summaryrefslogtreecommitdiffstats
path: root/tinyusb
diff options
context:
space:
mode:
authorWillian Paixao <willian@ufpa.br>2021-12-05 19:16:34 +0100
committerWillian Paixao <willian@ufpa.br>2021-12-05 19:16:34 +0100
commitac2e205ae9f465c27297ea542c72e8cfe4966f8c (patch)
tree16e4d1268b2631ba7e17dcda8f366f070fbd7475 /tinyusb
parentbbd394a19aaa334a179c36cf2ed2a066f1bb312c (diff)
downloadSensor-Watch-ac2e205ae9f465c27297ea542c72e8cfe4966f8c.tar.gz
Sensor-Watch-ac2e205ae9f465c27297ea542c72e8cfe4966f8c.tar.bz2
Sensor-Watch-ac2e205ae9f465c27297ea542c72e8cfe4966f8c.zip
remove tinyusb directory
Diffstat (limited to 'tinyusb')
-rwxr-xr-xtinyusb/.gitattributes25
-rwxr-xr-xtinyusb/.github/ISSUE_TEMPLATE/bug_report.yml74
-rwxr-xr-xtinyusb/.github/ISSUE_TEMPLATE/config.yml4
-rwxr-xr-xtinyusb/.github/ISSUE_TEMPLATE/feature_request.md14
-rwxr-xr-xtinyusb/.github/pull_request_template.md5
-rwxr-xr-xtinyusb/.github/workflows/build.yml144
-rwxr-xr-xtinyusb/.github/workflows/build_esp.yml35
-rwxr-xr-xtinyusb/.github/workflows/build_msp430.yml50
-rwxr-xr-xtinyusb/.github/workflows/build_renesas.yml51
-rwxr-xr-xtinyusb/.github/workflows/build_riscv.yml51
-rwxr-xr-xtinyusb/.github/workflows/trigger.yml58
-rwxr-xr-xtinyusb/.gitignore28
-rwxr-xr-xtinyusb/.gitmodules129
-rwxr-xr-xtinyusb/.readthedocs.yaml18
-rwxr-xr-xtinyusb/CODE_OF_CONDUCT.rst88
-rwxr-xr-xtinyusb/CONTRIBUTORS.rst189
-rwxr-xr-xtinyusb/LICENSE21
-rwxr-xr-xtinyusb/README.rst140
-rwxr-xr-xtinyusb/docs/assets/logo.svg18
-rwxr-xr-xtinyusb/docs/assets/stack.svg1
-rwxr-xr-xtinyusb/docs/conf.py42
l---------tinyusb/docs/contributing/code_of_conduct.rst1
-rwxr-xr-xtinyusb/docs/contributing/index.rst23
-rwxr-xr-xtinyusb/docs/contributing/porting.rst241
-rwxr-xr-xtinyusb/docs/contributing/structure.rst59
-rwxr-xr-xtinyusb/docs/index.rst25
-rwxr-xr-xtinyusb/docs/info/changelog.rst513
l---------tinyusb/docs/info/contributors.rst1
-rwxr-xr-xtinyusb/docs/info/index.rst13
-rwxr-xr-xtinyusb/docs/info/uses.rst17
-rwxr-xr-xtinyusb/docs/reference/concurrency.rst42
-rwxr-xr-xtinyusb/docs/reference/getting_started.rst153
-rwxr-xr-xtinyusb/docs/reference/index.rst59
-rwxr-xr-xtinyusb/docs/reference/supported.rst337
-rwxr-xr-xtinyusb/docs/requirements.txt4
-rwxr-xr-xtinyusb/examples/device/99-tinyusb.rules14
-rwxr-xr-xtinyusb/examples/device/CMakeLists.txt27
-rwxr-xr-xtinyusb/examples/device/audio_4_channel_mic/.skip.MCU_SAMD110
-rwxr-xr-xtinyusb/examples/device/audio_4_channel_mic/.skip.MCU_SAME5X0
-rwxr-xr-xtinyusb/examples/device/audio_4_channel_mic/.skip.MCU_SAMG0
-rwxr-xr-xtinyusb/examples/device/audio_4_channel_mic/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/device/audio_4_channel_mic/Makefile12
-rwxr-xr-xtinyusb/examples/device/audio_4_channel_mic/src/main.c458
-rwxr-xr-xtinyusb/examples/device/audio_4_channel_mic/src/plot_audio_samples.py34
-rwxr-xr-xtinyusb/examples/device/audio_4_channel_mic/src/tusb_config.h118
-rwxr-xr-xtinyusb/examples/device/audio_4_channel_mic/src/usb_descriptors.c160
-rwxr-xr-xtinyusb/examples/device/audio_test/.skip.MCU_SAMD110
-rwxr-xr-xtinyusb/examples/device/audio_test/.skip.MCU_SAME5X0
-rwxr-xr-xtinyusb/examples/device/audio_test/.skip.MCU_SAMG0
-rwxr-xr-xtinyusb/examples/device/audio_test/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/device/audio_test/Makefile12
-rwxr-xr-xtinyusb/examples/device/audio_test/src/main.c446
-rwxr-xr-xtinyusb/examples/device/audio_test/src/plot_audio_samples.py34
-rwxr-xr-xtinyusb/examples/device/audio_test/src/tusb_config.h111
-rwxr-xr-xtinyusb/examples/device/audio_test/src/usb_descriptors.c160
-rwxr-xr-xtinyusb/examples/device/board_test/CMakeLists.txt42
-rwxr-xr-xtinyusb/examples/device/board_test/Makefile18
-rwxr-xr-xtinyusb/examples/device/board_test/sdkconfig.defaults3
-rwxr-xr-xtinyusb/examples/device/board_test/src/CMakeLists.txt17
-rwxr-xr-xtinyusb/examples/device/board_test/src/main.c78
-rwxr-xr-xtinyusb/examples/device/board_test/src/tusb_config.h85
-rwxr-xr-xtinyusb/examples/device/cdc_dual_ports/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/device/cdc_dual_ports/Makefile12
-rwxr-xr-xtinyusb/examples/device/cdc_dual_ports/src/main.c100
-rwxr-xr-xtinyusb/examples/device/cdc_dual_ports/src/tusb_config.h115
-rwxr-xr-xtinyusb/examples/device/cdc_dual_ports/src/usb_descriptors.c211
-rwxr-xr-xtinyusb/examples/device/cdc_msc/.skip.MCU_SAMD110
-rwxr-xr-xtinyusb/examples/device/cdc_msc/CMakeLists.txt29
-rwxr-xr-xtinyusb/examples/device/cdc_msc/Makefile12
-rwxr-xr-xtinyusb/examples/device/cdc_msc/src/main.c165
-rwxr-xr-xtinyusb/examples/device/cdc_msc/src/msc_disk.c259
-rwxr-xr-xtinyusb/examples/device/cdc_msc/src/tusb_config.h119
-rwxr-xr-xtinyusb/examples/device/cdc_msc/src/usb_descriptors.c224
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/.skip.MCU_CXD560
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/.skip.MCU_EFM32GG120
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/.skip.MCU_GD32VF1030
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/.skip.MCU_MKL25ZXX0
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/.skip.MCU_MSP430x5xx0
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/.skip.MCU_RP20400
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/.skip.MCU_SAMD110
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/.skip.MCU_SAMX7X0
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/.skip.MCU_VALENTYUSB_EPTRI0
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/CMakeLists.txt22
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/Makefile29
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/sdkconfig.defaults3
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/src/CMakeLists.txt32
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/src/FreeRTOSConfig.h182
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/src/freertos_hook.c114
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/src/main.c230
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/src/msc_disk.c249
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/src/tusb_config.h119
-rwxr-xr-xtinyusb/examples/device/cdc_msc_freertos/src/usb_descriptors.c211
-rwxr-xr-xtinyusb/examples/device/dfu/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/device/dfu/Makefile12
-rwxr-xr-xtinyusb/examples/device/dfu/src/main.c219
-rwxr-xr-xtinyusb/examples/device/dfu/src/tusb_config.h89
-rwxr-xr-xtinyusb/examples/device/dfu/src/usb_descriptors.c171
-rwxr-xr-xtinyusb/examples/device/dfu_runtime/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/device/dfu_runtime/Makefile12
-rwxr-xr-xtinyusb/examples/device/dfu_runtime/src/main.c135
-rwxr-xr-xtinyusb/examples/device/dfu_runtime/src/tusb_config.h87
-rwxr-xr-xtinyusb/examples/device/dfu_runtime/src/usb_descriptors.c166
-rwxr-xr-xtinyusb/examples/device/dynamic_configuration/.skip.MCU_SAMD110
-rwxr-xr-xtinyusb/examples/device/dynamic_configuration/CMakeLists.txt29
-rwxr-xr-xtinyusb/examples/device/dynamic_configuration/Makefile12
-rwxr-xr-xtinyusb/examples/device/dynamic_configuration/src/main.c217
-rwxr-xr-xtinyusb/examples/device/dynamic_configuration/src/msc_disk.c249
-rwxr-xr-xtinyusb/examples/device/dynamic_configuration/src/tusb_config.h119
-rwxr-xr-xtinyusb/examples/device/dynamic_configuration/src/usb_descriptors.c243
-rwxr-xr-xtinyusb/examples/device/hid_boot_interface/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/device/hid_boot_interface/Makefile15
-rwxr-xr-xtinyusb/examples/device/hid_boot_interface/src/main.c255
-rwxr-xr-xtinyusb/examples/device/hid_boot_interface/src/tusb_config.h111
-rwxr-xr-xtinyusb/examples/device/hid_boot_interface/src/usb_descriptors.c180
-rwxr-xr-xtinyusb/examples/device/hid_boot_interface/src/usb_descriptors.h35
-rwxr-xr-xtinyusb/examples/device/hid_composite/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/device/hid_composite/Makefile12
-rwxr-xr-xtinyusb/examples/device/hid_composite/src/main.c302
-rwxr-xr-xtinyusb/examples/device/hid_composite/src/tusb_config.h111
-rwxr-xr-xtinyusb/examples/device/hid_composite/src/usb_descriptors.c174
-rwxr-xr-xtinyusb/examples/device/hid_composite/src/usb_descriptors.h37
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/.skip.MCU_CXD560
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/.skip.MCU_EFM32GG120
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/.skip.MCU_GD32VF1030
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/.skip.MCU_MSP430x5xx0
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/.skip.MCU_RP20400
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/.skip.MCU_SAMD110
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/.skip.MCU_SAMX7X0
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/.skip.MCU_VALENTYUSB_EPTRI0
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/CMakeLists.txt17
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/Makefile29
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/sdkconfig.defaults3
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/src/CMakeLists.txt32
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/src/FreeRTOSConfig.h182
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/src/freertos_hook.c114
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/src/main.c355
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/src/tusb_config.h110
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/src/usb_descriptors.c174
-rwxr-xr-xtinyusb/examples/device/hid_composite_freertos/src/usb_descriptors.h37
-rwxr-xr-xtinyusb/examples/device/hid_generic_inout/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/device/hid_generic_inout/Makefile12
-rwxr-xr-xtinyusb/examples/device/hid_generic_inout/boards.js4
-rwxr-xr-xtinyusb/examples/device/hid_generic_inout/hid_test.js68
-rwxr-xr-xtinyusb/examples/device/hid_generic_inout/hid_test.py20
-rwxr-xr-xtinyusb/examples/device/hid_generic_inout/src/main.c171
-rwxr-xr-xtinyusb/examples/device/hid_generic_inout/src/tusb_config.h111
-rwxr-xr-xtinyusb/examples/device/hid_generic_inout/src/usb_descriptors.c170
-rwxr-xr-xtinyusb/examples/device/hid_multiple_interface/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/device/hid_multiple_interface/Makefile12
-rwxr-xr-xtinyusb/examples/device/hid_multiple_interface/src/main.c207
-rwxr-xr-xtinyusb/examples/device/hid_multiple_interface/src/tusb_config.h111
-rwxr-xr-xtinyusb/examples/device/hid_multiple_interface/src/usb_descriptors.c188
-rwxr-xr-xtinyusb/examples/device/midi_test/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/device/midi_test/Makefile12
-rwxr-xr-xtinyusb/examples/device/midi_test/src/main.c177
-rwxr-xr-xtinyusb/examples/device/midi_test/src/tusb_config.h112
-rwxr-xr-xtinyusb/examples/device/midi_test/src/usb_descriptors.c177
-rwxr-xr-xtinyusb/examples/device/msc_dual_lun/.skip.MCU_MKL25ZXX0
-rwxr-xr-xtinyusb/examples/device/msc_dual_lun/.skip.MCU_SAMD110
-rwxr-xr-xtinyusb/examples/device/msc_dual_lun/CMakeLists.txt29
-rwxr-xr-xtinyusb/examples/device/msc_dual_lun/Makefile12
-rwxr-xr-xtinyusb/examples/device/msc_dual_lun/src/main.c113
-rwxr-xr-xtinyusb/examples/device/msc_dual_lun/src/msc_disk_dual.c349
-rwxr-xr-xtinyusb/examples/device/msc_dual_lun/src/tusb_config.h111
-rwxr-xr-xtinyusb/examples/device/msc_dual_lun/src/usb_descriptors.c185
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/.skip.MCU_LPC11UXX0
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/.skip.MCU_LPC13XX0
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/.skip.MCU_MKL25ZXX0
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/.skip.MCU_MSP430x5xx1
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/.skip.MCU_NUC1210
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/.skip.MCU_SAMD110
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/.skip.MCU_STM32L00
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/CMakeLists.txt81
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/Makefile61
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/src/arch/cc.h75
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/src/lwipopts.h59
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/src/main.c247
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/src/tusb_config.h109
-rwxr-xr-xtinyusb/examples/device/net_lwip_webserver/src/usb_descriptors.c224
-rwxr-xr-xtinyusb/examples/device/uac2_headset/.skip.MCU_LPC11UXX0
-rwxr-xr-xtinyusb/examples/device/uac2_headset/.skip.MCU_LPC13XX0
-rwxr-xr-xtinyusb/examples/device/uac2_headset/.skip.MCU_NUC1210
-rwxr-xr-xtinyusb/examples/device/uac2_headset/.skip.MCU_SAMD110
-rwxr-xr-xtinyusb/examples/device/uac2_headset/.skip.MCU_SAME5X0
-rwxr-xr-xtinyusb/examples/device/uac2_headset/.skip.MCU_SAMG0
-rwxr-xr-xtinyusb/examples/device/uac2_headset/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/device/uac2_headset/Makefile12
-rwxr-xr-xtinyusb/examples/device/uac2_headset/src/main.c441
-rwxr-xr-xtinyusb/examples/device/uac2_headset/src/tusb_config.h159
-rwxr-xr-xtinyusb/examples/device/uac2_headset/src/usb_descriptors.c168
-rwxr-xr-xtinyusb/examples/device/uac2_headset/src/usb_descriptors.h155
-rwxr-xr-xtinyusb/examples/device/usbtmc/CMakeLists.txt29
-rwxr-xr-xtinyusb/examples/device/usbtmc/Makefile12
-rwxr-xr-xtinyusb/examples/device/usbtmc/src/main.c143
-rwxr-xr-xtinyusb/examples/device/usbtmc/src/main.h5
-rwxr-xr-xtinyusb/examples/device/usbtmc/src/tusb_config.h89
-rwxr-xr-xtinyusb/examples/device/usbtmc/src/usb_descriptors.c194
-rwxr-xr-xtinyusb/examples/device/usbtmc/src/usbtmc_app.c329
-rwxr-xr-xtinyusb/examples/device/usbtmc/src/usbtmc_app.h7
-rwxr-xr-xtinyusb/examples/device/usbtmc/visaQuery.py209
-rwxr-xr-xtinyusb/examples/device/webusb_serial/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/device/webusb_serial/Makefile12
-rwxr-xr-xtinyusb/examples/device/webusb_serial/src/main.c300
-rwxr-xr-xtinyusb/examples/device/webusb_serial/src/tusb_config.h118
-rwxr-xr-xtinyusb/examples/device/webusb_serial/src/usb_descriptors.c252
-rwxr-xr-xtinyusb/examples/device/webusb_serial/src/usb_descriptors.h36
-rwxr-xr-xtinyusb/examples/host/CMakeLists.txt9
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC175X_6X0
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC177X_8X0
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC18XX0
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC40XX0
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC43XX0
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/.only.MCU_MIMXRT10XX0
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/.only.MCU_RP20400
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/CMakeLists.txt29
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/Makefile27
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/src/hid_app.c296
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/src/main.c128
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/src/msc_app.c106
-rwxr-xr-xtinyusb/examples/host/cdc_msc_hid/src/tusb_config.h94
-rwxr-xr-xtinyusb/examples/host/hid_controller/.only.MCU_LPC175X_6X0
-rwxr-xr-xtinyusb/examples/host/hid_controller/.only.MCU_LPC177X_8X0
-rwxr-xr-xtinyusb/examples/host/hid_controller/.only.MCU_LPC18XX0
-rwxr-xr-xtinyusb/examples/host/hid_controller/.only.MCU_LPC40XX0
-rwxr-xr-xtinyusb/examples/host/hid_controller/.only.MCU_LPC43XX0
-rwxr-xr-xtinyusb/examples/host/hid_controller/.only.MCU_MIMXRT10XX0
-rwxr-xr-xtinyusb/examples/host/hid_controller/.only.MCU_RP20400
-rwxr-xr-xtinyusb/examples/host/hid_controller/CMakeLists.txt28
-rwxr-xr-xtinyusb/examples/host/hid_controller/Makefile30
-rwxr-xr-xtinyusb/examples/host/hid_controller/src/hid_app.c249
-rwxr-xr-xtinyusb/examples/host/hid_controller/src/main.c93
-rwxr-xr-xtinyusb/examples/host/hid_controller/src/tusb_config.h95
-rwxr-xr-xtinyusb/examples/make.mk132
-rwxr-xr-xtinyusb/examples/rules.mk204
-rwxr-xr-xtinyusb/hw/bsp/ansi_escape.h97
-rwxr-xr-xtinyusb/hw/bsp/board.c147
-rwxr-xr-xtinyusb/hw/bsp/board.h147
-rwxr-xr-xtinyusb/hw/bsp/board_mcu.h142
-rwxr-xr-xtinyusb/hw/bsp/d5035_01/board.mk58
-rwxr-xr-xtinyusb/hw/bsp/d5035_01/d5035_01.c353
-rwxr-xr-xtinyusb/hw/bsp/d5035_01/same51j19a_flash.ld163
-rwxr-xr-xtinyusb/hw/bsp/da14695_dk_usb/board.mk55
-rwxr-xr-xtinyusb/hw/bsp/da14695_dk_usb/da14695_dk_usb.c127
-rwxr-xr-xtinyusb/hw/bsp/da14695_dk_usb/da1469x.ld245
-rwxr-xr-xtinyusb/hw/bsp/da14695_dk_usb/gcc_startup_da1469x.S301
-rwxr-xr-xtinyusb/hw/bsp/da14695_dk_usb/product_header.dumpbin8192 -> 0 bytes
-rwxr-xr-xtinyusb/hw/bsp/da14695_dk_usb/syscfg/syscfg.h34
-rwxr-xr-xtinyusb/hw/bsp/da1469x_dk_pro/board.mk55
-rwxr-xr-xtinyusb/hw/bsp/da1469x_dk_pro/da1469x-dk-pro.c127
-rwxr-xr-xtinyusb/hw/bsp/da1469x_dk_pro/da1469x.ld245
-rwxr-xr-xtinyusb/hw/bsp/da1469x_dk_pro/gcc_startup_da1469x.S301
-rwxr-xr-xtinyusb/hw/bsp/da1469x_dk_pro/product_header.dumpbin8192 -> 0 bytes
-rwxr-xr-xtinyusb/hw/bsp/da1469x_dk_pro/syscfg/syscfg.h34
-rwxr-xr-xtinyusb/hw/bsp/ea4088qs/board.mk46
-rwxr-xr-xtinyusb/hw/bsp/ea4088qs/ea4088qs.c190
-rwxr-xr-xtinyusb/hw/bsp/ea4088qs/lpc4088.ld184
-rwxr-xr-xtinyusb/hw/bsp/ea4357/board.mk46
-rwxr-xr-xtinyusb/hw/bsp/ea4357/ea4357.c291
-rwxr-xr-xtinyusb/hw/bsp/ea4357/lpc4357.ld324
-rwxr-xr-xtinyusb/hw/bsp/ea4357/pca9532.c352
-rwxr-xr-xtinyusb/hw/bsp/ea4357/pca9532.h94
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/boards/CMakeLists.txt14
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/boards/adafruit_feather_esp32s2/board.cmake17
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/boards/adafruit_feather_esp32s2/board.h45
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/boards/adafruit_magtag_29gray/board.cmake17
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/boards/adafruit_magtag_29gray/board.h45
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/boards/adafruit_metro_esp32s2/board.cmake17
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/boards/adafruit_metro_esp32s2/board.h43
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/boards/esp32s2.c143
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/boards/espressif_kaluga_1/board.cmake17
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/boards/espressif_kaluga_1/board.h44
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/boards/espressif_saola_1/board.cmake17
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/boards/espressif_saola_1/board.h45
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/components/led_strip/CMakeLists.txt8
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/components/led_strip/include/led_strip.h126
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/components/led_strip/src/led_strip_rmt_ws2812.c171
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/family.cmake7
-rwxr-xr-xtinyusb/hw/bsp/esp32s2/family.mk26
-rwxr-xr-xtinyusb/hw/bsp/esp32s3/boards/CMakeLists.txt14
-rwxr-xr-xtinyusb/hw/bsp/esp32s3/boards/esp32s3.c143
-rwxr-xr-xtinyusb/hw/bsp/esp32s3/boards/espressif_addax_1/board.cmake17
-rwxr-xr-xtinyusb/hw/bsp/esp32s3/boards/espressif_addax_1/board.h44
-rwxr-xr-xtinyusb/hw/bsp/esp32s3/components/led_strip/CMakeLists.txt8
-rwxr-xr-xtinyusb/hw/bsp/esp32s3/components/led_strip/include/led_strip.h126
-rwxr-xr-xtinyusb/hw/bsp/esp32s3/components/led_strip/src/led_strip_rmt_ws2812.c171
-rwxr-xr-xtinyusb/hw/bsp/esp32s3/family.cmake7
-rwxr-xr-xtinyusb/hw/bsp/esp32s3/family.mk26
-rwxr-xr-xtinyusb/hw/bsp/family_support.cmake71
-rwxr-xr-xtinyusb/hw/bsp/fomu/boards/fomu/board.h40
-rwxr-xr-xtinyusb/hw/bsp/fomu/boards/fomu/board.mk1
-rwxr-xr-xtinyusb/hw/bsp/fomu/crt0-vexriscv.S83
-rwxr-xr-xtinyusb/hw/bsp/fomu/dfu.py95
-rwxr-xr-xtinyusb/hw/bsp/fomu/family.mk30
-rwxr-xr-xtinyusb/hw/bsp/fomu/fomu.c115
-rwxr-xr-xtinyusb/hw/bsp/fomu/fomu.ld104
-rwxr-xr-xtinyusb/hw/bsp/fomu/include/csr.h750
-rwxr-xr-xtinyusb/hw/bsp/fomu/include/hw/common.h33
-rwxr-xr-xtinyusb/hw/bsp/fomu/include/irq.h71
-rwxr-xr-xtinyusb/hw/bsp/fomu/output_format.ld1
-rwxr-xr-xtinyusb/hw/bsp/fomu/regions.ld6
-rwxr-xr-xtinyusb/hw/bsp/frdm_k32l2b/board.h56
-rwxr-xr-xtinyusb/hw/bsp/frdm_k32l2b/board.mk51
-rwxr-xr-xtinyusb/hw/bsp/frdm_k32l2b/frdm_k32l2b.c140
-rwxr-xr-xtinyusb/hw/bsp/frdm_kl25z/board.mk46
-rwxr-xr-xtinyusb/hw/bsp/frdm_kl25z/frdm_kl25z.c148
-rwxr-xr-xtinyusb/hw/bsp/gd32vf103/boards/sipeed_longan_nano/board.h20
-rwxr-xr-xtinyusb/hw/bsp/gd32vf103/boards/sipeed_longan_nano/board.mk13
-rwxr-xr-xtinyusb/hw/bsp/gd32vf103/family.c197
-rwxr-xr-xtinyusb/hw/bsp/gd32vf103/family.mk68
-rwxr-xr-xtinyusb/hw/bsp/gd32vf103/system_gd32vf103.c668
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/board.h53
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/evkmimxrt1010_flexspi_nor_config.c48
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/evkmimxrt1010_flexspi_nor_config.h267
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/board.h51
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/evkmimxrt1015_flexspi_nor_config.c48
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/evkmimxrt1015_flexspi_nor_config.h268
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/board.h51
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/evkmimxrt1020_flexspi_nor_config.c49
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/evkmimxrt1020_flexspi_nor_config.h268
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/board.h51
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/board.mk8
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/evkbimxrt1050_flexspi_nor_config.c55
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/evkbimxrt1050_flexspi_nor_config.h269
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/board.h51
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/evkmimxrt1060_flexspi_nor_config.c49
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/evkmimxrt1060_flexspi_nor_config.h268
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/board.h52
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/evkmimxrt1064_flexspi_nor_config.c49
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/evkmimxrt1064_flexspi_nor_config.h268
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/teensy_40/board.h52
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/teensy_40/board.mk10
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/teensy_40/teensy40_flexspi_nor_config.c49
-rwxr-xr-xtinyusb/hw/bsp/imxrt/boards/teensy_40/teensy40_flexspi_nor_config.h268
-rwxr-xr-xtinyusb/hw/bsp/imxrt/family.c190
-rwxr-xr-xtinyusb/hw/bsp/imxrt/family.mk54
-rwxr-xr-xtinyusb/hw/bsp/lpc15/boards/lpcxpresso1549/board.h72
-rwxr-xr-xtinyusb/hw/bsp/lpc15/boards/lpcxpresso1549/board.mk6
-rwxr-xr-xtinyusb/hw/bsp/lpc15/boards/lpcxpresso1549/lpc1549.ld246
-rwxr-xr-xtinyusb/hw/bsp/lpc15/family.c130
-rwxr-xr-xtinyusb/hw/bsp/lpc15/family.mk39
-rwxr-xr-xtinyusb/hw/bsp/lpc18/boards/lpcxpresso18s37/board.h77
-rwxr-xr-xtinyusb/hw/bsp/lpc18/boards/lpcxpresso18s37/board.mk6
-rwxr-xr-xtinyusb/hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld404
-rwxr-xr-xtinyusb/hw/bsp/lpc18/boards/mcb1800/board.h94
-rwxr-xr-xtinyusb/hw/bsp/lpc18/boards/mcb1800/board.mk7
-rwxr-xr-xtinyusb/hw/bsp/lpc18/boards/mcb1800/lpc1857.ld323
-rwxr-xr-xtinyusb/hw/bsp/lpc18/family.c159
-rwxr-xr-xtinyusb/hw/bsp/lpc18/family.mk35
-rwxr-xr-xtinyusb/hw/bsp/lpc54/boards/lpcxpresso54114/board.h59
-rwxr-xr-xtinyusb/hw/bsp/lpc54/boards/lpcxpresso54114/board.mk13
-rwxr-xr-xtinyusb/hw/bsp/lpc54/boards/lpcxpresso54628/board.h59
-rwxr-xr-xtinyusb/hw/bsp/lpc54/boards/lpcxpresso54628/board.mk18
-rwxr-xr-xtinyusb/hw/bsp/lpc54/family.c228
-rwxr-xr-xtinyusb/hw/bsp/lpc54/family.mk54
-rwxr-xr-xtinyusb/hw/bsp/lpc55/boards/double_m33_express/LPC55S69_cm33_core0_uf2.ld234
-rwxr-xr-xtinyusb/hw/bsp/lpc55/boards/double_m33_express/board.h63
-rwxr-xr-xtinyusb/hw/bsp/lpc55/boards/double_m33_express/board.mk12
-rwxr-xr-xtinyusb/hw/bsp/lpc55/boards/lpcxpresso55s28/board.h56
-rwxr-xr-xtinyusb/hw/bsp/lpc55/boards/lpcxpresso55s28/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/lpc55/boards/lpcxpresso55s69/board.h56
-rwxr-xr-xtinyusb/hw/bsp/lpc55/boards/lpcxpresso55s69/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/lpc55/boards/mcu_link/board.h56
-rwxr-xr-xtinyusb/hw/bsp/lpc55/boards/mcu_link/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/lpc55/family.c283
-rwxr-xr-xtinyusb/hw/bsp/lpc55/family.mk67
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso11u37/board.mk45
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso11u37/lpc11u37.ld195
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c208
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso11u68/board.mk42
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso11u68/lpc11u68.ld242
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso11u68/lpcxpresso11u68.c135
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso1347/board.mk44
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso1347/lpc1347.ld225
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso1347/lpcxpresso1347.c152
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso1769/board.mk43
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso1769/lpc1769.ld184
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso1769/lpcxpresso1769.c209
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso51u68/board.mk52
-rwxr-xr-xtinyusb/hw/bsp/lpcxpresso51u68/lpcxpresso51u68.c179
-rwxr-xr-xtinyusb/hw/bsp/mbed1768/board.mk45
-rwxr-xr-xtinyusb/hw/bsp/mbed1768/lpc1768.ld184
-rwxr-xr-xtinyusb/hw/bsp/mbed1768/mbed1768.c197
-rwxr-xr-xtinyusb/hw/bsp/msp430/boards/msp_exp430f5529lp/board.h46
-rwxr-xr-xtinyusb/hw/bsp/msp430/family.c218
-rwxr-xr-xtinyusb/hw/bsp/msp430/family.mk35
-rwxr-xr-xtinyusb/hw/bsp/ngx4330/board.mk45
-rwxr-xr-xtinyusb/hw/bsp/ngx4330/ngx4330.c264
-rwxr-xr-xtinyusb/hw/bsp/ngx4330/ngx4330.ld343
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/adafruit_clue/board.h52
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/adafruit_clue/board.mk10
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/adafruit_clue/nrf52840_s140_v6.ld38
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/arduino_nano33_ble/arduino_nano33_ble.ld32
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/arduino_nano33_ble/board.h52
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/arduino_nano33_ble/board.mk13
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/circuitplayground_bluefruit/board.h52
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/circuitplayground_bluefruit/board.mk10
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/circuitplayground_bluefruit/nrf52840_s140_v6.ld38
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/feather_nrf52840_express/board.h52
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/feather_nrf52840_express/board.mk10
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/feather_nrf52840_express/nrf52840_s140_v6.ld38
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/feather_nrf52840_sense/board.h52
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/feather_nrf52840_sense/board.mk10
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/feather_nrf52840_sense/nrf52840_s140_v6.ld38
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/itsybitsy_nrf52840/board.h52
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/itsybitsy_nrf52840/board.mk10
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/itsybitsy_nrf52840/nrf52840_s140_v6.ld38
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/nrf52840_mdk_dongle/board.h52
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/nrf52840_mdk_dongle/board.mk15
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/nrf52840_mdk_dongle/nrf52840_mdk_dongle.ld13
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/pca10056/board.h50
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/pca10056/board.mk7
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/pca10059/board.h52
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/pca10059/board.mk15
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/pca10059/pca10059.ld13
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/pca10100/board.h52
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/pca10100/board.mk7
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/raytac_mdbt50q_rx/board.h52
-rwxr-xr-xtinyusb/hw/bsp/nrf/boards/raytac_mdbt50q_rx/board.mk7
-rwxr-xr-xtinyusb/hw/bsp/nrf/family.c224
-rwxr-xr-xtinyusb/hw/bsp/nrf/family.mk60
-rwxr-xr-xtinyusb/hw/bsp/nutiny_nuc121s/board.mk55
-rwxr-xr-xtinyusb/hw/bsp/nutiny_nuc121s/nuc121_flash.ld195
-rwxr-xr-xtinyusb/hw/bsp/nutiny_nuc121s/nutiny_nuc121.c121
-rwxr-xr-xtinyusb/hw/bsp/nutiny_nuc125s/board.mk39
-rwxr-xr-xtinyusb/hw/bsp/nutiny_nuc125s/nuc125_flash.ld195
-rwxr-xr-xtinyusb/hw/bsp/nutiny_nuc125s/nutiny_nuc125.c121
-rwxr-xr-xtinyusb/hw/bsp/nutiny_nuc126v/board.mk59
-rwxr-xr-xtinyusb/hw/bsp/nutiny_nuc126v/nuc126_flash.ld195
-rwxr-xr-xtinyusb/hw/bsp/nutiny_nuc126v/nutiny_nuc126.c153
-rwxr-xr-xtinyusb/hw/bsp/nutiny_sdk_nuc120/board.mk55
-rwxr-xr-xtinyusb/hw/bsp/nutiny_sdk_nuc120/nuc120_flash.ld195
-rwxr-xr-xtinyusb/hw/bsp/nutiny_sdk_nuc120/nutiny_sdk_nuc120.c133
-rwxr-xr-xtinyusb/hw/bsp/nutiny_sdk_nuc505/board.mk60
-rwxr-xr-xtinyusb/hw/bsp/nutiny_sdk_nuc505/nuc505_flashtoram.ld199
-rwxr-xr-xtinyusb/hw/bsp/nutiny_sdk_nuc505/nutiny_sdk_nuc505.c129
-rwxr-xr-xtinyusb/hw/bsp/rp2040/board.h53
-rwxr-xr-xtinyusb/hw/bsp/rp2040/boards/adafruit_feather_rp2040/board.cmake1
-rwxr-xr-xtinyusb/hw/bsp/rp2040/boards/adafruit_itsybitsy_rp2040/board.cmake1
-rwxr-xr-xtinyusb/hw/bsp/rp2040/boards/adafruit_qtpy_rp2040/board.cmake1
-rwxr-xr-xtinyusb/hw/bsp/rp2040/boards/pico_sdk/board.cmake1
-rwxr-xr-xtinyusb/hw/bsp/rp2040/boards/raspberry_pi_pico/board.cmake1
-rwxr-xr-xtinyusb/hw/bsp/rp2040/family.c199
-rwxr-xr-xtinyusb/hw/bsp/rp2040/family.cmake154
-rwxr-xr-xtinyusb/hw/bsp/rp2040/family.mk19
-rwxr-xr-xtinyusb/hw/bsp/rp2040/pico_sdk_import.cmake62
-rwxr-xr-xtinyusb/hw/bsp/rx/boards/gr_citrus/board.mk24
-rwxr-xr-xtinyusb/hw/bsp/rx/boards/gr_citrus/gr_citrus.c275
-rwxr-xr-xtinyusb/hw/bsp/rx/boards/gr_citrus/hwinit.c31
-rwxr-xr-xtinyusb/hw/bsp/rx/boards/gr_citrus/r5f5631fd.ld127
-rwxr-xr-xtinyusb/hw/bsp/rx/boards/rx65n_target/board.mk25
-rwxr-xr-xtinyusb/hw/bsp/rx/boards/rx65n_target/r5f565ne.ld168
-rwxr-xr-xtinyusb/hw/bsp/rx/boards/rx65n_target/rx65n_target.c320
-rwxr-xr-xtinyusb/hw/bsp/rx/family.mk32
-rwxr-xr-xtinyusb/hw/bsp/samd11/boards/luna_d11/board.h46
-rwxr-xr-xtinyusb/hw/bsp/samd11/boards/luna_d11/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/samd11/boards/luna_d11/samd11d14am_flash.ld144
-rwxr-xr-xtinyusb/hw/bsp/samd11/boards/samd11_xplained/board.h46
-rwxr-xr-xtinyusb/hw/bsp/samd11/boards/samd11_xplained/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/samd11/boards/samd11_xplained/samd11d14am_flash.ld144
-rwxr-xr-xtinyusb/hw/bsp/samd11/family.c150
-rwxr-xr-xtinyusb/hw/bsp/samd11/family.mk37
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/atsamd21_xpro/board.h50
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/atsamd21_xpro/board.mk10
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/atsamd21_xpro/samd21j18a_flash.ld144
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/circuitplayground_express/board.h50
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/circuitplayground_express/board.mk9
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/circuitplayground_express/circuitplayground_express.ld146
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/feather_m0_express/board.h50
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/feather_m0_express/board.mk9
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/feather_m0_express/feather_m0_express.ld146
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/itsybitsy_m0/board.h50
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/itsybitsy_m0/board.mk9
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/itsybitsy_m0/itsybitsy_m0.ld146
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/luna_d21/board.h46
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/luna_d21/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/luna_d21/samd21g18a_flash.ld144
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/metro_m0_express/board.h50
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/metro_m0_express/board.mk9
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/metro_m0_express/metro_m0_express.ld146
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/seeeduino_xiao/board.h50
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/seeeduino_xiao/board.mk9
-rwxr-xr-xtinyusb/hw/bsp/samd21/boards/seeeduino_xiao/seeeduino_xiao.ld146
-rwxr-xr-xtinyusb/hw/bsp/samd21/family.c153
-rwxr-xr-xtinyusb/hw/bsp/samd21/family.mk46
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/feather_m4_express/board.h50
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/feather_m4_express/board.mk8
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/feather_m4_express/feather_m4_express.ld166
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/itsybitsy_m4/board.h50
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/itsybitsy_m4/board.mk9
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/itsybitsy_m4/itsybitsy_m4.ld166
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/metro_m4_express/board.h50
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/metro_m4_express/board.mk10
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/metro_m4_express/metro_m4_express.ld166
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/pybadge/board.h50
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/pybadge/board.mk8
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/pybadge/pybadge.ld166
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/pyportal/board.h50
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/pyportal/board.mk8
-rwxr-xr-xtinyusb/hw/bsp/samd51/boards/pyportal/pyportal.ld166
-rwxr-xr-xtinyusb/hw/bsp/samd51/family.c162
-rwxr-xr-xtinyusb/hw/bsp/samd51/family.mk49
-rwxr-xr-xtinyusb/hw/bsp/same54xplainedpro/board.mk46
-rwxr-xr-xtinyusb/hw/bsp/same54xplainedpro/same54p20a_flash.ld163
-rwxr-xr-xtinyusb/hw/bsp/same54xplainedpro/same54p20a_sram.ld162
-rwxr-xr-xtinyusb/hw/bsp/same54xplainedpro/same54xplainedpro.c306
-rwxr-xr-xtinyusb/hw/bsp/same70_xplained/board.mk56
-rwxr-xr-xtinyusb/hw/bsp/same70_xplained/hpl_pmc_config.h1053
-rwxr-xr-xtinyusb/hw/bsp/same70_xplained/hpl_usart_config.h215
-rwxr-xr-xtinyusb/hw/bsp/same70_xplained/hpl_xdmac_config.h4400
-rwxr-xr-xtinyusb/hw/bsp/same70_xplained/peripheral_clk_config.h126
-rwxr-xr-xtinyusb/hw/bsp/same70_xplained/same70_xplained.c156
-rwxr-xr-xtinyusb/hw/bsp/samg55xplained/board.mk52
-rwxr-xr-xtinyusb/hw/bsp/samg55xplained/hpl_usart_config.h215
-rwxr-xr-xtinyusb/hw/bsp/samg55xplained/peripheral_clk_config.h85
-rwxr-xr-xtinyusb/hw/bsp/samg55xplained/samg55j19_flash.ld158
-rwxr-xr-xtinyusb/hw/bsp/samg55xplained/samg55xplained.c157
-rwxr-xr-xtinyusb/hw/bsp/saml2x/boards/atsaml21_xpro/board.h50
-rwxr-xr-xtinyusb/hw/bsp/saml2x/boards/atsaml21_xpro/board.mk12
-rwxr-xr-xtinyusb/hw/bsp/saml2x/boards/atsaml21_xpro/saml21j18b_flash.ld153
-rwxr-xr-xtinyusb/hw/bsp/saml2x/boards/saml22_feather/board.h47
-rwxr-xr-xtinyusb/hw/bsp/saml2x/boards/saml22_feather/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/saml2x/boards/saml22_feather/saml22_feather.ld146
-rwxr-xr-xtinyusb/hw/bsp/saml2x/boards/sensorwatch_m0/board.h47
-rwxr-xr-xtinyusb/hw/bsp/saml2x/boards/sensorwatch_m0/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/saml2x/boards/sensorwatch_m0/sensorwatch_m0.ld146
-rwxr-xr-xtinyusb/hw/bsp/saml2x/family.c163
-rwxr-xr-xtinyusb/hw/bsp/saml2x/family.mk48
-rwxr-xr-xtinyusb/hw/bsp/sltb009a/board.mk47
-rwxr-xr-xtinyusb/hw/bsp/sltb009a/sltb009a.c721
-rwxr-xr-xtinyusb/hw/bsp/spresense/board.mk73
-rwxr-xr-xtinyusb/hw/bsp/spresense/board_spresense.c105
-rwxr-xr-xtinyusb/hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.h93
-rwxr-xr-xtinyusb/hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/stm32f0/boards/stm32f070rbnucleo/stm32F070rbtx_flash.ld200
-rwxr-xr-xtinyusb/hw/bsp/stm32f0/boards/stm32f072disco/STM32F072RBTx_FLASH.ld169
-rwxr-xr-xtinyusb/hw/bsp/stm32f0/boards/stm32f072disco/board.h85
-rwxr-xr-xtinyusb/hw/bsp/stm32f0/boards/stm32f072disco/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/stm32f0/boards/stm32f072eval/STM32F072VBTx_FLASH.ld177
-rwxr-xr-xtinyusb/hw/bsp/stm32f0/boards/stm32f072eval/board.h102
-rwxr-xr-xtinyusb/hw/bsp/stm32f0/boards/stm32f072eval/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/stm32f0/family.c179
-rwxr-xr-xtinyusb/hw/bsp/stm32f0/family.mk40
-rwxr-xr-xtinyusb/hw/bsp/stm32f0/stm32f0xx_hal_conf.h321
-rwxr-xr-xtinyusb/hw/bsp/stm32f1/boards/stm32f103_bluepill/STM32F103X8_FLASH.ld167
-rwxr-xr-xtinyusb/hw/bsp/stm32f1/boards/stm32f103_bluepill/board.h92
-rwxr-xr-xtinyusb/hw/bsp/stm32f1/boards/stm32f103_bluepill/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/stm32f1/boards/stm32f103_mini_2/STM32F103XC_FLASH.ld167
-rwxr-xr-xtinyusb/hw/bsp/stm32f1/boards/stm32f103_mini_2/board.h92
-rwxr-xr-xtinyusb/hw/bsp/stm32f1/boards/stm32f103_mini_2/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/stm32f1/family.c167
-rwxr-xr-xtinyusb/hw/bsp/stm32f1/family.mk45
-rwxr-xr-xtinyusb/hw/bsp/stm32f1/stm32f1xx_hal_conf.h379
-rwxr-xr-xtinyusb/hw/bsp/stm32f207nucleo/STM32F207ZGTx_FLASH.ld169
-rwxr-xr-xtinyusb/hw/bsp/stm32f207nucleo/board.mk48
-rwxr-xr-xtinyusb/hw/bsp/stm32f207nucleo/stm32f207nucleo.c213
-rwxr-xr-xtinyusb/hw/bsp/stm32f207nucleo/stm32f2xx_hal_conf.h407
-rwxr-xr-xtinyusb/hw/bsp/stm32f303disco/STM32F303VCTx_FLASH.ld189
-rwxr-xr-xtinyusb/hw/bsp/stm32f303disco/board.mk49
-rwxr-xr-xtinyusb/hw/bsp/stm32f303disco/stm32f303disco.c215
-rwxr-xr-xtinyusb/hw/bsp/stm32f303disco/stm32f3xx_hal_conf.h357
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/STM32F405RGTx_FLASH.ld189
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/board.h104
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/board.mk12
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/stm32f4xx_hal_conf.h491
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/pyboardv11/STM32F405RGTx_FLASH.ld189
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/pyboardv11/board.h102
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/pyboardv11/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/pyboardv11/stm32f4xx_hal_conf.h491
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/STM32F401VCTx_FLASH.ld169
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/board.h106
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/board.mk12
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/stm32f4xx_hal_conf.h493
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f407disco/STM32F407VGTx_FLASH.ld189
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f407disco/board.h105
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f407disco/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f407disco/stm32f4xx_hal_conf.h493
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/STM32F411CEUx_FLASH.ld169
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/board.h106
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/board.mk12
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/stm32f4xx_hal_conf.h493
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f411disco/STM32F411VETx_FLASH.ld169
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f411disco/board.h104
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f411disco/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f411disco/stm32f4xx_hal_conf.h493
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f412disco/STM32F412ZGTx_FLASH.ld169
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f412disco/board.h118
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f412disco/board.mk11
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/boards/stm32f412disco/stm32f4xx_hal_conf.h493
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/family.c191
-rwxr-xr-xtinyusb/hw/bsp/stm32f4/family.mk43
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/STM32F723xE_FLASH.ld167
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/board.h101
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/board.mk14
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/stm32f7xx_hal_conf.h472
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f723disco/STM32F723xE_FLASH.ld167
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f723disco/board.h105
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f723disco/board.mk12
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f723disco/stm32f7xx_hal_conf.h472
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f746disco/STM32F746ZGTx_FLASH.ld167
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f746disco/board.h100
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f746disco/board.mk12
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f746disco/stm32f7xx_hal_conf.h472
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/STM32F746ZGTx_FLASH.ld167
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/board.h96
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/board.mk12
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/stm32f7xx_hal_conf.h472
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/STM32F767ZITx_FLASH.ld169
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/board.h102
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/board.mk12
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/stm32f7xx_hal_conf.h472
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f769disco/STM32F769ZITx_FLASH.ld167
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f769disco/board.h101
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f769disco/board.mk13
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/boards/stm32f769disco/stm32f7xx_hal_conf.h472
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/family.c306
-rwxr-xr-xtinyusb/hw/bsp/stm32f7/family.mk54
-rwxr-xr-xtinyusb/hw/bsp/stm32h7/boards/stm32h743eval/board.h132
-rwxr-xr-xtinyusb/hw/bsp/stm32h7/boards/stm32h743eval/board.mk13
-rwxr-xr-xtinyusb/hw/bsp/stm32h7/boards/stm32h743eval/stm32h743xx_flash.ld173
-rwxr-xr-xtinyusb/hw/bsp/stm32h7/boards/stm32h743nucleo/board.h116
-rwxr-xr-xtinyusb/hw/bsp/stm32h7/boards/stm32h743nucleo/board.mk13
-rwxr-xr-xtinyusb/hw/bsp/stm32h7/boards/stm32h743nucleo/stm32h743xx_flash.ld173
-rwxr-xr-xtinyusb/hw/bsp/stm32h7/boards/stm32h745disco/board.h134
-rwxr-xr-xtinyusb/hw/bsp/stm32h7/boards/stm32h745disco/board.mk17
-rwxr-xr-xtinyusb/hw/bsp/stm32h7/family.c287
-rwxr-xr-xtinyusb/hw/bsp/stm32h7/family.mk51
-rwxr-xr-xtinyusb/hw/bsp/stm32h7/stm32h7xx_hal_conf.h483
-rwxr-xr-xtinyusb/hw/bsp/stm32l0538disco/STM32L053C8Tx_FLASH.ld169
-rwxr-xr-xtinyusb/hw/bsp/stm32l0538disco/board.mk53
-rwxr-xr-xtinyusb/hw/bsp/stm32l0538disco/stm32l0538disco.c205
-rwxr-xr-xtinyusb/hw/bsp/stm32l0538disco/stm32l0xx_hal_conf.h331
-rwxr-xr-xtinyusb/hw/bsp/stm32l476disco/STM32L476VGTx_FLASH.ld183
-rwxr-xr-xtinyusb/hw/bsp/stm32l476disco/board.mk56
-rwxr-xr-xtinyusb/hw/bsp/stm32l476disco/stm32l476disco.c242
-rwxr-xr-xtinyusb/hw/bsp/stm32l476disco/stm32l4xx_hal_conf.h420
-rwxr-xr-xtinyusb/hw/bsp/stm32l4r5nucleo/STM32L4RXxI_FLASH.ld167
-rwxr-xr-xtinyusb/hw/bsp/stm32l4r5nucleo/board.mk50
-rwxr-xr-xtinyusb/hw/bsp/stm32l4r5nucleo/stm32l4r5nucleo.c287
-rwxr-xr-xtinyusb/hw/bsp/stm32l4r5nucleo/stm32l4xx_hal_conf.h419
-rwxr-xr-xtinyusb/hw/bsp/waveshare_openh743i/STM32H743IITX_FLASH.ld175
-rwxr-xr-xtinyusb/hw/bsp/waveshare_openh743i/board.c495
-rwxr-xr-xtinyusb/hw/bsp/waveshare_openh743i/board.mk64
-rwxr-xr-xtinyusb/hw/bsp/waveshare_openh743i/stm32h7xx_hal_conf.h483
-rwxr-xr-xtinyusb/hw/mcu/dialog/README.md9
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/arm_license.txt27
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/DA1469xAB.h8657
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/cmsis_compiler.h271
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/cmsis_gcc.h2102
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/cmsis_version.h39
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/core_cm0.h950
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/core_cm33.h2908
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/mpu_armv8.h347
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/system_ARMCM0.h55
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/system_DA1469x.h72
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/da1469x.ld228
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/include/hal/hal_gpio.h184
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/include/mcu/da1469x_clock.h138
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/include/mcu/da1469x_hal.h53
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/include/mcu/mcu.h165
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/src/da1469x_clock.c159
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/src/hal_gpio.c478
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/src/hal_system.c136
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/src/hal_system_start.c177
-rwxr-xr-xtinyusb/hw/mcu/dialog/da1469x/src/system_da1469x.c61
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble.h685
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_err.h93
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gap.h2696
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gatt.h229
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gattc.h715
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gatts.h845
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_hci.h135
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_l2cap.h506
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_ranges.h156
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_types.h215
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf52/nrf_mbr.h268
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_error.h90
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_error_sdm.h70
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_error_soc.h85
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_nvic.h491
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_sdm.h367
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_soc.h1079
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_svc.h90
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrfx_config.h18
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrfx_glue.h227
-rwxr-xr-xtinyusb/hw/mcu/nordic/nrfx_log.h135
-rwxr-xr-xtinyusb/hw/mcu/sony/cxd56/mkspk/.gitignore2
-rwxr-xr-xtinyusb/hw/mcu/sony/cxd56/mkspk/Makefile51
-rwxr-xr-xtinyusb/hw/mcu/sony/cxd56/mkspk/clefia.c517
-rwxr-xr-xtinyusb/hw/mcu/sony/cxd56/mkspk/clefia.h65
-rwxr-xr-xtinyusb/hw/mcu/sony/cxd56/mkspk/elf32.h175
-rwxr-xr-xtinyusb/hw/mcu/sony/cxd56/mkspk/mkspk.c383
-rwxr-xr-xtinyusb/hw/mcu/sony/cxd56/mkspk/mkspk.h93
-rwxr-xr-xtinyusb/hw/mcu/sony/cxd56/tools/__pycache__/xmodem.cpython-36.pycbin15257 -> 0 bytes
-rwxr-xr-xtinyusb/hw/mcu/sony/cxd56/tools/flash_writer.py580
-rwxr-xr-xtinyusb/hw/mcu/sony/cxd56/tools/xmodem.py590
-rwxr-xr-xtinyusb/lib/SEGGER_RTT/License.txt34
-rwxr-xr-xtinyusb/lib/SEGGER_RTT/README.txt20
-rwxr-xr-xtinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT.c2005
-rwxr-xr-xtinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT.h321
-rwxr-xr-xtinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_ASM_ARMv7M.S235
-rwxr-xr-xtinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_Conf.h384
-rwxr-xr-xtinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_printf.c500
-rwxr-xr-xtinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_GCC.c120
-rwxr-xr-xtinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_IAR.c115
-rwxr-xr-xtinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_KEIL.c386
-rwxr-xr-xtinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_SES.c247
-rwxr-xr-xtinyusb/lib/fatfs/00readme.txt138
-rwxr-xr-xtinyusb/lib/fatfs/ccsbcs.c543
-rwxr-xr-xtinyusb/lib/fatfs/diskio.c193
-rwxr-xr-xtinyusb/lib/fatfs/diskio.h95
-rwxr-xr-xtinyusb/lib/fatfs/ff.c4330
-rwxr-xr-xtinyusb/lib/fatfs/ff.h342
-rwxr-xr-xtinyusb/lib/fatfs/ffconf.h193
-rwxr-xr-xtinyusb/lib/fatfs/integer.h36
-rwxr-xr-xtinyusb/lib/networking/dhserver.c348
-rwxr-xr-xtinyusb/lib/networking/dhserver.h62
-rwxr-xr-xtinyusb/lib/networking/dnserver.c200
-rwxr-xr-xtinyusb/lib/networking/dnserver.h47
-rwxr-xr-xtinyusb/lib/networking/ndis.h266
-rwxr-xr-xtinyusb/lib/networking/rndis_protocol.h307
-rwxr-xr-xtinyusb/lib/networking/rndis_reports.c303
-rwxr-xr-xtinyusb/pkg.yml14
-rwxr-xr-xtinyusb/repository.yml12
-rwxr-xr-xtinyusb/src/class/audio/audio.h945
-rwxr-xr-xtinyusb/src/class/audio/audio_device.c2272
-rwxr-xr-xtinyusb/src/class/audio/audio_device.h627
-rwxr-xr-xtinyusb/src/class/bth/bth_device.c254
-rwxr-xr-xtinyusb/src/class/bth/bth_device.h109
-rwxr-xr-xtinyusb/src/class/cdc/cdc.h410
-rwxr-xr-xtinyusb/src/class/cdc/cdc_device.c484
-rwxr-xr-xtinyusb/src/class/cdc/cdc_device.h260
-rwxr-xr-xtinyusb/src/class/cdc/cdc_host.c249
-rwxr-xr-xtinyusb/src/class/cdc/cdc_host.h134
-rwxr-xr-xtinyusb/src/class/cdc/cdc_rndis.h301
-rwxr-xr-xtinyusb/src/class/cdc/cdc_rndis_host.c279
-rwxr-xr-xtinyusb/src/class/cdc/cdc_rndis_host.h63
-rwxr-xr-xtinyusb/src/class/dfu/dfu.h119
-rwxr-xr-xtinyusb/src/class/dfu/dfu_device.c458
-rwxr-xr-xtinyusb/src/class/dfu/dfu_device.h98
-rwxr-xr-xtinyusb/src/class/dfu/dfu_rt_device.c128
-rwxr-xr-xtinyusb/src/class/dfu/dfu_rt_device.h54
-rwxr-xr-xtinyusb/src/class/hid/hid.h1119
-rwxr-xr-xtinyusb/src/class/hid/hid_device.c417
-rwxr-xr-xtinyusb/src/class/hid/hid_device.h393
-rwxr-xr-xtinyusb/src/class/hid/hid_host.c628
-rwxr-xr-xtinyusb/src/class/hid/hid_host.h152
-rwxr-xr-xtinyusb/src/class/midi/midi.h212
-rwxr-xr-xtinyusb/src/class/midi/midi_device.c538
-rwxr-xr-xtinyusb/src/class/midi/midi_device.h173
-rwxr-xr-xtinyusb/src/class/msc/msc.h382
-rwxr-xr-xtinyusb/src/class/msc/msc_device.c705
-rwxr-xr-xtinyusb/src/class/msc/msc_device.h159
-rwxr-xr-xtinyusb/src/class/msc/msc_host.c491
-rwxr-xr-xtinyusb/src/class/msc/msc_host.h119
-rwxr-xr-xtinyusb/src/class/net/net_device.c441
-rwxr-xr-xtinyusb/src/class/net/net_device.h85
-rwxr-xr-xtinyusb/src/class/usbtmc/usbtmc.h316
-rwxr-xr-xtinyusb/src/class/usbtmc/usbtmc_device.c860
-rwxr-xr-xtinyusb/src/class/usbtmc/usbtmc_device.h122
-rwxr-xr-xtinyusb/src/class/vendor/vendor_device.c248
-rwxr-xr-xtinyusb/src/class/vendor/vendor_device.h136
-rwxr-xr-xtinyusb/src/class/vendor/vendor_host.c146
-rwxr-xr-xtinyusb/src/class/vendor/vendor_host.h67
-rwxr-xr-xtinyusb/src/common/tusb_common.h429
-rwxr-xr-xtinyusb/src/common/tusb_compiler.h215
-rwxr-xr-xtinyusb/src/common/tusb_error.h75
-rwxr-xr-xtinyusb/src/common/tusb_fifo.c1000
-rwxr-xr-xtinyusb/src/common/tusb_fifo.h151
-rwxr-xr-xtinyusb/src/common/tusb_timeout.h80
-rwxr-xr-xtinyusb/src/common/tusb_types.h534
-rwxr-xr-xtinyusb/src/common/tusb_verify.h181
-rwxr-xr-xtinyusb/src/device/dcd.h181
-rwxr-xr-xtinyusb/src/device/dcd_attr.h164
-rwxr-xr-xtinyusb/src/device/usbd.c1353
-rwxr-xr-xtinyusb/src/device/usbd.h783
-rwxr-xr-xtinyusb/src/device/usbd_control.c233
-rwxr-xr-xtinyusb/src/device/usbd_pvt.h114
-rwxr-xr-xtinyusb/src/host/hcd.h179
-rwxr-xr-xtinyusb/src/host/hcd_attr.h105
-rwxr-xr-xtinyusb/src/host/hub.c388
-rwxr-xr-xtinyusb/src/host/hub.h196
-rwxr-xr-xtinyusb/src/host/usbh.c1188
-rwxr-xr-xtinyusb/src/host/usbh.h99
-rwxr-xr-xtinyusb/src/host/usbh_classdriver.h83
-rwxr-xr-xtinyusb/src/host/usbh_control.c138
-rwxr-xr-xtinyusb/src/osal/osal.h104
-rwxr-xr-xtinyusb/src/osal/osal_freertos.h172
-rwxr-xr-xtinyusb/src/osal/osal_mynewt.h174
-rwxr-xr-xtinyusb/src/osal/osal_none.h204
-rwxr-xr-xtinyusb/src/osal/osal_pico.h187
-rwxr-xr-xtinyusb/src/osal/osal_rtthread.h130
-rwxr-xr-xtinyusb/src/portable/dialog/da146xx/dcd_da146xx.c1067
-rwxr-xr-xtinyusb/src/portable/ehci/ehci.c893
-rwxr-xr-xtinyusb/src/portable/ehci/ehci.h420
-rwxr-xr-xtinyusb/src/portable/ehci/ehci_api.h45
-rwxr-xr-xtinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c867
-rwxr-xr-xtinyusb/src/portable/microchip/samd/dcd_samd.c411
-rwxr-xr-xtinyusb/src/portable/microchip/samg/dcd_samg.c486
-rwxr-xr-xtinyusb/src/portable/microchip/samx7x/common_usb_regs.h2108
-rwxr-xr-xtinyusb/src/portable/microchip/samx7x/dcd_samx7x.c762
-rwxr-xr-xtinyusb/src/portable/mindmotion/mm32/dcd_mm32f327x_otg.c471
-rwxr-xr-xtinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c1050
-rwxr-xr-xtinyusb/src/portable/nuvoton/nuc120/dcd_nuc120.c494
-rwxr-xr-xtinyusb/src/portable/nuvoton/nuc121/dcd_nuc121.c534
-rwxr-xr-xtinyusb/src/portable/nuvoton/nuc505/dcd_nuc505.c712
-rwxr-xr-xtinyusb/src/portable/nxp/khci/dcd_khci.c479
-rwxr-xr-xtinyusb/src/portable/nxp/lpc17_40/dcd_lpc17_40.c582
-rwxr-xr-xtinyusb/src/portable/nxp/lpc17_40/dcd_lpc17_40.h152
-rwxr-xr-xtinyusb/src/portable/nxp/lpc17_40/hcd_lpc17_40.c47
-rwxr-xr-xtinyusb/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c537
-rwxr-xr-xtinyusb/src/portable/nxp/transdimension/common_transdimension.h136
-rwxr-xr-xtinyusb/src/portable/nxp/transdimension/dcd_transdimension.c492
-rwxr-xr-xtinyusb/src/portable/nxp/transdimension/hcd_transdimension.c117
-rwxr-xr-xtinyusb/src/portable/ohci/ohci.c657
-rwxr-xr-xtinyusb/src/portable/ohci/ohci.h275
-rwxr-xr-xtinyusb/src/portable/raspberrypi/rp2040/dcd_rp2040.c485
-rwxr-xr-xtinyusb/src/portable/raspberrypi/rp2040/hcd_rp2040.c564
-rwxr-xr-xtinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c326
-rwxr-xr-xtinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.h147
-rwxr-xr-xtinyusb/src/portable/renesas/usba/dcd_usba.c891
-rwxr-xr-xtinyusb/src/portable/silabs/efm32/dcd_efm32.c931
-rwxr-xr-xtinyusb/src/portable/sony/cxd56/dcd_cxd56.c408
-rwxr-xr-xtinyusb/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c1129
-rwxr-xr-xtinyusb/src/portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h411
-rwxr-xr-xtinyusb/src/portable/st/synopsys/dcd_synopsys.c1186
-rwxr-xr-xtinyusb/src/portable/st/synopsys/synopsys_common.h1465
-rwxr-xr-xtinyusb/src/portable/template/dcd_template.c131
-rwxr-xr-xtinyusb/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c694
-rwxr-xr-xtinyusb/src/portable/valentyusb/eptri/dcd_eptri.c643
-rwxr-xr-xtinyusb/src/portable/valentyusb/eptri/dcd_eptri.h39
-rwxr-xr-xtinyusb/src/tusb.c246
-rwxr-xr-xtinyusb/src/tusb.h136
-rwxr-xr-xtinyusb/src/tusb_option.h315
-rwxr-xr-xtinyusb/test/ceedling3
-rwxr-xr-xtinyusb/test/project.yml106
-rwxr-xr-xtinyusb/test/test/device/msc/test_msc_device.c273
-rwxr-xr-xtinyusb/test/test/device/usbd/test_usbd.c243
-rwxr-xr-xtinyusb/test/test/support/tusb_config.h106
-rwxr-xr-xtinyusb/test/test/test_fifo.c318
-rwxr-xr-xtinyusb/test/vendor/ceedling/bin/ceedling337
-rwxr-xr-xtinyusb/test/vendor/ceedling/docs/CException.md292
-rwxr-xr-xtinyusb/test/vendor/ceedling/docs/CMock_Summary.md603
-rwxr-xr-xtinyusb/test/vendor/ceedling/docs/CeedlingPacket.md2060
-rwxr-xr-xtinyusb/test/vendor/ceedling/docs/ThrowTheSwitchCodingStandard.md206
-rwxr-xr-xtinyusb/test/vendor/ceedling/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdfbin144467 -> 0 bytes
-rwxr-xr-xtinyusb/test/vendor/ceedling/docs/UnityAssertionsReference.md779
-rwxr-xr-xtinyusb/test/vendor/ceedling/docs/UnityConfigurationGuide.md433
-rwxr-xr-xtinyusb/test/vendor/ceedling/docs/UnityGettingStartedGuide.md192
-rwxr-xr-xtinyusb/test/vendor/ceedling/docs/UnityHelperScriptsGuide.md260
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling.rb99
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/build_invoker_utils.rb39
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/cacheinator.rb47
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/cacheinator_helper.rb31
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/cmock_builder.rb15
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/configurator.rb363
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/configurator_builder.rb458
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/configurator_plugins.rb111
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/configurator_setup.rb127
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/configurator_validator.rb193
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/constants.rb97
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/defaults.rb418
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/dependinator.rb98
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/erb_wrapper.rb9
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/file_finder.rb149
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/file_finder_helper.rb54
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/file_path_utils.rb200
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/file_system_utils.rb69
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/file_system_wrapper.rb10
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/file_wrapper.rb83
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/flaginator.rb74
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/generator.rb183
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/generator_helper.rb40
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/generator_test_results.rb89
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/generator_test_results_sanity_checker.rb65
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/generator_test_runner.rb56
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/loginator.rb31
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/makefile.rb46
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/objects.yml310
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/par_map.rb19
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/plugin.rb80
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/plugin_builder.rb53
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/plugin_manager.rb107
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/plugin_manager_helper.rb19
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/plugin_reportinator.rb76
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/plugin_reportinator_helper.rb51
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator.rb42
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_extractor.rb30
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_file_handler.rb21
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_helper.rb46
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_includes_handler.rb181
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/project_config_manager.rb46
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/project_file_loader.rb99
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/rake_utils.rb17
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/rake_wrapper.rb33
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/rakefile.rb86
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/release_invoker.rb73
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/release_invoker_helper.rb19
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/reportinator.rb26
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/rules_cmock.rake9
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/rules_preprocess.rake26
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/rules_release.rake86
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/rules_release_deep_dependencies.rake15
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/rules_tests.rake74
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/rules_tests_deep_dependencies.rake15
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/setupinator.rb53
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/stream_wrapper.rb28
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/streaminator.rb40
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/streaminator_helper.rb15
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/system_utils.rb37
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/system_wrapper.rb80
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/target_loader.rb38
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/task_invoker.rb117
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/tasks_base.rake111
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/tasks_filesystem.rake103
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/tasks_release.rake30
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/tasks_release_deep_dependencies.rake9
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests.rake60
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests_deep_dependencies.rake9
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/tasks_vendor.rake35
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/test_includes_extractor.rb85
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/test_invoker.rb188
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/test_invoker_helper.rb32
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/tool_executor.rb229
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/tool_executor_helper.rb164
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/verbosinator.rb10
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/version.rb36
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/version.rb.erb15
-rwxr-xr-xtinyusb/test/vendor/ceedling/lib/ceedling/yaml_wrapper.rb17
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/beep/README.md22
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/beep/lib/beep.rb40
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/bullseye/assets/template.erb15
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/bullseye/bullseye.rake169
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/bullseye/config/defaults.yml57
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/bullseye/lib/bullseye.rb194
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/bullseye/readme.txt0
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/colour_report/lib/colour_report.rb16
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/command_hooks/README.md53
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/command_hooks/lib/command_hooks.rb92
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/README.md250
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/Rakefile19
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/project.yml71
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/rakefile.rb7
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/bar.c1
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/bar.h14
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/custom_types.h6
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/display.c7
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/display.h16
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/event_processor.c93
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/event_processor.h11
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/foo.c16
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/foo.h8
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/subfolder/zzz.c1
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/subfolder/zzz.h6
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/test/test_event_processor.c155
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/test/test_foo.c47
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/lib/fake_function_framework.rb87
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/lib/fff_mock_generator.rb163
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/fff_mock_header_generator_spec.rb304
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/fff_mock_source_generator_spec.rb149
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/header_generator.rb51
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/spec_helper.rb96
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/fake_function_framework/src/fff_unity_helper.h33
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/gcov/README.md101
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/gcov/assets/template.erb15
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/gcov/config/defaults.yml73
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/gcov/gcov.rake220
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/gcov/lib/gcov.rb113
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/gcov/lib/gcov_constants.rb19
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/junit_tests_report/README.md36
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/junit_tests_report/lib/junit_tests_report.rb129
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/module_generator/config/module_generator.yml4
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/module_generator/lib/module_generator.rb70
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/module_generator/module_generator.rake47
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/raw_output_report/lib/raw_output_report.rb41
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/assets/template.erb84
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/assets/template.erb copy59
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/config/stdout_gtestlike_tests_report.yml4
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/lib/stdout_gtestlike_tests_report.rb43
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/stdout_ide_tests_report/config/stdout_ide_tests_report.yml4
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/stdout_ide_tests_report/lib/stdout_ide_tests_report.rb44
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/stdout_pretty_tests_report/assets/template.erb59
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/stdout_pretty_tests_report/config/stdout_pretty_tests_report.yml4
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/stdout_pretty_tests_report/lib/stdout_pretty_tests_report.rb47
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/subprojects/README.md63
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/subprojects/config/defaults.yml33
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/subprojects/lib/subprojects.rb92
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/subprojects/subprojects.rake78
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/teamcity_tests_report/config/teamcity_tests_report.yml4
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/teamcity_tests_report/lib/teamcity_tests_report.rb57
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/warnings_report/lib/warnings_report.rb69
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/xml_tests_report/README.md36
-rwxr-xr-xtinyusb/test/vendor/ceedling/plugins/xml_tests_report/lib/xml_tests_report.rb110
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/c_exception/lib/CException.c46
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/c_exception/lib/CException.h115
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/c_exception/release/build.info2
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/c_exception/release/version.info2
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/config/production_environment.rb14
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/config/test_environment.rb16
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock.rb86
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_config.rb153
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_file_writer.rb44
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator.rb268
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_array.rb63
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_callback.rb88
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_cexception.rb51
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_expect.rb103
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_expect_any_args.rb53
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_ignore.rb75
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_ignore_arg.rb42
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb79
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_utils.rb253
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_header_parser.rb364
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_plugin_manager.rb55
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_unityhelper_parser.rb75
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/release/build.info2
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/release/version.info2
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/src/cmock.c216
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/src/cmock.h40
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/src/cmock_internals.h91
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/cmock/src/meson.build17
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/deep_merge/lib/deep_merge.rb211
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/diy/lib/diy.rb403
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/diy/lib/diy/factory.rb36
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/colour_prompt.rb119
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/colour_reporter.rb39
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/generate_config.yml36
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/generate_module.rb309
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/generate_test_runner.rb495
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/parse_output.rb322
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/run_test.erb36
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/stylize_as_junit.rb251
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/test_file_filter.rb25
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/type_sanitizer.rb6
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/unity_test_summary.py139
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/unity_test_summary.rb135
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/auto/unity_to_junit.py146
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/release/build.info2
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/release/version.info2
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/src/CMakeLists.txt22
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/src/meson.build16
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/src/unity.c2085
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/src/unity.h617
-rwxr-xr-xtinyusb/test/vendor/ceedling/vendor/unity/src/unity_internals.h1002
-rwxr-xr-xtinyusb/tools/build_board.py125
-rwxr-xr-xtinyusb/tools/build_esp32sx.py102
-rwxr-xr-xtinyusb/tools/build_family.py144
-rwxr-xr-xtinyusb/tools/top.mk30
-rwxr-xr-xtinyusb/tools/usb_drivers/tinyusb_win_usbser.inf108
-rwxr-xr-xtinyusb/version.yml3
1054 files changed, 0 insertions, 188322 deletions
diff --git a/tinyusb/.gitattributes b/tinyusb/.gitattributes
deleted file mode 100755
index 2342decc..00000000
--- a/tinyusb/.gitattributes
+++ /dev/null
@@ -1,25 +0,0 @@
-# Set the default behavior, in case people don't have core.autocrlf set.
-* text=auto
-
-*.c text
-*.cpp text
-*.h text
-*.icf text
-*.js text
-*.json text
-*.ld text
-*.md text
-*.mk text
-*.py text
-*.rst text
-*.s text
-*.txt text
-*.xml text
-*.yml text
-
-Makefile text
-
-# Windows-only Visual Studio things
-
-*.sln text eol=crlf
-*.csproj text eol=crlf
diff --git a/tinyusb/.github/ISSUE_TEMPLATE/bug_report.yml b/tinyusb/.github/ISSUE_TEMPLATE/bug_report.yml
deleted file mode 100755
index 291b2207..00000000
--- a/tinyusb/.github/ISSUE_TEMPLATE/bug_report.yml
+++ /dev/null
@@ -1,74 +0,0 @@
-name: Bug Report
-description: Report a problem with TinyUSB
-labels: 'Bug 🐞'
-body:
- - type: markdown
- attributes:
- value: |
- Thanks for taking the time to fill out this bug report!
- It's okay to leave some blank if it doesn't apply to your problem.
-
- - type: dropdown
- attributes:
- label: Operating System
- options:
- - Linux
- - MacOS
- - RaspberryPi OS
- - Windows 7
- - Windows 10
- - Windows 11
- - Others
- validations:
- required: true
-
- - type: input
- attributes:
- label: Board
- placeholder: e.g Feather nRF52840 Express
- validations:
- required: true
-
- - type: textarea
- attributes:
- label: Firmware
- placeholder: |
- e.g examples/device/cdc_msc.
- If it is custom firmware, please provide links to your minimal sources or as attached files.
- validations:
- required: true
-
- - type: textarea
- attributes:
- label: What happened ?
- placeholder: A clear and concise description of what the bug is.
- validations:
- required: true
-
- - type: textarea
- attributes:
- label: How to reproduce ?
- placeholder: |
- 1. Go to '...'
- 2. Click on '....'
- 3. See error
- validations:
- required: true
-
- - type: textarea
- attributes:
- label: Debug Log
- placeholder: |
- TinyUSB debug log where the issue occurred as attached txt file, best with comments to explain the actual events.
-
- Note: To enable logging, add `LOG=3` to to the make command if building with stock examples or set `CFG_TUSB_DEBUG=3` in your tusb_config.h.
- More information can be found at [example's readme](https://github.com/hathach/tinyusb/blob/master/docs/getting_started.md)
- validations:
- required: false
-
- - type: textarea
- attributes:
- label: Screenshots
- description: If applicable, add screenshots to help explain your problem.
- validations:
- required: false
diff --git a/tinyusb/.github/ISSUE_TEMPLATE/config.yml b/tinyusb/.github/ISSUE_TEMPLATE/config.yml
deleted file mode 100755
index 735a5ef2..00000000
--- a/tinyusb/.github/ISSUE_TEMPLATE/config.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-contact_links:
- - name: TinyUSB Discussion
- url: https://github.com/hathach/tinyusb/discussions
- about: If you have other questions or need help, post it here.
diff --git a/tinyusb/.github/ISSUE_TEMPLATE/feature_request.md b/tinyusb/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100755
index 562d3113..00000000
--- a/tinyusb/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-name: Feature Request
-about: Suggest an idea for this project
-title: ''
-labels: Feature 💡
-assignees: ''
-
----
-
-**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-
-**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
diff --git a/tinyusb/.github/pull_request_template.md b/tinyusb/.github/pull_request_template.md
deleted file mode 100755
index aa148eb7..00000000
--- a/tinyusb/.github/pull_request_template.md
+++ /dev/null
@@ -1,5 +0,0 @@
-**Describe the PR**
-A clear and concise description of what this PR solve.
-
-**Additional context**
-If applicable, add any other context about the PR and/or screenshots here.
diff --git a/tinyusb/.github/workflows/build.yml b/tinyusb/.github/workflows/build.yml
deleted file mode 100755
index 8ef19b0a..00000000
--- a/tinyusb/.github/workflows/build.yml
+++ /dev/null
@@ -1,144 +0,0 @@
-name: Build ARM
-
-on:
- pull_request:
- push:
- release:
- types:
- - created
-
-jobs:
- # ---------------------------------------
- # Unit testing with Ceedling
- # ---------------------------------------
- unit-test:
- runs-on: ubuntu-latest
- steps:
- - name: Setup Ruby
- uses: actions/setup-ruby@v1
- with:
- ruby-version: '2.7'
-
- - name: Checkout TinyUSB
- uses: actions/checkout@v2
-
- - name: Unit Tests
- run: |
- # Install Ceedling
- gem install ceedling
- cd test
- ceedling test:all
-
- # ---------------------------------------
- # Build ARM family
- # ---------------------------------------
- build-arm:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- family:
- # Alphabetical order
- - 'imxrt'
- - 'lpc15'
- - 'lpc18'
- - 'lpc54'
- - 'lpc55'
- - 'nrf'
- - 'rp2040'
- - 'samd11'
- - 'samd21'
- - 'samd51'
- - 'saml2x'
- - 'stm32f0'
- - 'stm32f1'
- - 'stm32f4'
- - 'stm32f7'
- - 'stm32h7'
- steps:
- - name: Setup Python
- uses: actions/setup-python@v2
-
- - name: Checkout TinyUSB
- uses: actions/checkout@v2
-
- - name: Checkout common submodules in lib
- run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
-
- - name: Checkout pico-sdk
- if: matrix.family == 'rp2040'
- run: |
- git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
- echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
-
- - name: Set Toolchain URL
- run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz
-
- - name: Cache Toolchain
- uses: actions/cache@v2
- id: cache-toolchain
- with:
- path: ~/cache/
- key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
-
- - name: Install Toolchain
- if: steps.cache-toolchain.outputs.cache-hit != 'true'
- run: |
- mkdir -p ~/cache/toolchain
- wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
- tar -C ~/cache/toolchain -xaf toolchain.tar.gz
-
- - name: Set Toolchain Path
- run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
-
- - name: Build
- run: python3 tools/build_family.py ${{ matrix.family }}
-
- # ---------------------------------------
- # Build all no-family (opharned) boards
- # ---------------------------------------
- build-board:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- example:
- # Alphabetical order, a group of 4
- - 'device/audio_test device/board_test device/cdc_dual_ports device/cdc_msc'
- - 'device/cdc_msc_freertos device/dfu_runtime device/hid_composite device/hid_composite_freertos'
- - 'device/hid_generic_inout device/hid_multiple_interface device/midi_test device/msc_dual_lun'
- - 'device/net_lwip_webserver'
- - 'device/uac2_headset device/usbtmc device/webusb_serial host/cdc_msc_hid'
-
- steps:
- - name: Setup Python
- uses: actions/setup-python@v2
-
- - name: Checkout TinyUSB
- uses: actions/checkout@v2
-
- - name: Checkout common submodules in lib
- run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
-
- - name: Set Toolchain URL
- run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz
-
- - name: Cache Toolchain
- uses: actions/cache@v2
- id: cache-toolchain
- with:
- path: ~/cache/
- key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
-
- - name: Install Toolchain
- if: steps.cache-toolchain.outputs.cache-hit != 'true'
- run: |
- mkdir -p ~/cache/toolchain
- wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
- tar -C ~/cache/toolchain -xaf toolchain.tar.gz
-
- - name: Set Toolchain Path
- run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
-
- - name: Build
- run: python3 tools/build_board.py ${{ matrix.example }}
diff --git a/tinyusb/.github/workflows/build_esp.yml b/tinyusb/.github/workflows/build_esp.yml
deleted file mode 100755
index 25f4e68f..00000000
--- a/tinyusb/.github/workflows/build_esp.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-name: Build ESP
-
-on:
- pull_request:
- push:
- release:
- types:
- - created
-
-jobs:
- build-esp:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- board:
- # Alphabetical order
- # ESP32-S2
- - 'espressif_saola_1'
- # ESP32-S3
- # latest IDF does not define USB0 in linker
- #- 'espressif_addax_1'
-
- steps:
- - name: Setup Python
- uses: actions/setup-python@v2
-
- - name: Pull ESP-IDF docker
- run: docker pull espressif/idf:latest
-
- - name: Checkout TinyUSB
- uses: actions/checkout@v2
-
- - name: Build
- run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32sx.py ${{ matrix.board }}
diff --git a/tinyusb/.github/workflows/build_msp430.yml b/tinyusb/.github/workflows/build_msp430.yml
deleted file mode 100755
index ff2ce72c..00000000
--- a/tinyusb/.github/workflows/build_msp430.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-name: Build MSP430
-
-on:
- pull_request:
- push:
- release:
- types:
- - created
-
-jobs:
- build-msp430:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- family:
- # Alphabetical order
- - 'msp430'
- steps:
- - name: Setup Python
- uses: actions/setup-python@v2
-
- - name: Checkout TinyUSB
- uses: actions/checkout@v2
-
- - name: Checkout common submodules in lib
- run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
-
- - name: Set Toolchain URL
- run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2
-
- - name: Cache Toolchain
- uses: actions/cache@v2
- id: cache-toolchain
- with:
- path: ~/cache/
- key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
-
- - name: Install Toolchain
- if: steps.cache-toolchain.outputs.cache-hit != 'true'
- run: |
- mkdir -p ~/cache/toolchain
- wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.bz2
- tar -C ~/cache/toolchain -xaf toolchain.tar.bz2
-
- - name: Set Toolchain Path
- run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
-
- - name: Build
- run: python3 tools/build_family.py ${{ matrix.family }}
diff --git a/tinyusb/.github/workflows/build_renesas.yml b/tinyusb/.github/workflows/build_renesas.yml
deleted file mode 100755
index ee9ba828..00000000
--- a/tinyusb/.github/workflows/build_renesas.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-name: Build Renesas
-
-on:
- pull_request:
- push:
- release:
- types:
- - created
-
-jobs:
- build-rx:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- family:
- # Alphabetical order
- - 'rx'
- steps:
- - name: Setup Python
- uses: actions/setup-python@v2
-
- - name: Checkout TinyUSB
- uses: actions/checkout@v2
-
- - name: Checkout common submodules in lib
- run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
-
- - name: Set Toolchain URL
- run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run
-
- - name: Cache Toolchain
- uses: actions/cache@v2
- id: cache-toolchain
- with:
- path: ~/cache/
- key: ${{ runner.os }}-21-03-30-${{ env.TOOLCHAIN_URL }}
-
- - name: Install Toolchain
- if: steps.cache-toolchain.outputs.cache-hit != 'true'
- run: |
- mkdir -p ~/cache/toolchain/gnurx
- wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.run
- chmod +x toolchain.run
- ./toolchain.run -p ~/cache/toolchain/gnurx -y
-
- - name: Set Toolchain Path
- run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
-
- - name: Build
- run: python3 tools/build_family.py ${{ matrix.family }}
diff --git a/tinyusb/.github/workflows/build_riscv.yml b/tinyusb/.github/workflows/build_riscv.yml
deleted file mode 100755
index 78510751..00000000
--- a/tinyusb/.github/workflows/build_riscv.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-name: Build RISC-V
-
-on:
- pull_request:
- push:
- release:
- types:
- - created
-
-jobs:
- build-riscv:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- family:
- # Alphabetical order
- - 'fomu'
- - 'gd32vf103'
- steps:
- - name: Setup Python
- uses: actions/setup-python@v2
-
- - name: Checkout TinyUSB
- uses: actions/checkout@v2
-
- - name: Checkout common submodules in lib
- run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
-
- - name: Set Toolchain URL
- run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.1.0-1.1/xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz
-
- - name: Cache Toolchain
- uses: actions/cache@v2
- id: cache-toolchain
- with:
- path: ~/cache/
- key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
-
- - name: Install Toolchain
- if: steps.cache-toolchain.outputs.cache-hit != 'true'
- run: |
- mkdir -p ~/cache/toolchain
- wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
- tar -C ~/cache/toolchain -xaf toolchain.tar.gz
-
- - name: Set Toolchain Path
- run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
-
- - name: Build
- run: python3 tools/build_family.py ${{ matrix.family }}
diff --git a/tinyusb/.github/workflows/trigger.yml b/tinyusb/.github/workflows/trigger.yml
deleted file mode 100755
index 40750a2f..00000000
--- a/tinyusb/.github/workflows/trigger.yml
+++ /dev/null
@@ -1,58 +0,0 @@
-name: Trigger Repos
-
-on:
- push:
- branches: master
- release:
- types:
- - created
-
-jobs:
- trigger-mynewt:
- if: github.repository == 'hathach/tinyusb'
- runs-on: ubuntu-latest
- steps:
- - name: Trigger mynewt-tinyusb-example
- shell: bash
- run: |
- curl -X POST -H "Authorization: token ${{ secrets.API_TOKEN_GITHUB }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" --data '{"event_type": "rebuild"}' https://api.github.com/repos/hathach/mynewt-tinyusb-example/dispatches
-
- mirror-tinyusb-src:
- if: github.repository == 'hathach/tinyusb'
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@v2
-
- - name: Push to tinyusb_src
- run: |
- # clone tinyusb_src with PAT
- git config --global user.email "thach@tinyusb.org"
- git config --global user.name "hathach"
- git clone --depth 1 --single-branch --branch main "https://${{ secrets.API_TOKEN_GITHUB }}@github.com/hathach/tinyusb_src.git" tinyusb_src
-
- # Remove all files
- rm -rf tinyusb_src/*
-
- # Copy src and other files
- cp -r src tinyusb_src/
- cp LICENSE tinyusb_src/
- cd tinyusb_src
-
- # Commit if there is changes
- if [ -n "$(git status --porcelain)" ]; then
- git add .
- git commit --message "Update from https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA"
- git push
- fi
-
- - name: Create tinyusb_src Release
- if: ${{ github.event_name == 'release' }}
- run: |
- # Push tag
- cd tinyusb_src
- git tag ${{ github.event.release.tag_name }}
- git push origin ${{ github.event.release.tag_name }}
-
- # Send POST reqwuest to release https://docs.github.com/en/rest/reference/repos#create-a-release
- curl -X POST -H "Authorization: token ${{ secrets.API_TOKEN_GITHUB }}" -H "Accept: application/vnd.github.v3+json" --data '{"tag_name": "${{ github.event.release.tag_name }}", "name": "${{ github.event.release.name }}", "body": "${{ github.event.release.body }}", "draft": ${{ github.event.release.draft }}, "prerelease": ${{ github.event.release.prerelease }}}' https://api.github.com/repos/hathach/tinyusb_src/releases
diff --git a/tinyusb/.gitignore b/tinyusb/.gitignore
deleted file mode 100755
index f7adff4c..00000000
--- a/tinyusb/.gitignore
+++ /dev/null
@@ -1,28 +0,0 @@
-html
-latex
-*.d
-*.o
-*.P
-*.map
-*.axf
-*.bin
-*.jlink
-*.emSession
-*.elf
-*.ind
-.env
-.settings/
-.idea/
-.gdb_history
-/examples/*/*/build*
-test_old/
-tests_obsolete/
-_build
-/examples/*/*/ses
-/examples/*/*/ozone
-/examples/obsolete
-# coverity intermediate files
-cov-int
-# cppcheck build directories
-*-build-dir
-/_bin/
diff --git a/tinyusb/.gitmodules b/tinyusb/.gitmodules
deleted file mode 100755
index 4c86fd55..00000000
--- a/tinyusb/.gitmodules
+++ /dev/null
@@ -1,129 +0,0 @@
-[submodule "hw/mcu/nordic/nrfx"]
- path = hw/mcu/nordic/nrfx
- url = https://github.com/NordicSemiconductor/nrfx.git
-[submodule "tools/uf2"]
- path = tools/uf2
- url = https://github.com/microsoft/uf2.git
-[submodule "hw/mcu/sony/cxd56/spresense-exported-sdk"]
- path = hw/mcu/sony/cxd56/spresense-exported-sdk
- url = https://github.com/sonydevworld/spresense-exported-sdk.git
-[submodule "hw/mcu/ti"]
- path = hw/mcu/ti
- url = https://github.com/hathach/ti_driver.git
-[submodule "hw/mcu/microchip"]
- path = hw/mcu/microchip
- url = https://github.com/hathach/microchip_driver.git
-[submodule "hw/mcu/nuvoton"]
- path = hw/mcu/nuvoton
- url = https://github.com/majbthrd/nuc_driver.git
-[submodule "lib/lwip"]
- path = lib/lwip
- url = https://github.com/lwip-tcpip/lwip.git
-[submodule "hw/mcu/st/cmsis_device_f4"]
- path = hw/mcu/st/cmsis_device_f4
- url = https://github.com/STMicroelectronics/cmsis_device_f4.git
-[submodule "hw/mcu/st/stm32f4xx_hal_driver"]
- path = hw/mcu/st/stm32f4xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32f4xx_hal_driver.git
-[submodule "hw/mcu/st/cmsis_device_f0"]
- path = hw/mcu/st/cmsis_device_f0
- url = https://github.com/STMicroelectronics/cmsis_device_f0.git
-[submodule "hw/mcu/st/stm32f0xx_hal_driver"]
- path = hw/mcu/st/stm32f0xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32f0xx_hal_driver.git
-[submodule "hw/mcu/st/cmsis_device_f1"]
- path = hw/mcu/st/cmsis_device_f1
- url = https://github.com/STMicroelectronics/cmsis_device_f1.git
-[submodule "hw/mcu/st/stm32f1xx_hal_driver"]
- path = hw/mcu/st/stm32f1xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32f1xx_hal_driver.git
-[submodule "hw/mcu/st/cmsis_device_f2"]
- path = hw/mcu/st/cmsis_device_f2
- url = https://github.com/STMicroelectronics/cmsis_device_f2.git
-[submodule "hw/mcu/st/stm32f2xx_hal_driver"]
- path = hw/mcu/st/stm32f2xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32f2xx_hal_driver.git
-[submodule "hw/mcu/st/cmsis_device_f3"]
- path = hw/mcu/st/cmsis_device_f3
- url = https://github.com/STMicroelectronics/cmsis_device_f3.git
-[submodule "hw/mcu/st/stm32f3xx_hal_driver"]
- path = hw/mcu/st/stm32f3xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32f3xx_hal_driver.git
-[submodule "hw/mcu/st/cmsis_device_f7"]
- path = hw/mcu/st/cmsis_device_f7
- url = https://github.com/STMicroelectronics/cmsis_device_f7.git
-[submodule "hw/mcu/st/stm32f7xx_hal_driver"]
- path = hw/mcu/st/stm32f7xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32f7xx_hal_driver.git
-[submodule "hw/mcu/st/cmsis_device_h7"]
- path = hw/mcu/st/cmsis_device_h7
- url = https://github.com/STMicroelectronics/cmsis_device_h7.git
-[submodule "hw/mcu/st/stm32h7xx_hal_driver"]
- path = hw/mcu/st/stm32h7xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32h7xx_hal_driver.git
-[submodule "hw/mcu/st/cmsis_device_l0"]
- path = hw/mcu/st/cmsis_device_l0
- url = https://github.com/STMicroelectronics/cmsis_device_l0.git
-[submodule "hw/mcu/st/stm32l0xx_hal_driver"]
- path = hw/mcu/st/stm32l0xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32l0xx_hal_driver.git
-[submodule "hw/mcu/st/cmsis_device_l1"]
- path = hw/mcu/st/cmsis_device_l1
- url = https://github.com/STMicroelectronics/cmsis_device_l1.git
-[submodule "hw/mcu/st/stm32l1xx_hal_driver"]
- path = hw/mcu/st/stm32l1xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32l1xx_hal_driver.git
-[submodule "hw/mcu/st/cmsis_device_l4"]
- path = hw/mcu/st/cmsis_device_l4
- url = https://github.com/STMicroelectronics/cmsis_device_l4.git
-[submodule "hw/mcu/st/stm32l4xx_hal_driver"]
- path = hw/mcu/st/stm32l4xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32l4xx_hal_driver.git
-[submodule "hw/mcu/st/cmsis_device_g0"]
- path = hw/mcu/st/cmsis_device_g0
- url = https://github.com/STMicroelectronics/cmsis_device_g0.git
-[submodule "hw/mcu/st/stm32g0xx_hal_driver"]
- path = hw/mcu/st/stm32g0xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git
-[submodule "hw/mcu/st/cmsis_device_g4"]
- path = hw/mcu/st/cmsis_device_g4
- url = https://github.com/STMicroelectronics/cmsis_device_g4.git
-[submodule "hw/mcu/st/stm32g4xx_hal_driver"]
- path = hw/mcu/st/stm32g4xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32g4xx_hal_driver.git
-[submodule "hw/mcu/st/cmsis_device_l5"]
- path = hw/mcu/st/cmsis_device_l5
- url = https://github.com/STMicroelectronics/cmsis_device_l5.git
-[submodule "hw/mcu/st/stm32l5xx_hal_driver"]
- path = hw/mcu/st/stm32l5xx_hal_driver
- url = https://github.com/STMicroelectronics/stm32l5xx_hal_driver.git
-[submodule "lib/sct_neopixel"]
- path = lib/sct_neopixel
- url = https://github.com/gsteiert/sct_neopixel
-[submodule "lib/FreeRTOS-Kernel"]
- path = lib/FreeRTOS-Kernel
- url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
-[submodule "lib/CMSIS_5"]
- path = lib/CMSIS_5
- url = https://github.com/ARM-software/CMSIS_5.git
-[submodule "hw/mcu/silabs/cmsis-dfp-efm32gg12b"]
- path = hw/mcu/silabs/cmsis-dfp-efm32gg12b
- url = https://github.com/cmsis-packs/cmsis-dfp-efm32gg12b
-[submodule "hw/mcu/renesas/rx"]
- path = hw/mcu/renesas/rx
- url = https://github.com/kkitayam/rx_device.git
-[submodule "hw/mcu/nxp/lpcopen"]
- path = hw/mcu/nxp/lpcopen
- url = https://github.com/hathach/nxp_lpcopen.git
-[submodule "hw/mcu/nxp/mcux-sdk"]
- path = hw/mcu/nxp/mcux-sdk
- url = https://github.com/NXPmicro/mcux-sdk.git
-[submodule "hw/mcu/nxp/nxp_sdk"]
- path = hw/mcu/nxp/nxp_sdk
- url = https://github.com/hathach/nxp_sdk.git
-[submodule "hw/mcu/mindmotion/mm32sdk"]
- path = hw/mcu/mindmotion/mm32sdk
- url = https://github.com/zhangslice/mm32sdk.git
-[submodule "hw/mcu/gd/nuclei-sdk"]
- path = hw/mcu/gd/nuclei-sdk
- url = https://github.com/Nuclei-Software/nuclei-sdk.git
diff --git a/tinyusb/.readthedocs.yaml b/tinyusb/.readthedocs.yaml
deleted file mode 100755
index e83cd90f..00000000
--- a/tinyusb/.readthedocs.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-# .readthedocs.yaml
-# Read the Docs configuration file
-# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
-
-version: 2
-
-sphinx:
- configuration: docs/conf.py
-
-python:
- version: 3.8
- install:
- - requirements: docs/requirements.txt
-
-submodules:
- include: []
- recursive: false
- \ No newline at end of file
diff --git a/tinyusb/CODE_OF_CONDUCT.rst b/tinyusb/CODE_OF_CONDUCT.rst
deleted file mode 100755
index 4035c528..00000000
--- a/tinyusb/CODE_OF_CONDUCT.rst
+++ /dev/null
@@ -1,88 +0,0 @@
-***************
-Code of Conduct
-***************
-
-Our Pledge
-----------
-
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our
-project and our community a harassment-free experience for everyone,
-regardless of age, body size, disability, ethnicity, sex
-characteristics, gender identity and expression, level of experience,
-education, socio-economic status, nationality, personal appearance,
-race, religion, or sexual identity and orientation.
-
-Our Standards
--------------
-
-Examples of behavior that contributes to creating a positive environment
-include:
-
-- Using welcoming and inclusive language
-- Being respectful of differing viewpoints and experiences
-- Gracefully accepting constructive criticism
-- Focusing on what is best for the community
-- Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-- The use of sexualized language or imagery and unwelcome sexual
- attention or advances
-- Trolling, insulting/derogatory comments, and personal or political
- attacks
-- Public or private harassment
-- Publishing others' private information, such as a physical or
- electronic address, without explicit permission
-- Other conduct which could reasonably be considered inappropriate in a
- professional setting
-
-Our Responsibilities
---------------------
-
-Project maintainers are responsible for clarifying the standards of
-acceptable behavior and are expected to take appropriate and fair
-corrective action in response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit,
-or reject comments, commits, code, wiki edits, issues, and other
-contributions that are not aligned to this Code of Conduct, or to ban
-temporarily or permanently any contributor for other behaviors that they
-deem inappropriate, threatening, offensive, or harmful.
-
-Scope
------
-
-This Code of Conduct applies both within project spaces and in public
-spaces when an individual is representing the project or its community.
-Examples of representing a project or community include using an
-official project e-mail address, posting via an official social media
-account, or acting as an appointed representative at an online or
-offline event. Representation of a project may be further defined and
-clarified by project maintainers.
-
-Enforcement
------------
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may
-be reported by contacting the project team at thach@tinyusb.org. All
-complaints will be reviewed and investigated and will result in a
-response that is deemed necessary and appropriate to the circumstances.
-The project team is obligated to maintain confidentiality with regard to
-the reporter of an incident. Further details of specific enforcement
-policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in
-good faith may face temporary or permanent repercussions as determined
-by other members of the project's leadership.
-
-Attribution
------------
-
-This Code of Conduct is adapted from the `Contributor
-Covenant <https://www.contributor-covenant.org>`__, version 1.4,
-available at
-https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
-
-For answers to common questions about this code of conduct, see
-https://www.contributor-covenant.org/faq
diff --git a/tinyusb/CONTRIBUTORS.rst b/tinyusb/CONTRIBUTORS.rst
deleted file mode 100755
index 040f4016..00000000
--- a/tinyusb/CONTRIBUTORS.rst
+++ /dev/null
@@ -1,189 +0,0 @@
-************
-Contributors
-************
-
-Special thanks to all the people who spent their precious time and effort to help this project so far.
-list contributors and their awesome work for the stack:
-
-Notable contributors
-====================
-
-(sorted alphabetically)
-
-`Adafruit Team <https://github.com/adafruit>`__
------------------------------------------------
-
-- Main supporter and sponsor for hardware boards and kits
-- Discussion and suggestion for feature and improvement
-- Design the project logo
-
-
-`Ha Thach <https://github.com/hathach>`__
------------------------------------------
-
-- *Author and maintainer*
-- Most features development
-
-
-`Hristo Gochkov <https://github.com/me-no-dev>`__
--------------------------------------------------
-
-- Improve ESP32s2 DCD
-
-
-`Jan Dümpelmann <https://github.com/duempel>`__
------------------------------------------------
-
-- Improve transfer performance for Synopsys DCD for STM32 MCUs
-
-
-`Jeff Epler <https://github.com/jepler>`__
-------------------------------------------
-
-- Improve MIDI class driver
-
-
-`Jerzy Kasenberg <https://github.com/kasjer>`__
------------------------------------------------
-
-- Add new DCD port for Dialog DA1469x
-- Add new class driver for Bluetooth HCI
-- Add ISO transfer for STM32 Synopsys, Nordic nRF, Dialog DA1469x
-- Improve Audio driver and add uac2\_headset example
-- Improve STM32 Synopsys DCD with various PRs
-
-
-`J McCarthy <https://github.com/xmos-jmccarthy>`__
---------------------------------------------------
-
-- Add new DFU 1.1 class driver
-- Add new example for dfu
-
-
-`Kamil Tomaszewski <https://github.com/kamtom480>`__
-----------------------------------------------------
-
-- Add new DCD port for Sony CXD56 (spresnese board)
-
-
-`Kay Sievers <https://github.com/kaysievers>`__
------------------------------------------------
-
-- Improve MIDI driver with packet API
-
-
-`Koji KITAYAMA <https://github.com/kkitayam>`__
------------------------------------------------
-
-- Add new DCD port for NXP Kinetis KL25
-- Add new DCD port for Renesas RX63n with GR-CITRUS board
-
-
-`Nathan Conrad <https://github.com/pigrew>`__
----------------------------------------------
-
-- Add new DCD port for STM32 fsdev Fullspeed device for STM32 L0,
- F0, F1, F3 etc ...
-- Add new class driver for USB Test and Measurement Class (USBTMC)
-- Various improvement e.g Zero-length packet, Lint setup
-- Board support for STM32F070RB Nucleo, STM32F303 Discovery
-
-
-`Peter Lawrence <https://github.com/majbthrd>`__
-------------------------------------------------
-
-- Add new DCD port for Nuvoton NUC 120, 121, 125, 126, 505
-- Add new class driver for USBNET RNDIS, CDC-ECM
-- Add *net\_lwip\_webserver* example for demonstration of usbnet with
- lwip
-- Board support for NuTiny NUC120, NUC121s, NUC125s, NUC126V, NUC505
-- Improve multiple cdc interfaces API & add cdc\_dual\_ports example
-
-
-`Rafael Silva <https://github.com/perigoso>`__
-----------------------------------------------
-
-- Add new DCD port for Silabs EFM32GG12 with SLTB009A board
-- Rewrite documentation in rst and setup for readthedocs
-
-
-`Raspberry Pi Team <https://github.com/raspberrypi>`__
-------------------------------------------------------
-
-- Add new DCD port for Raspberry Pi RP2040
-- Add new HCD port for Raspberry Pi RP2040
-
-
-`Reinhard Panhuber <https://github.com/PanRe>`__
-------------------------------------------------
-
-- Add new class driver for USB Audio Class 2.0 (UAC2)
-- Rework tu\_fifo with unmasked pointer, add DMA support, and constant
- address support
-- Add new DCD/USBD edpt\_xfer\_fifo() API for optimizing endpoint
- transfer
-- Add and greatly improve Isochronous transfer
-- Add new audio examples: audio\_test and audio\_4\_channel\_mic
-
-
-`Scott Shawcroft <https://github.com/tannewt>`__
-------------------------------------------------
-
-- Add new DCD port for SAMD21 and SAMD51
-- Add new class driver for Musical Instrument Digital Interface
- (MIDI)
-- Improve USBD control transfer, MSC, CDC class driver
-- Board support for Metro M0 & M4 express
-- Write the excellent porting.md documentation
-- Add initial Makefile
-
-`Sean Cross <https://github.com/xobs>`__
-----------------------------------------
-
-- Add new DCD port for ValentyUSB eptri (fomu board)
-
-
-`Sylvain "tnt" Munaut <https://github.com/smunaut>`__
------------------------------------------------------
-
-- Add new class driver for DFU Runtime
-
-
-`Timon Skerutsch <https://github.com/PTS93>`__
-----------------------------------------------
-
-- Add hid\_test.js script and extensive test for bi-directional raw HID
-
-
-`Tod E. Kurt <https://github.com/todbot>`__
--------------------------------------------
-
-- Add hid\_test.js script and extensive test for bi-directional raw HID
-
-
-`Uwe Bonnes <https://github.com/UweBonnes>`__
----------------------------------------------
-
-- Improve STM32 Synopsys highspeed DCD
-
-
-`William D. Jones <https://github.com/cr1901>`__
-------------------------------------------------
-
-- Add new DCD port for Synopsys DesignWare for STM32 L4, F2, F4,
- F7, H7 etc ...
-- Add new DCD port for TI MSP430
-- Board support for STM32F407 Discovery, STM32H743 Nucleo, pyboard
- v1.1, msp\_exp430f5529lp etc ...
-
-
-`Zixun Li <https://github.com/HiFiPhile>`__
------------------------------------------------
-
-- Add new DCD port for Microchip SAMx7x
-- Add IAR compiler support
-- Improve UAC2, CDC, DFU class driver
-
-
-`Full contributors list <https://github.com/hathach/tinyusb/contributors>`__
-============================================================================
diff --git a/tinyusb/LICENSE b/tinyusb/LICENSE
deleted file mode 100755
index ddd4ab41..00000000
--- a/tinyusb/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2018, hathach (tinyusb.org)
-
-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.
diff --git a/tinyusb/README.rst b/tinyusb/README.rst
deleted file mode 100755
index 2119c26d..00000000
--- a/tinyusb/README.rst
+++ /dev/null
@@ -1,140 +0,0 @@
-.. figure:: docs/assets/logo.svg
- :alt: TinyUSB
-
-|Build Status| |Documentation Status| |License|
-
-TinyUSB is an open-source cross-platform USB Host/Device stack for
-embedded system, designed to be memory-safe with no dynamic allocation
-and thread-safe with all interrupt events are deferred then handled in
-the non-ISR task function.
-
-Please take a look at the online `documentation <https://docs.tinyusb.org/>`__.
-
-.. figure:: docs/assets/stack.svg
- :width: 500px
- :alt: stackup
-
-::
-
- .
- ├── docs # Documentation
- ├── examples # Sample with Makefile build support
- ├── hw
- │   ├── bsp # Supported boards source files
- │   └── mcu # Low level mcu core & peripheral drivers
- ├── lib # Sources from 3rd party such as freeRTOS, fatfs ...
- ├── src # All sources files for TinyUSB stack itself.
- ├── test # Unit tests for the stack
- └── tools # Files used internally
-
-Supported MCUs
-==============
-
-The stack supports the following MCUs:
-
-- **Dialog:** DA1469x
-- **Espressif:** ESP32-S2, ESP32-S3
-- **MicroChip:** SAMD11, SAMD21, SAMD51, SAME5x, SAMG55, SAML21, SAML22, SAME7x
-- **NordicSemi:** nRF52833, nRF52840
-- **Nuvoton:** NUC120, NUC121/NUC125, NUC126, NUC505
-- **NXP:**
-
- - iMX RT Series: RT1011, RT1015, RT1021, RT1052, RT1062, RT1064
- - Kinetis: KL25
- - LPC Series: 11u, 13, 15, 17, 18, 40, 43, 51u, 54, 55
-
-- **Raspberry Pi:** RP2040
-- **Renesas:** RX63N, RX65N
-- **Silabs:** EFM32GG12
-- **Sony:** CXD56
-- **ST:** STM32 series: L0, F0, F1, F2, F3, F4, F7, H7 both FullSpeed and HighSpeed
-- **TI:** MSP430
-- **ValentyUSB:** eptri
-
-Here is the list of `Supported Devices`_ that can be used with provided examples.
-
-Device Stack
-============
-
-Supports multiple device configurations by dynamically changing usb descriptors. Low power functions such like suspend, resume, and remote wakeup. Following device classes are supported:
-
-- Audio Class 2.0 (UAC2)
-- Bluetooth Host Controller Interface (BTH HCI)
-- Communication Class (CDC)
-- Device Firmware Update (DFU): DFU mode (WIP) and Runtinme
-- Human Interface Device (HID): Generic (In & Out), Keyboard, Mouse, Gamepad etc ...
-- Mass Storage Class (MSC): with multiple LUNs
-- Musical Instrument Digital Interface (MIDI)
-- Network with RNDIS, CDC-ECM (work in progress)
-- USB Test and Measurement Class (USBTMC)
-- Vendor-specific class support with generic In & Out endpoints. Can be used with MS OS 2.0 compatible descriptor to load winUSB driver without INF file.
-- `WebUSB <https://github.com/WICG/webusb>`__ with vendor-specific class
-
-If you have special need, `usbd_app_driver_get_cb()` can be used to write your own class driver without modifying the stack. Here is how RPi team add their reset interface [raspberrypi/pico-sdk#197](https://github.com/raspberrypi/pico-sdk/pull/197)
-
-Host Stack
-==========
-
-- Human Interface Device (HID): Keyboard, Mouse, Generic
-- Mass Storage Class (MSC)
-- Hub currently only supports 1 level of hub (due to my laziness)
-
-OS Abstraction layer
-====================
-
-TinyUSB is completely thread-safe by pushing all ISR events into a central queue, then process it later in the non-ISR context task function. It also uses semaphore/mutex to access shared resources such as CDC FIFO. Therefore the stack needs to use some of OS's basic APIs. Following OSes are already supported out of the box.
-
-- **No OS**
-- **FreeRTOS**
-- **Mynewt** Due to the newt package build system, Mynewt examples are better to be on its [own repo](https://github.com/hathach/mynewt-tinyusb-example)
-
-Local Docs
-==========
-
-- Info
-
- - `Uses`_
- - `Changelog`_
- - `Contributors`_
-
-- `Reference`_
-
- - `Supported Devices`_
- - `Gettin Started`_
- - `Concurrency`_
-
-- `Contributing`_
-
- - `Code of Conduct`_
- - `Structure`_
- - `Porting`_
-
-License
-=======
-
-All TinyUSB sources in the ``src`` folder are licensed under MIT
-license, `Full license is here <LICENSE>`__. However, each file can be
-individually licensed especially those in ``lib`` and ``hw/mcu`` folder.
-Please make sure you understand all the license term for files you use
-in your project.
-
-
-.. |Build Status| image:: https://github.com/hathach/tinyusb/workflows/Build/badge.svg
- :target: https://github.com/hathach/tinyusb/actions
-.. |Documentation Status| image:: https://readthedocs.org/projects/tinyusb/badge/?version=latest
- :target: https://docs.tinyusb.org/en/latest/?badge=latest
-.. |License| image:: https://img.shields.io/badge/license-MIT-brightgreen.svg
- :target: https://opensource.org/licenses/MIT
-
-
-.. _Uses: docs/info/uses.rst
-.. _Changelog: docs/info/changelog.rst
-.. _Contributors: CONTRIBUTORS.rst
-.. _Reference: docs/reference/index.rst
-.. _Supported Devices: docs/reference/supported.rst
-.. _Gettin Started: docs/reference/getting_started.rst
-.. _Concurrency: docs/reference/concurrency.rst
-.. _Contributing: docs/contributing/index.rst
-.. _Code of Conduct: CODE_OF_CONDUCT.rst
-.. _Structure: docs/contributing/structure.rst
-.. _Porting: docs/contributing/porting.rst
diff --git a/tinyusb/docs/assets/logo.svg b/tinyusb/docs/assets/logo.svg
deleted file mode 100755
index 01c763ba..00000000
--- a/tinyusb/docs/assets/logo.svg
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="280" height="140" version="1.1" viewBox="0 0 74.083 37.042" xmlns="http://www.w3.org/2000/svg">
- <g transform="translate(-60.931 -79.245)">
- <g transform="matrix(1.0442 0 0 1.1531 -27.105 33.588)" fill="#fff">
- <path d="m86.972 39.594c-1.4683 3.2e-5 -2.6588 1.181-2.66 2.6384v26.844c3.3e-5 1.4583 1.1909 2.6404 2.66 2.6404h65.63c1.469-3.2e-5 2.66-1.1822 2.66-2.6404v-26.844c-1e-3 -1.4575-1.1917-2.6384-2.66-2.6384z" color="#000000" fill="#fff" style="-inkscape-stroke:none"/>
- </g>
- <g transform="matrix(.35278 0 0 -.35278 -160.36 421.93)" fill="#231f20">
- <path transform="translate(672.09 955.48)" d="m0 0h-21.484v-12.601h-5.349v-6.436h5.349v-25.383c0-11.331 7.252-13.87 17.223-13.87 4.352 0 8.613 0.272 12.873 0.907v6.073c-0.816-0.09-2.266-0.362-3.535-0.362-3.807 0-5.077 0.816-5.077 4.896v27.739h8.612v6.436h-8.612z"/>
- <path transform="translate(693.61 925.33)" d="m0 0h-0.049c-1.518 0-2.165-0.896-2.165-2.24v-0.05h4.504v0.05c0 1.344-0.771 2.24-2.29 2.24"/>
- <path transform="translate(700.92 925.5)" d="m0 0h-0.124c-1.443 0-2.265-0.995-2.265-2.389v-0.074h4.654v0.074c0 1.394-0.822 2.389-2.265 2.389"/>
- <path transform="translate(750.09 943.78)" d="m0 0c-6.165 0-11.876-2.267-14.505-5.893v4.986h-20.578v-45.326h21.484v36.533c1.27 0.272 2.449 0.453 3.717 0.453 4.715 0 5.44-2.538 5.44-6.436v-30.55h21.484v30.278c0 11.694-7.523 15.955-17.042 15.955"/>
- <path transform="translate(811.83 942.88)" d="m0 0-10.516-23.57-11.784 23.57h-23.388l24.204-48.046-6.799-15.411h8.249l28.193 63.457z"/>
- <path transform="translate(706 920)" d="m0 0h-17.421v2.637c0 2.938 1.194 5.675 4.43 5.675h0.124c2.24 0 3.335-1.269 3.932-2.514 0.647 1.469 1.667 2.738 3.883 2.738h0.224c3.086 0 4.828-2.39 4.828-5.774zm-0.598-9.412h-3.16c0.622 1.07 0.971 1.917 0.971 2.737 0 0.871-0.424 1.618-1.493 1.618h-0.05c-0.797 0-1.394-0.249-3.037-1.692-2.339-2.065-3.459-2.912-5.574-2.912h-0.05c-2.787 0-4.555 1.816-4.555 4.231 0 1.219 0.175 1.941 0.548 2.687h3.161c-0.548-0.945-0.797-1.518-0.797-2.314 0-0.845 0.548-1.568 1.493-1.568h0.05c0.821 0 1.12 0.25 2.788 1.692 2.762 2.39 3.832 2.912 5.824 2.912h0.048c2.739 0 4.555-1.917 4.555-4.305 0-1.195-0.298-2.215-0.722-3.086m-4.479-10.93h-12.344v3.011h12.643c1.567 0 2.189 0.548 2.189 1.319 0 0.772-0.622 1.32-2.189 1.32h-12.643v3.01h12.344c3.658 0 5.301-1.841 5.301-4.33 0-2.488-1.643-4.33-5.301-4.33m-9.641 53.817h12.114v-10.601h-12.114zm14.114 2h-16.114v-12.601h-2.685v-45.326h21.484v45.326h-2.685z"/>
- <path d="m692.79 947.02h2.827v2.319h-2.827z"/>
- <path d="m699.06 947.02h2.826v2.319h-2.826z"/>
- </g>
- </g>
-</svg>
diff --git a/tinyusb/docs/assets/stack.svg b/tinyusb/docs/assets/stack.svg
deleted file mode 100755
index 85fe35e9..00000000
--- a/tinyusb/docs/assets/stack.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg version="1.1" viewBox="0.0 0.0 510.73490813648294 310.08923884514434" fill="none" stroke="none" stroke-linecap="square" stroke-miterlimit="10" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"><clipPath id="p.0"><path d="m0 0l510.7349 0l0 310.08923l-510.7349 0l0 -310.08923z" clip-rule="nonzero"/></clipPath><g clip-path="url(#p.0)"><path fill="#ffffff" d="m0 0l510.7349 0l0 310.08923l-510.7349 0z" fill-rule="evenodd"/><path fill="#cfe2f3" d="m28.509478 231.92447l192.28346 0l0 48.629913l-192.28346 0z" fill-rule="evenodd"/><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m28.509478 231.92447l192.28346 0l0 48.629913l-192.28346 0z" fill-rule="evenodd"/><path fill="#000000" d="m55.37576 252.31943l0 -10.484375l1.390625 0l0 4.296875l5.453125 0l0 -4.296875l1.390625 0l0 10.484375l-1.390625 0l0 -4.9375l-5.453125 0l0 4.9375l-1.390625 0zm9.8967705 -3.796875q0 -2.109375 1.171875 -3.125q0.984375 -0.84375 2.390625 -0.84375q1.578125 0 2.5625 1.03125q1.0 1.015625 1.0 2.828125q0 1.46875 -0.4375 2.3125q-0.4375 0.828125 -1.28125 1.296875q-0.84375 0.46875 -1.84375 0.46875q-1.59375 0 -2.578125 -1.015625q-0.984375 -1.03125 -0.984375 -2.953125zm1.328125 0q0 1.453125 0.625 2.1875q0.640625 0.71875 1.609375 0.71875q0.96875 0 1.59375 -0.71875q0.640625 -0.734375 0.640625 -2.234375q0 -1.40625 -0.640625 -2.125q-0.640625 -0.734375 -1.59375 -0.734375q-0.96875 0 -1.609375 0.71875q-0.625 0.71875 -0.625 2.1875zm6.791733 1.53125l1.265625 -0.203125q0.109375 0.765625 0.59375 1.171875q0.5 0.40625 1.375 0.40625q0.890625 0 1.3125 -0.359375q0.4375 -0.359375 0.4375 -0.84375q0 -0.4375 -0.375 -0.6875q-0.265625 -0.171875 -1.3125 -0.4375q-1.421875 -0.359375 -1.96875 -0.609375q-0.546875 -0.265625 -0.828125 -0.734375q-0.28125 -0.46875 -0.28125 -1.015625q0 -0.515625 0.21875 -0.9375q0.234375 -0.4375 0.640625 -0.734375q0.296875 -0.21875 0.8125 -0.359375q0.53125 -0.15625 1.125 -0.15625q0.890625 0 1.5625 0.265625q0.671875 0.25 1.0 0.6875q0.328125 0.4375 0.4375 1.171875l-1.25 0.171875q-0.09375 -0.578125 -0.5 -0.90625q-0.40625 -0.34375 -1.15625 -0.34375q-0.890625 0 -1.28125 0.296875q-0.375 0.296875 -0.375 0.6875q0 0.25 0.15625 0.453125q0.15625 0.203125 0.5 0.34375q0.1875 0.078125 1.140625 0.328125q1.359375 0.359375 1.890625 0.59375q0.546875 0.234375 0.859375 0.6875q0.3125 0.4375 0.3125 1.09375q0 0.640625 -0.375 1.21875q-0.375 0.5625 -1.09375 0.875q-0.703125 0.3125 -1.59375 0.3125q-1.484375 0 -2.265625 -0.609375q-0.765625 -0.625 -0.984375 -1.828125zm10.65625 1.109375l0.1875 1.140625q-0.546875 0.109375 -0.984375 0.109375q-0.6875 0 -1.078125 -0.21875q-0.390625 -0.21875 -0.546875 -0.578125q-0.15625 -0.359375 -0.15625 -1.515625l0 -4.375l-0.953125 0l0 -1.0l0.953125 0l0 -1.890625l1.28125 -0.765625l0 2.65625l1.296875 0l0 1.0l-1.296875 0l0 4.4375q0 0.546875 0.0625 0.71875q0.078125 0.15625 0.21875 0.25q0.15625 0.078125 0.453125 0.078125q0.203125 0 0.5625 -0.046875zm12.972076 -2.515625l1.390625 0.34375q-0.4375 1.703125 -1.578125 2.609375q-1.125 0.890625 -2.765625 0.890625q-1.6875 0 -2.75 -0.6875q-1.0625 -0.6875 -1.625 -2.0q-0.546875 -1.3125 -0.546875 -2.8125q0 -1.640625 0.625 -2.859375q0.625 -1.21875 1.78125 -1.84375q1.15625 -0.640625 2.546875 -0.640625q1.5625 0 2.640625 0.8125q1.078125 0.796875 1.5 2.25l-1.375 0.3125q-0.359375 -1.140625 -1.0625 -1.65625q-0.6875 -0.53125 -1.734375 -0.53125q-1.21875 0 -2.03125 0.578125q-0.8125 0.578125 -1.140625 1.5625q-0.328125 0.96875 -0.328125 2.015625q0 1.328125 0.390625 2.328125q0.390625 1.0 1.21875 1.5q0.828125 0.484375 1.78125 0.484375q1.171875 0 1.96875 -0.671875q0.8125 -0.671875 1.09375 -1.984375zm2.4592743 -0.125q0 -2.109375 1.171875 -3.125q0.984375 -0.84375 2.390625 -0.84375q1.578125 0 2.5625 1.03125q1.0 1.015625 1.0 2.828125q0 1.46875 -0.4375 2.3125q-0.4375 0.828125 -1.28125 1.296875q-0.84375 0.46875 -1.84375 0.46875q-1.59375 0 -2.578125 -1.015625q-0.984375 -1.03125 -0.984375 -2.953125zm1.328125 0q0 1.453125 0.625 2.1875q0.640625 0.71875 1.609375 0.71875q0.96875 0 1.59375 -0.71875q0.640625 -0.734375 0.640625 -2.234375q0 -1.40625 -0.640625 -2.125q-0.640625 -0.734375 -1.59375 -0.734375q-0.96875 0 -1.609375 0.71875q-0.625 0.71875 -0.625 2.1875zm7.307358 3.796875l0 -7.59375l1.15625 0l0 1.078125q0.84375 -1.25 2.421875 -1.25q0.6875 0 1.265625 0.25q0.578125 0.234375 0.859375 0.640625q0.28125 0.40625 0.40625 0.953125q0.0625 0.359375 0.0625 1.25l0 4.671875l-1.28125 0l0 -4.625q0 -0.78125 -0.15625 -1.171875q-0.15625 -0.390625 -0.546875 -0.625q-0.375 -0.234375 -0.890625 -0.234375q-0.8125 0 -1.421875 0.53125q-0.59375 0.515625 -0.59375 1.96875l0 4.15625l-1.28125 0zm10.963608 -1.15625l0.1875 1.140625q-0.546875 0.109375 -0.984375 0.109375q-0.6875 0 -1.078125 -0.21875q-0.390625 -0.21875 -0.546875 -0.578125q-0.15625 -0.359375 -0.15625 -1.515625l0 -4.375l-0.953125 0l0 -1.0l0.953125 0l0 -1.890625l1.28125 -0.765625l0 2.65625l1.296875 0l0 1.0l-1.296875 0l0 4.4375q0 0.546875 0.0625 0.71875q0.078125 0.15625 0.21875 0.25q0.15625 0.078125 0.453125 0.078125q0.203125 0 0.5625 -0.046875zm1.2438507 1.15625l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0zm4.4118958 -3.796875q0 -2.109375 1.171875 -3.125q0.984375 -0.84375 2.3906326 -0.84375q1.578125 0 2.5625 1.03125q1.0 1.015625 1.0 2.828125q0 1.46875 -0.4375 2.3125q-0.4375 0.828125 -1.28125 1.296875q-0.84375 0.46875 -1.84375 0.46875q-1.5937576 0 -2.5781326 -1.015625q-0.984375 -1.03125 -0.984375 -2.953125zm1.328125 0q0 1.453125 0.625 2.1875q0.640625 0.71875 1.6093826 0.71875q0.96875 0 1.59375 -0.71875q0.640625 -0.734375 0.640625 -2.234375q0 -1.40625 -0.640625 -2.125q-0.640625 -0.734375 -1.59375 -0.734375q-0.9687576 0 -1.6093826 0.71875q-0.625 0.71875 -0.625 2.1875zm7.2761154 3.796875l0 -10.484375l1.28125 0l0 10.484375l-1.28125 0zm3.2561493 0l0 -10.484375l1.28125 0l0 10.484375l-1.28125 0zm8.490524 -2.453125l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.171875 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.515625 0 2.484375 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.65625 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.5 -0.375 0.796875 -1.203125zm-4.234375 -2.078125l4.25 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.625 -0.75 -1.609375 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm7.166733 4.53125l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0zm9.124496 0l0 -10.484375l3.625 0q1.21875 0 1.859375 0.140625q0.90625 0.203125 1.546875 0.75q0.828125 0.703125 1.234375 1.796875q0.40625 1.09375 0.40625 2.5q0 1.1875 -0.28125 2.109375q-0.265625 0.921875 -0.703125 1.53125q-0.4375 0.609375 -0.96875 0.953125q-0.515625 0.34375 -1.25 0.53125q-0.71875 0.171875 -1.671875 0.171875l-3.796875 0zm1.390625 -1.234375l2.25 0q1.03125 0 1.625 -0.1875q0.59375 -0.203125 0.9375 -0.546875q0.5 -0.5 0.765625 -1.328125q0.28125 -0.84375 0.28125 -2.03125q0 -1.640625 -0.546875 -2.515625q-0.53125 -0.890625 -1.3125 -1.1875q-0.546875 -0.21875 -1.796875 -0.21875l-2.203125 0l0 8.015625zm9.021759 1.234375l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0zm4.8962708 -9.015625l0 -1.46875l1.296875 0l0 1.46875l-1.296875 0zm0 9.015625l0 -7.59375l1.296875 0l0 7.59375l-1.296875 0zm5.3655396 0l-2.890625 -7.59375l1.359375 0l1.625 4.546875q0.265625 0.734375 0.5 1.53125q0.15625 -0.609375 0.46875 -1.453125l1.6875 -4.625l1.328125 0l-2.875 7.59375l-1.203125 0zm10.421875 -2.453125l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.171875 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.515625 0 2.484375 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.65625 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.5 -0.375 0.796875 -1.203125zm-4.234375 -2.078125l4.25 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.625 -0.75 -1.609375 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm7.1667175 4.53125l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0z" fill-rule="nonzero"/><path fill="#000000" d="m109.94667 270.31943l0 -10.484375l1.390625 0l0 4.296875l5.453125 0l0 -4.296875l1.390625 0l0 10.484375l-1.390625 0l0 -4.9375l-5.453125 0l0 4.9375l-1.390625 0zm18.021774 -3.671875l1.390625 0.34375q-0.4375 1.703125 -1.578125 2.609375q-1.125 0.890625 -2.765625 0.890625q-1.6875 0 -2.75 -0.6875q-1.0625 -0.6875 -1.625 -2.0q-0.546875 -1.3125 -0.546875 -2.8125q0 -1.640625 0.625 -2.859375q0.625 -1.21875 1.78125 -1.84375q1.15625 -0.640625 2.546875 -0.640625q1.5625 0 2.640625 0.8125q1.078125 0.796875 1.5 2.25l-1.375 0.3125q-0.359375 -1.140625 -1.0625 -1.65625q-0.6875 -0.53125 -1.734375 -0.53125q-1.21875 0 -2.03125 0.578125q-0.8125 0.578125 -1.140625 1.5625q-0.328125 0.96875 -0.328125 2.015625q0 1.328125 0.390625 2.328125q0.390625 1.0 1.21875 1.5q0.828125 0.484375 1.78125 0.484375q1.171875 0 1.96875 -0.671875q0.8125 -0.671875 1.09375 -1.984375zm3.0998993 3.671875l0 -10.484375l3.625 0q1.21875 0 1.859375 0.140625q0.90625 0.203125 1.546875 0.75q0.828125 0.703125 1.234375 1.796875q0.40625 1.09375 0.40625 2.5q0 1.1875 -0.28125 2.109375q-0.265625 0.921875 -0.703125 1.53125q-0.4375 0.609375 -0.96875 0.953125q-0.515625 0.34375 -1.25 0.53125q-0.71875 0.171875 -1.671875 0.171875l-3.796875 0zm1.390625 -1.234375l2.25 0q1.03125 0 1.625 -0.1875q0.59375 -0.203125 0.9375 -0.546875q0.5 -0.5 0.765625 -1.328125q0.28125 -0.84375 0.28125 -2.03125q0 -1.640625 -0.546875 -2.515625q-0.53125 -0.890625 -1.3125 -1.1875q-0.546875 -0.21875 -1.796875 -0.21875l-2.203125 0l0 8.015625z" fill-rule="nonzero"/><path fill="#d9ead3" d="m220.78944 231.92447l192.28346 0l0 48.629913l-192.28346 0z" fill-rule="evenodd"/><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m220.78944 231.92447l192.28346 0l0 48.629913l-192.28346 0z" fill-rule="evenodd"/><path fill="#000000" d="m240.27715 252.31943l0 -10.484375l3.625 0q1.21875 0 1.859375 0.140625q0.90625 0.203125 1.546875 0.75q0.828125 0.703125 1.234375 1.796875q0.40625 1.09375 0.40625 2.5q0 1.1875 -0.28125 2.109375q-0.265625 0.921875 -0.703125 1.53125q-0.4375 0.609375 -0.96875 0.953125q-0.515625 0.34375 -1.25 0.53125q-0.71875 0.171875 -1.671875 0.171875l-3.796875 0zm1.390625 -1.234375l2.25 0q1.03125 0 1.625 -0.1875q0.59375 -0.203125 0.9375 -0.546875q0.5 -0.5 0.765625 -1.328125q0.28125 -0.84375 0.28125 -2.03125q0 -1.640625 -0.546875 -2.515625q-0.53125 -0.890625 -1.3125 -1.1875q-0.546875 -0.21875 -1.796875 -0.21875l-2.203125 0l0 8.015625zm14.240524 -1.21875l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.171875 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.515625 0 2.484375 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.65625 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.5 -0.375 0.796875 -1.203125zm-4.234375 -2.078125l4.25 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.625 -0.75 -1.609375 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm9.291718 4.53125l-2.890625 -7.59375l1.359375 0l1.625 4.546875q0.265625 0.734375 0.5 1.53125q0.15625 -0.609375 0.46875 -1.453125l1.6875 -4.625l1.328125 0l-2.875 7.59375l-1.203125 0zm5.21875 -9.015625l0 -1.46875l1.296875 0l0 1.46875l-1.296875 0zm0 9.015625l0 -7.59375l1.296875 0l0 7.59375l-1.296875 0zm8.20929 -2.78125l1.265625 0.15625q-0.203125 1.3125 -1.0625 2.0625q-0.84375 0.734375 -2.09375 0.734375q-1.5625 0 -2.515625 -1.015625q-0.9375 -1.03125 -0.9375 -2.921875q0 -1.234375 0.40625 -2.15625q0.40625 -0.921875 1.234375 -1.375q0.84375 -0.46875 1.8125 -0.46875q1.25 0 2.03125 0.625q0.78125 0.625 1.015625 1.765625l-1.265625 0.203125q-0.171875 -0.765625 -0.625 -1.15625q-0.453125 -0.390625 -1.09375 -0.390625q-0.984375 0 -1.59375 0.703125q-0.609375 0.703125 -0.609375 2.203125q0 1.53125 0.578125 2.234375q0.59375 0.6875 1.546875 0.6875q0.75 0 1.265625 -0.453125q0.515625 -0.46875 0.640625 -1.4375zm7.578125 0.328125l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.171875 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.515625 0 2.484375 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.65625 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.5 -0.375 0.796875 -1.203125zm-4.234375 -2.078125l4.25 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.625 -0.75 -1.609375 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm18.894958 0.859375l1.390625 0.34375q-0.4375 1.703125 -1.578125 2.609375q-1.125 0.890625 -2.765625 0.890625q-1.6875 0 -2.75 -0.6875q-1.0625 -0.6875 -1.625 -2.0q-0.546875 -1.3125 -0.546875 -2.8125q0 -1.640625 0.625 -2.859375q0.625 -1.21875 1.78125 -1.84375q1.15625 -0.640625 2.546875 -0.640625q1.5625 0 2.640625 0.8125q1.078125 0.796875 1.5 2.25l-1.375 0.3125q-0.359375 -1.140625 -1.0625 -1.65625q-0.6875 -0.53125 -1.734375 -0.53125q-1.21875 0 -2.03125 0.578125q-0.8125 0.578125 -1.140625 1.5625q-0.328125 0.96875 -0.328125 2.015625q0 1.328125 0.390625 2.328125q0.390625 1.0 1.21875 1.5q0.828125 0.484375 1.78125 0.484375q1.171875 0 1.96875 -0.671875q0.8125 -0.671875 1.09375 -1.984375zm2.459259 -0.125q0 -2.109375 1.171875 -3.125q0.984375 -0.84375 2.390625 -0.84375q1.578125 0 2.5625 1.03125q1.0 1.015625 1.0 2.828125q0 1.46875 -0.4375 2.3125q-0.4375 0.828125 -1.28125 1.296875q-0.84375 0.46875 -1.84375 0.46875q-1.59375 0 -2.578125 -1.015625q-0.984375 -1.03125 -0.984375 -2.953125zm1.328125 0q0 1.453125 0.625 2.1875q0.640625 0.71875 1.609375 0.71875q0.96875 0 1.59375 -0.71875q0.640625 -0.734375 0.640625 -2.234375q0 -1.40625 -0.640625 -2.125q-0.640625 -0.734375 -1.59375 -0.734375q-0.96875 0 -1.609375 0.71875q-0.625 0.71875 -0.625 2.1875zm7.307373 3.796875l0 -7.59375l1.15625 0l0 1.078125q0.84375 -1.25 2.421875 -1.25q0.6875 0 1.265625 0.25q0.578125 0.234375 0.859375 0.640625q0.28125 0.40625 0.40625 0.953125q0.0625 0.359375 0.0625 1.25l0 4.671875l-1.28125 0l0 -4.625q0 -0.78125 -0.15625 -1.171875q-0.15625 -0.390625 -0.546875 -0.625q-0.375 -0.234375 -0.890625 -0.234375q-0.8125 0 -1.421875 0.53125q-0.59375 0.515625 -0.59375 1.96875l0 4.15625l-1.28125 0zm10.963593 -1.15625l0.1875 1.140625q-0.546875 0.109375 -0.984375 0.109375q-0.6875 0 -1.078125 -0.21875q-0.390625 -0.21875 -0.546875 -0.578125q-0.15625 -0.359375 -0.15625 -1.515625l0 -4.375l-0.953125 0l0 -1.0l0.953125 0l0 -1.890625l1.28125 -0.765625l0 2.65625l1.296875 0l0 1.0l-1.296875 0l0 4.4375q0 0.546875 0.0625 0.71875q0.078125 0.15625 0.21875 0.25q0.15625 0.078125 0.453125 0.078125q0.203125 0 0.5625 -0.046875zm1.243866 1.15625l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0zm4.4118958 -3.796875q0 -2.109375 1.171875 -3.125q0.984375 -0.84375 2.390625 -0.84375q1.578125 0 2.5625 1.03125q1.0 1.015625 1.0 2.828125q0 1.46875 -0.4375 2.3125q-0.4375 0.828125 -1.28125 1.296875q-0.84375 0.46875 -1.84375 0.46875q-1.59375 0 -2.578125 -1.015625q-0.984375 -1.03125 -0.984375 -2.953125zm1.328125 0q0 1.453125 0.625 2.1875q0.640625 0.71875 1.609375 0.71875q0.96875 0 1.59375 -0.71875q0.640625 -0.734375 0.640625 -2.234375q0 -1.40625 -0.640625 -2.125q-0.640625 -0.734375 -1.59375 -0.734375q-0.96875 0 -1.609375 0.71875q-0.625 0.71875 -0.625 2.1875zm7.2760925 3.796875l0 -10.484375l1.28125 0l0 10.484375l-1.28125 0zm3.2561646 0l0 -10.484375l1.28125 0l0 10.484375l-1.28125 0zm8.490509 -2.453125l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.171875 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.515625 0 2.484375 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.65625 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.5 -0.375 0.796875 -1.203125zm-4.234375 -2.078125l4.25 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.625 -0.75 -1.609375 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm7.166748 4.53125l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0zm9.124481 0l0 -10.484375l3.625 0q1.21875 0 1.859375 0.140625q0.90625 0.203125 1.546875 0.75q0.828125 0.703125 1.234375 1.796875q0.40625 1.09375 0.40625 2.5q0 1.1875 -0.28125 2.109375q-0.265625 0.921875 -0.703125 1.53125q-0.4375 0.609375 -0.96875 0.953125q-0.515625 0.34375 -1.25 0.53125q-0.71875 0.171875 -1.671875 0.171875l-3.796875 0zm1.390625 -1.234375l2.25 0q1.03125 0 1.625 -0.1875q0.59375 -0.203125 0.9375 -0.546875q0.5 -0.5 0.765625 -1.328125q0.28125 -0.84375 0.28125 -2.03125q0 -1.640625 -0.546875 -2.515625q-0.53125 -0.890625 -1.3125 -1.1875q-0.546875 -0.21875 -1.796875 -0.21875l-2.203125 0l0 8.015625zm9.02179 1.234375l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0zm4.8962708 -9.015625l0 -1.46875l1.296875 0l0 1.46875l-1.296875 0zm0 9.015625l0 -7.59375l1.296875 0l0 7.59375l-1.296875 0zm5.365509 0l-2.890625 -7.59375l1.359375 0l1.625 4.546875q0.265625 0.734375 0.5 1.53125q0.15625 -0.609375 0.46875 -1.453125l1.6875 -4.625l1.328125 0l-2.875 7.59375l-1.203125 0zm10.421875 -2.453125l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.171875 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.515625 0 2.484375 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.65625 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.5 -0.375 0.796875 -1.203125zm-4.234375 -2.078125l4.25 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.625 -0.75 -1.609375 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm7.166748 4.53125l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0z" fill-rule="nonzero"/><path fill="#000000" d="m302.17975 270.31943l0 -10.484375l3.625 0q1.21875 0 1.859375 0.140625q0.90625 0.203125 1.546875 0.75q0.828125 0.703125 1.234375 1.796875q0.40625 1.09375 0.40625 2.5q0 1.1875 -0.28125 2.109375q-0.265625 0.921875 -0.703125 1.53125q-0.4375 0.609375 -0.96875 0.953125q-0.515625 0.34375 -1.25 0.53125q-0.71875 0.171875 -1.671875 0.171875l-3.796875 0zm1.390625 -1.234375l2.25 0q1.03125 0 1.625 -0.1875q0.59375 -0.203125 0.9375 -0.546875q0.5 -0.5 0.765625 -1.328125q0.28125 -0.84375 0.28125 -2.03125q0 -1.640625 -0.546875 -2.515625q-0.53125 -0.890625 -1.3125 -1.1875q-0.546875 -0.21875 -1.796875 -0.21875l-2.203125 0l0 8.015625zm16.67804 -2.4375l1.390625 0.34375q-0.4375 1.703125 -1.578125 2.609375q-1.125 0.890625 -2.765625 0.890625q-1.6875 0 -2.75 -0.6875q-1.0625 -0.6875 -1.625 -2.0q-0.546875 -1.3125 -0.546875 -2.8125q0 -1.640625 0.625 -2.859375q0.625 -1.21875 1.78125 -1.84375q1.15625 -0.640625 2.546875 -0.640625q1.5625 0 2.640625 0.8125q1.078125 0.796875 1.5 2.25l-1.375 0.3125q-0.359375 -1.140625 -1.0625 -1.65625q-0.6875 -0.53125 -1.734375 -0.53125q-1.21875 0 -2.03125 0.578125q-0.8125 0.578125 -1.140625 1.5625q-0.328125 0.96875 -0.328125 2.015625q0 1.328125 0.390625 2.328125q0.390625 1.0 1.21875 1.5q0.828125 0.484375 1.78125 0.484375q1.171875 0 1.96875 -0.671875q0.8125 -0.671875 1.09375 -1.984375zm3.099884 3.671875l0 -10.484375l3.625 0q1.21875 0 1.859375 0.140625q0.90625 0.203125 1.546875 0.75q0.828125 0.703125 1.234375 1.796875q0.40625 1.09375 0.40625 2.5q0 1.1875 -0.28125 2.109375q-0.265625 0.921875 -0.703125 1.53125q-0.4375 0.609375 -0.96875 0.953125q-0.515625 0.34375 -1.25 0.53125q-0.71875 0.171875 -1.671875 0.171875l-3.796875 0zm1.390625 -1.234375l2.25 0q1.03125 0 1.625 -0.1875q0.59375 -0.203125 0.9375 -0.546875q0.5 -0.5 0.765625 -1.328125q0.28125 -0.84375 0.28125 -2.03125q0 -1.640625 -0.546875 -2.515625q-0.53125 -0.890625 -1.3125 -1.1875q-0.546875 -0.21875 -1.796875 -0.21875l-2.203125 0l0 8.015625z" fill-rule="nonzero"/><path fill="#d9ead3" d="m220.78944 139.45203l192.28346 0l0 48.62993l-192.28346 0z" fill-rule="evenodd"/><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m220.78944 139.45203l192.28346 0l0 48.62993l-192.28346 0z" fill-rule="evenodd"/><path fill="#000000" d="m263.86716 149.36261l1.390625 0l0 6.046875q0 1.59375 -0.359375 2.53125q-0.359375 0.921875 -1.296875 1.5q-0.9375 0.578125 -2.453125 0.578125q-1.46875 0 -2.40625 -0.5q-0.9375 -0.515625 -1.34375 -1.46875q-0.390625 -0.96875 -0.390625 -2.640625l0 -6.046875l1.390625 0l0 6.046875q0 1.375 0.25 2.015625q0.25 0.640625 0.859375 1.0q0.625 0.34375 1.53125 0.34375q1.53125 0 2.171875 -0.6875q0.65625 -0.703125 0.65625 -2.671875l0 -6.046875zm3.2249146 7.109375l1.3125 -0.109375q0.09375 0.78125 0.421875 1.296875q0.34375 0.5 1.0625 0.8125q0.71875 0.3125 1.609375 0.3125q0.796875 0 1.40625 -0.234375q0.609375 -0.234375 0.90625 -0.640625q0.296875 -0.421875 0.296875 -0.90625q0 -0.5 -0.296875 -0.859375q-0.28125 -0.375 -0.9375 -0.625q-0.421875 -0.171875 -1.875 -0.515625q-1.4375 -0.34375 -2.015625 -0.65625q-0.75 -0.390625 -1.125 -0.96875q-0.359375 -0.59375 -0.359375 -1.3125q0 -0.796875 0.4375 -1.484375q0.453125 -0.6875 1.3125 -1.046875q0.875 -0.359375 1.9375 -0.359375q1.171875 0 2.0625 0.375q0.890625 0.375 1.359375 1.109375q0.484375 0.734375 0.515625 1.65625l-1.328125 0.09375q-0.109375 -1.0 -0.734375 -1.5q-0.609375 -0.515625 -1.8125 -0.515625q-1.265625 0 -1.84375 0.46875q-0.578125 0.46875 -0.578125 1.109375q0 0.5625 0.421875 0.9375q0.390625 0.359375 2.078125 0.75q1.703125 0.375 2.328125 0.65625q0.921875 0.421875 1.359375 1.078125q0.4375 0.640625 0.4375 1.484375q0 0.84375 -0.484375 1.59375q-0.484375 0.734375 -1.390625 1.140625q-0.890625 0.40625 -2.015625 0.40625q-1.421875 0 -2.390625 -0.40625q-0.953125 -0.421875 -1.5 -1.25q-0.546875 -0.828125 -0.578125 -1.890625zm10.197479 3.375l0 -10.484375l3.9375 0q1.203125 0 1.921875 0.3125q0.734375 0.3125 1.140625 0.984375q0.40625 0.65625 0.40625 1.375q0 0.671875 -0.375 1.265625q-0.359375 0.59375 -1.09375 0.96875q0.953125 0.28125 1.46875 0.953125q0.515625 0.671875 0.515625 1.578125q0 0.75 -0.3125 1.390625q-0.3125 0.625 -0.78125 0.96875q-0.453125 0.34375 -1.140625 0.515625q-0.6875 0.171875 -1.6875 0.171875l-4.0 0zm1.390625 -6.078125l2.265625 0q0.921875 0 1.3125 -0.125q0.53125 -0.15625 0.796875 -0.515625q0.28125 -0.375 0.28125 -0.921875q0 -0.53125 -0.25 -0.921875q-0.25 -0.390625 -0.71875 -0.53125q-0.46875 -0.15625 -1.59375 -0.15625l-2.09375 0l0 3.171875zm0 4.84375l2.609375 0q0.671875 0 0.9375 -0.046875q0.484375 -0.09375 0.796875 -0.296875q0.328125 -0.203125 0.53125 -0.578125q0.21875 -0.390625 0.21875 -0.890625q0 -0.578125 -0.3125 -1.015625q-0.296875 -0.4375 -0.828125 -0.609375q-0.53125 -0.171875 -1.53125 -0.171875l-2.421875 0l0 3.609375zm12.503815 1.234375l0 -10.484375l3.625 0q1.21875 0 1.859375 0.140625q0.90625 0.203125 1.546875 0.75q0.828125 0.703125 1.234375 1.796875q0.40625 1.09375 0.40625 2.5q0 1.1875 -0.28125 2.109375q-0.265625 0.921875 -0.703125 1.53125q-0.4375 0.609375 -0.96875 0.953125q-0.515625 0.34375 -1.25 0.53125q-0.71875 0.171875 -1.671875 0.171875l-3.796875 0zm1.390625 -1.234375l2.25 0q1.03125 0 1.625 -0.1875q0.59375 -0.203125 0.9375 -0.546875q0.5 -0.5 0.765625 -1.328125q0.28125 -0.84375 0.28125 -2.03125q0 -1.640625 -0.546875 -2.515625q-0.53125 -0.890625 -1.3125 -1.1875q-0.546875 -0.21875 -1.796875 -0.21875l-2.203125 0l0 8.015625zm14.24054 -1.21875l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.171875 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.515625 0 2.484375 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.65625 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.5 -0.375 0.796875 -1.203125zm-4.234375 -2.078125l4.25 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.625 -0.75 -1.609375 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm9.291718 4.53125l-2.890625 -7.59375l1.359375 0l1.625 4.546875q0.265625 0.734375 0.5 1.53125q0.15625 -0.609375 0.46875 -1.453125l1.6875 -4.625l1.328125 0l-2.875 7.59375l-1.203125 0zm5.21875 -9.015625l0 -1.46875l1.296875 0l0 1.46875l-1.296875 0zm0 9.015625l0 -7.59375l1.296875 0l0 7.59375l-1.296875 0zm8.20929 -2.78125l1.265625 0.15625q-0.203125 1.3125 -1.0625 2.0625q-0.84375 0.734375 -2.09375 0.734375q-1.5625 0 -2.515625 -1.015625q-0.9375 -1.03125 -0.9375 -2.921875q0 -1.234375 0.40625 -2.15625q0.40625 -0.921875 1.234375 -1.375q0.84375 -0.46875 1.8125 -0.46875q1.25 0 2.03125 0.625q0.78125 0.625 1.015625 1.765625l-1.265625 0.203125q-0.171875 -0.765625 -0.625 -1.15625q-0.453125 -0.390625 -1.09375 -0.390625q-0.984375 0 -1.59375 0.703125q-0.609375 0.703125 -0.609375 2.203125q0 1.53125 0.578125 2.234375q0.59375 0.6875 1.546875 0.6875q0.75 0 1.265625 -0.453125q0.515625 -0.46875 0.640625 -1.4375zm7.578125 0.328125l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.171875 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.515625 0 2.484375 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.65625 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.5 -0.375 0.796875 -1.203125zm-4.234375 -2.078125l4.25 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.625 -0.75 -1.609375 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm11.4105835 4.53125l0 -10.484375l3.625 0q1.21875 0 1.859375 0.140625q0.90625 0.203125 1.546875 0.75q0.828125 0.703125 1.234375 1.796875q0.40625 1.09375 0.40625 2.5q0 1.1875 -0.28125 2.109375q-0.265625 0.921875 -0.703125 1.53125q-0.4375 0.609375 -0.96875 0.953125q-0.515625 0.34375 -1.25 0.53125q-0.71875 0.171875 -1.671875 0.171875l-3.796875 0zm1.390625 -1.234375l2.25 0q1.03125 0 1.625 -0.1875q0.59375 -0.203125 0.9375 -0.546875q0.5 -0.5 0.765625 -1.328125q0.28125 -0.84375 0.28125 -2.03125q0 -1.640625 -0.546875 -2.515625q-0.53125 -0.890625 -1.3125 -1.1875q-0.546875 -0.21875 -1.796875 -0.21875l-2.203125 0l0 8.015625zm9.021759 1.234375l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0zm4.8962708 -9.015625l0 -1.46875l1.296875 0l0 1.46875l-1.296875 0zm0 9.015625l0 -7.59375l1.296875 0l0 7.59375l-1.296875 0zm5.365509 0l-2.890625 -7.59375l1.359375 0l1.625 4.546875q0.265625 0.734375 0.5 1.53125q0.15625 -0.609375 0.46875 -1.453125l1.6875 -4.625l1.328125 0l-2.875 7.59375l-1.203125 0zm10.421875 -2.453125l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.171875 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.515625 0 2.484375 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.65625 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.5 -0.375 0.796875 -1.203125zm-4.234375 -2.078125l4.25 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.625 -0.75 -1.609375 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm7.166748 4.53125l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0z" fill-rule="nonzero"/><path fill="#000000" d="m304.5869 167.36261l1.390625 0l0 6.046875q0 1.59375 -0.359375 2.53125q-0.359375 0.921875 -1.296875 1.5q-0.9375 0.578125 -2.453125 0.578125q-1.46875 0 -2.40625 -0.5q-0.9375 -0.515625 -1.34375 -1.46875q-0.390625 -0.96875 -0.390625 -2.640625l0 -6.046875l1.390625 0l0 6.046875q0 1.375 0.25 2.015625q0.25 0.640625 0.859375 1.0q0.625 0.34375 1.53125 0.34375q1.53125 0 2.171875 -0.6875q0.65625 -0.703125 0.65625 -2.671875l0 -6.046875zm3.2249146 7.109375l1.3125 -0.109375q0.09375 0.78125 0.421875 1.296875q0.34375 0.5 1.0625 0.8125q0.71875 0.3125 1.609375 0.3125q0.796875 0 1.40625 -0.234375q0.609375 -0.234375 0.90625 -0.640625q0.296875 -0.421875 0.296875 -0.90625q0 -0.5 -0.296875 -0.859375q-0.28125 -0.375 -0.9375 -0.625q-0.421875 -0.171875 -1.875 -0.515625q-1.4375 -0.34375 -2.015625 -0.65625q-0.75 -0.390625 -1.125 -0.96875q-0.359375 -0.59375 -0.359375 -1.3125q0 -0.796875 0.4375 -1.484375q0.453125 -0.6875 1.3125 -1.046875q0.875 -0.359375 1.9375 -0.359375q1.171875 0 2.0625 0.375q0.890625 0.375 1.359375 1.109375q0.484375 0.734375 0.515625 1.65625l-1.328125 0.09375q-0.109375 -1.0 -0.734375 -1.5q-0.609375 -0.515625 -1.8125 -0.515625q-1.265625 0 -1.84375 0.46875q-0.578125 0.46875 -0.578125 1.109375q0 0.5625 0.421875 0.9375q0.390625 0.359375 2.078125 0.75q1.703125 0.375 2.328125 0.65625q0.921875 0.421875 1.359375 1.078125q0.4375 0.640625 0.4375 1.484375q0 0.84375 -0.484375 1.59375q-0.484375 0.734375 -1.390625 1.140625q-0.890625 0.40625 -2.015625 0.40625q-1.421875 0 -2.390625 -0.40625q-0.953125 -0.421875 -1.5 -1.25q-0.546875 -0.828125 -0.578125 -1.890625zm10.197479 3.375l0 -10.484375l3.9375 0q1.203125 0 1.921875 0.3125q0.734375 0.3125 1.140625 0.984375q0.40625 0.65625 0.40625 1.375q0 0.671875 -0.375 1.265625q-0.359375 0.59375 -1.09375 0.96875q0.953125 0.28125 1.46875 0.953125q0.515625 0.671875 0.515625 1.578125q0 0.75 -0.3125 1.390625q-0.3125 0.625 -0.78125 0.96875q-0.453125 0.34375 -1.140625 0.515625q-0.6875 0.171875 -1.6875 0.171875l-4.0 0zm1.390625 -6.078125l2.265625 0q0.921875 0 1.3125 -0.125q0.53125 -0.15625 0.796875 -0.515625q0.28125 -0.375 0.28125 -0.921875q0 -0.53125 -0.25 -0.921875q-0.25 -0.390625 -0.71875 -0.53125q-0.46875 -0.15625 -1.59375 -0.15625l-2.09375 0l0 3.171875zm0 4.84375l2.609375 0q0.671875 0 0.9375 -0.046875q0.484375 -0.09375 0.796875 -0.296875q0.328125 -0.203125 0.53125 -0.578125q0.21875 -0.390625 0.21875 -0.890625q0 -0.578125 -0.3125 -1.015625q-0.296875 -0.4375 -0.828125 -0.609375q-0.53125 -0.171875 -1.53125 -0.171875l-2.421875 0l0 3.609375zm8.431854 1.234375l0 -10.484375l3.625 0q1.21875 0 1.859375 0.140625q0.90625 0.203125 1.546875 0.75q0.828125 0.703125 1.234375 1.796875q0.40625 1.09375 0.40625 2.5q0 1.1875 -0.28125 2.109375q-0.265625 0.921875 -0.703125 1.53125q-0.4375 0.609375 -0.96875 0.953125q-0.515625 0.34375 -1.25 0.53125q-0.71875 0.171875 -1.671875 0.171875l-3.796875 0zm1.390625 -1.234375l2.25 0q1.03125 0 1.625 -0.1875q0.59375 -0.203125 0.9375 -0.546875q0.5 -0.5 0.765625 -1.328125q0.28125 -0.84375 0.28125 -2.03125q0 -1.640625 -0.546875 -2.515625q-0.53125 -0.890625 -1.3125 -1.1875q-0.546875 -0.21875 -1.796875 -0.21875l-2.203125 0l0 8.015625z" fill-rule="nonzero"/><path fill="#cfe2f3" d="m28.509478 139.45203l192.28346 0l0 48.62993l-192.28346 0z" fill-rule="evenodd"/><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m28.509478 139.45203l192.28346 0l0 48.62993l-192.28346 0z" fill-rule="evenodd"/><path fill="#000000" d="m78.9189 149.36261l1.390625 0l0 6.046875q0 1.59375 -0.359375 2.53125q-0.359375 0.921875 -1.296875 1.5q-0.9375 0.578125 -2.453125 0.578125q-1.46875 0 -2.40625 -0.5q-0.9375 -0.515625 -1.34375 -1.46875q-0.390625 -0.96875 -0.390625 -2.640625l0 -6.046875l1.390625 0l0 6.046875q0 1.375 0.25 2.015625q0.25 0.640625 0.859375 1.0q0.625 0.34375 1.53125 0.34375q1.53125 0 2.171875 -0.6875q0.65625 -0.703125 0.65625 -2.671875l0 -6.046875zm3.2248993 7.109375l1.3125 -0.109375q0.09375 0.78125 0.421875 1.296875q0.34375 0.5 1.0625 0.8125q0.71875 0.3125 1.609375 0.3125q0.796875 0 1.40625 -0.234375q0.609375 -0.234375 0.90625 -0.640625q0.296875 -0.421875 0.296875 -0.90625q0 -0.5 -0.296875 -0.859375q-0.28125 -0.375 -0.9375 -0.625q-0.421875 -0.171875 -1.875 -0.515625q-1.4375 -0.34375 -2.015625 -0.65625q-0.75 -0.390625 -1.125 -0.96875q-0.359375 -0.59375 -0.359375 -1.3125q0 -0.796875 0.4375 -1.484375q0.453125 -0.6875 1.3125 -1.046875q0.875 -0.359375 1.9375 -0.359375q1.171875 0 2.0625 0.375q0.890625 0.375 1.359375 1.109375q0.484375 0.734375 0.515625 1.65625l-1.328125 0.09375q-0.109375 -1.0 -0.734375 -1.5q-0.609375 -0.515625 -1.8125 -0.515625q-1.265625 0 -1.84375 0.46875q-0.578125 0.46875 -0.578125 1.109375q0 0.5625 0.421875 0.9375q0.390625 0.359375 2.078125 0.75q1.703125 0.375 2.328125 0.65625q0.921875 0.421875 1.359375 1.078125q0.4375 0.640625 0.4375 1.484375q0 0.84375 -0.484375 1.59375q-0.484375 0.734375 -1.390625 1.140625q-0.890625 0.40625 -2.015625 0.40625q-1.421875 0 -2.390625 -0.40625q-0.953125 -0.421875 -1.5 -1.25q-0.546875 -0.828125 -0.578125 -1.890625zm10.197479 3.375l0 -10.484375l3.9375 0q1.203125 0 1.921875 0.3125q0.734375 0.3125 1.140625 0.984375q0.40625 0.65625 0.40625 1.375q0 0.671875 -0.375 1.265625q-0.359375 0.59375 -1.09375 0.96875q0.953125 0.28125 1.46875 0.953125q0.515625 0.671875 0.515625 1.578125q0 0.75 -0.3125 1.390625q-0.3125 0.625 -0.78125 0.96875q-0.453125 0.34375 -1.140625 0.515625q-0.6875 0.171875 -1.6875 0.171875l-4.0 0zm1.390625 -6.078125l2.265625 0q0.921875 0 1.3125 -0.125q0.53125 -0.15625 0.796875 -0.515625q0.28125 -0.375 0.28125 -0.921875q0 -0.53125 -0.25 -0.921875q-0.25 -0.390625 -0.71875 -0.53125q-0.46875 -0.15625 -1.59375 -0.15625l-2.09375 0l0 3.171875zm0 4.84375l2.609375 0q0.671875 0 0.9375 -0.046875q0.484375 -0.09375 0.796875 -0.296875q0.328125 -0.203125 0.53125 -0.578125q0.21875 -0.390625 0.21875 -0.890625q0 -0.578125 -0.3125 -1.015625q-0.296875 -0.4375 -0.828125 -0.609375q-0.53125 -0.171875 -1.53125 -0.171875l-2.421875 0l0 3.609375zm12.550705 1.234375l0 -10.484375l1.390625 0l0 4.296875l5.453125 0l0 -4.296875l1.390625 0l0 10.484375l-1.390625 0l0 -4.9375l-5.453125 0l0 4.9375l-1.390625 0zm9.896774 -3.796875q0 -2.109375 1.171875 -3.125q0.984375 -0.84375 2.390625 -0.84375q1.578125 0 2.5625 1.03125q1.0 1.015625 1.0 2.828125q0 1.46875 -0.4375 2.3125q-0.4375 0.828125 -1.28125 1.296875q-0.84375 0.46875 -1.84375 0.46875q-1.59375 0 -2.578125 -1.015625q-0.984375 -1.03125 -0.984375 -2.953125zm1.328125 0q0 1.453125 0.625 2.1875q0.640625 0.71875 1.609375 0.71875q0.96875 0 1.59375 -0.71875q0.640625 -0.734375 0.640625 -2.234375q0 -1.40625 -0.640625 -2.125q-0.640625 -0.734375 -1.59375 -0.734375q-0.96875 0 -1.609375 0.71875q-0.625 0.71875 -0.625 2.1875zm6.791733 1.53125l1.265625 -0.203125q0.109375 0.765625 0.59375 1.171875q0.5 0.40625 1.375 0.40625q0.890625 0 1.3125 -0.359375q0.4375 -0.359375 0.4375 -0.84375q0 -0.4375 -0.375 -0.6875q-0.265625 -0.171875 -1.3125 -0.4375q-1.421875 -0.359375 -1.96875 -0.609375q-0.546875 -0.265625 -0.828125 -0.734375q-0.28125 -0.46875 -0.28125 -1.015625q0 -0.515625 0.21875 -0.9375q0.234375 -0.4375 0.640625 -0.734375q0.296875 -0.21875 0.8125 -0.359375q0.53125 -0.15625 1.125 -0.15625q0.890625 0 1.5625 0.265625q0.671875 0.25 1.0 0.6875q0.328125 0.4375 0.4375 1.171875l-1.25 0.171875q-0.09375 -0.578125 -0.5 -0.90625q-0.40625 -0.34375 -1.15625 -0.34375q-0.890625 0 -1.28125 0.296875q-0.375 0.296875 -0.375 0.6875q0 0.25 0.15625 0.453125q0.15625 0.203125 0.5 0.34375q0.1875 0.078125 1.140625 0.328125q1.359375 0.359375 1.890625 0.59375q0.546875 0.234375 0.859375 0.6875q0.3125 0.4375 0.3125 1.09375q0 0.640625 -0.375 1.21875q-0.375 0.5625 -1.09375 0.875q-0.703125 0.3125 -1.59375 0.3125q-1.484375 0 -2.265625 -0.609375q-0.765625 -0.625 -0.984375 -1.828125zm10.65625 1.109375l0.1875 1.140625q-0.546875 0.109375 -0.984375 0.109375q-0.6875 0 -1.078125 -0.21875q-0.390625 -0.21875 -0.546875 -0.578125q-0.15625 -0.359375 -0.15625 -1.515625l0 -4.375l-0.953125 0l0 -1.0l0.953125 0l0 -1.890625l1.28125 -0.765625l0 2.65625l1.296875 0l0 1.0l-1.296875 0l0 4.4375q0 0.546875 0.0625 0.71875q0.078125 0.15625 0.21875 0.25q0.15625 0.078125 0.453125 0.078125q0.203125 0 0.5625 -0.046875zm5.4877014 1.15625l0 -10.484375l3.625 0q1.21875 0 1.859375 0.140625q0.90625 0.203125 1.546875 0.75q0.828125 0.703125 1.234375 1.796875q0.40625 1.09375 0.40625 2.5q0 1.1875 -0.28125 2.109375q-0.265625 0.921875 -0.703125 1.53125q-0.4375 0.609375 -0.96875 0.953125q-0.515625 0.34375 -1.25 0.53125q-0.71875 0.171875 -1.671875 0.171875l-3.796875 0zm1.390625 -1.234375l2.25 0q1.03125 0 1.625 -0.1875q0.59375 -0.203125 0.9375 -0.546875q0.5 -0.5 0.765625 -1.328125q0.28125 -0.84375 0.28125 -2.03125q0 -1.640625 -0.546875 -2.515625q-0.53125 -0.890625 -1.3125 -1.1875q-0.546875 -0.21875 -1.796875 -0.21875l-2.203125 0l0 8.015625zm9.021774 1.234375l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0zm4.8962708 -9.015625l0 -1.46875l1.296875 0l0 1.46875l-1.296875 0zm0 9.015625l0 -7.59375l1.296875 0l0 7.59375l-1.296875 0zm5.3655243 0l-2.890625 -7.59375l1.359375 0l1.625 4.546875q0.265625 0.734375 0.5 1.53125q0.15625 -0.609375 0.46875 -1.453125l1.6875 -4.625l1.328125 0l-2.875 7.59375l-1.203125 0zm10.421875 -2.453125l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.171875 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.515625 0 2.484375 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.65625 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.5 -0.375 0.796875 -1.203125zm-4.234375 -2.078125l4.25 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.625 -0.75 -1.609375 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm7.166733 4.53125l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0z" fill-rule="nonzero"/><path fill="#000000" d="m112.30695 167.36261l1.390625 0l0 6.046875q0 1.59375 -0.359375 2.53125q-0.359375 0.921875 -1.296875 1.5q-0.9375 0.578125 -2.453125 0.578125q-1.46875 0 -2.40625 -0.5q-0.9375 -0.515625 -1.34375 -1.46875q-0.390625 -0.96875 -0.390625 -2.640625l0 -6.046875l1.390625 0l0 6.046875q0 1.375 0.25 2.015625q0.25 0.640625 0.859375 1.0q0.625 0.34375 1.53125 0.34375q1.53125 0 2.171875 -0.6875q0.65625 -0.703125 0.65625 -2.671875l0 -6.046875zm3.2248993 7.109375l1.3125 -0.109375q0.09375 0.78125 0.421875 1.296875q0.34375 0.5 1.0625 0.8125q0.71875 0.3125 1.609375 0.3125q0.796875 0 1.40625 -0.234375q0.609375 -0.234375 0.90625 -0.640625q0.296875 -0.421875 0.296875 -0.90625q0 -0.5 -0.296875 -0.859375q-0.28125 -0.375 -0.9375 -0.625q-0.421875 -0.171875 -1.875 -0.515625q-1.4375 -0.34375 -2.015625 -0.65625q-0.75 -0.390625 -1.125 -0.96875q-0.359375 -0.59375 -0.359375 -1.3125q0 -0.796875 0.4375 -1.484375q0.453125 -0.6875 1.3125 -1.046875q0.875 -0.359375 1.9375 -0.359375q1.171875 0 2.0625 0.375q0.890625 0.375 1.359375 1.109375q0.484375 0.734375 0.515625 1.65625l-1.328125 0.09375q-0.109375 -1.0 -0.734375 -1.5q-0.609375 -0.515625 -1.8125 -0.515625q-1.265625 0 -1.84375 0.46875q-0.578125 0.46875 -0.578125 1.109375q0 0.5625 0.421875 0.9375q0.390625 0.359375 2.078125 0.75q1.703125 0.375 2.328125 0.65625q0.921875 0.421875 1.359375 1.078125q0.4375 0.640625 0.4375 1.484375q0 0.84375 -0.484375 1.59375q-0.484375 0.734375 -1.390625 1.140625q-0.890625 0.40625 -2.015625 0.40625q-1.421875 0 -2.390625 -0.40625q-0.953125 -0.421875 -1.5 -1.25q-0.546875 -0.828125 -0.578125 -1.890625zm10.197479 3.375l0 -10.484375l3.9375076 0q1.203125 0 1.921875 0.3125q0.734375 0.3125 1.140625 0.984375q0.40625 0.65625 0.40625 1.375q0 0.671875 -0.375 1.265625q-0.359375 0.59375 -1.09375 0.96875q0.953125 0.28125 1.46875 0.953125q0.515625 0.671875 0.515625 1.578125q0 0.75 -0.3125 1.390625q-0.3125 0.625 -0.78125 0.96875q-0.453125 0.34375 -1.140625 0.515625q-0.6875 0.171875 -1.6875 0.171875l-4.0000076 0zm1.390625 -6.078125l2.2656326 0q0.921875 0 1.3125 -0.125q0.53125 -0.15625 0.796875 -0.515625q0.28125 -0.375 0.28125 -0.921875q0 -0.53125 -0.25 -0.921875q-0.25 -0.390625 -0.71875 -0.53125q-0.46875 -0.15625 -1.59375 -0.15625l-2.0937576 0l0 3.171875zm0 4.84375l2.6093826 0q0.671875 0 0.9375 -0.046875q0.484375 -0.09375 0.796875 -0.296875q0.328125 -0.203125 0.53125 -0.578125q0.21875 -0.390625 0.21875 -0.890625q0 -0.578125 -0.3125 -1.015625q-0.296875 -0.4375 -0.828125 -0.609375q-0.53125 -0.171875 -1.53125 -0.171875l-2.4218826 0l0 3.609375zm8.478737 1.234375l0 -10.484375l1.390625 0l0 4.296875l5.453125 0l0 -4.296875l1.390625 0l0 10.484375l-1.390625 0l0 -4.9375l-5.453125 0l0 4.9375l-1.390625 0z" fill-rule="nonzero"/><path fill="#d9d9d9" d="m28.509478 27.969963l384.56693 0l0 48.62992l-384.56693 0z" fill-rule="evenodd"/><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m28.509478 27.969963l384.56693 0l0 48.62992l-384.56693 0z" fill-rule="evenodd"/><path fill="#000000" d="m184.92747 57.36492l4.015625 -10.484375l1.5 0l4.296875 10.484375l-1.578125 0l-1.234375 -3.171875l-4.375 0l-1.15625 3.171875l-1.46875 0zm3.015625 -4.3125l3.5625 0l-1.09375 -2.90625q-0.5 -1.3125 -0.75 -2.171875q-0.203125 1.015625 -0.5625 2.0l-1.15625 3.078125zm7.7443542 7.21875l0 -10.5l1.171875 0l0 0.984375q0.421875 -0.578125 0.9375 -0.859375q0.515625 -0.296875 1.265625 -0.296875q0.96875 0 1.71875 0.5q0.75 0.5 1.125 1.421875q0.375 0.90625 0.375 1.984375q0 1.171875 -0.421875 2.109375q-0.40625 0.921875 -1.21875 1.421875q-0.796875 0.5 -1.671875 0.5q-0.640625 0 -1.15625 -0.265625q-0.515625 -0.28125 -0.84375 -0.6875l0 3.6875l-1.28125 0zm1.15625 -6.65625q0 1.453125 0.59375 2.15625q0.609375 0.703125 1.453125 0.703125q0.859375 0 1.46875 -0.71875q0.609375 -0.734375 0.609375 -2.25q0 -1.453125 -0.609375 -2.171875q-0.59375 -0.734375 -1.421875 -0.734375q-0.8125 0 -1.453125 0.78125q-0.640625 0.765625 -0.640625 2.234375zm6.994858 6.65625l0 -10.5l1.171875 0l0 0.984375q0.421875 -0.578125 0.9375 -0.859375q0.515625 -0.296875 1.265625 -0.296875q0.96875 0 1.71875 0.5q0.75 0.5 1.125 1.421875q0.375 0.90625 0.375 1.984375q0 1.171875 -0.421875 2.109375q-0.40625 0.921875 -1.21875 1.421875q-0.796875 0.5 -1.671875 0.5q-0.640625 0 -1.15625 -0.265625q-0.515625 -0.28125 -0.84375 -0.6875l0 3.6875l-1.28125 0zm1.15625 -6.65625q0 1.453125 0.59375 2.15625q0.609375 0.703125 1.453125 0.703125q0.859375 0 1.46875 -0.71875q0.609375 -0.734375 0.609375 -2.25q0 -1.453125 -0.609375 -2.171875q-0.59375 -0.734375 -1.421875 -0.734375q-0.8125 0 -1.453125 0.78125q-0.640625 0.765625 -0.640625 2.234375zm6.963608 3.75l0 -10.484375l1.28125 0l0 10.484375l-1.28125 0zm3.2873993 -9.015625l0 -1.46875l1.296875 0l0 1.46875l-1.296875 0zm0 9.015625l0 -7.59375l1.296875 0l0 7.59375l-1.296875 0zm8.209274 -2.78125l1.265625 0.15625q-0.203125 1.3125 -1.0625 2.0625q-0.84375 0.734375 -2.09375 0.734375q-1.5625 0 -2.515625 -1.015625q-0.9375 -1.03125 -0.9375 -2.921875q0 -1.234375 0.40625 -2.15625q0.40625 -0.921875 1.234375 -1.375q0.84375 -0.46875 1.8125 -0.46875q1.25 0 2.03125 0.625q0.78125 0.625 1.015625 1.765625l-1.265625 0.203125q-0.171875 -0.765625 -0.625 -1.15625q-0.453125 -0.390625 -1.09375 -0.390625q-0.984375 0 -1.59375 0.703125q-0.609375 0.703125 -0.609375 2.203125q0 1.53125 0.578125 2.234375q0.59375 0.6875 1.546875 0.6875q0.75 0 1.265625 -0.453125q0.515625 -0.46875 0.640625 -1.4375zm7.328125 1.84375q-0.71875 0.609375 -1.375 0.859375q-0.65625 0.25 -1.421875 0.25q-1.25 0 -1.921875 -0.609375q-0.671875 -0.609375 -0.671875 -1.5625q0 -0.5625 0.25 -1.015625q0.25 -0.46875 0.65625 -0.75q0.421875 -0.28125 0.9375 -0.421875q0.375 -0.09375 1.140625 -0.1875q1.5625 -0.1875 2.296875 -0.453125q0.015625 -0.265625 0.015625 -0.328125q0 -0.796875 -0.375 -1.109375q-0.484375 -0.4375 -1.453125 -0.4375q-0.921875 0 -1.359375 0.328125q-0.421875 0.3125 -0.625 1.109375l-1.265625 -0.171875q0.171875 -0.796875 0.5625 -1.296875q0.390625 -0.5 1.140625 -0.765625q0.75 -0.265625 1.71875 -0.265625q0.984375 0 1.59375 0.234375q0.609375 0.21875 0.890625 0.5625q0.28125 0.34375 0.40625 0.875q0.0625 0.328125 0.0625 1.1875l0 1.71875q0 1.796875 0.078125 2.28125q0.078125 0.46875 0.328125 0.90625l-1.34375 0q-0.203125 -0.40625 -0.265625 -0.9375zm-0.109375 -2.875q-0.703125 0.28125 -2.09375 0.484375q-0.796875 0.109375 -1.125 0.265625q-0.328125 0.140625 -0.515625 0.421875q-0.171875 0.265625 -0.171875 0.59375q0 0.515625 0.390625 0.859375q0.390625 0.34375 1.140625 0.34375q0.734375 0 1.3125 -0.3125q0.59375 -0.328125 0.859375 -0.890625q0.203125 -0.4375 0.203125 -1.296875l0 -0.46875zm6.119858 2.65625l0.1875 1.140625q-0.546875 0.109375 -0.984375 0.109375q-0.6875 0 -1.078125 -0.21875q-0.390625 -0.21875 -0.546875 -0.578125q-0.15625 -0.359375 -0.15625 -1.515625l0 -4.375l-0.953125 0l0 -1.0l0.953125 0l0 -1.890625l1.28125 -0.765625l0 2.65625l1.296875 0l0 1.0l-1.296875 0l0 4.4375q0 0.546875 0.0625 0.71875q0.078125 0.15625 0.21875 0.25q0.15625 0.078125 0.453125 0.078125q0.203125 0 0.5625 -0.046875zm1.2594757 -7.859375l0 -1.46875l1.296875 0l0 1.46875l-1.296875 0zm0 9.015625l0 -7.59375l1.296875 0l0 7.59375l-1.296875 0zm2.7717743 -3.796875q0 -2.109375 1.171875 -3.125q0.984375 -0.84375 2.390625 -0.84375q1.578125 0 2.5625 1.03125q1.0 1.015625 1.0 2.828125q0 1.46875 -0.4375 2.3125q-0.4375 0.828125 -1.28125 1.296875q-0.84375 0.46875 -1.84375 0.46875q-1.59375 0 -2.578125 -1.015625q-0.984375 -1.03125 -0.984375 -2.953125zm1.328125 0q0 1.453125 0.625 2.1875q0.640625 0.71875 1.609375 0.71875q0.96875 0 1.59375 -0.71875q0.640625 -0.734375 0.640625 -2.234375q0 -1.40625 -0.640625 -2.125q-0.640625 -0.734375 -1.59375 -0.734375q-0.96875 0 -1.609375 0.71875q-0.625 0.71875 -0.625 2.1875zm7.307358 3.796875l0 -7.59375l1.15625 0l0 1.078125q0.84375 -1.25 2.421875 -1.25q0.6875 0 1.265625 0.25q0.578125 0.234375 0.859375 0.640625q0.28125 0.40625 0.40625 0.953125q0.0625 0.359375 0.0625 1.25l0 4.671875l-1.28125 0l0 -4.625q0 -0.78125 -0.15625 -1.171875q-0.15625 -0.390625 -0.546875 -0.625q-0.375 -0.234375 -0.890625 -0.234375q-0.8125 0 -1.421875 0.53125q-0.59375 0.515625 -0.59375 1.96875l0 4.15625l-1.28125 0z" fill-rule="nonzero"/><path fill="#d9d2e9" d="m28.509478 195.19305l384.56693 0l0 29.606308l-384.56693 0z" fill-rule="evenodd"/><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m28.509478 195.19305l384.56693 0l0 29.606308l-384.56693 0z" fill-rule="evenodd"/><path fill="#000000" d="m125.783455 209.96683q0 -2.609375 1.40625 -4.078125q1.4062576 -1.484375 3.6250076 -1.484375q1.453125 0 2.609375 0.703125q1.171875 0.6875 1.78125 1.921875q0.609375 1.234375 0.609375 2.8125q0 1.59375 -0.640625 2.859375q-0.640625 1.265625 -1.828125 1.90625q-1.171875 0.640625 -2.546875 0.640625q-1.46875 0 -2.640625 -0.703125q-1.1718826 -0.71875 -1.7812576 -1.953125q-0.59375 -1.25 -0.59375 -2.625zm1.4375 0.015625q0 1.90625 1.0156326 3.0q1.015625 1.078125 2.5625 1.078125q1.5625 0 2.578125 -1.09375q1.015625 -1.109375 1.015625 -3.125q0 -1.28125 -0.4375 -2.234375q-0.4375 -0.96875 -1.265625 -1.484375q-0.828125 -0.53125 -1.875 -0.53125q-1.46875 0 -2.53125 1.015625q-1.0625076 1.015625 -1.0625076 3.375zm9.915733 1.71875l1.3125 -0.109375q0.09375 0.78125 0.421875 1.296875q0.34375 0.5 1.0625 0.8125q0.71875 0.3125 1.609375 0.3125q0.796875 0 1.40625 -0.234375q0.609375 -0.234375 0.90625 -0.640625q0.296875 -0.421875 0.296875 -0.90625q0 -0.5 -0.296875 -0.859375q-0.28125 -0.375 -0.9375 -0.625q-0.421875 -0.171875 -1.875 -0.515625q-1.4375 -0.34375 -2.015625 -0.65625q-0.75 -0.390625 -1.125 -0.96875q-0.359375 -0.59375 -0.359375 -1.3125q0 -0.796875 0.4375 -1.484375q0.453125 -0.6875 1.3125 -1.046875q0.875 -0.359375 1.9375 -0.359375q1.171875 0 2.0625 0.375q0.890625 0.375 1.359375 1.109375q0.484375 0.734375 0.515625 1.65625l-1.328125 0.09375q-0.109375 -1.0 -0.734375 -1.5q-0.609375 -0.515625 -1.8125 -0.515625q-1.265625 0 -1.84375 0.46875q-0.578125 0.46875 -0.578125 1.109375q0 0.5625 0.421875 0.9375q0.390625 0.359375 2.078125 0.75q1.703125 0.375 2.328125 0.65625q0.921875 0.421875 1.359375 1.078125q0.4375 0.640625 0.4375 1.484375q0 0.84375 -0.484375 1.59375q-0.484375 0.734375 -1.390625 1.140625q-0.890625 0.40625 -2.015625 0.40625q-1.421875 0 -2.390625 -0.40625q-0.953125 -0.421875 -1.5 -1.25q-0.546875 -0.828125 -0.578125 -1.890625zm12.366455 3.375l4.015625 -10.484375l1.5 0l4.2968597 10.484375l-1.578125 0l-1.2343597 -3.171875l-4.375 0l-1.15625 3.171875l-1.46875 0zm3.015625 -4.3125l3.5625 0l-1.09375 -2.90625q-0.5 -1.3125 -0.75 -2.171875q-0.203125 1.015625 -0.5625 2.0l-1.15625 3.078125zm8.931839 4.3125l-1.203125 0l0 -10.484375l1.296875 0l0 3.734375q0.8125 -1.015625 2.078125 -1.015625q0.703125 0 1.328125 0.28125q0.625 0.28125 1.03125 0.796875q0.40625 0.5 0.625 1.234375q0.234375 0.71875 0.234375 1.53125q0 1.96875 -0.96875 3.03125q-0.953125 1.0625 -2.3125 1.0625q-1.34375 0 -2.109375 -1.125l0 0.953125zm-0.015625 -3.859375q0 1.375 0.375 1.984375q0.609375 0.984375 1.640625 0.984375q0.84375 0 1.453125 -0.734375q0.625 -0.734375 0.625 -2.1875q0 -1.484375 -0.59375 -2.1875q-0.59375 -0.71875 -1.421875 -0.71875q-0.84375 0 -1.46875 0.734375q-0.609375 0.734375 -0.609375 2.125zm6.463623 1.59375l1.265625 -0.203125q0.109375 0.765625 0.59375 1.171875q0.5 0.40625 1.375 0.40625q0.890625 0 1.3125 -0.359375q0.4375 -0.359375 0.4375 -0.84375q0 -0.4375 -0.375 -0.6875q-0.265625 -0.171875 -1.3125 -0.4375q-1.421875 -0.359375 -1.96875 -0.609375q-0.546875 -0.265625 -0.828125 -0.734375q-0.28125 -0.46875 -0.28125 -1.015625q0 -0.515625 0.21875 -0.9375q0.234375 -0.4375 0.640625 -0.734375q0.296875 -0.21875 0.8125 -0.359375q0.53125 -0.15625 1.125 -0.15625q0.890625 0 1.5625 0.265625q0.671875 0.25 1.0 0.6875q0.328125 0.4375 0.4375 1.171875l-1.25 0.171875q-0.09375 -0.578125 -0.5 -0.90625q-0.40625 -0.34375 -1.15625 -0.34375q-0.890625 0 -1.28125 0.296875q-0.375 0.296875 -0.375 0.6875q0 0.25 0.15625 0.453125q0.15625 0.203125 0.5 0.34375q0.1875 0.078125 1.140625 0.328125q1.359375 0.359375 1.890625 0.59375q0.546875 0.234375 0.859375 0.6875q0.3125 0.4375 0.3125 1.09375q0 0.640625 -0.375 1.21875q-0.375 0.5625 -1.09375 0.875q-0.703125 0.3125 -1.59375 0.3125q-1.484375 0 -2.265625 -0.609375q-0.765625 -0.625 -0.984375 -1.828125zm10.65625 1.109375l0.1875 1.140625q-0.546875 0.109375 -0.984375 0.109375q-0.6875 0 -1.078125 -0.21875q-0.390625 -0.21875 -0.546875 -0.578125q-0.15625 -0.359375 -0.15625 -1.515625l0 -4.375l-0.953125 0l0 -1.0l0.953125 0l0 -1.890625l1.28125 -0.765625l0 2.65625l1.296875 0l0 1.0l-1.296875 0l0 4.4375q0 0.546875 0.0625 0.71875q0.078125 0.15625 0.21875 0.25q0.15625 0.078125 0.453125 0.078125q0.203125 0 0.5625 -0.046875zm1.2438354 1.15625l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0zm9.849396 -0.9375q-0.71875 0.609375 -1.375 0.859375q-0.65625 0.25 -1.421875 0.25q-1.25 0 -1.921875 -0.609375q-0.671875 -0.609375 -0.671875 -1.5625q0 -0.5625 0.25 -1.015625q0.25 -0.46875 0.65625 -0.75q0.421875 -0.28125 0.9375 -0.421875q0.375 -0.09375 1.140625 -0.1875q1.5625 -0.1875 2.296875 -0.453125q0.015625 -0.265625 0.015625 -0.328125q0 -0.796875 -0.375 -1.109375q-0.484375 -0.4375 -1.453125 -0.4375q-0.921875 0 -1.359375 0.328125q-0.421875 0.3125 -0.625 1.109375l-1.265625 -0.171875q0.171875 -0.796875 0.5625 -1.296875q0.390625 -0.5 1.140625 -0.765625q0.75 -0.265625 1.71875 -0.265625q0.984375 0 1.59375 0.234375q0.609375 0.21875 0.890625 0.5625q0.28125 0.34375 0.40625 0.875q0.0625 0.328125 0.0625 1.1875l0 1.71875q0 1.796875 0.078125 2.28125q0.078125 0.46875 0.328125 0.90625l-1.34375 0q-0.203125 -0.40625 -0.265625 -0.9375zm-0.109375 -2.875q-0.703125 0.28125 -2.09375 0.484375q-0.796875 0.109375 -1.125 0.265625q-0.328125 0.140625 -0.515625 0.421875q-0.171875 0.265625 -0.171875 0.59375q0 0.515625 0.390625 0.859375q0.390625 0.34375 1.140625 0.34375q0.734375 0 1.3125 -0.3125q0.59375 -0.328125 0.859375 -0.890625q0.203125 -0.4375 0.203125 -1.296875l0 -0.46875zm8.260498 1.03125l1.265625 0.15625q-0.203125 1.3125 -1.0625 2.0625q-0.84375 0.734375 -2.09375 0.734375q-1.5625 0 -2.515625 -1.015625q-0.9375 -1.03125 -0.9375 -2.921875q0 -1.234375 0.40625 -2.15625q0.40625 -0.921875 1.234375 -1.375q0.84375 -0.46875 1.8125 -0.46875q1.25 0 2.03125 0.625q0.78125 0.625 1.015625 1.765625l-1.265625 0.203125q-0.171875 -0.765625 -0.625 -1.15625q-0.453125 -0.390625 -1.09375 -0.390625q-0.984375 0 -1.59375 0.703125q-0.609375 0.703125 -0.609375 2.203125q0 1.53125 0.578125 2.234375q0.59375 0.6875 1.546875 0.6875q0.75 0 1.265625 -0.453125q0.515625 -0.46875 0.640625 -1.4375zm5.1875 1.625l0.1875 1.140625q-0.546875 0.109375 -0.984375 0.109375q-0.6875 0 -1.078125 -0.21875q-0.390625 -0.21875 -0.546875 -0.578125q-0.15625 -0.359375 -0.15625 -1.515625l0 -4.375l-0.953125 0l0 -1.0l0.953125 0l0 -1.890625l1.28125 -0.765625l0 2.65625l1.296875 0l0 1.0l-1.296875 0l0 4.4375q0 0.546875 0.0625 0.71875q0.078125 0.15625 0.21875 0.25q0.15625 0.078125 0.453125 0.078125q0.203125 0 0.5625 -0.046875zm1.2594604 -7.859375l0 -1.46875l1.296875 0l0 1.46875l-1.296875 0zm0 9.015625l0 -7.59375l1.296875 0l0 7.59375l-1.296875 0zm2.7717896 -3.796875q0 -2.109375 1.171875 -3.125q0.984375 -0.84375 2.390625 -0.84375q1.578125 0 2.5625 1.03125q1.0 1.015625 1.0 2.828125q0 1.46875 -0.4375 2.3125q-0.4375 0.828125 -1.28125 1.296875q-0.84375 0.46875 -1.84375 0.46875q-1.59375 0 -2.578125 -1.015625q-0.984375 -1.03125 -0.984375 -2.953125zm1.328125 0q0 1.453125 0.625 2.1875q0.640625 0.71875 1.609375 0.71875q0.96875 0 1.59375 -0.71875q0.640625 -0.734375 0.640625 -2.234375q0 -1.40625 -0.640625 -2.125q-0.640625 -0.734375 -1.59375 -0.734375q-0.96875 0 -1.609375 0.71875q-0.625 0.71875 -0.625 2.1875zm7.3073425 3.796875l0 -7.59375l1.15625 0l0 1.078125q0.84375 -1.25 2.421875 -1.25q0.6875 0 1.265625 0.25q0.578125 0.234375 0.859375 0.640625q0.28125 0.40625 0.40625 0.953125q0.0625 0.359375 0.0625 1.25l0 4.671875l-1.28125 0l0 -4.625q0 -0.78125 -0.15625 -1.171875q-0.15625 -0.390625 -0.546875 -0.625q-0.375 -0.234375 -0.890625 -0.234375q-0.8125 0 -1.421875 0.53125q-0.59375 0.515625 -0.59375 1.96875l0 4.15625l-1.28125 0zm12.3324585 0l0 -10.484375l1.390625 0l0 9.25l5.15625 0l0 1.234375l-6.546875 0zm12.994873 -0.9375q-0.71875 0.609375 -1.375 0.859375q-0.65625 0.25 -1.421875 0.25q-1.25 0 -1.921875 -0.609375q-0.671875 -0.609375 -0.671875 -1.5625q0 -0.5625 0.25 -1.015625q0.25 -0.46875 0.65625 -0.75q0.421875 -0.28125 0.9375 -0.421875q0.375 -0.09375 1.140625 -0.1875q1.5625 -0.1875 2.296875 -0.453125q0.015625 -0.265625 0.015625 -0.328125q0 -0.796875 -0.375 -1.109375q-0.484375 -0.4375 -1.453125 -0.4375q-0.921875 0 -1.359375 0.328125q-0.421875 0.3125 -0.625 1.109375l-1.265625 -0.171875q0.171875 -0.796875 0.5625 -1.296875q0.390625 -0.5 1.140625 -0.765625q0.75 -0.265625 1.71875 -0.265625q0.984375 0 1.59375 0.234375q0.609375 0.21875 0.890625 0.5625q0.28125 0.34375 0.40625 0.875q0.0625 0.328125 0.0625 1.1875l0 1.71875q0 1.796875 0.078125 2.28125q0.078125 0.46875 0.328125 0.90625l-1.34375 0q-0.203125 -0.40625 -0.265625 -0.9375zm-0.109375 -2.875q-0.703125 0.28125 -2.09375 0.484375q-0.796875 0.109375 -1.125 0.265625q-0.328125 0.140625 -0.515625 0.421875q-0.171875 0.265625 -0.171875 0.59375q0 0.515625 0.390625 0.859375q0.390625 0.34375 1.140625 0.34375q0.734375 0 1.3125 -0.3125q0.59375 -0.328125 0.859375 -0.890625q0.203125 -0.4375 0.203125 -1.296875l0 -0.46875zm3.2448425 6.734375l-0.140625 -1.203125q0.421875 0.109375 0.734375 0.109375q0.4375 0 0.6875 -0.140625q0.265625 -0.140625 0.421875 -0.40625q0.125 -0.1875 0.390625 -0.953125q0.046875 -0.109375 0.125 -0.3125l-2.890625 -7.609375l1.390625 0l1.578125 4.390625q0.3125 0.84375 0.546875 1.765625q0.234375 -0.890625 0.53125 -1.734375l1.625 -4.421875l1.296875 0l-2.890625 7.71875q-0.46875 1.25 -0.734375 1.734375q-0.34375 0.625 -0.78125 0.921875q-0.4375 0.296875 -1.0625 0.296875q-0.375 0 -0.828125 -0.15625zm12.593765 -5.375l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.1718903 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.5156403 0 2.4843903 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.6562653 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.50001526 -0.375 0.79689026 -1.203125zm-4.2343903 -2.078125l4.2500153 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.62501526 -0.75 -1.6093903 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm7.1667633 4.53125l0 -7.59375l1.15625 0l0 1.140625q0.453125 -0.796875 0.828125 -1.046875q0.375 -0.265625 0.8125 -0.265625q0.65625 0 1.328125 0.40625l-0.4375 1.203125q-0.46875 -0.28125 -0.953125 -0.28125q-0.421875 0 -0.765625 0.25q-0.328125 0.25 -0.46875 0.703125q-0.21875 0.6875 -0.21875 1.5l0 3.984375l-1.28125 0zm11.421356 3.078125q-1.0625 -1.34375 -1.796875 -3.140625q-0.734375 -1.8125 -0.734375 -3.734375q0 -1.703125 0.546875 -3.265625q0.640625 -1.8125 1.984375 -3.609375l0.921875 0q-0.859375 1.484375 -1.140625 2.125q-0.4375 0.984375 -0.6875 2.0625q-0.296875 1.34375 -0.296875 2.6875q0 3.453125 2.125 6.875l-0.921875 0zm2.1618958 -8.1875q0 -2.609375 1.40625 -4.078125q1.40625 -1.484375 3.625 -1.484375q1.453125 0 2.609375 0.703125q1.171875 0.6875 1.78125 1.921875q0.609375 1.234375 0.609375 2.8125q0 1.59375 -0.640625 2.859375q-0.640625 1.265625 -1.828125 1.90625q-1.171875 0.640625 -2.546875 0.640625q-1.46875 0 -2.640625 -0.703125q-1.171875 -0.71875 -1.78125 -1.953125q-0.59375 -1.25 -0.59375 -2.625zm1.4375 0.015625q0 1.90625 1.015625 3.0q1.015625 1.078125 2.5625 1.078125q1.5625 0 2.578125 -1.09375q1.015625 -1.109375 1.015625 -3.125q0 -1.28125 -0.4375 -2.234375q-0.4375 -0.96875 -1.265625 -1.484375q-0.828125 -0.53125 -1.875 -0.53125q-1.46875 0 -2.53125 1.015625q-1.0625 1.015625 -1.0625 3.375zm9.915741 1.71875l1.3125 -0.109375q0.09375 0.78125 0.421875 1.296875q0.34375 0.5 1.0625 0.8125q0.71875 0.3125 1.609375 0.3125q0.796875 0 1.40625 -0.234375q0.609375 -0.234375 0.90625 -0.640625q0.296875 -0.421875 0.296875 -0.90625q0 -0.5 -0.296875 -0.859375q-0.28125 -0.375 -0.9375 -0.625q-0.421875 -0.171875 -1.875 -0.515625q-1.4375 -0.34375 -2.015625 -0.65625q-0.75 -0.390625 -1.125 -0.96875q-0.359375 -0.59375 -0.359375 -1.3125q0 -0.796875 0.4375 -1.484375q0.453125 -0.6875 1.3125 -1.046875q0.875 -0.359375 1.9375 -0.359375q1.171875 0 2.0625 0.375q0.890625 0.375 1.359375 1.109375q0.484375 0.734375 0.515625 1.65625l-1.328125 0.09375q-0.109375 -1.0 -0.734375 -1.5q-0.609375 -0.515625 -1.8125 -0.515625q-1.265625 0 -1.84375 0.46875q-0.578125 0.46875 -0.578125 1.109375q0 0.5625 0.421875 0.9375q0.390625 0.359375 2.078125 0.75q1.703125 0.375 2.328125 0.65625q0.921875 0.421875 1.359375 1.078125q0.4375 0.640625 0.4375 1.484375q0 0.84375 -0.484375 1.59375q-0.484375 0.734375 -1.390625 1.140625q-0.890625 0.40625 -2.015625 0.40625q-1.421875 0 -2.390625 -0.40625q-0.953125 -0.421875 -1.5 -1.25q-0.546875 -0.828125 -0.578125 -1.890625zm9.103729 3.375l4.015625 -10.484375l1.5 0l4.296875 10.484375l-1.578125 0l-1.234375 -3.171875l-4.375 0l-1.15625 3.171875l-1.46875 0zm3.015625 -4.3125l3.5625 0l-1.09375 -2.90625q-0.5 -1.3125 -0.75 -2.171875q-0.203125 1.015625 -0.5625 2.0l-1.15625 3.078125zm7.8537292 4.3125l0 -10.484375l1.390625 0l0 9.25l5.15625 0l0 1.234375l-6.546875 0zm8.885468 3.078125l-0.921875 0q2.140625 -3.421875 2.140625 -6.875q0 -1.34375 -0.3125 -2.671875q-0.25 -1.0625 -0.671875 -2.046875q-0.28125 -0.65625 -1.15625 -2.15625l0.921875 0q1.34375 1.796875 1.984375 3.609375q0.546875 1.5625 0.546875 3.265625q0 1.921875 -0.734375 3.734375q-0.734375 1.796875 -1.796875 3.140625z" fill-rule="nonzero"/><path fill="#cfe2f3" d="m28.509478 83.71099l192.28346 0l0 48.62992l-192.28346 0z" fill-rule="evenodd"/><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m28.509478 83.71099l192.28346 0l0 48.62992l-192.28346 0z" fill-rule="evenodd"/><path fill="#000000" d="m76.95251 104.10596l0 -10.484375l1.390625 0l0 4.296875l5.453125 0l0 -4.296875l1.390625 0l0 10.484375l-1.390625 0l0 -4.9375l-5.453125 0l0 4.9375l-1.390625 0zm9.896774 -3.796875q0 -2.109375 1.171875 -3.125q0.984375 -0.84375 2.390625 -0.84375q1.578125 0 2.5625 1.03125q1.0 1.015625 1.0 2.828125q0 1.46875 -0.4375 2.3125q-0.4375 0.828125 -1.28125 1.296875q-0.84375 0.46875 -1.84375 0.46875q-1.59375 0 -2.578125 -1.015625q-0.984375 -1.03125 -0.984375 -2.953125zm1.328125 0q0 1.453125 0.625 2.1875q0.640625 0.71875 1.609375 0.71875q0.96875 0 1.59375 -0.71875q0.640625 -0.734375 0.640625 -2.234375q0 -1.40625 -0.640625 -2.125q-0.640625 -0.734375 -1.59375 -0.734375q-0.96875 0 -1.609375 0.71875q-0.625 0.71875 -0.625 2.1875zm6.791733 1.53125l1.265625 -0.203125q0.109375 0.765625 0.59375 1.171875q0.5 0.40625 1.375 0.40625q0.890625 0 1.3125 -0.359375q0.4375 -0.359375 0.4375 -0.84375q0 -0.4375 -0.375 -0.6875q-0.265625 -0.171875 -1.3125 -0.4375q-1.421875 -0.359375 -1.96875 -0.609375q-0.546875 -0.265625 -0.828125 -0.734375q-0.28125 -0.46875 -0.28125 -1.015625q0 -0.515625 0.21875 -0.9375q0.234375 -0.4375 0.640625 -0.734375q0.296875 -0.21875 0.8125 -0.359375q0.53125 -0.15625 1.125 -0.15625q0.890625 0 1.5625 0.265625q0.671875 0.25 1.0 0.6875q0.328125 0.4375 0.4375 1.171875l-1.25 0.171875q-0.09375 -0.578125 -0.5 -0.90625q-0.40625 -0.34375 -1.15625 -0.34375q-0.890625 0 -1.28125 0.296875q-0.375 0.296875 -0.375 0.6875q0 0.25 0.15625 0.453125q0.15625 0.203125 0.5 0.34375q0.1875 0.078125 1.140625 0.328125q1.359375 0.359375 1.890625 0.59375q0.546875 0.234375 0.859375 0.6875q0.3125 0.4375 0.3125 1.09375q0 0.640625 -0.375 1.21875q-0.375 0.5625 -1.09375 0.875q-0.703125 0.3125 -1.59375 0.3125q-1.484375 0 -2.265625 -0.609375q-0.765625 -0.625 -0.984375 -1.828125zm10.65625 1.109375l0.1875 1.140625q-0.546875 0.109375 -0.984375 0.109375q-0.6875 0 -1.078125 -0.21875q-0.390625 -0.21875 -0.546875 -0.578125q-0.15625 -0.359375 -0.15625 -1.515625l0 -4.375l-0.953125 0l0 -1.0l0.953125 0l0 -1.890625l1.28125 -0.765625l0 2.65625l1.296875 0l0 1.0l-1.296875 0l0 4.4375q0 0.546875 0.0625 0.71875q0.078125 0.15625 0.21875 0.25q0.15625 0.078125 0.453125 0.078125q0.203125 0 0.5625 -0.046875zm12.972076 -2.515625l1.390625 0.34375q-0.4375 1.703125 -1.578125 2.609375q-1.125 0.890625 -2.765625 0.890625q-1.6875 0 -2.75 -0.6875q-1.0625 -0.6875 -1.625 -2.0q-0.546875 -1.3125 -0.546875 -2.8125q0 -1.640625 0.625 -2.859375q0.625 -1.21875 1.78125 -1.84375q1.15625 -0.640625 2.546875 -0.640625q1.5625 0 2.640625 0.8125q1.078125 0.796875 1.5 2.25l-1.375 0.3125q-0.359375 -1.140625 -1.0625 -1.65625q-0.6875 -0.53125 -1.734375 -0.53125q-1.21875 0 -2.03125 0.578125q-0.8125 0.578125 -1.140625 1.5625q-0.328125 0.96875 -0.328125 2.015625q0 1.328125 0.390625 2.328125q0.390625 1.0 1.21875 1.5q0.828125 0.484375 1.78125 0.484375q1.171875 0 1.96875 -0.671875q0.8125 -0.671875 1.09375 -1.984375zm2.9123993 3.671875l0 -10.484375l1.28125 0l0 10.484375l-1.28125 0zm8.240532 -0.9375q-0.71875 0.609375 -1.375 0.859375q-0.6562576 0.25 -1.4218826 0.25q-1.25 0 -1.921875 -0.609375q-0.671875 -0.609375 -0.671875 -1.5625q0 -0.5625 0.25 -1.015625q0.25 -0.46875 0.65625 -0.75q0.421875 -0.28125 0.9375 -0.421875q0.375 -0.09375 1.140625 -0.1875q1.5625076 -0.1875 2.2968826 -0.453125q0.015625 -0.265625 0.015625 -0.328125q0 -0.796875 -0.375 -1.109375q-0.484375 -0.4375 -1.4531326 -0.4375q-0.921875 0 -1.359375 0.328125q-0.421875 0.3125 -0.625 1.109375l-1.265625 -0.171875q0.171875 -0.796875 0.5625 -1.296875q0.390625 -0.5 1.140625 -0.765625q0.75 -0.265625 1.7187576 -0.265625q0.984375 0 1.59375 0.234375q0.609375 0.21875 0.890625 0.5625q0.28125 0.34375 0.40625 0.875q0.0625 0.328125 0.0625 1.1875l0 1.71875q0 1.796875 0.078125 2.28125q0.078125 0.46875 0.328125 0.90625l-1.34375 0q-0.203125 -0.40625 -0.265625 -0.9375zm-0.109375 -2.875q-0.703125 0.28125 -2.0937576 0.484375q-0.796875 0.109375 -1.125 0.265625q-0.328125 0.140625 -0.515625 0.421875q-0.171875 0.265625 -0.171875 0.59375q0 0.515625 0.390625 0.859375q0.390625 0.34375 1.140625 0.34375q0.7343826 0 1.3125076 -0.3125q0.59375 -0.328125 0.859375 -0.890625q0.203125 -0.4375 0.203125 -1.296875l0 -0.46875zm2.7917328 1.546875l1.265625 -0.203125q0.109375 0.765625 0.59375 1.171875q0.5 0.40625 1.375 0.40625q0.890625 0 1.3125 -0.359375q0.4375 -0.359375 0.4375 -0.84375q0 -0.4375 -0.375 -0.6875q-0.265625 -0.171875 -1.3125 -0.4375q-1.421875 -0.359375 -1.96875 -0.609375q-0.546875 -0.265625 -0.828125 -0.734375q-0.28125 -0.46875 -0.28125 -1.015625q0 -0.515625 0.21875 -0.9375q0.234375 -0.4375 0.640625 -0.734375q0.296875 -0.21875 0.8125 -0.359375q0.53125 -0.15625 1.125 -0.15625q0.890625 0 1.5625 0.265625q0.671875 0.25 1.0 0.6875q0.328125 0.4375 0.4375 1.171875l-1.25 0.171875q-0.09375 -0.578125 -0.5 -0.90625q-0.40625 -0.34375 -1.15625 -0.34375q-0.890625 0 -1.28125 0.296875q-0.375 0.296875 -0.375 0.6875q0 0.25 0.15625 0.453125q0.15625 0.203125 0.5 0.34375q0.1875 0.078125 1.140625 0.328125q1.359375 0.359375 1.890625 0.59375q0.546875 0.234375 0.859375 0.6875q0.3125 0.4375 0.3125 1.09375q0 0.640625 -0.375 1.21875q-0.375 0.5625 -1.09375 0.875q-0.703125 0.3125 -1.59375 0.3125q-1.484375 0 -2.265625 -0.609375q-0.765625 -0.625 -0.984375 -1.828125zm7.328125 0l1.265625 -0.203125q0.109375 0.765625 0.59375 1.171875q0.5 0.40625 1.375 0.40625q0.890625 0 1.3125 -0.359375q0.4375 -0.359375 0.4375 -0.84375q0 -0.4375 -0.375 -0.6875q-0.265625 -0.171875 -1.3125 -0.4375q-1.421875 -0.359375 -1.96875 -0.609375q-0.546875 -0.265625 -0.828125 -0.734375q-0.28125 -0.46875 -0.28125 -1.015625q0 -0.515625 0.21875 -0.9375q0.234375 -0.4375 0.640625 -0.734375q0.296875 -0.21875 0.8125 -0.359375q0.53125 -0.15625 1.125 -0.15625q0.890625 0 1.5625 0.265625q0.671875 0.25 1.0 0.6875q0.328125 0.4375 0.4375 1.171875l-1.25 0.171875q-0.09375 -0.578125 -0.5 -0.90625q-0.40625 -0.34375 -1.15625 -0.34375q-0.890625 0 -1.28125 0.296875q-0.375 0.296875 -0.375 0.6875q0 0.25 0.15625 0.453125q0.15625 0.203125 0.5 0.34375q0.1875 0.078125 1.140625 0.328125q1.359375 0.359375 1.890625 0.59375q0.546875 0.234375 0.859375 0.6875q0.3125 0.4375 0.3125 1.09375q0 0.640625 -0.375 1.21875q-0.375 0.5625 -1.09375 0.875q-0.703125 0.3125 -1.59375 0.3125q-1.484375 0 -2.265625 -0.609375q-0.765625 -0.625 -0.984375 -1.828125zm10.122101 2.265625l4.015625 -10.484375l1.5 0l4.296875 10.484375l-1.578125 0l-1.234375 -3.171875l-4.375 0l-1.15625 3.171875l-1.46875 0zm3.015625 -4.3125l3.5625 0l-1.09375 -2.90625q-0.5 -1.3125 -0.75 -2.171875q-0.203125 1.015625 -0.5625 2.0l-1.15625 3.078125zm7.9006042 4.3125l0 -10.484375l3.96875 0q1.046875 0 1.59375 0.09375q0.765625 0.125 1.28125 0.484375q0.53125 0.359375 0.84375 1.015625q0.328125 0.65625 0.328125 1.4375q0 1.328125 -0.859375 2.265625q-0.84375 0.921875 -3.078125 0.921875l-2.6875 0l0 4.265625l-1.390625 0zm1.390625 -5.5l2.71875 0q1.34375 0 1.90625 -0.5q0.5625 -0.5 0.5625 -1.40625q0 -0.671875 -0.328125 -1.140625q-0.328125 -0.46875 -0.875 -0.609375q-0.359375 -0.09375 -1.296875 -0.09375l-2.6875 0l0 3.75zm8.619354 5.5l0 -10.484375l1.390625 0l0 10.484375l-1.390625 0z" fill-rule="nonzero"/><path fill="#000000" d="m113.3875 122.10595l0 -9.25l-3.453125 0l0 -1.234375l8.3125 0l0 1.234375l-3.46875 0l0 9.25l-1.390625 0zm13.171371 -10.484375l1.390625 0l0 6.046875q0 1.59375 -0.359375 2.53125q-0.359375 0.921875 -1.296875 1.5q-0.9375 0.578125 -2.453125 0.578125q-1.46875 0 -2.40625 -0.5q-0.9375 -0.515625 -1.34375 -1.46875q-0.390625 -0.96875 -0.390625 -2.640625l0 -6.046875l1.390625 0l0 6.046875q0 1.375 0.25 2.015625q0.25 0.640625 0.859375 1.0q0.625 0.34375 1.53125 0.34375q1.53125 0 2.171875 -0.6875q0.65625 -0.703125 0.65625 -2.671875l0 -6.046875zm3.7405243 10.484375l0 -10.484375l1.390625 0l0 4.296875l5.453125 0l0 -4.296875l1.390625 0l0 10.484375l-1.390625 0l0 -4.9375l-5.453125 0l0 4.9375l-1.390625 0z" fill-rule="nonzero"/><path fill="#d9ead3" d="m220.78944 83.71099l192.28346 0l0 48.62992l-192.28346 0z" fill-rule="evenodd"/><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m220.78944 83.71099l192.28346 0l0 48.62992l-192.28346 0z" fill-rule="evenodd"/><path fill="#000000" d="m261.85388 104.10596l0 -10.484375l3.625 0q1.21875 0 1.859375 0.140625q0.90625 0.203125 1.546875 0.75q0.828125 0.703125 1.234375 1.796875q0.40625 1.09375 0.40625 2.5q0 1.1875 -0.28125 2.109375q-0.265625 0.921875 -0.703125 1.53125q-0.4375 0.609375 -0.96875 0.953125q-0.515625 0.34375 -1.25 0.53125q-0.71875 0.171875 -1.671875 0.171875l-3.796875 0zm1.390625 -1.234375l2.25 0q1.03125 0 1.625 -0.1875q0.59375 -0.203125 0.9375 -0.546875q0.5 -0.5 0.765625 -1.328125q0.28125 -0.84375 0.28125 -2.03125q0 -1.640625 -0.546875 -2.515625q-0.53125 -0.890625 -1.3125 -1.1875q-0.546875 -0.21875 -1.796875 -0.21875l-2.203125 0l0 8.015625zm14.24054 -1.21875l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.171875 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.515625 0 2.484375 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.65625 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.5 -0.375 0.796875 -1.203125zm-4.234375 -2.078125l4.25 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.625 -0.75 -1.609375 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm9.291718 4.53125l-2.890625 -7.59375l1.359375 0l1.625 4.546875q0.265625 0.734375 0.5 1.53125q0.15625 -0.609375 0.46875 -1.453125l1.6875 -4.625l1.328125 0l-2.875 7.59375l-1.203125 0zm5.21875 -9.015625l0 -1.46875l1.296875 0l0 1.46875l-1.296875 0zm0 9.015625l0 -7.59375l1.296875 0l0 7.59375l-1.296875 0zm8.20929 -2.78125l1.265625 0.15625q-0.203125 1.3125 -1.0625 2.0625q-0.84375 0.734375 -2.09375 0.734375q-1.5625 0 -2.515625 -1.015625q-0.9375 -1.03125 -0.9375 -2.921875q0 -1.234375 0.40625 -2.15625q0.40625 -0.921875 1.234375 -1.375q0.84375 -0.46875 1.8125 -0.46875q1.25 0 2.03125 0.625q0.78125 0.625 1.015625 1.765625l-1.265625 0.203125q-0.171875 -0.765625 -0.625 -1.15625q-0.453125 -0.390625 -1.09375 -0.390625q-0.984375 0 -1.59375 0.703125q-0.609375 0.703125 -0.609375 2.203125q0 1.53125 0.578125 2.234375q0.59375 0.6875 1.546875 0.6875q0.75 0 1.265625 -0.453125q0.515625 -0.46875 0.640625 -1.4375zm7.578125 0.328125l1.328125 0.171875q-0.3125 1.171875 -1.171875 1.8125q-0.84375 0.640625 -2.171875 0.640625q-1.671875 0 -2.65625 -1.015625q-0.96875 -1.03125 -0.96875 -2.890625q0 -1.921875 0.984375 -2.96875q1.0 -1.0625 2.578125 -1.0625q1.515625 0 2.484375 1.03125q0.96875 1.03125 0.96875 2.921875q0 0.109375 -0.015625 0.34375l-5.65625 0q0.0625 1.25 0.703125 1.921875q0.640625 0.65625 1.59375 0.65625q0.703125 0 1.203125 -0.359375q0.5 -0.375 0.796875 -1.203125zm-4.234375 -2.078125l4.25 0q-0.09375 -0.953125 -0.484375 -1.4375q-0.625 -0.75 -1.609375 -0.75q-0.875 0 -1.484375 0.59375q-0.609375 0.59375 -0.671875 1.59375zm18.894958 0.859375l1.390625 0.34375q-0.4375 1.703125 -1.578125 2.609375q-1.125 0.890625 -2.765625 0.890625q-1.6875 0 -2.75 -0.6875q-1.0625 -0.6875 -1.625 -2.0q-0.546875 -1.3125 -0.546875 -2.8125q0 -1.640625 0.625 -2.859375q0.625 -1.21875 1.78125 -1.84375q1.15625 -0.640625 2.546875 -0.640625q1.5625 0 2.640625 0.8125q1.078125 0.796875 1.5 2.25l-1.375 0.3125q-0.359375 -1.140625 -1.0625 -1.65625q-0.6875 -0.53125 -1.734375 -0.53125q-1.21875 0 -2.03125 0.578125q-0.8125 0.578125 -1.140625 1.5625q-0.328125 0.96875 -0.328125 2.015625q0 1.328125 0.390625 2.328125q0.390625 1.0 1.21875 1.5q0.828125 0.484375 1.78125 0.484375q1.171875 0 1.96875 -0.671875q0.8125 -0.671875 1.09375 -1.984375zm2.912384 3.671875l0 -10.484375l1.28125 0l0 10.484375l-1.28125 0zm8.24054 -0.9375q-0.71875 0.609375 -1.375 0.859375q-0.65625 0.25 -1.421875 0.25q-1.25 0 -1.921875 -0.609375q-0.671875 -0.609375 -0.671875 -1.5625q0 -0.5625 0.25 -1.015625q0.25 -0.46875 0.65625 -0.75q0.421875 -0.28125 0.9375 -0.421875q0.375 -0.09375 1.140625 -0.1875q1.5625 -0.1875 2.296875 -0.453125q0.015625 -0.265625 0.015625 -0.328125q0 -0.796875 -0.375 -1.109375q-0.484375 -0.4375 -1.453125 -0.4375q-0.921875 0 -1.359375 0.328125q-0.421875 0.3125 -0.625 1.109375l-1.265625 -0.171875q0.171875 -0.796875 0.5625 -1.296875q0.390625 -0.5 1.140625 -0.765625q0.75 -0.265625 1.71875 -0.265625q0.984375 0 1.59375 0.234375q0.609375 0.21875 0.890625 0.5625q0.28125 0.34375 0.40625 0.875q0.0625 0.328125 0.0625 1.1875l0 1.71875q0 1.796875 0.078125 2.28125q0.078125 0.46875 0.328125 0.90625l-1.34375 0q-0.203125 -0.40625 -0.265625 -0.9375zm-0.109375 -2.875q-0.703125 0.28125 -2.09375 0.484375q-0.796875 0.109375 -1.125 0.265625q-0.328125 0.140625 -0.515625 0.421875q-0.171875 0.265625 -0.171875 0.59375q0 0.515625 0.390625 0.859375q0.390625 0.34375 1.140625 0.34375q0.734375 0 1.3125 -0.3125q0.59375 -0.328125 0.859375 -0.890625q0.203125 -0.4375 0.203125 -1.296875l0 -0.46875zm2.7917175 1.546875l1.265625 -0.203125q0.109375 0.765625 0.59375 1.171875q0.5 0.40625 1.375 0.40625q0.890625 0 1.3125 -0.359375q0.4375 -0.359375 0.4375 -0.84375q0 -0.4375 -0.375 -0.6875q-0.265625 -0.171875 -1.3125 -0.4375q-1.421875 -0.359375 -1.96875 -0.609375q-0.546875 -0.265625 -0.828125 -0.734375q-0.28125 -0.46875 -0.28125 -1.015625q0 -0.515625 0.21875 -0.9375q0.234375 -0.4375 0.640625 -0.734375q0.296875 -0.21875 0.8125 -0.359375q0.53125 -0.15625 1.125 -0.15625q0.890625 0 1.5625 0.265625q0.671875 0.25 1.0 0.6875q0.328125 0.4375 0.4375 1.171875l-1.25 0.171875q-0.09375 -0.578125 -0.5 -0.90625q-0.40625 -0.34375 -1.15625 -0.34375q-0.890625 0 -1.28125 0.296875q-0.375 0.296875 -0.375 0.6875q0 0.25 0.15625 0.453125q0.15625 0.203125 0.5 0.34375q0.1875 0.078125 1.140625 0.328125q1.359375 0.359375 1.890625 0.59375q0.546875 0.234375 0.859375 0.6875q0.3125 0.4375 0.3125 1.09375q0 0.640625 -0.375 1.21875q-0.375 0.5625 -1.09375 0.875q-0.703125 0.3125 -1.59375 0.3125q-1.484375 0 -2.265625 -0.609375q-0.765625 -0.625 -0.984375 -1.828125zm7.328125 0l1.265625 -0.203125q0.109375 0.765625 0.59375 1.171875q0.5 0.40625 1.375 0.40625q0.890625 0 1.3125 -0.359375q0.4375 -0.359375 0.4375 -0.84375q0 -0.4375 -0.375 -0.6875q-0.265625 -0.171875 -1.3125 -0.4375q-1.421875 -0.359375 -1.96875 -0.609375q-0.546875 -0.265625 -0.828125 -0.734375q-0.28125 -0.46875 -0.28125 -1.015625q0 -0.515625 0.21875 -0.9375q0.234375 -0.4375 0.640625 -0.734375q0.296875 -0.21875 0.8125 -0.359375q0.53125 -0.15625 1.125 -0.15625q0.890625 0 1.5625 0.265625q0.671875 0.25 1.0 0.6875q0.328125 0.4375 0.4375 1.171875l-1.25 0.171875q-0.09375 -0.578125 -0.5 -0.90625q-0.40625 -0.34375 -1.15625 -0.34375q-0.890625 0 -1.28125 0.296875q-0.375 0.296875 -0.375 0.6875q0 0.25 0.15625 0.453125q0.15625 0.203125 0.5 0.34375q0.1875 0.078125 1.140625 0.328125q1.359375 0.359375 1.890625 0.59375q0.546875 0.234375 0.859375 0.6875q0.3125 0.4375 0.3125 1.09375q0 0.640625 -0.375 1.21875q-0.375 0.5625 -1.09375 0.875q-0.703125 0.3125 -1.59375 0.3125q-1.484375 0 -2.265625 -0.609375q-0.765625 -0.625 -0.984375 -1.828125zm10.122101 2.265625l4.015625 -10.484375l1.5 0l4.296875 10.484375l-1.578125 0l-1.234375 -3.171875l-4.375 0l-1.15625 3.171875l-1.46875 0zm3.015625 -4.3125l3.5625 0l-1.09375 -2.90625q-0.5 -1.3125 -0.75 -2.171875q-0.203125 1.015625 -0.5625 2.0l-1.15625 3.078125zm7.9006042 4.3125l0 -10.484375l3.96875 0q1.046875 0 1.59375 0.09375q0.765625 0.125 1.28125 0.484375q0.53125 0.359375 0.84375 1.015625q0.328125 0.65625 0.328125 1.4375q0 1.328125 -0.859375 2.265625q-0.84375 0.921875 -3.078125 0.921875l-2.6875 0l0 4.265625l-1.390625 0zm1.390625 -5.5l2.71875 0q1.34375 0 1.90625 -0.5q0.5625 -0.5 0.5625 -1.40625q0 -0.671875 -0.328125 -1.140625q-0.328125 -0.46875 -0.875 -0.609375q-0.359375 -0.09375 -1.296875 -0.09375l-2.6875 0l0 3.75zm8.619354 5.5l0 -10.484375l1.390625 0l0 10.484375l-1.390625 0z" fill-rule="nonzero"/><path fill="#000000" d="m305.66745 122.10595l0 -9.25l-3.453125 0l0 -1.234375l8.3125 0l0 1.234375l-3.46875 0l0 9.25l-1.390625 0zm13.171387 -10.484375l1.390625 0l0 6.046875q0 1.59375 -0.359375 2.53125q-0.359375 0.921875 -1.296875 1.5q-0.9375 0.578125 -2.453125 0.578125q-1.46875 0 -2.40625 -0.5q-0.9375 -0.515625 -1.34375 -1.46875q-0.390625 -0.96875 -0.390625 -2.640625l0 -6.046875l1.390625 0l0 6.046875q0 1.375 0.25 2.015625q0.25 0.640625 0.859375 1.0q0.625 0.34375 1.53125 0.34375q1.53125 0 2.171875 -0.6875q0.65625 -0.703125 0.65625 -2.671875l0 -6.046875zm3.693634 10.484375l0 -10.484375l3.625 0q1.21875 0 1.859375 0.140625q0.90625 0.203125 1.546875 0.75q0.828125 0.703125 1.234375 1.796875q0.40625 1.09375 0.40625 2.5q0 1.1875 -0.28125 2.109375q-0.265625 0.921875 -0.703125 1.53125q-0.4375 0.609375 -0.96875 0.953125q-0.515625 0.34375 -1.25 0.53125q-0.71875 0.171875 -1.671875 0.171875l-3.796875 0zm1.390625 -1.234375l2.25 0q1.03125 0 1.625 -0.1875q0.59375 -0.203125 0.9375 -0.546875q0.5 -0.5 0.765625 -1.328125q0.28125 -0.84375 0.28125 -2.03125q0 -1.640625 -0.546875 -2.515625q-0.53125 -0.890625 -1.3125 -1.1875q-0.546875 -0.21875 -1.796875 -0.21875l-2.203125 0l0 8.015625z" fill-rule="nonzero"/><path fill="#000000" fill-opacity="0.0" d="m414.7422 230.80695l0 0" fill-rule="evenodd"/><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m414.7422 230.80695l0 0" fill-rule="evenodd"/><path fill="#000000" fill-opacity="0.0" d="m416.97958 84.35958l69.102356 0" fill-rule="evenodd"/><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" stroke-dasharray="8.0,3.0" d="m416.97958 84.35958l69.102356 0" fill-rule="evenodd"/><path fill="#000000" fill-opacity="0.0" d="m430.57208 84.35958l69.10239 0l0 37.5748l-69.10239 0z" fill-rule="evenodd"/><path fill="#000000" d="m441.68146 103.87958l0 -7.578125l-2.828125 0l0 -1.015625l6.8125 0l0 1.015625l-2.84375 0l0 7.578125l-1.140625 0zm4.5722656 -7.375l0 -1.21875l1.0625 0l0 1.21875l-1.0625 0zm0 7.375l0 -6.21875l1.0625 0l0 6.21875l-1.0625 0zm2.6660156 0l0 -6.21875l0.9375 0l0 0.875q0.6875 -1.015625 1.984375 -1.015625q0.5625 0 1.03125 0.203125q0.484375 0.203125 0.71875 0.53125q0.234375 0.328125 0.328125 0.765625q0.046875 0.296875 0.046875 1.03125l0 3.828125l-1.046875 0l0 -3.78125q0 -0.65625 -0.125 -0.96875q-0.125 -0.3125 -0.4375 -0.5q-0.3125 -0.203125 -0.734375 -0.203125q-0.671875 0 -1.171875 0.4375q-0.484375 0.421875 -0.484375 1.609375l0 3.40625l-1.046875 0zm6.626953 2.390625l-0.125 -0.984375q0.34375 0.09375 0.609375 0.09375q0.34375 0 0.546875 -0.125q0.21875 -0.109375 0.359375 -0.3125q0.09375 -0.171875 0.328125 -0.796875q0.015625 -0.078125 0.09375 -0.25l-2.375 -6.234375l1.140625 0l1.296875 3.59375q0.25 0.6875 0.453125 1.453125q0.1875 -0.734375 0.4375 -1.421875l1.328125 -3.625l1.046875 0l-2.359375 6.328125q-0.390625 1.015625 -0.59375 1.40625q-0.28125 0.53125 -0.65625 0.765625q-0.359375 0.25 -0.859375 0.25q-0.296875 0 -0.671875 -0.140625zm11.8125 -10.984375l1.140625 0l0 4.96875q0 1.296875 -0.296875 2.0625q-0.296875 0.75 -1.0625 1.234375q-0.765625 0.46875 -2.0 0.46875q-1.203125 0 -1.984375 -0.40625q-0.765625 -0.421875 -1.09375 -1.203125q-0.328125 -0.796875 -0.328125 -2.15625l0 -4.96875l1.140625 0l0 4.953125q0 1.125 0.203125 1.65625q0.21875 0.53125 0.71875 0.828125q0.515625 0.28125 1.25 0.28125q1.25 0 1.78125 -0.5625q0.53125 -0.578125 0.53125 -2.203125l0 -4.953125zm2.6503906 5.828125l1.0625 -0.09375q0.078125 0.65625 0.359375 1.0625q0.28125 0.40625 0.859375 0.671875q0.59375 0.25 1.328125 0.25q0.640625 0 1.140625 -0.1875q0.5 -0.203125 0.734375 -0.53125q0.25 -0.34375 0.25 -0.734375q0 -0.40625 -0.234375 -0.703125q-0.234375 -0.3125 -0.765625 -0.515625q-0.359375 -0.140625 -1.546875 -0.421875q-1.171875 -0.28125 -1.640625 -0.53125q-0.625 -0.328125 -0.921875 -0.796875q-0.296875 -0.484375 -0.296875 -1.078125q0 -0.640625 0.359375 -1.203125q0.375 -0.578125 1.078125 -0.859375q0.71875 -0.296875 1.578125 -0.296875q0.953125 0 1.6875 0.3125q0.734375 0.296875 1.125 0.90625q0.390625 0.59375 0.421875 1.34375l-1.09375 0.078125q-0.09375 -0.8125 -0.609375 -1.21875q-0.5 -0.421875 -1.484375 -0.421875q-1.03125 0 -1.5 0.375q-0.46875 0.375 -0.46875 0.90625q0 0.46875 0.328125 0.765625q0.328125 0.296875 1.703125 0.609375q1.390625 0.3125 1.90625 0.546875q0.75 0.359375 1.109375 0.890625q0.359375 0.515625 0.359375 1.21875q0 0.6875 -0.390625 1.296875q-0.390625 0.59375 -1.125 0.9375q-0.734375 0.328125 -1.65625 0.328125q-1.171875 0 -1.96875 -0.328125q-0.78125 -0.34375 -1.234375 -1.03125q-0.4375 -0.6875 -0.453125 -1.546875zm8.332031 2.765625l0 -8.59375l3.234375 0q0.984375 0 1.578125 0.265625q0.59375 0.265625 0.921875 0.8125q0.34375 0.53125 0.34375 1.125q0 0.546875 -0.296875 1.03125q-0.296875 0.484375 -0.90625 0.78125q0.78125 0.234375 1.1875 0.796875q0.421875 0.546875 0.421875 1.296875q0 0.59375 -0.25 1.125q-0.25 0.515625 -0.625 0.796875q-0.375 0.28125 -0.953125 0.421875q-0.5625 0.140625 -1.375 0.140625l-3.28125 0zm1.140625 -4.984375l1.859375 0q0.75 0 1.078125 -0.09375q0.4375 -0.125 0.65625 -0.421875q0.21875 -0.3125 0.21875 -0.765625q0 -0.421875 -0.203125 -0.75q-0.203125 -0.328125 -0.59375 -0.4375q-0.375 -0.125 -1.296875 -0.125l-1.71875 0l0 2.59375zm0 3.96875l2.140625 0q0.546875 0 0.765625 -0.046875q0.40625 -0.0625 0.65625 -0.21875q0.265625 -0.171875 0.4375 -0.484375q0.171875 -0.3125 0.171875 -0.71875q0 -0.484375 -0.25 -0.84375q-0.234375 -0.359375 -0.671875 -0.5q-0.4375 -0.140625 -1.265625 -0.140625l-1.984375 0l0 2.953125z" fill-rule="nonzero"/><path fill="#000000" fill-opacity="0.0" d="m416.97958 231.92447l69.102356 0" fill-rule="evenodd"/><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" stroke-dasharray="8.0,3.0" d="m416.97958 231.92447l69.102356 0" fill-rule="evenodd"/><path fill="#000000" fill-opacity="0.0" d="m429.0601 231.92447l72.12598 0l0 37.5748l-72.12598 0z" fill-rule="evenodd"/><path fill="#000000" d="m437.9507 251.44447l0 -8.59375l1.71875 0l2.03125 6.078125q0.28125 0.859375 0.40625 1.28125q0.140625 -0.46875 0.453125 -1.375l2.0625 -5.984375l1.53125 0l0 8.59375l-1.09375 0l0 -7.1875l-2.5 7.1875l-1.03125 0l-2.484375 -7.3125l0 7.3125l-1.09375 0zm16.167969 -3.015625l1.125 0.296875q-0.359375 1.390625 -1.28125 2.125q-0.921875 0.734375 -2.265625 0.734375q-1.390625 0 -2.265625 -0.5625q-0.875 -0.5625 -1.328125 -1.625q-0.453125 -1.078125 -0.453125 -2.3125q0 -1.34375 0.515625 -2.34375q0.515625 -1.0 1.453125 -1.515625q0.953125 -0.515625 2.09375 -0.515625q1.28125 0 2.15625 0.65625q0.890625 0.65625 1.234375 1.84375l-1.125 0.265625q-0.296875 -0.9375 -0.875 -1.359375q-0.5625 -0.4375 -1.421875 -0.4375q-0.984375 0 -1.65625 0.484375q-0.65625 0.46875 -0.9375 1.265625q-0.265625 0.796875 -0.265625 1.65625q0 1.09375 0.3125 1.90625q0.328125 0.8125 1.0 1.21875q0.671875 0.40625 1.46875 0.40625q0.953125 0 1.609375 -0.546875q0.671875 -0.546875 0.90625 -1.640625zm8.166016 -5.578125l1.140625 0l0 4.96875q0 1.296875 -0.296875 2.0625q-0.296875 0.75 -1.0625 1.234375q-0.765625 0.46875 -2.0 0.46875q-1.203125 0 -1.984375 -0.40625q-0.765625 -0.421875 -1.09375 -1.203125q-0.328125 -0.796875 -0.328125 -2.15625l0 -4.96875l1.140625 0l0 4.953125q0 1.125 0.203125 1.65625q0.21875 0.53125 0.71875 0.828125q0.515625 0.28125 1.25 0.28125q1.25 0 1.78125 -0.5625q0.53125 -0.578125 0.53125 -2.203125l0 -4.953125zm6.359375 8.59375l0 -8.59375l3.25 0q0.84375 0 1.296875 0.078125q0.640625 0.109375 1.0625 0.40625q0.4375 0.296875 0.6875 0.828125q0.265625 0.53125 0.265625 1.171875q0 1.09375 -0.703125 1.859375q-0.6875 0.75 -2.515625 0.75l-2.203125 0l0 3.5l-1.140625 0zm1.140625 -4.5l2.21875 0q1.109375 0 1.5625 -0.40625q0.46875 -0.421875 0.46875 -1.171875q0 -0.53125 -0.28125 -0.90625q-0.265625 -0.390625 -0.703125 -0.515625q-0.296875 -0.078125 -1.0625 -0.078125l-2.203125 0l0 3.078125zm6.3476562 1.390625q0 -1.734375 0.953125 -2.5625q0.796875 -0.6875 1.953125 -0.6875q1.28125 0 2.09375 0.84375q0.828125 0.828125 0.828125 2.3125q0 1.203125 -0.359375 1.890625q-0.359375 0.6875 -1.0625 1.078125q-0.6875 0.375 -1.5 0.375q-1.296875 0 -2.109375 -0.828125q-0.796875 -0.84375 -0.796875 -2.421875zm1.078125 0q0 1.1875 0.515625 1.78125q0.53125 0.59375 1.3125 0.59375q0.796875 0 1.3125 -0.59375q0.515625 -0.59375 0.515625 -1.8125q0 -1.15625 -0.53125 -1.75q-0.515625 -0.59375 -1.296875 -0.59375q-0.78125 0 -1.3125 0.59375q-0.515625 0.578125 -0.515625 1.78125zm5.970703 3.109375l0 -6.21875l0.953125 0l0 0.9375q0.359375 -0.65625 0.65625 -0.859375q0.3125 -0.21875 0.6875 -0.21875q0.53125 0 1.078125 0.328125l-0.359375 0.984375q-0.390625 -0.234375 -0.765625 -0.234375q-0.359375 0 -0.640625 0.21875q-0.265625 0.203125 -0.375 0.578125q-0.1875 0.5625 -0.1875 1.21875l0 3.265625l-1.046875 0zm6.3085938 -0.9375l0.15625 0.921875q-0.453125 0.09375 -0.796875 0.09375q-0.578125 0 -0.890625 -0.171875q-0.3125 -0.1875 -0.453125 -0.484375q-0.125 -0.296875 -0.125 -1.25l0 -3.578125l-0.765625 0l0 -0.8125l0.765625 0l0 -1.546875l1.046875 -0.625l0 2.171875l1.0625 0l0 0.8125l-1.0625 0l0 3.640625q0 0.453125 0.046875 0.578125q0.0625 0.125 0.1875 0.203125q0.125 0.078125 0.359375 0.078125q0.1875 0 0.46875 -0.03125z" fill-rule="nonzero"/></g></svg> \ No newline at end of file
diff --git a/tinyusb/docs/conf.py b/tinyusb/docs/conf.py
deleted file mode 100755
index c7a17478..00000000
--- a/tinyusb/docs/conf.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# Configuration file for the Sphinx documentation builder.
-#
-# This file only contains a selection of the most common options. For a full
-# list see the documentation:
-# https://www.sphinx-doc.org/en/master/usage/configuration.html
-
-# -- Path setup --------------------------------------------------------------
-
-
-# -- Project information -----------------------------------------------------
-
-project = 'TinyUSB'
-copyright = '2021, Ha Thach'
-author = 'Ha Thach'
-
-
-# -- General configuration ---------------------------------------------------
-
-extensions = [
- 'sphinx.ext.autodoc',
- 'sphinx.ext.intersphinx',
- 'sphinx.ext.todo',
- 'sphinx_autodoc_typehints',
- 'sphinxemoji.sphinxemoji',
-]
-
-templates_path = ['_templates']
-
-exclude_patterns = ['_build']
-
-
-# -- Options for HTML output -------------------------------------------------
-
-html_theme = 'furo'
-html_title = 'TinyUSB'
-html_logo = 'assets/logo.svg'
-html_favicon = 'assets/logo.svg'
-html_theme_options = {
- 'sidebar_hide_name': True,
-}
-
-todo_include_todos = True
diff --git a/tinyusb/docs/contributing/code_of_conduct.rst b/tinyusb/docs/contributing/code_of_conduct.rst
deleted file mode 120000
index b52bf14c..00000000
--- a/tinyusb/docs/contributing/code_of_conduct.rst
+++ /dev/null
@@ -1 +0,0 @@
-../../CODE_OF_CONDUCT.rst \ No newline at end of file
diff --git a/tinyusb/docs/contributing/index.rst b/tinyusb/docs/contributing/index.rst
deleted file mode 100755
index c572894a..00000000
--- a/tinyusb/docs/contributing/index.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-************
-Contributing
-************
-
-Contributing can be highly rewarding, but it can also be frustrating at times.
-It takes time to review patches, and as this is an open source project, that
-sometimes can take a while. The reviewing process depends on the availability
-of the maintainers, who may not be always available. Please try to be
-understanding throught the process.
-
-There a few guidelines you need to keep in mind when contributing. Please have
-a look at them as that will make the contribution process easier for all
-parties.
-
-Index
-=====
-
-.. toctree::
- :maxdepth: 2
-
- code_of_conduct
- structure
- porting
diff --git a/tinyusb/docs/contributing/porting.rst b/tinyusb/docs/contributing/porting.rst
deleted file mode 100755
index 7e9e462f..00000000
--- a/tinyusb/docs/contributing/porting.rst
+++ /dev/null
@@ -1,241 +0,0 @@
-
-*******
-Porting
-*******
-
-TinyUSB is designed to be a universal USB protocol stack for microcontrollers. It
-handles most of the high level USB protocol and relies on the microcontroller's USB peripheral for
-data transactions on different endpoints. Porting is the process of adding low-level support for
-the rest of the common stack. Once the low-level is implemented, it is very easy to add USB support
-for the microcontroller to other projects, especially those already using TinyUSB such as CircuitPython.
-
-Below are instructions on how to get the cdc_msc device example running on a new microcontroller. Doing so includes adding the common code necessary for other uses while minimizing other extra code. Whenever you see a phrase or word in <> it should be replaced.
-
-Register defs
--------------
-
-The first step to adding support is including the register definitions and startup code for the
-microcontroller in TinyUSB. We write the TinyUSB implementation against these structs instead of higher level functions to keep the code small and to prevent function name collisions in linking of larger projects. For ARM microcontrollers this is the CMSIS definitions. They should be
-placed in the ``hw/mcu/<vendor>/<chip_family>`` directory.
-
-Once this is done, create a directory in ``hw/bsp/<your board name>`` for the specific board you are using to test the code. (Duplicating an existing board's directory is the best way to get started.) The board should be a readily available development board so that others can also test.
-
-Build
------
-
-Now that those directories are in place, we can start our iteration process to get the example building successfully. To build, run from the root of TinyUSB:
-
-``make -C examples/device/cdc_msc BOARD=<board>``
-
-Unless, you've read ahead, this will fail miserably. Now, lets get it to fail less by updating the files in the board directory. The code in the board's directory is responsible for setting up the microcontroller's clocks and pins so that USB works. TinyUSB itself only operates on the USB peripheral. The board directory also includes information what files are needed to build the example.
-
-One of the first things to change is the ``-DCFG_TUSB_MCU`` cflag in the ``board.mk`` file. This is used to tell TinyUSB what platform is being built. So, add an entry to ``src/tusb_option.h`` and update the CFLAG to match.
-
-Update ``board.mk``\ 's VENDOR and CHIP_FAMILY values when creating the directory for the struct files. Duplicate one of the other sources from ``src/portable`` into ``src/portable/<vendor>/<chip_family>`` and delete all of the implementation internals. We'll cover what everything there does later. For now, get it compiling.
-
-Implementation
---------------
-
-At this point you should get an error due to an implementation issue and hopefully the build is setup for the new MCU. You will still need to modify the ``board.mk`` to include specific CFLAGS, the linker script, linker flags, source files, include directories. All file paths are relative to the top of the TinyUSB repo.
-
-Board Support (BSP)
-^^^^^^^^^^^^^^^^^^^
-
-The board support code is only used for self-contained examples and testing. It is not used when TinyUSB is part of a larger project. Its responsible for getting the MCU started and the USB peripheral clocked. It also optionally provides LED definitions that are used to blink an LED to show that the code is running.
-
-It is located in ``hw/bsp/<board name>/board_<board name>.c``.
-
-board_init
-~~~~~~~~~~
-
-``board_init`` is responsible for starting the MCU, setting up the USB clock and USB pins. It is also responsible for initializing LED pins.
-
-One useful clock debugging technique is to set up a PWM output at a known value such as 500hz based on the USB clock so that you can verify it is correct with a logic probe or oscilloscope.
-
-Setup your USB in a crystal-less mode when available. That makes the code easier to port across boards.
-
-board_led_write
-~~~~~~~~~~~~~~~
-
-Feel free to skip this until you want to verify your demo code is running. To implement, set the pin corresponding to the led to output a value that lights the LED when ``state`` is true.
-
-OS Abstraction Layer (OSAL)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The OS Abstraction Layer is responsible for providing basic data structures for TinyUSB that may allow for concurrency when used with an RTOS. Without an RTOS it simply handles concurrency issues between the main code and interrupts.
-
-The code is almost entirely agnostic of MCU and lives in ``src/osal``.
-
-Device API
-^^^^^^^^^^
-
-After the USB device is setup, the USB device code works by processing events on the main thread (by calling ``tud_task``\ ). These events are queued by the USB interrupt handler. So, there are three parts to the device low-level API: device setup, endpoint setup and interrupt processing.
-
-All of the code for the low-level device API is in ``src/portable/<vendor>/<chip family>/dcd_<chip family>.c``.
-
-Device Setup
-~~~~~~~~~~~~
-
-dcd_init
-""""""""
-
-Initializes the USB peripheral for device mode and enables it.
-This function should enable internal D+/D- pull-up for enumeration.
-
-dcd_int_enable / dcd_int_disable
-""""""""""""""""""""""""""""""""
-
-Enables or disables the USB device interrupt(s). May be used to prevent concurrency issues when mutating data structures shared between main code and the interrupt handler.
-
-dcd_int_handler
-"""""""""""""""
-
-Processes all the hardware generated events e.g Bus reset, new data packet from host etc ... It will be called by application in the MCU USB interrupt handler.
-
-dcd_set_address
-"""""""""""""""
-
-Called when the device is given a new bus address.
-
-If your peripheral automatically changes address during enumeration (like the nrf52) you may leave this empty and also no queue an event for the corresponding SETUP packet.
-
-dcd_remote_wakeup
-"""""""""""""""""
-
-Called to remote wake up host when suspended (e.g hid keyboard)
-
-dcd_connect / dcd_disconnect
-""""""""""""""""""""""""""""
-
-Connect or disconnect the data-line pull-up resistor. Define only if MCU has an internal pull-up. (BSP may define for MCU without internal pull-up.)
-
-Special events
-~~~~~~~~~~~~~~
-
-You must let TinyUSB know when certain events occur so that it can continue its work. There are a few methods you can call to queue events for TinyUSB to process.
-
-dcd_event_bus_signal
-""""""""""""""""""""
-
-There are a number of events that your peripheral may communicate about the state of the bus. Here is an overview of what they are. Events in **BOLD** must be provided for TinyUSB to work.
-
-
-* **DCD_EVENT_RESET** - Triggered when the host resets the bus causing the peripheral to reset. Do any other internal reset you need from the interrupt handler such as resetting the control endpoint.
-* DCD_EVENT_SOF - Signals the start of a new USB frame.
-
-Calls to this look like:
-
-.. code-block::
-
- dcd_event_bus_signal(0, DCD_EVENT_BUS_RESET, true);
-
-
-The first ``0`` is the USB peripheral number. Statically saying 0 is common for single USB device MCUs.
-
-The ``true`` indicates the call is from an interrupt handler and will always be the case when porting in this way.
-
-dcd_setup_received
-""""""""""""""""""
-
-SETUP packets are a special type of transaction that can occur at any time on the control endpoint, numbered ``0``. Since they are unique, most peripherals have special handling for them. Their data is always 8 bytes in length as well.
-
-Calls to this look like:
-
-.. code-block::
-
- dcd_event_setup_received(0, setup, true);
-
-
-As before with ``dcd_event_bus_signal`` the first argument is the USB peripheral number and the third is true to signal its being called from an interrupt handler. The middle argument is byte array of length 8 with the contents of the SETUP packet. It can be stack allocated because it is copied into the queue.
-
-Endpoints
-~~~~~~~~~
-
-Endpoints are the core of the USB data transfer process. They come in a few forms such as control, isochronous, bulk, and interrupt. We won't cover the details here except with some caveats in open below. In general, data is transferred by setting up a buffer of a given length to be transferred on a given endpoint address and then waiting for an interrupt to signal that the transfer is finished. Further details below.
-
-Endpoints within USB have an address which encodes both the number and direction of an endpoint. TinyUSB provides ``tu_edpt_number`` and ``tu_edpt_dir`` to unpack this data from the address. Here is a snippet that does it.
-
-.. code-block::
-
- uint8_t epnum = tu_edpt_number(ep_addr);
- uint8_t dir = tu_edpt_dir(ep_addr);
-
-
-dcd_edpt_open
-"""""""""""""
-
-Opening an endpoint is done for all non-control endpoints once the host picks a configuration that the device should use. At this point, the endpoint should be enabled in the peripheral and configured to match the endpoint descriptor. Pay special attention to the direction of the endpoint you can get from the helper methods above. It will likely change what registers you are setting.
-
-Also make sure to enable endpoint specific interrupts.
-
-dcd_edpt_close
-""""""""""""""
-
-Close an endpoint. his function is used for implementing alternate settings.
-
-After calling this, the device should not respond to any packets directed towards this endpoint. When called, this function must abort any transfers in progress through this endpoint, before returning.
-
-Implementation is optional. Must be called from the USB task. Interrupts could be disabled or enabled during the call.
-
-dcd_edpt_xfer
-"""""""""""""
-
-``dcd_edpt_xfer`` is responsible for configuring the peripheral to send or receive data from the host. "xfer" is short for "transfer". **This is one of the core methods you must implement for TinyUSB to work (one other is the interrupt handler).** Data from the host is the OUT direction and data to the host is IN. It is used for all endpoints including the control endpoint 0. Make sure to handle the zero-length packet STATUS packet on endpoint 0 correctly. It may be a special transaction to the peripheral.
-
-Besides that, all other transactions are relatively straight-forward. The endpoint address provides the endpoint
-number and direction which usually determines where to write the buffer info. The buffer and its length are usually
-written to a specific location in memory and the peripheral is told the data is valid. (Maybe by writing a 1 to a
-register or setting a counter register to 0 for OUT or length for IN.)
-
-The transmit buffer alignment is determined by ``CFG_TUSB_MEM_ALIGN``.
-
-One potential pitfall is that the buffer may be longer than the maximum endpoint size of one USB
-packet. Some peripherals can handle transmitting multiple USB packets for a provided buffer (like the SAMD21).
-Others (like the nRF52) may need each USB packet queued individually. To make this work you'll need to track
-some state for yourself and queue up an intermediate USB packet from the interrupt handler.
-
-Once the transaction is going, the interrupt handler will notify TinyUSB of transfer completion.
-During transmission, the IN data buffer is guarenteed to remain unchanged in memory until the ``dcd_xfer_complete`` function is called.
-
-The dcd_edpt_xfer function must never add zero-length-packets (ZLP) on its own to a transfer. If a ZLP is required,
-then it must be explicitly sent by the stack calling dcd_edpt_xfer(), by calling dcd_edpt_xfer() a second time with len=0.
-For control transfers, this is automatically done in ``usbd_control.c``.
-
-At the moment, only a single buffer can be transmitted at once. There is no provision for double-buffering. new dcd_edpt_xfer() will not
-be called again on the same endpoint address until the driver calls dcd_xfer_complete() (except in cases of USB resets).
-
-dcd_xfer_complete
-"""""""""""""""""
-
-Once a transfer completes you must call dcd_xfer_complete from the USB interrupt handler to let TinyUSB know that a transaction has completed. Here is a sample call:
-
-.. code-block::
-
- dcd_event_xfer_complete(0, ep_addr, xfer->actual_len, XFER_RESULT_SUCCESS, true);
-
-
-The arguments are:
-
-
-* the USB peripheral number
-* the endpoint address
-* the actual length of the transfer. (OUT transfers may be smaller than the buffer given in ``dcd_edpt_xfer``\ )
-* the result of the transfer. Failure isn't handled yet.
-* ``true`` to note the call is from an interrupt handler.
-
-dcd_edpt_stall / dcd_edpt_clear_stall
-"""""""""""""""""""""""""""""""""""""
-
-Stalling is one way an endpoint can indicate failure such as when an unsupported command is transmitted. The pair of ``dcd_edpt_stall``\ , ``dcd_edpt_clear_stall`` help manage the stall state of all endpoints.
-
-Woohoo!
--------
-
-At this point you should have everything working! ;-) Of course, you may not write perfect code. Here are some tips and tricks for debugging.
-
-Use `WireShark <https://www.wireshark.org/>`_ or `a Beagle <https://www.totalphase.com/protocols/usb/>`_ to sniff the USB traffic. When things aren't working its likely very early in the USB enumeration process. Figuring out where can help clue in where the issue is. For example:
-
-
-* If the host sends a SETUP packet and its not ACKed then your USB peripheral probably isn't started correctly.
-* If the peripheral is started correctly but it still didn't work, then verify your usb clock is correct. (You did output a PWM based on it right? ;-) )
-* If the SETUP packet is ACKed but nothing is sent back then you interrupt handler isn't queueing the setup packet correctly. (Also, if you are using your own code instead of an example ``tud_task`` may not be called.) If thats OK, the ``dcd_xfer_complete`` may not be setting up the next transaction correctly.
diff --git a/tinyusb/docs/contributing/structure.rst b/tinyusb/docs/contributing/structure.rst
deleted file mode 100755
index e8c65885..00000000
--- a/tinyusb/docs/contributing/structure.rst
+++ /dev/null
@@ -1,59 +0,0 @@
-*********
-Structure
-*********
-
-Tree
-====
-
-::
-
- .
- ├── docs
- ├── examples
- ├── hw
- │   ├── bsp
- │   └── mcu
- ├── lib
- ├── src
- ├── test
- └── tools
-
-docs
-----
-
-Documentation
-
-examples
---------
-
-Sample with Makefile build support
-
-hw/bsp
-------
-
-Supported boards source files
-
-hw/mcu
-------
-
-Low level mcu core & peripheral drivers
-
-lib
----
-
-Sources from 3rd party such as freeRTOS, fatfs ...
-
-src
----
-
-All sources files for TinyUSB stack itself.
-
-test
-----
-
-Unit tests for the stack
-
-tools
------
-
-Files used internally
diff --git a/tinyusb/docs/index.rst b/tinyusb/docs/index.rst
deleted file mode 100755
index 2a032c51..00000000
--- a/tinyusb/docs/index.rst
+++ /dev/null
@@ -1,25 +0,0 @@
-:hide-toc:
-
-*********
-TinyUSB
-*********
-
-TinyUSB is an open-source cross-platform USB Host/Device stack for embedded systems,
-designed to be memory-safe with no dynamic allocation and thread-safe with all interrupt events being deferred and then handled in the non-ISR task function.
-
-
-.. toctree::
- :caption: Index
- :hidden:
-
- Info <info/index>
- Reference <reference/index>
- Contributing <contributing/index>
-
-.. toctree::
- :caption: External Links
- :hidden:
-
- Source Code <https://github.com/hathach/tinyusb>
- Issue Tracker <https://github.com/hathach/tinyusb/issues>
- Discussions <https://github.com/hathach/tinyusb/discussions>
diff --git a/tinyusb/docs/info/changelog.rst b/tinyusb/docs/info/changelog.rst
deleted file mode 100755
index 80205a72..00000000
--- a/tinyusb/docs/info/changelog.rst
+++ /dev/null
@@ -1,513 +0,0 @@
-*********
-Changelog
-*********
-
-0.10.1 (03-06-221)
-===================
-
-- rework rp2040 examples and CMake build, allow better integration with pico-sdk
-
-Host Controller Driver (HCD)
-----------------------------
-
-- Fix rp2040 host driver: incorrect PID with low speed device with max packet size of 8 bytes
-- Improve hub driver
-- Remove obsolete hcd_pipe_queue_xfer()/hcd_pipe_xfer()
-- Use hcd_frame_number() instead of micro frame
-- Fix OHCI endpoint address and xferred_bytes in xfer complete event
-
-
-0.10.0 (28-05-2021)
-===================
-
-- Rework tu_fifo_t with separated mutex for read and write, better support DMA with read/write buffer info. And constant address mode
-- Improve audio_test example and add audio_4_channel_mic example
-- Add new dfu example
-- Remove pico-sdk from submodule
-
-Device Controller Driver (DCD)
-------------------------------
-
-- Add new DCD port for Silabs EFM32GG12 with board Thunderboard Kit (SLTB009A)
-- Add new DCD port Renesas RX63N, board GR-CITRUS
-- Add new (optional) endpoint API dcd_edpt_xfer_fifo
-- Fix build with nRF5340
-- Fix build with lpc15 and lpc54
-- Fix build with lpc177x_8x
-- STM32 Synopsys: greatly improve Isochronous transfer with edpt_xfer_fifo API
-- Support LPC55 port1 highspeed
-- Add support for Espressif esp32s3
-- nRF: fix race condition that could cause drop packet of Bulk OUT transfer
-
-USB Device Driver (USBD)
-------------------------
-
-- Add new (optional) endpoint ADPI usbd_edpt_xfer_fifo
-
-Device Class Driver
--------------------
-
-CDC
-
-- [Breaking] tud_cdc_peek(), tud_vendor_peek() no longer support random offset and dropped position parameter.
-
-DFU
-
-- Add new DFU 1.1 class driver (WIP)
-
-HID
-
-- Fix keyboard report descriptor template
-- Add more hid keys constant from 0x6B to 0xA4
-- [Breaking] rename API
- - HID_PROTOCOL_NONE/KEYBOARD/MOUST to HID_ITF_PROTOCOL_NONE/KEYBOARD/MOUSE
- - tud_hid_boot_mode() to tud_hid_get_protocol()
- - tud_hid_boot_mode_cb() to tud_hid_set_protocol_cb()
-
-MIDI
-
-- Fix MIDI buffer overflow issue
-- [Breaking] rename API
- - Rename tud_midi_read() to tud_midi_stream_read()
- - Rename tud_midi_write() to tud_midi_stream_write()
- - Rename tud_midi_receive() to tud_midi_packet_read()
- - Rename tud_midi_send() to tud_midi_packet_write()
-
-Host Controller Driver (HCD)
-----------------------------
-
-- No noticable changes
-
-USB Host Driver (USBH)
-----------------------
-
-- No noticable changes
-
-Host Class Driver
------------------
-
-- HID: Rework host hid driver, basically everything changes
-
-
-0.9.0 (12-03-2021)
-==================
-
-Device Stack
-------------
-
-Device Controller Driver (DCD)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-RP2040
-
-- Fix endpoint buffer reallocation overrun problem
-- Fix osal_pico queue overflow in initialization
-- Fix Isochronous endpoint buffer size in transfer
-- Optimize hardware endpoint struct to reduce RAM usage
-- Fix enum walkaround forever check for SE0 when pull up is disabled
-
-Sony CXD56
-
-- Pass the correct speed on Spresense
-- Fix setup processed flag
-
-NXP Transdimention
-
-- Update dcd_init() to reset controller to device mode
-
-USB Device Driver (USBD)
-^^^^^^^^^^^^^^^^^^^^^^^^
-
-- Fix issue with status zlp (tud_control_status) is returned by class driver with SET/CLEAR_FEATURE for endpoint.
-- Correct endpoint size check for fullspeed bulk, can be 8, 16, 32, 64
-- Ack SET_INTERFACE even if it is not implemented by class driver.
-
-Device Class Driver
-^^^^^^^^^^^^^^^^^^^
-
-DFU Runtime
-
-- rename dfu_rt to dfu_runtime for easy reading
-
-CDC
-
-- Add tud_cdc_send_break_cb() to support break request
-- Improve CDC receive, minor behavior changes: when tud_cdc_rx_wanted_cb() is invoked wanted_char may not be the last byte in the fifo
-
-HID
-
-- [Breaking] Add itf argument to hid API to support multiple instances, follow API has signature changes
- - tud_hid_descriptor_report_cb()
- - tud_hid_get_report_cb()
- - tud_hid_set_report_cb()
- - tud_hid_boot_mode_cb()
- - tud_hid_set_idle_cb()
-- Add report complete callback tud_hid_report_complete_cb() API
-- Add DPad/Hat support for HID Gamepad
- - `TUD_HID_REPORT_DESC_GAMEPAD()` now support 16 buttons, 2 joysticks, 1 hat/dpad
- - Add hid_gamepad_report_t along with `GAMEPAD_BUTTON_` and `GAMEPAD_HAT_` enum
- - Add Gamepad to hid_composite / hid_composite_freertos example
-
-MIDI
-
-- Fix dropping MIDI sysex message when fifo is full
-- Fix typo in tud_midi_write24(), make example less ambigous for cable and channel
-- Fix incorrect endpoint descriptor length, MIDI v1 use Audio v1 which has 9-byte endpoint descriptor (instead of 7)
-
-Host Stack
-----------
-
-Host Controller Driver (HCD)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-- Add rhport to hcd_init()
-- Improve EHCI/OHCI driver abstraction
- - Move echi/ohci files to portable/
- - Rename hcd_lpc18_43 to hcd_transdimension
- - Sub hcd API with hcd_ehci_init(), hcd_ehci_register_addr()
-- Update NXP transdimention hcd_init() to reset controller to host mode
- - Ported hcd to rt10xx
-
-USB Host Driver (USBH)
-^^^^^^^^^^^^^^^^^^^^^^
-
-- No noticeable changes to usbh
-
-Host Class Driver
-^^^^^^^^^^^^^^^^^
-
-MSC
-
-- Rename tuh_msc_scsi_inquiry() to tuh_msc_inquiry()
-- Rename tuh_msc_mounted_cb/tuh_msc_unmounted_cb to tuh_msc_mount_cb/tuh_msc_unmount_cb to match device stack naming
-- Change tuh_msc_is_busy() to tuh_msc_ready()
-- Add read10 and write10 function: tuh_msc_read10(), tuh_msc_write10()
-- Read_Capacity is invoked as part of enumeration process
-- Add tuh_msc_get_block_count(), tuh_msc_get_block_size()
-- Add CFG_TUH_MSC_MAXLUN (default to 4) to hold lun capacities
-
-Others
-------
-
-- Add basic support for rt-thread OS
-- Change zero bitfield length to more explicit padding
-- Build example now fetch required submodules on the fly while running `make` without prio submodule init for mcu drivers
-- Update pico-sdk to v1.1.0
-
-**New Boards**
-
-- Microchip SAM E54 Xplained Pro
-- LPCXpresso 55s28
-- LPCXpresso 18s37
-
-
-0.8.0 (05-02-2021)
-==================
-
-Device Controller Driver
-------------------------
-
-- Added new device support for Raspberry Pi RP2040
-- Added new device support for NXP Kinetis KL25ZXX
-- Use dcd_event_bus_reset() with link speed to replace bus_signal
-- ESP32-S2:
- - Add bus suspend and wakeup support
-- SAMD21:
- - Fix (walkaround) samd21 setup_packet overflow by USB DMA
-- STM32 Synopsys:
- - Rework USB FIFO allocation scheme and allow RX FIFO size reduction
-- Sony CXD56
- - Update Update Spresense SDK to 2.0.2
- - Fix dcd issues with setup packets
- - Correct EP number for cdc_msc example
-
-USB Device
-----------
-
-**USBD**
-
-- Rework usbd control transfer to have additional stage parameter for setup, data, status
-- Fix tusb_init() return true instead of TUSB_ERROR_NONE
-- Added new API tud_connected() that return true after device got out of bus reset and received the very first setup packet
-
-**Class Driver**
-
-- CDC
- - Allow to transmit data, even if the host does not support control line states i.e set DTR
-- HID
- - change default CFG_TUD_HID_EP_BUFSIZE from 16 to 64
-- MIDI
- - Fix midi sysex sending bug
-- MSC
- - Invoke only scsi complete callback after status transaction is complete.
- - Fix scsi_mode_sense6_t padding, which cause IAR compiler internal error.
-- USBTMC
- - Change interrupt endpoint example size to 8 instead of 2 for better compatibility with mcu
-
-**Example**
-
-- Support make from windows cmd.exe
-- Add HID Consumer Control (media keys) to hid_composite & hid_composite_freertos examples
-
-
-USB Host
---------
-
-No noticeable changes to host stack
-
-New Boards
-----------
-
-- NXP/Freescale Freedom FRDM-KL25Z
-- Feather Double M33 express
-- Raspberry Pi Pico
-- Adafruit Feather RP2040
-- Adafruit Itsy Bitsy RP2040
-- Adafruit QT RP2040
-- Adfruit Feather ESP32-S2
-- Adafruit Magtag 29" Eink
-- Adafruit Metro ESP32-S2
-- Adafruit PyBadge
-- Adafruit PyPortal
-- Great Scott Gadgets' LUNA D11 & D21
-
-
-0.7.0 (08-11-2020)
-==================
-
-Device Controller Driver
-------------------------
-
-- Added new support for Espressif ESP32-S2
-- Added new support for Dialog DA1469x
-- Enhance STM32 Synopsys
-- Support bus events disconnection/suspend/resume/wakeup
- - Improve transfer performance with optimizing xfer and fifo size
- - Support Highspeed port (OTG_HS) with both internal and external PHY
- - Support multiple usb ports with rhport=1 is highspeed on selected MCUs e.g H743, F23. It is possible to have OTG_HS to run on Fullspeed PHY (e.g lacking external PHY)
- - Add ISO transfer, fix odd/even frame
- - Fix FIFO flush during stall
- - Implement dcd_edpt_close() API
- - Support F105, F107
-- Enhance STM32 fsdev
- - Improve dcd fifo allocation
- - Fix ISTR race condition
- - Support remap USB IRQ on supported MCUs
- - Implement dcd_edpt_close() API
-- Enhance NUC 505: enhance set configure behavior
-- Enhance SAMD
- - Fix race condition with setup packet
- - Add SAMD11 option `OPT_MCU_SAMD11`
- - Add SAME5x option `OPT_MCU_SAME5X`
-- Fix SAMG control data toggle and stall race condition
-- Enhance nRF
- - Fix hanged when tud_task() is called within critical section (disabled interrupt)
- - Fix disconnect bus event not submitted
- - Implement ISO transfer and dcd_edpt_close()
-
-
-USB Device
-----------
-
-**USBD**
-
-- Add new class driver for **Bluetooth HCI** class driver with example can be found in [mynewt-tinyusb-example](https://github.com/hathach/mynewt-tinyusb-example) since it needs mynewt OS to run with.
-- Fix USBD endpoint usage racing condition with `usbd_edpt_claim()/usbd_edpt_release()`
-- Added `tud_task_event_ready()` and `osal_queue_empty()`. This API is needed to check before enter low power mode with WFI/WFE
-- Rename USB IRQ Handler to `dcd_int_handler()`. Application must define IRQ handler in which it calls this API.
-- Add `dcd_connect()` and `dcd_disconnect()` to enable/disable internal pullup on D+/D- on supported MCUs.
-- Add `usbd_edpt_open()`
-- Remove `dcd_set_config()`
-- Add *OPT_OS_CUMSTOM* as hook for application to overwrite and/or add their own OS implementation
-- Support SET_INTERFACE, GET_INTERFACE request
-- Add Logging for debug with optional uart/rtt/swo printf retarget or `CFG_TUSB_DEBUG_PRINTF` hook
-- Add IAR compiler support
-- Support multiple configuration descriptors. `TUD_CONFIG_DESCRIPTOR()` template has extra config_num as 1st argument
-- Improve USB Highspeed support with actual link speed detection with `dcd_event_bus_reset()`
-- Enhance class driver management
- - `usbd_driver_open()` add max length argument, and return length of interface (0 for not supported). Return value is used for finding appropriate driver
- - Add application implemented class driver via `usbd_app_driver_get_cb()`
- - IAD is handled to assign driver id
-- Added `tud_descriptor_device_qualifier_cb()` callback
-- Optimize `tu_fifo` bulk write/read transfer
-- Forward non-std control request to class driver
-- Let application handle Microsoft OS 1.0 Descriptors (the 0xEE index string)
-- Fix OSAL FreeRTOS yield from ISR
-
-**Class Drivers**
-
-- USBNET: remove ACM-EEM due to lack of support from host
-- USBTMC: fix descriptors when INT EP is disabled
-- CDC:
- - Send zero length packet for end of data when needed
- - Add `tud_cdc_tx_complete_cb()` callback
- - Change tud_cdc_n_write_flush() return number of bytes forced to transfer, and flush when writing enough data to fifo
-- MIDI:
- - Add packet interface
- - Add multiple jack descriptors
- - Fix MIDI driver for sysex
-- DFU Runtime: fix response to SET_INTERFACE and DFU_GETSTATUS request
-- Rename some configure macro to make it clear that those are used directly for endpoint transfer
- - CFG_TUD_HID_BUFSIZE to CFG_TUD_HID_EP_BUFSIZE
- - CFG_TUD_CDC_EPSIZE to CFG_TUD_CDC_EP_BUFSIZE
- - CFG_TUD_MSC_BUFSIZE to CFG_TUD_MSC_EP_BUFSIZE
- - CFG_TUD_MIDI_EPSIZE to CFG_TUD_MIDI_EP_BUFSIZE
-- HID:
- - Fix gamepad template descriptor
- - Add multiple HID interface API
- - Add extra comma to HID_REPORT_ID
-
-USB Host
---------
-
-- Rework USB host stack (still work in progress)
- - Fix compile error with pipehandle
- - Rework usbh control and enumeration as non-blocking
-- Improve Hub, MSC, HID host driver
-
-Examples
---------
-
-- Add new hid_composite_freertos
-- Add new dynamic_configuration to demonstrate how to switch configuration descriptors
-- Add new hid_multiple_interface
-- Enhance `net_lwip_webserver` example
- - Add multiple configuration: RNDIS for Windows, CDC-ECM for macOS (Linux will work with both)
- - Update lwip to STABLE-2_1_2_RELEASE for net_lwip_webserver
-- Added new Audio example: audio_test uac2_headsest
-
-New Boards
-----------
-
-- Espressif ESP32-S2: saola_1, kaluga_1
-- STM32: F746 Nucleo, H743 Eval, H743 Nucleo, F723 discovery, stlink v3 mini, STM32L4r5 Nucleo
-- Dialog DA1469x dk pro and dk usb
-- Microchip: Great Scoot Gadgets' LUNA, samd11_xplained, D5035-01, atsamd21 xplained pro
-- nRF: ItsyBitsy nRF52840
-
-
-0.6.0 (30-03-2020)
-==================
-
-Added **CONTRIBUTORS.md** to give proper credit for contributors to the stack. Special thanks to `Nathan Conrad <https://github.com/pigrew>`__ , `Peter Lawrence <https://github.com/majbthrd>`__ , `William D. Jones <https://github.com/cr1901>`__ and `Sean Cross <https://github.com/xobs>`__ and others for spending their precious time to add lots of features and ports for this release.
-
-Added
------
-
-**MCU**
-
-- Added support for Microchip SAMG55
-- Added support for Nordic nRF52833
-- Added support for Nuvoton: NUC120, NUC121/NUC125, NUC126, NUC505
-- Added support for NXP LPC: 51Uxx, 54xxx, 55xx
-- Added support for NXP iMXRT: RT1011, RT1015, RT1021, RT1052, RT1062, RT1064
-- Added support for Sony CXD56 (Spresense)
-- Added support for STM32: L0, F0, F1, F2, F3, F4, F7, H7
-- Added support for TI MSP430
-- Added support for ValentyUSB's eptri
-
-**Class Driver**
-
-- Added DFU Runtime class driver
-- Added Network class driver with RNDIS, CDC-ECM, CDC-EEM (work in progress)
-- Added USBTMC class driver
-- Added WebUSB class driver using vendor-specific class
-- Added multiple instances support for CDC and MIDI
-- Added a handful of unit test with Ceedling.
-- Added LOG support for debugging with CFG_TUSB_DEBUG
-- Added `tud_descriptor_bos_cb()` for BOS descriptor (required for USB 2.1)
-- Added `dcd_edpt0_status_complete()` as optional API for DCD
-
-**Examples**
-
-Following examples are added:
-
-- board_test
-- cdc_dual_ports
-- dfu_rt
-- hid_composite
-- net_lwip_webserver
-- usbtmc
-- webusb_serial
-
-**Boards**
-
-Following boards are added:
-
-- adafruit_clue
-- arduino_nano33_ble
-- circuitplayground_bluefruit
-- circuitplayground_express
-- feather_m0_express
-- feather_nrf52840_sense
-- feather_stm32f405
-- fomu
-- itsybitsy_m0
-- itsybitsy_m4
-- lpcxpresso11u37
-- lpcxpresso1549
-- lpcxpresso51u68
-- lpcxpresso54114
-- lpcxpresso55s69
-- mbed1768
-- mimxrt1010_evk
-- mimxrt1015_evk
-- mimxrt1020_evk
-- mimxrt1050_evkb
-- mimxrt1060_evk
-- mimxrt1064_evk
-- msp_exp430f5529lp
-- ngx4330
-- nrf52840_mdk_dongle
-- nutiny_nuc121s
-- nutiny_nuc125s
-- nutiny_nuc126v
-- nutiny_sdk_nuc120
-- nutiny_sdk_nuc505
-- pca10059
-- pca10100
-- pyboardv11
-- raytac_mdbt50q_rx
-- samg55xplained
-- seeeduino_xiao
-- spresense
-- stm32f070rbnucleo
-- stm32f072disco
-- stm32f103bluepill
-- stm32f207nucleo
-- stm32f401blackpill
-- stm32f411blackpill
-- stm32f411disco
-- stm32f412disco
-- stm32f767nucleo
-- stm32h743nucleo
-- stm32l0538disco
-- stm32l476disco
-- teensy_40
-
-Changed
--------
-
-- Changed `tud_descriptor_string_cb()` to have additional Language ID argument
-- Merged hal_nrf5x.c into dcd_nrf5x.c
-- Merged dcd_samd21.c and dcd_samd51.c into dcd_samd.c
-- Generalized dcd_stm32f4.c to dcd_synopsys.c
-- Changed cdc_msc_hid to cdc_msc (drop hid) due to limited endpoints number of some MCUs
-- Improved DCD SAMD stability, fix missing setup packet occasionally
-- Improved usbd/usbd_control with proper hanlding of zero-length packet (ZLP)
-- Improved STM32 DCD FSDev
-- Improved STM32 DCD Synopsys
-- Migrated CI from Travis to Github Action
-- Updated nrfx submodule to 2.1.0
-- Fixed mynewt osal queue definition
-- Fixed cdc_msc_freertos example build for all MCUs
-
-
-0.5.0 (06-2019)
-===============
-
-First release, device stack works great, host stack works but still need improvement.
-
-- Special thanks to @adafruit team, especially @tannewt to help out immensely to rework device stack: simplify osal & control transfer, adding SAMD21/SAMD51 ports, writing porting docs, adding MIDI class support etc...
-- Thanks to @cr1901 for adding STM32F4 port.
-- Thanks to @PTS93 and @todbot for HID raw API
diff --git a/tinyusb/docs/info/contributors.rst b/tinyusb/docs/info/contributors.rst
deleted file mode 120000
index b3748ccb..00000000
--- a/tinyusb/docs/info/contributors.rst
+++ /dev/null
@@ -1 +0,0 @@
-../../CONTRIBUTORS.rst \ No newline at end of file
diff --git a/tinyusb/docs/info/index.rst b/tinyusb/docs/info/index.rst
deleted file mode 100755
index fa56512b..00000000
--- a/tinyusb/docs/info/index.rst
+++ /dev/null
@@ -1,13 +0,0 @@
-****
-Info
-****
-
-Index
-=====
-
-.. toctree::
- :maxdepth: 2
-
- uses
- changelog
- contributors
diff --git a/tinyusb/docs/info/uses.rst b/tinyusb/docs/info/uses.rst
deleted file mode 100755
index f67df49f..00000000
--- a/tinyusb/docs/info/uses.rst
+++ /dev/null
@@ -1,17 +0,0 @@
-****
-Uses
-****
-
-TinyUSB is currently used by these other projects:
-
-- `Adafruit nRF52 Arduino <https://github.com/adafruit/Adafruit_nRF52_Arduino>`__
-- `Adafruit nRF52 Bootloader <https://github.com/adafruit/Adafruit_nRF52_Bootloader>`__
-- `Adafruit SAMD Arduino <https://github.com/adafruit/ArduinoCore-samd>`__
-- `CircuitPython <https://github.com/adafruit/circuitpython>`__
-- `Espressif IDF <https://github.com/espressif/esp-idf>`__
-- `MicroPython <https://github.com/micropython/micropython>`__
-- `mynewt <https://mynewt.apache.org>`__
-- `openinput <https://github.com/openinput-fw/openinput>`__
-- `Raspberry Pi Pico SDK <https://github.com/raspberrypi/pico-sdk>`__
-- `TinyUF2 Bootloader <https://github.com/adafruit/tinyuf2>`__
-- `TinyUSB Arduino Library <https://github.com/adafruit/Adafruit_TinyUSB_Arduino>`__
diff --git a/tinyusb/docs/reference/concurrency.rst b/tinyusb/docs/reference/concurrency.rst
deleted file mode 100755
index 776fa4b6..00000000
--- a/tinyusb/docs/reference/concurrency.rst
+++ /dev/null
@@ -1,42 +0,0 @@
-***********
-Concurrency
-***********
-
-The TinyUSB library is designed to operate on single-core MCUs with multi-threaded applications in mind. Interaction with interrupts is especially important to pay attention to.
-It is compatible with optionally using a RTOS.
-
-General
--------
-
-When writing code, keep in mind that the OS (if using a RTOS) may swap out your code at any time. Also, your code can be preempted by an interrupt at any time.
-
-Application Code
-----------------
-
-The USB core does not execute application callbacks while in an interrupt context. Calls to application code are from within the USB core task context. Note that the application core will call class drivers from within their own task.
-
-Class Drivers
--------------
-
-Class driver code should never be called from an interrupt context by the USB core, though the application is allowed to call class driver functions from interrupts. USB core functions may be called simultaneously by multiple tasks. Use care that proper locking is used to guard the USBD core functions from this case.
-
-Class drivers are allowed to call ``usbd_*`` functions, but not ``dcd_*`` functions.
-
-USB Core
---------
-
-All functions that may be called from an (USB core) interrupt context have a ``bool in_isr`` parameter to remind the implementer that special care must be taken.
-
-Interrupt handlers must not directly call class driver code, they must pass a message to the USB core's task.
-
- ``usbd_*`` functions may be called from interrupts without any notice. They may also be called simultaneously by multiple tasks.
-
-Device Drivers
---------------
-
-Much of the processing of the USB stack is done in an interrupt context, and care must be taken in order to ensure variables are handled in the appropriate ways by the compiler and optimizer.
-
-In particular:
-
-* Ensure that all memory-mapped registers (including packet memory) are marked as volatile. GCC's optimizer will even combine memory access (like two 16-bit to be a 32-bit) if you don't mark the pointers as volatile. On some architectures, this can use macros like _I , _O , or _IO.
-* All defined global variables are marked as ``static``.
diff --git a/tinyusb/docs/reference/getting_started.rst b/tinyusb/docs/reference/getting_started.rst
deleted file mode 100755
index 5f322792..00000000
--- a/tinyusb/docs/reference/getting_started.rst
+++ /dev/null
@@ -1,153 +0,0 @@
-***************
-Getting Started
-***************
-
-Add TinyUSB to your project
----------------------------
-
-It is relatively simple to incorporate tinyusb to your (existing) project
-
-
-* Copy or ``git submodule`` this repo into your project in a subfolder. Let's say it is *your_project/tinyusb*
-* Add all the .c in the ``tinyusb/src`` folder to your project
-* Add *your_project/tinyusb/src* to your include path. Also make sure your current include path also contains the configuration file tusb_config.h.
-* Make sure all required macros are all defined properly in tusb_config.h (configure file in demo application is sufficient, but you need to add a few more such as CFG_TUSB_MCU, CFG_TUSB_OS since they are passed by IDE/compiler to maintain a unique configure for all boards).
-* If you use the device stack, make sure you have created/modified usb descriptors for your own need. Ultimately you need to implement all **tud descriptor** callbacks for the stack to work.
-* Add tusb_init() call to your reset initialization code.
-* Call ``tud_int_handler()`` (device) and/or ``tuh_int_handler()`` (host) in your USB IRQ Handler
-* Implement all enabled classes's callbacks.
-* If you don't use any RTOSes at all, you need to continuously and/or periodically call tud_task()/tuh_task() function. All of the callbacks and functionality are handled and invoked within the call of that task runner.
-
-.. code-block::
-
- int main(void)
- {
- your_init_code();
- tusb_init(); // initialize tinyusb stack
-
- while(1) // the mainloop
- {
- your_application_code();
-
- tud_task(); // device task
- tuh_task(); // host task
- }
- }
-
-Examples
---------
-
-For your convenience, TinyUSB contains a handful of examples for both host and device with/without RTOS to quickly test the functionality as well as demonstrate how API() should be used. Most examples will work on most of `the supported Boards <boards.md>`_. Firstly we need to ``git clone`` if not already
-
-.. code-block::
-
- $ git clone https://github.com/hathach/tinyusb tinyusb
- $ cd tinyusb
-
-Some TinyUSB examples also requires external submodule libraries in ``/lib`` such as FreeRTOS, Lightweight IP to build. Run following command to fetch them
-
-.. code-block::
-
- $ git submodule update --init lib
-
-In addition, MCU driver submodule is also needed to provide low-level MCU peripheral's driver. Luckily, it will be fetched if needed when you run the ``make`` to build your board.
-
-Note: some examples especially those that uses Vendor class (e.g webUSB) may requires udev permission on Linux (and/or macOS) to access usb device. It depends on your OS distro, typically copy ``/examples/device/99-tinyusb.rules`` file to /etc/udev/rules.d/ then run ``sudo udevadm control --reload-rules && sudo udevadm trigger`` is good enough.
-
-Build
-^^^^^
-
-To build example, first change directory to an example folder.
-
-.. code-block::
-
- $ cd examples/device/cdc_msc
-
-Then compile with ``make BOARD=[board_name] all``\ , for example
-
-.. code-block::
-
- $ make BOARD=feather_nrf52840_express all
-
-Note: ``BOARD`` can be found as directory name in ``hw/bsp``\ , either in its family/boards or directly under bsp (no family).
-
-Port Selection
-~~~~~~~~~~~~~~
-
-If a board has several ports, one port is chosen by default in the individual board.mk file. Use option ``PORT=x`` To choose another port. For example to select the HS port of a STM32F746Disco board, use:
-
-.. code-block::
-
- $ make BOARD=stm32f746disco PORT=1 all
-
-Port Speed
-~~~~~~~~~~
-
-A MCU can support multiple operational speed. By default, the example build system will use the fastest supported on the board. Use option ``SPEED=full/high`` e.g To force F723 operate at full instead of default high speed
-
-.. code-block::
-
- $ make BOARD=stm32f746disco SPEED=full all
-
-Debug
-^^^^^
-
-To compile for debugging add ``DEBUG=1``\ , for example
-
-.. code-block::
-
- $ make BOARD=feather_nrf52840_express DEBUG=1 all
-
-Log
-~~~
-
-Should you have an issue running example and/or submitting an bug report. You could enable TinyUSB built-in debug logging with optional ``LOG=``. LOG=1 will only print out error message, LOG=2 print more information with on-going events. LOG=3 or higher is not used yet.
-
-.. code-block::
-
- $ make BOARD=feather_nrf52840_express LOG=2 all
-
-Logger
-~~~~~~
-
-By default log message is printed via on-board UART which is slow and take lots of CPU time comparing to USB speed. If your board support on-board/external debugger, it would be more efficient to use it for logging. There are 2 protocols:
-
-
-* `LOGGER=rtt`: use [Segger RTT protocol](https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/)
-
- * Cons: requires jlink as the debugger.
- * Pros: work with most if not all MCUs
- * Software viewer is JLink RTT Viewer/Client/Logger which is bundled with JLink driver package.
-
-* ``LOGGER=swo``\ : Use dedicated SWO pin of ARM Cortex SWD debug header.
-
- * Cons: only work with ARM Cortex MCUs minus M0
- * Pros: should be compatible with more debugger that support SWO.
- * Software viewer should be provided along with your debugger driver.
-
-.. code-block::
-
- $ make BOARD=feather_nrf52840_express LOG=2 LOGGER=rtt all
- $ make BOARD=feather_nrf52840_express LOG=2 LOGGER=swo all
-
-Flash
-^^^^^
-
-``flash`` target will use the default on-board debugger (jlink/cmsisdap/stlink/dfu) to flash the binary, please install those support software in advance. Some board use bootloader/DFU via serial which is required to pass to make command
-
-.. code-block::
-
- $ make BOARD=feather_nrf52840_express flash
- $ make SERIAL=/dev/ttyACM0 BOARD=feather_nrf52840_express flash
-
-Since jlink can be used with most of the boards, there is also ``flash-jlink`` target for your convenience.
-
-.. code-block::
-
- $ make BOARD=feather_nrf52840_express flash-jlink
-
-Some board use uf2 bootloader for drag & drop in to mass storage device, uf2 can be generated with ``uf2`` target
-
-.. code-block::
-
- $ make BOARD=feather_nrf52840_express all uf2
diff --git a/tinyusb/docs/reference/index.rst b/tinyusb/docs/reference/index.rst
deleted file mode 100755
index fcff0359..00000000
--- a/tinyusb/docs/reference/index.rst
+++ /dev/null
@@ -1,59 +0,0 @@
-*********
-Reference
-*********
-
-.. figure:: ../assets/stack.svg
- :width: 1600px
- :alt: stackup
-
- representation of the TinyUSB stack.
-
-Device Stack
-============
-
-Supports multiple device configurations by dynamically changing usb descriptors. Low power functions such like suspend, resume, and remote wakeup. Following device classes are supported:
-
-- Audio Class 2.0 (UAC2)
-- Bluetooth Host Controller Interface (BTH HCI)
-- Communication Class (CDC)
-- Device Firmware Update (DFU): DFU mode (WIP) and Runtinme
-- Human Interface Device (HID): Generic (In & Out), Keyboard, Mouse, Gamepad etc ...
-- Mass Storage Class (MSC): with multiple LUNs
-- Musical Instrument Digital Interface (MIDI)
-- Network with RNDIS, CDC-ECM (work in progress)
-- USB Test and Measurement Class (USBTMC)
-- Vendor-specific class support with generic In & Out endpoints. Can be used with MS OS 2.0 compatible descriptor to load winUSB driver without INF file.
-- `WebUSB <https://github.com/WICG/webusb>`__ with vendor-specific class
-
-If you have special need, `usbd_app_driver_get_cb()` can be used to write your own class driver without modifying the stack. Here is how RPi team add their reset interface [raspberrypi/pico-sdk#197](https://github.com/raspberrypi/pico-sdk/pull/197)
-
-Host Stack
-==========
-
-- Human Interface Device (HID): Keyboard, Mouse, Generic
-- Mass Storage Class (MSC)
-- Hub currently only supports 1 level of hub (due to my laziness)
-
-OS Abstraction layer
-====================
-
-TinyUSB is completely thread-safe by pushing all ISR events into a central queue, then process it later in the non-ISR context task function. It also uses semaphore/mutex to access shared resources such as CDC FIFO. Therefore the stack needs to use some of OS's basic APIs. Following OSes are already supported out of the box.
-
-- **No OS**
-- **FreeRTOS**
-- **Mynewt** Due to the newt package build system, Mynewt examples are better to be on its [own repo](https://github.com/hathach/mynewt-tinyusb-example)
-
-License
-=======
-
-All TinyUSB sources in the `src` folder are licensed under MIT license. However, each file can be individually licensed especially those in `lib` and `hw/mcu` folder. Please make sure you understand all the license term for files you use in your project.
-
-Index
-=====
-
-.. toctree::
- :maxdepth: 2
-
- supported
- getting_started
- concurrency
diff --git a/tinyusb/docs/reference/supported.rst b/tinyusb/docs/reference/supported.rst
deleted file mode 100755
index 4c7d753c..00000000
--- a/tinyusb/docs/reference/supported.rst
+++ /dev/null
@@ -1,337 +0,0 @@
-*****************
-Supported Devices
-*****************
-
-
-Supported MCUs
-==============
-
-.. admonition:: Warning
- :class: warning
-
- This table is a WIP! the data is not correct, tho if a device is listed, it likely works as a usb full speed device at the least.
-
-+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| Manufacturer | Family | Device | Host | FS | HS | Known Issues |
-+==============+====================+===================+====================+===================+===================+==============+
-| Dialog | DA1469x | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| Espressif | ESP32-S2 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | ESP32-S3 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| MicroChip | SAMD11 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | SAMD21 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | SAMD51 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | SAME5x | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | SAMG55 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | SAML21 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | SAML22 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | SAME70,S70,V70,V71 | |:green_square:| | |:red_square:| | |:green_square:| | |:green_square:| | |
-+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| NordicSemi | nRF52833 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | nRF52840 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| Nuvoton | NUC120 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | NUC121/NUC125 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | NUC126 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | NUC505 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-+--------------+-------+------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| NXP | iMX | RT1011 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | RT1015 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | RT1021 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | RT1052 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | RT1062 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | RT1064 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
-| +-------+------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | Kinetis KL25 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| +-------+------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | LPC | 11u | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | 13 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | 15 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | 17 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | 18 | | |:yellow_square:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | 40 | | |:x:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | 43 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | 51u | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | 54 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | 55 | |:green_square:| | |:x:| | |:green_square:| | | |
-+--------------+-------+------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| Raspberry Pi | RP2040 | |:green_square:| | |:x:| | |:green_square:| | | |
-+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| Renesas | RX63N | | | | | |
-| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | RX65N | | | | | |
-+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| Silabs | EFM32GG12 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | #750 |
-+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| Sony | CXD56 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
-+--------------+-------+------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| ST | STM32 | L0 | |:green_square:| | | |:green_square:| | | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | F0 | |:green_square:| | | |:green_square:| | | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | F1 | |:green_square:| | | |:green_square:| | | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | F2 | |:green_square:| | | |:green_square:| | | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | F3 | |:green_square:| | | |:green_square:| | | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | F4 | |:green_square:| | | |:green_square:| | | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | F7 | |:green_square:| | | |:green_square:| | | |
-| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| | | H7 | |:green_square:| | | |:green_square:| | |:green_square:| | |
-+--------------+-------+------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| TI | MSP430 | |:green_square:| | | |:green_square:| | | |
-+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-| ValentyUSB | eptri | |:green_square:| | | |:green_square:| | | |
-+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
-
-Table Legend
-------------
-
-================= ===================
-|:x:| Not available
-|:red_square:| Not supported
-|:yellow_square:| WIP/partial support
-|:green_square:| Supported
-================= ===================
-
-Supported Boards
-================
-
-The board support code is only used for self-contained examples and testing. It is not used when TinyUSB is part of a larger project. It is responsible for getting the MCU started and the USB peripheral clocked with minimal of on-board devices
-
-- One LED : for status
-- One Button : to get input from user
-- One UART : optional for device, but required for host examples
-
-The following boards are supported (sorted alphabetically):
-
-Dialog DA146xx
---------------
-
-- `DA14695 Development Kit – USB <https://www.dialog-semiconductor.com/products/da14695-development-kit-usb>`__
-- `DA1469x Development Kit – Pro <https://www.dialog-semiconductor.com/products/da14695-development-kit-pro>`__
-
-Espressif ESP32-S2
-------------------
-
-- Adafruit Feather ESP32-S2
-- `Adafruit Magtag 2.9" E-Ink WiFi Display <https://www.adafruit.com/product/4800>`__
-- `Adafruit Metro ESP32-S2 <https://www.adafruit.com/product/4775>`__
-- `ESP32-S2-Kaluga-1 <https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-esp32-s2-kaluga-1-kit.html>`__
-- `ESP32-S2-Saola-1 <https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-saola-1-v1.2.html>`__
-
-MicroChip
----------
-
-SAMD11 & SAMD21
-^^^^^^^^^^^^^^^
-
-- `Adafruit Circuit Playground Express <https://www.adafruit.com/product/3333>`__
-- `Adafruit Feather M0 Express <https://www.adafruit.com/product/3403>`__
-- `Adafruit ItsyBitsy M0 Express <https://www.adafruit.com/product/3727>`__
-- `Adafruit Metro M0 Express <https://www.adafruit.com/product/3505>`__
-- `Great Scott Gadgets LUNA <https://greatscottgadgets.com/luna/>`__
-- `Microchip SAMD11 Xplained Pro <https://www.microchip.com/developmenttools/ProductDetails/atsamd11-xpro>`__
-- `Microchip SAMD21 Xplained Pro <https://www.microchip.com/DevelopmentTools/ProductDetails/ATSAMD21-XPRO>`__
-- `Seeeduino Xiao <https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html>`__
-
-SAMD51 & SAME54
-^^^^^^^^^^^^^^^
-
-- `Adafruit Feather M4 Express <https://www.adafruit.com/product/3857>`__
-- `Adafruit ItsyBitsy M4 Express <https://www.adafruit.com/product/3800>`__
-- `Adafruit PyBadge <https://www.adafruit.com/product/4200>`__
-- `Adafruit PyPortal <https://www.adafruit.com/product/4116>`__
-- `Adafruit Metro M4 Express <https://www.adafruit.com/product/3382>`__
-- `D5035-01 <https://github.com/RudolphRiedel/USB_CAN-FD>`__
-- `Microchip SAME54 Xplained Pro <https://www.microchip.com/developmenttools/productdetails/atsame54-xpro>`__
-
-SAMG
-^^^^
-
-- `Microchip SAMG55 Xplained Pro <https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/ATSAMG55-XPRO>`__
-
-SAML2x
-^^^^^^
-
-- `SAML21 Xplaind Pro <https://www.microchip.com/DevelopmentTools/ProductDetails/ATSAML21-XPRO-B>`__
-- `SAML22 Feather <https://github.com/joeycastillo/Feather-Projects/tree/main/SAML22%20Feather>`__
-- `Sensor Watch <https://github.com/joeycastillo/Sensor-Watch>`__
-
-Nordic nRF5x
-------------
-
-- `Adafruit Circuit Playground Bluefruit <https://www.adafruit.com/product/4333>`__
-- `Adafruit CLUE <https://www.adafruit.com/product/4500>`__
-- `Adafruit Feather nRF52840 Express <https://www.adafruit.com/product/4062>`__
-- `Adafruit Feather nRF52840 Sense <https://www.adafruit.com/product/4516>`__
-- `Adafruit ItsyBitsy nRF52840 Express <https://www.adafruit.com/product/4481>`__
-- `Arduino Nano 33 BLE <https://store.arduino.cc/usa/nano-33-ble>`__
-- `Arduino Nano 33 BLE Sense <https://store.arduino.cc/usa/nano-33-ble-sense>`__
-- `Maker Diary nRF52840 MDK Dongle <https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle>`__
-- `Nordic nRF52840 Development Kit (aka pca10056) <https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK>`__
-- `Nordic nRF52840 Dongle (aka pca10059) <https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-Dongle>`__
-- `Nordic nRF52833 Development Kit (aka pca10100) <https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52833-DK>`__
-- `Raytac MDBT50Q-RX Dongle <https://www.raytac.com/product/ins.php?index_id=89>`__
-
-Nuvoton
--------
-
-- NuTiny SDK NUC120
-- `NuTiny NUC121S <https://direct.nuvoton.com/en/nutiny-nuc121s>`__
-- `NuTiny NUC125S <https://direct.nuvoton.com/en/nutiny-nuc125s>`__
-- `NuTiny NUC126V <https://direct.nuvoton.com/en/nutiny-nuc126v>`__
-- `NuTiny SDK NUC505Y <https://direct.nuvoton.com/en/nutiny-nuc505y>`__
-
-NXP
----
-
-iMX RT
-^^^^^^
-
-- `MIMX RT1010 Evaluation Kit <https://www.nxp.com/design/development-boards/i.mx-evaluation-and-development-boards/i.mx-rt1010-evaluation-kit:MIMXRT1010-EVK>`__
-- `MIMX RT1015 Evaluation Kit <https://www.nxp.com/design/development-boards/i.mx-evaluation-and-development-boards/i.mx-rt1015-evaluation-kit:MIMXRT1015-EVK>`__
-- `MIMX RT1020 Evaluation Kit <https://www.nxp.com/design/development-boards/i.mx-evaluation-and-development-boards/i.mx-rt1020-evaluation-kit:MIMXRT1020-EVK>`__
-- `MIMX RT1050 Evaluation Kit <https://www.nxp.com/design/development-boards/i.mx-evaluation-and-development-boards/i.mx-rt1050-evaluation-kit:MIMXRT1050-EVK>`__
-- `MIMX RT1060 Evaluation Kit <https://www.nxp.com/design/development-boards/i.mx-evaluation-and-development-boards/mimxrt1060-evk-i.mx-rt1060-evaluation-kit:MIMXRT1060-EVK>`__
-- `MIMX RT1064 Evaluation Kit <https://www.nxp.com/design/development-boards/i.mx-evaluation-and-development-boards/mimxrt1064-evk-i.mx-rt1064-evaluation-kit:MIMXRT1064-EVK>`__
-- `Teensy 4.0 Development Board <https://www.pjrc.com/store/teensy40.html>`__
-
-Kinetis
-^^^^^^^
-
-- `FRDM-KL25Z <https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/freedom-development-platform-for-kinetis-kl14-kl15-kl24-kl25-mcus:FRDM-KL25Z>`__
-
-LPC 11-13-15
-^^^^^^^^^^^^
-
-- `LPCXpresso 11u37 <https://www.nxp.com/design/microcontrollers-developer-resources/lpcxpresso-boards/lpcxpresso-board-for-lpc11u37h:OM13074>`__
-- `LPCXpresso 11u68 <https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/lpcxpresso-boards/lpcxpresso-board-for-lpc11u68:OM13058>`__
-- `LPCXpresso 1347 <https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/lpcxpresso-boards/lpcxpresso-board-for-lpc1347:OM13045>`__
-- `LPCXpresso 1549 <https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1500-cortex-m3/lpcxpresso-board-for-lpc1549:OM13056>`__
-
-LPC 17-40
-^^^^^^^^^
-
-- `ARM mbed LPC1768 <https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/arm-mbed-lpc1768-board:OM11043>`__
-- `Embedded Artists LPC4088 Quick Start board <https://www.embeddedartists.com/products/lpc4088-quickstart-board>`__
-- `LPCXpresso 1769 <https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/lpcxpresso-boards/lpcxpresso-board-for-lpc1769:OM13000>`__
-
-LPC 18-43
-^^^^^^^^^
-
-- `Embedded Artists LPC4357 Developer Kit <http://www.embeddedartists.com/products/kits/lpc4357_kit.php>`__
-- `Keil MCB1800 Evaluation Board <http://www.keil.com/mcb1800>`__
-- `LPCXpresso18S37 Development Board <https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc4000-cortex-m4/lpcxpresso18s37-development-board:OM13076>`__
-- `NGX LPC4330-Xplorer <https://www.nxp.com/design/designs/lpc4330-xplorer-board:OM13027>`__
-
-LPC 51
-^^^^^^
-
-- `LPCXpresso 51U68 <https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpcxpresso51u68-for-the-lpc51u68-mcus:OM40005>`__
-
-LPC 54
-^^^^^^
-
-- `LPCXpresso 54114 <https://www.nxp.com/design/microcontrollers-developer-resources/lpcxpresso-boards/lpcxpresso54114-board:OM13089>`__
-
-LPC55
-^^^^^
-
-- `Double M33 Express <https://www.crowdsupply.com/steiert-solutions/double-m33-express>`__
-- `LPCXpresso 55s28 EVK <https://www.nxp.com/design/software/development-software/lpcxpresso55s28-development-board:LPC55S28-EVK>`__
-- `LPCXpresso 55s69 EVK <https://www.nxp.com/design/development-boards/lpcxpresso-boards/lpcxpresso55s69-development-board:LPC55S69-EVK>`__
-- `MCU-Link <https://www.nxp.com/design/development-boards/lpcxpresso-boards/mcu-link-debug-probe:MCU-LINK>`__
-
-Renesas RX
-----------
-
-- `GR-CITRUS <https://www.renesas.com/us/en/products/gadget-renesas/boards/gr-citrus>`__
-- `Renesas RX65N Target Board <https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rx-32-bit-performance-efficiency-mcus/rtk5rx65n0c00000br-target-board-rx65n>`__
-
-Raspberry Pi RP2040
--------------------
-
-- `Adafruit Feather RP2040 <https://www.adafruit.com/product/4884>`__
-- `Adafruit ItsyBitsy RP2040 <https://www.adafruit.com/product/4888>`__
-- `Adafruit QT Py RP2040 <https://www.adafruit.com/product/4900>`__
-- `Raspberry Pi Pico <https://www.raspberrypi.org/products/raspberry-pi-pico/>`__
-
-Silabs
-------
-
-- `EFM32GG12 Thunderboard Kit (SLTB009A) <https://www.silabs.com/development-tools/thunderboard/thunderboard-gg12-kit>`__
-
-Sony
-----
-
-- `Sony Spresense CXD5602 <https://developer.sony.com/develop/spresense>`__
-
-ST STM32
---------
-
-- `Adafruit Feather STM32F405 <https://www.adafruit.com/product/4382>`__
-- `Micro Python PyBoard v1.1 <https://store.micropython.org/product/PYBv1.1>`__
-- `STLink-V3 Mini <https://www.st.com/en/development-tools/stlink-v3mini.html>`__
-- `STM32 L035c8 Discovery <https://www.st.com/en/evaluation-tools/32l0538discovery.html>`__
-- `STM32 L4R5zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-l4r5zi.html>`__
-- `STM32 F070rb Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f070rb.html>`__
-- `STM32 F072 Evaluation <https://www.st.com/en/evaluation-tools/stm32072b-eval.html>`__
-- `STM32 F072rb Discovery <https://www.st.com/en/evaluation-tools/32f072bdiscovery.html>`__
-- `STM32 F103c8 Blue Pill <https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill>`__
-- `STM32 F103rc Mini v2.0 <https://stm32-base.org/boards/STM32F103RCT6-STM32-Mini-V2.0>`__
-- `STM32 F207zg Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f207zg.html>`__
-- `STM32 F303vc Discovery <https://www.st.com/en/evaluation-tools/stm32f3discovery.html>`__
-- `STM32 F401cc Black Pill <https://stm32-base.org/boards/STM32F401CCU6-WeAct-Black-Pill-V1.2>`__
-- `STM32 F407vg Discovery <https://www.st.com/en/evaluation-tools/stm32f4discovery.html>`__
-- `STM32 F411ce Black Pill <https://www.adafruit.com/product/4877>`__
-- `STM32 F411ve Discovery <https://www.st.com/en/evaluation-tools/32f411ediscovery.html>`__
-- `STM32 F412zg Discovery <https://www.st.com/en/evaluation-tools/32f412gdiscovery.html>`__
-- `STM32 F723e Discovery <https://www.st.com/en/evaluation-tools/32f723ediscovery.html>`__
-- `STM32 F746zg Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f746zg.html>`__
-- `STM32 F746g Discovery <https://www.st.com/en/evaluation-tools/32f746gdiscovery.html>`__
-- `STM32 F767zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f767zi.html>`__
-- `STM32 F769i Discovery <https://www.st.com/en/evaluation-tools/32f769idiscovery.html>`__
-- `STM32 H743zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-h743zi.html>`__
-- `STM32 H743i Evaluation <https://www.st.com/en/evaluation-tools/stm32h743i-eval.html>`__
-- `STM32 H745i Discovery <https://www.st.com/en/evaluation-tools/stm32h745i-disco.html>`__
-- `Waveshare OpenH743I-C <https://www.waveshare.com/openh743i-c-standard.htm>`__
-
-TI
---
-
-- `MSP430F5529 USB LaunchPad Evaluation Kit <http://www.ti.com/tool/MSP-EXP430F5529LP>`__
-
-Tomu
-----
-
-- `Fomu <https://www.crowdsupply.com/sutajio-kosagi/fomu>`__
diff --git a/tinyusb/docs/requirements.txt b/tinyusb/docs/requirements.txt
deleted file mode 100755
index e415ae03..00000000
--- a/tinyusb/docs/requirements.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-sphinx~=3.0
-furo>=2020.12.30.b24
-sphinxemoji>=0.1.8
-sphinx-autodoc-typehints>=1.10
diff --git a/tinyusb/examples/device/99-tinyusb.rules b/tinyusb/examples/device/99-tinyusb.rules
deleted file mode 100755
index e6372ed5..00000000
--- a/tinyusb/examples/device/99-tinyusb.rules
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copy this file to the location of your distribution's udev rules, for example on Ubuntu:
-# sudo cp 99-tinyusb.rules /etc/udev/rules.d/
-# Then reload udev configuration by executing:
-# sudo udevadm control --reload-rules
-# sudo udevadm trigger
-
-# Check SUBSYSTEM
-SUBSYSTEMS=="hidraw", KERNEL=="hidraw*", MODE="0666", GROUP="dialout"
-
-# Rule applies to all TinyUSB example
-ATTRS{idVendor}=="cafe", MODE="0666", GROUP="dialout"
-
-# Rule to blacklist TinyUSB example from being manipulated by ModemManager.
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="cafe", ENV{ID_MM_DEVICE_IGNORE}="1"
diff --git a/tinyusb/examples/device/CMakeLists.txt b/tinyusb/examples/device/CMakeLists.txt
deleted file mode 100755
index a0e4600f..00000000
--- a/tinyusb/examples/device/CMakeLists.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
-
-project(tinyusb_device_examples)
-family_initialize_project(tinyusb_device_examples ${CMAKE_CURRENT_LIST_DIR})
-
-# family_add_subdirectory will filter what to actually add based on selected FAMILY
-family_add_subdirectory(audio_4_channel_mic)
-family_add_subdirectory(audio_test)
-family_add_subdirectory(board_test)
-family_add_subdirectory(cdc_dual_ports)
-family_add_subdirectory(cdc_msc)
-family_add_subdirectory(cdc_msc_freertos)
-family_add_subdirectory(dfu)
-family_add_subdirectory(dfu_runtime)
-family_add_subdirectory(dynamic_configuration)
-family_add_subdirectory(hid_composite)
-family_add_subdirectory(hid_composite_freertos)
-family_add_subdirectory(hid_generic_inout)
-family_add_subdirectory(hid_multiple_interface)
-family_add_subdirectory(midi_test)
-family_add_subdirectory(msc_dual_lun)
-family_add_subdirectory(net_lwip_webserver)
-family_add_subdirectory(uac2_headset)
-family_add_subdirectory(usbtmc)
-family_add_subdirectory(webusb_serial)
diff --git a/tinyusb/examples/device/audio_4_channel_mic/.skip.MCU_SAMD11 b/tinyusb/examples/device/audio_4_channel_mic/.skip.MCU_SAMD11
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/audio_4_channel_mic/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/tinyusb/examples/device/audio_4_channel_mic/.skip.MCU_SAME5X b/tinyusb/examples/device/audio_4_channel_mic/.skip.MCU_SAME5X
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/audio_4_channel_mic/.skip.MCU_SAME5X
+++ /dev/null
diff --git a/tinyusb/examples/device/audio_4_channel_mic/.skip.MCU_SAMG b/tinyusb/examples/device/audio_4_channel_mic/.skip.MCU_SAMG
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/audio_4_channel_mic/.skip.MCU_SAMG
+++ /dev/null
diff --git a/tinyusb/examples/device/audio_4_channel_mic/CMakeLists.txt b/tinyusb/examples/device/audio_4_channel_mic/CMakeLists.txt
deleted file mode 100755
index f6e10e2e..00000000
--- a/tinyusb/examples/device/audio_4_channel_mic/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
-)
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
-)
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
diff --git a/tinyusb/examples/device/audio_4_channel_mic/Makefile b/tinyusb/examples/device/audio_4_channel_mic/Makefile
deleted file mode 100755
index 5a455078..00000000
--- a/tinyusb/examples/device/audio_4_channel_mic/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/audio_4_channel_mic/src/main.c b/tinyusb/examples/device/audio_4_channel_mic/src/main.c
deleted file mode 100755
index 983b87e5..00000000
--- a/tinyusb/examples/device/audio_4_channel_mic/src/main.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Reinhard Panhuber
- *
- * 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.
- *
- */
-
-/* plot_audio_samples.py requires following modules:
- * $ sudo apt install libportaudio
- * $ pip3 install sounddevice matplotlib
- *
- * Then run
- * $ python3 plot_audio_samples.py
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-#ifndef AUDIO_SAMPLE_RATE
-#define AUDIO_SAMPLE_RATE 48000
-#endif
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-// Audio controls
-// Current states
-bool mute[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX + 1]; // +1 for master channel 0
-uint16_t volume[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX + 1]; // +1 for master channel 0
-uint32_t sampFreq;
-uint8_t clkValid;
-
-// Range states
-audio_control_range_2_n_t(1) volumeRng[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX+1]; // Volume range state
-audio_control_range_4_n_t(1) sampleFreqRng; // Sample frequency range state
-
-// Audio test data
-uint16_t i2s_dummy_buffer[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ/2]; // Ensure half word aligned
-
-void led_blinking_task(void);
-void audio_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- tusb_init();
-
- // Init values
- sampFreq = AUDIO_SAMPLE_RATE;
- clkValid = 1;
-
- sampleFreqRng.wNumSubRanges = 1;
- sampleFreqRng.subrange[0].bMin = AUDIO_SAMPLE_RATE;
- sampleFreqRng.subrange[0].bMax = AUDIO_SAMPLE_RATE;
- sampleFreqRng.subrange[0].bRes = 0;
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
- audio_task();
- }
-
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-//--------------------------------------------------------------------+
-// AUDIO Task
-//--------------------------------------------------------------------+
-
-void audio_task(void)
-{
- // Yet to be filled - e.g. put meas data into TX FIFOs etc.
- asm("nop");
-}
-
-//--------------------------------------------------------------------+
-// Application Callback API Implementations
-//--------------------------------------------------------------------+
-
-// Invoked when audio class specific set request received for an EP
-bool tud_audio_set_req_ep_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff)
-{
- (void) rhport;
- (void) pBuff;
-
- // We do not support any set range requests here, only current value requests
- TU_VERIFY(p_request->bRequest == AUDIO_CS_REQ_CUR);
-
- // Page 91 in UAC2 specification
- uint8_t channelNum = TU_U16_LOW(p_request->wValue);
- uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
- uint8_t ep = TU_U16_LOW(p_request->wIndex);
-
- (void) channelNum; (void) ctrlSel; (void) ep;
-
- return false; // Yet not implemented
-}
-
-// Invoked when audio class specific set request received for an interface
-bool tud_audio_set_req_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff)
-{
- (void) rhport;
- (void) pBuff;
-
- // We do not support any set range requests here, only current value requests
- TU_VERIFY(p_request->bRequest == AUDIO_CS_REQ_CUR);
-
- // Page 91 in UAC2 specification
- uint8_t channelNum = TU_U16_LOW(p_request->wValue);
- uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
- uint8_t itf = TU_U16_LOW(p_request->wIndex);
-
- (void) channelNum; (void) ctrlSel; (void) itf;
-
- return false; // Yet not implemented
-}
-
-// Invoked when audio class specific set request received for an entity
-bool tud_audio_set_req_entity_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff)
-{
- (void) rhport;
-
- // Page 91 in UAC2 specification
- uint8_t channelNum = TU_U16_LOW(p_request->wValue);
- uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
- uint8_t itf = TU_U16_LOW(p_request->wIndex);
- uint8_t entityID = TU_U16_HIGH(p_request->wIndex);
-
- (void) itf;
-
- // We do not support any set range requests here, only current value requests
- TU_VERIFY(p_request->bRequest == AUDIO_CS_REQ_CUR);
-
- // If request is for our feature unit
- if ( entityID == 2 )
- {
- switch ( ctrlSel )
- {
- case AUDIO_FU_CTRL_MUTE:
- // Request uses format layout 1
- TU_VERIFY(p_request->wLength == sizeof(audio_control_cur_1_t));
-
- mute[channelNum] = ((audio_control_cur_1_t*) pBuff)->bCur;
-
- TU_LOG2(" Set Mute: %d of channel: %u\r\n", mute[channelNum], channelNum);
- return true;
-
- case AUDIO_FU_CTRL_VOLUME:
- // Request uses format layout 2
- TU_VERIFY(p_request->wLength == sizeof(audio_control_cur_2_t));
-
- volume[channelNum] = ((audio_control_cur_2_t*) pBuff)->bCur;
-
- TU_LOG2(" Set Volume: %d dB of channel: %u\r\n", volume[channelNum], channelNum);
- return true;
-
- // Unknown/Unsupported control
- default:
- TU_BREAKPOINT();
- return false;
- }
- }
- return false; // Yet not implemented
-}
-
-// Invoked when audio class specific get request received for an EP
-bool tud_audio_get_req_ep_cb(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- (void) rhport;
-
- // Page 91 in UAC2 specification
- uint8_t channelNum = TU_U16_LOW(p_request->wValue);
- uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
- uint8_t ep = TU_U16_LOW(p_request->wIndex);
-
- (void) channelNum; (void) ctrlSel; (void) ep;
-
- // return tud_control_xfer(rhport, p_request, &tmp, 1);
-
- return false; // Yet not implemented
-}
-
-// Invoked when audio class specific get request received for an interface
-bool tud_audio_get_req_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- (void) rhport;
-
- // Page 91 in UAC2 specification
- uint8_t channelNum = TU_U16_LOW(p_request->wValue);
- uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
- uint8_t itf = TU_U16_LOW(p_request->wIndex);
-
- (void) channelNum; (void) ctrlSel; (void) itf;
-
- return false; // Yet not implemented
-}
-
-// Invoked when audio class specific get request received for an entity
-bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- (void) rhport;
-
- // Page 91 in UAC2 specification
- uint8_t channelNum = TU_U16_LOW(p_request->wValue);
- uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
- // uint8_t itf = TU_U16_LOW(p_request->wIndex); // Since we have only one audio function implemented, we do not need the itf value
- uint8_t entityID = TU_U16_HIGH(p_request->wIndex);
-
- // Input terminal (Microphone input)
- if (entityID == 1)
- {
- switch ( ctrlSel )
- {
- case AUDIO_TE_CTRL_CONNECTOR:
- {
- // The terminal connector control only has a get request with only the CUR attribute.
- audio_desc_channel_cluster_t ret;
-
- // Those are dummy values for now
- ret.bNrChannels = 1;
- ret.bmChannelConfig = 0;
- ret.iChannelNames = 0;
-
- TU_LOG2(" Get terminal connector\r\n");
-
- return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, (void*) &ret, sizeof(ret));
- }
- break;
-
- // Unknown/Unsupported control selector
- default:
- TU_BREAKPOINT();
- return false;
- }
- }
-
- // Feature unit
- if (entityID == 2)
- {
- switch ( ctrlSel )
- {
- case AUDIO_FU_CTRL_MUTE:
- // Audio control mute cur parameter block consists of only one byte - we thus can send it right away
- // There does not exist a range parameter block for mute
- TU_LOG2(" Get Mute of channel: %u\r\n", channelNum);
- return tud_control_xfer(rhport, p_request, &mute[channelNum], 1);
-
- case AUDIO_FU_CTRL_VOLUME:
- switch ( p_request->bRequest )
- {
- case AUDIO_CS_REQ_CUR:
- TU_LOG2(" Get Volume of channel: %u\r\n", channelNum);
- return tud_control_xfer(rhport, p_request, &volume[channelNum], sizeof(volume[channelNum]));
-
- case AUDIO_CS_REQ_RANGE:
- TU_LOG2(" Get Volume range of channel: %u\r\n", channelNum);
-
- // Copy values - only for testing - better is version below
- audio_control_range_2_n_t(1)
- ret;
-
- ret.wNumSubRanges = 1;
- ret.subrange[0].bMin = -90; // -90 dB
- ret.subrange[0].bMax = 90; // +90 dB
- ret.subrange[0].bRes = 1; // 1 dB steps
-
- return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, (void*) &ret, sizeof(ret));
-
- // Unknown/Unsupported control
- default:
- TU_BREAKPOINT();
- return false;
- }
- break;
-
- // Unknown/Unsupported control
- default:
- TU_BREAKPOINT();
- return false;
- }
- }
-
- // Clock Source unit
- if ( entityID == 4 )
- {
- switch ( ctrlSel )
- {
- case AUDIO_CS_CTRL_SAM_FREQ:
- // channelNum is always zero in this case
- switch ( p_request->bRequest )
- {
- case AUDIO_CS_REQ_CUR:
- TU_LOG2(" Get Sample Freq.\r\n");
- return tud_control_xfer(rhport, p_request, &sampFreq, sizeof(sampFreq));
-
- case AUDIO_CS_REQ_RANGE:
- TU_LOG2(" Get Sample Freq. range\r\n");
- return tud_control_xfer(rhport, p_request, &sampleFreqRng, sizeof(sampleFreqRng));
-
- // Unknown/Unsupported control
- default:
- TU_BREAKPOINT();
- return false;
- }
- break;
-
- case AUDIO_CS_CTRL_CLK_VALID:
- // Only cur attribute exists for this request
- TU_LOG2(" Get Sample Freq. valid\r\n");
- return tud_control_xfer(rhport, p_request, &clkValid, sizeof(clkValid));
-
- // Unknown/Unsupported control
- default:
- TU_BREAKPOINT();
- return false;
- }
- }
-
- TU_LOG2(" Unsupported entity: %d\r\n", entityID);
- return false; // Yet not implemented
-}
-
-bool tud_audio_tx_done_pre_load_cb(uint8_t rhport, uint8_t itf, uint8_t ep_in, uint8_t cur_alt_setting)
-{
- (void) rhport;
- (void) itf;
- (void) ep_in;
- (void) cur_alt_setting;
-
- for (uint8_t cnt=0; cnt < CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO; cnt++)
- {
- tud_audio_write_support_ff(cnt, i2s_dummy_buffer[cnt], AUDIO_SAMPLE_RATE/1000 * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX);
- }
-
- return true;
-}
-
-bool tud_audio_tx_done_post_load_cb(uint8_t rhport, uint16_t n_bytes_copied, uint8_t itf, uint8_t ep_in, uint8_t cur_alt_setting)
-{
- (void) rhport;
- (void) n_bytes_copied;
- (void) itf;
- (void) ep_in;
- (void) cur_alt_setting;
-
- uint16_t dataVal;
-
- // Generate dummy data
- for (uint16_t cnt = 0; cnt < CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO; cnt++)
- {
- uint16_t * p_buff = i2s_dummy_buffer[cnt]; // 2 bytes per sample
- dataVal = 1;
- for (uint16_t cnt2 = 0; cnt2 < AUDIO_SAMPLE_RATE/1000; cnt2++)
- {
- for (uint8_t cnt3 = 0; cnt3 < CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX; cnt3++)
- {
- *p_buff++ = dataVal;
- }
- dataVal++;
- }
- }
- return true;
-}
-
-bool tud_audio_set_itf_close_EP_cb(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- (void) rhport;
- (void) p_request;
-
- return true;
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/audio_4_channel_mic/src/plot_audio_samples.py b/tinyusb/examples/device/audio_4_channel_mic/src/plot_audio_samples.py
deleted file mode 100755
index 9ab15135..00000000
--- a/tinyusb/examples/device/audio_4_channel_mic/src/plot_audio_samples.py
+++ /dev/null
@@ -1,34 +0,0 @@
-import sounddevice as sd
-import matplotlib.pyplot as plt
-import numpy as np
-import platform
-
-if __name__ == '__main__':
-
- # If you got "ValueError: No input device matching", that is because your PC name example device
- # differently from tested list below. Uncomment the next line to see full list and try to pick correct one
- # print(sd.query_devices())
-
- fs = 48000 # Sample rate
- duration = 100e-3 # Duration of recording
-
- if platform.system() == 'Windows':
- # WDM-KS is needed since there are more than one MicNode device APIs (at least in Windows)
- device = 'Microphone (MicNode_4_Ch), Windows WDM-KS'
- elif platform.system() == 'Darwin':
- device = 'MicNode_4_Ch'
- else:
- device ='default'
-
- myrecording = sd.rec(int(duration * fs), samplerate=fs, channels=4, dtype='int16', device=device)
- print('Waiting...')
- sd.wait() # Wait until recording is finished
- print('Done!')
-
- time = np.arange(0, duration, 1 / fs) # time vector
- plt.plot(time, myrecording)
- plt.xlabel('Time [s]')
- plt.ylabel('Amplitude')
- plt.title('MicNode 4 Channel')
- plt.show()
- \ No newline at end of file
diff --git a/tinyusb/examples/device/audio_4_channel_mic/src/tusb_config.h b/tinyusb/examples/device/audio_4_channel_mic/src/tusb_config.h
deleted file mode 100755
index 44be5a0d..00000000
--- a/tinyusb/examples/device/audio_4_channel_mic/src/tusb_config.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by compiler flags for flexibility
-#ifndef CFG_TUSB_MCU
-#error CFG_TUSB_MCU must be defined
-#endif
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
-#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED)
-#else
-#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-#ifndef CFG_TUSB_DEBUG
-#define CFG_TUSB_DEBUG 0
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 0
-#define CFG_TUD_HID 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_AUDIO 1
-#define CFG_TUD_VENDOR 0
-
-//--------------------------------------------------------------------
-// AUDIO CLASS DRIVER CONFIGURATION
-//--------------------------------------------------------------------
-
-// Have a look into audio_device.h for all configurations
-
-#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_MIC_FOUR_CH_DESC_LEN
-
-#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 1
-#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64
-
-#define CFG_TUD_AUDIO_ENABLE_EP_IN 1
-#define CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX 2 // This value is not required by the driver, it parses this information from the descriptor once the alternate interface is set by the host - we use it for the setup
-#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 4 // This value is not required by the driver, it parses this information from the descriptor once the alternate interface is set by the host - we use it for the setup
-#define CFG_TUD_AUDIO_EP_SZ_IN (48 + 1) * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX // 48 Samples (48 kHz) x 2 Bytes/Sample x CFG_TUD_AUDIO_N_CHANNELS_TX Channels - the Windows driver always needs an extra sample per channel of space more, otherwise it complains... found by trial and error
-#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_EP_SZ_IN
-#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ CFG_TUD_AUDIO_EP_SZ_IN
-
-#define CFG_TUD_AUDIO_ENABLE_ENCODING 1
-#define CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING 1
-#define CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX 2 // One I2S stream contains two channels, each stream is saved within one support FIFO - this value is currently fixed, the driver does not support a changing value
-#define CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO (CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX / CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX)
-#define CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ (CFG_TUD_AUDIO_EP_SZ_IN / CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/audio_4_channel_mic/src/usb_descriptors.c b/tinyusb/examples/device/audio_4_channel_mic/src/usb_descriptors.c
deleted file mode 100755
index 93ec6e9f..00000000
--- a/tinyusb/examples/device/audio_4_channel_mic/src/usb_descriptors.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] AUDIO | MIDI | HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(AUDIO, 4) | _PID_MAP(VENDOR, 5) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
-
- // Use Interface Association Descriptor (IAD) for CDC
- // As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
- .bDeviceClass = TUSB_CLASS_MISC,
- .bDeviceSubClass = MISC_SUBCLASS_COMMON,
- .bDeviceProtocol = MISC_PROTOCOL_IAD,
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-enum
-{
- ITF_NUM_AUDIO_CONTROL = 0,
- ITF_NUM_AUDIO_STREAMING,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + CFG_TUD_AUDIO * TUD_AUDIO_MIC_FOUR_CH_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
-// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
-// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
-#define EPNUM_AUDIO 0x03
-#else
-#define EPNUM_AUDIO 0x01
-#endif
-
-uint8_t const desc_configuration[] =
-{
- // Interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_AUDIO_MIC_FOUR_CH_DESCRIPTOR(/*_itfnum*/ ITF_NUM_AUDIO_CONTROL, /*_stridx*/ 0, /*_nBytesPerSample*/ CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX, /*_nBitsUsedPerSample*/ CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX*8, /*_epin*/ 0x80 | EPNUM_AUDIO, /*_epsize*/ CFG_TUD_AUDIO_EP_SZ_IN)
-};
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
- return desc_configuration;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "PaniRCorp", // 1: Manufacturer
- "MicNode_4_Ch", // 2: Product
- "123458", // 3: Serials, should use chip ID
- "UAC2", // 4: Audio Interface
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Convert ASCII string into UTF-16
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/audio_test/.skip.MCU_SAMD11 b/tinyusb/examples/device/audio_test/.skip.MCU_SAMD11
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/audio_test/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/tinyusb/examples/device/audio_test/.skip.MCU_SAME5X b/tinyusb/examples/device/audio_test/.skip.MCU_SAME5X
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/audio_test/.skip.MCU_SAME5X
+++ /dev/null
diff --git a/tinyusb/examples/device/audio_test/.skip.MCU_SAMG b/tinyusb/examples/device/audio_test/.skip.MCU_SAMG
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/audio_test/.skip.MCU_SAMG
+++ /dev/null
diff --git a/tinyusb/examples/device/audio_test/CMakeLists.txt b/tinyusb/examples/device/audio_test/CMakeLists.txt
deleted file mode 100755
index cb321f9a..00000000
--- a/tinyusb/examples/device/audio_test/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
-)
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
-)
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/audio_test/Makefile b/tinyusb/examples/device/audio_test/Makefile
deleted file mode 100755
index 5a455078..00000000
--- a/tinyusb/examples/device/audio_test/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/audio_test/src/main.c b/tinyusb/examples/device/audio_test/src/main.c
deleted file mode 100755
index 9a2fdd3a..00000000
--- a/tinyusb/examples/device/audio_test/src/main.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Reinhard Panhuber
- *
- * 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.
- *
- */
-
-/* plot_audio_samples.py requires following modules:
- * $ sudo apt install libportaudio
- * $ pip3 install sounddevice matplotlib
- *
- * Then run
- * $ python3 plot_audio_samples.py
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-#ifndef AUDIO_SAMPLE_RATE
-#define AUDIO_SAMPLE_RATE 48000
-#endif
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-// Audio controls
-// Current states
-bool mute[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX + 1]; // +1 for master channel 0
-uint16_t volume[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX + 1]; // +1 for master channel 0
-uint32_t sampFreq;
-uint8_t clkValid;
-
-// Range states
-audio_control_range_2_n_t(1) volumeRng[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX+1]; // Volume range state
-audio_control_range_4_n_t(1) sampleFreqRng; // Sample frequency range state
-
-// Audio test data
-uint16_t test_buffer_audio[CFG_TUD_AUDIO_EP_SZ_IN/2];
-uint16_t startVal = 0;
-
-void led_blinking_task(void);
-void audio_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- tusb_init();
-
- // Init values
- sampFreq = AUDIO_SAMPLE_RATE;
- clkValid = 1;
-
- sampleFreqRng.wNumSubRanges = 1;
- sampleFreqRng.subrange[0].bMin = AUDIO_SAMPLE_RATE;
- sampleFreqRng.subrange[0].bMax = AUDIO_SAMPLE_RATE;
- sampleFreqRng.subrange[0].bRes = 0;
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
- audio_task();
- }
-
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-//--------------------------------------------------------------------+
-// AUDIO Task
-//--------------------------------------------------------------------+
-
-void audio_task(void)
-{
- // Yet to be filled - e.g. put meas data into TX FIFOs etc.
- asm("nop");
-}
-
-//--------------------------------------------------------------------+
-// Application Callback API Implementations
-//--------------------------------------------------------------------+
-
-// Invoked when audio class specific set request received for an EP
-bool tud_audio_set_req_ep_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff)
-{
- (void) rhport;
- (void) pBuff;
-
- // We do not support any set range requests here, only current value requests
- TU_VERIFY(p_request->bRequest == AUDIO_CS_REQ_CUR);
-
- // Page 91 in UAC2 specification
- uint8_t channelNum = TU_U16_LOW(p_request->wValue);
- uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
- uint8_t ep = TU_U16_LOW(p_request->wIndex);
-
- (void) channelNum; (void) ctrlSel; (void) ep;
-
- return false; // Yet not implemented
-}
-
-// Invoked when audio class specific set request received for an interface
-bool tud_audio_set_req_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff)
-{
- (void) rhport;
- (void) pBuff;
-
- // We do not support any set range requests here, only current value requests
- TU_VERIFY(p_request->bRequest == AUDIO_CS_REQ_CUR);
-
- // Page 91 in UAC2 specification
- uint8_t channelNum = TU_U16_LOW(p_request->wValue);
- uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
- uint8_t itf = TU_U16_LOW(p_request->wIndex);
-
- (void) channelNum; (void) ctrlSel; (void) itf;
-
- return false; // Yet not implemented
-}
-
-// Invoked when audio class specific set request received for an entity
-bool tud_audio_set_req_entity_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff)
-{
- (void) rhport;
-
- // Page 91 in UAC2 specification
- uint8_t channelNum = TU_U16_LOW(p_request->wValue);
- uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
- uint8_t itf = TU_U16_LOW(p_request->wIndex);
- uint8_t entityID = TU_U16_HIGH(p_request->wIndex);
-
- (void) itf;
-
- // We do not support any set range requests here, only current value requests
- TU_VERIFY(p_request->bRequest == AUDIO_CS_REQ_CUR);
-
- // If request is for our feature unit
- if ( entityID == 2 )
- {
- switch ( ctrlSel )
- {
- case AUDIO_FU_CTRL_MUTE:
- // Request uses format layout 1
- TU_VERIFY(p_request->wLength == sizeof(audio_control_cur_1_t));
-
- mute[channelNum] = ((audio_control_cur_1_t*) pBuff)->bCur;
-
- TU_LOG2(" Set Mute: %d of channel: %u\r\n", mute[channelNum], channelNum);
- return true;
-
- case AUDIO_FU_CTRL_VOLUME:
- // Request uses format layout 2
- TU_VERIFY(p_request->wLength == sizeof(audio_control_cur_2_t));
-
- volume[channelNum] = ((audio_control_cur_2_t*) pBuff)->bCur;
-
- TU_LOG2(" Set Volume: %d dB of channel: %u\r\n", volume[channelNum], channelNum);
- return true;
-
- // Unknown/Unsupported control
- default:
- TU_BREAKPOINT();
- return false;
- }
- }
- return false; // Yet not implemented
-}
-
-// Invoked when audio class specific get request received for an EP
-bool tud_audio_get_req_ep_cb(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- (void) rhport;
-
- // Page 91 in UAC2 specification
- uint8_t channelNum = TU_U16_LOW(p_request->wValue);
- uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
- uint8_t ep = TU_U16_LOW(p_request->wIndex);
-
- (void) channelNum; (void) ctrlSel; (void) ep;
-
- // return tud_control_xfer(rhport, p_request, &tmp, 1);
-
- return false; // Yet not implemented
-}
-
-// Invoked when audio class specific get request received for an interface
-bool tud_audio_get_req_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- (void) rhport;
-
- // Page 91 in UAC2 specification
- uint8_t channelNum = TU_U16_LOW(p_request->wValue);
- uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
- uint8_t itf = TU_U16_LOW(p_request->wIndex);
-
- (void) channelNum; (void) ctrlSel; (void) itf;
-
- return false; // Yet not implemented
-}
-
-// Invoked when audio class specific get request received for an entity
-bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- (void) rhport;
-
- // Page 91 in UAC2 specification
- uint8_t channelNum = TU_U16_LOW(p_request->wValue);
- uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
- // uint8_t itf = TU_U16_LOW(p_request->wIndex); // Since we have only one audio function implemented, we do not need the itf value
- uint8_t entityID = TU_U16_HIGH(p_request->wIndex);
-
- // Input terminal (Microphone input)
- if (entityID == 1)
- {
- switch ( ctrlSel )
- {
- case AUDIO_TE_CTRL_CONNECTOR:
- {
- // The terminal connector control only has a get request with only the CUR attribute.
- audio_desc_channel_cluster_t ret;
-
- // Those are dummy values for now
- ret.bNrChannels = 1;
- ret.bmChannelConfig = 0;
- ret.iChannelNames = 0;
-
- TU_LOG2(" Get terminal connector\r\n");
-
- return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, (void*) &ret, sizeof(ret));
- }
- break;
-
- // Unknown/Unsupported control selector
- default:
- TU_BREAKPOINT();
- return false;
- }
- }
-
- // Feature unit
- if (entityID == 2)
- {
- switch ( ctrlSel )
- {
- case AUDIO_FU_CTRL_MUTE:
- // Audio control mute cur parameter block consists of only one byte - we thus can send it right away
- // There does not exist a range parameter block for mute
- TU_LOG2(" Get Mute of channel: %u\r\n", channelNum);
- return tud_control_xfer(rhport, p_request, &mute[channelNum], 1);
-
- case AUDIO_FU_CTRL_VOLUME:
- switch ( p_request->bRequest )
- {
- case AUDIO_CS_REQ_CUR:
- TU_LOG2(" Get Volume of channel: %u\r\n", channelNum);
- return tud_control_xfer(rhport, p_request, &volume[channelNum], sizeof(volume[channelNum]));
-
- case AUDIO_CS_REQ_RANGE:
- TU_LOG2(" Get Volume range of channel: %u\r\n", channelNum);
-
- // Copy values - only for testing - better is version below
- audio_control_range_2_n_t(1)
- ret;
-
- ret.wNumSubRanges = 1;
- ret.subrange[0].bMin = -90; // -90 dB
- ret.subrange[0].bMax = 90; // +90 dB
- ret.subrange[0].bRes = 1; // 1 dB steps
-
- return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, (void*) &ret, sizeof(ret));
-
- // Unknown/Unsupported control
- default:
- TU_BREAKPOINT();
- return false;
- }
- break;
-
- // Unknown/Unsupported control
- default:
- TU_BREAKPOINT();
- return false;
- }
- }
-
- // Clock Source unit
- if ( entityID == 4 )
- {
- switch ( ctrlSel )
- {
- case AUDIO_CS_CTRL_SAM_FREQ:
- // channelNum is always zero in this case
- switch ( p_request->bRequest )
- {
- case AUDIO_CS_REQ_CUR:
- TU_LOG2(" Get Sample Freq.\r\n");
- return tud_control_xfer(rhport, p_request, &sampFreq, sizeof(sampFreq));
-
- case AUDIO_CS_REQ_RANGE:
- TU_LOG2(" Get Sample Freq. range\r\n");
- return tud_control_xfer(rhport, p_request, &sampleFreqRng, sizeof(sampleFreqRng));
-
- // Unknown/Unsupported control
- default:
- TU_BREAKPOINT();
- return false;
- }
- break;
-
- case AUDIO_CS_CTRL_CLK_VALID:
- // Only cur attribute exists for this request
- TU_LOG2(" Get Sample Freq. valid\r\n");
- return tud_control_xfer(rhport, p_request, &clkValid, sizeof(clkValid));
-
- // Unknown/Unsupported control
- default:
- TU_BREAKPOINT();
- return false;
- }
- }
-
- TU_LOG2(" Unsupported entity: %d\r\n", entityID);
- return false; // Yet not implemented
-}
-
-bool tud_audio_tx_done_pre_load_cb(uint8_t rhport, uint8_t itf, uint8_t ep_in, uint8_t cur_alt_setting)
-{
- (void) rhport;
- (void) itf;
- (void) ep_in;
- (void) cur_alt_setting;
-
- tud_audio_write ((uint8_t *)test_buffer_audio, CFG_TUD_AUDIO_EP_SZ_IN);
-
- return true;
-}
-
-bool tud_audio_tx_done_post_load_cb(uint8_t rhport, uint16_t n_bytes_copied, uint8_t itf, uint8_t ep_in, uint8_t cur_alt_setting)
-{
- (void) rhport;
- (void) n_bytes_copied;
- (void) itf;
- (void) ep_in;
- (void) cur_alt_setting;
-
- for (size_t cnt = 0; cnt < CFG_TUD_AUDIO_EP_SZ_IN/2; cnt++)
- {
- test_buffer_audio[cnt] = startVal++;
- }
-
- return true;
-}
-
-bool tud_audio_set_itf_close_EP_cb(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- (void) rhport;
- (void) p_request;
- startVal = 0;
-
- return true;
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/audio_test/src/plot_audio_samples.py b/tinyusb/examples/device/audio_test/src/plot_audio_samples.py
deleted file mode 100755
index 6e3c4978..00000000
--- a/tinyusb/examples/device/audio_test/src/plot_audio_samples.py
+++ /dev/null
@@ -1,34 +0,0 @@
-import sounddevice as sd
-import matplotlib.pyplot as plt
-import numpy as np
-import platform
-
-if __name__ == '__main__':
-
- # If you got "ValueError: No input device matching", that is because your PC name example device
- # differently from tested list below. Uncomment the next line to see full list and try to pick correct one
- # print(sd.query_devices())
-
- fs = 48000 # Sample rate
- duration = 100e-3 # Duration of recording
-
- if platform.system() == 'Windows':
- # MME is needed since there are more than one MicNode device APIs (at least in Windows)
- device = 'Microphone (MicNode) MME'
- elif platform.system() == 'Darwin':
- device = 'MicNode'
- else:
- device ='default'
-
- myrecording = sd.rec(int(duration * fs), samplerate=fs, channels=1, dtype='int16', device=device)
- print('Waiting...')
- sd.wait() # Wait until recording is finished
- print('Done!')
-
- time = np.arange(0, duration, 1 / fs) # time vector
- plt.plot(time, myrecording)
- plt.xlabel('Time [s]')
- plt.ylabel('Amplitude')
- plt.title('MicNode')
- plt.show()
- \ No newline at end of file
diff --git a/tinyusb/examples/device/audio_test/src/tusb_config.h b/tinyusb/examples/device/audio_test/src/tusb_config.h
deleted file mode 100755
index 683a1a56..00000000
--- a/tinyusb/examples/device/audio_test/src/tusb_config.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by compiler flags for flexibility
-#ifndef CFG_TUSB_MCU
-#error CFG_TUSB_MCU must be defined
-#endif
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
-#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED)
-#else
-#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-#ifndef CFG_TUSB_DEBUG
-#define CFG_TUSB_DEBUG 0
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 0
-#define CFG_TUD_HID 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_AUDIO 1
-#define CFG_TUD_VENDOR 0
-
-//--------------------------------------------------------------------
-// AUDIO CLASS DRIVER CONFIGURATION
-//--------------------------------------------------------------------
-
-// Have a look into audio_device.h for all configurations
-
-#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_MIC_ONE_CH_DESC_LEN
-#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 1 // Number of Standard AS Interface Descriptors (4.9.1) defined per audio function - this is required to be able to remember the current alternate settings of these interfaces - We restrict us here to have a constant number for all audio functions (which means this has to be the maximum number of AS interfaces an audio function has and a second audio function with less AS interfaces just wastes a few bytes)
-#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64 // Size of control request buffer
-
-#define CFG_TUD_AUDIO_ENABLE_EP_IN 1
-#define CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX 2 // Driver gets this info from the descriptors - we define it here to use it to setup the descriptors and to do calculations with it below
-#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 1 // Driver gets this info from the descriptors - we define it here to use it to setup the descriptors and to do calculations with it below - be aware: for different number of channels you need another descriptor!
-#define CFG_TUD_AUDIO_EP_SZ_IN 48 * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX // 48 Samples (48 kHz) x 2 Bytes/Sample x 1 Channel
-#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_EP_SZ_IN // Maximum EP IN size for all AS alternate settings used
-#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ CFG_TUD_AUDIO_EP_SZ_IN + 1
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/audio_test/src/usb_descriptors.c b/tinyusb/examples/device/audio_test/src/usb_descriptors.c
deleted file mode 100755
index 67dd34d2..00000000
--- a/tinyusb/examples/device/audio_test/src/usb_descriptors.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] AUDIO | MIDI | HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(AUDIO, 4) | _PID_MAP(VENDOR, 5) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
-
- // Use Interface Association Descriptor (IAD) for CDC
- // As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
- .bDeviceClass = TUSB_CLASS_MISC,
- .bDeviceSubClass = MISC_SUBCLASS_COMMON,
- .bDeviceProtocol = MISC_PROTOCOL_IAD,
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-enum
-{
- ITF_NUM_AUDIO_CONTROL = 0,
- ITF_NUM_AUDIO_STREAMING,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + CFG_TUD_AUDIO * TUD_AUDIO_MIC_ONE_CH_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
-// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
-// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
-#define EPNUM_AUDIO 0x03
-#else
-#define EPNUM_AUDIO 0x01
-#endif
-
-uint8_t const desc_configuration[] =
-{
- // Interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_AUDIO_MIC_ONE_CH_DESCRIPTOR(/*_itfnum*/ ITF_NUM_AUDIO_CONTROL, /*_stridx*/ 0, /*_nBytesPerSample*/ CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX, /*_nBitsUsedPerSample*/ CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX*8, /*_epin*/ 0x80 | EPNUM_AUDIO, /*_epsize*/ CFG_TUD_AUDIO_EP_SZ_IN)
-};
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
- return desc_configuration;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "PaniRCorp", // 1: Manufacturer
- "MicNode", // 2: Product
- "123456", // 3: Serials, should use chip ID
- "UAC2", // 4: Audio Interface
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Convert ASCII string into UTF-16
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/board_test/CMakeLists.txt b/tinyusb/examples/device/board_test/CMakeLists.txt
deleted file mode 100755
index 37113578..00000000
--- a/tinyusb/examples/device/board_test/CMakeLists.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# Check for -DFAMILY=
-if(FAMILY MATCHES "^esp32s[2-3]")
- # use BOARD-Directory name for project id
- get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
- set(PROJECT ${BOARD}-${PROJECT})
-
- # TOP is absolute path to root directory of TinyUSB git repo
- set(TOP "../../..")
- get_filename_component(TOP "${TOP}" REALPATH)
-
- project(${PROJECT})
-
-else()
-
- # gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
- family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
- project(${PROJECT})
-
- # Checks this example is valid for the family and initializes the project
- family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
- add_executable(${PROJECT})
-
- # Example source
- target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- )
-
- # Example include
- target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
- # Configure compilation flags and libraries for the example... see the corresponding function
- # in hw/bsp/FAMILY/family.cmake for details.
- family_configure_device_example(${PROJECT})
-endif()
diff --git a/tinyusb/examples/device/board_test/Makefile b/tinyusb/examples/device/board_test/Makefile
deleted file mode 100755
index b65575ce..00000000
--- a/tinyusb/examples/device/board_test/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-# board_test example is special example that doesn't enable device or host stack
-# This can cause some TinyUSB API missing, this hack to allow us to fill those API
-# to pass the compilation process
-CFLAGS += \
- -D"tud_int_handler(x)= " \
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/board_test/sdkconfig.defaults b/tinyusb/examples/device/board_test/sdkconfig.defaults
deleted file mode 100755
index 83871619..00000000
--- a/tinyusb/examples/device/board_test/sdkconfig.defaults
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_IDF_CMAKE=y
-CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
-CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
diff --git a/tinyusb/examples/device/board_test/src/CMakeLists.txt b/tinyusb/examples/device/board_test/src/CMakeLists.txt
deleted file mode 100755
index e4e1f4e9..00000000
--- a/tinyusb/examples/device/board_test/src/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-# FAMILY = esp32sx
-idf_component_register(SRCS "main.c"
- INCLUDE_DIRS "."
- REQUIRES freertos soc)
-
-file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake)
-
-if(EXISTS ${board_cmake})
- include(${board_cmake})
-endif()
-
-idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
-target_include_directories(${COMPONENT_TARGET} PUBLIC
- "${FREERTOS_ORIG_INCLUDE_PATH}"
- "${TOP}/hw"
- "${TOP}/src"
-)
diff --git a/tinyusb/examples/device/board_test/src/main.c b/tinyusb/examples/device/board_test/src/main.c
deleted file mode 100755
index c77dd564..00000000
--- a/tinyusb/examples/device/board_test/src/main.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 250 ms : button is not pressed
- * - 1000 ms : button is pressed (and hold)
- */
-enum {
- BLINK_PRESSED = 250,
- BLINK_UNPRESSED = 1000
-};
-
-#define HELLO_STR "Hello from TinyUSB\r\n"
-
-int main(void)
-{
- board_init();
-
- uint32_t start_ms = 0;
- bool led_state = false;
-
- while (1)
- {
- uint32_t interval_ms = board_button_read() ? BLINK_PRESSED : BLINK_UNPRESSED;
-
- // Blink every interval ms
- if ( !(board_millis() - start_ms < interval_ms) )
- {
- board_uart_write(HELLO_STR, strlen(HELLO_STR));
-
- start_ms = board_millis();
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
- }
- }
-
- return 0;
-}
-
-#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
-void app_main(void)
-{
- main();
-}
-#endif
diff --git a/tinyusb/examples/device/board_test/src/tusb_config.h b/tinyusb/examples/device/board_test/src/tusb_config.h
deleted file mode 100755
index da33729e..00000000
--- a/tinyusb/examples/device/board_test/src/tusb_config.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by compiler flags for flexibility
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-#ifndef CFG_TUSB_OS
- #define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-#define CFG_TUSB_RHPORT0_MODE OPT_MODE_NONE
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 0
-#define CFG_TUD_HID 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_VENDOR 0
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/cdc_dual_ports/CMakeLists.txt b/tinyusb/examples/device/cdc_dual_ports/CMakeLists.txt
deleted file mode 100755
index abc4d91d..00000000
--- a/tinyusb/examples/device/cdc_dual_ports/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/cdc_dual_ports/Makefile b/tinyusb/examples/device/cdc_dual_ports/Makefile
deleted file mode 100755
index 5a455078..00000000
--- a/tinyusb/examples/device/cdc_dual_ports/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/cdc_dual_ports/src/main.c b/tinyusb/examples/device/cdc_dual_ports/src/main.c
deleted file mode 100755
index 34cd29ed..00000000
--- a/tinyusb/examples/device/cdc_dual_ports/src/main.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//------------- prototypes -------------//
-static void cdc_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- cdc_task();
- }
-
- return 0;
-}
-
-// echo to either Serial0 or Serial1
-// with Serial0 as all lower case, Serial1 as all upper case
-static void echo_serial_port(uint8_t itf, uint8_t buf[], uint32_t count)
-{
- for(uint32_t i=0; i<count; i++)
- {
- if (itf == 0)
- {
- // echo back 1st port as lower case
- if (isupper(buf[i])) buf[i] += 'a' - 'A';
- }
- else
- {
- // echo back 2nd port as upper case
- if (islower(buf[i])) buf[i] -= 'a' - 'A';
- }
-
- tud_cdc_n_write_char(itf, buf[i]);
- }
- tud_cdc_n_write_flush(itf);
-}
-
-//--------------------------------------------------------------------+
-// USB CDC
-//--------------------------------------------------------------------+
-static void cdc_task(void)
-{
- uint8_t itf;
-
- for (itf = 0; itf < CFG_TUD_CDC; itf++)
- {
- // connected() check for DTR bit
- // Most but not all terminal client set this when making connection
- // if ( tud_cdc_n_connected(itf) )
- {
- if ( tud_cdc_n_available(itf) )
- {
- uint8_t buf[64];
-
- uint32_t count = tud_cdc_n_read(itf, buf, sizeof(buf));
-
- // echo back to both serial ports
- echo_serial_port(0, buf, count);
- echo_serial_port(1, buf, count);
- }
- }
- }
-}
diff --git a/tinyusb/examples/device/cdc_dual_ports/src/tusb_config.h b/tinyusb/examples/device/cdc_dual_ports/src/tusb_config.h
deleted file mode 100755
index ff8535d1..00000000
--- a/tinyusb/examples/device/cdc_dual_ports/src/tusb_config.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56 || CFG_TUSB_MCU == OPT_MCU_SAMX7X)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 2
-#define CFG_TUD_MSC 0
-#define CFG_TUD_HID 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_VENDOR 0
-
-// CDC FIFO size of TX and RX
-#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-
-// CDC Endpoint transfer buffer size, more is faster
-#define CFG_TUD_CDC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/cdc_dual_ports/src/usb_descriptors.c b/tinyusb/examples/device/cdc_dual_ports/src/usb_descriptors.c
deleted file mode 100755
index b935b672..00000000
--- a/tinyusb/examples/device/cdc_dual_ports/src/usb_descriptors.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] MIDI | HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
-
- // Use Interface Association Descriptor (IAD) for CDC
- // As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
- .bDeviceClass = TUSB_CLASS_MISC,
- .bDeviceSubClass = MISC_SUBCLASS_COMMON,
- .bDeviceProtocol = MISC_PROTOCOL_IAD,
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-enum
-{
- ITF_NUM_CDC_0 = 0,
- ITF_NUM_CDC_0_DATA,
- ITF_NUM_CDC_1,
- ITF_NUM_CDC_1_DATA,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + CFG_TUD_CDC * TUD_CDC_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
- // LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
- // 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
- #define EPNUM_CDC_0_NOTIF 0x81
- #define EPNUM_CDC_0_OUT 0x02
- #define EPNUM_CDC_0_IN 0x82
-
- #define EPNUM_CDC_1_NOTIF 0x84
- #define EPNUM_CDC_1_OUT 0x05
- #define EPNUM_CDC_1_IN 0x85
-
-#elif CFG_TUSB_MCU == OPT_MCU_SAMG || CFG_TUSB_MCU == OPT_MCU_SAMX7X
- // SAMG & SAME70 don't support a same endpoint number with different direction IN and OUT
- // e.g EP1 OUT & EP1 IN cannot exist together
- #define EPNUM_CDC_0_NOTIF 0x81
- #define EPNUM_CDC_0_OUT 0x02
- #define EPNUM_CDC_0_IN 0x83
-
- #define EPNUM_CDC_1_NOTIF 0x84
- #define EPNUM_CDC_1_OUT 0x05
- #define EPNUM_CDC_1_IN 0x86
-
-#else
- #define EPNUM_CDC_0_NOTIF 0x81
- #define EPNUM_CDC_0_OUT 0x02
- #define EPNUM_CDC_0_IN 0x82
-
- #define EPNUM_CDC_1_NOTIF 0x83
- #define EPNUM_CDC_1_OUT 0x04
- #define EPNUM_CDC_1_IN 0x84
-#endif
-
-uint8_t const desc_fs_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // 1st CDC: Interface number, string index, EP notification address and size, EP data address (out, in) and size.
- TUD_CDC_DESCRIPTOR(ITF_NUM_CDC_0, 4, EPNUM_CDC_0_NOTIF, 8, EPNUM_CDC_0_OUT, EPNUM_CDC_0_IN, 64),
-
- // 2nd CDC: Interface number, string index, EP notification address and size, EP data address (out, in) and size.
- TUD_CDC_DESCRIPTOR(ITF_NUM_CDC_1, 4, EPNUM_CDC_1_NOTIF, 8, EPNUM_CDC_1_OUT, EPNUM_CDC_1_IN, 64),
-};
-
-#if TUD_OPT_HIGH_SPEED
-uint8_t const desc_hs_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // 1st CDC: Interface number, string index, EP notification address and size, EP data address (out, in) and size.
- TUD_CDC_DESCRIPTOR(ITF_NUM_CDC_0, 4, EPNUM_CDC_0_NOTIF, 8, EPNUM_CDC_0_OUT, EPNUM_CDC_0_IN, 512),
-
- // 2nd CDC: Interface number, string index, EP notification address and size, EP data address (out, in) and size.
- TUD_CDC_DESCRIPTOR(ITF_NUM_CDC_1, 4, EPNUM_CDC_1_NOTIF, 8, EPNUM_CDC_1_OUT, EPNUM_CDC_1_IN, 512),
-};
-#endif
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
-
-#if TUD_OPT_HIGH_SPEED
- // Although we are highspeed, host may be fullspeed.
- return (tud_speed_get() == TUSB_SPEED_HIGH) ? desc_hs_configuration : desc_fs_configuration;
-#else
- return desc_fs_configuration;
-#endif
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
- "TinyUSB CDC", // 4: CDC Interface
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/cdc_msc/.skip.MCU_SAMD11 b/tinyusb/examples/device/cdc_msc/.skip.MCU_SAMD11
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/cdc_msc/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/tinyusb/examples/device/cdc_msc/CMakeLists.txt b/tinyusb/examples/device/cdc_msc/CMakeLists.txt
deleted file mode 100755
index fa6e83b7..00000000
--- a/tinyusb/examples/device/cdc_msc/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/cdc_msc/Makefile b/tinyusb/examples/device/cdc_msc/Makefile
deleted file mode 100755
index 69b633fe..00000000
--- a/tinyusb/examples/device/cdc_msc/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/cdc_msc/src/main.c b/tinyusb/examples/device/cdc_msc/src/main.c
deleted file mode 100755
index 131ae654..00000000
--- a/tinyusb/examples/device/cdc_msc/src/main.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-void led_blinking_task(void);
-void cdc_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
-
- cdc_task();
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-
-//--------------------------------------------------------------------+
-// USB CDC
-//--------------------------------------------------------------------+
-void cdc_task(void)
-{
- // connected() check for DTR bit
- // Most but not all terminal client set this when making connection
- // if ( tud_cdc_connected() )
- {
- // connected and there are data available
- if ( tud_cdc_available() )
- {
- // read datas
- char buf[64];
- uint32_t count = tud_cdc_read(buf, sizeof(buf));
- (void) count;
-
- // Echo back
- // Note: Skip echo by commenting out write() and write_flush()
- // for throughput test e.g
- // $ dd if=/dev/zero of=/dev/ttyACM0 count=10000
- tud_cdc_write(buf, count);
- tud_cdc_write_flush();
- }
- }
-}
-
-// Invoked when cdc when line state changed e.g connected/disconnected
-void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
-{
- (void) itf;
- (void) rts;
-
- // TODO set some indicator
- if ( dtr )
- {
- // Terminal connected
- }else
- {
- // Terminal disconnected
- }
-}
-
-// Invoked when CDC interface received data from host
-void tud_cdc_rx_cb(uint8_t itf)
-{
- (void) itf;
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/cdc_msc/src/msc_disk.c b/tinyusb/examples/device/cdc_msc/src/msc_disk.c
deleted file mode 100755
index 503baace..00000000
--- a/tinyusb/examples/device/cdc_msc/src/msc_disk.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-#if CFG_TUD_MSC
-
-// whether host does safe-eject
-static bool ejected = false;
-
-// Some MCU doesn't have enough 8KB SRAM to store the whole disk
-// We will use Flash as read-only disk with board that has
-// CFG_EXAMPLE_MSC_READONLY defined
-
-#define README_CONTENTS \
-"This is tinyusb's MassStorage Class demo.\r\n\r\n\
-If you find any bugs or get any questions, feel free to file an\r\n\
-issue at github.com/hathach/tinyusb"
-
-enum
-{
- DISK_BLOCK_NUM = 16, // 8KB is the smallest size that windows allow to mount
- DISK_BLOCK_SIZE = 512
-};
-
-#ifdef CFG_EXAMPLE_MSC_READONLY
-const
-#endif
-uint8_t msc_disk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
-{
- //------------- Block0: Boot Sector -------------//
- // byte_per_sector = DISK_BLOCK_SIZE; fat12_sector_num_16 = DISK_BLOCK_NUM;
- // sector_per_cluster = 1; reserved_sectors = 1;
- // fat_num = 1; fat12_root_entry_num = 16;
- // sector_per_fat = 1; sector_per_track = 1; head_num = 1; hidden_sectors = 0;
- // drive_number = 0x80; media_type = 0xf8; extended_boot_signature = 0x29;
- // filesystem_type = "FAT12 "; volume_serial_number = 0x1234; volume_label = "TinyUSB MSC";
- // FAT magic code at offset 510-511
- {
- 0xEB, 0x3C, 0x90, 0x4D, 0x53, 0x44, 0x4F, 0x53, 0x35, 0x2E, 0x30, 0x00, 0x02, 0x01, 0x01, 0x00,
- 0x01, 0x10, 0x00, 0x10, 0x00, 0xF8, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x29, 0x34, 0x12, 0x00, 0x00, 'T' , 'i' , 'n' , 'y' , 'U' ,
- 'S' , 'B' , ' ' , 'M' , 'S' , 'C' , 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00,
-
- // Zero up to 2 last bytes of FAT magic code
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA
- },
-
- //------------- Block1: FAT12 Table -------------//
- {
- 0xF8, 0xFF, 0xFF, 0xFF, 0x0F // // first 2 entries must be F8FF, third entry is cluster end of readme file
- },
-
- //------------- Block2: Root Directory -------------//
- {
- // first entry is volume label
- 'T' , 'i' , 'n' , 'y' , 'U' , 'S' , 'B' , ' ' , 'M' , 'S' , 'C' , 0x08, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x6D, 0x65, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // second entry is readme file
- 'R' , 'E' , 'A' , 'D' , 'M' , 'E' , ' ' , ' ' , 'T' , 'X' , 'T' , 0x20, 0x00, 0xC6, 0x52, 0x6D,
- 0x65, 0x43, 0x65, 0x43, 0x00, 0x00, 0x88, 0x6D, 0x65, 0x43, 0x02, 0x00,
- sizeof(README_CONTENTS)-1, 0x00, 0x00, 0x00 // readme's files size (4 Bytes)
- },
-
- //------------- Block3: Readme Content -------------//
- README_CONTENTS
-};
-
-// Invoked when received SCSI_CMD_INQUIRY
-// Application fill vendor id, product id and revision with string up to 8, 16, 4 characters respectively
-void tud_msc_inquiry_cb(uint8_t lun, uint8_t vendor_id[8], uint8_t product_id[16], uint8_t product_rev[4])
-{
- (void) lun;
-
- const char vid[] = "TinyUSB";
- const char pid[] = "Mass Storage";
- const char rev[] = "1.0";
-
- memcpy(vendor_id , vid, strlen(vid));
- memcpy(product_id , pid, strlen(pid));
- memcpy(product_rev, rev, strlen(rev));
-}
-
-// Invoked when received Test Unit Ready command.
-// return true allowing host to read/write this LUN e.g SD card inserted
-bool tud_msc_test_unit_ready_cb(uint8_t lun)
-{
- (void) lun;
-
- // RAM disk is ready until ejected
- if (ejected) {
- tud_msc_set_sense(lun, SCSI_SENSE_NOT_READY, 0x3a, 0x00);
- return false;
- }
-
- return true;
-}
-
-// Invoked when received SCSI_CMD_READ_CAPACITY_10 and SCSI_CMD_READ_FORMAT_CAPACITY to determine the disk size
-// Application update block count and block size
-void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_size)
-{
- (void) lun;
-
- *block_count = DISK_BLOCK_NUM;
- *block_size = DISK_BLOCK_SIZE;
-}
-
-// Invoked when received Start Stop Unit command
-// - Start = 0 : stopped power mode, if load_eject = 1 : unload disk storage
-// - Start = 1 : active mode, if load_eject = 1 : load disk storage
-bool tud_msc_start_stop_cb(uint8_t lun, uint8_t power_condition, bool start, bool load_eject)
-{
- (void) lun;
- (void) power_condition;
-
- if ( load_eject )
- {
- if (start)
- {
- // load disk storage
- }else
- {
- // unload disk storage
- ejected = true;
- }
- }
-
- return true;
-}
-
-// Callback invoked when received READ10 command.
-// Copy disk's data to buffer (up to bufsize) and return number of copied bytes.
-int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize)
-{
- (void) lun;
-
- uint8_t const* addr = msc_disk[lba] + offset;
- memcpy(buffer, addr, bufsize);
-
- return bufsize;
-}
-
-// Callback invoked when received WRITE10 command.
-// Process data in buffer to disk's storage and return number of written bytes
-int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize)
-{
- (void) lun;
-
-#ifndef CFG_EXAMPLE_MSC_READONLY
- uint8_t* addr = msc_disk[lba] + offset;
- memcpy(addr, buffer, bufsize);
-#else
- (void) lba; (void) offset; (void) buffer;
-#endif
-
- return bufsize;
-}
-
-// Callback invoked when received an SCSI command not in built-in list below
-// - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, MODE_SENSE6, REQUEST_SENSE
-// - READ10 and WRITE10 has their own callbacks
-int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize)
-{
- // read10 & write10 has their own callback and MUST not be handled here
-
- void const* response = NULL;
- uint16_t resplen = 0;
-
- // most scsi handled is input
- bool in_xfer = true;
-
- switch (scsi_cmd[0])
- {
- case SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL:
- // Host is about to read/write etc ... better not to disconnect disk
- resplen = 0;
- break;
-
- default:
- // Set Sense = Invalid Command Operation
- tud_msc_set_sense(lun, SCSI_SENSE_ILLEGAL_REQUEST, 0x20, 0x00);
-
- // negative means error -> tinyusb could stall and/or response with failed status
- resplen = -1;
- break;
- }
-
- // return resplen must not larger than bufsize
- if ( resplen > bufsize ) resplen = bufsize;
-
- if ( response && (resplen > 0) )
- {
- if(in_xfer)
- {
- memcpy(buffer, response, resplen);
- }else
- {
- // SCSI output
- }
- }
-
- return resplen;
-}
-
-#endif
diff --git a/tinyusb/examples/device/cdc_msc/src/tusb_config.h b/tinyusb/examples/device/cdc_msc/src/tusb_config.h
deleted file mode 100755
index bf6af06b..00000000
--- a/tinyusb/examples/device/cdc_msc/src/tusb_config.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56 || CFG_TUSB_MCU == OPT_MCU_SAMX7X)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-// This example doesn't use an RTOS
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 1
-#define CFG_TUD_MSC 1
-#define CFG_TUD_HID 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_VENDOR 0
-
-// CDC FIFO size of TX and RX
-#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-
-// CDC Endpoint transfer buffer size, more is faster
-#define CFG_TUD_CDC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-
-// MSC Buffer size of Device Mass storage
-#define CFG_TUD_MSC_EP_BUFSIZE 512
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/cdc_msc/src/usb_descriptors.c b/tinyusb/examples/device/cdc_msc/src/usb_descriptors.c
deleted file mode 100755
index 1a89ce56..00000000
--- a/tinyusb/examples/device/cdc_msc/src/usb_descriptors.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
-
- // Use Interface Association Descriptor (IAD) for CDC
- // As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
- .bDeviceClass = TUSB_CLASS_MISC,
- .bDeviceSubClass = MISC_SUBCLASS_COMMON,
- .bDeviceProtocol = MISC_PROTOCOL_IAD,
-
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-enum
-{
- ITF_NUM_CDC = 0,
- ITF_NUM_CDC_DATA,
- ITF_NUM_MSC,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_CDC_DESC_LEN + TUD_MSC_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
- // LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
- // 0 control, 1 In, 2 Bulk, 3 Iso, 4 In, 5 Bulk etc ...
- #define EPNUM_CDC_NOTIF 0x81
- #define EPNUM_CDC_OUT 0x02
- #define EPNUM_CDC_IN 0x82
-
- #define EPNUM_MSC_OUT 0x05
- #define EPNUM_MSC_IN 0x85
-
-#elif CFG_TUSB_MCU == OPT_MCU_SAMG || CFG_TUSB_MCU == OPT_MCU_SAMX7X
- // SAMG & SAME70 don't support a same endpoint number with different direction IN and OUT
- // e.g EP1 OUT & EP1 IN cannot exist together
- #define EPNUM_CDC_NOTIF 0x81
- #define EPNUM_CDC_OUT 0x02
- #define EPNUM_CDC_IN 0x83
-
- #define EPNUM_MSC_OUT 0x04
- #define EPNUM_MSC_IN 0x85
-
-#elif CFG_TUSB_MCU == OPT_MCU_CXD56
- // CXD56 doesn't support a same endpoint number with different direction IN and OUT
- // e.g EP1 OUT & EP1 IN cannot exist together
- // CXD56 USB driver has fixed endpoint type (bulk/interrupt/iso) and direction (IN/OUT) by its number
- // 0 control (IN/OUT), 1 Bulk (IN), 2 Bulk (OUT), 3 In (IN), 4 Bulk (IN), 5 Bulk (OUT), 6 In (IN)
- #define EPNUM_CDC_NOTIF 0x83
- #define EPNUM_CDC_OUT 0x02
- #define EPNUM_CDC_IN 0x81
-
- #define EPNUM_MSC_OUT 0x05
- #define EPNUM_MSC_IN 0x84
-
-#else
- #define EPNUM_CDC_NOTIF 0x81
- #define EPNUM_CDC_OUT 0x02
- #define EPNUM_CDC_IN 0x82
-
- #define EPNUM_MSC_OUT 0x03
- #define EPNUM_MSC_IN 0x83
-
-#endif
-
-uint8_t const desc_fs_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP notification address and size, EP data address (out, in) and size.
- TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, EPNUM_CDC_NOTIF, 8, EPNUM_CDC_OUT, EPNUM_CDC_IN, 64),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 5, EPNUM_MSC_OUT, EPNUM_MSC_IN, 64),
-};
-
-#if TUD_OPT_HIGH_SPEED
-uint8_t const desc_hs_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP notification address and size, EP data address (out, in) and size.
- TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, EPNUM_CDC_NOTIF, 8, EPNUM_CDC_OUT, EPNUM_CDC_IN, 512),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 5, EPNUM_MSC_OUT, EPNUM_MSC_IN, 512),
-};
-#endif
-
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
-
-#if TUD_OPT_HIGH_SPEED
- // Although we are highspeed, host may be fullspeed.
- return (tud_speed_get() == TUSB_SPEED_HIGH) ? desc_hs_configuration : desc_fs_configuration;
-#else
- return desc_fs_configuration;
-#endif
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
- "TinyUSB CDC", // 4: CDC Interface
- "TinyUSB MSC", // 5: MSC Interface
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_CXD56 b/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_CXD56
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_CXD56
+++ /dev/null
diff --git a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_EFM32GG12 b/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_EFM32GG12
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_EFM32GG12
+++ /dev/null
diff --git a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_GD32VF103 b/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_GD32VF103
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_GD32VF103
+++ /dev/null
diff --git a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_MKL25ZXX b/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_MKL25ZXX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_MKL25ZXX
+++ /dev/null
diff --git a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_MSP430x5xx b/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_MSP430x5xx
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_MSP430x5xx
+++ /dev/null
diff --git a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_RP2040 b/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_RP2040
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_RP2040
+++ /dev/null
diff --git a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_SAMD11 b/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_SAMD11
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_SAMX7X b/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_SAMX7X
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_SAMX7X
+++ /dev/null
diff --git a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_VALENTYUSB_EPTRI b/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_VALENTYUSB_EPTRI
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/.skip.MCU_VALENTYUSB_EPTRI
+++ /dev/null
diff --git a/tinyusb/examples/device/cdc_msc_freertos/CMakeLists.txt b/tinyusb/examples/device/cdc_msc_freertos/CMakeLists.txt
deleted file mode 100755
index 639dde99..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-# TOP is absolute path to root directory of TinyUSB git repo
-# needed for esp32sx build. TOOD could be removed later on
-set(TOP "../../..")
-get_filename_component(TOP "${TOP}" REALPATH)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-# Check for -DFAMILY=
-if(FAMILY MATCHES "^esp32s[2-3]")
-else()
- message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
-endif()
diff --git a/tinyusb/examples/device/cdc_msc_freertos/Makefile b/tinyusb/examples/device/cdc_msc_freertos/Makefile
deleted file mode 100755
index 86bacd2d..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-DEPS_SUBMODULES += lib/FreeRTOS-Kernel
-
-include ../../../tools/top.mk
-include ../../make.mk
-
-FREERTOS_SRC = lib/FreeRTOS-Kernel
-
-INC += \
- src \
- $(TOP)/hw \
- $(TOP)/$(FREERTOS_SRC)/include \
- $(TOP)/$(FREERTOS_SRC)/portable/GCC/$(FREERTOS_PORT)
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-# FreeRTOS source, all files in port folder
-SRC_C += \
- $(FREERTOS_SRC)/list.c \
- $(FREERTOS_SRC)/queue.c \
- $(FREERTOS_SRC)/tasks.c \
- $(FREERTOS_SRC)/timers.c \
- $(subst ../../../,,$(wildcard ../../../$(FREERTOS_SRC)/portable/GCC/$(FREERTOS_PORT)/*.c))
-
-# FreeRTOS (lto + Os) linker issue
-LDFLAGS += -Wl,--undefined=vTaskSwitchContext
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/cdc_msc_freertos/sdkconfig.defaults b/tinyusb/examples/device/cdc_msc_freertos/sdkconfig.defaults
deleted file mode 100755
index 83871619..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/sdkconfig.defaults
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_IDF_CMAKE=y
-CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
-CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
diff --git a/tinyusb/examples/device/cdc_msc_freertos/src/CMakeLists.txt b/tinyusb/examples/device/cdc_msc_freertos/src/CMakeLists.txt
deleted file mode 100755
index 6b188fd3..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/src/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-idf_component_register(SRCS "main.c" "usb_descriptors.c" "msc_disk.c"
- INCLUDE_DIRS "."
- REQUIRES freertos soc)
-
-file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake)
-
-if(EXISTS ${board_cmake})
- include(${board_cmake})
-endif()
-
-idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
-target_include_directories(${COMPONENT_TARGET} PUBLIC
- "${FREERTOS_ORIG_INCLUDE_PATH}"
- "${TOP}/hw"
- "${TOP}/src"
-)
-
-target_sources(${COMPONENT_TARGET} PUBLIC
- "${TOP}/src/tusb.c"
- "${TOP}/src/common/tusb_fifo.c"
- "${TOP}/src/device/usbd.c"
- "${TOP}/src/device/usbd_control.c"
- "${TOP}/src/class/cdc/cdc_device.c"
- "${TOP}/src/class/dfu/dfu_rt_device.c"
- "${TOP}/src/class/hid/hid_device.c"
- "${TOP}/src/class/midi/midi_device.c"
- "${TOP}/src/class/msc/msc_device.c"
- "${TOP}/src/class/net/net_device.c"
- "${TOP}/src/class/usbtmc/usbtmc_device.c"
- "${TOP}/src/class/vendor/vendor_device.c"
- "${TOP}/src/portable/espressif/esp32sx/dcd_esp32sx.c"
-)
diff --git a/tinyusb/examples/device/cdc_msc_freertos/src/FreeRTOSConfig.h b/tinyusb/examples/device/cdc_msc_freertos/src/FreeRTOSConfig.h
deleted file mode 100755
index 568b27a1..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/src/FreeRTOSConfig.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * FreeRTOS Kernel V10.0.0
- * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * 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. If you wish to use our Amazon
- * FreeRTOS name, please do so in a fair use way that does not cause confusion.
- *
- * 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.
- *
- * http://www.FreeRTOS.org
- * http://aws.amazon.com/freertos
- *
- * 1 tab == 4 spaces!
- */
-
-
-#ifndef FREERTOS_CONFIG_H
-#define FREERTOS_CONFIG_H
-
-/*-----------------------------------------------------------
- * Application specific definitions.
- *
- * These definitions should be adjusted for your particular hardware and
- * application requirements.
- *
- * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
- * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
- *
- * See http://www.freertos.org/a00110.html.
- *----------------------------------------------------------*/
-
-// Include MCU header
-#include "bsp/board_mcu.h"
-
-extern uint32_t SystemCoreClock;
-
-/* Cortex M23/M33 port configuration. */
-#define configENABLE_MPU 0
-#define configENABLE_FPU 1
-#define configENABLE_TRUSTZONE 0
-#define configMINIMAL_SECURE_STACK_SIZE ( 1024 )
-
-#define configUSE_PREEMPTION 1
-#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
-#define configCPU_CLOCK_HZ SystemCoreClock
-#define configTICK_RATE_HZ ( 1000 )
-#define configMAX_PRIORITIES ( 5 )
-#define configMINIMAL_STACK_SIZE ( 128 )
-#define configTOTAL_HEAP_SIZE ( 0*1024 ) // dynamic is not used
-#define configMAX_TASK_NAME_LEN 16
-#define configUSE_16_BIT_TICKS 0
-#define configIDLE_SHOULD_YIELD 1
-#define configUSE_MUTEXES 1
-#define configUSE_RECURSIVE_MUTEXES 1
-#define configUSE_COUNTING_SEMAPHORES 1
-#define configQUEUE_REGISTRY_SIZE 2
-#define configUSE_QUEUE_SETS 0
-#define configUSE_TIME_SLICING 0
-#define configUSE_NEWLIB_REENTRANT 0
-#define configENABLE_BACKWARD_COMPATIBILITY 1
-#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
-
-#define configSUPPORT_STATIC_ALLOCATION 1
-#define configSUPPORT_DYNAMIC_ALLOCATION 0
-
-/* Hook function related definitions. */
-#define configUSE_IDLE_HOOK 0
-#define configUSE_TICK_HOOK 0
-#define configUSE_MALLOC_FAILED_HOOK 0 // cause nested extern warning
-#define configCHECK_FOR_STACK_OVERFLOW 2
-
-/* Run time and task stats gathering related definitions. */
-#define configGENERATE_RUN_TIME_STATS 0
-#define configUSE_TRACE_FACILITY 1 // legacy trace
-#define configUSE_STATS_FORMATTING_FUNCTIONS 0
-
-/* Co-routine definitions. */
-#define configUSE_CO_ROUTINES 0
-#define configMAX_CO_ROUTINE_PRIORITIES 2
-
-/* Software timer related definitions. */
-#define configUSE_TIMERS 1
-#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES-2)
-#define configTIMER_QUEUE_LENGTH 32
-#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE
-
-/* Optional functions - most linkers will remove unused functions anyway. */
-#define INCLUDE_vTaskPrioritySet 0
-#define INCLUDE_uxTaskPriorityGet 0
-#define INCLUDE_vTaskDelete 0
-#define INCLUDE_vTaskSuspend 1 // required for queue, semaphore, mutex to be blocked indefinitely with portMAX_DELAY
-#define INCLUDE_xResumeFromISR 0
-#define INCLUDE_vTaskDelayUntil 1
-#define INCLUDE_vTaskDelay 1
-#define INCLUDE_xTaskGetSchedulerState 0
-#define INCLUDE_xTaskGetCurrentTaskHandle 0
-#define INCLUDE_uxTaskGetStackHighWaterMark 0
-#define INCLUDE_xTaskGetIdleTaskHandle 0
-#define INCLUDE_xTimerGetTimerDaemonTaskHandle 0
-#define INCLUDE_pcTaskGetTaskName 0
-#define INCLUDE_eTaskGetState 0
-#define INCLUDE_xEventGroupSetBitFromISR 0
-#define INCLUDE_xTimerPendFunctionCall 0
-
-/* Define to trap errors during development. */
-// Halt CPU (breakpoint) when hitting error, only apply for Cortex M3, M4, M7
-#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
- #define configASSERT(_exp) \
- do {\
- if ( !(_exp) ) { \
- volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL); /* Cortex M CoreDebug->DHCSR */ \
- if ( (*ARM_CM_DHCSR) & 1UL ) { /* Only halt mcu if debugger is attached */ \
- taskDISABLE_INTERRUPTS(); \
- __asm("BKPT #0\n"); \
- }\
- }\
- } while(0)
-#else
- #define configASSERT( x )
-#endif
-
-#ifdef __RX__
-/* Renesas RX series */
-#define vSoftwareInterruptISR INT_Excep_ICU_SWINT
-#define vTickISR INT_Excep_CMT0_CMI0
-#define configPERIPHERAL_CLOCK_HZ (configCPU_CLOCK_HZ/2)
-#define configKERNEL_INTERRUPT_PRIORITY 1
-#define configMAX_SYSCALL_INTERRUPT_PRIORITY 4
-
-#else
-
-/* FreeRTOS hooks to NVIC vectors */
-#define xPortPendSVHandler PendSV_Handler
-#define xPortSysTickHandler SysTick_Handler
-#define vPortSVCHandler SVC_Handler
-
-//--------------------------------------------------------------------+
-// Interrupt nesting behavior configuration.
-//--------------------------------------------------------------------+
-#if defined(__NVIC_PRIO_BITS)
- // For Cortex-M specific: __NVIC_PRIO_BITS is defined in core_cmx.h
- #define configPRIO_BITS __NVIC_PRIO_BITS
-#elif defined(__ECLIC_INTCTLBITS)
- // RISC-V Bumblebee core from nuclei
- #define configPRIO_BITS __ECLIC_INTCTLBITS
-#else
- #error "FreeRTOS configPRIO_BITS to be defined"
-#endif
-
-/* The lowest interrupt priority that can be used in a call to a "set priority" function. */
-#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY ((1<<configPRIO_BITS) - 1)
-
-/* The highest interrupt priority that can be used by any interrupt service
-routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
-INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
-PRIORITY THAN THIS! (higher priorities are lower numeric values. */
-#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 2
-
-/* Interrupt priorities used by the kernel port layer itself. These are generic
-to all Cortex-M ports, and do not rely on any particular library functions. */
-#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
-
-/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
-See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
-#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
-
-#endif
-
-#endif /* __FREERTOS_CONFIG__H */
diff --git a/tinyusb/examples/device/cdc_msc_freertos/src/freertos_hook.c b/tinyusb/examples/device/cdc_msc_freertos/src/freertos_hook.c
deleted file mode 100755
index ab885947..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/src/freertos_hook.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "FreeRTOS.h"
-#include "task.h"
-#include "common/tusb_common.h"
-
-
-void vApplicationMallocFailedHook(void)
-{
- taskDISABLE_INTERRUPTS();
- TU_ASSERT(false, );
-}
-
-void vApplicationStackOverflowHook(xTaskHandle pxTask, char *pcTaskName)
-{
- (void) pxTask;
- (void) pcTaskName;
-
- taskDISABLE_INTERRUPTS();
- TU_ASSERT(false, );
-}
-
-/* configSUPPORT_STATIC_ALLOCATION is set to 1, so the application must provide an
- * implementation of vApplicationGetIdleTaskMemory() to provide the memory that is
- * used by the Idle task. */
-void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize )
-{
- /* If the buffers to be provided to the Idle task are declared inside this
- * function then they must be declared static - otherwise they will be allocated on
- * the stack and so not exists after this function exits. */
- static StaticTask_t xIdleTaskTCB;
- static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
-
- /* Pass out a pointer to the StaticTask_t structure in which the Idle task's
- state will be stored. */
- *ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
-
- /* Pass out the array that will be used as the Idle task's stack. */
- *ppxIdleTaskStackBuffer = uxIdleTaskStack;
-
- /* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer.
- Note that, as the array is necessarily of type StackType_t,
- configMINIMAL_STACK_SIZE is specified in words, not bytes. */
- *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
-}
-
-/* configSUPPORT_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the
- * application must provide an implementation of vApplicationGetTimerTaskMemory()
- * to provide the memory that is used by the Timer service task. */
-void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize )
-{
- /* If the buffers to be provided to the Timer task are declared inside this
- * function then they must be declared static - otherwise they will be allocated on
- * the stack and so not exists after this function exits. */
- static StaticTask_t xTimerTaskTCB;
- static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
-
- /* Pass out a pointer to the StaticTask_t structure in which the Timer
- task's state will be stored. */
- *ppxTimerTaskTCBBuffer = &xTimerTaskTCB;
-
- /* Pass out the array that will be used as the Timer task's stack. */
- *ppxTimerTaskStackBuffer = uxTimerTaskStack;
-
- /* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer.
- Note that, as the array is necessarily of type StackType_t,
- configTIMER_TASK_STACK_DEPTH is specified in words, not bytes. */
- *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
-}
-
-#if CFG_TUSB_MCU == OPT_MCU_RX63X | CFG_TUSB_MCU == OPT_MCU_RX65X
-#include "iodefine.h"
-void vApplicationSetupTimerInterrupt(void)
-{
- /* Enable CMT0 */
- SYSTEM.PRCR.WORD = (0xA5u<<8) | TU_BIT(1);
- MSTP(CMT0) = 0;
- SYSTEM.PRCR.WORD = (0xA5u<<8);
-
- CMT0.CMCNT = 0;
- CMT0.CMCOR = (unsigned short)(((configPERIPHERAL_CLOCK_HZ/configTICK_RATE_HZ)-1)/128);
- CMT0.CMCR.WORD = TU_BIT(6) | 2;
- IR(CMT0, CMI0) = 0;
- IPR(CMT0, CMI0) = configKERNEL_INTERRUPT_PRIORITY;
- IEN(CMT0, CMI0) = 1;
- CMT.CMSTR0.BIT.STR0 = 1;
-}
-#endif
diff --git a/tinyusb/examples/device/cdc_msc_freertos/src/main.c b/tinyusb/examples/device/cdc_msc_freertos/src/main.c
deleted file mode 100755
index c27b7fed..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/src/main.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "FreeRTOS.h"
-#include "task.h"
-#include "timers.h"
-#include "queue.h"
-#include "semphr.h"
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-// static timer
-StaticTimer_t blinky_tmdef;
-TimerHandle_t blinky_tm;
-
-// static task for usbd
-// Increase stack size when debug log is enabled
-#if CFG_TUSB_DEBUG
- #define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE)
-#else
- #define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2)
-#endif
-
-StackType_t usb_device_stack[USBD_STACK_SIZE];
-StaticTask_t usb_device_taskdef;
-
-// static task for cdc
-#define CDC_STACK_SZIE configMINIMAL_STACK_SIZE
-StackType_t cdc_stack[CDC_STACK_SZIE];
-StaticTask_t cdc_taskdef;
-
-
-void led_blinky_cb(TimerHandle_t xTimer);
-void usb_device_task(void* param);
-void cdc_task(void* params);
-
-//--------------------------------------------------------------------+
-// Main
-//--------------------------------------------------------------------+
-
-int main(void)
-{
- board_init();
-
- // soft timer for blinky
- blinky_tm = xTimerCreateStatic(NULL, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), true, NULL, led_blinky_cb, &blinky_tmdef);
- xTimerStart(blinky_tm, 0);
-
- // Create a task for tinyusb device stack
- (void) xTaskCreateStatic( usb_device_task, "usbd", USBD_STACK_SIZE, NULL, configMAX_PRIORITIES-1, usb_device_stack, &usb_device_taskdef);
-
- // Create CDC task
- (void) xTaskCreateStatic( cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, cdc_stack, &cdc_taskdef);
-
- // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
-#if CFG_TUSB_MCU != OPT_MCU_ESP32S2 && CFG_TUSB_MCU != OPT_MCU_ESP32S3
- vTaskStartScheduler();
-#endif
-
- return 0;
-}
-
-#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
-void app_main(void)
-{
- main();
-}
-#endif
-
-// USB Device Driver task
-// This top level thread process all usb events and invoke callbacks
-void usb_device_task(void* param)
-{
- (void) param;
-
- // This should be called after scheduler/kernel is started.
- // Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API.
- tusb_init();
-
- // RTOS forever loop
- while (1)
- {
- // tinyusb device task
- tud_task();
- }
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), 0);
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_SUSPENDED), 0);
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
-}
-
-//--------------------------------------------------------------------+
-// USB CDC
-//--------------------------------------------------------------------+
-void cdc_task(void* params)
-{
- (void) params;
-
- // RTOS forever loop
- while ( 1 )
- {
- // connected() check for DTR bit
- // Most but not all terminal client set this when making connection
- // if ( tud_cdc_connected() )
- {
- // There are data available
- if ( tud_cdc_available() )
- {
- uint8_t buf[64];
-
- // read and echo back
- uint32_t count = tud_cdc_read(buf, sizeof(buf));
- (void) count;
-
- // Echo back
- // Note: Skip echo by commenting out write() and write_flush()
- // for throughput test e.g
- // $ dd if=/dev/zero of=/dev/ttyACM0 count=10000
- tud_cdc_write(buf, count);
- tud_cdc_write_flush();
- }
- }
-
- // For ESP32-S2 this delay is essential to allow idle how to run and reset wdt
- vTaskDelay(pdMS_TO_TICKS(10));
- }
-}
-
-// Invoked when cdc when line state changed e.g connected/disconnected
-void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
-{
- (void) itf;
- (void) rts;
-
- // TODO set some indicator
- if ( dtr )
- {
- // Terminal connected
- }else
- {
- // Terminal disconnected
- }
-}
-
-// Invoked when CDC interface received data from host
-void tud_cdc_rx_cb(uint8_t itf)
-{
- (void) itf;
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinky_cb(TimerHandle_t xTimer)
-{
- (void) xTimer;
- static bool led_state = false;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/cdc_msc_freertos/src/msc_disk.c b/tinyusb/examples/device/cdc_msc_freertos/src/msc_disk.c
deleted file mode 100755
index 5aa7befc..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/src/msc_disk.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-#if CFG_TUD_MSC
-
-// Some MCU doesn't have enough 8KB SRAM to store the whole disk
-// We will use Flash as read-only disk with board that has
-// CFG_EXAMPLE_MSC_READONLY defined
-
-#define README_CONTENTS \
-"This is tinyusb's MassStorage Class demo.\r\n\r\n\
-If you find any bugs or get any questions, feel free to file an\r\n\
-issue at github.com/hathach/tinyusb"
-
-enum
-{
- DISK_BLOCK_NUM = 16, // 8KB is the smallest size that windows allow to mount
- DISK_BLOCK_SIZE = 512
-};
-
-#ifdef CFG_EXAMPLE_MSC_READONLY
-const
-#endif
-uint8_t msc_disk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
-{
- //------------- Block0: Boot Sector -------------//
- // byte_per_sector = DISK_BLOCK_SIZE; fat12_sector_num_16 = DISK_BLOCK_NUM;
- // sector_per_cluster = 1; reserved_sectors = 1;
- // fat_num = 1; fat12_root_entry_num = 16;
- // sector_per_fat = 1; sector_per_track = 1; head_num = 1; hidden_sectors = 0;
- // drive_number = 0x80; media_type = 0xf8; extended_boot_signature = 0x29;
- // filesystem_type = "FAT12 "; volume_serial_number = 0x1234; volume_label = "TinyUSB MSC";
- // FAT magic code at offset 510-511
- {
- 0xEB, 0x3C, 0x90, 0x4D, 0x53, 0x44, 0x4F, 0x53, 0x35, 0x2E, 0x30, 0x00, 0x02, 0x01, 0x01, 0x00,
- 0x01, 0x10, 0x00, 0x10, 0x00, 0xF8, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x29, 0x34, 0x12, 0x00, 0x00, 'T' , 'i' , 'n' , 'y' , 'U' ,
- 'S' , 'B' , ' ' , 'M' , 'S' , 'C' , 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00,
-
- // Zero up to 2 last bytes of FAT magic code
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA
- },
-
- //------------- Block1: FAT12 Table -------------//
- {
- 0xF8, 0xFF, 0xFF, 0xFF, 0x0F // // first 2 entries must be F8FF, third entry is cluster end of readme file
- },
-
- //------------- Block2: Root Directory -------------//
- {
- // first entry is volume label
- 'T' , 'i' , 'n' , 'y' , 'U' , 'S' , 'B' , ' ' , 'M' , 'S' , 'C' , 0x08, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x6D, 0x65, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // second entry is readme file
- 'R' , 'E' , 'A' , 'D' , 'M' , 'E' , ' ' , ' ' , 'T' , 'X' , 'T' , 0x20, 0x00, 0xC6, 0x52, 0x6D,
- 0x65, 0x43, 0x65, 0x43, 0x00, 0x00, 0x88, 0x6D, 0x65, 0x43, 0x02, 0x00,
- sizeof(README_CONTENTS)-1, 0x00, 0x00, 0x00 // readme's files size (4 Bytes)
- },
-
- //------------- Block3: Readme Content -------------//
- README_CONTENTS
-};
-
-// Invoked when received SCSI_CMD_INQUIRY
-// Application fill vendor id, product id and revision with string up to 8, 16, 4 characters respectively
-void tud_msc_inquiry_cb(uint8_t lun, uint8_t vendor_id[8], uint8_t product_id[16], uint8_t product_rev[4])
-{
- (void) lun;
-
- const char vid[] = "TinyUSB";
- const char pid[] = "Mass Storage";
- const char rev[] = "1.0";
-
- memcpy(vendor_id , vid, strlen(vid));
- memcpy(product_id , pid, strlen(pid));
- memcpy(product_rev, rev, strlen(rev));
-}
-
-// Invoked when received Test Unit Ready command.
-// return true allowing host to read/write this LUN e.g SD card inserted
-bool tud_msc_test_unit_ready_cb(uint8_t lun)
-{
- (void) lun;
-
- return true; // RAM disk is always ready
-}
-
-// Invoked when received SCSI_CMD_READ_CAPACITY_10 and SCSI_CMD_READ_FORMAT_CAPACITY to determine the disk size
-// Application update block count and block size
-void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_size)
-{
- (void) lun;
-
- *block_count = DISK_BLOCK_NUM;
- *block_size = DISK_BLOCK_SIZE;
-}
-
-// Invoked when received Start Stop Unit command
-// - Start = 0 : stopped power mode, if load_eject = 1 : unload disk storage
-// - Start = 1 : active mode, if load_eject = 1 : load disk storage
-bool tud_msc_start_stop_cb(uint8_t lun, uint8_t power_condition, bool start, bool load_eject)
-{
- (void) lun;
- (void) power_condition;
-
- if ( load_eject )
- {
- if (start)
- {
- // load disk storage
- }else
- {
- // unload disk storage
- }
- }
-
- return true;
-}
-
-// Callback invoked when received READ10 command.
-// Copy disk's data to buffer (up to bufsize) and return number of copied bytes.
-int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize)
-{
- (void) lun;
-
- uint8_t const* addr = msc_disk[lba] + offset;
- memcpy(buffer, addr, bufsize);
-
- return bufsize;
-}
-
-// Callback invoked when received WRITE10 command.
-// Process data in buffer to disk's storage and return number of written bytes
-int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize)
-{
- (void) lun;
-
-#ifndef CFG_EXAMPLE_MSC_READONLY
- uint8_t* addr = msc_disk[lba] + offset;
- memcpy(addr, buffer, bufsize);
-#else
- (void) lba; (void) offset; (void) buffer;
-#endif
-
- return bufsize;
-}
-
-// Callback invoked when received an SCSI command not in built-in list below
-// - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, MODE_SENSE6, REQUEST_SENSE
-// - READ10 and WRITE10 has their own callbacks
-int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize)
-{
- // read10 & write10 has their own callback and MUST not be handled here
-
- void const* response = NULL;
- uint16_t resplen = 0;
-
- // most scsi handled is input
- bool in_xfer = true;
-
- switch (scsi_cmd[0])
- {
- case SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL:
- // Host is about to read/write etc ... better not to disconnect disk
- resplen = 0;
- break;
-
- default:
- // Set Sense = Invalid Command Operation
- tud_msc_set_sense(lun, SCSI_SENSE_ILLEGAL_REQUEST, 0x20, 0x00);
-
- // negative means error -> tinyusb could stall and/or response with failed status
- resplen = -1;
- break;
- }
-
- // return resplen must not larger than bufsize
- if ( resplen > bufsize ) resplen = bufsize;
-
- if ( response && (resplen > 0) )
- {
- if(in_xfer)
- {
- memcpy(buffer, response, resplen);
- }else
- {
- // SCSI output
- }
- }
-
- return resplen;
-}
-
-#endif
diff --git a/tinyusb/examples/device/cdc_msc_freertos/src/tusb_config.h b/tinyusb/examples/device/cdc_msc_freertos/src/tusb_config.h
deleted file mode 100755
index ff543834..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/src/tusb_config.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-// This examples use FreeRTOS
-#define CFG_TUSB_OS OPT_OS_FREERTOS
-
-// can be defined by compiler in DEBUG build
-#ifndef CFG_TUSB_DEBUG
- #define CFG_TUSB_DEBUG 0
-#endif
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 1
-#define CFG_TUD_MSC 1
-#define CFG_TUD_HID 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_VENDOR 0
-
-// CDC FIFO size of TX and RX
-#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-
-// CDC Endpoint transfer buffer size, more is faster
-#define CFG_TUD_CDC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-
-// MSC Buffer size of Device Mass storage
-#define CFG_TUD_MSC_EP_BUFSIZE 512
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/cdc_msc_freertos/src/usb_descriptors.c b/tinyusb/examples/device/cdc_msc_freertos/src/usb_descriptors.c
deleted file mode 100755
index 75b5ce7b..00000000
--- a/tinyusb/examples/device/cdc_msc_freertos/src/usb_descriptors.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
-
- // Use Interface Association Descriptor (IAD) for CDC
- // As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
- .bDeviceClass = TUSB_CLASS_MISC,
- .bDeviceSubClass = MISC_SUBCLASS_COMMON,
- .bDeviceProtocol = MISC_PROTOCOL_IAD,
-
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-enum
-{
- ITF_NUM_CDC = 0,
- ITF_NUM_CDC_DATA,
- ITF_NUM_MSC,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_CDC_DESC_LEN + TUD_MSC_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
- // LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
- // 0 control, 1 In, 2 Bulk, 3 Iso, 4 In, 5 Bulk etc ...
- #define EPNUM_CDC_NOTIF 0x81
- #define EPNUM_CDC_OUT 0x02
- #define EPNUM_CDC_IN 0x82
-
- #define EPNUM_MSC_OUT 0x05
- #define EPNUM_MSC_IN 0x85
-
-#elif CFG_TUSB_MCU == OPT_MCU_SAMG
- // SAMG doesn't support a same endpoint number with different direction IN and OUT
- // e.g EP1 OUT & EP1 IN cannot exist together
- #define EPNUM_CDC_NOTIF 0x81
- #define EPNUM_CDC_OUT 0x02
- #define EPNUM_CDC_IN 0x83
-
- #define EPNUM_MSC_OUT 0x04
- #define EPNUM_MSC_IN 0x85
-
-#else
- #define EPNUM_CDC_NOTIF 0x81
- #define EPNUM_CDC_OUT 0x02
- #define EPNUM_CDC_IN 0x82
-
- #define EPNUM_MSC_OUT 0x03
- #define EPNUM_MSC_IN 0x83
-
-#endif
-
-uint8_t const desc_fs_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP notification address and size, EP data address (out, in) and size.
- TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, EPNUM_CDC_NOTIF, 8, EPNUM_CDC_OUT, EPNUM_CDC_IN, 64),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 5, EPNUM_MSC_OUT, EPNUM_MSC_IN, 64),
-};
-
-#if TUD_OPT_HIGH_SPEED
-uint8_t const desc_hs_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP notification address and size, EP data address (out, in) and size.
- TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, EPNUM_CDC_NOTIF, 8, EPNUM_CDC_OUT, EPNUM_CDC_IN, 512),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 5, EPNUM_MSC_OUT, EPNUM_MSC_IN, 512),
-};
-#endif
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
-
-#if TUD_OPT_HIGH_SPEED
- // Although we are highspeed, host may be fullspeed.
- return (tud_speed_get() == TUSB_SPEED_HIGH) ? desc_hs_configuration : desc_fs_configuration;
-#else
- return desc_fs_configuration;
-#endif
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
- "TinyUSB CDC", // 4: CDC Interface
- "TinyUSB MSC", // 5: MSC Interface
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/dfu/CMakeLists.txt b/tinyusb/examples/device/dfu/CMakeLists.txt
deleted file mode 100755
index abc4d91d..00000000
--- a/tinyusb/examples/device/dfu/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/dfu/Makefile b/tinyusb/examples/device/dfu/Makefile
deleted file mode 100755
index 69b633fe..00000000
--- a/tinyusb/examples/device/dfu/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/dfu/src/main.c b/tinyusb/examples/device/dfu/src/main.c
deleted file mode 100755
index 5c846452..00000000
--- a/tinyusb/examples/device/dfu/src/main.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
- /*
- * After device is enumerated in dfu mode run the following commands
- *
- * To transfer firmware from host to device (best to test with text file)
- *
- * $ dfu-util -d cafe -a 0 -D [filename]
- * $ dfu-util -d cafe -a 1 -D [filename]
- *
- * To transfer firmware from device to host:
- *
- * $ dfu-util -d cafe -a 0 -U [filename]
- * $ dfu-util -d cafe -a 1 -U [filename]
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-const char* upload_image[2]=
-{
- "Hello world from TinyUSB DFU! - Partition 0",
- "Hello world from TinyUSB DFU! - Partition 1"
-};
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-void led_blinking_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-//--------------------------------------------------------------------+
-// DFU callbacks
-// Note: alt is used as the partition number, in order to support multiple partitions like FLASH, EEPROM, etc.
-//--------------------------------------------------------------------+
-
-// Invoked right before tud_dfu_download_cb() (state=DFU_DNBUSY) or tud_dfu_manifest_cb() (state=DFU_MANIFEST)
-// Application return timeout in milliseconds (bwPollTimeout) for the next download/manifest operation.
-// During this period, USB host won't try to communicate with us.
-uint32_t tud_dfu_get_timeout_cb(uint8_t alt, uint8_t state)
-{
- if ( state == DFU_DNBUSY )
- {
- // For this example
- // - Atl0 Flash is fast : 1 ms
- // - Alt1 EEPROM is slow: 100 ms
- return (alt == 0) ? 1 : 100;
- }
- else if (state == DFU_MANIFEST)
- {
- // since we don't buffer entire image and do any flashing in manifest stage
- return 0;
- }
-
- return 0;
-}
-
-// Invoked when received DFU_DNLOAD (wLength>0) following by DFU_GETSTATUS (state=DFU_DNBUSY) requests
-// This callback could be returned before flashing op is complete (async).
-// Once finished flashing, application must call tud_dfu_finish_flashing()
-void tud_dfu_download_cb(uint8_t alt, uint16_t block_num, uint8_t const* data, uint16_t length)
-{
- (void) alt;
- (void) block_num;
-
- //printf("\r\nReceived Alt %u BlockNum %u of length %u\r\n", alt, wBlockNum, length);
-
- for(uint16_t i=0; i<length; i++)
- {
- printf("%c", data[i]);
- }
-
- // flashing op for download complete without error
- tud_dfu_finish_flashing(DFU_STATUS_OK);
-}
-
-// Invoked when download process is complete, received DFU_DNLOAD (wLength=0) following by DFU_GETSTATUS (state=Manifest)
-// Application can do checksum, or actual flashing if buffered entire image previously.
-// Once finished flashing, application must call tud_dfu_finish_flashing()
-void tud_dfu_manifest_cb(uint8_t alt)
-{
- (void) alt;
- printf("Download completed, enter manifestation\r\n");
-
- // flashing op for manifest is complete without error
- // Application can perform checksum, should it fail, use appropriate status such as errVERIFY.
- tud_dfu_finish_flashing(DFU_STATUS_OK);
-}
-
-// Invoked when received DFU_UPLOAD request
-// Application must populate data with up to length bytes and
-// Return the number of written bytes
-uint16_t tud_dfu_upload_cb(uint8_t alt, uint16_t block_num, uint8_t* data, uint16_t length)
-{
- (void) block_num;
- (void) length;
-
- uint16_t const xfer_len = (uint16_t) strlen(upload_image[alt]);
- memcpy(data, upload_image[alt], xfer_len);
-
- return xfer_len;
-}
-
-// Invoked when the Host has terminated a download or upload transfer
-void tud_dfu_abort_cb(uint8_t alt)
-{
- (void) alt;
- printf("Host aborted transfer\r\n");
-}
-
-// Invoked when a DFU_DETACH request is received
-void tud_dfu_detach_cb(void)
-{
- printf("Host detach, we should probably reboot\r\n");
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK + Indicator pulse
-//--------------------------------------------------------------------+
-
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/dfu/src/tusb_config.h b/tinyusb/examples/device/dfu/src/tusb_config.h
deleted file mode 100755
index 66e35702..00000000
--- a/tinyusb/examples/device/dfu/src/tusb_config.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * tusb_config.h
- *
- * Created on: May 5, 2021
- * Author: Jeremiah McCarthy
- */
-
-#ifndef TUSB_CONFIG_H_
-#define TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_DFU 1
-
-// DFU buffer size, it has to be set to the buffer size used in TUD_DFU_DESCRIPTOR
-#define CFG_TUD_DFU_XFER_BUFSIZE 512
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/dfu/src/usb_descriptors.c b/tinyusb/examples/device/dfu/src/usb_descriptors.c
deleted file mode 100755
index 1cfe29c5..00000000
--- a/tinyusb/examples/device/dfu/src/usb_descriptors.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-#include "class/dfu/dfu_device.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
-
- #if CFG_TUD_CDC
- // Use Interface Association Descriptor (IAD) for CDC
- // As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
- .bDeviceClass = TUSB_CLASS_MISC,
- .bDeviceSubClass = MISC_SUBCLASS_COMMON,
- .bDeviceProtocol = MISC_PROTOCOL_IAD,
- #else
- .bDeviceClass = 0x00,
- .bDeviceSubClass = 0x00,
- .bDeviceProtocol = 0x00,
- #endif
-
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-// Number of Alternate Interface (each for 1 flash partition)
-#define ALT_COUNT 2
-
-enum
-{
- ITF_NUM_DFU_MODE,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_DFU_DESC_LEN(ALT_COUNT))
-
-#define FUNC_ATTRS (DFU_ATTR_CAN_UPLOAD | DFU_ATTR_CAN_DOWNLOAD | DFU_ATTR_MANIFESTATION_TOLERANT)
-
-uint8_t const desc_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, Alternate count, starting string index, attributes, detach timeout, transfer size
- TUD_DFU_DESCRIPTOR(ITF_NUM_DFU_MODE, ALT_COUNT, 4, FUNC_ATTRS, 1000, CFG_TUD_DFU_XFER_BUFSIZE),
-};
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
- return desc_configuration;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
- "FLASH", // 4: DFU Partition 1
- "EEPROM", // 5: DFU Partition 2
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- size_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }
- else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) {
- chr_count = 31;
- }
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (uint16_t)((((uint16_t)TUSB_DESC_STRING) << 8 ) | (2u*chr_count + 2u));
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/dfu_runtime/CMakeLists.txt b/tinyusb/examples/device/dfu_runtime/CMakeLists.txt
deleted file mode 100755
index abc4d91d..00000000
--- a/tinyusb/examples/device/dfu_runtime/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/dfu_runtime/Makefile b/tinyusb/examples/device/dfu_runtime/Makefile
deleted file mode 100755
index 69b633fe..00000000
--- a/tinyusb/examples/device/dfu_runtime/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/dfu_runtime/src/main.c b/tinyusb/examples/device/dfu_runtime/src/main.c
deleted file mode 100755
index 823c71ae..00000000
--- a/tinyusb/examples/device/dfu_runtime/src/main.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-/* After device is enumerated, run following command
- *
- * $ dfu-util -l
- *
- * It should be able to list our device as in Runtime mode. Then run
- *
- * $ dfu-util -e
- *
- * This will send DETTACH command to put device into bootloader. Since this example
- * is minimal, it doesn't actually go into DFU mode but rather change the LED blinking
- * pattern to fast rate as indicator.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 1000 ms : device should reboot
- * - 250 ms : device not mounted
- * - 0 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_DFU_MODE = 100,
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-void led_blinking_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked on DFU_DETACH request to reboot to the bootloader
-void tud_dfu_runtime_reboot_to_dfu_cb(void)
-{
- blink_interval_ms = BLINK_DFU_MODE;
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK + Indicator pulse
-//--------------------------------------------------------------------+
-
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/dfu_runtime/src/tusb_config.h b/tinyusb/examples/device/dfu_runtime/src/tusb_config.h
deleted file mode 100755
index bdae1d2e..00000000
--- a/tinyusb/examples/device/dfu_runtime/src/tusb_config.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * tusb_config.h
- *
- * Created on: Oct 28, 2019
- * Author: Sylvain Munaut
- */
-
-#ifndef TUSB_CONFIG_H_
-#define TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-
-#define CFG_TUD_DFU_RUNTIME 1
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/dfu_runtime/src/usb_descriptors.c b/tinyusb/examples/device/dfu_runtime/src/usb_descriptors.c
deleted file mode 100755
index 8b2bd265..00000000
--- a/tinyusb/examples/device/dfu_runtime/src/usb_descriptors.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-#include "class/dfu/dfu_rt_device.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
-
- #if CFG_TUD_CDC
- // Use Interface Association Descriptor (IAD) for CDC
- // As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
- .bDeviceClass = TUSB_CLASS_MISC,
- .bDeviceSubClass = MISC_SUBCLASS_COMMON,
- .bDeviceProtocol = MISC_PROTOCOL_IAD,
- #else
- .bDeviceClass = 0x00,
- .bDeviceSubClass = 0x00,
- .bDeviceProtocol = 0x00,
- #endif
-
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-enum
-{
- ITF_NUM_DFU_RT,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_DFU_RT_DESC_LEN)
-
-uint8_t const desc_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, attributes, detach timeout, transfer size */
- TUD_DFU_RT_DESCRIPTOR(ITF_NUM_DFU_RT, 4, 0x0d, 1000, 4096),
-};
-
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
- return desc_configuration;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
- "TinyUSB DFU runtime", // 4: DFU runtime
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- size_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }
- else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) {
- chr_count = 31;
- }
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (uint16_t)((((uint16_t)TUSB_DESC_STRING) << 8 ) | (2u*chr_count + 2u));
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/dynamic_configuration/.skip.MCU_SAMD11 b/tinyusb/examples/device/dynamic_configuration/.skip.MCU_SAMD11
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/dynamic_configuration/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/tinyusb/examples/device/dynamic_configuration/CMakeLists.txt b/tinyusb/examples/device/dynamic_configuration/CMakeLists.txt
deleted file mode 100755
index fa6e83b7..00000000
--- a/tinyusb/examples/device/dynamic_configuration/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/dynamic_configuration/Makefile b/tinyusb/examples/device/dynamic_configuration/Makefile
deleted file mode 100755
index 69b633fe..00000000
--- a/tinyusb/examples/device/dynamic_configuration/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/dynamic_configuration/src/main.c b/tinyusb/examples/device/dynamic_configuration/src/main.c
deleted file mode 100755
index 4c10f55b..00000000
--- a/tinyusb/examples/device/dynamic_configuration/src/main.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-void led_blinking_task(void);
-void cdc_task(void);
-void midi_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
- cdc_task();
- midi_task();
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-
-//--------------------------------------------------------------------+
-// USB CDC
-//--------------------------------------------------------------------+
-void cdc_task(void)
-{
- if ( tud_cdc_connected() )
- {
- // connected and there are data available
- if ( tud_cdc_available() )
- {
- uint8_t buf[64];
-
- // read and echo back
- uint32_t count = tud_cdc_read(buf, sizeof(buf));
-
- for(uint32_t i=0; i<count; i++)
- {
- tud_cdc_write_char(buf[i]);
-
- if ( buf[i] == '\r' ) tud_cdc_write_char('\n');
- }
-
- tud_cdc_write_flush();
- }
- }
-}
-
-// Invoked when cdc when line state changed e.g connected/disconnected
-void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
-{
- (void) itf;
-
- // connected
- if ( dtr && rts )
- {
- // print initial message when connected
- tud_cdc_write_str("\r\nTinyUSB CDC MSC device example\r\n");
- }
-}
-
-// Invoked when CDC interface received data from host
-void tud_cdc_rx_cb(uint8_t itf)
-{
- (void) itf;
-}
-
-//--------------------------------------------------------------------+
-// MIDI Task
-//--------------------------------------------------------------------+
-
-// Variable that holds the current position in the sequence.
-uint32_t note_pos = 0;
-
-// Store example melody as an array of note values
-static const uint8_t note_sequence[] =
-{
- 74,78,81,86,90,93,98,102,57,61,66,69,73,78,81,85,88,92,97,100,97,92,88,85,81,78,
- 74,69,66,62,57,62,66,69,74,78,81,86,90,93,97,102,97,93,90,85,81,78,73,68,64,61,
- 56,61,64,68,74,78,81,86,90,93,98,102
-};
-
-void midi_task(void)
-{
- static uint32_t start_ms = 0;
-
- uint8_t const cable_num = 0; // MIDI jack associated with USB endpoint
- uint8_t const channel = 0; // 0 for channel 1
-
- // The MIDI interface always creates input and output port/jack descriptors
- // regardless of these being used or not. Therefore incoming traffic should be read
- // (possibly just discarded) to avoid the sender blocking in IO
- uint8_t packet[4];
- while( tud_midi_available() ) tud_midi_packet_read(packet);
-
- // send note every 1000 ms
- if (board_millis() - start_ms < 286) return; // not enough time
- start_ms += 286;
-
- // Previous positions in the note sequence.
- int previous = note_pos - 1;
-
- // If we currently are at position 0, set the
- // previous position to the last note in the sequence.
- if (previous < 0) previous = sizeof(note_sequence) - 1;
-
- // Send Note On for current position at full velocity (127) on channel 1.
- uint8_t note_on[3] = { 0x90 | channel, note_sequence[note_pos], 127 };
- tud_midi_stream_write(cable_num, note_on, 3);
-
- // Send Note Off for previous note.
- uint8_t note_off[3] = { 0x80 | channel, note_sequence[previous], 0};
- tud_midi_stream_write(cable_num, note_off, 3);
-
- // Increment position
- note_pos++;
-
- // If we are at the end of the sequence, start over.
- if (note_pos >= sizeof(note_sequence)) note_pos = 0;
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/dynamic_configuration/src/msc_disk.c b/tinyusb/examples/device/dynamic_configuration/src/msc_disk.c
deleted file mode 100755
index 5aa7befc..00000000
--- a/tinyusb/examples/device/dynamic_configuration/src/msc_disk.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-#if CFG_TUD_MSC
-
-// Some MCU doesn't have enough 8KB SRAM to store the whole disk
-// We will use Flash as read-only disk with board that has
-// CFG_EXAMPLE_MSC_READONLY defined
-
-#define README_CONTENTS \
-"This is tinyusb's MassStorage Class demo.\r\n\r\n\
-If you find any bugs or get any questions, feel free to file an\r\n\
-issue at github.com/hathach/tinyusb"
-
-enum
-{
- DISK_BLOCK_NUM = 16, // 8KB is the smallest size that windows allow to mount
- DISK_BLOCK_SIZE = 512
-};
-
-#ifdef CFG_EXAMPLE_MSC_READONLY
-const
-#endif
-uint8_t msc_disk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
-{
- //------------- Block0: Boot Sector -------------//
- // byte_per_sector = DISK_BLOCK_SIZE; fat12_sector_num_16 = DISK_BLOCK_NUM;
- // sector_per_cluster = 1; reserved_sectors = 1;
- // fat_num = 1; fat12_root_entry_num = 16;
- // sector_per_fat = 1; sector_per_track = 1; head_num = 1; hidden_sectors = 0;
- // drive_number = 0x80; media_type = 0xf8; extended_boot_signature = 0x29;
- // filesystem_type = "FAT12 "; volume_serial_number = 0x1234; volume_label = "TinyUSB MSC";
- // FAT magic code at offset 510-511
- {
- 0xEB, 0x3C, 0x90, 0x4D, 0x53, 0x44, 0x4F, 0x53, 0x35, 0x2E, 0x30, 0x00, 0x02, 0x01, 0x01, 0x00,
- 0x01, 0x10, 0x00, 0x10, 0x00, 0xF8, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x29, 0x34, 0x12, 0x00, 0x00, 'T' , 'i' , 'n' , 'y' , 'U' ,
- 'S' , 'B' , ' ' , 'M' , 'S' , 'C' , 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00,
-
- // Zero up to 2 last bytes of FAT magic code
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA
- },
-
- //------------- Block1: FAT12 Table -------------//
- {
- 0xF8, 0xFF, 0xFF, 0xFF, 0x0F // // first 2 entries must be F8FF, third entry is cluster end of readme file
- },
-
- //------------- Block2: Root Directory -------------//
- {
- // first entry is volume label
- 'T' , 'i' , 'n' , 'y' , 'U' , 'S' , 'B' , ' ' , 'M' , 'S' , 'C' , 0x08, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x6D, 0x65, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // second entry is readme file
- 'R' , 'E' , 'A' , 'D' , 'M' , 'E' , ' ' , ' ' , 'T' , 'X' , 'T' , 0x20, 0x00, 0xC6, 0x52, 0x6D,
- 0x65, 0x43, 0x65, 0x43, 0x00, 0x00, 0x88, 0x6D, 0x65, 0x43, 0x02, 0x00,
- sizeof(README_CONTENTS)-1, 0x00, 0x00, 0x00 // readme's files size (4 Bytes)
- },
-
- //------------- Block3: Readme Content -------------//
- README_CONTENTS
-};
-
-// Invoked when received SCSI_CMD_INQUIRY
-// Application fill vendor id, product id and revision with string up to 8, 16, 4 characters respectively
-void tud_msc_inquiry_cb(uint8_t lun, uint8_t vendor_id[8], uint8_t product_id[16], uint8_t product_rev[4])
-{
- (void) lun;
-
- const char vid[] = "TinyUSB";
- const char pid[] = "Mass Storage";
- const char rev[] = "1.0";
-
- memcpy(vendor_id , vid, strlen(vid));
- memcpy(product_id , pid, strlen(pid));
- memcpy(product_rev, rev, strlen(rev));
-}
-
-// Invoked when received Test Unit Ready command.
-// return true allowing host to read/write this LUN e.g SD card inserted
-bool tud_msc_test_unit_ready_cb(uint8_t lun)
-{
- (void) lun;
-
- return true; // RAM disk is always ready
-}
-
-// Invoked when received SCSI_CMD_READ_CAPACITY_10 and SCSI_CMD_READ_FORMAT_CAPACITY to determine the disk size
-// Application update block count and block size
-void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_size)
-{
- (void) lun;
-
- *block_count = DISK_BLOCK_NUM;
- *block_size = DISK_BLOCK_SIZE;
-}
-
-// Invoked when received Start Stop Unit command
-// - Start = 0 : stopped power mode, if load_eject = 1 : unload disk storage
-// - Start = 1 : active mode, if load_eject = 1 : load disk storage
-bool tud_msc_start_stop_cb(uint8_t lun, uint8_t power_condition, bool start, bool load_eject)
-{
- (void) lun;
- (void) power_condition;
-
- if ( load_eject )
- {
- if (start)
- {
- // load disk storage
- }else
- {
- // unload disk storage
- }
- }
-
- return true;
-}
-
-// Callback invoked when received READ10 command.
-// Copy disk's data to buffer (up to bufsize) and return number of copied bytes.
-int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize)
-{
- (void) lun;
-
- uint8_t const* addr = msc_disk[lba] + offset;
- memcpy(buffer, addr, bufsize);
-
- return bufsize;
-}
-
-// Callback invoked when received WRITE10 command.
-// Process data in buffer to disk's storage and return number of written bytes
-int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize)
-{
- (void) lun;
-
-#ifndef CFG_EXAMPLE_MSC_READONLY
- uint8_t* addr = msc_disk[lba] + offset;
- memcpy(addr, buffer, bufsize);
-#else
- (void) lba; (void) offset; (void) buffer;
-#endif
-
- return bufsize;
-}
-
-// Callback invoked when received an SCSI command not in built-in list below
-// - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, MODE_SENSE6, REQUEST_SENSE
-// - READ10 and WRITE10 has their own callbacks
-int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize)
-{
- // read10 & write10 has their own callback and MUST not be handled here
-
- void const* response = NULL;
- uint16_t resplen = 0;
-
- // most scsi handled is input
- bool in_xfer = true;
-
- switch (scsi_cmd[0])
- {
- case SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL:
- // Host is about to read/write etc ... better not to disconnect disk
- resplen = 0;
- break;
-
- default:
- // Set Sense = Invalid Command Operation
- tud_msc_set_sense(lun, SCSI_SENSE_ILLEGAL_REQUEST, 0x20, 0x00);
-
- // negative means error -> tinyusb could stall and/or response with failed status
- resplen = -1;
- break;
- }
-
- // return resplen must not larger than bufsize
- if ( resplen > bufsize ) resplen = bufsize;
-
- if ( response && (resplen > 0) )
- {
- if(in_xfer)
- {
- memcpy(buffer, response, resplen);
- }else
- {
- // SCSI output
- }
- }
-
- return resplen;
-}
-
-#endif
diff --git a/tinyusb/examples/device/dynamic_configuration/src/tusb_config.h b/tinyusb/examples/device/dynamic_configuration/src/tusb_config.h
deleted file mode 100755
index 23073faf..00000000
--- a/tinyusb/examples/device/dynamic_configuration/src/tusb_config.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 1
-#define CFG_TUD_MSC 1
-#define CFG_TUD_MIDI 1
-#define CFG_TUD_HID 0
-#define CFG_TUD_VENDOR 0
-
-// CDC FIFO size of TX and RX
-#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-
-// MIDI FIFO size of TX and RX
-#define CFG_TUD_MIDI_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-#define CFG_TUD_MIDI_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-
-// MSC Buffer size of Device Mass storage
-#define CFG_TUD_MSC_EP_BUFSIZE 512
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/dynamic_configuration/src/usb_descriptors.c b/tinyusb/examples/device/dynamic_configuration/src/usb_descriptors.c
deleted file mode 100755
index 9ccb3765..00000000
--- a/tinyusb/examples/device/dynamic_configuration/src/usb_descriptors.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-#include "bsp/board.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-// Configuration mode
-// 0 : enumerated as CDC/MIDI. Board button is not pressed when enumerating
-// 1 : enumerated as MSC. Board button is pressed when enumerating
-static uint32_t mode = 0;
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device_0 =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
-
- // Use Interface Association Descriptor (IAD) for CDC
- // As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
- .bDeviceClass = TUSB_CLASS_MISC,
- .bDeviceSubClass = MISC_SUBCLASS_COMMON,
- .bDeviceProtocol = MISC_PROTOCOL_IAD,
-
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-tusb_desc_device_t const desc_device_1 =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
- .bDeviceClass = 0,
- .bDeviceSubClass = 0,
- .bDeviceProtocol = 0,
-
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
- .idVendor = 0xCafe,
- .idProduct = USB_PID + 11, // should be different PID than desc0
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- mode = board_button_read();
- return (uint8_t const*) (mode ? &desc_device_1 : &desc_device_0);
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-enum
-{
- ITF_0_NUM_CDC = 0,
- ITF_0_NUM_CDC_DATA,
- ITF_0_NUM_MIDI,
- ITF_0_NUM_MIDI_STREAMING,
- ITF_0_NUM_TOTAL
-};
-
-enum
-{
- ITF_1_NUM_MSC = 0,
- ITF_1_NUM_TOTAL
-};
-
-#define CONFIG_0_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_CDC_DESC_LEN + TUD_MIDI_DESC_LEN)
-#define CONFIG_1_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_MSC_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
- // LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
- // 0 control, 1 In, 2 Bulk, 3 Iso, 4 In, 5 Bulk etc ...
- #define EPNUM_0_CDC_NOTIF 0x81
- #define EPNUM_0_CDC_OUT 0x02
- #define EPNUM_0_CDC_IN 0x82
-
- #define EPNUM_0_MIDI_OUT 0x05
- #define EPNUM_0_MIDI_IN 0x85
-
- #define EPNUM_1_MSC_OUT 0x02
- #define EPNUM_1_MSC_IN 0x82
-
-#elif CFG_TUSB_MCU == OPT_MCU_SAMG
- // SAMG doesn't support a same endpoint number with different direction IN and OUT
- // e.g EP1 OUT & EP1 IN cannot exist together
- #define EPNUM_0_CDC_NOTIF 0x81
- #define EPNUM_0_CDC_OUT 0x02
- #define EPNUM_0_CDC_IN 0x83
-
- #define EPNUM_0_MIDI_OUT 0x04
- #define EPNUM_0_MIDI_IN 0x85
-
- #define EPNUM_1_MSC_OUT 0x01
- #define EPNUM_1_MSC_IN 0x82
-
-#else
- #define EPNUM_0_CDC_NOTIF 0x81
- #define EPNUM_0_CDC_OUT 0x02
- #define EPNUM_0_CDC_IN 0x82
-
- #define EPNUM_0_MIDI_OUT 0x03
- #define EPNUM_0_MIDI_IN 0x83
-
- #define EPNUM_1_MSC_OUT 0x01
- #define EPNUM_1_MSC_IN 0x81
-#endif
-
-uint8_t const desc_configuration_0[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_0_NUM_TOTAL, 0, CONFIG_0_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP notification address and size, EP data address (out, in) and size.
- TUD_CDC_DESCRIPTOR(ITF_0_NUM_CDC, 0, EPNUM_0_CDC_NOTIF, 8, EPNUM_0_CDC_OUT, EPNUM_0_CDC_IN, 64),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_MIDI_DESCRIPTOR(ITF_0_NUM_MIDI, 0, EPNUM_0_MIDI_OUT, EPNUM_0_MIDI_IN, TUD_OPT_HIGH_SPEED ? 512 : 64),
-};
-
-
-uint8_t const desc_configuraiton_1[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_1_NUM_TOTAL, 0, CONFIG_1_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_MSC_DESCRIPTOR(ITF_1_NUM_MSC, 0, EPNUM_1_MSC_OUT, EPNUM_1_MSC_IN, TUD_OPT_HIGH_SPEED ? 512 : 64),
-};
-
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
- return mode ? desc_configuraiton_1 : desc_configuration_0;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/hid_boot_interface/CMakeLists.txt b/tinyusb/examples/device/hid_boot_interface/CMakeLists.txt
deleted file mode 100755
index abc4d91d..00000000
--- a/tinyusb/examples/device/hid_boot_interface/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/hid_boot_interface/Makefile b/tinyusb/examples/device/hid_boot_interface/Makefile
deleted file mode 100755
index 138c2784..00000000
--- a/tinyusb/examples/device/hid_boot_interface/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += \
- src/main.c \
- src/usb_descriptors.c
-
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/hid_boot_interface/src/main.c b/tinyusb/examples/device/hid_boot_interface/src/main.c
deleted file mode 100755
index e5e2f685..00000000
--- a/tinyusb/examples/device/hid_boot_interface/src/main.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-#include "usb_descriptors.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-void led_blinking_task(void);
-void hid_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
-
- hid_task();
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-//--------------------------------------------------------------------+
-// USB HID
-//--------------------------------------------------------------------+
-
-// Every 10ms, we will sent 1 report for each HID profile (keyboard, mouse etc ..)
-// tud_hid_report_complete_cb() is used to send the next report after previous one is complete
-void hid_task(void)
-{
- // Poll every 10ms
- const uint32_t interval_ms = 10;
- static uint32_t start_ms = 0;
-
- if ( board_millis() - start_ms < interval_ms) return; // not enough time
- start_ms += interval_ms;
-
- uint32_t const btn = board_button_read();
-
- if ( tud_suspended() && btn )
- {
- // Wake up host if we are in suspend mode
- // and REMOTE_WAKEUP feature is enabled by host
- tud_remote_wakeup();
- }
- else
- {
- // keyboard interface
- if ( tud_hid_n_ready(ITF_NUM_KEYBOARD) )
- {
- // used to avoid send multiple consecutive zero report for keyboard
- static bool has_keyboard_key = false;
-
- uint8_t const report_id = 0;
- uint8_t const modifier = 0;
-
- if ( btn )
- {
- uint8_t keycode[6] = { 0 };
- keycode[0] = HID_KEY_ARROW_RIGHT;
-
- tud_hid_n_keyboard_report(ITF_NUM_KEYBOARD, report_id, modifier, keycode);
- has_keyboard_key = true;
- }else
- {
- // send empty key report if previously has key pressed
- if (has_keyboard_key) tud_hid_n_keyboard_report(ITF_NUM_KEYBOARD, report_id, modifier, NULL);
- has_keyboard_key = false;
- }
- }
-
- // mouse interface
- if ( tud_hid_n_ready(ITF_NUM_MOUSE) )
- {
- if ( btn )
- {
- uint8_t const report_id = 0;
- uint8_t const button_mask = 0;
- uint8_t const veritical = 0;
- uint8_t const horizontal = 0;
- int8_t const delta = 5;
-
- tud_hid_n_mouse_report(ITF_NUM_MOUSE, report_id, button_mask, delta, delta, veritical, horizontal);
- }
- }
- }
-}
-
-// Invoked when received SET_PROTOCOL request
-// protocol is either HID_PROTOCOL_BOOT (0) or HID_PROTOCOL_REPORT (1)
-void tud_hid_set_protocol_cb(uint8_t instance, uint8_t protocol)
-{
- (void) instance;
- (void) protocol;
-
- // nothing to do since we use the same compatible boot report for both Boot and Report mode.
- // TOOD set a indicator for user
-}
-
-// Invoked when sent REPORT successfully to host
-// Application can use this to send the next report
-// Note: For composite reports, report[0] is report ID
-void tud_hid_report_complete_cb(uint8_t instance, uint8_t const* report, uint8_t len)
-{
- (void) instance;
- (void) report;
- (void) len;
-
- // nothing to do
-}
-
-// Invoked when received GET_REPORT control request
-// Application must fill buffer report's content and return its length.
-// Return zero will cause the stack to STALL request
-uint16_t tud_hid_get_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
-{
- // TODO not Implemented
- (void) instance;
- (void) report_id;
- (void) report_type;
- (void) buffer;
- (void) reqlen;
-
- return 0;
-}
-
-// Invoked when received SET_REPORT control request or
-// received data on OUT endpoint ( Report ID = 0, Type = 0 )
-void tud_hid_set_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize)
-{
- (void) report_id;
-
- // keyboard interface
- if (instance == ITF_NUM_KEYBOARD)
- {
- // Set keyboard LED e.g Capslock, Numlock etc...
- if (report_type == HID_REPORT_TYPE_OUTPUT)
- {
- // bufsize should be (at least) 1
- if ( bufsize < 1 ) return;
-
- uint8_t const kbd_leds = buffer[0];
-
- if (kbd_leds & KEYBOARD_LED_CAPSLOCK)
- {
- // Capslock On: disable blink, turn led on
- blink_interval_ms = 0;
- board_led_write(true);
- }else
- {
- // Caplocks Off: back to normal blink
- board_led_write(false);
- blink_interval_ms = BLINK_MOUNTED;
- }
- }
- }
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // blink is disabled
- if (!blink_interval_ms) return;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/hid_boot_interface/src/tusb_config.h b/tinyusb/examples/device/hid_boot_interface/src/tusb_config.h
deleted file mode 100755
index 59fb9962..00000000
--- a/tinyusb/examples/device/hid_boot_interface/src/tusb_config.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56 || CFG_TUSB_MCU == OPT_MCU_SAMX7X)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_HID 2 // 1 for boot keyboard, 1 for boot mouse
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_VENDOR 0
-
-// HID buffer size Should be sufficient to hold ID (if any) + Data
-#define CFG_TUD_HID_EP_BUFSIZE 8
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/hid_boot_interface/src/usb_descriptors.c b/tinyusb/examples/device/hid_boot_interface/src/usb_descriptors.c
deleted file mode 100755
index 3fa48d98..00000000
--- a/tinyusb/examples/device/hid_boot_interface/src/usb_descriptors.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-#include "usb_descriptors.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
- .bDeviceClass = 0x00,
- .bDeviceSubClass = 0x00,
- .bDeviceProtocol = 0x00,
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// HID Report Descriptor
-//--------------------------------------------------------------------+
-
-uint8_t const desc_hid_keyboard_report[] =
-{
- TUD_HID_REPORT_DESC_KEYBOARD()
-};
-
-uint8_t const desc_hid_mouse_report[] =
-{
- TUD_HID_REPORT_DESC_MOUSE()
-};
-
-// Invoked when received GET HID REPORT DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_hid_descriptor_report_cb(uint8_t instance)
-{
- return (instance == 0) ? desc_hid_keyboard_report : desc_hid_mouse_report;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + 2*TUD_HID_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
- // LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
- // 1 Interrupt, 2 Bulk, 3 Iso, 4 Interrupt, 5 Bulk etc ...
- #define EPNUM_KEYBOARD 0x81
- #define EPNUM_MOUSE 0x84
-#else
- #define EPNUM_KEYBOARD 0x81
- #define EPNUM_MOUSE 0x82
-#endif
-
-uint8_t const desc_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, protocol, report descriptor len, EP In address, size & polling interval
- TUD_HID_DESCRIPTOR(ITF_NUM_KEYBOARD, 0, HID_ITF_PROTOCOL_KEYBOARD, sizeof(desc_hid_keyboard_report), EPNUM_KEYBOARD, CFG_TUD_HID_EP_BUFSIZE, 10),
-
- // Interface number, string index, protocol, report descriptor len, EP In address, size & polling interval
- TUD_HID_DESCRIPTOR(ITF_NUM_MOUSE, 0, HID_ITF_PROTOCOL_MOUSE, sizeof(desc_hid_mouse_report), EPNUM_MOUSE, CFG_TUD_HID_EP_BUFSIZE, 10)
-};
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
- return desc_configuration;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/hid_boot_interface/src/usb_descriptors.h b/tinyusb/examples/device/hid_boot_interface/src/usb_descriptors.h
deleted file mode 100755
index 57cf0e2c..00000000
--- a/tinyusb/examples/device/hid_boot_interface/src/usb_descriptors.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- */
-
-#ifndef USB_DESCRIPTORS_H_
-#define USB_DESCRIPTORS_H_
-
-enum
-{
- ITF_NUM_KEYBOARD,
- ITF_NUM_MOUSE,
- ITF_NUM_TOTAL
-};
-
-#endif
diff --git a/tinyusb/examples/device/hid_composite/CMakeLists.txt b/tinyusb/examples/device/hid_composite/CMakeLists.txt
deleted file mode 100755
index abc4d91d..00000000
--- a/tinyusb/examples/device/hid_composite/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/hid_composite/Makefile b/tinyusb/examples/device/hid_composite/Makefile
deleted file mode 100755
index 69b633fe..00000000
--- a/tinyusb/examples/device/hid_composite/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/hid_composite/src/main.c b/tinyusb/examples/device/hid_composite/src/main.c
deleted file mode 100755
index fd25e620..00000000
--- a/tinyusb/examples/device/hid_composite/src/main.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-#include "usb_descriptors.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-void led_blinking_task(void);
-void hid_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
-
- hid_task();
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-//--------------------------------------------------------------------+
-// USB HID
-//--------------------------------------------------------------------+
-
-static void send_hid_report(uint8_t report_id, uint32_t btn)
-{
- // skip if hid is not ready yet
- if ( !tud_hid_ready() ) return;
-
- switch(report_id)
- {
- case REPORT_ID_KEYBOARD:
- {
- // use to avoid send multiple consecutive zero report for keyboard
- static bool has_keyboard_key = false;
-
- if ( btn )
- {
- uint8_t keycode[6] = { 0 };
- keycode[0] = HID_KEY_A;
-
- tud_hid_keyboard_report(REPORT_ID_KEYBOARD, 0, keycode);
- has_keyboard_key = true;
- }else
- {
- // send empty key report if previously has key pressed
- if (has_keyboard_key) tud_hid_keyboard_report(REPORT_ID_KEYBOARD, 0, NULL);
- has_keyboard_key = false;
- }
- }
- break;
-
- case REPORT_ID_MOUSE:
- {
- int8_t const delta = 5;
-
- // no button, right + down, no scroll, no pan
- tud_hid_mouse_report(REPORT_ID_MOUSE, 0x00, delta, delta, 0, 0);
- }
- break;
-
- case REPORT_ID_CONSUMER_CONTROL:
- {
- // use to avoid send multiple consecutive zero report
- static bool has_consumer_key = false;
-
- if ( btn )
- {
- // volume down
- uint16_t volume_down = HID_USAGE_CONSUMER_VOLUME_DECREMENT;
- tud_hid_report(REPORT_ID_CONSUMER_CONTROL, &volume_down, 2);
- has_consumer_key = true;
- }else
- {
- // send empty key report (release key) if previously has key pressed
- uint16_t empty_key = 0;
- if (has_consumer_key) tud_hid_report(REPORT_ID_CONSUMER_CONTROL, &empty_key, 2);
- has_consumer_key = false;
- }
- }
- break;
-
- case REPORT_ID_GAMEPAD:
- {
- // use to avoid send multiple consecutive zero report for keyboard
- static bool has_gamepad_key = false;
-
- hid_gamepad_report_t report =
- {
- .x = 0, .y = 0, .z = 0, .rz = 0, .rx = 0, .ry = 0,
- .hat = 0, .buttons = 0
- };
-
- if ( btn )
- {
- report.hat = GAMEPAD_HAT_UP;
- report.buttons = GAMEPAD_BUTTON_A;
- tud_hid_report(REPORT_ID_GAMEPAD, &report, sizeof(report));
-
- has_gamepad_key = true;
- }else
- {
- report.hat = GAMEPAD_HAT_CENTERED;
- report.buttons = 0;
- if (has_gamepad_key) tud_hid_report(REPORT_ID_GAMEPAD, &report, sizeof(report));
- has_gamepad_key = false;
- }
- }
- break;
-
- default: break;
- }
-}
-
-// Every 10ms, we will sent 1 report for each HID profile (keyboard, mouse etc ..)
-// tud_hid_report_complete_cb() is used to send the next report after previous one is complete
-void hid_task(void)
-{
- // Poll every 10ms
- const uint32_t interval_ms = 10;
- static uint32_t start_ms = 0;
-
- if ( board_millis() - start_ms < interval_ms) return; // not enough time
- start_ms += interval_ms;
-
- uint32_t const btn = board_button_read();
-
- // Remote wakeup
- if ( tud_suspended() && btn )
- {
- // Wake up host if we are in suspend mode
- // and REMOTE_WAKEUP feature is enabled by host
- tud_remote_wakeup();
- }else
- {
- // Send the 1st of report chain, the rest will be sent by tud_hid_report_complete_cb()
- send_hid_report(REPORT_ID_KEYBOARD, btn);
- }
-}
-
-// Invoked when sent REPORT successfully to host
-// Application can use this to send the next report
-// Note: For composite reports, report[0] is report ID
-void tud_hid_report_complete_cb(uint8_t instance, uint8_t const* report, uint8_t len)
-{
- (void) instance;
- (void) len;
-
- uint8_t next_report_id = report[0] + 1;
-
- if (next_report_id < REPORT_ID_COUNT)
- {
- send_hid_report(next_report_id, board_button_read());
- }
-}
-
-// Invoked when received GET_REPORT control request
-// Application must fill buffer report's content and return its length.
-// Return zero will cause the stack to STALL request
-uint16_t tud_hid_get_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
-{
- // TODO not Implemented
- (void) instance;
- (void) report_id;
- (void) report_type;
- (void) buffer;
- (void) reqlen;
-
- return 0;
-}
-
-// Invoked when received SET_REPORT control request or
-// received data on OUT endpoint ( Report ID = 0, Type = 0 )
-void tud_hid_set_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize)
-{
- (void) instance;
-
- if (report_type == HID_REPORT_TYPE_OUTPUT)
- {
- // Set keyboard LED e.g Capslock, Numlock etc...
- if (report_id == REPORT_ID_KEYBOARD)
- {
- // bufsize should be (at least) 1
- if ( bufsize < 1 ) return;
-
- uint8_t const kbd_leds = buffer[0];
-
- if (kbd_leds & KEYBOARD_LED_CAPSLOCK)
- {
- // Capslock On: disable blink, turn led on
- blink_interval_ms = 0;
- board_led_write(true);
- }else
- {
- // Caplocks Off: back to normal blink
- board_led_write(false);
- blink_interval_ms = BLINK_MOUNTED;
- }
- }
- }
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // blink is disabled
- if (!blink_interval_ms) return;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/hid_composite/src/tusb_config.h b/tinyusb/examples/device/hid_composite/src/tusb_config.h
deleted file mode 100755
index 868424e6..00000000
--- a/tinyusb/examples/device/hid_composite/src/tusb_config.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56 || CFG_TUSB_MCU == OPT_MCU_SAMX7X)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_HID 1
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_VENDOR 0
-
-// HID buffer size Should be sufficient to hold ID (if any) + Data
-#define CFG_TUD_HID_EP_BUFSIZE 16
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/hid_composite/src/usb_descriptors.c b/tinyusb/examples/device/hid_composite/src/usb_descriptors.c
deleted file mode 100755
index b9a6e729..00000000
--- a/tinyusb/examples/device/hid_composite/src/usb_descriptors.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-#include "usb_descriptors.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
- .bDeviceClass = 0x00,
- .bDeviceSubClass = 0x00,
- .bDeviceProtocol = 0x00,
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// HID Report Descriptor
-//--------------------------------------------------------------------+
-
-uint8_t const desc_hid_report[] =
-{
- TUD_HID_REPORT_DESC_KEYBOARD( HID_REPORT_ID(REPORT_ID_KEYBOARD )),
- TUD_HID_REPORT_DESC_MOUSE ( HID_REPORT_ID(REPORT_ID_MOUSE )),
- TUD_HID_REPORT_DESC_CONSUMER( HID_REPORT_ID(REPORT_ID_CONSUMER_CONTROL )),
- TUD_HID_REPORT_DESC_GAMEPAD ( HID_REPORT_ID(REPORT_ID_GAMEPAD ))
-};
-
-// Invoked when received GET HID REPORT DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_hid_descriptor_report_cb(uint8_t instance)
-{
- (void) instance;
- return desc_hid_report;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-enum
-{
- ITF_NUM_HID,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_HID_DESC_LEN)
-
-#define EPNUM_HID 0x81
-
-uint8_t const desc_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, protocol, report descriptor len, EP In address, size & polling interval
- TUD_HID_DESCRIPTOR(ITF_NUM_HID, 0, HID_ITF_PROTOCOL_NONE, sizeof(desc_hid_report), EPNUM_HID, CFG_TUD_HID_EP_BUFSIZE, 5)
-};
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
- return desc_configuration;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/hid_composite/src/usb_descriptors.h b/tinyusb/examples/device/hid_composite/src/usb_descriptors.h
deleted file mode 100755
index ca8925ad..00000000
--- a/tinyusb/examples/device/hid_composite/src/usb_descriptors.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- */
-
-#ifndef USB_DESCRIPTORS_H_
-#define USB_DESCRIPTORS_H_
-
-enum
-{
- REPORT_ID_KEYBOARD = 1,
- REPORT_ID_MOUSE,
- REPORT_ID_CONSUMER_CONTROL,
- REPORT_ID_GAMEPAD,
- REPORT_ID_COUNT
-};
-
-#endif /* USB_DESCRIPTORS_H_ */
diff --git a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_CXD56 b/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_CXD56
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_CXD56
+++ /dev/null
diff --git a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_EFM32GG12 b/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_EFM32GG12
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_EFM32GG12
+++ /dev/null
diff --git a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_GD32VF103 b/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_GD32VF103
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_GD32VF103
+++ /dev/null
diff --git a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_MSP430x5xx b/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_MSP430x5xx
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_MSP430x5xx
+++ /dev/null
diff --git a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_RP2040 b/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_RP2040
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_RP2040
+++ /dev/null
diff --git a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_SAMD11 b/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_SAMD11
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_SAMX7X b/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_SAMX7X
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_SAMX7X
+++ /dev/null
diff --git a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_VALENTYUSB_EPTRI b/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_VALENTYUSB_EPTRI
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/.skip.MCU_VALENTYUSB_EPTRI
+++ /dev/null
diff --git a/tinyusb/examples/device/hid_composite_freertos/CMakeLists.txt b/tinyusb/examples/device/hid_composite_freertos/CMakeLists.txt
deleted file mode 100755
index ed734b95..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-# use BOARD-Directory name for project id
-get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
-set(PROJECT ${BOARD}-${PROJECT})
-
-# TOP is absolute path to root directory of TinyUSB git repo
-set(TOP "../../..")
-get_filename_component(TOP "${TOP}" REALPATH)
-
-# Check for -DFAMILY=
-if(FAMILY MATCHES "^esp32s[2-3]")
- include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
- project(${PROJECT})
-else()
- message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
-endif()
diff --git a/tinyusb/examples/device/hid_composite_freertos/Makefile b/tinyusb/examples/device/hid_composite_freertos/Makefile
deleted file mode 100755
index 1c195959..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-DEPS_SUBMODULES += lib/FreeRTOS-Kernel
-
-include ../../../tools/top.mk
-include ../../make.mk
-
-FREERTOS_SRC = lib/FreeRTOS-Kernel
-
-INC += \
- src \
- $(TOP)/hw \
- $(TOP)/$(FREERTOS_SRC)/include \
- $(TOP)/$(FREERTOS_SRC)/portable/GCC/$(FREERTOS_PORT)
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-# FreeRTOS source, all files in port folder
-SRC_C += \
- $(FREERTOS_SRC)/list.c \
- $(FREERTOS_SRC)/queue.c \
- $(FREERTOS_SRC)/tasks.c \
- $(FREERTOS_SRC)/timers.c \
- $(subst ../../../,,$(wildcard ../../../$(FREERTOS_SRC)/portable/GCC/$(FREERTOS_PORT)/*.c))
-
-# FreeRTOS (lto + Os) linker issue
-LDFLAGS += -Wl,--undefined=vTaskSwitchContext
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/hid_composite_freertos/sdkconfig.defaults b/tinyusb/examples/device/hid_composite_freertos/sdkconfig.defaults
deleted file mode 100755
index 83871619..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/sdkconfig.defaults
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_IDF_CMAKE=y
-CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
-CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
diff --git a/tinyusb/examples/device/hid_composite_freertos/src/CMakeLists.txt b/tinyusb/examples/device/hid_composite_freertos/src/CMakeLists.txt
deleted file mode 100755
index 6d4a3c1e..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/src/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-idf_component_register(SRCS "main.c" "usb_descriptors.c"
- INCLUDE_DIRS "."
- REQUIRES freertos soc)
-
-file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake)
-
-if(EXISTS ${board_cmake})
- include(${board_cmake})
-endif()
-
-idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
-target_include_directories(${COMPONENT_TARGET} PUBLIC
- "${FREERTOS_ORIG_INCLUDE_PATH}"
- "${TOP}/hw"
- "${TOP}/src"
-)
-
-target_sources(${COMPONENT_TARGET} PUBLIC
- "${TOP}/src/tusb.c"
- "${TOP}/src/common/tusb_fifo.c"
- "${TOP}/src/device/usbd.c"
- "${TOP}/src/device/usbd_control.c"
- "${TOP}/src/class/cdc/cdc_device.c"
- "${TOP}/src/class/dfu/dfu_rt_device.c"
- "${TOP}/src/class/hid/hid_device.c"
- "${TOP}/src/class/midi/midi_device.c"
- "${TOP}/src/class/msc/msc_device.c"
- "${TOP}/src/class/net/net_device.c"
- "${TOP}/src/class/usbtmc/usbtmc_device.c"
- "${TOP}/src/class/vendor/vendor_device.c"
- "${TOP}/src/portable/espressif/esp32sx/dcd_esp32sx.c"
-)
diff --git a/tinyusb/examples/device/hid_composite_freertos/src/FreeRTOSConfig.h b/tinyusb/examples/device/hid_composite_freertos/src/FreeRTOSConfig.h
deleted file mode 100755
index 568b27a1..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/src/FreeRTOSConfig.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * FreeRTOS Kernel V10.0.0
- * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * 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. If you wish to use our Amazon
- * FreeRTOS name, please do so in a fair use way that does not cause confusion.
- *
- * 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.
- *
- * http://www.FreeRTOS.org
- * http://aws.amazon.com/freertos
- *
- * 1 tab == 4 spaces!
- */
-
-
-#ifndef FREERTOS_CONFIG_H
-#define FREERTOS_CONFIG_H
-
-/*-----------------------------------------------------------
- * Application specific definitions.
- *
- * These definitions should be adjusted for your particular hardware and
- * application requirements.
- *
- * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
- * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
- *
- * See http://www.freertos.org/a00110.html.
- *----------------------------------------------------------*/
-
-// Include MCU header
-#include "bsp/board_mcu.h"
-
-extern uint32_t SystemCoreClock;
-
-/* Cortex M23/M33 port configuration. */
-#define configENABLE_MPU 0
-#define configENABLE_FPU 1
-#define configENABLE_TRUSTZONE 0
-#define configMINIMAL_SECURE_STACK_SIZE ( 1024 )
-
-#define configUSE_PREEMPTION 1
-#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
-#define configCPU_CLOCK_HZ SystemCoreClock
-#define configTICK_RATE_HZ ( 1000 )
-#define configMAX_PRIORITIES ( 5 )
-#define configMINIMAL_STACK_SIZE ( 128 )
-#define configTOTAL_HEAP_SIZE ( 0*1024 ) // dynamic is not used
-#define configMAX_TASK_NAME_LEN 16
-#define configUSE_16_BIT_TICKS 0
-#define configIDLE_SHOULD_YIELD 1
-#define configUSE_MUTEXES 1
-#define configUSE_RECURSIVE_MUTEXES 1
-#define configUSE_COUNTING_SEMAPHORES 1
-#define configQUEUE_REGISTRY_SIZE 2
-#define configUSE_QUEUE_SETS 0
-#define configUSE_TIME_SLICING 0
-#define configUSE_NEWLIB_REENTRANT 0
-#define configENABLE_BACKWARD_COMPATIBILITY 1
-#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
-
-#define configSUPPORT_STATIC_ALLOCATION 1
-#define configSUPPORT_DYNAMIC_ALLOCATION 0
-
-/* Hook function related definitions. */
-#define configUSE_IDLE_HOOK 0
-#define configUSE_TICK_HOOK 0
-#define configUSE_MALLOC_FAILED_HOOK 0 // cause nested extern warning
-#define configCHECK_FOR_STACK_OVERFLOW 2
-
-/* Run time and task stats gathering related definitions. */
-#define configGENERATE_RUN_TIME_STATS 0
-#define configUSE_TRACE_FACILITY 1 // legacy trace
-#define configUSE_STATS_FORMATTING_FUNCTIONS 0
-
-/* Co-routine definitions. */
-#define configUSE_CO_ROUTINES 0
-#define configMAX_CO_ROUTINE_PRIORITIES 2
-
-/* Software timer related definitions. */
-#define configUSE_TIMERS 1
-#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES-2)
-#define configTIMER_QUEUE_LENGTH 32
-#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE
-
-/* Optional functions - most linkers will remove unused functions anyway. */
-#define INCLUDE_vTaskPrioritySet 0
-#define INCLUDE_uxTaskPriorityGet 0
-#define INCLUDE_vTaskDelete 0
-#define INCLUDE_vTaskSuspend 1 // required for queue, semaphore, mutex to be blocked indefinitely with portMAX_DELAY
-#define INCLUDE_xResumeFromISR 0
-#define INCLUDE_vTaskDelayUntil 1
-#define INCLUDE_vTaskDelay 1
-#define INCLUDE_xTaskGetSchedulerState 0
-#define INCLUDE_xTaskGetCurrentTaskHandle 0
-#define INCLUDE_uxTaskGetStackHighWaterMark 0
-#define INCLUDE_xTaskGetIdleTaskHandle 0
-#define INCLUDE_xTimerGetTimerDaemonTaskHandle 0
-#define INCLUDE_pcTaskGetTaskName 0
-#define INCLUDE_eTaskGetState 0
-#define INCLUDE_xEventGroupSetBitFromISR 0
-#define INCLUDE_xTimerPendFunctionCall 0
-
-/* Define to trap errors during development. */
-// Halt CPU (breakpoint) when hitting error, only apply for Cortex M3, M4, M7
-#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
- #define configASSERT(_exp) \
- do {\
- if ( !(_exp) ) { \
- volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL); /* Cortex M CoreDebug->DHCSR */ \
- if ( (*ARM_CM_DHCSR) & 1UL ) { /* Only halt mcu if debugger is attached */ \
- taskDISABLE_INTERRUPTS(); \
- __asm("BKPT #0\n"); \
- }\
- }\
- } while(0)
-#else
- #define configASSERT( x )
-#endif
-
-#ifdef __RX__
-/* Renesas RX series */
-#define vSoftwareInterruptISR INT_Excep_ICU_SWINT
-#define vTickISR INT_Excep_CMT0_CMI0
-#define configPERIPHERAL_CLOCK_HZ (configCPU_CLOCK_HZ/2)
-#define configKERNEL_INTERRUPT_PRIORITY 1
-#define configMAX_SYSCALL_INTERRUPT_PRIORITY 4
-
-#else
-
-/* FreeRTOS hooks to NVIC vectors */
-#define xPortPendSVHandler PendSV_Handler
-#define xPortSysTickHandler SysTick_Handler
-#define vPortSVCHandler SVC_Handler
-
-//--------------------------------------------------------------------+
-// Interrupt nesting behavior configuration.
-//--------------------------------------------------------------------+
-#if defined(__NVIC_PRIO_BITS)
- // For Cortex-M specific: __NVIC_PRIO_BITS is defined in core_cmx.h
- #define configPRIO_BITS __NVIC_PRIO_BITS
-#elif defined(__ECLIC_INTCTLBITS)
- // RISC-V Bumblebee core from nuclei
- #define configPRIO_BITS __ECLIC_INTCTLBITS
-#else
- #error "FreeRTOS configPRIO_BITS to be defined"
-#endif
-
-/* The lowest interrupt priority that can be used in a call to a "set priority" function. */
-#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY ((1<<configPRIO_BITS) - 1)
-
-/* The highest interrupt priority that can be used by any interrupt service
-routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
-INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
-PRIORITY THAN THIS! (higher priorities are lower numeric values. */
-#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 2
-
-/* Interrupt priorities used by the kernel port layer itself. These are generic
-to all Cortex-M ports, and do not rely on any particular library functions. */
-#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
-
-/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
-See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
-#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
-
-#endif
-
-#endif /* __FREERTOS_CONFIG__H */
diff --git a/tinyusb/examples/device/hid_composite_freertos/src/freertos_hook.c b/tinyusb/examples/device/hid_composite_freertos/src/freertos_hook.c
deleted file mode 100755
index ab885947..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/src/freertos_hook.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "FreeRTOS.h"
-#include "task.h"
-#include "common/tusb_common.h"
-
-
-void vApplicationMallocFailedHook(void)
-{
- taskDISABLE_INTERRUPTS();
- TU_ASSERT(false, );
-}
-
-void vApplicationStackOverflowHook(xTaskHandle pxTask, char *pcTaskName)
-{
- (void) pxTask;
- (void) pcTaskName;
-
- taskDISABLE_INTERRUPTS();
- TU_ASSERT(false, );
-}
-
-/* configSUPPORT_STATIC_ALLOCATION is set to 1, so the application must provide an
- * implementation of vApplicationGetIdleTaskMemory() to provide the memory that is
- * used by the Idle task. */
-void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize )
-{
- /* If the buffers to be provided to the Idle task are declared inside this
- * function then they must be declared static - otherwise they will be allocated on
- * the stack and so not exists after this function exits. */
- static StaticTask_t xIdleTaskTCB;
- static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
-
- /* Pass out a pointer to the StaticTask_t structure in which the Idle task's
- state will be stored. */
- *ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
-
- /* Pass out the array that will be used as the Idle task's stack. */
- *ppxIdleTaskStackBuffer = uxIdleTaskStack;
-
- /* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer.
- Note that, as the array is necessarily of type StackType_t,
- configMINIMAL_STACK_SIZE is specified in words, not bytes. */
- *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
-}
-
-/* configSUPPORT_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the
- * application must provide an implementation of vApplicationGetTimerTaskMemory()
- * to provide the memory that is used by the Timer service task. */
-void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize )
-{
- /* If the buffers to be provided to the Timer task are declared inside this
- * function then they must be declared static - otherwise they will be allocated on
- * the stack and so not exists after this function exits. */
- static StaticTask_t xTimerTaskTCB;
- static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
-
- /* Pass out a pointer to the StaticTask_t structure in which the Timer
- task's state will be stored. */
- *ppxTimerTaskTCBBuffer = &xTimerTaskTCB;
-
- /* Pass out the array that will be used as the Timer task's stack. */
- *ppxTimerTaskStackBuffer = uxTimerTaskStack;
-
- /* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer.
- Note that, as the array is necessarily of type StackType_t,
- configTIMER_TASK_STACK_DEPTH is specified in words, not bytes. */
- *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
-}
-
-#if CFG_TUSB_MCU == OPT_MCU_RX63X | CFG_TUSB_MCU == OPT_MCU_RX65X
-#include "iodefine.h"
-void vApplicationSetupTimerInterrupt(void)
-{
- /* Enable CMT0 */
- SYSTEM.PRCR.WORD = (0xA5u<<8) | TU_BIT(1);
- MSTP(CMT0) = 0;
- SYSTEM.PRCR.WORD = (0xA5u<<8);
-
- CMT0.CMCNT = 0;
- CMT0.CMCOR = (unsigned short)(((configPERIPHERAL_CLOCK_HZ/configTICK_RATE_HZ)-1)/128);
- CMT0.CMCR.WORD = TU_BIT(6) | 2;
- IR(CMT0, CMI0) = 0;
- IPR(CMT0, CMI0) = configKERNEL_INTERRUPT_PRIORITY;
- IEN(CMT0, CMI0) = 1;
- CMT.CMSTR0.BIT.STR0 = 1;
-}
-#endif
diff --git a/tinyusb/examples/device/hid_composite_freertos/src/main.c b/tinyusb/examples/device/hid_composite_freertos/src/main.c
deleted file mode 100755
index 9c9830e3..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/src/main.c
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "FreeRTOS.h"
-#include "task.h"
-#include "timers.h"
-#include "queue.h"
-#include "semphr.h"
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-#include "usb_descriptors.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-// static timer
-StaticTimer_t blinky_tmdef;
-TimerHandle_t blinky_tm;
-
-// static task for usbd
-#if CFG_TUSB_DEBUG
- #define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE)
-#else
- #define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2)
-#endif
-
-StackType_t usb_device_stack[USBD_STACK_SIZE];
-StaticTask_t usb_device_taskdef;
-
-// static task for hid
-#define HID_STACK_SZIE configMINIMAL_STACK_SIZE
-StackType_t hid_stack[HID_STACK_SZIE];
-StaticTask_t hid_taskdef;
-
-
-void led_blinky_cb(TimerHandle_t xTimer);
-void usb_device_task(void* param);
-void hid_task(void* params);
-
-//--------------------------------------------------------------------+
-// Main
-//--------------------------------------------------------------------+
-
-int main(void)
-{
- board_init();
-
- // soft timer for blinky
- blinky_tm = xTimerCreateStatic(NULL, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), true, NULL, led_blinky_cb, &blinky_tmdef);
- xTimerStart(blinky_tm, 0);
-
- // Create a task for tinyusb device stack
- (void) xTaskCreateStatic( usb_device_task, "usbd", USBD_STACK_SIZE, NULL, configMAX_PRIORITIES-1, usb_device_stack, &usb_device_taskdef);
-
- // Create HID task
- (void) xTaskCreateStatic( hid_task, "hid", HID_STACK_SZIE, NULL, configMAX_PRIORITIES-2, hid_stack, &hid_taskdef);
-
- // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
-#if CFG_TUSB_MCU != OPT_MCU_ESP32S2 && CFG_TUSB_MCU != OPT_MCU_ESP32S3
- vTaskStartScheduler();
-#endif
-
- return 0;
-}
-
-#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
-void app_main(void)
-{
- main();
-}
-#endif
-
-// USB Device Driver task
-// This top level thread process all usb events and invoke callbacks
-void usb_device_task(void* param)
-{
- (void) param;
-
- // This should be called after scheduler/kernel is started.
- // Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API.
- tusb_init();
-
- // RTOS forever loop
- while (1)
- {
- // tinyusb device task
- tud_task();
- }
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), 0);
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_SUSPENDED), 0);
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
-}
-
-//--------------------------------------------------------------------+
-// USB HID
-//--------------------------------------------------------------------+
-
-static void send_hid_report(uint8_t report_id, uint32_t btn)
-{
- // skip if hid is not ready yet
- if ( !tud_hid_ready() ) return;
-
- switch(report_id)
- {
- case REPORT_ID_KEYBOARD:
- {
- // use to avoid send multiple consecutive zero report for keyboard
- static bool has_keyboard_key = false;
-
- if ( btn )
- {
- uint8_t keycode[6] = { 0 };
- keycode[0] = HID_KEY_A;
-
- tud_hid_keyboard_report(REPORT_ID_KEYBOARD, 0, keycode);
- has_keyboard_key = true;
- }else
- {
- // send empty key report if previously has key pressed
- if (has_keyboard_key) tud_hid_keyboard_report(REPORT_ID_KEYBOARD, 0, NULL);
- has_keyboard_key = false;
- }
- }
- break;
-
- case REPORT_ID_MOUSE:
- {
- int8_t const delta = 5;
-
- // no button, right + down, no scroll, no pan
- tud_hid_mouse_report(REPORT_ID_MOUSE, 0x00, delta, delta, 0, 0);
- }
- break;
-
- case REPORT_ID_CONSUMER_CONTROL:
- {
- // use to avoid send multiple consecutive zero report
- static bool has_consumer_key = false;
-
- if ( btn )
- {
- // volume down
- uint16_t volume_down = HID_USAGE_CONSUMER_VOLUME_DECREMENT;
- tud_hid_report(REPORT_ID_CONSUMER_CONTROL, &volume_down, 2);
- has_consumer_key = true;
- }else
- {
- // send empty key report (release key) if previously has key pressed
- uint16_t empty_key = 0;
- if (has_consumer_key) tud_hid_report(REPORT_ID_CONSUMER_CONTROL, &empty_key, 2);
- has_consumer_key = false;
- }
- }
- break;
-
- case REPORT_ID_GAMEPAD:
- {
- // use to avoid send multiple consecutive zero report for keyboard
- static bool has_gamepad_key = false;
-
- hid_gamepad_report_t report =
- {
- .x = 0, .y = 0, .z = 0, .rz = 0, .rx = 0, .ry = 0,
- .hat = 0, .buttons = 0
- };
-
- if ( btn )
- {
- report.hat = GAMEPAD_HAT_UP;
- report.buttons = GAMEPAD_BUTTON_A;
- tud_hid_report(REPORT_ID_GAMEPAD, &report, sizeof(report));
-
- has_gamepad_key = true;
- }else
- {
- report.hat = GAMEPAD_HAT_CENTERED;
- report.buttons = 0;
- if (has_gamepad_key) tud_hid_report(REPORT_ID_GAMEPAD, &report, sizeof(report));
- has_gamepad_key = false;
- }
- }
- break;
-
- default: break;
- }
-}
-
-void hid_task(void* param)
-{
- (void) param;
-
- while(1)
- {
- // Poll every 10ms
- vTaskDelay(pdMS_TO_TICKS(10));
-
- uint32_t const btn = board_button_read();
-
- // Remote wakeup
- if ( tud_suspended() && btn )
- {
- // Wake up host if we are in suspend mode
- // and REMOTE_WAKEUP feature is enabled by host
- tud_remote_wakeup();
- }
- else
- {
- // Send the 1st of report chain, the rest will be sent by tud_hid_report_complete_cb()
- send_hid_report(REPORT_ID_KEYBOARD, btn);
- }
- }
-}
-
-// Invoked when sent REPORT successfully to host
-// Application can use this to send the next report
-// Note: For composite reports, report[0] is report ID
-void tud_hid_report_complete_cb(uint8_t instance, uint8_t const* report, uint8_t len)
-{
- (void) instance;
- (void) len;
-
- uint8_t next_report_id = report[0] + 1;
-
- if (next_report_id < REPORT_ID_COUNT)
- {
- send_hid_report(next_report_id, board_button_read());
- }
-}
-
-
-// Invoked when received GET_REPORT control request
-// Application must fill buffer report's content and return its length.
-// Return zero will cause the stack to STALL request
-uint16_t tud_hid_get_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
-{
- // TODO not Implemented
- (void) instance;
- (void) report_id;
- (void) report_type;
- (void) buffer;
- (void) reqlen;
-
- return 0;
-}
-
-// Invoked when received SET_REPORT control request or
-// received data on OUT endpoint ( Report ID = 0, Type = 0 )
-void tud_hid_set_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize)
-{
- (void) instance;
-
- if (report_type == HID_REPORT_TYPE_OUTPUT)
- {
- // Set keyboard LED e.g Capslock, Numlock etc...
- if (report_id == REPORT_ID_KEYBOARD)
- {
- // bufsize should be (at least) 1
- if ( bufsize < 1 ) return;
-
- uint8_t const kbd_leds = buffer[0];
-
- if (kbd_leds & KEYBOARD_LED_CAPSLOCK)
- {
- // Capslock On: disable blink, turn led on
- xTimerStop(blinky_tm, portMAX_DELAY);
- board_led_write(true);
- }else
- {
- // Caplocks Off: back to normal blink
- board_led_write(false);
- xTimerStart(blinky_tm, portMAX_DELAY);
- }
- }
- }
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinky_cb(TimerHandle_t xTimer)
-{
- (void) xTimer;
- static bool led_state = false;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/hid_composite_freertos/src/tusb_config.h b/tinyusb/examples/device/hid_composite_freertos/src/tusb_config.h
deleted file mode 100755
index 4b0458ef..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/src/tusb_config.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-// This examples use FreeRTOS
-#define CFG_TUSB_OS OPT_OS_FREERTOS
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_HID 1
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_VENDOR 0
-
-// HID buffer size Should be sufficient to hold ID (if any) + Data
-#define CFG_TUD_HID_EP_BUFSIZE 16
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/hid_composite_freertos/src/usb_descriptors.c b/tinyusb/examples/device/hid_composite_freertos/src/usb_descriptors.c
deleted file mode 100755
index b9a6e729..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/src/usb_descriptors.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-#include "usb_descriptors.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
- .bDeviceClass = 0x00,
- .bDeviceSubClass = 0x00,
- .bDeviceProtocol = 0x00,
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// HID Report Descriptor
-//--------------------------------------------------------------------+
-
-uint8_t const desc_hid_report[] =
-{
- TUD_HID_REPORT_DESC_KEYBOARD( HID_REPORT_ID(REPORT_ID_KEYBOARD )),
- TUD_HID_REPORT_DESC_MOUSE ( HID_REPORT_ID(REPORT_ID_MOUSE )),
- TUD_HID_REPORT_DESC_CONSUMER( HID_REPORT_ID(REPORT_ID_CONSUMER_CONTROL )),
- TUD_HID_REPORT_DESC_GAMEPAD ( HID_REPORT_ID(REPORT_ID_GAMEPAD ))
-};
-
-// Invoked when received GET HID REPORT DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_hid_descriptor_report_cb(uint8_t instance)
-{
- (void) instance;
- return desc_hid_report;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-enum
-{
- ITF_NUM_HID,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_HID_DESC_LEN)
-
-#define EPNUM_HID 0x81
-
-uint8_t const desc_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, protocol, report descriptor len, EP In address, size & polling interval
- TUD_HID_DESCRIPTOR(ITF_NUM_HID, 0, HID_ITF_PROTOCOL_NONE, sizeof(desc_hid_report), EPNUM_HID, CFG_TUD_HID_EP_BUFSIZE, 5)
-};
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
- return desc_configuration;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/hid_composite_freertos/src/usb_descriptors.h b/tinyusb/examples/device/hid_composite_freertos/src/usb_descriptors.h
deleted file mode 100755
index ca8925ad..00000000
--- a/tinyusb/examples/device/hid_composite_freertos/src/usb_descriptors.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- */
-
-#ifndef USB_DESCRIPTORS_H_
-#define USB_DESCRIPTORS_H_
-
-enum
-{
- REPORT_ID_KEYBOARD = 1,
- REPORT_ID_MOUSE,
- REPORT_ID_CONSUMER_CONTROL,
- REPORT_ID_GAMEPAD,
- REPORT_ID_COUNT
-};
-
-#endif /* USB_DESCRIPTORS_H_ */
diff --git a/tinyusb/examples/device/hid_generic_inout/CMakeLists.txt b/tinyusb/examples/device/hid_generic_inout/CMakeLists.txt
deleted file mode 100755
index abc4d91d..00000000
--- a/tinyusb/examples/device/hid_generic_inout/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/hid_generic_inout/Makefile b/tinyusb/examples/device/hid_generic_inout/Makefile
deleted file mode 100755
index 69b633fe..00000000
--- a/tinyusb/examples/device/hid_generic_inout/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/hid_generic_inout/boards.js b/tinyusb/examples/device/hid_generic_inout/boards.js
deleted file mode 100755
index 6b78231a..00000000
--- a/tinyusb/examples/device/hid_generic_inout/boards.js
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = {
- "Adafruit Boards":[0x239A,0xFFFF],
- "TinyUSB example":[0xCAFE,0xFFFF]
-}
diff --git a/tinyusb/examples/device/hid_generic_inout/hid_test.js b/tinyusb/examples/device/hid_generic_inout/hid_test.js
deleted file mode 100755
index daa958fd..00000000
--- a/tinyusb/examples/device/hid_generic_inout/hid_test.js
+++ /dev/null
@@ -1,68 +0,0 @@
-// IMPORTANT: install the dependency via 'npm i node-hid' in the same location as the script
-// If the install fails on windows you may need to run 'npm i -g windows-build-tools' first to be able to compile native code needed for this library
-
-var HID = require('node-hid');
-var os = require('os')
-// list of supported devices
-var boards = require('./boards.js')
-var devices = HID.devices();
-
-// this will choose any device found in the boards.js file
-var deviceInfo = devices.find(anySupportedBoard);
-var reportLen = 64;
-
-var message = "Hello World!"
-
-// Turn our string into an array of integers e.g. 'ascii codes', though charCodeAt spits out UTF-16
-// This means if you have characters in your string that are not Latin-1 you will have to add additional logic for character codes above 255
-var messageBuffer = Array.from(message, function(c){return c.charCodeAt(0)});
-
-// HIDAPI requires us to prepend a 0 for single hid report as dummy reportID
-messageBuffer.unshift(0)
-
-// Some OSes expect that you always send a buffer that equals your report length
-// So lets fill up the rest of the buffer with zeros
-var paddingBuf = Array(reportLen-messageBuffer.length);
-paddingBuf.fill(0)
-messageBuffer = messageBuffer.concat(paddingBuf)
-
-// check if we actually found a device and if so send our messageBuffer to it
-if( deviceInfo ) {
- console.log(deviceInfo)
- var device = new HID.HID( deviceInfo.path );
-
- // register an event listener for data coming from the device
- device.on("data", function(data) {
- // Print what we get from the device
- console.log(data.toString('ascii'));
- });
-
- // the same for any error that occur
- device.on("error", function(err) {console.log(err)});
-
- // send our message to the device every 500ms
- setInterval(function () {
- device.write(messageBuffer);
- },500)
-}
-
-
-function anySupportedBoard(d) {
-
- for (var key in boards) {
- if (boards.hasOwnProperty(key)) {
- if (isDevice(boards[key],d)) {
- console.log("Found " + d.product);
- return true;
- }
- }
- }
- return false;
-}
-
-
-function isDevice(board,d){
- // product id 0xff is matches all
- return d.vendorId==board[0] && (d.productId==board[1] || board[1] == 0xFFFF);
-}
-
diff --git a/tinyusb/examples/device/hid_generic_inout/hid_test.py b/tinyusb/examples/device/hid_generic_inout/hid_test.py
deleted file mode 100755
index a42930fb..00000000
--- a/tinyusb/examples/device/hid_generic_inout/hid_test.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Install python3 HID package https://pypi.org/project/hid/
-import hid
-
-USB_VID = 0xcafe
-
-print("Openning HID device with VID = 0x%X" % USB_VID)
-
-for dict in hid.enumerate(USB_VID):
- print(dict)
- dev = hid.Device(dict['vendor_id'], dict['product_id'])
- if dev:
- while True:
- # Get input from console and encode to UTF8 for array of chars.
- # hid generic inout is single report therefore by HIDAPI requirement
- # it must be preceeded with 0x00 as dummy reportID
- str_out = b'\x00'
- str_out += input("Send text to HID Device : ").encode('utf-8')
- dev.write(str_out)
- str_in = dev.read(64)
- print("Received from HID Device:", str_in, '\n')
diff --git a/tinyusb/examples/device/hid_generic_inout/src/main.c b/tinyusb/examples/device/hid_generic_inout/src/main.c
deleted file mode 100755
index 32185560..00000000
--- a/tinyusb/examples/device/hid_generic_inout/src/main.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-/* This example demonstrate HID Generic raw Input & Output.
- * It will receive data from Host (In endpoint) and echo back (Out endpoint).
- * HID Report descriptor use vendor for usage page (using template TUD_HID_REPORT_DESC_GENERIC_INOUT)
- *
- * There are 2 ways to test the sketch
- * 1. Using nodejs
- * - Install nodejs and npm to your PC
- *
- * - Install excellent node-hid (https://github.com/node-hid/node-hid) by
- * $ npm install node-hid
- *
- * - Run provided hid test script
- * $ node hid_test.js
- *
- * 2. Using python
- * - Install `hid` package (https://pypi.org/project/hid/) by
- * $ pip install hid
- *
- * - hid package replies on hidapi (https://github.com/libusb/hidapi) for backend,
- * which already available in Linux. However on windows, you may need to download its dlls from their release page and
- * copy it over to folder where python is installed.
- *
- * - Run provided hid test script to send and receive data to this device.
- * $ python3 hid_test.py
- */
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-void led_blinking_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-//--------------------------------------------------------------------+
-// USB HID
-//--------------------------------------------------------------------+
-
-// Invoked when received GET_REPORT control request
-// Application must fill buffer report's content and return its length.
-// Return zero will cause the stack to STALL request
-uint16_t tud_hid_get_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
-{
- // TODO not Implemented
- (void) itf;
- (void) report_id;
- (void) report_type;
- (void) buffer;
- (void) reqlen;
-
- return 0;
-}
-
-// Invoked when received SET_REPORT control request or
-// received data on OUT endpoint ( Report ID = 0, Type = 0 )
-void tud_hid_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize)
-{
- // This example doesn't use multiple report and report ID
- (void) itf;
- (void) report_id;
- (void) report_type;
-
- // echo back anything we received from host
- tud_hid_report(0, buffer, bufsize);
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/hid_generic_inout/src/tusb_config.h b/tinyusb/examples/device/hid_generic_inout/src/tusb_config.h
deleted file mode 100755
index 1b8b91c4..00000000
--- a/tinyusb/examples/device/hid_generic_inout/src/tusb_config.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 0
-#define CFG_TUD_HID 1
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_VENDOR 0
-
-// HID buffer size Should be sufficient to hold ID (if any) + Data
-#define CFG_TUD_HID_EP_BUFSIZE 64
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/hid_generic_inout/src/usb_descriptors.c b/tinyusb/examples/device/hid_generic_inout/src/usb_descriptors.c
deleted file mode 100755
index 5a2f5ffd..00000000
--- a/tinyusb/examples/device/hid_generic_inout/src/usb_descriptors.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
- .bDeviceClass = 0x00,
- .bDeviceSubClass = 0x00,
- .bDeviceProtocol = 0x00,
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// HID Report Descriptor
-//--------------------------------------------------------------------+
-
-uint8_t const desc_hid_report[] =
-{
- TUD_HID_REPORT_DESC_GENERIC_INOUT(CFG_TUD_HID_EP_BUFSIZE)
-};
-
-// Invoked when received GET HID REPORT DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_hid_descriptor_report_cb(uint8_t itf)
-{
- (void) itf;
- return desc_hid_report;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-enum
-{
- ITF_NUM_HID,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_HID_INOUT_DESC_LEN)
-
-#define EPNUM_HID 0x01
-
-uint8_t const desc_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, protocol, report descriptor len, EP In & Out address, size & polling interval
- TUD_HID_INOUT_DESCRIPTOR(ITF_NUM_HID, 0, HID_ITF_PROTOCOL_NONE, sizeof(desc_hid_report), EPNUM_HID, 0x80 | EPNUM_HID, CFG_TUD_HID_EP_BUFSIZE, 10)
-};
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
- return desc_configuration;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/hid_multiple_interface/CMakeLists.txt b/tinyusb/examples/device/hid_multiple_interface/CMakeLists.txt
deleted file mode 100755
index abc4d91d..00000000
--- a/tinyusb/examples/device/hid_multiple_interface/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/hid_multiple_interface/Makefile b/tinyusb/examples/device/hid_multiple_interface/Makefile
deleted file mode 100755
index 69b633fe..00000000
--- a/tinyusb/examples/device/hid_multiple_interface/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/hid_multiple_interface/src/main.c b/tinyusb/examples/device/hid_multiple_interface/src/main.c
deleted file mode 100755
index 7cb1d75a..00000000
--- a/tinyusb/examples/device/hid_multiple_interface/src/main.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-// Interface index depends on the order in configuration descriptor
-enum {
- ITF_KEYBOARD = 0,
- ITF_MOUSE = 1
-};
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-void led_blinking_task(void);
-void hid_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
-
- hid_task();
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-//--------------------------------------------------------------------+
-// USB HID
-//--------------------------------------------------------------------+
-
-void hid_task(void)
-{
- // Poll every 10ms
- const uint32_t interval_ms = 10;
- static uint32_t start_ms = 0;
-
- if ( board_millis() - start_ms < interval_ms) return; // not enough time
- start_ms += interval_ms;
-
- uint32_t const btn = board_button_read();
-
- // Remote wakeup
- if ( tud_suspended() && btn )
- {
- // Wake up host if we are in suspend mode
- // and REMOTE_WAKEUP feature is enabled by host
- tud_remote_wakeup();
- }
-
- /*------------- Keyboard -------------*/
- if ( tud_hid_n_ready(ITF_KEYBOARD) )
- {
- // use to avoid send multiple consecutive zero report for keyboard
- static bool has_key = false;
-
- if ( btn )
- {
- uint8_t keycode[6] = { 0 };
- keycode[0] = HID_KEY_A;
-
- tud_hid_n_keyboard_report(ITF_KEYBOARD, 0, 0, keycode);
-
- has_key = true;
- }else
- {
- // send empty key report if previously has key pressed
- if (has_key) tud_hid_n_keyboard_report(ITF_KEYBOARD, 0, 0, NULL);
- has_key = false;
- }
- }
-
- /*------------- Mouse -------------*/
- if ( tud_hid_n_ready(ITF_MOUSE) )
- {
- if ( btn )
- {
- int8_t const delta = 5;
-
- // no button, right + down, no scroll pan
- tud_hid_n_mouse_report(ITF_MOUSE, 0, 0x00, delta, delta, 0, 0);
- }
- }
-}
-
-
-// Invoked when received GET_REPORT control request
-// Application must fill buffer report's content and return its length.
-// Return zero will cause the stack to STALL request
-uint16_t tud_hid_get_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
-{
- // TODO not Implemented
- (void) itf;
- (void) report_id;
- (void) report_type;
- (void) buffer;
- (void) reqlen;
-
- return 0;
-}
-
-// Invoked when received SET_REPORT control request or
-// received data on OUT endpoint ( Report ID = 0, Type = 0 )
-void tud_hid_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize)
-{
- // TODO set LED based on CAPLOCK, NUMLOCK etc...
- (void) itf;
- (void) report_id;
- (void) report_type;
- (void) buffer;
- (void) bufsize;
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/hid_multiple_interface/src/tusb_config.h b/tinyusb/examples/device/hid_multiple_interface/src/tusb_config.h
deleted file mode 100755
index a0aa17a9..00000000
--- a/tinyusb/examples/device/hid_multiple_interface/src/tusb_config.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_HID 2
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_VENDOR 0
-
-// HID buffer size Should be sufficient to hold ID (if any) + Data
-#define CFG_TUD_HID_EP_BUFSIZE 8
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/hid_multiple_interface/src/usb_descriptors.c b/tinyusb/examples/device/hid_multiple_interface/src/usb_descriptors.c
deleted file mode 100755
index 9eef2150..00000000
--- a/tinyusb/examples/device/hid_multiple_interface/src/usb_descriptors.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
- .bDeviceClass = 0x00,
- .bDeviceSubClass = 0x00,
- .bDeviceProtocol = 0x00,
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// HID Report Descriptor
-//--------------------------------------------------------------------+
-
-uint8_t const desc_hid_report1[] =
-{
- TUD_HID_REPORT_DESC_KEYBOARD()
-};
-
-uint8_t const desc_hid_report2[] =
-{
- TUD_HID_REPORT_DESC_MOUSE()
-};
-
-// Invoked when received GET HID REPORT DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_hid_descriptor_report_cb(uint8_t itf)
-{
- if (itf == 0)
- {
- return desc_hid_report1;
- }
- else if (itf == 1)
- {
- return desc_hid_report2;
- }
-
- return NULL;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-enum
-{
- ITF_NUM_HID1,
- ITF_NUM_HID2,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_HID_DESC_LEN + TUD_HID_DESC_LEN)
-
-#define EPNUM_HID1 0x81
-#define EPNUM_HID2 0x82
-
-uint8_t const desc_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, protocol, report descriptor len, EP In address, size & polling interval
- TUD_HID_DESCRIPTOR(ITF_NUM_HID1, 4, HID_ITF_PROTOCOL_NONE, sizeof(desc_hid_report1), EPNUM_HID1, CFG_TUD_HID_EP_BUFSIZE, 10),
- TUD_HID_DESCRIPTOR(ITF_NUM_HID2, 5, HID_ITF_PROTOCOL_NONE, sizeof(desc_hid_report2), EPNUM_HID2, CFG_TUD_HID_EP_BUFSIZE, 10)
-};
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
- return desc_configuration;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
- "Keyboard Interface", // 4: Interface 1 String
- "Mouse Interface", // 5: Interface 2 String
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/midi_test/CMakeLists.txt b/tinyusb/examples/device/midi_test/CMakeLists.txt
deleted file mode 100755
index abc4d91d..00000000
--- a/tinyusb/examples/device/midi_test/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/midi_test/Makefile b/tinyusb/examples/device/midi_test/Makefile
deleted file mode 100755
index 5a455078..00000000
--- a/tinyusb/examples/device/midi_test/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/midi_test/src/main.c b/tinyusb/examples/device/midi_test/src/main.c
deleted file mode 100755
index 19374847..00000000
--- a/tinyusb/examples/device/midi_test/src/main.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-/* This MIDI example send sequence of note (on/off) repeatedly. To test on PC, you need to install
- * synth software and midi connection management software. On
- * - Linux (Ubuntu): install qsynth, qjackctl. Then connect TinyUSB output port to FLUID Synth input port
- * - Windows: install MIDI-OX
- * - MacOS: SimpleSynth
- */
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-void led_blinking_task(void);
-void midi_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
- midi_task();
- }
-
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-//--------------------------------------------------------------------+
-// MIDI Task
-//--------------------------------------------------------------------+
-
-// Variable that holds the current position in the sequence.
-uint32_t note_pos = 0;
-
-// Store example melody as an array of note values
-uint8_t note_sequence[] =
-{
- 74,78,81,86,90,93,98,102,57,61,66,69,73,78,81,85,88,92,97,100,97,92,88,85,81,78,
- 74,69,66,62,57,62,66,69,74,78,81,86,90,93,97,102,97,93,90,85,81,78,73,68,64,61,
- 56,61,64,68,74,78,81,86,90,93,98,102
-};
-
-void midi_task(void)
-{
- static uint32_t start_ms = 0;
-
- uint8_t const cable_num = 0; // MIDI jack associated with USB endpoint
- uint8_t const channel = 0; // 0 for channel 1
-
- // The MIDI interface always creates input and output port/jack descriptors
- // regardless of these being used or not. Therefore incoming traffic should be read
- // (possibly just discarded) to avoid the sender blocking in IO
- uint8_t packet[4];
- while ( tud_midi_available() ) tud_midi_packet_read(packet);
-
- // send note periodically
- if (board_millis() - start_ms < 286) return; // not enough time
- start_ms += 286;
-
- // Previous positions in the note sequence.
- int previous = note_pos - 1;
-
- // If we currently are at position 0, set the
- // previous position to the last note in the sequence.
- if (previous < 0) previous = sizeof(note_sequence) - 1;
-
- // Send Note On for current position at full velocity (127) on channel 1.
- uint8_t note_on[3] = { 0x90 | channel, note_sequence[note_pos], 127 };
- tud_midi_stream_write(cable_num, note_on, 3);
-
- // Send Note Off for previous note.
- uint8_t note_off[3] = { 0x80 | channel, note_sequence[previous], 0};
- tud_midi_stream_write(cable_num, note_off, 3);
-
- // Increment position
- note_pos++;
-
- // If we are at the end of the sequence, start over.
- if (note_pos >= sizeof(note_sequence)) note_pos = 0;
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/midi_test/src/tusb_config.h b/tinyusb/examples/device/midi_test/src/tusb_config.h
deleted file mode 100755
index 61b9b655..00000000
--- a/tinyusb/examples/device/midi_test/src/tusb_config.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 0
-#define CFG_TUD_HID 0
-#define CFG_TUD_MIDI 1
-#define CFG_TUD_VENDOR 0
-
-// MIDI FIFO size of TX and RX
-#define CFG_TUD_MIDI_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-#define CFG_TUD_MIDI_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/midi_test/src/usb_descriptors.c b/tinyusb/examples/device/midi_test/src/usb_descriptors.c
deleted file mode 100755
index 9d92a775..00000000
--- a/tinyusb/examples/device/midi_test/src/usb_descriptors.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] MIDI | HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
- .bDeviceClass = 0x00,
- .bDeviceSubClass = 0x00,
- .bDeviceProtocol = 0x00,
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-enum
-{
- ITF_NUM_MIDI = 0,
- ITF_NUM_MIDI_STREAMING,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_MIDI_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
- // LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
- // 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
- #define EPNUM_MIDI 0x02
-#else
- #define EPNUM_MIDI 0x01
-#endif
-
-uint8_t const desc_fs_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_MIDI_DESCRIPTOR(ITF_NUM_MIDI, 0, EPNUM_MIDI, 0x80 | EPNUM_MIDI, 64)
-};
-
-#if TUD_OPT_HIGH_SPEED
-uint8_t const desc_hs_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_MIDI_DESCRIPTOR(ITF_NUM_MIDI, 0, EPNUM_MIDI, 0x80 | EPNUM_MIDI, 512)
-};
-#endif
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
-
-#if TUD_OPT_HIGH_SPEED
- // Although we are highspeed, host may be fullspeed.
- return (tud_speed_get() == TUSB_SPEED_HIGH) ? desc_hs_configuration : desc_fs_configuration;
-#else
- return desc_fs_configuration;
-#endif
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/msc_dual_lun/.skip.MCU_MKL25ZXX b/tinyusb/examples/device/msc_dual_lun/.skip.MCU_MKL25ZXX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/msc_dual_lun/.skip.MCU_MKL25ZXX
+++ /dev/null
diff --git a/tinyusb/examples/device/msc_dual_lun/.skip.MCU_SAMD11 b/tinyusb/examples/device/msc_dual_lun/.skip.MCU_SAMD11
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/msc_dual_lun/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/tinyusb/examples/device/msc_dual_lun/CMakeLists.txt b/tinyusb/examples/device/msc_dual_lun/CMakeLists.txt
deleted file mode 100755
index 9e834ae2..00000000
--- a/tinyusb/examples/device/msc_dual_lun/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk_dual.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/msc_dual_lun/Makefile b/tinyusb/examples/device/msc_dual_lun/Makefile
deleted file mode 100755
index 5a455078..00000000
--- a/tinyusb/examples/device/msc_dual_lun/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/msc_dual_lun/src/main.c b/tinyusb/examples/device/msc_dual_lun/src/main.c
deleted file mode 100755
index 0293261a..00000000
--- a/tinyusb/examples/device/msc_dual_lun/src/main.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-void led_blinking_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/msc_dual_lun/src/msc_disk_dual.c b/tinyusb/examples/device/msc_dual_lun/src/msc_disk_dual.c
deleted file mode 100755
index 2ab050da..00000000
--- a/tinyusb/examples/device/msc_dual_lun/src/msc_disk_dual.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-#if CFG_TUD_MSC
-
-// Some MCU doesn't have enough 8KB SRAM to store the whole disk
-// We will use Flash as read-only disk with board that has
-// CFG_EXAMPLE_MSC_READONLY defined
-
-enum
-{
- DISK_BLOCK_NUM = 16, // 8KB is the smallest size that windows allow to mount
- DISK_BLOCK_SIZE = 512
-};
-
-
-//--------------------------------------------------------------------+
-// LUN 0
-//--------------------------------------------------------------------+
-#define README0_CONTENTS \
-"LUN0: This is tinyusb's MassStorage Class demo.\r\n\r\n\
-If you find any bugs or get any questions, feel free to file an\r\n\
-issue at github.com/hathach/tinyusb"
-
-
-#ifdef CFG_EXAMPLE_MSC_READONLY
-const
-#endif
-uint8_t msc_disk0[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
-{
- //------------- Block0: Boot Sector -------------//
- // byte_per_sector = DISK_BLOCK_SIZE; fat12_sector_num_16 = DISK_BLOCK_NUM;
- // sector_per_cluster = 1; reserved_sectors = 1;
- // fat_num = 1; fat12_root_entry_num = 16;
- // sector_per_fat = 1; sector_per_track = 1; head_num = 1; hidden_sectors = 0;
- // drive_number = 0x80; media_type = 0xf8; extended_boot_signature = 0x29;
- // filesystem_type = "FAT12 "; volume_serial_number = 0x1234; volume_label = "TinyUSB 0 ";
- // FAT magic code at offset 510-511
- {
- 0xEB, 0x3C, 0x90, 0x4D, 0x53, 0x44, 0x4F, 0x53, 0x35, 0x2E, 0x30, 0x00, 0x02, 0x01, 0x01, 0x00,
- 0x01, 0x10, 0x00, 0x10, 0x00, 0xF8, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x29, 0x34, 0x12, 0x00, 0x00, 'T' , 'i' , 'n' , 'y' , 'U' ,
- 'S' , 'B' , ' ' , '0' , ' ' , ' ' , 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00,
-
- // Zero up to 2 last bytes of FAT magic code
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA
- },
-
- //------------- Block1: FAT12 Table -------------//
- {
- 0xF8, 0xFF, 0xFF, 0xFF, 0x0F // // first 2 entries must be F8FF, third entry is cluster end of readme file
- },
-
- //------------- Block2: Root Directory -------------//
- {
- // first entry is volume label
- 'T' , 'i' , 'n' , 'y' , 'U' , 'S' , 'B' , ' ' , '0' , ' ' , ' ' , 0x08, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x6D, 0x65, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // second entry is readme file
- 'R' , 'E' , 'A' , 'D' , 'M' , 'E' , '0' , ' ' , 'T' , 'X' , 'T' , 0x20, 0x00, 0xC6, 0x52, 0x6D,
- 0x65, 0x43, 0x65, 0x43, 0x00, 0x00, 0x88, 0x6D, 0x65, 0x43, 0x02, 0x00,
- sizeof(README0_CONTENTS)-1, 0x00, 0x00, 0x00 // readme's files size (4 Bytes)
- },
-
- //------------- Block3: Readme Content -------------//
- README0_CONTENTS
-};
-
-//--------------------------------------------------------------------+
-// LUN 1
-//--------------------------------------------------------------------+
-#define README1_CONTENTS \
-"LUN1: This is tinyusb's MassStorage Class demo.\r\n\r\n\
-If you find any bugs or get any questions, feel free to file an\r\n\
-issue at github.com/hathach/tinyusb"
-
-#ifdef CFG_EXAMPLE_MSC_READONLY
-const
-#endif
-uint8_t msc_disk1[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
-{
- //------------- Block0: Boot Sector -------------//
- // byte_per_sector = DISK_BLOCK_SIZE; fat12_sector_num_16 = DISK_BLOCK_NUM;
- // sector_per_cluster = 1; reserved_sectors = 1;
- // fat_num = 1; fat12_root_entry_num = 16;
- // sector_per_fat = 1; sector_per_track = 1; head_num = 1; hidden_sectors = 0;
- // drive_number = 0x80; media_type = 0xf8; extended_boot_signature = 0x29;
- // filesystem_type = "FAT12 "; volume_serial_number = 0x5678; volume_label = "TinyUSB 1 ";
- // FAT magic code at offset 510-511
- {
- 0xEB, 0x3C, 0x90, 0x4D, 0x53, 0x44, 0x4F, 0x53, 0x35, 0x2E, 0x30, 0x00, 0x02, 0x01, 0x01, 0x00,
- 0x01, 0x10, 0x00, 0x10, 0x00, 0xF8, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x29, 0x78, 0x56, 0x00, 0x00, 'T' , 'i' , 'n' , 'y' , 'U' ,
- 'S' , 'B' , ' ' , '1' , ' ' , ' ' , 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00,
-
- // Zero up to 2 last bytes of FAT magic code
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA
- },
-
- //------------- Block1: FAT12 Table -------------//
- {
- 0xF8, 0xFF, 0xFF, 0xFF, 0x0F // // first 2 entries must be F8FF, third entry is cluster end of readme file
- },
-
- //------------- Block2: Root Directory -------------//
- {
- // first entry is volume label
- 'T' , 'i' , 'n' , 'y' , 'U' , 'S' , 'B' , ' ' , '1' , ' ' , ' ' , 0x08, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x6D, 0x65, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // second entry is readme file
- 'R' , 'E' , 'A' , 'D' , 'M' , 'E' , '1' , ' ' , 'T' , 'X' , 'T' , 0x20, 0x00, 0xC6, 0x52, 0x6D,
- 0x65, 0x43, 0x65, 0x43, 0x00, 0x00, 0x88, 0x6D, 0x65, 0x43, 0x02, 0x00,
- sizeof(README1_CONTENTS)-1, 0x00, 0x00, 0x00 // readme's files size (4 Bytes)
- },
-
- //------------- Block3: Readme Content -------------//
- README1_CONTENTS
-};
-
-// Invoked to determine max LUN
-uint8_t tud_msc_get_maxlun_cb(void)
-{
- return 2; // dual LUN
-}
-
-// Invoked when received SCSI_CMD_INQUIRY
-// Application fill vendor id, product id and revision with string up to 8, 16, 4 characters respectively
-void tud_msc_inquiry_cb(uint8_t lun, uint8_t vendor_id[8], uint8_t product_id[16], uint8_t product_rev[4])
-{
- (void) lun; // use same ID for both LUNs
-
- const char vid[] = "TinyUSB";
- const char pid[] = "Mass Storage";
- const char rev[] = "1.0";
-
- memcpy(vendor_id , vid, strlen(vid));
- memcpy(product_id , pid, strlen(pid));
- memcpy(product_rev, rev, strlen(rev));
-}
-
-// Invoked when received Test Unit Ready command.
-// return true allowing host to read/write this LUN e.g SD card inserted
-bool tud_msc_test_unit_ready_cb(uint8_t lun)
-{
- (void) lun;
-
- return true; // RAM disk is always ready
-}
-
-// Invoked when received SCSI_CMD_READ_CAPACITY_10 and SCSI_CMD_READ_FORMAT_CAPACITY to determine the disk size
-// Application update block count and block size
-void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_size)
-{
- (void) lun;
-
- *block_count = DISK_BLOCK_NUM;
- *block_size = DISK_BLOCK_SIZE;
-}
-
-// Invoked when received Start Stop Unit command
-// - Start = 0 : stopped power mode, if load_eject = 1 : unload disk storage
-// - Start = 1 : active mode, if load_eject = 1 : load disk storage
-bool tud_msc_start_stop_cb(uint8_t lun, uint8_t power_condition, bool start, bool load_eject)
-{
- (void) lun;
- (void) power_condition;
-
- if ( load_eject )
- {
- if (start)
- {
- // load disk storage
- }else
- {
- // unload disk storage
- }
- }
-
- return true;
-}
-
-// Callback invoked when received READ10 command.
-// Copy disk's data to buffer (up to bufsize) and return number of copied bytes.
-int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize)
-{
- uint8_t const* addr = (lun ? msc_disk1[lba] : msc_disk0[lba]) + offset;
- memcpy(buffer, addr, bufsize);
-
- return bufsize;
-}
-
-// Callback invoked when received WRITE10 command.
-// Process data in buffer to disk's storage and return number of written bytes
-int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize)
-{
-#ifndef CFG_EXAMPLE_MSC_READONLY
- uint8_t* addr = (lun ? msc_disk1[lba] : msc_disk0[lba]) + offset;
- memcpy(addr, buffer, bufsize);
-#else
- (void) lun; (void) lba; (void) offset; (void) buffer;
-#endif
-
- return bufsize;
-}
-
-// Callback invoked when received an SCSI command not in built-in list below
-// - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, MODE_SENSE6, REQUEST_SENSE
-// - READ10 and WRITE10 has their own callbacks
-int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize)
-{
- // read10 & write10 has their own callback and MUST not be handled here
-
- void const* response = NULL;
- uint16_t resplen = 0;
-
- // most scsi handled is input
- bool in_xfer = true;
-
- switch (scsi_cmd[0])
- {
- case SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL:
- // Host is about to read/write etc ... better not to disconnect disk
- resplen = 0;
- break;
-
- case SCSI_CMD_START_STOP_UNIT:
- // Host try to eject/safe remove/poweroff us. We could safely disconnect with disk storage, or go into lower power
- /* scsi_start_stop_unit_t const * start_stop = (scsi_start_stop_unit_t const *) scsi_cmd;
- // Start bit = 0 : low power mode, if load_eject = 1 : unmount disk storage as well
- // Start bit = 1 : Ready mode, if load_eject = 1 : mount disk storage
- start_stop->start;
- start_stop->load_eject;
- */
- resplen = 0;
- break;
-
-
- default:
- // Set Sense = Invalid Command Operation
- tud_msc_set_sense(lun, SCSI_SENSE_ILLEGAL_REQUEST, 0x20, 0x00);
-
- // negative means error -> tinyusb could stall and/or response with failed status
- resplen = -1;
- break;
- }
-
- // return resplen must not larger than bufsize
- if ( resplen > bufsize ) resplen = bufsize;
-
- if ( response && (resplen > 0) )
- {
- if(in_xfer)
- {
- memcpy(buffer, response, resplen);
- }else
- {
- // SCSI output
- }
- }
-
- return resplen;
-}
-
-#endif
diff --git a/tinyusb/examples/device/msc_dual_lun/src/tusb_config.h b/tinyusb/examples/device/msc_dual_lun/src/tusb_config.h
deleted file mode 100755
index 44da21e5..00000000
--- a/tinyusb/examples/device/msc_dual_lun/src/tusb_config.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 1
-#define CFG_TUD_HID 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_VENDOR 0
-
-// MSC Buffer size of Device Mass storage
-#define CFG_TUD_MSC_EP_BUFSIZE 512
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/msc_dual_lun/src/usb_descriptors.c b/tinyusb/examples/device/msc_dual_lun/src/usb_descriptors.c
deleted file mode 100755
index 138de62a..00000000
--- a/tinyusb/examples/device/msc_dual_lun/src/usb_descriptors.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
- .bDeviceClass = 0x00,
- .bDeviceSubClass = 0x00,
- .bDeviceProtocol = 0x00,
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-enum
-{
- ITF_NUM_MSC,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_MSC_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
- // LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
- // 0 control, 1 In, 2 Bulk, 3 Iso, 4 In, 5 Bulk etc ...
- #define EPNUM_MSC_OUT 0x02
- #define EPNUM_MSC_IN 0x82
-
-#elif CFG_TUSB_MCU == OPT_MCU_SAMG
- // SAMG doesn't support a same endpoint number with different direction IN and OUT
- // e.g EP1 OUT & EP1 IN cannot exist together
- #define EPNUM_MSC_OUT 0x01
- #define EPNUM_MSC_IN 0x82
-
-#else
- #define EPNUM_MSC_OUT 0x01
- #define EPNUM_MSC_IN 0x81
-
-#endif
-
-uint8_t const desc_fs_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 0, EPNUM_MSC_OUT, EPNUM_MSC_IN, 64),
-};
-
-#if TUD_OPT_HIGH_SPEED
-uint8_t const desc_hs_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 0, EPNUM_MSC_OUT, EPNUM_MSC_IN, 512),
-};
-#endif
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
-
-#if TUD_OPT_HIGH_SPEED
- // Although we are highspeed, host may be fullspeed.
- return (tud_speed_get() == TUSB_SPEED_HIGH) ? desc_hs_configuration : desc_fs_configuration;
-#else
- return desc_fs_configuration;
-#endif
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_LPC11UXX b/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_LPC11UXX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_LPC11UXX
+++ /dev/null
diff --git a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_LPC13XX b/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_LPC13XX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_LPC13XX
+++ /dev/null
diff --git a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_MKL25ZXX b/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_MKL25ZXX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_MKL25ZXX
+++ /dev/null
diff --git a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_MSP430x5xx b/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_MSP430x5xx
deleted file mode 100755
index 17600f06..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_MSP430x5xx
+++ /dev/null
@@ -1 +0,0 @@
-too many warnings for 16-bit integer overflow
diff --git a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_NUC121 b/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_NUC121
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_NUC121
+++ /dev/null
diff --git a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_SAMD11 b/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_SAMD11
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_STM32L0 b/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_STM32L0
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/.skip.MCU_STM32L0
+++ /dev/null
diff --git a/tinyusb/examples/device/net_lwip_webserver/CMakeLists.txt b/tinyusb/examples/device/net_lwip_webserver/CMakeLists.txt
deleted file mode 100755
index 7500f6e9..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/CMakeLists.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-set(TOP "../../..")
-get_filename_component(TOP "${TOP}" REALPATH)
-
-if (EXISTS ${TOP}/lib/lwip/src)
- include(${TOP}/hw/bsp/family_support.cmake)
-
- # gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
- family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
- project(${PROJECT})
-
- # Checks this example is valid for the family and initializes the project
- family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
- add_executable(${PROJECT})
-
- # Example source
- target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
- # Example include
- target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- ${TOP}/lib/lwip/src/include
- ${TOP}/lib/lwip/src/include/ipv4
- ${TOP}/lib/lwip/src/include/lwip/apps
- ${TOP}/lib/networking
- )
-
- target_sources(${PROJECT} PUBLIC
- ${TOP}/lib/lwip/src/core/altcp.c
- ${TOP}/lib/lwip/src/core/altcp_alloc.c
- ${TOP}/lib/lwip/src/core/altcp_tcp.c
- ${TOP}/lib/lwip/src/core/def.c
- ${TOP}/lib/lwip/src/core/dns.c
- ${TOP}/lib/lwip/src/core/inet_chksum.c
- ${TOP}/lib/lwip/src/core/init.c
- ${TOP}/lib/lwip/src/core/ip.c
- ${TOP}/lib/lwip/src/core/mem.c
- ${TOP}/lib/lwip/src/core/memp.c
- ${TOP}/lib/lwip/src/core/netif.c
- ${TOP}/lib/lwip/src/core/pbuf.c
- ${TOP}/lib/lwip/src/core/raw.c
- ${TOP}/lib/lwip/src/core/stats.c
- ${TOP}/lib/lwip/src/core/sys.c
- ${TOP}/lib/lwip/src/core/tcp.c
- ${TOP}/lib/lwip/src/core/tcp_in.c
- ${TOP}/lib/lwip/src/core/tcp_out.c
- ${TOP}/lib/lwip/src/core/timeouts.c
- ${TOP}/lib/lwip/src/core/udp.c
- ${TOP}/lib/lwip/src/core/ipv4/autoip.c
- ${TOP}/lib/lwip/src/core/ipv4/dhcp.c
- ${TOP}/lib/lwip/src/core/ipv4/etharp.c
- ${TOP}/lib/lwip/src/core/ipv4/icmp.c
- ${TOP}/lib/lwip/src/core/ipv4/igmp.c
- ${TOP}/lib/lwip/src/core/ipv4/ip4.c
- ${TOP}/lib/lwip/src/core/ipv4/ip4_addr.c
- ${TOP}/lib/lwip/src/core/ipv4/ip4_frag.c
- ${TOP}/lib/lwip/src/netif/ethernet.c
- ${TOP}/lib/lwip/src/netif/slipif.c
- ${TOP}/lib/lwip/src/apps/http/httpd.c
- ${TOP}/lib/lwip/src/apps/http/fs.c
- ${TOP}/lib/networking/dhserver.c
- ${TOP}/lib/networking/dnserver.c
- ${TOP}/lib/networking/rndis_reports.c
- )
-
- target_compile_definitions(${PROJECT} PUBLIC
- PBUF_POOL_SIZE=2
- TCP_WND=2*TCP_MSS
- HTTPD_USE_CUSTOM_FSDATA=0
- )
-
- # Configure compilation flags and libraries for the example... see the corresponding function
- # in hw/bsp/FAMILY/family.cmake for details.
- family_configure_device_example(${PROJECT})
-endif() \ No newline at end of file
diff --git a/tinyusb/examples/device/net_lwip_webserver/Makefile b/tinyusb/examples/device/net_lwip_webserver/Makefile
deleted file mode 100755
index c3e0d889..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/Makefile
+++ /dev/null
@@ -1,61 +0,0 @@
-DEPS_SUBMODULES += lib/lwip
-
-include ../../../tools/top.mk
-include ../../make.mk
-
-CFLAGS += \
- -DPBUF_POOL_SIZE=2 \
- -DTCP_WND=2*TCP_MSS \
- -DHTTPD_USE_CUSTOM_FSDATA=0
-
-INC += \
- src \
- $(TOP)/hw \
- $(TOP)/lib/lwip/src/include \
- $(TOP)/lib/lwip/src/include/ipv4 \
- $(TOP)/lib/lwip/src/include/lwip/apps \
- $(TOP)/lib/networking
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-# lwip sources
-SRC_C += \
- lib/lwip/src/core/altcp.c \
- lib/lwip/src/core/altcp_alloc.c \
- lib/lwip/src/core/altcp_tcp.c \
- lib/lwip/src/core/def.c \
- lib/lwip/src/core/dns.c \
- lib/lwip/src/core/inet_chksum.c \
- lib/lwip/src/core/init.c \
- lib/lwip/src/core/ip.c \
- lib/lwip/src/core/mem.c \
- lib/lwip/src/core/memp.c \
- lib/lwip/src/core/netif.c \
- lib/lwip/src/core/pbuf.c \
- lib/lwip/src/core/raw.c \
- lib/lwip/src/core/stats.c \
- lib/lwip/src/core/sys.c \
- lib/lwip/src/core/tcp.c \
- lib/lwip/src/core/tcp_in.c \
- lib/lwip/src/core/tcp_out.c \
- lib/lwip/src/core/timeouts.c \
- lib/lwip/src/core/udp.c \
- lib/lwip/src/core/ipv4/autoip.c \
- lib/lwip/src/core/ipv4/dhcp.c \
- lib/lwip/src/core/ipv4/etharp.c \
- lib/lwip/src/core/ipv4/icmp.c \
- lib/lwip/src/core/ipv4/igmp.c \
- lib/lwip/src/core/ipv4/ip4.c \
- lib/lwip/src/core/ipv4/ip4_addr.c \
- lib/lwip/src/core/ipv4/ip4_frag.c \
- lib/lwip/src/netif/ethernet.c \
- lib/lwip/src/netif/slipif.c \
- lib/lwip/src/apps/http/httpd.c \
- lib/lwip/src/apps/http/fs.c \
- lib/networking/dhserver.c \
- lib/networking/dnserver.c \
- lib/networking/rndis_reports.c
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/net_lwip_webserver/src/arch/cc.h b/tinyusb/examples/device/net_lwip_webserver/src/arch/cc.h
deleted file mode 100755
index 56a0cacf..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/src/arch/cc.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
- * 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. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- *
- * This file is part of the lwIP TCP/IP stack.
- *
- * Author: Adam Dunkels <adam@sics.se>
- *
- */
-#ifndef __CC_H__
-#define __CC_H__
-
-//#include "cpu.h"
-
-typedef int sys_prot_t;
-
-
-
-/* define compiler specific symbols */
-#if defined (__ICCARM__)
-
-#define PACK_STRUCT_BEGIN
-#define PACK_STRUCT_STRUCT
-#define PACK_STRUCT_END
-#define PACK_STRUCT_FIELD(x) x
-#define PACK_STRUCT_USE_INCLUDES
-
-#elif defined (__CC_ARM)
-
-#define PACK_STRUCT_BEGIN __packed
-#define PACK_STRUCT_STRUCT
-#define PACK_STRUCT_END
-#define PACK_STRUCT_FIELD(x) x
-
-#elif defined (__GNUC__)
-
-#define PACK_STRUCT_BEGIN
-#define PACK_STRUCT_STRUCT __attribute__ ((__packed__))
-#define PACK_STRUCT_END
-#define PACK_STRUCT_FIELD(x) x
-
-#elif defined (__TASKING__)
-
-#define PACK_STRUCT_BEGIN
-#define PACK_STRUCT_STRUCT
-#define PACK_STRUCT_END
-#define PACK_STRUCT_FIELD(x) x
-
-#endif
-
-#define LWIP_PLATFORM_ASSERT(x) do { if(!(x)) while(1); } while(0)
-
-#endif /* __CC_H__ */
diff --git a/tinyusb/examples/device/net_lwip_webserver/src/lwipopts.h b/tinyusb/examples/device/net_lwip_webserver/src/lwipopts.h
deleted file mode 100755
index 5a8096f5..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/src/lwipopts.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
- * 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. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- *
- * This file is part of the lwIP TCP/IP stack.
- *
- * Author: Simon Goldschmidt
- *
- */
-#ifndef __LWIPOPTS_H__
-#define __LWIPOPTS_H__
-
-/* Prevent having to link sys_arch.c (we don't test the API layers in unit tests) */
-#define NO_SYS 1
-#define MEM_ALIGNMENT 4
-#define LWIP_RAW 0
-#define LWIP_NETCONN 0
-#define LWIP_SOCKET 0
-#define LWIP_DHCP 0
-#define LWIP_ICMP 1
-#define LWIP_UDP 1
-#define LWIP_TCP 1
-#define ETH_PAD_SIZE 0
-#define LWIP_IP_ACCEPT_UDP_PORT(p) ((p) == PP_NTOHS(67))
-
-#define TCP_MSS (1500 /*mtu*/ - 20 /*iphdr*/ - 20 /*tcphhr*/)
-#define TCP_SND_BUF (2 * TCP_MSS)
-
-#define ETHARP_SUPPORT_STATIC_ENTRIES 1
-
-#define LWIP_HTTPD_CGI 0
-#define LWIP_HTTPD_SSI 0
-#define LWIP_HTTPD_SSI_INCLUDE_TAG 0
-
-#define LWIP_SINGLE_NETIF 1
-
-#endif /* __LWIPOPTS_H__ */
diff --git a/tinyusb/examples/device/net_lwip_webserver/src/main.c b/tinyusb/examples/device/net_lwip_webserver/src/main.c
deleted file mode 100755
index 80831921..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/src/main.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Peter Lawrence
- *
- * influenced by lrndis https://github.com/fetisov/lrndis
- *
- * 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 appears as either a RNDIS or CDC-ECM USB virtual network adapter; the OS picks its preference
-
-RNDIS should be valid on Linux and Windows hosts, and CDC-ECM should be valid on Linux and macOS hosts
-
-The MCU appears to the host as IP address 192.168.7.1, and provides a DHCP server, DNS server, and web server.
-*/
-/*
-Some smartphones *may* work with this implementation as well, but likely have limited (broken) drivers,
-and likely their manufacturer has not tested such functionality. Some code workarounds could be tried:
-
-The smartphone may only have an ECM driver, but refuse to automatically pick ECM (unlike the OSes above);
-try modifying ./examples/devices/net_lwip_webserver/usb_descriptors.c so that CONFIG_ID_ECM is default.
-
-The smartphone may be artificially picky about which Ethernet MAC address to recognize; if this happens,
-try changing the first byte of tud_network_mac_address[] below from 0x02 to 0x00 (clearing bit 1).
-*/
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-#include "dhserver.h"
-#include "dnserver.h"
-#include "lwip/init.h"
-#include "lwip/timeouts.h"
-#include "httpd.h"
-
-/* lwip context */
-static struct netif netif_data;
-
-/* shared between tud_network_recv_cb() and service_traffic() */
-static struct pbuf *received_frame;
-
-/* this is used by this code, ./class/net/net_driver.c, and usb_descriptors.c */
-/* ideally speaking, this should be generated from the hardware's unique ID (if available) */
-/* it is suggested that the first byte is 0x02 to indicate a link-local address */
-const uint8_t tud_network_mac_address[6] = {0x02,0x02,0x84,0x6A,0x96,0x00};
-
-/* network parameters of this MCU */
-static const ip_addr_t ipaddr = IPADDR4_INIT_BYTES(192, 168, 7, 1);
-static const ip_addr_t netmask = IPADDR4_INIT_BYTES(255, 255, 255, 0);
-static const ip_addr_t gateway = IPADDR4_INIT_BYTES(0, 0, 0, 0);
-
-/* database IP addresses that can be offered to the host; this must be in RAM to store assigned MAC addresses */
-static dhcp_entry_t entries[] =
-{
- /* mac ip address lease time */
- { {0}, IPADDR4_INIT_BYTES(192, 168, 7, 2), 24 * 60 * 60 },
- { {0}, IPADDR4_INIT_BYTES(192, 168, 7, 3), 24 * 60 * 60 },
- { {0}, IPADDR4_INIT_BYTES(192, 168, 7, 4), 24 * 60 * 60 },
-};
-
-static const dhcp_config_t dhcp_config =
-{
- .router = IPADDR4_INIT_BYTES(0, 0, 0, 0), /* router address (if any) */
- .port = 67, /* listen port */
- .dns = IPADDR4_INIT_BYTES(192, 168, 7, 1), /* dns server (if any) */
- "usb", /* dns suffix */
- TU_ARRAY_SIZE(entries), /* num entry */
- entries /* entries */
-};
-static err_t linkoutput_fn(struct netif *netif, struct pbuf *p)
-{
- (void)netif;
-
- for (;;)
- {
- /* if TinyUSB isn't ready, we must signal back to lwip that there is nothing we can do */
- if (!tud_ready())
- return ERR_USE;
-
- /* if the network driver can accept another packet, we make it happen */
- if (tud_network_can_xmit())
- {
- tud_network_xmit(p, 0 /* unused for this example */);
- return ERR_OK;
- }
-
- /* transfer execution to TinyUSB in the hopes that it will finish transmitting the prior packet */
- tud_task();
- }
-}
-
-static err_t output_fn(struct netif *netif, struct pbuf *p, const ip_addr_t *addr)
-{
- return etharp_output(netif, p, addr);
-}
-
-static err_t netif_init_cb(struct netif *netif)
-{
- LWIP_ASSERT("netif != NULL", (netif != NULL));
- netif->mtu = CFG_TUD_NET_MTU;
- netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP | NETIF_FLAG_UP;
- netif->state = NULL;
- netif->name[0] = 'E';
- netif->name[1] = 'X';
- netif->linkoutput = linkoutput_fn;
- netif->output = output_fn;
- return ERR_OK;
-}
-
-static void init_lwip(void)
-{
- struct netif *netif = &netif_data;
-
- lwip_init();
-
- /* the lwip virtual MAC address must be different from the host's; to ensure this, we toggle the LSbit */
- netif->hwaddr_len = sizeof(tud_network_mac_address);
- memcpy(netif->hwaddr, tud_network_mac_address, sizeof(tud_network_mac_address));
- netif->hwaddr[5] ^= 0x01;
-
- netif = netif_add(netif, &ipaddr, &netmask, &gateway, NULL, netif_init_cb, ip_input);
- netif_set_default(netif);
-}
-
-/* handle any DNS requests from dns-server */
-bool dns_query_proc(const char *name, ip_addr_t *addr)
-{
- if (0 == strcmp(name, "tiny.usb"))
- {
- *addr = ipaddr;
- return true;
- }
- return false;
-}
-
-bool tud_network_recv_cb(const uint8_t *src, uint16_t size)
-{
- /* this shouldn't happen, but if we get another packet before
- parsing the previous, we must signal our inability to accept it */
- if (received_frame) return false;
-
- if (size)
- {
- struct pbuf *p = pbuf_alloc(PBUF_RAW, size, PBUF_POOL);
-
- if (p)
- {
- /* pbuf_alloc() has already initialized struct; all we need to do is copy the data */
- memcpy(p->payload, src, size);
-
- /* store away the pointer for service_traffic() to later handle */
- received_frame = p;
- }
- }
-
- return true;
-}
-
-uint16_t tud_network_xmit_cb(uint8_t *dst, void *ref, uint16_t arg)
-{
- struct pbuf *p = (struct pbuf *)ref;
-
- (void)arg; /* unused for this example */
-
- return pbuf_copy_partial(p, dst, p->tot_len, 0);
-}
-
-static void service_traffic(void)
-{
- /* handle any packet received by tud_network_recv_cb() */
- if (received_frame)
- {
- ethernet_input(received_frame, &netif_data);
- pbuf_free(received_frame);
- received_frame = NULL;
- tud_network_recv_renew();
- }
-
- sys_check_timeouts();
-}
-
-void tud_network_init_cb(void)
-{
- /* if the network is re-initializing and we have a leftover packet, we must do a cleanup */
- if (received_frame)
- {
- pbuf_free(received_frame);
- received_frame = NULL;
- }
-}
-
-int main(void)
-{
- /* initialize TinyUSB */
- board_init();
- tusb_init();
-
- /* initialize lwip, dhcp-server, dns-server, and http */
- init_lwip();
- while (!netif_is_up(&netif_data));
- while (dhserv_init(&dhcp_config) != ERR_OK);
- while (dnserv_init(&ipaddr, 53, dns_query_proc) != ERR_OK);
- httpd_init();
-
- while (1)
- {
- tud_task();
- service_traffic();
- }
-
- return 0;
-}
-
-/* lwip has provision for using a mutex, when applicable */
-sys_prot_t sys_arch_protect(void)
-{
- return 0;
-}
-void sys_arch_unprotect(sys_prot_t pval)
-{
- (void)pval;
-}
-
-/* lwip needs a millisecond time source, and the TinyUSB board support code has one available */
-uint32_t sys_now(void)
-{
- return board_millis();
-}
diff --git a/tinyusb/examples/device/net_lwip_webserver/src/tusb_config.h b/tinyusb/examples/device/net_lwip_webserver/src/tusb_config.h
deleted file mode 100755
index 262d4ebc..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/src/tusb_config.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 0
-#define CFG_TUD_HID 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_VENDOR 0
-#define CFG_TUD_NET 1
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/net_lwip_webserver/src/usb_descriptors.c b/tinyusb/examples/device/net_lwip_webserver/src/usb_descriptors.c
deleted file mode 100755
index 71e6c458..00000000
--- a/tinyusb/examples/device/net_lwip_webserver/src/usb_descriptors.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] NET | VENDOR | MIDI | HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) | _PID_MAP(NET, 5) )
-
-// String Descriptor Index
-enum
-{
- STRID_LANGID = 0,
- STRID_MANUFACTURER,
- STRID_PRODUCT,
- STRID_SERIAL,
- STRID_INTERFACE,
- STRID_MAC
-};
-
-enum
-{
- ITF_NUM_CDC = 0,
- ITF_NUM_CDC_DATA,
- ITF_NUM_TOTAL
-};
-
-enum
-{
- CONFIG_ID_RNDIS = 0,
- CONFIG_ID_ECM = 1,
- CONFIG_ID_COUNT
-};
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
-
- // Use Interface Association Descriptor (IAD) device class
- .bDeviceClass = TUSB_CLASS_MISC,
- .bDeviceSubClass = MISC_SUBCLASS_COMMON,
- .bDeviceProtocol = MISC_PROTOCOL_IAD,
-
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0101,
-
- .iManufacturer = STRID_MANUFACTURER,
- .iProduct = STRID_PRODUCT,
- .iSerialNumber = STRID_SERIAL,
-
- .bNumConfigurations = CONFIG_ID_COUNT // multiple configurations
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-#define MAIN_CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_RNDIS_DESC_LEN)
-#define ALT_CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_CDC_ECM_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
- // LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
- // 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
- #define EPNUM_NET_NOTIF 0x81
- #define EPNUM_NET_OUT 0x02
- #define EPNUM_NET_IN 0x82
-
-#elif CFG_TUSB_MCU == OPT_MCU_SAMG || CFG_TUSB_MCU == OPT_MCU_SAMX7X
- // SAMG & SAME70 don't support a same endpoint number with different direction IN and OUT
- // e.g EP1 OUT & EP1 IN cannot exist together
- #define EPNUM_NET_NOTIF 0x81
- #define EPNUM_NET_OUT 0x02
- #define EPNUM_NET_IN 0x83
-
-#else
- #define EPNUM_NET_NOTIF 0x81
- #define EPNUM_NET_OUT 0x02
- #define EPNUM_NET_IN 0x82
-#endif
-
-static uint8_t const rndis_configuration[] =
-{
- // Config number (index+1), interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(CONFIG_ID_RNDIS+1, ITF_NUM_TOTAL, 0, MAIN_CONFIG_TOTAL_LEN, 0, 100),
-
- // Interface number, string index, EP notification address and size, EP data address (out, in) and size.
- TUD_RNDIS_DESCRIPTOR(ITF_NUM_CDC, STRID_INTERFACE, EPNUM_NET_NOTIF, 8, EPNUM_NET_OUT, EPNUM_NET_IN, CFG_TUD_NET_ENDPOINT_SIZE),
-};
-
-static uint8_t const ecm_configuration[] =
-{
- // Config number (index+1), interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(CONFIG_ID_ECM+1, ITF_NUM_TOTAL, 0, ALT_CONFIG_TOTAL_LEN, 0, 100),
-
- // Interface number, description string index, MAC address string index, EP notification address and size, EP data address (out, in), and size, max segment size.
- TUD_CDC_ECM_DESCRIPTOR(ITF_NUM_CDC, STRID_INTERFACE, STRID_MAC, EPNUM_NET_NOTIF, 64, EPNUM_NET_OUT, EPNUM_NET_IN, CFG_TUD_NET_ENDPOINT_SIZE, CFG_TUD_NET_MTU),
-};
-
-// Configuration array: RNDIS and CDC-ECM
-// - Windows only works with RNDIS
-// - MacOS only works with CDC-ECM
-// - Linux will work on both
-static uint8_t const * const configuration_arr[2] =
-{
- [CONFIG_ID_RNDIS] = rndis_configuration,
- [CONFIG_ID_ECM ] = ecm_configuration
-};
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- return (index < CONFIG_ID_COUNT) ? configuration_arr[index] : NULL;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-static char const* string_desc_arr [] =
-{
- [STRID_LANGID] = (const char[]) { 0x09, 0x04 }, // supported language is English (0x0409)
- [STRID_MANUFACTURER] = "TinyUSB", // Manufacturer
- [STRID_PRODUCT] = "TinyUSB Device", // Product
- [STRID_SERIAL] = "123456", // Serial
- [STRID_INTERFACE] = "TinyUSB Network Interface" // Interface Description
-
- // STRID_MAC index is handled separately
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- unsigned int chr_count = 0;
-
- if (STRID_LANGID == index)
- {
- memcpy(&_desc_str[1], string_desc_arr[STRID_LANGID], 2);
- chr_count = 1;
- }
- else if (STRID_MAC == index)
- {
- // Convert MAC address into UTF-16
-
- for (unsigned i=0; i<sizeof(tud_network_mac_address); i++)
- {
- _desc_str[1+chr_count++] = "0123456789ABCDEF"[(tud_network_mac_address[i] >> 4) & 0xf];
- _desc_str[1+chr_count++] = "0123456789ABCDEF"[(tud_network_mac_address[i] >> 0) & 0xf];
- }
- }
- else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > (TU_ARRAY_SIZE(_desc_str) - 1)) chr_count = TU_ARRAY_SIZE(_desc_str) - 1;
-
- // Convert ASCII string into UTF-16
- for (unsigned int i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/uac2_headset/.skip.MCU_LPC11UXX b/tinyusb/examples/device/uac2_headset/.skip.MCU_LPC11UXX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/uac2_headset/.skip.MCU_LPC11UXX
+++ /dev/null
diff --git a/tinyusb/examples/device/uac2_headset/.skip.MCU_LPC13XX b/tinyusb/examples/device/uac2_headset/.skip.MCU_LPC13XX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/uac2_headset/.skip.MCU_LPC13XX
+++ /dev/null
diff --git a/tinyusb/examples/device/uac2_headset/.skip.MCU_NUC121 b/tinyusb/examples/device/uac2_headset/.skip.MCU_NUC121
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/uac2_headset/.skip.MCU_NUC121
+++ /dev/null
diff --git a/tinyusb/examples/device/uac2_headset/.skip.MCU_SAMD11 b/tinyusb/examples/device/uac2_headset/.skip.MCU_SAMD11
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/uac2_headset/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/tinyusb/examples/device/uac2_headset/.skip.MCU_SAME5X b/tinyusb/examples/device/uac2_headset/.skip.MCU_SAME5X
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/uac2_headset/.skip.MCU_SAME5X
+++ /dev/null
diff --git a/tinyusb/examples/device/uac2_headset/.skip.MCU_SAMG b/tinyusb/examples/device/uac2_headset/.skip.MCU_SAMG
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/device/uac2_headset/.skip.MCU_SAMG
+++ /dev/null
diff --git a/tinyusb/examples/device/uac2_headset/CMakeLists.txt b/tinyusb/examples/device/uac2_headset/CMakeLists.txt
deleted file mode 100755
index abc4d91d..00000000
--- a/tinyusb/examples/device/uac2_headset/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/uac2_headset/Makefile b/tinyusb/examples/device/uac2_headset/Makefile
deleted file mode 100755
index 5a455078..00000000
--- a/tinyusb/examples/device/uac2_headset/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/uac2_headset/src/main.c b/tinyusb/examples/device/uac2_headset/src/main.c
deleted file mode 100755
index 790af088..00000000
--- a/tinyusb/examples/device/uac2_headset/src/main.c
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Jerzy Kasenberg
- *
- * 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.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-#include "usb_descriptors.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTOTYPES
-//--------------------------------------------------------------------+
-
-// List of supported sample rates
-#if defined(__RX__)
-const uint32_t sample_rates[] = {44100, 48000};
-#else
-const uint32_t sample_rates[] = {44100, 48000, 88200, 96000};
-#endif
-uint32_t current_sample_rate = 44100;
-
-#define N_SAMPLE_RATES TU_ARRAY_SIZE(sample_rates)
-
-/* Blink pattern
- * - 25 ms : streaming data
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum
-{
- BLINK_STREAMING = 25,
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-};
-
-enum
-{
- VOLUME_CTRL_0_DB = 0,
- VOLUME_CTRL_10_DB = 2560,
- VOLUME_CTRL_20_DB = 5120,
- VOLUME_CTRL_30_DB = 7680,
- VOLUME_CTRL_40_DB = 10240,
- VOLUME_CTRL_50_DB = 12800,
- VOLUME_CTRL_60_DB = 15360,
- VOLUME_CTRL_70_DB = 17920,
- VOLUME_CTRL_80_DB = 20480,
- VOLUME_CTRL_90_DB = 23040,
- VOLUME_CTRL_100_DB = 25600,
- VOLUME_CTRL_SILENCE = 0x8000,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-// Audio controls
-// Current states
-int8_t mute[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX + 1]; // +1 for master channel 0
-int16_t volume[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX + 1]; // +1 for master channel 0
-
-// Buffer for microphone data
-int32_t mic_buf[CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ / 4];
-// Buffer for speaker data
-int32_t spk_buf[CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ / 4];
-// Speaker data size received in the last frame
-int spk_data_size;
-// Resolution per format
-const uint8_t resolutions_per_format[CFG_TUD_AUDIO_FUNC_1_N_FORMATS] = {CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_RX,
- CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_RX};
-// Current resolution, update on format change
-uint8_t current_resolution;
-
-void led_blinking_task(void);
-void audio_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- tusb_init();
-
- TU_LOG1("Headset running\r\n");
-
- while (1)
- {
- tud_task(); // TinyUSB device task
- audio_task();
- led_blinking_task();
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void)remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Helper for clock get requests
-static bool tud_audio_clock_get_request(uint8_t rhport, audio_control_request_t const *request)
-{
- TU_ASSERT(request->bEntityID == UAC2_ENTITY_CLOCK);
-
- if (request->bControlSelector == AUDIO_CS_CTRL_SAM_FREQ)
- {
- if (request->bRequest == AUDIO_CS_REQ_CUR)
- {
- TU_LOG1("Clock get current freq %u\r\n", current_sample_rate);
-
- audio_control_cur_4_t curf = { tu_htole32(current_sample_rate) };
- return tud_audio_buffer_and_schedule_control_xfer(rhport, (tusb_control_request_t const *)request, &curf, sizeof(curf));
- }
- else if (request->bRequest == AUDIO_CS_REQ_RANGE)
- {
- audio_control_range_4_n_t(N_SAMPLE_RATES) rangef =
- {
- .wNumSubRanges = tu_htole16(N_SAMPLE_RATES)
- };
- TU_LOG1("Clock get %d freq ranges\r\n", N_SAMPLE_RATES);
- for(uint8_t i = 0; i < N_SAMPLE_RATES; i++)
- {
- rangef.subrange[i].bMin = sample_rates[i];
- rangef.subrange[i].bMax = sample_rates[i];
- rangef.subrange[i].bRes = 0;
- TU_LOG1("Range %d (%d, %d, %d)\r\n", i, (int)rangef.subrange[i].bMin, (int)rangef.subrange[i].bMax, (int)rangef.subrange[i].bRes);
- }
-
- return tud_audio_buffer_and_schedule_control_xfer(rhport, (tusb_control_request_t const *)request, &rangef, sizeof(rangef));
- }
- }
- else if (request->bControlSelector == AUDIO_CS_CTRL_CLK_VALID &&
- request->bRequest == AUDIO_CS_REQ_CUR)
- {
- audio_control_cur_1_t cur_valid = { .bCur = 1 };
- TU_LOG1("Clock get is valid %u\r\n", cur_valid.bCur);
- return tud_audio_buffer_and_schedule_control_xfer(rhport, (tusb_control_request_t const *)request, &cur_valid, sizeof(cur_valid));
- }
- TU_LOG1("Clock get request not supported, entity = %u, selector = %u, request = %u\r\n",
- request->bEntityID, request->bControlSelector, request->bRequest);
- return false;
-}
-
-// Helper for clock set requests
-static bool tud_audio_clock_set_request(uint8_t rhport, audio_control_request_t const *request, uint8_t const *buf)
-{
- (void)rhport;
-
- TU_ASSERT(request->bEntityID == UAC2_ENTITY_CLOCK);
- TU_VERIFY(request->bRequest == AUDIO_CS_REQ_CUR);
-
- if (request->bControlSelector == AUDIO_CS_CTRL_SAM_FREQ)
- {
- TU_VERIFY(request->wLength == sizeof(audio_control_cur_4_t));
-
- current_sample_rate = ((audio_control_cur_4_t *)buf)->bCur;
-
- TU_LOG1("Clock set current freq: %d\r\n", current_sample_rate);
-
- return true;
- }
- else
- {
- TU_LOG1("Clock set request not supported, entity = %u, selector = %u, request = %u\r\n",
- request->bEntityID, request->bControlSelector, request->bRequest);
- return false;
- }
-}
-
-// Helper for feature unit get requests
-static bool tud_audio_feature_unit_get_request(uint8_t rhport, audio_control_request_t const *request)
-{
- TU_ASSERT(request->bEntityID == UAC2_ENTITY_SPK_FEATURE_UNIT);
-
- if (request->bControlSelector == AUDIO_FU_CTRL_MUTE && request->bRequest == AUDIO_CS_REQ_CUR)
- {
- audio_control_cur_1_t mute1 = { .bCur = mute[request->bChannelNumber] };
- TU_LOG1("Get channel %u mute %d\r\n", request->bChannelNumber, mute1.bCur);
- return tud_audio_buffer_and_schedule_control_xfer(rhport, (tusb_control_request_t const *)request, &mute1, sizeof(mute1));
- }
- else if (UAC2_ENTITY_SPK_FEATURE_UNIT && request->bControlSelector == AUDIO_FU_CTRL_VOLUME)
- {
- if (request->bRequest == AUDIO_CS_REQ_RANGE)
- {
- audio_control_range_2_n_t(1) range_vol = {
- .wNumSubRanges = tu_htole16(1),
- .subrange[0] = { .bMin = tu_htole16(-VOLUME_CTRL_50_DB), tu_htole16(VOLUME_CTRL_0_DB), tu_htole16(256) }
- };
- TU_LOG1("Get channel %u volume range (%d, %d, %u) dB\r\n", request->bChannelNumber,
- range_vol.subrange[0].bMin / 256, range_vol.subrange[0].bMax / 256, range_vol.subrange[0].bRes / 256);
- return tud_audio_buffer_and_schedule_control_xfer(rhport, (tusb_control_request_t const *)request, &range_vol, sizeof(range_vol));
- }
- else if (request->bRequest == AUDIO_CS_REQ_CUR)
- {
- audio_control_cur_2_t cur_vol = { .bCur = tu_htole16(volume[request->bChannelNumber]) };
- TU_LOG1("Get channel %u volume %d dB\r\n", request->bChannelNumber, cur_vol.bCur / 256);
- return tud_audio_buffer_and_schedule_control_xfer(rhport, (tusb_control_request_t const *)request, &cur_vol, sizeof(cur_vol));
- }
- }
- TU_LOG1("Feature unit get request not supported, entity = %u, selector = %u, request = %u\r\n",
- request->bEntityID, request->bControlSelector, request->bRequest);
-
- return false;
-}
-
-// Helper for feature unit set requests
-static bool tud_audio_feature_unit_set_request(uint8_t rhport, audio_control_request_t const *request, uint8_t const *buf)
-{
- (void)rhport;
-
- TU_ASSERT(request->bEntityID == UAC2_ENTITY_SPK_FEATURE_UNIT);
- TU_VERIFY(request->bRequest == AUDIO_CS_REQ_CUR);
-
- if (request->bControlSelector == AUDIO_FU_CTRL_MUTE)
- {
- TU_VERIFY(request->wLength == sizeof(audio_control_cur_1_t));
-
- mute[request->bChannelNumber] = ((audio_control_cur_1_t *)buf)->bCur;
-
- TU_LOG1("Set channel %d Mute: %d\r\n", request->bChannelNumber, mute[request->bChannelNumber]);
-
- return true;
- }
- else if (request->bControlSelector == AUDIO_FU_CTRL_VOLUME)
- {
- TU_VERIFY(request->wLength == sizeof(audio_control_cur_2_t));
-
- volume[request->bChannelNumber] = ((audio_control_cur_2_t const *)buf)->bCur;
-
- TU_LOG1("Set channel %d volume: %d dB\r\n", request->bChannelNumber, volume[request->bChannelNumber] / 256);
-
- return true;
- }
- else
- {
- TU_LOG1("Feature unit set request not supported, entity = %u, selector = %u, request = %u\r\n",
- request->bEntityID, request->bControlSelector, request->bRequest);
- return false;
- }
-}
-
-//--------------------------------------------------------------------+
-// Application Callback API Implementations
-//--------------------------------------------------------------------+
-
-// Invoked when audio class specific get request received for an entity
-bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const *p_request)
-{
- audio_control_request_t *request = (audio_control_request_t *)p_request;
-
- if (request->bEntityID == UAC2_ENTITY_CLOCK)
- return tud_audio_clock_get_request(rhport, request);
- if (request->bEntityID == UAC2_ENTITY_SPK_FEATURE_UNIT)
- return tud_audio_feature_unit_get_request(rhport, request);
- else
- {
- TU_LOG1("Get request not handled, entity = %d, selector = %d, request = %d\r\n",
- request->bEntityID, request->bControlSelector, request->bRequest);
- }
- return false;
-}
-
-// Invoked when audio class specific set request received for an entity
-bool tud_audio_set_req_entity_cb(uint8_t rhport, tusb_control_request_t const *p_request, uint8_t *buf)
-{
- audio_control_request_t const *request = (audio_control_request_t const *)p_request;
-
- if (request->bEntityID == UAC2_ENTITY_SPK_FEATURE_UNIT)
- return tud_audio_feature_unit_set_request(rhport, request, buf);
- if (request->bEntityID == UAC2_ENTITY_CLOCK)
- return tud_audio_clock_set_request(rhport, request, buf);
- TU_LOG1("Set request not handled, entity = %d, selector = %d, request = %d\r\n",
- request->bEntityID, request->bControlSelector, request->bRequest);
-
- return false;
-}
-
-bool tud_audio_set_itf_close_EP_cb(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- (void)rhport;
-
- uint8_t const itf = tu_u16_low(tu_le16toh(p_request->wIndex));
- uint8_t const alt = tu_u16_low(tu_le16toh(p_request->wValue));
-
- if (ITF_NUM_AUDIO_STREAMING_SPK == itf && alt == 0)
- blink_interval_ms = BLINK_MOUNTED;
-
- return true;
-}
-
-bool tud_audio_set_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- (void)rhport;
- uint8_t const itf = tu_u16_low(tu_le16toh(p_request->wIndex));
- uint8_t const alt = tu_u16_low(tu_le16toh(p_request->wValue));
-
- TU_LOG2("Set interface %d alt %d\r\n", itf, alt);
- if (ITF_NUM_AUDIO_STREAMING_SPK == itf && alt != 0)
- blink_interval_ms = BLINK_STREAMING;
-
- // Clear buffer when streaming format is changed
- spk_data_size = 0;
- if(alt != 0)
- {
- current_resolution = resolutions_per_format[alt-1];
- }
-
- return true;
-}
-
-bool tud_audio_rx_done_pre_read_cb(uint8_t rhport, uint16_t n_bytes_received, uint8_t func_id, uint8_t ep_out, uint8_t cur_alt_setting)
-{
- (void)rhport;
- (void)func_id;
- (void)ep_out;
- (void)cur_alt_setting;
-
- spk_data_size = tud_audio_read(spk_buf, n_bytes_received);
- return true;
-}
-
-bool tud_audio_tx_done_pre_load_cb(uint8_t rhport, uint8_t itf, uint8_t ep_in, uint8_t cur_alt_setting)
-{
- (void)rhport;
- (void)itf;
- (void)ep_in;
- (void)cur_alt_setting;
-
- // This callback could be used to fill microphone data separately
- return true;
-}
-
-//--------------------------------------------------------------------+
-// AUDIO Task
-//--------------------------------------------------------------------+
-
-void audio_task(void)
-{
- // When new data arrived, copy data from speaker buffer, to microphone buffer
- // and send it over
- // Only support speaker & headphone both have the same resolution
- // If one is 16bit another is 24bit be care of LOUD noise !
- if (spk_data_size)
- {
- if (current_resolution == 16)
- {
- int16_t *src = (int16_t*)spk_buf;
- int16_t *limit = (int16_t*)spk_buf + spk_data_size / 2;
- int16_t *dst = (int16_t*)mic_buf;
- while (src < limit)
- {
- // Combine two channels into one
- int32_t left = *src++;
- int32_t right = *src++;
- *dst++ = (left >> 1) + (right >> 1);
- }
- tud_audio_write((uint8_t *)mic_buf, spk_data_size / 2);
- spk_data_size = 0;
- }
- else if (current_resolution == 24)
- {
- int32_t *src = spk_buf;
- int32_t *limit = spk_buf + spk_data_size / 4;
- int32_t *dst = mic_buf;
- while (src < limit)
- {
- // Combine two channels into one
- int32_t left = *src++;
- int32_t right = *src++;
- *dst++ = ((left >> 1) + (right >> 1)) & 0xffffff00;
- }
- tud_audio_write((uint8_t *)mic_buf, spk_data_size / 2);
- spk_data_size = 0;
- }
- }
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // Blink every interval ms
- if (board_millis() - start_ms < blink_interval_ms) return;
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state;
-}
diff --git a/tinyusb/examples/device/uac2_headset/src/tusb_config.h b/tinyusb/examples/device/uac2_headset/src/tusb_config.h
deleted file mode 100755
index e8d93f56..00000000
--- a/tinyusb/examples/device/uac2_headset/src/tusb_config.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Ha Thach (tinyusb.org)
- * Copyright (c) 2020 Jerzy Kasenberg
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-#include "usb_descriptors.h"
-
-// defined by compiler flags for flexibility
-#ifndef CFG_TUSB_MCU
-#error CFG_TUSB_MCU must be defined
-#endif
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
-#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED)
-#else
-#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-#ifndef CFG_TUSB_DEBUG
-// Can be set during compilation i.e.: make LOG=<value for CFG_TUSB_DEBUG> BOARD=<bsp>
-// Keep in mind that enabling logs when data is streaming can disrupt data flow.
-// It can be very helpful though when audio unit requests are tested/debugged.
-#define CFG_TUSB_DEBUG 0
-#endif
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 0
-#define CFG_TUD_HID 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_AUDIO 1
-#define CFG_TUD_VENDOR 0
-
-//--------------------------------------------------------------------
-// AUDIO CLASS DRIVER CONFIGURATION
-//--------------------------------------------------------------------
-
-#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_HEADSET_STEREO_DESC_LEN
-
-// How many formats are used, need to adjust USB descriptor if changed
-#define CFG_TUD_AUDIO_FUNC_1_N_FORMATS 2
-
-// Audio format type I specifications
-#if defined(__RX__)
-#define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 48000 // 16bit/48kHz is the best quality for Renesas RX
-#else
-#define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 96000 // 24bit/96kHz is the best quality for full-speed, high-speed is needed beyond this
-#endif
-#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 1
-#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX 2
-
-// 16bit in 16bit slots
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX 2
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_TX 16
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_RX 2
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_RX 16
-
-#if defined(__RX__)
-// 8bit in 8bit slots
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX 1
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_TX 8
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_RX 1
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_RX 8
-#else
-// 24bit in 32bit slots
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX 4
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_TX 24
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_RX 4
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_RX 24
-#endif
-
-// EP and buffer size - for isochronous EP´s, the buffer and EP size are equal (different sizes would not make sense)
-#define CFG_TUD_AUDIO_ENABLE_EP_IN 1
-
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_IN TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX)
-#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_EP_SZ_IN TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX)
-
-#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ TU_MAX(CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_IN, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_EP_SZ_IN)*2
-#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX TU_MAX(CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_IN, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_EP_SZ_IN) // Maximum EP IN size for all AS alternate settings used
-
-// EP and buffer size - for isochronous EP´s, the buffer and EP size are equal (different sizes would not make sense)
-#define CFG_TUD_AUDIO_ENABLE_EP_OUT 1
-
-#define CFG_TUD_AUDIO_UNC_1_FORMAT_1_EP_SZ_OUT TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_RX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX)
-#define CFG_TUD_AUDIO_UNC_1_FORMAT_2_EP_SZ_OUT TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_RX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX)
-
-#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ TU_MAX(CFG_TUD_AUDIO_UNC_1_FORMAT_1_EP_SZ_OUT, CFG_TUD_AUDIO_UNC_1_FORMAT_2_EP_SZ_OUT)*2
-#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX TU_MAX(CFG_TUD_AUDIO_UNC_1_FORMAT_1_EP_SZ_OUT, CFG_TUD_AUDIO_UNC_1_FORMAT_2_EP_SZ_OUT) // Maximum EP IN size for all AS alternate settings used
-
-// Number of Standard AS Interface Descriptors (4.9.1) defined per audio function - this is required to be able to remember the current alternate settings of these interfaces - We restrict us here to have a constant number for all audio functions (which means this has to be the maximum number of AS interfaces an audio function has and a second audio function with less AS interfaces just wastes a few bytes)
-#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 2
-
-// Size of control request buffer
-#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/uac2_headset/src/usb_descriptors.c b/tinyusb/examples/device/uac2_headset/src/usb_descriptors.c
deleted file mode 100755
index 4a26b0b1..00000000
--- a/tinyusb/examples/device/uac2_headset/src/usb_descriptors.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Ha Thach (tinyusb.org)
- * Copyright (c) 2020 Jerzy Kasenberg
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-#include "usb_descriptors.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] AUDIO | MIDI | HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(AUDIO, 4) | _PID_MAP(VENDOR, 5) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
-
- // Use Interface Association Descriptor (IAD) for CDC
- // As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
- .bDeviceClass = TUSB_CLASS_MISC,
- .bDeviceSubClass = MISC_SUBCLASS_COMMON,
- .bDeviceProtocol = MISC_PROTOCOL_IAD,
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *)&desc_device;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + CFG_TUD_AUDIO * TUD_AUDIO_HEADSET_STEREO_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
-// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
-// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
-#define EPNUM_AUDIO_IN 0x03
-#define EPNUM_AUDIO_OUT 0x03
-#elif CFG_TUSB_MCU == OPT_MCU_NRF5X
-// ISO endpoints for NRF5x are fixed to 0x08 (0x88)
-#define EPNUM_AUDIO_IN 0x08
-#define EPNUM_AUDIO_OUT 0x08
-#elif CFG_TUSB_MCU == OPT_MCU_SAMG || CFG_TUSB_MCU == OPT_MCU_SAMX7X
-// SAMG & SAME70 don't support a same endpoint number with different direction IN and OUT
-// e.g EP1 OUT & EP1 IN cannot exist together
-#define EPNUM_AUDIO_IN 0x01
-#define EPNUM_AUDIO_OUT 0x02
-#else
-#define EPNUM_AUDIO_IN 0x01
-#define EPNUM_AUDIO_OUT 0x01
-#endif
-
-uint8_t const desc_configuration[] =
-{
- // Interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_AUDIO_HEADSET_STEREO_DESCRIPTOR(2, EPNUM_AUDIO_OUT, EPNUM_AUDIO_IN | 0x80)
-};
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void)index; // for multiple configurations
- return desc_configuration;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB headset", // 2: Product
- "000001", // 3: Serials, should use chip ID
- "TinyUSB Speakers", // 4: Audio Interface
- "TinyUSB Microphone", // 5: Audio Interface
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void)langid;
-
- uint8_t chr_count;
-
- if (index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }
- else
- {
- // Convert ASCII string into UTF-16
-
- if (!(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0]))) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if (chr_count > 31) chr_count = 31;
-
- for (uint8_t i = 0; i < chr_count; i++)
- {
- _desc_str[1 + i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2 * chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/uac2_headset/src/usb_descriptors.h b/tinyusb/examples/device/uac2_headset/src/usb_descriptors.h
deleted file mode 100755
index d9510ea4..00000000
--- a/tinyusb/examples/device/uac2_headset/src/usb_descriptors.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Jerzy Kasenbreg
- *
- * 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.
- *
- */
-
-#ifndef _USB_DESCRIPTORS_H_
-#define _USB_DESCRIPTORS_H_
-
-// #include "tusb.h"
-
-// Unit numbers are arbitrary selected
-#define UAC2_ENTITY_CLOCK 0x04
-// Speaker path
-#define UAC2_ENTITY_SPK_INPUT_TERMINAL 0x01
-#define UAC2_ENTITY_SPK_FEATURE_UNIT 0x02
-#define UAC2_ENTITY_SPK_OUTPUT_TERMINAL 0x03
-// Microphone path
-#define UAC2_ENTITY_MIC_INPUT_TERMINAL 0x11
-#define UAC2_ENTITY_MIC_OUTPUT_TERMINAL 0x13
-
-enum
-{
- ITF_NUM_AUDIO_CONTROL = 0,
- ITF_NUM_AUDIO_STREAMING_SPK,
- ITF_NUM_AUDIO_STREAMING_MIC,
- ITF_NUM_TOTAL
-};
-
-#define TUD_AUDIO_HEADSET_STEREO_DESC_LEN (TUD_AUDIO_DESC_IAD_LEN\
- + TUD_AUDIO_DESC_STD_AC_LEN\
- + TUD_AUDIO_DESC_CS_AC_LEN\
- + TUD_AUDIO_DESC_CLK_SRC_LEN\
- + TUD_AUDIO_DESC_INPUT_TERM_LEN\
- + TUD_AUDIO_DESC_FEATURE_UNIT_TWO_CHANNEL_LEN\
- + TUD_AUDIO_DESC_OUTPUT_TERM_LEN\
- + TUD_AUDIO_DESC_INPUT_TERM_LEN\
- + TUD_AUDIO_DESC_OUTPUT_TERM_LEN\
- /* Interface 1, Alternate 0 */\
- + TUD_AUDIO_DESC_STD_AS_INT_LEN\
- /* Interface 1, Alternate 0 */\
- + TUD_AUDIO_DESC_STD_AS_INT_LEN\
- + TUD_AUDIO_DESC_CS_AS_INT_LEN\
- + TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN\
- + TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN\
- + TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN\
- /* Interface 1, Alternate 2 */\
- + TUD_AUDIO_DESC_STD_AS_INT_LEN\
- + TUD_AUDIO_DESC_CS_AS_INT_LEN\
- + TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN\
- + TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN\
- + TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN\
- /* Interface 2, Alternate 0 */\
- + TUD_AUDIO_DESC_STD_AS_INT_LEN\
- /* Interface 2, Alternate 1 */\
- + TUD_AUDIO_DESC_STD_AS_INT_LEN\
- + TUD_AUDIO_DESC_CS_AS_INT_LEN\
- + TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN\
- + TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN\
- + TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN\
- /* Interface 2, Alternate 2 */\
- + TUD_AUDIO_DESC_STD_AS_INT_LEN\
- + TUD_AUDIO_DESC_CS_AS_INT_LEN\
- + TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN\
- + TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN\
- + TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN)
-
-#define TUD_AUDIO_HEADSET_STEREO_DESCRIPTOR(_stridx, _epout, _epin) \
- /* Standard Interface Association Descriptor (IAD) */\
- TUD_AUDIO_DESC_IAD(/*_firstitfs*/ ITF_NUM_AUDIO_CONTROL, /*_nitfs*/ ITF_NUM_TOTAL, /*_stridx*/ 0x00),\
- /* Standard AC Interface Descriptor(4.7.1) */\
- TUD_AUDIO_DESC_STD_AC(/*_itfnum*/ ITF_NUM_AUDIO_CONTROL, /*_nEPs*/ 0x00, /*_stridx*/ _stridx),\
- /* Class-Specific AC Interface Header Descriptor(4.7.2) */\
- TUD_AUDIO_DESC_CS_AC(/*_bcdADC*/ 0x0200, /*_category*/ AUDIO_FUNC_HEADSET, /*_totallen*/ TUD_AUDIO_DESC_CLK_SRC_LEN+TUD_AUDIO_DESC_FEATURE_UNIT_TWO_CHANNEL_LEN+TUD_AUDIO_DESC_INPUT_TERM_LEN+TUD_AUDIO_DESC_OUTPUT_TERM_LEN+TUD_AUDIO_DESC_INPUT_TERM_LEN+TUD_AUDIO_DESC_OUTPUT_TERM_LEN, /*_ctrl*/ AUDIO_CS_AS_INTERFACE_CTRL_LATENCY_POS),\
- /* Clock Source Descriptor(4.7.2.1) */\
- TUD_AUDIO_DESC_CLK_SRC(/*_clkid*/ UAC2_ENTITY_CLOCK, /*_attr*/ 3, /*_ctrl*/ 7, /*_assocTerm*/ 0x00, /*_stridx*/ 0x00), \
- /* Input Terminal Descriptor(4.7.2.4) */\
- TUD_AUDIO_DESC_INPUT_TERM(/*_termid*/ UAC2_ENTITY_SPK_INPUT_TERMINAL, /*_termtype*/ AUDIO_TERM_TYPE_USB_STREAMING, /*_assocTerm*/ 0x00, /*_clkid*/ UAC2_ENTITY_CLOCK, /*_nchannelslogical*/ 0x02, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_idxchannelnames*/ 0x00, /*_ctrl*/ 0 * (AUDIO_CTRL_R << AUDIO_IN_TERM_CTRL_CONNECTOR_POS), /*_stridx*/ 0x00),\
- /* Feature Unit Descriptor(4.7.2.8) */\
- TUD_AUDIO_DESC_FEATURE_UNIT_TWO_CHANNEL(/*_unitid*/ UAC2_ENTITY_SPK_FEATURE_UNIT, /*_srcid*/ UAC2_ENTITY_SPK_INPUT_TERMINAL, /*_ctrlch0master*/ (AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS), /*_ctrlch1*/ (AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS), /*_ctrlch2*/ (AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS), /*_stridx*/ 0x00),\
- /* Output Terminal Descriptor(4.7.2.5) */\
- TUD_AUDIO_DESC_OUTPUT_TERM(/*_termid*/ UAC2_ENTITY_SPK_OUTPUT_TERMINAL, /*_termtype*/ AUDIO_TERM_TYPE_OUT_HEADPHONES, /*_assocTerm*/ 0x00, /*_srcid*/ UAC2_ENTITY_SPK_FEATURE_UNIT, /*_clkid*/ UAC2_ENTITY_CLOCK, /*_ctrl*/ 0x0000, /*_stridx*/ 0x00),\
- /* Input Terminal Descriptor(4.7.2.4) */\
- TUD_AUDIO_DESC_INPUT_TERM(/*_termid*/ UAC2_ENTITY_MIC_INPUT_TERMINAL, /*_termtype*/ AUDIO_TERM_TYPE_IN_GENERIC_MIC, /*_assocTerm*/ 0x00, /*_clkid*/ UAC2_ENTITY_CLOCK, /*_nchannelslogical*/ 0x01, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_idxchannelnames*/ 0x00, /*_ctrl*/ 0 * (AUDIO_CTRL_R << AUDIO_IN_TERM_CTRL_CONNECTOR_POS), /*_stridx*/ 0x00),\
- /* Output Terminal Descriptor(4.7.2.5) */\
- TUD_AUDIO_DESC_OUTPUT_TERM(/*_termid*/ UAC2_ENTITY_MIC_OUTPUT_TERMINAL, /*_termtype*/ AUDIO_TERM_TYPE_USB_STREAMING, /*_assocTerm*/ 0x00, /*_srcid*/ UAC2_ENTITY_MIC_INPUT_TERMINAL, /*_clkid*/ UAC2_ENTITY_CLOCK, /*_ctrl*/ 0x0000, /*_stridx*/ 0x00),\
- /* Standard AS Interface Descriptor(4.9.1) */\
- /* Interface 1, Alternate 0 - default alternate setting with 0 bandwidth */\
- TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)(ITF_NUM_AUDIO_STREAMING_SPK), /*_altset*/ 0x00, /*_nEPs*/ 0x00, /*_stridx*/ 0x05),\
- /* Standard AS Interface Descriptor(4.9.1) */\
- /* Interface 1, Alternate 1 - alternate interface for data streaming */\
- TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)(ITF_NUM_AUDIO_STREAMING_SPK), /*_altset*/ 0x01, /*_nEPs*/ 0x01, /*_stridx*/ 0x05),\
- /* Class-Specific AS Interface Descriptor(4.9.2) */\
- TUD_AUDIO_DESC_CS_AS_INT(/*_termid*/ UAC2_ENTITY_SPK_INPUT_TERMINAL, /*_ctrl*/ AUDIO_CTRL_NONE, /*_formattype*/ AUDIO_FORMAT_TYPE_I, /*_formats*/ AUDIO_DATA_FORMAT_TYPE_I_PCM, /*_nchannelsphysical*/ CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_stridx*/ 0x00),\
- /* Type I Format Type Descriptor(2.3.1.6 - Audio Formats) */\
- TUD_AUDIO_DESC_TYPE_I_FORMAT(CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_RX, CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_RX),\
- /* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
- TUD_AUDIO_DESC_STD_AS_ISO_EP(/*_ep*/ _epout, /*_attr*/ (TUSB_XFER_ISOCHRONOUS | TUSB_ISO_EP_ATT_ADAPTIVE | TUSB_ISO_EP_ATT_DATA), /*_maxEPsize*/ TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_RX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX), /*_interval*/ 0x01),\
- /* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
- TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_MILLISEC, /*_lockdelay*/ 0x0001),\
- /* Interface 1, Alternate 2 - alternate interface for data streaming */\
- TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)(ITF_NUM_AUDIO_STREAMING_SPK), /*_altset*/ 0x02, /*_nEPs*/ 0x01, /*_stridx*/ 0x05),\
- /* Class-Specific AS Interface Descriptor(4.9.2) */\
- TUD_AUDIO_DESC_CS_AS_INT(/*_termid*/ UAC2_ENTITY_SPK_INPUT_TERMINAL, /*_ctrl*/ AUDIO_CTRL_NONE, /*_formattype*/ AUDIO_FORMAT_TYPE_I, /*_formats*/ AUDIO_DATA_FORMAT_TYPE_I_PCM, /*_nchannelsphysical*/ CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_stridx*/ 0x00),\
- /* Type I Format Type Descriptor(2.3.1.6 - Audio Formats) */\
- TUD_AUDIO_DESC_TYPE_I_FORMAT(CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_RX, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_RX),\
- /* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
- TUD_AUDIO_DESC_STD_AS_ISO_EP(/*_ep*/ _epout, /*_attr*/ (TUSB_XFER_ISOCHRONOUS | TUSB_ISO_EP_ATT_ADAPTIVE | TUSB_ISO_EP_ATT_DATA), /*_maxEPsize*/ TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_RX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX), /*_interval*/ 0x01),\
- /* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
- TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_MILLISEC, /*_lockdelay*/ 0x0001),\
- /* Standard AS Interface Descriptor(4.9.1) */\
- /* Interface 2, Alternate 0 - default alternate setting with 0 bandwidth */\
- TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)(ITF_NUM_AUDIO_STREAMING_MIC), /*_altset*/ 0x00, /*_nEPs*/ 0x00, /*_stridx*/ 0x04),\
- /* Standard AS Interface Descriptor(4.9.1) */\
- /* Interface 2, Alternate 1 - alternate interface for data streaming */\
- TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)(ITF_NUM_AUDIO_STREAMING_MIC), /*_altset*/ 0x01, /*_nEPs*/ 0x01, /*_stridx*/ 0x04),\
- /* Class-Specific AS Interface Descriptor(4.9.2) */\
- TUD_AUDIO_DESC_CS_AS_INT(/*_termid*/ UAC2_ENTITY_MIC_OUTPUT_TERMINAL, /*_ctrl*/ AUDIO_CTRL_NONE, /*_formattype*/ AUDIO_FORMAT_TYPE_I, /*_formats*/ AUDIO_DATA_FORMAT_TYPE_I_PCM, /*_nchannelsphysical*/ CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_stridx*/ 0x00),\
- /* Type I Format Type Descriptor(2.3.1.6 - Audio Formats) */\
- TUD_AUDIO_DESC_TYPE_I_FORMAT(CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_TX),\
- /* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
- TUD_AUDIO_DESC_STD_AS_ISO_EP(/*_ep*/ _epin, /*_attr*/ (TUSB_XFER_ISOCHRONOUS | TUSB_ISO_EP_ATT_ASYNCHRONOUS | TUSB_ISO_EP_ATT_DATA), /*_maxEPsize*/ TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX), /*_interval*/ 0x01),\
- /* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
- TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_UNDEFINED, /*_lockdelay*/ 0x0000),\
- /* Interface 2, Alternate 2 - alternate interface for data streaming */\
- TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)(ITF_NUM_AUDIO_STREAMING_MIC), /*_altset*/ 0x02, /*_nEPs*/ 0x01, /*_stridx*/ 0x04),\
- /* Class-Specific AS Interface Descriptor(4.9.2) */\
- TUD_AUDIO_DESC_CS_AS_INT(/*_termid*/ UAC2_ENTITY_MIC_OUTPUT_TERMINAL, /*_ctrl*/ AUDIO_CTRL_NONE, /*_formattype*/ AUDIO_FORMAT_TYPE_I, /*_formats*/ AUDIO_DATA_FORMAT_TYPE_I_PCM, /*_nchannelsphysical*/ CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_stridx*/ 0x00),\
- /* Type I Format Type Descriptor(2.3.1.6 - Audio Formats) */\
- TUD_AUDIO_DESC_TYPE_I_FORMAT(CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_TX),\
- /* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
- TUD_AUDIO_DESC_STD_AS_ISO_EP(/*_ep*/ _epin, /*_attr*/ (TUSB_XFER_ISOCHRONOUS | TUSB_ISO_EP_ATT_ASYNCHRONOUS | TUSB_ISO_EP_ATT_DATA), /*_maxEPsize*/ TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX), /*_interval*/ 0x01),\
- /* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
- TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_UNDEFINED, /*_lockdelay*/ 0x0000)
-
-#endif
diff --git a/tinyusb/examples/device/usbtmc/CMakeLists.txt b/tinyusb/examples/device/usbtmc/CMakeLists.txt
deleted file mode 100755
index c49603c2..00000000
--- a/tinyusb/examples/device/usbtmc/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usbtmc_app.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/usbtmc/Makefile b/tinyusb/examples/device/usbtmc/Makefile
deleted file mode 100755
index 69b633fe..00000000
--- a/tinyusb/examples/device/usbtmc/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/usbtmc/src/main.c b/tinyusb/examples/device/usbtmc/src/main.c
deleted file mode 100755
index 1fce48f4..00000000
--- a/tinyusb/examples/device/usbtmc/src/main.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-#include "usbtmc_app.h"
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 0 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 0,
- BLINK_SUSPENDED = 2500,
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-void led_blinking_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- led_blinking_task();
- usbtmc_app_task_iter();
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK + Indicator pulse
-//--------------------------------------------------------------------+
-
-
-volatile uint8_t doPulse = false;
-// called from USB context
-void led_indicator_pulse(void) {
- doPulse = true;
-}
-
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
- if(blink_interval_ms == BLINK_MOUNTED) // Mounted
- {
- if(doPulse)
- {
- led_state = true;
- board_led_write(true);
- start_ms = board_millis();
- doPulse = false;
- }
- else if (led_state == true)
- {
- if ( board_millis() - start_ms < 750) //Spec says blink must be between 500 and 1000 ms.
- {
- return; // not enough time
- }
- led_state = false;
- board_led_write(false);
- }
- }
- else
- {
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
- }
-}
diff --git a/tinyusb/examples/device/usbtmc/src/main.h b/tinyusb/examples/device/usbtmc/src/main.h
deleted file mode 100755
index 673247ec..00000000
--- a/tinyusb/examples/device/usbtmc/src/main.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifndef MAIN_H
-#define MAIN_H
-void led_indicator_pulse(void);
-
-#endif
diff --git a/tinyusb/examples/device/usbtmc/src/tusb_config.h b/tinyusb/examples/device/usbtmc/src/tusb_config.h
deleted file mode 100755
index a192d0db..00000000
--- a/tinyusb/examples/device/usbtmc/src/tusb_config.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * tusb_config.h
- *
- * Created on: Sep 5, 2019
- * Author: nconrad
- */
-
-#ifndef TUSB_CONFIG_H_
-#define TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-
-#define CFG_TUD_USBTMC 1
-#define CFG_TUD_USBTMC_ENABLE_INT_EP 1
-#define CFG_TUD_USBTMC_ENABLE_488 1
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/usbtmc/src/usb_descriptors.c b/tinyusb/examples/device/usbtmc/src/usb_descriptors.c
deleted file mode 100755
index 2336266b..00000000
--- a/tinyusb/examples/device/usbtmc/src/usb_descriptors.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-#include "class/usbtmc/usbtmc.h"
-#include "class/usbtmc/usbtmc_device.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
- .bDeviceClass = 0x00,
- .bDeviceSubClass = 0x00,
- .bDeviceProtocol = 0x00,
-
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-
-#if defined(CFG_TUD_USBTMC)
-
-# define TUD_USBTMC_DESC_MAIN(_itfnum,_bNumEndpoints) \
- TUD_USBTMC_IF_DESCRIPTOR(_itfnum, _bNumEndpoints, /*_stridx = */ 4u, TUD_USBTMC_PROTOCOL_USB488), \
- TUD_USBTMC_BULK_DESCRIPTORS(/* OUT = */0x01, /* IN = */ 0x81, /* packet size = */USBTMCD_MAX_PACKET_SIZE)
-
-#if CFG_TUD_USBTMC_ENABLE_INT_EP
-// USBTMC Interrupt xfer always has length of 2, but we use epMaxSize=8 for
-// compatibility with mcus that only allow 8, 16, 32 or 64 for FS endpoints
-# define TUD_USBTMC_DESC(_itfnum) \
- TUD_USBTMC_DESC_MAIN(_itfnum, /* _epCount = */ 3), \
- TUD_USBTMC_INT_DESCRIPTOR(/* INT ep # */ 0x82, /* epMaxSize = */ 8, /* bInterval = */16u )
-# define TUD_USBTMC_DESC_LEN (TUD_USBTMC_IF_DESCRIPTOR_LEN + TUD_USBTMC_BULK_DESCRIPTORS_LEN + TUD_USBTMC_INT_DESCRIPTOR_LEN)
-
-#else
-
-# define TUD_USBTMC_DESC(_itfnum) \
- TUD_USBTMC_DESC_MAIN(_itfnum, /* _epCount = */ 2u)
-# define TUD_USBTMC_DESC_LEN (TUD_USBTMC_IF_DESCRIPTOR_LEN + TUD_USBTMC_BULK_DESCRIPTORS_LEN)
-
-#endif /* CFG_TUD_USBTMC_ENABLE_INT_EP */
-
-#else
-# define USBTMC_DESC_LEN (0)
-#endif /* CFG_TUD_USBTMC */
-
-enum
-{
- ITF_NUM_USBTMC,
- ITF_NUM_TOTAL
-};
-
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_USBTMC_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
- // LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
- // 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
- // Note: since CDC EP ( 1 & 2), HID (4) are spot-on, thus we only need to force
- // endpoint number for MSC to 5
- #define EPNUM_MSC 0x05
-#else
- #define EPNUM_MSC 0x03
-#endif
-
-
-uint8_t const desc_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- TUD_USBTMC_DESC(ITF_NUM_USBTMC),
-};
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
- return desc_configuration;
-}
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
- "TinyUSB USBTMC", // 4: USBTMC
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- size_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }
- else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) {
- chr_count = 31;
- }
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (uint16_t)((((uint16_t)TUSB_DESC_STRING) << 8 ) | (2u*chr_count + 2u));
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/usbtmc/src/usbtmc_app.c b/tinyusb/examples/device/usbtmc/src/usbtmc_app.c
deleted file mode 100755
index 8f87a6dc..00000000
--- a/tinyusb/examples/device/usbtmc/src/usbtmc_app.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Nathan Conrad
- *
- * 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.
- *
- */
-
-#include <strings.h>
-#include <stdlib.h> /* atoi */
-#include "tusb.h"
-#include "bsp/board.h"
-#include "main.h"
-
-#if (CFG_TUD_USBTMC_ENABLE_488)
-static usbtmc_response_capabilities_488_t const
-#else
-static usbtmc_response_capabilities_t const
-#endif
-tud_usbtmc_app_capabilities =
-{
- .USBTMC_status = USBTMC_STATUS_SUCCESS,
- .bcdUSBTMC = USBTMC_VERSION,
- .bmIntfcCapabilities =
- {
- .listenOnly = 0,
- .talkOnly = 0,
- .supportsIndicatorPulse = 1
- },
- .bmDevCapabilities = {
- .canEndBulkInOnTermChar = 0
- },
-
-#if (CFG_TUD_USBTMC_ENABLE_488)
- .bcdUSB488 = USBTMC_488_VERSION,
- .bmIntfcCapabilities488 =
- {
- .supportsTrigger = 1,
- .supportsREN_GTL_LLO = 0,
- .is488_2 = 1
- },
- .bmDevCapabilities488 =
- {
- .SCPI = 1,
- .SR1 = 0,
- .RL1 = 0,
- .DT1 =0,
- }
-#endif
-};
-
-#define IEEE4882_STB_QUESTIONABLE (0x08u)
-#define IEEE4882_STB_MAV (0x10u)
-#define IEEE4882_STB_SER (0x20u)
-#define IEEE4882_STB_SRQ (0x40u)
-
-static const char idn[] = "TinyUSB,ModelNumber,SerialNumber,FirmwareVer123456\r\n";
-//static const char idn[] = "TinyUSB,ModelNumber,SerialNumber,FirmwareVer and a bunch of other text to make it longer than a packet, perhaps? lets make it three transfers...\n";
-static volatile uint8_t status;
-
-// 0=not query, 1=queried, 2=delay,set(MAV), 3=delay 4=ready?
-// (to simulate delay)
-static volatile uint16_t queryState = 0;
-static volatile uint32_t queryDelayStart;
-static volatile uint32_t bulkInStarted;
-static volatile uint32_t idnQuery;
-
-static uint32_t resp_delay = 125u; // Adjustable delay, to allow for better testing
-static size_t buffer_len;
-static size_t buffer_tx_ix; // for transmitting using multiple transfers
-static uint8_t buffer[225]; // A few packets long should be enough.
-
-
-static usbtmc_msg_dev_dep_msg_in_header_t rspMsg = {
- .bmTransferAttributes =
- {
- .EOM = 1,
- .UsingTermChar = 0
- }
-};
-
-void tud_usbtmc_open_cb(uint8_t interface_id)
-{
- (void)interface_id;
- tud_usbtmc_start_bus_read();
-}
-
-#if (CFG_TUD_USBTMC_ENABLE_488)
-usbtmc_response_capabilities_488_t const *
-#else
-usbtmc_response_capabilities_t const *
-#endif
-tud_usbtmc_get_capabilities_cb()
-{
- return &tud_usbtmc_app_capabilities;
-}
-
-
-bool tud_usbtmc_msg_trigger_cb(usbtmc_msg_generic_t* msg) {
- (void)msg;
- // Let trigger set the SRQ
- status |= IEEE4882_STB_SRQ;
- return true;
-}
-
-bool tud_usbtmc_msgBulkOut_start_cb(usbtmc_msg_request_dev_dep_out const * msgHeader)
-{
- (void)msgHeader;
- buffer_len = 0;
- if(msgHeader->TransferSize > sizeof(buffer))
- {
-
- return false;
- }
- return true;
-}
-
-bool tud_usbtmc_msg_data_cb(void *data, size_t len, bool transfer_complete)
-{
- // If transfer isn't finished, we just ignore it (for now)
-
- if(len + buffer_len < sizeof(buffer))
- {
- memcpy(&(buffer[buffer_len]), data, len);
- buffer_len += len;
- }
- else
- {
- return false; // buffer overflow!
- }
- queryState = transfer_complete;
- idnQuery = 0;
-
- if(transfer_complete && (len >=4) && !strncasecmp("*idn?",data,4))
- {
- idnQuery = 1;
- }
- if(transfer_complete && !strncasecmp("delay ",data,5))
- {
- queryState = 0;
- int d = atoi((char*)data + 5);
- if(d > 10000)
- d = 10000;
- if(d<0)
- d=0;
- resp_delay = (uint32_t)d;
- }
- tud_usbtmc_start_bus_read();
- return true;
-}
-
-bool tud_usbtmc_msgBulkIn_complete_cb()
-{
- if((buffer_tx_ix == buffer_len) || idnQuery) // done
- {
- status &= (uint8_t)~(IEEE4882_STB_MAV); // clear MAV
- queryState = 0;
- bulkInStarted = 0;
- buffer_tx_ix = 0;
- }
- tud_usbtmc_start_bus_read();
-
- return true;
-}
-
-static unsigned int msgReqLen;
-
-bool tud_usbtmc_msgBulkIn_request_cb(usbtmc_msg_request_dev_dep_in const * request)
-{
- rspMsg.header.MsgID = request->header.MsgID,
- rspMsg.header.bTag = request->header.bTag,
- rspMsg.header.bTagInverse = request->header.bTagInverse;
- msgReqLen = request->TransferSize;
-
-#ifdef xDEBUG
- uart_tx_str_sync("MSG_IN_DATA: Requested!\r\n");
-#endif
- if(queryState == 0 || (buffer_tx_ix == 0))
- {
- TU_ASSERT(bulkInStarted == 0);
- bulkInStarted = 1;
-
- // > If a USBTMC interface receives a Bulk-IN request prior to receiving a USBTMC command message
- // that expects a response, the device must NAK the request (*not stall*)
- }
- else
- {
- size_t txlen = tu_min32(buffer_len-buffer_tx_ix,msgReqLen);
- tud_usbtmc_transmit_dev_msg_data(&buffer[buffer_tx_ix], txlen,
- (buffer_tx_ix+txlen) == buffer_len, false);
- buffer_tx_ix += txlen;
- }
- // Always return true indicating not to stall the EP.
- return true;
-}
-
-void usbtmc_app_task_iter(void) {
- switch(queryState) {
- case 0:
- break;
- case 1:
- queryDelayStart = board_millis();
- queryState = 2;
- break;
- case 2:
- if( (board_millis() - queryDelayStart) > resp_delay) {
- queryDelayStart = board_millis();
- queryState=3;
- status |= 0x10u; // MAV
- status |= 0x40u; // SRQ
- }
- break;
- case 3:
- if( (board_millis() - queryDelayStart) > resp_delay) {
- queryState = 4;
- }
- break;
- case 4: // time to transmit;
- if(bulkInStarted && (buffer_tx_ix == 0)) {
- if(idnQuery)
- {
- tud_usbtmc_transmit_dev_msg_data(idn, tu_min32(sizeof(idn)-1,msgReqLen),true,false);
- queryState = 0;
- bulkInStarted = 0;
- }
- else
- {
- buffer_tx_ix = tu_min32(buffer_len,msgReqLen);
- tud_usbtmc_transmit_dev_msg_data(buffer, buffer_tx_ix, buffer_tx_ix == buffer_len, false);
- }
- // MAV is cleared in the transfer complete callback.
- }
- break;
- default:
- TU_ASSERT(false,);
- return;
- }
-}
-
-bool tud_usbtmc_initiate_clear_cb(uint8_t *tmcResult)
-{
- *tmcResult = USBTMC_STATUS_SUCCESS;
- queryState = 0;
- bulkInStarted = false;
- status = 0;
- return true;
-}
-
-bool tud_usbtmc_check_clear_cb(usbtmc_get_clear_status_rsp_t *rsp)
-{
- queryState = 0;
- bulkInStarted = false;
- status = 0;
- buffer_tx_ix = 0u;
- buffer_len = 0u;
- rsp->USBTMC_status = USBTMC_STATUS_SUCCESS;
- rsp->bmClear.BulkInFifoBytes = 0u;
- return true;
-}
-bool tud_usbtmc_initiate_abort_bulk_in_cb(uint8_t *tmcResult)
-{
- bulkInStarted = 0;
- *tmcResult = USBTMC_STATUS_SUCCESS;
- return true;
-}
-bool tud_usbtmc_check_abort_bulk_in_cb(usbtmc_check_abort_bulk_rsp_t *rsp)
-{
- (void)rsp;
- tud_usbtmc_start_bus_read();
- return true;
-}
-
-bool tud_usbtmc_initiate_abort_bulk_out_cb(uint8_t *tmcResult)
-{
- *tmcResult = USBTMC_STATUS_SUCCESS;
- return true;
-
-}
-bool tud_usbtmc_check_abort_bulk_out_cb(usbtmc_check_abort_bulk_rsp_t *rsp)
-{
- (void)rsp;
- tud_usbtmc_start_bus_read();
- return true;
-}
-
-void tud_usbtmc_bulkIn_clearFeature_cb(void)
-{
-}
-void tud_usbtmc_bulkOut_clearFeature_cb(void)
-{
- tud_usbtmc_start_bus_read();
-}
-
-// Return status byte, but put the transfer result status code in the rspResult argument.
-uint8_t tud_usbtmc_get_stb_cb(uint8_t *tmcResult)
-{
- uint8_t old_status = status;
- status = (uint8_t)(status & ~(IEEE4882_STB_SRQ)); // clear SRQ
-
- *tmcResult = USBTMC_STATUS_SUCCESS;
- // Increment status so that we see different results on each read...
-
- return old_status;
-}
-
-bool tud_usbtmc_indicator_pulse_cb(tusb_control_request_t const * msg, uint8_t *tmcResult)
-{
- (void)msg;
- led_indicator_pulse();
- *tmcResult = USBTMC_STATUS_SUCCESS;
- return true;
-}
diff --git a/tinyusb/examples/device/usbtmc/src/usbtmc_app.h b/tinyusb/examples/device/usbtmc/src/usbtmc_app.h
deleted file mode 100755
index 4de30c2b..00000000
--- a/tinyusb/examples/device/usbtmc/src/usbtmc_app.h
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#ifndef USBTMC_APP_H
-#define USBTMC_APP_H
-
-void usbtmc_app_task_iter(void);
-
-#endif
diff --git a/tinyusb/examples/device/usbtmc/visaQuery.py b/tinyusb/examples/device/usbtmc/visaQuery.py
deleted file mode 100755
index 50a765a0..00000000
--- a/tinyusb/examples/device/usbtmc/visaQuery.py
+++ /dev/null
@@ -1,209 +0,0 @@
-#!/usr/bin/env python3
-
-import visa
-import time
-import sys
-
-
-def test_idn():
- idn = inst.query("*idn?");
- assert (idn == "TinyUSB,ModelNumber,SerialNumber,FirmwareVer123456\r\n")
- assert (inst.is_4882_compliant)
-
-def test_echo(m,n):
- longstr = "0123456789abcdefghijklmnopqrstuvwxyz" * 50
- t0 = time.monotonic()
-
- #Next try echo from 1 to 175 characters (200 is max buffer size on DUT)
- for i in range(m,n):
- #print(i)
- x = longstr[0:i]
- xt = x + inst.write_termination
- y = inst.query(x)
- #print(x)
- #print (":".join("{:02x}".format(ord(c)) for c in xt))
- #print (":".join("{:02x}".format(ord(c)) for c in y))
- assert(xt == y), f"failed i={i}"
- #inst.read_stb();# Just to make USB logging easier by sending a control query (bad thing is that this made things slow)
- t = time.monotonic() - t0
- print(f" elapsed: {t:0.3} sec")
-
-def test_trig():
- # clear SRQ
- inst.read_stb()
- assert (inst.read_stb() == 0)
- inst.assert_trigger()
- time.sleep(0.3) # SRQ may have some delay
- assert (inst.read_stb() & 0x40), "SRQ not set after 0.3 seconds"
- assert (inst.read_stb() == 0)
-
-
-def test_mav():
- inst.write("delay 50")
- inst.read_stb() # clear STB
- assert (inst.read_stb() == 0)
- inst.write("123")
- time.sleep(0.3)
- assert (inst.read_stb() & 0x10), "MAV not set after 0.5 seconds"
-
- rsp = inst.read()
- assert(rsp == "123\r\n")
-
-
-def test_srq():
- assert (inst.read_stb() == 0)
- inst.write("123")
-
- #inst.enable_event(visa.constants.VI_EVENT_SERVICE_REQ, visa.constants.VI_QUEUE)
- #waitrsp = inst.wait_on_event(visa.constants.VI_EVENT_SERVICE_REQ, 5000)
- #inst.discard_events(visa.constants.VI_EVENT_SERVICE_REQ, visa.constants.VI_QUEUE)
- #inst.wait_for_srq()
- time.sleep(0.3)
- stb = inst.read_stb()
- msg = "SRQ not set after 0.5 seconds, was {:02x}".format(stb)
- assert (stb == 0x50),msg
-
- assert (inst.read_stb() == 0x10), "SRQ set at second read!"
-
- rsp = inst.read()
- assert(rsp == "123\r\n")
-
-def test_read_timeout():
- inst.timeout = 500
- # First read with no MAV
- inst.read_stb()
- assert (inst.read_stb() == 0)
- inst.write("delay 500")
- t0 = time.monotonic()
- try:
- rsp = inst.read()
- assert(false), "Read should have resulted in timeout"
- except visa.VisaIOError:
- print(" Got expected exception")
- t = time.monotonic() - t0
- assert ((t*1000.0) > (inst.timeout - 300))
- assert ((t*1000.0) < (inst.timeout + 300))
- print(f"Delay was {t:0.3}")
- # Response is still in queue, so send a clear (to be more helpful to the next test)
- inst.clear()
- time.sleep(0.3)
- assert(0 == (inst.read_stb() & 0x10)), "MAV not reset after clear"
-
-def test_abort_in():
- inst.timeout = 200
- # First read with no MAV
- inst.read_stb()
- assert (inst.read_stb() == 0)
- inst.write("delay 500")
- inst.write("xxx")
- t0 = time.monotonic()
- try:
- rsp = inst.read()
- assert(false), "Read should have resulted in timeout"
- except visa.VisaIOError:
- print(" Got expected exception")
- t = time.monotonic() - t0
- assert ((t*1000.0) > (inst.timeout - 300))
- assert ((t*1000.0) < (inst.timeout + 300))
- print(f" Delay was {t:0.3}")
- # Response is still in queue, so send a clear (to be more helpful to the next test)
- inst.timeout = 800
- y = inst.read()
- assert(y == "xxx\r\n")
-
-def test_indicate():
- # perform indicator pulse
- usb_iface = inst.get_visa_attribute(visa.constants.VI_ATTR_USB_INTFC_NUM)
- retv = inst.control_in(request_type_bitmap_field=0xA1, request_id=64, request_value=0x0000, index=usb_iface, length=0x0001)
- assert((retv[1] == visa.constants.StatusCode(0)) and (retv[0] == b'\x01')), f"indicator pulse failed: retv={retv}"
-
-
-def test_multi_read():
- old_chunk_size = inst.chunk_size
- longstr = "0123456789abcdefghijklmnopqrstuvwxyz" * 10
- timeout = 10
- x = longstr[0:174]
- inst.chunk_size = 50 # Seems chunk size only applies to read but not write
- inst.write(x)
- # I'm not sure how to request just the remaining bit using a max count... so just read it all.
- y = inst.read()
- assert (x + "\r\n" == y)
- #inst.chunk_size = old_chunk_size
-
-def test_stall_ep0():
- usb_iface = inst.get_visa_attribute(visa.constants.VI_ATTR_USB_INTFC_NUM)
- inst.read_stb()
- # This is an invalid request, should create stall.
- try:
- retv = inst.control_in(request_type_bitmap_field=0xA1, request_id=60, request_value=0x0000, index=usb_iface, length=0x0001)
- assert false
- except visa.VisaIOError:
- pass
-
- assert (inst.read_stb() == 0)
-
-
-rm = visa.ResourceManager()
-reslist = rm.list_resources("USB?::?*::INSTR")
-print(reslist)
-
-if (len(reslist) == 0):
- sys.exit()
-
-inst = rm.open_resource(reslist[0]);
-inst.timeout = 3000
-
-inst.clear()
-
-print("+ IDN")
-test_idn()
-
-print("+test abort in")
-test_abort_in()
-
-
-inst.timeout = 2000
-
-print("+ multi read")
-test_multi_read()
-
-
-print("+ echo delay=0")
-inst.write("delay 0")
-test_echo(1,175)
-
-print("+ echo delay=2")
-inst.write("delay 2")
-test_echo(1,175)
-
-print("+ echo delay=150")
-inst.write("delay 150")
-test_echo(53,76)
-test_echo(165,170)
-
-print("+ Read timeout (no MAV)")
-test_read_timeout()
-
-print("+ Test EP0 stall recovery")
-test_stall_ep0()
-
-print("+ MAV")
-test_mav()
-
-print("+ SRQ")
-test_srq()
-
-print("+ indicate")
-test_indicate()
-
-print("+ TRIG")
-test_trig()
-
-# Untested:
-# abort bulk out
-# LLO, GTL, etc
-# Throughput rate?
-# Transmitting a message using multiple transfers
-
-inst.close()
-print("Test complete")
diff --git a/tinyusb/examples/device/webusb_serial/CMakeLists.txt b/tinyusb/examples/device/webusb_serial/CMakeLists.txt
deleted file mode 100755
index abc4d91d..00000000
--- a/tinyusb/examples/device/webusb_serial/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/device/webusb_serial/Makefile b/tinyusb/examples/device/webusb_serial/Makefile
deleted file mode 100755
index 5a455078..00000000
--- a/tinyusb/examples/device/webusb_serial/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-include ../../rules.mk
diff --git a/tinyusb/examples/device/webusb_serial/src/main.c b/tinyusb/examples/device/webusb_serial/src/main.c
deleted file mode 100755
index aba4aedf..00000000
--- a/tinyusb/examples/device/webusb_serial/src/main.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 example demonstrates WebUSB as web serial with browser with WebUSB support (e.g Chrome).
- * After enumerated successfully, browser will pop-up notification
- * with URL to landing page, click on it to test
- * - Click "Connect" and select device, When connected the on-board LED will litted up.
- * - Any charters received from either webusb/Serial will be echo back to webusb and Serial
- *
- * Note:
- * - The WebUSB landing page notification is currently disabled in Chrome
- * on Windows due to Chromium issue 656702 (https://crbug.com/656702). You have to
- * go to landing page (below) to test
- *
- * - On Windows 7 and prior: You need to use Zadig tool to manually bind the
- * WebUSB interface with the WinUSB driver for Chrome to access. From windows 8 and 10, this
- * is done automatically by firmware.
- *
- * - On Linux/macOS, udev permission may need to be updated by
- * - copying '/examples/device/99-tinyusb.rules' file to /etc/udev/rules.d/ then
- * - run 'sudo udevadm control --reload-rules && sudo udevadm trigger'
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-#include "usb_descriptors.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-/* Blink pattern
- * - 250 ms : device not mounted
- * - 1000 ms : device mounted
- * - 2500 ms : device is suspended
- */
-enum {
- BLINK_NOT_MOUNTED = 250,
- BLINK_MOUNTED = 1000,
- BLINK_SUSPENDED = 2500,
-
- BLINK_ALWAYS_ON = UINT32_MAX,
- BLINK_ALWAYS_OFF = 0
-};
-
-static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
-
-#define URL "example.tinyusb.org/webusb-serial/"
-
-const tusb_desc_webusb_url_t desc_url =
-{
- .bLength = 3 + sizeof(URL) - 1,
- .bDescriptorType = 3, // WEBUSB URL type
- .bScheme = 1, // 0: http, 1: https
- .url = URL
-};
-
-static bool web_serial_connected = false;
-
-//------------- prototypes -------------//
-void led_blinking_task(void);
-void cdc_task(void);
-void webserial_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- tusb_init();
-
- while (1)
- {
- tud_task(); // tinyusb device task
- cdc_task();
- webserial_task();
- led_blinking_task();
- }
-
- return 0;
-}
-
-// send characters to both CDC and WebUSB
-void echo_all(uint8_t buf[], uint32_t count)
-{
- // echo to web serial
- if ( web_serial_connected )
- {
- tud_vendor_write(buf, count);
- }
-
- // echo to cdc
- if ( tud_cdc_connected() )
- {
- for(uint32_t i=0; i<count; i++)
- {
- tud_cdc_write_char(buf[i]);
-
- if ( buf[i] == '\r' ) tud_cdc_write_char('\n');
- }
- tud_cdc_write_flush();
- }
-}
-
-//--------------------------------------------------------------------+
-// Device callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device is mounted
-void tud_mount_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-// Invoked when device is unmounted
-void tud_umount_cb(void)
-{
- blink_interval_ms = BLINK_NOT_MOUNTED;
-}
-
-// Invoked when usb bus is suspended
-// remote_wakeup_en : if host allow us to perform remote wakeup
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-void tud_suspend_cb(bool remote_wakeup_en)
-{
- (void) remote_wakeup_en;
- blink_interval_ms = BLINK_SUSPENDED;
-}
-
-// Invoked when usb bus is resumed
-void tud_resume_cb(void)
-{
- blink_interval_ms = BLINK_MOUNTED;
-}
-
-//--------------------------------------------------------------------+
-// WebUSB use vendor class
-//--------------------------------------------------------------------+
-
-// Invoked when a control transfer occurred on an interface of this class
-// Driver response accordingly to the request and the transfer stage (setup/data/ack)
-// return false to stall control endpoint (e.g unsupported request)
-bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
-{
- // nothing to with DATA & ACK stage
- if (stage != CONTROL_STAGE_SETUP) return true;
-
- switch (request->bmRequestType_bit.type)
- {
- case TUSB_REQ_TYPE_VENDOR:
- switch (request->bRequest)
- {
- case VENDOR_REQUEST_WEBUSB:
- // match vendor request in BOS descriptor
- // Get landing page url
- return tud_control_xfer(rhport, request, (void*) &desc_url, desc_url.bLength);
-
- case VENDOR_REQUEST_MICROSOFT:
- if ( request->wIndex == 7 )
- {
- // Get Microsoft OS 2.0 compatible descriptor
- uint16_t total_len;
- memcpy(&total_len, desc_ms_os_20+8, 2);
-
- return tud_control_xfer(rhport, request, (void*) desc_ms_os_20, total_len);
- }else
- {
- return false;
- }
-
- default: break;
- }
- break;
-
- case TUSB_REQ_TYPE_CLASS:
- if (request->bRequest == 0x22)
- {
- // Webserial simulate the CDC_REQUEST_SET_CONTROL_LINE_STATE (0x22) to connect and disconnect.
- web_serial_connected = (request->wValue != 0);
-
- // Always lit LED if connected
- if ( web_serial_connected )
- {
- board_led_write(true);
- blink_interval_ms = BLINK_ALWAYS_ON;
-
- tud_vendor_write_str("\r\nTinyUSB WebUSB device example\r\n");
- }else
- {
- blink_interval_ms = BLINK_MOUNTED;
- }
-
- // response with status OK
- return tud_control_status(rhport, request);
- }
- break;
-
- default: break;
- }
-
- // stall unknown request
- return false;
-}
-
-void webserial_task(void)
-{
- if ( web_serial_connected )
- {
- if ( tud_vendor_available() )
- {
- uint8_t buf[64];
- uint32_t count = tud_vendor_read(buf, sizeof(buf));
-
- // echo back to both web serial and cdc
- echo_all(buf, count);
- }
- }
-}
-
-
-//--------------------------------------------------------------------+
-// USB CDC
-//--------------------------------------------------------------------+
-void cdc_task(void)
-{
- if ( tud_cdc_connected() )
- {
- // connected and there are data available
- if ( tud_cdc_available() )
- {
- uint8_t buf[64];
-
- uint32_t count = tud_cdc_read(buf, sizeof(buf));
-
- // echo back to both web serial and cdc
- echo_all(buf, count);
- }
- }
-}
-
-// Invoked when cdc when line state changed e.g connected/disconnected
-void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
-{
- (void) itf;
-
- // connected
- if ( dtr && rts )
- {
- // print initial message when connected
- tud_cdc_write_str("\r\nTinyUSB WebUSB device example\r\n");
- }
-}
-
-// Invoked when CDC interface received data from host
-void tud_cdc_rx_cb(uint8_t itf)
-{
- (void) itf;
-}
-
-//--------------------------------------------------------------------+
-// BLINKING TASK
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- static uint32_t start_ms = 0;
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
- start_ms += blink_interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/device/webusb_serial/src/tusb_config.h b/tinyusb/examples/device/webusb_serial/src/tusb_config.h
deleted file mode 100755
index 26b81b38..00000000
--- a/tinyusb/examples/device/webusb_serial/src/tusb_config.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by board.mk
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-// RHPort number used for device can be defined by board.mk, default to port 0
-#ifndef BOARD_DEVICE_RHPORT_NUM
- #define BOARD_DEVICE_RHPORT_NUM 0
-#endif
-
-// RHPort max operational speed can defined by board.mk
-// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
-#ifndef BOARD_DEVICE_RHPORT_SPEED
- #if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
- CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56)
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
- #else
- #define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
- #endif
-#endif
-
-// Device mode with rhport and speed defined by board.mk
-#if BOARD_DEVICE_RHPORT_NUM == 0
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- #define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
-#else
- #error "Incorrect RHPort configuration"
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
-#define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-//------------- CLASS -------------//
-#define CFG_TUD_CDC 1
-#define CFG_TUD_MSC 0
-#define CFG_TUD_HID 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_VENDOR 1
-
-// CDC FIFO size of TX and RX
-#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-
-// Vendor FIFO size of TX and RX
-// If not configured vendor endpoints will not be buffered
-#define CFG_TUD_VENDOR_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-#define CFG_TUD_VENDOR_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/device/webusb_serial/src/usb_descriptors.c b/tinyusb/examples/device/webusb_serial/src/usb_descriptors.c
deleted file mode 100755
index d1539488..00000000
--- a/tinyusb/examples/device/webusb_serial/src/usb_descriptors.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-#include "usb_descriptors.h"
-
-/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
- * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
- *
- * Auto ProductID layout's Bitmap:
- * [MSB] MIDI | HID | MSC | CDC [LSB]
- */
-#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
-#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
- _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
-
-//--------------------------------------------------------------------+
-// Device Descriptors
-//--------------------------------------------------------------------+
-tusb_desc_device_t const desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0210, // at least 2.1 or 3.x for BOS & webUSB
-
- // Use Interface Association Descriptor (IAD) for CDC
- // As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
- .bDeviceClass = TUSB_CLASS_MISC,
- .bDeviceSubClass = MISC_SUBCLASS_COMMON,
- .bDeviceProtocol = MISC_PROTOCOL_IAD,
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = USB_PID,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-// Invoked when received GET DEVICE DESCRIPTOR
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return (uint8_t const *) &desc_device;
-}
-
-//--------------------------------------------------------------------+
-// Configuration Descriptor
-//--------------------------------------------------------------------+
-enum
-{
- ITF_NUM_CDC = 0,
- ITF_NUM_CDC_DATA,
- ITF_NUM_VENDOR,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_CDC_DESC_LEN + TUD_VENDOR_DESC_LEN)
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
- // LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
- // 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
- #define EPNUM_CDC_IN 2
- #define EPNUM_CDC_OUT 2
- #define EPNUM_VENDOR_IN 5
- #define EPNUM_VENDOR_OUT 5
-#elif CFG_TUSB_MCU == OPT_MCU_SAMG || CFG_TUSB_MCU == OPT_MCU_SAMX7X
- // SAMG & SAME70 don't support a same endpoint number with different direction IN and OUT
- // e.g EP1 OUT & EP1 IN cannot exist together
- #define EPNUM_CDC_IN 2
- #define EPNUM_CDC_OUT 3
- #define EPNUM_VENDOR_IN 4
- #define EPNUM_VENDOR_OUT 5
-#else
- #define EPNUM_CDC_IN 2
- #define EPNUM_CDC_OUT 2
- #define EPNUM_VENDOR_IN 3
- #define EPNUM_VENDOR_OUT 3
-#endif
-
-uint8_t const desc_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP notification address and size, EP data address (out, in) and size.
- TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, 0x81, 8, EPNUM_CDC_OUT, 0x80 | EPNUM_CDC_IN, TUD_OPT_HIGH_SPEED ? 512 : 64),
-
- // Interface number, string index, EP Out & IN address, EP size
- TUD_VENDOR_DESCRIPTOR(ITF_NUM_VENDOR, 5, EPNUM_VENDOR_OUT, 0x80 | EPNUM_VENDOR_IN, TUD_OPT_HIGH_SPEED ? 512 : 64)
-};
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR
-// Application return pointer to descriptor
-// Descriptor contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- (void) index; // for multiple configurations
- return desc_configuration;
-}
-
-//--------------------------------------------------------------------+
-// BOS Descriptor
-//--------------------------------------------------------------------+
-
-/* Microsoft OS 2.0 registry property descriptor
-Per MS requirements https://msdn.microsoft.com/en-us/library/windows/hardware/hh450799(v=vs.85).aspx
-device should create DeviceInterfaceGUIDs. It can be done by driver and
-in case of real PnP solution device should expose MS "Microsoft OS 2.0
-registry property descriptor". Such descriptor can insert any record
-into Windows registry per device/configuration/interface. In our case it
-will insert "DeviceInterfaceGUIDs" multistring property.
-
-GUID is freshly generated and should be OK to use.
-
-https://developers.google.com/web/fundamentals/native-hardware/build-for-webusb/
-(Section Microsoft OS compatibility descriptors)
-*/
-
-#define BOS_TOTAL_LEN (TUD_BOS_DESC_LEN + TUD_BOS_WEBUSB_DESC_LEN + TUD_BOS_MICROSOFT_OS_DESC_LEN)
-
-#define MS_OS_20_DESC_LEN 0xB2
-
-// BOS Descriptor is required for webUSB
-uint8_t const desc_bos[] =
-{
- // total length, number of device caps
- TUD_BOS_DESCRIPTOR(BOS_TOTAL_LEN, 2),
-
- // Vendor Code, iLandingPage
- TUD_BOS_WEBUSB_DESCRIPTOR(VENDOR_REQUEST_WEBUSB, 1),
-
- // Microsoft OS 2.0 descriptor
- TUD_BOS_MS_OS_20_DESCRIPTOR(MS_OS_20_DESC_LEN, VENDOR_REQUEST_MICROSOFT)
-};
-
-uint8_t const * tud_descriptor_bos_cb(void)
-{
- return desc_bos;
-}
-
-
-uint8_t const desc_ms_os_20[] =
-{
- // Set header: length, type, windows version, total length
- U16_TO_U8S_LE(0x000A), U16_TO_U8S_LE(MS_OS_20_SET_HEADER_DESCRIPTOR), U32_TO_U8S_LE(0x06030000), U16_TO_U8S_LE(MS_OS_20_DESC_LEN),
-
- // Configuration subset header: length, type, configuration index, reserved, configuration total length
- U16_TO_U8S_LE(0x0008), U16_TO_U8S_LE(MS_OS_20_SUBSET_HEADER_CONFIGURATION), 0, 0, U16_TO_U8S_LE(MS_OS_20_DESC_LEN-0x0A),
-
- // Function Subset header: length, type, first interface, reserved, subset length
- U16_TO_U8S_LE(0x0008), U16_TO_U8S_LE(MS_OS_20_SUBSET_HEADER_FUNCTION), ITF_NUM_VENDOR, 0, U16_TO_U8S_LE(MS_OS_20_DESC_LEN-0x0A-0x08),
-
- // MS OS 2.0 Compatible ID descriptor: length, type, compatible ID, sub compatible ID
- U16_TO_U8S_LE(0x0014), U16_TO_U8S_LE(MS_OS_20_FEATURE_COMPATBLE_ID), 'W', 'I', 'N', 'U', 'S', 'B', 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // sub-compatible
-
- // MS OS 2.0 Registry property descriptor: length, type
- U16_TO_U8S_LE(MS_OS_20_DESC_LEN-0x0A-0x08-0x08-0x14), U16_TO_U8S_LE(MS_OS_20_FEATURE_REG_PROPERTY),
- U16_TO_U8S_LE(0x0007), U16_TO_U8S_LE(0x002A), // wPropertyDataType, wPropertyNameLength and PropertyName "DeviceInterfaceGUIDs\0" in UTF-16
- 'D', 0x00, 'e', 0x00, 'v', 0x00, 'i', 0x00, 'c', 0x00, 'e', 0x00, 'I', 0x00, 'n', 0x00, 't', 0x00, 'e', 0x00,
- 'r', 0x00, 'f', 0x00, 'a', 0x00, 'c', 0x00, 'e', 0x00, 'G', 0x00, 'U', 0x00, 'I', 0x00, 'D', 0x00, 's', 0x00, 0x00, 0x00,
- U16_TO_U8S_LE(0x0050), // wPropertyDataLength
- //bPropertyData: “{975F44D9-0D08-43FD-8B3E-127CA8AFFF9D}”.
- '{', 0x00, '9', 0x00, '7', 0x00, '5', 0x00, 'F', 0x00, '4', 0x00, '4', 0x00, 'D', 0x00, '9', 0x00, '-', 0x00,
- '0', 0x00, 'D', 0x00, '0', 0x00, '8', 0x00, '-', 0x00, '4', 0x00, '3', 0x00, 'F', 0x00, 'D', 0x00, '-', 0x00,
- '8', 0x00, 'B', 0x00, '3', 0x00, 'E', 0x00, '-', 0x00, '1', 0x00, '2', 0x00, '7', 0x00, 'C', 0x00, 'A', 0x00,
- '8', 0x00, 'A', 0x00, 'F', 0x00, 'F', 0x00, 'F', 0x00, '9', 0x00, 'D', 0x00, '}', 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-TU_VERIFY_STATIC(sizeof(desc_ms_os_20) == MS_OS_20_DESC_LEN, "Incorrect size");
-
-//--------------------------------------------------------------------+
-// String Descriptors
-//--------------------------------------------------------------------+
-
-// array of pointer to string descriptors
-char const* string_desc_arr [] =
-{
- (const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
- "TinyUSB", // 1: Manufacturer
- "TinyUSB Device", // 2: Product
- "123456", // 3: Serials, should use chip ID
- "TinyUSB CDC", // 4: CDC Interface
- "TinyUSB WebUSB" // 5: Vendor Interface
-};
-
-static uint16_t _desc_str[32];
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- uint8_t chr_count;
-
- if ( index == 0)
- {
- memcpy(&_desc_str[1], string_desc_arr[0], 2);
- chr_count = 1;
- }else
- {
- // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
- // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
-
- if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
-
- const char* str = string_desc_arr[index];
-
- // Cap at max char
- chr_count = strlen(str);
- if ( chr_count > 31 ) chr_count = 31;
-
- // Convert ASCII string into UTF-16
- for(uint8_t i=0; i<chr_count; i++)
- {
- _desc_str[1+i] = str[i];
- }
- }
-
- // first byte is length (including header), second byte is string type
- _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
-
- return _desc_str;
-}
diff --git a/tinyusb/examples/device/webusb_serial/src/usb_descriptors.h b/tinyusb/examples/device/webusb_serial/src/usb_descriptors.h
deleted file mode 100755
index 19f1ff3f..00000000
--- a/tinyusb/examples/device/webusb_serial/src/usb_descriptors.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- */
-
-#ifndef USB_DESCRIPTORS_H_
-#define USB_DESCRIPTORS_H_
-
-enum
-{
- VENDOR_REQUEST_WEBUSB = 1,
- VENDOR_REQUEST_MICROSOFT = 2
-};
-
-extern uint8_t const desc_ms_os_20[];
-
-#endif /* USB_DESCRIPTORS_H_ */
diff --git a/tinyusb/examples/host/CMakeLists.txt b/tinyusb/examples/host/CMakeLists.txt
deleted file mode 100755
index f185ac4f..00000000
--- a/tinyusb/examples/host/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
-
-project(tinyusb_host_examples)
-family_initialize_project(tinyusb_host_examples ${CMAKE_CURRENT_LIST_DIR})
-
-# family_add_subdirectory will filter what to actually add based on selected FAMILY
-family_add_subdirectory(cdc_msc_hid)
diff --git a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC175X_6X b/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC175X_6X
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC175X_6X
+++ /dev/null
diff --git a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC177X_8X b/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC177X_8X
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC177X_8X
+++ /dev/null
diff --git a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC18XX b/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC18XX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC18XX
+++ /dev/null
diff --git a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC40XX b/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC40XX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC40XX
+++ /dev/null
diff --git a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC43XX b/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC43XX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_LPC43XX
+++ /dev/null
diff --git a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_MIMXRT10XX b/tinyusb/examples/host/cdc_msc_hid/.only.MCU_MIMXRT10XX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_MIMXRT10XX
+++ /dev/null
diff --git a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_RP2040 b/tinyusb/examples/host/cdc_msc_hid/.only.MCU_RP2040
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/.only.MCU_RP2040
+++ /dev/null
diff --git a/tinyusb/examples/host/cdc_msc_hid/CMakeLists.txt b/tinyusb/examples/host/cdc_msc_hid/CMakeLists.txt
deleted file mode 100755
index 0a99bc3a..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/hid_app.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/msc_app.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_host_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/host/cdc_msc_hid/Makefile b/tinyusb/examples/host/cdc_msc_hid/Makefile
deleted file mode 100755
index 6a2b4d90..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += $(wildcard src/*.c)
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-CFLAGS += -Wno-error=cast-align
-
-# TinyUSB Host Stack source
-SRC_C += \
- src/class/cdc/cdc_host.c \
- src/class/hid/hid_host.c \
- src/class/msc/msc_host.c \
- src/host/hub.c \
- src/host/usbh.c \
- src/host/usbh_control.c \
- src/portable/ehci/ehci.c \
- src/portable/ohci/ohci.c \
- src/portable/nxp/transdimension/hcd_transdimension.c \
- src/portable/nxp/lpc17_40/hcd_lpc17_40.c
-
-include ../../rules.mk
diff --git a/tinyusb/examples/host/cdc_msc_hid/src/hid_app.c b/tinyusb/examples/host/cdc_msc_hid/src/hid_app.c
deleted file mode 100755
index 11437c2b..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/src/hid_app.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-// If your host terminal support ansi escape code such as TeraTerm
-// it can be use to simulate mouse cursor movement within terminal
-#define USE_ANSI_ESCAPE 0
-
-#define MAX_REPORT 4
-
-static uint8_t const keycode2ascii[128][2] = { HID_KEYCODE_TO_ASCII };
-
-// Each HID instance can has multiple reports
-static struct
-{
- uint8_t report_count;
- tuh_hid_report_info_t report_info[MAX_REPORT];
-}hid_info[CFG_TUH_HID];
-
-static void process_kbd_report(hid_keyboard_report_t const *report);
-static void process_mouse_report(hid_mouse_report_t const * report);
-static void process_generic_report(uint8_t dev_addr, uint8_t instance, uint8_t const* report, uint16_t len);
-
-void hid_app_task(void)
-{
- // nothing to do
-}
-
-//--------------------------------------------------------------------+
-// TinyUSB Callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device with hid interface is mounted
-// Report descriptor is also available for use. tuh_hid_parse_report_descriptor()
-// can be used to parse common/simple enough descriptor.
-// Note: if report descriptor length > CFG_TUH_ENUMERATION_BUFSIZE, it will be skipped
-// therefore report_desc = NULL, desc_len = 0
-void tuh_hid_mount_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* desc_report, uint16_t desc_len)
-{
- printf("HID device address = %d, instance = %d is mounted\r\n", dev_addr, instance);
-
- // Interface protocol (hid_interface_protocol_enum_t)
- const char* protocol_str[] = { "None", "Keyboard", "Mouse" };
- uint8_t const itf_protocol = tuh_hid_interface_protocol(dev_addr, instance);
-
- printf("HID Interface Protocol = %s\r\n", protocol_str[itf_protocol]);
-
- // By default host stack will use activate boot protocol on supported interface.
- // Therefore for this simple example, we only need to parse generic report descriptor (with built-in parser)
- if ( itf_protocol == HID_ITF_PROTOCOL_NONE )
- {
- hid_info[instance].report_count = tuh_hid_parse_report_descriptor(hid_info[instance].report_info, MAX_REPORT, desc_report, desc_len);
- printf("HID has %u reports \r\n", hid_info[instance].report_count);
- }
-
- // request to receive report
- // tuh_hid_report_received_cb() will be invoked when report is available
- if ( !tuh_hid_receive_report(dev_addr, instance) )
- {
- printf("Error: cannot request to receive report\r\n");
- }
-}
-
-// Invoked when device with hid interface is un-mounted
-void tuh_hid_umount_cb(uint8_t dev_addr, uint8_t instance)
-{
- printf("HID device address = %d, instance = %d is unmounted\r\n", dev_addr, instance);
-}
-
-// Invoked when received report from device via interrupt endpoint
-void tuh_hid_report_received_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* report, uint16_t len)
-{
- uint8_t const itf_protocol = tuh_hid_interface_protocol(dev_addr, instance);
-
- switch (itf_protocol)
- {
- case HID_ITF_PROTOCOL_KEYBOARD:
- TU_LOG2("HID receive boot keyboard report\r\n");
- process_kbd_report( (hid_keyboard_report_t const*) report );
- break;
-
- case HID_ITF_PROTOCOL_MOUSE:
- TU_LOG2("HID receive boot mouse report\r\n");
- process_mouse_report( (hid_mouse_report_t const*) report );
- break;
-
- default:
- // Generic report requires matching ReportID and contents with previous parsed report info
- process_generic_report(dev_addr, instance, report, len);
- break;
- }
-
- // continue to request to receive report
- if ( !tuh_hid_receive_report(dev_addr, instance) )
- {
- printf("Error: cannot request to receive report\r\n");
- }
-}
-
-//--------------------------------------------------------------------+
-// Keyboard
-//--------------------------------------------------------------------+
-
-// look up new key in previous keys
-static inline bool find_key_in_report(hid_keyboard_report_t const *report, uint8_t keycode)
-{
- for(uint8_t i=0; i<6; i++)
- {
- if (report->keycode[i] == keycode) return true;
- }
-
- return false;
-}
-
-static void process_kbd_report(hid_keyboard_report_t const *report)
-{
- static hid_keyboard_report_t prev_report = { 0, 0, {0} }; // previous report to check key released
-
- //------------- example code ignore control (non-printable) key affects -------------//
- for(uint8_t i=0; i<6; i++)
- {
- if ( report->keycode[i] )
- {
- if ( find_key_in_report(&prev_report, report->keycode[i]) )
- {
- // exist in previous report means the current key is holding
- }else
- {
- // not existed in previous report means the current key is pressed
- bool const is_shift = report->modifier & (KEYBOARD_MODIFIER_LEFTSHIFT | KEYBOARD_MODIFIER_RIGHTSHIFT);
- uint8_t ch = keycode2ascii[report->keycode[i]][is_shift ? 1 : 0];
- putchar(ch);
- if ( ch == '\r' ) putchar('\n'); // added new line for enter key
-
- fflush(stdout); // flush right away, else nanolib will wait for newline
- }
- }
- // TODO example skips key released
- }
-
- prev_report = *report;
-}
-
-//--------------------------------------------------------------------+
-// Mouse
-//--------------------------------------------------------------------+
-
-void cursor_movement(int8_t x, int8_t y, int8_t wheel)
-{
-#if USE_ANSI_ESCAPE
- // Move X using ansi escape
- if ( x < 0)
- {
- printf(ANSI_CURSOR_BACKWARD(%d), (-x)); // move left
- }else if ( x > 0)
- {
- printf(ANSI_CURSOR_FORWARD(%d), x); // move right
- }
-
- // Move Y using ansi escape
- if ( y < 0)
- {
- printf(ANSI_CURSOR_UP(%d), (-y)); // move up
- }else if ( y > 0)
- {
- printf(ANSI_CURSOR_DOWN(%d), y); // move down
- }
-
- // Scroll using ansi escape
- if (wheel < 0)
- {
- printf(ANSI_SCROLL_UP(%d), (-wheel)); // scroll up
- }else if (wheel > 0)
- {
- printf(ANSI_SCROLL_DOWN(%d), wheel); // scroll down
- }
-
- printf("\r\n");
-#else
- printf("(%d %d %d)\r\n", x, y, wheel);
-#endif
-}
-
-static void process_mouse_report(hid_mouse_report_t const * report)
-{
- static hid_mouse_report_t prev_report = { 0 };
-
- //------------- button state -------------//
- uint8_t button_changed_mask = report->buttons ^ prev_report.buttons;
- if ( button_changed_mask & report->buttons)
- {
- printf(" %c%c%c ",
- report->buttons & MOUSE_BUTTON_LEFT ? 'L' : '-',
- report->buttons & MOUSE_BUTTON_MIDDLE ? 'M' : '-',
- report->buttons & MOUSE_BUTTON_RIGHT ? 'R' : '-');
- }
-
- //------------- cursor movement -------------//
- cursor_movement(report->x, report->y, report->wheel);
-}
-
-//--------------------------------------------------------------------+
-// Generic Report
-//--------------------------------------------------------------------+
-static void process_generic_report(uint8_t dev_addr, uint8_t instance, uint8_t const* report, uint16_t len)
-{
- (void) dev_addr;
-
- uint8_t const rpt_count = hid_info[instance].report_count;
- tuh_hid_report_info_t* rpt_info_arr = hid_info[instance].report_info;
- tuh_hid_report_info_t* rpt_info = NULL;
-
- if ( rpt_count == 1 && rpt_info_arr[0].report_id == 0)
- {
- // Simple report without report ID as 1st byte
- rpt_info = &rpt_info_arr[0];
- }else
- {
- // Composite report, 1st byte is report ID, data starts from 2nd byte
- uint8_t const rpt_id = report[0];
-
- // Find report id in the arrray
- for(uint8_t i=0; i<rpt_count; i++)
- {
- if (rpt_id == rpt_info_arr[i].report_id )
- {
- rpt_info = &rpt_info_arr[i];
- break;
- }
- }
-
- report++;
- len--;
- }
-
- if (!rpt_info)
- {
- printf("Couldn't find the report info for this report !\r\n");
- return;
- }
-
- // For complete list of Usage Page & Usage checkout src/class/hid/hid.h. For examples:
- // - Keyboard : Desktop, Keyboard
- // - Mouse : Desktop, Mouse
- // - Gamepad : Desktop, Gamepad
- // - Consumer Control (Media Key) : Consumer, Consumer Control
- // - System Control (Power key) : Desktop, System Control
- // - Generic (vendor) : 0xFFxx, xx
- if ( rpt_info->usage_page == HID_USAGE_PAGE_DESKTOP )
- {
- switch (rpt_info->usage)
- {
- case HID_USAGE_DESKTOP_KEYBOARD:
- TU_LOG1("HID receive keyboard report\r\n");
- // Assume keyboard follow boot report layout
- process_kbd_report( (hid_keyboard_report_t const*) report );
- break;
-
- case HID_USAGE_DESKTOP_MOUSE:
- TU_LOG1("HID receive mouse report\r\n");
- // Assume mouse follow boot report layout
- process_mouse_report( (hid_mouse_report_t const*) report );
- break;
-
- default: break;
- }
- }
-}
diff --git a/tinyusb/examples/host/cdc_msc_hid/src/main.c b/tinyusb/examples/host/cdc_msc_hid/src/main.c
deleted file mode 100755
index a14be05e..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/src/main.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-void led_blinking_task(void);
-
-extern void cdc_task(void);
-extern void hid_app_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- printf("TinyUSB Host CDC MSC HID Example\r\n");
-
- tusb_init();
-
- while (1)
- {
- // tinyusb host task
- tuh_task();
- led_blinking_task();
-
-#if CFG_TUH_CDC
- cdc_task();
-#endif
-
-#if CFG_TUH_HID
- hid_app_task();
-#endif
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// USB CDC
-//--------------------------------------------------------------------+
-#if CFG_TUH_CDC
-CFG_TUSB_MEM_SECTION static char serial_in_buffer[64] = { 0 };
-
-void tuh_mount_cb(uint8_t dev_addr)
-{
- // application set-up
- printf("A device with address %d is mounted\r\n", dev_addr);
-
- tuh_cdc_receive(dev_addr, serial_in_buffer, sizeof(serial_in_buffer), true); // schedule first transfer
-}
-
-void tuh_umount_cb(uint8_t dev_addr)
-{
- // application tear-down
- printf("A device with address %d is unmounted \r\n", dev_addr);
-}
-
-// invoked ISR context
-void tuh_cdc_xfer_isr(uint8_t dev_addr, xfer_result_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
-{
- (void) event;
- (void) pipe_id;
- (void) xferred_bytes;
-
- printf(serial_in_buffer);
- tu_memclr(serial_in_buffer, sizeof(serial_in_buffer));
-
- tuh_cdc_receive(dev_addr, serial_in_buffer, sizeof(serial_in_buffer), true); // waiting for next data
-}
-
-void cdc_task(void)
-{
-
-}
-
-#endif
-
-//--------------------------------------------------------------------+
-// TinyUSB Callbacks
-//--------------------------------------------------------------------+
-
-//--------------------------------------------------------------------+
-// Blinking Task
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- const uint32_t interval_ms = 1000;
- static uint32_t start_ms = 0;
-
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < interval_ms) return; // not enough time
- start_ms += interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/host/cdc_msc_hid/src/msc_app.c b/tinyusb/examples/host/cdc_msc_hid/src/msc_app.c
deleted file mode 100755
index 77a72052..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/src/msc_app.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "tusb.h"
-
-#if CFG_TUH_MSC
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-static scsi_inquiry_resp_t inquiry_resp;
-
-bool inquiry_complete_cb(uint8_t dev_addr, msc_cbw_t const* cbw, msc_csw_t const* csw)
-{
- if (csw->status != 0)
- {
- printf("Inquiry failed\r\n");
- return false;
- }
-
- // Print out Vendor ID, Product ID and Rev
- printf("%.8s %.16s rev %.4s\r\n", inquiry_resp.vendor_id, inquiry_resp.product_id, inquiry_resp.product_rev);
-
- // Get capacity of device
- uint32_t const block_count = tuh_msc_get_block_count(dev_addr, cbw->lun);
- uint32_t const block_size = tuh_msc_get_block_size(dev_addr, cbw->lun);
-
- printf("Disk Size: %lu MB\r\n", block_count / ((1024*1024)/block_size));
- printf("Block Count = %lu, Block Size: %lu\r\n", block_count, block_size);
-
- return true;
-}
-
-//------------- IMPLEMENTATION -------------//
-void tuh_msc_mount_cb(uint8_t dev_addr)
-{
- printf("A MassStorage device is mounted\r\n");
-
- uint8_t const lun = 0;
- tuh_msc_inquiry(dev_addr, lun, &inquiry_resp, inquiry_complete_cb);
-//
-// //------------- file system (only 1 LUN support) -------------//
-// uint8_t phy_disk = dev_addr-1;
-// disk_initialize(phy_disk);
-//
-// if ( disk_is_ready(phy_disk) )
-// {
-// if ( f_mount(phy_disk, &fatfs[phy_disk]) != FR_OK )
-// {
-// puts("mount failed");
-// return;
-// }
-//
-// f_chdrive(phy_disk); // change to newly mounted drive
-// f_chdir("/"); // root as current dir
-//
-// cli_init();
-// }
-}
-
-void tuh_msc_umount_cb(uint8_t dev_addr)
-{
- (void) dev_addr;
- printf("A MassStorage device is unmounted\r\n");
-
-// uint8_t phy_disk = dev_addr-1;
-//
-// f_mount(phy_disk, NULL); // unmount disk
-// disk_deinitialize(phy_disk);
-//
-// if ( phy_disk == f_get_current_drive() )
-// { // active drive is unplugged --> change to other drive
-// for(uint8_t i=0; i<CFG_TUH_DEVICE_MAX; i++)
-// {
-// if ( disk_is_ready(i) )
-// {
-// f_chdrive(i);
-// cli_init(); // refractor, rename
-// }
-// }
-// }
-}
-
-#endif
diff --git a/tinyusb/examples/host/cdc_msc_hid/src/tusb_config.h b/tinyusb/examples/host/cdc_msc_hid/src/tusb_config.h
deleted file mode 100755
index bc6c68e5..00000000
--- a/tinyusb/examples/host/cdc_msc_hid/src/tusb_config.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by compiler flags for flexibility
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_HOST | OPT_MODE_HIGH_SPEED)
-#else
- #define CFG_TUSB_RHPORT0_MODE OPT_MODE_HOST
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// CONFIGURATION
-//--------------------------------------------------------------------
-
-// Size of buffer to hold descriptors and other data used for enumeration
-#define CFG_TUH_ENUMERATION_BUFSIZE 256
-
-#define CFG_TUH_HUB 1
-#define CFG_TUH_CDC 1
-#define CFG_TUH_HID 4 // typical keyboard + mouse device can have 3-4 HID interfaces
-#define CFG_TUH_MSC 1
-#define CFG_TUH_VENDOR 0
-
-// max device support (excluding hub device)
-#define CFG_TUH_DEVICE_MAX (CFG_TUH_HUB ? 4 : 1) // hub typically has 4 ports
-
-//------------- HID -------------//
-#define CFG_TUH_HID_EPIN_BUFSIZE 64
-#define CFG_TUH_HID_EPOUT_BUFSIZE 64
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/host/hid_controller/.only.MCU_LPC175X_6X b/tinyusb/examples/host/hid_controller/.only.MCU_LPC175X_6X
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/hid_controller/.only.MCU_LPC175X_6X
+++ /dev/null
diff --git a/tinyusb/examples/host/hid_controller/.only.MCU_LPC177X_8X b/tinyusb/examples/host/hid_controller/.only.MCU_LPC177X_8X
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/hid_controller/.only.MCU_LPC177X_8X
+++ /dev/null
diff --git a/tinyusb/examples/host/hid_controller/.only.MCU_LPC18XX b/tinyusb/examples/host/hid_controller/.only.MCU_LPC18XX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/hid_controller/.only.MCU_LPC18XX
+++ /dev/null
diff --git a/tinyusb/examples/host/hid_controller/.only.MCU_LPC40XX b/tinyusb/examples/host/hid_controller/.only.MCU_LPC40XX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/hid_controller/.only.MCU_LPC40XX
+++ /dev/null
diff --git a/tinyusb/examples/host/hid_controller/.only.MCU_LPC43XX b/tinyusb/examples/host/hid_controller/.only.MCU_LPC43XX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/hid_controller/.only.MCU_LPC43XX
+++ /dev/null
diff --git a/tinyusb/examples/host/hid_controller/.only.MCU_MIMXRT10XX b/tinyusb/examples/host/hid_controller/.only.MCU_MIMXRT10XX
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/hid_controller/.only.MCU_MIMXRT10XX
+++ /dev/null
diff --git a/tinyusb/examples/host/hid_controller/.only.MCU_RP2040 b/tinyusb/examples/host/hid_controller/.only.MCU_RP2040
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/examples/host/hid_controller/.only.MCU_RP2040
+++ /dev/null
diff --git a/tinyusb/examples/host/hid_controller/CMakeLists.txt b/tinyusb/examples/host/hid_controller/CMakeLists.txt
deleted file mode 100755
index aaf8bc34..00000000
--- a/tinyusb/examples/host/hid_controller/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
-
-# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
-family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
-
-project(${PROJECT})
-
-# Checks this example is valid for the family and initializes the project
-family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
-
-add_executable(${PROJECT})
-
-# Example source
-target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/hid_app.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- )
-
-# Example include
-target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
-
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_host_example(${PROJECT}) \ No newline at end of file
diff --git a/tinyusb/examples/host/hid_controller/Makefile b/tinyusb/examples/host/hid_controller/Makefile
deleted file mode 100755
index 6f59faee..00000000
--- a/tinyusb/examples/host/hid_controller/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-include ../../../tools/top.mk
-include ../../make.mk
-
-INC += \
- src \
- $(TOP)/hw \
-
-# Example source
-EXAMPLE_SOURCE += \
- src/hid_app.c \
- src/main.c
-
-SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-
-CFLAGS += -Wno-error=cast-align
-
-# TinyUSB Host Stack source
-SRC_C += \
- src/class/cdc/cdc_host.c \
- src/class/hid/hid_host.c \
- src/class/msc/msc_host.c \
- src/host/hub.c \
- src/host/usbh.c \
- src/host/usbh_control.c \
- src/portable/ehci/ehci.c \
- src/portable/ohci/ohci.c \
- src/portable/nxp/transdimension/hcd_transdimension.c \
- src/portable/nxp/lpc17_40/hcd_lpc17_40.c
-
-include ../../rules.mk
diff --git a/tinyusb/examples/host/hid_controller/src/hid_app.c b/tinyusb/examples/host/hid_controller/src/hid_app.c
deleted file mode 100755
index c61ce70f..00000000
--- a/tinyusb/examples/host/hid_controller/src/hid_app.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-/* From https://www.kernel.org/doc/html/latest/input/gamepad.html
- ____________________________ __
- / [__ZL__] [__ZR__] \ |
- / [__ TL __] [__ TR __] \ | Front Triggers
- __/________________________________\__ __|
- / _ \ |
- / /\ __ (N) \ |
- / || __ |MO| __ _ _ \ | Main Pad
- | <===DP===> |SE| |ST| (W) -|- (E) | |
- \ || ___ ___ _ / |
- /\ \/ / \ / \ (S) /\ __|
- / \________ | LS | ____ | RS | ________/ \ |
-| / \ \___/ / \ \___/ / \ | | Control Sticks
-| / \_____/ \_____/ \ | __|
-| / \ |
- \_____/ \_____/
-
- |________|______| |______|___________|
- D-Pad Left Right Action Pad
- Stick Stick
-
- |_____________|
- Menu Pad
-
- Most gamepads have the following features:
- - Action-Pad 4 buttons in diamonds-shape (on the right side) NORTH, SOUTH, WEST and EAST.
- - D-Pad (Direction-pad) 4 buttons (on the left side) that point up, down, left and right.
- - Menu-Pad Different constellations, but most-times 2 buttons: SELECT - START.
- - Analog-Sticks provide freely moveable sticks to control directions, Analog-sticks may also
- provide a digital button if you press them.
- - Triggers are located on the upper-side of the pad in vertical direction. The upper buttons
- are normally named Left- and Right-Triggers, the lower buttons Z-Left and Z-Right.
- - Rumble Many devices provide force-feedback features. But are mostly just simple rumble motors.
- */
-
-// Sony DS4 report layout detail https://www.psdevwiki.com/ps4/DS4-USB
-typedef struct TU_ATTR_PACKED
-{
- uint8_t x, y, z, rz; // joystick
-
- struct {
- uint8_t dpad : 4; // (hat format, 0x08 is released, 0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW)
- uint8_t square : 1; // west
- uint8_t cross : 1; // south
- uint8_t circle : 1; // east
- uint8_t triangle : 1; // north
- };
-
- struct {
- uint8_t l1 : 1;
- uint8_t r1 : 1;
- uint8_t l2 : 1;
- uint8_t r2 : 1;
- uint8_t share : 1;
- uint8_t option : 1;
- uint8_t l3 : 1;
- uint8_t r3 : 1;
- };
-
- struct {
- uint8_t ps : 1; // playstation button
- uint8_t tpad : 1; // track pad click
- uint8_t counter : 6; // +1 each report
- };
-
- // comment out since not used by this example
- // uint8_t l2_trigger; // 0 released, 0xff fully pressed
- // uint8_t r2_trigger; // as above
-
- // uint16_t timestamp;
- // uint8_t battery;
- //
- // int16_t gyro[3]; // x, y, z;
- // int16_t accel[3]; // x, y, z
-
- // there is still lots more info
-
-} sony_ds4_report_t;
-
-// check if device is Sony DualShock 4
-static inline bool is_sony_ds4(uint8_t dev_addr)
-{
- uint16_t vid, pid;
- tuh_vid_pid_get(dev_addr, &vid, &pid);
-
- return (vid == 0x054c && pid == 0x09cc);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-void hid_app_task(void)
-{
- // nothing to do
-}
-
-//--------------------------------------------------------------------+
-// TinyUSB Callbacks
-//--------------------------------------------------------------------+
-
-// Invoked when device with hid interface is mounted
-// Report descriptor is also available for use. tuh_hid_parse_report_descriptor()
-// can be used to parse common/simple enough descriptor.
-// Note: if report descriptor length > CFG_TUH_ENUMERATION_BUFSIZE, it will be skipped
-// therefore report_desc = NULL, desc_len = 0
-void tuh_hid_mount_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* desc_report, uint16_t desc_len)
-{
- uint16_t vid, pid;
- tuh_vid_pid_get(dev_addr, &vid, &pid);
-
- printf("HID device address = %d, instance = %d is mounted\r\n", dev_addr, instance);
- printf("VID = %04x, PID = %04x\r\n", vid, pid);
-
- // Sony DualShock 4 [CUH-ZCT2x]
- if ( is_sony_ds4(dev_addr) )
- {
- // request to receive report
- // tuh_hid_report_received_cb() will be invoked when report is available
- if ( !tuh_hid_receive_report(dev_addr, instance) )
- {
- printf("Error: cannot request to receive report\r\n");
- }
- }
-}
-
-// Invoked when device with hid interface is un-mounted
-void tuh_hid_umount_cb(uint8_t dev_addr, uint8_t instance)
-{
- printf("HID device address = %d, instance = %d is unmounted\r\n", dev_addr, instance);
-
-}
-
-// check if different than 2
-bool diff_than_2(uint8_t x, uint8_t y)
-{
- return (x - y > 2) || (y - x > 2);
-}
-
-// check if 2 reports are different enough
-bool diff_report(sony_ds4_report_t const* rpt1, sony_ds4_report_t const* rpt2)
-{
- bool result;
-
- // x, y, z, rz must different than 2 to be counted
- result = diff_than_2(rpt1->x, rpt2->x) || diff_than_2(rpt1->y , rpt2->y ) ||
- diff_than_2(rpt1->z, rpt2->z) || diff_than_2(rpt1->rz, rpt2->rz);
-
- // check the reset with mem compare
- result |= memcmp(&rpt1->rz + 1, &rpt2->rz + 1, sizeof(sony_ds4_report_t)-4);
-
- return result;
-}
-
-void process_sony_ds4(uint8_t const* report, uint16_t len)
-{
- const char* dpad_str[] = { "N", "NE", "E", "SE", "S", "SW", "W", "NW", "none" };
-
- // previous report used to compare for changes
- static sony_ds4_report_t prev_report = { 0 };
-
- uint8_t const report_id = report[0];
- report++;
- len--;
-
- // all buttons state is stored in ID 1
- if (report_id == 1)
- {
- sony_ds4_report_t ds4_report;
- memcpy(&ds4_report, report, sizeof(ds4_report));
-
- // counter is +1, assign to make it easier to compare 2 report
- prev_report.counter = ds4_report.counter;
-
- // only print if changes since it is polled ~ 5ms
- // Since count+1 after each report and x, y, z, rz fluctuate within 1 or 2
- // We need more than memcmp to check if report is different enough
- if ( diff_report(&prev_report, &ds4_report) )
- {
- printf("(x, y, z, rz) = (%u, %u, %u, %u)\r\n", ds4_report.x, ds4_report.y, ds4_report.z, ds4_report.rz);
- printf("DPad = %s ", dpad_str[ds4_report.dpad]);
-
- if (ds4_report.square ) printf("Square ");
- if (ds4_report.cross ) printf("Cross ");
- if (ds4_report.circle ) printf("Circle ");
- if (ds4_report.triangle ) printf("Triangle ");
-
- if (ds4_report.l1 ) printf("L1 ");
- if (ds4_report.r1 ) printf("R1 ");
- if (ds4_report.l2 ) printf("L2 ");
- if (ds4_report.r2 ) printf("R2 ");
-
- if (ds4_report.share ) printf("Share ");
- if (ds4_report.option ) printf("Option ");
- if (ds4_report.l3 ) printf("L3 ");
- if (ds4_report.r3 ) printf("R3 ");
-
- if (ds4_report.ps ) printf("PS ");
- if (ds4_report.tpad ) printf("TPad ");
-
- printf("\r\n");
- }
-
- prev_report = ds4_report;
- }
-}
-
-// Invoked when received report from device via interrupt endpoint
-void tuh_hid_report_received_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* report, uint16_t len)
-{
- if ( is_sony_ds4(dev_addr) )
- {
- process_sony_ds4(report, len);
- }
-
- // continue to request to receive report
- if ( !tuh_hid_receive_report(dev_addr, instance) )
- {
- printf("Error: cannot request to receive report\r\n");
- }
-}
diff --git a/tinyusb/examples/host/hid_controller/src/main.c b/tinyusb/examples/host/hid_controller/src/main.c
deleted file mode 100755
index e13fa818..00000000
--- a/tinyusb/examples/host/hid_controller/src/main.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 example current worked and tested with following controller
- * - Sony DualShock 4 [CUH-ZCT2x] VID = 0x054c, PID = 0x09cc
- */
-
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "bsp/board.h"
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-void led_blinking_task(void);
-
-extern void cdc_task(void);
-extern void hid_app_task(void);
-
-/*------------- MAIN -------------*/
-int main(void)
-{
- board_init();
-
- printf("TinyUSB Host HID Controller Example\r\n");
-
- tusb_init();
-
- while (1)
- {
- // tinyusb host task
- tuh_task();
- led_blinking_task();
-
-#if CFG_TUH_CDC
- cdc_task();
-#endif
-
-#if CFG_TUH_HID
- hid_app_task();
-#endif
- }
-
- return 0;
-}
-
-//--------------------------------------------------------------------+
-// TinyUSB Callbacks
-//--------------------------------------------------------------------+
-
-//--------------------------------------------------------------------+
-// Blinking Task
-//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
- const uint32_t interval_ms = 1000;
- static uint32_t start_ms = 0;
-
- static bool led_state = false;
-
- // Blink every interval ms
- if ( board_millis() - start_ms < interval_ms) return; // not enough time
- start_ms += interval_ms;
-
- board_led_write(led_state);
- led_state = 1 - led_state; // toggle
-}
diff --git a/tinyusb/examples/host/hid_controller/src/tusb_config.h b/tinyusb/examples/host/hid_controller/src/tusb_config.h
deleted file mode 100755
index 74b471ae..00000000
--- a/tinyusb/examples/host/hid_controller/src/tusb_config.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by compiler flags for flexibility
-#ifndef CFG_TUSB_MCU
- #error CFG_TUSB_MCU must be defined
-#endif
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
- #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_HOST | OPT_MODE_HIGH_SPEED)
-#else
- #define CFG_TUSB_RHPORT0_MODE OPT_MODE_HOST
-#endif
-
-#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-// #define CFG_TUSB_DEBUG 0
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// CONFIGURATION
-//--------------------------------------------------------------------
-
-// Size of buffer to hold descriptors and other data used for enumeration
-#define CFG_TUH_ENUMERATION_BUFSIZE 256
-
-#define CFG_TUH_HUB 0
-#define CFG_TUH_CDC 0
-#define CFG_TUH_HID 4 // typical keyboard + mouse device can have 3-4 HID interfaces
-#define CFG_TUH_MSC 0
-#define CFG_TUH_VENDOR 0
-
-// max device support (excluding hub device)
-// 1 hub typically has 4 ports
-#define CFG_TUH_DEVICE_MAX (CFG_TUH_HUB ? 4 : 1)
-
-//------------- HID -------------//
-
-#define CFG_TUH_HID_EP_BUFSIZE 64
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/examples/make.mk b/tinyusb/examples/make.mk
deleted file mode 100755
index 9daf60e3..00000000
--- a/tinyusb/examples/make.mk
+++ /dev/null
@@ -1,132 +0,0 @@
-# ---------------------------------------
-# Common make definition for all examples
-# ---------------------------------------
-
-# Build directory
-BUILD := _build/$(BOARD)
-
-PROJECT := $(notdir $(CURDIR))
-BIN := $(TOP)/_bin/$(BOARD)/$(notdir $(CURDIR))
-
-# Handy check parameter function
-check_defined = \
- $(strip $(foreach 1,$1, \
- $(call __check_defined,$1,$(strip $(value 2)))))
-__check_defined = \
- $(if $(value $1),, \
- $(error Undefined make flag: $1$(if $2, ($2))))
-
-#-------------- Select the board to build for. ------------
-
-# Board without family
-ifneq ($(wildcard $(TOP)/hw/bsp/$(BOARD)/board.mk),)
-BOARD_PATH := hw/bsp/$(BOARD)
-FAMILY :=
-endif
-
-# Board within family
-ifeq ($(BOARD_PATH),)
- BOARD_PATH := $(subst $(TOP)/,,$(wildcard $(TOP)/hw/bsp/*/boards/$(BOARD)))
- FAMILY := $(word 3, $(subst /, ,$(BOARD_PATH)))
- FAMILY_PATH = hw/bsp/$(FAMILY)
-endif
-
-ifeq ($(BOARD_PATH),)
- $(info You must provide a BOARD parameter with 'BOARD=')
- $(error Invalid BOARD specified)
-endif
-
-ifeq ($(FAMILY),)
- include $(TOP)/hw/bsp/$(BOARD)/board.mk
-else
- # Include Family and Board specific defs
- include $(TOP)/$(FAMILY_PATH)/family.mk
-
- SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
-endif
-
-# Fetch submodules depended by family
-fetch_submodule_if_empty = $(if $(wildcard $(TOP)/$1/*),,$(info $(shell git -C $(TOP) submodule update --init $1)))
-ifdef DEPS_SUBMODULES
- $(foreach s,$(DEPS_SUBMODULES),$(call fetch_submodule_if_empty,$(s)))
-endif
-
-#-------------- Cross Compiler ------------
-# Can be set by board, default to ARM GCC
-CROSS_COMPILE ?= arm-none-eabi-
-
-CC = $(CROSS_COMPILE)gcc
-CXX = $(CROSS_COMPILE)g++
-GDB = $(CROSS_COMPILE)gdb
-OBJCOPY = $(CROSS_COMPILE)objcopy
-SIZE = $(CROSS_COMPILE)size
-MKDIR = mkdir
-
-ifeq ($(CMDEXE),1)
- CP = copy
- RM = del
-else
- SED = sed
- CP = cp
- RM = rm
-endif
-
-#-------------- Source files and compiler flags --------------
-
-# Include all source C in family & board folder
-SRC_C += hw/bsp/board.c
-SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(BOARD_PATH)/*.c))
-
-INC += $(TOP)/$(FAMILY_PATH)
-
-# Compiler Flags
-CFLAGS += \
- -ggdb \
- -fdata-sections \
- -ffunction-sections \
- -fsingle-precision-constant \
- -fno-strict-aliasing \
- -Wdouble-promotion \
- -Wstrict-prototypes \
- -Wstrict-overflow \
- -Wall \
- -Wextra \
- -Werror \
- -Wfatal-errors \
- -Werror-implicit-function-declaration \
- -Wfloat-equal \
- -Wundef \
- -Wshadow \
- -Wwrite-strings \
- -Wsign-compare \
- -Wmissing-format-attribute \
- -Wunreachable-code \
- -Wcast-align \
- -Wcast-function-type
-
-# Debugging/Optimization
-ifeq ($(DEBUG), 1)
- CFLAGS += -Og
-else
- CFLAGS += -Os
-endif
-
-# Log level is mapped to TUSB DEBUG option
-ifneq ($(LOG),)
- CMAKE_DEFSYM += -DLOG=$(LOG)
- CFLAGS += -DCFG_TUSB_DEBUG=$(LOG)
-endif
-
-# Logger: default is uart, can be set to rtt or swo
-ifneq ($(LOGGER),)
- CMAKE_DEFSYM += -DLOGGER=$(LOGGER)
-endif
-
-ifeq ($(LOGGER),rtt)
- CFLAGS += -DLOGGER_RTT -DSEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
- RTT_SRC = lib/SEGGER_RTT
- INC += $(TOP)/$(RTT_SRC)/RTT
- SRC_C += $(RTT_SRC)/RTT/SEGGER_RTT.c
-else ifeq ($(LOGGER),swo)
- CFLAGS += -DLOGGER_SWO
-endif
diff --git a/tinyusb/examples/rules.mk b/tinyusb/examples/rules.mk
deleted file mode 100755
index 4fce468f..00000000
--- a/tinyusb/examples/rules.mk
+++ /dev/null
@@ -1,204 +0,0 @@
-# ---------------------------------------
-# Common make rules for all examples
-# ---------------------------------------
-
-# Set all as default goal
-.DEFAULT_GOAL := all
-
-# ESP32-SX and RP2040 has its own CMake build system
-ifneq ($(FAMILY),esp32s2)
-ifneq ($(FAMILY),esp32s3)
-ifneq ($(FAMILY),rp2040)
-# ---------------------------------------
-# GNU Make build system
-# ---------------------------------------
-
-# libc
-LIBS += -lgcc -lm -lnosys
-
-ifneq ($(BOARD), spresense)
-LIBS += -lc
-endif
-
-# TinyUSB Stack source
-SRC_C += \
- src/tusb.c \
- src/common/tusb_fifo.c \
- src/device/usbd.c \
- src/device/usbd_control.c \
- src/class/audio/audio_device.c \
- src/class/cdc/cdc_device.c \
- src/class/dfu/dfu_device.c \
- src/class/dfu/dfu_rt_device.c \
- src/class/hid/hid_device.c \
- src/class/midi/midi_device.c \
- src/class/msc/msc_device.c \
- src/class/net/net_device.c \
- src/class/usbtmc/usbtmc_device.c \
- src/class/vendor/vendor_device.c
-
-# TinyUSB stack include
-INC += $(TOP)/src
-
-CFLAGS += $(addprefix -I,$(INC))
-
-LDFLAGS += $(CFLAGS) -Wl,-T,$(TOP)/$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections
-ifneq ($(SKIP_NANOLIB), 1)
-LDFLAGS += -specs=nosys.specs -specs=nano.specs
-endif
-
-ASFLAGS += $(CFLAGS)
-
-# Assembly files can be name with upper case .S, convert it to .s
-SRC_S := $(SRC_S:.S=.s)
-
-# Due to GCC LTO bug https://bugs.launchpad.net/gcc-arm-embedded/+bug/1747966
-# assembly file should be placed first in linking order
-# '_asm' suffix is added to object of assembly file
-OBJ += $(addprefix $(BUILD)/obj/, $(SRC_S:.s=_asm.o))
-OBJ += $(addprefix $(BUILD)/obj/, $(SRC_C:.c=.o))
-
-# Verbose mode
-ifeq ("$(V)","1")
-$(info CFLAGS $(CFLAGS) ) $(info )
-$(info LDFLAGS $(LDFLAGS)) $(info )
-$(info ASFLAGS $(ASFLAGS)) $(info )
-endif
-
-all: $(BUILD)/$(PROJECT).bin $(BUILD)/$(PROJECT).hex size
-
-uf2: $(BUILD)/$(PROJECT).uf2
-
-OBJ_DIRS = $(sort $(dir $(OBJ)))
-$(OBJ): | $(OBJ_DIRS)
-$(OBJ_DIRS):
-ifeq ($(CMDEXE),1)
- @$(MKDIR) $(subst /,\,$@)
-else
- @$(MKDIR) -p $@
-endif
-
-$(BUILD)/$(PROJECT).elf: $(OBJ)
- @echo LINK $@
- @$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group
-
-$(BUILD)/$(PROJECT).bin: $(BUILD)/$(PROJECT).elf
- @echo CREATE $@
- @$(OBJCOPY) -O binary $^ $@
-
-$(BUILD)/$(PROJECT).hex: $(BUILD)/$(PROJECT).elf
- @echo CREATE $@
- @$(OBJCOPY) -O ihex $^ $@
-
-# UF2 generation, iMXRT need to strip to text only before conversion
-ifeq ($(FAMILY),imxrt)
-$(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).elf
- @echo CREATE $@
- @$(OBJCOPY) -O ihex -R .flash_config -R .ivt $^ $(BUILD)/$(PROJECT)-textonly.hex
- $(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -c -o $@ $(BUILD)/$(PROJECT)-textonly.hex
-else
-$(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).hex
- @echo CREATE $@
- $(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -c -o $@ $^
-endif
-
-copy-artifact: $(BUILD)/$(PROJECT).bin $(BUILD)/$(PROJECT).hex $(BUILD)/$(PROJECT).uf2
-
-# We set vpath to point to the top of the tree so that the source files
-# can be located. By following this scheme, it allows a single build rule
-# to be used to compile all .c files.
-vpath %.c . $(TOP)
-$(BUILD)/obj/%.o: %.c
- @echo CC $(notdir $@)
- @$(CC) $(CFLAGS) -c -MD -o $@ $<
-
-# ASM sources lower case .s
-vpath %.s . $(TOP)
-$(BUILD)/obj/%_asm.o: %.s
- @echo AS $(notdir $@)
- @$(CC) -x assembler-with-cpp $(ASFLAGS) -c -o $@ $<
-
-# ASM sources upper case .S
-vpath %.S . $(TOP)
-$(BUILD)/obj/%_asm.o: %.S
- @echo AS $(notdir $@)
- @$(CC) -x assembler-with-cpp $(ASFLAGS) -c -o $@ $<
-
-size: $(BUILD)/$(PROJECT).elf
- -@echo ''
- @$(SIZE) $<
- -@echo ''
-
-.PHONY: clean
-clean:
-ifeq ($(CMDEXE),1)
- rd /S /Q $(subst /,\,$(BUILD))
-else
- $(RM) -rf $(BUILD)
-endif
-
-endif
-endif
-endif # GNU Make
-
-# ---------------------------------------
-# Flash Targets
-# ---------------------------------------
-
-# Flash binary using Jlink
-ifeq ($(OS),Windows_NT)
- JLINKEXE = JLink.exe
-else
- JLINKEXE = JLinkExe
-endif
-
-JLINK_IF ?= swd
-
-# Flash using jlink
-flash-jlink: $(BUILD)/$(PROJECT).hex
- @echo halt > $(BUILD)/$(BOARD).jlink
- @echo r > $(BUILD)/$(BOARD).jlink
- @echo loadfile $^ >> $(BUILD)/$(BOARD).jlink
- @echo r >> $(BUILD)/$(BOARD).jlink
- @echo go >> $(BUILD)/$(BOARD).jlink
- @echo exit >> $(BUILD)/$(BOARD).jlink
- $(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $(BUILD)/$(BOARD).jlink
-
-# flash STM32 MCU using stlink with STM32 Cube Programmer CLI
-flash-stlink: $(BUILD)/$(PROJECT).elf
- STM32_Programmer_CLI --connect port=swd --write $< --go
-
-# flash with pyocd
-flash-pyocd: $(BUILD)/$(PROJECT).hex
- pyocd flash -t $(PYOCD_TARGET) $<
- pyocd reset -t $(PYOCD_TARGET)
-
-# flash with Black Magic Probe
-
-# This symlink is created by https://github.com/blacksphere/blackmagic/blob/master/driver/99-blackmagic.rules
-BMP ?= /dev/ttyBmpGdb
-
-flash-bmp: $(BUILD)/$(PROJECT).elf
- $(GDB) --batch -ex 'target extended-remote $(BMP)' -ex 'monitor swdp_scan' -ex 'attach 1' -ex load $<
-
-debug-bmp: $(BUILD)/$(PROJECT).elf
- $(GDB) -ex 'target extended-remote $(BMP)' -ex 'monitor swdp_scan' -ex 'attach 1' $<
-
-#-------------- Artifacts --------------
-
-# Create binary directory
-$(BIN):
- @$(MKDIR) -p $@
-
-# Copy binaries .elf, .bin, .hex, .uf2 to BIN for upload
-# due to large size of combined artifacts, only uf2 is uploaded for now
-copy-artifact: $(BIN)
- @$(CP) $(BUILD)/$(PROJECT).uf2 $(BIN)
- #@$(CP) $(BUILD)/$(PROJECT).bin $(BIN)
- #@$(CP) $(BUILD)/$(PROJECT).hex $(BIN)
- #@$(CP) $(BUILD)/$(PROJECT).elf $(BIN)
-
-# Print out the value of a make variable.
-# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile
-print-%:
- @echo $* = $($*)
diff --git a/tinyusb/hw/bsp/ansi_escape.h b/tinyusb/hw/bsp/ansi_escape.h
deleted file mode 100755
index 35342cfe..00000000
--- a/tinyusb/hw/bsp/ansi_escape.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup group_board
- * \defgroup group_ansi_esc ANSI Esacpe Code
- * @{ */
-
-#ifndef _TUSB_ANSI_ESC_CODE_H_
-#define _TUSB_ANSI_ESC_CODE_H_
-
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define CSI_CODE(seq) "\33[" seq
-#define CSI_SGR(x) CSI_CODE(#x) "m"
-
-//------------- Cursor movement -------------//
-/** \defgroup group_ansi_cursor Cursor Movement
- * @{ */
-#define ANSI_CURSOR_UP(n) CSI_CODE(#n "A") ///< Move cursor up
-#define ANSI_CURSOR_DOWN(n) CSI_CODE(#n "B") ///< Move cursor down
-#define ANSI_CURSOR_FORWARD(n) CSI_CODE(#n "C") ///< Move cursor forward
-#define ANSI_CURSOR_BACKWARD(n) CSI_CODE(#n "D") ///< Move cursor backward
-#define ANSI_CURSOR_LINE_DOWN(n) CSI_CODE(#n "E") ///< Move cursor to the beginning of the line (n) down
-#define ANSI_CURSOR_LINE_UP(n) CSI_CODE(#n "F") ///< Move cursor to the beginning of the line (n) up
-#define ANSI_CURSOR_POSITION(n, m) CSI_CODE(#n ";" #m "H") ///< Move cursor to position (n, m)
-/** @} */
-
-//------------- Screen -------------//
-/** \defgroup group_ansi_screen Screen Control
- * @{ */
-#define ANSI_ERASE_SCREEN(n) CSI_CODE(#n "J") ///< Erase the screen
-#define ANSI_ERASE_LINE(n) CSI_CODE(#n "K") ///< Erase the line (n)
-#define ANSI_SCROLL_UP(n) CSI_CODE(#n "S") ///< Scroll the whole page up (n) lines
-#define ANSI_SCROLL_DOWN(n) CSI_CODE(#n "T") ///< Scroll the whole page down (n) lines
-/** @} */
-
-//------------- Text Color -------------//
-/** \defgroup group_ansi_text Text Color
- * @{ */
-#define ANSI_TEXT_BLACK CSI_SGR(30)
-#define ANSI_TEXT_RED CSI_SGR(31)
-#define ANSI_TEXT_GREEN CSI_SGR(32)
-#define ANSI_TEXT_YELLOW CSI_SGR(33)
-#define ANSI_TEXT_BLUE CSI_SGR(34)
-#define ANSI_TEXT_MAGENTA CSI_SGR(35)
-#define ANSI_TEXT_CYAN CSI_SGR(36)
-#define ANSI_TEXT_WHITE CSI_SGR(37)
-#define ANSI_TEXT_DEFAULT CSI_SGR(39)
-/** @} */
-
-//------------- Background Color -------------//
-/** \defgroup group_ansi_background Background Color
- * @{ */
-#define ANSI_BG_BLACK CSI_SGR(40)
-#define ANSI_BG_RED CSI_SGR(41)
-#define ANSI_BG_GREEN CSI_SGR(42)
-#define ANSI_BG_YELLOW CSI_SGR(43)
-#define ANSI_BG_BLUE CSI_SGR(44)
-#define ANSI_BG_MAGENTA CSI_SGR(45)
-#define ANSI_BG_CYAN CSI_SGR(46)
-#define ANSI_BG_WHITE CSI_SGR(47)
-#define ANSI_BG_DEFAULT CSI_SGR(49)
-/** @} */
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_ANSI_ESC_CODE_H_ */
-
-/** @} */
diff --git a/tinyusb/hw/bsp/board.c b/tinyusb/hw/bsp/board.c
deleted file mode 100755
index 6a26f55b..00000000
--- a/tinyusb/hw/bsp/board.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018, hathach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "board.h"
-
-#if 0
-#define LED_PHASE_MAX 8
-
-static struct
-{
- uint32_t phase[LED_PHASE_MAX];
- uint8_t phase_count;
-
- bool led_state;
- uint8_t current_phase;
- uint32_t current_ms;
-}led_pattern;
-
-void board_led_pattern(uint32_t const phase_ms[], uint8_t count)
-{
- memcpy(led_pattern.phase, phase_ms, 4*count);
- led_pattern.phase_count = count;
-
- // reset with 1st phase is on
- led_pattern.current_ms = board_millis();
- led_pattern.current_phase = 0;
- led_pattern.led_state = true;
- board_led_on();
-}
-
-void board_led_task(void)
-{
- if ( led_pattern.phase_count == 0 ) return;
-
- uint32_t const duration = led_pattern.phase[led_pattern.current_phase];
-
- // return if not enough time
- if (board_millis() - led_pattern.current_ms < duration) return;
-
- led_pattern.led_state = !led_pattern.led_state;
- board_led_write(led_pattern.led_state);
-
- led_pattern.current_ms += duration;
- led_pattern.current_phase++;
-
- if (led_pattern.current_phase == led_pattern.phase_count)
- {
- led_pattern.current_phase = 0;
- led_pattern.led_state = true;
- board_led_on();
- }
-}
-#endif
-
-//--------------------------------------------------------------------+
-// newlib read()/write() retarget
-//--------------------------------------------------------------------+
-
-#if defined(__MSP430__) || defined(__RX__)
- #define sys_write write
- #define sys_read read
-#else
- #define sys_write _write
- #define sys_read _read
-#endif
-
-#if defined(LOGGER_RTT)
-// Logging with RTT
-
-// If using SES IDE, use the Syscalls/SEGGER_RTT_Syscalls_SES.c instead
-#if !(defined __SES_ARM) && !(defined __SES_RISCV) && !(defined __CROSSWORKS_ARM)
-#include "SEGGER_RTT.h"
-
-TU_ATTR_USED int sys_write (int fhdl, const void *buf, size_t count)
-{
- (void) fhdl;
- SEGGER_RTT_Write(0, (char*) buf, (int) count);
- return count;
-}
-
-TU_ATTR_USED int sys_read (int fhdl, char *buf, size_t count)
-{
- (void) fhdl;
- return SEGGER_RTT_Read(0, buf, count);
-}
-#endif
-
-#elif defined(LOGGER_SWO)
-// Logging with SWO for ARM Cortex
-
-#include "board_mcu.h"
-
-TU_ATTR_USED int sys_write (int fhdl, const void *buf, size_t count)
-{
- (void) fhdl;
- uint8_t const* buf8 = (uint8_t const*) buf;
- for(size_t i=0; i<count; i++)
- {
- ITM_SendChar(buf8[i]);
- }
- return count;
-}
-
-TU_ATTR_USED int sys_read (int fhdl, char *buf, size_t count)
-{
- (void) fhdl;
- return 0;
-}
-
-#else
-
-// Default logging with on-board UART
-TU_ATTR_USED int sys_write (int fhdl, const void *buf, size_t count)
-{
- (void) fhdl;
- return board_uart_write(buf, count);
-}
-
-TU_ATTR_USED int sys_read (int fhdl, char *buf, size_t count)
-{
- (void) fhdl;
- return board_uart_read((uint8_t*) buf, count);
-}
-
-#endif
diff --git a/tinyusb/hw/bsp/board.h b/tinyusb/hw/bsp/board.h
deleted file mode 100755
index 782e0939..00000000
--- a/tinyusb/hw/bsp/board.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup group_demo
- * \defgroup group_board Boards Abstraction Layer
- * @{ */
-
-#ifndef _BSP_BOARD_H_
-#define _BSP_BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include <stdint.h>
-#include <stdbool.h>
-
-#include "ansi_escape.h"
-#include "tusb.h"
-
-#define CFG_BOARD_UART_BAUDRATE 115200
-
-//--------------------------------------------------------------------+
-// Board Porting API
-// For simplicity, only one LED and one Button are used
-//--------------------------------------------------------------------+
-
-// Initialize on-board peripherals : led, button, uart and USB
-void board_init(void);
-
-// Turn LED on or off
-void board_led_write(bool state);
-
-// Control led pattern using phase duration in ms.
-// For each phase, LED is toggle then repeated, board_led_task() is required to be called
-//void board_led_pattern(uint32_t const phase_ms[], uint8_t count);
-
-// Get the current state of button
-// a '1' means active (pressed), a '0' means inactive.
-uint32_t board_button_read(void);
-
-// Get characters from UART
-int board_uart_read(uint8_t* buf, int len);
-
-// Send characters to UART
-int board_uart_write(void const * buf, int len);
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // Get current milliseconds, must be implemented when no RTOS is used
- uint32_t board_millis(void);
-
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- static inline uint32_t board_millis(void)
- {
- return ( ( ((uint64_t) xTaskGetTickCount()) * 1000) / configTICK_RATE_HZ );
- }
-
-#elif CFG_TUSB_OS == OPT_OS_MYNEWT
- static inline uint32_t board_millis(void)
- {
- return os_time_ticks_to_ms32( os_time_get() );
- }
-
-#elif CFG_TUSB_OS == OPT_OS_PICO
- #include "pico/time.h"
- static inline uint32_t board_millis(void)
- {
- return to_ms_since_boot(get_absolute_time());
- }
-
-#elif CFG_TUSB_OS == OPT_OS_RTTHREAD
- static inline uint32_t board_millis(void)
- {
- return (((uint64_t)rt_tick_get()) * 1000 / RT_TICK_PER_SECOND);
- }
-
-#else
- #error "board_millis() is not implemented for this OS"
-#endif
-
-//--------------------------------------------------------------------+
-// Helper functions
-//--------------------------------------------------------------------+
-static inline void board_led_on(void)
-{
- board_led_write(true);
-}
-
-static inline void board_led_off(void)
-{
- board_led_write(false);
-}
-
-// TODO remove
-static inline void board_delay(uint32_t ms)
-{
- uint32_t start_ms = board_millis();
- while (board_millis() - start_ms < ms)
- {
- #if TUSB_OPT_DEVICE_ENABLED
- // take chance to run usb background
- tud_task();
- #endif
- }
-}
-
-static inline int board_uart_getchar(void)
-{
- uint8_t c;
- return board_uart_read(&c, 1) ? (int) c : (-1);
-}
-
-static inline int board_uart_putchar(uint8_t c)
-{
- return board_uart_write(&c, 1);
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _BSP_BOARD_H_ */
-
-/** @} */
diff --git a/tinyusb/hw/bsp/board_mcu.h b/tinyusb/hw/bsp/board_mcu.h
deleted file mode 100755
index 8cc50c80..00000000
--- a/tinyusb/hw/bsp/board_mcu.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-
-#ifndef BOARD_MCU_H_
-#define BOARD_MCU_H_
-
-#include "tusb_option.h"
-
-//--------------------------------------------------------------------+
-// Low Level MCU header include. TinyUSB stack and example should be
-// platform independent and mostly doens't need to include this file.
-// However there are still certain situation where this file is needed:
-// - FreeRTOSConfig.h to set up correct clock and NVIC interrupts for ARM Cortex
-// - SWO logging for Cortex M with ITM_SendChar() / ITM_ReceiveChar()
-//--------------------------------------------------------------------+
-
-// Include order follows OPT_MCU_ number
-#if CFG_TUSB_MCU == OPT_MCU_LPC11UXX || CFG_TUSB_MCU == OPT_MCU_LPC13XX || \
- CFG_TUSB_MCU == OPT_MCU_LPC15XX || CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || \
- CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC18XX || \
- CFG_TUSB_MCU == OPT_MCU_LPC40XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX
- #include "chip.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_LPC51UXX || CFG_TUSB_MCU == OPT_MCU_LPC54XXX || \
- CFG_TUSB_MCU == OPT_MCU_LPC55XX || CFG_TUSB_MCU == OPT_MCU_MKL25ZXX || \
- CFG_TUSB_MCU == OPT_MCU_K32L2BXX
- #include "fsl_device_registers.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_NRF5X
- #include "nrf.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_SAMD11 || CFG_TUSB_MCU == OPT_MCU_SAMD21 || \
- CFG_TUSB_MCU == OPT_MCU_SAMD51 || CFG_TUSB_MCU == OPT_MCU_SAME5X || \
- CFG_TUSB_MCU == OPT_MCU_SAML22 || CFG_TUSB_MCU == OPT_MCU_SAML21
- #include "sam.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_SAMG
- #undef LITTLE_ENDIAN // hack to suppress "LITTLE_ENDIAN" redefined
- #include "sam.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F0
- #include "stm32f0xx.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F1
- #include "stm32f1xx.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F2
- #include "stm32f2xx.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F3
- #include "stm32f3xx.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F4
- #include "stm32f4xx.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F7
- #include "stm32f7xx.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32H7
- #include "stm32h7xx.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32L0
- #include "stm32l0xx.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32L1
- #include "stm32l1xx.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32L4
- #include "stm32l4xx.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_CXD56
- // no header needed
-
-#elif CFG_TUSB_MCU == OPT_MCU_MSP430x5xx
- #include "msp430.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_VALENTYUSB_EPTRI
- // no header needed
-
-#elif CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
- #include "fsl_device_registers.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_NUC120
- #include "NUC100Series.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_NUC121 || CFG_TUSB_MCU == OPT_MCU_NUC126
- #include "NuMicro.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_NUC505
- #include "NUC505Series.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_ESP32S2
- // no header needed
-
-#elif CFG_TUSB_MCU == OPT_MCU_ESP32S3
- // no header needed
-
-#elif CFG_TUSB_MCU == OPT_MCU_DA1469X
- #include "DA1469xAB.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_RP2040
- #include "pico.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_EFM32GG || CFG_TUSB_MCU == OPT_MCU_EFM32GG11 || CFG_TUSB_MCU == OPT_MCU_EFM32GG12
- #include "em_device.h"
-
-#elif CFG_TUSB_MCU == OPT_MCU_RX63X || CFG_TUSB_MCU == OPT_MCU_RX65X
- // no header needed
-
-#elif CFG_TUSB_MCU == OPT_MCU_GD32VF103
- #include "gd32vf103.h"
-
-#else
- #error "Missing MCU header"
-#endif
-
-
-#endif /* BOARD_MCU_H_ */
diff --git a/tinyusb/hw/bsp/d5035_01/board.mk b/tinyusb/hw/bsp/d5035_01/board.mk
deleted file mode 100755
index 1d09bd3d..00000000
--- a/tinyusb/hw/bsp/d5035_01/board.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/microchip
-HWREV ?= 1
-
-CFLAGS += \
- -mthumb \
- -mabi=aapcs \
- -mlong-calls \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib -nostartfiles \
- -D__SAME51J19A__ \
- -DCONF_CPU_FREQUENCY=80000000 \
- -DCONF_GCLK_USB_FREQUENCY=48000000 \
- -DCFG_TUSB_MCU=OPT_MCU_SAME5X \
- -DD5035_01=1 \
- -DBOARD_NAME="\"D5035-01\"" \
- -DSVC_Handler=SVCall_Handler \
- -DHWREV=$(HWREV)
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/same51j19a_flash.ld
-
-SRC_C += \
- src/portable/microchip/samd/dcd_samd.c \
- hw/mcu/microchip/same51/gcc/gcc/startup_same51.c \
- hw/mcu/microchip/same51/gcc/system_same51.c
-
-ifdef SYSCALLS
-ifneq ($(SYSCALLS),0)
- SRC_C += hw/mcu/microchip/same51/hal/utils/src/utils_syscalls.c
-endif
-endif
-
-ifdef LOG
-ifneq ($(LOG),0)
- SRC_C += hw/mcu/microchip/same51/hal/utils/src/utils_syscalls.c
-endif
-endif
-
-INC += \
- $(TOP)/hw/mcu/microchip/same51/ \
- $(TOP)/hw/mcu/microchip/same51/config \
- $(TOP)/hw/mcu/microchip/same51/include \
- $(TOP)/hw/mcu/microchip/same51/hal/include \
- $(TOP)/hw/mcu/microchip/same51/hal/utils/include \
- $(TOP)/hw/mcu/microchip/same51/hpl/port \
- $(TOP)/hw/mcu/microchip/same51/hri \
- $(TOP)/hw/mcu/microchip/same51/CMSIS/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAME51J19
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/d5035_01/d5035_01.c b/tinyusb/hw/bsp/d5035_01/d5035_01.c
deleted file mode 100755
index 5685ff16..00000000
--- a/tinyusb/hw/bsp/d5035_01/d5035_01.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Jean Gressmann <jean@0x42.de>
- *
- * 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.
- *
- */
-
-#include <sam.h>
-#include "bsp/board.h"
-
-#include <hal/include/hal_gpio.h>
-
-#if CONF_CPU_FREQUENCY != 80000000
-# error "CONF_CPU_FREQUENCY" must 80000000
-#endif
-
-#if CONF_GCLK_USB_FREQUENCY != 48000000
-# error "CONF_GCLK_USB_FREQUENCY" must 48000000
-#endif
-
-#if !defined(HWREV)
-# error Define "HWREV"
-#endif
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_0_Handler (void)
-{
- tud_int_handler(0);
-}
-
-void USB_1_Handler (void)
-{
- tud_int_handler(0);
-}
-
-void USB_2_Handler (void)
-{
- tud_int_handler(0);
-}
-
-void USB_3_Handler (void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-#define LED_PIN PIN_PA02
-
-#if HWREV < 3
-# define BOARD_SERCOM SERCOM5
-#else
-# define BOARD_SERCOM SERCOM0
-#endif
-
-static inline void init_clock(void)
-{
- /* AUTOWS is enabled by default in REG_NVMCTRL_CTRLA - no need to change the number of wait states when changing the core clock */
-#if HWREV == 1
- /* configure XOSC1 for a 16MHz crystal connected to XIN1/XOUT1 */
- OSCCTRL->XOSCCTRL[1].reg =
- OSCCTRL_XOSCCTRL_STARTUP(6) | // 1,953 ms
- OSCCTRL_XOSCCTRL_RUNSTDBY |
- OSCCTRL_XOSCCTRL_ENALC |
- OSCCTRL_XOSCCTRL_IMULT(4) |
- OSCCTRL_XOSCCTRL_IPTAT(3) |
- OSCCTRL_XOSCCTRL_XTALEN |
- OSCCTRL_XOSCCTRL_ENABLE;
- while(0 == OSCCTRL->STATUS.bit.XOSCRDY1);
-
- OSCCTRL->Dpll[0].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_DIV(3) | OSCCTRL_DPLLCTRLB_REFCLK(OSCCTRL_DPLLCTRLB_REFCLK_XOSC1_Val); /* pre-scaler = 8, input = XOSC1 */
- OSCCTRL->Dpll[0].DPLLRATIO.reg = OSCCTRL_DPLLRATIO_LDRFRAC(0x0) | OSCCTRL_DPLLRATIO_LDR(39); /* multiply by 40 -> 80 MHz */
- OSCCTRL->Dpll[0].DPLLCTRLA.reg = OSCCTRL_DPLLCTRLA_RUNSTDBY | OSCCTRL_DPLLCTRLA_ENABLE;
- while(0 == OSCCTRL->Dpll[0].DPLLSTATUS.bit.CLKRDY); /* wait for the PLL0 to be ready */
-
- OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_DIV(7) | OSCCTRL_DPLLCTRLB_REFCLK(OSCCTRL_DPLLCTRLB_REFCLK_XOSC1_Val); /* pre-scaler = 16, input = XOSC1 */
- OSCCTRL->Dpll[1].DPLLRATIO.reg = OSCCTRL_DPLLRATIO_LDRFRAC(0x0) | OSCCTRL_DPLLRATIO_LDR(47); /* multiply by 48 -> 48 MHz */
- OSCCTRL->Dpll[1].DPLLCTRLA.reg = OSCCTRL_DPLLCTRLA_RUNSTDBY | OSCCTRL_DPLLCTRLA_ENABLE;
- while(0 == OSCCTRL->Dpll[1].DPLLSTATUS.bit.CLKRDY); /* wait for the PLL1 to be ready */
-#else // HWREV >= 1
- /* configure XOSC0 for a 16MHz crystal connected to XIN0/XOUT0 */
- OSCCTRL->XOSCCTRL[0].reg =
- OSCCTRL_XOSCCTRL_STARTUP(6) | // 1,953 ms
- OSCCTRL_XOSCCTRL_RUNSTDBY |
- OSCCTRL_XOSCCTRL_ENALC |
- OSCCTRL_XOSCCTRL_IMULT(4) |
- OSCCTRL_XOSCCTRL_IPTAT(3) |
- OSCCTRL_XOSCCTRL_XTALEN |
- OSCCTRL_XOSCCTRL_ENABLE;
- while(0 == OSCCTRL->STATUS.bit.XOSCRDY0);
-
- OSCCTRL->Dpll[0].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_DIV(3) | OSCCTRL_DPLLCTRLB_REFCLK(OSCCTRL_DPLLCTRLB_REFCLK_XOSC0_Val); /* pre-scaler = 8, input = XOSC1 */
- OSCCTRL->Dpll[0].DPLLRATIO.reg = OSCCTRL_DPLLRATIO_LDRFRAC(0x0) | OSCCTRL_DPLLRATIO_LDR(39); /* multiply by 40 -> 80 MHz */
- OSCCTRL->Dpll[0].DPLLCTRLA.reg = OSCCTRL_DPLLCTRLA_RUNSTDBY | OSCCTRL_DPLLCTRLA_ENABLE;
- while(0 == OSCCTRL->Dpll[0].DPLLSTATUS.bit.CLKRDY); /* wait for the PLL0 to be ready */
-
- OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_DIV(7) | OSCCTRL_DPLLCTRLB_REFCLK(OSCCTRL_DPLLCTRLB_REFCLK_XOSC0_Val); /* pre-scaler = 16, input = XOSC1 */
- OSCCTRL->Dpll[1].DPLLRATIO.reg = OSCCTRL_DPLLRATIO_LDRFRAC(0x0) | OSCCTRL_DPLLRATIO_LDR(47); /* multiply by 48 -> 48 MHz */
- OSCCTRL->Dpll[1].DPLLCTRLA.reg = OSCCTRL_DPLLCTRLA_RUNSTDBY | OSCCTRL_DPLLCTRLA_ENABLE;
- while(0 == OSCCTRL->Dpll[1].DPLLSTATUS.bit.CLKRDY); /* wait for the PLL1 to be ready */
-#endif // HWREV
-
- /* configure clock-generator 0 to use DPLL0 as source -> GCLK0 is used for the core */
- GCLK->GENCTRL[0].reg =
- GCLK_GENCTRL_DIV(0) |
- GCLK_GENCTRL_RUNSTDBY |
- GCLK_GENCTRL_GENEN |
- GCLK_GENCTRL_SRC_DPLL0 | /* DPLL0 */
- GCLK_GENCTRL_IDC ;
- while(1 == GCLK->SYNCBUSY.bit.GENCTRL0); /* wait for the synchronization between clock domains to be complete */
-
- /* configure clock-generator 1 to use DPLL1 as source -> for use with some peripheral */
- GCLK->GENCTRL[1].reg =
- GCLK_GENCTRL_DIV(0) |
- GCLK_GENCTRL_RUNSTDBY |
- GCLK_GENCTRL_GENEN |
- GCLK_GENCTRL_SRC_DPLL1 |
- GCLK_GENCTRL_IDC ;
- while(1 == GCLK->SYNCBUSY.bit.GENCTRL1); /* wait for the synchronization between clock domains to be complete */
-
- /* configure clock-generator 2 to use DPLL0 as source -> for use with SERCOM */
- GCLK->GENCTRL[2].reg =
- GCLK_GENCTRL_DIV(1) | /* 80MHz */
- GCLK_GENCTRL_RUNSTDBY |
- GCLK_GENCTRL_GENEN |
- GCLK_GENCTRL_SRC_DPLL0 |
- GCLK_GENCTRL_IDC ;
- while(1 == GCLK->SYNCBUSY.bit.GENCTRL2); /* wait for the synchronization between clock domains to be complete */
-}
-
-static inline void uart_init(void)
-{
-#if HWREV < 3
- /* configure SERCOM5 on PB02 */
- PORT->Group[1].WRCONFIG.reg =
- PORT_WRCONFIG_WRPINCFG |
- PORT_WRCONFIG_WRPMUX |
- PORT_WRCONFIG_PMUX(3) | /* function D */
- PORT_WRCONFIG_DRVSTR |
- PORT_WRCONFIG_PINMASK(0x0004) | /* PB02 */
- PORT_WRCONFIG_PMUXEN;
-
- MCLK->APBDMASK.bit.SERCOM5_ = 1;
- GCLK->PCHCTRL[SERCOM5_GCLK_ID_CORE].reg = GCLK_PCHCTRL_GEN_GCLK2 | GCLK_PCHCTRL_CHEN; /* setup SERCOM to use GLCK2 -> 80MHz */
-
- SERCOM5->USART.CTRLA.reg = 0x00; /* disable SERCOM -> enable config */
- while(SERCOM5->USART.SYNCBUSY.bit.ENABLE);
-
- SERCOM5->USART.CTRLA.reg = /* CMODE = 0 -> async, SAMPA = 0, FORM = 0 -> USART frame, SMPR = 0 -> arithmetic baud rate */
- SERCOM_USART_CTRLA_SAMPR(1) | /* 0 = 16x / arithmetic baud rate, 1 = 16x / fractional baud rate */
-// SERCOM_USART_CTRLA_FORM(0) | /* 0 = USART Frame, 2 = LIN Master */
- SERCOM_USART_CTRLA_DORD | /* LSB first */
- SERCOM_USART_CTRLA_MODE(1) | /* 0 = Asynchronous, 1 = USART with internal clock */
- SERCOM_USART_CTRLA_RXPO(1) | /* SERCOM PAD[1] is used for data reception */
- SERCOM_USART_CTRLA_TXPO(0); /* SERCOM PAD[0] is used for data transmission */
-
- SERCOM5->USART.CTRLB.reg = /* RXEM = 0 -> receiver disabled, LINCMD = 0 -> normal USART transmission, SFDE = 0 -> start-of-frame detection disabled, SBMODE = 0 -> one stop bit, CHSIZE = 0 -> 8 bits */
- SERCOM_USART_CTRLB_TXEN; /* transmitter enabled */
- SERCOM5->USART.CTRLC.reg = 0x00;
- // 21.701388889 @ baud rate of 230400 bit/s, table 33-2, p 918 of DS60001507E
- SERCOM5->USART.BAUD.reg = SERCOM_USART_BAUD_FRAC_FP(7) | SERCOM_USART_BAUD_FRAC_BAUD(21);
-
-// SERCOM5->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC;
- SERCOM5->SPI.CTRLA.bit.ENABLE = 1; /* activate SERCOM */
- while(SERCOM5->USART.SYNCBUSY.bit.ENABLE); /* wait for SERCOM to be ready */
-#else
-/* configure SERCOM0 on PA08 */
- PORT->Group[0].WRCONFIG.reg =
- PORT_WRCONFIG_WRPINCFG |
- PORT_WRCONFIG_WRPMUX |
- PORT_WRCONFIG_PMUX(2) | /* function C */
- PORT_WRCONFIG_DRVSTR |
- PORT_WRCONFIG_PINMASK(0x0100) | /* PA08 */
- PORT_WRCONFIG_PMUXEN;
-
- MCLK->APBAMASK.bit.SERCOM0_ = 1;
- GCLK->PCHCTRL[SERCOM0_GCLK_ID_CORE].reg = GCLK_PCHCTRL_GEN_GCLK2 | GCLK_PCHCTRL_CHEN; /* setup SERCOM to use GLCK2 -> 80MHz */
-
- SERCOM0->USART.CTRLA.reg = 0x00; /* disable SERCOM -> enable config */
- while(SERCOM0->USART.SYNCBUSY.bit.ENABLE);
-
- SERCOM0->USART.CTRLA.reg = /* CMODE = 0 -> async, SAMPA = 0, FORM = 0 -> USART frame, SMPR = 0 -> arithmetic baud rate */
- SERCOM_USART_CTRLA_SAMPR(1) | /* 0 = 16x / arithmetic baud rate, 1 = 16x / fractional baud rate */
-// SERCOM_USART_CTRLA_FORM(0) | /* 0 = USART Frame, 2 = LIN Master */
- SERCOM_USART_CTRLA_DORD | /* LSB first */
- SERCOM_USART_CTRLA_MODE(1) | /* 0 = Asynchronous, 1 = USART with internal clock */
- SERCOM_USART_CTRLA_RXPO(1) | /* SERCOM PAD[1] is used for data reception */
- SERCOM_USART_CTRLA_TXPO(0); /* SERCOM PAD[0] is used for data transmission */
-
- SERCOM0->USART.CTRLB.reg = /* RXEM = 0 -> receiver disabled, LINCMD = 0 -> normal USART transmission, SFDE = 0 -> start-of-frame detection disabled, SBMODE = 0 -> one stop bit, CHSIZE = 0 -> 8 bits */
- SERCOM_USART_CTRLB_TXEN; /* transmitter enabled */
- SERCOM0->USART.CTRLC.reg = 0x00;
- // 21.701388889 @ baud rate of 230400 bit/s, table 33-2, p 918 of DS60001507E
- SERCOM0->USART.BAUD.reg = SERCOM_USART_BAUD_FRAC_FP(7) | SERCOM_USART_BAUD_FRAC_BAUD(21);
-
-// SERCOM0->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC;
- SERCOM0->SPI.CTRLA.bit.ENABLE = 1; /* activate SERCOM */
- while(SERCOM0->USART.SYNCBUSY.bit.ENABLE); /* wait for SERCOM to be ready */
-#endif
-}
-
-static inline void uart_send_buffer(uint8_t const *text, size_t len)
-{
- for (size_t i = 0; i < len; ++i) {
- BOARD_SERCOM->USART.DATA.reg = text[i];
- while((BOARD_SERCOM->USART.INTFLAG.reg & SERCOM_SPI_INTFLAG_TXC) == 0);
- }
-}
-
-static inline void uart_send_str(const char* text)
-{
- while (*text) {
- BOARD_SERCOM->USART.DATA.reg = *text++;
- while((BOARD_SERCOM->USART.INTFLAG.reg & SERCOM_SPI_INTFLAG_TXC) == 0);
- }
-}
-
-
-void board_init(void)
-{
- init_clock();
-
- SystemCoreClock = CONF_CPU_FREQUENCY;
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- SysTick_Config(CONF_CPU_FREQUENCY / 1000);
-#endif
-
- uart_init();
-#if CFG_TUSB_DEBUG >= 2
- uart_send_str(BOARD_NAME " UART initialized\n");
- tu_printf(BOARD_NAME " reset cause %#02x\n", RSTC->RCAUSE.reg);
-#endif
-
- // Led init
- gpio_set_pin_direction(LED_PIN, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(LED_PIN, 0);
-
-#if CFG_TUSB_DEBUG >= 2
- uart_send_str(BOARD_NAME " LED pin configured\n");
-#endif
-
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB_0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USB_1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USB_2_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USB_3_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
-#endif
-
-
-#if TUSB_OPT_DEVICE_ENABLED
-#if CFG_TUSB_DEBUG >= 2
- uart_send_str(BOARD_NAME " USB device enabled\n");
-#endif
-
- /* USB clock init
- * The USB module requires a GCLK_USB of 48 MHz ~ 0.25% clock
- * for low speed and full speed operation. */
- hri_gclk_write_PCHCTRL_reg(GCLK, USB_GCLK_ID, GCLK_PCHCTRL_GEN_GCLK1_Val | GCLK_PCHCTRL_CHEN);
- hri_mclk_set_AHBMASK_USB_bit(MCLK);
- hri_mclk_set_APBBMASK_USB_bit(MCLK);
-
- // USB pin init
- gpio_set_pin_direction(PIN_PA24, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(PIN_PA24, false);
- gpio_set_pin_pull_mode(PIN_PA24, GPIO_PULL_OFF);
- gpio_set_pin_direction(PIN_PA25, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(PIN_PA25, false);
- gpio_set_pin_pull_mode(PIN_PA25, GPIO_PULL_OFF);
-
- gpio_set_pin_function(PIN_PA24, PINMUX_PA24H_USB_DM);
- gpio_set_pin_function(PIN_PA25, PINMUX_PA25H_USB_DP);
-
-
-#if CFG_TUSB_DEBUG >= 2
- uart_send_str(BOARD_NAME " USB device configured\n");
-#endif
-#endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- gpio_set_pin_level(LED_PIN, state);
-}
-
-uint32_t board_button_read(void)
-{
- // this board has no button
- return 0;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- if (len < 0) {
- uart_send_str(buf);
- } else {
- uart_send_buffer(buf, len);
- }
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-
-void SysTick_Handler(void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/d5035_01/same51j19a_flash.ld b/tinyusb/hw/bsp/d5035_01/same51j19a_flash.ld
deleted file mode 100755
index 328d1c72..00000000
--- a/tinyusb/hw/bsp/d5035_01/same51j19a_flash.ld
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAME51J19A
- *
- * Copyright (c) 2019 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
- bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
- qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x1000;
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- .bkupram (NOLOAD):
- {
- . = ALIGN(8);
- _sbkupram = .;
- *(.bkupram .bkupram.*);
- . = ALIGN(8);
- _ebkupram = .;
- } > bkupram
-
- .qspi (NOLOAD):
- {
- . = ALIGN(8);
- _sqspi = .;
- *(.qspi .qspi.*);
- . = ALIGN(8);
- _eqspi = .;
- } > qspi
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/da14695_dk_usb/board.mk b/tinyusb/hw/bsp/da14695_dk_usb/board.mk
deleted file mode 100755
index e969c79c..00000000
--- a/tinyusb/hw/bsp/da14695_dk_usb/board.mk
+++ /dev/null
@@ -1,55 +0,0 @@
-CFLAGS += \
- -flto \
- -mthumb \
- -mthumb-interwork \
- -mabi=aapcs \
- -mcpu=cortex-m33+nodsp \
- -mfloat-abi=hard \
- -mfpu=fpv5-sp-d16 \
- -nostdlib \
- -DCORE_M33 \
- -DCFG_TUSB_MCU=OPT_MCU_DA1469X \
- -DCFG_TUD_ENDPOINT0_SIZE=8\
-
-MCU_FAMILY_DIR = hw/mcu/dialog/da1469x
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/da1469x.ld
-
-# While this is for da1469x chip, there is chance that da1468x chip family will also work
-SRC_C += \
- src/portable/dialog/da146xx/dcd_da146xx.c \
- $(MCU_FAMILY_DIR)/src/system_da1469x.c \
- $(MCU_FAMILY_DIR)/src/da1469x_clock.c \
- $(MCU_FAMILY_DIR)/src/hal_gpio.c \
-
-SRC_S += hw/bsp/$(BOARD)/gcc_startup_da1469x.S
-
-INC += \
- $(TOP)/hw/bsp/$(BOARD) \
- $(TOP)/$(MCU_FAMILY_DIR)/include \
- $(TOP)/$(MCU_FAMILY_DIR)/SDK_10.0.8.105/sdk/bsp/include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM33_NTZ/non_secure
-
-# For flash-jlink target
-JLINK_DEVICE = DA14695
-
-# flash using jlink but with some twists
-flash: flash-dialog
-
-flash-dialog: $(BUILD)/$(PROJECT).bin
- @echo '#define SW_VERSION "v_1.0.0.1"' >$(BUILD)/version.h
- @echo '#define SW_VERSION_DATE "'`date +"%Y-%m-%d %H:%M"`'"' >>$(BUILD)/version.h
- mkimage da1469x $(BUILD)/$(PROJECT).bin $(BUILD)/version.h $^.img
- cp $(TOP)/hw/bsp/$(BOARD)/product_header.dump $(BUILD)/$(BOARD)-image.bin
- cat $^.img >> $(BUILD)/$(BOARD)-image.bin
- @echo r > $(BUILD)/$(BOARD).jlink
- @echo halt >> $(BUILD)/$(BOARD).jlink
- @echo loadfile $(BUILD)/$(BOARD)-image.bin 0x16000000 >> $(BUILD)/$(BOARD).jlink
- @echo r >> $(BUILD)/$(BOARD).jlink
- @echo go >> $(BUILD)/$(BOARD).jlink
- @echo exit >> $(BUILD)/$(BOARD).jlink
- $(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $(BUILD)/$(BOARD).jlink
-
diff --git a/tinyusb/hw/bsp/da14695_dk_usb/da14695_dk_usb.c b/tinyusb/hw/bsp/da14695_dk_usb/da14695_dk_usb.c
deleted file mode 100755
index e7c7ae36..00000000
--- a/tinyusb/hw/bsp/da14695_dk_usb/da14695_dk_usb.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Jerzy Kasenberg
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "bsp/board.h"
-#include <hal/hal_gpio.h>
-#include <mcu/mcu.h>
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-#define LED_PIN 33 // P1.1
-#define LED_STATE_ON 1
-#define LED_STATE_OFF (1-LED_STATE_ON)
-
-#define BUTTON_PIN 6
-
-void UnhandledIRQ(void)
-{
- CRG_TOP->SYS_CTRL_REG = 0x80;
- __BKPT(1);
- while(1);
-}
-
-void board_init(void)
-{
- // LED
- hal_gpio_init_out(LED_PIN, LED_STATE_ON);
-
- hal_gpio_init_out(1, 0);
- hal_gpio_init_out(2, 0);
- hal_gpio_init_out(3, 0);
- hal_gpio_init_out(4, 0);
- hal_gpio_init_out(5, 0);
-
- // Button
- hal_gpio_init_in(BUTTON_PIN, HAL_GPIO_PULL_NONE);
-
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-
- NVIC_SetPriority(USB_IRQn, 2);
-
- /* Setup USB IRQ */
- NVIC_SetPriority(USB_IRQn, 2);
- NVIC_EnableIRQ(USB_IRQn);
-
- /* Use PLL96 / 2 clock not HCLK */
- CRG_TOP->CLK_CTRL_REG &= ~CRG_TOP_CLK_CTRL_REG_USB_CLK_SRC_Msk;
-
- mcu_gpio_set_pin_function(14, MCU_GPIO_MODE_INPUT, MCU_GPIO_FUNC_USB);
- mcu_gpio_set_pin_function(15, MCU_GPIO_MODE_INPUT, MCU_GPIO_FUNC_USB);
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- hal_gpio_write(LED_PIN, state ? LED_STATE_ON : LED_STATE_OFF);
-}
-
-uint32_t board_button_read(void)
-{
- // button is active LOW
- return hal_gpio_read(BUTTON_PIN) ^ 1;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void)buf;
- (void)len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void)buf;
- (void)len;
-
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler(void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/da14695_dk_usb/da1469x.ld b/tinyusb/hw/bsp/da14695_dk_usb/da1469x.ld
deleted file mode 100755
index 96507d6e..00000000
--- a/tinyusb/hw/bsp/da14695_dk_usb/da1469x.ld
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-MEMORY
-{
- /*
- * Flash is remapped at 0x0 by 1st stage bootloader, but this is done with
- * an offset derived from image header thus it is safer to use remapped
- * address space at 0x0 instead of QSPI_M address space at 0x16000000.
- * Bootloader partition is 32K, but 9K is currently reserved for product
- * header (8K) and image header (1K).
- * First 512 bytes of SYSRAM are remapped at 0x0 and used as ISR vector
- * (there's no need to reallocate ISR vector) and thus cannot be used by
- * application.
- */
-
- FLASH (r) : ORIGIN = (0x00000000), LENGTH = (1024 * 1024)
- RAM (rw) : ORIGIN = (0x20000000), LENGTH = (512 * 1024)
-}
-
-OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- * Reset_Handler : Entry of reset handler
- *
- * It defines following symbols, which code can use without definition:
- * __exidx_start
- * __exidx_end
- * __etext
- * __data_start__
- * __preinit_array_start
- * __preinit_array_end
- * __init_array_start
- * __init_array_end
- * __fini_array_start
- * __fini_array_end
- * __data_end__
- * __bss_start__
- * __bss_end__
- * __HeapBase
- * __HeapLimit
- * __StackLimit
- * __StackTop
- * __stack
- * __bssnz_start__
- * __bssnz_end__
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
- __text = .;
-
- .text :
- {
- __isr_vector_start = .;
- KEEP(*(.isr_vector))
- /* ISR vector shall have exactly 512 bytes */
- . = __isr_vector_start + 0x200;
- __isr_vector_end = .;
-
- *(.text)
- *(.text.*)
-
- *(.libcmac.rom)
-
- 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*)
-
- *(.eh_frame*)
- . = ALIGN(4);
- } > FLASH
-
- .ARM.extab :
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- . = ALIGN(4);
- } > FLASH
-
- __exidx_start = .;
- .ARM :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- . = ALIGN(4);
- } > FLASH
- __exidx_end = .;
-
- .intvect :
- {
- . = ALIGN(4);
- __intvect_start__ = .;
- . = . + (__isr_vector_end - __isr_vector_start);
- . = ALIGN(4);
- } > RAM
-
- .sleep_state (NOLOAD) :
- {
- . = ALIGN(4);
- *(sleep_state)
- } > RAM
-
- /* This section will be zeroed by RTT package init */
- .rtt (NOLOAD):
- {
- . = ALIGN(4);
- *(.rtt)
- . = ALIGN(4);
- } > RAM
-
- __text_ram_addr = LOADADDR(.text_ram);
-
- .text_ram :
- {
- . = ALIGN(4);
- __text_ram_start__ = .;
- *(.text_ram*)
- . = ALIGN(4);
- __text_ram_end__ = .;
- } > RAM AT > FLASH
-
- __etext = LOADADDR(.data);
-
- .data :
- {
- __data_start__ = .;
- *(vtable)
- *(.data*)
-
- . = ALIGN(4);
- /* preinit data */
- PROVIDE_HIDDEN (__preinit_array_start = .);
- *(.preinit_array)
- PROVIDE_HIDDEN (__preinit_array_end = .);
-
- . = ALIGN(4);
- /* init data */
- PROVIDE_HIDDEN (__init_array_start = .);
- *(SORT(.init_array.*))
- *(.init_array)
- PROVIDE_HIDDEN (__init_array_end = .);
-
-
- . = ALIGN(4);
- /* finit data */
- PROVIDE_HIDDEN (__fini_array_start = .);
- *(SORT(.fini_array.*))
- *(.fini_array)
- PROVIDE_HIDDEN (__fini_array_end = .);
-
- *(.jcr)
- . = ALIGN(4);
- /* All data end */
- __data_end__ = .;
- } > RAM AT > FLASH
-
- .bssnz :
- {
- . = ALIGN(4);
- __bssnz_start__ = .;
- *(.bss.core.nz*)
- . = ALIGN(4);
- __bssnz_end__ = .;
- } > RAM
-
- .bss :
- {
- . = ALIGN(4);
- __bss_start__ = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4);
- __bss_end__ = .;
- } > RAM
-
- .cmac (NOLOAD) :
- {
- . = ALIGN(0x400);
- *(.libcmac.ram)
- } > RAM
-
- /* Heap starts after BSS */
- . = ALIGN(8);
- __HeapBase = .;
-
- /* .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):
- {
- *(.stack*)
- } > RAM
-
- _ram_start = ORIGIN(RAM);
-
- /* 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);
-
- /* Top of head is the bottom of the stack */
- __HeapLimit = __StackLimit;
- end = __HeapLimit;
-
- /* Check if data + heap + stack exceeds RAM limit */
- ASSERT(__HeapBase <= __HeapLimit, "region RAM overflowed with stack")
-
- /* Check that intvect is at the beginning of RAM */
- ASSERT(__intvect_start__ == ORIGIN(RAM), "intvect is not at beginning of RAM")
-}
-
diff --git a/tinyusb/hw/bsp/da14695_dk_usb/gcc_startup_da1469x.S b/tinyusb/hw/bsp/da14695_dk_usb/gcc_startup_da1469x.S
deleted file mode 100755
index d47fbcd9..00000000
--- a/tinyusb/hw/bsp/da14695_dk_usb/gcc_startup_da1469x.S
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
- #include "syscfg/syscfg.h"
-
- .syntax unified
- .arch armv7-m
-
- .section .stack
- .align 3
-#ifdef __STACK_SIZE
- .equ Stack_Size, __STACK_SIZE
-#else
- .equ Stack_Size, 0xC00
-#endif
- .equ SYS_CTRL_REG, 0x50000024
- .equ CACHE_FLASH_REG, 0x100C0040
- .equ RESET_STAT_REG, 0x500000BC
-
- .globl __StackTop
- .globl __StackLimit
-__StackLimit:
- .space Stack_Size
- .size __StackLimit, . - __StackLimit
-__StackTop:
- .size __StackTop, . - __StackTop
-
- .section .heap
- .align 3
-#ifdef __HEAP_SIZE
- .equ Heap_Size, __HEAP_SIZE
-#else
- .equ Heap_Size, 0
-#endif
- .globl __HeapBase
- .globl __HeapLimit
-__HeapBase:
- .if Heap_Size
- .space Heap_Size
- .endif
- .size __HeapBase, . - __HeapBase
-__HeapLimit:
- .size __HeapLimit, . - __HeapLimit
-
- .section .isr_vector
- .align 2
- .globl __isr_vector
-__isr_vector:
- .long __StackTop
- .long Reset_Handler
- /* Cortex-M33 interrupts */
- .long NMI_Handler
- .long HardFault_Handler
- .long MemoryManagement_Handler
- .long BusFault_Handler
- .long UsageFault_Handler
- .long SecureFault_Handler
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long SVC_Handler
- .long DebugMonitor_Handler
- .long 0 /* Reserved */
- .long PendSV_Handler
- .long SysTick_Handler
- /* DA1469x interrupts */
- .long SENSOR_NODE_IRQHandler
- .long DMA_IRQHandler
- .long CHARGER_STATE_IRQHandler
- .long CHARGER_ERROR_IRQHandler
- .long CMAC2SYS_IRQHandler
- .long UART_IRQHandler
- .long UART2_IRQHandler
- .long UART3_IRQHandler
- .long I2C_IRQHandler
- .long I2C2_IRQHandler
- .long SPI_IRQHandler
- .long SPI2_IRQHandler
- .long PCM_IRQHandler
- .long SRC_IN_IRQHandler
- .long SRC_OUT_IRQHandler
- .long USB_IRQHandler
- .long TIMER_IRQHandler
- .long TIMER2_IRQHandler
- .long RTC_IRQHandler
- .long KEY_WKUP_GPIO_IRQHandler
- .long PDC_IRQHandler
- .long VBUS_IRQHandler
- .long MRM_IRQHandler
- .long MOTOR_CONTROLLER_IRQHandler
- .long TRNG_IRQHandler
- .long DCDC_IRQHandler
- .long XTAL32M_RDY_IRQHandler
- .long ADC_IRQHandler
- .long ADC2_IRQHandler
- .long CRYPTO_IRQHandler
- .long CAPTIMER1_IRQHandler
- .long RFDIAG_IRQHandler
- .long LCD_CONTROLLER_IRQHandler
- .long PLL_LOCK_IRQHandler
- .long TIMER3_IRQHandler
- .long TIMER4_IRQHandler
- .long LRA_IRQHandler
- .long RTC_EVENT_IRQHandler
- .long GPIO_P0_IRQHandler
- .long GPIO_P1_IRQHandler
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .size __isr_vector, . - __isr_vector
-
- .text
- .thumb
- .thumb_func
- .align 2
- .globl Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- /* Make sure interrupt vector is remapped at 0x0 */
- ldr r1, =SYS_CTRL_REG
- ldrh r2, [r1, #0]
- orrs r2, r2, #8
- strh r2, [r1, #0]
-
-#if !MYNEWT_VAL(RAM_RESIDENT)
-/*
- * Flash is remapped at 0x0 with an offset, i.e. 0x0 does not correspond to
- * 0x16000000 but to start of an image on flash. This is calculated from product
- * header by 1st state bootloader and configured in CACHE_FLASH_REG. We need to
- * retrieve proper offset value for calculations later.
- */
- ldr r1, =CACHE_FLASH_REG
- ldr r4, [r1, #0]
- mov r2, r4
- mov r3, #0xFFFF
- bic r4, r4, r3 /* CACHE_FLASH_REG[FLASH_REGION_BASE] */
- mov r3, #0xFFF0
- and r2, r2, r3 /* CACHE_FLASH_REG[FLASH_REGION_OFFSET] */
- lsr r2, r2, #2
- orr r4, r4, r2
-
-/* Copy ISR vector from flash to RAM */
- ldr r1, =__isr_vector_start /* src ptr */
- ldr r2, =__isr_vector_end /* src end */
- ldr r3, =__intvect_start__ /* dst ptr */
-/* Make sure we copy from QSPIC address range, not from remapped range */
- cmp r1, r4
- itt lt
- addlt r1, r1, r4
- addlt r2, r2, r4
-.loop_isr_copy:
- cmp r1, r2
- ittt lt
- ldrlt r0, [r1], #4
- strlt r0, [r3], #4
- blt .loop_isr_copy
-
-/* Copy QSPI code from flash to RAM */
- ldr r1, =__text_ram_addr /* src ptr */
- ldr r2, =__text_ram_start__ /* ptr */
- ldr r3, =__text_ram_end__ /* dst end */
-.loop_code_text_ram_copy:
- cmp r2, r3
- ittt lt
- ldrlt r0, [r1], #4
- strlt r0, [r2], #4
- blt .loop_code_text_ram_copy
-
-/* Copy data from flash to RAM */
- ldr r1, =__etext /* src ptr */
- ldr r2, =__data_start__ /* dst ptr */
- ldr r3, =__data_end__ /* dst end */
-.loop_data_copy:
- cmp r2, r3
- ittt lt
- ldrlt r0, [r1], #4
- strlt r0, [r2], #4
- blt .loop_data_copy
-#endif
-
-/* Clear BSS */
- movs r0, 0
- ldr r1, =__bss_start__
- ldr r2, =__bss_end__
-.loop_bss_clear:
- cmp r1, r2
- itt lt
- strlt r0, [r1], #4
- blt .loop_bss_clear
-
- ldr r0, =__HeapBase
- ldr r1, =__HeapLimit
-/* Call static constructors */
- bl __libc_init_array
-
- bl SystemInit
- bl main
-
- .pool
- .size Reset_Handler, . - Reset_Handler
-
-/* Default interrupt handler */
- .type Default_Handler, %function
-Default_Handler:
- ldr r1, =SYS_CTRL_REG
- ldrh r2, [r1, #0]
- orrs r2, r2, #0x80 /* DEBUGGER_ENABLE */
- strh r2, [r1, #0]
- b .
-
- .size Default_Handler, . - Default_Handler
-
-/* Default handlers for all interrupts */
- .macro IRQ handler
- .weak \handler
- .set \handler, Default_Handler
- .endm
-
- /* Cortex-M33 interrupts */
- IRQ NMI_Handler
- IRQ HardFault_Handler
- IRQ MemoryManagement_Handler
- IRQ BusFault_Handler
- IRQ UsageFault_Handler
- IRQ SecureFault_Handler
- IRQ SVC_Handler
- IRQ DebugMonitor_Handler
- IRQ PendSV_Handler
- IRQ SysTick_Handler
- /* DA1469x interrupts */
- IRQ SENSOR_NODE_IRQHandler
- IRQ DMA_IRQHandler
- IRQ CHARGER_STATE_IRQHandler
- IRQ CHARGER_ERROR_IRQHandler
- IRQ CMAC2SYS_IRQHandler
- IRQ UART_IRQHandler
- IRQ UART2_IRQHandler
- IRQ UART3_IRQHandler
- IRQ I2C_IRQHandler
- IRQ I2C2_IRQHandler
- IRQ SPI_IRQHandler
- IRQ SPI2_IRQHandler
- IRQ PCM_IRQHandler
- IRQ SRC_IN_IRQHandler
- IRQ SRC_OUT_IRQHandler
- IRQ USB_IRQHandler
- IRQ TIMER_IRQHandler
- IRQ TIMER2_IRQHandler
- IRQ RTC_IRQHandler
- IRQ KEY_WKUP_GPIO_IRQHandler
- IRQ PDC_IRQHandler
- IRQ VBUS_IRQHandler
- IRQ MRM_IRQHandler
- IRQ MOTOR_CONTROLLER_IRQHandler
- IRQ TRNG_IRQHandler
- IRQ DCDC_IRQHandler
- IRQ XTAL32M_RDY_IRQHandler
- IRQ ADC_IRQHandler
- IRQ ADC2_IRQHandler
- IRQ CRYPTO_IRQHandler
- IRQ CAPTIMER1_IRQHandler
- IRQ RFDIAG_IRQHandler
- IRQ LCD_CONTROLLER_IRQHandler
- IRQ PLL_LOCK_IRQHandler
- IRQ TIMER3_IRQHandler
- IRQ TIMER4_IRQHandler
- IRQ LRA_IRQHandler
- IRQ RTC_EVENT_IRQHandler
- IRQ GPIO_P0_IRQHandler
- IRQ GPIO_P1_IRQHandler
- IRQ RESERVED40_IRQHandler
- IRQ RESERVED41_IRQHandler
- IRQ RESERVED42_IRQHandler
- IRQ RESERVED43_IRQHandler
- IRQ RESERVED44_IRQHandler
- IRQ RESERVED45_IRQHandler
- IRQ RESERVED46_IRQHandler
- IRQ RESERVED47_IRQHandler
-
-.end
diff --git a/tinyusb/hw/bsp/da14695_dk_usb/product_header.dump b/tinyusb/hw/bsp/da14695_dk_usb/product_header.dump
deleted file mode 100755
index ea484224..00000000
--- a/tinyusb/hw/bsp/da14695_dk_usb/product_header.dump
+++ /dev/null
Binary files differ
diff --git a/tinyusb/hw/bsp/da14695_dk_usb/syscfg/syscfg.h b/tinyusb/hw/bsp/da14695_dk_usb/syscfg/syscfg.h
deleted file mode 100755
index 6cbb4319..00000000
--- a/tinyusb/hw/bsp/da14695_dk_usb/syscfg/syscfg.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * This file was generated by Apache newt version: 1.9.0-dev
- */
-
-#ifndef H_MYNEWT_SYSCFG_
-#define H_MYNEWT_SYSCFG_
-
-/**
- * This macro exists to ensure code includes this header when needed. If code
- * checks the existence of a setting directly via ifdef without including this
- * header, the setting macro will silently evaluate to 0. In contrast, an
- * attempt to use these macros without including this header will result in a
- * compiler error.
- */
-#define MYNEWT_VAL(_name) MYNEWT_VAL_ ## _name
-#define MYNEWT_VAL_CHOICE(_name, _val) MYNEWT_VAL_ ## _name ## __ ## _val
-
-#ifndef MYNEWT_VAL_RAM_RESIDENT
-#define MYNEWT_VAL_RAM_RESIDENT (0)
-#endif
-
-#ifndef MYNEWT_VAL_MCU_GPIO_MAX_IRQ
-#define MYNEWT_VAL_MCU_GPIO_MAX_IRQ (4)
-#endif
-
-#ifndef MYNEWT_VAL_MCU_GPIO_RETAINABLE_NUM
-#define MYNEWT_VAL_MCU_GPIO_RETAINABLE_NUM (-1)
-#endif
-
-#ifndef MYNEWT_VAL_MCU_CLOCK_XTAL32M_SETTLE_TIME_US
-#define MYNEWT_VAL_MCU_CLOCK_XTAL32M_SETTLE_TIME_US (2000)
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/da1469x_dk_pro/board.mk b/tinyusb/hw/bsp/da1469x_dk_pro/board.mk
deleted file mode 100755
index 980fc422..00000000
--- a/tinyusb/hw/bsp/da1469x_dk_pro/board.mk
+++ /dev/null
@@ -1,55 +0,0 @@
-CFLAGS += \
- -flto \
- -mthumb \
- -mthumb-interwork \
- -mabi=aapcs \
- -mcpu=cortex-m33+nodsp \
- -mfloat-abi=hard \
- -mfpu=fpv5-sp-d16 \
- -nostdlib \
- -DCORE_M33 \
- -DCFG_TUSB_MCU=OPT_MCU_DA1469X \
- -DCFG_TUD_ENDPOINT0_SIZE=8\
-
-MCU_FAMILY_DIR = hw/mcu/dialog/da1469x
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/da1469x.ld
-
-# While this is for da1469x chip, there is chance that da1468x chip family will also work
-SRC_C += \
- src/portable/dialog/da146xx/dcd_da146xx.c \
- $(MCU_FAMILY_DIR)/src/system_da1469x.c \
- $(MCU_FAMILY_DIR)/src/da1469x_clock.c \
- $(MCU_FAMILY_DIR)/src/hal_gpio.c \
-
-SRC_S += hw/bsp/$(BOARD)/gcc_startup_da1469x.S
-
-INC += \
- $(TOP)/hw/bsp/$(BOARD) \
- $(TOP)/$(MCU_FAMILY_DIR)/include \
- $(TOP)/$(MCU_FAMILY_DIR)/SDK_10.0.8.105/sdk/bsp/include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM33_NTZ/non_secure
-
-# For flash-jlink target
-JLINK_DEVICE = DA14699
-
-# flash using jlink but with some twists
-flash: flash-dialog
-
-flash-dialog: $(BUILD)/$(PROJECT).bin
- @echo '#define SW_VERSION "v_1.0.0.1"' >$(BUILD)/version.h
- @echo '#define SW_VERSION_DATE "'`date +"%Y-%m-%d %H:%M"`'"' >>$(BUILD)/version.h
- mkimage da1469x $(BUILD)/$(PROJECT).bin $(BUILD)/version.h $^.img
- cp $(TOP)/hw/bsp/$(BOARD)/product_header.dump $(BUILD)/$(BOARD)-image.bin
- cat $^.img >> $(BUILD)/$(BOARD)-image.bin
- @echo r > $(BUILD)/$(BOARD).jlink
- @echo halt >> $(BUILD)/$(BOARD).jlink
- @echo loadfile $(BUILD)/$(BOARD)-image.bin 0x16000000 >> $(BUILD)/$(BOARD).jlink
- @echo r >> $(BUILD)/$(BOARD).jlink
- @echo go >> $(BUILD)/$(BOARD).jlink
- @echo exit >> $(BUILD)/$(BOARD).jlink
- $(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $(BUILD)/$(BOARD).jlink
-
diff --git a/tinyusb/hw/bsp/da1469x_dk_pro/da1469x-dk-pro.c b/tinyusb/hw/bsp/da1469x_dk_pro/da1469x-dk-pro.c
deleted file mode 100755
index 85fa1715..00000000
--- a/tinyusb/hw/bsp/da1469x_dk_pro/da1469x-dk-pro.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Jerzy Kasenberg
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "bsp/board.h"
-#include <hal/hal_gpio.h>
-#include <mcu/mcu.h>
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-#define LED_PIN 33
-#define LED_STATE_ON 1
-#define LED_STATE_OFF 0
-
-#define BUTTON_PIN 6
-
-void UnhandledIRQ(void)
-{
- CRG_TOP->SYS_CTRL_REG = 0x80;
- __BKPT(1);
- while(1);
-}
-
-void board_init(void)
-{
- // LED
- hal_gpio_init_out(LED_PIN, LED_STATE_ON);
-
- hal_gpio_init_out(1, 0);
- hal_gpio_init_out(2, 0);
- hal_gpio_init_out(3, 0);
- hal_gpio_init_out(4, 0);
- hal_gpio_init_out(5, 0);
-
- // Button
- hal_gpio_init_in(BUTTON_PIN, HAL_GPIO_PULL_NONE);
-
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-
- NVIC_SetPriority(USB_IRQn, 2);
-
- /* Setup USB IRQ */
- NVIC_SetPriority(USB_IRQn, 2);
- NVIC_EnableIRQ(USB_IRQn);
-
- /* Use PLL96 / 2 clock not HCLK */
- CRG_TOP->CLK_CTRL_REG &= ~CRG_TOP_CLK_CTRL_REG_USB_CLK_SRC_Msk;
-
- mcu_gpio_set_pin_function(14, MCU_GPIO_MODE_INPUT, MCU_GPIO_FUNC_USB);
- mcu_gpio_set_pin_function(15, MCU_GPIO_MODE_INPUT, MCU_GPIO_FUNC_USB);
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- hal_gpio_write(LED_PIN, state ? LED_STATE_ON : LED_STATE_OFF);
-}
-
-uint32_t board_button_read(void)
-{
- // button is active LOW
- return hal_gpio_read(BUTTON_PIN) ^ 1;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void)buf;
- (void)len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void)buf;
- (void)len;
-
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler(void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/da1469x_dk_pro/da1469x.ld b/tinyusb/hw/bsp/da1469x_dk_pro/da1469x.ld
deleted file mode 100755
index 96507d6e..00000000
--- a/tinyusb/hw/bsp/da1469x_dk_pro/da1469x.ld
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-MEMORY
-{
- /*
- * Flash is remapped at 0x0 by 1st stage bootloader, but this is done with
- * an offset derived from image header thus it is safer to use remapped
- * address space at 0x0 instead of QSPI_M address space at 0x16000000.
- * Bootloader partition is 32K, but 9K is currently reserved for product
- * header (8K) and image header (1K).
- * First 512 bytes of SYSRAM are remapped at 0x0 and used as ISR vector
- * (there's no need to reallocate ISR vector) and thus cannot be used by
- * application.
- */
-
- FLASH (r) : ORIGIN = (0x00000000), LENGTH = (1024 * 1024)
- RAM (rw) : ORIGIN = (0x20000000), LENGTH = (512 * 1024)
-}
-
-OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- * Reset_Handler : Entry of reset handler
- *
- * It defines following symbols, which code can use without definition:
- * __exidx_start
- * __exidx_end
- * __etext
- * __data_start__
- * __preinit_array_start
- * __preinit_array_end
- * __init_array_start
- * __init_array_end
- * __fini_array_start
- * __fini_array_end
- * __data_end__
- * __bss_start__
- * __bss_end__
- * __HeapBase
- * __HeapLimit
- * __StackLimit
- * __StackTop
- * __stack
- * __bssnz_start__
- * __bssnz_end__
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
- __text = .;
-
- .text :
- {
- __isr_vector_start = .;
- KEEP(*(.isr_vector))
- /* ISR vector shall have exactly 512 bytes */
- . = __isr_vector_start + 0x200;
- __isr_vector_end = .;
-
- *(.text)
- *(.text.*)
-
- *(.libcmac.rom)
-
- 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*)
-
- *(.eh_frame*)
- . = ALIGN(4);
- } > FLASH
-
- .ARM.extab :
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- . = ALIGN(4);
- } > FLASH
-
- __exidx_start = .;
- .ARM :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- . = ALIGN(4);
- } > FLASH
- __exidx_end = .;
-
- .intvect :
- {
- . = ALIGN(4);
- __intvect_start__ = .;
- . = . + (__isr_vector_end - __isr_vector_start);
- . = ALIGN(4);
- } > RAM
-
- .sleep_state (NOLOAD) :
- {
- . = ALIGN(4);
- *(sleep_state)
- } > RAM
-
- /* This section will be zeroed by RTT package init */
- .rtt (NOLOAD):
- {
- . = ALIGN(4);
- *(.rtt)
- . = ALIGN(4);
- } > RAM
-
- __text_ram_addr = LOADADDR(.text_ram);
-
- .text_ram :
- {
- . = ALIGN(4);
- __text_ram_start__ = .;
- *(.text_ram*)
- . = ALIGN(4);
- __text_ram_end__ = .;
- } > RAM AT > FLASH
-
- __etext = LOADADDR(.data);
-
- .data :
- {
- __data_start__ = .;
- *(vtable)
- *(.data*)
-
- . = ALIGN(4);
- /* preinit data */
- PROVIDE_HIDDEN (__preinit_array_start = .);
- *(.preinit_array)
- PROVIDE_HIDDEN (__preinit_array_end = .);
-
- . = ALIGN(4);
- /* init data */
- PROVIDE_HIDDEN (__init_array_start = .);
- *(SORT(.init_array.*))
- *(.init_array)
- PROVIDE_HIDDEN (__init_array_end = .);
-
-
- . = ALIGN(4);
- /* finit data */
- PROVIDE_HIDDEN (__fini_array_start = .);
- *(SORT(.fini_array.*))
- *(.fini_array)
- PROVIDE_HIDDEN (__fini_array_end = .);
-
- *(.jcr)
- . = ALIGN(4);
- /* All data end */
- __data_end__ = .;
- } > RAM AT > FLASH
-
- .bssnz :
- {
- . = ALIGN(4);
- __bssnz_start__ = .;
- *(.bss.core.nz*)
- . = ALIGN(4);
- __bssnz_end__ = .;
- } > RAM
-
- .bss :
- {
- . = ALIGN(4);
- __bss_start__ = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4);
- __bss_end__ = .;
- } > RAM
-
- .cmac (NOLOAD) :
- {
- . = ALIGN(0x400);
- *(.libcmac.ram)
- } > RAM
-
- /* Heap starts after BSS */
- . = ALIGN(8);
- __HeapBase = .;
-
- /* .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):
- {
- *(.stack*)
- } > RAM
-
- _ram_start = ORIGIN(RAM);
-
- /* 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);
-
- /* Top of head is the bottom of the stack */
- __HeapLimit = __StackLimit;
- end = __HeapLimit;
-
- /* Check if data + heap + stack exceeds RAM limit */
- ASSERT(__HeapBase <= __HeapLimit, "region RAM overflowed with stack")
-
- /* Check that intvect is at the beginning of RAM */
- ASSERT(__intvect_start__ == ORIGIN(RAM), "intvect is not at beginning of RAM")
-}
-
diff --git a/tinyusb/hw/bsp/da1469x_dk_pro/gcc_startup_da1469x.S b/tinyusb/hw/bsp/da1469x_dk_pro/gcc_startup_da1469x.S
deleted file mode 100755
index d47fbcd9..00000000
--- a/tinyusb/hw/bsp/da1469x_dk_pro/gcc_startup_da1469x.S
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
- #include "syscfg/syscfg.h"
-
- .syntax unified
- .arch armv7-m
-
- .section .stack
- .align 3
-#ifdef __STACK_SIZE
- .equ Stack_Size, __STACK_SIZE
-#else
- .equ Stack_Size, 0xC00
-#endif
- .equ SYS_CTRL_REG, 0x50000024
- .equ CACHE_FLASH_REG, 0x100C0040
- .equ RESET_STAT_REG, 0x500000BC
-
- .globl __StackTop
- .globl __StackLimit
-__StackLimit:
- .space Stack_Size
- .size __StackLimit, . - __StackLimit
-__StackTop:
- .size __StackTop, . - __StackTop
-
- .section .heap
- .align 3
-#ifdef __HEAP_SIZE
- .equ Heap_Size, __HEAP_SIZE
-#else
- .equ Heap_Size, 0
-#endif
- .globl __HeapBase
- .globl __HeapLimit
-__HeapBase:
- .if Heap_Size
- .space Heap_Size
- .endif
- .size __HeapBase, . - __HeapBase
-__HeapLimit:
- .size __HeapLimit, . - __HeapLimit
-
- .section .isr_vector
- .align 2
- .globl __isr_vector
-__isr_vector:
- .long __StackTop
- .long Reset_Handler
- /* Cortex-M33 interrupts */
- .long NMI_Handler
- .long HardFault_Handler
- .long MemoryManagement_Handler
- .long BusFault_Handler
- .long UsageFault_Handler
- .long SecureFault_Handler
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long SVC_Handler
- .long DebugMonitor_Handler
- .long 0 /* Reserved */
- .long PendSV_Handler
- .long SysTick_Handler
- /* DA1469x interrupts */
- .long SENSOR_NODE_IRQHandler
- .long DMA_IRQHandler
- .long CHARGER_STATE_IRQHandler
- .long CHARGER_ERROR_IRQHandler
- .long CMAC2SYS_IRQHandler
- .long UART_IRQHandler
- .long UART2_IRQHandler
- .long UART3_IRQHandler
- .long I2C_IRQHandler
- .long I2C2_IRQHandler
- .long SPI_IRQHandler
- .long SPI2_IRQHandler
- .long PCM_IRQHandler
- .long SRC_IN_IRQHandler
- .long SRC_OUT_IRQHandler
- .long USB_IRQHandler
- .long TIMER_IRQHandler
- .long TIMER2_IRQHandler
- .long RTC_IRQHandler
- .long KEY_WKUP_GPIO_IRQHandler
- .long PDC_IRQHandler
- .long VBUS_IRQHandler
- .long MRM_IRQHandler
- .long MOTOR_CONTROLLER_IRQHandler
- .long TRNG_IRQHandler
- .long DCDC_IRQHandler
- .long XTAL32M_RDY_IRQHandler
- .long ADC_IRQHandler
- .long ADC2_IRQHandler
- .long CRYPTO_IRQHandler
- .long CAPTIMER1_IRQHandler
- .long RFDIAG_IRQHandler
- .long LCD_CONTROLLER_IRQHandler
- .long PLL_LOCK_IRQHandler
- .long TIMER3_IRQHandler
- .long TIMER4_IRQHandler
- .long LRA_IRQHandler
- .long RTC_EVENT_IRQHandler
- .long GPIO_P0_IRQHandler
- .long GPIO_P1_IRQHandler
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .long 0 /* Reserved */
- .size __isr_vector, . - __isr_vector
-
- .text
- .thumb
- .thumb_func
- .align 2
- .globl Reset_Handler
- .type Reset_Handler, %function
-Reset_Handler:
- /* Make sure interrupt vector is remapped at 0x0 */
- ldr r1, =SYS_CTRL_REG
- ldrh r2, [r1, #0]
- orrs r2, r2, #8
- strh r2, [r1, #0]
-
-#if !MYNEWT_VAL(RAM_RESIDENT)
-/*
- * Flash is remapped at 0x0 with an offset, i.e. 0x0 does not correspond to
- * 0x16000000 but to start of an image on flash. This is calculated from product
- * header by 1st state bootloader and configured in CACHE_FLASH_REG. We need to
- * retrieve proper offset value for calculations later.
- */
- ldr r1, =CACHE_FLASH_REG
- ldr r4, [r1, #0]
- mov r2, r4
- mov r3, #0xFFFF
- bic r4, r4, r3 /* CACHE_FLASH_REG[FLASH_REGION_BASE] */
- mov r3, #0xFFF0
- and r2, r2, r3 /* CACHE_FLASH_REG[FLASH_REGION_OFFSET] */
- lsr r2, r2, #2
- orr r4, r4, r2
-
-/* Copy ISR vector from flash to RAM */
- ldr r1, =__isr_vector_start /* src ptr */
- ldr r2, =__isr_vector_end /* src end */
- ldr r3, =__intvect_start__ /* dst ptr */
-/* Make sure we copy from QSPIC address range, not from remapped range */
- cmp r1, r4
- itt lt
- addlt r1, r1, r4
- addlt r2, r2, r4
-.loop_isr_copy:
- cmp r1, r2
- ittt lt
- ldrlt r0, [r1], #4
- strlt r0, [r3], #4
- blt .loop_isr_copy
-
-/* Copy QSPI code from flash to RAM */
- ldr r1, =__text_ram_addr /* src ptr */
- ldr r2, =__text_ram_start__ /* ptr */
- ldr r3, =__text_ram_end__ /* dst end */
-.loop_code_text_ram_copy:
- cmp r2, r3
- ittt lt
- ldrlt r0, [r1], #4
- strlt r0, [r2], #4
- blt .loop_code_text_ram_copy
-
-/* Copy data from flash to RAM */
- ldr r1, =__etext /* src ptr */
- ldr r2, =__data_start__ /* dst ptr */
- ldr r3, =__data_end__ /* dst end */
-.loop_data_copy:
- cmp r2, r3
- ittt lt
- ldrlt r0, [r1], #4
- strlt r0, [r2], #4
- blt .loop_data_copy
-#endif
-
-/* Clear BSS */
- movs r0, 0
- ldr r1, =__bss_start__
- ldr r2, =__bss_end__
-.loop_bss_clear:
- cmp r1, r2
- itt lt
- strlt r0, [r1], #4
- blt .loop_bss_clear
-
- ldr r0, =__HeapBase
- ldr r1, =__HeapLimit
-/* Call static constructors */
- bl __libc_init_array
-
- bl SystemInit
- bl main
-
- .pool
- .size Reset_Handler, . - Reset_Handler
-
-/* Default interrupt handler */
- .type Default_Handler, %function
-Default_Handler:
- ldr r1, =SYS_CTRL_REG
- ldrh r2, [r1, #0]
- orrs r2, r2, #0x80 /* DEBUGGER_ENABLE */
- strh r2, [r1, #0]
- b .
-
- .size Default_Handler, . - Default_Handler
-
-/* Default handlers for all interrupts */
- .macro IRQ handler
- .weak \handler
- .set \handler, Default_Handler
- .endm
-
- /* Cortex-M33 interrupts */
- IRQ NMI_Handler
- IRQ HardFault_Handler
- IRQ MemoryManagement_Handler
- IRQ BusFault_Handler
- IRQ UsageFault_Handler
- IRQ SecureFault_Handler
- IRQ SVC_Handler
- IRQ DebugMonitor_Handler
- IRQ PendSV_Handler
- IRQ SysTick_Handler
- /* DA1469x interrupts */
- IRQ SENSOR_NODE_IRQHandler
- IRQ DMA_IRQHandler
- IRQ CHARGER_STATE_IRQHandler
- IRQ CHARGER_ERROR_IRQHandler
- IRQ CMAC2SYS_IRQHandler
- IRQ UART_IRQHandler
- IRQ UART2_IRQHandler
- IRQ UART3_IRQHandler
- IRQ I2C_IRQHandler
- IRQ I2C2_IRQHandler
- IRQ SPI_IRQHandler
- IRQ SPI2_IRQHandler
- IRQ PCM_IRQHandler
- IRQ SRC_IN_IRQHandler
- IRQ SRC_OUT_IRQHandler
- IRQ USB_IRQHandler
- IRQ TIMER_IRQHandler
- IRQ TIMER2_IRQHandler
- IRQ RTC_IRQHandler
- IRQ KEY_WKUP_GPIO_IRQHandler
- IRQ PDC_IRQHandler
- IRQ VBUS_IRQHandler
- IRQ MRM_IRQHandler
- IRQ MOTOR_CONTROLLER_IRQHandler
- IRQ TRNG_IRQHandler
- IRQ DCDC_IRQHandler
- IRQ XTAL32M_RDY_IRQHandler
- IRQ ADC_IRQHandler
- IRQ ADC2_IRQHandler
- IRQ CRYPTO_IRQHandler
- IRQ CAPTIMER1_IRQHandler
- IRQ RFDIAG_IRQHandler
- IRQ LCD_CONTROLLER_IRQHandler
- IRQ PLL_LOCK_IRQHandler
- IRQ TIMER3_IRQHandler
- IRQ TIMER4_IRQHandler
- IRQ LRA_IRQHandler
- IRQ RTC_EVENT_IRQHandler
- IRQ GPIO_P0_IRQHandler
- IRQ GPIO_P1_IRQHandler
- IRQ RESERVED40_IRQHandler
- IRQ RESERVED41_IRQHandler
- IRQ RESERVED42_IRQHandler
- IRQ RESERVED43_IRQHandler
- IRQ RESERVED44_IRQHandler
- IRQ RESERVED45_IRQHandler
- IRQ RESERVED46_IRQHandler
- IRQ RESERVED47_IRQHandler
-
-.end
diff --git a/tinyusb/hw/bsp/da1469x_dk_pro/product_header.dump b/tinyusb/hw/bsp/da1469x_dk_pro/product_header.dump
deleted file mode 100755
index ea484224..00000000
--- a/tinyusb/hw/bsp/da1469x_dk_pro/product_header.dump
+++ /dev/null
Binary files differ
diff --git a/tinyusb/hw/bsp/da1469x_dk_pro/syscfg/syscfg.h b/tinyusb/hw/bsp/da1469x_dk_pro/syscfg/syscfg.h
deleted file mode 100755
index 6cbb4319..00000000
--- a/tinyusb/hw/bsp/da1469x_dk_pro/syscfg/syscfg.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * This file was generated by Apache newt version: 1.9.0-dev
- */
-
-#ifndef H_MYNEWT_SYSCFG_
-#define H_MYNEWT_SYSCFG_
-
-/**
- * This macro exists to ensure code includes this header when needed. If code
- * checks the existence of a setting directly via ifdef without including this
- * header, the setting macro will silently evaluate to 0. In contrast, an
- * attempt to use these macros without including this header will result in a
- * compiler error.
- */
-#define MYNEWT_VAL(_name) MYNEWT_VAL_ ## _name
-#define MYNEWT_VAL_CHOICE(_name, _val) MYNEWT_VAL_ ## _name ## __ ## _val
-
-#ifndef MYNEWT_VAL_RAM_RESIDENT
-#define MYNEWT_VAL_RAM_RESIDENT (0)
-#endif
-
-#ifndef MYNEWT_VAL_MCU_GPIO_MAX_IRQ
-#define MYNEWT_VAL_MCU_GPIO_MAX_IRQ (4)
-#endif
-
-#ifndef MYNEWT_VAL_MCU_GPIO_RETAINABLE_NUM
-#define MYNEWT_VAL_MCU_GPIO_RETAINABLE_NUM (-1)
-#endif
-
-#ifndef MYNEWT_VAL_MCU_CLOCK_XTAL32M_SETTLE_TIME_US
-#define MYNEWT_VAL_MCU_CLOCK_XTAL32M_SETTLE_TIME_US (2000)
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/ea4088qs/board.mk b/tinyusb/hw/bsp/ea4088qs/board.mk
deleted file mode 100755
index c624a5cf..00000000
--- a/tinyusb/hw/bsp/ea4088qs/board.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nxp/lpcopen
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib \
- -DCORE_M4 \
- -D__USE_LPCOPEN \
- -DCFG_TUSB_MEM_SECTION='__attribute__((section(".data.$$RAM2")))' \
- -DCFG_TUSB_MCU=OPT_MCU_LPC40XX
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter
-
-MCU_DIR = hw/mcu/nxp/lpcopen/lpc40xx/lpc_chip_40xx
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/lpc4088.ld
-
-SRC_C += \
- src/portable/nxp/lpc17_40/dcd_lpc17_40.c \
- $(MCU_DIR)/../gcc/cr_startup_lpc40xx.c \
- $(MCU_DIR)/src/chip_17xx_40xx.c \
- $(MCU_DIR)/src/clock_17xx_40xx.c \
- $(MCU_DIR)/src/gpio_17xx_40xx.c \
- $(MCU_DIR)/src/iocon_17xx_40xx.c \
- $(MCU_DIR)/src/sysctl_17xx_40xx.c \
- $(MCU_DIR)/src/sysinit_17xx_40xx.c \
- $(MCU_DIR)/src/uart_17xx_40xx.c \
- $(MCU_DIR)/src/fpu_init.c
-
-INC += \
- $(TOP)/$(MCU_DIR)/inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# For flash-jlink target
-JLINK_DEVICE = LPC4088
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/ea4088qs/ea4088qs.c b/tinyusb/hw/bsp/ea4088qs/ea4088qs.c
deleted file mode 100755
index b25f9101..00000000
--- a/tinyusb/hw/bsp/ea4088qs/ea4088qs.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "chip.h"
-#include "../board.h"
-
-//--------------------------------------------------------------------+
-// USB Interrupt Handler
-//--------------------------------------------------------------------+
-void USB_IRQHandler(void)
-{
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
- tuh_int_handler(0);
- #endif
-
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
- tud_int_handler(0);
- #endif
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-#define LED_PORT 2
-#define LED_PIN 19
-
-#define BUTTON_PORT 2
-#define BUTTON_PIN 10
-
-/* System oscillator rate and RTC oscillator rate */
-const uint32_t OscRateIn = 12000000;
-const uint32_t RTCOscRateIn = 32768;
-
-/* Pin muxing configuration */
-static const PINMUX_GRP_T pinmuxing[] =
-{
- // LED
- {2, 19, (IOCON_FUNC0 | IOCON_MODE_INACT)},
-
- // Button
- {2, 10, (IOCON_FUNC0 | IOCON_MODE_INACT | IOCON_MODE_PULLUP)},
-};
-
-static const PINMUX_GRP_T pin_usb_mux[] =
-{
- // USB1 as Host
- {0, 29, (IOCON_FUNC1 | IOCON_MODE_INACT)}, // D+1
- {0, 30, (IOCON_FUNC1 | IOCON_MODE_INACT)}, // D-1
- {1, 18, (IOCON_FUNC1 | IOCON_MODE_INACT)}, // UP LED1
- {1, 19, (IOCON_FUNC2 | IOCON_MODE_INACT)}, // PPWR1
-// {2, 14, (IOCON_FUNC2 | IOCON_MODE_INACT)}, // VBUS1
-// {2, 15, (IOCON_FUNC2 | IOCON_MODE_INACT)}, // OVRCR1
-
- // USB2 as Device
- {0, 31, (IOCON_FUNC1 | IOCON_MODE_INACT)}, // D+2
- {0, 13, (IOCON_FUNC1 | IOCON_MODE_INACT)}, // UP LED
- {0, 14, (IOCON_FUNC3 | IOCON_MODE_INACT)}, // CONNECT2
-
- /* VBUS is not connected on this board, so leave the pin at default setting. */
- /*Chip_IOCON_PinMux(LPC_IOCON, 1, 30, IOCON_MODE_INACT, IOCON_FUNC2);*/ /* USB VBUS */
-};
-
-// Invoked by startup code
-void SystemInit(void)
-{
-#ifdef __USE_LPCOPEN
- extern void (* const g_pfnVectors[])(void);
- unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
- *pSCB_VTOR = (unsigned int) g_pfnVectors;
-
-#if __FPU_USED == 1
- fpuInit();
-#endif
-#endif // __USE_LPCOPEN
-
- Chip_IOCON_Init(LPC_IOCON);
- Chip_IOCON_SetPinMuxing(LPC_IOCON, pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
-
- /* CPU clock source starts with IRC */
- /* Enable PBOOST for CPU clock over 100MHz */
- Chip_SYSCTL_EnableBoost();
-
- Chip_SetupXtalClocking();
-}
-
-void board_init(void)
-{
- SystemCoreClockUpdate();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- Chip_GPIO_Init(LPC_GPIO);
-
- // LED
- Chip_GPIO_SetPinDIROutput(LPC_GPIO, LED_PORT, LED_PIN);
-
- // Button
- Chip_GPIO_SetPinDIRInput(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
-
- // UART
-
- //------------- USB -------------//
- Chip_IOCON_SetPinMuxing(LPC_IOCON, pin_usb_mux, sizeof(pin_usb_mux) / sizeof(PINMUX_GRP_T));
-
- // Port1 as Host, Port2: Device
- Chip_USB_Init();
-
- enum {
- USBCLK_DEVCIE = 0x12, // AHB + Device
- USBCLK_HOST = 0x19 , // AHB + OTG + Host
- USBCLK_ALL = 0x1B // Host + Device + OTG + AHB
- };
-
- LPC_USB->OTGClkCtrl = USBCLK_ALL;
- while ( (LPC_USB->OTGClkSt & USBCLK_ALL) != USBCLK_ALL ) {}
-
- // set portfunc: USB1 = host, USB2 = device
- LPC_USB->StCtrl = 0x3;
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- Chip_GPIO_SetPinState(LPC_GPIO, LED_PORT, LED_PIN, state);
-}
-
-uint32_t board_button_read(void)
-{
- // active low
- return Chip_GPIO_GetPinState(LPC_GPIO, BUTTON_PORT, BUTTON_PIN) ? 0 : 1;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- //return UART_ReceiveByte(BOARD_UART_PORT);
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- //UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/ea4088qs/lpc4088.ld b/tinyusb/hw/bsp/ea4088qs/lpc4088.ld
deleted file mode 100755
index 4b1cddd6..00000000
--- a/tinyusb/hw/bsp/ea4088qs/lpc4088.ld
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * GENERATED FILE - DO NOT EDIT
- * (c) Code Red Technologies Ltd, 2008-2013
- * (c) NXP Semiconductors 2013-2019
- * Generated linker script file for LPC4088
- * Created from linkscript.ldt by FMCreateLinkLibraries
- * Using Freemarker v2.3.23
- * MCUXpresso IDE v10.2.1 [Build 795] [2018-07-25] on May 15, 2019 5:16:07 PM
- */
-
-MEMORY
-{
- /* Define each memory region */
- MFlash512 (rx) : ORIGIN = 0x0, LENGTH = 0x80000 /* 512K bytes (alias Flash) */
- RamLoc64 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x10000 /* 64K bytes (alias RAM) */
- RamPeriph32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes (alias RAM2) */
-}
-
- /* Define a symbol for the top of each memory region */
- __base_MFlash512 = 0x0 ; /* MFlash512 */
- __base_Flash = 0x0 ; /* Flash */
- __top_MFlash512 = 0x0 + 0x80000 ; /* 512K bytes */
- __top_Flash = 0x0 + 0x80000 ; /* 512K bytes */
- __base_RamLoc64 = 0x10000000 ; /* RamLoc64 */
- __base_RAM = 0x10000000 ; /* RAM */
- __top_RamLoc64 = 0x10000000 + 0x10000 ; /* 64K bytes */
- __top_RAM = 0x10000000 + 0x10000 ; /* 64K bytes */
- __base_RamPeriph32 = 0x20000000 ; /* RamPeriph32 */
- __base_RAM2 = 0x20000000 ; /* RAM2 */
- __top_RamPeriph32 = 0x20000000 + 0x8000 ; /* 32K bytes */
- __top_RAM2 = 0x20000000 + 0x8000 ; /* 32K bytes */
-
-ENTRY(ResetISR)
-
-SECTIONS
-{
- /* MAIN TEXT SECTION */
- .text : ALIGN(4)
- {
- FILL(0xff)
- __vectors_start__ = ABSOLUTE(.) ;
- KEEP(*(.isr_vector))
- /* Global Section Table */
- . = ALIGN(4) ;
- __section_table_start = .;
- __data_section_table = .;
- LONG(LOADADDR(.data));
- LONG( ADDR(.data));
- LONG( SIZEOF(.data));
- LONG(LOADADDR(.data_RAM2));
- LONG( ADDR(.data_RAM2));
- LONG( SIZEOF(.data_RAM2));
- __data_section_table_end = .;
- __bss_section_table = .;
- LONG( ADDR(.bss));
- LONG( SIZEOF(.bss));
- LONG( ADDR(.bss_RAM2));
- LONG( SIZEOF(.bss_RAM2));
- __bss_section_table_end = .;
- __section_table_end = . ;
- /* End of Global Section Table */
-
- *(.after_vectors*)
-
- } > MFlash512
-
- .text : ALIGN(4)
- {
- *(.text*)
- *(.rodata .rodata.* .constdata .constdata.*)
- . = ALIGN(4);
- } > MFlash512
- /*
- * for exception handling/unwind - some Newlib functions (in common
- * with C++ and STDC++) use this.
- */
- .ARM.extab : ALIGN(4)
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > MFlash512
-
- __exidx_start = .;
-
- .ARM.exidx : ALIGN(4)
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > MFlash512
- __exidx_end = .;
-
- _etext = .;
-
- /* DATA section for RamPeriph32 */
-
- .data_RAM2 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM2 = .) ;
- *(.ramfunc.$RAM2)
- *(.ramfunc.$RamPeriph32)
- *(.data.$RAM2*)
- *(.data.$RamPeriph32*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM2 = .) ;
- } > RamPeriph32 AT>MFlash512
- /* MAIN DATA SECTION */
- .uninit_RESERVED : ALIGN(4)
- {
- KEEP(*(.bss.$RESERVED*))
- . = ALIGN(4) ;
- _end_uninit_RESERVED = .;
- } > RamLoc64
-
- /* Main DATA section (RamLoc64) */
- .data : ALIGN(4)
- {
- FILL(0xff)
- _data = . ;
- *(vtable)
- *(.ramfunc*)
- *(.data*)
- . = ALIGN(4) ;
- _edata = . ;
- } > RamLoc64 AT>MFlash512
-
- /* BSS section for RamPeriph32 */
- .bss_RAM2 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM2 = .) ;
- *(.bss.$RAM2*)
- *(.bss.$RamPeriph32*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM2 = .) ;
- } > RamPeriph32
-
- /* MAIN BSS SECTION */
- .bss : ALIGN(4)
- {
- _bss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4) ;
- _ebss = .;
- PROVIDE(end = .);
- } > RamLoc64
-
- /* NOINIT section for RamPeriph32 */
- .noinit_RAM2 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM2*)
- *(.noinit.$RamPeriph32*)
- . = ALIGN(4) ;
- } > RamPeriph32
-
- /* DEFAULT NOINIT SECTION */
- .noinit (NOLOAD): ALIGN(4)
- {
- _noinit = .;
- *(.noinit*)
- . = ALIGN(4) ;
- _end_noinit = .;
- } > RamLoc64
- PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
- PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc64 - 0);
-
- /* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (NMI_Handler + 1)
- + (HardFault_Handler + 1)
- + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
- + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
- + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
- ) );
-
- /* Provide basic symbols giving location and size of main text
- * block, including initial values of RW data sections. Note that
- * these will need extending to give a complete picture with
- * complex images (e.g multiple Flash banks).
- */
- _image_start = LOADADDR(.text);
- _image_end = LOADADDR(.data) + SIZEOF(.data);
- _image_size = _image_end - _image_start;
-} \ No newline at end of file
diff --git a/tinyusb/hw/bsp/ea4357/board.mk b/tinyusb/hw/bsp/ea4357/board.mk
deleted file mode 100755
index 86391ab5..00000000
--- a/tinyusb/hw/bsp/ea4357/board.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nxp/lpcopen
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib \
- -DCORE_M4 \
- -D__USE_LPCOPEN \
- -DCFG_TUSB_MCU=OPT_MCU_LPC43XX
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes
-
-MCU_DIR = hw/mcu/nxp/lpcopen/lpc43xx/lpc_chip_43xx
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/lpc4357.ld
-
-SRC_C += \
- src/portable/nxp/transdimension/dcd_transdimension.c \
- $(MCU_DIR)/../gcc/cr_startup_lpc43xx.c \
- $(MCU_DIR)/src/chip_18xx_43xx.c \
- $(MCU_DIR)/src/clock_18xx_43xx.c \
- $(MCU_DIR)/src/gpio_18xx_43xx.c \
- $(MCU_DIR)/src/sysinit_18xx_43xx.c \
- $(MCU_DIR)/src/i2c_18xx_43xx.c \
- $(MCU_DIR)/src/i2cm_18xx_43xx.c \
- $(MCU_DIR)/src/uart_18xx_43xx.c \
- $(MCU_DIR)/src/fpu_init.c
-
-INC += \
- $(TOP)/$(MCU_DIR)/inc \
- $(TOP)/$(MCU_DIR)/inc/config_43xx
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# For flash-jlink target
-JLINK_DEVICE = LPC4357_M4
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/ea4357/ea4357.c b/tinyusb/hw/bsp/ea4357/ea4357.c
deleted file mode 100755
index aa206a28..00000000
--- a/tinyusb/hw/bsp/ea4357/ea4357.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "chip.h"
-#include "../board.h"
-#include "pca9532.h"
-
-#define UART_DEV LPC_USART0
-#define UART_PORT 0x0f
-#define UART_PIN_TX 10
-#define UART_PIN_RX 11
-
-// P9_1 joystick down
-#define BUTTON_PORT 4
-#define BUTTON_PIN 13
-
-//static const struct {
-// uint8_t mux_port;
-// uint8_t mux_pin;
-//
-// uint8_t gpio_port;
-// uint8_t gpio_pin;
-//}buttons[] =
-//{
-// {0x0a, 3, 4, 10 }, // Joystick up
-// {0x09, 1, 4, 13 }, // Joystick down
-// {0x0a, 2, 4, 9 }, // Joystick left
-// {0x09, 0, 4, 12 }, // Joystick right
-// {0x0a, 1, 4, 8 }, // Joystick press
-// {0x02, 7, 0, 7 }, // SW6
-//};
-
-/*------------------------------------------------------------------*/
-/* BOARD API
- *------------------------------------------------------------------*/
-
-/* System configuration variables used by chip driver */
-const uint32_t OscRateIn = 12000000;
-const uint32_t ExtRateIn = 0;
-
-static const PINMUX_GRP_T pinmuxing[] =
-{
- // Button ( Joystick down )
- {0x9, 1, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLUP)},
-
- // UART
- {UART_PORT, UART_PIN_TX, SCU_MODE_PULLDOWN | SCU_MODE_FUNC1},
- {UART_PORT, UART_PIN_RX, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC1},
-
- // USB
-};
-
-/* Pin clock mux values, re-used structure, value in first index is meaningless */
-static const PINMUX_GRP_T pinclockmuxing[] =
-{
- {0, 0, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
- {0, 1, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
- {0, 2, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
- {0, 3, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
-};
-
-// Invoked by startup code
-void SystemInit(void)
-{
-#ifdef __USE_LPCOPEN
- extern void (* const g_pfnVectors[])(void);
- unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
- *pSCB_VTOR = (unsigned int) g_pfnVectors;
-
-#if __FPU_USED == 1
- fpuInit();
-#endif
-#endif // __USE_LPCOPEN
-
- /* Setup system level pin muxing */
- Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
-
- /* Clock pins only, group field not used */
- for (int i = 0; i <(int) (sizeof(pinclockmuxing) / sizeof(pinclockmuxing[0])); i++)
- {
- Chip_SCU_ClockPinMuxSet(pinclockmuxing[i].pinnum, pinclockmuxing[i].modefunc);
- }
-
- Chip_SetupXtalClocking();
-}
-
-void board_init(void)
-{
- SystemCoreClockUpdate();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- //NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- Chip_GPIO_Init(LPC_GPIO_PORT);
-
- // LED via pca9532 I2C
- Chip_SCU_I2C0PinConfig(I2C0_STANDARD_FAST_MODE);
- Chip_I2C_Init(I2C0);
- Chip_I2C_SetClockRate(I2C0, 100000);
- Chip_I2C_SetMasterEventHandler(I2C0, Chip_I2C_EventHandlerPolling);
-
- pca9532_init();
-
- // Button
- Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN);
-
- //------------- UART -------------//
- Chip_UART_Init(UART_DEV);
- Chip_UART_SetBaud(UART_DEV, CFG_BOARD_UART_BAUDRATE);
- Chip_UART_ConfigData(UART_DEV, UART_LCR_WLEN8 | UART_LCR_SBS_1BIT | UART_LCR_PARITY_DIS);
- Chip_UART_TXEnable(UART_DEV);
-
- //------------- USB -------------//
- enum {
- USBMODE_DEVICE = 2,
- USBMODE_HOST = 3
- };
-
- enum {
- USBMODE_VBUS_LOW = 0,
- USBMODE_VBUS_HIGH = 1
- };
-
- /* From EA4357 user manual
- *
- * USB0 Device operation:
- * - Insert jumpers in position 1-2 in JP17/JP18/JP19.
- * - GPIO28 controls USB connect functionality
- * - LED32 lights when the USB Device is connected. SJ4 has pads 1-2 shorted by default.
- * - LED33 is controlled by GPIO27 and signals USB-up state. GPIO54 is used for VBUS
- * sensing.
- *
- * USB0 Host operation:
- * - insert jumpers in position 2-3 in JP17/JP18/JP19.
- * - USB Host power is controlled via distribution switch U20 (found in schematic page 11).
- * - Signal GPIO26 is active low and enables +5V on VBUS2.
- * - LED35 light whenever +5V is present on VBUS2.
- * - GPIO55 is connected to status feedback from the distribution switch.
- * - GPIO54 is used for VBUS sensing. 15Kohm pull-down resistors are always active
- *
- * Note:
- * - Insert jumpers in position 2-3 in JP17/JP18/JP19
- * - Insert jumpers in JP31 (OTG)
- */
-#if CFG_TUSB_RHPORT0_MODE
- Chip_USB0_Init();
-#endif
-
- /* From EA4357 user manual
- *
- * For USB1 Device:
- * - a 1.5Kohm pull-up resistor is needed on the USB DP data signal. There are two methods to create this.
- * JP15 is inserted and the pull-up resistor is always enabled. Alternatively, the pull-up resistor is activated
- * inside the USB OTG chip (U31), and this has to be done via the I2C interface of GPIO52/GPIO53. In the latter case,
- * JP15 shall not be inserted.
- * - J19 is the connector to use when USB Device is used. Normally it should be a USB-B connector for
- * creating a USB Device interface, but the mini-AB connector can also be used in this case. The status
- * of VBUS can be read via U31.
- * - JP16 shall not be inserted.
- *
- * For USB1 Host:
- * - 15Kohm pull-down resistors are needed on the USB data signals. These are activated inside the USB OTG chip (U31),
- * and this has to be done via the I2C interface of GPIO52/GPIO53.
- * - J20 is the connector to use when USB Host is used. In order to provide +5V to the external USB
- * device connected to this connector (J20), channel A of U20 must be enabled. It is enabled by default
- * since SJ5 is normally connected between pin 1-2.
- * - LED34 lights green when +5V is available on J20.
- * - JP15 shall not be inserted. JP16 has no effect
- */
-#if CFG_TUSB_RHPORT1_MODE
- Chip_USB1_Init();
-#endif
-
- // USB0 Vbus Power: P2_3 on EA4357 channel B U20 GPIO26 active low (base board)
- Chip_SCU_PinMuxSet(2, 3, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC7);
-
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
- // P9_5 (GPIO5[18]) (GPIO28 on oem base) as USB connect, active low.
- Chip_SCU_PinMuxSet(9, 5, SCU_MODE_PULLDOWN | SCU_MODE_FUNC4);
- Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 5, 18);
- #endif
-
- // USB1 Power: EA4357 channel A U20 is enabled by SJ5 connected to pad 1-2, no more action required
- // TODO Remove R170, R171, solder a pair of 15K to USB1 D+/D- to test with USB1 Host
-}
-
-//--------------------------------------------------------------------+
-// USB Interrupt Handler
-//--------------------------------------------------------------------+
-void USB0_IRQHandler(void)
-{
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
- tuh_int_handler(0);
- #endif
-
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
- tud_int_handler(0);
- #endif
-}
-
-void USB1_IRQHandler(void)
-{
- #if CFG_TUSB_RHPORT1_MODE & OPT_MODE_HOST
- tuh_int_handler(1);
- #endif
-
- #if CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE
- tud_int_handler(1);
- #endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- if (state)
- {
- pca9532_setLeds( LED1, 0 );
- }else
- {
- pca9532_setLeds( 0, LED1);
- }
-}
-
-uint32_t board_button_read(void)
-{
- // active low
- return Chip_GPIO_GetPinState(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN) ? 0 : 1;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- //return UART_ReceiveByte(BOARD_UART_DEV);
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- uint8_t const* buf8 = (uint8_t const*) buf;
- for(int i=0; i<len; i++)
- {
- while ((Chip_UART_ReadLineStatus(UART_DEV) & UART_LSR_THRE) == 0) {}
- Chip_UART_SendByte(UART_DEV, buf8[i]);
- }
-
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/ea4357/lpc4357.ld b/tinyusb/hw/bsp/ea4357/lpc4357.ld
deleted file mode 100755
index 14a0df32..00000000
--- a/tinyusb/hw/bsp/ea4357/lpc4357.ld
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * GENERATED FILE - DO NOT EDIT
- * (c) Code Red Technologies Ltd, 2008-2013
- * (c) NXP Semiconductors 2013-2019
- * Generated linker script file for LPC4357
- * Created from linkscript.ldt by FMCreateLinkLibraries
- * Using Freemarker v2.3.23
- * MCUXpresso IDE v10.2.1 [Build 795] [2018-07-25] on May 15, 2019 5:48:43 PM
- */
-
-MEMORY
-{
- /* Define each memory region */
- MFlashA512 (rx) : ORIGIN = 0x1a000000, LENGTH = 0x80000 /* 512K bytes (alias Flash) */
- MFlashB512 (rx) : ORIGIN = 0x1b000000, LENGTH = 0x80000 /* 512K bytes (alias Flash2) */
- RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */
- RamLoc40 (rwx) : ORIGIN = 0x10080000, LENGTH = 0xa000 /* 40K bytes (alias RAM2) */
- RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes (alias RAM3) */
- RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16K bytes (alias RAM4) */
- RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes (alias RAM5) */
-}
-
- /* Define a symbol for the top of each memory region */
- __base_MFlashA512 = 0x1a000000 ; /* MFlashA512 */
- __base_Flash = 0x1a000000 ; /* Flash */
- __top_MFlashA512 = 0x1a000000 + 0x80000 ; /* 512K bytes */
- __top_Flash = 0x1a000000 + 0x80000 ; /* 512K bytes */
- __base_MFlashB512 = 0x1b000000 ; /* MFlashB512 */
- __base_Flash2 = 0x1b000000 ; /* Flash2 */
- __top_MFlashB512 = 0x1b000000 + 0x80000 ; /* 512K bytes */
- __top_Flash2 = 0x1b000000 + 0x80000 ; /* 512K bytes */
- __base_RamLoc32 = 0x10000000 ; /* RamLoc32 */
- __base_RAM = 0x10000000 ; /* RAM */
- __top_RamLoc32 = 0x10000000 + 0x8000 ; /* 32K bytes */
- __top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */
- __base_RamLoc40 = 0x10080000 ; /* RamLoc40 */
- __base_RAM2 = 0x10080000 ; /* RAM2 */
- __top_RamLoc40 = 0x10080000 + 0xa000 ; /* 40K bytes */
- __top_RAM2 = 0x10080000 + 0xa000 ; /* 40K bytes */
- __base_RamAHB32 = 0x20000000 ; /* RamAHB32 */
- __base_RAM3 = 0x20000000 ; /* RAM3 */
- __top_RamAHB32 = 0x20000000 + 0x8000 ; /* 32K bytes */
- __top_RAM3 = 0x20000000 + 0x8000 ; /* 32K bytes */
- __base_RamAHB16 = 0x20008000 ; /* RamAHB16 */
- __base_RAM4 = 0x20008000 ; /* RAM4 */
- __top_RamAHB16 = 0x20008000 + 0x4000 ; /* 16K bytes */
- __top_RAM4 = 0x20008000 + 0x4000 ; /* 16K bytes */
- __base_RamAHB_ETB16 = 0x2000c000 ; /* RamAHB_ETB16 */
- __base_RAM5 = 0x2000c000 ; /* RAM5 */
- __top_RamAHB_ETB16 = 0x2000c000 + 0x4000 ; /* 16K bytes */
- __top_RAM5 = 0x2000c000 + 0x4000 ; /* 16K bytes */
-
-
-ENTRY(ResetISR)
-
-SECTIONS
-{
- .text_Flash2 : ALIGN(4)
- {
- FILL(0xff)
- *(.text_Flash2*) /* for compatibility with previous releases */
- *(.text_MFlashB512*) /* for compatibility with previous releases */
- *(.text.$Flash2*)
- *(.text.$MFlashB512*)
- *(.rodata.$Flash2*)
- *(.rodata.$MFlashB512*)
- } > MFlashB512
-
- /* MAIN TEXT SECTION */
- .text : ALIGN(4)
- {
- FILL(0xff)
- __vectors_start__ = ABSOLUTE(.) ;
- KEEP(*(.isr_vector))
- /* Global Section Table */
- . = ALIGN(4) ;
- __section_table_start = .;
- __data_section_table = .;
- LONG(LOADADDR(.data));
- LONG( ADDR(.data));
- LONG( SIZEOF(.data));
- LONG(LOADADDR(.data_RAM2));
- LONG( ADDR(.data_RAM2));
- LONG( SIZEOF(.data_RAM2));
- LONG(LOADADDR(.data_RAM3));
- LONG( ADDR(.data_RAM3));
- LONG( SIZEOF(.data_RAM3));
- LONG(LOADADDR(.data_RAM4));
- LONG( ADDR(.data_RAM4));
- LONG( SIZEOF(.data_RAM4));
- LONG(LOADADDR(.data_RAM5));
- LONG( ADDR(.data_RAM5));
- LONG( SIZEOF(.data_RAM5));
- __data_section_table_end = .;
- __bss_section_table = .;
- LONG( ADDR(.bss));
- LONG( SIZEOF(.bss));
- LONG( ADDR(.bss_RAM2));
- LONG( SIZEOF(.bss_RAM2));
- LONG( ADDR(.bss_RAM3));
- LONG( SIZEOF(.bss_RAM3));
- LONG( ADDR(.bss_RAM4));
- LONG( SIZEOF(.bss_RAM4));
- LONG( ADDR(.bss_RAM5));
- LONG( SIZEOF(.bss_RAM5));
- __bss_section_table_end = .;
- __section_table_end = . ;
- /* End of Global Section Table */
-
- *(.after_vectors*)
-
- } > MFlashA512
-
- .text : ALIGN(4)
- {
- *(.text*)
- *(.rodata .rodata.* .constdata .constdata.*)
- . = ALIGN(4);
- } > MFlashA512
- /*
- * for exception handling/unwind - some Newlib functions (in common
- * with C++ and STDC++) use this.
- */
- .ARM.extab : ALIGN(4)
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > MFlashA512
-
- __exidx_start = .;
-
- .ARM.exidx : ALIGN(4)
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > MFlashA512
- __exidx_end = .;
-
- _etext = .;
-
- /* DATA section for RamLoc40 */
-
- .data_RAM2 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM2 = .) ;
- *(.ramfunc.$RAM2)
- *(.ramfunc.$RamLoc40)
- *(.data.$RAM2*)
- *(.data.$RamLoc40*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM2 = .) ;
- } > RamLoc40 AT>MFlashA512
- /* DATA section for RamAHB32 */
-
- .data_RAM3 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM3 = .) ;
- *(.ramfunc.$RAM3)
- *(.ramfunc.$RamAHB32)
- *(.data.$RAM3*)
- *(.data.$RamAHB32*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM3 = .) ;
- } > RamAHB32 AT>MFlashA512
- /* DATA section for RamAHB16 */
-
- .data_RAM4 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM4 = .) ;
- *(.ramfunc.$RAM4)
- *(.ramfunc.$RamAHB16)
- *(.data.$RAM4*)
- *(.data.$RamAHB16*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM4 = .) ;
- } > RamAHB16 AT>MFlashA512
- /* DATA section for RamAHB_ETB16 */
-
- .data_RAM5 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM5 = .) ;
- *(.ramfunc.$RAM5)
- *(.ramfunc.$RamAHB_ETB16)
- *(.data.$RAM5*)
- *(.data.$RamAHB_ETB16*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM5 = .) ;
- } > RamAHB_ETB16 AT>MFlashA512
- /* MAIN DATA SECTION */
- .uninit_RESERVED : ALIGN(4)
- {
- KEEP(*(.bss.$RESERVED*))
- . = ALIGN(4) ;
- _end_uninit_RESERVED = .;
- } > RamLoc32
-
- /* Main DATA section (RamLoc32) */
- .data : ALIGN(4)
- {
- FILL(0xff)
- _data = . ;
- *(vtable)
- *(.ramfunc*)
- *(.data*)
- . = ALIGN(4) ;
- _edata = . ;
- } > RamLoc32 AT>MFlashA512
-
- /* BSS section for RamLoc40 */
- .bss_RAM2 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM2 = .) ;
- *(.bss.$RAM2*)
- *(.bss.$RamLoc40*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM2 = .) ;
- } > RamLoc40
-
- /* BSS section for RamAHB32 */
- .bss_RAM3 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM3 = .) ;
- *(.bss.$RAM3*)
- *(.bss.$RamAHB32*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM3 = .) ;
- } > RamAHB32
-
- /* BSS section for RamAHB16 */
- .bss_RAM4 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM4 = .) ;
- *(.bss.$RAM4*)
- *(.bss.$RamAHB16*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM4 = .) ;
- } > RamAHB16
-
- /* BSS section for RamAHB_ETB16 */
- .bss_RAM5 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM5 = .) ;
- *(.bss.$RAM5*)
- *(.bss.$RamAHB_ETB16*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM5 = .) ;
- } > RamAHB_ETB16
-
- /* MAIN BSS SECTION */
- .bss : ALIGN(4)
- {
- _bss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4) ;
- _ebss = .;
- PROVIDE(end = .);
- } > RamLoc32
-
- /* NOINIT section for RamLoc40 */
- .noinit_RAM2 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM2*)
- *(.noinit.$RamLoc40*)
- . = ALIGN(4) ;
- } > RamLoc40
-
- /* NOINIT section for RamAHB32 */
- .noinit_RAM3 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM3*)
- *(.noinit.$RamAHB32*)
- . = ALIGN(4) ;
- } > RamAHB32
-
- /* NOINIT section for RamAHB16 */
- .noinit_RAM4 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM4*)
- *(.noinit.$RamAHB16*)
- . = ALIGN(4) ;
- } > RamAHB16
-
- /* NOINIT section for RamAHB_ETB16 */
- .noinit_RAM5 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM5*)
- *(.noinit.$RamAHB_ETB16*)
- . = ALIGN(4) ;
- } > RamAHB_ETB16
-
- /* DEFAULT NOINIT SECTION */
- .noinit (NOLOAD): ALIGN(4)
- {
- _noinit = .;
- *(.noinit*)
- . = ALIGN(4) ;
- _end_noinit = .;
- } > RamLoc32
- PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
- PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc32 - 0);
-
- /* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (NMI_Handler + 1)
- + (HardFault_Handler + 1)
- + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
- + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
- + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
- ) );
-
- /* Provide basic symbols giving location and size of main text
- * block, including initial values of RW data sections. Note that
- * these will need extending to give a complete picture with
- * complex images (e.g multiple Flash banks).
- */
- _image_start = LOADADDR(.text);
- _image_end = LOADADDR(.data) + SIZEOF(.data);
- _image_size = _image_end - _image_start;
-} \ No newline at end of file
diff --git a/tinyusb/hw/bsp/ea4357/pca9532.c b/tinyusb/hw/bsp/ea4357/pca9532.c
deleted file mode 100755
index eae3805c..00000000
--- a/tinyusb/hw/bsp/ea4357/pca9532.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/*****************************************************************************
- *
- * Copyright(C) 2011, Embedded Artists AB
- * All rights reserved.
- *
- ******************************************************************************
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * products. This software is supplied "AS IS" without any warranties.
- * Embedded Artists AB assumes no responsibility or liability for the
- * use of the software, conveys no license or title under any patent,
- * copyright, or mask work right to the product. Embedded Artists AB
- * reserves the right to make changes in the software without
- * notification. Embedded Artists AB also make no representation or
- * warranty that such application will be suitable for the specified
- * use without further testing or modification.
- *****************************************************************************/
-
-/*
- * NOTE: I2C must have been initialized before calling any functions in this
- * file.
- */
-
-/******************************************************************************
- * Includes
- *****************************************************************************/
-
-//#include "board.h"
-#include "chip.h"
-
-#include "pca9532.h"
-
-/******************************************************************************
- * Defines and typedefs
- *****************************************************************************/
-
-#define I2C_PORT (LPC_I2C0)
-
-#define LS_MODE_ON 0x01
-#define LS_MODE_BLINK0 0x02
-#define LS_MODE_BLINK1 0x03
-
-/******************************************************************************
- * External global variables
- *****************************************************************************/
-
-
-/******************************************************************************
- * Local variables
- *****************************************************************************/
-
-static uint16_t blink0Shadow = 0;
-static uint16_t blink1Shadow = 0;
-static uint16_t ledStateShadow = 0;
-
-/******************************************************************************
- * Local Functions
- *****************************************************************************/
-
-static Status I2CWrite(uint32_t addr, uint8_t* buf, uint32_t len)
-{
- I2CM_XFER_T i2cData;
-
- i2cData.slaveAddr = addr;
- i2cData.options = 0;
- i2cData.status = 0;
- i2cData.txBuff = buf;
- i2cData.txSz = len;
- i2cData.rxBuff = NULL;
- i2cData.rxSz = 0;
-
- if (Chip_I2CM_XferBlocking(LPC_I2C0, &i2cData) == 0) {
- return ERROR;
- }
- return SUCCESS;
-}
-
-static Status I2CRead(uint32_t addr, uint8_t* buf, uint32_t len)
-{
- I2CM_XFER_T i2cData;
-
- i2cData.slaveAddr = addr;
- i2cData.options = 0;
- i2cData.status = 0;
- i2cData.txBuff = NULL;
- i2cData.txSz = 0;
- i2cData.rxBuff = buf;
- i2cData.rxSz = len;
-
- if (Chip_I2CM_XferBlocking(LPC_I2C0, &i2cData) == 0) {
- return ERROR;
- }
- return SUCCESS;
-}
-
-static void setLsStates(uint16_t states, uint8_t* ls, uint8_t mode)
-{
-#define IS_LED_SET(bit, x) ( ( ((x) & (bit)) != 0 ) ? 1 : 0 )
-
- int i = 0;
-
- for (i = 0; i < 4; i++) {
-
- ls[i] |= ( (IS_LED_SET(0x0001, states)*mode << 0)
- | (IS_LED_SET(0x0002, states)*mode << 2)
- | (IS_LED_SET(0x0004, states)*mode << 4)
- | (IS_LED_SET(0x0008, states)*mode << 6) );
-
- states >>= 4;
- }
-}
-
-static void setLeds(void)
-{
- uint8_t buf[5];
- uint8_t ls[4] = {0,0,0,0};
- uint16_t states = ledStateShadow;
-
- /* LEDs in On/Off state */
- setLsStates(states, ls, LS_MODE_ON);
-
- /* set the LEDs that should blink */
- setLsStates(blink0Shadow, ls, LS_MODE_BLINK0);
- setLsStates(blink1Shadow, ls, LS_MODE_BLINK1);
-
-
- buf[0] = PCA9532_LS0 | PCA9532_AUTO_INC;
- buf[1] = ls[0];
- buf[2] = ls[1];
- buf[3] = ls[2];
- buf[4] = ls[3];
- I2CWrite(PCA9532_I2C_ADDR, buf, 5);
-}
-
-/******************************************************************************
- * Public Functions
- *****************************************************************************/
-
-/******************************************************************************
- *
- * Description:
- * Initialize the PCA9532 Device
- *
- *****************************************************************************/
-void pca9532_init (void)
-{
- /* nothing to initialize */
-}
-
-/******************************************************************************
- *
- * Description:
- * Get the LED states
- *
- * Params:
- * [in] shadow - TRUE if the states should be retrieved from the shadow
- * variables. The shadow variable are updated when any
- * of setLeds, setBlink0Leds and/or setBlink1Leds are
- * called.
- *
- * FALSE if the state should be retrieved from the PCA9532
- * device. A blinkin LED may be reported as on or off
- * depending on the state when calling the function.
- *
- * Returns:
- * A mask where a 1 indicates that a LED is on (or blinking).
- *
- *****************************************************************************/
-uint16_t pca9532_getLedState (uint32_t shadow)
-{
- uint8_t buf[2];
- uint16_t ret = 0;
-
- if (shadow) {
- /* a blink LED is reported as on*/
- ret = (ledStateShadow | blink0Shadow | blink1Shadow);
- }
- else {
-
- /*
- * A blinking LED may be reported as on or off depending on
- * its state when reading the Input register.
- */
-
- buf[0] = PCA9532_INPUT0;
- I2CWrite(PCA9532_I2C_ADDR, buf, 1);
-
- I2CRead(PCA9532_I2C_ADDR, buf, 1);
- ret = buf[0];
-
-
- buf[0] = PCA9532_INPUT1;
- I2CWrite(PCA9532_I2C_ADDR, buf, 1);
-
- I2CRead(PCA9532_I2C_ADDR, buf, 1);
- ret |= (buf[0] << 8);
-
-
- /* invert since LEDs are active low */
- ret = ((~ret) & 0xFFFF);
- }
-
- return (ret & ~PCA9532_NOT_USED);
-}
-
-
-/******************************************************************************
- *
- * Description:
- * Set LED states (on or off).
- *
- * Params:
- * [in] ledOnMask - The LEDs that should be turned on. This mask has
- * priority over ledOffMask
- * [in] ledOffMask - The LEDs that should be turned off.
- *
- *****************************************************************************/
-void pca9532_setLeds (uint16_t ledOnMask, uint16_t ledOffMask)
-{
- /* turn off leds */
- ledStateShadow &= (~(ledOffMask) & 0xffff);
-
- /* ledOnMask has priority over ledOffMask */
- ledStateShadow |= ledOnMask;
-
- /* turn off blinking */
- blink0Shadow &= (~(ledOffMask) & 0xffff);
- blink1Shadow &= (~(ledOffMask) & 0xffff);
-
- setLeds();
-}
-
-/******************************************************************************
- *
- * Description:
- * Set the blink period for PWM0. Valid values are 0 - 255 where 0
- * means 152 Hz and 255 means 0.59 Hz. A value of 151 means 1 Hz.
- *
- * Params:
- * [in] period - the period for pwm0
- *
- *****************************************************************************/
-void pca9532_setBlink0Period(uint8_t period)
-{
- uint8_t buf[2];
-
- buf[0] = PCA9532_PSC0;
- buf[1] = period;
- I2CWrite(PCA9532_I2C_ADDR, buf, 2);
-}
-
-/******************************************************************************
- *
- * Description:
- * Set the duty cycle for PWM0. Valid values are 0 - 100. 25 means the LED
- * is on 25% of the period.
- *
- * Params:
- * [in] duty - duty cycle
- *
- *****************************************************************************/
-void pca9532_setBlink0Duty(uint8_t duty)
-{
- uint8_t buf[2];
- uint32_t tmp = duty;
- if (tmp > 100) {
- tmp = 100;
- }
-
- tmp = (256 * tmp)/100;
-
- buf[0] = PCA9532_PWM0;
- buf[1] = tmp;
- I2CWrite(PCA9532_I2C_ADDR, buf, 2);
-}
-
-/******************************************************************************
- *
- * Description:
- * Set the LEDs that should blink with rate and duty cycle from PWM0.
- * Blinking is turned off with pca9532_setLeds.
- *
- * Params:
- * [in] ledMask - LEDs that should blink.
- *
- *****************************************************************************/
-void pca9532_setBlink0Leds(uint16_t ledMask)
-{
- blink0Shadow |= ledMask;
- setLeds();
-}
-
-/******************************************************************************
- *
- * Description:
- * Set the blink period for PWM1. Valid values are 0 - 255 where 0
- * means 152 Hz and 255 means 0.59 Hz. A value of 151 means 1 Hz.
- *
- * Params:
- * [in] period - The period for PWM1
- *
- *****************************************************************************/
-void pca9532_setBlink1Period(uint8_t period)
-{
- uint8_t buf[2];
-
- buf[0] = PCA9532_PSC1;
- buf[1] = period;
- I2CWrite(PCA9532_I2C_ADDR, buf, 2);
-}
-
-/******************************************************************************
- *
- * Description:
- * Set the duty cycle for PWM1. Valid values are 0 - 100. 25 means the LED
- * is on 25% of the period.
- *
- * Params:
- * [in] duty - duty cycle.
- *
- *****************************************************************************/
-void pca9532_setBlink1Duty(uint8_t duty)
-{
- uint8_t buf[2];
-
- uint32_t tmp = duty;
- if (tmp > 100) {
- tmp = 100;
- }
-
- tmp = (256 * tmp)/100;
-
- buf[0] = PCA9532_PWM1;
- buf[1] = tmp;
- I2CWrite(PCA9532_I2C_ADDR, buf, 2);
-}
-
-/******************************************************************************
- *
- * Description:
- * Set the LEDs that should blink with rate and duty cycle from PWM1.
- * Blinking is turned off with pca9532_setLeds.
- *
- * Params:
- * [in] ledMask - LEDs that should blink.
- *
- *****************************************************************************/
-void pca9532_setBlink1Leds(uint16_t ledMask)
-{
- blink1Shadow |= ledMask;
- setLeds();
-}
diff --git a/tinyusb/hw/bsp/ea4357/pca9532.h b/tinyusb/hw/bsp/ea4357/pca9532.h
deleted file mode 100755
index 7a7c6e14..00000000
--- a/tinyusb/hw/bsp/ea4357/pca9532.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*****************************************************************************
- *
- * Copyright(C) 2011, Embedded Artists AB
- * All rights reserved.
- *
- ******************************************************************************
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * products. This software is supplied "AS IS" without any warranties.
- * Embedded Artists AB assumes no responsibility or liability for the
- * use of the software, conveys no license or title under any patent,
- * copyright, or mask work right to the product. Embedded Artists AB
- * reserves the right to make changes in the software without
- * notification. Embedded Artists AB also make no representation or
- * warranty that such application will be suitable for the specified
- * use without further testing or modification.
- *****************************************************************************/
-#ifndef __PCA9532C_H
-#define __PCA9532C_H
-
-
-#define PCA9532_I2C_ADDR (0xC0>>1)
-
-#define PCA9532_INPUT0 0x00
-#define PCA9532_INPUT1 0x01
-#define PCA9532_PSC0 0x02
-#define PCA9532_PWM0 0x03
-#define PCA9532_PSC1 0x04
-#define PCA9532_PWM1 0x05
-#define PCA9532_LS0 0x06
-#define PCA9532_LS1 0x07
-#define PCA9532_LS2 0x08
-#define PCA9532_LS3 0x09
-
-#define PCA9532_AUTO_INC 0x10
-
-
-/*
- * The Keys on the base board are mapped to LED0 -> LED3 on
- * the PCA9532.
- */
-
-#define KEY1 0x0001
-#define KEY2 0x0002
-#define KEY3 0x0004
-#define KEY4 0x0008
-
-#define KEY_MASK 0x000F
-
-/*
- * MMC Card Detect and MMC Write Protect are mapped to LED4
- * and LED5 on the PCA9532. Please note that WP is active low.
- */
-
-#define MMC_CD 0x0010
-#define MMC_WP 0x0020
-
-#define MMC_MASK 0x30
-
-/* NOTE: LED6 and LED7 on PCA9532 are not connected to anything */
-#define PCA9532_NOT_USED 0xC0
-
-/*
- * Below are the LED constants to use when enabling/disabling a LED.
- * The LED names are the names printed on the base board and not
- * the names from the PCA9532 device. base_LED1 -> LED8 on PCA9532,
- * base_LED2 -> LED9, and so on.
- */
-
-#define LED1 0x0100
-#define LED2 0x0200
-#define LED3 0x0400
-#define LED4 0x0800
-#define LED5 0x1000
-#define LED6 0x2000
-#define LED7 0x4000
-#define LED8 0x8000
-
-#define LED_MASK 0xFF00
-
-void pca9532_init (void);
-uint16_t pca9532_getLedState (uint32_t shadow);
-void pca9532_setLeds (uint16_t ledOnMask, uint16_t ledOffMask);
-void pca9532_setBlink0Period(uint8_t period);
-void pca9532_setBlink0Duty(uint8_t duty);
-void pca9532_setBlink0Leds(uint16_t ledMask);
-void pca9532_setBlink1Period(uint8_t period);
-void pca9532_setBlink1Duty(uint8_t duty);
-void pca9532_setBlink1Leds(uint16_t ledMask);
-
-#endif /* end __PCA9532C_H */
-/****************************************************************************
-** End Of File
-*****************************************************************************/
diff --git a/tinyusb/hw/bsp/esp32s2/boards/CMakeLists.txt b/tinyusb/hw/bsp/esp32s2/boards/CMakeLists.txt
deleted file mode 100755
index 71753012..00000000
--- a/tinyusb/hw/bsp/esp32s2/boards/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-idf_component_register(SRCS esp32s2.c
- INCLUDE_DIRS "." "${BOARD}"
- PRIV_REQUIRES "driver"
- REQUIRES freertos src led_strip)
-
-# Apply board specific content
-include("${BOARD}/board.cmake")
-
-idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
-target_include_directories(${COMPONENT_TARGET} PUBLIC
- "${FREERTOS_ORIG_INCLUDE_PATH}"
- "${TOP}/hw"
- "${TOP}/src"
-)
diff --git a/tinyusb/hw/bsp/esp32s2/boards/adafruit_feather_esp32s2/board.cmake b/tinyusb/hw/bsp/esp32s2/boards/adafruit_feather_esp32s2/board.cmake
deleted file mode 100755
index d3396267..00000000
--- a/tinyusb/hw/bsp/esp32s2/boards/adafruit_feather_esp32s2/board.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-# Apply board specific content here
-target_include_directories(${COMPONENT_LIB} PRIVATE .)
-
-idf_build_get_property(idf_target IDF_TARGET)
-
-message(STATUS "Apply ${BOARD}(${idf_target}) specific options for component: ${COMPONENT_TARGET}")
-
-if(NOT ${idf_target} STREQUAL "esp32s2")
- message(FATAL_ERROR "Incorrect target for board ${BOARD}: $ENV{IDF_TARGET}(${idf_target}), try to clean the build first." )
-endif()
-
-set(IDF_TARGET "esp32s2" FORCE)
-
-target_compile_options(${COMPONENT_TARGET} PUBLIC
- "-DCFG_TUSB_MCU=OPT_MCU_ESP32S2"
- "-DCFG_TUSB_OS=OPT_OS_FREERTOS"
-) \ No newline at end of file
diff --git a/tinyusb/hw/bsp/esp32s2/boards/adafruit_feather_esp32s2/board.h b/tinyusb/hw/bsp/esp32s2/boards/adafruit_feather_esp32s2/board.h
deleted file mode 100755
index 43e00901..00000000
--- a/tinyusb/hw/bsp/esp32s2/boards/adafruit_feather_esp32s2/board.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define NEOPIXEL_PIN 33
-#define NEOPIXEL_POWER_PIN 21
-#define NEOPIXEL_POWER_STATE 1
-
-#define BUTTON_PIN 0
-#define BUTTON_STATE_ACTIVE 0
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/esp32s2/boards/adafruit_magtag_29gray/board.cmake b/tinyusb/hw/bsp/esp32s2/boards/adafruit_magtag_29gray/board.cmake
deleted file mode 100755
index d3396267..00000000
--- a/tinyusb/hw/bsp/esp32s2/boards/adafruit_magtag_29gray/board.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-# Apply board specific content here
-target_include_directories(${COMPONENT_LIB} PRIVATE .)
-
-idf_build_get_property(idf_target IDF_TARGET)
-
-message(STATUS "Apply ${BOARD}(${idf_target}) specific options for component: ${COMPONENT_TARGET}")
-
-if(NOT ${idf_target} STREQUAL "esp32s2")
- message(FATAL_ERROR "Incorrect target for board ${BOARD}: $ENV{IDF_TARGET}(${idf_target}), try to clean the build first." )
-endif()
-
-set(IDF_TARGET "esp32s2" FORCE)
-
-target_compile_options(${COMPONENT_TARGET} PUBLIC
- "-DCFG_TUSB_MCU=OPT_MCU_ESP32S2"
- "-DCFG_TUSB_OS=OPT_OS_FREERTOS"
-) \ No newline at end of file
diff --git a/tinyusb/hw/bsp/esp32s2/boards/adafruit_magtag_29gray/board.h b/tinyusb/hw/bsp/esp32s2/boards/adafruit_magtag_29gray/board.h
deleted file mode 100755
index 16e30b68..00000000
--- a/tinyusb/hw/bsp/esp32s2/boards/adafruit_magtag_29gray/board.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define NEOPIXEL_PIN 1
-#define NEOPIXEL_POWER_PIN 21
-#define NEOPIXEL_POWER_STATE 0
-
-#define BUTTON_PIN 0
-#define BUTTON_STATE_ACTIVE 0
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/esp32s2/boards/adafruit_metro_esp32s2/board.cmake b/tinyusb/hw/bsp/esp32s2/boards/adafruit_metro_esp32s2/board.cmake
deleted file mode 100755
index d5c17b9b..00000000
--- a/tinyusb/hw/bsp/esp32s2/boards/adafruit_metro_esp32s2/board.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-# Apply board specific content here
-target_include_directories(${COMPONENT_LIB} PRIVATE .)
-
-idf_build_get_property(idf_target IDF_TARGET)
-
-message(STATUS "Apply ${BOARD}(${idf_target}) specific options for component: ${COMPONENT_TARGET}")
-
-if(NOT ${idf_target} STREQUAL "esp32s2")
- message(FATAL_ERROR "Incorrect target for board ${BOARD}: (${idf_target}), try to clean the build first." )
-endif()
-
-set(IDF_TARGET "esp32s2" FORCE)
-
-target_compile_options(${COMPONENT_TARGET} PUBLIC
- "-DCFG_TUSB_MCU=OPT_MCU_ESP32S2"
- "-DCFG_TUSB_OS=OPT_OS_FREERTOS"
-) \ No newline at end of file
diff --git a/tinyusb/hw/bsp/esp32s2/boards/adafruit_metro_esp32s2/board.h b/tinyusb/hw/bsp/esp32s2/boards/adafruit_metro_esp32s2/board.h
deleted file mode 100755
index 49a2474b..00000000
--- a/tinyusb/hw/bsp/esp32s2/boards/adafruit_metro_esp32s2/board.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define NEOPIXEL_PIN 45
-
-#define BUTTON_PIN 0
-#define BUTTON_STATE_ACTIVE 0
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/esp32s2/boards/esp32s2.c b/tinyusb/hw/bsp/esp32s2/boards/esp32s2.c
deleted file mode 100755
index 358c0c80..00000000
--- a/tinyusb/hw/bsp/esp32s2/boards/esp32s2.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "../../board.h"
-#include "board.h"
-
-#include "esp_rom_gpio.h"
-#include "hal/gpio_ll.h"
-#include "hal/usb_hal.h"
-#include "soc/usb_periph.h"
-
-#include "driver/periph_ctrl.h"
-#include "driver/rmt.h"
-
-#ifdef NEOPIXEL_PIN
-#include "led_strip.h"
-static led_strip_t *strip;
-#endif
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-static void configure_pins(usb_hal_context_t *usb);
-
-// Initialize on-board peripherals : led, button, uart and USB
-void board_init(void)
-{
-
-#ifdef NEOPIXEL_PIN
- #ifdef NEOPIXEL_POWER_PIN
- gpio_reset_pin(NEOPIXEL_POWER_PIN);
- gpio_set_direction(NEOPIXEL_POWER_PIN, GPIO_MODE_OUTPUT);
- gpio_set_level(NEOPIXEL_POWER_PIN, NEOPIXEL_POWER_STATE);
- #endif
-
- // WS2812 Neopixel driver with RMT peripheral
- rmt_config_t config = RMT_DEFAULT_CONFIG_TX(NEOPIXEL_PIN, RMT_CHANNEL_0);
- config.clk_div = 2; // set counter clock to 40MHz
-
- rmt_config(&config);
- rmt_driver_install(config.channel, 0, 0);
-
- led_strip_config_t strip_config = LED_STRIP_DEFAULT_CONFIG(1, (led_strip_dev_t) config.channel);
- strip = led_strip_new_rmt_ws2812(&strip_config);
- strip->clear(strip, 100); // off led
-#endif
-
- // Button
- gpio_pad_select_gpio(BUTTON_PIN);
- gpio_set_direction(BUTTON_PIN, GPIO_MODE_INPUT);
- gpio_set_pull_mode(BUTTON_PIN, BUTTON_STATE_ACTIVE ? GPIO_PULLDOWN_ONLY : GPIO_PULLUP_ONLY);
-
- // USB Controller Hal init
- periph_module_reset(PERIPH_USB_MODULE);
- periph_module_enable(PERIPH_USB_MODULE);
-
- usb_hal_context_t hal = {
- .use_external_phy = false // use built-in PHY
- };
- usb_hal_init(&hal);
- configure_pins(&hal);
-}
-
-static void configure_pins(usb_hal_context_t *usb)
-{
- /* usb_periph_iopins currently configures USB_OTG as USB Device.
- * Introduce additional parameters in usb_hal_context_t when adding support
- * for USB Host.
- */
- for (const usb_iopin_dsc_t *iopin = usb_periph_iopins; iopin->pin != -1; ++iopin) {
- if ((usb->use_external_phy) || (iopin->ext_phy_only == 0)) {
- esp_rom_gpio_pad_select_gpio(iopin->pin);
- if (iopin->is_output) {
- esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false);
- } else {
- esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false);
- if ((iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH)) {
- gpio_ll_input_enable(&GPIO, iopin->pin);
- }
- }
- esp_rom_gpio_pad_unhold(iopin->pin);
- }
- }
- if (!usb->use_external_phy) {
- gpio_set_drive_capability(USBPHY_DM_NUM, GPIO_DRIVE_CAP_3);
- gpio_set_drive_capability(USBPHY_DP_NUM, GPIO_DRIVE_CAP_3);
- }
-}
-
-// Turn LED on or off
-void board_led_write(bool state)
-{
-#ifdef NEOPIXEL_PIN
- strip->set_pixel(strip, 0, (state ? 0x88 : 0x00), 0x00, 0x00);
- strip->refresh(strip, 100);
-#endif
-}
-
-// Get the current state of button
-// a '1' means active (pressed), a '0' means inactive.
-uint32_t board_button_read(void)
-{
- return gpio_get_level(BUTTON_PIN) == BUTTON_STATE_ACTIVE;
-}
-
-// Get characters from UART
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-// Send characters to UART
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
diff --git a/tinyusb/hw/bsp/esp32s2/boards/espressif_kaluga_1/board.cmake b/tinyusb/hw/bsp/esp32s2/boards/espressif_kaluga_1/board.cmake
deleted file mode 100755
index d5c17b9b..00000000
--- a/tinyusb/hw/bsp/esp32s2/boards/espressif_kaluga_1/board.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-# Apply board specific content here
-target_include_directories(${COMPONENT_LIB} PRIVATE .)
-
-idf_build_get_property(idf_target IDF_TARGET)
-
-message(STATUS "Apply ${BOARD}(${idf_target}) specific options for component: ${COMPONENT_TARGET}")
-
-if(NOT ${idf_target} STREQUAL "esp32s2")
- message(FATAL_ERROR "Incorrect target for board ${BOARD}: (${idf_target}), try to clean the build first." )
-endif()
-
-set(IDF_TARGET "esp32s2" FORCE)
-
-target_compile_options(${COMPONENT_TARGET} PUBLIC
- "-DCFG_TUSB_MCU=OPT_MCU_ESP32S2"
- "-DCFG_TUSB_OS=OPT_OS_FREERTOS"
-) \ No newline at end of file
diff --git a/tinyusb/hw/bsp/esp32s2/boards/espressif_kaluga_1/board.h b/tinyusb/hw/bsp/esp32s2/boards/espressif_kaluga_1/board.h
deleted file mode 100755
index 6bb44f76..00000000
--- a/tinyusb/hw/bsp/esp32s2/boards/espressif_kaluga_1/board.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// Note: need to insert jumper next to WS2812 pixel
-#define NEOPIXEL_PIN 45
-
-#define BUTTON_PIN 0
-#define BUTTON_STATE_ACTIVE 0
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/esp32s2/boards/espressif_saola_1/board.cmake b/tinyusb/hw/bsp/esp32s2/boards/espressif_saola_1/board.cmake
deleted file mode 100755
index d5c17b9b..00000000
--- a/tinyusb/hw/bsp/esp32s2/boards/espressif_saola_1/board.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-# Apply board specific content here
-target_include_directories(${COMPONENT_LIB} PRIVATE .)
-
-idf_build_get_property(idf_target IDF_TARGET)
-
-message(STATUS "Apply ${BOARD}(${idf_target}) specific options for component: ${COMPONENT_TARGET}")
-
-if(NOT ${idf_target} STREQUAL "esp32s2")
- message(FATAL_ERROR "Incorrect target for board ${BOARD}: (${idf_target}), try to clean the build first." )
-endif()
-
-set(IDF_TARGET "esp32s2" FORCE)
-
-target_compile_options(${COMPONENT_TARGET} PUBLIC
- "-DCFG_TUSB_MCU=OPT_MCU_ESP32S2"
- "-DCFG_TUSB_OS=OPT_OS_FREERTOS"
-) \ No newline at end of file
diff --git a/tinyusb/hw/bsp/esp32s2/boards/espressif_saola_1/board.h b/tinyusb/hw/bsp/esp32s2/boards/espressif_saola_1/board.h
deleted file mode 100755
index f450b9a8..00000000
--- a/tinyusb/hw/bsp/esp32s2/boards/espressif_saola_1/board.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// Note: On the production version (v1.2) WS2812 is connected to GPIO 18,
-// however earlier revision v1.1 WS2812 is connected to GPIO 17
-#define NEOPIXEL_PIN 18
-
-#define BUTTON_PIN 0
-#define BUTTON_STATE_ACTIVE 0
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/esp32s2/components/led_strip/CMakeLists.txt b/tinyusb/hw/bsp/esp32s2/components/led_strip/CMakeLists.txt
deleted file mode 100755
index 6d0fcbc8..00000000
--- a/tinyusb/hw/bsp/esp32s2/components/led_strip/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-set(component_srcs "src/led_strip_rmt_ws2812.c")
-
-idf_component_register(SRCS "${component_srcs}"
- INCLUDE_DIRS "include"
- PRIV_INCLUDE_DIRS ""
- PRIV_REQUIRES "driver"
- REQUIRES "")
-
diff --git a/tinyusb/hw/bsp/esp32s2/components/led_strip/include/led_strip.h b/tinyusb/hw/bsp/esp32s2/components/led_strip/include/led_strip.h
deleted file mode 100755
index a9dffc32..00000000
--- a/tinyusb/hw/bsp/esp32s2/components/led_strip/include/led_strip.h
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
-//
-// 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.
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "esp_err.h"
-
-/**
-* @brief LED Strip Type
-*
-*/
-typedef struct led_strip_s led_strip_t;
-
-/**
-* @brief LED Strip Device Type
-*
-*/
-typedef void *led_strip_dev_t;
-
-/**
-* @brief Declare of LED Strip Type
-*
-*/
-struct led_strip_s {
- /**
- * @brief Set RGB for a specific pixel
- *
- * @param strip: LED strip
- * @param index: index of pixel to set
- * @param red: red part of color
- * @param green: green part of color
- * @param blue: blue part of color
- *
- * @return
- * - ESP_OK: Set RGB for a specific pixel successfully
- * - ESP_ERR_INVALID_ARG: Set RGB for a specific pixel failed because of invalid parameters
- * - ESP_FAIL: Set RGB for a specific pixel failed because other error occurred
- */
- esp_err_t (*set_pixel)(led_strip_t *strip, uint32_t index, uint32_t red, uint32_t green, uint32_t blue);
-
- /**
- * @brief Refresh memory colors to LEDs
- *
- * @param strip: LED strip
- * @param timeout_ms: timeout value for refreshing task
- *
- * @return
- * - ESP_OK: Refresh successfully
- * - ESP_ERR_TIMEOUT: Refresh failed because of timeout
- * - ESP_FAIL: Refresh failed because some other error occurred
- *
- * @note:
- * After updating the LED colors in the memory, a following invocation of this API is needed to flush colors to strip.
- */
- esp_err_t (*refresh)(led_strip_t *strip, uint32_t timeout_ms);
-
- /**
- * @brief Clear LED strip (turn off all LEDs)
- *
- * @param strip: LED strip
- * @param timeout_ms: timeout value for clearing task
- *
- * @return
- * - ESP_OK: Clear LEDs successfully
- * - ESP_ERR_TIMEOUT: Clear LEDs failed because of timeout
- * - ESP_FAIL: Clear LEDs failed because some other error occurred
- */
- esp_err_t (*clear)(led_strip_t *strip, uint32_t timeout_ms);
-
- /**
- * @brief Free LED strip resources
- *
- * @param strip: LED strip
- *
- * @return
- * - ESP_OK: Free resources successfully
- * - ESP_FAIL: Free resources failed because error occurred
- */
- esp_err_t (*del)(led_strip_t *strip);
-};
-
-/**
-* @brief LED Strip Configuration Type
-*
-*/
-typedef struct {
- uint32_t max_leds; /*!< Maximum LEDs in a single strip */
- led_strip_dev_t dev; /*!< LED strip device (e.g. RMT channel, PWM channel, etc) */
-} led_strip_config_t;
-
-/**
- * @brief Default configuration for LED strip
- *
- */
-#define LED_STRIP_DEFAULT_CONFIG(number, dev_hdl) \
- { \
- .max_leds = number, \
- .dev = dev_hdl, \
- }
-
-/**
-* @brief Install a new ws2812 driver (based on RMT peripheral)
-*
-* @param config: LED strip configuration
-* @return
-* LED strip instance or NULL
-*/
-led_strip_t *led_strip_new_rmt_ws2812(const led_strip_config_t *config);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/tinyusb/hw/bsp/esp32s2/components/led_strip/src/led_strip_rmt_ws2812.c b/tinyusb/hw/bsp/esp32s2/components/led_strip/src/led_strip_rmt_ws2812.c
deleted file mode 100755
index 025d3c59..00000000
--- a/tinyusb/hw/bsp/esp32s2/components/led_strip/src/led_strip_rmt_ws2812.c
+++ /dev/null
@@ -1,171 +0,0 @@
-// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-#include <stdlib.h>
-#include <string.h>
-#include <sys/cdefs.h>
-#include "esp_log.h"
-#include "esp_attr.h"
-#include "led_strip.h"
-#include "driver/rmt.h"
-
-static const char *TAG = "ws2812";
-#define STRIP_CHECK(a, str, goto_tag, ret_value, ...) \
- do \
- { \
- if (!(a)) \
- { \
- ESP_LOGE(TAG, "%s(%d): " str, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
- ret = ret_value; \
- goto goto_tag; \
- } \
- } while (0)
-
-#define WS2812_T0H_NS (350)
-#define WS2812_T0L_NS (1000)
-#define WS2812_T1H_NS (1000)
-#define WS2812_T1L_NS (350)
-#define WS2812_RESET_US (280)
-
-static uint32_t ws2812_t0h_ticks = 0;
-static uint32_t ws2812_t1h_ticks = 0;
-static uint32_t ws2812_t0l_ticks = 0;
-static uint32_t ws2812_t1l_ticks = 0;
-
-typedef struct {
- led_strip_t parent;
- rmt_channel_t rmt_channel;
- uint32_t strip_len;
- uint8_t buffer[0];
-} ws2812_t;
-
-/**
- * @brief Conver RGB data to RMT format.
- *
- * @note For WS2812, R,G,B each contains 256 different choices (i.e. uint8_t)
- *
- * @param[in] src: source data, to converted to RMT format
- * @param[in] dest: place where to store the convert result
- * @param[in] src_size: size of source data
- * @param[in] wanted_num: number of RMT items that want to get
- * @param[out] translated_size: number of source data that got converted
- * @param[out] item_num: number of RMT items which are converted from source data
- */
-static void IRAM_ATTR ws2812_rmt_adapter(const void *src, rmt_item32_t *dest, size_t src_size,
- size_t wanted_num, size_t *translated_size, size_t *item_num)
-{
- if (src == NULL || dest == NULL) {
- *translated_size = 0;
- *item_num = 0;
- return;
- }
- const rmt_item32_t bit0 = {{{ ws2812_t0h_ticks, 1, ws2812_t0l_ticks, 0 }}}; //Logical 0
- const rmt_item32_t bit1 = {{{ ws2812_t1h_ticks, 1, ws2812_t1l_ticks, 0 }}}; //Logical 1
- size_t size = 0;
- size_t num = 0;
- uint8_t *psrc = (uint8_t *)src;
- rmt_item32_t *pdest = dest;
- while (size < src_size && num < wanted_num) {
- for (int i = 0; i < 8; i++) {
- // MSB first
- if (*psrc & (1 << (7 - i))) {
- pdest->val = bit1.val;
- } else {
- pdest->val = bit0.val;
- }
- num++;
- pdest++;
- }
- size++;
- psrc++;
- }
- *translated_size = size;
- *item_num = num;
-}
-
-static esp_err_t ws2812_set_pixel(led_strip_t *strip, uint32_t index, uint32_t red, uint32_t green, uint32_t blue)
-{
- esp_err_t ret = ESP_OK;
- ws2812_t *ws2812 = __containerof(strip, ws2812_t, parent);
- STRIP_CHECK(index < ws2812->strip_len, "index out of the maximum number of leds", err, ESP_ERR_INVALID_ARG);
- uint32_t start = index * 3;
- // In thr order of GRB
- ws2812->buffer[start + 0] = green & 0xFF;
- ws2812->buffer[start + 1] = red & 0xFF;
- ws2812->buffer[start + 2] = blue & 0xFF;
- return ESP_OK;
-err:
- return ret;
-}
-
-static esp_err_t ws2812_refresh(led_strip_t *strip, uint32_t timeout_ms)
-{
- esp_err_t ret = ESP_OK;
- ws2812_t *ws2812 = __containerof(strip, ws2812_t, parent);
- STRIP_CHECK(rmt_write_sample(ws2812->rmt_channel, ws2812->buffer, ws2812->strip_len * 3, true) == ESP_OK,
- "transmit RMT samples failed", err, ESP_FAIL);
- return rmt_wait_tx_done(ws2812->rmt_channel, pdMS_TO_TICKS(timeout_ms));
-err:
- return ret;
-}
-
-static esp_err_t ws2812_clear(led_strip_t *strip, uint32_t timeout_ms)
-{
- ws2812_t *ws2812 = __containerof(strip, ws2812_t, parent);
- // Write zero to turn off all leds
- memset(ws2812->buffer, 0, ws2812->strip_len * 3);
- return ws2812_refresh(strip, timeout_ms);
-}
-
-static esp_err_t ws2812_del(led_strip_t *strip)
-{
- ws2812_t *ws2812 = __containerof(strip, ws2812_t, parent);
- free(ws2812);
- return ESP_OK;
-}
-
-led_strip_t *led_strip_new_rmt_ws2812(const led_strip_config_t *config)
-{
- led_strip_t *ret = NULL;
- STRIP_CHECK(config, "configuration can't be null", err, NULL);
-
- // 24 bits per led
- uint32_t ws2812_size = sizeof(ws2812_t) + config->max_leds * 3;
- ws2812_t *ws2812 = calloc(1, ws2812_size);
- STRIP_CHECK(ws2812, "request memory for ws2812 failed", err, NULL);
-
- uint32_t counter_clk_hz = 0;
- STRIP_CHECK(rmt_get_counter_clock((rmt_channel_t)config->dev, &counter_clk_hz) == ESP_OK,
- "get rmt counter clock failed", err, NULL);
- // ns -> ticks
- float ratio = (float)counter_clk_hz / 1e9;
- ws2812_t0h_ticks = (uint32_t)(ratio * WS2812_T0H_NS);
- ws2812_t0l_ticks = (uint32_t)(ratio * WS2812_T0L_NS);
- ws2812_t1h_ticks = (uint32_t)(ratio * WS2812_T1H_NS);
- ws2812_t1l_ticks = (uint32_t)(ratio * WS2812_T1L_NS);
-
- // set ws2812 to rmt adapter
- rmt_translator_init((rmt_channel_t)config->dev, ws2812_rmt_adapter);
-
- ws2812->rmt_channel = (rmt_channel_t)config->dev;
- ws2812->strip_len = config->max_leds;
-
- ws2812->parent.set_pixel = ws2812_set_pixel;
- ws2812->parent.refresh = ws2812_refresh;
- ws2812->parent.clear = ws2812_clear;
- ws2812->parent.del = ws2812_del;
-
- return &ws2812->parent;
-err:
- return ret;
-}
diff --git a/tinyusb/hw/bsp/esp32s2/family.cmake b/tinyusb/hw/bsp/esp32s2/family.cmake
deleted file mode 100755
index f3d41d04..00000000
--- a/tinyusb/hw/bsp/esp32s2/family.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-# Add example src and bsp directories
-set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s2/boards" "${TOP}/hw/bsp/esp32s2/components")
-include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-set(SUPPORTED_TARGETS esp32s2)
-set(FAMILY_MCUS ESP32S2)
diff --git a/tinyusb/hw/bsp/esp32s2/family.mk b/tinyusb/hw/bsp/esp32s2/family.mk
deleted file mode 100755
index fb9b2164..00000000
--- a/tinyusb/hw/bsp/esp32s2/family.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-#DEPS_SUBMODULES +=
-
-.PHONY: all clean flash bootloader-flash app-flash erase monitor dfu-flash dfu
-
-all:
- idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) -DIDF_TARGET=esp32s2 build
-
-build: all
-
-clean:
- idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) clean
-
-fullclean:
- if test -f sdkconfig; then $(RM) -f sdkconfig ; fi
- if test -d $(BUILD); then $(RM) -rf $(BUILD) ; fi
-
-flash bootloader-flash app-flash erase monitor dfu-flash dfu:
- idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) $@
-
-uf2: $(BUILD)/$(PROJECT).uf2
-
-UF2_FAMILY_ID = 0xbfdd4eee
-$(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).bin
- @echo CREATE $@
- $(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -b 0x0 -c -o $@ $^
-
diff --git a/tinyusb/hw/bsp/esp32s3/boards/CMakeLists.txt b/tinyusb/hw/bsp/esp32s3/boards/CMakeLists.txt
deleted file mode 100755
index e1b921ae..00000000
--- a/tinyusb/hw/bsp/esp32s3/boards/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-idf_component_register(SRCS esp32s3.c
- INCLUDE_DIRS "." "${BOARD}"
- PRIV_REQUIRES "driver"
- REQUIRES freertos src led_strip)
-
-# Apply board specific content
-include("${BOARD}/board.cmake")
-
-idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
-target_include_directories(${COMPONENT_TARGET} PUBLIC
- "${FREERTOS_ORIG_INCLUDE_PATH}"
- "${TOP}/hw"
- "${TOP}/src"
-)
diff --git a/tinyusb/hw/bsp/esp32s3/boards/esp32s3.c b/tinyusb/hw/bsp/esp32s3/boards/esp32s3.c
deleted file mode 100755
index 358c0c80..00000000
--- a/tinyusb/hw/bsp/esp32s3/boards/esp32s3.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "../../board.h"
-#include "board.h"
-
-#include "esp_rom_gpio.h"
-#include "hal/gpio_ll.h"
-#include "hal/usb_hal.h"
-#include "soc/usb_periph.h"
-
-#include "driver/periph_ctrl.h"
-#include "driver/rmt.h"
-
-#ifdef NEOPIXEL_PIN
-#include "led_strip.h"
-static led_strip_t *strip;
-#endif
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-static void configure_pins(usb_hal_context_t *usb);
-
-// Initialize on-board peripherals : led, button, uart and USB
-void board_init(void)
-{
-
-#ifdef NEOPIXEL_PIN
- #ifdef NEOPIXEL_POWER_PIN
- gpio_reset_pin(NEOPIXEL_POWER_PIN);
- gpio_set_direction(NEOPIXEL_POWER_PIN, GPIO_MODE_OUTPUT);
- gpio_set_level(NEOPIXEL_POWER_PIN, NEOPIXEL_POWER_STATE);
- #endif
-
- // WS2812 Neopixel driver with RMT peripheral
- rmt_config_t config = RMT_DEFAULT_CONFIG_TX(NEOPIXEL_PIN, RMT_CHANNEL_0);
- config.clk_div = 2; // set counter clock to 40MHz
-
- rmt_config(&config);
- rmt_driver_install(config.channel, 0, 0);
-
- led_strip_config_t strip_config = LED_STRIP_DEFAULT_CONFIG(1, (led_strip_dev_t) config.channel);
- strip = led_strip_new_rmt_ws2812(&strip_config);
- strip->clear(strip, 100); // off led
-#endif
-
- // Button
- gpio_pad_select_gpio(BUTTON_PIN);
- gpio_set_direction(BUTTON_PIN, GPIO_MODE_INPUT);
- gpio_set_pull_mode(BUTTON_PIN, BUTTON_STATE_ACTIVE ? GPIO_PULLDOWN_ONLY : GPIO_PULLUP_ONLY);
-
- // USB Controller Hal init
- periph_module_reset(PERIPH_USB_MODULE);
- periph_module_enable(PERIPH_USB_MODULE);
-
- usb_hal_context_t hal = {
- .use_external_phy = false // use built-in PHY
- };
- usb_hal_init(&hal);
- configure_pins(&hal);
-}
-
-static void configure_pins(usb_hal_context_t *usb)
-{
- /* usb_periph_iopins currently configures USB_OTG as USB Device.
- * Introduce additional parameters in usb_hal_context_t when adding support
- * for USB Host.
- */
- for (const usb_iopin_dsc_t *iopin = usb_periph_iopins; iopin->pin != -1; ++iopin) {
- if ((usb->use_external_phy) || (iopin->ext_phy_only == 0)) {
- esp_rom_gpio_pad_select_gpio(iopin->pin);
- if (iopin->is_output) {
- esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false);
- } else {
- esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false);
- if ((iopin->pin != GPIO_FUNC_IN_LOW) && (iopin->pin != GPIO_FUNC_IN_HIGH)) {
- gpio_ll_input_enable(&GPIO, iopin->pin);
- }
- }
- esp_rom_gpio_pad_unhold(iopin->pin);
- }
- }
- if (!usb->use_external_phy) {
- gpio_set_drive_capability(USBPHY_DM_NUM, GPIO_DRIVE_CAP_3);
- gpio_set_drive_capability(USBPHY_DP_NUM, GPIO_DRIVE_CAP_3);
- }
-}
-
-// Turn LED on or off
-void board_led_write(bool state)
-{
-#ifdef NEOPIXEL_PIN
- strip->set_pixel(strip, 0, (state ? 0x88 : 0x00), 0x00, 0x00);
- strip->refresh(strip, 100);
-#endif
-}
-
-// Get the current state of button
-// a '1' means active (pressed), a '0' means inactive.
-uint32_t board_button_read(void)
-{
- return gpio_get_level(BUTTON_PIN) == BUTTON_STATE_ACTIVE;
-}
-
-// Get characters from UART
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-// Send characters to UART
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
diff --git a/tinyusb/hw/bsp/esp32s3/boards/espressif_addax_1/board.cmake b/tinyusb/hw/bsp/esp32s3/boards/espressif_addax_1/board.cmake
deleted file mode 100755
index 60f7d19c..00000000
--- a/tinyusb/hw/bsp/esp32s3/boards/espressif_addax_1/board.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-# Apply board specific content here
-target_include_directories(${COMPONENT_LIB} PRIVATE .)
-
-idf_build_get_property(idf_target IDF_TARGET)
-
-message(STATUS "Apply ${BOARD}(${idf_target}) specific options for component: ${COMPONENT_TARGET}")
-
-if(NOT ${idf_target} STREQUAL "esp32s3")
- message(FATAL_ERROR "Incorrect target for board ${BOARD}: (${idf_target}), try to clean the build first." )
-endif()
-
-set(IDF_TARGET "esp32s3" FORCE)
-
-target_compile_options(${COMPONENT_TARGET} PUBLIC
- "-DCFG_TUSB_MCU=OPT_MCU_ESP32S3"
- "-DCFG_TUSB_OS=OPT_OS_FREERTOS"
-) \ No newline at end of file
diff --git a/tinyusb/hw/bsp/esp32s3/boards/espressif_addax_1/board.h b/tinyusb/hw/bsp/esp32s3/boards/espressif_addax_1/board.h
deleted file mode 100755
index fff24ba4..00000000
--- a/tinyusb/hw/bsp/esp32s3/boards/espressif_addax_1/board.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// Note: On the production version (v1.1) WS2812 is connected to GPIO 47
-#define NEOPIXEL_PIN 47
-
-#define BUTTON_PIN 0
-#define BUTTON_STATE_ACTIVE 0
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/esp32s3/components/led_strip/CMakeLists.txt b/tinyusb/hw/bsp/esp32s3/components/led_strip/CMakeLists.txt
deleted file mode 100755
index 6d0fcbc8..00000000
--- a/tinyusb/hw/bsp/esp32s3/components/led_strip/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-set(component_srcs "src/led_strip_rmt_ws2812.c")
-
-idf_component_register(SRCS "${component_srcs}"
- INCLUDE_DIRS "include"
- PRIV_INCLUDE_DIRS ""
- PRIV_REQUIRES "driver"
- REQUIRES "")
-
diff --git a/tinyusb/hw/bsp/esp32s3/components/led_strip/include/led_strip.h b/tinyusb/hw/bsp/esp32s3/components/led_strip/include/led_strip.h
deleted file mode 100755
index a9dffc32..00000000
--- a/tinyusb/hw/bsp/esp32s3/components/led_strip/include/led_strip.h
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
-//
-// 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.
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "esp_err.h"
-
-/**
-* @brief LED Strip Type
-*
-*/
-typedef struct led_strip_s led_strip_t;
-
-/**
-* @brief LED Strip Device Type
-*
-*/
-typedef void *led_strip_dev_t;
-
-/**
-* @brief Declare of LED Strip Type
-*
-*/
-struct led_strip_s {
- /**
- * @brief Set RGB for a specific pixel
- *
- * @param strip: LED strip
- * @param index: index of pixel to set
- * @param red: red part of color
- * @param green: green part of color
- * @param blue: blue part of color
- *
- * @return
- * - ESP_OK: Set RGB for a specific pixel successfully
- * - ESP_ERR_INVALID_ARG: Set RGB for a specific pixel failed because of invalid parameters
- * - ESP_FAIL: Set RGB for a specific pixel failed because other error occurred
- */
- esp_err_t (*set_pixel)(led_strip_t *strip, uint32_t index, uint32_t red, uint32_t green, uint32_t blue);
-
- /**
- * @brief Refresh memory colors to LEDs
- *
- * @param strip: LED strip
- * @param timeout_ms: timeout value for refreshing task
- *
- * @return
- * - ESP_OK: Refresh successfully
- * - ESP_ERR_TIMEOUT: Refresh failed because of timeout
- * - ESP_FAIL: Refresh failed because some other error occurred
- *
- * @note:
- * After updating the LED colors in the memory, a following invocation of this API is needed to flush colors to strip.
- */
- esp_err_t (*refresh)(led_strip_t *strip, uint32_t timeout_ms);
-
- /**
- * @brief Clear LED strip (turn off all LEDs)
- *
- * @param strip: LED strip
- * @param timeout_ms: timeout value for clearing task
- *
- * @return
- * - ESP_OK: Clear LEDs successfully
- * - ESP_ERR_TIMEOUT: Clear LEDs failed because of timeout
- * - ESP_FAIL: Clear LEDs failed because some other error occurred
- */
- esp_err_t (*clear)(led_strip_t *strip, uint32_t timeout_ms);
-
- /**
- * @brief Free LED strip resources
- *
- * @param strip: LED strip
- *
- * @return
- * - ESP_OK: Free resources successfully
- * - ESP_FAIL: Free resources failed because error occurred
- */
- esp_err_t (*del)(led_strip_t *strip);
-};
-
-/**
-* @brief LED Strip Configuration Type
-*
-*/
-typedef struct {
- uint32_t max_leds; /*!< Maximum LEDs in a single strip */
- led_strip_dev_t dev; /*!< LED strip device (e.g. RMT channel, PWM channel, etc) */
-} led_strip_config_t;
-
-/**
- * @brief Default configuration for LED strip
- *
- */
-#define LED_STRIP_DEFAULT_CONFIG(number, dev_hdl) \
- { \
- .max_leds = number, \
- .dev = dev_hdl, \
- }
-
-/**
-* @brief Install a new ws2812 driver (based on RMT peripheral)
-*
-* @param config: LED strip configuration
-* @return
-* LED strip instance or NULL
-*/
-led_strip_t *led_strip_new_rmt_ws2812(const led_strip_config_t *config);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/tinyusb/hw/bsp/esp32s3/components/led_strip/src/led_strip_rmt_ws2812.c b/tinyusb/hw/bsp/esp32s3/components/led_strip/src/led_strip_rmt_ws2812.c
deleted file mode 100755
index 025d3c59..00000000
--- a/tinyusb/hw/bsp/esp32s3/components/led_strip/src/led_strip_rmt_ws2812.c
+++ /dev/null
@@ -1,171 +0,0 @@
-// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-#include <stdlib.h>
-#include <string.h>
-#include <sys/cdefs.h>
-#include "esp_log.h"
-#include "esp_attr.h"
-#include "led_strip.h"
-#include "driver/rmt.h"
-
-static const char *TAG = "ws2812";
-#define STRIP_CHECK(a, str, goto_tag, ret_value, ...) \
- do \
- { \
- if (!(a)) \
- { \
- ESP_LOGE(TAG, "%s(%d): " str, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
- ret = ret_value; \
- goto goto_tag; \
- } \
- } while (0)
-
-#define WS2812_T0H_NS (350)
-#define WS2812_T0L_NS (1000)
-#define WS2812_T1H_NS (1000)
-#define WS2812_T1L_NS (350)
-#define WS2812_RESET_US (280)
-
-static uint32_t ws2812_t0h_ticks = 0;
-static uint32_t ws2812_t1h_ticks = 0;
-static uint32_t ws2812_t0l_ticks = 0;
-static uint32_t ws2812_t1l_ticks = 0;
-
-typedef struct {
- led_strip_t parent;
- rmt_channel_t rmt_channel;
- uint32_t strip_len;
- uint8_t buffer[0];
-} ws2812_t;
-
-/**
- * @brief Conver RGB data to RMT format.
- *
- * @note For WS2812, R,G,B each contains 256 different choices (i.e. uint8_t)
- *
- * @param[in] src: source data, to converted to RMT format
- * @param[in] dest: place where to store the convert result
- * @param[in] src_size: size of source data
- * @param[in] wanted_num: number of RMT items that want to get
- * @param[out] translated_size: number of source data that got converted
- * @param[out] item_num: number of RMT items which are converted from source data
- */
-static void IRAM_ATTR ws2812_rmt_adapter(const void *src, rmt_item32_t *dest, size_t src_size,
- size_t wanted_num, size_t *translated_size, size_t *item_num)
-{
- if (src == NULL || dest == NULL) {
- *translated_size = 0;
- *item_num = 0;
- return;
- }
- const rmt_item32_t bit0 = {{{ ws2812_t0h_ticks, 1, ws2812_t0l_ticks, 0 }}}; //Logical 0
- const rmt_item32_t bit1 = {{{ ws2812_t1h_ticks, 1, ws2812_t1l_ticks, 0 }}}; //Logical 1
- size_t size = 0;
- size_t num = 0;
- uint8_t *psrc = (uint8_t *)src;
- rmt_item32_t *pdest = dest;
- while (size < src_size && num < wanted_num) {
- for (int i = 0; i < 8; i++) {
- // MSB first
- if (*psrc & (1 << (7 - i))) {
- pdest->val = bit1.val;
- } else {
- pdest->val = bit0.val;
- }
- num++;
- pdest++;
- }
- size++;
- psrc++;
- }
- *translated_size = size;
- *item_num = num;
-}
-
-static esp_err_t ws2812_set_pixel(led_strip_t *strip, uint32_t index, uint32_t red, uint32_t green, uint32_t blue)
-{
- esp_err_t ret = ESP_OK;
- ws2812_t *ws2812 = __containerof(strip, ws2812_t, parent);
- STRIP_CHECK(index < ws2812->strip_len, "index out of the maximum number of leds", err, ESP_ERR_INVALID_ARG);
- uint32_t start = index * 3;
- // In thr order of GRB
- ws2812->buffer[start + 0] = green & 0xFF;
- ws2812->buffer[start + 1] = red & 0xFF;
- ws2812->buffer[start + 2] = blue & 0xFF;
- return ESP_OK;
-err:
- return ret;
-}
-
-static esp_err_t ws2812_refresh(led_strip_t *strip, uint32_t timeout_ms)
-{
- esp_err_t ret = ESP_OK;
- ws2812_t *ws2812 = __containerof(strip, ws2812_t, parent);
- STRIP_CHECK(rmt_write_sample(ws2812->rmt_channel, ws2812->buffer, ws2812->strip_len * 3, true) == ESP_OK,
- "transmit RMT samples failed", err, ESP_FAIL);
- return rmt_wait_tx_done(ws2812->rmt_channel, pdMS_TO_TICKS(timeout_ms));
-err:
- return ret;
-}
-
-static esp_err_t ws2812_clear(led_strip_t *strip, uint32_t timeout_ms)
-{
- ws2812_t *ws2812 = __containerof(strip, ws2812_t, parent);
- // Write zero to turn off all leds
- memset(ws2812->buffer, 0, ws2812->strip_len * 3);
- return ws2812_refresh(strip, timeout_ms);
-}
-
-static esp_err_t ws2812_del(led_strip_t *strip)
-{
- ws2812_t *ws2812 = __containerof(strip, ws2812_t, parent);
- free(ws2812);
- return ESP_OK;
-}
-
-led_strip_t *led_strip_new_rmt_ws2812(const led_strip_config_t *config)
-{
- led_strip_t *ret = NULL;
- STRIP_CHECK(config, "configuration can't be null", err, NULL);
-
- // 24 bits per led
- uint32_t ws2812_size = sizeof(ws2812_t) + config->max_leds * 3;
- ws2812_t *ws2812 = calloc(1, ws2812_size);
- STRIP_CHECK(ws2812, "request memory for ws2812 failed", err, NULL);
-
- uint32_t counter_clk_hz = 0;
- STRIP_CHECK(rmt_get_counter_clock((rmt_channel_t)config->dev, &counter_clk_hz) == ESP_OK,
- "get rmt counter clock failed", err, NULL);
- // ns -> ticks
- float ratio = (float)counter_clk_hz / 1e9;
- ws2812_t0h_ticks = (uint32_t)(ratio * WS2812_T0H_NS);
- ws2812_t0l_ticks = (uint32_t)(ratio * WS2812_T0L_NS);
- ws2812_t1h_ticks = (uint32_t)(ratio * WS2812_T1H_NS);
- ws2812_t1l_ticks = (uint32_t)(ratio * WS2812_T1L_NS);
-
- // set ws2812 to rmt adapter
- rmt_translator_init((rmt_channel_t)config->dev, ws2812_rmt_adapter);
-
- ws2812->rmt_channel = (rmt_channel_t)config->dev;
- ws2812->strip_len = config->max_leds;
-
- ws2812->parent.set_pixel = ws2812_set_pixel;
- ws2812->parent.refresh = ws2812_refresh;
- ws2812->parent.clear = ws2812_clear;
- ws2812->parent.del = ws2812_del;
-
- return &ws2812->parent;
-err:
- return ret;
-}
diff --git a/tinyusb/hw/bsp/esp32s3/family.cmake b/tinyusb/hw/bsp/esp32s3/family.cmake
deleted file mode 100755
index 511dd58b..00000000
--- a/tinyusb/hw/bsp/esp32s3/family.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-# Add example src and bsp directories
-set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s3/boards" "${TOP}/hw/bsp/esp32s3/components")
-include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-set(SUPPORTED_TARGETS esp32s3)
-set(FAMILY_MCUS ESP32S3)
diff --git a/tinyusb/hw/bsp/esp32s3/family.mk b/tinyusb/hw/bsp/esp32s3/family.mk
deleted file mode 100755
index cf153ffc..00000000
--- a/tinyusb/hw/bsp/esp32s3/family.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-#DEPS_SUBMODULES +=
-
-.PHONY: all clean flash bootloader-flash app-flash erase monitor dfu-flash dfu
-
-all:
- idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) -DIDF_TARGET=esp32s3 build
-
-build: all
-
-clean:
- idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) clean
-
-fullclean:
- if test -f sdkconfig; then $(RM) -f sdkconfig ; fi
- if test -d $(BUILD); then $(RM) -rf $(BUILD) ; fi
-
-flash bootloader-flash app-flash erase monitor dfu-flash dfu:
- idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) $@
-
-uf2: $(BUILD)/$(PROJECT).uf2
-
-UF2_FAMILY_ID = 0xc47e5767
-$(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).bin
- @echo CREATE $@
- $(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -b 0x0 -c -o $@ $^
-
diff --git a/tinyusb/hw/bsp/family_support.cmake b/tinyusb/hw/bsp/family_support.cmake
deleted file mode 100755
index af0e00b2..00000000
--- a/tinyusb/hw/bsp/family_support.cmake
+++ /dev/null
@@ -1,71 +0,0 @@
-if (NOT TARGET _family_support_marker)
- add_library(_family_support_marker INTERFACE)
-
- if (NOT FAMILY)
- message(FATAL_ERROR "You must set a FAMILY variable for the build (e.g. rp2040, eps32s2, esp32s3). You can do this via -DFAMILY=xxx on the camke command line")
- endif()
-
- if (NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/${FAMILY}/family.cmake)
- message(FATAL_ERROR "Family '${FAMILY}' is not known/supported")
- endif()
-
- function(family_filter RESULT DIR)
- get_filename_component(DIR ${DIR} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
- file(GLOB ONLYS "${DIR}/.only.MCU_*")
- if (ONLYS)
- foreach(MCU IN LISTS FAMILY_MCUS)
- if (EXISTS ${DIR}/.only.MCU_${MCU})
- set(${RESULT} 1 PARENT_SCOPE)
- return()
- endif()
- endforeach()
- else()
- foreach(MCU IN LISTS FAMILY_MCUS)
- if (EXISTS ${DIR}/.skip.MCU_${MCU})
- set(${RESULT} 0 PARENT_SCOPE)
- return()
- endif()
- endforeach()
- endif()
- set(${RESULT} 1 PARENT_SCOPE)
- endfunction()
-
- function(family_add_subdirectory DIR)
- family_filter(SHOULD_ADD "${DIR}")
- if (SHOULD_ADD)
- add_subdirectory(${DIR})
- endif()
- endfunction()
-
- function(family_get_project_name OUTPUT_NAME DIR)
- get_filename_component(SHORT_NAME ${DIR} NAME)
- set(${OUTPUT_NAME} ${TINYUSB_FAMILY_PROJECT_NAME_PREFIX}${SHORT_NAME} PARENT_SCOPE)
- endfunction()
-
- function(family_initialize_project PROJECT DIR)
- family_filter(ALLOWED "${DIR}")
- if (NOT ALLOWED)
- get_filename_component(SHORT_NAME ${DIR} NAME)
- message(FATAL_ERROR "${SHORT_NAME} is not supported on FAMILY=${FAMILY}")
- endif()
- endfunction()
-
- # configure an executable target to link to tinyusb in device mode, and add the board implementation
- function(family_configure_device_example TARGET)
- # default implentation is empty, the function should be redefined in the FAMILY/family.cmake
- endfunction()
-
- # configure an executable target to link to tinyusb in host mode, and add the board implementation
- function(family_configure_host_example TARGET)
- # default implentation is empty, the function should be redefined in the FAMILY/family.cmake
- endfunction()
-
- include(${CMAKE_CURRENT_LIST_DIR}/${FAMILY}/family.cmake)
-
- if (NOT FAMILY_MCUS)
- set(FAMILY_MCUS ${FAMILY})
- endif()
-
- # save it in case of re-inclusion
- set(FAMILY_MCUS ${FAMILY_MCUS} CACHE INTERNAL "")
-endif() \ No newline at end of file
diff --git a/tinyusb/hw/bsp/fomu/boards/fomu/board.h b/tinyusb/hw/bsp/fomu/boards/fomu/board.h
deleted file mode 100755
index 666ba1d9..00000000
--- a/tinyusb/hw/bsp/fomu/boards/fomu/board.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// Place holder only
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/fomu/boards/fomu/board.mk b/tinyusb/hw/bsp/fomu/boards/fomu/board.mk
deleted file mode 100755
index 8ced1141..00000000
--- a/tinyusb/hw/bsp/fomu/boards/fomu/board.mk
+++ /dev/null
@@ -1 +0,0 @@
-# place holder \ No newline at end of file
diff --git a/tinyusb/hw/bsp/fomu/crt0-vexriscv.S b/tinyusb/hw/bsp/fomu/crt0-vexriscv.S
deleted file mode 100755
index d80a29e0..00000000
--- a/tinyusb/hw/bsp/fomu/crt0-vexriscv.S
+++ /dev/null
@@ -1,83 +0,0 @@
-.global main
-.global isr
-
-.section .text.start
-.global _start
-
-_start:
- j crt_init
-
-.section .text
-.global trap_entry
-trap_entry:
- sw x1, - 1*4(sp)
- sw x5, - 2*4(sp)
- sw x6, - 3*4(sp)
- sw x7, - 4*4(sp)
- sw x10, - 5*4(sp)
- sw x11, - 6*4(sp)
- sw x12, - 7*4(sp)
- sw x13, - 8*4(sp)
- sw x14, - 9*4(sp)
- sw x15, -10*4(sp)
- sw x16, -11*4(sp)
- sw x17, -12*4(sp)
- sw x28, -13*4(sp)
- sw x29, -14*4(sp)
- sw x30, -15*4(sp)
- sw x31, -16*4(sp)
- addi sp,sp,-16*4
- call isr
- lw x1 , 15*4(sp)
- lw x5, 14*4(sp)
- lw x6, 13*4(sp)
- lw x7, 12*4(sp)
- lw x10, 11*4(sp)
- lw x11, 10*4(sp)
- lw x12, 9*4(sp)
- lw x13, 8*4(sp)
- lw x14, 7*4(sp)
- lw x15, 6*4(sp)
- lw x16, 5*4(sp)
- lw x17, 4*4(sp)
- lw x28, 3*4(sp)
- lw x29, 2*4(sp)
- lw x30, 1*4(sp)
- lw x31, 0*4(sp)
- addi sp,sp,16*4
- mret
-
-.text
-crt_init:
- la sp, _estack - 4
- la a0, trap_entry
- csrw mtvec, a0
-
-bss_init:
- la a0, _sbss
- la a1, _ebss + 4
-bss_loop:
- beq a0,a1,bss_done
- sw zero,0(a0)
- add a0,a0,4
- j bss_loop
-bss_done:
-
- /* Load DATA */
- la t0, _etext
- la t1, _srelocate
- la t2, _erelocate + 4
-3:
- lw t3, 0(t0)
- sw t3, 0(t1)
- /* _edata is aligned to 4 bytes. Use word-xfers. */
- addi t0, t0, 4
- addi t1, t1, 4
- bltu t1, t2, 3b
-
- li a0, 0x880 //880 enable timer + external interrupt sources (until mstatus.MIE is set, they will never trigger an interrupt)
- csrw mie,a0
-
- call main
-infinite_loop:
- j infinite_loop
diff --git a/tinyusb/hw/bsp/fomu/dfu.py b/tinyusb/hw/bsp/fomu/dfu.py
deleted file mode 100755
index 32479350..00000000
--- a/tinyusb/hw/bsp/fomu/dfu.py
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/usr/bin/python
-
-# Written by Antonio Galea - 2010/11/18
-# Updated for DFU 1.1 by Sean Cross - 2020/03/31
-# Distributed under Gnu LGPL 3.0
-# see http://www.gnu.org/licenses/lgpl-3.0.txt
-
-import sys,struct,zlib,os
-from optparse import OptionParser
-
-DEFAULT_DEVICE="0x1209:0x5bf0"
-
-def named(tuple,names):
- return dict(zip(names.split(),tuple))
-def consume(fmt,data,names):
- n = struct.calcsize(fmt)
- return named(struct.unpack(fmt,data[:n]),names),data[n:]
-def cstring(string):
- return string.split('\0',1)[0]
-def compute_crc(data):
- return 0xFFFFFFFF & -zlib.crc32(data) -1
-
-def parse(file,dump_images=False):
- print ('File: "%s"' % file)
- data = open(file,'rb').read()
- crc = compute_crc(data[:-4])
- data = data[len(data)-16:]
- suffix = named(struct.unpack('<4H3sBI',data[:16]),'device product vendor dfu ufd len crc')
- print ('usb: %(vendor)04x:%(product)04x, device: 0x%(device)04x, dfu: 0x%(dfu)04x, %(ufd)s, %(len)d, 0x%(crc)08x' % suffix)
- if crc != suffix['crc']:
- print ("CRC ERROR: computed crc32 is 0x%08x" % crc)
- data = data[16:]
- if data:
- print ("PARSE ERROR")
-
-def build(file,data,device=DEFAULT_DEVICE):
- # Parse the VID and PID from the `device` argument
- v,d=map(lambda x: int(x,0) & 0xFFFF, device.split(':',1))
-
- # Generate the DFU suffix, consisting of these fields:
- # Field name | Length | Description
- # ================+=========+================================
- # bcdDevice | 2 | The release number of this firmware (0xffff - don't care)
- # idProduct | 2 | PID of this device
- # idVendor | 2 | VID of this device
- # bcdDFU | 2 | Version of this DFU spec (0x01 0x00)
- # ucDfuSignature | 3 | The characters 'DFU', printed in reverse order
- # bLength | 1 | The length of this suffix (16 bytes)
- # dwCRC | 4 | A CRC32 of the data, including this suffix
- data += struct.pack('<4H3sB',0xffff,d,v,0x0100,b'UFD',16)
- crc = compute_crc(data)
- # Append the CRC32 of the entire block
- data += struct.pack('<I',crc)
- open(file,'wb').write(data)
-
-if __name__=="__main__":
- usage = """
-%prog [-d|--dump] infile.dfu
-%prog {-b|--build} file.bin [{-D|--device}=vendor:device] outfile.dfu"""
- parser = OptionParser(usage=usage)
- parser.add_option("-b", "--build", action="store", dest="binfile",
- help="build a DFU file from given BINFILE", metavar="BINFILE")
- parser.add_option("-D", "--device", action="store", dest="device",
- help="build for DEVICE, defaults to %s" % DEFAULT_DEVICE, metavar="DEVICE")
- parser.add_option("-d", "--dump", action="store_true", dest="dump_images",
- default=False, help="dump contained images to current directory")
- (options, args) = parser.parse_args()
-
- if options.binfile and len(args)==1:
- binfile = options.binfile
- if not os.path.isfile(binfile):
- print ("Unreadable file '%s'." % binfile)
- sys.exit(1)
- target = open(binfile,'rb').read()
- outfile = args[0]
- device = DEFAULT_DEVICE
- # If a device is specified, parse the pair into a VID:PID pair
- # in order to validate them.
- if options.device:
- device=options.device
- try:
- v,d=map(lambda x: int(x,0) & 0xFFFF, device.split(':',1))
- except:
- print ("Invalid device '%s'." % device)
- sys.exit(1)
- build(outfile,target,device)
- elif len(args)==1:
- infile = args[0]
- if not os.path.isfile(infile):
- print ("Unreadable file '%s'." % infile)
- sys.exit(1)
- parse(infile, dump_images=options.dump_images)
- else:
- parser.print_help()
- sys.exit(1)
diff --git a/tinyusb/hw/bsp/fomu/family.mk b/tinyusb/hw/bsp/fomu/family.mk
deleted file mode 100755
index 165535c6..00000000
--- a/tinyusb/hw/bsp/fomu/family.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-CFLAGS += \
- -flto \
- -march=rv32i \
- -mabi=ilp32 \
- -nostdlib \
- -DCFG_TUSB_MCU=OPT_MCU_VALENTYUSB_EPTRI
-
-# Toolchain from https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack
-CROSS_COMPILE = riscv-none-embed-
-
-# All source paths should be relative to the top level.
-LD_FILE = $(FAMILY_PATH)/fomu.ld
-
-SRC_C += src/portable/valentyusb/eptri/dcd_eptri.c
-
-SRC_S += $(FAMILY_PATH)/crt0-vexriscv.S
-
-INC += \
- $(TOP)/$(FAMILY_PATH)/include
-
-# For freeRTOS port source
-FREERTOS_PORT = RISC-V
-
-# flash using dfu-util
-$(BUILD)/$(PROJECT).dfu: $(BUILD)/$(PROJECT).bin
- @echo "Create $@"
- python $(TOP)/hw/bsp/$(BOARD)/dfu.py -b $^ -D 0x1209:0x5bf0 $@
-
-flash: $(BUILD)/$(PROJECT).dfu
- dfu-util -D $^
diff --git a/tinyusb/hw/bsp/fomu/fomu.c b/tinyusb/hw/bsp/fomu/fomu.c
deleted file mode 100755
index 25e5e961..00000000
--- a/tinyusb/hw/bsp/fomu/fomu.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include <stdint.h>
-#include <stdbool.h>
-#include "../board.h"
-#include "csr.h"
-#include "irq.h"
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void fomu_error(uint32_t line)
-{
- (void)line;
- TU_BREAKPOINT();
-}
-
-volatile uint32_t system_ticks = 0;
-static void timer_init(void)
-{
- int t;
-
- timer0_en_write(0);
- t = CONFIG_CLOCK_FREQUENCY / 1000; // 1000 kHz tick
- timer0_reload_write(t);
- timer0_load_write(t);
- timer0_en_write(1);
- timer0_ev_enable_write(1);
- timer0_ev_pending_write(1);
- irq_setmask(irq_getmask() | (1 << TIMER0_INTERRUPT));
-}
-
-void isr(void)
-{
- unsigned int irqs;
-
- irqs = irq_pending() & irq_getmask();
-
-#if CFG_TUSB_RHPORT0_MODE == OPT_MODE_DEVICE
- if (irqs & (1 << USB_INTERRUPT)) {
- tud_int_handler(0);
- }
-#endif
- if (irqs & (1 << TIMER0_INTERRUPT)) {
- system_ticks++;
- timer0_ev_pending_write(1);
- }
-}
-
-void board_init(void)
-{
- irq_setmask(0);
- irq_setie(1);
- timer_init();
- return;
-}
-
-void board_led_write(bool state)
-{
- rgb_ctrl_write(0xff);
- rgb_raw_write(state);
-}
-
-uint32_t board_button_read(void)
-{
- return 0;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf;
- (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- int32_t offset = 0;
- for (offset = 0; offset < len; offset++)
- if (! (messible_status_read() & CSR_MESSIBLE_STATUS_FULL_OFFSET))
- messible_in_write(((uint8_t *)buf)[offset]);
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/fomu/fomu.ld b/tinyusb/hw/bsp/fomu/fomu.ld
deleted file mode 100755
index 13278d2a..00000000
--- a/tinyusb/hw/bsp/fomu/fomu.ld
+++ /dev/null
@@ -1,104 +0,0 @@
-OUTPUT_FORMAT("elf32-littleriscv")
-ENTRY(_start)
-
-__DYNAMIC = 0;
-
-MEMORY {
- csr : ORIGIN = 0x60000000, LENGTH = 0x01000000
- vexriscv_debug : ORIGIN = 0xf00f0000, LENGTH = 0x00000100
- ram : ORIGIN = 0x10000000, LENGTH = 0x00020000
- rom : ORIGIN = 0x20040000, LENGTH = 0x00200000 - 0x40000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _ftext = .;
- *(.text.start)
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
- } > rom
-
- . = ALIGN(4);
- _etext = .; /* End of text section */
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(.sbss .sbss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/fomu/include/csr.h b/tinyusb/hw/bsp/fomu/include/csr.h
deleted file mode 100755
index a2f60ecf..00000000
--- a/tinyusb/hw/bsp/fomu/include/csr.h
+++ /dev/null
@@ -1,750 +0,0 @@
-//--------------------------------------------------------------------------------
-// Auto-generated by Migen (f4fcd10) & LiteX (1425a68d) on 2019-11-12 19:41:49
-//--------------------------------------------------------------------------------
-#ifndef __GENERATED_CSR_H
-#define __GENERATED_CSR_H
-#include <stdint.h>
-#ifdef CSR_ACCESSORS_DEFINED
-extern void csr_writeb(uint8_t value, unsigned long addr);
-extern uint8_t csr_readb(unsigned long addr);
-extern void csr_writew(uint16_t value, unsigned long addr);
-extern uint16_t csr_readw(unsigned long addr);
-extern void csr_writel(uint32_t value, unsigned long addr);
-extern uint32_t csr_readl(unsigned long addr);
-#else /* ! CSR_ACCESSORS_DEFINED */
-#include <hw/common.h>
-#endif /* ! CSR_ACCESSORS_DEFINED */
-
-/* ctrl */
-#define CSR_CTRL_BASE 0xe0000000L
-#define CSR_CTRL_RESET_ADDR 0xe0000000L
-#define CSR_CTRL_RESET_SIZE 1
-static inline unsigned char ctrl_reset_read(void) {
- unsigned char r = csr_readl(0xe0000000L);
- return r;
-}
-static inline void ctrl_reset_write(unsigned char value) {
- csr_writel(value, 0xe0000000L);
-}
-#define CSR_CTRL_SCRATCH_ADDR 0xe0000004L
-#define CSR_CTRL_SCRATCH_SIZE 4
-static inline unsigned int ctrl_scratch_read(void) {
- unsigned int r = csr_readl(0xe0000004L);
- r <<= 8;
- r |= csr_readl(0xe0000008L);
- r <<= 8;
- r |= csr_readl(0xe000000cL);
- r <<= 8;
- r |= csr_readl(0xe0000010L);
- return r;
-}
-static inline void ctrl_scratch_write(unsigned int value) {
- csr_writel(value >> 24, 0xe0000004L);
- csr_writel(value >> 16, 0xe0000008L);
- csr_writel(value >> 8, 0xe000000cL);
- csr_writel(value, 0xe0000010L);
-}
-#define CSR_CTRL_BUS_ERRORS_ADDR 0xe0000014L
-#define CSR_CTRL_BUS_ERRORS_SIZE 4
-static inline unsigned int ctrl_bus_errors_read(void) {
- unsigned int r = csr_readl(0xe0000014L);
- r <<= 8;
- r |= csr_readl(0xe0000018L);
- r <<= 8;
- r |= csr_readl(0xe000001cL);
- r <<= 8;
- r |= csr_readl(0xe0000020L);
- return r;
-}
-
-/* messible */
-#define CSR_MESSIBLE_BASE 0xe0008000L
-#define CSR_MESSIBLE_IN_ADDR 0xe0008000L
-#define CSR_MESSIBLE_IN_SIZE 1
-static inline unsigned char messible_in_read(void) {
- unsigned char r = csr_readl(0xe0008000L);
- return r;
-}
-static inline void messible_in_write(unsigned char value) {
- csr_writel(value, 0xe0008000L);
-}
-#define CSR_MESSIBLE_OUT_ADDR 0xe0008004L
-#define CSR_MESSIBLE_OUT_SIZE 1
-static inline unsigned char messible_out_read(void) {
- unsigned char r = csr_readl(0xe0008004L);
- return r;
-}
-#define CSR_MESSIBLE_STATUS_ADDR 0xe0008008L
-#define CSR_MESSIBLE_STATUS_SIZE 1
-static inline unsigned char messible_status_read(void) {
- unsigned char r = csr_readl(0xe0008008L);
- return r;
-}
-#define CSR_MESSIBLE_STATUS_FULL_OFFSET 0
-#define CSR_MESSIBLE_STATUS_FULL_SIZE 1
-#define CSR_MESSIBLE_STATUS_HAVE_OFFSET 1
-#define CSR_MESSIBLE_STATUS_HAVE_SIZE 1
-
-/* picorvspi */
-#define CSR_PICORVSPI_BASE 0xe0005000L
-#define CSR_PICORVSPI_CFG1_ADDR 0xe0005000L
-#define CSR_PICORVSPI_CFG1_SIZE 1
-static inline unsigned char picorvspi_cfg1_read(void) {
- unsigned char r = csr_readl(0xe0005000L);
- return r;
-}
-static inline void picorvspi_cfg1_write(unsigned char value) {
- csr_writel(value, 0xe0005000L);
-}
-#define CSR_PICORVSPI_CFG1_BB_OUT_OFFSET 0
-#define CSR_PICORVSPI_CFG1_BB_OUT_SIZE 4
-#define CSR_PICORVSPI_CFG1_BB_CLK_OFFSET 4
-#define CSR_PICORVSPI_CFG1_BB_CLK_SIZE 1
-#define CSR_PICORVSPI_CFG1_BB_CS_OFFSET 5
-#define CSR_PICORVSPI_CFG1_BB_CS_SIZE 1
-#define CSR_PICORVSPI_CFG2_ADDR 0xe0005004L
-#define CSR_PICORVSPI_CFG2_SIZE 1
-static inline unsigned char picorvspi_cfg2_read(void) {
- unsigned char r = csr_readl(0xe0005004L);
- return r;
-}
-static inline void picorvspi_cfg2_write(unsigned char value) {
- csr_writel(value, 0xe0005004L);
-}
-#define CSR_PICORVSPI_CFG2_BB_OE_OFFSET 0
-#define CSR_PICORVSPI_CFG2_BB_OE_SIZE 4
-#define CSR_PICORVSPI_CFG3_ADDR 0xe0005008L
-#define CSR_PICORVSPI_CFG3_SIZE 1
-static inline unsigned char picorvspi_cfg3_read(void) {
- unsigned char r = csr_readl(0xe0005008L);
- return r;
-}
-static inline void picorvspi_cfg3_write(unsigned char value) {
- csr_writel(value, 0xe0005008L);
-}
-#define CSR_PICORVSPI_CFG3_RLAT_OFFSET 0
-#define CSR_PICORVSPI_CFG3_RLAT_SIZE 4
-#define CSR_PICORVSPI_CFG3_CRM_OFFSET 4
-#define CSR_PICORVSPI_CFG3_CRM_SIZE 1
-#define CSR_PICORVSPI_CFG3_QSPI_OFFSET 5
-#define CSR_PICORVSPI_CFG3_QSPI_SIZE 1
-#define CSR_PICORVSPI_CFG3_DDR_OFFSET 6
-#define CSR_PICORVSPI_CFG3_DDR_SIZE 1
-#define CSR_PICORVSPI_CFG4_ADDR 0xe000500cL
-#define CSR_PICORVSPI_CFG4_SIZE 1
-static inline unsigned char picorvspi_cfg4_read(void) {
- unsigned char r = csr_readl(0xe000500cL);
- return r;
-}
-static inline void picorvspi_cfg4_write(unsigned char value) {
- csr_writel(value, 0xe000500cL);
-}
-#define CSR_PICORVSPI_CFG4_MEMIO_OFFSET 7
-#define CSR_PICORVSPI_CFG4_MEMIO_SIZE 1
-#define CSR_PICORVSPI_STAT1_ADDR 0xe0005010L
-#define CSR_PICORVSPI_STAT1_SIZE 1
-static inline unsigned char picorvspi_stat1_read(void) {
- unsigned char r = csr_readl(0xe0005010L);
- return r;
-}
-#define CSR_PICORVSPI_STAT1_BB_IN_OFFSET 0
-#define CSR_PICORVSPI_STAT1_BB_IN_SIZE 4
-#define CSR_PICORVSPI_STAT2_ADDR 0xe0005014L
-#define CSR_PICORVSPI_STAT2_SIZE 1
-static inline unsigned char picorvspi_stat2_read(void) {
- unsigned char r = csr_readl(0xe0005014L);
- return r;
-}
-#define CSR_PICORVSPI_STAT3_ADDR 0xe0005018L
-#define CSR_PICORVSPI_STAT3_SIZE 1
-static inline unsigned char picorvspi_stat3_read(void) {
- unsigned char r = csr_readl(0xe0005018L);
- return r;
-}
-#define CSR_PICORVSPI_STAT4_ADDR 0xe000501cL
-#define CSR_PICORVSPI_STAT4_SIZE 1
-static inline unsigned char picorvspi_stat4_read(void) {
- unsigned char r = csr_readl(0xe000501cL);
- return r;
-}
-
-/* reboot */
-#define CSR_REBOOT_BASE 0xe0006000L
-#define CSR_REBOOT_CTRL_ADDR 0xe0006000L
-#define CSR_REBOOT_CTRL_SIZE 1
-static inline unsigned char reboot_ctrl_read(void) {
- unsigned char r = csr_readl(0xe0006000L);
- return r;
-}
-static inline void reboot_ctrl_write(unsigned char value) {
- csr_writel(value, 0xe0006000L);
-}
-#define CSR_REBOOT_CTRL_IMAGE_OFFSET 0
-#define CSR_REBOOT_CTRL_IMAGE_SIZE 2
-#define CSR_REBOOT_CTRL_KEY_OFFSET 2
-#define CSR_REBOOT_CTRL_KEY_SIZE 6
-#define CSR_REBOOT_ADDR_ADDR 0xe0006004L
-#define CSR_REBOOT_ADDR_SIZE 4
-static inline unsigned int reboot_addr_read(void) {
- unsigned int r = csr_readl(0xe0006004L);
- r <<= 8;
- r |= csr_readl(0xe0006008L);
- r <<= 8;
- r |= csr_readl(0xe000600cL);
- r <<= 8;
- r |= csr_readl(0xe0006010L);
- return r;
-}
-static inline void reboot_addr_write(unsigned int value) {
- csr_writel(value >> 24, 0xe0006004L);
- csr_writel(value >> 16, 0xe0006008L);
- csr_writel(value >> 8, 0xe000600cL);
- csr_writel(value, 0xe0006010L);
-}
-
-/* rgb */
-#define CSR_RGB_BASE 0xe0006800L
-#define CSR_RGB_DAT_ADDR 0xe0006800L
-#define CSR_RGB_DAT_SIZE 1
-static inline unsigned char rgb_dat_read(void) {
- unsigned char r = csr_readl(0xe0006800L);
- return r;
-}
-static inline void rgb_dat_write(unsigned char value) {
- csr_writel(value, 0xe0006800L);
-}
-#define CSR_RGB_ADDR_ADDR 0xe0006804L
-#define CSR_RGB_ADDR_SIZE 1
-static inline unsigned char rgb_addr_read(void) {
- unsigned char r = csr_readl(0xe0006804L);
- return r;
-}
-static inline void rgb_addr_write(unsigned char value) {
- csr_writel(value, 0xe0006804L);
-}
-#define CSR_RGB_CTRL_ADDR 0xe0006808L
-#define CSR_RGB_CTRL_SIZE 1
-static inline unsigned char rgb_ctrl_read(void) {
- unsigned char r = csr_readl(0xe0006808L);
- return r;
-}
-static inline void rgb_ctrl_write(unsigned char value) {
- csr_writel(value, 0xe0006808L);
-}
-#define CSR_RGB_CTRL_EXE_OFFSET 0
-#define CSR_RGB_CTRL_EXE_SIZE 1
-#define CSR_RGB_CTRL_CURREN_OFFSET 1
-#define CSR_RGB_CTRL_CURREN_SIZE 1
-#define CSR_RGB_CTRL_RGBLEDEN_OFFSET 2
-#define CSR_RGB_CTRL_RGBLEDEN_SIZE 1
-#define CSR_RGB_CTRL_RRAW_OFFSET 3
-#define CSR_RGB_CTRL_RRAW_SIZE 1
-#define CSR_RGB_CTRL_GRAW_OFFSET 4
-#define CSR_RGB_CTRL_GRAW_SIZE 1
-#define CSR_RGB_CTRL_BRAW_OFFSET 5
-#define CSR_RGB_CTRL_BRAW_SIZE 1
-#define CSR_RGB_RAW_ADDR 0xe000680cL
-#define CSR_RGB_RAW_SIZE 1
-static inline unsigned char rgb_raw_read(void) {
- unsigned char r = csr_readl(0xe000680cL);
- return r;
-}
-static inline void rgb_raw_write(unsigned char value) {
- csr_writel(value, 0xe000680cL);
-}
-#define CSR_RGB_RAW_R_OFFSET 0
-#define CSR_RGB_RAW_R_SIZE 1
-#define CSR_RGB_RAW_G_OFFSET 1
-#define CSR_RGB_RAW_G_SIZE 1
-#define CSR_RGB_RAW_B_OFFSET 2
-#define CSR_RGB_RAW_B_SIZE 1
-
-/* timer0 */
-#define CSR_TIMER0_BASE 0xe0002800L
-#define CSR_TIMER0_LOAD_ADDR 0xe0002800L
-#define CSR_TIMER0_LOAD_SIZE 4
-static inline unsigned int timer0_load_read(void) {
- unsigned int r = csr_readl(0xe0002800L);
- r <<= 8;
- r |= csr_readl(0xe0002804L);
- r <<= 8;
- r |= csr_readl(0xe0002808L);
- r <<= 8;
- r |= csr_readl(0xe000280cL);
- return r;
-}
-static inline void timer0_load_write(unsigned int value) {
- csr_writel(value >> 24, 0xe0002800L);
- csr_writel(value >> 16, 0xe0002804L);
- csr_writel(value >> 8, 0xe0002808L);
- csr_writel(value, 0xe000280cL);
-}
-#define CSR_TIMER0_RELOAD_ADDR 0xe0002810L
-#define CSR_TIMER0_RELOAD_SIZE 4
-static inline unsigned int timer0_reload_read(void) {
- unsigned int r = csr_readl(0xe0002810L);
- r <<= 8;
- r |= csr_readl(0xe0002814L);
- r <<= 8;
- r |= csr_readl(0xe0002818L);
- r <<= 8;
- r |= csr_readl(0xe000281cL);
- return r;
-}
-static inline void timer0_reload_write(unsigned int value) {
- csr_writel(value >> 24, 0xe0002810L);
- csr_writel(value >> 16, 0xe0002814L);
- csr_writel(value >> 8, 0xe0002818L);
- csr_writel(value, 0xe000281cL);
-}
-#define CSR_TIMER0_EN_ADDR 0xe0002820L
-#define CSR_TIMER0_EN_SIZE 1
-static inline unsigned char timer0_en_read(void) {
- unsigned char r = csr_readl(0xe0002820L);
- return r;
-}
-static inline void timer0_en_write(unsigned char value) {
- csr_writel(value, 0xe0002820L);
-}
-#define CSR_TIMER0_UPDATE_VALUE_ADDR 0xe0002824L
-#define CSR_TIMER0_UPDATE_VALUE_SIZE 1
-static inline unsigned char timer0_update_value_read(void) {
- unsigned char r = csr_readl(0xe0002824L);
- return r;
-}
-static inline void timer0_update_value_write(unsigned char value) {
- csr_writel(value, 0xe0002824L);
-}
-#define CSR_TIMER0_VALUE_ADDR 0xe0002828L
-#define CSR_TIMER0_VALUE_SIZE 4
-static inline unsigned int timer0_value_read(void) {
- unsigned int r = csr_readl(0xe0002828L);
- r <<= 8;
- r |= csr_readl(0xe000282cL);
- r <<= 8;
- r |= csr_readl(0xe0002830L);
- r <<= 8;
- r |= csr_readl(0xe0002834L);
- return r;
-}
-#define CSR_TIMER0_EV_STATUS_ADDR 0xe0002838L
-#define CSR_TIMER0_EV_STATUS_SIZE 1
-static inline unsigned char timer0_ev_status_read(void) {
- unsigned char r = csr_readl(0xe0002838L);
- return r;
-}
-static inline void timer0_ev_status_write(unsigned char value) {
- csr_writel(value, 0xe0002838L);
-}
-#define CSR_TIMER0_EV_PENDING_ADDR 0xe000283cL
-#define CSR_TIMER0_EV_PENDING_SIZE 1
-static inline unsigned char timer0_ev_pending_read(void) {
- unsigned char r = csr_readl(0xe000283cL);
- return r;
-}
-static inline void timer0_ev_pending_write(unsigned char value) {
- csr_writel(value, 0xe000283cL);
-}
-#define CSR_TIMER0_EV_ENABLE_ADDR 0xe0002840L
-#define CSR_TIMER0_EV_ENABLE_SIZE 1
-static inline unsigned char timer0_ev_enable_read(void) {
- unsigned char r = csr_readl(0xe0002840L);
- return r;
-}
-static inline void timer0_ev_enable_write(unsigned char value) {
- csr_writel(value, 0xe0002840L);
-}
-
-/* touch */
-#define CSR_TOUCH_BASE 0xe0005800L
-#define CSR_TOUCH_O_ADDR 0xe0005800L
-#define CSR_TOUCH_O_SIZE 1
-static inline unsigned char touch_o_read(void) {
- unsigned char r = csr_readl(0xe0005800L);
- return r;
-}
-static inline void touch_o_write(unsigned char value) {
- csr_writel(value, 0xe0005800L);
-}
-#define CSR_TOUCH_O_O_OFFSET 0
-#define CSR_TOUCH_O_O_SIZE 4
-#define CSR_TOUCH_OE_ADDR 0xe0005804L
-#define CSR_TOUCH_OE_SIZE 1
-static inline unsigned char touch_oe_read(void) {
- unsigned char r = csr_readl(0xe0005804L);
- return r;
-}
-static inline void touch_oe_write(unsigned char value) {
- csr_writel(value, 0xe0005804L);
-}
-#define CSR_TOUCH_OE_OE_OFFSET 0
-#define CSR_TOUCH_OE_OE_SIZE 4
-#define CSR_TOUCH_I_ADDR 0xe0005808L
-#define CSR_TOUCH_I_SIZE 1
-static inline unsigned char touch_i_read(void) {
- unsigned char r = csr_readl(0xe0005808L);
- return r;
-}
-#define CSR_TOUCH_I_I_OFFSET 0
-#define CSR_TOUCH_I_I_SIZE 4
-
-/* usb */
-#define CSR_USB_BASE 0xe0004800L
-#define CSR_USB_PULLUP_OUT_ADDR 0xe0004800L
-#define CSR_USB_PULLUP_OUT_SIZE 1
-static inline unsigned char usb_pullup_out_read(void) {
- unsigned char r = csr_readl(0xe0004800L);
- return r;
-}
-static inline void usb_pullup_out_write(unsigned char value) {
- csr_writel(value, 0xe0004800L);
-}
-#define CSR_USB_ADDRESS_ADDR 0xe0004804L
-#define CSR_USB_ADDRESS_SIZE 1
-static inline unsigned char usb_address_read(void) {
- unsigned char r = csr_readl(0xe0004804L);
- return r;
-}
-static inline void usb_address_write(unsigned char value) {
- csr_writel(value, 0xe0004804L);
-}
-#define CSR_USB_ADDRESS_ADDR_OFFSET 0
-#define CSR_USB_ADDRESS_ADDR_SIZE 7
-#define CSR_USB_NEXT_EV_ADDR 0xe0004808L
-#define CSR_USB_NEXT_EV_SIZE 1
-static inline unsigned char usb_next_ev_read(void) {
- unsigned char r = csr_readl(0xe0004808L);
- return r;
-}
-#define CSR_USB_NEXT_EV_IN_OFFSET 0
-#define CSR_USB_NEXT_EV_IN_SIZE 1
-#define CSR_USB_NEXT_EV_OUT_OFFSET 1
-#define CSR_USB_NEXT_EV_OUT_SIZE 1
-#define CSR_USB_NEXT_EV_SETUP_OFFSET 2
-#define CSR_USB_NEXT_EV_SETUP_SIZE 1
-#define CSR_USB_NEXT_EV_RESET_OFFSET 3
-#define CSR_USB_NEXT_EV_RESET_SIZE 1
-#define CSR_USB_SETUP_DATA_ADDR 0xe000480cL
-#define CSR_USB_SETUP_DATA_SIZE 1
-static inline unsigned char usb_setup_data_read(void) {
- unsigned char r = csr_readl(0xe000480cL);
- return r;
-}
-#define CSR_USB_SETUP_DATA_DATA_OFFSET 0
-#define CSR_USB_SETUP_DATA_DATA_SIZE 8
-#define CSR_USB_SETUP_CTRL_ADDR 0xe0004810L
-#define CSR_USB_SETUP_CTRL_SIZE 1
-static inline unsigned char usb_setup_ctrl_read(void) {
- unsigned char r = csr_readl(0xe0004810L);
- return r;
-}
-static inline void usb_setup_ctrl_write(unsigned char value) {
- csr_writel(value, 0xe0004810L);
-}
-#define CSR_USB_SETUP_CTRL_RESET_OFFSET 5
-#define CSR_USB_SETUP_CTRL_RESET_SIZE 1
-#define CSR_USB_SETUP_STATUS_ADDR 0xe0004814L
-#define CSR_USB_SETUP_STATUS_SIZE 1
-static inline unsigned char usb_setup_status_read(void) {
- unsigned char r = csr_readl(0xe0004814L);
- return r;
-}
-#define CSR_USB_SETUP_STATUS_EPNO_OFFSET 0
-#define CSR_USB_SETUP_STATUS_EPNO_SIZE 4
-#define CSR_USB_SETUP_STATUS_HAVE_OFFSET 4
-#define CSR_USB_SETUP_STATUS_HAVE_SIZE 1
-#define CSR_USB_SETUP_STATUS_PEND_OFFSET 5
-#define CSR_USB_SETUP_STATUS_PEND_SIZE 1
-#define CSR_USB_SETUP_STATUS_IS_IN_OFFSET 6
-#define CSR_USB_SETUP_STATUS_IS_IN_SIZE 1
-#define CSR_USB_SETUP_STATUS_DATA_OFFSET 7
-#define CSR_USB_SETUP_STATUS_DATA_SIZE 1
-#define CSR_USB_SETUP_EV_STATUS_ADDR 0xe0004818L
-#define CSR_USB_SETUP_EV_STATUS_SIZE 1
-static inline unsigned char usb_setup_ev_status_read(void) {
- unsigned char r = csr_readl(0xe0004818L);
- return r;
-}
-static inline void usb_setup_ev_status_write(unsigned char value) {
- csr_writel(value, 0xe0004818L);
-}
-#define CSR_USB_SETUP_EV_PENDING_ADDR 0xe000481cL
-#define CSR_USB_SETUP_EV_PENDING_SIZE 1
-static inline unsigned char usb_setup_ev_pending_read(void) {
- unsigned char r = csr_readl(0xe000481cL);
- return r;
-}
-static inline void usb_setup_ev_pending_write(unsigned char value) {
- csr_writel(value, 0xe000481cL);
-}
-#define CSR_USB_SETUP_EV_ENABLE_ADDR 0xe0004820L
-#define CSR_USB_SETUP_EV_ENABLE_SIZE 1
-static inline unsigned char usb_setup_ev_enable_read(void) {
- unsigned char r = csr_readl(0xe0004820L);
- return r;
-}
-static inline void usb_setup_ev_enable_write(unsigned char value) {
- csr_writel(value, 0xe0004820L);
-}
-#define CSR_USB_IN_DATA_ADDR 0xe0004824L
-#define CSR_USB_IN_DATA_SIZE 1
-static inline unsigned char usb_in_data_read(void) {
- unsigned char r = csr_readl(0xe0004824L);
- return r;
-}
-static inline void usb_in_data_write(unsigned char value) {
- csr_writel(value, 0xe0004824L);
-}
-#define CSR_USB_IN_DATA_DATA_OFFSET 0
-#define CSR_USB_IN_DATA_DATA_SIZE 8
-#define CSR_USB_IN_CTRL_ADDR 0xe0004828L
-#define CSR_USB_IN_CTRL_SIZE 1
-static inline unsigned char usb_in_ctrl_read(void) {
- unsigned char r = csr_readl(0xe0004828L);
- return r;
-}
-static inline void usb_in_ctrl_write(unsigned char value) {
- csr_writel(value, 0xe0004828L);
-}
-#define CSR_USB_IN_CTRL_EPNO_OFFSET 0
-#define CSR_USB_IN_CTRL_EPNO_SIZE 4
-#define CSR_USB_IN_CTRL_RESET_OFFSET 5
-#define CSR_USB_IN_CTRL_RESET_SIZE 1
-#define CSR_USB_IN_CTRL_STALL_OFFSET 6
-#define CSR_USB_IN_CTRL_STALL_SIZE 1
-#define CSR_USB_IN_STATUS_ADDR 0xe000482cL
-#define CSR_USB_IN_STATUS_SIZE 1
-static inline unsigned char usb_in_status_read(void) {
- unsigned char r = csr_readl(0xe000482cL);
- return r;
-}
-#define CSR_USB_IN_STATUS_IDLE_OFFSET 0
-#define CSR_USB_IN_STATUS_IDLE_SIZE 1
-#define CSR_USB_IN_STATUS_HAVE_OFFSET 4
-#define CSR_USB_IN_STATUS_HAVE_SIZE 1
-#define CSR_USB_IN_STATUS_PEND_OFFSET 5
-#define CSR_USB_IN_STATUS_PEND_SIZE 1
-#define CSR_USB_IN_EV_STATUS_ADDR 0xe0004830L
-#define CSR_USB_IN_EV_STATUS_SIZE 1
-static inline unsigned char usb_in_ev_status_read(void) {
- unsigned char r = csr_readl(0xe0004830L);
- return r;
-}
-static inline void usb_in_ev_status_write(unsigned char value) {
- csr_writel(value, 0xe0004830L);
-}
-#define CSR_USB_IN_EV_PENDING_ADDR 0xe0004834L
-#define CSR_USB_IN_EV_PENDING_SIZE 1
-static inline unsigned char usb_in_ev_pending_read(void) {
- unsigned char r = csr_readl(0xe0004834L);
- return r;
-}
-static inline void usb_in_ev_pending_write(unsigned char value) {
- csr_writel(value, 0xe0004834L);
-}
-#define CSR_USB_IN_EV_ENABLE_ADDR 0xe0004838L
-#define CSR_USB_IN_EV_ENABLE_SIZE 1
-static inline unsigned char usb_in_ev_enable_read(void) {
- unsigned char r = csr_readl(0xe0004838L);
- return r;
-}
-static inline void usb_in_ev_enable_write(unsigned char value) {
- csr_writel(value, 0xe0004838L);
-}
-#define CSR_USB_OUT_DATA_ADDR 0xe000483cL
-#define CSR_USB_OUT_DATA_SIZE 1
-static inline unsigned char usb_out_data_read(void) {
- unsigned char r = csr_readl(0xe000483cL);
- return r;
-}
-#define CSR_USB_OUT_DATA_DATA_OFFSET 0
-#define CSR_USB_OUT_DATA_DATA_SIZE 8
-#define CSR_USB_OUT_CTRL_ADDR 0xe0004840L
-#define CSR_USB_OUT_CTRL_SIZE 1
-static inline unsigned char usb_out_ctrl_read(void) {
- unsigned char r = csr_readl(0xe0004840L);
- return r;
-}
-static inline void usb_out_ctrl_write(unsigned char value) {
- csr_writel(value, 0xe0004840L);
-}
-#define CSR_USB_OUT_CTRL_EPNO_OFFSET 0
-#define CSR_USB_OUT_CTRL_EPNO_SIZE 4
-#define CSR_USB_OUT_CTRL_ENABLE_OFFSET 4
-#define CSR_USB_OUT_CTRL_ENABLE_SIZE 1
-#define CSR_USB_OUT_CTRL_RESET_OFFSET 5
-#define CSR_USB_OUT_CTRL_RESET_SIZE 1
-#define CSR_USB_OUT_CTRL_STALL_OFFSET 6
-#define CSR_USB_OUT_CTRL_STALL_SIZE 1
-#define CSR_USB_OUT_STATUS_ADDR 0xe0004844L
-#define CSR_USB_OUT_STATUS_SIZE 1
-static inline unsigned char usb_out_status_read(void) {
- unsigned char r = csr_readl(0xe0004844L);
- return r;
-}
-#define CSR_USB_OUT_STATUS_EPNO_OFFSET 0
-#define CSR_USB_OUT_STATUS_EPNO_SIZE 4
-#define CSR_USB_OUT_STATUS_HAVE_OFFSET 4
-#define CSR_USB_OUT_STATUS_HAVE_SIZE 1
-#define CSR_USB_OUT_STATUS_PEND_OFFSET 5
-#define CSR_USB_OUT_STATUS_PEND_SIZE 1
-#define CSR_USB_OUT_EV_STATUS_ADDR 0xe0004848L
-#define CSR_USB_OUT_EV_STATUS_SIZE 1
-static inline unsigned char usb_out_ev_status_read(void) {
- unsigned char r = csr_readl(0xe0004848L);
- return r;
-}
-static inline void usb_out_ev_status_write(unsigned char value) {
- csr_writel(value, 0xe0004848L);
-}
-#define CSR_USB_OUT_EV_PENDING_ADDR 0xe000484cL
-#define CSR_USB_OUT_EV_PENDING_SIZE 1
-static inline unsigned char usb_out_ev_pending_read(void) {
- unsigned char r = csr_readl(0xe000484cL);
- return r;
-}
-static inline void usb_out_ev_pending_write(unsigned char value) {
- csr_writel(value, 0xe000484cL);
-}
-#define CSR_USB_OUT_EV_ENABLE_ADDR 0xe0004850L
-#define CSR_USB_OUT_EV_ENABLE_SIZE 1
-static inline unsigned char usb_out_ev_enable_read(void) {
- unsigned char r = csr_readl(0xe0004850L);
- return r;
-}
-static inline void usb_out_ev_enable_write(unsigned char value) {
- csr_writel(value, 0xe0004850L);
-}
-#define CSR_USB_OUT_ENABLE_STATUS_ADDR 0xe0004854L
-#define CSR_USB_OUT_ENABLE_STATUS_SIZE 1
-static inline unsigned char usb_out_enable_status_read(void) {
- unsigned char r = csr_readl(0xe0004854L);
- return r;
-}
-#define CSR_USB_OUT_STALL_STATUS_ADDR 0xe0004858L
-#define CSR_USB_OUT_STALL_STATUS_SIZE 1
-static inline unsigned char usb_out_stall_status_read(void) {
- unsigned char r = csr_readl(0xe0004858L);
- return r;
-}
-
-/* version */
-#define CSR_VERSION_BASE 0xe0007000L
-#define CSR_VERSION_MAJOR_ADDR 0xe0007000L
-#define CSR_VERSION_MAJOR_SIZE 1
-static inline unsigned char version_major_read(void) {
- unsigned char r = csr_readl(0xe0007000L);
- return r;
-}
-#define CSR_VERSION_MINOR_ADDR 0xe0007004L
-#define CSR_VERSION_MINOR_SIZE 1
-static inline unsigned char version_minor_read(void) {
- unsigned char r = csr_readl(0xe0007004L);
- return r;
-}
-#define CSR_VERSION_REVISION_ADDR 0xe0007008L
-#define CSR_VERSION_REVISION_SIZE 1
-static inline unsigned char version_revision_read(void) {
- unsigned char r = csr_readl(0xe0007008L);
- return r;
-}
-#define CSR_VERSION_GITREV_ADDR 0xe000700cL
-#define CSR_VERSION_GITREV_SIZE 4
-static inline unsigned int version_gitrev_read(void) {
- unsigned int r = csr_readl(0xe000700cL);
- r <<= 8;
- r |= csr_readl(0xe0007010L);
- r <<= 8;
- r |= csr_readl(0xe0007014L);
- r <<= 8;
- r |= csr_readl(0xe0007018L);
- return r;
-}
-#define CSR_VERSION_GITEXTRA_ADDR 0xe000701cL
-#define CSR_VERSION_GITEXTRA_SIZE 2
-static inline unsigned short int version_gitextra_read(void) {
- unsigned short int r = csr_readl(0xe000701cL);
- r <<= 8;
- r |= csr_readl(0xe0007020L);
- return r;
-}
-#define CSR_VERSION_DIRTY_ADDR 0xe0007024L
-#define CSR_VERSION_DIRTY_SIZE 1
-static inline unsigned char version_dirty_read(void) {
- unsigned char r = csr_readl(0xe0007024L);
- return r;
-}
-#define CSR_VERSION_DIRTY_DIRTY_OFFSET 0
-#define CSR_VERSION_DIRTY_DIRTY_SIZE 1
-#define CSR_VERSION_MODEL_ADDR 0xe0007028L
-#define CSR_VERSION_MODEL_SIZE 1
-static inline unsigned char version_model_read(void) {
- unsigned char r = csr_readl(0xe0007028L);
- return r;
-}
-#define CSR_VERSION_MODEL_MODEL_OFFSET 0
-#define CSR_VERSION_MODEL_MODEL_SIZE 8
-#define CSR_VERSION_SEED_ADDR 0xe000702cL
-#define CSR_VERSION_SEED_SIZE 4
-static inline unsigned int version_seed_read(void) {
- unsigned int r = csr_readl(0xe000702cL);
- r <<= 8;
- r |= csr_readl(0xe0007030L);
- r <<= 8;
- r |= csr_readl(0xe0007034L);
- r <<= 8;
- r |= csr_readl(0xe0007038L);
- return r;
-}
-
-/* constants */
-#define TIMER0_INTERRUPT 2
-static inline int timer0_interrupt_read(void) {
- return 2;
-}
-#define USB_INTERRUPT 3
-static inline int usb_interrupt_read(void) {
- return 3;
-}
-#define CONFIG_BITSTREAM_SYNC_HEADER1 2123999870
-static inline int config_bitstream_sync_header1_read(void) {
- return 2123999870;
-}
-#define CONFIG_BITSTREAM_SYNC_HEADER2 2125109630
-static inline int config_bitstream_sync_header2_read(void) {
- return 2125109630;
-}
-#define CONFIG_CLOCK_FREQUENCY 12000000
-static inline int config_clock_frequency_read(void) {
- return 12000000;
-}
-#define CONFIG_CPU_RESET_ADDR 0
-static inline int config_cpu_reset_addr_read(void) {
- return 0;
-}
-#define CONFIG_CPU_TYPE "VEXRISCV"
-static inline const char * config_cpu_type_read(void) {
- return "VEXRISCV";
-}
-#define CONFIG_CPU_TYPE_VEXRISCV 1
-static inline int config_cpu_type_vexriscv_read(void) {
- return 1;
-}
-#define CONFIG_CPU_VARIANT "MIN"
-static inline const char * config_cpu_variant_read(void) {
- return "MIN";
-}
-#define CONFIG_CPU_VARIANT_MIN 1
-static inline int config_cpu_variant_min_read(void) {
- return 1;
-}
-#define CONFIG_CSR_ALIGNMENT 32
-static inline int config_csr_alignment_read(void) {
- return 32;
-}
-#define CONFIG_CSR_DATA_WIDTH 8
-static inline int config_csr_data_width_read(void) {
- return 8;
-}
-
-#endif
diff --git a/tinyusb/hw/bsp/fomu/include/hw/common.h b/tinyusb/hw/bsp/fomu/include/hw/common.h
deleted file mode 100755
index 6a97ca2e..00000000
--- a/tinyusb/hw/bsp/fomu/include/hw/common.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef _HW_COMMON_H_
-#define _HW_COMMON_H_
-#include <stdint.h>
-static inline void csr_writeb(uint8_t value, uint32_t addr)
-{
- *((volatile uint8_t *)addr) = value;
-}
-
-static inline uint8_t csr_readb(uint32_t addr)
-{
- return *(volatile uint8_t *)addr;
-}
-
-static inline void csr_writew(uint16_t value, uint32_t addr)
-{
- *((volatile uint16_t *)addr) = value;
-}
-
-static inline uint16_t csr_readw(uint32_t addr)
-{
- return *(volatile uint16_t *)addr;
-}
-
-static inline void csr_writel(uint32_t value, uint32_t addr)
-{
- *((volatile uint32_t *)addr) = value;
-}
-
-static inline uint32_t csr_readl(uint32_t addr)
-{
- return *(volatile uint32_t *)addr;
-}
-#endif /* _HW_COMMON_H_ */ \ No newline at end of file
diff --git a/tinyusb/hw/bsp/fomu/include/irq.h b/tinyusb/hw/bsp/fomu/include/irq.h
deleted file mode 100755
index a8221890..00000000
--- a/tinyusb/hw/bsp/fomu/include/irq.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifndef __IRQ_H
-#define __IRQ_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define CSR_MSTATUS_MIE 0x8
-
-#define CSR_IRQ_MASK 0xBC0
-#define CSR_IRQ_PENDING 0xFC0
-
-#define CSR_DCACHE_INFO 0xCC0
-
-#define csrr(reg) ({ unsigned long __tmp; \
- asm volatile ("csrr %0, " #reg : "=r"(__tmp)); \
- __tmp; })
-
-#define csrw(reg, val) ({ \
- if (__builtin_constant_p(val) && (unsigned long)(val) < 32) \
- asm volatile ("csrw " #reg ", %0" :: "i"(val)); \
- else \
- asm volatile ("csrw " #reg ", %0" :: "r"(val)); })
-
-#define csrs(reg, bit) ({ \
- if (__builtin_constant_p(bit) && (unsigned long)(bit) < 32) \
- asm volatile ("csrrs x0, " #reg ", %0" :: "i"(bit)); \
- else \
- asm volatile ("csrrs x0, " #reg ", %0" :: "r"(bit)); })
-
-#define csrc(reg, bit) ({ \
- if (__builtin_constant_p(bit) && (unsigned long)(bit) < 32) \
- asm volatile ("csrrc x0, " #reg ", %0" :: "i"(bit)); \
- else \
- asm volatile ("csrrc x0, " #reg ", %0" :: "r"(bit)); })
-
-static inline unsigned int irq_getie(void)
-{
- return (csrr(mstatus) & CSR_MSTATUS_MIE) != 0;
-}
-
-static inline void irq_setie(unsigned int ie)
-{
- if(ie) csrs(mstatus,CSR_MSTATUS_MIE); else csrc(mstatus,CSR_MSTATUS_MIE);
-}
-
-static inline unsigned int irq_getmask(void)
-{
- unsigned int mask;
- asm volatile ("csrr %0, %1" : "=r"(mask) : "i"(CSR_IRQ_MASK));
- return mask;
-}
-
-static inline void irq_setmask(unsigned int mask)
-{
- asm volatile ("csrw %0, %1" :: "i"(CSR_IRQ_MASK), "r"(mask));
-}
-
-static inline unsigned int irq_pending(void)
-{
- unsigned int pending;
- asm volatile ("csrr %0, %1" : "=r"(pending) : "i"(CSR_IRQ_PENDING));
- return pending;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __IRQ_H */ \ No newline at end of file
diff --git a/tinyusb/hw/bsp/fomu/output_format.ld b/tinyusb/hw/bsp/fomu/output_format.ld
deleted file mode 100755
index 5e76f5f4..00000000
--- a/tinyusb/hw/bsp/fomu/output_format.ld
+++ /dev/null
@@ -1 +0,0 @@
-OUTPUT_FORMAT("elf32-littleriscv")
diff --git a/tinyusb/hw/bsp/fomu/regions.ld b/tinyusb/hw/bsp/fomu/regions.ld
deleted file mode 100755
index 51811f66..00000000
--- a/tinyusb/hw/bsp/fomu/regions.ld
+++ /dev/null
@@ -1,6 +0,0 @@
-MEMORY {
- csr : ORIGIN = 0x60000000, LENGTH = 0x01000000
- vexriscv_debug : ORIGIN = 0xf00f0000, LENGTH = 0x00000100
- sram : ORIGIN = 0x10000000, LENGTH = 0x00020000
- rom : ORIGIN = 0x00000000, LENGTH = 0x00002000
-}
diff --git a/tinyusb/hw/bsp/frdm_k32l2b/board.h b/tinyusb/hw/bsp/frdm_k32l2b/board.h
deleted file mode 100755
index 82536791..00000000
--- a/tinyusb/hw/bsp/frdm_k32l2b/board.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#include "fsl_device_registers.h"
-
-// LED
-#define LED_PIN_CLOCK kCLOCK_PortD
-#define LED_GPIO GPIOD
-#define LED_PORT PORTD
-#define LED_PIN 5
-#define LED_STATE_ON 0
-
-// SW3 button1
-#define BUTTON_PIN_CLOCK kCLOCK_PortC
-#define BUTTON_GPIO GPIOC
-#define BUTTON_PORT PORTC
-#define BUTTON_PIN 3
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_PORT LPUART0
-#define UART_PIN_CLOCK kCLOCK_PortA
-#define UART_PIN_PORT PORTA
-#define UART_PIN_RX 1u
-#define UART_PIN_TX 2u
-#define SOPT5_LPUART0RXSRC_LPUART_RX 0x00u /*!<@brief LPUART0 Receive Data Source Select: LPUART_RX pin */
-#define SOPT5_LPUART0TXSRC_LPUART_TX 0x00u /*!<@brief LPUART0 Transmit Data Source Select: LPUART0_TX pin */
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/frdm_k32l2b/board.mk b/tinyusb/hw/bsp/frdm_k32l2b/board.mk
deleted file mode 100755
index 56df553d..00000000
--- a/tinyusb/hw/bsp/frdm_k32l2b/board.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-SDK_DIR = hw/mcu/nxp/mcux-sdk
-DEPS_SUBMODULES += $(SDK_DIR)
-
-CFLAGS += \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m0plus \
- -DCPU_K32L2B31VLH0A \
- -DCFG_TUSB_MCU=OPT_MCU_K32L2BXX
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter
-
-MCU_DIR = $(SDK_DIR)/devices/K32L2B31A
-
-# All source paths should be relative to the top level.
-LD_FILE = $(MCU_DIR)/gcc/K32L2B31xxxxA_flash.ld
-
-SRC_C += \
- src/portable/nxp/khci/dcd_khci.c \
- $(MCU_DIR)/system_K32L2B31A.c \
- $(MCU_DIR)/project_template/clock_config.c \
- $(MCU_DIR)/drivers/fsl_clock.c \
- $(SDK_DIR)/drivers/gpio/fsl_gpio.c \
- $(SDK_DIR)/drivers/lpuart/fsl_lpuart.c
-
-INC += \
- $(TOP)/hw/bsp/$(BOARD) \
- $(TOP)/$(SDK_DIR)/CMSIS/Include \
- $(TOP)/$(SDK_DIR)/drivers/smc \
- $(TOP)/$(SDK_DIR)/drivers/common \
- $(TOP)/$(SDK_DIR)/drivers/gpio \
- $(TOP)/$(SDK_DIR)/drivers/port \
- $(TOP)/$(SDK_DIR)/drivers/lpuart \
- $(TOP)/$(MCU_DIR) \
- $(TOP)/$(MCU_DIR)/drivers \
- $(TOP)/$(MCU_DIR)/project_template \
-
-SRC_S += $(MCU_DIR)/gcc/startup_K32L2B31A.S
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
-
-# For flash-jlink target
-JLINK_DEVICE = MKL25Z128xxx4
-
-# For flash-pyocd target
-PYOCD_TARGET = K32L2B
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/frdm_k32l2b/frdm_k32l2b.c b/tinyusb/hw/bsp/frdm_k32l2b/frdm_k32l2b.c
deleted file mode 100755
index c45095ca..00000000
--- a/tinyusb/hw/bsp/frdm_k32l2b/frdm_k32l2b.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018, hathach (tinyusb.org)
- * Copyright (c) 2020, Koji Kitayama
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "../board.h"
-#include "board.h"
-#include "fsl_gpio.h"
-#include "fsl_port.h"
-#include "fsl_clock.h"
-#include "fsl_lpuart.h"
-
-#include "clock_config.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB0_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-void board_init(void)
-{
- /* Enable port clocks for UART/LED/Button pins */
- CLOCK_EnableClock(UART_PIN_CLOCK);
- CLOCK_EnableClock(LED_PIN_CLOCK);
- CLOCK_EnableClock(BUTTON_PIN_CLOCK);
-
- gpio_pin_config_t led_config = { kGPIO_DigitalOutput, 0 };
- GPIO_PinInit(LED_GPIO, LED_PIN, &led_config);
- PORT_SetPinMux(LED_PORT, LED_PIN, kPORT_MuxAsGpio);
-
- gpio_pin_config_t button_config = { kGPIO_DigitalInput, 0 };
- GPIO_PinInit(BUTTON_GPIO, BUTTON_PIN, &button_config);
- const port_pin_config_t BUTTON_CFG = {
- kPORT_PullUp,
- kPORT_FastSlewRate,
- kPORT_PassiveFilterDisable,
- kPORT_LowDriveStrength,
- kPORT_MuxAsGpio
- };
- PORT_SetPinConfig(BUTTON_PORT, BUTTON_PIN, &BUTTON_CFG);
-
- /* PORTA1 (pin 23) is configured as LPUART0_RX */
- PORT_SetPinMux(PORTA, 1U, kPORT_MuxAlt2);
- /* PORTA2 (pin 24) is configured as LPUART0_TX */
- PORT_SetPinMux(PORTA, 2U, kPORT_MuxAlt2);
-
- SIM->SOPT5 = ((SIM->SOPT5 &
- /* Mask bits to zero which are setting */
- (~(SIM_SOPT5_LPUART0TXSRC_MASK | SIM_SOPT5_LPUART0RXSRC_MASK)))
- /* LPUART0 Transmit Data Source Select: LPUART0_TX pin. */
- | SIM_SOPT5_LPUART0TXSRC(SOPT5_LPUART0TXSRC_LPUART_TX)
- /* LPUART0 Receive Data Source Select: LPUART_RX pin. */
- | SIM_SOPT5_LPUART0RXSRC(SOPT5_LPUART0RXSRC_LPUART_RX));
-
- BOARD_BootClockRUN();
- SystemCoreClockUpdate();
- CLOCK_SetLpuart0Clock(1);
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- lpuart_config_t uart_config;
- LPUART_GetDefaultConfig(&uart_config);
- uart_config.baudRate_Bps = CFG_BOARD_UART_BAUDRATE;
- uart_config.enableTx = true;
- uart_config.enableRx = true;
- LPUART_Init(UART_PORT, &uart_config, CLOCK_GetFreq(kCLOCK_McgIrc48MClk));
-
- // USB
- CLOCK_EnableUsbfs0Clock(kCLOCK_UsbSrcIrc48M, 48000000U);
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- GPIO_PinWrite(LED_GPIO, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == GPIO_PinRead(BUTTON_GPIO, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- LPUART_ReadBlocking(UART_PORT, buf, len);
- return len;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- LPUART_WriteBlocking(UART_PORT, (uint8_t*)buf, len);
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler(void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/frdm_kl25z/board.mk b/tinyusb/hw/bsp/frdm_kl25z/board.mk
deleted file mode 100755
index 451bc37c..00000000
--- a/tinyusb/hw/bsp/frdm_kl25z/board.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-SDK_DIR = hw/mcu/nxp/nxp_sdk
-DEPS_SUBMODULES += $(SDK_DIR)
-
-CFLAGS += \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m0plus \
- -DCPU_MKL25Z128VLK4 \
- -DCFG_TUSB_MCU=OPT_MCU_MKL25ZXX
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter
-
-MCU_DIR = $(SDK_DIR)/devices/MKL25Z4
-
-# All source paths should be relative to the top level.
-LD_FILE = $(MCU_DIR)/gcc/MKL25Z128xxx4_flash.ld
-
-SRC_C += \
- src/portable/nxp/khci/dcd_khci.c \
- $(MCU_DIR)/system_MKL25Z4.c \
- $(MCU_DIR)/project_template/clock_config.c \
- $(MCU_DIR)/drivers/fsl_clock.c \
- $(MCU_DIR)/drivers/fsl_gpio.c \
- $(MCU_DIR)/drivers/fsl_lpsci.c
-
-INC += \
- $(TOP)/hw/bsp/$(BOARD) \
- $(TOP)/$(SDK_DIR)/CMSIS/Include \
- $(TOP)/$(MCU_DIR) \
- $(TOP)/$(MCU_DIR)/drivers \
- $(TOP)/$(MCU_DIR)/project_template \
-
-SRC_S += $(MCU_DIR)/gcc/startup_MKL25Z4.S
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
-
-# For flash-jlink target
-JLINK_DEVICE = MKL25Z128xxx4
-
-# For flash-pyocd target
-PYOCD_TARGET = mkl25zl128
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/frdm_kl25z/frdm_kl25z.c b/tinyusb/hw/bsp/frdm_kl25z/frdm_kl25z.c
deleted file mode 100755
index 7d3a173e..00000000
--- a/tinyusb/hw/bsp/frdm_kl25z/frdm_kl25z.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018, hathach (tinyusb.org)
- * Copyright (c) 2020, Koji Kitayama
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "../board.h"
-#include "fsl_device_registers.h"
-#include "fsl_gpio.h"
-#include "fsl_port.h"
-#include "fsl_clock.h"
-#include "fsl_lpsci.h"
-
-#include "clock_config.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB0_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-// LED
-#define LED_PINMUX IOMUXC_GPIO_AD_B0_09_GPIO1_IO09
-#define LED_PORT GPIOB
-#define LED_PIN_CLOCK kCLOCK_PortB
-#define LED_PIN_PORT PORTB
-#define LED_PIN 19U
-#define LED_PIN_FUNCTION kPORT_MuxAsGpio
-#define LED_STATE_ON 0
-
-// UART
-#define UART_PORT UART0
-#define UART_PIN_CLOCK kCLOCK_PortA
-#define UART_PIN_PORT PORTA
-#define UART_PIN_RX 1u
-#define UART_PIN_TX 2u
-#define UART_PIN_FUNCTION kPORT_MuxAlt2
-#define SOPT5_UART0RXSRC_UART_RX 0x00u /*!< UART0 receive data source select: UART0_RX pin */
-#define SOPT5_UART0TXSRC_UART_TX 0x00u /*!< UART0 transmit data source select: UART0_TX pin */
-
-const uint8_t dcd_data[] = { 0x00 };
-
-void board_init(void)
-{
- BOARD_BootClockRUN();
- SystemCoreClockUpdate();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- // LED
- CLOCK_EnableClock(LED_PIN_CLOCK);
- PORT_SetPinMux(LED_PIN_PORT, LED_PIN, LED_PIN_FUNCTION);
- gpio_pin_config_t led_config = { kGPIO_DigitalOutput, 0 };
- GPIO_PinInit(LED_PORT, LED_PIN, &led_config);
- board_led_write(true);
-
- // UART
- CLOCK_EnableClock(UART_PIN_CLOCK);
- PORT_SetPinMux(UART_PIN_PORT, UART_PIN_RX, UART_PIN_FUNCTION);
- PORT_SetPinMux(UART_PIN_PORT, UART_PIN_TX, UART_PIN_FUNCTION);
- SIM->SOPT5 = ((SIM->SOPT5 &
- (~(SIM_SOPT5_UART0TXSRC_MASK | SIM_SOPT5_UART0RXSRC_MASK)))
- | SIM_SOPT5_UART0TXSRC(SOPT5_UART0TXSRC_UART_TX)
- | SIM_SOPT5_UART0RXSRC(SOPT5_UART0RXSRC_UART_RX)
- );
-
- lpsci_config_t uart_config;
- CLOCK_SetLpsci0Clock(1);
- LPSCI_GetDefaultConfig(&uart_config);
- uart_config.baudRate_Bps = CFG_BOARD_UART_BAUDRATE;
- uart_config.enableTx = true;
- uart_config.enableRx = true;
- LPSCI_Init(UART_PORT, &uart_config, CLOCK_GetPllFllSelClkFreq());
-
- // USB
- CLOCK_EnableUsbfs0Clock(kCLOCK_UsbSrcPll0, CLOCK_GetFreq(kCLOCK_PllFllSelClk));
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- GPIO_WritePinOutput(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return 0;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- LPSCI_ReadBlocking(UART_PORT, buf, len);
- return len;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- LPSCI_WriteBlocking(UART_PORT, (uint8_t*)buf, len);
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler(void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/gd32vf103/boards/sipeed_longan_nano/board.h b/tinyusb/hw/bsp/gd32vf103/boards/sipeed_longan_nano/board.h
deleted file mode 100755
index fae7c40b..00000000
--- a/tinyusb/hw/bsp/gd32vf103/boards/sipeed_longan_nano/board.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _NUCLEI_SDK_HAL_H
-#define _NUCLEI_SDK_HAL_H
-
-#include "gd32vf103c_longan_nano.h"
-
-// 4 bits for interrupt level, 0 for priority.
-// level 0 = lowest priority, level 15 = highest priority.
-#define __ECLIC_INTCTLBITS 4
-
-#define __SYSTEM_CLOCK 72000000
-#define HXTAL_VALUE ((uint32_t)8000000)
-
-#define SOC_DEBUG_UART GD32_COM0
-
-#define DBG_KEY_UNLOCK 0x4B5A6978
-#define DBG_CMD_RESET 0x1
-#define DBG_KEY REG32(DBG + 0x0C)
-#define DBG_CMD REG32(DBG + 0x08)
-
-#endif
diff --git a/tinyusb/hw/bsp/gd32vf103/boards/sipeed_longan_nano/board.mk b/tinyusb/hw/bsp/gd32vf103/boards/sipeed_longan_nano/board.mk
deleted file mode 100755
index 3b894445..00000000
--- a/tinyusb/hw/bsp/gd32vf103/boards/sipeed_longan_nano/board.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-LONGAN_NANO_SDK_BSP = $(GD32VF103_SDK_SOC)/Board/gd32vf103c_longan_nano
-LINKER_SCRIPTS = $(LONGAN_NANO_SDK_BSP)/Source/GCC
-
-# All source paths should be relative to the top level.
-LD_FILE = $(LINKER_SCRIPTS)/gcc_gd32vf103xb_flashxip.ld # Longan Nano 128k ROM 32k RAM
-#LD_FILE = $(LINKER_SCRIPTS)/gcc_gd32vf103x8_flashxip.ld # Longan Nano Lite 64k ROM 20k RAM
-
-SRC_C += $(LONGAN_NANO_SDK_BSP)/Source/gd32vf103c_longan_nano.c
-INC += $(TOP)/$(LONGAN_NANO_SDK_BSP)/Include
-
-# Longan Nano 128k ROM 32k RAM
-JLINK_DEVICE = gd32vf103cbt6
-#JLINK_DEVICE = gd32vf103c8t6 # Longan Nano Lite 64k ROM 20k RAM
diff --git a/tinyusb/hw/bsp/gd32vf103/family.c b/tinyusb/hw/bsp/gd32vf103/family.c
deleted file mode 100755
index d76fb9a2..00000000
--- a/tinyusb/hw/bsp/gd32vf103/family.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "board.h"
-#include "drv_usb_hw.h"
-#include "drv_usb_dev.h"
-
-#include "../board.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-
-void USBFS_IRQHandler(void) { tud_int_handler(0); }
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-#define USB_NO_VBUS_PIN
-
-// According to GD32VF103 user manual clock tree:
-// Systick clock = AHB clock / 4.
-#define TIMER_TICKS ((SystemCoreClock / 4) / 1000)
-
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-#define UART_DEV SOC_DEBUG_UART
-
-#define LED_PIN LED_R
-
-void board_init(void) {
- /* Disable interrupts during init */
- __disable_irq();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- SysTick_Config(TIMER_TICKS);
-#endif
-
- rcu_periph_clock_enable(RCU_GPIOA);
- rcu_periph_clock_enable(RCU_GPIOB);
- rcu_periph_clock_enable(RCU_GPIOC);
- rcu_periph_clock_enable(RCU_GPIOD);
- rcu_periph_clock_enable(RCU_AF);
-
-#ifdef BUTTON_PIN
- gpio_init(BUTTON_PORT, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, BUTTON_PIN);
-#endif
-
-#ifdef LED_PIN
- gd_led_init(LED_PIN);
-#endif
-
-#if defined(UART_DEV)
- gd_com_init(UART_DEV);
-#endif
-
- /* USB D+ and D- pins don't need to be configured. */
- /* Configure VBUS Pin */
-#ifndef USB_NO_VBUS_PIN
- gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_9);
-#endif
-
- /* This for ID line debug */
- // gpio_init(GPIOA, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_10);
-
- /* Enable USB OTG clock */
- usb_rcu_config();
-
- /* Reset USB OTG peripheral */
- rcu_periph_reset_enable(RCU_USBFSRST);
- rcu_periph_reset_disable(RCU_USBFSRST);
-
- /* Configure USBFS IRQ */
- ECLIC_Register_IRQ(USBFS_IRQn, ECLIC_NON_VECTOR_INTERRUPT,
- ECLIC_POSTIVE_EDGE_TRIGGER, 3, 0, NULL);
-
- /* Retrieve otg core registers */
- usb_gr* otg_core_regs = (usb_gr*)(USBFS_REG_BASE + USB_REG_OFFSET_CORE);
-
-#ifdef USB_NO_VBUS_PIN
- /* Disable VBUS sense*/
- otg_core_regs->GCCFG |= GCCFG_VBUSIG | GCCFG_PWRON | GCCFG_VBUSBCEN;
-#else
- /* Enable VBUS sense via pin PA9 */
- otg_core_regs->GCCFG |= GCCFG_VBUSIG | GCCFG_PWRON | GCCFG_VBUSBCEN;
- otg_core_regs->GCCFG &= ~GCCFG_VBUSIG;
-#endif
-
- /* Enable interrupts globaly */
- __enable_irq();
-}
-
-void gd32vf103_reset(void) {
- /* The MTIMER unit of the GD32VF103 doesn't have the MSFRST
- * register to generate a software reset request.
- * BUT instead two undocumented registers in the debug peripheral
- * that allow issueing a software reset.
- * https://github.com/esmil/gd32vf103inator/blob/master/include/gd32vf103/dbg.h
- */
- DBG_KEY = DBG_KEY_UNLOCK;
- DBG_CMD = DBG_CMD_RESET;
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state) {
- state ? gd_led_on(LED_PIN) : gd_led_off(LED_PIN);
-}
-
-uint32_t board_button_read(void) {
- return BUTTON_STATE_ACTIVE == gpio_input_bit_get(BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len) {
-#if defined(UART_DEV)
- int rxsize = len;
- while (rxsize--) {
- *(uint8_t*)buf = usart_read(UART_DEV);
- buf++;
- }
- return len;
-#else
- (void)buf;
- (void)len;
- return 0;
-#endif
-}
-
-int board_uart_write(void const* buf, int len) {
-#if defined(UART_DEV)
- int txsize = len;
- while (txsize--) {
- usart_write(UART_DEV, *(uint8_t*)buf);
- buf++;
- }
- return len;
-#else
- (void)buf;
- (void)len;
- return 0;
-#endif
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void eclic_mtip_handler(void) {
- system_ticks++;
- SysTick_Reload(TIMER_TICKS);
-}
-uint32_t board_millis(void) { return system_ticks; }
-#endif
-
-#ifdef USE_FULL_ASSERT
-/**
- * @brief Reports the name of the source file and the source line number
- * where the assert_param error has occurred.
- * @param file: pointer to the source file name
- * @param line: assert_param error line source number
- * @retval None
- */
-void assert_failed(char* file, uint32_t line) {
- /* USER CODE BEGIN 6 */
- /* User can add his own implementation to report the file name and line
- number,
- tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line)
- */
- /* USER CODE END 6 */
-}
-#endif /* USE_FULL_ASSERT */
diff --git a/tinyusb/hw/bsp/gd32vf103/family.mk b/tinyusb/hw/bsp/gd32vf103/family.mk
deleted file mode 100755
index 9148e7f8..00000000
--- a/tinyusb/hw/bsp/gd32vf103/family.mk
+++ /dev/null
@@ -1,68 +0,0 @@
-# https://www.embecosm.com/resources/tool-chain-downloads/#riscv-stable
-#CROSS_COMPILE ?= riscv32-unknown-elf-
-
-# Toolchain from https://nucleisys.com/download.php
-#CROSS_COMPILE ?= riscv-nuclei-elf-
-
-# Toolchain from https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack
-CROSS_COMPILE ?= riscv-none-embed-
-
-# Submodules
-NUCLEI_SDK = hw/mcu/gd/nuclei-sdk
-DEPS_SUBMODULES += $(NUCLEI_SDK)
-
-# Nuclei-SDK paths
-GD32VF103_SDK_SOC = $(NUCLEI_SDK)/SoC/gd32vf103
-GD32VF103_SDK_DRIVER = $(GD32VF103_SDK_SOC)/Common/Source/Drivers
-LIBC_STUBS = $(GD32VF103_SDK_SOC)/Common/Source/Stubs
-STARTUP_ASM = $(GD32VF103_SDK_SOC)/Common/Source/GCC
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-SKIP_NANOLIB = 1
-
-CFLAGS += \
- -march=rv32imac \
- -mabi=ilp32 \
- -mcmodel=medlow \
- -mstrict-align \
- -nostdlib -nostartfiles \
- -DCFG_TUSB_MCU=OPT_MCU_GD32VF103 \
- -DDOWNLOAD_MODE=DOWNLOAD_MODE_FLASHXIP \
- -DGD32VF103
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter
-
-SRC_C += \
- src/portable/st/synopsys/dcd_synopsys.c \
- $(GD32VF103_SDK_DRIVER)/gd32vf103_rcu.c \
- $(GD32VF103_SDK_DRIVER)/gd32vf103_gpio.c \
- $(GD32VF103_SDK_DRIVER)/Usb/gd32vf103_usb_hw.c \
- $(GD32VF103_SDK_DRIVER)/gd32vf103_usart.c \
- $(LIBC_STUBS)/sbrk.c \
- $(LIBC_STUBS)/close.c \
- $(LIBC_STUBS)/isatty.c \
- $(LIBC_STUBS)/fstat.c \
- $(LIBC_STUBS)/lseek.c \
- $(LIBC_STUBS)/read.c
-
-SRC_S += \
- $(STARTUP_ASM)/startup_gd32vf103.S \
- $(STARTUP_ASM)/intexc_gd32vf103.S
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/$(NUCLEI_SDK)/NMSIS/Core/Include \
- $(TOP)/$(GD32VF103_SDK_SOC)/Common/Include \
- $(TOP)/$(GD32VF103_SDK_SOC)/Common/Include/Usb
-
-# For freeRTOS port source
-FREERTOS_PORT = RISC-V
-
-# For flash-jlink target
-JLINK_IF = jtag
-
-# flash target ROM bootloader
-flash: $(BUILD)/$(PROJECT).bin
- dfu-util -R -a 0 --dfuse-address 0x08000000 -D $<
diff --git a/tinyusb/hw/bsp/gd32vf103/system_gd32vf103.c b/tinyusb/hw/bsp/gd32vf103/system_gd32vf103.c
deleted file mode 100755
index 29518a54..00000000
--- a/tinyusb/hw/bsp/gd32vf103/system_gd32vf103.c
+++ /dev/null
@@ -1,668 +0,0 @@
-/*!
- \file system_gd32vf103.h
-\brief RISC-V Device Peripheral Access Layer Source File for
- GD32VF103 Device Series
-
-*/
-
-/*
- Copyright (c) 2020, GigaDevice Semiconductor Inc.
-
- 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.
-*/
-
-/* This file refers the RISC-V standard, some adjustments are made according to GigaDevice chips */
-#include "board.h"
-
-/* system frequency define */
-#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */
-#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */
-#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */
-#define __SYSTEM_CLOCK_HXTAL (HXTAL_VALUE)
-
-#if !defined(__SYSTEM_CLOCK)
-#define __SYSTEM_CLOCK 72000000
-#endif
-
-#if __SYSTEM_CLOCK == 48000000
- #define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000)
- uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL;
- static void system_clock_48m_hxtal(void);
-
-#elif __SYSTEM_CLOCK == 72000000
- #define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000)
- uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL;
- static void system_clock_72m_hxtal(void);
-
-#elif __SYSTEM_CLOCK == 96000000
- #define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000)
- uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL;
- static void system_clock_96m_hxtal(void);
-
-#else
-#error No valid system clock configuration set!
-#endif
-
-/* configure the system clock */
-static void system_clock_config(void);
-
-/*!
- \brief configure the system clock
- \param[in] none
- \param[out] none
- \retval none
-*/
-static void system_clock_config(void)
-{
-#if defined (__SYSTEM_CLOCK_48M_PLL_HXTAL)
- system_clock_48m_hxtal();
-#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL)
- system_clock_72m_hxtal();
-#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL)
- system_clock_96m_hxtal();
-#endif /* __SYSTEM_CLOCK_HXTAL */
-}
-
-/*!
- \brief setup the microcontroller system, initialize the system
- \param[in] none
- \param[out] none
- \retval none
-*/
-void SystemInit(void)
-{
- /* reset the RCC clock configuration to the default reset state */
- /* enable IRC8M */
- RCU_CTL |= RCU_CTL_IRC8MEN;
-
- /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */
- RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC |
- RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL);
-
- /* reset HXTALEN, CKMEN, PLLEN bits */
- RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN);
-
- /* Reset HXTALBPS bit */
- RCU_CTL &= ~(RCU_CTL_HXTALBPS);
-
- /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */
-
- RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF |
- RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4);
- RCU_CFG1 = 0x00000000U;
-
- /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */
- RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN);
- /* disable all interrupts */
- RCU_INT = 0x00FF0000U;
-
- /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */
- system_clock_config();
-}
-
-/*!
- \brief update the SystemCoreClock with current core clock retrieved from cpu registers
- \param[in] none
- \param[out] none
- \retval none
-*/
-void SystemCoreClockUpdate(void)
-{
- uint32_t scss;
- uint32_t pllsel, predv0sel, pllmf, ck_src;
- uint32_t predv0, predv1, pll1mf;
-
- scss = GET_BITS(RCU_CFG0, 2, 3);
-
- switch (scss)
- {
- /* IRC8M is selected as CK_SYS */
- case SEL_IRC8M:
- SystemCoreClock = IRC8M_VALUE;
- break;
-
- /* HXTAL is selected as CK_SYS */
- case SEL_HXTAL:
- SystemCoreClock = HXTAL_VALUE;
- break;
-
- /* PLL is selected as CK_SYS */
- case SEL_PLL:
- /* PLL clock source selection, HXTAL or IRC8M/2 */
- pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL);
-
-
- if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){
- /* PLL clock source is IRC8M/2 */
- ck_src = IRC8M_VALUE / 2U;
- }else{
- /* PLL clock source is HXTAL */
- ck_src = HXTAL_VALUE;
-
- predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL);
-
- /* source clock use PLL1 */
- if(RCU_PREDV0SRC_CKPLL1 == predv0sel){
- predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U;
- pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U;
- if(17U == pll1mf){
- pll1mf = 20U;
- }
- ck_src = (ck_src / predv1) * pll1mf;
- }
- predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U;
- ck_src /= predv0;
- }
-
- /* PLL multiplication factor */
- pllmf = GET_BITS(RCU_CFG0, 18, 21);
-
- if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){
- pllmf |= 0x10U;
- }
-
- if(pllmf >= 15U){
- pllmf += 1U;
- }else{
- pllmf += 2U;
- }
-
- SystemCoreClock = ck_src * pllmf;
-
- if(15U == pllmf){
- /* PLL source clock multiply by 6.5 */
- SystemCoreClock = ck_src * 6U + ck_src / 2U;
- }
-
- break;
-
- /* IRC8M is selected as CK_SYS */
- default:
- SystemCoreClock = IRC8M_VALUE;
- break;
- }
-}
-
-#if defined (__SYSTEM_CLOCK_48M_PLL_HXTAL)
-/*!
- \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source
- \param[in] none
- \param[out] none
- \retval none
-*/
-static void system_clock_48m_hxtal(void)
-{
- uint32_t timeout = 0U;
- uint32_t stab_flag = 0U;
-
- /* enable HXTAL */
- RCU_CTL |= RCU_CTL_HXTALEN;
-
- /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */
- do{
- timeout++;
- stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB);
- }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout));
-
- /* if fail */
- if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){
- while(1){
- }
- }
-
- /* HXTAL is stable */
- /* AHB = SYSCLK */
- RCU_CFG0 |= RCU_AHB_CKSYS_DIV1;
- /* APB2 = AHB/1 */
- RCU_CFG0 |= RCU_APB2_CKAHB_DIV1;
- /* APB1 = AHB/2 */
- RCU_CFG0 |= RCU_APB1_CKAHB_DIV2;
-
- /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */
- RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4);
- RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12);
-
- if(HXTAL_VALUE==25000000){
-
- /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */
- RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0);
- RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10);
-
- /* enable PLL1 */
- RCU_CTL |= RCU_CTL_PLL1EN;
- /* wait till PLL1 is ready */
- while((RCU_CTL & RCU_CTL_PLL1STB) == 0){
- }
-
- }else if(HXTAL_VALUE==8000000){
- RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PREDV1 | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV0);
- RCU_CFG1 |= (RCU_PREDV0SRC_HXTAL | RCU_PREDV0_DIV2 );
- }
-
-
-
- /* enable PLL */
- RCU_CTL |= RCU_CTL_PLLEN;
-
- /* wait until PLL is stable */
- while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){
- }
-
- /* select PLL as system clock */
- RCU_CFG0 &= ~RCU_CFG0_SCS;
- RCU_CFG0 |= RCU_CKSYSSRC_PLL;
-
- /* wait until PLL is selected as system clock */
- while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){
- }
-}
-
-#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL)
-/*!
- \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source
- \param[in] none
- \param[out] none
- \retval none
-*/
-static void system_clock_72m_hxtal(void)
-{
- uint32_t timeout = 0U;
- uint32_t stab_flag = 0U;
-
- /* enable HXTAL */
- RCU_CTL |= RCU_CTL_HXTALEN;
-
- /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */
- do{
- timeout++;
- stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB);
- }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout));
-
- /* if fail */
- if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){
- while(1){
- }
- }
-
- /* HXTAL is stable */
- /* AHB = SYSCLK */
- RCU_CFG0 |= RCU_AHB_CKSYS_DIV1;
- /* APB2 = AHB/1 */
- RCU_CFG0 |= RCU_APB2_CKAHB_DIV1;
- /* APB1 = AHB/2 */
- RCU_CFG0 |= RCU_APB1_CKAHB_DIV2;
-
- /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */
- RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4);
- RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18);
-
-
- if(HXTAL_VALUE==25000000){
-
- /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */
- RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0);
- RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10);
-
- /* enable PLL1 */
- RCU_CTL |= RCU_CTL_PLL1EN;
- /* wait till PLL1 is ready */
- while((RCU_CTL & RCU_CTL_PLL1STB) == 0){
- }
-
- }else if(HXTAL_VALUE==8000000){
- RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PREDV1 | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV0);
- RCU_CFG1 |= (RCU_PREDV0SRC_HXTAL | RCU_PREDV0_DIV2 );
- }
-
- /* enable PLL */
- RCU_CTL |= RCU_CTL_PLLEN;
-
- /* wait until PLL is stable */
- while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){
- }
-
- /* select PLL as system clock */
- RCU_CFG0 &= ~RCU_CFG0_SCS;
- RCU_CFG0 |= RCU_CKSYSSRC_PLL;
-
- /* wait until PLL is selected as system clock */
- while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){
- }
-}
-
-#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL)
-/*!
- \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source
- \param[in] none
- \param[out] none
- \retval none
-*/
-static void system_clock_96m_hxtal(void)
-{
- uint32_t timeout = 0U;
- uint32_t stab_flag = 0U;
-
- /* enable HXTAL */
- RCU_CTL |= RCU_CTL_HXTALEN;
-
- /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */
- do{
- timeout++;
- stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB);
- }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout));
-
- /* if fail */
- if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){
- while(1){
- }
- }
-
- /* HXTAL is stable */
- /* AHB = SYSCLK */
- RCU_CFG0 |= RCU_AHB_CKSYS_DIV1;
- /* APB2 = AHB/1 */
- RCU_CFG0 |= RCU_APB2_CKAHB_DIV1;
- /* APB1 = AHB/2 */
- RCU_CFG0 |= RCU_APB1_CKAHB_DIV2;
-
- if(HXTAL_VALUE==25000000){
-
- /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */
- RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4);
- RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24);
-
- /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */
- RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0);
- RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10);
- /* enable PLL1 */
- RCU_CTL |= RCU_CTL_PLL1EN;
- /* wait till PLL1 is ready */
- while((RCU_CTL & RCU_CTL_PLL1STB) == 0){
- }
-
- }else if(HXTAL_VALUE==8000000){
- /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */
- RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4);
- RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24);
-
- RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PREDV1 | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV0);
- RCU_CFG1 |= (RCU_PREDV0SRC_HXTAL | RCU_PREDV0_DIV2 );
- }
-
- /* enable PLL */
- RCU_CTL |= RCU_CTL_PLLEN;
-
- /* wait until PLL is stable */
- while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){
- }
-
- /* select PLL as system clock */
- RCU_CFG0 &= ~RCU_CFG0_SCS;
- RCU_CFG0 |= RCU_CKSYSSRC_PLL;
-
- /* wait until PLL is selected as system clock */
- while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){
- }
-}
-
-#endif
-
-/**
- * \defgroup NMSIS_Core_IntExcNMI_Handling Interrupt and Exception and NMI Handling
- * \brief Functions for interrupt, exception and nmi handle available in system_<device>.c.
- * \details
- * Nuclei provide a template for interrupt, exception and NMI handling. Silicon Vendor could adapat according
- * to their requirement. Silicon vendor could implement interface for different exception code and
- * replace current implementation.
- *
- * @{
- */
-/** \brief Max exception handler number, don't include the NMI(0xFFF) one */
-#define MAX_SYSTEM_EXCEPTION_NUM 12
-/**
- * \brief Store the exception handlers for each exception ID
- * \note
- * - This SystemExceptionHandlers are used to store all the handlers for all
- * the exception codes Nuclei N/NX core provided.
- * - Exception code 0 - 11, totally 12 exceptions are mapped to SystemExceptionHandlers[0:11]
- * - Exception for NMI is also re-routed to exception handling(exception code 0xFFF) in startup code configuration, the handler itself is mapped to SystemExceptionHandlers[MAX_SYSTEM_EXCEPTION_NUM]
- */
-static unsigned long SystemExceptionHandlers[MAX_SYSTEM_EXCEPTION_NUM + 1];
-
-/**
- * \brief Exception Handler Function Typedef
- * \note
- * This typedef is only used internal in this system_gd32vf103.c file.
- * It is used to do type conversion for registered exception handler before calling it.
- */
-typedef void (*EXC_HANDLER)(unsigned long mcause, unsigned long sp);
-
-/**
- * \brief System Default Exception Handler
- * \details
- * This function provided a default exception and NMI handling code for all exception ids.
- * By default, It will just print some information for debug, Vendor can customize it according to its requirements.
- */
-static void system_default_exception_handler(unsigned long mcause, unsigned long sp)
-{
- /* TODO: Uncomment this if you have implement printf function */
- /*printf("MCAUSE: 0x%lx\r\n", mcause);
- printf("MEPC : 0x%lx\r\n", __RV_CSR_READ(CSR_MEPC));
- printf("MTVAL : 0x%lx\r\n", __RV_CSR_READ(CSR_MBADADDR));*/
- while (1);
-}
-
-/**
- * \brief Initialize all the default core exception handlers
- * \details
- * The core exception handler for each exception id will be initialized to \ref system_default_exception_handler.
- * \note
- * Called in \ref _init function, used to initialize default exception handlers for all exception IDs
- */
-static void Exception_Init(void)
-{
- for (int i = 0; i < MAX_SYSTEM_EXCEPTION_NUM + 1; i++) {
- SystemExceptionHandlers[i] = (unsigned long)system_default_exception_handler;
- }
-}
-
-/**
- * \brief Register an exception handler for exception code EXCn
- * \details
- * * For EXCn < \ref MAX_SYSTEM_EXCEPTION_NUM, it will be registered into SystemExceptionHandlers[EXCn-1].
- * * For EXCn == NMI_EXCn, it will be registered into SystemExceptionHandlers[MAX_SYSTEM_EXCEPTION_NUM].
- * \param EXCn See \ref EXCn_Type
- * \param exc_handler The exception handler for this exception code EXCn
- */
-void Exception_Register_EXC(uint32_t EXCn, unsigned long exc_handler)
-{
- if ((EXCn < MAX_SYSTEM_EXCEPTION_NUM) && (EXCn != 0)) {
- SystemExceptionHandlers[EXCn] = exc_handler;
- } else if (EXCn == NMI_EXCn) {
- SystemExceptionHandlers[MAX_SYSTEM_EXCEPTION_NUM] = exc_handler;
- }
-}
-
-/**
- * \brief Get current exception handler for exception code EXCn
- * \details
- * * For EXCn < \ref MAX_SYSTEM_EXCEPTION_NUM, it will return SystemExceptionHandlers[EXCn-1].
- * * For EXCn == NMI_EXCn, it will return SystemExceptionHandlers[MAX_SYSTEM_EXCEPTION_NUM].
- * \param EXCn See \ref EXCn_Type
- * \return Current exception handler for exception code EXCn, if not found, return 0.
- */
-unsigned long Exception_Get_EXC(uint32_t EXCn)
-{
- if ((EXCn < MAX_SYSTEM_EXCEPTION_NUM) && (EXCn != 0)) {
- return SystemExceptionHandlers[EXCn];
- } else if (EXCn == NMI_EXCn) {
- return SystemExceptionHandlers[MAX_SYSTEM_EXCEPTION_NUM];
- } else {
- return 0;
- }
-}
-
-/**
- * \brief Common NMI and Exception handler entry
- * \details
- * This function provided a command entry for NMI and exception. Silicon Vendor could modify
- * this template implementation according to requirement.
- * \remarks
- * - RISCV provided common entry for all types of exception. This is proposed code template
- * for exception entry function, Silicon Vendor could modify the implementation.
- * - For the core_exception_handler template, we provided exception register function \ref Exception_Register_EXC
- * which can help developer to register your exception handler for specific exception number.
- */
-uint32_t core_exception_handler(unsigned long mcause, unsigned long sp)
-{
- uint32_t EXCn = (uint32_t)(mcause & 0X00000fff);
- EXC_HANDLER exc_handler;
-
- if ((EXCn < MAX_SYSTEM_EXCEPTION_NUM) && (EXCn > 0)) {
- exc_handler = (EXC_HANDLER)SystemExceptionHandlers[EXCn];
- } else if (EXCn == NMI_EXCn) {
- exc_handler = (EXC_HANDLER)SystemExceptionHandlers[MAX_SYSTEM_EXCEPTION_NUM];
- } else {
- exc_handler = (EXC_HANDLER)system_default_exception_handler;
- }
- if (exc_handler != NULL) {
- exc_handler(mcause, sp);
- }
- return 0;
-}
-/** @} */ /* End of Doxygen Group NMSIS_Core_ExceptionAndNMI */
-
-/**
- * \brief initialize eclic config
- * \details
- * Eclic need initialize after boot up, Vendor could also change the initialization
- * configuration.
- */
-void ECLIC_Init(void)
-{
- /* TODO: Add your own initialization code here. This function will be called by main */
- ECLIC_SetMth(0);
- ECLIC_SetCfgNlbits(__ECLIC_INTCTLBITS);
-}
-
-/**
- * \brief Initialize a specific IRQ and register the handler
- * \details
- * This function set vector mode, trigger mode and polarity, interrupt level and priority,
- * assign handler for specific IRQn.
- * \param [in] IRQn NMI interrupt handler address
- * \param [in] shv \ref ECLIC_NON_VECTOR_INTERRUPT means non-vector mode, and \ref ECLIC_VECTOR_INTERRUPT is vector mode
- * \param [in] trig_mode see \ref ECLIC_TRIGGER_Type
- * \param [in] lvl interupt level
- * \param [in] priority interrupt priority
- * \param [in] handler interrupt handler, if NULL, handler will not be installed
- * \return -1 means invalid input parameter. 0 means successful.
- * \remarks
- * - This function use to configure specific eclic interrupt and register its interrupt handler and enable its interrupt.
- * - If the vector table is placed in read-only section(FLASHXIP mode), handler could not be installed
- */
-int32_t ECLIC_Register_IRQ(IRQn_Type IRQn, uint8_t shv, ECLIC_TRIGGER_Type trig_mode, uint8_t lvl, uint8_t priority, void* handler)
-{
- if ((IRQn > SOC_INT_MAX) || (shv > ECLIC_VECTOR_INTERRUPT) \
- || (trig_mode > ECLIC_NEGTIVE_EDGE_TRIGGER)) {
- return -1;
- }
-
- /* set interrupt vector mode */
- ECLIC_SetShvIRQ(IRQn, shv);
- /* set interrupt trigger mode and polarity */
- ECLIC_SetTrigIRQ(IRQn, trig_mode);
- /* set interrupt level */
- ECLIC_SetLevelIRQ(IRQn, lvl);
- /* set interrupt priority */
- ECLIC_SetPriorityIRQ(IRQn, priority);
- if (handler != NULL) {
- /* set interrupt handler entry to vector table */
- ECLIC_SetVector(IRQn, (rv_csr_t)handler);
- }
- /* enable interrupt */
- ECLIC_EnableIRQ(IRQn);
- return 0;
-}
-/** @} */ /* End of Doxygen Group NMSIS_Core_ExceptionAndNMI */
-
-/**
- * \brief early init function before main
- * \details
- * This function is executed right before main function.
- * For RISC-V gnu toolchain, _init function might not be called
- * by __libc_init_array function, so we defined a new function
- * to do initialization
- */
-void _premain_init(void)
-{
- /* Initialize exception default handlers */
- Exception_Init();
- /* ECLIC initialization, mainly MTH and NLBIT */
- ECLIC_Init();
-}
-
-/**
- * \brief finish function after main
- * \param [in] status status code return from main
- * \details
- * This function is executed right after main function.
- * For RISC-V gnu toolchain, _fini function might not be called
- * by __libc_fini_array function, so we defined a new function
- * to do initialization
- */
-void _postmain_fini(int status)
-{
- /* TODO: Add your own finishing code here, called after main */
-}
-
-/**
- * \brief _init function called in __libc_init_array()
- * \details
- * This `__libc_init_array()` function is called during startup code,
- * user need to implement this function, otherwise when link it will
- * error init.c:(.text.__libc_init_array+0x26): undefined reference to `_init'
- * \note
- * Please use \ref _premain_init function now
- */
-void _init(void)
-{
- /* Don't put any code here, please use _premain_init now */
-}
-
-/**
- * \brief _fini function called in __libc_fini_array()
- * \details
- * This `__libc_fini_array()` function is called when exit main.
- * user need to implement this function, otherwise when link it will
- * error fini.c:(.text.__libc_fini_array+0x28): undefined reference to `_fini'
- * \note
- * Please use \ref _postmain_fini function now
- */
-void _fini(void)
-{
- /* Don't put any code here, please use _postmain_fini now */
-}
-
-/** @} */ /* End of Doxygen Group NMSIS_Core_SystemAndClock */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/board.h b/tinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/board.h
deleted file mode 100755
index 4f21b52f..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/board.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#include "fsl_device_registers.h"
-
-// required since iMX RT10xx SDK include this file for board size
-#define BOARD_FLASH_SIZE (0x1000000U)
-
-// LED
-#define LED_PINMUX IOMUXC_GPIO_11_GPIOMUX_IO11
-#define LED_PORT GPIO1
-#define LED_PIN 11
-#define LED_STATE_ON 0
-
-// SW8 button
-#define BUTTON_PINMUX IOMUXC_GPIO_SD_05_GPIO2_IO05
-#define BUTTON_PORT GPIO2
-#define BUTTON_PIN 5
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_PORT LPUART1
-#define UART_RX_PINMUX IOMUXC_GPIO_09_LPUART1_RXD
-#define UART_TX_PINMUX IOMUXC_GPIO_10_LPUART1_TXD
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/board.mk b/tinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/board.mk
deleted file mode 100755
index 507db7f0..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DCPU_MIMXRT1011DAE5A
-MCU_VARIANT = MIMXRT1011
-
-# For flash-jlink target
-JLINK_DEVICE = MIMXRT1011DAE5A
-
-# For flash-pyocd target
-PYOCD_TARGET = mimxrt1010
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/evkmimxrt1010_flexspi_nor_config.c b/tinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/evkmimxrt1010_flexspi_nor_config.c
deleted file mode 100755
index cd50a93d..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/evkmimxrt1010_flexspi_nor_config.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2019 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include "evkmimxrt1010_flexspi_nor_config.h"
-
-/* Component ID definition, used by tools. */
-#ifndef FSL_COMPONENT_ID
-#define FSL_COMPONENT_ID "platform.drivers.xip_board"
-#endif
-
-/*******************************************************************************
- * Code
- ******************************************************************************/
-#if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1)
-#if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__)
-__attribute__((section(".boot_hdr.conf")))
-#elif defined(__ICCARM__)
-#pragma location = ".boot_hdr.conf"
-#endif
-
-const flexspi_nor_config_t qspiflash_config = {
- .memConfig =
- {
- .tag = FLEXSPI_CFG_BLK_TAG,
- .version = FLEXSPI_CFG_BLK_VERSION,
- .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad,
- .csHoldTime = 3u,
- .csSetupTime = 3u,
- .sflashPadType = kSerialFlash_4Pads,
- .serialClkFreq = kFlexSpiSerialClk_100MHz,
- .sflashA1Size = 16u * 1024u * 1024u,
- .lookupTable =
- {
- // Read LUTs
- FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
- FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
- },
- },
- .pageSize = 256u,
- .sectorSize = 4u * 1024u,
- .blockSize = 256u * 1024u,
- .isUniformBlockSize = false,
-};
-#endif /* XIP_BOOT_HEADER_ENABLE */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/evkmimxrt1010_flexspi_nor_config.h b/tinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/evkmimxrt1010_flexspi_nor_config.h
deleted file mode 100755
index 4be2760b..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1010_evk/evkmimxrt1010_flexspi_nor_config.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Copyright 2019 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef __EVKMIMXRT1011_FLEXSPI_NOR_CONFIG__
-#define __EVKMIMXRT1011_FLEXSPI_NOR_CONFIG__
-
-#include <stdint.h>
-#include <stdbool.h>
-#include "fsl_common.h"
-
-/*! @name Driver version */
-/*@{*/
-/*! @brief XIP_BOARD driver version 2.0.0. */
-#define FSL_XIP_BOARD_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
-/*@}*/
-
-/* FLEXSPI memory config block related defintions */
-#define FLEXSPI_CFG_BLK_TAG (0x42464346UL) // ascii "FCFB" Big Endian
-#define FLEXSPI_CFG_BLK_VERSION (0x56010400UL) // V1.4.0
-#define FLEXSPI_CFG_BLK_SIZE (512)
-
-/* FLEXSPI Feature related definitions */
-#define FLEXSPI_FEATURE_HAS_PARALLEL_MODE 1
-
-/* Lookup table related defintions */
-#define CMD_INDEX_READ 0
-#define CMD_INDEX_READSTATUS 1
-#define CMD_INDEX_WRITEENABLE 2
-#define CMD_INDEX_WRITE 4
-
-#define CMD_LUT_SEQ_IDX_READ 0
-#define CMD_LUT_SEQ_IDX_READSTATUS 1
-#define CMD_LUT_SEQ_IDX_WRITEENABLE 3
-#define CMD_LUT_SEQ_IDX_WRITE 9
-
-#define CMD_SDR 0x01
-#define CMD_DDR 0x21
-#define RADDR_SDR 0x02
-#define RADDR_DDR 0x22
-#define CADDR_SDR 0x03
-#define CADDR_DDR 0x23
-#define MODE1_SDR 0x04
-#define MODE1_DDR 0x24
-#define MODE2_SDR 0x05
-#define MODE2_DDR 0x25
-#define MODE4_SDR 0x06
-#define MODE4_DDR 0x26
-#define MODE8_SDR 0x07
-#define MODE8_DDR 0x27
-#define WRITE_SDR 0x08
-#define WRITE_DDR 0x28
-#define READ_SDR 0x09
-#define READ_DDR 0x29
-#define LEARN_SDR 0x0A
-#define LEARN_DDR 0x2A
-#define DATSZ_SDR 0x0B
-#define DATSZ_DDR 0x2B
-#define DUMMY_SDR 0x0C
-#define DUMMY_DDR 0x2C
-#define DUMMY_RWDS_SDR 0x0D
-#define DUMMY_RWDS_DDR 0x2D
-#define JMP_ON_CS 0x1F
-#define STOP 0
-
-#define FLEXSPI_1PAD 0
-#define FLEXSPI_2PAD 1
-#define FLEXSPI_4PAD 2
-#define FLEXSPI_8PAD 3
-
-#define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \
- (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \
- FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1))
-
-//!@brief Definitions for FlexSPI Serial Clock Frequency
-typedef enum _FlexSpiSerialClockFreq
-{
- kFlexSpiSerialClk_30MHz = 1,
- kFlexSpiSerialClk_50MHz = 2,
- kFlexSpiSerialClk_60MHz = 3,
- kFlexSpiSerialClk_75MHz = 4,
- kFlexSpiSerialClk_80MHz = 5,
- kFlexSpiSerialClk_100MHz = 6,
- kFlexSpiSerialClk_120MHz = 7,
- kFlexSpiSerialClk_133MHz = 8,
-} flexspi_serial_clk_freq_t;
-
-//!@brief FlexSPI clock configuration type
-enum
-{
- kFlexSpiClk_SDR, //!< Clock configure for SDR mode
- kFlexSpiClk_DDR, //!< Clock configurat for DDR mode
-};
-
-//!@brief FlexSPI Read Sample Clock Source definition
-typedef enum _FlashReadSampleClkSource
-{
- kFlexSPIReadSampleClk_LoopbackInternally = 0,
- kFlexSPIReadSampleClk_LoopbackFromDqsPad = 1,
- kFlexSPIReadSampleClk_LoopbackFromSckPad = 2,
- kFlexSPIReadSampleClk_ExternalInputFromDqsPad = 3,
-} flexspi_read_sample_clk_t;
-
-//!@brief Misc feature bit definitions
-enum
-{
- kFlexSpiMiscOffset_DiffClkEnable = 0, //!< Bit for Differential clock enable
- kFlexSpiMiscOffset_Ck2Enable = 1, //!< Bit for CK2 enable
- kFlexSpiMiscOffset_ParallelEnable = 2, //!< Bit for Parallel mode enable
- kFlexSpiMiscOffset_WordAddressableEnable = 3, //!< Bit for Word Addressable enable
- kFlexSpiMiscOffset_SafeConfigFreqEnable = 4, //!< Bit for Safe Configuration Frequency enable
- kFlexSpiMiscOffset_PadSettingOverrideEnable = 5, //!< Bit for Pad setting override enable
- kFlexSpiMiscOffset_DdrModeEnable = 6, //!< Bit for DDR clock confiuration indication.
-};
-
-//!@brief Flash Type Definition
-enum
-{
- kFlexSpiDeviceType_SerialNOR = 1, //!< Flash devices are Serial NOR
- kFlexSpiDeviceType_SerialNAND = 2, //!< Flash devices are Serial NAND
- kFlexSpiDeviceType_SerialRAM = 3, //!< Flash devices are Serial RAM/HyperFLASH
- kFlexSpiDeviceType_MCP_NOR_NAND = 0x12, //!< Flash device is MCP device, A1 is Serial NOR, A2 is Serial NAND
- kFlexSpiDeviceType_MCP_NOR_RAM = 0x13, //!< Flash deivce is MCP device, A1 is Serial NOR, A2 is Serial RAMs
-};
-
-//!@brief Flash Pad Definitions
-enum
-{
- kSerialFlash_1Pad = 1,
- kSerialFlash_2Pads = 2,
- kSerialFlash_4Pads = 4,
- kSerialFlash_8Pads = 8,
-};
-
-//!@brief FlexSPI LUT Sequence structure
-typedef struct _lut_sequence
-{
- uint8_t seqNum; //!< Sequence Number, valid number: 1-16
- uint8_t seqId; //!< Sequence Index, valid number: 0-15
- uint16_t reserved;
-} flexspi_lut_seq_t;
-
-//!@brief Flash Configuration Command Type
-enum
-{
- kDeviceConfigCmdType_Generic, //!< Generic command, for example: configure dummy cycles, drive strength, etc
- kDeviceConfigCmdType_QuadEnable, //!< Quad Enable command
- kDeviceConfigCmdType_Spi2Xpi, //!< Switch from SPI to DPI/QPI/OPI mode
- kDeviceConfigCmdType_Xpi2Spi, //!< Switch from DPI/QPI/OPI to SPI mode
- kDeviceConfigCmdType_Spi2NoCmd, //!< Switch to 0-4-4/0-8-8 mode
- kDeviceConfigCmdType_Reset, //!< Reset device command
-};
-
-//!@brief FlexSPI Memory Configuration Block
-typedef struct _FlexSPIConfig
-{
- uint32_t tag; //!< [0x000-0x003] Tag, fixed value 0x42464346UL
- uint32_t version; //!< [0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix
- uint32_t reserved0; //!< [0x008-0x00b] Reserved for future use
- uint8_t readSampleClkSrc; //!< [0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3
- uint8_t csHoldTime; //!< [0x00d-0x00d] CS hold time, default value: 3
- uint8_t csSetupTime; //!< [0x00e-0x00e] CS setup time, default value: 3
- uint8_t columnAddressWidth; //!< [0x00f-0x00f] Column Address with, for HyperBus protocol, it is fixed to 3, For
- //! Serial NAND, need to refer to datasheet
- uint8_t deviceModeCfgEnable; //!< [0x010-0x010] Device Mode Configure enable flag, 1 - Enable, 0 - Disable
- uint8_t deviceModeType; //!< [0x011-0x011] Specify the configuration command type:Quad Enable, DPI/QPI/OPI switch,
- //! Generic configuration, etc.
- uint16_t waitTimeCfgCommands; //!< [0x012-0x013] Wait time for all configuration commands, unit: 100us, Used for
- //! DPI/QPI/OPI switch or reset command
- flexspi_lut_seq_t deviceModeSeq; //!< [0x014-0x017] Device mode sequence info, [7:0] - LUT sequence id, [15:8] - LUt
- //! sequence number, [31:16] Reserved
- uint32_t deviceModeArg; //!< [0x018-0x01b] Argument/Parameter for device configuration
- uint8_t configCmdEnable; //!< [0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable
- uint8_t configModeType[3]; //!< [0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe
- flexspi_lut_seq_t
- configCmdSeqs[3]; //!< [0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq
- uint32_t reserved1; //!< [0x02c-0x02f] Reserved for future use
- uint32_t configCmdArgs[3]; //!< [0x030-0x03b] Arguments/Parameters for device Configuration commands
- uint32_t reserved2; //!< [0x03c-0x03f] Reserved for future use
- uint32_t controllerMiscOption; //!< [0x040-0x043] Controller Misc Options, see Misc feature bit definitions for more
- //! details
- uint8_t deviceType; //!< [0x044-0x044] Device Type: See Flash Type Definition for more details
- uint8_t sflashPadType; //!< [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal
- uint8_t serialClkFreq; //!< [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot
- //! Chapter for more details
- uint8_t lutCustomSeqEnable; //!< [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot
- //! be done using 1 LUT sequence, currently, only applicable to HyperFLASH
- uint32_t reserved3[2]; //!< [0x048-0x04f] Reserved for future use
- uint32_t sflashA1Size; //!< [0x050-0x053] Size of Flash connected to A1
- uint32_t sflashA2Size; //!< [0x054-0x057] Size of Flash connected to A2
- uint32_t sflashB1Size; //!< [0x058-0x05b] Size of Flash connected to B1
- uint32_t sflashB2Size; //!< [0x05c-0x05f] Size of Flash connected to B2
- uint32_t csPadSettingOverride; //!< [0x060-0x063] CS pad setting override value
- uint32_t sclkPadSettingOverride; //!< [0x064-0x067] SCK pad setting override value
- uint32_t dataPadSettingOverride; //!< [0x068-0x06b] data pad setting override value
- uint32_t dqsPadSettingOverride; //!< [0x06c-0x06f] DQS pad setting override value
- uint32_t timeoutInMs; //!< [0x070-0x073] Timeout threshold for read status command
- uint32_t commandInterval; //!< [0x074-0x077] CS deselect interval between two commands
- uint16_t dataValidTime[2]; //!< [0x078-0x07b] CLK edge to data valid time for PORT A and PORT B, in terms of 0.1ns
- uint16_t busyOffset; //!< [0x07c-0x07d] Busy offset, valid value: 0-31
- uint16_t busyBitPolarity; //!< [0x07e-0x07f] Busy flag polarity, 0 - busy flag is 1 when flash device is busy, 1 -
- //! busy flag is 0 when flash device is busy
- uint32_t lookupTable[64]; //!< [0x080-0x17f] Lookup table holds Flash command sequences
- flexspi_lut_seq_t lutCustomSeq[12]; //!< [0x180-0x1af] Customizable LUT Sequences
- uint32_t reserved4[4]; //!< [0x1b0-0x1bf] Reserved for future use
-} flexspi_mem_config_t;
-
-/* */
-#define NOR_CMD_INDEX_READ CMD_INDEX_READ //!< 0
-#define NOR_CMD_INDEX_READSTATUS CMD_INDEX_READSTATUS //!< 1
-#define NOR_CMD_INDEX_WRITEENABLE CMD_INDEX_WRITEENABLE //!< 2
-#define NOR_CMD_INDEX_ERASESECTOR 3 //!< 3
-#define NOR_CMD_INDEX_PAGEPROGRAM CMD_INDEX_WRITE //!< 4
-#define NOR_CMD_INDEX_CHIPERASE 5 //!< 5
-#define NOR_CMD_INDEX_DUMMY 6 //!< 6
-#define NOR_CMD_INDEX_ERASEBLOCK 7 //!< 7
-
-#define NOR_CMD_LUT_SEQ_IDX_READ CMD_LUT_SEQ_IDX_READ //!< 0 READ LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS \
- CMD_LUT_SEQ_IDX_READSTATUS //!< 1 Read Status LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS_XPI \
- 2 //!< 2 Read status DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE \
- CMD_LUT_SEQ_IDX_WRITEENABLE //!< 3 Write Enable sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_XPI \
- 4 //!< 4 Write Enable DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 5 //!< 5 Erase Sector sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASEBLOCK 8 //!< 8 Erase Block sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM \
- CMD_LUT_SEQ_IDX_WRITE //!< 9 Program sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_CHIPERASE 11 //!< 11 Chip Erase sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READ_SFDP 13 //!< 13 Read SFDP sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_RESTORE_NOCMD \
- 14 //!< 14 Restore 0-4-4/0-8-8 mode sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_EXIT_NOCMD \
- 15 //!< 15 Exit 0-4-4/0-8-8 mode sequence id in lookupTable stored in config blobk
-
-/*
- * Serial NOR configuration block
- */
-typedef struct _flexspi_nor_config
-{
- flexspi_mem_config_t memConfig; //!< Common memory configuration info via FlexSPI
- uint32_t pageSize; //!< Page size of Serial NOR
- uint32_t sectorSize; //!< Sector size of Serial NOR
- uint8_t ipcmdSerialClkFreq; //!< Clock frequency for IP command
- uint8_t isUniformBlockSize; //!< Sector/Block size is the same
- uint8_t reserved0[2]; //!< Reserved for future use
- uint8_t serialNorType; //!< Serial NOR Flash type: 0/1/2/3
- uint8_t needExitNoCmdMode; //!< Need to exit NoCmd mode before other IP command
- uint8_t halfClkForNonReadCmd; //!< Half the Serial Clock for non-read command: true/false
- uint8_t needRestoreNoCmdMode; //!< Need to Restore NoCmd mode after IP commmand execution
- uint32_t blockSize; //!< Block size
- uint32_t reserve2[11]; //!< Reserved for future use
-} flexspi_nor_config_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __EVKMIMXRT1011_FLEXSPI_NOR_CONFIG__ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/board.h b/tinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/board.h
deleted file mode 100755
index 932ce7fd..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/board.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-// required since iMX RT10xx SDK include this file for board size
-#define BOARD_FLASH_SIZE (0x1000000U)
-
-// LED
-#define LED_PINMUX IOMUXC_GPIO_SD_B1_01_GPIO3_IO21
-#define LED_PORT GPIO3
-#define LED_PIN 21
-#define LED_STATE_ON 0
-
-// SW8 button
-#define BUTTON_PINMUX IOMUXC_GPIO_EMC_09_GPIO2_IO09
-#define BUTTON_PORT GPIO2
-#define BUTTON_PIN 9
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_PORT LPUART1
-#define UART_RX_PINMUX IOMUXC_GPIO_AD_B0_07_LPUART1_RX
-#define UART_TX_PINMUX IOMUXC_GPIO_AD_B0_06_LPUART1_TX
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/board.mk b/tinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/board.mk
deleted file mode 100755
index 17fd25df..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DCPU_MIMXRT1015DAF5A
-MCU_VARIANT = MIMXRT1015
-
-# For flash-jlink target
-JLINK_DEVICE = MIMXRT1015DAF5A
-
-# For flash-pyocd target
-PYOCD_TARGET = mimxrt1015
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/evkmimxrt1015_flexspi_nor_config.c b/tinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/evkmimxrt1015_flexspi_nor_config.c
deleted file mode 100755
index a396fe60..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/evkmimxrt1015_flexspi_nor_config.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2018-2019 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include "evkmimxrt1015_flexspi_nor_config.h"
-
-/* Component ID definition, used by tools. */
-#ifndef FSL_COMPONENT_ID
-#define FSL_COMPONENT_ID "platform.drivers.xip_board"
-#endif
-
-/*******************************************************************************
- * Code
- ******************************************************************************/
-#if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1)
-#if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__)
-__attribute__((section(".boot_hdr.conf")))
-#elif defined(__ICCARM__)
-#pragma location = ".boot_hdr.conf"
-#endif
-
-const flexspi_nor_config_t qspiflash_config = {
- .memConfig =
- {
- .tag = FLEXSPI_CFG_BLK_TAG,
- .version = FLEXSPI_CFG_BLK_VERSION,
- .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad,
- .csHoldTime = 3u,
- .csSetupTime = 3u,
- .sflashPadType = kSerialFlash_4Pads,
- .serialClkFreq = kFlexSpiSerialClk_100MHz,
- .sflashA1Size = 16u * 1024u * 1024u,
- .lookupTable =
- {
- // Read LUTs
- FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
- FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
- },
- },
- .pageSize = 256u,
- .sectorSize = 4u * 1024u,
- .blockSize = 256u * 1024u,
- .isUniformBlockSize = false,
-};
-#endif /* XIP_BOOT_HEADER_ENABLE */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/evkmimxrt1015_flexspi_nor_config.h b/tinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/evkmimxrt1015_flexspi_nor_config.h
deleted file mode 100755
index 94af5a11..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1015_evk/evkmimxrt1015_flexspi_nor_config.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright 2018-2019 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef __EVKMIMXRT1015_FLEXSPI_NOR_CONFIG__
-#define __EVKMIMXRT1015_FLEXSPI_NOR_CONFIG__
-
-#include <stdint.h>
-#include <stdbool.h>
-#include "fsl_common.h"
-
-/*! @name Driver version */
-/*@{*/
-/*! @brief XIP_BOARD driver version 2.0.0. */
-#define FSL_XIP_BOARD_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
-/*@}*/
-
-/* FLEXSPI memory config block related defintions */
-#define FLEXSPI_CFG_BLK_TAG (0x42464346UL) // ascii "FCFB" Big Endian
-#define FLEXSPI_CFG_BLK_VERSION (0x56010400UL) // V1.4.0
-#define FLEXSPI_CFG_BLK_SIZE (512)
-
-/* FLEXSPI Feature related definitions */
-#define FLEXSPI_FEATURE_HAS_PARALLEL_MODE 1
-
-/* Lookup table related defintions */
-#define CMD_INDEX_READ 0
-#define CMD_INDEX_READSTATUS 1
-#define CMD_INDEX_WRITEENABLE 2
-#define CMD_INDEX_WRITE 4
-
-#define CMD_LUT_SEQ_IDX_READ 0
-#define CMD_LUT_SEQ_IDX_READSTATUS 1
-#define CMD_LUT_SEQ_IDX_WRITEENABLE 3
-#define CMD_LUT_SEQ_IDX_WRITE 9
-
-#define CMD_SDR 0x01
-#define CMD_DDR 0x21
-#define RADDR_SDR 0x02
-#define RADDR_DDR 0x22
-#define CADDR_SDR 0x03
-#define CADDR_DDR 0x23
-#define MODE1_SDR 0x04
-#define MODE1_DDR 0x24
-#define MODE2_SDR 0x05
-#define MODE2_DDR 0x25
-#define MODE4_SDR 0x06
-#define MODE4_DDR 0x26
-#define MODE8_SDR 0x07
-#define MODE8_DDR 0x27
-#define WRITE_SDR 0x08
-#define WRITE_DDR 0x28
-#define READ_SDR 0x09
-#define READ_DDR 0x29
-#define LEARN_SDR 0x0A
-#define LEARN_DDR 0x2A
-#define DATSZ_SDR 0x0B
-#define DATSZ_DDR 0x2B
-#define DUMMY_SDR 0x0C
-#define DUMMY_DDR 0x2C
-#define DUMMY_RWDS_SDR 0x0D
-#define DUMMY_RWDS_DDR 0x2D
-#define JMP_ON_CS 0x1F
-#define STOP 0
-
-#define FLEXSPI_1PAD 0
-#define FLEXSPI_2PAD 1
-#define FLEXSPI_4PAD 2
-#define FLEXSPI_8PAD 3
-
-#define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \
- (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \
- FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1))
-
-//!@brief Definitions for FlexSPI Serial Clock Frequency
-typedef enum _FlexSpiSerialClockFreq
-{
- kFlexSpiSerialClk_30MHz = 1,
- kFlexSpiSerialClk_50MHz = 2,
- kFlexSpiSerialClk_60MHz = 3,
- kFlexSpiSerialClk_75MHz = 4,
- kFlexSpiSerialClk_80MHz = 5,
- kFlexSpiSerialClk_100MHz = 6,
- kFlexSpiSerialClk_133MHz = 7,
- kFlexSpiSerialClk_166MHz = 8,
- kFlexSpiSerialClk_200MHz = 9,
-} flexspi_serial_clk_freq_t;
-
-//!@brief FlexSPI clock configuration type
-enum
-{
- kFlexSpiClk_SDR, //!< Clock configure for SDR mode
- kFlexSpiClk_DDR, //!< Clock configurat for DDR mode
-};
-
-//!@brief FlexSPI Read Sample Clock Source definition
-typedef enum _FlashReadSampleClkSource
-{
- kFlexSPIReadSampleClk_LoopbackInternally = 0,
- kFlexSPIReadSampleClk_LoopbackFromDqsPad = 1,
- kFlexSPIReadSampleClk_LoopbackFromSckPad = 2,
- kFlexSPIReadSampleClk_ExternalInputFromDqsPad = 3,
-} flexspi_read_sample_clk_t;
-
-//!@brief Misc feature bit definitions
-enum
-{
- kFlexSpiMiscOffset_DiffClkEnable = 0, //!< Bit for Differential clock enable
- kFlexSpiMiscOffset_Ck2Enable = 1, //!< Bit for CK2 enable
- kFlexSpiMiscOffset_ParallelEnable = 2, //!< Bit for Parallel mode enable
- kFlexSpiMiscOffset_WordAddressableEnable = 3, //!< Bit for Word Addressable enable
- kFlexSpiMiscOffset_SafeConfigFreqEnable = 4, //!< Bit for Safe Configuration Frequency enable
- kFlexSpiMiscOffset_PadSettingOverrideEnable = 5, //!< Bit for Pad setting override enable
- kFlexSpiMiscOffset_DdrModeEnable = 6, //!< Bit for DDR clock confiuration indication.
-};
-
-//!@brief Flash Type Definition
-enum
-{
- kFlexSpiDeviceType_SerialNOR = 1, //!< Flash devices are Serial NOR
- kFlexSpiDeviceType_SerialNAND = 2, //!< Flash devices are Serial NAND
- kFlexSpiDeviceType_SerialRAM = 3, //!< Flash devices are Serial RAM/HyperFLASH
- kFlexSpiDeviceType_MCP_NOR_NAND = 0x12, //!< Flash device is MCP device, A1 is Serial NOR, A2 is Serial NAND
- kFlexSpiDeviceType_MCP_NOR_RAM = 0x13, //!< Flash deivce is MCP device, A1 is Serial NOR, A2 is Serial RAMs
-};
-
-//!@brief Flash Pad Definitions
-enum
-{
- kSerialFlash_1Pad = 1,
- kSerialFlash_2Pads = 2,
- kSerialFlash_4Pads = 4,
- kSerialFlash_8Pads = 8,
-};
-
-//!@brief FlexSPI LUT Sequence structure
-typedef struct _lut_sequence
-{
- uint8_t seqNum; //!< Sequence Number, valid number: 1-16
- uint8_t seqId; //!< Sequence Index, valid number: 0-15
- uint16_t reserved;
-} flexspi_lut_seq_t;
-
-//!@brief Flash Configuration Command Type
-enum
-{
- kDeviceConfigCmdType_Generic, //!< Generic command, for example: configure dummy cycles, drive strength, etc
- kDeviceConfigCmdType_QuadEnable, //!< Quad Enable command
- kDeviceConfigCmdType_Spi2Xpi, //!< Switch from SPI to DPI/QPI/OPI mode
- kDeviceConfigCmdType_Xpi2Spi, //!< Switch from DPI/QPI/OPI to SPI mode
- kDeviceConfigCmdType_Spi2NoCmd, //!< Switch to 0-4-4/0-8-8 mode
- kDeviceConfigCmdType_Reset, //!< Reset device command
-};
-
-//!@brief FlexSPI Memory Configuration Block
-typedef struct _FlexSPIConfig
-{
- uint32_t tag; //!< [0x000-0x003] Tag, fixed value 0x42464346UL
- uint32_t version; //!< [0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix
- uint32_t reserved0; //!< [0x008-0x00b] Reserved for future use
- uint8_t readSampleClkSrc; //!< [0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3
- uint8_t csHoldTime; //!< [0x00d-0x00d] CS hold time, default value: 3
- uint8_t csSetupTime; //!< [0x00e-0x00e] CS setup time, default value: 3
- uint8_t columnAddressWidth; //!< [0x00f-0x00f] Column Address with, for HyperBus protocol, it is fixed to 3, For
- //! Serial NAND, need to refer to datasheet
- uint8_t deviceModeCfgEnable; //!< [0x010-0x010] Device Mode Configure enable flag, 1 - Enable, 0 - Disable
- uint8_t deviceModeType; //!< [0x011-0x011] Specify the configuration command type:Quad Enable, DPI/QPI/OPI switch,
- //! Generic configuration, etc.
- uint16_t waitTimeCfgCommands; //!< [0x012-0x013] Wait time for all configuration commands, unit: 100us, Used for
- //! DPI/QPI/OPI switch or reset command
- flexspi_lut_seq_t deviceModeSeq; //!< [0x014-0x017] Device mode sequence info, [7:0] - LUT sequence id, [15:8] - LUt
- //! sequence number, [31:16] Reserved
- uint32_t deviceModeArg; //!< [0x018-0x01b] Argument/Parameter for device configuration
- uint8_t configCmdEnable; //!< [0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable
- uint8_t configModeType[3]; //!< [0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe
- flexspi_lut_seq_t
- configCmdSeqs[3]; //!< [0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq
- uint32_t reserved1; //!< [0x02c-0x02f] Reserved for future use
- uint32_t configCmdArgs[3]; //!< [0x030-0x03b] Arguments/Parameters for device Configuration commands
- uint32_t reserved2; //!< [0x03c-0x03f] Reserved for future use
- uint32_t controllerMiscOption; //!< [0x040-0x043] Controller Misc Options, see Misc feature bit definitions for more
- //! details
- uint8_t deviceType; //!< [0x044-0x044] Device Type: See Flash Type Definition for more details
- uint8_t sflashPadType; //!< [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal
- uint8_t serialClkFreq; //!< [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot
- //! Chapter for more details
- uint8_t lutCustomSeqEnable; //!< [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot
- //! be done using 1 LUT sequence, currently, only applicable to HyperFLASH
- uint32_t reserved3[2]; //!< [0x048-0x04f] Reserved for future use
- uint32_t sflashA1Size; //!< [0x050-0x053] Size of Flash connected to A1
- uint32_t sflashA2Size; //!< [0x054-0x057] Size of Flash connected to A2
- uint32_t sflashB1Size; //!< [0x058-0x05b] Size of Flash connected to B1
- uint32_t sflashB2Size; //!< [0x05c-0x05f] Size of Flash connected to B2
- uint32_t csPadSettingOverride; //!< [0x060-0x063] CS pad setting override value
- uint32_t sclkPadSettingOverride; //!< [0x064-0x067] SCK pad setting override value
- uint32_t dataPadSettingOverride; //!< [0x068-0x06b] data pad setting override value
- uint32_t dqsPadSettingOverride; //!< [0x06c-0x06f] DQS pad setting override value
- uint32_t timeoutInMs; //!< [0x070-0x073] Timeout threshold for read status command
- uint32_t commandInterval; //!< [0x074-0x077] CS deselect interval between two commands
- uint16_t dataValidTime[2]; //!< [0x078-0x07b] CLK edge to data valid time for PORT A and PORT B, in terms of 0.1ns
- uint16_t busyOffset; //!< [0x07c-0x07d] Busy offset, valid value: 0-31
- uint16_t busyBitPolarity; //!< [0x07e-0x07f] Busy flag polarity, 0 - busy flag is 1 when flash device is busy, 1 -
- //! busy flag is 0 when flash device is busy
- uint32_t lookupTable[64]; //!< [0x080-0x17f] Lookup table holds Flash command sequences
- flexspi_lut_seq_t lutCustomSeq[12]; //!< [0x180-0x1af] Customizable LUT Sequences
- uint32_t reserved4[4]; //!< [0x1b0-0x1bf] Reserved for future use
-} flexspi_mem_config_t;
-
-/* */
-#define NOR_CMD_INDEX_READ CMD_INDEX_READ //!< 0
-#define NOR_CMD_INDEX_READSTATUS CMD_INDEX_READSTATUS //!< 1
-#define NOR_CMD_INDEX_WRITEENABLE CMD_INDEX_WRITEENABLE //!< 2
-#define NOR_CMD_INDEX_ERASESECTOR 3 //!< 3
-#define NOR_CMD_INDEX_PAGEPROGRAM CMD_INDEX_WRITE //!< 4
-#define NOR_CMD_INDEX_CHIPERASE 5 //!< 5
-#define NOR_CMD_INDEX_DUMMY 6 //!< 6
-#define NOR_CMD_INDEX_ERASEBLOCK 7 //!< 7
-
-#define NOR_CMD_LUT_SEQ_IDX_READ CMD_LUT_SEQ_IDX_READ //!< 0 READ LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS \
- CMD_LUT_SEQ_IDX_READSTATUS //!< 1 Read Status LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS_XPI \
- 2 //!< 2 Read status DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE \
- CMD_LUT_SEQ_IDX_WRITEENABLE //!< 3 Write Enable sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_XPI \
- 4 //!< 4 Write Enable DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 5 //!< 5 Erase Sector sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASEBLOCK 8 //!< 8 Erase Block sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM \
- CMD_LUT_SEQ_IDX_WRITE //!< 9 Program sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_CHIPERASE 11 //!< 11 Chip Erase sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READ_SFDP 13 //!< 13 Read SFDP sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_RESTORE_NOCMD \
- 14 //!< 14 Restore 0-4-4/0-8-8 mode sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_EXIT_NOCMD \
- 15 //!< 15 Exit 0-4-4/0-8-8 mode sequence id in lookupTable stored in config blobk
-
-/*
- * Serial NOR configuration block
- */
-typedef struct _flexspi_nor_config
-{
- flexspi_mem_config_t memConfig; //!< Common memory configuration info via FlexSPI
- uint32_t pageSize; //!< Page size of Serial NOR
- uint32_t sectorSize; //!< Sector size of Serial NOR
- uint8_t ipcmdSerialClkFreq; //!< Clock frequency for IP command
- uint8_t isUniformBlockSize; //!< Sector/Block size is the same
- uint8_t reserved0[2]; //!< Reserved for future use
- uint8_t serialNorType; //!< Serial NOR Flash type: 0/1/2/3
- uint8_t needExitNoCmdMode; //!< Need to exit NoCmd mode before other IP command
- uint8_t halfClkForNonReadCmd; //!< Half the Serial Clock for non-read command: true/false
- uint8_t needRestoreNoCmdMode; //!< Need to Restore NoCmd mode after IP commmand execution
- uint32_t blockSize; //!< Block size
- uint32_t reserve2[11]; //!< Reserved for future use
-} flexspi_nor_config_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __EVKMIMXRT1015_FLEXSPI_NOR_CONFIG__ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/board.h b/tinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/board.h
deleted file mode 100755
index 56ed5855..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/board.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-// required since iMX RT10xx SDK include this file for board size
-#define BOARD_FLASH_SIZE (0x800000U)
-
-// LED
-#define LED_PINMUX IOMUXC_GPIO_AD_B0_05_GPIO1_IO05
-#define LED_PORT GPIO1
-#define LED_PIN 5
-#define LED_STATE_ON 0
-
-// SW8 button
-#define BUTTON_PINMUX IOMUXC_SNVS_WAKEUP_GPIO5_IO00
-#define BUTTON_PORT GPIO5
-#define BUTTON_PIN 0
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_PORT LPUART1
-#define UART_RX_PINMUX IOMUXC_GPIO_AD_B0_07_LPUART1_RX
-#define UART_TX_PINMUX IOMUXC_GPIO_AD_B0_06_LPUART1_TX
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/board.mk b/tinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/board.mk
deleted file mode 100755
index b15da1b6..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DCPU_MIMXRT1021DAG5A
-MCU_VARIANT = MIMXRT1021
-
-# For flash-jlink target
-JLINK_DEVICE = MIMXRT1021DAG5A
-
-# For flash-pyocd target
-PYOCD_TARGET = mimxrt1020
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/evkmimxrt1020_flexspi_nor_config.c b/tinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/evkmimxrt1020_flexspi_nor_config.c
deleted file mode 100755
index 6bafe195..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/evkmimxrt1020_flexspi_nor_config.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2018 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include "evkmimxrt1020_flexspi_nor_config.h"
-
-/* Component ID definition, used by tools. */
-#ifndef FSL_COMPONENT_ID
-#define FSL_COMPONENT_ID "platform.drivers.xip_board"
-#endif
-
-/*******************************************************************************
- * Code
- ******************************************************************************/
-#if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1)
-#if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__)
-__attribute__((section(".boot_hdr.conf")))
-#elif defined(__ICCARM__)
-#pragma location = ".boot_hdr.conf"
-#endif
-
-const flexspi_nor_config_t qspiflash_config = {
- .memConfig =
- {
- .tag = FLEXSPI_CFG_BLK_TAG,
- .version = FLEXSPI_CFG_BLK_VERSION,
- .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad,
- .csHoldTime = 3u,
- .csSetupTime = 3u,
- // Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
- .sflashPadType = kSerialFlash_4Pads,
- .serialClkFreq = kFlexSpiSerialClk_100MHz,
- .sflashA1Size = 8u * 1024u * 1024u,
- .lookupTable =
- {
- // Read LUTs
- FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
- FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
- },
- },
- .pageSize = 256u,
- .sectorSize = 4u * 1024u,
- .blockSize = 256u * 1024u,
- .isUniformBlockSize = false,
-};
-#endif /* XIP_BOOT_HEADER_ENABLE */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/evkmimxrt1020_flexspi_nor_config.h b/tinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/evkmimxrt1020_flexspi_nor_config.h
deleted file mode 100755
index f5e1aca5..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1020_evk/evkmimxrt1020_flexspi_nor_config.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright 2018 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef __EVKMIMXRT1020_FLEXSPI_NOR_CONFIG__
-#define __EVKMIMXRT1020_FLEXSPI_NOR_CONFIG__
-
-#include <stdint.h>
-#include <stdbool.h>
-#include "fsl_common.h"
-
-/*! @name Driver version */
-/*@{*/
-/*! @brief XIP_BOARD driver version 2.0.0. */
-#define FSL_XIP_BOARD_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
-/*@}*/
-
-/* FLEXSPI memory config block related defintions */
-#define FLEXSPI_CFG_BLK_TAG (0x42464346UL) // ascii "FCFB" Big Endian
-#define FLEXSPI_CFG_BLK_VERSION (0x56010400UL) // V1.4.0
-#define FLEXSPI_CFG_BLK_SIZE (512)
-
-/* FLEXSPI Feature related definitions */
-#define FLEXSPI_FEATURE_HAS_PARALLEL_MODE 1
-
-/* Lookup table related defintions */
-#define CMD_INDEX_READ 0
-#define CMD_INDEX_READSTATUS 1
-#define CMD_INDEX_WRITEENABLE 2
-#define CMD_INDEX_WRITE 4
-
-#define CMD_LUT_SEQ_IDX_READ 0
-#define CMD_LUT_SEQ_IDX_READSTATUS 1
-#define CMD_LUT_SEQ_IDX_WRITEENABLE 3
-#define CMD_LUT_SEQ_IDX_WRITE 9
-
-#define CMD_SDR 0x01
-#define CMD_DDR 0x21
-#define RADDR_SDR 0x02
-#define RADDR_DDR 0x22
-#define CADDR_SDR 0x03
-#define CADDR_DDR 0x23
-#define MODE1_SDR 0x04
-#define MODE1_DDR 0x24
-#define MODE2_SDR 0x05
-#define MODE2_DDR 0x25
-#define MODE4_SDR 0x06
-#define MODE4_DDR 0x26
-#define MODE8_SDR 0x07
-#define MODE8_DDR 0x27
-#define WRITE_SDR 0x08
-#define WRITE_DDR 0x28
-#define READ_SDR 0x09
-#define READ_DDR 0x29
-#define LEARN_SDR 0x0A
-#define LEARN_DDR 0x2A
-#define DATSZ_SDR 0x0B
-#define DATSZ_DDR 0x2B
-#define DUMMY_SDR 0x0C
-#define DUMMY_DDR 0x2C
-#define DUMMY_RWDS_SDR 0x0D
-#define DUMMY_RWDS_DDR 0x2D
-#define JMP_ON_CS 0x1F
-#define STOP 0
-
-#define FLEXSPI_1PAD 0
-#define FLEXSPI_2PAD 1
-#define FLEXSPI_4PAD 2
-#define FLEXSPI_8PAD 3
-
-#define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \
- (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \
- FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1))
-
-//!@brief Definitions for FlexSPI Serial Clock Frequency
-typedef enum _FlexSpiSerialClockFreq
-{
- kFlexSpiSerialClk_30MHz = 1,
- kFlexSpiSerialClk_50MHz = 2,
- kFlexSpiSerialClk_60MHz = 3,
- kFlexSpiSerialClk_75MHz = 4,
- kFlexSpiSerialClk_80MHz = 5,
- kFlexSpiSerialClk_100MHz = 6,
- kFlexSpiSerialClk_133MHz = 7,
- kFlexSpiSerialClk_166MHz = 8,
- kFlexSpiSerialClk_200MHz = 9,
-} flexspi_serial_clk_freq_t;
-
-//!@brief FlexSPI clock configuration type
-enum
-{
- kFlexSpiClk_SDR, //!< Clock configure for SDR mode
- kFlexSpiClk_DDR, //!< Clock configurat for DDR mode
-};
-
-//!@brief FlexSPI Read Sample Clock Source definition
-typedef enum _FlashReadSampleClkSource
-{
- kFlexSPIReadSampleClk_LoopbackInternally = 0,
- kFlexSPIReadSampleClk_LoopbackFromDqsPad = 1,
- kFlexSPIReadSampleClk_LoopbackFromSckPad = 2,
- kFlexSPIReadSampleClk_ExternalInputFromDqsPad = 3,
-} flexspi_read_sample_clk_t;
-
-//!@brief Misc feature bit definitions
-enum
-{
- kFlexSpiMiscOffset_DiffClkEnable = 0, //!< Bit for Differential clock enable
- kFlexSpiMiscOffset_Ck2Enable = 1, //!< Bit for CK2 enable
- kFlexSpiMiscOffset_ParallelEnable = 2, //!< Bit for Parallel mode enable
- kFlexSpiMiscOffset_WordAddressableEnable = 3, //!< Bit for Word Addressable enable
- kFlexSpiMiscOffset_SafeConfigFreqEnable = 4, //!< Bit for Safe Configuration Frequency enable
- kFlexSpiMiscOffset_PadSettingOverrideEnable = 5, //!< Bit for Pad setting override enable
- kFlexSpiMiscOffset_DdrModeEnable = 6, //!< Bit for DDR clock confiuration indication.
-};
-
-//!@brief Flash Type Definition
-enum
-{
- kFlexSpiDeviceType_SerialNOR = 1, //!< Flash devices are Serial NOR
- kFlexSpiDeviceType_SerialNAND = 2, //!< Flash devices are Serial NAND
- kFlexSpiDeviceType_SerialRAM = 3, //!< Flash devices are Serial RAM/HyperFLASH
- kFlexSpiDeviceType_MCP_NOR_NAND = 0x12, //!< Flash device is MCP device, A1 is Serial NOR, A2 is Serial NAND
- kFlexSpiDeviceType_MCP_NOR_RAM = 0x13, //!< Flash deivce is MCP device, A1 is Serial NOR, A2 is Serial RAMs
-};
-
-//!@brief Flash Pad Definitions
-enum
-{
- kSerialFlash_1Pad = 1,
- kSerialFlash_2Pads = 2,
- kSerialFlash_4Pads = 4,
- kSerialFlash_8Pads = 8,
-};
-
-//!@brief FlexSPI LUT Sequence structure
-typedef struct _lut_sequence
-{
- uint8_t seqNum; //!< Sequence Number, valid number: 1-16
- uint8_t seqId; //!< Sequence Index, valid number: 0-15
- uint16_t reserved;
-} flexspi_lut_seq_t;
-
-//!@brief Flash Configuration Command Type
-enum
-{
- kDeviceConfigCmdType_Generic, //!< Generic command, for example: configure dummy cycles, drive strength, etc
- kDeviceConfigCmdType_QuadEnable, //!< Quad Enable command
- kDeviceConfigCmdType_Spi2Xpi, //!< Switch from SPI to DPI/QPI/OPI mode
- kDeviceConfigCmdType_Xpi2Spi, //!< Switch from DPI/QPI/OPI to SPI mode
- kDeviceConfigCmdType_Spi2NoCmd, //!< Switch to 0-4-4/0-8-8 mode
- kDeviceConfigCmdType_Reset, //!< Reset device command
-};
-
-//!@brief FlexSPI Memory Configuration Block
-typedef struct _FlexSPIConfig
-{
- uint32_t tag; //!< [0x000-0x003] Tag, fixed value 0x42464346UL
- uint32_t version; //!< [0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix
- uint32_t reserved0; //!< [0x008-0x00b] Reserved for future use
- uint8_t readSampleClkSrc; //!< [0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3
- uint8_t csHoldTime; //!< [0x00d-0x00d] CS hold time, default value: 3
- uint8_t csSetupTime; //!< [0x00e-0x00e] CS setup time, default value: 3
- uint8_t columnAddressWidth; //!< [0x00f-0x00f] Column Address with, for HyperBus protocol, it is fixed to 3, For
- //! Serial NAND, need to refer to datasheet
- uint8_t deviceModeCfgEnable; //!< [0x010-0x010] Device Mode Configure enable flag, 1 - Enable, 0 - Disable
- uint8_t deviceModeType; //!< [0x011-0x011] Specify the configuration command type:Quad Enable, DPI/QPI/OPI switch,
- //! Generic configuration, etc.
- uint16_t waitTimeCfgCommands; //!< [0x012-0x013] Wait time for all configuration commands, unit: 100us, Used for
- //! DPI/QPI/OPI switch or reset command
- flexspi_lut_seq_t deviceModeSeq; //!< [0x014-0x017] Device mode sequence info, [7:0] - LUT sequence id, [15:8] - LUt
- //! sequence number, [31:16] Reserved
- uint32_t deviceModeArg; //!< [0x018-0x01b] Argument/Parameter for device configuration
- uint8_t configCmdEnable; //!< [0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable
- uint8_t configModeType[3]; //!< [0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe
- flexspi_lut_seq_t
- configCmdSeqs[3]; //!< [0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq
- uint32_t reserved1; //!< [0x02c-0x02f] Reserved for future use
- uint32_t configCmdArgs[3]; //!< [0x030-0x03b] Arguments/Parameters for device Configuration commands
- uint32_t reserved2; //!< [0x03c-0x03f] Reserved for future use
- uint32_t controllerMiscOption; //!< [0x040-0x043] Controller Misc Options, see Misc feature bit definitions for more
- //! details
- uint8_t deviceType; //!< [0x044-0x044] Device Type: See Flash Type Definition for more details
- uint8_t sflashPadType; //!< [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal
- uint8_t serialClkFreq; //!< [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot
- //! Chapter for more details
- uint8_t lutCustomSeqEnable; //!< [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot
- //! be done using 1 LUT sequence, currently, only applicable to HyperFLASH
- uint32_t reserved3[2]; //!< [0x048-0x04f] Reserved for future use
- uint32_t sflashA1Size; //!< [0x050-0x053] Size of Flash connected to A1
- uint32_t sflashA2Size; //!< [0x054-0x057] Size of Flash connected to A2
- uint32_t sflashB1Size; //!< [0x058-0x05b] Size of Flash connected to B1
- uint32_t sflashB2Size; //!< [0x05c-0x05f] Size of Flash connected to B2
- uint32_t csPadSettingOverride; //!< [0x060-0x063] CS pad setting override value
- uint32_t sclkPadSettingOverride; //!< [0x064-0x067] SCK pad setting override value
- uint32_t dataPadSettingOverride; //!< [0x068-0x06b] data pad setting override value
- uint32_t dqsPadSettingOverride; //!< [0x06c-0x06f] DQS pad setting override value
- uint32_t timeoutInMs; //!< [0x070-0x073] Timeout threshold for read status command
- uint32_t commandInterval; //!< [0x074-0x077] CS deselect interval between two commands
- uint16_t dataValidTime[2]; //!< [0x078-0x07b] CLK edge to data valid time for PORT A and PORT B, in terms of 0.1ns
- uint16_t busyOffset; //!< [0x07c-0x07d] Busy offset, valid value: 0-31
- uint16_t busyBitPolarity; //!< [0x07e-0x07f] Busy flag polarity, 0 - busy flag is 1 when flash device is busy, 1 -
- //! busy flag is 0 when flash device is busy
- uint32_t lookupTable[64]; //!< [0x080-0x17f] Lookup table holds Flash command sequences
- flexspi_lut_seq_t lutCustomSeq[12]; //!< [0x180-0x1af] Customizable LUT Sequences
- uint32_t reserved4[4]; //!< [0x1b0-0x1bf] Reserved for future use
-} flexspi_mem_config_t;
-
-/* */
-#define NOR_CMD_INDEX_READ CMD_INDEX_READ //!< 0
-#define NOR_CMD_INDEX_READSTATUS CMD_INDEX_READSTATUS //!< 1
-#define NOR_CMD_INDEX_WRITEENABLE CMD_INDEX_WRITEENABLE //!< 2
-#define NOR_CMD_INDEX_ERASESECTOR 3 //!< 3
-#define NOR_CMD_INDEX_PAGEPROGRAM CMD_INDEX_WRITE //!< 4
-#define NOR_CMD_INDEX_CHIPERASE 5 //!< 5
-#define NOR_CMD_INDEX_DUMMY 6 //!< 6
-#define NOR_CMD_INDEX_ERASEBLOCK 7 //!< 7
-
-#define NOR_CMD_LUT_SEQ_IDX_READ CMD_LUT_SEQ_IDX_READ //!< 0 READ LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS \
- CMD_LUT_SEQ_IDX_READSTATUS //!< 1 Read Status LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS_XPI \
- 2 //!< 2 Read status DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE \
- CMD_LUT_SEQ_IDX_WRITEENABLE //!< 3 Write Enable sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_XPI \
- 4 //!< 4 Write Enable DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 5 //!< 5 Erase Sector sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASEBLOCK 8 //!< 8 Erase Block sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM \
- CMD_LUT_SEQ_IDX_WRITE //!< 9 Program sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_CHIPERASE 11 //!< 11 Chip Erase sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READ_SFDP 13 //!< 13 Read SFDP sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_RESTORE_NOCMD \
- 14 //!< 14 Restore 0-4-4/0-8-8 mode sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_EXIT_NOCMD \
- 15 //!< 15 Exit 0-4-4/0-8-8 mode sequence id in lookupTable stored in config blobk
-
-/*
- * Serial NOR configuration block
- */
-typedef struct _flexspi_nor_config
-{
- flexspi_mem_config_t memConfig; //!< Common memory configuration info via FlexSPI
- uint32_t pageSize; //!< Page size of Serial NOR
- uint32_t sectorSize; //!< Sector size of Serial NOR
- uint8_t ipcmdSerialClkFreq; //!< Clock frequency for IP command
- uint8_t isUniformBlockSize; //!< Sector/Block size is the same
- uint8_t reserved0[2]; //!< Reserved for future use
- uint8_t serialNorType; //!< Serial NOR Flash type: 0/1/2/3
- uint8_t needExitNoCmdMode; //!< Need to exit NoCmd mode before other IP command
- uint8_t halfClkForNonReadCmd; //!< Half the Serial Clock for non-read command: true/false
- uint8_t needRestoreNoCmdMode; //!< Need to Restore NoCmd mode after IP commmand execution
- uint32_t blockSize; //!< Block size
- uint32_t reserve2[11]; //!< Reserved for future use
-} flexspi_nor_config_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __EVKMIMXRT1020_FLEXSPI_NOR_CONFIG__ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/board.h b/tinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/board.h
deleted file mode 100755
index 928fbd72..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/board.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-// required since iMX RT10xx SDK include this file for board size
-#define BOARD_FLASH_SIZE (0x4000000U)
-
-// LED
-#define LED_PINMUX IOMUXC_GPIO_AD_B0_09_GPIO1_IO09
-#define LED_PORT GPIO1
-#define LED_PIN 9
-#define LED_STATE_ON 0
-
-// SW8 button
-#define BUTTON_PINMUX IOMUXC_SNVS_WAKEUP_GPIO5_IO00
-#define BUTTON_PORT GPIO5
-#define BUTTON_PIN 0
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_PORT LPUART1
-#define UART_RX_PINMUX IOMUXC_GPIO_AD_B0_13_LPUART1_RX
-#define UART_TX_PINMUX IOMUXC_GPIO_AD_B0_12_LPUART1_TX
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/board.mk b/tinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/board.mk
deleted file mode 100755
index 9fd22910..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/board.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-CFLAGS += -DCPU_MIMXRT1052DVL6B
-MCU_VARIANT = MIMXRT1052
-
-# For flash-pyocd target
-PYOCD_TARGET = mimxrt1050
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/evkbimxrt1050_flexspi_nor_config.c b/tinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/evkbimxrt1050_flexspi_nor_config.c
deleted file mode 100755
index af6eabc8..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/evkbimxrt1050_flexspi_nor_config.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2017 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include "evkbimxrt1050_flexspi_nor_config.h"
-
-/* Component ID definition, used by tools. */
-#ifndef FSL_COMPONENT_ID
-#define FSL_COMPONENT_ID "platform.drivers.xip_board"
-#endif
-
-/*******************************************************************************
- * Code
- ******************************************************************************/
-#if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1)
-#if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__)
-__attribute__((section(".boot_hdr.conf")))
-#elif defined(__ICCARM__)
-#pragma location = ".boot_hdr.conf"
-#endif
-
-const flexspi_nor_config_t hyperflash_config = {
- .memConfig =
- {
- .tag = FLEXSPI_CFG_BLK_TAG,
- .version = FLEXSPI_CFG_BLK_VERSION,
- .readSampleClkSrc = kFlexSPIReadSampleClk_ExternalInputFromDqsPad,
- .csHoldTime = 3u,
- .csSetupTime = 3u,
- .columnAddressWidth = 3u,
- // Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
- .controllerMiscOption =
- (1u << kFlexSpiMiscOffset_DdrModeEnable) | (1u << kFlexSpiMiscOffset_WordAddressableEnable) |
- (1u << kFlexSpiMiscOffset_SafeConfigFreqEnable) | (1u << kFlexSpiMiscOffset_DiffClkEnable),
- .sflashPadType = kSerialFlash_8Pads,
- .serialClkFreq = kFlexSpiSerialClk_133MHz,
- .sflashA1Size = 64u * 1024u * 1024u,
- .dataValidTime = {16u, 16u},
- .lookupTable =
- {
- // Read LUTs
- FLEXSPI_LUT_SEQ(CMD_DDR, FLEXSPI_8PAD, 0xA0, RADDR_DDR, FLEXSPI_8PAD, 0x18),
- FLEXSPI_LUT_SEQ(CADDR_DDR, FLEXSPI_8PAD, 0x10, DUMMY_DDR, FLEXSPI_8PAD, 0x06),
- FLEXSPI_LUT_SEQ(READ_DDR, FLEXSPI_8PAD, 0x04, STOP, FLEXSPI_1PAD, 0x0),
- },
- },
- .pageSize = 512u,
- .sectorSize = 256u * 1024u,
- .blockSize = 256u * 1024u,
- .isUniformBlockSize = true,
-};
-#endif /* XIP_BOOT_HEADER_ENABLE */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/evkbimxrt1050_flexspi_nor_config.h b/tinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/evkbimxrt1050_flexspi_nor_config.h
deleted file mode 100755
index fe40e7ed..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1050_evkb/evkbimxrt1050_flexspi_nor_config.h
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Copyright (c) 2016, Freescale Semiconductor, Inc.
- * Copyright 2016-2017 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef __EVKBIMXRT1050_FLEXSPI_NOR_CONFIG__
-#define __EVKBIMXRT1050_FLEXSPI_NOR_CONFIG__
-
-#include <stdint.h>
-#include <stdbool.h>
-#include "fsl_common.h"
-
-/*! @name Driver version */
-/*@{*/
-/*! @brief XIP_BOARD driver version 2.0.0. */
-#define FSL_XIP_BOARD_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
-/*@}*/
-
-/* FLEXSPI memory config block related defintions */
-#define FLEXSPI_CFG_BLK_TAG (0x42464346UL) // ascii "FCFB" Big Endian
-#define FLEXSPI_CFG_BLK_VERSION (0x56010400UL) // V1.4.0
-#define FLEXSPI_CFG_BLK_SIZE (512)
-
-/* FLEXSPI Feature related definitions */
-#define FLEXSPI_FEATURE_HAS_PARALLEL_MODE 1
-
-/* Lookup table related defintions */
-#define CMD_INDEX_READ 0
-#define CMD_INDEX_READSTATUS 1
-#define CMD_INDEX_WRITEENABLE 2
-#define CMD_INDEX_WRITE 4
-
-#define CMD_LUT_SEQ_IDX_READ 0
-#define CMD_LUT_SEQ_IDX_READSTATUS 1
-#define CMD_LUT_SEQ_IDX_WRITEENABLE 3
-#define CMD_LUT_SEQ_IDX_WRITE 9
-
-#define CMD_SDR 0x01
-#define CMD_DDR 0x21
-#define RADDR_SDR 0x02
-#define RADDR_DDR 0x22
-#define CADDR_SDR 0x03
-#define CADDR_DDR 0x23
-#define MODE1_SDR 0x04
-#define MODE1_DDR 0x24
-#define MODE2_SDR 0x05
-#define MODE2_DDR 0x25
-#define MODE4_SDR 0x06
-#define MODE4_DDR 0x26
-#define MODE8_SDR 0x07
-#define MODE8_DDR 0x27
-#define WRITE_SDR 0x08
-#define WRITE_DDR 0x28
-#define READ_SDR 0x09
-#define READ_DDR 0x29
-#define LEARN_SDR 0x0A
-#define LEARN_DDR 0x2A
-#define DATSZ_SDR 0x0B
-#define DATSZ_DDR 0x2B
-#define DUMMY_SDR 0x0C
-#define DUMMY_DDR 0x2C
-#define DUMMY_RWDS_SDR 0x0D
-#define DUMMY_RWDS_DDR 0x2D
-#define JMP_ON_CS 0x1F
-#define STOP 0
-
-#define FLEXSPI_1PAD 0
-#define FLEXSPI_2PAD 1
-#define FLEXSPI_4PAD 2
-#define FLEXSPI_8PAD 3
-
-#define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \
- (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \
- FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1))
-
-//!@brief Definitions for FlexSPI Serial Clock Frequency
-typedef enum _FlexSpiSerialClockFreq
-{
- kFlexSpiSerialClk_30MHz = 1,
- kFlexSpiSerialClk_50MHz = 2,
- kFlexSpiSerialClk_60MHz = 3,
- kFlexSpiSerialClk_75MHz = 4,
- kFlexSpiSerialClk_80MHz = 5,
- kFlexSpiSerialClk_100MHz = 6,
- kFlexSpiSerialClk_133MHz = 7,
- kFlexSpiSerialClk_166MHz = 8,
- kFlexSpiSerialClk_200MHz = 9,
-} flexspi_serial_clk_freq_t;
-
-//!@brief FlexSPI clock configuration type
-enum
-{
- kFlexSpiClk_SDR, //!< Clock configure for SDR mode
- kFlexSpiClk_DDR, //!< Clock configurat for DDR mode
-};
-
-//!@brief FlexSPI Read Sample Clock Source definition
-typedef enum _FlashReadSampleClkSource
-{
- kFlexSPIReadSampleClk_LoopbackInternally = 0,
- kFlexSPIReadSampleClk_LoopbackFromDqsPad = 1,
- kFlexSPIReadSampleClk_LoopbackFromSckPad = 2,
- kFlexSPIReadSampleClk_ExternalInputFromDqsPad = 3,
-} flexspi_read_sample_clk_t;
-
-//!@brief Misc feature bit definitions
-enum
-{
- kFlexSpiMiscOffset_DiffClkEnable = 0, //!< Bit for Differential clock enable
- kFlexSpiMiscOffset_Ck2Enable = 1, //!< Bit for CK2 enable
- kFlexSpiMiscOffset_ParallelEnable = 2, //!< Bit for Parallel mode enable
- kFlexSpiMiscOffset_WordAddressableEnable = 3, //!< Bit for Word Addressable enable
- kFlexSpiMiscOffset_SafeConfigFreqEnable = 4, //!< Bit for Safe Configuration Frequency enable
- kFlexSpiMiscOffset_PadSettingOverrideEnable = 5, //!< Bit for Pad setting override enable
- kFlexSpiMiscOffset_DdrModeEnable = 6, //!< Bit for DDR clock confiuration indication.
-};
-
-//!@brief Flash Type Definition
-enum
-{
- kFlexSpiDeviceType_SerialNOR = 1, //!< Flash devices are Serial NOR
- kFlexSpiDeviceType_SerialNAND = 2, //!< Flash devices are Serial NAND
- kFlexSpiDeviceType_SerialRAM = 3, //!< Flash devices are Serial RAM/HyperFLASH
- kFlexSpiDeviceType_MCP_NOR_NAND = 0x12, //!< Flash device is MCP device, A1 is Serial NOR, A2 is Serial NAND
- kFlexSpiDeviceType_MCP_NOR_RAM = 0x13, //!< Flash deivce is MCP device, A1 is Serial NOR, A2 is Serial RAMs
-};
-
-//!@brief Flash Pad Definitions
-enum
-{
- kSerialFlash_1Pad = 1,
- kSerialFlash_2Pads = 2,
- kSerialFlash_4Pads = 4,
- kSerialFlash_8Pads = 8,
-};
-
-//!@brief FlexSPI LUT Sequence structure
-typedef struct _lut_sequence
-{
- uint8_t seqNum; //!< Sequence Number, valid number: 1-16
- uint8_t seqId; //!< Sequence Index, valid number: 0-15
- uint16_t reserved;
-} flexspi_lut_seq_t;
-
-//!@brief Flash Configuration Command Type
-enum
-{
- kDeviceConfigCmdType_Generic, //!< Generic command, for example: configure dummy cycles, drive strength, etc
- kDeviceConfigCmdType_QuadEnable, //!< Quad Enable command
- kDeviceConfigCmdType_Spi2Xpi, //!< Switch from SPI to DPI/QPI/OPI mode
- kDeviceConfigCmdType_Xpi2Spi, //!< Switch from DPI/QPI/OPI to SPI mode
- kDeviceConfigCmdType_Spi2NoCmd, //!< Switch to 0-4-4/0-8-8 mode
- kDeviceConfigCmdType_Reset, //!< Reset device command
-};
-
-//!@brief FlexSPI Memory Configuration Block
-typedef struct _FlexSPIConfig
-{
- uint32_t tag; //!< [0x000-0x003] Tag, fixed value 0x42464346UL
- uint32_t version; //!< [0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix
- uint32_t reserved0; //!< [0x008-0x00b] Reserved for future use
- uint8_t readSampleClkSrc; //!< [0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3
- uint8_t csHoldTime; //!< [0x00d-0x00d] CS hold time, default value: 3
- uint8_t csSetupTime; //!< [0x00e-0x00e] CS setup time, default value: 3
- uint8_t columnAddressWidth; //!< [0x00f-0x00f] Column Address with, for HyperBus protocol, it is fixed to 3, For
- //! Serial NAND, need to refer to datasheet
- uint8_t deviceModeCfgEnable; //!< [0x010-0x010] Device Mode Configure enable flag, 1 - Enable, 0 - Disable
- uint8_t deviceModeType; //!< [0x011-0x011] Specify the configuration command type:Quad Enable, DPI/QPI/OPI switch,
- //! Generic configuration, etc.
- uint16_t waitTimeCfgCommands; //!< [0x012-0x013] Wait time for all configuration commands, unit: 100us, Used for
- //! DPI/QPI/OPI switch or reset command
- flexspi_lut_seq_t deviceModeSeq; //!< [0x014-0x017] Device mode sequence info, [7:0] - LUT sequence id, [15:8] - LUt
- //! sequence number, [31:16] Reserved
- uint32_t deviceModeArg; //!< [0x018-0x01b] Argument/Parameter for device configuration
- uint8_t configCmdEnable; //!< [0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable
- uint8_t configModeType[3]; //!< [0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe
- flexspi_lut_seq_t
- configCmdSeqs[3]; //!< [0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq
- uint32_t reserved1; //!< [0x02c-0x02f] Reserved for future use
- uint32_t configCmdArgs[3]; //!< [0x030-0x03b] Arguments/Parameters for device Configuration commands
- uint32_t reserved2; //!< [0x03c-0x03f] Reserved for future use
- uint32_t controllerMiscOption; //!< [0x040-0x043] Controller Misc Options, see Misc feature bit definitions for more
- //! details
- uint8_t deviceType; //!< [0x044-0x044] Device Type: See Flash Type Definition for more details
- uint8_t sflashPadType; //!< [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal
- uint8_t serialClkFreq; //!< [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot
- //! Chapter for more details
- uint8_t lutCustomSeqEnable; //!< [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot
- //! be done using 1 LUT sequence, currently, only applicable to HyperFLASH
- uint32_t reserved3[2]; //!< [0x048-0x04f] Reserved for future use
- uint32_t sflashA1Size; //!< [0x050-0x053] Size of Flash connected to A1
- uint32_t sflashA2Size; //!< [0x054-0x057] Size of Flash connected to A2
- uint32_t sflashB1Size; //!< [0x058-0x05b] Size of Flash connected to B1
- uint32_t sflashB2Size; //!< [0x05c-0x05f] Size of Flash connected to B2
- uint32_t csPadSettingOverride; //!< [0x060-0x063] CS pad setting override value
- uint32_t sclkPadSettingOverride; //!< [0x064-0x067] SCK pad setting override value
- uint32_t dataPadSettingOverride; //!< [0x068-0x06b] data pad setting override value
- uint32_t dqsPadSettingOverride; //!< [0x06c-0x06f] DQS pad setting override value
- uint32_t timeoutInMs; //!< [0x070-0x073] Timeout threshold for read status command
- uint32_t commandInterval; //!< [0x074-0x077] CS deselect interval between two commands
- uint16_t dataValidTime[2]; //!< [0x078-0x07b] CLK edge to data valid time for PORT A and PORT B, in terms of 0.1ns
- uint16_t busyOffset; //!< [0x07c-0x07d] Busy offset, valid value: 0-31
- uint16_t busyBitPolarity; //!< [0x07e-0x07f] Busy flag polarity, 0 - busy flag is 1 when flash device is busy, 1 -
- //! busy flag is 0 when flash device is busy
- uint32_t lookupTable[64]; //!< [0x080-0x17f] Lookup table holds Flash command sequences
- flexspi_lut_seq_t lutCustomSeq[12]; //!< [0x180-0x1af] Customizable LUT Sequences
- uint32_t reserved4[4]; //!< [0x1b0-0x1bf] Reserved for future use
-} flexspi_mem_config_t;
-
-/* */
-#define NOR_CMD_INDEX_READ CMD_INDEX_READ //!< 0
-#define NOR_CMD_INDEX_READSTATUS CMD_INDEX_READSTATUS //!< 1
-#define NOR_CMD_INDEX_WRITEENABLE CMD_INDEX_WRITEENABLE //!< 2
-#define NOR_CMD_INDEX_ERASESECTOR 3 //!< 3
-#define NOR_CMD_INDEX_PAGEPROGRAM CMD_INDEX_WRITE //!< 4
-#define NOR_CMD_INDEX_CHIPERASE 5 //!< 5
-#define NOR_CMD_INDEX_DUMMY 6 //!< 6
-#define NOR_CMD_INDEX_ERASEBLOCK 7 //!< 7
-
-#define NOR_CMD_LUT_SEQ_IDX_READ CMD_LUT_SEQ_IDX_READ //!< 0 READ LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS \
- CMD_LUT_SEQ_IDX_READSTATUS //!< 1 Read Status LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS_XPI \
- 2 //!< 2 Read status DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE \
- CMD_LUT_SEQ_IDX_WRITEENABLE //!< 3 Write Enable sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_XPI \
- 4 //!< 4 Write Enable DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 5 //!< 5 Erase Sector sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASEBLOCK 8 //!< 8 Erase Block sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM \
- CMD_LUT_SEQ_IDX_WRITE //!< 9 Program sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_CHIPERASE 11 //!< 11 Chip Erase sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READ_SFDP 13 //!< 13 Read SFDP sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_RESTORE_NOCMD \
- 14 //!< 14 Restore 0-4-4/0-8-8 mode sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_EXIT_NOCMD \
- 15 //!< 15 Exit 0-4-4/0-8-8 mode sequence id in lookupTable stored in config blobk
-
-/*
- * Serial NOR configuration block
- */
-typedef struct _flexspi_nor_config
-{
- flexspi_mem_config_t memConfig; //!< Common memory configuration info via FlexSPI
- uint32_t pageSize; //!< Page size of Serial NOR
- uint32_t sectorSize; //!< Sector size of Serial NOR
- uint8_t ipcmdSerialClkFreq; //!< Clock frequency for IP command
- uint8_t isUniformBlockSize; //!< Sector/Block size is the same
- uint8_t reserved0[2]; //!< Reserved for future use
- uint8_t serialNorType; //!< Serial NOR Flash type: 0/1/2/3
- uint8_t needExitNoCmdMode; //!< Need to exit NoCmd mode before other IP command
- uint8_t halfClkForNonReadCmd; //!< Half the Serial Clock for non-read command: true/false
- uint8_t needRestoreNoCmdMode; //!< Need to Restore NoCmd mode after IP commmand execution
- uint32_t blockSize; //!< Block size
- uint32_t reserve2[11]; //!< Reserved for future use
-} flexspi_nor_config_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __EVKBIMXRT1050_FLEXSPI_NOR_CONFIG__ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/board.h b/tinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/board.h
deleted file mode 100755
index 7fa37e33..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/board.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-// required since iMX RT10xx SDK include this file for board size
-#define BOARD_FLASH_SIZE (0x800000U)
-
-// LED
-#define LED_PINMUX IOMUXC_GPIO_AD_B0_09_GPIO1_IO09
-#define LED_PORT GPIO1
-#define LED_PIN 9
-#define LED_STATE_ON 0
-
-// SW8 button
-#define BUTTON_PINMUX IOMUXC_SNVS_WAKEUP_GPIO5_IO00
-#define BUTTON_PORT GPIO5
-#define BUTTON_PIN 0
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_PORT LPUART1
-#define UART_RX_PINMUX IOMUXC_GPIO_AD_B0_13_LPUART1_RX
-#define UART_TX_PINMUX IOMUXC_GPIO_AD_B0_12_LPUART1_TX
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/board.mk b/tinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/board.mk
deleted file mode 100755
index d0498dbb..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DCPU_MIMXRT1062DVL6A
-MCU_VARIANT = MIMXRT1062
-
-# For flash-jlink target
-JLINK_DEVICE = MIMXRT1062xxx6A
-
-# For flash-pyocd target
-PYOCD_TARGET = mimxrt1060
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/evkmimxrt1060_flexspi_nor_config.c b/tinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/evkmimxrt1060_flexspi_nor_config.c
deleted file mode 100755
index 5df2b7c1..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/evkmimxrt1060_flexspi_nor_config.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2018 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include "evkmimxrt1060_flexspi_nor_config.h"
-
-/* Component ID definition, used by tools. */
-#ifndef FSL_COMPONENT_ID
-#define FSL_COMPONENT_ID "platform.drivers.xip_board"
-#endif
-
-/*******************************************************************************
- * Code
- ******************************************************************************/
-#if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1)
-#if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__)
-__attribute__((section(".boot_hdr.conf")))
-#elif defined(__ICCARM__)
-#pragma location = ".boot_hdr.conf"
-#endif
-
-const flexspi_nor_config_t qspiflash_config = {
- .memConfig =
- {
- .tag = FLEXSPI_CFG_BLK_TAG,
- .version = FLEXSPI_CFG_BLK_VERSION,
- .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad,
- .csHoldTime = 3u,
- .csSetupTime = 3u,
- // Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
- .sflashPadType = kSerialFlash_4Pads,
- .serialClkFreq = kFlexSpiSerialClk_100MHz,
- .sflashA1Size = 8u * 1024u * 1024u,
- .lookupTable =
- {
- // Read LUTs
- FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
- FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
- },
- },
- .pageSize = 256u,
- .sectorSize = 4u * 1024u,
- .blockSize = 256u * 1024u,
- .isUniformBlockSize = false,
-};
-#endif /* XIP_BOOT_HEADER_ENABLE */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/evkmimxrt1060_flexspi_nor_config.h b/tinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/evkmimxrt1060_flexspi_nor_config.h
deleted file mode 100755
index 28d7db57..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1060_evk/evkmimxrt1060_flexspi_nor_config.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright 2018 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef __EVKMIMXRT1060_FLEXSPI_NOR_CONFIG__
-#define __EVKMIMXRT1060_FLEXSPI_NOR_CONFIG__
-
-#include <stdint.h>
-#include <stdbool.h>
-#include "fsl_common.h"
-
-/*! @name Driver version */
-/*@{*/
-/*! @brief XIP_BOARD driver version 2.0.0. */
-#define FSL_XIP_BOARD_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
-/*@}*/
-
-/* FLEXSPI memory config block related defintions */
-#define FLEXSPI_CFG_BLK_TAG (0x42464346UL) // ascii "FCFB" Big Endian
-#define FLEXSPI_CFG_BLK_VERSION (0x56010400UL) // V1.4.0
-#define FLEXSPI_CFG_BLK_SIZE (512)
-
-/* FLEXSPI Feature related definitions */
-#define FLEXSPI_FEATURE_HAS_PARALLEL_MODE 1
-
-/* Lookup table related defintions */
-#define CMD_INDEX_READ 0
-#define CMD_INDEX_READSTATUS 1
-#define CMD_INDEX_WRITEENABLE 2
-#define CMD_INDEX_WRITE 4
-
-#define CMD_LUT_SEQ_IDX_READ 0
-#define CMD_LUT_SEQ_IDX_READSTATUS 1
-#define CMD_LUT_SEQ_IDX_WRITEENABLE 3
-#define CMD_LUT_SEQ_IDX_WRITE 9
-
-#define CMD_SDR 0x01
-#define CMD_DDR 0x21
-#define RADDR_SDR 0x02
-#define RADDR_DDR 0x22
-#define CADDR_SDR 0x03
-#define CADDR_DDR 0x23
-#define MODE1_SDR 0x04
-#define MODE1_DDR 0x24
-#define MODE2_SDR 0x05
-#define MODE2_DDR 0x25
-#define MODE4_SDR 0x06
-#define MODE4_DDR 0x26
-#define MODE8_SDR 0x07
-#define MODE8_DDR 0x27
-#define WRITE_SDR 0x08
-#define WRITE_DDR 0x28
-#define READ_SDR 0x09
-#define READ_DDR 0x29
-#define LEARN_SDR 0x0A
-#define LEARN_DDR 0x2A
-#define DATSZ_SDR 0x0B
-#define DATSZ_DDR 0x2B
-#define DUMMY_SDR 0x0C
-#define DUMMY_DDR 0x2C
-#define DUMMY_RWDS_SDR 0x0D
-#define DUMMY_RWDS_DDR 0x2D
-#define JMP_ON_CS 0x1F
-#define STOP 0
-
-#define FLEXSPI_1PAD 0
-#define FLEXSPI_2PAD 1
-#define FLEXSPI_4PAD 2
-#define FLEXSPI_8PAD 3
-
-#define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \
- (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \
- FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1))
-
-//!@brief Definitions for FlexSPI Serial Clock Frequency
-typedef enum _FlexSpiSerialClockFreq
-{
- kFlexSpiSerialClk_30MHz = 1,
- kFlexSpiSerialClk_50MHz = 2,
- kFlexSpiSerialClk_60MHz = 3,
- kFlexSpiSerialClk_75MHz = 4,
- kFlexSpiSerialClk_80MHz = 5,
- kFlexSpiSerialClk_100MHz = 6,
- kFlexSpiSerialClk_120MHz = 7,
- kFlexSpiSerialClk_133MHz = 8,
- kFlexSpiSerialClk_166MHz = 9,
-} flexspi_serial_clk_freq_t;
-
-//!@brief FlexSPI clock configuration type
-enum
-{
- kFlexSpiClk_SDR, //!< Clock configure for SDR mode
- kFlexSpiClk_DDR, //!< Clock configurat for DDR mode
-};
-
-//!@brief FlexSPI Read Sample Clock Source definition
-typedef enum _FlashReadSampleClkSource
-{
- kFlexSPIReadSampleClk_LoopbackInternally = 0,
- kFlexSPIReadSampleClk_LoopbackFromDqsPad = 1,
- kFlexSPIReadSampleClk_LoopbackFromSckPad = 2,
- kFlexSPIReadSampleClk_ExternalInputFromDqsPad = 3,
-} flexspi_read_sample_clk_t;
-
-//!@brief Misc feature bit definitions
-enum
-{
- kFlexSpiMiscOffset_DiffClkEnable = 0, //!< Bit for Differential clock enable
- kFlexSpiMiscOffset_Ck2Enable = 1, //!< Bit for CK2 enable
- kFlexSpiMiscOffset_ParallelEnable = 2, //!< Bit for Parallel mode enable
- kFlexSpiMiscOffset_WordAddressableEnable = 3, //!< Bit for Word Addressable enable
- kFlexSpiMiscOffset_SafeConfigFreqEnable = 4, //!< Bit for Safe Configuration Frequency enable
- kFlexSpiMiscOffset_PadSettingOverrideEnable = 5, //!< Bit for Pad setting override enable
- kFlexSpiMiscOffset_DdrModeEnable = 6, //!< Bit for DDR clock confiuration indication.
-};
-
-//!@brief Flash Type Definition
-enum
-{
- kFlexSpiDeviceType_SerialNOR = 1, //!< Flash devices are Serial NOR
- kFlexSpiDeviceType_SerialNAND = 2, //!< Flash devices are Serial NAND
- kFlexSpiDeviceType_SerialRAM = 3, //!< Flash devices are Serial RAM/HyperFLASH
- kFlexSpiDeviceType_MCP_NOR_NAND = 0x12, //!< Flash device is MCP device, A1 is Serial NOR, A2 is Serial NAND
- kFlexSpiDeviceType_MCP_NOR_RAM = 0x13, //!< Flash deivce is MCP device, A1 is Serial NOR, A2 is Serial RAMs
-};
-
-//!@brief Flash Pad Definitions
-enum
-{
- kSerialFlash_1Pad = 1,
- kSerialFlash_2Pads = 2,
- kSerialFlash_4Pads = 4,
- kSerialFlash_8Pads = 8,
-};
-
-//!@brief FlexSPI LUT Sequence structure
-typedef struct _lut_sequence
-{
- uint8_t seqNum; //!< Sequence Number, valid number: 1-16
- uint8_t seqId; //!< Sequence Index, valid number: 0-15
- uint16_t reserved;
-} flexspi_lut_seq_t;
-
-//!@brief Flash Configuration Command Type
-enum
-{
- kDeviceConfigCmdType_Generic, //!< Generic command, for example: configure dummy cycles, drive strength, etc
- kDeviceConfigCmdType_QuadEnable, //!< Quad Enable command
- kDeviceConfigCmdType_Spi2Xpi, //!< Switch from SPI to DPI/QPI/OPI mode
- kDeviceConfigCmdType_Xpi2Spi, //!< Switch from DPI/QPI/OPI to SPI mode
- kDeviceConfigCmdType_Spi2NoCmd, //!< Switch to 0-4-4/0-8-8 mode
- kDeviceConfigCmdType_Reset, //!< Reset device command
-};
-
-//!@brief FlexSPI Memory Configuration Block
-typedef struct _FlexSPIConfig
-{
- uint32_t tag; //!< [0x000-0x003] Tag, fixed value 0x42464346UL
- uint32_t version; //!< [0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix
- uint32_t reserved0; //!< [0x008-0x00b] Reserved for future use
- uint8_t readSampleClkSrc; //!< [0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3
- uint8_t csHoldTime; //!< [0x00d-0x00d] CS hold time, default value: 3
- uint8_t csSetupTime; //!< [0x00e-0x00e] CS setup time, default value: 3
- uint8_t columnAddressWidth; //!< [0x00f-0x00f] Column Address with, for HyperBus protocol, it is fixed to 3, For
- //! Serial NAND, need to refer to datasheet
- uint8_t deviceModeCfgEnable; //!< [0x010-0x010] Device Mode Configure enable flag, 1 - Enable, 0 - Disable
- uint8_t deviceModeType; //!< [0x011-0x011] Specify the configuration command type:Quad Enable, DPI/QPI/OPI switch,
- //! Generic configuration, etc.
- uint16_t waitTimeCfgCommands; //!< [0x012-0x013] Wait time for all configuration commands, unit: 100us, Used for
- //! DPI/QPI/OPI switch or reset command
- flexspi_lut_seq_t deviceModeSeq; //!< [0x014-0x017] Device mode sequence info, [7:0] - LUT sequence id, [15:8] - LUt
- //! sequence number, [31:16] Reserved
- uint32_t deviceModeArg; //!< [0x018-0x01b] Argument/Parameter for device configuration
- uint8_t configCmdEnable; //!< [0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable
- uint8_t configModeType[3]; //!< [0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe
- flexspi_lut_seq_t
- configCmdSeqs[3]; //!< [0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq
- uint32_t reserved1; //!< [0x02c-0x02f] Reserved for future use
- uint32_t configCmdArgs[3]; //!< [0x030-0x03b] Arguments/Parameters for device Configuration commands
- uint32_t reserved2; //!< [0x03c-0x03f] Reserved for future use
- uint32_t controllerMiscOption; //!< [0x040-0x043] Controller Misc Options, see Misc feature bit definitions for more
- //! details
- uint8_t deviceType; //!< [0x044-0x044] Device Type: See Flash Type Definition for more details
- uint8_t sflashPadType; //!< [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal
- uint8_t serialClkFreq; //!< [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot
- //! Chapter for more details
- uint8_t lutCustomSeqEnable; //!< [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot
- //! be done using 1 LUT sequence, currently, only applicable to HyperFLASH
- uint32_t reserved3[2]; //!< [0x048-0x04f] Reserved for future use
- uint32_t sflashA1Size; //!< [0x050-0x053] Size of Flash connected to A1
- uint32_t sflashA2Size; //!< [0x054-0x057] Size of Flash connected to A2
- uint32_t sflashB1Size; //!< [0x058-0x05b] Size of Flash connected to B1
- uint32_t sflashB2Size; //!< [0x05c-0x05f] Size of Flash connected to B2
- uint32_t csPadSettingOverride; //!< [0x060-0x063] CS pad setting override value
- uint32_t sclkPadSettingOverride; //!< [0x064-0x067] SCK pad setting override value
- uint32_t dataPadSettingOverride; //!< [0x068-0x06b] data pad setting override value
- uint32_t dqsPadSettingOverride; //!< [0x06c-0x06f] DQS pad setting override value
- uint32_t timeoutInMs; //!< [0x070-0x073] Timeout threshold for read status command
- uint32_t commandInterval; //!< [0x074-0x077] CS deselect interval between two commands
- uint16_t dataValidTime[2]; //!< [0x078-0x07b] CLK edge to data valid time for PORT A and PORT B, in terms of 0.1ns
- uint16_t busyOffset; //!< [0x07c-0x07d] Busy offset, valid value: 0-31
- uint16_t busyBitPolarity; //!< [0x07e-0x07f] Busy flag polarity, 0 - busy flag is 1 when flash device is busy, 1 -
- //! busy flag is 0 when flash device is busy
- uint32_t lookupTable[64]; //!< [0x080-0x17f] Lookup table holds Flash command sequences
- flexspi_lut_seq_t lutCustomSeq[12]; //!< [0x180-0x1af] Customizable LUT Sequences
- uint32_t reserved4[4]; //!< [0x1b0-0x1bf] Reserved for future use
-} flexspi_mem_config_t;
-
-/* */
-#define NOR_CMD_INDEX_READ CMD_INDEX_READ //!< 0
-#define NOR_CMD_INDEX_READSTATUS CMD_INDEX_READSTATUS //!< 1
-#define NOR_CMD_INDEX_WRITEENABLE CMD_INDEX_WRITEENABLE //!< 2
-#define NOR_CMD_INDEX_ERASESECTOR 3 //!< 3
-#define NOR_CMD_INDEX_PAGEPROGRAM CMD_INDEX_WRITE //!< 4
-#define NOR_CMD_INDEX_CHIPERASE 5 //!< 5
-#define NOR_CMD_INDEX_DUMMY 6 //!< 6
-#define NOR_CMD_INDEX_ERASEBLOCK 7 //!< 7
-
-#define NOR_CMD_LUT_SEQ_IDX_READ CMD_LUT_SEQ_IDX_READ //!< 0 READ LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS \
- CMD_LUT_SEQ_IDX_READSTATUS //!< 1 Read Status LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS_XPI \
- 2 //!< 2 Read status DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE \
- CMD_LUT_SEQ_IDX_WRITEENABLE //!< 3 Write Enable sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_XPI \
- 4 //!< 4 Write Enable DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 5 //!< 5 Erase Sector sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASEBLOCK 8 //!< 8 Erase Block sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM \
- CMD_LUT_SEQ_IDX_WRITE //!< 9 Program sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_CHIPERASE 11 //!< 11 Chip Erase sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READ_SFDP 13 //!< 13 Read SFDP sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_RESTORE_NOCMD \
- 14 //!< 14 Restore 0-4-4/0-8-8 mode sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_EXIT_NOCMD \
- 15 //!< 15 Exit 0-4-4/0-8-8 mode sequence id in lookupTable stored in config blobk
-
-/*
- * Serial NOR configuration block
- */
-typedef struct _flexspi_nor_config
-{
- flexspi_mem_config_t memConfig; //!< Common memory configuration info via FlexSPI
- uint32_t pageSize; //!< Page size of Serial NOR
- uint32_t sectorSize; //!< Sector size of Serial NOR
- uint8_t ipcmdSerialClkFreq; //!< Clock frequency for IP command
- uint8_t isUniformBlockSize; //!< Sector/Block size is the same
- uint8_t reserved0[2]; //!< Reserved for future use
- uint8_t serialNorType; //!< Serial NOR Flash type: 0/1/2/3
- uint8_t needExitNoCmdMode; //!< Need to exit NoCmd mode before other IP command
- uint8_t halfClkForNonReadCmd; //!< Half the Serial Clock for non-read command: true/false
- uint8_t needRestoreNoCmdMode; //!< Need to Restore NoCmd mode after IP commmand execution
- uint32_t blockSize; //!< Block size
- uint32_t reserve2[11]; //!< Reserved for future use
-} flexspi_nor_config_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __EVKMIMXRT1060_FLEXSPI_NOR_CONFIG__ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/board.h b/tinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/board.h
deleted file mode 100755
index 5f51e91a..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/board.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-// required since iMX RT10xx SDK include this file for board size
-#define BOARD_FLASH_SIZE (0x400000U)
-
-// LED
-#define LED_PINMUX IOMUXC_GPIO_AD_B0_09_GPIO1_IO09
-#define LED_PORT GPIO1
-#define LED_PIN 9
-#define LED_STATE_ON 0
-
-// SW8 button
-#define BUTTON_PINMUX IOMUXC_SNVS_WAKEUP_GPIO5_IO00
-#define BUTTON_PORT GPIO5
-#define BUTTON_PIN 0
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_PORT LPUART1
-#define UART_RX_PINMUX IOMUXC_GPIO_AD_B0_13_LPUART1_RX
-#define UART_TX_PINMUX IOMUXC_GPIO_AD_B0_12_LPUART1_TX
-
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/board.mk b/tinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/board.mk
deleted file mode 100755
index 586d74fe..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DCPU_MIMXRT1064DVL6A
-MCU_VARIANT = MIMXRT1064
-
-# For flash-jlink target
-JLINK_DEVICE = MIMXRT1064xxx6A
-
-# For flash-pyocd target
-PYOCD_TARGET = mimxrt1064
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/evkmimxrt1064_flexspi_nor_config.c b/tinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/evkmimxrt1064_flexspi_nor_config.c
deleted file mode 100755
index bfb1c2d5..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/evkmimxrt1064_flexspi_nor_config.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2018 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include "evkmimxrt1064_flexspi_nor_config.h"
-
-/* Component ID definition, used by tools. */
-#ifndef FSL_COMPONENT_ID
-#define FSL_COMPONENT_ID "platform.drivers.xip_board"
-#endif
-
-/*******************************************************************************
- * Code
- ******************************************************************************/
-#if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1)
-#if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__)
-__attribute__((section(".boot_hdr.conf")))
-#elif defined(__ICCARM__)
-#pragma location = ".boot_hdr.conf"
-#endif
-
-const flexspi_nor_config_t qspiflash_config = {
- .memConfig =
- {
- .tag = FLEXSPI_CFG_BLK_TAG,
- .version = FLEXSPI_CFG_BLK_VERSION,
- .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad,
- .csHoldTime = 3u,
- .csSetupTime = 3u,
- // Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
- .sflashPadType = kSerialFlash_4Pads,
- .serialClkFreq = kFlexSpiSerialClk_100MHz,
- .sflashA1Size = 8u * 1024u * 1024u,
- .lookupTable =
- {
- // Read LUTs
- FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
- FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
- },
- },
- .pageSize = 256u,
- .sectorSize = 4u * 1024u,
- .blockSize = 256u * 1024u,
- .isUniformBlockSize = false,
-};
-#endif /* XIP_BOOT_HEADER_ENABLE */
diff --git a/tinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/evkmimxrt1064_flexspi_nor_config.h b/tinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/evkmimxrt1064_flexspi_nor_config.h
deleted file mode 100755
index efdfe583..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/mimxrt1064_evk/evkmimxrt1064_flexspi_nor_config.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright 2018 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef __EVKMIMXRT1064_FLEXSPI_NOR_CONFIG__
-#define __EVKMIMXRT1064_FLEXSPI_NOR_CONFIG__
-
-#include <stdint.h>
-#include <stdbool.h>
-#include "fsl_common.h"
-
-/*! @name Driver version */
-/*@{*/
-/*! @brief XIP_BOARD driver version 2.0.0. */
-#define FSL_XIP_BOARD_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
-/*@}*/
-
-/* FLEXSPI memory config block related defintions */
-#define FLEXSPI_CFG_BLK_TAG (0x42464346UL) // ascii "FCFB" Big Endian
-#define FLEXSPI_CFG_BLK_VERSION (0x56010400UL) // V1.4.0
-#define FLEXSPI_CFG_BLK_SIZE (512)
-
-/* FLEXSPI Feature related definitions */
-#define FLEXSPI_FEATURE_HAS_PARALLEL_MODE 1
-
-/* Lookup table related defintions */
-#define CMD_INDEX_READ 0
-#define CMD_INDEX_READSTATUS 1
-#define CMD_INDEX_WRITEENABLE 2
-#define CMD_INDEX_WRITE 4
-
-#define CMD_LUT_SEQ_IDX_READ 0
-#define CMD_LUT_SEQ_IDX_READSTATUS 1
-#define CMD_LUT_SEQ_IDX_WRITEENABLE 3
-#define CMD_LUT_SEQ_IDX_WRITE 9
-
-#define CMD_SDR 0x01
-#define CMD_DDR 0x21
-#define RADDR_SDR 0x02
-#define RADDR_DDR 0x22
-#define CADDR_SDR 0x03
-#define CADDR_DDR 0x23
-#define MODE1_SDR 0x04
-#define MODE1_DDR 0x24
-#define MODE2_SDR 0x05
-#define MODE2_DDR 0x25
-#define MODE4_SDR 0x06
-#define MODE4_DDR 0x26
-#define MODE8_SDR 0x07
-#define MODE8_DDR 0x27
-#define WRITE_SDR 0x08
-#define WRITE_DDR 0x28
-#define READ_SDR 0x09
-#define READ_DDR 0x29
-#define LEARN_SDR 0x0A
-#define LEARN_DDR 0x2A
-#define DATSZ_SDR 0x0B
-#define DATSZ_DDR 0x2B
-#define DUMMY_SDR 0x0C
-#define DUMMY_DDR 0x2C
-#define DUMMY_RWDS_SDR 0x0D
-#define DUMMY_RWDS_DDR 0x2D
-#define JMP_ON_CS 0x1F
-#define STOP 0
-
-#define FLEXSPI_1PAD 0
-#define FLEXSPI_2PAD 1
-#define FLEXSPI_4PAD 2
-#define FLEXSPI_8PAD 3
-
-#define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \
- (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \
- FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1))
-
-//!@brief Definitions for FlexSPI Serial Clock Frequency
-typedef enum _FlexSpiSerialClockFreq
-{
- kFlexSpiSerialClk_30MHz = 1,
- kFlexSpiSerialClk_50MHz = 2,
- kFlexSpiSerialClk_60MHz = 3,
- kFlexSpiSerialClk_75MHz = 4,
- kFlexSpiSerialClk_80MHz = 5,
- kFlexSpiSerialClk_100MHz = 6,
- kFlexSpiSerialClk_120MHz = 7,
- kFlexSpiSerialClk_133MHz = 8,
- kFlexSpiSerialClk_166MHz = 9,
-} flexspi_serial_clk_freq_t;
-
-//!@brief FlexSPI clock configuration type
-enum
-{
- kFlexSpiClk_SDR, //!< Clock configure for SDR mode
- kFlexSpiClk_DDR, //!< Clock configurat for DDR mode
-};
-
-//!@brief FlexSPI Read Sample Clock Source definition
-typedef enum _FlashReadSampleClkSource
-{
- kFlexSPIReadSampleClk_LoopbackInternally = 0,
- kFlexSPIReadSampleClk_LoopbackFromDqsPad = 1,
- kFlexSPIReadSampleClk_LoopbackFromSckPad = 2,
- kFlexSPIReadSampleClk_ExternalInputFromDqsPad = 3,
-} flexspi_read_sample_clk_t;
-
-//!@brief Misc feature bit definitions
-enum
-{
- kFlexSpiMiscOffset_DiffClkEnable = 0, //!< Bit for Differential clock enable
- kFlexSpiMiscOffset_Ck2Enable = 1, //!< Bit for CK2 enable
- kFlexSpiMiscOffset_ParallelEnable = 2, //!< Bit for Parallel mode enable
- kFlexSpiMiscOffset_WordAddressableEnable = 3, //!< Bit for Word Addressable enable
- kFlexSpiMiscOffset_SafeConfigFreqEnable = 4, //!< Bit for Safe Configuration Frequency enable
- kFlexSpiMiscOffset_PadSettingOverrideEnable = 5, //!< Bit for Pad setting override enable
- kFlexSpiMiscOffset_DdrModeEnable = 6, //!< Bit for DDR clock confiuration indication.
-};
-
-//!@brief Flash Type Definition
-enum
-{
- kFlexSpiDeviceType_SerialNOR = 1, //!< Flash devices are Serial NOR
- kFlexSpiDeviceType_SerialNAND = 2, //!< Flash devices are Serial NAND
- kFlexSpiDeviceType_SerialRAM = 3, //!< Flash devices are Serial RAM/HyperFLASH
- kFlexSpiDeviceType_MCP_NOR_NAND = 0x12, //!< Flash device is MCP device, A1 is Serial NOR, A2 is Serial NAND
- kFlexSpiDeviceType_MCP_NOR_RAM = 0x13, //!< Flash deivce is MCP device, A1 is Serial NOR, A2 is Serial RAMs
-};
-
-//!@brief Flash Pad Definitions
-enum
-{
- kSerialFlash_1Pad = 1,
- kSerialFlash_2Pads = 2,
- kSerialFlash_4Pads = 4,
- kSerialFlash_8Pads = 8,
-};
-
-//!@brief FlexSPI LUT Sequence structure
-typedef struct _lut_sequence
-{
- uint8_t seqNum; //!< Sequence Number, valid number: 1-16
- uint8_t seqId; //!< Sequence Index, valid number: 0-15
- uint16_t reserved;
-} flexspi_lut_seq_t;
-
-//!@brief Flash Configuration Command Type
-enum
-{
- kDeviceConfigCmdType_Generic, //!< Generic command, for example: configure dummy cycles, drive strength, etc
- kDeviceConfigCmdType_QuadEnable, //!< Quad Enable command
- kDeviceConfigCmdType_Spi2Xpi, //!< Switch from SPI to DPI/QPI/OPI mode
- kDeviceConfigCmdType_Xpi2Spi, //!< Switch from DPI/QPI/OPI to SPI mode
- kDeviceConfigCmdType_Spi2NoCmd, //!< Switch to 0-4-4/0-8-8 mode
- kDeviceConfigCmdType_Reset, //!< Reset device command
-};
-
-//!@brief FlexSPI Memory Configuration Block
-typedef struct _FlexSPIConfig
-{
- uint32_t tag; //!< [0x000-0x003] Tag, fixed value 0x42464346UL
- uint32_t version; //!< [0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix
- uint32_t reserved0; //!< [0x008-0x00b] Reserved for future use
- uint8_t readSampleClkSrc; //!< [0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3
- uint8_t csHoldTime; //!< [0x00d-0x00d] CS hold time, default value: 3
- uint8_t csSetupTime; //!< [0x00e-0x00e] CS setup time, default value: 3
- uint8_t columnAddressWidth; //!< [0x00f-0x00f] Column Address with, for HyperBus protocol, it is fixed to 3, For
- //! Serial NAND, need to refer to datasheet
- uint8_t deviceModeCfgEnable; //!< [0x010-0x010] Device Mode Configure enable flag, 1 - Enable, 0 - Disable
- uint8_t deviceModeType; //!< [0x011-0x011] Specify the configuration command type:Quad Enable, DPI/QPI/OPI switch,
- //! Generic configuration, etc.
- uint16_t waitTimeCfgCommands; //!< [0x012-0x013] Wait time for all configuration commands, unit: 100us, Used for
- //! DPI/QPI/OPI switch or reset command
- flexspi_lut_seq_t deviceModeSeq; //!< [0x014-0x017] Device mode sequence info, [7:0] - LUT sequence id, [15:8] - LUt
- //! sequence number, [31:16] Reserved
- uint32_t deviceModeArg; //!< [0x018-0x01b] Argument/Parameter for device configuration
- uint8_t configCmdEnable; //!< [0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable
- uint8_t configModeType[3]; //!< [0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe
- flexspi_lut_seq_t
- configCmdSeqs[3]; //!< [0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq
- uint32_t reserved1; //!< [0x02c-0x02f] Reserved for future use
- uint32_t configCmdArgs[3]; //!< [0x030-0x03b] Arguments/Parameters for device Configuration commands
- uint32_t reserved2; //!< [0x03c-0x03f] Reserved for future use
- uint32_t controllerMiscOption; //!< [0x040-0x043] Controller Misc Options, see Misc feature bit definitions for more
- //! details
- uint8_t deviceType; //!< [0x044-0x044] Device Type: See Flash Type Definition for more details
- uint8_t sflashPadType; //!< [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal
- uint8_t serialClkFreq; //!< [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot
- //! Chapter for more details
- uint8_t lutCustomSeqEnable; //!< [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot
- //! be done using 1 LUT sequence, currently, only applicable to HyperFLASH
- uint32_t reserved3[2]; //!< [0x048-0x04f] Reserved for future use
- uint32_t sflashA1Size; //!< [0x050-0x053] Size of Flash connected to A1
- uint32_t sflashA2Size; //!< [0x054-0x057] Size of Flash connected to A2
- uint32_t sflashB1Size; //!< [0x058-0x05b] Size of Flash connected to B1
- uint32_t sflashB2Size; //!< [0x05c-0x05f] Size of Flash connected to B2
- uint32_t csPadSettingOverride; //!< [0x060-0x063] CS pad setting override value
- uint32_t sclkPadSettingOverride; //!< [0x064-0x067] SCK pad setting override value
- uint32_t dataPadSettingOverride; //!< [0x068-0x06b] data pad setting override value
- uint32_t dqsPadSettingOverride; //!< [0x06c-0x06f] DQS pad setting override value
- uint32_t timeoutInMs; //!< [0x070-0x073] Timeout threshold for read status command
- uint32_t commandInterval; //!< [0x074-0x077] CS deselect interval between two commands
- uint16_t dataValidTime[2]; //!< [0x078-0x07b] CLK edge to data valid time for PORT A and PORT B, in terms of 0.1ns
- uint16_t busyOffset; //!< [0x07c-0x07d] Busy offset, valid value: 0-31
- uint16_t busyBitPolarity; //!< [0x07e-0x07f] Busy flag polarity, 0 - busy flag is 1 when flash device is busy, 1 -
- //! busy flag is 0 when flash device is busy
- uint32_t lookupTable[64]; //!< [0x080-0x17f] Lookup table holds Flash command sequences
- flexspi_lut_seq_t lutCustomSeq[12]; //!< [0x180-0x1af] Customizable LUT Sequences
- uint32_t reserved4[4]; //!< [0x1b0-0x1bf] Reserved for future use
-} flexspi_mem_config_t;
-
-/* */
-#define NOR_CMD_INDEX_READ CMD_INDEX_READ //!< 0
-#define NOR_CMD_INDEX_READSTATUS CMD_INDEX_READSTATUS //!< 1
-#define NOR_CMD_INDEX_WRITEENABLE CMD_INDEX_WRITEENABLE //!< 2
-#define NOR_CMD_INDEX_ERASESECTOR 3 //!< 3
-#define NOR_CMD_INDEX_PAGEPROGRAM CMD_INDEX_WRITE //!< 4
-#define NOR_CMD_INDEX_CHIPERASE 5 //!< 5
-#define NOR_CMD_INDEX_DUMMY 6 //!< 6
-#define NOR_CMD_INDEX_ERASEBLOCK 7 //!< 7
-
-#define NOR_CMD_LUT_SEQ_IDX_READ CMD_LUT_SEQ_IDX_READ //!< 0 READ LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS \
- CMD_LUT_SEQ_IDX_READSTATUS //!< 1 Read Status LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS_XPI \
- 2 //!< 2 Read status DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE \
- CMD_LUT_SEQ_IDX_WRITEENABLE //!< 3 Write Enable sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_XPI \
- 4 //!< 4 Write Enable DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 5 //!< 5 Erase Sector sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASEBLOCK 8 //!< 8 Erase Block sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM \
- CMD_LUT_SEQ_IDX_WRITE //!< 9 Program sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_CHIPERASE 11 //!< 11 Chip Erase sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READ_SFDP 13 //!< 13 Read SFDP sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_RESTORE_NOCMD \
- 14 //!< 14 Restore 0-4-4/0-8-8 mode sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_EXIT_NOCMD \
- 15 //!< 15 Exit 0-4-4/0-8-8 mode sequence id in lookupTable stored in config blobk
-
-/*
- * Serial NOR configuration block
- */
-typedef struct _flexspi_nor_config
-{
- flexspi_mem_config_t memConfig; //!< Common memory configuration info via FlexSPI
- uint32_t pageSize; //!< Page size of Serial NOR
- uint32_t sectorSize; //!< Sector size of Serial NOR
- uint8_t ipcmdSerialClkFreq; //!< Clock frequency for IP command
- uint8_t isUniformBlockSize; //!< Sector/Block size is the same
- uint8_t reserved0[2]; //!< Reserved for future use
- uint8_t serialNorType; //!< Serial NOR Flash type: 0/1/2/3
- uint8_t needExitNoCmdMode; //!< Need to exit NoCmd mode before other IP command
- uint8_t halfClkForNonReadCmd; //!< Half the Serial Clock for non-read command: true/false
- uint8_t needRestoreNoCmdMode; //!< Need to Restore NoCmd mode after IP commmand execution
- uint32_t blockSize; //!< Block size
- uint32_t reserve2[11]; //!< Reserved for future use
-} flexspi_nor_config_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __EVKMIMXRT1064_FLEXSPI_NOR_CONFIG__ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/teensy_40/board.h b/tinyusb/hw/bsp/imxrt/boards/teensy_40/board.h
deleted file mode 100755
index b3cc0a8c..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/teensy_40/board.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-
-// required since iMX RT10xx SDK include this file for board size
-#define BOARD_FLASH_SIZE (2 * 1024 * 1024)
-
-// LED
-#define LED_PINMUX IOMUXC_GPIO_B0_03_GPIO2_IO03 // D13
-#define LED_PORT GPIO2
-#define LED_PIN 3
-#define LED_STATE_ON 0
-
-// no button
-#define BUTTON_PINMUX IOMUXC_GPIO_B0_01_GPIO2_IO01 // D12
-#define BUTTON_PORT GPIO2
-#define BUTTON_PIN 1
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_PORT LPUART6
-#define UART_RX_PINMUX IOMUXC_GPIO_AD_B0_03_LPUART6_RX // D0
-#define UART_TX_PINMUX IOMUXC_GPIO_AD_B0_02_LPUART6_TX // D1
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/imxrt/boards/teensy_40/board.mk b/tinyusb/hw/bsp/imxrt/boards/teensy_40/board.mk
deleted file mode 100755
index 0ad5ea5c..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/teensy_40/board.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-CFLAGS += -DCPU_MIMXRT1062DVL6A
-MCU_VARIANT = MIMXRT1062
-
-# For flash-jlink target
-JLINK_DEVICE = MIMXRT1062xxx6A
-
-# flash by using teensy_loader_cli https://github.com/PaulStoffregen/teensy_loader_cli
-# Make sure it is in your PATH
-flash: $(BUILD)/$(PROJECT).hex
- teensy_loader_cli --mcu=imxrt1062 -v -w $<
diff --git a/tinyusb/hw/bsp/imxrt/boards/teensy_40/teensy40_flexspi_nor_config.c b/tinyusb/hw/bsp/imxrt/boards/teensy_40/teensy40_flexspi_nor_config.c
deleted file mode 100755
index 7929906e..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/teensy_40/teensy40_flexspi_nor_config.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2018 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <bsp/imxrt/boards/teensy_40/teensy40_flexspi_nor_config.h>
-
-/* Component ID definition, used by tools. */
-#ifndef FSL_COMPONENT_ID
-#define FSL_COMPONENT_ID "platform.drivers.xip_board"
-#endif
-
-/*******************************************************************************
- * Code
- ******************************************************************************/
-#if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1)
-#if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__)
-__attribute__((section(".boot_hdr.conf")))
-#elif defined(__ICCARM__)
-#pragma location = ".boot_hdr.conf"
-#endif
-
-const flexspi_nor_config_t qspiflash_config = {
- .memConfig =
- {
- .tag = FLEXSPI_CFG_BLK_TAG,
- .version = FLEXSPI_CFG_BLK_VERSION,
- .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad,
- .csHoldTime = 3u,
- .csSetupTime = 3u,
- // Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
- .sflashPadType = kSerialFlash_4Pads,
- .serialClkFreq = kFlexSpiSerialClk_100MHz,
- .sflashA1Size = 2u * 1024u * 1024u,
- .lookupTable =
- {
- // Read LUTs
- FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
- FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
- },
- },
- .pageSize = 256u,
- .sectorSize = 4u * 1024u,
- .blockSize = 256u * 1024u,
- .isUniformBlockSize = false,
-};
-#endif /* XIP_BOOT_HEADER_ENABLE */
diff --git a/tinyusb/hw/bsp/imxrt/boards/teensy_40/teensy40_flexspi_nor_config.h b/tinyusb/hw/bsp/imxrt/boards/teensy_40/teensy40_flexspi_nor_config.h
deleted file mode 100755
index 56068ec6..00000000
--- a/tinyusb/hw/bsp/imxrt/boards/teensy_40/teensy40_flexspi_nor_config.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright 2018 NXP
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef __TEENSY40_FLEXSPI_NOR_CONFIG__
-#define __TEENSY40_FLEXSPI_NOR_CONFIG__
-
-#include <stdint.h>
-#include <stdbool.h>
-#include "fsl_common.h"
-
-/*! @name Driver version */
-/*@{*/
-/*! @brief XIP_BOARD driver version 2.0.0. */
-#define FSL_XIP_BOARD_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
-/*@}*/
-
-/* FLEXSPI memory config block related defintions */
-#define FLEXSPI_CFG_BLK_TAG (0x42464346UL) // ascii "FCFB" Big Endian
-#define FLEXSPI_CFG_BLK_VERSION (0x56010400UL) // V1.4.0
-#define FLEXSPI_CFG_BLK_SIZE (512)
-
-/* FLEXSPI Feature related definitions */
-#define FLEXSPI_FEATURE_HAS_PARALLEL_MODE 1
-
-/* Lookup table related defintions */
-#define CMD_INDEX_READ 0
-#define CMD_INDEX_READSTATUS 1
-#define CMD_INDEX_WRITEENABLE 2
-#define CMD_INDEX_WRITE 4
-
-#define CMD_LUT_SEQ_IDX_READ 0
-#define CMD_LUT_SEQ_IDX_READSTATUS 1
-#define CMD_LUT_SEQ_IDX_WRITEENABLE 3
-#define CMD_LUT_SEQ_IDX_WRITE 9
-
-#define CMD_SDR 0x01
-#define CMD_DDR 0x21
-#define RADDR_SDR 0x02
-#define RADDR_DDR 0x22
-#define CADDR_SDR 0x03
-#define CADDR_DDR 0x23
-#define MODE1_SDR 0x04
-#define MODE1_DDR 0x24
-#define MODE2_SDR 0x05
-#define MODE2_DDR 0x25
-#define MODE4_SDR 0x06
-#define MODE4_DDR 0x26
-#define MODE8_SDR 0x07
-#define MODE8_DDR 0x27
-#define WRITE_SDR 0x08
-#define WRITE_DDR 0x28
-#define READ_SDR 0x09
-#define READ_DDR 0x29
-#define LEARN_SDR 0x0A
-#define LEARN_DDR 0x2A
-#define DATSZ_SDR 0x0B
-#define DATSZ_DDR 0x2B
-#define DUMMY_SDR 0x0C
-#define DUMMY_DDR 0x2C
-#define DUMMY_RWDS_SDR 0x0D
-#define DUMMY_RWDS_DDR 0x2D
-#define JMP_ON_CS 0x1F
-#define STOP 0
-
-#define FLEXSPI_1PAD 0
-#define FLEXSPI_2PAD 1
-#define FLEXSPI_4PAD 2
-#define FLEXSPI_8PAD 3
-
-#define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \
- (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \
- FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1))
-
-//!@brief Definitions for FlexSPI Serial Clock Frequency
-typedef enum _FlexSpiSerialClockFreq
-{
- kFlexSpiSerialClk_30MHz = 1,
- kFlexSpiSerialClk_50MHz = 2,
- kFlexSpiSerialClk_60MHz = 3,
- kFlexSpiSerialClk_75MHz = 4,
- kFlexSpiSerialClk_80MHz = 5,
- kFlexSpiSerialClk_100MHz = 6,
- kFlexSpiSerialClk_120MHz = 7,
- kFlexSpiSerialClk_133MHz = 8,
- kFlexSpiSerialClk_166MHz = 9,
-} flexspi_serial_clk_freq_t;
-
-//!@brief FlexSPI clock configuration type
-enum
-{
- kFlexSpiClk_SDR, //!< Clock configure for SDR mode
- kFlexSpiClk_DDR, //!< Clock configurat for DDR mode
-};
-
-//!@brief FlexSPI Read Sample Clock Source definition
-typedef enum _FlashReadSampleClkSource
-{
- kFlexSPIReadSampleClk_LoopbackInternally = 0,
- kFlexSPIReadSampleClk_LoopbackFromDqsPad = 1,
- kFlexSPIReadSampleClk_LoopbackFromSckPad = 2,
- kFlexSPIReadSampleClk_ExternalInputFromDqsPad = 3,
-} flexspi_read_sample_clk_t;
-
-//!@brief Misc feature bit definitions
-enum
-{
- kFlexSpiMiscOffset_DiffClkEnable = 0, //!< Bit for Differential clock enable
- kFlexSpiMiscOffset_Ck2Enable = 1, //!< Bit for CK2 enable
- kFlexSpiMiscOffset_ParallelEnable = 2, //!< Bit for Parallel mode enable
- kFlexSpiMiscOffset_WordAddressableEnable = 3, //!< Bit for Word Addressable enable
- kFlexSpiMiscOffset_SafeConfigFreqEnable = 4, //!< Bit for Safe Configuration Frequency enable
- kFlexSpiMiscOffset_PadSettingOverrideEnable = 5, //!< Bit for Pad setting override enable
- kFlexSpiMiscOffset_DdrModeEnable = 6, //!< Bit for DDR clock confiuration indication.
-};
-
-//!@brief Flash Type Definition
-enum
-{
- kFlexSpiDeviceType_SerialNOR = 1, //!< Flash devices are Serial NOR
- kFlexSpiDeviceType_SerialNAND = 2, //!< Flash devices are Serial NAND
- kFlexSpiDeviceType_SerialRAM = 3, //!< Flash devices are Serial RAM/HyperFLASH
- kFlexSpiDeviceType_MCP_NOR_NAND = 0x12, //!< Flash device is MCP device, A1 is Serial NOR, A2 is Serial NAND
- kFlexSpiDeviceType_MCP_NOR_RAM = 0x13, //!< Flash deivce is MCP device, A1 is Serial NOR, A2 is Serial RAMs
-};
-
-//!@brief Flash Pad Definitions
-enum
-{
- kSerialFlash_1Pad = 1,
- kSerialFlash_2Pads = 2,
- kSerialFlash_4Pads = 4,
- kSerialFlash_8Pads = 8,
-};
-
-//!@brief FlexSPI LUT Sequence structure
-typedef struct _lut_sequence
-{
- uint8_t seqNum; //!< Sequence Number, valid number: 1-16
- uint8_t seqId; //!< Sequence Index, valid number: 0-15
- uint16_t reserved;
-} flexspi_lut_seq_t;
-
-//!@brief Flash Configuration Command Type
-enum
-{
- kDeviceConfigCmdType_Generic, //!< Generic command, for example: configure dummy cycles, drive strength, etc
- kDeviceConfigCmdType_QuadEnable, //!< Quad Enable command
- kDeviceConfigCmdType_Spi2Xpi, //!< Switch from SPI to DPI/QPI/OPI mode
- kDeviceConfigCmdType_Xpi2Spi, //!< Switch from DPI/QPI/OPI to SPI mode
- kDeviceConfigCmdType_Spi2NoCmd, //!< Switch to 0-4-4/0-8-8 mode
- kDeviceConfigCmdType_Reset, //!< Reset device command
-};
-
-//!@brief FlexSPI Memory Configuration Block
-typedef struct _FlexSPIConfig
-{
- uint32_t tag; //!< [0x000-0x003] Tag, fixed value 0x42464346UL
- uint32_t version; //!< [0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix
- uint32_t reserved0; //!< [0x008-0x00b] Reserved for future use
- uint8_t readSampleClkSrc; //!< [0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3
- uint8_t csHoldTime; //!< [0x00d-0x00d] CS hold time, default value: 3
- uint8_t csSetupTime; //!< [0x00e-0x00e] CS setup time, default value: 3
- uint8_t columnAddressWidth; //!< [0x00f-0x00f] Column Address with, for HyperBus protocol, it is fixed to 3, For
- //! Serial NAND, need to refer to datasheet
- uint8_t deviceModeCfgEnable; //!< [0x010-0x010] Device Mode Configure enable flag, 1 - Enable, 0 - Disable
- uint8_t deviceModeType; //!< [0x011-0x011] Specify the configuration command type:Quad Enable, DPI/QPI/OPI switch,
- //! Generic configuration, etc.
- uint16_t waitTimeCfgCommands; //!< [0x012-0x013] Wait time for all configuration commands, unit: 100us, Used for
- //! DPI/QPI/OPI switch or reset command
- flexspi_lut_seq_t deviceModeSeq; //!< [0x014-0x017] Device mode sequence info, [7:0] - LUT sequence id, [15:8] - LUt
- //! sequence number, [31:16] Reserved
- uint32_t deviceModeArg; //!< [0x018-0x01b] Argument/Parameter for device configuration
- uint8_t configCmdEnable; //!< [0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable
- uint8_t configModeType[3]; //!< [0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe
- flexspi_lut_seq_t
- configCmdSeqs[3]; //!< [0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq
- uint32_t reserved1; //!< [0x02c-0x02f] Reserved for future use
- uint32_t configCmdArgs[3]; //!< [0x030-0x03b] Arguments/Parameters for device Configuration commands
- uint32_t reserved2; //!< [0x03c-0x03f] Reserved for future use
- uint32_t controllerMiscOption; //!< [0x040-0x043] Controller Misc Options, see Misc feature bit definitions for more
- //! details
- uint8_t deviceType; //!< [0x044-0x044] Device Type: See Flash Type Definition for more details
- uint8_t sflashPadType; //!< [0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal
- uint8_t serialClkFreq; //!< [0x046-0x046] Serial Flash Frequencey, device specific definitions, See System Boot
- //! Chapter for more details
- uint8_t lutCustomSeqEnable; //!< [0x047-0x047] LUT customization Enable, it is required if the program/erase cannot
- //! be done using 1 LUT sequence, currently, only applicable to HyperFLASH
- uint32_t reserved3[2]; //!< [0x048-0x04f] Reserved for future use
- uint32_t sflashA1Size; //!< [0x050-0x053] Size of Flash connected to A1
- uint32_t sflashA2Size; //!< [0x054-0x057] Size of Flash connected to A2
- uint32_t sflashB1Size; //!< [0x058-0x05b] Size of Flash connected to B1
- uint32_t sflashB2Size; //!< [0x05c-0x05f] Size of Flash connected to B2
- uint32_t csPadSettingOverride; //!< [0x060-0x063] CS pad setting override value
- uint32_t sclkPadSettingOverride; //!< [0x064-0x067] SCK pad setting override value
- uint32_t dataPadSettingOverride; //!< [0x068-0x06b] data pad setting override value
- uint32_t dqsPadSettingOverride; //!< [0x06c-0x06f] DQS pad setting override value
- uint32_t timeoutInMs; //!< [0x070-0x073] Timeout threshold for read status command
- uint32_t commandInterval; //!< [0x074-0x077] CS deselect interval between two commands
- uint16_t dataValidTime[2]; //!< [0x078-0x07b] CLK edge to data valid time for PORT A and PORT B, in terms of 0.1ns
- uint16_t busyOffset; //!< [0x07c-0x07d] Busy offset, valid value: 0-31
- uint16_t busyBitPolarity; //!< [0x07e-0x07f] Busy flag polarity, 0 - busy flag is 1 when flash device is busy, 1 -
- //! busy flag is 0 when flash device is busy
- uint32_t lookupTable[64]; //!< [0x080-0x17f] Lookup table holds Flash command sequences
- flexspi_lut_seq_t lutCustomSeq[12]; //!< [0x180-0x1af] Customizable LUT Sequences
- uint32_t reserved4[4]; //!< [0x1b0-0x1bf] Reserved for future use
-} flexspi_mem_config_t;
-
-/* */
-#define NOR_CMD_INDEX_READ CMD_INDEX_READ //!< 0
-#define NOR_CMD_INDEX_READSTATUS CMD_INDEX_READSTATUS //!< 1
-#define NOR_CMD_INDEX_WRITEENABLE CMD_INDEX_WRITEENABLE //!< 2
-#define NOR_CMD_INDEX_ERASESECTOR 3 //!< 3
-#define NOR_CMD_INDEX_PAGEPROGRAM CMD_INDEX_WRITE //!< 4
-#define NOR_CMD_INDEX_CHIPERASE 5 //!< 5
-#define NOR_CMD_INDEX_DUMMY 6 //!< 6
-#define NOR_CMD_INDEX_ERASEBLOCK 7 //!< 7
-
-#define NOR_CMD_LUT_SEQ_IDX_READ CMD_LUT_SEQ_IDX_READ //!< 0 READ LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS \
- CMD_LUT_SEQ_IDX_READSTATUS //!< 1 Read Status LUT sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READSTATUS_XPI \
- 2 //!< 2 Read status DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE \
- CMD_LUT_SEQ_IDX_WRITEENABLE //!< 3 Write Enable sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_XPI \
- 4 //!< 4 Write Enable DPI/QPI/OPI sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 5 //!< 5 Erase Sector sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_ERASEBLOCK 8 //!< 8 Erase Block sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM \
- CMD_LUT_SEQ_IDX_WRITE //!< 9 Program sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_CHIPERASE 11 //!< 11 Chip Erase sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_READ_SFDP 13 //!< 13 Read SFDP sequence in lookupTable id stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_RESTORE_NOCMD \
- 14 //!< 14 Restore 0-4-4/0-8-8 mode sequence id in lookupTable stored in config block
-#define NOR_CMD_LUT_SEQ_IDX_EXIT_NOCMD \
- 15 //!< 15 Exit 0-4-4/0-8-8 mode sequence id in lookupTable stored in config blobk
-
-/*
- * Serial NOR configuration block
- */
-typedef struct _flexspi_nor_config
-{
- flexspi_mem_config_t memConfig; //!< Common memory configuration info via FlexSPI
- uint32_t pageSize; //!< Page size of Serial NOR
- uint32_t sectorSize; //!< Sector size of Serial NOR
- uint8_t ipcmdSerialClkFreq; //!< Clock frequency for IP command
- uint8_t isUniformBlockSize; //!< Sector/Block size is the same
- uint8_t reserved0[2]; //!< Reserved for future use
- uint8_t serialNorType; //!< Serial NOR Flash type: 0/1/2/3
- uint8_t needExitNoCmdMode; //!< Need to exit NoCmd mode before other IP command
- uint8_t halfClkForNonReadCmd; //!< Half the Serial Clock for non-read command: true/false
- uint8_t needRestoreNoCmdMode; //!< Need to Restore NoCmd mode after IP commmand execution
- uint32_t blockSize; //!< Block size
- uint32_t reserve2[11]; //!< Reserved for future use
-} flexspi_nor_config_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __EVKMIMXRT1060_FLEXSPI_NOR_CONFIG__ */
diff --git a/tinyusb/hw/bsp/imxrt/family.c b/tinyusb/hw/bsp/imxrt/family.c
deleted file mode 100755
index 77a224a5..00000000
--- a/tinyusb/hw/bsp/imxrt/family.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018, hathach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "bsp/board.h"
-#include "board.h"
-#include "fsl_device_registers.h"
-#include "fsl_gpio.h"
-#include "fsl_iomuxc.h"
-#include "fsl_clock.h"
-#include "fsl_lpuart.h"
-
-#include "clock_config.h"
-
-// needed by fsl_flexspi_nor_boot
-const uint8_t dcd_data[] = { 0x00 };
-
-void board_init(void)
-{
- // Init clock
- BOARD_BootClockRUN();
- SystemCoreClockUpdate();
-
- // Enable IOCON clock
- CLOCK_EnableClock(kCLOCK_Iomuxc);
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
-// NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- // LED
- IOMUXC_SetPinMux( LED_PINMUX, 0U);
- IOMUXC_SetPinConfig( LED_PINMUX, 0x10B0U);
-
- gpio_pin_config_t led_config = { kGPIO_DigitalOutput, 0, kGPIO_NoIntmode };
- GPIO_PinInit(LED_PORT, LED_PIN, &led_config);
- board_led_write(true);
-
- // Button
- IOMUXC_SetPinMux( BUTTON_PINMUX, 0U);
- IOMUXC_SetPinConfig(BUTTON_PINMUX, 0x01B0A0U);
- gpio_pin_config_t button_config = { kGPIO_DigitalInput, 0, kGPIO_IntRisingEdge, };
- GPIO_PinInit(BUTTON_PORT, BUTTON_PIN, &button_config);
-
- // UART
- IOMUXC_SetPinMux( UART_TX_PINMUX, 0U);
- IOMUXC_SetPinMux( UART_RX_PINMUX, 0U);
- IOMUXC_SetPinConfig( UART_TX_PINMUX, 0x10B0u);
- IOMUXC_SetPinConfig( UART_RX_PINMUX, 0x10B0u);
-
- lpuart_config_t uart_config;
- LPUART_GetDefaultConfig(&uart_config);
- uart_config.baudRate_Bps = CFG_BOARD_UART_BAUDRATE;
- uart_config.enableTx = true;
- uart_config.enableRx = true;
-
- uint32_t freq;
- if (CLOCK_GetMux(kCLOCK_UartMux) == 0) /* PLL3 div6 80M */
- {
- freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
- }
- else
- {
- freq = CLOCK_GetOscFreq() / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
- }
-
- LPUART_Init(UART_PORT, &uart_config, freq);
-
- //------------- USB0 -------------//
-
- // Clock
- CLOCK_EnableUsbhs0PhyPllClock(kCLOCK_Usbphy480M, 480000000U);
- CLOCK_EnableUsbhs0Clock(kCLOCK_Usb480M, 480000000U);
-
- // USB1
-// CLOCK_EnableUsbhs1PhyPllClock(kCLOCK_Usbphy480M, 480000000U);
-// CLOCK_EnableUsbhs1Clock(kCLOCK_Usb480M, 480000000U);
-
- USBPHY_Type* usb_phy;
-
- // RT105x RT106x have dual USB controller. TODO support USB2
-#ifdef USBPHY1
- usb_phy = USBPHY1;
-#else
- usb_phy = USBPHY;
-#endif
-
- // Enable PHY support for Low speed device + LS via FS Hub
- usb_phy->CTRL |= USBPHY_CTRL_SET_ENUTMILEVEL2_MASK | USBPHY_CTRL_SET_ENUTMILEVEL3_MASK;
-
- // Enable all power for normal operation
- usb_phy->PWD = 0;
-
- // TX Timing
- uint32_t phytx = usb_phy->TX;
- phytx &= ~(USBPHY_TX_D_CAL_MASK | USBPHY_TX_TXCAL45DM_MASK | USBPHY_TX_TXCAL45DP_MASK);
- phytx |= USBPHY_TX_D_CAL(0x0C) | USBPHY_TX_TXCAL45DP(0x06) | USBPHY_TX_TXCAL45DM(0x06);
- usb_phy->TX = phytx;
-}
-
-//--------------------------------------------------------------------+
-// USB Interrupt Handler
-//--------------------------------------------------------------------+
-void USB_OTG1_IRQHandler(void)
-{
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
- tuh_int_handler(0);
- #endif
-
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
- tud_int_handler(0);
- #endif
-}
-
-void USB_OTG2_IRQHandler(void)
-{
- #if CFG_TUSB_RHPORT1_MODE & OPT_MODE_HOST
- tuh_int_handler(1);
- #endif
-
- #if CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE
- tud_int_handler(1);
- #endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- GPIO_PinWrite(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- // active low
- return BUTTON_STATE_ACTIVE == GPIO_PinRead(BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- LPUART_ReadBlocking(UART_PORT, buf, len);
- return len;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- LPUART_WriteBlocking(UART_PORT, (uint8_t*)buf, len);
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler(void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/imxrt/family.mk b/tinyusb/hw/bsp/imxrt/family.mk
deleted file mode 100755
index a919d369..00000000
--- a/tinyusb/hw/bsp/imxrt/family.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-UF2_FAMILY_ID = 0x4fb2d5bd
-SDK_DIR = hw/mcu/nxp/mcux-sdk
-DEPS_SUBMODULES += $(SDK_DIR)
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m7 \
- -mfloat-abi=hard \
- -mfpu=fpv5-d16 \
- -D__ARMVFP__=0 -D__ARMFPV5__=0\
- -DXIP_EXTERNAL_FLASH=1 \
- -DXIP_BOOT_HEADER_ENABLE=1 \
- -DCFG_TUSB_MCU=OPT_MCU_MIMXRT10XX
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter -Wno-error=implicit-fallthrough=
-
-MCU_DIR = $(SDK_DIR)/devices/$(MCU_VARIANT)
-
-# All source paths should be relative to the top level.
-LD_FILE = $(MCU_DIR)/gcc/$(MCU_VARIANT)xxxxx_flexspi_nor.ld
-
-# TODO for net_lwip_webserver exmaple, but may not needed !!
-LDFLAGS += \
- -Wl,--defsym,__stack_size__=0x800 \
-
-SRC_C += \
- src/portable/nxp/transdimension/dcd_transdimension.c \
- $(MCU_DIR)/system_$(MCU_VARIANT).c \
- $(MCU_DIR)/xip/fsl_flexspi_nor_boot.c \
- $(MCU_DIR)/project_template/clock_config.c \
- $(MCU_DIR)/drivers/fsl_clock.c \
- $(SDK_DIR)/drivers/common/fsl_common.c \
- $(SDK_DIR)/drivers/igpio/fsl_gpio.c \
- $(SDK_DIR)/drivers/lpuart/fsl_lpuart.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/$(MCU_DIR)/../../CMSIS/Include \
- $(TOP)/$(MCU_DIR) \
- $(TOP)/$(MCU_DIR)/project_template \
- $(TOP)/$(MCU_DIR)/drivers \
- $(TOP)/$(SDK_DIR)/drivers/common \
- $(TOP)/$(SDK_DIR)/drivers/igpio \
- $(TOP)/$(SDK_DIR)/drivers/lpuart
-
-SRC_S += $(MCU_DIR)/gcc/startup_$(MCU_VARIANT).S
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM7/r0p1
-
diff --git a/tinyusb/hw/bsp/lpc15/boards/lpcxpresso1549/board.h b/tinyusb/hw/bsp/lpc15/boards/lpcxpresso1549/board.h
deleted file mode 100755
index 5ed5b75b..00000000
--- a/tinyusb/hw/bsp/lpc15/boards/lpcxpresso1549/board.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// XTAL
-#define XTAL_OscRateIn 12000000
-#define XTAL_RTCOscRateIn 32768
-
-// LED
-#define LED_PORT 0
-#define LED_PIN 25
-
-// Wake Switch
-#define BUTTON_PORT 0
-#define BUTTON_PIN 17
-
-#define UART_PORT LPC_USART0
-
-static inline void board_lpc15_pinmux_swm_init(void)
-{
- // Pinmux
- const PINMUX_GRP_T pinmuxing[] =
- {
- {0, 25, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, // PIO0_25-BREAK_CTRL-RED (low enable)
- {0, 13, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, // PIO0_13-ISP_RX
- {0, 18, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, // PIO0_18-ISP_TX
- {1, 11, (IOCON_MODE_PULLDOWN | IOCON_DIGMODE_EN)}, // PIO1_11-ISP_1 (VBUS)
- };
-
- // Pin Mux
- Chip_IOCON_SetPinMuxing(LPC_IOCON, pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
-
- // SWIM
- Chip_SWM_MovablePortPinAssign(SWM_USB_VBUS_I , 1, 11);
- Chip_SWM_MovablePortPinAssign(SWM_UART0_RXD_I, 0, 13);
- Chip_SWM_MovablePortPinAssign(SWM_UART0_TXD_O, 0, 18);
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/lpc15/boards/lpcxpresso1549/board.mk b/tinyusb/hw/bsp/lpc15/boards/lpcxpresso1549/board.mk
deleted file mode 100755
index a3e04cfa..00000000
--- a/tinyusb/hw/bsp/lpc15/boards/lpcxpresso1549/board.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-LD_FILE = $(BOARD_PATH)/lpc1549.ld
-
-JLINK_DEVICE = LPC1549
-
-# flash using pyocd
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/lpc15/boards/lpcxpresso1549/lpc1549.ld b/tinyusb/hw/bsp/lpc15/boards/lpcxpresso1549/lpc1549.ld
deleted file mode 100755
index 6dd12ade..00000000
--- a/tinyusb/hw/bsp/lpc15/boards/lpcxpresso1549/lpc1549.ld
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * GENERATED FILE - DO NOT EDIT
- * Copyright (c) 2008-2013 Code Red Technologies Ltd,
- * Copyright 2015, 2018-2019 NXP
- * (c) NXP Semiconductors 2013-2019
- * Generated linker script file for LPC1549
- * Created from linkscript.ldt by FMCreateLinkLibraries
- * Using Freemarker v2.3.23
- * MCUXpresso IDE v11.0.0 [Build 2516] [2019-06-05] on Oct 3, 2019 2:55:18 PM
- */
-
-
-MEMORY
-{
- /* Define each memory region */
- MFlash256 (rx) : ORIGIN = 0x0, LENGTH = 0x40000 /* 256K bytes (alias Flash) */
- Ram0_16 (rwx) : ORIGIN = 0x2000000, LENGTH = 0x4000 /* 16K bytes (alias RAM) */
- Ram1_16 (rwx) : ORIGIN = 0x2004000, LENGTH = 0x4000 /* 16K bytes (alias RAM2) */
- Ram2_4 (rwx) : ORIGIN = 0x2008000, LENGTH = 0x1000 /* 4K bytes (alias RAM3) */
-}
-
- /* Define a symbol for the top of each memory region */
- __base_MFlash256 = 0x0 ; /* MFlash256 */
- __base_Flash = 0x0 ; /* Flash */
- __top_MFlash256 = 0x0 + 0x40000 ; /* 256K bytes */
- __top_Flash = 0x0 + 0x40000 ; /* 256K bytes */
- __base_Ram0_16 = 0x2000000 ; /* Ram0_16 */
- __base_RAM = 0x2000000 ; /* RAM */
- __top_Ram0_16 = 0x2000000 + 0x4000 ; /* 16K bytes */
- __top_RAM = 0x2000000 + 0x4000 ; /* 16K bytes */
- __base_Ram1_16 = 0x2004000 ; /* Ram1_16 */
- __base_RAM2 = 0x2004000 ; /* RAM2 */
- __top_Ram1_16 = 0x2004000 + 0x4000 ; /* 16K bytes */
- __top_RAM2 = 0x2004000 + 0x4000 ; /* 16K bytes */
- __base_Ram2_4 = 0x2008000 ; /* Ram2_4 */
- __base_RAM3 = 0x2008000 ; /* RAM3 */
- __top_Ram2_4 = 0x2008000 + 0x1000 ; /* 4K bytes */
- __top_RAM3 = 0x2008000 + 0x1000 ; /* 4K bytes */
-
-ENTRY(ResetISR)
-
-SECTIONS
-{
- /* MAIN TEXT SECTION */
- .text : ALIGN(4)
- {
- FILL(0xff)
- __vectors_start__ = ABSOLUTE(.) ;
- KEEP(*(.isr_vector))
- /* Global Section Table */
- . = ALIGN(4) ;
- __section_table_start = .;
- __data_section_table = .;
- LONG(LOADADDR(.data));
- LONG( ADDR(.data));
- LONG( SIZEOF(.data));
- LONG(LOADADDR(.data_RAM2));
- LONG( ADDR(.data_RAM2));
- LONG( SIZEOF(.data_RAM2));
- LONG(LOADADDR(.data_RAM3));
- LONG( ADDR(.data_RAM3));
- LONG( SIZEOF(.data_RAM3));
- __data_section_table_end = .;
- __bss_section_table = .;
- LONG( ADDR(.bss));
- LONG( SIZEOF(.bss));
- LONG( ADDR(.bss_RAM2));
- LONG( SIZEOF(.bss_RAM2));
- LONG( ADDR(.bss_RAM3));
- LONG( SIZEOF(.bss_RAM3));
- __bss_section_table_end = .;
- __section_table_end = . ;
- /* End of Global Section Table */
-
- *(.after_vectors*)
-
- } > MFlash256
-
- .text : ALIGN(4)
- {
- *(.text*)
- *(.rodata .rodata.* .constdata .constdata.*)
- . = ALIGN(4);
- } > MFlash256
- /*
- * for exception handling/unwind - some Newlib functions (in common
- * with C++ and STDC++) use this.
- */
- .ARM.extab : ALIGN(4)
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > MFlash256
-
- __exidx_start = .;
-
- .ARM.exidx : ALIGN(4)
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > MFlash256
- __exidx_end = .;
-
- _etext = .;
-
- /* DATA section for Ram1_16 */
-
- .data_RAM2 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM2 = .) ;
- *(.ramfunc.$RAM2)
- *(.ramfunc.$Ram1_16)
- *(.data.$RAM2)
- *(.data.$Ram1_16)
- *(.data.$RAM2.*)
- *(.data.$Ram1_16.*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM2 = .) ;
- } > Ram1_16 AT>MFlash256
- /* DATA section for Ram2_4 */
-
- .data_RAM3 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM3 = .) ;
- *(.ramfunc.$RAM3)
- *(.ramfunc.$Ram2_4)
- *(.data.$RAM3)
- *(.data.$Ram2_4)
- *(.data.$RAM3.*)
- *(.data.$Ram2_4.*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM3 = .) ;
- } > Ram2_4 AT>MFlash256
- /* MAIN DATA SECTION */
- .uninit_RESERVED (NOLOAD) :
- {
- . = ALIGN(4) ;
- KEEP(*(.bss.$RESERVED*))
- . = ALIGN(4) ;
- _end_uninit_RESERVED = .;
- } > Ram0_16
-
- /* Main DATA section (Ram0_16) */
- .data : ALIGN(4)
- {
- FILL(0xff)
- _data = . ;
- *(vtable)
- *(.ramfunc*)
- *(.data*)
- . = ALIGN(4) ;
- _edata = . ;
- } > Ram0_16 AT>MFlash256
-
- /* BSS section for Ram1_16 */
- .bss_RAM2 :
- {
- . = ALIGN(4) ;
- PROVIDE(__start_bss_RAM2 = .) ;
- *(.bss.$RAM2)
- *(.bss.$Ram1_16)
- *(.bss.$RAM2.*)
- *(.bss.$Ram1_16.*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM2 = .) ;
- } > Ram1_16
-
- /* BSS section for Ram2_4 */
- .bss_RAM3 :
- {
- . = ALIGN(4) ;
- PROVIDE(__start_bss_RAM3 = .) ;
- *(.bss.$RAM3)
- *(.bss.$Ram2_4)
- *(.bss.$RAM3.*)
- *(.bss.$Ram2_4.*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM3 = .) ;
- } > Ram2_4
-
- /* MAIN BSS SECTION */
- .bss :
- {
- . = ALIGN(4) ;
- _bss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4) ;
- _ebss = .;
- PROVIDE(end = .);
- } > Ram0_16
-
- /* NOINIT section for Ram1_16 */
- .noinit_RAM2 (NOLOAD) :
- {
- . = ALIGN(4) ;
- *(.noinit.$RAM2)
- *(.noinit.$Ram1_16)
- *(.noinit.$RAM2.*)
- *(.noinit.$Ram1_16.*)
- . = ALIGN(4) ;
- } > Ram1_16
-
- /* NOINIT section for Ram2_4 */
- .noinit_RAM3 (NOLOAD) :
- {
- . = ALIGN(4) ;
- *(.noinit.$RAM3)
- *(.noinit.$Ram2_4)
- *(.noinit.$RAM3.*)
- *(.noinit.$Ram2_4.*)
- . = ALIGN(4) ;
- } > Ram2_4
-
- /* DEFAULT NOINIT SECTION */
- .noinit (NOLOAD):
- {
- . = ALIGN(4) ;
- _noinit = .;
- *(.noinit*)
- . = ALIGN(4) ;
- _end_noinit = .;
- } > Ram0_16
- PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
- PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_Ram0_16 - 0);
-
- /* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (NMI_Handler + 1)
- + (HardFault_Handler + 1)
- + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
- + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
- + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
- ) );
-
- /* Provide basic symbols giving location and size of main text
- * block, including initial values of RW data sections. Note that
- * these will need extending to give a complete picture with
- * complex images (e.g multiple Flash banks).
- */
- _image_start = LOADADDR(.text);
- _image_end = LOADADDR(.data) + SIZEOF(.data);
- _image_size = _image_end - _image_start;
-} \ No newline at end of file
diff --git a/tinyusb/hw/bsp/lpc15/family.c b/tinyusb/hw/bsp/lpc15/family.c
deleted file mode 100755
index 7f5984a3..00000000
--- a/tinyusb/hw/bsp/lpc15/family.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "chip.h"
-#include "bsp/board.h"
-#include "board.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-/* System oscillator rate and RTC oscillator rate */
-const uint32_t OscRateIn = XTAL_OscRateIn;
-const uint32_t RTCOscRateIn = XTAL_RTCOscRateIn;
-
-// Invoked by startup code
-void SystemInit(void)
-{
- Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SRAM1);
- Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SRAM2);
- Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_IOCON);
- Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);
- Chip_SYSCTL_PeriphReset(RESET_IOCON);
-
- board_lpc15_pinmux_swm_init();
-
- Chip_SetupXtalClocking();
-}
-
-void board_init(void)
-{
- SystemCoreClockUpdate();
-
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- Chip_GPIO_Init(LPC_GPIO);
-
- // LED
- Chip_GPIO_SetPinDIROutput(LPC_GPIO, LED_PORT, LED_PIN);
-
- // Button
- Chip_GPIO_SetPinDIRInput(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
-
- // UART
- Chip_Clock_SetUARTBaseClockRate(Chip_Clock_GetMainClockRate(), false);
- Chip_UART_Init(UART_PORT);
- Chip_UART_ConfigData(UART_PORT, UART_CFG_DATALEN_8 | UART_CFG_PARITY_NONE | UART_CFG_STOPLEN_1);
- Chip_UART_SetBaud(UART_PORT, CFG_BOARD_UART_BAUDRATE);
- Chip_UART_Enable(UART_PORT);
- Chip_UART_TXEnable(UART_PORT);
-
- // USB: Setup PLL clock, and power
- Chip_USB_Init();
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- Chip_GPIO_SetPinState(LPC_GPIO, LED_PORT, LED_PIN, state);
-}
-
-uint32_t board_button_read(void)
-{
- // active low
- return Chip_GPIO_GetPinState(LPC_GPIO, BUTTON_PORT, BUTTON_PIN) ? 0 : 1;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- return Chip_UART_SendBlocking(UART_PORT, buf, len);
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/lpc15/family.mk b/tinyusb/hw/bsp/lpc15/family.mk
deleted file mode 100755
index e80a3bc5..00000000
--- a/tinyusb/hw/bsp/lpc15/family.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nxp/lpcopen
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m3 \
- -nostdlib \
- -DCORE_M3 \
- -D__USE_LPCOPEN \
- -DCFG_EXAMPLE_MSC_READONLY \
- -DCFG_TUSB_MCU=OPT_MCU_LPC15XX \
- -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=unused-variable
-
-MCU_DIR = hw/mcu/nxp/lpcopen/lpc15xx/lpc_chip_15xx
-
-SRC_C += \
- src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
- $(MCU_DIR)/../gcc/cr_startup_lpc15xx.c \
- $(MCU_DIR)/src/chip_15xx.c \
- $(MCU_DIR)/src/clock_15xx.c \
- $(MCU_DIR)/src/gpio_15xx.c \
- $(MCU_DIR)/src/iocon_15xx.c \
- $(MCU_DIR)/src/swm_15xx.c \
- $(MCU_DIR)/src/sysctl_15xx.c \
- $(MCU_DIR)/src/uart_15xx.c \
- $(MCU_DIR)/src/sysinit_15xx.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/$(MCU_DIR)/inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM3
diff --git a/tinyusb/hw/bsp/lpc18/boards/lpcxpresso18s37/board.h b/tinyusb/hw/bsp/lpc18/boards/lpcxpresso18s37/board.h
deleted file mode 100755
index b3a7bc44..00000000
--- a/tinyusb/hw/bsp/lpc18/boards/lpcxpresso18s37/board.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-// Note: For USB Host demo, install JP4
-// WARNING: don't install JP4 when running as device
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED Red
-#define LED_PORT 3
-#define LED_PIN 7
-
-// ISP Button
-#define BUTTON_PORT 0
-#define BUTTON_PIN 7
-
-#define UART_DEV LPC_USART0
-
-static inline void board_lpc18_pinmux(void)
-{
- const PINMUX_GRP_T pinmuxing[] =
- {
- // LEDs
- { 0x6, 9 , SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC0 },
- { 0x6, 11, SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC0 },
-
- // Button
- { 0x2, 7, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC0 },
-
- // UART
- { 0x06, 4, SCU_MODE_PULLDOWN | SCU_MODE_FUNC2 },
- { 0x02, 1, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC1 },
-
- // USB0
- //{ 0x6, 3, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC1 }, // P6_3 USB0_PWR_EN, USB0 VBus function
-
- //{ 0x9, 5, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC2 }, // P9_5 USB1_VBUS_EN, USB1 VBus function
- //{ 0x2, 5, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 }, // P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION
- {0x2, 5, SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC4 },
- };
-
- Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/lpc18/boards/lpcxpresso18s37/board.mk b/tinyusb/hw/bsp/lpc18/boards/lpcxpresso18s37/board.mk
deleted file mode 100755
index 29b12913..00000000
--- a/tinyusb/hw/bsp/lpc18/boards/lpcxpresso18s37/board.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-LD_FILE = $(BOARD_PATH)/lpc1837.ld
-
-# For flash-jlink target
-JLINK_DEVICE = LPC18S37
-
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld b/tinyusb/hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld
deleted file mode 100755
index 51fd1539..00000000
--- a/tinyusb/hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
- * GENERATED FILE - DO NOT EDIT
- * Copyright (c) 2008-2013 Code Red Technologies Ltd,
- * Copyright 2015, 2018-2019 NXP
- * (c) NXP Semiconductors 2013-2021
- * Generated linker script file for LPC1837
- * Created from linkscript.ldt by FMCreateLinkLibraries
- * Using Freemarker v2.3.23
- * MCUXpresso IDE v11.2.0 [Build 4120] [2020-07-09] on Mar 3, 2021 4:22:49 PM
- */
-
-MEMORY
-{
- /* Define each memory region */
- MFlashA512 (rx) : ORIGIN = 0x1a000000, LENGTH = 0x80000 /* 512K bytes (alias Flash) */
- MFlashB512 (rx) : ORIGIN = 0x1b000000, LENGTH = 0x80000 /* 512K bytes (alias Flash2) */
- RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */
- RamLoc40 (rwx) : ORIGIN = 0x10080000, LENGTH = 0xa000 /* 40K bytes (alias RAM2) */
- RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes (alias RAM3) */
- RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16K bytes (alias RAM4) */
- RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes (alias RAM5) */
-}
-
-/* Define a symbol for the top of each memory region */
-__base_MFlashA512 = 0x1a000000 ; /* MFlashA512 */
-__base_Flash = 0x1a000000 ; /* Flash */
-__top_MFlashA512 = 0x1a000000 + 0x80000 ; /* 512K bytes */
-__top_Flash = 0x1a000000 + 0x80000 ; /* 512K bytes */
-__base_MFlashB512 = 0x1b000000 ; /* MFlashB512 */
-__base_Flash2 = 0x1b000000 ; /* Flash2 */
-__top_MFlashB512 = 0x1b000000 + 0x80000 ; /* 512K bytes */
-__top_Flash2 = 0x1b000000 + 0x80000 ; /* 512K bytes */
-__base_RamLoc32 = 0x10000000 ; /* RamLoc32 */
-__base_RAM = 0x10000000 ; /* RAM */
-__top_RamLoc32 = 0x10000000 + 0x8000 ; /* 32K bytes */
-__top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */
-__base_RamLoc40 = 0x10080000 ; /* RamLoc40 */
-__base_RAM2 = 0x10080000 ; /* RAM2 */
-__top_RamLoc40 = 0x10080000 + 0xa000 ; /* 40K bytes */
-__top_RAM2 = 0x10080000 + 0xa000 ; /* 40K bytes */
-__base_RamAHB32 = 0x20000000 ; /* RamAHB32 */
-__base_RAM3 = 0x20000000 ; /* RAM3 */
-__top_RamAHB32 = 0x20000000 + 0x8000 ; /* 32K bytes */
-__top_RAM3 = 0x20000000 + 0x8000 ; /* 32K bytes */
-__base_RamAHB16 = 0x20008000 ; /* RamAHB16 */
-__base_RAM4 = 0x20008000 ; /* RAM4 */
-__top_RamAHB16 = 0x20008000 + 0x4000 ; /* 16K bytes */
-__top_RAM4 = 0x20008000 + 0x4000 ; /* 16K bytes */
-__base_RamAHB_ETB16 = 0x2000c000 ; /* RamAHB_ETB16 */
-__base_RAM5 = 0x2000c000 ; /* RAM5 */
-__top_RamAHB_ETB16 = 0x2000c000 + 0x4000 ; /* 16K bytes */
-__top_RAM5 = 0x2000c000 + 0x4000 ; /* 16K bytes */
-
-ENTRY(ResetISR)
-
-SECTIONS
-{
- .text_Flash2 : ALIGN(4)
- {
- FILL(0xff)
- *(.text_Flash2) /* for compatibility with previous releases */
- *(.text_MFlashB512) /* for compatibility with previous releases */
- *(.text.$Flash2)
- *(.text.$MFlashB512)
- *(.text_Flash2.*) /* for compatibility with previous releases */
- *(.text_MFlashB512.*) /* for compatibility with previous releases */
- *(.text.$Flash2.*)
- *(.text.$MFlashB512.*)
- *(.rodata.$Flash2)
- *(.rodata.$MFlashB512)
- *(.rodata.$Flash2.*)
- *(.rodata.$MFlashB512.*) } > MFlashB512
-
- /* MAIN TEXT SECTION */
- .text : ALIGN(4)
- {
- FILL(0xff)
- __vectors_start__ = ABSOLUTE(.) ;
- KEEP(*(.isr_vector))
- /* Global Section Table */
- . = ALIGN(4) ;
- __section_table_start = .;
- __data_section_table = .;
- LONG(LOADADDR(.data));
- LONG( ADDR(.data));
- LONG( SIZEOF(.data));
- LONG(LOADADDR(.data_RAM2));
- LONG( ADDR(.data_RAM2));
- LONG( SIZEOF(.data_RAM2));
- LONG(LOADADDR(.data_RAM3));
- LONG( ADDR(.data_RAM3));
- LONG( SIZEOF(.data_RAM3));
- LONG(LOADADDR(.data_RAM4));
- LONG( ADDR(.data_RAM4));
- LONG( SIZEOF(.data_RAM4));
- LONG(LOADADDR(.data_RAM5));
- LONG( ADDR(.data_RAM5));
- LONG( SIZEOF(.data_RAM5));
- __data_section_table_end = .;
- __bss_section_table = .;
- LONG( ADDR(.bss));
- LONG( SIZEOF(.bss));
- LONG( ADDR(.bss_RAM2));
- LONG( SIZEOF(.bss_RAM2));
- LONG( ADDR(.bss_RAM3));
- LONG( SIZEOF(.bss_RAM3));
- LONG( ADDR(.bss_RAM4));
- LONG( SIZEOF(.bss_RAM4));
- LONG( ADDR(.bss_RAM5));
- LONG( SIZEOF(.bss_RAM5));
- __bss_section_table_end = .;
- __section_table_end = . ;
- /* End of Global Section Table */
-
- *(.after_vectors*)
-
- } > MFlashA512
-
- .text : ALIGN(4)
- {
- *(.text*)
- *(.rodata .rodata.* .constdata .constdata.*)
- . = ALIGN(4);
- } > MFlashA512
- /*
- * for exception handling/unwind - some Newlib functions (in common
- * with C++ and STDC++) use this.
- */
- .ARM.extab : ALIGN(4)
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > MFlashA512
-
- .ARM.exidx : ALIGN(4)
- {
- __exidx_start = .;
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- __exidx_end = .;
- } > MFlashA512
-
- _etext = .;
-
- /* DATA section for RamLoc40 */
-
- .data_RAM2 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM2 = .) ;
- PROVIDE(__start_data_RamLoc40 = .) ;
- *(.ramfunc.$RAM2)
- *(.ramfunc.$RamLoc40)
- *(.data.$RAM2)
- *(.data.$RamLoc40)
- *(.data.$RAM2.*)
- *(.data.$RamLoc40.*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM2 = .) ;
- PROVIDE(__end_data_RamLoc40 = .) ;
- } > RamLoc40 AT>MFlashA512
-
- /* DATA section for RamAHB32 */
-
- .data_RAM3 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM3 = .) ;
- PROVIDE(__start_data_RamAHB32 = .) ;
- *(.ramfunc.$RAM3)
- *(.ramfunc.$RamAHB32)
- *(.data.$RAM3)
- *(.data.$RamAHB32)
- *(.data.$RAM3.*)
- *(.data.$RamAHB32.*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM3 = .) ;
- PROVIDE(__end_data_RamAHB32 = .) ;
- } > RamAHB32 AT>MFlashA512
-
- /* DATA section for RamAHB16 */
-
- .data_RAM4 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM4 = .) ;
- PROVIDE(__start_data_RamAHB16 = .) ;
- *(.ramfunc.$RAM4)
- *(.ramfunc.$RamAHB16)
- *(.data.$RAM4)
- *(.data.$RamAHB16)
- *(.data.$RAM4.*)
- *(.data.$RamAHB16.*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM4 = .) ;
- PROVIDE(__end_data_RamAHB16 = .) ;
- } > RamAHB16 AT>MFlashA512
-
- /* DATA section for RamAHB_ETB16 */
-
- .data_RAM5 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM5 = .) ;
- PROVIDE(__start_data_RamAHB_ETB16 = .) ;
- *(.ramfunc.$RAM5)
- *(.ramfunc.$RamAHB_ETB16)
- *(.data.$RAM5)
- *(.data.$RamAHB_ETB16)
- *(.data.$RAM5.*)
- *(.data.$RamAHB_ETB16.*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM5 = .) ;
- PROVIDE(__end_data_RamAHB_ETB16 = .) ;
- } > RamAHB_ETB16 AT>MFlashA512
-
- /* MAIN DATA SECTION */
- .uninit_RESERVED (NOLOAD) : ALIGN(4)
- {
- _start_uninit_RESERVED = .;
- KEEP(*(.bss.$RESERVED*))
- . = ALIGN(4) ;
- _end_uninit_RESERVED = .;
- } > RamLoc32 AT> RamLoc32
-
- /* Main DATA section (RamLoc32) */
- .data : ALIGN(4)
- {
- FILL(0xff)
- _data = . ;
- PROVIDE(__start_data_RAM = .) ;
- PROVIDE(__start_data_RamLoc32 = .) ;
- *(vtable)
- *(.ramfunc*)
- KEEP(*(CodeQuickAccess))
- KEEP(*(DataQuickAccess))
- *(RamFunction)
- *(.data*)
- . = ALIGN(4) ;
- _edata = . ;
- PROVIDE(__end_data_RAM = .) ;
- PROVIDE(__end_data_RamLoc32 = .) ;
- } > RamLoc32 AT>MFlashA512
-
- /* BSS section for RamLoc40 */
- .bss_RAM2 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM2 = .) ;
- PROVIDE(__start_bss_RamLoc40 = .) ;
- *(.bss.$RAM2)
- *(.bss.$RamLoc40)
- *(.bss.$RAM2.*)
- *(.bss.$RamLoc40.*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM2 = .) ;
- PROVIDE(__end_bss_RamLoc40 = .) ;
- } > RamLoc40 AT> RamLoc40
-
- /* BSS section for RamAHB32 */
- .bss_RAM3 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM3 = .) ;
- PROVIDE(__start_bss_RamAHB32 = .) ;
- *(.bss.$RAM3)
- *(.bss.$RamAHB32)
- *(.bss.$RAM3.*)
- *(.bss.$RamAHB32.*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM3 = .) ;
- PROVIDE(__end_bss_RamAHB32 = .) ;
- } > RamAHB32 AT> RamAHB32
-
- /* BSS section for RamAHB16 */
- .bss_RAM4 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM4 = .) ;
- PROVIDE(__start_bss_RamAHB16 = .) ;
- *(.bss.$RAM4)
- *(.bss.$RamAHB16)
- *(.bss.$RAM4.*)
- *(.bss.$RamAHB16.*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM4 = .) ;
- PROVIDE(__end_bss_RamAHB16 = .) ;
- } > RamAHB16 AT> RamAHB16
-
- /* BSS section for RamAHB_ETB16 */
- .bss_RAM5 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM5 = .) ;
- PROVIDE(__start_bss_RamAHB_ETB16 = .) ;
- *(.bss.$RAM5)
- *(.bss.$RamAHB_ETB16)
- *(.bss.$RAM5.*)
- *(.bss.$RamAHB_ETB16.*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM5 = .) ;
- PROVIDE(__end_bss_RamAHB_ETB16 = .) ;
- } > RamAHB_ETB16 AT> RamAHB_ETB16
-
- /* MAIN BSS SECTION */
- .bss : ALIGN(4)
- {
- _bss = .;
- PROVIDE(__start_bss_RAM = .) ;
- PROVIDE(__start_bss_RamLoc32 = .) ;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4) ;
- _ebss = .;
- PROVIDE(__end_bss_RAM = .) ;
- PROVIDE(__end_bss_RamLoc32 = .) ;
- PROVIDE(end = .);
- } > RamLoc32 AT> RamLoc32
-
- /* NOINIT section for RamLoc40 */
- .noinit_RAM2 (NOLOAD) : ALIGN(4)
- {
- PROVIDE(__start_noinit_RAM2 = .) ;
- PROVIDE(__start_noinit_RamLoc40 = .) ;
- *(.noinit.$RAM2)
- *(.noinit.$RamLoc40)
- *(.noinit.$RAM2.*)
- *(.noinit.$RamLoc40.*)
- . = ALIGN(4) ;
- PROVIDE(__end_noinit_RAM2 = .) ;
- PROVIDE(__end_noinit_RamLoc40 = .) ;
- } > RamLoc40 AT> RamLoc40
-
- /* NOINIT section for RamAHB32 */
- .noinit_RAM3 (NOLOAD) : ALIGN(4)
- {
- PROVIDE(__start_noinit_RAM3 = .) ;
- PROVIDE(__start_noinit_RamAHB32 = .) ;
- *(.noinit.$RAM3)
- *(.noinit.$RamAHB32)
- *(.noinit.$RAM3.*)
- *(.noinit.$RamAHB32.*)
- . = ALIGN(4) ;
- PROVIDE(__end_noinit_RAM3 = .) ;
- PROVIDE(__end_noinit_RamAHB32 = .) ;
- } > RamAHB32 AT> RamAHB32
-
- /* NOINIT section for RamAHB16 */
- .noinit_RAM4 (NOLOAD) : ALIGN(4)
- {
- PROVIDE(__start_noinit_RAM4 = .) ;
- PROVIDE(__start_noinit_RamAHB16 = .) ;
- *(.noinit.$RAM4)
- *(.noinit.$RamAHB16)
- *(.noinit.$RAM4.*)
- *(.noinit.$RamAHB16.*)
- . = ALIGN(4) ;
- PROVIDE(__end_noinit_RAM4 = .) ;
- PROVIDE(__end_noinit_RamAHB16 = .) ;
- } > RamAHB16 AT> RamAHB16
-
- /* NOINIT section for RamAHB_ETB16 */
- .noinit_RAM5 (NOLOAD) : ALIGN(4)
- {
- PROVIDE(__start_noinit_RAM5 = .) ;
- PROVIDE(__start_noinit_RamAHB_ETB16 = .) ;
- *(.noinit.$RAM5)
- *(.noinit.$RamAHB_ETB16)
- *(.noinit.$RAM5.*)
- *(.noinit.$RamAHB_ETB16.*)
- . = ALIGN(4) ;
- PROVIDE(__end_noinit_RAM5 = .) ;
- PROVIDE(__end_noinit_RamAHB_ETB16 = .) ;
- } > RamAHB_ETB16 AT> RamAHB_ETB16
-
- /* DEFAULT NOINIT SECTION */
- .noinit (NOLOAD): ALIGN(4)
- {
- _noinit = .;
- PROVIDE(__start_noinit_RAM = .) ;
- PROVIDE(__start_noinit_RamLoc32 = .) ;
- *(.noinit*)
- . = ALIGN(4) ;
- _end_noinit = .;
- PROVIDE(__end_noinit_RAM = .) ;
- PROVIDE(__end_noinit_RamLoc32 = .) ;
- } > RamLoc32 AT> RamLoc32
- PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
- PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc32 - 0);
-
- /* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (NMI_Handler + 1)
- + (HardFault_Handler + 1)
- + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
- + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
- + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
- ) );
-
- /* Provide basic symbols giving location and size of main text
- * block, including initial values of RW data sections. Note that
- * these will need extending to give a complete picture with
- * complex images (e.g multiple Flash banks).
- */
- _image_start = LOADADDR(.text);
- _image_end = LOADADDR(.data) + SIZEOF(.data);
- _image_size = _image_end - _image_start;
-} \ No newline at end of file
diff --git a/tinyusb/hw/bsp/lpc18/boards/mcb1800/board.h b/tinyusb/hw/bsp/lpc18/boards/mcb1800/board.h
deleted file mode 100755
index 6111da97..00000000
--- a/tinyusb/hw/bsp/lpc18/boards/mcb1800/board.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// PD_10
-#define LED_PORT 6
-#define LED_PIN 24
-
-// P4_0
-#define BUTTON_PORT 2
-#define BUTTON_PIN 0
-
-#define UART_DEV LPC_USART3
-
-static inline void board_lpc18_pinmux(void)
-{
- const PINMUX_GRP_T pinmuxing[] =
- {
- // LEDs
- { 0xD, 10, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4) },
- { 0xD, 11, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) },
- { 0xD, 12, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) },
- { 0xD, 13, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) },
- { 0xD, 14, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) },
- { 0x9, 0, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) },
- { 0x9, 1, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) },
- { 0x9, 2, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) },
-
- // Button
- { 0x4, 0, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLUP) },
-
- // UART
- { 2, 3, SCU_MODE_PULLDOWN | SCU_MODE_FUNC2 },
- { 2, 4, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 },
-
- // USB0
- { 0x6, 3, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC1 }, // P6_3 USB0_PWR_EN, USB0 VBus function
-
- { 0x9, 5, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC2 }, // P9_5 USB1_VBUS_EN, USB1 VBus function
- { 0x2, 5, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 }, // P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION
- };
-
- Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
-
- /* Pin clock mux values, re-used structure, value in first index is meaningless */
- const PINMUX_GRP_T pinclockmuxing[] =
- {
- { 0, 0, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
- { 0, 1, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
- { 0, 2, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
- { 0, 3, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)},
- };
-
- /* Clock pins only, group field not used */
- for (uint32_t i = 0; i < (sizeof(pinclockmuxing) / sizeof(pinclockmuxing[0])); i++)
- {
- Chip_SCU_ClockPinMuxSet(pinclockmuxing[i].pinnum, pinclockmuxing[i].modefunc);
- }
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/lpc18/boards/mcb1800/board.mk b/tinyusb/hw/bsp/lpc18/boards/mcb1800/board.mk
deleted file mode 100755
index 0307a21d..00000000
--- a/tinyusb/hw/bsp/lpc18/boards/mcb1800/board.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-LD_FILE = $(BOARD_PATH)/lpc1857.ld
-
-# For flash-jlink target
-JLINK_DEVICE = LPC1857
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/lpc18/boards/mcb1800/lpc1857.ld b/tinyusb/hw/bsp/lpc18/boards/mcb1800/lpc1857.ld
deleted file mode 100755
index 9a308e34..00000000
--- a/tinyusb/hw/bsp/lpc18/boards/mcb1800/lpc1857.ld
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * GENERATED FILE - DO NOT EDIT
- * (c) Code Red Technologies Ltd, 2008-2013
- * (c) NXP Semiconductors 2013-2019
- * Generated linker script file for LPC1857
- * Created from linkscript.ldt by FMCreateLinkLibraries
- * Using Freemarker v2.3.23
- * MCUXpresso IDE v10.2.1 [Build 795] [2018-07-25] on May 15, 2019 1:01:52 PM
- */
-
-MEMORY
-{
- /* Define each memory region */
- MFlashA512 (rx) : ORIGIN = 0x1a000000, LENGTH = 0x80000 /* 512K bytes (alias Flash) */
- MFlashB512 (rx) : ORIGIN = 0x1b000000, LENGTH = 0x80000 /* 512K bytes (alias Flash2) */
- RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */
- RamLoc40 (rwx) : ORIGIN = 0x10080000, LENGTH = 0xa000 /* 40K bytes (alias RAM2) */
- RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes (alias RAM3) */
- RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16K bytes (alias RAM4) */
- RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes (alias RAM5) */
-}
-
-/* Define a symbol for the top of each memory region */
-__base_MFlashA512 = 0x1a000000 ; /* MFlashA512 */
-__base_Flash = 0x1a000000 ; /* Flash */
-__top_MFlashA512 = 0x1a000000 + 0x80000 ; /* 512K bytes */
-__top_Flash = 0x1a000000 + 0x80000 ; /* 512K bytes */
-__base_MFlashB512 = 0x1b000000 ; /* MFlashB512 */
-__base_Flash2 = 0x1b000000 ; /* Flash2 */
-__top_MFlashB512 = 0x1b000000 + 0x80000 ; /* 512K bytes */
-__top_Flash2 = 0x1b000000 + 0x80000 ; /* 512K bytes */
-__base_RamLoc32 = 0x10000000 ; /* RamLoc32 */
-__base_RAM = 0x10000000 ; /* RAM */
-__top_RamLoc32 = 0x10000000 + 0x8000 ; /* 32K bytes */
-__top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */
-__base_RamLoc40 = 0x10080000 ; /* RamLoc40 */
-__base_RAM2 = 0x10080000 ; /* RAM2 */
-__top_RamLoc40 = 0x10080000 + 0xa000 ; /* 40K bytes */
-__top_RAM2 = 0x10080000 + 0xa000 ; /* 40K bytes */
-__base_RamAHB32 = 0x20000000 ; /* RamAHB32 */
-__base_RAM3 = 0x20000000 ; /* RAM3 */
-__top_RamAHB32 = 0x20000000 + 0x8000 ; /* 32K bytes */
-__top_RAM3 = 0x20000000 + 0x8000 ; /* 32K bytes */
-__base_RamAHB16 = 0x20008000 ; /* RamAHB16 */
-__base_RAM4 = 0x20008000 ; /* RAM4 */
-__top_RamAHB16 = 0x20008000 + 0x4000 ; /* 16K bytes */
-__top_RAM4 = 0x20008000 + 0x4000 ; /* 16K bytes */
-__base_RamAHB_ETB16 = 0x2000c000 ; /* RamAHB_ETB16 */
-__base_RAM5 = 0x2000c000 ; /* RAM5 */
-__top_RamAHB_ETB16 = 0x2000c000 + 0x4000 ; /* 16K bytes */
-__top_RAM5 = 0x2000c000 + 0x4000 ; /* 16K bytes */
-
-ENTRY(ResetISR)
-
-SECTIONS
-{
- .text_Flash2 : ALIGN(4)
- {
- FILL(0xff)
- *(.text_Flash2*) /* for compatibility with previous releases */
- *(.text_MFlashB512*) /* for compatibility with previous releases */
- *(.text.$Flash2*)
- *(.text.$MFlashB512*)
- *(.rodata.$Flash2*)
- *(.rodata.$MFlashB512*)
- } > MFlashB512
-
- /* MAIN TEXT SECTION */
- .text : ALIGN(4)
- {
- FILL(0xff)
- __vectors_start__ = ABSOLUTE(.) ;
- KEEP(*(.isr_vector))
- /* Global Section Table */
- . = ALIGN(4) ;
- __section_table_start = .;
- __data_section_table = .;
- LONG(LOADADDR(.data));
- LONG( ADDR(.data));
- LONG( SIZEOF(.data));
- LONG(LOADADDR(.data_RAM2));
- LONG( ADDR(.data_RAM2));
- LONG( SIZEOF(.data_RAM2));
- LONG(LOADADDR(.data_RAM3));
- LONG( ADDR(.data_RAM3));
- LONG( SIZEOF(.data_RAM3));
- LONG(LOADADDR(.data_RAM4));
- LONG( ADDR(.data_RAM4));
- LONG( SIZEOF(.data_RAM4));
- LONG(LOADADDR(.data_RAM5));
- LONG( ADDR(.data_RAM5));
- LONG( SIZEOF(.data_RAM5));
- __data_section_table_end = .;
- __bss_section_table = .;
- LONG( ADDR(.bss));
- LONG( SIZEOF(.bss));
- LONG( ADDR(.bss_RAM2));
- LONG( SIZEOF(.bss_RAM2));
- LONG( ADDR(.bss_RAM3));
- LONG( SIZEOF(.bss_RAM3));
- LONG( ADDR(.bss_RAM4));
- LONG( SIZEOF(.bss_RAM4));
- LONG( ADDR(.bss_RAM5));
- LONG( SIZEOF(.bss_RAM5));
- __bss_section_table_end = .;
- __section_table_end = . ;
- /* End of Global Section Table */
-
- *(.after_vectors*)
-
- } > MFlashA512
-
- .text : ALIGN(4)
- {
- *(.text*)
- *(.rodata .rodata.* .constdata .constdata.*)
- . = ALIGN(4);
- } > MFlashA512
- /*
- * for exception handling/unwind - some Newlib functions (in common
- * with C++ and STDC++) use this.
- */
- .ARM.extab : ALIGN(4)
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > MFlashA512
-
- __exidx_start = .;
-
- .ARM.exidx : ALIGN(4)
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > MFlashA512
- __exidx_end = .;
-
- _etext = .;
-
- /* DATA section for RamLoc40 */
-
- .data_RAM2 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM2 = .) ;
- *(.ramfunc.$RAM2)
- *(.ramfunc.$RamLoc40)
- *(.data.$RAM2*)
- *(.data.$RamLoc40*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM2 = .) ;
- } > RamLoc40 AT>MFlashA512
- /* DATA section for RamAHB32 */
-
- .data_RAM3 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM3 = .) ;
- *(.ramfunc.$RAM3)
- *(.ramfunc.$RamAHB32)
- *(.data.$RAM3*)
- *(.data.$RamAHB32*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM3 = .) ;
- } > RamAHB32 AT>MFlashA512
- /* DATA section for RamAHB16 */
-
- .data_RAM4 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM4 = .) ;
- *(.ramfunc.$RAM4)
- *(.ramfunc.$RamAHB16)
- *(.data.$RAM4*)
- *(.data.$RamAHB16*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM4 = .) ;
- } > RamAHB16 AT>MFlashA512
- /* DATA section for RamAHB_ETB16 */
-
- .data_RAM5 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM5 = .) ;
- *(.ramfunc.$RAM5)
- *(.ramfunc.$RamAHB_ETB16)
- *(.data.$RAM5*)
- *(.data.$RamAHB_ETB16*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM5 = .) ;
- } > RamAHB_ETB16 AT>MFlashA512
- /* MAIN DATA SECTION */
- .uninit_RESERVED : ALIGN(4)
- {
- KEEP(*(.bss.$RESERVED*))
- . = ALIGN(4) ;
- _end_uninit_RESERVED = .;
- } > RamLoc32
-
- /* Main DATA section (RamLoc32) */
- .data : ALIGN(4)
- {
- FILL(0xff)
- _data = . ;
- *(vtable)
- *(.ramfunc*)
- *(.data*)
- . = ALIGN(4) ;
- _edata = . ;
- } > RamLoc32 AT>MFlashA512
-
- /* BSS section for RamLoc40 */
- .bss_RAM2 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM2 = .) ;
- *(.bss.$RAM2*)
- *(.bss.$RamLoc40*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM2 = .) ;
- } > RamLoc40
-
- /* BSS section for RamAHB32 */
- .bss_RAM3 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM3 = .) ;
- *(.bss.$RAM3*)
- *(.bss.$RamAHB32*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM3 = .) ;
- } > RamAHB32
-
- /* BSS section for RamAHB16 */
- .bss_RAM4 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM4 = .) ;
- *(.bss.$RAM4*)
- *(.bss.$RamAHB16*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM4 = .) ;
- } > RamAHB16
-
- /* BSS section for RamAHB_ETB16 */
- .bss_RAM5 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM5 = .) ;
- *(.bss.$RAM5*)
- *(.bss.$RamAHB_ETB16*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM5 = .) ;
- } > RamAHB_ETB16
-
- /* MAIN BSS SECTION */
- .bss : ALIGN(4)
- {
- _bss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4) ;
- _ebss = .;
- PROVIDE(end = .);
- } > RamLoc32
-
- /* NOINIT section for RamLoc40 */
- .noinit_RAM2 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM2*)
- *(.noinit.$RamLoc40*)
- . = ALIGN(4) ;
- } > RamLoc40
-
- /* NOINIT section for RamAHB32 */
- .noinit_RAM3 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM3*)
- *(.noinit.$RamAHB32*)
- . = ALIGN(4) ;
- } > RamAHB32
-
- /* NOINIT section for RamAHB16 */
- .noinit_RAM4 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM4*)
- *(.noinit.$RamAHB16*)
- . = ALIGN(4) ;
- } > RamAHB16
-
- /* NOINIT section for RamAHB_ETB16 */
- .noinit_RAM5 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM5*)
- *(.noinit.$RamAHB_ETB16*)
- . = ALIGN(4) ;
- } > RamAHB_ETB16
-
- /* DEFAULT NOINIT SECTION */
- .noinit (NOLOAD): ALIGN(4)
- {
- _noinit = .;
- *(.noinit*)
- . = ALIGN(4) ;
- _end_noinit = .;
- } > RamLoc32
- PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
- PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc32 - 0);
-
- /* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (NMI_Handler + 1)
- + (HardFault_Handler + 1)
- + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
- + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
- + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
- ) );
-
- /* Provide basic symbols giving location and size of main text
- * block, including initial values of RW data sections. Note that
- * these will need extending to give a complete picture with
- * complex images (e.g multiple Flash banks).
- */
- _image_start = LOADADDR(.text);
- _image_end = LOADADDR(.data) + SIZEOF(.data);
- _image_size = _image_end - _image_start;
-} \ No newline at end of file
diff --git a/tinyusb/hw/bsp/lpc18/family.c b/tinyusb/hw/bsp/lpc18/family.c
deleted file mode 100755
index d74ebcd3..00000000
--- a/tinyusb/hw/bsp/lpc18/family.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "chip.h"
-#include "bsp/board.h"
-#include "board.h"
-
-//--------------------------------------------------------------------+
-// USB Interrupt Handler
-//--------------------------------------------------------------------+
-void USB0_IRQHandler(void)
-{
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
- tuh_int_handler(0);
- #endif
-
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
- tud_int_handler(0);
- #endif
-}
-
-void USB1_IRQHandler(void)
-{
- #if CFG_TUSB_RHPORT1_MODE & OPT_MODE_HOST
- tuh_int_handler(1);
- #endif
-
- #if CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE
- tud_int_handler(1);
- #endif
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-
-/* System configuration variables used by chip driver */
-const uint32_t OscRateIn = 12000000;
-const uint32_t ExtRateIn = 0;
-
-// Invoked by startup code
-void SystemInit(void)
-{
-#ifdef __USE_LPCOPEN
- extern void (* const g_pfnVectors[])(void);
- unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
- *pSCB_VTOR = (unsigned int) g_pfnVectors;
-#endif
-
- board_lpc18_pinmux();
- Chip_SetupXtalClocking();
-}
-
-void board_init(void)
-{
- SystemCoreClockUpdate();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- //NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- Chip_GPIO_Init(LPC_GPIO_PORT);
-
- // LED
- Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, LED_PORT, LED_PIN);
-
- // Button
- Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN);
-
- //------------- UART -------------//
- Chip_UART_Init(UART_DEV);
- Chip_UART_SetBaud(UART_DEV, CFG_BOARD_UART_BAUDRATE);
- Chip_UART_ConfigData(UART_DEV, UART_LCR_WLEN8 | UART_LCR_SBS_1BIT | UART_LCR_PARITY_DIS);
- Chip_UART_TXEnable(UART_DEV);
-
- //------------- USB -------------//
-#if CFG_TUSB_RHPORT0_MODE
- Chip_USB0_Init();
-#endif
-
-#if CFG_TUSB_RHPORT1_MODE
- Chip_USB1_Init();
-#endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- Chip_GPIO_SetPinState(LPC_GPIO_PORT, LED_PORT, LED_PIN, state);
-}
-
-uint32_t board_button_read(void)
-{
- // active low
- return Chip_GPIO_GetPinState(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN) ? 0 : 1;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- //return UART_ReceiveByte(BOARD_UART_PORT);
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- uint8_t const* buf8 = (uint8_t const*) buf;
- for(int i=0; i<len; i++)
- {
- while ((Chip_UART_ReadLineStatus(UART_DEV) & UART_LSR_THRE) == 0) {}
- Chip_UART_SendByte(UART_DEV, buf8[i]);
- }
-
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/lpc18/family.mk b/tinyusb/hw/bsp/lpc18/family.mk
deleted file mode 100755
index 3fed0b45..00000000
--- a/tinyusb/hw/bsp/lpc18/family.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nxp/lpcopen
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m3 \
- -nostdlib \
- -DCORE_M3 \
- -D__USE_LPCOPEN \
- -DCFG_TUSB_MCU=OPT_MCU_LPC18XX
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes
-
-MCU_DIR = hw/mcu/nxp/lpcopen/lpc18xx/lpc_chip_18xx
-
-SRC_C += \
- src/portable/nxp/transdimension/dcd_transdimension.c \
- $(MCU_DIR)/../gcc/cr_startup_lpc18xx.c \
- $(MCU_DIR)/src/chip_18xx_43xx.c \
- $(MCU_DIR)/src/clock_18xx_43xx.c \
- $(MCU_DIR)/src/gpio_18xx_43xx.c \
- $(MCU_DIR)/src/sysinit_18xx_43xx.c \
- $(MCU_DIR)/src/uart_18xx_43xx.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/$(MCU_DIR)/inc \
- $(TOP)/$(MCU_DIR)/inc/config_18xx
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM3
diff --git a/tinyusb/hw/bsp/lpc54/boards/lpcxpresso54114/board.h b/tinyusb/hw/bsp/lpc54/boards/lpcxpresso54114/board.h
deleted file mode 100755
index b1ad4258..00000000
--- a/tinyusb/hw/bsp/lpc54/boards/lpcxpresso54114/board.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT 0
-#define LED_PIN 29
-#define LED_STATE_ON 0
-
-// WAKE button
-#define BUTTON_PORT 0
-#define BUTTON_PIN 24
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_DEV USART0
-#define UART_RX_PINMUX 0, 0, IOCON_PIO_DIG_FUNC1_EN
-#define UART_TX_PINMUX 0, 1, IOCON_PIO_DIG_FUNC1_EN
-
-// USB0 VBUS
-#define USB0_VBUS_PINMUX 1, 6, IOCON_PIO_DIG_FUNC7_EN
-
-// XTAL
-//#define XTAL0_CLK_HZ (16 * 1000 * 1000U)
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/lpc54/boards/lpcxpresso54114/board.mk b/tinyusb/hw/bsp/lpc54/boards/lpcxpresso54114/board.mk
deleted file mode 100755
index 6e33d8cb..00000000
--- a/tinyusb/hw/bsp/lpc54/boards/lpcxpresso54114/board.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-MCU_VARIANT = LPC54114
-MCU_CORE = LPC54114_cm4
-
-CFLAGS += -DCPU_LPC54114J256BD64_cm4
-LD_FILE = $(MCU_DIR)/gcc/LPC54114J256_cm4_flash.ld
-
-LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower_cm4_hardabi.a
-
-JLINK_DEVICE = LPC54114J256_M4
-PYOCD_TARGET = LPC54114
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/lpc54/boards/lpcxpresso54628/board.h b/tinyusb/hw/bsp/lpc54/boards/lpcxpresso54628/board.h
deleted file mode 100755
index 67027751..00000000
--- a/tinyusb/hw/bsp/lpc54/boards/lpcxpresso54628/board.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT 2
-#define LED_PIN 2
-#define LED_STATE_ON 0
-
-// WAKE button
-#define BUTTON_PORT 1
-#define BUTTON_PIN 1
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_DEV USART0
-#define UART_RX_PINMUX 0, 29, IOCON_PIO_DIG_FUNC1_EN
-#define UART_TX_PINMUX 0, 30, IOCON_PIO_DIG_FUNC1_EN
-
-// USB0 VBUS
-#define USB0_VBUS_PINMUX 0, 22, IOCON_PIO_DIG_FUNC7_EN
-
-// XTAL
-//#define XTAL0_CLK_HZ (16 * 1000 * 1000U)
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/lpc54/boards/lpcxpresso54628/board.mk b/tinyusb/hw/bsp/lpc54/boards/lpcxpresso54628/board.mk
deleted file mode 100755
index 925374cc..00000000
--- a/tinyusb/hw/bsp/lpc54/boards/lpcxpresso54628/board.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-MCU_VARIANT = LPC54628
-MCU_CORE = LPC54628
-
-PORT ?= 0
-
-CFLAGS += -DCPU_LPC54628J512ET180
-CFLAGS += -Wno-error=double-promotion
-
-LD_FILE = $(MCU_DIR)/gcc/LPC54628J512_flash.ld
-
-LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower_hardabi.a
-
-JLINK_DEVICE = LPC54628J512
-PYOCD_TARGET = LPC54628
-
-#flash: flash-pyocd
-
-flash: flash-jlink \ No newline at end of file
diff --git a/tinyusb/hw/bsp/lpc54/family.c b/tinyusb/hw/bsp/lpc54/family.c
deleted file mode 100755
index 4789425a..00000000
--- a/tinyusb/hw/bsp/lpc54/family.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018, hathach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "fsl_device_registers.h"
-#include "fsl_gpio.h"
-#include "fsl_power.h"
-#include "fsl_iocon.h"
-#include "fsl_usart.h"
-
-#include "bsp/board.h"
-#include "board.h"
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-// IOCON pin mux
-#define IOCON_PIO_DIGITAL_EN 0x80u // Enables digital function
-#define IOCON_PIO_FUNC0 0x00u
-#define IOCON_PIO_FUNC1 0x01u // Selects pin function 1
-#define IOCON_PIO_FUNC7 0x07u // Selects pin function 7
-#define IOCON_PIO_INPFILT_OFF 0x0100u // Input filter disabled
-#define IOCON_PIO_INV_DI 0x00u // Input function is not inverted
-#define IOCON_PIO_MODE_INACT 0x00u // No addition pin function
-#define IOCON_PIO_MODE_PULLUP 0x10u
-#define IOCON_PIO_OPENDRAIN_DI 0x00u // Open drain is disabled
-#define IOCON_PIO_SLEW_STANDARD 0x00u // Standard mode, output slew rate control is enabled
-
-// Digital pin function n enabled
-#define IOCON_PIO_DIG_FUNC0_EN (IOCON_PIO_DIGITAL_EN | IOCON_PIO_INPFILT_OFF | IOCON_PIO_FUNC0)
-#define IOCON_PIO_DIG_FUNC1_EN (IOCON_PIO_DIGITAL_EN | IOCON_PIO_INPFILT_OFF | IOCON_PIO_FUNC1)
-#define IOCON_PIO_DIG_FUNC4_EN (IOCON_PIO_DIGITAL_EN | IOCON_PIO_INPFILT_OFF | IOCON_PIO_FUNC4)
-#define IOCON_PIO_DIG_FUNC7_EN (IOCON_PIO_DIGITAL_EN | IOCON_PIO_INPFILT_OFF | IOCON_PIO_FUNC7)
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB0_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-void USB1_IRQHandler(void)
-{
- tud_int_handler(1);
-}
-
-/****************************************************************
-name: BOARD_BootClockFROHF96M
-outputs:
-- {id: SYSTICK_clock.outFreq, value: 96 MHz}
-- {id: System_clock.outFreq, value: 96 MHz}
-settings:
-- {id: SYSCON.MAINCLKSELA.sel, value: SYSCON.fro_hf}
-sources:
-- {id: SYSCON.fro_hf.outFreq, value: 96 MHz}
-******************************************************************/
-void BootClockFROHF96M(void)
-{
- /*!< Set up the clock sources */
- /*!< Set up FRO */
- POWER_DisablePD(kPDRUNCFG_PD_FRO_EN); /*!< Ensure FRO is on */
- CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); /*!< Switch to FRO 12MHz first to ensure we can change voltage without
- accidentally being below the voltage for current speed */
- POWER_SetVoltageForFreq(96000000U); /*!< Set voltage for the one of the fastest clock outputs: System clock output */
- CLOCK_SetFLASHAccessCyclesForFreq(96000000U); /*!< Set FLASH wait states for core */
-
- CLOCK_SetupFROClocking(96000000U); /*!< Set up high frequency FRO output to selected frequency */
-
- /*!< Set up dividers */
- CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U, false); /*!< Set AHBCLKDIV divider to value 1 */
-
- /*!< Set up clock selectors - Attach clocks to the peripheries */
- CLOCK_AttachClk(kFRO_HF_to_MAIN_CLK); /*!< Switch MAIN_CLK to FRO_HF */
-
- /*!< Set SystemCoreClock variable. */
- SystemCoreClock = 96000000U;
-}
-
-void board_init(void)
-{
- // Enable IOCON clock
- CLOCK_EnableClock(kCLOCK_Iocon);
-
- // Init 96 MHz clock
- BootClockFROHF96M();
-
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- // Init all GPIO ports 54114 only has 2 ports.
- GPIO_PortInit(GPIO, LED_PORT);
- GPIO_PortInit(GPIO, BUTTON_PORT);
-
- // LED
- IOCON_PinMuxSet(IOCON, LED_PORT, LED_PIN, IOCON_PIO_DIG_FUNC0_EN);
- gpio_pin_config_t const led_config = { kGPIO_DigitalOutput, 0};
- GPIO_PinInit(GPIO, LED_PORT, LED_PIN, &led_config);
-
- board_led_write(0);
-
- // Button
- IOCON_PinMuxSet(IOCON, BUTTON_PORT, BUTTON_PIN, IOCON_PIO_DIG_FUNC0_EN | IOCON_PIO_MODE_PULLUP);
- gpio_pin_config_t const button_config = { kGPIO_DigitalInput, 0};
- GPIO_PinInit(GPIO, BUTTON_PORT, BUTTON_PIN, &button_config);
-
-#ifdef UART_DEV
- // UART
- IOCON_PinMuxSet(IOCON, UART_RX_PINMUX);
- IOCON_PinMuxSet(IOCON, UART_TX_PINMUX);
-
- // Enable UART when debug log is on
- CLOCK_AttachClk(kFRO12M_to_FLEXCOMM0);
- usart_config_t uart_config;
- USART_GetDefaultConfig(&uart_config);
- uart_config.baudRate_Bps = CFG_BOARD_UART_BAUDRATE;
- uart_config.enableTx = true;
- uart_config.enableRx = true;
- USART_Init(UART_DEV, &uart_config, 12000000);
-#endif
-
- // USB
- IOCON_PinMuxSet(IOCON, USB0_VBUS_PINMUX);
-
-#if defined(FSL_FEATURE_SOC_USBHSD_COUNT) && FSL_FEATURE_SOC_USBHSD_COUNT
- // LPC546xx and LPC540xx has OTG 1 FS + 1 HS rhports
-
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
- // Port0 is Full Speed
- POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY); /*< Turn on USB Phy */
- CLOCK_SetClkDiv(kCLOCK_DivUsb0Clk, 1, false);
- CLOCK_AttachClk(kFRO_HF_to_USB0_CLK);
-
- /*According to reference mannual, device mode setting has to be set by access usb host register */
- CLOCK_EnableClock(kCLOCK_Usbhsl0); /* enable usb0 host clock */
- USBFSH->PORTMODE |= USBFSH_PORTMODE_DEV_ENABLE_MASK;
- CLOCK_DisableClock(kCLOCK_Usbhsl0); /* disable usb0 host clock */
-
- CLOCK_EnableUsbfs0DeviceClock(kCLOCK_UsbSrcFro, CLOCK_GetFroHfFreq());
- #endif
-
- #if CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE
- // Port1 is High Speed
- POWER_DisablePD(kPDRUNCFG_PD_USB1_PHY);
-
- /*According to reference mannual, device mode setting has to be set by access usb host register */
- CLOCK_EnableClock(kCLOCK_Usbh1); /* enable usb1 host clock */
- USBHSH->PORTMODE |= USBHSH_PORTMODE_DEV_ENABLE_MASK;
- CLOCK_DisableClock(kCLOCK_Usbh1); /* enable usb1 host clock */
-
- CLOCK_EnableUsbhs0DeviceClock(kCLOCK_UsbSrcUsbPll, 0U);
- #endif
-
-#else
- // LPC5411x series only has full speed device
-
- POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY); // Turn on USB Phy
- CLOCK_EnableUsbfs0Clock(kCLOCK_UsbSrcFro, CLOCK_GetFreq(kCLOCK_FroHf)); /* enable USB IP clock */
-#endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- GPIO_PinWrite(GPIO, LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- // active low
- return BUTTON_STATE_ACTIVE == GPIO_PinRead(GPIO, BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- USART_WriteBlocking(UART_DEV, (uint8_t *)buf, len);
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler(void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/lpc54/family.mk b/tinyusb/hw/bsp/lpc54/family.mk
deleted file mode 100755
index 600df6fd..00000000
--- a/tinyusb/hw/bsp/lpc54/family.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-SDK_DIR = hw/mcu/nxp/mcux-sdk
-DEPS_SUBMODULES += $(SDK_DIR)
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -DCFG_TUSB_MCU=OPT_MCU_LPC54XXX \
- -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
-
-ifeq ($(PORT), 1)
- $(info "PORT1 High Speed")
- CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
-
- # LPC55 Highspeed Port1 can only write to USB_SRAM region
- CFLAGS += -DCFG_TUSB_MEM_SECTION='__attribute__((section("m_usb_global")))'
-else
- $(info "PORT0 Full Speed")
-endif
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter
-
-MCU_DIR = $(SDK_DIR)/devices/$(MCU_VARIANT)
-
-SRC_C += \
- src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
- $(MCU_DIR)/system_$(MCU_CORE).c \
- $(MCU_DIR)/drivers/fsl_clock.c \
- $(MCU_DIR)/drivers/fsl_power.c \
- $(MCU_DIR)/drivers/fsl_reset.c \
- $(SDK_DIR)/drivers/lpc_gpio/fsl_gpio.c \
- $(SDK_DIR)/drivers/flexcomm/fsl_flexcomm.c \
- $(SDK_DIR)/drivers/flexcomm/fsl_usart.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/$(MCU_DIR)/../../CMSIS/Include \
- $(TOP)/$(MCU_DIR) \
- $(TOP)/$(MCU_DIR)/drivers \
- $(TOP)/$(SDK_DIR)/drivers/common \
- $(TOP)/$(SDK_DIR)/drivers/flexcomm \
- $(TOP)/$(SDK_DIR)/drivers/lpc_iocon \
- $(TOP)/$(SDK_DIR)/drivers/lpc_gpio
-
-SRC_S += $(MCU_DIR)/gcc/startup_$(MCU_CORE).S
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
diff --git a/tinyusb/hw/bsp/lpc55/boards/double_m33_express/LPC55S69_cm33_core0_uf2.ld b/tinyusb/hw/bsp/lpc55/boards/double_m33_express/LPC55S69_cm33_core0_uf2.ld
deleted file mode 100755
index 6b5d852a..00000000
--- a/tinyusb/hw/bsp/lpc55/boards/double_m33_express/LPC55S69_cm33_core0_uf2.ld
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
-** ###################################################################
-** Processors: LPC55S69JBD100_cm33_core0
-** LPC55S69JBD64_cm33_core0
-** LPC55S69JEV98_cm33_core0
-**
-** Compiler: GNU C Compiler
-** Reference manual: LPC55S6x/LPC55S2x/LPC552x User manual(UM11126) Rev.1.3 16 May 2019
-** Version: rev. 1.1, 2019-05-16
-** Build: b191008
-**
-** Abstract:
-** Linker file for the GNU C Compiler
-**
-** Copyright 2016 Freescale Semiconductor, Inc.
-** Copyright 2016-2019 NXP
-** All rights reserved.
-**
-** SPDX-License-Identifier: BSD-3-Clause
-**
-** http: www.nxp.com
-** mail: support@nxp.com
-**
-** ###################################################################
-*/
-
-
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
-STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0800;
-RPMSG_SHMEM_SIZE = DEFINED(__use_shmem__) ? 0x1800 : 0;
-
-/* Specify the memory areas */
-MEMORY
-{
- m_interrupts (RX) : ORIGIN = 0x00010000, LENGTH = 0x00000200
- m_text (RX) : ORIGIN = 0x00010200, LENGTH = 0x0007FE00
- m_core1_image (RX) : ORIGIN = 0x00090000, LENGTH = 0x00008000
- m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00033000 - RPMSG_SHMEM_SIZE
- rpmsg_sh_mem (RW) : ORIGIN = 0x20033000 - RPMSG_SHMEM_SIZE, LENGTH = RPMSG_SHMEM_SIZE
- m_usb_sram (RW) : ORIGIN = 0x40100000, LENGTH = 0x00004000
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* section for storing the secondary core image */
- .m0code :
- {
- . = ALIGN(4) ;
- KEEP (*(.m0code))
- *(.m0code*)
- . = ALIGN(4) ;
- } > m_core1_image
-
- /* NOINIT section for rpmsg_sh_mem */
- .noinit_rpmsg_sh_mem (NOLOAD) : ALIGN(4)
- {
- __RPMSG_SH_MEM_START__ = .;
- *(.noinit.$rpmsg_sh_mem*)
- . = ALIGN(4) ;
- __RPMSG_SH_MEM_END__ = .;
- } > rpmsg_sh_mem
-
- /* The startup code goes first into internal flash */
- .interrupts :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } > m_interrupts
-
- /* The program code and other data goes into internal flash */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
- KEEP (*(.init))
- KEEP (*(.fini))
- . = ALIGN(4);
- } > m_text
-
- .ARM.extab :
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > m_text
-
- .ARM :
- {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } > m_text
-
- .ctors :
- {
- __CTOR_LIST__ = .;
- /* gcc uses crtbegin.o to find the start of
- the constructors, so we make sure it is
- first. Because this is a wildcard, it
- doesn't matter if the user does not
- actually link against crtbegin.o; the
- linker won't look for a file to match a
- wildcard. The wildcard also means that it
- doesn't matter which directory crtbegin.o
- is in. */
- KEEP (*crtbegin.o(.ctors))
- KEEP (*crtbegin?.o(.ctors))
- /* We don't want to include the .ctor section from
- from the crtend.o file until after the sorted ctors.
- The .ctor section from the crtend file contains the
- end of ctors marker and it must be last */
- KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*(.ctors))
- __CTOR_END__ = .;
- } > m_text
-
- .dtors :
- {
- __DTOR_LIST__ = .;
- KEEP (*crtbegin.o(.dtors))
- KEEP (*crtbegin?.o(.dtors))
- KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*(.dtors))
- __DTOR_END__ = .;
- } > m_text
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } > m_text
-
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } > m_text
-
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } > m_text
-
- __etext = .; /* define a global symbol at end of code */
- __DATA_ROM = .; /* Symbol is used by startup for data initialization */
-
- .data : AT(__DATA_ROM)
- {
- . = ALIGN(4);
- __DATA_RAM = .;
- __data_start__ = .; /* create a global symbol at data start */
- *(.ramfunc*) /* for functions in ram */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
- KEEP(*(.jcr*))
- . = ALIGN(4);
- __data_end__ = .; /* define a global symbol at data end */
- } > m_data
-
- __DATA_END = __DATA_ROM + (__data_end__ - __data_start__);
- text_end = ORIGIN(m_text) + LENGTH(m_text);
- ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
-
- /* Uninitialized data section */
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss section */
- . = ALIGN(4);
- __START_BSS = .;
- __bss_start__ = .;
- *(.bss)
- *(.bss*)
- *(COMMON)
- . = ALIGN(4);
- __bss_end__ = .;
- __END_BSS = .;
- } > m_data
-
- .heap :
- {
- . = ALIGN(8);
- __end__ = .;
- PROVIDE(end = .);
- __HeapBase = .;
- . += HEAP_SIZE;
- __HeapLimit = .;
- __heap_limit = .; /* Add for _sbrk */
- } > m_data
-
- .stack :
- {
- . = ALIGN(8);
- . += STACK_SIZE;
- } > m_data
-
- m_usb_bdt (NOLOAD) :
- {
- . = ALIGN(512);
- *(m_usb_bdt)
- } > m_usb_sram
-
- m_usb_global (NOLOAD) :
- {
- *(m_usb_global)
- } > m_usb_sram
-
- /* Initializes stack on the end of block */
- __StackTop = ORIGIN(m_data) + LENGTH(m_data);
- __StackLimit = __StackTop - STACK_SIZE;
- PROVIDE(__stack = __StackTop);
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-
- ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap")
-}
-
diff --git a/tinyusb/hw/bsp/lpc55/boards/double_m33_express/board.h b/tinyusb/hw/bsp/lpc55/boards/double_m33_express/board.h
deleted file mode 100755
index 975e74e9..00000000
--- a/tinyusb/hw/bsp/lpc55/boards/double_m33_express/board.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT 0
-#define LED_PIN 1
-#define LED_STATE_ON 1
-
-// WAKE button
-#define BUTTON_PORT 0
-#define BUTTON_PIN 5
-#define BUTTON_STATE_ACTIVE 0
-
-// Number of neopixels
-#define NEOPIXEL_NUMBER 2
-#define NEOPIXEL_PORT 0
-#define NEOPIXEL_PIN 27
-#define NEOPIXEL_CH 6
-#define NEOPIXEL_TYPE 0
-
-// UART
-#define UART_DEV USART0
-#define UART_RX_PINMUX 0U, 29U, IOCON_PIO_DIG_FUNC1_EN
-#define UART_TX_PINMUX 0U, 30U, IOCON_PIO_DIG_FUNC1_EN
-
-// XTAL
-#define XTAL0_CLK_HZ (16 * 1000 * 1000U)
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/lpc55/boards/double_m33_express/board.mk b/tinyusb/hw/bsp/lpc55/boards/double_m33_express/board.mk
deleted file mode 100755
index d28700ca..00000000
--- a/tinyusb/hw/bsp/lpc55/boards/double_m33_express/board.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-MCU_VARIANT = LPC55S69
-MCU_CORE = LPC55S69_cm33_core0
-PORT ?= 1
-
-CFLAGS += -DCPU_LPC55S69JBD100_cm33_core0
-LD_FILE = $(BOARD_PATH)/LPC55S69_cm33_core0_uf2.ld
-
-JLINK_DEVICE = LPC55S69
-PYOCD_TARGET = LPC55S69
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/lpc55/boards/lpcxpresso55s28/board.h b/tinyusb/hw/bsp/lpc55/boards/lpcxpresso55s28/board.h
deleted file mode 100755
index f85701b0..00000000
--- a/tinyusb/hw/bsp/lpc55/boards/lpcxpresso55s28/board.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT 1
-#define LED_PIN 6
-#define LED_STATE_ON 0
-
-// WAKE button
-#define BUTTON_PORT 1
-#define BUTTON_PIN 18
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_DEV USART0
-#define UART_RX_PINMUX 0, 29, IOCON_PIO_DIG_FUNC1_EN
-#define UART_TX_PINMUX 0, 30, IOCON_PIO_DIG_FUNC1_EN
-
-// XTAL
-#define XTAL0_CLK_HZ (16 * 1000 * 1000U)
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/lpc55/boards/lpcxpresso55s28/board.mk b/tinyusb/hw/bsp/lpc55/boards/lpcxpresso55s28/board.mk
deleted file mode 100755
index ec0828e4..00000000
--- a/tinyusb/hw/bsp/lpc55/boards/lpcxpresso55s28/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-MCU_VARIANT = LPC55S28
-MCU_CORE = LPC55S28
-PORT ?= 1
-
-CFLAGS += -DCPU_LPC55S28JBD100
-
-JLINK_DEVICE = LPC55S28
-PYOCD_TARGET = LPC55S28
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/lpc55/boards/lpcxpresso55s69/board.h b/tinyusb/hw/bsp/lpc55/boards/lpcxpresso55s69/board.h
deleted file mode 100755
index f85701b0..00000000
--- a/tinyusb/hw/bsp/lpc55/boards/lpcxpresso55s69/board.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT 1
-#define LED_PIN 6
-#define LED_STATE_ON 0
-
-// WAKE button
-#define BUTTON_PORT 1
-#define BUTTON_PIN 18
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_DEV USART0
-#define UART_RX_PINMUX 0, 29, IOCON_PIO_DIG_FUNC1_EN
-#define UART_TX_PINMUX 0, 30, IOCON_PIO_DIG_FUNC1_EN
-
-// XTAL
-#define XTAL0_CLK_HZ (16 * 1000 * 1000U)
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/lpc55/boards/lpcxpresso55s69/board.mk b/tinyusb/hw/bsp/lpc55/boards/lpcxpresso55s69/board.mk
deleted file mode 100755
index 73edc88a..00000000
--- a/tinyusb/hw/bsp/lpc55/boards/lpcxpresso55s69/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-MCU_VARIANT = LPC55S69
-MCU_CORE = LPC55S69_cm33_core0
-PORT ?= 1
-
-CFLAGS += -DCPU_LPC55S69JBD100_cm33_core0
-
-JLINK_DEVICE = LPC55S69
-PYOCD_TARGET = LPC55S69
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/lpc55/boards/mcu_link/board.h b/tinyusb/hw/bsp/lpc55/boards/mcu_link/board.h
deleted file mode 100755
index 5e17cf9f..00000000
--- a/tinyusb/hw/bsp/lpc55/boards/mcu_link/board.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT 0
-#define LED_PIN 5
-#define LED_STATE_ON 0
-
-// WAKE button (Dummy, use unused pin
-#define BUTTON_PORT 0
-#define BUTTON_PIN 30
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_DEV USART0
-#define UART_RX_PINMUX 0, 24, IOCON_PIO_DIG_FUNC1_EN
-#define UART_TX_PINMUX 0, 25, IOCON_PIO_DIG_FUNC1_EN
-
-// XTAL
-#define XTAL0_CLK_HZ (16 * 1000 * 1000U)
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/lpc55/boards/mcu_link/board.mk b/tinyusb/hw/bsp/lpc55/boards/mcu_link/board.mk
deleted file mode 100755
index ceb1d0eb..00000000
--- a/tinyusb/hw/bsp/lpc55/boards/mcu_link/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-MCU_VARIANT = LPC55S69
-MCU_CORE = LPC55S69_cm33_core0
-PORT ?= 1
-
-CFLAGS += -DCPU_LPC55S69JBD64_cm33_core0
-
-JLINK_DEVICE = LPC55S69
-PYOCD_TARGET = LPC55S69
-
-# flash using pyocd
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/lpc55/family.c b/tinyusb/hw/bsp/lpc55/family.c
deleted file mode 100755
index 4fc1f622..00000000
--- a/tinyusb/hw/bsp/lpc55/family.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018, hathach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "bsp/board.h"
-#include "board.h"
-#include "fsl_device_registers.h"
-#include "fsl_gpio.h"
-#include "fsl_power.h"
-#include "fsl_iocon.h"
-#include "fsl_usart.h"
-#include "fsl_sctimer.h"
-#include "sct_neopixel.h"
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-// IOCON pin mux
-#define IOCON_PIO_DIGITAL_EN 0x0100u // Enables digital function
-#define IOCON_PIO_FUNC0 0x00u // Selects pin function 0
-#define IOCON_PIO_FUNC1 0x01u // Selects pin function 1
-#define IOCON_PIO_FUNC4 0x04u // Selects pin function 4
-#define IOCON_PIO_FUNC7 0x07u // Selects pin function 7
-#define IOCON_PIO_INV_DI 0x00u // Input function is not inverted
-#define IOCON_PIO_MODE_INACT 0x00u // No addition pin function
-#define IOCON_PIO_OPENDRAIN_DI 0x00u // Open drain is disabled
-#define IOCON_PIO_SLEW_STANDARD 0x00u // Standard mode, output slew rate control is enabled
-
-#define IOCON_PIO_DIG_FUNC0_EN (IOCON_PIO_DIGITAL_EN | IOCON_PIO_FUNC0) // Digital pin function 0 enabled
-#define IOCON_PIO_DIG_FUNC1_EN (IOCON_PIO_DIGITAL_EN | IOCON_PIO_FUNC1) // Digital pin function 1 enabled
-#define IOCON_PIO_DIG_FUNC4_EN (IOCON_PIO_DIGITAL_EN | IOCON_PIO_FUNC4) // Digital pin function 2 enabled
-#define IOCON_PIO_DIG_FUNC7_EN (IOCON_PIO_DIGITAL_EN | IOCON_PIO_FUNC7) // Digital pin function 2 enabled
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB0_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-void USB1_IRQHandler(void)
-{
- tud_int_handler(1);
-}
-
-/****************************************************************
-name: BOARD_BootClockFROHF96M
-outputs:
-- {id: SYSTICK_clock.outFreq, value: 96 MHz}
-- {id: System_clock.outFreq, value: 96 MHz}
-settings:
-- {id: SYSCON.MAINCLKSELA.sel, value: SYSCON.fro_hf}
-sources:
-- {id: SYSCON.fro_hf.outFreq, value: 96 MHz}
-******************************************************************/
-void BootClockFROHF96M(void)
-{
- /*!< Set up the clock sources */
- /*!< Set up FRO */
- POWER_DisablePD(kPDRUNCFG_PD_FRO192M); /*!< Ensure FRO is on */
- CLOCK_SetupFROClocking(12000000U); /*!< Set up FRO to the 12 MHz, just for sure */
- CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); /*!< Switch to FRO 12MHz first to ensure we can change voltage without
- accidentally being below the voltage for current speed */
-
- CLOCK_SetupFROClocking(96000000U); /*!< Set up high frequency FRO output to selected frequency */
-
- POWER_SetVoltageForFreq(96000000U); /*!< Set voltage for the one of the fastest clock outputs: System clock output */
- CLOCK_SetFLASHAccessCyclesForFreq(96000000U); /*!< Set FLASH wait states for core */
-
- /*!< Set up dividers */
- CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U, false); /*!< Set AHBCLKDIV divider to value 1 */
-
- /*!< Set up clock selectors - Attach clocks to the peripheries */
- CLOCK_AttachClk(kFRO_HF_to_MAIN_CLK); /*!< Switch MAIN_CLK to FRO_HF */
-
- /*!< Set SystemCoreClock variable. */
- SystemCoreClock = 96000000U;
-}
-
-void board_init(void)
-{
- // Enable IOCON clock
- CLOCK_EnableClock(kCLOCK_Iocon);
-
- // Init 96 MHz clock
- BootClockFROHF96M();
-
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- // Init all GPIO ports
- GPIO_PortInit(GPIO, 0);
- GPIO_PortInit(GPIO, 1);
-
- // LED
- IOCON_PinMuxSet(IOCON, LED_PORT, LED_PIN, IOCON_PIO_DIG_FUNC0_EN);
- gpio_pin_config_t const led_config = { kGPIO_DigitalOutput, 1};
- GPIO_PinInit(GPIO, LED_PORT, LED_PIN, &led_config);
-
- board_led_write(0);
-
-#ifdef NEOPIXEL_PIN
- // Neopixel
- static uint32_t pixelData[NEOPIXEL_NUMBER];
- IOCON_PinMuxSet(IOCON, NEOPIXEL_PORT, NEOPIXEL_PIN, IOCON_PIO_DIG_FUNC4_EN);
-
- sctpix_init(NEOPIXEL_TYPE);
- sctpix_addCh(NEOPIXEL_CH, pixelData, NEOPIXEL_NUMBER);
- sctpix_setPixel(NEOPIXEL_CH, 0, 0x100010);
- sctpix_setPixel(NEOPIXEL_CH, 1, 0x100010);
- sctpix_show();
-#endif
-
- // Button
- IOCON_PinMuxSet(IOCON, BUTTON_PORT, BUTTON_PIN, IOCON_PIO_DIG_FUNC0_EN);
- gpio_pin_config_t const button_config = { kGPIO_DigitalInput, 0};
- GPIO_PinInit(GPIO, BUTTON_PORT, BUTTON_PIN, &button_config);
-
-#ifdef UART_DEV
- // UART
- IOCON_PinMuxSet(IOCON, UART_RX_PINMUX);
- IOCON_PinMuxSet(IOCON, UART_TX_PINMUX);
-
- // Enable UART when debug log is on
- CLOCK_AttachClk(kFRO12M_to_FLEXCOMM0);
- usart_config_t uart_config;
- USART_GetDefaultConfig(&uart_config);
- uart_config.baudRate_Bps = CFG_BOARD_UART_BAUDRATE;
- uart_config.enableTx = true;
- uart_config.enableRx = true;
- USART_Init(UART_DEV, &uart_config, 12000000);
-#endif
-
- // USB VBUS
- /* PORT0 PIN22 configured as USB0_VBUS */
- IOCON_PinMuxSet(IOCON, 0U, 22U, IOCON_PIO_DIG_FUNC7_EN);
-
-#if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
- // Port0 is Full Speed
-
- /* Turn on USB0 Phy */
- POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY);
-
- /* reset the IP to make sure it's in reset state. */
- RESET_PeripheralReset(kUSB0D_RST_SHIFT_RSTn);
- RESET_PeripheralReset(kUSB0HSL_RST_SHIFT_RSTn);
- RESET_PeripheralReset(kUSB0HMR_RST_SHIFT_RSTn);
-
- // Enable USB Clock Adjustments to trim the FRO for the full speed controller
- ANACTRL->FRO192M_CTRL |= ANACTRL_FRO192M_CTRL_USBCLKADJ_MASK;
- CLOCK_SetClkDiv(kCLOCK_DivUsb0Clk, 1, false);
- CLOCK_AttachClk(kFRO_HF_to_USB0_CLK);
-
- /*According to reference mannual, device mode setting has to be set by access usb host register */
- CLOCK_EnableClock(kCLOCK_Usbhsl0); // enable usb0 host clock
- USBFSH->PORTMODE |= USBFSH_PORTMODE_DEV_ENABLE_MASK;
- CLOCK_DisableClock(kCLOCK_Usbhsl0); // disable usb0 host clock
-
- /* enable USB Device clock */
- CLOCK_EnableUsbfs0DeviceClock(kCLOCK_UsbfsSrcFro, CLOCK_GetFreq(kCLOCK_FroHf));
-#endif
-
-#if CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE
- // Port1 is High Speed
-
- /* Turn on USB1 Phy */
- POWER_DisablePD(kPDRUNCFG_PD_USB1_PHY);
-
- /* reset the IP to make sure it's in reset state. */
- RESET_PeripheralReset(kUSB1H_RST_SHIFT_RSTn);
- RESET_PeripheralReset(kUSB1D_RST_SHIFT_RSTn);
- RESET_PeripheralReset(kUSB1_RST_SHIFT_RSTn);
- RESET_PeripheralReset(kUSB1RAM_RST_SHIFT_RSTn);
-
- /* According to reference mannual, device mode setting has to be set by access usb host register */
- CLOCK_EnableClock(kCLOCK_Usbh1); // enable usb0 host clock
-
- USBHSH->PORTMODE = USBHSH_PORTMODE_SW_PDCOM_MASK; // Put PHY powerdown under software control
- USBHSH->PORTMODE |= USBHSH_PORTMODE_DEV_ENABLE_MASK;
-
- CLOCK_DisableClock(kCLOCK_Usbh1); // disable usb0 host clock
-
- /* enable USB Device clock */
- CLOCK_EnableUsbhs0PhyPllClock(kCLOCK_UsbPhySrcExt, XTAL0_CLK_HZ);
- CLOCK_EnableUsbhs0DeviceClock(kCLOCK_UsbSrcUnused, 0U);
- CLOCK_EnableClock(kCLOCK_UsbRam1);
-
- // Enable PHY support for Low speed device + LS via FS Hub
- USBPHY->CTRL |= USBPHY_CTRL_SET_ENUTMILEVEL2_MASK | USBPHY_CTRL_SET_ENUTMILEVEL3_MASK;
-
- // Enable all power for normal operation
- USBPHY->PWD = 0;
-
- USBPHY->CTRL_SET = USBPHY_CTRL_SET_ENAUTOCLR_CLKGATE_MASK;
- USBPHY->CTRL_SET = USBPHY_CTRL_SET_ENAUTOCLR_PHY_PWD_MASK;
-
- // TX Timing
-// uint32_t phytx = USBPHY->TX;
-// phytx &= ~(USBPHY_TX_D_CAL_MASK | USBPHY_TX_TXCAL45DM_MASK | USBPHY_TX_TXCAL45DP_MASK);
-// phytx |= USBPHY_TX_D_CAL(0x0C) | USBPHY_TX_TXCAL45DP(0x06) | USBPHY_TX_TXCAL45DM(0x06);
-// USBPHY->TX = phytx;
-#endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- GPIO_PinWrite(GPIO, LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-
-#ifdef NEOPIXEL_PIN
- if (state) {
- sctpix_setPixel(NEOPIXEL_CH, 0, 0x100000);
- sctpix_setPixel(NEOPIXEL_CH, 1, 0x101010);
- } else {
- sctpix_setPixel(NEOPIXEL_CH, 0, 0x001000);
- sctpix_setPixel(NEOPIXEL_CH, 1, 0x000010);
- }
- sctpix_show();
-#endif
-}
-
-uint32_t board_button_read(void)
-{
- // active low
- return BUTTON_STATE_ACTIVE == GPIO_PinRead(GPIO, BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- USART_WriteBlocking(UART_DEV, (uint8_t *)buf, len);
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler(void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/lpc55/family.mk b/tinyusb/hw/bsp/lpc55/family.mk
deleted file mode 100755
index 4e8d65ce..00000000
--- a/tinyusb/hw/bsp/lpc55/family.mk
+++ /dev/null
@@ -1,67 +0,0 @@
-UF2_FAMILY_ID = 0x2abc77ec
-SDK_DIR = hw/mcu/nxp/mcux-sdk
-DEPS_SUBMODULES += lib/sct_neopixel $(SDK_DIR)
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-# Default to Highspeed PORT1
-PORT ?= 1
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m33 \
- -mfloat-abi=hard \
- -mfpu=fpv5-sp-d16 \
- -DCFG_TUSB_MCU=OPT_MCU_LPC55XX \
- -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' \
- -DBOARD_DEVICE_RHPORT_NUM=$(PORT)
-
-ifeq ($(PORT), 1)
- $(info "PORT1 High Speed")
- CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
-
- # LPC55 Highspeed Port1 can only write to USB_SRAM region
- CFLAGS += -DCFG_TUSB_MEM_SECTION='__attribute__((section("m_usb_global")))'
-else
- $(info "PORT0 Full Speed")
-endif
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter -Wno-error=float-equal
-
-MCU_DIR = $(SDK_DIR)/devices/$(MCU_VARIANT)
-
-# All source paths should be relative to the top level.
-LD_FILE ?= $(MCU_DIR)/gcc/$(MCU_CORE)_flash.ld
-
-SRC_C += \
- src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
- $(MCU_DIR)/system_$(MCU_CORE).c \
- $(MCU_DIR)/drivers/fsl_clock.c \
- $(MCU_DIR)/drivers/fsl_power.c \
- $(MCU_DIR)/drivers/fsl_reset.c \
- $(SDK_DIR)/drivers/lpc_gpio/fsl_gpio.c \
- $(SDK_DIR)/drivers/flexcomm/fsl_flexcomm.c \
- $(SDK_DIR)/drivers/flexcomm/fsl_usart.c \
- lib/sct_neopixel/sct_neopixel.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/lib/sct_neopixel \
- $(TOP)/$(MCU_DIR)/../../CMSIS/Include \
- $(TOP)/$(MCU_DIR) \
- $(TOP)/$(MCU_DIR)/drivers \
- $(TOP)/$(SDK_DIR)/drivers/common \
- $(TOP)/$(SDK_DIR)/drivers/flexcomm \
- $(TOP)/$(SDK_DIR)/drivers/lpc_iocon \
- $(TOP)/$(SDK_DIR)/drivers/lpc_gpio \
- $(TOP)/$(SDK_DIR)/drivers/sctimer
-
-SRC_S += $(MCU_DIR)/gcc/startup_$(MCU_CORE).S
-
-LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower_hardabi.a
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM33_NTZ/non_secure
diff --git a/tinyusb/hw/bsp/lpcxpresso11u37/board.mk b/tinyusb/hw/bsp/lpcxpresso11u37/board.mk
deleted file mode 100755
index 8fcda51e..00000000
--- a/tinyusb/hw/bsp/lpcxpresso11u37/board.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nxp/lpcopen
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m0 \
- -nostdlib \
- -DCORE_M0 \
- -D__USE_LPCOPEN \
- -DCFG_EXAMPLE_MSC_READONLY \
- -DCFG_TUSB_MCU=OPT_MCU_LPC11UXX \
- -DCFG_TUSB_MEM_SECTION='__attribute__((section(".data.$$RAM2")))' \
- -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter
-
-MCU_DIR = hw/mcu/nxp/lpcopen/lpc11uxx/lpc_chip_11uxx
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/lpc11u37.ld
-
-SRC_C += \
- src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
- $(MCU_DIR)/../gcc/cr_startup_lpc11xx.c \
- $(MCU_DIR)/src/chip_11xx.c \
- $(MCU_DIR)/src/clock_11xx.c \
- $(MCU_DIR)/src/gpio_11xx_1.c \
- $(MCU_DIR)/src/iocon_11xx.c \
- $(MCU_DIR)/src/sysctl_11xx.c \
- $(MCU_DIR)/src/sysinit_11xx.c
-
-INC += \
- $(TOP)/$(MCU_DIR)/inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
-
-# For flash-jlink target
-JLINK_DEVICE = LPC11U37/401
-
-# flash using pyocd
-flash: $(BUILD)/$(PROJECT).hex
- pyocd flash -t lpc11u37 $<
diff --git a/tinyusb/hw/bsp/lpcxpresso11u37/lpc11u37.ld b/tinyusb/hw/bsp/lpcxpresso11u37/lpc11u37.ld
deleted file mode 100755
index 6a2dfb7f..00000000
--- a/tinyusb/hw/bsp/lpcxpresso11u37/lpc11u37.ld
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * GENERATED FILE - DO NOT EDIT
- * Copyright (c) 2008-2013 Code Red Technologies Ltd,
- * Copyright 2015, 2018-2019 NXP
- * (c) NXP Semiconductors 2013-2019
- * Generated linker script file for LPC11U37/401
- * Created from linkscript.ldt by FMCreateLinkLibraries
- * Using Freemarker v2.3.23
- * MCUXpresso IDE v11.0.0 [Build 2516] [2019-06-05] on Sep 6, 2019 12:16:06 PM
- */
-
-MEMORY
-{
- /* Define each memory region */
- MFlash128 (rx) : ORIGIN = 0x0, LENGTH = 0x20000 /* 128K bytes (alias Flash) */
- RamLoc8 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x2000 /* 8K bytes (alias RAM) */
- RamUsb2 (rwx) : ORIGIN = 0x20004000, LENGTH = 0x800 /* 2K bytes (alias RAM2) */
-}
-
- /* Define a symbol for the top of each memory region */
- __base_MFlash128 = 0x0 ; /* MFlash128 */
- __base_Flash = 0x0 ; /* Flash */
- __top_MFlash128 = 0x0 + 0x20000 ; /* 128K bytes */
- __top_Flash = 0x0 + 0x20000 ; /* 128K bytes */
- __base_RamLoc8 = 0x10000000 ; /* RamLoc8 */
- __base_RAM = 0x10000000 ; /* RAM */
- __top_RamLoc8 = 0x10000000 + 0x2000 ; /* 8K bytes */
- __top_RAM = 0x10000000 + 0x2000 ; /* 8K bytes */
- __base_RamUsb2 = 0x20004000 ; /* RamUsb2 */
- __base_RAM2 = 0x20004000 ; /* RAM2 */
- __top_RamUsb2 = 0x20004000 + 0x800 ; /* 2K bytes */
- __top_RAM2 = 0x20004000 + 0x800 ; /* 2K bytes */
-
-
-ENTRY(ResetISR)
-
-SECTIONS
-{
- /* MAIN TEXT SECTION */
- .text : ALIGN(4)
- {
- FILL(0xff)
- __vectors_start__ = ABSOLUTE(.) ;
- KEEP(*(.isr_vector))
- /* Global Section Table */
- . = ALIGN(4) ;
- __section_table_start = .;
- __data_section_table = .;
- LONG(LOADADDR(.data));
- LONG( ADDR(.data));
- LONG( SIZEOF(.data));
- LONG(LOADADDR(.data_RAM2));
- LONG( ADDR(.data_RAM2));
- LONG( SIZEOF(.data_RAM2));
- __data_section_table_end = .;
- __bss_section_table = .;
- LONG( ADDR(.bss));
- LONG( SIZEOF(.bss));
- LONG( ADDR(.bss_RAM2));
- LONG( SIZEOF(.bss_RAM2));
- __bss_section_table_end = .;
- __section_table_end = . ;
- /* End of Global Section Table */
-
- *(.after_vectors*)
-
- } > MFlash128
-
- .text : ALIGN(4)
- {
- *(.text*)
- *(.rodata .rodata.* .constdata .constdata.*)
- . = ALIGN(4);
- } > MFlash128
- /*
- * for exception handling/unwind - some Newlib functions (in common
- * with C++ and STDC++) use this.
- */
- .ARM.extab : ALIGN(4)
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > MFlash128
-
- __exidx_start = .;
-
- .ARM.exidx : ALIGN(4)
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > MFlash128
- __exidx_end = .;
-
- _etext = .;
-
- /* DATA section for RamUsb2 */
-
- .data_RAM2 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM2 = .) ;
- *(.ramfunc.$RAM2)
- *(.ramfunc.$RamUsb2)
- *(.data.$RAM2)
- *(.data.$RamUsb2)
- *(.data.$RAM2.*)
- *(.data.$RamUsb2.*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM2 = .) ;
- } > RamUsb2 AT>MFlash128
- /* MAIN DATA SECTION */
- .uninit_RESERVED (NOLOAD) :
- {
- . = ALIGN(4) ;
- KEEP(*(.bss.$RESERVED*))
- . = ALIGN(4) ;
- _end_uninit_RESERVED = .;
- } > RamLoc8
-
- /* Main DATA section (RamLoc8) */
- .data : ALIGN(4)
- {
- FILL(0xff)
- _data = . ;
- *(vtable)
- *(.ramfunc*)
- *(.data*)
- . = ALIGN(4) ;
- _edata = . ;
- } > RamLoc8 AT>MFlash128
-
- /* BSS section for RamUsb2 */
- .bss_RAM2 :
- {
- . = ALIGN(4) ;
- PROVIDE(__start_bss_RAM2 = .) ;
- *(.bss.$RAM2)
- *(.bss.$RamUsb2)
- *(.bss.$RAM2.*)
- *(.bss.$RamUsb2.*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM2 = .) ;
- } > RamUsb2
-
- /* MAIN BSS SECTION */
- .bss :
- {
- . = ALIGN(4) ;
- _bss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4) ;
- _ebss = .;
- PROVIDE(end = .);
- } > RamLoc8
-
- /* NOINIT section for RamUsb2 */
- .noinit_RAM2 (NOLOAD) :
- {
- . = ALIGN(4) ;
- *(.noinit.$RAM2)
- *(.noinit.$RamUsb2)
- *(.noinit.$RAM2.*)
- *(.noinit.$RamUsb2.*)
- . = ALIGN(4) ;
- } > RamUsb2
-
- /* DEFAULT NOINIT SECTION */
- .noinit (NOLOAD):
- {
- . = ALIGN(4) ;
- _noinit = .;
- *(.noinit*)
- . = ALIGN(4) ;
- _end_noinit = .;
- } > RamLoc8
- PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
- PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc8 - 0);
-
- /* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (( DEFINED(NMI_Handler) ? NMI_Handler : M0_NMI_Handler ) + 1)
- + (( DEFINED(HardFault_Handler) ? HardFault_Handler : M0_HardFault_Handler ) + 1)
- )
- );
-
- /* Provide basic symbols giving location and size of main text
- * block, including initial values of RW data sections. Note that
- * these will need extending to give a complete picture with
- * complex images (e.g multiple Flash banks).
- */
- _image_start = LOADADDR(.text);
- _image_end = LOADADDR(.data) + SIZEOF(.data);
- _image_size = _image_end - _image_start;
-} \ No newline at end of file
diff --git a/tinyusb/hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c b/tinyusb/hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c
deleted file mode 100755
index 11f1797a..00000000
--- a/tinyusb/hw/bsp/lpcxpresso11u37/lpcxpresso11u37.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "chip.h"
-#include "../board.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//---------------------------------------------------------------- ----+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-#define LED_PORT 1
-#define LED_PIN 24
-#define LED_STATE_ON 0
-
-// Wake up Switch
-#define BUTTON_PORT 0
-#define BUTTON_PIN 16
-#define BUTTON_STATE_ACTIVE 0
-
-/* System oscillator rate and RTC oscillator rate */
-const uint32_t OscRateIn = 12000000;
-const uint32_t ExtRateIn = 0;
-
-/* Pin muxing table, only items that need changing from their default pin
- state are in this table. Not every pin is mapped. */
-/* IOCON pin definitions for pin muxing */
-typedef struct {
- uint32_t port : 8; /* Pin port */
- uint32_t pin : 8; /* Pin number */
- uint32_t modefunc : 16; /* Function and mode */
-} PINMUX_GRP_T;
-
-static const PINMUX_GRP_T pinmuxing[] =
-{
- {0, 3, (IOCON_FUNC1 | IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, // USB VBUS
- {0, 6, (IOCON_FUNC1 | IOCON_MODE_INACT)}, /* PIO0_6 used for USB_CONNECT */
-
- {0, 18, (IOCON_FUNC1 | IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, // UART0 RX
- {0, 19, (IOCON_FUNC1 | IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, // UART0 TX
-};
-
-/* Setup system clocking */
-static void SystemSetupClocking(void)
-{
- volatile int i;
-
- /* Powerup main oscillator */
- Chip_SYSCTL_PowerUp(SYSCTL_POWERDOWN_SYSOSC_PD);
-
- /* Wait 200us for OSC to be stablized, no status
- indication, dummy wait. */
- for (i = 0; i < 0x100; i++) {}
-
- /* Set system PLL input to main oscillator */
- Chip_Clock_SetSystemPLLSource(SYSCTL_PLLCLKSRC_MAINOSC);
-
- /* Power down PLL to change the PLL divider ratio */
- Chip_SYSCTL_PowerDown(SYSCTL_POWERDOWN_SYSPLL_PD);
-
- /* Setup PLL for main oscillator rate (FCLKIN = 12MHz) * 4 = 48MHz
- MSEL = 3 (this is pre-decremented), PSEL = 1 (for P = 2)
- FCLKOUT = FCLKIN * (MSEL + 1) = 12MHz * 4 = 48MHz
- FCCO = FCLKOUT * 2 * P = 48MHz * 2 * 2 = 192MHz (within FCCO range) */
- Chip_Clock_SetupSystemPLL(3, 1);
-
- /* Powerup system PLL */
- Chip_SYSCTL_PowerUp(SYSCTL_POWERDOWN_SYSPLL_PD);
-
- /* Wait for PLL to lock */
- while (!Chip_Clock_IsSystemPLLLocked()) {}
-
- /* Set system clock divider to 1 */
- Chip_Clock_SetSysClockDiv(1);
-
- /* Setup FLASH access to 3 clocks */
- Chip_FMC_SetFLASHAccess(FLASHTIM_50MHZ_CPU);
-
- /* Set main clock source to the system PLL. This will drive 48MHz
- for the main clock and 48MHz for the system clock */
- Chip_Clock_SetMainClockSource(SYSCTL_MAINCLKSRC_PLLOUT);
-
- /* Set USB PLL input to main oscillator */
- Chip_Clock_SetUSBPLLSource(SYSCTL_PLLCLKSRC_MAINOSC);
- /* Setup USB PLL (FCLKIN = 12MHz) * 4 = 48MHz
- MSEL = 3 (this is pre-decremented), PSEL = 1 (for P = 2)
- FCLKOUT = FCLKIN * (MSEL + 1) = 12MHz * 4 = 48MHz
- FCCO = FCLKOUT * 2 * P = 48MHz * 2 * 2 = 192MHz (within FCCO range) */
- Chip_Clock_SetupUSBPLL(3, 1);
-
- /* Powerup USB PLL */
- Chip_SYSCTL_PowerUp(SYSCTL_POWERDOWN_USBPLL_PD);
-
- /* Wait for PLL to lock */
- while (!Chip_Clock_IsUSBPLLLocked()) {}
-}
-
-// Invoked by startup code
-void SystemInit(void)
-{
- SystemSetupClocking();
- Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_RAM1);
-
- /* Enable IOCON clock */
- Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_IOCON);
- for (uint32_t i = 0; i < (sizeof(pinmuxing) / sizeof(PINMUX_GRP_T)); i++)
- {
- Chip_IOCON_PinMuxSet(LPC_IOCON, pinmuxing[i].port, pinmuxing[i].pin, pinmuxing[i].modefunc);
- }
-}
-
-void board_init(void)
-{
- SystemCoreClockUpdate();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- Chip_GPIO_Init(LPC_GPIO);
-
- // LED
- Chip_GPIO_SetPinDIROutput(LPC_GPIO, LED_PORT, LED_PIN);
-
- // Button
- Chip_GPIO_SetPinDIRInput(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
-
- // USB: Setup PLL clock, and power
- /* enable USB main clock */
- Chip_Clock_SetUSBClockSource(SYSCTL_USBCLKSRC_PLLOUT, 1);
- /* Enable AHB clock to the USB block and USB RAM. */
- Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_USB);
- Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_USBRAM);
- /* power UP USB Phy */
- Chip_SYSCTL_PowerUp(SYSCTL_POWERDOWN_USBPAD_PD);
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- Chip_GPIO_SetPinState(LPC_GPIO, LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == Chip_GPIO_GetPinState(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/lpcxpresso11u68/board.mk b/tinyusb/hw/bsp/lpcxpresso11u68/board.mk
deleted file mode 100755
index 922414f8..00000000
--- a/tinyusb/hw/bsp/lpcxpresso11u68/board.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nxp/lpcopen
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m0plus \
- -nostdlib \
- -DCORE_M0PLUS \
- -D__VTOR_PRESENT=0 \
- -D__USE_LPCOPEN \
- -DCFG_TUSB_MCU=OPT_MCU_LPC11UXX \
- -DCFG_TUSB_MEM_SECTION='__attribute__((section(".data.$$RAM3")))' \
- -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
-
-MCU_DIR = hw/mcu/nxp/lpcopen/lpc11u6x/lpc_chip_11u6x
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/lpc11u68.ld
-
-SRC_C += \
- src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
- $(MCU_DIR)/../gcc/cr_startup_lpc11u6x.c \
- $(MCU_DIR)/src/chip_11u6x.c \
- $(MCU_DIR)/src/clock_11u6x.c \
- $(MCU_DIR)/src/gpio_11u6x.c \
- $(MCU_DIR)/src/iocon_11u6x.c \
- $(MCU_DIR)/src/syscon_11u6x.c \
- $(MCU_DIR)/src/sysinit_11u6x.c
-
-INC += \
- $(TOP)/$(MCU_DIR)/inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
-
-# For flash-jlink target
-JLINK_DEVICE = LPC11U68
-
-# flash using pyocd
-flash: $(BUILD)/$(PROJECT).hex
- pyocd flash -t lpc11u68 $<
diff --git a/tinyusb/hw/bsp/lpcxpresso11u68/lpc11u68.ld b/tinyusb/hw/bsp/lpcxpresso11u68/lpc11u68.ld
deleted file mode 100755
index 56d9e4b8..00000000
--- a/tinyusb/hw/bsp/lpcxpresso11u68/lpc11u68.ld
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * GENERATED FILE - DO NOT EDIT
- * (c) Code Red Technologies Ltd, 2008-2013
- * (c) NXP Semiconductors 2013-2019
- * Generated linker script file for LPC11U68
- * Created from linkscript.ldt by FMCreateLinkLibraries
- * Using Freemarker v2.3.23
- * MCUXpresso IDE v10.2.1 [Build 795] [2018-07-25] on May 14, 2019 4:55:54 PM
- */
-
-MEMORY
-{
- /* Define each memory region */
- MFlash256 (rx) : ORIGIN = 0x0, LENGTH = 0x40000 /* 256K bytes (alias Flash) */
- Ram0_32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */
- Ram1_2 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x800 /* 2K bytes (alias RAM2) */
- Ram2USB_2 (rwx) : ORIGIN = 0x20004000, LENGTH = 0x800 /* 2K bytes (alias RAM3) */
-}
-
- /* Define a symbol for the top of each memory region */
- __base_MFlash256 = 0x0 ; /* MFlash256 */
- __base_Flash = 0x0 ; /* Flash */
- __top_MFlash256 = 0x0 + 0x40000 ; /* 256K bytes */
- __top_Flash = 0x0 + 0x40000 ; /* 256K bytes */
- __base_Ram0_32 = 0x10000000 ; /* Ram0_32 */
- __base_RAM = 0x10000000 ; /* RAM */
- __top_Ram0_32 = 0x10000000 + 0x8000 ; /* 32K bytes */
- __top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */
- __base_Ram1_2 = 0x20000000 ; /* Ram1_2 */
- __base_RAM2 = 0x20000000 ; /* RAM2 */
- __top_Ram1_2 = 0x20000000 + 0x800 ; /* 2K bytes */
- __top_RAM2 = 0x20000000 + 0x800 ; /* 2K bytes */
- __base_Ram2USB_2 = 0x20004000 ; /* Ram2USB_2 */
- __base_RAM3 = 0x20004000 ; /* RAM3 */
- __top_Ram2USB_2 = 0x20004000 + 0x800 ; /* 2K bytes */
- __top_RAM3 = 0x20004000 + 0x800 ; /* 2K bytes */
-
-ENTRY(ResetISR)
-
-SECTIONS
-{
- /* MAIN TEXT SECTION */
- .text : ALIGN(4)
- {
- FILL(0xff)
- __vectors_start__ = ABSOLUTE(.) ;
- KEEP(*(.isr_vector))
- /* Global Section Table */
- . = ALIGN(4) ;
- __section_table_start = .;
- __data_section_table = .;
- LONG(LOADADDR(.data));
- LONG( ADDR(.data));
- LONG( SIZEOF(.data));
- LONG(LOADADDR(.data_RAM2));
- LONG( ADDR(.data_RAM2));
- LONG( SIZEOF(.data_RAM2));
- LONG(LOADADDR(.data_RAM3));
- LONG( ADDR(.data_RAM3));
- LONG( SIZEOF(.data_RAM3));
- __data_section_table_end = .;
- __bss_section_table = .;
- LONG( ADDR(.bss));
- LONG( SIZEOF(.bss));
- LONG( ADDR(.bss_RAM2));
- LONG( SIZEOF(.bss_RAM2));
- LONG( ADDR(.bss_RAM3));
- LONG( SIZEOF(.bss_RAM3));
- __bss_section_table_end = .;
- __section_table_end = . ;
- /* End of Global Section Table */
-
- *(.after_vectors*)
-
- } > MFlash256
-
- .text : ALIGN(4)
- {
- *(.text*)
- *(.rodata .rodata.* .constdata .constdata.*)
- . = ALIGN(4);
- } > MFlash256
- /*
- * for exception handling/unwind - some Newlib functions (in common
- * with C++ and STDC++) use this.
- */
- .ARM.extab : ALIGN(4)
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > MFlash256
-
- __exidx_start = .;
-
- .ARM.exidx : ALIGN(4)
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > MFlash256
- __exidx_end = .;
-
- _etext = .;
-
- /* possible MTB section for Ram1_2 */
- .mtb_buffer_RAM2 (NOLOAD) :
- {
- KEEP(*(.mtb.$RAM2*))
- KEEP(*(.mtb.$Ram1_2*))
- } > Ram1_2
-
- /* DATA section for Ram1_2 */
-
- .data_RAM2 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM2 = .) ;
- *(.ramfunc.$RAM2)
- *(.ramfunc.$Ram1_2)
- *(.data.$RAM2*)
- *(.data.$Ram1_2*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM2 = .) ;
- } > Ram1_2 AT>MFlash256
- /* possible MTB section for Ram2USB_2 */
- .mtb_buffer_RAM3 (NOLOAD) :
- {
- KEEP(*(.mtb.$RAM3*))
- KEEP(*(.mtb.$Ram2USB_2*))
- } > Ram2USB_2
-
- /* DATA section for Ram2USB_2 */
-
- .data_RAM3 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM3 = .) ;
- *(.ramfunc.$RAM3)
- *(.ramfunc.$Ram2USB_2)
- *(.data.$RAM3*)
- *(.data.$Ram2USB_2*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM3 = .) ;
- } > Ram2USB_2 AT>MFlash256
- /* MAIN DATA SECTION */
- /* Default MTB section */
- .mtb_buffer_default (NOLOAD) :
- {
- KEEP(*(.mtb*))
- } > Ram0_32
- .uninit_RESERVED : ALIGN(4)
- {
- KEEP(*(.bss.$RESERVED*))
- . = ALIGN(4) ;
- _end_uninit_RESERVED = .;
- } > Ram0_32
-
- /* Main DATA section (Ram0_32) */
- .data : ALIGN(4)
- {
- FILL(0xff)
- _data = . ;
- *(vtable)
- *(.ramfunc*)
- *(.data*)
- . = ALIGN(4) ;
- _edata = . ;
- } > Ram0_32 AT>MFlash256
-
- /* BSS section for Ram1_2 */
- .bss_RAM2 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM2 = .) ;
- *(.bss.$RAM2*)
- *(.bss.$Ram1_2*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM2 = .) ;
- } > Ram1_2
-
- /* BSS section for Ram2USB_2 */
- .bss_RAM3 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM3 = .) ;
- *(.bss.$RAM3*)
- *(.bss.$Ram2USB_2*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM3 = .) ;
- } > Ram2USB_2
-
- /* MAIN BSS SECTION */
- .bss : ALIGN(4)
- {
- _bss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4) ;
- _ebss = .;
- PROVIDE(end = .);
- } > Ram0_32
-
- /* NOINIT section for Ram1_2 */
- .noinit_RAM2 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM2*)
- *(.noinit.$Ram1_2*)
- . = ALIGN(4) ;
- } > Ram1_2
-
- /* NOINIT section for Ram2USB_2 */
- .noinit_RAM3 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM3*)
- *(.noinit.$Ram2USB_2*)
- . = ALIGN(4) ;
- } > Ram2USB_2
-
- /* DEFAULT NOINIT SECTION */
- .noinit (NOLOAD): ALIGN(4)
- {
- _noinit = .;
- *(.noinit*)
- . = ALIGN(4) ;
- _end_noinit = .;
- } > Ram0_32
- PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
- PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_Ram0_32 - 0);
-
- /* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (( DEFINED(NMI_Handler) ? NMI_Handler : M0_NMI_Handler ) + 1)
- + (( DEFINED(HardFault_Handler) ? HardFault_Handler : M0_HardFault_Handler ) + 1)
- )
- );
-
- /* Provide basic symbols giving location and size of main text
- * block, including initial values of RW data sections. Note that
- * these will need extending to give a complete picture with
- * complex images (e.g multiple Flash banks).
- */
- _image_start = LOADADDR(.text);
- _image_end = LOADADDR(.data) + SIZEOF(.data);
- _image_size = _image_end - _image_start;
-} \ No newline at end of file
diff --git a/tinyusb/hw/bsp/lpcxpresso11u68/lpcxpresso11u68.c b/tinyusb/hw/bsp/lpcxpresso11u68/lpcxpresso11u68.c
deleted file mode 100755
index e33a5c6e..00000000
--- a/tinyusb/hw/bsp/lpcxpresso11u68/lpcxpresso11u68.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "chip.h"
-#include "../board.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-#define LED_PORT 2
-#define LED_PIN 17
-#define LED_STATE_ON 0
-
-// Wake up Switch
-#define BUTTON_PORT 0
-#define BUTTON_PIN 16
-#define BUTTON_STATE_ACTIVE 0
-
-/* System oscillator rate and RTC oscillator rate */
-const uint32_t OscRateIn = 12000000;
-const uint32_t RTCOscRateIn = 32768;
-
-/* Pin muxing table, only items that need changing from their default pin
- state are in this table. Not every pin is mapped. */
-static const PINMUX_GRP_T pinmuxing[] =
-{
- {0, 3, (IOCON_FUNC1 | IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, // USB VBUS
- {0, 18, (IOCON_FUNC1 | IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, // UART0 RX
- {0, 19, (IOCON_FUNC1 | IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, // UART0 TX
- {2, 0, (IOCON_FUNC1 | IOCON_MODE_INACT)}, // XTALIN
- {2, 1, (IOCON_FUNC1 | IOCON_MODE_INACT)}, // XTALOUT
-};
-
-// Invoked by startup code
-void SystemInit(void)
-{
- /* Enable IOCON clock */
- Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_IOCON);
- Chip_IOCON_SetPinMuxing(LPC_IOCON, pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
- Chip_SetupXtalClocking();
-}
-
-void board_init(void)
-{
- SystemCoreClockUpdate();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- Chip_GPIO_Init(LPC_GPIO);
-
- // LED
- Chip_GPIO_SetPinDIROutput(LPC_GPIO, LED_PORT, LED_PIN);
-
- // Button
- Chip_GPIO_SetPinDIRInput(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
-
- // USB: Setup PLL clock, and power
- Chip_USB_Init();
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- Chip_GPIO_SetPinState(LPC_GPIO, LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == Chip_GPIO_GetPinState(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/lpcxpresso1347/board.mk b/tinyusb/hw/bsp/lpcxpresso1347/board.mk
deleted file mode 100755
index 0d56a33a..00000000
--- a/tinyusb/hw/bsp/lpcxpresso1347/board.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nxp/lpcopen
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m3 \
- -nostdlib \
- -DCORE_M3 \
- -D__USE_LPCOPEN \
- -DCFG_EXAMPLE_MSC_READONLY \
- -DCFG_TUSB_MCU=OPT_MCU_LPC13XX \
- -DCFG_TUSB_MEM_SECTION='__attribute__((section(".data.$$RAM2")))' \
- -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
-
-# startup.c and lpc_types.h cause following errors
-CFLAGS += -Wno-error=strict-prototypes
-
-MCU_DIR = hw/mcu/nxp/lpcopen/lpc13xx/lpc_chip_13xx
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/lpc1347.ld
-
-SRC_C += \
- src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
- $(MCU_DIR)/../gcc/cr_startup_lpc13xx.c \
- $(MCU_DIR)/src/chip_13xx.c \
- $(MCU_DIR)/src/clock_13xx.c \
- $(MCU_DIR)/src/gpio_13xx_1.c \
- $(MCU_DIR)/src/iocon_13xx.c \
- $(MCU_DIR)/src/sysctl_13xx.c \
- $(MCU_DIR)/src/sysinit_13xx.c
-
-INC += \
- $(TOP)/$(MCU_DIR)/inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM3
-
-# For flash-jlink target
-JLINK_DEVICE = LPC1347
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/lpcxpresso1347/lpc1347.ld b/tinyusb/hw/bsp/lpcxpresso1347/lpc1347.ld
deleted file mode 100755
index 42a4bb25..00000000
--- a/tinyusb/hw/bsp/lpcxpresso1347/lpc1347.ld
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * GENERATED FILE - DO NOT EDIT
- * (c) Code Red Technologies Ltd, 2008-2013
- * (c) NXP Semiconductors 2013-2019
- * Generated linker script file for LPC1347
- * Created from linkscript.ldt by FMCreateLinkLibraries
- * Using Freemarker v2.3.23
- * MCUXpresso IDE v10.2.1 [Build 795] [2018-07-25] on May 14, 2019 6:01:58 PM
- */
-
-MEMORY
-{
- /* Define each memory region */
- MFlash64 (rx) : ORIGIN = 0x0, LENGTH = 0x10000 /* 64K bytes (alias Flash) */
- RamLoc8 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x2000 /* 8K bytes (alias RAM) */
- RamUsb2 (rwx) : ORIGIN = 0x20004000, LENGTH = 0x800 /* 2K bytes (alias RAM2) */
- RamPeriph2 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x800 /* 2K bytes (alias RAM3) */
-}
-
- /* Define a symbol for the top of each memory region */
- __base_MFlash64 = 0x0 ; /* MFlash64 */
- __base_Flash = 0x0 ; /* Flash */
- __top_MFlash64 = 0x0 + 0x10000 ; /* 64K bytes */
- __top_Flash = 0x0 + 0x10000 ; /* 64K bytes */
- __base_RamLoc8 = 0x10000000 ; /* RamLoc8 */
- __base_RAM = 0x10000000 ; /* RAM */
- __top_RamLoc8 = 0x10000000 + 0x2000 ; /* 8K bytes */
- __top_RAM = 0x10000000 + 0x2000 ; /* 8K bytes */
- __base_RamUsb2 = 0x20004000 ; /* RamUsb2 */
- __base_RAM2 = 0x20004000 ; /* RAM2 */
- __top_RamUsb2 = 0x20004000 + 0x800 ; /* 2K bytes */
- __top_RAM2 = 0x20004000 + 0x800 ; /* 2K bytes */
- __base_RamPeriph2 = 0x20000000 ; /* RamPeriph2 */
- __base_RAM3 = 0x20000000 ; /* RAM3 */
- __top_RamPeriph2 = 0x20000000 + 0x800 ; /* 2K bytes */
- __top_RAM3 = 0x20000000 + 0x800 ; /* 2K bytes */
-
-ENTRY(ResetISR)
-
-SECTIONS
-{
- /* MAIN TEXT SECTION */
- .text : ALIGN(4)
- {
- FILL(0xff)
- __vectors_start__ = ABSOLUTE(.) ;
- KEEP(*(.isr_vector))
- /* Global Section Table */
- . = ALIGN(4) ;
- __section_table_start = .;
- __data_section_table = .;
- LONG(LOADADDR(.data));
- LONG( ADDR(.data));
- LONG( SIZEOF(.data));
- LONG(LOADADDR(.data_RAM2));
- LONG( ADDR(.data_RAM2));
- LONG( SIZEOF(.data_RAM2));
- LONG(LOADADDR(.data_RAM3));
- LONG( ADDR(.data_RAM3));
- LONG( SIZEOF(.data_RAM3));
- __data_section_table_end = .;
- __bss_section_table = .;
- LONG( ADDR(.bss));
- LONG( SIZEOF(.bss));
- LONG( ADDR(.bss_RAM2));
- LONG( SIZEOF(.bss_RAM2));
- LONG( ADDR(.bss_RAM3));
- LONG( SIZEOF(.bss_RAM3));
- __bss_section_table_end = .;
- __section_table_end = . ;
- /* End of Global Section Table */
-
- *(.after_vectors*)
-
- } > MFlash64
-
- .text : ALIGN(4)
- {
- *(.text*)
- *(.rodata .rodata.* .constdata .constdata.*)
- . = ALIGN(4);
- } > MFlash64
- /*
- * for exception handling/unwind - some Newlib functions (in common
- * with C++ and STDC++) use this.
- */
- .ARM.extab : ALIGN(4)
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > MFlash64
-
- __exidx_start = .;
-
- .ARM.exidx : ALIGN(4)
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > MFlash64
- __exidx_end = .;
-
- _etext = .;
-
- /* DATA section for RamUsb2 */
-
- .data_RAM2 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM2 = .) ;
- *(.ramfunc.$RAM2)
- *(.ramfunc.$RamUsb2)
- *(.data.$RAM2*)
- *(.data.$RamUsb2*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM2 = .) ;
- } > RamUsb2 AT>MFlash64
- /* DATA section for RamPeriph2 */
-
- .data_RAM3 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM3 = .) ;
- *(.ramfunc.$RAM3)
- *(.ramfunc.$RamPeriph2)
- *(.data.$RAM3*)
- *(.data.$RamPeriph2*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM3 = .) ;
- } > RamPeriph2 AT>MFlash64
- /* MAIN DATA SECTION */
- .uninit_RESERVED : ALIGN(4)
- {
- KEEP(*(.bss.$RESERVED*))
- . = ALIGN(4) ;
- _end_uninit_RESERVED = .;
- } > RamLoc8
-
- /* Main DATA section (RamLoc8) */
- .data : ALIGN(4)
- {
- FILL(0xff)
- _data = . ;
- *(vtable)
- *(.ramfunc*)
- *(.data*)
- . = ALIGN(4) ;
- _edata = . ;
- } > RamLoc8 AT>MFlash64
-
- /* BSS section for RamUsb2 */
- .bss_RAM2 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM2 = .) ;
- *(.bss.$RAM2*)
- *(.bss.$RamUsb2*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM2 = .) ;
- } > RamUsb2
-
- /* BSS section for RamPeriph2 */
- .bss_RAM3 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM3 = .) ;
- *(.bss.$RAM3*)
- *(.bss.$RamPeriph2*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM3 = .) ;
- } > RamPeriph2
-
- /* MAIN BSS SECTION */
- .bss : ALIGN(4)
- {
- _bss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4) ;
- _ebss = .;
- PROVIDE(end = .);
- } > RamLoc8
-
- /* NOINIT section for RamUsb2 */
- .noinit_RAM2 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM2*)
- *(.noinit.$RamUsb2*)
- . = ALIGN(4) ;
- } > RamUsb2
-
- /* NOINIT section for RamPeriph2 */
- .noinit_RAM3 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM3*)
- *(.noinit.$RamPeriph2*)
- . = ALIGN(4) ;
- } > RamPeriph2
-
- /* DEFAULT NOINIT SECTION */
- .noinit (NOLOAD): ALIGN(4)
- {
- _noinit = .;
- *(.noinit*)
- . = ALIGN(4) ;
- _end_noinit = .;
- } > RamLoc8
- PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
- PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc8 - 0);
-
- /* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (NMI_Handler + 1)
- + (HardFault_Handler + 1)
- + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
- + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
- + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
- ) );
-
- /* Provide basic symbols giving location and size of main text
- * block, including initial values of RW data sections. Note that
- * these will need extending to give a complete picture with
- * complex images (e.g multiple Flash banks).
- */
- _image_start = LOADADDR(.text);
- _image_end = LOADADDR(.data) + SIZEOF(.data);
- _image_size = _image_end - _image_start;
-} \ No newline at end of file
diff --git a/tinyusb/hw/bsp/lpcxpresso1347/lpcxpresso1347.c b/tinyusb/hw/bsp/lpcxpresso1347/lpcxpresso1347.c
deleted file mode 100755
index a9a67ae3..00000000
--- a/tinyusb/hw/bsp/lpcxpresso1347/lpcxpresso1347.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "chip.h"
-#include "../board.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-#define LED_PORT 0
-#define LED_PIN 7
-
-// Joytick Down if connected to LPCXpresso Base board
-#define BUTTON_PORT 1
-#define BUTTON_PIN 20
-
-//static const struct {
-// uint8_t port;
-// uint8_t pin;
-//} buttons[] =
-//{
-// {1, 22 }, // Joystick up
-// {1, 20 }, // Joystick down
-// {1, 23 }, // Joystick left
-// {1, 21 }, // Joystick right
-// {1, 19 }, // Joystick press
-// {0, 1 }, // SW3
-//};
-
-/* System oscillator rate and RTC oscillator rate */
-const uint32_t OscRateIn = 12000000;
-const uint32_t ExtRateIn = 0;
-
-/* Pin muxing table, only items that need changing from their default pin
- state are in this table. */
-static const PINMUX_GRP_T pinmuxing[] =
-{
- {0, 1, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7 | IOCON_MODE_INACT)}, /* PIO0_1 used for CLKOUT */
- {0, 2, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7 | IOCON_MODE_PULLUP)}, /* PIO0_2 used for SSEL */
- {0, 3, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7 | IOCON_MODE_INACT)}, /* PIO0_3 used for USB_VBUS */
- {0, 6, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7 | IOCON_MODE_INACT)}, /* PIO0_6 used for USB_CONNECT */
- {0, 8, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7 | IOCON_MODE_INACT)}, /* PIO0_8 used for MISO0 */
- {0, 9, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7 | IOCON_MODE_INACT)}, /* PIO0_9 used for MOSI0 */
- {0, 11, (IOCON_FUNC2 | IOCON_ADMODE_EN | IOCON_FILT_DIS)}, /* PIO0_11 used for AD0 */
- {0, 18, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7 | IOCON_MODE_INACT)}, /* PIO0_18 used for RXD */
- {0, 19, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7 | IOCON_MODE_INACT)}, /* PIO0_19 used for TXD */
- {1, 29, (IOCON_FUNC1 | IOCON_RESERVED_BIT_7 | IOCON_MODE_INACT)}, /* PIO1_29 used for SCK0 */
-};
-
-// Invoked by startup code
-void SystemInit(void)
-{
- /* Enable IOCON clock */
- Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_IOCON);
- Chip_IOCON_SetPinMuxing(LPC_IOCON, pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
- Chip_SetupXtalClocking();
-}
-
-void board_init(void)
-{
- SystemCoreClockUpdate();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- Chip_GPIO_Init(LPC_GPIO_PORT);
-
- // LED
- Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, LED_PORT, LED_PIN);
-
- // Button
- Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN);
-
- // USB: Setup PLL clock, and power
- Chip_USB_Init();
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-void board_led_write(bool state)
-{
- Chip_GPIO_SetPinState(LPC_GPIO_PORT, LED_PORT, LED_PIN, state);
-}
-
-uint32_t board_button_read(void)
-{
- // active low
- return Chip_GPIO_GetPinState(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN) ? 0 : 1;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
diff --git a/tinyusb/hw/bsp/lpcxpresso1769/board.mk b/tinyusb/hw/bsp/lpcxpresso1769/board.mk
deleted file mode 100755
index b69be39b..00000000
--- a/tinyusb/hw/bsp/lpcxpresso1769/board.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nxp/lpcopen
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m3 \
- -nostdlib \
- -DCORE_M3 \
- -D__USE_LPCOPEN \
- -DCFG_TUSB_MCU=OPT_MCU_LPC175X_6X \
- -DRTC_EV_SUPPORT=0
-
-# lpc_types.h cause following errors
-CFLAGS += -Wno-error=strict-prototypes
-
-MCU_DIR = hw/mcu/nxp/lpcopen/lpc175x_6x/lpc_chip_175x_6x
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/lpc1769.ld
-
-SRC_C += \
- src/portable/nxp/lpc17_40/dcd_lpc17_40.c \
- $(MCU_DIR)/../gcc/cr_startup_lpc175x_6x.c \
- $(MCU_DIR)/src/chip_17xx_40xx.c \
- $(MCU_DIR)/src/clock_17xx_40xx.c \
- $(MCU_DIR)/src/gpio_17xx_40xx.c \
- $(MCU_DIR)/src/iocon_17xx_40xx.c \
- $(MCU_DIR)/src/sysctl_17xx_40xx.c \
- $(MCU_DIR)/src/sysinit_17xx_40xx.c \
- $(MCU_DIR)/src/uart_17xx_40xx.c
-
-INC += \
- $(TOP)/$(MCU_DIR)/inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM3
-
-# For flash-jlink target
-JLINK_DEVICE = LPC1769
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/lpcxpresso1769/lpc1769.ld b/tinyusb/hw/bsp/lpcxpresso1769/lpc1769.ld
deleted file mode 100755
index d1c83d8e..00000000
--- a/tinyusb/hw/bsp/lpcxpresso1769/lpc1769.ld
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * GENERATED FILE - DO NOT EDIT
- * (c) Code Red Technologies Ltd, 2008-2013
- * (c) NXP Semiconductors 2013-2019
- * Generated linker script file for LPC1769
- * Created from linkscript.ldt by FMCreateLinkLibraries
- * Using Freemarker v2.3.23
- * MCUXpresso IDE v10.2.1 [Build 795] [2018-07-25] on May 14, 2019 6:39:29 PM
- */
-
-MEMORY
-{
- /* Define each memory region */
- MFlash512 (rx) : ORIGIN = 0x0, LENGTH = 0x80000 /* 512K bytes (alias Flash) */
- RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */
- RamAHB32 (rwx) : ORIGIN = 0x2007c000, LENGTH = 0x8000 /* 32K bytes (alias RAM2) */
-}
-
- /* Define a symbol for the top of each memory region */
- __base_MFlash512 = 0x0 ; /* MFlash512 */
- __base_Flash = 0x0 ; /* Flash */
- __top_MFlash512 = 0x0 + 0x80000 ; /* 512K bytes */
- __top_Flash = 0x0 + 0x80000 ; /* 512K bytes */
- __base_RamLoc32 = 0x10000000 ; /* RamLoc32 */
- __base_RAM = 0x10000000 ; /* RAM */
- __top_RamLoc32 = 0x10000000 + 0x8000 ; /* 32K bytes */
- __top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */
- __base_RamAHB32 = 0x2007c000 ; /* RamAHB32 */
- __base_RAM2 = 0x2007c000 ; /* RAM2 */
- __top_RamAHB32 = 0x2007c000 + 0x8000 ; /* 32K bytes */
- __top_RAM2 = 0x2007c000 + 0x8000 ; /* 32K bytes */
-
-ENTRY(ResetISR)
-
-SECTIONS
-{
- /* MAIN TEXT SECTION */
- .text : ALIGN(4)
- {
- FILL(0xff)
- __vectors_start__ = ABSOLUTE(.) ;
- KEEP(*(.isr_vector))
- /* Global Section Table */
- . = ALIGN(4) ;
- __section_table_start = .;
- __data_section_table = .;
- LONG(LOADADDR(.data));
- LONG( ADDR(.data));
- LONG( SIZEOF(.data));
- LONG(LOADADDR(.data_RAM2));
- LONG( ADDR(.data_RAM2));
- LONG( SIZEOF(.data_RAM2));
- __data_section_table_end = .;
- __bss_section_table = .;
- LONG( ADDR(.bss));
- LONG( SIZEOF(.bss));
- LONG( ADDR(.bss_RAM2));
- LONG( SIZEOF(.bss_RAM2));
- __bss_section_table_end = .;
- __section_table_end = . ;
- /* End of Global Section Table */
-
- *(.after_vectors*)
-
- } > MFlash512
-
- .text : ALIGN(4)
- {
- *(.text*)
- *(.rodata .rodata.* .constdata .constdata.*)
- . = ALIGN(4);
- } > MFlash512
- /*
- * for exception handling/unwind - some Newlib functions (in common
- * with C++ and STDC++) use this.
- */
- .ARM.extab : ALIGN(4)
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > MFlash512
-
- __exidx_start = .;
-
- .ARM.exidx : ALIGN(4)
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > MFlash512
- __exidx_end = .;
-
- _etext = .;
-
- /* DATA section for RamAHB32 */
-
- .data_RAM2 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM2 = .) ;
- *(.ramfunc.$RAM2)
- *(.ramfunc.$RamAHB32)
- *(.data.$RAM2*)
- *(.data.$RamAHB32*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM2 = .) ;
- } > RamAHB32 AT>MFlash512
- /* MAIN DATA SECTION */
- .uninit_RESERVED : ALIGN(4)
- {
- KEEP(*(.bss.$RESERVED*))
- . = ALIGN(4) ;
- _end_uninit_RESERVED = .;
- } > RamLoc32
-
- /* Main DATA section (RamLoc32) */
- .data : ALIGN(4)
- {
- FILL(0xff)
- _data = . ;
- *(vtable)
- *(.ramfunc*)
- *(.data*)
- . = ALIGN(4) ;
- _edata = . ;
- } > RamLoc32 AT>MFlash512
-
- /* BSS section for RamAHB32 */
- .bss_RAM2 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM2 = .) ;
- *(.bss.$RAM2*)
- *(.bss.$RamAHB32*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM2 = .) ;
- } > RamAHB32
-
- /* MAIN BSS SECTION */
- .bss : ALIGN(4)
- {
- _bss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4) ;
- _ebss = .;
- PROVIDE(end = .);
- } > RamLoc32
-
- /* NOINIT section for RamAHB32 */
- .noinit_RAM2 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM2*)
- *(.noinit.$RamAHB32*)
- . = ALIGN(4) ;
- } > RamAHB32
-
- /* DEFAULT NOINIT SECTION */
- .noinit (NOLOAD): ALIGN(4)
- {
- _noinit = .;
- *(.noinit*)
- . = ALIGN(4) ;
- _end_noinit = .;
- } > RamLoc32
- PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
- PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc32 - 0);
-
- /* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (NMI_Handler + 1)
- + (HardFault_Handler + 1)
- + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
- + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
- + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
- ) );
-
- /* Provide basic symbols giving location and size of main text
- * block, including initial values of RW data sections. Note that
- * these will need extending to give a complete picture with
- * complex images (e.g multiple Flash banks).
- */
- _image_start = LOADADDR(.text);
- _image_end = LOADADDR(.data) + SIZEOF(.data);
- _image_size = _image_end - _image_start;
-} \ No newline at end of file
diff --git a/tinyusb/hw/bsp/lpcxpresso1769/lpcxpresso1769.c b/tinyusb/hw/bsp/lpcxpresso1769/lpcxpresso1769.c
deleted file mode 100755
index 101cc8a4..00000000
--- a/tinyusb/hw/bsp/lpcxpresso1769/lpcxpresso1769.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "chip.h"
-#include "../board.h"
-
-//--------------------------------------------------------------------+
-// USB Interrupt Handler
-//--------------------------------------------------------------------+
-void USB_IRQHandler(void)
-{
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
- tuh_int_handler(0);
- #endif
-
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
- tud_int_handler(0);
- #endif
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-#define LED_PORT 0
-#define LED_PIN 22
-#define LED_STATE_ON 1
-
-// JOYSTICK_DOWN if using LPCXpresso Base Board
-#define BUTTON_PORT 0
-#define BUTTON_PIN 15
-#define BUTTON_STATE_ACTIVE 0
-
-#define BOARD_UART_PORT LPC_UART3
-
-/* System oscillator rate and RTC oscillator rate */
-const uint32_t OscRateIn = 12000000;
-const uint32_t RTCOscRateIn = 32768;
-
-/* Pin muxing configuration */
-static const PINMUX_GRP_T pinmuxing[] =
-{
- {0, 0, IOCON_MODE_INACT | IOCON_FUNC2}, /* TXD3 */
- {0, 1, IOCON_MODE_INACT | IOCON_FUNC2}, /* RXD3 */
- {LED_PORT, LED_PIN, IOCON_MODE_INACT | IOCON_FUNC0}, /* Led 0 */
-
- /* Joystick buttons. */
-// {2, 3, IOCON_MODE_INACT | IOCON_FUNC0}, /* JOYSTICK_UP */
- {BUTTON_PORT, BUTTON_PIN, IOCON_FUNC0 | IOCON_MODE_PULLUP}, /* JOYSTICK_DOWN */
-// {2, 4, IOCON_MODE_INACT | IOCON_FUNC0}, /* JOYSTICK_LEFT */
-// {0, 16, IOCON_MODE_INACT | IOCON_FUNC0}, /* JOYSTICK_RIGHT */
-// {0, 17, IOCON_MODE_INACT | IOCON_FUNC0}, /* JOYSTICK_PRESS */
-};
-
-static const PINMUX_GRP_T pin_usb_mux[] =
-{
- {0, 29, IOCON_MODE_INACT | IOCON_FUNC1}, // D+
- {0, 30, IOCON_MODE_INACT | IOCON_FUNC1}, // D-
- {2, 9, IOCON_MODE_INACT | IOCON_FUNC1}, // Soft Connect
-
- {1, 19, IOCON_MODE_INACT | IOCON_FUNC2}, // USB_PPWR (Host mode)
-
- // VBUS is not connected on this board, so leave the pin at default setting.
- /// Chip_IOCON_PinMux(LPC_IOCON, 1, 30, IOCON_MODE_INACT, IOCON_FUNC2); // USB VBUS
-};
-
-// Invoked by startup code
-void SystemInit(void)
-{
-#ifdef __USE_LPCOPEN
- extern void (* const g_pfnVectors[])(void);
- unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
- *pSCB_VTOR = (unsigned int) g_pfnVectors;
-#endif
-
- Chip_IOCON_Init(LPC_IOCON);
- Chip_IOCON_SetPinMuxing(LPC_IOCON, pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
- Chip_SetupXtalClocking();
-
- Chip_SYSCTL_SetFLASHAccess(FLASHTIM_100MHZ_CPU);
-}
-
-void board_init(void)
-{
- SystemCoreClockUpdate();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- Chip_GPIO_Init(LPC_GPIO);
-
- // LED
- Chip_GPIO_SetPinDIROutput(LPC_GPIO, LED_PORT, LED_PIN);
-
- // Button
- Chip_GPIO_SetPinDIRInput(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
-
-#if 0
- //------------- UART -------------//
- PINSEL_CFG_Type PinCfg =
- {
- .Portnum = 0,
- .Pinnum = 0, // TXD is P0.0
- .Funcnum = 2,
- .OpenDrain = 0,
- .Pinmode = 0
- };
- PINSEL_ConfigPin(&PinCfg);
-
- PinCfg.Portnum = 0;
- PinCfg.Pinnum = 1; // RXD is P0.1
- PINSEL_ConfigPin(&PinCfg);
-
- UART_CFG_Type UARTConfigStruct;
- UART_ConfigStructInit(&UARTConfigStruct);
- UARTConfigStruct.Baud_rate = CFG_BOARD_UART_BAUDRATE;
-
- UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
- UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
-#endif
-
- //------------- USB -------------//
- Chip_IOCON_SetPinMuxing(LPC_IOCON, pin_usb_mux, sizeof(pin_usb_mux) / sizeof(PINMUX_GRP_T));
- Chip_USB_Init();
-
- enum {
- USBCLK_DEVCIE = 0x12, // AHB + Device
- USBCLK_HOST = 0x19, // AHB + Host + OTG
-// 0x1B // Host + Device + OTG + AHB
- };
-
- uint32_t const clk_en = TUSB_OPT_DEVICE_ENABLED ? USBCLK_DEVCIE : USBCLK_HOST;
-
- LPC_USB->OTGClkCtrl = clk_en;
- while ( (LPC_USB->OTGClkSt & clk_en) != clk_en );
-
-#if TUSB_OPT_HOST_ENABLED
- // set portfunc to host !!!
- LPC_USB->StCtrl = 0x3; // should be 1
-#endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- Chip_GPIO_SetPinState(LPC_GPIO, LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == Chip_GPIO_GetPinState(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
-// return UART_ReceiveByte(BOARD_UART_PORT);
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
-// UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/lpcxpresso51u68/board.mk b/tinyusb/hw/bsp/lpcxpresso51u68/board.mk
deleted file mode 100755
index 98bef675..00000000
--- a/tinyusb/hw/bsp/lpcxpresso51u68/board.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-SDK_DIR = hw/mcu/nxp/mcux-sdk
-DEPS_SUBMODULES += $(SDK_DIR)
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m0plus \
- -DCPU_LPC51U68JBD64 \
- -DCFG_TUSB_MCU=OPT_MCU_LPC51UXX \
- -DCFG_TUSB_MEM_SECTION='__attribute__((section(".data")))' \
- -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter
-
-MCU_DIR = $(SDK_DIR)/devices/LPC51U68
-
-# All source paths should be relative to the top level.
-LD_FILE = $(MCU_DIR)/gcc/LPC51U68_flash.ld
-
-SRC_C += \
- src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
- $(MCU_DIR)/system_LPC51U68.c \
- $(MCU_DIR)/drivers/fsl_clock.c \
- $(MCU_DIR)/drivers/fsl_power.c \
- $(MCU_DIR)/drivers/fsl_reset.c \
- $(SDK_DIR)/drivers/lpc_gpio/fsl_gpio.c \
- $(SDK_DIR)/drivers/flexcomm/fsl_flexcomm.c \
- $(SDK_DIR)/drivers/flexcomm/fsl_usart.c
-
-INC += \
- $(TOP)/$(MCU_DIR)/../../CMSIS/Include \
- $(TOP)/$(MCU_DIR) \
- $(TOP)/$(MCU_DIR)/drivers \
- $(TOP)/$(SDK_DIR)/drivers/common \
- $(TOP)/$(SDK_DIR)/drivers/flexcomm \
- $(TOP)/$(SDK_DIR)/drivers/lpc_iocon \
- $(TOP)/$(SDK_DIR)/drivers/lpc_gpio
-
-SRC_S += $(MCU_DIR)/gcc/startup_LPC51U68.S
-
-LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower.a
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
-
-JLINK_DEVICE = LPC51U68
-PYOCD_TARGET = LPC51U68
-
-# flash using pyocd (51u68 is not supported yet)
-flash: flash-pyocd
diff --git a/tinyusb/hw/bsp/lpcxpresso51u68/lpcxpresso51u68.c b/tinyusb/hw/bsp/lpcxpresso51u68/lpcxpresso51u68.c
deleted file mode 100755
index 6bade774..00000000
--- a/tinyusb/hw/bsp/lpcxpresso51u68/lpcxpresso51u68.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018, hathach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "../board.h"
-#include "fsl_device_registers.h"
-#include "fsl_gpio.h"
-#include "fsl_power.h"
-#include "fsl_iocon.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB0_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-#define LED_PORT 0
-#define LED_PIN 29
-#define LED_STATE_ON 0
-
-// WAKE button
-#define BUTTON_PORT 0
-#define BUTTON_PIN 24
-
-// IOCON pin mux
-#define IOCON_PIO_DIGITAL_EN 0x80u /*!< Enables digital function */
-#define IOCON_PIO_FUNC1 0x01u /*!< Selects pin function 1 */
-#define IOCON_PIO_FUNC7 0x07u /*!< Selects pin function 7 */
-#define IOCON_PIO_INPFILT_OFF 0x0100u /*!< Input filter disabled */
-#define IOCON_PIO_INV_DI 0x00u /*!< Input function is not inverted */
-#define IOCON_PIO_MODE_INACT 0x00u /*!< No addition pin function */
-#define IOCON_PIO_OPENDRAIN_DI 0x00u /*!< Open drain is disabled */
-#define IOCON_PIO_SLEW_STANDARD 0x00u /*!< Standard mode, output slew rate control is enabled */
-
-/****************************************************************
-name: BOARD_BootClockFROHF96M
-outputs:
-- {id: SYSTICK_clock.outFreq, value: 96 MHz}
-- {id: System_clock.outFreq, value: 96 MHz}
-settings:
-- {id: SYSCON.MAINCLKSELA.sel, value: SYSCON.fro_hf}
-sources:
-- {id: SYSCON.fro_hf.outFreq, value: 96 MHz}
-******************************************************************/
-void BootClockFROHF96M(void)
-{
- /*!< Set up the clock sources */
- /*!< Set up FRO */
- POWER_DisablePD(kPDRUNCFG_PD_FRO_EN); /*!< Ensure FRO is on */
- CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); /*!< Switch to FRO 12MHz first to ensure we can change voltage without
- accidentally being below the voltage for current speed */
- POWER_SetVoltageForFreq(96000000U); /*!< Set voltage for the one of the fastest clock outputs: System clock output */
- CLOCK_SetFLASHAccessCyclesForFreq(96000000U); /*!< Set FLASH wait states for core */
-
- CLOCK_SetupFROClocking(96000000U); /*!< Set up high frequency FRO output to selected frequency */
-
- /*!< Set up dividers */
- CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U, false); /*!< Set AHBCLKDIV divider to value 1 */
- CLOCK_SetClkDiv(kCLOCK_DivSystickClk, 0U, true); /*!< Reset SYSTICKCLKDIV divider counter and halt it */
- CLOCK_SetClkDiv(kCLOCK_DivSystickClk, 1U, false); /*!< Set SYSTICKCLKDIV divider to value 1 */
-
- /*!< Set up clock selectors - Attach clocks to the peripheries */
- CLOCK_AttachClk(kFRO_HF_to_MAIN_CLK); /*!< Switch MAIN_CLK to FRO_HF */
- /*!< Set SystemCoreClock variable. */
- SystemCoreClock = 96000000U;
-}
-
-void board_init(void)
-{
- // Enable IOCON clock
- CLOCK_EnableClock(kCLOCK_Iocon);
-
- // Enable GPIO0 clock
- CLOCK_EnableClock(kCLOCK_Gpio0);
-
- // Init 96 MHz clock
- BootClockFROHF96M();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- GPIO_PortInit(GPIO, LED_PORT);
- GPIO_PortInit(GPIO, BUTTON_PORT);
-
- // LED
- gpio_pin_config_t const led_config = { kGPIO_DigitalOutput, 0};
- GPIO_PinInit(GPIO, LED_PORT, LED_PIN, &led_config);
- board_led_write(true);
-
- // Button
- gpio_pin_config_t const button_config = { kGPIO_DigitalInput, 0};
- GPIO_PinInit(GPIO, BUTTON_PORT, BUTTON_PIN, &button_config);
-
- // USB
- const uint32_t port1_pin6_config = (
- IOCON_PIO_FUNC7 | /* Pin is configured as USB0_VBUS */
- IOCON_PIO_MODE_INACT | /* No addition pin function */
- IOCON_PIO_INV_DI | /* Input function is not inverted */
- IOCON_PIO_DIGITAL_EN | /* Enables digital function */
- IOCON_PIO_INPFILT_OFF | /* Input filter disabled */
- IOCON_PIO_OPENDRAIN_DI /* Open drain is disabled */
- );
- IOCON_PinMuxSet(IOCON, 1, 6, port1_pin6_config); /* PORT1 PIN6 (coords: 26) is configured as USB0_VBUS */
-
- POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY); /*Turn on USB Phy */
- CLOCK_EnableUsbfs0Clock(kCLOCK_UsbSrcFro, CLOCK_GetFreq(kCLOCK_FroHf)); /* enable USB IP clock */
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- GPIO_PinWrite(GPIO, LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- // active low
- return 1-GPIO_PinRead(GPIO, BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler(void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/mbed1768/board.mk b/tinyusb/hw/bsp/mbed1768/board.mk
deleted file mode 100755
index e99df9f0..00000000
--- a/tinyusb/hw/bsp/mbed1768/board.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nxp/lpcopen
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m3 \
- -nostdlib \
- -DCORE_M3 \
- -D__USE_LPCOPEN \
- -DCFG_TUSB_MCU=OPT_MCU_LPC175X_6X \
- -DRTC_EV_SUPPORT=0
-
-# startup.c and lpc_types.h cause following errors
-CFLAGS += -Wno-error=strict-prototypes
-
-MCU_DIR = hw/mcu/nxp/lpcopen/lpc175x_6x/lpc_chip_175x_6x
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/lpc1768.ld
-
-SRC_C += \
- src/portable/nxp/lpc17_40/dcd_lpc17_40.c \
- $(MCU_DIR)/../gcc/cr_startup_lpc175x_6x.c \
- $(MCU_DIR)/src/chip_17xx_40xx.c \
- $(MCU_DIR)/src/clock_17xx_40xx.c \
- $(MCU_DIR)/src/gpio_17xx_40xx.c \
- $(MCU_DIR)/src/iocon_17xx_40xx.c \
- $(MCU_DIR)/src/sysctl_17xx_40xx.c \
- $(MCU_DIR)/src/sysinit_17xx_40xx.c \
- $(MCU_DIR)/src/uart_17xx_40xx.c
-
-INC += \
- $(TOP)/$(MCU_DIR)/inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM3
-
-# For flash-jlink target
-JLINK_DEVICE = LPC1768
-
-# flash using pyocd
-flash: $(BUILD)/$(PROJECT).hex
- pyocd flash -t lpc1768 $<
-
diff --git a/tinyusb/hw/bsp/mbed1768/lpc1768.ld b/tinyusb/hw/bsp/mbed1768/lpc1768.ld
deleted file mode 100755
index d1c83d8e..00000000
--- a/tinyusb/hw/bsp/mbed1768/lpc1768.ld
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * GENERATED FILE - DO NOT EDIT
- * (c) Code Red Technologies Ltd, 2008-2013
- * (c) NXP Semiconductors 2013-2019
- * Generated linker script file for LPC1769
- * Created from linkscript.ldt by FMCreateLinkLibraries
- * Using Freemarker v2.3.23
- * MCUXpresso IDE v10.2.1 [Build 795] [2018-07-25] on May 14, 2019 6:39:29 PM
- */
-
-MEMORY
-{
- /* Define each memory region */
- MFlash512 (rx) : ORIGIN = 0x0, LENGTH = 0x80000 /* 512K bytes (alias Flash) */
- RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */
- RamAHB32 (rwx) : ORIGIN = 0x2007c000, LENGTH = 0x8000 /* 32K bytes (alias RAM2) */
-}
-
- /* Define a symbol for the top of each memory region */
- __base_MFlash512 = 0x0 ; /* MFlash512 */
- __base_Flash = 0x0 ; /* Flash */
- __top_MFlash512 = 0x0 + 0x80000 ; /* 512K bytes */
- __top_Flash = 0x0 + 0x80000 ; /* 512K bytes */
- __base_RamLoc32 = 0x10000000 ; /* RamLoc32 */
- __base_RAM = 0x10000000 ; /* RAM */
- __top_RamLoc32 = 0x10000000 + 0x8000 ; /* 32K bytes */
- __top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */
- __base_RamAHB32 = 0x2007c000 ; /* RamAHB32 */
- __base_RAM2 = 0x2007c000 ; /* RAM2 */
- __top_RamAHB32 = 0x2007c000 + 0x8000 ; /* 32K bytes */
- __top_RAM2 = 0x2007c000 + 0x8000 ; /* 32K bytes */
-
-ENTRY(ResetISR)
-
-SECTIONS
-{
- /* MAIN TEXT SECTION */
- .text : ALIGN(4)
- {
- FILL(0xff)
- __vectors_start__ = ABSOLUTE(.) ;
- KEEP(*(.isr_vector))
- /* Global Section Table */
- . = ALIGN(4) ;
- __section_table_start = .;
- __data_section_table = .;
- LONG(LOADADDR(.data));
- LONG( ADDR(.data));
- LONG( SIZEOF(.data));
- LONG(LOADADDR(.data_RAM2));
- LONG( ADDR(.data_RAM2));
- LONG( SIZEOF(.data_RAM2));
- __data_section_table_end = .;
- __bss_section_table = .;
- LONG( ADDR(.bss));
- LONG( SIZEOF(.bss));
- LONG( ADDR(.bss_RAM2));
- LONG( SIZEOF(.bss_RAM2));
- __bss_section_table_end = .;
- __section_table_end = . ;
- /* End of Global Section Table */
-
- *(.after_vectors*)
-
- } > MFlash512
-
- .text : ALIGN(4)
- {
- *(.text*)
- *(.rodata .rodata.* .constdata .constdata.*)
- . = ALIGN(4);
- } > MFlash512
- /*
- * for exception handling/unwind - some Newlib functions (in common
- * with C++ and STDC++) use this.
- */
- .ARM.extab : ALIGN(4)
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > MFlash512
-
- __exidx_start = .;
-
- .ARM.exidx : ALIGN(4)
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > MFlash512
- __exidx_end = .;
-
- _etext = .;
-
- /* DATA section for RamAHB32 */
-
- .data_RAM2 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM2 = .) ;
- *(.ramfunc.$RAM2)
- *(.ramfunc.$RamAHB32)
- *(.data.$RAM2*)
- *(.data.$RamAHB32*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM2 = .) ;
- } > RamAHB32 AT>MFlash512
- /* MAIN DATA SECTION */
- .uninit_RESERVED : ALIGN(4)
- {
- KEEP(*(.bss.$RESERVED*))
- . = ALIGN(4) ;
- _end_uninit_RESERVED = .;
- } > RamLoc32
-
- /* Main DATA section (RamLoc32) */
- .data : ALIGN(4)
- {
- FILL(0xff)
- _data = . ;
- *(vtable)
- *(.ramfunc*)
- *(.data*)
- . = ALIGN(4) ;
- _edata = . ;
- } > RamLoc32 AT>MFlash512
-
- /* BSS section for RamAHB32 */
- .bss_RAM2 : ALIGN(4)
- {
- PROVIDE(__start_bss_RAM2 = .) ;
- *(.bss.$RAM2*)
- *(.bss.$RamAHB32*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM2 = .) ;
- } > RamAHB32
-
- /* MAIN BSS SECTION */
- .bss : ALIGN(4)
- {
- _bss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4) ;
- _ebss = .;
- PROVIDE(end = .);
- } > RamLoc32
-
- /* NOINIT section for RamAHB32 */
- .noinit_RAM2 (NOLOAD) : ALIGN(4)
- {
- *(.noinit.$RAM2*)
- *(.noinit.$RamAHB32*)
- . = ALIGN(4) ;
- } > RamAHB32
-
- /* DEFAULT NOINIT SECTION */
- .noinit (NOLOAD): ALIGN(4)
- {
- _noinit = .;
- *(.noinit*)
- . = ALIGN(4) ;
- _end_noinit = .;
- } > RamLoc32
- PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
- PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc32 - 0);
-
- /* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (NMI_Handler + 1)
- + (HardFault_Handler + 1)
- + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
- + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
- + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
- ) );
-
- /* Provide basic symbols giving location and size of main text
- * block, including initial values of RW data sections. Note that
- * these will need extending to give a complete picture with
- * complex images (e.g multiple Flash banks).
- */
- _image_start = LOADADDR(.text);
- _image_end = LOADADDR(.data) + SIZEOF(.data);
- _image_size = _image_end - _image_start;
-} \ No newline at end of file
diff --git a/tinyusb/hw/bsp/mbed1768/mbed1768.c b/tinyusb/hw/bsp/mbed1768/mbed1768.c
deleted file mode 100755
index 5495ed16..00000000
--- a/tinyusb/hw/bsp/mbed1768/mbed1768.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "chip.h"
-#include "../board.h"
-
-#define LED_PORT 1
-#define LED_PIN 18
-#define LED_STATE_ON 1
-
-// JOYSTICK_DOWN if using LPCXpresso Base Board
-#define BUTTON_PORT 0
-#define BUTTON_PIN 15
-#define BUTTON_STATE_ACTIVE 0
-
-#define BOARD_UART_PORT LPC_UART3
-
-/* System oscillator rate and RTC oscillator rate */
-const uint32_t OscRateIn = 10000000;
-const uint32_t RTCOscRateIn = 32768;
-
-/* Pin muxing configuration */
-static const PINMUX_GRP_T pinmuxing[] =
-{
- {LED_PORT, LED_PIN, IOCON_MODE_INACT | IOCON_FUNC0},
- {BUTTON_PORT, BUTTON_PIN, IOCON_FUNC0 | IOCON_MODE_PULLUP},
-};
-
-static const PINMUX_GRP_T pin_usb_mux[] =
-{
- {0, 29, IOCON_MODE_INACT | IOCON_FUNC1}, // D+
- {0, 30, IOCON_MODE_INACT | IOCON_FUNC1}, // D-
- {2, 9, IOCON_MODE_INACT | IOCON_FUNC1}, // Connect
-
- {1, 19, IOCON_MODE_INACT | IOCON_FUNC2}, // USB_PPWR
- {1, 22, IOCON_MODE_INACT | IOCON_FUNC2}, // USB_PWRD
-
- /* VBUS is not connected on this board, so leave the pin at default setting. */
- /*Chip_IOCON_PinMux(LPC_IOCON, 1, 30, IOCON_MODE_INACT, IOCON_FUNC2);*/ /* USB VBUS */
-};
-
-// Invoked by startup code
-void SystemInit(void)
-{
-#ifdef __USE_LPCOPEN
- extern void (* const g_pfnVectors[])(void);
- unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
- *pSCB_VTOR = (unsigned int) g_pfnVectors;
-#endif
-
- Chip_IOCON_Init(LPC_IOCON);
- Chip_IOCON_SetPinMuxing(LPC_IOCON, pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
- Chip_SetupXtalClocking();
-}
-
-void board_init(void)
-{
- SystemCoreClockUpdate();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- Chip_GPIO_Init(LPC_GPIO);
-
- // LED
- Chip_GPIO_SetPinDIROutput(LPC_GPIO, LED_PORT, LED_PIN);
-
- // Button
- Chip_GPIO_SetPinDIRInput(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
-
-#if 0
- //------------- UART -------------//
- PINSEL_CFG_Type PinCfg =
- {
- .Portnum = 0,
- .Pinnum = 0, // TXD is P0.0
- .Funcnum = 2,
- .OpenDrain = 0,
- .Pinmode = 0
- };
- PINSEL_ConfigPin(&PinCfg);
-
- PinCfg.Portnum = 0;
- PinCfg.Pinnum = 1; // RXD is P0.1
- PINSEL_ConfigPin(&PinCfg);
-
- UART_CFG_Type UARTConfigStruct;
- UART_ConfigStructInit(&UARTConfigStruct);
- UARTConfigStruct.Baud_rate = CFG_BOARD_UART_BAUDRATE;
-
- UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
- UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
-#endif
-
- //------------- USB -------------//
- Chip_IOCON_SetPinMuxing(LPC_IOCON, pin_usb_mux, sizeof(pin_usb_mux) / sizeof(PINMUX_GRP_T));
- Chip_USB_Init();
-
- enum {
- USBCLK_DEVCIE = 0x12, // AHB + Device
- USBCLK_HOST = 0x19, // AHB + Host + OTG
-// 0x1B // Host + Device + OTG + AHB
- };
-
- uint32_t const clk_en = TUSB_OPT_DEVICE_ENABLED ? USBCLK_DEVCIE : USBCLK_HOST;
-
- LPC_USB->OTGClkCtrl = clk_en;
- while ( (LPC_USB->OTGClkSt & clk_en) != clk_en );
-
-#if TUSB_OPT_HOST_ENABLED
- // set portfunc to host !!!
- LPC_USB->StCtrl = 0x3; // should be 1
-#endif
-}
-
-//--------------------------------------------------------------------+
-// USB Interrupt Handler
-//--------------------------------------------------------------------+
-void USB_IRQHandler(void)
-{
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
- tuh_int_handler(0);
- #endif
-
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
- tud_int_handler(0);
- #endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- Chip_GPIO_SetPinState(LPC_GPIO, LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == Chip_GPIO_GetPinState(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
-// return UART_ReceiveByte(BOARD_UART_PORT);
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
-// UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/msp430/boards/msp_exp430f5529lp/board.h b/tinyusb/hw/bsp/msp430/boards/msp_exp430f5529lp/board.h
deleted file mode 100755
index ccfe321c..00000000
--- a/tinyusb/hw/bsp/msp430/boards/msp_exp430f5529lp/board.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define LED_PORT P1OUT
-#define LED_PIN BIT0
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT P1IN
-#define BUTTON_PIN BIT1
-#define BUTTON_STATE_ACTIVE 0
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/msp430/family.c b/tinyusb/hw/bsp/msp430/family.c
deleted file mode 100755
index 4b8ae393..00000000
--- a/tinyusb/hw/bsp/msp430/family.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "bsp/board.h"
-#include "board.h"
-#include "msp430.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void __attribute__ ((interrupt(USB_UBM_VECTOR))) USB_UBM_ISR(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-uint32_t cnt = 0;
-
-static void SystemClock_Config(void)
-{
- WDTCTL = WDTPW + WDTHOLD; // Disable watchdog.
-
- // Increase VCore to level 2- required for 16 MHz operation on this MCU.
- PMMCTL0 = PMMPW + PMMCOREV_2;
-
- UCSCTL3 = SELREF__XT2CLK; // FLL is fed by XT2.
-
- // XT1 used for ACLK (default- not used in this demo)
- P5SEL |= BIT4; // Required to enable XT1
- // Loop until XT1 fault flag is cleared.
- do
- {
- UCSCTL7 &= ~XT1LFOFFG;
- }while(UCSCTL7 & XT1LFOFFG);
-
- // XT2 is 4 MHz an external oscillator, use PLL to boost to 16 MHz.
- P5SEL |= BIT2; // Required to enable XT2.
- // Loop until XT2 fault flag is cleared
- do
- {
- UCSCTL7 &= ~XT2OFFG;
- }while(UCSCTL7 & XT2OFFG);
-
- // Kickstart the DCO into the correct frequency range, otherwise a
- // fault will occur.
- // FIXME: DCORSEL_6 should work according to datasheet params, but generates
- // a fault. I am not sure why it faults.
- UCSCTL1 = DCORSEL_7;
- UCSCTL2 = FLLD_2 + 3; // DCO freq = D * (N + 1) * (FLLREFCLK / n)
- // DCOCLKDIV freq = (N + 1) * (FLLREFCLK / n)
- // N = 3, D = 2, thus DCO freq = 32 MHz.
-
- // MCLK configured for 16 MHz using XT2.
- // SMCLK configured for 8 MHz using XT2.
- UCSCTL4 |= SELM__DCOCLKDIV + SELS__DCOCLKDIV;
- UCSCTL5 |= DIVM__16 + DIVS__2;
-
- // Now wait till everything's stabilized.
- do
- {
- UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);
- SFRIFG1 &= ~OFIFG;
- }while(SFRIFG1 & OFIFG);
-
- // Configure Timer A to use SMCLK as a source. Count 1000 ticks at 1 MHz.
- TA0CCTL0 |= CCIE;
- TA0CCR0 = 999; // 1000 ticks.
- TA0CTL |= TASSEL_2 + ID_3 + MC__UP; // Use SMCLK, divide by 8, start timer.
-
- // Initialize USB power and PLL.
- USBKEYPID = USBKEY;
-
- // VUSB enabled automatically.
- // Wait two milliseconds to stabilize, per manual recommendation.
- uint32_t ms_elapsed = board_millis();
- do
- {
- while((board_millis() - ms_elapsed) < 2);
- }while(!(USBPWRCTL & USBBGVBV));
-
- // USB uses XT2 (4 MHz) directly. Enable the PLL.
- USBPLLDIVB |= USBPLL_SETCLK_4_0;
- USBPLLCTL |= (UPFDEN | UPLLEN);
-
- // Wait until PLL locks. Check every 2ms, per manual.
- ms_elapsed = board_millis();
- do
- {
- USBPLLIR &= ~USBOOLIFG;
- while((board_millis() - ms_elapsed) < 2);
- }while(USBPLLIR & USBOOLIFG);
-
- USBKEYPID = 0;
-}
-
-uint32_t wait = 0;
-
-void board_init(void)
-{
- __bis_SR_register(GIE); // Enable interrupts.
- SystemClock_Config();
-
- // Enable basic I/O.
- P1DIR |= LED_PIN; // LED output.
- P1REN |= BUTTON_PIN; // Internal resistor enable.
- P1OUT |= BUTTON_PIN; // Pullup.
-
- // Enable the backchannel UART (115200)
- P4DIR |= BIT5;
- P4SEL |= (BIT5 | BIT4);
-
- UCA1CTL1 |= (UCSSEL__SMCLK | UCSWRST); // Hold in reset, use SMCLK.
- UCA1BRW = 4;
- UCA1MCTL |= (UCBRF_3 | UCBRS_5 | UCOS16); // Overampling mode, 115200 baud.
- // Copied from manual.
- UCA1CTL1 &= ~UCSWRST;
-
- // Set up USB pins.
- USBKEYPID = USBKEY;
- USBPHYCTL |= PUSEL; // Convert USB D+/D- pins to USB functionality.
- USBKEYPID = 0;
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- if(state)
- {
- LED_PORT |= LED_PIN;
- }
- else
- {
- LED_PORT &= ~LED_PIN;
- }
-}
-
-uint32_t board_button_read(void)
-{
- return ((P1IN & BIT1) >> 1) == BUTTON_STATE_ACTIVE;
-}
-
-int board_uart_read(uint8_t * buf, int len)
-{
- for(int i = 0; i < len; i++)
- {
- // Wait until something to receive (cleared by reading buffer).
- while(!(UCA1IFG & UCRXIFG));
- buf[i] = UCA1RXBUF;
- }
-
- return len;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- const char * char_buf = (const char *) buf;
-
- for(int i = 0; i < len; i++)
- {
- // Wait until TX buffer is empty (cleared by writing buffer).
- while(!(UCA1IFG & UCTXIFG));
- UCA1TXBUF = char_buf[i];
- }
-
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void __attribute__ ((interrupt(TIMER0_A0_VECTOR))) TIMER0_A0_ISR (void)
-{
- system_ticks++;
- // TAxCCR0 CCIFG resets itself as soon as interrupt is invoked.
-}
-
-uint32_t board_millis(void)
-{
- uint32_t systick_mirror;
-
- // 32-bit update is not atomic on MSP430. We can read the bottom 16-bits,
- // an interrupt occurs, updates _all_ 32 bits, and then we return a
- // garbage value. And I've seen it happen!
- TA0CCTL0 &= ~CCIE;
- systick_mirror = system_ticks;
- TA0CCTL0 |= CCIE;
-
- return systick_mirror;
-}
-#endif
diff --git a/tinyusb/hw/bsp/msp430/family.mk b/tinyusb/hw/bsp/msp430/family.mk
deleted file mode 100755
index ceafa6ec..00000000
--- a/tinyusb/hw/bsp/msp430/family.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-CROSS_COMPILE = msp430-elf-
-DEPS_SUBMODULES += hw/mcu/ti
-SKIP_NANOLIB = 1
-
-CFLAGS += \
- -D__MSP430F5529__ \
- -DCFG_TUSB_MCU=OPT_MCU_MSP430x5xx \
- -DCFG_EXAMPLE_MSC_READONLY \
- -DCFG_TUD_ENDPOINT0_SIZE=8
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/mcu/ti/msp430/msp430-gcc-support-files/include/msp430f5529.ld
-LDINC += $(TOP)/hw/mcu/ti/msp430/msp430-gcc-support-files/include
-LDFLAGS += $(addprefix -L,$(LDINC))
-
-SRC_C += src/portable/ti/msp430x5xx/dcd_msp430x5xx.c
-
-INC += \
- $(TOP)/hw/mcu/ti/msp430/msp430-gcc-support-files/include \
- $(TOP)/$(BOARD_PATH)
-
-# export for libmsp430.so to same installation
-ifneq ($(OS),Windows_NT)
-export LD_LIBRARY_PATH=$(dir $(shell which MSP430Flasher))
-endif
-
-# flash target using TI MSP430-Flasher
-# http://www.ti.com/tool/MSP430-FLASHER
-# Please add its installation dir to PATH
-flash: $(BUILD)/$(PROJECT).hex
- MSP430Flasher -w $< -z [VCC]
-
-# flash target using mspdebug.
-flash-mspdebug: $(BUILD)/$(PROJECT).elf
- $(MSPDEBUG) tilib "prog $<" --allow-fw-update
diff --git a/tinyusb/hw/bsp/ngx4330/board.mk b/tinyusb/hw/bsp/ngx4330/board.mk
deleted file mode 100755
index 04c37fee..00000000
--- a/tinyusb/hw/bsp/ngx4330/board.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nxp/lpcopen
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib \
- -DCORE_M4 \
- -D__USE_LPCOPEN \
- -DCFG_TUSB_MCU=OPT_MCU_LPC43XX
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter
-
-MCU_DIR = hw/mcu/nxp/lpcopen/lpc43xx/lpc_chip_43xx
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/ngx4330.ld
-
-SRC_C += \
- src/portable/nxp/transdimension/dcd_transdimension.c \
- $(MCU_DIR)/../gcc/cr_startup_lpc43xx.c \
- $(MCU_DIR)/src/chip_18xx_43xx.c \
- $(MCU_DIR)/src/clock_18xx_43xx.c \
- $(MCU_DIR)/src/gpio_18xx_43xx.c \
- $(MCU_DIR)/src/sysinit_18xx_43xx.c \
- $(MCU_DIR)/src/uart_18xx_43xx.c \
- $(MCU_DIR)/src/fpu_init.c
-
-INC += \
- $(TOP)/$(MCU_DIR)/inc \
- $(TOP)/$(MCU_DIR)/inc/config_43xx
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# For flash-jlink target
-JLINK_DEVICE = LPC4330
-JLINK_IF = swd
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/ngx4330/ngx4330.c b/tinyusb/hw/bsp/ngx4330/ngx4330.c
deleted file mode 100755
index b63f9b89..00000000
--- a/tinyusb/hw/bsp/ngx4330/ngx4330.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "chip.h"
-#include "../board.h"
-
-#define LED_PORT 1
-#define LED_PIN 12
-#define LED_STATE_ON 0
-
-#define BUTTON_PORT 0
-#define BUTTON_PIN 7
-#define BUTTON_STATE_ACTIVE 0
-
-#define BOARD_UART_PORT LPC_USART0
-#define BOARD_UART_PIN_PORT 0x0f
-#define BOARD_UART_PIN_TX 10 // PF.10 : UART0_TXD
-#define BOARD_UART_PIN_RX 11 // PF.11 : UART0_RXD
-
-/*------------------------------------------------------------------*/
-/* BOARD API
- *------------------------------------------------------------------*/
-
-/* System configuration variables used by chip driver */
-const uint32_t OscRateIn = 12000000;
-const uint32_t ExtRateIn = 0;
-
-static const PINMUX_GRP_T pinmuxing[] =
-{
- // LED P2.12 as GPIO 1.12
- {2, 11, (SCU_MODE_INBUFF_EN | SCU_MODE_PULLDOWN | SCU_MODE_FUNC0)},
-
- // Button P2.7 as GPIO 0.7
- {2, 7, (SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC0)},
-
- // USB
- {2, 6, (SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC4)}, // USB1_PWR_EN
- {2, 5, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2)}, // USB1_VBUS
- {1, 7, (SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC4)}, // USB0_PWRN_EN
-
- // SPIFI
- {3, 3, (SCU_PINIO_FAST | SCU_MODE_FUNC3)}, /* SPIFI CLK */
- {3, 4, (SCU_PINIO_FAST | SCU_MODE_FUNC3)}, /* SPIFI D3 */
- {3, 5, (SCU_PINIO_FAST | SCU_MODE_FUNC3)}, /* SPIFI D2 */
- {3, 6, (SCU_PINIO_FAST | SCU_MODE_FUNC3)}, /* SPIFI D1 */
- {3, 7, (SCU_PINIO_FAST | SCU_MODE_FUNC3)}, /* SPIFI D0 */
- {3, 8, (SCU_PINIO_FAST | SCU_MODE_FUNC3)} /* SPIFI CS/SSEL */
-};
-
-// Invoked by startup code
-void SystemInit(void)
-{
-#ifdef __USE_LPCOPEN
- extern void (* const g_pfnVectors[])(void);
- unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
- *pSCB_VTOR = (unsigned int) g_pfnVectors;
-
-#if __FPU_USED == 1
- fpuInit();
-#endif
-#endif // __USE_LPCOPEN
-
- // Set up pinmux
- Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));
-
- //------------- Set up clock -------------//
- Chip_Clock_SetBaseClock(CLK_BASE_SPIFI, CLKIN_IRC, true, false); // change SPIFI to IRC during clock programming
- LPC_SPIFI->CTRL |= SPIFI_CTRL_FBCLK(1); // and set FBCLK in SPIFI controller
-
- Chip_SetupCoreClock(CLKIN_CRYSTAL, MAX_CLOCK_FREQ, true);
-
- /* Reset and enable 32Khz oscillator */
- LPC_CREG->CREG0 &= ~((1 << 3) | (1 << 2));
- LPC_CREG->CREG0 |= (1 << 1) | (1 << 0);
-
- /* Setup a divider E for main PLL clock switch SPIFI clock to that divider.
- Divide rate is based on CPU speed and speed of SPI FLASH part. */
-#if (MAX_CLOCK_FREQ > 180000000)
- Chip_Clock_SetDivider(CLK_IDIV_E, CLKIN_MAINPLL, 5);
-#else
- Chip_Clock_SetDivider(CLK_IDIV_E, CLKIN_MAINPLL, 4);
-#endif
- Chip_Clock_SetBaseClock(CLK_BASE_SPIFI, CLKIN_IDIVE, true, false);
-
- /* Setup system base clocks and initial states. This won't enable and
- disable individual clocks, but sets up the base clock sources for
- each individual peripheral clock. */
- Chip_Clock_SetBaseClock(CLK_BASE_USB1, CLKIN_IDIVD, true, true);
-}
-
-void board_init(void)
-{
- SystemCoreClockUpdate();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- //NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- Chip_GPIO_Init(LPC_GPIO_PORT);
-
- // LED
- Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, LED_PORT, LED_PIN);
-
- // Button
- Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN);
-
-#if 0
- //------------- UART -------------//
- scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_TX, MD_PDN, FUNC1);
- scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_RX, MD_PLN | MD_EZI | MD_ZI, FUNC1);
-
- UART_CFG_Type UARTConfigStruct;
- UART_ConfigStructInit(&UARTConfigStruct);
- UARTConfigStruct.Baud_rate = CFG_BOARD_UART_BAUDRATE;
- UARTConfigStruct.Clock_Speed = 0;
-
- UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
- UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
-#endif
-
- //------------- USB -------------//
- enum {
- USBMODE_DEVICE = 2,
- USBMODE_HOST = 3
- };
-
- enum {
- USBMODE_VBUS_LOW = 0,
- USBMODE_VBUS_HIGH = 1
- };
-
- /* USB0
- * For USB Device operation; insert jumpers in position 1-2 in JP17/JP18/JP19. GPIO28 controls USB
- * connect functionality and LED32 lights when the USB Device is connected. SJ4 has pads 1-2 shorted
- * by default. LED33 is controlled by GPIO27 and signals USB-up state. GPIO54 is used for VBUS
- * sensing.
- * For USB Host operation; insert jumpers in position 2-3 in JP17/JP18/JP19. USB Host power is
- * controlled via distribution switch U20 (found in schematic page 11). Signal GPIO26 is active low and
- * enables +5V on VBUS2. LED35 light whenever +5V is present on VBUS2. GPIO55 is connected to
- * status feedback from the distribution switch. GPIO54 is used for VBUS sensing. 15Kohm pull-down
- * resistors are always active
- */
-#if CFG_TUSB_RHPORT0_MODE
- Chip_USB0_Init();
-#endif
-
- /* USB1
- * When USB channel #1 is used as USB Host, 15Kohm pull-down resistors are needed on the USB data
- * signals. These are activated inside the USB OTG chip (U31), and this has to be done via the I2C
- * interface of GPIO52/GPIO53.
- * J20 is the connector to use when USB Host is used. In order to provide +5V to the external USB
- * device connected to this connector (J20), channel A of U20 must be enabled. It is enabled by default
- * since SJ5 is normally connected between pin 1-2. LED34 lights green when +5V is available on J20.
- * JP15 shall not be inserted. JP16 has no effect
- *
- * When USB channel #1 is used as USB Device, a 1.5Kohm pull-up resistor is needed on the USB DP
- * data signal. There are two methods to create this. JP15 is inserted and the pull-up resistor is always
- * enabled. Alternatively, the pull-up resistor is activated inside the USB OTG chip (U31), and this has to
- * be done via the I2C interface of GPIO52/GPIO53. In the latter case, JP15 shall not be inserted.
- * J19 is the connector to use when USB Device is used. Normally it should be a USB-B connector for
- * creating a USB Device interface, but the mini-AB connector can also be used in this case. The status
- * of VBUS can be read via U31.
- * JP16 shall not be inserted.
- */
-#if CFG_TUSB_RHPORT1_MODE
- Chip_USB1_Init();
-
-// Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 5, 6); /* GPIO5[6] = USB1_PWR_EN */
-// Chip_GPIO_SetPinState(LPC_GPIO_PORT, 5, 6, true); /* GPIO5[6] output high */
-#endif
-}
-
-//--------------------------------------------------------------------+
-// USB Interrupt Handler
-//--------------------------------------------------------------------+
-void USB0_IRQHandler(void)
-{
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_HOST
- tuh_int_handler(0);
- #endif
-
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
- tud_int_handler(0);
- #endif
-}
-
-void USB1_IRQHandler(void)
-{
- #if CFG_TUSB_RHPORT1_MODE & OPT_MODE_HOST
- tuh_int_handler(1);
- #endif
-
- #if CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE
- tud_int_handler(1);
- #endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- Chip_GPIO_SetPinState(LPC_GPIO_PORT, LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == Chip_GPIO_GetPinState(LPC_GPIO_PORT, BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- //return UART_ReceiveByte(BOARD_UART_PORT);
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- //UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/ngx4330/ngx4330.ld b/tinyusb/hw/bsp/ngx4330/ngx4330.ld
deleted file mode 100755
index 7bd363f0..00000000
--- a/tinyusb/hw/bsp/ngx4330/ngx4330.ld
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * GENERATED FILE - DO NOT EDIT
- * Copyright (c) 2008-2013 Code Red Technologies Ltd,
- * Copyright 2015, 2018-2019 NXP
- * (c) NXP Semiconductors 2013-2019
- * Generated linker script file for LPC4330
- * Created from linkscript.ldt by FMCreateLinkLibraries
- * Using Freemarker v2.3.23
- * MCUXpresso IDE v11.0.0 [Build 2516] [2019-06-05] on Sep 9, 2019 12:09:49 PM
- */
-
-MEMORY
-{
- /* Define each memory region */
- RamLoc128 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x20000 /* 128K bytes (alias RAM) */
- RamLoc72 (rwx) : ORIGIN = 0x10080000, LENGTH = 0x12000 /* 72K bytes (alias RAM2) */
- RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes (alias RAM3) */
- RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16K bytes (alias RAM4) */
- RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes (alias RAM5) */
- SPIFI (rx) : ORIGIN = 0x14000000, LENGTH = 0x400000 /* 4M bytes (alias Flash) */
-}
-
- /* Define a symbol for the top of each memory region */
- __base_RamLoc128 = 0x10000000 ; /* RamLoc128 */
- __base_RAM = 0x10000000 ; /* RAM */
- __top_RamLoc128 = 0x10000000 + 0x20000 ; /* 128K bytes */
- __top_RAM = 0x10000000 + 0x20000 ; /* 128K bytes */
- __base_RamLoc72 = 0x10080000 ; /* RamLoc72 */
- __base_RAM2 = 0x10080000 ; /* RAM2 */
- __top_RamLoc72 = 0x10080000 + 0x12000 ; /* 72K bytes */
- __top_RAM2 = 0x10080000 + 0x12000 ; /* 72K bytes */
- __base_RamAHB32 = 0x20000000 ; /* RamAHB32 */
- __base_RAM3 = 0x20000000 ; /* RAM3 */
- __top_RamAHB32 = 0x20000000 + 0x8000 ; /* 32K bytes */
- __top_RAM3 = 0x20000000 + 0x8000 ; /* 32K bytes */
- __base_RamAHB16 = 0x20008000 ; /* RamAHB16 */
- __base_RAM4 = 0x20008000 ; /* RAM4 */
- __top_RamAHB16 = 0x20008000 + 0x4000 ; /* 16K bytes */
- __top_RAM4 = 0x20008000 + 0x4000 ; /* 16K bytes */
- __base_RamAHB_ETB16 = 0x2000c000 ; /* RamAHB_ETB16 */
- __base_RAM5 = 0x2000c000 ; /* RAM5 */
- __top_RamAHB_ETB16 = 0x2000c000 + 0x4000 ; /* 16K bytes */
- __top_RAM5 = 0x2000c000 + 0x4000 ; /* 16K bytes */
- __base_SPIFI = 0x14000000 ; /* SPIFI */
- __base_Flash = 0x14000000 ; /* Flash */
- __top_SPIFI = 0x14000000 + 0x400000 ; /* 4M bytes */
- __top_Flash = 0x14000000 + 0x400000 ; /* 4M bytes */
-
-ENTRY(ResetISR)
-
-SECTIONS
-{
- /* MAIN TEXT SECTION */
- .text : ALIGN(4)
- {
- FILL(0xff)
- __vectors_start__ = ABSOLUTE(.) ;
- KEEP(*(.isr_vector))
- /* Global Section Table */
- . = ALIGN(4) ;
- __section_table_start = .;
- __data_section_table = .;
- LONG(LOADADDR(.data));
- LONG( ADDR(.data));
- LONG( SIZEOF(.data));
- LONG(LOADADDR(.data_RAM2));
- LONG( ADDR(.data_RAM2));
- LONG( SIZEOF(.data_RAM2));
- LONG(LOADADDR(.data_RAM3));
- LONG( ADDR(.data_RAM3));
- LONG( SIZEOF(.data_RAM3));
- LONG(LOADADDR(.data_RAM4));
- LONG( ADDR(.data_RAM4));
- LONG( SIZEOF(.data_RAM4));
- LONG(LOADADDR(.data_RAM5));
- LONG( ADDR(.data_RAM5));
- LONG( SIZEOF(.data_RAM5));
- __data_section_table_end = .;
- __bss_section_table = .;
- LONG( ADDR(.bss));
- LONG( SIZEOF(.bss));
- LONG( ADDR(.bss_RAM2));
- LONG( SIZEOF(.bss_RAM2));
- LONG( ADDR(.bss_RAM3));
- LONG( SIZEOF(.bss_RAM3));
- LONG( ADDR(.bss_RAM4));
- LONG( SIZEOF(.bss_RAM4));
- LONG( ADDR(.bss_RAM5));
- LONG( SIZEOF(.bss_RAM5));
- __bss_section_table_end = .;
- __section_table_end = . ;
- /* End of Global Section Table */
-
- *(.after_vectors*)
-
- } > SPIFI
-
- .text : ALIGN(4)
- {
- *(.text*)
- *(.rodata .rodata.* .constdata .constdata.*)
- . = ALIGN(4);
- } > SPIFI
- /*
- * for exception handling/unwind - some Newlib functions (in common
- * with C++ and STDC++) use this.
- */
- .ARM.extab : ALIGN(4)
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > SPIFI
-
- __exidx_start = .;
-
- .ARM.exidx : ALIGN(4)
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > SPIFI
- __exidx_end = .;
-
- _etext = .;
-
- /* DATA section for RamLoc72 */
-
- .data_RAM2 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM2 = .) ;
- *(.ramfunc.$RAM2)
- *(.ramfunc.$RamLoc72)
- *(.data.$RAM2)
- *(.data.$RamLoc72)
- *(.data.$RAM2.*)
- *(.data.$RamLoc72.*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM2 = .) ;
- } > RamLoc72 AT>SPIFI
- /* DATA section for RamAHB32 */
-
- .data_RAM3 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM3 = .) ;
- *(.ramfunc.$RAM3)
- *(.ramfunc.$RamAHB32)
- *(.data.$RAM3)
- *(.data.$RamAHB32)
- *(.data.$RAM3.*)
- *(.data.$RamAHB32.*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM3 = .) ;
- } > RamAHB32 AT>SPIFI
- /* DATA section for RamAHB16 */
-
- .data_RAM4 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM4 = .) ;
- *(.ramfunc.$RAM4)
- *(.ramfunc.$RamAHB16)
- *(.data.$RAM4)
- *(.data.$RamAHB16)
- *(.data.$RAM4.*)
- *(.data.$RamAHB16.*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM4 = .) ;
- } > RamAHB16 AT>SPIFI
- /* DATA section for RamAHB_ETB16 */
-
- .data_RAM5 : ALIGN(4)
- {
- FILL(0xff)
- PROVIDE(__start_data_RAM5 = .) ;
- *(.ramfunc.$RAM5)
- *(.ramfunc.$RamAHB_ETB16)
- *(.data.$RAM5)
- *(.data.$RamAHB_ETB16)
- *(.data.$RAM5.*)
- *(.data.$RamAHB_ETB16.*)
- . = ALIGN(4) ;
- PROVIDE(__end_data_RAM5 = .) ;
- } > RamAHB_ETB16 AT>SPIFI
- /* MAIN DATA SECTION */
- .uninit_RESERVED (NOLOAD) :
- {
- . = ALIGN(4) ;
- KEEP(*(.bss.$RESERVED*))
- . = ALIGN(4) ;
- _end_uninit_RESERVED = .;
- } > RamLoc128
-
- /* Main DATA section (RamLoc128) */
- .data : ALIGN(4)
- {
- FILL(0xff)
- _data = . ;
- *(vtable)
- *(.ramfunc*)
- *(.data*)
- . = ALIGN(4) ;
- _edata = . ;
- } > RamLoc128 AT>SPIFI
-
- /* BSS section for RamLoc72 */
- .bss_RAM2 :
- {
- . = ALIGN(4) ;
- PROVIDE(__start_bss_RAM2 = .) ;
- *(.bss.$RAM2)
- *(.bss.$RamLoc72)
- *(.bss.$RAM2.*)
- *(.bss.$RamLoc72.*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM2 = .) ;
- } > RamLoc72
-
- /* BSS section for RamAHB32 */
- .bss_RAM3 :
- {
- . = ALIGN(4) ;
- PROVIDE(__start_bss_RAM3 = .) ;
- *(.bss.$RAM3)
- *(.bss.$RamAHB32)
- *(.bss.$RAM3.*)
- *(.bss.$RamAHB32.*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM3 = .) ;
- } > RamAHB32
-
- /* BSS section for RamAHB16 */
- .bss_RAM4 :
- {
- . = ALIGN(4) ;
- PROVIDE(__start_bss_RAM4 = .) ;
- *(.bss.$RAM4)
- *(.bss.$RamAHB16)
- *(.bss.$RAM4.*)
- *(.bss.$RamAHB16.*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM4 = .) ;
- } > RamAHB16
-
- /* BSS section for RamAHB_ETB16 */
- .bss_RAM5 :
- {
- . = ALIGN(4) ;
- PROVIDE(__start_bss_RAM5 = .) ;
- *(.bss.$RAM5)
- *(.bss.$RamAHB_ETB16)
- *(.bss.$RAM5.*)
- *(.bss.$RamAHB_ETB16.*)
- . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
- PROVIDE(__end_bss_RAM5 = .) ;
- } > RamAHB_ETB16
-
- /* MAIN BSS SECTION */
- .bss :
- {
- . = ALIGN(4) ;
- _bss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4) ;
- _ebss = .;
- PROVIDE(end = .);
- } > RamLoc128
-
- /* NOINIT section for RamLoc72 */
- .noinit_RAM2 (NOLOAD) :
- {
- . = ALIGN(4) ;
- *(.noinit.$RAM2)
- *(.noinit.$RamLoc72)
- *(.noinit.$RAM2.*)
- *(.noinit.$RamLoc72.*)
- . = ALIGN(4) ;
- } > RamLoc72
-
- /* NOINIT section for RamAHB32 */
- .noinit_RAM3 (NOLOAD) :
- {
- . = ALIGN(4) ;
- *(.noinit.$RAM3)
- *(.noinit.$RamAHB32)
- *(.noinit.$RAM3.*)
- *(.noinit.$RamAHB32.*)
- . = ALIGN(4) ;
- } > RamAHB32
-
- /* NOINIT section for RamAHB16 */
- .noinit_RAM4 (NOLOAD) :
- {
- . = ALIGN(4) ;
- *(.noinit.$RAM4)
- *(.noinit.$RamAHB16)
- *(.noinit.$RAM4.*)
- *(.noinit.$RamAHB16.*)
- . = ALIGN(4) ;
- } > RamAHB16
-
- /* NOINIT section for RamAHB_ETB16 */
- .noinit_RAM5 (NOLOAD) :
- {
- . = ALIGN(4) ;
- *(.noinit.$RAM5)
- *(.noinit.$RamAHB_ETB16)
- *(.noinit.$RAM5.*)
- *(.noinit.$RamAHB_ETB16.*)
- . = ALIGN(4) ;
- } > RamAHB_ETB16
-
- /* DEFAULT NOINIT SECTION */
- .noinit (NOLOAD):
- {
- . = ALIGN(4) ;
- _noinit = .;
- *(.noinit*)
- . = ALIGN(4) ;
- _end_noinit = .;
- } > RamLoc128
- PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
- PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc128 - 0);
-
- /* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (NMI_Handler + 1)
- + (HardFault_Handler + 1)
- + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
- + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
- + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
- ) );
-
- /* Provide basic symbols giving location and size of main text
- * block, including initial values of RW data sections. Note that
- * these will need extending to give a complete picture with
- * complex images (e.g multiple Flash banks).
- */
- _image_start = LOADADDR(.text);
- _image_end = LOADADDR(.data) + SIZEOF(.data);
- _image_size = _image_end - _image_start;
-} \ No newline at end of file
diff --git a/tinyusb/hw/bsp/nrf/boards/adafruit_clue/board.h b/tinyusb/hw/bsp/nrf/boards/adafruit_clue/board.h
deleted file mode 100755
index 2c58e8fe..00000000
--- a/tinyusb/hw/bsp/nrf/boards/adafruit_clue/board.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define _PINNUM(port, pin) ((port)*32 + (pin))
-
-// LED
-#define LED_PIN _PINNUM(1, 1)
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN _PINNUM(1, 02)
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 4
-#define UART_TX_PIN 5
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/nrf/boards/adafruit_clue/board.mk b/tinyusb/hw/bsp/nrf/boards/adafruit_clue/board.mk
deleted file mode 100755
index f31899eb..00000000
--- a/tinyusb/hw/bsp/nrf/boards/adafruit_clue/board.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-MCU_VARIANT = nrf52840
-CFLAGS += -DNRF52840_XXAA
-
-$(BUILD)/$(PROJECT).zip: $(BUILD)/$(PROJECT).hex
- adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0xFFFE --application $^ $@
-
-# flash using adafruit-nrfutil dfu
-flash: $(BUILD)/$(PROJECT).zip
- @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
- adafruit-nrfutil --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank --touch 1200
diff --git a/tinyusb/hw/bsp/nrf/boards/adafruit_clue/nrf52840_s140_v6.ld b/tinyusb/hw/bsp/nrf/boards/adafruit_clue/nrf52840_s140_v6.ld
deleted file mode 100755
index 5314a4e9..00000000
--- a/tinyusb/hw/bsp/nrf/boards/adafruit_clue/nrf52840_s140_v6.ld
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Linker script to configure memory regions. */
-
-SEARCH_DIR(.)
-GROUP(-lgcc -lc -lnosys)
-
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xED000 - 0x26000
-
- /* SRAM required by S132 depend on
- * - Attribute Table Size
- * - Vendor UUID count
- * - Max ATT MTU
- * - Concurrent connection peripheral + central + secure links
- * - Event Len, HVN queue, Write CMD queue
- */
- RAM (rwx) : ORIGIN = 0x20003400, LENGTH = 0x20040000 - 0x20003400
-}
-
-SECTIONS
-{
- . = ALIGN(4);
- .svc_data :
- {
- PROVIDE(__start_svc_data = .);
- KEEP(*(.svc_data))
- PROVIDE(__stop_svc_data = .);
- } > RAM
-
- .fs_data :
- {
- PROVIDE(__start_fs_data = .);
- KEEP(*(.fs_data))
- PROVIDE(__stop_fs_data = .);
- } > RAM
-} INSERT AFTER .data;
-
-INCLUDE "nrf52_common.ld"
diff --git a/tinyusb/hw/bsp/nrf/boards/arduino_nano33_ble/arduino_nano33_ble.ld b/tinyusb/hw/bsp/nrf/boards/arduino_nano33_ble/arduino_nano33_ble.ld
deleted file mode 100755
index f570740b..00000000
--- a/tinyusb/hw/bsp/nrf/boards/arduino_nano33_ble/arduino_nano33_ble.ld
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Linker script to configure memory regions. */
-
-SEARCH_DIR(.)
-GROUP(-lgcc -lc -lnosys)
-
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x10000, LENGTH = 0xf0000
- RAM_NVIC (rwx) : ORIGIN = 0x20000000, LENGTH = 0x100
- RAM_CRASH_DATA (rwx) : ORIGIN = (0x20000000 + 0x100), LENGTH = 0x100
- RAM (rwx) : ORIGIN = ((0x20000000 + 0x100) + 0x100), LENGTH = (0x40000 - (0x100 + 0x100))
-}
-
-SECTIONS
-{
- . = ALIGN(4);
- .svc_data :
- {
- PROVIDE(__start_svc_data = .);
- KEEP(*(.svc_data))
- PROVIDE(__stop_svc_data = .);
- } > RAM
-
- .fs_data :
- {
- PROVIDE(__start_fs_data = .);
- KEEP(*(.fs_data))
- PROVIDE(__stop_fs_data = .);
- } > RAM
-} INSERT AFTER .data;
-
-INCLUDE "nrf52_common.ld"
diff --git a/tinyusb/hw/bsp/nrf/boards/arduino_nano33_ble/board.h b/tinyusb/hw/bsp/nrf/boards/arduino_nano33_ble/board.h
deleted file mode 100755
index d548e01c..00000000
--- a/tinyusb/hw/bsp/nrf/boards/arduino_nano33_ble/board.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define _PINNUM(port, pin) ((port)*32 + (pin))
-
-// LED
-#define LED_PIN _PINNUM(0, 24)
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PIN _PINNUM(1, 11) // D2
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN _PINNUM(1, 10)
-#define UART_TX_PIN _PINNUM(1, 3)
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/nrf/boards/arduino_nano33_ble/board.mk b/tinyusb/hw/bsp/nrf/boards/arduino_nano33_ble/board.mk
deleted file mode 100755
index 94babd82..00000000
--- a/tinyusb/hw/bsp/nrf/boards/arduino_nano33_ble/board.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-MCU_VARIANT = nrf52840
-CFLAGS += -DNRF52840_XXAA
-
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# flash using bossac (as part of Nano33 BSP tools)
-# can be found in arduino15/packages/arduino/tools/bossac/
-# Add it to your PATH or change BOSSAC variable to match your installation
-BOSSAC = bossac
-
-flash: $(BUILD)/$(PROJECT).bin
- @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
- $(BOSSAC) --port=$(SERIAL) -U -i -e -w $^ -R
diff --git a/tinyusb/hw/bsp/nrf/boards/circuitplayground_bluefruit/board.h b/tinyusb/hw/bsp/nrf/boards/circuitplayground_bluefruit/board.h
deleted file mode 100755
index a86c9dc7..00000000
--- a/tinyusb/hw/bsp/nrf/boards/circuitplayground_bluefruit/board.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define _PINNUM(port, pin) ((port)*32 + (pin))
-
-// LED
-#define LED_PIN _PINNUM(1, 14)
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN _PINNUM(1, 15)
-#define BUTTON_STATE_ACTIVE 1
-
-// UART
-#define UART_RX_PIN 30
-#define UART_TX_PIN 14
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/nrf/boards/circuitplayground_bluefruit/board.mk b/tinyusb/hw/bsp/nrf/boards/circuitplayground_bluefruit/board.mk
deleted file mode 100755
index f31899eb..00000000
--- a/tinyusb/hw/bsp/nrf/boards/circuitplayground_bluefruit/board.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-MCU_VARIANT = nrf52840
-CFLAGS += -DNRF52840_XXAA
-
-$(BUILD)/$(PROJECT).zip: $(BUILD)/$(PROJECT).hex
- adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0xFFFE --application $^ $@
-
-# flash using adafruit-nrfutil dfu
-flash: $(BUILD)/$(PROJECT).zip
- @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
- adafruit-nrfutil --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank --touch 1200
diff --git a/tinyusb/hw/bsp/nrf/boards/circuitplayground_bluefruit/nrf52840_s140_v6.ld b/tinyusb/hw/bsp/nrf/boards/circuitplayground_bluefruit/nrf52840_s140_v6.ld
deleted file mode 100755
index 5314a4e9..00000000
--- a/tinyusb/hw/bsp/nrf/boards/circuitplayground_bluefruit/nrf52840_s140_v6.ld
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Linker script to configure memory regions. */
-
-SEARCH_DIR(.)
-GROUP(-lgcc -lc -lnosys)
-
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xED000 - 0x26000
-
- /* SRAM required by S132 depend on
- * - Attribute Table Size
- * - Vendor UUID count
- * - Max ATT MTU
- * - Concurrent connection peripheral + central + secure links
- * - Event Len, HVN queue, Write CMD queue
- */
- RAM (rwx) : ORIGIN = 0x20003400, LENGTH = 0x20040000 - 0x20003400
-}
-
-SECTIONS
-{
- . = ALIGN(4);
- .svc_data :
- {
- PROVIDE(__start_svc_data = .);
- KEEP(*(.svc_data))
- PROVIDE(__stop_svc_data = .);
- } > RAM
-
- .fs_data :
- {
- PROVIDE(__start_fs_data = .);
- KEEP(*(.fs_data))
- PROVIDE(__stop_fs_data = .);
- } > RAM
-} INSERT AFTER .data;
-
-INCLUDE "nrf52_common.ld"
diff --git a/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_express/board.h b/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_express/board.h
deleted file mode 100755
index 3208a948..00000000
--- a/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_express/board.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define _PINNUM(port, pin) ((port)*32 + (pin))
-
-// LED
-#define LED_PIN _PINNUM(1, 15)
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN _PINNUM(1, 02)
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 24
-#define UART_TX_PIN 25
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_express/board.mk b/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_express/board.mk
deleted file mode 100755
index f31899eb..00000000
--- a/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_express/board.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-MCU_VARIANT = nrf52840
-CFLAGS += -DNRF52840_XXAA
-
-$(BUILD)/$(PROJECT).zip: $(BUILD)/$(PROJECT).hex
- adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0xFFFE --application $^ $@
-
-# flash using adafruit-nrfutil dfu
-flash: $(BUILD)/$(PROJECT).zip
- @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
- adafruit-nrfutil --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank --touch 1200
diff --git a/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_express/nrf52840_s140_v6.ld b/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_express/nrf52840_s140_v6.ld
deleted file mode 100755
index 5314a4e9..00000000
--- a/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_express/nrf52840_s140_v6.ld
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Linker script to configure memory regions. */
-
-SEARCH_DIR(.)
-GROUP(-lgcc -lc -lnosys)
-
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xED000 - 0x26000
-
- /* SRAM required by S132 depend on
- * - Attribute Table Size
- * - Vendor UUID count
- * - Max ATT MTU
- * - Concurrent connection peripheral + central + secure links
- * - Event Len, HVN queue, Write CMD queue
- */
- RAM (rwx) : ORIGIN = 0x20003400, LENGTH = 0x20040000 - 0x20003400
-}
-
-SECTIONS
-{
- . = ALIGN(4);
- .svc_data :
- {
- PROVIDE(__start_svc_data = .);
- KEEP(*(.svc_data))
- PROVIDE(__stop_svc_data = .);
- } > RAM
-
- .fs_data :
- {
- PROVIDE(__start_fs_data = .);
- KEEP(*(.fs_data))
- PROVIDE(__stop_fs_data = .);
- } > RAM
-} INSERT AFTER .data;
-
-INCLUDE "nrf52_common.ld"
diff --git a/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_sense/board.h b/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_sense/board.h
deleted file mode 100755
index ece6e34c..00000000
--- a/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_sense/board.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define _PINNUM(port, pin) ((port)*32 + (pin))
-
-// LED
-#define LED_PIN _PINNUM(1, 9)
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN _PINNUM(1, 02)
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 24
-#define UART_TX_PIN 25
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_sense/board.mk b/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_sense/board.mk
deleted file mode 100755
index f31899eb..00000000
--- a/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_sense/board.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-MCU_VARIANT = nrf52840
-CFLAGS += -DNRF52840_XXAA
-
-$(BUILD)/$(PROJECT).zip: $(BUILD)/$(PROJECT).hex
- adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0xFFFE --application $^ $@
-
-# flash using adafruit-nrfutil dfu
-flash: $(BUILD)/$(PROJECT).zip
- @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
- adafruit-nrfutil --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank --touch 1200
diff --git a/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_sense/nrf52840_s140_v6.ld b/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_sense/nrf52840_s140_v6.ld
deleted file mode 100755
index 5314a4e9..00000000
--- a/tinyusb/hw/bsp/nrf/boards/feather_nrf52840_sense/nrf52840_s140_v6.ld
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Linker script to configure memory regions. */
-
-SEARCH_DIR(.)
-GROUP(-lgcc -lc -lnosys)
-
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xED000 - 0x26000
-
- /* SRAM required by S132 depend on
- * - Attribute Table Size
- * - Vendor UUID count
- * - Max ATT MTU
- * - Concurrent connection peripheral + central + secure links
- * - Event Len, HVN queue, Write CMD queue
- */
- RAM (rwx) : ORIGIN = 0x20003400, LENGTH = 0x20040000 - 0x20003400
-}
-
-SECTIONS
-{
- . = ALIGN(4);
- .svc_data :
- {
- PROVIDE(__start_svc_data = .);
- KEEP(*(.svc_data))
- PROVIDE(__stop_svc_data = .);
- } > RAM
-
- .fs_data :
- {
- PROVIDE(__start_fs_data = .);
- KEEP(*(.fs_data))
- PROVIDE(__stop_fs_data = .);
- } > RAM
-} INSERT AFTER .data;
-
-INCLUDE "nrf52_common.ld"
diff --git a/tinyusb/hw/bsp/nrf/boards/itsybitsy_nrf52840/board.h b/tinyusb/hw/bsp/nrf/boards/itsybitsy_nrf52840/board.h
deleted file mode 100755
index 132173a8..00000000
--- a/tinyusb/hw/bsp/nrf/boards/itsybitsy_nrf52840/board.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define _PINNUM(port, pin) ((port)*32 + (pin))
-
-// LED
-#define LED_PIN _PINNUM(0, 6)
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN _PINNUM(0, 29)
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 25
-#define UART_TX_PIN 24
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/nrf/boards/itsybitsy_nrf52840/board.mk b/tinyusb/hw/bsp/nrf/boards/itsybitsy_nrf52840/board.mk
deleted file mode 100755
index f31899eb..00000000
--- a/tinyusb/hw/bsp/nrf/boards/itsybitsy_nrf52840/board.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-MCU_VARIANT = nrf52840
-CFLAGS += -DNRF52840_XXAA
-
-$(BUILD)/$(PROJECT).zip: $(BUILD)/$(PROJECT).hex
- adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0xFFFE --application $^ $@
-
-# flash using adafruit-nrfutil dfu
-flash: $(BUILD)/$(PROJECT).zip
- @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
- adafruit-nrfutil --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank --touch 1200
diff --git a/tinyusb/hw/bsp/nrf/boards/itsybitsy_nrf52840/nrf52840_s140_v6.ld b/tinyusb/hw/bsp/nrf/boards/itsybitsy_nrf52840/nrf52840_s140_v6.ld
deleted file mode 100755
index 5314a4e9..00000000
--- a/tinyusb/hw/bsp/nrf/boards/itsybitsy_nrf52840/nrf52840_s140_v6.ld
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Linker script to configure memory regions. */
-
-SEARCH_DIR(.)
-GROUP(-lgcc -lc -lnosys)
-
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xED000 - 0x26000
-
- /* SRAM required by S132 depend on
- * - Attribute Table Size
- * - Vendor UUID count
- * - Max ATT MTU
- * - Concurrent connection peripheral + central + secure links
- * - Event Len, HVN queue, Write CMD queue
- */
- RAM (rwx) : ORIGIN = 0x20003400, LENGTH = 0x20040000 - 0x20003400
-}
-
-SECTIONS
-{
- . = ALIGN(4);
- .svc_data :
- {
- PROVIDE(__start_svc_data = .);
- KEEP(*(.svc_data))
- PROVIDE(__stop_svc_data = .);
- } > RAM
-
- .fs_data :
- {
- PROVIDE(__start_fs_data = .);
- KEEP(*(.fs_data))
- PROVIDE(__stop_fs_data = .);
- } > RAM
-} INSERT AFTER .data;
-
-INCLUDE "nrf52_common.ld"
diff --git a/tinyusb/hw/bsp/nrf/boards/nrf52840_mdk_dongle/board.h b/tinyusb/hw/bsp/nrf/boards/nrf52840_mdk_dongle/board.h
deleted file mode 100755
index 01dd1f24..00000000
--- a/tinyusb/hw/bsp/nrf/boards/nrf52840_mdk_dongle/board.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define _PINNUM(port, pin) ((port)*32 + (pin))
-
-// LED
-#define LED_PIN _PINNUM(0, 23)
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PIN _PINNUM(0, 18)
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 2
-#define UART_TX_PIN 3
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/nrf/boards/nrf52840_mdk_dongle/board.mk b/tinyusb/hw/bsp/nrf/boards/nrf52840_mdk_dongle/board.mk
deleted file mode 100755
index 3afa234a..00000000
--- a/tinyusb/hw/bsp/nrf/boards/nrf52840_mdk_dongle/board.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-MCU_VARIANT = nrf52840
-CFLAGS += -DNRF52840_XXAA
-
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# flash using Nordic nrfutil (pip3 install nrfutil)
-# make BOARD=nrf52840_mdk_dongle SERIAL=/dev/ttyACM0 all flash
-NRFUTIL = nrfutil
-
-$(BUILD)/$(PROJECT).zip: $(BUILD)/$(PROJECT).hex
- $(NRFUTIL) pkg generate --hw-version 52 --sd-req 0x0000 --debug-mode --application $^ $@
-
-flash: $(BUILD)/$(PROJECT).zip
- @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
- $(NRFUTIL) dfu usb-serial --package $^ -p $(SERIAL) -b 115200 \ No newline at end of file
diff --git a/tinyusb/hw/bsp/nrf/boards/nrf52840_mdk_dongle/nrf52840_mdk_dongle.ld b/tinyusb/hw/bsp/nrf/boards/nrf52840_mdk_dongle/nrf52840_mdk_dongle.ld
deleted file mode 100755
index 78eddc9c..00000000
--- a/tinyusb/hw/bsp/nrf/boards/nrf52840_mdk_dongle/nrf52840_mdk_dongle.ld
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Linker script to configure memory regions. */
-
-SEARCH_DIR(.)
-GROUP(-lgcc -lc -lnosys)
-
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x1000, LENGTH = 0xE0000-0x1000
- RAM (rwx) : ORIGIN = 0x20000008, LENGTH = 0x3fff8
-}
-
-
-INCLUDE "nrf_common.ld"
diff --git a/tinyusb/hw/bsp/nrf/boards/pca10056/board.h b/tinyusb/hw/bsp/nrf/boards/pca10056/board.h
deleted file mode 100755
index ab12d21a..00000000
--- a/tinyusb/hw/bsp/nrf/boards/pca10056/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN 13
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PIN 11
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 8
-#define UART_TX_PIN 6
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/nrf/boards/pca10056/board.mk b/tinyusb/hw/bsp/nrf/boards/pca10056/board.mk
deleted file mode 100755
index be2ed331..00000000
--- a/tinyusb/hw/bsp/nrf/boards/pca10056/board.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-MCU_VARIANT = nrf52840
-CFLAGS += -DNRF52840_XXAA
-
-LD_FILE = hw/mcu/nordic/nrfx/mdk/nrf52840_xxaa.ld
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/nrf/boards/pca10059/board.h b/tinyusb/hw/bsp/nrf/boards/pca10059/board.h
deleted file mode 100755
index 0810be64..00000000
--- a/tinyusb/hw/bsp/nrf/boards/pca10059/board.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define _PINNUM(port, pin) ((port)*32 + (pin))
-
-// LED
-#define LED_PIN 8
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PIN _PINNUM(1, 6)
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 8
-#define UART_TX_PIN 6
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/nrf/boards/pca10059/board.mk b/tinyusb/hw/bsp/nrf/boards/pca10059/board.mk
deleted file mode 100755
index 0b82ecdb..00000000
--- a/tinyusb/hw/bsp/nrf/boards/pca10059/board.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-MCU_VARIANT = nrf52840
-CFLAGS += -DNRF52840_XXAA
-
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# flash using Nordic nrfutil (pip2 install nrfutil)
-# make BOARD=pca10059 SERIAL=/dev/ttyACM0 all flash
-NRFUTIL = nrfutil
-
-$(BUILD)/$(PROJECT).zip: $(BUILD)/$(PROJECT).hex
- $(NRFUTIL) pkg generate --hw-version 52 --sd-req 0x0000 --debug-mode --application $^ $@
-
-flash: $(BUILD)/$(PROJECT).zip
- @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
- $(NRFUTIL) dfu usb-serial --package $^ -p $(SERIAL) -b 115200
diff --git a/tinyusb/hw/bsp/nrf/boards/pca10059/pca10059.ld b/tinyusb/hw/bsp/nrf/boards/pca10059/pca10059.ld
deleted file mode 100755
index 510bfdd8..00000000
--- a/tinyusb/hw/bsp/nrf/boards/pca10059/pca10059.ld
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Linker script to configure memory regions. */
-
-SEARCH_DIR(.)
-GROUP(-lgcc -lc -lnosys)
-
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x1000, LENGTH = 0xff000
- RAM (rwx) : ORIGIN = 0x20000008, LENGTH = 0x3fff8
-}
-
-
-INCLUDE "nrf_common.ld"
diff --git a/tinyusb/hw/bsp/nrf/boards/pca10100/board.h b/tinyusb/hw/bsp/nrf/boards/pca10100/board.h
deleted file mode 100755
index 88113303..00000000
--- a/tinyusb/hw/bsp/nrf/boards/pca10100/board.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define _PINNUM(port, pin) ((port)*32 + (pin))
-
-// LED
-#define LED_PIN 13
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PIN 11
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 8
-#define UART_TX_PIN 6
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/nrf/boards/pca10100/board.mk b/tinyusb/hw/bsp/nrf/boards/pca10100/board.mk
deleted file mode 100755
index 5fba269b..00000000
--- a/tinyusb/hw/bsp/nrf/boards/pca10100/board.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-MCU_VARIANT = nrf52833
-CFLAGS += -DNRF52833_XXAA
-
-LD_FILE = hw/mcu/nordic/nrfx/mdk/nrf52833_xxaa.ld
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/nrf/boards/raytac_mdbt50q_rx/board.h b/tinyusb/hw/bsp/nrf/boards/raytac_mdbt50q_rx/board.h
deleted file mode 100755
index dcf829d9..00000000
--- a/tinyusb/hw/bsp/nrf/boards/raytac_mdbt50q_rx/board.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define _PINNUM(port, pin) ((port)*32 + (pin))
-
-// LED
-#define LED_PIN _PINNUM(1, 13)
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PIN _PINNUM(0, 15)
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 25
-#define UART_TX_PIN 24
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/nrf/boards/raytac_mdbt50q_rx/board.mk b/tinyusb/hw/bsp/nrf/boards/raytac_mdbt50q_rx/board.mk
deleted file mode 100755
index be2ed331..00000000
--- a/tinyusb/hw/bsp/nrf/boards/raytac_mdbt50q_rx/board.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-MCU_VARIANT = nrf52840
-CFLAGS += -DNRF52840_XXAA
-
-LD_FILE = hw/mcu/nordic/nrfx/mdk/nrf52840_xxaa.ld
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/nrf/family.c b/tinyusb/hw/bsp/nrf/family.c
deleted file mode 100755
index ed742daa..00000000
--- a/tinyusb/hw/bsp/nrf/family.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "bsp/board.h"
-#include "board.h"
-
-#include "nrfx.h"
-#include "nrfx/hal/nrf_gpio.h"
-#include "nrfx/drivers/include/nrfx_power.h"
-#include "nrfx/drivers/include/nrfx_uarte.h"
-
-#ifdef SOFTDEVICE_PRESENT
-#include "nrf_sdm.h"
-#include "nrf_soc.h"
-#endif
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USBD_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-/*------------------------------------------------------------------*/
-/* MACRO TYPEDEF CONSTANT ENUM
- *------------------------------------------------------------------*/
-
-static nrfx_uarte_t _uart_id = NRFX_UARTE_INSTANCE(0);
-
-// tinyusb function that handles power event (detected, ready, removed)
-// We must call it within SD's SOC event handler, or set it as power event handler if SD is not enabled.
-extern void tusb_hal_nrf_power_event(uint32_t event);
-
-
-// nrf power callback, could be unused if SD is enabled or usb is disabled (board_test example)
-TU_ATTR_UNUSED static void power_event_handler(nrfx_power_usb_evt_t event)
-{
- tusb_hal_nrf_power_event((uint32_t) event);
-}
-
-void board_init(void)
-{
- // stop LF clock just in case we jump from application without reset
- NRF_CLOCK->TASKS_LFCLKSTOP = 1UL;
-
- // Use Internal OSC to compatible with all boards
- NRF_CLOCK->LFCLKSRC = CLOCK_LFCLKSRC_SRC_RC;
- NRF_CLOCK->TASKS_LFCLKSTART = 1UL;
-
- // LED
- nrf_gpio_cfg_output(LED_PIN);
- board_led_write(false);
-
- // Button
- nrf_gpio_cfg_input(BUTTON_PIN, NRF_GPIO_PIN_PULLUP);
-
- // 1ms tick timer
- SysTick_Config(SystemCoreClock/1000);
-
- // UART
- nrfx_uarte_config_t uart_cfg =
- {
- .pseltxd = UART_TX_PIN,
- .pselrxd = UART_RX_PIN,
- .pselcts = NRF_UARTE_PSEL_DISCONNECTED,
- .pselrts = NRF_UARTE_PSEL_DISCONNECTED,
- .p_context = NULL,
- .baudrate = NRF_UARTE_BAUDRATE_115200, // CFG_BOARD_UART_BAUDRATE
- .interrupt_priority = 7,
- .hal_cfg = {
- .hwfc = NRF_UARTE_HWFC_DISABLED,
- .parity = NRF_UARTE_PARITY_EXCLUDED,
- }
- };
-
- nrfx_uarte_init(&_uart_id, &uart_cfg, NULL); //uart_handler);
-
- //------------- USB -------------//
-#if TUSB_OPT_DEVICE_ENABLED
- // Priorities 0, 1, 4 (nRF52) are reserved for SoftDevice
- // 2 is highest for application
- NVIC_SetPriority(USBD_IRQn, 2);
-
- // USB power may already be ready at this time -> no event generated
- // We need to invoke the handler based on the status initially
- uint32_t usb_reg;
-
-#ifdef SOFTDEVICE_PRESENT
- uint8_t sd_en = false;
- sd_softdevice_is_enabled(&sd_en);
-
- if ( sd_en ) {
- sd_power_usbdetected_enable(true);
- sd_power_usbpwrrdy_enable(true);
- sd_power_usbremoved_enable(true);
-
- sd_power_usbregstatus_get(&usb_reg);
- }else
-#endif
- {
- // Power module init
- const nrfx_power_config_t pwr_cfg = { 0 };
- nrfx_power_init(&pwr_cfg);
-
- // Register tusb function as USB power handler
- // cause cast-function-type warning
- const nrfx_power_usbevt_config_t config = { .handler = power_event_handler };
- nrfx_power_usbevt_init(&config);
-
- nrfx_power_usbevt_enable();
-
- usb_reg = NRF_POWER->USBREGSTATUS;
- }
-
- if ( usb_reg & POWER_USBREGSTATUS_VBUSDETECT_Msk ) tusb_hal_nrf_power_event(NRFX_POWER_USB_EVT_DETECTED);
- if ( usb_reg & POWER_USBREGSTATUS_OUTPUTRDY_Msk ) tusb_hal_nrf_power_event(NRFX_POWER_USB_EVT_READY);
-#endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- nrf_gpio_pin_write(LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == nrf_gpio_pin_read(BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-// return NRFX_SUCCESS == nrfx_uart_rx(&_uart_id, buf, (size_t) len) ? len : 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- return (NRFX_SUCCESS == nrfx_uarte_tx(&_uart_id, (uint8_t const*) buf, (size_t) len)) ? len : 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-#ifdef SOFTDEVICE_PRESENT
-// process SOC event from SD
-uint32_t proc_soc(void)
-{
- uint32_t soc_evt;
- uint32_t err = sd_evt_get(&soc_evt);
-
- if (NRF_SUCCESS == err)
- {
- /*------------- usb power event handler -------------*/
- int32_t usbevt = (soc_evt == NRF_EVT_POWER_USB_DETECTED ) ? NRFX_POWER_USB_EVT_DETECTED:
- (soc_evt == NRF_EVT_POWER_USB_POWER_READY) ? NRFX_POWER_USB_EVT_READY :
- (soc_evt == NRF_EVT_POWER_USB_REMOVED ) ? NRFX_POWER_USB_EVT_REMOVED : -1;
-
- if ( usbevt >= 0) tusb_hal_nrf_power_event(usbevt);
- }
-
- return err;
-}
-
-uint32_t proc_ble(void)
-{
- // do nothing with ble
- return NRF_ERROR_NOT_FOUND;
-}
-
-void SD_EVT_IRQHandler(void)
-{
- // process BLE and SOC until there is no more events
- while( (NRF_ERROR_NOT_FOUND != proc_ble()) || (NRF_ERROR_NOT_FOUND != proc_soc()) )
- {
-
- }
-}
-
-void nrf_error_cb(uint32_t id, uint32_t pc, uint32_t info)
-{
- (void) id;
- (void) pc;
- (void) info;
-}
-#endif
diff --git a/tinyusb/hw/bsp/nrf/family.mk b/tinyusb/hw/bsp/nrf/family.mk
deleted file mode 100755
index d1afd258..00000000
--- a/tinyusb/hw/bsp/nrf/family.mk
+++ /dev/null
@@ -1,60 +0,0 @@
-UF2_FAMILY_ID = 0xADA52840
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/nordic/nrfx
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -DCFG_TUSB_MCU=OPT_MCU_NRF5X \
- -DCONFIG_GPIO_AS_PINRESET
-
-# suppress warning caused by vendor mcu driver
-CFLAGS += -Wno-error=undef -Wno-error=unused-parameter -Wno-error=cast-align
-
-# due to tusb_hal_nrf_power_event
-GCCVERSION = $(firstword $(subst ., ,$(shell arm-none-eabi-gcc -dumpversion)))
-ifeq ($(CMDEXE),1)
- ifeq ($(shell if $(GCCVERSION) geq 8 echo 1), 1)
- CFLAGS += -Wno-error=cast-function-type
- endif
-else
- ifeq ($(shell expr $(GCCVERSION) \>= 8), 1)
- CFLAGS += -Wno-error=cast-function-type
- endif
-endif
-
-# All source paths should be relative to the top level.
-LD_FILE ?= hw/bsp/nrf/boards/$(BOARD)/nrf52840_s140_v6.ld
-
-LDFLAGS += -L$(TOP)/hw/mcu/nordic/nrfx/mdk
-
-SRC_C += \
- src/portable/nordic/nrf5x/dcd_nrf5x.c \
- hw/mcu/nordic/nrfx/drivers/src/nrfx_power.c \
- hw/mcu/nordic/nrfx/drivers/src/nrfx_uarte.c \
- hw/mcu/nordic/nrfx/mdk/system_$(MCU_VARIANT).c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/hw/mcu/nordic \
- $(TOP)/hw/mcu/nordic/nrfx \
- $(TOP)/hw/mcu/nordic/nrfx/mdk \
- $(TOP)/hw/mcu/nordic/nrfx/hal \
- $(TOP)/hw/mcu/nordic/nrfx/drivers/include \
- $(TOP)/hw/mcu/nordic/nrfx/drivers/src \
-
-SRC_S += hw/mcu/nordic/nrfx/mdk/gcc_startup_$(MCU_VARIANT).S
-
-ASFLAGS += -D__HEAP_SIZE=0
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# For flash-jlink target
-JLINK_DEVICE = $(MCU_VARIANT)_xxaa
diff --git a/tinyusb/hw/bsp/nutiny_nuc121s/board.mk b/tinyusb/hw/bsp/nutiny_nuc121s/board.mk
deleted file mode 100755
index a0a208ca..00000000
--- a/tinyusb/hw/bsp/nutiny_nuc121s/board.mk
+++ /dev/null
@@ -1,55 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nuvoton
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs-linux \
- -mcpu=cortex-m0 \
- -D__ARM_FEATURE_DSP=0 \
- -DUSE_ASSERT=0 \
- -DCFG_EXAMPLE_MSC_READONLY \
- -DCFG_TUSB_MCU=OPT_MCU_NUC121
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/nuc121_flash.ld
-
-SRC_C += \
- src/portable/nuvoton/nuc121/dcd_nuc121.c \
- hw/mcu/nuvoton/nuc121_125/Device/Nuvoton/NUC121/Source/system_NUC121.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/adc.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/bpwm.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/clk.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/fmc.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/gpio.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/i2c.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/pdma.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/pwm.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/spi_i2s.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/sys.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/timer.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/uart.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/usbd.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/usci_i2c.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/usci_spi.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/usci_uart.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/wdt.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/wwdt.c
-
-SRC_S += \
- hw/mcu/nuvoton/nuc121_125/Device/Nuvoton/NUC121/Source/GCC/startup_NUC121.S
-
-INC += \
- $(TOP)/hw/mcu/nuvoton/nuc121_125/Device/Nuvoton/NUC121/Include \
- $(TOP)/hw/mcu/nuvoton/nuc121_125/StdDriver/inc \
- $(TOP)/hw/mcu/nuvoton/nuc121_125/CMSIS/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
-
-# For flash-jlink target
-JLINK_DEVICE = NUC121SC2AE
-
-# Flash using Nuvoton's openocd fork at https://github.com/OpenNuvoton/OpenOCD-Nuvoton
-# Please compile and install it from github source
-flash: $(BUILD)/$(PROJECT).elf
- openocd -f interface/nulink.cfg -f target/numicroM0.cfg -c "program $< reset exit"
diff --git a/tinyusb/hw/bsp/nutiny_nuc121s/nuc121_flash.ld b/tinyusb/hw/bsp/nutiny_nuc121s/nuc121_flash.ld
deleted file mode 100755
index 3966b276..00000000
--- a/tinyusb/hw/bsp/nutiny_nuc121s/nuc121_flash.ld
+++ /dev/null
@@ -1,195 +0,0 @@
-/* Linker script to configure memory regions. */
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x8000 /* 32k */
- RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x2000 /* 8k */
-}
-
-/* Library configurations */
-GROUP(libgcc.a libc.a libm.a libnosys.a)
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- * Reset_Handler : Entry of reset handler
- *
- * It defines following symbols, which code can use without definition:
- * __exidx_start
- * __exidx_end
- * __copy_table_start__
- * __copy_table_end__
- * __zero_table_start__
- * __zero_table_end__
- * __etext
- * __data_start__
- * __preinit_array_start
- * __preinit_array_end
- * __init_array_start
- * __init_array_end
- * __fini_array_start
- * __fini_array_end
- * __data_end__
- * __bss_start__
- * __bss_end__
- * __end__
- * end
- * __HeapLimit
- * __StackLimit
- * __StackTop
- * __stack
- * __Vectors_End
- * __Vectors_Size
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
- .text :
- {
- KEEP(*(.vectors))
- __Vectors_End = .;
- __Vectors_Size = __Vectors_End - __Vectors;
- __end__ = .;
-
- *(.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 = .;
-
- /* To copy multiple ROM to RAM sections,
- * uncomment .copy.table section and,
- * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
- /*
- .copy.table :
- {
- . = ALIGN(4);
- __copy_table_start__ = .;
- LONG (__etext)
- LONG (__data_start__)
- LONG (__data_end__ - __data_start__)
- LONG (__etext2)
- LONG (__data2_start__)
- LONG (__data2_end__ - __data2_start__)
- __copy_table_end__ = .;
- } > FLASH
- */
-
- /* To clear multiple BSS sections,
- * uncomment .zero.table section and,
- * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
- /*
- .zero.table :
- {
- . = ALIGN(4);
- __zero_table_start__ = .;
- LONG (__bss_start__)
- LONG (__bss_end__ - __bss_start__)
- LONG (__bss2_start__)
- LONG (__bss2_end__ - __bss2_start__)
- __zero_table_end__ = .;
- } > FLASH
- */
-
- __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__ = .;
- end = __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
-
- /* 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/tinyusb/hw/bsp/nutiny_nuc121s/nutiny_nuc121.c b/tinyusb/hw/bsp/nutiny_nuc121s/nutiny_nuc121.c
deleted file mode 100755
index 7117a342..00000000
--- a/tinyusb/hw/bsp/nutiny_nuc121s/nutiny_nuc121.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "bsp/board.h"
-#include "NuMicro.h"
-#include "clk.h"
-#include "sys.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USBD_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-#define LED_PORT PB
-#define LED_PIN 4
-#define LED_PIN_IO PB4
-#define LED_STATE_ON 0
-
-void board_init(void)
-{
- /* Unlock protected registers */
- SYS_UnlockReg();
-
- /*---------------------------------------------------------------------------------------------------------*/
- /* Init System Clock */
- /*---------------------------------------------------------------------------------------------------------*/
-
- /* Enable Internal HIRC 48 MHz clock */
- CLK_EnableXtalRC(CLK_PWRCTL_HIRCEN);
-
- /* Waiting for Internal RC clock ready */
- CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk);
-
- /* Switch HCLK clock source to Internal HIRC and HCLK source divide 1 */
- CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_HIRC, CLK_CLKDIV0_HCLK(1));
-
- /* Enable module clock */
- CLK_EnableModuleClock(USBD_MODULE);
-
- /* Select module clock source */
- CLK_SetModuleClock(USBD_MODULE, CLK_CLKSEL3_USBDSEL_HIRC, CLK_CLKDIV0_USB(1));
-
- /* Enable module clock */
- CLK_EnableModuleClock(USBD_MODULE);
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(48000000 / 1000);
-#endif
-
- // LED
- GPIO_SetMode(LED_PORT, 1 << LED_PIN, GPIO_MODE_OUTPUT);
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- LED_PIN_IO = (state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return 0;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
diff --git a/tinyusb/hw/bsp/nutiny_nuc125s/board.mk b/tinyusb/hw/bsp/nutiny_nuc125s/board.mk
deleted file mode 100755
index bb56e42a..00000000
--- a/tinyusb/hw/bsp/nutiny_nuc125s/board.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nuvoton
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs-linux \
- -mcpu=cortex-m0 \
- -D__ARM_FEATURE_DSP=0 \
- -DUSE_ASSERT=0 \
- -DCFG_EXAMPLE_MSC_READONLY \
- -DCFG_TUSB_MCU=OPT_MCU_NUC121
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/nuc125_flash.ld
-
-SRC_C += \
- src/portable/nuvoton/nuc121/dcd_nuc121.c \
- hw/mcu/nuvoton/nuc121_125/Device/Nuvoton/NUC121/Source/system_NUC121.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/clk.c \
- hw/mcu/nuvoton/nuc121_125/StdDriver/src/gpio.c
-
-SRC_S += \
- hw/mcu/nuvoton/nuc121_125/Device/Nuvoton/NUC121/Source/GCC/startup_NUC121.S
-
-INC += \
- $(TOP)/hw/mcu/nuvoton/nuc121_125/Device/Nuvoton/NUC121/Include \
- $(TOP)/hw/mcu/nuvoton/nuc121_125/StdDriver/inc \
- $(TOP)/hw/mcu/nuvoton/nuc121_125/CMSIS/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
-
-# For flash-jlink target
-JLINK_DEVICE = NUC125SC2AE
-
-# Flash using Nuvoton's openocd fork at https://github.com/OpenNuvoton/OpenOCD-Nuvoton
-# Please compile and install it from github source
-flash: $(BUILD)/$(PROJECT).elf
- openocd -f interface/nulink.cfg -f target/numicroM0.cfg -c "program $< reset exit"
diff --git a/tinyusb/hw/bsp/nutiny_nuc125s/nuc125_flash.ld b/tinyusb/hw/bsp/nutiny_nuc125s/nuc125_flash.ld
deleted file mode 100755
index 3966b276..00000000
--- a/tinyusb/hw/bsp/nutiny_nuc125s/nuc125_flash.ld
+++ /dev/null
@@ -1,195 +0,0 @@
-/* Linker script to configure memory regions. */
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x8000 /* 32k */
- RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x2000 /* 8k */
-}
-
-/* Library configurations */
-GROUP(libgcc.a libc.a libm.a libnosys.a)
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- * Reset_Handler : Entry of reset handler
- *
- * It defines following symbols, which code can use without definition:
- * __exidx_start
- * __exidx_end
- * __copy_table_start__
- * __copy_table_end__
- * __zero_table_start__
- * __zero_table_end__
- * __etext
- * __data_start__
- * __preinit_array_start
- * __preinit_array_end
- * __init_array_start
- * __init_array_end
- * __fini_array_start
- * __fini_array_end
- * __data_end__
- * __bss_start__
- * __bss_end__
- * __end__
- * end
- * __HeapLimit
- * __StackLimit
- * __StackTop
- * __stack
- * __Vectors_End
- * __Vectors_Size
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
- .text :
- {
- KEEP(*(.vectors))
- __Vectors_End = .;
- __Vectors_Size = __Vectors_End - __Vectors;
- __end__ = .;
-
- *(.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 = .;
-
- /* To copy multiple ROM to RAM sections,
- * uncomment .copy.table section and,
- * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
- /*
- .copy.table :
- {
- . = ALIGN(4);
- __copy_table_start__ = .;
- LONG (__etext)
- LONG (__data_start__)
- LONG (__data_end__ - __data_start__)
- LONG (__etext2)
- LONG (__data2_start__)
- LONG (__data2_end__ - __data2_start__)
- __copy_table_end__ = .;
- } > FLASH
- */
-
- /* To clear multiple BSS sections,
- * uncomment .zero.table section and,
- * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
- /*
- .zero.table :
- {
- . = ALIGN(4);
- __zero_table_start__ = .;
- LONG (__bss_start__)
- LONG (__bss_end__ - __bss_start__)
- LONG (__bss2_start__)
- LONG (__bss2_end__ - __bss2_start__)
- __zero_table_end__ = .;
- } > FLASH
- */
-
- __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__ = .;
- end = __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
-
- /* 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/tinyusb/hw/bsp/nutiny_nuc125s/nutiny_nuc125.c b/tinyusb/hw/bsp/nutiny_nuc125s/nutiny_nuc125.c
deleted file mode 100755
index 7117a342..00000000
--- a/tinyusb/hw/bsp/nutiny_nuc125s/nutiny_nuc125.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "bsp/board.h"
-#include "NuMicro.h"
-#include "clk.h"
-#include "sys.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USBD_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-#define LED_PORT PB
-#define LED_PIN 4
-#define LED_PIN_IO PB4
-#define LED_STATE_ON 0
-
-void board_init(void)
-{
- /* Unlock protected registers */
- SYS_UnlockReg();
-
- /*---------------------------------------------------------------------------------------------------------*/
- /* Init System Clock */
- /*---------------------------------------------------------------------------------------------------------*/
-
- /* Enable Internal HIRC 48 MHz clock */
- CLK_EnableXtalRC(CLK_PWRCTL_HIRCEN);
-
- /* Waiting for Internal RC clock ready */
- CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk);
-
- /* Switch HCLK clock source to Internal HIRC and HCLK source divide 1 */
- CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_HIRC, CLK_CLKDIV0_HCLK(1));
-
- /* Enable module clock */
- CLK_EnableModuleClock(USBD_MODULE);
-
- /* Select module clock source */
- CLK_SetModuleClock(USBD_MODULE, CLK_CLKSEL3_USBDSEL_HIRC, CLK_CLKDIV0_USB(1));
-
- /* Enable module clock */
- CLK_EnableModuleClock(USBD_MODULE);
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(48000000 / 1000);
-#endif
-
- // LED
- GPIO_SetMode(LED_PORT, 1 << LED_PIN, GPIO_MODE_OUTPUT);
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- LED_PIN_IO = (state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return 0;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
diff --git a/tinyusb/hw/bsp/nutiny_nuc126v/board.mk b/tinyusb/hw/bsp/nutiny_nuc126v/board.mk
deleted file mode 100755
index 848b19f9..00000000
--- a/tinyusb/hw/bsp/nutiny_nuc126v/board.mk
+++ /dev/null
@@ -1,59 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nuvoton
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs-linux \
- -mcpu=cortex-m0 \
- -D__ARM_FEATURE_DSP=0 \
- -DUSE_ASSERT=0 \
- -D__CORTEX_SC=0 \
- -DCFG_TUSB_MCU=OPT_MCU_NUC126
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/nuc126_flash.ld
-
-SRC_C += \
- src/portable/nuvoton/nuc121/dcd_nuc121.c \
- hw/mcu/nuvoton/nuc126/Device/Nuvoton/NUC126/Source/system_NUC126.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/acmp.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/adc.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/clk.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/crc.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/ebi.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/fmc.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/gpio.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/pdma.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/pwm.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/rtc.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/sc.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/scuart.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/spi.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/sys.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/timer.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/timer_pwm.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/uart.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/usbd.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/usci_spi.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/usci_uart.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/wdt.c \
- hw/mcu/nuvoton/nuc126/StdDriver/src/wwdt.c
-
-SRC_S += \
- hw/mcu/nuvoton/nuc126/Device/Nuvoton/NUC126/Source/GCC/startup_NUC126.S
-
-INC += \
- $(TOP)/hw/mcu/nuvoton/nuc126/Device/Nuvoton/NUC126/Include \
- $(TOP)/hw/mcu/nuvoton/nuc126/StdDriver/inc \
- $(TOP)/hw/mcu/nuvoton/nuc126/CMSIS/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
-
-# For flash-jlink target
-JLINK_DEVICE = NUC126VG4AE
-
-# Flash using Nuvoton's openocd fork at https://github.com/OpenNuvoton/OpenOCD-Nuvoton
-# Please compile and install it from github source
-flash: $(BUILD)/$(PROJECT).elf
- openocd -f interface/nulink.cfg -f target/numicroM0.cfg -c "program $< reset exit"
diff --git a/tinyusb/hw/bsp/nutiny_nuc126v/nuc126_flash.ld b/tinyusb/hw/bsp/nutiny_nuc126v/nuc126_flash.ld
deleted file mode 100755
index b23890b4..00000000
--- a/tinyusb/hw/bsp/nutiny_nuc126v/nuc126_flash.ld
+++ /dev/null
@@ -1,195 +0,0 @@
-/* Linker script to configure memory regions. */
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x40000 /* 256k */
- RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x5000 /* 20k */
-}
-
-/* Library configurations */
-GROUP(libgcc.a libc.a libm.a libnosys.a)
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- * Reset_Handler : Entry of reset handler
- *
- * It defines following symbols, which code can use without definition:
- * __exidx_start
- * __exidx_end
- * __copy_table_start__
- * __copy_table_end__
- * __zero_table_start__
- * __zero_table_end__
- * __etext
- * __data_start__
- * __preinit_array_start
- * __preinit_array_end
- * __init_array_start
- * __init_array_end
- * __fini_array_start
- * __fini_array_end
- * __data_end__
- * __bss_start__
- * __bss_end__
- * __end__
- * end
- * __HeapLimit
- * __StackLimit
- * __StackTop
- * __stack
- * __Vectors_End
- * __Vectors_Size
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
- .text :
- {
- KEEP(*(.vectors))
- __Vectors_End = .;
- __Vectors_Size = __Vectors_End - __Vectors;
- __end__ = .;
-
- *(.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 = .;
-
- /* To copy multiple ROM to RAM sections,
- * uncomment .copy.table section and,
- * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
- /*
- .copy.table :
- {
- . = ALIGN(4);
- __copy_table_start__ = .;
- LONG (__etext)
- LONG (__data_start__)
- LONG (__data_end__ - __data_start__)
- LONG (__etext2)
- LONG (__data2_start__)
- LONG (__data2_end__ - __data2_start__)
- __copy_table_end__ = .;
- } > FLASH
- */
-
- /* To clear multiple BSS sections,
- * uncomment .zero.table section and,
- * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
- /*
- .zero.table :
- {
- . = ALIGN(4);
- __zero_table_start__ = .;
- LONG (__bss_start__)
- LONG (__bss_end__ - __bss_start__)
- LONG (__bss2_start__)
- LONG (__bss2_end__ - __bss2_start__)
- __zero_table_end__ = .;
- } > FLASH
- */
-
- __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__ = .;
- end = __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
-
- /* 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/tinyusb/hw/bsp/nutiny_nuc126v/nutiny_nuc126.c b/tinyusb/hw/bsp/nutiny_nuc126v/nutiny_nuc126.c
deleted file mode 100755
index da62e7bd..00000000
--- a/tinyusb/hw/bsp/nutiny_nuc126v/nutiny_nuc126.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "bsp/board.h"
-#include "NuMicro.h"
-#include "clk.h"
-#include "sys.h"
-
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USBD_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-#define LED_PORT PC
-#define LED_PIN 9
-#define LED_PIN_IO PC9
-#define LED_STATE_ON 0
-
-#define CRYSTAL_LESS /* system will be 48MHz when defined, otherwise, system is 72MHz */
-#define HIRC48_AUTO_TRIM SYS_IRCTCTL1_REFCKSEL_Msk | (1UL << SYS_IRCTCTL1_LOOPSEL_Pos) | (2UL << SYS_IRCTCTL1_FREQSEL_Pos)
-#define TRIM_INIT (SYS_BASE+0x118)
-
-void board_init(void)
-{
- /* Unlock protected registers */
- SYS_UnlockReg();
-
- /*---------------------------------------------------------------------------------------------------------*/
- /* Init System Clock */
- /*---------------------------------------------------------------------------------------------------------*/
-
- /* Enable Internal RC 22.1184 MHz clock */
- CLK_EnableXtalRC(CLK_PWRCTL_HIRCEN_Msk);
-
- /* Waiting for Internal RC clock ready */
- CLK_WaitClockReady(CLK_STATUS_HIRCSTB_Msk);
-
- /* Switch HCLK clock source to Internal RC and HCLK source divide 1 */
- CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_HIRC, CLK_CLKDIV0_HCLK(1));
-
-#ifndef CRYSTAL_LESS
- /* Enable external XTAL 12 MHz clock */
- CLK_EnableXtalRC(CLK_PWRCTL_HXTEN_Msk);
-
- /* Waiting for external XTAL clock ready */
- CLK_WaitClockReady(CLK_STATUS_HXTSTB_Msk);
-
- /* Set core clock */
- CLK_SetCoreClock(72000000);
-
- /* Use HIRC as UART clock source */
- CLK_SetModuleClock(UART0_MODULE, CLK_CLKSEL1_UARTSEL_HIRC, CLK_CLKDIV0_UART(1));
-
- /* Use PLL as USB clock source */
- CLK_SetModuleClock(USBD_MODULE, CLK_CLKSEL3_USBDSEL_PLL, CLK_CLKDIV0_USB(3));
-
-#else
- /* Enable Internal RC 48MHz clock */
- CLK_EnableXtalRC(CLK_PWRCTL_HIRC48EN_Msk);
-
- /* Waiting for Internal RC clock ready */
- CLK_WaitClockReady(CLK_STATUS_HIRC48STB_Msk);
-
- /* Switch HCLK clock source to Internal RC and HCLK source divide 1 */
- CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_HIRC48, CLK_CLKDIV0_HCLK(1));
-
- /* Use HIRC as UART clock source */
- CLK_SetModuleClock(UART0_MODULE, CLK_CLKSEL1_UARTSEL_HIRC, CLK_CLKDIV0_UART(1));
-
- /* Use HIRC48 as USB clock source */
- CLK_SetModuleClock(USBD_MODULE, CLK_CLKSEL3_USBDSEL_HIRC48, CLK_CLKDIV0_USB(1));
-#endif
-
- /* Enable module clock */
- CLK_EnableModuleClock(USBD_MODULE);
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(48000000 / 1000);
-#endif
-
- // LED
- GPIO_SetMode(LED_PORT, 1 << LED_PIN, GPIO_MODE_OUTPUT);
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- LED_PIN_IO = (state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return 0;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
diff --git a/tinyusb/hw/bsp/nutiny_sdk_nuc120/board.mk b/tinyusb/hw/bsp/nutiny_sdk_nuc120/board.mk
deleted file mode 100755
index 90b3e91f..00000000
--- a/tinyusb/hw/bsp/nutiny_sdk_nuc120/board.mk
+++ /dev/null
@@ -1,55 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nuvoton
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs-linux \
- -mcpu=cortex-m0 \
- -DCFG_EXAMPLE_MSC_READONLY \
- -DCFG_TUSB_MCU=OPT_MCU_NUC120
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/nutiny_sdk_nuc120/nuc120_flash.ld
-
-SRC_C += \
- src/portable/nuvoton/nuc120/dcd_nuc120.c \
- hw/mcu/nuvoton/nuc100_120/Device/Nuvoton/NUC100Series/Source/system_NUC100Series.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/acmp.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/adc.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/clk.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/crc.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/fmc.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/gpio.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/i2c.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/i2s.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/pdma.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/ps2.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/pwm.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/rtc.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/sc.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/spi.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/sys.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/timer.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/uart.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/usbd.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/wdt.c \
- hw/mcu/nuvoton/nuc100_120/StdDriver/src/wwdt.c
-
-SRC_S += \
- hw/mcu/nuvoton/nuc100_120/Device/Nuvoton/NUC100Series/Source/GCC/startup_NUC100Series.S
-
-INC += \
- $(TOP)/hw/mcu/nuvoton/nuc100_120/Device/Nuvoton/NUC100Series/Include \
- $(TOP)/hw/mcu/nuvoton/nuc100_120/StdDriver/inc \
- $(TOP)/hw/mcu/nuvoton/nuc100_120/CMSIS/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
-
-# For flash-jlink target
-JLINK_DEVICE = NUC120LE3
-
-# Flash using Nuvoton's openocd fork at https://github.com/OpenNuvoton/OpenOCD-Nuvoton
-# Please compile and install it from github source
-flash: $(BUILD)/$(PROJECT).elf
- openocd -f interface/nulink.cfg -f target/numicroM0.cfg -c "program $< reset exit"
diff --git a/tinyusb/hw/bsp/nutiny_sdk_nuc120/nuc120_flash.ld b/tinyusb/hw/bsp/nutiny_sdk_nuc120/nuc120_flash.ld
deleted file mode 100755
index cab12c8b..00000000
--- a/tinyusb/hw/bsp/nutiny_sdk_nuc120/nuc120_flash.ld
+++ /dev/null
@@ -1,195 +0,0 @@
-/* Linker script to configure memory regions. */
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x20000 /* 128k */
- RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x4000 /* 16k */
-}
-
-/* Library configurations */
-GROUP(libgcc.a libc.a libm.a libnosys.a)
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- * Reset_Handler : Entry of reset handler
- *
- * It defines following symbols, which code can use without definition:
- * __exidx_start
- * __exidx_end
- * __copy_table_start__
- * __copy_table_end__
- * __zero_table_start__
- * __zero_table_end__
- * __etext
- * __data_start__
- * __preinit_array_start
- * __preinit_array_end
- * __init_array_start
- * __init_array_end
- * __fini_array_start
- * __fini_array_end
- * __data_end__
- * __bss_start__
- * __bss_end__
- * __end__
- * end
- * __HeapLimit
- * __StackLimit
- * __StackTop
- * __stack
- * __Vectors_End
- * __Vectors_Size
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
- .text :
- {
- KEEP(*(.vectors))
- __Vectors_End = .;
- __Vectors_Size = __Vectors_End - __Vectors;
- __end__ = .;
-
- *(.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 = .;
-
- /* To copy multiple ROM to RAM sections,
- * uncomment .copy.table section and,
- * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
- /*
- .copy.table :
- {
- . = ALIGN(4);
- __copy_table_start__ = .;
- LONG (__etext)
- LONG (__data_start__)
- LONG (__data_end__ - __data_start__)
- LONG (__etext2)
- LONG (__data2_start__)
- LONG (__data2_end__ - __data2_start__)
- __copy_table_end__ = .;
- } > FLASH
- */
-
- /* To clear multiple BSS sections,
- * uncomment .zero.table section and,
- * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
- /*
- .zero.table :
- {
- . = ALIGN(4);
- __zero_table_start__ = .;
- LONG (__bss_start__)
- LONG (__bss_end__ - __bss_start__)
- LONG (__bss2_start__)
- LONG (__bss2_end__ - __bss2_start__)
- __zero_table_end__ = .;
- } > FLASH
- */
-
- __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__ = .;
- end = __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
-
- /* 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/tinyusb/hw/bsp/nutiny_sdk_nuc120/nutiny_sdk_nuc120.c b/tinyusb/hw/bsp/nutiny_sdk_nuc120/nutiny_sdk_nuc120.c
deleted file mode 100755
index 0d78116b..00000000
--- a/tinyusb/hw/bsp/nutiny_sdk_nuc120/nutiny_sdk_nuc120.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "bsp/board.h"
-#include "NUC100Series.h"
-#include "clk.h"
-#include "sys.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USBD_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-#define LED_PORT PB
-#define LED_PIN 0
-#define LED_PIN_IO PB0
-#define LED_STATE_ON 0
-
-void board_init(void)
-{
- SYS_UnlockReg();
-
- /* Enable Internal RC 22.1184 MHz clock */
- CLK_EnableXtalRC(CLK_PWRCON_OSC22M_EN_Msk);
-
- /* Waiting for Internal RC clock ready */
- CLK_WaitClockReady(CLK_CLKSTATUS_OSC22M_STB_Msk);
-
- /* Switch HCLK clock source to Internal RC and HCLK source divide 1 */
- CLK_SetHCLK(CLK_CLKSEL0_HCLK_S_HIRC, CLK_CLKDIV_HCLK(1));
-
- /* Enable external XTAL 12 MHz clock */
- CLK_EnableXtalRC(CLK_PWRCON_XTL12M_EN_Msk);
-
- /* Waiting for external XTAL clock ready */
- CLK_WaitClockReady(CLK_CLKSTATUS_XTL12M_STB_Msk);
-
- /* Set core clock */
- CLK_SetCoreClock(48000000);
-
- /* Enable module clock */
- CLK_EnableModuleClock(USBD_MODULE);
-
- /* Select module clock source */
- CLK_SetModuleClock(USBD_MODULE, 0, CLK_CLKDIV_USB(1));
-
- SYS_LockReg();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(48000000 / 1000);
-#endif
-
- GPIO_SetMode(LED_PORT, 1UL << LED_PIN, GPIO_PMD_OUTPUT);
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
-#if 0
- /* this would be the simplest solution... *IF* the part supported the pin data interface */
- LED_PIN_IO = (state) ? LED_STATE_ON : (1-LED_STATE_ON);
-#else
- /* if the part's *PDIO pin data registers don't work, a more elaborate approach is needed */
- uint32_t irq_state = __get_PRIMASK();
- __disable_irq();
- uint32_t current = LED_PORT->DOUT & ~(1UL << LED_PIN);
- LED_PORT->DOUT = current | (((state) ? LED_STATE_ON : (1UL-LED_STATE_ON)) << LED_PIN);
- __set_PRIMASK(irq_state);
-#endif
-}
-
-uint32_t board_button_read(void)
-{
- return 0;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
diff --git a/tinyusb/hw/bsp/nutiny_sdk_nuc505/board.mk b/tinyusb/hw/bsp/nutiny_sdk_nuc505/board.mk
deleted file mode 100755
index e8514347..00000000
--- a/tinyusb/hw/bsp/nutiny_sdk_nuc505/board.mk
+++ /dev/null
@@ -1,60 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/nuvoton
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs-linux \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -DCFG_TUSB_MCU=OPT_MCU_NUC505
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/nuc505_flashtoram.ld
-
-SRC_C += \
- src/portable/nuvoton/nuc505/dcd_nuc505.c \
- hw/mcu/nuvoton/nuc505/Device/Nuvoton/NUC505Series/Source/system_NUC505Series.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/adc.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/clk.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/gpio.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/i2c.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/i2s.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/pwm.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/rtc.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/spi.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/spim.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/sys.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/timer.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/uart.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/wdt.c \
- hw/mcu/nuvoton/nuc505/StdDriver/src/wwdt.c
-
-SRC_S += \
- hw/mcu/nuvoton/nuc505/Device/Nuvoton/NUC505Series/Source/GCC/startup_NUC505Series.S
-
-INC += \
- $(TOP)/hw/mcu/nuvoton/nuc505/Device/Nuvoton/NUC505Series/Include \
- $(TOP)/hw/mcu/nuvoton/nuc505/StdDriver/inc \
- $(TOP)/hw/mcu/nuvoton/nuc505/CMSIS/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# For flash-jlink target
-JLINK_DEVICE = NUC505YO13Y
-
-# Note
-# To be able to program the SPI flash, it need to boot with ICP mode "1011".
-# However, in ICP mode, opencod cannot establish connection to the mcu.
-# Therefore, there is no easy command line flash for NUC505
-# It is probably better to just use Nuvoton NuMicro ICP programming on windows to program the board
-# - 1111 "SPI" (run from internal flash)
-# - 1110 "USB" (mass storage emulator that accepts a .bin file)
-# - 0111 "ICE-SPI" (allow external debugger access, but may not be programmable)
-# - 1011 ICP mode (programmable via NuMicro ICP programming tool)
-
-# Flash using Nuvoton's openocd fork at https://github.com/OpenNuvoton/OpenOCD-Nuvoton
-# Please compile and install it from github source
-flash: $(BUILD)/$(PROJECT).elf
- openocd -f interface/nulink.cfg -f target/numicroM4.cfg -c "program $< reset exit"
diff --git a/tinyusb/hw/bsp/nutiny_sdk_nuc505/nuc505_flashtoram.ld b/tinyusb/hw/bsp/nutiny_sdk_nuc505/nuc505_flashtoram.ld
deleted file mode 100755
index 53d385cd..00000000
--- a/tinyusb/hw/bsp/nutiny_sdk_nuc505/nuc505_flashtoram.ld
+++ /dev/null
@@ -1,199 +0,0 @@
-/* Linker script to configure memory regions. */
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x80000 /* 512k */
- RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000 /* 128k */
-}
-
-/* Library configurations */
-GROUP(libgcc.a libc.a libm.a libnosys.a)
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- * Reset_Handler : Entry of reset handler
- *
- * It defines following symbols, which code can use without definition:
- * __exidx_start
- * __exidx_end
- * __copy_table_start__
- * __copy_table_end__
- * __zero_table_start__
- * __zero_table_end__
- * __etext
- * __data_start__
- * __preinit_array_start
- * __preinit_array_end
- * __init_array_start
- * __init_array_end
- * __fini_array_start
- * __fini_array_end
- * __data_end__
- * __bss_start__
- * __bss_end__
- * __end__
- * end
- * __HeapLimit
- * __StackLimit
- * __StackTop
- * __stack
- * __Vectors_End
- * __Vectors_Size
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
- .startup :
- {
- KEEP(*(.vectors))
- __Vectors_End = .;
- __Vectors_Size = __Vectors_End - __Vectors;
- __end__ = .;
-
- KEEP(*(.preinit))
-
- KEEP(*(.init))
- KEEP(*(.fini))
-
- } > FLASH
-
- .ARM.extab :
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- } > FLASH
-
- __exidx_start = .;
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > FLASH
- __exidx_end = .;
-
- /* To copy multiple ROM to RAM sections,
- * uncomment .copy.table section and,
- * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
- /*
- .copy.table :
- {
- . = ALIGN(4);
- __copy_table_start__ = .;
- LONG (__etext)
- LONG (__data_start__)
- LONG (__data_end__ - __data_start__)
- LONG (__etext2)
- LONG (__data2_start__)
- LONG (__data2_end__ - __data2_start__)
- __copy_table_end__ = .;
- } > FLASH
- */
-
- /* To clear multiple BSS sections,
- * uncomment .zero.table section and,
- * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
- /*
- .zero.table :
- {
- . = ALIGN(4);
- __zero_table_start__ = .;
- LONG (__bss_start__)
- LONG (__bss_end__ - __bss_start__)
- LONG (__bss2_start__)
- LONG (__bss2_end__ - __bss2_start__)
- __zero_table_end__ = .;
- } > FLASH
- */
-
- __etext = .;
-
- .data : AT (__etext)
- {
- __data_start__ = .;
-
- *(.text*)
-
- /* .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*))
-
- *(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__ = .;
- end = __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
-
- /* 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/tinyusb/hw/bsp/nutiny_sdk_nuc505/nutiny_sdk_nuc505.c b/tinyusb/hw/bsp/nutiny_sdk_nuc505/nutiny_sdk_nuc505.c
deleted file mode 100755
index 49e66d2d..00000000
--- a/tinyusb/hw/bsp/nutiny_sdk_nuc505/nutiny_sdk_nuc505.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "bsp/board.h"
-#include "NUC505Series.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USBD_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-#define LED_PORT PC
-#define LED_PIN 3
-#define LED_STATE_ON 0
-
-void board_init(void)
-{
- /* Enable XTAL */
- CLK->PWRCTL |= CLK_PWRCTL_HXTEN_Msk;
-
- CLK_SetCoreClock(96000000);
-
- /* Set PCLK divider */
- CLK_SetModuleClock(PCLK_MODULE, 0, 1);
-
- /* Update System Core Clock */
- SystemCoreClockUpdate();
-
- /* Enable USB IP clock */
- CLK_EnableModuleClock(USBD_MODULE);
-
- /* Select USB IP clock source */
- CLK_SetModuleClock(USBD_MODULE, CLK_USBD_SRC_EXT, 0);
-
- CLK_SetModuleClock(PCLK_MODULE, 0, 1);
-
- /* Enable PHY */
- USBD_ENABLE_PHY();
- /* wait PHY clock ready */
- while (1) {
- USBD->EP[EPA].EPMPS = 0x20;
- if (USBD->EP[EPA].EPMPS == 0x20)
- break;
- }
-
- /* Force SE0, and then clear it to connect*/
- USBD_SET_SE0();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(96000000 / 1000);
-#endif
-
- GPIO_SetMode(LED_PORT, 1UL << LED_PIN, GPIO_MODE_OUTPUT);
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- uint32_t current = (state) ? LED_STATE_ON : (1-LED_STATE_ON);
- current <<= LED_PIN;
- uint32_t irq_state = __get_PRIMASK();
- __disable_irq();
- current |= LED_PORT->DOUT & ~(1UL << LED_PIN);
- LED_PORT->DOUT = current;
- __set_PRIMASK(irq_state);
-}
-
-uint32_t board_button_read(void)
-{
- return 0;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
diff --git a/tinyusb/hw/bsp/rp2040/board.h b/tinyusb/hw/bsp/rp2040/board.h
deleted file mode 100755
index 237f29dc..00000000
--- a/tinyusb/hw/bsp/rp2040/board.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#ifdef PICO_DEFAULT_LED_PIN
-#define LED_PIN PICO_DEFAULT_LED_PIN
-#define LED_STATE_ON (!(PICO_DEFAULT_LED_PIN_INVERTED))
-#endif
-
-// Button pin is BOOTSEL which is flash CS pin
-#define BUTTON_BOOTSEL
-#define BUTTON_STATE_ACTIVE 0
-
-#if defined(PICO_DEFAULT_UART_TX_PIN) && defined(PICO_DEFAULT_UART_RX_PIN) && defined(PICO_DEFAULT_UART)
-#define UART_DEV PICO_DEFAULT_UART
-#define UART_TX_PIN PICO_DEFAULT_UART_TX_PIN
-#define UART_RX_PIN PICO_DEFAULT_UART_RX_PIN
-#endif
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/rp2040/boards/adafruit_feather_rp2040/board.cmake b/tinyusb/hw/bsp/rp2040/boards/adafruit_feather_rp2040/board.cmake
deleted file mode 100755
index e527a8ce..00000000
--- a/tinyusb/hw/bsp/rp2040/boards/adafruit_feather_rp2040/board.cmake
+++ /dev/null
@@ -1 +0,0 @@
-set(PICO_BOARD adafruit_feather_rp2040) \ No newline at end of file
diff --git a/tinyusb/hw/bsp/rp2040/boards/adafruit_itsybitsy_rp2040/board.cmake b/tinyusb/hw/bsp/rp2040/boards/adafruit_itsybitsy_rp2040/board.cmake
deleted file mode 100755
index 3fd2dd06..00000000
--- a/tinyusb/hw/bsp/rp2040/boards/adafruit_itsybitsy_rp2040/board.cmake
+++ /dev/null
@@ -1 +0,0 @@
-set(PICO_BOARD adafruit_itsybitsy_rp2040) \ No newline at end of file
diff --git a/tinyusb/hw/bsp/rp2040/boards/adafruit_qtpy_rp2040/board.cmake b/tinyusb/hw/bsp/rp2040/boards/adafruit_qtpy_rp2040/board.cmake
deleted file mode 100755
index 469929c5..00000000
--- a/tinyusb/hw/bsp/rp2040/boards/adafruit_qtpy_rp2040/board.cmake
+++ /dev/null
@@ -1 +0,0 @@
-set(PICO_BOARD adafruit_qtpy_rp2040) \ No newline at end of file
diff --git a/tinyusb/hw/bsp/rp2040/boards/pico_sdk/board.cmake b/tinyusb/hw/bsp/rp2040/boards/pico_sdk/board.cmake
deleted file mode 100755
index d57cbe52..00000000
--- a/tinyusb/hw/bsp/rp2040/boards/pico_sdk/board.cmake
+++ /dev/null
@@ -1 +0,0 @@
-# This builds with settings based purely on the current PICO_BOARD set via the SDK
diff --git a/tinyusb/hw/bsp/rp2040/boards/raspberry_pi_pico/board.cmake b/tinyusb/hw/bsp/rp2040/boards/raspberry_pi_pico/board.cmake
deleted file mode 100755
index 8280c835..00000000
--- a/tinyusb/hw/bsp/rp2040/boards/raspberry_pi_pico/board.cmake
+++ /dev/null
@@ -1 +0,0 @@
-set(PICO_BOARD pico) \ No newline at end of file
diff --git a/tinyusb/hw/bsp/rp2040/family.c b/tinyusb/hw/bsp/rp2040/family.c
deleted file mode 100755
index 10ead277..00000000
--- a/tinyusb/hw/bsp/rp2040/family.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "pico/stdlib.h"
-#include "pico/binary_info.h"
-#include "hardware/gpio.h"
-#include "hardware/sync.h"
-#include "hardware/structs/ioqspi.h"
-#include "hardware/structs/sio.h"
-
-#include "bsp/board.h"
-#include "board.h"
-
-#ifdef BUTTON_BOOTSEL
-// This example blinks the Picoboard LED when the BOOTSEL button is pressed.
-//
-// Picoboard has a button attached to the flash CS pin, which the bootrom
-// checks, and jumps straight to the USB bootcode if the button is pressed
-// (pulling flash CS low). We can check this pin in by jumping to some code in
-// SRAM (so that the XIP interface is not required), floating the flash CS
-// pin, and observing whether it is pulled low.
-//
-// This doesn't work if others are trying to access flash at the same time,
-// e.g. XIP streamer, or the other core.
-bool __no_inline_not_in_flash_func(get_bootsel_button)() {
- const uint CS_PIN_INDEX = 1;
-
- // Must disable interrupts, as interrupt handlers may be in flash, and we
- // are about to temporarily disable flash access!
- uint32_t flags = save_and_disable_interrupts();
-
- // Set chip select to Hi-Z
- hw_write_masked(&ioqspi_hw->io[CS_PIN_INDEX].ctrl,
- GPIO_OVERRIDE_LOW << IO_QSPI_GPIO_QSPI_SS_CTRL_OEOVER_LSB,
- IO_QSPI_GPIO_QSPI_SS_CTRL_OEOVER_BITS);
-
- // Note we can't call into any sleep functions in flash right now
- for (volatile int i = 0; i < 1000; ++i);
-
- // The HI GPIO registers in SIO can observe and control the 6 QSPI pins.
- // Note the button pulls the pin *low* when pressed.
- bool button_state = (sio_hw->gpio_hi_in & (1u << CS_PIN_INDEX));
-
- // Need to restore the state of chip select, else we are going to have a
- // bad time when we return to code in flash!
- hw_write_masked(&ioqspi_hw->io[CS_PIN_INDEX].ctrl,
- GPIO_OVERRIDE_NORMAL << IO_QSPI_GPIO_QSPI_SS_CTRL_OEOVER_LSB,
- IO_QSPI_GPIO_QSPI_SS_CTRL_OEOVER_BITS);
-
- restore_interrupts(flags);
-
- return button_state;
-}
-#endif
-
-//------------- Segger RTT retarget -------------//
-#if defined(LOGGER_RTT)
-
-// Logging with RTT
-// - If RTT Control Block is not found by 'Auto Detection` try to use 'Search Range` with '0x20000000 0x10000'
-// - SWD speed is rather slow around 1000Khz
-
-#include "pico/stdio/driver.h"
-#include "SEGGER_RTT.h"
-
-static void stdio_rtt_write (const char *buf, int length)
-{
- SEGGER_RTT_Write(0, buf, length);
-}
-
-static int stdio_rtt_read (char *buf, int len)
-{
- return SEGGER_RTT_Read(0, buf, len);
-}
-
-static stdio_driver_t stdio_rtt =
-{
- .out_chars = stdio_rtt_write,
- .out_flush = NULL,
- .in_chars = stdio_rtt_read
-};
-
-void stdio_rtt_init(void)
-{
- stdio_set_driver_enabled(&stdio_rtt, true);
-}
-
-#endif
-
-#ifdef UART_DEV
-static uart_inst_t *uart_inst;
-#endif
-
-void board_init(void)
-{
-#ifdef LED_PIN
- bi_decl(bi_1pin_with_name(LED_PIN, "LED"));
- gpio_init(LED_PIN);
- gpio_set_dir(LED_PIN, GPIO_OUT);
-#endif
-
- // Button
-#ifndef BUTTON_BOOTSEL
-#endif
-
-#if defined(UART_DEV) && defined(LIB_PICO_STDIO_UART)
- bi_decl(bi_2pins_with_func(UART_TX_PIN, UART_TX_PIN, GPIO_FUNC_UART));
- uart_inst = uart_get_instance(UART_DEV);
- stdio_uart_init_full(uart_inst, CFG_BOARD_UART_BAUDRATE, UART_TX_PIN, UART_RX_PIN);
-#endif
-
-#if defined(LOGGER_RTT)
- stdio_rtt_init();
-#endif
-
- // todo probably set up device mode?
-#if TUSB_OPT_DEVICE_ENABLED
-
-#endif
-
-#if TUSB_OPT_HOST_ENABLED
- // set portfunc to host !!!
-#endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
-#ifdef LED_PIN
- gpio_put(LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-#endif
-}
-
-uint32_t board_button_read(void)
-{
-#ifdef BUTTON_BOOTSEL
- return BUTTON_STATE_ACTIVE == get_bootsel_button();
-#else
- return 0;
-#endif
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
-#ifdef UART_DEV
- for(int i=0;i<len;i++) {
- buf[i] = uart_getc(uart_inst);
- }
- return len;
-#else
- return 0;
-#endif
-}
-
-int board_uart_write(void const * buf, int len)
-{
-#ifdef UART_DEV
- char const* bufch = (char const*) buf;
- for(int i=0;i<len;i++) {
- uart_putc(uart_inst, bufch[i]);
- }
- return len;
-#else
- return 0;
-#endif
-}
-
-//--------------------------------------------------------------------+
-// USB Interrupt Handler
-// rp2040 implementation will install approriate handler when initializing
-// tinyusb. There is no need to forward IRQ from application
-//--------------------------------------------------------------------+
diff --git a/tinyusb/hw/bsp/rp2040/family.cmake b/tinyusb/hw/bsp/rp2040/family.cmake
deleted file mode 100755
index 41960b6c..00000000
--- a/tinyusb/hw/bsp/rp2040/family.cmake
+++ /dev/null
@@ -1,154 +0,0 @@
-cmake_minimum_required(VERSION 3.13)
-if (NOT TARGET _rp2040_family_inclusion_marker)
- add_library(_rp2040_family_inclusion_marker INTERFACE)
-
- if (NOT BOARD)
- message("BOARD not specified, defaulting to pico_sdk")
- set(BOARD pico_sdk)
- endif()
-
- # add the SDK in case we are standalone tinyusb example (noop if already present)
- include(${CMAKE_CURRENT_LIST_DIR}/pico_sdk_import.cmake)
-
- # include basic family CMake functionality
- set(FAMILY_MCUS RP2040)
-
- include(${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake)
-
- # TOP is absolute path to root directory of TinyUSB git repo
- set(TOP "${CMAKE_CURRENT_LIST_DIR}/../../..")
- get_filename_component(TOP "${TOP}" REALPATH)
-
- if (NOT PICO_TINYUSB_PATH)
- set(PICO_TINYUSB_PATH ${TOP})
- endif()
-
- # Base config for both device and host; wrapped by SDK's tinyusb_common
- add_library(tinyusb_common_base INTERFACE)
-
- target_sources(tinyusb_common_base INTERFACE
- ${TOP}/src/tusb.c
- ${TOP}/src/common/tusb_fifo.c
- )
-
- target_include_directories(tinyusb_common_base INTERFACE
- ${TOP}/src
- ${TOP}/src/common
- ${TOP}/hw
- )
-
- target_link_libraries(tinyusb_common_base INTERFACE
- hardware_structs
- hardware_irq
- hardware_resets
- pico_sync
- )
-
- set(TINYUSB_DEBUG_LEVEL 0)
- if (CMAKE_BUILD_TYPE STREQUAL "Debug")
- message("Compiling TinyUSB with CFG_TUSB_DEBUG=1")
- set(TINYUSB_DEBUG_LEVEL 1)
- endif ()
-
- target_compile_definitions(tinyusb_common_base INTERFACE
- CFG_TUSB_MCU=OPT_MCU_RP2040
- CFG_TUSB_OS=OPT_OS_PICO
- CFG_TUSB_DEBUG=${TINYUSB_DEBUG_LEVEL}
- )
-
- # Base config for device mode; wrapped by SDK's tinyusb_device
- add_library(tinyusb_device_base INTERFACE)
- target_sources(tinyusb_device_base INTERFACE
- ${TOP}/src/portable/raspberrypi/rp2040/dcd_rp2040.c
- ${TOP}/src/portable/raspberrypi/rp2040/rp2040_usb.c
- ${TOP}/src/device/usbd.c
- ${TOP}/src/device/usbd_control.c
- ${TOP}/src/class/audio/audio_device.c
- ${TOP}/src/class/cdc/cdc_device.c
- ${TOP}/src/class/dfu/dfu_device.c
- ${TOP}/src/class/dfu/dfu_rt_device.c
- ${TOP}/src/class/hid/hid_device.c
- ${TOP}/src/class/midi/midi_device.c
- ${TOP}/src/class/msc/msc_device.c
- ${TOP}/src/class/net/net_device.c
- ${TOP}/src/class/usbtmc/usbtmc_device.c
- ${TOP}/src/class/vendor/vendor_device.c
- )
-
-
- # Base config for host mode; wrapped by SDK's tinyusb_host
- add_library(tinyusb_host_base INTERFACE)
- target_sources(tinyusb_host_base INTERFACE
- ${TOP}/src/portable/raspberrypi/rp2040/hcd_rp2040.c
- ${TOP}/src/portable/raspberrypi/rp2040/rp2040_usb.c
- ${TOP}/src/host/usbh.c
- ${TOP}/src/host/usbh_control.c
- ${TOP}/src/host/hub.c
- ${TOP}/src/class/cdc/cdc_host.c
- ${TOP}/src/class/hid/hid_host.c
- ${TOP}/src/class/msc/msc_host.c
- ${TOP}/src/class/vendor/vendor_host.c
- )
-
- # Sometimes have to do host specific actions in mostly
- # common functions
- target_compile_definitions(tinyusb_host_base INTERFACE
- RP2040_USB_HOST_MODE=1
- )
-
- add_library(tinyusb_bsp INTERFACE)
- target_sources(tinyusb_bsp INTERFACE
- ${TOP}/hw/bsp/rp2040/family.c
- )
-# target_include_directories(tinyusb_bsp INTERFACE
-# ${TOP}/hw/bsp/rp2040)
-
- # tinyusb_additions will hold our extra settings for examples
- add_library(tinyusb_additions INTERFACE)
-
- target_compile_definitions(tinyusb_additions INTERFACE
- PICO_RP2040_USB_DEVICE_ENUMERATION_FIX=1
- )
-
- if(DEFINED LOG)
- target_compile_definitions(tinyusb_additions INTERFACE CFG_TUSB_DEBUG=${LOG} )
- endif()
-
- if(LOGGER STREQUAL "rtt")
- target_compile_definitions(tinyusb_additions INTERFACE
- LOGGER_RTT
- SEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
- )
-
- target_sources(tinyusb_additions INTERFACE
- ${TOP}/lib/SEGGER_RTT/RTT/SEGGER_RTT.c
- )
-
- target_include_directories(tinyusb_additions INTERFACE
- ${TOP}/lib/SEGGER_RTT/RTT
- )
- endif()
-
- function(family_configure_target TARGET)
- pico_add_extra_outputs(${TARGET})
- pico_enable_stdio_uart(${TARGET} 1)
- target_link_libraries(${TARGET} PUBLIC pico_stdlib pico_bootsel_via_double_reset tinyusb_board tinyusb_additions)
- endfunction()
-
- function(family_configure_device_example TARGET)
- family_configure_target(${TARGET})
- target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_device)
- endfunction()
-
- function(family_configure_host_example TARGET)
- family_configure_target(${TARGET})
- target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_host)
- endfunction()
-
- function(family_initialize_project PROJECT DIR)
- # call the original version of this function from family_common.cmake
- _family_initialize_project(${PROJECT} ${DIR})
- enable_language(C CXX ASM)
- pico_sdk_init()
- endfunction()
-endif()
diff --git a/tinyusb/hw/bsp/rp2040/family.mk b/tinyusb/hw/bsp/rp2040/family.mk
deleted file mode 100755
index 5db784b1..00000000
--- a/tinyusb/hw/bsp/rp2040/family.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-JLINK_DEVICE = rp2040_m0_0
-PYOCD_TARGET = rp2040
-
-ifeq ($(DEBUG), 1)
-CMAKE_DEFSYM += -DCMAKE_BUILD_TYPE=Debug
-endif
-
-$(BUILD):
- cmake -S . -B $(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) -DPICO_BUILD_DOCS=0 $(CMAKE_DEFSYM)
-
-all: $(BUILD)
- $(MAKE) -C $(BUILD)
-
-clean:
- $(RM) -rf $(BUILD)
-
-flash: flash-pyocd
-flash-uf2:
- @$(CP) $(BUILD)/$(PROJECT).uf2 /media/$(USER)/RPI-RP2
diff --git a/tinyusb/hw/bsp/rp2040/pico_sdk_import.cmake b/tinyusb/hw/bsp/rp2040/pico_sdk_import.cmake
deleted file mode 100755
index 28efe9ea..00000000
--- a/tinyusb/hw/bsp/rp2040/pico_sdk_import.cmake
+++ /dev/null
@@ -1,62 +0,0 @@
-# This is a copy of <PICO_SDK_PATH>/external/pico_sdk_import.cmake
-
-# This can be dropped into an external project to help locate this SDK
-# It should be include()ed prior to project()
-
-if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH))
- set(PICO_SDK_PATH $ENV{PICO_SDK_PATH})
- message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')")
-endif ()
-
-if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT} AND (NOT PICO_SDK_FETCH_FROM_GIT))
- set(PICO_SDK_FETCH_FROM_GIT $ENV{PICO_SDK_FETCH_FROM_GIT})
- message("Using PICO_SDK_FETCH_FROM_GIT from environment ('${PICO_SDK_FETCH_FROM_GIT}')")
-endif ()
-
-if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_PATH))
- set(PICO_SDK_FETCH_FROM_GIT_PATH $ENV{PICO_SDK_FETCH_FROM_GIT_PATH})
- message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')")
-endif ()
-
-set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK")
-set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of SDK from git if not otherwise locatable")
-set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK")
-
-if (NOT PICO_SDK_PATH)
- if (PICO_SDK_FETCH_FROM_GIT)
- include(FetchContent)
- set(FETCHCONTENT_BASE_DIR_SAVE ${FETCHCONTENT_BASE_DIR})
- if (PICO_SDK_FETCH_FROM_GIT_PATH)
- get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
- endif ()
- FetchContent_Declare(
- pico_sdk
- GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
- GIT_TAG master
- )
- if (NOT pico_sdk)
- message("Downloading Raspberry Pi Pico SDK")
- FetchContent_Populate(pico_sdk)
- set(PICO_SDK_PATH ${pico_sdk_SOURCE_DIR})
- endif ()
- set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE})
- else ()
- message(FATAL_ERROR
- "SDK location was not specified. Please set PICO_SDK_PATH or set PICO_SDK_FETCH_FROM_GIT to on to fetch from git."
- )
- endif ()
-endif ()
-
-get_filename_component(PICO_SDK_PATH "${PICO_SDK_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
-if (NOT EXISTS ${PICO_SDK_PATH})
- message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' not found")
-endif ()
-
-set(PICO_SDK_INIT_CMAKE_FILE ${PICO_SDK_PATH}/pico_sdk_init.cmake)
-if (NOT EXISTS ${PICO_SDK_INIT_CMAKE_FILE})
- message(FATAL_ERROR "Directory '${PICO_SDK_PATH}' does not appear to contain the Raspberry Pi Pico SDK")
-endif ()
-
-set(PICO_SDK_PATH ${PICO_SDK_PATH} CACHE PATH "Path to the Raspberry Pi Pico SDK" FORCE)
-
-include(${PICO_SDK_INIT_CMAKE_FILE})
diff --git a/tinyusb/hw/bsp/rx/boards/gr_citrus/board.mk b/tinyusb/hw/bsp/rx/boards/gr_citrus/board.mk
deleted file mode 100755
index 0eba9461..00000000
--- a/tinyusb/hw/bsp/rx/boards/gr_citrus/board.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/renesas/rx
-
-CFLAGS += \
- -mcpu=rx610 \
- -misa=v1 \
- -DCFG_TUSB_MCU=OPT_MCU_RX63X
-
-MCU_DIR = hw/mcu/renesas/rx/rx63n
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/r5f5631fd.ld
-
-# For freeRTOS port source
-FREERTOS_PORT = RX600
-
-# For flash-jlink target
-JLINK_DEVICE = R5F5631F
-JLINK_IF = JTAG
-
-# For flash-pyocd target
-PYOCD_TARGET =
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/rx/boards/gr_citrus/gr_citrus.c b/tinyusb/hw/bsp/rx/boards/gr_citrus/gr_citrus.c
deleted file mode 100755
index caf5fd6f..00000000
--- a/tinyusb/hw/bsp/rx/boards/gr_citrus/gr_citrus.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Koji Kitayama
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/* How to connect JLink and GR-CITRUS
- *
- * GR-CITRUS needs to solder some pads to enable JTAG interface.
- * - Short the following pads individually with solder.
- * - J4
- * - J5
- * - Short EMLE pad and 3.3V(GR-CITRUS pin name) with a wire.
- *
- * The pads are [the back side of GR-CITRUS](https://www.slideshare.net/MinaoYamamoto/grcitrusrx631/2).
- *
- * Connect the pins between GR-CITRUS and JLink as follows.
- *
- * | Function | GR-CITRUS pin | JLink pin No.| note |
- * |:---------:|:-------------:|:------------:|:--------:|
- * | VTref | 3.3V | 1 | |
- * | TRST | 5 | 3 | |
- * | GND | GND | 4 | |
- * | TDI | 3 | 5 | |
- * | TMS | 2 | 7 | |
- * | TCK/FINEC | 14 | 9 | short J4 |
- * | TDO | 9 | 13 | short J5 |
- * | nRES | RST | 15 | |
- *
- * JLink firmware needs to update to V6.96 or newer version to avoid
- * [a bug](https://forum.segger.com/index.php/Thread/7758-SOLVED-Bug-in-JLink-from-V6-88b-regarding-RX65N)
- * regarding downloading.
- */
-
-#include "../board.h"
-#include "iodefine.h"
-#include "interrupt_handlers.h"
-
-#define IRQ_PRIORITY_CMT0 5
-#define IRQ_PRIORITY_USBI0 6
-#define IRQ_PRIORITY_SCI0 5
-
-#define SYSTEM_PRCR_PRC1 (1<<1)
-#define SYSTEM_PRCR_PRKEY (0xA5u<<8)
-
-#define CMT_PCLK 48000000
-#define CMT_CMCR_CKS_DIV_128 2
-#define CMT_CMCR_CMIE (1<<6)
-#define MPC_PFS_ISEL (1<<6)
-
-#define SCI_PCLK 48000000
-#define SCI_SSR_FER (1<<4)
-#define SCI_SSR_ORER (1<<5)
-
-#define SCI_SCR_TEIE (1u<<2)
-#define SCI_SCR_RE (1u<<4)
-#define SCI_SCR_TE (1u<<5)
-#define SCI_SCR_RIE (1u<<6)
-#define SCI_SCR_TIE (1u<<7)
-
-//--------------------------------------------------------------------+
-// SCI0 handling
-//--------------------------------------------------------------------+
-typedef struct {
- uint8_t *buf;
- uint32_t cnt;
-} sci_buf_t;
-static volatile sci_buf_t sci0_buf[2];
-
-void INT_Excep_SCI0_TXI0(void)
-{
- uint8_t *buf = sci0_buf[0].buf;
- uint32_t cnt = sci0_buf[0].cnt;
-
- if (!buf || !cnt) {
- SCI0.SCR.BYTE &= ~(SCI_SCR_TEIE | SCI_SCR_TE | SCI_SCR_TIE);
- return;
- }
- SCI0.TDR = *buf;
- if (--cnt) {
- ++buf;
- } else {
- buf = NULL;
- SCI0.SCR.BIT.TIE = 0;
- SCI0.SCR.BIT.TEIE = 1;
- }
- sci0_buf[0].buf = buf;
- sci0_buf[0].cnt = cnt;
-}
-
-void INT_Excep_SCI0_TEI0(void)
-{
- SCI0.SCR.BYTE &= ~(SCI_SCR_TEIE | SCI_SCR_TE | SCI_SCR_TIE);
-}
-
-void INT_Excep_SCI0_RXI0(void)
-{
- uint8_t *buf = sci0_buf[1].buf;
- uint32_t cnt = sci0_buf[1].cnt;
-
- if (!buf || !cnt ||
- (SCI0.SSR.BYTE & (SCI_SSR_FER | SCI_SSR_ORER))) {
- sci0_buf[1].buf = NULL;
- SCI0.SSR.BYTE = 0;
- SCI0.SCR.BYTE &= ~(SCI_SCR_RE | SCI_SCR_RIE);
- return;
- }
- *buf = SCI0.RDR;
- if (--cnt) {
- ++buf;
- } else {
- buf = NULL;
- SCI0.SCR.BYTE &= ~(SCI_SCR_RE | SCI_SCR_RIE);
- }
- sci0_buf[1].buf = buf;
- sci0_buf[1].cnt = cnt;
-}
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void INT_Excep_USB0_USBI0(void)
-{
- tud_int_handler(0);
-}
-
-void board_init(void)
-{
-#if CFG_TUSB_OS == OPT_OS_NONE
- /* Enable CMT0 */
- SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY | SYSTEM_PRCR_PRC1;
- MSTP(CMT0) = 0;
- SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY;
- /* Setup 1ms tick timer */
- CMT0.CMCNT = 0;
- CMT0.CMCOR = CMT_PCLK / 1000 / 128;
- CMT0.CMCR.WORD = CMT_CMCR_CMIE | CMT_CMCR_CKS_DIV_128;
- IR(CMT0, CMI0) = 0;
- IPR(CMT0, CMI0) = IRQ_PRIORITY_CMT0;
- IEN(CMT0, CMI0) = 1;
- CMT.CMSTR0.BIT.STR0 = 1;
-#endif
-
- /* Unlock MPC registers */
- MPC.PWPR.BIT.B0WI = 0;
- MPC.PWPR.BIT.PFSWE = 1;
- /* LED PA0 */
- PORTA.PMR.BIT.B0 = 0U;
- PORTA.PODR.BIT.B0 = 0U;
- PORTA.PDR.BIT.B0 = 1U;
- /* UART TXD0 => P20, RXD0 => P21 */
- PORT2.PMR.BIT.B0 = 1U;
- PORT2.PCR.BIT.B0 = 1U;
- MPC.P20PFS.BYTE = 0b01010;
- PORT2.PMR.BIT.B1 = 1U;
- MPC.P21PFS.BYTE = 0b01010;
- /* USB VBUS -> P16 DPUPE -> P14 */
- PORT1.PMR.BIT.B4 = 1U;
- PORT1.PMR.BIT.B6 = 1U;
- MPC.P14PFS.BYTE = 0b10001;
- MPC.P16PFS.BYTE = MPC_PFS_ISEL | 0b10001;
- MPC.PFUSB0.BIT.PUPHZS = 1;
- /* Lock MPC registers */
- MPC.PWPR.BIT.PFSWE = 0;
- MPC.PWPR.BIT.B0WI = 1;
-
- IR(USB0, USBI0) = 0;
- IPR(USB0, USBI0) = IRQ_PRIORITY_USBI0;
-
- /* Enable SCI0 */
- SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY | SYSTEM_PRCR_PRC1;
- MSTP(SCI0) = 0;
- SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY;
- SCI0.BRR = (SCI_PCLK / (32 * 115200)) - 1;
- IR(SCI0, RXI0) = 0;
- IR(SCI0, TXI0) = 0;
- IR(SCI0, TEI0) = 0;
- IPR(SCI0, RXI0) = IRQ_PRIORITY_SCI0;
- IPR(SCI0, TXI0) = IRQ_PRIORITY_SCI0;
- IPR(SCI0, TEI0) = IRQ_PRIORITY_SCI0;
- IEN(SCI0, RXI0) = 1;
- IEN(SCI0, TXI0) = 1;
- IEN(SCI0, TEI0) = 1;
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- PORTA.PODR.BIT.B0 = state ? 1 : 0;
-}
-
-uint32_t board_button_read(void)
-{
- return 0;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- sci0_buf[1].buf = buf;
- sci0_buf[1].cnt = len;
- SCI0.SCR.BYTE |= SCI_SCR_RE | SCI_SCR_RIE;
- while (SCI0.SCR.BIT.RE) ;
- return len - sci0_buf[1].cnt;
-}
-
-int board_uart_write(void const *buf, int len)
-{
- sci0_buf[0].buf = (uint8_t*)buf;
- sci0_buf[0].cnt = len;
- SCI0.SCR.BYTE |= SCI_SCR_TE | SCI_SCR_TIE;
- while (SCI0.SCR.BIT.TE) ;
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void INT_Excep_CMT0_CMI0(void)
-{
- ++system_ticks;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#else
-uint32_t SystemCoreClock = 96000000;
-#endif
-
-int close(int fd)
-{
- (void)fd;
- return -1;
-}
-int fstat(int fd, void *pstat)
-{
- (void)fd;
- (void)pstat;
- return 0;
-}
-off_t lseek(int fd, off_t pos, int whence)
-{
- (void)fd;
- (void)pos;
- (void)whence;
- return 0;
-}
-int isatty(int fd)
-{
- (void)fd;
- return 1;
-}
diff --git a/tinyusb/hw/bsp/rx/boards/gr_citrus/hwinit.c b/tinyusb/hw/bsp/rx/boards/gr_citrus/hwinit.c
deleted file mode 100755
index 8245d774..00000000
--- a/tinyusb/hw/bsp/rx/boards/gr_citrus/hwinit.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/************************************************************************/
-/* File Version: V1.00 */
-/* Date Generated: 08/07/2013 */
-/************************************************************************/
-
-#include "iodefine.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern void HardwareSetup(void);
-#ifdef __cplusplus
-}
-#endif
-
-void HardwareSetup(void)
-{
- SYSTEM.PRCR.WORD = 0xA503u;
- SYSTEM.SOSCCR.BYTE = 0x01u;
- SYSTEM.MOSCWTCR.BYTE = 0x0Du;
- SYSTEM.PLLWTCR.BYTE = 0x0Eu;
- SYSTEM.PLLCR.WORD = 0x0F00u;
- SYSTEM.MOSCCR.BYTE = 0x00u;
- SYSTEM.PLLCR2.BYTE = 0x00u;
- for (unsigned i = 0; i < 2075u; ++i) __asm("nop");
- SYSTEM.SCKCR.LONG = 0x21021211u;
- SYSTEM.SCKCR2.WORD = 0x0033u;
- SYSTEM.SCKCR3.WORD = 0x0400u;
- SYSTEM.SYSCR0.WORD = 0x5A01;
- SYSTEM.MSTPCRB.BIT.MSTPB15 = 0;
- SYSTEM.PRCR.WORD = 0xA500u;
-}
diff --git a/tinyusb/hw/bsp/rx/boards/gr_citrus/r5f5631fd.ld b/tinyusb/hw/bsp/rx/boards/gr_citrus/r5f5631fd.ld
deleted file mode 100755
index bb9c297c..00000000
--- a/tinyusb/hw/bsp/rx/boards/gr_citrus/r5f5631fd.ld
+++ /dev/null
@@ -1,127 +0,0 @@
-__USTACK_SIZE = 0x00000400;
-__ISTACK_SIZE = 0x00000400;
-
-MEMORY
-{
- RAM : ORIGIN = 0x4, LENGTH = 0x3fffc
- ROM : ORIGIN = 0xFFE00000, LENGTH = 0x200000
-}
-SECTIONS
-{
- .fvectors 0xFFFFFF80: AT(0xFFFFFF80)
- {
- KEEP(*(.fvectors))
- } > ROM
- .text 0xFFE00000: AT(0xFFE00000)
- {
- *(.text)
- *(.text.*)
- *(P)
- etext = .;
- } > ROM
- .rvectors ALIGN(4):
- {
- _rvectors_start = .;
- KEEP(*(.rvectors))
- _rvectors_end = .;
- } > ROM
- .init :
- {
- KEEP(*(.init))
- __preinit_array_start = .;
- KEEP(*(.preinit_array))
- __preinit_array_end = .;
- __init_array_start = (. + 3) & ~ 3;
- KEEP(*(.init_array))
- KEEP(*(SORT(.init_array.*)))
- __init_array_end = .;
- __fini_array_start = .;
- KEEP(*(.fini_array))
- KEEP(*(SORT(.fini_array.*)))
- __fini_array_end = .;
- } > ROM
- .fini :
- {
- KEEP(*(.fini))
- } > ROM
- .got :
- {
- *(.got)
- *(.got.plt)
- } > ROM
- .rodata :
- {
- *(.rodata)
- *(.rodata.*)
- *(C_1)
- *(C_2)
- *(C)
- _erodata = .;
- } > ROM
- .eh_frame_hdr :
- {
- *(.eh_frame_hdr)
- } > ROM
- .eh_frame :
- {
- *(.eh_frame)
- } > ROM
- .jcr :
- {
- *(.jcr)
- } > ROM
- .tors :
- {
- __CTOR_LIST__ = .;
- . = ALIGN(2);
- ___ctors = .;
- *(.ctors)
- ___ctors_end = .;
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- ___dtors = .;
- *(.dtors)
- ___dtors_end = .;
- __DTOR_END__ = .;
- . = ALIGN(2);
- _mdata = .;
- } > ROM
- .data : AT(_mdata)
- {
- _data = .;
- *(.data)
- *(.data.*)
- *(D)
- *(D_1)
- *(D_2)
- _edata = .;
- } > RAM
- .gcc_exc :
- {
- *(.gcc_exc)
- } > RAM
- .bss :
- {
- _bss = .;
- *(.bss)
- *(.bss.**)
- *(COMMON)
- *(B)
- *(B_1)
- *(B_2)
- _ebss = .;
- _end = .;
- } > RAM
- .ustack :
- {
- . = ALIGN(8);
- . = . + __USTACK_SIZE;
- PROVIDE(_ustack = .);
- } > RAM
- .istack :
- {
- . = ALIGN(8);
- . = . + __ISTACK_SIZE;
- PROVIDE(_istack = .);
- } > RAM
-}
diff --git a/tinyusb/hw/bsp/rx/boards/rx65n_target/board.mk b/tinyusb/hw/bsp/rx/boards/rx65n_target/board.mk
deleted file mode 100755
index fc76d79f..00000000
--- a/tinyusb/hw/bsp/rx/boards/rx65n_target/board.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-CFLAGS += \
- -mcpu=rx64m \
- -misa=v2 \
- -DCFG_TUSB_MCU=OPT_MCU_RX65X \
- -DIR_USB0_USBI0=IR_PERIB_INTB185 \
- -DIER_USB0_USBI0=IER_PERIB_INTB185 \
- -DIEN_USB0_USBI0=IEN_PERIB_INTB185
-
-MCU_DIR = hw/mcu/renesas/rx/rx65n
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/r5f565ne.ld
-
-# For freeRTOS port source
-FREERTOS_PORT = RX600
-
-# For flash-jlink target
-JLINK_DEVICE = R5F565NE
-JLINK_IF = JTAG
-
-# For flash-pyocd target
-PYOCD_TARGET =
-
-# flash using rfp-cli
-flash: flash-rfp
diff --git a/tinyusb/hw/bsp/rx/boards/rx65n_target/r5f565ne.ld b/tinyusb/hw/bsp/rx/boards/rx65n_target/r5f565ne.ld
deleted file mode 100755
index 8e5617f2..00000000
--- a/tinyusb/hw/bsp/rx/boards/rx65n_target/r5f565ne.ld
+++ /dev/null
@@ -1,168 +0,0 @@
-__USTACK_SIZE = 0x00000400;
-__ISTACK_SIZE = 0x00000400;
-
-MEMORY
-{
- RAM : ORIGIN = 0x4, LENGTH = 0x3fffc
- RAM2 : ORIGIN = 0x00800000, LENGTH = 0x60000
- OFS : ORIGIN = 0xFE7F5D00, LENGTH = 128
- ROM : ORIGIN = 0xFFE00000, LENGTH = 0x200000
-}
-SECTIONS
-{
- .exvectors 0xFFFFFF80: AT(0xFFFFFF80)
- {
- "_exvectors_start" = .;
- KEEP(*(.exvectors))
- "_exvectors_end" = .;
- } >ROM
- .fvectors 0xFFFFFFFC: AT(0xFFFFFFFC)
- {
- KEEP(*(.fvectors))
- } > ROM
- .text 0xFFE00000: AT(0xFFE00000)
- {
- *(.text)
- *(.text.*)
- *(P)
- KEEP(*(.text.*_isr))
- etext = .;
- } > ROM
- .rvectors ALIGN(4):
- {
- _rvectors_start = .;
- KEEP(*(.rvectors))
- _rvectors_end = .;
- } > ROM
- .init :
- {
- KEEP(*(.init))
- __preinit_array_start = .;
- KEEP(*(.preinit_array))
- __preinit_array_end = .;
- __init_array_start = (. + 3) & ~ 3;
- KEEP(*(.init_array))
- KEEP(*(SORT(.init_array.*)))
- __init_array_end = .;
- __fini_array_start = .;
- KEEP(*(.fini_array))
- KEEP(*(SORT(.fini_array.*)))
- __fini_array_end = .;
- } > ROM
- .fini :
- {
- KEEP(*(.fini))
- } > ROM
- .got :
- {
- *(.got)
- *(.got.plt)
- } > ROM
- .rodata :
- {
- *(.rodata)
- *(.rodata.*)
- *(C_1)
- *(C_2)
- *(C)
- _erodata = .;
- } > ROM
- .eh_frame_hdr :
- {
- *(.eh_frame_hdr)
- } > ROM
- .eh_frame :
- {
- *(.eh_frame)
- } > ROM
- .jcr :
- {
- *(.jcr)
- } > ROM
- .tors :
- {
- __CTOR_LIST__ = .;
- . = ALIGN(2);
- ___ctors = .;
- *(.ctors)
- ___ctors_end = .;
- __CTOR_END__ = .;
- __DTOR_LIST__ = .;
- ___dtors = .;
- *(.dtors)
- ___dtors_end = .;
- __DTOR_END__ = .;
- . = ALIGN(2);
- _mdata = .;
- } > ROM
- .data : AT(_mdata)
- {
- _data = .;
- *(.data)
- *(.data.*)
- *(D)
- *(D_1)
- *(D_2)
- _edata = .;
- } > RAM
- .gcc_exc :
- {
- *(.gcc_exc)
- } > RAM
- .bss :
- {
- _bss = .;
- *(.bss)
- *(.bss.**)
- *(COMMON)
- *(B)
- *(B_1)
- *(B_2)
- _ebss = .;
- _end = .;
- } > RAM
- .ustack :
- {
- . = ALIGN(8);
- . = . + __USTACK_SIZE;
- PROVIDE(_ustack = .);
- } > RAM
- .istack :
- {
- . = ALIGN(8);
- . = . + __ISTACK_SIZE;
- PROVIDE(_istack = .);
- } > RAM
- .ofs1 0xFE7F5D00: AT(0xFE7F5D00)
- {
- KEEP(*(.ofs1))
- } > OFS
- .ofs2 0xFE7F5D10: AT(0xFE7F5D10)
- {
- KEEP(*(.ofs2))
- } > OFS
- .ofs3 0xFE7F5D20: AT(0xFE7F5D20)
- {
- KEEP(*(.ofs3))
- } > OFS
- .ofs4 0xFE7F5D40: AT(0xFE7F5D40)
- {
- KEEP(*(.ofs4))
- } > OFS
- .ofs5 0xFE7F5D48: AT(0xFE7F5D48)
- {
- KEEP(*(.ofs5))
- } > OFS
- .ofs6 0xFE7F5D50: AT(0xFE7F5D50)
- {
- KEEP(*(.ofs6))
- } > OFS
- .ofs7 0xFE7F5D64: AT(0xFE7F5D64)
- {
- KEEP(*(.ofs7))
- } > OFS
- .ofs8 0xFE7F5D70: AT(0xFE7F5D70)
- {
- KEEP(*(.ofs8))
- } > OFS
-}
diff --git a/tinyusb/hw/bsp/rx/boards/rx65n_target/rx65n_target.c b/tinyusb/hw/bsp/rx/boards/rx65n_target/rx65n_target.c
deleted file mode 100755
index 20867455..00000000
--- a/tinyusb/hw/bsp/rx/boards/rx65n_target/rx65n_target.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Koji Kitayama
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/* How to connect JLink and RX65n Target and option board
- * (For original comment https://github.com/hathach/tinyusb/pull/922#issuecomment-869786131)
- *
- * To enable JTAG, RX65N requires following connections on main board.
- * - short EJ2 jumper header, to disable onboard E2L.
- * - short EMLE(J1-2) and 3V3(J1-14 or J2-10), to enable In-Circuit Emulator.
- *
- * Note: For RX65N-Cloud-Kit, the option board's JTAG pins to some switches or floating.
- * To use JLink with the option board, I think some further modifications will be necessary.
- *
- * | Function | RX65N pin | main board | option board | JLink connector |
- * |:---------:|:----------:|:----------:|:------------:|:---------------:|
- * | 3V3 | VCC | J1-14 | CN5-6 | 1 |
- * | TRST | P34 | J1-16 | CN5-7 | 3 |
- * | GND | VSS | J1-12 | CN5-5 | 4 |
- * | TDI | P30 | J1-20 | CN5-10 | 5 |
- * | TMS | P31 | J1-19 | USER_SW | 7 |
- * | TCK/FINEC | P27 | J1-21 | N/A | 9 |
- * | TDO | P26 | J1-22 | CN5-9 | 13 |
- * | nRES | RES# | J1-10 | RESET_SW | 15 |
- *
- * JLink firmware needs to update to V6.96 or newer version to avoid
- * [a bug](https://forum.segger.com/index.php/Thread/7758-SOLVED-Bug-in-JLink-from-V6-88b-regarding-RX65N)
- * regarding downloading.
- */
-
-#include "bsp/board.h"
-#include "iodefine.h"
-#include "interrupt_handlers.h"
-
-#define IRQ_PRIORITY_CMT0 5
-#define IRQ_PRIORITY_USBI0 6
-#define IRQ_PRIORITY_SCI5 5
-
-#define SYSTEM_PRCR_PRC1 (1<<1)
-#define SYSTEM_PRCR_PRKEY (0xA5u<<8)
-
-#define CMT_PCLK 60000000
-#define CMT_CMCR_CKS_DIV_128 2
-#define CMT_CMCR_CMIE (1<<6)
-#define MPC_PFS_ISEL (1<<6)
-
-#define SCI_PCLK 60000000
-#define SCI_SSR_FER (1<<4)
-#define SCI_SSR_ORER (1<<5)
-
-#define SCI_SCR_TEIE (1u<<2)
-#define SCI_SCR_RE (1u<<4)
-#define SCI_SCR_TE (1u<<5)
-#define SCI_SCR_RIE (1u<<6)
-#define SCI_SCR_TIE (1u<<7)
-#define INT_Excep_SCI5_TEI5 INT_Excep_ICU_GROUPBL0
-
-#define IRQ_USB0_USBI0 62
-#define SLIBR_USBI0 SLIBR185
-#define IPR_USB0_USBI0 IPR_PERIB_INTB185
-#define INT_Excep_USB0_USBI0 INT_Excep_PERIB_INTB185
-
-void HardwareSetup(void)
-{
- FLASH.ROMCIV.WORD = 1;
- while (FLASH.ROMCIV.WORD) ;
- FLASH.ROMCE.WORD = 1;
- while (!FLASH.ROMCE.WORD) ;
-
- SYSTEM.PRCR.WORD = 0xA503u;
- if (!SYSTEM.RSTSR1.BYTE) {
- RTC.RCR4.BYTE = 0;
- RTC.RCR3.BYTE = 12;
- while (12 != RTC.RCR3.BYTE) ;
- }
- SYSTEM.SOSCCR.BYTE = 1;
-
- if (SYSTEM.HOCOCR.BYTE) {
- SYSTEM.HOCOCR.BYTE = 0;
- while (!SYSTEM.OSCOVFSR.BIT.HCOVF) ;
- }
- SYSTEM.PLLCR.WORD = 0x1D10u; /* HOCO x 15 */
- SYSTEM.PLLCR2.BYTE = 0;
- while (!SYSTEM.OSCOVFSR.BIT.PLOVF) ;
-
- SYSTEM.SCKCR.LONG = 0x21C11222u;
- SYSTEM.SCKCR2.WORD = 0x0041u;
- SYSTEM.ROMWT.BYTE = 0x02u;
- while (0x02u != SYSTEM.ROMWT.BYTE) ;
- SYSTEM.SCKCR3.WORD = 0x400u;
- SYSTEM.PRCR.WORD = 0xA500u;
-}
-
-//--------------------------------------------------------------------+
-// SCI handling
-//--------------------------------------------------------------------+
-typedef struct {
- uint8_t *buf;
- uint32_t cnt;
-} sci_buf_t;
-static volatile sci_buf_t sci_buf[2];
-
-void INT_Excep_SCI5_TXI5(void)
-{
- uint8_t *buf = sci_buf[0].buf;
- uint32_t cnt = sci_buf[0].cnt;
-
- if (!buf || !cnt) {
- SCI5.SCR.BYTE &= ~(SCI_SCR_TEIE | SCI_SCR_TE | SCI_SCR_TIE);
- return;
- }
- SCI5.TDR = *buf;
- if (--cnt) {
- ++buf;
- } else {
- buf = NULL;
- SCI5.SCR.BIT.TIE = 0;
- SCI5.SCR.BIT.TEIE = 1;
- }
- sci_buf[0].buf = buf;
- sci_buf[0].cnt = cnt;
-}
-
-void INT_Excep_SCI5_TEI5(void)
-{
- SCI5.SCR.BYTE &= ~(SCI_SCR_TEIE | SCI_SCR_TE | SCI_SCR_TIE);
-}
-
-void INT_Excep_SCI5_RXI5(void)
-{
- uint8_t *buf = sci_buf[1].buf;
- uint32_t cnt = sci_buf[1].cnt;
-
- if (!buf || !cnt ||
- (SCI5.SSR.BYTE & (SCI_SSR_FER | SCI_SSR_ORER))) {
- sci_buf[1].buf = NULL;
- SCI5.SSR.BYTE = 0;
- SCI5.SCR.BYTE &= ~(SCI_SCR_RE | SCI_SCR_RIE);
- return;
- }
- *buf = SCI5.RDR;
- if (--cnt) {
- ++buf;
- } else {
- buf = NULL;
- SCI5.SCR.BYTE &= ~(SCI_SCR_RE | SCI_SCR_RIE);
- }
- sci_buf[1].buf = buf;
- sci_buf[1].cnt = cnt;
-}
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void INT_Excep_USB0_USBI0(void)
-{
- tud_int_handler(0);
-}
-
-void board_init(void)
-{
- /* setup software configurable interrupts */
- ICU.SLIBR_USBI0.BYTE = IRQ_USB0_USBI0;
- ICU.SLIPRCR.BYTE = 1;
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- /* Enable CMT0 */
- SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY | SYSTEM_PRCR_PRC1;
- MSTP(CMT0) = 0;
- SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY;
- /* Setup 1ms tick timer */
- CMT0.CMCNT = 0;
- CMT0.CMCOR = CMT_PCLK / 1000 / 128;
- CMT0.CMCR.WORD = CMT_CMCR_CMIE | CMT_CMCR_CKS_DIV_128;
- IR(CMT0, CMI0) = 0;
- IPR(CMT0, CMI0) = IRQ_PRIORITY_CMT0;
- IEN(CMT0, CMI0) = 1;
- CMT.CMSTR0.BIT.STR0 = 1;
-#endif
-
- /* Unlock MPC registers */
- MPC.PWPR.BIT.B0WI = 0;
- MPC.PWPR.BIT.PFSWE = 1;
- // SW PB1
- PORTB.PMR.BIT.B1 = 0U;
- PORTB.PDR.BIT.B1 = 0U;
- // LED PD6
- PORTD.PODR.BIT.B6 = 1U;
- PORTD.ODR1.BIT.B4 = 1U;
- PORTD.PMR.BIT.B6 = 0U;
- PORTD.PDR.BIT.B6 = 1U;
- /* UART TXD5 => PA4, RXD5 => PA3 */
- PORTA.PMR.BIT.B4 = 1U;
- PORTA.PCR.BIT.B4 = 1U;
- MPC.PA4PFS.BYTE = 0b01010;
- PORTA.PMR.BIT.B3 = 1U;
- MPC.PA5PFS.BYTE = 0b01010;
- /* USB VBUS -> P16 */
- PORT1.PMR.BIT.B6 = 1U;
- MPC.P16PFS.BYTE = MPC_PFS_ISEL | 0b10001;
- /* Lock MPC registers */
- MPC.PWPR.BIT.PFSWE = 0;
- MPC.PWPR.BIT.B0WI = 1;
-
- /* Enable SCI5 */
- SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY | SYSTEM_PRCR_PRC1;
- MSTP(SCI5) = 0;
- SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY;
- SCI5.SEMR.BIT.ABCS = 1;
- SCI5.SEMR.BIT.BGDM = 1;
- SCI5.BRR = (SCI_PCLK / (8 * 115200)) - 1;
- IR(SCI5, RXI5) = 0;
- IR(SCI5, TXI5) = 0;
- IS(SCI5, TEI5) = 0;
- IR(ICU, GROUPBL0) = 0;
- IPR(SCI5, RXI5) = IRQ_PRIORITY_SCI5;
- IPR(SCI5, TXI5) = IRQ_PRIORITY_SCI5;
- IPR(ICU,GROUPBL0) = IRQ_PRIORITY_SCI5;
- IEN(SCI5, RXI5) = 1;
- IEN(SCI5, TXI5) = 1;
- IEN(ICU,GROUPBL0) = 1;
- EN(SCI5, TEI5) = 1;
-
- /* setup USBI0 interrupt. */
- IR(USB0, USBI0) = 0;
- IPR(USB0, USBI0) = IRQ_PRIORITY_USBI0;
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- PORTD.PODR.BIT.B6 = state ? 0 : 1;
-}
-
-uint32_t board_button_read(void)
-{
- return PORTB.PIDR.BIT.B1 ? 0 : 1;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- sci_buf[1].buf = buf;
- sci_buf[1].cnt = len;
- SCI5.SCR.BYTE |= SCI_SCR_RE | SCI_SCR_RIE;
- while (SCI5.SCR.BIT.RE) ;
- return len - sci_buf[1].cnt;
-}
-
-int board_uart_write(void const *buf, int len)
-{
- sci_buf[0].buf = (uint8_t*)buf;
- sci_buf[0].cnt = len;
- SCI5.SCR.BYTE |= SCI_SCR_TE | SCI_SCR_TIE;
- while (SCI5.SCR.BIT.TE) ;
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void INT_Excep_CMT0_CMI0(void)
-{
- ++system_ticks;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#else
-uint32_t SystemCoreClock = 120000000;
-#endif
-
-int close(int fd)
-{
- (void)fd;
- return -1;
-}
-int fstat(int fd, void *pstat)
-{
- (void)fd;
- (void)pstat;
- return 0;
-}
-off_t lseek(int fd, off_t pos, int whence)
-{
- (void)fd;
- (void)pos;
- (void)whence;
- return 0;
-}
-int isatty(int fd)
-{
- (void)fd;
- return 1;
-}
diff --git a/tinyusb/hw/bsp/rx/family.mk b/tinyusb/hw/bsp/rx/family.mk
deleted file mode 100755
index 5a828171..00000000
--- a/tinyusb/hw/bsp/rx/family.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/renesas/rx
-
-# Cross Compiler for RX
-CROSS_COMPILE = rx-elf-
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -nostartfiles \
- -ffunction-sections \
- -fdata-sections \
- -fshort-enums \
- -mlittle-endian-data \
- -DSSIZE_MAX=__INT_MAX__
-
-SRC_C += \
- src/portable/renesas/usba/dcd_usba.c \
- $(MCU_DIR)/vects.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/$(MCU_DIR)
-
-SRC_S += $(MCU_DIR)/start.S
-
-$(BUILD)/$(PROJECT).mot: $(BUILD)/$(PROJECT).elf
- @echo CREATE $@
- $(OBJCOPY) -O srec -I elf32-rx-be-ns $^ $@
-
-# flash using rfp-cli
-flash-rfp: $(BUILD)/$(PROJECT).mot
- rfp-cli -device rx65x -tool e2l -if fine -fo id FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -auth id FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -auto $^
diff --git a/tinyusb/hw/bsp/samd11/boards/luna_d11/board.h b/tinyusb/hw/bsp/samd11/boards/luna_d11/board.h
deleted file mode 100755
index 1bda9293..00000000
--- a/tinyusb/hw/bsp/samd11/boards/luna_d11/board.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN PIN_PA27 // pin PA22
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PIN PIN_PA16 // pin PB22
-#define BUTTON_STATE_ACTIVE 0
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd11/boards/luna_d11/board.mk b/tinyusb/hw/bsp/samd11/boards/luna_d11/board.mk
deleted file mode 100755
index ad9cfb25..00000000
--- a/tinyusb/hw/bsp/samd11/boards/luna_d11/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -D__SAMD11D14AM__
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/samd11d14am_flash.ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD11D14
-
-# flash using dfu-util
-flash: $(BUILD)/$(PROJECT).bin
- dfu-util -a 0 -d 1d50:615c -D $< || dfu-util -a 0 -d 16d0:05a5 -D $<
diff --git a/tinyusb/hw/bsp/samd11/boards/luna_d11/samd11d14am_flash.ld b/tinyusb/hw/bsp/samd11/boards/luna_d11/samd11d14am_flash.ld
deleted file mode 100755
index cb633c19..00000000
--- a/tinyusb/hw/bsp/samd11/boards/luna_d11/samd11d14am_flash.ld
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD11D14AM
- *
- * Copyright (c) 2018 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000 + 4K, LENGTH = 0x00004000 - 4K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00001000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x400;
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd11/boards/samd11_xplained/board.h b/tinyusb/hw/bsp/samd11/boards/samd11_xplained/board.h
deleted file mode 100755
index cfeac673..00000000
--- a/tinyusb/hw/bsp/samd11/boards/samd11_xplained/board.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN PIN_PA16 // pin PA22
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PIN PIN_PA14 // pin PB22
-#define BUTTON_STATE_ACTIVE 0
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd11/boards/samd11_xplained/board.mk b/tinyusb/hw/bsp/samd11/boards/samd11_xplained/board.mk
deleted file mode 100755
index e351cf0b..00000000
--- a/tinyusb/hw/bsp/samd11/boards/samd11_xplained/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -D__SAMD11D14AM__
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/samd11d14am_flash.ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD11D14
-
-# flash using edbg
-flash: $(BUILD)/$(PROJECT).bin
- edbg -b -t samd11 -e -pv -f $<
diff --git a/tinyusb/hw/bsp/samd11/boards/samd11_xplained/samd11d14am_flash.ld b/tinyusb/hw/bsp/samd11/boards/samd11_xplained/samd11d14am_flash.ld
deleted file mode 100755
index 8b3124c0..00000000
--- a/tinyusb/hw/bsp/samd11/boards/samd11_xplained/samd11d14am_flash.ld
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD11D14AM
- *
- * Copyright (c) 2018 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00004000
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00001000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x400;
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd11/family.c b/tinyusb/hw/bsp/samd11/family.c
deleted file mode 100755
index 8d963397..00000000
--- a/tinyusb/hw/bsp/samd11/family.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "sam.h"
-#include "bsp/board.h"
-#include "board.h"
-
-#include "hal/include/hal_gpio.h"
-#include "hal/include/hal_init.h"
-#include "hri/hri_nvmctrl_d11.h"
-
-#include "hpl/gclk/hpl_gclk_base.h"
-#include "hpl_pm_config.h"
-#include "hpl/pm/hpl_pm_base.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_Handler(void)
-{
- tud_int_handler(0);
-}
-
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-/* Referenced GCLKs, should be initialized firstly */
-#define _GCLK_INIT_1ST (1 << 0 | 1 << 1)
-
-/* Not referenced GCLKs, initialized last */
-#define _GCLK_INIT_LAST (~_GCLK_INIT_1ST)
-
-void board_init(void)
-{
- // Clock init ( follow hpl_init.c )
- hri_nvmctrl_set_CTRLB_RWS_bf(NVMCTRL, 2);
-
- _pm_init();
- _sysctrl_init_sources();
-#if _GCLK_INIT_1ST
- _gclk_init_generators_by_fref(_GCLK_INIT_1ST);
-#endif
- _sysctrl_init_referenced_generators();
- _gclk_init_generators_by_fref(_GCLK_INIT_LAST);
-
- // 1ms tick timer (samd SystemCoreClock may not correct)
- SystemCoreClock = CONF_CPU_FREQUENCY;
- SysTick_Config(CONF_CPU_FREQUENCY / 1000);
-
- // Led init
- gpio_set_pin_direction(LED_PIN, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(LED_PIN, 0);
-
- // Button init
- gpio_set_pin_direction(BUTTON_PIN, GPIO_DIRECTION_IN);
- gpio_set_pin_pull_mode(BUTTON_PIN, GPIO_PULL_UP);
-
- /* USB Clock init
- * The USB module requires a GCLK_USB of 48 MHz ~ 0.25% clock
- * for low speed and full speed operation. */
- _pm_enable_bus_clock(PM_BUS_APBB, USB);
- _pm_enable_bus_clock(PM_BUS_AHB, USB);
- _gclk_enable_channel(USB_GCLK_ID, GCLK_CLKCTRL_GEN_GCLK0_Val);
-
- // USB Pin Init
- gpio_set_pin_direction(PIN_PA24, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(PIN_PA24, false);
- gpio_set_pin_pull_mode(PIN_PA24, GPIO_PULL_OFF);
- gpio_set_pin_direction(PIN_PA25, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(PIN_PA25, false);
- gpio_set_pin_pull_mode(PIN_PA25, GPIO_PULL_OFF);
-
- gpio_set_pin_function(PIN_PA24, PINMUX_PA24G_USB_DM);
- gpio_set_pin_function(PIN_PA25, PINMUX_PA25G_USB_DP);
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- gpio_set_pin_level(LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == gpio_get_pin_level(BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-
-volatile uint32_t system_ticks = 0;
-
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-
-void _init(void)
-{
- // This _init() standin makes certain GCC environments happier.
- // They expect the main binary to have a constructor called _init; but don't provide a weak default.
- // Providing an empty constructor satisfies this odd case, and doesn't harm anything.
-}
-
-
-#endif
diff --git a/tinyusb/hw/bsp/samd11/family.mk b/tinyusb/hw/bsp/samd11/family.mk
deleted file mode 100755
index 032d11b9..00000000
--- a/tinyusb/hw/bsp/samd11/family.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/microchip
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m0plus \
- -nostdlib -nostartfiles \
- -DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
- -DOSC32K_OVERWRITE_CALIBRATION=0 \
- -DCFG_TUSB_MCU=OPT_MCU_SAMD11
-
-SRC_C += \
- src/portable/microchip/samd/dcd_samd.c \
- hw/mcu/microchip/samd11/gcc/gcc/startup_samd11.c \
- hw/mcu/microchip/samd11/gcc/system_samd11.c \
- hw/mcu/microchip/samd11/hpl/gclk/hpl_gclk.c \
- hw/mcu/microchip/samd11/hpl/pm/hpl_pm.c \
- hw/mcu/microchip/samd11/hpl/sysctrl/hpl_sysctrl.c \
- hw/mcu/microchip/samd11/hal/src/hal_atomic.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/hw/mcu/microchip/samd11/ \
- $(TOP)/hw/mcu/microchip/samd11/config \
- $(TOP)/hw/mcu/microchip/samd11/include \
- $(TOP)/hw/mcu/microchip/samd11/hal/include \
- $(TOP)/hw/mcu/microchip/samd11/hal/utils/include \
- $(TOP)/hw/mcu/microchip/samd11/hpl/pm/ \
- $(TOP)/hw/mcu/microchip/samd11/hpl/port \
- $(TOP)/hw/mcu/microchip/samd11/hri \
- $(TOP)/hw/mcu/microchip/samd11/CMSIS/Include \
- $(TOP)/hw/mcu/microchip/samd11/CMSIS/Core/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
diff --git a/tinyusb/hw/bsp/samd21/boards/atsamd21_xpro/board.h b/tinyusb/hw/bsp/samd21/boards/atsamd21_xpro/board.h
deleted file mode 100755
index a3e03997..00000000
--- a/tinyusb/hw/bsp/samd21/boards/atsamd21_xpro/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN (32 + 30) // PB30
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PIN (0 + 15) // PA15
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 4
-#define UART_TX_PIN 5
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd21/boards/atsamd21_xpro/board.mk b/tinyusb/hw/bsp/samd21/boards/atsamd21_xpro/board.mk
deleted file mode 100755
index 5cd82735..00000000
--- a/tinyusb/hw/bsp/samd21/boards/atsamd21_xpro/board.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-CFLAGS += -D__SAMD21J18A__
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/samd21j18a_flash.ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD21J18
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/samd21/boards/atsamd21_xpro/samd21j18a_flash.ld b/tinyusb/hw/bsp/samd21/boards/atsamd21_xpro/samd21j18a_flash.ld
deleted file mode 100755
index e2f93416..00000000
--- a/tinyusb/hw/bsp/samd21/boards/atsamd21_xpro/samd21j18a_flash.ld
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD21J18A
- *
- * Copyright (c) 2017 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd21/boards/circuitplayground_express/board.h b/tinyusb/hw/bsp/samd21/boards/circuitplayground_express/board.h
deleted file mode 100755
index 2d7da1c0..00000000
--- a/tinyusb/hw/bsp/samd21/boards/circuitplayground_express/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN 17
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN 28
-#define BUTTON_STATE_ACTIVE 1
-
-// UART
-#define UART_RX_PIN 4
-#define UART_TX_PIN 5
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd21/boards/circuitplayground_express/board.mk b/tinyusb/hw/bsp/samd21/boards/circuitplayground_express/board.mk
deleted file mode 100755
index bb426cda..00000000
--- a/tinyusb/hw/bsp/samd21/boards/circuitplayground_express/board.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-CFLAGS += -D__SAMD21G18A__
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD21G18
-
-flash: flash-bossac
diff --git a/tinyusb/hw/bsp/samd21/boards/circuitplayground_express/circuitplayground_express.ld b/tinyusb/hw/bsp/samd21/boards/circuitplayground_express/circuitplayground_express.ld
deleted file mode 100755
index f0c93340..00000000
--- a/tinyusb/hw/bsp/samd21/boards/circuitplayground_express/circuitplayground_express.ld
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD21G18A
- *
- * Copyright (c) 2017 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 0x00040000 - 8K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
-
-ENTRY(Reset_Handler)
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd21/boards/feather_m0_express/board.h b/tinyusb/hw/bsp/samd21/boards/feather_m0_express/board.h
deleted file mode 100755
index b9292b9a..00000000
--- a/tinyusb/hw/bsp/samd21/boards/feather_m0_express/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN 17
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN 15
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 4
-#define UART_TX_PIN 5
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd21/boards/feather_m0_express/board.mk b/tinyusb/hw/bsp/samd21/boards/feather_m0_express/board.mk
deleted file mode 100755
index bb426cda..00000000
--- a/tinyusb/hw/bsp/samd21/boards/feather_m0_express/board.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-CFLAGS += -D__SAMD21G18A__
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD21G18
-
-flash: flash-bossac
diff --git a/tinyusb/hw/bsp/samd21/boards/feather_m0_express/feather_m0_express.ld b/tinyusb/hw/bsp/samd21/boards/feather_m0_express/feather_m0_express.ld
deleted file mode 100755
index f0c93340..00000000
--- a/tinyusb/hw/bsp/samd21/boards/feather_m0_express/feather_m0_express.ld
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD21G18A
- *
- * Copyright (c) 2017 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 0x00040000 - 8K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
-
-ENTRY(Reset_Handler)
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd21/boards/itsybitsy_m0/board.h b/tinyusb/hw/bsp/samd21/boards/itsybitsy_m0/board.h
deleted file mode 100755
index 177fb695..00000000
--- a/tinyusb/hw/bsp/samd21/boards/itsybitsy_m0/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN 17
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN 21
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 4
-#define UART_TX_PIN 5
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd21/boards/itsybitsy_m0/board.mk b/tinyusb/hw/bsp/samd21/boards/itsybitsy_m0/board.mk
deleted file mode 100755
index bb426cda..00000000
--- a/tinyusb/hw/bsp/samd21/boards/itsybitsy_m0/board.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-CFLAGS += -D__SAMD21G18A__
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD21G18
-
-flash: flash-bossac
diff --git a/tinyusb/hw/bsp/samd21/boards/itsybitsy_m0/itsybitsy_m0.ld b/tinyusb/hw/bsp/samd21/boards/itsybitsy_m0/itsybitsy_m0.ld
deleted file mode 100755
index f0c93340..00000000
--- a/tinyusb/hw/bsp/samd21/boards/itsybitsy_m0/itsybitsy_m0.ld
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD21G18A
- *
- * Copyright (c) 2017 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 0x00040000 - 8K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
-
-ENTRY(Reset_Handler)
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd21/boards/luna_d21/board.h b/tinyusb/hw/bsp/samd21/boards/luna_d21/board.h
deleted file mode 100755
index 2e0a2a60..00000000
--- a/tinyusb/hw/bsp/samd21/boards/luna_d21/board.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN PIN_PA22
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN PIN_PB22
-#define BUTTON_STATE_ACTIVE 0
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd21/boards/luna_d21/board.mk b/tinyusb/hw/bsp/samd21/boards/luna_d21/board.mk
deleted file mode 100755
index 5beb5e02..00000000
--- a/tinyusb/hw/bsp/samd21/boards/luna_d21/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -D__SAMD21G18A__
-
-LD_FILE = $(BOARD_PATH)/samd21g18a_flash.ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD21G18
-
-# flash using dfu-util
-flash: $(BUILD)/$(PROJECT).bin
- dfu-util -a 0 -d 1d50:615c -D $< || dfu-util -a 0 -d 16d0:05a5 -D $<
-
diff --git a/tinyusb/hw/bsp/samd21/boards/luna_d21/samd21g18a_flash.ld b/tinyusb/hw/bsp/samd21/boards/luna_d21/samd21g18a_flash.ld
deleted file mode 100755
index 15859303..00000000
--- a/tinyusb/hw/bsp/samd21/boards/luna_d21/samd21g18a_flash.ld
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD21G18A
- *
- * Copyright (c) 2017 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000 + 4K, LENGTH = 0x00040000 - 4K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd21/boards/metro_m0_express/board.h b/tinyusb/hw/bsp/samd21/boards/metro_m0_express/board.h
deleted file mode 100755
index b9292b9a..00000000
--- a/tinyusb/hw/bsp/samd21/boards/metro_m0_express/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN 17
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN 15
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 4
-#define UART_TX_PIN 5
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd21/boards/metro_m0_express/board.mk b/tinyusb/hw/bsp/samd21/boards/metro_m0_express/board.mk
deleted file mode 100755
index bb426cda..00000000
--- a/tinyusb/hw/bsp/samd21/boards/metro_m0_express/board.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-CFLAGS += -D__SAMD21G18A__
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD21G18
-
-flash: flash-bossac
diff --git a/tinyusb/hw/bsp/samd21/boards/metro_m0_express/metro_m0_express.ld b/tinyusb/hw/bsp/samd21/boards/metro_m0_express/metro_m0_express.ld
deleted file mode 100755
index f0c93340..00000000
--- a/tinyusb/hw/bsp/samd21/boards/metro_m0_express/metro_m0_express.ld
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD21G18A
- *
- * Copyright (c) 2017 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 0x00040000 - 8K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
-
-ENTRY(Reset_Handler)
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd21/boards/seeeduino_xiao/board.h b/tinyusb/hw/bsp/samd21/boards/seeeduino_xiao/board.h
deleted file mode 100755
index 0d1e9cef..00000000
--- a/tinyusb/hw/bsp/samd21/boards/seeeduino_xiao/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN 17
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PIN 9 // PA4 pin D1 on seed input
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 4
-#define UART_TX_PIN 5
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd21/boards/seeeduino_xiao/board.mk b/tinyusb/hw/bsp/samd21/boards/seeeduino_xiao/board.mk
deleted file mode 100755
index 54591b3a..00000000
--- a/tinyusb/hw/bsp/samd21/boards/seeeduino_xiao/board.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-CFLAGS += -D__SAMD21G18A__
-
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD21G18
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/samd21/boards/seeeduino_xiao/seeeduino_xiao.ld b/tinyusb/hw/bsp/samd21/boards/seeeduino_xiao/seeeduino_xiao.ld
deleted file mode 100755
index cf11c4c3..00000000
--- a/tinyusb/hw/bsp/samd21/boards/seeeduino_xiao/seeeduino_xiao.ld
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD21G18A
- *
- * Copyright (c) 2017 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 0x00040000 - 8K /* 8K offset to preserve bootloader */
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
-
-ENTRY(Reset_Handler)
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd21/family.c b/tinyusb/hw/bsp/samd21/family.c
deleted file mode 100755
index eb5b5586..00000000
--- a/tinyusb/hw/bsp/samd21/family.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "sam.h"
-#include "bsp/board.h"
-#include "board.h"
-
-#include "hal/include/hal_gpio.h"
-#include "hal/include/hal_init.h"
-#include "hri/hri_nvmctrl_d21.h"
-
-#include "hpl/gclk/hpl_gclk_base.h"
-#include "hpl_pm_config.h"
-#include "hpl/pm/hpl_pm_base.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_Handler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-/* Referenced GCLKs, should be initialized firstly */
-#define _GCLK_INIT_1ST (1 << 0 | 1 << 1)
-
-/* Not referenced GCLKs, initialized last */
-#define _GCLK_INIT_LAST (~_GCLK_INIT_1ST)
-
-void board_init(void)
-{
- // Clock init ( follow hpl_init.c )
- hri_nvmctrl_set_CTRLB_RWS_bf(NVMCTRL, 2);
-
- _pm_init();
- _sysctrl_init_sources();
-#if _GCLK_INIT_1ST
- _gclk_init_generators_by_fref(_GCLK_INIT_1ST);
-#endif
- _sysctrl_init_referenced_generators();
- _gclk_init_generators_by_fref(_GCLK_INIT_LAST);
-
- // Update SystemCoreClock since it is hard coded with asf4 and not correct
- // Init 1ms tick timer (samd SystemCoreClock may not correct)
- SystemCoreClock = CONF_CPU_FREQUENCY;
- SysTick_Config(CONF_CPU_FREQUENCY / 1000);
-
- // Led init
- gpio_set_pin_direction(LED_PIN, GPIO_DIRECTION_OUT);
- board_led_write(false);
-
- // Button init
- gpio_set_pin_direction(BUTTON_PIN, GPIO_DIRECTION_IN);
- gpio_set_pin_pull_mode(BUTTON_PIN, BUTTON_STATE_ACTIVE ? GPIO_PULL_DOWN : GPIO_PULL_UP);
-
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
-#endif
-
- /* USB Clock init
- * The USB module requires a GCLK_USB of 48 MHz ~ 0.25% clock
- * for low speed and full speed operation. */
- _pm_enable_bus_clock(PM_BUS_APBB, USB);
- _pm_enable_bus_clock(PM_BUS_AHB, USB);
- _gclk_enable_channel(USB_GCLK_ID, GCLK_CLKCTRL_GEN_GCLK0_Val);
-
- // USB Pin Init
- gpio_set_pin_direction(PIN_PA24, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(PIN_PA24, false);
- gpio_set_pin_pull_mode(PIN_PA24, GPIO_PULL_OFF);
- gpio_set_pin_direction(PIN_PA25, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(PIN_PA25, false);
- gpio_set_pin_pull_mode(PIN_PA25, GPIO_PULL_OFF);
-
- gpio_set_pin_function(PIN_PA24, PINMUX_PA24G_USB_DM);
- gpio_set_pin_function(PIN_PA25, PINMUX_PA25G_USB_DP);
-
- // Output 500hz PWM on D12 (PA19 - TCC0 WO[3]) so we can validate the GCLK0 clock speed with a Saleae.
- _pm_enable_bus_clock(PM_BUS_APBC, TCC0);
- TCC0->PER.bit.PER = 48000000 / 1000;
- TCC0->CC[3].bit.CC = 48000000 / 2000;
- TCC0->CTRLA.bit.ENABLE = true;
-
- gpio_set_pin_function(PIN_PA19, PINMUX_PA19F_TCC0_WO3);
- _gclk_enable_channel(TCC0_GCLK_ID, GCLK_CLKCTRL_GEN_GCLK0_Val);
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- gpio_set_pin_level(LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == gpio_get_pin_level(BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/samd21/family.mk b/tinyusb/hw/bsp/samd21/family.mk
deleted file mode 100755
index f1b063f2..00000000
--- a/tinyusb/hw/bsp/samd21/family.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-UF2_FAMILY_ID = 0x68ed2b88
-DEPS_SUBMODULES += hw/mcu/microchip
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m0plus \
- -nostdlib -nostartfiles \
- -DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
- -DCFG_TUSB_MCU=OPT_MCU_SAMD21
-
-SRC_C += \
- src/portable/microchip/samd/dcd_samd.c \
- hw/mcu/microchip/samd21/gcc/gcc/startup_samd21.c \
- hw/mcu/microchip/samd21/gcc/system_samd21.c \
- hw/mcu/microchip/samd21/hpl/gclk/hpl_gclk.c \
- hw/mcu/microchip/samd21/hpl/pm/hpl_pm.c \
- hw/mcu/microchip/samd21/hpl/sysctrl/hpl_sysctrl.c \
- hw/mcu/microchip/samd21/hal/src/hal_atomic.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/hw/mcu/microchip/samd21/ \
- $(TOP)/hw/mcu/microchip/samd21/config \
- $(TOP)/hw/mcu/microchip/samd21/include \
- $(TOP)/hw/mcu/microchip/samd21/hal/include \
- $(TOP)/hw/mcu/microchip/samd21/hal/utils/include \
- $(TOP)/hw/mcu/microchip/samd21/hpl/pm/ \
- $(TOP)/hw/mcu/microchip/samd21/hpl/port \
- $(TOP)/hw/mcu/microchip/samd21/hri \
- $(TOP)/hw/mcu/microchip/samd21/CMSIS/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
-
-# flash using bossac at least version 1.8
-# can be found in arduino15/packages/arduino/tools/bossac/
-# Add it to your PATH or change BOSSAC variable to match your installation
-BOSSAC = bossac
-
-flash-bossac: $(BUILD)/$(PROJECT).bin
- @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
- $(BOSSAC) --port=$(SERIAL) -U -i --offset=0x2000 -e -w $^ -R
diff --git a/tinyusb/hw/bsp/samd51/boards/feather_m4_express/board.h b/tinyusb/hw/bsp/samd51/boards/feather_m4_express/board.h
deleted file mode 100755
index 1d5ed804..00000000
--- a/tinyusb/hw/bsp/samd51/boards/feather_m4_express/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN 23
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN 16 // D5
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_TX_PIN (32 + 17)
-#define UART_RX_PIN (32 + 16)
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd51/boards/feather_m4_express/board.mk b/tinyusb/hw/bsp/samd51/boards/feather_m4_express/board.mk
deleted file mode 100755
index a8a98a98..00000000
--- a/tinyusb/hw/bsp/samd51/boards/feather_m4_express/board.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-CFLAGS += -D__SAMD51J19A__
-
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD51J19
-
-flash: flash-bossac
diff --git a/tinyusb/hw/bsp/samd51/boards/feather_m4_express/feather_m4_express.ld b/tinyusb/hw/bsp/samd51/boards/feather_m4_express/feather_m4_express.ld
deleted file mode 100755
index f1a021d7..00000000
--- a/tinyusb/hw/bsp/samd51/boards/feather_m4_express/feather_m4_express.ld
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD51G19A
- *
- * Copyright (c) 2017 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 0x00080000 - 16K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
- bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
- qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
-
-ENTRY(Reset_Handler)
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- .bkupram (NOLOAD):
- {
- . = ALIGN(8);
- _sbkupram = .;
- *(.bkupram .bkupram.*);
- . = ALIGN(8);
- _ebkupram = .;
- } > bkupram
-
- .qspi (NOLOAD):
- {
- . = ALIGN(8);
- _sqspi = .;
- *(.qspi .qspi.*);
- . = ALIGN(8);
- _eqspi = .;
- } > qspi
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd51/boards/itsybitsy_m4/board.h b/tinyusb/hw/bsp/samd51/boards/itsybitsy_m4/board.h
deleted file mode 100755
index 0760d428..00000000
--- a/tinyusb/hw/bsp/samd51/boards/itsybitsy_m4/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN 22
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN 18 // D5
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_TX_PIN 16
-#define UART_RX_PIN 17
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd51/boards/itsybitsy_m4/board.mk b/tinyusb/hw/bsp/samd51/boards/itsybitsy_m4/board.mk
deleted file mode 100755
index 57a680e9..00000000
--- a/tinyusb/hw/bsp/samd51/boards/itsybitsy_m4/board.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-CFLAGS += -D__SAMD51J19A__
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD51J19
-
-flash: flash-bossac
diff --git a/tinyusb/hw/bsp/samd51/boards/itsybitsy_m4/itsybitsy_m4.ld b/tinyusb/hw/bsp/samd51/boards/itsybitsy_m4/itsybitsy_m4.ld
deleted file mode 100755
index f1a021d7..00000000
--- a/tinyusb/hw/bsp/samd51/boards/itsybitsy_m4/itsybitsy_m4.ld
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD51G19A
- *
- * Copyright (c) 2017 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 0x00080000 - 16K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
- bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
- qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
-
-ENTRY(Reset_Handler)
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- .bkupram (NOLOAD):
- {
- . = ALIGN(8);
- _sbkupram = .;
- *(.bkupram .bkupram.*);
- . = ALIGN(8);
- _ebkupram = .;
- } > bkupram
-
- .qspi (NOLOAD):
- {
- . = ALIGN(8);
- _sqspi = .;
- *(.qspi .qspi.*);
- . = ALIGN(8);
- _eqspi = .;
- } > qspi
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd51/boards/metro_m4_express/board.h b/tinyusb/hw/bsp/samd51/boards/metro_m4_express/board.h
deleted file mode 100755
index 9bb5f815..00000000
--- a/tinyusb/hw/bsp/samd51/boards/metro_m4_express/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN 16
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN (32+14) // D5
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_TX_PIN 23
-#define UART_RX_PIN 22
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd51/boards/metro_m4_express/board.mk b/tinyusb/hw/bsp/samd51/boards/metro_m4_express/board.mk
deleted file mode 100755
index d7953cc2..00000000
--- a/tinyusb/hw/bsp/samd51/boards/metro_m4_express/board.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-CFLAGS += -D__SAMD51J19A__
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD51J19
-
-flash: flash-bossac
-
diff --git a/tinyusb/hw/bsp/samd51/boards/metro_m4_express/metro_m4_express.ld b/tinyusb/hw/bsp/samd51/boards/metro_m4_express/metro_m4_express.ld
deleted file mode 100755
index f1a021d7..00000000
--- a/tinyusb/hw/bsp/samd51/boards/metro_m4_express/metro_m4_express.ld
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD51G19A
- *
- * Copyright (c) 2017 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 0x00080000 - 16K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
- bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
- qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
-
-ENTRY(Reset_Handler)
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- .bkupram (NOLOAD):
- {
- . = ALIGN(8);
- _sbkupram = .;
- *(.bkupram .bkupram.*);
- . = ALIGN(8);
- _ebkupram = .;
- } > bkupram
-
- .qspi (NOLOAD):
- {
- . = ALIGN(8);
- _sqspi = .;
- *(.qspi .qspi.*);
- . = ALIGN(8);
- _eqspi = .;
- } > qspi
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd51/boards/pybadge/board.h b/tinyusb/hw/bsp/samd51/boards/pybadge/board.h
deleted file mode 100755
index 1d5ed804..00000000
--- a/tinyusb/hw/bsp/samd51/boards/pybadge/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN 23
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN 16 // D5
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_TX_PIN (32 + 17)
-#define UART_RX_PIN (32 + 16)
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd51/boards/pybadge/board.mk b/tinyusb/hw/bsp/samd51/boards/pybadge/board.mk
deleted file mode 100755
index a8a98a98..00000000
--- a/tinyusb/hw/bsp/samd51/boards/pybadge/board.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-CFLAGS += -D__SAMD51J19A__
-
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD51J19
-
-flash: flash-bossac
diff --git a/tinyusb/hw/bsp/samd51/boards/pybadge/pybadge.ld b/tinyusb/hw/bsp/samd51/boards/pybadge/pybadge.ld
deleted file mode 100755
index f1a021d7..00000000
--- a/tinyusb/hw/bsp/samd51/boards/pybadge/pybadge.ld
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD51G19A
- *
- * Copyright (c) 2017 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 0x00080000 - 16K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
- bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
- qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
-
-ENTRY(Reset_Handler)
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- .bkupram (NOLOAD):
- {
- . = ALIGN(8);
- _sbkupram = .;
- *(.bkupram .bkupram.*);
- . = ALIGN(8);
- _ebkupram = .;
- } > bkupram
-
- .qspi (NOLOAD):
- {
- . = ALIGN(8);
- _sqspi = .;
- *(.qspi .qspi.*);
- . = ALIGN(8);
- _eqspi = .;
- } > qspi
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd51/boards/pyportal/board.h b/tinyusb/hw/bsp/samd51/boards/pyportal/board.h
deleted file mode 100755
index 9e51ded3..00000000
--- a/tinyusb/hw/bsp/samd51/boards/pyportal/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN (32+23)
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN (32+22) // D2
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_TX_PIN (32 + 13)
-#define UART_RX_PIN (32 + 12)
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/samd51/boards/pyportal/board.mk b/tinyusb/hw/bsp/samd51/boards/pyportal/board.mk
deleted file mode 100755
index a8a98a98..00000000
--- a/tinyusb/hw/bsp/samd51/boards/pyportal/board.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-CFLAGS += -D__SAMD51J19A__
-
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMD51J19
-
-flash: flash-bossac
diff --git a/tinyusb/hw/bsp/samd51/boards/pyportal/pyportal.ld b/tinyusb/hw/bsp/samd51/boards/pyportal/pyportal.ld
deleted file mode 100755
index f1a021d7..00000000
--- a/tinyusb/hw/bsp/samd51/boards/pyportal/pyportal.ld
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAMD51G19A
- *
- * Copyright (c) 2017 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 0x00080000 - 16K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
- bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
- qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
-
-ENTRY(Reset_Handler)
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- .bkupram (NOLOAD):
- {
- . = ALIGN(8);
- _sbkupram = .;
- *(.bkupram .bkupram.*);
- . = ALIGN(8);
- _ebkupram = .;
- } > bkupram
-
- .qspi (NOLOAD):
- {
- . = ALIGN(8);
- _sqspi = .;
- *(.qspi .qspi.*);
- . = ALIGN(8);
- _eqspi = .;
- } > qspi
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/samd51/family.c b/tinyusb/hw/bsp/samd51/family.c
deleted file mode 100755
index 020e638c..00000000
--- a/tinyusb/hw/bsp/samd51/family.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "sam.h"
-#include "bsp/board.h"
-#include "board.h"
-
-#include "hal/include/hal_gpio.h"
-#include "hal/include/hal_init.h"
-#include "hpl/gclk/hpl_gclk_base.h"
-#include "hpl_mclk_config.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_0_Handler (void)
-{
- tud_int_handler(0);
-}
-
-void USB_1_Handler (void)
-{
- tud_int_handler(0);
-}
-
-void USB_2_Handler (void)
-{
- tud_int_handler(0);
-}
-
-void USB_3_Handler (void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-/* Referenced GCLKs, should be initialized firstly */
-#define _GCLK_INIT_1ST 0xFFFFFFFF
-
-/* Not referenced GCLKs, initialized last */
-#define _GCLK_INIT_LAST (~_GCLK_INIT_1ST)
-
-void board_init(void)
-{
- // Clock init ( follow hpl_init.c )
- hri_nvmctrl_set_CTRLA_RWS_bf(NVMCTRL, 0);
-
- _osc32kctrl_init_sources();
- _oscctrl_init_sources();
- _mclk_init();
-#if _GCLK_INIT_1ST
- _gclk_init_generators_by_fref(_GCLK_INIT_1ST);
-#endif
- _oscctrl_init_referenced_generators();
- _gclk_init_generators_by_fref(_GCLK_INIT_LAST);
-
- // Update SystemCoreClock since it is hard coded with asf4 and not correct
- // Init 1ms tick timer (samd SystemCoreClock may not correct)
- SystemCoreClock = CONF_CPU_FREQUENCY;
- SysTick_Config(CONF_CPU_FREQUENCY / 1000);
-
- // Led init
- gpio_set_pin_direction(LED_PIN, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(LED_PIN, 0);
-
- // Button init
- gpio_set_pin_direction(BUTTON_PIN, GPIO_DIRECTION_IN);
- gpio_set_pin_pull_mode(BUTTON_PIN, GPIO_PULL_UP);
-
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB_0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USB_1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USB_2_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USB_3_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
-#endif
-
- /* USB Clock init
- * The USB module requires a GCLK_USB of 48 MHz ~ 0.25% clock
- * for low speed and full speed operation. */
- hri_gclk_write_PCHCTRL_reg(GCLK, USB_GCLK_ID, GCLK_PCHCTRL_GEN_GCLK1_Val | GCLK_PCHCTRL_CHEN);
- hri_mclk_set_AHBMASK_USB_bit(MCLK);
- hri_mclk_set_APBBMASK_USB_bit(MCLK);
-
- // USB Pin Init
- gpio_set_pin_direction(PIN_PA24, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(PIN_PA24, false);
- gpio_set_pin_pull_mode(PIN_PA24, GPIO_PULL_OFF);
- gpio_set_pin_direction(PIN_PA25, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(PIN_PA25, false);
- gpio_set_pin_pull_mode(PIN_PA25, GPIO_PULL_OFF);
-
- gpio_set_pin_function(PIN_PA24, PINMUX_PA24H_USB_DM);
- gpio_set_pin_function(PIN_PA25, PINMUX_PA25H_USB_DP);
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- gpio_set_pin_level(LED_PIN, state);
-}
-
-uint32_t board_button_read(void)
-{
- // button is active low
- return gpio_get_pin_level(BUTTON_PIN) ? 0 : 1;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
diff --git a/tinyusb/hw/bsp/samd51/family.mk b/tinyusb/hw/bsp/samd51/family.mk
deleted file mode 100755
index f4e260fb..00000000
--- a/tinyusb/hw/bsp/samd51/family.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-UF2_FAMILY_ID = 0x55114460
-DEPS_SUBMODULES += hw/mcu/microchip
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib -nostartfiles \
- -DCFG_TUSB_MCU=OPT_MCU_SAMD51
-
-CFLAGS += -Wno-error=undef
-
-SRC_C += \
- src/portable/microchip/samd/dcd_samd.c \
- hw/mcu/microchip/samd51/gcc/gcc/startup_samd51.c \
- hw/mcu/microchip/samd51/gcc/system_samd51.c \
- hw/mcu/microchip/samd51/hpl/gclk/hpl_gclk.c \
- hw/mcu/microchip/samd51/hpl/mclk/hpl_mclk.c \
- hw/mcu/microchip/samd51/hpl/osc32kctrl/hpl_osc32kctrl.c \
- hw/mcu/microchip/samd51/hpl/oscctrl/hpl_oscctrl.c \
- hw/mcu/microchip/samd51/hal/src/hal_atomic.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/hw/mcu/microchip/samd51/ \
- $(TOP)/hw/mcu/microchip/samd51/config \
- $(TOP)/hw/mcu/microchip/samd51/include \
- $(TOP)/hw/mcu/microchip/samd51/hal/include \
- $(TOP)/hw/mcu/microchip/samd51/hal/utils/include \
- $(TOP)/hw/mcu/microchip/samd51/hpl/port \
- $(TOP)/hw/mcu/microchip/samd51/hri \
- $(TOP)/hw/mcu/microchip/samd51/CMSIS/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# flash using bossac at least version 1.8
-# can be found in arduino15/packages/arduino/tools/bossac/
-# Add it to your PATH or change BOSSAC variable to match your installation
-BOSSAC = bossac
-
-flash-bossac: $(BUILD)/$(PROJECT).bin
- @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
- $(BOSSAC) --port=$(SERIAL) -U -i --offset=0x4000 -e -w $^ -R
diff --git a/tinyusb/hw/bsp/same54xplainedpro/board.mk b/tinyusb/hw/bsp/same54xplainedpro/board.mk
deleted file mode 100755
index 16ac786d..00000000
--- a/tinyusb/hw/bsp/same54xplainedpro/board.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/microchip
-
-CONF_CPU_FREQUENCY ?= 48000000
-
-CFLAGS += \
- -mthumb \
- -mabi=aapcs \
- -mlong-calls \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib -nostartfiles \
- -D__SAME54P20A__ \
- -DCONF_CPU_FREQUENCY=$(CONF_CPU_FREQUENCY) \
- -DCFG_TUSB_MCU=OPT_MCU_SAME5X \
- -DBOARD_NAME="\"Microchip SAM E54 Xplained Pro\""
-
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/same54p20a_flash.ld
-
-SRC_C += \
- src/portable/microchip/samd/dcd_samd.c \
- hw/mcu/microchip/same54/gcc/gcc/startup_same54.c \
- hw/mcu/microchip/same54/gcc/system_same54.c \
- hw/mcu/microchip/same54/hal/utils/src/utils_syscalls.c
-
-INC += \
- $(TOP)/hw/mcu/microchip/same54/ \
- $(TOP)/hw/mcu/microchip/same54/config \
- $(TOP)/hw/mcu/microchip/same54/include \
- $(TOP)/hw/mcu/microchip/same54/hal/include \
- $(TOP)/hw/mcu/microchip/same54/hal/utils/include \
- $(TOP)/hw/mcu/microchip/same54/hpl/port \
- $(TOP)/hw/mcu/microchip/same54/hri \
- $(TOP)/hw/mcu/microchip/same54/CMSIS/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAME54P20
-
-# flash using edbg from https://github.com/ataradov/edbg
-flash: $(BUILD)/$(PROJECT).bin
- edbg --verbose -t same54 -pv -f $<
diff --git a/tinyusb/hw/bsp/same54xplainedpro/same54p20a_flash.ld b/tinyusb/hw/bsp/same54xplainedpro/same54p20a_flash.ld
deleted file mode 100755
index 97072bfe..00000000
--- a/tinyusb/hw/bsp/same54xplainedpro/same54p20a_flash.ld
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAME54P20A
- *
- * Copyright (c) 2019 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
- bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
- qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x10000;
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- .bkupram (NOLOAD):
- {
- . = ALIGN(8);
- _sbkupram = .;
- *(.bkupram .bkupram.*);
- . = ALIGN(8);
- _ebkupram = .;
- } > bkupram
-
- .qspi (NOLOAD):
- {
- . = ALIGN(8);
- _sqspi = .;
- *(.qspi .qspi.*);
- . = ALIGN(8);
- _eqspi = .;
- } > qspi
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/same54xplainedpro/same54p20a_sram.ld b/tinyusb/hw/bsp/same54xplainedpro/same54p20a_sram.ld
deleted file mode 100755
index 6219f4af..00000000
--- a/tinyusb/hw/bsp/same54xplainedpro/same54p20a_sram.ld
+++ /dev/null
@@ -1,162 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal SRAM on the SAME54P20A
- *
- * Copyright (c) 2019 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
- bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
- qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x10000;
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > ram
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > ram
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- .bkupram (NOLOAD):
- {
- . = ALIGN(8);
- _sbkupram = .;
- *(.bkupram .bkupram.*);
- . = ALIGN(8);
- _ebkupram = .;
- } > bkupram
-
- .qspi (NOLOAD):
- {
- . = ALIGN(8);
- _sqspi = .;
- *(.qspi .qspi.*);
- . = ALIGN(8);
- _eqspi = .;
- } > qspi
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/same54xplainedpro/same54xplainedpro.c b/tinyusb/hw/bsp/same54xplainedpro/same54xplainedpro.c
deleted file mode 100755
index 4c38fc6e..00000000
--- a/tinyusb/hw/bsp/same54xplainedpro/same54xplainedpro.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021 Jean Gressmann <jean@0x42.de>
- *
- * 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.
- *
- */
-
-#include <sam.h>
-#include "bsp/board.h"
-
-#include <hal/include/hal_gpio.h>
-
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_0_Handler(void)
-{
- tud_int_handler(0);
-}
-
-void USB_1_Handler(void)
-{
- tud_int_handler(0);
-}
-
-void USB_2_Handler(void)
-{
- tud_int_handler(0);
-}
-
-void USB_3_Handler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-#define LED_PIN PIN_PC18
-#define BUTTON_PIN PIN_PB31
-#define BOARD_SERCOM SERCOM2
-
-/** Initializes the clocks from the external 12 MHz crystal
- *
- * The goal of this setup is to preserve the second PLL
- * for the application code while still having a reasonable
- * 48 MHz clock for USB / UART.
- *
- * GCLK0: CONF_CPU_FREQUENCY (default 120 MHz) from PLL0
- * GCLK1: unused
- * GCLK2: 12 MHz from XOSC1
- * DFLL48M: closed loop from GLCK2
- * GCLK3: 48 MHz
- */
-static inline void init_clock_xtal(void)
-{
- /* configure for a 12MHz crystal connected to XIN1/XOUT1 */
- OSCCTRL->XOSCCTRL[1].reg =
- OSCCTRL_XOSCCTRL_STARTUP(6) | // 1.953 ms
- OSCCTRL_XOSCCTRL_RUNSTDBY |
- OSCCTRL_XOSCCTRL_ENALC |
- OSCCTRL_XOSCCTRL_IMULT(4) | OSCCTRL_XOSCCTRL_IPTAT(3) | // 8MHz to 16MHz
- OSCCTRL_XOSCCTRL_XTALEN |
- OSCCTRL_XOSCCTRL_ENABLE;
- while(0 == OSCCTRL->STATUS.bit.XOSCRDY1);
-
- OSCCTRL->Dpll[0].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_DIV(2) | OSCCTRL_DPLLCTRLB_REFCLK_XOSC1; /* 12MHz / 6 = 2Mhz, input = XOSC1 */
- OSCCTRL->Dpll[0].DPLLRATIO.reg = OSCCTRL_DPLLRATIO_LDRFRAC(0x0) | OSCCTRL_DPLLRATIO_LDR((CONF_CPU_FREQUENCY / 1000000 / 2) - 1); /* multiply to get CONF_CPU_FREQUENCY (default = 120MHz) */
- OSCCTRL->Dpll[0].DPLLCTRLA.reg = OSCCTRL_DPLLCTRLA_RUNSTDBY | OSCCTRL_DPLLCTRLA_ENABLE;
- while(0 == OSCCTRL->Dpll[0].DPLLSTATUS.bit.CLKRDY); /* wait for the PLL0 to be ready */
-
- /* configure clock-generator 0 to use DPLL0 as source -> GCLK0 is used for the core */
- GCLK->GENCTRL[0].reg =
- GCLK_GENCTRL_DIV(0) |
- GCLK_GENCTRL_RUNSTDBY |
- GCLK_GENCTRL_GENEN |
- GCLK_GENCTRL_SRC_DPLL0 |
- GCLK_GENCTRL_IDC;
- while(1 == GCLK->SYNCBUSY.bit.GENCTRL0); /* wait for the synchronization between clock domains to be complete */
-
- // configure GCLK2 for 12MHz from XOSC1
- GCLK->GENCTRL[2].reg =
- GCLK_GENCTRL_DIV(0) |
- GCLK_GENCTRL_RUNSTDBY |
- GCLK_GENCTRL_GENEN |
- GCLK_GENCTRL_SRC_XOSC1 |
- GCLK_GENCTRL_IDC;
- while(1 == GCLK->SYNCBUSY.bit.GENCTRL2); /* wait for the synchronization between clock domains to be complete */
-
- /* setup DFLL48M to use GLCK2 */
- GCLK->PCHCTRL[OSCCTRL_GCLK_ID_DFLL48].reg = GCLK_PCHCTRL_GEN_GCLK2 | GCLK_PCHCTRL_CHEN;
-
- OSCCTRL->DFLLCTRLA.reg = 0;
- while(1 == OSCCTRL->DFLLSYNC.bit.ENABLE);
-
- OSCCTRL->DFLLCTRLB.reg = OSCCTRL_DFLLCTRLB_MODE | OSCCTRL_DFLLCTRLB_WAITLOCK;
- OSCCTRL->DFLLMUL.bit.MUL = 4; // 4 * 12MHz -> 48MHz
-
- OSCCTRL->DFLLCTRLA.reg =
- OSCCTRL_DFLLCTRLA_ENABLE |
- OSCCTRL_DFLLCTRLA_RUNSTDBY;
- while(1 == OSCCTRL->DFLLSYNC.bit.ENABLE);
-
- // setup 48 MHz GCLK3 from DFLL48M
- GCLK->GENCTRL[3].reg =
- GCLK_GENCTRL_DIV(0) |
- GCLK_GENCTRL_RUNSTDBY |
- GCLK_GENCTRL_GENEN |
- GCLK_GENCTRL_SRC_DFLL |
- GCLK_GENCTRL_IDC;
- while(1 == GCLK->SYNCBUSY.bit.GENCTRL3);
-}
-
-/* Initialize SERCOM2 for 115200 bps 8N1 using a 48 MHz clock */
-static inline void uart_init(void)
-{
- gpio_set_pin_function(PIN_PB24, PINMUX_PB24D_SERCOM2_PAD1);
- gpio_set_pin_function(PIN_PB25, PINMUX_PB25D_SERCOM2_PAD0);
-
- MCLK->APBBMASK.bit.SERCOM2_ = 1;
- GCLK->PCHCTRL[SERCOM2_GCLK_ID_CORE].reg = GCLK_PCHCTRL_GEN_GCLK0 | GCLK_PCHCTRL_CHEN;
-
- BOARD_SERCOM->USART.CTRLA.bit.SWRST = 1; /* reset and disable SERCOM -> enable configuration */
- while (BOARD_SERCOM->USART.SYNCBUSY.bit.SWRST);
-
- BOARD_SERCOM->USART.CTRLA.reg =
- SERCOM_USART_CTRLA_SAMPR(0) | /* 0 = 16x / arithmetic baud rate, 1 = 16x / fractional baud rate */
- SERCOM_USART_CTRLA_SAMPA(0) | /* 16x over sampling */
- SERCOM_USART_CTRLA_FORM(0) | /* 0x0 USART frame, 0x1 USART frame with parity, ... */
- SERCOM_USART_CTRLA_DORD | /* LSB first */
- SERCOM_USART_CTRLA_MODE(1) | /* 0x0 USART with external clock, 0x1 USART with internal clock */
- SERCOM_USART_CTRLA_RXPO(1) | /* SERCOM PAD[1] is used for data reception */
- SERCOM_USART_CTRLA_TXPO(0); /* SERCOM PAD[0] is used for data transmission */
-
- BOARD_SERCOM->USART.CTRLB.reg = /* RXEM = 0 -> receiver disabled, LINCMD = 0 -> normal USART transmission, SFDE = 0 -> start-of-frame detection disabled, SBMODE = 0 -> one stop bit, CHSIZE = 0 -> 8 bits */
- SERCOM_USART_CTRLB_TXEN | /* transmitter enabled */
- SERCOM_USART_CTRLB_RXEN; /* receiver enabled */
- // BOARD_SERCOM->USART.BAUD.reg = SERCOM_USART_BAUD_FRAC_FP(0) | SERCOM_USART_BAUD_FRAC_BAUD(26); /* 48000000/(16*115200) = 26.041666667 */
- BOARD_SERCOM->USART.BAUD.reg = SERCOM_USART_BAUD_BAUD(63019); /* 65536*(1−16*115200/48000000) */
-
- BOARD_SERCOM->USART.CTRLA.bit.ENABLE = 1; /* activate SERCOM */
- while (BOARD_SERCOM->USART.SYNCBUSY.bit.ENABLE); /* wait for SERCOM to be ready */
-}
-
-static inline void uart_send_buffer(uint8_t const *text, size_t len)
-{
- for (size_t i = 0; i < len; ++i) {
- BOARD_SERCOM->USART.DATA.reg = text[i];
- while((BOARD_SERCOM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_TXC) == 0);
- }
-}
-
-static inline void uart_send_str(const char* text)
-{
- while (*text) {
- BOARD_SERCOM->USART.DATA.reg = *text++;
- while((BOARD_SERCOM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_TXC) == 0);
- }
-}
-
-
-void board_init(void)
-{
- // Uncomment this line and change the GCLK for UART/USB to run off the XTAL.
- // init_clock_xtal();
-
- SystemCoreClock = CONF_CPU_FREQUENCY;
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- SysTick_Config(CONF_CPU_FREQUENCY / 1000);
-#endif
-
- uart_init();
-
-#if CFG_TUSB_DEBUG >= 2
- uart_send_str(BOARD_NAME " UART initialized\n");
- tu_printf(BOARD_NAME " reset cause %#02x\n", RSTC->RCAUSE.reg);
-#endif
-
- // LED0 init
- gpio_set_pin_function(LED_PIN, GPIO_PIN_FUNCTION_OFF);
- gpio_set_pin_direction(LED_PIN, GPIO_DIRECTION_OUT);
- board_led_write(0);
-
-#if CFG_TUSB_DEBUG >= 2
- uart_send_str(BOARD_NAME " LED pin configured\n");
-#endif
-
- // BTN0 init
- gpio_set_pin_function(BUTTON_PIN, GPIO_PIN_FUNCTION_OFF);
- gpio_set_pin_direction(BUTTON_PIN, GPIO_DIRECTION_IN);
- gpio_set_pin_pull_mode(BUTTON_PIN, GPIO_PULL_UP);
-
-#if CFG_TUSB_DEBUG >= 2
- uart_send_str(BOARD_NAME " Button pin configured\n");
-#endif
-
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB_0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USB_1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USB_2_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USB_3_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
-#endif
-
-
-#if TUSB_OPT_DEVICE_ENABLED
-#if CFG_TUSB_DEBUG >= 2
- uart_send_str(BOARD_NAME " USB device enabled\n");
-#endif
-
- /* USB clock init
- * The USB module requires a GCLK_USB of 48 MHz ~ 0.25% clock
- * for low speed and full speed operation.
- */
- hri_gclk_write_PCHCTRL_reg(GCLK, USB_GCLK_ID, GCLK_PCHCTRL_GEN_GCLK0_Val | GCLK_PCHCTRL_CHEN);
- hri_mclk_set_AHBMASK_USB_bit(MCLK);
- hri_mclk_set_APBBMASK_USB_bit(MCLK);
-
- // USB pin init
- gpio_set_pin_direction(PIN_PA24, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(PIN_PA24, false);
- gpio_set_pin_pull_mode(PIN_PA24, GPIO_PULL_OFF);
- gpio_set_pin_direction(PIN_PA25, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(PIN_PA25, false);
- gpio_set_pin_pull_mode(PIN_PA25, GPIO_PULL_OFF);
-
- gpio_set_pin_function(PIN_PA24, PINMUX_PA24H_USB_DM);
- gpio_set_pin_function(PIN_PA25, PINMUX_PA25H_USB_DP);
-
-
-#if CFG_TUSB_DEBUG >= 2
- uart_send_str(BOARD_NAME " USB device configured\n");
-#endif
-#endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- gpio_set_pin_level(LED_PIN, !state);
-}
-
-uint32_t board_button_read(void)
-{
- return (PORT->Group[1].IN.reg & 0x80000000) != 0x80000000;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- if (len < 0) {
- uart_send_str(buf);
- } else {
- uart_send_buffer(buf, len);
- }
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-
-void SysTick_Handler(void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/same70_xplained/board.mk b/tinyusb/hw/bsp/same70_xplained/board.mk
deleted file mode 100755
index c9bc0cea..00000000
--- a/tinyusb/hw/bsp/same70_xplained/board.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/microchip
-
-CFLAGS += \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m7 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib -nostartfiles \
- -D__SAME70Q21B__ \
- -DCFG_TUSB_MCU=OPT_MCU_SAMX7X
-
-# suppress following warnings from mcu driver
-CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align
-
-ASF_DIR = hw/mcu/microchip/same70
-
-# All source paths should be relative to the top level.
-LD_FILE = $(ASF_DIR)/same70b/gcc/gcc/same70q21b_flash.ld
-
-SRC_C += \
- src/portable/microchip/samx7x/dcd_samx7x.c \
- $(ASF_DIR)/same70b/gcc/gcc/startup_same70q21b.c \
- $(ASF_DIR)/same70b/gcc/system_same70q21b.c \
- $(ASF_DIR)/hpl/core/hpl_init.c \
- $(ASF_DIR)/hpl/usart/hpl_usart.c \
- $(ASF_DIR)/hpl/pmc/hpl_pmc.c \
- $(ASF_DIR)/hal/src/hal_usart_async.c \
- $(ASF_DIR)/hal/src/hal_io.c \
- $(ASF_DIR)/hal/src/hal_atomic.c \
- $(ASF_DIR)/hal/utils/src/utils_ringbuffer.c
-
-INC += \
- $(TOP)/hw/bsp/$(BOARD) \
- $(TOP)/$(ASF_DIR) \
- $(TOP)/$(ASF_DIR)/config \
- $(TOP)/$(ASF_DIR)/same70b/include \
- $(TOP)/$(ASF_DIR)/hal/include \
- $(TOP)/$(ASF_DIR)/hal/utils/include \
- $(TOP)/$(ASF_DIR)/hpl/core \
- $(TOP)/$(ASF_DIR)/hpl/pio \
- $(TOP)/$(ASF_DIR)/hpl/pmc \
- $(TOP)/$(ASF_DIR)/hri \
- $(TOP)/$(ASF_DIR)/CMSIS/Core/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM7
-
-# For flash-jlink target
-JLINK_DEVICE = SAME70Q21B
-
-# flash using edbg from https://github.com/ataradov/edbg
-# Note: SAME70's GPNVM1 must be set to 1 to boot from flash with
-# edbg -t same70 -F w0,1,1
-flash: $(BUILD)/$(PROJECT).bin
- edbg --verbose -t same70 -pv -f $<
diff --git a/tinyusb/hw/bsp/same70_xplained/hpl_pmc_config.h b/tinyusb/hw/bsp/same70_xplained/hpl_pmc_config.h
deleted file mode 100755
index 387aaa5d..00000000
--- a/tinyusb/hw/bsp/same70_xplained/hpl_pmc_config.h
+++ /dev/null
@@ -1,1053 +0,0 @@
-/* Auto-generated config file hpl_pmc_config.h */
-#ifndef HPL_PMC_CONFIG_H
-#define HPL_PMC_CONFIG_H
-
-// <<< Use Configuration Wizard in Context Menu >>>
-
-#include <peripheral_clk_config.h>
-
-#define CLK_SRC_OPTION_OSC32K 0
-#define CLK_SRC_OPTION_XOSC32K 1
-#define CLK_SRC_OPTION_OSC12M 2
-#define CLK_SRC_OPTION_XOSC20M 3
-
-#define CLK_SRC_OPTION_SLCK 0
-#define CLK_SRC_OPTION_MAINCK 1
-#define CLK_SRC_OPTION_PLLACK 2
-#define CLK_SRC_OPTION_UPLLCKDIV 3
-#define CLK_SRC_OPTION_MCK 4
-
-#define CLK_SRC_OPTION_UPLLCK 3
-
-#define CONF_RC_4M 0
-#define CONF_RC_8M 1
-#define CONF_RC_12M 2
-
-#define CONF_XOSC32K_NO_BYPASS 0
-#define CONF_XOSC32K_BYPASS 1
-
-#define CONF_XOSC20M_NO_BYPASS 0
-#define CONF_XOSC20M_BYPASS 1
-
-// <e> Clock_SLCK configuration
-// <i> Indicates whether SLCK configuration is enabled or not
-// <id> enable_clk_gen_slck
-#ifndef CONF_CLK_SLCK_CONFIG
-#define CONF_CLK_SLCK_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator SLCK source
-
-// <CLK_SRC_OPTION_OSC32K"> 32kHz High Accuracy Internal Oscillator (OSC32K)
-
-// <CLK_SRC_OPTION_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
-
-// <i> This defines the clock source for SLCK
-// <id> clk_gen_slck_oscillator
-#ifndef CONF_CLK_GEN_SLCK_SRC
-#define CONF_CLK_GEN_SLCK_SRC CLK_SRC_OPTION_OSC32K
-#endif
-
-// <q> Enable Clock_SLCK
-// <i> Indicates whether SLCK is enabled or disable
-// <id> clk_gen_slck_arch_enable
-#ifndef CONF_CLK_SLCK_ENABLE
-#define CONF_CLK_SLCK_ENABLE 1
-#endif
-
-// </h>
-
-// <h>
-
-// </h>
-// </e>// <e> Clock_MAINCK configuration
-// <i> Indicates whether MAINCK configuration is enabled or not
-// <id> enable_clk_gen_mainck
-#ifndef CONF_CLK_MAINCK_CONFIG
-#define CONF_CLK_MAINCK_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator MAINCK source
-
-// <CLK_SRC_OPTION_OSC12M"> Embedded 4/8/12MHz RC Oscillator (OSC12M)
-
-// <CLK_SRC_OPTION_XOSC20M"> External 3-20MHz Oscillator (XOSC20M)
-
-// <i> This defines the clock source for MAINCK
-// <id> clk_gen_mainck_oscillator
-#ifndef CONF_CLK_GEN_MAINCK_SRC
-#define CONF_CLK_GEN_MAINCK_SRC CLK_SRC_OPTION_XOSC20M
-#endif
-
-// <q> Enable Clock_MAINCK
-// <i> Indicates whether MAINCK is enabled or disable
-// <id> clk_gen_mainck_arch_enable
-#ifndef CONF_CLK_MAINCK_ENABLE
-#define CONF_CLK_MAINCK_ENABLE 1
-#endif
-
-// <q> Enable Main Clock Failure Detection
-// <i> Indicates whether Main Clock Failure Detection is enabled or disable.
-// <i> The 4/8/12 MHz RC oscillator must be selected as the source of MAINCK.
-// <id> clk_gen_cfden_enable
-#ifndef CONF_CLK_CFDEN_ENABLE
-#define CONF_CLK_CFDEN_ENABLE 0
-#endif
-
-// </h>
-
-// <h>
-
-// </h>
-// </e>// <e> Clock_MCKR configuration
-// <i> Indicates whether MCKR configuration is enabled or not
-// <id> enable_clk_gen_mckr
-#ifndef CONF_CLK_MCKR_CONFIG
-#define CONF_CLK_MCKR_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator MCKR source
-
-// <CLK_SRC_OPTION_SLCK"> Slow Clock (SLCK)
-
-// <CLK_SRC_OPTION_MAINCK"> Main Clock (MAINCK)
-
-// <CLK_SRC_OPTION_PLLACK"> PLLA Clock (PLLACK)
-
-// <CLK_SRC_OPTION_UPLLCKDIV"> UDPLL with Divider (MCKR UPLLDIV2)
-
-// <i> This defines the clock source for MCKR
-// <id> clk_gen_mckr_oscillator
-#ifndef CONF_CLK_GEN_MCKR_SRC
-#define CONF_CLK_GEN_MCKR_SRC CLK_SRC_OPTION_PLLACK
-#endif
-
-// <q> Enable Clock_MCKR
-// <i> Indicates whether MCKR is enabled or disable
-// <id> clk_gen_mckr_arch_enable
-#ifndef CONF_CLK_MCKR_ENABLE
-#define CONF_CLK_MCKR_ENABLE 1
-#endif
-
-// </h>
-
-// <h>
-
-// <o> Master Clock Prescaler
-// <0=> 1
-// <1=> 2
-// <2=> 4
-// <3=> 8
-// <4=> 16
-// <5=> 32
-// <6=> 64
-// <7=> 3
-// <i> Select the clock prescaler.
-// <id> mckr_presc
-#ifndef CONF_MCKR_PRESC
-#define CONF_MCKR_PRESC 0
-#endif
-
-// </h>
-// </e>// <e> Clock_MCK configuration
-// <i> Indicates whether MCK configuration is enabled or not
-// <id> enable_clk_gen_mck
-#ifndef CONF_CLK_MCK_CONFIG
-#define CONF_CLK_MCK_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator MCK source
-
-// <CLK_SRC_OPTION_MCKR"> Master Clock Controller (PMC_MCKR)
-
-// <i> This defines the clock source for MCK
-// <id> clk_gen_mck_oscillator
-#ifndef CONF_CLK_GEN_MCK_SRC
-#define CONF_CLK_GEN_MCK_SRC CLK_SRC_OPTION_MCKR
-#endif
-
-// </h>
-
-// <h>
-
-//<o> Master Clock Controller Divider MCK divider
-// <0=> 1
-// <1=> 2
-// <3=> 3
-// <2=> 4
-// <i> Select the master clock divider.
-// <id> mck_div
-#ifndef CONF_MCK_DIV
-#define CONF_MCK_DIV 1
-#endif
-
-// </h>
-// </e>// <e> Clock_SYSTICK configuration
-// <i> Indicates whether SYSTICK configuration is enabled or not
-// <id> enable_clk_gen_systick
-#ifndef CONF_CLK_SYSTICK_CONFIG
-#define CONF_CLK_SYSTICK_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator SYSTICK source
-
-// <CLK_SRC_OPTION_MCKR"> Master Clock Controller (PMC_MCKR)
-
-// <i> This defines the clock source for SYSTICK
-// <id> clk_gen_systick_oscillator
-#ifndef CONF_CLK_GEN_SYSTICK_SRC
-#define CONF_CLK_GEN_SYSTICK_SRC CLK_SRC_OPTION_MCKR
-#endif
-
-// </h>
-
-// <h>
-
-// <o> Systick clock divider
-// <8=> 8
-// <i> Select systick clock divider
-// <id> systick_clock_div
-#ifndef CONF_SYSTICK_DIV
-#define CONF_SYSTICK_DIV 8
-#endif
-
-// </h>
-// </e>// <e> Clock_FCLK configuration
-// <i> Indicates whether FCLK configuration is enabled or not
-// <id> enable_clk_gen_fclk
-#ifndef CONF_CLK_FCLK_CONFIG
-#define CONF_CLK_FCLK_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator FCLK source
-
-// <CLK_SRC_OPTION_MCKR"> Master Clock Controller (PMC_MCKR)
-
-// <i> This defines the clock source for FCLK
-// <id> clk_gen_fclk_oscillator
-#ifndef CONF_CLK_GEN_FCLK_SRC
-#define CONF_CLK_GEN_FCLK_SRC CLK_SRC_OPTION_MCKR
-#endif
-
-// </h>
-
-// <h>
-
-// </h>
-// </e>// <e> Clock_GCLK0 configuration
-// <i> Indicates whether GCLK0 configuration is enabled or not
-// <id> enable_clk_gen_gclk0
-#ifndef CONF_CLK_GCLK0_CONFIG
-#define CONF_CLK_GCLK0_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator GCLK0 source
-
-// <CLK_SRC_OPTION_SLCK"> Slow Clock (SLCK)
-
-// <CLK_SRC_OPTION_MAINCK"> Main Clock (MAINCK)
-
-// <CLK_SRC_OPTION_UPLLCK"> USB 480M Clock (UPLLCK)
-
-// <CLK_SRC_OPTION_PLLACK"> PLLA Clock (PLLACK)
-
-// <CLK_SRC_OPTION_MCK"> Master Clock (MCK)
-
-// <i> This defines the clock source for GCLK0
-// <id> clk_gen_gclk0_oscillator
-#ifndef CONF_CLK_GEN_GCLK0_SRC
-#define CONF_CLK_GEN_GCLK0_SRC CLK_SRC_OPTION_MCK
-#endif
-
-// <q> Enable Clock_GCLK0
-// <i> Indicates whether GCLK0 is enabled or disable
-// <id> clk_gen_gclk0_arch_enable
-#ifndef CONF_CLK_GCLK0_ENABLE
-#define CONF_CLK_GCLK0_ENABLE 1
-#endif
-
-// </h>
-
-// <h>
-// <q> Enable GCLK0 GCLKEN
-// <i> Indicates whether GCLK0 GCLKEN is enabled or disable
-// <id> gclk0_gclken_enable
-#ifndef CONF_GCLK0_GCLKEN_ENABLE
-#define CONF_GCLK0_GCLKEN_ENABLE 0
-#endif
-
-// <o> Generic Clock GCLK0 divider <1-256>
-// <i> Select the clock divider (divider = GCLKDIV + 1).
-// <id> gclk0_div
-#ifndef CONF_GCLK0_DIV
-#define CONF_GCLK0_DIV 2
-#endif
-
-// </h>
-// </e>// <e> Clock_GCLK1 configuration
-// <i> Indicates whether GCLK1 configuration is enabled or not
-// <id> enable_clk_gen_gclk1
-#ifndef CONF_CLK_GCLK1_CONFIG
-#define CONF_CLK_GCLK1_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator GCLK1 source
-
-// <CLK_SRC_OPTION_SLCK"> Slow Clock (SLCK)
-
-// <CLK_SRC_OPTION_MAINCK"> Main Clock (MAINCK)
-
-// <CLK_SRC_OPTION_UPLLCK"> USB 480M Clock (UPLLCK)
-
-// <CLK_SRC_OPTION_PLLACK"> PLLA Clock (PLLACK)
-
-// <CLK_SRC_OPTION_MCK"> Master Clock (MCK)
-
-// <i> This defines the clock source for GCLK1
-// <id> clk_gen_gclk1_oscillator
-#ifndef CONF_CLK_GEN_GCLK1_SRC
-#define CONF_CLK_GEN_GCLK1_SRC CLK_SRC_OPTION_PLLACK
-#endif
-
-// <q> Enable Clock_GCLK1
-// <i> Indicates whether GCLK1 is enabled or disable
-// <id> clk_gen_gclk1_arch_enable
-#ifndef CONF_CLK_GCLK1_ENABLE
-#define CONF_CLK_GCLK1_ENABLE 1
-#endif
-
-// </h>
-
-// <h>
-// <q> Enable GCLK1 GCLKEN
-// <i> Indicates whether GCLK1 GCLKEN is enabled or disable
-// <id> gclk1_gclken_enable
-#ifndef CONF_GCLK1_GCLKEN_ENABLE
-#define CONF_GCLK1_GCLKEN_ENABLE 0
-#endif
-
-// <o> Generic Clock GCLK1 divider <1-256>
-// <i> Select the clock divider (divider = GCLKDIV + 1).
-// <id> gclk1_div
-#ifndef CONF_GCLK1_DIV
-#define CONF_GCLK1_DIV 3
-#endif
-
-// </h>
-// </e>// <e> Clock_PCK0 configuration
-// <i> Indicates whether PCK0 configuration is enabled or not
-// <id> enable_clk_gen_pck0
-#ifndef CONF_CLK_PCK0_CONFIG
-#define CONF_CLK_PCK0_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator PCK0 source
-
-// <CLK_SRC_OPTION_SLCK"> Slow Clock (SLCK)
-
-// <CLK_SRC_OPTION_MAINCK"> Main Clock (MAINCK)
-
-// <CLK_SRC_OPTION_UPLLCKDIV"> UDPLL with Divider (MCKR UPLLDIV2)
-
-// <CLK_SRC_OPTION_PLLACK"> PLLA Clock (PLLACK)
-
-// <CLK_SRC_OPTION_MCK"> Master Clock (MCK)
-
-// <i> This defines the clock source for PCK0
-// <id> clk_gen_pck0_oscillator
-#ifndef CONF_CLK_GEN_PCK0_SRC
-#define CONF_CLK_GEN_PCK0_SRC CLK_SRC_OPTION_MAINCK
-#endif
-
-// <q> Enable Clock_PCK0
-// <i> Indicates whether PCK0 is enabled or disable
-// <id> clk_gen_pck0_arch_enable
-#ifndef CONF_CLK_PCK0_ENABLE
-#define CONF_CLK_PCK0_ENABLE 0
-#endif
-
-// </h>
-
-// <h>
-
-// <o> Programmable Clock Controller Prescaler <1-256>
-// <i> Select the clock prescaler (prescaler = PRESC + 1).
-// <id> pck0_presc
-#ifndef CONF_PCK0_PRESC
-#define CONF_PCK0_PRESC 1
-#endif
-
-// </h>
-// </e>// <e> Clock_PCK1 configuration
-// <i> Indicates whether PCK1 configuration is enabled or not
-// <id> enable_clk_gen_pck1
-#ifndef CONF_CLK_PCK1_CONFIG
-#define CONF_CLK_PCK1_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator PCK1 source
-
-// <CLK_SRC_OPTION_SLCK"> Slow Clock (SLCK)
-
-// <CLK_SRC_OPTION_MAINCK"> Main Clock (MAINCK)
-
-// <CLK_SRC_OPTION_UPLLCKDIV"> UDPLL with Divider (MCKR UPLLDIV2)
-
-// <CLK_SRC_OPTION_PLLACK"> PLLA Clock (PLLACK)
-
-// <CLK_SRC_OPTION_MCK"> Master Clock (MCK)
-
-// <i> This defines the clock source for PCK1
-// <id> clk_gen_pck1_oscillator
-#ifndef CONF_CLK_GEN_PCK1_SRC
-#define CONF_CLK_GEN_PCK1_SRC CLK_SRC_OPTION_MAINCK
-#endif
-
-// <q> Enable Clock_PCK1
-// <i> Indicates whether PCK1 is enabled or disable
-// <id> clk_gen_pck1_arch_enable
-#ifndef CONF_CLK_PCK1_ENABLE
-#define CONF_CLK_PCK1_ENABLE 0
-#endif
-
-// </h>
-
-// <h>
-
-// <o> Programmable Clock Controller Prescaler <1-256>
-// <i> Select the clock prescaler (prescaler = PRESC + 1).
-// <id> pck1_presc
-#ifndef CONF_PCK1_PRESC
-#define CONF_PCK1_PRESC 2
-#endif
-
-// </h>
-// </e>// <e> Clock_PCK2 configuration
-// <i> Indicates whether PCK2 configuration is enabled or not
-// <id> enable_clk_gen_pck2
-#ifndef CONF_CLK_PCK2_CONFIG
-#define CONF_CLK_PCK2_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator PCK2 source
-
-// <CLK_SRC_OPTION_SLCK"> Slow Clock (SLCK)
-
-// <CLK_SRC_OPTION_MAINCK"> Main Clock (MAINCK)
-
-// <CLK_SRC_OPTION_UPLLCKDIV"> UDPLL with Divider (MCKR UPLLDIV2)
-
-// <CLK_SRC_OPTION_PLLACK"> PLLA Clock (PLLACK)
-
-// <CLK_SRC_OPTION_MCK"> Master Clock (MCK)
-
-// <i> This defines the clock source for PCK2
-// <id> clk_gen_pck2_oscillator
-#ifndef CONF_CLK_GEN_PCK2_SRC
-#define CONF_CLK_GEN_PCK2_SRC CLK_SRC_OPTION_MAINCK
-#endif
-
-// <q> Enable Clock_PCK2
-// <i> Indicates whether PCK2 is enabled or disable
-// <id> clk_gen_pck2_arch_enable
-#ifndef CONF_CLK_PCK2_ENABLE
-#define CONF_CLK_PCK2_ENABLE 0
-#endif
-
-// </h>
-
-// <h>
-
-// <o> Programmable Clock Controller Prescaler <1-256>
-// <i> Select the clock prescaler (prescaler = PRESC + 1).
-// <id> pck2_presc
-#ifndef CONF_PCK2_PRESC
-#define CONF_PCK2_PRESC 3
-#endif
-
-// </h>
-// </e>// <e> Clock_PCK3 configuration
-// <i> Indicates whether PCK3 configuration is enabled or not
-// <id> enable_clk_gen_pck3
-#ifndef CONF_CLK_PCK3_CONFIG
-#define CONF_CLK_PCK3_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator PCK3 source
-
-// <CLK_SRC_OPTION_SLCK"> Slow Clock (SLCK)
-
-// <CLK_SRC_OPTION_MAINCK"> Main Clock (MAINCK)
-
-// <CLK_SRC_OPTION_UPLLCKDIV"> UDPLL with Divider (MCKR UPLLDIV2)
-
-// <CLK_SRC_OPTION_PLLACK"> PLLA Clock (PLLACK)
-
-// <CLK_SRC_OPTION_MCK"> Master Clock (MCK)
-
-// <i> This defines the clock source for PCK3
-// <id> clk_gen_pck3_oscillator
-#ifndef CONF_CLK_GEN_PCK3_SRC
-#define CONF_CLK_GEN_PCK3_SRC CLK_SRC_OPTION_MAINCK
-#endif
-
-// <q> Enable Clock_PCK3
-// <i> Indicates whether PCK3 is enabled or disable
-// <id> clk_gen_pck3_arch_enable
-#ifndef CONF_CLK_PCK3_ENABLE
-#define CONF_CLK_PCK3_ENABLE 0
-#endif
-
-// </h>
-
-// <h>
-
-// <o> Programmable Clock Controller Prescaler <1-256>
-// <i> Select the clock prescaler (prescaler = PRESC + 1).
-// <id> pck3_presc
-#ifndef CONF_PCK3_PRESC
-#define CONF_PCK3_PRESC 4
-#endif
-
-// </h>
-// </e>// <e> Clock_PCK4 configuration
-// <i> Indicates whether PCK4 configuration is enabled or not
-// <id> enable_clk_gen_pck4
-#ifndef CONF_CLK_PCK4_CONFIG
-#define CONF_CLK_PCK4_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator PCK4 source
-
-// <CLK_SRC_OPTION_SLCK"> Slow Clock (SLCK)
-
-// <CLK_SRC_OPTION_MAINCK"> Main Clock (MAINCK)
-
-// <CLK_SRC_OPTION_UPLLCKDIV"> UDPLL with Divider (MCKR UPLLDIV2)
-
-// <CLK_SRC_OPTION_PLLACK"> PLLA Clock (PLLACK)
-
-// <CLK_SRC_OPTION_MCK"> Master Clock (MCK)
-
-// <i> This defines the clock source for PCK4
-// <id> clk_gen_pck4_oscillator
-#ifndef CONF_CLK_GEN_PCK4_SRC
-#define CONF_CLK_GEN_PCK4_SRC CLK_SRC_OPTION_MAINCK
-#endif
-
-// <q> Enable Clock_PCK4
-// <i> Indicates whether PCK4 is enabled or disable
-// <id> clk_gen_pck4_arch_enable
-#ifndef CONF_CLK_PCK4_ENABLE
-#define CONF_CLK_PCK4_ENABLE 0
-#endif
-
-// </h>
-
-// <h>
-
-// <o> Programmable Clock Controller Prescaler <1-256>
-// <i> Select the clock prescaler (prescaler = PRESC + 1).
-// <id> pck4_presc
-#ifndef CONF_PCK4_PRESC
-#define CONF_PCK4_PRESC 5
-#endif
-
-// </h>
-// </e>// <e> Clock_PCK5 configuration
-// <i> Indicates whether PCK5 configuration is enabled or not
-// <id> enable_clk_gen_pck5
-#ifndef CONF_CLK_PCK5_CONFIG
-#define CONF_CLK_PCK5_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator PCK5 source
-
-// <CLK_SRC_OPTION_SLCK"> Slow Clock (SLCK)
-
-// <CLK_SRC_OPTION_MAINCK"> Main Clock (MAINCK)
-
-// <CLK_SRC_OPTION_UPLLCKDIV"> UDPLL with Divider (MCKR UPLLDIV2)
-
-// <CLK_SRC_OPTION_PLLACK"> PLLA Clock (PLLACK)
-
-// <CLK_SRC_OPTION_MCK"> Master Clock (MCK)
-
-// <i> This defines the clock source for PCK5
-// <id> clk_gen_pck5_oscillator
-#ifndef CONF_CLK_GEN_PCK5_SRC
-#define CONF_CLK_GEN_PCK5_SRC CLK_SRC_OPTION_MAINCK
-#endif
-
-// <q> Enable Clock_PCK5
-// <i> Indicates whether PCK5 is enabled or disable
-// <id> clk_gen_pck5_arch_enable
-#ifndef CONF_CLK_PCK5_ENABLE
-#define CONF_CLK_PCK5_ENABLE 0
-#endif
-
-// </h>
-
-// <h>
-
-// <o> Programmable Clock Controller Prescaler <1-256>
-// <i> Select the clock prescaler (prescaler = PRESC + 1).
-// <id> pck5_presc
-#ifndef CONF_PCK5_PRESC
-#define CONF_PCK5_PRESC 6
-#endif
-
-// </h>
-// </e>// <e> Clock_PCK6 configuration
-// <i> Indicates whether PCK6 configuration is enabled or not
-// <id> enable_clk_gen_pck6
-#ifndef CONF_CLK_PCK6_CONFIG
-#define CONF_CLK_PCK6_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator PCK6 source
-
-// <CLK_SRC_OPTION_SLCK"> Slow Clock (SLCK)
-
-// <CLK_SRC_OPTION_MAINCK"> Main Clock (MAINCK)
-
-// <CLK_SRC_OPTION_UPLLCKDIV"> UDPLL with Divider (MCKR UPLLDIV2)
-
-// <CLK_SRC_OPTION_PLLACK"> PLLA Clock (PLLACK)
-
-// <CLK_SRC_OPTION_MCK"> Master Clock (MCK)
-
-// <i> This defines the clock source for PCK6
-// <id> clk_gen_pck6_oscillator
-#ifndef CONF_CLK_GEN_PCK6_SRC
-#define CONF_CLK_GEN_PCK6_SRC CLK_SRC_OPTION_MAINCK
-#endif
-
-// <q> Enable Clock_PCK6
-// <i> Indicates whether PCK6 is enabled or disable
-// <id> clk_gen_pck6_arch_enable
-#ifndef CONF_CLK_PCK6_ENABLE
-#define CONF_CLK_PCK6_ENABLE 0
-#endif
-
-// </h>
-
-// <h>
-
-// <o> Programmable Clock Controller Prescaler <1-256>
-// <i> Select the clock prescaler (prescaler = PRESC + 1).
-// <id> pck6_presc
-#ifndef CONF_PCK6_PRESC
-#define CONF_PCK6_PRESC 7
-#endif
-
-// </h>
-// </e>// <e> Clock_USB_480M configuration
-// <i> Indicates whether USB_480M configuration is enabled or not
-// <id> enable_clk_gen_usb_480m
-#ifndef CONF_CLK_USB_480M_CONFIG
-#define CONF_CLK_USB_480M_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator USB_480M source
-
-// <CLK_SRC_OPTION_UPLLCK"> USB 480M Clock (UPLLCK)
-
-// <i> This defines the clock source for USB_480M
-// <id> clk_gen_usb_480m_oscillator
-#ifndef CONF_CLK_GEN_USB_480M_SRC
-#define CONF_CLK_GEN_USB_480M_SRC CLK_SRC_OPTION_UPLLCK
-#endif
-
-// </h>
-
-// <h>
-
-// </h>
-// </e>// <e> Clock_USB_48M configuration
-// <i> Indicates whether USB_48M configuration is enabled or not
-// <id> enable_clk_gen_usb_48m
-#ifndef CONF_CLK_USB_48M_CONFIG
-#define CONF_CLK_USB_48M_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator USB_48M source
-
-// <CLK_SRC_OPTION_PLLACK"> PLLA Clock (PLLACK)
-
-// <CLK_SRC_OPTION_UPLLCKDIV"> UDPLL with Divider (MCKR UPLLDIV2)
-
-// <i> This defines the clock source for USB_48M
-// <id> clk_gen_usb_48m_oscillator
-#ifndef CONF_CLK_GEN_USB_48M_SRC
-#define CONF_CLK_GEN_USB_48M_SRC CLK_SRC_OPTION_UPLLCKDIV
-#endif
-
-// <q> Enable Clock_USB_48M
-// <i> Indicates whether USB_48M is enabled or disable
-// <id> clk_gen_usb_48m_arch_enable
-#ifndef CONF_CLK_USB_48M_ENABLE
-#define CONF_CLK_USB_48M_ENABLE 1
-#endif
-
-// </h>
-
-// <h>
-
-// <o> USB Clock Controller Divider <1-16>
-// <i> Select the USB clock divider (divider = USBDIV + 1).
-// <id> usb_48m_div
-#ifndef CONF_USB_48M_DIV
-#define CONF_USB_48M_DIV 5
-#endif
-
-// </h>
-// </e>// <e> Clock_SLCK2 configuration
-// <i> Indicates whether SLCK2 configuration is enabled or not
-// <id> enable_clk_gen_slck2
-#ifndef CONF_CLK_SLCK2_CONFIG
-#define CONF_CLK_SLCK2_CONFIG 1
-#endif
-
-//<h> Clock Generator
-// <y> clock generator SLCK2 source
-
-// <CLK_SRC_OPTION_SLCK"> Slow Clock (SLCK)
-
-// <i> This defines the clock source for SLCK2
-// <id> clk_gen_slck2_oscillator
-#ifndef CONF_CLK_GEN_SLCK2_SRC
-#define CONF_CLK_GEN_SLCK2_SRC CLK_SRC_OPTION_SLCK
-#endif
-
-// </h>
-
-// <h>
-
-// </h>
-// </e>
-
-// <e> System Configuration
-// <i> Indicates whether configuration for system is enabled or not
-// <id> enable_hclk_clock
-#ifndef CONF_SYSTEM_CONFIG
-#define CONF_SYSTEM_CONFIG 1
-#endif
-
-// <h> Processor Clock Settings
-// <y> Processor Clock source
-// <MCKR"> Master Clock Controller (PMC_MCKR)
-// <i> This defines the clock source for the HCLK (Processor clock)
-// <id> hclk_clock_source
-#ifndef CONF_HCLK_SRC
-#define CONF_HCLK_SRC MCKR
-#endif
-
-// <o> Flash Wait State
-// <0=> 1 cycle
-// <1=> 2 cycles
-// <2=> 3 cycles
-// <3=> 4 cycles
-// <4=> 5 cycles
-// <5=> 6 cycles
-// <6=> 7 cycles
-// <i> This field defines the number of wait states for read and write operations.
-// <id> efc_fws
-#ifndef CONF_EFC_WAIT_STATE
-#define CONF_EFC_WAIT_STATE 5
-#endif
-
-// </h>
-// </e>
-
-// <e> SysTick Clock
-// <id> enable_systick_clk_clock
-#ifndef CONF_SYSTICK_CLK_CONFIG
-#define CONF_SYSTICK_CLK_CONFIG 1
-#endif
-
-// <y> SysTick Clock source
-// <MCKR"> Master Clock Controller (PMC_MCKR)
-// <i> This defines the clock source for the SysTick Clock
-// <id> systick_clk_clock_source
-#ifndef CONF_SYSTICK_CLK_SRC
-#define CONF_SYSTICK_CLK_SRC MCKR
-#endif
-
-// <o> SysTick Clock Divider
-// <8=> 8
-// <i> Fixed to 8 if Systick is not using Processor clock
-// <id> systick_clk_clock_div
-#ifndef CONF_SYSTICK_CLK_DIV
-#define CONF_SYSTICK_CLK_DIV 8
-#endif
-
-// </e>
-
-// <e> OSC32K Oscillator Configuration
-// <i> Indicates whether configuration for OSC32K is enabled or not
-// <id> enable_osc32k
-#ifndef CONF_OSC32K_CONFIG
-#define CONF_OSC32K_CONFIG 1
-#endif
-
-// <h> OSC32K Oscillator Control
-// <q> OSC32K Oscillator Enable
-// <i> Indicates whether OSC32K Oscillator is enabled or not
-// <id> osc32k_arch_enable
-#ifndef CONF_OSC32K_ENABLE
-#define CONF_OSC32K_ENABLE 0
-#endif
-// </h>
-// </e>
-
-// <e> XOSC32K Oscillator Configuration
-// <i> Indicates whether configuration for XOSC32K is enabled or not
-// <id> enable_xosc32k
-#ifndef CONF_XOSC32K_CONFIG
-#define CONF_XOSC32K_CONFIG 0
-#endif
-
-// <h> XOSC32K Oscillator Control
-// <y> Oscillator Bypass Select
-// <CONF_XOSC32K_NO_BYPASS"> The 32kHz crystal oscillator is not bypassed.
-// <CONF_XOSC32K_BYPASS"> The 32kHz crystal oscillator is bypassed.
-// <i> Indicates whether XOSC32K is bypassed.
-// <id> xosc32k_bypass
-#ifndef CONF_XOSC32K
-#define CONF_XOSC32K CONF_XOSC32K_NO_BYPASS
-#endif
-
-// <q> XOSC32K Oscillator Enable
-// <i> Indicates whether XOSC32K Oscillator is enabled or not
-// <id> xosc32k_arch_enable
-#ifndef CONF_XOSC32K_ENABLE
-#define CONF_XOSC32K_ENABLE 0
-#endif
-// </h>
-// </e>
-
-// <e> OSC12M Oscillator Configuration
-// <i> Indicates whether configuration for OSC12M is enabled or not
-// <id> enable_osc12m
-#ifndef CONF_OSC12M_CONFIG
-#define CONF_OSC12M_CONFIG 0
-#endif
-
-// <h> OSC12M Oscillator Control
-// <q> OSC12M Oscillator Enable
-// <i> Indicates whether OSC12M Oscillator is enabled or not.
-// <id> osc12m_arch_enable
-#ifndef CONF_OSC12M_ENABLE
-#define CONF_OSC12M_ENABLE 0
-#endif
-
-// <o> OSC12M selector
-// <0=> 4000000
-// <1=> 8000000
-// <2=> 12000000
-// <i> Select the frequency of embedded fast RC oscillator.
-// <id> osc12m_selector
-#ifndef CONF_OSC12M_SELECTOR
-#define CONF_OSC12M_SELECTOR 2
-#endif
-// </h>
-// </e>
-
-// <e> XOSC20M Oscillator Configuration
-// <i> Indicates whether configuration for XOSC20M is enabled or not.
-// <id> enable_xosc20m
-#ifndef CONF_XOSC20M_CONFIG
-#define CONF_XOSC20M_CONFIG 1
-#endif
-
-// <h> XOSC20M Oscillator Control
-// <o> XOSC20M selector <3000000-20000000>
-// <i> Select the frequency of crystal or ceramic resonator oscillator.
-// <id> xosc20m_selector
-#ifndef CONF_XOSC20M_SELECTOR
-#define CONF_XOSC20M_SELECTOR 12000000
-#endif
-
-// <o> Start up time for the external oscillator (ms): <0-256>
-// <i> Select start-up time.
-// <id> xosc20m_startup_time
-#ifndef CONF_XOSC20M_STARTUP_TIME
-#define CONF_XOSC20M_STARTUP_TIME 62
-#endif
-
-// <y> Oscillator Bypass Select
-// <CONF_XOSC20M_NO_BYPASS"> The external crystal oscillator is not bypassed.
-// <CONF_XOSC20M_BYPASS"> The external crystal oscillator is bypassed.
-// <i> Indicates whether XOSC20M is bypassed.
-// <id> xosc20m_bypass
-#ifndef CONF_XOSC20M
-#define CONF_XOSC20M CONF_XOSC20M_NO_BYPASS
-#endif
-
-// <q> XOSC20M Oscillator Enable
-// <i> Indicates whether XOSC20M Oscillator is enabled or not
-// <id> xosc20m_arch_enable
-#ifndef CONF_XOSC20M_ENABLE
-#define CONF_XOSC20M_ENABLE 1
-#endif
-// </h>
-// </e>
-
-// <e> PLLACK Oscillator Configuration
-// <i> Indicates whether configuration for PLLACK is enabled or not
-// <id> enable_pllack
-#ifndef CONF_PLLACK_CONFIG
-#define CONF_PLLACK_CONFIG 1
-#endif
-
-// <y> PLLACK Reference Clock Source
-// <MAINCK"> Main Clock (MAINCK)
-// <i> Select the clock source.
-// <id> pllack_ref_clock
-#ifndef CONF_PLLACK_CLK
-#define CONF_PLLACK_CLK MAINCK
-#endif
-
-// <h> PLLACK Oscillator Control
-// <q> PLLACK Oscillator Enable
-// <i> Indicates whether PLLACK Oscillator is enabled or not
-// <id> pllack_arch_enable
-#ifndef CONF_PLLACK_ENABLE
-#define CONF_PLLACK_ENABLE 1
-#endif
-
-// <o> PLLA Frontend Divider (DIVA) <1-255>
-// <i> Select the clock divider
-// <id> pllack_div
-#ifndef CONF_PLLACK_DIV
-#define CONF_PLLACK_DIV 1
-#endif
-
-// <o> PLLACK Muliplier <1-62>
-// <i> Indicates PLLA multiplier (multiplier = MULA + 1).
-// <id> pllack_mul
-#ifndef CONF_PLLACK_MUL
-#define CONF_PLLACK_MUL 25
-#endif
-// </h>
-// </e>
-
-// <e> UPLLCK Oscillator Configuration
-// <i> Indicates whether configuration for UPLLCK is enabled or not
-// <id> enable_upllck
-#ifndef CONF_UPLLCK_CONFIG
-#define CONF_UPLLCK_CONFIG 1
-#endif
-
-// <y> UPLLCK Reference Clock Source
-// <XOSC20M"> External 3-20MHz Oscillator (XOSC20M)
-// <i> Select the clock source,only when the input frequency is 12M or 16M, the upllck output is 480M.
-// <id> upllck_ref_clock
-#ifndef CONF_UPLLCK_CLK
-#define CONF_UPLLCK_CLK XOSC20M
-#endif
-
-// <h> UPLLCK Oscillator Control
-// <q> UPLLCK Oscillator Enable
-// <i> Indicates whether UPLLCK Oscillator is enabled or not
-// <id> upllck_arch_enable
-#ifndef CONF_UPLLCK_ENABLE
-#define CONF_UPLLCK_ENABLE 1
-#endif
-// </h>
-// </e>
-
-// <e> UPLLCKDIV Oscillator Configuration
-// <i> Indicates whether configuration for UPLLCKDIV is enabled or not
-// <id> enable_upllckdiv
-#ifndef CONF_UPLLCKDIV_CONFIG
-#define CONF_UPLLCKDIV_CONFIG 1
-#endif
-
-// <y> UPLLCKDIV Reference Clock Source
-// <UPLLCK"> USB 480M Clock (UPLLCK)
-// <i> Select the clock source.
-// <id> upllckdiv_ref_clock
-#ifndef CONF_UPLLCKDIV_CLK
-#define CONF_UPLLCKDIV_CLK UPLLCK
-#endif
-
-// <h> UPLLCKDIV Oscillator Control
-// <o> UPLLCKDIV Clock Divider
-// <0=> 1
-// <1=> 2
-// <i> Select the clock divider.
-// <id> upllckdiv_div
-#ifndef CONF_UPLLCKDIV_DIV
-#define CONF_UPLLCKDIV_DIV 1
-#endif
-// </h>
-// </e>
-
-// <e> MCK/8
-// <id> enable_mck_div_8
-#ifndef CONF_MCK_DIV_8_CONFIG
-#define CONF_MCK_DIV_8_CONFIG 0
-#endif
-
-// <o> MCK/8 Source
-// <0=> Master Clock (MCK)
-// <id> mck_div_8_src
-#ifndef CONF_MCK_DIV_8_SRC
-#define CONF_MCK_DIV_8_SRC 0
-#endif
-// </e>
-
-// <e> External Clock Input Configuration
-// <id> enable_dummy_ext
-#ifndef CONF_DUMMY_EXT_CONFIG
-#define CONF_DUMMY_EXT_CONFIG 1
-#endif
-
-// <o> External Clock Input Source
-// <i> All here are dummy values
-// <i> Refer to the peripherals settings for actual input information
-// <0=> Specific clock input from specific pin
-// <id> dummy_ext_src
-#ifndef CONF_DUMMY_EXT_SRC
-#define CONF_DUMMY_EXT_SRC 0
-#endif
-// </e>
-
-// <e> External Clock Configuration
-// <id> enable_dummy_ext_clk
-#ifndef CONF_DUMMY_EXT_CLK_CONFIG
-#define CONF_DUMMY_EXT_CLK_CONFIG 1
-#endif
-
-// <o> External Clock Source
-// <i> All here are dummy values
-// <i> Refer to the peripherals settings for actual input information
-// <0=> External Clock Input
-// <id> dummy_ext_clk_src
-#ifndef CONF_DUMMY_EXT_CLK_SRC
-#define CONF_DUMMY_EXT_CLK_SRC 0
-#endif
-// </e>
-
-// <<< end of configuration section >>>
-
-#endif // HPL_PMC_CONFIG_H
diff --git a/tinyusb/hw/bsp/same70_xplained/hpl_usart_config.h b/tinyusb/hw/bsp/same70_xplained/hpl_usart_config.h
deleted file mode 100755
index 50ca3f15..00000000
--- a/tinyusb/hw/bsp/same70_xplained/hpl_usart_config.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/* Auto-generated config file hpl_usart_config.h */
-#ifndef HPL_USART_CONFIG_H
-#define HPL_USART_CONFIG_H
-
-// <<< Use Configuration Wizard in Context Menu >>>
-
-#include <peripheral_clk_config.h>
-
-#ifndef CONF_USART_1_ENABLE
-#define CONF_USART_1_ENABLE 1
-#endif
-
-// <h> Basic Configuration
-
-// <o> Frame parity
-// <0x0=>Even parity
-// <0x1=>Odd parity
-// <0x2=>Parity forced to 0
-// <0x3=>Parity forced to 1
-// <0x4=>No parity
-// <i> Parity bit mode for USART frame
-// <id> usart_parity
-#ifndef CONF_USART_1_PARITY
-#define CONF_USART_1_PARITY 0x4
-#endif
-
-// <o> Character Size
-// <0x0=>5 bits
-// <0x1=>6 bits
-// <0x2=>7 bits
-// <0x3=>8 bits
-// <i> Data character size in USART frame
-// <id> usart_character_size
-#ifndef CONF_USART_1_CHSIZE
-#define CONF_USART_1_CHSIZE 0x3
-#endif
-
-// <o> Stop Bit
-// <0=>1 stop bit
-// <1=>1.5 stop bits
-// <2=>2 stop bits
-// <i> Number of stop bits in USART frame
-// <id> usart_stop_bit
-#ifndef CONF_USART_1_SBMODE
-#define CONF_USART_1_SBMODE 0
-#endif
-
-// <o> Clock Output Select
-// <0=>The USART does not drive the SCK pin
-// <1=>The USART drives the SCK pin if USCLKS does not select the external clock SCK
-// <i> Clock Output Select in USART sck, if in usrt master mode, please drive SCK.
-// <id> usart_clock_output_select
-#ifndef CONF_USART_1_CLKO
-#define CONF_USART_1_CLKO 0
-#endif
-
-// <o> Baud rate <1-3000000>
-// <i> USART baud rate setting
-// <id> usart_baud_rate
-#ifndef CONF_USART_1_BAUD
-#define CONF_USART_1_BAUD 9600
-#endif
-
-// </h>
-
-// <e> Advanced configuration
-// <id> usart_advanced
-#ifndef CONF_USART_1_ADVANCED_CONFIG
-#define CONF_USART_1_ADVANCED_CONFIG 0
-#endif
-
-// <o> Channel Mode
-// <0=>Normal Mode
-// <1=>Automatic Echo
-// <2=>Local Loopback
-// <3=>Remote Loopback
-// <i> Channel mode in USART frame
-// <id> usart_channel_mode
-#ifndef CONF_USART_1_CHMODE
-#define CONF_USART_1_CHMODE 0
-#endif
-
-// <q> 9 bits character enable
-// <i> Enable 9 bits character, this has high priority than 5/6/7/8 bits.
-// <id> usart_9bits_enable
-#ifndef CONF_USART_1_MODE9
-#define CONF_USART_1_MODE9 0
-#endif
-
-// <o> Variable Sync
-// <0=>User defined configuration
-// <1=>sync field is updated when a character is written into US_THR
-// <i> Variable Synchronization of Command/Data Sync Start Frarm Delimiter
-// <id> variable_sync
-#ifndef CONF_USART_1_VAR_SYNC
-#define CONF_USART_1_VAR_SYNC 0
-#endif
-
-// <o> Oversampling Mode
-// <0=>16 Oversampling
-// <1=>8 Oversampling
-// <i> Oversampling Mode in UART mode
-// <id> usart__oversampling_mode
-#ifndef CONF_USART_1_OVER
-#define CONF_USART_1_OVER 0
-#endif
-
-// <o> Inhibit Non Ack
-// <0=>The NACK is generated
-// <1=>The NACK is not generated
-// <i> Inhibit Non Acknowledge
-// <id> usart__inack
-#ifndef CONF_USART_1_INACK
-#define CONF_USART_1_INACK 1
-#endif
-
-// <o> Disable Successive NACK
-// <0=>NACK is sent on the ISO line as soon as a parity error occurs
-// <1=>Many parity errors generate a NACK on the ISO line
-// <i> Disable Successive NACK
-// <id> usart_dsnack
-#ifndef CONF_USART_1_DSNACK
-#define CONF_USART_1_DSNACK 0
-#endif
-
-// <o> Inverted Data
-// <0=>Data isn't inverted, nomal mode
-// <1=>Data is inverted
-// <i> Inverted Data
-// <id> usart_invdata
-#ifndef CONF_USART_1_INVDATA
-#define CONF_USART_1_INVDATA 0
-#endif
-
-// <o> Maximum Number of Automatic Iteration <0-7>
-// <i> Defines the maximum number of iterations in mode ISO7816, protocol T = 0.
-// <id> usart_max_iteration
-#ifndef CONF_USART_1_MAX_ITERATION
-#define CONF_USART_1_MAX_ITERATION 0
-#endif
-
-// <q> Receive Line Filter enable
-// <i> whether the USART filters the receive line using a three-sample filter
-// <id> usart_receive_filter_enable
-#ifndef CONF_USART_1_FILTER
-#define CONF_USART_1_FILTER 0
-#endif
-
-// <q> Manchester Encoder/Decoder Enable
-// <i> whether the USART Manchester Encoder/Decoder
-// <id> usart_manchester_filter_enable
-#ifndef CONF_USART_1_MAN
-#define CONF_USART_1_MAN 0
-#endif
-
-// <o> Manchester Synchronization Mode
-// <0=>The Manchester start bit is a 0 to 1 transition
-// <1=>The Manchester start bit is a 1 to 0 transition
-// <i> Manchester Synchronization Mode
-// <id> usart_manchester_synchronization_mode
-#ifndef CONF_USART_1_MODSYNC
-#define CONF_USART_1_MODSYNC 0
-#endif
-
-// <o> Start Frame Delimiter Selector
-// <0=>Start frame delimiter is COMMAND or DATA SYNC
-// <1=>Start frame delimiter is one bit
-// <i> Start Frame Delimiter Selector
-// <id> usart_start_frame_delimiter
-#ifndef CONF_USART_1_ONEBIT
-#define CONF_USART_1_ONEBIT 0
-#endif
-
-// <o> Fractional Part <0-7>
-// <i> Fractional part of the baud rate if baud rate generator is in fractional mode
-// <id> usart_arch_fractional
-#ifndef CONF_USART_1_FRACTIONAL
-#define CONF_USART_1_FRACTIONAL 0x0
-#endif
-
-// <o> Data Order
-// <0=>LSB is transmitted first
-// <1=>MSB is transmitted first
-// <i> Data order of the data bits in the frame
-// <id> usart_arch_msbf
-#ifndef CONF_USART_1_MSBF
-#define CONF_USART_1_MSBF 0
-#endif
-
-// </e>
-
-#define CONF_USART_1_MODE 0x0
-
-// Calculate BAUD register value in UART mode
-#if CONF_USART1_CK_SRC < 3
-#ifndef CONF_USART_1_BAUD_CD
-#define CONF_USART_1_BAUD_CD ((CONF_USART1_FREQUENCY) / CONF_USART_1_BAUD / 8 / (2 - CONF_USART_1_OVER))
-#endif
-#ifndef CONF_USART_1_BAUD_FP
-#define CONF_USART_1_BAUD_FP \
- ((CONF_USART1_FREQUENCY) / CONF_USART_1_BAUD / (2 - CONF_USART_1_OVER) - 8 * CONF_USART_1_BAUD_CD)
-#endif
-#elif CONF_USART1_CK_SRC == 3
-// No division is active. The value written in US_BRGR has no effect.
-#ifndef CONF_USART_1_BAUD_CD
-#define CONF_USART_1_BAUD_CD 1
-#endif
-#ifndef CONF_USART_1_BAUD_FP
-#define CONF_USART_1_BAUD_FP 1
-#endif
-#endif
-
-// <<< end of configuration section >>>
-
-#endif // HPL_USART_CONFIG_H
diff --git a/tinyusb/hw/bsp/same70_xplained/hpl_xdmac_config.h b/tinyusb/hw/bsp/same70_xplained/hpl_xdmac_config.h
deleted file mode 100755
index a3d62c6f..00000000
--- a/tinyusb/hw/bsp/same70_xplained/hpl_xdmac_config.h
+++ /dev/null
@@ -1,4400 +0,0 @@
-/* Auto-generated config file hpl_xdmac_config.h */
-#ifndef HPL_XDMAC_CONFIG_H
-#define HPL_XDMAC_CONFIG_H
-
-// <<< Use Configuration Wizard in Context Menu >>>
-
-// <e> XDMAC enable
-// <i> Indicates whether xdmac is enabled or not
-// <id> xdmac_enable
-#ifndef CONF_DMA_ENABLE
-#define CONF_DMA_ENABLE 0
-#endif
-
-// <e> Channel 0 settings
-// <id> dmac_channel_0_settings
-#ifndef CONF_DMAC_CHANNEL_0_SETTINGS
-#define CONF_DMAC_CHANNEL_0_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_0
-#ifndef CONF_DMAC_BURSTSIZE_0
-#define CONF_DMAC_BURSTSIZE_0 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_0
-#ifndef CONF_DMAC_CHUNKSIZE_0
-#define CONF_DMAC_CHUNKSIZE_0 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_0
-#ifndef CONF_DMAC_BEATSIZE_0
-#define CONF_DMAC_BEATSIZE_0 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_0
-#ifndef CONF_DMAC_SRC_INTERFACE_0
-#define CONF_DMAC_SRC_INTERFACE_0 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_0
-#ifndef CONF_DMAC_DES_INTERFACE_0
-#define CONF_DMAC_DES_INTERFACE_0 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_0
-#ifndef CONF_DMAC_SRCINC_0
-#define CONF_DMAC_SRCINC_0 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_0
-#ifndef CONF_DMAC_DSTINC_0
-#define CONF_DMAC_DSTINC_0 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_0
-#ifndef CONF_DMAC_TRANS_TYPE_0
-#define CONF_DMAC_TRANS_TYPE_0 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_0
-#ifndef CONF_DMAC_TRIGSRC_0
-#define CONF_DMAC_TRIGSRC_0 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_0 == 0
-#define CONF_DMAC_TYPE_0 0
-#define CONF_DMAC_DSYNC_0 0
-#elif CONF_DMAC_TRANS_TYPE_0 == 1
-#define CONF_DMAC_TYPE_0 1
-#define CONF_DMAC_DSYNC_0 0
-#elif CONF_DMAC_TRANS_TYPE_0 == 2
-#define CONF_DMAC_TYPE_0 1
-#define CONF_DMAC_DSYNC_0 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_0 == 0xFF
-#define CONF_DMAC_SWREQ_0 1
-#else
-#define CONF_DMAC_SWREQ_0 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_0_SETTINGS == 1 && CONF_DMAC_BEATSIZE_0 != 2 && ((!CONF_DMAC_SRCINC_0) || (!CONF_DMAC_DSTINC_0)))
-#if (!CONF_DMAC_SRCINC_0)
-#define CONF_DMAC_SRC_STRIDE_0 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_0)
-#define CONF_DMAC_DES_STRIDE_0 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_0
-#define CONF_DMAC_SRC_STRIDE_0 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_0
-#define CONF_DMAC_DES_STRIDE_0 0
-#endif
-
-// <e> Channel 1 settings
-// <id> dmac_channel_1_settings
-#ifndef CONF_DMAC_CHANNEL_1_SETTINGS
-#define CONF_DMAC_CHANNEL_1_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_1
-#ifndef CONF_DMAC_BURSTSIZE_1
-#define CONF_DMAC_BURSTSIZE_1 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_1
-#ifndef CONF_DMAC_CHUNKSIZE_1
-#define CONF_DMAC_CHUNKSIZE_1 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_1
-#ifndef CONF_DMAC_BEATSIZE_1
-#define CONF_DMAC_BEATSIZE_1 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_1
-#ifndef CONF_DMAC_SRC_INTERFACE_1
-#define CONF_DMAC_SRC_INTERFACE_1 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_1
-#ifndef CONF_DMAC_DES_INTERFACE_1
-#define CONF_DMAC_DES_INTERFACE_1 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_1
-#ifndef CONF_DMAC_SRCINC_1
-#define CONF_DMAC_SRCINC_1 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_1
-#ifndef CONF_DMAC_DSTINC_1
-#define CONF_DMAC_DSTINC_1 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_1
-#ifndef CONF_DMAC_TRANS_TYPE_1
-#define CONF_DMAC_TRANS_TYPE_1 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_1
-#ifndef CONF_DMAC_TRIGSRC_1
-#define CONF_DMAC_TRIGSRC_1 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_1 == 0
-#define CONF_DMAC_TYPE_1 0
-#define CONF_DMAC_DSYNC_1 0
-#elif CONF_DMAC_TRANS_TYPE_1 == 1
-#define CONF_DMAC_TYPE_1 1
-#define CONF_DMAC_DSYNC_1 0
-#elif CONF_DMAC_TRANS_TYPE_1 == 2
-#define CONF_DMAC_TYPE_1 1
-#define CONF_DMAC_DSYNC_1 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_1 == 0xFF
-#define CONF_DMAC_SWREQ_1 1
-#else
-#define CONF_DMAC_SWREQ_1 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_1_SETTINGS == 1 && CONF_DMAC_BEATSIZE_1 != 2 && ((!CONF_DMAC_SRCINC_1) || (!CONF_DMAC_DSTINC_1)))
-#if (!CONF_DMAC_SRCINC_1)
-#define CONF_DMAC_SRC_STRIDE_1 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_1)
-#define CONF_DMAC_DES_STRIDE_1 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_1
-#define CONF_DMAC_SRC_STRIDE_1 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_1
-#define CONF_DMAC_DES_STRIDE_1 0
-#endif
-
-// <e> Channel 2 settings
-// <id> dmac_channel_2_settings
-#ifndef CONF_DMAC_CHANNEL_2_SETTINGS
-#define CONF_DMAC_CHANNEL_2_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_2
-#ifndef CONF_DMAC_BURSTSIZE_2
-#define CONF_DMAC_BURSTSIZE_2 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_2
-#ifndef CONF_DMAC_CHUNKSIZE_2
-#define CONF_DMAC_CHUNKSIZE_2 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_2
-#ifndef CONF_DMAC_BEATSIZE_2
-#define CONF_DMAC_BEATSIZE_2 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_2
-#ifndef CONF_DMAC_SRC_INTERFACE_2
-#define CONF_DMAC_SRC_INTERFACE_2 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_2
-#ifndef CONF_DMAC_DES_INTERFACE_2
-#define CONF_DMAC_DES_INTERFACE_2 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_2
-#ifndef CONF_DMAC_SRCINC_2
-#define CONF_DMAC_SRCINC_2 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_2
-#ifndef CONF_DMAC_DSTINC_2
-#define CONF_DMAC_DSTINC_2 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_2
-#ifndef CONF_DMAC_TRANS_TYPE_2
-#define CONF_DMAC_TRANS_TYPE_2 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_2
-#ifndef CONF_DMAC_TRIGSRC_2
-#define CONF_DMAC_TRIGSRC_2 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_2 == 0
-#define CONF_DMAC_TYPE_2 0
-#define CONF_DMAC_DSYNC_2 0
-#elif CONF_DMAC_TRANS_TYPE_2 == 1
-#define CONF_DMAC_TYPE_2 1
-#define CONF_DMAC_DSYNC_2 0
-#elif CONF_DMAC_TRANS_TYPE_2 == 2
-#define CONF_DMAC_TYPE_2 1
-#define CONF_DMAC_DSYNC_2 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_2 == 0xFF
-#define CONF_DMAC_SWREQ_2 1
-#else
-#define CONF_DMAC_SWREQ_2 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_2_SETTINGS == 1 && CONF_DMAC_BEATSIZE_2 != 2 && ((!CONF_DMAC_SRCINC_2) || (!CONF_DMAC_DSTINC_2)))
-#if (!CONF_DMAC_SRCINC_2)
-#define CONF_DMAC_SRC_STRIDE_2 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_2)
-#define CONF_DMAC_DES_STRIDE_2 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_2
-#define CONF_DMAC_SRC_STRIDE_2 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_2
-#define CONF_DMAC_DES_STRIDE_2 0
-#endif
-
-// <e> Channel 3 settings
-// <id> dmac_channel_3_settings
-#ifndef CONF_DMAC_CHANNEL_3_SETTINGS
-#define CONF_DMAC_CHANNEL_3_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_3
-#ifndef CONF_DMAC_BURSTSIZE_3
-#define CONF_DMAC_BURSTSIZE_3 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_3
-#ifndef CONF_DMAC_CHUNKSIZE_3
-#define CONF_DMAC_CHUNKSIZE_3 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_3
-#ifndef CONF_DMAC_BEATSIZE_3
-#define CONF_DMAC_BEATSIZE_3 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_3
-#ifndef CONF_DMAC_SRC_INTERFACE_3
-#define CONF_DMAC_SRC_INTERFACE_3 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_3
-#ifndef CONF_DMAC_DES_INTERFACE_3
-#define CONF_DMAC_DES_INTERFACE_3 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_3
-#ifndef CONF_DMAC_SRCINC_3
-#define CONF_DMAC_SRCINC_3 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_3
-#ifndef CONF_DMAC_DSTINC_3
-#define CONF_DMAC_DSTINC_3 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_3
-#ifndef CONF_DMAC_TRANS_TYPE_3
-#define CONF_DMAC_TRANS_TYPE_3 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_3
-#ifndef CONF_DMAC_TRIGSRC_3
-#define CONF_DMAC_TRIGSRC_3 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_3 == 0
-#define CONF_DMAC_TYPE_3 0
-#define CONF_DMAC_DSYNC_3 0
-#elif CONF_DMAC_TRANS_TYPE_3 == 1
-#define CONF_DMAC_TYPE_3 1
-#define CONF_DMAC_DSYNC_3 0
-#elif CONF_DMAC_TRANS_TYPE_3 == 2
-#define CONF_DMAC_TYPE_3 1
-#define CONF_DMAC_DSYNC_3 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_3 == 0xFF
-#define CONF_DMAC_SWREQ_3 1
-#else
-#define CONF_DMAC_SWREQ_3 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_3_SETTINGS == 1 && CONF_DMAC_BEATSIZE_3 != 2 && ((!CONF_DMAC_SRCINC_3) || (!CONF_DMAC_DSTINC_3)))
-#if (!CONF_DMAC_SRCINC_3)
-#define CONF_DMAC_SRC_STRIDE_3 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_3)
-#define CONF_DMAC_DES_STRIDE_3 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_3
-#define CONF_DMAC_SRC_STRIDE_3 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_3
-#define CONF_DMAC_DES_STRIDE_3 0
-#endif
-
-// <e> Channel 4 settings
-// <id> dmac_channel_4_settings
-#ifndef CONF_DMAC_CHANNEL_4_SETTINGS
-#define CONF_DMAC_CHANNEL_4_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_4
-#ifndef CONF_DMAC_BURSTSIZE_4
-#define CONF_DMAC_BURSTSIZE_4 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_4
-#ifndef CONF_DMAC_CHUNKSIZE_4
-#define CONF_DMAC_CHUNKSIZE_4 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_4
-#ifndef CONF_DMAC_BEATSIZE_4
-#define CONF_DMAC_BEATSIZE_4 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_4
-#ifndef CONF_DMAC_SRC_INTERFACE_4
-#define CONF_DMAC_SRC_INTERFACE_4 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_4
-#ifndef CONF_DMAC_DES_INTERFACE_4
-#define CONF_DMAC_DES_INTERFACE_4 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_4
-#ifndef CONF_DMAC_SRCINC_4
-#define CONF_DMAC_SRCINC_4 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_4
-#ifndef CONF_DMAC_DSTINC_4
-#define CONF_DMAC_DSTINC_4 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_4
-#ifndef CONF_DMAC_TRANS_TYPE_4
-#define CONF_DMAC_TRANS_TYPE_4 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_4
-#ifndef CONF_DMAC_TRIGSRC_4
-#define CONF_DMAC_TRIGSRC_4 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_4 == 0
-#define CONF_DMAC_TYPE_4 0
-#define CONF_DMAC_DSYNC_4 0
-#elif CONF_DMAC_TRANS_TYPE_4 == 1
-#define CONF_DMAC_TYPE_4 1
-#define CONF_DMAC_DSYNC_4 0
-#elif CONF_DMAC_TRANS_TYPE_4 == 2
-#define CONF_DMAC_TYPE_4 1
-#define CONF_DMAC_DSYNC_4 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_4 == 0xFF
-#define CONF_DMAC_SWREQ_4 1
-#else
-#define CONF_DMAC_SWREQ_4 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_4_SETTINGS == 1 && CONF_DMAC_BEATSIZE_4 != 2 && ((!CONF_DMAC_SRCINC_4) || (!CONF_DMAC_DSTINC_4)))
-#if (!CONF_DMAC_SRCINC_4)
-#define CONF_DMAC_SRC_STRIDE_4 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_4)
-#define CONF_DMAC_DES_STRIDE_4 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_4
-#define CONF_DMAC_SRC_STRIDE_4 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_4
-#define CONF_DMAC_DES_STRIDE_4 0
-#endif
-
-// <e> Channel 5 settings
-// <id> dmac_channel_5_settings
-#ifndef CONF_DMAC_CHANNEL_5_SETTINGS
-#define CONF_DMAC_CHANNEL_5_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_5
-#ifndef CONF_DMAC_BURSTSIZE_5
-#define CONF_DMAC_BURSTSIZE_5 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_5
-#ifndef CONF_DMAC_CHUNKSIZE_5
-#define CONF_DMAC_CHUNKSIZE_5 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_5
-#ifndef CONF_DMAC_BEATSIZE_5
-#define CONF_DMAC_BEATSIZE_5 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_5
-#ifndef CONF_DMAC_SRC_INTERFACE_5
-#define CONF_DMAC_SRC_INTERFACE_5 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_5
-#ifndef CONF_DMAC_DES_INTERFACE_5
-#define CONF_DMAC_DES_INTERFACE_5 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_5
-#ifndef CONF_DMAC_SRCINC_5
-#define CONF_DMAC_SRCINC_5 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_5
-#ifndef CONF_DMAC_DSTINC_5
-#define CONF_DMAC_DSTINC_5 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_5
-#ifndef CONF_DMAC_TRANS_TYPE_5
-#define CONF_DMAC_TRANS_TYPE_5 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_5
-#ifndef CONF_DMAC_TRIGSRC_5
-#define CONF_DMAC_TRIGSRC_5 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_5 == 0
-#define CONF_DMAC_TYPE_5 0
-#define CONF_DMAC_DSYNC_5 0
-#elif CONF_DMAC_TRANS_TYPE_5 == 1
-#define CONF_DMAC_TYPE_5 1
-#define CONF_DMAC_DSYNC_5 0
-#elif CONF_DMAC_TRANS_TYPE_5 == 2
-#define CONF_DMAC_TYPE_5 1
-#define CONF_DMAC_DSYNC_5 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_5 == 0xFF
-#define CONF_DMAC_SWREQ_5 1
-#else
-#define CONF_DMAC_SWREQ_5 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_5_SETTINGS == 1 && CONF_DMAC_BEATSIZE_5 != 2 && ((!CONF_DMAC_SRCINC_5) || (!CONF_DMAC_DSTINC_5)))
-#if (!CONF_DMAC_SRCINC_5)
-#define CONF_DMAC_SRC_STRIDE_5 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_5)
-#define CONF_DMAC_DES_STRIDE_5 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_5
-#define CONF_DMAC_SRC_STRIDE_5 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_5
-#define CONF_DMAC_DES_STRIDE_5 0
-#endif
-
-// <e> Channel 6 settings
-// <id> dmac_channel_6_settings
-#ifndef CONF_DMAC_CHANNEL_6_SETTINGS
-#define CONF_DMAC_CHANNEL_6_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_6
-#ifndef CONF_DMAC_BURSTSIZE_6
-#define CONF_DMAC_BURSTSIZE_6 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_6
-#ifndef CONF_DMAC_CHUNKSIZE_6
-#define CONF_DMAC_CHUNKSIZE_6 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_6
-#ifndef CONF_DMAC_BEATSIZE_6
-#define CONF_DMAC_BEATSIZE_6 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_6
-#ifndef CONF_DMAC_SRC_INTERFACE_6
-#define CONF_DMAC_SRC_INTERFACE_6 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_6
-#ifndef CONF_DMAC_DES_INTERFACE_6
-#define CONF_DMAC_DES_INTERFACE_6 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_6
-#ifndef CONF_DMAC_SRCINC_6
-#define CONF_DMAC_SRCINC_6 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_6
-#ifndef CONF_DMAC_DSTINC_6
-#define CONF_DMAC_DSTINC_6 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_6
-#ifndef CONF_DMAC_TRANS_TYPE_6
-#define CONF_DMAC_TRANS_TYPE_6 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_6
-#ifndef CONF_DMAC_TRIGSRC_6
-#define CONF_DMAC_TRIGSRC_6 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_6 == 0
-#define CONF_DMAC_TYPE_6 0
-#define CONF_DMAC_DSYNC_6 0
-#elif CONF_DMAC_TRANS_TYPE_6 == 1
-#define CONF_DMAC_TYPE_6 1
-#define CONF_DMAC_DSYNC_6 0
-#elif CONF_DMAC_TRANS_TYPE_6 == 2
-#define CONF_DMAC_TYPE_6 1
-#define CONF_DMAC_DSYNC_6 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_6 == 0xFF
-#define CONF_DMAC_SWREQ_6 1
-#else
-#define CONF_DMAC_SWREQ_6 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_6_SETTINGS == 1 && CONF_DMAC_BEATSIZE_6 != 2 && ((!CONF_DMAC_SRCINC_6) || (!CONF_DMAC_DSTINC_6)))
-#if (!CONF_DMAC_SRCINC_6)
-#define CONF_DMAC_SRC_STRIDE_6 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_6)
-#define CONF_DMAC_DES_STRIDE_6 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_6
-#define CONF_DMAC_SRC_STRIDE_6 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_6
-#define CONF_DMAC_DES_STRIDE_6 0
-#endif
-
-// <e> Channel 7 settings
-// <id> dmac_channel_7_settings
-#ifndef CONF_DMAC_CHANNEL_7_SETTINGS
-#define CONF_DMAC_CHANNEL_7_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_7
-#ifndef CONF_DMAC_BURSTSIZE_7
-#define CONF_DMAC_BURSTSIZE_7 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_7
-#ifndef CONF_DMAC_CHUNKSIZE_7
-#define CONF_DMAC_CHUNKSIZE_7 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_7
-#ifndef CONF_DMAC_BEATSIZE_7
-#define CONF_DMAC_BEATSIZE_7 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_7
-#ifndef CONF_DMAC_SRC_INTERFACE_7
-#define CONF_DMAC_SRC_INTERFACE_7 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_7
-#ifndef CONF_DMAC_DES_INTERFACE_7
-#define CONF_DMAC_DES_INTERFACE_7 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_7
-#ifndef CONF_DMAC_SRCINC_7
-#define CONF_DMAC_SRCINC_7 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_7
-#ifndef CONF_DMAC_DSTINC_7
-#define CONF_DMAC_DSTINC_7 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_7
-#ifndef CONF_DMAC_TRANS_TYPE_7
-#define CONF_DMAC_TRANS_TYPE_7 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_7
-#ifndef CONF_DMAC_TRIGSRC_7
-#define CONF_DMAC_TRIGSRC_7 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_7 == 0
-#define CONF_DMAC_TYPE_7 0
-#define CONF_DMAC_DSYNC_7 0
-#elif CONF_DMAC_TRANS_TYPE_7 == 1
-#define CONF_DMAC_TYPE_7 1
-#define CONF_DMAC_DSYNC_7 0
-#elif CONF_DMAC_TRANS_TYPE_7 == 2
-#define CONF_DMAC_TYPE_7 1
-#define CONF_DMAC_DSYNC_7 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_7 == 0xFF
-#define CONF_DMAC_SWREQ_7 1
-#else
-#define CONF_DMAC_SWREQ_7 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_7_SETTINGS == 1 && CONF_DMAC_BEATSIZE_7 != 2 && ((!CONF_DMAC_SRCINC_7) || (!CONF_DMAC_DSTINC_7)))
-#if (!CONF_DMAC_SRCINC_7)
-#define CONF_DMAC_SRC_STRIDE_7 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_7)
-#define CONF_DMAC_DES_STRIDE_7 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_7
-#define CONF_DMAC_SRC_STRIDE_7 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_7
-#define CONF_DMAC_DES_STRIDE_7 0
-#endif
-
-// <e> Channel 8 settings
-// <id> dmac_channel_8_settings
-#ifndef CONF_DMAC_CHANNEL_8_SETTINGS
-#define CONF_DMAC_CHANNEL_8_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_8
-#ifndef CONF_DMAC_BURSTSIZE_8
-#define CONF_DMAC_BURSTSIZE_8 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_8
-#ifndef CONF_DMAC_CHUNKSIZE_8
-#define CONF_DMAC_CHUNKSIZE_8 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_8
-#ifndef CONF_DMAC_BEATSIZE_8
-#define CONF_DMAC_BEATSIZE_8 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_8
-#ifndef CONF_DMAC_SRC_INTERFACE_8
-#define CONF_DMAC_SRC_INTERFACE_8 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_8
-#ifndef CONF_DMAC_DES_INTERFACE_8
-#define CONF_DMAC_DES_INTERFACE_8 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_8
-#ifndef CONF_DMAC_SRCINC_8
-#define CONF_DMAC_SRCINC_8 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_8
-#ifndef CONF_DMAC_DSTINC_8
-#define CONF_DMAC_DSTINC_8 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_8
-#ifndef CONF_DMAC_TRANS_TYPE_8
-#define CONF_DMAC_TRANS_TYPE_8 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_8
-#ifndef CONF_DMAC_TRIGSRC_8
-#define CONF_DMAC_TRIGSRC_8 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_8 == 0
-#define CONF_DMAC_TYPE_8 0
-#define CONF_DMAC_DSYNC_8 0
-#elif CONF_DMAC_TRANS_TYPE_8 == 1
-#define CONF_DMAC_TYPE_8 1
-#define CONF_DMAC_DSYNC_8 0
-#elif CONF_DMAC_TRANS_TYPE_8 == 2
-#define CONF_DMAC_TYPE_8 1
-#define CONF_DMAC_DSYNC_8 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_8 == 0xFF
-#define CONF_DMAC_SWREQ_8 1
-#else
-#define CONF_DMAC_SWREQ_8 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_8_SETTINGS == 1 && CONF_DMAC_BEATSIZE_8 != 2 && ((!CONF_DMAC_SRCINC_8) || (!CONF_DMAC_DSTINC_8)))
-#if (!CONF_DMAC_SRCINC_8)
-#define CONF_DMAC_SRC_STRIDE_8 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_8)
-#define CONF_DMAC_DES_STRIDE_8 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_8
-#define CONF_DMAC_SRC_STRIDE_8 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_8
-#define CONF_DMAC_DES_STRIDE_8 0
-#endif
-
-// <e> Channel 9 settings
-// <id> dmac_channel_9_settings
-#ifndef CONF_DMAC_CHANNEL_9_SETTINGS
-#define CONF_DMAC_CHANNEL_9_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_9
-#ifndef CONF_DMAC_BURSTSIZE_9
-#define CONF_DMAC_BURSTSIZE_9 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_9
-#ifndef CONF_DMAC_CHUNKSIZE_9
-#define CONF_DMAC_CHUNKSIZE_9 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_9
-#ifndef CONF_DMAC_BEATSIZE_9
-#define CONF_DMAC_BEATSIZE_9 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_9
-#ifndef CONF_DMAC_SRC_INTERFACE_9
-#define CONF_DMAC_SRC_INTERFACE_9 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_9
-#ifndef CONF_DMAC_DES_INTERFACE_9
-#define CONF_DMAC_DES_INTERFACE_9 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_9
-#ifndef CONF_DMAC_SRCINC_9
-#define CONF_DMAC_SRCINC_9 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_9
-#ifndef CONF_DMAC_DSTINC_9
-#define CONF_DMAC_DSTINC_9 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_9
-#ifndef CONF_DMAC_TRANS_TYPE_9
-#define CONF_DMAC_TRANS_TYPE_9 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_9
-#ifndef CONF_DMAC_TRIGSRC_9
-#define CONF_DMAC_TRIGSRC_9 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_9 == 0
-#define CONF_DMAC_TYPE_9 0
-#define CONF_DMAC_DSYNC_9 0
-#elif CONF_DMAC_TRANS_TYPE_9 == 1
-#define CONF_DMAC_TYPE_9 1
-#define CONF_DMAC_DSYNC_9 0
-#elif CONF_DMAC_TRANS_TYPE_9 == 2
-#define CONF_DMAC_TYPE_9 1
-#define CONF_DMAC_DSYNC_9 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_9 == 0xFF
-#define CONF_DMAC_SWREQ_9 1
-#else
-#define CONF_DMAC_SWREQ_9 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_9_SETTINGS == 1 && CONF_DMAC_BEATSIZE_9 != 2 && ((!CONF_DMAC_SRCINC_9) || (!CONF_DMAC_DSTINC_9)))
-#if (!CONF_DMAC_SRCINC_9)
-#define CONF_DMAC_SRC_STRIDE_9 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_9)
-#define CONF_DMAC_DES_STRIDE_9 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_9
-#define CONF_DMAC_SRC_STRIDE_9 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_9
-#define CONF_DMAC_DES_STRIDE_9 0
-#endif
-
-// <e> Channel 10 settings
-// <id> dmac_channel_10_settings
-#ifndef CONF_DMAC_CHANNEL_10_SETTINGS
-#define CONF_DMAC_CHANNEL_10_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_10
-#ifndef CONF_DMAC_BURSTSIZE_10
-#define CONF_DMAC_BURSTSIZE_10 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_10
-#ifndef CONF_DMAC_CHUNKSIZE_10
-#define CONF_DMAC_CHUNKSIZE_10 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_10
-#ifndef CONF_DMAC_BEATSIZE_10
-#define CONF_DMAC_BEATSIZE_10 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_10
-#ifndef CONF_DMAC_SRC_INTERFACE_10
-#define CONF_DMAC_SRC_INTERFACE_10 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_10
-#ifndef CONF_DMAC_DES_INTERFACE_10
-#define CONF_DMAC_DES_INTERFACE_10 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_10
-#ifndef CONF_DMAC_SRCINC_10
-#define CONF_DMAC_SRCINC_10 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_10
-#ifndef CONF_DMAC_DSTINC_10
-#define CONF_DMAC_DSTINC_10 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_10
-#ifndef CONF_DMAC_TRANS_TYPE_10
-#define CONF_DMAC_TRANS_TYPE_10 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_10
-#ifndef CONF_DMAC_TRIGSRC_10
-#define CONF_DMAC_TRIGSRC_10 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_10 == 0
-#define CONF_DMAC_TYPE_10 0
-#define CONF_DMAC_DSYNC_10 0
-#elif CONF_DMAC_TRANS_TYPE_10 == 1
-#define CONF_DMAC_TYPE_10 1
-#define CONF_DMAC_DSYNC_10 0
-#elif CONF_DMAC_TRANS_TYPE_10 == 2
-#define CONF_DMAC_TYPE_10 1
-#define CONF_DMAC_DSYNC_10 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_10 == 0xFF
-#define CONF_DMAC_SWREQ_10 1
-#else
-#define CONF_DMAC_SWREQ_10 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_10_SETTINGS == 1 && CONF_DMAC_BEATSIZE_10 != 2 \
- && ((!CONF_DMAC_SRCINC_10) || (!CONF_DMAC_DSTINC_10)))
-#if (!CONF_DMAC_SRCINC_10)
-#define CONF_DMAC_SRC_STRIDE_10 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_10)
-#define CONF_DMAC_DES_STRIDE_10 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_10
-#define CONF_DMAC_SRC_STRIDE_10 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_10
-#define CONF_DMAC_DES_STRIDE_10 0
-#endif
-
-// <e> Channel 11 settings
-// <id> dmac_channel_11_settings
-#ifndef CONF_DMAC_CHANNEL_11_SETTINGS
-#define CONF_DMAC_CHANNEL_11_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_11
-#ifndef CONF_DMAC_BURSTSIZE_11
-#define CONF_DMAC_BURSTSIZE_11 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_11
-#ifndef CONF_DMAC_CHUNKSIZE_11
-#define CONF_DMAC_CHUNKSIZE_11 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_11
-#ifndef CONF_DMAC_BEATSIZE_11
-#define CONF_DMAC_BEATSIZE_11 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_11
-#ifndef CONF_DMAC_SRC_INTERFACE_11
-#define CONF_DMAC_SRC_INTERFACE_11 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_11
-#ifndef CONF_DMAC_DES_INTERFACE_11
-#define CONF_DMAC_DES_INTERFACE_11 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_11
-#ifndef CONF_DMAC_SRCINC_11
-#define CONF_DMAC_SRCINC_11 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_11
-#ifndef CONF_DMAC_DSTINC_11
-#define CONF_DMAC_DSTINC_11 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_11
-#ifndef CONF_DMAC_TRANS_TYPE_11
-#define CONF_DMAC_TRANS_TYPE_11 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_11
-#ifndef CONF_DMAC_TRIGSRC_11
-#define CONF_DMAC_TRIGSRC_11 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_11 == 0
-#define CONF_DMAC_TYPE_11 0
-#define CONF_DMAC_DSYNC_11 0
-#elif CONF_DMAC_TRANS_TYPE_11 == 1
-#define CONF_DMAC_TYPE_11 1
-#define CONF_DMAC_DSYNC_11 0
-#elif CONF_DMAC_TRANS_TYPE_11 == 2
-#define CONF_DMAC_TYPE_11 1
-#define CONF_DMAC_DSYNC_11 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_11 == 0xFF
-#define CONF_DMAC_SWREQ_11 1
-#else
-#define CONF_DMAC_SWREQ_11 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_11_SETTINGS == 1 && CONF_DMAC_BEATSIZE_11 != 2 \
- && ((!CONF_DMAC_SRCINC_11) || (!CONF_DMAC_DSTINC_11)))
-#if (!CONF_DMAC_SRCINC_11)
-#define CONF_DMAC_SRC_STRIDE_11 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_11)
-#define CONF_DMAC_DES_STRIDE_11 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_11
-#define CONF_DMAC_SRC_STRIDE_11 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_11
-#define CONF_DMAC_DES_STRIDE_11 0
-#endif
-
-// <e> Channel 12 settings
-// <id> dmac_channel_12_settings
-#ifndef CONF_DMAC_CHANNEL_12_SETTINGS
-#define CONF_DMAC_CHANNEL_12_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_12
-#ifndef CONF_DMAC_BURSTSIZE_12
-#define CONF_DMAC_BURSTSIZE_12 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_12
-#ifndef CONF_DMAC_CHUNKSIZE_12
-#define CONF_DMAC_CHUNKSIZE_12 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_12
-#ifndef CONF_DMAC_BEATSIZE_12
-#define CONF_DMAC_BEATSIZE_12 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_12
-#ifndef CONF_DMAC_SRC_INTERFACE_12
-#define CONF_DMAC_SRC_INTERFACE_12 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_12
-#ifndef CONF_DMAC_DES_INTERFACE_12
-#define CONF_DMAC_DES_INTERFACE_12 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_12
-#ifndef CONF_DMAC_SRCINC_12
-#define CONF_DMAC_SRCINC_12 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_12
-#ifndef CONF_DMAC_DSTINC_12
-#define CONF_DMAC_DSTINC_12 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_12
-#ifndef CONF_DMAC_TRANS_TYPE_12
-#define CONF_DMAC_TRANS_TYPE_12 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_12
-#ifndef CONF_DMAC_TRIGSRC_12
-#define CONF_DMAC_TRIGSRC_12 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_12 == 0
-#define CONF_DMAC_TYPE_12 0
-#define CONF_DMAC_DSYNC_12 0
-#elif CONF_DMAC_TRANS_TYPE_12 == 1
-#define CONF_DMAC_TYPE_12 1
-#define CONF_DMAC_DSYNC_12 0
-#elif CONF_DMAC_TRANS_TYPE_12 == 2
-#define CONF_DMAC_TYPE_12 1
-#define CONF_DMAC_DSYNC_12 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_12 == 0xFF
-#define CONF_DMAC_SWREQ_12 1
-#else
-#define CONF_DMAC_SWREQ_12 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_12_SETTINGS == 1 && CONF_DMAC_BEATSIZE_12 != 2 \
- && ((!CONF_DMAC_SRCINC_12) || (!CONF_DMAC_DSTINC_12)))
-#if (!CONF_DMAC_SRCINC_12)
-#define CONF_DMAC_SRC_STRIDE_12 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_12)
-#define CONF_DMAC_DES_STRIDE_12 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_12
-#define CONF_DMAC_SRC_STRIDE_12 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_12
-#define CONF_DMAC_DES_STRIDE_12 0
-#endif
-
-// <e> Channel 13 settings
-// <id> dmac_channel_13_settings
-#ifndef CONF_DMAC_CHANNEL_13_SETTINGS
-#define CONF_DMAC_CHANNEL_13_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_13
-#ifndef CONF_DMAC_BURSTSIZE_13
-#define CONF_DMAC_BURSTSIZE_13 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_13
-#ifndef CONF_DMAC_CHUNKSIZE_13
-#define CONF_DMAC_CHUNKSIZE_13 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_13
-#ifndef CONF_DMAC_BEATSIZE_13
-#define CONF_DMAC_BEATSIZE_13 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_13
-#ifndef CONF_DMAC_SRC_INTERFACE_13
-#define CONF_DMAC_SRC_INTERFACE_13 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_13
-#ifndef CONF_DMAC_DES_INTERFACE_13
-#define CONF_DMAC_DES_INTERFACE_13 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_13
-#ifndef CONF_DMAC_SRCINC_13
-#define CONF_DMAC_SRCINC_13 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_13
-#ifndef CONF_DMAC_DSTINC_13
-#define CONF_DMAC_DSTINC_13 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_13
-#ifndef CONF_DMAC_TRANS_TYPE_13
-#define CONF_DMAC_TRANS_TYPE_13 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_13
-#ifndef CONF_DMAC_TRIGSRC_13
-#define CONF_DMAC_TRIGSRC_13 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_13 == 0
-#define CONF_DMAC_TYPE_13 0
-#define CONF_DMAC_DSYNC_13 0
-#elif CONF_DMAC_TRANS_TYPE_13 == 1
-#define CONF_DMAC_TYPE_13 1
-#define CONF_DMAC_DSYNC_13 0
-#elif CONF_DMAC_TRANS_TYPE_13 == 2
-#define CONF_DMAC_TYPE_13 1
-#define CONF_DMAC_DSYNC_13 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_13 == 0xFF
-#define CONF_DMAC_SWREQ_13 1
-#else
-#define CONF_DMAC_SWREQ_13 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_13_SETTINGS == 1 && CONF_DMAC_BEATSIZE_13 != 2 \
- && ((!CONF_DMAC_SRCINC_13) || (!CONF_DMAC_DSTINC_13)))
-#if (!CONF_DMAC_SRCINC_13)
-#define CONF_DMAC_SRC_STRIDE_13 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_13)
-#define CONF_DMAC_DES_STRIDE_13 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_13
-#define CONF_DMAC_SRC_STRIDE_13 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_13
-#define CONF_DMAC_DES_STRIDE_13 0
-#endif
-
-// <e> Channel 14 settings
-// <id> dmac_channel_14_settings
-#ifndef CONF_DMAC_CHANNEL_14_SETTINGS
-#define CONF_DMAC_CHANNEL_14_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_14
-#ifndef CONF_DMAC_BURSTSIZE_14
-#define CONF_DMAC_BURSTSIZE_14 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_14
-#ifndef CONF_DMAC_CHUNKSIZE_14
-#define CONF_DMAC_CHUNKSIZE_14 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_14
-#ifndef CONF_DMAC_BEATSIZE_14
-#define CONF_DMAC_BEATSIZE_14 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_14
-#ifndef CONF_DMAC_SRC_INTERFACE_14
-#define CONF_DMAC_SRC_INTERFACE_14 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_14
-#ifndef CONF_DMAC_DES_INTERFACE_14
-#define CONF_DMAC_DES_INTERFACE_14 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_14
-#ifndef CONF_DMAC_SRCINC_14
-#define CONF_DMAC_SRCINC_14 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_14
-#ifndef CONF_DMAC_DSTINC_14
-#define CONF_DMAC_DSTINC_14 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_14
-#ifndef CONF_DMAC_TRANS_TYPE_14
-#define CONF_DMAC_TRANS_TYPE_14 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_14
-#ifndef CONF_DMAC_TRIGSRC_14
-#define CONF_DMAC_TRIGSRC_14 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_14 == 0
-#define CONF_DMAC_TYPE_14 0
-#define CONF_DMAC_DSYNC_14 0
-#elif CONF_DMAC_TRANS_TYPE_14 == 1
-#define CONF_DMAC_TYPE_14 1
-#define CONF_DMAC_DSYNC_14 0
-#elif CONF_DMAC_TRANS_TYPE_14 == 2
-#define CONF_DMAC_TYPE_14 1
-#define CONF_DMAC_DSYNC_14 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_14 == 0xFF
-#define CONF_DMAC_SWREQ_14 1
-#else
-#define CONF_DMAC_SWREQ_14 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_14_SETTINGS == 1 && CONF_DMAC_BEATSIZE_14 != 2 \
- && ((!CONF_DMAC_SRCINC_14) || (!CONF_DMAC_DSTINC_14)))
-#if (!CONF_DMAC_SRCINC_14)
-#define CONF_DMAC_SRC_STRIDE_14 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_14)
-#define CONF_DMAC_DES_STRIDE_14 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_14
-#define CONF_DMAC_SRC_STRIDE_14 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_14
-#define CONF_DMAC_DES_STRIDE_14 0
-#endif
-
-// <e> Channel 15 settings
-// <id> dmac_channel_15_settings
-#ifndef CONF_DMAC_CHANNEL_15_SETTINGS
-#define CONF_DMAC_CHANNEL_15_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_15
-#ifndef CONF_DMAC_BURSTSIZE_15
-#define CONF_DMAC_BURSTSIZE_15 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_15
-#ifndef CONF_DMAC_CHUNKSIZE_15
-#define CONF_DMAC_CHUNKSIZE_15 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_15
-#ifndef CONF_DMAC_BEATSIZE_15
-#define CONF_DMAC_BEATSIZE_15 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_15
-#ifndef CONF_DMAC_SRC_INTERFACE_15
-#define CONF_DMAC_SRC_INTERFACE_15 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_15
-#ifndef CONF_DMAC_DES_INTERFACE_15
-#define CONF_DMAC_DES_INTERFACE_15 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_15
-#ifndef CONF_DMAC_SRCINC_15
-#define CONF_DMAC_SRCINC_15 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_15
-#ifndef CONF_DMAC_DSTINC_15
-#define CONF_DMAC_DSTINC_15 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_15
-#ifndef CONF_DMAC_TRANS_TYPE_15
-#define CONF_DMAC_TRANS_TYPE_15 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_15
-#ifndef CONF_DMAC_TRIGSRC_15
-#define CONF_DMAC_TRIGSRC_15 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_15 == 0
-#define CONF_DMAC_TYPE_15 0
-#define CONF_DMAC_DSYNC_15 0
-#elif CONF_DMAC_TRANS_TYPE_15 == 1
-#define CONF_DMAC_TYPE_15 1
-#define CONF_DMAC_DSYNC_15 0
-#elif CONF_DMAC_TRANS_TYPE_15 == 2
-#define CONF_DMAC_TYPE_15 1
-#define CONF_DMAC_DSYNC_15 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_15 == 0xFF
-#define CONF_DMAC_SWREQ_15 1
-#else
-#define CONF_DMAC_SWREQ_15 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_15_SETTINGS == 1 && CONF_DMAC_BEATSIZE_15 != 2 \
- && ((!CONF_DMAC_SRCINC_15) || (!CONF_DMAC_DSTINC_15)))
-#if (!CONF_DMAC_SRCINC_15)
-#define CONF_DMAC_SRC_STRIDE_15 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_15)
-#define CONF_DMAC_DES_STRIDE_15 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_15
-#define CONF_DMAC_SRC_STRIDE_15 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_15
-#define CONF_DMAC_DES_STRIDE_15 0
-#endif
-
-// <e> Channel 16 settings
-// <id> dmac_channel_16_settings
-#ifndef CONF_DMAC_CHANNEL_16_SETTINGS
-#define CONF_DMAC_CHANNEL_16_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_16
-#ifndef CONF_DMAC_BURSTSIZE_16
-#define CONF_DMAC_BURSTSIZE_16 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_16
-#ifndef CONF_DMAC_CHUNKSIZE_16
-#define CONF_DMAC_CHUNKSIZE_16 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_16
-#ifndef CONF_DMAC_BEATSIZE_16
-#define CONF_DMAC_BEATSIZE_16 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_16
-#ifndef CONF_DMAC_SRC_INTERFACE_16
-#define CONF_DMAC_SRC_INTERFACE_16 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_16
-#ifndef CONF_DMAC_DES_INTERFACE_16
-#define CONF_DMAC_DES_INTERFACE_16 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_16
-#ifndef CONF_DMAC_SRCINC_16
-#define CONF_DMAC_SRCINC_16 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_16
-#ifndef CONF_DMAC_DSTINC_16
-#define CONF_DMAC_DSTINC_16 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_16
-#ifndef CONF_DMAC_TRANS_TYPE_16
-#define CONF_DMAC_TRANS_TYPE_16 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_16
-#ifndef CONF_DMAC_TRIGSRC_16
-#define CONF_DMAC_TRIGSRC_16 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_16 == 0
-#define CONF_DMAC_TYPE_16 0
-#define CONF_DMAC_DSYNC_16 0
-#elif CONF_DMAC_TRANS_TYPE_16 == 1
-#define CONF_DMAC_TYPE_16 1
-#define CONF_DMAC_DSYNC_16 0
-#elif CONF_DMAC_TRANS_TYPE_16 == 2
-#define CONF_DMAC_TYPE_16 1
-#define CONF_DMAC_DSYNC_16 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_16 == 0xFF
-#define CONF_DMAC_SWREQ_16 1
-#else
-#define CONF_DMAC_SWREQ_16 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_16_SETTINGS == 1 && CONF_DMAC_BEATSIZE_16 != 2 \
- && ((!CONF_DMAC_SRCINC_16) || (!CONF_DMAC_DSTINC_16)))
-#if (!CONF_DMAC_SRCINC_16)
-#define CONF_DMAC_SRC_STRIDE_16 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_16)
-#define CONF_DMAC_DES_STRIDE_16 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_16
-#define CONF_DMAC_SRC_STRIDE_16 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_16
-#define CONF_DMAC_DES_STRIDE_16 0
-#endif
-
-// <e> Channel 17 settings
-// <id> dmac_channel_17_settings
-#ifndef CONF_DMAC_CHANNEL_17_SETTINGS
-#define CONF_DMAC_CHANNEL_17_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_17
-#ifndef CONF_DMAC_BURSTSIZE_17
-#define CONF_DMAC_BURSTSIZE_17 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_17
-#ifndef CONF_DMAC_CHUNKSIZE_17
-#define CONF_DMAC_CHUNKSIZE_17 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_17
-#ifndef CONF_DMAC_BEATSIZE_17
-#define CONF_DMAC_BEATSIZE_17 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_17
-#ifndef CONF_DMAC_SRC_INTERFACE_17
-#define CONF_DMAC_SRC_INTERFACE_17 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_17
-#ifndef CONF_DMAC_DES_INTERFACE_17
-#define CONF_DMAC_DES_INTERFACE_17 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_17
-#ifndef CONF_DMAC_SRCINC_17
-#define CONF_DMAC_SRCINC_17 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_17
-#ifndef CONF_DMAC_DSTINC_17
-#define CONF_DMAC_DSTINC_17 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_17
-#ifndef CONF_DMAC_TRANS_TYPE_17
-#define CONF_DMAC_TRANS_TYPE_17 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_17
-#ifndef CONF_DMAC_TRIGSRC_17
-#define CONF_DMAC_TRIGSRC_17 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_17 == 0
-#define CONF_DMAC_TYPE_17 0
-#define CONF_DMAC_DSYNC_17 0
-#elif CONF_DMAC_TRANS_TYPE_17 == 1
-#define CONF_DMAC_TYPE_17 1
-#define CONF_DMAC_DSYNC_17 0
-#elif CONF_DMAC_TRANS_TYPE_17 == 2
-#define CONF_DMAC_TYPE_17 1
-#define CONF_DMAC_DSYNC_17 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_17 == 0xFF
-#define CONF_DMAC_SWREQ_17 1
-#else
-#define CONF_DMAC_SWREQ_17 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_17_SETTINGS == 1 && CONF_DMAC_BEATSIZE_17 != 2 \
- && ((!CONF_DMAC_SRCINC_17) || (!CONF_DMAC_DSTINC_17)))
-#if (!CONF_DMAC_SRCINC_17)
-#define CONF_DMAC_SRC_STRIDE_17 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_17)
-#define CONF_DMAC_DES_STRIDE_17 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_17
-#define CONF_DMAC_SRC_STRIDE_17 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_17
-#define CONF_DMAC_DES_STRIDE_17 0
-#endif
-
-// <e> Channel 18 settings
-// <id> dmac_channel_18_settings
-#ifndef CONF_DMAC_CHANNEL_18_SETTINGS
-#define CONF_DMAC_CHANNEL_18_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_18
-#ifndef CONF_DMAC_BURSTSIZE_18
-#define CONF_DMAC_BURSTSIZE_18 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_18
-#ifndef CONF_DMAC_CHUNKSIZE_18
-#define CONF_DMAC_CHUNKSIZE_18 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_18
-#ifndef CONF_DMAC_BEATSIZE_18
-#define CONF_DMAC_BEATSIZE_18 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_18
-#ifndef CONF_DMAC_SRC_INTERFACE_18
-#define CONF_DMAC_SRC_INTERFACE_18 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_18
-#ifndef CONF_DMAC_DES_INTERFACE_18
-#define CONF_DMAC_DES_INTERFACE_18 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_18
-#ifndef CONF_DMAC_SRCINC_18
-#define CONF_DMAC_SRCINC_18 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_18
-#ifndef CONF_DMAC_DSTINC_18
-#define CONF_DMAC_DSTINC_18 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_18
-#ifndef CONF_DMAC_TRANS_TYPE_18
-#define CONF_DMAC_TRANS_TYPE_18 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_18
-#ifndef CONF_DMAC_TRIGSRC_18
-#define CONF_DMAC_TRIGSRC_18 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_18 == 0
-#define CONF_DMAC_TYPE_18 0
-#define CONF_DMAC_DSYNC_18 0
-#elif CONF_DMAC_TRANS_TYPE_18 == 1
-#define CONF_DMAC_TYPE_18 1
-#define CONF_DMAC_DSYNC_18 0
-#elif CONF_DMAC_TRANS_TYPE_18 == 2
-#define CONF_DMAC_TYPE_18 1
-#define CONF_DMAC_DSYNC_18 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_18 == 0xFF
-#define CONF_DMAC_SWREQ_18 1
-#else
-#define CONF_DMAC_SWREQ_18 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_18_SETTINGS == 1 && CONF_DMAC_BEATSIZE_18 != 2 \
- && ((!CONF_DMAC_SRCINC_18) || (!CONF_DMAC_DSTINC_18)))
-#if (!CONF_DMAC_SRCINC_18)
-#define CONF_DMAC_SRC_STRIDE_18 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_18)
-#define CONF_DMAC_DES_STRIDE_18 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_18
-#define CONF_DMAC_SRC_STRIDE_18 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_18
-#define CONF_DMAC_DES_STRIDE_18 0
-#endif
-
-// <e> Channel 19 settings
-// <id> dmac_channel_19_settings
-#ifndef CONF_DMAC_CHANNEL_19_SETTINGS
-#define CONF_DMAC_CHANNEL_19_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_19
-#ifndef CONF_DMAC_BURSTSIZE_19
-#define CONF_DMAC_BURSTSIZE_19 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_19
-#ifndef CONF_DMAC_CHUNKSIZE_19
-#define CONF_DMAC_CHUNKSIZE_19 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_19
-#ifndef CONF_DMAC_BEATSIZE_19
-#define CONF_DMAC_BEATSIZE_19 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_19
-#ifndef CONF_DMAC_SRC_INTERFACE_19
-#define CONF_DMAC_SRC_INTERFACE_19 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_19
-#ifndef CONF_DMAC_DES_INTERFACE_19
-#define CONF_DMAC_DES_INTERFACE_19 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_19
-#ifndef CONF_DMAC_SRCINC_19
-#define CONF_DMAC_SRCINC_19 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_19
-#ifndef CONF_DMAC_DSTINC_19
-#define CONF_DMAC_DSTINC_19 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_19
-#ifndef CONF_DMAC_TRANS_TYPE_19
-#define CONF_DMAC_TRANS_TYPE_19 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_19
-#ifndef CONF_DMAC_TRIGSRC_19
-#define CONF_DMAC_TRIGSRC_19 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_19 == 0
-#define CONF_DMAC_TYPE_19 0
-#define CONF_DMAC_DSYNC_19 0
-#elif CONF_DMAC_TRANS_TYPE_19 == 1
-#define CONF_DMAC_TYPE_19 1
-#define CONF_DMAC_DSYNC_19 0
-#elif CONF_DMAC_TRANS_TYPE_19 == 2
-#define CONF_DMAC_TYPE_19 1
-#define CONF_DMAC_DSYNC_19 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_19 == 0xFF
-#define CONF_DMAC_SWREQ_19 1
-#else
-#define CONF_DMAC_SWREQ_19 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_19_SETTINGS == 1 && CONF_DMAC_BEATSIZE_19 != 2 \
- && ((!CONF_DMAC_SRCINC_19) || (!CONF_DMAC_DSTINC_19)))
-#if (!CONF_DMAC_SRCINC_19)
-#define CONF_DMAC_SRC_STRIDE_19 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_19)
-#define CONF_DMAC_DES_STRIDE_19 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_19
-#define CONF_DMAC_SRC_STRIDE_19 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_19
-#define CONF_DMAC_DES_STRIDE_19 0
-#endif
-
-// <e> Channel 20 settings
-// <id> dmac_channel_20_settings
-#ifndef CONF_DMAC_CHANNEL_20_SETTINGS
-#define CONF_DMAC_CHANNEL_20_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_20
-#ifndef CONF_DMAC_BURSTSIZE_20
-#define CONF_DMAC_BURSTSIZE_20 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_20
-#ifndef CONF_DMAC_CHUNKSIZE_20
-#define CONF_DMAC_CHUNKSIZE_20 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_20
-#ifndef CONF_DMAC_BEATSIZE_20
-#define CONF_DMAC_BEATSIZE_20 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_20
-#ifndef CONF_DMAC_SRC_INTERFACE_20
-#define CONF_DMAC_SRC_INTERFACE_20 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_20
-#ifndef CONF_DMAC_DES_INTERFACE_20
-#define CONF_DMAC_DES_INTERFACE_20 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_20
-#ifndef CONF_DMAC_SRCINC_20
-#define CONF_DMAC_SRCINC_20 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_20
-#ifndef CONF_DMAC_DSTINC_20
-#define CONF_DMAC_DSTINC_20 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_20
-#ifndef CONF_DMAC_TRANS_TYPE_20
-#define CONF_DMAC_TRANS_TYPE_20 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_20
-#ifndef CONF_DMAC_TRIGSRC_20
-#define CONF_DMAC_TRIGSRC_20 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_20 == 0
-#define CONF_DMAC_TYPE_20 0
-#define CONF_DMAC_DSYNC_20 0
-#elif CONF_DMAC_TRANS_TYPE_20 == 1
-#define CONF_DMAC_TYPE_20 1
-#define CONF_DMAC_DSYNC_20 0
-#elif CONF_DMAC_TRANS_TYPE_20 == 2
-#define CONF_DMAC_TYPE_20 1
-#define CONF_DMAC_DSYNC_20 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_20 == 0xFF
-#define CONF_DMAC_SWREQ_20 1
-#else
-#define CONF_DMAC_SWREQ_20 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_20_SETTINGS == 1 && CONF_DMAC_BEATSIZE_20 != 2 \
- && ((!CONF_DMAC_SRCINC_20) || (!CONF_DMAC_DSTINC_20)))
-#if (!CONF_DMAC_SRCINC_20)
-#define CONF_DMAC_SRC_STRIDE_20 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_20)
-#define CONF_DMAC_DES_STRIDE_20 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_20
-#define CONF_DMAC_SRC_STRIDE_20 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_20
-#define CONF_DMAC_DES_STRIDE_20 0
-#endif
-
-// <e> Channel 21 settings
-// <id> dmac_channel_21_settings
-#ifndef CONF_DMAC_CHANNEL_21_SETTINGS
-#define CONF_DMAC_CHANNEL_21_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_21
-#ifndef CONF_DMAC_BURSTSIZE_21
-#define CONF_DMAC_BURSTSIZE_21 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_21
-#ifndef CONF_DMAC_CHUNKSIZE_21
-#define CONF_DMAC_CHUNKSIZE_21 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_21
-#ifndef CONF_DMAC_BEATSIZE_21
-#define CONF_DMAC_BEATSIZE_21 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_21
-#ifndef CONF_DMAC_SRC_INTERFACE_21
-#define CONF_DMAC_SRC_INTERFACE_21 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_21
-#ifndef CONF_DMAC_DES_INTERFACE_21
-#define CONF_DMAC_DES_INTERFACE_21 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_21
-#ifndef CONF_DMAC_SRCINC_21
-#define CONF_DMAC_SRCINC_21 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_21
-#ifndef CONF_DMAC_DSTINC_21
-#define CONF_DMAC_DSTINC_21 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_21
-#ifndef CONF_DMAC_TRANS_TYPE_21
-#define CONF_DMAC_TRANS_TYPE_21 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_21
-#ifndef CONF_DMAC_TRIGSRC_21
-#define CONF_DMAC_TRIGSRC_21 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_21 == 0
-#define CONF_DMAC_TYPE_21 0
-#define CONF_DMAC_DSYNC_21 0
-#elif CONF_DMAC_TRANS_TYPE_21 == 1
-#define CONF_DMAC_TYPE_21 1
-#define CONF_DMAC_DSYNC_21 0
-#elif CONF_DMAC_TRANS_TYPE_21 == 2
-#define CONF_DMAC_TYPE_21 1
-#define CONF_DMAC_DSYNC_21 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_21 == 0xFF
-#define CONF_DMAC_SWREQ_21 1
-#else
-#define CONF_DMAC_SWREQ_21 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_21_SETTINGS == 1 && CONF_DMAC_BEATSIZE_21 != 2 \
- && ((!CONF_DMAC_SRCINC_21) || (!CONF_DMAC_DSTINC_21)))
-#if (!CONF_DMAC_SRCINC_21)
-#define CONF_DMAC_SRC_STRIDE_21 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_21)
-#define CONF_DMAC_DES_STRIDE_21 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_21
-#define CONF_DMAC_SRC_STRIDE_21 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_21
-#define CONF_DMAC_DES_STRIDE_21 0
-#endif
-
-// <e> Channel 22 settings
-// <id> dmac_channel_22_settings
-#ifndef CONF_DMAC_CHANNEL_22_SETTINGS
-#define CONF_DMAC_CHANNEL_22_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_22
-#ifndef CONF_DMAC_BURSTSIZE_22
-#define CONF_DMAC_BURSTSIZE_22 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_22
-#ifndef CONF_DMAC_CHUNKSIZE_22
-#define CONF_DMAC_CHUNKSIZE_22 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_22
-#ifndef CONF_DMAC_BEATSIZE_22
-#define CONF_DMAC_BEATSIZE_22 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_22
-#ifndef CONF_DMAC_SRC_INTERFACE_22
-#define CONF_DMAC_SRC_INTERFACE_22 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_22
-#ifndef CONF_DMAC_DES_INTERFACE_22
-#define CONF_DMAC_DES_INTERFACE_22 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_22
-#ifndef CONF_DMAC_SRCINC_22
-#define CONF_DMAC_SRCINC_22 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_22
-#ifndef CONF_DMAC_DSTINC_22
-#define CONF_DMAC_DSTINC_22 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_22
-#ifndef CONF_DMAC_TRANS_TYPE_22
-#define CONF_DMAC_TRANS_TYPE_22 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_22
-#ifndef CONF_DMAC_TRIGSRC_22
-#define CONF_DMAC_TRIGSRC_22 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_22 == 0
-#define CONF_DMAC_TYPE_22 0
-#define CONF_DMAC_DSYNC_22 0
-#elif CONF_DMAC_TRANS_TYPE_22 == 1
-#define CONF_DMAC_TYPE_22 1
-#define CONF_DMAC_DSYNC_22 0
-#elif CONF_DMAC_TRANS_TYPE_22 == 2
-#define CONF_DMAC_TYPE_22 1
-#define CONF_DMAC_DSYNC_22 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_22 == 0xFF
-#define CONF_DMAC_SWREQ_22 1
-#else
-#define CONF_DMAC_SWREQ_22 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_22_SETTINGS == 1 && CONF_DMAC_BEATSIZE_22 != 2 \
- && ((!CONF_DMAC_SRCINC_22) || (!CONF_DMAC_DSTINC_22)))
-#if (!CONF_DMAC_SRCINC_22)
-#define CONF_DMAC_SRC_STRIDE_22 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_22)
-#define CONF_DMAC_DES_STRIDE_22 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_22
-#define CONF_DMAC_SRC_STRIDE_22 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_22
-#define CONF_DMAC_DES_STRIDE_22 0
-#endif
-
-// <e> Channel 23 settings
-// <id> dmac_channel_23_settings
-#ifndef CONF_DMAC_CHANNEL_23_SETTINGS
-#define CONF_DMAC_CHANNEL_23_SETTINGS 0
-#endif
-
-// <o> Burst Size
-// <0x0=> 1 burst size
-// <0x1=> 4 burst size
-// <0x2=> 8 burst size
-// <0x3=> 16 burst size
-// <i> Define the memory burst size
-// <id> dmac_burstsize_23
-#ifndef CONF_DMAC_BURSTSIZE_23
-#define CONF_DMAC_BURSTSIZE_23 0x0
-#endif
-
-// <o> Chunk Size
-// <0x0=> 1 data transferred
-// <0x1=> 2 data transferred
-// <0x2=> 4 data transferred
-// <0x3=> 8 data transferred
-// <0x4=> 16 data transferred
-// <i> Define the peripheral chunk size
-// <id> dmac_chunksize_23
-#ifndef CONF_DMAC_CHUNKSIZE_23
-#define CONF_DMAC_CHUNKSIZE_23 0x0
-#endif
-
-// <o> Beat Size
-// <0=> 8-bit bus transfer
-// <1=> 16-bit bus transfer
-// <2=> 32-bit bus transfer
-// <i> Defines the size of one beat
-// <id> dmac_beatsize_23
-#ifndef CONF_DMAC_BEATSIZE_23
-#define CONF_DMAC_BEATSIZE_23 0x0
-#endif
-
-// <o> Source Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is read through the system bus interface 0 or 1
-// <id> dma_src_interface_23
-#ifndef CONF_DMAC_SRC_INTERFACE_23
-#define CONF_DMAC_SRC_INTERFACE_23 0x0
-#endif
-
-// <o> Destination Interface Identifier
-// <0x0=> AHB_IF0
-// <0x1=> AHB_IF1
-// <i> Define the data is written through the system bus interface 0 or 1
-// <id> dma_des_interface_23
-#ifndef CONF_DMAC_DES_INTERFACE_23
-#define CONF_DMAC_DES_INTERFACE_23 0x0
-#endif
-
-// <q> Source Address Increment
-// <i> Indicates whether the source address incremented as beat size or not
-// <id> dmac_srcinc_23
-#ifndef CONF_DMAC_SRCINC_23
-#define CONF_DMAC_SRCINC_23 0
-#endif
-
-// <q> Destination Address Increment
-// <i> Indicates whether the destination address incremented as beat size or not
-// <id> dmac_dstinc_23
-#ifndef CONF_DMAC_DSTINC_23
-#define CONF_DMAC_DSTINC_23 0
-#endif
-
-// <o> Transfer Type
-// <0x0=> Memory to Memory Transfer
-// <0x1=> Peripheral to Memory Transfer
-// <0x2=> Memory to Peripheral Transfer
-// <i> Define the data transfer type
-// <id> dma_trans_type_23
-#ifndef CONF_DMAC_TRANS_TYPE_23
-#define CONF_DMAC_TRANS_TYPE_23 0x0
-#endif
-
-// <o> Trigger source
-// <0xFF=> Software Trigger
-// <0x00=> HSMCI TX/RX Trigger
-// <0x01=> SPI0 TX Trigger
-// <0x02=> SPI0 RX Trigger
-// <0x03=> SPI1 TX Trigger
-// <0x04=> SPI1 RX Trigger
-// <0x05=> QSPI TX Trigger
-// <0x06=> QSPI RX Trigger
-// <0x07=> USART0 TX Trigger
-// <0x08=> USART0 RX Trigger
-// <0x09=> USART1 TX Trigger
-// <0x0A=> USART1 RX Trigger
-// <0x0B=> USART2 TX Trigger
-// <0x0C=> USART2 RX Trigger
-// <0x0D=> PWM0 TX Trigger
-// <0x0E=> TWIHS0 TX Trigger
-// <0x0F=> TWIHS0 RX Trigger
-// <0x10=> TWIHS1 TX Trigger
-// <0x11=> TWIHS1 RX Trigger
-// <0x12=> TWIHS2 TX Trigger
-// <0x13=> TWIHS2 RX Trigger
-// <0x14=> UART0 TX Trigger
-// <0x15=> UART0 RX Trigger
-// <0x16=> UART1 TX Trigger
-// <0x17=> UART1 RX Trigger
-// <0x18=> UART2 TX Trigger
-// <0x19=> UART2 RX Trigger
-// <0x1A=> UART3 TX Trigger
-// <0x1B=> UART3 RX Trigger
-// <0x1C=> UART4 TX Trigger
-// <0x1D=> UART4 RX Trigger
-// <0x1E=> DACC TX Trigger
-// <0x20=> SSC TX Trigger
-// <0x21=> SSC RX Trigger
-// <0x22=> PIOA RX Trigger
-// <0x23=> AFEC0 RX Trigger
-// <0x24=> AFEC1 RX Trigger
-// <0x25=> AES TX Trigger
-// <0x26=> AES RX Trigger
-// <0x27=> PWM1 TX Trigger
-// <0x28=> TC0 RX Trigger
-// <0x29=> TC3 RX Trigger
-// <0x2A=> TC6 RX Trigger
-// <0x2B=> TC9 RX Trigger
-// <0x2C=> I2SC0 TX Left Trigger
-// <0x2D=> I2SC0 RX Left Trigger
-// <0x2E=> I2SC1 TX Left Trigger
-// <0x2F=> I2SC1 RX Left Trigger
-// <0x30=> I2SC0 TX Right Trigger
-// <0x31=> I2SC0 RX Right Trigger
-// <0x32=> I2SC1 TX Right Trigger
-// <0x33=> I2SC1 RX Right Trigger
-// <i> Define the DMA trigger source
-// <id> dmac_trifsrc_23
-#ifndef CONF_DMAC_TRIGSRC_23
-#define CONF_DMAC_TRIGSRC_23 0xff
-#endif
-
-// </e>
-
-#if CONF_DMAC_TRANS_TYPE_23 == 0
-#define CONF_DMAC_TYPE_23 0
-#define CONF_DMAC_DSYNC_23 0
-#elif CONF_DMAC_TRANS_TYPE_23 == 1
-#define CONF_DMAC_TYPE_23 1
-#define CONF_DMAC_DSYNC_23 0
-#elif CONF_DMAC_TRANS_TYPE_23 == 2
-#define CONF_DMAC_TYPE_23 1
-#define CONF_DMAC_DSYNC_23 1
-#endif
-
-#if CONF_DMAC_TRIGSRC_23 == 0xFF
-#define CONF_DMAC_SWREQ_23 1
-#else
-#define CONF_DMAC_SWREQ_23 0
-#endif
-
-/* Errata: If XDMA is used to transfer 8-bit or 16-bit data in fixed source address
- * or fixed destination address mode, source and destination addresses are incremented
- * by 8-bit or 16-bit.
- * Workaround: The user can fix the problem by setting the source addressing mode to
- * use microblock and data striding with microblock stride set to 0 and data stride set to -1.
- */
-#if (CONF_DMAC_CHANNEL_23_SETTINGS == 1 && CONF_DMAC_BEATSIZE_23 != 2 \
- && ((!CONF_DMAC_SRCINC_23) || (!CONF_DMAC_DSTINC_23)))
-#if (!CONF_DMAC_SRCINC_23)
-#define CONF_DMAC_SRC_STRIDE_23 ((int16_t)(-1))
-#endif
-#if (!CONF_DMAC_DSTINC_23)
-#define CONF_DMAC_DES_STRIDE_23 ((int16_t)(-1))
-#endif
-#endif
-
-#ifndef CONF_DMAC_SRC_STRIDE_23
-#define CONF_DMAC_SRC_STRIDE_23 0
-#endif
-
-#ifndef CONF_DMAC_DES_STRIDE_23
-#define CONF_DMAC_DES_STRIDE_23 0
-#endif
-
-// </e>
-
-// <<< end of configuration section >>>
-
-#endif // HPL_XDMAC_CONFIG_H
diff --git a/tinyusb/hw/bsp/same70_xplained/peripheral_clk_config.h b/tinyusb/hw/bsp/same70_xplained/peripheral_clk_config.h
deleted file mode 100755
index 84756f5a..00000000
--- a/tinyusb/hw/bsp/same70_xplained/peripheral_clk_config.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/* Auto-generated config file peripheral_clk_config.h */
-#ifndef PERIPHERAL_CLK_CONFIG_H
-#define PERIPHERAL_CLK_CONFIG_H
-
-// <<< Use Configuration Wizard in Context Menu >>>
-
-/**
- * \def CONF_HCLK_FREQUENCY
- * \brief HCLK's Clock frequency
- */
-#ifndef CONF_HCLK_FREQUENCY
-#define CONF_HCLK_FREQUENCY 300000000
-#endif
-
-/**
- * \def CONF_FCLK_FREQUENCY
- * \brief FCLK's Clock frequency
- */
-#ifndef CONF_FCLK_FREQUENCY
-#define CONF_FCLK_FREQUENCY 300000000
-#endif
-
-/**
- * \def CONF_CPU_FREQUENCY
- * \brief CPU's Clock frequency
- */
-#ifndef CONF_CPU_FREQUENCY
-#define CONF_CPU_FREQUENCY 300000000
-#endif
-
-/**
- * \def CONF_SLCK_FREQUENCY
- * \brief Slow Clock frequency
- */
-#define CONF_SLCK_FREQUENCY 0
-
-/**
- * \def CONF_MCK_FREQUENCY
- * \brief Master Clock frequency
- */
-#define CONF_MCK_FREQUENCY 150000000
-
-/**
- * \def CONF_PCK6_FREQUENCY
- * \brief Programmable Clock Controller 6 frequency
- */
-#define CONF_PCK6_FREQUENCY 1714285
-
-// <h> USART Clock Settings
-// <o> USART Clock source
-
-// <0=> Master Clock (MCK)
-// <1=> MCK / 8 for USART
-// <2=> Programmable Clock Controller 4 (PMC_PCK4)
-// <3=> External Clock
-// <i> This defines the clock source for the USART
-// <id> usart_clock_source
-#ifndef CONF_USART1_CK_SRC
-#define CONF_USART1_CK_SRC 0
-#endif
-
-// <o> USART External Clock Input on SCK <1-4294967295>
-// <i> Inputs the external clock frequency on SCK
-// <id> usart_clock_freq
-#ifndef CONF_USART1_SCK_FREQ
-#define CONF_USART1_SCK_FREQ 10000000
-#endif
-
-// </h>
-
-/**
- * \def USART FREQUENCY
- * \brief USART's Clock frequency
- */
-#ifndef CONF_USART1_FREQUENCY
-#define CONF_USART1_FREQUENCY 150000000
-#endif
-
-#ifndef CONF_SRC_USB_480M
-#define CONF_SRC_USB_480M 0
-#endif
-
-#ifndef CONF_SRC_USB_48M
-#define CONF_SRC_USB_48M 1
-#endif
-
-// <y> USB Full/Low Speed Clock
-// <CONF_SRC_USB_48M"> USB Clock Controller (USB_48M)
-// <id> usb_fsls_clock_source
-// <i> 48MHz clock source for low speed and full speed.
-// <i> It must be available when low speed is supported by host driver.
-// <i> It must be available when low power mode is selected.
-#ifndef CONF_USBHS_FSLS_SRC
-#define CONF_USBHS_FSLS_SRC CONF_SRC_USB_48M
-#endif
-
-// <y> USB Clock Source(Normal/Low-power Mode Selection)
-// <CONF_SRC_USB_480M"> USB High Speed Clock (USB_480M)
-// <CONF_SRC_USB_48M"> USB Clock Controller (USB_48M)
-// <id> usb_clock_source
-// <i> Select the clock source for USB.
-// <i> In normal mode, use "USB High Speed Clock (USB_480M)".
-// <i> In low-power mode, use "USB Clock Controller (USB_48M)".
-#ifndef CONF_USBHS_SRC
-#define CONF_USBHS_SRC CONF_SRC_USB_480M
-#endif
-
-/**
- * \def CONF_USBHS_FSLS_FREQUENCY
- * \brief USBHS's Full/Low Speed Clock Source frequency
- */
-#ifndef CONF_USBHS_FSLS_FREQUENCY
-#define CONF_USBHS_FSLS_FREQUENCY 48000000
-#endif
-
-/**
- * \def CONF_USBHS_FREQUENCY
- * \brief USBHS's Selected Clock Source frequency
- */
-#ifndef CONF_USBHS_FREQUENCY
-#define CONF_USBHS_FREQUENCY 480000000
-#endif
-
-// <<< end of configuration section >>>
-
-#endif // PERIPHERAL_CLK_CONFIG_H
diff --git a/tinyusb/hw/bsp/same70_xplained/same70_xplained.c b/tinyusb/hw/bsp/same70_xplained/same70_xplained.c
deleted file mode 100755
index e6e7db0f..00000000
--- a/tinyusb/hw/bsp/same70_xplained/same70_xplained.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, hathach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "sam.h"
-#include "bsp/board.h"
-
-#include "peripheral_clk_config.h"
-#include "hpl/usart/hpl_usart_base.h"
-#include "hpl/pmc/hpl_pmc.h"
-#include "hal/include/hal_init.h"
-#include "hal/include/hal_usart_async.h"
-#include "hal/include/hal_gpio.h"
-
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-#define LED_PIN GPIO(GPIO_PORTC, 8)
-
-#define BUTTON_PIN GPIO(GPIO_PORTA, 11)
-#define BUTTON_STATE_ACTIVE 0
-
-#define UART_TX_PIN GPIO(GPIO_PORTB, 4)
-#define UART_RX_PIN GPIO(GPIO_PORTA, 21)
-
-static struct usart_async_descriptor edbg_com;
-static uint8_t edbg_com_buffer[64];
-static volatile bool uart_busy = false;
-
-static void tx_cb_EDBG_COM(const struct usart_async_descriptor *const io_descr)
-{
- (void) io_descr;
- uart_busy = false;
-}
-
-//------------- IMPLEMENTATION -------------//
-void board_init(void)
-{
- init_mcu();
-
- /* Disable Watchdog */
- hri_wdt_set_MR_WDDIS_bit(WDT);
-
- // LED
- _pmc_enable_periph_clock(ID_PIOC);
- gpio_set_pin_level(LED_PIN, false);
- gpio_set_pin_direction(LED_PIN, GPIO_DIRECTION_OUT);
- gpio_set_pin_function(LED_PIN, GPIO_PIN_FUNCTION_OFF);
-
- // Button
- _pmc_enable_periph_clock(ID_PIOA);
- gpio_set_pin_direction(BUTTON_PIN, GPIO_DIRECTION_IN);
- gpio_set_pin_pull_mode(BUTTON_PIN, GPIO_PULL_UP);
- gpio_set_pin_function(BUTTON_PIN, GPIO_PIN_FUNCTION_OFF);
-
- // Uart via EDBG Com
- _pmc_enable_periph_clock(ID_USART1);
- gpio_set_pin_function(UART_RX_PIN, MUX_PA21A_USART1_RXD1);
- gpio_set_pin_function(UART_TX_PIN, MUX_PB4D_USART1_TXD1);
-
- usart_async_init(&edbg_com, USART1, edbg_com_buffer, sizeof(edbg_com_buffer), _usart_get_usart_async());
- usart_async_set_baud_rate(&edbg_com, CFG_BOARD_UART_BAUDRATE);
- usart_async_register_callback(&edbg_com, USART_ASYNC_TXC_CB, tx_cb_EDBG_COM);
- usart_async_enable(&edbg_com);
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer (samd SystemCoreClock may not correct)
- SysTick_Config(CONF_CPU_FREQUENCY / 1000);
-#endif
-
- // Enable USB clock
- _pmc_enable_periph_clock(ID_USBHS);
-
-}
-
-//--------------------------------------------------------------------+
-// USB Interrupt Handler
-//--------------------------------------------------------------------+
-void USBHS_Handler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- gpio_set_pin_level(LED_PIN, state);
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == gpio_get_pin_level(BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- // while until previous transfer is complete
- while(uart_busy) {}
- uart_busy = true;
-
- io_write(&edbg_com.io, buf, len);
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/samg55xplained/board.mk b/tinyusb/hw/bsp/samg55xplained/board.mk
deleted file mode 100755
index aed4de68..00000000
--- a/tinyusb/hw/bsp/samg55xplained/board.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/microchip
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib -nostartfiles \
- -D__SAMG55J19__ \
- -DCFG_TUSB_MCU=OPT_MCU_SAMG
-
-# suppress following warnings from mcu driver
-CFLAGS += -Wno-error=undef
-
-ASF_DIR = hw/mcu/microchip/samg55
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/samg55j19_flash.ld
-
-SRC_C += \
- src/portable/microchip/samg/dcd_samg.c \
- $(ASF_DIR)/samg55/gcc/gcc/startup_samg55.c \
- $(ASF_DIR)/samg55/gcc/system_samg55.c \
- $(ASF_DIR)/hpl/core/hpl_init.c \
- $(ASF_DIR)/hpl/usart/hpl_usart.c \
- $(ASF_DIR)/hpl/pmc/hpl_pmc.c \
- $(ASF_DIR)/hal/src/hal_atomic.c
-
-INC += \
- $(TOP)/hw/bsp/$(BOARD) \
- $(TOP)/$(ASF_DIR) \
- $(TOP)/$(ASF_DIR)/config \
- $(TOP)/$(ASF_DIR)/samg55/include \
- $(TOP)/$(ASF_DIR)/hal/include \
- $(TOP)/$(ASF_DIR)/hal/utils/include \
- $(TOP)/$(ASF_DIR)/hpl/core \
- $(TOP)/$(ASF_DIR)/hpl/pio \
- $(TOP)/$(ASF_DIR)/hpl/pmc \
- $(TOP)/$(ASF_DIR)/hri \
- $(TOP)/$(ASF_DIR)/CMSIS/Core/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAMG55J19
-
-# flash using edbg from https://github.com/ataradov/edbg
-flash: $(BUILD)/$(PROJECT).bin
- edbg --verbose -t samg55 -pv -f $<
diff --git a/tinyusb/hw/bsp/samg55xplained/hpl_usart_config.h b/tinyusb/hw/bsp/samg55xplained/hpl_usart_config.h
deleted file mode 100755
index 4f2837d2..00000000
--- a/tinyusb/hw/bsp/samg55xplained/hpl_usart_config.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/* Auto-generated config file hpl_usart_config.h */
-#ifndef HPL_USART_CONFIG_H
-#define HPL_USART_CONFIG_H
-
-// <<< Use Configuration Wizard in Context Menu >>>
-
-#include <peripheral_clk_config.h>
-
-#ifndef CONF_USART_7_ENABLE
-#define CONF_USART_7_ENABLE 1
-#endif
-
-// <h> Basic Configuration
-
-// <o> Frame parity
-// <0x0=>Even parity
-// <0x1=>Odd parity
-// <0x2=>Parity forced to 0
-// <0x3=>Parity forced to 1
-// <0x4=>No parity
-// <i> Parity bit mode for USART frame
-// <id> usart_parity
-#ifndef CONF_USART_7_PARITY
-#define CONF_USART_7_PARITY 0x4
-#endif
-
-// <o> Character Size
-// <0x0=>5 bits
-// <0x1=>6 bits
-// <0x2=>7 bits
-// <0x3=>8 bits
-// <i> Data character size in USART frame
-// <id> usart_character_size
-#ifndef CONF_USART_7_CHSIZE
-#define CONF_USART_7_CHSIZE 0x3
-#endif
-
-// <o> Stop Bit
-// <0=>1 stop bit
-// <1=>1.5 stop bits
-// <2=>2 stop bits
-// <i> Number of stop bits in USART frame
-// <id> usart_stop_bit
-#ifndef CONF_USART_7_SBMODE
-#define CONF_USART_7_SBMODE 0
-#endif
-
-// <o> Clock Output Select
-// <0=>The USART does not drive the SCK pin
-// <1=>The USART drives the SCK pin if USCLKS does not select the external clock SCK
-// <i> Clock Output Select in USART sck, if in usrt master mode, please drive SCK.
-// <id> usart_clock_output_select
-#ifndef CONF_USART_7_CLKO
-#define CONF_USART_7_CLKO 0
-#endif
-
-// <o> Baud rate <1-3000000>
-// <i> USART baud rate setting
-// <id> usart_baud_rate
-#ifndef CONF_USART_7_BAUD
-#define CONF_USART_7_BAUD 9600
-#endif
-
-// </h>
-
-// <e> Advanced configuration
-// <id> usart_advanced
-#ifndef CONF_USART_7_ADVANCED_CONFIG
-#define CONF_USART_7_ADVANCED_CONFIG 0
-#endif
-
-// <o> Channel Mode
-// <0=>Normal Mode
-// <1=>Automatic Echo
-// <2=>Local Loopback
-// <3=>Remote Loopback
-// <i> Channel mode in USART frame
-// <id> usart_channel_mode
-#ifndef CONF_USART_7_CHMODE
-#define CONF_USART_7_CHMODE 0
-#endif
-
-// <q> 9 bits character enable
-// <i> Enable 9 bits character, this has high priority than 5/6/7/8 bits.
-// <id> usart_9bits_enable
-#ifndef CONF_USART_7_MODE9
-#define CONF_USART_7_MODE9 0
-#endif
-
-// <o> Variable Sync
-// <0=>User defined configuration
-// <1=>sync field is updated when a character is written into US_THR
-// <i> Variable Synchronization of Command/Data Sync Start Frarm Delimiter
-// <id> variable_sync
-#ifndef CONF_USART_7_VAR_SYNC
-#define CONF_USART_7_VAR_SYNC 0
-#endif
-
-// <o> Oversampling Mode
-// <0=>16 Oversampling
-// <1=>8 Oversampling
-// <i> Oversampling Mode in UART mode
-// <id> usart__oversampling_mode
-#ifndef CONF_USART_7_OVER
-#define CONF_USART_7_OVER 0
-#endif
-
-// <o> Inhibit Non Ack
-// <0=>The NACK is generated
-// <1=>The NACK is not generated
-// <i> Inhibit Non Acknowledge
-// <id> usart__inack
-#ifndef CONF_USART_7_INACK
-#define CONF_USART_7_INACK 1
-#endif
-
-// <o> Disable Successive NACK
-// <0=>NACK is sent on the ISO line as soon as a parity error occurs
-// <1=>Many parity errors generate a NACK on the ISO line
-// <i> Disable Successive NACK
-// <id> usart_dsnack
-#ifndef CONF_USART_7_DSNACK
-#define CONF_USART_7_DSNACK 0
-#endif
-
-// <o> Inverted Data
-// <0=>Data isn't inverted, nomal mode
-// <1=>Data is inverted
-// <i> Inverted Data
-// <id> usart_invdata
-#ifndef CONF_USART_7_INVDATA
-#define CONF_USART_7_INVDATA 0
-#endif
-
-// <o> Maximum Number of Automatic Iteration <0-7>
-// <i> Defines the maximum number of iterations in mode ISO7816, protocol T = 0.
-// <id> usart_max_iteration
-#ifndef CONF_USART_7_MAX_ITERATION
-#define CONF_USART_7_MAX_ITERATION 0
-#endif
-
-// <q> Receive Line Filter enable
-// <i> whether the USART filters the receive line using a three-sample filter
-// <id> usart_receive_filter_enable
-#ifndef CONF_USART_7_FILTER
-#define CONF_USART_7_FILTER 0
-#endif
-
-// <q> Manchester Encoder/Decoder Enable
-// <i> whether the USART Manchester Encoder/Decoder
-// <id> usart_manchester_filter_enable
-#ifndef CONF_USART_7_MAN
-#define CONF_USART_7_MAN 0
-#endif
-
-// <o> Manchester Synchronization Mode
-// <0=>The Manchester start bit is a 0 to 1 transition
-// <1=>The Manchester start bit is a 1 to 0 transition
-// <i> Manchester Synchronization Mode
-// <id> usart_manchester_synchronization_mode
-#ifndef CONF_USART_7_MODSYNC
-#define CONF_USART_7_MODSYNC 0
-#endif
-
-// <o> Start Frame Delimiter Selector
-// <0=>Start frame delimiter is COMMAND or DATA SYNC
-// <1=>Start frame delimiter is one bit
-// <i> Start Frame Delimiter Selector
-// <id> usart_start_frame_delimiter
-#ifndef CONF_USART_7_ONEBIT
-#define CONF_USART_7_ONEBIT 0
-#endif
-
-// <o> Fractional Part <0-7>
-// <i> Fractional part of the baud rate if baud rate generator is in fractional mode
-// <id> usart_arch_fractional
-#ifndef CONF_USART_7_FRACTIONAL
-#define CONF_USART_7_FRACTIONAL 0x0
-#endif
-
-// <o> Data Order
-// <0=>LSB is transmitted first
-// <1=>MSB is transmitted first
-// <i> Data order of the data bits in the frame
-// <id> usart_arch_msbf
-#ifndef CONF_USART_7_MSBF
-#define CONF_USART_7_MSBF 0
-#endif
-
-// </e>
-
-#define CONF_USART_7_MODE 0x0
-
-// Calculate BAUD register value in UART mode
-#if CONF_FLEXCOM7_CK_SRC < 3
-#ifndef CONF_USART_7_BAUD_CD
-#define CONF_USART_7_BAUD_CD ((CONF_FLEXCOM7_FREQUENCY) / CONF_USART_7_BAUD / 8 / (2 - CONF_USART_7_OVER))
-#endif
-#ifndef CONF_USART_7_BAUD_FP
-#define CONF_USART_7_BAUD_FP \
- ((CONF_FLEXCOM7_FREQUENCY) / CONF_USART_7_BAUD / (2 - CONF_USART_7_OVER) - 8 * CONF_USART_7_BAUD_CD)
-#endif
-#elif CONF_FLEXCOM7_CK_SRC == 3
-// No division is active. The value written in US_BRGR has no effect.
-#ifndef CONF_USART_7_BAUD_CD
-#define CONF_USART_7_BAUD_CD 1
-#endif
-#ifndef CONF_USART_7_BAUD_FP
-#define CONF_USART_7_BAUD_FP 1
-#endif
-#endif
-
-// <<< end of configuration section >>>
-
-#endif // HPL_USART_CONFIG_H
diff --git a/tinyusb/hw/bsp/samg55xplained/peripheral_clk_config.h b/tinyusb/hw/bsp/samg55xplained/peripheral_clk_config.h
deleted file mode 100755
index 6d390f38..00000000
--- a/tinyusb/hw/bsp/samg55xplained/peripheral_clk_config.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Auto-generated config file peripheral_clk_config.h */
-#ifndef PERIPHERAL_CLK_CONFIG_H
-#define PERIPHERAL_CLK_CONFIG_H
-
-// <<< Use Configuration Wizard in Context Menu >>>
-
-/**
- * \def CONF_HCLK_FREQUENCY
- * \brief HCLK's Clock frequency
- */
-#ifndef CONF_HCLK_FREQUENCY
-#define CONF_HCLK_FREQUENCY 8000000
-#endif
-
-/**
- * \def CONF_FCLK_FREQUENCY
- * \brief FCLK's Clock frequency
- */
-#ifndef CONF_FCLK_FREQUENCY
-#define CONF_FCLK_FREQUENCY 8000000
-#endif
-
-/**
- * \def CONF_CPU_FREQUENCY
- * \brief CPU's Clock frequency
- */
-#ifndef CONF_CPU_FREQUENCY
-#define CONF_CPU_FREQUENCY 8000000
-#endif
-
-/**
- * \def CONF_SLCK_FREQUENCY
- * \brief Slow Clock frequency
- */
-#define CONF_SLCK_FREQUENCY 32768
-
-/**
- * \def CONF_MCK_FREQUENCY
- * \brief Master Clock frequency
- */
-#define CONF_MCK_FREQUENCY 8000000
-
-// <o> USB Clock Source
-// <0=> USB Clock Controller (USB_48M)
-// <id> usb_clock_source
-// <i> Select the clock source for USB.
-#ifndef CONF_UDP_SRC
-#define CONF_UDP_SRC 0
-#endif
-
-/**
- * \def CONF_UDP_FREQUENCY
- * \brief UDP's Clock frequency
- */
-#ifndef CONF_UDP_FREQUENCY
-#define CONF_UDP_FREQUENCY 48005120
-#endif
-
-// <h> FLEXCOM Clock Settings
-// <o> FLEXCOM Clock source
-// <0=> Master Clock (MCK)
-// <1=> MCK / 8
-// <2=> Programmable Clock Controller 6 (PMC_PCK6)
-// <2=> Programmable Clock Controller 7 (PMC_PCK7)
-// <3=> External Clock
-// <i> This defines the clock source for the FLEXCOM, PCK6 is used for FLEXCOM0/1/2/3 and PCK7 is used for FLEXCOM4/5/6/7
-// <id> flexcom_clock_source
-#ifndef CONF_FLEXCOM7_CK_SRC
-#define CONF_FLEXCOM7_CK_SRC 0
-#endif
-
-// <o> FLEXCOM External Clock Input on SCK <1-4294967295>
-// <i> Inputs the external clock frequency on SCK
-// <id> flexcom_clock_freq
-#ifndef CONF_FLEXCOM7_SCK_FREQ
-#define CONF_FLEXCOM7_SCK_FREQ 10000000
-#endif
-
-#ifndef CONF_FLEXCOM7_FREQUENCY
-#define CONF_FLEXCOM7_FREQUENCY 8000000
-#endif
-
-// <<< end of configuration section >>>
-
-#endif // PERIPHERAL_CLK_CONFIG_H
diff --git a/tinyusb/hw/bsp/samg55xplained/samg55j19_flash.ld b/tinyusb/hw/bsp/samg55xplained/samg55j19_flash.ld
deleted file mode 100755
index 21c0b5bc..00000000
--- a/tinyusb/hw/bsp/samg55xplained/samg55j19_flash.ld
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * \file
- *
- * \brief GCC linker script (flash) for ATSAMG55J19
- *
- * Copyright (c) 2017 Atmel Corporation, a wholly owned subsidiary of Microchip Technology Inc.
- *
- * \license_start
- *
- * \page License
- *
- * 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.
- *
- * \license_stop
- *
- */
-
-/*------------------------------------------------------------------------------
- * Linker script for running in internal FLASH on the ATSAMG55J19
- *----------------------------------------------------------------------------*/
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00400000, LENGTH = 0x00080000 /* rom, 524288K */
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00028000 /* ram, 163840K */
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
-
-/* The heapsize used by the application. NOTE: you need to adjust according to your application. */
-HEAP_SIZE = DEFINED(HEAP_SIZE) ? HEAP_SIZE : DEFINED(__heap_size__) ? __heap_size__ : 0x0200;
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(0x4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* heap section */
- .heap (NOLOAD):
- {
- . = ALIGN(8);
- _sheap = .;
- . = . + HEAP_SIZE;
- . = ALIGN(8);
- _eheap = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
- _ram_end_ = ORIGIN(ram) + LENGTH(ram) - 1 ;
-}
diff --git a/tinyusb/hw/bsp/samg55xplained/samg55xplained.c b/tinyusb/hw/bsp/samg55xplained/samg55xplained.c
deleted file mode 100755
index ed106b06..00000000
--- a/tinyusb/hw/bsp/samg55xplained/samg55xplained.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, hathach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#include "sam.h"
-#include "bsp/board.h"
-
-#include "peripheral_clk_config.h"
-#include "hal/include/hal_init.h"
-#include "hal/include/hpl_usart_sync.h"
-#include "hpl/pmc/hpl_pmc.h"
-#include "hal/include/hal_gpio.h"
-
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-#define LED_PIN GPIO(GPIO_PORTA, 6)
-
-#define BUTTON_PIN GPIO(GPIO_PORTA, 2)
-#define BUTTON_STATE_ACTIVE 0
-
-#define UART_TX_PIN GPIO(GPIO_PORTA, 28)
-#define UART_RX_PIN GPIO(GPIO_PORTA, 27)
-
-struct _usart_sync_device edbg_com;
-
-//------------- IMPLEMENTATION -------------//
-void board_init(void)
-{
- init_mcu();
-
- _pmc_enable_periph_clock(ID_PIOA);
-
- /* Disable Watchdog */
- hri_wdt_set_MR_WDDIS_bit(WDT);
-
- // LED
- gpio_set_pin_level(LED_PIN, false);
- gpio_set_pin_direction(LED_PIN, GPIO_DIRECTION_OUT);
- gpio_set_pin_function(LED_PIN, GPIO_PIN_FUNCTION_OFF);
-
- // Button
- gpio_set_pin_direction(BUTTON_PIN, GPIO_DIRECTION_IN);
- gpio_set_pin_pull_mode(BUTTON_PIN, GPIO_PULL_UP);
- gpio_set_pin_function(BUTTON_PIN, GPIO_PIN_FUNCTION_OFF);
-
- // Uart via EDBG Com
- _pmc_enable_periph_clock(ID_FLEXCOM7);
- gpio_set_pin_function(UART_RX_PIN, MUX_PA27B_FLEXCOM7_RXD);
- gpio_set_pin_function(UART_TX_PIN, MUX_PA28B_FLEXCOM7_TXD);
-
- _usart_sync_init(&edbg_com, FLEXCOM7);
- _usart_sync_set_baud_rate(&edbg_com, CFG_BOARD_UART_BAUDRATE);
- _usart_sync_set_mode(&edbg_com, USART_MODE_ASYNCHRONOUS);
- _usart_sync_enable(&edbg_com);
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer (samd SystemCoreClock may not correct)
- SysTick_Config(CONF_CPU_FREQUENCY / 1000);
-#endif
-
- // USB Pin, Clock init
-
- /* Clear SYSIO 10 & 11 for USB DM & DP */
- hri_matrix_clear_CCFG_SYSIO_reg(MATRIX, CCFG_SYSIO_SYSIO10 | CCFG_SYSIO_SYSIO11);
-
- // Enable clock
- _pmc_enable_periph_clock(ID_UDP);
-
- /* USB Device mode & Transceiver active */
- hri_matrix_write_CCFG_USBMR_reg(MATRIX, CCFG_USBMR_USBMODE);
-}
-
-//--------------------------------------------------------------------+
-// USB Interrupt Handler
-//--------------------------------------------------------------------+
-void UDP_Handler(void)
-{
- #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
- tud_int_handler(0);
- #endif
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- gpio_set_pin_level(LED_PIN, state);
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == gpio_get_pin_level(BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- uint8_t const * buf8 = (uint8_t const *) buf;
- for(int i=0; i<len; i++)
- {
- while ( !_usart_sync_is_ready_to_send(&edbg_com) ) {}
- _usart_sync_write_byte(&edbg_com, buf8[i]);
- }
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/saml2x/boards/atsaml21_xpro/board.h b/tinyusb/hw/bsp/saml2x/boards/atsaml21_xpro/board.h
deleted file mode 100755
index a3e03997..00000000
--- a/tinyusb/hw/bsp/saml2x/boards/atsaml21_xpro/board.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN (32 + 30) // PB30
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PIN (0 + 15) // PA15
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_RX_PIN 4
-#define UART_TX_PIN 5
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/saml2x/boards/atsaml21_xpro/board.mk b/tinyusb/hw/bsp/saml2x/boards/atsaml21_xpro/board.mk
deleted file mode 100755
index 81b4ecdc..00000000
--- a/tinyusb/hw/bsp/saml2x/boards/atsaml21_xpro/board.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-CFLAGS += -D__SAML21J18B__
-
-SAML_VARIANT = saml21
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/saml21j18b_flash.ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAML21J18
-
-# flash using jlink
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/saml2x/boards/atsaml21_xpro/saml21j18b_flash.ld b/tinyusb/hw/bsp/saml2x/boards/atsaml21_xpro/saml21j18b_flash.ld
deleted file mode 100755
index 7f6b7fa9..00000000
--- a/tinyusb/hw/bsp/saml2x/boards/atsaml21_xpro/saml21j18b_flash.ld
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAML21J18B
- *
- * Copyright (c) 2016 Atmel Corporation,
- * a wholly owned subsidiary of Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
- lpram (rwx) : ORIGIN = 0x30000000, LENGTH = 0x00002000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- .lpram (NOLOAD):
- {
- . = ALIGN(8);
- _slpram = .;
- *(.lpram .lpram.*);
- . = ALIGN(8);
- _elpram = .;
- } > lpram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/saml2x/boards/saml22_feather/board.h b/tinyusb/hw/bsp/saml2x/boards/saml22_feather/board.h
deleted file mode 100755
index 13a32600..00000000
--- a/tinyusb/hw/bsp/saml2x/boards/saml22_feather/board.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN PIN_PA08
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN PIN_PA06
-#define BUTTON_STATE_ACTIVE 0
-
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/saml2x/boards/saml22_feather/board.mk b/tinyusb/hw/bsp/saml2x/boards/saml22_feather/board.mk
deleted file mode 100755
index 0605dca1..00000000
--- a/tinyusb/hw/bsp/saml2x/boards/saml22_feather/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -D__SAML22J18A__
-
-SAML_VARIANT = saml22
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAML22J18
-
-flash: flash-bossac
diff --git a/tinyusb/hw/bsp/saml2x/boards/saml22_feather/saml22_feather.ld b/tinyusb/hw/bsp/saml2x/boards/saml22_feather/saml22_feather.ld
deleted file mode 100755
index d1aaa44f..00000000
--- a/tinyusb/hw/bsp/saml2x/boards/saml22_feather/saml22_feather.ld
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAML22J18A
- *
- * Copyright (c) 2018 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
-
-ENTRY(Reset_Handler)
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/saml2x/boards/sensorwatch_m0/board.h b/tinyusb/hw/bsp/saml2x/boards/sensorwatch_m0/board.h
deleted file mode 100755
index 7fc690ab..00000000
--- a/tinyusb/hw/bsp/saml2x/boards/sensorwatch_m0/board.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PIN PIN_PA21
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PIN PIN_PA22
-#define BUTTON_STATE_ACTIVE 1
-
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/saml2x/boards/sensorwatch_m0/board.mk b/tinyusb/hw/bsp/saml2x/boards/sensorwatch_m0/board.mk
deleted file mode 100755
index 0605dca1..00000000
--- a/tinyusb/hw/bsp/saml2x/boards/sensorwatch_m0/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -D__SAML22J18A__
-
-SAML_VARIANT = saml22
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/$(BOARD).ld
-
-# For flash-jlink target
-JLINK_DEVICE = ATSAML22J18
-
-flash: flash-bossac
diff --git a/tinyusb/hw/bsp/saml2x/boards/sensorwatch_m0/sensorwatch_m0.ld b/tinyusb/hw/bsp/saml2x/boards/sensorwatch_m0/sensorwatch_m0.ld
deleted file mode 100755
index d1aaa44f..00000000
--- a/tinyusb/hw/bsp/saml2x/boards/sensorwatch_m0/sensorwatch_m0.ld
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * \file
- *
- * \brief Linker script for running in internal FLASH on the SAML22J18A
- *
- * Copyright (c) 2018 Microchip Technology Inc.
- *
- * \asf_license_start
- *
- * \page License
- *
- * 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 Licence 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.
- *
- * \asf_license_stop
- *
- */
-
-
-OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
-OUTPUT_ARCH(arm)
-SEARCH_DIR(.)
-
-/* Memory Spaces Definitions */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
-}
-
-/* The stack size used by the application. NOTE: you need to adjust according to your application. */
-STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
-
-ENTRY(Reset_Handler)
-
-/* Section Definitions */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(4);
- _sfixed = .;
- KEEP(*(.vectors .vectors.*))
- *(.text .text.* .gnu.linkonce.t.*)
- *(.glue_7t) *(.glue_7)
- *(.rodata .rodata* .gnu.linkonce.r.*)
- *(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* Support C constructors, and C destructors in both user code
- and the C library. This also provides support for C++ code. */
- . = ALIGN(4);
- KEEP(*(.init))
- . = ALIGN(4);
- __preinit_array_start = .;
- KEEP (*(.preinit_array))
- __preinit_array_end = .;
-
- . = ALIGN(4);
- __init_array_start = .;
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __init_array_end = .;
-
- . = ALIGN(4);
- KEEP (*crtbegin.o(.ctors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*crtend.o(.ctors))
-
- . = ALIGN(4);
- KEEP(*(.fini))
-
- . = ALIGN(4);
- __fini_array_start = .;
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __fini_array_end = .;
-
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*crtend.o(.dtors))
-
- . = ALIGN(4);
- _efixed = .; /* End of text section */
- } > rom
-
- /* .ARM.exidx is sorted, so has to go in its own output section. */
- PROVIDE_HIDDEN (__exidx_start = .);
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > rom
- PROVIDE_HIDDEN (__exidx_end = .);
-
- . = ALIGN(4);
- _etext = .;
-
- .relocate : AT (_etext)
- {
- . = ALIGN(4);
- _srelocate = .;
- *(.ramfunc .ramfunc.*);
- *(.data .data.*);
- . = ALIGN(4);
- _erelocate = .;
- } > ram
-
- /* .bss section which is used for uninitialized data */
- .bss (NOLOAD) :
- {
- . = ALIGN(4);
- _sbss = . ;
- _szero = .;
- *(.bss .bss.*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- _ezero = .;
- end = .;
- } > ram
-
- /* stack section */
- .stack (NOLOAD):
- {
- . = ALIGN(8);
- _sstack = .;
- . = . + STACK_SIZE;
- . = ALIGN(8);
- _estack = .;
- } > ram
-
- . = ALIGN(4);
- _end = . ;
-}
diff --git a/tinyusb/hw/bsp/saml2x/family.c b/tinyusb/hw/bsp/saml2x/family.c
deleted file mode 100755
index 470fde75..00000000
--- a/tinyusb/hw/bsp/saml2x/family.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "sam.h"
-#include "bsp/board.h"
-#include "board.h"
-
-#include "hal/include/hal_gpio.h"
-#include "hal/include/hal_init.h"
-#include "hpl/gclk/hpl_gclk_base.h"
-#include "hpl_mclk_config.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_Handler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-/* Referenced GCLKs (out of 0~4), should be initialized firstly */
-#define _GCLK_INIT_1ST 0x00000000
-/* Not referenced GCLKs, initialized last */
-#define _GCLK_INIT_LAST 0x0000001F
-
-void board_init(void)
-{
- // Clock init ( follow hpl_init.c )
- hri_nvmctrl_set_CTRLB_RWS_bf(NVMCTRL, CONF_NVM_WAIT_STATE);
-
- _set_performance_level(2);
-
- _osc32kctrl_init_sources();
- _oscctrl_init_sources();
- _mclk_init();
-#if _GCLK_INIT_1ST
- _gclk_init_generators_by_fref(_GCLK_INIT_1ST);
-#endif
- _oscctrl_init_referenced_generators();
- _gclk_init_generators_by_fref(_GCLK_INIT_LAST);
-
-#if (CONF_PORT_EVCTRL_PORT_0 | CONF_PORT_EVCTRL_PORT_1 | CONF_PORT_EVCTRL_PORT_2 | CONF_PORT_EVCTRL_PORT_3)
- hri_port_set_EVCTRL_reg(PORT, 0, CONF_PORTA_EVCTRL);
- hri_port_set_EVCTRL_reg(PORT, 1, CONF_PORTB_EVCTRL);
-#endif
-
- // Update SystemCoreClock since it is hard coded with asf4 and not correct
- // Init 1ms tick timer (samd SystemCoreClock may not correct)
- SystemCoreClock = CONF_CPU_FREQUENCY;
- SysTick_Config(CONF_CPU_FREQUENCY / 1000);
-
- // Led init
- gpio_set_pin_direction(LED_PIN, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(LED_PIN, !LED_STATE_ON);
-
- // Button init
- gpio_set_pin_direction(BUTTON_PIN, GPIO_DIRECTION_IN);
- gpio_set_pin_pull_mode(BUTTON_PIN, BUTTON_STATE_ACTIVE ? GPIO_PULL_DOWN : GPIO_PULL_UP);
-
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
-#endif
-
- /* USB Clock init
- * The USB module requires a GCLK_USB of 48 MHz ~ 0.25% clock
- * for low speed and full speed operation. */
- hri_gclk_write_PCHCTRL_reg(GCLK, USB_GCLK_ID, GCLK_PCHCTRL_GEN_GCLK1_Val | GCLK_PCHCTRL_CHEN);
- hri_mclk_set_AHBMASK_USB_bit(MCLK);
- hri_mclk_set_APBBMASK_USB_bit(MCLK);
-
- // USB Pin Init
- gpio_set_pin_direction(PIN_PA24, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(PIN_PA24, false);
- gpio_set_pin_pull_mode(PIN_PA24, GPIO_PULL_OFF);
- gpio_set_pin_direction(PIN_PA25, GPIO_DIRECTION_OUT);
- gpio_set_pin_level(PIN_PA25, false);
- gpio_set_pin_pull_mode(PIN_PA25, GPIO_PULL_OFF);
-
- gpio_set_pin_function(PIN_PA24, PINMUX_PA24G_USB_DM);
- gpio_set_pin_function(PIN_PA25, PINMUX_PA25G_USB_DP);
-
- // Output 500hz PWM on PB23 (TCC0 WO[3]) so we can validate the GCLK1 clock speed
-// hri_mclk_set_APBCMASK_TCC0_bit(MCLK);
-// TCC0->PER.bit.PER = 48000000 / 1000;
-// TCC0->CC[3].bit.CC = 48000000 / 2000;
-// TCC0->CTRLA.bit.ENABLE = true;
-//
-// gpio_set_pin_function(PIN_PB23, PINMUX_PB23F_TCC0_WO3);
-// hri_gclk_write_PCHCTRL_reg(GCLK, TCC0_GCLK_ID, GCLK_PCHCTRL_GEN_GCLK1_Val | GCLK_PCHCTRL_CHEN);
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- gpio_set_pin_level(LED_PIN, state);
-}
-
-uint32_t board_button_read(void)
-{
- // button is active low
- return gpio_get_pin_level(BUTTON_PIN) ? 0 : 1;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/saml2x/family.mk b/tinyusb/hw/bsp/saml2x/family.mk
deleted file mode 100755
index e0f6b2f7..00000000
--- a/tinyusb/hw/bsp/saml2x/family.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-UF2_FAMILY_ID = 0x68ed2b88
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/microchip
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-MCU_DIR = hw/mcu/microchip/$(SAML_VARIANT)
-
-CFLAGS += \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m0plus \
- -nostdlib -nostartfiles \
- -DCONF_OSC32K_CALIB_ENABLE=0 \
- -DCFG_TUSB_MCU=OPT_MCU_SAML22
-
-SRC_C += \
- src/portable/microchip/samd/dcd_samd.c \
- $(MCU_DIR)/gcc/gcc/startup_$(SAML_VARIANT).c \
- $(MCU_DIR)/gcc/system_$(SAML_VARIANT).c \
- $(MCU_DIR)/hpl/gclk/hpl_gclk.c \
- $(MCU_DIR)/hpl/mclk/hpl_mclk.c \
- $(MCU_DIR)/hpl/pm/hpl_pm.c \
- $(MCU_DIR)/hpl/osc32kctrl/hpl_osc32kctrl.c \
- $(MCU_DIR)/hpl/oscctrl/hpl_oscctrl.c \
- $(MCU_DIR)/hal/src/hal_atomic.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/$(MCU_DIR)/ \
- $(TOP)/$(MCU_DIR)/config \
- $(TOP)/$(MCU_DIR)/include \
- $(TOP)/$(MCU_DIR)/hal/include \
- $(TOP)/$(MCU_DIR)/hal/utils/include \
- $(TOP)/$(MCU_DIR)/hpl/port \
- $(TOP)/$(MCU_DIR)/hri \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
-
-# flash using bossac at least version 1.8
-# can be found in arduino15/packages/arduino/tools/bossac/
-# Add it to your PATH or change BOSSAC variable to match your installation
-BOSSAC = bossac
-
-flash-bossac: $(BUILD)/$(PROJECT).bin
- @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
- $(BOSSAC) --port=$(SERIAL) -U -i --offset=0x2000 -e -w $^ -R
diff --git a/tinyusb/hw/bsp/sltb009a/board.mk b/tinyusb/hw/bsp/sltb009a/board.mk
deleted file mode 100755
index e8a24d1b..00000000
--- a/tinyusb/hw/bsp/sltb009a/board.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-CFLAGS += \
- -flto \
- -mthumb \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib -nostartfiles \
- -D__STARTUP_CLEAR_BSS \
- -D__START=main \
- -DEFM32GG12B810F1024GM64 \
- -DCFG_TUSB_MCU=OPT_MCU_EFM32GG12
-
-# mcu driver cause following warnings
-#CFLAGS += -Wno-error=unused-parameter
-
-SILABS_FAMILY = efm32gg12b
-SILABS_CMSIS = hw/mcu/silabs/cmsis-dfp-$(SILABS_FAMILY)/Device/SiliconLabs/$(shell echo $(SILABS_FAMILY) | tr a-z A-Z)
-
-DEPS_SUBMODULES += hw/mcu/silabs/cmsis-dfp-$(SILABS_FAMILY)
-DEPS_SUBMODULES += lib/CMSIS_5
-
-# All source paths should be relative to the top level.
-LD_FILE = $(SILABS_CMSIS)/Source/GCC/$(SILABS_FAMILY).ld
-
-SRC_C += \
- $(SILABS_CMSIS)/Source/system_$(SILABS_FAMILY).c \
- src/portable/silabs/efm32/dcd_efm32.c
-
-SRC_S += \
- $(SILABS_CMSIS)/Source/GCC/startup_$(SILABS_FAMILY).S
-
-INC += \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(SILABS_CMSIS)/Include \
- $(TOP)/hw/bsp/$(BOARD)
-
-# For TinyUSB port source
-VENDOR = silabs
-CHIP_FAMILY = efm32
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4
-
-# For flash-jlink target
-JLINK_DEVICE = EFM32GG12B810F1024
-
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/sltb009a/sltb009a.c b/tinyusb/hw/bsp/sltb009a/sltb009a.c
deleted file mode 100755
index b929adb1..00000000
--- a/tinyusb/hw/bsp/sltb009a/sltb009a.c
+++ /dev/null
@@ -1,721 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021 Rafael Silva (@perigoso)
- * Copyright (c) 2021 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "../board.h"
-
-#include "em_device.h"
-
-/*--------------------------------------------------------------------*/
-/* MACRO TYPEDEF CONSTANT ENUM */
-/*--------------------------------------------------------------------*/
-
-#define LED_PORT 0 // A
-#define LED_PIN_R 12 // 12
-#define LED_PIN_B 13 // 13
-#define LED_PIN_G 14 // 14
-#define LED_STATE_ON 0 // active-low
-
-#define BUTTON_PORT 3 // D
-#define BUTTON_PIN 5 // 5
-#define BUTTON_STATE_ACTIVE 0 // active-low
-
-/*--------------------------------------------------------------------*/
-/* Forward USB interrupt events to TinyUSB IRQ Handler */
-/*--------------------------------------------------------------------*/
-
-void USB_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-/*--------------------------------------------------------------------*/
-/* Fault Handlers */
-/*--------------------------------------------------------------------*/
-
-void HardFault_Handler(void)
-{
- asm("bkpt");
-}
-
-void MemManage_Handler(void)
-{
- asm("bkpt");
-}
-
-void BusFault_Handler(void)
-{
- asm("bkpt");
-}
-
-void UsageFault_Handler(void)
-{
- asm("bkpt");
-}
-
-/*--------------------------------------------------------------------*/
-/* Startup */
-/*--------------------------------------------------------------------*/
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
-
-/*--------------------------------------------------------------------*/
-/* Initing Funcs */
-/*--------------------------------------------------------------------*/
-
-void emu_init(uint8_t immediate_switch)
-{
- EMU->PWRCTRL = (immediate_switch ? EMU_PWRCTRL_IMMEDIATEPWRSWITCH : 0) | EMU_PWRCTRL_REGPWRSEL_DVDD | EMU_PWRCTRL_ANASW_AVDD;
-}
-
-void emu_reg_init(float target_voltage)
-{
- if(target_voltage < 2300.f || target_voltage >= 3800.f)
- return;
-
- uint8_t level = ((target_voltage - 2300.f) / 100.f);
-
- EMU->R5VCTRL = EMU_R5VCTRL_INPUTMODE_AUTO;
-
- EMU->R5VOUTLEVEL = level; /* Reg output to 3.3V*/
-}
-
-void emu_dcdc_init(float target_voltage, float max_ln_current, float max_lp_current, float max_reverse_current)
-{
- if(target_voltage < 1800.f || target_voltage >= 3000.f)
- return;
-
- if(max_ln_current <= 0.f || max_ln_current > 200.f)
- return;
-
- if(max_lp_current <= 0.f || max_lp_current > 10000.f)
- return;
-
- if(max_reverse_current < 0.f || max_reverse_current > 160.f)
- return;
-
- // Low Power & Low Noise current limit
- uint8_t lp_bias = 0;
-
- if(max_lp_current < 75.f)
- lp_bias = 0;
- else if(max_lp_current < 500.f)
- lp_bias = 1;
- else if(max_lp_current < 2500.f)
- lp_bias = 2;
- else
- lp_bias = 3;
-
- EMU->DCDCMISCCTRL = (EMU->DCDCMISCCTRL & ~_EMU_DCDCMISCCTRL_LPCMPBIASEM234H_MASK) | ((uint32_t)lp_bias << _EMU_DCDCMISCCTRL_LPCMPBIASEM234H_SHIFT);
- EMU->DCDCMISCCTRL |= EMU_DCDCMISCCTRL_LNFORCECCM; // Force CCM to prevent reverse current
- EMU->DCDCLPCTRL |= EMU_DCDCLPCTRL_LPVREFDUTYEN; // Enable duty cycling of the bias for LP mode
- EMU->DCDCLNFREQCTRL = (EMU->DCDCLNFREQCTRL & ~_EMU_DCDCLNFREQCTRL_RCOBAND_MASK) | 4; // Set RCO Band to 7MHz
-
- uint8_t fet_count = 0;
-
- if(max_ln_current < 20.f)
- fet_count = 4;
- else if(max_ln_current >= 20.f && max_ln_current < 40.f)
- fet_count = 8;
- else
- fet_count = 16;
-
- EMU->DCDCMISCCTRL = (EMU->DCDCMISCCTRL & ~_EMU_DCDCMISCCTRL_NFETCNT_MASK) | ((uint32_t)(fet_count - 1) << _EMU_DCDCMISCCTRL_NFETCNT_SHIFT);
- EMU->DCDCMISCCTRL = (EMU->DCDCMISCCTRL & ~_EMU_DCDCMISCCTRL_PFETCNT_MASK) | ((uint32_t)(fet_count - 1) << _EMU_DCDCMISCCTRL_PFETCNT_SHIFT);
-
- uint8_t ln_current_limit = (((max_ln_current + 40.f) * 1.5f) / (5.f * fet_count)) - 1;
- uint8_t lp_current_limit = 1; // Recommended value
-
- EMU->DCDCMISCCTRL = (EMU->DCDCMISCCTRL & ~(_EMU_DCDCMISCCTRL_LNCLIMILIMSEL_MASK | _EMU_DCDCMISCCTRL_LPCLIMILIMSEL_MASK)) | ((uint32_t)ln_current_limit << _EMU_DCDCMISCCTRL_LNCLIMILIMSEL_SHIFT) | ((uint32_t)lp_current_limit << _EMU_DCDCMISCCTRL_LPCLIMILIMSEL_SHIFT);
-
- uint8_t z_det_limit = ((max_reverse_current + 40.f) * 1.5f) / (2.5f * fet_count);
-
- EMU->DCDCZDETCTRL = (EMU->DCDCZDETCTRL & ~_EMU_DCDCZDETCTRL_ZDETILIMSEL_MASK) | ((uint32_t)z_det_limit << _EMU_DCDCZDETCTRL_ZDETILIMSEL_SHIFT);
-
- EMU->DCDCCLIMCTRL |= EMU_DCDCCLIMCTRL_BYPLIMEN; // Enable bypass current limiter to prevent overcurrent when switching modes
-
- // Output Voltage
- if(target_voltage > 1800.f)
- {
- float max_vout = 3000.f;
- float min_vout = 1800.f;
- float diff_vout = max_vout - min_vout;
-
- uint8_t ln_vref_high = (DEVINFO->DCDCLNVCTRL0 & _DEVINFO_DCDCLNVCTRL0_3V0LNATT1_MASK) >> _DEVINFO_DCDCLNVCTRL0_3V0LNATT1_SHIFT;
- uint8_t ln_vref_low = (DEVINFO->DCDCLNVCTRL0 & _DEVINFO_DCDCLNVCTRL0_1V8LNATT1_MASK) >> _DEVINFO_DCDCLNVCTRL0_1V8LNATT1_SHIFT;
-
- uint8_t ln_vref = ((target_voltage - min_vout) * (float)(ln_vref_high - ln_vref_low)) / diff_vout;
- ln_vref += ln_vref_low;
-
- EMU->DCDCLNVCTRL = (ln_vref << _EMU_DCDCLNVCTRL_LNVREF_SHIFT) | EMU_DCDCLNVCTRL_LNATT;
-
- uint8_t lp_vref_low = 0;
- uint8_t lp_vref_high = 0;
-
- switch(lp_bias)
- {
- case 0:
- {
- lp_vref_high = (DEVINFO->DCDCLPVCTRL2 & _DEVINFO_DCDCLPVCTRL2_3V0LPATT1LPCMPBIAS0_MASK) >> _DEVINFO_DCDCLPVCTRL2_3V0LPATT1LPCMPBIAS0_SHIFT;
- lp_vref_low = (DEVINFO->DCDCLPVCTRL2 & _DEVINFO_DCDCLPVCTRL2_1V8LPATT1LPCMPBIAS0_MASK) >> _DEVINFO_DCDCLPVCTRL2_1V8LPATT1LPCMPBIAS0_SHIFT;
- }
- break;
- case 1:
- {
- lp_vref_high = (DEVINFO->DCDCLPVCTRL2 & _DEVINFO_DCDCLPVCTRL2_3V0LPATT1LPCMPBIAS1_MASK) >> _DEVINFO_DCDCLPVCTRL2_3V0LPATT1LPCMPBIAS1_SHIFT;
- lp_vref_low = (DEVINFO->DCDCLPVCTRL2 & _DEVINFO_DCDCLPVCTRL2_1V8LPATT1LPCMPBIAS1_MASK) >> _DEVINFO_DCDCLPVCTRL2_1V8LPATT1LPCMPBIAS1_SHIFT;
- }
- break;
- case 2:
- {
- lp_vref_high = (DEVINFO->DCDCLPVCTRL3 & _DEVINFO_DCDCLPVCTRL3_3V0LPATT1LPCMPBIAS2_MASK) >> _DEVINFO_DCDCLPVCTRL3_3V0LPATT1LPCMPBIAS2_SHIFT;
- lp_vref_low = (DEVINFO->DCDCLPVCTRL3 & _DEVINFO_DCDCLPVCTRL3_1V8LPATT1LPCMPBIAS2_MASK) >> _DEVINFO_DCDCLPVCTRL3_1V8LPATT1LPCMPBIAS2_SHIFT;
- }
- break;
- case 3:
- {
- lp_vref_high = (DEVINFO->DCDCLPVCTRL3 & _DEVINFO_DCDCLPVCTRL3_3V0LPATT1LPCMPBIAS3_MASK) >> _DEVINFO_DCDCLPVCTRL3_3V0LPATT1LPCMPBIAS3_SHIFT;
- lp_vref_low = (DEVINFO->DCDCLPVCTRL3 & _DEVINFO_DCDCLPVCTRL3_1V8LPATT1LPCMPBIAS3_MASK) >> _DEVINFO_DCDCLPVCTRL3_1V8LPATT1LPCMPBIAS3_SHIFT;
- }
- break;
- }
-
- uint8_t lp_vref = ((target_voltage - min_vout) * (float)(lp_vref_high - lp_vref_low)) / diff_vout;
- lp_vref += lp_vref_low;
-
- EMU->DCDCLPVCTRL = (lp_vref << _EMU_DCDCLPVCTRL_LPVREF_SHIFT) | EMU_DCDCLPVCTRL_LPATT;
- }
- else
- {
- float max_vout = 1800.f;
- float min_vout = 1200.f;
- float diff_vout = max_vout - min_vout;
-
- uint8_t ln_vref_high = (DEVINFO->DCDCLNVCTRL0 & _DEVINFO_DCDCLNVCTRL0_1V8LNATT0_MASK) >> _DEVINFO_DCDCLNVCTRL0_1V8LNATT0_SHIFT;
- uint8_t ln_vref_low = (DEVINFO->DCDCLNVCTRL0 & _DEVINFO_DCDCLNVCTRL0_1V2LNATT0_MASK) >> _DEVINFO_DCDCLNVCTRL0_1V2LNATT0_SHIFT;
-
- uint8_t ln_vref = ((target_voltage - min_vout) * (float)(ln_vref_high - ln_vref_low)) / diff_vout;
- ln_vref += ln_vref_low;
-
- EMU->DCDCLNVCTRL = ln_vref << _EMU_DCDCLNVCTRL_LNVREF_SHIFT;
-
- uint8_t lp_vref_low = 0;
- uint8_t lp_vref_high = 0;
-
- switch(lp_bias)
- {
- case 0:
- {
- lp_vref_high = (DEVINFO->DCDCLPVCTRL0 & _DEVINFO_DCDCLPVCTRL2_3V0LPATT1LPCMPBIAS0_MASK) >> _DEVINFO_DCDCLPVCTRL2_3V0LPATT1LPCMPBIAS0_SHIFT;
- lp_vref_low = (DEVINFO->DCDCLPVCTRL0 & _DEVINFO_DCDCLPVCTRL2_1V8LPATT1LPCMPBIAS0_MASK) >> _DEVINFO_DCDCLPVCTRL2_1V8LPATT1LPCMPBIAS0_SHIFT;
- }
- break;
- case 1:
- {
- lp_vref_high = (DEVINFO->DCDCLPVCTRL0 & _DEVINFO_DCDCLPVCTRL2_3V0LPATT1LPCMPBIAS1_MASK) >> _DEVINFO_DCDCLPVCTRL2_3V0LPATT1LPCMPBIAS1_SHIFT;
- lp_vref_low = (DEVINFO->DCDCLPVCTRL0 & _DEVINFO_DCDCLPVCTRL2_1V8LPATT1LPCMPBIAS1_MASK) >> _DEVINFO_DCDCLPVCTRL2_1V8LPATT1LPCMPBIAS1_SHIFT;
- }
- break;
- case 2:
- {
- lp_vref_high = (DEVINFO->DCDCLPVCTRL1 & _DEVINFO_DCDCLPVCTRL3_3V0LPATT1LPCMPBIAS2_MASK) >> _DEVINFO_DCDCLPVCTRL3_3V0LPATT1LPCMPBIAS2_SHIFT;
- lp_vref_low = (DEVINFO->DCDCLPVCTRL1 & _DEVINFO_DCDCLPVCTRL3_1V8LPATT1LPCMPBIAS2_MASK) >> _DEVINFO_DCDCLPVCTRL3_1V8LPATT1LPCMPBIAS2_SHIFT;
- }
- break;
- case 3:
- {
- lp_vref_high = (DEVINFO->DCDCLPVCTRL1 & _DEVINFO_DCDCLPVCTRL3_3V0LPATT1LPCMPBIAS3_MASK) >> _DEVINFO_DCDCLPVCTRL3_3V0LPATT1LPCMPBIAS3_SHIFT;
- lp_vref_low = (DEVINFO->DCDCLPVCTRL1 & _DEVINFO_DCDCLPVCTRL3_1V8LPATT1LPCMPBIAS3_MASK) >> _DEVINFO_DCDCLPVCTRL3_1V8LPATT1LPCMPBIAS3_SHIFT;
- }
- break;
- }
-
- uint8_t lp_vref = ((target_voltage - min_vout) * (float)(lp_vref_high - lp_vref_low)) / diff_vout;
- lp_vref += lp_vref_low;
-
- EMU->DCDCLPVCTRL = lp_vref << _EMU_DCDCLPVCTRL_LPVREF_SHIFT;
- }
-
- EMU->DCDCLPCTRL = (EMU->DCDCLPCTRL & ~_EMU_DCDCLPCTRL_LPCMPHYSSELEM234H_MASK) | (((DEVINFO->DCDCLPCMPHYSSEL1 & (((uint32_t)0xFF) << (lp_bias * 8))) >> (lp_bias * 8)) << _EMU_DCDCLPCTRL_LPCMPHYSSELEM234H_SHIFT);
-
- while(EMU->DCDCSYNC & EMU_DCDCSYNC_DCDCCTRLBUSY); // Wait for configuration to write
-
- // Calibration
- //EMU->DCDCLNCOMPCTRL = 0x57204077; // Compensation for 1uF DCDC capacitor
- EMU->DCDCLNCOMPCTRL = 0xB7102137; // Compensation for 4.7uF DCDC capacitor
-
- // Enable DCDC converter
- EMU->DCDCCTRL = EMU_DCDCCTRL_DCDCMODEEM4_EM4LOWPOWER | EMU_DCDCCTRL_DCDCMODEEM23_EM23LOWPOWER | EMU_DCDCCTRL_DCDCMODE_LOWNOISE;
-
- // Switch digital domain to DVDD
- EMU->PWRCTRL = EMU_PWRCTRL_REGPWRSEL_DVDD | EMU_PWRCTRL_ANASW_AVDD;
-}
-
-void cmu_hfxo_startup_calib(uint16_t ib_trim, uint16_t c_tune)
-{
- if(CMU->STATUS & CMU_STATUS_HFXOENS)
- return;
-
- CMU->HFXOSTARTUPCTRL = (CMU->HFXOSTARTUPCTRL & ~(_CMU_HFXOSTARTUPCTRL_CTUNE_MASK | _CMU_HFXOSTARTUPCTRL_IBTRIMXOCORE_MASK)) | (((uint32_t)c_tune << _CMU_HFXOSTARTUPCTRL_CTUNE_SHIFT) & _CMU_HFXOSTARTUPCTRL_CTUNE_MASK) | (((uint32_t)ib_trim << _CMU_HFXOSTARTUPCTRL_IBTRIMXOCORE_SHIFT) & _CMU_HFXOSTARTUPCTRL_IBTRIMXOCORE_MASK);
-}
-
-void cmu_hfxo_steady_calib(uint16_t ib_trim, uint16_t c_tune)
-{
- if(CMU->STATUS & CMU_STATUS_HFXOENS)
- return;
-
- CMU->HFXOSTEADYSTATECTRL = (CMU->HFXOSTEADYSTATECTRL & ~(_CMU_HFXOSTEADYSTATECTRL_CTUNE_MASK | _CMU_HFXOSTEADYSTATECTRL_IBTRIMXOCORE_MASK)) | (((uint32_t)c_tune << _CMU_HFXOSTEADYSTATECTRL_CTUNE_SHIFT) & _CMU_HFXOSTEADYSTATECTRL_CTUNE_MASK) | (((uint32_t)ib_trim << _CMU_HFXOSTEADYSTATECTRL_IBTRIMXOCORE_SHIFT) & _CMU_HFXOSTEADYSTATECTRL_IBTRIMXOCORE_MASK);
-}
-
-void cmu_hfrco_calib(uint32_t calibration)
-{
- if(CMU->STATUS & CMU_STATUS_DPLLENS)
- return;
-
- while(CMU->SYNCBUSY & CMU_SYNCBUSY_HFRCOBSY);
-
- CMU->HFRCOCTRL = calibration;
-
- while(CMU->SYNCBUSY & CMU_SYNCBUSY_HFRCOBSY);
-}
-
-void cmu_ushfrco_calib(uint8_t enable, uint32_t calibration)
-{
- if(CMU->USBCRCTRL & CMU_USBCRCTRL_USBCREN)
- return;
-
- if(!enable)
- {
- CMU->OSCENCMD = CMU_OSCENCMD_USHFRCODIS;
- while(CMU->STATUS & CMU_STATUS_USHFRCOENS);
-
- return;
- }
-
- while(CMU->SYNCBUSY & CMU_SYNCBUSY_USHFRCOBSY);
-
- CMU->USHFRCOCTRL = calibration | CMU_USHFRCOCTRL_FINETUNINGEN;
-
- while(CMU->SYNCBUSY & CMU_SYNCBUSY_USHFRCOBSY);
-
- if(enable && !(CMU->STATUS & CMU_STATUS_USHFRCOENS))
- {
- CMU->OSCENCMD = CMU_OSCENCMD_USHFRCOEN;
-
- while(!(CMU->STATUS & CMU_STATUS_USHFRCORDY));
- }
-}
-
-void cmu_auxhfrco_calib(uint8_t enable, uint32_t calibration)
-{
- if(!enable)
- {
- CMU->OSCENCMD = CMU_OSCENCMD_AUXHFRCODIS;
- while(CMU->STATUS & CMU_STATUS_AUXHFRCOENS);
-
- return;
- }
-
- while(CMU->SYNCBUSY & CMU_SYNCBUSY_AUXHFRCOBSY);
-
- CMU->AUXHFRCOCTRL = calibration;
-
- while(CMU->SYNCBUSY & CMU_SYNCBUSY_AUXHFRCOBSY);
-
- if(enable && !(CMU->STATUS & CMU_STATUS_AUXHFRCOENS))
- {
- CMU->OSCENCMD = CMU_OSCENCMD_AUXHFRCOEN;
-
- while(!(CMU->STATUS & CMU_STATUS_AUXHFRCORDY));
- }
-}
-
-
-void cmu_init(void)
-{
- // Change SDIO clock to HFXO if HFRCO selected and disable it
- CMU->SDIOCTRL = CMU_SDIOCTRL_SDIOCLKDIS | CMU_SDIOCTRL_SDIOCLKSEL_HFXO;
- while(CMU->STATUS & CMU_STATUS_SDIOCLKENS);
-
- // Change QSPI clock to HFXO if HFRCO selected and disable it
- CMU->QSPICTRL = CMU_QSPICTRL_QSPI0CLKDIS | CMU_QSPICTRL_QSPI0CLKSEL_HFXO;
- while(CMU->STATUS & CMU_STATUS_QSPI0CLKENS);
-
- // Disable DPLL if enabled
- if(CMU->STATUS & CMU_STATUS_DPLLENS)
- {
- CMU->OSCENCMD = CMU_OSCENCMD_DPLLDIS;
- while(CMU->STATUS & CMU_STATUS_DPLLENS);
- }
-
- // Disable HFXO if enabled
- if(CMU->STATUS & CMU_STATUS_HFXOENS)
- {
- CMU->OSCENCMD = CMU_OSCENCMD_HFXODIS;
- while(CMU->STATUS & CMU_STATUS_HFXOENS);
- }
-
- // Setup HFXO
- CMU->HFXOCTRL = CMU_HFXOCTRL_PEAKDETMODE_AUTOCMD | CMU_HFXOCTRL_MODE_XTAL;
- CMU->HFXOCTRL1 = CMU_HFXOCTRL1_PEAKDETTHR_DEFAULT;
- CMU->HFXOSTEADYSTATECTRL |= CMU_HFXOSTEADYSTATECTRL_PEAKMONEN;
- CMU->HFXOTIMEOUTCTRL = (7 << _CMU_HFXOTIMEOUTCTRL_PEAKDETTIMEOUT_SHIFT) | (8 << _CMU_HFXOTIMEOUTCTRL_STEADYTIMEOUT_SHIFT) | (12 << _CMU_HFXOTIMEOUTCTRL_STARTUPTIMEOUT_SHIFT);
-
- // Enable HFXO and wait for it to be ready
- CMU->OSCENCMD = CMU_OSCENCMD_HFXOEN;
- while(!(CMU->STATUS & CMU_STATUS_HFXORDY));
-
- // Switch main clock to HFXO and wait for it to be selected
- CMU->HFCLKSEL = CMU_HFCLKSEL_HF_HFXO;
- while((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK) != CMU_HFCLKSTATUS_SELECTED_HFXO);
-
- // Calibrate HFRCO for 72MHz and enable tunning by PLL
- cmu_hfrco_calib((DEVINFO->HFRCOCAL16) | CMU_HFRCOCTRL_FINETUNINGEN);
-
- // Setup the PLL
- CMU->DPLLCTRL = CMU_DPLLCTRL_REFSEL_HFXO | CMU_DPLLCTRL_AUTORECOVER | CMU_DPLLCTRL_EDGESEL_RISE | CMU_DPLLCTRL_MODE_FREQLL;
- // 72MHz = 50MHz (HFXO) * 1.44 (144/100)
- CMU->DPLLCTRL1 = (143 << _CMU_DPLLCTRL1_N_SHIFT) | (99 << _CMU_DPLLCTRL1_M_SHIFT); // fHFRCO = fHFXO * (N + 1) / (M + 1)
-
- // Enable the DPLL and wait for it to be ready
- CMU->OSCENCMD = CMU_OSCENCMD_DPLLEN;
- while(!(CMU->STATUS & CMU_STATUS_DPLLRDY));
-
- // Config peripherals for the new frequency (freq > 32MHz)
- CMU->CTRL |= CMU_CTRL_WSHFLE;
-
- // Set prescalers
- CMU->HFPRESC = CMU_HFPRESC_HFCLKLEPRESC_DIV2 | CMU_HFPRESC_PRESC_NODIVISION;
- CMU->HFBUSPRESC = 1 << _CMU_HFBUSPRESC_PRESC_SHIFT;
- CMU->HFCOREPRESC = 0 << _CMU_HFCOREPRESC_PRESC_SHIFT;
- CMU->HFPERPRESC = 1 << _CMU_HFPERPRESC_PRESC_SHIFT;
- CMU->HFEXPPRESC = 0 << _CMU_HFEXPPRESC_PRESC_SHIFT;
- CMU->HFPERPRESCB = 0 << _CMU_HFPERPRESCB_PRESC_SHIFT;
- CMU->HFPERPRESCC = 1 << _CMU_HFPERPRESCC_PRESC_SHIFT;
-
- // Enable clock to peripherals
- CMU->CTRL |= CMU_CTRL_HFPERCLKEN;
-
- // Switch main clock to HFRCO and wait for it to be selected
- CMU->HFCLKSEL = CMU_HFCLKSEL_HF_HFRCO;
- while((CMU->HFCLKSTATUS & _CMU_HFCLKSTATUS_SELECTED_MASK) != CMU_HFCLKSTATUS_SELECTED_HFRCO);
-
- // LFA Clock
- CMU->LFACLKSEL = CMU_LFACLKSEL_LFA_LFRCO;
-
- // LFB Clock
- CMU->LFBCLKSEL = CMU_LFBCLKSEL_LFB_LFRCO;
-
- // LFC Clock
- CMU->LFCCLKSEL = CMU_LFCCLKSEL_LFC_LFRCO;
-
- // LFE Clock
- CMU->LFECLKSEL = CMU_LFECLKSEL_LFE_ULFRCO;
-}
-
-void systick_init(void)
-{
- SysTick->LOAD = (72000000 / 1000) - 1;
- SysTick->VAL = 0;
- SysTick->CTRL = SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_CLKSOURCE_Msk;
-
- SCB->SHP[11] = 7 << (8 - __NVIC_PRIO_BITS); // Set priority 3,1 (min)
-}
-
-void gpio_init(void)
-{
- CMU->HFBUSCLKEN0 |= CMU_HFBUSCLKEN0_GPIO;
-
- // NC - Not Connected (not available in mcu package)
- // NR - Not routed (no routing to pin on pcb, floating)
- // NU - Not used (not currently in use)
-
- // Port A
- GPIO->P[0].CTRL = GPIO_P_CTRL_DRIVESTRENGTHALT_STRONG | (6 << _GPIO_P_CTRL_SLEWRATEALT_SHIFT)
- | GPIO_P_CTRL_DRIVESTRENGTH_STRONG | (6 << _GPIO_P_CTRL_SLEWRATE_SHIFT);
- GPIO->P[0].MODEL = GPIO_P_MODEL_MODE0_DISABLED // NU
- | GPIO_P_MODEL_MODE1_DISABLED // NU
- | GPIO_P_MODEL_MODE2_DISABLED // NU
- | GPIO_P_MODEL_MODE3_DISABLED // NU
- | GPIO_P_MODEL_MODE4_DISABLED // NU
- | GPIO_P_MODEL_MODE5_DISABLED // NU
- | GPIO_P_MODEL_MODE6_DISABLED // NU
- | GPIO_P_MODEL_MODE7_DISABLED; // NC
- GPIO->P[0].MODEH = GPIO_P_MODEH_MODE8_DISABLED // GPIO - MIC_ENABLE
- | GPIO_P_MODEH_MODE9_DISABLED // NC
- | GPIO_P_MODEH_MODE10_DISABLED // NC
- | GPIO_P_MODEH_MODE11_DISABLED // NC
- | GPIO_P_MODEH_MODE12_WIREDAND // LED0R
- | GPIO_P_MODEH_MODE13_WIREDAND // LED0B
- | GPIO_P_MODEH_MODE14_WIREDAND // LED0G
- | GPIO_P_MODEH_MODE15_DISABLED; // NU
- GPIO->P[0].DOUT = 0x7000; // Leds off By default
- GPIO->P[0].OVTDIS = 0;
-
- // Port B
- GPIO->P[1].CTRL = GPIO_P_CTRL_DRIVESTRENGTHALT_STRONG | (6 << _GPIO_P_CTRL_SLEWRATEALT_SHIFT)
- | GPIO_P_CTRL_DRIVESTRENGTH_STRONG | (6 << _GPIO_P_CTRL_SLEWRATE_SHIFT);
- GPIO->P[1].MODEL = GPIO_P_MODEL_MODE0_DISABLED // NC
- | GPIO_P_MODEL_MODE1_DISABLED // NC
- | GPIO_P_MODEL_MODE2_DISABLED // NC
- | GPIO_P_MODEL_MODE3_DISABLED // NU
- | GPIO_P_MODEL_MODE4_DISABLED // NU
- | GPIO_P_MODEL_MODE5_DISABLED // NU
- | GPIO_P_MODEL_MODE6_DISABLED // NU
- | GPIO_P_MODEL_MODE7_DISABLED; // MAIN_LFXTAL_P
- GPIO->P[1].MODEH = GPIO_P_MODEH_MODE8_DISABLED // MAIN_LFXTAL_N
- | GPIO_P_MODEH_MODE9_DISABLED // NC
- | GPIO_P_MODEH_MODE10_DISABLED // NC
- | GPIO_P_MODEH_MODE11_DISABLED // PDM_DAT0 - MIC_DATA
- | GPIO_P_MODEH_MODE12_DISABLED // PDM_CLK - MIC_CLOCK
- | GPIO_P_MODEH_MODE13_DISABLED // MAIN_HFXTAL_P
- | GPIO_P_MODEH_MODE14_DISABLED // MAIN_HFXTAL_N
- | GPIO_P_MODEH_MODE15_DISABLED; // NC
- GPIO->P[1].DOUT = 0;
- GPIO->P[1].OVTDIS = 0;
-
- // Port C
- GPIO->P[2].CTRL = GPIO_P_CTRL_DRIVESTRENGTHALT_STRONG | (6 << _GPIO_P_CTRL_SLEWRATEALT_SHIFT)
- | GPIO_P_CTRL_DRIVESTRENGTH_STRONG | (7 << _GPIO_P_CTRL_SLEWRATE_SHIFT);
- GPIO->P[2].MODEL = GPIO_P_MODEL_MODE0_DISABLED // NC
- | GPIO_P_MODEL_MODE1_DISABLED // NC
- | GPIO_P_MODEL_MODE2_DISABLED // NC
- | GPIO_P_MODEL_MODE3_DISABLED // NC
- | GPIO_P_MODEL_MODE4_DISABLED // NU
- | GPIO_P_MODEL_MODE5_DISABLED // NU
- | GPIO_P_MODEL_MODE6_DISABLED // NC
- | GPIO_P_MODEL_MODE7_DISABLED; // NC
- GPIO->P[2].MODEH = GPIO_P_MODEH_MODE8_DISABLED // NC
- | GPIO_P_MODEH_MODE9_DISABLED // NC
- | GPIO_P_MODEH_MODE10_DISABLED // NC
- | GPIO_P_MODEH_MODE11_DISABLED // NC
- | GPIO_P_MODEH_MODE12_DISABLED // NC
- | GPIO_P_MODEH_MODE13_DISABLED // NC
- | GPIO_P_MODEH_MODE14_DISABLED // NC
- | GPIO_P_MODEH_MODE15_DISABLED; // NC
- GPIO->P[2].DOUT = 0;
- GPIO->P[2].OVTDIS = 0;
-
- // Port D
- GPIO->P[3].CTRL = GPIO_P_CTRL_DRIVESTRENGTHALT_STRONG | (6 << _GPIO_P_CTRL_SLEWRATEALT_SHIFT)
- | GPIO_P_CTRL_DRIVESTRENGTH_STRONG | (6 << _GPIO_P_CTRL_SLEWRATE_SHIFT);
- GPIO->P[3].MODEL = GPIO_P_MODEL_MODE0_DISABLED // NU
- | GPIO_P_MODEL_MODE1_DISABLED // NU
- | GPIO_P_MODEL_MODE2_DISABLED // NU
- | GPIO_P_MODEL_MODE3_DISABLED // NU
- | GPIO_P_MODEL_MODE4_DISABLED // NU
- | GPIO_P_MODEL_MODE5_INPUT // GPIO - BTN0
- | GPIO_P_MODEL_MODE6_WIREDAND // LED1R
- | GPIO_P_MODEL_MODE7_DISABLED; // NU
- GPIO->P[3].MODEH = GPIO_P_MODEH_MODE8_INPUT // GPIO - BTN1
- | GPIO_P_MODEH_MODE9_DISABLED // NC
- | GPIO_P_MODEH_MODE10_DISABLED // NC
- | GPIO_P_MODEH_MODE11_DISABLED // NC
- | GPIO_P_MODEH_MODE12_DISABLED // NC
- | GPIO_P_MODEH_MODE13_DISABLED // NC
- | GPIO_P_MODEH_MODE14_DISABLED // NC
- | GPIO_P_MODEH_MODE15_DISABLED; // NC
- GPIO->P[3].DOUT = 0;
- GPIO->P[3].OVTDIS = 0;
-
- // Port E
- GPIO->P[4].CTRL = GPIO_P_CTRL_DRIVESTRENGTHALT_STRONG | (6 << _GPIO_P_CTRL_SLEWRATEALT_SHIFT)
- | GPIO_P_CTRL_DRIVESTRENGTH_STRONG | (6 << _GPIO_P_CTRL_SLEWRATE_SHIFT);
- GPIO->P[4].MODEL = GPIO_P_MODEL_MODE0_DISABLED // NC
- | GPIO_P_MODEL_MODE1_DISABLED // NC
- | GPIO_P_MODEL_MODE2_DISABLED // NC
- | GPIO_P_MODEL_MODE3_DISABLED // NC
- | GPIO_P_MODEL_MODE4_DISABLED // NU
- | GPIO_P_MODEL_MODE5_DISABLED // NU
- | GPIO_P_MODEL_MODE6_DISABLED // NU
- | GPIO_P_MODEL_MODE7_DISABLED; // NU
- GPIO->P[4].MODEH = GPIO_P_MODEH_MODE8_DISABLED // NU
- | GPIO_P_MODEH_MODE9_DISABLED // NU
- | GPIO_P_MODEH_MODE10_DISABLED // NU
- | GPIO_P_MODEH_MODE11_DISABLED // NU
- | GPIO_P_MODEH_MODE12_WIREDAND // LED1B
- | GPIO_P_MODEH_MODE13_DISABLED // NU
- | GPIO_P_MODEH_MODE14_DISABLED // NU
- | GPIO_P_MODEH_MODE15_DISABLED; // NU
- GPIO->P[4].DOUT = 0;
- GPIO->P[4].OVTDIS = 0;
-
- // Port F
- GPIO->P[5].CTRL = GPIO_P_CTRL_DRIVESTRENGTHALT_STRONG | (6 << _GPIO_P_CTRL_SLEWRATEALT_SHIFT)
- | GPIO_P_CTRL_DRIVESTRENGTH_STRONG | (6 << _GPIO_P_CTRL_SLEWRATE_SHIFT);
- GPIO->P[5].MODEL = GPIO_P_MODEL_MODE0_PUSHPULL // SWCLK
- | GPIO_P_MODEL_MODE1_PUSHPULL // SWDIO
- | GPIO_P_MODEL_MODE2_PUSHPULL // SWO
- | GPIO_P_MODEL_MODE3_DISABLED // NC
- | GPIO_P_MODEL_MODE4_DISABLED // NC
- | GPIO_P_MODEL_MODE5_DISABLED // NU
- | GPIO_P_MODEL_MODE6_DISABLED // NC
- | GPIO_P_MODEL_MODE7_DISABLED; // NC
- GPIO->P[5].MODEH = GPIO_P_MODEH_MODE8_DISABLED // NC
- | GPIO_P_MODEH_MODE9_DISABLED // NC
- | GPIO_P_MODEH_MODE10_DISABLED // USB N
- | GPIO_P_MODEH_MODE11_DISABLED // USB P
- | GPIO_P_MODEH_MODE12_WIREDAND // LED1G
- | GPIO_P_MODEH_MODE13_DISABLED // NC
- | GPIO_P_MODEH_MODE14_DISABLED // NC
- | GPIO_P_MODEH_MODE15_DISABLED; // NC
- GPIO->P[5].DOUT = 0;
-
- GPIO->P[5].OVTDIS = 0;
-
- // Debugger Route
- GPIO->ROUTEPEN &= ~(GPIO_ROUTEPEN_TDIPEN | GPIO_ROUTEPEN_TDOPEN); // Disable JTAG
- GPIO->ROUTEPEN |= GPIO_ROUTEPEN_SWVPEN; // Enable SWO
- GPIO->ROUTELOC0 = GPIO_ROUTELOC0_SWVLOC_LOC0; // SWO on PF2
-
- // External interrupts
- GPIO->EXTIPSELL = GPIO_EXTIPSELL_EXTIPSEL0_PORTE // NU
- | GPIO_EXTIPSELL_EXTIPSEL1_PORTB // NU
- | GPIO_EXTIPSELL_EXTIPSEL2_PORTB // NU
- | GPIO_EXTIPSELL_EXTIPSEL3_PORTB // NU
- | GPIO_EXTIPSELL_EXTIPSEL4_PORTA // NU
- | GPIO_EXTIPSELL_EXTIPSEL5_PORTA // NU
- | GPIO_EXTIPSELL_EXTIPSEL6_PORTC // NU
- | GPIO_EXTIPSELL_EXTIPSEL7_PORTC; // NU
- GPIO->EXTIPSELH = GPIO_EXTIPSELH_EXTIPSEL8_PORTA // NU
- | GPIO_EXTIPSELH_EXTIPSEL9_PORTE // NU
- | GPIO_EXTIPSELH_EXTIPSEL10_PORTF // NU
- | GPIO_EXTIPSELH_EXTIPSEL11_PORTA // NU
- | GPIO_EXTIPSELH_EXTIPSEL12_PORTA // NU
- | GPIO_EXTIPSELH_EXTIPSEL13_PORTE // NU
- | GPIO_EXTIPSELH_EXTIPSEL14_PORTF // NU
- | GPIO_EXTIPSELH_EXTIPSEL15_PORTA; // NU
-
- GPIO->EXTIPINSELL = GPIO_EXTIPINSELL_EXTIPINSEL0_PIN3 // NU
- | GPIO_EXTIPINSELL_EXTIPINSEL1_PIN1 // NU
- | GPIO_EXTIPINSELL_EXTIPINSEL2_PIN2 // NU
- | GPIO_EXTIPINSELL_EXTIPINSEL3_PIN3 // NU
- | GPIO_EXTIPINSELL_EXTIPINSEL4_PIN6 // NU
- | GPIO_EXTIPINSELL_EXTIPINSEL5_PIN7 // NU
- | GPIO_EXTIPINSELL_EXTIPINSEL6_PIN4 // NU
- | GPIO_EXTIPINSELL_EXTIPINSEL7_PIN7; // NU
- GPIO->EXTIPINSELH = GPIO_EXTIPINSELH_EXTIPINSEL8_PIN8 // NU
- | GPIO_EXTIPINSELH_EXTIPINSEL9_PIN9 // NU
- | GPIO_EXTIPINSELH_EXTIPINSEL10_PIN11 // NU
- | GPIO_EXTIPINSELH_EXTIPINSEL11_PIN8 // NU
- | GPIO_EXTIPINSELH_EXTIPINSEL12_PIN13 // NU
- | GPIO_EXTIPINSELH_EXTIPINSEL13_PIN15 // NU
- | GPIO_EXTIPINSELH_EXTIPINSEL14_PIN12 // NU
- | GPIO_EXTIPINSELH_EXTIPINSEL15_PIN12; // NU
-
-}
-
-/*--------------------------------------------------------------------*/
-/* Board Init */
-/*--------------------------------------------------------------------*/
-
-void board_init(void)
-{
-
- emu_dcdc_init(1800.f, 50.f, 100.f, 0.f); // Init DC-DC converter (1.8 V, 50 mA active, 100 uA sleep, 0 mA reverse limit)
- emu_init(0);
- emu_reg_init(3300.f); // set output regulator to 3.3V
-
- cmu_hfxo_startup_calib(0x200, 0x145); // Config HFXO Startup for 1280 uA, 36 pF (18 pF + 2 pF CLOAD)
- cmu_hfxo_steady_calib(0x009, 0x145); // Config HFXO Steady for 12 uA, 36 pF (18 pF + 2 pF CLOAD)
-
- cmu_init(); // Init Clock Management Unit
-
- cmu_ushfrco_calib(1, DEVINFO->USHFRCOCAL13); // Enable and calibrate USHFRCO for 48 MHz
- cmu_auxhfrco_calib(1, DEVINFO->AUXHFRCOCAL11); // Enable and calibrate AUXHFRCO for 32 MHz
-
- CMU->USBCRCTRL = CMU_USBCRCTRL_USBCREN; // enable USB clock recovery
- CMU->USBCTRL = CMU_USBCTRL_USBCLKSEL_USHFRCO | CMU_USBCTRL_USBCLKEN; // select USHFRCO as USB Phy clock source and enable it
-
- CMU->HFBUSCLKEN0 |= CMU_HFBUSCLKEN0_USB; // enable USB peripheral clock
-
- systick_init(); // Init system tick
-
- gpio_init(); // Init IOs
-
-}
-
-/*--------------------------------------------------------------------*/
-/* Board porting API */
-/*--------------------------------------------------------------------*/
-
-void board_led_write(bool state)
-{
- // Combine red and blue for pink Because it looks good :)
- GPIO->P[LED_PORT].DOUT = (GPIO->P[LED_PORT].DOUT & ~((1 << LED_PIN_R) | (1 << LED_PIN_B))) | (state << LED_PIN_R) | (state << LED_PIN_B);
-}
-
-uint32_t board_button_read(void)
-{
- return !!(GPIO->P[BUTTON_PORT].DIN & (1 << BUTTON_PIN));
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler(void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-#ifdef USE_FULL_ASSERT
-/**
- * @brief Reports the name of the source file and the source line number
- * where the assert_param error has occurred.
- * @param file: pointer to the source file name
- * @param line: assert_param error line source number
- * @retval None
- */
-void assert_failed(char *file, uint32_t line)
-{
- /* USER CODE BEGIN 6 */
- /* User can add his own implementation to report the file name and line number,
- tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
- /* USER CODE END 6 */
-}
-#endif /* USE_FULL_ASSERT */
diff --git a/tinyusb/hw/bsp/spresense/board.mk b/tinyusb/hw/bsp/spresense/board.mk
deleted file mode 100755
index a46c42bd..00000000
--- a/tinyusb/hw/bsp/spresense/board.mk
+++ /dev/null
@@ -1,73 +0,0 @@
-DEPS_SUBMODULES += hw/mcu/sony/cxd56/spresense-exported-sdk
-
-# Platforms are: Linux, Darwin, MSYS, CYGWIN
-PLATFORM := $(firstword $(subst _, ,$(shell uname -s 2>/dev/null)))
-
-ifeq ($(PLATFORM),Darwin)
- # macOS
- MKSPK = $(TOP)/hw/mcu/sony/cxd56/mkspk/mkspk
-else ifeq ($(PLATFORM),Linux)
- # Linux
- MKSPK = $(TOP)/hw/mcu/sony/cxd56/mkspk/mkspk
-else
- # Cygwin/MSYS2
- MKSPK = $(TOP)/hw/mcu/sony/cxd56/mkspk/mkspk.exe
-endif
-
-SERIAL ?= /dev/ttyUSB0
-
-CFLAGS += \
- -DCONFIG_HAVE_DOUBLE \
- -Dmain=spresense_main \
- -pipe \
- -std=gnu11 \
- -mcpu=cortex-m4 \
- -mthumb \
- -mfpu=fpv4-sp-d16 \
- -mfloat-abi=hard \
- -mabi=aapcs \
- -fno-builtin \
- -fno-strength-reduce \
- -fomit-frame-pointer \
- -Wno-error=undef \
- -Wno-error=cast-align \
- -Wno-error=unused-parameter \
- -DCFG_TUSB_MCU=OPT_MCU_CXD56 \
-
-# lwip/src/core/raw.c:334:43: error: declaration of 'recv' shadows a global declaration
-CFLAGS += -Wno-error=shadow
-
-SPRESENSE_SDK = $(TOP)/hw/mcu/sony/cxd56/spresense-exported-sdk
-
-SRC_C += src/portable/sony/cxd56/dcd_cxd56.c
-
-INC += \
- $(SPRESENSE_SDK)/nuttx/include \
- $(SPRESENSE_SDK)/nuttx/arch \
- $(SPRESENSE_SDK)/nuttx/arch/chip \
- $(SPRESENSE_SDK)/nuttx/arch/os \
- $(SPRESENSE_SDK)/sdk/include \
-
-LIBS += \
- $(SPRESENSE_SDK)/nuttx/libs/libapps.a \
- $(SPRESENSE_SDK)/nuttx/libs/libnuttx.a \
-
-LD_FILE = hw/mcu/sony/cxd56/spresense-exported-sdk/nuttx/scripts/ramconfig.ld
-
-LDFLAGS += \
- -Xlinker --entry=__start \
- -nostartfiles \
- -nodefaultlibs \
- -Wl,--gc-sections \
- -u spresense_main
-
-$(MKSPK): $(BUILD)/$(PROJECT).elf
- $(MAKE) -C $(TOP)/hw/mcu/sony/cxd56/mkspk
-
-$(BUILD)/$(PROJECT).spk: $(MKSPK)
- @echo CREATE $@
- @$(MKSPK) -c 2 $(BUILD)/$(PROJECT).elf nuttx $@
-
-# flash
-flash: $(BUILD)/$(PROJECT).spk
- @$(TOP)/hw/mcu/sony/cxd56/tools/flash_writer.py -s -c $(SERIAL) -d -b 115200 -n $<
diff --git a/tinyusb/hw/bsp/spresense/board_spresense.c b/tinyusb/hw/bsp/spresense/board_spresense.c
deleted file mode 100755
index 256bccd1..00000000
--- a/tinyusb/hw/bsp/spresense/board_spresense.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright 2019 Sony Semiconductor Solutions Corporation
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include <sys/boardctl.h>
-#include <nuttx/arch.h>
-#include <arch/board/board.h>
-#include <arch/chip/pin.h>
-
-#include "bsp/board.h"
-
-/*------------------------------------------------------------------*/
-/* MACRO TYPEDEF CONSTANT ENUM
- *------------------------------------------------------------------*/
-#define LED_PIN PIN_I2S1_BCK
-
-#define BUTTON_PIN PIN_HIF_IRQ_OUT
-
-// Initialize on-board peripherals : led, button, uart and USB
-void board_init(void)
-{
- boardctl(BOARDIOC_INIT, 0);
-
- board_gpio_write(PIN_I2S1_BCK, -1);
- board_gpio_config(PIN_I2S1_BCK, 0, false, true, PIN_FLOAT);
-
- board_gpio_write(PIN_HIF_IRQ_OUT, -1);
- board_gpio_config(PIN_HIF_IRQ_OUT, 0, true, true, PIN_FLOAT);
-};
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-// Turn LED on or off
-void board_led_write(bool state)
-{
- board_gpio_write(LED_PIN, state);
-}
-
-// Get the current state of button
-// a '1' means active (pressed), a '0' means inactive.
-uint32_t board_button_read(void)
-{
- if (board_gpio_read(BUTTON_PIN))
- {
- return 0;
- }
-
- return 1;
-}
-
-// Get characters from UART
-int board_uart_read(uint8_t *buf, int len)
-{
- int r = read(0, buf, len);
-
- return r;
-}
-
-// Send characters to UART
-int board_uart_write(void const *buf, int len)
-{
- int r = write(1, buf, len);
-
- return r;
-}
-
-// Get current milliseconds
-uint32_t board_millis(void)
-{
- struct timespec tp;
-
- /* Wait until RTC is available */
- while (g_rtc_enabled == false);
-
- if (clock_gettime(CLOCK_MONOTONIC, &tp))
- {
- return 0;
- }
-
- return (((uint64_t)tp.tv_sec) * 1000 + tp.tv_nsec / 1000000);
-}
diff --git a/tinyusb/hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.h b/tinyusb/hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.h
deleted file mode 100755
index 7c527e2c..00000000
--- a/tinyusb/hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT GPIOA
-#define LED_PIN GPIO_PIN_5
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PORT GPIOC
-#define BUTTON_PIN GPIO_PIN_13
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_DEV USART2
-#define UART_CLK_EN __HAL_RCC_USART2_CLK_ENABLE
-#define UART_GPIO_PORT GPIOA
-#define UART_GPIO_AF GPIO_AF1_USART2
-#define UART_TX_PIN GPIO_PIN_2
-#define UART_RX_PIN GPIO_PIN_3
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_stm32f0_clock_init(void)
-{
- /* Configure the system clock to 48 MHz */
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
- RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
-
- /* Enable HSE Oscillator and activate PLL with 8 MHz HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
- RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
- clocks dividers */
- RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1;
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1);
-
-
- PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB;
- PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL;
- HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) ;
-}
-
-static inline void board_vbus_sense_init(void)
-{
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.mk b/tinyusb/hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.mk
deleted file mode 100755
index 9e636cd7..00000000
--- a/tinyusb/hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DSTM32F070xB
-
-LD_FILE = $(BOARD_PATH)/stm32F070rbtx_flash.ld
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f070xb.s
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f070rb
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f0/boards/stm32f070rbnucleo/stm32F070rbtx_flash.ld b/tinyusb/hw/bsp/stm32f0/boards/stm32f070rbnucleo/stm32F070rbtx_flash.ld
deleted file mode 100755
index 59e18f37..00000000
--- a/tinyusb/hw/bsp/stm32f0/boards/stm32f070rbnucleo/stm32F070rbtx_flash.ld
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
-******************************************************************************
-**
-** File : LinkerScript.ld
-**
-** Author : Auto-generated by STM32CubeIDE
-**
-** Abstract : Linker script for STM32F070RBTx Device from STM32F0 series
-** 128Kbytes FLASH
-** 16Kbytes RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-** Distribution: The file is distributed as is without any warranty
-** of any kind.
-**
-*****************************************************************************
-** @attention
-**
-** <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
-**
-** 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 STMicroelectronics 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.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20004000; /* end of "RAM" Ram type memory */
-
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Memories definition */
-MEMORY
-{
- RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K
- FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K
-}
-
-/* Sections */
-SECTIONS
-{
- /* The startup code into "FLASH" Rom type memory */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data into "FLASH" Rom type memory */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data into "FLASH" Rom type memory */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : {
- . = ALIGN(4);
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- . = ALIGN(4);
- } >FLASH
-
- .ARM : {
- . = ALIGN(4);
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- . = ALIGN(4);
- } >FLASH
-
- .preinit_array :
- {
- . = ALIGN(4);
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- . = ALIGN(4);
- } >FLASH
-
- .init_array :
- {
- . = ALIGN(4);
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- . = ALIGN(4);
- } >FLASH
-
- .fini_array :
- {
- . = ALIGN(4);
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- . = ALIGN(4);
- } >FLASH
-
- /* Used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections into "RAM" Ram type memory */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
-
- } >RAM AT> FLASH
-
- /* Uninitialized data section into "RAM" Ram type memory */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
- /* Remove information from the compiler libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
diff --git a/tinyusb/hw/bsp/stm32f0/boards/stm32f072disco/STM32F072RBTx_FLASH.ld b/tinyusb/hw/bsp/stm32f0/boards/stm32f072disco/STM32F072RBTx_FLASH.ld
deleted file mode 100755
index 8d31f6a0..00000000
--- a/tinyusb/hw/bsp/stm32f0/boards/stm32f072disco/STM32F072RBTx_FLASH.ld
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F072RBTx Device with
-** 128KByte FLASH, 16KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20004000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32f0/boards/stm32f072disco/board.h b/tinyusb/hw/bsp/stm32f0/boards/stm32f072disco/board.h
deleted file mode 100755
index 0b1824b8..00000000
--- a/tinyusb/hw/bsp/stm32f0/boards/stm32f072disco/board.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT GPIOC
-#define LED_PIN GPIO_PIN_6
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-// UART
-#define UART_DEV USART1
-#define UART_CLK_EN __HAL_RCC_USART1_CLK_ENABLE
-#define UART_GPIO_PORT GPIOA
-#define UART_GPIO_AF GPIO_AF1_USART1
-#define UART_TX_PIN GPIO_PIN_9
-#define UART_RX_PIN GPIO_PIN_10
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_stm32f0_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Select HSI48 Oscillator as PLL source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48;
- RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI48;
- RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV2;
- RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL2;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Select PLL as system clock source and configure the HCLK and PCLK1 clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1);
-}
-
-static inline void board_vbus_sense_init(void)
-{
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f0/boards/stm32f072disco/board.mk b/tinyusb/hw/bsp/stm32f0/boards/stm32f072disco/board.mk
deleted file mode 100755
index 2ef0ee63..00000000
--- a/tinyusb/hw/bsp/stm32f0/boards/stm32f072disco/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DSTM32F072xB
-
-LD_FILE = $(BOARD_PATH)/STM32F072RBTx_FLASH.ld
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f072xb.s
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f072rb
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f0/boards/stm32f072eval/STM32F072VBTx_FLASH.ld b/tinyusb/hw/bsp/stm32f0/boards/stm32f072eval/STM32F072VBTx_FLASH.ld
deleted file mode 100755
index 581613a5..00000000
--- a/tinyusb/hw/bsp/stm32f0/boards/stm32f072eval/STM32F072VBTx_FLASH.ld
+++ /dev/null
@@ -1,177 +0,0 @@
-/**
- ******************************************************************************
- * @file LinkerScript.ld
- * @author Auto-generated by STM32CubeIDE
- * Abstract : Linker script for STM32072B-EVAL Board embedding STM32F072VBTx Device from stm32f0 series
- * 128Kbytes FLASH
- * 16Kbytes RAM
- *
- * Set heap size, stack size and stack location according
- * to application requirements.
- *
- * Set memory bank area and size if external memory is used
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
-
-_Min_Heap_Size = 0x200 ; /* required amount of heap */
-_Min_Stack_Size = 0x400 ; /* required amount of stack */
-
-/* Memories definition */
-MEMORY
-{
- RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K
- FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K
-}
-
-/* Sections */
-SECTIONS
-{
- /* The startup code into "FLASH" Rom type memory */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data into "FLASH" Rom type memory */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data into "FLASH" Rom type memory */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : {
- . = ALIGN(4);
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- . = ALIGN(4);
- } >FLASH
-
- .ARM : {
- . = ALIGN(4);
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- . = ALIGN(4);
- } >FLASH
-
- .preinit_array :
- {
- . = ALIGN(4);
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- . = ALIGN(4);
- } >FLASH
-
- .init_array :
- {
- . = ALIGN(4);
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- . = ALIGN(4);
- } >FLASH
-
- .fini_array :
- {
- . = ALIGN(4);
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- . = ALIGN(4);
- } >FLASH
-
- /* Used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections into "RAM" Ram type memory */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
- *(.RamFunc) /* .RamFunc sections */
- *(.RamFunc*) /* .RamFunc* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
-
- } >RAM AT> FLASH
-
- /* Uninitialized data section into "RAM" Ram type memory */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss section */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
- /* Remove information from the compiler libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
diff --git a/tinyusb/hw/bsp/stm32f0/boards/stm32f072eval/board.h b/tinyusb/hw/bsp/stm32f0/boards/stm32f072eval/board.h
deleted file mode 100755
index 8869d5dc..00000000
--- a/tinyusb/hw/bsp/stm32f0/boards/stm32f072eval/board.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT GPIOD
-#define LED_PIN GPIO_PIN_8 // LED1, GREEN
-// #define LED_PIN GPIO_PIN_9 // LED2, ORANGE
-// #define LED_PIN GPIO_PIN_10 // LED3, RED
-// #define LED_PIN GPIO_PIN_11 // LED4, BLUE
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0 // JOY_SEL
-#define BUTTON_STATE_ACTIVE 1
-
-// UART
-#define UART_DEV USART2
-#define UART_CLK_EN __HAL_RCC_USART2_CLK_ENABLE
-#define UART_GPIO_PORT GPIOD
-#define UART_GPIO_AF GPIO_AF0_USART2
-#define UART_TX_PIN GPIO_PIN_5
-#define UART_RX_PIN GPIO_PIN_6
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_stm32f0_clock_init(void)
-{
- RCC_OscInitTypeDef RCC_OscInitStruct = {0};
- RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
- RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
-
- /** Initializes the RCC Oscillators according to the specified parameters
- * in the RCC_OscInitTypeDef structure.
- */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48;
- RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
- RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
- RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
- RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
-
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /** Initializes the CPU, AHB and APB buses clocks
- */
- RCC_ClkInitStruct.ClockType =
- RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1;
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
-
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1);
-
- PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB | RCC_PERIPHCLK_USART2;
- PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_PCLK1;
- PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
-
- HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);
-}
-
-static inline void board_vbus_sense_init(void)
-{
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f0/boards/stm32f072eval/board.mk b/tinyusb/hw/bsp/stm32f0/boards/stm32f072eval/board.mk
deleted file mode 100755
index f7f8c84e..00000000
--- a/tinyusb/hw/bsp/stm32f0/boards/stm32f072eval/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DSTM32F072xB -DLSI_VALUE=40000
-
-LD_FILE = $(BOARD_PATH)/STM32F072VBTx_FLASH.ld
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f072xb.s
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f072vb
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f0/family.c b/tinyusb/hw/bsp/stm32f0/family.c
deleted file mode 100755
index 853bb9d6..00000000
--- a/tinyusb/hw/bsp/stm32f0/family.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "stm32f0xx_hal.h"
-#include "bsp/board.h"
-#include "board.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-UART_HandleTypeDef UartHandle;
-
-void board_init(void)
-{
- board_stm32f0_clock_init();
-
- // Enable All GPIOs clocks
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOB_CLK_ENABLE();
- __HAL_RCC_GPIOC_CLK_ENABLE();
- __HAL_RCC_GPIOD_CLK_ENABLE();
- __HAL_RCC_GPIOF_CLK_ENABLE();
-
- // Enable UART Clock
- UART_CLK_EN();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
-#endif
-
- // LED
- GPIO_InitTypeDef GPIO_InitStruct;
- GPIO_InitStruct.Pin = LED_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
-
- // Button
- GPIO_InitStruct.Pin = BUTTON_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_PULLDOWN;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
-
- // Uart
- GPIO_InitStruct.Pin = UART_TX_PIN | UART_RX_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- GPIO_InitStruct.Alternate = UART_GPIO_AF;
- HAL_GPIO_Init(UART_GPIO_PORT, &GPIO_InitStruct);
-
- UartHandle.Instance = UART_DEV;
- UartHandle.Init.BaudRate = CFG_BOARD_UART_BAUDRATE;
- UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
- UartHandle.Init.StopBits = UART_STOPBITS_1;
- UartHandle.Init.Parity = UART_PARITY_NONE;
- UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
- UartHandle.Init.Mode = UART_MODE_TX_RX;
- UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
- HAL_UART_Init(&UartHandle);
-
- // USB Pins
- // Configure USB DM and DP pins. This is optional, and maintained only for user guidance.
- GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12);
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- // USB Clock enable
- __HAL_RCC_USB_CLK_ENABLE();
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-void HardFault_Handler (void)
-{
- asm("bkpt");
-}
-
-#ifdef USE_FULL_ASSERT
-/**
- * @brief Reports the name of the source file and the source line number
- * where the assert_param error has occurred.
- * @param file: pointer to the source file name
- * @param line: assert_param error line source number
- * @retval None
- */
-void assert_failed(uint8_t* file, uint32_t line)
-{
- (void) file; (void) line;
- /* USER CODE BEGIN 6 */
- /* User can add his own implementation to report the file name and line number,
- tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
- /* USER CODE END 6 */
-}
-#endif /* USE_FULL_ASSERT */
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/stm32f0/family.mk b/tinyusb/hw/bsp/stm32f0/family.mk
deleted file mode 100755
index 08cbf562..00000000
--- a/tinyusb/hw/bsp/stm32f0/family.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-UF2_FAMILY_ID = 0x647824b6
-ST_FAMILY = f0
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
-ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m0 \
- -mfloat-abi=soft \
- -nostdlib -nostartfiles \
- -DCFG_EXAMPLE_MSC_READONLY \
- -DCFG_TUSB_MCU=OPT_MCU_STM32F0
-
-# suppress warning caused by vendor mcu driver
-CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align
-
-SRC_C += \
- src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \
- $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_uart.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
diff --git a/tinyusb/hw/bsp/stm32f0/stm32f0xx_hal_conf.h b/tinyusb/hw/bsp/stm32f0/stm32f0xx_hal_conf.h
deleted file mode 100755
index cfa66b36..00000000
--- a/tinyusb/hw/bsp/stm32f0/stm32f0xx_hal_conf.h
+++ /dev/null
@@ -1,321 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f0xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F0xx_HAL_CONF_H
-#define __STM32F0xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/*#define HAL_ADC_MODULE_ENABLED */
-/*#define HAL_CAN_MODULE_ENABLED */
-/*#define HAL_CEC_MODULE_ENABLED */
-/*#define HAL_COMP_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/*#define HAL_CRC_MODULE_ENABLED */
-/*#define HAL_DAC_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-/*#define HAL_EXTI_MODULE_ENABLED */
-/*#define HAL_I2C_MODULE_ENABLED */
-/*#define HAL_I2S_MODULE_ENABLED */
-/*#define HAL_IRDA_MODULE_ENABLED */
-/*#define HAL_IWDG_MODULE_ENABLED */
-#define HAL_PCD_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-/*#define HAL_RTC_MODULE_ENABLED */
-/*#define HAL_SMARTCARD_MODULE_ENABLED */
-/*#define HAL_SMBUS_MODULE_ENABLED */
-/*#define HAL_SPI_MODULE_ENABLED */
-/*#define HAL_TIM_MODULE_ENABLED */
-/*#define HAL_TSC_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/*#define HAL_USART_MODULE_ENABLED */
-/*#define HAL_WWDG_MODULE_ENABLED */
-
-/* ######################### Oscillator Values adaptation ################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-/**
- * @brief In the following line adjust the External High Speed oscillator (HSE) Startup
- * Timeout value
- */
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup
- * Timeout value
- */
-#if !defined (HSI_STARTUP_TIMEOUT)
- #define HSI_STARTUP_TIMEOUT 5000U /*!< Time out for HSI start up */
-#endif /* HSI_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator for ADC (HSI14) value.
- */
-#if !defined (HSI14_VALUE)
- #define HSI14_VALUE 14000000U /*!< Value of the Internal High Speed oscillator for ADC in Hz.
- The real value may vary depending on the variations
- in voltage and temperature. */
-#endif /* HSI14_VALUE */
-
-/**
- * @brief Internal High Speed oscillator for USB (HSI48) value.
- */
-#if !defined (HSI48_VALUE)
- #define HSI48_VALUE 48000000U /*!< Value of the Internal High Speed oscillator for USB in Hz.
- The real value may vary depending on the variations
- in voltage and temperature. */
-#endif /* HSI48_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE 32000U
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-/**
- * @brief Time out for LSE start up value in ms.
- */
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE 3300U /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default) */
- /* Warning: Must be set to higher priority for HAL_Delay() */
- /* and HAL_GetTick() usage under interrupt context */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define INSTRUCTION_CACHE_ENABLE 0U
-#define DATA_CACHE_ENABLE 0U
-#define USE_SPI_CRC 1U
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
- #define USE_FULL_ASSERT 1
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f0xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f0xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32f0xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f0xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f0xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f0xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f0xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f0xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_COMP_MODULE_ENABLED
- #include "stm32f0xx_hal_comp.h"
-#endif /* HAL_COMP_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f0xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f0xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f0xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f0xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f0xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f0xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f0xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f0xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f0xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f0xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f0xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_SMBUS_MODULE_ENABLED
- #include "stm32f0xx_hal_smbus.h"
-#endif /* HAL_SMBUS_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f0xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f0xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_TSC_MODULE_ENABLED
- #include "stm32f0xx_hal_tsc.h"
-#endif /* HAL_TSC_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f0xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f0xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f0xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F0xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
-
diff --git a/tinyusb/hw/bsp/stm32f1/boards/stm32f103_bluepill/STM32F103X8_FLASH.ld b/tinyusb/hw/bsp/stm32f1/boards/stm32f103_bluepill/STM32F103X8_FLASH.ld
deleted file mode 100755
index ca180490..00000000
--- a/tinyusb/hw/bsp/stm32f1/boards/stm32f103_bluepill/STM32F103X8_FLASH.ld
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-*****************************************************************************
-**
-** File : STM32F103XB_FLASH.ld
-**
-** Abstract : Linker script for STM32F103xB Device with
-** 128KByte FLASH, 20KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20004FFF; /* end of RAM */
-
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
diff --git a/tinyusb/hw/bsp/stm32f1/boards/stm32f103_bluepill/board.h b/tinyusb/hw/bsp/stm32f1/boards/stm32f103_bluepill/board.h
deleted file mode 100755
index 57a607ed..00000000
--- a/tinyusb/hw/bsp/stm32f1/boards/stm32f103_bluepill/board.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT GPIOC
-#define LED_PIN GPIO_PIN_13
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-// UART
-//#define UART_DEV USART1
-//#define UART_CLK_EN __HAL_RCC_USART1_CLK_ENABLE
-//#define UART_GPIO_PORT GPIOA
-//#define UART_GPIO_AF GPIO_AF1_USART1
-//#define UART_TX_PIN GPIO_PIN_9
-//#define UART_RX_PIN GPIO_PIN_10
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_stm32f1_clock_init(void)
-{
- RCC_ClkInitTypeDef clkinitstruct = {0};
- RCC_OscInitTypeDef oscinitstruct = {0};
- RCC_PeriphCLKInitTypeDef rccperiphclkinit = {0};
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- oscinitstruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- oscinitstruct.HSEState = RCC_HSE_ON;
- oscinitstruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
- oscinitstruct.PLL.PLLMUL = RCC_PLL_MUL9;
- oscinitstruct.PLL.PLLState = RCC_PLL_ON;
- oscinitstruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- HAL_RCC_OscConfig(&oscinitstruct);
-
- /* USB clock selection */
- rccperiphclkinit.PeriphClockSelection = RCC_PERIPHCLK_USB;
- rccperiphclkinit.UsbClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5;
- HAL_RCCEx_PeriphCLKConfig(&rccperiphclkinit);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
- clkinitstruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- clkinitstruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- clkinitstruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- clkinitstruct.APB1CLKDivider = RCC_HCLK_DIV2;
- clkinitstruct.APB2CLKDivider = RCC_HCLK_DIV1;
- HAL_RCC_ClockConfig(&clkinitstruct, FLASH_LATENCY_2);
-}
-
-static inline void board_vbus_sense_init(void)
-{
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f1/boards/stm32f103_bluepill/board.mk b/tinyusb/hw/bsp/stm32f1/boards/stm32f103_bluepill/board.mk
deleted file mode 100755
index 9c690ca7..00000000
--- a/tinyusb/hw/bsp/stm32f1/boards/stm32f103_bluepill/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DSTM32F103xB -DHSE_VALUE=8000000U
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/STM32F103X8_FLASH.ld
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f103xb.s
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f103c8
-
-# flash target ROM bootloader
-flash: flash-dfu-util
diff --git a/tinyusb/hw/bsp/stm32f1/boards/stm32f103_mini_2/STM32F103XC_FLASH.ld b/tinyusb/hw/bsp/stm32f1/boards/stm32f103_mini_2/STM32F103XC_FLASH.ld
deleted file mode 100755
index da40d1eb..00000000
--- a/tinyusb/hw/bsp/stm32f1/boards/stm32f103_mini_2/STM32F103XC_FLASH.ld
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-*****************************************************************************
-**
-** File : STM32F103XB_FLASH.ld
-**
-** Abstract : Linker script for STM32F103xB Device with
-** 128KByte FLASH, 20KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20004FFF; /* end of RAM */
-
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 256K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 48K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
diff --git a/tinyusb/hw/bsp/stm32f1/boards/stm32f103_mini_2/board.h b/tinyusb/hw/bsp/stm32f1/boards/stm32f103_mini_2/board.h
deleted file mode 100755
index bedce7f1..00000000
--- a/tinyusb/hw/bsp/stm32f1/boards/stm32f103_mini_2/board.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT GPIOA
-#define LED_PIN GPIO_PIN_8
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-// UART
-//#define UART_DEV USART1
-//#define UART_CLK_EN __HAL_RCC_USART1_CLK_ENABLE
-//#define UART_GPIO_PORT GPIOA
-//#define UART_GPIO_AF GPIO_AF1_USART1
-//#define UART_TX_PIN GPIO_PIN_9
-//#define UART_RX_PIN GPIO_PIN_10
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_stm32f1_clock_init(void)
-{
- RCC_ClkInitTypeDef clkinitstruct = {0};
- RCC_OscInitTypeDef oscinitstruct = {0};
- RCC_PeriphCLKInitTypeDef rccperiphclkinit = {0};
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- oscinitstruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- oscinitstruct.HSEState = RCC_HSE_ON;
- oscinitstruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
- oscinitstruct.PLL.PLLMUL = RCC_PLL_MUL9;
- oscinitstruct.PLL.PLLState = RCC_PLL_ON;
- oscinitstruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- HAL_RCC_OscConfig(&oscinitstruct);
-
- /* USB clock selection */
- rccperiphclkinit.PeriphClockSelection = RCC_PERIPHCLK_USB;
- rccperiphclkinit.UsbClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5;
- HAL_RCCEx_PeriphCLKConfig(&rccperiphclkinit);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
- clkinitstruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- clkinitstruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- clkinitstruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- clkinitstruct.APB1CLKDivider = RCC_HCLK_DIV2;
- clkinitstruct.APB2CLKDivider = RCC_HCLK_DIV1;
- HAL_RCC_ClockConfig(&clkinitstruct, FLASH_LATENCY_2);
-}
-
-static inline void board_vbus_sense_init(void)
-{
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f1/boards/stm32f103_mini_2/board.mk b/tinyusb/hw/bsp/stm32f1/boards/stm32f103_mini_2/board.mk
deleted file mode 100755
index eeda8708..00000000
--- a/tinyusb/hw/bsp/stm32f1/boards/stm32f103_mini_2/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DSTM32F103xB -DHSE_VALUE=8000000U
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/STM32F103XC_FLASH.ld
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f103xb.s
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f103rc
-
-# flash target ROM bootloader
-flash: flash-jlink
diff --git a/tinyusb/hw/bsp/stm32f1/family.c b/tinyusb/hw/bsp/stm32f1/family.c
deleted file mode 100755
index 8fcf9ebd..00000000
--- a/tinyusb/hw/bsp/stm32f1/family.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "stm32f1xx_hal.h"
-#include "bsp/board.h"
-#include "board.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_HP_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-void USB_LP_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-void USBWakeUp_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-void board_init(void)
-{
- board_stm32f1_clock_init();
-
- // Enable All GPIOs clocks
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOB_CLK_ENABLE();
- __HAL_RCC_GPIOC_CLK_ENABLE();
- __HAL_RCC_GPIOD_CLK_ENABLE();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(USB_HP_CAN1_TX_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USB_LP_CAN1_RX0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(USBWakeUp_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
-#endif
-
- // LED
- GPIO_InitTypeDef GPIO_InitStruct;
- GPIO_InitStruct.Pin = LED_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = LED_STATE_ON ? GPIO_PULLDOWN : GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
-
- // Button
- GPIO_InitStruct.Pin = BUTTON_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = BUTTON_STATE_ACTIVE ? GPIO_PULLDOWN : GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
-
- // USB Pins
- // Configure USB DM and DP pins.
- GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12);
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- // USB Clock enable
- __HAL_RCC_USB_CLK_ENABLE();
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-void HardFault_Handler (void)
-{
- asm("bkpt");
-}
-
-#ifdef USE_FULL_ASSERT
-/**
- * @brief Reports the name of the source file and the source line number
- * where the assert_param error has occurred.
- * @param file: pointer to the source file name
- * @param line: assert_param error line source number
- * @retval None
- */
-void assert_failed(char *file, uint32_t line)
-{
- /* USER CODE BEGIN 6 */
- /* User can add his own implementation to report the file name and line number,
- tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
- /* USER CODE END 6 */
-}
-#endif /* USE_FULL_ASSERT */
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/stm32f1/family.mk b/tinyusb/hw/bsp/stm32f1/family.mk
deleted file mode 100755
index 3fb2e6e7..00000000
--- a/tinyusb/hw/bsp/stm32f1/family.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-ST_FAMILY = f1
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
-ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m3 \
- -mfloat-abi=soft \
- -nostdlib -nostartfiles \
- -DCFG_TUSB_MCU=OPT_MCU_STM32F1
-
-# mcu driver cause following warnings
-#CFLAGS += -Wno-error=unused-parameter
-
-# All source paths should be relative to the top level.
-SRC_C += \
- src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \
- $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM3
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f103c8
-
-# flash target ROM bootloader
-flash-dfu-util: $(BUILD)/$(PROJECT).bin
- dfu-util -R -a 0 --dfuse-address 0x08000000 -D $<
diff --git a/tinyusb/hw/bsp/stm32f1/stm32f1xx_hal_conf.h b/tinyusb/hw/bsp/stm32f1/stm32f1xx_hal_conf.h
deleted file mode 100755
index a4a3f308..00000000
--- a/tinyusb/hw/bsp/stm32f1/stm32f1xx_hal_conf.h
+++ /dev/null
@@ -1,379 +0,0 @@
-/**
- ******************************************************************************
- * @file USB_Device/HID_Standalone/Inc/stm32f1xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration template file.
- * This file should be copied to the application folder and renamed
- * to stm32f1xx_hal_conf.h.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F1xx_HAL_CONF_H
-#define __STM32F1xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-#define HAL_PCD_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-
-/* ########################## Oscillator Values adaptation ####################*/
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
-#if defined(USE_STM3210C_EVAL)
- #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
-#else
- #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
-#endif
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz */
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE 40000U /*!< LSI Typical Value in Hz */
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-
-/**
- * @brief External Low Speed oscillator (LSE) value.
- * This value is used by the UART, RTC HAL module to compute the system frequency
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE 3300U /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1U */
-
-/* ################## Ethernet peripheral configuration ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB 8U /* 8 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-
-/* DP83848 PHY Address*/
-#define DP83848_PHY_ADDRESS 0x01U
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY 0x000000FFU
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY 0x00000FFFU
-
-#define PHY_READ_TO 0x0000FFFFU
-#define PHY_WRITE_TO 0x0000FFFFU
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */
-#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */
-#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */
-
-#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */
-#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */
-
-#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */
-#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */
-
-#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */
-#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f1xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f1xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32f1xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f1xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f1xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "Legacy/stm32f1xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f1xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f1xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f1xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f1xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f1xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f1xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f1xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f1xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f1xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f1xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f1xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f1xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_PCCARD_MODULE_ENABLED
- #include "stm32f1xx_hal_pccard.h"
-#endif /* HAL_PCCARD_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f1xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f1xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f1xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f1xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f1xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f1xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f1xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f1xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f1xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f1xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F1xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f207nucleo/STM32F207ZGTx_FLASH.ld b/tinyusb/hw/bsp/stm32f207nucleo/STM32F207ZGTx_FLASH.ld
deleted file mode 100755
index 29e387f2..00000000
--- a/tinyusb/hw/bsp/stm32f207nucleo/STM32F207ZGTx_FLASH.ld
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F207IGHx Device with
-** 1024KByte FLASH, 128KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20020000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32f207nucleo/board.mk b/tinyusb/hw/bsp/stm32f207nucleo/board.mk
deleted file mode 100755
index 2b979f3d..00000000
--- a/tinyusb/hw/bsp/stm32f207nucleo/board.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-ST_FAMILY = f2
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
-ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m3 \
- -mfloat-abi=soft \
- -nostdlib -nostartfiles \
- -DSTM32F207xx \
- -DCFG_TUSB_MCU=OPT_MCU_STM32F2
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=sign-compare
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/STM32F207ZGTx_FLASH.ld
-
-SRC_C += \
- src/portable/st/synopsys/dcd_synopsys.c \
- $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c
-
-SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f207xx.s
-
-INC += \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM3
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f207zg
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f207nucleo/stm32f207nucleo.c b/tinyusb/hw/bsp/stm32f207nucleo/stm32f207nucleo.c
deleted file mode 100755
index 619c90d6..00000000
--- a/tinyusb/hw/bsp/stm32f207nucleo/stm32f207nucleo.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "../board.h"
-
-#include "stm32f2xx_hal.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void OTG_FS_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-#define LED_PORT GPIOB
-#define LED_PIN GPIO_PIN_14
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT GPIOC
-#define BUTTON_PIN GPIO_PIN_13
-#define BUTTON_STATE_ACTIVE 1
-
-
-// enable all LED, Button, Uart, USB clock
-static void all_rcc_clk_enable(void)
-{
- __HAL_RCC_GPIOA_CLK_ENABLE(); // USB D+, D-
- __HAL_RCC_GPIOB_CLK_ENABLE(); // LED
- __HAL_RCC_GPIOC_CLK_ENABLE(); // Button
-}
-
-/**
- * @brief System Clock Configuration
- * The system Clock is configured as follow :
- * System Clock source = PLL (HSE)
- * SYSCLK(Hz) = 120000000
- * HCLK(Hz) = 120000000
- * AHB Prescaler = 1
- * APB1 Prescaler = 4
- * APB2 Prescaler = 2
- * HSE Frequency(Hz) = 8000000
- * PLL_M = HSE_VALUE/1000000
- * PLL_N = 240
- * PLL_P = 2
- * PLL_Q = 5
- * VDD(V) = 3.3
- * Flash Latency(WS) = 3
- * @param None
- * @retval None
- */
-void SystemClock_Config(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 240;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
- RCC_OscInitStruct.PLL.PLLQ = 5;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
- clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3);
-}
-
-void board_init(void)
-{
- SystemClock_Config();
-
- #if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
- #endif
-
-
- all_rcc_clk_enable();
-
- GPIO_InitTypeDef GPIO_InitStruct;
-
- // LED
- GPIO_InitStruct.Pin = LED_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
-
- board_led_write(false);
-
- // Button
- GPIO_InitStruct.Pin = BUTTON_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_PULLDOWN;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
-
- /* Configure DM DP Pins */
- GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12);
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* Configure VBUS Pin */
- GPIO_InitStruct.Pin = GPIO_PIN_9;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* Configure ID pin */
- GPIO_InitStruct.Pin = GPIO_PIN_10;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* Enable USB FS Clocks */
- __HAL_RCC_USB_OTG_FS_CLK_ENABLE();
-
- // Enable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_NOVBUSSENS;
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBUSBSEN;
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-void HardFault_Handler (void)
-{
- asm("bkpt");
-}
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/stm32f207nucleo/stm32f2xx_hal_conf.h b/tinyusb/hw/bsp/stm32f207nucleo/stm32f2xx_hal_conf.h
deleted file mode 100755
index 2ab46b26..00000000
--- a/tinyusb/hw/bsp/stm32f207nucleo/stm32f2xx_hal_conf.h
+++ /dev/null
@@ -1,407 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f2xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F2xx_HAL_CONF_H
-#define __STM32F2xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-/* #define HAL_DMA_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_EXTI_MODULE_ENABLED
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-/* #define HAL_UART_MODULE_ENABLED */
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-#define HAL_PCD_MODULE_ENABLED
-/* #define HAL_HCD_MODULE_ENABLED */
-
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature.*/
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE 3300U /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define INSTRUCTION_CACHE_ENABLE 1U
-#define DATA_CACHE_ENABLE 1U
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1U */
-
-/* ################## Ethernet peripheral configuration for NUCLEO 144 board ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB 5U /* 5 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB 5U /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-
-/* LAN8742A PHY Address*/
-#define LAN8742A_PHY_ADDRESS 0x00U
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY 0x000000FFU
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY 0x00000FFFU
-
-#define PHY_READ_TO 0x0000FFFFU
-#define PHY_WRITE_TO 0x0000FFFFU
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x1F) /*!< PHY special control/ status register Offset */
-
-#define PHY_SPEED_STATUS ((uint16_t)0x0004) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0010) /*!< PHY Duplex mask */
-
-
-#define PHY_ISFR ((uint16_t)0x1D) /*!< PHY Interrupt Source Flag register Offset */
-#define PHY_ISFR_INT4 ((uint16_t)0x0010) /*!< PHY Link down inturrupt */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f2xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f2xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32f2xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f2xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f2xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f2xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f2xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f2xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f2xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f2xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f2xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f2xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f2xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f2xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f2xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f2xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_PCCARD_MODULE_ENABLED
- #include "stm32f2xx_hal_pccard.h"
-#endif /* HAL_PCCARD_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f2xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f2xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f2xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f2xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f2xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f2xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f2xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f2xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f2xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f2xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f2xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f2xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f2xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f2xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f2xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f2xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f2xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F2xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f303disco/STM32F303VCTx_FLASH.ld b/tinyusb/hw/bsp/stm32f303disco/STM32F303VCTx_FLASH.ld
deleted file mode 100755
index ca9046d2..00000000
--- a/tinyusb/hw/bsp/stm32f303disco/STM32F303VCTx_FLASH.ld
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F303VCTx Device with
-** 256KByte FLASH, 40KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x2000a000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x800;; /* required amount of heap */
-_Min_Stack_Size = 0x800;; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 40K
-CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 8K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
- _siccmram = LOADADDR(.ccmram);
-
- /* CCM-RAM section
- *
- * IMPORTANT NOTE!
- * If initialized variables will be placed in this section,
- * the startup code needs to be modified to copy the init-values.
- */
- .ccmram :
- {
- . = ALIGN(4);
- _sccmram = .; /* create a global symbol at ccmram start */
- *(.ccmram)
- *(.ccmram*)
-
- . = ALIGN(4);
- _eccmram = .; /* create a global symbol at ccmram end */
- } >CCMRAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32f303disco/board.mk b/tinyusb/hw/bsp/stm32f303disco/board.mk
deleted file mode 100755
index 9dd27a85..00000000
--- a/tinyusb/hw/bsp/stm32f303disco/board.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-ST_FAMILY = f3
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
-ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib -nostartfiles \
- -DSTM32F303xC \
- -DCFG_TUSB_MCU=OPT_MCU_STM32F3
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/STM32F303VCTx_FLASH.ld
-
-SRC_C += \
- src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \
- $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c
-
-SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f303xc.s
-
-INC += \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f303vc
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f303disco/stm32f303disco.c b/tinyusb/hw/bsp/stm32f303disco/stm32f303disco.c
deleted file mode 100755
index 33552bc0..00000000
--- a/tinyusb/hw/bsp/stm32f303disco/stm32f303disco.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "../board.h"
-#include "stm32f3xx_hal.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-
-// USB defaults to using interrupts 19, 20 and 42, however, this BSP sets the
-// SYSCFG_CFGR1.USB_IT_RMP bit remapping interrupts to 74, 75 and 76.
-
-// FIXME: Do all three need to be handled, or just the LP one?
-// USB high-priority interrupt (Channel 74): Triggered only by a correct
-// transfer event for isochronous and double-buffer bulk transfer to reach
-// the highest possible transfer rate.
-void USB_HP_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-// USB low-priority interrupt (Channel 75): Triggered by all USB events
-// (Correct transfer, USB reset, etc.). The firmware has to check the
-// interrupt source before serving the interrupt.
-void USB_LP_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-// USB wakeup interrupt (Channel 76): Triggered by the wakeup event from the USB
-// Suspend mode.
-void USBWakeUp_RMP_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-#define LED_PORT GPIOE
-#define LED_PIN GPIO_PIN_9
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-
-/**
- * @brief System Clock Configuration
- * The system Clock is configured as follow :
- * System Clock source = PLL (HSE)
- * SYSCLK(Hz) = 72000000
- * HCLK(Hz) = 72000000
- * AHB Prescaler = 1
- * APB1 Prescaler = 2
- * APB2 Prescaler = 1
- * HSE Frequency(Hz) = 8000000
- * HSE PREDIV = 1
- * PLLMUL = RCC_PLL_MUL9 (9)
- * Flash Latency(WS) = 2
- * @param None
- * @retval None
- */
-static void SystemClock_Config(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
- RCC_PeriphCLKInitTypeDef RCC_PeriphClkInit;
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Configures the USB clock */
- HAL_RCCEx_GetPeriphCLKConfig(&RCC_PeriphClkInit);
- RCC_PeriphClkInit.USBClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5;
- HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphClkInit);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
- clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2);
-
- /* Enable Power Clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-}
-
-void board_init(void)
-{
- SystemClock_Config();
-
- #if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
- #endif
-
- // Remap the USB interrupts
- __HAL_RCC_SYSCFG_CLK_ENABLE();
- __HAL_REMAPINTERRUPT_USB_ENABLE();
-
- // LED
- __HAL_RCC_GPIOE_CLK_ENABLE();
- GPIO_InitTypeDef GPIO_InitStruct;
- GPIO_InitStruct.Pin = LED_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
-
- // Button
- __HAL_RCC_GPIOA_CLK_ENABLE();
- GPIO_InitStruct.Pin = BUTTON_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_PULLDOWN;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
-
- /* Configure USB DM and DP pins */
- __HAL_RCC_GPIOA_CLK_ENABLE();
- GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12);
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF14_USB;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- // Enable USB clock
- __HAL_RCC_USB_CLK_ENABLE();
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-void HardFault_Handler (void)
-{
- asm("bkpt");
-}
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/stm32f303disco/stm32f3xx_hal_conf.h b/tinyusb/hw/bsp/stm32f303disco/stm32f3xx_hal_conf.h
deleted file mode 100755
index 0abcbb01..00000000
--- a/tinyusb/hw/bsp/stm32f303disco/stm32f3xx_hal_conf.h
+++ /dev/null
@@ -1,357 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f3xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F3xx_HAL_CONF_H
-#define __STM32F3xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_COMP_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_EXTI_MODULE_ENABLED */
-/* #define HAL_HRTIM_MODULE_ENABLED */
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_OPAMP_MODULE_ENABLED */
-/* #define HAL_PCD_MODULE_ENABLED */
-/* #define HAL_PWR_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SDADC_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-/* #define HAL_TSC_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-/**
- * @brief In the following line adjust the External High Speed oscillator (HSE) Startup
- * Timeout value
- */
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE (8000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup
- * Timeout value
- */
-#if !defined (HSI_STARTUP_TIMEOUT)
- #define HSI_STARTUP_TIMEOUT (5000U) /*!< Time out for HSI start up */
-#endif /* HSI_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE (40000U)
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-/**
- * @brief Time out for LSE start up value in ms.
- */
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- * - External clock generated through external PLL component on EVAL 303 (based on MCO or crystal)
- * - External clock not generated on EVAL 373
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE (8000000U) /*!< Value of the External oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE (3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default) */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define INSTRUCTION_CACHE_ENABLE 0U
-#define DATA_CACHE_ENABLE 0U
-#define USE_SPI_CRC 1U
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SDADC_REGISTER_CALLBACKS 0U /* SDADC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
-#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* OPAMP register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/*#define USE_FULL_ASSERT 1U*/
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f3xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f3xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32f3xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f3xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f3xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f3xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f3xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "stm32f3xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f3xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_COMP_MODULE_ENABLED
- #include "stm32f3xx_hal_comp.h"
-#endif /* HAL_COMP_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f3xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f3xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f3xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f3xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f3xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f3xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_PCCARD_MODULE_ENABLED
- #include "stm32f3xx_hal_pccard.h"
-#endif /* HAL_PCCARD_MODULE_ENABLED */
-
-#ifdef HAL_HRTIM_MODULE_ENABLED
- #include "stm32f3xx_hal_hrtim.h"
-#endif /* HAL_HRTIM_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f3xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f3xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f3xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f3xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_OPAMP_MODULE_ENABLED
- #include "stm32f3xx_hal_opamp.h"
-#endif /* HAL_OPAMP_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f3xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f3xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f3xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SDADC_MODULE_ENABLED
- #include "stm32f3xx_hal_sdadc.h"
-#endif /* HAL_SDADC_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f3xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_SMBUS_MODULE_ENABLED
- #include "stm32f3xx_hal_smbus.h"
-#endif /* HAL_SMBUS_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f3xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f3xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_TSC_MODULE_ENABLED
- #include "stm32f3xx_hal_tsc.h"
-#endif /* HAL_TSC_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f3xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f3xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f3xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F3xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/STM32F405RGTx_FLASH.ld b/tinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/STM32F405RGTx_FLASH.ld
deleted file mode 100755
index 57ef61e2..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/STM32F405RGTx_FLASH.ld
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F405RGTx Device with
-** 1024KByte FLASH, 128KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20020000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
-CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
- _siccmram = LOADADDR(.ccmram);
-
- /* CCM-RAM section
- *
- * IMPORTANT NOTE!
- * If initialized variables will be placed in this section,
- * the startup code needs to be modified to copy the init-values.
- */
- .ccmram :
- {
- . = ALIGN(4);
- _sccmram = .; /* create a global symbol at ccmram start */
- *(.ccmram)
- *(.ccmram*)
-
- . = ALIGN(4);
- _eccmram = .; /* create a global symbol at ccmram end */
- } >CCMRAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/board.h b/tinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/board.h
deleted file mode 100755
index 19d0a1ea..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/board.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT GPIOC
-#define LED_PIN GPIO_PIN_1
-#define LED_STATE_ON 1
-
-// Button: Pin D5
-#define BUTTON_PORT GPIOC
-#define BUTTON_PIN GPIO_PIN_7
-#define BUTTON_STATE_ACTIVE 0
-
-// UART
-#define UART_DEV USART3
-#define UART_GPIO_PORT GPIOB
-#define UART_GPIO_AF GPIO_AF7_USART3
-#define UART_TX_PIN GPIO_PIN_10
-#define UART_RX_PIN GPIO_PIN_11
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 336;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
- RCC_OscInitStruct.PLL.PLLQ = 7;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
- clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5);
-
- // Enable clocks for LED, Button, Uart
- __HAL_RCC_GPIOB_CLK_ENABLE();
- __HAL_RCC_GPIOC_CLK_ENABLE();
- __HAL_RCC_USART3_CLK_ENABLE();
-}
-
-static inline void board_vbus_sense_init(void)
-{
- // Enable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_NOVBUSSENS;
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBUSBSEN;
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/board.mk b/tinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/board.mk
deleted file mode 100755
index 1de56fe5..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/board.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-CFLAGS += -DSTM32F405xx
-
-LD_FILE = $(BOARD_PATH)/STM32F405RGTx_FLASH.ld
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f405xx.s
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f405rg
-
-# flash target ROM bootloader
-flash: $(BUILD)/$(PROJECT).bin
- dfu-util -R -a 0 --dfuse-address 0x08000000 -D $<
diff --git a/tinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/stm32f4xx_hal_conf.h b/tinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/stm32f4xx_hal_conf.h
deleted file mode 100755
index b892df3b..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/feather_stm32f405/stm32f4xx_hal_conf.h
+++ /dev/null
@@ -1,491 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f4xx_hal_conf.h
- * @brief HAL configuration file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
- *
- * 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 STMicroelectronics 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.
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F4xx_HAL_CONF_H
-#define __STM32F4xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-/* #define HAL_MMC_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_PCD_MODULE_ENABLED
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-/* #define HAL_QSPI_MODULE_ENABLED */
-/* #define HAL_QSPI_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_FMPI2C_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_EXTI_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE ((uint32_t)12000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature.*/
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define INSTRUCTION_CACHE_ENABLE 1U
-#define DATA_CACHE_ENABLE 1U
-
-/* Copied over manually- STM32Cube didn't generate these for some reason. */
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */
-#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1U */
-
-/* ################## Ethernet peripheral configuration ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-
-/* DP83848_PHY_ADDRESS Address*/
-#define DP83848_PHY_ADDRESS 0x01U
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY ((uint32_t)0x000000FFU)
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU)
-
-#define PHY_READ_TO ((uint32_t)0x0000FFFFU)
-#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU)
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */
-
-#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 0U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f4xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32f4xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f4xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f4xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f4xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f4xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f4xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f4xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f4xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f4xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f4xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f4xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f4xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f4xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f4xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f4xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_PCCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_pccard.h"
-#endif /* HAL_PCCARD_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f4xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f4xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f4xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f4xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f4xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f4xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f4xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f4xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f4xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_MMC_MODULE_ENABLED
- #include "stm32f4xx_hal_mmc.h"
-#endif /* HAL_MMC_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f4xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f4xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f4xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f4xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f4xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f4xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f4xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f4xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f4xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f4xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_FMPI2C_MODULE_ENABLED
- #include "stm32f4xx_hal_fmpi2c.h"
-#endif /* HAL_FMPI2C_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f4xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f4xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f4xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F4xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f4/boards/pyboardv11/STM32F405RGTx_FLASH.ld b/tinyusb/hw/bsp/stm32f4/boards/pyboardv11/STM32F405RGTx_FLASH.ld
deleted file mode 100755
index 57ef61e2..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/pyboardv11/STM32F405RGTx_FLASH.ld
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F405RGTx Device with
-** 1024KByte FLASH, 128KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20020000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
-CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
- _siccmram = LOADADDR(.ccmram);
-
- /* CCM-RAM section
- *
- * IMPORTANT NOTE!
- * If initialized variables will be placed in this section,
- * the startup code needs to be modified to copy the init-values.
- */
- .ccmram :
- {
- . = ALIGN(4);
- _sccmram = .; /* create a global symbol at ccmram start */
- *(.ccmram)
- *(.ccmram*)
-
- . = ALIGN(4);
- _eccmram = .; /* create a global symbol at ccmram end */
- } >CCMRAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32f4/boards/pyboardv11/board.h b/tinyusb/hw/bsp/stm32f4/boards/pyboardv11/board.h
deleted file mode 100755
index 685919c5..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/pyboardv11/board.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// Blue LED is chosen because the other LEDs are connected to ST-LINK lines.
-#define LED_PORT GPIOB
-#define LED_PIN GPIO_PIN_4
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT GPIOB
-#define BUTTON_PIN GPIO_PIN_3
-#define BUTTON_STATE_ACTIVE 1
-
-// Enable PA2 as the debug log UART
-// It is not routed to the ST/Link on the Discovery board.
-//#define UART_DEV USART2
-//#define UART_GPIO_PORT GPIOA
-//#define UART_GPIO_AF GPIO_AF7_USART2
-//#define UART_TX_PIN GPIO_PIN_2
-//#define UART_RX_PIN GPIO_PIN_3
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 336;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
- RCC_OscInitStruct.PLL.PLLQ = 7;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
- clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5);
-
- // Enable clocks for LED, Button, Uart
- __HAL_RCC_GPIOB_CLK_ENABLE();
-}
-
-static inline void board_vbus_sense_init(void)
-{
- // Enable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_NOVBUSSENS;
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBUSBSEN;
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f4/boards/pyboardv11/board.mk b/tinyusb/hw/bsp/stm32f4/boards/pyboardv11/board.mk
deleted file mode 100755
index 02dcd121..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/pyboardv11/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DSTM32F405xx
-
-LD_FILE = $(BOARD_PATH)/STM32F405RGTx_FLASH.ld
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f405xx.s
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f405rg
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f4/boards/pyboardv11/stm32f4xx_hal_conf.h b/tinyusb/hw/bsp/stm32f4/boards/pyboardv11/stm32f4xx_hal_conf.h
deleted file mode 100755
index b892df3b..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/pyboardv11/stm32f4xx_hal_conf.h
+++ /dev/null
@@ -1,491 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f4xx_hal_conf.h
- * @brief HAL configuration file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
- *
- * 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 STMicroelectronics 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.
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F4xx_HAL_CONF_H
-#define __STM32F4xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-/* #define HAL_MMC_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_PCD_MODULE_ENABLED
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-/* #define HAL_QSPI_MODULE_ENABLED */
-/* #define HAL_QSPI_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_FMPI2C_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_EXTI_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE ((uint32_t)12000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature.*/
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define INSTRUCTION_CACHE_ENABLE 1U
-#define DATA_CACHE_ENABLE 1U
-
-/* Copied over manually- STM32Cube didn't generate these for some reason. */
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */
-#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1U */
-
-/* ################## Ethernet peripheral configuration ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-
-/* DP83848_PHY_ADDRESS Address*/
-#define DP83848_PHY_ADDRESS 0x01U
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY ((uint32_t)0x000000FFU)
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU)
-
-#define PHY_READ_TO ((uint32_t)0x0000FFFFU)
-#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU)
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */
-
-#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 0U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f4xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32f4xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f4xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f4xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f4xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f4xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f4xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f4xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f4xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f4xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f4xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f4xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f4xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f4xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f4xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f4xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_PCCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_pccard.h"
-#endif /* HAL_PCCARD_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f4xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f4xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f4xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f4xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f4xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f4xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f4xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f4xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f4xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_MMC_MODULE_ENABLED
- #include "stm32f4xx_hal_mmc.h"
-#endif /* HAL_MMC_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f4xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f4xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f4xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f4xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f4xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f4xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f4xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f4xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f4xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f4xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_FMPI2C_MODULE_ENABLED
- #include "stm32f4xx_hal_fmpi2c.h"
-#endif /* HAL_FMPI2C_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f4xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f4xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f4xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F4xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/STM32F401VCTx_FLASH.ld b/tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/STM32F401VCTx_FLASH.ld
deleted file mode 100755
index f51f1ab4..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/STM32F401VCTx_FLASH.ld
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F401VCTx Device with
-** 256KByte FLASH, 64KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20010000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200;; /* required amount of heap */
-_Min_Stack_Size = 0x400;; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 256K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/board.h b/tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/board.h
deleted file mode 100755
index 0f820512..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/board.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT GPIOC
-#define LED_PIN GPIO_PIN_13
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 0
-
-// Enable PA2 as the debug log UART
-//#define UART_DEV USART2
-//#define UART_GPIO_PORT GPIOA
-//#define UART_GPIO_AF GPIO_AF7_USART2
-//#define UART_TX_PIN GPIO_PIN_2
-//#define UART_RX_PIN GPIO_PIN_3
-
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 336;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
- RCC_OscInitStruct.PLL.PLLQ = 7;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
- clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2);
-
- // Enable clocks for LED, Button, Uart
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOC_CLK_ENABLE();
- //__HAL_RCC_USART2_CLK_ENABLE();
-}
-
-static inline void board_vbus_sense_init(void)
-{
- // Blackpill doens't use VBUS sense (B device) explicitly disable it
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS;
- USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN;
- USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSASEN;
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/board.mk b/tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/board.mk
deleted file mode 100755
index de0f3d4c..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/board.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-CFLAGS += -DSTM32F401xC
-
-LD_FILE = $(BOARD_PATH)/STM32F401VCTx_FLASH.ld
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f401xc.s
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f401cc
-
-# flash target ROM bootloader
-flash: $(BUILD)/$(PROJECT).bin
- dfu-util -R -a 0 --dfuse-address 0x08000000 -D $<
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/stm32f4xx_hal_conf.h b/tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/stm32f4xx_hal_conf.h
deleted file mode 100755
index 2ab9a1d5..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f401blackpill/stm32f4xx_hal_conf.h
+++ /dev/null
@@ -1,493 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f4xx_hal_conf_template.h
- * @author MCD Application Team
- * @brief HAL configuration file
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F4xx_HAL_CONF_H
-#define __STM32F4xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_EXTI_MODULE_ENABLED */
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-// #define HAL_SPI_MODULE_ENABLED
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_PCD_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_FMPI2C_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_MMC_MODULE_ENABLED */
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE (25000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE (16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE (32000U)
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE (12288000U) /*!< Value of the External oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE (3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY (0x0FU) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define INSTRUCTION_CACHE_ENABLE 1U
-#define DATA_CACHE_ENABLE 1U
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1U */
-
-/* ################## Ethernet peripheral configuration ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-
-/* DP83848 PHY Address*/
-#define DP83848_PHY_ADDRESS 0x01U
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY 0x000000FFU
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY 0x00000FFFU
-
-#define PHY_READ_TO 0x0000FFFFU
-#define PHY_WRITE_TO 0x0000FFFFU
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */
-#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */
-#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */
-
-#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */
-#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */
-
-#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */
-#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */
-
-#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */
-#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f4xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f4xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32f4xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f4xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f4xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f4xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f4xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "stm32f4xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f4xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f4xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f4xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f4xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f4xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f4xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f4xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f4xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f4xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_PCCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_pccard.h"
-#endif /* HAL_PCCARD_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f4xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f4xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_SMBUS_MODULE_ENABLED
- #include "stm32f4xx_hal_smbus.h"
-#endif /* HAL_SMBUS_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f4xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f4xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f4xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f4xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f4xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f4xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f4xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f4xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f4xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f4xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f4xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f4xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f4xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f4xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f4xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f4xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f4xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_FMPI2C_MODULE_ENABLED
- #include "stm32f4xx_hal_fmpi2c.h"
-#endif /* HAL_FMPI2C_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f4xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f4xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f4xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_MMC_MODULE_ENABLED
- #include "stm32f4xx_hal_mmc.h"
-#endif /* HAL_MMC_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F4xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f407disco/STM32F407VGTx_FLASH.ld b/tinyusb/hw/bsp/stm32f4/boards/stm32f407disco/STM32F407VGTx_FLASH.ld
deleted file mode 100755
index c4160272..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f407disco/STM32F407VGTx_FLASH.ld
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F407VGTx Device with
-** 1024KByte FLASH, 128KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20020000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x1000; /* required amount of heap */
-_Min_Stack_Size = 0x4000; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
- RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
- CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
- FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
- _siccmram = LOADADDR(.ccmram);
-
- /* CCM-RAM section
- *
- * IMPORTANT NOTE!
- * If initialized variables will be placed in this section,
- * the startup code needs to be modified to copy the init-values.
- */
- .ccmram :
- {
- . = ALIGN(4);
- _sccmram = .; /* create a global symbol at ccmram start */
- *(.ccmram)
- *(.ccmram*)
-
- . = ALIGN(4);
- _eccmram = .; /* create a global symbol at ccmram end */
- } >CCMRAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f407disco/board.h b/tinyusb/hw/bsp/stm32f4/boards/stm32f407disco/board.h
deleted file mode 100755
index 693e0393..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f407disco/board.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT GPIOD
-#define LED_PIN GPIO_PIN_14
-#define LED_STATE_ON 1
-
-// Button
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-// Enable PA2 as the debug log UART
-// It is not routed to the ST/Link on the Discovery board.
-#define UART_DEV USART2
-#define UART_GPIO_PORT GPIOA
-#define UART_GPIO_AF GPIO_AF7_USART2
-#define UART_TX_PIN GPIO_PIN_2
-#define UART_RX_PIN GPIO_PIN_3
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 336;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
- RCC_OscInitStruct.PLL.PLLQ = 7;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
- clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5);
-
- // Enable clocks for LED, Button, Uart
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOD_CLK_ENABLE();
- __HAL_RCC_USART2_CLK_ENABLE();
-}
-
-static inline void board_vbus_sense_init(void)
-{
- // Enable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_NOVBUSSENS;
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBUSBSEN;
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f407disco/board.mk b/tinyusb/hw/bsp/stm32f4/boards/stm32f407disco/board.mk
deleted file mode 100755
index 212b924b..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f407disco/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DSTM32F407xx
-
-LD_FILE = $(BOARD_PATH)/STM32F407VGTx_FLASH.ld
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f407xx.s
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f407vg
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f407disco/stm32f4xx_hal_conf.h b/tinyusb/hw/bsp/stm32f4/boards/stm32f407disco/stm32f4xx_hal_conf.h
deleted file mode 100755
index 7864f8d5..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f407disco/stm32f4xx_hal_conf.h
+++ /dev/null
@@ -1,493 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f4xx_hal_conf_template.h
- * @author MCD Application Team
- * @brief HAL configuration file
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F4xx_HAL_CONF_H
-#define __STM32F4xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_EXTI_MODULE_ENABLED */
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-// #define HAL_SPI_MODULE_ENABLED
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_PCD_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_FMPI2C_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_MMC_MODULE_ENABLED */
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE (16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE (32000U)
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE (12288000U) /*!< Value of the External oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE (3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY (0x0FU) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define INSTRUCTION_CACHE_ENABLE 1U
-#define DATA_CACHE_ENABLE 1U
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1U */
-
-/* ################## Ethernet peripheral configuration ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-
-/* DP83848 PHY Address*/
-#define DP83848_PHY_ADDRESS 0x01U
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY 0x000000FFU
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY 0x00000FFFU
-
-#define PHY_READ_TO 0x0000FFFFU
-#define PHY_WRITE_TO 0x0000FFFFU
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */
-#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */
-#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */
-
-#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */
-#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */
-
-#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */
-#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */
-
-#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */
-#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f4xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f4xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32f4xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f4xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f4xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f4xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f4xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "stm32f4xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f4xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f4xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f4xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f4xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f4xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f4xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f4xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f4xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f4xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_PCCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_pccard.h"
-#endif /* HAL_PCCARD_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f4xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f4xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_SMBUS_MODULE_ENABLED
- #include "stm32f4xx_hal_smbus.h"
-#endif /* HAL_SMBUS_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f4xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f4xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f4xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f4xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f4xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f4xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f4xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f4xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f4xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f4xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f4xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f4xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f4xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f4xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f4xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f4xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f4xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_FMPI2C_MODULE_ENABLED
- #include "stm32f4xx_hal_fmpi2c.h"
-#endif /* HAL_FMPI2C_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f4xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f4xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f4xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_MMC_MODULE_ENABLED
- #include "stm32f4xx_hal_mmc.h"
-#endif /* HAL_MMC_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F4xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/STM32F411CEUx_FLASH.ld b/tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/STM32F411CEUx_FLASH.ld
deleted file mode 100755
index efea1e06..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/STM32F411CEUx_FLASH.ld
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F411CEUx Device with
-** 512KByte FLASH, 128KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20020000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200;; /* required amount of heap */
-_Min_Stack_Size = 0x400;; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(4);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(4);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/board.h b/tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/board.h
deleted file mode 100755
index 0f820512..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/board.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT GPIOC
-#define LED_PIN GPIO_PIN_13
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 0
-
-// Enable PA2 as the debug log UART
-//#define UART_DEV USART2
-//#define UART_GPIO_PORT GPIOA
-//#define UART_GPIO_AF GPIO_AF7_USART2
-//#define UART_TX_PIN GPIO_PIN_2
-//#define UART_RX_PIN GPIO_PIN_3
-
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 336;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
- RCC_OscInitStruct.PLL.PLLQ = 7;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
- clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2);
-
- // Enable clocks for LED, Button, Uart
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOC_CLK_ENABLE();
- //__HAL_RCC_USART2_CLK_ENABLE();
-}
-
-static inline void board_vbus_sense_init(void)
-{
- // Blackpill doens't use VBUS sense (B device) explicitly disable it
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS;
- USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN;
- USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSASEN;
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/board.mk b/tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/board.mk
deleted file mode 100755
index 78be4348..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/board.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-CFLAGS += -DSTM32F411xE
-
-LD_FILE = $(BOARD_PATH)/STM32F411CEUx_FLASH.ld
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f411xe.s
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f411ce
-
-# flash target ROM bootloader
-flash: $(BUILD)/$(PROJECT).bin
- dfu-util -R -a 0 --dfuse-address 0x08000000 -D $<
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/stm32f4xx_hal_conf.h b/tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/stm32f4xx_hal_conf.h
deleted file mode 100755
index 2ab9a1d5..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f411blackpill/stm32f4xx_hal_conf.h
+++ /dev/null
@@ -1,493 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f4xx_hal_conf_template.h
- * @author MCD Application Team
- * @brief HAL configuration file
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F4xx_HAL_CONF_H
-#define __STM32F4xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_EXTI_MODULE_ENABLED */
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-// #define HAL_SPI_MODULE_ENABLED
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_PCD_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_FMPI2C_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_MMC_MODULE_ENABLED */
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE (25000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE (16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE (32000U)
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE (12288000U) /*!< Value of the External oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE (3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY (0x0FU) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define INSTRUCTION_CACHE_ENABLE 1U
-#define DATA_CACHE_ENABLE 1U
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1U */
-
-/* ################## Ethernet peripheral configuration ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-
-/* DP83848 PHY Address*/
-#define DP83848_PHY_ADDRESS 0x01U
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY 0x000000FFU
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY 0x00000FFFU
-
-#define PHY_READ_TO 0x0000FFFFU
-#define PHY_WRITE_TO 0x0000FFFFU
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */
-#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */
-#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */
-
-#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */
-#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */
-
-#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */
-#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */
-
-#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */
-#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f4xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f4xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32f4xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f4xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f4xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f4xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f4xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "stm32f4xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f4xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f4xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f4xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f4xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f4xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f4xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f4xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f4xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f4xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_PCCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_pccard.h"
-#endif /* HAL_PCCARD_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f4xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f4xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_SMBUS_MODULE_ENABLED
- #include "stm32f4xx_hal_smbus.h"
-#endif /* HAL_SMBUS_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f4xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f4xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f4xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f4xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f4xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f4xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f4xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f4xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f4xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f4xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f4xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f4xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f4xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f4xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f4xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f4xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f4xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_FMPI2C_MODULE_ENABLED
- #include "stm32f4xx_hal_fmpi2c.h"
-#endif /* HAL_FMPI2C_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f4xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f4xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f4xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_MMC_MODULE_ENABLED
- #include "stm32f4xx_hal_mmc.h"
-#endif /* HAL_MMC_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F4xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f411disco/STM32F411VETx_FLASH.ld b/tinyusb/hw/bsp/stm32f4/boards/stm32f411disco/STM32F411VETx_FLASH.ld
deleted file mode 100755
index 3a0ce526..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f411disco/STM32F411VETx_FLASH.ld
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F411VETx Device with
-** 512KByte FLASH, 128KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20020000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200;; /* required amount of heap */
-_Min_Stack_Size = 0x400;; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f411disco/board.h b/tinyusb/hw/bsp/stm32f4/boards/stm32f411disco/board.h
deleted file mode 100755
index 008a94a5..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f411disco/board.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// Orange LED
-#define LED_PORT GPIOD
-#define LED_PIN GPIO_PIN_13
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-// Enable PA2 as the debug log UART
-#define UART_DEV USART2
-#define UART_GPIO_PORT GPIOA
-#define UART_GPIO_AF GPIO_AF7_USART2
-#define UART_TX_PIN GPIO_PIN_2
-#define UART_RX_PIN GPIO_PIN_3
-
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 336;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
- RCC_OscInitStruct.PLL.PLLQ = 7;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
- clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2);
-
- // Enable clocks for LED, Button, Uart
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOD_CLK_ENABLE();
- __HAL_RCC_USART2_CLK_ENABLE();
-}
-
-static inline void board_vbus_sense_init(void)
-{
- // Enable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_NOVBUSSENS;
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBUSBSEN;
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f411disco/board.mk b/tinyusb/hw/bsp/stm32f4/boards/stm32f411disco/board.mk
deleted file mode 100755
index 48272acf..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f411disco/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DSTM32F411xE
-
-LD_FILE = $(BOARD_PATH)/STM32F411VETx_FLASH.ld
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f411xe.s
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f411ve
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f411disco/stm32f4xx_hal_conf.h b/tinyusb/hw/bsp/stm32f4/boards/stm32f411disco/stm32f4xx_hal_conf.h
deleted file mode 100755
index 7864f8d5..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f411disco/stm32f4xx_hal_conf.h
+++ /dev/null
@@ -1,493 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f4xx_hal_conf_template.h
- * @author MCD Application Team
- * @brief HAL configuration file
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F4xx_HAL_CONF_H
-#define __STM32F4xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_EXTI_MODULE_ENABLED */
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-// #define HAL_SPI_MODULE_ENABLED
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_PCD_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_FMPI2C_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_MMC_MODULE_ENABLED */
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE (16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE (32000U)
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE (12288000U) /*!< Value of the External oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE (3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY (0x0FU) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define INSTRUCTION_CACHE_ENABLE 1U
-#define DATA_CACHE_ENABLE 1U
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1U */
-
-/* ################## Ethernet peripheral configuration ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-
-/* DP83848 PHY Address*/
-#define DP83848_PHY_ADDRESS 0x01U
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY 0x000000FFU
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY 0x00000FFFU
-
-#define PHY_READ_TO 0x0000FFFFU
-#define PHY_WRITE_TO 0x0000FFFFU
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */
-#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */
-#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */
-
-#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */
-#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */
-
-#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */
-#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */
-
-#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */
-#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f4xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f4xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32f4xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f4xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f4xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f4xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f4xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "stm32f4xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f4xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f4xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f4xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f4xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f4xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f4xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f4xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f4xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f4xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_PCCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_pccard.h"
-#endif /* HAL_PCCARD_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f4xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f4xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_SMBUS_MODULE_ENABLED
- #include "stm32f4xx_hal_smbus.h"
-#endif /* HAL_SMBUS_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f4xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f4xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f4xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f4xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f4xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f4xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f4xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f4xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f4xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f4xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f4xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f4xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f4xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f4xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f4xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f4xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f4xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_FMPI2C_MODULE_ENABLED
- #include "stm32f4xx_hal_fmpi2c.h"
-#endif /* HAL_FMPI2C_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f4xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f4xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f4xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_MMC_MODULE_ENABLED
- #include "stm32f4xx_hal_mmc.h"
-#endif /* HAL_MMC_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F4xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f412disco/STM32F412ZGTx_FLASH.ld b/tinyusb/hw/bsp/stm32f4/boards/stm32f412disco/STM32F412ZGTx_FLASH.ld
deleted file mode 100755
index b00b5dbe..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f412disco/STM32F412ZGTx_FLASH.ld
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F412ZGTx Device with
-** 1024KByte FLASH, 256KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20040000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f412disco/board.h b/tinyusb/hw/bsp/stm32f4/boards/stm32f412disco/board.h
deleted file mode 100755
index 7f4a4fa1..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f412disco/board.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// LED
-#define LED_PORT GPIOE
-#define LED_PIN GPIO_PIN_2
-#define LED_STATE_ON 0
-
-// Button
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-// UART Enable PA2 as the debug log UART
-#define UART_DEV USART2
-#define UART_GPIO_PORT GPIOA
-#define UART_GPIO_AF GPIO_AF7_USART2
-#define UART_TX_PIN GPIO_PIN_2
-#define UART_RX_PIN GPIO_PIN_3
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
- RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the
- * device is clocked below the maximum system frequency, to update the
- * voltage scaling value regarding system frequency refer to product
- * datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 200;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
- RCC_OscInitStruct.PLL.PLLQ = 7;
- RCC_OscInitStruct.PLL.PLLR = 2;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Select PLLSAI output as USB clock source */
- PeriphClkInitStruct.PLLI2S.PLLI2SM = 8;
- PeriphClkInitStruct.PLLI2S.PLLI2SQ = 4;
- PeriphClkInitStruct.PLLI2S.PLLI2SN = 192;
- PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CK48;
- PeriphClkInitStruct.Clk48ClockSelection = RCC_CK48CLKSOURCE_PLLI2SQ;
- PeriphClkInitStruct.PLLI2SSelection = RCC_PLLI2SCLKSOURCE_PLLSRC;
- PeriphClkInitStruct.PLLI2S.PLLI2SR = 7;
- HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
- * clocks dividers */
- RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK |
- RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
-
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3);
-
- // Enable clocks for LED, Button, Uart
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOE_CLK_ENABLE();
- __HAL_RCC_USART2_CLK_ENABLE();
-}
-
-static inline void board_vbus_sense_init(void)
-{
- // Enable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN;
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f412disco/board.mk b/tinyusb/hw/bsp/stm32f4/boards/stm32f412disco/board.mk
deleted file mode 100755
index 50973f73..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f412disco/board.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-CFLAGS += -DSTM32F412Zx
-
-LD_FILE = $(BOARD_PATH)/STM32F412ZGTx_FLASH.ld
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f412zx.s
-
-# For flash-jlink target
-JLINK_DEVICE = stm32f412zg
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f4/boards/stm32f412disco/stm32f4xx_hal_conf.h b/tinyusb/hw/bsp/stm32f4/boards/stm32f412disco/stm32f4xx_hal_conf.h
deleted file mode 100755
index 7864f8d5..00000000
--- a/tinyusb/hw/bsp/stm32f4/boards/stm32f412disco/stm32f4xx_hal_conf.h
+++ /dev/null
@@ -1,493 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f4xx_hal_conf_template.h
- * @author MCD Application Team
- * @brief HAL configuration file
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F4xx_HAL_CONF_H
-#define __STM32F4xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_EXTI_MODULE_ENABLED */
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-// #define HAL_SPI_MODULE_ENABLED
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_PCD_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_FMPI2C_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_MMC_MODULE_ENABLED */
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE (16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE (32000U)
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE (12288000U) /*!< Value of the External oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE (3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY (0x0FU) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define INSTRUCTION_CACHE_ENABLE 1U
-#define DATA_CACHE_ENABLE 1U
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1U */
-
-/* ################## Ethernet peripheral configuration ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-
-/* DP83848 PHY Address*/
-#define DP83848_PHY_ADDRESS 0x01U
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY 0x000000FFU
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY 0x00000FFFU
-
-#define PHY_READ_TO 0x0000FFFFU
-#define PHY_WRITE_TO 0x0000FFFFU
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */
-#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */
-#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */
-
-#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */
-#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */
-
-#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */
-#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */
-
-#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */
-#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f4xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f4xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32f4xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f4xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f4xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f4xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f4xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "stm32f4xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f4xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f4xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f4xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f4xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f4xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f4xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f4xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f4xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f4xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_PCCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_pccard.h"
-#endif /* HAL_PCCARD_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f4xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f4xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f4xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_SMBUS_MODULE_ENABLED
- #include "stm32f4xx_hal_smbus.h"
-#endif /* HAL_SMBUS_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f4xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f4xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f4xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f4xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f4xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f4xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f4xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f4xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f4xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f4xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f4xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f4xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f4xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f4xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f4xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f4xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f4xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f4xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f4xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_FMPI2C_MODULE_ENABLED
- #include "stm32f4xx_hal_fmpi2c.h"
-#endif /* HAL_FMPI2C_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f4xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f4xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f4xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_MMC_MODULE_ENABLED
- #include "stm32f4xx_hal_mmc.h"
-#endif /* HAL_MMC_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F4xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f4/family.c b/tinyusb/hw/bsp/stm32f4/family.c
deleted file mode 100755
index 4a0dbcb1..00000000
--- a/tinyusb/hw/bsp/stm32f4/family.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "stm32f4xx_hal.h"
-#include "bsp/board.h"
-#include "board.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void OTG_FS_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-UART_HandleTypeDef UartHandle;
-
-void board_init(void)
-{
- board_clock_init();
- //SystemCoreClockUpdate();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(OTG_FS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- GPIO_InitTypeDef GPIO_InitStruct;
-
- // LED
- GPIO_InitStruct.Pin = LED_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
-
- board_led_write(false);
-
- // Button
- GPIO_InitStruct.Pin = BUTTON_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = BUTTON_STATE_ACTIVE ? GPIO_PULLDOWN : GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
-
-#ifdef UART_DEV
- // UART
- GPIO_InitStruct.Pin = UART_TX_PIN | UART_RX_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- GPIO_InitStruct.Alternate = UART_GPIO_AF;
- HAL_GPIO_Init(UART_GPIO_PORT, &GPIO_InitStruct);
-
- UartHandle = (UART_HandleTypeDef){
- .Instance = UART_DEV,
- .Init.BaudRate = CFG_BOARD_UART_BAUDRATE,
- .Init.WordLength = UART_WORDLENGTH_8B,
- .Init.StopBits = UART_STOPBITS_1,
- .Init.Parity = UART_PARITY_NONE,
- .Init.HwFlowCtl = UART_HWCONTROL_NONE,
- .Init.Mode = UART_MODE_TX_RX,
- .Init.OverSampling = UART_OVERSAMPLING_16
- };
- HAL_UART_Init(&UartHandle);
-#endif
-
- /* Configure USB FS GPIOs */
- __HAL_RCC_GPIOA_CLK_ENABLE();
-
- /* Configure USB D+ D- Pins */
- GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12;
- GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* Configure VBUS Pin */
- GPIO_InitStruct.Pin = GPIO_PIN_9;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* ID Pin */
- GPIO_InitStruct.Pin = GPIO_PIN_10;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
-#ifdef STM32F412Zx
- /* Configure POWER_SWITCH IO pin */
- __HAL_RCC_GPIOG_CLK_ENABLE();
- GPIO_InitStruct.Pin = GPIO_PIN_8;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
-#endif
-
- // Enable USB OTG clock
- __HAL_RCC_USB_OTG_FS_CLK_ENABLE();
-
- board_vbus_sense_init();
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
-#ifdef UART_DEV
- HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
- return len;
-#else
- (void) buf; (void) len; (void) UartHandle;
- return 0;
-#endif
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-void HardFault_Handler (void)
-{
- asm("bkpt");
-}
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/stm32f4/family.mk b/tinyusb/hw/bsp/stm32f4/family.mk
deleted file mode 100755
index 584d6940..00000000
--- a/tinyusb/hw/bsp/stm32f4/family.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-UF2_FAMILY_ID = 0x57755a57
-ST_FAMILY = f4
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
-ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib -nostartfiles \
- -DCFG_TUSB_MCU=OPT_MCU_STM32F4
-
-# suppress warning caused by vendor mcu driver
-CFLAGS += -Wno-error=cast-align
-
-SRC_C += \
- src/portable/st/synopsys/dcd_synopsys.c \
- $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_uart.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/STM32F723xE_FLASH.ld b/tinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/STM32F723xE_FLASH.ld
deleted file mode 100755
index 8645ce5c..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/STM32F723xE_FLASH.ld
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F723xE Device with
-** 512KByte FLASH, 256KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20040000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x460; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/board.h b/tinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/board.h
deleted file mode 100755
index d0ef6625..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/board.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define LED_PORT GPIOA
-#define LED_PIN GPIO_PIN_10
-#define LED_STATE_ON 1
-
-// No physical button is populated
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-#define UART_DEV USART6
-#define UART_CLK_EN __HAL_RCC_USART6_CLK_ENABLE
-#define UART_GPIO_AF GPIO_AF8_USART6
-
-#define UART_TX_PORT GPIOG
-#define UART_TX_PIN GPIO_PIN_9
-
-#define UART_RX_PORT GPIOG
-#define UART_RX_PIN GPIO_PIN_14
-
-// VBUS Sense detection
-#define OTG_FS_VBUS_SENSE 1
-#define OTG_HS_VBUS_SENSE 0
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 432;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
- RCC_OscInitStruct.PLL.PLLQ = 9;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Activate the OverDrive to reach the 216 MHz Frequency */
- HAL_PWREx_EnableOverDrive();
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
-
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7);
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/board.mk b/tinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/board.mk
deleted file mode 100755
index a18b3231..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/board.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# Only OTG-HS has a connector on this board
-PORT ?= 1
-SPEED ?= high
-
-CFLAGS += \
- -DSTM32F723xx \
- -DHSE_VALUE=25000000 \
-
-# All source paths should be relative to the top level.
-LD_FILE = $(BOARD_PATH)/STM32F723xE_FLASH.ld
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f723xx.s
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/stm32f7xx_hal_conf.h b/tinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/stm32f7xx_hal_conf.h
deleted file mode 100755
index 581f0e46..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stlinkv3mini/stm32f7xx_hal_conf.h
+++ /dev/null
@@ -1,472 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f7xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F7xx_HAL_CONF_H
-#define __STM32F7xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_PCD_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-/* #define HAL_JPEG_MODULE_ENABLED */
-/* #define HAL_MDIOS_MODULE_ENABLED */
-
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE ((uint32_t)25000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)0x0FU) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define ART_ACCLERATOR_ENABLE 1U /* To enable instruction cache and prefetch */
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIOS register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1 */
-
-/* ################## Ethernet peripheral configuration for NUCLEO 144 board ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB ((uint32_t)5) /* 5 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB ((uint32_t)5) /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-/* LAN8742A PHY Address*/
-#define LAN8742A_PHY_ADDRESS 0x00
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY ((uint32_t)0x00000FFF)
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF)
-
-#define PHY_READ_TO ((uint32_t)0x0000FFFF)
-#define PHY_WRITE_TO ((uint32_t)0x0000FFFF)
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x1F) /*!< PHY special control/ status register Offset */
-
-#define PHY_SPEED_STATUS ((uint16_t)0x0004) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0010) /*!< PHY Duplex mask */
-
-
-#define PHY_ISFR ((uint16_t)0x1D) /*!< PHY Interrupt Source Flag register Offset */
-#define PHY_ISFR_INT4 ((uint16_t)0x0010) /*!< PHY Link down inturrupt */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f7xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f7xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f7xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f7xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f7xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f7xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "stm32f7xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f7xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f7xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f7xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f7xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f7xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f7xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f7xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f7xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f7xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f7xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f7xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f7xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f7xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f7xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f7xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f7xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f7xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f7xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f7xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f7xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f7xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f7xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f7xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f7xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f7xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f7xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f7xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f7xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f7xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f7xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f7xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f7xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f7xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f7xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f7xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f7xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_JPEG_MODULE_ENABLED
- #include "stm32f7xx_hal_jpeg.h"
-#endif /* HAL_JPEG_MODULE_ENABLED */
-
-#ifdef HAL_MDIOS_MODULE_ENABLED
- #include "stm32f7xx_hal_mdios.h"
-#endif /* HAL_MDIOS_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F7xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f723disco/STM32F723xE_FLASH.ld b/tinyusb/hw/bsp/stm32f7/boards/stm32f723disco/STM32F723xE_FLASH.ld
deleted file mode 100755
index 8645ce5c..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f723disco/STM32F723xE_FLASH.ld
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F723xE Device with
-** 512KByte FLASH, 256KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20040000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x460; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f723disco/board.h b/tinyusb/hw/bsp/stm32f7/boards/stm32f723disco/board.h
deleted file mode 100755
index 93d83efc..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f723disco/board.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define LED_PORT GPIOB
-#define LED_PIN GPIO_PIN_1
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-#define UART_DEV USART6
-#define UART_CLK_EN __HAL_RCC_USART6_CLK_ENABLE
-#define UART_GPIO_AF GPIO_AF8_USART6
-
-#define UART_TX_PORT GPIOC
-#define UART_TX_PIN GPIO_PIN_6
-
-#define UART_RX_PORT GPIOC
-#define UART_RX_PIN GPIO_PIN_7
-
-// VBUS Sense detection
-#define OTG_FS_VBUS_SENSE 1
-#define OTG_HS_VBUS_SENSE 0
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 432;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
- RCC_OscInitStruct.PLL.PLLQ = 9;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Activate the OverDrive to reach the 216 MHz Frequency */
- HAL_PWREx_EnableOverDrive();
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
-
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7);
-}
-
-//static inline void board_vbus_sense_init(void)
-//{
-//
-//}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f723disco/board.mk b/tinyusb/hw/bsp/stm32f7/boards/stm32f723disco/board.mk
deleted file mode 100755
index 8f05199d..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f723disco/board.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-PORT ?= 1
-SPEED ?= high
-
-CFLAGS += \
- -DSTM32F723xx \
- -DHSE_VALUE=25000000 \
-
-LD_FILE = $(BOARD_PATH)/STM32F723xE_FLASH.ld
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f723xx.s
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f723disco/stm32f7xx_hal_conf.h b/tinyusb/hw/bsp/stm32f7/boards/stm32f723disco/stm32f7xx_hal_conf.h
deleted file mode 100755
index 581f0e46..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f723disco/stm32f7xx_hal_conf.h
+++ /dev/null
@@ -1,472 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f7xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F7xx_HAL_CONF_H
-#define __STM32F7xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_PCD_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-/* #define HAL_JPEG_MODULE_ENABLED */
-/* #define HAL_MDIOS_MODULE_ENABLED */
-
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE ((uint32_t)25000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)0x0FU) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define ART_ACCLERATOR_ENABLE 1U /* To enable instruction cache and prefetch */
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIOS register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1 */
-
-/* ################## Ethernet peripheral configuration for NUCLEO 144 board ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB ((uint32_t)5) /* 5 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB ((uint32_t)5) /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-/* LAN8742A PHY Address*/
-#define LAN8742A_PHY_ADDRESS 0x00
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY ((uint32_t)0x00000FFF)
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF)
-
-#define PHY_READ_TO ((uint32_t)0x0000FFFF)
-#define PHY_WRITE_TO ((uint32_t)0x0000FFFF)
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x1F) /*!< PHY special control/ status register Offset */
-
-#define PHY_SPEED_STATUS ((uint16_t)0x0004) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0010) /*!< PHY Duplex mask */
-
-
-#define PHY_ISFR ((uint16_t)0x1D) /*!< PHY Interrupt Source Flag register Offset */
-#define PHY_ISFR_INT4 ((uint16_t)0x0010) /*!< PHY Link down inturrupt */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f7xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f7xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f7xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f7xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f7xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f7xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "stm32f7xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f7xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f7xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f7xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f7xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f7xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f7xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f7xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f7xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f7xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f7xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f7xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f7xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f7xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f7xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f7xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f7xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f7xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f7xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f7xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f7xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f7xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f7xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f7xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f7xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f7xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f7xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f7xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f7xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f7xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f7xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f7xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f7xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f7xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f7xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f7xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f7xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_JPEG_MODULE_ENABLED
- #include "stm32f7xx_hal_jpeg.h"
-#endif /* HAL_JPEG_MODULE_ENABLED */
-
-#ifdef HAL_MDIOS_MODULE_ENABLED
- #include "stm32f7xx_hal_mdios.h"
-#endif /* HAL_MDIOS_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F7xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f746disco/STM32F746ZGTx_FLASH.ld b/tinyusb/hw/bsp/stm32f7/boards/stm32f746disco/STM32F746ZGTx_FLASH.ld
deleted file mode 100755
index 045ec76f..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f746disco/STM32F746ZGTx_FLASH.ld
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F746ZGTx Device with
-** 1024KByte FLASH, 320KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20050000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x460; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f746disco/board.h b/tinyusb/hw/bsp/stm32f7/boards/stm32f746disco/board.h
deleted file mode 100755
index ee342b9f..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f746disco/board.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define LED_PORT GPIOI
-#define LED_PIN GPIO_PIN_1
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT GPIOI
-#define BUTTON_PIN GPIO_PIN_11
-#define BUTTON_STATE_ACTIVE 1
-
-#define UART_DEV USART1
-#define UART_CLK_EN __HAL_RCC_USART1_CLK_ENABLE
-#define UART_GPIO_AF GPIO_AF7_USART1
-
-#define UART_TX_PORT GPIOA
-#define UART_TX_PIN GPIO_PIN_9
-
-#define UART_RX_PORT GPIOB
-#define UART_RX_PIN GPIO_PIN_7
-
-// VBUS Sense detection
-#define OTG_FS_VBUS_SENSE 0
-#define OTG_HS_VBUS_SENSE 0
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 432;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
- RCC_OscInitStruct.PLL.PLLQ = 9;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Activate the OverDrive to reach the 216 MHz Frequency */
- HAL_PWREx_EnableOverDrive();
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
-
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7);
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f746disco/board.mk b/tinyusb/hw/bsp/stm32f7/boards/stm32f746disco/board.mk
deleted file mode 100755
index 2ba59f67..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f746disco/board.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-PORT ?= 1
-SPEED ?= high
-
-CFLAGS += \
- -DSTM32F746xx \
- -DHSE_VALUE=25000000
-
-LD_FILE = $(BOARD_PATH)/STM32F746ZGTx_FLASH.ld
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f746xx.s
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f746disco/stm32f7xx_hal_conf.h b/tinyusb/hw/bsp/stm32f7/boards/stm32f746disco/stm32f7xx_hal_conf.h
deleted file mode 100755
index 03dec8f0..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f746disco/stm32f7xx_hal_conf.h
+++ /dev/null
@@ -1,472 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f7xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F7xx_HAL_CONF_H
-#define __STM32F7xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_PCD_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-/* #define HAL_JPEG_MODULE_ENABLED */
-/* #define HAL_MDIOS_MODULE_ENABLED */
-
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)0x0FU) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define ART_ACCLERATOR_ENABLE 1U /* To enable instruction cache and prefetch */
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIOS register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1 */
-
-/* ################## Ethernet peripheral configuration for NUCLEO 144 board ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB ((uint32_t)5) /* 5 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB ((uint32_t)5) /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-/* LAN8742A PHY Address*/
-#define LAN8742A_PHY_ADDRESS 0x00
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY ((uint32_t)0x00000FFF)
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF)
-
-#define PHY_READ_TO ((uint32_t)0x0000FFFF)
-#define PHY_WRITE_TO ((uint32_t)0x0000FFFF)
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x1F) /*!< PHY special control/ status register Offset */
-
-#define PHY_SPEED_STATUS ((uint16_t)0x0004) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0010) /*!< PHY Duplex mask */
-
-
-#define PHY_ISFR ((uint16_t)0x1D) /*!< PHY Interrupt Source Flag register Offset */
-#define PHY_ISFR_INT4 ((uint16_t)0x0010) /*!< PHY Link down inturrupt */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f7xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f7xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f7xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f7xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f7xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f7xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "stm32f7xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f7xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f7xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f7xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f7xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f7xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f7xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f7xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f7xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f7xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f7xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f7xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f7xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f7xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f7xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f7xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f7xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f7xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f7xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f7xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f7xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f7xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f7xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f7xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f7xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f7xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f7xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f7xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f7xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f7xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f7xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f7xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f7xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f7xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f7xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f7xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f7xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_JPEG_MODULE_ENABLED
- #include "stm32f7xx_hal_jpeg.h"
-#endif /* HAL_JPEG_MODULE_ENABLED */
-
-#ifdef HAL_MDIOS_MODULE_ENABLED
- #include "stm32f7xx_hal_mdios.h"
-#endif /* HAL_MDIOS_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F7xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/STM32F746ZGTx_FLASH.ld b/tinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/STM32F746ZGTx_FLASH.ld
deleted file mode 100755
index b434a01b..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/STM32F746ZGTx_FLASH.ld
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F746ZGTx Device with
-** 1024KByte FLASH, 320KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20050000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x460; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/board.h b/tinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/board.h
deleted file mode 100755
index 093445ed..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/board.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define LED_PORT GPIOB
-#define LED_PIN GPIO_PIN_14
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT GPIOC
-#define BUTTON_PIN GPIO_PIN_13
-#define BUTTON_STATE_ACTIVE 1
-
-#define UART_DEV USART3
-#define UART_CLK_EN __HAL_RCC_USART3_CLK_ENABLE
-#define UART_GPIO_AF GPIO_AF7_USART3
-
-#define UART_TX_PORT GPIOD
-#define UART_TX_PIN GPIO_PIN_8
-#define UART_RX_PORT GPIOD
-#define UART_RX_PIN GPIO_PIN_9
-
-// VBUS Sense detection
-#define OTG_FS_VBUS_SENSE 1
-#define OTG_HS_VBUS_SENSE 0
-
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 432;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
- RCC_OscInitStruct.PLL.PLLQ = 9;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Activate the OverDrive to reach the 216 MHz Frequency */
- HAL_PWREx_EnableOverDrive();
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
-
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7);
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/board.mk b/tinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/board.mk
deleted file mode 100755
index 3dcf4817..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/board.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-PORT ?= 0
-SPEED ?= full
-
-CFLAGS += \
- -DSTM32F746xx \
- -DHSE_VALUE=8000000
-
-LD_FILE = $(BOARD_PATH)/STM32F746ZGTx_FLASH.ld
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f746xx.s
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/stm32f7xx_hal_conf.h b/tinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/stm32f7xx_hal_conf.h
deleted file mode 100755
index 234191b0..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f746nucleo/stm32f7xx_hal_conf.h
+++ /dev/null
@@ -1,472 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f7xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F7xx_HAL_CONF_H
-#define __STM32F7xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_PCD_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-/* #define HAL_JPEG_MODULE_ENABLED */
-/* #define HAL_MDIOS_MODULE_ENABLED */
-
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)0x0FU) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define ART_ACCLERATOR_ENABLE 1U /* To enable instruction cache and prefetch */
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIOS register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1 */
-
-/* ################## Ethernet peripheral configuration for NUCLEO 144 board ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB ((uint32_t)5) /* 5 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB ((uint32_t)5) /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-/* LAN8742A PHY Address*/
-#define LAN8742A_PHY_ADDRESS 0x00
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY ((uint32_t)0x00000FFF)
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF)
-
-#define PHY_READ_TO ((uint32_t)0x0000FFFF)
-#define PHY_WRITE_TO ((uint32_t)0x0000FFFF)
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x1F) /*!< PHY special control/ status register Offset */
-
-#define PHY_SPEED_STATUS ((uint16_t)0x0004) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0010) /*!< PHY Duplex mask */
-
-
-#define PHY_ISFR ((uint16_t)0x1D) /*!< PHY Interrupt Source Flag register Offset */
-#define PHY_ISFR_INT4 ((uint16_t)0x0010) /*!< PHY Link down inturrupt */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f7xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f7xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f7xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f7xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f7xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f7xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "stm32f7xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f7xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f7xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f7xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f7xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f7xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f7xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f7xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f7xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f7xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f7xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f7xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f7xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f7xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f7xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f7xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f7xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f7xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f7xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f7xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f7xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f7xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f7xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f7xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f7xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f7xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f7xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f7xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f7xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f7xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f7xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f7xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f7xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f7xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f7xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f7xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f7xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_JPEG_MODULE_ENABLED
- #include "stm32f7xx_hal_jpeg.h"
-#endif /* HAL_JPEG_MODULE_ENABLED */
-
-#ifdef HAL_MDIOS_MODULE_ENABLED
- #include "stm32f7xx_hal_mdios.h"
-#endif /* HAL_MDIOS_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F7xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/STM32F767ZITx_FLASH.ld b/tinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/STM32F767ZITx_FLASH.ld
deleted file mode 100755
index 0b6d5a49..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/STM32F767ZITx_FLASH.ld
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F767ZITx Device with
-** 2048KByte FLASH, 512KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20080000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/board.h b/tinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/board.h
deleted file mode 100755
index 1283f231..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/board.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define LED_PORT GPIOB
-#define LED_PIN GPIO_PIN_14
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT GPIOC
-#define BUTTON_PIN GPIO_PIN_13
-#define BUTTON_STATE_ACTIVE 1
-
-#define UART_DEV USART3
-#define UART_CLK_EN __HAL_RCC_USART3_CLK_ENABLE
-#define UART_GPIO_AF GPIO_AF7_USART3
-
-#define UART_TX_PORT GPIOD
-#define UART_TX_PIN GPIO_PIN_8
-
-#define UART_RX_PORT GPIOD
-#define UART_RX_PIN GPIO_PIN_9
-
-// VBUS Sense detection
-#define OTG_FS_VBUS_SENSE 1
-#define OTG_HS_VBUS_SENSE 0
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 432;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
- RCC_OscInitStruct.PLL.PLLQ = 9;
- RCC_OscInitStruct.PLL.PLLR = 7;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Activate the OverDrive to reach the 216 MHz Frequency */
- HAL_PWREx_EnableOverDrive();
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
-
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7);
-}
-
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/board.mk b/tinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/board.mk
deleted file mode 100755
index 2400a4ba..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/board.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-PORT ?= 0
-SPEED ?= full
-
-CFLAGS += \
- -DSTM32F767xx \
- -DHSE_VALUE=8000000 \
-
-LD_FILE = $(BOARD_PATH)/STM32F767ZITx_FLASH.ld
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f767xx.s
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/stm32f7xx_hal_conf.h b/tinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/stm32f7xx_hal_conf.h
deleted file mode 100755
index 234191b0..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f767nucleo/stm32f7xx_hal_conf.h
+++ /dev/null
@@ -1,472 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f7xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F7xx_HAL_CONF_H
-#define __STM32F7xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_PCD_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-/* #define HAL_JPEG_MODULE_ENABLED */
-/* #define HAL_MDIOS_MODULE_ENABLED */
-
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)0x0FU) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define ART_ACCLERATOR_ENABLE 1U /* To enable instruction cache and prefetch */
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIOS register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1 */
-
-/* ################## Ethernet peripheral configuration for NUCLEO 144 board ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB ((uint32_t)5) /* 5 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB ((uint32_t)5) /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-/* LAN8742A PHY Address*/
-#define LAN8742A_PHY_ADDRESS 0x00
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY ((uint32_t)0x00000FFF)
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF)
-
-#define PHY_READ_TO ((uint32_t)0x0000FFFF)
-#define PHY_WRITE_TO ((uint32_t)0x0000FFFF)
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x1F) /*!< PHY special control/ status register Offset */
-
-#define PHY_SPEED_STATUS ((uint16_t)0x0004) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0010) /*!< PHY Duplex mask */
-
-
-#define PHY_ISFR ((uint16_t)0x1D) /*!< PHY Interrupt Source Flag register Offset */
-#define PHY_ISFR_INT4 ((uint16_t)0x0010) /*!< PHY Link down inturrupt */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f7xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f7xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f7xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f7xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f7xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f7xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "stm32f7xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f7xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f7xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f7xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f7xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f7xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f7xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f7xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f7xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f7xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f7xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f7xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f7xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f7xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f7xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f7xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f7xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f7xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f7xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f7xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f7xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f7xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f7xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f7xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f7xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f7xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f7xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f7xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f7xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f7xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f7xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f7xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f7xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f7xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f7xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f7xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f7xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_JPEG_MODULE_ENABLED
- #include "stm32f7xx_hal_jpeg.h"
-#endif /* HAL_JPEG_MODULE_ENABLED */
-
-#ifdef HAL_MDIOS_MODULE_ENABLED
- #include "stm32f7xx_hal_mdios.h"
-#endif /* HAL_MDIOS_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F7xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f769disco/STM32F769ZITx_FLASH.ld b/tinyusb/hw/bsp/stm32f7/boards/stm32f769disco/STM32F769ZITx_FLASH.ld
deleted file mode 100755
index 378ed80d..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f769disco/STM32F769ZITx_FLASH.ld
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F767ZITx Device with
-** 2048KByte FLASH, 512KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20080000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f769disco/board.h b/tinyusb/hw/bsp/stm32f7/boards/stm32f769disco/board.h
deleted file mode 100755
index 5ec217f5..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f769disco/board.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define LED_PORT GPIOJ
-#define LED_PIN GPIO_PIN_12
-#define LED_STATE_ON 5
-
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-#define UART_DEV USART1
-#define UART_CLK_EN __HAL_RCC_USART1_CLK_ENABLE
-#define UART_GPIO_AF GPIO_AF7_USART1
-
-#define UART_TX_PORT GPIOA
-#define UART_TX_PIN GPIO_PIN_9
-
-#define UART_RX_PORT GPIOA
-#define UART_RX_PIN GPIO_PIN_10
-
-// VBUS Sense detection
-#define OTG_FS_VBUS_SENSE 1
-#define OTG_HS_VBUS_SENSE 0
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* Enable Power Control clock */
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 432;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
- RCC_OscInitStruct.PLL.PLLQ = 9;
- RCC_OscInitStruct.PLL.PLLR = 7;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Activate the OverDrive to reach the 216 MHz Frequency */
- HAL_PWREx_EnableOverDrive();
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
-
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7);
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* BOARD_H_ */
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f769disco/board.mk b/tinyusb/hw/bsp/stm32f7/boards/stm32f769disco/board.mk
deleted file mode 100755
index 45b4a78c..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f769disco/board.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-# Only OTG-HS has a connector on this board
-PORT ?= 1
-SPEED ?= high
-
-CFLAGS += \
- -DSTM32F769xx \
- -DHSE_VALUE=25000000 \
-
-LD_FILE = $(BOARD_PATH)/STM32F769ZITx_FLASH.ld
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32f769xx.s
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32f7/boards/stm32f769disco/stm32f7xx_hal_conf.h b/tinyusb/hw/bsp/stm32f7/boards/stm32f769disco/stm32f7xx_hal_conf.h
deleted file mode 100755
index 581f0e46..00000000
--- a/tinyusb/hw/bsp/stm32f7/boards/stm32f769disco/stm32f7xx_hal_conf.h
+++ /dev/null
@@ -1,472 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32f7xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration file.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32F7xx_HAL_CONF_H
-#define __STM32F7xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_PCD_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-/* #define HAL_JPEG_MODULE_ENABLED */
-/* #define HAL_MDIOS_MODULE_ENABLED */
-
-
-/* ########################## HSE/HSI Values adaptation ##################### */
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE ((uint32_t)25000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature. */
-/**
- * @brief External Low Speed oscillator (LSE) value.
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)0x0FU) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define ART_ACCLERATOR_ENABLE 1U /* To enable instruction cache and prefetch */
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
-#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIOS register callback disabled */
-#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
-#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1 */
-
-/* ################## Ethernet peripheral configuration for NUCLEO 144 board ##################### */
-
-/* Section 1 : Ethernet peripheral configuration */
-
-/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
-#define MAC_ADDR0 2U
-#define MAC_ADDR1 0U
-#define MAC_ADDR2 0U
-#define MAC_ADDR3 0U
-#define MAC_ADDR4 0U
-#define MAC_ADDR5 0U
-
-/* Definition of the Ethernet driver buffers size and count */
-#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
-#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
-#define ETH_RXBUFNB ((uint32_t)5) /* 5 Rx buffers of size ETH_RX_BUF_SIZE */
-#define ETH_TXBUFNB ((uint32_t)5) /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
-
-/* Section 2: PHY configuration section */
-/* LAN8742A PHY Address*/
-#define LAN8742A_PHY_ADDRESS 0x00
-/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
-#define PHY_RESET_DELAY ((uint32_t)0x00000FFF)
-/* PHY Configuration delay */
-#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF)
-
-#define PHY_READ_TO ((uint32_t)0x0000FFFF)
-#define PHY_WRITE_TO ((uint32_t)0x0000FFFF)
-
-/* Section 3: Common PHY Registers */
-
-#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */
-#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */
-
-#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
-#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
-#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
-#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
-#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
-#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
-#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
-#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
-#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
-#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
-
-#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
-#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
-#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
-
-/* Section 4: Extended PHY Registers */
-
-#define PHY_SR ((uint16_t)0x1F) /*!< PHY special control/ status register Offset */
-
-#define PHY_SPEED_STATUS ((uint16_t)0x0004) /*!< PHY Speed mask */
-#define PHY_DUPLEX_STATUS ((uint16_t)0x0010) /*!< PHY Duplex mask */
-
-
-#define PHY_ISFR ((uint16_t)0x1D) /*!< PHY Interrupt Source Flag register Offset */
-#define PHY_ISFR_INT4 ((uint16_t)0x0010) /*!< PHY Link down inturrupt */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
-* Activated: CRC code is present inside driver
-* Deactivated: CRC code cleaned from driver
-*/
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32f7xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32f7xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32f7xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32f7xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32f7xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32f7xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "stm32f7xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32f7xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32f7xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32f7xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32f7xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32f7xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32f7xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32f7xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32f7xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32f7xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32f7xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32f7xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32f7xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32f7xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32f7xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32f7xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32f7xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
- #include "stm32f7xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
- #include "stm32f7xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32f7xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32f7xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32f7xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32f7xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32f7xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32f7xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32f7xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32f7xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32f7xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32f7xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32f7xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32f7xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32f7xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32f7xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32f7xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32f7xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32f7xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32f7xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_JPEG_MODULE_ENABLED
- #include "stm32f7xx_hal_jpeg.h"
-#endif /* HAL_JPEG_MODULE_ENABLED */
-
-#ifdef HAL_MDIOS_MODULE_ENABLED
- #include "stm32f7xx_hal_mdios.h"
-#endif /* HAL_MDIOS_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t* file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32F7xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32f7/family.c b/tinyusb/hw/bsp/stm32f7/family.c
deleted file mode 100755
index c0d32459..00000000
--- a/tinyusb/hw/bsp/stm32f7/family.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 William D. Jones (thor0505@comcast.net),
- * Uwe Bonnes (bon@elektron.ikp.physik.tu-darmstadt.de),
- * Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "stm32f7xx_hal.h"
-#include "bsp/board.h"
-#include "board.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void OTG_FS_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-// Despite being call USB2_OTG
-// OTG_HS is marked as RHPort1 by TinyUSB to be consistent across stm32 port
-void OTG_HS_IRQHandler(void)
-{
- tud_int_handler(1);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-UART_HandleTypeDef UartHandle;
-
-void board_init(void)
-{
- board_clock_init();
-
- // Enable All GPIOs clocks
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOB_CLK_ENABLE();
- __HAL_RCC_GPIOC_CLK_ENABLE();
- __HAL_RCC_GPIOD_CLK_ENABLE();
- __HAL_RCC_GPIOG_CLK_ENABLE();
- __HAL_RCC_GPIOH_CLK_ENABLE(); // ULPI NXT
- __HAL_RCC_GPIOI_CLK_ENABLE(); // ULPI NXT
-
-#ifdef __HAL_RCC_GPIOJ_CLK_ENABLE
- __HAL_RCC_GPIOJ_CLK_ENABLE();
-#endif
-
- UART_CLK_EN();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#endif
-
- GPIO_InitTypeDef GPIO_InitStruct;
-
- // LED
- GPIO_InitStruct.Pin = LED_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
-
- // Button
- GPIO_InitStruct.Pin = BUTTON_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
-
- // Uart TX
- GPIO_InitStruct.Pin = UART_TX_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- GPIO_InitStruct.Alternate = UART_GPIO_AF;
- HAL_GPIO_Init(UART_TX_PORT, &GPIO_InitStruct);
-
- // Uart RX
- GPIO_InitStruct.Pin = UART_RX_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- GPIO_InitStruct.Alternate = UART_GPIO_AF;
- HAL_GPIO_Init(UART_RX_PORT, &GPIO_InitStruct);
-
- UartHandle.Instance = UART_DEV;
- UartHandle.Init.BaudRate = CFG_BOARD_UART_BAUDRATE;
- UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
- UartHandle.Init.StopBits = UART_STOPBITS_1;
- UartHandle.Init.Parity = UART_PARITY_NONE;
- UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
- UartHandle.Init.Mode = UART_MODE_TX_RX;
- UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
- HAL_UART_Init(&UartHandle);
-
-#if BOARD_DEVICE_RHPORT_NUM == 0
- // OTG_FS
-
- /* Configure DM DP Pins */
- GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12);
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* Configure OTG-FS ID pin */
- GPIO_InitStruct.Pin = GPIO_PIN_10;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* Enable USB FS Clocks */
- __HAL_RCC_USB_OTG_FS_CLK_ENABLE();
-
-#if OTG_FS_VBUS_SENSE
- /* Configure VBUS Pin */
- GPIO_InitStruct.Pin = GPIO_PIN_9;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- // Enable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN;
-#else
- // Disable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBDEN;
-
- // B-peripheral session valid override enable
- USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOEN;
- USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL;
-#endif // vbus sense
-
-#else
- // OTG_HS
-
- #ifdef USB_HS_PHYC
- // MCU with built-in HS PHY such as F723, F733, F730
-
- /* Configure DM DP Pins */
- GPIO_InitStruct.Pin = (GPIO_PIN_14 | GPIO_PIN_15);
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
- HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
-
- // Enable HS VBUS sense (B device) via pin PB13
- USB_OTG_HS->GCCFG |= USB_OTG_GCCFG_VBDEN;
-
- /* Configure OTG-HS ID pin */
- GPIO_InitStruct.Pin = GPIO_PIN_13;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
- HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
-
- /* Enable PHYC Clocks */
- __HAL_RCC_OTGPHYC_CLK_ENABLE();
-
- #else
- // MUC with external ULPI PHY
-
- /* ULPI CLK */
- GPIO_InitStruct.Pin = GPIO_PIN_5;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* ULPI D0 */
- GPIO_InitStruct.Pin = GPIO_PIN_3;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* ULPI D1 D2 D3 D4 D5 D6 D7 */
- GPIO_InitStruct.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_5;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
- HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
-
- /* ULPI STP */
- GPIO_InitStruct.Pin = GPIO_PIN_0 | GPIO_PIN_2;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
- HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
-
- /* NXT */
- GPIO_InitStruct.Pin = GPIO_PIN_4;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
- HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
-
- /* ULPI DIR */
- GPIO_InitStruct.Pin = GPIO_PIN_11;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
- HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);
- #endif // USB_HS_PHYC
-
- // Enable USB HS & ULPI Clocks
- __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE();
- __HAL_RCC_USB_OTG_HS_CLK_ENABLE();
-
-#if OTG_HS_VBUS_SENSE
- #error OTG HS VBUS Sense enabled is not implemented
-#else
- // No VBUS sense
- USB_OTG_HS->GCCFG &= ~USB_OTG_GCCFG_VBDEN;
-
- // B-peripheral session valid override enable
- USB_OTG_HS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOEN;
- USB_OTG_HS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL;
-#endif
-
- // Force device mode
- USB_OTG_HS->GUSBCFG &= ~USB_OTG_GUSBCFG_FHMOD;
- USB_OTG_HS->GUSBCFG |= USB_OTG_GUSBCFG_FDMOD;
-
-#endif // BOARD_DEVICE_RHPORT_NUM
-
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-void HardFault_Handler (void)
-{
- asm("bkpt");
-}
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/stm32f7/family.mk b/tinyusb/hw/bsp/stm32f7/family.mk
deleted file mode 100755
index ead0c977..00000000
--- a/tinyusb/hw/bsp/stm32f7/family.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-UF2_FAMILY_ID = 0x53b80f00
-ST_FAMILY = f7
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
-ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m7 \
- -mfloat-abi=hard \
- -mfpu=fpv5-d16 \
- -nostdlib -nostartfiles \
- -DCFG_TUSB_MCU=OPT_MCU_STM32F7 \
- -DBOARD_DEVICE_RHPORT_NUM=$(PORT)
-
-ifeq ($(PORT), 1)
- ifeq ($(SPEED), high)
- CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
- $(info "Using OTG_HS in HighSpeed mode")
- else
- CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_FULL_SPEED
- $(info "Using OTG_HS in FullSpeed mode")
- endif
-else
- $(info "Using OTG_FS")
-endif
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=shadow -Wno-error=cast-align
-
-SRC_C += \
- src/portable/st/synopsys/dcd_synopsys.c \
- $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_uart.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_pwr_ex.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM7/r0p1
diff --git a/tinyusb/hw/bsp/stm32h7/boards/stm32h743eval/board.h b/tinyusb/hw/bsp/stm32h7/boards/stm32h743eval/board.h
deleted file mode 100755
index ab263d2b..00000000
--- a/tinyusb/hw/bsp/stm32h7/boards/stm32h743eval/board.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define LED_PORT GPIOA
-#define LED_PIN GPIO_PIN_4
-#define LED_STATE_ON 1
-
-// Tamper push-button
-#define BUTTON_PORT GPIOC
-#define BUTTON_PIN GPIO_PIN_13
-#define BUTTON_STATE_ACTIVE 0
-
-// Need to change jumper setting J7 and J8 from RS-232 to STLink
-#define UART_DEV USART1
-#define UART_CLK_EN __HAL_RCC_USART1_CLK_ENABLE
-#define UART_GPIO_PORT GPIOB
-#define UART_GPIO_AF GPIO_AF4_USART1
-#define UART_TX_PIN GPIO_PIN_14
-#define UART_RX_PIN GPIO_PIN_15
-
-// VBUS Sense detection
-#define OTG_FS_VBUS_SENSE 1
-#define OTG_HS_VBUS_SENSE 0
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_stm32h7_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
- RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
-
- /*!< Supply configuration update enable */
- HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
-
- /* The voltage scaling allows optimizing the power consumption when the device is
- clocked below the maximum system frequency, to update the voltage scaling value
- regarding system frequency refer to product datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
-
- while ((PWR->D3CR & (PWR_D3CR_VOSRDY)) != PWR_D3CR_VOSRDY) {}
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.HSIState = RCC_HSI_OFF;
- RCC_OscInitStruct.CSIState = RCC_CSI_OFF;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
-
- /* PLL1 for System Clock */
- RCC_OscInitStruct.PLL.PLLM = 5;
- RCC_OscInitStruct.PLL.PLLN = 160;
- RCC_OscInitStruct.PLL.PLLFRACN = 0;
- RCC_OscInitStruct.PLL.PLLP = 2;
- RCC_OscInitStruct.PLL.PLLR = 2;
- RCC_OscInitStruct.PLL.PLLQ = 4;
-
- RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOMEDIUM;
- RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_2;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* PLL3 for USB Clock */
- PeriphClkInitStruct.PLL3.PLL3M = 25;
- PeriphClkInitStruct.PLL3.PLL3N = 336;
- PeriphClkInitStruct.PLL3.PLL3FRACN = 0;
- PeriphClkInitStruct.PLL3.PLL3P = 2;
- PeriphClkInitStruct.PLL3.PLL3R = 2;
- PeriphClkInitStruct.PLL3.PLL3Q = 7;
-
- PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
- PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL3;
- HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
-
- /* Select PLL as system clock source and configure bus clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_D1PCLK1 | RCC_CLOCKTYPE_PCLK1 | \
- RCC_CLOCKTYPE_PCLK2 | RCC_CLOCKTYPE_D3PCLK1);
-
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2;
- RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV1;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4);
-
- /*activate CSI clock mondatory for I/O Compensation Cell*/
- __HAL_RCC_CSI_ENABLE() ;
-
- /* Enable SYSCFG clock mondatory for I/O Compensation Cell */
- __HAL_RCC_SYSCFG_CLK_ENABLE() ;
-
- /* Enables the I/O Compensation Cell */
- HAL_EnableCompensationCell();
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/stm32h7/boards/stm32h743eval/board.mk b/tinyusb/hw/bsp/stm32h7/boards/stm32h743eval/board.mk
deleted file mode 100755
index 96d14a79..00000000
--- a/tinyusb/hw/bsp/stm32h7/boards/stm32h743eval/board.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-CFLAGS += -DSTM32H743xx -DHSE_VALUE=25000000
-
-# Default is Highspeed port
-PORT ?= 1
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32h743xx.s
-LD_FILE = $(BOARD_PATH)/stm32h743xx_flash.ld
-
-# For flash-jlink target
-JLINK_DEVICE = stm32h743xi
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32h7/boards/stm32h743eval/stm32h743xx_flash.ld b/tinyusb/hw/bsp/stm32h7/boards/stm32h743eval/stm32h743xx_flash.ld
deleted file mode 100755
index 59b9ff4d..00000000
--- a/tinyusb/hw/bsp/stm32h7/boards/stm32h743eval/stm32h743xx_flash.ld
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32H743XIHx Device with
-** 2048KByte FLASH, 128KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20020000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
-RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
-RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
-RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
-ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >DTCMRAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >DTCMRAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >DTCMRAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32h7/boards/stm32h743nucleo/board.h b/tinyusb/hw/bsp/stm32h7/boards/stm32h743nucleo/board.h
deleted file mode 100755
index 3a31783a..00000000
--- a/tinyusb/hw/bsp/stm32h7/boards/stm32h743nucleo/board.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define LED_PORT GPIOB
-#define LED_PIN GPIO_PIN_0
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT GPIOC
-#define BUTTON_PIN GPIO_PIN_13
-#define BUTTON_STATE_ACTIVE 1
-
-#define UART_DEV USART3
-#define UART_CLK_EN __HAL_RCC_USART3_CLK_ENABLE
-#define UART_GPIO_PORT GPIOD
-#define UART_GPIO_AF GPIO_AF7_USART3
-#define UART_TX_PIN GPIO_PIN_8
-#define UART_RX_PIN GPIO_PIN_9
-
-// VBUS Sense detection
-#define OTG_FS_VBUS_SENSE 1
-#define OTG_HS_VBUS_SENSE 0
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_stm32h7_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
-
- /* The PWR block is always enabled on the H7 series- there is no clock
- enable. For now, use the default VOS3 scale mode (lowest) and limit clock
- frequencies to avoid potential current draw problems from bus
- power when using the max clock speeds throughout the chip. */
-
- /* Enable HSE Oscillator and activate PLL1 with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.HSIState = RCC_HSI_OFF;
- RCC_OscInitStruct.CSIState = RCC_CSI_OFF;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000;
- RCC_OscInitStruct.PLL.PLLN = 336;
- RCC_OscInitStruct.PLL.PLLP = 2;
- RCC_OscInitStruct.PLL.PLLQ = 7;
- RCC_OscInitStruct.PLL.PLLR = 2; /* Unused */
- RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_0;
- RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOMEDIUM;
- RCC_OscInitStruct.PLL.PLLFRACN = 0;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | \
- RCC_CLOCKTYPE_D1PCLK1 | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2 | \
- RCC_CLOCKTYPE_D3PCLK1);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1;
-
- /* Unlike on the STM32F4 family, it appears the maximum APB frequencies are
- device-dependent- 120 MHz for this board according to Figure 2 of
- the datasheet. Dividing by half will be safe for now. */
- RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2;
- RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2;
-
- /* 4 wait states required for 168MHz and VOS3. */
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4);
-
- /* Like on F4, on H7, USB's actual peripheral clock and bus clock are
- separate. However, the main system PLL (PLL1) doesn't have a direct
- connection to the USB peripheral clock to generate 48 MHz, so we do this
- dance. This will connect PLL1's Q output to the USB peripheral clock. */
- RCC_PeriphCLKInitTypeDef RCC_PeriphCLKInitStruct;
-
- RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
- RCC_PeriphCLKInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL;
- HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct);
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/stm32h7/boards/stm32h743nucleo/board.mk b/tinyusb/hw/bsp/stm32h7/boards/stm32h743nucleo/board.mk
deleted file mode 100755
index fc670fe7..00000000
--- a/tinyusb/hw/bsp/stm32h7/boards/stm32h743nucleo/board.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-CFLAGS += -DSTM32H743xx -DHSE_VALUE=8000000
-
-# Default is FulSpeed port
-PORT ?= 0
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32h743xx.s
-LD_FILE = $(BOARD_PATH)/stm32h743xx_flash.ld
-
-# For flash-jlink target
-JLINK_DEVICE = stm32h743zi
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32h7/boards/stm32h743nucleo/stm32h743xx_flash.ld b/tinyusb/hw/bsp/stm32h7/boards/stm32h743nucleo/stm32h743xx_flash.ld
deleted file mode 100755
index 59b9ff4d..00000000
--- a/tinyusb/hw/bsp/stm32h7/boards/stm32h743nucleo/stm32h743xx_flash.ld
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32H743XIHx Device with
-** 2048KByte FLASH, 128KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20020000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
-RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
-RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
-RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
-ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >DTCMRAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >DTCMRAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >DTCMRAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32h7/boards/stm32h745disco/board.h b/tinyusb/hw/bsp/stm32h7/boards/stm32h745disco/board.h
deleted file mode 100755
index 30a7a9ff..00000000
--- a/tinyusb/hw/bsp/stm32h7/boards/stm32h745disco/board.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef BOARD_H_
-#define BOARD_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define LED_PORT GPIOJ
-#define LED_PIN GPIO_PIN_2
-#define LED_STATE_ON 1
-
-// Blue push-button
-#define BUTTON_PORT GPIOC
-#define BUTTON_PIN GPIO_PIN_13
-#define BUTTON_STATE_ACTIVE 1
-
-// UART
-#define UART_DEV USART3
-#define UART_CLK_EN __HAL_RCC_USART3_CLK_ENABLE
-#define UART_GPIO_PORT GPIOB
-#define UART_GPIO_AF GPIO_AF7_USART3
-#define UART_TX_PIN GPIO_PIN_10
-#define UART_RX_PIN GPIO_PIN_11
-
-// VBUS Sense detection
-#define OTG_FS_VBUS_SENSE 1
-#define OTG_HS_VBUS_SENSE 0
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_stm32h7_clock_init(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
- RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
-
- /*!< Supply configuration update enable */
- /* For STM32H750XB, use "HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);" */
- HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY);
-
- /* The voltage scaling allows optimizing the power consumption when the
- device is clocked below the maximum system frequency, to update the
- voltage scaling value regarding system frequency refer to product
- datasheet. */
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
-
- while ((PWR->D3CR & (PWR_D3CR_VOSRDY)) != PWR_D3CR_VOSRDY) {}
-
- /* Enable HSE Oscillator and activate PLL with HSE as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
- RCC_OscInitStruct.HSIState = RCC_HSI_OFF;
- RCC_OscInitStruct.CSIState = RCC_CSI_OFF;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
-
- /* PLL1 for System Clock */
- RCC_OscInitStruct.PLL.PLLM = 5;
- RCC_OscInitStruct.PLL.PLLN = 160;
- RCC_OscInitStruct.PLL.PLLFRACN = 0;
- RCC_OscInitStruct.PLL.PLLP = 2;
- RCC_OscInitStruct.PLL.PLLR = 2;
- RCC_OscInitStruct.PLL.PLLQ = 4;
-
- RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOMEDIUM;
- RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_2;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* PLL3 for USB Clock */
- PeriphClkInitStruct.PLL3.PLL3M = 25;
- PeriphClkInitStruct.PLL3.PLL3N = 336;
- PeriphClkInitStruct.PLL3.PLL3FRACN = 0;
- PeriphClkInitStruct.PLL3.PLL3P = 2;
- PeriphClkInitStruct.PLL3.PLL3R = 2;
- PeriphClkInitStruct.PLL3.PLL3Q = 7;
-
- PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
- PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL3;
- HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
-
- /* Select PLL as system clock source and configure bus clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_D1PCLK1 | RCC_CLOCKTYPE_PCLK1 | \
- RCC_CLOCKTYPE_PCLK2 | RCC_CLOCKTYPE_D3PCLK1);
-
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2;
- RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV1;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4);
-
- /*activate CSI clock mondatory for I/O Compensation Cell*/
- __HAL_RCC_CSI_ENABLE() ;
-
- /* Enable SYSCFG clock mondatory for I/O Compensation Cell */
- __HAL_RCC_SYSCFG_CLK_ENABLE() ;
-
- /* Enables the I/O Compensation Cell */
- HAL_EnableCompensationCell();
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/hw/bsp/stm32h7/boards/stm32h745disco/board.mk b/tinyusb/hw/bsp/stm32h7/boards/stm32h745disco/board.mk
deleted file mode 100755
index 384065bd..00000000
--- a/tinyusb/hw/bsp/stm32h7/boards/stm32h745disco/board.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# STM32H745I-DISCO uses OTG_FS
-# FIXME: Reset enumerates, un/replug USB plug does not enumerate
-
-CFLAGS += -DSTM32H745xx -DCORE_CM7 -DHSE_VALUE=25000000
-
-# Default is FulSpeed port
-PORT ?= 0
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32h745xx.s
-LD_FILE = $(ST_CMSIS)/Source/Templates/gcc/linker/stm32h745xx_flash_CM7.ld
-
-# For flash-jlink target
-JLINK_DEVICE = stm32h745xi_m7
-
-# flash target using on-board stlink
-flash: flash-stlink
-
diff --git a/tinyusb/hw/bsp/stm32h7/family.c b/tinyusb/hw/bsp/stm32h7/family.c
deleted file mode 100755
index 2cbd8741..00000000
--- a/tinyusb/hw/bsp/stm32h7/family.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019
- * William D. Jones (thor0505@comcast.net),
- * Ha Thach (tinyusb.org)
- * Uwe Bonnes (bon@elektron.ikp.physik.tu-darmstadt.de
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "stm32h7xx_hal.h"
-#include "bsp/board.h"
-#include "board.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-
-// Despite being call USB2_OTG
-// OTG_FS is marked as RHPort0 by TinyUSB to be consistent across stm32 port
-void OTG_FS_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-// Despite being call USB2_OTG
-// OTG_HS is marked as RHPort1 by TinyUSB to be consistent across stm32 port
-void OTG_HS_IRQHandler(void)
-{
- tud_int_handler(1);
-}
-
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-UART_HandleTypeDef UartHandle;
-
-void board_init(void)
-{
- board_stm32h7_clock_init();
-
- // Enable All GPIOs clocks
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOB_CLK_ENABLE(); // USB ULPI NXT
- __HAL_RCC_GPIOC_CLK_ENABLE(); // USB ULPI NXT
- __HAL_RCC_GPIOD_CLK_ENABLE();
- __HAL_RCC_GPIOE_CLK_ENABLE();
- __HAL_RCC_GPIOE_CLK_ENABLE();
- __HAL_RCC_GPIOG_CLK_ENABLE();
- __HAL_RCC_GPIOH_CLK_ENABLE(); // USB ULPI NXT
- __HAL_RCC_GPIOI_CLK_ENABLE(); // USB ULPI NXT
- __HAL_RCC_GPIOJ_CLK_ENABLE();
-
- // Enable UART Clock
- UART_CLK_EN();
-
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(OTG_FS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
- NVIC_SetPriority(OTG_HS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- GPIO_InitTypeDef GPIO_InitStruct;
-
- // LED
- GPIO_InitStruct.Pin = LED_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
-
- // Button
- GPIO_InitStruct.Pin = BUTTON_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
-
- // Uart
- GPIO_InitStruct.Pin = UART_TX_PIN | UART_RX_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- GPIO_InitStruct.Alternate = UART_GPIO_AF;
- HAL_GPIO_Init(UART_GPIO_PORT, &GPIO_InitStruct);
-
- UartHandle.Instance = UART_DEV;
- UartHandle.Init.BaudRate = CFG_BOARD_UART_BAUDRATE;
- UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
- UartHandle.Init.StopBits = UART_STOPBITS_1;
- UartHandle.Init.Parity = UART_PARITY_NONE;
- UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
- UartHandle.Init.Mode = UART_MODE_TX_RX;
- UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
- HAL_UART_Init(&UartHandle);
-
-#if BOARD_DEVICE_RHPORT_NUM == 0
- // Despite being call USB2_OTG
- // OTG_FS is marked as RHPort0 by TinyUSB to be consistent across stm32 port
- // PA9 VUSB, PA10 ID, PA11 DM, PA12 DP
-
- /* Configure DM DP Pins */
- GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* This for ID line debug */
- GPIO_InitStruct.Pin = GPIO_PIN_10;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- // https://community.st.com/s/question/0D50X00009XkYZLSA3/stm32h7-nucleo-usb-fs-cdc
- // TODO: Board init actually works fine without this line.
- HAL_PWREx_EnableUSBVoltageDetector();
- __HAL_RCC_USB2_OTG_FS_CLK_ENABLE();
-
-#if OTG_FS_VBUS_SENSE
- /* Configure VBUS Pin */
- GPIO_InitStruct.Pin = GPIO_PIN_9;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- // Enable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN;
-#else
- // Disable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBDEN;
-
- // B-peripheral session valid override enable
- USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOEN;
- USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL;
-#endif // vbus sense
-
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- // Despite being call USB2_OTG
- // OTG_HS is marked as RHPort1 by TinyUSB to be consistent across stm32 port
-
- /* CLK */
- GPIO_InitStruct.Pin = GPIO_PIN_5;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* D0 */
- GPIO_InitStruct.Pin = GPIO_PIN_3;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* D1 D2 D3 D4 D5 D6 D7 */
- GPIO_InitStruct.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_5 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
-
- /* STP */
- GPIO_InitStruct.Pin = GPIO_PIN_0;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
-
- /* NXT */
- GPIO_InitStruct.Pin = GPIO_PIN_4;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
-
- /* DIR */
- GPIO_InitStruct.Pin = GPIO_PIN_11;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);
-
- // Enable USB HS & ULPI Clocks
- __HAL_RCC_USB1_OTG_HS_ULPI_CLK_ENABLE();
- __HAL_RCC_USB1_OTG_HS_CLK_ENABLE();
-
-#if OTG_HS_VBUS_SENSE
- #error OTG HS VBUS Sense enabled is not implemented
-#else
- // No VBUS sense
- USB_OTG_HS->GCCFG &= ~USB_OTG_GCCFG_VBDEN;
-
- // B-peripheral session valid override enable
- USB_OTG_HS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOEN;
- USB_OTG_HS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL;
-#endif
-
- // Force device mode
- USB_OTG_HS->GUSBCFG &= ~USB_OTG_GUSBCFG_FHMOD;
- USB_OTG_HS->GUSBCFG |= USB_OTG_GUSBCFG_FDMOD;
-
- HAL_PWREx_EnableUSBVoltageDetector();
-#endif // rhport = 1
-
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return (BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN)) ? 1 : 0;
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
- return len;
-}
-
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-void HardFault_Handler (void)
-{
- asm("bkpt");
-}
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/stm32h7/family.mk b/tinyusb/hw/bsp/stm32h7/family.mk
deleted file mode 100755
index e35e7561..00000000
--- a/tinyusb/hw/bsp/stm32h7/family.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-UF2_FAMILY_ID = 0x6db66082
-ST_FAMILY = h7
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
-ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-include $(TOP)/$(BOARD_PATH)/board.mk
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m7 \
- -mfloat-abi=hard \
- -mfpu=fpv5-d16 \
- -nostdlib -nostartfiles \
- -DCFG_TUSB_MCU=OPT_MCU_STM32H7 \
- -DBOARD_DEVICE_RHPORT_NUM=$(PORT)
-
-ifeq ($(PORT), 1)
- CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
- $(info "PORT1 High Speed")
-else
- $(info "PORT0 Full Speed")
-endif
-
-# suppress warning caused by vendor mcu driver
-CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=cast-align
-
-# All source paths should be relative to the top level.
-SRC_C += \
- src/portable/st/synopsys/dcd_synopsys.c \
- $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_uart.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_pwr_ex.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM7/r0p1
-
diff --git a/tinyusb/hw/bsp/stm32h7/stm32h7xx_hal_conf.h b/tinyusb/hw/bsp/stm32h7/stm32h7xx_hal_conf.h
deleted file mode 100755
index a7cc6d82..00000000
--- a/tinyusb/hw/bsp/stm32h7/stm32h7xx_hal_conf.h
+++ /dev/null
@@ -1,483 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32h7xx_hal_conf_template.h
- * @brief HAL configuration template file.
- * This file should be copied to the application folder and renamed
- * to stm32h7xx_hal_conf.h.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
- *
- * 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 STMicroelectronics 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.
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32H7xx_HAL_CONF_H
-#define __STM32H7xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_COMP_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-/* #define HAL_EXTI_MODULE_ENABLED */
-/* #define HAL_FDCAN_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_HASH_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_HRTIM_MODULE_ENABLED */
-/* #define HAL_HSEM_MODULE_ENABLED */
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_JPEG_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_MDIOS_MODULE_ENABLED */
-/* #define HAL_MDMA_MODULE_ENABLED */
-/* #define HAL_MMC_MODULE_ENABLED */
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_OPAMP_MODULE_ENABLED */
-/* #define HAL_PCD_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-/* #define HAL_RAMECC_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-#define HAL_SPI_MODULE_ENABLED
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SWPMI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-
-/* ########################## Oscillator Values adaptation ####################*/
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
-//#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
-#error HSE_VALUE is not defined
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal oscillator (CSI) default value.
- * This value is the default CSI value after Reset.
- */
-#if !defined (CSI_VALUE)
- #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
-#endif /* CSI_VALUE */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief External Low Speed oscillator (LSE) value.
- * This value is used by the UART, RTC HAL module to compute the system frequency
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External oscillator in Hz*/
-#endif /* LSE_VALUE */
-
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-#if !defined (LSI_VALUE)
- #define LSI_VALUE ((uint32_t)32000) /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature.*/
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */
-#define USE_RTOS 0
-#define USE_SD_TRANSCEIVER 1U /*!< use uSD Transceiver */
-#define USE_SPI_CRC 1U /*!< use CRC in SPI */
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */
-#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################### Ethernet Configuration ######################### */
-#define ETH_TX_DESC_CNT 4 /* number of Ethernet Tx DMA descriptors */
-#define ETH_RX_DESC_CNT 4 /* number of Ethernet Rx DMA descriptors */
-
-#define ETH_MAC_ADDR0 ((uint8_t)0x02)
-#define ETH_MAC_ADDR1 ((uint8_t)0x00)
-#define ETH_MAC_ADDR2 ((uint8_t)0x00)
-#define ETH_MAC_ADDR3 ((uint8_t)0x00)
-#define ETH_MAC_ADDR4 ((uint8_t)0x00)
-#define ETH_MAC_ADDR5 ((uint8_t)0x00)
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1 */
-
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32h7xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32h7xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32h7xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_MDMA_MODULE_ENABLED
- #include "stm32h7xx_hal_mdma.h"
-#endif /* HAL_MDMA_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32h7xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32h7xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32h7xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32h7xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32h7xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32h7xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32h7xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32h7xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32h7xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_FDCAN_MODULE_ENABLED
- #include "stm32h7xx_hal_fdcan.h"
-#endif /* HAL_FDCAN_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32h7xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_COMP_MODULE_ENABLED
- #include "stm32h7xx_hal_comp.h"
-#endif /* HAL_COMP_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32h7xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32h7xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32h7xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32h7xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_HRTIM_MODULE_ENABLED
- #include "stm32h7xx_hal_hrtim.h"
-#endif /* HAL_HRTIM_MODULE_ENABLED */
-
-#ifdef HAL_HSEM_MODULE_ENABLED
- #include "stm32h7xx_hal_hsem.h"
-#endif /* HAL_HSEM_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32h7xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32h7xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32h7xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32h7xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32h7xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32h7xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_JPEG_MODULE_ENABLED
- #include "stm32h7xx_hal_jpeg.h"
-#endif /* HAL_JPEG_MODULE_ENABLED */
-
-#ifdef HAL_MDIOS_MODULE_ENABLED
- #include "stm32h7xx_hal_mdios.h"
-#endif /* HAL_MDIOS_MODULE_ENABLED */
-
-#ifdef HAL_MMC_MODULE_ENABLED
- #include "stm32h7xx_hal_mmc.h"
-#endif /* HAL_MMC_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
-#include "stm32h7xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
-#include "stm32h7xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_OPAMP_MODULE_ENABLED
-#include "stm32h7xx_hal_opamp.h"
-#endif /* HAL_OPAMP_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32h7xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32h7xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_RAMECC_MODULE_ENABLED
- #include "stm32h7xx_hal_ramecc.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32h7xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32h7xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32h7xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32h7xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32h7xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32h7xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32h7xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_SWPMI_MODULE_ENABLED
- #include "stm32h7xx_hal_swpmi.h"
-#endif /* HAL_SWPMI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32h7xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32h7xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32h7xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32h7xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32h7xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_SMBUS_MODULE_ENABLED
- #include "stm32h7xx_hal_smbus.h"
-#endif /* HAL_SMBUS_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32h7xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32h7xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32h7xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t *file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32H7xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32l0538disco/STM32L053C8Tx_FLASH.ld b/tinyusb/hw/bsp/stm32l0538disco/STM32L053C8Tx_FLASH.ld
deleted file mode 100755
index 787418e0..00000000
--- a/tinyusb/hw/bsp/stm32l0538disco/STM32L053C8Tx_FLASH.ld
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32L053C8Tx Device with
-** 64KByte FLASH, 8KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20002000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x200; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32l0538disco/board.mk b/tinyusb/hw/bsp/stm32l0538disco/board.mk
deleted file mode 100755
index c46887f1..00000000
--- a/tinyusb/hw/bsp/stm32l0538disco/board.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-ST_FAMILY = l0
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
-ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m0plus \
- -mfloat-abi=soft \
- -nostdlib -nostartfiles \
- -DSTM32L053xx \
- -DCFG_EXAMPLE_MSC_READONLY \
- -DCFG_TUSB_MCU=OPT_MCU_STM32L0
-
-# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter -Wno-error=maybe-uninitialized
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/STM32L053C8Tx_FLASH.ld
-
-SRC_C += \
- src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \
- $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c
-
-SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l053xx.s
-
-INC += \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM0
-
-# For flash-jlink target
-JLINK_DEVICE = STM32L053R8
-
-# Path to STM32 Cube Programmer CLI, should be added into system path
-STM32Prog = STM32_Programmer_CLI
-
-# flash target using on-board stlink
-flash: $(BUILD)/$(PROJECT).elf
- $(STM32Prog) --connect port=swd --write $< --go
diff --git a/tinyusb/hw/bsp/stm32l0538disco/stm32l0538disco.c b/tinyusb/hw/bsp/stm32l0538disco/stm32l0538disco.c
deleted file mode 100755
index f0f1d028..00000000
--- a/tinyusb/hw/bsp/stm32l0538disco/stm32l0538disco.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "../board.h"
-#include "stm32l0xx_hal.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void USB_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-#define LED_PORT GPIOA
-#define LED_PIN GPIO_PIN_5
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-/**
- * @brief System Clock Configuration
- * The system Clock is configured as follow:
- * HSI48 used as USB clock source
- * - System Clock source = HSI
- * - HSI Frequency(Hz) = 16000000
- * - SYSCLK(Hz) = 16000000
- * - HCLK(Hz) = 16000000
- * - AHB Prescaler = 1
- * - APB1 Prescaler = 1
- * - APB2 Prescaler = 1
- * - Flash Latency(WS) = 0
- * - Main regulator output voltage = Scale1 mode
- * @param None
- * @retval None
- */
-static void SystemClock_Config(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
- RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
- static RCC_CRSInitTypeDef RCC_CRSInitStruct;
-
- /* Enable HSI Oscillator to be used as System clock source
- Enable HSI48 Oscillator to be used as USB clock source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI48;
- RCC_OscInitStruct.HSIState = RCC_HSI_ON;
- RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Select HSI48 as USB clock source */
- PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
- PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
- HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
-
- /* Select HSI as system clock source and configure the HCLK, PCLK1 and PCLK2
- clock dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0);
-
- /*Configure the clock recovery system (CRS)**********************************/
-
- /*Enable CRS Clock*/
- __HAL_RCC_CRS_CLK_ENABLE();
-
- /* Default Synchro Signal division factor (not divided) */
- RCC_CRSInitStruct.Prescaler = RCC_CRS_SYNC_DIV1;
- /* Set the SYNCSRC[1:0] bits according to CRS_Source value */
- RCC_CRSInitStruct.Source = RCC_CRS_SYNC_SOURCE_USB;
- /* HSI48 is synchronized with USB SOF at 1KHz rate */
- RCC_CRSInitStruct.ReloadValue = __HAL_RCC_CRS_RELOADVALUE_CALCULATE(48000000, 1000);
- RCC_CRSInitStruct.ErrorLimitValue = RCC_CRS_ERRORLIMIT_DEFAULT;
- /* Set the TRIM[5:0] to the default value*/
- RCC_CRSInitStruct.HSI48CalibrationValue = 0x20;
- /* Start automatic synchronization */
- HAL_RCCEx_CRSConfig (&RCC_CRSInitStruct);
-}
-
-void board_init(void)
-{
- SystemClock_Config();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- //NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- GPIO_InitTypeDef GPIO_InitStruct;
-
- // LED
- __HAL_RCC_GPIOA_CLK_ENABLE();
- GPIO_InitStruct.Pin = LED_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
-
- board_led_write(false);
-
- // Button
- //__HAL_RCC_GPIOA_CLK_ENABLE();
- GPIO_InitStruct.Pin = BUTTON_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_PULLDOWN;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
-
- // USB
- /* Configure DM DP Pins */
- __HAL_RCC_GPIOA_CLK_ENABLE();
- GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12);
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* Enable USB FS Clock */
- __HAL_RCC_USB_CLK_ENABLE();
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-void HardFault_Handler (void)
-{
- asm("bkpt");
-}
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/stm32l0538disco/stm32l0xx_hal_conf.h b/tinyusb/hw/bsp/stm32l0538disco/stm32l0xx_hal_conf.h
deleted file mode 100755
index 773b74e2..00000000
--- a/tinyusb/hw/bsp/stm32l0538disco/stm32l0xx_hal_conf.h
+++ /dev/null
@@ -1,331 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32l0xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration file.
- ******************************************************************************
- *
- * Copyright (c) 2016 STMicroelectronics International N.V. 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. Redistribution 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 STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
- * derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
- * software, must execute solely and exclusively on microcontroller or
- * microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
- *
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
- * SHALL STMICROELECTRONICS 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.
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32L0xx_HAL_CONF_H
-#define __STM32L0xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-// #define HAL_ADC_MODULE_ENABLED
-/* #define HAL_COMP_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_FIREWALL_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LCD_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-/* #define HAL_RTC_MODULE_ENABLED */
-//#define HAL_SPI_MODULE_ENABLED
-/* #define HAL_TIM_MODULE_ENABLED */
-/* #define HAL_TSC_MODULE_ENABLED */
-/* #define HAL_UART_MODULE_ENABLED */
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-//#define HAL_PCD_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_PCD_MODULE_ENABLED */
-
-
-/* ########################## Oscillator Values adaptation ####################*/
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal Multiple Speed oscillator (MSI) default value.
- * This value is the default MSI range value after Reset.
- */
-#if !defined (MSI_VALUE)
- #define MSI_VALUE ((uint32_t)2097152U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* MSI_VALUE */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal High Speed oscillator for USB (HSI48) value.
- */
-#if !defined (HSI48_VALUE)
-#define HSI48_VALUE ((uint32_t)48000000U) /*!< Value of the Internal High Speed oscillator for USB in Hz.
- The real value may vary depending on the variations
- in voltage and temperature. */
-#endif /* HSI48_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE ((uint32_t)37000U) /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature.*/
-/**
- * @brief External Low Speed oscillator (LSE) value.
- * This value is used by the UART, RTC HAL module to compute the system frequency
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/
-#endif /* LSE_VALUE */
-
-/**
- * @brief Time out for LSE start up value in ms.
- */
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 1U
-#define PREREAD_ENABLE 1U
-#define BUFFER_CACHE_DISABLE 0U
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1 */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
- * Activated: CRC code is present inside driver
- * Deactivated: CRC code cleaned from driver
- */
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32l0xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32l0xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32l0xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32l0xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32l0xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_COMP_MODULE_ENABLED
- #include "stm32l0xx_hal_comp.h"
-#endif /* HAL_COMP_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32l0xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32l0xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32l0xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_FIREWALL_MODULE_ENABLED
- #include "stm32l0xx_hal_firewall.h"
-#endif /* HAL_FIREWALL_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32l0xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32l0xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32l0xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32l0xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LCD_MODULE_ENABLED
- #include "stm32l0xx_hal_lcd.h"
-#endif /* HAL_LCD_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
-#include "stm32l0xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32l0xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32l0xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32l0xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32l0xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32l0xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_TSC_MODULE_ENABLED
- #include "stm32l0xx_hal_tsc.h"
-#endif /* HAL_TSC_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32l0xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32l0xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32l0xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32l0xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_SMBUS_MODULE_ENABLED
- #include "stm32l0xx_hal_smbus.h"
-#endif /* HAL_SMBUS_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32l0xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32l0xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t *file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32L0xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32l476disco/STM32L476VGTx_FLASH.ld b/tinyusb/hw/bsp/stm32l476disco/STM32L476VGTx_FLASH.ld
deleted file mode 100755
index 98f468ac..00000000
--- a/tinyusb/hw/bsp/stm32l476disco/STM32L476VGTx_FLASH.ld
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32L476VGTx Device with
-** 1024KByte FLASH, 96KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20018000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x500; /* required amount of heap */
-_Min_Stack_Size = 0x1000; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(8);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(8);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(8);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(8);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(8);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(8);
- } >FLASH
-
- .ARM.extab :
- {
- . = ALIGN(8);
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- . = ALIGN(8);
- } >FLASH
- .ARM : {
- . = ALIGN(8);
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- . = ALIGN(8);
- } >FLASH
-
- .preinit_array :
- {
- . = ALIGN(8);
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- . = ALIGN(8);
- } >FLASH
-
- .init_array :
- {
- . = ALIGN(8);
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- . = ALIGN(8);
- } >FLASH
- .fini_array :
- {
- . = ALIGN(8);
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- . = ALIGN(8);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(8);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(8);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/stm32l476disco/board.mk b/tinyusb/hw/bsp/stm32l476disco/board.mk
deleted file mode 100755
index 28824efd..00000000
--- a/tinyusb/hw/bsp/stm32l476disco/board.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-ST_FAMILY = l4
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
-ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib -nostartfiles \
- -DSTM32L476xx \
- -DCFG_TUSB_MCU=OPT_MCU_STM32L4
-
-# suppress warning caused by vendor mcu driver
-CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=cast-align
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/STM32L476VGTx_FLASH.ld
-
-SRC_C += \
- src/portable/st/synopsys/dcd_synopsys.c \
- $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_pwr.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_pwr_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_uart.c
-
-SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l476xx.s
-
-INC += \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# For flash-jlink target
-JLINK_DEVICE = stm32l476vg
-
-# Path to STM32 Cube Programmer CLI, should be added into system path
-STM32Prog = STM32_Programmer_CLI
-
-# flash target using on-board stlink
-flash: $(BUILD)/$(PROJECT).elf
- $(STM32Prog) --connect port=swd --write $< --go
diff --git a/tinyusb/hw/bsp/stm32l476disco/stm32l476disco.c b/tinyusb/hw/bsp/stm32l476disco/stm32l476disco.c
deleted file mode 100755
index b1884668..00000000
--- a/tinyusb/hw/bsp/stm32l476disco/stm32l476disco.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "../board.h"
-
-#include "stm32l4xx_hal.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void OTG_FS_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-#define LED_PORT GPIOB
-#define LED_PIN GPIO_PIN_2
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-
-// enable all LED, Button, Uart, USB clock
-static void all_rcc_clk_enable(void)
-{
- __HAL_RCC_GPIOA_CLK_ENABLE(); // USB D+, D-, Button
- __HAL_RCC_GPIOB_CLK_ENABLE(); // LED
- __HAL_RCC_GPIOC_CLK_ENABLE(); // VBUS pin
-}
-
-
-/**
- * @brief System Clock Configuration
- * The system Clock is configured as follow :
- *
- * If define USB_USE_LSE_MSI_CLOCK enabled:
- * System Clock source = PLL (MSI)
- * SYSCLK(Hz) = 80000000
- * HCLK(Hz) = 80000000
- * AHB Prescaler = 1
- * APB1 Prescaler = 1
- * APB2 Prescaler = 2
- * MSI Frequency(Hz) = 4800000
- * LSE Frequency(Hz) = 32768
- * PLL_M = 6
- * PLL_N = 40
- * PLL_P = 7
- * PLL_Q = 4
- * PLL_R = 4
- * Flash Latency(WS) = 4
- * @param None
- * @retval None
- */
-static void SystemClock_Config(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
- RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
-
- /* Enable the LSE Oscillator */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
- RCC_OscInitStruct.LSEState = RCC_LSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Enable the CSS interrupt in case LSE signal is corrupted or not present */
- HAL_RCCEx_DisableLSECSS();
-
- /* Set tick interrupt priority, default HAL value is intentionally invalid
- and that prevents PLL initialization in HAL_RCC_OscConfig() */
- HAL_InitTick((1UL << __NVIC_PRIO_BITS) - 1UL);
-
- /* Enable MSI Oscillator and activate PLL with MSI as source */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI;
- RCC_OscInitStruct.MSIState = RCC_MSI_ON;
- RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
- RCC_OscInitStruct.PLL.PLLM = 6;
- RCC_OscInitStruct.PLL.PLLN = 40;
- RCC_OscInitStruct.PLL.PLLP = 7;
- RCC_OscInitStruct.PLL.PLLQ = 4;
- RCC_OscInitStruct.PLL.PLLR = 4;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Enable MSI Auto-calibration through LSE */
- HAL_RCCEx_EnableMSIPLLMode();
-
- /* Select MSI output as USB clock source */
- PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
- PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_MSI;
- HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
- clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4);
-}
-
-void board_init(void)
-{
- SystemClock_Config();
- all_rcc_clk_enable();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- //NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- /* Enable Power Clock*/
- __HAL_RCC_PWR_CLK_ENABLE();
-
- /* Enable USB power on Pwrctrl CR2 register */
- HAL_PWREx_EnableVddUSB();
-
- GPIO_InitTypeDef GPIO_InitStruct;
-
- // LED
- GPIO_InitStruct.Pin = LED_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
- HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
-
- board_led_write(false);
-
- // Button
- GPIO_InitStruct.Pin = BUTTON_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_PULLDOWN;
- GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
- HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
-
- // USB
- /* Configure DM DP Pins */
- GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12);
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* Configure VBUS Pin */
- GPIO_InitStruct.Pin = GPIO_PIN_11;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
-
- /* Enable USB FS Clock */
- __HAL_RCC_USB_OTG_FS_CLK_ENABLE();
-
- // Enable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN;
-}
-
-//--------------------------------------------------------------------+
-// board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-void HardFault_Handler (void)
-{
- asm("bkpt");
-}
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/stm32l476disco/stm32l4xx_hal_conf.h b/tinyusb/hw/bsp/stm32l476disco/stm32l4xx_hal_conf.h
deleted file mode 100755
index 312f86da..00000000
--- a/tinyusb/hw/bsp/stm32l476disco/stm32l4xx_hal_conf.h
+++ /dev/null
@@ -1,420 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32l4xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration template file.
- * This file should be copied to the application folder and renamed
- * to stm32l4xx_hal_conf.h.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32L4xx_HAL_CONF_H
-#define __STM32L4xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_COMP_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_FIREWALL_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-// #define HAL_NOR_MODULE_ENABLED
-// #define HAL_SRAM_MODULE_ENABLED
-/* #define HAL_HCD_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-//#define HAL_I2C_MODULE_ENABLED
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-//#define HAL_LCD_MODULE_ENABLED
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_OPAMP_MODULE_ENABLED */
-//#define HAL_PCD_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-//#define HAL_SAI_MODULE_ENABLED
-//#define HAL_SD_MODULE_ENABLED
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_SWPMI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-/* #define HAL_TSC_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-
-
-/* ########################## Oscillator Values adaptation ####################*/
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal Multiple Speed oscillator (MSI) default value.
- * This value is the default MSI range value after Reset.
- */
-#if !defined (MSI_VALUE)
- #define MSI_VALUE 4000000U /*!< Value of the Internal oscillator in Hz*/
-#endif /* MSI_VALUE */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal High Speed oscillator (HSI48) value for USB FS, SDMMC and RNG.
- * This internal oscillator is mainly dedicated to provide a high precision clock to
- * the USB peripheral by means of a special Clock Recovery System (CRS) circuitry.
- * When the CRS is not used, the HSI48 RC oscillator runs on it default frequency
- * which is subject to manufacturing process variations.
- */
-#if !defined (HSI48_VALUE)
- #define HSI48_VALUE 48000000U /*!< Value of the Internal High Speed oscillator for USB FS/SDMMC/RNG in Hz.
- The real value my vary depending on manufacturing process variations.*/
-#endif /* HSI48_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature.*/
-/**
- * @brief External Low Speed oscillator (LSE) value.
- * This value is used by the UART, RTC HAL module to compute the system frequency
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for SAI1 peripheral
- * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
- * frequency.
- */
-#if !defined (EXTERNAL_SAI1_CLOCK_VALUE)
- #define EXTERNAL_SAI1_CLOCK_VALUE 48000U /*!< Value of the SAI1 External clock source in Hz*/
-#endif /* EXTERNAL_SAI1_CLOCK_VALUE */
-
-/**
- * @brief External clock source for SAI2 peripheral
- * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
- * frequency.
- */
-#if !defined (EXTERNAL_SAI2_CLOCK_VALUE)
- #define EXTERNAL_SAI2_CLOCK_VALUE 48000U /*!< Value of the SAI2 External clock source in Hz*/
-#endif /* EXTERNAL_SAI2_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE 3300U /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 0U
-#define INSTRUCTION_CACHE_ENABLE 1U
-#define DATA_CACHE_ENABLE 1U
-
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */
-#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1U */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
- * Activated: CRC code is present inside driver
- * Deactivated: CRC code cleaned from driver
- */
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32l4xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32l4xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32l4xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32l4xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32l4xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32l4xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32l4xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "Legacy/stm32l4xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_COMP_MODULE_ENABLED
- #include "stm32l4xx_hal_comp.h"
-#endif /* HAL_COMP_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32l4xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32l4xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32l4xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_FIREWALL_MODULE_ENABLED
- #include "stm32l4xx_hal_firewall.h"
-#endif /* HAL_FIREWALL_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32l4xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32l4xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32l4xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32l4xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32l4xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32l4xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LCD_MODULE_ENABLED
- #include "stm32l4xx_hal_lcd.h"
-#endif /* HAL_LCD_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
-#include "stm32l4xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_OPAMP_MODULE_ENABLED
-#include "stm32l4xx_hal_opamp.h"
-#endif /* HAL_OPAMP_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32l4xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32l4xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32l4xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32l4xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32l4xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32l4xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SMBUS_MODULE_ENABLED
- #include "stm32l4xx_hal_smbus.h"
-#endif /* HAL_SMBUS_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32l4xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_SWPMI_MODULE_ENABLED
- #include "stm32l4xx_hal_swpmi.h"
-#endif /* HAL_SWPMI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32l4xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_TSC_MODULE_ENABLED
- #include "stm32l4xx_hal_tsc.h"
-#endif /* HAL_TSC_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32l4xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32l4xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32l4xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32l4xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32l4xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32l4xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32l4xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t *file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32L4xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/stm32l4r5nucleo/STM32L4RXxI_FLASH.ld b/tinyusb/hw/bsp/stm32l4r5nucleo/STM32L4RXxI_FLASH.ld
deleted file mode 100755
index f93a1604..00000000
--- a/tinyusb/hw/bsp/stm32l4r5nucleo/STM32L4RXxI_FLASH.ld
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32L4RxI Device with
-** 2048KByte FLASH, 640KByte RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-** (c)Copyright Ac6.
-** You may use this file as-is or modify it according to the needs of your
-** project. Distribution of this file (unmodified or modified) is not
-** permitted. Ac6 permit registered System Workbench for MCU users the
-** rights to distribute the assembled, compiled & linked contents of this
-** file as part of an application binary file, provided that it is built
-** using the System Workbench for MCU toolchain.
-**
-*****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x200a0000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x460; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640K
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
diff --git a/tinyusb/hw/bsp/stm32l4r5nucleo/board.mk b/tinyusb/hw/bsp/stm32l4r5nucleo/board.mk
deleted file mode 100755
index 12a291d0..00000000
--- a/tinyusb/hw/bsp/stm32l4r5nucleo/board.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-ST_FAMILY = l4
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
-ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m4 \
- -mfloat-abi=hard \
- -mfpu=fpv4-sp-d16 \
- -nostdlib -nostartfiles \
- -DHSE_VALUE=8000000 \
- -DSTM32L4R5xx \
- -DCFG_TUSB_MCU=OPT_MCU_STM32L4
-
-# suppress warning caused by vendor mcu driver
-CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=cast-align
-
-# All source paths should be relative to the top level.
-LD_FILE = hw/bsp/$(BOARD)/STM32L4RXxI_FLASH.ld
-
-SRC_C += \
- src/portable/st/synopsys/dcd_synopsys.c \
- $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_pwr.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_pwr_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_uart.c
-
-SRC_S += \
- $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l4r5xx.s
-
-INC += \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc \
- $(TOP)/hw/bsp/$(BOARD)
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM4F
-
-# flash target using on-board stlink
-flash: flash-stlink
diff --git a/tinyusb/hw/bsp/stm32l4r5nucleo/stm32l4r5nucleo.c b/tinyusb/hw/bsp/stm32l4r5nucleo/stm32l4r5nucleo.c
deleted file mode 100755
index bab66b55..00000000
--- a/tinyusb/hw/bsp/stm32l4r5nucleo/stm32l4r5nucleo.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 William D. Jones (thor0505@comcast.net),
- * Ha Thach (tinyusb.org)
- * Uwe Bonnes (bon@elektron.ikp.physik.tu-darmstadt.de)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "../board.h"
-
-#include "stm32l4xx_hal.h"
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-void OTG_FS_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-#define LED_PORT GPIOB
-#define LED_PIN GPIO_PIN_14
-#define LED_STATE_ON 1
-
-#define BUTTON_PORT GPIOC
-#define BUTTON_PIN GPIO_PIN_13
-#define BUTTON_STATE_ACTIVE 1
-
-#define UARTx LPUART1
-#define UART_GPIO_PORT GPIOG
-#define UART_GPIO_AF GPIO_AF8_LPUART1
-#define UART_TX_PIN GPIO_PIN_7
-#define UART_RX_PIN GPIO_PIN_8
-
-UART_HandleTypeDef UartHandle;
-
-// enable all LED, Button, Uart, USB clock
-static void all_rcc_clk_enable(void)
-{
- __HAL_RCC_GPIOA_CLK_ENABLE(); // USB D+, D-
- __HAL_RCC_GPIOB_CLK_ENABLE(); // LED
- __HAL_RCC_GPIOC_CLK_ENABLE(); // Button
- __HAL_RCC_GPIOG_CLK_ENABLE(); // Uart TX, RX
- __HAL_RCC_LPUART1_CLK_ENABLE(); // LPUart1 module
-}
-
-/**
- * @brief System Clock Configuration
- * The system Clock is configured as follow :
- * System Clock source = PLL (MSI)
- * SYSCLK(Hz) = 120000000
- * HCLK(Hz) = 120000000
- * AHB Prescaler = 1
- * APB1 Prescaler = 1
- * APB2 Prescaler = 1
- * MSI Frequency(Hz) = 48000000
- * PLL_M = 12
- * PLL_N = 60
- * PLL_P = 2
- * PLL_Q = 2
- * VDD(V) = 3.3
- * Main regulator output voltage = Scale1 mode
- * Flash Latency(WS) = 5
- * The USB clock configuration from PLLSAI:
- * PLLSAIP = 8 FIXME
- * PLLSAIN = 384 FIXME
- * PLLSAIQ = 7 FIXME
- * @param None
- * @retval None
- */
-void SystemClock_Config(void)
-{
- RCC_ClkInitTypeDef RCC_ClkInitStruct;
- RCC_OscInitTypeDef RCC_OscInitStruct;
- RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
-
- /* Activate PLL with MSI , stabilizied via PLL by LSE */
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE | RCC_OSCILLATORTYPE_MSI;
- RCC_OscInitStruct.MSIState = RCC_MSI_ON;
- RCC_OscInitStruct.LSEState = RCC_LSE_ON;
- RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11;
- RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
- RCC_OscInitStruct.PLL.PLLM = 12;
- RCC_OscInitStruct.PLL.PLLN = 60;
- RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
- RCC_OscInitStruct.PLL.PLLQ = 2;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- /* Enable MSI Auto-calibration through LSE */
- HAL_RCCEx_EnableMSIPLLMode();
-
- /* Select MSI output as USB clock source */
- PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
- PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_MSI;
- HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
-
- /* Select MSI output as USB clock source */
- PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LPUART1;
- PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1;
- HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
-
- /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
- clocks dividers */
- RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- // Avoid overshoot and start with HCLK 60 MHz
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV2;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3);
-
- /* AHB prescaler divider at 1 as second step */
- RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5);
-}
-
-void board_init(void)
-{
- /* Enable Power Clock*/
- __HAL_RCC_PWR_CLK_ENABLE();
- /* Enable voltage range 1 boost mode for frequency above 80 Mhz */
- HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1_BOOST);
-
- /* Set tick interrupt priority, default HAL value is intentionally invalid
- and that prevents PLL initialization in HAL_RCC_OscConfig() */
-
- HAL_InitTick((1UL << __NVIC_PRIO_BITS) - 1UL);
-
- SystemClock_Config();
- all_rcc_clk_enable();
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- //NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
-#endif
-
- /* Enable USB power on Pwrctrl CR2 register */
- HAL_PWREx_EnableVddUSB();
-
- GPIO_InitTypeDef GPIO_InitStruct;
-
- // LED
- GPIO_InitStruct.Pin = LED_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
-
- // Button
- GPIO_InitStruct.Pin = BUTTON_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
-
- // IOSV bit MUST be set to access GPIO port G[2:15] */
- __HAL_RCC_PWR_CLK_ENABLE();
- HAL_PWREx_EnableVddIO2();
-
- // Uart
- GPIO_InitStruct.Pin = UART_TX_PIN | UART_RX_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Alternate = UART_GPIO_AF;
- HAL_GPIO_Init(UART_GPIO_PORT, &GPIO_InitStruct);
-
- UartHandle.Instance = UARTx;
- UartHandle.Init.BaudRate = CFG_BOARD_UART_BAUDRATE;
- UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
- UartHandle.Init.StopBits = UART_STOPBITS_1;
- UartHandle.Init.Parity = UART_PARITY_NONE;
- UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
- UartHandle.Init.Mode = UART_MODE_TX_RX;
- UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
- UartHandle.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
- UartHandle.Init.ClockPrescaler = UART_PRESCALER_DIV1;
- UartHandle.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
-
- HAL_UART_Init(&UartHandle);
-
- /* Configure USB FS GPIOs */
- /* Configure DM DP Pins */
- GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12);
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* Configure VBUS Pin */
- GPIO_InitStruct.Pin = GPIO_PIN_9;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* Configure ID pin */
- GPIO_InitStruct.Pin = GPIO_PIN_10;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- /* Enable USB FS Clocks */
- __HAL_RCC_USB_OTG_FS_CLK_ENABLE();
-
- // Enable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN;
-}
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-
-void board_led_write(bool state)
-{
- HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
-}
-
-uint32_t board_button_read(void)
-{
- return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
-}
-
-int board_uart_read(uint8_t* buf, int len)
-{
- (void) buf; (void) len;
- return 0;
-}
-
-int board_uart_write(void const * buf, int len)
-{
- HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
- return len;
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler (void)
-{
- system_ticks++;
-}
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-void HardFault_Handler (void)
-{
- asm("bkpt");
-}
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-
-}
diff --git a/tinyusb/hw/bsp/stm32l4r5nucleo/stm32l4xx_hal_conf.h b/tinyusb/hw/bsp/stm32l4r5nucleo/stm32l4xx_hal_conf.h
deleted file mode 100755
index 470ef129..00000000
--- a/tinyusb/hw/bsp/stm32l4r5nucleo/stm32l4xx_hal_conf.h
+++ /dev/null
@@ -1,419 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32l4xx_hal_conf.h
- * @author MCD Application Team
- * @brief HAL configuration template file.
- * This file should be copied to the application folder and renamed
- * to stm32l4xx_hal_conf.h.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32L4xx_HAL_CONF_H
-#define __STM32L4xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-/* #define HAL_ADC_MODULE_ENABLED */
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_COMP_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_FIREWALL_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-// #define HAL_NOR_MODULE_ENABLED
-// #define HAL_SRAM_MODULE_ENABLED
-/* #define HAL_HCD_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-//#define HAL_I2C_MODULE_ENABLED
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-//#define HAL_LCD_MODULE_ENABLED
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_OPAMP_MODULE_ENABLED */
-//#define HAL_PCD_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-//#define HAL_SAI_MODULE_ENABLED
-//#define HAL_SD_MODULE_ENABLED
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_SPI_MODULE_ENABLED */
-/* #define HAL_SWPMI_MODULE_ENABLED */
-/* #define HAL_TIM_MODULE_ENABLED */
-/* #define HAL_TSC_MODULE_ENABLED */
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-
-
-/* ########################## Oscillator Values adaptation ####################*/
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
- #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal Multiple Speed oscillator (MSI) default value.
- * This value is the default MSI range value after Reset.
- */
-#if !defined (MSI_VALUE)
- #define MSI_VALUE 4000000U /*!< Value of the Internal oscillator in Hz*/
-#endif /* MSI_VALUE */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief Internal High Speed oscillator (HSI48) value for USB FS, SDMMC and RNG.
- * This internal oscillator is mainly dedicated to provide a high precision clock to
- * the USB peripheral by means of a special Clock Recovery System (CRS) circuitry.
- * When the CRS is not used, the HSI48 RC oscillator runs on it default frequency
- * which is subject to manufacturing process variations.
- */
-#if !defined (HSI48_VALUE)
- #define HSI48_VALUE 48000000U /*!< Value of the Internal High Speed oscillator for USB FS/SDMMC/RNG in Hz.
- The real value my vary depending on manufacturing process variations.*/
-#endif /* HSI48_VALUE */
-
-/**
- * @brief Internal Low Speed oscillator (LSI) value.
- */
-#if !defined (LSI_VALUE)
- #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature.*/
-/**
- * @brief External Low Speed oscillator (LSE) value.
- * This value is used by the UART, RTC HAL module to compute the system frequency
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
-#endif /* LSE_VALUE */
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief External clock source for SAI1 peripheral
- * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
- * frequency.
- */
-#if !defined (EXTERNAL_SAI1_CLOCK_VALUE)
- #define EXTERNAL_SAI1_CLOCK_VALUE 48000U /*!< Value of the SAI1 External clock source in Hz*/
-#endif /* EXTERNAL_SAI1_CLOCK_VALUE */
-
-/**
- * @brief External clock source for SAI2 peripheral
- * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
- * frequency.
- */
-#if !defined (EXTERNAL_SAI2_CLOCK_VALUE)
- #define EXTERNAL_SAI2_CLOCK_VALUE 48000U /*!< Value of the SAI2 External clock source in Hz*/
-#endif /* EXTERNAL_SAI2_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE 3300U /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */
-#define USE_RTOS 0U
-#define PREFETCH_ENABLE 0U
-#define INSTRUCTION_CACHE_ENABLE 1U
-#define DATA_CACHE_ENABLE 1U
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */
-#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1U */
-
-/* ################## SPI peripheral configuration ########################## */
-
-/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
- * Activated: CRC code is present inside driver
- * Deactivated: CRC code cleaned from driver
- */
-
-#define USE_SPI_CRC 1U
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32l4xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32l4xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32l4xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32l4xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32l4xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32l4xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_CAN_MODULE_ENABLED
- #include "stm32l4xx_hal_can.h"
-#endif /* HAL_CAN_MODULE_ENABLED */
-
-#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
- #include "Legacy/stm32l4xx_hal_can_legacy.h"
-#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
-
-#ifdef HAL_COMP_MODULE_ENABLED
- #include "stm32l4xx_hal_comp.h"
-#endif /* HAL_COMP_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32l4xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32l4xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32l4xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_FIREWALL_MODULE_ENABLED
- #include "stm32l4xx_hal_firewall.h"
-#endif /* HAL_FIREWALL_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32l4xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32l4xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32l4xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32l4xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32l4xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32l4xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_LCD_MODULE_ENABLED
- #include "stm32l4xx_hal_lcd.h"
-#endif /* HAL_LCD_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
-#include "stm32l4xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_OPAMP_MODULE_ENABLED
-#include "stm32l4xx_hal_opamp.h"
-#endif /* HAL_OPAMP_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32l4xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32l4xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32l4xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32l4xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32l4xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32l4xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SMBUS_MODULE_ENABLED
- #include "stm32l4xx_hal_smbus.h"
-#endif /* HAL_SMBUS_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32l4xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_SWPMI_MODULE_ENABLED
- #include "stm32l4xx_hal_swpmi.h"
-#endif /* HAL_SWPMI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32l4xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_TSC_MODULE_ENABLED
- #include "stm32l4xx_hal_tsc.h"
-#endif /* HAL_TSC_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32l4xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32l4xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32l4xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32l4xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32l4xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32l4xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32l4xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t *file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32L4xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/bsp/waveshare_openh743i/STM32H743IITX_FLASH.ld b/tinyusb/hw/bsp/waveshare_openh743i/STM32H743IITX_FLASH.ld
deleted file mode 100755
index 73d2dedb..00000000
--- a/tinyusb/hw/bsp/waveshare_openh743i/STM32H743IITX_FLASH.ld
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
-******************************************************************************
-**
-** File : LinkerScript.ld
-**
-** Author : STM32CubeIDE
-**
-** Abstract : Linker script for STM32H7 series
-** 2048Kbytes FLASH and 192Kbytes RAM
-**
-** Set heap size, stack size and stack location according
-** to application requirements.
-**
-** Set memory bank area and size if external memory is used.
-**
-** Target : STMicroelectronics STM32
-**
-** Distribution: The file is distributed as is, without any warranty
-** of any kind.
-**
-*****************************************************************************
-** @attention
-**
-** Copyright (c) 2019 STMicroelectronics.
-** All rights reserved.
-**
-** This software component is licensed by ST under BSD 3-Clause license,
-** the "License"; You may not use this file except in compliance with the
-** License. You may obtain a copy of the License at:
-** opensource.org/licenses/BSD-3-Clause
-**
-****************************************************************************
-*/
-
-/* Entry Point */
-ENTRY(Reset_Handler)
-
-/* Highest address of the user mode stack */
-_estack = 0x20020000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x2000 ; /* required amount of heap */
-_Min_Stack_Size = 0x2000 ; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
- FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
- RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
- RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
- RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
- RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
- ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text) /* .text sections (code) */
- *(.text*) /* .text* sections (code) */
- *(.glue_7) /* glue arm to thumb code */
- *(.glue_7t) /* glue thumb to arm code */
- *(.eh_frame)
-
- KEEP (*(.init))
- KEEP (*(.fini))
-
- . = ALIGN(4);
- _etext = .; /* define a global symbols at end of code */
- } >FLASH
-
- /* Constant data goes into FLASH */
- .rodata :
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start */
- *(.data) /* .data sections */
- *(.data*) /* .data* sections */
- *(.RamFunc) /* .RamFunc sections */
- *(.RamFunc*) /* .RamFunc* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end */
- } >RAM AT> FLASH
-
- /* Uninitialized data section */
- . = ALIGN(4);
- .bss :
- {
- /* This is used by the startup in order to initialize the .bss secion */
- _sbss = .; /* define a global symbol at bss start */
- __bss_start__ = _sbss;
- *(.bss)
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end */
- __bss_end__ = _ebss;
- } >RAM
-
- /* User_heap_stack section, used to check that there is enough RAM left */
- ._user_heap_stack :
- {
- . = ALIGN(8);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(8);
- } >RAM
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/tinyusb/hw/bsp/waveshare_openh743i/board.c b/tinyusb/hw/bsp/waveshare_openh743i/board.c
deleted file mode 100755
index 4468c066..00000000
--- a/tinyusb/hw/bsp/waveshare_openh743i/board.c
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019
- * Benjamin Evans
- * William D. Jones (thor0505@comcast.net),
- * Ha Thach (tinyusb.org)
- * Uwe Bonnes (bon@elektron.ikp.physik.tu-darmstadt.de
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "stm32h7xx_hal.h"
-#include "stm32h7xx_hal_tim.h"
-#include "bsp/board.h"
-
-
-/* ** BOARD SETUP **
- *
- * NOTE: This board has bad signal integrity so you may experience some problems.
- * This setup assumes you have an openh743i-c Core and breakout board. For the HS
- * examples it also assumes you have a waveshare USB3300 breakout board plugged
- * into the ULPI PMOD header on the openh743i-c.
- *
- * UART Debugging:
- * Due to pin conflicts in the HS configuration, this BSP uses USART3 (PD8, PD9).
- * As such, you won't be able to use the UART to USB converter on board and will
- * require an external UART to USB converter. You could use the waveshare FT232
- * USB UART Board (micro) but any 3.3V UART to USB converter will be fine.
- *
- * Fullspeed:
- * If VBUS sense is enabled, ensure the PA9-VBUS jumper is connected on the core
- * board. Connect the PB6 jumper for the LED and the Wakeup - PA0 jumper for the
- * button. Connect the USB cable to the USB connector on the core board.
- *
- * High Speed:
- * Remove all jumpers from the openh743i-c (especially the USART1 jumpers as the
- * pins conflict). Connect the PB6 jumper for the LED and the Wakeup - PA0
- * jumper for the button.
- *
- * The reset pin on the ULPI PMOD port is not connected to the MCU. You'll need
- * to solder a wire from the RST pin on the USB3300 to a pin of your choosing on
- * the openh743i-c board (this example assumes you've used PD14 as specified with
- * the ULPI_RST_PORT and ULPI_RST_PIN defines below).
- *
- * Preferably power the board using the external 5VDC jack. Connect the USB cable
- * to the USB connector on the ULPI board. Adjust delays in this file as required.
- *
- * If you're having trouble, ask a question on the tinyUSB Github Discussion boards.
- *
- * Have fun!
- *
-*/
-
-//--------------------------------------------------------------------+
-// BOARD DEFINES
-//--------------------------------------------------------------------+
-
-//LED Pin
-#define LED_PORT GPIOB
-#define LED_PIN GPIO_PIN_6
-#define LED_STATE_ON 1
-
-//ULPI PHY reset pin
-#define ULPI_RST_PORT GPIOD
-#define ULPI_RST_PIN GPIO_PIN_14
-
-// Tamper push-button
-#define BUTTON_PORT GPIOA
-#define BUTTON_PIN GPIO_PIN_0
-#define BUTTON_STATE_ACTIVE 1
-
-// Need external UART to USB converter as USART1 pins conflict with HS ULPI pins
-#define UART_DEV USART3
-#define UART_CLK_EN __HAL_RCC_USART3_CLK_ENABLE
-#define UART_GPIO_PORT GPIOD
-#define UART_GPIO_AF GPIO_AF7_USART3
-#define UART_TX_PIN GPIO_PIN_8
-#define UART_RX_PIN GPIO_PIN_9
-
-// VBUS Sense detection
-#define OTG_FS_VBUS_SENSE 1
-#define OTG_HS_VBUS_SENSE 0
-
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-UART_HandleTypeDef uartHandle;
-TIM_HandleTypeDef tim2Handle;
-
-
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-
-// Despite being call USB2_OTG
-// OTG_FS is marked as RHPort0 by TinyUSB to be consistent across stm32 port
-void OTG_FS_IRQHandler(void)
-{
- tud_int_handler(0);
-}
-
-// Despite being call USB2_OTG
-// OTG_HS is marked as RHPort1 by TinyUSB to be consistent across stm32 port
-void OTG_HS_IRQHandler(void)
-{
- tud_int_handler(1);
-}
-
-
-//--------------------------------------------------------------------+
-// RCC Clock
-//--------------------------------------------------------------------+
-static inline void board_stm32h7_clock_init(void)
-{
- RCC_OscInitTypeDef RCC_OscInitStruct = {0};
- RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
- RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
-
- __HAL_RCC_SYSCFG_CLK_ENABLE();
-
- // Supply configuration update enable
- HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
-
- // Configure the main internal regulator output voltage
- __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0);
-
- while (!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY))
- {
- }
- // Macro to configure the PLL clock source
- __HAL_RCC_PLL_PLLSOURCE_CONFIG(RCC_PLLSOURCE_HSE);
-
- // Initializes the RCC Oscillators according to the specified parameters in the RCC_OscInitTypeDef structure.
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
- RCC_OscInitStruct.HSEState = RCC_HSE_ON;
- RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
- RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
- RCC_OscInitStruct.PLL.PLLM = 2;
- RCC_OscInitStruct.PLL.PLLN = 240;
- RCC_OscInitStruct.PLL.PLLP = 2;
- RCC_OscInitStruct.PLL.PLLQ = 2;
- RCC_OscInitStruct.PLL.PLLR = 2;
- RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_2;
- RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE;
- RCC_OscInitStruct.PLL.PLLFRACN = 0;
- HAL_RCC_OscConfig(&RCC_OscInitStruct);
-
- PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB | RCC_PERIPHCLK_USART3;
- PeriphClkInitStruct.PLL3.PLL3M = 8;
- PeriphClkInitStruct.PLL3.PLL3N = 336;
- PeriphClkInitStruct.PLL3.PLL3P = 2;
- PeriphClkInitStruct.PLL3.PLL3Q = 7;
- PeriphClkInitStruct.PLL3.PLL3R = 2;
- PeriphClkInitStruct.PLL3.PLL3RGE = RCC_PLL3VCIRANGE_0;
- PeriphClkInitStruct.PLL3.PLL3VCOSEL = RCC_PLL3VCOWIDE;
- PeriphClkInitStruct.PLL3.PLL3FRACN = 0;
- PeriphClkInitStruct.Usart234578ClockSelection = RCC_USART234578CLKSOURCE_PLL3;
- PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL3;
- HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
-
- // Initializes the CPU, AHB and APB buses clocks
- RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2 | RCC_CLOCKTYPE_D3PCLK1 | RCC_CLOCKTYPE_D1PCLK1;
- RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
- RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
- RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2;
- RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2;
- RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2;
- RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2;
- RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2;
- HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2);
-
- __HAL_RCC_CSI_ENABLE();
-
- // Enable SYSCFG clock mondatory for I/O Compensation Cell
- __HAL_RCC_SYSCFG_CLK_ENABLE();
-
- // Enables the I/O Compensation Cell
- HAL_EnableCompensationCell();
-
- // Enable voltage detector
- HAL_PWREx_EnableUSBVoltageDetector();
-
- return;
-}
-
-
-//--------------------------------------------------------------------+
-// Timer implementation for board delay
-// This should be OS safe and doesn't require the scheduler to be running
-//--------------------------------------------------------------------+
-static void init_timer(void)
-{
- TIM_ClockConfigTypeDef sClockSourceConfig = {0};
-
- __HAL_RCC_TIM2_CLK_ENABLE();
-
- //Assuming timer clock is running at 260Mhz this should configure the timer counter to 1000Hz
- tim2Handle.Instance = TIM2;
- tim2Handle.Init.Prescaler = 60000U - 1U;
- tim2Handle.Init.CounterMode = TIM_COUNTERMODE_UP;
- tim2Handle.Init.Period = 0xFFFFFFFFU;
- tim2Handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV4;
- tim2Handle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
- HAL_TIM_Base_Init(&tim2Handle);
-
- sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
- HAL_TIM_ConfigClockSource(&tim2Handle, &sClockSourceConfig);
-
- //Start the timer
- HAL_TIM_Base_Start(&tim2Handle);
-
- return;
-}
-
-
-// Custom board delay implementation using timer ticks
-static inline void timer_board_delay(uint32_t ms)
-{
- uint32_t startMs = __HAL_TIM_GET_COUNTER(&tim2Handle);
- while ((__HAL_TIM_GET_COUNTER(&tim2Handle) - startMs) < ms)
- {
- asm("nop"); //do nothing
- }
-}
-
-
-//Board initialisation
-void board_init(void)
-{
- GPIO_InitTypeDef GPIO_InitStruct;
-
- // Init clocks
- board_stm32h7_clock_init();
-
- // Init timer for delays
- init_timer();
-
- //Disable systick for now
- //If using an RTOS and the systick interrupt fires without the scheduler running you might have an issue
- //Because this init code now introduces delays, the systick should be disabled until after board init
- SysTick->CTRL &= ~1U;
-
- // Enable GPIO clocks
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOB_CLK_ENABLE();
- __HAL_RCC_GPIOC_CLK_ENABLE();
- __HAL_RCC_GPIOD_CLK_ENABLE();
- __HAL_RCC_GPIOH_CLK_ENABLE();
- __HAL_RCC_GPIOI_CLK_ENABLE();
-
- // Enable UART Clock
- UART_CLK_EN();
-
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
- // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
- NVIC_SetPriority(OTG_FS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
- NVIC_SetPriority(OTG_HS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
-#endif
-
- // LED
- GPIO_InitStruct.Pin = LED_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct);
-
- // PHY RST Pin
- GPIO_InitStruct.Pin = ULPI_RST_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
- HAL_GPIO_Init(ULPI_RST_PORT, &GPIO_InitStruct);
- HAL_GPIO_WritePin(ULPI_RST_PORT, ULPI_RST_PIN, 0U);
-
- // Button
- GPIO_InitStruct.Pin = BUTTON_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
-
- // Uart
- GPIO_InitStruct.Pin = UART_TX_PIN | UART_RX_PIN;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- GPIO_InitStruct.Alternate = UART_GPIO_AF;
- HAL_GPIO_Init(UART_GPIO_PORT, &GPIO_InitStruct);
-
- uartHandle.Instance = UART_DEV;
- uartHandle.Init.BaudRate = CFG_BOARD_UART_BAUDRATE;
- uartHandle.Init.WordLength = UART_WORDLENGTH_8B;
- uartHandle.Init.StopBits = UART_STOPBITS_1;
- uartHandle.Init.Parity = UART_PARITY_NONE;
- uartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
- uartHandle.Init.Mode = UART_MODE_TX_RX;
- uartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
- HAL_UART_Init(&uartHandle);
-
-#if BOARD_DEVICE_RHPORT_NUM == 0
- //Full Speed
-
- // Configure DM DP Pins
- GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- // This for ID line debug
- GPIO_InitStruct.Pin = GPIO_PIN_10;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- __HAL_RCC_USB2_OTG_FS_CLK_ENABLE();
-
-#if OTG_FS_VBUS_SENSE
- // Configure VBUS Pin
- GPIO_InitStruct.Pin = GPIO_PIN_9;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- // Enable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN;
-#else
- // Disable VBUS sense (B device) via pin PA9
- USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBDEN;
-
- // B-peripheral session valid override enable
- USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOEN;
- USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL;
-#endif // vbus sense
-
-#elif BOARD_DEVICE_RHPORT_NUM == 1
- //High Speed
-
- /**USB_OTG_HS GPIO Configuration
- PC0 ------> USB_OTG_HS_ULPI_STP
- PC2_C ------> USB_OTG_HS_ULPI_DIR
- PC3_C ------> USB_OTG_HS_ULPI_NXT
- PA3 ------> USB_OTG_HS_ULPI_D0
- PA5 ------> USB_OTG_HS_ULPI_CK
- PB1 ------> USB_OTG_HS_ULPI_D2
- PB10 ------> USB_OTG_HS_ULPI_D3
- PB11 ------> USB_OTG_HS_ULPI_D4
- PB12 ------> USB_OTG_HS_ULPI_D5
- PB13 ------> USB_OTG_HS_ULPI_D6
- PB5 ------> USB_OTG_HS_ULPI_D7
- */
-
- GPIO_InitStruct.Pin = GPIO_PIN_0 | GPIO_PIN_2 | GPIO_PIN_3;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
-
- GPIO_InitStruct.Pin = GPIO_PIN_3 | GPIO_PIN_5;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- GPIO_InitStruct.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_5;
- GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS;
- HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
-
- // Peripheral clock enable
- __HAL_RCC_USB_OTG_HS_CLK_ENABLE();
- __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE();
-
-#if OTG_HS_VBUS_SENSE
-#error OTG HS VBUS Sense enabled is not implemented
-#else
- // No VBUS sense
- USB_OTG_HS->GCCFG &= ~USB_OTG_GCCFG_VBDEN;
-
- // B-peripheral session valid override enable
- USB_OTG_HS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOEN;
- USB_OTG_HS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL;
-#endif
-
- // Force device mode
- USB_OTG_HS->GUSBCFG &= ~USB_OTG_GUSBCFG_FHMOD;
- USB_OTG_HS->GUSBCFG |= USB_OTG_GUSBCFG_FDMOD;
-
- //Reset the PHY - Change the delays as you see fit
- timer_board_delay(5U); //Delay 5ms
- HAL_GPIO_WritePin(ULPI_RST_PORT, ULPI_RST_PIN, 1U);
- timer_board_delay(20U); //Delay 20ms
- HAL_GPIO_WritePin(ULPI_RST_PORT, ULPI_RST_PIN, 0U);
- timer_board_delay(20U); //Delay 20ms
-
-#endif // rhport = 1
-
- //Disable the timer used for delays
- HAL_TIM_Base_Stop(&tim2Handle);
- __HAL_RCC_TIM2_CLK_DISABLE();
-
- // Configure systick 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
-
- //Enable systick
- SysTick->CTRL |= ~1U;
-
- return;
-}
-
-
-//--------------------------------------------------------------------+
-// Board porting API
-//--------------------------------------------------------------------+
-void board_led_write(bool state)
-{
- HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1 - LED_STATE_ON));
-}
-
-
-uint32_t board_button_read(void)
-{
- return (BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN)) ? 1 : 0;
-}
-
-
-int board_uart_read(uint8_t *buf, int len)
-{
- (void)buf;
- (void)len;
- return 0;
-}
-
-
-int board_uart_write(void const *buf, int len)
-{
- HAL_UART_Transmit(&uartHandle, (uint8_t *)buf, len, 0xffff);
- return len;
-}
-
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-volatile uint32_t system_ticks = 0;
-void SysTick_Handler(void)
-{
- system_ticks++;
-}
-
-
-uint32_t board_millis(void)
-{
- return system_ticks;
-}
-#endif
-
-
-void HardFault_Handler(void)
-{
- asm("bkpt");
-}
-
-
-// Required by __libc_init_array in startup code if we are compiling using
-// -nostdlib/-nostartfiles.
-void _init(void)
-{
-} \ No newline at end of file
diff --git a/tinyusb/hw/bsp/waveshare_openh743i/board.mk b/tinyusb/hw/bsp/waveshare_openh743i/board.mk
deleted file mode 100755
index 721df1bd..00000000
--- a/tinyusb/hw/bsp/waveshare_openh743i/board.mk
+++ /dev/null
@@ -1,64 +0,0 @@
-UF2_FAMILY_ID = 0x6db66082
-ST_FAMILY = h7
-DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
-ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
-
-# Default is HS port
-PORT ?= 1
-
-SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32h743xx.s
-LD_FILE = $(BOARD_PATH)/STM32H743IITX_FLASH.ld
-
-CFLAGS += \
- -flto \
- -mthumb \
- -mabi=aapcs \
- -mcpu=cortex-m7 \
- -mfloat-abi=hard \
- -mfpu=fpv5-d16 \
- -nostdlib -nostartfiles \
- -DCFG_TUSB_MCU=OPT_MCU_STM32H7 \
- -DBOARD_DEVICE_RHPORT_NUM=$(PORT) \
- -DSTM32H743xx \
- -DHSE_VALUE=8000000
-
-ifeq ($(PORT), 1)
- CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
- $(info "PORT1 High Speed")
-else
- $(info "PORT0 Full Speed")
-endif
-
-# suppress warning caused by vendor mcu driver
-CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=cast-align
-
-# All source paths should be relative to the top level.
-SRC_C += \
- src/portable/st/synopsys/dcd_synopsys.c \
- $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_uart.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_pwr_ex.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_tim.c \
- $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_tim_ex.c
-
-INC += \
- $(TOP)/$(BOARD_PATH) \
- $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
- $(TOP)/$(ST_CMSIS)/Include \
- $(TOP)/$(ST_HAL_DRIVER)/Inc
-
-# For freeRTOS port source
-FREERTOS_PORT = ARM_CM7/r0p1
-
-# For flash-jlink target
-JLINK_DEVICE = stm32h743ii
-
-# flash target using jlink
-flash: flash-jlink \ No newline at end of file
diff --git a/tinyusb/hw/bsp/waveshare_openh743i/stm32h7xx_hal_conf.h b/tinyusb/hw/bsp/waveshare_openh743i/stm32h7xx_hal_conf.h
deleted file mode 100755
index 11d29ed6..00000000
--- a/tinyusb/hw/bsp/waveshare_openh743i/stm32h7xx_hal_conf.h
+++ /dev/null
@@ -1,483 +0,0 @@
-/**
- ******************************************************************************
- * @file stm32h7xx_hal_conf_template.h
- * @brief HAL configuration template file.
- * This file should be copied to the application folder and renamed
- * to stm32h7xx_hal_conf.h.
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
- *
- * 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 STMicroelectronics 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.
- *
- ******************************************************************************
- */
-
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __STM32H7xx_HAL_CONF_H
-#define __STM32H7xx_HAL_CONF_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* Exported types ------------------------------------------------------------*/
-/* Exported constants --------------------------------------------------------*/
-
-/* ########################## Module Selection ############################## */
-/**
- * @brief This is the list of modules to be used in the HAL driver
- */
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_COMP_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-/* #define HAL_DAC_MODULE_ENABLED */
-/* #define HAL_DCMI_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-/* #define HAL_EXTI_MODULE_ENABLED */
-/* #define HAL_FDCAN_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_HASH_MODULE_ENABLED */
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_HRTIM_MODULE_ENABLED */
-/* #define HAL_HSEM_MODULE_ENABLED */
-/* #define HAL_I2C_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_JPEG_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_MDIOS_MODULE_ENABLED */
-/* #define HAL_MDMA_MODULE_ENABLED */
-/* #define HAL_MMC_MODULE_ENABLED */
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_OPAMP_MODULE_ENABLED */
-/* #define HAL_PCD_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-/* #define HAL_RAMECC_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-#define HAL_SPI_MODULE_ENABLED
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SWPMI_MODULE_ENABLED */
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_UART_MODULE_ENABLED
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-
-/* ########################## Oscillator Values adaptation ####################*/
-/**
- * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSE is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSE_VALUE)
-//#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
-#error HSE_VALUE is not defined
-#endif /* HSE_VALUE */
-
-#if !defined (HSE_STARTUP_TIMEOUT)
- #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */
-#endif /* HSE_STARTUP_TIMEOUT */
-
-/**
- * @brief Internal oscillator (CSI) default value.
- * This value is the default CSI value after Reset.
- */
-#if !defined (CSI_VALUE)
- #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
-#endif /* CSI_VALUE */
-
-/**
- * @brief Internal High Speed oscillator (HSI) value.
- * This value is used by the RCC HAL module to compute the system frequency
- * (when HSI is used as system clock source, directly or through the PLL).
- */
-#if !defined (HSI_VALUE)
- #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/
-#endif /* HSI_VALUE */
-
-/**
- * @brief External Low Speed oscillator (LSE) value.
- * This value is used by the UART, RTC HAL module to compute the system frequency
- */
-#if !defined (LSE_VALUE)
- #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External oscillator in Hz*/
-#endif /* LSE_VALUE */
-
-
-#if !defined (LSE_STARTUP_TIMEOUT)
- #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */
-#endif /* LSE_STARTUP_TIMEOUT */
-
-#if !defined (LSI_VALUE)
- #define LSI_VALUE ((uint32_t)32000) /*!< LSI Typical Value in Hz*/
-#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
- The real value may vary depending on the variations
- in voltage and temperature.*/
-
-/**
- * @brief External clock source for I2S peripheral
- * This value is used by the I2S HAL module to compute the I2S clock source
- * frequency, this source is inserted directly through I2S_CKIN pad.
- */
-#if !defined (EXTERNAL_CLOCK_VALUE)
- #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/
-#endif /* EXTERNAL_CLOCK_VALUE */
-
-/* Tip: To avoid modifying this file each time you need to use different HSE,
- === you can define the HSE value in your toolchain compiler preprocessor. */
-
-/* ########################### System Configuration ######################### */
-/**
- * @brief This is the HAL system configuration section
- */
-#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */
-#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */
-#define USE_RTOS 0
-#define USE_SD_TRANSCEIVER 1U /*!< use uSD Transceiver */
-#define USE_SPI_CRC 1U /*!< use CRC in SPI */
-
-#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
-#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
-#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */
-#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
-#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
-#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
-#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
-#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
-#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
-#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
-#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */
-#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
-#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
-#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
-#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
-#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
-#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
-#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */
-#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
-#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
-#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
-#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
-#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
-#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */
-#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */
-#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
-#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
-#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
-#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
-#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
-#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
-#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
-#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
-#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */
-#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
-#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
-#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
-#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
-
-/* ########################### Ethernet Configuration ######################### */
-#define ETH_TX_DESC_CNT 4 /* number of Ethernet Tx DMA descriptors */
-#define ETH_RX_DESC_CNT 4 /* number of Ethernet Rx DMA descriptors */
-
-#define ETH_MAC_ADDR0 ((uint8_t)0x02)
-#define ETH_MAC_ADDR1 ((uint8_t)0x00)
-#define ETH_MAC_ADDR2 ((uint8_t)0x00)
-#define ETH_MAC_ADDR3 ((uint8_t)0x00)
-#define ETH_MAC_ADDR4 ((uint8_t)0x00)
-#define ETH_MAC_ADDR5 ((uint8_t)0x00)
-
-/* ########################## Assert Selection ############################## */
-/**
- * @brief Uncomment the line below to expanse the "assert_param" macro in the
- * HAL drivers code
- */
-/* #define USE_FULL_ASSERT 1 */
-
-
-/* Includes ------------------------------------------------------------------*/
-/**
- * @brief Include module's header file
- */
-
-#ifdef HAL_RCC_MODULE_ENABLED
- #include "stm32h7xx_hal_rcc.h"
-#endif /* HAL_RCC_MODULE_ENABLED */
-
-#ifdef HAL_GPIO_MODULE_ENABLED
- #include "stm32h7xx_hal_gpio.h"
-#endif /* HAL_GPIO_MODULE_ENABLED */
-
-#ifdef HAL_DMA_MODULE_ENABLED
- #include "stm32h7xx_hal_dma.h"
-#endif /* HAL_DMA_MODULE_ENABLED */
-
-#ifdef HAL_MDMA_MODULE_ENABLED
- #include "stm32h7xx_hal_mdma.h"
-#endif /* HAL_MDMA_MODULE_ENABLED */
-
-#ifdef HAL_HASH_MODULE_ENABLED
- #include "stm32h7xx_hal_hash.h"
-#endif /* HAL_HASH_MODULE_ENABLED */
-
-#ifdef HAL_DCMI_MODULE_ENABLED
- #include "stm32h7xx_hal_dcmi.h"
-#endif /* HAL_DCMI_MODULE_ENABLED */
-
-#ifdef HAL_DMA2D_MODULE_ENABLED
- #include "stm32h7xx_hal_dma2d.h"
-#endif /* HAL_DMA2D_MODULE_ENABLED */
-
-#ifdef HAL_DSI_MODULE_ENABLED
- #include "stm32h7xx_hal_dsi.h"
-#endif /* HAL_DSI_MODULE_ENABLED */
-
-#ifdef HAL_DFSDM_MODULE_ENABLED
- #include "stm32h7xx_hal_dfsdm.h"
-#endif /* HAL_DFSDM_MODULE_ENABLED */
-
-#ifdef HAL_ETH_MODULE_ENABLED
- #include "stm32h7xx_hal_eth.h"
-#endif /* HAL_ETH_MODULE_ENABLED */
-
-#ifdef HAL_EXTI_MODULE_ENABLED
- #include "stm32h7xx_hal_exti.h"
-#endif /* HAL_EXTI_MODULE_ENABLED */
-
-#ifdef HAL_CORTEX_MODULE_ENABLED
- #include "stm32h7xx_hal_cortex.h"
-#endif /* HAL_CORTEX_MODULE_ENABLED */
-
-#ifdef HAL_ADC_MODULE_ENABLED
- #include "stm32h7xx_hal_adc.h"
-#endif /* HAL_ADC_MODULE_ENABLED */
-
-#ifdef HAL_FDCAN_MODULE_ENABLED
- #include "stm32h7xx_hal_fdcan.h"
-#endif /* HAL_FDCAN_MODULE_ENABLED */
-
-#ifdef HAL_CEC_MODULE_ENABLED
- #include "stm32h7xx_hal_cec.h"
-#endif /* HAL_CEC_MODULE_ENABLED */
-
-#ifdef HAL_COMP_MODULE_ENABLED
- #include "stm32h7xx_hal_comp.h"
-#endif /* HAL_COMP_MODULE_ENABLED */
-
-#ifdef HAL_CRC_MODULE_ENABLED
- #include "stm32h7xx_hal_crc.h"
-#endif /* HAL_CRC_MODULE_ENABLED */
-
-#ifdef HAL_CRYP_MODULE_ENABLED
- #include "stm32h7xx_hal_cryp.h"
-#endif /* HAL_CRYP_MODULE_ENABLED */
-
-#ifdef HAL_DAC_MODULE_ENABLED
- #include "stm32h7xx_hal_dac.h"
-#endif /* HAL_DAC_MODULE_ENABLED */
-
-#ifdef HAL_FLASH_MODULE_ENABLED
- #include "stm32h7xx_hal_flash.h"
-#endif /* HAL_FLASH_MODULE_ENABLED */
-
-#ifdef HAL_HRTIM_MODULE_ENABLED
- #include "stm32h7xx_hal_hrtim.h"
-#endif /* HAL_HRTIM_MODULE_ENABLED */
-
-#ifdef HAL_HSEM_MODULE_ENABLED
- #include "stm32h7xx_hal_hsem.h"
-#endif /* HAL_HSEM_MODULE_ENABLED */
-
-#ifdef HAL_SRAM_MODULE_ENABLED
- #include "stm32h7xx_hal_sram.h"
-#endif /* HAL_SRAM_MODULE_ENABLED */
-
-#ifdef HAL_NOR_MODULE_ENABLED
- #include "stm32h7xx_hal_nor.h"
-#endif /* HAL_NOR_MODULE_ENABLED */
-
-#ifdef HAL_NAND_MODULE_ENABLED
- #include "stm32h7xx_hal_nand.h"
-#endif /* HAL_NAND_MODULE_ENABLED */
-
-#ifdef HAL_I2C_MODULE_ENABLED
- #include "stm32h7xx_hal_i2c.h"
-#endif /* HAL_I2C_MODULE_ENABLED */
-
-#ifdef HAL_I2S_MODULE_ENABLED
- #include "stm32h7xx_hal_i2s.h"
-#endif /* HAL_I2S_MODULE_ENABLED */
-
-#ifdef HAL_IWDG_MODULE_ENABLED
- #include "stm32h7xx_hal_iwdg.h"
-#endif /* HAL_IWDG_MODULE_ENABLED */
-
-#ifdef HAL_JPEG_MODULE_ENABLED
- #include "stm32h7xx_hal_jpeg.h"
-#endif /* HAL_JPEG_MODULE_ENABLED */
-
-#ifdef HAL_MDIOS_MODULE_ENABLED
- #include "stm32h7xx_hal_mdios.h"
-#endif /* HAL_MDIOS_MODULE_ENABLED */
-
-#ifdef HAL_MMC_MODULE_ENABLED
- #include "stm32h7xx_hal_mmc.h"
-#endif /* HAL_MMC_MODULE_ENABLED */
-
-#ifdef HAL_LPTIM_MODULE_ENABLED
-#include "stm32h7xx_hal_lptim.h"
-#endif /* HAL_LPTIM_MODULE_ENABLED */
-
-#ifdef HAL_LTDC_MODULE_ENABLED
-#include "stm32h7xx_hal_ltdc.h"
-#endif /* HAL_LTDC_MODULE_ENABLED */
-
-#ifdef HAL_OPAMP_MODULE_ENABLED
-#include "stm32h7xx_hal_opamp.h"
-#endif /* HAL_OPAMP_MODULE_ENABLED */
-
-#ifdef HAL_PWR_MODULE_ENABLED
- #include "stm32h7xx_hal_pwr.h"
-#endif /* HAL_PWR_MODULE_ENABLED */
-
-#ifdef HAL_QSPI_MODULE_ENABLED
- #include "stm32h7xx_hal_qspi.h"
-#endif /* HAL_QSPI_MODULE_ENABLED */
-
-#ifdef HAL_RAMECC_MODULE_ENABLED
- #include "stm32h7xx_hal_ramecc.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-#ifdef HAL_RNG_MODULE_ENABLED
- #include "stm32h7xx_hal_rng.h"
-#endif /* HAL_RNG_MODULE_ENABLED */
-
-#ifdef HAL_RTC_MODULE_ENABLED
- #include "stm32h7xx_hal_rtc.h"
-#endif /* HAL_RTC_MODULE_ENABLED */
-
-#ifdef HAL_SAI_MODULE_ENABLED
- #include "stm32h7xx_hal_sai.h"
-#endif /* HAL_SAI_MODULE_ENABLED */
-
-#ifdef HAL_SD_MODULE_ENABLED
- #include "stm32h7xx_hal_sd.h"
-#endif /* HAL_SD_MODULE_ENABLED */
-
-#ifdef HAL_SDRAM_MODULE_ENABLED
- #include "stm32h7xx_hal_sdram.h"
-#endif /* HAL_SDRAM_MODULE_ENABLED */
-
-#ifdef HAL_SPI_MODULE_ENABLED
- #include "stm32h7xx_hal_spi.h"
-#endif /* HAL_SPI_MODULE_ENABLED */
-
-#ifdef HAL_SPDIFRX_MODULE_ENABLED
- #include "stm32h7xx_hal_spdifrx.h"
-#endif /* HAL_SPDIFRX_MODULE_ENABLED */
-
-#ifdef HAL_SWPMI_MODULE_ENABLED
- #include "stm32h7xx_hal_swpmi.h"
-#endif /* HAL_SWPMI_MODULE_ENABLED */
-
-#ifdef HAL_TIM_MODULE_ENABLED
- #include "stm32h7xx_hal_tim.h"
-#endif /* HAL_TIM_MODULE_ENABLED */
-
-#ifdef HAL_UART_MODULE_ENABLED
- #include "stm32h7xx_hal_uart.h"
-#endif /* HAL_UART_MODULE_ENABLED */
-
-#ifdef HAL_USART_MODULE_ENABLED
- #include "stm32h7xx_hal_usart.h"
-#endif /* HAL_USART_MODULE_ENABLED */
-
-#ifdef HAL_IRDA_MODULE_ENABLED
- #include "stm32h7xx_hal_irda.h"
-#endif /* HAL_IRDA_MODULE_ENABLED */
-
-#ifdef HAL_SMARTCARD_MODULE_ENABLED
- #include "stm32h7xx_hal_smartcard.h"
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */
-
-#ifdef HAL_SMBUS_MODULE_ENABLED
- #include "stm32h7xx_hal_smbus.h"
-#endif /* HAL_SMBUS_MODULE_ENABLED */
-
-#ifdef HAL_WWDG_MODULE_ENABLED
- #include "stm32h7xx_hal_wwdg.h"
-#endif /* HAL_WWDG_MODULE_ENABLED */
-
-#ifdef HAL_PCD_MODULE_ENABLED
- #include "stm32h7xx_hal_pcd.h"
-#endif /* HAL_PCD_MODULE_ENABLED */
-
-#ifdef HAL_HCD_MODULE_ENABLED
- #include "stm32h7xx_hal_hcd.h"
-#endif /* HAL_HCD_MODULE_ENABLED */
-
-/* Exported macro ------------------------------------------------------------*/
-#ifdef USE_FULL_ASSERT
-/**
- * @brief The assert_param macro is used for function's parameters check.
- * @param expr: If expr is false, it calls assert_failed function
- * which reports the name of the source file and the source
- * line number of the call that failed.
- * If expr is true, it returns no value.
- * @retval None
- */
- #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
-/* Exported functions ------------------------------------------------------- */
- void assert_failed(uint8_t *file, uint32_t line);
-#else
- #define assert_param(expr) ((void)0U)
-#endif /* USE_FULL_ASSERT */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STM32H7xx_HAL_CONF_H */
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/hw/mcu/dialog/README.md b/tinyusb/hw/mcu/dialog/README.md
deleted file mode 100755
index 69676f08..00000000
--- a/tinyusb/hw/mcu/dialog/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Dialog DA1469x MCU
-
-**Dialog Semiconductors** provides SDKs for DA146x MCU family.
-Most of the files there can't be redistributed.
-Registers definition file `DA1469xAB.h` and some **ARM** originated headers are have licenses that allow
-for redistribution.
-Whole SDK repository can be downloaded from Dialog Semiconductor web page `https://www.dialog.com`
-
-
diff --git a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/arm_license.txt b/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/arm_license.txt
deleted file mode 100755
index b324eb28..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/arm_license.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (c) 2009 - 2013 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.
- ---------------------------------------------------------------------------*/
-
diff --git a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/DA1469xAB.h b/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/DA1469xAB.h
deleted file mode 100755
index fa2ca5d9..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/DA1469xAB.h
+++ /dev/null
@@ -1,8657 +0,0 @@
-/*
- * Copyright (C) 2019 Dialog Semiconductor. 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 Dialog Semiconductor 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.
- *
- * @file DA1469xAB.h
- * @brief CMSIS HeaderFile
- * @version 1.2
- * @date 22. April 2019
- * @note Generated by SVDConv V3.3.25 on Monday, 22.04.2019 11:06:30
- * from File 'DA1469xAB.xml',
- */
-
-
-
-/** @addtogroup PLA_BSP_REGISTERS
- * @{
- */
-
-
-/** @addtogroup DA1469x
- * @{
- */
-
-
-#ifndef DA1469X_H
-#define DA1469X_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/** @addtogroup Configuration_of_CMSIS
- * @{
- */
-
-
-/* =========================================================================================================================== */
-/* ================ Interrupt Number Definition ================ */
-/* =========================================================================================================================== */
-
-/**
- * @brief Interrupt Number Definition
- */
-
-typedef enum {
-/* ======================================= ARM Cortex-M33 Specific Interrupt Numbers ======================================= */
- Reset_IRQn = -15, /*!< -15 Reset Vector, invoked on Power up and warm reset */
- NonMaskableInt_IRQn = -14, /*!< -14 Non maskable Interrupt, cannot be stopped or preempted */
- HardFault_IRQn = -13, /*!< -13 Hard Fault, all classes of Fault */
- MemoryManagement_IRQn = -12, /*!< -12 Memory Management, MPU mismatch, including Access Violation
- and No Match */
- BusFault_IRQn = -11, /*!< -11 Bus Fault, Pre-Fetch-, Memory Access Fault, other address/memory
- related Fault */
- UsageFault_IRQn = -10, /*!< -10 Usage Fault, i.e. Undef Instruction, Illegal State Transition */
- SecureFault_IRQn = -9, /*!< -9 Secure Fault Handler */
- SVCall_IRQn = -5, /*!< -5 System Service Call via SVC instruction */
- DebugMonitor_IRQn = -4, /*!< -4 Debug Monitor */
- PendSV_IRQn = -2, /*!< -2 Pendable request for system service */
- SysTick_IRQn = -1, /*!< -1 System Tick Timer */
-/* ========================================== DA1469x Specific Interrupt Numbers =========================================== */
- SNC_IRQn = 0, /*!< 0 Sensor Node Controller interrupt request. */
- DMA_IRQn = 1, /*!< 1 General Purpose DMA interrupt request. */
- CHARGER_STATE_IRQn = 2, /*!< 2 Charger State interrupt request. */
- CHARGER_ERROR_IRQn = 3, /*!< 3 Charger Error interrupt request. */
- CMAC2SYS_IRQn = 4, /*!< 4 CMAC and mailbox interrupt request. */
- UART_IRQn = 5, /*!< 5 UART interrupt request. */
- UART2_IRQn = 6, /*!< 6 UART2 interrupt request. */
- UART3_IRQn = 7, /*!< 7 UART3 interrupt request. */
- I2C_IRQn = 8, /*!< 8 I2C interrupt request. */
- I2C2_IRQn = 9, /*!< 9 I2C2 interrupt request. */
- SPI_IRQn = 10, /*!< 10 SPI interrupt request. */
- SPI2_IRQn = 11, /*!< 11 SPI2 interrupt request. */
- PCM_IRQn = 12, /*!< 12 PCM interrupt request. */
- SRC_IN_IRQn = 13, /*!< 13 SRC input interrupt request. */
- SRC_OUT_IRQn = 14, /*!< 14 SRC output interrupt request. */
- USB_IRQn = 15, /*!< 15 USB interrupt request. */
- TIMER_IRQn = 16, /*!< 16 TIMER interrupt request. */
- TIMER2_IRQn = 17, /*!< 17 TIMER2 interrupt request. */
- RTC_IRQn = 18, /*!< 18 RTC interrupt request. */
- KEY_WKUP_GPIO_IRQn = 19, /*!< 19 Debounced button press interrupt request. */
- PDC_IRQn = 20, /*!< 20 Wakeup IRQ from PDC to CM33 */
- VBUS_IRQn = 21, /*!< 21 VBUS presence interrupt request. */
- MRM_IRQn = 22, /*!< 22 Cache Miss Rate Monitor interrupt request. */
- MOTOR_CONTROLLER_IRQn = 23, /*!< 23 MOTOR and mailbox interrupt request. */
- TRNG_IRQn = 24, /*!< 24 True Random Number Generation interrupt request. */
- DCDC_IRQn = 25, /*!< 25 DCDC interrupt request. */
- XTAL32M_RDY_IRQn = 26, /*!< 26 XTAL32M trimmed and ready interrupt request. */
- GPADC_IRQn = 27, /*!< 27 General Purpose Analog-Digital Converter interrupt request. */
- SDADC_IRQn = 28, /*!< 28 Sigma Delta Analog-Digital Converter interrupt request. */
- CRYPTO_IRQn = 29, /*!< 29 Crypto interrupt request. */
- CAPTIMER_IRQn = 30, /*!< 30 GPIO triggered Timer Capture interrupt request. */
- RFDIAG_IRQn = 31, /*!< 31 Baseband or Radio Diagnostics interrupt request. */
- LCD_CONTROLLER_IRQn = 32, /*!< 32 Parallel LCD Controller interrupt request. */
- PLL_LOCK_IRQn = 33, /*!< 33 Pll lock interrupt request. */
- TIMER3_IRQn = 34, /*!< 34 TIMER3 interrupt request. */
- TIMER4_IRQn = 35, /*!< 35 TIMER4 interrupt request. */
- LRA_IRQn = 36, /*!< 36 LRA/ERM interrupt request. */
- RTC_EVENT_IRQn = 37, /*!< 37 RTC event interrupt request. */
- GPIO_P0_IRQn = 38, /*!< 38 GPIO port 0 toggle interrupt request. */
- GPIO_P1_IRQn = 39 /*!< 39 GPIO port 1 toggle interrupt request. */
-} IRQn_Type;
-
-
-
-/* =========================================================================================================================== */
-/* ================ Processor and Core Peripheral Section ================ */
-/* =========================================================================================================================== */
-
-/* ========================== Configuration of the ARM Cortex-M33 Processor and Core Peripherals =========================== */
-#define __CM33_REV 0x0000U /*!< CM33 Core Revision */
-#define __NVIC_PRIO_BITS 4 /*!< Number of Bits used for Priority Levels */
-#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
-#define __VTOR_PRESENT 1 /*!< Set to 1 if CPU supports Vector Table Offset Register */
-#define __MPU_PRESENT 1 /*!< MPU present */
-#define __FPU_PRESENT 1 /*!< FPU present */
-#define __FPU_DP 0 /*!< Double Precision FPU */
-#define __DSP_PRESENT 1 /*!< DSP extension present */
-#define __SAU_REGION_PRESENT 0 /*!< SAU present */
-
-
-/** @} */ /* End of group Configuration_of_CMSIS */
-
-#include "core_cm33.h" /*!< ARM Cortex-M33 processor and core peripherals */
-#include "system_DA1469x.h" /*!< DA1469x System */
-
-#ifndef __IM /*!< Fallback for older CMSIS versions */
- #define __IM __I
-#endif
-#ifndef __OM /*!< Fallback for older CMSIS versions */
- #define __OM __O
-#endif
-#ifndef __IOM /*!< Fallback for older CMSIS versions */
- #define __IOM __IO
-#endif
-
-
-/* =========================================================================================================================== */
-/* ================ Device Specific Peripheral Section ================ */
-/* =========================================================================================================================== */
-
-
-/** @addtogroup Device_Peripheral_peripherals
- * @{
- */
-
-
-
-/* =========================================================================================================================== */
-/* ================ AES_HASH ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief AES_HASH registers (AES_HASH)
- */
-
-typedef struct { /*!< (@ 0x30040000) AES_HASH Structure */
- __IOM uint32_t CRYPTO_CTRL_REG; /*!< (@ 0x00000000) Crypto Control register */
- __IOM uint32_t CRYPTO_START_REG; /*!< (@ 0x00000004) Crypto Start calculation */
- __IOM uint32_t CRYPTO_FETCH_ADDR_REG; /*!< (@ 0x00000008) Crypto DMA fetch register */
- __IOM uint32_t CRYPTO_LEN_REG; /*!< (@ 0x0000000C) Crypto Length of the input block in bytes */
- __IOM uint32_t CRYPTO_DEST_ADDR_REG; /*!< (@ 0x00000010) Crypto DMA destination memory */
- __IOM uint32_t CRYPTO_STATUS_REG; /*!< (@ 0x00000014) Crypto Status register */
- __IOM uint32_t CRYPTO_CLRIRQ_REG; /*!< (@ 0x00000018) Crypto Clear interrupt request */
- __IOM uint32_t CRYPTO_MREG0_REG; /*!< (@ 0x0000001C) Crypto Mode depended register 0 */
- __IOM uint32_t CRYPTO_MREG1_REG; /*!< (@ 0x00000020) Crypto Mode depended register 1 */
- __IOM uint32_t CRYPTO_MREG2_REG; /*!< (@ 0x00000024) Crypto Mode depended register 2 */
- __IOM uint32_t CRYPTO_MREG3_REG; /*!< (@ 0x00000028) Crypto Mode depended register 3 */
- __IM uint32_t RESERVED[53];
- __IOM uint32_t CRYPTO_KEYS_START; /*!< (@ 0x00000100) Crypto First position of the AES keys storage
- memory */
-} AES_HASH_Type; /*!< Size = 260 (0x104) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ ANAMISC_BIF ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief ANAMISC_BIF registers (ANAMISC_BIF)
- */
-
-typedef struct { /*!< (@ 0x50030B00) ANAMISC_BIF Structure */
- __IM uint32_t RESERVED[4];
- __IOM uint32_t CLK_REF_SEL_REG; /*!< (@ 0x00000010) Select clock for oscillator calibration */
- __IOM uint32_t CLK_REF_CNT_REG; /*!< (@ 0x00000014) Count value for oscillator calibration */
- __IOM uint32_t CLK_REF_VAL_REG; /*!< (@ 0x00000018) DIVN reference cycles, lower 16 bits */
-} ANAMISC_BIF_Type; /*!< Size = 28 (0x1c) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ APU ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief APU registers (APU)
- */
-
-typedef struct { /*!< (@ 0x50030600) APU Structure */
- __IOM uint32_t SRC1_CTRL_REG; /*!< (@ 0x00000000) SRC1 control register */
- __IOM uint32_t SRC1_IN_FS_REG; /*!< (@ 0x00000004) SRC1 Sample input rate */
- __IOM uint32_t SRC1_OUT_FS_REG; /*!< (@ 0x00000008) SRC1 Sample output rate */
- __IOM uint32_t SRC1_IN1_REG; /*!< (@ 0x0000000C) SRC1 data in 1 */
- __IOM uint32_t SRC1_IN2_REG; /*!< (@ 0x00000010) SRC1 data in 2 */
- __IOM uint32_t SRC1_OUT1_REG; /*!< (@ 0x00000014) SRC1 data out 1 */
- __IOM uint32_t SRC1_OUT2_REG; /*!< (@ 0x00000018) SRC1 data out 2 */
- __IOM uint32_t APU_MUX_REG; /*!< (@ 0x0000001C) APU mux register */
- __IOM uint32_t COEF10_SET1_REG; /*!< (@ 0x00000020) SRC coefficient 1,0 set 1 */
- __IOM uint32_t COEF32_SET1_REG; /*!< (@ 0x00000024) SRC coefficient 3,2 set 1 */
- __IOM uint32_t COEF54_SET1_REG; /*!< (@ 0x00000028) SRC coefficient 5,4 set 1 */
- __IOM uint32_t COEF76_SET1_REG; /*!< (@ 0x0000002C) SRC coefficient 7,6 set 1 */
- __IOM uint32_t COEF98_SET1_REG; /*!< (@ 0x00000030) SRC coefficient 9,8 set 1 */
- __IOM uint32_t COEF0A_SET1_REG; /*!< (@ 0x00000034) SRC coefficient 10 set 1 */
- __IM uint32_t RESERVED[50];
- __IOM uint32_t PCM1_CTRL_REG; /*!< (@ 0x00000100) PCM1 Control register */
- __IOM uint32_t PCM1_IN1_REG; /*!< (@ 0x00000104) PCM1 data in 1 */
- __IOM uint32_t PCM1_IN2_REG; /*!< (@ 0x00000108) PCM1 data in 2 */
- __IOM uint32_t PCM1_OUT1_REG; /*!< (@ 0x0000010C) PCM1 data out 1 */
- __IOM uint32_t PCM1_OUT2_REG; /*!< (@ 0x00000110) PCM1 data out 2 */
-} APU_Type; /*!< Size = 276 (0x114) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ CACHE ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief CACHE registers (CACHE)
- */
-
-typedef struct { /*!< (@ 0x100C0000) CACHE Structure */
- __IOM uint32_t CACHE_CTRL1_REG; /*!< (@ 0x00000000) Cache control register 1 */
- __IOM uint32_t CACHE_LNSIZECFG_REG; /*!< (@ 0x00000004) Cache line size configuration register */
- __IOM uint32_t CACHE_ASSOCCFG_REG; /*!< (@ 0x00000008) Cache associativity configuration register */
- __IM uint32_t RESERVED[5];
- __IOM uint32_t CACHE_CTRL2_REG; /*!< (@ 0x00000020) Cache control register 2 */
- __IM uint32_t RESERVED1;
- __IOM uint32_t CACHE_MRM_HITS_REG; /*!< (@ 0x00000028) Cache MRM (Miss Rate Monitor) HITS register */
- __IOM uint32_t CACHE_MRM_MISSES_REG; /*!< (@ 0x0000002C) Cache MRM (Miss Rate Monitor) MISSES register */
- __IOM uint32_t CACHE_MRM_CTRL_REG; /*!< (@ 0x00000030) Cache MRM (Miss Rate Monitor) CONTROL register */
- __IOM uint32_t CACHE_MRM_TINT_REG; /*!< (@ 0x00000034) Cache MRM (Miss Rate Monitor) TIME INTERVAL register */
- __IOM uint32_t CACHE_MRM_MISSES_THRES_REG; /*!< (@ 0x00000038) Cache MRM (Miss Rate Monitor) THRESHOLD register */
- __IOM uint32_t CACHE_MRM_HITS_THRES_REG; /*!< (@ 0x0000003C) Cache MRM (Miss Rate Monitor) HITS THRESHOLD
- register */
- __IOM uint32_t CACHE_FLASH_REG; /*!< (@ 0x00000040) Cache Flash program size and base address register */
- __IM uint32_t RESERVED2[3];
- __IOM uint32_t SWD_RESET_REG; /*!< (@ 0x00000050) SWD HW reset control register */
-} CACHE_Type; /*!< Size = 84 (0x54) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ CHARGER ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief CHARGER registers (CHARGER)
- */
-
-typedef struct { /*!< (@ 0x50040400) CHARGER Structure */
- __IOM uint32_t CHARGER_CTRL_REG; /*!< (@ 0x00000000) Charger main control register */
- __IOM uint32_t CHARGER_TEST_CTRL_REG; /*!< (@ 0x00000004) Charger test control register */
- __IOM uint32_t CHARGER_STATUS_REG; /*!< (@ 0x00000008) Charger main status register */
- __IOM uint32_t CHARGER_VOLTAGE_PARAM_REG; /*!< (@ 0x0000000C) Charger voltage settings register */
- __IOM uint32_t CHARGER_CURRENT_PARAM_REG; /*!< (@ 0x00000010) Charger current settings register */
- __IOM uint32_t CHARGER_TEMPSET_PARAM_REG; /*!< (@ 0x00000014) Charger battery temperature settings register */
- __IOM uint32_t CHARGER_PRE_CHARGE_TIMER_REG; /*!< (@ 0x00000018) Maximum pre-charge time limit register */
- __IOM uint32_t CHARGER_CC_CHARGE_TIMER_REG; /*!< (@ 0x0000001C) Maximum CC-charge time limit register */
- __IOM uint32_t CHARGER_CV_CHARGE_TIMER_REG; /*!< (@ 0x00000020) Maximum CV-charge time limit register */
- __IOM uint32_t CHARGER_TOTAL_CHARGE_TIMER_REG;/*!< (@ 0x00000024) Maximum total charge time limit register */
- __IOM uint32_t CHARGER_JEITA_V_CHARGE_REG; /*!< (@ 0x00000028) JEITA-compliant Charge voltage settings register */
- __IOM uint32_t CHARGER_JEITA_V_PRECHARGE_REG;/*!< (@ 0x0000002C) JEITA-compliant Pre-Charge voltage settings register */
- __IOM uint32_t CHARGER_JEITA_V_REPLENISH_REG;/*!< (@ 0x00000030) JEITA-compliant Replenish settings register */
- __IOM uint32_t CHARGER_JEITA_V_OVP_REG; /*!< (@ 0x00000034) JEITA-compliant OVP settings register */
- __IOM uint32_t CHARGER_JEITA_CURRENT_REG; /*!< (@ 0x00000038) JEITA-compliant current settings register */
- __IOM uint32_t CHARGER_VBAT_COMP_TIMER_REG; /*!< (@ 0x0000003C) Main Vbat comparator timer register */
- __IOM uint32_t CHARGER_VOVP_COMP_TIMER_REG; /*!< (@ 0x00000040) Vbat OVP comparator timer register */
- __IOM uint32_t CHARGER_TDIE_COMP_TIMER_REG; /*!< (@ 0x00000044) Die temperature comparator timer register */
- __IOM uint32_t CHARGER_TBAT_MON_TIMER_REG; /*!< (@ 0x00000048) Battery temperature monitor interval timer */
- __IOM uint32_t CHARGER_TBAT_COMP_TIMER_REG; /*!< (@ 0x0000004C) Battery temperature (main) comparator timer */
- __IOM uint32_t CHARGER_THOT_COMP_TIMER_REG; /*!< (@ 0x00000050) Battery temperature comparator timer for 'Hot'
- zone */
- __IOM uint32_t CHARGER_PWR_UP_TIMER_REG; /*!< (@ 0x00000054) Charger power-up (settling) timer */
- __IOM uint32_t CHARGER_STATE_IRQ_MASK_REG; /*!< (@ 0x00000058) Mask register of Charger FSM IRQs */
- __IOM uint32_t CHARGER_ERROR_IRQ_MASK_REG; /*!< (@ 0x0000005C) Mask register of Charger Error IRQs */
- __IOM uint32_t CHARGER_STATE_IRQ_STATUS_REG; /*!< (@ 0x00000060) Status register of Charger FSM IRQs */
- __IOM uint32_t CHARGER_ERROR_IRQ_STATUS_REG; /*!< (@ 0x00000064) Status register of Charger Error IRQs */
- __IOM uint32_t CHARGER_STATE_IRQ_CLR_REG; /*!< (@ 0x00000068) Interrupt clear register of Charger FSM IRQs */
- __IOM uint32_t CHARGER_ERROR_IRQ_CLR_REG; /*!< (@ 0x0000006C) Interrupt clear register of Charger Error IRQs */
-} CHARGER_Type; /*!< Size = 112 (0x70) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ CHIP_VERSION ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief CHIP_VERSION registers (CHIP_VERSION)
- */
-
-typedef struct { /*!< (@ 0x50040200) CHIP_VERSION Structure */
- __IOM uint32_t CHIP_ID1_REG; /*!< (@ 0x00000000) Chip identification register 1. */
- __IOM uint32_t CHIP_ID2_REG; /*!< (@ 0x00000004) Chip identification register 2. */
- __IOM uint32_t CHIP_ID3_REG; /*!< (@ 0x00000008) Chip identification register 3. */
- __IOM uint32_t CHIP_ID4_REG; /*!< (@ 0x0000000C) Chip identification register 4. */
- __IOM uint32_t CHIP_SWC_REG; /*!< (@ 0x00000010) Software compatibility register. */
- __IOM uint32_t CHIP_REVISION_REG; /*!< (@ 0x00000014) Chip revision register. */
- __IM uint32_t RESERVED[56];
- __IOM uint32_t CHIP_TEST1_REG; /*!< (@ 0x000000F8) Chip test register 1. */
- __IOM uint32_t CHIP_TEST2_REG; /*!< (@ 0x000000FC) Chip test register 2. */
-} CHIP_VERSION_Type; /*!< Size = 256 (0x100) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ CRG_COM ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief CRG_COM registers (CRG_COM)
- */
-
-typedef struct { /*!< (@ 0x50020900) CRG_COM Structure */
- __IM uint32_t RESERVED;
- __IOM uint32_t CLK_COM_REG; /*!< (@ 0x00000004) Peripheral divider register */
- __IOM uint32_t SET_CLK_COM_REG; /*!< (@ 0x00000008) Peripheral divider register SET register. Reads
- back 0x0000 */
- __IOM uint32_t RESET_CLK_COM_REG; /*!< (@ 0x0000000C) Peripheral divider register RESET register. Reads
- back 0x0000 */
-} CRG_COM_Type; /*!< Size = 16 (0x10) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ CRG_PER ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief CRG_PER registers (CRG_PER)
- */
-
-typedef struct { /*!< (@ 0x50030C00) CRG_PER Structure */
- __IM uint32_t RESERVED;
- __IOM uint32_t CLK_PER_REG; /*!< (@ 0x00000004) Peripheral divider register */
- __IOM uint32_t SET_CLK_PER_REG; /*!< (@ 0x00000008) Peripheral divider register SET register, reads
- 0x0000 */
- __IOM uint32_t RESET_CLK_PER_REG; /*!< (@ 0x0000000C) Peripheral divider register RESET register, reads
- 0x0000 */
- __IM uint32_t RESERVED1[12];
- __IOM uint32_t PCM_DIV_REG; /*!< (@ 0x00000040) PCM divider and enables */
- __IOM uint32_t PCM_FDIV_REG; /*!< (@ 0x00000044) PCM fractional division register */
- __IOM uint32_t PDM_DIV_REG; /*!< (@ 0x00000048) PDM divider and enables */
- __IOM uint32_t SRC_DIV_REG; /*!< (@ 0x0000004C) SRC divider and enables */
-} CRG_PER_Type; /*!< Size = 80 (0x50) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ CRG_SYS ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief CRG_SYS registers (CRG_SYS)
- */
-
-typedef struct { /*!< (@ 0x50040500) CRG_SYS Structure */
- __IOM uint32_t CLK_SYS_REG; /*!< (@ 0x00000000) Peripheral divider register */
- __IOM uint32_t BATCHECK_REG; /*!< (@ 0x00000004) BATCHECK_REG */
-} CRG_SYS_Type; /*!< Size = 8 (0x8) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ CRG_TOP ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief CRG_TOP registers (CRG_TOP)
- */
-
-typedef struct { /*!< (@ 0x50000000) CRG_TOP Structure */
- __IOM uint32_t CLK_AMBA_REG; /*!< (@ 0x00000000) HCLK, PCLK, divider and clock gates */
- __IM uint32_t RESERVED[3];
- __IOM uint32_t CLK_RADIO_REG; /*!< (@ 0x00000010) Radio PLL control register */
- __IOM uint32_t CLK_CTRL_REG; /*!< (@ 0x00000014) Clock control register */
- __IOM uint32_t CLK_TMR_REG; /*!< (@ 0x00000018) Clock control for the timers */
- __IOM uint32_t CLK_SWITCH2XTAL_REG; /*!< (@ 0x0000001C) Switches clock from RC32M to XTAL32M */
- __IOM uint32_t PMU_CTRL_REG; /*!< (@ 0x00000020) Power Management Unit control register */
- __IOM uint32_t SYS_CTRL_REG; /*!< (@ 0x00000024) System Control register */
- __IOM uint32_t SYS_STAT_REG; /*!< (@ 0x00000028) System status register */
- __IM uint32_t RESERVED1[4];
- __IOM uint32_t CLK_RC32K_REG; /*!< (@ 0x0000003C) 32 kHz RC oscillator register */
- __IOM uint32_t CLK_XTAL32K_REG; /*!< (@ 0x00000040) 32 kHz XTAL oscillator register */
- __IOM uint32_t CLK_RC32M_REG; /*!< (@ 0x00000044) Fast RC control register */
- __IOM uint32_t CLK_RCX_REG; /*!< (@ 0x00000048) RCX-oscillator control register */
- __IOM uint32_t CLK_RTCDIV_REG; /*!< (@ 0x0000004C) Divisor for RTC 100Hz clock */
- __IOM uint32_t BANDGAP_REG; /*!< (@ 0x00000050) bandgap trimming */
- __IOM uint32_t VBUS_IRQ_MASK_REG; /*!< (@ 0x00000054) IRQ masking */
- __IOM uint32_t VBUS_IRQ_CLEAR_REG; /*!< (@ 0x00000058) Clear pending IRQ register */
- __IM uint32_t RESERVED2;
- __IOM uint32_t BOD_CTRL_REG; /*!< (@ 0x00000060) Brown Out Detection control register */
- __IOM uint32_t BOD_LVL_CTRL0_REG; /*!< (@ 0x00000064) BOD_LVL_CTRL0_REG */
- __IOM uint32_t BOD_LVL_CTRL1_REG; /*!< (@ 0x00000068) BOD_LVL_CTRL1_REG */
- __IOM uint32_t BOD_LVL_CTRL2_REG; /*!< (@ 0x0000006C) BOD_LVL_CTRL2_REG */
- __IOM uint32_t P0_PAD_LATCH_REG; /*!< (@ 0x00000070) Control the state retention of the GPIO ports */
- __IOM uint32_t P0_SET_PAD_LATCH_REG; /*!< (@ 0x00000074) Control the state retention of the GPIO ports */
- __IOM uint32_t P0_RESET_PAD_LATCH_REG; /*!< (@ 0x00000078) Control the state retention of the GPIO ports */
- __IOM uint32_t P1_PAD_LATCH_REG; /*!< (@ 0x0000007C) Control the state retention of the GPIO ports */
- __IOM uint32_t P1_SET_PAD_LATCH_REG; /*!< (@ 0x00000080) Control the state retention of the GPIO ports */
- __IOM uint32_t P1_RESET_PAD_LATCH_REG; /*!< (@ 0x00000084) Control the state retention of the GPIO ports */
- __IM uint32_t RESERVED3[2];
- __IOM uint32_t BOD_STATUS_REG; /*!< (@ 0x00000090) BOD_STATUS_REG */
- __IOM uint32_t POR_VBAT_CTRL_REG; /*!< (@ 0x00000094) Controls the POR on VBAT */
- __IOM uint32_t POR_PIN_REG; /*!< (@ 0x00000098) Selects a GPIO pin for POR generation */
- __IOM uint32_t POR_TIMER_REG; /*!< (@ 0x0000009C) Time for POR to happen */
- __IOM uint32_t LDO_VDDD_HIGH_CTRL_REG; /*!< (@ 0x000000A0) LDO control register */
- __IOM uint32_t BIAS_VREF_SEL_REG; /*!< (@ 0x000000A4) BIAS_VREF_SEL_REG */
- __IM uint32_t RESERVED4[5];
- __IOM uint32_t RESET_STAT_REG; /*!< (@ 0x000000BC) Reset status register */
- __IOM uint32_t RAM_PWR_CTRL_REG; /*!< (@ 0x000000C0) Control power state of System RAMS */
- __IM uint32_t RESERVED5[2];
- __IOM uint32_t SECURE_BOOT_REG; /*!< (@ 0x000000CC) Controls secure booting */
- __IM uint32_t RESERVED6;
- __IOM uint32_t DISCHARGE_RAIL_REG; /*!< (@ 0x000000D4) Immediate rail resetting. There is no LDO/DCDC
- gating */
- __IM uint32_t RESERVED7[5];
- __IOM uint32_t ANA_STATUS_REG; /*!< (@ 0x000000EC) Analog Signals Status Register */
- __IOM uint32_t POWER_CTRL_REG; /*!< (@ 0x000000F0) Power control register */
- __IOM uint32_t PMU_SLEEP_REG; /*!< (@ 0x000000F4) Configures the sleep/wakeup strategy */
- __IOM uint32_t PMU_TRIM_REG; /*!< (@ 0x000000F8) LDO trimming register */
-} CRG_TOP_Type; /*!< Size = 252 (0xfc) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ CRG_XTAL ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief CRG_XTAL registers (CRG_XTAL)
- */
-
-typedef struct { /*!< (@ 0x50010000) CRG_XTAL Structure */
- __IOM uint32_t CLK_FREQ_TRIM_REG; /*!< (@ 0x00000000) Xtal frequency trimming register. */
- __IM uint32_t RESERVED[3];
- __IOM uint32_t TRIM_CTRL_REG; /*!< (@ 0x00000010) Control trimming of the XTAL32M */
- __IM uint32_t RESERVED1;
- __IOM uint32_t XTALRDY_CTRL_REG; /*!< (@ 0x00000018) Control register for XTALRDY IRQ */
- __IOM uint32_t XTALRDY_STAT_REG; /*!< (@ 0x0000001C) Difference between XTAL_OK and XTALRDY_IRQ in
- LP clock cycles */
- __IM uint32_t RESERVED2[4];
- __IOM uint32_t XTAL32M_CTRL0_REG; /*!< (@ 0x00000030) Control register for XTAL32M */
- __IOM uint32_t XTAL32M_CTRL1_REG; /*!< (@ 0x00000034) Control register for XTAL32M */
- __IOM uint32_t XTAL32M_CTRL2_REG; /*!< (@ 0x00000038) Control register for XTAL32M */
- __IOM uint32_t XTAL32M_CTRL3_REG; /*!< (@ 0x0000003C) Control register for XTAL32M */
- __IOM uint32_t XTAL32M_CTRL4_REG; /*!< (@ 0x00000040) Control register for XTAL32M */
- __IM uint32_t RESERVED3[3];
- __IOM uint32_t XTAL32M_STAT0_REG; /*!< (@ 0x00000050) Status register for XTAL32M */
- __IOM uint32_t XTAL32M_STAT1_REG; /*!< (@ 0x00000054) Status register for XTAL32M */
- __IM uint32_t RESERVED4[2];
- __IOM uint32_t PLL_SYS_CTRL1_REG; /*!< (@ 0x00000060) System PLL control register 1. */
- __IOM uint32_t PLL_SYS_CTRL2_REG; /*!< (@ 0x00000064) System PLL control register 2. */
- __IOM uint32_t PLL_SYS_CTRL3_REG; /*!< (@ 0x00000068) System PLL control register 3. */
- __IM uint32_t RESERVED5;
- __IOM uint32_t PLL_SYS_STATUS_REG; /*!< (@ 0x00000070) System PLL status register. */
-} CRG_XTAL_Type; /*!< Size = 116 (0x74) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ DCDC ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief DCDC registers (DCDC)
- */
-
-typedef struct { /*!< (@ 0x50000300) DCDC Structure */
- __IM uint32_t RESERVED;
- __IOM uint32_t DCDC_CTRL1_REG; /*!< (@ 0x00000004) DCDC First Control Register */
- __IOM uint32_t DCDC_CTRL2_REG; /*!< (@ 0x00000008) DCDC Second Control Register */
- __IOM uint32_t DCDC_V14_REG; /*!< (@ 0x0000000C) DCDC V14 Control Register */
- __IOM uint32_t DCDC_VDD_REG; /*!< (@ 0x00000010) DCDC VDD Control Register */
- __IOM uint32_t DCDC_V18_REG; /*!< (@ 0x00000014) DCDC V18 Control Register */
- __IOM uint32_t DCDC_V18P_REG; /*!< (@ 0x00000018) DCDC V18P Control Register */
- __IM uint32_t RESERVED1;
- __IOM uint32_t DCDC_STATUS1_REG; /*!< (@ 0x00000020) DCDC First Status Register */
- __IM uint32_t RESERVED2[3];
- __IOM uint32_t DCDC_IRQ_STATUS_REG; /*!< (@ 0x00000030) DCDC Interrupt Status Register */
- __IOM uint32_t DCDC_IRQ_CLEAR_REG; /*!< (@ 0x00000034) DCDC Interrupt Clear Register */
- __IOM uint32_t DCDC_IRQ_MASK_REG; /*!< (@ 0x00000038) DCDC Interrupt Mask Register */
-} DCDC_Type; /*!< Size = 60 (0x3c) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ DMA ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief DMA registers (DMA)
- */
-
-typedef struct { /*!< (@ 0x50040800) DMA Structure */
- __IOM uint32_t DMA0_A_START_REG; /*!< (@ 0x00000000) Start address A of DMA channel 0 */
- __IOM uint32_t DMA0_B_START_REG; /*!< (@ 0x00000004) Start address B of DMA channel 0 */
- __IOM uint32_t DMA0_INT_REG; /*!< (@ 0x00000008) DMA receive interrupt register channel 0 */
- __IOM uint32_t DMA0_LEN_REG; /*!< (@ 0x0000000C) DMA receive length register channel 0 */
- __IOM uint32_t DMA0_CTRL_REG; /*!< (@ 0x00000010) Control register for the DMA channel 0 */
- __IOM uint32_t DMA0_IDX_REG; /*!< (@ 0x00000014) Index value of DMA channel 0 */
- __IM uint32_t RESERVED[2];
- __IOM uint32_t DMA1_A_START_REG; /*!< (@ 0x00000020) Start address A of DMA channel 1 */
- __IOM uint32_t DMA1_B_START_REG; /*!< (@ 0x00000024) Start address B of DMA channel 1 */
- __IOM uint32_t DMA1_INT_REG; /*!< (@ 0x00000028) DMA receive interrupt register channel 1 */
- __IOM uint32_t DMA1_LEN_REG; /*!< (@ 0x0000002C) DMA receive length register channel 1 */
- __IOM uint32_t DMA1_CTRL_REG; /*!< (@ 0x00000030) Control register for the DMA channel 1 */
- __IOM uint32_t DMA1_IDX_REG; /*!< (@ 0x00000034) Index value of DMA channel 1 */
- __IM uint32_t RESERVED1[2];
- __IOM uint32_t DMA2_A_START_REG; /*!< (@ 0x00000040) Start address A of DMA channel 2 */
- __IOM uint32_t DMA2_B_START_REG; /*!< (@ 0x00000044) Start address B of DMA channel 2 */
- __IOM uint32_t DMA2_INT_REG; /*!< (@ 0x00000048) DMA receive interrupt register channel 2 */
- __IOM uint32_t DMA2_LEN_REG; /*!< (@ 0x0000004C) DMA receive length register channel 2 */
- __IOM uint32_t DMA2_CTRL_REG; /*!< (@ 0x00000050) Control register for the DMA channel 2 */
- __IOM uint32_t DMA2_IDX_REG; /*!< (@ 0x00000054) Index value of DMA channel 2 */
- __IM uint32_t RESERVED2[2];
- __IOM uint32_t DMA3_A_START_REG; /*!< (@ 0x00000060) Start address A of DMA channel 3 */
- __IOM uint32_t DMA3_B_START_REG; /*!< (@ 0x00000064) Start address B of DMA channel 3 */
- __IOM uint32_t DMA3_INT_REG; /*!< (@ 0x00000068) DMA receive interrupt register channel 3 */
- __IOM uint32_t DMA3_LEN_REG; /*!< (@ 0x0000006C) DMA receive length register channel 3 */
- __IOM uint32_t DMA3_CTRL_REG; /*!< (@ 0x00000070) Control register for the DMA channel 3 */
- __IOM uint32_t DMA3_IDX_REG; /*!< (@ 0x00000074) Index value of DMA channel 3 */
- __IM uint32_t RESERVED3[2];
- __IOM uint32_t DMA4_A_START_REG; /*!< (@ 0x00000080) Start address A of DMA channel 4 */
- __IOM uint32_t DMA4_B_START_REG; /*!< (@ 0x00000084) Start address B of DMA channel 4 */
- __IOM uint32_t DMA4_INT_REG; /*!< (@ 0x00000088) DMA receive interrupt register channel 4 */
- __IOM uint32_t DMA4_LEN_REG; /*!< (@ 0x0000008C) DMA receive length register channel 4 */
- __IOM uint32_t DMA4_CTRL_REG; /*!< (@ 0x00000090) Control register for the DMA channel 4 */
- __IOM uint32_t DMA4_IDX_REG; /*!< (@ 0x00000094) Index value of DMA channel 4 */
- __IM uint32_t RESERVED4[2];
- __IOM uint32_t DMA5_A_START_REG; /*!< (@ 0x000000A0) Start address A of DMA channel 5 */
- __IOM uint32_t DMA5_B_START_REG; /*!< (@ 0x000000A4) Start address B of DMA channel 5 */
- __IOM uint32_t DMA5_INT_REG; /*!< (@ 0x000000A8) DMA receive interrupt register channel 5 */
- __IOM uint32_t DMA5_LEN_REG; /*!< (@ 0x000000AC) DMA receive length register channel 5 */
- __IOM uint32_t DMA5_CTRL_REG; /*!< (@ 0x000000B0) Control register for the DMA channel 5 */
- __IOM uint32_t DMA5_IDX_REG; /*!< (@ 0x000000B4) Index value of DMA channel 5 */
- __IM uint32_t RESERVED5[2];
- __IOM uint32_t DMA6_A_START_REG; /*!< (@ 0x000000C0) Start address A of DMA channel 6 */
- __IOM uint32_t DMA6_B_START_REG; /*!< (@ 0x000000C4) Start address B of DMA channel 6 */
- __IOM uint32_t DMA6_INT_REG; /*!< (@ 0x000000C8) DMA receive interrupt register channel 6 */
- __IOM uint32_t DMA6_LEN_REG; /*!< (@ 0x000000CC) DMA receive length register channel 6 */
- __IOM uint32_t DMA6_CTRL_REG; /*!< (@ 0x000000D0) Control register for the DMA channel 6 */
- __IOM uint32_t DMA6_IDX_REG; /*!< (@ 0x000000D4) Index value of DMA channel 6 */
- __IM uint32_t RESERVED6[2];
- __IOM uint32_t DMA7_A_START_REG; /*!< (@ 0x000000E0) Start address A of DMA channel 7 */
- __IOM uint32_t DMA7_B_START_REG; /*!< (@ 0x000000E4) Start address B of DMA channel 7 */
- __IOM uint32_t DMA7_INT_REG; /*!< (@ 0x000000E8) DMA receive interrupt register channel 7 */
- __IOM uint32_t DMA7_LEN_REG; /*!< (@ 0x000000EC) DMA receive length register channel 7 */
- __IOM uint32_t DMA7_CTRL_REG; /*!< (@ 0x000000F0) Control register for the DMA channel 7 */
- __IOM uint32_t DMA7_IDX_REG; /*!< (@ 0x000000F4) Index value of DMA channel 7 */
- __IM uint32_t RESERVED7[2];
- __IOM uint32_t DMA_REQ_MUX_REG; /*!< (@ 0x00000100) DMA channel assignments */
- __IOM uint32_t DMA_INT_STATUS_REG; /*!< (@ 0x00000104) DMA interrupt status register */
- __IOM uint32_t DMA_CLEAR_INT_REG; /*!< (@ 0x00000108) DMA clear interrupt register */
- __IOM uint32_t DMA_INT_MASK_REG; /*!< (@ 0x0000010C) DMA Interrupt mask register */
-} DMA_Type; /*!< Size = 272 (0x110) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ DW ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief DW registers (DW)
- */
-
-typedef struct { /*!< (@ 0x30020000) DW Structure */
- __IOM uint32_t AHB_DMA_PL1_REG; /*!< (@ 0x00000000) AHB-DMA layer priority level for RFTP (AHB DMA
- layer only) */
- __IOM uint32_t AHB_DMA_PL2_REG; /*!< (@ 0x00000004) AHB-DMA layer priority level for LCD (AHB DMA
- layer only) */
- __IOM uint32_t AHB_DMA_PL3_REG; /*!< (@ 0x00000008) AHB-DMA layer Priority level for GEN-DMA (AHB
- DMA layer only) */
- __IOM uint32_t AHB_DMA_PL4_REG; /*!< (@ 0x0000000C) AHB-DMA layer Priority level for CRYPTO-DMA (AHB
- DMA layer only) */
- __IM uint32_t RESERVED[14];
- __IOM uint32_t AHB_DMA_DFLT_MASTER_REG; /*!< (@ 0x00000048) Default master ID number (AHB DMA layer only) */
- __IOM uint32_t AHB_DMA_WTEN_REG; /*!< (@ 0x0000004C) Weighted-Token Arbitration Scheme Enable (AHB
- DMA layer only) */
- __IOM uint32_t AHB_DMA_TCL_REG; /*!< (@ 0x00000050) Master clock refresh period (AHB DMA layer only) */
- __IOM uint32_t AHB_DMA_CCLM1_REG; /*!< (@ 0x00000054) USB Master clock tokens (AHB DMA layer only) */
- __IOM uint32_t AHB_DMA_CCLM2_REG; /*!< (@ 0x00000058) GenDMA Master clock tokens (AHB DMA layer only) */
- __IOM uint32_t AHB_DMA_CCLM3_REG; /*!< (@ 0x0000005C) CRYPTO Master clock tokens (AHB DMA layer only) */
- __IOM uint32_t AHB_DMA_CCLM4_REG; /*!< (@ 0x00000060) CRYPTO Master clock tokens (AHB DMA layer only) */
- __IM uint32_t RESERVED1[11];
- __IOM uint32_t AHB_DMA_VERSION_REG; /*!< (@ 0x00000090) Version ID (AHB DMA layer only) */
-} DW_Type; /*!< Size = 148 (0x94) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ GPADC ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief GPADC registers (GPADC)
- */
-
-typedef struct { /*!< (@ 0x50030900) GPADC Structure */
- __IOM uint32_t GP_ADC_CTRL_REG; /*!< (@ 0x00000000) General Purpose ADC Control Register */
- __IOM uint32_t GP_ADC_CTRL2_REG; /*!< (@ 0x00000004) General Purpose ADC Second Control Register */
- __IOM uint32_t GP_ADC_CTRL3_REG; /*!< (@ 0x00000008) General Purpose ADC Third Control Register */
- __IOM uint32_t GP_ADC_OFFP_REG; /*!< (@ 0x0000000C) General Purpose ADC Positive Offset Register */
- __IOM uint32_t GP_ADC_OFFN_REG; /*!< (@ 0x00000010) General Purpose ADC Negative Offset Register */
- __IOM uint32_t GP_ADC_CLEAR_INT_REG; /*!< (@ 0x00000014) General Purpose ADC Clear Interrupt Register */
- __IOM uint32_t GP_ADC_RESULT_REG; /*!< (@ 0x00000018) General Purpose ADC Result Register */
-} GPADC_Type; /*!< Size = 28 (0x1c) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ GPIO ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief GPIO registers (GPIO)
- */
-
-typedef struct { /*!< (@ 0x50020A00) GPIO Structure */
- __IOM uint32_t P0_DATA_REG; /*!< (@ 0x00000000) P0 Data input / output Register */
- __IOM uint32_t P1_DATA_REG; /*!< (@ 0x00000004) P1 Data input / output Register */
- __IOM uint32_t P0_SET_DATA_REG; /*!< (@ 0x00000008) P0 Set port pins Register */
- __IOM uint32_t P1_SET_DATA_REG; /*!< (@ 0x0000000C) P1 Set port pins Register */
- __IOM uint32_t P0_RESET_DATA_REG; /*!< (@ 0x00000010) P0 Reset port pins Register */
- __IOM uint32_t P1_RESET_DATA_REG; /*!< (@ 0x00000014) P1 Reset port pins Register */
- __IOM uint32_t P0_00_MODE_REG; /*!< (@ 0x00000018) P0_00 Mode Register */
- __IOM uint32_t P0_01_MODE_REG; /*!< (@ 0x0000001C) P0_01 Mode Register */
- __IOM uint32_t P0_02_MODE_REG; /*!< (@ 0x00000020) P0_02 Mode Register */
- __IOM uint32_t P0_03_MODE_REG; /*!< (@ 0x00000024) P0_03 Mode Register */
- __IOM uint32_t P0_04_MODE_REG; /*!< (@ 0x00000028) P0_04 Mode Register */
- __IOM uint32_t P0_05_MODE_REG; /*!< (@ 0x0000002C) P0_05 Mode Register */
- __IOM uint32_t P0_06_MODE_REG; /*!< (@ 0x00000030) P0_06 Mode Register */
- __IOM uint32_t P0_07_MODE_REG; /*!< (@ 0x00000034) P0_07 Mode Register */
- __IOM uint32_t P0_08_MODE_REG; /*!< (@ 0x00000038) P0_08 Mode Register */
- __IOM uint32_t P0_09_MODE_REG; /*!< (@ 0x0000003C) P0_09 Mode Register */
- __IOM uint32_t P0_10_MODE_REG; /*!< (@ 0x00000040) P0_10 Mode Register */
- __IOM uint32_t P0_11_MODE_REG; /*!< (@ 0x00000044) P0_11 Mode Register */
- __IOM uint32_t P0_12_MODE_REG; /*!< (@ 0x00000048) P0_12 Mode Register */
- __IOM uint32_t P0_13_MODE_REG; /*!< (@ 0x0000004C) P0_13 Mode Register */
- __IOM uint32_t P0_14_MODE_REG; /*!< (@ 0x00000050) P0_14 Mode Register */
- __IOM uint32_t P0_15_MODE_REG; /*!< (@ 0x00000054) P0_15 Mode Register */
- __IOM uint32_t P0_16_MODE_REG; /*!< (@ 0x00000058) P0_16 Mode Register */
- __IOM uint32_t P0_17_MODE_REG; /*!< (@ 0x0000005C) P0_17 Mode Register */
- __IOM uint32_t P0_18_MODE_REG; /*!< (@ 0x00000060) P0_18 Mode Register */
- __IOM uint32_t P0_19_MODE_REG; /*!< (@ 0x00000064) P0_19 Mode Register */
- __IOM uint32_t P0_20_MODE_REG; /*!< (@ 0x00000068) P0_20 Mode Register */
- __IOM uint32_t P0_21_MODE_REG; /*!< (@ 0x0000006C) P0_21 Mode Register */
- __IOM uint32_t P0_22_MODE_REG; /*!< (@ 0x00000070) P0_22 Mode Register */
- __IOM uint32_t P0_23_MODE_REG; /*!< (@ 0x00000074) P0_23 Mode Register */
- __IOM uint32_t P0_24_MODE_REG; /*!< (@ 0x00000078) P0_24 Mode Register */
- __IOM uint32_t P0_25_MODE_REG; /*!< (@ 0x0000007C) P0_25 Mode Register */
- __IOM uint32_t P0_26_MODE_REG; /*!< (@ 0x00000080) P0_26 Mode Register */
- __IOM uint32_t P0_27_MODE_REG; /*!< (@ 0x00000084) P0_27 Mode Register */
- __IOM uint32_t P0_28_MODE_REG; /*!< (@ 0x00000088) P0_28 Mode Register */
- __IOM uint32_t P0_29_MODE_REG; /*!< (@ 0x0000008C) P0_29 Mode Register */
- __IOM uint32_t P0_30_MODE_REG; /*!< (@ 0x00000090) P0_30 Mode Register */
- __IOM uint32_t P0_31_MODE_REG; /*!< (@ 0x00000094) P0_31 Mode Register */
- __IOM uint32_t P1_00_MODE_REG; /*!< (@ 0x00000098) P1_00 Mode Register */
- __IOM uint32_t P1_01_MODE_REG; /*!< (@ 0x0000009C) P1_01 Mode Register */
- __IOM uint32_t P1_02_MODE_REG; /*!< (@ 0x000000A0) P1_02 Mode Register */
- __IOM uint32_t P1_03_MODE_REG; /*!< (@ 0x000000A4) P1_03 Mode Register */
- __IOM uint32_t P1_04_MODE_REG; /*!< (@ 0x000000A8) P1_04 Mode Register */
- __IOM uint32_t P1_05_MODE_REG; /*!< (@ 0x000000AC) P1_05 Mode Register */
- __IOM uint32_t P1_06_MODE_REG; /*!< (@ 0x000000B0) P1_06 Mode Register */
- __IOM uint32_t P1_07_MODE_REG; /*!< (@ 0x000000B4) P1_07 Mode Register */
- __IOM uint32_t P1_08_MODE_REG; /*!< (@ 0x000000B8) P1_08 Mode Register */
- __IOM uint32_t P1_09_MODE_REG; /*!< (@ 0x000000BC) P1_09 Mode Register */
- __IOM uint32_t P1_10_MODE_REG; /*!< (@ 0x000000C0) P1_10 Mode Register */
- __IOM uint32_t P1_11_MODE_REG; /*!< (@ 0x000000C4) P1_11 Mode Register */
- __IOM uint32_t P1_12_MODE_REG; /*!< (@ 0x000000C8) P1_12 Mode Register */
- __IOM uint32_t P1_13_MODE_REG; /*!< (@ 0x000000CC) P1_13 Mode Register */
- __IOM uint32_t P1_14_MODE_REG; /*!< (@ 0x000000D0) P1_14 Mode Register */
- __IOM uint32_t P1_15_MODE_REG; /*!< (@ 0x000000D4) P1_15 Mode Register */
- __IOM uint32_t P1_16_MODE_REG; /*!< (@ 0x000000D8) P1_16 Mode Register */
- __IOM uint32_t P1_17_MODE_REG; /*!< (@ 0x000000DC) P1_17 Mode Register */
- __IOM uint32_t P1_18_MODE_REG; /*!< (@ 0x000000E0) P1_18 Mode Register */
- __IOM uint32_t P1_19_MODE_REG; /*!< (@ 0x000000E4) P1_19 Mode Register */
- __IOM uint32_t P1_20_MODE_REG; /*!< (@ 0x000000E8) P1_20 Mode Register */
- __IOM uint32_t P1_21_MODE_REG; /*!< (@ 0x000000EC) P1_21 Mode Register */
- __IOM uint32_t P1_22_MODE_REG; /*!< (@ 0x000000F0) P1_22 Mode Register */
- __IOM uint32_t P0_PADPWR_CTRL_REG; /*!< (@ 0x000000F4) P0 Output Power Control Register */
- __IOM uint32_t P1_PADPWR_CTRL_REG; /*!< (@ 0x000000F8) P1 Output Power Control Register */
- __IOM uint32_t GPIO_CLK_SEL_REG; /*!< (@ 0x000000FC) Select which clock to map on ports P0/P1 */
- __IOM uint32_t PAD_WEAK_CTRL_REG; /*!< (@ 0x00000100) Weak Pads Control Register */
-} GPIO_Type; /*!< Size = 260 (0x104) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ GPREG ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief GPREG registers (GPREG)
- */
-
-typedef struct { /*!< (@ 0x50040300) GPREG Structure */
- __IOM uint32_t SET_FREEZE_REG; /*!< (@ 0x00000000) Controls freezing of various timers/counters
- (incl. DMA and USB). */
- __IOM uint32_t RESET_FREEZE_REG; /*!< (@ 0x00000004) Controls unfreezing of various timers/counters
- (incl. DMA and USB). */
- __IOM uint32_t DEBUG_REG; /*!< (@ 0x00000008) Various debug information register. */
- __IOM uint32_t GP_STATUS_REG; /*!< (@ 0x0000000C) General purpose system status register. */
- __IOM uint32_t GP_CONTROL_REG; /*!< (@ 0x00000010) General purpose system control register. */
- __IM uint32_t RESERVED;
- __IOM uint32_t USBPAD_REG; /*!< (@ 0x00000018) USB pads control register */
-} GPREG_Type; /*!< Size = 28 (0x1c) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ I2C ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief I2C registers (I2C)
- */
-
-typedef struct { /*!< (@ 0x50020600) I2C Structure */
- __IOM uint32_t I2C_CON_REG; /*!< (@ 0x00000000) I2C Control Register */
- __IOM uint32_t I2C_TAR_REG; /*!< (@ 0x00000004) I2C Target Address Register */
- __IOM uint32_t I2C_SAR_REG; /*!< (@ 0x00000008) I2C Slave Address Register */
- __IOM uint32_t I2C_HS_MADDR_REG; /*!< (@ 0x0000000C) I2C High Speed Master Mode Code Address Register */
- __IOM uint32_t I2C_DATA_CMD_REG; /*!< (@ 0x00000010) I2C Rx/Tx Data Buffer and Command Register */
- __IOM uint32_t I2C_SS_SCL_HCNT_REG; /*!< (@ 0x00000014) Standard Speed I2C Clock SCL High Count Register */
- __IOM uint32_t I2C_SS_SCL_LCNT_REG; /*!< (@ 0x00000018) Standard Speed I2C Clock SCL Low Count Register */
- __IOM uint32_t I2C_FS_SCL_HCNT_REG; /*!< (@ 0x0000001C) Fast Speed I2C Clock SCL High Count Register */
- __IOM uint32_t I2C_FS_SCL_LCNT_REG; /*!< (@ 0x00000020) Fast Speed I2C Clock SCL Low Count Register */
- __IOM uint32_t I2C_HS_SCL_HCNT_REG; /*!< (@ 0x00000024) High Speed I2C Clock SCL High Count Register */
- __IOM uint32_t I2C_HS_SCL_LCNT_REG; /*!< (@ 0x00000028) High Speed I2C Clock SCL Low Count Register */
- __IOM uint32_t I2C_INTR_STAT_REG; /*!< (@ 0x0000002C) I2C Interrupt Status Register */
- __IOM uint32_t I2C_INTR_MASK_REG; /*!< (@ 0x00000030) I2C Interrupt Mask Register */
- __IOM uint32_t I2C_RAW_INTR_STAT_REG; /*!< (@ 0x00000034) I2C Raw Interrupt Status Register */
- __IOM uint32_t I2C_RX_TL_REG; /*!< (@ 0x00000038) I2C Receive FIFO Threshold Register */
- __IOM uint32_t I2C_TX_TL_REG; /*!< (@ 0x0000003C) I2C Transmit FIFO Threshold Register */
- __IOM uint32_t I2C_CLR_INTR_REG; /*!< (@ 0x00000040) Clear Combined and Individual Interrupt Register */
- __IOM uint32_t I2C_CLR_RX_UNDER_REG; /*!< (@ 0x00000044) Clear RX_UNDER Interrupt Register */
- __IOM uint32_t I2C_CLR_RX_OVER_REG; /*!< (@ 0x00000048) Clear RX_OVER Interrupt Register */
- __IOM uint32_t I2C_CLR_TX_OVER_REG; /*!< (@ 0x0000004C) Clear TX_OVER Interrupt Register */
- __IOM uint32_t I2C_CLR_RD_REQ_REG; /*!< (@ 0x00000050) Clear RD_REQ Interrupt Register */
- __IOM uint32_t I2C_CLR_TX_ABRT_REG; /*!< (@ 0x00000054) Clear TX_ABRT Interrupt Register */
- __IOM uint32_t I2C_CLR_RX_DONE_REG; /*!< (@ 0x00000058) Clear RX_DONE Interrupt Register */
- __IOM uint32_t I2C_CLR_ACTIVITY_REG; /*!< (@ 0x0000005C) Clear ACTIVITY Interrupt Register */
- __IOM uint32_t I2C_CLR_STOP_DET_REG; /*!< (@ 0x00000060) Clear STOP_DET Interrupt Register */
- __IOM uint32_t I2C_CLR_START_DET_REG; /*!< (@ 0x00000064) Clear START_DET Interrupt Register */
- __IOM uint32_t I2C_CLR_GEN_CALL_REG; /*!< (@ 0x00000068) Clear GEN_CALL Interrupt Register */
- __IOM uint32_t I2C_ENABLE_REG; /*!< (@ 0x0000006C) I2C Enable Register */
- __IOM uint32_t I2C_STATUS_REG; /*!< (@ 0x00000070) I2C Status Register */
- __IOM uint32_t I2C_TXFLR_REG; /*!< (@ 0x00000074) I2C Transmit FIFO Level Register */
- __IOM uint32_t I2C_RXFLR_REG; /*!< (@ 0x00000078) I2C Receive FIFO Level Register */
- __IOM uint32_t I2C_SDA_HOLD_REG; /*!< (@ 0x0000007C) I2C SDA Hold Time Length Register */
- __IOM uint32_t I2C_TX_ABRT_SOURCE_REG; /*!< (@ 0x00000080) I2C Transmit Abort Source Register */
- __IM uint32_t RESERVED;
- __IOM uint32_t I2C_DMA_CR_REG; /*!< (@ 0x00000088) DMA Control Register */
- __IOM uint32_t I2C_DMA_TDLR_REG; /*!< (@ 0x0000008C) DMA Transmit Data Level Register */
- __IOM uint32_t I2C_DMA_RDLR_REG; /*!< (@ 0x00000090) I2C Receive Data Level Register */
- __IOM uint32_t I2C_SDA_SETUP_REG; /*!< (@ 0x00000094) I2C SDA Setup Register */
- __IOM uint32_t I2C_ACK_GENERAL_CALL_REG; /*!< (@ 0x00000098) I2C ACK General Call Register */
- __IOM uint32_t I2C_ENABLE_STATUS_REG; /*!< (@ 0x0000009C) I2C Enable Status Register */
- __IOM uint32_t I2C_IC_FS_SPKLEN_REG; /*!< (@ 0x000000A0) I2C SS and FS spike suppression limit Size */
- __IOM uint32_t I2C_IC_HS_SPKLEN_REG; /*!< (@ 0x000000A4) I2C HS spike suppression limit Size */
-} I2C_Type; /*!< Size = 168 (0xa8) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ I2C2 ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief I2C2 registers (I2C2)
- */
-
-typedef struct { /*!< (@ 0x50020700) I2C2 Structure */
- __IOM uint32_t I2C2_CON_REG; /*!< (@ 0x00000000) I2C Control Register */
- __IOM uint32_t I2C2_TAR_REG; /*!< (@ 0x00000004) I2C Target Address Register */
- __IOM uint32_t I2C2_SAR_REG; /*!< (@ 0x00000008) I2C Slave Address Register */
- __IOM uint32_t I2C2_HS_MADDR_REG; /*!< (@ 0x0000000C) I2C High Speed Master Mode Code Address Register */
- __IOM uint32_t I2C2_DATA_CMD_REG; /*!< (@ 0x00000010) I2C Rx/Tx Data Buffer and Command Register */
- __IOM uint32_t I2C2_SS_SCL_HCNT_REG; /*!< (@ 0x00000014) Standard Speed I2C Clock SCL High Count Register */
- __IOM uint32_t I2C2_SS_SCL_LCNT_REG; /*!< (@ 0x00000018) Standard Speed I2C Clock SCL Low Count Register */
- __IOM uint32_t I2C2_FS_SCL_HCNT_REG; /*!< (@ 0x0000001C) Fast Speed I2C Clock SCL High Count Register */
- __IOM uint32_t I2C2_FS_SCL_LCNT_REG; /*!< (@ 0x00000020) Fast Speed I2C Clock SCL Low Count Register */
- __IOM uint32_t I2C2_HS_SCL_HCNT_REG; /*!< (@ 0x00000024) High Speed I2C Clock SCL High Count Register */
- __IOM uint32_t I2C2_HS_SCL_LCNT_REG; /*!< (@ 0x00000028) High Speed I2C Clock SCL Low Count Register */
- __IOM uint32_t I2C2_INTR_STAT_REG; /*!< (@ 0x0000002C) I2C Interrupt Status Register */
- __IOM uint32_t I2C2_INTR_MASK_REG; /*!< (@ 0x00000030) I2C Interrupt Mask Register */
- __IOM uint32_t I2C2_RAW_INTR_STAT_REG; /*!< (@ 0x00000034) I2C Raw Interrupt Status Register */
- __IOM uint32_t I2C2_RX_TL_REG; /*!< (@ 0x00000038) I2C Receive FIFO Threshold Register */
- __IOM uint32_t I2C2_TX_TL_REG; /*!< (@ 0x0000003C) I2C Transmit FIFO Threshold Register */
- __IOM uint32_t I2C2_CLR_INTR_REG; /*!< (@ 0x00000040) Clear Combined and Individual Interrupt Register */
- __IOM uint32_t I2C2_CLR_RX_UNDER_REG; /*!< (@ 0x00000044) Clear RX_UNDER Interrupt Register */
- __IOM uint32_t I2C2_CLR_RX_OVER_REG; /*!< (@ 0x00000048) Clear RX_OVER Interrupt Register */
- __IOM uint32_t I2C2_CLR_TX_OVER_REG; /*!< (@ 0x0000004C) Clear TX_OVER Interrupt Register */
- __IOM uint32_t I2C2_CLR_RD_REQ_REG; /*!< (@ 0x00000050) Clear RD_REQ Interrupt Register */
- __IOM uint32_t I2C2_CLR_TX_ABRT_REG; /*!< (@ 0x00000054) Clear TX_ABRT Interrupt Register */
- __IOM uint32_t I2C2_CLR_RX_DONE_REG; /*!< (@ 0x00000058) Clear RX_DONE Interrupt Register */
- __IOM uint32_t I2C2_CLR_ACTIVITY_REG; /*!< (@ 0x0000005C) Clear ACTIVITY Interrupt Register */
- __IOM uint32_t I2C2_CLR_STOP_DET_REG; /*!< (@ 0x00000060) Clear STOP_DET Interrupt Register */
- __IOM uint32_t I2C2_CLR_START_DET_REG; /*!< (@ 0x00000064) Clear START_DET Interrupt Register */
- __IOM uint32_t I2C2_CLR_GEN_CALL_REG; /*!< (@ 0x00000068) Clear GEN_CALL Interrupt Register */
- __IOM uint32_t I2C2_ENABLE_REG; /*!< (@ 0x0000006C) I2C Enable Register */
- __IOM uint32_t I2C2_STATUS_REG; /*!< (@ 0x00000070) I2C Status Register */
- __IOM uint32_t I2C2_TXFLR_REG; /*!< (@ 0x00000074) I2C Transmit FIFO Level Register */
- __IOM uint32_t I2C2_RXFLR_REG; /*!< (@ 0x00000078) I2C Receive FIFO Level Register */
- __IOM uint32_t I2C2_SDA_HOLD_REG; /*!< (@ 0x0000007C) I2C SDA Hold Time Length Register */
- __IOM uint32_t I2C2_TX_ABRT_SOURCE_REG; /*!< (@ 0x00000080) I2C Transmit Abort Source Register */
- __IM uint32_t RESERVED;
- __IOM uint32_t I2C2_DMA_CR_REG; /*!< (@ 0x00000088) DMA Control Register */
- __IOM uint32_t I2C2_DMA_TDLR_REG; /*!< (@ 0x0000008C) DMA Transmit Data Level Register */
- __IOM uint32_t I2C2_DMA_RDLR_REG; /*!< (@ 0x00000090) I2C Receive Data Level Register */
- __IOM uint32_t I2C2_SDA_SETUP_REG; /*!< (@ 0x00000094) I2C SDA Setup Register */
- __IOM uint32_t I2C2_ACK_GENERAL_CALL_REG; /*!< (@ 0x00000098) I2C ACK General Call Register */
- __IOM uint32_t I2C2_ENABLE_STATUS_REG; /*!< (@ 0x0000009C) I2C Enable Status Register */
- __IOM uint32_t I2C2_IC_FS_SPKLEN_REG; /*!< (@ 0x000000A0) I2C SS and FS spike suppression limit Size */
- __IOM uint32_t I2C2_IC_HS_SPKLEN_REG; /*!< (@ 0x000000A4) I2C HS spike suppression limit Size */
-} I2C2_Type; /*!< Size = 168 (0xa8) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ LCDC ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief LCDC registers (LCDC)
- */
-
-typedef struct { /*!< (@ 0x30030000) LCDC Structure */
- __IOM uint32_t LCDC_MODE_REG; /*!< (@ 0x00000000) Display Mode */
- __IOM uint32_t LCDC_CLKCTRL_REG; /*!< (@ 0x00000004) Clock Divider */
- __IOM uint32_t LCDC_BGCOLOR_REG; /*!< (@ 0x00000008) Background Color */
- __IOM uint32_t LCDC_RESXY_REG; /*!< (@ 0x0000000C) Resolution X,Y */
- __IM uint32_t RESERVED;
- __IOM uint32_t LCDC_FRONTPORCHXY_REG; /*!< (@ 0x00000014) Front Porch X and Y */
- __IOM uint32_t LCDC_BLANKINGXY_REG; /*!< (@ 0x00000018) Blanking X and Y */
- __IOM uint32_t LCDC_BACKPORCHXY_REG; /*!< (@ 0x0000001C) Back Porch X and Y */
- __IM uint32_t RESERVED1[2];
- __IOM uint32_t LCDC_DBIB_CFG_REG; /*!< (@ 0x00000028) MIPI Config Register */
- __IOM uint32_t LCDC_GPIO_REG; /*!< (@ 0x0000002C) General Purpose IO (2-bits) */
- __IOM uint32_t LCDC_LAYER0_MODE_REG; /*!< (@ 0x00000030) Layer0 Mode */
- __IOM uint32_t LCDC_LAYER0_STARTXY_REG; /*!< (@ 0x00000034) Layer0 Start XY */
- __IOM uint32_t LCDC_LAYER0_SIZEXY_REG; /*!< (@ 0x00000038) Layer0 Size XY */
- __IOM uint32_t LCDC_LAYER0_BASEADDR_REG; /*!< (@ 0x0000003C) Layer0 Base Addr */
- __IOM uint32_t LCDC_LAYER0_STRIDE_REG; /*!< (@ 0x00000040) Layer0 Stride */
- __IOM uint32_t LCDC_LAYER0_RESXY_REG; /*!< (@ 0x00000044) Layer0 Res XY */
- __IM uint32_t RESERVED2[18];
- __IOM uint32_t LCDC_JDI_RESXY_REG; /*!< (@ 0x00000090) Resolution XY for the JDI parallel I/F */
- __IOM uint32_t LCDC_JDI_FBX_BLANKING_REG; /*!< (@ 0x00000094) Horizontal front/back blanking (hck half periods) */
- __IOM uint32_t LCDC_JDI_FBY_BLANKING_REG; /*!< (@ 0x00000098) Vertical front/back blanking (vck half periods) */
- __IOM uint32_t LCDC_JDI_HCK_WIDTH_REG; /*!< (@ 0x0000009C) HCK high/low width */
- __IOM uint32_t LCDC_JDI_XRST_WIDTH_REG; /*!< (@ 0x000000A0) XRST width */
- __IOM uint32_t LCDC_JDI_VST_DELAY_REG; /*!< (@ 0x000000A4) XRST-to-VST delay */
- __IOM uint32_t LCDC_JDI_VST_WIDTH_REG; /*!< (@ 0x000000A8) VST width */
- __IOM uint32_t LCDC_JDI_VCK_DELAY_REG; /*!< (@ 0x000000AC) XRST-to-VCK delay */
- __IOM uint32_t LCDC_JDI_HST_DELAY_REG; /*!< (@ 0x000000B0) VCK-to-HST delay */
- __IOM uint32_t LCDC_JDI_HST_WIDTH_REG; /*!< (@ 0x000000B4) HST width */
- __IOM uint32_t LCDC_JDI_ENB_START_HLINE_REG; /*!< (@ 0x000000B8) ENB start horizontal line */
- __IOM uint32_t LCDC_JDI_ENB_END_HLINE_REG; /*!< (@ 0x000000BC) ENB end horizontal line */
- __IOM uint32_t LCDC_JDI_ENB_START_CLK_REG; /*!< (@ 0x000000C0) ENB start delay */
- __IOM uint32_t LCDC_JDI_ENB_WIDTH_CLK_REG; /*!< (@ 0x000000C4) ENB width */
- __IM uint32_t RESERVED3[8];
- __IOM uint32_t LCDC_DBIB_CMD_REG; /*!< (@ 0x000000E8) MIPI DBIB Command Register */
- __IM uint32_t RESERVED4[2];
- __IOM uint32_t LCDC_IDREG_REG; /*!< (@ 0x000000F4) Identification Register */
- __IOM uint32_t LCDC_INTERRUPT_REG; /*!< (@ 0x000000F8) Interrupt Register */
- __IOM uint32_t LCDC_STATUS_REG; /*!< (@ 0x000000FC) Status Register */
- __IM uint32_t RESERVED5[33];
- __IOM uint32_t LCDC_CRC_REG; /*!< (@ 0x00000184) CRC check */
- __IOM uint32_t LCDC_LAYER0_OFFSETX_REG; /*!< (@ 0x00000188) Layer0 OffsetX and DMA prefetch */
-} LCDC_Type; /*!< Size = 396 (0x18c) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ LRA ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief LRA registers (LRA)
- */
-
-typedef struct { /*!< (@ 0x50030A00) LRA Structure */
- __IOM uint32_t LRA_CTRL1_REG; /*!< (@ 0x00000000) General Purpose LRA Control Register */
- __IOM uint32_t LRA_CTRL2_REG; /*!< (@ 0x00000004) General Purpose LRA Control Register */
- __IOM uint32_t LRA_CTRL3_REG; /*!< (@ 0x00000008) General Purpose LRA Control Register */
- __IOM uint32_t LRA_FLT_SMP1_REG; /*!< (@ 0x0000000C) LRA Sample Register */
- __IOM uint32_t LRA_FLT_SMP2_REG; /*!< (@ 0x00000010) LRA Sample Register */
- __IOM uint32_t LRA_FLT_SMP3_REG; /*!< (@ 0x00000014) LRA Sample Register */
- __IOM uint32_t LRA_FLT_SMP4_REG; /*!< (@ 0x00000018) LRA Sample Register */
- __IOM uint32_t LRA_FLT_SMP5_REG; /*!< (@ 0x0000001C) LRA Sample Register */
- __IOM uint32_t LRA_FLT_SMP6_REG; /*!< (@ 0x00000020) LRA Sample Register */
- __IOM uint32_t LRA_FLT_SMP7_REG; /*!< (@ 0x00000024) LRA Sample Register */
- __IOM uint32_t LRA_FLT_SMP8_REG; /*!< (@ 0x00000028) LRA Sample Register */
- __IOM uint32_t LRA_FLT_COEF1_REG; /*!< (@ 0x0000002C) LRA Filter Coefficient Register */
- __IOM uint32_t LRA_FLT_COEF2_REG; /*!< (@ 0x00000030) LRA Filter Coefficient Register */
- __IOM uint32_t LRA_FLT_COEF3_REG; /*!< (@ 0x00000034) LRA Filter Coefficient Register */
- __IOM uint32_t LRA_BRD_LS_REG; /*!< (@ 0x00000038) LRA Bridge Register */
- __IOM uint32_t LRA_BRD_HS_REG; /*!< (@ 0x0000003C) LRA Bridge Register */
- __IOM uint32_t LRA_BRD_STAT_REG; /*!< (@ 0x00000040) LRA Bridge Staus Register */
- __IOM uint32_t LRA_ADC_CTRL1_REG; /*!< (@ 0x00000044) General Purpose ADC Control Register */
- __IM uint32_t RESERVED[2];
- __IOM uint32_t LRA_ADC_RESULT_REG; /*!< (@ 0x00000050) General Purpose ADC Result Register */
- __IOM uint32_t LRA_LDO_REG; /*!< (@ 0x00000054) LRA LDO Regsiter */
- __IOM uint32_t LRA_DFT_REG; /*!< (@ 0x00000058) LRA test Register */
-} LRA_Type; /*!< Size = 92 (0x5c) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ MEMCTRL ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief MEMCTRL registers (MEMCTRL)
- */
-
-typedef struct { /*!< (@ 0x50050000) MEMCTRL Structure */
- __IM uint32_t RESERVED;
- __IOM uint32_t MEM_PRIO_REG; /*!< (@ 0x00000004) Priority Control Register */
- __IOM uint32_t MEM_STALL_REG; /*!< (@ 0x00000008) Maximum Stall cycles Control Register */
- __IOM uint32_t MEM_STATUS_REG; /*!< (@ 0x0000000C) Memory Arbiter Status Register */
- __IOM uint32_t MEM_STATUS2_REG; /*!< (@ 0x00000010) RAM cells Status Register */
- __IM uint32_t RESERVED1[3];
- __IOM uint32_t CMI_CODE_BASE_REG; /*!< (@ 0x00000020) CMAC code Base Address Register */
- __IOM uint32_t CMI_DATA_BASE_REG; /*!< (@ 0x00000024) CMAC data Base Address Register */
- __IOM uint32_t CMI_SHARED_BASE_REG; /*!< (@ 0x00000028) CMAC shared data Base Address Register */
- __IOM uint32_t CMI_END_REG; /*!< (@ 0x0000002C) CMAC end Address Register */
- __IOM uint32_t SNC_BASE_REG; /*!< (@ 0x00000030) Sensor Node Controller Base Address Register */
- __IM uint32_t RESERVED2[16];
- __IOM uint32_t BUSY_SET_REG; /*!< (@ 0x00000074) BSR Set Register */
- __IOM uint32_t BUSY_RESET_REG; /*!< (@ 0x00000078) BSR Reset Register */
- __IOM uint32_t BUSY_STAT_REG; /*!< (@ 0x0000007C) BSR Status Register */
-} MEMCTRL_Type; /*!< Size = 128 (0x80) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ OTPC ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief OTPC registers (OTPC)
- */
-
-typedef struct { /*!< (@ 0x30070000) OTPC Structure */
- __IOM uint32_t OTPC_MODE_REG; /*!< (@ 0x00000000) Mode register */
- __IOM uint32_t OTPC_STAT_REG; /*!< (@ 0x00000004) Status register */
- __IOM uint32_t OTPC_PADDR_REG; /*!< (@ 0x00000008) The address of the word that will be programmed,
- when the PROG mode is used. */
- __IOM uint32_t OTPC_PWORD_REG; /*!< (@ 0x0000000C) The 32-bit word that will be programmed, when
- the PROG mode is used. */
- __IOM uint32_t OTPC_TIM1_REG; /*!< (@ 0x00000010) Various timing parameters of the OTP cell. */
- __IOM uint32_t OTPC_TIM2_REG; /*!< (@ 0x00000014) Various timing parameters of the OTP cell. */
-} OTPC_Type; /*!< Size = 24 (0x18) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ PDC ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief PDC registers (PDC)
- */
-
-typedef struct { /*!< (@ 0x50000200) PDC Structure */
- __IOM uint32_t PDC_CTRL0_REG; /*!< (@ 0x00000000) PDC control register */
- __IOM uint32_t PDC_CTRL1_REG; /*!< (@ 0x00000004) PDC control register */
- __IOM uint32_t PDC_CTRL2_REG; /*!< (@ 0x00000008) PDC control register */
- __IOM uint32_t PDC_CTRL3_REG; /*!< (@ 0x0000000C) PDC control register */
- __IOM uint32_t PDC_CTRL4_REG; /*!< (@ 0x00000010) PDC control register */
- __IOM uint32_t PDC_CTRL5_REG; /*!< (@ 0x00000014) PDC control register */
- __IOM uint32_t PDC_CTRL6_REG; /*!< (@ 0x00000018) PDC control register */
- __IOM uint32_t PDC_CTRL7_REG; /*!< (@ 0x0000001C) PDC control register */
- __IOM uint32_t PDC_CTRL8_REG; /*!< (@ 0x00000020) PDC control register */
- __IOM uint32_t PDC_CTRL9_REG; /*!< (@ 0x00000024) PDC control register */
- __IOM uint32_t PDC_CTRL10_REG; /*!< (@ 0x00000028) PDC control register */
- __IOM uint32_t PDC_CTRL11_REG; /*!< (@ 0x0000002C) PDC control register */
- __IOM uint32_t PDC_CTRL12_REG; /*!< (@ 0x00000030) PDC control register */
- __IOM uint32_t PDC_CTRL13_REG; /*!< (@ 0x00000034) PDC control register */
- __IOM uint32_t PDC_CTRL14_REG; /*!< (@ 0x00000038) PDC control register */
- __IOM uint32_t PDC_CTRL15_REG; /*!< (@ 0x0000003C) PDC control register */
- __IM uint32_t RESERVED[16];
- __IOM uint32_t PDC_ACKNOWLEDGE_REG; /*!< (@ 0x00000080) Clear a pending PDC bit */
- __IOM uint32_t PDC_PENDING_REG; /*!< (@ 0x00000084) Shows any pending wakup event */
- __IOM uint32_t PDC_PENDING_SNC_REG; /*!< (@ 0x00000088) Shows any pending IRQ to SNC */
- __IOM uint32_t PDC_PENDING_CM33_REG; /*!< (@ 0x0000008C) Shows any pending IRQ to CM33 */
- __IOM uint32_t PDC_PENDING_CMAC_REG; /*!< (@ 0x00000090) Shows any pending IRQ to CM33 */
- __IOM uint32_t PDC_SET_PENDING_REG; /*!< (@ 0x00000094) Set a pending PDC bit */
-} PDC_Type; /*!< Size = 152 (0x98) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ PWMLED ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief PWMLED registers (PWMLED)
- */
-
-typedef struct { /*!< (@ 0x50030500) PWMLED Structure */
- __IOM uint32_t PWMLED_DUTY_CYCLE_LED1_REG; /*!< (@ 0x00000000) Defines duty cycle for PWM1 */
- __IOM uint32_t PWMLED_DUTY_CYCLE_LED2_REG; /*!< (@ 0x00000004) Defines duty cycle for PWM2 */
- __IOM uint32_t PWMLED_FREQUENCY_REG; /*!< (@ 0x00000008) Defines the PWM frequecny */
- __IOM uint32_t PWMLED_CTRL_REG; /*!< (@ 0x0000000C) PWM Control register */
-} PWMLED_Type; /*!< Size = 16 (0x10) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ QSPIC ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief QSPIC registers (QSPIC)
- */
-
-typedef struct { /*!< (@ 0x38000000) QSPIC Structure */
- __IOM uint32_t QSPIC_CTRLBUS_REG; /*!< (@ 0x00000000) SPI Bus control register for the Manual mode */
- __IOM uint32_t QSPIC_CTRLMODE_REG; /*!< (@ 0x00000004) Mode Control register */
- __IOM uint32_t QSPIC_RECVDATA_REG; /*!< (@ 0x00000008) Received data for the Manual mode */
- __IOM uint32_t QSPIC_BURSTCMDA_REG; /*!< (@ 0x0000000C) The way of reading in Auto mode (command register
- A) */
- __IOM uint32_t QSPIC_BURSTCMDB_REG; /*!< (@ 0x00000010) The way of reading in Auto mode (command register
- B) */
- __IOM uint32_t QSPIC_STATUS_REG; /*!< (@ 0x00000014) The status register of the QSPI controller */
- __IOM uint32_t QSPIC_WRITEDATA_REG; /*!< (@ 0x00000018) Write data to SPI Bus for the Manual mode */
- __IOM uint32_t QSPIC_READDATA_REG; /*!< (@ 0x0000001C) Read data from SPI Bus for the Manual mode */
- __IOM uint32_t QSPIC_DUMMYDATA_REG; /*!< (@ 0x00000020) Send dummy clocks to SPI Bus for the Manual mode */
- __IOM uint32_t QSPIC_ERASECTRL_REG; /*!< (@ 0x00000024) QSPI Erase control register */
- __IOM uint32_t QSPIC_ERASECMDA_REG; /*!< (@ 0x00000028) The way of erasing in Auto mode (command register
- A) */
- __IOM uint32_t QSPIC_ERASECMDB_REG; /*!< (@ 0x0000002C) The way of erasing in Auto mode (command register
- B) */
- __IOM uint32_t QSPIC_BURSTBRK_REG; /*!< (@ 0x00000030) Read break sequence in Auto mode */
- __IOM uint32_t QSPIC_STATUSCMD_REG; /*!< (@ 0x00000034) The way of reading the status of external device
- in Auto mode */
- __IOM uint32_t QSPIC_CHCKERASE_REG; /*!< (@ 0x00000038) Check erase progress in Auto mode */
- __IOM uint32_t QSPIC_GP_REG; /*!< (@ 0x0000003C) QSPI General Purpose control register */
- __IOM uint32_t QSPIC_UCODE_START; /*!< (@ 0x00000040) QSPIC uCode memory */
- __IM uint32_t RESERVED[15];
- __IOM uint32_t QSPIC_CTR_CTRL_REG; /*!< (@ 0x00000080) Control register for the decryption engine of
- the QSPIC */
- __IOM uint32_t QSPIC_CTR_SADDR_REG; /*!< (@ 0x00000084) Start address of the encrypted content in the
- QSPI flash */
- __IOM uint32_t QSPIC_CTR_EADDR_REG; /*!< (@ 0x00000088) End address of the encrypted content in the QSPI
- flash */
- __IOM uint32_t QSPIC_CTR_NONCE_0_3_REG; /*!< (@ 0x0000008C) Nonce bytes 0 to 3 for the AES-CTR algorithm */
- __IOM uint32_t QSPIC_CTR_NONCE_4_7_REG; /*!< (@ 0x00000090) Nonce bytes 4 to 7 for the AES-CTR algorithm */
- __IOM uint32_t QSPIC_CTR_KEY_0_3_REG; /*!< (@ 0x00000094) Key bytes 0 to 3 for the AES-CTR algorithm */
- __IOM uint32_t QSPIC_CTR_KEY_4_7_REG; /*!< (@ 0x00000098) Key bytes 4 to 7 for the AES-CTR algorithm */
- __IOM uint32_t QSPIC_CTR_KEY_8_11_REG; /*!< (@ 0x0000009C) Key bytes 8 to 11 for the AES-CTR algorithm */
- __IOM uint32_t QSPIC_CTR_KEY_12_15_REG; /*!< (@ 0x000000A0) Key bytes 12 to 15 for the AES-CTR algorithm */
- __IOM uint32_t QSPIC_CTR_KEY_16_19_REG; /*!< (@ 0x000000A4) Key bytes 16 to 19 for the AES-CTR algorithm */
- __IOM uint32_t QSPIC_CTR_KEY_20_23_REG; /*!< (@ 0x000000A8) Key bytes 20 to 23 for the AES-CTR algorithm */
- __IOM uint32_t QSPIC_CTR_KEY_24_27_REG; /*!< (@ 0x000000AC) Key bytes 24 to 27 for the AES-CTR algorithm */
- __IOM uint32_t QSPIC_CTR_KEY_28_31_REG; /*!< (@ 0x000000B0) Key bytes 28 to 31 for the AES-CTR algorithm */
-} QSPIC_Type; /*!< Size = 180 (0xb4) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ QSPIC2 ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief QSPIC2 registers (QSPIC2)
- */
-
-typedef struct { /*!< (@ 0x34000000) QSPIC2 Structure */
- __IOM uint32_t QSPIC2_CTRLBUS_REG; /*!< (@ 0x00000000) SPI Bus control register for the Manual mode */
- __IOM uint32_t QSPIC2_CTRLMODE_REG; /*!< (@ 0x00000004) Mode control register */
- __IOM uint32_t QSPIC2_RECVDATA_REG; /*!< (@ 0x00000008) Received data for the Manual mode */
- __IOM uint32_t QSPIC2_BURSTCMDA_REG; /*!< (@ 0x0000000C) The way of reading in Auto mode (command register
- A) */
- __IOM uint32_t QSPIC2_BURSTCMDB_REG; /*!< (@ 0x00000010) The way of reading in Auto mode (command register
- B) */
- __IOM uint32_t QSPIC2_STATUS_REG; /*!< (@ 0x00000014) The status register of the QSPI controller */
- __IOM uint32_t QSPIC2_WRITEDATA_REG; /*!< (@ 0x00000018) Write data to SPI Bus for the Manual mode */
- __IOM uint32_t QSPIC2_READDATA_REG; /*!< (@ 0x0000001C) Read data from SPI Bus for the Manual mode */
- __IOM uint32_t QSPIC2_DUMMYDATA_REG; /*!< (@ 0x00000020) Send dummy clocks to SPI Bus for the Manual mode */
- __IOM uint32_t QSPIC2_ERASECTRL_REG; /*!< (@ 0x00000024) Erase control register */
- __IOM uint32_t QSPIC2_ERASECMDA_REG; /*!< (@ 0x00000028) The way of erasing in Auto mode (command register
- A) */
- __IOM uint32_t QSPIC2_ERASECMDB_REG; /*!< (@ 0x0000002C) The way of erasing in Auto mode (command register
- B) */
- __IOM uint32_t QSPIC2_BURSTBRK_REG; /*!< (@ 0x00000030) Read break sequence in Auto mode */
- __IOM uint32_t QSPIC2_STATUSCMD_REG; /*!< (@ 0x00000034) The way of reading the status of external device
- in Auto mode */
- __IOM uint32_t QSPIC2_CHCKERASE_REG; /*!< (@ 0x00000038) Check erase progress in Auto mode */
- __IOM uint32_t QSPIC2_GP_REG; /*!< (@ 0x0000003C) General purpose QSPIC2 register */
- __IOM uint32_t QSPIC2_AWRITECMD_REG; /*!< (@ 0x00000040) The way of writing in Auto mode when the external
- device is a serial SRAM */
- __IOM uint32_t QSPIC2_MEMBLEN_REG; /*!< (@ 0x00000044) External memory burst length configuration */
-} QSPIC2_Type; /*!< Size = 72 (0x48) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ RFMON ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief RFMON registers (RFMON)
- */
-
-typedef struct { /*!< (@ 0x50040600) RFMON Structure */
- __IOM uint32_t RFMON_CTRL_REG; /*!< (@ 0x00000000) Control register */
- __IOM uint32_t RFMON_ADDR_REG; /*!< (@ 0x00000004) AHB master start address */
- __IOM uint32_t RFMON_LEN_REG; /*!< (@ 0x00000008) Data length register */
- __IOM uint32_t RFMON_STAT_REG; /*!< (@ 0x0000000C) Status register */
- __IOM uint32_t RFMON_CRV_ADDR_REG; /*!< (@ 0x00000010) AHB master current address */
- __IOM uint32_t RFMON_CRV_LEN_REG; /*!< (@ 0x00000014) The remaining data to be transferred */
-} RFMON_Type; /*!< Size = 24 (0x18) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ RTC ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief RTC registers (RTC)
- */
-
-typedef struct { /*!< (@ 0x50000400) RTC Structure */
- __IOM uint32_t RTC_CONTROL_REG; /*!< (@ 0x00000000) RTC Control Register */
- __IOM uint32_t RTC_HOUR_MODE_REG; /*!< (@ 0x00000004) RTC Hour Mode Register */
- __IOM uint32_t RTC_TIME_REG; /*!< (@ 0x00000008) RTC Time Register */
- __IOM uint32_t RTC_CALENDAR_REG; /*!< (@ 0x0000000C) RTC Calendar Register */
- __IOM uint32_t RTC_TIME_ALARM_REG; /*!< (@ 0x00000010) RTC Time Alarm Register */
- __IOM uint32_t RTC_CALENDAR_ALARM_REG; /*!< (@ 0x00000014) RTC Calendar Alram Register */
- __IOM uint32_t RTC_ALARM_ENABLE_REG; /*!< (@ 0x00000018) RTC Alarm Enable Register */
- __IOM uint32_t RTC_EVENT_FLAGS_REG; /*!< (@ 0x0000001C) RTC Event Flags Register */
- __IOM uint32_t RTC_INTERRUPT_ENABLE_REG; /*!< (@ 0x00000020) RTC Interrupt Enable Register */
- __IOM uint32_t RTC_INTERRUPT_DISABLE_REG; /*!< (@ 0x00000024) RTC Interrupt Disable Register */
- __IOM uint32_t RTC_INTERRUPT_MASK_REG; /*!< (@ 0x00000028) RTC Interrupt Mask Register */
- __IOM uint32_t RTC_STATUS_REG; /*!< (@ 0x0000002C) RTC Status Register */
- __IOM uint32_t RTC_KEEP_RTC_REG; /*!< (@ 0x00000030) RTC Keep RTC Register */
- __IM uint32_t RESERVED[19];
- __IOM uint32_t RTC_EVENT_CTRL_REG; /*!< (@ 0x00000080) RTC Event Control Register */
- __IOM uint32_t RTC_MOTOR_EVENT_PERIOD_REG; /*!< (@ 0x00000084) RTC Motor Event Period Register */
- __IOM uint32_t RTC_PDC_EVENT_PERIOD_REG; /*!< (@ 0x00000088) RTC PDC Event Period Register */
- __IOM uint32_t RTC_PDC_EVENT_CLEAR_REG; /*!< (@ 0x0000008C) RTC PDC Event Clear Register */
- __IOM uint32_t RTC_MOTOR_EVENT_CNT_REG; /*!< (@ 0x00000090) RTC Motor Event Counter Register */
- __IOM uint32_t RTC_PDC_EVENT_CNT_REG; /*!< (@ 0x00000094) RTC PDC Event Counter Register */
-} RTC_Type; /*!< Size = 152 (0x98) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ SDADC ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief SDADC registers (SDADC)
- */
-
-typedef struct { /*!< (@ 0x50020800) SDADC Structure */
- __IOM uint32_t SDADC_CTRL_REG; /*!< (@ 0x00000000) Sigma Delta ADC Control Register */
- __IM uint32_t RESERVED;
- __IOM uint32_t SDADC_TEST_REG; /*!< (@ 0x00000008) Sigma Delta ADC Test Register */
- __IOM uint32_t SDADC_GAIN_CORR_REG; /*!< (@ 0x0000000C) Sigma Delta ADC Gain Correction Register */
- __IOM uint32_t SDADC_OFFS_CORR_REG; /*!< (@ 0x00000010) Sigma Delta ADC Offset Correction Register */
- __IOM uint32_t SDADC_CLEAR_INT_REG; /*!< (@ 0x00000014) Sigma Delta ADC Clear Interrupt Register */
- __IOM uint32_t SDADC_RESULT_REG; /*!< (@ 0x00000018) Sigma Delta ADC Result Register */
-} SDADC_Type; /*!< Size = 28 (0x1c) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ SMOTOR ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief SMOTOR registers (SMOTOR)
- */
-
-typedef struct { /*!< (@ 0x50030E00) SMOTOR Structure */
- __IOM uint32_t SMOTOR_CTRL_REG; /*!< (@ 0x00000000) Motor control register */
- __IOM uint32_t PG0_CTRL_REG; /*!< (@ 0x00000004) Pattern generator 0 control register */
- __IOM uint32_t PG1_CTRL_REG; /*!< (@ 0x00000008) Pattern generator 1 control register */
- __IOM uint32_t PG2_CTRL_REG; /*!< (@ 0x0000000C) Pattern generator 2 control register */
- __IOM uint32_t PG3_CTRL_REG; /*!< (@ 0x00000010) Pattern generator 3 control register */
- __IOM uint32_t PG4_CTRL_REG; /*!< (@ 0x00000014) Pattern generator 4 control register */
- __IOM uint32_t SMOTOR_TRIGGER_REG; /*!< (@ 0x00000018) Motor controller trigger register */
- __IM uint32_t RESERVED;
- __IOM uint32_t SMOTOR_CMD_FIFO_REG; /*!< (@ 0x00000020) Motor control command FIFO register */
- __IOM uint32_t SMOTOR_CMD_READ_PTR_REG; /*!< (@ 0x00000024) Command read pointer register */
- __IOM uint32_t SMOTOR_CMD_WRITE_PTR_REG; /*!< (@ 0x00000028) Command write pointer register */
- __IOM uint32_t SMOTOR_STATUS_REG; /*!< (@ 0x0000002C) Motor controller status register */
- __IOM uint32_t SMOTOR_IRQ_CLEAR_REG; /*!< (@ 0x00000030) Motor control IRQ clear register */
- __IM uint32_t RESERVED1[3];
- __IOM uint32_t WAVETABLE_BASE; /*!< (@ 0x00000040) Base address of the wavetable */
- __IM uint32_t RESERVED2[15];
- __IOM uint32_t CMD_TABLE_BASE; /*!< (@ 0x00000080) Base address of the command table */
-} SMOTOR_Type; /*!< Size = 132 (0x84) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ SNC ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief SNC registers (SNC)
- */
-
-typedef struct { /*!< (@ 0x50020C00) SNC Structure */
- __IOM uint32_t SNC_CTRL_REG; /*!< (@ 0x00000000) Sensor Node Control Register */
- __IOM uint32_t SNC_STATUS_REG; /*!< (@ 0x00000004) Sensor Node Status Register */
- __IOM uint32_t SNC_LP_TIMER_REG; /*!< (@ 0x00000008) Sensor Node Low-Power Timer Register */
- __IOM uint32_t SNC_PC_REG; /*!< (@ 0x0000000C) Sensor Node Program Counter */
- __IOM uint32_t SNC_R1_REG; /*!< (@ 0x00000010) Sensor Node core - Operand 1 Register */
- __IOM uint32_t SNC_R2_REG; /*!< (@ 0x00000014) Sensor Node core - Operand 2 Register */
- __IOM uint32_t SNC_TMP1_REG; /*!< (@ 0x00000018) Sensor Node core - Temporary Register 1 */
- __IOM uint32_t SNC_TMP2_REG; /*!< (@ 0x0000001C) Sensor Node core - Temporary Register 2 */
-} SNC_Type; /*!< Size = 32 (0x20) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ SPI ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief SPI registers (SPI)
- */
-
-typedef struct { /*!< (@ 0x50020300) SPI Structure */
- __IOM uint32_t SPI_CTRL_REG; /*!< (@ 0x00000000) SPI control register 0 */
- __IOM uint32_t SPI_RX_TX_REG; /*!< (@ 0x00000004) SPI RX/TX register0 */
- __IOM uint32_t SPI_CLEAR_INT_REG; /*!< (@ 0x00000008) SPI clear interrupt register */
-} SPI_Type; /*!< Size = 12 (0xc) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ SPI2 ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief SPI2 registers (SPI2)
- */
-
-typedef struct { /*!< (@ 0x50020400) SPI2 Structure */
- __IOM uint32_t SPI2_CTRL_REG; /*!< (@ 0x00000000) SPI control register 0 */
- __IOM uint32_t SPI2_RX_TX_REG; /*!< (@ 0x00000004) SPI RX/TX register0 */
- __IOM uint32_t SPI2_CLEAR_INT_REG; /*!< (@ 0x00000008) SPI clear interrupt register */
-} SPI2_Type; /*!< Size = 12 (0xc) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ SYS_WDOG ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief SYS_WDOG registers (SYS_WDOG)
- */
-
-typedef struct { /*!< (@ 0x50000700) SYS_WDOG Structure */
- __IOM uint32_t WATCHDOG_REG; /*!< (@ 0x00000000) Watchdog timer register. */
- __IOM uint32_t WATCHDOG_CTRL_REG; /*!< (@ 0x00000004) Watchdog control register. */
-} SYS_WDOG_Type; /*!< Size = 8 (0x8) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ TIMER ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief TIMER registers (TIMER)
- */
-
-typedef struct { /*!< (@ 0x50010200) TIMER Structure */
- __IOM uint32_t TIMER_CTRL_REG; /*!< (@ 0x00000000) Timer control register */
- __IOM uint32_t TIMER_TIMER_VAL_REG; /*!< (@ 0x00000004) Timer counter value */
- __IOM uint32_t TIMER_STATUS_REG; /*!< (@ 0x00000008) Timer status register */
- __IOM uint32_t TIMER_GPIO1_CONF_REG; /*!< (@ 0x0000000C) Timer gpio1 selection */
- __IOM uint32_t TIMER_GPIO2_CONF_REG; /*!< (@ 0x00000010) Timer gpio2 selection */
- __IOM uint32_t TIMER_RELOAD_REG; /*!< (@ 0x00000014) Timer reload value and Delay in shot mode */
- __IOM uint32_t TIMER_SHOTWIDTH_REG; /*!< (@ 0x00000018) Timer Shot duration in shot mode */
- __IOM uint32_t TIMER_PRESCALER_REG; /*!< (@ 0x0000001C) Timer prescaler value */
- __IOM uint32_t TIMER_CAPTURE_GPIO1_REG; /*!< (@ 0x00000020) Timer value for event on GPIO1 */
- __IOM uint32_t TIMER_CAPTURE_GPIO2_REG; /*!< (@ 0x00000024) Timer value for event on GPIO2 */
- __IOM uint32_t TIMER_PRESCALER_VAL_REG; /*!< (@ 0x00000028) Timer prescaler counter valuew */
- __IOM uint32_t TIMER_PWM_FREQ_REG; /*!< (@ 0x0000002C) Timer pwm frequency register */
- __IOM uint32_t TIMER_PWM_DC_REG; /*!< (@ 0x00000030) Timer pwm dc register */
- __IOM uint32_t TIMER_GPIO3_CONF_REG; /*!< (@ 0x00000034) Timer gpio3 selection */
- __IOM uint32_t TIMER_GPIO4_CONF_REG; /*!< (@ 0x00000038) Timer gpio4 selection */
- __IOM uint32_t TIMER_CAPTURE_GPIO3_REG; /*!< (@ 0x0000003C) Timer value for event on GPIO1 */
- __IOM uint32_t TIMER_CAPTURE_GPIO4_REG; /*!< (@ 0x00000040) Timer value for event on GPIO1 */
- __IOM uint32_t TIMER_CLEAR_GPIO_EVENT_REG; /*!< (@ 0x00000044) Timer clear gpio event register */
- __IOM uint32_t TIMER_CLEAR_IRQ_REG; /*!< (@ 0x00000048) Timer clear interrupt */
-} TIMER_Type; /*!< Size = 76 (0x4c) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ TIMER2 ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief TIMER2 registers (TIMER2)
- */
-
-typedef struct { /*!< (@ 0x50010300) TIMER2 Structure */
- __IOM uint32_t TIMER2_CTRL_REG; /*!< (@ 0x00000000) Timer control register */
- __IOM uint32_t TIMER2_TIMER_VAL_REG; /*!< (@ 0x00000004) Timer counter value */
- __IOM uint32_t TIMER2_STATUS_REG; /*!< (@ 0x00000008) Timer status register */
- __IOM uint32_t TIMER2_GPIO1_CONF_REG; /*!< (@ 0x0000000C) Timer gpio1 selection */
- __IOM uint32_t TIMER2_GPIO2_CONF_REG; /*!< (@ 0x00000010) Timer gpio2 selection */
- __IOM uint32_t TIMER2_RELOAD_REG; /*!< (@ 0x00000014) Timer reload value and Delay in shot mode */
- __IOM uint32_t TIMER2_SHOTWIDTH_REG; /*!< (@ 0x00000018) Timer Shot duration in shot mode */
- __IOM uint32_t TIMER2_PRESCALER_REG; /*!< (@ 0x0000001C) Timer prescaler value */
- __IOM uint32_t TIMER2_CAPTURE_GPIO1_REG; /*!< (@ 0x00000020) Timer value for event on GPIO1 */
- __IOM uint32_t TIMER2_CAPTURE_GPIO2_REG; /*!< (@ 0x00000024) Timer value for event on GPIO2 */
- __IOM uint32_t TIMER2_PRESCALER_VAL_REG; /*!< (@ 0x00000028) Timer prescaler counter valuew */
- __IOM uint32_t TIMER2_PWM_FREQ_REG; /*!< (@ 0x0000002C) Timer pwm frequency register */
- __IOM uint32_t TIMER2_PWM_DC_REG; /*!< (@ 0x00000030) Timer pwm dc register */
- __IOM uint32_t TIMER2_CLEAR_IRQ_REG; /*!< (@ 0x00000034) Timer clear interrupt */
-} TIMER2_Type; /*!< Size = 56 (0x38) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ TIMER3 ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief TIMER3 registers (TIMER3)
- */
-
-typedef struct { /*!< (@ 0x50040A00) TIMER3 Structure */
- __IOM uint32_t TIMER3_CTRL_REG; /*!< (@ 0x00000000) Timer control register */
- __IOM uint32_t TIMER3_TIMER_VAL_REG; /*!< (@ 0x00000004) Timer counter value */
- __IOM uint32_t TIMER3_STATUS_REG; /*!< (@ 0x00000008) Timer status register */
- __IOM uint32_t TIMER3_GPIO1_CONF_REG; /*!< (@ 0x0000000C) Timer gpio1 selection */
- __IOM uint32_t TIMER3_GPIO2_CONF_REG; /*!< (@ 0x00000010) Timer gpio2 selection */
- __IOM uint32_t TIMER3_RELOAD_REG; /*!< (@ 0x00000014) Timer reload value and Delay in shot mode */
- __IM uint32_t RESERVED;
- __IOM uint32_t TIMER3_PRESCALER_REG; /*!< (@ 0x0000001C) Timer prescaler value */
- __IOM uint32_t TIMER3_CAPTURE_GPIO1_REG; /*!< (@ 0x00000020) Timer value for event on GPIO1 */
- __IOM uint32_t TIMER3_CAPTURE_GPIO2_REG; /*!< (@ 0x00000024) Timer value for event on GPIO2 */
- __IOM uint32_t TIMER3_PRESCALER_VAL_REG; /*!< (@ 0x00000028) Timer prescaler counter valuew */
- __IOM uint32_t TIMER3_PWM_FREQ_REG; /*!< (@ 0x0000002C) Timer pwm frequency register */
- __IOM uint32_t TIMER3_PWM_DC_REG; /*!< (@ 0x00000030) Timer pwm dc register */
- __IOM uint32_t TIMER3_CLEAR_IRQ_REG; /*!< (@ 0x00000034) Timer clear interrupt */
-} TIMER3_Type; /*!< Size = 56 (0x38) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ TIMER4 ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief TIMER4 registers (TIMER4)
- */
-
-typedef struct { /*!< (@ 0x50040B00) TIMER4 Structure */
- __IOM uint32_t TIMER4_CTRL_REG; /*!< (@ 0x00000000) Timer control register */
- __IOM uint32_t TIMER4_TIMER_VAL_REG; /*!< (@ 0x00000004) Timer counter value */
- __IOM uint32_t TIMER4_STATUS_REG; /*!< (@ 0x00000008) Timer status register */
- __IOM uint32_t TIMER4_GPIO1_CONF_REG; /*!< (@ 0x0000000C) Timer gpio1 selection */
- __IOM uint32_t TIMER4_GPIO2_CONF_REG; /*!< (@ 0x00000010) Timer gpio2 selection */
- __IOM uint32_t TIMER4_RELOAD_REG; /*!< (@ 0x00000014) Timer reload value and Delay in shot mode */
- __IM uint32_t RESERVED;
- __IOM uint32_t TIMER4_PRESCALER_REG; /*!< (@ 0x0000001C) Timer prescaler value */
- __IOM uint32_t TIMER4_CAPTURE_GPIO1_REG; /*!< (@ 0x00000020) Timer value for event on GPIO1 */
- __IOM uint32_t TIMER4_CAPTURE_GPIO2_REG; /*!< (@ 0x00000024) Timer value for event on GPIO2 */
- __IOM uint32_t TIMER4_PRESCALER_VAL_REG; /*!< (@ 0x00000028) Timer prescaler counter valuew */
- __IOM uint32_t TIMER4_PWM_FREQ_REG; /*!< (@ 0x0000002C) Timer pwm frequency register */
- __IOM uint32_t TIMER4_PWM_DC_REG; /*!< (@ 0x00000030) Timer pwm dc register */
- __IOM uint32_t TIMER4_CLEAR_IRQ_REG; /*!< (@ 0x00000034) Timer clear interrupt */
-} TIMER4_Type; /*!< Size = 56 (0x38) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ TRNG ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief TRNG registers (TRNG)
- */
-
-typedef struct { /*!< (@ 0x50040C00) TRNG Structure */
- __IOM uint32_t TRNG_CTRL_REG; /*!< (@ 0x00000000) TRNG control register */
- __IOM uint32_t TRNG_FIFOLVL_REG; /*!< (@ 0x00000004) TRNG FIFO level register */
- __IOM uint32_t TRNG_VER_REG; /*!< (@ 0x00000008) TRNG Version register */
-} TRNG_Type; /*!< Size = 12 (0xc) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ UART ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief UART registers (UART)
- */
-
-typedef struct { /*!< (@ 0x50020000) UART Structure */
- __IOM uint32_t UART_RBR_THR_DLL_REG; /*!< (@ 0x00000000) Receive Buffer Register */
- __IOM uint32_t UART_IER_DLH_REG; /*!< (@ 0x00000004) Interrupt Enable Register */
- __IOM uint32_t UART_IIR_FCR_REG; /*!< (@ 0x00000008) Interrupt Identification Register/FIFO Control
- Register */
- __IOM uint32_t UART_LCR_REG; /*!< (@ 0x0000000C) Line Control Register */
- __IOM uint32_t UART_MCR_REG; /*!< (@ 0x00000010) Modem Control Register */
- __IOM uint32_t UART_LSR_REG; /*!< (@ 0x00000014) Line Status Register */
- __IM uint32_t RESERVED;
- __IOM uint32_t UART_SCR_REG; /*!< (@ 0x0000001C) Scratchpad Register */
- __IM uint32_t RESERVED1[4];
- __IOM uint32_t UART_SRBR_STHR0_REG; /*!< (@ 0x00000030) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR1_REG; /*!< (@ 0x00000034) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR2_REG; /*!< (@ 0x00000038) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR3_REG; /*!< (@ 0x0000003C) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR4_REG; /*!< (@ 0x00000040) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR5_REG; /*!< (@ 0x00000044) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR6_REG; /*!< (@ 0x00000048) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR7_REG; /*!< (@ 0x0000004C) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR8_REG; /*!< (@ 0x00000050) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR9_REG; /*!< (@ 0x00000054) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR10_REG; /*!< (@ 0x00000058) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR11_REG; /*!< (@ 0x0000005C) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR12_REG; /*!< (@ 0x00000060) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR13_REG; /*!< (@ 0x00000064) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR14_REG; /*!< (@ 0x00000068) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART_SRBR_STHR15_REG; /*!< (@ 0x0000006C) Shadow Receive/Transmit Buffer Register */
- __IM uint32_t RESERVED2[3];
- __IOM uint32_t UART_USR_REG; /*!< (@ 0x0000007C) UART Status register. */
- __IOM uint32_t UART_TFL_REG; /*!< (@ 0x00000080) Transmit FIFO Level */
- __IOM uint32_t UART_RFL_REG; /*!< (@ 0x00000084) Receive FIFO Level. */
- __IOM uint32_t UART_SRR_REG; /*!< (@ 0x00000088) Software Reset Register. */
- __IM uint32_t RESERVED3;
- __IOM uint32_t UART_SBCR_REG; /*!< (@ 0x00000090) Shadow Break Control Register */
- __IOM uint32_t UART_SDMAM_REG; /*!< (@ 0x00000094) Shadow DMA Mode */
- __IOM uint32_t UART_SFE_REG; /*!< (@ 0x00000098) Shadow FIFO Enable */
- __IOM uint32_t UART_SRT_REG; /*!< (@ 0x0000009C) Shadow RCVR Trigger */
- __IOM uint32_t UART_STET_REG; /*!< (@ 0x000000A0) Shadow TX Empty Trigger */
- __IOM uint32_t UART_HTX_REG; /*!< (@ 0x000000A4) Halt TX */
- __IOM uint32_t UART_DMASA_REG; /*!< (@ 0x000000A8) DMA Software Acknowledge */
- __IM uint32_t RESERVED4[5];
- __IOM uint32_t UART_DLF_REG; /*!< (@ 0x000000C0) Divisor Latch Fraction Register */
- __IM uint32_t RESERVED5[13];
- __IOM uint32_t UART_UCV_REG; /*!< (@ 0x000000F8) Component Version */
- __IOM uint32_t UART_CTR_REG; /*!< (@ 0x000000FC) Component Type Register */
-} UART_Type; /*!< Size = 256 (0x100) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ UART2 ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief UART2 registers (UART2)
- */
-
-typedef struct { /*!< (@ 0x50020100) UART2 Structure */
- __IOM uint32_t UART2_RBR_THR_DLL_REG; /*!< (@ 0x00000000) Receive Buffer Register */
- __IOM uint32_t UART2_IER_DLH_REG; /*!< (@ 0x00000004) Interrupt Enable Register */
- __IOM uint32_t UART2_IIR_FCR_REG; /*!< (@ 0x00000008) Interrupt Identification Register/FIFO Control
- Register */
- __IOM uint32_t UART2_LCR_REG; /*!< (@ 0x0000000C) Line Control Register */
- __IOM uint32_t UART2_MCR_REG; /*!< (@ 0x00000010) Modem Control Register */
- __IOM uint32_t UART2_LSR_REG; /*!< (@ 0x00000014) Line Status Register */
- __IOM uint32_t UART2_MSR_REG; /*!< (@ 0x00000018) Modem Status Register */
- __IOM uint32_t UART2_SCR_REG; /*!< (@ 0x0000001C) Scratchpad Register */
- __IM uint32_t RESERVED[4];
- __IOM uint32_t UART2_SRBR_STHR0_REG; /*!< (@ 0x00000030) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR1_REG; /*!< (@ 0x00000034) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR2_REG; /*!< (@ 0x00000038) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR3_REG; /*!< (@ 0x0000003C) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR4_REG; /*!< (@ 0x00000040) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR5_REG; /*!< (@ 0x00000044) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR6_REG; /*!< (@ 0x00000048) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR7_REG; /*!< (@ 0x0000004C) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR8_REG; /*!< (@ 0x00000050) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR9_REG; /*!< (@ 0x00000054) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR10_REG; /*!< (@ 0x00000058) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR11_REG; /*!< (@ 0x0000005C) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR12_REG; /*!< (@ 0x00000060) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR13_REG; /*!< (@ 0x00000064) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR14_REG; /*!< (@ 0x00000068) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART2_SRBR_STHR15_REG; /*!< (@ 0x0000006C) Shadow Receive/Transmit Buffer Register */
- __IM uint32_t RESERVED1[3];
- __IOM uint32_t UART2_USR_REG; /*!< (@ 0x0000007C) UART Status register. */
- __IOM uint32_t UART2_TFL_REG; /*!< (@ 0x00000080) Transmit FIFO Level */
- __IOM uint32_t UART2_RFL_REG; /*!< (@ 0x00000084) Receive FIFO Level. */
- __IOM uint32_t UART2_SRR_REG; /*!< (@ 0x00000088) Software Reset Register. */
- __IOM uint32_t UART2_SRTS_REG; /*!< (@ 0x0000008C) Shadow Request to Send */
- __IOM uint32_t UART2_SBCR_REG; /*!< (@ 0x00000090) Shadow Break Control Register */
- __IOM uint32_t UART2_SDMAM_REG; /*!< (@ 0x00000094) Shadow DMA Mode */
- __IOM uint32_t UART2_SFE_REG; /*!< (@ 0x00000098) Shadow FIFO Enable */
- __IOM uint32_t UART2_SRT_REG; /*!< (@ 0x0000009C) Shadow RCVR Trigger */
- __IOM uint32_t UART2_STET_REG; /*!< (@ 0x000000A0) Shadow TX Empty Trigger */
- __IOM uint32_t UART2_HTX_REG; /*!< (@ 0x000000A4) Halt TX */
- __IOM uint32_t UART2_DMASA_REG; /*!< (@ 0x000000A8) DMA Software Acknowledge */
- __IM uint32_t RESERVED2[5];
- __IOM uint32_t UART2_DLF_REG; /*!< (@ 0x000000C0) Divisor Latch Fraction Register */
- __IOM uint32_t UART2_RAR_REG; /*!< (@ 0x000000C4) Receive Address Register */
- __IOM uint32_t UART2_TAR_REG; /*!< (@ 0x000000C8) Transmit Address Register */
- __IOM uint32_t UART2_LCR_EXT; /*!< (@ 0x000000CC) Line Extended Control Register */
- __IM uint32_t RESERVED3[10];
- __IOM uint32_t UART2_UCV_REG; /*!< (@ 0x000000F8) Component Version */
- __IOM uint32_t UART2_CTR_REG; /*!< (@ 0x000000FC) Component Type Register */
-} UART2_Type; /*!< Size = 256 (0x100) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ UART3 ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief UART3 registers (UART3)
- */
-
-typedef struct { /*!< (@ 0x50020200) UART3 Structure */
- __IOM uint32_t UART3_RBR_THR_DLL_REG; /*!< (@ 0x00000000) Receive Buffer Register */
- __IOM uint32_t UART3_IER_DLH_REG; /*!< (@ 0x00000004) Interrupt Enable Register */
- __IOM uint32_t UART3_IIR_FCR_REG; /*!< (@ 0x00000008) Interrupt Identification Register/FIFO Control
- Register */
- __IOM uint32_t UART3_LCR_REG; /*!< (@ 0x0000000C) Line Control Register */
- __IOM uint32_t UART3_MCR_REG; /*!< (@ 0x00000010) Modem Control Register */
- __IOM uint32_t UART3_LSR_REG; /*!< (@ 0x00000014) Line Status Register */
- __IOM uint32_t UART3_MSR_REG; /*!< (@ 0x00000018) Modem Status Register */
- __IOM uint32_t UART3_CONFIG_REG; /*!< (@ 0x0000001C) ISO7816 Config Register */
- __IM uint32_t RESERVED[4];
- __IOM uint32_t UART3_SRBR_STHR0_REG; /*!< (@ 0x00000030) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR1_REG; /*!< (@ 0x00000034) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR2_REG; /*!< (@ 0x00000038) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR3_REG; /*!< (@ 0x0000003C) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR4_REG; /*!< (@ 0x00000040) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR5_REG; /*!< (@ 0x00000044) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR6_REG; /*!< (@ 0x00000048) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR7_REG; /*!< (@ 0x0000004C) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR8_REG; /*!< (@ 0x00000050) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR9_REG; /*!< (@ 0x00000054) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR10_REG; /*!< (@ 0x00000058) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR11_REG; /*!< (@ 0x0000005C) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR12_REG; /*!< (@ 0x00000060) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR13_REG; /*!< (@ 0x00000064) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR14_REG; /*!< (@ 0x00000068) Shadow Receive/Transmit Buffer Register */
- __IOM uint32_t UART3_SRBR_STHR15_REG; /*!< (@ 0x0000006C) Shadow Receive/Transmit Buffer Register */
- __IM uint32_t RESERVED1[3];
- __IOM uint32_t UART3_USR_REG; /*!< (@ 0x0000007C) UART Status register. */
- __IOM uint32_t UART3_TFL_REG; /*!< (@ 0x00000080) Transmit FIFO Level */
- __IOM uint32_t UART3_RFL_REG; /*!< (@ 0x00000084) Receive FIFO Level. */
- __IOM uint32_t UART3_SRR_REG; /*!< (@ 0x00000088) Software Reset Register. */
- __IOM uint32_t UART3_SRTS_REG; /*!< (@ 0x0000008C) Shadow Request to Send */
- __IOM uint32_t UART3_SBCR_REG; /*!< (@ 0x00000090) Shadow Break Control Register */
- __IOM uint32_t UART3_SDMAM_REG; /*!< (@ 0x00000094) Shadow DMA Mode */
- __IOM uint32_t UART3_SFE_REG; /*!< (@ 0x00000098) Shadow FIFO Enable */
- __IOM uint32_t UART3_SRT_REG; /*!< (@ 0x0000009C) Shadow RCVR Trigger */
- __IOM uint32_t UART3_STET_REG; /*!< (@ 0x000000A0) Shadow TX Empty Trigger */
- __IOM uint32_t UART3_HTX_REG; /*!< (@ 0x000000A4) Halt TX */
- __IOM uint32_t UART3_DMASA_REG; /*!< (@ 0x000000A8) DMA Software Acknowledge */
- __IM uint32_t RESERVED2[5];
- __IOM uint32_t UART3_DLF_REG; /*!< (@ 0x000000C0) Divisor Latch Fraction Register */
- __IOM uint32_t UART3_RAR_REG; /*!< (@ 0x000000C4) Receive Address Register */
- __IOM uint32_t UART3_TAR_REG; /*!< (@ 0x000000C8) Transmit Address Register */
- __IOM uint32_t UART3_LCR_EXT; /*!< (@ 0x000000CC) Line Extended Control Register */
- __IM uint32_t RESERVED3[4];
- __IOM uint32_t UART3_CTRL_REG; /*!< (@ 0x000000E0) ISO7816 Control Register */
- __IOM uint32_t UART3_TIMER_REG; /*!< (@ 0x000000E4) ISO7816 Timer Register */
- __IOM uint32_t UART3_ERR_CTRL_REG; /*!< (@ 0x000000E8) ISO7816 Error Signal Control Register */
- __IOM uint32_t UART3_IRQ_STATUS_REG; /*!< (@ 0x000000EC) ISO7816 Interrupt Status Register */
- __IM uint32_t RESERVED4[2];
- __IOM uint32_t UART3_UCV_REG; /*!< (@ 0x000000F8) Component Version */
- __IOM uint32_t UART3_CTR_REG; /*!< (@ 0x000000FC) Component Type Register */
-} UART3_Type; /*!< Size = 256 (0x100) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ USB ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief USB registers (USB)
- */
-
-typedef struct { /*!< (@ 0x50040000) USB Structure */
- __IOM uint32_t USB_MCTRL_REG; /*!< (@ 0x00000000) Main Control Register) */
- __IOM uint32_t USB_XCVDIAG_REG; /*!< (@ 0x00000004) Transceiver diagnostic Register (for test purpose
- only) */
- __IOM uint32_t USB_TCR_REG; /*!< (@ 0x00000008) Transceiver configuration Register */
- __IOM uint32_t USB_UTR_REG; /*!< (@ 0x0000000C) USB test Register (for test purpose only) */
- __IOM uint32_t USB_FAR_REG; /*!< (@ 0x00000010) Function Address Register */
- __IOM uint32_t USB_NFSR_REG; /*!< (@ 0x00000014) Node Functional State Register */
- __IOM uint32_t USB_MAEV_REG; /*!< (@ 0x00000018) Main Event Register */
- __IOM uint32_t USB_MAMSK_REG; /*!< (@ 0x0000001C) Main Mask Register */
- __IOM uint32_t USB_ALTEV_REG; /*!< (@ 0x00000020) Alternate Event Register */
- __IOM uint32_t USB_ALTMSK_REG; /*!< (@ 0x00000024) Alternate Mask Register */
- __IOM uint32_t USB_TXEV_REG; /*!< (@ 0x00000028) Transmit Event Register */
- __IOM uint32_t USB_TXMSK_REG; /*!< (@ 0x0000002C) Transmit Mask Register */
- __IOM uint32_t USB_RXEV_REG; /*!< (@ 0x00000030) Receive Event Register */
- __IOM uint32_t USB_RXMSK_REG; /*!< (@ 0x00000034) Receive Mask Register */
- __IOM uint32_t USB_NAKEV_REG; /*!< (@ 0x00000038) NAK Event Register */
- __IOM uint32_t USB_NAKMSK_REG; /*!< (@ 0x0000003C) NAK Mask Register */
- __IOM uint32_t USB_FWEV_REG; /*!< (@ 0x00000040) FIFO Warning Event Register */
- __IOM uint32_t USB_FWMSK_REG; /*!< (@ 0x00000044) FIFO Warning Mask Register */
- __IOM uint32_t USB_FNH_REG; /*!< (@ 0x00000048) Frame Number High Byte Register */
- __IOM uint32_t USB_FNL_REG; /*!< (@ 0x0000004C) Frame Number Low Byte Register */
- __IM uint32_t RESERVED[11];
- __IOM uint32_t USB_UX20CDR_REG; /*!< (@ 0x0000007C) Transceiver 2.0 Configuration and Diagnostics
- Register(for test purpose only) */
- __IOM uint32_t USB_EPC0_REG; /*!< (@ 0x00000080) Endpoint Control 0 Register */
- __IOM uint32_t USB_TXD0_REG; /*!< (@ 0x00000084) Transmit Data 0 Register */
- __IOM uint32_t USB_TXS0_REG; /*!< (@ 0x00000088) Transmit Status 0 Register */
- __IOM uint32_t USB_TXC0_REG; /*!< (@ 0x0000008C) Transmit command 0 Register */
- __IOM uint32_t USB_EP0_NAK_REG; /*!< (@ 0x00000090) EP0 INNAK and OUTNAK Register */
- __IOM uint32_t USB_RXD0_REG; /*!< (@ 0x00000094) Receive Data 0 Register */
- __IOM uint32_t USB_RXS0_REG; /*!< (@ 0x00000098) Receive Status 0 Register */
- __IOM uint32_t USB_RXC0_REG; /*!< (@ 0x0000009C) Receive Command 0 Register */
- __IOM uint32_t USB_EPC1_REG; /*!< (@ 0x000000A0) Endpoint Control Register 1 */
- __IOM uint32_t USB_TXD1_REG; /*!< (@ 0x000000A4) Transmit Data Register 1 */
- __IOM uint32_t USB_TXS1_REG; /*!< (@ 0x000000A8) Transmit Status Register 1 */
- __IOM uint32_t USB_TXC1_REG; /*!< (@ 0x000000AC) Transmit Command Register 1 */
- __IOM uint32_t USB_EPC2_REG; /*!< (@ 0x000000B0) Endpoint Control Register 2 */
- __IOM uint32_t USB_RXD1_REG; /*!< (@ 0x000000B4) Receive Data Register,1 */
- __IOM uint32_t USB_RXS1_REG; /*!< (@ 0x000000B8) Receive Status Register 1 */
- __IOM uint32_t USB_RXC1_REG; /*!< (@ 0x000000BC) Receive Command Register 1 */
- __IOM uint32_t USB_EPC3_REG; /*!< (@ 0x000000C0) Endpoint Control Register 3 */
- __IOM uint32_t USB_TXD2_REG; /*!< (@ 0x000000C4) Transmit Data Register 2 */
- __IOM uint32_t USB_TXS2_REG; /*!< (@ 0x000000C8) Transmit Status Register 2 */
- __IOM uint32_t USB_TXC2_REG; /*!< (@ 0x000000CC) Transmit Command Register 2 */
- __IOM uint32_t USB_EPC4_REG; /*!< (@ 0x000000D0) Endpoint Control Register 4 */
- __IOM uint32_t USB_RXD2_REG; /*!< (@ 0x000000D4) Receive Data Register 2 */
- __IOM uint32_t USB_RXS2_REG; /*!< (@ 0x000000D8) Receive Status Register 2 */
- __IOM uint32_t USB_RXC2_REG; /*!< (@ 0x000000DC) Receive Command Register 2 */
- __IOM uint32_t USB_EPC5_REG; /*!< (@ 0x000000E0) Endpoint Control Register 5 */
- __IOM uint32_t USB_TXD3_REG; /*!< (@ 0x000000E4) Transmit Data Register 3 */
- __IOM uint32_t USB_TXS3_REG; /*!< (@ 0x000000E8) Transmit Status Register 3 */
- __IOM uint32_t USB_TXC3_REG; /*!< (@ 0x000000EC) Transmit Command Register 3 */
- __IOM uint32_t USB_EPC6_REG; /*!< (@ 0x000000F0) Endpoint Control Register 6 */
- __IOM uint32_t USB_RXD3_REG; /*!< (@ 0x000000F4) Receive Data Register 3 */
- __IOM uint32_t USB_RXS3_REG; /*!< (@ 0x000000F8) Receive Status Register 3 */
- __IOM uint32_t USB_RXC3_REG; /*!< (@ 0x000000FC) Receive Command Register 3 */
- __IM uint32_t RESERVED1[40];
- __IOM uint32_t USB_DMA_CTRL_REG; /*!< (@ 0x000001A0) USB DMA control register */
- __IM uint32_t RESERVED2;
- __IOM uint32_t USB_CHARGER_CTRL_REG; /*!< (@ 0x000001A8) USB Charger Control Register */
- __IOM uint32_t USB_CHARGER_STAT_REG; /*!< (@ 0x000001AC) USB Charger Status Register */
-} USB_Type; /*!< Size = 432 (0x1b0) */
-
-
-
-/* =========================================================================================================================== */
-/* ================ WAKEUP ================ */
-/* =========================================================================================================================== */
-
-
-/**
- * @brief WAKEUP registers (WAKEUP)
- */
-
-typedef struct { /*!< (@ 0x50000100) WAKEUP Structure */
- __IOM uint32_t WKUP_CTRL_REG; /*!< (@ 0x00000000) Control register for the wakeup counter */
- __IM uint32_t RESERVED;
- __IOM uint32_t WKUP_RESET_IRQ_REG; /*!< (@ 0x00000008) Reset wakeup interrupt */
- __IM uint32_t RESERVED1[2];
- __IOM uint32_t WKUP_SELECT_P0_REG; /*!< (@ 0x00000014) select which inputs from P0 port can trigger
- wkup counter */
- __IOM uint32_t WKUP_SELECT_P1_REG; /*!< (@ 0x00000018) select which inputs from P1 port can trigger
- wkup counter */
- __IM uint32_t RESERVED2[3];
- __IOM uint32_t WKUP_POL_P0_REG; /*!< (@ 0x00000028) select the sesitivity polarity for each P0 input */
- __IOM uint32_t WKUP_POL_P1_REG; /*!< (@ 0x0000002C) select the sesitivity polarity for each P1 input */
- __IM uint32_t RESERVED3[3];
- __IOM uint32_t WKUP_STATUS_P0_REG; /*!< (@ 0x0000003C) Event status register for P0 */
- __IOM uint32_t WKUP_STATUS_P1_REG; /*!< (@ 0x00000040) Event status register for P1 */
- __IM uint32_t RESERVED4;
- __IOM uint32_t WKUP_CLEAR_P0_REG; /*!< (@ 0x00000048) Clear event register for P0 */
- __IOM uint32_t WKUP_CLEAR_P1_REG; /*!< (@ 0x0000004C) Clear event register for P1 */
- __IM uint32_t RESERVED5;
- __IOM uint32_t WKUP_SEL_GPIO_P0_REG; /*!< (@ 0x00000054) select which inputs from P0 port can trigger
- interrupt */
- __IOM uint32_t WKUP_SEL_GPIO_P1_REG; /*!< (@ 0x00000058) select which inputs from P1 port can trigger
- interrupt */
-} WAKEUP_Type; /*!< Size = 92 (0x5c) */
-
-
-/** @} */ /* End of group Device_Peripheral_peripherals */
-
-
-/* =========================================================================================================================== */
-/* ================ Device Specific Peripheral Address Map ================ */
-/* =========================================================================================================================== */
-
-
-#define AES_HASH_BASE 0x30040000UL
-#define ANAMISC_BIF_BASE 0x50030B00UL
-#define APU_BASE 0x50030600UL
-#define CACHE_BASE 0x100C0000UL
-#define CHARGER_BASE 0x50040400UL
-#define CHIP_VERSION_BASE 0x50040200UL
-#define CRG_COM_BASE 0x50020900UL
-#define CRG_PER_BASE 0x50030C00UL
-#define CRG_SYS_BASE 0x50040500UL
-#define CRG_TOP_BASE 0x50000000UL
-#define CRG_XTAL_BASE 0x50010000UL
-#define DCDC_BASE 0x50000300UL
-#define DMA_BASE 0x50040800UL
-#define DW_BASE 0x30020000UL
-#define GPADC_BASE 0x50030900UL
-#define GPIO_BASE 0x50020A00UL
-#define GPREG_BASE 0x50040300UL
-#define I2C_BASE 0x50020600UL
-#define I2C2_BASE 0x50020700UL
-#define LCDC_BASE 0x30030000UL
-#define LRA_BASE 0x50030A00UL
-#define MEMCTRL_BASE 0x50050000UL
-#define OTPC_BASE 0x30070000UL
-#define PDC_BASE 0x50000200UL
-#define PWMLED_BASE 0x50030500UL
-#define QSPIC_BASE 0x38000000UL
-#define QSPIC2_BASE 0x34000000UL
-#define RFMON_BASE 0x50040600UL
-#define RTC_BASE 0x50000400UL
-#define SDADC_BASE 0x50020800UL
-#define SMOTOR_BASE 0x50030E00UL
-#define SNC_BASE 0x50020C00UL
-#define SPI_BASE 0x50020300UL
-#define SPI2_BASE 0x50020400UL
-#define SYS_WDOG_BASE 0x50000700UL
-#define TIMER_BASE 0x50010200UL
-#define TIMER2_BASE 0x50010300UL
-#define TIMER3_BASE 0x50040A00UL
-#define TIMER4_BASE 0x50040B00UL
-#define TRNG_BASE 0x50040C00UL
-#define UART_BASE 0x50020000UL
-#define UART2_BASE 0x50020100UL
-#define UART3_BASE 0x50020200UL
-#define USB_BASE 0x50040000UL
-#define WAKEUP_BASE 0x50000100UL
-
-
-/* =========================================================================================================================== */
-/* ================ Peripheral declaration ================ */
-/* =========================================================================================================================== */
-
-
-#define AES_HASH ((AES_HASH_Type*) AES_HASH_BASE)
-#define ANAMISC_BIF ((ANAMISC_BIF_Type*) ANAMISC_BIF_BASE)
-#define APU ((APU_Type*) APU_BASE)
-#define CACHE ((CACHE_Type*) CACHE_BASE)
-#define CHARGER ((CHARGER_Type*) CHARGER_BASE)
-#define CHIP_VERSION ((CHIP_VERSION_Type*) CHIP_VERSION_BASE)
-#define CRG_COM ((CRG_COM_Type*) CRG_COM_BASE)
-#define CRG_PER ((CRG_PER_Type*) CRG_PER_BASE)
-#define CRG_SYS ((CRG_SYS_Type*) CRG_SYS_BASE)
-#define CRG_TOP ((CRG_TOP_Type*) CRG_TOP_BASE)
-#define CRG_XTAL ((CRG_XTAL_Type*) CRG_XTAL_BASE)
-#define DCDC ((DCDC_Type*) DCDC_BASE)
-#define DMA ((DMA_Type*) DMA_BASE)
-#define DW ((DW_Type*) DW_BASE)
-#define GPADC ((GPADC_Type*) GPADC_BASE)
-#define GPIO ((GPIO_Type*) GPIO_BASE)
-#define GPREG ((GPREG_Type*) GPREG_BASE)
-#define I2C ((I2C_Type*) I2C_BASE)
-#define I2C2 ((I2C2_Type*) I2C2_BASE)
-#define LCDC ((LCDC_Type*) LCDC_BASE)
-#define LRA ((LRA_Type*) LRA_BASE)
-#define MEMCTRL ((MEMCTRL_Type*) MEMCTRL_BASE)
-#define OTPC ((OTPC_Type*) OTPC_BASE)
-#define PDC ((PDC_Type*) PDC_BASE)
-#define PWMLED ((PWMLED_Type*) PWMLED_BASE)
-#define QSPIC ((QSPIC_Type*) QSPIC_BASE)
-#define QSPIC2 ((QSPIC2_Type*) QSPIC2_BASE)
-#define RFMON ((RFMON_Type*) RFMON_BASE)
-#define RTC ((RTC_Type*) RTC_BASE)
-#define SDADC ((SDADC_Type*) SDADC_BASE)
-#define SMOTOR ((SMOTOR_Type*) SMOTOR_BASE)
-#define SNC ((SNC_Type*) SNC_BASE)
-#define SPI ((SPI_Type*) SPI_BASE)
-#define SPI2 ((SPI2_Type*) SPI2_BASE)
-#define SYS_WDOG ((SYS_WDOG_Type*) SYS_WDOG_BASE)
-#define TIMER ((TIMER_Type*) TIMER_BASE)
-#define TIMER2 ((TIMER2_Type*) TIMER2_BASE)
-#define TIMER3 ((TIMER3_Type*) TIMER3_BASE)
-#define TIMER4 ((TIMER4_Type*) TIMER4_BASE)
-#define TRNG ((TRNG_Type*) TRNG_BASE)
-#define UART ((UART_Type*) UART_BASE)
-#define UART2 ((UART2_Type*) UART2_BASE)
-#define UART3 ((UART3_Type*) UART3_BASE)
-#define USB ((USB_Type*) USB_BASE)
-#define WAKEUP ((WAKEUP_Type*) WAKEUP_BASE)
-
-
-/* =========================================================================================================================== */
-/* ================ Pos/Mask Peripheral Section ================ */
-/* =========================================================================================================================== */
-
-
-/** @addtogroup PosMask_peripherals
- * @{
- */
-
-
-
-/* =========================================================================================================================== */
-/* ================ AES_HASH ================ */
-/* =========================================================================================================================== */
-
-/* =================================================== CRYPTO_CLRIRQ_REG =================================================== */
-#define AES_HASH_CRYPTO_CLRIRQ_REG_CRYPTO_CLRIRQ_Pos (0UL) /*!< CRYPTO_CLRIRQ (Bit 0) */
-#define AES_HASH_CRYPTO_CLRIRQ_REG_CRYPTO_CLRIRQ_Msk (0x1UL) /*!< CRYPTO_CLRIRQ (Bitfield-Mask: 0x01) */
-/* ==================================================== CRYPTO_CTRL_REG ==================================================== */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_AES_KEXP_Pos (17UL) /*!< CRYPTO_AES_KEXP (Bit 17) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_AES_KEXP_Msk (0x20000UL) /*!< CRYPTO_AES_KEXP (Bitfield-Mask: 0x01) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_MORE_IN_Pos (16UL) /*!< CRYPTO_MORE_IN (Bit 16) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_MORE_IN_Msk (0x10000UL) /*!< CRYPTO_MORE_IN (Bitfield-Mask: 0x01) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_HASH_OUT_LEN_Pos (10UL) /*!< CRYPTO_HASH_OUT_LEN (Bit 10) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_HASH_OUT_LEN_Msk (0xfc00UL) /*!< CRYPTO_HASH_OUT_LEN (Bitfield-Mask: 0x3f) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_HASH_SEL_Pos (9UL) /*!< CRYPTO_HASH_SEL (Bit 9) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_HASH_SEL_Msk (0x200UL) /*!< CRYPTO_HASH_SEL (Bitfield-Mask: 0x01) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_IRQ_EN_Pos (8UL) /*!< CRYPTO_IRQ_EN (Bit 8) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_IRQ_EN_Msk (0x100UL) /*!< CRYPTO_IRQ_EN (Bitfield-Mask: 0x01) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_ENCDEC_Pos (7UL) /*!< CRYPTO_ENCDEC (Bit 7) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_ENCDEC_Msk (0x80UL) /*!< CRYPTO_ENCDEC (Bitfield-Mask: 0x01) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_AES_KEY_SZ_Pos (5UL) /*!< CRYPTO_AES_KEY_SZ (Bit 5) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_AES_KEY_SZ_Msk (0x60UL) /*!< CRYPTO_AES_KEY_SZ (Bitfield-Mask: 0x03) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_OUT_MD_Pos (4UL) /*!< CRYPTO_OUT_MD (Bit 4) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_OUT_MD_Msk (0x10UL) /*!< CRYPTO_OUT_MD (Bitfield-Mask: 0x01) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_ALG_MD_Pos (2UL) /*!< CRYPTO_ALG_MD (Bit 2) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_ALG_MD_Msk (0xcUL) /*!< CRYPTO_ALG_MD (Bitfield-Mask: 0x03) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_ALG_Pos (0UL) /*!< CRYPTO_ALG (Bit 0) */
-#define AES_HASH_CRYPTO_CTRL_REG_CRYPTO_ALG_Msk (0x3UL) /*!< CRYPTO_ALG (Bitfield-Mask: 0x03) */
-/* ================================================= CRYPTO_DEST_ADDR_REG ================================================== */
-#define AES_HASH_CRYPTO_DEST_ADDR_REG_CRYPTO_DEST_ADDR_Pos (0UL) /*!< CRYPTO_DEST_ADDR (Bit 0) */
-#define AES_HASH_CRYPTO_DEST_ADDR_REG_CRYPTO_DEST_ADDR_Msk (0xffffffffUL) /*!< CRYPTO_DEST_ADDR (Bitfield-Mask: 0xffffffff) */
-/* ================================================= CRYPTO_FETCH_ADDR_REG ================================================= */
-#define AES_HASH_CRYPTO_FETCH_ADDR_REG_CRYPTO_FETCH_ADDR_Pos (0UL) /*!< CRYPTO_FETCH_ADDR (Bit 0) */
-#define AES_HASH_CRYPTO_FETCH_ADDR_REG_CRYPTO_FETCH_ADDR_Msk (0xffffffffUL) /*!< CRYPTO_FETCH_ADDR (Bitfield-Mask: 0xffffffff) */
-/* =================================================== CRYPTO_KEYS_START =================================================== */
-#define AES_HASH_CRYPTO_KEYS_START_CRYPTO_KEY_X_Pos (0UL) /*!< CRYPTO_KEY_X (Bit 0) */
-#define AES_HASH_CRYPTO_KEYS_START_CRYPTO_KEY_X_Msk (0xffffffffUL) /*!< CRYPTO_KEY_X (Bitfield-Mask: 0xffffffff) */
-/* ==================================================== CRYPTO_LEN_REG ===================================================== */
-#define AES_HASH_CRYPTO_LEN_REG_CRYPTO_LEN_Pos (0UL) /*!< CRYPTO_LEN (Bit 0) */
-#define AES_HASH_CRYPTO_LEN_REG_CRYPTO_LEN_Msk (0xffffffUL) /*!< CRYPTO_LEN (Bitfield-Mask: 0xffffff) */
-/* =================================================== CRYPTO_MREG0_REG ==================================================== */
-#define AES_HASH_CRYPTO_MREG0_REG_CRYPTO_MREG0_Pos (0UL) /*!< CRYPTO_MREG0 (Bit 0) */
-#define AES_HASH_CRYPTO_MREG0_REG_CRYPTO_MREG0_Msk (0xffffffffUL) /*!< CRYPTO_MREG0 (Bitfield-Mask: 0xffffffff) */
-/* =================================================== CRYPTO_MREG1_REG ==================================================== */
-#define AES_HASH_CRYPTO_MREG1_REG_CRYPTO_MREG1_Pos (0UL) /*!< CRYPTO_MREG1 (Bit 0) */
-#define AES_HASH_CRYPTO_MREG1_REG_CRYPTO_MREG1_Msk (0xffffffffUL) /*!< CRYPTO_MREG1 (Bitfield-Mask: 0xffffffff) */
-/* =================================================== CRYPTO_MREG2_REG ==================================================== */
-#define AES_HASH_CRYPTO_MREG2_REG_CRYPTO_MREG2_Pos (0UL) /*!< CRYPTO_MREG2 (Bit 0) */
-#define AES_HASH_CRYPTO_MREG2_REG_CRYPTO_MREG2_Msk (0xffffffffUL) /*!< CRYPTO_MREG2 (Bitfield-Mask: 0xffffffff) */
-/* =================================================== CRYPTO_MREG3_REG ==================================================== */
-#define AES_HASH_CRYPTO_MREG3_REG_CRYPTO_MREG3_Pos (0UL) /*!< CRYPTO_MREG3 (Bit 0) */
-#define AES_HASH_CRYPTO_MREG3_REG_CRYPTO_MREG3_Msk (0xffffffffUL) /*!< CRYPTO_MREG3 (Bitfield-Mask: 0xffffffff) */
-/* =================================================== CRYPTO_START_REG ==================================================== */
-#define AES_HASH_CRYPTO_START_REG_CRYPTO_START_Pos (0UL) /*!< CRYPTO_START (Bit 0) */
-#define AES_HASH_CRYPTO_START_REG_CRYPTO_START_Msk (0x1UL) /*!< CRYPTO_START (Bitfield-Mask: 0x01) */
-/* =================================================== CRYPTO_STATUS_REG =================================================== */
-#define AES_HASH_CRYPTO_STATUS_REG_CRYPTO_IRQ_ST_Pos (2UL) /*!< CRYPTO_IRQ_ST (Bit 2) */
-#define AES_HASH_CRYPTO_STATUS_REG_CRYPTO_IRQ_ST_Msk (0x4UL) /*!< CRYPTO_IRQ_ST (Bitfield-Mask: 0x01) */
-#define AES_HASH_CRYPTO_STATUS_REG_CRYPTO_WAIT_FOR_IN_Pos (1UL) /*!< CRYPTO_WAIT_FOR_IN (Bit 1) */
-#define AES_HASH_CRYPTO_STATUS_REG_CRYPTO_WAIT_FOR_IN_Msk (0x2UL) /*!< CRYPTO_WAIT_FOR_IN (Bitfield-Mask: 0x01) */
-#define AES_HASH_CRYPTO_STATUS_REG_CRYPTO_INACTIVE_Pos (0UL) /*!< CRYPTO_INACTIVE (Bit 0) */
-#define AES_HASH_CRYPTO_STATUS_REG_CRYPTO_INACTIVE_Msk (0x1UL) /*!< CRYPTO_INACTIVE (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ ANAMISC_BIF ================ */
-/* =========================================================================================================================== */
-
-/* ==================================================== CLK_REF_CNT_REG ==================================================== */
-#define ANAMISC_BIF_CLK_REF_CNT_REG_REF_CNT_VAL_Pos (0UL) /*!< REF_CNT_VAL (Bit 0) */
-#define ANAMISC_BIF_CLK_REF_CNT_REG_REF_CNT_VAL_Msk (0xffffUL) /*!< REF_CNT_VAL (Bitfield-Mask: 0xffff) */
-/* ==================================================== CLK_REF_SEL_REG ==================================================== */
-#define ANAMISC_BIF_CLK_REF_SEL_REG_CAL_CLK_SEL_Pos (5UL) /*!< CAL_CLK_SEL (Bit 5) */
-#define ANAMISC_BIF_CLK_REF_SEL_REG_CAL_CLK_SEL_Msk (0xe0UL) /*!< CAL_CLK_SEL (Bitfield-Mask: 0x07) */
-#define ANAMISC_BIF_CLK_REF_SEL_REG_EXT_CNT_EN_SEL_Pos (4UL) /*!< EXT_CNT_EN_SEL (Bit 4) */
-#define ANAMISC_BIF_CLK_REF_SEL_REG_EXT_CNT_EN_SEL_Msk (0x10UL) /*!< EXT_CNT_EN_SEL (Bitfield-Mask: 0x01) */
-#define ANAMISC_BIF_CLK_REF_SEL_REG_REF_CAL_START_Pos (3UL) /*!< REF_CAL_START (Bit 3) */
-#define ANAMISC_BIF_CLK_REF_SEL_REG_REF_CAL_START_Msk (0x8UL) /*!< REF_CAL_START (Bitfield-Mask: 0x01) */
-#define ANAMISC_BIF_CLK_REF_SEL_REG_REF_CLK_SEL_Pos (0UL) /*!< REF_CLK_SEL (Bit 0) */
-#define ANAMISC_BIF_CLK_REF_SEL_REG_REF_CLK_SEL_Msk (0x7UL) /*!< REF_CLK_SEL (Bitfield-Mask: 0x07) */
-/* ==================================================== CLK_REF_VAL_REG ==================================================== */
-#define ANAMISC_BIF_CLK_REF_VAL_REG_XTAL_CNT_VAL_Pos (0UL) /*!< XTAL_CNT_VAL (Bit 0) */
-#define ANAMISC_BIF_CLK_REF_VAL_REG_XTAL_CNT_VAL_Msk (0xffffffffUL) /*!< XTAL_CNT_VAL (Bitfield-Mask: 0xffffffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ APU ================ */
-/* =========================================================================================================================== */
-
-/* ====================================================== APU_MUX_REG ====================================================== */
-#define APU_APU_MUX_REG_PDM1_MUX_IN_Pos (6UL) /*!< PDM1_MUX_IN (Bit 6) */
-#define APU_APU_MUX_REG_PDM1_MUX_IN_Msk (0x40UL) /*!< PDM1_MUX_IN (Bitfield-Mask: 0x01) */
-#define APU_APU_MUX_REG_PCM1_MUX_IN_Pos (3UL) /*!< PCM1_MUX_IN (Bit 3) */
-#define APU_APU_MUX_REG_PCM1_MUX_IN_Msk (0x38UL) /*!< PCM1_MUX_IN (Bitfield-Mask: 0x07) */
-#define APU_APU_MUX_REG_SRC1_MUX_IN_Pos (0UL) /*!< SRC1_MUX_IN (Bit 0) */
-#define APU_APU_MUX_REG_SRC1_MUX_IN_Msk (0x7UL) /*!< SRC1_MUX_IN (Bitfield-Mask: 0x07) */
-/* ==================================================== COEF0A_SET1_REG ==================================================== */
-#define APU_COEF0A_SET1_REG_SRC_COEF10_Pos (0UL) /*!< SRC_COEF10 (Bit 0) */
-#define APU_COEF0A_SET1_REG_SRC_COEF10_Msk (0xffffUL) /*!< SRC_COEF10 (Bitfield-Mask: 0xffff) */
-/* ==================================================== COEF10_SET1_REG ==================================================== */
-#define APU_COEF10_SET1_REG_SRC_COEF1_Pos (16UL) /*!< SRC_COEF1 (Bit 16) */
-#define APU_COEF10_SET1_REG_SRC_COEF1_Msk (0xffff0000UL) /*!< SRC_COEF1 (Bitfield-Mask: 0xffff) */
-#define APU_COEF10_SET1_REG_SRC_COEF0_Pos (0UL) /*!< SRC_COEF0 (Bit 0) */
-#define APU_COEF10_SET1_REG_SRC_COEF0_Msk (0xffffUL) /*!< SRC_COEF0 (Bitfield-Mask: 0xffff) */
-/* ==================================================== COEF32_SET1_REG ==================================================== */
-#define APU_COEF32_SET1_REG_SRC_COEF3_Pos (16UL) /*!< SRC_COEF3 (Bit 16) */
-#define APU_COEF32_SET1_REG_SRC_COEF3_Msk (0xffff0000UL) /*!< SRC_COEF3 (Bitfield-Mask: 0xffff) */
-#define APU_COEF32_SET1_REG_SRC_COEF2_Pos (0UL) /*!< SRC_COEF2 (Bit 0) */
-#define APU_COEF32_SET1_REG_SRC_COEF2_Msk (0xffffUL) /*!< SRC_COEF2 (Bitfield-Mask: 0xffff) */
-/* ==================================================== COEF54_SET1_REG ==================================================== */
-#define APU_COEF54_SET1_REG_SRC_COEF5_Pos (16UL) /*!< SRC_COEF5 (Bit 16) */
-#define APU_COEF54_SET1_REG_SRC_COEF5_Msk (0xffff0000UL) /*!< SRC_COEF5 (Bitfield-Mask: 0xffff) */
-#define APU_COEF54_SET1_REG_SRC_COEF4_Pos (0UL) /*!< SRC_COEF4 (Bit 0) */
-#define APU_COEF54_SET1_REG_SRC_COEF4_Msk (0xffffUL) /*!< SRC_COEF4 (Bitfield-Mask: 0xffff) */
-/* ==================================================== COEF76_SET1_REG ==================================================== */
-#define APU_COEF76_SET1_REG_SRC_COEF7_Pos (16UL) /*!< SRC_COEF7 (Bit 16) */
-#define APU_COEF76_SET1_REG_SRC_COEF7_Msk (0xffff0000UL) /*!< SRC_COEF7 (Bitfield-Mask: 0xffff) */
-#define APU_COEF76_SET1_REG_SRC_COEF6_Pos (0UL) /*!< SRC_COEF6 (Bit 0) */
-#define APU_COEF76_SET1_REG_SRC_COEF6_Msk (0xffffUL) /*!< SRC_COEF6 (Bitfield-Mask: 0xffff) */
-/* ==================================================== COEF98_SET1_REG ==================================================== */
-#define APU_COEF98_SET1_REG_SRC_COEF9_Pos (16UL) /*!< SRC_COEF9 (Bit 16) */
-#define APU_COEF98_SET1_REG_SRC_COEF9_Msk (0xffff0000UL) /*!< SRC_COEF9 (Bitfield-Mask: 0xffff) */
-#define APU_COEF98_SET1_REG_SRC_COEF8_Pos (0UL) /*!< SRC_COEF8 (Bit 0) */
-#define APU_COEF98_SET1_REG_SRC_COEF8_Msk (0xffffUL) /*!< SRC_COEF8 (Bitfield-Mask: 0xffff) */
-/* ===================================================== PCM1_CTRL_REG ===================================================== */
-#define APU_PCM1_CTRL_REG_PCM_FSC_DIV_Pos (20UL) /*!< PCM_FSC_DIV (Bit 20) */
-#define APU_PCM1_CTRL_REG_PCM_FSC_DIV_Msk (0xfff00000UL) /*!< PCM_FSC_DIV (Bitfield-Mask: 0xfff) */
-#define APU_PCM1_CTRL_REG_PCM_FSC_EDGE_Pos (16UL) /*!< PCM_FSC_EDGE (Bit 16) */
-#define APU_PCM1_CTRL_REG_PCM_FSC_EDGE_Msk (0x10000UL) /*!< PCM_FSC_EDGE (Bitfield-Mask: 0x01) */
-#define APU_PCM1_CTRL_REG_PCM_CH_DEL_Pos (11UL) /*!< PCM_CH_DEL (Bit 11) */
-#define APU_PCM1_CTRL_REG_PCM_CH_DEL_Msk (0xf800UL) /*!< PCM_CH_DEL (Bitfield-Mask: 0x1f) */
-#define APU_PCM1_CTRL_REG_PCM_CLK_BIT_Pos (10UL) /*!< PCM_CLK_BIT (Bit 10) */
-#define APU_PCM1_CTRL_REG_PCM_CLK_BIT_Msk (0x400UL) /*!< PCM_CLK_BIT (Bitfield-Mask: 0x01) */
-#define APU_PCM1_CTRL_REG_PCM_FSCINV_Pos (9UL) /*!< PCM_FSCINV (Bit 9) */
-#define APU_PCM1_CTRL_REG_PCM_FSCINV_Msk (0x200UL) /*!< PCM_FSCINV (Bitfield-Mask: 0x01) */
-#define APU_PCM1_CTRL_REG_PCM_CLKINV_Pos (8UL) /*!< PCM_CLKINV (Bit 8) */
-#define APU_PCM1_CTRL_REG_PCM_CLKINV_Msk (0x100UL) /*!< PCM_CLKINV (Bitfield-Mask: 0x01) */
-#define APU_PCM1_CTRL_REG_PCM_PPOD_Pos (7UL) /*!< PCM_PPOD (Bit 7) */
-#define APU_PCM1_CTRL_REG_PCM_PPOD_Msk (0x80UL) /*!< PCM_PPOD (Bitfield-Mask: 0x01) */
-#define APU_PCM1_CTRL_REG_PCM_FSCDEL_Pos (6UL) /*!< PCM_FSCDEL (Bit 6) */
-#define APU_PCM1_CTRL_REG_PCM_FSCDEL_Msk (0x40UL) /*!< PCM_FSCDEL (Bitfield-Mask: 0x01) */
-#define APU_PCM1_CTRL_REG_PCM_FSCLEN_Pos (2UL) /*!< PCM_FSCLEN (Bit 2) */
-#define APU_PCM1_CTRL_REG_PCM_FSCLEN_Msk (0x3cUL) /*!< PCM_FSCLEN (Bitfield-Mask: 0x0f) */
-#define APU_PCM1_CTRL_REG_PCM_MASTER_Pos (1UL) /*!< PCM_MASTER (Bit 1) */
-#define APU_PCM1_CTRL_REG_PCM_MASTER_Msk (0x2UL) /*!< PCM_MASTER (Bitfield-Mask: 0x01) */
-#define APU_PCM1_CTRL_REG_PCM_EN_Pos (0UL) /*!< PCM_EN (Bit 0) */
-#define APU_PCM1_CTRL_REG_PCM_EN_Msk (0x1UL) /*!< PCM_EN (Bitfield-Mask: 0x01) */
-/* ===================================================== PCM1_IN1_REG ====================================================== */
-#define APU_PCM1_IN1_REG_PCM_IN_Pos (0UL) /*!< PCM_IN (Bit 0) */
-#define APU_PCM1_IN1_REG_PCM_IN_Msk (0xffffffffUL) /*!< PCM_IN (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== PCM1_IN2_REG ====================================================== */
-#define APU_PCM1_IN2_REG_PCM_IN_Pos (0UL) /*!< PCM_IN (Bit 0) */
-#define APU_PCM1_IN2_REG_PCM_IN_Msk (0xffffffffUL) /*!< PCM_IN (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== PCM1_OUT1_REG ===================================================== */
-#define APU_PCM1_OUT1_REG_PCM_OUT_Pos (0UL) /*!< PCM_OUT (Bit 0) */
-#define APU_PCM1_OUT1_REG_PCM_OUT_Msk (0xffffffffUL) /*!< PCM_OUT (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== PCM1_OUT2_REG ===================================================== */
-#define APU_PCM1_OUT2_REG_PCM_OUT_Pos (0UL) /*!< PCM_OUT (Bit 0) */
-#define APU_PCM1_OUT2_REG_PCM_OUT_Msk (0xffffffffUL) /*!< PCM_OUT (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== SRC1_CTRL_REG ===================================================== */
-#define APU_SRC1_CTRL_REG_SRC_PDM_DO_DEL_Pos (30UL) /*!< SRC_PDM_DO_DEL (Bit 30) */
-#define APU_SRC1_CTRL_REG_SRC_PDM_DO_DEL_Msk (0xc0000000UL) /*!< SRC_PDM_DO_DEL (Bitfield-Mask: 0x03) */
-#define APU_SRC1_CTRL_REG_SRC_PDM_MODE_Pos (28UL) /*!< SRC_PDM_MODE (Bit 28) */
-#define APU_SRC1_CTRL_REG_SRC_PDM_MODE_Msk (0x30000000UL) /*!< SRC_PDM_MODE (Bitfield-Mask: 0x03) */
-#define APU_SRC1_CTRL_REG_SRC_PDM_DI_DEL_Pos (26UL) /*!< SRC_PDM_DI_DEL (Bit 26) */
-#define APU_SRC1_CTRL_REG_SRC_PDM_DI_DEL_Msk (0xc000000UL) /*!< SRC_PDM_DI_DEL (Bitfield-Mask: 0x03) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_FLOWCLR_Pos (25UL) /*!< SRC_OUT_FLOWCLR (Bit 25) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_FLOWCLR_Msk (0x2000000UL) /*!< SRC_OUT_FLOWCLR (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_IN_FLOWCLR_Pos (24UL) /*!< SRC_IN_FLOWCLR (Bit 24) */
-#define APU_SRC1_CTRL_REG_SRC_IN_FLOWCLR_Msk (0x1000000UL) /*!< SRC_IN_FLOWCLR (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_UNFLOW_Pos (23UL) /*!< SRC_OUT_UNFLOW (Bit 23) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_UNFLOW_Msk (0x800000UL) /*!< SRC_OUT_UNFLOW (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_OVFLOW_Pos (22UL) /*!< SRC_OUT_OVFLOW (Bit 22) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_OVFLOW_Msk (0x400000UL) /*!< SRC_OUT_OVFLOW (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_IN_UNFLOW_Pos (21UL) /*!< SRC_IN_UNFLOW (Bit 21) */
-#define APU_SRC1_CTRL_REG_SRC_IN_UNFLOW_Msk (0x200000UL) /*!< SRC_IN_UNFLOW (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_IN_OVFLOW_Pos (20UL) /*!< SRC_IN_OVFLOW (Bit 20) */
-#define APU_SRC1_CTRL_REG_SRC_IN_OVFLOW_Msk (0x100000UL) /*!< SRC_IN_OVFLOW (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_RESYNC_Pos (19UL) /*!< SRC_RESYNC (Bit 19) */
-#define APU_SRC1_CTRL_REG_SRC_RESYNC_Msk (0x80000UL) /*!< SRC_RESYNC (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_OK_Pos (18UL) /*!< SRC_OUT_OK (Bit 18) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_OK_Msk (0x40000UL) /*!< SRC_OUT_OK (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_US_Pos (16UL) /*!< SRC_OUT_US (Bit 16) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_US_Msk (0x30000UL) /*!< SRC_OUT_US (Bitfield-Mask: 0x03) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_CAL_BYPASS_Pos (14UL) /*!< SRC_OUT_CAL_BYPASS (Bit 14) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_CAL_BYPASS_Msk (0x4000UL) /*!< SRC_OUT_CAL_BYPASS (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_AMODE_Pos (13UL) /*!< SRC_OUT_AMODE (Bit 13) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_AMODE_Msk (0x2000UL) /*!< SRC_OUT_AMODE (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_PDM_OUT_INV_Pos (12UL) /*!< SRC_PDM_OUT_INV (Bit 12) */
-#define APU_SRC1_CTRL_REG_SRC_PDM_OUT_INV_Msk (0x1000UL) /*!< SRC_PDM_OUT_INV (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_FIFO_DIRECTION_Pos (11UL) /*!< SRC_FIFO_DIRECTION (Bit 11) */
-#define APU_SRC1_CTRL_REG_SRC_FIFO_DIRECTION_Msk (0x800UL) /*!< SRC_FIFO_DIRECTION (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_FIFO_ENABLE_Pos (10UL) /*!< SRC_FIFO_ENABLE (Bit 10) */
-#define APU_SRC1_CTRL_REG_SRC_FIFO_ENABLE_Msk (0x400UL) /*!< SRC_FIFO_ENABLE (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_DSD_MODE_Pos (9UL) /*!< SRC_OUT_DSD_MODE (Bit 9) */
-#define APU_SRC1_CTRL_REG_SRC_OUT_DSD_MODE_Msk (0x200UL) /*!< SRC_OUT_DSD_MODE (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_IN_DSD_MODE_Pos (8UL) /*!< SRC_IN_DSD_MODE (Bit 8) */
-#define APU_SRC1_CTRL_REG_SRC_IN_DSD_MODE_Msk (0x100UL) /*!< SRC_IN_DSD_MODE (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_DITHER_DISABLE_Pos (7UL) /*!< SRC_DITHER_DISABLE (Bit 7) */
-#define APU_SRC1_CTRL_REG_SRC_DITHER_DISABLE_Msk (0x80UL) /*!< SRC_DITHER_DISABLE (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_IN_OK_Pos (6UL) /*!< SRC_IN_OK (Bit 6) */
-#define APU_SRC1_CTRL_REG_SRC_IN_OK_Msk (0x40UL) /*!< SRC_IN_OK (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_IN_DS_Pos (4UL) /*!< SRC_IN_DS (Bit 4) */
-#define APU_SRC1_CTRL_REG_SRC_IN_DS_Msk (0x30UL) /*!< SRC_IN_DS (Bitfield-Mask: 0x03) */
-#define APU_SRC1_CTRL_REG_SRC_PDM_IN_INV_Pos (3UL) /*!< SRC_PDM_IN_INV (Bit 3) */
-#define APU_SRC1_CTRL_REG_SRC_PDM_IN_INV_Msk (0x8UL) /*!< SRC_PDM_IN_INV (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_IN_CAL_BYPASS_Pos (2UL) /*!< SRC_IN_CAL_BYPASS (Bit 2) */
-#define APU_SRC1_CTRL_REG_SRC_IN_CAL_BYPASS_Msk (0x4UL) /*!< SRC_IN_CAL_BYPASS (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_IN_AMODE_Pos (1UL) /*!< SRC_IN_AMODE (Bit 1) */
-#define APU_SRC1_CTRL_REG_SRC_IN_AMODE_Msk (0x2UL) /*!< SRC_IN_AMODE (Bitfield-Mask: 0x01) */
-#define APU_SRC1_CTRL_REG_SRC_EN_Pos (0UL) /*!< SRC_EN (Bit 0) */
-#define APU_SRC1_CTRL_REG_SRC_EN_Msk (0x1UL) /*!< SRC_EN (Bitfield-Mask: 0x01) */
-/* ===================================================== SRC1_IN1_REG ====================================================== */
-#define APU_SRC1_IN1_REG_SRC_IN_Pos (0UL) /*!< SRC_IN (Bit 0) */
-#define APU_SRC1_IN1_REG_SRC_IN_Msk (0xffffffffUL) /*!< SRC_IN (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== SRC1_IN2_REG ====================================================== */
-#define APU_SRC1_IN2_REG_SRC_IN_Pos (0UL) /*!< SRC_IN (Bit 0) */
-#define APU_SRC1_IN2_REG_SRC_IN_Msk (0xffffffffUL) /*!< SRC_IN (Bitfield-Mask: 0xffffffff) */
-/* ==================================================== SRC1_IN_FS_REG ===================================================== */
-#define APU_SRC1_IN_FS_REG_SRC_IN_FS_Pos (0UL) /*!< SRC_IN_FS (Bit 0) */
-#define APU_SRC1_IN_FS_REG_SRC_IN_FS_Msk (0xffffffUL) /*!< SRC_IN_FS (Bitfield-Mask: 0xffffff) */
-/* ===================================================== SRC1_OUT1_REG ===================================================== */
-#define APU_SRC1_OUT1_REG_SRC_OUT_Pos (0UL) /*!< SRC_OUT (Bit 0) */
-#define APU_SRC1_OUT1_REG_SRC_OUT_Msk (0xffffffffUL) /*!< SRC_OUT (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== SRC1_OUT2_REG ===================================================== */
-#define APU_SRC1_OUT2_REG_SRC_OUT_Pos (0UL) /*!< SRC_OUT (Bit 0) */
-#define APU_SRC1_OUT2_REG_SRC_OUT_Msk (0xffffffffUL) /*!< SRC_OUT (Bitfield-Mask: 0xffffffff) */
-/* ==================================================== SRC1_OUT_FS_REG ==================================================== */
-#define APU_SRC1_OUT_FS_REG_SRC_OUT_FS_Pos (0UL) /*!< SRC_OUT_FS (Bit 0) */
-#define APU_SRC1_OUT_FS_REG_SRC_OUT_FS_Msk (0xffffffUL) /*!< SRC_OUT_FS (Bitfield-Mask: 0xffffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ CACHE ================ */
-/* =========================================================================================================================== */
-
-/* ================================================== CACHE_ASSOCCFG_REG =================================================== */
-#define CACHE_CACHE_ASSOCCFG_REG_CACHE_ASSOC_Pos (0UL) /*!< CACHE_ASSOC (Bit 0) */
-#define CACHE_CACHE_ASSOCCFG_REG_CACHE_ASSOC_Msk (0x3UL) /*!< CACHE_ASSOC (Bitfield-Mask: 0x03) */
-/* ==================================================== CACHE_CTRL1_REG ==================================================== */
-#define CACHE_CACHE_CTRL1_REG_CACHE_RES1_Pos (1UL) /*!< CACHE_RES1 (Bit 1) */
-#define CACHE_CACHE_CTRL1_REG_CACHE_RES1_Msk (0x2UL) /*!< CACHE_RES1 (Bitfield-Mask: 0x01) */
-#define CACHE_CACHE_CTRL1_REG_CACHE_FLUSH_Pos (0UL) /*!< CACHE_FLUSH (Bit 0) */
-#define CACHE_CACHE_CTRL1_REG_CACHE_FLUSH_Msk (0x1UL) /*!< CACHE_FLUSH (Bitfield-Mask: 0x01) */
-/* ==================================================== CACHE_CTRL2_REG ==================================================== */
-#define CACHE_CACHE_CTRL2_REG_CACHE_CGEN_Pos (10UL) /*!< CACHE_CGEN (Bit 10) */
-#define CACHE_CACHE_CTRL2_REG_CACHE_CGEN_Msk (0x400UL) /*!< CACHE_CGEN (Bitfield-Mask: 0x01) */
-#define CACHE_CACHE_CTRL2_REG_CACHE_WEN_Pos (9UL) /*!< CACHE_WEN (Bit 9) */
-#define CACHE_CACHE_CTRL2_REG_CACHE_WEN_Msk (0x200UL) /*!< CACHE_WEN (Bitfield-Mask: 0x01) */
-#define CACHE_CACHE_CTRL2_REG_CACHE_LEN_Pos (0UL) /*!< CACHE_LEN (Bit 0) */
-#define CACHE_CACHE_CTRL2_REG_CACHE_LEN_Msk (0x1ffUL) /*!< CACHE_LEN (Bitfield-Mask: 0x1ff) */
-/* ==================================================== CACHE_FLASH_REG ==================================================== */
-#define CACHE_CACHE_FLASH_REG_FLASH_REGION_BASE_Pos (16UL) /*!< FLASH_REGION_BASE (Bit 16) */
-#define CACHE_CACHE_FLASH_REG_FLASH_REGION_BASE_Msk (0xffff0000UL) /*!< FLASH_REGION_BASE (Bitfield-Mask: 0xffff) */
-#define CACHE_CACHE_FLASH_REG_FLASH_REGION_OFFSET_Pos (4UL) /*!< FLASH_REGION_OFFSET (Bit 4) */
-#define CACHE_CACHE_FLASH_REG_FLASH_REGION_OFFSET_Msk (0xfff0UL) /*!< FLASH_REGION_OFFSET (Bitfield-Mask: 0xfff) */
-#define CACHE_CACHE_FLASH_REG_FLASH_REGION_SIZE_Pos (0UL) /*!< FLASH_REGION_SIZE (Bit 0) */
-#define CACHE_CACHE_FLASH_REG_FLASH_REGION_SIZE_Msk (0x7UL) /*!< FLASH_REGION_SIZE (Bitfield-Mask: 0x07) */
-/* ================================================== CACHE_LNSIZECFG_REG ================================================== */
-#define CACHE_CACHE_LNSIZECFG_REG_CACHE_LINE_Pos (0UL) /*!< CACHE_LINE (Bit 0) */
-#define CACHE_CACHE_LNSIZECFG_REG_CACHE_LINE_Msk (0x3UL) /*!< CACHE_LINE (Bitfield-Mask: 0x03) */
-/* ================================================== CACHE_MRM_CTRL_REG =================================================== */
-#define CACHE_CACHE_MRM_CTRL_REG_MRM_IRQ_HITS_THRES_STATUS_Pos (4UL) /*!< MRM_IRQ_HITS_THRES_STATUS (Bit 4) */
-#define CACHE_CACHE_MRM_CTRL_REG_MRM_IRQ_HITS_THRES_STATUS_Msk (0x10UL) /*!< MRM_IRQ_HITS_THRES_STATUS (Bitfield-Mask: 0x01) */
-#define CACHE_CACHE_MRM_CTRL_REG_MRM_IRQ_MISSES_THRES_STATUS_Pos (3UL) /*!< MRM_IRQ_MISSES_THRES_STATUS (Bit 3) */
-#define CACHE_CACHE_MRM_CTRL_REG_MRM_IRQ_MISSES_THRES_STATUS_Msk (0x8UL) /*!< MRM_IRQ_MISSES_THRES_STATUS (Bitfield-Mask: 0x01) */
-#define CACHE_CACHE_MRM_CTRL_REG_MRM_IRQ_TINT_STATUS_Pos (2UL) /*!< MRM_IRQ_TINT_STATUS (Bit 2) */
-#define CACHE_CACHE_MRM_CTRL_REG_MRM_IRQ_TINT_STATUS_Msk (0x4UL) /*!< MRM_IRQ_TINT_STATUS (Bitfield-Mask: 0x01) */
-#define CACHE_CACHE_MRM_CTRL_REG_MRM_IRQ_MASK_Pos (1UL) /*!< MRM_IRQ_MASK (Bit 1) */
-#define CACHE_CACHE_MRM_CTRL_REG_MRM_IRQ_MASK_Msk (0x2UL) /*!< MRM_IRQ_MASK (Bitfield-Mask: 0x01) */
-#define CACHE_CACHE_MRM_CTRL_REG_MRM_START_Pos (0UL) /*!< MRM_START (Bit 0) */
-#define CACHE_CACHE_MRM_CTRL_REG_MRM_START_Msk (0x1UL) /*!< MRM_START (Bitfield-Mask: 0x01) */
-/* ================================================== CACHE_MRM_HITS_REG =================================================== */
-#define CACHE_CACHE_MRM_HITS_REG_MRM_HITS_Pos (0UL) /*!< MRM_HITS (Bit 0) */
-#define CACHE_CACHE_MRM_HITS_REG_MRM_HITS_Msk (0xffffffffUL) /*!< MRM_HITS (Bitfield-Mask: 0xffffffff) */
-/* =============================================== CACHE_MRM_HITS_THRES_REG ================================================ */
-#define CACHE_CACHE_MRM_HITS_THRES_REG_MRM_HITS_THRES_Pos (0UL) /*!< MRM_HITS_THRES (Bit 0) */
-#define CACHE_CACHE_MRM_HITS_THRES_REG_MRM_HITS_THRES_Msk (0xffffffffUL) /*!< MRM_HITS_THRES (Bitfield-Mask: 0xffffffff) */
-/* ================================================= CACHE_MRM_MISSES_REG ================================================== */
-#define CACHE_CACHE_MRM_MISSES_REG_MRM_MISSES_Pos (0UL) /*!< MRM_MISSES (Bit 0) */
-#define CACHE_CACHE_MRM_MISSES_REG_MRM_MISSES_Msk (0xffffffffUL) /*!< MRM_MISSES (Bitfield-Mask: 0xffffffff) */
-/* ============================================== CACHE_MRM_MISSES_THRES_REG =============================================== */
-#define CACHE_CACHE_MRM_MISSES_THRES_REG_MRM_MISSES_THRES_Pos (0UL) /*!< MRM_MISSES_THRES (Bit 0) */
-#define CACHE_CACHE_MRM_MISSES_THRES_REG_MRM_MISSES_THRES_Msk (0xffffffffUL) /*!< MRM_MISSES_THRES (Bitfield-Mask: 0xffffffff) */
-/* ================================================== CACHE_MRM_TINT_REG =================================================== */
-#define CACHE_CACHE_MRM_TINT_REG_MRM_TINT_Pos (0UL) /*!< MRM_TINT (Bit 0) */
-#define CACHE_CACHE_MRM_TINT_REG_MRM_TINT_Msk (0x7ffffUL) /*!< MRM_TINT (Bitfield-Mask: 0x7ffff) */
-/* ===================================================== SWD_RESET_REG ===================================================== */
-#define CACHE_SWD_RESET_REG_SWD_HW_RESET_REQ_Pos (0UL) /*!< SWD_HW_RESET_REQ (Bit 0) */
-#define CACHE_SWD_RESET_REG_SWD_HW_RESET_REQ_Msk (0x1UL) /*!< SWD_HW_RESET_REQ (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ CHARGER ================ */
-/* =========================================================================================================================== */
-
-/* ============================================== CHARGER_CC_CHARGE_TIMER_REG ============================================== */
-#define CHARGER_CHARGER_CC_CHARGE_TIMER_REG_CC_CHARGE_TIMER_Pos (16UL) /*!< CC_CHARGE_TIMER (Bit 16) */
-#define CHARGER_CHARGER_CC_CHARGE_TIMER_REG_CC_CHARGE_TIMER_Msk (0x7fff0000UL) /*!< CC_CHARGE_TIMER (Bitfield-Mask: 0x7fff) */
-#define CHARGER_CHARGER_CC_CHARGE_TIMER_REG_MAX_CC_CHARGE_TIME_Pos (0UL) /*!< MAX_CC_CHARGE_TIME (Bit 0) */
-#define CHARGER_CHARGER_CC_CHARGE_TIMER_REG_MAX_CC_CHARGE_TIME_Msk (0x7fffUL) /*!< MAX_CC_CHARGE_TIME (Bitfield-Mask: 0x7fff) */
-/* =================================================== CHARGER_CTRL_REG ==================================================== */
-#define CHARGER_CHARGER_CTRL_REG_EOC_INTERVAL_CHECK_TIMER_Pos (22UL) /*!< EOC_INTERVAL_CHECK_TIMER (Bit 22) */
-#define CHARGER_CHARGER_CTRL_REG_EOC_INTERVAL_CHECK_TIMER_Msk (0xfc00000UL) /*!< EOC_INTERVAL_CHECK_TIMER (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_CTRL_REG_EOC_INTERVAL_CHECK_THRES_Pos (16UL) /*!< EOC_INTERVAL_CHECK_THRES (Bit 16) */
-#define CHARGER_CHARGER_CTRL_REG_EOC_INTERVAL_CHECK_THRES_Msk (0x3f0000UL) /*!< EOC_INTERVAL_CHECK_THRES (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_CTRL_REG_REPLENISH_MODE_Pos (15UL) /*!< REPLENISH_MODE (Bit 15) */
-#define CHARGER_CHARGER_CTRL_REG_REPLENISH_MODE_Msk (0x8000UL) /*!< REPLENISH_MODE (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CTRL_REG_PRE_CHARGE_MODE_Pos (14UL) /*!< PRE_CHARGE_MODE (Bit 14) */
-#define CHARGER_CHARGER_CTRL_REG_PRE_CHARGE_MODE_Msk (0x4000UL) /*!< PRE_CHARGE_MODE (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CTRL_REG_CHARGE_LOOP_HOLD_Pos (13UL) /*!< CHARGE_LOOP_HOLD (Bit 13) */
-#define CHARGER_CHARGER_CTRL_REG_CHARGE_LOOP_HOLD_Msk (0x2000UL) /*!< CHARGE_LOOP_HOLD (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CTRL_REG_JEITA_SUPPORT_DISABLED_Pos (12UL) /*!< JEITA_SUPPORT_DISABLED (Bit 12) */
-#define CHARGER_CHARGER_CTRL_REG_JEITA_SUPPORT_DISABLED_Msk (0x1000UL) /*!< JEITA_SUPPORT_DISABLED (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CTRL_REG_TBAT_MONITOR_MODE_Pos (10UL) /*!< TBAT_MONITOR_MODE (Bit 10) */
-#define CHARGER_CHARGER_CTRL_REG_TBAT_MONITOR_MODE_Msk (0xc00UL) /*!< TBAT_MONITOR_MODE (Bitfield-Mask: 0x03) */
-#define CHARGER_CHARGER_CTRL_REG_CHARGE_TIMERS_HALT_ENABLE_Pos (9UL) /*!< CHARGE_TIMERS_HALT_ENABLE (Bit 9) */
-#define CHARGER_CHARGER_CTRL_REG_CHARGE_TIMERS_HALT_ENABLE_Msk (0x200UL) /*!< CHARGE_TIMERS_HALT_ENABLE (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CTRL_REG_NTC_LOW_DISABLE_Pos (7UL) /*!< NTC_LOW_DISABLE (Bit 7) */
-#define CHARGER_CHARGER_CTRL_REG_NTC_LOW_DISABLE_Msk (0x80UL) /*!< NTC_LOW_DISABLE (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CTRL_REG_TBAT_PROT_ENABLE_Pos (6UL) /*!< TBAT_PROT_ENABLE (Bit 6) */
-#define CHARGER_CHARGER_CTRL_REG_TBAT_PROT_ENABLE_Msk (0x40UL) /*!< TBAT_PROT_ENABLE (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CTRL_REG_TDIE_ERROR_RESUME_Pos (5UL) /*!< TDIE_ERROR_RESUME (Bit 5) */
-#define CHARGER_CHARGER_CTRL_REG_TDIE_ERROR_RESUME_Msk (0x20UL) /*!< TDIE_ERROR_RESUME (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CTRL_REG_TDIE_PROT_ENABLE_Pos (4UL) /*!< TDIE_PROT_ENABLE (Bit 4) */
-#define CHARGER_CHARGER_CTRL_REG_TDIE_PROT_ENABLE_Msk (0x10UL) /*!< TDIE_PROT_ENABLE (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CTRL_REG_CHARGER_RESUME_Pos (3UL) /*!< CHARGER_RESUME (Bit 3) */
-#define CHARGER_CHARGER_CTRL_REG_CHARGER_RESUME_Msk (0x8UL) /*!< CHARGER_RESUME (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CTRL_REG_CHARGER_BYPASS_Pos (2UL) /*!< CHARGER_BYPASS (Bit 2) */
-#define CHARGER_CHARGER_CTRL_REG_CHARGER_BYPASS_Msk (0x4UL) /*!< CHARGER_BYPASS (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CTRL_REG_CHARGE_START_Pos (1UL) /*!< CHARGE_START (Bit 1) */
-#define CHARGER_CHARGER_CTRL_REG_CHARGE_START_Msk (0x2UL) /*!< CHARGE_START (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CTRL_REG_CHARGER_ENABLE_Pos (0UL) /*!< CHARGER_ENABLE (Bit 0) */
-#define CHARGER_CHARGER_CTRL_REG_CHARGER_ENABLE_Msk (0x1UL) /*!< CHARGER_ENABLE (Bitfield-Mask: 0x01) */
-/* =============================================== CHARGER_CURRENT_PARAM_REG =============================================== */
-#define CHARGER_CHARGER_CURRENT_PARAM_REG_I_EOC_DOUBLE_RANGE_Pos (15UL) /*!< I_EOC_DOUBLE_RANGE (Bit 15) */
-#define CHARGER_CHARGER_CURRENT_PARAM_REG_I_EOC_DOUBLE_RANGE_Msk (0x8000UL) /*!< I_EOC_DOUBLE_RANGE (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_CURRENT_PARAM_REG_I_END_OF_CHARGE_Pos (12UL) /*!< I_END_OF_CHARGE (Bit 12) */
-#define CHARGER_CHARGER_CURRENT_PARAM_REG_I_END_OF_CHARGE_Msk (0x7000UL) /*!< I_END_OF_CHARGE (Bitfield-Mask: 0x07) */
-#define CHARGER_CHARGER_CURRENT_PARAM_REG_I_PRECHARGE_Pos (6UL) /*!< I_PRECHARGE (Bit 6) */
-#define CHARGER_CHARGER_CURRENT_PARAM_REG_I_PRECHARGE_Msk (0xfc0UL) /*!< I_PRECHARGE (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_CURRENT_PARAM_REG_I_CHARGE_Pos (0UL) /*!< I_CHARGE (Bit 0) */
-#define CHARGER_CHARGER_CURRENT_PARAM_REG_I_CHARGE_Msk (0x3fUL) /*!< I_CHARGE (Bitfield-Mask: 0x3f) */
-/* ============================================== CHARGER_CV_CHARGE_TIMER_REG ============================================== */
-#define CHARGER_CHARGER_CV_CHARGE_TIMER_REG_CV_CHARGE_TIMER_Pos (16UL) /*!< CV_CHARGE_TIMER (Bit 16) */
-#define CHARGER_CHARGER_CV_CHARGE_TIMER_REG_CV_CHARGE_TIMER_Msk (0x7fff0000UL) /*!< CV_CHARGE_TIMER (Bitfield-Mask: 0x7fff) */
-#define CHARGER_CHARGER_CV_CHARGE_TIMER_REG_MAX_CV_CHARGE_TIME_Pos (0UL) /*!< MAX_CV_CHARGE_TIME (Bit 0) */
-#define CHARGER_CHARGER_CV_CHARGE_TIMER_REG_MAX_CV_CHARGE_TIME_Msk (0x7fffUL) /*!< MAX_CV_CHARGE_TIME (Bitfield-Mask: 0x7fff) */
-/* =============================================== CHARGER_ERROR_IRQ_CLR_REG =============================================== */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_TBAT_ERROR_IRQ_CLR_Pos (6UL) /*!< TBAT_ERROR_IRQ_CLR (Bit 6) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_TBAT_ERROR_IRQ_CLR_Msk (0x40UL) /*!< TBAT_ERROR_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_TDIE_ERROR_IRQ_CLR_Pos (5UL) /*!< TDIE_ERROR_IRQ_CLR (Bit 5) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_TDIE_ERROR_IRQ_CLR_Msk (0x20UL) /*!< TDIE_ERROR_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_VBAT_OVP_ERROR_IRQ_CLR_Pos (4UL) /*!< VBAT_OVP_ERROR_IRQ_CLR (Bit 4) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_VBAT_OVP_ERROR_IRQ_CLR_Msk (0x10UL) /*!< VBAT_OVP_ERROR_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_TOTAL_CHARGE_TIMEOUT_IRQ_CLR_Pos (3UL) /*!< TOTAL_CHARGE_TIMEOUT_IRQ_CLR (Bit 3) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_TOTAL_CHARGE_TIMEOUT_IRQ_CLR_Msk (0x8UL) /*!< TOTAL_CHARGE_TIMEOUT_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_CV_CHARGE_TIMEOUT_IRQ_CLR_Pos (2UL) /*!< CV_CHARGE_TIMEOUT_IRQ_CLR (Bit 2) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_CV_CHARGE_TIMEOUT_IRQ_CLR_Msk (0x4UL) /*!< CV_CHARGE_TIMEOUT_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_CC_CHARGE_TIMEOUT_IRQ_CLR_Pos (1UL) /*!< CC_CHARGE_TIMEOUT_IRQ_CLR (Bit 1) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_CC_CHARGE_TIMEOUT_IRQ_CLR_Msk (0x2UL) /*!< CC_CHARGE_TIMEOUT_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_PRECHARGE_TIMEOUT_IRQ_CLR_Pos (0UL) /*!< PRECHARGE_TIMEOUT_IRQ_CLR (Bit 0) */
-#define CHARGER_CHARGER_ERROR_IRQ_CLR_REG_PRECHARGE_TIMEOUT_IRQ_CLR_Msk (0x1UL) /*!< PRECHARGE_TIMEOUT_IRQ_CLR (Bitfield-Mask: 0x01) */
-/* ============================================== CHARGER_ERROR_IRQ_MASK_REG =============================================== */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_TBAT_ERROR_IRQ_EN_Pos (6UL) /*!< TBAT_ERROR_IRQ_EN (Bit 6) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_TBAT_ERROR_IRQ_EN_Msk (0x40UL) /*!< TBAT_ERROR_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_TDIE_ERROR_IRQ_EN_Pos (5UL) /*!< TDIE_ERROR_IRQ_EN (Bit 5) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_TDIE_ERROR_IRQ_EN_Msk (0x20UL) /*!< TDIE_ERROR_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_VBAT_OVP_ERROR_IRQ_EN_Pos (4UL) /*!< VBAT_OVP_ERROR_IRQ_EN (Bit 4) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_VBAT_OVP_ERROR_IRQ_EN_Msk (0x10UL) /*!< VBAT_OVP_ERROR_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_TOTAL_CHARGE_TIMEOUT_IRQ_EN_Pos (3UL) /*!< TOTAL_CHARGE_TIMEOUT_IRQ_EN (Bit 3) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_TOTAL_CHARGE_TIMEOUT_IRQ_EN_Msk (0x8UL) /*!< TOTAL_CHARGE_TIMEOUT_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_CV_CHARGE_TIMEOUT_IRQ_EN_Pos (2UL) /*!< CV_CHARGE_TIMEOUT_IRQ_EN (Bit 2) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_CV_CHARGE_TIMEOUT_IRQ_EN_Msk (0x4UL) /*!< CV_CHARGE_TIMEOUT_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_CC_CHARGE_TIMEOUT_IRQ_EN_Pos (1UL) /*!< CC_CHARGE_TIMEOUT_IRQ_EN (Bit 1) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_CC_CHARGE_TIMEOUT_IRQ_EN_Msk (0x2UL) /*!< CC_CHARGE_TIMEOUT_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_PRECHARGE_TIMEOUT_IRQ_EN_Pos (0UL) /*!< PRECHARGE_TIMEOUT_IRQ_EN (Bit 0) */
-#define CHARGER_CHARGER_ERROR_IRQ_MASK_REG_PRECHARGE_TIMEOUT_IRQ_EN_Msk (0x1UL) /*!< PRECHARGE_TIMEOUT_IRQ_EN (Bitfield-Mask: 0x01) */
-/* ============================================= CHARGER_ERROR_IRQ_STATUS_REG ============================================== */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_TBAT_ERROR_IRQ_Pos (6UL) /*!< TBAT_ERROR_IRQ (Bit 6) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_TBAT_ERROR_IRQ_Msk (0x40UL) /*!< TBAT_ERROR_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_TDIE_ERROR_IRQ_Pos (5UL) /*!< TDIE_ERROR_IRQ (Bit 5) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_TDIE_ERROR_IRQ_Msk (0x20UL) /*!< TDIE_ERROR_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_VBAT_OVP_ERROR_IRQ_Pos (4UL) /*!< VBAT_OVP_ERROR_IRQ (Bit 4) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_VBAT_OVP_ERROR_IRQ_Msk (0x10UL) /*!< VBAT_OVP_ERROR_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_TOTAL_CHARGE_TIMEOUT_IRQ_Pos (3UL) /*!< TOTAL_CHARGE_TIMEOUT_IRQ (Bit 3) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_TOTAL_CHARGE_TIMEOUT_IRQ_Msk (0x8UL) /*!< TOTAL_CHARGE_TIMEOUT_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_CV_CHARGE_TIMEOUT_IRQ_Pos (2UL) /*!< CV_CHARGE_TIMEOUT_IRQ (Bit 2) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_CV_CHARGE_TIMEOUT_IRQ_Msk (0x4UL) /*!< CV_CHARGE_TIMEOUT_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_CC_CHARGE_TIMEOUT_IRQ_Pos (1UL) /*!< CC_CHARGE_TIMEOUT_IRQ (Bit 1) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_CC_CHARGE_TIMEOUT_IRQ_Msk (0x2UL) /*!< CC_CHARGE_TIMEOUT_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_PRECHARGE_TIMEOUT_IRQ_Pos (0UL) /*!< PRECHARGE_TIMEOUT_IRQ (Bit 0) */
-#define CHARGER_CHARGER_ERROR_IRQ_STATUS_REG_PRECHARGE_TIMEOUT_IRQ_Msk (0x1UL) /*!< PRECHARGE_TIMEOUT_IRQ (Bitfield-Mask: 0x01) */
-/* =============================================== CHARGER_JEITA_CURRENT_REG =============================================== */
-#define CHARGER_CHARGER_JEITA_CURRENT_REG_I_PRECHARGE_TWARM_Pos (18UL) /*!< I_PRECHARGE_TWARM (Bit 18) */
-#define CHARGER_CHARGER_JEITA_CURRENT_REG_I_PRECHARGE_TWARM_Msk (0xfc0000UL) /*!< I_PRECHARGE_TWARM (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_JEITA_CURRENT_REG_I_PRECHARGE_TCOOL_Pos (12UL) /*!< I_PRECHARGE_TCOOL (Bit 12) */
-#define CHARGER_CHARGER_JEITA_CURRENT_REG_I_PRECHARGE_TCOOL_Msk (0x3f000UL) /*!< I_PRECHARGE_TCOOL (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_JEITA_CURRENT_REG_I_CHARGE_TWARM_Pos (6UL) /*!< I_CHARGE_TWARM (Bit 6) */
-#define CHARGER_CHARGER_JEITA_CURRENT_REG_I_CHARGE_TWARM_Msk (0xfc0UL) /*!< I_CHARGE_TWARM (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_JEITA_CURRENT_REG_I_CHARGE_TCOOL_Pos (0UL) /*!< I_CHARGE_TCOOL (Bit 0) */
-#define CHARGER_CHARGER_JEITA_CURRENT_REG_I_CHARGE_TCOOL_Msk (0x3fUL) /*!< I_CHARGE_TCOOL (Bitfield-Mask: 0x3f) */
-/* ============================================== CHARGER_JEITA_V_CHARGE_REG =============================================== */
-#define CHARGER_CHARGER_JEITA_V_CHARGE_REG_V_CHARGE_TWARM_Pos (6UL) /*!< V_CHARGE_TWARM (Bit 6) */
-#define CHARGER_CHARGER_JEITA_V_CHARGE_REG_V_CHARGE_TWARM_Msk (0xfc0UL) /*!< V_CHARGE_TWARM (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_JEITA_V_CHARGE_REG_V_CHARGE_TCOOL_Pos (0UL) /*!< V_CHARGE_TCOOL (Bit 0) */
-#define CHARGER_CHARGER_JEITA_V_CHARGE_REG_V_CHARGE_TCOOL_Msk (0x3fUL) /*!< V_CHARGE_TCOOL (Bitfield-Mask: 0x3f) */
-/* ================================================ CHARGER_JEITA_V_OVP_REG ================================================ */
-#define CHARGER_CHARGER_JEITA_V_OVP_REG_V_OVP_TWARM_Pos (6UL) /*!< V_OVP_TWARM (Bit 6) */
-#define CHARGER_CHARGER_JEITA_V_OVP_REG_V_OVP_TWARM_Msk (0xfc0UL) /*!< V_OVP_TWARM (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_JEITA_V_OVP_REG_V_OVP_TCOOL_Pos (0UL) /*!< V_OVP_TCOOL (Bit 0) */
-#define CHARGER_CHARGER_JEITA_V_OVP_REG_V_OVP_TCOOL_Msk (0x3fUL) /*!< V_OVP_TCOOL (Bitfield-Mask: 0x3f) */
-/* ============================================= CHARGER_JEITA_V_PRECHARGE_REG ============================================= */
-#define CHARGER_CHARGER_JEITA_V_PRECHARGE_REG_V_PRECHARGE_TWARM_Pos (6UL) /*!< V_PRECHARGE_TWARM (Bit 6) */
-#define CHARGER_CHARGER_JEITA_V_PRECHARGE_REG_V_PRECHARGE_TWARM_Msk (0xfc0UL) /*!< V_PRECHARGE_TWARM (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_JEITA_V_PRECHARGE_REG_V_PRECHARGE_TCOOL_Pos (0UL) /*!< V_PRECHARGE_TCOOL (Bit 0) */
-#define CHARGER_CHARGER_JEITA_V_PRECHARGE_REG_V_PRECHARGE_TCOOL_Msk (0x3fUL) /*!< V_PRECHARGE_TCOOL (Bitfield-Mask: 0x3f) */
-/* ============================================= CHARGER_JEITA_V_REPLENISH_REG ============================================= */
-#define CHARGER_CHARGER_JEITA_V_REPLENISH_REG_V_REPLENISH_TWARM_Pos (6UL) /*!< V_REPLENISH_TWARM (Bit 6) */
-#define CHARGER_CHARGER_JEITA_V_REPLENISH_REG_V_REPLENISH_TWARM_Msk (0xfc0UL) /*!< V_REPLENISH_TWARM (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_JEITA_V_REPLENISH_REG_V_REPLENISH_TCOOL_Pos (0UL) /*!< V_REPLENISH_TCOOL (Bit 0) */
-#define CHARGER_CHARGER_JEITA_V_REPLENISH_REG_V_REPLENISH_TCOOL_Msk (0x3fUL) /*!< V_REPLENISH_TCOOL (Bitfield-Mask: 0x3f) */
-/* ============================================= CHARGER_PRE_CHARGE_TIMER_REG ============================================== */
-#define CHARGER_CHARGER_PRE_CHARGE_TIMER_REG_PRE_CHARGE_TIMER_Pos (16UL) /*!< PRE_CHARGE_TIMER (Bit 16) */
-#define CHARGER_CHARGER_PRE_CHARGE_TIMER_REG_PRE_CHARGE_TIMER_Msk (0x7fff0000UL) /*!< PRE_CHARGE_TIMER (Bitfield-Mask: 0x7fff) */
-#define CHARGER_CHARGER_PRE_CHARGE_TIMER_REG_MAX_PRE_CHARGE_TIME_Pos (0UL) /*!< MAX_PRE_CHARGE_TIME (Bit 0) */
-#define CHARGER_CHARGER_PRE_CHARGE_TIMER_REG_MAX_PRE_CHARGE_TIME_Msk (0x7fffUL) /*!< MAX_PRE_CHARGE_TIME (Bitfield-Mask: 0x7fff) */
-/* =============================================== CHARGER_PWR_UP_TIMER_REG ================================================ */
-#define CHARGER_CHARGER_PWR_UP_TIMER_REG_CHARGER_PWR_UP_TIMER_Pos (16UL) /*!< CHARGER_PWR_UP_TIMER (Bit 16) */
-#define CHARGER_CHARGER_PWR_UP_TIMER_REG_CHARGER_PWR_UP_TIMER_Msk (0x3ff0000UL) /*!< CHARGER_PWR_UP_TIMER (Bitfield-Mask: 0x3ff) */
-#define CHARGER_CHARGER_PWR_UP_TIMER_REG_CHARGER_PWR_UP_SETTLING_Pos (0UL) /*!< CHARGER_PWR_UP_SETTLING (Bit 0) */
-#define CHARGER_CHARGER_PWR_UP_TIMER_REG_CHARGER_PWR_UP_SETTLING_Msk (0x3ffUL) /*!< CHARGER_PWR_UP_SETTLING (Bitfield-Mask: 0x3ff) */
-/* =============================================== CHARGER_STATE_IRQ_CLR_REG =============================================== */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_CV_TO_PRECHARGE_IRQ_CLR_Pos (11UL) /*!< CV_TO_PRECHARGE_IRQ_CLR (Bit 11) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_CV_TO_PRECHARGE_IRQ_CLR_Msk (0x800UL) /*!< CV_TO_PRECHARGE_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_CC_TO_PRECHARGE_IRQ_CLR_Pos (10UL) /*!< CC_TO_PRECHARGE_IRQ_CLR (Bit 10) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_CC_TO_PRECHARGE_IRQ_CLR_Msk (0x400UL) /*!< CC_TO_PRECHARGE_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_CV_TO_CC_IRQ_CLR_Pos (9UL) /*!< CV_TO_CC_IRQ_CLR (Bit 9) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_CV_TO_CC_IRQ_CLR_Msk (0x200UL) /*!< CV_TO_CC_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_TBAT_STATUS_UPDATE_IRQ_CLR_Pos (8UL) /*!< TBAT_STATUS_UPDATE_IRQ_CLR (Bit 8) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_TBAT_STATUS_UPDATE_IRQ_CLR_Msk (0x100UL) /*!< TBAT_STATUS_UPDATE_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_TBAT_PROT_TO_PRECHARGE_IRQ_CLR_Pos (7UL) /*!< TBAT_PROT_TO_PRECHARGE_IRQ_CLR (Bit 7) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_TBAT_PROT_TO_PRECHARGE_IRQ_CLR_Msk (0x80UL) /*!< TBAT_PROT_TO_PRECHARGE_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_TDIE_PROT_TO_PRECHARGE_IRQ_CLR_Pos (6UL) /*!< TDIE_PROT_TO_PRECHARGE_IRQ_CLR (Bit 6) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_TDIE_PROT_TO_PRECHARGE_IRQ_CLR_Msk (0x40UL) /*!< TDIE_PROT_TO_PRECHARGE_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_EOC_TO_PRECHARGE_IRQ_CLR_Pos (5UL) /*!< EOC_TO_PRECHARGE_IRQ_CLR (Bit 5) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_EOC_TO_PRECHARGE_IRQ_CLR_Msk (0x20UL) /*!< EOC_TO_PRECHARGE_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_CV_TO_EOC_IRQ_CLR_Pos (4UL) /*!< CV_TO_EOC_IRQ_CLR (Bit 4) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_CV_TO_EOC_IRQ_CLR_Msk (0x10UL) /*!< CV_TO_EOC_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_CC_TO_EOC_IRQ_CLR_Pos (3UL) /*!< CC_TO_EOC_IRQ_CLR (Bit 3) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_CC_TO_EOC_IRQ_CLR_Msk (0x8UL) /*!< CC_TO_EOC_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_CC_TO_CV_IRQ_CLR_Pos (2UL) /*!< CC_TO_CV_IRQ_CLR (Bit 2) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_CC_TO_CV_IRQ_CLR_Msk (0x4UL) /*!< CC_TO_CV_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_PRECHARGE_TO_CC_IRQ_CLR_Pos (1UL) /*!< PRECHARGE_TO_CC_IRQ_CLR (Bit 1) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_PRECHARGE_TO_CC_IRQ_CLR_Msk (0x2UL) /*!< PRECHARGE_TO_CC_IRQ_CLR (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_DISABLED_TO_PRECHARGE_IRQ_CLR_Pos (0UL) /*!< DISABLED_TO_PRECHARGE_IRQ_CLR (Bit 0) */
-#define CHARGER_CHARGER_STATE_IRQ_CLR_REG_DISABLED_TO_PRECHARGE_IRQ_CLR_Msk (0x1UL) /*!< DISABLED_TO_PRECHARGE_IRQ_CLR (Bitfield-Mask: 0x01) */
-/* ============================================== CHARGER_STATE_IRQ_MASK_REG =============================================== */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_CV_TO_PRECHARGE_IRQ_EN_Pos (11UL) /*!< CV_TO_PRECHARGE_IRQ_EN (Bit 11) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_CV_TO_PRECHARGE_IRQ_EN_Msk (0x800UL) /*!< CV_TO_PRECHARGE_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_CC_TO_PRECHARGE_IRQ_EN_Pos (10UL) /*!< CC_TO_PRECHARGE_IRQ_EN (Bit 10) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_CC_TO_PRECHARGE_IRQ_EN_Msk (0x400UL) /*!< CC_TO_PRECHARGE_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_CV_TO_CC_IRQ_EN_Pos (9UL) /*!< CV_TO_CC_IRQ_EN (Bit 9) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_CV_TO_CC_IRQ_EN_Msk (0x200UL) /*!< CV_TO_CC_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_TBAT_STATUS_UPDATE_IRQ_EN_Pos (8UL) /*!< TBAT_STATUS_UPDATE_IRQ_EN (Bit 8) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_TBAT_STATUS_UPDATE_IRQ_EN_Msk (0x100UL) /*!< TBAT_STATUS_UPDATE_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_TBAT_PROT_TO_PRECHARGE_IRQ_EN_Pos (7UL) /*!< TBAT_PROT_TO_PRECHARGE_IRQ_EN (Bit 7) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_TBAT_PROT_TO_PRECHARGE_IRQ_EN_Msk (0x80UL) /*!< TBAT_PROT_TO_PRECHARGE_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_TDIE_PROT_TO_PRECHARGE_IRQ_EN_Pos (6UL) /*!< TDIE_PROT_TO_PRECHARGE_IRQ_EN (Bit 6) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_TDIE_PROT_TO_PRECHARGE_IRQ_EN_Msk (0x40UL) /*!< TDIE_PROT_TO_PRECHARGE_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_EOC_TO_PRECHARGE_IRQ_EN_Pos (5UL) /*!< EOC_TO_PRECHARGE_IRQ_EN (Bit 5) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_EOC_TO_PRECHARGE_IRQ_EN_Msk (0x20UL) /*!< EOC_TO_PRECHARGE_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_CV_TO_EOC_IRQ_EN_Pos (4UL) /*!< CV_TO_EOC_IRQ_EN (Bit 4) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_CV_TO_EOC_IRQ_EN_Msk (0x10UL) /*!< CV_TO_EOC_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_CC_TO_EOC_IRQ_EN_Pos (3UL) /*!< CC_TO_EOC_IRQ_EN (Bit 3) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_CC_TO_EOC_IRQ_EN_Msk (0x8UL) /*!< CC_TO_EOC_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_CC_TO_CV_IRQ_EN_Pos (2UL) /*!< CC_TO_CV_IRQ_EN (Bit 2) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_CC_TO_CV_IRQ_EN_Msk (0x4UL) /*!< CC_TO_CV_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_PRECHARGE_TO_CC_IRQ_EN_Pos (1UL) /*!< PRECHARGE_TO_CC_IRQ_EN (Bit 1) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_PRECHARGE_TO_CC_IRQ_EN_Msk (0x2UL) /*!< PRECHARGE_TO_CC_IRQ_EN (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_DISABLED_TO_PRECHARGE_IRQ_EN_Pos (0UL) /*!< DISABLED_TO_PRECHARGE_IRQ_EN (Bit 0) */
-#define CHARGER_CHARGER_STATE_IRQ_MASK_REG_DISABLED_TO_PRECHARGE_IRQ_EN_Msk (0x1UL) /*!< DISABLED_TO_PRECHARGE_IRQ_EN (Bitfield-Mask: 0x01) */
-/* ============================================= CHARGER_STATE_IRQ_STATUS_REG ============================================== */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_CV_TO_PRECHARGE_IRQ_Pos (11UL) /*!< CV_TO_PRECHARGE_IRQ (Bit 11) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_CV_TO_PRECHARGE_IRQ_Msk (0x800UL) /*!< CV_TO_PRECHARGE_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_CC_TO_PRECHARGE_IRQ_Pos (10UL) /*!< CC_TO_PRECHARGE_IRQ (Bit 10) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_CC_TO_PRECHARGE_IRQ_Msk (0x400UL) /*!< CC_TO_PRECHARGE_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_CV_TO_CC_IRQ_Pos (9UL) /*!< CV_TO_CC_IRQ (Bit 9) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_CV_TO_CC_IRQ_Msk (0x200UL) /*!< CV_TO_CC_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_TBAT_STATUS_UPDATE_IRQ_Pos (8UL) /*!< TBAT_STATUS_UPDATE_IRQ (Bit 8) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_TBAT_STATUS_UPDATE_IRQ_Msk (0x100UL) /*!< TBAT_STATUS_UPDATE_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_TBAT_PROT_TO_PRECHARGE_IRQ_Pos (7UL) /*!< TBAT_PROT_TO_PRECHARGE_IRQ (Bit 7) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_TBAT_PROT_TO_PRECHARGE_IRQ_Msk (0x80UL) /*!< TBAT_PROT_TO_PRECHARGE_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_TDIE_PROT_TO_PRECHARGE_IRQ_Pos (6UL) /*!< TDIE_PROT_TO_PRECHARGE_IRQ (Bit 6) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_TDIE_PROT_TO_PRECHARGE_IRQ_Msk (0x40UL) /*!< TDIE_PROT_TO_PRECHARGE_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_EOC_TO_PRECHARGE_IRQ_Pos (5UL) /*!< EOC_TO_PRECHARGE_IRQ (Bit 5) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_EOC_TO_PRECHARGE_IRQ_Msk (0x20UL) /*!< EOC_TO_PRECHARGE_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_CV_TO_EOC_IRQ_Pos (4UL) /*!< CV_TO_EOC_IRQ (Bit 4) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_CV_TO_EOC_IRQ_Msk (0x10UL) /*!< CV_TO_EOC_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_CC_TO_EOC_IRQ_Pos (3UL) /*!< CC_TO_EOC_IRQ (Bit 3) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_CC_TO_EOC_IRQ_Msk (0x8UL) /*!< CC_TO_EOC_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_CC_TO_CV_IRQ_Pos (2UL) /*!< CC_TO_CV_IRQ (Bit 2) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_CC_TO_CV_IRQ_Msk (0x4UL) /*!< CC_TO_CV_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_PRECHARGE_TO_CC_IRQ_Pos (1UL) /*!< PRECHARGE_TO_CC_IRQ (Bit 1) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_PRECHARGE_TO_CC_IRQ_Msk (0x2UL) /*!< PRECHARGE_TO_CC_IRQ (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_DISABLED_TO_PRECHARGE_IRQ_Pos (0UL) /*!< DISABLED_TO_PRECHARGE_IRQ (Bit 0) */
-#define CHARGER_CHARGER_STATE_IRQ_STATUS_REG_DISABLED_TO_PRECHARGE_IRQ_Msk (0x1UL) /*!< DISABLED_TO_PRECHARGE_IRQ (Bitfield-Mask: 0x01) */
-/* ================================================== CHARGER_STATUS_REG =================================================== */
-#define CHARGER_CHARGER_STATUS_REG_OVP_EVENTS_DEBOUNCE_CNT_Pos (27UL) /*!< OVP_EVENTS_DEBOUNCE_CNT (Bit 27) */
-#define CHARGER_CHARGER_STATUS_REG_OVP_EVENTS_DEBOUNCE_CNT_Msk (0x38000000UL) /*!< OVP_EVENTS_DEBOUNCE_CNT (Bitfield-Mask: 0x07) */
-#define CHARGER_CHARGER_STATUS_REG_EOC_EVENTS_DEBOUNCE_CNT_Pos (24UL) /*!< EOC_EVENTS_DEBOUNCE_CNT (Bit 24) */
-#define CHARGER_CHARGER_STATUS_REG_EOC_EVENTS_DEBOUNCE_CNT_Msk (0x7000000UL) /*!< EOC_EVENTS_DEBOUNCE_CNT (Bitfield-Mask: 0x07) */
-#define CHARGER_CHARGER_STATUS_REG_TDIE_ERROR_DEBOUNCE_CNT_Pos (21UL) /*!< TDIE_ERROR_DEBOUNCE_CNT (Bit 21) */
-#define CHARGER_CHARGER_STATUS_REG_TDIE_ERROR_DEBOUNCE_CNT_Msk (0xe00000UL) /*!< TDIE_ERROR_DEBOUNCE_CNT (Bitfield-Mask: 0x07) */
-#define CHARGER_CHARGER_STATUS_REG_CHARGER_JEITA_STATE_Pos (18UL) /*!< CHARGER_JEITA_STATE (Bit 18) */
-#define CHARGER_CHARGER_STATUS_REG_CHARGER_JEITA_STATE_Msk (0x1c0000UL) /*!< CHARGER_JEITA_STATE (Bitfield-Mask: 0x07) */
-#define CHARGER_CHARGER_STATUS_REG_CHARGER_STATE_Pos (14UL) /*!< CHARGER_STATE (Bit 14) */
-#define CHARGER_CHARGER_STATUS_REG_CHARGER_STATE_Msk (0x3c000UL) /*!< CHARGER_STATE (Bitfield-Mask: 0x0f) */
-#define CHARGER_CHARGER_STATUS_REG_TBAT_STATUS_Pos (9UL) /*!< TBAT_STATUS (Bit 9) */
-#define CHARGER_CHARGER_STATUS_REG_TBAT_STATUS_Msk (0x3e00UL) /*!< TBAT_STATUS (Bitfield-Mask: 0x1f) */
-#define CHARGER_CHARGER_STATUS_REG_MAIN_TBAT_COMP_OUT_Pos (8UL) /*!< MAIN_TBAT_COMP_OUT (Bit 8) */
-#define CHARGER_CHARGER_STATUS_REG_MAIN_TBAT_COMP_OUT_Msk (0x100UL) /*!< MAIN_TBAT_COMP_OUT (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATUS_REG_TBAT_HOT_COMP_OUT_Pos (7UL) /*!< TBAT_HOT_COMP_OUT (Bit 7) */
-#define CHARGER_CHARGER_STATUS_REG_TBAT_HOT_COMP_OUT_Msk (0x80UL) /*!< TBAT_HOT_COMP_OUT (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATUS_REG_TDIE_COMP_OUT_Pos (6UL) /*!< TDIE_COMP_OUT (Bit 6) */
-#define CHARGER_CHARGER_STATUS_REG_TDIE_COMP_OUT_Msk (0x40UL) /*!< TDIE_COMP_OUT (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATUS_REG_VBAT_OVP_COMP_OUT_Pos (5UL) /*!< VBAT_OVP_COMP_OUT (Bit 5) */
-#define CHARGER_CHARGER_STATUS_REG_VBAT_OVP_COMP_OUT_Msk (0x20UL) /*!< VBAT_OVP_COMP_OUT (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATUS_REG_MAIN_VBAT_COMP_OUT_Pos (4UL) /*!< MAIN_VBAT_COMP_OUT (Bit 4) */
-#define CHARGER_CHARGER_STATUS_REG_MAIN_VBAT_COMP_OUT_Msk (0x10UL) /*!< MAIN_VBAT_COMP_OUT (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATUS_REG_END_OF_CHARGE_Pos (3UL) /*!< END_OF_CHARGE (Bit 3) */
-#define CHARGER_CHARGER_STATUS_REG_END_OF_CHARGE_Msk (0x8UL) /*!< END_OF_CHARGE (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATUS_REG_CHARGER_CV_MODE_Pos (2UL) /*!< CHARGER_CV_MODE (Bit 2) */
-#define CHARGER_CHARGER_STATUS_REG_CHARGER_CV_MODE_Msk (0x4UL) /*!< CHARGER_CV_MODE (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATUS_REG_CHARGER_CC_MODE_Pos (1UL) /*!< CHARGER_CC_MODE (Bit 1) */
-#define CHARGER_CHARGER_STATUS_REG_CHARGER_CC_MODE_Msk (0x2UL) /*!< CHARGER_CC_MODE (Bitfield-Mask: 0x01) */
-#define CHARGER_CHARGER_STATUS_REG_CHARGER_IS_POWERED_UP_Pos (0UL) /*!< CHARGER_IS_POWERED_UP (Bit 0) */
-#define CHARGER_CHARGER_STATUS_REG_CHARGER_IS_POWERED_UP_Msk (0x1UL) /*!< CHARGER_IS_POWERED_UP (Bitfield-Mask: 0x01) */
-/* ============================================== CHARGER_TBAT_COMP_TIMER_REG ============================================== */
-#define CHARGER_CHARGER_TBAT_COMP_TIMER_REG_TBAT_COMP_TIMER_Pos (16UL) /*!< TBAT_COMP_TIMER (Bit 16) */
-#define CHARGER_CHARGER_TBAT_COMP_TIMER_REG_TBAT_COMP_TIMER_Msk (0x3ff0000UL) /*!< TBAT_COMP_TIMER (Bitfield-Mask: 0x3ff) */
-#define CHARGER_CHARGER_TBAT_COMP_TIMER_REG_TBAT_COMP_SETTLING_Pos (0UL) /*!< TBAT_COMP_SETTLING (Bit 0) */
-#define CHARGER_CHARGER_TBAT_COMP_TIMER_REG_TBAT_COMP_SETTLING_Msk (0x3ffUL) /*!< TBAT_COMP_SETTLING (Bitfield-Mask: 0x3ff) */
-/* ============================================== CHARGER_TBAT_MON_TIMER_REG =============================================== */
-#define CHARGER_CHARGER_TBAT_MON_TIMER_REG_TBAT_MON_TIMER_Pos (16UL) /*!< TBAT_MON_TIMER (Bit 16) */
-#define CHARGER_CHARGER_TBAT_MON_TIMER_REG_TBAT_MON_TIMER_Msk (0x3ff0000UL) /*!< TBAT_MON_TIMER (Bitfield-Mask: 0x3ff) */
-#define CHARGER_CHARGER_TBAT_MON_TIMER_REG_TBAT_MON_INTERVAL_Pos (0UL) /*!< TBAT_MON_INTERVAL (Bit 0) */
-#define CHARGER_CHARGER_TBAT_MON_TIMER_REG_TBAT_MON_INTERVAL_Msk (0x3ffUL) /*!< TBAT_MON_INTERVAL (Bitfield-Mask: 0x3ff) */
-/* ============================================== CHARGER_TDIE_COMP_TIMER_REG ============================================== */
-#define CHARGER_CHARGER_TDIE_COMP_TIMER_REG_TDIE_COMP_TIMER_Pos (16UL) /*!< TDIE_COMP_TIMER (Bit 16) */
-#define CHARGER_CHARGER_TDIE_COMP_TIMER_REG_TDIE_COMP_TIMER_Msk (0x3ff0000UL) /*!< TDIE_COMP_TIMER (Bitfield-Mask: 0x3ff) */
-#define CHARGER_CHARGER_TDIE_COMP_TIMER_REG_TDIE_COMP_SETTLING_Pos (0UL) /*!< TDIE_COMP_SETTLING (Bit 0) */
-#define CHARGER_CHARGER_TDIE_COMP_TIMER_REG_TDIE_COMP_SETTLING_Msk (0x3ffUL) /*!< TDIE_COMP_SETTLING (Bitfield-Mask: 0x3ff) */
-/* =============================================== CHARGER_TEMPSET_PARAM_REG =============================================== */
-#define CHARGER_CHARGER_TEMPSET_PARAM_REG_TDIE_MAX_Pos (24UL) /*!< TDIE_MAX (Bit 24) */
-#define CHARGER_CHARGER_TEMPSET_PARAM_REG_TDIE_MAX_Msk (0x7000000UL) /*!< TDIE_MAX (Bitfield-Mask: 0x07) */
-#define CHARGER_CHARGER_TEMPSET_PARAM_REG_TBAT_HOT_Pos (18UL) /*!< TBAT_HOT (Bit 18) */
-#define CHARGER_CHARGER_TEMPSET_PARAM_REG_TBAT_HOT_Msk (0xfc0000UL) /*!< TBAT_HOT (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_TEMPSET_PARAM_REG_TBAT_WARM_Pos (12UL) /*!< TBAT_WARM (Bit 12) */
-#define CHARGER_CHARGER_TEMPSET_PARAM_REG_TBAT_WARM_Msk (0x3f000UL) /*!< TBAT_WARM (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_TEMPSET_PARAM_REG_TBAT_COOL_Pos (6UL) /*!< TBAT_COOL (Bit 6) */
-#define CHARGER_CHARGER_TEMPSET_PARAM_REG_TBAT_COOL_Msk (0xfc0UL) /*!< TBAT_COOL (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_TEMPSET_PARAM_REG_TBAT_COLD_Pos (0UL) /*!< TBAT_COLD (Bit 0) */
-#define CHARGER_CHARGER_TEMPSET_PARAM_REG_TBAT_COLD_Msk (0x3fUL) /*!< TBAT_COLD (Bitfield-Mask: 0x3f) */
-/* ================================================= CHARGER_TEST_CTRL_REG ================================================= */
-/* ============================================== CHARGER_THOT_COMP_TIMER_REG ============================================== */
-#define CHARGER_CHARGER_THOT_COMP_TIMER_REG_THOT_COMP_TIMER_Pos (16UL) /*!< THOT_COMP_TIMER (Bit 16) */
-#define CHARGER_CHARGER_THOT_COMP_TIMER_REG_THOT_COMP_TIMER_Msk (0x3ff0000UL) /*!< THOT_COMP_TIMER (Bitfield-Mask: 0x3ff) */
-#define CHARGER_CHARGER_THOT_COMP_TIMER_REG_THOT_COMP_SETTLING_Pos (0UL) /*!< THOT_COMP_SETTLING (Bit 0) */
-#define CHARGER_CHARGER_THOT_COMP_TIMER_REG_THOT_COMP_SETTLING_Msk (0x3ffUL) /*!< THOT_COMP_SETTLING (Bitfield-Mask: 0x3ff) */
-/* ============================================ CHARGER_TOTAL_CHARGE_TIMER_REG ============================================= */
-#define CHARGER_CHARGER_TOTAL_CHARGE_TIMER_REG_TOTAL_CHARGE_TIMER_Pos (16UL) /*!< TOTAL_CHARGE_TIMER (Bit 16) */
-#define CHARGER_CHARGER_TOTAL_CHARGE_TIMER_REG_TOTAL_CHARGE_TIMER_Msk (0xffff0000UL) /*!< TOTAL_CHARGE_TIMER (Bitfield-Mask: 0xffff) */
-#define CHARGER_CHARGER_TOTAL_CHARGE_TIMER_REG_MAX_TOTAL_CHARGE_TIME_Pos (0UL) /*!< MAX_TOTAL_CHARGE_TIME (Bit 0) */
-#define CHARGER_CHARGER_TOTAL_CHARGE_TIMER_REG_MAX_TOTAL_CHARGE_TIME_Msk (0xffffUL) /*!< MAX_TOTAL_CHARGE_TIME (Bitfield-Mask: 0xffff) */
-/* ============================================== CHARGER_VBAT_COMP_TIMER_REG ============================================== */
-#define CHARGER_CHARGER_VBAT_COMP_TIMER_REG_VBAT_COMP_TIMER_Pos (16UL) /*!< VBAT_COMP_TIMER (Bit 16) */
-#define CHARGER_CHARGER_VBAT_COMP_TIMER_REG_VBAT_COMP_TIMER_Msk (0x3ff0000UL) /*!< VBAT_COMP_TIMER (Bitfield-Mask: 0x3ff) */
-#define CHARGER_CHARGER_VBAT_COMP_TIMER_REG_VBAT_COMP_SETTLING_Pos (0UL) /*!< VBAT_COMP_SETTLING (Bit 0) */
-#define CHARGER_CHARGER_VBAT_COMP_TIMER_REG_VBAT_COMP_SETTLING_Msk (0x3ffUL) /*!< VBAT_COMP_SETTLING (Bitfield-Mask: 0x3ff) */
-/* =============================================== CHARGER_VOLTAGE_PARAM_REG =============================================== */
-#define CHARGER_CHARGER_VOLTAGE_PARAM_REG_V_OVP_Pos (18UL) /*!< V_OVP (Bit 18) */
-#define CHARGER_CHARGER_VOLTAGE_PARAM_REG_V_OVP_Msk (0xfc0000UL) /*!< V_OVP (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_VOLTAGE_PARAM_REG_V_REPLENISH_Pos (12UL) /*!< V_REPLENISH (Bit 12) */
-#define CHARGER_CHARGER_VOLTAGE_PARAM_REG_V_REPLENISH_Msk (0x3f000UL) /*!< V_REPLENISH (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_VOLTAGE_PARAM_REG_V_PRECHARGE_Pos (6UL) /*!< V_PRECHARGE (Bit 6) */
-#define CHARGER_CHARGER_VOLTAGE_PARAM_REG_V_PRECHARGE_Msk (0xfc0UL) /*!< V_PRECHARGE (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_VOLTAGE_PARAM_REG_V_CHARGE_Pos (0UL) /*!< V_CHARGE (Bit 0) */
-#define CHARGER_CHARGER_VOLTAGE_PARAM_REG_V_CHARGE_Msk (0x3fUL) /*!< V_CHARGE (Bitfield-Mask: 0x3f) */
-/* ============================================== CHARGER_VOVP_COMP_TIMER_REG ============================================== */
-#define CHARGER_CHARGER_VOVP_COMP_TIMER_REG_OVP_INTERVAL_CHECK_TIMER_Pos (26UL) /*!< OVP_INTERVAL_CHECK_TIMER (Bit 26) */
-#define CHARGER_CHARGER_VOVP_COMP_TIMER_REG_OVP_INTERVAL_CHECK_TIMER_Msk (0xfc000000UL) /*!< OVP_INTERVAL_CHECK_TIMER (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_VOVP_COMP_TIMER_REG_VBAT_OVP_COMP_TIMER_Pos (16UL) /*!< VBAT_OVP_COMP_TIMER (Bit 16) */
-#define CHARGER_CHARGER_VOVP_COMP_TIMER_REG_VBAT_OVP_COMP_TIMER_Msk (0x3ff0000UL) /*!< VBAT_OVP_COMP_TIMER (Bitfield-Mask: 0x3ff) */
-#define CHARGER_CHARGER_VOVP_COMP_TIMER_REG_OVP_INTERVAL_CHECK_THRES_Pos (10UL) /*!< OVP_INTERVAL_CHECK_THRES (Bit 10) */
-#define CHARGER_CHARGER_VOVP_COMP_TIMER_REG_OVP_INTERVAL_CHECK_THRES_Msk (0xfc00UL) /*!< OVP_INTERVAL_CHECK_THRES (Bitfield-Mask: 0x3f) */
-#define CHARGER_CHARGER_VOVP_COMP_TIMER_REG_VBAT_OVP_COMP_SETTLING_Pos (0UL) /*!< VBAT_OVP_COMP_SETTLING (Bit 0) */
-#define CHARGER_CHARGER_VOVP_COMP_TIMER_REG_VBAT_OVP_COMP_SETTLING_Msk (0x3ffUL) /*!< VBAT_OVP_COMP_SETTLING (Bitfield-Mask: 0x3ff) */
-
-
-/* =========================================================================================================================== */
-/* ================ CHIP_VERSION ================ */
-/* =========================================================================================================================== */
-
-/* ===================================================== CHIP_ID1_REG ====================================================== */
-#define CHIP_VERSION_CHIP_ID1_REG_CHIP_ID1_Pos (0UL) /*!< CHIP_ID1 (Bit 0) */
-#define CHIP_VERSION_CHIP_ID1_REG_CHIP_ID1_Msk (0xffUL) /*!< CHIP_ID1 (Bitfield-Mask: 0xff) */
-/* ===================================================== CHIP_ID2_REG ====================================================== */
-#define CHIP_VERSION_CHIP_ID2_REG_CHIP_ID2_Pos (0UL) /*!< CHIP_ID2 (Bit 0) */
-#define CHIP_VERSION_CHIP_ID2_REG_CHIP_ID2_Msk (0xffUL) /*!< CHIP_ID2 (Bitfield-Mask: 0xff) */
-/* ===================================================== CHIP_ID3_REG ====================================================== */
-#define CHIP_VERSION_CHIP_ID3_REG_CHIP_ID3_Pos (0UL) /*!< CHIP_ID3 (Bit 0) */
-#define CHIP_VERSION_CHIP_ID3_REG_CHIP_ID3_Msk (0xffUL) /*!< CHIP_ID3 (Bitfield-Mask: 0xff) */
-/* ===================================================== CHIP_ID4_REG ====================================================== */
-#define CHIP_VERSION_CHIP_ID4_REG_CHIP_ID4_Pos (0UL) /*!< CHIP_ID4 (Bit 0) */
-#define CHIP_VERSION_CHIP_ID4_REG_CHIP_ID4_Msk (0xffUL) /*!< CHIP_ID4 (Bitfield-Mask: 0xff) */
-/* =================================================== CHIP_REVISION_REG =================================================== */
-#define CHIP_VERSION_CHIP_REVISION_REG_CHIP_REVISION_Pos (0UL) /*!< CHIP_REVISION (Bit 0) */
-#define CHIP_VERSION_CHIP_REVISION_REG_CHIP_REVISION_Msk (0xffUL) /*!< CHIP_REVISION (Bitfield-Mask: 0xff) */
-/* ===================================================== CHIP_SWC_REG ====================================================== */
-#define CHIP_VERSION_CHIP_SWC_REG_CHIP_SWC_Pos (0UL) /*!< CHIP_SWC (Bit 0) */
-#define CHIP_VERSION_CHIP_SWC_REG_CHIP_SWC_Msk (0xfUL) /*!< CHIP_SWC (Bitfield-Mask: 0x0f) */
-/* ==================================================== CHIP_TEST1_REG ===================================================== */
-#define CHIP_VERSION_CHIP_TEST1_REG_CHIP_LAYOUT_REVISION_Pos (0UL) /*!< CHIP_LAYOUT_REVISION (Bit 0) */
-#define CHIP_VERSION_CHIP_TEST1_REG_CHIP_LAYOUT_REVISION_Msk (0xffUL) /*!< CHIP_LAYOUT_REVISION (Bitfield-Mask: 0xff) */
-/* ==================================================== CHIP_TEST2_REG ===================================================== */
-#define CHIP_VERSION_CHIP_TEST2_REG_CHIP_METAL_OPTION_Pos (0UL) /*!< CHIP_METAL_OPTION (Bit 0) */
-#define CHIP_VERSION_CHIP_TEST2_REG_CHIP_METAL_OPTION_Msk (0xfUL) /*!< CHIP_METAL_OPTION (Bitfield-Mask: 0x0f) */
-
-
-/* =========================================================================================================================== */
-/* ================ CRG_COM ================ */
-/* =========================================================================================================================== */
-
-/* ====================================================== CLK_COM_REG ====================================================== */
-#define CRG_COM_CLK_COM_REG_LCD_EXT_CLK_SEL_Pos (16UL) /*!< LCD_EXT_CLK_SEL (Bit 16) */
-#define CRG_COM_CLK_COM_REG_LCD_EXT_CLK_SEL_Msk (0x30000UL) /*!< LCD_EXT_CLK_SEL (Bitfield-Mask: 0x03) */
-#define CRG_COM_CLK_COM_REG_SNC_DIV_Pos (14UL) /*!< SNC_DIV (Bit 14) */
-#define CRG_COM_CLK_COM_REG_SNC_DIV_Msk (0xc000UL) /*!< SNC_DIV (Bitfield-Mask: 0x03) */
-#define CRG_COM_CLK_COM_REG_I2C2_CLK_SEL_Pos (12UL) /*!< I2C2_CLK_SEL (Bit 12) */
-#define CRG_COM_CLK_COM_REG_I2C2_CLK_SEL_Msk (0x1000UL) /*!< I2C2_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_CLK_COM_REG_I2C2_ENABLE_Pos (11UL) /*!< I2C2_ENABLE (Bit 11) */
-#define CRG_COM_CLK_COM_REG_I2C2_ENABLE_Msk (0x800UL) /*!< I2C2_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_CLK_COM_REG_I2C_CLK_SEL_Pos (10UL) /*!< I2C_CLK_SEL (Bit 10) */
-#define CRG_COM_CLK_COM_REG_I2C_CLK_SEL_Msk (0x400UL) /*!< I2C_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_CLK_COM_REG_I2C_ENABLE_Pos (9UL) /*!< I2C_ENABLE (Bit 9) */
-#define CRG_COM_CLK_COM_REG_I2C_ENABLE_Msk (0x200UL) /*!< I2C_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_CLK_COM_REG_SPI2_CLK_SEL_Pos (8UL) /*!< SPI2_CLK_SEL (Bit 8) */
-#define CRG_COM_CLK_COM_REG_SPI2_CLK_SEL_Msk (0x100UL) /*!< SPI2_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_CLK_COM_REG_SPI2_ENABLE_Pos (7UL) /*!< SPI2_ENABLE (Bit 7) */
-#define CRG_COM_CLK_COM_REG_SPI2_ENABLE_Msk (0x80UL) /*!< SPI2_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_CLK_COM_REG_SPI_CLK_SEL_Pos (6UL) /*!< SPI_CLK_SEL (Bit 6) */
-#define CRG_COM_CLK_COM_REG_SPI_CLK_SEL_Msk (0x40UL) /*!< SPI_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_CLK_COM_REG_SPI_ENABLE_Pos (5UL) /*!< SPI_ENABLE (Bit 5) */
-#define CRG_COM_CLK_COM_REG_SPI_ENABLE_Msk (0x20UL) /*!< SPI_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_CLK_COM_REG_UART3_CLK_SEL_Pos (4UL) /*!< UART3_CLK_SEL (Bit 4) */
-#define CRG_COM_CLK_COM_REG_UART3_CLK_SEL_Msk (0x10UL) /*!< UART3_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_CLK_COM_REG_UART3_ENABLE_Pos (3UL) /*!< UART3_ENABLE (Bit 3) */
-#define CRG_COM_CLK_COM_REG_UART3_ENABLE_Msk (0x8UL) /*!< UART3_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_CLK_COM_REG_UART2_CLK_SEL_Pos (2UL) /*!< UART2_CLK_SEL (Bit 2) */
-#define CRG_COM_CLK_COM_REG_UART2_CLK_SEL_Msk (0x4UL) /*!< UART2_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_CLK_COM_REG_UART2_ENABLE_Pos (1UL) /*!< UART2_ENABLE (Bit 1) */
-#define CRG_COM_CLK_COM_REG_UART2_ENABLE_Msk (0x2UL) /*!< UART2_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_CLK_COM_REG_UART_ENABLE_Pos (0UL) /*!< UART_ENABLE (Bit 0) */
-#define CRG_COM_CLK_COM_REG_UART_ENABLE_Msk (0x1UL) /*!< UART_ENABLE (Bitfield-Mask: 0x01) */
-/* =================================================== RESET_CLK_COM_REG =================================================== */
-#define CRG_COM_RESET_CLK_COM_REG_LCD_EXT_CLK_SEL_Pos (16UL) /*!< LCD_EXT_CLK_SEL (Bit 16) */
-#define CRG_COM_RESET_CLK_COM_REG_LCD_EXT_CLK_SEL_Msk (0x30000UL) /*!< LCD_EXT_CLK_SEL (Bitfield-Mask: 0x03) */
-#define CRG_COM_RESET_CLK_COM_REG_SNC_DIV_Pos (14UL) /*!< SNC_DIV (Bit 14) */
-#define CRG_COM_RESET_CLK_COM_REG_SNC_DIV_Msk (0xc000UL) /*!< SNC_DIV (Bitfield-Mask: 0x03) */
-#define CRG_COM_RESET_CLK_COM_REG_I2C2_CLK_SEL_Pos (12UL) /*!< I2C2_CLK_SEL (Bit 12) */
-#define CRG_COM_RESET_CLK_COM_REG_I2C2_CLK_SEL_Msk (0x1000UL) /*!< I2C2_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_RESET_CLK_COM_REG_I2C2_ENABLE_Pos (11UL) /*!< I2C2_ENABLE (Bit 11) */
-#define CRG_COM_RESET_CLK_COM_REG_I2C2_ENABLE_Msk (0x800UL) /*!< I2C2_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_RESET_CLK_COM_REG_I2C_CLK_SEL_Pos (10UL) /*!< I2C_CLK_SEL (Bit 10) */
-#define CRG_COM_RESET_CLK_COM_REG_I2C_CLK_SEL_Msk (0x400UL) /*!< I2C_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_RESET_CLK_COM_REG_I2C_ENABLE_Pos (9UL) /*!< I2C_ENABLE (Bit 9) */
-#define CRG_COM_RESET_CLK_COM_REG_I2C_ENABLE_Msk (0x200UL) /*!< I2C_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_RESET_CLK_COM_REG_SPI2_CLK_SEL_Pos (8UL) /*!< SPI2_CLK_SEL (Bit 8) */
-#define CRG_COM_RESET_CLK_COM_REG_SPI2_CLK_SEL_Msk (0x100UL) /*!< SPI2_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_RESET_CLK_COM_REG_SPI2_ENABLE_Pos (7UL) /*!< SPI2_ENABLE (Bit 7) */
-#define CRG_COM_RESET_CLK_COM_REG_SPI2_ENABLE_Msk (0x80UL) /*!< SPI2_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_RESET_CLK_COM_REG_SPI_CLK_SEL_Pos (6UL) /*!< SPI_CLK_SEL (Bit 6) */
-#define CRG_COM_RESET_CLK_COM_REG_SPI_CLK_SEL_Msk (0x40UL) /*!< SPI_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_RESET_CLK_COM_REG_SPI_ENABLE_Pos (5UL) /*!< SPI_ENABLE (Bit 5) */
-#define CRG_COM_RESET_CLK_COM_REG_SPI_ENABLE_Msk (0x20UL) /*!< SPI_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_RESET_CLK_COM_REG_UART3_CLK_SEL_Pos (4UL) /*!< UART3_CLK_SEL (Bit 4) */
-#define CRG_COM_RESET_CLK_COM_REG_UART3_CLK_SEL_Msk (0x10UL) /*!< UART3_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_RESET_CLK_COM_REG_UART3_ENABLE_Pos (3UL) /*!< UART3_ENABLE (Bit 3) */
-#define CRG_COM_RESET_CLK_COM_REG_UART3_ENABLE_Msk (0x8UL) /*!< UART3_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_RESET_CLK_COM_REG_UART2_CLK_SEL_Pos (2UL) /*!< UART2_CLK_SEL (Bit 2) */
-#define CRG_COM_RESET_CLK_COM_REG_UART2_CLK_SEL_Msk (0x4UL) /*!< UART2_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_RESET_CLK_COM_REG_UART2_ENABLE_Pos (1UL) /*!< UART2_ENABLE (Bit 1) */
-#define CRG_COM_RESET_CLK_COM_REG_UART2_ENABLE_Msk (0x2UL) /*!< UART2_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_RESET_CLK_COM_REG_UART_ENABLE_Pos (0UL) /*!< UART_ENABLE (Bit 0) */
-#define CRG_COM_RESET_CLK_COM_REG_UART_ENABLE_Msk (0x1UL) /*!< UART_ENABLE (Bitfield-Mask: 0x01) */
-/* ==================================================== SET_CLK_COM_REG ==================================================== */
-#define CRG_COM_SET_CLK_COM_REG_LCD_EXT_CLK_SEL_Pos (16UL) /*!< LCD_EXT_CLK_SEL (Bit 16) */
-#define CRG_COM_SET_CLK_COM_REG_LCD_EXT_CLK_SEL_Msk (0x30000UL) /*!< LCD_EXT_CLK_SEL (Bitfield-Mask: 0x03) */
-#define CRG_COM_SET_CLK_COM_REG_SNC_DIV_Pos (14UL) /*!< SNC_DIV (Bit 14) */
-#define CRG_COM_SET_CLK_COM_REG_SNC_DIV_Msk (0xc000UL) /*!< SNC_DIV (Bitfield-Mask: 0x03) */
-#define CRG_COM_SET_CLK_COM_REG_I2C2_CLK_SEL_Pos (12UL) /*!< I2C2_CLK_SEL (Bit 12) */
-#define CRG_COM_SET_CLK_COM_REG_I2C2_CLK_SEL_Msk (0x1000UL) /*!< I2C2_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_SET_CLK_COM_REG_I2C2_ENABLE_Pos (11UL) /*!< I2C2_ENABLE (Bit 11) */
-#define CRG_COM_SET_CLK_COM_REG_I2C2_ENABLE_Msk (0x800UL) /*!< I2C2_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_SET_CLK_COM_REG_I2C_CLK_SEL_Pos (10UL) /*!< I2C_CLK_SEL (Bit 10) */
-#define CRG_COM_SET_CLK_COM_REG_I2C_CLK_SEL_Msk (0x400UL) /*!< I2C_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_SET_CLK_COM_REG_I2C_ENABLE_Pos (9UL) /*!< I2C_ENABLE (Bit 9) */
-#define CRG_COM_SET_CLK_COM_REG_I2C_ENABLE_Msk (0x200UL) /*!< I2C_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_SET_CLK_COM_REG_SPI2_CLK_SEL_Pos (8UL) /*!< SPI2_CLK_SEL (Bit 8) */
-#define CRG_COM_SET_CLK_COM_REG_SPI2_CLK_SEL_Msk (0x100UL) /*!< SPI2_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_SET_CLK_COM_REG_SPI2_ENABLE_Pos (7UL) /*!< SPI2_ENABLE (Bit 7) */
-#define CRG_COM_SET_CLK_COM_REG_SPI2_ENABLE_Msk (0x80UL) /*!< SPI2_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_SET_CLK_COM_REG_SPI_CLK_SEL_Pos (6UL) /*!< SPI_CLK_SEL (Bit 6) */
-#define CRG_COM_SET_CLK_COM_REG_SPI_CLK_SEL_Msk (0x40UL) /*!< SPI_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_SET_CLK_COM_REG_SPI_ENABLE_Pos (5UL) /*!< SPI_ENABLE (Bit 5) */
-#define CRG_COM_SET_CLK_COM_REG_SPI_ENABLE_Msk (0x20UL) /*!< SPI_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_SET_CLK_COM_REG_UART3_CLK_SEL_Pos (4UL) /*!< UART3_CLK_SEL (Bit 4) */
-#define CRG_COM_SET_CLK_COM_REG_UART3_CLK_SEL_Msk (0x10UL) /*!< UART3_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_SET_CLK_COM_REG_UART3_ENABLE_Pos (3UL) /*!< UART3_ENABLE (Bit 3) */
-#define CRG_COM_SET_CLK_COM_REG_UART3_ENABLE_Msk (0x8UL) /*!< UART3_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_SET_CLK_COM_REG_UART2_CLK_SEL_Pos (2UL) /*!< UART2_CLK_SEL (Bit 2) */
-#define CRG_COM_SET_CLK_COM_REG_UART2_CLK_SEL_Msk (0x4UL) /*!< UART2_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_COM_SET_CLK_COM_REG_UART2_ENABLE_Pos (1UL) /*!< UART2_ENABLE (Bit 1) */
-#define CRG_COM_SET_CLK_COM_REG_UART2_ENABLE_Msk (0x2UL) /*!< UART2_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_COM_SET_CLK_COM_REG_UART_ENABLE_Pos (0UL) /*!< UART_ENABLE (Bit 0) */
-#define CRG_COM_SET_CLK_COM_REG_UART_ENABLE_Msk (0x1UL) /*!< UART_ENABLE (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ CRG_PER ================ */
-/* =========================================================================================================================== */
-
-/* ====================================================== CLK_PER_REG ====================================================== */
-#define CRG_PER_CLK_PER_REG_MC_TRIG_DIV_Pos (8UL) /*!< MC_TRIG_DIV (Bit 8) */
-#define CRG_PER_CLK_PER_REG_MC_TRIG_DIV_Msk (0x1f00UL) /*!< MC_TRIG_DIV (Bitfield-Mask: 0x1f) */
-#define CRG_PER_CLK_PER_REG_MC_CLK_DIV_Pos (3UL) /*!< MC_CLK_DIV (Bit 3) */
-#define CRG_PER_CLK_PER_REG_MC_CLK_DIV_Msk (0xf8UL) /*!< MC_CLK_DIV (Bitfield-Mask: 0x1f) */
-#define CRG_PER_CLK_PER_REG_MC_CLK_EN_Pos (2UL) /*!< MC_CLK_EN (Bit 2) */
-#define CRG_PER_CLK_PER_REG_MC_CLK_EN_Msk (0x4UL) /*!< MC_CLK_EN (Bitfield-Mask: 0x01) */
-#define CRG_PER_CLK_PER_REG_LRA_CLK_EN_Pos (1UL) /*!< LRA_CLK_EN (Bit 1) */
-#define CRG_PER_CLK_PER_REG_LRA_CLK_EN_Msk (0x2UL) /*!< LRA_CLK_EN (Bitfield-Mask: 0x01) */
-#define CRG_PER_CLK_PER_REG_GPADC_CLK_SEL_Pos (0UL) /*!< GPADC_CLK_SEL (Bit 0) */
-#define CRG_PER_CLK_PER_REG_GPADC_CLK_SEL_Msk (0x1UL) /*!< GPADC_CLK_SEL (Bitfield-Mask: 0x01) */
-/* ====================================================== PCM_DIV_REG ====================================================== */
-#define CRG_PER_PCM_DIV_REG_PCM_SRC_SEL_Pos (13UL) /*!< PCM_SRC_SEL (Bit 13) */
-#define CRG_PER_PCM_DIV_REG_PCM_SRC_SEL_Msk (0x2000UL) /*!< PCM_SRC_SEL (Bitfield-Mask: 0x01) */
-#define CRG_PER_PCM_DIV_REG_CLK_PCM_EN_Pos (12UL) /*!< CLK_PCM_EN (Bit 12) */
-#define CRG_PER_PCM_DIV_REG_CLK_PCM_EN_Msk (0x1000UL) /*!< CLK_PCM_EN (Bitfield-Mask: 0x01) */
-#define CRG_PER_PCM_DIV_REG_PCM_DIV_Pos (0UL) /*!< PCM_DIV (Bit 0) */
-#define CRG_PER_PCM_DIV_REG_PCM_DIV_Msk (0xfffUL) /*!< PCM_DIV (Bitfield-Mask: 0xfff) */
-/* ===================================================== PCM_FDIV_REG ====================================================== */
-#define CRG_PER_PCM_FDIV_REG_PCM_FDIV_Pos (0UL) /*!< PCM_FDIV (Bit 0) */
-#define CRG_PER_PCM_FDIV_REG_PCM_FDIV_Msk (0xffffUL) /*!< PCM_FDIV (Bitfield-Mask: 0xffff) */
-/* ====================================================== PDM_DIV_REG ====================================================== */
-#define CRG_PER_PDM_DIV_REG_PDM_MASTER_MODE_Pos (9UL) /*!< PDM_MASTER_MODE (Bit 9) */
-#define CRG_PER_PDM_DIV_REG_PDM_MASTER_MODE_Msk (0x200UL) /*!< PDM_MASTER_MODE (Bitfield-Mask: 0x01) */
-#define CRG_PER_PDM_DIV_REG_CLK_PDM_EN_Pos (8UL) /*!< CLK_PDM_EN (Bit 8) */
-#define CRG_PER_PDM_DIV_REG_CLK_PDM_EN_Msk (0x100UL) /*!< CLK_PDM_EN (Bitfield-Mask: 0x01) */
-#define CRG_PER_PDM_DIV_REG_PDM_DIV_Pos (0UL) /*!< PDM_DIV (Bit 0) */
-#define CRG_PER_PDM_DIV_REG_PDM_DIV_Msk (0xffUL) /*!< PDM_DIV (Bitfield-Mask: 0xff) */
-/* =================================================== RESET_CLK_PER_REG =================================================== */
-#define CRG_PER_RESET_CLK_PER_REG_MC_TRIG_DIV_Pos (8UL) /*!< MC_TRIG_DIV (Bit 8) */
-#define CRG_PER_RESET_CLK_PER_REG_MC_TRIG_DIV_Msk (0x1f00UL) /*!< MC_TRIG_DIV (Bitfield-Mask: 0x1f) */
-#define CRG_PER_RESET_CLK_PER_REG_MC_CLK_DIV_Pos (3UL) /*!< MC_CLK_DIV (Bit 3) */
-#define CRG_PER_RESET_CLK_PER_REG_MC_CLK_DIV_Msk (0xf8UL) /*!< MC_CLK_DIV (Bitfield-Mask: 0x1f) */
-#define CRG_PER_RESET_CLK_PER_REG_MC_CLK_EN_Pos (2UL) /*!< MC_CLK_EN (Bit 2) */
-#define CRG_PER_RESET_CLK_PER_REG_MC_CLK_EN_Msk (0x4UL) /*!< MC_CLK_EN (Bitfield-Mask: 0x01) */
-#define CRG_PER_RESET_CLK_PER_REG_LRA_CLK_EN_Pos (1UL) /*!< LRA_CLK_EN (Bit 1) */
-#define CRG_PER_RESET_CLK_PER_REG_LRA_CLK_EN_Msk (0x2UL) /*!< LRA_CLK_EN (Bitfield-Mask: 0x01) */
-#define CRG_PER_RESET_CLK_PER_REG_GPADC_CLK_SEL_Pos (0UL) /*!< GPADC_CLK_SEL (Bit 0) */
-#define CRG_PER_RESET_CLK_PER_REG_GPADC_CLK_SEL_Msk (0x1UL) /*!< GPADC_CLK_SEL (Bitfield-Mask: 0x01) */
-/* ==================================================== SET_CLK_PER_REG ==================================================== */
-#define CRG_PER_SET_CLK_PER_REG_MC_TRIG_DIV_Pos (8UL) /*!< MC_TRIG_DIV (Bit 8) */
-#define CRG_PER_SET_CLK_PER_REG_MC_TRIG_DIV_Msk (0x1f00UL) /*!< MC_TRIG_DIV (Bitfield-Mask: 0x1f) */
-#define CRG_PER_SET_CLK_PER_REG_MC_CLK_DIV_Pos (3UL) /*!< MC_CLK_DIV (Bit 3) */
-#define CRG_PER_SET_CLK_PER_REG_MC_CLK_DIV_Msk (0xf8UL) /*!< MC_CLK_DIV (Bitfield-Mask: 0x1f) */
-#define CRG_PER_SET_CLK_PER_REG_MC_CLK_EN_Pos (2UL) /*!< MC_CLK_EN (Bit 2) */
-#define CRG_PER_SET_CLK_PER_REG_MC_CLK_EN_Msk (0x4UL) /*!< MC_CLK_EN (Bitfield-Mask: 0x01) */
-#define CRG_PER_SET_CLK_PER_REG_LRA_CLK_EN_Pos (1UL) /*!< LRA_CLK_EN (Bit 1) */
-#define CRG_PER_SET_CLK_PER_REG_LRA_CLK_EN_Msk (0x2UL) /*!< LRA_CLK_EN (Bitfield-Mask: 0x01) */
-#define CRG_PER_SET_CLK_PER_REG_GPADC_CLK_SEL_Pos (0UL) /*!< GPADC_CLK_SEL (Bit 0) */
-#define CRG_PER_SET_CLK_PER_REG_GPADC_CLK_SEL_Msk (0x1UL) /*!< GPADC_CLK_SEL (Bitfield-Mask: 0x01) */
-/* ====================================================== SRC_DIV_REG ====================================================== */
-#define CRG_PER_SRC_DIV_REG_CLK_SRC_EN_Pos (8UL) /*!< CLK_SRC_EN (Bit 8) */
-#define CRG_PER_SRC_DIV_REG_CLK_SRC_EN_Msk (0x100UL) /*!< CLK_SRC_EN (Bitfield-Mask: 0x01) */
-#define CRG_PER_SRC_DIV_REG_SRC_DIV_Pos (0UL) /*!< SRC_DIV (Bit 0) */
-#define CRG_PER_SRC_DIV_REG_SRC_DIV_Msk (0xffUL) /*!< SRC_DIV (Bitfield-Mask: 0xff) */
-
-
-/* =========================================================================================================================== */
-/* ================ CRG_SYS ================ */
-/* =========================================================================================================================== */
-
-/* ===================================================== BATCHECK_REG ====================================================== */
-#define CRG_SYS_BATCHECK_REG_BATCHECK_LOAD_ENABLE_Pos (7UL) /*!< BATCHECK_LOAD_ENABLE (Bit 7) */
-#define CRG_SYS_BATCHECK_REG_BATCHECK_LOAD_ENABLE_Msk (0x80UL) /*!< BATCHECK_LOAD_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_SYS_BATCHECK_REG_BATCHECK_ILOAD_Pos (4UL) /*!< BATCHECK_ILOAD (Bit 4) */
-#define CRG_SYS_BATCHECK_REG_BATCHECK_ILOAD_Msk (0x70UL) /*!< BATCHECK_ILOAD (Bitfield-Mask: 0x07) */
-#define CRG_SYS_BATCHECK_REG_BATCHECK_TRIM_Pos (0UL) /*!< BATCHECK_TRIM (Bit 0) */
-#define CRG_SYS_BATCHECK_REG_BATCHECK_TRIM_Msk (0xfUL) /*!< BATCHECK_TRIM (Bitfield-Mask: 0x0f) */
-/* ====================================================== CLK_SYS_REG ====================================================== */
-#define CRG_SYS_CLK_SYS_REG_CLK_CHG_EN_Pos (5UL) /*!< CLK_CHG_EN (Bit 5) */
-#define CRG_SYS_CLK_SYS_REG_CLK_CHG_EN_Msk (0x20UL) /*!< CLK_CHG_EN (Bitfield-Mask: 0x01) */
-#define CRG_SYS_CLK_SYS_REG_LCD_RESET_REQ_Pos (4UL) /*!< LCD_RESET_REQ (Bit 4) */
-#define CRG_SYS_CLK_SYS_REG_LCD_RESET_REQ_Msk (0x10UL) /*!< LCD_RESET_REQ (Bitfield-Mask: 0x01) */
-#define CRG_SYS_CLK_SYS_REG_LCD_CLK_SEL_Pos (1UL) /*!< LCD_CLK_SEL (Bit 1) */
-#define CRG_SYS_CLK_SYS_REG_LCD_CLK_SEL_Msk (0x2UL) /*!< LCD_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_SYS_CLK_SYS_REG_LCD_ENABLE_Pos (0UL) /*!< LCD_ENABLE (Bit 0) */
-#define CRG_SYS_CLK_SYS_REG_LCD_ENABLE_Msk (0x1UL) /*!< LCD_ENABLE (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ CRG_TOP ================ */
-/* =========================================================================================================================== */
-
-/* ==================================================== ANA_STATUS_REG ===================================================== */
-#define CRG_TOP_ANA_STATUS_REG_COMP_VBUS_HIGH_Pos (14UL) /*!< COMP_VBUS_HIGH (Bit 14) */
-#define CRG_TOP_ANA_STATUS_REG_COMP_VBUS_HIGH_Msk (0x4000UL) /*!< COMP_VBUS_HIGH (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_COMP_VBUS_LOW_Pos (13UL) /*!< COMP_VBUS_LOW (Bit 13) */
-#define CRG_TOP_ANA_STATUS_REG_COMP_VBUS_LOW_Msk (0x2000UL) /*!< COMP_VBUS_LOW (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_COMP_VBAT_HIGH_Pos (12UL) /*!< COMP_VBAT_HIGH (Bit 12) */
-#define CRG_TOP_ANA_STATUS_REG_COMP_VBAT_HIGH_Msk (0x1000UL) /*!< COMP_VBAT_HIGH (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_COMP_VBAT_LOW_Pos (11UL) /*!< COMP_VBAT_LOW (Bit 11) */
-#define CRG_TOP_ANA_STATUS_REG_COMP_VBAT_LOW_Msk (0x800UL) /*!< COMP_VBAT_LOW (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_COMP_VDD_OK_Pos (10UL) /*!< COMP_VDD_OK (Bit 10) */
-#define CRG_TOP_ANA_STATUS_REG_COMP_VDD_OK_Msk (0x400UL) /*!< COMP_VDD_OK (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_VBUS_AVAILABLE_Pos (9UL) /*!< VBUS_AVAILABLE (Bit 9) */
-#define CRG_TOP_ANA_STATUS_REG_VBUS_AVAILABLE_Msk (0x200UL) /*!< VBUS_AVAILABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_BANDGAP_OK_Pos (8UL) /*!< BANDGAP_OK (Bit 8) */
-#define CRG_TOP_ANA_STATUS_REG_BANDGAP_OK_Msk (0x100UL) /*!< BANDGAP_OK (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_3V0_VBAT_OK_Pos (7UL) /*!< LDO_3V0_VBAT_OK (Bit 7) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_3V0_VBAT_OK_Msk (0x80UL) /*!< LDO_3V0_VBAT_OK (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_3V0_VBUS_OK_Pos (6UL) /*!< LDO_3V0_VBUS_OK (Bit 6) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_3V0_VBUS_OK_Msk (0x40UL) /*!< LDO_3V0_VBUS_OK (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_1V8P_OK_Pos (5UL) /*!< LDO_1V8P_OK (Bit 5) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_1V8P_OK_Msk (0x20UL) /*!< LDO_1V8P_OK (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_1V8_OK_Pos (4UL) /*!< LDO_1V8_OK (Bit 4) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_1V8_OK_Msk (0x10UL) /*!< LDO_1V8_OK (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_RADIO_OK_Pos (3UL) /*!< LDO_RADIO_OK (Bit 3) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_RADIO_OK_Msk (0x8UL) /*!< LDO_RADIO_OK (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_CORE_OK_Pos (2UL) /*!< LDO_CORE_OK (Bit 2) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_CORE_OK_Msk (0x4UL) /*!< LDO_CORE_OK (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_VDD_HIGH_OK_Pos (1UL) /*!< LDO_VDD_HIGH_OK (Bit 1) */
-#define CRG_TOP_ANA_STATUS_REG_LDO_VDD_HIGH_OK_Msk (0x2UL) /*!< LDO_VDD_HIGH_OK (Bitfield-Mask: 0x01) */
-#define CRG_TOP_ANA_STATUS_REG_BOD_VIN_NOK_Pos (0UL) /*!< BOD_VIN_NOK (Bit 0) */
-#define CRG_TOP_ANA_STATUS_REG_BOD_VIN_NOK_Msk (0x1UL) /*!< BOD_VIN_NOK (Bitfield-Mask: 0x01) */
-/* ====================================================== BANDGAP_REG ====================================================== */
-#define CRG_TOP_BANDGAP_REG_BANDGAP_ENABLE_CLAMP_Pos (12UL) /*!< BANDGAP_ENABLE_CLAMP (Bit 12) */
-#define CRG_TOP_BANDGAP_REG_BANDGAP_ENABLE_CLAMP_Msk (0x1000UL) /*!< BANDGAP_ENABLE_CLAMP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BANDGAP_REG_BGR_ITRIM_Pos (6UL) /*!< BGR_ITRIM (Bit 6) */
-#define CRG_TOP_BANDGAP_REG_BGR_ITRIM_Msk (0xfc0UL) /*!< BGR_ITRIM (Bitfield-Mask: 0x3f) */
-#define CRG_TOP_BANDGAP_REG_SYSRAM_LPMX_Pos (5UL) /*!< SYSRAM_LPMX (Bit 5) */
-#define CRG_TOP_BANDGAP_REG_SYSRAM_LPMX_Msk (0x20UL) /*!< SYSRAM_LPMX (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BANDGAP_REG_BGR_TRIM_Pos (0UL) /*!< BGR_TRIM (Bit 0) */
-#define CRG_TOP_BANDGAP_REG_BGR_TRIM_Msk (0x1fUL) /*!< BGR_TRIM (Bitfield-Mask: 0x1f) */
-/* =================================================== BIAS_VREF_SEL_REG =================================================== */
-#define CRG_TOP_BIAS_VREF_SEL_REG_BIAS_VREF_RF2_SEL_Pos (4UL) /*!< BIAS_VREF_RF2_SEL (Bit 4) */
-#define CRG_TOP_BIAS_VREF_SEL_REG_BIAS_VREF_RF2_SEL_Msk (0xf0UL) /*!< BIAS_VREF_RF2_SEL (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_BIAS_VREF_SEL_REG_BIAS_VREF_RF1_SEL_Pos (0UL) /*!< BIAS_VREF_RF1_SEL (Bit 0) */
-#define CRG_TOP_BIAS_VREF_SEL_REG_BIAS_VREF_RF1_SEL_Msk (0xfUL) /*!< BIAS_VREF_RF1_SEL (Bitfield-Mask: 0x0f) */
-/* ===================================================== BOD_CTRL_REG ====================================================== */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V14_RST_EN_Pos (16UL) /*!< BOD_V14_RST_EN (Bit 16) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V14_RST_EN_Msk (0x10000UL) /*!< BOD_V14_RST_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V18F_RST_EN_Pos (15UL) /*!< BOD_V18F_RST_EN (Bit 15) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V18F_RST_EN_Msk (0x8000UL) /*!< BOD_V18F_RST_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_VDD_RST_EN_Pos (14UL) /*!< BOD_VDD_RST_EN (Bit 14) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_VDD_RST_EN_Msk (0x4000UL) /*!< BOD_VDD_RST_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V18P_RST_EN_Pos (13UL) /*!< BOD_V18P_RST_EN (Bit 13) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V18P_RST_EN_Msk (0x2000UL) /*!< BOD_V18P_RST_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V18_RST_EN_Pos (12UL) /*!< BOD_V18_RST_EN (Bit 12) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V18_RST_EN_Msk (0x1000UL) /*!< BOD_V18_RST_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V30_RST_EN_Pos (11UL) /*!< BOD_V30_RST_EN (Bit 11) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V30_RST_EN_Msk (0x800UL) /*!< BOD_V30_RST_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_VBAT_RST_EN_Pos (10UL) /*!< BOD_VBAT_RST_EN (Bit 10) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_VBAT_RST_EN_Msk (0x400UL) /*!< BOD_VBAT_RST_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V14_EN_Pos (9UL) /*!< BOD_V14_EN (Bit 9) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V14_EN_Msk (0x200UL) /*!< BOD_V14_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V18F_EN_Pos (8UL) /*!< BOD_V18F_EN (Bit 8) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V18F_EN_Msk (0x100UL) /*!< BOD_V18F_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_VDD_EN_Pos (7UL) /*!< BOD_VDD_EN (Bit 7) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_VDD_EN_Msk (0x80UL) /*!< BOD_VDD_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V18P_EN_Pos (6UL) /*!< BOD_V18P_EN (Bit 6) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V18P_EN_Msk (0x40UL) /*!< BOD_V18P_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V18_EN_Pos (5UL) /*!< BOD_V18_EN (Bit 5) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V18_EN_Msk (0x20UL) /*!< BOD_V18_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V30_EN_Pos (4UL) /*!< BOD_V30_EN (Bit 4) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_V30_EN_Msk (0x10UL) /*!< BOD_V30_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_VBAT_EN_Pos (3UL) /*!< BOD_VBAT_EN (Bit 3) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_VBAT_EN_Msk (0x8UL) /*!< BOD_VBAT_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_STATUS_CLEAR_Pos (2UL) /*!< BOD_STATUS_CLEAR (Bit 2) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_STATUS_CLEAR_Msk (0x4UL) /*!< BOD_STATUS_CLEAR (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_CLK_DIV_Pos (0UL) /*!< BOD_CLK_DIV (Bit 0) */
-#define CRG_TOP_BOD_CTRL_REG_BOD_CLK_DIV_Msk (0x3UL) /*!< BOD_CLK_DIV (Bitfield-Mask: 0x03) */
-/* =================================================== BOD_LVL_CTRL0_REG =================================================== */
-#define CRG_TOP_BOD_LVL_CTRL0_REG_BOD_LVL_V18_Pos (18UL) /*!< BOD_LVL_V18 (Bit 18) */
-#define CRG_TOP_BOD_LVL_CTRL0_REG_BOD_LVL_V18_Msk (0x7fc0000UL) /*!< BOD_LVL_V18 (Bitfield-Mask: 0x1ff) */
-#define CRG_TOP_BOD_LVL_CTRL0_REG_BOD_LVL_V30_Pos (9UL) /*!< BOD_LVL_V30 (Bit 9) */
-#define CRG_TOP_BOD_LVL_CTRL0_REG_BOD_LVL_V30_Msk (0x3fe00UL) /*!< BOD_LVL_V30 (Bitfield-Mask: 0x1ff) */
-#define CRG_TOP_BOD_LVL_CTRL0_REG_BOD_LVL_VBAT_Pos (0UL) /*!< BOD_LVL_VBAT (Bit 0) */
-#define CRG_TOP_BOD_LVL_CTRL0_REG_BOD_LVL_VBAT_Msk (0x1ffUL) /*!< BOD_LVL_VBAT (Bitfield-Mask: 0x1ff) */
-/* =================================================== BOD_LVL_CTRL1_REG =================================================== */
-#define CRG_TOP_BOD_LVL_CTRL1_REG_BOD_LVL_VDD_RET_Pos (17UL) /*!< BOD_LVL_VDD_RET (Bit 17) */
-#define CRG_TOP_BOD_LVL_CTRL1_REG_BOD_LVL_VDD_RET_Msk (0x1fe0000UL) /*!< BOD_LVL_VDD_RET (Bitfield-Mask: 0xff) */
-#define CRG_TOP_BOD_LVL_CTRL1_REG_BOD_LVL_VDD_ON_Pos (9UL) /*!< BOD_LVL_VDD_ON (Bit 9) */
-#define CRG_TOP_BOD_LVL_CTRL1_REG_BOD_LVL_VDD_ON_Msk (0x1fe00UL) /*!< BOD_LVL_VDD_ON (Bitfield-Mask: 0xff) */
-#define CRG_TOP_BOD_LVL_CTRL1_REG_BOD_LVL_V18P_Pos (0UL) /*!< BOD_LVL_V18P (Bit 0) */
-#define CRG_TOP_BOD_LVL_CTRL1_REG_BOD_LVL_V18P_Msk (0x1ffUL) /*!< BOD_LVL_V18P (Bitfield-Mask: 0x1ff) */
-/* =================================================== BOD_LVL_CTRL2_REG =================================================== */
-#define CRG_TOP_BOD_LVL_CTRL2_REG_BOD_LVL_V14_Pos (9UL) /*!< BOD_LVL_V14 (Bit 9) */
-#define CRG_TOP_BOD_LVL_CTRL2_REG_BOD_LVL_V14_Msk (0x3fe00UL) /*!< BOD_LVL_V14 (Bitfield-Mask: 0x1ff) */
-#define CRG_TOP_BOD_LVL_CTRL2_REG_BOD_LVL_V18F_Pos (0UL) /*!< BOD_LVL_V18F (Bit 0) */
-#define CRG_TOP_BOD_LVL_CTRL2_REG_BOD_LVL_V18F_Msk (0x1ffUL) /*!< BOD_LVL_V18F (Bitfield-Mask: 0x1ff) */
-/* ==================================================== BOD_STATUS_REG ===================================================== */
-#define CRG_TOP_BOD_STATUS_REG_BOD_V14_Pos (6UL) /*!< BOD_V14 (Bit 6) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_V14_Msk (0x40UL) /*!< BOD_V14 (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_V18F_Pos (5UL) /*!< BOD_V18F (Bit 5) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_V18F_Msk (0x20UL) /*!< BOD_V18F (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_VDD_Pos (4UL) /*!< BOD_VDD (Bit 4) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_VDD_Msk (0x10UL) /*!< BOD_VDD (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_V18P_Pos (3UL) /*!< BOD_V18P (Bit 3) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_V18P_Msk (0x8UL) /*!< BOD_V18P (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_V18_Pos (2UL) /*!< BOD_V18 (Bit 2) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_V18_Msk (0x4UL) /*!< BOD_V18 (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_V30_Pos (1UL) /*!< BOD_V30 (Bit 1) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_V30_Msk (0x2UL) /*!< BOD_V30 (Bitfield-Mask: 0x01) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_VBAT_Pos (0UL) /*!< BOD_VBAT (Bit 0) */
-#define CRG_TOP_BOD_STATUS_REG_BOD_VBAT_Msk (0x1UL) /*!< BOD_VBAT (Bitfield-Mask: 0x01) */
-/* ===================================================== CLK_AMBA_REG ====================================================== */
-#define CRG_TOP_CLK_AMBA_REG_QSPI2_ENABLE_Pos (15UL) /*!< QSPI2_ENABLE (Bit 15) */
-#define CRG_TOP_CLK_AMBA_REG_QSPI2_ENABLE_Msk (0x8000UL) /*!< QSPI2_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_AMBA_REG_QSPI2_DIV_Pos (13UL) /*!< QSPI2_DIV (Bit 13) */
-#define CRG_TOP_CLK_AMBA_REG_QSPI2_DIV_Msk (0x6000UL) /*!< QSPI2_DIV (Bitfield-Mask: 0x03) */
-#define CRG_TOP_CLK_AMBA_REG_QSPI_ENABLE_Pos (12UL) /*!< QSPI_ENABLE (Bit 12) */
-#define CRG_TOP_CLK_AMBA_REG_QSPI_ENABLE_Msk (0x1000UL) /*!< QSPI_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_AMBA_REG_QSPI_DIV_Pos (10UL) /*!< QSPI_DIV (Bit 10) */
-#define CRG_TOP_CLK_AMBA_REG_QSPI_DIV_Msk (0xc00UL) /*!< QSPI_DIV (Bitfield-Mask: 0x03) */
-#define CRG_TOP_CLK_AMBA_REG_OTP_ENABLE_Pos (9UL) /*!< OTP_ENABLE (Bit 9) */
-#define CRG_TOP_CLK_AMBA_REG_OTP_ENABLE_Msk (0x200UL) /*!< OTP_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_AMBA_REG_TRNG_CLK_ENABLE_Pos (8UL) /*!< TRNG_CLK_ENABLE (Bit 8) */
-#define CRG_TOP_CLK_AMBA_REG_TRNG_CLK_ENABLE_Msk (0x100UL) /*!< TRNG_CLK_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_AMBA_REG_AES_CLK_ENABLE_Pos (6UL) /*!< AES_CLK_ENABLE (Bit 6) */
-#define CRG_TOP_CLK_AMBA_REG_AES_CLK_ENABLE_Msk (0x40UL) /*!< AES_CLK_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_AMBA_REG_PCLK_DIV_Pos (4UL) /*!< PCLK_DIV (Bit 4) */
-#define CRG_TOP_CLK_AMBA_REG_PCLK_DIV_Msk (0x30UL) /*!< PCLK_DIV (Bitfield-Mask: 0x03) */
-#define CRG_TOP_CLK_AMBA_REG_HCLK_DIV_Pos (0UL) /*!< HCLK_DIV (Bit 0) */
-#define CRG_TOP_CLK_AMBA_REG_HCLK_DIV_Msk (0x7UL) /*!< HCLK_DIV (Bitfield-Mask: 0x07) */
-/* ===================================================== CLK_CTRL_REG ====================================================== */
-#define CRG_TOP_CLK_CTRL_REG_RUNNING_AT_PLL96M_Pos (15UL) /*!< RUNNING_AT_PLL96M (Bit 15) */
-#define CRG_TOP_CLK_CTRL_REG_RUNNING_AT_PLL96M_Msk (0x8000UL) /*!< RUNNING_AT_PLL96M (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_CTRL_REG_RUNNING_AT_XTAL32M_Pos (14UL) /*!< RUNNING_AT_XTAL32M (Bit 14) */
-#define CRG_TOP_CLK_CTRL_REG_RUNNING_AT_XTAL32M_Msk (0x4000UL) /*!< RUNNING_AT_XTAL32M (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_CTRL_REG_RUNNING_AT_RC32M_Pos (13UL) /*!< RUNNING_AT_RC32M (Bit 13) */
-#define CRG_TOP_CLK_CTRL_REG_RUNNING_AT_RC32M_Msk (0x2000UL) /*!< RUNNING_AT_RC32M (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_CTRL_REG_RUNNING_AT_LP_CLK_Pos (12UL) /*!< RUNNING_AT_LP_CLK (Bit 12) */
-#define CRG_TOP_CLK_CTRL_REG_RUNNING_AT_LP_CLK_Msk (0x1000UL) /*!< RUNNING_AT_LP_CLK (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_CTRL_REG_USB_CLK_SRC_Pos (4UL) /*!< USB_CLK_SRC (Bit 4) */
-#define CRG_TOP_CLK_CTRL_REG_USB_CLK_SRC_Msk (0x10UL) /*!< USB_CLK_SRC (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_CTRL_REG_LP_CLK_SEL_Pos (2UL) /*!< LP_CLK_SEL (Bit 2) */
-#define CRG_TOP_CLK_CTRL_REG_LP_CLK_SEL_Msk (0xcUL) /*!< LP_CLK_SEL (Bitfield-Mask: 0x03) */
-#define CRG_TOP_CLK_CTRL_REG_SYS_CLK_SEL_Pos (0UL) /*!< SYS_CLK_SEL (Bit 0) */
-#define CRG_TOP_CLK_CTRL_REG_SYS_CLK_SEL_Msk (0x3UL) /*!< SYS_CLK_SEL (Bitfield-Mask: 0x03) */
-/* ===================================================== CLK_RADIO_REG ===================================================== */
-#define CRG_TOP_CLK_RADIO_REG_RFCU_ENABLE_Pos (5UL) /*!< RFCU_ENABLE (Bit 5) */
-#define CRG_TOP_CLK_RADIO_REG_RFCU_ENABLE_Msk (0x20UL) /*!< RFCU_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_RADIO_REG_CMAC_SYNCH_RESET_Pos (4UL) /*!< CMAC_SYNCH_RESET (Bit 4) */
-#define CRG_TOP_CLK_RADIO_REG_CMAC_SYNCH_RESET_Msk (0x10UL) /*!< CMAC_SYNCH_RESET (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_RADIO_REG_CMAC_CLK_SEL_Pos (3UL) /*!< CMAC_CLK_SEL (Bit 3) */
-#define CRG_TOP_CLK_RADIO_REG_CMAC_CLK_SEL_Msk (0x8UL) /*!< CMAC_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_RADIO_REG_CMAC_CLK_ENABLE_Pos (2UL) /*!< CMAC_CLK_ENABLE (Bit 2) */
-#define CRG_TOP_CLK_RADIO_REG_CMAC_CLK_ENABLE_Msk (0x4UL) /*!< CMAC_CLK_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_RADIO_REG_CMAC_DIV_Pos (0UL) /*!< CMAC_DIV (Bit 0) */
-#define CRG_TOP_CLK_RADIO_REG_CMAC_DIV_Msk (0x3UL) /*!< CMAC_DIV (Bitfield-Mask: 0x03) */
-/* ===================================================== CLK_RC32K_REG ===================================================== */
-#define CRG_TOP_CLK_RC32K_REG_RC32K_TRIM_Pos (1UL) /*!< RC32K_TRIM (Bit 1) */
-#define CRG_TOP_CLK_RC32K_REG_RC32K_TRIM_Msk (0x1eUL) /*!< RC32K_TRIM (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_CLK_RC32K_REG_RC32K_ENABLE_Pos (0UL) /*!< RC32K_ENABLE (Bit 0) */
-#define CRG_TOP_CLK_RC32K_REG_RC32K_ENABLE_Msk (0x1UL) /*!< RC32K_ENABLE (Bitfield-Mask: 0x01) */
-/* ===================================================== CLK_RC32M_REG ===================================================== */
-#define CRG_TOP_CLK_RC32M_REG_RC32M_INIT_RANGE_Pos (20UL) /*!< RC32M_INIT_RANGE (Bit 20) */
-#define CRG_TOP_CLK_RC32M_REG_RC32M_INIT_RANGE_Msk (0x300000UL) /*!< RC32M_INIT_RANGE (Bitfield-Mask: 0x03) */
-#define CRG_TOP_CLK_RC32M_REG_RC32M_INIT_DEL_Pos (12UL) /*!< RC32M_INIT_DEL (Bit 12) */
-#define CRG_TOP_CLK_RC32M_REG_RC32M_INIT_DEL_Msk (0xff000UL) /*!< RC32M_INIT_DEL (Bitfield-Mask: 0xff) */
-#define CRG_TOP_CLK_RC32M_REG_RC32M_INIT_DTCF_Pos (9UL) /*!< RC32M_INIT_DTCF (Bit 9) */
-#define CRG_TOP_CLK_RC32M_REG_RC32M_INIT_DTCF_Msk (0xe00UL) /*!< RC32M_INIT_DTCF (Bitfield-Mask: 0x07) */
-#define CRG_TOP_CLK_RC32M_REG_RC32M_INIT_DTC_Pos (5UL) /*!< RC32M_INIT_DTC (Bit 5) */
-#define CRG_TOP_CLK_RC32M_REG_RC32M_INIT_DTC_Msk (0x1e0UL) /*!< RC32M_INIT_DTC (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_CLK_RC32M_REG_RC32M_BIAS_Pos (1UL) /*!< RC32M_BIAS (Bit 1) */
-#define CRG_TOP_CLK_RC32M_REG_RC32M_BIAS_Msk (0x1eUL) /*!< RC32M_BIAS (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_CLK_RC32M_REG_RC32M_ENABLE_Pos (0UL) /*!< RC32M_ENABLE (Bit 0) */
-#define CRG_TOP_CLK_RC32M_REG_RC32M_ENABLE_Msk (0x1UL) /*!< RC32M_ENABLE (Bitfield-Mask: 0x01) */
-/* ====================================================== CLK_RCX_REG ====================================================== */
-#define CRG_TOP_CLK_RCX_REG_RCX_BIAS_Pos (8UL) /*!< RCX_BIAS (Bit 8) */
-#define CRG_TOP_CLK_RCX_REG_RCX_BIAS_Msk (0xf00UL) /*!< RCX_BIAS (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_CLK_RCX_REG_RCX_C0_Pos (7UL) /*!< RCX_C0 (Bit 7) */
-#define CRG_TOP_CLK_RCX_REG_RCX_C0_Msk (0x80UL) /*!< RCX_C0 (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_RCX_REG_RCX_CADJUST_Pos (2UL) /*!< RCX_CADJUST (Bit 2) */
-#define CRG_TOP_CLK_RCX_REG_RCX_CADJUST_Msk (0x7cUL) /*!< RCX_CADJUST (Bitfield-Mask: 0x1f) */
-#define CRG_TOP_CLK_RCX_REG_RCX_RADJUST_Pos (1UL) /*!< RCX_RADJUST (Bit 1) */
-#define CRG_TOP_CLK_RCX_REG_RCX_RADJUST_Msk (0x2UL) /*!< RCX_RADJUST (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_RCX_REG_RCX_ENABLE_Pos (0UL) /*!< RCX_ENABLE (Bit 0) */
-#define CRG_TOP_CLK_RCX_REG_RCX_ENABLE_Msk (0x1UL) /*!< RCX_ENABLE (Bitfield-Mask: 0x01) */
-/* ==================================================== CLK_RTCDIV_REG ===================================================== */
-#define CRG_TOP_CLK_RTCDIV_REG_RTC_RESET_REQ_Pos (21UL) /*!< RTC_RESET_REQ (Bit 21) */
-#define CRG_TOP_CLK_RTCDIV_REG_RTC_RESET_REQ_Msk (0x200000UL) /*!< RTC_RESET_REQ (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_RTCDIV_REG_RTC_DIV_ENABLE_Pos (20UL) /*!< RTC_DIV_ENABLE (Bit 20) */
-#define CRG_TOP_CLK_RTCDIV_REG_RTC_DIV_ENABLE_Msk (0x100000UL) /*!< RTC_DIV_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_RTCDIV_REG_RTC_DIV_DENOM_Pos (19UL) /*!< RTC_DIV_DENOM (Bit 19) */
-#define CRG_TOP_CLK_RTCDIV_REG_RTC_DIV_DENOM_Msk (0x80000UL) /*!< RTC_DIV_DENOM (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_RTCDIV_REG_RTC_DIV_INT_Pos (10UL) /*!< RTC_DIV_INT (Bit 10) */
-#define CRG_TOP_CLK_RTCDIV_REG_RTC_DIV_INT_Msk (0x7fc00UL) /*!< RTC_DIV_INT (Bitfield-Mask: 0x1ff) */
-#define CRG_TOP_CLK_RTCDIV_REG_RTC_DIV_FRAC_Pos (0UL) /*!< RTC_DIV_FRAC (Bit 0) */
-#define CRG_TOP_CLK_RTCDIV_REG_RTC_DIV_FRAC_Msk (0x3ffUL) /*!< RTC_DIV_FRAC (Bitfield-Mask: 0x3ff) */
-/* ================================================== CLK_SWITCH2XTAL_REG ================================================== */
-#define CRG_TOP_CLK_SWITCH2XTAL_REG_SWITCH2XTAL_Pos (0UL) /*!< SWITCH2XTAL (Bit 0) */
-#define CRG_TOP_CLK_SWITCH2XTAL_REG_SWITCH2XTAL_Msk (0x1UL) /*!< SWITCH2XTAL (Bitfield-Mask: 0x01) */
-/* ====================================================== CLK_TMR_REG ====================================================== */
-#define CRG_TOP_CLK_TMR_REG_TMR2_PWM_AON_MODE_Pos (2UL) /*!< TMR2_PWM_AON_MODE (Bit 2) */
-#define CRG_TOP_CLK_TMR_REG_TMR2_PWM_AON_MODE_Msk (0x4UL) /*!< TMR2_PWM_AON_MODE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_TMR_REG_TMR_PWM_AON_MODE_Pos (1UL) /*!< TMR_PWM_AON_MODE (Bit 1) */
-#define CRG_TOP_CLK_TMR_REG_TMR_PWM_AON_MODE_Msk (0x2UL) /*!< TMR_PWM_AON_MODE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_TMR_REG_WAKEUPCT_ENABLE_Pos (0UL) /*!< WAKEUPCT_ENABLE (Bit 0) */
-#define CRG_TOP_CLK_TMR_REG_WAKEUPCT_ENABLE_Msk (0x1UL) /*!< WAKEUPCT_ENABLE (Bitfield-Mask: 0x01) */
-/* ==================================================== CLK_XTAL32K_REG ==================================================== */
-#define CRG_TOP_CLK_XTAL32K_REG_XTAL32K_DISABLE_OUTPUT_Pos (9UL) /*!< XTAL32K_DISABLE_OUTPUT (Bit 9) */
-#define CRG_TOP_CLK_XTAL32K_REG_XTAL32K_DISABLE_OUTPUT_Msk (0x200UL) /*!< XTAL32K_DISABLE_OUTPUT (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_XTAL32K_REG_XTAL32K_DISABLE_AMPREG_Pos (7UL) /*!< XTAL32K_DISABLE_AMPREG (Bit 7) */
-#define CRG_TOP_CLK_XTAL32K_REG_XTAL32K_DISABLE_AMPREG_Msk (0x80UL) /*!< XTAL32K_DISABLE_AMPREG (Bitfield-Mask: 0x01) */
-#define CRG_TOP_CLK_XTAL32K_REG_XTAL32K_CUR_Pos (3UL) /*!< XTAL32K_CUR (Bit 3) */
-#define CRG_TOP_CLK_XTAL32K_REG_XTAL32K_CUR_Msk (0x78UL) /*!< XTAL32K_CUR (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_CLK_XTAL32K_REG_XTAL32K_RBIAS_Pos (1UL) /*!< XTAL32K_RBIAS (Bit 1) */
-#define CRG_TOP_CLK_XTAL32K_REG_XTAL32K_RBIAS_Msk (0x6UL) /*!< XTAL32K_RBIAS (Bitfield-Mask: 0x03) */
-#define CRG_TOP_CLK_XTAL32K_REG_XTAL32K_ENABLE_Pos (0UL) /*!< XTAL32K_ENABLE (Bit 0) */
-#define CRG_TOP_CLK_XTAL32K_REG_XTAL32K_ENABLE_Msk (0x1UL) /*!< XTAL32K_ENABLE (Bitfield-Mask: 0x01) */
-/* ================================================== DISCHARGE_RAIL_REG =================================================== */
-#define CRG_TOP_DISCHARGE_RAIL_REG_RESET_V18P_Pos (2UL) /*!< RESET_V18P (Bit 2) */
-#define CRG_TOP_DISCHARGE_RAIL_REG_RESET_V18P_Msk (0x4UL) /*!< RESET_V18P (Bitfield-Mask: 0x01) */
-#define CRG_TOP_DISCHARGE_RAIL_REG_RESET_V18_Pos (1UL) /*!< RESET_V18 (Bit 1) */
-#define CRG_TOP_DISCHARGE_RAIL_REG_RESET_V18_Msk (0x2UL) /*!< RESET_V18 (Bitfield-Mask: 0x01) */
-#define CRG_TOP_DISCHARGE_RAIL_REG_RESET_V14_Pos (0UL) /*!< RESET_V14 (Bit 0) */
-#define CRG_TOP_DISCHARGE_RAIL_REG_RESET_V14_Msk (0x1UL) /*!< RESET_V14 (Bitfield-Mask: 0x01) */
-/* ================================================ LDO_VDDD_HIGH_CTRL_REG ================================================= */
-#define CRG_TOP_LDO_VDDD_HIGH_CTRL_REG_LDO_VDDD_HIGH_LOW_ZOUT_DISABLE_Pos (3UL) /*!< LDO_VDDD_HIGH_LOW_ZOUT_DISABLE (Bit 3) */
-#define CRG_TOP_LDO_VDDD_HIGH_CTRL_REG_LDO_VDDD_HIGH_LOW_ZOUT_DISABLE_Msk (0x8UL) /*!< LDO_VDDD_HIGH_LOW_ZOUT_DISABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_LDO_VDDD_HIGH_CTRL_REG_LDO_VDDD_HIGH_STATIC_LOAD_ENABLE_Pos (2UL) /*!< LDO_VDDD_HIGH_STATIC_LOAD_ENABLE (Bit 2) */
-#define CRG_TOP_LDO_VDDD_HIGH_CTRL_REG_LDO_VDDD_HIGH_STATIC_LOAD_ENABLE_Msk (0x4UL) /*!< LDO_VDDD_HIGH_STATIC_LOAD_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_LDO_VDDD_HIGH_CTRL_REG_LDO_VDDD_HIGH_ENABLE_Pos (1UL) /*!< LDO_VDDD_HIGH_ENABLE (Bit 1) */
-#define CRG_TOP_LDO_VDDD_HIGH_CTRL_REG_LDO_VDDD_HIGH_ENABLE_Msk (0x2UL) /*!< LDO_VDDD_HIGH_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_LDO_VDDD_HIGH_CTRL_REG_LDO_VDDD_HIGH_VREF_HOLD_Pos (0UL) /*!< LDO_VDDD_HIGH_VREF_HOLD (Bit 0) */
-#define CRG_TOP_LDO_VDDD_HIGH_CTRL_REG_LDO_VDDD_HIGH_VREF_HOLD_Msk (0x1UL) /*!< LDO_VDDD_HIGH_VREF_HOLD (Bitfield-Mask: 0x01) */
-/* =================================================== P0_PAD_LATCH_REG ==================================================== */
-#define CRG_TOP_P0_PAD_LATCH_REG_P0_LATCH_EN_Pos (0UL) /*!< P0_LATCH_EN (Bit 0) */
-#define CRG_TOP_P0_PAD_LATCH_REG_P0_LATCH_EN_Msk (0xffffffffUL) /*!< P0_LATCH_EN (Bitfield-Mask: 0xffffffff) */
-/* ================================================ P0_RESET_PAD_LATCH_REG ================================================= */
-#define CRG_TOP_P0_RESET_PAD_LATCH_REG_P0_RESET_LATCH_EN_Pos (0UL) /*!< P0_RESET_LATCH_EN (Bit 0) */
-#define CRG_TOP_P0_RESET_PAD_LATCH_REG_P0_RESET_LATCH_EN_Msk (0xffffffffUL) /*!< P0_RESET_LATCH_EN (Bitfield-Mask: 0xffffffff) */
-/* ================================================= P0_SET_PAD_LATCH_REG ================================================== */
-#define CRG_TOP_P0_SET_PAD_LATCH_REG_P0_SET_LATCH_EN_Pos (0UL) /*!< P0_SET_LATCH_EN (Bit 0) */
-#define CRG_TOP_P0_SET_PAD_LATCH_REG_P0_SET_LATCH_EN_Msk (0xffffffffUL) /*!< P0_SET_LATCH_EN (Bitfield-Mask: 0xffffffff) */
-/* =================================================== P1_PAD_LATCH_REG ==================================================== */
-#define CRG_TOP_P1_PAD_LATCH_REG_P1_LATCH_EN_Pos (0UL) /*!< P1_LATCH_EN (Bit 0) */
-#define CRG_TOP_P1_PAD_LATCH_REG_P1_LATCH_EN_Msk (0x7fffffUL) /*!< P1_LATCH_EN (Bitfield-Mask: 0x7fffff) */
-/* ================================================ P1_RESET_PAD_LATCH_REG ================================================= */
-#define CRG_TOP_P1_RESET_PAD_LATCH_REG_P1_RESET_LATCH_EN_Pos (0UL) /*!< P1_RESET_LATCH_EN (Bit 0) */
-#define CRG_TOP_P1_RESET_PAD_LATCH_REG_P1_RESET_LATCH_EN_Msk (0x7fffffUL) /*!< P1_RESET_LATCH_EN (Bitfield-Mask: 0x7fffff) */
-/* ================================================= P1_SET_PAD_LATCH_REG ================================================== */
-#define CRG_TOP_P1_SET_PAD_LATCH_REG_P1_SET_LATCH_EN_Pos (0UL) /*!< P1_SET_LATCH_EN (Bit 0) */
-#define CRG_TOP_P1_SET_PAD_LATCH_REG_P1_SET_LATCH_EN_Msk (0x7fffffUL) /*!< P1_SET_LATCH_EN (Bitfield-Mask: 0x7fffff) */
-/* ===================================================== PMU_CTRL_REG ====================================================== */
-#define CRG_TOP_PMU_CTRL_REG_ENABLE_CLKLESS_Pos (8UL) /*!< ENABLE_CLKLESS (Bit 8) */
-#define CRG_TOP_PMU_CTRL_REG_ENABLE_CLKLESS_Msk (0x100UL) /*!< ENABLE_CLKLESS (Bitfield-Mask: 0x01) */
-#define CRG_TOP_PMU_CTRL_REG_RETAIN_CACHE_Pos (7UL) /*!< RETAIN_CACHE (Bit 7) */
-#define CRG_TOP_PMU_CTRL_REG_RETAIN_CACHE_Msk (0x80UL) /*!< RETAIN_CACHE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_PMU_CTRL_REG_SYS_SLEEP_Pos (6UL) /*!< SYS_SLEEP (Bit 6) */
-#define CRG_TOP_PMU_CTRL_REG_SYS_SLEEP_Msk (0x40UL) /*!< SYS_SLEEP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_PMU_CTRL_REG_RESET_ON_WAKEUP_Pos (5UL) /*!< RESET_ON_WAKEUP (Bit 5) */
-#define CRG_TOP_PMU_CTRL_REG_RESET_ON_WAKEUP_Msk (0x20UL) /*!< RESET_ON_WAKEUP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_PMU_CTRL_REG_MAP_BANDGAP_EN_Pos (4UL) /*!< MAP_BANDGAP_EN (Bit 4) */
-#define CRG_TOP_PMU_CTRL_REG_MAP_BANDGAP_EN_Msk (0x10UL) /*!< MAP_BANDGAP_EN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_PMU_CTRL_REG_COM_SLEEP_Pos (3UL) /*!< COM_SLEEP (Bit 3) */
-#define CRG_TOP_PMU_CTRL_REG_COM_SLEEP_Msk (0x8UL) /*!< COM_SLEEP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_PMU_CTRL_REG_TIM_SLEEP_Pos (2UL) /*!< TIM_SLEEP (Bit 2) */
-#define CRG_TOP_PMU_CTRL_REG_TIM_SLEEP_Msk (0x4UL) /*!< TIM_SLEEP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_PMU_CTRL_REG_RADIO_SLEEP_Pos (1UL) /*!< RADIO_SLEEP (Bit 1) */
-#define CRG_TOP_PMU_CTRL_REG_RADIO_SLEEP_Msk (0x2UL) /*!< RADIO_SLEEP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_PMU_CTRL_REG_PERIPH_SLEEP_Pos (0UL) /*!< PERIPH_SLEEP (Bit 0) */
-#define CRG_TOP_PMU_CTRL_REG_PERIPH_SLEEP_Msk (0x1UL) /*!< PERIPH_SLEEP (Bitfield-Mask: 0x01) */
-/* ===================================================== PMU_SLEEP_REG ===================================================== */
-#define CRG_TOP_PMU_SLEEP_REG_CLAMP_VDD_WKUP_MAX_Pos (18UL) /*!< CLAMP_VDD_WKUP_MAX (Bit 18) */
-#define CRG_TOP_PMU_SLEEP_REG_CLAMP_VDD_WKUP_MAX_Msk (0x40000UL) /*!< CLAMP_VDD_WKUP_MAX (Bitfield-Mask: 0x01) */
-#define CRG_TOP_PMU_SLEEP_REG_ULTRA_FAST_WAKEUP_Pos (17UL) /*!< ULTRA_FAST_WAKEUP (Bit 17) */
-#define CRG_TOP_PMU_SLEEP_REG_ULTRA_FAST_WAKEUP_Msk (0x20000UL) /*!< ULTRA_FAST_WAKEUP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_PMU_SLEEP_REG_FAST_WAKEUP_Pos (16UL) /*!< FAST_WAKEUP (Bit 16) */
-#define CRG_TOP_PMU_SLEEP_REG_FAST_WAKEUP_Msk (0x10000UL) /*!< FAST_WAKEUP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_PMU_SLEEP_REG_BOD_SLEEP_INTERVAL_Pos (12UL) /*!< BOD_SLEEP_INTERVAL (Bit 12) */
-#define CRG_TOP_PMU_SLEEP_REG_BOD_SLEEP_INTERVAL_Msk (0xf000UL) /*!< BOD_SLEEP_INTERVAL (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_PMU_SLEEP_REG_BG_REFRESH_INTERVAL_Pos (0UL) /*!< BG_REFRESH_INTERVAL (Bit 0) */
-#define CRG_TOP_PMU_SLEEP_REG_BG_REFRESH_INTERVAL_Msk (0xfffUL) /*!< BG_REFRESH_INTERVAL (Bitfield-Mask: 0xfff) */
-/* ===================================================== PMU_TRIM_REG ====================================================== */
-#define CRG_TOP_PMU_TRIM_REG_LDO_1V8_TRIM_Pos (12UL) /*!< LDO_1V8_TRIM (Bit 12) */
-#define CRG_TOP_PMU_TRIM_REG_LDO_1V8_TRIM_Msk (0xf000UL) /*!< LDO_1V8_TRIM (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_PMU_TRIM_REG_LDO_1V8P_TRIM_Pos (8UL) /*!< LDO_1V8P_TRIM (Bit 8) */
-#define CRG_TOP_PMU_TRIM_REG_LDO_1V8P_TRIM_Msk (0xf00UL) /*!< LDO_1V8P_TRIM (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_PMU_TRIM_REG_LDO_SUPPLY_VBAT_TRIM_Pos (4UL) /*!< LDO_SUPPLY_VBAT_TRIM (Bit 4) */
-#define CRG_TOP_PMU_TRIM_REG_LDO_SUPPLY_VBAT_TRIM_Msk (0xf0UL) /*!< LDO_SUPPLY_VBAT_TRIM (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_PMU_TRIM_REG_LDO_SUPPLY_VBUS_TRIM_Pos (0UL) /*!< LDO_SUPPLY_VBUS_TRIM (Bit 0) */
-#define CRG_TOP_PMU_TRIM_REG_LDO_SUPPLY_VBUS_TRIM_Msk (0xfUL) /*!< LDO_SUPPLY_VBUS_TRIM (Bitfield-Mask: 0x0f) */
-/* ====================================================== POR_PIN_REG ====================================================== */
-#define CRG_TOP_POR_PIN_REG_POR_PIN_POLARITY_Pos (7UL) /*!< POR_PIN_POLARITY (Bit 7) */
-#define CRG_TOP_POR_PIN_REG_POR_PIN_POLARITY_Msk (0x80UL) /*!< POR_PIN_POLARITY (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POR_PIN_REG_POR_PIN_SELECT_Pos (0UL) /*!< POR_PIN_SELECT (Bit 0) */
-#define CRG_TOP_POR_PIN_REG_POR_PIN_SELECT_Msk (0x3fUL) /*!< POR_PIN_SELECT (Bitfield-Mask: 0x3f) */
-/* ===================================================== POR_TIMER_REG ===================================================== */
-#define CRG_TOP_POR_TIMER_REG_POR_TIME_Pos (0UL) /*!< POR_TIME (Bit 0) */
-#define CRG_TOP_POR_TIMER_REG_POR_TIME_Msk (0x7fUL) /*!< POR_TIME (Bitfield-Mask: 0x7f) */
-/* =================================================== POR_VBAT_CTRL_REG =================================================== */
-#define CRG_TOP_POR_VBAT_CTRL_REG_POR_VBAT_MASK_N_Pos (13UL) /*!< POR_VBAT_MASK_N (Bit 13) */
-#define CRG_TOP_POR_VBAT_CTRL_REG_POR_VBAT_MASK_N_Msk (0x2000UL) /*!< POR_VBAT_MASK_N (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POR_VBAT_CTRL_REG_POR_VBAT_ENABLE_Pos (12UL) /*!< POR_VBAT_ENABLE (Bit 12) */
-#define CRG_TOP_POR_VBAT_CTRL_REG_POR_VBAT_ENABLE_Msk (0x1000UL) /*!< POR_VBAT_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POR_VBAT_CTRL_REG_POR_VBAT_HYST_LOW_Pos (8UL) /*!< POR_VBAT_HYST_LOW (Bit 8) */
-#define CRG_TOP_POR_VBAT_CTRL_REG_POR_VBAT_HYST_LOW_Msk (0xf00UL) /*!< POR_VBAT_HYST_LOW (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_POR_VBAT_CTRL_REG_POR_VBAT_THRES_HIGH_Pos (4UL) /*!< POR_VBAT_THRES_HIGH (Bit 4) */
-#define CRG_TOP_POR_VBAT_CTRL_REG_POR_VBAT_THRES_HIGH_Msk (0xf0UL) /*!< POR_VBAT_THRES_HIGH (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_POR_VBAT_CTRL_REG_POR_VBAT_THRES_LOW_Pos (0UL) /*!< POR_VBAT_THRES_LOW (Bit 0) */
-#define CRG_TOP_POR_VBAT_CTRL_REG_POR_VBAT_THRES_LOW_Msk (0xfUL) /*!< POR_VBAT_THRES_LOW (Bitfield-Mask: 0x0f) */
-/* ==================================================== POWER_CTRL_REG ===================================================== */
-#define CRG_TOP_POWER_CTRL_REG_VDD_SLEEP_LEVEL_Pos (29UL) /*!< VDD_SLEEP_LEVEL (Bit 29) */
-#define CRG_TOP_POWER_CTRL_REG_VDD_SLEEP_LEVEL_Msk (0xe0000000UL) /*!< VDD_SLEEP_LEVEL (Bitfield-Mask: 0x07) */
-#define CRG_TOP_POWER_CTRL_REG_VDD_CLAMP_LEVEL_Pos (25UL) /*!< VDD_CLAMP_LEVEL (Bit 25) */
-#define CRG_TOP_POWER_CTRL_REG_VDD_CLAMP_LEVEL_Msk (0x1e000000UL) /*!< VDD_CLAMP_LEVEL (Bitfield-Mask: 0x0f) */
-#define CRG_TOP_POWER_CTRL_REG_CLAMP_3V0_VBAT_ENABLE_Pos (24UL) /*!< CLAMP_3V0_VBAT_ENABLE (Bit 24) */
-#define CRG_TOP_POWER_CTRL_REG_CLAMP_3V0_VBAT_ENABLE_Msk (0x1000000UL) /*!< CLAMP_3V0_VBAT_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_V18_LEVEL_Pos (23UL) /*!< V18_LEVEL (Bit 23) */
-#define CRG_TOP_POWER_CTRL_REG_V18_LEVEL_Msk (0x800000UL) /*!< V18_LEVEL (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_V14_LEVEL_Pos (20UL) /*!< V14_LEVEL (Bit 20) */
-#define CRG_TOP_POWER_CTRL_REG_V14_LEVEL_Msk (0x700000UL) /*!< V14_LEVEL (Bitfield-Mask: 0x07) */
-#define CRG_TOP_POWER_CTRL_REG_V30_LEVEL_Pos (18UL) /*!< V30_LEVEL (Bit 18) */
-#define CRG_TOP_POWER_CTRL_REG_V30_LEVEL_Msk (0xc0000UL) /*!< V30_LEVEL (Bitfield-Mask: 0x03) */
-#define CRG_TOP_POWER_CTRL_REG_VDD_LEVEL_Pos (16UL) /*!< VDD_LEVEL (Bit 16) */
-#define CRG_TOP_POWER_CTRL_REG_VDD_LEVEL_Msk (0x30000UL) /*!< VDD_LEVEL (Bitfield-Mask: 0x03) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_3V0_REF_Pos (15UL) /*!< LDO_3V0_REF (Bit 15) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_3V0_REF_Msk (0x8000UL) /*!< LDO_3V0_REF (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_CORE_RET_ENABLE_SLEEP_Pos (14UL) /*!< LDO_CORE_RET_ENABLE_SLEEP (Bit 14) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_CORE_RET_ENABLE_SLEEP_Msk (0x4000UL) /*!< LDO_CORE_RET_ENABLE_SLEEP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_CORE_RET_ENABLE_ACTIVE_Pos (13UL) /*!< LDO_CORE_RET_ENABLE_ACTIVE (Bit 13) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_CORE_RET_ENABLE_ACTIVE_Msk (0x2000UL) /*!< LDO_CORE_RET_ENABLE_ACTIVE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_CORE_ENABLE_Pos (12UL) /*!< LDO_CORE_ENABLE (Bit 12) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_CORE_ENABLE_Msk (0x1000UL) /*!< LDO_CORE_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_3V0_RET_ENABLE_SLEEP_Pos (11UL) /*!< LDO_3V0_RET_ENABLE_SLEEP (Bit 11) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_3V0_RET_ENABLE_SLEEP_Msk (0x800UL) /*!< LDO_3V0_RET_ENABLE_SLEEP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_3V0_RET_ENABLE_ACTIVE_Pos (10UL) /*!< LDO_3V0_RET_ENABLE_ACTIVE (Bit 10) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_3V0_RET_ENABLE_ACTIVE_Msk (0x400UL) /*!< LDO_3V0_RET_ENABLE_ACTIVE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_3V0_MODE_Pos (8UL) /*!< LDO_3V0_MODE (Bit 8) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_3V0_MODE_Msk (0x300UL) /*!< LDO_3V0_MODE (Bitfield-Mask: 0x03) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_RADIO_ENABLE_Pos (7UL) /*!< LDO_RADIO_ENABLE (Bit 7) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_RADIO_ENABLE_Msk (0x80UL) /*!< LDO_RADIO_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_1V8_RET_ENABLE_SLEEP_Pos (6UL) /*!< LDO_1V8_RET_ENABLE_SLEEP (Bit 6) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_1V8_RET_ENABLE_SLEEP_Msk (0x40UL) /*!< LDO_1V8_RET_ENABLE_SLEEP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_1V8_RET_ENABLE_ACTIVE_Pos (5UL) /*!< LDO_1V8_RET_ENABLE_ACTIVE (Bit 5) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_1V8_RET_ENABLE_ACTIVE_Msk (0x20UL) /*!< LDO_1V8_RET_ENABLE_ACTIVE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_1V8_ENABLE_Pos (4UL) /*!< LDO_1V8_ENABLE (Bit 4) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_1V8_ENABLE_Msk (0x10UL) /*!< LDO_1V8_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_SW_1V8F_ENABLE_FORCE_Pos (3UL) /*!< SW_1V8F_ENABLE_FORCE (Bit 3) */
-#define CRG_TOP_POWER_CTRL_REG_SW_1V8F_ENABLE_FORCE_Msk (0x8UL) /*!< SW_1V8F_ENABLE_FORCE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_1V8P_RET_ENABLE_SLEEP_Pos (2UL) /*!< LDO_1V8P_RET_ENABLE_SLEEP (Bit 2) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_1V8P_RET_ENABLE_SLEEP_Msk (0x4UL) /*!< LDO_1V8P_RET_ENABLE_SLEEP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_1V8P_RET_ENABLE_ACTIVE_Pos (1UL) /*!< LDO_1V8P_RET_ENABLE_ACTIVE (Bit 1) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_1V8P_RET_ENABLE_ACTIVE_Msk (0x2UL) /*!< LDO_1V8P_RET_ENABLE_ACTIVE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_1V8P_ENABLE_Pos (0UL) /*!< LDO_1V8P_ENABLE (Bit 0) */
-#define CRG_TOP_POWER_CTRL_REG_LDO_1V8P_ENABLE_Msk (0x1UL) /*!< LDO_1V8P_ENABLE (Bitfield-Mask: 0x01) */
-/* =================================================== RAM_PWR_CTRL_REG ==================================================== */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM8_PWR_CTRL_Pos (14UL) /*!< RAM8_PWR_CTRL (Bit 14) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM8_PWR_CTRL_Msk (0xc000UL) /*!< RAM8_PWR_CTRL (Bitfield-Mask: 0x03) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM7_PWR_CTRL_Pos (12UL) /*!< RAM7_PWR_CTRL (Bit 12) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM7_PWR_CTRL_Msk (0x3000UL) /*!< RAM7_PWR_CTRL (Bitfield-Mask: 0x03) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM6_PWR_CTRL_Pos (10UL) /*!< RAM6_PWR_CTRL (Bit 10) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM6_PWR_CTRL_Msk (0xc00UL) /*!< RAM6_PWR_CTRL (Bitfield-Mask: 0x03) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM5_PWR_CTRL_Pos (8UL) /*!< RAM5_PWR_CTRL (Bit 8) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM5_PWR_CTRL_Msk (0x300UL) /*!< RAM5_PWR_CTRL (Bitfield-Mask: 0x03) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM4_PWR_CTRL_Pos (6UL) /*!< RAM4_PWR_CTRL (Bit 6) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM4_PWR_CTRL_Msk (0xc0UL) /*!< RAM4_PWR_CTRL (Bitfield-Mask: 0x03) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM3_PWR_CTRL_Pos (4UL) /*!< RAM3_PWR_CTRL (Bit 4) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM3_PWR_CTRL_Msk (0x30UL) /*!< RAM3_PWR_CTRL (Bitfield-Mask: 0x03) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM2_PWR_CTRL_Pos (2UL) /*!< RAM2_PWR_CTRL (Bit 2) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM2_PWR_CTRL_Msk (0xcUL) /*!< RAM2_PWR_CTRL (Bitfield-Mask: 0x03) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM1_PWR_CTRL_Pos (0UL) /*!< RAM1_PWR_CTRL (Bit 0) */
-#define CRG_TOP_RAM_PWR_CTRL_REG_RAM1_PWR_CTRL_Msk (0x3UL) /*!< RAM1_PWR_CTRL (Bitfield-Mask: 0x03) */
-/* ==================================================== RESET_STAT_REG ===================================================== */
-#define CRG_TOP_RESET_STAT_REG_CMAC_WDOGRESET_STAT_Pos (5UL) /*!< CMAC_WDOGRESET_STAT (Bit 5) */
-#define CRG_TOP_RESET_STAT_REG_CMAC_WDOGRESET_STAT_Msk (0x20UL) /*!< CMAC_WDOGRESET_STAT (Bitfield-Mask: 0x01) */
-#define CRG_TOP_RESET_STAT_REG_SWD_HWRESET_STAT_Pos (4UL) /*!< SWD_HWRESET_STAT (Bit 4) */
-#define CRG_TOP_RESET_STAT_REG_SWD_HWRESET_STAT_Msk (0x10UL) /*!< SWD_HWRESET_STAT (Bitfield-Mask: 0x01) */
-#define CRG_TOP_RESET_STAT_REG_WDOGRESET_STAT_Pos (3UL) /*!< WDOGRESET_STAT (Bit 3) */
-#define CRG_TOP_RESET_STAT_REG_WDOGRESET_STAT_Msk (0x8UL) /*!< WDOGRESET_STAT (Bitfield-Mask: 0x01) */
-#define CRG_TOP_RESET_STAT_REG_SWRESET_STAT_Pos (2UL) /*!< SWRESET_STAT (Bit 2) */
-#define CRG_TOP_RESET_STAT_REG_SWRESET_STAT_Msk (0x4UL) /*!< SWRESET_STAT (Bitfield-Mask: 0x01) */
-#define CRG_TOP_RESET_STAT_REG_HWRESET_STAT_Pos (1UL) /*!< HWRESET_STAT (Bit 1) */
-#define CRG_TOP_RESET_STAT_REG_HWRESET_STAT_Msk (0x2UL) /*!< HWRESET_STAT (Bitfield-Mask: 0x01) */
-#define CRG_TOP_RESET_STAT_REG_PORESET_STAT_Pos (0UL) /*!< PORESET_STAT (Bit 0) */
-#define CRG_TOP_RESET_STAT_REG_PORESET_STAT_Msk (0x1UL) /*!< PORESET_STAT (Bitfield-Mask: 0x01) */
-/* ==================================================== SECURE_BOOT_REG ==================================================== */
-#define CRG_TOP_SECURE_BOOT_REG_PROT_QSPI_KEY_READ_Pos (7UL) /*!< PROT_QSPI_KEY_READ (Bit 7) */
-#define CRG_TOP_SECURE_BOOT_REG_PROT_QSPI_KEY_READ_Msk (0x80UL) /*!< PROT_QSPI_KEY_READ (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SECURE_BOOT_REG_PROT_QSPI_KEY_WRITE_Pos (6UL) /*!< PROT_QSPI_KEY_WRITE (Bit 6) */
-#define CRG_TOP_SECURE_BOOT_REG_PROT_QSPI_KEY_WRITE_Msk (0x40UL) /*!< PROT_QSPI_KEY_WRITE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SECURE_BOOT_REG_PROT_AES_KEY_READ_Pos (5UL) /*!< PROT_AES_KEY_READ (Bit 5) */
-#define CRG_TOP_SECURE_BOOT_REG_PROT_AES_KEY_READ_Msk (0x20UL) /*!< PROT_AES_KEY_READ (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SECURE_BOOT_REG_PROT_AES_KEY_WRITE_Pos (4UL) /*!< PROT_AES_KEY_WRITE (Bit 4) */
-#define CRG_TOP_SECURE_BOOT_REG_PROT_AES_KEY_WRITE_Msk (0x10UL) /*!< PROT_AES_KEY_WRITE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SECURE_BOOT_REG_PROT_SIG_KEY_WRITE_Pos (3UL) /*!< PROT_SIG_KEY_WRITE (Bit 3) */
-#define CRG_TOP_SECURE_BOOT_REG_PROT_SIG_KEY_WRITE_Msk (0x8UL) /*!< PROT_SIG_KEY_WRITE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SECURE_BOOT_REG_FORCE_CMAC_DEBUGGER_OFF_Pos (2UL) /*!< FORCE_CMAC_DEBUGGER_OFF (Bit 2) */
-#define CRG_TOP_SECURE_BOOT_REG_FORCE_CMAC_DEBUGGER_OFF_Msk (0x4UL) /*!< FORCE_CMAC_DEBUGGER_OFF (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SECURE_BOOT_REG_FORCE_DEBUGGER_OFF_Pos (1UL) /*!< FORCE_DEBUGGER_OFF (Bit 1) */
-#define CRG_TOP_SECURE_BOOT_REG_FORCE_DEBUGGER_OFF_Msk (0x2UL) /*!< FORCE_DEBUGGER_OFF (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SECURE_BOOT_REG_SECURE_BOOT_Pos (0UL) /*!< SECURE_BOOT (Bit 0) */
-#define CRG_TOP_SECURE_BOOT_REG_SECURE_BOOT_Msk (0x1UL) /*!< SECURE_BOOT (Bitfield-Mask: 0x01) */
-/* ===================================================== SYS_CTRL_REG ====================================================== */
-#define CRG_TOP_SYS_CTRL_REG_SW_RESET_Pos (15UL) /*!< SW_RESET (Bit 15) */
-#define CRG_TOP_SYS_CTRL_REG_SW_RESET_Msk (0x8000UL) /*!< SW_RESET (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_CTRL_REG_CACHERAM_MUX_Pos (10UL) /*!< CACHERAM_MUX (Bit 10) */
-#define CRG_TOP_SYS_CTRL_REG_CACHERAM_MUX_Msk (0x400UL) /*!< CACHERAM_MUX (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_CTRL_REG_TIMEOUT_DISABLE_Pos (9UL) /*!< TIMEOUT_DISABLE (Bit 9) */
-#define CRG_TOP_SYS_CTRL_REG_TIMEOUT_DISABLE_Msk (0x200UL) /*!< TIMEOUT_DISABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_CTRL_REG_DEBUGGER_ENABLE_Pos (7UL) /*!< DEBUGGER_ENABLE (Bit 7) */
-#define CRG_TOP_SYS_CTRL_REG_DEBUGGER_ENABLE_Msk (0x80UL) /*!< DEBUGGER_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_CTRL_REG_QSPI_INIT_Pos (4UL) /*!< QSPI_INIT (Bit 4) */
-#define CRG_TOP_SYS_CTRL_REG_QSPI_INIT_Msk (0x10UL) /*!< QSPI_INIT (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_CTRL_REG_REMAP_INTVECT_Pos (3UL) /*!< REMAP_INTVECT (Bit 3) */
-#define CRG_TOP_SYS_CTRL_REG_REMAP_INTVECT_Msk (0x8UL) /*!< REMAP_INTVECT (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_CTRL_REG_REMAP_ADR0_Pos (0UL) /*!< REMAP_ADR0 (Bit 0) */
-#define CRG_TOP_SYS_CTRL_REG_REMAP_ADR0_Msk (0x7UL) /*!< REMAP_ADR0 (Bitfield-Mask: 0x07) */
-/* ===================================================== SYS_STAT_REG ====================================================== */
-#define CRG_TOP_SYS_STAT_REG_POWER_IS_UP_Pos (13UL) /*!< POWER_IS_UP (Bit 13) */
-#define CRG_TOP_SYS_STAT_REG_POWER_IS_UP_Msk (0x2000UL) /*!< POWER_IS_UP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_DBG_IS_ACTIVE_Pos (12UL) /*!< DBG_IS_ACTIVE (Bit 12) */
-#define CRG_TOP_SYS_STAT_REG_DBG_IS_ACTIVE_Msk (0x1000UL) /*!< DBG_IS_ACTIVE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_COM_IS_UP_Pos (11UL) /*!< COM_IS_UP (Bit 11) */
-#define CRG_TOP_SYS_STAT_REG_COM_IS_UP_Msk (0x800UL) /*!< COM_IS_UP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_COM_IS_DOWN_Pos (10UL) /*!< COM_IS_DOWN (Bit 10) */
-#define CRG_TOP_SYS_STAT_REG_COM_IS_DOWN_Msk (0x400UL) /*!< COM_IS_DOWN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_TIM_IS_UP_Pos (9UL) /*!< TIM_IS_UP (Bit 9) */
-#define CRG_TOP_SYS_STAT_REG_TIM_IS_UP_Msk (0x200UL) /*!< TIM_IS_UP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_TIM_IS_DOWN_Pos (8UL) /*!< TIM_IS_DOWN (Bit 8) */
-#define CRG_TOP_SYS_STAT_REG_TIM_IS_DOWN_Msk (0x100UL) /*!< TIM_IS_DOWN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_MEM_IS_UP_Pos (7UL) /*!< MEM_IS_UP (Bit 7) */
-#define CRG_TOP_SYS_STAT_REG_MEM_IS_UP_Msk (0x80UL) /*!< MEM_IS_UP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_MEM_IS_DOWN_Pos (6UL) /*!< MEM_IS_DOWN (Bit 6) */
-#define CRG_TOP_SYS_STAT_REG_MEM_IS_DOWN_Msk (0x40UL) /*!< MEM_IS_DOWN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_SYS_IS_UP_Pos (5UL) /*!< SYS_IS_UP (Bit 5) */
-#define CRG_TOP_SYS_STAT_REG_SYS_IS_UP_Msk (0x20UL) /*!< SYS_IS_UP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_SYS_IS_DOWN_Pos (4UL) /*!< SYS_IS_DOWN (Bit 4) */
-#define CRG_TOP_SYS_STAT_REG_SYS_IS_DOWN_Msk (0x10UL) /*!< SYS_IS_DOWN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_PER_IS_UP_Pos (3UL) /*!< PER_IS_UP (Bit 3) */
-#define CRG_TOP_SYS_STAT_REG_PER_IS_UP_Msk (0x8UL) /*!< PER_IS_UP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_PER_IS_DOWN_Pos (2UL) /*!< PER_IS_DOWN (Bit 2) */
-#define CRG_TOP_SYS_STAT_REG_PER_IS_DOWN_Msk (0x4UL) /*!< PER_IS_DOWN (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_RAD_IS_UP_Pos (1UL) /*!< RAD_IS_UP (Bit 1) */
-#define CRG_TOP_SYS_STAT_REG_RAD_IS_UP_Msk (0x2UL) /*!< RAD_IS_UP (Bitfield-Mask: 0x01) */
-#define CRG_TOP_SYS_STAT_REG_RAD_IS_DOWN_Pos (0UL) /*!< RAD_IS_DOWN (Bit 0) */
-#define CRG_TOP_SYS_STAT_REG_RAD_IS_DOWN_Msk (0x1UL) /*!< RAD_IS_DOWN (Bitfield-Mask: 0x01) */
-/* ================================================== VBUS_IRQ_CLEAR_REG =================================================== */
-#define CRG_TOP_VBUS_IRQ_CLEAR_REG_VBUS_IRQ_CLEAR_Pos (0UL) /*!< VBUS_IRQ_CLEAR (Bit 0) */
-#define CRG_TOP_VBUS_IRQ_CLEAR_REG_VBUS_IRQ_CLEAR_Msk (0xffffUL) /*!< VBUS_IRQ_CLEAR (Bitfield-Mask: 0xffff) */
-/* =================================================== VBUS_IRQ_MASK_REG =================================================== */
-#define CRG_TOP_VBUS_IRQ_MASK_REG_VBUS_IRQ_EN_RISE_Pos (1UL) /*!< VBUS_IRQ_EN_RISE (Bit 1) */
-#define CRG_TOP_VBUS_IRQ_MASK_REG_VBUS_IRQ_EN_RISE_Msk (0x2UL) /*!< VBUS_IRQ_EN_RISE (Bitfield-Mask: 0x01) */
-#define CRG_TOP_VBUS_IRQ_MASK_REG_VBUS_IRQ_EN_FALL_Pos (0UL) /*!< VBUS_IRQ_EN_FALL (Bit 0) */
-#define CRG_TOP_VBUS_IRQ_MASK_REG_VBUS_IRQ_EN_FALL_Msk (0x1UL) /*!< VBUS_IRQ_EN_FALL (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ CRG_XTAL ================ */
-/* =========================================================================================================================== */
-
-/* =================================================== CLK_FREQ_TRIM_REG =================================================== */
-#define CRG_XTAL_CLK_FREQ_TRIM_REG_XTAL32M_START_Pos (20UL) /*!< XTAL32M_START (Bit 20) */
-#define CRG_XTAL_CLK_FREQ_TRIM_REG_XTAL32M_START_Msk (0x3ff00000UL) /*!< XTAL32M_START (Bitfield-Mask: 0x3ff) */
-#define CRG_XTAL_CLK_FREQ_TRIM_REG_XTAL32M_RAMP_Pos (10UL) /*!< XTAL32M_RAMP (Bit 10) */
-#define CRG_XTAL_CLK_FREQ_TRIM_REG_XTAL32M_RAMP_Msk (0xffc00UL) /*!< XTAL32M_RAMP (Bitfield-Mask: 0x3ff) */
-#define CRG_XTAL_CLK_FREQ_TRIM_REG_XTAL32M_TRIM_Pos (0UL) /*!< XTAL32M_TRIM (Bit 0) */
-#define CRG_XTAL_CLK_FREQ_TRIM_REG_XTAL32M_TRIM_Msk (0x3ffUL) /*!< XTAL32M_TRIM (Bitfield-Mask: 0x3ff) */
-/* =================================================== PLL_SYS_CTRL1_REG =================================================== */
-#define CRG_XTAL_PLL_SYS_CTRL1_REG_PLL_SEL_MIN_CUR_INT_Pos (14UL) /*!< PLL_SEL_MIN_CUR_INT (Bit 14) */
-#define CRG_XTAL_PLL_SYS_CTRL1_REG_PLL_SEL_MIN_CUR_INT_Msk (0x4000UL) /*!< PLL_SEL_MIN_CUR_INT (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_PLL_SYS_CTRL1_REG_PLL_PRE_DIV_Pos (11UL) /*!< PLL_PRE_DIV (Bit 11) */
-#define CRG_XTAL_PLL_SYS_CTRL1_REG_PLL_PRE_DIV_Msk (0x800UL) /*!< PLL_PRE_DIV (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_PLL_SYS_CTRL1_REG_PLL_N_DIV_Pos (4UL) /*!< PLL_N_DIV (Bit 4) */
-#define CRG_XTAL_PLL_SYS_CTRL1_REG_PLL_N_DIV_Msk (0x7f0UL) /*!< PLL_N_DIV (Bitfield-Mask: 0x7f) */
-#define CRG_XTAL_PLL_SYS_CTRL1_REG_LDO_PLL_VREF_HOLD_Pos (3UL) /*!< LDO_PLL_VREF_HOLD (Bit 3) */
-#define CRG_XTAL_PLL_SYS_CTRL1_REG_LDO_PLL_VREF_HOLD_Msk (0x8UL) /*!< LDO_PLL_VREF_HOLD (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_PLL_SYS_CTRL1_REG_LDO_PLL_ENABLE_Pos (2UL) /*!< LDO_PLL_ENABLE (Bit 2) */
-#define CRG_XTAL_PLL_SYS_CTRL1_REG_LDO_PLL_ENABLE_Msk (0x4UL) /*!< LDO_PLL_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_PLL_SYS_CTRL1_REG_PLL_EN_Pos (1UL) /*!< PLL_EN (Bit 1) */
-#define CRG_XTAL_PLL_SYS_CTRL1_REG_PLL_EN_Msk (0x2UL) /*!< PLL_EN (Bitfield-Mask: 0x01) */
-/* =================================================== PLL_SYS_CTRL2_REG =================================================== */
-#define CRG_XTAL_PLL_SYS_CTRL2_REG_PLL_RECALIB_Pos (15UL) /*!< PLL_RECALIB (Bit 15) */
-#define CRG_XTAL_PLL_SYS_CTRL2_REG_PLL_RECALIB_Msk (0x8000UL) /*!< PLL_RECALIB (Bitfield-Mask: 0x01) */
-/* =================================================== PLL_SYS_CTRL3_REG =================================================== */
-#define CRG_XTAL_PLL_SYS_CTRL3_REG_PLL_TEST_VCTR_Pos (7UL) /*!< PLL_TEST_VCTR (Bit 7) */
-#define CRG_XTAL_PLL_SYS_CTRL3_REG_PLL_TEST_VCTR_Msk (0x80UL) /*!< PLL_TEST_VCTR (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_PLL_SYS_CTRL3_REG_PLL_MIN_CURRENT_Pos (1UL) /*!< PLL_MIN_CURRENT (Bit 1) */
-#define CRG_XTAL_PLL_SYS_CTRL3_REG_PLL_MIN_CURRENT_Msk (0x7eUL) /*!< PLL_MIN_CURRENT (Bitfield-Mask: 0x3f) */
-/* ================================================== PLL_SYS_STATUS_REG =================================================== */
-#define CRG_XTAL_PLL_SYS_STATUS_REG_LDO_PLL_OK_Pos (15UL) /*!< LDO_PLL_OK (Bit 15) */
-#define CRG_XTAL_PLL_SYS_STATUS_REG_LDO_PLL_OK_Msk (0x8000UL) /*!< LDO_PLL_OK (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_PLL_SYS_STATUS_REG_PLL_CALIBRATION_END_Pos (11UL) /*!< PLL_CALIBRATION_END (Bit 11) */
-#define CRG_XTAL_PLL_SYS_STATUS_REG_PLL_CALIBRATION_END_Msk (0x800UL) /*!< PLL_CALIBRATION_END (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_PLL_SYS_STATUS_REG_PLL_BEST_MIN_CUR_Pos (5UL) /*!< PLL_BEST_MIN_CUR (Bit 5) */
-#define CRG_XTAL_PLL_SYS_STATUS_REG_PLL_BEST_MIN_CUR_Msk (0x7e0UL) /*!< PLL_BEST_MIN_CUR (Bitfield-Mask: 0x3f) */
-#define CRG_XTAL_PLL_SYS_STATUS_REG_PLL_LOCK_FINE_Pos (0UL) /*!< PLL_LOCK_FINE (Bit 0) */
-#define CRG_XTAL_PLL_SYS_STATUS_REG_PLL_LOCK_FINE_Msk (0x1UL) /*!< PLL_LOCK_FINE (Bitfield-Mask: 0x01) */
-/* ===================================================== TRIM_CTRL_REG ===================================================== */
-#define CRG_XTAL_TRIM_CTRL_REG_XTAL_SETTLE_N_Pos (8UL) /*!< XTAL_SETTLE_N (Bit 8) */
-#define CRG_XTAL_TRIM_CTRL_REG_XTAL_SETTLE_N_Msk (0x3f00UL) /*!< XTAL_SETTLE_N (Bitfield-Mask: 0x3f) */
-#define CRG_XTAL_TRIM_CTRL_REG_XTAL_TRIM_SELECT_Pos (6UL) /*!< XTAL_TRIM_SELECT (Bit 6) */
-#define CRG_XTAL_TRIM_CTRL_REG_XTAL_TRIM_SELECT_Msk (0xc0UL) /*!< XTAL_TRIM_SELECT (Bitfield-Mask: 0x03) */
-#define CRG_XTAL_TRIM_CTRL_REG_XTAL_COUNT_N_Pos (0UL) /*!< XTAL_COUNT_N (Bit 0) */
-#define CRG_XTAL_TRIM_CTRL_REG_XTAL_COUNT_N_Msk (0x3fUL) /*!< XTAL_COUNT_N (Bitfield-Mask: 0x3f) */
-/* =================================================== XTAL32M_CTRL0_REG =================================================== */
-#define CRG_XTAL_XTAL32M_CTRL0_REG_XTAL32M_DXTAL_SYSPLL_ENABLE_Pos (30UL) /*!< XTAL32M_DXTAL_SYSPLL_ENABLE (Bit 30) */
-#define CRG_XTAL_XTAL32M_CTRL0_REG_XTAL32M_DXTAL_SYSPLL_ENABLE_Msk (0x40000000UL) /*!< XTAL32M_DXTAL_SYSPLL_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_XTAL32M_CTRL0_REG_XTAL32M_CORE_CUR_SET_Pos (15UL) /*!< XTAL32M_CORE_CUR_SET (Bit 15) */
-#define CRG_XTAL_XTAL32M_CTRL0_REG_XTAL32M_CORE_CUR_SET_Msk (0x38000UL) /*!< XTAL32M_CORE_CUR_SET (Bitfield-Mask: 0x07) */
-#define CRG_XTAL_XTAL32M_CTRL0_REG_XTAL32M_RCOSC_CALIBRATE_Pos (3UL) /*!< XTAL32M_RCOSC_CALIBRATE (Bit 3) */
-#define CRG_XTAL_XTAL32M_CTRL0_REG_XTAL32M_RCOSC_CALIBRATE_Msk (0x8UL) /*!< XTAL32M_RCOSC_CALIBRATE (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_XTAL32M_CTRL0_REG_XTAL32M_RCOSC_XTAL_DRIVE_Pos (1UL) /*!< XTAL32M_RCOSC_XTAL_DRIVE (Bit 1) */
-#define CRG_XTAL_XTAL32M_CTRL0_REG_XTAL32M_RCOSC_XTAL_DRIVE_Msk (0x2UL) /*!< XTAL32M_RCOSC_XTAL_DRIVE (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_XTAL32M_CTRL0_REG_XTAL32M_CXCOMP_ENABLE_Pos (0UL) /*!< XTAL32M_CXCOMP_ENABLE (Bit 0) */
-#define CRG_XTAL_XTAL32M_CTRL0_REG_XTAL32M_CXCOMP_ENABLE_Msk (0x1UL) /*!< XTAL32M_CXCOMP_ENABLE (Bitfield-Mask: 0x01) */
-/* =================================================== XTAL32M_CTRL1_REG =================================================== */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_STARTUP_TDISCHARGE_Pos (28UL) /*!< XTAL32M_STARTUP_TDISCHARGE (Bit 28) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_STARTUP_TDISCHARGE_Msk (0x70000000UL) /*!< XTAL32M_STARTUP_TDISCHARGE (Bitfield-Mask: 0x07) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_STARTUP_TSETTLE_Pos (24UL) /*!< XTAL32M_STARTUP_TSETTLE (Bit 24) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_STARTUP_TSETTLE_Msk (0x7000000UL) /*!< XTAL32M_STARTUP_TSETTLE (Bitfield-Mask: 0x07) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_XTAL_ENABLE_Pos (23UL) /*!< XTAL32M_XTAL_ENABLE (Bit 23) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_XTAL_ENABLE_Msk (0x800000UL) /*!< XTAL32M_XTAL_ENABLE (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_STARTUP_TDRIVE_LSB_Pos (13UL) /*!< XTAL32M_STARTUP_TDRIVE_LSB (Bit 13) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_STARTUP_TDRIVE_LSB_Msk (0x7fe000UL) /*!< XTAL32M_STARTUP_TDRIVE_LSB (Bitfield-Mask: 0x3ff) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_DRIVE_CYCLES_Pos (8UL) /*!< XTAL32M_DRIVE_CYCLES (Bit 8) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_DRIVE_CYCLES_Msk (0x1f00UL) /*!< XTAL32M_DRIVE_CYCLES (Bitfield-Mask: 0x1f) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_STARTUP_TDRIVE_Pos (5UL) /*!< XTAL32M_STARTUP_TDRIVE (Bit 5) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_STARTUP_TDRIVE_Msk (0xe0UL) /*!< XTAL32M_STARTUP_TDRIVE (Bitfield-Mask: 0x07) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_RCOSC_SYNC_DELAY_TRIM_Pos (0UL) /*!< XTAL32M_RCOSC_SYNC_DELAY_TRIM (Bit 0) */
-#define CRG_XTAL_XTAL32M_CTRL1_REG_XTAL32M_RCOSC_SYNC_DELAY_TRIM_Msk (0x1fUL) /*!< XTAL32M_RCOSC_SYNC_DELAY_TRIM (Bitfield-Mask: 0x1f) */
-/* =================================================== XTAL32M_CTRL2_REG =================================================== */
-#define CRG_XTAL_XTAL32M_CTRL2_REG_XTAL32M_RCOSC_TRIM_SNS_Pos (14UL) /*!< XTAL32M_RCOSC_TRIM_SNS (Bit 14) */
-#define CRG_XTAL_XTAL32M_CTRL2_REG_XTAL32M_RCOSC_TRIM_SNS_Msk (0x3fc000UL) /*!< XTAL32M_RCOSC_TRIM_SNS (Bitfield-Mask: 0xff) */
-#define CRG_XTAL_XTAL32M_CTRL2_REG_XTAL32M_CXCOMP_PHI_TRIM_Pos (12UL) /*!< XTAL32M_CXCOMP_PHI_TRIM (Bit 12) */
-#define CRG_XTAL_XTAL32M_CTRL2_REG_XTAL32M_CXCOMP_PHI_TRIM_Msk (0x3000UL) /*!< XTAL32M_CXCOMP_PHI_TRIM (Bitfield-Mask: 0x03) */
-#define CRG_XTAL_XTAL32M_CTRL2_REG_XTAL32M_CXCOMP_TRIM_CAP_Pos (3UL) /*!< XTAL32M_CXCOMP_TRIM_CAP (Bit 3) */
-#define CRG_XTAL_XTAL32M_CTRL2_REG_XTAL32M_CXCOMP_TRIM_CAP_Msk (0xff8UL) /*!< XTAL32M_CXCOMP_TRIM_CAP (Bitfield-Mask: 0x1ff) */
-/* =================================================== XTAL32M_CTRL3_REG =================================================== */
-#define CRG_XTAL_XTAL32M_CTRL3_REG_XTAL32M_RCOSC_TRIM_STROBE_Pos (30UL) /*!< XTAL32M_RCOSC_TRIM_STROBE (Bit 30) */
-#define CRG_XTAL_XTAL32M_CTRL3_REG_XTAL32M_RCOSC_TRIM_STROBE_Msk (0x40000000UL) /*!< XTAL32M_RCOSC_TRIM_STROBE (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_XTAL32M_CTRL3_REG_XTAL32M_FREQ_DET_START_Pos (22UL) /*!< XTAL32M_FREQ_DET_START (Bit 22) */
-#define CRG_XTAL_XTAL32M_CTRL3_REG_XTAL32M_FREQ_DET_START_Msk (0x400000UL) /*!< XTAL32M_FREQ_DET_START (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_XTAL32M_CTRL3_REG_XTAL32M_SW_CTRL_MODE_Pos (18UL) /*!< XTAL32M_SW_CTRL_MODE (Bit 18) */
-#define CRG_XTAL_XTAL32M_CTRL3_REG_XTAL32M_SW_CTRL_MODE_Msk (0x40000UL) /*!< XTAL32M_SW_CTRL_MODE (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_XTAL32M_CTRL3_REG_XTAL32M_RCOSC_BAND_SELECT_Pos (14UL) /*!< XTAL32M_RCOSC_BAND_SELECT (Bit 14) */
-#define CRG_XTAL_XTAL32M_CTRL3_REG_XTAL32M_RCOSC_BAND_SELECT_Msk (0x3c000UL) /*!< XTAL32M_RCOSC_BAND_SELECT (Bitfield-Mask: 0x0f) */
-#define CRG_XTAL_XTAL32M_CTRL3_REG_XTAL32M_RCOSC_TRIM_Pos (4UL) /*!< XTAL32M_RCOSC_TRIM (Bit 4) */
-#define CRG_XTAL_XTAL32M_CTRL3_REG_XTAL32M_RCOSC_TRIM_Msk (0x3ff0UL) /*!< XTAL32M_RCOSC_TRIM (Bitfield-Mask: 0x3ff) */
-/* =================================================== XTAL32M_CTRL4_REG =================================================== */
-/* =================================================== XTAL32M_STAT0_REG =================================================== */
-#define CRG_XTAL_XTAL32M_STAT0_REG_XTAL32M_RCOSC_BAND_SELECT_STAT_Pos (28UL) /*!< XTAL32M_RCOSC_BAND_SELECT_STAT (Bit 28) */
-#define CRG_XTAL_XTAL32M_STAT0_REG_XTAL32M_RCOSC_BAND_SELECT_STAT_Msk (0xf0000000UL) /*!< XTAL32M_RCOSC_BAND_SELECT_STAT (Bitfield-Mask: 0x0f) */
-#define CRG_XTAL_XTAL32M_STAT0_REG_XTAL32M_RCOSC_CALIBRATION_DONE_Pos (15UL) /*!< XTAL32M_RCOSC_CALIBRATION_DONE (Bit 15) */
-#define CRG_XTAL_XTAL32M_STAT0_REG_XTAL32M_RCOSC_CALIBRATION_DONE_Msk (0x8000UL) /*!< XTAL32M_RCOSC_CALIBRATION_DONE (Bitfield-Mask: 0x01) */
-/* =================================================== XTAL32M_STAT1_REG =================================================== */
-#define CRG_XTAL_XTAL32M_STAT1_REG_XTAL32M_CAL_STATE_Pos (4UL) /*!< XTAL32M_CAL_STATE (Bit 4) */
-#define CRG_XTAL_XTAL32M_STAT1_REG_XTAL32M_CAL_STATE_Msk (0xf0UL) /*!< XTAL32M_CAL_STATE (Bitfield-Mask: 0x0f) */
-#define CRG_XTAL_XTAL32M_STAT1_REG_XTAL32M_STATE_Pos (0UL) /*!< XTAL32M_STATE (Bit 0) */
-#define CRG_XTAL_XTAL32M_STAT1_REG_XTAL32M_STATE_Msk (0xfUL) /*!< XTAL32M_STATE (Bitfield-Mask: 0x0f) */
-/* =================================================== XTALRDY_CTRL_REG ==================================================== */
-#define CRG_XTAL_XTALRDY_CTRL_REG_XTALRDY_CLK_SEL_Pos (8UL) /*!< XTALRDY_CLK_SEL (Bit 8) */
-#define CRG_XTAL_XTALRDY_CTRL_REG_XTALRDY_CLK_SEL_Msk (0x100UL) /*!< XTALRDY_CLK_SEL (Bitfield-Mask: 0x01) */
-#define CRG_XTAL_XTALRDY_CTRL_REG_XTALRDY_CNT_Pos (0UL) /*!< XTALRDY_CNT (Bit 0) */
-#define CRG_XTAL_XTALRDY_CTRL_REG_XTALRDY_CNT_Msk (0xffUL) /*!< XTALRDY_CNT (Bitfield-Mask: 0xff) */
-/* =================================================== XTALRDY_STAT_REG ==================================================== */
-#define CRG_XTAL_XTALRDY_STAT_REG_XTALRDY_COUNT_Pos (8UL) /*!< XTALRDY_COUNT (Bit 8) */
-#define CRG_XTAL_XTALRDY_STAT_REG_XTALRDY_COUNT_Msk (0xff00UL) /*!< XTALRDY_COUNT (Bitfield-Mask: 0xff) */
-#define CRG_XTAL_XTALRDY_STAT_REG_XTALRDY_STAT_Pos (0UL) /*!< XTALRDY_STAT (Bit 0) */
-#define CRG_XTAL_XTALRDY_STAT_REG_XTALRDY_STAT_Msk (0xffUL) /*!< XTALRDY_STAT (Bitfield-Mask: 0xff) */
-
-
-/* =========================================================================================================================== */
-/* ================ DCDC ================ */
-/* =========================================================================================================================== */
-
-/* ==================================================== DCDC_CTRL1_REG ===================================================== */
-#define DCDC_DCDC_CTRL1_REG_DCDC_SH_ENABLE_Pos (31UL) /*!< DCDC_SH_ENABLE (Bit 31) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_SH_ENABLE_Msk (0x80000000UL) /*!< DCDC_SH_ENABLE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_STARTUP_DELAY_Pos (26UL) /*!< DCDC_STARTUP_DELAY (Bit 26) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_STARTUP_DELAY_Msk (0x7c000000UL) /*!< DCDC_STARTUP_DELAY (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_IDLE_MAX_FAST_DOWNRAMP_Pos (20UL) /*!< DCDC_IDLE_MAX_FAST_DOWNRAMP (Bit 20) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_IDLE_MAX_FAST_DOWNRAMP_Msk (0x3f00000UL) /*!< DCDC_IDLE_MAX_FAST_DOWNRAMP (Bitfield-Mask: 0x3f) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_SW_TIMEOUT_Pos (15UL) /*!< DCDC_SW_TIMEOUT (Bit 15) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_SW_TIMEOUT_Msk (0xf8000UL) /*!< DCDC_SW_TIMEOUT (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_FAST_STARTUP_Pos (14UL) /*!< DCDC_FAST_STARTUP (Bit 14) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_FAST_STARTUP_Msk (0x4000UL) /*!< DCDC_FAST_STARTUP (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_MAN_LV_MODE_Pos (13UL) /*!< DCDC_MAN_LV_MODE (Bit 13) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_MAN_LV_MODE_Msk (0x2000UL) /*!< DCDC_MAN_LV_MODE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_AUTO_LV_MODE_Pos (12UL) /*!< DCDC_AUTO_LV_MODE (Bit 12) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_AUTO_LV_MODE_Msk (0x1000UL) /*!< DCDC_AUTO_LV_MODE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_IDLE_CLK_DIV_Pos (10UL) /*!< DCDC_IDLE_CLK_DIV (Bit 10) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_IDLE_CLK_DIV_Msk (0xc00UL) /*!< DCDC_IDLE_CLK_DIV (Bitfield-Mask: 0x03) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_PRIORITY_Pos (2UL) /*!< DCDC_PRIORITY (Bit 2) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_PRIORITY_Msk (0x3fcUL) /*!< DCDC_PRIORITY (Bitfield-Mask: 0xff) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_FW_ENABLE_Pos (1UL) /*!< DCDC_FW_ENABLE (Bit 1) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_FW_ENABLE_Msk (0x2UL) /*!< DCDC_FW_ENABLE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_ENABLE_Pos (0UL) /*!< DCDC_ENABLE (Bit 0) */
-#define DCDC_DCDC_CTRL1_REG_DCDC_ENABLE_Msk (0x1UL) /*!< DCDC_ENABLE (Bitfield-Mask: 0x01) */
-/* ==================================================== DCDC_CTRL2_REG ===================================================== */
-#define DCDC_DCDC_CTRL2_REG_DCDC_V_NOK_CNT_MAX_Pos (24UL) /*!< DCDC_V_NOK_CNT_MAX (Bit 24) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_V_NOK_CNT_MAX_Msk (0xf000000UL) /*!< DCDC_V_NOK_CNT_MAX (Bitfield-Mask: 0x0f) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_N_COMP_TRIM_MAN_Pos (22UL) /*!< DCDC_N_COMP_TRIM_MAN (Bit 22) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_N_COMP_TRIM_MAN_Msk (0x400000UL) /*!< DCDC_N_COMP_TRIM_MAN (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_N_COMP_TRIM_VAL_Pos (16UL) /*!< DCDC_N_COMP_TRIM_VAL (Bit 16) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_N_COMP_TRIM_VAL_Msk (0x3f0000UL) /*!< DCDC_N_COMP_TRIM_VAL (Bitfield-Mask: 0x3f) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_TIMEOUT_IRQ_TRIG_Pos (12UL) /*!< DCDC_TIMEOUT_IRQ_TRIG (Bit 12) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_TIMEOUT_IRQ_TRIG_Msk (0xf000UL) /*!< DCDC_TIMEOUT_IRQ_TRIG (Bitfield-Mask: 0x0f) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_TIMEOUT_IRQ_RES_Pos (8UL) /*!< DCDC_TIMEOUT_IRQ_RES (Bit 8) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_TIMEOUT_IRQ_RES_Msk (0xf00UL) /*!< DCDC_TIMEOUT_IRQ_RES (Bitfield-Mask: 0x0f) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_SLOPE_CONTROL_Pos (6UL) /*!< DCDC_SLOPE_CONTROL (Bit 6) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_SLOPE_CONTROL_Msk (0xc0UL) /*!< DCDC_SLOPE_CONTROL (Bitfield-Mask: 0x03) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_VBTSTRP_TRIM_Pos (4UL) /*!< DCDC_VBTSTRP_TRIM (Bit 4) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_VBTSTRP_TRIM_Msk (0x30UL) /*!< DCDC_VBTSTRP_TRIM (Bitfield-Mask: 0x03) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_LSSUP_TRIM_Pos (2UL) /*!< DCDC_LSSUP_TRIM (Bit 2) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_LSSUP_TRIM_Msk (0xcUL) /*!< DCDC_LSSUP_TRIM (Bitfield-Mask: 0x03) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_HSGND_TRIM_Pos (0UL) /*!< DCDC_HSGND_TRIM (Bit 0) */
-#define DCDC_DCDC_CTRL2_REG_DCDC_HSGND_TRIM_Msk (0x3UL) /*!< DCDC_HSGND_TRIM (Bitfield-Mask: 0x03) */
-/* ================================================== DCDC_IRQ_CLEAR_REG =================================================== */
-#define DCDC_DCDC_IRQ_CLEAR_REG_DCDC_LOW_VBAT_IRQ_CLEAR_Pos (4UL) /*!< DCDC_LOW_VBAT_IRQ_CLEAR (Bit 4) */
-#define DCDC_DCDC_IRQ_CLEAR_REG_DCDC_LOW_VBAT_IRQ_CLEAR_Msk (0x10UL) /*!< DCDC_LOW_VBAT_IRQ_CLEAR (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_IRQ_CLEAR_REG_DCDC_V18P_TIMEOUT_IRQ_CLEAR_Pos (3UL) /*!< DCDC_V18P_TIMEOUT_IRQ_CLEAR (Bit 3) */
-#define DCDC_DCDC_IRQ_CLEAR_REG_DCDC_V18P_TIMEOUT_IRQ_CLEAR_Msk (0x8UL) /*!< DCDC_V18P_TIMEOUT_IRQ_CLEAR (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_IRQ_CLEAR_REG_DCDC_VDD_TIMEOUT_IRQ_CLEAR_Pos (2UL) /*!< DCDC_VDD_TIMEOUT_IRQ_CLEAR (Bit 2) */
-#define DCDC_DCDC_IRQ_CLEAR_REG_DCDC_VDD_TIMEOUT_IRQ_CLEAR_Msk (0x4UL) /*!< DCDC_VDD_TIMEOUT_IRQ_CLEAR (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_IRQ_CLEAR_REG_DCDC_V18_TIMEOUT_IRQ_CLEAR_Pos (1UL) /*!< DCDC_V18_TIMEOUT_IRQ_CLEAR (Bit 1) */
-#define DCDC_DCDC_IRQ_CLEAR_REG_DCDC_V18_TIMEOUT_IRQ_CLEAR_Msk (0x2UL) /*!< DCDC_V18_TIMEOUT_IRQ_CLEAR (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_IRQ_CLEAR_REG_DCDC_V14_TIMEOUT_IRQ_CLEAR_Pos (0UL) /*!< DCDC_V14_TIMEOUT_IRQ_CLEAR (Bit 0) */
-#define DCDC_DCDC_IRQ_CLEAR_REG_DCDC_V14_TIMEOUT_IRQ_CLEAR_Msk (0x1UL) /*!< DCDC_V14_TIMEOUT_IRQ_CLEAR (Bitfield-Mask: 0x01) */
-/* =================================================== DCDC_IRQ_MASK_REG =================================================== */
-#define DCDC_DCDC_IRQ_MASK_REG_DCDC_LOW_VBAT_IRQ_MASK_Pos (4UL) /*!< DCDC_LOW_VBAT_IRQ_MASK (Bit 4) */
-#define DCDC_DCDC_IRQ_MASK_REG_DCDC_LOW_VBAT_IRQ_MASK_Msk (0x10UL) /*!< DCDC_LOW_VBAT_IRQ_MASK (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_IRQ_MASK_REG_DCDC_V18P_TIMEOUT_IRQ_MASK_Pos (3UL) /*!< DCDC_V18P_TIMEOUT_IRQ_MASK (Bit 3) */
-#define DCDC_DCDC_IRQ_MASK_REG_DCDC_V18P_TIMEOUT_IRQ_MASK_Msk (0x8UL) /*!< DCDC_V18P_TIMEOUT_IRQ_MASK (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_IRQ_MASK_REG_DCDC_VDD_TIMEOUT_IRQ_MASK_Pos (2UL) /*!< DCDC_VDD_TIMEOUT_IRQ_MASK (Bit 2) */
-#define DCDC_DCDC_IRQ_MASK_REG_DCDC_VDD_TIMEOUT_IRQ_MASK_Msk (0x4UL) /*!< DCDC_VDD_TIMEOUT_IRQ_MASK (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_IRQ_MASK_REG_DCDC_V18_TIMEOUT_IRQ_MASK_Pos (1UL) /*!< DCDC_V18_TIMEOUT_IRQ_MASK (Bit 1) */
-#define DCDC_DCDC_IRQ_MASK_REG_DCDC_V18_TIMEOUT_IRQ_MASK_Msk (0x2UL) /*!< DCDC_V18_TIMEOUT_IRQ_MASK (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_IRQ_MASK_REG_DCDC_V14_TIMEOUT_IRQ_MASK_Pos (0UL) /*!< DCDC_V14_TIMEOUT_IRQ_MASK (Bit 0) */
-#define DCDC_DCDC_IRQ_MASK_REG_DCDC_V14_TIMEOUT_IRQ_MASK_Msk (0x1UL) /*!< DCDC_V14_TIMEOUT_IRQ_MASK (Bitfield-Mask: 0x01) */
-/* ================================================== DCDC_IRQ_STATUS_REG ================================================== */
-#define DCDC_DCDC_IRQ_STATUS_REG_DCDC_LOW_VBAT_IRQ_STATUS_Pos (4UL) /*!< DCDC_LOW_VBAT_IRQ_STATUS (Bit 4) */
-#define DCDC_DCDC_IRQ_STATUS_REG_DCDC_LOW_VBAT_IRQ_STATUS_Msk (0x10UL) /*!< DCDC_LOW_VBAT_IRQ_STATUS (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_IRQ_STATUS_REG_DCDC_V18P_TIMEOUT_IRQ_STATUS_Pos (3UL) /*!< DCDC_V18P_TIMEOUT_IRQ_STATUS (Bit 3) */
-#define DCDC_DCDC_IRQ_STATUS_REG_DCDC_V18P_TIMEOUT_IRQ_STATUS_Msk (0x8UL) /*!< DCDC_V18P_TIMEOUT_IRQ_STATUS (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_IRQ_STATUS_REG_DCDC_VDD_TIMEOUT_IRQ_STATUS_Pos (2UL) /*!< DCDC_VDD_TIMEOUT_IRQ_STATUS (Bit 2) */
-#define DCDC_DCDC_IRQ_STATUS_REG_DCDC_VDD_TIMEOUT_IRQ_STATUS_Msk (0x4UL) /*!< DCDC_VDD_TIMEOUT_IRQ_STATUS (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_IRQ_STATUS_REG_DCDC_V18_TIMEOUT_IRQ_STATUS_Pos (1UL) /*!< DCDC_V18_TIMEOUT_IRQ_STATUS (Bit 1) */
-#define DCDC_DCDC_IRQ_STATUS_REG_DCDC_V18_TIMEOUT_IRQ_STATUS_Msk (0x2UL) /*!< DCDC_V18_TIMEOUT_IRQ_STATUS (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_IRQ_STATUS_REG_DCDC_V14_TIMEOUT_IRQ_STATUS_Pos (0UL) /*!< DCDC_V14_TIMEOUT_IRQ_STATUS (Bit 0) */
-#define DCDC_DCDC_IRQ_STATUS_REG_DCDC_V14_TIMEOUT_IRQ_STATUS_Msk (0x1UL) /*!< DCDC_V14_TIMEOUT_IRQ_STATUS (Bitfield-Mask: 0x01) */
-/* =================================================== DCDC_STATUS1_REG ==================================================== */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18P_AVAILABLE_Pos (27UL) /*!< DCDC_V18P_AVAILABLE (Bit 27) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18P_AVAILABLE_Msk (0x8000000UL) /*!< DCDC_V18P_AVAILABLE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_VDD_AVAILABLE_Pos (26UL) /*!< DCDC_VDD_AVAILABLE (Bit 26) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_VDD_AVAILABLE_Msk (0x4000000UL) /*!< DCDC_VDD_AVAILABLE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18_AVAILABLE_Pos (25UL) /*!< DCDC_V18_AVAILABLE (Bit 25) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18_AVAILABLE_Msk (0x2000000UL) /*!< DCDC_V18_AVAILABLE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V14_AVAILABLE_Pos (24UL) /*!< DCDC_V14_AVAILABLE (Bit 24) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V14_AVAILABLE_Msk (0x1000000UL) /*!< DCDC_V14_AVAILABLE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18P_COMP_OK_Pos (23UL) /*!< DCDC_V18P_COMP_OK (Bit 23) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18P_COMP_OK_Msk (0x800000UL) /*!< DCDC_V18P_COMP_OK (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_VDD_COMP_OK_Pos (22UL) /*!< DCDC_VDD_COMP_OK (Bit 22) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_VDD_COMP_OK_Msk (0x400000UL) /*!< DCDC_VDD_COMP_OK (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18_COMP_OK_Pos (21UL) /*!< DCDC_V18_COMP_OK (Bit 21) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18_COMP_OK_Msk (0x200000UL) /*!< DCDC_V18_COMP_OK (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V14_COMP_OK_Pos (20UL) /*!< DCDC_V14_COMP_OK (Bit 20) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V14_COMP_OK_Msk (0x100000UL) /*!< DCDC_V14_COMP_OK (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18P_COMP_NOK_Pos (19UL) /*!< DCDC_V18P_COMP_NOK (Bit 19) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18P_COMP_NOK_Msk (0x80000UL) /*!< DCDC_V18P_COMP_NOK (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_VDD_COMP_NOK_Pos (18UL) /*!< DCDC_VDD_COMP_NOK (Bit 18) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_VDD_COMP_NOK_Msk (0x40000UL) /*!< DCDC_VDD_COMP_NOK (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18_COMP_NOK_Pos (17UL) /*!< DCDC_V18_COMP_NOK (Bit 17) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18_COMP_NOK_Msk (0x20000UL) /*!< DCDC_V18_COMP_NOK (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V14_COMP_NOK_Pos (16UL) /*!< DCDC_V14_COMP_NOK (Bit 16) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V14_COMP_NOK_Msk (0x10000UL) /*!< DCDC_V14_COMP_NOK (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_N_COMP_P_Pos (11UL) /*!< DCDC_N_COMP_P (Bit 11) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_N_COMP_P_Msk (0x800UL) /*!< DCDC_N_COMP_P (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_N_COMP_N_Pos (10UL) /*!< DCDC_N_COMP_N (Bit 10) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_N_COMP_N_Msk (0x400UL) /*!< DCDC_N_COMP_N (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_P_COMP_Pos (9UL) /*!< DCDC_P_COMP (Bit 9) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_P_COMP_Msk (0x200UL) /*!< DCDC_P_COMP (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_N_COMP_Pos (8UL) /*!< DCDC_N_COMP (Bit 8) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_N_COMP_Msk (0x100UL) /*!< DCDC_N_COMP (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_LV_MODE_Pos (7UL) /*!< DCDC_LV_MODE (Bit 7) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_LV_MODE_Msk (0x80UL) /*!< DCDC_LV_MODE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18P_SW_STATE_Pos (6UL) /*!< DCDC_V18P_SW_STATE (Bit 6) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18P_SW_STATE_Msk (0x40UL) /*!< DCDC_V18P_SW_STATE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_VDD_SW_STATE_Pos (5UL) /*!< DCDC_VDD_SW_STATE (Bit 5) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_VDD_SW_STATE_Msk (0x20UL) /*!< DCDC_VDD_SW_STATE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18_SW_STATE_Pos (4UL) /*!< DCDC_V18_SW_STATE (Bit 4) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V18_SW_STATE_Msk (0x10UL) /*!< DCDC_V18_SW_STATE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V14_SW_STATE_Pos (3UL) /*!< DCDC_V14_SW_STATE (Bit 3) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_V14_SW_STATE_Msk (0x8UL) /*!< DCDC_V14_SW_STATE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_N_SW_STATE_Pos (2UL) /*!< DCDC_N_SW_STATE (Bit 2) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_N_SW_STATE_Msk (0x4UL) /*!< DCDC_N_SW_STATE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_P_SW_STATE_Pos (1UL) /*!< DCDC_P_SW_STATE (Bit 1) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_P_SW_STATE_Msk (0x2UL) /*!< DCDC_P_SW_STATE (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_STARTUP_COMPLETE_Pos (0UL) /*!< DCDC_STARTUP_COMPLETE (Bit 0) */
-#define DCDC_DCDC_STATUS1_REG_DCDC_STARTUP_COMPLETE_Msk (0x1UL) /*!< DCDC_STARTUP_COMPLETE (Bitfield-Mask: 0x01) */
-/* ===================================================== DCDC_V14_REG ====================================================== */
-#define DCDC_DCDC_V14_REG_DCDC_V14_FAST_RAMPING_Pos (31UL) /*!< DCDC_V14_FAST_RAMPING (Bit 31) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_FAST_RAMPING_Msk (0x80000000UL) /*!< DCDC_V14_FAST_RAMPING (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_TRIM_Pos (27UL) /*!< DCDC_V14_TRIM (Bit 27) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_TRIM_Msk (0x8000000UL) /*!< DCDC_V14_TRIM (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_CUR_LIM_MAX_HV_Pos (22UL) /*!< DCDC_V14_CUR_LIM_MAX_HV (Bit 22) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_CUR_LIM_MAX_HV_Msk (0x7c00000UL) /*!< DCDC_V14_CUR_LIM_MAX_HV (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_CUR_LIM_MAX_LV_Pos (17UL) /*!< DCDC_V14_CUR_LIM_MAX_LV (Bit 17) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_CUR_LIM_MAX_LV_Msk (0x3e0000UL) /*!< DCDC_V14_CUR_LIM_MAX_LV (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_CUR_LIM_MIN_Pos (12UL) /*!< DCDC_V14_CUR_LIM_MIN (Bit 12) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_CUR_LIM_MIN_Msk (0x1f000UL) /*!< DCDC_V14_CUR_LIM_MIN (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_IDLE_HYST_Pos (7UL) /*!< DCDC_V14_IDLE_HYST (Bit 7) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_IDLE_HYST_Msk (0xf80UL) /*!< DCDC_V14_IDLE_HYST (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_IDLE_MIN_Pos (2UL) /*!< DCDC_V14_IDLE_MIN (Bit 2) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_IDLE_MIN_Msk (0x7cUL) /*!< DCDC_V14_IDLE_MIN (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_ENABLE_HV_Pos (1UL) /*!< DCDC_V14_ENABLE_HV (Bit 1) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_ENABLE_HV_Msk (0x2UL) /*!< DCDC_V14_ENABLE_HV (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_ENABLE_LV_Pos (0UL) /*!< DCDC_V14_ENABLE_LV (Bit 0) */
-#define DCDC_DCDC_V14_REG_DCDC_V14_ENABLE_LV_Msk (0x1UL) /*!< DCDC_V14_ENABLE_LV (Bitfield-Mask: 0x01) */
-/* ===================================================== DCDC_V18P_REG ===================================================== */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_FAST_RAMPING_Pos (31UL) /*!< DCDC_V18P_FAST_RAMPING (Bit 31) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_FAST_RAMPING_Msk (0x80000000UL) /*!< DCDC_V18P_FAST_RAMPING (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_TRIM_Pos (27UL) /*!< DCDC_V18P_TRIM (Bit 27) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_TRIM_Msk (0x78000000UL) /*!< DCDC_V18P_TRIM (Bitfield-Mask: 0x0f) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_CUR_LIM_MAX_HV_Pos (22UL) /*!< DCDC_V18P_CUR_LIM_MAX_HV (Bit 22) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_CUR_LIM_MAX_HV_Msk (0x7c00000UL) /*!< DCDC_V18P_CUR_LIM_MAX_HV (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_CUR_LIM_MAX_LV_Pos (17UL) /*!< DCDC_V18P_CUR_LIM_MAX_LV (Bit 17) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_CUR_LIM_MAX_LV_Msk (0x3e0000UL) /*!< DCDC_V18P_CUR_LIM_MAX_LV (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_CUR_LIM_MIN_Pos (12UL) /*!< DCDC_V18P_CUR_LIM_MIN (Bit 12) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_CUR_LIM_MIN_Msk (0x1f000UL) /*!< DCDC_V18P_CUR_LIM_MIN (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_IDLE_HYST_Pos (7UL) /*!< DCDC_V18P_IDLE_HYST (Bit 7) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_IDLE_HYST_Msk (0xf80UL) /*!< DCDC_V18P_IDLE_HYST (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_IDLE_MIN_Pos (2UL) /*!< DCDC_V18P_IDLE_MIN (Bit 2) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_IDLE_MIN_Msk (0x7cUL) /*!< DCDC_V18P_IDLE_MIN (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_ENABLE_HV_Pos (1UL) /*!< DCDC_V18P_ENABLE_HV (Bit 1) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_ENABLE_HV_Msk (0x2UL) /*!< DCDC_V18P_ENABLE_HV (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_ENABLE_LV_Pos (0UL) /*!< DCDC_V18P_ENABLE_LV (Bit 0) */
-#define DCDC_DCDC_V18P_REG_DCDC_V18P_ENABLE_LV_Msk (0x1UL) /*!< DCDC_V18P_ENABLE_LV (Bitfield-Mask: 0x01) */
-/* ===================================================== DCDC_V18_REG ====================================================== */
-#define DCDC_DCDC_V18_REG_DCDC_V18_FAST_RAMPING_Pos (31UL) /*!< DCDC_V18_FAST_RAMPING (Bit 31) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_FAST_RAMPING_Msk (0x80000000UL) /*!< DCDC_V18_FAST_RAMPING (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_TRIM_Pos (27UL) /*!< DCDC_V18_TRIM (Bit 27) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_TRIM_Msk (0x78000000UL) /*!< DCDC_V18_TRIM (Bitfield-Mask: 0x0f) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_CUR_LIM_MAX_HV_Pos (22UL) /*!< DCDC_V18_CUR_LIM_MAX_HV (Bit 22) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_CUR_LIM_MAX_HV_Msk (0x7c00000UL) /*!< DCDC_V18_CUR_LIM_MAX_HV (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_CUR_LIM_MAX_LV_Pos (17UL) /*!< DCDC_V18_CUR_LIM_MAX_LV (Bit 17) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_CUR_LIM_MAX_LV_Msk (0x3e0000UL) /*!< DCDC_V18_CUR_LIM_MAX_LV (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_CUR_LIM_MIN_Pos (12UL) /*!< DCDC_V18_CUR_LIM_MIN (Bit 12) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_CUR_LIM_MIN_Msk (0x1f000UL) /*!< DCDC_V18_CUR_LIM_MIN (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_IDLE_HYST_Pos (7UL) /*!< DCDC_V18_IDLE_HYST (Bit 7) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_IDLE_HYST_Msk (0xf80UL) /*!< DCDC_V18_IDLE_HYST (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_IDLE_MIN_Pos (2UL) /*!< DCDC_V18_IDLE_MIN (Bit 2) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_IDLE_MIN_Msk (0x7cUL) /*!< DCDC_V18_IDLE_MIN (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_ENABLE_HV_Pos (1UL) /*!< DCDC_V18_ENABLE_HV (Bit 1) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_ENABLE_HV_Msk (0x2UL) /*!< DCDC_V18_ENABLE_HV (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_ENABLE_LV_Pos (0UL) /*!< DCDC_V18_ENABLE_LV (Bit 0) */
-#define DCDC_DCDC_V18_REG_DCDC_V18_ENABLE_LV_Msk (0x1UL) /*!< DCDC_V18_ENABLE_LV (Bitfield-Mask: 0x01) */
-/* ===================================================== DCDC_VDD_REG ====================================================== */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_FAST_RAMPING_Pos (31UL) /*!< DCDC_VDD_FAST_RAMPING (Bit 31) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_FAST_RAMPING_Msk (0x80000000UL) /*!< DCDC_VDD_FAST_RAMPING (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_TRIM_Pos (27UL) /*!< DCDC_VDD_TRIM (Bit 27) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_TRIM_Msk (0x38000000UL) /*!< DCDC_VDD_TRIM (Bitfield-Mask: 0x07) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_CUR_LIM_MAX_HV_Pos (22UL) /*!< DCDC_VDD_CUR_LIM_MAX_HV (Bit 22) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_CUR_LIM_MAX_HV_Msk (0x7c00000UL) /*!< DCDC_VDD_CUR_LIM_MAX_HV (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_CUR_LIM_MAX_LV_Pos (17UL) /*!< DCDC_VDD_CUR_LIM_MAX_LV (Bit 17) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_CUR_LIM_MAX_LV_Msk (0x3e0000UL) /*!< DCDC_VDD_CUR_LIM_MAX_LV (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_CUR_LIM_MIN_Pos (12UL) /*!< DCDC_VDD_CUR_LIM_MIN (Bit 12) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_CUR_LIM_MIN_Msk (0x1f000UL) /*!< DCDC_VDD_CUR_LIM_MIN (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_IDLE_HYST_Pos (7UL) /*!< DCDC_VDD_IDLE_HYST (Bit 7) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_IDLE_HYST_Msk (0xf80UL) /*!< DCDC_VDD_IDLE_HYST (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_IDLE_MIN_Pos (2UL) /*!< DCDC_VDD_IDLE_MIN (Bit 2) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_IDLE_MIN_Msk (0x7cUL) /*!< DCDC_VDD_IDLE_MIN (Bitfield-Mask: 0x1f) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_ENABLE_HV_Pos (1UL) /*!< DCDC_VDD_ENABLE_HV (Bit 1) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_ENABLE_HV_Msk (0x2UL) /*!< DCDC_VDD_ENABLE_HV (Bitfield-Mask: 0x01) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_ENABLE_LV_Pos (0UL) /*!< DCDC_VDD_ENABLE_LV (Bit 0) */
-#define DCDC_DCDC_VDD_REG_DCDC_VDD_ENABLE_LV_Msk (0x1UL) /*!< DCDC_VDD_ENABLE_LV (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ DMA ================ */
-/* =========================================================================================================================== */
-
-/* =================================================== DMA0_A_START_REG ==================================================== */
-#define DMA_DMA0_A_START_REG_DMA0_A_START_Pos (0UL) /*!< DMA0_A_START (Bit 0) */
-#define DMA_DMA0_A_START_REG_DMA0_A_START_Msk (0xffffffffUL) /*!< DMA0_A_START (Bitfield-Mask: 0xffffffff) */
-/* =================================================== DMA0_B_START_REG ==================================================== */
-#define DMA_DMA0_B_START_REG_DMA0_B_START_Pos (0UL) /*!< DMA0_B_START (Bit 0) */
-#define DMA_DMA0_B_START_REG_DMA0_B_START_Msk (0xffffffffUL) /*!< DMA0_B_START (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== DMA0_CTRL_REG ===================================================== */
-#define DMA_DMA0_CTRL_REG_BUS_ERROR_DETECT_Pos (15UL) /*!< BUS_ERROR_DETECT (Bit 15) */
-#define DMA_DMA0_CTRL_REG_BUS_ERROR_DETECT_Msk (0x8000UL) /*!< BUS_ERROR_DETECT (Bitfield-Mask: 0x01) */
-#define DMA_DMA0_CTRL_REG_BURST_MODE_Pos (13UL) /*!< BURST_MODE (Bit 13) */
-#define DMA_DMA0_CTRL_REG_BURST_MODE_Msk (0x6000UL) /*!< BURST_MODE (Bitfield-Mask: 0x03) */
-#define DMA_DMA0_CTRL_REG_REQ_SENSE_Pos (12UL) /*!< REQ_SENSE (Bit 12) */
-#define DMA_DMA0_CTRL_REG_REQ_SENSE_Msk (0x1000UL) /*!< REQ_SENSE (Bitfield-Mask: 0x01) */
-#define DMA_DMA0_CTRL_REG_DMA_INIT_Pos (11UL) /*!< DMA_INIT (Bit 11) */
-#define DMA_DMA0_CTRL_REG_DMA_INIT_Msk (0x800UL) /*!< DMA_INIT (Bitfield-Mask: 0x01) */
-#define DMA_DMA0_CTRL_REG_DMA_IDLE_Pos (10UL) /*!< DMA_IDLE (Bit 10) */
-#define DMA_DMA0_CTRL_REG_DMA_IDLE_Msk (0x400UL) /*!< DMA_IDLE (Bitfield-Mask: 0x01) */
-#define DMA_DMA0_CTRL_REG_DMA_PRIO_Pos (7UL) /*!< DMA_PRIO (Bit 7) */
-#define DMA_DMA0_CTRL_REG_DMA_PRIO_Msk (0x380UL) /*!< DMA_PRIO (Bitfield-Mask: 0x07) */
-#define DMA_DMA0_CTRL_REG_CIRCULAR_Pos (6UL) /*!< CIRCULAR (Bit 6) */
-#define DMA_DMA0_CTRL_REG_CIRCULAR_Msk (0x40UL) /*!< CIRCULAR (Bitfield-Mask: 0x01) */
-#define DMA_DMA0_CTRL_REG_AINC_Pos (5UL) /*!< AINC (Bit 5) */
-#define DMA_DMA0_CTRL_REG_AINC_Msk (0x20UL) /*!< AINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA0_CTRL_REG_BINC_Pos (4UL) /*!< BINC (Bit 4) */
-#define DMA_DMA0_CTRL_REG_BINC_Msk (0x10UL) /*!< BINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA0_CTRL_REG_DREQ_MODE_Pos (3UL) /*!< DREQ_MODE (Bit 3) */
-#define DMA_DMA0_CTRL_REG_DREQ_MODE_Msk (0x8UL) /*!< DREQ_MODE (Bitfield-Mask: 0x01) */
-#define DMA_DMA0_CTRL_REG_BW_Pos (1UL) /*!< BW (Bit 1) */
-#define DMA_DMA0_CTRL_REG_BW_Msk (0x6UL) /*!< BW (Bitfield-Mask: 0x03) */
-#define DMA_DMA0_CTRL_REG_DMA_ON_Pos (0UL) /*!< DMA_ON (Bit 0) */
-#define DMA_DMA0_CTRL_REG_DMA_ON_Msk (0x1UL) /*!< DMA_ON (Bitfield-Mask: 0x01) */
-/* ===================================================== DMA0_IDX_REG ====================================================== */
-#define DMA_DMA0_IDX_REG_DMA0_IDX_Pos (0UL) /*!< DMA0_IDX (Bit 0) */
-#define DMA_DMA0_IDX_REG_DMA0_IDX_Msk (0xffffUL) /*!< DMA0_IDX (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA0_INT_REG ====================================================== */
-#define DMA_DMA0_INT_REG_DMA0_INT_Pos (0UL) /*!< DMA0_INT (Bit 0) */
-#define DMA_DMA0_INT_REG_DMA0_INT_Msk (0xffffUL) /*!< DMA0_INT (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA0_LEN_REG ====================================================== */
-#define DMA_DMA0_LEN_REG_DMA0_LEN_Pos (0UL) /*!< DMA0_LEN (Bit 0) */
-#define DMA_DMA0_LEN_REG_DMA0_LEN_Msk (0xffffUL) /*!< DMA0_LEN (Bitfield-Mask: 0xffff) */
-/* =================================================== DMA1_A_START_REG ==================================================== */
-#define DMA_DMA1_A_START_REG_DMA1_A_START_Pos (0UL) /*!< DMA1_A_START (Bit 0) */
-#define DMA_DMA1_A_START_REG_DMA1_A_START_Msk (0xffffffffUL) /*!< DMA1_A_START (Bitfield-Mask: 0xffffffff) */
-/* =================================================== DMA1_B_START_REG ==================================================== */
-#define DMA_DMA1_B_START_REG_DMA1_B_START_Pos (0UL) /*!< DMA1_B_START (Bit 0) */
-#define DMA_DMA1_B_START_REG_DMA1_B_START_Msk (0xffffffffUL) /*!< DMA1_B_START (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== DMA1_CTRL_REG ===================================================== */
-#define DMA_DMA1_CTRL_REG_BUS_ERROR_DETECT_Pos (15UL) /*!< BUS_ERROR_DETECT (Bit 15) */
-#define DMA_DMA1_CTRL_REG_BUS_ERROR_DETECT_Msk (0x8000UL) /*!< BUS_ERROR_DETECT (Bitfield-Mask: 0x01) */
-#define DMA_DMA1_CTRL_REG_BURST_MODE_Pos (13UL) /*!< BURST_MODE (Bit 13) */
-#define DMA_DMA1_CTRL_REG_BURST_MODE_Msk (0x6000UL) /*!< BURST_MODE (Bitfield-Mask: 0x03) */
-#define DMA_DMA1_CTRL_REG_REQ_SENSE_Pos (12UL) /*!< REQ_SENSE (Bit 12) */
-#define DMA_DMA1_CTRL_REG_REQ_SENSE_Msk (0x1000UL) /*!< REQ_SENSE (Bitfield-Mask: 0x01) */
-#define DMA_DMA1_CTRL_REG_DMA_INIT_Pos (11UL) /*!< DMA_INIT (Bit 11) */
-#define DMA_DMA1_CTRL_REG_DMA_INIT_Msk (0x800UL) /*!< DMA_INIT (Bitfield-Mask: 0x01) */
-#define DMA_DMA1_CTRL_REG_DMA_IDLE_Pos (10UL) /*!< DMA_IDLE (Bit 10) */
-#define DMA_DMA1_CTRL_REG_DMA_IDLE_Msk (0x400UL) /*!< DMA_IDLE (Bitfield-Mask: 0x01) */
-#define DMA_DMA1_CTRL_REG_DMA_PRIO_Pos (7UL) /*!< DMA_PRIO (Bit 7) */
-#define DMA_DMA1_CTRL_REG_DMA_PRIO_Msk (0x380UL) /*!< DMA_PRIO (Bitfield-Mask: 0x07) */
-#define DMA_DMA1_CTRL_REG_CIRCULAR_Pos (6UL) /*!< CIRCULAR (Bit 6) */
-#define DMA_DMA1_CTRL_REG_CIRCULAR_Msk (0x40UL) /*!< CIRCULAR (Bitfield-Mask: 0x01) */
-#define DMA_DMA1_CTRL_REG_AINC_Pos (5UL) /*!< AINC (Bit 5) */
-#define DMA_DMA1_CTRL_REG_AINC_Msk (0x20UL) /*!< AINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA1_CTRL_REG_BINC_Pos (4UL) /*!< BINC (Bit 4) */
-#define DMA_DMA1_CTRL_REG_BINC_Msk (0x10UL) /*!< BINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA1_CTRL_REG_DREQ_MODE_Pos (3UL) /*!< DREQ_MODE (Bit 3) */
-#define DMA_DMA1_CTRL_REG_DREQ_MODE_Msk (0x8UL) /*!< DREQ_MODE (Bitfield-Mask: 0x01) */
-#define DMA_DMA1_CTRL_REG_BW_Pos (1UL) /*!< BW (Bit 1) */
-#define DMA_DMA1_CTRL_REG_BW_Msk (0x6UL) /*!< BW (Bitfield-Mask: 0x03) */
-#define DMA_DMA1_CTRL_REG_DMA_ON_Pos (0UL) /*!< DMA_ON (Bit 0) */
-#define DMA_DMA1_CTRL_REG_DMA_ON_Msk (0x1UL) /*!< DMA_ON (Bitfield-Mask: 0x01) */
-/* ===================================================== DMA1_IDX_REG ====================================================== */
-#define DMA_DMA1_IDX_REG_DMA1_IDX_Pos (0UL) /*!< DMA1_IDX (Bit 0) */
-#define DMA_DMA1_IDX_REG_DMA1_IDX_Msk (0xffffUL) /*!< DMA1_IDX (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA1_INT_REG ====================================================== */
-#define DMA_DMA1_INT_REG_DMA1_INT_Pos (0UL) /*!< DMA1_INT (Bit 0) */
-#define DMA_DMA1_INT_REG_DMA1_INT_Msk (0xffffUL) /*!< DMA1_INT (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA1_LEN_REG ====================================================== */
-#define DMA_DMA1_LEN_REG_DMA1_LEN_Pos (0UL) /*!< DMA1_LEN (Bit 0) */
-#define DMA_DMA1_LEN_REG_DMA1_LEN_Msk (0xffffUL) /*!< DMA1_LEN (Bitfield-Mask: 0xffff) */
-/* =================================================== DMA2_A_START_REG ==================================================== */
-#define DMA_DMA2_A_START_REG_DMA2_A_START_Pos (0UL) /*!< DMA2_A_START (Bit 0) */
-#define DMA_DMA2_A_START_REG_DMA2_A_START_Msk (0xffffffffUL) /*!< DMA2_A_START (Bitfield-Mask: 0xffffffff) */
-/* =================================================== DMA2_B_START_REG ==================================================== */
-#define DMA_DMA2_B_START_REG_DMA2_B_START_Pos (0UL) /*!< DMA2_B_START (Bit 0) */
-#define DMA_DMA2_B_START_REG_DMA2_B_START_Msk (0xffffffffUL) /*!< DMA2_B_START (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== DMA2_CTRL_REG ===================================================== */
-#define DMA_DMA2_CTRL_REG_BUS_ERROR_DETECT_Pos (15UL) /*!< BUS_ERROR_DETECT (Bit 15) */
-#define DMA_DMA2_CTRL_REG_BUS_ERROR_DETECT_Msk (0x8000UL) /*!< BUS_ERROR_DETECT (Bitfield-Mask: 0x01) */
-#define DMA_DMA2_CTRL_REG_BURST_MODE_Pos (13UL) /*!< BURST_MODE (Bit 13) */
-#define DMA_DMA2_CTRL_REG_BURST_MODE_Msk (0x6000UL) /*!< BURST_MODE (Bitfield-Mask: 0x03) */
-#define DMA_DMA2_CTRL_REG_REQ_SENSE_Pos (12UL) /*!< REQ_SENSE (Bit 12) */
-#define DMA_DMA2_CTRL_REG_REQ_SENSE_Msk (0x1000UL) /*!< REQ_SENSE (Bitfield-Mask: 0x01) */
-#define DMA_DMA2_CTRL_REG_DMA_INIT_Pos (11UL) /*!< DMA_INIT (Bit 11) */
-#define DMA_DMA2_CTRL_REG_DMA_INIT_Msk (0x800UL) /*!< DMA_INIT (Bitfield-Mask: 0x01) */
-#define DMA_DMA2_CTRL_REG_DMA_IDLE_Pos (10UL) /*!< DMA_IDLE (Bit 10) */
-#define DMA_DMA2_CTRL_REG_DMA_IDLE_Msk (0x400UL) /*!< DMA_IDLE (Bitfield-Mask: 0x01) */
-#define DMA_DMA2_CTRL_REG_DMA_PRIO_Pos (7UL) /*!< DMA_PRIO (Bit 7) */
-#define DMA_DMA2_CTRL_REG_DMA_PRIO_Msk (0x380UL) /*!< DMA_PRIO (Bitfield-Mask: 0x07) */
-#define DMA_DMA2_CTRL_REG_CIRCULAR_Pos (6UL) /*!< CIRCULAR (Bit 6) */
-#define DMA_DMA2_CTRL_REG_CIRCULAR_Msk (0x40UL) /*!< CIRCULAR (Bitfield-Mask: 0x01) */
-#define DMA_DMA2_CTRL_REG_AINC_Pos (5UL) /*!< AINC (Bit 5) */
-#define DMA_DMA2_CTRL_REG_AINC_Msk (0x20UL) /*!< AINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA2_CTRL_REG_BINC_Pos (4UL) /*!< BINC (Bit 4) */
-#define DMA_DMA2_CTRL_REG_BINC_Msk (0x10UL) /*!< BINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA2_CTRL_REG_DREQ_MODE_Pos (3UL) /*!< DREQ_MODE (Bit 3) */
-#define DMA_DMA2_CTRL_REG_DREQ_MODE_Msk (0x8UL) /*!< DREQ_MODE (Bitfield-Mask: 0x01) */
-#define DMA_DMA2_CTRL_REG_BW_Pos (1UL) /*!< BW (Bit 1) */
-#define DMA_DMA2_CTRL_REG_BW_Msk (0x6UL) /*!< BW (Bitfield-Mask: 0x03) */
-#define DMA_DMA2_CTRL_REG_DMA_ON_Pos (0UL) /*!< DMA_ON (Bit 0) */
-#define DMA_DMA2_CTRL_REG_DMA_ON_Msk (0x1UL) /*!< DMA_ON (Bitfield-Mask: 0x01) */
-/* ===================================================== DMA2_IDX_REG ====================================================== */
-#define DMA_DMA2_IDX_REG_DMA2_IDX_Pos (0UL) /*!< DMA2_IDX (Bit 0) */
-#define DMA_DMA2_IDX_REG_DMA2_IDX_Msk (0xffffUL) /*!< DMA2_IDX (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA2_INT_REG ====================================================== */
-#define DMA_DMA2_INT_REG_DMA2_INT_Pos (0UL) /*!< DMA2_INT (Bit 0) */
-#define DMA_DMA2_INT_REG_DMA2_INT_Msk (0xffffUL) /*!< DMA2_INT (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA2_LEN_REG ====================================================== */
-#define DMA_DMA2_LEN_REG_DMA2_LEN_Pos (0UL) /*!< DMA2_LEN (Bit 0) */
-#define DMA_DMA2_LEN_REG_DMA2_LEN_Msk (0xffffUL) /*!< DMA2_LEN (Bitfield-Mask: 0xffff) */
-/* =================================================== DMA3_A_START_REG ==================================================== */
-#define DMA_DMA3_A_START_REG_DMA3_A_START_Pos (0UL) /*!< DMA3_A_START (Bit 0) */
-#define DMA_DMA3_A_START_REG_DMA3_A_START_Msk (0xffffffffUL) /*!< DMA3_A_START (Bitfield-Mask: 0xffffffff) */
-/* =================================================== DMA3_B_START_REG ==================================================== */
-#define DMA_DMA3_B_START_REG_DMA3_B_START_Pos (0UL) /*!< DMA3_B_START (Bit 0) */
-#define DMA_DMA3_B_START_REG_DMA3_B_START_Msk (0xffffffffUL) /*!< DMA3_B_START (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== DMA3_CTRL_REG ===================================================== */
-#define DMA_DMA3_CTRL_REG_BUS_ERROR_DETECT_Pos (15UL) /*!< BUS_ERROR_DETECT (Bit 15) */
-#define DMA_DMA3_CTRL_REG_BUS_ERROR_DETECT_Msk (0x8000UL) /*!< BUS_ERROR_DETECT (Bitfield-Mask: 0x01) */
-#define DMA_DMA3_CTRL_REG_BURST_MODE_Pos (13UL) /*!< BURST_MODE (Bit 13) */
-#define DMA_DMA3_CTRL_REG_BURST_MODE_Msk (0x6000UL) /*!< BURST_MODE (Bitfield-Mask: 0x03) */
-#define DMA_DMA3_CTRL_REG_REQ_SENSE_Pos (12UL) /*!< REQ_SENSE (Bit 12) */
-#define DMA_DMA3_CTRL_REG_REQ_SENSE_Msk (0x1000UL) /*!< REQ_SENSE (Bitfield-Mask: 0x01) */
-#define DMA_DMA3_CTRL_REG_DMA_INIT_Pos (11UL) /*!< DMA_INIT (Bit 11) */
-#define DMA_DMA3_CTRL_REG_DMA_INIT_Msk (0x800UL) /*!< DMA_INIT (Bitfield-Mask: 0x01) */
-#define DMA_DMA3_CTRL_REG_DMA_IDLE_Pos (10UL) /*!< DMA_IDLE (Bit 10) */
-#define DMA_DMA3_CTRL_REG_DMA_IDLE_Msk (0x400UL) /*!< DMA_IDLE (Bitfield-Mask: 0x01) */
-#define DMA_DMA3_CTRL_REG_DMA_PRIO_Pos (7UL) /*!< DMA_PRIO (Bit 7) */
-#define DMA_DMA3_CTRL_REG_DMA_PRIO_Msk (0x380UL) /*!< DMA_PRIO (Bitfield-Mask: 0x07) */
-#define DMA_DMA3_CTRL_REG_CIRCULAR_Pos (6UL) /*!< CIRCULAR (Bit 6) */
-#define DMA_DMA3_CTRL_REG_CIRCULAR_Msk (0x40UL) /*!< CIRCULAR (Bitfield-Mask: 0x01) */
-#define DMA_DMA3_CTRL_REG_AINC_Pos (5UL) /*!< AINC (Bit 5) */
-#define DMA_DMA3_CTRL_REG_AINC_Msk (0x20UL) /*!< AINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA3_CTRL_REG_BINC_Pos (4UL) /*!< BINC (Bit 4) */
-#define DMA_DMA3_CTRL_REG_BINC_Msk (0x10UL) /*!< BINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA3_CTRL_REG_DREQ_MODE_Pos (3UL) /*!< DREQ_MODE (Bit 3) */
-#define DMA_DMA3_CTRL_REG_DREQ_MODE_Msk (0x8UL) /*!< DREQ_MODE (Bitfield-Mask: 0x01) */
-#define DMA_DMA3_CTRL_REG_BW_Pos (1UL) /*!< BW (Bit 1) */
-#define DMA_DMA3_CTRL_REG_BW_Msk (0x6UL) /*!< BW (Bitfield-Mask: 0x03) */
-#define DMA_DMA3_CTRL_REG_DMA_ON_Pos (0UL) /*!< DMA_ON (Bit 0) */
-#define DMA_DMA3_CTRL_REG_DMA_ON_Msk (0x1UL) /*!< DMA_ON (Bitfield-Mask: 0x01) */
-/* ===================================================== DMA3_IDX_REG ====================================================== */
-#define DMA_DMA3_IDX_REG_DMA3_IDX_Pos (0UL) /*!< DMA3_IDX (Bit 0) */
-#define DMA_DMA3_IDX_REG_DMA3_IDX_Msk (0xffffUL) /*!< DMA3_IDX (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA3_INT_REG ====================================================== */
-#define DMA_DMA3_INT_REG_DMA3_INT_Pos (0UL) /*!< DMA3_INT (Bit 0) */
-#define DMA_DMA3_INT_REG_DMA3_INT_Msk (0xffffUL) /*!< DMA3_INT (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA3_LEN_REG ====================================================== */
-#define DMA_DMA3_LEN_REG_DMA3_LEN_Pos (0UL) /*!< DMA3_LEN (Bit 0) */
-#define DMA_DMA3_LEN_REG_DMA3_LEN_Msk (0xffffUL) /*!< DMA3_LEN (Bitfield-Mask: 0xffff) */
-/* =================================================== DMA4_A_START_REG ==================================================== */
-#define DMA_DMA4_A_START_REG_DMA4_A_START_Pos (0UL) /*!< DMA4_A_START (Bit 0) */
-#define DMA_DMA4_A_START_REG_DMA4_A_START_Msk (0xffffffffUL) /*!< DMA4_A_START (Bitfield-Mask: 0xffffffff) */
-/* =================================================== DMA4_B_START_REG ==================================================== */
-#define DMA_DMA4_B_START_REG_DMA4_B_START_Pos (0UL) /*!< DMA4_B_START (Bit 0) */
-#define DMA_DMA4_B_START_REG_DMA4_B_START_Msk (0xffffffffUL) /*!< DMA4_B_START (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== DMA4_CTRL_REG ===================================================== */
-#define DMA_DMA4_CTRL_REG_BUS_ERROR_DETECT_Pos (15UL) /*!< BUS_ERROR_DETECT (Bit 15) */
-#define DMA_DMA4_CTRL_REG_BUS_ERROR_DETECT_Msk (0x8000UL) /*!< BUS_ERROR_DETECT (Bitfield-Mask: 0x01) */
-#define DMA_DMA4_CTRL_REG_BURST_MODE_Pos (13UL) /*!< BURST_MODE (Bit 13) */
-#define DMA_DMA4_CTRL_REG_BURST_MODE_Msk (0x6000UL) /*!< BURST_MODE (Bitfield-Mask: 0x03) */
-#define DMA_DMA4_CTRL_REG_REQ_SENSE_Pos (12UL) /*!< REQ_SENSE (Bit 12) */
-#define DMA_DMA4_CTRL_REG_REQ_SENSE_Msk (0x1000UL) /*!< REQ_SENSE (Bitfield-Mask: 0x01) */
-#define DMA_DMA4_CTRL_REG_DMA_INIT_Pos (11UL) /*!< DMA_INIT (Bit 11) */
-#define DMA_DMA4_CTRL_REG_DMA_INIT_Msk (0x800UL) /*!< DMA_INIT (Bitfield-Mask: 0x01) */
-#define DMA_DMA4_CTRL_REG_DMA_IDLE_Pos (10UL) /*!< DMA_IDLE (Bit 10) */
-#define DMA_DMA4_CTRL_REG_DMA_IDLE_Msk (0x400UL) /*!< DMA_IDLE (Bitfield-Mask: 0x01) */
-#define DMA_DMA4_CTRL_REG_DMA_PRIO_Pos (7UL) /*!< DMA_PRIO (Bit 7) */
-#define DMA_DMA4_CTRL_REG_DMA_PRIO_Msk (0x380UL) /*!< DMA_PRIO (Bitfield-Mask: 0x07) */
-#define DMA_DMA4_CTRL_REG_CIRCULAR_Pos (6UL) /*!< CIRCULAR (Bit 6) */
-#define DMA_DMA4_CTRL_REG_CIRCULAR_Msk (0x40UL) /*!< CIRCULAR (Bitfield-Mask: 0x01) */
-#define DMA_DMA4_CTRL_REG_AINC_Pos (5UL) /*!< AINC (Bit 5) */
-#define DMA_DMA4_CTRL_REG_AINC_Msk (0x20UL) /*!< AINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA4_CTRL_REG_BINC_Pos (4UL) /*!< BINC (Bit 4) */
-#define DMA_DMA4_CTRL_REG_BINC_Msk (0x10UL) /*!< BINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA4_CTRL_REG_DREQ_MODE_Pos (3UL) /*!< DREQ_MODE (Bit 3) */
-#define DMA_DMA4_CTRL_REG_DREQ_MODE_Msk (0x8UL) /*!< DREQ_MODE (Bitfield-Mask: 0x01) */
-#define DMA_DMA4_CTRL_REG_BW_Pos (1UL) /*!< BW (Bit 1) */
-#define DMA_DMA4_CTRL_REG_BW_Msk (0x6UL) /*!< BW (Bitfield-Mask: 0x03) */
-#define DMA_DMA4_CTRL_REG_DMA_ON_Pos (0UL) /*!< DMA_ON (Bit 0) */
-#define DMA_DMA4_CTRL_REG_DMA_ON_Msk (0x1UL) /*!< DMA_ON (Bitfield-Mask: 0x01) */
-/* ===================================================== DMA4_IDX_REG ====================================================== */
-#define DMA_DMA4_IDX_REG_DMA4_IDX_Pos (0UL) /*!< DMA4_IDX (Bit 0) */
-#define DMA_DMA4_IDX_REG_DMA4_IDX_Msk (0xffffUL) /*!< DMA4_IDX (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA4_INT_REG ====================================================== */
-#define DMA_DMA4_INT_REG_DMA4_INT_Pos (0UL) /*!< DMA4_INT (Bit 0) */
-#define DMA_DMA4_INT_REG_DMA4_INT_Msk (0xffffUL) /*!< DMA4_INT (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA4_LEN_REG ====================================================== */
-#define DMA_DMA4_LEN_REG_DMA4_LEN_Pos (0UL) /*!< DMA4_LEN (Bit 0) */
-#define DMA_DMA4_LEN_REG_DMA4_LEN_Msk (0xffffUL) /*!< DMA4_LEN (Bitfield-Mask: 0xffff) */
-/* =================================================== DMA5_A_START_REG ==================================================== */
-#define DMA_DMA5_A_START_REG_DMA5_A_START_Pos (0UL) /*!< DMA5_A_START (Bit 0) */
-#define DMA_DMA5_A_START_REG_DMA5_A_START_Msk (0xffffffffUL) /*!< DMA5_A_START (Bitfield-Mask: 0xffffffff) */
-/* =================================================== DMA5_B_START_REG ==================================================== */
-#define DMA_DMA5_B_START_REG_DMA5_B_START_Pos (0UL) /*!< DMA5_B_START (Bit 0) */
-#define DMA_DMA5_B_START_REG_DMA5_B_START_Msk (0xffffffffUL) /*!< DMA5_B_START (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== DMA5_CTRL_REG ===================================================== */
-#define DMA_DMA5_CTRL_REG_BUS_ERROR_DETECT_Pos (15UL) /*!< BUS_ERROR_DETECT (Bit 15) */
-#define DMA_DMA5_CTRL_REG_BUS_ERROR_DETECT_Msk (0x8000UL) /*!< BUS_ERROR_DETECT (Bitfield-Mask: 0x01) */
-#define DMA_DMA5_CTRL_REG_BURST_MODE_Pos (13UL) /*!< BURST_MODE (Bit 13) */
-#define DMA_DMA5_CTRL_REG_BURST_MODE_Msk (0x6000UL) /*!< BURST_MODE (Bitfield-Mask: 0x03) */
-#define DMA_DMA5_CTRL_REG_REQ_SENSE_Pos (12UL) /*!< REQ_SENSE (Bit 12) */
-#define DMA_DMA5_CTRL_REG_REQ_SENSE_Msk (0x1000UL) /*!< REQ_SENSE (Bitfield-Mask: 0x01) */
-#define DMA_DMA5_CTRL_REG_DMA_INIT_Pos (11UL) /*!< DMA_INIT (Bit 11) */
-#define DMA_DMA5_CTRL_REG_DMA_INIT_Msk (0x800UL) /*!< DMA_INIT (Bitfield-Mask: 0x01) */
-#define DMA_DMA5_CTRL_REG_DMA_IDLE_Pos (10UL) /*!< DMA_IDLE (Bit 10) */
-#define DMA_DMA5_CTRL_REG_DMA_IDLE_Msk (0x400UL) /*!< DMA_IDLE (Bitfield-Mask: 0x01) */
-#define DMA_DMA5_CTRL_REG_DMA_PRIO_Pos (7UL) /*!< DMA_PRIO (Bit 7) */
-#define DMA_DMA5_CTRL_REG_DMA_PRIO_Msk (0x380UL) /*!< DMA_PRIO (Bitfield-Mask: 0x07) */
-#define DMA_DMA5_CTRL_REG_CIRCULAR_Pos (6UL) /*!< CIRCULAR (Bit 6) */
-#define DMA_DMA5_CTRL_REG_CIRCULAR_Msk (0x40UL) /*!< CIRCULAR (Bitfield-Mask: 0x01) */
-#define DMA_DMA5_CTRL_REG_AINC_Pos (5UL) /*!< AINC (Bit 5) */
-#define DMA_DMA5_CTRL_REG_AINC_Msk (0x20UL) /*!< AINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA5_CTRL_REG_BINC_Pos (4UL) /*!< BINC (Bit 4) */
-#define DMA_DMA5_CTRL_REG_BINC_Msk (0x10UL) /*!< BINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA5_CTRL_REG_DREQ_MODE_Pos (3UL) /*!< DREQ_MODE (Bit 3) */
-#define DMA_DMA5_CTRL_REG_DREQ_MODE_Msk (0x8UL) /*!< DREQ_MODE (Bitfield-Mask: 0x01) */
-#define DMA_DMA5_CTRL_REG_BW_Pos (1UL) /*!< BW (Bit 1) */
-#define DMA_DMA5_CTRL_REG_BW_Msk (0x6UL) /*!< BW (Bitfield-Mask: 0x03) */
-#define DMA_DMA5_CTRL_REG_DMA_ON_Pos (0UL) /*!< DMA_ON (Bit 0) */
-#define DMA_DMA5_CTRL_REG_DMA_ON_Msk (0x1UL) /*!< DMA_ON (Bitfield-Mask: 0x01) */
-/* ===================================================== DMA5_IDX_REG ====================================================== */
-#define DMA_DMA5_IDX_REG_DMA5_IDX_Pos (0UL) /*!< DMA5_IDX (Bit 0) */
-#define DMA_DMA5_IDX_REG_DMA5_IDX_Msk (0xffffUL) /*!< DMA5_IDX (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA5_INT_REG ====================================================== */
-#define DMA_DMA5_INT_REG_DMA5_INT_Pos (0UL) /*!< DMA5_INT (Bit 0) */
-#define DMA_DMA5_INT_REG_DMA5_INT_Msk (0xffffUL) /*!< DMA5_INT (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA5_LEN_REG ====================================================== */
-#define DMA_DMA5_LEN_REG_DMA5_LEN_Pos (0UL) /*!< DMA5_LEN (Bit 0) */
-#define DMA_DMA5_LEN_REG_DMA5_LEN_Msk (0xffffUL) /*!< DMA5_LEN (Bitfield-Mask: 0xffff) */
-/* =================================================== DMA6_A_START_REG ==================================================== */
-#define DMA_DMA6_A_START_REG_DMA6_A_START_Pos (0UL) /*!< DMA6_A_START (Bit 0) */
-#define DMA_DMA6_A_START_REG_DMA6_A_START_Msk (0xffffffffUL) /*!< DMA6_A_START (Bitfield-Mask: 0xffffffff) */
-/* =================================================== DMA6_B_START_REG ==================================================== */
-#define DMA_DMA6_B_START_REG_DMA6_B_START_Pos (0UL) /*!< DMA6_B_START (Bit 0) */
-#define DMA_DMA6_B_START_REG_DMA6_B_START_Msk (0xffffffffUL) /*!< DMA6_B_START (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== DMA6_CTRL_REG ===================================================== */
-#define DMA_DMA6_CTRL_REG_BUS_ERROR_DETECT_Pos (15UL) /*!< BUS_ERROR_DETECT (Bit 15) */
-#define DMA_DMA6_CTRL_REG_BUS_ERROR_DETECT_Msk (0x8000UL) /*!< BUS_ERROR_DETECT (Bitfield-Mask: 0x01) */
-#define DMA_DMA6_CTRL_REG_BURST_MODE_Pos (13UL) /*!< BURST_MODE (Bit 13) */
-#define DMA_DMA6_CTRL_REG_BURST_MODE_Msk (0x6000UL) /*!< BURST_MODE (Bitfield-Mask: 0x03) */
-#define DMA_DMA6_CTRL_REG_REQ_SENSE_Pos (12UL) /*!< REQ_SENSE (Bit 12) */
-#define DMA_DMA6_CTRL_REG_REQ_SENSE_Msk (0x1000UL) /*!< REQ_SENSE (Bitfield-Mask: 0x01) */
-#define DMA_DMA6_CTRL_REG_DMA_INIT_Pos (11UL) /*!< DMA_INIT (Bit 11) */
-#define DMA_DMA6_CTRL_REG_DMA_INIT_Msk (0x800UL) /*!< DMA_INIT (Bitfield-Mask: 0x01) */
-#define DMA_DMA6_CTRL_REG_DMA_IDLE_Pos (10UL) /*!< DMA_IDLE (Bit 10) */
-#define DMA_DMA6_CTRL_REG_DMA_IDLE_Msk (0x400UL) /*!< DMA_IDLE (Bitfield-Mask: 0x01) */
-#define DMA_DMA6_CTRL_REG_DMA_PRIO_Pos (7UL) /*!< DMA_PRIO (Bit 7) */
-#define DMA_DMA6_CTRL_REG_DMA_PRIO_Msk (0x380UL) /*!< DMA_PRIO (Bitfield-Mask: 0x07) */
-#define DMA_DMA6_CTRL_REG_CIRCULAR_Pos (6UL) /*!< CIRCULAR (Bit 6) */
-#define DMA_DMA6_CTRL_REG_CIRCULAR_Msk (0x40UL) /*!< CIRCULAR (Bitfield-Mask: 0x01) */
-#define DMA_DMA6_CTRL_REG_AINC_Pos (5UL) /*!< AINC (Bit 5) */
-#define DMA_DMA6_CTRL_REG_AINC_Msk (0x20UL) /*!< AINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA6_CTRL_REG_BINC_Pos (4UL) /*!< BINC (Bit 4) */
-#define DMA_DMA6_CTRL_REG_BINC_Msk (0x10UL) /*!< BINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA6_CTRL_REG_DREQ_MODE_Pos (3UL) /*!< DREQ_MODE (Bit 3) */
-#define DMA_DMA6_CTRL_REG_DREQ_MODE_Msk (0x8UL) /*!< DREQ_MODE (Bitfield-Mask: 0x01) */
-#define DMA_DMA6_CTRL_REG_BW_Pos (1UL) /*!< BW (Bit 1) */
-#define DMA_DMA6_CTRL_REG_BW_Msk (0x6UL) /*!< BW (Bitfield-Mask: 0x03) */
-#define DMA_DMA6_CTRL_REG_DMA_ON_Pos (0UL) /*!< DMA_ON (Bit 0) */
-#define DMA_DMA6_CTRL_REG_DMA_ON_Msk (0x1UL) /*!< DMA_ON (Bitfield-Mask: 0x01) */
-/* ===================================================== DMA6_IDX_REG ====================================================== */
-#define DMA_DMA6_IDX_REG_DMA6_IDX_Pos (0UL) /*!< DMA6_IDX (Bit 0) */
-#define DMA_DMA6_IDX_REG_DMA6_IDX_Msk (0xffffUL) /*!< DMA6_IDX (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA6_INT_REG ====================================================== */
-#define DMA_DMA6_INT_REG_DMA6_INT_Pos (0UL) /*!< DMA6_INT (Bit 0) */
-#define DMA_DMA6_INT_REG_DMA6_INT_Msk (0xffffUL) /*!< DMA6_INT (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA6_LEN_REG ====================================================== */
-#define DMA_DMA6_LEN_REG_DMA6_LEN_Pos (0UL) /*!< DMA6_LEN (Bit 0) */
-#define DMA_DMA6_LEN_REG_DMA6_LEN_Msk (0xffffUL) /*!< DMA6_LEN (Bitfield-Mask: 0xffff) */
-/* =================================================== DMA7_A_START_REG ==================================================== */
-#define DMA_DMA7_A_START_REG_DMA7_A_START_Pos (0UL) /*!< DMA7_A_START (Bit 0) */
-#define DMA_DMA7_A_START_REG_DMA7_A_START_Msk (0xffffffffUL) /*!< DMA7_A_START (Bitfield-Mask: 0xffffffff) */
-/* =================================================== DMA7_B_START_REG ==================================================== */
-#define DMA_DMA7_B_START_REG_DMA7_B_START_Pos (0UL) /*!< DMA7_B_START (Bit 0) */
-#define DMA_DMA7_B_START_REG_DMA7_B_START_Msk (0xffffffffUL) /*!< DMA7_B_START (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== DMA7_CTRL_REG ===================================================== */
-#define DMA_DMA7_CTRL_REG_BUS_ERROR_DETECT_Pos (15UL) /*!< BUS_ERROR_DETECT (Bit 15) */
-#define DMA_DMA7_CTRL_REG_BUS_ERROR_DETECT_Msk (0x8000UL) /*!< BUS_ERROR_DETECT (Bitfield-Mask: 0x01) */
-#define DMA_DMA7_CTRL_REG_BURST_MODE_Pos (13UL) /*!< BURST_MODE (Bit 13) */
-#define DMA_DMA7_CTRL_REG_BURST_MODE_Msk (0x6000UL) /*!< BURST_MODE (Bitfield-Mask: 0x03) */
-#define DMA_DMA7_CTRL_REG_REQ_SENSE_Pos (12UL) /*!< REQ_SENSE (Bit 12) */
-#define DMA_DMA7_CTRL_REG_REQ_SENSE_Msk (0x1000UL) /*!< REQ_SENSE (Bitfield-Mask: 0x01) */
-#define DMA_DMA7_CTRL_REG_DMA_INIT_Pos (11UL) /*!< DMA_INIT (Bit 11) */
-#define DMA_DMA7_CTRL_REG_DMA_INIT_Msk (0x800UL) /*!< DMA_INIT (Bitfield-Mask: 0x01) */
-#define DMA_DMA7_CTRL_REG_DMA_IDLE_Pos (10UL) /*!< DMA_IDLE (Bit 10) */
-#define DMA_DMA7_CTRL_REG_DMA_IDLE_Msk (0x400UL) /*!< DMA_IDLE (Bitfield-Mask: 0x01) */
-#define DMA_DMA7_CTRL_REG_DMA_PRIO_Pos (7UL) /*!< DMA_PRIO (Bit 7) */
-#define DMA_DMA7_CTRL_REG_DMA_PRIO_Msk (0x380UL) /*!< DMA_PRIO (Bitfield-Mask: 0x07) */
-#define DMA_DMA7_CTRL_REG_CIRCULAR_Pos (6UL) /*!< CIRCULAR (Bit 6) */
-#define DMA_DMA7_CTRL_REG_CIRCULAR_Msk (0x40UL) /*!< CIRCULAR (Bitfield-Mask: 0x01) */
-#define DMA_DMA7_CTRL_REG_AINC_Pos (5UL) /*!< AINC (Bit 5) */
-#define DMA_DMA7_CTRL_REG_AINC_Msk (0x20UL) /*!< AINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA7_CTRL_REG_BINC_Pos (4UL) /*!< BINC (Bit 4) */
-#define DMA_DMA7_CTRL_REG_BINC_Msk (0x10UL) /*!< BINC (Bitfield-Mask: 0x01) */
-#define DMA_DMA7_CTRL_REG_DREQ_MODE_Pos (3UL) /*!< DREQ_MODE (Bit 3) */
-#define DMA_DMA7_CTRL_REG_DREQ_MODE_Msk (0x8UL) /*!< DREQ_MODE (Bitfield-Mask: 0x01) */
-#define DMA_DMA7_CTRL_REG_BW_Pos (1UL) /*!< BW (Bit 1) */
-#define DMA_DMA7_CTRL_REG_BW_Msk (0x6UL) /*!< BW (Bitfield-Mask: 0x03) */
-#define DMA_DMA7_CTRL_REG_DMA_ON_Pos (0UL) /*!< DMA_ON (Bit 0) */
-#define DMA_DMA7_CTRL_REG_DMA_ON_Msk (0x1UL) /*!< DMA_ON (Bitfield-Mask: 0x01) */
-/* ===================================================== DMA7_IDX_REG ====================================================== */
-#define DMA_DMA7_IDX_REG_DMA7_IDX_Pos (0UL) /*!< DMA7_IDX (Bit 0) */
-#define DMA_DMA7_IDX_REG_DMA7_IDX_Msk (0xffffUL) /*!< DMA7_IDX (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA7_INT_REG ====================================================== */
-#define DMA_DMA7_INT_REG_DMA7_INT_Pos (0UL) /*!< DMA7_INT (Bit 0) */
-#define DMA_DMA7_INT_REG_DMA7_INT_Msk (0xffffUL) /*!< DMA7_INT (Bitfield-Mask: 0xffff) */
-/* ===================================================== DMA7_LEN_REG ====================================================== */
-#define DMA_DMA7_LEN_REG_DMA7_LEN_Pos (0UL) /*!< DMA7_LEN (Bit 0) */
-#define DMA_DMA7_LEN_REG_DMA7_LEN_Msk (0xffffUL) /*!< DMA7_LEN (Bitfield-Mask: 0xffff) */
-/* =================================================== DMA_CLEAR_INT_REG =================================================== */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH7_Pos (7UL) /*!< DMA_RST_IRQ_CH7 (Bit 7) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH7_Msk (0x80UL) /*!< DMA_RST_IRQ_CH7 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH6_Pos (6UL) /*!< DMA_RST_IRQ_CH6 (Bit 6) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH6_Msk (0x40UL) /*!< DMA_RST_IRQ_CH6 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH5_Pos (5UL) /*!< DMA_RST_IRQ_CH5 (Bit 5) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH5_Msk (0x20UL) /*!< DMA_RST_IRQ_CH5 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH4_Pos (4UL) /*!< DMA_RST_IRQ_CH4 (Bit 4) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH4_Msk (0x10UL) /*!< DMA_RST_IRQ_CH4 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH3_Pos (3UL) /*!< DMA_RST_IRQ_CH3 (Bit 3) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH3_Msk (0x8UL) /*!< DMA_RST_IRQ_CH3 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH2_Pos (2UL) /*!< DMA_RST_IRQ_CH2 (Bit 2) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH2_Msk (0x4UL) /*!< DMA_RST_IRQ_CH2 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH1_Pos (1UL) /*!< DMA_RST_IRQ_CH1 (Bit 1) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH1_Msk (0x2UL) /*!< DMA_RST_IRQ_CH1 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH0_Pos (0UL) /*!< DMA_RST_IRQ_CH0 (Bit 0) */
-#define DMA_DMA_CLEAR_INT_REG_DMA_RST_IRQ_CH0_Msk (0x1UL) /*!< DMA_RST_IRQ_CH0 (Bitfield-Mask: 0x01) */
-/* =================================================== DMA_INT_MASK_REG ==================================================== */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE7_Pos (7UL) /*!< DMA_IRQ_ENABLE7 (Bit 7) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE7_Msk (0x80UL) /*!< DMA_IRQ_ENABLE7 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE6_Pos (6UL) /*!< DMA_IRQ_ENABLE6 (Bit 6) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE6_Msk (0x40UL) /*!< DMA_IRQ_ENABLE6 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE5_Pos (5UL) /*!< DMA_IRQ_ENABLE5 (Bit 5) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE5_Msk (0x20UL) /*!< DMA_IRQ_ENABLE5 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE4_Pos (4UL) /*!< DMA_IRQ_ENABLE4 (Bit 4) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE4_Msk (0x10UL) /*!< DMA_IRQ_ENABLE4 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE3_Pos (3UL) /*!< DMA_IRQ_ENABLE3 (Bit 3) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE3_Msk (0x8UL) /*!< DMA_IRQ_ENABLE3 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE2_Pos (2UL) /*!< DMA_IRQ_ENABLE2 (Bit 2) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE2_Msk (0x4UL) /*!< DMA_IRQ_ENABLE2 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE1_Pos (1UL) /*!< DMA_IRQ_ENABLE1 (Bit 1) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE1_Msk (0x2UL) /*!< DMA_IRQ_ENABLE1 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE0_Pos (0UL) /*!< DMA_IRQ_ENABLE0 (Bit 0) */
-#define DMA_DMA_INT_MASK_REG_DMA_IRQ_ENABLE0_Msk (0x1UL) /*!< DMA_IRQ_ENABLE0 (Bitfield-Mask: 0x01) */
-/* ================================================== DMA_INT_STATUS_REG =================================================== */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR7_Pos (15UL) /*!< DMA_BUS_ERR7 (Bit 15) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR7_Msk (0x8000UL) /*!< DMA_BUS_ERR7 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR6_Pos (14UL) /*!< DMA_BUS_ERR6 (Bit 14) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR6_Msk (0x4000UL) /*!< DMA_BUS_ERR6 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR5_Pos (13UL) /*!< DMA_BUS_ERR5 (Bit 13) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR5_Msk (0x2000UL) /*!< DMA_BUS_ERR5 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR4_Pos (12UL) /*!< DMA_BUS_ERR4 (Bit 12) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR4_Msk (0x1000UL) /*!< DMA_BUS_ERR4 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR3_Pos (11UL) /*!< DMA_BUS_ERR3 (Bit 11) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR3_Msk (0x800UL) /*!< DMA_BUS_ERR3 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR2_Pos (10UL) /*!< DMA_BUS_ERR2 (Bit 10) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR2_Msk (0x400UL) /*!< DMA_BUS_ERR2 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR1_Pos (9UL) /*!< DMA_BUS_ERR1 (Bit 9) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR1_Msk (0x200UL) /*!< DMA_BUS_ERR1 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR0_Pos (8UL) /*!< DMA_BUS_ERR0 (Bit 8) */
-#define DMA_DMA_INT_STATUS_REG_DMA_BUS_ERR0_Msk (0x100UL) /*!< DMA_BUS_ERR0 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH7_Pos (7UL) /*!< DMA_IRQ_CH7 (Bit 7) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH7_Msk (0x80UL) /*!< DMA_IRQ_CH7 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH6_Pos (6UL) /*!< DMA_IRQ_CH6 (Bit 6) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH6_Msk (0x40UL) /*!< DMA_IRQ_CH6 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH5_Pos (5UL) /*!< DMA_IRQ_CH5 (Bit 5) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH5_Msk (0x20UL) /*!< DMA_IRQ_CH5 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH4_Pos (4UL) /*!< DMA_IRQ_CH4 (Bit 4) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH4_Msk (0x10UL) /*!< DMA_IRQ_CH4 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH3_Pos (3UL) /*!< DMA_IRQ_CH3 (Bit 3) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH3_Msk (0x8UL) /*!< DMA_IRQ_CH3 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH2_Pos (2UL) /*!< DMA_IRQ_CH2 (Bit 2) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH2_Msk (0x4UL) /*!< DMA_IRQ_CH2 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH1_Pos (1UL) /*!< DMA_IRQ_CH1 (Bit 1) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH1_Msk (0x2UL) /*!< DMA_IRQ_CH1 (Bitfield-Mask: 0x01) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH0_Pos (0UL) /*!< DMA_IRQ_CH0 (Bit 0) */
-#define DMA_DMA_INT_STATUS_REG_DMA_IRQ_CH0_Msk (0x1UL) /*!< DMA_IRQ_CH0 (Bitfield-Mask: 0x01) */
-/* ==================================================== DMA_REQ_MUX_REG ==================================================== */
-#define DMA_DMA_REQ_MUX_REG_DMA67_SEL_Pos (12UL) /*!< DMA67_SEL (Bit 12) */
-#define DMA_DMA_REQ_MUX_REG_DMA67_SEL_Msk (0xf000UL) /*!< DMA67_SEL (Bitfield-Mask: 0x0f) */
-#define DMA_DMA_REQ_MUX_REG_DMA45_SEL_Pos (8UL) /*!< DMA45_SEL (Bit 8) */
-#define DMA_DMA_REQ_MUX_REG_DMA45_SEL_Msk (0xf00UL) /*!< DMA45_SEL (Bitfield-Mask: 0x0f) */
-#define DMA_DMA_REQ_MUX_REG_DMA23_SEL_Pos (4UL) /*!< DMA23_SEL (Bit 4) */
-#define DMA_DMA_REQ_MUX_REG_DMA23_SEL_Msk (0xf0UL) /*!< DMA23_SEL (Bitfield-Mask: 0x0f) */
-#define DMA_DMA_REQ_MUX_REG_DMA01_SEL_Pos (0UL) /*!< DMA01_SEL (Bit 0) */
-#define DMA_DMA_REQ_MUX_REG_DMA01_SEL_Msk (0xfUL) /*!< DMA01_SEL (Bitfield-Mask: 0x0f) */
-
-
-/* =========================================================================================================================== */
-/* ================ DW ================ */
-/* =========================================================================================================================== */
-
-/* =================================================== AHB_DMA_CCLM1_REG =================================================== */
-#define DW_AHB_DMA_CCLM1_REG_AHB_DMA_CCLM_Pos (0UL) /*!< AHB_DMA_CCLM (Bit 0) */
-#define DW_AHB_DMA_CCLM1_REG_AHB_DMA_CCLM_Msk (0xffffUL) /*!< AHB_DMA_CCLM (Bitfield-Mask: 0xffff) */
-/* =================================================== AHB_DMA_CCLM2_REG =================================================== */
-#define DW_AHB_DMA_CCLM2_REG_AHB_DMA_CCLM_Pos (0UL) /*!< AHB_DMA_CCLM (Bit 0) */
-#define DW_AHB_DMA_CCLM2_REG_AHB_DMA_CCLM_Msk (0xffffUL) /*!< AHB_DMA_CCLM (Bitfield-Mask: 0xffff) */
-/* =================================================== AHB_DMA_CCLM3_REG =================================================== */
-#define DW_AHB_DMA_CCLM3_REG_AHB_DMA_CCLM_Pos (0UL) /*!< AHB_DMA_CCLM (Bit 0) */
-#define DW_AHB_DMA_CCLM3_REG_AHB_DMA_CCLM_Msk (0xffffUL) /*!< AHB_DMA_CCLM (Bitfield-Mask: 0xffff) */
-/* =================================================== AHB_DMA_CCLM4_REG =================================================== */
-#define DW_AHB_DMA_CCLM4_REG_AHB_DMA_CCLM_Pos (0UL) /*!< AHB_DMA_CCLM (Bit 0) */
-#define DW_AHB_DMA_CCLM4_REG_AHB_DMA_CCLM_Msk (0xffffUL) /*!< AHB_DMA_CCLM (Bitfield-Mask: 0xffff) */
-/* ================================================ AHB_DMA_DFLT_MASTER_REG ================================================ */
-#define DW_AHB_DMA_DFLT_MASTER_REG_AHB_DMA_DFLT_MASTER_Pos (0UL) /*!< AHB_DMA_DFLT_MASTER (Bit 0) */
-#define DW_AHB_DMA_DFLT_MASTER_REG_AHB_DMA_DFLT_MASTER_Msk (0xfUL) /*!< AHB_DMA_DFLT_MASTER (Bitfield-Mask: 0x0f) */
-/* ==================================================== AHB_DMA_PL1_REG ==================================================== */
-#define DW_AHB_DMA_PL1_REG_AHB_DMA_PL1_Pos (0UL) /*!< AHB_DMA_PL1 (Bit 0) */
-#define DW_AHB_DMA_PL1_REG_AHB_DMA_PL1_Msk (0xfUL) /*!< AHB_DMA_PL1 (Bitfield-Mask: 0x0f) */
-/* ==================================================== AHB_DMA_PL2_REG ==================================================== */
-#define DW_AHB_DMA_PL2_REG_AHB_DMA_PL2_Pos (0UL) /*!< AHB_DMA_PL2 (Bit 0) */
-#define DW_AHB_DMA_PL2_REG_AHB_DMA_PL2_Msk (0xfUL) /*!< AHB_DMA_PL2 (Bitfield-Mask: 0x0f) */
-/* ==================================================== AHB_DMA_PL3_REG ==================================================== */
-#define DW_AHB_DMA_PL3_REG_AHB_DMA_PL3_Pos (0UL) /*!< AHB_DMA_PL3 (Bit 0) */
-#define DW_AHB_DMA_PL3_REG_AHB_DMA_PL3_Msk (0xfUL) /*!< AHB_DMA_PL3 (Bitfield-Mask: 0x0f) */
-/* ==================================================== AHB_DMA_PL4_REG ==================================================== */
-#define DW_AHB_DMA_PL4_REG_AHB_DMA_PL4_Pos (0UL) /*!< AHB_DMA_PL4 (Bit 0) */
-#define DW_AHB_DMA_PL4_REG_AHB_DMA_PL4_Msk (0xfUL) /*!< AHB_DMA_PL4 (Bitfield-Mask: 0x0f) */
-/* ==================================================== AHB_DMA_TCL_REG ==================================================== */
-#define DW_AHB_DMA_TCL_REG_AHB_DMA_TCL_Pos (0UL) /*!< AHB_DMA_TCL (Bit 0) */
-#define DW_AHB_DMA_TCL_REG_AHB_DMA_TCL_Msk (0xffffUL) /*!< AHB_DMA_TCL (Bitfield-Mask: 0xffff) */
-/* ================================================== AHB_DMA_VERSION_REG ================================================== */
-#define DW_AHB_DMA_VERSION_REG_AHB_DMA_VERSION_Pos (0UL) /*!< AHB_DMA_VERSION (Bit 0) */
-#define DW_AHB_DMA_VERSION_REG_AHB_DMA_VERSION_Msk (0xffffffffUL) /*!< AHB_DMA_VERSION (Bitfield-Mask: 0xffffffff) */
-/* =================================================== AHB_DMA_WTEN_REG ==================================================== */
-#define DW_AHB_DMA_WTEN_REG_AHB_DMA_WTEN_Pos (0UL) /*!< AHB_DMA_WTEN (Bit 0) */
-#define DW_AHB_DMA_WTEN_REG_AHB_DMA_WTEN_Msk (0x1UL) /*!< AHB_DMA_WTEN (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ GPADC ================ */
-/* =========================================================================================================================== */
-
-/* ================================================= GP_ADC_CLEAR_INT_REG ================================================== */
-#define GPADC_GP_ADC_CLEAR_INT_REG_GP_ADC_CLR_INT_Pos (0UL) /*!< GP_ADC_CLR_INT (Bit 0) */
-#define GPADC_GP_ADC_CLEAR_INT_REG_GP_ADC_CLR_INT_Msk (0xffffUL) /*!< GP_ADC_CLR_INT (Bitfield-Mask: 0xffff) */
-/* =================================================== GP_ADC_CTRL2_REG ==================================================== */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_STORE_DEL_Pos (12UL) /*!< GP_ADC_STORE_DEL (Bit 12) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_STORE_DEL_Msk (0xf000UL) /*!< GP_ADC_STORE_DEL (Bitfield-Mask: 0x0f) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_SMPL_TIME_Pos (8UL) /*!< GP_ADC_SMPL_TIME (Bit 8) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_SMPL_TIME_Msk (0xf00UL) /*!< GP_ADC_SMPL_TIME (Bitfield-Mask: 0x0f) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_CONV_NRS_Pos (5UL) /*!< GP_ADC_CONV_NRS (Bit 5) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_CONV_NRS_Msk (0xe0UL) /*!< GP_ADC_CONV_NRS (Bitfield-Mask: 0x07) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_DMA_EN_Pos (3UL) /*!< GP_ADC_DMA_EN (Bit 3) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_DMA_EN_Msk (0x8UL) /*!< GP_ADC_DMA_EN (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_I20U_Pos (2UL) /*!< GP_ADC_I20U (Bit 2) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_I20U_Msk (0x4UL) /*!< GP_ADC_I20U (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_IDYN_Pos (1UL) /*!< GP_ADC_IDYN (Bit 1) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_IDYN_Msk (0x2UL) /*!< GP_ADC_IDYN (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_ATTN3X_Pos (0UL) /*!< GP_ADC_ATTN3X (Bit 0) */
-#define GPADC_GP_ADC_CTRL2_REG_GP_ADC_ATTN3X_Msk (0x1UL) /*!< GP_ADC_ATTN3X (Bitfield-Mask: 0x01) */
-/* =================================================== GP_ADC_CTRL3_REG ==================================================== */
-#define GPADC_GP_ADC_CTRL3_REG_GP_ADC_INTERVAL_Pos (8UL) /*!< GP_ADC_INTERVAL (Bit 8) */
-#define GPADC_GP_ADC_CTRL3_REG_GP_ADC_INTERVAL_Msk (0xff00UL) /*!< GP_ADC_INTERVAL (Bitfield-Mask: 0xff) */
-#define GPADC_GP_ADC_CTRL3_REG_GP_ADC_EN_DEL_Pos (0UL) /*!< GP_ADC_EN_DEL (Bit 0) */
-#define GPADC_GP_ADC_CTRL3_REG_GP_ADC_EN_DEL_Msk (0xffUL) /*!< GP_ADC_EN_DEL (Bitfield-Mask: 0xff) */
-/* ==================================================== GP_ADC_CTRL_REG ==================================================== */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_DIFF_TEMP_EN_Pos (18UL) /*!< GP_ADC_DIFF_TEMP_EN (Bit 18) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_DIFF_TEMP_EN_Msk (0x40000UL) /*!< GP_ADC_DIFF_TEMP_EN (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_DIFF_TEMP_SEL_Pos (16UL) /*!< GP_ADC_DIFF_TEMP_SEL (Bit 16) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_DIFF_TEMP_SEL_Msk (0x30000UL) /*!< GP_ADC_DIFF_TEMP_SEL (Bitfield-Mask: 0x03) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_LDO_ZERO_Pos (15UL) /*!< GP_ADC_LDO_ZERO (Bit 15) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_LDO_ZERO_Msk (0x8000UL) /*!< GP_ADC_LDO_ZERO (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_CHOP_Pos (14UL) /*!< GP_ADC_CHOP (Bit 14) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_CHOP_Msk (0x4000UL) /*!< GP_ADC_CHOP (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_SIGN_Pos (13UL) /*!< GP_ADC_SIGN (Bit 13) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_SIGN_Msk (0x2000UL) /*!< GP_ADC_SIGN (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_SEL_Pos (8UL) /*!< GP_ADC_SEL (Bit 8) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_SEL_Msk (0x1f00UL) /*!< GP_ADC_SEL (Bitfield-Mask: 0x1f) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_MUTE_Pos (7UL) /*!< GP_ADC_MUTE (Bit 7) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_MUTE_Msk (0x80UL) /*!< GP_ADC_MUTE (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_SE_Pos (6UL) /*!< GP_ADC_SE (Bit 6) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_SE_Msk (0x40UL) /*!< GP_ADC_SE (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_MINT_Pos (5UL) /*!< GP_ADC_MINT (Bit 5) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_MINT_Msk (0x20UL) /*!< GP_ADC_MINT (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_INT_Pos (4UL) /*!< GP_ADC_INT (Bit 4) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_INT_Msk (0x10UL) /*!< GP_ADC_INT (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_CLK_SEL_Pos (3UL) /*!< GP_ADC_CLK_SEL (Bit 3) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_CLK_SEL_Msk (0x8UL) /*!< GP_ADC_CLK_SEL (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_CONT_Pos (2UL) /*!< GP_ADC_CONT (Bit 2) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_CONT_Msk (0x4UL) /*!< GP_ADC_CONT (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_START_Pos (1UL) /*!< GP_ADC_START (Bit 1) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_START_Msk (0x2UL) /*!< GP_ADC_START (Bitfield-Mask: 0x01) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_EN_Pos (0UL) /*!< GP_ADC_EN (Bit 0) */
-#define GPADC_GP_ADC_CTRL_REG_GP_ADC_EN_Msk (0x1UL) /*!< GP_ADC_EN (Bitfield-Mask: 0x01) */
-/* ==================================================== GP_ADC_OFFN_REG ==================================================== */
-#define GPADC_GP_ADC_OFFN_REG_GP_ADC_OFFN_Pos (0UL) /*!< GP_ADC_OFFN (Bit 0) */
-#define GPADC_GP_ADC_OFFN_REG_GP_ADC_OFFN_Msk (0x3ffUL) /*!< GP_ADC_OFFN (Bitfield-Mask: 0x3ff) */
-/* ==================================================== GP_ADC_OFFP_REG ==================================================== */
-#define GPADC_GP_ADC_OFFP_REG_GP_ADC_OFFP_Pos (0UL) /*!< GP_ADC_OFFP (Bit 0) */
-#define GPADC_GP_ADC_OFFP_REG_GP_ADC_OFFP_Msk (0x3ffUL) /*!< GP_ADC_OFFP (Bitfield-Mask: 0x3ff) */
-/* =================================================== GP_ADC_RESULT_REG =================================================== */
-#define GPADC_GP_ADC_RESULT_REG_GP_ADC_VAL_Pos (0UL) /*!< GP_ADC_VAL (Bit 0) */
-#define GPADC_GP_ADC_RESULT_REG_GP_ADC_VAL_Msk (0xffffUL) /*!< GP_ADC_VAL (Bitfield-Mask: 0xffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ GPIO ================ */
-/* =========================================================================================================================== */
-
-/* =================================================== GPIO_CLK_SEL_REG ==================================================== */
-#define GPIO_GPIO_CLK_SEL_REG_DIVN_OUTPUT_EN_Pos (9UL) /*!< DIVN_OUTPUT_EN (Bit 9) */
-#define GPIO_GPIO_CLK_SEL_REG_DIVN_OUTPUT_EN_Msk (0x200UL) /*!< DIVN_OUTPUT_EN (Bitfield-Mask: 0x01) */
-#define GPIO_GPIO_CLK_SEL_REG_RC32M_OUTPUT_EN_Pos (8UL) /*!< RC32M_OUTPUT_EN (Bit 8) */
-#define GPIO_GPIO_CLK_SEL_REG_RC32M_OUTPUT_EN_Msk (0x100UL) /*!< RC32M_OUTPUT_EN (Bitfield-Mask: 0x01) */
-#define GPIO_GPIO_CLK_SEL_REG_XTAL32M_OUTPUT_EN_Pos (7UL) /*!< XTAL32M_OUTPUT_EN (Bit 7) */
-#define GPIO_GPIO_CLK_SEL_REG_XTAL32M_OUTPUT_EN_Msk (0x80UL) /*!< XTAL32M_OUTPUT_EN (Bitfield-Mask: 0x01) */
-#define GPIO_GPIO_CLK_SEL_REG_RCX_OUTPUT_EN_Pos (6UL) /*!< RCX_OUTPUT_EN (Bit 6) */
-#define GPIO_GPIO_CLK_SEL_REG_RCX_OUTPUT_EN_Msk (0x40UL) /*!< RCX_OUTPUT_EN (Bitfield-Mask: 0x01) */
-#define GPIO_GPIO_CLK_SEL_REG_RC32K_OUTPUT_EN_Pos (5UL) /*!< RC32K_OUTPUT_EN (Bit 5) */
-#define GPIO_GPIO_CLK_SEL_REG_RC32K_OUTPUT_EN_Msk (0x20UL) /*!< RC32K_OUTPUT_EN (Bitfield-Mask: 0x01) */
-#define GPIO_GPIO_CLK_SEL_REG_XTAL32K_OUTPUT_EN_Pos (4UL) /*!< XTAL32K_OUTPUT_EN (Bit 4) */
-#define GPIO_GPIO_CLK_SEL_REG_XTAL32K_OUTPUT_EN_Msk (0x10UL) /*!< XTAL32K_OUTPUT_EN (Bitfield-Mask: 0x01) */
-#define GPIO_GPIO_CLK_SEL_REG_FUNC_CLOCK_EN_Pos (3UL) /*!< FUNC_CLOCK_EN (Bit 3) */
-#define GPIO_GPIO_CLK_SEL_REG_FUNC_CLOCK_EN_Msk (0x8UL) /*!< FUNC_CLOCK_EN (Bitfield-Mask: 0x01) */
-#define GPIO_GPIO_CLK_SEL_REG_FUNC_CLOCK_SEL_Pos (0UL) /*!< FUNC_CLOCK_SEL (Bit 0) */
-#define GPIO_GPIO_CLK_SEL_REG_FUNC_CLOCK_SEL_Msk (0x7UL) /*!< FUNC_CLOCK_SEL (Bitfield-Mask: 0x07) */
-/* ==================================================== P0_00_MODE_REG ===================================================== */
-#define GPIO_P0_00_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_00_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_00_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_00_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_00_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_00_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_01_MODE_REG ===================================================== */
-#define GPIO_P0_01_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_01_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_01_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_01_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_01_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_01_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_02_MODE_REG ===================================================== */
-#define GPIO_P0_02_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_02_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_02_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_02_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_02_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_02_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_03_MODE_REG ===================================================== */
-#define GPIO_P0_03_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_03_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_03_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_03_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_03_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_03_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_04_MODE_REG ===================================================== */
-#define GPIO_P0_04_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_04_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_04_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_04_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_04_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_04_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_05_MODE_REG ===================================================== */
-#define GPIO_P0_05_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_05_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_05_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_05_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_05_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_05_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_06_MODE_REG ===================================================== */
-#define GPIO_P0_06_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_06_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_06_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_06_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_06_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_06_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_07_MODE_REG ===================================================== */
-#define GPIO_P0_07_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_07_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_07_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_07_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_07_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_07_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_08_MODE_REG ===================================================== */
-#define GPIO_P0_08_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_08_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_08_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_08_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_08_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_08_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_09_MODE_REG ===================================================== */
-#define GPIO_P0_09_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_09_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_09_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_09_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_09_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_09_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_10_MODE_REG ===================================================== */
-#define GPIO_P0_10_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_10_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_10_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_10_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_10_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_10_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_11_MODE_REG ===================================================== */
-#define GPIO_P0_11_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_11_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_11_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_11_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_11_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_11_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_12_MODE_REG ===================================================== */
-#define GPIO_P0_12_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_12_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_12_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_12_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_12_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_12_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_13_MODE_REG ===================================================== */
-#define GPIO_P0_13_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_13_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_13_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_13_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_13_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_13_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_14_MODE_REG ===================================================== */
-#define GPIO_P0_14_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_14_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_14_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_14_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_14_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_14_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_15_MODE_REG ===================================================== */
-#define GPIO_P0_15_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_15_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_15_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_15_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_15_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_15_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_16_MODE_REG ===================================================== */
-#define GPIO_P0_16_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_16_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_16_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_16_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_16_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_16_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_17_MODE_REG ===================================================== */
-#define GPIO_P0_17_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_17_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_17_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_17_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_17_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_17_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_18_MODE_REG ===================================================== */
-#define GPIO_P0_18_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_18_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_18_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_18_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_18_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_18_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_19_MODE_REG ===================================================== */
-#define GPIO_P0_19_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_19_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_19_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_19_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_19_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_19_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_20_MODE_REG ===================================================== */
-#define GPIO_P0_20_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_20_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_20_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_20_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_20_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_20_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_21_MODE_REG ===================================================== */
-#define GPIO_P0_21_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_21_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_21_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_21_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_21_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_21_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_22_MODE_REG ===================================================== */
-#define GPIO_P0_22_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_22_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_22_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_22_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_22_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_22_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_23_MODE_REG ===================================================== */
-#define GPIO_P0_23_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_23_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_23_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_23_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_23_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_23_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_24_MODE_REG ===================================================== */
-#define GPIO_P0_24_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_24_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_24_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_24_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_24_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_24_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_25_MODE_REG ===================================================== */
-#define GPIO_P0_25_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_25_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_25_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_25_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_25_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_25_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_26_MODE_REG ===================================================== */
-#define GPIO_P0_26_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_26_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_26_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_26_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_26_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_26_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_27_MODE_REG ===================================================== */
-#define GPIO_P0_27_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_27_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_27_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_27_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_27_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_27_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_28_MODE_REG ===================================================== */
-#define GPIO_P0_28_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_28_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_28_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_28_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_28_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_28_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_29_MODE_REG ===================================================== */
-#define GPIO_P0_29_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_29_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_29_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_29_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_29_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_29_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_30_MODE_REG ===================================================== */
-#define GPIO_P0_30_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_30_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_30_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_30_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_30_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_30_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P0_31_MODE_REG ===================================================== */
-#define GPIO_P0_31_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P0_31_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P0_31_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P0_31_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P0_31_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P0_31_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ====================================================== P0_DATA_REG ====================================================== */
-#define GPIO_P0_DATA_REG_P0_DATA_Pos (0UL) /*!< P0_DATA (Bit 0) */
-#define GPIO_P0_DATA_REG_P0_DATA_Msk (0xffffffffUL) /*!< P0_DATA (Bitfield-Mask: 0xffffffff) */
-/* ================================================== P0_PADPWR_CTRL_REG =================================================== */
-#define GPIO_P0_PADPWR_CTRL_REG_P0_OUT_CTRL_Pos (6UL) /*!< P0_OUT_CTRL (Bit 6) */
-#define GPIO_P0_PADPWR_CTRL_REG_P0_OUT_CTRL_Msk (0xffffffc0UL) /*!< P0_OUT_CTRL (Bitfield-Mask: 0x3ffffff) */
-/* =================================================== P0_RESET_DATA_REG =================================================== */
-#define GPIO_P0_RESET_DATA_REG_P0_RESET_Pos (0UL) /*!< P0_RESET (Bit 0) */
-#define GPIO_P0_RESET_DATA_REG_P0_RESET_Msk (0xffffffffUL) /*!< P0_RESET (Bitfield-Mask: 0xffffffff) */
-/* ==================================================== P0_SET_DATA_REG ==================================================== */
-#define GPIO_P0_SET_DATA_REG_P0_SET_Pos (0UL) /*!< P0_SET (Bit 0) */
-#define GPIO_P0_SET_DATA_REG_P0_SET_Msk (0xffffffffUL) /*!< P0_SET (Bitfield-Mask: 0xffffffff) */
-/* ==================================================== P1_00_MODE_REG ===================================================== */
-#define GPIO_P1_00_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_00_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_00_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_00_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_00_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_00_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_01_MODE_REG ===================================================== */
-#define GPIO_P1_01_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_01_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_01_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_01_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_01_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_01_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_02_MODE_REG ===================================================== */
-#define GPIO_P1_02_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_02_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_02_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_02_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_02_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_02_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_03_MODE_REG ===================================================== */
-#define GPIO_P1_03_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_03_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_03_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_03_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_03_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_03_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_04_MODE_REG ===================================================== */
-#define GPIO_P1_04_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_04_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_04_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_04_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_04_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_04_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_05_MODE_REG ===================================================== */
-#define GPIO_P1_05_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_05_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_05_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_05_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_05_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_05_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_06_MODE_REG ===================================================== */
-#define GPIO_P1_06_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_06_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_06_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_06_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_06_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_06_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_07_MODE_REG ===================================================== */
-#define GPIO_P1_07_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_07_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_07_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_07_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_07_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_07_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_08_MODE_REG ===================================================== */
-#define GPIO_P1_08_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_08_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_08_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_08_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_08_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_08_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_09_MODE_REG ===================================================== */
-#define GPIO_P1_09_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_09_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_09_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_09_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_09_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_09_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_10_MODE_REG ===================================================== */
-#define GPIO_P1_10_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_10_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_10_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_10_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_10_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_10_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_11_MODE_REG ===================================================== */
-#define GPIO_P1_11_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_11_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_11_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_11_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_11_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_11_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_12_MODE_REG ===================================================== */
-#define GPIO_P1_12_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_12_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_12_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_12_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_12_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_12_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_13_MODE_REG ===================================================== */
-#define GPIO_P1_13_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_13_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_13_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_13_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_13_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_13_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_14_MODE_REG ===================================================== */
-#define GPIO_P1_14_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_14_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_14_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_14_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_14_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_14_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_15_MODE_REG ===================================================== */
-#define GPIO_P1_15_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_15_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_15_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_15_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_15_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_15_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_16_MODE_REG ===================================================== */
-#define GPIO_P1_16_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_16_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_16_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_16_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_16_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_16_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_17_MODE_REG ===================================================== */
-#define GPIO_P1_17_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_17_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_17_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_17_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_17_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_17_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_18_MODE_REG ===================================================== */
-#define GPIO_P1_18_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_18_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_18_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_18_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_18_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_18_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_19_MODE_REG ===================================================== */
-#define GPIO_P1_19_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_19_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_19_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_19_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_19_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_19_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_20_MODE_REG ===================================================== */
-#define GPIO_P1_20_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_20_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_20_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_20_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_20_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_20_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_21_MODE_REG ===================================================== */
-#define GPIO_P1_21_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_21_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_21_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_21_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_21_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_21_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ==================================================== P1_22_MODE_REG ===================================================== */
-#define GPIO_P1_22_MODE_REG_PPOD_Pos (10UL) /*!< PPOD (Bit 10) */
-#define GPIO_P1_22_MODE_REG_PPOD_Msk (0x400UL) /*!< PPOD (Bitfield-Mask: 0x01) */
-#define GPIO_P1_22_MODE_REG_PUPD_Pos (8UL) /*!< PUPD (Bit 8) */
-#define GPIO_P1_22_MODE_REG_PUPD_Msk (0x300UL) /*!< PUPD (Bitfield-Mask: 0x03) */
-#define GPIO_P1_22_MODE_REG_PID_Pos (0UL) /*!< PID (Bit 0) */
-#define GPIO_P1_22_MODE_REG_PID_Msk (0x3fUL) /*!< PID (Bitfield-Mask: 0x3f) */
-/* ====================================================== P1_DATA_REG ====================================================== */
-#define GPIO_P1_DATA_REG_P1_DATA_Pos (0UL) /*!< P1_DATA (Bit 0) */
-#define GPIO_P1_DATA_REG_P1_DATA_Msk (0x7fffffUL) /*!< P1_DATA (Bitfield-Mask: 0x7fffff) */
-/* ================================================== P1_PADPWR_CTRL_REG =================================================== */
-#define GPIO_P1_PADPWR_CTRL_REG_P1_OUT_CTRL_Pos (0UL) /*!< P1_OUT_CTRL (Bit 0) */
-#define GPIO_P1_PADPWR_CTRL_REG_P1_OUT_CTRL_Msk (0x7fffffUL) /*!< P1_OUT_CTRL (Bitfield-Mask: 0x7fffff) */
-/* =================================================== P1_RESET_DATA_REG =================================================== */
-#define GPIO_P1_RESET_DATA_REG_P1_RESET_Pos (0UL) /*!< P1_RESET (Bit 0) */
-#define GPIO_P1_RESET_DATA_REG_P1_RESET_Msk (0x7fffffUL) /*!< P1_RESET (Bitfield-Mask: 0x7fffff) */
-/* ==================================================== P1_SET_DATA_REG ==================================================== */
-#define GPIO_P1_SET_DATA_REG_P1_SET_Pos (0UL) /*!< P1_SET (Bit 0) */
-#define GPIO_P1_SET_DATA_REG_P1_SET_Msk (0x7fffffUL) /*!< P1_SET (Bitfield-Mask: 0x7fffff) */
-/* =================================================== PAD_WEAK_CTRL_REG =================================================== */
-#define GPIO_PAD_WEAK_CTRL_REG_P1_09_LOWDRV_Pos (12UL) /*!< P1_09_LOWDRV (Bit 12) */
-#define GPIO_PAD_WEAK_CTRL_REG_P1_09_LOWDRV_Msk (0x1000UL) /*!< P1_09_LOWDRV (Bitfield-Mask: 0x01) */
-#define GPIO_PAD_WEAK_CTRL_REG_P1_06_LOWDRV_Pos (11UL) /*!< P1_06_LOWDRV (Bit 11) */
-#define GPIO_PAD_WEAK_CTRL_REG_P1_06_LOWDRV_Msk (0x800UL) /*!< P1_06_LOWDRV (Bitfield-Mask: 0x01) */
-#define GPIO_PAD_WEAK_CTRL_REG_P1_02_LOWDRV_Pos (10UL) /*!< P1_02_LOWDRV (Bit 10) */
-#define GPIO_PAD_WEAK_CTRL_REG_P1_02_LOWDRV_Msk (0x400UL) /*!< P1_02_LOWDRV (Bitfield-Mask: 0x01) */
-#define GPIO_PAD_WEAK_CTRL_REG_P1_01_LOWDRV_Pos (9UL) /*!< P1_01_LOWDRV (Bit 9) */
-#define GPIO_PAD_WEAK_CTRL_REG_P1_01_LOWDRV_Msk (0x200UL) /*!< P1_01_LOWDRV (Bitfield-Mask: 0x01) */
-#define GPIO_PAD_WEAK_CTRL_REG_P1_00_LOWDRV_Pos (8UL) /*!< P1_00_LOWDRV (Bit 8) */
-#define GPIO_PAD_WEAK_CTRL_REG_P1_00_LOWDRV_Msk (0x100UL) /*!< P1_00_LOWDRV (Bitfield-Mask: 0x01) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_27_LOWDRV_Pos (7UL) /*!< P0_27_LOWDRV (Bit 7) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_27_LOWDRV_Msk (0x80UL) /*!< P0_27_LOWDRV (Bitfield-Mask: 0x01) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_26_LOWDRV_Pos (6UL) /*!< P0_26_LOWDRV (Bit 6) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_26_LOWDRV_Msk (0x40UL) /*!< P0_26_LOWDRV (Bitfield-Mask: 0x01) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_25_LOWDRV_Pos (5UL) /*!< P0_25_LOWDRV (Bit 5) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_25_LOWDRV_Msk (0x20UL) /*!< P0_25_LOWDRV (Bitfield-Mask: 0x01) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_18_LOWDRV_Pos (4UL) /*!< P0_18_LOWDRV (Bit 4) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_18_LOWDRV_Msk (0x10UL) /*!< P0_18_LOWDRV (Bitfield-Mask: 0x01) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_17_LOWDRV_Pos (3UL) /*!< P0_17_LOWDRV (Bit 3) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_17_LOWDRV_Msk (0x8UL) /*!< P0_17_LOWDRV (Bitfield-Mask: 0x01) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_16_LOWDRV_Pos (2UL) /*!< P0_16_LOWDRV (Bit 2) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_16_LOWDRV_Msk (0x4UL) /*!< P0_16_LOWDRV (Bitfield-Mask: 0x01) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_07_LOWDRV_Pos (1UL) /*!< P0_07_LOWDRV (Bit 1) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_07_LOWDRV_Msk (0x2UL) /*!< P0_07_LOWDRV (Bitfield-Mask: 0x01) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_06_LOWDRV_Pos (0UL) /*!< P0_06_LOWDRV (Bit 0) */
-#define GPIO_PAD_WEAK_CTRL_REG_P0_06_LOWDRV_Msk (0x1UL) /*!< P0_06_LOWDRV (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ GPREG ================ */
-/* =========================================================================================================================== */
-
-/* ======================================================= DEBUG_REG ======================================================= */
-#define GPREG_DEBUG_REG_CROSS_CPU_HALT_SENSITIVITY_Pos (8UL) /*!< CROSS_CPU_HALT_SENSITIVITY (Bit 8) */
-#define GPREG_DEBUG_REG_CROSS_CPU_HALT_SENSITIVITY_Msk (0x100UL) /*!< CROSS_CPU_HALT_SENSITIVITY (Bitfield-Mask: 0x01) */
-#define GPREG_DEBUG_REG_SYS_CPUWAIT_ON_JTAG_Pos (7UL) /*!< SYS_CPUWAIT_ON_JTAG (Bit 7) */
-#define GPREG_DEBUG_REG_SYS_CPUWAIT_ON_JTAG_Msk (0x80UL) /*!< SYS_CPUWAIT_ON_JTAG (Bitfield-Mask: 0x01) */
-#define GPREG_DEBUG_REG_SYS_CPUWAIT_Pos (6UL) /*!< SYS_CPUWAIT (Bit 6) */
-#define GPREG_DEBUG_REG_SYS_CPUWAIT_Msk (0x40UL) /*!< SYS_CPUWAIT (Bitfield-Mask: 0x01) */
-#define GPREG_DEBUG_REG_CMAC_CPU_IS_HALTED_Pos (5UL) /*!< CMAC_CPU_IS_HALTED (Bit 5) */
-#define GPREG_DEBUG_REG_CMAC_CPU_IS_HALTED_Msk (0x20UL) /*!< CMAC_CPU_IS_HALTED (Bitfield-Mask: 0x01) */
-#define GPREG_DEBUG_REG_SYS_CPU_IS_HALTED_Pos (4UL) /*!< SYS_CPU_IS_HALTED (Bit 4) */
-#define GPREG_DEBUG_REG_SYS_CPU_IS_HALTED_Msk (0x10UL) /*!< SYS_CPU_IS_HALTED (Bitfield-Mask: 0x01) */
-#define GPREG_DEBUG_REG_HALT_CMAC_SYS_CPU_EN_Pos (3UL) /*!< HALT_CMAC_SYS_CPU_EN (Bit 3) */
-#define GPREG_DEBUG_REG_HALT_CMAC_SYS_CPU_EN_Msk (0x8UL) /*!< HALT_CMAC_SYS_CPU_EN (Bitfield-Mask: 0x01) */
-#define GPREG_DEBUG_REG_HALT_SYS_CMAC_CPU_EN_Pos (2UL) /*!< HALT_SYS_CMAC_CPU_EN (Bit 2) */
-#define GPREG_DEBUG_REG_HALT_SYS_CMAC_CPU_EN_Msk (0x4UL) /*!< HALT_SYS_CMAC_CPU_EN (Bitfield-Mask: 0x01) */
-#define GPREG_DEBUG_REG_CMAC_CPU_FREEZE_EN_Pos (1UL) /*!< CMAC_CPU_FREEZE_EN (Bit 1) */
-#define GPREG_DEBUG_REG_CMAC_CPU_FREEZE_EN_Msk (0x2UL) /*!< CMAC_CPU_FREEZE_EN (Bitfield-Mask: 0x01) */
-#define GPREG_DEBUG_REG_SYS_CPU_FREEZE_EN_Pos (0UL) /*!< SYS_CPU_FREEZE_EN (Bit 0) */
-#define GPREG_DEBUG_REG_SYS_CPU_FREEZE_EN_Msk (0x1UL) /*!< SYS_CPU_FREEZE_EN (Bitfield-Mask: 0x01) */
-/* ==================================================== GP_CONTROL_REG ===================================================== */
-#define GPREG_GP_CONTROL_REG_CMAC_H2H_BRIDGE_BYPASS_Pos (1UL) /*!< CMAC_H2H_BRIDGE_BYPASS (Bit 1) */
-#define GPREG_GP_CONTROL_REG_CMAC_H2H_BRIDGE_BYPASS_Msk (0x2UL) /*!< CMAC_H2H_BRIDGE_BYPASS (Bitfield-Mask: 0x01) */
-/* ===================================================== GP_STATUS_REG ===================================================== */
-#define GPREG_GP_STATUS_REG_CAL_PHASE_Pos (0UL) /*!< CAL_PHASE (Bit 0) */
-#define GPREG_GP_STATUS_REG_CAL_PHASE_Msk (0x1UL) /*!< CAL_PHASE (Bitfield-Mask: 0x01) */
-/* =================================================== RESET_FREEZE_REG ==================================================== */
-#define GPREG_RESET_FREEZE_REG_FRZ_CMAC_WDOG_Pos (10UL) /*!< FRZ_CMAC_WDOG (Bit 10) */
-#define GPREG_RESET_FREEZE_REG_FRZ_CMAC_WDOG_Msk (0x400UL) /*!< FRZ_CMAC_WDOG (Bitfield-Mask: 0x01) */
-#define GPREG_RESET_FREEZE_REG_FRZ_SWTIM4_Pos (9UL) /*!< FRZ_SWTIM4 (Bit 9) */
-#define GPREG_RESET_FREEZE_REG_FRZ_SWTIM4_Msk (0x200UL) /*!< FRZ_SWTIM4 (Bitfield-Mask: 0x01) */
-#define GPREG_RESET_FREEZE_REG_FRZ_SWTIM3_Pos (8UL) /*!< FRZ_SWTIM3 (Bit 8) */
-#define GPREG_RESET_FREEZE_REG_FRZ_SWTIM3_Msk (0x100UL) /*!< FRZ_SWTIM3 (Bitfield-Mask: 0x01) */
-#define GPREG_RESET_FREEZE_REG_FRZ_PWMLED_Pos (7UL) /*!< FRZ_PWMLED (Bit 7) */
-#define GPREG_RESET_FREEZE_REG_FRZ_PWMLED_Msk (0x80UL) /*!< FRZ_PWMLED (Bitfield-Mask: 0x01) */
-#define GPREG_RESET_FREEZE_REG_FRZ_SWTIM2_Pos (6UL) /*!< FRZ_SWTIM2 (Bit 6) */
-#define GPREG_RESET_FREEZE_REG_FRZ_SWTIM2_Msk (0x40UL) /*!< FRZ_SWTIM2 (Bitfield-Mask: 0x01) */
-#define GPREG_RESET_FREEZE_REG_FRZ_DMA_Pos (5UL) /*!< FRZ_DMA (Bit 5) */
-#define GPREG_RESET_FREEZE_REG_FRZ_DMA_Msk (0x20UL) /*!< FRZ_DMA (Bitfield-Mask: 0x01) */
-#define GPREG_RESET_FREEZE_REG_FRZ_USB_Pos (4UL) /*!< FRZ_USB (Bit 4) */
-#define GPREG_RESET_FREEZE_REG_FRZ_USB_Msk (0x10UL) /*!< FRZ_USB (Bitfield-Mask: 0x01) */
-#define GPREG_RESET_FREEZE_REG_FRZ_SYS_WDOG_Pos (3UL) /*!< FRZ_SYS_WDOG (Bit 3) */
-#define GPREG_RESET_FREEZE_REG_FRZ_SYS_WDOG_Msk (0x8UL) /*!< FRZ_SYS_WDOG (Bitfield-Mask: 0x01) */
-#define GPREG_RESET_FREEZE_REG_FRZ_RESERVED_Pos (2UL) /*!< FRZ_RESERVED (Bit 2) */
-#define GPREG_RESET_FREEZE_REG_FRZ_RESERVED_Msk (0x4UL) /*!< FRZ_RESERVED (Bitfield-Mask: 0x01) */
-#define GPREG_RESET_FREEZE_REG_FRZ_SWTIM_Pos (1UL) /*!< FRZ_SWTIM (Bit 1) */
-#define GPREG_RESET_FREEZE_REG_FRZ_SWTIM_Msk (0x2UL) /*!< FRZ_SWTIM (Bitfield-Mask: 0x01) */
-#define GPREG_RESET_FREEZE_REG_FRZ_WKUPTIM_Pos (0UL) /*!< FRZ_WKUPTIM (Bit 0) */
-#define GPREG_RESET_FREEZE_REG_FRZ_WKUPTIM_Msk (0x1UL) /*!< FRZ_WKUPTIM (Bitfield-Mask: 0x01) */
-/* ==================================================== SET_FREEZE_REG ===================================================== */
-#define GPREG_SET_FREEZE_REG_FRZ_CMAC_WDOG_Pos (10UL) /*!< FRZ_CMAC_WDOG (Bit 10) */
-#define GPREG_SET_FREEZE_REG_FRZ_CMAC_WDOG_Msk (0x400UL) /*!< FRZ_CMAC_WDOG (Bitfield-Mask: 0x01) */
-#define GPREG_SET_FREEZE_REG_FRZ_SWTIM4_Pos (9UL) /*!< FRZ_SWTIM4 (Bit 9) */
-#define GPREG_SET_FREEZE_REG_FRZ_SWTIM4_Msk (0x200UL) /*!< FRZ_SWTIM4 (Bitfield-Mask: 0x01) */
-#define GPREG_SET_FREEZE_REG_FRZ_SWTIM3_Pos (8UL) /*!< FRZ_SWTIM3 (Bit 8) */
-#define GPREG_SET_FREEZE_REG_FRZ_SWTIM3_Msk (0x100UL) /*!< FRZ_SWTIM3 (Bitfield-Mask: 0x01) */
-#define GPREG_SET_FREEZE_REG_FRZ_PWMLED_Pos (7UL) /*!< FRZ_PWMLED (Bit 7) */
-#define GPREG_SET_FREEZE_REG_FRZ_PWMLED_Msk (0x80UL) /*!< FRZ_PWMLED (Bitfield-Mask: 0x01) */
-#define GPREG_SET_FREEZE_REG_FRZ_SWTIM2_Pos (6UL) /*!< FRZ_SWTIM2 (Bit 6) */
-#define GPREG_SET_FREEZE_REG_FRZ_SWTIM2_Msk (0x40UL) /*!< FRZ_SWTIM2 (Bitfield-Mask: 0x01) */
-#define GPREG_SET_FREEZE_REG_FRZ_DMA_Pos (5UL) /*!< FRZ_DMA (Bit 5) */
-#define GPREG_SET_FREEZE_REG_FRZ_DMA_Msk (0x20UL) /*!< FRZ_DMA (Bitfield-Mask: 0x01) */
-#define GPREG_SET_FREEZE_REG_FRZ_USB_Pos (4UL) /*!< FRZ_USB (Bit 4) */
-#define GPREG_SET_FREEZE_REG_FRZ_USB_Msk (0x10UL) /*!< FRZ_USB (Bitfield-Mask: 0x01) */
-#define GPREG_SET_FREEZE_REG_FRZ_SYS_WDOG_Pos (3UL) /*!< FRZ_SYS_WDOG (Bit 3) */
-#define GPREG_SET_FREEZE_REG_FRZ_SYS_WDOG_Msk (0x8UL) /*!< FRZ_SYS_WDOG (Bitfield-Mask: 0x01) */
-#define GPREG_SET_FREEZE_REG_FRZ_RESERVED_Pos (2UL) /*!< FRZ_RESERVED (Bit 2) */
-#define GPREG_SET_FREEZE_REG_FRZ_RESERVED_Msk (0x4UL) /*!< FRZ_RESERVED (Bitfield-Mask: 0x01) */
-#define GPREG_SET_FREEZE_REG_FRZ_SWTIM_Pos (1UL) /*!< FRZ_SWTIM (Bit 1) */
-#define GPREG_SET_FREEZE_REG_FRZ_SWTIM_Msk (0x2UL) /*!< FRZ_SWTIM (Bitfield-Mask: 0x01) */
-#define GPREG_SET_FREEZE_REG_FRZ_WKUPTIM_Pos (0UL) /*!< FRZ_WKUPTIM (Bit 0) */
-#define GPREG_SET_FREEZE_REG_FRZ_WKUPTIM_Msk (0x1UL) /*!< FRZ_WKUPTIM (Bitfield-Mask: 0x01) */
-/* ====================================================== USBPAD_REG ======================================================= */
-#define GPREG_USBPAD_REG_USBPHY_FORCE_SW2_ON_Pos (2UL) /*!< USBPHY_FORCE_SW2_ON (Bit 2) */
-#define GPREG_USBPAD_REG_USBPHY_FORCE_SW2_ON_Msk (0x4UL) /*!< USBPHY_FORCE_SW2_ON (Bitfield-Mask: 0x01) */
-#define GPREG_USBPAD_REG_USBPHY_FORCE_SW1_OFF_Pos (1UL) /*!< USBPHY_FORCE_SW1_OFF (Bit 1) */
-#define GPREG_USBPAD_REG_USBPHY_FORCE_SW1_OFF_Msk (0x2UL) /*!< USBPHY_FORCE_SW1_OFF (Bitfield-Mask: 0x01) */
-#define GPREG_USBPAD_REG_USBPAD_EN_Pos (0UL) /*!< USBPAD_EN (Bit 0) */
-#define GPREG_USBPAD_REG_USBPAD_EN_Msk (0x1UL) /*!< USBPAD_EN (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ I2C ================ */
-/* =========================================================================================================================== */
-
-/* =============================================== I2C_ACK_GENERAL_CALL_REG ================================================ */
-#define I2C_I2C_ACK_GENERAL_CALL_REG_ACK_GEN_CALL_Pos (0UL) /*!< ACK_GEN_CALL (Bit 0) */
-#define I2C_I2C_ACK_GENERAL_CALL_REG_ACK_GEN_CALL_Msk (0x1UL) /*!< ACK_GEN_CALL (Bitfield-Mask: 0x01) */
-/* ================================================= I2C_CLR_ACTIVITY_REG ================================================== */
-#define I2C_I2C_CLR_ACTIVITY_REG_CLR_ACTIVITY_Pos (0UL) /*!< CLR_ACTIVITY (Bit 0) */
-#define I2C_I2C_CLR_ACTIVITY_REG_CLR_ACTIVITY_Msk (0x1UL) /*!< CLR_ACTIVITY (Bitfield-Mask: 0x01) */
-/* ================================================= I2C_CLR_GEN_CALL_REG ================================================== */
-#define I2C_I2C_CLR_GEN_CALL_REG_CLR_GEN_CALL_Pos (0UL) /*!< CLR_GEN_CALL (Bit 0) */
-#define I2C_I2C_CLR_GEN_CALL_REG_CLR_GEN_CALL_Msk (0x1UL) /*!< CLR_GEN_CALL (Bitfield-Mask: 0x01) */
-/* =================================================== I2C_CLR_INTR_REG ==================================================== */
-#define I2C_I2C_CLR_INTR_REG_CLR_INTR_Pos (0UL) /*!< CLR_INTR (Bit 0) */
-#define I2C_I2C_CLR_INTR_REG_CLR_INTR_Msk (0x1UL) /*!< CLR_INTR (Bitfield-Mask: 0x01) */
-/* ================================================== I2C_CLR_RD_REQ_REG =================================================== */
-#define I2C_I2C_CLR_RD_REQ_REG_CLR_RD_REQ_Pos (0UL) /*!< CLR_RD_REQ (Bit 0) */
-#define I2C_I2C_CLR_RD_REQ_REG_CLR_RD_REQ_Msk (0x1UL) /*!< CLR_RD_REQ (Bitfield-Mask: 0x01) */
-/* ================================================== I2C_CLR_RX_DONE_REG ================================================== */
-#define I2C_I2C_CLR_RX_DONE_REG_CLR_RX_DONE_Pos (0UL) /*!< CLR_RX_DONE (Bit 0) */
-#define I2C_I2C_CLR_RX_DONE_REG_CLR_RX_DONE_Msk (0x1UL) /*!< CLR_RX_DONE (Bitfield-Mask: 0x01) */
-/* ================================================== I2C_CLR_RX_OVER_REG ================================================== */
-#define I2C_I2C_CLR_RX_OVER_REG_CLR_RX_OVER_Pos (0UL) /*!< CLR_RX_OVER (Bit 0) */
-#define I2C_I2C_CLR_RX_OVER_REG_CLR_RX_OVER_Msk (0x1UL) /*!< CLR_RX_OVER (Bitfield-Mask: 0x01) */
-/* ================================================= I2C_CLR_RX_UNDER_REG ================================================== */
-#define I2C_I2C_CLR_RX_UNDER_REG_CLR_RX_UNDER_Pos (0UL) /*!< CLR_RX_UNDER (Bit 0) */
-#define I2C_I2C_CLR_RX_UNDER_REG_CLR_RX_UNDER_Msk (0x1UL) /*!< CLR_RX_UNDER (Bitfield-Mask: 0x01) */
-/* ================================================= I2C_CLR_START_DET_REG ================================================= */
-#define I2C_I2C_CLR_START_DET_REG_CLR_START_DET_Pos (0UL) /*!< CLR_START_DET (Bit 0) */
-#define I2C_I2C_CLR_START_DET_REG_CLR_START_DET_Msk (0x1UL) /*!< CLR_START_DET (Bitfield-Mask: 0x01) */
-/* ================================================= I2C_CLR_STOP_DET_REG ================================================== */
-#define I2C_I2C_CLR_STOP_DET_REG_CLR_STOP_DET_Pos (0UL) /*!< CLR_STOP_DET (Bit 0) */
-#define I2C_I2C_CLR_STOP_DET_REG_CLR_STOP_DET_Msk (0x1UL) /*!< CLR_STOP_DET (Bitfield-Mask: 0x01) */
-/* ================================================== I2C_CLR_TX_ABRT_REG ================================================== */
-#define I2C_I2C_CLR_TX_ABRT_REG_CLR_TX_ABRT_Pos (0UL) /*!< CLR_TX_ABRT (Bit 0) */
-#define I2C_I2C_CLR_TX_ABRT_REG_CLR_TX_ABRT_Msk (0x1UL) /*!< CLR_TX_ABRT (Bitfield-Mask: 0x01) */
-/* ================================================== I2C_CLR_TX_OVER_REG ================================================== */
-#define I2C_I2C_CLR_TX_OVER_REG_CLR_TX_OVER_Pos (0UL) /*!< CLR_TX_OVER (Bit 0) */
-#define I2C_I2C_CLR_TX_OVER_REG_CLR_TX_OVER_Msk (0x1UL) /*!< CLR_TX_OVER (Bitfield-Mask: 0x01) */
-/* ====================================================== I2C_CON_REG ====================================================== */
-#define I2C_I2C_CON_REG_I2C_STOP_DET_IF_MASTER_ACTIVE_Pos (10UL) /*!< I2C_STOP_DET_IF_MASTER_ACTIVE (Bit 10) */
-#define I2C_I2C_CON_REG_I2C_STOP_DET_IF_MASTER_ACTIVE_Msk (0x400UL) /*!< I2C_STOP_DET_IF_MASTER_ACTIVE (Bitfield-Mask: 0x01) */
-#define I2C_I2C_CON_REG_I2C_RX_FIFO_FULL_HLD_CTRL_Pos (9UL) /*!< I2C_RX_FIFO_FULL_HLD_CTRL (Bit 9) */
-#define I2C_I2C_CON_REG_I2C_RX_FIFO_FULL_HLD_CTRL_Msk (0x200UL) /*!< I2C_RX_FIFO_FULL_HLD_CTRL (Bitfield-Mask: 0x01) */
-#define I2C_I2C_CON_REG_I2C_TX_EMPTY_CTRL_Pos (8UL) /*!< I2C_TX_EMPTY_CTRL (Bit 8) */
-#define I2C_I2C_CON_REG_I2C_TX_EMPTY_CTRL_Msk (0x100UL) /*!< I2C_TX_EMPTY_CTRL (Bitfield-Mask: 0x01) */
-#define I2C_I2C_CON_REG_I2C_STOP_DET_IFADDRESSED_Pos (7UL) /*!< I2C_STOP_DET_IFADDRESSED (Bit 7) */
-#define I2C_I2C_CON_REG_I2C_STOP_DET_IFADDRESSED_Msk (0x80UL) /*!< I2C_STOP_DET_IFADDRESSED (Bitfield-Mask: 0x01) */
-#define I2C_I2C_CON_REG_I2C_SLAVE_DISABLE_Pos (6UL) /*!< I2C_SLAVE_DISABLE (Bit 6) */
-#define I2C_I2C_CON_REG_I2C_SLAVE_DISABLE_Msk (0x40UL) /*!< I2C_SLAVE_DISABLE (Bitfield-Mask: 0x01) */
-#define I2C_I2C_CON_REG_I2C_RESTART_EN_Pos (5UL) /*!< I2C_RESTART_EN (Bit 5) */
-#define I2C_I2C_CON_REG_I2C_RESTART_EN_Msk (0x20UL) /*!< I2C_RESTART_EN (Bitfield-Mask: 0x01) */
-#define I2C_I2C_CON_REG_I2C_10BITADDR_MASTER_Pos (4UL) /*!< I2C_10BITADDR_MASTER (Bit 4) */
-#define I2C_I2C_CON_REG_I2C_10BITADDR_MASTER_Msk (0x10UL) /*!< I2C_10BITADDR_MASTER (Bitfield-Mask: 0x01) */
-#define I2C_I2C_CON_REG_I2C_10BITADDR_SLAVE_Pos (3UL) /*!< I2C_10BITADDR_SLAVE (Bit 3) */
-#define I2C_I2C_CON_REG_I2C_10BITADDR_SLAVE_Msk (0x8UL) /*!< I2C_10BITADDR_SLAVE (Bitfield-Mask: 0x01) */
-#define I2C_I2C_CON_REG_I2C_SPEED_Pos (1UL) /*!< I2C_SPEED (Bit 1) */
-#define I2C_I2C_CON_REG_I2C_SPEED_Msk (0x6UL) /*!< I2C_SPEED (Bitfield-Mask: 0x03) */
-#define I2C_I2C_CON_REG_I2C_MASTER_MODE_Pos (0UL) /*!< I2C_MASTER_MODE (Bit 0) */
-#define I2C_I2C_CON_REG_I2C_MASTER_MODE_Msk (0x1UL) /*!< I2C_MASTER_MODE (Bitfield-Mask: 0x01) */
-/* =================================================== I2C_DATA_CMD_REG ==================================================== */
-#define I2C_I2C_DATA_CMD_REG_I2C_RESTART_Pos (10UL) /*!< I2C_RESTART (Bit 10) */
-#define I2C_I2C_DATA_CMD_REG_I2C_RESTART_Msk (0x400UL) /*!< I2C_RESTART (Bitfield-Mask: 0x01) */
-#define I2C_I2C_DATA_CMD_REG_I2C_STOP_Pos (9UL) /*!< I2C_STOP (Bit 9) */
-#define I2C_I2C_DATA_CMD_REG_I2C_STOP_Msk (0x200UL) /*!< I2C_STOP (Bitfield-Mask: 0x01) */
-#define I2C_I2C_DATA_CMD_REG_I2C_CMD_Pos (8UL) /*!< I2C_CMD (Bit 8) */
-#define I2C_I2C_DATA_CMD_REG_I2C_CMD_Msk (0x100UL) /*!< I2C_CMD (Bitfield-Mask: 0x01) */
-#define I2C_I2C_DATA_CMD_REG_I2C_DAT_Pos (0UL) /*!< I2C_DAT (Bit 0) */
-#define I2C_I2C_DATA_CMD_REG_I2C_DAT_Msk (0xffUL) /*!< I2C_DAT (Bitfield-Mask: 0xff) */
-/* ==================================================== I2C_DMA_CR_REG ===================================================== */
-#define I2C_I2C_DMA_CR_REG_TDMAE_Pos (1UL) /*!< TDMAE (Bit 1) */
-#define I2C_I2C_DMA_CR_REG_TDMAE_Msk (0x2UL) /*!< TDMAE (Bitfield-Mask: 0x01) */
-#define I2C_I2C_DMA_CR_REG_RDMAE_Pos (0UL) /*!< RDMAE (Bit 0) */
-#define I2C_I2C_DMA_CR_REG_RDMAE_Msk (0x1UL) /*!< RDMAE (Bitfield-Mask: 0x01) */
-/* =================================================== I2C_DMA_RDLR_REG ==================================================== */
-#define I2C_I2C_DMA_RDLR_REG_DMARDL_Pos (0UL) /*!< DMARDL (Bit 0) */
-#define I2C_I2C_DMA_RDLR_REG_DMARDL_Msk (0x1fUL) /*!< DMARDL (Bitfield-Mask: 0x1f) */
-/* =================================================== I2C_DMA_TDLR_REG ==================================================== */
-#define I2C_I2C_DMA_TDLR_REG_DMATDL_Pos (0UL) /*!< DMATDL (Bit 0) */
-#define I2C_I2C_DMA_TDLR_REG_DMATDL_Msk (0x1fUL) /*!< DMATDL (Bitfield-Mask: 0x1f) */
-/* ==================================================== I2C_ENABLE_REG ===================================================== */
-#define I2C_I2C_ENABLE_REG_I2C_TX_CMD_BLOCK_Pos (2UL) /*!< I2C_TX_CMD_BLOCK (Bit 2) */
-#define I2C_I2C_ENABLE_REG_I2C_TX_CMD_BLOCK_Msk (0x4UL) /*!< I2C_TX_CMD_BLOCK (Bitfield-Mask: 0x01) */
-#define I2C_I2C_ENABLE_REG_I2C_ABORT_Pos (1UL) /*!< I2C_ABORT (Bit 1) */
-#define I2C_I2C_ENABLE_REG_I2C_ABORT_Msk (0x2UL) /*!< I2C_ABORT (Bitfield-Mask: 0x01) */
-#define I2C_I2C_ENABLE_REG_I2C_EN_Pos (0UL) /*!< I2C_EN (Bit 0) */
-#define I2C_I2C_ENABLE_REG_I2C_EN_Msk (0x1UL) /*!< I2C_EN (Bitfield-Mask: 0x01) */
-/* ================================================= I2C_ENABLE_STATUS_REG ================================================= */
-#define I2C_I2C_ENABLE_STATUS_REG_SLV_RX_DATA_LOST_Pos (2UL) /*!< SLV_RX_DATA_LOST (Bit 2) */
-#define I2C_I2C_ENABLE_STATUS_REG_SLV_RX_DATA_LOST_Msk (0x4UL) /*!< SLV_RX_DATA_LOST (Bitfield-Mask: 0x01) */
-#define I2C_I2C_ENABLE_STATUS_REG_SLV_DISABLED_WHILE_BUSY_Pos (1UL) /*!< SLV_DISABLED_WHILE_BUSY (Bit 1) */
-#define I2C_I2C_ENABLE_STATUS_REG_SLV_DISABLED_WHILE_BUSY_Msk (0x2UL) /*!< SLV_DISABLED_WHILE_BUSY (Bitfield-Mask: 0x01) */
-#define I2C_I2C_ENABLE_STATUS_REG_IC_EN_Pos (0UL) /*!< IC_EN (Bit 0) */
-#define I2C_I2C_ENABLE_STATUS_REG_IC_EN_Msk (0x1UL) /*!< IC_EN (Bitfield-Mask: 0x01) */
-/* ================================================== I2C_FS_SCL_HCNT_REG ================================================== */
-#define I2C_I2C_FS_SCL_HCNT_REG_IC_FS_SCL_HCNT_Pos (0UL) /*!< IC_FS_SCL_HCNT (Bit 0) */
-#define I2C_I2C_FS_SCL_HCNT_REG_IC_FS_SCL_HCNT_Msk (0xffffUL) /*!< IC_FS_SCL_HCNT (Bitfield-Mask: 0xffff) */
-/* ================================================== I2C_FS_SCL_LCNT_REG ================================================== */
-#define I2C_I2C_FS_SCL_LCNT_REG_IC_FS_SCL_LCNT_Pos (0UL) /*!< IC_FS_SCL_LCNT (Bit 0) */
-#define I2C_I2C_FS_SCL_LCNT_REG_IC_FS_SCL_LCNT_Msk (0xffffUL) /*!< IC_FS_SCL_LCNT (Bitfield-Mask: 0xffff) */
-/* =================================================== I2C_HS_MADDR_REG ==================================================== */
-#define I2C_I2C_HS_MADDR_REG_I2C_IC_HS_MAR_Pos (0UL) /*!< I2C_IC_HS_MAR (Bit 0) */
-#define I2C_I2C_HS_MADDR_REG_I2C_IC_HS_MAR_Msk (0x7UL) /*!< I2C_IC_HS_MAR (Bitfield-Mask: 0x07) */
-/* ================================================== I2C_HS_SCL_HCNT_REG ================================================== */
-#define I2C_I2C_HS_SCL_HCNT_REG_IC_HS_SCL_HCNT_Pos (0UL) /*!< IC_HS_SCL_HCNT (Bit 0) */
-#define I2C_I2C_HS_SCL_HCNT_REG_IC_HS_SCL_HCNT_Msk (0xffffUL) /*!< IC_HS_SCL_HCNT (Bitfield-Mask: 0xffff) */
-/* ================================================== I2C_HS_SCL_LCNT_REG ================================================== */
-#define I2C_I2C_HS_SCL_LCNT_REG_IC_HS_SCL_LCNT_Pos (0UL) /*!< IC_HS_SCL_LCNT (Bit 0) */
-#define I2C_I2C_HS_SCL_LCNT_REG_IC_HS_SCL_LCNT_Msk (0xffffUL) /*!< IC_HS_SCL_LCNT (Bitfield-Mask: 0xffff) */
-/* ================================================= I2C_IC_FS_SPKLEN_REG ================================================== */
-#define I2C_I2C_IC_FS_SPKLEN_REG_I2C_FS_SPKLEN_Pos (0UL) /*!< I2C_FS_SPKLEN (Bit 0) */
-#define I2C_I2C_IC_FS_SPKLEN_REG_I2C_FS_SPKLEN_Msk (0xffUL) /*!< I2C_FS_SPKLEN (Bitfield-Mask: 0xff) */
-/* ================================================= I2C_IC_HS_SPKLEN_REG ================================================== */
-#define I2C_I2C_IC_HS_SPKLEN_REG_I2C_HS_SPKLEN_Pos (0UL) /*!< I2C_HS_SPKLEN (Bit 0) */
-#define I2C_I2C_IC_HS_SPKLEN_REG_I2C_HS_SPKLEN_Msk (0xffUL) /*!< I2C_HS_SPKLEN (Bitfield-Mask: 0xff) */
-/* =================================================== I2C_INTR_MASK_REG =================================================== */
-#define I2C_I2C_INTR_MASK_REG_M_SCL_STUCK_AT_LOW_Pos (14UL) /*!< M_SCL_STUCK_AT_LOW (Bit 14) */
-#define I2C_I2C_INTR_MASK_REG_M_SCL_STUCK_AT_LOW_Msk (0x4000UL) /*!< M_SCL_STUCK_AT_LOW (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_MASTER_ON_HOLD_Pos (13UL) /*!< M_MASTER_ON_HOLD (Bit 13) */
-#define I2C_I2C_INTR_MASK_REG_M_MASTER_ON_HOLD_Msk (0x2000UL) /*!< M_MASTER_ON_HOLD (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_RESTART_DET_Pos (12UL) /*!< M_RESTART_DET (Bit 12) */
-#define I2C_I2C_INTR_MASK_REG_M_RESTART_DET_Msk (0x1000UL) /*!< M_RESTART_DET (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_GEN_CALL_Pos (11UL) /*!< M_GEN_CALL (Bit 11) */
-#define I2C_I2C_INTR_MASK_REG_M_GEN_CALL_Msk (0x800UL) /*!< M_GEN_CALL (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_START_DET_Pos (10UL) /*!< M_START_DET (Bit 10) */
-#define I2C_I2C_INTR_MASK_REG_M_START_DET_Msk (0x400UL) /*!< M_START_DET (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_STOP_DET_Pos (9UL) /*!< M_STOP_DET (Bit 9) */
-#define I2C_I2C_INTR_MASK_REG_M_STOP_DET_Msk (0x200UL) /*!< M_STOP_DET (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_ACTIVITY_Pos (8UL) /*!< M_ACTIVITY (Bit 8) */
-#define I2C_I2C_INTR_MASK_REG_M_ACTIVITY_Msk (0x100UL) /*!< M_ACTIVITY (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_RX_DONE_Pos (7UL) /*!< M_RX_DONE (Bit 7) */
-#define I2C_I2C_INTR_MASK_REG_M_RX_DONE_Msk (0x80UL) /*!< M_RX_DONE (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_TX_ABRT_Pos (6UL) /*!< M_TX_ABRT (Bit 6) */
-#define I2C_I2C_INTR_MASK_REG_M_TX_ABRT_Msk (0x40UL) /*!< M_TX_ABRT (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_RD_REQ_Pos (5UL) /*!< M_RD_REQ (Bit 5) */
-#define I2C_I2C_INTR_MASK_REG_M_RD_REQ_Msk (0x20UL) /*!< M_RD_REQ (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_TX_EMPTY_Pos (4UL) /*!< M_TX_EMPTY (Bit 4) */
-#define I2C_I2C_INTR_MASK_REG_M_TX_EMPTY_Msk (0x10UL) /*!< M_TX_EMPTY (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_TX_OVER_Pos (3UL) /*!< M_TX_OVER (Bit 3) */
-#define I2C_I2C_INTR_MASK_REG_M_TX_OVER_Msk (0x8UL) /*!< M_TX_OVER (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_RX_FULL_Pos (2UL) /*!< M_RX_FULL (Bit 2) */
-#define I2C_I2C_INTR_MASK_REG_M_RX_FULL_Msk (0x4UL) /*!< M_RX_FULL (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_RX_OVER_Pos (1UL) /*!< M_RX_OVER (Bit 1) */
-#define I2C_I2C_INTR_MASK_REG_M_RX_OVER_Msk (0x2UL) /*!< M_RX_OVER (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_MASK_REG_M_RX_UNDER_Pos (0UL) /*!< M_RX_UNDER (Bit 0) */
-#define I2C_I2C_INTR_MASK_REG_M_RX_UNDER_Msk (0x1UL) /*!< M_RX_UNDER (Bitfield-Mask: 0x01) */
-/* =================================================== I2C_INTR_STAT_REG =================================================== */
-#define I2C_I2C_INTR_STAT_REG_R_SCL_STUCK_AT_LOW_Pos (14UL) /*!< R_SCL_STUCK_AT_LOW (Bit 14) */
-#define I2C_I2C_INTR_STAT_REG_R_SCL_STUCK_AT_LOW_Msk (0x4000UL) /*!< R_SCL_STUCK_AT_LOW (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_MASTER_ON_HOLD_Pos (13UL) /*!< R_MASTER_ON_HOLD (Bit 13) */
-#define I2C_I2C_INTR_STAT_REG_R_MASTER_ON_HOLD_Msk (0x2000UL) /*!< R_MASTER_ON_HOLD (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_RESTART_DET_Pos (12UL) /*!< R_RESTART_DET (Bit 12) */
-#define I2C_I2C_INTR_STAT_REG_R_RESTART_DET_Msk (0x1000UL) /*!< R_RESTART_DET (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_GEN_CALL_Pos (11UL) /*!< R_GEN_CALL (Bit 11) */
-#define I2C_I2C_INTR_STAT_REG_R_GEN_CALL_Msk (0x800UL) /*!< R_GEN_CALL (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_START_DET_Pos (10UL) /*!< R_START_DET (Bit 10) */
-#define I2C_I2C_INTR_STAT_REG_R_START_DET_Msk (0x400UL) /*!< R_START_DET (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_STOP_DET_Pos (9UL) /*!< R_STOP_DET (Bit 9) */
-#define I2C_I2C_INTR_STAT_REG_R_STOP_DET_Msk (0x200UL) /*!< R_STOP_DET (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_ACTIVITY_Pos (8UL) /*!< R_ACTIVITY (Bit 8) */
-#define I2C_I2C_INTR_STAT_REG_R_ACTIVITY_Msk (0x100UL) /*!< R_ACTIVITY (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_RX_DONE_Pos (7UL) /*!< R_RX_DONE (Bit 7) */
-#define I2C_I2C_INTR_STAT_REG_R_RX_DONE_Msk (0x80UL) /*!< R_RX_DONE (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_TX_ABRT_Pos (6UL) /*!< R_TX_ABRT (Bit 6) */
-#define I2C_I2C_INTR_STAT_REG_R_TX_ABRT_Msk (0x40UL) /*!< R_TX_ABRT (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_RD_REQ_Pos (5UL) /*!< R_RD_REQ (Bit 5) */
-#define I2C_I2C_INTR_STAT_REG_R_RD_REQ_Msk (0x20UL) /*!< R_RD_REQ (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_TX_EMPTY_Pos (4UL) /*!< R_TX_EMPTY (Bit 4) */
-#define I2C_I2C_INTR_STAT_REG_R_TX_EMPTY_Msk (0x10UL) /*!< R_TX_EMPTY (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_TX_OVER_Pos (3UL) /*!< R_TX_OVER (Bit 3) */
-#define I2C_I2C_INTR_STAT_REG_R_TX_OVER_Msk (0x8UL) /*!< R_TX_OVER (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_RX_FULL_Pos (2UL) /*!< R_RX_FULL (Bit 2) */
-#define I2C_I2C_INTR_STAT_REG_R_RX_FULL_Msk (0x4UL) /*!< R_RX_FULL (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_RX_OVER_Pos (1UL) /*!< R_RX_OVER (Bit 1) */
-#define I2C_I2C_INTR_STAT_REG_R_RX_OVER_Msk (0x2UL) /*!< R_RX_OVER (Bitfield-Mask: 0x01) */
-#define I2C_I2C_INTR_STAT_REG_R_RX_UNDER_Pos (0UL) /*!< R_RX_UNDER (Bit 0) */
-#define I2C_I2C_INTR_STAT_REG_R_RX_UNDER_Msk (0x1UL) /*!< R_RX_UNDER (Bitfield-Mask: 0x01) */
-/* ================================================= I2C_RAW_INTR_STAT_REG ================================================= */
-#define I2C_I2C_RAW_INTR_STAT_REG_SCL_STUCK_AT_LOW_Pos (14UL) /*!< SCL_STUCK_AT_LOW (Bit 14) */
-#define I2C_I2C_RAW_INTR_STAT_REG_SCL_STUCK_AT_LOW_Msk (0x4000UL) /*!< SCL_STUCK_AT_LOW (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_MASTER_ON_HOLD_Pos (13UL) /*!< MASTER_ON_HOLD (Bit 13) */
-#define I2C_I2C_RAW_INTR_STAT_REG_MASTER_ON_HOLD_Msk (0x2000UL) /*!< MASTER_ON_HOLD (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_RESTART_DET_Pos (12UL) /*!< RESTART_DET (Bit 12) */
-#define I2C_I2C_RAW_INTR_STAT_REG_RESTART_DET_Msk (0x1000UL) /*!< RESTART_DET (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_GEN_CALL_Pos (11UL) /*!< GEN_CALL (Bit 11) */
-#define I2C_I2C_RAW_INTR_STAT_REG_GEN_CALL_Msk (0x800UL) /*!< GEN_CALL (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_START_DET_Pos (10UL) /*!< START_DET (Bit 10) */
-#define I2C_I2C_RAW_INTR_STAT_REG_START_DET_Msk (0x400UL) /*!< START_DET (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_STOP_DET_Pos (9UL) /*!< STOP_DET (Bit 9) */
-#define I2C_I2C_RAW_INTR_STAT_REG_STOP_DET_Msk (0x200UL) /*!< STOP_DET (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_ACTIVITY_Pos (8UL) /*!< ACTIVITY (Bit 8) */
-#define I2C_I2C_RAW_INTR_STAT_REG_ACTIVITY_Msk (0x100UL) /*!< ACTIVITY (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_RX_DONE_Pos (7UL) /*!< RX_DONE (Bit 7) */
-#define I2C_I2C_RAW_INTR_STAT_REG_RX_DONE_Msk (0x80UL) /*!< RX_DONE (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_TX_ABRT_Pos (6UL) /*!< TX_ABRT (Bit 6) */
-#define I2C_I2C_RAW_INTR_STAT_REG_TX_ABRT_Msk (0x40UL) /*!< TX_ABRT (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_RD_REQ_Pos (5UL) /*!< RD_REQ (Bit 5) */
-#define I2C_I2C_RAW_INTR_STAT_REG_RD_REQ_Msk (0x20UL) /*!< RD_REQ (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_TX_EMPTY_Pos (4UL) /*!< TX_EMPTY (Bit 4) */
-#define I2C_I2C_RAW_INTR_STAT_REG_TX_EMPTY_Msk (0x10UL) /*!< TX_EMPTY (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_TX_OVER_Pos (3UL) /*!< TX_OVER (Bit 3) */
-#define I2C_I2C_RAW_INTR_STAT_REG_TX_OVER_Msk (0x8UL) /*!< TX_OVER (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_RX_FULL_Pos (2UL) /*!< RX_FULL (Bit 2) */
-#define I2C_I2C_RAW_INTR_STAT_REG_RX_FULL_Msk (0x4UL) /*!< RX_FULL (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_RX_OVER_Pos (1UL) /*!< RX_OVER (Bit 1) */
-#define I2C_I2C_RAW_INTR_STAT_REG_RX_OVER_Msk (0x2UL) /*!< RX_OVER (Bitfield-Mask: 0x01) */
-#define I2C_I2C_RAW_INTR_STAT_REG_RX_UNDER_Pos (0UL) /*!< RX_UNDER (Bit 0) */
-#define I2C_I2C_RAW_INTR_STAT_REG_RX_UNDER_Msk (0x1UL) /*!< RX_UNDER (Bitfield-Mask: 0x01) */
-/* ===================================================== I2C_RXFLR_REG ===================================================== */
-#define I2C_I2C_RXFLR_REG_RXFLR_Pos (0UL) /*!< RXFLR (Bit 0) */
-#define I2C_I2C_RXFLR_REG_RXFLR_Msk (0x3fUL) /*!< RXFLR (Bitfield-Mask: 0x3f) */
-/* ===================================================== I2C_RX_TL_REG ===================================================== */
-#define I2C_I2C_RX_TL_REG_RX_TL_Pos (0UL) /*!< RX_TL (Bit 0) */
-#define I2C_I2C_RX_TL_REG_RX_TL_Msk (0x1fUL) /*!< RX_TL (Bitfield-Mask: 0x1f) */
-/* ====================================================== I2C_SAR_REG ====================================================== */
-#define I2C_I2C_SAR_REG_IC_SAR_Pos (0UL) /*!< IC_SAR (Bit 0) */
-#define I2C_I2C_SAR_REG_IC_SAR_Msk (0x3ffUL) /*!< IC_SAR (Bitfield-Mask: 0x3ff) */
-/* =================================================== I2C_SDA_HOLD_REG ==================================================== */
-#define I2C_I2C_SDA_HOLD_REG_I2C_SDA_RX_HOLD_Pos (16UL) /*!< I2C_SDA_RX_HOLD (Bit 16) */
-#define I2C_I2C_SDA_HOLD_REG_I2C_SDA_RX_HOLD_Msk (0xff0000UL) /*!< I2C_SDA_RX_HOLD (Bitfield-Mask: 0xff) */
-#define I2C_I2C_SDA_HOLD_REG_I2C_SDA_TX_HOLD_Pos (0UL) /*!< I2C_SDA_TX_HOLD (Bit 0) */
-#define I2C_I2C_SDA_HOLD_REG_I2C_SDA_TX_HOLD_Msk (0xffffUL) /*!< I2C_SDA_TX_HOLD (Bitfield-Mask: 0xffff) */
-/* =================================================== I2C_SDA_SETUP_REG =================================================== */
-#define I2C_I2C_SDA_SETUP_REG_SDA_SETUP_Pos (0UL) /*!< SDA_SETUP (Bit 0) */
-#define I2C_I2C_SDA_SETUP_REG_SDA_SETUP_Msk (0xffUL) /*!< SDA_SETUP (Bitfield-Mask: 0xff) */
-/* ================================================== I2C_SS_SCL_HCNT_REG ================================================== */
-#define I2C_I2C_SS_SCL_HCNT_REG_IC_SS_SCL_HCNT_Pos (0UL) /*!< IC_SS_SCL_HCNT (Bit 0) */
-#define I2C_I2C_SS_SCL_HCNT_REG_IC_SS_SCL_HCNT_Msk (0xffffUL) /*!< IC_SS_SCL_HCNT (Bitfield-Mask: 0xffff) */
-/* ================================================== I2C_SS_SCL_LCNT_REG ================================================== */
-#define I2C_I2C_SS_SCL_LCNT_REG_IC_SS_SCL_LCNT_Pos (0UL) /*!< IC_SS_SCL_LCNT (Bit 0) */
-#define I2C_I2C_SS_SCL_LCNT_REG_IC_SS_SCL_LCNT_Msk (0xffffUL) /*!< IC_SS_SCL_LCNT (Bitfield-Mask: 0xffff) */
-/* ==================================================== I2C_STATUS_REG ===================================================== */
-#define I2C_I2C_STATUS_REG_LV_HOLD_RX_FIFO_FULL_Pos (10UL) /*!< LV_HOLD_RX_FIFO_FULL (Bit 10) */
-#define I2C_I2C_STATUS_REG_LV_HOLD_RX_FIFO_FULL_Msk (0x400UL) /*!< LV_HOLD_RX_FIFO_FULL (Bitfield-Mask: 0x01) */
-#define I2C_I2C_STATUS_REG_SLV_HOLD_TX_FIFO_EMPTY_Pos (9UL) /*!< SLV_HOLD_TX_FIFO_EMPTY (Bit 9) */
-#define I2C_I2C_STATUS_REG_SLV_HOLD_TX_FIFO_EMPTY_Msk (0x200UL) /*!< SLV_HOLD_TX_FIFO_EMPTY (Bitfield-Mask: 0x01) */
-#define I2C_I2C_STATUS_REG_MST_HOLD_RX_FIFO_FULL_Pos (8UL) /*!< MST_HOLD_RX_FIFO_FULL (Bit 8) */
-#define I2C_I2C_STATUS_REG_MST_HOLD_RX_FIFO_FULL_Msk (0x100UL) /*!< MST_HOLD_RX_FIFO_FULL (Bitfield-Mask: 0x01) */
-#define I2C_I2C_STATUS_REG_MST_HOLD_TX_FIFO_EMPTY_Pos (7UL) /*!< MST_HOLD_TX_FIFO_EMPTY (Bit 7) */
-#define I2C_I2C_STATUS_REG_MST_HOLD_TX_FIFO_EMPTY_Msk (0x80UL) /*!< MST_HOLD_TX_FIFO_EMPTY (Bitfield-Mask: 0x01) */
-#define I2C_I2C_STATUS_REG_SLV_ACTIVITY_Pos (6UL) /*!< SLV_ACTIVITY (Bit 6) */
-#define I2C_I2C_STATUS_REG_SLV_ACTIVITY_Msk (0x40UL) /*!< SLV_ACTIVITY (Bitfield-Mask: 0x01) */
-#define I2C_I2C_STATUS_REG_MST_ACTIVITY_Pos (5UL) /*!< MST_ACTIVITY (Bit 5) */
-#define I2C_I2C_STATUS_REG_MST_ACTIVITY_Msk (0x20UL) /*!< MST_ACTIVITY (Bitfield-Mask: 0x01) */
-#define I2C_I2C_STATUS_REG_RFF_Pos (4UL) /*!< RFF (Bit 4) */
-#define I2C_I2C_STATUS_REG_RFF_Msk (0x10UL) /*!< RFF (Bitfield-Mask: 0x01) */
-#define I2C_I2C_STATUS_REG_RFNE_Pos (3UL) /*!< RFNE (Bit 3) */
-#define I2C_I2C_STATUS_REG_RFNE_Msk (0x8UL) /*!< RFNE (Bitfield-Mask: 0x01) */
-#define I2C_I2C_STATUS_REG_TFE_Pos (2UL) /*!< TFE (Bit 2) */
-#define I2C_I2C_STATUS_REG_TFE_Msk (0x4UL) /*!< TFE (Bitfield-Mask: 0x01) */
-#define I2C_I2C_STATUS_REG_TFNF_Pos (1UL) /*!< TFNF (Bit 1) */
-#define I2C_I2C_STATUS_REG_TFNF_Msk (0x2UL) /*!< TFNF (Bitfield-Mask: 0x01) */
-#define I2C_I2C_STATUS_REG_I2C_ACTIVITY_Pos (0UL) /*!< I2C_ACTIVITY (Bit 0) */
-#define I2C_I2C_STATUS_REG_I2C_ACTIVITY_Msk (0x1UL) /*!< I2C_ACTIVITY (Bitfield-Mask: 0x01) */
-/* ====================================================== I2C_TAR_REG ====================================================== */
-#define I2C_I2C_TAR_REG_SPECIAL_Pos (11UL) /*!< SPECIAL (Bit 11) */
-#define I2C_I2C_TAR_REG_SPECIAL_Msk (0x800UL) /*!< SPECIAL (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TAR_REG_GC_OR_START_Pos (10UL) /*!< GC_OR_START (Bit 10) */
-#define I2C_I2C_TAR_REG_GC_OR_START_Msk (0x400UL) /*!< GC_OR_START (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TAR_REG_IC_TAR_Pos (0UL) /*!< IC_TAR (Bit 0) */
-#define I2C_I2C_TAR_REG_IC_TAR_Msk (0x3ffUL) /*!< IC_TAR (Bitfield-Mask: 0x3ff) */
-/* ===================================================== I2C_TXFLR_REG ===================================================== */
-#define I2C_I2C_TXFLR_REG_TXFLR_Pos (0UL) /*!< TXFLR (Bit 0) */
-#define I2C_I2C_TXFLR_REG_TXFLR_Msk (0x3fUL) /*!< TXFLR (Bitfield-Mask: 0x3f) */
-/* ================================================ I2C_TX_ABRT_SOURCE_REG ================================================= */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_USER_ABRT_Pos (16UL) /*!< ABRT_USER_ABRT (Bit 16) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_USER_ABRT_Msk (0x10000UL) /*!< ABRT_USER_ABRT (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SLVRD_INTX_Pos (15UL) /*!< ABRT_SLVRD_INTX (Bit 15) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SLVRD_INTX_Msk (0x8000UL) /*!< ABRT_SLVRD_INTX (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SLV_ARBLOST_Pos (14UL) /*!< ABRT_SLV_ARBLOST (Bit 14) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SLV_ARBLOST_Msk (0x4000UL) /*!< ABRT_SLV_ARBLOST (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SLVFLUSH_TXFIFO_Pos (13UL) /*!< ABRT_SLVFLUSH_TXFIFO (Bit 13) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SLVFLUSH_TXFIFO_Msk (0x2000UL) /*!< ABRT_SLVFLUSH_TXFIFO (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ARB_LOST_Pos (12UL) /*!< ARB_LOST (Bit 12) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ARB_LOST_Msk (0x1000UL) /*!< ARB_LOST (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_MASTER_DIS_Pos (11UL) /*!< ABRT_MASTER_DIS (Bit 11) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_MASTER_DIS_Msk (0x800UL) /*!< ABRT_MASTER_DIS (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_10B_RD_NORSTRT_Pos (10UL) /*!< ABRT_10B_RD_NORSTRT (Bit 10) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_10B_RD_NORSTRT_Msk (0x400UL) /*!< ABRT_10B_RD_NORSTRT (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SBYTE_NORSTRT_Pos (9UL) /*!< ABRT_SBYTE_NORSTRT (Bit 9) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SBYTE_NORSTRT_Msk (0x200UL) /*!< ABRT_SBYTE_NORSTRT (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_HS_NORSTRT_Pos (8UL) /*!< ABRT_HS_NORSTRT (Bit 8) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_HS_NORSTRT_Msk (0x100UL) /*!< ABRT_HS_NORSTRT (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SBYTE_ACKDET_Pos (7UL) /*!< ABRT_SBYTE_ACKDET (Bit 7) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_SBYTE_ACKDET_Msk (0x80UL) /*!< ABRT_SBYTE_ACKDET (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_HS_ACKDET_Pos (6UL) /*!< ABRT_HS_ACKDET (Bit 6) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_HS_ACKDET_Msk (0x40UL) /*!< ABRT_HS_ACKDET (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_GCALL_READ_Pos (5UL) /*!< ABRT_GCALL_READ (Bit 5) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_GCALL_READ_Msk (0x20UL) /*!< ABRT_GCALL_READ (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_GCALL_NOACK_Pos (4UL) /*!< ABRT_GCALL_NOACK (Bit 4) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_GCALL_NOACK_Msk (0x10UL) /*!< ABRT_GCALL_NOACK (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_TXDATA_NOACK_Pos (3UL) /*!< ABRT_TXDATA_NOACK (Bit 3) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_TXDATA_NOACK_Msk (0x8UL) /*!< ABRT_TXDATA_NOACK (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_10ADDR2_NOACK_Pos (2UL) /*!< ABRT_10ADDR2_NOACK (Bit 2) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_10ADDR2_NOACK_Msk (0x4UL) /*!< ABRT_10ADDR2_NOACK (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_10ADDR1_NOACK_Pos (1UL) /*!< ABRT_10ADDR1_NOACK (Bit 1) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_10ADDR1_NOACK_Msk (0x2UL) /*!< ABRT_10ADDR1_NOACK (Bitfield-Mask: 0x01) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_7B_ADDR_NOACK_Pos (0UL) /*!< ABRT_7B_ADDR_NOACK (Bit 0) */
-#define I2C_I2C_TX_ABRT_SOURCE_REG_ABRT_7B_ADDR_NOACK_Msk (0x1UL) /*!< ABRT_7B_ADDR_NOACK (Bitfield-Mask: 0x01) */
-/* ===================================================== I2C_TX_TL_REG ===================================================== */
-#define I2C_I2C_TX_TL_REG_TX_TL_Pos (0UL) /*!< TX_TL (Bit 0) */
-#define I2C_I2C_TX_TL_REG_TX_TL_Msk (0x1fUL) /*!< TX_TL (Bitfield-Mask: 0x1f) */
-
-
-/* =========================================================================================================================== */
-/* ================ I2C2 ================ */
-/* =========================================================================================================================== */
-
-/* =============================================== I2C2_ACK_GENERAL_CALL_REG =============================================== */
-#define I2C2_I2C2_ACK_GENERAL_CALL_REG_ACK_GEN_CALL_Pos (0UL) /*!< ACK_GEN_CALL (Bit 0) */
-#define I2C2_I2C2_ACK_GENERAL_CALL_REG_ACK_GEN_CALL_Msk (0x1UL) /*!< ACK_GEN_CALL (Bitfield-Mask: 0x01) */
-/* ================================================= I2C2_CLR_ACTIVITY_REG ================================================= */
-#define I2C2_I2C2_CLR_ACTIVITY_REG_CLR_ACTIVITY_Pos (0UL) /*!< CLR_ACTIVITY (Bit 0) */
-#define I2C2_I2C2_CLR_ACTIVITY_REG_CLR_ACTIVITY_Msk (0x1UL) /*!< CLR_ACTIVITY (Bitfield-Mask: 0x01) */
-/* ================================================= I2C2_CLR_GEN_CALL_REG ================================================= */
-#define I2C2_I2C2_CLR_GEN_CALL_REG_CLR_GEN_CALL_Pos (0UL) /*!< CLR_GEN_CALL (Bit 0) */
-#define I2C2_I2C2_CLR_GEN_CALL_REG_CLR_GEN_CALL_Msk (0x1UL) /*!< CLR_GEN_CALL (Bitfield-Mask: 0x01) */
-/* =================================================== I2C2_CLR_INTR_REG =================================================== */
-#define I2C2_I2C2_CLR_INTR_REG_CLR_INTR_Pos (0UL) /*!< CLR_INTR (Bit 0) */
-#define I2C2_I2C2_CLR_INTR_REG_CLR_INTR_Msk (0x1UL) /*!< CLR_INTR (Bitfield-Mask: 0x01) */
-/* ================================================== I2C2_CLR_RD_REQ_REG ================================================== */
-#define I2C2_I2C2_CLR_RD_REQ_REG_CLR_RD_REQ_Pos (0UL) /*!< CLR_RD_REQ (Bit 0) */
-#define I2C2_I2C2_CLR_RD_REQ_REG_CLR_RD_REQ_Msk (0x1UL) /*!< CLR_RD_REQ (Bitfield-Mask: 0x01) */
-/* ================================================= I2C2_CLR_RX_DONE_REG ================================================== */
-#define I2C2_I2C2_CLR_RX_DONE_REG_CLR_RX_DONE_Pos (0UL) /*!< CLR_RX_DONE (Bit 0) */
-#define I2C2_I2C2_CLR_RX_DONE_REG_CLR_RX_DONE_Msk (0x1UL) /*!< CLR_RX_DONE (Bitfield-Mask: 0x01) */
-/* ================================================= I2C2_CLR_RX_OVER_REG ================================================== */
-#define I2C2_I2C2_CLR_RX_OVER_REG_CLR_RX_OVER_Pos (0UL) /*!< CLR_RX_OVER (Bit 0) */
-#define I2C2_I2C2_CLR_RX_OVER_REG_CLR_RX_OVER_Msk (0x1UL) /*!< CLR_RX_OVER (Bitfield-Mask: 0x01) */
-/* ================================================= I2C2_CLR_RX_UNDER_REG ================================================= */
-#define I2C2_I2C2_CLR_RX_UNDER_REG_CLR_RX_UNDER_Pos (0UL) /*!< CLR_RX_UNDER (Bit 0) */
-#define I2C2_I2C2_CLR_RX_UNDER_REG_CLR_RX_UNDER_Msk (0x1UL) /*!< CLR_RX_UNDER (Bitfield-Mask: 0x01) */
-/* ================================================ I2C2_CLR_START_DET_REG ================================================= */
-#define I2C2_I2C2_CLR_START_DET_REG_CLR_START_DET_Pos (0UL) /*!< CLR_START_DET (Bit 0) */
-#define I2C2_I2C2_CLR_START_DET_REG_CLR_START_DET_Msk (0x1UL) /*!< CLR_START_DET (Bitfield-Mask: 0x01) */
-/* ================================================= I2C2_CLR_STOP_DET_REG ================================================= */
-#define I2C2_I2C2_CLR_STOP_DET_REG_CLR_STOP_DET_Pos (0UL) /*!< CLR_STOP_DET (Bit 0) */
-#define I2C2_I2C2_CLR_STOP_DET_REG_CLR_STOP_DET_Msk (0x1UL) /*!< CLR_STOP_DET (Bitfield-Mask: 0x01) */
-/* ================================================= I2C2_CLR_TX_ABRT_REG ================================================== */
-#define I2C2_I2C2_CLR_TX_ABRT_REG_CLR_TX_ABRT_Pos (0UL) /*!< CLR_TX_ABRT (Bit 0) */
-#define I2C2_I2C2_CLR_TX_ABRT_REG_CLR_TX_ABRT_Msk (0x1UL) /*!< CLR_TX_ABRT (Bitfield-Mask: 0x01) */
-/* ================================================= I2C2_CLR_TX_OVER_REG ================================================== */
-#define I2C2_I2C2_CLR_TX_OVER_REG_CLR_TX_OVER_Pos (0UL) /*!< CLR_TX_OVER (Bit 0) */
-#define I2C2_I2C2_CLR_TX_OVER_REG_CLR_TX_OVER_Msk (0x1UL) /*!< CLR_TX_OVER (Bitfield-Mask: 0x01) */
-/* ===================================================== I2C2_CON_REG ====================================================== */
-#define I2C2_I2C2_CON_REG_I2C_STOP_DET_IF_MASTER_ACTIVE_Pos (10UL) /*!< I2C_STOP_DET_IF_MASTER_ACTIVE (Bit 10) */
-#define I2C2_I2C2_CON_REG_I2C_STOP_DET_IF_MASTER_ACTIVE_Msk (0x400UL) /*!< I2C_STOP_DET_IF_MASTER_ACTIVE (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_CON_REG_I2C_RX_FIFO_FULL_HLD_CTRL_Pos (9UL) /*!< I2C_RX_FIFO_FULL_HLD_CTRL (Bit 9) */
-#define I2C2_I2C2_CON_REG_I2C_RX_FIFO_FULL_HLD_CTRL_Msk (0x200UL) /*!< I2C_RX_FIFO_FULL_HLD_CTRL (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_CON_REG_I2C_TX_EMPTY_CTRL_Pos (8UL) /*!< I2C_TX_EMPTY_CTRL (Bit 8) */
-#define I2C2_I2C2_CON_REG_I2C_TX_EMPTY_CTRL_Msk (0x100UL) /*!< I2C_TX_EMPTY_CTRL (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_CON_REG_I2C_STOP_DET_IFADDRESSED_Pos (7UL) /*!< I2C_STOP_DET_IFADDRESSED (Bit 7) */
-#define I2C2_I2C2_CON_REG_I2C_STOP_DET_IFADDRESSED_Msk (0x80UL) /*!< I2C_STOP_DET_IFADDRESSED (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_CON_REG_I2C_SLAVE_DISABLE_Pos (6UL) /*!< I2C_SLAVE_DISABLE (Bit 6) */
-#define I2C2_I2C2_CON_REG_I2C_SLAVE_DISABLE_Msk (0x40UL) /*!< I2C_SLAVE_DISABLE (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_CON_REG_I2C_RESTART_EN_Pos (5UL) /*!< I2C_RESTART_EN (Bit 5) */
-#define I2C2_I2C2_CON_REG_I2C_RESTART_EN_Msk (0x20UL) /*!< I2C_RESTART_EN (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_CON_REG_I2C_10BITADDR_MASTER_Pos (4UL) /*!< I2C_10BITADDR_MASTER (Bit 4) */
-#define I2C2_I2C2_CON_REG_I2C_10BITADDR_MASTER_Msk (0x10UL) /*!< I2C_10BITADDR_MASTER (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_CON_REG_I2C_10BITADDR_SLAVE_Pos (3UL) /*!< I2C_10BITADDR_SLAVE (Bit 3) */
-#define I2C2_I2C2_CON_REG_I2C_10BITADDR_SLAVE_Msk (0x8UL) /*!< I2C_10BITADDR_SLAVE (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_CON_REG_I2C_SPEED_Pos (1UL) /*!< I2C_SPEED (Bit 1) */
-#define I2C2_I2C2_CON_REG_I2C_SPEED_Msk (0x6UL) /*!< I2C_SPEED (Bitfield-Mask: 0x03) */
-#define I2C2_I2C2_CON_REG_I2C_MASTER_MODE_Pos (0UL) /*!< I2C_MASTER_MODE (Bit 0) */
-#define I2C2_I2C2_CON_REG_I2C_MASTER_MODE_Msk (0x1UL) /*!< I2C_MASTER_MODE (Bitfield-Mask: 0x01) */
-/* =================================================== I2C2_DATA_CMD_REG =================================================== */
-#define I2C2_I2C2_DATA_CMD_REG_I2C_RESTART_Pos (10UL) /*!< I2C_RESTART (Bit 10) */
-#define I2C2_I2C2_DATA_CMD_REG_I2C_RESTART_Msk (0x400UL) /*!< I2C_RESTART (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_DATA_CMD_REG_I2C_STOP_Pos (9UL) /*!< I2C_STOP (Bit 9) */
-#define I2C2_I2C2_DATA_CMD_REG_I2C_STOP_Msk (0x200UL) /*!< I2C_STOP (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_DATA_CMD_REG_I2C_CMD_Pos (8UL) /*!< I2C_CMD (Bit 8) */
-#define I2C2_I2C2_DATA_CMD_REG_I2C_CMD_Msk (0x100UL) /*!< I2C_CMD (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_DATA_CMD_REG_I2C_DAT_Pos (0UL) /*!< I2C_DAT (Bit 0) */
-#define I2C2_I2C2_DATA_CMD_REG_I2C_DAT_Msk (0xffUL) /*!< I2C_DAT (Bitfield-Mask: 0xff) */
-/* ==================================================== I2C2_DMA_CR_REG ==================================================== */
-#define I2C2_I2C2_DMA_CR_REG_TDMAE_Pos (1UL) /*!< TDMAE (Bit 1) */
-#define I2C2_I2C2_DMA_CR_REG_TDMAE_Msk (0x2UL) /*!< TDMAE (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_DMA_CR_REG_RDMAE_Pos (0UL) /*!< RDMAE (Bit 0) */
-#define I2C2_I2C2_DMA_CR_REG_RDMAE_Msk (0x1UL) /*!< RDMAE (Bitfield-Mask: 0x01) */
-/* =================================================== I2C2_DMA_RDLR_REG =================================================== */
-#define I2C2_I2C2_DMA_RDLR_REG_DMARDL_Pos (0UL) /*!< DMARDL (Bit 0) */
-#define I2C2_I2C2_DMA_RDLR_REG_DMARDL_Msk (0x1fUL) /*!< DMARDL (Bitfield-Mask: 0x1f) */
-/* =================================================== I2C2_DMA_TDLR_REG =================================================== */
-#define I2C2_I2C2_DMA_TDLR_REG_DMATDL_Pos (0UL) /*!< DMATDL (Bit 0) */
-#define I2C2_I2C2_DMA_TDLR_REG_DMATDL_Msk (0x1fUL) /*!< DMATDL (Bitfield-Mask: 0x1f) */
-/* ==================================================== I2C2_ENABLE_REG ==================================================== */
-#define I2C2_I2C2_ENABLE_REG_I2C_TX_CMD_BLOCK_Pos (2UL) /*!< I2C_TX_CMD_BLOCK (Bit 2) */
-#define I2C2_I2C2_ENABLE_REG_I2C_TX_CMD_BLOCK_Msk (0x4UL) /*!< I2C_TX_CMD_BLOCK (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_ENABLE_REG_I2C_ABORT_Pos (1UL) /*!< I2C_ABORT (Bit 1) */
-#define I2C2_I2C2_ENABLE_REG_I2C_ABORT_Msk (0x2UL) /*!< I2C_ABORT (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_ENABLE_REG_I2C_EN_Pos (0UL) /*!< I2C_EN (Bit 0) */
-#define I2C2_I2C2_ENABLE_REG_I2C_EN_Msk (0x1UL) /*!< I2C_EN (Bitfield-Mask: 0x01) */
-/* ================================================ I2C2_ENABLE_STATUS_REG ================================================= */
-#define I2C2_I2C2_ENABLE_STATUS_REG_SLV_RX_DATA_LOST_Pos (2UL) /*!< SLV_RX_DATA_LOST (Bit 2) */
-#define I2C2_I2C2_ENABLE_STATUS_REG_SLV_RX_DATA_LOST_Msk (0x4UL) /*!< SLV_RX_DATA_LOST (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_ENABLE_STATUS_REG_SLV_DISABLED_WHILE_BUSY_Pos (1UL) /*!< SLV_DISABLED_WHILE_BUSY (Bit 1) */
-#define I2C2_I2C2_ENABLE_STATUS_REG_SLV_DISABLED_WHILE_BUSY_Msk (0x2UL) /*!< SLV_DISABLED_WHILE_BUSY (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_ENABLE_STATUS_REG_IC_EN_Pos (0UL) /*!< IC_EN (Bit 0) */
-#define I2C2_I2C2_ENABLE_STATUS_REG_IC_EN_Msk (0x1UL) /*!< IC_EN (Bitfield-Mask: 0x01) */
-/* ================================================= I2C2_FS_SCL_HCNT_REG ================================================== */
-#define I2C2_I2C2_FS_SCL_HCNT_REG_IC_FS_SCL_HCNT_Pos (0UL) /*!< IC_FS_SCL_HCNT (Bit 0) */
-#define I2C2_I2C2_FS_SCL_HCNT_REG_IC_FS_SCL_HCNT_Msk (0xffffUL) /*!< IC_FS_SCL_HCNT (Bitfield-Mask: 0xffff) */
-/* ================================================= I2C2_FS_SCL_LCNT_REG ================================================== */
-#define I2C2_I2C2_FS_SCL_LCNT_REG_IC_FS_SCL_LCNT_Pos (0UL) /*!< IC_FS_SCL_LCNT (Bit 0) */
-#define I2C2_I2C2_FS_SCL_LCNT_REG_IC_FS_SCL_LCNT_Msk (0xffffUL) /*!< IC_FS_SCL_LCNT (Bitfield-Mask: 0xffff) */
-/* =================================================== I2C2_HS_MADDR_REG =================================================== */
-#define I2C2_I2C2_HS_MADDR_REG_I2C_IC_HS_MAR_Pos (0UL) /*!< I2C_IC_HS_MAR (Bit 0) */
-#define I2C2_I2C2_HS_MADDR_REG_I2C_IC_HS_MAR_Msk (0x7UL) /*!< I2C_IC_HS_MAR (Bitfield-Mask: 0x07) */
-/* ================================================= I2C2_HS_SCL_HCNT_REG ================================================== */
-#define I2C2_I2C2_HS_SCL_HCNT_REG_IC_HS_SCL_HCNT_Pos (0UL) /*!< IC_HS_SCL_HCNT (Bit 0) */
-#define I2C2_I2C2_HS_SCL_HCNT_REG_IC_HS_SCL_HCNT_Msk (0xffffUL) /*!< IC_HS_SCL_HCNT (Bitfield-Mask: 0xffff) */
-/* ================================================= I2C2_HS_SCL_LCNT_REG ================================================== */
-#define I2C2_I2C2_HS_SCL_LCNT_REG_IC_HS_SCL_LCNT_Pos (0UL) /*!< IC_HS_SCL_LCNT (Bit 0) */
-#define I2C2_I2C2_HS_SCL_LCNT_REG_IC_HS_SCL_LCNT_Msk (0xffffUL) /*!< IC_HS_SCL_LCNT (Bitfield-Mask: 0xffff) */
-/* ================================================= I2C2_IC_FS_SPKLEN_REG ================================================= */
-#define I2C2_I2C2_IC_FS_SPKLEN_REG_I2C_FS_SPKLEN_Pos (0UL) /*!< I2C_FS_SPKLEN (Bit 0) */
-#define I2C2_I2C2_IC_FS_SPKLEN_REG_I2C_FS_SPKLEN_Msk (0xffUL) /*!< I2C_FS_SPKLEN (Bitfield-Mask: 0xff) */
-/* ================================================= I2C2_IC_HS_SPKLEN_REG ================================================= */
-#define I2C2_I2C2_IC_HS_SPKLEN_REG_I2C_HS_SPKLEN_Pos (0UL) /*!< I2C_HS_SPKLEN (Bit 0) */
-#define I2C2_I2C2_IC_HS_SPKLEN_REG_I2C_HS_SPKLEN_Msk (0xffUL) /*!< I2C_HS_SPKLEN (Bitfield-Mask: 0xff) */
-/* ================================================== I2C2_INTR_MASK_REG =================================================== */
-#define I2C2_I2C2_INTR_MASK_REG_M_SCL_STUCK_AT_LOW_Pos (14UL) /*!< M_SCL_STUCK_AT_LOW (Bit 14) */
-#define I2C2_I2C2_INTR_MASK_REG_M_SCL_STUCK_AT_LOW_Msk (0x4000UL) /*!< M_SCL_STUCK_AT_LOW (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_MASTER_ON_HOLD_Pos (13UL) /*!< M_MASTER_ON_HOLD (Bit 13) */
-#define I2C2_I2C2_INTR_MASK_REG_M_MASTER_ON_HOLD_Msk (0x2000UL) /*!< M_MASTER_ON_HOLD (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_RESTART_DET_Pos (12UL) /*!< M_RESTART_DET (Bit 12) */
-#define I2C2_I2C2_INTR_MASK_REG_M_RESTART_DET_Msk (0x1000UL) /*!< M_RESTART_DET (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_GEN_CALL_Pos (11UL) /*!< M_GEN_CALL (Bit 11) */
-#define I2C2_I2C2_INTR_MASK_REG_M_GEN_CALL_Msk (0x800UL) /*!< M_GEN_CALL (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_START_DET_Pos (10UL) /*!< M_START_DET (Bit 10) */
-#define I2C2_I2C2_INTR_MASK_REG_M_START_DET_Msk (0x400UL) /*!< M_START_DET (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_STOP_DET_Pos (9UL) /*!< M_STOP_DET (Bit 9) */
-#define I2C2_I2C2_INTR_MASK_REG_M_STOP_DET_Msk (0x200UL) /*!< M_STOP_DET (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_ACTIVITY_Pos (8UL) /*!< M_ACTIVITY (Bit 8) */
-#define I2C2_I2C2_INTR_MASK_REG_M_ACTIVITY_Msk (0x100UL) /*!< M_ACTIVITY (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_RX_DONE_Pos (7UL) /*!< M_RX_DONE (Bit 7) */
-#define I2C2_I2C2_INTR_MASK_REG_M_RX_DONE_Msk (0x80UL) /*!< M_RX_DONE (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_TX_ABRT_Pos (6UL) /*!< M_TX_ABRT (Bit 6) */
-#define I2C2_I2C2_INTR_MASK_REG_M_TX_ABRT_Msk (0x40UL) /*!< M_TX_ABRT (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_RD_REQ_Pos (5UL) /*!< M_RD_REQ (Bit 5) */
-#define I2C2_I2C2_INTR_MASK_REG_M_RD_REQ_Msk (0x20UL) /*!< M_RD_REQ (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_TX_EMPTY_Pos (4UL) /*!< M_TX_EMPTY (Bit 4) */
-#define I2C2_I2C2_INTR_MASK_REG_M_TX_EMPTY_Msk (0x10UL) /*!< M_TX_EMPTY (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_TX_OVER_Pos (3UL) /*!< M_TX_OVER (Bit 3) */
-#define I2C2_I2C2_INTR_MASK_REG_M_TX_OVER_Msk (0x8UL) /*!< M_TX_OVER (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_RX_FULL_Pos (2UL) /*!< M_RX_FULL (Bit 2) */
-#define I2C2_I2C2_INTR_MASK_REG_M_RX_FULL_Msk (0x4UL) /*!< M_RX_FULL (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_RX_OVER_Pos (1UL) /*!< M_RX_OVER (Bit 1) */
-#define I2C2_I2C2_INTR_MASK_REG_M_RX_OVER_Msk (0x2UL) /*!< M_RX_OVER (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_MASK_REG_M_RX_UNDER_Pos (0UL) /*!< M_RX_UNDER (Bit 0) */
-#define I2C2_I2C2_INTR_MASK_REG_M_RX_UNDER_Msk (0x1UL) /*!< M_RX_UNDER (Bitfield-Mask: 0x01) */
-/* ================================================== I2C2_INTR_STAT_REG =================================================== */
-#define I2C2_I2C2_INTR_STAT_REG_R_SCL_STUCK_AT_LOW_Pos (14UL) /*!< R_SCL_STUCK_AT_LOW (Bit 14) */
-#define I2C2_I2C2_INTR_STAT_REG_R_SCL_STUCK_AT_LOW_Msk (0x4000UL) /*!< R_SCL_STUCK_AT_LOW (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_MASTER_ON_HOLD_Pos (13UL) /*!< R_MASTER_ON_HOLD (Bit 13) */
-#define I2C2_I2C2_INTR_STAT_REG_R_MASTER_ON_HOLD_Msk (0x2000UL) /*!< R_MASTER_ON_HOLD (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_RESTART_DET_Pos (12UL) /*!< R_RESTART_DET (Bit 12) */
-#define I2C2_I2C2_INTR_STAT_REG_R_RESTART_DET_Msk (0x1000UL) /*!< R_RESTART_DET (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_GEN_CALL_Pos (11UL) /*!< R_GEN_CALL (Bit 11) */
-#define I2C2_I2C2_INTR_STAT_REG_R_GEN_CALL_Msk (0x800UL) /*!< R_GEN_CALL (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_START_DET_Pos (10UL) /*!< R_START_DET (Bit 10) */
-#define I2C2_I2C2_INTR_STAT_REG_R_START_DET_Msk (0x400UL) /*!< R_START_DET (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_STOP_DET_Pos (9UL) /*!< R_STOP_DET (Bit 9) */
-#define I2C2_I2C2_INTR_STAT_REG_R_STOP_DET_Msk (0x200UL) /*!< R_STOP_DET (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_ACTIVITY_Pos (8UL) /*!< R_ACTIVITY (Bit 8) */
-#define I2C2_I2C2_INTR_STAT_REG_R_ACTIVITY_Msk (0x100UL) /*!< R_ACTIVITY (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_RX_DONE_Pos (7UL) /*!< R_RX_DONE (Bit 7) */
-#define I2C2_I2C2_INTR_STAT_REG_R_RX_DONE_Msk (0x80UL) /*!< R_RX_DONE (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_TX_ABRT_Pos (6UL) /*!< R_TX_ABRT (Bit 6) */
-#define I2C2_I2C2_INTR_STAT_REG_R_TX_ABRT_Msk (0x40UL) /*!< R_TX_ABRT (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_RD_REQ_Pos (5UL) /*!< R_RD_REQ (Bit 5) */
-#define I2C2_I2C2_INTR_STAT_REG_R_RD_REQ_Msk (0x20UL) /*!< R_RD_REQ (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_TX_EMPTY_Pos (4UL) /*!< R_TX_EMPTY (Bit 4) */
-#define I2C2_I2C2_INTR_STAT_REG_R_TX_EMPTY_Msk (0x10UL) /*!< R_TX_EMPTY (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_TX_OVER_Pos (3UL) /*!< R_TX_OVER (Bit 3) */
-#define I2C2_I2C2_INTR_STAT_REG_R_TX_OVER_Msk (0x8UL) /*!< R_TX_OVER (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_RX_FULL_Pos (2UL) /*!< R_RX_FULL (Bit 2) */
-#define I2C2_I2C2_INTR_STAT_REG_R_RX_FULL_Msk (0x4UL) /*!< R_RX_FULL (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_RX_OVER_Pos (1UL) /*!< R_RX_OVER (Bit 1) */
-#define I2C2_I2C2_INTR_STAT_REG_R_RX_OVER_Msk (0x2UL) /*!< R_RX_OVER (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_INTR_STAT_REG_R_RX_UNDER_Pos (0UL) /*!< R_RX_UNDER (Bit 0) */
-#define I2C2_I2C2_INTR_STAT_REG_R_RX_UNDER_Msk (0x1UL) /*!< R_RX_UNDER (Bitfield-Mask: 0x01) */
-/* ================================================ I2C2_RAW_INTR_STAT_REG ================================================= */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_SCL_STUCK_AT_LOW_Pos (14UL) /*!< SCL_STUCK_AT_LOW (Bit 14) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_SCL_STUCK_AT_LOW_Msk (0x4000UL) /*!< SCL_STUCK_AT_LOW (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_MASTER_ON_HOLD_Pos (13UL) /*!< MASTER_ON_HOLD (Bit 13) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_MASTER_ON_HOLD_Msk (0x2000UL) /*!< MASTER_ON_HOLD (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_RESTART_DET_Pos (12UL) /*!< RESTART_DET (Bit 12) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_RESTART_DET_Msk (0x1000UL) /*!< RESTART_DET (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_GEN_CALL_Pos (11UL) /*!< GEN_CALL (Bit 11) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_GEN_CALL_Msk (0x800UL) /*!< GEN_CALL (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_START_DET_Pos (10UL) /*!< START_DET (Bit 10) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_START_DET_Msk (0x400UL) /*!< START_DET (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_STOP_DET_Pos (9UL) /*!< STOP_DET (Bit 9) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_STOP_DET_Msk (0x200UL) /*!< STOP_DET (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_ACTIVITY_Pos (8UL) /*!< ACTIVITY (Bit 8) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_ACTIVITY_Msk (0x100UL) /*!< ACTIVITY (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_RX_DONE_Pos (7UL) /*!< RX_DONE (Bit 7) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_RX_DONE_Msk (0x80UL) /*!< RX_DONE (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_TX_ABRT_Pos (6UL) /*!< TX_ABRT (Bit 6) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_TX_ABRT_Msk (0x40UL) /*!< TX_ABRT (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_RD_REQ_Pos (5UL) /*!< RD_REQ (Bit 5) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_RD_REQ_Msk (0x20UL) /*!< RD_REQ (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_TX_EMPTY_Pos (4UL) /*!< TX_EMPTY (Bit 4) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_TX_EMPTY_Msk (0x10UL) /*!< TX_EMPTY (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_TX_OVER_Pos (3UL) /*!< TX_OVER (Bit 3) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_TX_OVER_Msk (0x8UL) /*!< TX_OVER (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_RX_FULL_Pos (2UL) /*!< RX_FULL (Bit 2) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_RX_FULL_Msk (0x4UL) /*!< RX_FULL (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_RX_OVER_Pos (1UL) /*!< RX_OVER (Bit 1) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_RX_OVER_Msk (0x2UL) /*!< RX_OVER (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_RX_UNDER_Pos (0UL) /*!< RX_UNDER (Bit 0) */
-#define I2C2_I2C2_RAW_INTR_STAT_REG_RX_UNDER_Msk (0x1UL) /*!< RX_UNDER (Bitfield-Mask: 0x01) */
-/* ==================================================== I2C2_RXFLR_REG ===================================================== */
-#define I2C2_I2C2_RXFLR_REG_RXFLR_Pos (0UL) /*!< RXFLR (Bit 0) */
-#define I2C2_I2C2_RXFLR_REG_RXFLR_Msk (0x3fUL) /*!< RXFLR (Bitfield-Mask: 0x3f) */
-/* ==================================================== I2C2_RX_TL_REG ===================================================== */
-#define I2C2_I2C2_RX_TL_REG_RX_TL_Pos (0UL) /*!< RX_TL (Bit 0) */
-#define I2C2_I2C2_RX_TL_REG_RX_TL_Msk (0x1fUL) /*!< RX_TL (Bitfield-Mask: 0x1f) */
-/* ===================================================== I2C2_SAR_REG ====================================================== */
-#define I2C2_I2C2_SAR_REG_IC_SAR_Pos (0UL) /*!< IC_SAR (Bit 0) */
-#define I2C2_I2C2_SAR_REG_IC_SAR_Msk (0x3ffUL) /*!< IC_SAR (Bitfield-Mask: 0x3ff) */
-/* =================================================== I2C2_SDA_HOLD_REG =================================================== */
-#define I2C2_I2C2_SDA_HOLD_REG_I2C_SDA_RX_HOLD_Pos (16UL) /*!< I2C_SDA_RX_HOLD (Bit 16) */
-#define I2C2_I2C2_SDA_HOLD_REG_I2C_SDA_RX_HOLD_Msk (0xff0000UL) /*!< I2C_SDA_RX_HOLD (Bitfield-Mask: 0xff) */
-#define I2C2_I2C2_SDA_HOLD_REG_I2C_SDA_TX_HOLD_Pos (0UL) /*!< I2C_SDA_TX_HOLD (Bit 0) */
-#define I2C2_I2C2_SDA_HOLD_REG_I2C_SDA_TX_HOLD_Msk (0xffffUL) /*!< I2C_SDA_TX_HOLD (Bitfield-Mask: 0xffff) */
-/* ================================================== I2C2_SDA_SETUP_REG =================================================== */
-#define I2C2_I2C2_SDA_SETUP_REG_SDA_SETUP_Pos (0UL) /*!< SDA_SETUP (Bit 0) */
-#define I2C2_I2C2_SDA_SETUP_REG_SDA_SETUP_Msk (0xffUL) /*!< SDA_SETUP (Bitfield-Mask: 0xff) */
-/* ================================================= I2C2_SS_SCL_HCNT_REG ================================================== */
-#define I2C2_I2C2_SS_SCL_HCNT_REG_IC_SS_SCL_HCNT_Pos (0UL) /*!< IC_SS_SCL_HCNT (Bit 0) */
-#define I2C2_I2C2_SS_SCL_HCNT_REG_IC_SS_SCL_HCNT_Msk (0xffffUL) /*!< IC_SS_SCL_HCNT (Bitfield-Mask: 0xffff) */
-/* ================================================= I2C2_SS_SCL_LCNT_REG ================================================== */
-#define I2C2_I2C2_SS_SCL_LCNT_REG_IC_SS_SCL_LCNT_Pos (0UL) /*!< IC_SS_SCL_LCNT (Bit 0) */
-#define I2C2_I2C2_SS_SCL_LCNT_REG_IC_SS_SCL_LCNT_Msk (0xffffUL) /*!< IC_SS_SCL_LCNT (Bitfield-Mask: 0xffff) */
-/* ==================================================== I2C2_STATUS_REG ==================================================== */
-#define I2C2_I2C2_STATUS_REG_LV_HOLD_RX_FIFO_FULL_Pos (10UL) /*!< LV_HOLD_RX_FIFO_FULL (Bit 10) */
-#define I2C2_I2C2_STATUS_REG_LV_HOLD_RX_FIFO_FULL_Msk (0x400UL) /*!< LV_HOLD_RX_FIFO_FULL (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_STATUS_REG_SLV_HOLD_TX_FIFO_EMPTY_Pos (9UL) /*!< SLV_HOLD_TX_FIFO_EMPTY (Bit 9) */
-#define I2C2_I2C2_STATUS_REG_SLV_HOLD_TX_FIFO_EMPTY_Msk (0x200UL) /*!< SLV_HOLD_TX_FIFO_EMPTY (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_STATUS_REG_MST_HOLD_RX_FIFO_FULL_Pos (8UL) /*!< MST_HOLD_RX_FIFO_FULL (Bit 8) */
-#define I2C2_I2C2_STATUS_REG_MST_HOLD_RX_FIFO_FULL_Msk (0x100UL) /*!< MST_HOLD_RX_FIFO_FULL (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_STATUS_REG_MST_HOLD_TX_FIFO_EMPTY_Pos (7UL) /*!< MST_HOLD_TX_FIFO_EMPTY (Bit 7) */
-#define I2C2_I2C2_STATUS_REG_MST_HOLD_TX_FIFO_EMPTY_Msk (0x80UL) /*!< MST_HOLD_TX_FIFO_EMPTY (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_STATUS_REG_SLV_ACTIVITY_Pos (6UL) /*!< SLV_ACTIVITY (Bit 6) */
-#define I2C2_I2C2_STATUS_REG_SLV_ACTIVITY_Msk (0x40UL) /*!< SLV_ACTIVITY (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_STATUS_REG_MST_ACTIVITY_Pos (5UL) /*!< MST_ACTIVITY (Bit 5) */
-#define I2C2_I2C2_STATUS_REG_MST_ACTIVITY_Msk (0x20UL) /*!< MST_ACTIVITY (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_STATUS_REG_RFF_Pos (4UL) /*!< RFF (Bit 4) */
-#define I2C2_I2C2_STATUS_REG_RFF_Msk (0x10UL) /*!< RFF (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_STATUS_REG_RFNE_Pos (3UL) /*!< RFNE (Bit 3) */
-#define I2C2_I2C2_STATUS_REG_RFNE_Msk (0x8UL) /*!< RFNE (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_STATUS_REG_TFE_Pos (2UL) /*!< TFE (Bit 2) */
-#define I2C2_I2C2_STATUS_REG_TFE_Msk (0x4UL) /*!< TFE (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_STATUS_REG_TFNF_Pos (1UL) /*!< TFNF (Bit 1) */
-#define I2C2_I2C2_STATUS_REG_TFNF_Msk (0x2UL) /*!< TFNF (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_STATUS_REG_I2C_ACTIVITY_Pos (0UL) /*!< I2C_ACTIVITY (Bit 0) */
-#define I2C2_I2C2_STATUS_REG_I2C_ACTIVITY_Msk (0x1UL) /*!< I2C_ACTIVITY (Bitfield-Mask: 0x01) */
-/* ===================================================== I2C2_TAR_REG ====================================================== */
-#define I2C2_I2C2_TAR_REG_SPECIAL_Pos (11UL) /*!< SPECIAL (Bit 11) */
-#define I2C2_I2C2_TAR_REG_SPECIAL_Msk (0x800UL) /*!< SPECIAL (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TAR_REG_GC_OR_START_Pos (10UL) /*!< GC_OR_START (Bit 10) */
-#define I2C2_I2C2_TAR_REG_GC_OR_START_Msk (0x400UL) /*!< GC_OR_START (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TAR_REG_IC_TAR_Pos (0UL) /*!< IC_TAR (Bit 0) */
-#define I2C2_I2C2_TAR_REG_IC_TAR_Msk (0x3ffUL) /*!< IC_TAR (Bitfield-Mask: 0x3ff) */
-/* ==================================================== I2C2_TXFLR_REG ===================================================== */
-#define I2C2_I2C2_TXFLR_REG_TXFLR_Pos (0UL) /*!< TXFLR (Bit 0) */
-#define I2C2_I2C2_TXFLR_REG_TXFLR_Msk (0x3fUL) /*!< TXFLR (Bitfield-Mask: 0x3f) */
-/* ================================================ I2C2_TX_ABRT_SOURCE_REG ================================================ */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_USER_ABRT_Pos (16UL) /*!< ABRT_USER_ABRT (Bit 16) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_USER_ABRT_Msk (0x10000UL) /*!< ABRT_USER_ABRT (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_SLVRD_INTX_Pos (15UL) /*!< ABRT_SLVRD_INTX (Bit 15) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_SLVRD_INTX_Msk (0x8000UL) /*!< ABRT_SLVRD_INTX (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_SLV_ARBLOST_Pos (14UL) /*!< ABRT_SLV_ARBLOST (Bit 14) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_SLV_ARBLOST_Msk (0x4000UL) /*!< ABRT_SLV_ARBLOST (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_SLVFLUSH_TXFIFO_Pos (13UL) /*!< ABRT_SLVFLUSH_TXFIFO (Bit 13) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_SLVFLUSH_TXFIFO_Msk (0x2000UL) /*!< ABRT_SLVFLUSH_TXFIFO (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ARB_LOST_Pos (12UL) /*!< ARB_LOST (Bit 12) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ARB_LOST_Msk (0x1000UL) /*!< ARB_LOST (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_MASTER_DIS_Pos (11UL) /*!< ABRT_MASTER_DIS (Bit 11) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_MASTER_DIS_Msk (0x800UL) /*!< ABRT_MASTER_DIS (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_10B_RD_NORSTRT_Pos (10UL) /*!< ABRT_10B_RD_NORSTRT (Bit 10) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_10B_RD_NORSTRT_Msk (0x400UL) /*!< ABRT_10B_RD_NORSTRT (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_SBYTE_NORSTRT_Pos (9UL) /*!< ABRT_SBYTE_NORSTRT (Bit 9) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_SBYTE_NORSTRT_Msk (0x200UL) /*!< ABRT_SBYTE_NORSTRT (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_HS_NORSTRT_Pos (8UL) /*!< ABRT_HS_NORSTRT (Bit 8) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_HS_NORSTRT_Msk (0x100UL) /*!< ABRT_HS_NORSTRT (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_SBYTE_ACKDET_Pos (7UL) /*!< ABRT_SBYTE_ACKDET (Bit 7) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_SBYTE_ACKDET_Msk (0x80UL) /*!< ABRT_SBYTE_ACKDET (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_HS_ACKDET_Pos (6UL) /*!< ABRT_HS_ACKDET (Bit 6) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_HS_ACKDET_Msk (0x40UL) /*!< ABRT_HS_ACKDET (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_GCALL_READ_Pos (5UL) /*!< ABRT_GCALL_READ (Bit 5) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_GCALL_READ_Msk (0x20UL) /*!< ABRT_GCALL_READ (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_GCALL_NOACK_Pos (4UL) /*!< ABRT_GCALL_NOACK (Bit 4) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_GCALL_NOACK_Msk (0x10UL) /*!< ABRT_GCALL_NOACK (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_TXDATA_NOACK_Pos (3UL) /*!< ABRT_TXDATA_NOACK (Bit 3) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_TXDATA_NOACK_Msk (0x8UL) /*!< ABRT_TXDATA_NOACK (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_10ADDR2_NOACK_Pos (2UL) /*!< ABRT_10ADDR2_NOACK (Bit 2) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_10ADDR2_NOACK_Msk (0x4UL) /*!< ABRT_10ADDR2_NOACK (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_10ADDR1_NOACK_Pos (1UL) /*!< ABRT_10ADDR1_NOACK (Bit 1) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_10ADDR1_NOACK_Msk (0x2UL) /*!< ABRT_10ADDR1_NOACK (Bitfield-Mask: 0x01) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_7B_ADDR_NOACK_Pos (0UL) /*!< ABRT_7B_ADDR_NOACK (Bit 0) */
-#define I2C2_I2C2_TX_ABRT_SOURCE_REG_ABRT_7B_ADDR_NOACK_Msk (0x1UL) /*!< ABRT_7B_ADDR_NOACK (Bitfield-Mask: 0x01) */
-/* ==================================================== I2C2_TX_TL_REG ===================================================== */
-#define I2C2_I2C2_TX_TL_REG_TX_TL_Pos (0UL) /*!< TX_TL (Bit 0) */
-#define I2C2_I2C2_TX_TL_REG_TX_TL_Msk (0x1fUL) /*!< TX_TL (Bitfield-Mask: 0x1f) */
-
-
-/* =========================================================================================================================== */
-/* ================ LCDC ================ */
-/* =========================================================================================================================== */
-
-/* ================================================= LCDC_BACKPORCHXY_REG ================================================== */
-#define LCDC_LCDC_BACKPORCHXY_REG_LCDC_BPORCH_X_Pos (16UL) /*!< LCDC_BPORCH_X (Bit 16) */
-#define LCDC_LCDC_BACKPORCHXY_REG_LCDC_BPORCH_X_Msk (0xffff0000UL) /*!< LCDC_BPORCH_X (Bitfield-Mask: 0xffff) */
-#define LCDC_LCDC_BACKPORCHXY_REG_LCDC_BPORCH_Y_Pos (0UL) /*!< LCDC_BPORCH_Y (Bit 0) */
-#define LCDC_LCDC_BACKPORCHXY_REG_LCDC_BPORCH_Y_Msk (0xffffUL) /*!< LCDC_BPORCH_Y (Bitfield-Mask: 0xffff) */
-/* =================================================== LCDC_BGCOLOR_REG ==================================================== */
-#define LCDC_LCDC_BGCOLOR_REG_LCDC_BG_RED_Pos (24UL) /*!< LCDC_BG_RED (Bit 24) */
-#define LCDC_LCDC_BGCOLOR_REG_LCDC_BG_RED_Msk (0xff000000UL) /*!< LCDC_BG_RED (Bitfield-Mask: 0xff) */
-#define LCDC_LCDC_BGCOLOR_REG_LCDC_BG_GREEN_Pos (16UL) /*!< LCDC_BG_GREEN (Bit 16) */
-#define LCDC_LCDC_BGCOLOR_REG_LCDC_BG_GREEN_Msk (0xff0000UL) /*!< LCDC_BG_GREEN (Bitfield-Mask: 0xff) */
-#define LCDC_LCDC_BGCOLOR_REG_LCDC_BG_BLUE_Pos (8UL) /*!< LCDC_BG_BLUE (Bit 8) */
-#define LCDC_LCDC_BGCOLOR_REG_LCDC_BG_BLUE_Msk (0xff00UL) /*!< LCDC_BG_BLUE (Bitfield-Mask: 0xff) */
-#define LCDC_LCDC_BGCOLOR_REG_LCDC_BG_ALPHA_Pos (0UL) /*!< LCDC_BG_ALPHA (Bit 0) */
-#define LCDC_LCDC_BGCOLOR_REG_LCDC_BG_ALPHA_Msk (0xffUL) /*!< LCDC_BG_ALPHA (Bitfield-Mask: 0xff) */
-/* ================================================== LCDC_BLANKINGXY_REG ================================================== */
-#define LCDC_LCDC_BLANKINGXY_REG_LCDC_BLANKING_X_Pos (16UL) /*!< LCDC_BLANKING_X (Bit 16) */
-#define LCDC_LCDC_BLANKINGXY_REG_LCDC_BLANKING_X_Msk (0xffff0000UL) /*!< LCDC_BLANKING_X (Bitfield-Mask: 0xffff) */
-#define LCDC_LCDC_BLANKINGXY_REG_LCDC_BLANKING_Y_Pos (0UL) /*!< LCDC_BLANKING_Y (Bit 0) */
-#define LCDC_LCDC_BLANKINGXY_REG_LCDC_BLANKING_Y_Msk (0xffffUL) /*!< LCDC_BLANKING_Y (Bitfield-Mask: 0xffff) */
-/* =================================================== LCDC_CLKCTRL_REG ==================================================== */
-#define LCDC_LCDC_CLKCTRL_REG_LCDC_SEC_CLK_DIV_Pos (27UL) /*!< LCDC_SEC_CLK_DIV (Bit 27) */
-#define LCDC_LCDC_CLKCTRL_REG_LCDC_SEC_CLK_DIV_Msk (0xf8000000UL) /*!< LCDC_SEC_CLK_DIV (Bitfield-Mask: 0x1f) */
-#define LCDC_LCDC_CLKCTRL_REG_LCDC_DMA_HOLD_Pos (8UL) /*!< LCDC_DMA_HOLD (Bit 8) */
-#define LCDC_LCDC_CLKCTRL_REG_LCDC_DMA_HOLD_Msk (0x3f00UL) /*!< LCDC_DMA_HOLD (Bitfield-Mask: 0x3f) */
-#define LCDC_LCDC_CLKCTRL_REG_LCDC_CLK_DIV_Pos (0UL) /*!< LCDC_CLK_DIV (Bit 0) */
-#define LCDC_LCDC_CLKCTRL_REG_LCDC_CLK_DIV_Msk (0x3fUL) /*!< LCDC_CLK_DIV (Bitfield-Mask: 0x3f) */
-/* ===================================================== LCDC_CRC_REG ====================================================== */
-#define LCDC_LCDC_CRC_REG_LCDC_CRC_Pos (0UL) /*!< LCDC_CRC (Bit 0) */
-#define LCDC_LCDC_CRC_REG_LCDC_CRC_Msk (0xffffffffUL) /*!< LCDC_CRC (Bitfield-Mask: 0xffffffff) */
-/* =================================================== LCDC_DBIB_CFG_REG =================================================== */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_TE_DIS_Pos (31UL) /*!< LCDC_DBIB_TE_DIS (Bit 31) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_TE_DIS_Msk (0x80000000UL) /*!< LCDC_DBIB_TE_DIS (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_CSX_FORCE_Pos (30UL) /*!< LCDC_DBIB_CSX_FORCE (Bit 30) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_CSX_FORCE_Msk (0x40000000UL) /*!< LCDC_DBIB_CSX_FORCE (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_CSX_FORCE_VAL_Pos (29UL) /*!< LCDC_DBIB_CSX_FORCE_VAL (Bit 29) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_CSX_FORCE_VAL_Msk (0x20000000UL) /*!< LCDC_DBIB_CSX_FORCE_VAL (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI_PAD_Pos (28UL) /*!< LCDC_DBIB_SPI_PAD (Bit 28) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI_PAD_Msk (0x10000000UL) /*!< LCDC_DBIB_SPI_PAD (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_RESX_Pos (25UL) /*!< LCDC_DBIB_RESX (Bit 25) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_RESX_Msk (0x2000000UL) /*!< LCDC_DBIB_RESX (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_DMA_EN_Pos (24UL) /*!< LCDC_DBIB_DMA_EN (Bit 24) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_DMA_EN_Msk (0x1000000UL) /*!< LCDC_DBIB_DMA_EN (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI3_EN_Pos (23UL) /*!< LCDC_DBIB_SPI3_EN (Bit 23) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI3_EN_Msk (0x800000UL) /*!< LCDC_DBIB_SPI3_EN (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI4_EN_Pos (22UL) /*!< LCDC_DBIB_SPI4_EN (Bit 22) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI4_EN_Msk (0x400000UL) /*!< LCDC_DBIB_SPI4_EN (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI_CPHA_Pos (20UL) /*!< LCDC_DBIB_SPI_CPHA (Bit 20) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI_CPHA_Msk (0x100000UL) /*!< LCDC_DBIB_SPI_CPHA (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI_CPOL_Pos (19UL) /*!< LCDC_DBIB_SPI_CPOL (Bit 19) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI_CPOL_Msk (0x80000UL) /*!< LCDC_DBIB_SPI_CPOL (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI_JDI_Pos (18UL) /*!< LCDC_DBIB_SPI_JDI (Bit 18) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI_JDI_Msk (0x40000UL) /*!< LCDC_DBIB_SPI_JDI (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI_HOLD_Pos (17UL) /*!< LCDC_DBIB_SPI_HOLD (Bit 17) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI_HOLD_Msk (0x20000UL) /*!< LCDC_DBIB_SPI_HOLD (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI_INV_ADDR_Pos (16UL) /*!< LCDC_DBIB_SPI_INV_ADDR (Bit 16) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_SPI_INV_ADDR_Msk (0x10000UL) /*!< LCDC_DBIB_SPI_INV_ADDR (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_INV_DATA_Pos (15UL) /*!< LCDC_DBIB_INV_DATA (Bit 15) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_INV_DATA_Msk (0x8000UL) /*!< LCDC_DBIB_INV_DATA (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_JDI_INV_PIX_Pos (14UL) /*!< LCDC_DBIB_JDI_INV_PIX (Bit 14) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_JDI_INV_PIX_Msk (0x4000UL) /*!< LCDC_DBIB_JDI_INV_PIX (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_JDI_SOFT_RST_Pos (13UL) /*!< LCDC_DBIB_JDI_SOFT_RST (Bit 13) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_JDI_SOFT_RST_Msk (0x2000UL) /*!< LCDC_DBIB_JDI_SOFT_RST (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_FMT_Pos (0UL) /*!< LCDC_DBIB_FMT (Bit 0) */
-#define LCDC_LCDC_DBIB_CFG_REG_LCDC_DBIB_FMT_Msk (0x1fUL) /*!< LCDC_DBIB_FMT (Bitfield-Mask: 0x1f) */
-/* =================================================== LCDC_DBIB_CMD_REG =================================================== */
-#define LCDC_LCDC_DBIB_CMD_REG_LCDC_DBIB_CMD_SEND_Pos (30UL) /*!< LCDC_DBIB_CMD_SEND (Bit 30) */
-#define LCDC_LCDC_DBIB_CMD_REG_LCDC_DBIB_CMD_SEND_Msk (0x40000000UL) /*!< LCDC_DBIB_CMD_SEND (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CMD_REG_LCDC_DBIB_CMD_STORE_Pos (27UL) /*!< LCDC_DBIB_CMD_STORE (Bit 27) */
-#define LCDC_LCDC_DBIB_CMD_REG_LCDC_DBIB_CMD_STORE_Msk (0x8000000UL) /*!< LCDC_DBIB_CMD_STORE (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_DBIB_CMD_REG_LCDC_DBIB_CMD_VAL_Pos (0UL) /*!< LCDC_DBIB_CMD_VAL (Bit 0) */
-#define LCDC_LCDC_DBIB_CMD_REG_LCDC_DBIB_CMD_VAL_Msk (0xffffUL) /*!< LCDC_DBIB_CMD_VAL (Bitfield-Mask: 0xffff) */
-/* ================================================= LCDC_FRONTPORCHXY_REG ================================================= */
-#define LCDC_LCDC_FRONTPORCHXY_REG_LCDC_FPORCH_X_Pos (16UL) /*!< LCDC_FPORCH_X (Bit 16) */
-#define LCDC_LCDC_FRONTPORCHXY_REG_LCDC_FPORCH_X_Msk (0xffff0000UL) /*!< LCDC_FPORCH_X (Bitfield-Mask: 0xffff) */
-#define LCDC_LCDC_FRONTPORCHXY_REG_LCDC_FPORCH_Y_Pos (0UL) /*!< LCDC_FPORCH_Y (Bit 0) */
-#define LCDC_LCDC_FRONTPORCHXY_REG_LCDC_FPORCH_Y_Msk (0xffffUL) /*!< LCDC_FPORCH_Y (Bitfield-Mask: 0xffff) */
-/* ===================================================== LCDC_GPIO_REG ===================================================== */
-#define LCDC_LCDC_GPIO_REG_LCDC_TE_INV_Pos (1UL) /*!< LCDC_TE_INV (Bit 1) */
-#define LCDC_LCDC_GPIO_REG_LCDC_TE_INV_Msk (0x2UL) /*!< LCDC_TE_INV (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_GPIO_REG_LCDC_PARIF_SEL_Pos (0UL) /*!< LCDC_PARIF_SEL (Bit 0) */
-#define LCDC_LCDC_GPIO_REG_LCDC_PARIF_SEL_Msk (0x1UL) /*!< LCDC_PARIF_SEL (Bitfield-Mask: 0x01) */
-/* ==================================================== LCDC_IDREG_REG ===================================================== */
-#define LCDC_LCDC_IDREG_REG_LCDC_ID_Pos (0UL) /*!< LCDC_ID (Bit 0) */
-#define LCDC_LCDC_IDREG_REG_LCDC_ID_Msk (0xffffffffUL) /*!< LCDC_ID (Bitfield-Mask: 0xffffffff) */
-/* ================================================== LCDC_INTERRUPT_REG =================================================== */
-#define LCDC_LCDC_INTERRUPT_REG_LCDC_IRQ_TRIGGER_SEL_Pos (31UL) /*!< LCDC_IRQ_TRIGGER_SEL (Bit 31) */
-#define LCDC_LCDC_INTERRUPT_REG_LCDC_IRQ_TRIGGER_SEL_Msk (0x80000000UL) /*!< LCDC_IRQ_TRIGGER_SEL (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_INTERRUPT_REG_LCDC_FRAME_END_IRQ_EN_Pos (5UL) /*!< LCDC_FRAME_END_IRQ_EN (Bit 5) */
-#define LCDC_LCDC_INTERRUPT_REG_LCDC_FRAME_END_IRQ_EN_Msk (0x20UL) /*!< LCDC_FRAME_END_IRQ_EN (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_INTERRUPT_REG_LCDC_TE_IRQ_EN_Pos (3UL) /*!< LCDC_TE_IRQ_EN (Bit 3) */
-#define LCDC_LCDC_INTERRUPT_REG_LCDC_TE_IRQ_EN_Msk (0x8UL) /*!< LCDC_TE_IRQ_EN (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_INTERRUPT_REG_LCDC_HSYNC_IRQ_EN_Pos (1UL) /*!< LCDC_HSYNC_IRQ_EN (Bit 1) */
-#define LCDC_LCDC_INTERRUPT_REG_LCDC_HSYNC_IRQ_EN_Msk (0x2UL) /*!< LCDC_HSYNC_IRQ_EN (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_INTERRUPT_REG_LCDC_VSYNC_IRQ_EN_Pos (0UL) /*!< LCDC_VSYNC_IRQ_EN (Bit 0) */
-#define LCDC_LCDC_INTERRUPT_REG_LCDC_VSYNC_IRQ_EN_Msk (0x1UL) /*!< LCDC_VSYNC_IRQ_EN (Bitfield-Mask: 0x01) */
-/* ============================================== LCDC_JDI_ENB_END_HLINE_REG =============================================== */
-#define LCDC_LCDC_JDI_ENB_END_HLINE_REG_LCDC_JDI_ENB_END_HLINE_Pos (0UL) /*!< LCDC_JDI_ENB_END_HLINE (Bit 0) */
-#define LCDC_LCDC_JDI_ENB_END_HLINE_REG_LCDC_JDI_ENB_END_HLINE_Msk (0xffffffffUL) /*!< LCDC_JDI_ENB_END_HLINE (Bitfield-Mask: 0xffffffff) */
-/* ============================================== LCDC_JDI_ENB_START_CLK_REG =============================================== */
-#define LCDC_LCDC_JDI_ENB_START_CLK_REG_LCDC_JDI_ENB_START_CLK_Pos (0UL) /*!< LCDC_JDI_ENB_START_CLK (Bit 0) */
-#define LCDC_LCDC_JDI_ENB_START_CLK_REG_LCDC_JDI_ENB_START_CLK_Msk (0xffffffffUL) /*!< LCDC_JDI_ENB_START_CLK (Bitfield-Mask: 0xffffffff) */
-/* ============================================= LCDC_JDI_ENB_START_HLINE_REG ============================================== */
-#define LCDC_LCDC_JDI_ENB_START_HLINE_REG_LCDC_JDI_ENB_START_HLINE_Pos (0UL) /*!< LCDC_JDI_ENB_START_HLINE (Bit 0) */
-#define LCDC_LCDC_JDI_ENB_START_HLINE_REG_LCDC_JDI_ENB_START_HLINE_Msk (0xffffffffUL) /*!< LCDC_JDI_ENB_START_HLINE (Bitfield-Mask: 0xffffffff) */
-/* ============================================== LCDC_JDI_ENB_WIDTH_CLK_REG =============================================== */
-#define LCDC_LCDC_JDI_ENB_WIDTH_CLK_REG_LCDC_JDI_ENB_WIDTH_CLK_Pos (0UL) /*!< LCDC_JDI_ENB_WIDTH_CLK (Bit 0) */
-#define LCDC_LCDC_JDI_ENB_WIDTH_CLK_REG_LCDC_JDI_ENB_WIDTH_CLK_Msk (0xffffffffUL) /*!< LCDC_JDI_ENB_WIDTH_CLK (Bitfield-Mask: 0xffffffff) */
-/* =============================================== LCDC_JDI_FBX_BLANKING_REG =============================================== */
-#define LCDC_LCDC_JDI_FBX_BLANKING_REG_LCDC_JDI_FXBLANKING_Pos (16UL) /*!< LCDC_JDI_FXBLANKING (Bit 16) */
-#define LCDC_LCDC_JDI_FBX_BLANKING_REG_LCDC_JDI_FXBLANKING_Msk (0xffff0000UL) /*!< LCDC_JDI_FXBLANKING (Bitfield-Mask: 0xffff) */
-#define LCDC_LCDC_JDI_FBX_BLANKING_REG_LCDC_JDI_BXBLANKING_Pos (0UL) /*!< LCDC_JDI_BXBLANKING (Bit 0) */
-#define LCDC_LCDC_JDI_FBX_BLANKING_REG_LCDC_JDI_BXBLANKING_Msk (0xffffUL) /*!< LCDC_JDI_BXBLANKING (Bitfield-Mask: 0xffff) */
-/* =============================================== LCDC_JDI_FBY_BLANKING_REG =============================================== */
-#define LCDC_LCDC_JDI_FBY_BLANKING_REG_LCDC_JDI_FYBLANKING_Pos (16UL) /*!< LCDC_JDI_FYBLANKING (Bit 16) */
-#define LCDC_LCDC_JDI_FBY_BLANKING_REG_LCDC_JDI_FYBLANKING_Msk (0xffff0000UL) /*!< LCDC_JDI_FYBLANKING (Bitfield-Mask: 0xffff) */
-#define LCDC_LCDC_JDI_FBY_BLANKING_REG_LCDC_JDI_BYBLANKING_Pos (0UL) /*!< LCDC_JDI_BYBLANKING (Bit 0) */
-#define LCDC_LCDC_JDI_FBY_BLANKING_REG_LCDC_JDI_BYBLANKING_Msk (0xffffUL) /*!< LCDC_JDI_BYBLANKING (Bitfield-Mask: 0xffff) */
-/* ================================================ LCDC_JDI_HCK_WIDTH_REG ================================================= */
-#define LCDC_LCDC_JDI_HCK_WIDTH_REG_LCDC_JDI_HCK_WIDTH_Pos (0UL) /*!< LCDC_JDI_HCK_WIDTH (Bit 0) */
-#define LCDC_LCDC_JDI_HCK_WIDTH_REG_LCDC_JDI_HCK_WIDTH_Msk (0xffffffffUL) /*!< LCDC_JDI_HCK_WIDTH (Bitfield-Mask: 0xffffffff) */
-/* ================================================ LCDC_JDI_HST_DELAY_REG ================================================= */
-#define LCDC_LCDC_JDI_HST_DELAY_REG_LCDC_JDI_HST_DELAY_Pos (0UL) /*!< LCDC_JDI_HST_DELAY (Bit 0) */
-#define LCDC_LCDC_JDI_HST_DELAY_REG_LCDC_JDI_HST_DELAY_Msk (0xffffffffUL) /*!< LCDC_JDI_HST_DELAY (Bitfield-Mask: 0xffffffff) */
-/* ================================================ LCDC_JDI_HST_WIDTH_REG ================================================= */
-#define LCDC_LCDC_JDI_HST_WIDTH_REG_LCDC_JDI_HST_WIDTH_Pos (0UL) /*!< LCDC_JDI_HST_WIDTH (Bit 0) */
-#define LCDC_LCDC_JDI_HST_WIDTH_REG_LCDC_JDI_HST_WIDTH_Msk (0xffffffffUL) /*!< LCDC_JDI_HST_WIDTH (Bitfield-Mask: 0xffffffff) */
-/* ================================================== LCDC_JDI_RESXY_REG =================================================== */
-#define LCDC_LCDC_JDI_RESXY_REG_LCDC_JDI_RES_X_Pos (16UL) /*!< LCDC_JDI_RES_X (Bit 16) */
-#define LCDC_LCDC_JDI_RESXY_REG_LCDC_JDI_RES_X_Msk (0xffff0000UL) /*!< LCDC_JDI_RES_X (Bitfield-Mask: 0xffff) */
-#define LCDC_LCDC_JDI_RESXY_REG_LCDC_JDI_RES_Y_Pos (0UL) /*!< LCDC_JDI_RES_Y (Bit 0) */
-#define LCDC_LCDC_JDI_RESXY_REG_LCDC_JDI_RES_Y_Msk (0xffffUL) /*!< LCDC_JDI_RES_Y (Bitfield-Mask: 0xffff) */
-/* ================================================ LCDC_JDI_VCK_DELAY_REG ================================================= */
-#define LCDC_LCDC_JDI_VCK_DELAY_REG_LCDC_JDI_VCK_DELAY_Pos (0UL) /*!< LCDC_JDI_VCK_DELAY (Bit 0) */
-#define LCDC_LCDC_JDI_VCK_DELAY_REG_LCDC_JDI_VCK_DELAY_Msk (0xffffffffUL) /*!< LCDC_JDI_VCK_DELAY (Bitfield-Mask: 0xffffffff) */
-/* ================================================ LCDC_JDI_VST_DELAY_REG ================================================= */
-#define LCDC_LCDC_JDI_VST_DELAY_REG_LCDC_JDI_VST_DELAY_Pos (0UL) /*!< LCDC_JDI_VST_DELAY (Bit 0) */
-#define LCDC_LCDC_JDI_VST_DELAY_REG_LCDC_JDI_VST_DELAY_Msk (0xffffffffUL) /*!< LCDC_JDI_VST_DELAY (Bitfield-Mask: 0xffffffff) */
-/* ================================================ LCDC_JDI_VST_WIDTH_REG ================================================= */
-#define LCDC_LCDC_JDI_VST_WIDTH_REG_LCDC_JDI_VST_WIDTH_Pos (0UL) /*!< LCDC_JDI_VST_WIDTH (Bit 0) */
-#define LCDC_LCDC_JDI_VST_WIDTH_REG_LCDC_JDI_VST_WIDTH_Msk (0xffffffffUL) /*!< LCDC_JDI_VST_WIDTH (Bitfield-Mask: 0xffffffff) */
-/* ================================================ LCDC_JDI_XRST_WIDTH_REG ================================================ */
-#define LCDC_LCDC_JDI_XRST_WIDTH_REG_LCDC_JDI_XRST_WIDTH_Pos (0UL) /*!< LCDC_JDI_XRST_WIDTH (Bit 0) */
-#define LCDC_LCDC_JDI_XRST_WIDTH_REG_LCDC_JDI_XRST_WIDTH_Msk (0xffffffffUL) /*!< LCDC_JDI_XRST_WIDTH (Bitfield-Mask: 0xffffffff) */
-/* =============================================== LCDC_LAYER0_BASEADDR_REG ================================================ */
-#define LCDC_LCDC_LAYER0_BASEADDR_REG_LCDC_L0_FB_ADDR_Pos (0UL) /*!< LCDC_L0_FB_ADDR (Bit 0) */
-#define LCDC_LCDC_LAYER0_BASEADDR_REG_LCDC_L0_FB_ADDR_Msk (0xffffffffUL) /*!< LCDC_L0_FB_ADDR (Bitfield-Mask: 0xffffffff) */
-/* ================================================= LCDC_LAYER0_MODE_REG ================================================== */
-#define LCDC_LCDC_LAYER0_MODE_REG_LCDC_L0_EN_Pos (31UL) /*!< LCDC_L0_EN (Bit 31) */
-#define LCDC_LCDC_LAYER0_MODE_REG_LCDC_L0_EN_Msk (0x80000000UL) /*!< LCDC_L0_EN (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_LAYER0_MODE_REG_LCDC_L0_COLOUR_MODE_Pos (0UL) /*!< LCDC_L0_COLOUR_MODE (Bit 0) */
-#define LCDC_LCDC_LAYER0_MODE_REG_LCDC_L0_COLOUR_MODE_Msk (0x1fUL) /*!< LCDC_L0_COLOUR_MODE (Bitfield-Mask: 0x1f) */
-/* ================================================ LCDC_LAYER0_OFFSETX_REG ================================================ */
-#define LCDC_LCDC_LAYER0_OFFSETX_REG_LCDC_L0_DMA_PREFETCH_Pos (16UL) /*!< LCDC_L0_DMA_PREFETCH (Bit 16) */
-#define LCDC_LCDC_LAYER0_OFFSETX_REG_LCDC_L0_DMA_PREFETCH_Msk (0xffff0000UL) /*!< LCDC_L0_DMA_PREFETCH (Bitfield-Mask: 0xffff) */
-#define LCDC_LCDC_LAYER0_OFFSETX_REG_LCDC_L0_OFFSETX_Pos (0UL) /*!< LCDC_L0_OFFSETX (Bit 0) */
-#define LCDC_LCDC_LAYER0_OFFSETX_REG_LCDC_L0_OFFSETX_Msk (0xffffUL) /*!< LCDC_L0_OFFSETX (Bitfield-Mask: 0xffff) */
-/* ================================================= LCDC_LAYER0_RESXY_REG ================================================= */
-#define LCDC_LCDC_LAYER0_RESXY_REG_LCDC_L0_RES_X_Pos (16UL) /*!< LCDC_L0_RES_X (Bit 16) */
-#define LCDC_LCDC_LAYER0_RESXY_REG_LCDC_L0_RES_X_Msk (0xffff0000UL) /*!< LCDC_L0_RES_X (Bitfield-Mask: 0xffff) */
-#define LCDC_LCDC_LAYER0_RESXY_REG_LCDC_L0_RES_Y_Pos (0UL) /*!< LCDC_L0_RES_Y (Bit 0) */
-#define LCDC_LCDC_LAYER0_RESXY_REG_LCDC_L0_RES_Y_Msk (0xffffUL) /*!< LCDC_L0_RES_Y (Bitfield-Mask: 0xffff) */
-/* ================================================ LCDC_LAYER0_SIZEXY_REG ================================================= */
-#define LCDC_LCDC_LAYER0_SIZEXY_REG_LCDC_L0_SIZE_X_Pos (16UL) /*!< LCDC_L0_SIZE_X (Bit 16) */
-#define LCDC_LCDC_LAYER0_SIZEXY_REG_LCDC_L0_SIZE_X_Msk (0xffff0000UL) /*!< LCDC_L0_SIZE_X (Bitfield-Mask: 0xffff) */
-#define LCDC_LCDC_LAYER0_SIZEXY_REG_LCDC_L0_SIZE_Y_Pos (0UL) /*!< LCDC_L0_SIZE_Y (Bit 0) */
-#define LCDC_LCDC_LAYER0_SIZEXY_REG_LCDC_L0_SIZE_Y_Msk (0xffffUL) /*!< LCDC_L0_SIZE_Y (Bitfield-Mask: 0xffff) */
-/* ================================================ LCDC_LAYER0_STARTXY_REG ================================================ */
-#define LCDC_LCDC_LAYER0_STARTXY_REG_LCDC_L0_START_X_Pos (16UL) /*!< LCDC_L0_START_X (Bit 16) */
-#define LCDC_LCDC_LAYER0_STARTXY_REG_LCDC_L0_START_X_Msk (0xffff0000UL) /*!< LCDC_L0_START_X (Bitfield-Mask: 0xffff) */
-#define LCDC_LCDC_LAYER0_STARTXY_REG_LCDC_L0_START_Y_Pos (0UL) /*!< LCDC_L0_START_Y (Bit 0) */
-#define LCDC_LCDC_LAYER0_STARTXY_REG_LCDC_L0_START_Y_Msk (0xffffUL) /*!< LCDC_L0_START_Y (Bitfield-Mask: 0xffff) */
-/* ================================================ LCDC_LAYER0_STRIDE_REG ================================================= */
-#define LCDC_LCDC_LAYER0_STRIDE_REG_LCDC_L0_FIFO_THR_Pos (19UL) /*!< LCDC_L0_FIFO_THR (Bit 19) */
-#define LCDC_LCDC_LAYER0_STRIDE_REG_LCDC_L0_FIFO_THR_Msk (0x180000UL) /*!< LCDC_L0_FIFO_THR (Bitfield-Mask: 0x03) */
-#define LCDC_LCDC_LAYER0_STRIDE_REG_LCDC_L0_BURST_LEN_Pos (16UL) /*!< LCDC_L0_BURST_LEN (Bit 16) */
-#define LCDC_LCDC_LAYER0_STRIDE_REG_LCDC_L0_BURST_LEN_Msk (0x70000UL) /*!< LCDC_L0_BURST_LEN (Bitfield-Mask: 0x07) */
-#define LCDC_LCDC_LAYER0_STRIDE_REG_LCDC_L0_STRIDE_Pos (0UL) /*!< LCDC_L0_STRIDE (Bit 0) */
-#define LCDC_LCDC_LAYER0_STRIDE_REG_LCDC_L0_STRIDE_Msk (0xffffUL) /*!< LCDC_L0_STRIDE (Bitfield-Mask: 0xffff) */
-/* ===================================================== LCDC_MODE_REG ===================================================== */
-#define LCDC_LCDC_MODE_REG_LCDC_MODE_EN_Pos (31UL) /*!< LCDC_MODE_EN (Bit 31) */
-#define LCDC_LCDC_MODE_REG_LCDC_MODE_EN_Msk (0x80000000UL) /*!< LCDC_MODE_EN (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_MODE_REG_LCDC_VSYNC_POL_Pos (28UL) /*!< LCDC_VSYNC_POL (Bit 28) */
-#define LCDC_LCDC_MODE_REG_LCDC_VSYNC_POL_Msk (0x10000000UL) /*!< LCDC_VSYNC_POL (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_MODE_REG_LCDC_HSYNC_POL_Pos (27UL) /*!< LCDC_HSYNC_POL (Bit 27) */
-#define LCDC_LCDC_MODE_REG_LCDC_HSYNC_POL_Msk (0x8000000UL) /*!< LCDC_HSYNC_POL (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_MODE_REG_LCDC_DE_POL_Pos (26UL) /*!< LCDC_DE_POL (Bit 26) */
-#define LCDC_LCDC_MODE_REG_LCDC_DE_POL_Msk (0x4000000UL) /*!< LCDC_DE_POL (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_MODE_REG_LCDC_VSYNC_SCPL_Pos (23UL) /*!< LCDC_VSYNC_SCPL (Bit 23) */
-#define LCDC_LCDC_MODE_REG_LCDC_VSYNC_SCPL_Msk (0x800000UL) /*!< LCDC_VSYNC_SCPL (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_MODE_REG_LCDC_PIXCLKOUT_POL_Pos (22UL) /*!< LCDC_PIXCLKOUT_POL (Bit 22) */
-#define LCDC_LCDC_MODE_REG_LCDC_PIXCLKOUT_POL_Msk (0x400000UL) /*!< LCDC_PIXCLKOUT_POL (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_MODE_REG_LCDC_FORCE_BLANK_Pos (19UL) /*!< LCDC_FORCE_BLANK (Bit 19) */
-#define LCDC_LCDC_MODE_REG_LCDC_FORCE_BLANK_Msk (0x80000UL) /*!< LCDC_FORCE_BLANK (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_MODE_REG_LCDC_SFRAME_UPD_Pos (17UL) /*!< LCDC_SFRAME_UPD (Bit 17) */
-#define LCDC_LCDC_MODE_REG_LCDC_SFRAME_UPD_Msk (0x20000UL) /*!< LCDC_SFRAME_UPD (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_MODE_REG_LCDC_PIXCLKOUT_SEL_Pos (11UL) /*!< LCDC_PIXCLKOUT_SEL (Bit 11) */
-#define LCDC_LCDC_MODE_REG_LCDC_PIXCLKOUT_SEL_Msk (0x800UL) /*!< LCDC_PIXCLKOUT_SEL (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_MODE_REG_LCDC_OUT_MODE_Pos (5UL) /*!< LCDC_OUT_MODE (Bit 5) */
-#define LCDC_LCDC_MODE_REG_LCDC_OUT_MODE_Msk (0x1e0UL) /*!< LCDC_OUT_MODE (Bitfield-Mask: 0x0f) */
-#define LCDC_LCDC_MODE_REG_LCDC_MIPI_OFF_Pos (4UL) /*!< LCDC_MIPI_OFF (Bit 4) */
-#define LCDC_LCDC_MODE_REG_LCDC_MIPI_OFF_Msk (0x10UL) /*!< LCDC_MIPI_OFF (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_MODE_REG_LCDC_FORM_OFF_Pos (3UL) /*!< LCDC_FORM_OFF (Bit 3) */
-#define LCDC_LCDC_MODE_REG_LCDC_FORM_OFF_Msk (0x8UL) /*!< LCDC_FORM_OFF (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_MODE_REG_LCDC_DSCAN_Pos (1UL) /*!< LCDC_DSCAN (Bit 1) */
-#define LCDC_LCDC_MODE_REG_LCDC_DSCAN_Msk (0x2UL) /*!< LCDC_DSCAN (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_MODE_REG_LCDC_TMODE_Pos (0UL) /*!< LCDC_TMODE (Bit 0) */
-#define LCDC_LCDC_MODE_REG_LCDC_TMODE_Msk (0x1UL) /*!< LCDC_TMODE (Bitfield-Mask: 0x01) */
-/* ==================================================== LCDC_RESXY_REG ===================================================== */
-#define LCDC_LCDC_RESXY_REG_LCDC_RES_X_Pos (16UL) /*!< LCDC_RES_X (Bit 16) */
-#define LCDC_LCDC_RESXY_REG_LCDC_RES_X_Msk (0xffff0000UL) /*!< LCDC_RES_X (Bitfield-Mask: 0xffff) */
-#define LCDC_LCDC_RESXY_REG_LCDC_RES_Y_Pos (0UL) /*!< LCDC_RES_Y (Bit 0) */
-#define LCDC_LCDC_RESXY_REG_LCDC_RES_Y_Msk (0xffffUL) /*!< LCDC_RES_Y (Bitfield-Mask: 0xffff) */
-/* ==================================================== LCDC_STATUS_REG ==================================================== */
-#define LCDC_LCDC_STATUS_REG_LCDC_JDI_TIM_SW_RST_Pos (15UL) /*!< LCDC_JDI_TIM_SW_RST (Bit 15) */
-#define LCDC_LCDC_STATUS_REG_LCDC_JDI_TIM_SW_RST_Msk (0x8000UL) /*!< LCDC_JDI_TIM_SW_RST (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_FRAME_START_Pos (14UL) /*!< LCDC_FRAME_START (Bit 14) */
-#define LCDC_LCDC_STATUS_REG_LCDC_FRAME_START_Msk (0x4000UL) /*!< LCDC_FRAME_START (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_FRAME_END_Pos (13UL) /*!< LCDC_FRAME_END (Bit 13) */
-#define LCDC_LCDC_STATUS_REG_LCDC_FRAME_END_Msk (0x2000UL) /*!< LCDC_FRAME_END (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_DBIB_CMD_PENDING_Pos (12UL) /*!< LCDC_DBIB_CMD_PENDING (Bit 12) */
-#define LCDC_LCDC_STATUS_REG_LCDC_DBIB_CMD_PENDING_Msk (0x1000UL) /*!< LCDC_DBIB_CMD_PENDING (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_DBIB_CMD_FIFO_FULL_Pos (11UL) /*!< LCDC_DBIB_CMD_FIFO_FULL (Bit 11) */
-#define LCDC_LCDC_STATUS_REG_LCDC_DBIB_CMD_FIFO_FULL_Msk (0x800UL) /*!< LCDC_DBIB_CMD_FIFO_FULL (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_DBIB_CMD_FIFO_EMPTY_N_Pos (10UL) /*!< LCDC_DBIB_CMD_FIFO_EMPTY_N (Bit 10) */
-#define LCDC_LCDC_STATUS_REG_LCDC_DBIB_CMD_FIFO_EMPTY_N_Msk (0x400UL) /*!< LCDC_DBIB_CMD_FIFO_EMPTY_N (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_DBIB_TE_Pos (8UL) /*!< LCDC_DBIB_TE (Bit 8) */
-#define LCDC_LCDC_STATUS_REG_LCDC_DBIB_TE_Msk (0x100UL) /*!< LCDC_DBIB_TE (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_STICKY_UNDERFLOW_Pos (7UL) /*!< LCDC_STICKY_UNDERFLOW (Bit 7) */
-#define LCDC_LCDC_STATUS_REG_LCDC_STICKY_UNDERFLOW_Msk (0x80UL) /*!< LCDC_STICKY_UNDERFLOW (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_UNDERFLOW_Pos (6UL) /*!< LCDC_UNDERFLOW (Bit 6) */
-#define LCDC_LCDC_STATUS_REG_LCDC_UNDERFLOW_Msk (0x40UL) /*!< LCDC_UNDERFLOW (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_LAST_ROW_Pos (5UL) /*!< LCDC_LAST_ROW (Bit 5) */
-#define LCDC_LCDC_STATUS_REG_LCDC_LAST_ROW_Msk (0x20UL) /*!< LCDC_LAST_ROW (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_STAT_CSYNC_Pos (4UL) /*!< LCDC_STAT_CSYNC (Bit 4) */
-#define LCDC_LCDC_STATUS_REG_LCDC_STAT_CSYNC_Msk (0x10UL) /*!< LCDC_STAT_CSYNC (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_STAT_VSYNC_Pos (3UL) /*!< LCDC_STAT_VSYNC (Bit 3) */
-#define LCDC_LCDC_STATUS_REG_LCDC_STAT_VSYNC_Msk (0x8UL) /*!< LCDC_STAT_VSYNC (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_STAT_HSYNC_Pos (2UL) /*!< LCDC_STAT_HSYNC (Bit 2) */
-#define LCDC_LCDC_STATUS_REG_LCDC_STAT_HSYNC_Msk (0x4UL) /*!< LCDC_STAT_HSYNC (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_FRAMEGEN_BUSY_Pos (1UL) /*!< LCDC_FRAMEGEN_BUSY (Bit 1) */
-#define LCDC_LCDC_STATUS_REG_LCDC_FRAMEGEN_BUSY_Msk (0x2UL) /*!< LCDC_FRAMEGEN_BUSY (Bitfield-Mask: 0x01) */
-#define LCDC_LCDC_STATUS_REG_LCDC_STAT_ACTIVE_Pos (0UL) /*!< LCDC_STAT_ACTIVE (Bit 0) */
-#define LCDC_LCDC_STATUS_REG_LCDC_STAT_ACTIVE_Msk (0x1UL) /*!< LCDC_STAT_ACTIVE (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ LRA ================ */
-/* =========================================================================================================================== */
-
-/* =================================================== LRA_ADC_CTRL1_REG =================================================== */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_BUSY_Pos (31UL) /*!< LRA_ADC_BUSY (Bit 31) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_BUSY_Msk (0x80000000UL) /*!< LRA_ADC_BUSY (Bitfield-Mask: 0x01) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_OFFSET_Pos (9UL) /*!< LRA_ADC_OFFSET (Bit 9) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_OFFSET_Msk (0x1fe00UL) /*!< LRA_ADC_OFFSET (Bitfield-Mask: 0xff) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_TEST_PARAM_Pos (8UL) /*!< LRA_ADC_TEST_PARAM (Bit 8) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_TEST_PARAM_Msk (0x100UL) /*!< LRA_ADC_TEST_PARAM (Bitfield-Mask: 0x01) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_TEST_IN_SEL_Pos (7UL) /*!< LRA_ADC_TEST_IN_SEL (Bit 7) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_TEST_IN_SEL_Msk (0x80UL) /*!< LRA_ADC_TEST_IN_SEL (Bitfield-Mask: 0x01) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_FREQ_Pos (3UL) /*!< LRA_ADC_FREQ (Bit 3) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_FREQ_Msk (0x78UL) /*!< LRA_ADC_FREQ (Bitfield-Mask: 0x0f) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_SIGN_Pos (2UL) /*!< LRA_ADC_SIGN (Bit 2) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_SIGN_Msk (0x4UL) /*!< LRA_ADC_SIGN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_MUTE_Pos (1UL) /*!< LRA_ADC_MUTE (Bit 1) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_MUTE_Msk (0x2UL) /*!< LRA_ADC_MUTE (Bitfield-Mask: 0x01) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_START_Pos (0UL) /*!< LRA_ADC_START (Bit 0) */
-#define LRA_LRA_ADC_CTRL1_REG_LRA_ADC_START_Msk (0x1UL) /*!< LRA_ADC_START (Bitfield-Mask: 0x01) */
-/* ================================================== LRA_ADC_RESULT_REG =================================================== */
-#define LRA_LRA_ADC_RESULT_REG_MAN_FLT_IN_Pos (16UL) /*!< MAN_FLT_IN (Bit 16) */
-#define LRA_LRA_ADC_RESULT_REG_MAN_FLT_IN_Msk (0xffff0000UL) /*!< MAN_FLT_IN (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_ADC_RESULT_REG_GP_ADC_VAL_Pos (0UL) /*!< GP_ADC_VAL (Bit 0) */
-#define LRA_LRA_ADC_RESULT_REG_GP_ADC_VAL_Msk (0xffffUL) /*!< GP_ADC_VAL (Bitfield-Mask: 0xffff) */
-/* ==================================================== LRA_BRD_HS_REG ===================================================== */
-#define LRA_LRA_BRD_HS_REG_TRIM_GAIN_Pos (11UL) /*!< TRIM_GAIN (Bit 11) */
-#define LRA_LRA_BRD_HS_REG_TRIM_GAIN_Msk (0x7800UL) /*!< TRIM_GAIN (Bitfield-Mask: 0x0f) */
-#define LRA_LRA_BRD_HS_REG_HSGND_TRIM_Pos (8UL) /*!< HSGND_TRIM (Bit 8) */
-#define LRA_LRA_BRD_HS_REG_HSGND_TRIM_Msk (0x700UL) /*!< HSGND_TRIM (Bitfield-Mask: 0x07) */
-#define LRA_LRA_BRD_HS_REG_SCP_HS_TRIM_Pos (4UL) /*!< SCP_HS_TRIM (Bit 4) */
-#define LRA_LRA_BRD_HS_REG_SCP_HS_TRIM_Msk (0xf0UL) /*!< SCP_HS_TRIM (Bitfield-Mask: 0x0f) */
-#define LRA_LRA_BRD_HS_REG_SCP_HS_EN_Pos (3UL) /*!< SCP_HS_EN (Bit 3) */
-#define LRA_LRA_BRD_HS_REG_SCP_HS_EN_Msk (0x8UL) /*!< SCP_HS_EN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_HS_REG_ERC_HS_TRIM_Pos (1UL) /*!< ERC_HS_TRIM (Bit 1) */
-#define LRA_LRA_BRD_HS_REG_ERC_HS_TRIM_Msk (0x6UL) /*!< ERC_HS_TRIM (Bitfield-Mask: 0x03) */
-#define LRA_LRA_BRD_HS_REG_ERC_HS_EN_Pos (0UL) /*!< ERC_HS_EN (Bit 0) */
-#define LRA_LRA_BRD_HS_REG_ERC_HS_EN_Msk (0x1UL) /*!< ERC_HS_EN (Bitfield-Mask: 0x01) */
-/* ==================================================== LRA_BRD_LS_REG ===================================================== */
-#define LRA_LRA_BRD_LS_REG_SCP_LS_TRIM_N_Pos (8UL) /*!< SCP_LS_TRIM_N (Bit 8) */
-#define LRA_LRA_BRD_LS_REG_SCP_LS_TRIM_N_Msk (0xf00UL) /*!< SCP_LS_TRIM_N (Bitfield-Mask: 0x0f) */
-#define LRA_LRA_BRD_LS_REG_SCP_LS_TRIM_P_Pos (4UL) /*!< SCP_LS_TRIM_P (Bit 4) */
-#define LRA_LRA_BRD_LS_REG_SCP_LS_TRIM_P_Msk (0xf0UL) /*!< SCP_LS_TRIM_P (Bitfield-Mask: 0x0f) */
-#define LRA_LRA_BRD_LS_REG_SCP_LS_EN_Pos (3UL) /*!< SCP_LS_EN (Bit 3) */
-#define LRA_LRA_BRD_LS_REG_SCP_LS_EN_Msk (0x8UL) /*!< SCP_LS_EN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_LS_REG_ERC_LS_TRIM_Pos (1UL) /*!< ERC_LS_TRIM (Bit 1) */
-#define LRA_LRA_BRD_LS_REG_ERC_LS_TRIM_Msk (0x6UL) /*!< ERC_LS_TRIM (Bitfield-Mask: 0x03) */
-#define LRA_LRA_BRD_LS_REG_ERC_LS_EN_Pos (0UL) /*!< ERC_LS_EN (Bit 0) */
-#define LRA_LRA_BRD_LS_REG_ERC_LS_EN_Msk (0x1UL) /*!< ERC_LS_EN (Bitfield-Mask: 0x01) */
-/* =================================================== LRA_BRD_STAT_REG ==================================================== */
-#define LRA_LRA_BRD_STAT_REG_SCP_HS_OUT_Pos (13UL) /*!< SCP_HS_OUT (Bit 13) */
-#define LRA_LRA_BRD_STAT_REG_SCP_HS_OUT_Msk (0x2000UL) /*!< SCP_HS_OUT (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_SCP_LS_COMP_OUT_N_Pos (12UL) /*!< SCP_LS_COMP_OUT_N (Bit 12) */
-#define LRA_LRA_BRD_STAT_REG_SCP_LS_COMP_OUT_N_Msk (0x1000UL) /*!< SCP_LS_COMP_OUT_N (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_SCP_LS_COMP_OUT_P_Pos (11UL) /*!< SCP_LS_COMP_OUT_P (Bit 11) */
-#define LRA_LRA_BRD_STAT_REG_SCP_LS_COMP_OUT_P_Msk (0x800UL) /*!< SCP_LS_COMP_OUT_P (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_SC_EVENT_LS_Pos (10UL) /*!< SC_EVENT_LS (Bit 10) */
-#define LRA_LRA_BRD_STAT_REG_SC_EVENT_LS_Msk (0x400UL) /*!< SC_EVENT_LS (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_SC_EVENT_HS_Pos (9UL) /*!< SC_EVENT_HS (Bit 9) */
-#define LRA_LRA_BRD_STAT_REG_SC_EVENT_HS_Msk (0x200UL) /*!< SC_EVENT_HS (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_LOOP_STAT_Pos (8UL) /*!< LOOP_STAT (Bit 8) */
-#define LRA_LRA_BRD_STAT_REG_LOOP_STAT_Msk (0x100UL) /*!< LOOP_STAT (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_LSN_ON_Pos (7UL) /*!< LSN_ON (Bit 7) */
-#define LRA_LRA_BRD_STAT_REG_LSN_ON_Msk (0x80UL) /*!< LSN_ON (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_LSP_ON_Pos (6UL) /*!< LSP_ON (Bit 6) */
-#define LRA_LRA_BRD_STAT_REG_LSP_ON_Msk (0x40UL) /*!< LSP_ON (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_HSN_ON_Pos (5UL) /*!< HSN_ON (Bit 5) */
-#define LRA_LRA_BRD_STAT_REG_HSN_ON_Msk (0x20UL) /*!< HSN_ON (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_HSP_ON_Pos (4UL) /*!< HSP_ON (Bit 4) */
-#define LRA_LRA_BRD_STAT_REG_HSP_ON_Msk (0x10UL) /*!< HSP_ON (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_LSN_STAT_Pos (3UL) /*!< LSN_STAT (Bit 3) */
-#define LRA_LRA_BRD_STAT_REG_LSN_STAT_Msk (0x8UL) /*!< LSN_STAT (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_LSP_STAT_Pos (2UL) /*!< LSP_STAT (Bit 2) */
-#define LRA_LRA_BRD_STAT_REG_LSP_STAT_Msk (0x4UL) /*!< LSP_STAT (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_HSN_STAT_Pos (1UL) /*!< HSN_STAT (Bit 1) */
-#define LRA_LRA_BRD_STAT_REG_HSN_STAT_Msk (0x2UL) /*!< HSN_STAT (Bitfield-Mask: 0x01) */
-#define LRA_LRA_BRD_STAT_REG_HSP_STAT_Pos (0UL) /*!< HSP_STAT (Bit 0) */
-#define LRA_LRA_BRD_STAT_REG_HSP_STAT_Msk (0x1UL) /*!< HSP_STAT (Bitfield-Mask: 0x01) */
-/* ===================================================== LRA_CTRL1_REG ===================================================== */
-#define LRA_LRA_CTRL1_REG_SMP_IDX_Pos (24UL) /*!< SMP_IDX (Bit 24) */
-#define LRA_LRA_CTRL1_REG_SMP_IDX_Msk (0xf000000UL) /*!< SMP_IDX (Bitfield-Mask: 0x0f) */
-#define LRA_LRA_CTRL1_REG_IRQ_SCP_EVENT_EN_Pos (18UL) /*!< IRQ_SCP_EVENT_EN (Bit 18) */
-#define LRA_LRA_CTRL1_REG_IRQ_SCP_EVENT_EN_Msk (0x40000UL) /*!< IRQ_SCP_EVENT_EN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_CTRL1_REG_IRQ_ADC_EN_Pos (17UL) /*!< IRQ_ADC_EN (Bit 17) */
-#define LRA_LRA_CTRL1_REG_IRQ_ADC_EN_Msk (0x20000UL) /*!< IRQ_ADC_EN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_CTRL1_REG_IRQ_CTRL_EN_Pos (16UL) /*!< IRQ_CTRL_EN (Bit 16) */
-#define LRA_LRA_CTRL1_REG_IRQ_CTRL_EN_Msk (0x10000UL) /*!< IRQ_CTRL_EN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_CTRL1_REG_IRQ_IDX_Pos (12UL) /*!< IRQ_IDX (Bit 12) */
-#define LRA_LRA_CTRL1_REG_IRQ_IDX_Msk (0xf000UL) /*!< IRQ_IDX (Bitfield-Mask: 0x0f) */
-#define LRA_LRA_CTRL1_REG_IRQ_DIV_Pos (8UL) /*!< IRQ_DIV (Bit 8) */
-#define LRA_LRA_CTRL1_REG_IRQ_DIV_Msk (0xf00UL) /*!< IRQ_DIV (Bitfield-Mask: 0x0f) */
-#define LRA_LRA_CTRL1_REG_SMP_SEL_Pos (6UL) /*!< SMP_SEL (Bit 6) */
-#define LRA_LRA_CTRL1_REG_SMP_SEL_Msk (0xc0UL) /*!< SMP_SEL (Bitfield-Mask: 0x03) */
-#define LRA_LRA_CTRL1_REG_PULLDOWN_EN_Pos (5UL) /*!< PULLDOWN_EN (Bit 5) */
-#define LRA_LRA_CTRL1_REG_PULLDOWN_EN_Msk (0x20UL) /*!< PULLDOWN_EN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_CTRL1_REG_LOOP_EN_Pos (4UL) /*!< LOOP_EN (Bit 4) */
-#define LRA_LRA_CTRL1_REG_LOOP_EN_Msk (0x10UL) /*!< LOOP_EN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_CTRL1_REG_LDO_EN_Pos (3UL) /*!< LDO_EN (Bit 3) */
-#define LRA_LRA_CTRL1_REG_LDO_EN_Msk (0x8UL) /*!< LDO_EN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_CTRL1_REG_ADC_EN_Pos (2UL) /*!< ADC_EN (Bit 2) */
-#define LRA_LRA_CTRL1_REG_ADC_EN_Msk (0x4UL) /*!< ADC_EN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_CTRL1_REG_HBRIDGE_EN_Pos (1UL) /*!< HBRIDGE_EN (Bit 1) */
-#define LRA_LRA_CTRL1_REG_HBRIDGE_EN_Msk (0x2UL) /*!< HBRIDGE_EN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_CTRL1_REG_LRA_EN_Pos (0UL) /*!< LRA_EN (Bit 0) */
-#define LRA_LRA_CTRL1_REG_LRA_EN_Msk (0x1UL) /*!< LRA_EN (Bitfield-Mask: 0x01) */
-/* ===================================================== LRA_CTRL2_REG ===================================================== */
-#define LRA_LRA_CTRL2_REG_HALF_PERIOD_Pos (16UL) /*!< HALF_PERIOD (Bit 16) */
-#define LRA_LRA_CTRL2_REG_HALF_PERIOD_Msk (0xffff0000UL) /*!< HALF_PERIOD (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_CTRL2_REG_AUTO_MODE_Pos (5UL) /*!< AUTO_MODE (Bit 5) */
-#define LRA_LRA_CTRL2_REG_AUTO_MODE_Msk (0x20UL) /*!< AUTO_MODE (Bitfield-Mask: 0x01) */
-#define LRA_LRA_CTRL2_REG_SMP_MODE_Pos (4UL) /*!< SMP_MODE (Bit 4) */
-#define LRA_LRA_CTRL2_REG_SMP_MODE_Msk (0x10UL) /*!< SMP_MODE (Bitfield-Mask: 0x01) */
-#define LRA_LRA_CTRL2_REG_POLARITY_Pos (3UL) /*!< POLARITY (Bit 3) */
-#define LRA_LRA_CTRL2_REG_POLARITY_Msk (0x8UL) /*!< POLARITY (Bitfield-Mask: 0x01) */
-#define LRA_LRA_CTRL2_REG_FLT_IN_SEL_Pos (2UL) /*!< FLT_IN_SEL (Bit 2) */
-#define LRA_LRA_CTRL2_REG_FLT_IN_SEL_Msk (0x4UL) /*!< FLT_IN_SEL (Bitfield-Mask: 0x01) */
-#define LRA_LRA_CTRL2_REG_PWM_MODE_Pos (0UL) /*!< PWM_MODE (Bit 0) */
-#define LRA_LRA_CTRL2_REG_PWM_MODE_Msk (0x3UL) /*!< PWM_MODE (Bitfield-Mask: 0x03) */
-/* ===================================================== LRA_CTRL3_REG ===================================================== */
-#define LRA_LRA_CTRL3_REG_VREF_Pos (16UL) /*!< VREF (Bit 16) */
-#define LRA_LRA_CTRL3_REG_VREF_Msk (0xffff0000UL) /*!< VREF (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_CTRL3_REG_DREF_Pos (0UL) /*!< DREF (Bit 0) */
-#define LRA_LRA_CTRL3_REG_DREF_Msk (0xffffUL) /*!< DREF (Bitfield-Mask: 0xffff) */
-/* ====================================================== LRA_DFT_REG ====================================================== */
-#define LRA_LRA_DFT_REG_SPARE_Pos (29UL) /*!< SPARE (Bit 29) */
-#define LRA_LRA_DFT_REG_SPARE_Msk (0xe0000000UL) /*!< SPARE (Bitfield-Mask: 0x07) */
-#define LRA_LRA_DFT_REG_SWM_SEL_Pos (28UL) /*!< SWM_SEL (Bit 28) */
-#define LRA_LRA_DFT_REG_SWM_SEL_Msk (0x10000000UL) /*!< SWM_SEL (Bitfield-Mask: 0x01) */
-#define LRA_LRA_DFT_REG_SWM_MAN_Pos (27UL) /*!< SWM_MAN (Bit 27) */
-#define LRA_LRA_DFT_REG_SWM_MAN_Msk (0x8000000UL) /*!< SWM_MAN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_DFT_REG_PWM_SEL_Pos (26UL) /*!< PWM_SEL (Bit 26) */
-#define LRA_LRA_DFT_REG_PWM_SEL_Msk (0x4000000UL) /*!< PWM_SEL (Bitfield-Mask: 0x01) */
-#define LRA_LRA_DFT_REG_PWM_MAN_Pos (25UL) /*!< PWM_MAN (Bit 25) */
-#define LRA_LRA_DFT_REG_PWM_MAN_Msk (0x2000000UL) /*!< PWM_MAN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_DFT_REG_TIMER_TRIM_Pos (23UL) /*!< TIMER_TRIM (Bit 23) */
-#define LRA_LRA_DFT_REG_TIMER_TRIM_Msk (0x1800000UL) /*!< TIMER_TRIM (Bitfield-Mask: 0x03) */
-#define LRA_LRA_DFT_REG_TIMER_SCALE_TRIM_Pos (21UL) /*!< TIMER_SCALE_TRIM (Bit 21) */
-#define LRA_LRA_DFT_REG_TIMER_SCALE_TRIM_Msk (0x600000UL) /*!< TIMER_SCALE_TRIM (Bitfield-Mask: 0x03) */
-#define LRA_LRA_DFT_REG_DFT_SEL_Pos (20UL) /*!< DFT_SEL (Bit 20) */
-#define LRA_LRA_DFT_REG_DFT_SEL_Msk (0x100000UL) /*!< DFT_SEL (Bitfield-Mask: 0x01) */
-#define LRA_LRA_DFT_REG_DFT_FORCE_HSPN_Pos (19UL) /*!< DFT_FORCE_HSPN (Bit 19) */
-#define LRA_LRA_DFT_REG_DFT_FORCE_HSPN_Msk (0x80000UL) /*!< DFT_FORCE_HSPN (Bitfield-Mask: 0x01) */
-#define LRA_LRA_DFT_REG_DFT_EN_TIMER_Pos (18UL) /*!< DFT_EN_TIMER (Bit 18) */
-#define LRA_LRA_DFT_REG_DFT_EN_TIMER_Msk (0x40000UL) /*!< DFT_EN_TIMER (Bitfield-Mask: 0x01) */
-#define LRA_LRA_DFT_REG_DFT_STALL_Pos (16UL) /*!< DFT_STALL (Bit 16) */
-#define LRA_LRA_DFT_REG_DFT_STALL_Msk (0x30000UL) /*!< DFT_STALL (Bitfield-Mask: 0x03) */
-#define LRA_LRA_DFT_REG_DFT_CTRL_Pos (0UL) /*!< DFT_CTRL (Bit 0) */
-#define LRA_LRA_DFT_REG_DFT_CTRL_Msk (0xffffUL) /*!< DFT_CTRL (Bitfield-Mask: 0xffff) */
-/* =================================================== LRA_FLT_COEF1_REG =================================================== */
-#define LRA_LRA_FLT_COEF1_REG_FLT_COEF_01_Pos (16UL) /*!< FLT_COEF_01 (Bit 16) */
-#define LRA_LRA_FLT_COEF1_REG_FLT_COEF_01_Msk (0xffff0000UL) /*!< FLT_COEF_01 (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_FLT_COEF1_REG_FLT_COEF_00_Pos (0UL) /*!< FLT_COEF_00 (Bit 0) */
-#define LRA_LRA_FLT_COEF1_REG_FLT_COEF_00_Msk (0xffffUL) /*!< FLT_COEF_00 (Bitfield-Mask: 0xffff) */
-/* =================================================== LRA_FLT_COEF2_REG =================================================== */
-#define LRA_LRA_FLT_COEF2_REG_FLT_COEF_10_Pos (16UL) /*!< FLT_COEF_10 (Bit 16) */
-#define LRA_LRA_FLT_COEF2_REG_FLT_COEF_10_Msk (0xffff0000UL) /*!< FLT_COEF_10 (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_FLT_COEF2_REG_FLT_COEF_02_Pos (0UL) /*!< FLT_COEF_02 (Bit 0) */
-#define LRA_LRA_FLT_COEF2_REG_FLT_COEF_02_Msk (0xffffUL) /*!< FLT_COEF_02 (Bitfield-Mask: 0xffff) */
-/* =================================================== LRA_FLT_COEF3_REG =================================================== */
-#define LRA_LRA_FLT_COEF3_REG_FLT_COEF_12_Pos (16UL) /*!< FLT_COEF_12 (Bit 16) */
-#define LRA_LRA_FLT_COEF3_REG_FLT_COEF_12_Msk (0xffff0000UL) /*!< FLT_COEF_12 (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_FLT_COEF3_REG_FLT_COEF_11_Pos (0UL) /*!< FLT_COEF_11 (Bit 0) */
-#define LRA_LRA_FLT_COEF3_REG_FLT_COEF_11_Msk (0xffffUL) /*!< FLT_COEF_11 (Bitfield-Mask: 0xffff) */
-/* =================================================== LRA_FLT_SMP1_REG ==================================================== */
-#define LRA_LRA_FLT_SMP1_REG_LRA_SMP_2_Pos (16UL) /*!< LRA_SMP_2 (Bit 16) */
-#define LRA_LRA_FLT_SMP1_REG_LRA_SMP_2_Msk (0xffff0000UL) /*!< LRA_SMP_2 (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_FLT_SMP1_REG_LRA_SMP_1_Pos (0UL) /*!< LRA_SMP_1 (Bit 0) */
-#define LRA_LRA_FLT_SMP1_REG_LRA_SMP_1_Msk (0xffffUL) /*!< LRA_SMP_1 (Bitfield-Mask: 0xffff) */
-/* =================================================== LRA_FLT_SMP2_REG ==================================================== */
-#define LRA_LRA_FLT_SMP2_REG_LRA_SMP_4_Pos (16UL) /*!< LRA_SMP_4 (Bit 16) */
-#define LRA_LRA_FLT_SMP2_REG_LRA_SMP_4_Msk (0xffff0000UL) /*!< LRA_SMP_4 (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_FLT_SMP2_REG_LRA_SMP_3_Pos (0UL) /*!< LRA_SMP_3 (Bit 0) */
-#define LRA_LRA_FLT_SMP2_REG_LRA_SMP_3_Msk (0xffffUL) /*!< LRA_SMP_3 (Bitfield-Mask: 0xffff) */
-/* =================================================== LRA_FLT_SMP3_REG ==================================================== */
-#define LRA_LRA_FLT_SMP3_REG_LRA_SMP_6_Pos (16UL) /*!< LRA_SMP_6 (Bit 16) */
-#define LRA_LRA_FLT_SMP3_REG_LRA_SMP_6_Msk (0xffff0000UL) /*!< LRA_SMP_6 (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_FLT_SMP3_REG_LRA_SMP_5_Pos (0UL) /*!< LRA_SMP_5 (Bit 0) */
-#define LRA_LRA_FLT_SMP3_REG_LRA_SMP_5_Msk (0xffffUL) /*!< LRA_SMP_5 (Bitfield-Mask: 0xffff) */
-/* =================================================== LRA_FLT_SMP4_REG ==================================================== */
-#define LRA_LRA_FLT_SMP4_REG_LRA_SMP_8_Pos (16UL) /*!< LRA_SMP_8 (Bit 16) */
-#define LRA_LRA_FLT_SMP4_REG_LRA_SMP_8_Msk (0xffff0000UL) /*!< LRA_SMP_8 (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_FLT_SMP4_REG_LRA_SMP_7_Pos (0UL) /*!< LRA_SMP_7 (Bit 0) */
-#define LRA_LRA_FLT_SMP4_REG_LRA_SMP_7_Msk (0xffffUL) /*!< LRA_SMP_7 (Bitfield-Mask: 0xffff) */
-/* =================================================== LRA_FLT_SMP5_REG ==================================================== */
-#define LRA_LRA_FLT_SMP5_REG_LRA_SMP_10_Pos (16UL) /*!< LRA_SMP_10 (Bit 16) */
-#define LRA_LRA_FLT_SMP5_REG_LRA_SMP_10_Msk (0xffff0000UL) /*!< LRA_SMP_10 (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_FLT_SMP5_REG_LRA_SMP_9_Pos (0UL) /*!< LRA_SMP_9 (Bit 0) */
-#define LRA_LRA_FLT_SMP5_REG_LRA_SMP_9_Msk (0xffffUL) /*!< LRA_SMP_9 (Bitfield-Mask: 0xffff) */
-/* =================================================== LRA_FLT_SMP6_REG ==================================================== */
-#define LRA_LRA_FLT_SMP6_REG_LRA_SMP_12_Pos (16UL) /*!< LRA_SMP_12 (Bit 16) */
-#define LRA_LRA_FLT_SMP6_REG_LRA_SMP_12_Msk (0xffff0000UL) /*!< LRA_SMP_12 (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_FLT_SMP6_REG_LRA_SMP_11_Pos (0UL) /*!< LRA_SMP_11 (Bit 0) */
-#define LRA_LRA_FLT_SMP6_REG_LRA_SMP_11_Msk (0xffffUL) /*!< LRA_SMP_11 (Bitfield-Mask: 0xffff) */
-/* =================================================== LRA_FLT_SMP7_REG ==================================================== */
-#define LRA_LRA_FLT_SMP7_REG_LRA_SMP_14_Pos (16UL) /*!< LRA_SMP_14 (Bit 16) */
-#define LRA_LRA_FLT_SMP7_REG_LRA_SMP_14_Msk (0xffff0000UL) /*!< LRA_SMP_14 (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_FLT_SMP7_REG_LRA_SMP_13_Pos (0UL) /*!< LRA_SMP_13 (Bit 0) */
-#define LRA_LRA_FLT_SMP7_REG_LRA_SMP_13_Msk (0xffffUL) /*!< LRA_SMP_13 (Bitfield-Mask: 0xffff) */
-/* =================================================== LRA_FLT_SMP8_REG ==================================================== */
-#define LRA_LRA_FLT_SMP8_REG_LRA_SMP_16_Pos (16UL) /*!< LRA_SMP_16 (Bit 16) */
-#define LRA_LRA_FLT_SMP8_REG_LRA_SMP_16_Msk (0xffff0000UL) /*!< LRA_SMP_16 (Bitfield-Mask: 0xffff) */
-#define LRA_LRA_FLT_SMP8_REG_LRA_SMP_15_Pos (0UL) /*!< LRA_SMP_15 (Bit 0) */
-#define LRA_LRA_FLT_SMP8_REG_LRA_SMP_15_Msk (0xffffUL) /*!< LRA_SMP_15 (Bitfield-Mask: 0xffff) */
-/* ====================================================== LRA_LDO_REG ====================================================== */
-#define LRA_LRA_LDO_REG_LDO_OK_Pos (31UL) /*!< LDO_OK (Bit 31) */
-#define LRA_LRA_LDO_REG_LDO_OK_Msk (0x80000000UL) /*!< LDO_OK (Bitfield-Mask: 0x01) */
-#define LRA_LRA_LDO_REG_LDO_TST_Pos (1UL) /*!< LDO_TST (Bit 1) */
-#define LRA_LRA_LDO_REG_LDO_TST_Msk (0x2UL) /*!< LDO_TST (Bitfield-Mask: 0x01) */
-#define LRA_LRA_LDO_REG_LDO_VREF_HOLD_Pos (0UL) /*!< LDO_VREF_HOLD (Bit 0) */
-#define LRA_LRA_LDO_REG_LDO_VREF_HOLD_Msk (0x1UL) /*!< LDO_VREF_HOLD (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ MEMCTRL ================ */
-/* =========================================================================================================================== */
-
-/* ==================================================== BUSY_RESET_REG ===================================================== */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_SPARE_Pos (30UL) /*!< BUSY_SPARE (Bit 30) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_SPARE_Msk (0xc0000000UL) /*!< BUSY_SPARE (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_MOTOR_Pos (28UL) /*!< BUSY_MOTOR (Bit 28) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_MOTOR_Msk (0x30000000UL) /*!< BUSY_MOTOR (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_TIMER2_Pos (26UL) /*!< BUSY_TIMER2 (Bit 26) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_TIMER2_Msk (0xc000000UL) /*!< BUSY_TIMER2 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_TIMER_Pos (24UL) /*!< BUSY_TIMER (Bit 24) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_TIMER_Msk (0x3000000UL) /*!< BUSY_TIMER (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_UART3_Pos (22UL) /*!< BUSY_UART3 (Bit 22) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_UART3_Msk (0xc00000UL) /*!< BUSY_UART3 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_GPADC_Pos (20UL) /*!< BUSY_GPADC (Bit 20) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_GPADC_Msk (0x300000UL) /*!< BUSY_GPADC (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_PDM_Pos (18UL) /*!< BUSY_PDM (Bit 18) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_PDM_Msk (0xc0000UL) /*!< BUSY_PDM (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_SRC_Pos (16UL) /*!< BUSY_SRC (Bit 16) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_SRC_Msk (0x30000UL) /*!< BUSY_SRC (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_PCM_Pos (14UL) /*!< BUSY_PCM (Bit 14) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_PCM_Msk (0xc000UL) /*!< BUSY_PCM (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_SDADC_Pos (12UL) /*!< BUSY_SDADC (Bit 12) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_SDADC_Msk (0x3000UL) /*!< BUSY_SDADC (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_I2C2_Pos (10UL) /*!< BUSY_I2C2 (Bit 10) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_I2C2_Msk (0xc00UL) /*!< BUSY_I2C2 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_I2C_Pos (8UL) /*!< BUSY_I2C (Bit 8) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_I2C_Msk (0x300UL) /*!< BUSY_I2C (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_SPI2_Pos (6UL) /*!< BUSY_SPI2 (Bit 6) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_SPI2_Msk (0xc0UL) /*!< BUSY_SPI2 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_SPI_Pos (4UL) /*!< BUSY_SPI (Bit 4) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_SPI_Msk (0x30UL) /*!< BUSY_SPI (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_UART2_Pos (2UL) /*!< BUSY_UART2 (Bit 2) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_UART2_Msk (0xcUL) /*!< BUSY_UART2 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_UART_Pos (0UL) /*!< BUSY_UART (Bit 0) */
-#define MEMCTRL_BUSY_RESET_REG_BUSY_UART_Msk (0x3UL) /*!< BUSY_UART (Bitfield-Mask: 0x03) */
-/* ===================================================== BUSY_SET_REG ====================================================== */
-#define MEMCTRL_BUSY_SET_REG_BUSY_SPARE_Pos (30UL) /*!< BUSY_SPARE (Bit 30) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_SPARE_Msk (0xc0000000UL) /*!< BUSY_SPARE (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_MOTOR_Pos (28UL) /*!< BUSY_MOTOR (Bit 28) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_MOTOR_Msk (0x30000000UL) /*!< BUSY_MOTOR (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_TIMER2_Pos (26UL) /*!< BUSY_TIMER2 (Bit 26) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_TIMER2_Msk (0xc000000UL) /*!< BUSY_TIMER2 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_TIMER_Pos (24UL) /*!< BUSY_TIMER (Bit 24) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_TIMER_Msk (0x3000000UL) /*!< BUSY_TIMER (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_UART3_Pos (22UL) /*!< BUSY_UART3 (Bit 22) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_UART3_Msk (0xc00000UL) /*!< BUSY_UART3 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_GPADC_Pos (20UL) /*!< BUSY_GPADC (Bit 20) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_GPADC_Msk (0x300000UL) /*!< BUSY_GPADC (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_PDM_Pos (18UL) /*!< BUSY_PDM (Bit 18) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_PDM_Msk (0xc0000UL) /*!< BUSY_PDM (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_SRC_Pos (16UL) /*!< BUSY_SRC (Bit 16) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_SRC_Msk (0x30000UL) /*!< BUSY_SRC (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_PCM_Pos (14UL) /*!< BUSY_PCM (Bit 14) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_PCM_Msk (0xc000UL) /*!< BUSY_PCM (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_SDADC_Pos (12UL) /*!< BUSY_SDADC (Bit 12) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_SDADC_Msk (0x3000UL) /*!< BUSY_SDADC (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_I2C2_Pos (10UL) /*!< BUSY_I2C2 (Bit 10) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_I2C2_Msk (0xc00UL) /*!< BUSY_I2C2 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_I2C_Pos (8UL) /*!< BUSY_I2C (Bit 8) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_I2C_Msk (0x300UL) /*!< BUSY_I2C (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_SPI2_Pos (6UL) /*!< BUSY_SPI2 (Bit 6) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_SPI2_Msk (0xc0UL) /*!< BUSY_SPI2 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_SPI_Pos (4UL) /*!< BUSY_SPI (Bit 4) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_SPI_Msk (0x30UL) /*!< BUSY_SPI (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_UART2_Pos (2UL) /*!< BUSY_UART2 (Bit 2) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_UART2_Msk (0xcUL) /*!< BUSY_UART2 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_UART_Pos (0UL) /*!< BUSY_UART (Bit 0) */
-#define MEMCTRL_BUSY_SET_REG_BUSY_UART_Msk (0x3UL) /*!< BUSY_UART (Bitfield-Mask: 0x03) */
-/* ===================================================== BUSY_STAT_REG ===================================================== */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_SPARE_Pos (30UL) /*!< BUSY_SPARE (Bit 30) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_SPARE_Msk (0xc0000000UL) /*!< BUSY_SPARE (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_MOTOR_Pos (28UL) /*!< BUSY_MOTOR (Bit 28) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_MOTOR_Msk (0x30000000UL) /*!< BUSY_MOTOR (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_TIMER2_Pos (26UL) /*!< BUSY_TIMER2 (Bit 26) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_TIMER2_Msk (0xc000000UL) /*!< BUSY_TIMER2 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_TIMER_Pos (24UL) /*!< BUSY_TIMER (Bit 24) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_TIMER_Msk (0x3000000UL) /*!< BUSY_TIMER (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_UART3_Pos (22UL) /*!< BUSY_UART3 (Bit 22) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_UART3_Msk (0xc00000UL) /*!< BUSY_UART3 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_GPADC_Pos (20UL) /*!< BUSY_GPADC (Bit 20) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_GPADC_Msk (0x300000UL) /*!< BUSY_GPADC (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_PDM_Pos (18UL) /*!< BUSY_PDM (Bit 18) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_PDM_Msk (0xc0000UL) /*!< BUSY_PDM (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_SRC_Pos (16UL) /*!< BUSY_SRC (Bit 16) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_SRC_Msk (0x30000UL) /*!< BUSY_SRC (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_PCM_Pos (14UL) /*!< BUSY_PCM (Bit 14) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_PCM_Msk (0xc000UL) /*!< BUSY_PCM (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_SDADC_Pos (12UL) /*!< BUSY_SDADC (Bit 12) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_SDADC_Msk (0x3000UL) /*!< BUSY_SDADC (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_I2C2_Pos (10UL) /*!< BUSY_I2C2 (Bit 10) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_I2C2_Msk (0xc00UL) /*!< BUSY_I2C2 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_I2C_Pos (8UL) /*!< BUSY_I2C (Bit 8) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_I2C_Msk (0x300UL) /*!< BUSY_I2C (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_SPI2_Pos (6UL) /*!< BUSY_SPI2 (Bit 6) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_SPI2_Msk (0xc0UL) /*!< BUSY_SPI2 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_SPI_Pos (4UL) /*!< BUSY_SPI (Bit 4) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_SPI_Msk (0x30UL) /*!< BUSY_SPI (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_UART2_Pos (2UL) /*!< BUSY_UART2 (Bit 2) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_UART2_Msk (0xcUL) /*!< BUSY_UART2 (Bitfield-Mask: 0x03) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_UART_Pos (0UL) /*!< BUSY_UART (Bit 0) */
-#define MEMCTRL_BUSY_STAT_REG_BUSY_UART_Msk (0x3UL) /*!< BUSY_UART (Bitfield-Mask: 0x03) */
-/* =================================================== CMI_CODE_BASE_REG =================================================== */
-#define MEMCTRL_CMI_CODE_BASE_REG_CMI_CODE_BASE_ADDR_Pos (10UL) /*!< CMI_CODE_BASE_ADDR (Bit 10) */
-#define MEMCTRL_CMI_CODE_BASE_REG_CMI_CODE_BASE_ADDR_Msk (0x7fc00UL) /*!< CMI_CODE_BASE_ADDR (Bitfield-Mask: 0x1ff) */
-/* =================================================== CMI_DATA_BASE_REG =================================================== */
-#define MEMCTRL_CMI_DATA_BASE_REG_CMI_DATA_BASE_ADDR_Pos (2UL) /*!< CMI_DATA_BASE_ADDR (Bit 2) */
-#define MEMCTRL_CMI_DATA_BASE_REG_CMI_DATA_BASE_ADDR_Msk (0x7fffcUL) /*!< CMI_DATA_BASE_ADDR (Bitfield-Mask: 0x1ffff) */
-/* ====================================================== CMI_END_REG ====================================================== */
-#define MEMCTRL_CMI_END_REG_CMI_END_ADDR_Pos (10UL) /*!< CMI_END_ADDR (Bit 10) */
-#define MEMCTRL_CMI_END_REG_CMI_END_ADDR_Msk (0x7fc00UL) /*!< CMI_END_ADDR (Bitfield-Mask: 0x1ff) */
-/* ================================================== CMI_SHARED_BASE_REG ================================================== */
-#define MEMCTRL_CMI_SHARED_BASE_REG_CMI_SHARED_BASE_ADDR_Pos (10UL) /*!< CMI_SHARED_BASE_ADDR (Bit 10) */
-#define MEMCTRL_CMI_SHARED_BASE_REG_CMI_SHARED_BASE_ADDR_Msk (0x7fc00UL) /*!< CMI_SHARED_BASE_ADDR (Bitfield-Mask: 0x1ff) */
-/* ===================================================== MEM_PRIO_REG ====================================================== */
-#define MEMCTRL_MEM_PRIO_REG_AHB_PRIO_Pos (4UL) /*!< AHB_PRIO (Bit 4) */
-#define MEMCTRL_MEM_PRIO_REG_AHB_PRIO_Msk (0x30UL) /*!< AHB_PRIO (Bitfield-Mask: 0x03) */
-#define MEMCTRL_MEM_PRIO_REG_AHB2_PRIO_Pos (2UL) /*!< AHB2_PRIO (Bit 2) */
-#define MEMCTRL_MEM_PRIO_REG_AHB2_PRIO_Msk (0xcUL) /*!< AHB2_PRIO (Bitfield-Mask: 0x03) */
-#define MEMCTRL_MEM_PRIO_REG_SNC_PRIO_Pos (0UL) /*!< SNC_PRIO (Bit 0) */
-#define MEMCTRL_MEM_PRIO_REG_SNC_PRIO_Msk (0x3UL) /*!< SNC_PRIO (Bitfield-Mask: 0x03) */
-/* ===================================================== MEM_STALL_REG ===================================================== */
-#define MEMCTRL_MEM_STALL_REG_AHB_MAX_STALL_Pos (8UL) /*!< AHB_MAX_STALL (Bit 8) */
-#define MEMCTRL_MEM_STALL_REG_AHB_MAX_STALL_Msk (0xf00UL) /*!< AHB_MAX_STALL (Bitfield-Mask: 0x0f) */
-#define MEMCTRL_MEM_STALL_REG_AHB2_MAX_STALL_Pos (4UL) /*!< AHB2_MAX_STALL (Bit 4) */
-#define MEMCTRL_MEM_STALL_REG_AHB2_MAX_STALL_Msk (0xf0UL) /*!< AHB2_MAX_STALL (Bitfield-Mask: 0x0f) */
-#define MEMCTRL_MEM_STALL_REG_SNC_MAX_STALL_Pos (0UL) /*!< SNC_MAX_STALL (Bit 0) */
-#define MEMCTRL_MEM_STALL_REG_SNC_MAX_STALL_Msk (0xfUL) /*!< SNC_MAX_STALL (Bitfield-Mask: 0x0f) */
-/* ==================================================== MEM_STATUS2_REG ==================================================== */
-#define MEMCTRL_MEM_STATUS2_REG_RAM8_OFF_BUT_ACCESS_Pos (7UL) /*!< RAM8_OFF_BUT_ACCESS (Bit 7) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM8_OFF_BUT_ACCESS_Msk (0x80UL) /*!< RAM8_OFF_BUT_ACCESS (Bitfield-Mask: 0x01) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM7_OFF_BUT_ACCESS_Pos (6UL) /*!< RAM7_OFF_BUT_ACCESS (Bit 6) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM7_OFF_BUT_ACCESS_Msk (0x40UL) /*!< RAM7_OFF_BUT_ACCESS (Bitfield-Mask: 0x01) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM6_OFF_BUT_ACCESS_Pos (5UL) /*!< RAM6_OFF_BUT_ACCESS (Bit 5) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM6_OFF_BUT_ACCESS_Msk (0x20UL) /*!< RAM6_OFF_BUT_ACCESS (Bitfield-Mask: 0x01) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM5_OFF_BUT_ACCESS_Pos (4UL) /*!< RAM5_OFF_BUT_ACCESS (Bit 4) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM5_OFF_BUT_ACCESS_Msk (0x10UL) /*!< RAM5_OFF_BUT_ACCESS (Bitfield-Mask: 0x01) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM4_OFF_BUT_ACCESS_Pos (3UL) /*!< RAM4_OFF_BUT_ACCESS (Bit 3) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM4_OFF_BUT_ACCESS_Msk (0x8UL) /*!< RAM4_OFF_BUT_ACCESS (Bitfield-Mask: 0x01) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM3_OFF_BUT_ACCESS_Pos (2UL) /*!< RAM3_OFF_BUT_ACCESS (Bit 2) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM3_OFF_BUT_ACCESS_Msk (0x4UL) /*!< RAM3_OFF_BUT_ACCESS (Bitfield-Mask: 0x01) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM2_OFF_BUT_ACCESS_Pos (1UL) /*!< RAM2_OFF_BUT_ACCESS (Bit 1) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM2_OFF_BUT_ACCESS_Msk (0x2UL) /*!< RAM2_OFF_BUT_ACCESS (Bitfield-Mask: 0x01) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM1_OFF_BUT_ACCESS_Pos (0UL) /*!< RAM1_OFF_BUT_ACCESS (Bit 0) */
-#define MEMCTRL_MEM_STATUS2_REG_RAM1_OFF_BUT_ACCESS_Msk (0x1UL) /*!< RAM1_OFF_BUT_ACCESS (Bitfield-Mask: 0x01) */
-/* ==================================================== MEM_STATUS_REG ===================================================== */
-#define MEMCTRL_MEM_STATUS_REG_CMI_CLEAR_READY_Pos (13UL) /*!< CMI_CLEAR_READY (Bit 13) */
-#define MEMCTRL_MEM_STATUS_REG_CMI_CLEAR_READY_Msk (0x2000UL) /*!< CMI_CLEAR_READY (Bitfield-Mask: 0x01) */
-#define MEMCTRL_MEM_STATUS_REG_CMI_NOT_READY_Pos (12UL) /*!< CMI_NOT_READY (Bit 12) */
-#define MEMCTRL_MEM_STATUS_REG_CMI_NOT_READY_Msk (0x1000UL) /*!< CMI_NOT_READY (Bitfield-Mask: 0x01) */
-#define MEMCTRL_MEM_STATUS_REG_AHB2_WR_BUFF_CNT_Pos (8UL) /*!< AHB2_WR_BUFF_CNT (Bit 8) */
-#define MEMCTRL_MEM_STATUS_REG_AHB2_WR_BUFF_CNT_Msk (0xf00UL) /*!< AHB2_WR_BUFF_CNT (Bitfield-Mask: 0x0f) */
-#define MEMCTRL_MEM_STATUS_REG_AHB_WR_BUFF_CNT_Pos (4UL) /*!< AHB_WR_BUFF_CNT (Bit 4) */
-#define MEMCTRL_MEM_STATUS_REG_AHB_WR_BUFF_CNT_Msk (0xf0UL) /*!< AHB_WR_BUFF_CNT (Bitfield-Mask: 0x0f) */
-#define MEMCTRL_MEM_STATUS_REG_AHB2_CLR_WR_BUFF_Pos (3UL) /*!< AHB2_CLR_WR_BUFF (Bit 3) */
-#define MEMCTRL_MEM_STATUS_REG_AHB2_CLR_WR_BUFF_Msk (0x8UL) /*!< AHB2_CLR_WR_BUFF (Bitfield-Mask: 0x01) */
-#define MEMCTRL_MEM_STATUS_REG_AHB_CLR_WR_BUFF_Pos (2UL) /*!< AHB_CLR_WR_BUFF (Bit 2) */
-#define MEMCTRL_MEM_STATUS_REG_AHB_CLR_WR_BUFF_Msk (0x4UL) /*!< AHB_CLR_WR_BUFF (Bitfield-Mask: 0x01) */
-#define MEMCTRL_MEM_STATUS_REG_AHB2_WRITE_BUFF_Pos (1UL) /*!< AHB2_WRITE_BUFF (Bit 1) */
-#define MEMCTRL_MEM_STATUS_REG_AHB2_WRITE_BUFF_Msk (0x2UL) /*!< AHB2_WRITE_BUFF (Bitfield-Mask: 0x01) */
-#define MEMCTRL_MEM_STATUS_REG_AHB_WRITE_BUFF_Pos (0UL) /*!< AHB_WRITE_BUFF (Bit 0) */
-#define MEMCTRL_MEM_STATUS_REG_AHB_WRITE_BUFF_Msk (0x1UL) /*!< AHB_WRITE_BUFF (Bitfield-Mask: 0x01) */
-/* ===================================================== SNC_BASE_REG ====================================================== */
-#define MEMCTRL_SNC_BASE_REG_SNC_BASE_ADDRESS_Pos (2UL) /*!< SNC_BASE_ADDRESS (Bit 2) */
-#define MEMCTRL_SNC_BASE_REG_SNC_BASE_ADDRESS_Msk (0x7fffcUL) /*!< SNC_BASE_ADDRESS (Bitfield-Mask: 0x1ffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ OTPC ================ */
-/* =========================================================================================================================== */
-
-/* ===================================================== OTPC_MODE_REG ===================================================== */
-#define OTPC_OTPC_MODE_REG_OTPC_MODE_PRG_SEL_Pos (6UL) /*!< OTPC_MODE_PRG_SEL (Bit 6) */
-#define OTPC_OTPC_MODE_REG_OTPC_MODE_PRG_SEL_Msk (0xc0UL) /*!< OTPC_MODE_PRG_SEL (Bitfield-Mask: 0x03) */
-#define OTPC_OTPC_MODE_REG_OTPC_MODE_HT_MARG_EN_Pos (5UL) /*!< OTPC_MODE_HT_MARG_EN (Bit 5) */
-#define OTPC_OTPC_MODE_REG_OTPC_MODE_HT_MARG_EN_Msk (0x20UL) /*!< OTPC_MODE_HT_MARG_EN (Bitfield-Mask: 0x01) */
-#define OTPC_OTPC_MODE_REG_OTPC_MODE_USE_TST_ROW_Pos (4UL) /*!< OTPC_MODE_USE_TST_ROW (Bit 4) */
-#define OTPC_OTPC_MODE_REG_OTPC_MODE_USE_TST_ROW_Msk (0x10UL) /*!< OTPC_MODE_USE_TST_ROW (Bitfield-Mask: 0x01) */
-#define OTPC_OTPC_MODE_REG_OTPC_MODE_MODE_Pos (0UL) /*!< OTPC_MODE_MODE (Bit 0) */
-#define OTPC_OTPC_MODE_REG_OTPC_MODE_MODE_Msk (0x7UL) /*!< OTPC_MODE_MODE (Bitfield-Mask: 0x07) */
-/* ==================================================== OTPC_PADDR_REG ===================================================== */
-#define OTPC_OTPC_PADDR_REG_OTPC_PADDR_Pos (0UL) /*!< OTPC_PADDR (Bit 0) */
-#define OTPC_OTPC_PADDR_REG_OTPC_PADDR_Msk (0x3ffUL) /*!< OTPC_PADDR (Bitfield-Mask: 0x3ff) */
-/* ==================================================== OTPC_PWORD_REG ===================================================== */
-#define OTPC_OTPC_PWORD_REG_OTPC_PWORD_Pos (0UL) /*!< OTPC_PWORD (Bit 0) */
-#define OTPC_OTPC_PWORD_REG_OTPC_PWORD_Msk (0xffffffffUL) /*!< OTPC_PWORD (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== OTPC_STAT_REG ===================================================== */
-#define OTPC_OTPC_STAT_REG_OTPC_STAT_MRDY_Pos (2UL) /*!< OTPC_STAT_MRDY (Bit 2) */
-#define OTPC_OTPC_STAT_REG_OTPC_STAT_MRDY_Msk (0x4UL) /*!< OTPC_STAT_MRDY (Bitfield-Mask: 0x01) */
-#define OTPC_OTPC_STAT_REG_OTPC_STAT_PBUF_EMPTY_Pos (1UL) /*!< OTPC_STAT_PBUF_EMPTY (Bit 1) */
-#define OTPC_OTPC_STAT_REG_OTPC_STAT_PBUF_EMPTY_Msk (0x2UL) /*!< OTPC_STAT_PBUF_EMPTY (Bitfield-Mask: 0x01) */
-#define OTPC_OTPC_STAT_REG_OTPC_STAT_PRDY_Pos (0UL) /*!< OTPC_STAT_PRDY (Bit 0) */
-#define OTPC_OTPC_STAT_REG_OTPC_STAT_PRDY_Msk (0x1UL) /*!< OTPC_STAT_PRDY (Bitfield-Mask: 0x01) */
-/* ===================================================== OTPC_TIM1_REG ===================================================== */
-#define OTPC_OTPC_TIM1_REG_OTPC_TIM1_US_T_CSP_Pos (24UL) /*!< OTPC_TIM1_US_T_CSP (Bit 24) */
-#define OTPC_OTPC_TIM1_REG_OTPC_TIM1_US_T_CSP_Msk (0x7f000000UL) /*!< OTPC_TIM1_US_T_CSP (Bitfield-Mask: 0x7f) */
-#define OTPC_OTPC_TIM1_REG_OTPC_TIM1_US_T_CS_Pos (20UL) /*!< OTPC_TIM1_US_T_CS (Bit 20) */
-#define OTPC_OTPC_TIM1_REG_OTPC_TIM1_US_T_CS_Msk (0xf00000UL) /*!< OTPC_TIM1_US_T_CS (Bitfield-Mask: 0x0f) */
-#define OTPC_OTPC_TIM1_REG_OTPC_TIM1_US_T_PL_Pos (16UL) /*!< OTPC_TIM1_US_T_PL (Bit 16) */
-#define OTPC_OTPC_TIM1_REG_OTPC_TIM1_US_T_PL_Msk (0xf0000UL) /*!< OTPC_TIM1_US_T_PL (Bitfield-Mask: 0x0f) */
-#define OTPC_OTPC_TIM1_REG_OTPC_TIM1_CC_T_RD_Pos (12UL) /*!< OTPC_TIM1_CC_T_RD (Bit 12) */
-#define OTPC_OTPC_TIM1_REG_OTPC_TIM1_CC_T_RD_Msk (0x7000UL) /*!< OTPC_TIM1_CC_T_RD (Bitfield-Mask: 0x07) */
-#define OTPC_OTPC_TIM1_REG_OTPC_TIM1_CC_T_20NS_Pos (8UL) /*!< OTPC_TIM1_CC_T_20NS (Bit 8) */
-#define OTPC_OTPC_TIM1_REG_OTPC_TIM1_CC_T_20NS_Msk (0x300UL) /*!< OTPC_TIM1_CC_T_20NS (Bitfield-Mask: 0x03) */
-#define OTPC_OTPC_TIM1_REG_OTPC_TIM1_CC_T_1US_Pos (0UL) /*!< OTPC_TIM1_CC_T_1US (Bit 0) */
-#define OTPC_OTPC_TIM1_REG_OTPC_TIM1_CC_T_1US_Msk (0x7fUL) /*!< OTPC_TIM1_CC_T_1US (Bitfield-Mask: 0x7f) */
-/* ===================================================== OTPC_TIM2_REG ===================================================== */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_ADD_CC_EN_Pos (31UL) /*!< OTPC_TIM2_US_ADD_CC_EN (Bit 31) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_ADD_CC_EN_Msk (0x80000000UL) /*!< OTPC_TIM2_US_ADD_CC_EN (Bitfield-Mask: 0x01) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_SAS_Pos (29UL) /*!< OTPC_TIM2_US_T_SAS (Bit 29) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_SAS_Msk (0x60000000UL) /*!< OTPC_TIM2_US_T_SAS (Bitfield-Mask: 0x03) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_PPH_Pos (24UL) /*!< OTPC_TIM2_US_T_PPH (Bit 24) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_PPH_Msk (0x1f000000UL) /*!< OTPC_TIM2_US_T_PPH (Bitfield-Mask: 0x1f) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_VDS_Pos (21UL) /*!< OTPC_TIM2_US_T_VDS (Bit 21) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_VDS_Msk (0xe00000UL) /*!< OTPC_TIM2_US_T_VDS (Bitfield-Mask: 0x07) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_PPS_Pos (16UL) /*!< OTPC_TIM2_US_T_PPS (Bit 16) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_PPS_Msk (0x1f0000UL) /*!< OTPC_TIM2_US_T_PPS (Bitfield-Mask: 0x1f) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_PPR_Pos (8UL) /*!< OTPC_TIM2_US_T_PPR (Bit 8) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_PPR_Msk (0x7f00UL) /*!< OTPC_TIM2_US_T_PPR (Bitfield-Mask: 0x7f) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_PWI_Pos (5UL) /*!< OTPC_TIM2_US_T_PWI (Bit 5) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_PWI_Msk (0xe0UL) /*!< OTPC_TIM2_US_T_PWI (Bitfield-Mask: 0x07) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_PW_Pos (0UL) /*!< OTPC_TIM2_US_T_PW (Bit 0) */
-#define OTPC_OTPC_TIM2_REG_OTPC_TIM2_US_T_PW_Msk (0x1fUL) /*!< OTPC_TIM2_US_T_PW (Bitfield-Mask: 0x1f) */
-
-
-/* =========================================================================================================================== */
-/* ================ PDC ================ */
-/* =========================================================================================================================== */
-
-/* ================================================== PDC_ACKNOWLEDGE_REG ================================================== */
-#define PDC_PDC_ACKNOWLEDGE_REG_PDC_ACKNOWLEDGE_Pos (0UL) /*!< PDC_ACKNOWLEDGE (Bit 0) */
-#define PDC_PDC_ACKNOWLEDGE_REG_PDC_ACKNOWLEDGE_Msk (0x1fUL) /*!< PDC_ACKNOWLEDGE (Bitfield-Mask: 0x1f) */
-/* ===================================================== PDC_CTRL0_REG ===================================================== */
-#define PDC_PDC_CTRL0_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL0_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL0_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL0_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL0_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL0_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL0_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL0_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL0_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL0_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL0_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL0_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL0_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL0_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ==================================================== PDC_CTRL10_REG ===================================================== */
-#define PDC_PDC_CTRL10_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL10_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL10_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL10_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL10_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL10_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL10_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL10_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL10_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL10_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL10_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL10_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL10_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL10_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ==================================================== PDC_CTRL11_REG ===================================================== */
-#define PDC_PDC_CTRL11_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL11_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL11_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL11_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL11_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL11_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL11_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL11_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL11_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL11_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL11_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL11_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL11_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL11_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ==================================================== PDC_CTRL12_REG ===================================================== */
-#define PDC_PDC_CTRL12_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL12_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL12_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL12_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL12_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL12_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL12_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL12_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL12_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL12_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL12_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL12_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL12_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL12_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ==================================================== PDC_CTRL13_REG ===================================================== */
-#define PDC_PDC_CTRL13_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL13_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL13_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL13_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL13_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL13_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL13_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL13_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL13_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL13_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL13_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL13_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL13_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL13_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ==================================================== PDC_CTRL14_REG ===================================================== */
-#define PDC_PDC_CTRL14_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL14_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL14_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL14_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL14_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL14_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL14_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL14_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL14_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL14_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL14_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL14_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL14_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL14_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ==================================================== PDC_CTRL15_REG ===================================================== */
-#define PDC_PDC_CTRL15_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL15_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL15_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL15_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL15_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL15_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL15_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL15_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL15_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL15_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL15_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL15_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL15_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL15_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ===================================================== PDC_CTRL1_REG ===================================================== */
-#define PDC_PDC_CTRL1_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL1_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL1_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL1_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL1_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL1_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL1_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL1_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL1_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL1_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL1_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL1_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL1_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL1_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ===================================================== PDC_CTRL2_REG ===================================================== */
-#define PDC_PDC_CTRL2_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL2_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL2_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL2_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL2_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL2_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL2_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL2_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL2_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL2_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL2_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL2_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL2_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL2_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ===================================================== PDC_CTRL3_REG ===================================================== */
-#define PDC_PDC_CTRL3_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL3_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL3_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL3_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL3_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL3_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL3_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL3_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL3_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL3_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL3_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL3_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL3_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL3_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ===================================================== PDC_CTRL4_REG ===================================================== */
-#define PDC_PDC_CTRL4_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL4_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL4_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL4_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL4_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL4_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL4_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL4_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL4_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL4_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL4_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL4_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL4_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL4_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ===================================================== PDC_CTRL5_REG ===================================================== */
-#define PDC_PDC_CTRL5_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL5_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL5_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL5_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL5_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL5_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL5_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL5_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL5_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL5_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL5_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL5_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL5_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL5_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ===================================================== PDC_CTRL6_REG ===================================================== */
-#define PDC_PDC_CTRL6_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL6_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL6_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL6_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL6_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL6_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL6_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL6_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL6_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL6_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL6_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL6_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL6_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL6_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ===================================================== PDC_CTRL7_REG ===================================================== */
-#define PDC_PDC_CTRL7_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL7_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL7_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL7_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL7_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL7_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL7_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL7_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL7_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL7_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL7_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL7_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL7_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL7_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ===================================================== PDC_CTRL8_REG ===================================================== */
-#define PDC_PDC_CTRL8_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL8_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL8_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL8_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL8_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL8_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL8_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL8_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL8_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL8_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL8_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL8_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL8_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL8_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ===================================================== PDC_CTRL9_REG ===================================================== */
-#define PDC_PDC_CTRL9_REG_PDC_MASTER_Pos (11UL) /*!< PDC_MASTER (Bit 11) */
-#define PDC_PDC_CTRL9_REG_PDC_MASTER_Msk (0x1800UL) /*!< PDC_MASTER (Bitfield-Mask: 0x03) */
-#define PDC_PDC_CTRL9_REG_EN_COM_Pos (10UL) /*!< EN_COM (Bit 10) */
-#define PDC_PDC_CTRL9_REG_EN_COM_Msk (0x400UL) /*!< EN_COM (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL9_REG_EN_PER_Pos (9UL) /*!< EN_PER (Bit 9) */
-#define PDC_PDC_CTRL9_REG_EN_PER_Msk (0x200UL) /*!< EN_PER (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL9_REG_EN_TMR_Pos (8UL) /*!< EN_TMR (Bit 8) */
-#define PDC_PDC_CTRL9_REG_EN_TMR_Msk (0x100UL) /*!< EN_TMR (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL9_REG_EN_XTAL_Pos (7UL) /*!< EN_XTAL (Bit 7) */
-#define PDC_PDC_CTRL9_REG_EN_XTAL_Msk (0x80UL) /*!< EN_XTAL (Bitfield-Mask: 0x01) */
-#define PDC_PDC_CTRL9_REG_TRIG_ID_Pos (2UL) /*!< TRIG_ID (Bit 2) */
-#define PDC_PDC_CTRL9_REG_TRIG_ID_Msk (0x7cUL) /*!< TRIG_ID (Bitfield-Mask: 0x1f) */
-#define PDC_PDC_CTRL9_REG_TRIG_SELECT_Pos (0UL) /*!< TRIG_SELECT (Bit 0) */
-#define PDC_PDC_CTRL9_REG_TRIG_SELECT_Msk (0x3UL) /*!< TRIG_SELECT (Bitfield-Mask: 0x03) */
-/* ================================================= PDC_PENDING_CM33_REG ================================================== */
-#define PDC_PDC_PENDING_CM33_REG_PDC_PENDING_Pos (0UL) /*!< PDC_PENDING (Bit 0) */
-#define PDC_PDC_PENDING_CM33_REG_PDC_PENDING_Msk (0xffffUL) /*!< PDC_PENDING (Bitfield-Mask: 0xffff) */
-/* ================================================= PDC_PENDING_CMAC_REG ================================================== */
-#define PDC_PDC_PENDING_CMAC_REG_PDC_PENDING_Pos (0UL) /*!< PDC_PENDING (Bit 0) */
-#define PDC_PDC_PENDING_CMAC_REG_PDC_PENDING_Msk (0xffffUL) /*!< PDC_PENDING (Bitfield-Mask: 0xffff) */
-/* ==================================================== PDC_PENDING_REG ==================================================== */
-#define PDC_PDC_PENDING_REG_PDC_PENDING_Pos (0UL) /*!< PDC_PENDING (Bit 0) */
-#define PDC_PDC_PENDING_REG_PDC_PENDING_Msk (0xffffUL) /*!< PDC_PENDING (Bitfield-Mask: 0xffff) */
-/* ================================================== PDC_PENDING_SNC_REG ================================================== */
-#define PDC_PDC_PENDING_SNC_REG_PDC_PENDING_Pos (0UL) /*!< PDC_PENDING (Bit 0) */
-#define PDC_PDC_PENDING_SNC_REG_PDC_PENDING_Msk (0xffffUL) /*!< PDC_PENDING (Bitfield-Mask: 0xffff) */
-/* ================================================== PDC_SET_PENDING_REG ================================================== */
-#define PDC_PDC_SET_PENDING_REG_PDC_SET_PENDING_Pos (0UL) /*!< PDC_SET_PENDING (Bit 0) */
-#define PDC_PDC_SET_PENDING_REG_PDC_SET_PENDING_Msk (0x1fUL) /*!< PDC_SET_PENDING (Bitfield-Mask: 0x1f) */
-
-
-/* =========================================================================================================================== */
-/* ================ PWMLED ================ */
-/* =========================================================================================================================== */
-
-/* ==================================================== PWMLED_CTRL_REG ==================================================== */
-#define PWMLED_PWMLED_CTRL_REG_LED2_LOAD_SEL_Pos (11UL) /*!< LED2_LOAD_SEL (Bit 11) */
-#define PWMLED_PWMLED_CTRL_REG_LED2_LOAD_SEL_Msk (0x3800UL) /*!< LED2_LOAD_SEL (Bitfield-Mask: 0x07) */
-#define PWMLED_PWMLED_CTRL_REG_LED1_LOAD_SEL_Pos (8UL) /*!< LED1_LOAD_SEL (Bit 8) */
-#define PWMLED_PWMLED_CTRL_REG_LED1_LOAD_SEL_Msk (0x700UL) /*!< LED1_LOAD_SEL (Bitfield-Mask: 0x07) */
-#define PWMLED_PWMLED_CTRL_REG_LED2_EN_Pos (7UL) /*!< LED2_EN (Bit 7) */
-#define PWMLED_PWMLED_CTRL_REG_LED2_EN_Msk (0x80UL) /*!< LED2_EN (Bitfield-Mask: 0x01) */
-#define PWMLED_PWMLED_CTRL_REG_LED1_EN_Pos (6UL) /*!< LED1_EN (Bit 6) */
-#define PWMLED_PWMLED_CTRL_REG_LED1_EN_Msk (0x40UL) /*!< LED1_EN (Bitfield-Mask: 0x01) */
-#define PWMLED_PWMLED_CTRL_REG_LED_TRIM_Pos (2UL) /*!< LED_TRIM (Bit 2) */
-#define PWMLED_PWMLED_CTRL_REG_LED_TRIM_Msk (0x3cUL) /*!< LED_TRIM (Bitfield-Mask: 0x0f) */
-#define PWMLED_PWMLED_CTRL_REG_SW_PAUSE_EN_Pos (1UL) /*!< SW_PAUSE_EN (Bit 1) */
-#define PWMLED_PWMLED_CTRL_REG_SW_PAUSE_EN_Msk (0x2UL) /*!< SW_PAUSE_EN (Bitfield-Mask: 0x01) */
-#define PWMLED_PWMLED_CTRL_REG_PWM_ENABLE_Pos (0UL) /*!< PWM_ENABLE (Bit 0) */
-#define PWMLED_PWMLED_CTRL_REG_PWM_ENABLE_Msk (0x1UL) /*!< PWM_ENABLE (Bitfield-Mask: 0x01) */
-/* ============================================== PWMLED_DUTY_CYCLE_LED1_REG =============================================== */
-#define PWMLED_PWMLED_DUTY_CYCLE_LED1_REG_LED1_PWM_START_CYCLE_Pos (8UL) /*!< LED1_PWM_START_CYCLE (Bit 8) */
-#define PWMLED_PWMLED_DUTY_CYCLE_LED1_REG_LED1_PWM_START_CYCLE_Msk (0xff00UL) /*!< LED1_PWM_START_CYCLE (Bitfield-Mask: 0xff) */
-#define PWMLED_PWMLED_DUTY_CYCLE_LED1_REG_LED1_PWM_END_CYCLE_Pos (0UL) /*!< LED1_PWM_END_CYCLE (Bit 0) */
-#define PWMLED_PWMLED_DUTY_CYCLE_LED1_REG_LED1_PWM_END_CYCLE_Msk (0xffUL) /*!< LED1_PWM_END_CYCLE (Bitfield-Mask: 0xff) */
-/* ============================================== PWMLED_DUTY_CYCLE_LED2_REG =============================================== */
-#define PWMLED_PWMLED_DUTY_CYCLE_LED2_REG_LED2_PWM_START_CYCLE_Pos (8UL) /*!< LED2_PWM_START_CYCLE (Bit 8) */
-#define PWMLED_PWMLED_DUTY_CYCLE_LED2_REG_LED2_PWM_START_CYCLE_Msk (0xff00UL) /*!< LED2_PWM_START_CYCLE (Bitfield-Mask: 0xff) */
-#define PWMLED_PWMLED_DUTY_CYCLE_LED2_REG_LED2_PWM_END_CYCLE_Pos (0UL) /*!< LED2_PWM_END_CYCLE (Bit 0) */
-#define PWMLED_PWMLED_DUTY_CYCLE_LED2_REG_LED2_PWM_END_CYCLE_Msk (0xffUL) /*!< LED2_PWM_END_CYCLE (Bitfield-Mask: 0xff) */
-/* ================================================= PWMLED_FREQUENCY_REG ================================================== */
-#define PWMLED_PWMLED_FREQUENCY_REG_LED_PWM_FREQUENCY_Pos (0UL) /*!< LED_PWM_FREQUENCY (Bit 0) */
-#define PWMLED_PWMLED_FREQUENCY_REG_LED_PWM_FREQUENCY_Msk (0xffUL) /*!< LED_PWM_FREQUENCY (Bitfield-Mask: 0xff) */
-
-
-/* =========================================================================================================================== */
-/* ================ QSPIC ================ */
-/* =========================================================================================================================== */
-
-/* ================================================== QSPIC_BURSTBRK_REG =================================================== */
-#define QSPIC_QSPIC_BURSTBRK_REG_QSPIC_SEC_HF_DS_Pos (20UL) /*!< QSPIC_SEC_HF_DS (Bit 20) */
-#define QSPIC_QSPIC_BURSTBRK_REG_QSPIC_SEC_HF_DS_Msk (0x100000UL) /*!< QSPIC_SEC_HF_DS (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_BURSTBRK_REG_QSPIC_BRK_TX_MD_Pos (18UL) /*!< QSPIC_BRK_TX_MD (Bit 18) */
-#define QSPIC_QSPIC_BURSTBRK_REG_QSPIC_BRK_TX_MD_Msk (0xc0000UL) /*!< QSPIC_BRK_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_BURSTBRK_REG_QSPIC_BRK_SZ_Pos (17UL) /*!< QSPIC_BRK_SZ (Bit 17) */
-#define QSPIC_QSPIC_BURSTBRK_REG_QSPIC_BRK_SZ_Msk (0x20000UL) /*!< QSPIC_BRK_SZ (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_BURSTBRK_REG_QSPIC_BRK_EN_Pos (16UL) /*!< QSPIC_BRK_EN (Bit 16) */
-#define QSPIC_QSPIC_BURSTBRK_REG_QSPIC_BRK_EN_Msk (0x10000UL) /*!< QSPIC_BRK_EN (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_BURSTBRK_REG_QSPIC_BRK_WRD_Pos (0UL) /*!< QSPIC_BRK_WRD (Bit 0) */
-#define QSPIC_QSPIC_BURSTBRK_REG_QSPIC_BRK_WRD_Msk (0xffffUL) /*!< QSPIC_BRK_WRD (Bitfield-Mask: 0xffff) */
-/* ================================================== QSPIC_BURSTCMDA_REG ================================================== */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_DMY_TX_MD_Pos (30UL) /*!< QSPIC_DMY_TX_MD (Bit 30) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_DMY_TX_MD_Msk (0xc0000000UL) /*!< QSPIC_DMY_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_EXT_TX_MD_Pos (28UL) /*!< QSPIC_EXT_TX_MD (Bit 28) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_EXT_TX_MD_Msk (0x30000000UL) /*!< QSPIC_EXT_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_ADR_TX_MD_Pos (26UL) /*!< QSPIC_ADR_TX_MD (Bit 26) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_ADR_TX_MD_Msk (0xc000000UL) /*!< QSPIC_ADR_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_INST_TX_MD_Pos (24UL) /*!< QSPIC_INST_TX_MD (Bit 24) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_INST_TX_MD_Msk (0x3000000UL) /*!< QSPIC_INST_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_EXT_BYTE_Pos (16UL) /*!< QSPIC_EXT_BYTE (Bit 16) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_EXT_BYTE_Msk (0xff0000UL) /*!< QSPIC_EXT_BYTE (Bitfield-Mask: 0xff) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_INST_WB_Pos (8UL) /*!< QSPIC_INST_WB (Bit 8) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_INST_WB_Msk (0xff00UL) /*!< QSPIC_INST_WB (Bitfield-Mask: 0xff) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_INST_Pos (0UL) /*!< QSPIC_INST (Bit 0) */
-#define QSPIC_QSPIC_BURSTCMDA_REG_QSPIC_INST_Msk (0xffUL) /*!< QSPIC_INST (Bitfield-Mask: 0xff) */
-/* ================================================== QSPIC_BURSTCMDB_REG ================================================== */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_DMY_FORCE_Pos (15UL) /*!< QSPIC_DMY_FORCE (Bit 15) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_DMY_FORCE_Msk (0x8000UL) /*!< QSPIC_DMY_FORCE (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_CS_HIGH_MIN_Pos (12UL) /*!< QSPIC_CS_HIGH_MIN (Bit 12) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_CS_HIGH_MIN_Msk (0x7000UL) /*!< QSPIC_CS_HIGH_MIN (Bitfield-Mask: 0x07) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_WRAP_SIZE_Pos (10UL) /*!< QSPIC_WRAP_SIZE (Bit 10) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_WRAP_SIZE_Msk (0xc00UL) /*!< QSPIC_WRAP_SIZE (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_WRAP_LEN_Pos (8UL) /*!< QSPIC_WRAP_LEN (Bit 8) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_WRAP_LEN_Msk (0x300UL) /*!< QSPIC_WRAP_LEN (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_WRAP_MD_Pos (7UL) /*!< QSPIC_WRAP_MD (Bit 7) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_WRAP_MD_Msk (0x80UL) /*!< QSPIC_WRAP_MD (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_INST_MD_Pos (6UL) /*!< QSPIC_INST_MD (Bit 6) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_INST_MD_Msk (0x40UL) /*!< QSPIC_INST_MD (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_DMY_NUM_Pos (4UL) /*!< QSPIC_DMY_NUM (Bit 4) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_DMY_NUM_Msk (0x30UL) /*!< QSPIC_DMY_NUM (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_EXT_HF_DS_Pos (3UL) /*!< QSPIC_EXT_HF_DS (Bit 3) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_EXT_HF_DS_Msk (0x8UL) /*!< QSPIC_EXT_HF_DS (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_EXT_BYTE_EN_Pos (2UL) /*!< QSPIC_EXT_BYTE_EN (Bit 2) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_EXT_BYTE_EN_Msk (0x4UL) /*!< QSPIC_EXT_BYTE_EN (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_DAT_RX_MD_Pos (0UL) /*!< QSPIC_DAT_RX_MD (Bit 0) */
-#define QSPIC_QSPIC_BURSTCMDB_REG_QSPIC_DAT_RX_MD_Msk (0x3UL) /*!< QSPIC_DAT_RX_MD (Bitfield-Mask: 0x03) */
-/* ================================================== QSPIC_CHCKERASE_REG ================================================== */
-#define QSPIC_QSPIC_CHCKERASE_REG_QSPIC_CHCKERASE_Pos (0UL) /*!< QSPIC_CHCKERASE (Bit 0) */
-#define QSPIC_QSPIC_CHCKERASE_REG_QSPIC_CHCKERASE_Msk (0xffffffffUL) /*!< QSPIC_CHCKERASE (Bitfield-Mask: 0xffffffff) */
-/* =================================================== QSPIC_CTRLBUS_REG =================================================== */
-#define QSPIC_QSPIC_CTRLBUS_REG_QSPIC_DIS_CS_Pos (4UL) /*!< QSPIC_DIS_CS (Bit 4) */
-#define QSPIC_QSPIC_CTRLBUS_REG_QSPIC_DIS_CS_Msk (0x10UL) /*!< QSPIC_DIS_CS (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLBUS_REG_QSPIC_EN_CS_Pos (3UL) /*!< QSPIC_EN_CS (Bit 3) */
-#define QSPIC_QSPIC_CTRLBUS_REG_QSPIC_EN_CS_Msk (0x8UL) /*!< QSPIC_EN_CS (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLBUS_REG_QSPIC_SET_QUAD_Pos (2UL) /*!< QSPIC_SET_QUAD (Bit 2) */
-#define QSPIC_QSPIC_CTRLBUS_REG_QSPIC_SET_QUAD_Msk (0x4UL) /*!< QSPIC_SET_QUAD (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLBUS_REG_QSPIC_SET_DUAL_Pos (1UL) /*!< QSPIC_SET_DUAL (Bit 1) */
-#define QSPIC_QSPIC_CTRLBUS_REG_QSPIC_SET_DUAL_Msk (0x2UL) /*!< QSPIC_SET_DUAL (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLBUS_REG_QSPIC_SET_SINGLE_Pos (0UL) /*!< QSPIC_SET_SINGLE (Bit 0) */
-#define QSPIC_QSPIC_CTRLBUS_REG_QSPIC_SET_SINGLE_Msk (0x1UL) /*!< QSPIC_SET_SINGLE (Bitfield-Mask: 0x01) */
-/* ================================================== QSPIC_CTRLMODE_REG =================================================== */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_USE_32BA_Pos (13UL) /*!< QSPIC_USE_32BA (Bit 13) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_USE_32BA_Msk (0x2000UL) /*!< QSPIC_USE_32BA (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_BUF_LIM_EN_Pos (12UL) /*!< QSPIC_BUF_LIM_EN (Bit 12) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_BUF_LIM_EN_Msk (0x1000UL) /*!< QSPIC_BUF_LIM_EN (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_PCLK_MD_Pos (9UL) /*!< QSPIC_PCLK_MD (Bit 9) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_PCLK_MD_Msk (0xe00UL) /*!< QSPIC_PCLK_MD (Bitfield-Mask: 0x07) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_RPIPE_EN_Pos (8UL) /*!< QSPIC_RPIPE_EN (Bit 8) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_RPIPE_EN_Msk (0x100UL) /*!< QSPIC_RPIPE_EN (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_RXD_NEG_Pos (7UL) /*!< QSPIC_RXD_NEG (Bit 7) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_RXD_NEG_Msk (0x80UL) /*!< QSPIC_RXD_NEG (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_HRDY_MD_Pos (6UL) /*!< QSPIC_HRDY_MD (Bit 6) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_HRDY_MD_Msk (0x40UL) /*!< QSPIC_HRDY_MD (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_IO3_DAT_Pos (5UL) /*!< QSPIC_IO3_DAT (Bit 5) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_IO3_DAT_Msk (0x20UL) /*!< QSPIC_IO3_DAT (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_IO2_DAT_Pos (4UL) /*!< QSPIC_IO2_DAT (Bit 4) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_IO2_DAT_Msk (0x10UL) /*!< QSPIC_IO2_DAT (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_IO3_OEN_Pos (3UL) /*!< QSPIC_IO3_OEN (Bit 3) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_IO3_OEN_Msk (0x8UL) /*!< QSPIC_IO3_OEN (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_IO2_OEN_Pos (2UL) /*!< QSPIC_IO2_OEN (Bit 2) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_IO2_OEN_Msk (0x4UL) /*!< QSPIC_IO2_OEN (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_CLK_MD_Pos (1UL) /*!< QSPIC_CLK_MD (Bit 1) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_CLK_MD_Msk (0x2UL) /*!< QSPIC_CLK_MD (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_AUTO_MD_Pos (0UL) /*!< QSPIC_AUTO_MD (Bit 0) */
-#define QSPIC_QSPIC_CTRLMODE_REG_QSPIC_AUTO_MD_Msk (0x1UL) /*!< QSPIC_AUTO_MD (Bitfield-Mask: 0x01) */
-/* ================================================== QSPIC_CTR_CTRL_REG =================================================== */
-#define QSPIC_QSPIC_CTR_CTRL_REG_QSPIC_CTR_EN_Pos (0UL) /*!< QSPIC_CTR_EN (Bit 0) */
-#define QSPIC_QSPIC_CTR_CTRL_REG_QSPIC_CTR_EN_Msk (0x1UL) /*!< QSPIC_CTR_EN (Bitfield-Mask: 0x01) */
-/* ================================================== QSPIC_CTR_EADDR_REG ================================================== */
-#define QSPIC_QSPIC_CTR_EADDR_REG_QSPIC_CTR_EADDR_Pos (10UL) /*!< QSPIC_CTR_EADDR (Bit 10) */
-#define QSPIC_QSPIC_CTR_EADDR_REG_QSPIC_CTR_EADDR_Msk (0xfffffc00UL) /*!< QSPIC_CTR_EADDR (Bitfield-Mask: 0x3fffff) */
-/* ================================================= QSPIC_CTR_KEY_0_3_REG ================================================= */
-#define QSPIC_QSPIC_CTR_KEY_0_3_REG_QSPIC_CTR_KEY_0_3_Pos (0UL) /*!< QSPIC_CTR_KEY_0_3 (Bit 0) */
-#define QSPIC_QSPIC_CTR_KEY_0_3_REG_QSPIC_CTR_KEY_0_3_Msk (0xffffffffUL) /*!< QSPIC_CTR_KEY_0_3 (Bitfield-Mask: 0xffffffff) */
-/* ================================================ QSPIC_CTR_KEY_12_15_REG ================================================ */
-#define QSPIC_QSPIC_CTR_KEY_12_15_REG_QSPIC_CTR_KEY_12_15_Pos (0UL) /*!< QSPIC_CTR_KEY_12_15 (Bit 0) */
-#define QSPIC_QSPIC_CTR_KEY_12_15_REG_QSPIC_CTR_KEY_12_15_Msk (0xffffffffUL) /*!< QSPIC_CTR_KEY_12_15 (Bitfield-Mask: 0xffffffff) */
-/* ================================================ QSPIC_CTR_KEY_16_19_REG ================================================ */
-#define QSPIC_QSPIC_CTR_KEY_16_19_REG_QSPIC_CTR_KEY_16_19_Pos (0UL) /*!< QSPIC_CTR_KEY_16_19 (Bit 0) */
-#define QSPIC_QSPIC_CTR_KEY_16_19_REG_QSPIC_CTR_KEY_16_19_Msk (0xffffffffUL) /*!< QSPIC_CTR_KEY_16_19 (Bitfield-Mask: 0xffffffff) */
-/* ================================================ QSPIC_CTR_KEY_20_23_REG ================================================ */
-#define QSPIC_QSPIC_CTR_KEY_20_23_REG_QSPIC_CTR_KEY_20_23_Pos (0UL) /*!< QSPIC_CTR_KEY_20_23 (Bit 0) */
-#define QSPIC_QSPIC_CTR_KEY_20_23_REG_QSPIC_CTR_KEY_20_23_Msk (0xffffffffUL) /*!< QSPIC_CTR_KEY_20_23 (Bitfield-Mask: 0xffffffff) */
-/* ================================================ QSPIC_CTR_KEY_24_27_REG ================================================ */
-#define QSPIC_QSPIC_CTR_KEY_24_27_REG_QSPIC_CTR_KEY_24_27_Pos (0UL) /*!< QSPIC_CTR_KEY_24_27 (Bit 0) */
-#define QSPIC_QSPIC_CTR_KEY_24_27_REG_QSPIC_CTR_KEY_24_27_Msk (0xffffffffUL) /*!< QSPIC_CTR_KEY_24_27 (Bitfield-Mask: 0xffffffff) */
-/* ================================================ QSPIC_CTR_KEY_28_31_REG ================================================ */
-#define QSPIC_QSPIC_CTR_KEY_28_31_REG_QSPIC_CTR_KEY_28_31_Pos (0UL) /*!< QSPIC_CTR_KEY_28_31 (Bit 0) */
-#define QSPIC_QSPIC_CTR_KEY_28_31_REG_QSPIC_CTR_KEY_28_31_Msk (0xffffffffUL) /*!< QSPIC_CTR_KEY_28_31 (Bitfield-Mask: 0xffffffff) */
-/* ================================================= QSPIC_CTR_KEY_4_7_REG ================================================= */
-#define QSPIC_QSPIC_CTR_KEY_4_7_REG_QSPIC_CTR_KEY_4_7_Pos (0UL) /*!< QSPIC_CTR_KEY_4_7 (Bit 0) */
-#define QSPIC_QSPIC_CTR_KEY_4_7_REG_QSPIC_CTR_KEY_4_7_Msk (0xffffffffUL) /*!< QSPIC_CTR_KEY_4_7 (Bitfield-Mask: 0xffffffff) */
-/* ================================================ QSPIC_CTR_KEY_8_11_REG ================================================= */
-#define QSPIC_QSPIC_CTR_KEY_8_11_REG_QSPIC_CTR_KEY_8_11_Pos (0UL) /*!< QSPIC_CTR_KEY_8_11 (Bit 0) */
-#define QSPIC_QSPIC_CTR_KEY_8_11_REG_QSPIC_CTR_KEY_8_11_Msk (0xffffffffUL) /*!< QSPIC_CTR_KEY_8_11 (Bitfield-Mask: 0xffffffff) */
-/* ================================================ QSPIC_CTR_NONCE_0_3_REG ================================================ */
-#define QSPIC_QSPIC_CTR_NONCE_0_3_REG_QSPIC_CTR_NONCE_0_3_Pos (0UL) /*!< QSPIC_CTR_NONCE_0_3 (Bit 0) */
-#define QSPIC_QSPIC_CTR_NONCE_0_3_REG_QSPIC_CTR_NONCE_0_3_Msk (0xffffffffUL) /*!< QSPIC_CTR_NONCE_0_3 (Bitfield-Mask: 0xffffffff) */
-/* ================================================ QSPIC_CTR_NONCE_4_7_REG ================================================ */
-#define QSPIC_QSPIC_CTR_NONCE_4_7_REG_QSPIC_CTR_NONCE_4_7_Pos (0UL) /*!< QSPIC_CTR_NONCE_4_7 (Bit 0) */
-#define QSPIC_QSPIC_CTR_NONCE_4_7_REG_QSPIC_CTR_NONCE_4_7_Msk (0xffffffffUL) /*!< QSPIC_CTR_NONCE_4_7 (Bitfield-Mask: 0xffffffff) */
-/* ================================================== QSPIC_CTR_SADDR_REG ================================================== */
-#define QSPIC_QSPIC_CTR_SADDR_REG_QSPIC_CTR_SADDR_Pos (10UL) /*!< QSPIC_CTR_SADDR (Bit 10) */
-#define QSPIC_QSPIC_CTR_SADDR_REG_QSPIC_CTR_SADDR_Msk (0xfffffc00UL) /*!< QSPIC_CTR_SADDR (Bitfield-Mask: 0x3fffff) */
-/* ================================================== QSPIC_DUMMYDATA_REG ================================================== */
-#define QSPIC_QSPIC_DUMMYDATA_REG_QSPIC_DUMMYDATA_Pos (0UL) /*!< QSPIC_DUMMYDATA (Bit 0) */
-#define QSPIC_QSPIC_DUMMYDATA_REG_QSPIC_DUMMYDATA_Msk (0xffffffffUL) /*!< QSPIC_DUMMYDATA (Bitfield-Mask: 0xffffffff) */
-/* ================================================== QSPIC_ERASECMDA_REG ================================================== */
-#define QSPIC_QSPIC_ERASECMDA_REG_QSPIC_RES_INST_Pos (24UL) /*!< QSPIC_RES_INST (Bit 24) */
-#define QSPIC_QSPIC_ERASECMDA_REG_QSPIC_RES_INST_Msk (0xff000000UL) /*!< QSPIC_RES_INST (Bitfield-Mask: 0xff) */
-#define QSPIC_QSPIC_ERASECMDA_REG_QSPIC_SUS_INST_Pos (16UL) /*!< QSPIC_SUS_INST (Bit 16) */
-#define QSPIC_QSPIC_ERASECMDA_REG_QSPIC_SUS_INST_Msk (0xff0000UL) /*!< QSPIC_SUS_INST (Bitfield-Mask: 0xff) */
-#define QSPIC_QSPIC_ERASECMDA_REG_QSPIC_WEN_INST_Pos (8UL) /*!< QSPIC_WEN_INST (Bit 8) */
-#define QSPIC_QSPIC_ERASECMDA_REG_QSPIC_WEN_INST_Msk (0xff00UL) /*!< QSPIC_WEN_INST (Bitfield-Mask: 0xff) */
-#define QSPIC_QSPIC_ERASECMDA_REG_QSPIC_ERS_INST_Pos (0UL) /*!< QSPIC_ERS_INST (Bit 0) */
-#define QSPIC_QSPIC_ERASECMDA_REG_QSPIC_ERS_INST_Msk (0xffUL) /*!< QSPIC_ERS_INST (Bitfield-Mask: 0xff) */
-/* ================================================== QSPIC_ERASECMDB_REG ================================================== */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_RESSUS_DLY_Pos (24UL) /*!< QSPIC_RESSUS_DLY (Bit 24) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_RESSUS_DLY_Msk (0x3f000000UL) /*!< QSPIC_RESSUS_DLY (Bitfield-Mask: 0x3f) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_ERSRES_HLD_Pos (16UL) /*!< QSPIC_ERSRES_HLD (Bit 16) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_ERSRES_HLD_Msk (0xf0000UL) /*!< QSPIC_ERSRES_HLD (Bitfield-Mask: 0x0f) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_ERS_CS_HI_Pos (10UL) /*!< QSPIC_ERS_CS_HI (Bit 10) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_ERS_CS_HI_Msk (0x7c00UL) /*!< QSPIC_ERS_CS_HI (Bitfield-Mask: 0x1f) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_EAD_TX_MD_Pos (8UL) /*!< QSPIC_EAD_TX_MD (Bit 8) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_EAD_TX_MD_Msk (0x300UL) /*!< QSPIC_EAD_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_RES_TX_MD_Pos (6UL) /*!< QSPIC_RES_TX_MD (Bit 6) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_RES_TX_MD_Msk (0xc0UL) /*!< QSPIC_RES_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_SUS_TX_MD_Pos (4UL) /*!< QSPIC_SUS_TX_MD (Bit 4) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_SUS_TX_MD_Msk (0x30UL) /*!< QSPIC_SUS_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_WEN_TX_MD_Pos (2UL) /*!< QSPIC_WEN_TX_MD (Bit 2) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_WEN_TX_MD_Msk (0xcUL) /*!< QSPIC_WEN_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_ERS_TX_MD_Pos (0UL) /*!< QSPIC_ERS_TX_MD (Bit 0) */
-#define QSPIC_QSPIC_ERASECMDB_REG_QSPIC_ERS_TX_MD_Msk (0x3UL) /*!< QSPIC_ERS_TX_MD (Bitfield-Mask: 0x03) */
-/* ================================================== QSPIC_ERASECTRL_REG ================================================== */
-#define QSPIC_QSPIC_ERASECTRL_REG_QSPIC_ERS_STATE_Pos (25UL) /*!< QSPIC_ERS_STATE (Bit 25) */
-#define QSPIC_QSPIC_ERASECTRL_REG_QSPIC_ERS_STATE_Msk (0xe000000UL) /*!< QSPIC_ERS_STATE (Bitfield-Mask: 0x07) */
-#define QSPIC_QSPIC_ERASECTRL_REG_QSPIC_ERASE_EN_Pos (24UL) /*!< QSPIC_ERASE_EN (Bit 24) */
-#define QSPIC_QSPIC_ERASECTRL_REG_QSPIC_ERASE_EN_Msk (0x1000000UL) /*!< QSPIC_ERASE_EN (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_ERASECTRL_REG_QSPIC_ERS_ADDR_Pos (4UL) /*!< QSPIC_ERS_ADDR (Bit 4) */
-#define QSPIC_QSPIC_ERASECTRL_REG_QSPIC_ERS_ADDR_Msk (0xfffff0UL) /*!< QSPIC_ERS_ADDR (Bitfield-Mask: 0xfffff) */
-/* ===================================================== QSPIC_GP_REG ====================================================== */
-#define QSPIC_QSPIC_GP_REG_QSPIC_PADS_SLEW_Pos (3UL) /*!< QSPIC_PADS_SLEW (Bit 3) */
-#define QSPIC_QSPIC_GP_REG_QSPIC_PADS_SLEW_Msk (0x18UL) /*!< QSPIC_PADS_SLEW (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_GP_REG_QSPIC_PADS_DRV_Pos (1UL) /*!< QSPIC_PADS_DRV (Bit 1) */
-#define QSPIC_QSPIC_GP_REG_QSPIC_PADS_DRV_Msk (0x6UL) /*!< QSPIC_PADS_DRV (Bitfield-Mask: 0x03) */
-/* ================================================== QSPIC_READDATA_REG =================================================== */
-#define QSPIC_QSPIC_READDATA_REG_QSPIC_READDATA_Pos (0UL) /*!< QSPIC_READDATA (Bit 0) */
-#define QSPIC_QSPIC_READDATA_REG_QSPIC_READDATA_Msk (0xffffffffUL) /*!< QSPIC_READDATA (Bitfield-Mask: 0xffffffff) */
-/* ================================================== QSPIC_RECVDATA_REG =================================================== */
-#define QSPIC_QSPIC_RECVDATA_REG_QSPIC_RECVDATA_Pos (0UL) /*!< QSPIC_RECVDATA (Bit 0) */
-#define QSPIC_QSPIC_RECVDATA_REG_QSPIC_RECVDATA_Msk (0xffffffffUL) /*!< QSPIC_RECVDATA (Bitfield-Mask: 0xffffffff) */
-/* ================================================== QSPIC_STATUSCMD_REG ================================================== */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_STSDLY_SEL_Pos (22UL) /*!< QSPIC_STSDLY_SEL (Bit 22) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_STSDLY_SEL_Msk (0x400000UL) /*!< QSPIC_STSDLY_SEL (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_RESSTS_DLY_Pos (16UL) /*!< QSPIC_RESSTS_DLY (Bit 16) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_RESSTS_DLY_Msk (0x3f0000UL) /*!< QSPIC_RESSTS_DLY (Bitfield-Mask: 0x3f) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_BUSY_VAL_Pos (15UL) /*!< QSPIC_BUSY_VAL (Bit 15) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_BUSY_VAL_Msk (0x8000UL) /*!< QSPIC_BUSY_VAL (Bitfield-Mask: 0x01) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_BUSY_POS_Pos (12UL) /*!< QSPIC_BUSY_POS (Bit 12) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_BUSY_POS_Msk (0x7000UL) /*!< QSPIC_BUSY_POS (Bitfield-Mask: 0x07) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_RSTAT_RX_MD_Pos (10UL) /*!< QSPIC_RSTAT_RX_MD (Bit 10) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_RSTAT_RX_MD_Msk (0xc00UL) /*!< QSPIC_RSTAT_RX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_RSTAT_TX_MD_Pos (8UL) /*!< QSPIC_RSTAT_TX_MD (Bit 8) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_RSTAT_TX_MD_Msk (0x300UL) /*!< QSPIC_RSTAT_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_RSTAT_INST_Pos (0UL) /*!< QSPIC_RSTAT_INST (Bit 0) */
-#define QSPIC_QSPIC_STATUSCMD_REG_QSPIC_RSTAT_INST_Msk (0xffUL) /*!< QSPIC_RSTAT_INST (Bitfield-Mask: 0xff) */
-/* =================================================== QSPIC_STATUS_REG ==================================================== */
-#define QSPIC_QSPIC_STATUS_REG_QSPIC_BUSY_Pos (0UL) /*!< QSPIC_BUSY (Bit 0) */
-#define QSPIC_QSPIC_STATUS_REG_QSPIC_BUSY_Msk (0x1UL) /*!< QSPIC_BUSY (Bitfield-Mask: 0x01) */
-/* =================================================== QSPIC_UCODE_START =================================================== */
-#define QSPIC_QSPIC_UCODE_START_QSPIC_UCODE_X_Pos (0UL) /*!< QSPIC_UCODE_X (Bit 0) */
-#define QSPIC_QSPIC_UCODE_START_QSPIC_UCODE_X_Msk (0xffffffffUL) /*!< QSPIC_UCODE_X (Bitfield-Mask: 0xffffffff) */
-/* ================================================== QSPIC_WRITEDATA_REG ================================================== */
-#define QSPIC_QSPIC_WRITEDATA_REG_QSPIC_WRITEDATA_Pos (0UL) /*!< QSPIC_WRITEDATA (Bit 0) */
-#define QSPIC_QSPIC_WRITEDATA_REG_QSPIC_WRITEDATA_Msk (0xffffffffUL) /*!< QSPIC_WRITEDATA (Bitfield-Mask: 0xffffffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ QSPIC2 ================ */
-/* =========================================================================================================================== */
-
-/* ================================================= QSPIC2_AWRITECMD_REG ================================================== */
-#define QSPIC2_QSPIC2_AWRITECMD_REG_QSPIC_WR_CS_HIGH_MIN_Pos (14UL) /*!< QSPIC_WR_CS_HIGH_MIN (Bit 14) */
-#define QSPIC2_QSPIC2_AWRITECMD_REG_QSPIC_WR_CS_HIGH_MIN_Msk (0x7c000UL) /*!< QSPIC_WR_CS_HIGH_MIN (Bitfield-Mask: 0x1f) */
-#define QSPIC2_QSPIC2_AWRITECMD_REG_QSPIC_WR_DAT_TX_MD_Pos (12UL) /*!< QSPIC_WR_DAT_TX_MD (Bit 12) */
-#define QSPIC2_QSPIC2_AWRITECMD_REG_QSPIC_WR_DAT_TX_MD_Msk (0x3000UL) /*!< QSPIC_WR_DAT_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_AWRITECMD_REG_QSPIC_WR_ADR_TX_MD_Pos (10UL) /*!< QSPIC_WR_ADR_TX_MD (Bit 10) */
-#define QSPIC2_QSPIC2_AWRITECMD_REG_QSPIC_WR_ADR_TX_MD_Msk (0xc00UL) /*!< QSPIC_WR_ADR_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_AWRITECMD_REG_QSPIC_WR_INST_TX_MD_Pos (8UL) /*!< QSPIC_WR_INST_TX_MD (Bit 8) */
-#define QSPIC2_QSPIC2_AWRITECMD_REG_QSPIC_WR_INST_TX_MD_Msk (0x300UL) /*!< QSPIC_WR_INST_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_AWRITECMD_REG_QSPIC_WR_INST_Pos (0UL) /*!< QSPIC_WR_INST (Bit 0) */
-#define QSPIC2_QSPIC2_AWRITECMD_REG_QSPIC_WR_INST_Msk (0xffUL) /*!< QSPIC_WR_INST (Bitfield-Mask: 0xff) */
-/* ================================================== QSPIC2_BURSTBRK_REG ================================================== */
-#define QSPIC2_QSPIC2_BURSTBRK_REG_QSPIC_SEC_HF_DS_Pos (20UL) /*!< QSPIC_SEC_HF_DS (Bit 20) */
-#define QSPIC2_QSPIC2_BURSTBRK_REG_QSPIC_SEC_HF_DS_Msk (0x100000UL) /*!< QSPIC_SEC_HF_DS (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_BURSTBRK_REG_QSPIC_BRK_TX_MD_Pos (18UL) /*!< QSPIC_BRK_TX_MD (Bit 18) */
-#define QSPIC2_QSPIC2_BURSTBRK_REG_QSPIC_BRK_TX_MD_Msk (0xc0000UL) /*!< QSPIC_BRK_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_BURSTBRK_REG_QSPIC_BRK_SZ_Pos (17UL) /*!< QSPIC_BRK_SZ (Bit 17) */
-#define QSPIC2_QSPIC2_BURSTBRK_REG_QSPIC_BRK_SZ_Msk (0x20000UL) /*!< QSPIC_BRK_SZ (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_BURSTBRK_REG_QSPIC_BRK_EN_Pos (16UL) /*!< QSPIC_BRK_EN (Bit 16) */
-#define QSPIC2_QSPIC2_BURSTBRK_REG_QSPIC_BRK_EN_Msk (0x10000UL) /*!< QSPIC_BRK_EN (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_BURSTBRK_REG_QSPIC_BRK_WRD_Pos (0UL) /*!< QSPIC_BRK_WRD (Bit 0) */
-#define QSPIC2_QSPIC2_BURSTBRK_REG_QSPIC_BRK_WRD_Msk (0xffffUL) /*!< QSPIC_BRK_WRD (Bitfield-Mask: 0xffff) */
-/* ================================================= QSPIC2_BURSTCMDA_REG ================================================== */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_DMY_TX_MD_Pos (30UL) /*!< QSPIC_DMY_TX_MD (Bit 30) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_DMY_TX_MD_Msk (0xc0000000UL) /*!< QSPIC_DMY_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_EXT_TX_MD_Pos (28UL) /*!< QSPIC_EXT_TX_MD (Bit 28) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_EXT_TX_MD_Msk (0x30000000UL) /*!< QSPIC_EXT_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_ADR_TX_MD_Pos (26UL) /*!< QSPIC_ADR_TX_MD (Bit 26) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_ADR_TX_MD_Msk (0xc000000UL) /*!< QSPIC_ADR_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_INST_TX_MD_Pos (24UL) /*!< QSPIC_INST_TX_MD (Bit 24) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_INST_TX_MD_Msk (0x3000000UL) /*!< QSPIC_INST_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_EXT_BYTE_Pos (16UL) /*!< QSPIC_EXT_BYTE (Bit 16) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_EXT_BYTE_Msk (0xff0000UL) /*!< QSPIC_EXT_BYTE (Bitfield-Mask: 0xff) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_INST_WB_Pos (8UL) /*!< QSPIC_INST_WB (Bit 8) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_INST_WB_Msk (0xff00UL) /*!< QSPIC_INST_WB (Bitfield-Mask: 0xff) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_INST_Pos (0UL) /*!< QSPIC_INST (Bit 0) */
-#define QSPIC2_QSPIC2_BURSTCMDA_REG_QSPIC_INST_Msk (0xffUL) /*!< QSPIC_INST (Bitfield-Mask: 0xff) */
-/* ================================================= QSPIC2_BURSTCMDB_REG ================================================== */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_DMY_FORCE_Pos (15UL) /*!< QSPIC_DMY_FORCE (Bit 15) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_DMY_FORCE_Msk (0x8000UL) /*!< QSPIC_DMY_FORCE (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_CS_HIGH_MIN_Pos (12UL) /*!< QSPIC_CS_HIGH_MIN (Bit 12) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_CS_HIGH_MIN_Msk (0x7000UL) /*!< QSPIC_CS_HIGH_MIN (Bitfield-Mask: 0x07) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_WRAP_SIZE_Pos (10UL) /*!< QSPIC_WRAP_SIZE (Bit 10) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_WRAP_SIZE_Msk (0xc00UL) /*!< QSPIC_WRAP_SIZE (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_WRAP_LEN_Pos (8UL) /*!< QSPIC_WRAP_LEN (Bit 8) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_WRAP_LEN_Msk (0x300UL) /*!< QSPIC_WRAP_LEN (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_WRAP_MD_Pos (7UL) /*!< QSPIC_WRAP_MD (Bit 7) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_WRAP_MD_Msk (0x80UL) /*!< QSPIC_WRAP_MD (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_INST_MD_Pos (6UL) /*!< QSPIC_INST_MD (Bit 6) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_INST_MD_Msk (0x40UL) /*!< QSPIC_INST_MD (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_DMY_NUM_Pos (4UL) /*!< QSPIC_DMY_NUM (Bit 4) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_DMY_NUM_Msk (0x30UL) /*!< QSPIC_DMY_NUM (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_EXT_HF_DS_Pos (3UL) /*!< QSPIC_EXT_HF_DS (Bit 3) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_EXT_HF_DS_Msk (0x8UL) /*!< QSPIC_EXT_HF_DS (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_EXT_BYTE_EN_Pos (2UL) /*!< QSPIC_EXT_BYTE_EN (Bit 2) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_EXT_BYTE_EN_Msk (0x4UL) /*!< QSPIC_EXT_BYTE_EN (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_DAT_RX_MD_Pos (0UL) /*!< QSPIC_DAT_RX_MD (Bit 0) */
-#define QSPIC2_QSPIC2_BURSTCMDB_REG_QSPIC_DAT_RX_MD_Msk (0x3UL) /*!< QSPIC_DAT_RX_MD (Bitfield-Mask: 0x03) */
-/* ================================================= QSPIC2_CHCKERASE_REG ================================================== */
-#define QSPIC2_QSPIC2_CHCKERASE_REG_QSPIC_CHCKERASE_Pos (0UL) /*!< QSPIC_CHCKERASE (Bit 0) */
-#define QSPIC2_QSPIC2_CHCKERASE_REG_QSPIC_CHCKERASE_Msk (0xffffffffUL) /*!< QSPIC_CHCKERASE (Bitfield-Mask: 0xffffffff) */
-/* ================================================== QSPIC2_CTRLBUS_REG =================================================== */
-#define QSPIC2_QSPIC2_CTRLBUS_REG_QSPIC_DIS_CS_Pos (4UL) /*!< QSPIC_DIS_CS (Bit 4) */
-#define QSPIC2_QSPIC2_CTRLBUS_REG_QSPIC_DIS_CS_Msk (0x10UL) /*!< QSPIC_DIS_CS (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLBUS_REG_QSPIC_EN_CS_Pos (3UL) /*!< QSPIC_EN_CS (Bit 3) */
-#define QSPIC2_QSPIC2_CTRLBUS_REG_QSPIC_EN_CS_Msk (0x8UL) /*!< QSPIC_EN_CS (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLBUS_REG_QSPIC_SET_QUAD_Pos (2UL) /*!< QSPIC_SET_QUAD (Bit 2) */
-#define QSPIC2_QSPIC2_CTRLBUS_REG_QSPIC_SET_QUAD_Msk (0x4UL) /*!< QSPIC_SET_QUAD (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLBUS_REG_QSPIC_SET_DUAL_Pos (1UL) /*!< QSPIC_SET_DUAL (Bit 1) */
-#define QSPIC2_QSPIC2_CTRLBUS_REG_QSPIC_SET_DUAL_Msk (0x2UL) /*!< QSPIC_SET_DUAL (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLBUS_REG_QSPIC_SET_SINGLE_Pos (0UL) /*!< QSPIC_SET_SINGLE (Bit 0) */
-#define QSPIC2_QSPIC2_CTRLBUS_REG_QSPIC_SET_SINGLE_Msk (0x1UL) /*!< QSPIC_SET_SINGLE (Bitfield-Mask: 0x01) */
-/* ================================================== QSPIC2_CTRLMODE_REG ================================================== */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_CLK_FREE_EN_Pos (16UL) /*!< QSPIC_CLK_FREE_EN (Bit 16) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_CLK_FREE_EN_Msk (0x10000UL) /*!< QSPIC_CLK_FREE_EN (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_CS_MD_Pos (15UL) /*!< QSPIC_CS_MD (Bit 15) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_CS_MD_Msk (0x8000UL) /*!< QSPIC_CS_MD (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_SRAM_EN_Pos (14UL) /*!< QSPIC_SRAM_EN (Bit 14) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_SRAM_EN_Msk (0x4000UL) /*!< QSPIC_SRAM_EN (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_USE_32BA_Pos (13UL) /*!< QSPIC_USE_32BA (Bit 13) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_USE_32BA_Msk (0x2000UL) /*!< QSPIC_USE_32BA (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_FORCENSEQ_EN_Pos (12UL) /*!< QSPIC_FORCENSEQ_EN (Bit 12) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_FORCENSEQ_EN_Msk (0x1000UL) /*!< QSPIC_FORCENSEQ_EN (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_PCLK_MD_Pos (9UL) /*!< QSPIC_PCLK_MD (Bit 9) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_PCLK_MD_Msk (0xe00UL) /*!< QSPIC_PCLK_MD (Bitfield-Mask: 0x07) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_RPIPE_EN_Pos (8UL) /*!< QSPIC_RPIPE_EN (Bit 8) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_RPIPE_EN_Msk (0x100UL) /*!< QSPIC_RPIPE_EN (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_RXD_NEG_Pos (7UL) /*!< QSPIC_RXD_NEG (Bit 7) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_RXD_NEG_Msk (0x80UL) /*!< QSPIC_RXD_NEG (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_HRDY_MD_Pos (6UL) /*!< QSPIC_HRDY_MD (Bit 6) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_HRDY_MD_Msk (0x40UL) /*!< QSPIC_HRDY_MD (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_IO3_DAT_Pos (5UL) /*!< QSPIC_IO3_DAT (Bit 5) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_IO3_DAT_Msk (0x20UL) /*!< QSPIC_IO3_DAT (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_IO2_DAT_Pos (4UL) /*!< QSPIC_IO2_DAT (Bit 4) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_IO2_DAT_Msk (0x10UL) /*!< QSPIC_IO2_DAT (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_IO3_OEN_Pos (3UL) /*!< QSPIC_IO3_OEN (Bit 3) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_IO3_OEN_Msk (0x8UL) /*!< QSPIC_IO3_OEN (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_IO2_OEN_Pos (2UL) /*!< QSPIC_IO2_OEN (Bit 2) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_IO2_OEN_Msk (0x4UL) /*!< QSPIC_IO2_OEN (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_CLK_MD_Pos (1UL) /*!< QSPIC_CLK_MD (Bit 1) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_CLK_MD_Msk (0x2UL) /*!< QSPIC_CLK_MD (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_AUTO_MD_Pos (0UL) /*!< QSPIC_AUTO_MD (Bit 0) */
-#define QSPIC2_QSPIC2_CTRLMODE_REG_QSPIC_AUTO_MD_Msk (0x1UL) /*!< QSPIC_AUTO_MD (Bitfield-Mask: 0x01) */
-/* ================================================= QSPIC2_DUMMYDATA_REG ================================================== */
-#define QSPIC2_QSPIC2_DUMMYDATA_REG_QSPIC_DUMMYDATA_Pos (0UL) /*!< QSPIC_DUMMYDATA (Bit 0) */
-#define QSPIC2_QSPIC2_DUMMYDATA_REG_QSPIC_DUMMYDATA_Msk (0xffffffffUL) /*!< QSPIC_DUMMYDATA (Bitfield-Mask: 0xffffffff) */
-/* ================================================= QSPIC2_ERASECMDA_REG ================================================== */
-#define QSPIC2_QSPIC2_ERASECMDA_REG_QSPIC_RES_INST_Pos (24UL) /*!< QSPIC_RES_INST (Bit 24) */
-#define QSPIC2_QSPIC2_ERASECMDA_REG_QSPIC_RES_INST_Msk (0xff000000UL) /*!< QSPIC_RES_INST (Bitfield-Mask: 0xff) */
-#define QSPIC2_QSPIC2_ERASECMDA_REG_QSPIC_SUS_INST_Pos (16UL) /*!< QSPIC_SUS_INST (Bit 16) */
-#define QSPIC2_QSPIC2_ERASECMDA_REG_QSPIC_SUS_INST_Msk (0xff0000UL) /*!< QSPIC_SUS_INST (Bitfield-Mask: 0xff) */
-#define QSPIC2_QSPIC2_ERASECMDA_REG_QSPIC_WEN_INST_Pos (8UL) /*!< QSPIC_WEN_INST (Bit 8) */
-#define QSPIC2_QSPIC2_ERASECMDA_REG_QSPIC_WEN_INST_Msk (0xff00UL) /*!< QSPIC_WEN_INST (Bitfield-Mask: 0xff) */
-#define QSPIC2_QSPIC2_ERASECMDA_REG_QSPIC_ERS_INST_Pos (0UL) /*!< QSPIC_ERS_INST (Bit 0) */
-#define QSPIC2_QSPIC2_ERASECMDA_REG_QSPIC_ERS_INST_Msk (0xffUL) /*!< QSPIC_ERS_INST (Bitfield-Mask: 0xff) */
-/* ================================================= QSPIC2_ERASECMDB_REG ================================================== */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_RESSUS_DLY_Pos (24UL) /*!< QSPIC_RESSUS_DLY (Bit 24) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_RESSUS_DLY_Msk (0x3f000000UL) /*!< QSPIC_RESSUS_DLY (Bitfield-Mask: 0x3f) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_ERSRES_HLD_Pos (16UL) /*!< QSPIC_ERSRES_HLD (Bit 16) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_ERSRES_HLD_Msk (0xf0000UL) /*!< QSPIC_ERSRES_HLD (Bitfield-Mask: 0x0f) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_ERS_CS_HI_Pos (10UL) /*!< QSPIC_ERS_CS_HI (Bit 10) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_ERS_CS_HI_Msk (0x7c00UL) /*!< QSPIC_ERS_CS_HI (Bitfield-Mask: 0x1f) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_EAD_TX_MD_Pos (8UL) /*!< QSPIC_EAD_TX_MD (Bit 8) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_EAD_TX_MD_Msk (0x300UL) /*!< QSPIC_EAD_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_RES_TX_MD_Pos (6UL) /*!< QSPIC_RES_TX_MD (Bit 6) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_RES_TX_MD_Msk (0xc0UL) /*!< QSPIC_RES_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_SUS_TX_MD_Pos (4UL) /*!< QSPIC_SUS_TX_MD (Bit 4) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_SUS_TX_MD_Msk (0x30UL) /*!< QSPIC_SUS_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_WEN_TX_MD_Pos (2UL) /*!< QSPIC_WEN_TX_MD (Bit 2) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_WEN_TX_MD_Msk (0xcUL) /*!< QSPIC_WEN_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_ERS_TX_MD_Pos (0UL) /*!< QSPIC_ERS_TX_MD (Bit 0) */
-#define QSPIC2_QSPIC2_ERASECMDB_REG_QSPIC_ERS_TX_MD_Msk (0x3UL) /*!< QSPIC_ERS_TX_MD (Bitfield-Mask: 0x03) */
-/* ================================================= QSPIC2_ERASECTRL_REG ================================================== */
-#define QSPIC2_QSPIC2_ERASECTRL_REG_QSPIC_ERS_STATE_Pos (25UL) /*!< QSPIC_ERS_STATE (Bit 25) */
-#define QSPIC2_QSPIC2_ERASECTRL_REG_QSPIC_ERS_STATE_Msk (0xe000000UL) /*!< QSPIC_ERS_STATE (Bitfield-Mask: 0x07) */
-#define QSPIC2_QSPIC2_ERASECTRL_REG_QSPIC_ERASE_EN_Pos (24UL) /*!< QSPIC_ERASE_EN (Bit 24) */
-#define QSPIC2_QSPIC2_ERASECTRL_REG_QSPIC_ERASE_EN_Msk (0x1000000UL) /*!< QSPIC_ERASE_EN (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_ERASECTRL_REG_QSPIC_ERS_ADDR_Pos (4UL) /*!< QSPIC_ERS_ADDR (Bit 4) */
-#define QSPIC2_QSPIC2_ERASECTRL_REG_QSPIC_ERS_ADDR_Msk (0xfffff0UL) /*!< QSPIC_ERS_ADDR (Bitfield-Mask: 0xfffff) */
-/* ===================================================== QSPIC2_GP_REG ===================================================== */
-#define QSPIC2_QSPIC2_GP_REG_QSPIC_PADS_SLEW_Pos (3UL) /*!< QSPIC_PADS_SLEW (Bit 3) */
-#define QSPIC2_QSPIC2_GP_REG_QSPIC_PADS_SLEW_Msk (0x18UL) /*!< QSPIC_PADS_SLEW (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_GP_REG_QSPIC_PADS_DRV_Pos (1UL) /*!< QSPIC_PADS_DRV (Bit 1) */
-#define QSPIC2_QSPIC2_GP_REG_QSPIC_PADS_DRV_Msk (0x6UL) /*!< QSPIC_PADS_DRV (Bitfield-Mask: 0x03) */
-/* ================================================== QSPIC2_MEMBLEN_REG =================================================== */
-#define QSPIC2_QSPIC2_MEMBLEN_REG_QSPIC_T_CEM_CC_Pos (4UL) /*!< QSPIC_T_CEM_CC (Bit 4) */
-#define QSPIC2_QSPIC2_MEMBLEN_REG_QSPIC_T_CEM_CC_Msk (0x3ff0UL) /*!< QSPIC_T_CEM_CC (Bitfield-Mask: 0x3ff) */
-#define QSPIC2_QSPIC2_MEMBLEN_REG_QSPIC_T_CEM_EN_Pos (3UL) /*!< QSPIC_T_CEM_EN (Bit 3) */
-#define QSPIC2_QSPIC2_MEMBLEN_REG_QSPIC_T_CEM_EN_Msk (0x8UL) /*!< QSPIC_T_CEM_EN (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_MEMBLEN_REG_QSPIC_MEMBLEN_Pos (0UL) /*!< QSPIC_MEMBLEN (Bit 0) */
-#define QSPIC2_QSPIC2_MEMBLEN_REG_QSPIC_MEMBLEN_Msk (0x7UL) /*!< QSPIC_MEMBLEN (Bitfield-Mask: 0x07) */
-/* ================================================== QSPIC2_READDATA_REG ================================================== */
-#define QSPIC2_QSPIC2_READDATA_REG_QSPIC_READDATA_Pos (0UL) /*!< QSPIC_READDATA (Bit 0) */
-#define QSPIC2_QSPIC2_READDATA_REG_QSPIC_READDATA_Msk (0xffffffffUL) /*!< QSPIC_READDATA (Bitfield-Mask: 0xffffffff) */
-/* ================================================== QSPIC2_RECVDATA_REG ================================================== */
-#define QSPIC2_QSPIC2_RECVDATA_REG_QSPIC_RECVDATA_Pos (0UL) /*!< QSPIC_RECVDATA (Bit 0) */
-#define QSPIC2_QSPIC2_RECVDATA_REG_QSPIC_RECVDATA_Msk (0xffffffffUL) /*!< QSPIC_RECVDATA (Bitfield-Mask: 0xffffffff) */
-/* ================================================= QSPIC2_STATUSCMD_REG ================================================== */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_STSDLY_SEL_Pos (22UL) /*!< QSPIC_STSDLY_SEL (Bit 22) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_STSDLY_SEL_Msk (0x400000UL) /*!< QSPIC_STSDLY_SEL (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_RESSTS_DLY_Pos (16UL) /*!< QSPIC_RESSTS_DLY (Bit 16) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_RESSTS_DLY_Msk (0x3f0000UL) /*!< QSPIC_RESSTS_DLY (Bitfield-Mask: 0x3f) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_BUSY_VAL_Pos (15UL) /*!< QSPIC_BUSY_VAL (Bit 15) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_BUSY_VAL_Msk (0x8000UL) /*!< QSPIC_BUSY_VAL (Bitfield-Mask: 0x01) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_BUSY_POS_Pos (12UL) /*!< QSPIC_BUSY_POS (Bit 12) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_BUSY_POS_Msk (0x7000UL) /*!< QSPIC_BUSY_POS (Bitfield-Mask: 0x07) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_RSTAT_RX_MD_Pos (10UL) /*!< QSPIC_RSTAT_RX_MD (Bit 10) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_RSTAT_RX_MD_Msk (0xc00UL) /*!< QSPIC_RSTAT_RX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_RSTAT_TX_MD_Pos (8UL) /*!< QSPIC_RSTAT_TX_MD (Bit 8) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_RSTAT_TX_MD_Msk (0x300UL) /*!< QSPIC_RSTAT_TX_MD (Bitfield-Mask: 0x03) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_RSTAT_INST_Pos (0UL) /*!< QSPIC_RSTAT_INST (Bit 0) */
-#define QSPIC2_QSPIC2_STATUSCMD_REG_QSPIC_RSTAT_INST_Msk (0xffUL) /*!< QSPIC_RSTAT_INST (Bitfield-Mask: 0xff) */
-/* =================================================== QSPIC2_STATUS_REG =================================================== */
-#define QSPIC2_QSPIC2_STATUS_REG_QSPIC_BUSY_Pos (0UL) /*!< QSPIC_BUSY (Bit 0) */
-#define QSPIC2_QSPIC2_STATUS_REG_QSPIC_BUSY_Msk (0x1UL) /*!< QSPIC_BUSY (Bitfield-Mask: 0x01) */
-/* ================================================= QSPIC2_WRITEDATA_REG ================================================== */
-#define QSPIC2_QSPIC2_WRITEDATA_REG_QSPIC_WRITEDATA_Pos (0UL) /*!< QSPIC_WRITEDATA (Bit 0) */
-#define QSPIC2_QSPIC2_WRITEDATA_REG_QSPIC_WRITEDATA_Msk (0xffffffffUL) /*!< QSPIC_WRITEDATA (Bitfield-Mask: 0xffffffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ RFMON ================ */
-/* =========================================================================================================================== */
-
-/* ==================================================== RFMON_ADDR_REG ===================================================== */
-#define RFMON_RFMON_ADDR_REG_RFMON_ADDR_Pos (2UL) /*!< RFMON_ADDR (Bit 2) */
-#define RFMON_RFMON_ADDR_REG_RFMON_ADDR_Msk (0xfffffffcUL) /*!< RFMON_ADDR (Bitfield-Mask: 0x3fffffff) */
-/* ================================================== RFMON_CRV_ADDR_REG =================================================== */
-#define RFMON_RFMON_CRV_ADDR_REG_RFMON_CRV_ADDR_Pos (2UL) /*!< RFMON_CRV_ADDR (Bit 2) */
-#define RFMON_RFMON_CRV_ADDR_REG_RFMON_CRV_ADDR_Msk (0xfffffffcUL) /*!< RFMON_CRV_ADDR (Bitfield-Mask: 0x3fffffff) */
-/* =================================================== RFMON_CRV_LEN_REG =================================================== */
-#define RFMON_RFMON_CRV_LEN_REG_RFMON_CRV_LEN_Pos (0UL) /*!< RFMON_CRV_LEN (Bit 0) */
-#define RFMON_RFMON_CRV_LEN_REG_RFMON_CRV_LEN_Msk (0x1ffffUL) /*!< RFMON_CRV_LEN (Bitfield-Mask: 0x1ffff) */
-/* ==================================================== RFMON_CTRL_REG ===================================================== */
-#define RFMON_RFMON_CTRL_REG_RFMON_BREQ_FORCE_Pos (2UL) /*!< RFMON_BREQ_FORCE (Bit 2) */
-#define RFMON_RFMON_CTRL_REG_RFMON_BREQ_FORCE_Msk (0x4UL) /*!< RFMON_BREQ_FORCE (Bitfield-Mask: 0x01) */
-#define RFMON_RFMON_CTRL_REG_RFMON_CIRC_EN_Pos (1UL) /*!< RFMON_CIRC_EN (Bit 1) */
-#define RFMON_RFMON_CTRL_REG_RFMON_CIRC_EN_Msk (0x2UL) /*!< RFMON_CIRC_EN (Bitfield-Mask: 0x01) */
-#define RFMON_RFMON_CTRL_REG_RFMON_PACK_EN_Pos (0UL) /*!< RFMON_PACK_EN (Bit 0) */
-#define RFMON_RFMON_CTRL_REG_RFMON_PACK_EN_Msk (0x1UL) /*!< RFMON_PACK_EN (Bitfield-Mask: 0x01) */
-/* ===================================================== RFMON_LEN_REG ===================================================== */
-#define RFMON_RFMON_LEN_REG_RFMON_LEN_Pos (0UL) /*!< RFMON_LEN (Bit 0) */
-#define RFMON_RFMON_LEN_REG_RFMON_LEN_Msk (0x1ffffUL) /*!< RFMON_LEN (Bitfield-Mask: 0x1ffff) */
-/* ==================================================== RFMON_STAT_REG ===================================================== */
-#define RFMON_RFMON_STAT_REG_RFMON_OFLOW_STK_Pos (1UL) /*!< RFMON_OFLOW_STK (Bit 1) */
-#define RFMON_RFMON_STAT_REG_RFMON_OFLOW_STK_Msk (0x2UL) /*!< RFMON_OFLOW_STK (Bitfield-Mask: 0x01) */
-#define RFMON_RFMON_STAT_REG_RFMON_ACTIVE_Pos (0UL) /*!< RFMON_ACTIVE (Bit 0) */
-#define RFMON_RFMON_STAT_REG_RFMON_ACTIVE_Msk (0x1UL) /*!< RFMON_ACTIVE (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ RTC ================ */
-/* =========================================================================================================================== */
-
-/* ================================================= RTC_ALARM_ENABLE_REG ================================================== */
-#define RTC_RTC_ALARM_ENABLE_REG_RTC_ALARM_MNTH_EN_Pos (5UL) /*!< RTC_ALARM_MNTH_EN (Bit 5) */
-#define RTC_RTC_ALARM_ENABLE_REG_RTC_ALARM_MNTH_EN_Msk (0x20UL) /*!< RTC_ALARM_MNTH_EN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_ALARM_ENABLE_REG_RTC_ALARM_DATE_EN_Pos (4UL) /*!< RTC_ALARM_DATE_EN (Bit 4) */
-#define RTC_RTC_ALARM_ENABLE_REG_RTC_ALARM_DATE_EN_Msk (0x10UL) /*!< RTC_ALARM_DATE_EN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_ALARM_ENABLE_REG_RTC_ALARM_HOUR_EN_Pos (3UL) /*!< RTC_ALARM_HOUR_EN (Bit 3) */
-#define RTC_RTC_ALARM_ENABLE_REG_RTC_ALARM_HOUR_EN_Msk (0x8UL) /*!< RTC_ALARM_HOUR_EN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_ALARM_ENABLE_REG_RTC_ALARM_MIN_EN_Pos (2UL) /*!< RTC_ALARM_MIN_EN (Bit 2) */
-#define RTC_RTC_ALARM_ENABLE_REG_RTC_ALARM_MIN_EN_Msk (0x4UL) /*!< RTC_ALARM_MIN_EN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_ALARM_ENABLE_REG_RTC_ALARM_SEC_EN_Pos (1UL) /*!< RTC_ALARM_SEC_EN (Bit 1) */
-#define RTC_RTC_ALARM_ENABLE_REG_RTC_ALARM_SEC_EN_Msk (0x2UL) /*!< RTC_ALARM_SEC_EN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_ALARM_ENABLE_REG_RTC_ALARM_HOS_EN_Pos (0UL) /*!< RTC_ALARM_HOS_EN (Bit 0) */
-#define RTC_RTC_ALARM_ENABLE_REG_RTC_ALARM_HOS_EN_Msk (0x1UL) /*!< RTC_ALARM_HOS_EN (Bitfield-Mask: 0x01) */
-/* ================================================ RTC_CALENDAR_ALARM_REG ================================================= */
-#define RTC_RTC_CALENDAR_ALARM_REG_RTC_CAL_D_T_Pos (12UL) /*!< RTC_CAL_D_T (Bit 12) */
-#define RTC_RTC_CALENDAR_ALARM_REG_RTC_CAL_D_T_Msk (0x3000UL) /*!< RTC_CAL_D_T (Bitfield-Mask: 0x03) */
-#define RTC_RTC_CALENDAR_ALARM_REG_RTC_CAL_D_U_Pos (8UL) /*!< RTC_CAL_D_U (Bit 8) */
-#define RTC_RTC_CALENDAR_ALARM_REG_RTC_CAL_D_U_Msk (0xf00UL) /*!< RTC_CAL_D_U (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_CALENDAR_ALARM_REG_RTC_CAL_M_T_Pos (7UL) /*!< RTC_CAL_M_T (Bit 7) */
-#define RTC_RTC_CALENDAR_ALARM_REG_RTC_CAL_M_T_Msk (0x80UL) /*!< RTC_CAL_M_T (Bitfield-Mask: 0x01) */
-#define RTC_RTC_CALENDAR_ALARM_REG_RTC_CAL_M_U_Pos (3UL) /*!< RTC_CAL_M_U (Bit 3) */
-#define RTC_RTC_CALENDAR_ALARM_REG_RTC_CAL_M_U_Msk (0x78UL) /*!< RTC_CAL_M_U (Bitfield-Mask: 0x0f) */
-/* =================================================== RTC_CALENDAR_REG ==================================================== */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_CH_Pos (31UL) /*!< RTC_CAL_CH (Bit 31) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_CH_Msk (0x80000000UL) /*!< RTC_CAL_CH (Bitfield-Mask: 0x01) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_C_T_Pos (28UL) /*!< RTC_CAL_C_T (Bit 28) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_C_T_Msk (0x30000000UL) /*!< RTC_CAL_C_T (Bitfield-Mask: 0x03) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_C_U_Pos (24UL) /*!< RTC_CAL_C_U (Bit 24) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_C_U_Msk (0xf000000UL) /*!< RTC_CAL_C_U (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_Y_T_Pos (20UL) /*!< RTC_CAL_Y_T (Bit 20) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_Y_T_Msk (0xf00000UL) /*!< RTC_CAL_Y_T (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_Y_U_Pos (16UL) /*!< RTC_CAL_Y_U (Bit 16) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_Y_U_Msk (0xf0000UL) /*!< RTC_CAL_Y_U (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_D_T_Pos (12UL) /*!< RTC_CAL_D_T (Bit 12) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_D_T_Msk (0x3000UL) /*!< RTC_CAL_D_T (Bitfield-Mask: 0x03) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_D_U_Pos (8UL) /*!< RTC_CAL_D_U (Bit 8) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_D_U_Msk (0xf00UL) /*!< RTC_CAL_D_U (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_M_T_Pos (7UL) /*!< RTC_CAL_M_T (Bit 7) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_M_T_Msk (0x80UL) /*!< RTC_CAL_M_T (Bitfield-Mask: 0x01) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_M_U_Pos (3UL) /*!< RTC_CAL_M_U (Bit 3) */
-#define RTC_RTC_CALENDAR_REG_RTC_CAL_M_U_Msk (0x78UL) /*!< RTC_CAL_M_U (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_CALENDAR_REG_RTC_DAY_Pos (0UL) /*!< RTC_DAY (Bit 0) */
-#define RTC_RTC_CALENDAR_REG_RTC_DAY_Msk (0x7UL) /*!< RTC_DAY (Bitfield-Mask: 0x07) */
-/* ==================================================== RTC_CONTROL_REG ==================================================== */
-#define RTC_RTC_CONTROL_REG_RTC_CAL_DISABLE_Pos (1UL) /*!< RTC_CAL_DISABLE (Bit 1) */
-#define RTC_RTC_CONTROL_REG_RTC_CAL_DISABLE_Msk (0x2UL) /*!< RTC_CAL_DISABLE (Bitfield-Mask: 0x01) */
-#define RTC_RTC_CONTROL_REG_RTC_TIME_DISABLE_Pos (0UL) /*!< RTC_TIME_DISABLE (Bit 0) */
-#define RTC_RTC_CONTROL_REG_RTC_TIME_DISABLE_Msk (0x1UL) /*!< RTC_TIME_DISABLE (Bitfield-Mask: 0x01) */
-/* ================================================== RTC_EVENT_CTRL_REG =================================================== */
-#define RTC_RTC_EVENT_CTRL_REG_RTC_PDC_EVENT_EN_Pos (1UL) /*!< RTC_PDC_EVENT_EN (Bit 1) */
-#define RTC_RTC_EVENT_CTRL_REG_RTC_PDC_EVENT_EN_Msk (0x2UL) /*!< RTC_PDC_EVENT_EN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_EVENT_CTRL_REG_RTC_MOTOR_EVENT_EN_Pos (0UL) /*!< RTC_MOTOR_EVENT_EN (Bit 0) */
-#define RTC_RTC_EVENT_CTRL_REG_RTC_MOTOR_EVENT_EN_Msk (0x1UL) /*!< RTC_MOTOR_EVENT_EN (Bitfield-Mask: 0x01) */
-/* ================================================== RTC_EVENT_FLAGS_REG ================================================== */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_ALRM_Pos (6UL) /*!< RTC_EVENT_ALRM (Bit 6) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_ALRM_Msk (0x40UL) /*!< RTC_EVENT_ALRM (Bitfield-Mask: 0x01) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_MNTH_Pos (5UL) /*!< RTC_EVENT_MNTH (Bit 5) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_MNTH_Msk (0x20UL) /*!< RTC_EVENT_MNTH (Bitfield-Mask: 0x01) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_DATE_Pos (4UL) /*!< RTC_EVENT_DATE (Bit 4) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_DATE_Msk (0x10UL) /*!< RTC_EVENT_DATE (Bitfield-Mask: 0x01) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_HOUR_Pos (3UL) /*!< RTC_EVENT_HOUR (Bit 3) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_HOUR_Msk (0x8UL) /*!< RTC_EVENT_HOUR (Bitfield-Mask: 0x01) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_MIN_Pos (2UL) /*!< RTC_EVENT_MIN (Bit 2) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_MIN_Msk (0x4UL) /*!< RTC_EVENT_MIN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_SEC_Pos (1UL) /*!< RTC_EVENT_SEC (Bit 1) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_SEC_Msk (0x2UL) /*!< RTC_EVENT_SEC (Bitfield-Mask: 0x01) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_HOS_Pos (0UL) /*!< RTC_EVENT_HOS (Bit 0) */
-#define RTC_RTC_EVENT_FLAGS_REG_RTC_EVENT_HOS_Msk (0x1UL) /*!< RTC_EVENT_HOS (Bitfield-Mask: 0x01) */
-/* =================================================== RTC_HOUR_MODE_REG =================================================== */
-#define RTC_RTC_HOUR_MODE_REG_RTC_HMS_Pos (0UL) /*!< RTC_HMS (Bit 0) */
-#define RTC_RTC_HOUR_MODE_REG_RTC_HMS_Msk (0x1UL) /*!< RTC_HMS (Bitfield-Mask: 0x01) */
-/* =============================================== RTC_INTERRUPT_DISABLE_REG =============================================== */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_ALRM_INT_DIS_Pos (6UL) /*!< RTC_ALRM_INT_DIS (Bit 6) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_ALRM_INT_DIS_Msk (0x40UL) /*!< RTC_ALRM_INT_DIS (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_MNTH_INT_DIS_Pos (5UL) /*!< RTC_MNTH_INT_DIS (Bit 5) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_MNTH_INT_DIS_Msk (0x20UL) /*!< RTC_MNTH_INT_DIS (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_DATE_INT_DIS_Pos (4UL) /*!< RTC_DATE_INT_DIS (Bit 4) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_DATE_INT_DIS_Msk (0x10UL) /*!< RTC_DATE_INT_DIS (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_HOUR_INT_DIS_Pos (3UL) /*!< RTC_HOUR_INT_DIS (Bit 3) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_HOUR_INT_DIS_Msk (0x8UL) /*!< RTC_HOUR_INT_DIS (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_MIN_INT_DIS_Pos (2UL) /*!< RTC_MIN_INT_DIS (Bit 2) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_MIN_INT_DIS_Msk (0x4UL) /*!< RTC_MIN_INT_DIS (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_SEC_INT_DIS_Pos (1UL) /*!< RTC_SEC_INT_DIS (Bit 1) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_SEC_INT_DIS_Msk (0x2UL) /*!< RTC_SEC_INT_DIS (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_HOS_INT_DIS_Pos (0UL) /*!< RTC_HOS_INT_DIS (Bit 0) */
-#define RTC_RTC_INTERRUPT_DISABLE_REG_RTC_HOS_INT_DIS_Msk (0x1UL) /*!< RTC_HOS_INT_DIS (Bitfield-Mask: 0x01) */
-/* =============================================== RTC_INTERRUPT_ENABLE_REG ================================================ */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_ALRM_INT_EN_Pos (6UL) /*!< RTC_ALRM_INT_EN (Bit 6) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_ALRM_INT_EN_Msk (0x40UL) /*!< RTC_ALRM_INT_EN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_MNTH_INT_EN_Pos (5UL) /*!< RTC_MNTH_INT_EN (Bit 5) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_MNTH_INT_EN_Msk (0x20UL) /*!< RTC_MNTH_INT_EN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_DATE_INT_EN_Pos (4UL) /*!< RTC_DATE_INT_EN (Bit 4) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_DATE_INT_EN_Msk (0x10UL) /*!< RTC_DATE_INT_EN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_HOUR_INT_EN_Pos (3UL) /*!< RTC_HOUR_INT_EN (Bit 3) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_HOUR_INT_EN_Msk (0x8UL) /*!< RTC_HOUR_INT_EN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_MIN_INT_EN_Pos (2UL) /*!< RTC_MIN_INT_EN (Bit 2) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_MIN_INT_EN_Msk (0x4UL) /*!< RTC_MIN_INT_EN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_SEC_INT_EN_Pos (1UL) /*!< RTC_SEC_INT_EN (Bit 1) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_SEC_INT_EN_Msk (0x2UL) /*!< RTC_SEC_INT_EN (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_HOS_INT_EN_Pos (0UL) /*!< RTC_HOS_INT_EN (Bit 0) */
-#define RTC_RTC_INTERRUPT_ENABLE_REG_RTC_HOS_INT_EN_Msk (0x1UL) /*!< RTC_HOS_INT_EN (Bitfield-Mask: 0x01) */
-/* ================================================ RTC_INTERRUPT_MASK_REG ================================================= */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_ALRM_INT_MSK_Pos (6UL) /*!< RTC_ALRM_INT_MSK (Bit 6) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_ALRM_INT_MSK_Msk (0x40UL) /*!< RTC_ALRM_INT_MSK (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_MNTH_INT_MSK_Pos (5UL) /*!< RTC_MNTH_INT_MSK (Bit 5) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_MNTH_INT_MSK_Msk (0x20UL) /*!< RTC_MNTH_INT_MSK (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_DATE_INT_MSK_Pos (4UL) /*!< RTC_DATE_INT_MSK (Bit 4) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_DATE_INT_MSK_Msk (0x10UL) /*!< RTC_DATE_INT_MSK (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_HOUR_INT_MSK_Pos (3UL) /*!< RTC_HOUR_INT_MSK (Bit 3) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_HOUR_INT_MSK_Msk (0x8UL) /*!< RTC_HOUR_INT_MSK (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_MIN_INT_MSK_Pos (2UL) /*!< RTC_MIN_INT_MSK (Bit 2) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_MIN_INT_MSK_Msk (0x4UL) /*!< RTC_MIN_INT_MSK (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_SEC_INT_MSK_Pos (1UL) /*!< RTC_SEC_INT_MSK (Bit 1) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_SEC_INT_MSK_Msk (0x2UL) /*!< RTC_SEC_INT_MSK (Bitfield-Mask: 0x01) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_HOS_INT_MSK_Pos (0UL) /*!< RTC_HOS_INT_MSK (Bit 0) */
-#define RTC_RTC_INTERRUPT_MASK_REG_RTC_HOS_INT_MSK_Msk (0x1UL) /*!< RTC_HOS_INT_MSK (Bitfield-Mask: 0x01) */
-/* =================================================== RTC_KEEP_RTC_REG ==================================================== */
-#define RTC_RTC_KEEP_RTC_REG_RTC_KEEP_Pos (0UL) /*!< RTC_KEEP (Bit 0) */
-#define RTC_RTC_KEEP_RTC_REG_RTC_KEEP_Msk (0x1UL) /*!< RTC_KEEP (Bitfield-Mask: 0x01) */
-/* ================================================ RTC_MOTOR_EVENT_CNT_REG ================================================ */
-#define RTC_RTC_MOTOR_EVENT_CNT_REG_RTC_MOTOR_EVENT_CNT_Pos (0UL) /*!< RTC_MOTOR_EVENT_CNT (Bit 0) */
-#define RTC_RTC_MOTOR_EVENT_CNT_REG_RTC_MOTOR_EVENT_CNT_Msk (0xfffUL) /*!< RTC_MOTOR_EVENT_CNT (Bitfield-Mask: 0xfff) */
-/* ============================================== RTC_MOTOR_EVENT_PERIOD_REG =============================================== */
-#define RTC_RTC_MOTOR_EVENT_PERIOD_REG_RTC_MOTOR_EVENT_PERIOD_Pos (0UL) /*!< RTC_MOTOR_EVENT_PERIOD (Bit 0) */
-#define RTC_RTC_MOTOR_EVENT_PERIOD_REG_RTC_MOTOR_EVENT_PERIOD_Msk (0xfffUL) /*!< RTC_MOTOR_EVENT_PERIOD (Bitfield-Mask: 0xfff) */
-/* ================================================ RTC_PDC_EVENT_CLEAR_REG ================================================ */
-#define RTC_RTC_PDC_EVENT_CLEAR_REG_PDC_EVENT_CLEAR_Pos (0UL) /*!< PDC_EVENT_CLEAR (Bit 0) */
-#define RTC_RTC_PDC_EVENT_CLEAR_REG_PDC_EVENT_CLEAR_Msk (0x1UL) /*!< PDC_EVENT_CLEAR (Bitfield-Mask: 0x01) */
-/* ================================================= RTC_PDC_EVENT_CNT_REG ================================================= */
-#define RTC_RTC_PDC_EVENT_CNT_REG_RTC_PDC_EVENT_CNT_Pos (0UL) /*!< RTC_PDC_EVENT_CNT (Bit 0) */
-#define RTC_RTC_PDC_EVENT_CNT_REG_RTC_PDC_EVENT_CNT_Msk (0x1fffUL) /*!< RTC_PDC_EVENT_CNT (Bitfield-Mask: 0x1fff) */
-/* =============================================== RTC_PDC_EVENT_PERIOD_REG ================================================ */
-#define RTC_RTC_PDC_EVENT_PERIOD_REG_RTC_PDC_EVENT_PERIOD_Pos (0UL) /*!< RTC_PDC_EVENT_PERIOD (Bit 0) */
-#define RTC_RTC_PDC_EVENT_PERIOD_REG_RTC_PDC_EVENT_PERIOD_Msk (0x1fffUL) /*!< RTC_PDC_EVENT_PERIOD (Bitfield-Mask: 0x1fff) */
-/* ==================================================== RTC_STATUS_REG ===================================================== */
-#define RTC_RTC_STATUS_REG_RTC_VALID_CAL_ALM_Pos (3UL) /*!< RTC_VALID_CAL_ALM (Bit 3) */
-#define RTC_RTC_STATUS_REG_RTC_VALID_CAL_ALM_Msk (0x8UL) /*!< RTC_VALID_CAL_ALM (Bitfield-Mask: 0x01) */
-#define RTC_RTC_STATUS_REG_RTC_VALID_TIME_ALM_Pos (2UL) /*!< RTC_VALID_TIME_ALM (Bit 2) */
-#define RTC_RTC_STATUS_REG_RTC_VALID_TIME_ALM_Msk (0x4UL) /*!< RTC_VALID_TIME_ALM (Bitfield-Mask: 0x01) */
-#define RTC_RTC_STATUS_REG_RTC_VALID_CAL_Pos (1UL) /*!< RTC_VALID_CAL (Bit 1) */
-#define RTC_RTC_STATUS_REG_RTC_VALID_CAL_Msk (0x2UL) /*!< RTC_VALID_CAL (Bitfield-Mask: 0x01) */
-#define RTC_RTC_STATUS_REG_RTC_VALID_TIME_Pos (0UL) /*!< RTC_VALID_TIME (Bit 0) */
-#define RTC_RTC_STATUS_REG_RTC_VALID_TIME_Msk (0x1UL) /*!< RTC_VALID_TIME (Bitfield-Mask: 0x01) */
-/* ================================================== RTC_TIME_ALARM_REG =================================================== */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_PM_Pos (30UL) /*!< RTC_TIME_PM (Bit 30) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_PM_Msk (0x40000000UL) /*!< RTC_TIME_PM (Bitfield-Mask: 0x01) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_HR_T_Pos (28UL) /*!< RTC_TIME_HR_T (Bit 28) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_HR_T_Msk (0x30000000UL) /*!< RTC_TIME_HR_T (Bitfield-Mask: 0x03) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_HR_U_Pos (24UL) /*!< RTC_TIME_HR_U (Bit 24) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_HR_U_Msk (0xf000000UL) /*!< RTC_TIME_HR_U (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_M_T_Pos (20UL) /*!< RTC_TIME_M_T (Bit 20) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_M_T_Msk (0x700000UL) /*!< RTC_TIME_M_T (Bitfield-Mask: 0x07) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_M_U_Pos (16UL) /*!< RTC_TIME_M_U (Bit 16) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_M_U_Msk (0xf0000UL) /*!< RTC_TIME_M_U (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_S_T_Pos (12UL) /*!< RTC_TIME_S_T (Bit 12) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_S_T_Msk (0x7000UL) /*!< RTC_TIME_S_T (Bitfield-Mask: 0x07) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_S_U_Pos (8UL) /*!< RTC_TIME_S_U (Bit 8) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_S_U_Msk (0xf00UL) /*!< RTC_TIME_S_U (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_H_T_Pos (4UL) /*!< RTC_TIME_H_T (Bit 4) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_H_T_Msk (0xf0UL) /*!< RTC_TIME_H_T (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_H_U_Pos (0UL) /*!< RTC_TIME_H_U (Bit 0) */
-#define RTC_RTC_TIME_ALARM_REG_RTC_TIME_H_U_Msk (0xfUL) /*!< RTC_TIME_H_U (Bitfield-Mask: 0x0f) */
-/* ===================================================== RTC_TIME_REG ====================================================== */
-#define RTC_RTC_TIME_REG_RTC_TIME_CH_Pos (31UL) /*!< RTC_TIME_CH (Bit 31) */
-#define RTC_RTC_TIME_REG_RTC_TIME_CH_Msk (0x80000000UL) /*!< RTC_TIME_CH (Bitfield-Mask: 0x01) */
-#define RTC_RTC_TIME_REG_RTC_TIME_PM_Pos (30UL) /*!< RTC_TIME_PM (Bit 30) */
-#define RTC_RTC_TIME_REG_RTC_TIME_PM_Msk (0x40000000UL) /*!< RTC_TIME_PM (Bitfield-Mask: 0x01) */
-#define RTC_RTC_TIME_REG_RTC_TIME_HR_T_Pos (28UL) /*!< RTC_TIME_HR_T (Bit 28) */
-#define RTC_RTC_TIME_REG_RTC_TIME_HR_T_Msk (0x30000000UL) /*!< RTC_TIME_HR_T (Bitfield-Mask: 0x03) */
-#define RTC_RTC_TIME_REG_RTC_TIME_HR_U_Pos (24UL) /*!< RTC_TIME_HR_U (Bit 24) */
-#define RTC_RTC_TIME_REG_RTC_TIME_HR_U_Msk (0xf000000UL) /*!< RTC_TIME_HR_U (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_TIME_REG_RTC_TIME_M_T_Pos (20UL) /*!< RTC_TIME_M_T (Bit 20) */
-#define RTC_RTC_TIME_REG_RTC_TIME_M_T_Msk (0x700000UL) /*!< RTC_TIME_M_T (Bitfield-Mask: 0x07) */
-#define RTC_RTC_TIME_REG_RTC_TIME_M_U_Pos (16UL) /*!< RTC_TIME_M_U (Bit 16) */
-#define RTC_RTC_TIME_REG_RTC_TIME_M_U_Msk (0xf0000UL) /*!< RTC_TIME_M_U (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_TIME_REG_RTC_TIME_S_T_Pos (12UL) /*!< RTC_TIME_S_T (Bit 12) */
-#define RTC_RTC_TIME_REG_RTC_TIME_S_T_Msk (0x7000UL) /*!< RTC_TIME_S_T (Bitfield-Mask: 0x07) */
-#define RTC_RTC_TIME_REG_RTC_TIME_S_U_Pos (8UL) /*!< RTC_TIME_S_U (Bit 8) */
-#define RTC_RTC_TIME_REG_RTC_TIME_S_U_Msk (0xf00UL) /*!< RTC_TIME_S_U (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_TIME_REG_RTC_TIME_H_T_Pos (4UL) /*!< RTC_TIME_H_T (Bit 4) */
-#define RTC_RTC_TIME_REG_RTC_TIME_H_T_Msk (0xf0UL) /*!< RTC_TIME_H_T (Bitfield-Mask: 0x0f) */
-#define RTC_RTC_TIME_REG_RTC_TIME_H_U_Pos (0UL) /*!< RTC_TIME_H_U (Bit 0) */
-#define RTC_RTC_TIME_REG_RTC_TIME_H_U_Msk (0xfUL) /*!< RTC_TIME_H_U (Bitfield-Mask: 0x0f) */
-
-
-/* =========================================================================================================================== */
-/* ================ SDADC ================ */
-/* =========================================================================================================================== */
-
-/* ================================================== SDADC_CLEAR_INT_REG ================================================== */
-#define SDADC_SDADC_CLEAR_INT_REG_SDADC_CLR_INT_Pos (0UL) /*!< SDADC_CLR_INT (Bit 0) */
-#define SDADC_SDADC_CLEAR_INT_REG_SDADC_CLR_INT_Msk (0xffffUL) /*!< SDADC_CLR_INT (Bitfield-Mask: 0xffff) */
-/* ==================================================== SDADC_CTRL_REG ===================================================== */
-#define SDADC_SDADC_CTRL_REG_SDADC_DMA_EN_Pos (17UL) /*!< SDADC_DMA_EN (Bit 17) */
-#define SDADC_SDADC_CTRL_REG_SDADC_DMA_EN_Msk (0x20000UL) /*!< SDADC_DMA_EN (Bitfield-Mask: 0x01) */
-#define SDADC_SDADC_CTRL_REG_SDADC_MINT_Pos (16UL) /*!< SDADC_MINT (Bit 16) */
-#define SDADC_SDADC_CTRL_REG_SDADC_MINT_Msk (0x10000UL) /*!< SDADC_MINT (Bitfield-Mask: 0x01) */
-#define SDADC_SDADC_CTRL_REG_SDADC_INT_Pos (15UL) /*!< SDADC_INT (Bit 15) */
-#define SDADC_SDADC_CTRL_REG_SDADC_INT_Msk (0x8000UL) /*!< SDADC_INT (Bitfield-Mask: 0x01) */
-#define SDADC_SDADC_CTRL_REG_SDADC_LDO_OK_Pos (14UL) /*!< SDADC_LDO_OK (Bit 14) */
-#define SDADC_SDADC_CTRL_REG_SDADC_LDO_OK_Msk (0x4000UL) /*!< SDADC_LDO_OK (Bitfield-Mask: 0x01) */
-#define SDADC_SDADC_CTRL_REG_SDADC_VREF_SEL_Pos (13UL) /*!< SDADC_VREF_SEL (Bit 13) */
-#define SDADC_SDADC_CTRL_REG_SDADC_VREF_SEL_Msk (0x2000UL) /*!< SDADC_VREF_SEL (Bitfield-Mask: 0x01) */
-#define SDADC_SDADC_CTRL_REG_SDADC_CONT_Pos (12UL) /*!< SDADC_CONT (Bit 12) */
-#define SDADC_SDADC_CTRL_REG_SDADC_CONT_Msk (0x1000UL) /*!< SDADC_CONT (Bitfield-Mask: 0x01) */
-#define SDADC_SDADC_CTRL_REG_SDADC_OSR_Pos (10UL) /*!< SDADC_OSR (Bit 10) */
-#define SDADC_SDADC_CTRL_REG_SDADC_OSR_Msk (0xc00UL) /*!< SDADC_OSR (Bitfield-Mask: 0x03) */
-#define SDADC_SDADC_CTRL_REG_SDADC_SE_Pos (9UL) /*!< SDADC_SE (Bit 9) */
-#define SDADC_SDADC_CTRL_REG_SDADC_SE_Msk (0x200UL) /*!< SDADC_SE (Bitfield-Mask: 0x01) */
-#define SDADC_SDADC_CTRL_REG_SDADC_INN_SEL_Pos (6UL) /*!< SDADC_INN_SEL (Bit 6) */
-#define SDADC_SDADC_CTRL_REG_SDADC_INN_SEL_Msk (0x1c0UL) /*!< SDADC_INN_SEL (Bitfield-Mask: 0x07) */
-#define SDADC_SDADC_CTRL_REG_SDADC_INP_SEL_Pos (2UL) /*!< SDADC_INP_SEL (Bit 2) */
-#define SDADC_SDADC_CTRL_REG_SDADC_INP_SEL_Msk (0x3cUL) /*!< SDADC_INP_SEL (Bitfield-Mask: 0x0f) */
-#define SDADC_SDADC_CTRL_REG_SDADC_START_Pos (1UL) /*!< SDADC_START (Bit 1) */
-#define SDADC_SDADC_CTRL_REG_SDADC_START_Msk (0x2UL) /*!< SDADC_START (Bitfield-Mask: 0x01) */
-#define SDADC_SDADC_CTRL_REG_SDADC_EN_Pos (0UL) /*!< SDADC_EN (Bit 0) */
-#define SDADC_SDADC_CTRL_REG_SDADC_EN_Msk (0x1UL) /*!< SDADC_EN (Bitfield-Mask: 0x01) */
-/* ================================================== SDADC_GAIN_CORR_REG ================================================== */
-#define SDADC_SDADC_GAIN_CORR_REG_SDADC_GAIN_CORR_Pos (0UL) /*!< SDADC_GAIN_CORR (Bit 0) */
-#define SDADC_SDADC_GAIN_CORR_REG_SDADC_GAIN_CORR_Msk (0x3ffUL) /*!< SDADC_GAIN_CORR (Bitfield-Mask: 0x3ff) */
-/* ================================================== SDADC_OFFS_CORR_REG ================================================== */
-#define SDADC_SDADC_OFFS_CORR_REG_SDADC_OFFS_CORR_Pos (0UL) /*!< SDADC_OFFS_CORR (Bit 0) */
-#define SDADC_SDADC_OFFS_CORR_REG_SDADC_OFFS_CORR_Msk (0x3ffUL) /*!< SDADC_OFFS_CORR (Bitfield-Mask: 0x3ff) */
-/* =================================================== SDADC_RESULT_REG ==================================================== */
-#define SDADC_SDADC_RESULT_REG_SDADC_VAL_Pos (0UL) /*!< SDADC_VAL (Bit 0) */
-#define SDADC_SDADC_RESULT_REG_SDADC_VAL_Msk (0xffffUL) /*!< SDADC_VAL (Bitfield-Mask: 0xffff) */
-/* ==================================================== SDADC_TEST_REG ===================================================== */
-#define SDADC_SDADC_TEST_REG_SDADC_CLK_FREQ_Pos (6UL) /*!< SDADC_CLK_FREQ (Bit 6) */
-#define SDADC_SDADC_TEST_REG_SDADC_CLK_FREQ_Msk (0xc0UL) /*!< SDADC_CLK_FREQ (Bitfield-Mask: 0x03) */
-
-
-/* =========================================================================================================================== */
-/* ================ SMOTOR ================ */
-/* =========================================================================================================================== */
-
-/* ==================================================== CMD_TABLE_BASE ===================================================== */
-/* ===================================================== PG0_CTRL_REG ====================================================== */
-#define SMOTOR_PG0_CTRL_REG_GENEND_IRQ_EN_Pos (15UL) /*!< GENEND_IRQ_EN (Bit 15) */
-#define SMOTOR_PG0_CTRL_REG_GENEND_IRQ_EN_Msk (0x8000UL) /*!< GENEND_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG0_CTRL_REG_GENSTART_IRQ_EN_Pos (14UL) /*!< GENSTART_IRQ_EN (Bit 14) */
-#define SMOTOR_PG0_CTRL_REG_GENSTART_IRQ_EN_Msk (0x4000UL) /*!< GENSTART_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG0_CTRL_REG_PG_START_MODE_Pos (13UL) /*!< PG_START_MODE (Bit 13) */
-#define SMOTOR_PG0_CTRL_REG_PG_START_MODE_Msk (0x2000UL) /*!< PG_START_MODE (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG0_CTRL_REG_PG_MODE_Pos (12UL) /*!< PG_MODE (Bit 12) */
-#define SMOTOR_PG0_CTRL_REG_PG_MODE_Msk (0x1000UL) /*!< PG_MODE (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG0_CTRL_REG_SIG3_EN_Pos (11UL) /*!< SIG3_EN (Bit 11) */
-#define SMOTOR_PG0_CTRL_REG_SIG3_EN_Msk (0x800UL) /*!< SIG3_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG0_CTRL_REG_SIG2_EN_Pos (10UL) /*!< SIG2_EN (Bit 10) */
-#define SMOTOR_PG0_CTRL_REG_SIG2_EN_Msk (0x400UL) /*!< SIG2_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG0_CTRL_REG_SIG1_EN_Pos (9UL) /*!< SIG1_EN (Bit 9) */
-#define SMOTOR_PG0_CTRL_REG_SIG1_EN_Msk (0x200UL) /*!< SIG1_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG0_CTRL_REG_SIG0_EN_Pos (8UL) /*!< SIG0_EN (Bit 8) */
-#define SMOTOR_PG0_CTRL_REG_SIG0_EN_Msk (0x100UL) /*!< SIG0_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG0_CTRL_REG_OUT3_SIG_Pos (6UL) /*!< OUT3_SIG (Bit 6) */
-#define SMOTOR_PG0_CTRL_REG_OUT3_SIG_Msk (0xc0UL) /*!< OUT3_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG0_CTRL_REG_OUT2_SIG_Pos (4UL) /*!< OUT2_SIG (Bit 4) */
-#define SMOTOR_PG0_CTRL_REG_OUT2_SIG_Msk (0x30UL) /*!< OUT2_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG0_CTRL_REG_OUT1_SIG_Pos (2UL) /*!< OUT1_SIG (Bit 2) */
-#define SMOTOR_PG0_CTRL_REG_OUT1_SIG_Msk (0xcUL) /*!< OUT1_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG0_CTRL_REG_OUT0_SIG_Pos (0UL) /*!< OUT0_SIG (Bit 0) */
-#define SMOTOR_PG0_CTRL_REG_OUT0_SIG_Msk (0x3UL) /*!< OUT0_SIG (Bitfield-Mask: 0x03) */
-/* ===================================================== PG1_CTRL_REG ====================================================== */
-#define SMOTOR_PG1_CTRL_REG_GENEND_IRQ_EN_Pos (15UL) /*!< GENEND_IRQ_EN (Bit 15) */
-#define SMOTOR_PG1_CTRL_REG_GENEND_IRQ_EN_Msk (0x8000UL) /*!< GENEND_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG1_CTRL_REG_GENSTART_IRQ_EN_Pos (14UL) /*!< GENSTART_IRQ_EN (Bit 14) */
-#define SMOTOR_PG1_CTRL_REG_GENSTART_IRQ_EN_Msk (0x4000UL) /*!< GENSTART_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG1_CTRL_REG_PG_START_MODE_Pos (13UL) /*!< PG_START_MODE (Bit 13) */
-#define SMOTOR_PG1_CTRL_REG_PG_START_MODE_Msk (0x2000UL) /*!< PG_START_MODE (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG1_CTRL_REG_PG_MODE_Pos (12UL) /*!< PG_MODE (Bit 12) */
-#define SMOTOR_PG1_CTRL_REG_PG_MODE_Msk (0x1000UL) /*!< PG_MODE (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG1_CTRL_REG_SIG3_EN_Pos (11UL) /*!< SIG3_EN (Bit 11) */
-#define SMOTOR_PG1_CTRL_REG_SIG3_EN_Msk (0x800UL) /*!< SIG3_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG1_CTRL_REG_SIG2_EN_Pos (10UL) /*!< SIG2_EN (Bit 10) */
-#define SMOTOR_PG1_CTRL_REG_SIG2_EN_Msk (0x400UL) /*!< SIG2_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG1_CTRL_REG_SIG1_EN_Pos (9UL) /*!< SIG1_EN (Bit 9) */
-#define SMOTOR_PG1_CTRL_REG_SIG1_EN_Msk (0x200UL) /*!< SIG1_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG1_CTRL_REG_SIG0_EN_Pos (8UL) /*!< SIG0_EN (Bit 8) */
-#define SMOTOR_PG1_CTRL_REG_SIG0_EN_Msk (0x100UL) /*!< SIG0_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG1_CTRL_REG_OUT3_SIG_Pos (6UL) /*!< OUT3_SIG (Bit 6) */
-#define SMOTOR_PG1_CTRL_REG_OUT3_SIG_Msk (0xc0UL) /*!< OUT3_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG1_CTRL_REG_OUT2_SIG_Pos (4UL) /*!< OUT2_SIG (Bit 4) */
-#define SMOTOR_PG1_CTRL_REG_OUT2_SIG_Msk (0x30UL) /*!< OUT2_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG1_CTRL_REG_OUT1_SIG_Pos (2UL) /*!< OUT1_SIG (Bit 2) */
-#define SMOTOR_PG1_CTRL_REG_OUT1_SIG_Msk (0xcUL) /*!< OUT1_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG1_CTRL_REG_OUT0_SIG_Pos (0UL) /*!< OUT0_SIG (Bit 0) */
-#define SMOTOR_PG1_CTRL_REG_OUT0_SIG_Msk (0x3UL) /*!< OUT0_SIG (Bitfield-Mask: 0x03) */
-/* ===================================================== PG2_CTRL_REG ====================================================== */
-#define SMOTOR_PG2_CTRL_REG_GENEND_IRQ_EN_Pos (15UL) /*!< GENEND_IRQ_EN (Bit 15) */
-#define SMOTOR_PG2_CTRL_REG_GENEND_IRQ_EN_Msk (0x8000UL) /*!< GENEND_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG2_CTRL_REG_GENSTART_IRQ_EN_Pos (14UL) /*!< GENSTART_IRQ_EN (Bit 14) */
-#define SMOTOR_PG2_CTRL_REG_GENSTART_IRQ_EN_Msk (0x4000UL) /*!< GENSTART_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG2_CTRL_REG_PG_START_MODE_Pos (13UL) /*!< PG_START_MODE (Bit 13) */
-#define SMOTOR_PG2_CTRL_REG_PG_START_MODE_Msk (0x2000UL) /*!< PG_START_MODE (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG2_CTRL_REG_PG_MODE_Pos (12UL) /*!< PG_MODE (Bit 12) */
-#define SMOTOR_PG2_CTRL_REG_PG_MODE_Msk (0x1000UL) /*!< PG_MODE (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG2_CTRL_REG_SIG3_EN_Pos (11UL) /*!< SIG3_EN (Bit 11) */
-#define SMOTOR_PG2_CTRL_REG_SIG3_EN_Msk (0x800UL) /*!< SIG3_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG2_CTRL_REG_SIG2_EN_Pos (10UL) /*!< SIG2_EN (Bit 10) */
-#define SMOTOR_PG2_CTRL_REG_SIG2_EN_Msk (0x400UL) /*!< SIG2_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG2_CTRL_REG_SIG1_EN_Pos (9UL) /*!< SIG1_EN (Bit 9) */
-#define SMOTOR_PG2_CTRL_REG_SIG1_EN_Msk (0x200UL) /*!< SIG1_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG2_CTRL_REG_SIG0_EN_Pos (8UL) /*!< SIG0_EN (Bit 8) */
-#define SMOTOR_PG2_CTRL_REG_SIG0_EN_Msk (0x100UL) /*!< SIG0_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG2_CTRL_REG_OUT3_SIG_Pos (6UL) /*!< OUT3_SIG (Bit 6) */
-#define SMOTOR_PG2_CTRL_REG_OUT3_SIG_Msk (0xc0UL) /*!< OUT3_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG2_CTRL_REG_OUT2_SIG_Pos (4UL) /*!< OUT2_SIG (Bit 4) */
-#define SMOTOR_PG2_CTRL_REG_OUT2_SIG_Msk (0x30UL) /*!< OUT2_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG2_CTRL_REG_OUT1_SIG_Pos (2UL) /*!< OUT1_SIG (Bit 2) */
-#define SMOTOR_PG2_CTRL_REG_OUT1_SIG_Msk (0xcUL) /*!< OUT1_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG2_CTRL_REG_OUT0_SIG_Pos (0UL) /*!< OUT0_SIG (Bit 0) */
-#define SMOTOR_PG2_CTRL_REG_OUT0_SIG_Msk (0x3UL) /*!< OUT0_SIG (Bitfield-Mask: 0x03) */
-/* ===================================================== PG3_CTRL_REG ====================================================== */
-#define SMOTOR_PG3_CTRL_REG_GENEND_IRQ_EN_Pos (15UL) /*!< GENEND_IRQ_EN (Bit 15) */
-#define SMOTOR_PG3_CTRL_REG_GENEND_IRQ_EN_Msk (0x8000UL) /*!< GENEND_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG3_CTRL_REG_GENSTART_IRQ_EN_Pos (14UL) /*!< GENSTART_IRQ_EN (Bit 14) */
-#define SMOTOR_PG3_CTRL_REG_GENSTART_IRQ_EN_Msk (0x4000UL) /*!< GENSTART_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG3_CTRL_REG_PG_START_MODE_Pos (13UL) /*!< PG_START_MODE (Bit 13) */
-#define SMOTOR_PG3_CTRL_REG_PG_START_MODE_Msk (0x2000UL) /*!< PG_START_MODE (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG3_CTRL_REG_PG_MODE_Pos (12UL) /*!< PG_MODE (Bit 12) */
-#define SMOTOR_PG3_CTRL_REG_PG_MODE_Msk (0x1000UL) /*!< PG_MODE (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG3_CTRL_REG_SIG3_EN_Pos (11UL) /*!< SIG3_EN (Bit 11) */
-#define SMOTOR_PG3_CTRL_REG_SIG3_EN_Msk (0x800UL) /*!< SIG3_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG3_CTRL_REG_SIG2_EN_Pos (10UL) /*!< SIG2_EN (Bit 10) */
-#define SMOTOR_PG3_CTRL_REG_SIG2_EN_Msk (0x400UL) /*!< SIG2_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG3_CTRL_REG_SIG1_EN_Pos (9UL) /*!< SIG1_EN (Bit 9) */
-#define SMOTOR_PG3_CTRL_REG_SIG1_EN_Msk (0x200UL) /*!< SIG1_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG3_CTRL_REG_SIG0_EN_Pos (8UL) /*!< SIG0_EN (Bit 8) */
-#define SMOTOR_PG3_CTRL_REG_SIG0_EN_Msk (0x100UL) /*!< SIG0_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG3_CTRL_REG_OUT3_SIG_Pos (6UL) /*!< OUT3_SIG (Bit 6) */
-#define SMOTOR_PG3_CTRL_REG_OUT3_SIG_Msk (0xc0UL) /*!< OUT3_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG3_CTRL_REG_OUT2_SIG_Pos (4UL) /*!< OUT2_SIG (Bit 4) */
-#define SMOTOR_PG3_CTRL_REG_OUT2_SIG_Msk (0x30UL) /*!< OUT2_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG3_CTRL_REG_OUT1_SIG_Pos (2UL) /*!< OUT1_SIG (Bit 2) */
-#define SMOTOR_PG3_CTRL_REG_OUT1_SIG_Msk (0xcUL) /*!< OUT1_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG3_CTRL_REG_OUT0_SIG_Pos (0UL) /*!< OUT0_SIG (Bit 0) */
-#define SMOTOR_PG3_CTRL_REG_OUT0_SIG_Msk (0x3UL) /*!< OUT0_SIG (Bitfield-Mask: 0x03) */
-/* ===================================================== PG4_CTRL_REG ====================================================== */
-#define SMOTOR_PG4_CTRL_REG_GENEND_IRQ_EN_Pos (15UL) /*!< GENEND_IRQ_EN (Bit 15) */
-#define SMOTOR_PG4_CTRL_REG_GENEND_IRQ_EN_Msk (0x8000UL) /*!< GENEND_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG4_CTRL_REG_GENSTART_IRQ_EN_Pos (14UL) /*!< GENSTART_IRQ_EN (Bit 14) */
-#define SMOTOR_PG4_CTRL_REG_GENSTART_IRQ_EN_Msk (0x4000UL) /*!< GENSTART_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG4_CTRL_REG_PG_START_MODE_Pos (13UL) /*!< PG_START_MODE (Bit 13) */
-#define SMOTOR_PG4_CTRL_REG_PG_START_MODE_Msk (0x2000UL) /*!< PG_START_MODE (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG4_CTRL_REG_PG_MODE_Pos (12UL) /*!< PG_MODE (Bit 12) */
-#define SMOTOR_PG4_CTRL_REG_PG_MODE_Msk (0x1000UL) /*!< PG_MODE (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG4_CTRL_REG_SIG3_EN_Pos (11UL) /*!< SIG3_EN (Bit 11) */
-#define SMOTOR_PG4_CTRL_REG_SIG3_EN_Msk (0x800UL) /*!< SIG3_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG4_CTRL_REG_SIG2_EN_Pos (10UL) /*!< SIG2_EN (Bit 10) */
-#define SMOTOR_PG4_CTRL_REG_SIG2_EN_Msk (0x400UL) /*!< SIG2_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG4_CTRL_REG_SIG1_EN_Pos (9UL) /*!< SIG1_EN (Bit 9) */
-#define SMOTOR_PG4_CTRL_REG_SIG1_EN_Msk (0x200UL) /*!< SIG1_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG4_CTRL_REG_SIG0_EN_Pos (8UL) /*!< SIG0_EN (Bit 8) */
-#define SMOTOR_PG4_CTRL_REG_SIG0_EN_Msk (0x100UL) /*!< SIG0_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_PG4_CTRL_REG_OUT3_SIG_Pos (6UL) /*!< OUT3_SIG (Bit 6) */
-#define SMOTOR_PG4_CTRL_REG_OUT3_SIG_Msk (0xc0UL) /*!< OUT3_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG4_CTRL_REG_OUT2_SIG_Pos (4UL) /*!< OUT2_SIG (Bit 4) */
-#define SMOTOR_PG4_CTRL_REG_OUT2_SIG_Msk (0x30UL) /*!< OUT2_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG4_CTRL_REG_OUT1_SIG_Pos (2UL) /*!< OUT1_SIG (Bit 2) */
-#define SMOTOR_PG4_CTRL_REG_OUT1_SIG_Msk (0xcUL) /*!< OUT1_SIG (Bitfield-Mask: 0x03) */
-#define SMOTOR_PG4_CTRL_REG_OUT0_SIG_Pos (0UL) /*!< OUT0_SIG (Bit 0) */
-#define SMOTOR_PG4_CTRL_REG_OUT0_SIG_Msk (0x3UL) /*!< OUT0_SIG (Bitfield-Mask: 0x03) */
-/* ================================================== SMOTOR_CMD_FIFO_REG ================================================== */
-#define SMOTOR_SMOTOR_CMD_FIFO_REG_SMOTOR_CMD_FIFO_Pos (0UL) /*!< SMOTOR_CMD_FIFO (Bit 0) */
-#define SMOTOR_SMOTOR_CMD_FIFO_REG_SMOTOR_CMD_FIFO_Msk (0xffffUL) /*!< SMOTOR_CMD_FIFO (Bitfield-Mask: 0xffff) */
-/* ================================================ SMOTOR_CMD_READ_PTR_REG ================================================ */
-#define SMOTOR_SMOTOR_CMD_READ_PTR_REG_SMOTOR_CMD_READ_PTR_Pos (0UL) /*!< SMOTOR_CMD_READ_PTR (Bit 0) */
-#define SMOTOR_SMOTOR_CMD_READ_PTR_REG_SMOTOR_CMD_READ_PTR_Msk (0x3fUL) /*!< SMOTOR_CMD_READ_PTR (Bitfield-Mask: 0x3f) */
-/* =============================================== SMOTOR_CMD_WRITE_PTR_REG ================================================ */
-#define SMOTOR_SMOTOR_CMD_WRITE_PTR_REG_SMOTOR_CMD_WRITE_PTR_Pos (0UL) /*!< SMOTOR_CMD_WRITE_PTR (Bit 0) */
-#define SMOTOR_SMOTOR_CMD_WRITE_PTR_REG_SMOTOR_CMD_WRITE_PTR_Msk (0x3fUL) /*!< SMOTOR_CMD_WRITE_PTR (Bitfield-Mask: 0x3f) */
-/* ==================================================== SMOTOR_CTRL_REG ==================================================== */
-#define SMOTOR_SMOTOR_CTRL_REG_TRIG_RTC_EVENT_EN_Pos (28UL) /*!< TRIG_RTC_EVENT_EN (Bit 28) */
-#define SMOTOR_SMOTOR_CTRL_REG_TRIG_RTC_EVENT_EN_Msk (0x10000000UL) /*!< TRIG_RTC_EVENT_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_CTRL_REG_MC_LP_CLK_TRIG_EN_Pos (27UL) /*!< MC_LP_CLK_TRIG_EN (Bit 27) */
-#define SMOTOR_SMOTOR_CTRL_REG_MC_LP_CLK_TRIG_EN_Msk (0x8000000UL) /*!< MC_LP_CLK_TRIG_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_THRESHOLD_IRQ_EN_Pos (26UL) /*!< SMOTOR_THRESHOLD_IRQ_EN (Bit 26) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_THRESHOLD_IRQ_EN_Msk (0x4000000UL) /*!< SMOTOR_THRESHOLD_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_THRESHOLD_Pos (21UL) /*!< SMOTOR_THRESHOLD (Bit 21) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_THRESHOLD_Msk (0x3e00000UL) /*!< SMOTOR_THRESHOLD (Bitfield-Mask: 0x1f) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_FIFO_UNR_IRQ_EN_Pos (20UL) /*!< SMOTOR_FIFO_UNR_IRQ_EN (Bit 20) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_FIFO_UNR_IRQ_EN_Msk (0x100000UL) /*!< SMOTOR_FIFO_UNR_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_FIFO_OVF_IRQ_EN_Pos (19UL) /*!< SMOTOR_FIFO_OVF_IRQ_EN (Bit 19) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_FIFO_OVF_IRQ_EN_Msk (0x80000UL) /*!< SMOTOR_FIFO_OVF_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_GENEND_IRQ_EN_Pos (18UL) /*!< SMOTOR_GENEND_IRQ_EN (Bit 18) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_GENEND_IRQ_EN_Msk (0x40000UL) /*!< SMOTOR_GENEND_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_GENSTART_IRQ_EN_Pos (17UL) /*!< SMOTOR_GENSTART_IRQ_EN (Bit 17) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_GENSTART_IRQ_EN_Msk (0x20000UL) /*!< SMOTOR_GENSTART_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_MOI_Pos (7UL) /*!< SMOTOR_MOI (Bit 7) */
-#define SMOTOR_SMOTOR_CTRL_REG_SMOTOR_MOI_Msk (0x1ff80UL) /*!< SMOTOR_MOI (Bitfield-Mask: 0x3ff) */
-#define SMOTOR_SMOTOR_CTRL_REG_CYCLIC_SIZE_Pos (1UL) /*!< CYCLIC_SIZE (Bit 1) */
-#define SMOTOR_SMOTOR_CTRL_REG_CYCLIC_SIZE_Msk (0x7eUL) /*!< CYCLIC_SIZE (Bitfield-Mask: 0x3f) */
-#define SMOTOR_SMOTOR_CTRL_REG_CYCLIC_MODE_Pos (0UL) /*!< CYCLIC_MODE (Bit 0) */
-#define SMOTOR_SMOTOR_CTRL_REG_CYCLIC_MODE_Msk (0x1UL) /*!< CYCLIC_MODE (Bitfield-Mask: 0x01) */
-/* ================================================= SMOTOR_IRQ_CLEAR_REG ================================================== */
-#define SMOTOR_SMOTOR_IRQ_CLEAR_REG_THRESHOLD_IRQ_CLEAR_Pos (4UL) /*!< THRESHOLD_IRQ_CLEAR (Bit 4) */
-#define SMOTOR_SMOTOR_IRQ_CLEAR_REG_THRESHOLD_IRQ_CLEAR_Msk (0x10UL) /*!< THRESHOLD_IRQ_CLEAR (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_IRQ_CLEAR_REG_FIFO_UNR_IRQ_CLEAR_Pos (3UL) /*!< FIFO_UNR_IRQ_CLEAR (Bit 3) */
-#define SMOTOR_SMOTOR_IRQ_CLEAR_REG_FIFO_UNR_IRQ_CLEAR_Msk (0x8UL) /*!< FIFO_UNR_IRQ_CLEAR (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_IRQ_CLEAR_REG_FIFO_OVF_IRQ_CLEAR_Pos (2UL) /*!< FIFO_OVF_IRQ_CLEAR (Bit 2) */
-#define SMOTOR_SMOTOR_IRQ_CLEAR_REG_FIFO_OVF_IRQ_CLEAR_Msk (0x4UL) /*!< FIFO_OVF_IRQ_CLEAR (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_IRQ_CLEAR_REG_GENEND_IRQ_CLEAR_Pos (1UL) /*!< GENEND_IRQ_CLEAR (Bit 1) */
-#define SMOTOR_SMOTOR_IRQ_CLEAR_REG_GENEND_IRQ_CLEAR_Msk (0x2UL) /*!< GENEND_IRQ_CLEAR (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_IRQ_CLEAR_REG_GENSTART_IRQ_CLEAR_Pos (0UL) /*!< GENSTART_IRQ_CLEAR (Bit 0) */
-#define SMOTOR_SMOTOR_IRQ_CLEAR_REG_GENSTART_IRQ_CLEAR_Msk (0x1UL) /*!< GENSTART_IRQ_CLEAR (Bitfield-Mask: 0x01) */
-/* =================================================== SMOTOR_STATUS_REG =================================================== */
-#define SMOTOR_SMOTOR_STATUS_REG_PG4_BUSY_Pos (9UL) /*!< PG4_BUSY (Bit 9) */
-#define SMOTOR_SMOTOR_STATUS_REG_PG4_BUSY_Msk (0x200UL) /*!< PG4_BUSY (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_STATUS_REG_PG3_BUSY_Pos (8UL) /*!< PG3_BUSY (Bit 8) */
-#define SMOTOR_SMOTOR_STATUS_REG_PG3_BUSY_Msk (0x100UL) /*!< PG3_BUSY (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_STATUS_REG_PG2_BUSY_Pos (7UL) /*!< PG2_BUSY (Bit 7) */
-#define SMOTOR_SMOTOR_STATUS_REG_PG2_BUSY_Msk (0x80UL) /*!< PG2_BUSY (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_STATUS_REG_PG1_BUSY_Pos (6UL) /*!< PG1_BUSY (Bit 6) */
-#define SMOTOR_SMOTOR_STATUS_REG_PG1_BUSY_Msk (0x40UL) /*!< PG1_BUSY (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_STATUS_REG_PG0_BUSY_Pos (5UL) /*!< PG0_BUSY (Bit 5) */
-#define SMOTOR_SMOTOR_STATUS_REG_PG0_BUSY_Msk (0x20UL) /*!< PG0_BUSY (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_STATUS_REG_THRESHOLD_IRQ_STATUS_Pos (4UL) /*!< THRESHOLD_IRQ_STATUS (Bit 4) */
-#define SMOTOR_SMOTOR_STATUS_REG_THRESHOLD_IRQ_STATUS_Msk (0x10UL) /*!< THRESHOLD_IRQ_STATUS (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_STATUS_REG_FIFO_UNR_IRQ_STATUS_Pos (3UL) /*!< FIFO_UNR_IRQ_STATUS (Bit 3) */
-#define SMOTOR_SMOTOR_STATUS_REG_FIFO_UNR_IRQ_STATUS_Msk (0x8UL) /*!< FIFO_UNR_IRQ_STATUS (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_STATUS_REG_FIFO_OVF_IRQ_STATUS_Pos (2UL) /*!< FIFO_OVF_IRQ_STATUS (Bit 2) */
-#define SMOTOR_SMOTOR_STATUS_REG_FIFO_OVF_IRQ_STATUS_Msk (0x4UL) /*!< FIFO_OVF_IRQ_STATUS (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_STATUS_REG_GENEND_IRQ_STATUS_Pos (1UL) /*!< GENEND_IRQ_STATUS (Bit 1) */
-#define SMOTOR_SMOTOR_STATUS_REG_GENEND_IRQ_STATUS_Msk (0x2UL) /*!< GENEND_IRQ_STATUS (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_STATUS_REG_GENSTART_IRQ_STATUS_Pos (0UL) /*!< GENSTART_IRQ_STATUS (Bit 0) */
-#define SMOTOR_SMOTOR_STATUS_REG_GENSTART_IRQ_STATUS_Msk (0x1UL) /*!< GENSTART_IRQ_STATUS (Bitfield-Mask: 0x01) */
-/* ================================================== SMOTOR_TRIGGER_REG =================================================== */
-#define SMOTOR_SMOTOR_TRIGGER_REG_PG4_START_Pos (5UL) /*!< PG4_START (Bit 5) */
-#define SMOTOR_SMOTOR_TRIGGER_REG_PG4_START_Msk (0x20UL) /*!< PG4_START (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_TRIGGER_REG_PG3_START_Pos (4UL) /*!< PG3_START (Bit 4) */
-#define SMOTOR_SMOTOR_TRIGGER_REG_PG3_START_Msk (0x10UL) /*!< PG3_START (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_TRIGGER_REG_PG2_START_Pos (3UL) /*!< PG2_START (Bit 3) */
-#define SMOTOR_SMOTOR_TRIGGER_REG_PG2_START_Msk (0x8UL) /*!< PG2_START (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_TRIGGER_REG_PG1_START_Pos (2UL) /*!< PG1_START (Bit 2) */
-#define SMOTOR_SMOTOR_TRIGGER_REG_PG1_START_Msk (0x4UL) /*!< PG1_START (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_TRIGGER_REG_PG0_START_Pos (1UL) /*!< PG0_START (Bit 1) */
-#define SMOTOR_SMOTOR_TRIGGER_REG_PG0_START_Msk (0x2UL) /*!< PG0_START (Bitfield-Mask: 0x01) */
-#define SMOTOR_SMOTOR_TRIGGER_REG_POP_CMD_Pos (0UL) /*!< POP_CMD (Bit 0) */
-#define SMOTOR_SMOTOR_TRIGGER_REG_POP_CMD_Msk (0x1UL) /*!< POP_CMD (Bitfield-Mask: 0x01) */
-/* ==================================================== WAVETABLE_BASE ===================================================== */
-
-
-/* =========================================================================================================================== */
-/* ================ SNC ================ */
-/* =========================================================================================================================== */
-
-/* ===================================================== SNC_CTRL_REG ====================================================== */
-#define SNC_SNC_CTRL_REG_SNC_IRQ_ACK_Pos (8UL) /*!< SNC_IRQ_ACK (Bit 8) */
-#define SNC_SNC_CTRL_REG_SNC_IRQ_ACK_Msk (0x100UL) /*!< SNC_IRQ_ACK (Bitfield-Mask: 0x01) */
-#define SNC_SNC_CTRL_REG_SNC_IRQ_CONFIG_Pos (6UL) /*!< SNC_IRQ_CONFIG (Bit 6) */
-#define SNC_SNC_CTRL_REG_SNC_IRQ_CONFIG_Msk (0xc0UL) /*!< SNC_IRQ_CONFIG (Bitfield-Mask: 0x03) */
-#define SNC_SNC_CTRL_REG_SNC_IRQ_EN_Pos (5UL) /*!< SNC_IRQ_EN (Bit 5) */
-#define SNC_SNC_CTRL_REG_SNC_IRQ_EN_Msk (0x20UL) /*!< SNC_IRQ_EN (Bitfield-Mask: 0x01) */
-#define SNC_SNC_CTRL_REG_SNC_BRANCH_LOOP_INIT_Pos (4UL) /*!< SNC_BRANCH_LOOP_INIT (Bit 4) */
-#define SNC_SNC_CTRL_REG_SNC_BRANCH_LOOP_INIT_Msk (0x10UL) /*!< SNC_BRANCH_LOOP_INIT (Bitfield-Mask: 0x01) */
-#define SNC_SNC_CTRL_REG_SNC_RESET_Pos (3UL) /*!< SNC_RESET (Bit 3) */
-#define SNC_SNC_CTRL_REG_SNC_RESET_Msk (0x8UL) /*!< SNC_RESET (Bitfield-Mask: 0x01) */
-#define SNC_SNC_CTRL_REG_BUS_ERROR_DETECT_EN_Pos (2UL) /*!< BUS_ERROR_DETECT_EN (Bit 2) */
-#define SNC_SNC_CTRL_REG_BUS_ERROR_DETECT_EN_Msk (0x4UL) /*!< BUS_ERROR_DETECT_EN (Bitfield-Mask: 0x01) */
-#define SNC_SNC_CTRL_REG_SNC_SW_CTRL_Pos (1UL) /*!< SNC_SW_CTRL (Bit 1) */
-#define SNC_SNC_CTRL_REG_SNC_SW_CTRL_Msk (0x2UL) /*!< SNC_SW_CTRL (Bitfield-Mask: 0x01) */
-#define SNC_SNC_CTRL_REG_SNC_EN_Pos (0UL) /*!< SNC_EN (Bit 0) */
-#define SNC_SNC_CTRL_REG_SNC_EN_Msk (0x1UL) /*!< SNC_EN (Bitfield-Mask: 0x01) */
-/* =================================================== SNC_LP_TIMER_REG ==================================================== */
-#define SNC_SNC_LP_TIMER_REG_LP_TIMER_Pos (0UL) /*!< LP_TIMER (Bit 0) */
-#define SNC_SNC_LP_TIMER_REG_LP_TIMER_Msk (0xffUL) /*!< LP_TIMER (Bitfield-Mask: 0xff) */
-/* ====================================================== SNC_PC_REG ======================================================= */
-#define SNC_SNC_PC_REG_PC_REG_Pos (2UL) /*!< PC_REG (Bit 2) */
-#define SNC_SNC_PC_REG_PC_REG_Msk (0x7fffcUL) /*!< PC_REG (Bitfield-Mask: 0x1ffff) */
-/* ====================================================== SNC_R1_REG ======================================================= */
-#define SNC_SNC_R1_REG_R1_REG_Pos (0UL) /*!< R1_REG (Bit 0) */
-#define SNC_SNC_R1_REG_R1_REG_Msk (0xffffffffUL) /*!< R1_REG (Bitfield-Mask: 0xffffffff) */
-/* ====================================================== SNC_R2_REG ======================================================= */
-#define SNC_SNC_R2_REG_R2_REG_Pos (0UL) /*!< R2_REG (Bit 0) */
-#define SNC_SNC_R2_REG_R2_REG_Msk (0xffffffffUL) /*!< R2_REG (Bitfield-Mask: 0xffffffff) */
-/* ==================================================== SNC_STATUS_REG ===================================================== */
-#define SNC_SNC_STATUS_REG_SNC_PC_LOADED_Pos (6UL) /*!< SNC_PC_LOADED (Bit 6) */
-#define SNC_SNC_STATUS_REG_SNC_PC_LOADED_Msk (0x40UL) /*!< SNC_PC_LOADED (Bitfield-Mask: 0x01) */
-#define SNC_SNC_STATUS_REG_SNC_IS_STOPPED_Pos (5UL) /*!< SNC_IS_STOPPED (Bit 5) */
-#define SNC_SNC_STATUS_REG_SNC_IS_STOPPED_Msk (0x20UL) /*!< SNC_IS_STOPPED (Bitfield-Mask: 0x01) */
-#define SNC_SNC_STATUS_REG_HARD_FAULT_STATUS_Pos (4UL) /*!< HARD_FAULT_STATUS (Bit 4) */
-#define SNC_SNC_STATUS_REG_HARD_FAULT_STATUS_Msk (0x10UL) /*!< HARD_FAULT_STATUS (Bitfield-Mask: 0x01) */
-#define SNC_SNC_STATUS_REG_BUS_ERROR_STATUS_Pos (3UL) /*!< BUS_ERROR_STATUS (Bit 3) */
-#define SNC_SNC_STATUS_REG_BUS_ERROR_STATUS_Msk (0x8UL) /*!< BUS_ERROR_STATUS (Bitfield-Mask: 0x01) */
-#define SNC_SNC_STATUS_REG_SNC_DONE_STATUS_Pos (2UL) /*!< SNC_DONE_STATUS (Bit 2) */
-#define SNC_SNC_STATUS_REG_SNC_DONE_STATUS_Msk (0x4UL) /*!< SNC_DONE_STATUS (Bitfield-Mask: 0x01) */
-#define SNC_SNC_STATUS_REG_GR_FLAG_Pos (1UL) /*!< GR_FLAG (Bit 1) */
-#define SNC_SNC_STATUS_REG_GR_FLAG_Msk (0x2UL) /*!< GR_FLAG (Bitfield-Mask: 0x01) */
-#define SNC_SNC_STATUS_REG_EQ_FLAG_Pos (0UL) /*!< EQ_FLAG (Bit 0) */
-#define SNC_SNC_STATUS_REG_EQ_FLAG_Msk (0x1UL) /*!< EQ_FLAG (Bitfield-Mask: 0x01) */
-/* ===================================================== SNC_TMP1_REG ====================================================== */
-#define SNC_SNC_TMP1_REG_TMP1_REG_Pos (0UL) /*!< TMP1_REG (Bit 0) */
-#define SNC_SNC_TMP1_REG_TMP1_REG_Msk (0xffffffffUL) /*!< TMP1_REG (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== SNC_TMP2_REG ====================================================== */
-#define SNC_SNC_TMP2_REG_TMP2_REG_Pos (0UL) /*!< TMP2_REG (Bit 0) */
-#define SNC_SNC_TMP2_REG_TMP2_REG_Msk (0xffffffffUL) /*!< TMP2_REG (Bitfield-Mask: 0xffffffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ SPI ================ */
-/* =========================================================================================================================== */
-
-/* =================================================== SPI_CLEAR_INT_REG =================================================== */
-#define SPI_SPI_CLEAR_INT_REG_SPI_CLEAR_INT_Pos (0UL) /*!< SPI_CLEAR_INT (Bit 0) */
-#define SPI_SPI_CLEAR_INT_REG_SPI_CLEAR_INT_Msk (0xffffffffUL) /*!< SPI_CLEAR_INT (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== SPI_CTRL_REG ====================================================== */
-#define SPI_SPI_CTRL_REG_SPI_TX_FIFO_NOTFULL_MASK_Pos (25UL) /*!< SPI_TX_FIFO_NOTFULL_MASK (Bit 25) */
-#define SPI_SPI_CTRL_REG_SPI_TX_FIFO_NOTFULL_MASK_Msk (0x2000000UL) /*!< SPI_TX_FIFO_NOTFULL_MASK (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_DMA_TXREQ_MODE_Pos (24UL) /*!< SPI_DMA_TXREQ_MODE (Bit 24) */
-#define SPI_SPI_CTRL_REG_SPI_DMA_TXREQ_MODE_Msk (0x1000000UL) /*!< SPI_DMA_TXREQ_MODE (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_TX_FIFO_EMPTY_Pos (23UL) /*!< SPI_TX_FIFO_EMPTY (Bit 23) */
-#define SPI_SPI_CTRL_REG_SPI_TX_FIFO_EMPTY_Msk (0x800000UL) /*!< SPI_TX_FIFO_EMPTY (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_RX_FIFO_FULL_Pos (22UL) /*!< SPI_RX_FIFO_FULL (Bit 22) */
-#define SPI_SPI_CTRL_REG_SPI_RX_FIFO_FULL_Msk (0x400000UL) /*!< SPI_RX_FIFO_FULL (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_RX_FIFO_EMPTY_Pos (21UL) /*!< SPI_RX_FIFO_EMPTY (Bit 21) */
-#define SPI_SPI_CTRL_REG_SPI_RX_FIFO_EMPTY_Msk (0x200000UL) /*!< SPI_RX_FIFO_EMPTY (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_9BIT_VAL_Pos (20UL) /*!< SPI_9BIT_VAL (Bit 20) */
-#define SPI_SPI_CTRL_REG_SPI_9BIT_VAL_Msk (0x100000UL) /*!< SPI_9BIT_VAL (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_BUSY_Pos (19UL) /*!< SPI_BUSY (Bit 19) */
-#define SPI_SPI_CTRL_REG_SPI_BUSY_Msk (0x80000UL) /*!< SPI_BUSY (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_PRIORITY_Pos (18UL) /*!< SPI_PRIORITY (Bit 18) */
-#define SPI_SPI_CTRL_REG_SPI_PRIORITY_Msk (0x40000UL) /*!< SPI_PRIORITY (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_FIFO_MODE_Pos (16UL) /*!< SPI_FIFO_MODE (Bit 16) */
-#define SPI_SPI_CTRL_REG_SPI_FIFO_MODE_Msk (0x30000UL) /*!< SPI_FIFO_MODE (Bitfield-Mask: 0x03) */
-#define SPI_SPI_CTRL_REG_SPI_EN_CTRL_Pos (15UL) /*!< SPI_EN_CTRL (Bit 15) */
-#define SPI_SPI_CTRL_REG_SPI_EN_CTRL_Msk (0x8000UL) /*!< SPI_EN_CTRL (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_MINT_Pos (14UL) /*!< SPI_MINT (Bit 14) */
-#define SPI_SPI_CTRL_REG_SPI_MINT_Msk (0x4000UL) /*!< SPI_MINT (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_INT_BIT_Pos (13UL) /*!< SPI_INT_BIT (Bit 13) */
-#define SPI_SPI_CTRL_REG_SPI_INT_BIT_Msk (0x2000UL) /*!< SPI_INT_BIT (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_DI_Pos (12UL) /*!< SPI_DI (Bit 12) */
-#define SPI_SPI_CTRL_REG_SPI_DI_Msk (0x1000UL) /*!< SPI_DI (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_TXH_Pos (11UL) /*!< SPI_TXH (Bit 11) */
-#define SPI_SPI_CTRL_REG_SPI_TXH_Msk (0x800UL) /*!< SPI_TXH (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_FORCE_DO_Pos (10UL) /*!< SPI_FORCE_DO (Bit 10) */
-#define SPI_SPI_CTRL_REG_SPI_FORCE_DO_Msk (0x400UL) /*!< SPI_FORCE_DO (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_WORD_Pos (8UL) /*!< SPI_WORD (Bit 8) */
-#define SPI_SPI_CTRL_REG_SPI_WORD_Msk (0x300UL) /*!< SPI_WORD (Bitfield-Mask: 0x03) */
-#define SPI_SPI_CTRL_REG_SPI_RST_Pos (7UL) /*!< SPI_RST (Bit 7) */
-#define SPI_SPI_CTRL_REG_SPI_RST_Msk (0x80UL) /*!< SPI_RST (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_SMN_Pos (6UL) /*!< SPI_SMN (Bit 6) */
-#define SPI_SPI_CTRL_REG_SPI_SMN_Msk (0x40UL) /*!< SPI_SMN (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_DO_Pos (5UL) /*!< SPI_DO (Bit 5) */
-#define SPI_SPI_CTRL_REG_SPI_DO_Msk (0x20UL) /*!< SPI_DO (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_CLK_Pos (3UL) /*!< SPI_CLK (Bit 3) */
-#define SPI_SPI_CTRL_REG_SPI_CLK_Msk (0x18UL) /*!< SPI_CLK (Bitfield-Mask: 0x03) */
-#define SPI_SPI_CTRL_REG_SPI_POL_Pos (2UL) /*!< SPI_POL (Bit 2) */
-#define SPI_SPI_CTRL_REG_SPI_POL_Msk (0x4UL) /*!< SPI_POL (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_PHA_Pos (1UL) /*!< SPI_PHA (Bit 1) */
-#define SPI_SPI_CTRL_REG_SPI_PHA_Msk (0x2UL) /*!< SPI_PHA (Bitfield-Mask: 0x01) */
-#define SPI_SPI_CTRL_REG_SPI_ON_Pos (0UL) /*!< SPI_ON (Bit 0) */
-#define SPI_SPI_CTRL_REG_SPI_ON_Msk (0x1UL) /*!< SPI_ON (Bitfield-Mask: 0x01) */
-/* ===================================================== SPI_RX_TX_REG ===================================================== */
-#define SPI_SPI_RX_TX_REG_SPI_DATA_Pos (0UL) /*!< SPI_DATA (Bit 0) */
-#define SPI_SPI_RX_TX_REG_SPI_DATA_Msk (0xffffffffUL) /*!< SPI_DATA (Bitfield-Mask: 0xffffffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ SPI2 ================ */
-/* =========================================================================================================================== */
-
-/* ================================================== SPI2_CLEAR_INT_REG =================================================== */
-#define SPI2_SPI2_CLEAR_INT_REG_SPI_CLEAR_INT_Pos (0UL) /*!< SPI_CLEAR_INT (Bit 0) */
-#define SPI2_SPI2_CLEAR_INT_REG_SPI_CLEAR_INT_Msk (0xffffffffUL) /*!< SPI_CLEAR_INT (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== SPI2_CTRL_REG ===================================================== */
-#define SPI2_SPI2_CTRL_REG_SPI_TX_FIFO_NOTFULL_MASK_Pos (25UL) /*!< SPI_TX_FIFO_NOTFULL_MASK (Bit 25) */
-#define SPI2_SPI2_CTRL_REG_SPI_TX_FIFO_NOTFULL_MASK_Msk (0x2000000UL) /*!< SPI_TX_FIFO_NOTFULL_MASK (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_DMA_TXREQ_MODE_Pos (24UL) /*!< SPI_DMA_TXREQ_MODE (Bit 24) */
-#define SPI2_SPI2_CTRL_REG_SPI_DMA_TXREQ_MODE_Msk (0x1000000UL) /*!< SPI_DMA_TXREQ_MODE (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_TX_FIFO_EMPTY_Pos (23UL) /*!< SPI_TX_FIFO_EMPTY (Bit 23) */
-#define SPI2_SPI2_CTRL_REG_SPI_TX_FIFO_EMPTY_Msk (0x800000UL) /*!< SPI_TX_FIFO_EMPTY (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_RX_FIFO_FULL_Pos (22UL) /*!< SPI_RX_FIFO_FULL (Bit 22) */
-#define SPI2_SPI2_CTRL_REG_SPI_RX_FIFO_FULL_Msk (0x400000UL) /*!< SPI_RX_FIFO_FULL (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_RX_FIFO_EMPTY_Pos (21UL) /*!< SPI_RX_FIFO_EMPTY (Bit 21) */
-#define SPI2_SPI2_CTRL_REG_SPI_RX_FIFO_EMPTY_Msk (0x200000UL) /*!< SPI_RX_FIFO_EMPTY (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_9BIT_VAL_Pos (20UL) /*!< SPI_9BIT_VAL (Bit 20) */
-#define SPI2_SPI2_CTRL_REG_SPI_9BIT_VAL_Msk (0x100000UL) /*!< SPI_9BIT_VAL (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_BUSY_Pos (19UL) /*!< SPI_BUSY (Bit 19) */
-#define SPI2_SPI2_CTRL_REG_SPI_BUSY_Msk (0x80000UL) /*!< SPI_BUSY (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_PRIORITY_Pos (18UL) /*!< SPI_PRIORITY (Bit 18) */
-#define SPI2_SPI2_CTRL_REG_SPI_PRIORITY_Msk (0x40000UL) /*!< SPI_PRIORITY (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_FIFO_MODE_Pos (16UL) /*!< SPI_FIFO_MODE (Bit 16) */
-#define SPI2_SPI2_CTRL_REG_SPI_FIFO_MODE_Msk (0x30000UL) /*!< SPI_FIFO_MODE (Bitfield-Mask: 0x03) */
-#define SPI2_SPI2_CTRL_REG_SPI_EN_CTRL_Pos (15UL) /*!< SPI_EN_CTRL (Bit 15) */
-#define SPI2_SPI2_CTRL_REG_SPI_EN_CTRL_Msk (0x8000UL) /*!< SPI_EN_CTRL (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_MINT_Pos (14UL) /*!< SPI_MINT (Bit 14) */
-#define SPI2_SPI2_CTRL_REG_SPI_MINT_Msk (0x4000UL) /*!< SPI_MINT (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_INT_BIT_Pos (13UL) /*!< SPI_INT_BIT (Bit 13) */
-#define SPI2_SPI2_CTRL_REG_SPI_INT_BIT_Msk (0x2000UL) /*!< SPI_INT_BIT (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_DI_Pos (12UL) /*!< SPI_DI (Bit 12) */
-#define SPI2_SPI2_CTRL_REG_SPI_DI_Msk (0x1000UL) /*!< SPI_DI (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_TXH_Pos (11UL) /*!< SPI_TXH (Bit 11) */
-#define SPI2_SPI2_CTRL_REG_SPI_TXH_Msk (0x800UL) /*!< SPI_TXH (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_FORCE_DO_Pos (10UL) /*!< SPI_FORCE_DO (Bit 10) */
-#define SPI2_SPI2_CTRL_REG_SPI_FORCE_DO_Msk (0x400UL) /*!< SPI_FORCE_DO (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_WORD_Pos (8UL) /*!< SPI_WORD (Bit 8) */
-#define SPI2_SPI2_CTRL_REG_SPI_WORD_Msk (0x300UL) /*!< SPI_WORD (Bitfield-Mask: 0x03) */
-#define SPI2_SPI2_CTRL_REG_SPI_RST_Pos (7UL) /*!< SPI_RST (Bit 7) */
-#define SPI2_SPI2_CTRL_REG_SPI_RST_Msk (0x80UL) /*!< SPI_RST (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_SMN_Pos (6UL) /*!< SPI_SMN (Bit 6) */
-#define SPI2_SPI2_CTRL_REG_SPI_SMN_Msk (0x40UL) /*!< SPI_SMN (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_DO_Pos (5UL) /*!< SPI_DO (Bit 5) */
-#define SPI2_SPI2_CTRL_REG_SPI_DO_Msk (0x20UL) /*!< SPI_DO (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_CLK_Pos (3UL) /*!< SPI_CLK (Bit 3) */
-#define SPI2_SPI2_CTRL_REG_SPI_CLK_Msk (0x18UL) /*!< SPI_CLK (Bitfield-Mask: 0x03) */
-#define SPI2_SPI2_CTRL_REG_SPI_POL_Pos (2UL) /*!< SPI_POL (Bit 2) */
-#define SPI2_SPI2_CTRL_REG_SPI_POL_Msk (0x4UL) /*!< SPI_POL (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_PHA_Pos (1UL) /*!< SPI_PHA (Bit 1) */
-#define SPI2_SPI2_CTRL_REG_SPI_PHA_Msk (0x2UL) /*!< SPI_PHA (Bitfield-Mask: 0x01) */
-#define SPI2_SPI2_CTRL_REG_SPI_ON_Pos (0UL) /*!< SPI_ON (Bit 0) */
-#define SPI2_SPI2_CTRL_REG_SPI_ON_Msk (0x1UL) /*!< SPI_ON (Bitfield-Mask: 0x01) */
-/* ==================================================== SPI2_RX_TX_REG ===================================================== */
-#define SPI2_SPI2_RX_TX_REG_SPI_DATA_Pos (0UL) /*!< SPI_DATA (Bit 0) */
-#define SPI2_SPI2_RX_TX_REG_SPI_DATA_Msk (0xffffffffUL) /*!< SPI_DATA (Bitfield-Mask: 0xffffffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ SYS_WDOG ================ */
-/* =========================================================================================================================== */
-
-/* =================================================== WATCHDOG_CTRL_REG =================================================== */
-#define SYS_WDOG_WATCHDOG_CTRL_REG_WRITE_BUSY_Pos (3UL) /*!< WRITE_BUSY (Bit 3) */
-#define SYS_WDOG_WATCHDOG_CTRL_REG_WRITE_BUSY_Msk (0x8UL) /*!< WRITE_BUSY (Bitfield-Mask: 0x01) */
-#define SYS_WDOG_WATCHDOG_CTRL_REG_WDOG_FREEZE_EN_Pos (2UL) /*!< WDOG_FREEZE_EN (Bit 2) */
-#define SYS_WDOG_WATCHDOG_CTRL_REG_WDOG_FREEZE_EN_Msk (0x4UL) /*!< WDOG_FREEZE_EN (Bitfield-Mask: 0x01) */
-#define SYS_WDOG_WATCHDOG_CTRL_REG_NMI_RST_Pos (0UL) /*!< NMI_RST (Bit 0) */
-#define SYS_WDOG_WATCHDOG_CTRL_REG_NMI_RST_Msk (0x1UL) /*!< NMI_RST (Bitfield-Mask: 0x01) */
-/* ===================================================== WATCHDOG_REG ====================================================== */
-#define SYS_WDOG_WATCHDOG_REG_WDOG_WEN_Pos (14UL) /*!< WDOG_WEN (Bit 14) */
-#define SYS_WDOG_WATCHDOG_REG_WDOG_WEN_Msk (0xffffc000UL) /*!< WDOG_WEN (Bitfield-Mask: 0x3ffff) */
-#define SYS_WDOG_WATCHDOG_REG_WDOG_VAL_NEG_Pos (13UL) /*!< WDOG_VAL_NEG (Bit 13) */
-#define SYS_WDOG_WATCHDOG_REG_WDOG_VAL_NEG_Msk (0x2000UL) /*!< WDOG_VAL_NEG (Bitfield-Mask: 0x01) */
-#define SYS_WDOG_WATCHDOG_REG_WDOG_VAL_Pos (0UL) /*!< WDOG_VAL (Bit 0) */
-#define SYS_WDOG_WATCHDOG_REG_WDOG_VAL_Msk (0x1fffUL) /*!< WDOG_VAL (Bitfield-Mask: 0x1fff) */
-
-
-/* =========================================================================================================================== */
-/* ================ TIMER ================ */
-/* =========================================================================================================================== */
-
-/* ================================================ TIMER_CAPTURE_GPIO1_REG ================================================ */
-#define TIMER_TIMER_CAPTURE_GPIO1_REG_TIM_CAPTURE_GPIO1_Pos (0UL) /*!< TIM_CAPTURE_GPIO1 (Bit 0) */
-#define TIMER_TIMER_CAPTURE_GPIO1_REG_TIM_CAPTURE_GPIO1_Msk (0xffffffUL) /*!< TIM_CAPTURE_GPIO1 (Bitfield-Mask: 0xffffff) */
-/* ================================================ TIMER_CAPTURE_GPIO2_REG ================================================ */
-#define TIMER_TIMER_CAPTURE_GPIO2_REG_TIM_CAPTURE_GPIO2_Pos (0UL) /*!< TIM_CAPTURE_GPIO2 (Bit 0) */
-#define TIMER_TIMER_CAPTURE_GPIO2_REG_TIM_CAPTURE_GPIO2_Msk (0xffffffUL) /*!< TIM_CAPTURE_GPIO2 (Bitfield-Mask: 0xffffff) */
-/* ================================================ TIMER_CAPTURE_GPIO3_REG ================================================ */
-#define TIMER_TIMER_CAPTURE_GPIO3_REG_TIM_CAPTURE_GPIO3_Pos (0UL) /*!< TIM_CAPTURE_GPIO3 (Bit 0) */
-#define TIMER_TIMER_CAPTURE_GPIO3_REG_TIM_CAPTURE_GPIO3_Msk (0xffffffUL) /*!< TIM_CAPTURE_GPIO3 (Bitfield-Mask: 0xffffff) */
-/* ================================================ TIMER_CAPTURE_GPIO4_REG ================================================ */
-#define TIMER_TIMER_CAPTURE_GPIO4_REG_TIM_CAPTURE_GPIO4_Pos (0UL) /*!< TIM_CAPTURE_GPIO4 (Bit 0) */
-#define TIMER_TIMER_CAPTURE_GPIO4_REG_TIM_CAPTURE_GPIO4_Msk (0xffffffUL) /*!< TIM_CAPTURE_GPIO4 (Bitfield-Mask: 0xffffff) */
-/* ============================================== TIMER_CLEAR_GPIO_EVENT_REG =============================================== */
-#define TIMER_TIMER_CLEAR_GPIO_EVENT_REG_TIM_CLEAR_GPIO4_EVENT_Pos (3UL) /*!< TIM_CLEAR_GPIO4_EVENT (Bit 3) */
-#define TIMER_TIMER_CLEAR_GPIO_EVENT_REG_TIM_CLEAR_GPIO4_EVENT_Msk (0x8UL) /*!< TIM_CLEAR_GPIO4_EVENT (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CLEAR_GPIO_EVENT_REG_TIM_CLEAR_GPIO3_EVENT_Pos (2UL) /*!< TIM_CLEAR_GPIO3_EVENT (Bit 2) */
-#define TIMER_TIMER_CLEAR_GPIO_EVENT_REG_TIM_CLEAR_GPIO3_EVENT_Msk (0x4UL) /*!< TIM_CLEAR_GPIO3_EVENT (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CLEAR_GPIO_EVENT_REG_TIM_CLEAR_GPIO2_EVENT_Pos (1UL) /*!< TIM_CLEAR_GPIO2_EVENT (Bit 1) */
-#define TIMER_TIMER_CLEAR_GPIO_EVENT_REG_TIM_CLEAR_GPIO2_EVENT_Msk (0x2UL) /*!< TIM_CLEAR_GPIO2_EVENT (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CLEAR_GPIO_EVENT_REG_TIM_CLEAR_GPIO1_EVENT_Pos (0UL) /*!< TIM_CLEAR_GPIO1_EVENT (Bit 0) */
-#define TIMER_TIMER_CLEAR_GPIO_EVENT_REG_TIM_CLEAR_GPIO1_EVENT_Msk (0x1UL) /*!< TIM_CLEAR_GPIO1_EVENT (Bitfield-Mask: 0x01) */
-/* ================================================== TIMER_CLEAR_IRQ_REG ================================================== */
-#define TIMER_TIMER_CLEAR_IRQ_REG_TIM_CLEAR_IRQ_Pos (0UL) /*!< TIM_CLEAR_IRQ (Bit 0) */
-#define TIMER_TIMER_CLEAR_IRQ_REG_TIM_CLEAR_IRQ_Msk (0x1UL) /*!< TIM_CLEAR_IRQ (Bitfield-Mask: 0x01) */
-/* ==================================================== TIMER_CTRL_REG ===================================================== */
-#define TIMER_TIMER_CTRL_REG_TIM_CAP_GPIO4_IRQ_EN_Pos (14UL) /*!< TIM_CAP_GPIO4_IRQ_EN (Bit 14) */
-#define TIMER_TIMER_CTRL_REG_TIM_CAP_GPIO4_IRQ_EN_Msk (0x4000UL) /*!< TIM_CAP_GPIO4_IRQ_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_CAP_GPIO3_IRQ_EN_Pos (13UL) /*!< TIM_CAP_GPIO3_IRQ_EN (Bit 13) */
-#define TIMER_TIMER_CTRL_REG_TIM_CAP_GPIO3_IRQ_EN_Msk (0x2000UL) /*!< TIM_CAP_GPIO3_IRQ_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_CAP_GPIO2_IRQ_EN_Pos (12UL) /*!< TIM_CAP_GPIO2_IRQ_EN (Bit 12) */
-#define TIMER_TIMER_CTRL_REG_TIM_CAP_GPIO2_IRQ_EN_Msk (0x1000UL) /*!< TIM_CAP_GPIO2_IRQ_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_CAP_GPIO1_IRQ_EN_Pos (11UL) /*!< TIM_CAP_GPIO1_IRQ_EN (Bit 11) */
-#define TIMER_TIMER_CTRL_REG_TIM_CAP_GPIO1_IRQ_EN_Msk (0x800UL) /*!< TIM_CAP_GPIO1_IRQ_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_IN4_EVENT_FALL_EN_Pos (10UL) /*!< TIM_IN4_EVENT_FALL_EN (Bit 10) */
-#define TIMER_TIMER_CTRL_REG_TIM_IN4_EVENT_FALL_EN_Msk (0x400UL) /*!< TIM_IN4_EVENT_FALL_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_IN3_EVENT_FALL_EN_Pos (9UL) /*!< TIM_IN3_EVENT_FALL_EN (Bit 9) */
-#define TIMER_TIMER_CTRL_REG_TIM_IN3_EVENT_FALL_EN_Msk (0x200UL) /*!< TIM_IN3_EVENT_FALL_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_CLK_EN_Pos (8UL) /*!< TIM_CLK_EN (Bit 8) */
-#define TIMER_TIMER_CTRL_REG_TIM_CLK_EN_Msk (0x100UL) /*!< TIM_CLK_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_SYS_CLK_EN_Pos (7UL) /*!< TIM_SYS_CLK_EN (Bit 7) */
-#define TIMER_TIMER_CTRL_REG_TIM_SYS_CLK_EN_Msk (0x80UL) /*!< TIM_SYS_CLK_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_FREE_RUN_MODE_EN_Pos (6UL) /*!< TIM_FREE_RUN_MODE_EN (Bit 6) */
-#define TIMER_TIMER_CTRL_REG_TIM_FREE_RUN_MODE_EN_Msk (0x40UL) /*!< TIM_FREE_RUN_MODE_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_IRQ_EN_Pos (5UL) /*!< TIM_IRQ_EN (Bit 5) */
-#define TIMER_TIMER_CTRL_REG_TIM_IRQ_EN_Msk (0x20UL) /*!< TIM_IRQ_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_IN2_EVENT_FALL_EN_Pos (4UL) /*!< TIM_IN2_EVENT_FALL_EN (Bit 4) */
-#define TIMER_TIMER_CTRL_REG_TIM_IN2_EVENT_FALL_EN_Msk (0x10UL) /*!< TIM_IN2_EVENT_FALL_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_IN1_EVENT_FALL_EN_Pos (3UL) /*!< TIM_IN1_EVENT_FALL_EN (Bit 3) */
-#define TIMER_TIMER_CTRL_REG_TIM_IN1_EVENT_FALL_EN_Msk (0x8UL) /*!< TIM_IN1_EVENT_FALL_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_COUNT_DOWN_EN_Pos (2UL) /*!< TIM_COUNT_DOWN_EN (Bit 2) */
-#define TIMER_TIMER_CTRL_REG_TIM_COUNT_DOWN_EN_Msk (0x4UL) /*!< TIM_COUNT_DOWN_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_ONESHOT_MODE_EN_Pos (1UL) /*!< TIM_ONESHOT_MODE_EN (Bit 1) */
-#define TIMER_TIMER_CTRL_REG_TIM_ONESHOT_MODE_EN_Msk (0x2UL) /*!< TIM_ONESHOT_MODE_EN (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_CTRL_REG_TIM_EN_Pos (0UL) /*!< TIM_EN (Bit 0) */
-#define TIMER_TIMER_CTRL_REG_TIM_EN_Msk (0x1UL) /*!< TIM_EN (Bitfield-Mask: 0x01) */
-/* ================================================= TIMER_GPIO1_CONF_REG ================================================== */
-#define TIMER_TIMER_GPIO1_CONF_REG_TIM_GPIO1_CONF_Pos (0UL) /*!< TIM_GPIO1_CONF (Bit 0) */
-#define TIMER_TIMER_GPIO1_CONF_REG_TIM_GPIO1_CONF_Msk (0x3fUL) /*!< TIM_GPIO1_CONF (Bitfield-Mask: 0x3f) */
-/* ================================================= TIMER_GPIO2_CONF_REG ================================================== */
-#define TIMER_TIMER_GPIO2_CONF_REG_TIM_GPIO2_CONF_Pos (0UL) /*!< TIM_GPIO2_CONF (Bit 0) */
-#define TIMER_TIMER_GPIO2_CONF_REG_TIM_GPIO2_CONF_Msk (0x3fUL) /*!< TIM_GPIO2_CONF (Bitfield-Mask: 0x3f) */
-/* ================================================= TIMER_GPIO3_CONF_REG ================================================== */
-#define TIMER_TIMER_GPIO3_CONF_REG_TIM_GPIO3_CONF_Pos (0UL) /*!< TIM_GPIO3_CONF (Bit 0) */
-#define TIMER_TIMER_GPIO3_CONF_REG_TIM_GPIO3_CONF_Msk (0x3fUL) /*!< TIM_GPIO3_CONF (Bitfield-Mask: 0x3f) */
-/* ================================================= TIMER_GPIO4_CONF_REG ================================================== */
-#define TIMER_TIMER_GPIO4_CONF_REG_TIM_GPIO4_CONF_Pos (0UL) /*!< TIM_GPIO4_CONF (Bit 0) */
-#define TIMER_TIMER_GPIO4_CONF_REG_TIM_GPIO4_CONF_Msk (0x3fUL) /*!< TIM_GPIO4_CONF (Bitfield-Mask: 0x3f) */
-/* ================================================== TIMER_PRESCALER_REG ================================================== */
-#define TIMER_TIMER_PRESCALER_REG_TIM_PRESCALER_Pos (0UL) /*!< TIM_PRESCALER (Bit 0) */
-#define TIMER_TIMER_PRESCALER_REG_TIM_PRESCALER_Msk (0x1fUL) /*!< TIM_PRESCALER (Bitfield-Mask: 0x1f) */
-/* ================================================ TIMER_PRESCALER_VAL_REG ================================================ */
-#define TIMER_TIMER_PRESCALER_VAL_REG_TIM_PRESCALER_VAL_Pos (0UL) /*!< TIM_PRESCALER_VAL (Bit 0) */
-#define TIMER_TIMER_PRESCALER_VAL_REG_TIM_PRESCALER_VAL_Msk (0x1fUL) /*!< TIM_PRESCALER_VAL (Bitfield-Mask: 0x1f) */
-/* =================================================== TIMER_PWM_DC_REG ==================================================== */
-#define TIMER_TIMER_PWM_DC_REG_TIM_PWM_DC_Pos (0UL) /*!< TIM_PWM_DC (Bit 0) */
-#define TIMER_TIMER_PWM_DC_REG_TIM_PWM_DC_Msk (0xffffUL) /*!< TIM_PWM_DC (Bitfield-Mask: 0xffff) */
-/* ================================================== TIMER_PWM_FREQ_REG =================================================== */
-#define TIMER_TIMER_PWM_FREQ_REG_TIM_PWM_FREQ_Pos (0UL) /*!< TIM_PWM_FREQ (Bit 0) */
-#define TIMER_TIMER_PWM_FREQ_REG_TIM_PWM_FREQ_Msk (0xffffUL) /*!< TIM_PWM_FREQ (Bitfield-Mask: 0xffff) */
-/* =================================================== TIMER_RELOAD_REG ==================================================== */
-#define TIMER_TIMER_RELOAD_REG_TIM_RELOAD_Pos (0UL) /*!< TIM_RELOAD (Bit 0) */
-#define TIMER_TIMER_RELOAD_REG_TIM_RELOAD_Msk (0xffffffUL) /*!< TIM_RELOAD (Bitfield-Mask: 0xffffff) */
-/* ================================================== TIMER_SHOTWIDTH_REG ================================================== */
-#define TIMER_TIMER_SHOTWIDTH_REG_TIM_SHOTWIDTH_Pos (0UL) /*!< TIM_SHOTWIDTH (Bit 0) */
-#define TIMER_TIMER_SHOTWIDTH_REG_TIM_SHOTWIDTH_Msk (0xffffffUL) /*!< TIM_SHOTWIDTH (Bitfield-Mask: 0xffffff) */
-/* =================================================== TIMER_STATUS_REG ==================================================== */
-#define TIMER_TIMER_STATUS_REG_TIM_GPIO4_EVENT_PENDING_Pos (7UL) /*!< TIM_GPIO4_EVENT_PENDING (Bit 7) */
-#define TIMER_TIMER_STATUS_REG_TIM_GPIO4_EVENT_PENDING_Msk (0x80UL) /*!< TIM_GPIO4_EVENT_PENDING (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_STATUS_REG_TIM_GPIO3_EVENT_PENDING_Pos (6UL) /*!< TIM_GPIO3_EVENT_PENDING (Bit 6) */
-#define TIMER_TIMER_STATUS_REG_TIM_GPIO3_EVENT_PENDING_Msk (0x40UL) /*!< TIM_GPIO3_EVENT_PENDING (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_STATUS_REG_TIM_GPIO2_EVENT_PENDING_Pos (5UL) /*!< TIM_GPIO2_EVENT_PENDING (Bit 5) */
-#define TIMER_TIMER_STATUS_REG_TIM_GPIO2_EVENT_PENDING_Msk (0x20UL) /*!< TIM_GPIO2_EVENT_PENDING (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_STATUS_REG_TIM_GPIO1_EVENT_PENDING_Pos (4UL) /*!< TIM_GPIO1_EVENT_PENDING (Bit 4) */
-#define TIMER_TIMER_STATUS_REG_TIM_GPIO1_EVENT_PENDING_Msk (0x10UL) /*!< TIM_GPIO1_EVENT_PENDING (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_STATUS_REG_TIM_ONESHOT_PHASE_Pos (2UL) /*!< TIM_ONESHOT_PHASE (Bit 2) */
-#define TIMER_TIMER_STATUS_REG_TIM_ONESHOT_PHASE_Msk (0xcUL) /*!< TIM_ONESHOT_PHASE (Bitfield-Mask: 0x03) */
-#define TIMER_TIMER_STATUS_REG_TIM_IN2_STATE_Pos (1UL) /*!< TIM_IN2_STATE (Bit 1) */
-#define TIMER_TIMER_STATUS_REG_TIM_IN2_STATE_Msk (0x2UL) /*!< TIM_IN2_STATE (Bitfield-Mask: 0x01) */
-#define TIMER_TIMER_STATUS_REG_TIM_IN1_STATE_Pos (0UL) /*!< TIM_IN1_STATE (Bit 0) */
-#define TIMER_TIMER_STATUS_REG_TIM_IN1_STATE_Msk (0x1UL) /*!< TIM_IN1_STATE (Bitfield-Mask: 0x01) */
-/* ================================================== TIMER_TIMER_VAL_REG ================================================== */
-#define TIMER_TIMER_TIMER_VAL_REG_TIM_TIMER_VALUE_Pos (0UL) /*!< TIM_TIMER_VALUE (Bit 0) */
-#define TIMER_TIMER_TIMER_VAL_REG_TIM_TIMER_VALUE_Msk (0xffffffUL) /*!< TIM_TIMER_VALUE (Bitfield-Mask: 0xffffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ TIMER2 ================ */
-/* =========================================================================================================================== */
-
-/* =============================================== TIMER2_CAPTURE_GPIO1_REG ================================================ */
-#define TIMER2_TIMER2_CAPTURE_GPIO1_REG_TIM_CAPTURE_GPIO1_Pos (0UL) /*!< TIM_CAPTURE_GPIO1 (Bit 0) */
-#define TIMER2_TIMER2_CAPTURE_GPIO1_REG_TIM_CAPTURE_GPIO1_Msk (0xffffffUL) /*!< TIM_CAPTURE_GPIO1 (Bitfield-Mask: 0xffffff) */
-/* =============================================== TIMER2_CAPTURE_GPIO2_REG ================================================ */
-#define TIMER2_TIMER2_CAPTURE_GPIO2_REG_TIM_CAPTURE_GPIO2_Pos (0UL) /*!< TIM_CAPTURE_GPIO2 (Bit 0) */
-#define TIMER2_TIMER2_CAPTURE_GPIO2_REG_TIM_CAPTURE_GPIO2_Msk (0xffffffUL) /*!< TIM_CAPTURE_GPIO2 (Bitfield-Mask: 0xffffff) */
-/* ================================================= TIMER2_CLEAR_IRQ_REG ================================================== */
-#define TIMER2_TIMER2_CLEAR_IRQ_REG_TIM_CLEAR_IRQ_Pos (0UL) /*!< TIM_CLEAR_IRQ (Bit 0) */
-#define TIMER2_TIMER2_CLEAR_IRQ_REG_TIM_CLEAR_IRQ_Msk (0x1UL) /*!< TIM_CLEAR_IRQ (Bitfield-Mask: 0x01) */
-/* ==================================================== TIMER2_CTRL_REG ==================================================== */
-#define TIMER2_TIMER2_CTRL_REG_TIM_CLK_EN_Pos (8UL) /*!< TIM_CLK_EN (Bit 8) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_CLK_EN_Msk (0x100UL) /*!< TIM_CLK_EN (Bitfield-Mask: 0x01) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_SYS_CLK_EN_Pos (7UL) /*!< TIM_SYS_CLK_EN (Bit 7) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_SYS_CLK_EN_Msk (0x80UL) /*!< TIM_SYS_CLK_EN (Bitfield-Mask: 0x01) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_FREE_RUN_MODE_EN_Pos (6UL) /*!< TIM_FREE_RUN_MODE_EN (Bit 6) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_FREE_RUN_MODE_EN_Msk (0x40UL) /*!< TIM_FREE_RUN_MODE_EN (Bitfield-Mask: 0x01) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_IRQ_EN_Pos (5UL) /*!< TIM_IRQ_EN (Bit 5) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_IRQ_EN_Msk (0x20UL) /*!< TIM_IRQ_EN (Bitfield-Mask: 0x01) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_IN2_EVENT_FALL_EN_Pos (4UL) /*!< TIM_IN2_EVENT_FALL_EN (Bit 4) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_IN2_EVENT_FALL_EN_Msk (0x10UL) /*!< TIM_IN2_EVENT_FALL_EN (Bitfield-Mask: 0x01) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_IN1_EVENT_FALL_EN_Pos (3UL) /*!< TIM_IN1_EVENT_FALL_EN (Bit 3) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_IN1_EVENT_FALL_EN_Msk (0x8UL) /*!< TIM_IN1_EVENT_FALL_EN (Bitfield-Mask: 0x01) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_COUNT_DOWN_EN_Pos (2UL) /*!< TIM_COUNT_DOWN_EN (Bit 2) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_COUNT_DOWN_EN_Msk (0x4UL) /*!< TIM_COUNT_DOWN_EN (Bitfield-Mask: 0x01) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_ONESHOT_MODE_EN_Pos (1UL) /*!< TIM_ONESHOT_MODE_EN (Bit 1) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_ONESHOT_MODE_EN_Msk (0x2UL) /*!< TIM_ONESHOT_MODE_EN (Bitfield-Mask: 0x01) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_EN_Pos (0UL) /*!< TIM_EN (Bit 0) */
-#define TIMER2_TIMER2_CTRL_REG_TIM_EN_Msk (0x1UL) /*!< TIM_EN (Bitfield-Mask: 0x01) */
-/* ================================================= TIMER2_GPIO1_CONF_REG ================================================= */
-#define TIMER2_TIMER2_GPIO1_CONF_REG_TIM_GPIO1_CONF_Pos (0UL) /*!< TIM_GPIO1_CONF (Bit 0) */
-#define TIMER2_TIMER2_GPIO1_CONF_REG_TIM_GPIO1_CONF_Msk (0x3fUL) /*!< TIM_GPIO1_CONF (Bitfield-Mask: 0x3f) */
-/* ================================================= TIMER2_GPIO2_CONF_REG ================================================= */
-#define TIMER2_TIMER2_GPIO2_CONF_REG_TIM_GPIO2_CONF_Pos (0UL) /*!< TIM_GPIO2_CONF (Bit 0) */
-#define TIMER2_TIMER2_GPIO2_CONF_REG_TIM_GPIO2_CONF_Msk (0x3fUL) /*!< TIM_GPIO2_CONF (Bitfield-Mask: 0x3f) */
-/* ================================================= TIMER2_PRESCALER_REG ================================================== */
-#define TIMER2_TIMER2_PRESCALER_REG_TIM_PRESCALER_Pos (0UL) /*!< TIM_PRESCALER (Bit 0) */
-#define TIMER2_TIMER2_PRESCALER_REG_TIM_PRESCALER_Msk (0x1fUL) /*!< TIM_PRESCALER (Bitfield-Mask: 0x1f) */
-/* =============================================== TIMER2_PRESCALER_VAL_REG ================================================ */
-#define TIMER2_TIMER2_PRESCALER_VAL_REG_TIM_PRESCALER_VAL_Pos (0UL) /*!< TIM_PRESCALER_VAL (Bit 0) */
-#define TIMER2_TIMER2_PRESCALER_VAL_REG_TIM_PRESCALER_VAL_Msk (0x1fUL) /*!< TIM_PRESCALER_VAL (Bitfield-Mask: 0x1f) */
-/* =================================================== TIMER2_PWM_DC_REG =================================================== */
-#define TIMER2_TIMER2_PWM_DC_REG_TIM_PWM_DC_Pos (0UL) /*!< TIM_PWM_DC (Bit 0) */
-#define TIMER2_TIMER2_PWM_DC_REG_TIM_PWM_DC_Msk (0xffffUL) /*!< TIM_PWM_DC (Bitfield-Mask: 0xffff) */
-/* ================================================== TIMER2_PWM_FREQ_REG ================================================== */
-#define TIMER2_TIMER2_PWM_FREQ_REG_TIM_PWM_FREQ_Pos (0UL) /*!< TIM_PWM_FREQ (Bit 0) */
-#define TIMER2_TIMER2_PWM_FREQ_REG_TIM_PWM_FREQ_Msk (0xffffUL) /*!< TIM_PWM_FREQ (Bitfield-Mask: 0xffff) */
-/* =================================================== TIMER2_RELOAD_REG =================================================== */
-#define TIMER2_TIMER2_RELOAD_REG_TIM_RELOAD_Pos (0UL) /*!< TIM_RELOAD (Bit 0) */
-#define TIMER2_TIMER2_RELOAD_REG_TIM_RELOAD_Msk (0xffffffUL) /*!< TIM_RELOAD (Bitfield-Mask: 0xffffff) */
-/* ================================================= TIMER2_SHOTWIDTH_REG ================================================== */
-#define TIMER2_TIMER2_SHOTWIDTH_REG_TIM_SHOTWIDTH_Pos (0UL) /*!< TIM_SHOTWIDTH (Bit 0) */
-#define TIMER2_TIMER2_SHOTWIDTH_REG_TIM_SHOTWIDTH_Msk (0xffffffUL) /*!< TIM_SHOTWIDTH (Bitfield-Mask: 0xffffff) */
-/* =================================================== TIMER2_STATUS_REG =================================================== */
-#define TIMER2_TIMER2_STATUS_REG_TIM_ONESHOT_PHASE_Pos (2UL) /*!< TIM_ONESHOT_PHASE (Bit 2) */
-#define TIMER2_TIMER2_STATUS_REG_TIM_ONESHOT_PHASE_Msk (0xcUL) /*!< TIM_ONESHOT_PHASE (Bitfield-Mask: 0x03) */
-#define TIMER2_TIMER2_STATUS_REG_TIM_IN2_STATE_Pos (1UL) /*!< TIM_IN2_STATE (Bit 1) */
-#define TIMER2_TIMER2_STATUS_REG_TIM_IN2_STATE_Msk (0x2UL) /*!< TIM_IN2_STATE (Bitfield-Mask: 0x01) */
-#define TIMER2_TIMER2_STATUS_REG_TIM_IN1_STATE_Pos (0UL) /*!< TIM_IN1_STATE (Bit 0) */
-#define TIMER2_TIMER2_STATUS_REG_TIM_IN1_STATE_Msk (0x1UL) /*!< TIM_IN1_STATE (Bitfield-Mask: 0x01) */
-/* ================================================= TIMER2_TIMER_VAL_REG ================================================== */
-#define TIMER2_TIMER2_TIMER_VAL_REG_TIM_TIMER_VALUE_Pos (0UL) /*!< TIM_TIMER_VALUE (Bit 0) */
-#define TIMER2_TIMER2_TIMER_VAL_REG_TIM_TIMER_VALUE_Msk (0xffffffUL) /*!< TIM_TIMER_VALUE (Bitfield-Mask: 0xffffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ TIMER3 ================ */
-/* =========================================================================================================================== */
-
-/* =============================================== TIMER3_CAPTURE_GPIO1_REG ================================================ */
-#define TIMER3_TIMER3_CAPTURE_GPIO1_REG_TIM_CAPTURE_GPIO1_Pos (0UL) /*!< TIM_CAPTURE_GPIO1 (Bit 0) */
-#define TIMER3_TIMER3_CAPTURE_GPIO1_REG_TIM_CAPTURE_GPIO1_Msk (0xffffffUL) /*!< TIM_CAPTURE_GPIO1 (Bitfield-Mask: 0xffffff) */
-/* =============================================== TIMER3_CAPTURE_GPIO2_REG ================================================ */
-#define TIMER3_TIMER3_CAPTURE_GPIO2_REG_TIM_CAPTURE_GPIO2_Pos (0UL) /*!< TIM_CAPTURE_GPIO2 (Bit 0) */
-#define TIMER3_TIMER3_CAPTURE_GPIO2_REG_TIM_CAPTURE_GPIO2_Msk (0xffffffUL) /*!< TIM_CAPTURE_GPIO2 (Bitfield-Mask: 0xffffff) */
-/* ================================================= TIMER3_CLEAR_IRQ_REG ================================================== */
-#define TIMER3_TIMER3_CLEAR_IRQ_REG_TIM_CLEAR_IRQ_Pos (0UL) /*!< TIM_CLEAR_IRQ (Bit 0) */
-#define TIMER3_TIMER3_CLEAR_IRQ_REG_TIM_CLEAR_IRQ_Msk (0x1UL) /*!< TIM_CLEAR_IRQ (Bitfield-Mask: 0x01) */
-/* ==================================================== TIMER3_CTRL_REG ==================================================== */
-#define TIMER3_TIMER3_CTRL_REG_TIM_CLK_EN_Pos (8UL) /*!< TIM_CLK_EN (Bit 8) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_CLK_EN_Msk (0x100UL) /*!< TIM_CLK_EN (Bitfield-Mask: 0x01) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_SYS_CLK_EN_Pos (7UL) /*!< TIM_SYS_CLK_EN (Bit 7) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_SYS_CLK_EN_Msk (0x80UL) /*!< TIM_SYS_CLK_EN (Bitfield-Mask: 0x01) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_FREE_RUN_MODE_EN_Pos (6UL) /*!< TIM_FREE_RUN_MODE_EN (Bit 6) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_FREE_RUN_MODE_EN_Msk (0x40UL) /*!< TIM_FREE_RUN_MODE_EN (Bitfield-Mask: 0x01) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_IRQ_EN_Pos (5UL) /*!< TIM_IRQ_EN (Bit 5) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_IRQ_EN_Msk (0x20UL) /*!< TIM_IRQ_EN (Bitfield-Mask: 0x01) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_IN2_EVENT_FALL_EN_Pos (4UL) /*!< TIM_IN2_EVENT_FALL_EN (Bit 4) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_IN2_EVENT_FALL_EN_Msk (0x10UL) /*!< TIM_IN2_EVENT_FALL_EN (Bitfield-Mask: 0x01) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_IN1_EVENT_FALL_EN_Pos (3UL) /*!< TIM_IN1_EVENT_FALL_EN (Bit 3) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_IN1_EVENT_FALL_EN_Msk (0x8UL) /*!< TIM_IN1_EVENT_FALL_EN (Bitfield-Mask: 0x01) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_COUNT_DOWN_EN_Pos (2UL) /*!< TIM_COUNT_DOWN_EN (Bit 2) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_COUNT_DOWN_EN_Msk (0x4UL) /*!< TIM_COUNT_DOWN_EN (Bitfield-Mask: 0x01) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_EN_Pos (0UL) /*!< TIM_EN (Bit 0) */
-#define TIMER3_TIMER3_CTRL_REG_TIM_EN_Msk (0x1UL) /*!< TIM_EN (Bitfield-Mask: 0x01) */
-/* ================================================= TIMER3_GPIO1_CONF_REG ================================================= */
-#define TIMER3_TIMER3_GPIO1_CONF_REG_TIM_GPIO1_CONF_Pos (0UL) /*!< TIM_GPIO1_CONF (Bit 0) */
-#define TIMER3_TIMER3_GPIO1_CONF_REG_TIM_GPIO1_CONF_Msk (0x3fUL) /*!< TIM_GPIO1_CONF (Bitfield-Mask: 0x3f) */
-/* ================================================= TIMER3_GPIO2_CONF_REG ================================================= */
-#define TIMER3_TIMER3_GPIO2_CONF_REG_TIM_GPIO2_CONF_Pos (0UL) /*!< TIM_GPIO2_CONF (Bit 0) */
-#define TIMER3_TIMER3_GPIO2_CONF_REG_TIM_GPIO2_CONF_Msk (0x3fUL) /*!< TIM_GPIO2_CONF (Bitfield-Mask: 0x3f) */
-/* ================================================= TIMER3_PRESCALER_REG ================================================== */
-#define TIMER3_TIMER3_PRESCALER_REG_TIM_PRESCALER_Pos (0UL) /*!< TIM_PRESCALER (Bit 0) */
-#define TIMER3_TIMER3_PRESCALER_REG_TIM_PRESCALER_Msk (0x1fUL) /*!< TIM_PRESCALER (Bitfield-Mask: 0x1f) */
-/* =============================================== TIMER3_PRESCALER_VAL_REG ================================================ */
-#define TIMER3_TIMER3_PRESCALER_VAL_REG_TIM_PRESCALER_VAL_Pos (0UL) /*!< TIM_PRESCALER_VAL (Bit 0) */
-#define TIMER3_TIMER3_PRESCALER_VAL_REG_TIM_PRESCALER_VAL_Msk (0x1fUL) /*!< TIM_PRESCALER_VAL (Bitfield-Mask: 0x1f) */
-/* =================================================== TIMER3_PWM_DC_REG =================================================== */
-#define TIMER3_TIMER3_PWM_DC_REG_TIM_PWM_DC_Pos (0UL) /*!< TIM_PWM_DC (Bit 0) */
-#define TIMER3_TIMER3_PWM_DC_REG_TIM_PWM_DC_Msk (0xffffUL) /*!< TIM_PWM_DC (Bitfield-Mask: 0xffff) */
-/* ================================================== TIMER3_PWM_FREQ_REG ================================================== */
-#define TIMER3_TIMER3_PWM_FREQ_REG_TIM_PWM_FREQ_Pos (0UL) /*!< TIM_PWM_FREQ (Bit 0) */
-#define TIMER3_TIMER3_PWM_FREQ_REG_TIM_PWM_FREQ_Msk (0xffffUL) /*!< TIM_PWM_FREQ (Bitfield-Mask: 0xffff) */
-/* =================================================== TIMER3_RELOAD_REG =================================================== */
-#define TIMER3_TIMER3_RELOAD_REG_TIM_RELOAD_Pos (0UL) /*!< TIM_RELOAD (Bit 0) */
-#define TIMER3_TIMER3_RELOAD_REG_TIM_RELOAD_Msk (0xffffffUL) /*!< TIM_RELOAD (Bitfield-Mask: 0xffffff) */
-/* =================================================== TIMER3_STATUS_REG =================================================== */
-#define TIMER3_TIMER3_STATUS_REG_TIM_ONESHOT_PHASE_Pos (2UL) /*!< TIM_ONESHOT_PHASE (Bit 2) */
-#define TIMER3_TIMER3_STATUS_REG_TIM_ONESHOT_PHASE_Msk (0xcUL) /*!< TIM_ONESHOT_PHASE (Bitfield-Mask: 0x03) */
-#define TIMER3_TIMER3_STATUS_REG_TIM_IN2_STATE_Pos (1UL) /*!< TIM_IN2_STATE (Bit 1) */
-#define TIMER3_TIMER3_STATUS_REG_TIM_IN2_STATE_Msk (0x2UL) /*!< TIM_IN2_STATE (Bitfield-Mask: 0x01) */
-#define TIMER3_TIMER3_STATUS_REG_TIM_IN1_STATE_Pos (0UL) /*!< TIM_IN1_STATE (Bit 0) */
-#define TIMER3_TIMER3_STATUS_REG_TIM_IN1_STATE_Msk (0x1UL) /*!< TIM_IN1_STATE (Bitfield-Mask: 0x01) */
-/* ================================================= TIMER3_TIMER_VAL_REG ================================================== */
-#define TIMER3_TIMER3_TIMER_VAL_REG_TIM_TIMER_VALUE_Pos (0UL) /*!< TIM_TIMER_VALUE (Bit 0) */
-#define TIMER3_TIMER3_TIMER_VAL_REG_TIM_TIMER_VALUE_Msk (0xffffffUL) /*!< TIM_TIMER_VALUE (Bitfield-Mask: 0xffffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ TIMER4 ================ */
-/* =========================================================================================================================== */
-
-/* =============================================== TIMER4_CAPTURE_GPIO1_REG ================================================ */
-#define TIMER4_TIMER4_CAPTURE_GPIO1_REG_TIM_CAPTURE_GPIO1_Pos (0UL) /*!< TIM_CAPTURE_GPIO1 (Bit 0) */
-#define TIMER4_TIMER4_CAPTURE_GPIO1_REG_TIM_CAPTURE_GPIO1_Msk (0xffffffUL) /*!< TIM_CAPTURE_GPIO1 (Bitfield-Mask: 0xffffff) */
-/* =============================================== TIMER4_CAPTURE_GPIO2_REG ================================================ */
-#define TIMER4_TIMER4_CAPTURE_GPIO2_REG_TIM_CAPTURE_GPIO2_Pos (0UL) /*!< TIM_CAPTURE_GPIO2 (Bit 0) */
-#define TIMER4_TIMER4_CAPTURE_GPIO2_REG_TIM_CAPTURE_GPIO2_Msk (0xffffffUL) /*!< TIM_CAPTURE_GPIO2 (Bitfield-Mask: 0xffffff) */
-/* ================================================= TIMER4_CLEAR_IRQ_REG ================================================== */
-#define TIMER4_TIMER4_CLEAR_IRQ_REG_TIM_CLEAR_IRQ_Pos (0UL) /*!< TIM_CLEAR_IRQ (Bit 0) */
-#define TIMER4_TIMER4_CLEAR_IRQ_REG_TIM_CLEAR_IRQ_Msk (0x1UL) /*!< TIM_CLEAR_IRQ (Bitfield-Mask: 0x01) */
-/* ==================================================== TIMER4_CTRL_REG ==================================================== */
-#define TIMER4_TIMER4_CTRL_REG_TIM_CLK_EN_Pos (8UL) /*!< TIM_CLK_EN (Bit 8) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_CLK_EN_Msk (0x100UL) /*!< TIM_CLK_EN (Bitfield-Mask: 0x01) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_SYS_CLK_EN_Pos (7UL) /*!< TIM_SYS_CLK_EN (Bit 7) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_SYS_CLK_EN_Msk (0x80UL) /*!< TIM_SYS_CLK_EN (Bitfield-Mask: 0x01) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_FREE_RUN_MODE_EN_Pos (6UL) /*!< TIM_FREE_RUN_MODE_EN (Bit 6) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_FREE_RUN_MODE_EN_Msk (0x40UL) /*!< TIM_FREE_RUN_MODE_EN (Bitfield-Mask: 0x01) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_IRQ_EN_Pos (5UL) /*!< TIM_IRQ_EN (Bit 5) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_IRQ_EN_Msk (0x20UL) /*!< TIM_IRQ_EN (Bitfield-Mask: 0x01) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_IN2_EVENT_FALL_EN_Pos (4UL) /*!< TIM_IN2_EVENT_FALL_EN (Bit 4) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_IN2_EVENT_FALL_EN_Msk (0x10UL) /*!< TIM_IN2_EVENT_FALL_EN (Bitfield-Mask: 0x01) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_IN1_EVENT_FALL_EN_Pos (3UL) /*!< TIM_IN1_EVENT_FALL_EN (Bit 3) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_IN1_EVENT_FALL_EN_Msk (0x8UL) /*!< TIM_IN1_EVENT_FALL_EN (Bitfield-Mask: 0x01) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_COUNT_DOWN_EN_Pos (2UL) /*!< TIM_COUNT_DOWN_EN (Bit 2) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_COUNT_DOWN_EN_Msk (0x4UL) /*!< TIM_COUNT_DOWN_EN (Bitfield-Mask: 0x01) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_EN_Pos (0UL) /*!< TIM_EN (Bit 0) */
-#define TIMER4_TIMER4_CTRL_REG_TIM_EN_Msk (0x1UL) /*!< TIM_EN (Bitfield-Mask: 0x01) */
-/* ================================================= TIMER4_GPIO1_CONF_REG ================================================= */
-#define TIMER4_TIMER4_GPIO1_CONF_REG_TIM_GPIO1_CONF_Pos (0UL) /*!< TIM_GPIO1_CONF (Bit 0) */
-#define TIMER4_TIMER4_GPIO1_CONF_REG_TIM_GPIO1_CONF_Msk (0x3fUL) /*!< TIM_GPIO1_CONF (Bitfield-Mask: 0x3f) */
-/* ================================================= TIMER4_GPIO2_CONF_REG ================================================= */
-#define TIMER4_TIMER4_GPIO2_CONF_REG_TIM_GPIO2_CONF_Pos (0UL) /*!< TIM_GPIO2_CONF (Bit 0) */
-#define TIMER4_TIMER4_GPIO2_CONF_REG_TIM_GPIO2_CONF_Msk (0x3fUL) /*!< TIM_GPIO2_CONF (Bitfield-Mask: 0x3f) */
-/* ================================================= TIMER4_PRESCALER_REG ================================================== */
-#define TIMER4_TIMER4_PRESCALER_REG_TIM_PRESCALER_Pos (0UL) /*!< TIM_PRESCALER (Bit 0) */
-#define TIMER4_TIMER4_PRESCALER_REG_TIM_PRESCALER_Msk (0x1fUL) /*!< TIM_PRESCALER (Bitfield-Mask: 0x1f) */
-/* =============================================== TIMER4_PRESCALER_VAL_REG ================================================ */
-#define TIMER4_TIMER4_PRESCALER_VAL_REG_TIM_PRESCALER_VAL_Pos (0UL) /*!< TIM_PRESCALER_VAL (Bit 0) */
-#define TIMER4_TIMER4_PRESCALER_VAL_REG_TIM_PRESCALER_VAL_Msk (0x1fUL) /*!< TIM_PRESCALER_VAL (Bitfield-Mask: 0x1f) */
-/* =================================================== TIMER4_PWM_DC_REG =================================================== */
-#define TIMER4_TIMER4_PWM_DC_REG_TIM_PWM_DC_Pos (0UL) /*!< TIM_PWM_DC (Bit 0) */
-#define TIMER4_TIMER4_PWM_DC_REG_TIM_PWM_DC_Msk (0xffffUL) /*!< TIM_PWM_DC (Bitfield-Mask: 0xffff) */
-/* ================================================== TIMER4_PWM_FREQ_REG ================================================== */
-#define TIMER4_TIMER4_PWM_FREQ_REG_TIM_PWM_FREQ_Pos (0UL) /*!< TIM_PWM_FREQ (Bit 0) */
-#define TIMER4_TIMER4_PWM_FREQ_REG_TIM_PWM_FREQ_Msk (0xffffUL) /*!< TIM_PWM_FREQ (Bitfield-Mask: 0xffff) */
-/* =================================================== TIMER4_RELOAD_REG =================================================== */
-#define TIMER4_TIMER4_RELOAD_REG_TIM_RELOAD_Pos (0UL) /*!< TIM_RELOAD (Bit 0) */
-#define TIMER4_TIMER4_RELOAD_REG_TIM_RELOAD_Msk (0xffffffUL) /*!< TIM_RELOAD (Bitfield-Mask: 0xffffff) */
-/* =================================================== TIMER4_STATUS_REG =================================================== */
-#define TIMER4_TIMER4_STATUS_REG_TIM_ONESHOT_PHASE_Pos (2UL) /*!< TIM_ONESHOT_PHASE (Bit 2) */
-#define TIMER4_TIMER4_STATUS_REG_TIM_ONESHOT_PHASE_Msk (0xcUL) /*!< TIM_ONESHOT_PHASE (Bitfield-Mask: 0x03) */
-#define TIMER4_TIMER4_STATUS_REG_TIM_IN2_STATE_Pos (1UL) /*!< TIM_IN2_STATE (Bit 1) */
-#define TIMER4_TIMER4_STATUS_REG_TIM_IN2_STATE_Msk (0x2UL) /*!< TIM_IN2_STATE (Bitfield-Mask: 0x01) */
-#define TIMER4_TIMER4_STATUS_REG_TIM_IN1_STATE_Pos (0UL) /*!< TIM_IN1_STATE (Bit 0) */
-#define TIMER4_TIMER4_STATUS_REG_TIM_IN1_STATE_Msk (0x1UL) /*!< TIM_IN1_STATE (Bitfield-Mask: 0x01) */
-/* ================================================= TIMER4_TIMER_VAL_REG ================================================== */
-#define TIMER4_TIMER4_TIMER_VAL_REG_TIM_TIMER_VALUE_Pos (0UL) /*!< TIM_TIMER_VALUE (Bit 0) */
-#define TIMER4_TIMER4_TIMER_VAL_REG_TIM_TIMER_VALUE_Msk (0xffffffUL) /*!< TIM_TIMER_VALUE (Bitfield-Mask: 0xffffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ TRNG ================ */
-/* =========================================================================================================================== */
-
-/* ===================================================== TRNG_CTRL_REG ===================================================== */
-#define TRNG_TRNG_CTRL_REG_TRNG_ENABLE_Pos (0UL) /*!< TRNG_ENABLE (Bit 0) */
-#define TRNG_TRNG_CTRL_REG_TRNG_ENABLE_Msk (0x1UL) /*!< TRNG_ENABLE (Bitfield-Mask: 0x01) */
-/* =================================================== TRNG_FIFOLVL_REG ==================================================== */
-#define TRNG_TRNG_FIFOLVL_REG_TRNG_FIFOFULL_Pos (5UL) /*!< TRNG_FIFOFULL (Bit 5) */
-#define TRNG_TRNG_FIFOLVL_REG_TRNG_FIFOFULL_Msk (0x20UL) /*!< TRNG_FIFOFULL (Bitfield-Mask: 0x01) */
-#define TRNG_TRNG_FIFOLVL_REG_TRNG_FIFOLVL_Pos (0UL) /*!< TRNG_FIFOLVL (Bit 0) */
-#define TRNG_TRNG_FIFOLVL_REG_TRNG_FIFOLVL_Msk (0x1fUL) /*!< TRNG_FIFOLVL (Bitfield-Mask: 0x1f) */
-/* ===================================================== TRNG_VER_REG ====================================================== */
-#define TRNG_TRNG_VER_REG_TRNG_MAJ_Pos (24UL) /*!< TRNG_MAJ (Bit 24) */
-#define TRNG_TRNG_VER_REG_TRNG_MAJ_Msk (0xff000000UL) /*!< TRNG_MAJ (Bitfield-Mask: 0xff) */
-#define TRNG_TRNG_VER_REG_TRNG_MIN_Pos (16UL) /*!< TRNG_MIN (Bit 16) */
-#define TRNG_TRNG_VER_REG_TRNG_MIN_Msk (0xff0000UL) /*!< TRNG_MIN (Bitfield-Mask: 0xff) */
-#define TRNG_TRNG_VER_REG_TRNG_SVN_Pos (0UL) /*!< TRNG_SVN (Bit 0) */
-#define TRNG_TRNG_VER_REG_TRNG_SVN_Msk (0xffffUL) /*!< TRNG_SVN (Bitfield-Mask: 0xffff) */
-
-
-/* =========================================================================================================================== */
-/* ================ UART ================ */
-/* =========================================================================================================================== */
-
-/* ===================================================== UART_CTR_REG ====================================================== */
-#define UART_UART_CTR_REG_UART_CTR_Pos (0UL) /*!< UART_CTR (Bit 0) */
-#define UART_UART_CTR_REG_UART_CTR_Msk (0xffffffffUL) /*!< UART_CTR (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== UART_DLF_REG ====================================================== */
-#define UART_UART_DLF_REG_UART_DLF_Pos (0UL) /*!< UART_DLF (Bit 0) */
-#define UART_UART_DLF_REG_UART_DLF_Msk (0xfUL) /*!< UART_DLF (Bitfield-Mask: 0x0f) */
-/* ==================================================== UART_DMASA_REG ===================================================== */
-#define UART_UART_DMASA_REG_UART_DMASA_Pos (0UL) /*!< UART_DMASA (Bit 0) */
-#define UART_UART_DMASA_REG_UART_DMASA_Msk (0x1UL) /*!< UART_DMASA (Bitfield-Mask: 0x01) */
-/* ===================================================== UART_HTX_REG ====================================================== */
-#define UART_UART_HTX_REG_UART_HALT_TX_Pos (0UL) /*!< UART_HALT_TX (Bit 0) */
-#define UART_UART_HTX_REG_UART_HALT_TX_Msk (0x1UL) /*!< UART_HALT_TX (Bitfield-Mask: 0x01) */
-/* =================================================== UART_IER_DLH_REG ==================================================== */
-#define UART_UART_IER_DLH_REG_PTIME_DLH7_Pos (7UL) /*!< PTIME_DLH7 (Bit 7) */
-#define UART_UART_IER_DLH_REG_PTIME_DLH7_Msk (0x80UL) /*!< PTIME_DLH7 (Bitfield-Mask: 0x01) */
-#define UART_UART_IER_DLH_REG_DLH6_5_Pos (5UL) /*!< DLH6_5 (Bit 5) */
-#define UART_UART_IER_DLH_REG_DLH6_5_Msk (0x60UL) /*!< DLH6_5 (Bitfield-Mask: 0x03) */
-#define UART_UART_IER_DLH_REG_ELCOLR_DLH4_Pos (4UL) /*!< ELCOLR_DLH4 (Bit 4) */
-#define UART_UART_IER_DLH_REG_ELCOLR_DLH4_Msk (0x10UL) /*!< ELCOLR_DLH4 (Bitfield-Mask: 0x01) */
-#define UART_UART_IER_DLH_REG_EDSSI_DLH3_Pos (3UL) /*!< EDSSI_DLH3 (Bit 3) */
-#define UART_UART_IER_DLH_REG_EDSSI_DLH3_Msk (0x8UL) /*!< EDSSI_DLH3 (Bitfield-Mask: 0x01) */
-#define UART_UART_IER_DLH_REG_ELSI_DLH2_Pos (2UL) /*!< ELSI_DLH2 (Bit 2) */
-#define UART_UART_IER_DLH_REG_ELSI_DLH2_Msk (0x4UL) /*!< ELSI_DLH2 (Bitfield-Mask: 0x01) */
-#define UART_UART_IER_DLH_REG_ETBEI_DLH1_Pos (1UL) /*!< ETBEI_DLH1 (Bit 1) */
-#define UART_UART_IER_DLH_REG_ETBEI_DLH1_Msk (0x2UL) /*!< ETBEI_DLH1 (Bitfield-Mask: 0x01) */
-#define UART_UART_IER_DLH_REG_ERBFI_DLH0_Pos (0UL) /*!< ERBFI_DLH0 (Bit 0) */
-#define UART_UART_IER_DLH_REG_ERBFI_DLH0_Msk (0x1UL) /*!< ERBFI_DLH0 (Bitfield-Mask: 0x01) */
-/* =================================================== UART_IIR_FCR_REG ==================================================== */
-#define UART_UART_IIR_FCR_REG_IIR_FCR_Pos (0UL) /*!< IIR_FCR (Bit 0) */
-#define UART_UART_IIR_FCR_REG_IIR_FCR_Msk (0xffUL) /*!< IIR_FCR (Bitfield-Mask: 0xff) */
-/* ===================================================== UART_LCR_REG ====================================================== */
-#define UART_UART_LCR_REG_UART_DLAB_Pos (7UL) /*!< UART_DLAB (Bit 7) */
-#define UART_UART_LCR_REG_UART_DLAB_Msk (0x80UL) /*!< UART_DLAB (Bitfield-Mask: 0x01) */
-#define UART_UART_LCR_REG_UART_BC_Pos (6UL) /*!< UART_BC (Bit 6) */
-#define UART_UART_LCR_REG_UART_BC_Msk (0x40UL) /*!< UART_BC (Bitfield-Mask: 0x01) */
-#define UART_UART_LCR_REG_UART_EPS_Pos (4UL) /*!< UART_EPS (Bit 4) */
-#define UART_UART_LCR_REG_UART_EPS_Msk (0x10UL) /*!< UART_EPS (Bitfield-Mask: 0x01) */
-#define UART_UART_LCR_REG_UART_PEN_Pos (3UL) /*!< UART_PEN (Bit 3) */
-#define UART_UART_LCR_REG_UART_PEN_Msk (0x8UL) /*!< UART_PEN (Bitfield-Mask: 0x01) */
-#define UART_UART_LCR_REG_UART_STOP_Pos (2UL) /*!< UART_STOP (Bit 2) */
-#define UART_UART_LCR_REG_UART_STOP_Msk (0x4UL) /*!< UART_STOP (Bitfield-Mask: 0x01) */
-#define UART_UART_LCR_REG_UART_DLS_Pos (0UL) /*!< UART_DLS (Bit 0) */
-#define UART_UART_LCR_REG_UART_DLS_Msk (0x3UL) /*!< UART_DLS (Bitfield-Mask: 0x03) */
-/* ===================================================== UART_LSR_REG ====================================================== */
-#define UART_UART_LSR_REG_UART_RFE_Pos (7UL) /*!< UART_RFE (Bit 7) */
-#define UART_UART_LSR_REG_UART_RFE_Msk (0x80UL) /*!< UART_RFE (Bitfield-Mask: 0x01) */
-#define UART_UART_LSR_REG_UART_TEMT_Pos (6UL) /*!< UART_TEMT (Bit 6) */
-#define UART_UART_LSR_REG_UART_TEMT_Msk (0x40UL) /*!< UART_TEMT (Bitfield-Mask: 0x01) */
-#define UART_UART_LSR_REG_UART_THRE_Pos (5UL) /*!< UART_THRE (Bit 5) */
-#define UART_UART_LSR_REG_UART_THRE_Msk (0x20UL) /*!< UART_THRE (Bitfield-Mask: 0x01) */
-#define UART_UART_LSR_REG_UART_BI_Pos (4UL) /*!< UART_BI (Bit 4) */
-#define UART_UART_LSR_REG_UART_BI_Msk (0x10UL) /*!< UART_BI (Bitfield-Mask: 0x01) */
-#define UART_UART_LSR_REG_UART_FE_Pos (3UL) /*!< UART_FE (Bit 3) */
-#define UART_UART_LSR_REG_UART_FE_Msk (0x8UL) /*!< UART_FE (Bitfield-Mask: 0x01) */
-#define UART_UART_LSR_REG_UART_PE_Pos (2UL) /*!< UART_PE (Bit 2) */
-#define UART_UART_LSR_REG_UART_PE_Msk (0x4UL) /*!< UART_PE (Bitfield-Mask: 0x01) */
-#define UART_UART_LSR_REG_UART_OE_Pos (1UL) /*!< UART_OE (Bit 1) */
-#define UART_UART_LSR_REG_UART_OE_Msk (0x2UL) /*!< UART_OE (Bitfield-Mask: 0x01) */
-#define UART_UART_LSR_REG_UART_DR_Pos (0UL) /*!< UART_DR (Bit 0) */
-#define UART_UART_LSR_REG_UART_DR_Msk (0x1UL) /*!< UART_DR (Bitfield-Mask: 0x01) */
-/* ===================================================== UART_MCR_REG ====================================================== */
-#define UART_UART_MCR_REG_UART_LB_Pos (4UL) /*!< UART_LB (Bit 4) */
-#define UART_UART_MCR_REG_UART_LB_Msk (0x10UL) /*!< UART_LB (Bitfield-Mask: 0x01) */
-/* ================================================= UART_RBR_THR_DLL_REG ================================================== */
-#define UART_UART_RBR_THR_DLL_REG_RBR_THR_DLL_Pos (0UL) /*!< RBR_THR_DLL (Bit 0) */
-#define UART_UART_RBR_THR_DLL_REG_RBR_THR_DLL_Msk (0xffUL) /*!< RBR_THR_DLL (Bitfield-Mask: 0xff) */
-/* ===================================================== UART_RFL_REG ====================================================== */
-#define UART_UART_RFL_REG_UART_RECEIVE_FIFO_LEVEL_Pos (0UL) /*!< UART_RECEIVE_FIFO_LEVEL (Bit 0) */
-#define UART_UART_RFL_REG_UART_RECEIVE_FIFO_LEVEL_Msk (0x1fUL) /*!< UART_RECEIVE_FIFO_LEVEL (Bitfield-Mask: 0x1f) */
-/* ===================================================== UART_SBCR_REG ===================================================== */
-#define UART_UART_SBCR_REG_UART_SHADOW_BREAK_CONTROL_Pos (0UL) /*!< UART_SHADOW_BREAK_CONTROL (Bit 0) */
-#define UART_UART_SBCR_REG_UART_SHADOW_BREAK_CONTROL_Msk (0x1UL) /*!< UART_SHADOW_BREAK_CONTROL (Bitfield-Mask: 0x01) */
-/* ===================================================== UART_SCR_REG ====================================================== */
-#define UART_UART_SCR_REG_UART_SCRATCH_PAD_Pos (0UL) /*!< UART_SCRATCH_PAD (Bit 0) */
-#define UART_UART_SCR_REG_UART_SCRATCH_PAD_Msk (0xffUL) /*!< UART_SCRATCH_PAD (Bitfield-Mask: 0xff) */
-/* ==================================================== UART_SDMAM_REG ===================================================== */
-#define UART_UART_SDMAM_REG_UART_SHADOW_DMA_MODE_Pos (0UL) /*!< UART_SHADOW_DMA_MODE (Bit 0) */
-#define UART_UART_SDMAM_REG_UART_SHADOW_DMA_MODE_Msk (0x1UL) /*!< UART_SHADOW_DMA_MODE (Bitfield-Mask: 0x01) */
-/* ===================================================== UART_SFE_REG ====================================================== */
-#define UART_UART_SFE_REG_UART_SHADOW_FIFO_ENABLE_Pos (0UL) /*!< UART_SHADOW_FIFO_ENABLE (Bit 0) */
-#define UART_UART_SFE_REG_UART_SHADOW_FIFO_ENABLE_Msk (0x1UL) /*!< UART_SHADOW_FIFO_ENABLE (Bitfield-Mask: 0x01) */
-/* ================================================== UART_SRBR_STHR0_REG ================================================== */
-#define UART_UART_SRBR_STHR0_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR0_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART_SRBR_STHR10_REG ================================================== */
-#define UART_UART_SRBR_STHR10_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR10_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART_SRBR_STHR11_REG ================================================== */
-#define UART_UART_SRBR_STHR11_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR11_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART_SRBR_STHR12_REG ================================================== */
-#define UART_UART_SRBR_STHR12_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR12_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART_SRBR_STHR13_REG ================================================== */
-#define UART_UART_SRBR_STHR13_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR13_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART_SRBR_STHR14_REG ================================================== */
-#define UART_UART_SRBR_STHR14_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR14_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART_SRBR_STHR15_REG ================================================== */
-#define UART_UART_SRBR_STHR15_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR15_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================== UART_SRBR_STHR1_REG ================================================== */
-#define UART_UART_SRBR_STHR1_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR1_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================== UART_SRBR_STHR2_REG ================================================== */
-#define UART_UART_SRBR_STHR2_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR2_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================== UART_SRBR_STHR3_REG ================================================== */
-#define UART_UART_SRBR_STHR3_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR3_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================== UART_SRBR_STHR4_REG ================================================== */
-#define UART_UART_SRBR_STHR4_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR4_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================== UART_SRBR_STHR5_REG ================================================== */
-#define UART_UART_SRBR_STHR5_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR5_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================== UART_SRBR_STHR6_REG ================================================== */
-#define UART_UART_SRBR_STHR6_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR6_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================== UART_SRBR_STHR7_REG ================================================== */
-#define UART_UART_SRBR_STHR7_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR7_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================== UART_SRBR_STHR8_REG ================================================== */
-#define UART_UART_SRBR_STHR8_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR8_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================== UART_SRBR_STHR9_REG ================================================== */
-#define UART_UART_SRBR_STHR9_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART_UART_SRBR_STHR9_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ===================================================== UART_SRR_REG ====================================================== */
-#define UART_UART_SRR_REG_UART_XFR_Pos (2UL) /*!< UART_XFR (Bit 2) */
-#define UART_UART_SRR_REG_UART_XFR_Msk (0x4UL) /*!< UART_XFR (Bitfield-Mask: 0x01) */
-#define UART_UART_SRR_REG_UART_RFR_Pos (1UL) /*!< UART_RFR (Bit 1) */
-#define UART_UART_SRR_REG_UART_RFR_Msk (0x2UL) /*!< UART_RFR (Bitfield-Mask: 0x01) */
-#define UART_UART_SRR_REG_UART_UR_Pos (0UL) /*!< UART_UR (Bit 0) */
-#define UART_UART_SRR_REG_UART_UR_Msk (0x1UL) /*!< UART_UR (Bitfield-Mask: 0x01) */
-/* ===================================================== UART_SRT_REG ====================================================== */
-#define UART_UART_SRT_REG_UART_SHADOW_RCVR_TRIGGER_Pos (0UL) /*!< UART_SHADOW_RCVR_TRIGGER (Bit 0) */
-#define UART_UART_SRT_REG_UART_SHADOW_RCVR_TRIGGER_Msk (0x3UL) /*!< UART_SHADOW_RCVR_TRIGGER (Bitfield-Mask: 0x03) */
-/* ===================================================== UART_STET_REG ===================================================== */
-#define UART_UART_STET_REG_UART_SHADOW_TX_EMPTY_TRIGGER_Pos (0UL) /*!< UART_SHADOW_TX_EMPTY_TRIGGER (Bit 0) */
-#define UART_UART_STET_REG_UART_SHADOW_TX_EMPTY_TRIGGER_Msk (0x3UL) /*!< UART_SHADOW_TX_EMPTY_TRIGGER (Bitfield-Mask: 0x03) */
-/* ===================================================== UART_TFL_REG ====================================================== */
-#define UART_UART_TFL_REG_UART_TRANSMIT_FIFO_LEVEL_Pos (0UL) /*!< UART_TRANSMIT_FIFO_LEVEL (Bit 0) */
-#define UART_UART_TFL_REG_UART_TRANSMIT_FIFO_LEVEL_Msk (0x1fUL) /*!< UART_TRANSMIT_FIFO_LEVEL (Bitfield-Mask: 0x1f) */
-/* ===================================================== UART_UCV_REG ====================================================== */
-#define UART_UART_UCV_REG_UART_UCV_Pos (0UL) /*!< UART_UCV (Bit 0) */
-#define UART_UART_UCV_REG_UART_UCV_Msk (0xffffffffUL) /*!< UART_UCV (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== UART_USR_REG ====================================================== */
-#define UART_UART_USR_REG_UART_RFF_Pos (4UL) /*!< UART_RFF (Bit 4) */
-#define UART_UART_USR_REG_UART_RFF_Msk (0x10UL) /*!< UART_RFF (Bitfield-Mask: 0x01) */
-#define UART_UART_USR_REG_UART_RFNE_Pos (3UL) /*!< UART_RFNE (Bit 3) */
-#define UART_UART_USR_REG_UART_RFNE_Msk (0x8UL) /*!< UART_RFNE (Bitfield-Mask: 0x01) */
-#define UART_UART_USR_REG_UART_TFE_Pos (2UL) /*!< UART_TFE (Bit 2) */
-#define UART_UART_USR_REG_UART_TFE_Msk (0x4UL) /*!< UART_TFE (Bitfield-Mask: 0x01) */
-#define UART_UART_USR_REG_UART_TFNF_Pos (1UL) /*!< UART_TFNF (Bit 1) */
-#define UART_UART_USR_REG_UART_TFNF_Msk (0x2UL) /*!< UART_TFNF (Bitfield-Mask: 0x01) */
-#define UART_UART_USR_REG_UART_BUSY_Pos (0UL) /*!< UART_BUSY (Bit 0) */
-#define UART_UART_USR_REG_UART_BUSY_Msk (0x1UL) /*!< UART_BUSY (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ UART2 ================ */
-/* =========================================================================================================================== */
-
-/* ===================================================== UART2_CTR_REG ===================================================== */
-#define UART2_UART2_CTR_REG_UART_CTR_Pos (0UL) /*!< UART_CTR (Bit 0) */
-#define UART2_UART2_CTR_REG_UART_CTR_Msk (0xffffffffUL) /*!< UART_CTR (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== UART2_DLF_REG ===================================================== */
-#define UART2_UART2_DLF_REG_UART_DLF_Pos (0UL) /*!< UART_DLF (Bit 0) */
-#define UART2_UART2_DLF_REG_UART_DLF_Msk (0xfUL) /*!< UART_DLF (Bitfield-Mask: 0x0f) */
-/* ==================================================== UART2_DMASA_REG ==================================================== */
-#define UART2_UART2_DMASA_REG_UART_DMASA_Pos (0UL) /*!< UART_DMASA (Bit 0) */
-#define UART2_UART2_DMASA_REG_UART_DMASA_Msk (0x1UL) /*!< UART_DMASA (Bitfield-Mask: 0x01) */
-/* ===================================================== UART2_HTX_REG ===================================================== */
-#define UART2_UART2_HTX_REG_UART_HALT_TX_Pos (0UL) /*!< UART_HALT_TX (Bit 0) */
-#define UART2_UART2_HTX_REG_UART_HALT_TX_Msk (0x1UL) /*!< UART_HALT_TX (Bitfield-Mask: 0x01) */
-/* =================================================== UART2_IER_DLH_REG =================================================== */
-#define UART2_UART2_IER_DLH_REG_PTIME_DLH7_Pos (7UL) /*!< PTIME_DLH7 (Bit 7) */
-#define UART2_UART2_IER_DLH_REG_PTIME_DLH7_Msk (0x80UL) /*!< PTIME_DLH7 (Bitfield-Mask: 0x01) */
-#define UART2_UART2_IER_DLH_REG_DLH6_5_Pos (5UL) /*!< DLH6_5 (Bit 5) */
-#define UART2_UART2_IER_DLH_REG_DLH6_5_Msk (0x60UL) /*!< DLH6_5 (Bitfield-Mask: 0x03) */
-#define UART2_UART2_IER_DLH_REG_ELCOLR_DLH4_Pos (4UL) /*!< ELCOLR_DLH4 (Bit 4) */
-#define UART2_UART2_IER_DLH_REG_ELCOLR_DLH4_Msk (0x10UL) /*!< ELCOLR_DLH4 (Bitfield-Mask: 0x01) */
-#define UART2_UART2_IER_DLH_REG_EDSSI_DLH3_Pos (3UL) /*!< EDSSI_DLH3 (Bit 3) */
-#define UART2_UART2_IER_DLH_REG_EDSSI_DLH3_Msk (0x8UL) /*!< EDSSI_DLH3 (Bitfield-Mask: 0x01) */
-#define UART2_UART2_IER_DLH_REG_ELSI_DLH2_Pos (2UL) /*!< ELSI_DLH2 (Bit 2) */
-#define UART2_UART2_IER_DLH_REG_ELSI_DLH2_Msk (0x4UL) /*!< ELSI_DLH2 (Bitfield-Mask: 0x01) */
-#define UART2_UART2_IER_DLH_REG_ETBEI_DLH1_Pos (1UL) /*!< ETBEI_DLH1 (Bit 1) */
-#define UART2_UART2_IER_DLH_REG_ETBEI_DLH1_Msk (0x2UL) /*!< ETBEI_DLH1 (Bitfield-Mask: 0x01) */
-#define UART2_UART2_IER_DLH_REG_ERBFI_DLH0_Pos (0UL) /*!< ERBFI_DLH0 (Bit 0) */
-#define UART2_UART2_IER_DLH_REG_ERBFI_DLH0_Msk (0x1UL) /*!< ERBFI_DLH0 (Bitfield-Mask: 0x01) */
-/* =================================================== UART2_IIR_FCR_REG =================================================== */
-#define UART2_UART2_IIR_FCR_REG_IIR_FCR_Pos (0UL) /*!< IIR_FCR (Bit 0) */
-#define UART2_UART2_IIR_FCR_REG_IIR_FCR_Msk (0xffUL) /*!< IIR_FCR (Bitfield-Mask: 0xff) */
-/* ===================================================== UART2_LCR_EXT ===================================================== */
-#define UART2_UART2_LCR_EXT_UART_TRANSMIT_MODE_Pos (3UL) /*!< UART_TRANSMIT_MODE (Bit 3) */
-#define UART2_UART2_LCR_EXT_UART_TRANSMIT_MODE_Msk (0x8UL) /*!< UART_TRANSMIT_MODE (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LCR_EXT_UART_SEND_ADDR_Pos (2UL) /*!< UART_SEND_ADDR (Bit 2) */
-#define UART2_UART2_LCR_EXT_UART_SEND_ADDR_Msk (0x4UL) /*!< UART_SEND_ADDR (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LCR_EXT_UART_ADDR_MATCH_Pos (1UL) /*!< UART_ADDR_MATCH (Bit 1) */
-#define UART2_UART2_LCR_EXT_UART_ADDR_MATCH_Msk (0x2UL) /*!< UART_ADDR_MATCH (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LCR_EXT_UART_DLS_E_Pos (0UL) /*!< UART_DLS_E (Bit 0) */
-#define UART2_UART2_LCR_EXT_UART_DLS_E_Msk (0x1UL) /*!< UART_DLS_E (Bitfield-Mask: 0x01) */
-/* ===================================================== UART2_LCR_REG ===================================================== */
-#define UART2_UART2_LCR_REG_UART_DLAB_Pos (7UL) /*!< UART_DLAB (Bit 7) */
-#define UART2_UART2_LCR_REG_UART_DLAB_Msk (0x80UL) /*!< UART_DLAB (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LCR_REG_UART_BC_Pos (6UL) /*!< UART_BC (Bit 6) */
-#define UART2_UART2_LCR_REG_UART_BC_Msk (0x40UL) /*!< UART_BC (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LCR_REG_UART_SP_Pos (5UL) /*!< UART_SP (Bit 5) */
-#define UART2_UART2_LCR_REG_UART_SP_Msk (0x20UL) /*!< UART_SP (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LCR_REG_UART_EPS_Pos (4UL) /*!< UART_EPS (Bit 4) */
-#define UART2_UART2_LCR_REG_UART_EPS_Msk (0x10UL) /*!< UART_EPS (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LCR_REG_UART_PEN_Pos (3UL) /*!< UART_PEN (Bit 3) */
-#define UART2_UART2_LCR_REG_UART_PEN_Msk (0x8UL) /*!< UART_PEN (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LCR_REG_UART_STOP_Pos (2UL) /*!< UART_STOP (Bit 2) */
-#define UART2_UART2_LCR_REG_UART_STOP_Msk (0x4UL) /*!< UART_STOP (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LCR_REG_UART_DLS_Pos (0UL) /*!< UART_DLS (Bit 0) */
-#define UART2_UART2_LCR_REG_UART_DLS_Msk (0x3UL) /*!< UART_DLS (Bitfield-Mask: 0x03) */
-/* ===================================================== UART2_LSR_REG ===================================================== */
-#define UART2_UART2_LSR_REG_UART_ADDR_RCVD_Pos (8UL) /*!< UART_ADDR_RCVD (Bit 8) */
-#define UART2_UART2_LSR_REG_UART_ADDR_RCVD_Msk (0x100UL) /*!< UART_ADDR_RCVD (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LSR_REG_UART_RFE_Pos (7UL) /*!< UART_RFE (Bit 7) */
-#define UART2_UART2_LSR_REG_UART_RFE_Msk (0x80UL) /*!< UART_RFE (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LSR_REG_UART_TEMT_Pos (6UL) /*!< UART_TEMT (Bit 6) */
-#define UART2_UART2_LSR_REG_UART_TEMT_Msk (0x40UL) /*!< UART_TEMT (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LSR_REG_UART_THRE_Pos (5UL) /*!< UART_THRE (Bit 5) */
-#define UART2_UART2_LSR_REG_UART_THRE_Msk (0x20UL) /*!< UART_THRE (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LSR_REG_UART_BI_Pos (4UL) /*!< UART_BI (Bit 4) */
-#define UART2_UART2_LSR_REG_UART_BI_Msk (0x10UL) /*!< UART_BI (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LSR_REG_UART_FE_Pos (3UL) /*!< UART_FE (Bit 3) */
-#define UART2_UART2_LSR_REG_UART_FE_Msk (0x8UL) /*!< UART_FE (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LSR_REG_UART_PE_Pos (2UL) /*!< UART_PE (Bit 2) */
-#define UART2_UART2_LSR_REG_UART_PE_Msk (0x4UL) /*!< UART_PE (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LSR_REG_UART_OE_Pos (1UL) /*!< UART_OE (Bit 1) */
-#define UART2_UART2_LSR_REG_UART_OE_Msk (0x2UL) /*!< UART_OE (Bitfield-Mask: 0x01) */
-#define UART2_UART2_LSR_REG_UART_DR_Pos (0UL) /*!< UART_DR (Bit 0) */
-#define UART2_UART2_LSR_REG_UART_DR_Msk (0x1UL) /*!< UART_DR (Bitfield-Mask: 0x01) */
-/* ===================================================== UART2_MCR_REG ===================================================== */
-#define UART2_UART2_MCR_REG_UART_AFCE_Pos (5UL) /*!< UART_AFCE (Bit 5) */
-#define UART2_UART2_MCR_REG_UART_AFCE_Msk (0x20UL) /*!< UART_AFCE (Bitfield-Mask: 0x01) */
-#define UART2_UART2_MCR_REG_UART_LB_Pos (4UL) /*!< UART_LB (Bit 4) */
-#define UART2_UART2_MCR_REG_UART_LB_Msk (0x10UL) /*!< UART_LB (Bitfield-Mask: 0x01) */
-#define UART2_UART2_MCR_REG_UART_RTS_Pos (1UL) /*!< UART_RTS (Bit 1) */
-#define UART2_UART2_MCR_REG_UART_RTS_Msk (0x2UL) /*!< UART_RTS (Bitfield-Mask: 0x01) */
-/* ===================================================== UART2_MSR_REG ===================================================== */
-#define UART2_UART2_MSR_REG_UART_CTS_Pos (4UL) /*!< UART_CTS (Bit 4) */
-#define UART2_UART2_MSR_REG_UART_CTS_Msk (0x10UL) /*!< UART_CTS (Bitfield-Mask: 0x01) */
-#define UART2_UART2_MSR_REG_UART_DCTS_Pos (0UL) /*!< UART_DCTS (Bit 0) */
-#define UART2_UART2_MSR_REG_UART_DCTS_Msk (0x1UL) /*!< UART_DCTS (Bitfield-Mask: 0x01) */
-/* ===================================================== UART2_RAR_REG ===================================================== */
-#define UART2_UART2_RAR_REG_UART_RAR_Pos (0UL) /*!< UART_RAR (Bit 0) */
-#define UART2_UART2_RAR_REG_UART_RAR_Msk (0xffUL) /*!< UART_RAR (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_RBR_THR_DLL_REG ================================================= */
-#define UART2_UART2_RBR_THR_DLL_REG_RBR_THR_9BIT_Pos (8UL) /*!< RBR_THR_9BIT (Bit 8) */
-#define UART2_UART2_RBR_THR_DLL_REG_RBR_THR_9BIT_Msk (0x100UL) /*!< RBR_THR_9BIT (Bitfield-Mask: 0x01) */
-#define UART2_UART2_RBR_THR_DLL_REG_RBR_THR_DLL_Pos (0UL) /*!< RBR_THR_DLL (Bit 0) */
-#define UART2_UART2_RBR_THR_DLL_REG_RBR_THR_DLL_Msk (0xffUL) /*!< RBR_THR_DLL (Bitfield-Mask: 0xff) */
-/* ===================================================== UART2_RFL_REG ===================================================== */
-#define UART2_UART2_RFL_REG_UART_RECEIVE_FIFO_LEVEL_Pos (0UL) /*!< UART_RECEIVE_FIFO_LEVEL (Bit 0) */
-#define UART2_UART2_RFL_REG_UART_RECEIVE_FIFO_LEVEL_Msk (0x1fUL) /*!< UART_RECEIVE_FIFO_LEVEL (Bitfield-Mask: 0x1f) */
-/* ==================================================== UART2_SBCR_REG ===================================================== */
-#define UART2_UART2_SBCR_REG_UART_SHADOW_BREAK_CONTROL_Pos (0UL) /*!< UART_SHADOW_BREAK_CONTROL (Bit 0) */
-#define UART2_UART2_SBCR_REG_UART_SHADOW_BREAK_CONTROL_Msk (0x1UL) /*!< UART_SHADOW_BREAK_CONTROL (Bitfield-Mask: 0x01) */
-/* ===================================================== UART2_SCR_REG ===================================================== */
-#define UART2_UART2_SCR_REG_UART_SCRATCH_PAD_Pos (0UL) /*!< UART_SCRATCH_PAD (Bit 0) */
-#define UART2_UART2_SCR_REG_UART_SCRATCH_PAD_Msk (0xffUL) /*!< UART_SCRATCH_PAD (Bitfield-Mask: 0xff) */
-/* ==================================================== UART2_SDMAM_REG ==================================================== */
-#define UART2_UART2_SDMAM_REG_UART_SHADOW_DMA_MODE_Pos (0UL) /*!< UART_SHADOW_DMA_MODE (Bit 0) */
-#define UART2_UART2_SDMAM_REG_UART_SHADOW_DMA_MODE_Msk (0x1UL) /*!< UART_SHADOW_DMA_MODE (Bitfield-Mask: 0x01) */
-/* ===================================================== UART2_SFE_REG ===================================================== */
-#define UART2_UART2_SFE_REG_UART_SHADOW_FIFO_ENABLE_Pos (0UL) /*!< UART_SHADOW_FIFO_ENABLE (Bit 0) */
-#define UART2_UART2_SFE_REG_UART_SHADOW_FIFO_ENABLE_Msk (0x1UL) /*!< UART_SHADOW_FIFO_ENABLE (Bitfield-Mask: 0x01) */
-/* ================================================= UART2_SRBR_STHR0_REG ================================================== */
-#define UART2_UART2_SRBR_STHR0_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR0_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR10_REG ================================================= */
-#define UART2_UART2_SRBR_STHR10_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR10_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR11_REG ================================================= */
-#define UART2_UART2_SRBR_STHR11_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR11_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR12_REG ================================================= */
-#define UART2_UART2_SRBR_STHR12_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR12_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR13_REG ================================================= */
-#define UART2_UART2_SRBR_STHR13_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR13_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR14_REG ================================================= */
-#define UART2_UART2_SRBR_STHR14_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR14_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR15_REG ================================================= */
-#define UART2_UART2_SRBR_STHR15_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR15_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR1_REG ================================================== */
-#define UART2_UART2_SRBR_STHR1_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR1_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR2_REG ================================================== */
-#define UART2_UART2_SRBR_STHR2_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR2_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR3_REG ================================================== */
-#define UART2_UART2_SRBR_STHR3_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR3_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR4_REG ================================================== */
-#define UART2_UART2_SRBR_STHR4_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR4_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR5_REG ================================================== */
-#define UART2_UART2_SRBR_STHR5_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR5_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR6_REG ================================================== */
-#define UART2_UART2_SRBR_STHR6_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR6_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR7_REG ================================================== */
-#define UART2_UART2_SRBR_STHR7_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR7_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR8_REG ================================================== */
-#define UART2_UART2_SRBR_STHR8_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR8_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART2_SRBR_STHR9_REG ================================================== */
-#define UART2_UART2_SRBR_STHR9_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART2_UART2_SRBR_STHR9_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ===================================================== UART2_SRR_REG ===================================================== */
-#define UART2_UART2_SRR_REG_UART_XFR_Pos (2UL) /*!< UART_XFR (Bit 2) */
-#define UART2_UART2_SRR_REG_UART_XFR_Msk (0x4UL) /*!< UART_XFR (Bitfield-Mask: 0x01) */
-#define UART2_UART2_SRR_REG_UART_RFR_Pos (1UL) /*!< UART_RFR (Bit 1) */
-#define UART2_UART2_SRR_REG_UART_RFR_Msk (0x2UL) /*!< UART_RFR (Bitfield-Mask: 0x01) */
-#define UART2_UART2_SRR_REG_UART_UR_Pos (0UL) /*!< UART_UR (Bit 0) */
-#define UART2_UART2_SRR_REG_UART_UR_Msk (0x1UL) /*!< UART_UR (Bitfield-Mask: 0x01) */
-/* ==================================================== UART2_SRTS_REG ===================================================== */
-#define UART2_UART2_SRTS_REG_UART_SHADOW_REQUEST_TO_SEND_Pos (0UL) /*!< UART_SHADOW_REQUEST_TO_SEND (Bit 0) */
-#define UART2_UART2_SRTS_REG_UART_SHADOW_REQUEST_TO_SEND_Msk (0x1UL) /*!< UART_SHADOW_REQUEST_TO_SEND (Bitfield-Mask: 0x01) */
-/* ===================================================== UART2_SRT_REG ===================================================== */
-#define UART2_UART2_SRT_REG_UART_SHADOW_RCVR_TRIGGER_Pos (0UL) /*!< UART_SHADOW_RCVR_TRIGGER (Bit 0) */
-#define UART2_UART2_SRT_REG_UART_SHADOW_RCVR_TRIGGER_Msk (0x3UL) /*!< UART_SHADOW_RCVR_TRIGGER (Bitfield-Mask: 0x03) */
-/* ==================================================== UART2_STET_REG ===================================================== */
-#define UART2_UART2_STET_REG_UART_SHADOW_TX_EMPTY_TRIGGER_Pos (0UL) /*!< UART_SHADOW_TX_EMPTY_TRIGGER (Bit 0) */
-#define UART2_UART2_STET_REG_UART_SHADOW_TX_EMPTY_TRIGGER_Msk (0x3UL) /*!< UART_SHADOW_TX_EMPTY_TRIGGER (Bitfield-Mask: 0x03) */
-/* ===================================================== UART2_TAR_REG ===================================================== */
-#define UART2_UART2_TAR_REG_UART_TAR_Pos (0UL) /*!< UART_TAR (Bit 0) */
-#define UART2_UART2_TAR_REG_UART_TAR_Msk (0xffUL) /*!< UART_TAR (Bitfield-Mask: 0xff) */
-/* ===================================================== UART2_TFL_REG ===================================================== */
-#define UART2_UART2_TFL_REG_UART_TRANSMIT_FIFO_LEVEL_Pos (0UL) /*!< UART_TRANSMIT_FIFO_LEVEL (Bit 0) */
-#define UART2_UART2_TFL_REG_UART_TRANSMIT_FIFO_LEVEL_Msk (0x1fUL) /*!< UART_TRANSMIT_FIFO_LEVEL (Bitfield-Mask: 0x1f) */
-/* ===================================================== UART2_UCV_REG ===================================================== */
-#define UART2_UART2_UCV_REG_UART_UCV_Pos (0UL) /*!< UART_UCV (Bit 0) */
-#define UART2_UART2_UCV_REG_UART_UCV_Msk (0xffffffffUL) /*!< UART_UCV (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== UART2_USR_REG ===================================================== */
-#define UART2_UART2_USR_REG_UART_RFF_Pos (4UL) /*!< UART_RFF (Bit 4) */
-#define UART2_UART2_USR_REG_UART_RFF_Msk (0x10UL) /*!< UART_RFF (Bitfield-Mask: 0x01) */
-#define UART2_UART2_USR_REG_UART_RFNE_Pos (3UL) /*!< UART_RFNE (Bit 3) */
-#define UART2_UART2_USR_REG_UART_RFNE_Msk (0x8UL) /*!< UART_RFNE (Bitfield-Mask: 0x01) */
-#define UART2_UART2_USR_REG_UART_TFE_Pos (2UL) /*!< UART_TFE (Bit 2) */
-#define UART2_UART2_USR_REG_UART_TFE_Msk (0x4UL) /*!< UART_TFE (Bitfield-Mask: 0x01) */
-#define UART2_UART2_USR_REG_UART_TFNF_Pos (1UL) /*!< UART_TFNF (Bit 1) */
-#define UART2_UART2_USR_REG_UART_TFNF_Msk (0x2UL) /*!< UART_TFNF (Bitfield-Mask: 0x01) */
-#define UART2_UART2_USR_REG_UART_BUSY_Pos (0UL) /*!< UART_BUSY (Bit 0) */
-#define UART2_UART2_USR_REG_UART_BUSY_Msk (0x1UL) /*!< UART_BUSY (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ UART3 ================ */
-/* =========================================================================================================================== */
-
-/* =================================================== UART3_CONFIG_REG ==================================================== */
-#define UART3_UART3_CONFIG_REG_ISO7816_SCRATCH_PAD_Pos (3UL) /*!< ISO7816_SCRATCH_PAD (Bit 3) */
-#define UART3_UART3_CONFIG_REG_ISO7816_SCRATCH_PAD_Msk (0xf8UL) /*!< ISO7816_SCRATCH_PAD (Bitfield-Mask: 0x1f) */
-#define UART3_UART3_CONFIG_REG_ISO7816_ENABLE_Pos (2UL) /*!< ISO7816_ENABLE (Bit 2) */
-#define UART3_UART3_CONFIG_REG_ISO7816_ENABLE_Msk (0x4UL) /*!< ISO7816_ENABLE (Bitfield-Mask: 0x01) */
-#define UART3_UART3_CONFIG_REG_ISO7816_ERR_SIG_EN_Pos (1UL) /*!< ISO7816_ERR_SIG_EN (Bit 1) */
-#define UART3_UART3_CONFIG_REG_ISO7816_ERR_SIG_EN_Msk (0x2UL) /*!< ISO7816_ERR_SIG_EN (Bitfield-Mask: 0x01) */
-#define UART3_UART3_CONFIG_REG_ISO7816_CONVENTION_Pos (0UL) /*!< ISO7816_CONVENTION (Bit 0) */
-#define UART3_UART3_CONFIG_REG_ISO7816_CONVENTION_Msk (0x1UL) /*!< ISO7816_CONVENTION (Bitfield-Mask: 0x01) */
-/* ==================================================== UART3_CTRL_REG ===================================================== */
-#define UART3_UART3_CTRL_REG_ISO7816_AUTO_GT_Pos (11UL) /*!< ISO7816_AUTO_GT (Bit 11) */
-#define UART3_UART3_CTRL_REG_ISO7816_AUTO_GT_Msk (0x800UL) /*!< ISO7816_AUTO_GT (Bitfield-Mask: 0x01) */
-#define UART3_UART3_CTRL_REG_ISO7816_ERR_TX_VALUE_IRQMASK_Pos (10UL) /*!< ISO7816_ERR_TX_VALUE_IRQMASK (Bit 10) */
-#define UART3_UART3_CTRL_REG_ISO7816_ERR_TX_VALUE_IRQMASK_Msk (0x400UL) /*!< ISO7816_ERR_TX_VALUE_IRQMASK (Bitfield-Mask: 0x01) */
-#define UART3_UART3_CTRL_REG_ISO7816_ERR_TX_TIME_IRQMASK_Pos (9UL) /*!< ISO7816_ERR_TX_TIME_IRQMASK (Bit 9) */
-#define UART3_UART3_CTRL_REG_ISO7816_ERR_TX_TIME_IRQMASK_Msk (0x200UL) /*!< ISO7816_ERR_TX_TIME_IRQMASK (Bitfield-Mask: 0x01) */
-#define UART3_UART3_CTRL_REG_ISO7816_TIM_EXPIRED_IRQMASK_Pos (8UL) /*!< ISO7816_TIM_EXPIRED_IRQMASK (Bit 8) */
-#define UART3_UART3_CTRL_REG_ISO7816_TIM_EXPIRED_IRQMASK_Msk (0x100UL) /*!< ISO7816_TIM_EXPIRED_IRQMASK (Bitfield-Mask: 0x01) */
-#define UART3_UART3_CTRL_REG_ISO7816_CLK_STATUS_Pos (7UL) /*!< ISO7816_CLK_STATUS (Bit 7) */
-#define UART3_UART3_CTRL_REG_ISO7816_CLK_STATUS_Msk (0x80UL) /*!< ISO7816_CLK_STATUS (Bitfield-Mask: 0x01) */
-#define UART3_UART3_CTRL_REG_ISO7816_CLK_LEVEL_Pos (6UL) /*!< ISO7816_CLK_LEVEL (Bit 6) */
-#define UART3_UART3_CTRL_REG_ISO7816_CLK_LEVEL_Msk (0x40UL) /*!< ISO7816_CLK_LEVEL (Bitfield-Mask: 0x01) */
-#define UART3_UART3_CTRL_REG_ISO7816_CLK_EN_Pos (5UL) /*!< ISO7816_CLK_EN (Bit 5) */
-#define UART3_UART3_CTRL_REG_ISO7816_CLK_EN_Msk (0x20UL) /*!< ISO7816_CLK_EN (Bitfield-Mask: 0x01) */
-#define UART3_UART3_CTRL_REG_ISO7816_CLK_DIV_Pos (0UL) /*!< ISO7816_CLK_DIV (Bit 0) */
-#define UART3_UART3_CTRL_REG_ISO7816_CLK_DIV_Msk (0x1fUL) /*!< ISO7816_CLK_DIV (Bitfield-Mask: 0x1f) */
-/* ===================================================== UART3_CTR_REG ===================================================== */
-#define UART3_UART3_CTR_REG_UART_CTR_Pos (0UL) /*!< UART_CTR (Bit 0) */
-#define UART3_UART3_CTR_REG_UART_CTR_Msk (0xffffffffUL) /*!< UART_CTR (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== UART3_DLF_REG ===================================================== */
-#define UART3_UART3_DLF_REG_UART_DLF_Pos (0UL) /*!< UART_DLF (Bit 0) */
-#define UART3_UART3_DLF_REG_UART_DLF_Msk (0xfUL) /*!< UART_DLF (Bitfield-Mask: 0x0f) */
-/* ==================================================== UART3_DMASA_REG ==================================================== */
-#define UART3_UART3_DMASA_REG_UART_DMASA_Pos (0UL) /*!< UART_DMASA (Bit 0) */
-#define UART3_UART3_DMASA_REG_UART_DMASA_Msk (0x1UL) /*!< UART_DMASA (Bitfield-Mask: 0x01) */
-/* ================================================== UART3_ERR_CTRL_REG =================================================== */
-#define UART3_UART3_ERR_CTRL_REG_ISO7816_ERR_PULSE_WIDTH_Pos (4UL) /*!< ISO7816_ERR_PULSE_WIDTH (Bit 4) */
-#define UART3_UART3_ERR_CTRL_REG_ISO7816_ERR_PULSE_WIDTH_Msk (0x1f0UL) /*!< ISO7816_ERR_PULSE_WIDTH (Bitfield-Mask: 0x1f) */
-#define UART3_UART3_ERR_CTRL_REG_ISO7816_ERR_PULSE_OFFSET_Pos (0UL) /*!< ISO7816_ERR_PULSE_OFFSET (Bit 0) */
-#define UART3_UART3_ERR_CTRL_REG_ISO7816_ERR_PULSE_OFFSET_Msk (0xfUL) /*!< ISO7816_ERR_PULSE_OFFSET (Bitfield-Mask: 0x0f) */
-/* ===================================================== UART3_HTX_REG ===================================================== */
-#define UART3_UART3_HTX_REG_UART_HALT_TX_Pos (0UL) /*!< UART_HALT_TX (Bit 0) */
-#define UART3_UART3_HTX_REG_UART_HALT_TX_Msk (0x1UL) /*!< UART_HALT_TX (Bitfield-Mask: 0x01) */
-/* =================================================== UART3_IER_DLH_REG =================================================== */
-#define UART3_UART3_IER_DLH_REG_PTIME_DLH7_Pos (7UL) /*!< PTIME_DLH7 (Bit 7) */
-#define UART3_UART3_IER_DLH_REG_PTIME_DLH7_Msk (0x80UL) /*!< PTIME_DLH7 (Bitfield-Mask: 0x01) */
-#define UART3_UART3_IER_DLH_REG_DLH6_5_Pos (5UL) /*!< DLH6_5 (Bit 5) */
-#define UART3_UART3_IER_DLH_REG_DLH6_5_Msk (0x60UL) /*!< DLH6_5 (Bitfield-Mask: 0x03) */
-#define UART3_UART3_IER_DLH_REG_ELCOLR_DLH4_Pos (4UL) /*!< ELCOLR_DLH4 (Bit 4) */
-#define UART3_UART3_IER_DLH_REG_ELCOLR_DLH4_Msk (0x10UL) /*!< ELCOLR_DLH4 (Bitfield-Mask: 0x01) */
-#define UART3_UART3_IER_DLH_REG_EDSSI_DLH3_Pos (3UL) /*!< EDSSI_DLH3 (Bit 3) */
-#define UART3_UART3_IER_DLH_REG_EDSSI_DLH3_Msk (0x8UL) /*!< EDSSI_DLH3 (Bitfield-Mask: 0x01) */
-#define UART3_UART3_IER_DLH_REG_ELSI_DLH2_Pos (2UL) /*!< ELSI_DLH2 (Bit 2) */
-#define UART3_UART3_IER_DLH_REG_ELSI_DLH2_Msk (0x4UL) /*!< ELSI_DLH2 (Bitfield-Mask: 0x01) */
-#define UART3_UART3_IER_DLH_REG_ETBEI_DLH1_Pos (1UL) /*!< ETBEI_DLH1 (Bit 1) */
-#define UART3_UART3_IER_DLH_REG_ETBEI_DLH1_Msk (0x2UL) /*!< ETBEI_DLH1 (Bitfield-Mask: 0x01) */
-#define UART3_UART3_IER_DLH_REG_ERBFI_DLH0_Pos (0UL) /*!< ERBFI_DLH0 (Bit 0) */
-#define UART3_UART3_IER_DLH_REG_ERBFI_DLH0_Msk (0x1UL) /*!< ERBFI_DLH0 (Bitfield-Mask: 0x01) */
-/* =================================================== UART3_IIR_FCR_REG =================================================== */
-#define UART3_UART3_IIR_FCR_REG_IIR_FCR_Pos (0UL) /*!< IIR_FCR (Bit 0) */
-#define UART3_UART3_IIR_FCR_REG_IIR_FCR_Msk (0xffUL) /*!< IIR_FCR (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_IRQ_STATUS_REG ================================================== */
-#define UART3_UART3_IRQ_STATUS_REG_ISO7816_ERR_TX_VALUE_IRQ_Pos (2UL) /*!< ISO7816_ERR_TX_VALUE_IRQ (Bit 2) */
-#define UART3_UART3_IRQ_STATUS_REG_ISO7816_ERR_TX_VALUE_IRQ_Msk (0x4UL) /*!< ISO7816_ERR_TX_VALUE_IRQ (Bitfield-Mask: 0x01) */
-#define UART3_UART3_IRQ_STATUS_REG_ISO7816_ERR_TX_TIME_IRQ_Pos (1UL) /*!< ISO7816_ERR_TX_TIME_IRQ (Bit 1) */
-#define UART3_UART3_IRQ_STATUS_REG_ISO7816_ERR_TX_TIME_IRQ_Msk (0x2UL) /*!< ISO7816_ERR_TX_TIME_IRQ (Bitfield-Mask: 0x01) */
-#define UART3_UART3_IRQ_STATUS_REG_ISO7816_TIM_EXPIRED_IRQ_Pos (0UL) /*!< ISO7816_TIM_EXPIRED_IRQ (Bit 0) */
-#define UART3_UART3_IRQ_STATUS_REG_ISO7816_TIM_EXPIRED_IRQ_Msk (0x1UL) /*!< ISO7816_TIM_EXPIRED_IRQ (Bitfield-Mask: 0x01) */
-/* ===================================================== UART3_LCR_EXT ===================================================== */
-#define UART3_UART3_LCR_EXT_UART_TRANSMIT_MODE_Pos (3UL) /*!< UART_TRANSMIT_MODE (Bit 3) */
-#define UART3_UART3_LCR_EXT_UART_TRANSMIT_MODE_Msk (0x8UL) /*!< UART_TRANSMIT_MODE (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LCR_EXT_UART_SEND_ADDR_Pos (2UL) /*!< UART_SEND_ADDR (Bit 2) */
-#define UART3_UART3_LCR_EXT_UART_SEND_ADDR_Msk (0x4UL) /*!< UART_SEND_ADDR (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LCR_EXT_UART_ADDR_MATCH_Pos (1UL) /*!< UART_ADDR_MATCH (Bit 1) */
-#define UART3_UART3_LCR_EXT_UART_ADDR_MATCH_Msk (0x2UL) /*!< UART_ADDR_MATCH (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LCR_EXT_UART_DLS_E_Pos (0UL) /*!< UART_DLS_E (Bit 0) */
-#define UART3_UART3_LCR_EXT_UART_DLS_E_Msk (0x1UL) /*!< UART_DLS_E (Bitfield-Mask: 0x01) */
-/* ===================================================== UART3_LCR_REG ===================================================== */
-#define UART3_UART3_LCR_REG_UART_DLAB_Pos (7UL) /*!< UART_DLAB (Bit 7) */
-#define UART3_UART3_LCR_REG_UART_DLAB_Msk (0x80UL) /*!< UART_DLAB (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LCR_REG_UART_BC_Pos (6UL) /*!< UART_BC (Bit 6) */
-#define UART3_UART3_LCR_REG_UART_BC_Msk (0x40UL) /*!< UART_BC (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LCR_REG_UART_SP_Pos (5UL) /*!< UART_SP (Bit 5) */
-#define UART3_UART3_LCR_REG_UART_SP_Msk (0x20UL) /*!< UART_SP (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LCR_REG_UART_EPS_Pos (4UL) /*!< UART_EPS (Bit 4) */
-#define UART3_UART3_LCR_REG_UART_EPS_Msk (0x10UL) /*!< UART_EPS (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LCR_REG_UART_PEN_Pos (3UL) /*!< UART_PEN (Bit 3) */
-#define UART3_UART3_LCR_REG_UART_PEN_Msk (0x8UL) /*!< UART_PEN (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LCR_REG_UART_STOP_Pos (2UL) /*!< UART_STOP (Bit 2) */
-#define UART3_UART3_LCR_REG_UART_STOP_Msk (0x4UL) /*!< UART_STOP (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LCR_REG_UART_DLS_Pos (0UL) /*!< UART_DLS (Bit 0) */
-#define UART3_UART3_LCR_REG_UART_DLS_Msk (0x3UL) /*!< UART_DLS (Bitfield-Mask: 0x03) */
-/* ===================================================== UART3_LSR_REG ===================================================== */
-#define UART3_UART3_LSR_REG_UART_ADDR_RCVD_Pos (8UL) /*!< UART_ADDR_RCVD (Bit 8) */
-#define UART3_UART3_LSR_REG_UART_ADDR_RCVD_Msk (0x100UL) /*!< UART_ADDR_RCVD (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LSR_REG_UART_RFE_Pos (7UL) /*!< UART_RFE (Bit 7) */
-#define UART3_UART3_LSR_REG_UART_RFE_Msk (0x80UL) /*!< UART_RFE (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LSR_REG_UART_TEMT_Pos (6UL) /*!< UART_TEMT (Bit 6) */
-#define UART3_UART3_LSR_REG_UART_TEMT_Msk (0x40UL) /*!< UART_TEMT (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LSR_REG_UART_THRE_Pos (5UL) /*!< UART_THRE (Bit 5) */
-#define UART3_UART3_LSR_REG_UART_THRE_Msk (0x20UL) /*!< UART_THRE (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LSR_REG_UART_BI_Pos (4UL) /*!< UART_BI (Bit 4) */
-#define UART3_UART3_LSR_REG_UART_BI_Msk (0x10UL) /*!< UART_BI (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LSR_REG_UART_FE_Pos (3UL) /*!< UART_FE (Bit 3) */
-#define UART3_UART3_LSR_REG_UART_FE_Msk (0x8UL) /*!< UART_FE (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LSR_REG_UART_PE_Pos (2UL) /*!< UART_PE (Bit 2) */
-#define UART3_UART3_LSR_REG_UART_PE_Msk (0x4UL) /*!< UART_PE (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LSR_REG_UART_OE_Pos (1UL) /*!< UART_OE (Bit 1) */
-#define UART3_UART3_LSR_REG_UART_OE_Msk (0x2UL) /*!< UART_OE (Bitfield-Mask: 0x01) */
-#define UART3_UART3_LSR_REG_UART_DR_Pos (0UL) /*!< UART_DR (Bit 0) */
-#define UART3_UART3_LSR_REG_UART_DR_Msk (0x1UL) /*!< UART_DR (Bitfield-Mask: 0x01) */
-/* ===================================================== UART3_MCR_REG ===================================================== */
-#define UART3_UART3_MCR_REG_UART_AFCE_Pos (5UL) /*!< UART_AFCE (Bit 5) */
-#define UART3_UART3_MCR_REG_UART_AFCE_Msk (0x20UL) /*!< UART_AFCE (Bitfield-Mask: 0x01) */
-#define UART3_UART3_MCR_REG_UART_LB_Pos (4UL) /*!< UART_LB (Bit 4) */
-#define UART3_UART3_MCR_REG_UART_LB_Msk (0x10UL) /*!< UART_LB (Bitfield-Mask: 0x01) */
-#define UART3_UART3_MCR_REG_UART_RTS_Pos (1UL) /*!< UART_RTS (Bit 1) */
-#define UART3_UART3_MCR_REG_UART_RTS_Msk (0x2UL) /*!< UART_RTS (Bitfield-Mask: 0x01) */
-/* ===================================================== UART3_MSR_REG ===================================================== */
-#define UART3_UART3_MSR_REG_UART_CTS_Pos (4UL) /*!< UART_CTS (Bit 4) */
-#define UART3_UART3_MSR_REG_UART_CTS_Msk (0x10UL) /*!< UART_CTS (Bitfield-Mask: 0x01) */
-#define UART3_UART3_MSR_REG_UART_DCTS_Pos (0UL) /*!< UART_DCTS (Bit 0) */
-#define UART3_UART3_MSR_REG_UART_DCTS_Msk (0x1UL) /*!< UART_DCTS (Bitfield-Mask: 0x01) */
-/* ===================================================== UART3_RAR_REG ===================================================== */
-#define UART3_UART3_RAR_REG_UART_RAR_Pos (0UL) /*!< UART_RAR (Bit 0) */
-#define UART3_UART3_RAR_REG_UART_RAR_Msk (0xffUL) /*!< UART_RAR (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_RBR_THR_DLL_REG ================================================= */
-#define UART3_UART3_RBR_THR_DLL_REG_RBR_THR_9BIT_Pos (8UL) /*!< RBR_THR_9BIT (Bit 8) */
-#define UART3_UART3_RBR_THR_DLL_REG_RBR_THR_9BIT_Msk (0x100UL) /*!< RBR_THR_9BIT (Bitfield-Mask: 0x01) */
-#define UART3_UART3_RBR_THR_DLL_REG_RBR_THR_DLL_Pos (0UL) /*!< RBR_THR_DLL (Bit 0) */
-#define UART3_UART3_RBR_THR_DLL_REG_RBR_THR_DLL_Msk (0xffUL) /*!< RBR_THR_DLL (Bitfield-Mask: 0xff) */
-/* ===================================================== UART3_RFL_REG ===================================================== */
-#define UART3_UART3_RFL_REG_UART_RECEIVE_FIFO_LEVEL_Pos (0UL) /*!< UART_RECEIVE_FIFO_LEVEL (Bit 0) */
-#define UART3_UART3_RFL_REG_UART_RECEIVE_FIFO_LEVEL_Msk (0x1fUL) /*!< UART_RECEIVE_FIFO_LEVEL (Bitfield-Mask: 0x1f) */
-/* ==================================================== UART3_SBCR_REG ===================================================== */
-#define UART3_UART3_SBCR_REG_UART_SHADOW_BREAK_CONTROL_Pos (0UL) /*!< UART_SHADOW_BREAK_CONTROL (Bit 0) */
-#define UART3_UART3_SBCR_REG_UART_SHADOW_BREAK_CONTROL_Msk (0x1UL) /*!< UART_SHADOW_BREAK_CONTROL (Bitfield-Mask: 0x01) */
-/* ==================================================== UART3_SDMAM_REG ==================================================== */
-#define UART3_UART3_SDMAM_REG_UART_SHADOW_DMA_MODE_Pos (0UL) /*!< UART_SHADOW_DMA_MODE (Bit 0) */
-#define UART3_UART3_SDMAM_REG_UART_SHADOW_DMA_MODE_Msk (0x1UL) /*!< UART_SHADOW_DMA_MODE (Bitfield-Mask: 0x01) */
-/* ===================================================== UART3_SFE_REG ===================================================== */
-#define UART3_UART3_SFE_REG_UART_SHADOW_FIFO_ENABLE_Pos (0UL) /*!< UART_SHADOW_FIFO_ENABLE (Bit 0) */
-#define UART3_UART3_SFE_REG_UART_SHADOW_FIFO_ENABLE_Msk (0x1UL) /*!< UART_SHADOW_FIFO_ENABLE (Bitfield-Mask: 0x01) */
-/* ================================================= UART3_SRBR_STHR0_REG ================================================== */
-#define UART3_UART3_SRBR_STHR0_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR0_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR10_REG ================================================= */
-#define UART3_UART3_SRBR_STHR10_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR10_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR11_REG ================================================= */
-#define UART3_UART3_SRBR_STHR11_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR11_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR12_REG ================================================= */
-#define UART3_UART3_SRBR_STHR12_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR12_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR13_REG ================================================= */
-#define UART3_UART3_SRBR_STHR13_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR13_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR14_REG ================================================= */
-#define UART3_UART3_SRBR_STHR14_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR14_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR15_REG ================================================= */
-#define UART3_UART3_SRBR_STHR15_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR15_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR1_REG ================================================== */
-#define UART3_UART3_SRBR_STHR1_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR1_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR2_REG ================================================== */
-#define UART3_UART3_SRBR_STHR2_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR2_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR3_REG ================================================== */
-#define UART3_UART3_SRBR_STHR3_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR3_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR4_REG ================================================== */
-#define UART3_UART3_SRBR_STHR4_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR4_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR5_REG ================================================== */
-#define UART3_UART3_SRBR_STHR5_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR5_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR6_REG ================================================== */
-#define UART3_UART3_SRBR_STHR6_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR6_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR7_REG ================================================== */
-#define UART3_UART3_SRBR_STHR7_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR7_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR8_REG ================================================== */
-#define UART3_UART3_SRBR_STHR8_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR8_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ================================================= UART3_SRBR_STHR9_REG ================================================== */
-#define UART3_UART3_SRBR_STHR9_REG_SRBR_STHRx_Pos (0UL) /*!< SRBR_STHRx (Bit 0) */
-#define UART3_UART3_SRBR_STHR9_REG_SRBR_STHRx_Msk (0xffUL) /*!< SRBR_STHRx (Bitfield-Mask: 0xff) */
-/* ===================================================== UART3_SRR_REG ===================================================== */
-#define UART3_UART3_SRR_REG_UART_XFR_Pos (2UL) /*!< UART_XFR (Bit 2) */
-#define UART3_UART3_SRR_REG_UART_XFR_Msk (0x4UL) /*!< UART_XFR (Bitfield-Mask: 0x01) */
-#define UART3_UART3_SRR_REG_UART_RFR_Pos (1UL) /*!< UART_RFR (Bit 1) */
-#define UART3_UART3_SRR_REG_UART_RFR_Msk (0x2UL) /*!< UART_RFR (Bitfield-Mask: 0x01) */
-#define UART3_UART3_SRR_REG_UART_UR_Pos (0UL) /*!< UART_UR (Bit 0) */
-#define UART3_UART3_SRR_REG_UART_UR_Msk (0x1UL) /*!< UART_UR (Bitfield-Mask: 0x01) */
-/* ==================================================== UART3_SRTS_REG ===================================================== */
-#define UART3_UART3_SRTS_REG_UART_SHADOW_REQUEST_TO_SEND_Pos (0UL) /*!< UART_SHADOW_REQUEST_TO_SEND (Bit 0) */
-#define UART3_UART3_SRTS_REG_UART_SHADOW_REQUEST_TO_SEND_Msk (0x1UL) /*!< UART_SHADOW_REQUEST_TO_SEND (Bitfield-Mask: 0x01) */
-/* ===================================================== UART3_SRT_REG ===================================================== */
-#define UART3_UART3_SRT_REG_UART_SHADOW_RCVR_TRIGGER_Pos (0UL) /*!< UART_SHADOW_RCVR_TRIGGER (Bit 0) */
-#define UART3_UART3_SRT_REG_UART_SHADOW_RCVR_TRIGGER_Msk (0x3UL) /*!< UART_SHADOW_RCVR_TRIGGER (Bitfield-Mask: 0x03) */
-/* ==================================================== UART3_STET_REG ===================================================== */
-#define UART3_UART3_STET_REG_UART_SHADOW_TX_EMPTY_TRIGGER_Pos (0UL) /*!< UART_SHADOW_TX_EMPTY_TRIGGER (Bit 0) */
-#define UART3_UART3_STET_REG_UART_SHADOW_TX_EMPTY_TRIGGER_Msk (0x3UL) /*!< UART_SHADOW_TX_EMPTY_TRIGGER (Bitfield-Mask: 0x03) */
-/* ===================================================== UART3_TAR_REG ===================================================== */
-#define UART3_UART3_TAR_REG_UART_TAR_Pos (0UL) /*!< UART_TAR (Bit 0) */
-#define UART3_UART3_TAR_REG_UART_TAR_Msk (0xffUL) /*!< UART_TAR (Bitfield-Mask: 0xff) */
-/* ===================================================== UART3_TFL_REG ===================================================== */
-#define UART3_UART3_TFL_REG_UART_TRANSMIT_FIFO_LEVEL_Pos (0UL) /*!< UART_TRANSMIT_FIFO_LEVEL (Bit 0) */
-#define UART3_UART3_TFL_REG_UART_TRANSMIT_FIFO_LEVEL_Msk (0x1fUL) /*!< UART_TRANSMIT_FIFO_LEVEL (Bitfield-Mask: 0x1f) */
-/* ==================================================== UART3_TIMER_REG ==================================================== */
-#define UART3_UART3_TIMER_REG_ISO7816_TIM_MODE_Pos (17UL) /*!< ISO7816_TIM_MODE (Bit 17) */
-#define UART3_UART3_TIMER_REG_ISO7816_TIM_MODE_Msk (0x20000UL) /*!< ISO7816_TIM_MODE (Bitfield-Mask: 0x01) */
-#define UART3_UART3_TIMER_REG_ISO7816_TIM_EN_Pos (16UL) /*!< ISO7816_TIM_EN (Bit 16) */
-#define UART3_UART3_TIMER_REG_ISO7816_TIM_EN_Msk (0x10000UL) /*!< ISO7816_TIM_EN (Bitfield-Mask: 0x01) */
-#define UART3_UART3_TIMER_REG_ISO7816_TIM_MAX_Pos (0UL) /*!< ISO7816_TIM_MAX (Bit 0) */
-#define UART3_UART3_TIMER_REG_ISO7816_TIM_MAX_Msk (0xffffUL) /*!< ISO7816_TIM_MAX (Bitfield-Mask: 0xffff) */
-/* ===================================================== UART3_UCV_REG ===================================================== */
-#define UART3_UART3_UCV_REG_UART_UCV_Pos (0UL) /*!< UART_UCV (Bit 0) */
-#define UART3_UART3_UCV_REG_UART_UCV_Msk (0xffffffffUL) /*!< UART_UCV (Bitfield-Mask: 0xffffffff) */
-/* ===================================================== UART3_USR_REG ===================================================== */
-#define UART3_UART3_USR_REG_UART_RFF_Pos (4UL) /*!< UART_RFF (Bit 4) */
-#define UART3_UART3_USR_REG_UART_RFF_Msk (0x10UL) /*!< UART_RFF (Bitfield-Mask: 0x01) */
-#define UART3_UART3_USR_REG_UART_RFNE_Pos (3UL) /*!< UART_RFNE (Bit 3) */
-#define UART3_UART3_USR_REG_UART_RFNE_Msk (0x8UL) /*!< UART_RFNE (Bitfield-Mask: 0x01) */
-#define UART3_UART3_USR_REG_UART_TFE_Pos (2UL) /*!< UART_TFE (Bit 2) */
-#define UART3_UART3_USR_REG_UART_TFE_Msk (0x4UL) /*!< UART_TFE (Bitfield-Mask: 0x01) */
-#define UART3_UART3_USR_REG_UART_TFNF_Pos (1UL) /*!< UART_TFNF (Bit 1) */
-#define UART3_UART3_USR_REG_UART_TFNF_Msk (0x2UL) /*!< UART_TFNF (Bitfield-Mask: 0x01) */
-#define UART3_UART3_USR_REG_UART_BUSY_Pos (0UL) /*!< UART_BUSY (Bit 0) */
-#define UART3_UART3_USR_REG_UART_BUSY_Msk (0x1UL) /*!< UART_BUSY (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ USB ================ */
-/* =========================================================================================================================== */
-
-/* ===================================================== USB_ALTEV_REG ===================================================== */
-#define USB_USB_ALTEV_REG_USB_RESUME_Pos (7UL) /*!< USB_RESUME (Bit 7) */
-#define USB_USB_ALTEV_REG_USB_RESUME_Msk (0x80UL) /*!< USB_RESUME (Bitfield-Mask: 0x01) */
-#define USB_USB_ALTEV_REG_USB_RESET_Pos (6UL) /*!< USB_RESET (Bit 6) */
-#define USB_USB_ALTEV_REG_USB_RESET_Msk (0x40UL) /*!< USB_RESET (Bitfield-Mask: 0x01) */
-#define USB_USB_ALTEV_REG_USB_SD5_Pos (5UL) /*!< USB_SD5 (Bit 5) */
-#define USB_USB_ALTEV_REG_USB_SD5_Msk (0x20UL) /*!< USB_SD5 (Bitfield-Mask: 0x01) */
-#define USB_USB_ALTEV_REG_USB_SD3_Pos (4UL) /*!< USB_SD3 (Bit 4) */
-#define USB_USB_ALTEV_REG_USB_SD3_Msk (0x10UL) /*!< USB_SD3 (Bitfield-Mask: 0x01) */
-#define USB_USB_ALTEV_REG_USB_EOP_Pos (3UL) /*!< USB_EOP (Bit 3) */
-#define USB_USB_ALTEV_REG_USB_EOP_Msk (0x8UL) /*!< USB_EOP (Bitfield-Mask: 0x01) */
-/* ==================================================== USB_ALTMSK_REG ===================================================== */
-#define USB_USB_ALTMSK_REG_USB_M_RESUME_Pos (7UL) /*!< USB_M_RESUME (Bit 7) */
-#define USB_USB_ALTMSK_REG_USB_M_RESUME_Msk (0x80UL) /*!< USB_M_RESUME (Bitfield-Mask: 0x01) */
-#define USB_USB_ALTMSK_REG_USB_M_RESET_Pos (6UL) /*!< USB_M_RESET (Bit 6) */
-#define USB_USB_ALTMSK_REG_USB_M_RESET_Msk (0x40UL) /*!< USB_M_RESET (Bitfield-Mask: 0x01) */
-#define USB_USB_ALTMSK_REG_USB_M_SD5_Pos (5UL) /*!< USB_M_SD5 (Bit 5) */
-#define USB_USB_ALTMSK_REG_USB_M_SD5_Msk (0x20UL) /*!< USB_M_SD5 (Bitfield-Mask: 0x01) */
-#define USB_USB_ALTMSK_REG_USB_M_SD3_Pos (4UL) /*!< USB_M_SD3 (Bit 4) */
-#define USB_USB_ALTMSK_REG_USB_M_SD3_Msk (0x10UL) /*!< USB_M_SD3 (Bitfield-Mask: 0x01) */
-#define USB_USB_ALTMSK_REG_USB_M_EOP_Pos (3UL) /*!< USB_M_EOP (Bit 3) */
-#define USB_USB_ALTMSK_REG_USB_M_EOP_Msk (0x8UL) /*!< USB_M_EOP (Bitfield-Mask: 0x01) */
-/* ================================================= USB_CHARGER_CTRL_REG ================================================== */
-#define USB_USB_CHARGER_CTRL_REG_IDM_SINK_ON_Pos (5UL) /*!< IDM_SINK_ON (Bit 5) */
-#define USB_USB_CHARGER_CTRL_REG_IDM_SINK_ON_Msk (0x20UL) /*!< IDM_SINK_ON (Bitfield-Mask: 0x01) */
-#define USB_USB_CHARGER_CTRL_REG_IDP_SINK_ON_Pos (4UL) /*!< IDP_SINK_ON (Bit 4) */
-#define USB_USB_CHARGER_CTRL_REG_IDP_SINK_ON_Msk (0x10UL) /*!< IDP_SINK_ON (Bitfield-Mask: 0x01) */
-#define USB_USB_CHARGER_CTRL_REG_VDM_SRC_ON_Pos (3UL) /*!< VDM_SRC_ON (Bit 3) */
-#define USB_USB_CHARGER_CTRL_REG_VDM_SRC_ON_Msk (0x8UL) /*!< VDM_SRC_ON (Bitfield-Mask: 0x01) */
-#define USB_USB_CHARGER_CTRL_REG_VDP_SRC_ON_Pos (2UL) /*!< VDP_SRC_ON (Bit 2) */
-#define USB_USB_CHARGER_CTRL_REG_VDP_SRC_ON_Msk (0x4UL) /*!< VDP_SRC_ON (Bitfield-Mask: 0x01) */
-#define USB_USB_CHARGER_CTRL_REG_IDP_SRC_ON_Pos (1UL) /*!< IDP_SRC_ON (Bit 1) */
-#define USB_USB_CHARGER_CTRL_REG_IDP_SRC_ON_Msk (0x2UL) /*!< IDP_SRC_ON (Bitfield-Mask: 0x01) */
-#define USB_USB_CHARGER_CTRL_REG_USB_CHARGE_ON_Pos (0UL) /*!< USB_CHARGE_ON (Bit 0) */
-#define USB_USB_CHARGER_CTRL_REG_USB_CHARGE_ON_Msk (0x1UL) /*!< USB_CHARGE_ON (Bitfield-Mask: 0x01) */
-/* ================================================= USB_CHARGER_STAT_REG ================================================== */
-#define USB_USB_CHARGER_STAT_REG_USB_DM_VAL2_Pos (5UL) /*!< USB_DM_VAL2 (Bit 5) */
-#define USB_USB_CHARGER_STAT_REG_USB_DM_VAL2_Msk (0x20UL) /*!< USB_DM_VAL2 (Bitfield-Mask: 0x01) */
-#define USB_USB_CHARGER_STAT_REG_USB_DP_VAL2_Pos (4UL) /*!< USB_DP_VAL2 (Bit 4) */
-#define USB_USB_CHARGER_STAT_REG_USB_DP_VAL2_Msk (0x10UL) /*!< USB_DP_VAL2 (Bitfield-Mask: 0x01) */
-#define USB_USB_CHARGER_STAT_REG_USB_DM_VAL_Pos (3UL) /*!< USB_DM_VAL (Bit 3) */
-#define USB_USB_CHARGER_STAT_REG_USB_DM_VAL_Msk (0x8UL) /*!< USB_DM_VAL (Bitfield-Mask: 0x01) */
-#define USB_USB_CHARGER_STAT_REG_USB_DP_VAL_Pos (2UL) /*!< USB_DP_VAL (Bit 2) */
-#define USB_USB_CHARGER_STAT_REG_USB_DP_VAL_Msk (0x4UL) /*!< USB_DP_VAL (Bitfield-Mask: 0x01) */
-#define USB_USB_CHARGER_STAT_REG_USB_CHG_DET_Pos (1UL) /*!< USB_CHG_DET (Bit 1) */
-#define USB_USB_CHARGER_STAT_REG_USB_CHG_DET_Msk (0x2UL) /*!< USB_CHG_DET (Bitfield-Mask: 0x01) */
-#define USB_USB_CHARGER_STAT_REG_USB_DCP_DET_Pos (0UL) /*!< USB_DCP_DET (Bit 0) */
-#define USB_USB_CHARGER_STAT_REG_USB_DCP_DET_Msk (0x1UL) /*!< USB_DCP_DET (Bitfield-Mask: 0x01) */
-/* =================================================== USB_DMA_CTRL_REG ==================================================== */
-#define USB_USB_DMA_CTRL_REG_USB_DMA_EN_Pos (6UL) /*!< USB_DMA_EN (Bit 6) */
-#define USB_USB_DMA_CTRL_REG_USB_DMA_EN_Msk (0x40UL) /*!< USB_DMA_EN (Bitfield-Mask: 0x01) */
-#define USB_USB_DMA_CTRL_REG_USB_DMA_TX_Pos (3UL) /*!< USB_DMA_TX (Bit 3) */
-#define USB_USB_DMA_CTRL_REG_USB_DMA_TX_Msk (0x38UL) /*!< USB_DMA_TX (Bitfield-Mask: 0x07) */
-#define USB_USB_DMA_CTRL_REG_USB_DMA_RX_Pos (0UL) /*!< USB_DMA_RX (Bit 0) */
-#define USB_USB_DMA_CTRL_REG_USB_DMA_RX_Msk (0x7UL) /*!< USB_DMA_RX (Bitfield-Mask: 0x07) */
-/* ==================================================== USB_EP0_NAK_REG ==================================================== */
-#define USB_USB_EP0_NAK_REG_USB_EP0_OUTNAK_Pos (1UL) /*!< USB_EP0_OUTNAK (Bit 1) */
-#define USB_USB_EP0_NAK_REG_USB_EP0_OUTNAK_Msk (0x2UL) /*!< USB_EP0_OUTNAK (Bitfield-Mask: 0x01) */
-#define USB_USB_EP0_NAK_REG_USB_EP0_INNAK_Pos (0UL) /*!< USB_EP0_INNAK (Bit 0) */
-#define USB_USB_EP0_NAK_REG_USB_EP0_INNAK_Msk (0x1UL) /*!< USB_EP0_INNAK (Bitfield-Mask: 0x01) */
-/* ===================================================== USB_EPC0_REG ====================================================== */
-#define USB_USB_EPC0_REG_USB_STALL_Pos (7UL) /*!< USB_STALL (Bit 7) */
-#define USB_USB_EPC0_REG_USB_STALL_Msk (0x80UL) /*!< USB_STALL (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC0_REG_USB_DEF_Pos (6UL) /*!< USB_DEF (Bit 6) */
-#define USB_USB_EPC0_REG_USB_DEF_Msk (0x40UL) /*!< USB_DEF (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC0_REG_USB_EP_Pos (0UL) /*!< USB_EP (Bit 0) */
-#define USB_USB_EPC0_REG_USB_EP_Msk (0xfUL) /*!< USB_EP (Bitfield-Mask: 0x0f) */
-/* ===================================================== USB_EPC1_REG ====================================================== */
-#define USB_USB_EPC1_REG_USB_STALL_Pos (7UL) /*!< USB_STALL (Bit 7) */
-#define USB_USB_EPC1_REG_USB_STALL_Msk (0x80UL) /*!< USB_STALL (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC1_REG_USB_ISO_Pos (5UL) /*!< USB_ISO (Bit 5) */
-#define USB_USB_EPC1_REG_USB_ISO_Msk (0x20UL) /*!< USB_ISO (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC1_REG_USB_EP_EN_Pos (4UL) /*!< USB_EP_EN (Bit 4) */
-#define USB_USB_EPC1_REG_USB_EP_EN_Msk (0x10UL) /*!< USB_EP_EN (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC1_REG_USB_EP_Pos (0UL) /*!< USB_EP (Bit 0) */
-#define USB_USB_EPC1_REG_USB_EP_Msk (0xfUL) /*!< USB_EP (Bitfield-Mask: 0x0f) */
-/* ===================================================== USB_EPC2_REG ====================================================== */
-#define USB_USB_EPC2_REG_USB_STALL_Pos (7UL) /*!< USB_STALL (Bit 7) */
-#define USB_USB_EPC2_REG_USB_STALL_Msk (0x80UL) /*!< USB_STALL (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC2_REG_USB_ISO_Pos (5UL) /*!< USB_ISO (Bit 5) */
-#define USB_USB_EPC2_REG_USB_ISO_Msk (0x20UL) /*!< USB_ISO (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC2_REG_USB_EP_EN_Pos (4UL) /*!< USB_EP_EN (Bit 4) */
-#define USB_USB_EPC2_REG_USB_EP_EN_Msk (0x10UL) /*!< USB_EP_EN (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC2_REG_USB_EP_Pos (0UL) /*!< USB_EP (Bit 0) */
-#define USB_USB_EPC2_REG_USB_EP_Msk (0xfUL) /*!< USB_EP (Bitfield-Mask: 0x0f) */
-/* ===================================================== USB_EPC3_REG ====================================================== */
-#define USB_USB_EPC3_REG_USB_STALL_Pos (7UL) /*!< USB_STALL (Bit 7) */
-#define USB_USB_EPC3_REG_USB_STALL_Msk (0x80UL) /*!< USB_STALL (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC3_REG_USB_ISO_Pos (5UL) /*!< USB_ISO (Bit 5) */
-#define USB_USB_EPC3_REG_USB_ISO_Msk (0x20UL) /*!< USB_ISO (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC3_REG_USB_EP_EN_Pos (4UL) /*!< USB_EP_EN (Bit 4) */
-#define USB_USB_EPC3_REG_USB_EP_EN_Msk (0x10UL) /*!< USB_EP_EN (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC3_REG_USB_EP_Pos (0UL) /*!< USB_EP (Bit 0) */
-#define USB_USB_EPC3_REG_USB_EP_Msk (0xfUL) /*!< USB_EP (Bitfield-Mask: 0x0f) */
-/* ===================================================== USB_EPC4_REG ====================================================== */
-#define USB_USB_EPC4_REG_USB_STALL_Pos (7UL) /*!< USB_STALL (Bit 7) */
-#define USB_USB_EPC4_REG_USB_STALL_Msk (0x80UL) /*!< USB_STALL (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC4_REG_USB_ISO_Pos (5UL) /*!< USB_ISO (Bit 5) */
-#define USB_USB_EPC4_REG_USB_ISO_Msk (0x20UL) /*!< USB_ISO (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC4_REG_USB_EP_EN_Pos (4UL) /*!< USB_EP_EN (Bit 4) */
-#define USB_USB_EPC4_REG_USB_EP_EN_Msk (0x10UL) /*!< USB_EP_EN (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC4_REG_USB_EP_Pos (0UL) /*!< USB_EP (Bit 0) */
-#define USB_USB_EPC4_REG_USB_EP_Msk (0xfUL) /*!< USB_EP (Bitfield-Mask: 0x0f) */
-/* ===================================================== USB_EPC5_REG ====================================================== */
-#define USB_USB_EPC5_REG_USB_STALL_Pos (7UL) /*!< USB_STALL (Bit 7) */
-#define USB_USB_EPC5_REG_USB_STALL_Msk (0x80UL) /*!< USB_STALL (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC5_REG_USB_ISO_Pos (5UL) /*!< USB_ISO (Bit 5) */
-#define USB_USB_EPC5_REG_USB_ISO_Msk (0x20UL) /*!< USB_ISO (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC5_REG_USB_EP_EN_Pos (4UL) /*!< USB_EP_EN (Bit 4) */
-#define USB_USB_EPC5_REG_USB_EP_EN_Msk (0x10UL) /*!< USB_EP_EN (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC5_REG_USB_EP_Pos (0UL) /*!< USB_EP (Bit 0) */
-#define USB_USB_EPC5_REG_USB_EP_Msk (0xfUL) /*!< USB_EP (Bitfield-Mask: 0x0f) */
-/* ===================================================== USB_EPC6_REG ====================================================== */
-#define USB_USB_EPC6_REG_USB_STALL_Pos (7UL) /*!< USB_STALL (Bit 7) */
-#define USB_USB_EPC6_REG_USB_STALL_Msk (0x80UL) /*!< USB_STALL (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC6_REG_USB_ISO_Pos (5UL) /*!< USB_ISO (Bit 5) */
-#define USB_USB_EPC6_REG_USB_ISO_Msk (0x20UL) /*!< USB_ISO (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC6_REG_USB_EP_EN_Pos (4UL) /*!< USB_EP_EN (Bit 4) */
-#define USB_USB_EPC6_REG_USB_EP_EN_Msk (0x10UL) /*!< USB_EP_EN (Bitfield-Mask: 0x01) */
-#define USB_USB_EPC6_REG_USB_EP_Pos (0UL) /*!< USB_EP (Bit 0) */
-#define USB_USB_EPC6_REG_USB_EP_Msk (0xfUL) /*!< USB_EP (Bitfield-Mask: 0x0f) */
-/* ====================================================== USB_FAR_REG ====================================================== */
-#define USB_USB_FAR_REG_USB_AD_EN_Pos (7UL) /*!< USB_AD_EN (Bit 7) */
-#define USB_USB_FAR_REG_USB_AD_EN_Msk (0x80UL) /*!< USB_AD_EN (Bitfield-Mask: 0x01) */
-#define USB_USB_FAR_REG_USB_AD_Pos (0UL) /*!< USB_AD (Bit 0) */
-#define USB_USB_FAR_REG_USB_AD_Msk (0x7fUL) /*!< USB_AD (Bitfield-Mask: 0x7f) */
-/* ====================================================== USB_FNH_REG ====================================================== */
-#define USB_USB_FNH_REG_USB_MF_Pos (7UL) /*!< USB_MF (Bit 7) */
-#define USB_USB_FNH_REG_USB_MF_Msk (0x80UL) /*!< USB_MF (Bitfield-Mask: 0x01) */
-#define USB_USB_FNH_REG_USB_UL_Pos (6UL) /*!< USB_UL (Bit 6) */
-#define USB_USB_FNH_REG_USB_UL_Msk (0x40UL) /*!< USB_UL (Bitfield-Mask: 0x01) */
-#define USB_USB_FNH_REG_USB_RFC_Pos (5UL) /*!< USB_RFC (Bit 5) */
-#define USB_USB_FNH_REG_USB_RFC_Msk (0x20UL) /*!< USB_RFC (Bitfield-Mask: 0x01) */
-#define USB_USB_FNH_REG_USB_FN_10_8_Pos (0UL) /*!< USB_FN_10_8 (Bit 0) */
-#define USB_USB_FNH_REG_USB_FN_10_8_Msk (0x7UL) /*!< USB_FN_10_8 (Bitfield-Mask: 0x07) */
-/* ====================================================== USB_FNL_REG ====================================================== */
-#define USB_USB_FNL_REG_USB_FN_Pos (0UL) /*!< USB_FN (Bit 0) */
-#define USB_USB_FNL_REG_USB_FN_Msk (0xffUL) /*!< USB_FN (Bitfield-Mask: 0xff) */
-/* ===================================================== USB_FWEV_REG ====================================================== */
-#define USB_USB_FWEV_REG_USB_RXWARN31_Pos (4UL) /*!< USB_RXWARN31 (Bit 4) */
-#define USB_USB_FWEV_REG_USB_RXWARN31_Msk (0x70UL) /*!< USB_RXWARN31 (Bitfield-Mask: 0x07) */
-#define USB_USB_FWEV_REG_USB_TXWARN31_Pos (0UL) /*!< USB_TXWARN31 (Bit 0) */
-#define USB_USB_FWEV_REG_USB_TXWARN31_Msk (0x7UL) /*!< USB_TXWARN31 (Bitfield-Mask: 0x07) */
-/* ===================================================== USB_FWMSK_REG ===================================================== */
-#define USB_USB_FWMSK_REG_USB_M_RXWARN31_Pos (4UL) /*!< USB_M_RXWARN31 (Bit 4) */
-#define USB_USB_FWMSK_REG_USB_M_RXWARN31_Msk (0x70UL) /*!< USB_M_RXWARN31 (Bitfield-Mask: 0x07) */
-#define USB_USB_FWMSK_REG_USB_M_TXWARN31_Pos (0UL) /*!< USB_M_TXWARN31 (Bit 0) */
-#define USB_USB_FWMSK_REG_USB_M_TXWARN31_Msk (0x7UL) /*!< USB_M_TXWARN31 (Bitfield-Mask: 0x07) */
-/* ===================================================== USB_MAEV_REG ====================================================== */
-#define USB_USB_MAEV_REG_USB_CH_EV_Pos (11UL) /*!< USB_CH_EV (Bit 11) */
-#define USB_USB_MAEV_REG_USB_CH_EV_Msk (0x800UL) /*!< USB_CH_EV (Bitfield-Mask: 0x01) */
-#define USB_USB_MAEV_REG_USB_EP0_NAK_Pos (10UL) /*!< USB_EP0_NAK (Bit 10) */
-#define USB_USB_MAEV_REG_USB_EP0_NAK_Msk (0x400UL) /*!< USB_EP0_NAK (Bitfield-Mask: 0x01) */
-#define USB_USB_MAEV_REG_USB_EP0_RX_Pos (9UL) /*!< USB_EP0_RX (Bit 9) */
-#define USB_USB_MAEV_REG_USB_EP0_RX_Msk (0x200UL) /*!< USB_EP0_RX (Bitfield-Mask: 0x01) */
-#define USB_USB_MAEV_REG_USB_EP0_TX_Pos (8UL) /*!< USB_EP0_TX (Bit 8) */
-#define USB_USB_MAEV_REG_USB_EP0_TX_Msk (0x100UL) /*!< USB_EP0_TX (Bitfield-Mask: 0x01) */
-#define USB_USB_MAEV_REG_USB_INTR_Pos (7UL) /*!< USB_INTR (Bit 7) */
-#define USB_USB_MAEV_REG_USB_INTR_Msk (0x80UL) /*!< USB_INTR (Bitfield-Mask: 0x01) */
-#define USB_USB_MAEV_REG_USB_RX_EV_Pos (6UL) /*!< USB_RX_EV (Bit 6) */
-#define USB_USB_MAEV_REG_USB_RX_EV_Msk (0x40UL) /*!< USB_RX_EV (Bitfield-Mask: 0x01) */
-#define USB_USB_MAEV_REG_USB_ULD_Pos (5UL) /*!< USB_ULD (Bit 5) */
-#define USB_USB_MAEV_REG_USB_ULD_Msk (0x20UL) /*!< USB_ULD (Bitfield-Mask: 0x01) */
-#define USB_USB_MAEV_REG_USB_NAK_Pos (4UL) /*!< USB_NAK (Bit 4) */
-#define USB_USB_MAEV_REG_USB_NAK_Msk (0x10UL) /*!< USB_NAK (Bitfield-Mask: 0x01) */
-#define USB_USB_MAEV_REG_USB_FRAME_Pos (3UL) /*!< USB_FRAME (Bit 3) */
-#define USB_USB_MAEV_REG_USB_FRAME_Msk (0x8UL) /*!< USB_FRAME (Bitfield-Mask: 0x01) */
-#define USB_USB_MAEV_REG_USB_TX_EV_Pos (2UL) /*!< USB_TX_EV (Bit 2) */
-#define USB_USB_MAEV_REG_USB_TX_EV_Msk (0x4UL) /*!< USB_TX_EV (Bitfield-Mask: 0x01) */
-#define USB_USB_MAEV_REG_USB_ALT_Pos (1UL) /*!< USB_ALT (Bit 1) */
-#define USB_USB_MAEV_REG_USB_ALT_Msk (0x2UL) /*!< USB_ALT (Bitfield-Mask: 0x01) */
-#define USB_USB_MAEV_REG_USB_WARN_Pos (0UL) /*!< USB_WARN (Bit 0) */
-#define USB_USB_MAEV_REG_USB_WARN_Msk (0x1UL) /*!< USB_WARN (Bitfield-Mask: 0x01) */
-/* ===================================================== USB_MAMSK_REG ===================================================== */
-#define USB_USB_MAMSK_REG_USB_M_CH_EV_Pos (11UL) /*!< USB_M_CH_EV (Bit 11) */
-#define USB_USB_MAMSK_REG_USB_M_CH_EV_Msk (0x800UL) /*!< USB_M_CH_EV (Bitfield-Mask: 0x01) */
-#define USB_USB_MAMSK_REG_USB_M_EP0_NAK_Pos (10UL) /*!< USB_M_EP0_NAK (Bit 10) */
-#define USB_USB_MAMSK_REG_USB_M_EP0_NAK_Msk (0x400UL) /*!< USB_M_EP0_NAK (Bitfield-Mask: 0x01) */
-#define USB_USB_MAMSK_REG_USB_M_EP0_RX_Pos (9UL) /*!< USB_M_EP0_RX (Bit 9) */
-#define USB_USB_MAMSK_REG_USB_M_EP0_RX_Msk (0x200UL) /*!< USB_M_EP0_RX (Bitfield-Mask: 0x01) */
-#define USB_USB_MAMSK_REG_USB_M_EP0_TX_Pos (8UL) /*!< USB_M_EP0_TX (Bit 8) */
-#define USB_USB_MAMSK_REG_USB_M_EP0_TX_Msk (0x100UL) /*!< USB_M_EP0_TX (Bitfield-Mask: 0x01) */
-#define USB_USB_MAMSK_REG_USB_M_INTR_Pos (7UL) /*!< USB_M_INTR (Bit 7) */
-#define USB_USB_MAMSK_REG_USB_M_INTR_Msk (0x80UL) /*!< USB_M_INTR (Bitfield-Mask: 0x01) */
-#define USB_USB_MAMSK_REG_USB_M_RX_EV_Pos (6UL) /*!< USB_M_RX_EV (Bit 6) */
-#define USB_USB_MAMSK_REG_USB_M_RX_EV_Msk (0x40UL) /*!< USB_M_RX_EV (Bitfield-Mask: 0x01) */
-#define USB_USB_MAMSK_REG_USB_M_ULD_Pos (5UL) /*!< USB_M_ULD (Bit 5) */
-#define USB_USB_MAMSK_REG_USB_M_ULD_Msk (0x20UL) /*!< USB_M_ULD (Bitfield-Mask: 0x01) */
-#define USB_USB_MAMSK_REG_USB_M_NAK_Pos (4UL) /*!< USB_M_NAK (Bit 4) */
-#define USB_USB_MAMSK_REG_USB_M_NAK_Msk (0x10UL) /*!< USB_M_NAK (Bitfield-Mask: 0x01) */
-#define USB_USB_MAMSK_REG_USB_M_FRAME_Pos (3UL) /*!< USB_M_FRAME (Bit 3) */
-#define USB_USB_MAMSK_REG_USB_M_FRAME_Msk (0x8UL) /*!< USB_M_FRAME (Bitfield-Mask: 0x01) */
-#define USB_USB_MAMSK_REG_USB_M_TX_EV_Pos (2UL) /*!< USB_M_TX_EV (Bit 2) */
-#define USB_USB_MAMSK_REG_USB_M_TX_EV_Msk (0x4UL) /*!< USB_M_TX_EV (Bitfield-Mask: 0x01) */
-#define USB_USB_MAMSK_REG_USB_M_ALT_Pos (1UL) /*!< USB_M_ALT (Bit 1) */
-#define USB_USB_MAMSK_REG_USB_M_ALT_Msk (0x2UL) /*!< USB_M_ALT (Bitfield-Mask: 0x01) */
-#define USB_USB_MAMSK_REG_USB_M_WARN_Pos (0UL) /*!< USB_M_WARN (Bit 0) */
-#define USB_USB_MAMSK_REG_USB_M_WARN_Msk (0x1UL) /*!< USB_M_WARN (Bitfield-Mask: 0x01) */
-/* ===================================================== USB_MCTRL_REG ===================================================== */
-#define USB_USB_MCTRL_REG_LSMODE_Pos (4UL) /*!< LSMODE (Bit 4) */
-#define USB_USB_MCTRL_REG_LSMODE_Msk (0x10UL) /*!< LSMODE (Bitfield-Mask: 0x01) */
-#define USB_USB_MCTRL_REG_USB_NAT_Pos (3UL) /*!< USB_NAT (Bit 3) */
-#define USB_USB_MCTRL_REG_USB_NAT_Msk (0x8UL) /*!< USB_NAT (Bitfield-Mask: 0x01) */
-#define USB_USB_MCTRL_REG_USB_DBG_Pos (1UL) /*!< USB_DBG (Bit 1) */
-#define USB_USB_MCTRL_REG_USB_DBG_Msk (0x2UL) /*!< USB_DBG (Bitfield-Mask: 0x01) */
-#define USB_USB_MCTRL_REG_USBEN_Pos (0UL) /*!< USBEN (Bit 0) */
-#define USB_USB_MCTRL_REG_USBEN_Msk (0x1UL) /*!< USBEN (Bitfield-Mask: 0x01) */
-/* ===================================================== USB_NAKEV_REG ===================================================== */
-#define USB_USB_NAKEV_REG_USB_OUT31_Pos (4UL) /*!< USB_OUT31 (Bit 4) */
-#define USB_USB_NAKEV_REG_USB_OUT31_Msk (0x70UL) /*!< USB_OUT31 (Bitfield-Mask: 0x07) */
-#define USB_USB_NAKEV_REG_USB_IN31_Pos (0UL) /*!< USB_IN31 (Bit 0) */
-#define USB_USB_NAKEV_REG_USB_IN31_Msk (0x7UL) /*!< USB_IN31 (Bitfield-Mask: 0x07) */
-/* ==================================================== USB_NAKMSK_REG ===================================================== */
-#define USB_USB_NAKMSK_REG_USB_M_OUT31_Pos (4UL) /*!< USB_M_OUT31 (Bit 4) */
-#define USB_USB_NAKMSK_REG_USB_M_OUT31_Msk (0x70UL) /*!< USB_M_OUT31 (Bitfield-Mask: 0x07) */
-#define USB_USB_NAKMSK_REG_USB_M_IN31_Pos (0UL) /*!< USB_M_IN31 (Bit 0) */
-#define USB_USB_NAKMSK_REG_USB_M_IN31_Msk (0x7UL) /*!< USB_M_IN31 (Bitfield-Mask: 0x07) */
-/* ===================================================== USB_NFSR_REG ====================================================== */
-#define USB_USB_NFSR_REG_USB_NFS_Pos (0UL) /*!< USB_NFS (Bit 0) */
-#define USB_USB_NFSR_REG_USB_NFS_Msk (0x3UL) /*!< USB_NFS (Bitfield-Mask: 0x03) */
-/* ===================================================== USB_RXC0_REG ====================================================== */
-#define USB_USB_RXC0_REG_USB_FLUSH_Pos (3UL) /*!< USB_FLUSH (Bit 3) */
-#define USB_USB_RXC0_REG_USB_FLUSH_Msk (0x8UL) /*!< USB_FLUSH (Bitfield-Mask: 0x01) */
-#define USB_USB_RXC0_REG_USB_IGN_SETUP_Pos (2UL) /*!< USB_IGN_SETUP (Bit 2) */
-#define USB_USB_RXC0_REG_USB_IGN_SETUP_Msk (0x4UL) /*!< USB_IGN_SETUP (Bitfield-Mask: 0x01) */
-#define USB_USB_RXC0_REG_USB_IGN_OUT_Pos (1UL) /*!< USB_IGN_OUT (Bit 1) */
-#define USB_USB_RXC0_REG_USB_IGN_OUT_Msk (0x2UL) /*!< USB_IGN_OUT (Bitfield-Mask: 0x01) */
-#define USB_USB_RXC0_REG_USB_RX_EN_Pos (0UL) /*!< USB_RX_EN (Bit 0) */
-#define USB_USB_RXC0_REG_USB_RX_EN_Msk (0x1UL) /*!< USB_RX_EN (Bitfield-Mask: 0x01) */
-/* ===================================================== USB_RXC1_REG ====================================================== */
-#define USB_USB_RXC1_REG_USB_RFWL_Pos (5UL) /*!< USB_RFWL (Bit 5) */
-#define USB_USB_RXC1_REG_USB_RFWL_Msk (0x60UL) /*!< USB_RFWL (Bitfield-Mask: 0x03) */
-#define USB_USB_RXC1_REG_USB_FLUSH_Pos (3UL) /*!< USB_FLUSH (Bit 3) */
-#define USB_USB_RXC1_REG_USB_FLUSH_Msk (0x8UL) /*!< USB_FLUSH (Bitfield-Mask: 0x01) */
-#define USB_USB_RXC1_REG_USB_IGN_SETUP_Pos (2UL) /*!< USB_IGN_SETUP (Bit 2) */
-#define USB_USB_RXC1_REG_USB_IGN_SETUP_Msk (0x4UL) /*!< USB_IGN_SETUP (Bitfield-Mask: 0x01) */
-#define USB_USB_RXC1_REG_USB_RX_EN_Pos (0UL) /*!< USB_RX_EN (Bit 0) */
-#define USB_USB_RXC1_REG_USB_RX_EN_Msk (0x1UL) /*!< USB_RX_EN (Bitfield-Mask: 0x01) */
-/* ===================================================== USB_RXC2_REG ====================================================== */
-#define USB_USB_RXC2_REG_USB_RFWL_Pos (5UL) /*!< USB_RFWL (Bit 5) */
-#define USB_USB_RXC2_REG_USB_RFWL_Msk (0x60UL) /*!< USB_RFWL (Bitfield-Mask: 0x03) */
-#define USB_USB_RXC2_REG_USB_FLUSH_Pos (3UL) /*!< USB_FLUSH (Bit 3) */
-#define USB_USB_RXC2_REG_USB_FLUSH_Msk (0x8UL) /*!< USB_FLUSH (Bitfield-Mask: 0x01) */
-#define USB_USB_RXC2_REG_USB_IGN_SETUP_Pos (2UL) /*!< USB_IGN_SETUP (Bit 2) */
-#define USB_USB_RXC2_REG_USB_IGN_SETUP_Msk (0x4UL) /*!< USB_IGN_SETUP (Bitfield-Mask: 0x01) */
-#define USB_USB_RXC2_REG_USB_RX_EN_Pos (0UL) /*!< USB_RX_EN (Bit 0) */
-#define USB_USB_RXC2_REG_USB_RX_EN_Msk (0x1UL) /*!< USB_RX_EN (Bitfield-Mask: 0x01) */
-/* ===================================================== USB_RXC3_REG ====================================================== */
-#define USB_USB_RXC3_REG_USB_RFWL_Pos (5UL) /*!< USB_RFWL (Bit 5) */
-#define USB_USB_RXC3_REG_USB_RFWL_Msk (0x60UL) /*!< USB_RFWL (Bitfield-Mask: 0x03) */
-#define USB_USB_RXC3_REG_USB_FLUSH_Pos (3UL) /*!< USB_FLUSH (Bit 3) */
-#define USB_USB_RXC3_REG_USB_FLUSH_Msk (0x8UL) /*!< USB_FLUSH (Bitfield-Mask: 0x01) */
-#define USB_USB_RXC3_REG_USB_IGN_SETUP_Pos (2UL) /*!< USB_IGN_SETUP (Bit 2) */
-#define USB_USB_RXC3_REG_USB_IGN_SETUP_Msk (0x4UL) /*!< USB_IGN_SETUP (Bitfield-Mask: 0x01) */
-#define USB_USB_RXC3_REG_USB_RX_EN_Pos (0UL) /*!< USB_RX_EN (Bit 0) */
-#define USB_USB_RXC3_REG_USB_RX_EN_Msk (0x1UL) /*!< USB_RX_EN (Bitfield-Mask: 0x01) */
-/* ===================================================== USB_RXD0_REG ====================================================== */
-#define USB_USB_RXD0_REG_USB_RXFD_Pos (0UL) /*!< USB_RXFD (Bit 0) */
-#define USB_USB_RXD0_REG_USB_RXFD_Msk (0xffUL) /*!< USB_RXFD (Bitfield-Mask: 0xff) */
-/* ===================================================== USB_RXD1_REG ====================================================== */
-#define USB_USB_RXD1_REG_USB_RXFD_Pos (0UL) /*!< USB_RXFD (Bit 0) */
-#define USB_USB_RXD1_REG_USB_RXFD_Msk (0xffUL) /*!< USB_RXFD (Bitfield-Mask: 0xff) */
-/* ===================================================== USB_RXD2_REG ====================================================== */
-#define USB_USB_RXD2_REG_USB_RXFD_Pos (0UL) /*!< USB_RXFD (Bit 0) */
-#define USB_USB_RXD2_REG_USB_RXFD_Msk (0xffUL) /*!< USB_RXFD (Bitfield-Mask: 0xff) */
-/* ===================================================== USB_RXD3_REG ====================================================== */
-#define USB_USB_RXD3_REG_USB_RXFD_Pos (0UL) /*!< USB_RXFD (Bit 0) */
-#define USB_USB_RXD3_REG_USB_RXFD_Msk (0xffUL) /*!< USB_RXFD (Bitfield-Mask: 0xff) */
-/* ===================================================== USB_RXEV_REG ====================================================== */
-#define USB_USB_RXEV_REG_USB_RXOVRRN31_Pos (4UL) /*!< USB_RXOVRRN31 (Bit 4) */
-#define USB_USB_RXEV_REG_USB_RXOVRRN31_Msk (0x70UL) /*!< USB_RXOVRRN31 (Bitfield-Mask: 0x07) */
-#define USB_USB_RXEV_REG_USB_RXFIFO31_Pos (0UL) /*!< USB_RXFIFO31 (Bit 0) */
-#define USB_USB_RXEV_REG_USB_RXFIFO31_Msk (0x7UL) /*!< USB_RXFIFO31 (Bitfield-Mask: 0x07) */
-/* ===================================================== USB_RXMSK_REG ===================================================== */
-#define USB_USB_RXMSK_REG_USB_M_RXOVRRN31_Pos (4UL) /*!< USB_M_RXOVRRN31 (Bit 4) */
-#define USB_USB_RXMSK_REG_USB_M_RXOVRRN31_Msk (0x70UL) /*!< USB_M_RXOVRRN31 (Bitfield-Mask: 0x07) */
-#define USB_USB_RXMSK_REG_USB_M_RXFIFO31_Pos (0UL) /*!< USB_M_RXFIFO31 (Bit 0) */
-#define USB_USB_RXMSK_REG_USB_M_RXFIFO31_Msk (0x7UL) /*!< USB_M_RXFIFO31 (Bitfield-Mask: 0x07) */
-/* ===================================================== USB_RXS0_REG ====================================================== */
-#define USB_USB_RXS0_REG_USB_SETUP_Pos (6UL) /*!< USB_SETUP (Bit 6) */
-#define USB_USB_RXS0_REG_USB_SETUP_Msk (0x40UL) /*!< USB_SETUP (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS0_REG_USB_TOGGLE_RX0_Pos (5UL) /*!< USB_TOGGLE_RX0 (Bit 5) */
-#define USB_USB_RXS0_REG_USB_TOGGLE_RX0_Msk (0x20UL) /*!< USB_TOGGLE_RX0 (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS0_REG_USB_RX_LAST_Pos (4UL) /*!< USB_RX_LAST (Bit 4) */
-#define USB_USB_RXS0_REG_USB_RX_LAST_Msk (0x10UL) /*!< USB_RX_LAST (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS0_REG_USB_RCOUNT_Pos (0UL) /*!< USB_RCOUNT (Bit 0) */
-#define USB_USB_RXS0_REG_USB_RCOUNT_Msk (0xfUL) /*!< USB_RCOUNT (Bitfield-Mask: 0x0f) */
-/* ===================================================== USB_RXS1_REG ====================================================== */
-#define USB_USB_RXS1_REG_USB_RXCOUNT_Pos (8UL) /*!< USB_RXCOUNT (Bit 8) */
-#define USB_USB_RXS1_REG_USB_RXCOUNT_Msk (0x7f00UL) /*!< USB_RXCOUNT (Bitfield-Mask: 0x7f) */
-#define USB_USB_RXS1_REG_USB_RX_ERR_Pos (7UL) /*!< USB_RX_ERR (Bit 7) */
-#define USB_USB_RXS1_REG_USB_RX_ERR_Msk (0x80UL) /*!< USB_RX_ERR (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS1_REG_USB_SETUP_Pos (6UL) /*!< USB_SETUP (Bit 6) */
-#define USB_USB_RXS1_REG_USB_SETUP_Msk (0x40UL) /*!< USB_SETUP (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS1_REG_USB_TOGGLE_RX_Pos (5UL) /*!< USB_TOGGLE_RX (Bit 5) */
-#define USB_USB_RXS1_REG_USB_TOGGLE_RX_Msk (0x20UL) /*!< USB_TOGGLE_RX (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS1_REG_USB_RX_LAST_Pos (4UL) /*!< USB_RX_LAST (Bit 4) */
-#define USB_USB_RXS1_REG_USB_RX_LAST_Msk (0x10UL) /*!< USB_RX_LAST (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS1_REG_USB_RCOUNT_Pos (0UL) /*!< USB_RCOUNT (Bit 0) */
-#define USB_USB_RXS1_REG_USB_RCOUNT_Msk (0xfUL) /*!< USB_RCOUNT (Bitfield-Mask: 0x0f) */
-/* ===================================================== USB_RXS2_REG ====================================================== */
-#define USB_USB_RXS2_REG_USB_RXCOUNT_Pos (8UL) /*!< USB_RXCOUNT (Bit 8) */
-#define USB_USB_RXS2_REG_USB_RXCOUNT_Msk (0x7f00UL) /*!< USB_RXCOUNT (Bitfield-Mask: 0x7f) */
-#define USB_USB_RXS2_REG_USB_RX_ERR_Pos (7UL) /*!< USB_RX_ERR (Bit 7) */
-#define USB_USB_RXS2_REG_USB_RX_ERR_Msk (0x80UL) /*!< USB_RX_ERR (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS2_REG_USB_SETUP_Pos (6UL) /*!< USB_SETUP (Bit 6) */
-#define USB_USB_RXS2_REG_USB_SETUP_Msk (0x40UL) /*!< USB_SETUP (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS2_REG_USB_TOGGLE_RX_Pos (5UL) /*!< USB_TOGGLE_RX (Bit 5) */
-#define USB_USB_RXS2_REG_USB_TOGGLE_RX_Msk (0x20UL) /*!< USB_TOGGLE_RX (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS2_REG_USB_RX_LAST_Pos (4UL) /*!< USB_RX_LAST (Bit 4) */
-#define USB_USB_RXS2_REG_USB_RX_LAST_Msk (0x10UL) /*!< USB_RX_LAST (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS2_REG_USB_RCOUNT_Pos (0UL) /*!< USB_RCOUNT (Bit 0) */
-#define USB_USB_RXS2_REG_USB_RCOUNT_Msk (0xfUL) /*!< USB_RCOUNT (Bitfield-Mask: 0x0f) */
-/* ===================================================== USB_RXS3_REG ====================================================== */
-#define USB_USB_RXS3_REG_USB_RXCOUNT_Pos (8UL) /*!< USB_RXCOUNT (Bit 8) */
-#define USB_USB_RXS3_REG_USB_RXCOUNT_Msk (0x7f00UL) /*!< USB_RXCOUNT (Bitfield-Mask: 0x7f) */
-#define USB_USB_RXS3_REG_USB_RX_ERR_Pos (7UL) /*!< USB_RX_ERR (Bit 7) */
-#define USB_USB_RXS3_REG_USB_RX_ERR_Msk (0x80UL) /*!< USB_RX_ERR (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS3_REG_USB_SETUP_Pos (6UL) /*!< USB_SETUP (Bit 6) */
-#define USB_USB_RXS3_REG_USB_SETUP_Msk (0x40UL) /*!< USB_SETUP (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS3_REG_USB_TOGGLE_RX_Pos (5UL) /*!< USB_TOGGLE_RX (Bit 5) */
-#define USB_USB_RXS3_REG_USB_TOGGLE_RX_Msk (0x20UL) /*!< USB_TOGGLE_RX (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS3_REG_USB_RX_LAST_Pos (4UL) /*!< USB_RX_LAST (Bit 4) */
-#define USB_USB_RXS3_REG_USB_RX_LAST_Msk (0x10UL) /*!< USB_RX_LAST (Bitfield-Mask: 0x01) */
-#define USB_USB_RXS3_REG_USB_RCOUNT_Pos (0UL) /*!< USB_RCOUNT (Bit 0) */
-#define USB_USB_RXS3_REG_USB_RCOUNT_Msk (0xfUL) /*!< USB_RCOUNT (Bitfield-Mask: 0x0f) */
-/* ====================================================== USB_TCR_REG ====================================================== */
-#define USB_USB_TCR_REG_USB_VADJ_Pos (5UL) /*!< USB_VADJ (Bit 5) */
-#define USB_USB_TCR_REG_USB_VADJ_Msk (0xe0UL) /*!< USB_VADJ (Bitfield-Mask: 0x07) */
-#define USB_USB_TCR_REG_USB_CADJ_Pos (0UL) /*!< USB_CADJ (Bit 0) */
-#define USB_USB_TCR_REG_USB_CADJ_Msk (0x1fUL) /*!< USB_CADJ (Bitfield-Mask: 0x1f) */
-/* ===================================================== USB_TXC0_REG ====================================================== */
-#define USB_USB_TXC0_REG_USB_IGN_IN_Pos (4UL) /*!< USB_IGN_IN (Bit 4) */
-#define USB_USB_TXC0_REG_USB_IGN_IN_Msk (0x10UL) /*!< USB_IGN_IN (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC0_REG_USB_FLUSH_Pos (3UL) /*!< USB_FLUSH (Bit 3) */
-#define USB_USB_TXC0_REG_USB_FLUSH_Msk (0x8UL) /*!< USB_FLUSH (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC0_REG_USB_TOGGLE_TX0_Pos (2UL) /*!< USB_TOGGLE_TX0 (Bit 2) */
-#define USB_USB_TXC0_REG_USB_TOGGLE_TX0_Msk (0x4UL) /*!< USB_TOGGLE_TX0 (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC0_REG_USB_TX_EN_Pos (0UL) /*!< USB_TX_EN (Bit 0) */
-#define USB_USB_TXC0_REG_USB_TX_EN_Msk (0x1UL) /*!< USB_TX_EN (Bitfield-Mask: 0x01) */
-/* ===================================================== USB_TXC1_REG ====================================================== */
-#define USB_USB_TXC1_REG_USB_IGN_ISOMSK_Pos (7UL) /*!< USB_IGN_ISOMSK (Bit 7) */
-#define USB_USB_TXC1_REG_USB_IGN_ISOMSK_Msk (0x80UL) /*!< USB_IGN_ISOMSK (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC1_REG_USB_TFWL_Pos (5UL) /*!< USB_TFWL (Bit 5) */
-#define USB_USB_TXC1_REG_USB_TFWL_Msk (0x60UL) /*!< USB_TFWL (Bitfield-Mask: 0x03) */
-#define USB_USB_TXC1_REG_USB_RFF_Pos (4UL) /*!< USB_RFF (Bit 4) */
-#define USB_USB_TXC1_REG_USB_RFF_Msk (0x10UL) /*!< USB_RFF (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC1_REG_USB_FLUSH_Pos (3UL) /*!< USB_FLUSH (Bit 3) */
-#define USB_USB_TXC1_REG_USB_FLUSH_Msk (0x8UL) /*!< USB_FLUSH (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC1_REG_USB_TOGGLE_TX_Pos (2UL) /*!< USB_TOGGLE_TX (Bit 2) */
-#define USB_USB_TXC1_REG_USB_TOGGLE_TX_Msk (0x4UL) /*!< USB_TOGGLE_TX (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC1_REG_USB_LAST_Pos (1UL) /*!< USB_LAST (Bit 1) */
-#define USB_USB_TXC1_REG_USB_LAST_Msk (0x2UL) /*!< USB_LAST (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC1_REG_USB_TX_EN_Pos (0UL) /*!< USB_TX_EN (Bit 0) */
-#define USB_USB_TXC1_REG_USB_TX_EN_Msk (0x1UL) /*!< USB_TX_EN (Bitfield-Mask: 0x01) */
-/* ===================================================== USB_TXC2_REG ====================================================== */
-#define USB_USB_TXC2_REG_USB_IGN_ISOMSK_Pos (7UL) /*!< USB_IGN_ISOMSK (Bit 7) */
-#define USB_USB_TXC2_REG_USB_IGN_ISOMSK_Msk (0x80UL) /*!< USB_IGN_ISOMSK (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC2_REG_USB_TFWL_Pos (5UL) /*!< USB_TFWL (Bit 5) */
-#define USB_USB_TXC2_REG_USB_TFWL_Msk (0x60UL) /*!< USB_TFWL (Bitfield-Mask: 0x03) */
-#define USB_USB_TXC2_REG_USB_RFF_Pos (4UL) /*!< USB_RFF (Bit 4) */
-#define USB_USB_TXC2_REG_USB_RFF_Msk (0x10UL) /*!< USB_RFF (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC2_REG_USB_FLUSH_Pos (3UL) /*!< USB_FLUSH (Bit 3) */
-#define USB_USB_TXC2_REG_USB_FLUSH_Msk (0x8UL) /*!< USB_FLUSH (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC2_REG_USB_TOGGLE_TX_Pos (2UL) /*!< USB_TOGGLE_TX (Bit 2) */
-#define USB_USB_TXC2_REG_USB_TOGGLE_TX_Msk (0x4UL) /*!< USB_TOGGLE_TX (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC2_REG_USB_LAST_Pos (1UL) /*!< USB_LAST (Bit 1) */
-#define USB_USB_TXC2_REG_USB_LAST_Msk (0x2UL) /*!< USB_LAST (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC2_REG_USB_TX_EN_Pos (0UL) /*!< USB_TX_EN (Bit 0) */
-#define USB_USB_TXC2_REG_USB_TX_EN_Msk (0x1UL) /*!< USB_TX_EN (Bitfield-Mask: 0x01) */
-/* ===================================================== USB_TXC3_REG ====================================================== */
-#define USB_USB_TXC3_REG_USB_IGN_ISOMSK_Pos (7UL) /*!< USB_IGN_ISOMSK (Bit 7) */
-#define USB_USB_TXC3_REG_USB_IGN_ISOMSK_Msk (0x80UL) /*!< USB_IGN_ISOMSK (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC3_REG_USB_TFWL_Pos (5UL) /*!< USB_TFWL (Bit 5) */
-#define USB_USB_TXC3_REG_USB_TFWL_Msk (0x60UL) /*!< USB_TFWL (Bitfield-Mask: 0x03) */
-#define USB_USB_TXC3_REG_USB_RFF_Pos (4UL) /*!< USB_RFF (Bit 4) */
-#define USB_USB_TXC3_REG_USB_RFF_Msk (0x10UL) /*!< USB_RFF (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC3_REG_USB_FLUSH_Pos (3UL) /*!< USB_FLUSH (Bit 3) */
-#define USB_USB_TXC3_REG_USB_FLUSH_Msk (0x8UL) /*!< USB_FLUSH (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC3_REG_USB_TOGGLE_TX_Pos (2UL) /*!< USB_TOGGLE_TX (Bit 2) */
-#define USB_USB_TXC3_REG_USB_TOGGLE_TX_Msk (0x4UL) /*!< USB_TOGGLE_TX (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC3_REG_USB_LAST_Pos (1UL) /*!< USB_LAST (Bit 1) */
-#define USB_USB_TXC3_REG_USB_LAST_Msk (0x2UL) /*!< USB_LAST (Bitfield-Mask: 0x01) */
-#define USB_USB_TXC3_REG_USB_TX_EN_Pos (0UL) /*!< USB_TX_EN (Bit 0) */
-#define USB_USB_TXC3_REG_USB_TX_EN_Msk (0x1UL) /*!< USB_TX_EN (Bitfield-Mask: 0x01) */
-/* ===================================================== USB_TXD0_REG ====================================================== */
-#define USB_USB_TXD0_REG_USB_TXFD_Pos (0UL) /*!< USB_TXFD (Bit 0) */
-#define USB_USB_TXD0_REG_USB_TXFD_Msk (0xffUL) /*!< USB_TXFD (Bitfield-Mask: 0xff) */
-/* ===================================================== USB_TXD1_REG ====================================================== */
-#define USB_USB_TXD1_REG_USB_TXFD_Pos (0UL) /*!< USB_TXFD (Bit 0) */
-#define USB_USB_TXD1_REG_USB_TXFD_Msk (0xffUL) /*!< USB_TXFD (Bitfield-Mask: 0xff) */
-/* ===================================================== USB_TXD2_REG ====================================================== */
-#define USB_USB_TXD2_REG_USB_TXFD_Pos (0UL) /*!< USB_TXFD (Bit 0) */
-#define USB_USB_TXD2_REG_USB_TXFD_Msk (0xffUL) /*!< USB_TXFD (Bitfield-Mask: 0xff) */
-/* ===================================================== USB_TXD3_REG ====================================================== */
-#define USB_USB_TXD3_REG_USB_TXFD_Pos (0UL) /*!< USB_TXFD (Bit 0) */
-#define USB_USB_TXD3_REG_USB_TXFD_Msk (0xffUL) /*!< USB_TXFD (Bitfield-Mask: 0xff) */
-/* ===================================================== USB_TXEV_REG ====================================================== */
-#define USB_USB_TXEV_REG_USB_TXUDRRN31_Pos (4UL) /*!< USB_TXUDRRN31 (Bit 4) */
-#define USB_USB_TXEV_REG_USB_TXUDRRN31_Msk (0x70UL) /*!< USB_TXUDRRN31 (Bitfield-Mask: 0x07) */
-#define USB_USB_TXEV_REG_USB_TXFIFO31_Pos (0UL) /*!< USB_TXFIFO31 (Bit 0) */
-#define USB_USB_TXEV_REG_USB_TXFIFO31_Msk (0x7UL) /*!< USB_TXFIFO31 (Bitfield-Mask: 0x07) */
-/* ===================================================== USB_TXMSK_REG ===================================================== */
-#define USB_USB_TXMSK_REG_USB_M_TXUDRRN31_Pos (4UL) /*!< USB_M_TXUDRRN31 (Bit 4) */
-#define USB_USB_TXMSK_REG_USB_M_TXUDRRN31_Msk (0x70UL) /*!< USB_M_TXUDRRN31 (Bitfield-Mask: 0x07) */
-#define USB_USB_TXMSK_REG_USB_M_TXFIFO31_Pos (0UL) /*!< USB_M_TXFIFO31 (Bit 0) */
-#define USB_USB_TXMSK_REG_USB_M_TXFIFO31_Msk (0x7UL) /*!< USB_M_TXFIFO31 (Bitfield-Mask: 0x07) */
-/* ===================================================== USB_TXS0_REG ====================================================== */
-#define USB_USB_TXS0_REG_USB_ACK_STAT_Pos (6UL) /*!< USB_ACK_STAT (Bit 6) */
-#define USB_USB_TXS0_REG_USB_ACK_STAT_Msk (0x40UL) /*!< USB_ACK_STAT (Bitfield-Mask: 0x01) */
-#define USB_USB_TXS0_REG_USB_TX_DONE_Pos (5UL) /*!< USB_TX_DONE (Bit 5) */
-#define USB_USB_TXS0_REG_USB_TX_DONE_Msk (0x20UL) /*!< USB_TX_DONE (Bitfield-Mask: 0x01) */
-#define USB_USB_TXS0_REG_USB_TCOUNT_Pos (0UL) /*!< USB_TCOUNT (Bit 0) */
-#define USB_USB_TXS0_REG_USB_TCOUNT_Msk (0x1fUL) /*!< USB_TCOUNT (Bitfield-Mask: 0x1f) */
-/* ===================================================== USB_TXS1_REG ====================================================== */
-#define USB_USB_TXS1_REG_USB_TX_URUN_Pos (7UL) /*!< USB_TX_URUN (Bit 7) */
-#define USB_USB_TXS1_REG_USB_TX_URUN_Msk (0x80UL) /*!< USB_TX_URUN (Bitfield-Mask: 0x01) */
-#define USB_USB_TXS1_REG_USB_ACK_STAT_Pos (6UL) /*!< USB_ACK_STAT (Bit 6) */
-#define USB_USB_TXS1_REG_USB_ACK_STAT_Msk (0x40UL) /*!< USB_ACK_STAT (Bitfield-Mask: 0x01) */
-#define USB_USB_TXS1_REG_USB_TX_DONE_Pos (5UL) /*!< USB_TX_DONE (Bit 5) */
-#define USB_USB_TXS1_REG_USB_TX_DONE_Msk (0x20UL) /*!< USB_TX_DONE (Bitfield-Mask: 0x01) */
-#define USB_USB_TXS1_REG_USB_TCOUNT_Pos (0UL) /*!< USB_TCOUNT (Bit 0) */
-#define USB_USB_TXS1_REG_USB_TCOUNT_Msk (0x1fUL) /*!< USB_TCOUNT (Bitfield-Mask: 0x1f) */
-/* ===================================================== USB_TXS2_REG ====================================================== */
-#define USB_USB_TXS2_REG_USB_TX_URUN_Pos (7UL) /*!< USB_TX_URUN (Bit 7) */
-#define USB_USB_TXS2_REG_USB_TX_URUN_Msk (0x80UL) /*!< USB_TX_URUN (Bitfield-Mask: 0x01) */
-#define USB_USB_TXS2_REG_USB_ACK_STAT_Pos (6UL) /*!< USB_ACK_STAT (Bit 6) */
-#define USB_USB_TXS2_REG_USB_ACK_STAT_Msk (0x40UL) /*!< USB_ACK_STAT (Bitfield-Mask: 0x01) */
-#define USB_USB_TXS2_REG_USB_TX_DONE_Pos (5UL) /*!< USB_TX_DONE (Bit 5) */
-#define USB_USB_TXS2_REG_USB_TX_DONE_Msk (0x20UL) /*!< USB_TX_DONE (Bitfield-Mask: 0x01) */
-#define USB_USB_TXS2_REG_USB_TCOUNT_Pos (0UL) /*!< USB_TCOUNT (Bit 0) */
-#define USB_USB_TXS2_REG_USB_TCOUNT_Msk (0x1fUL) /*!< USB_TCOUNT (Bitfield-Mask: 0x1f) */
-/* ===================================================== USB_TXS3_REG ====================================================== */
-#define USB_USB_TXS3_REG_USB_TX_URUN_Pos (7UL) /*!< USB_TX_URUN (Bit 7) */
-#define USB_USB_TXS3_REG_USB_TX_URUN_Msk (0x80UL) /*!< USB_TX_URUN (Bitfield-Mask: 0x01) */
-#define USB_USB_TXS3_REG_USB_ACK_STAT_Pos (6UL) /*!< USB_ACK_STAT (Bit 6) */
-#define USB_USB_TXS3_REG_USB_ACK_STAT_Msk (0x40UL) /*!< USB_ACK_STAT (Bitfield-Mask: 0x01) */
-#define USB_USB_TXS3_REG_USB_TX_DONE_Pos (5UL) /*!< USB_TX_DONE (Bit 5) */
-#define USB_USB_TXS3_REG_USB_TX_DONE_Msk (0x20UL) /*!< USB_TX_DONE (Bitfield-Mask: 0x01) */
-#define USB_USB_TXS3_REG_USB_TCOUNT_Pos (0UL) /*!< USB_TCOUNT (Bit 0) */
-#define USB_USB_TXS3_REG_USB_TCOUNT_Msk (0x1fUL) /*!< USB_TCOUNT (Bitfield-Mask: 0x1f) */
-/* ====================================================== USB_UTR_REG ====================================================== */
-#define USB_USB_UTR_REG_USB_DIAG_Pos (7UL) /*!< USB_DIAG (Bit 7) */
-#define USB_USB_UTR_REG_USB_DIAG_Msk (0x80UL) /*!< USB_DIAG (Bitfield-Mask: 0x01) */
-#define USB_USB_UTR_REG_USB_NCRC_Pos (6UL) /*!< USB_NCRC (Bit 6) */
-#define USB_USB_UTR_REG_USB_NCRC_Msk (0x40UL) /*!< USB_NCRC (Bitfield-Mask: 0x01) */
-#define USB_USB_UTR_REG_USB_SF_Pos (5UL) /*!< USB_SF (Bit 5) */
-#define USB_USB_UTR_REG_USB_SF_Msk (0x20UL) /*!< USB_SF (Bitfield-Mask: 0x01) */
-#define USB_USB_UTR_REG_USB_UTR_RES_Pos (0UL) /*!< USB_UTR_RES (Bit 0) */
-#define USB_USB_UTR_REG_USB_UTR_RES_Msk (0x1fUL) /*!< USB_UTR_RES (Bitfield-Mask: 0x1f) */
-/* ==================================================== USB_UX20CDR_REG ==================================================== */
-#define USB_USB_UX20CDR_REG_RPU_TEST7_Pos (7UL) /*!< RPU_TEST7 (Bit 7) */
-#define USB_USB_UX20CDR_REG_RPU_TEST7_Msk (0x80UL) /*!< RPU_TEST7 (Bitfield-Mask: 0x01) */
-#define USB_USB_UX20CDR_REG_RPU_TEST_SW2_Pos (6UL) /*!< RPU_TEST_SW2 (Bit 6) */
-#define USB_USB_UX20CDR_REG_RPU_TEST_SW2_Msk (0x40UL) /*!< RPU_TEST_SW2 (Bitfield-Mask: 0x01) */
-#define USB_USB_UX20CDR_REG_RPU_TEST_SW1_Pos (5UL) /*!< RPU_TEST_SW1 (Bit 5) */
-#define USB_USB_UX20CDR_REG_RPU_TEST_SW1_Msk (0x20UL) /*!< RPU_TEST_SW1 (Bitfield-Mask: 0x01) */
-#define USB_USB_UX20CDR_REG_RPU_TEST_EN_Pos (4UL) /*!< RPU_TEST_EN (Bit 4) */
-#define USB_USB_UX20CDR_REG_RPU_TEST_EN_Msk (0x10UL) /*!< RPU_TEST_EN (Bitfield-Mask: 0x01) */
-#define USB_USB_UX20CDR_REG_RPU_TEST_SW1DM_Pos (2UL) /*!< RPU_TEST_SW1DM (Bit 2) */
-#define USB_USB_UX20CDR_REG_RPU_TEST_SW1DM_Msk (0x4UL) /*!< RPU_TEST_SW1DM (Bitfield-Mask: 0x01) */
-#define USB_USB_UX20CDR_REG_RPU_RCDELAY_Pos (1UL) /*!< RPU_RCDELAY (Bit 1) */
-#define USB_USB_UX20CDR_REG_RPU_RCDELAY_Msk (0x2UL) /*!< RPU_RCDELAY (Bitfield-Mask: 0x01) */
-#define USB_USB_UX20CDR_REG_RPU_SSPROTEN_Pos (0UL) /*!< RPU_SSPROTEN (Bit 0) */
-#define USB_USB_UX20CDR_REG_RPU_SSPROTEN_Msk (0x1UL) /*!< RPU_SSPROTEN (Bitfield-Mask: 0x01) */
-/* ==================================================== USB_XCVDIAG_REG ==================================================== */
-#define USB_USB_XCVDIAG_REG_USB_VPIN_Pos (7UL) /*!< USB_VPIN (Bit 7) */
-#define USB_USB_XCVDIAG_REG_USB_VPIN_Msk (0x80UL) /*!< USB_VPIN (Bitfield-Mask: 0x01) */
-#define USB_USB_XCVDIAG_REG_USB_VMIN_Pos (6UL) /*!< USB_VMIN (Bit 6) */
-#define USB_USB_XCVDIAG_REG_USB_VMIN_Msk (0x40UL) /*!< USB_VMIN (Bitfield-Mask: 0x01) */
-#define USB_USB_XCVDIAG_REG_USB_RCV_Pos (5UL) /*!< USB_RCV (Bit 5) */
-#define USB_USB_XCVDIAG_REG_USB_RCV_Msk (0x20UL) /*!< USB_RCV (Bitfield-Mask: 0x01) */
-#define USB_USB_XCVDIAG_REG_USB_XCV_TXEN_Pos (3UL) /*!< USB_XCV_TXEN (Bit 3) */
-#define USB_USB_XCVDIAG_REG_USB_XCV_TXEN_Msk (0x8UL) /*!< USB_XCV_TXEN (Bitfield-Mask: 0x01) */
-#define USB_USB_XCVDIAG_REG_USB_XCV_TXn_Pos (2UL) /*!< USB_XCV_TXn (Bit 2) */
-#define USB_USB_XCVDIAG_REG_USB_XCV_TXn_Msk (0x4UL) /*!< USB_XCV_TXn (Bitfield-Mask: 0x01) */
-#define USB_USB_XCVDIAG_REG_USB_XCV_TXp_Pos (1UL) /*!< USB_XCV_TXp (Bit 1) */
-#define USB_USB_XCVDIAG_REG_USB_XCV_TXp_Msk (0x2UL) /*!< USB_XCV_TXp (Bitfield-Mask: 0x01) */
-#define USB_USB_XCVDIAG_REG_USB_XCV_TEST_Pos (0UL) /*!< USB_XCV_TEST (Bit 0) */
-#define USB_USB_XCVDIAG_REG_USB_XCV_TEST_Msk (0x1UL) /*!< USB_XCV_TEST (Bitfield-Mask: 0x01) */
-
-
-/* =========================================================================================================================== */
-/* ================ WAKEUP ================ */
-/* =========================================================================================================================== */
-
-/* =================================================== WKUP_CLEAR_P0_REG =================================================== */
-#define WAKEUP_WKUP_CLEAR_P0_REG_WKUP_CLEAR_P0_Pos (0UL) /*!< WKUP_CLEAR_P0 (Bit 0) */
-#define WAKEUP_WKUP_CLEAR_P0_REG_WKUP_CLEAR_P0_Msk (0xffffffffUL) /*!< WKUP_CLEAR_P0 (Bitfield-Mask: 0xffffffff) */
-/* =================================================== WKUP_CLEAR_P1_REG =================================================== */
-#define WAKEUP_WKUP_CLEAR_P1_REG_WKUP_CLEAR_P1_Pos (0UL) /*!< WKUP_CLEAR_P1 (Bit 0) */
-#define WAKEUP_WKUP_CLEAR_P1_REG_WKUP_CLEAR_P1_Msk (0x7fffffUL) /*!< WKUP_CLEAR_P1 (Bitfield-Mask: 0x7fffff) */
-/* ===================================================== WKUP_CTRL_REG ===================================================== */
-#define WAKEUP_WKUP_CTRL_REG_WKUP_ENABLE_IRQ_Pos (7UL) /*!< WKUP_ENABLE_IRQ (Bit 7) */
-#define WAKEUP_WKUP_CTRL_REG_WKUP_ENABLE_IRQ_Msk (0x80UL) /*!< WKUP_ENABLE_IRQ (Bitfield-Mask: 0x01) */
-#define WAKEUP_WKUP_CTRL_REG_WKUP_SFT_KEYHIT_Pos (6UL) /*!< WKUP_SFT_KEYHIT (Bit 6) */
-#define WAKEUP_WKUP_CTRL_REG_WKUP_SFT_KEYHIT_Msk (0x40UL) /*!< WKUP_SFT_KEYHIT (Bitfield-Mask: 0x01) */
-#define WAKEUP_WKUP_CTRL_REG_WKUP_DEB_VALUE_Pos (0UL) /*!< WKUP_DEB_VALUE (Bit 0) */
-#define WAKEUP_WKUP_CTRL_REG_WKUP_DEB_VALUE_Msk (0x3fUL) /*!< WKUP_DEB_VALUE (Bitfield-Mask: 0x3f) */
-/* ==================================================== WKUP_POL_P0_REG ==================================================== */
-#define WAKEUP_WKUP_POL_P0_REG_WKUP_POL_P0_Pos (0UL) /*!< WKUP_POL_P0 (Bit 0) */
-#define WAKEUP_WKUP_POL_P0_REG_WKUP_POL_P0_Msk (0xffffffffUL) /*!< WKUP_POL_P0 (Bitfield-Mask: 0xffffffff) */
-/* ==================================================== WKUP_POL_P1_REG ==================================================== */
-#define WAKEUP_WKUP_POL_P1_REG_WKUP_POL_P1_Pos (0UL) /*!< WKUP_POL_P1 (Bit 0) */
-#define WAKEUP_WKUP_POL_P1_REG_WKUP_POL_P1_Msk (0x7fffffUL) /*!< WKUP_POL_P1 (Bitfield-Mask: 0x7fffff) */
-/* ================================================== WKUP_RESET_IRQ_REG =================================================== */
-#define WAKEUP_WKUP_RESET_IRQ_REG_WKUP_IRQ_RST_Pos (0UL) /*!< WKUP_IRQ_RST (Bit 0) */
-#define WAKEUP_WKUP_RESET_IRQ_REG_WKUP_IRQ_RST_Msk (0xffffUL) /*!< WKUP_IRQ_RST (Bitfield-Mask: 0xffff) */
-/* ================================================== WKUP_SELECT_P0_REG =================================================== */
-#define WAKEUP_WKUP_SELECT_P0_REG_WKUP_SELECT_P0_Pos (0UL) /*!< WKUP_SELECT_P0 (Bit 0) */
-#define WAKEUP_WKUP_SELECT_P0_REG_WKUP_SELECT_P0_Msk (0xffffffffUL) /*!< WKUP_SELECT_P0 (Bitfield-Mask: 0xffffffff) */
-/* ================================================== WKUP_SELECT_P1_REG =================================================== */
-#define WAKEUP_WKUP_SELECT_P1_REG_WKUP_SELECT_P1_Pos (0UL) /*!< WKUP_SELECT_P1 (Bit 0) */
-#define WAKEUP_WKUP_SELECT_P1_REG_WKUP_SELECT_P1_Msk (0x7fffffUL) /*!< WKUP_SELECT_P1 (Bitfield-Mask: 0x7fffff) */
-/* ================================================= WKUP_SEL_GPIO_P0_REG ================================================== */
-#define WAKEUP_WKUP_SEL_GPIO_P0_REG_WKUP_SEL_GPIO_P0_Pos (0UL) /*!< WKUP_SEL_GPIO_P0 (Bit 0) */
-#define WAKEUP_WKUP_SEL_GPIO_P0_REG_WKUP_SEL_GPIO_P0_Msk (0xffffffffUL) /*!< WKUP_SEL_GPIO_P0 (Bitfield-Mask: 0xffffffff) */
-/* ================================================= WKUP_SEL_GPIO_P1_REG ================================================== */
-#define WAKEUP_WKUP_SEL_GPIO_P1_REG_WKUP_SEL_GPIO_P1_Pos (0UL) /*!< WKUP_SEL_GPIO_P1 (Bit 0) */
-#define WAKEUP_WKUP_SEL_GPIO_P1_REG_WKUP_SEL_GPIO_P1_Msk (0x7fffffUL) /*!< WKUP_SEL_GPIO_P1 (Bitfield-Mask: 0x7fffff) */
-/* ================================================== WKUP_STATUS_P0_REG =================================================== */
-#define WAKEUP_WKUP_STATUS_P0_REG_WKUP_STAT_P0_Pos (0UL) /*!< WKUP_STAT_P0 (Bit 0) */
-#define WAKEUP_WKUP_STATUS_P0_REG_WKUP_STAT_P0_Msk (0xffffffffUL) /*!< WKUP_STAT_P0 (Bitfield-Mask: 0xffffffff) */
-/* ================================================== WKUP_STATUS_P1_REG =================================================== */
-#define WAKEUP_WKUP_STATUS_P1_REG_WKUP_STAT_P1_Pos (0UL) /*!< WKUP_STAT_P1 (Bit 0) */
-#define WAKEUP_WKUP_STATUS_P1_REG_WKUP_STAT_P1_Msk (0x7fffffUL) /*!< WKUP_STAT_P1 (Bitfield-Mask: 0x7fffff) */
-
-/** @} */ /* End of group PosMask_peripherals */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* DA1469X_H */
-
-
-/** @} */ /* End of group DA1469x */
-
-/** @} */ /* End of group PLA_BSP_REGISTERS */
diff --git a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/cmsis_compiler.h b/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/cmsis_compiler.h
deleted file mode 100755
index fdb1a971..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/cmsis_compiler.h
+++ /dev/null
@@ -1,271 +0,0 @@
-/**************************************************************************//**
- * @file cmsis_compiler.h
- * @brief CMSIS compiler generic header file
- * @version V5.1.0
- * @date 09. October 2018
- ******************************************************************************/
-/*
- * Copyright (c) 2009-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
- *
- * www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CMSIS_COMPILER_H
-#define __CMSIS_COMPILER_H
-
-#include <stdint.h>
-
-/*
- * Arm Compiler 4/5
- */
-#if defined ( __CC_ARM )
- #include "cmsis_armcc.h"
-
-
-/*
- * Arm Compiler 6.6 LTM (armclang)
- */
-#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100)
- #include "cmsis_armclang_ltm.h"
-
- /*
- * Arm Compiler above 6.10.1 (armclang)
- */
-#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)
- #include "cmsis_armclang.h"
-
-
-/*
- * GNU Compiler
- */
-#elif defined ( __GNUC__ )
- #include "cmsis_gcc.h"
-
-
-/*
- * IAR Compiler
- */
-#elif defined ( __ICCARM__ )
- #include <cmsis_iccarm.h>
-
-
-/*
- * TI Arm Compiler
- */
-#elif defined ( __TI_ARM__ )
- #include <cmsis_ccs.h>
-
- #ifndef __ASM
- #define __ASM __asm
- #endif
- #ifndef __INLINE
- #define __INLINE inline
- #endif
- #ifndef __STATIC_INLINE
- #define __STATIC_INLINE static inline
- #endif
- #ifndef __STATIC_FORCEINLINE
- #define __STATIC_FORCEINLINE __STATIC_INLINE
- #endif
- #ifndef __NO_RETURN
- #define __NO_RETURN __attribute__((noreturn))
- #endif
- #ifndef __USED
- #define __USED __attribute__((used))
- #endif
- #ifndef __WEAK
- #define __WEAK __attribute__((weak))
- #endif
- #ifndef __PACKED
- #define __PACKED __attribute__((packed))
- #endif
- #ifndef __PACKED_STRUCT
- #define __PACKED_STRUCT struct __attribute__((packed))
- #endif
- #ifndef __PACKED_UNION
- #define __PACKED_UNION union __attribute__((packed))
- #endif
- #ifndef __UNALIGNED_UINT32 /* deprecated */
- struct __attribute__((packed)) T_UINT32 { uint32_t v; };
- #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
- #endif
- #ifndef __UNALIGNED_UINT16_WRITE
- __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
- #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val))
- #endif
- #ifndef __UNALIGNED_UINT16_READ
- __PACKED_STRUCT T_UINT16_READ { uint16_t v; };
- #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
- #endif
- #ifndef __UNALIGNED_UINT32_WRITE
- __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
- #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
- #endif
- #ifndef __UNALIGNED_UINT32_READ
- __PACKED_STRUCT T_UINT32_READ { uint32_t v; };
- #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
- #endif
- #ifndef __ALIGNED
- #define __ALIGNED(x) __attribute__((aligned(x)))
- #endif
- #ifndef __RESTRICT
- #define __RESTRICT __restrict
- #endif
-
-
-/*
- * 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.
- */
-
- #ifndef __ASM
- #define __ASM __asm
- #endif
- #ifndef __INLINE
- #define __INLINE inline
- #endif
- #ifndef __STATIC_INLINE
- #define __STATIC_INLINE static inline
- #endif
- #ifndef __STATIC_FORCEINLINE
- #define __STATIC_FORCEINLINE __STATIC_INLINE
- #endif
- #ifndef __NO_RETURN
- #define __NO_RETURN __attribute__((noreturn))
- #endif
- #ifndef __USED
- #define __USED __attribute__((used))
- #endif
- #ifndef __WEAK
- #define __WEAK __attribute__((weak))
- #endif
- #ifndef __PACKED
- #define __PACKED __packed__
- #endif
- #ifndef __PACKED_STRUCT
- #define __PACKED_STRUCT struct __packed__
- #endif
- #ifndef __PACKED_UNION
- #define __PACKED_UNION union __packed__
- #endif
- #ifndef __UNALIGNED_UINT32 /* deprecated */
- struct __packed__ T_UINT32 { uint32_t v; };
- #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
- #endif
- #ifndef __UNALIGNED_UINT16_WRITE
- __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
- #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
- #endif
- #ifndef __UNALIGNED_UINT16_READ
- __PACKED_STRUCT T_UINT16_READ { uint16_t v; };
- #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
- #endif
- #ifndef __UNALIGNED_UINT32_WRITE
- __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
- #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
- #endif
- #ifndef __UNALIGNED_UINT32_READ
- __PACKED_STRUCT T_UINT32_READ { uint32_t v; };
- #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
- #endif
- #ifndef __ALIGNED
- #define __ALIGNED(x) __align(x)
- #endif
- #ifndef __RESTRICT
- #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.
- #define __RESTRICT
- #endif
-
-
-/*
- * COSMIC Compiler
- */
-#elif defined ( __CSMC__ )
- #include <cmsis_csm.h>
-
- #ifndef __ASM
- #define __ASM _asm
- #endif
- #ifndef __INLINE
- #define __INLINE inline
- #endif
- #ifndef __STATIC_INLINE
- #define __STATIC_INLINE static inline
- #endif
- #ifndef __STATIC_FORCEINLINE
- #define __STATIC_FORCEINLINE __STATIC_INLINE
- #endif
- #ifndef __NO_RETURN
- // NO RETURN is automatically detected hence no warning here
- #define __NO_RETURN
- #endif
- #ifndef __USED
- #warning No compiler specific solution for __USED. __USED is ignored.
- #define __USED
- #endif
- #ifndef __WEAK
- #define __WEAK __weak
- #endif
- #ifndef __PACKED
- #define __PACKED @packed
- #endif
- #ifndef __PACKED_STRUCT
- #define __PACKED_STRUCT @packed struct
- #endif
- #ifndef __PACKED_UNION
- #define __PACKED_UNION @packed union
- #endif
- #ifndef __UNALIGNED_UINT32 /* deprecated */
- @packed struct T_UINT32 { uint32_t v; };
- #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
- #endif
- #ifndef __UNALIGNED_UINT16_WRITE
- __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
- #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
- #endif
- #ifndef __UNALIGNED_UINT16_READ
- __PACKED_STRUCT T_UINT16_READ { uint16_t v; };
- #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
- #endif
- #ifndef __UNALIGNED_UINT32_WRITE
- __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
- #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
- #endif
- #ifndef __UNALIGNED_UINT32_READ
- __PACKED_STRUCT T_UINT32_READ { uint32_t v; };
- #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
- #endif
- #ifndef __ALIGNED
- #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored.
- #define __ALIGNED(x)
- #endif
- #ifndef __RESTRICT
- #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.
- #define __RESTRICT
- #endif
-
-
-#else
- #error Unknown compiler.
-#endif
-
-
-#endif /* __CMSIS_COMPILER_H */
-
diff --git a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/cmsis_gcc.h b/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/cmsis_gcc.h
deleted file mode 100755
index 47a4b59d..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/cmsis_gcc.h
+++ /dev/null
@@ -1,2102 +0,0 @@
-/**************************************************************************//**
- * @file cmsis_gcc.h
- * @brief CMSIS compiler GCC header file
- * @version V5.1.0
- * @date 20. December 2018
- ******************************************************************************/
-/*
- * Copyright (c) 2009-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
- *
- * 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.
- */
- /* Copyright (c) 2019 Modified by Dialog Semiconductor */
-
-#ifndef __CMSIS_GCC_H
-#define __CMSIS_GCC_H
-
-/* ignore some GCC warnings */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#pragma GCC diagnostic ignored "-Wconversion"
-#pragma GCC diagnostic ignored "-Wunused-parameter"
-
-/* Fallback for __has_builtin */
-#ifndef __has_builtin
- #define __has_builtin(x) (0)
-#endif
-
-/* CMSIS compiler specific defines */
-#ifndef __ASM
- #define __ASM __asm
-#endif
-#ifndef __INLINE
- #define __INLINE inline
-#endif
-#ifndef __STATIC_INLINE
- #define __STATIC_INLINE static inline
-#endif
-#ifndef __STATIC_FORCEINLINE
- #define __STATIC_FORCEINLINE __attribute__((always_inline)) static inline
-#endif
-#ifndef __NO_RETURN
- #define __NO_RETURN __attribute__((__noreturn__))
-#endif
-#ifndef __USED
- #define __USED __attribute__((used))
-#endif
-#ifndef __WEAK
- #define __WEAK __attribute__((weak))
-#endif
-#ifndef __PACKED
- #define __PACKED __attribute__((packed, aligned(1)))
-#endif
-#ifndef __PACKED_STRUCT
- #define __PACKED_STRUCT struct __attribute__((packed, aligned(1)))
-#endif
-#ifndef __PACKED_UNION
- #define __PACKED_UNION union __attribute__((packed, aligned(1)))
-#endif
-#ifndef __UNALIGNED_UINT32 /* deprecated */
- #pragma GCC diagnostic push
- #pragma GCC diagnostic ignored "-Wpacked"
- #pragma GCC diagnostic ignored "-Wattributes"
- struct __attribute__((packed)) T_UINT32 { uint32_t v; };
- #pragma GCC diagnostic pop
- #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
-#endif
-#ifndef __UNALIGNED_UINT16_WRITE
- #pragma GCC diagnostic push
- #pragma GCC diagnostic ignored "-Wpacked"
- #pragma GCC diagnostic ignored "-Wattributes"
- __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
- #pragma GCC diagnostic pop
- #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
-#endif
-#ifndef __UNALIGNED_UINT16_READ
- #pragma GCC diagnostic push
- #pragma GCC diagnostic ignored "-Wpacked"
- #pragma GCC diagnostic ignored "-Wattributes"
- __PACKED_STRUCT T_UINT16_READ { uint16_t v; };
- #pragma GCC diagnostic pop
- #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
-#endif
-#ifndef __UNALIGNED_UINT32_WRITE
- #pragma GCC diagnostic push
- #pragma GCC diagnostic ignored "-Wpacked"
- #pragma GCC diagnostic ignored "-Wattributes"
- __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
- #pragma GCC diagnostic pop
- #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
-#endif
-#ifndef __UNALIGNED_UINT32_READ
- #pragma GCC diagnostic push
- #pragma GCC diagnostic ignored "-Wpacked"
- #pragma GCC diagnostic ignored "-Wattributes"
- __PACKED_STRUCT T_UINT32_READ { uint32_t v; };
- #pragma GCC diagnostic pop
- #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
-#endif
-#ifndef __ALIGNED
- #define __ALIGNED(x) __attribute__((aligned(x)))
-#endif
-#ifndef __RESTRICT
- #define __RESTRICT __restrict
-#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.
- */
-__STATIC_FORCEINLINE 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.
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE uint32_t __get_CONTROL(void)
-{
- uint32_t result;
-
- __ASM volatile ("MRS %0, control" : "=r" (result) );
- return(result);
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control)
-{
- __ASM volatile ("MSR control, %0" : : "r" (control) : "memory");
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE uint32_t __get_PSP(void)
-{
- uint32_t result;
-
- __ASM volatile ("MRS %0, psp" : "=r" (result) );
- return(result);
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \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
- */
-__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void)
-{
- 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
- */
-__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack)
-{
- __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : );
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \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
- */
-__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack)
-{
- __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : );
-}
-#endif
-
-
-/**
- \brief Get Main Stack Pointer
- \details Returns the current value of the Main Stack Pointer (MSP).
- \return MSP Register value
- */
-__STATIC_FORCEINLINE uint32_t __get_MSP(void)
-{
- uint32_t result;
-
- __ASM volatile ("MRS %0, msp" : "=r" (result) );
- return(result);
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \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
- */
-__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void)
-{
- 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
- */
-__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack)
-{
- __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : );
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \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
- */
-__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack)
-{
- __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : );
-}
-#endif
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \brief Get Stack Pointer (non-secure)
- \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state.
- \return SP Register value
- */
-__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void)
-{
- uint32_t result;
-
- __ASM volatile ("MRS %0, sp_ns" : "=r" (result) );
- return(result);
-}
-
-
-/**
- \brief Set Stack Pointer (non-secure)
- \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state.
- \param [in] topOfStack Stack Pointer value to set
- */
-__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack)
-{
- __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : );
-}
-#endif
-
-
-/**
- \brief Get Priority Mask
- \details Returns the current state of the priority mask bit from the Priority Mask Register.
- \return Priority Mask value
- */
-__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void)
-{
- uint32_t result;
-
- __ASM volatile ("MRS %0, primask" : "=r" (result) :: "memory");
- return(result);
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \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
- */
-__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void)
-{
- uint32_t result;
-
- __ASM volatile ("MRS %0, primask_ns" : "=r" (result) :: "memory");
- return(result);
-}
-#endif
-
-
-/**
- \brief Set Priority Mask
- \details Assigns the given value to the Priority Mask Register.
- \param [in] priMask Priority Mask
- */
-__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask)
-{
- __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory");
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \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
- */
-__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask)
-{
- __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory");
-}
-#endif
-
-
-#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) )
-/**
- \brief Enable FIQ
- \details Enables FIQ interrupts by clearing the F-bit in the CPSR.
- Can only be executed in Privileged modes.
- */
-__STATIC_FORCEINLINE 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.
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void)
-{
- uint32_t result;
-
- __ASM volatile ("MRS %0, basepri" : "=r" (result) );
- return(result);
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri)
-{
- __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory");
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \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
- */
-__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri)
-{
- __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "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
- */
-__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri)
-{
- __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory");
-}
-
-
-/**
- \brief Get Fault Mask
- \details Returns the current value of the Fault Mask register.
- \return Fault Mask register value
- */
-__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void)
-{
- uint32_t result;
-
- __ASM volatile ("MRS %0, faultmask" : "=r" (result) );
- return(result);
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask)
-{
- __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory");
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \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
- */
-__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask)
-{
- __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory");
-}
-#endif
-
-#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */
-
-
-#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
- (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
-
-/**
- \brief Get Process Stack Pointer Limit
- Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
- Stack Pointer Limit register hence zero is returned always in non-secure
- mode.
-
- \details Returns the current value of the Process Stack Pointer Limit (PSPLIM).
- \return PSPLIM Register value
- */
-__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void)
-{
-#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
- (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
- // without main extensions, the non-secure PSPLIM is RAZ/WI
- return 0U;
-#else
- uint32_t result;
- __ASM volatile ("MRS %0, psplim" : "=r" (result) );
- return result;
-#endif
-}
-
-#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3))
-/**
- \brief Get Process Stack Pointer Limit (non-secure)
- Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
- Stack Pointer Limit register hence zero is returned always.
-
- \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.
- \return PSPLIM Register value
- */
-__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void)
-{
-#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
- // without main extensions, the non-secure PSPLIM is RAZ/WI
- return 0U;
-#else
- uint32_t result;
- __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) );
- return result;
-#endif
-}
-#endif
-
-
-/**
- \brief Set Process Stack Pointer Limit
- Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
- Stack Pointer Limit register hence the write is silently ignored in non-secure
- mode.
-
- \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM).
- \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set
- */
-__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit)
-{
-#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
- (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
- // without main extensions, the non-secure PSPLIM is RAZ/WI
- (void)ProcStackPtrLimit;
-#else
- __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit));
-#endif
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \brief Set Process Stack Pointer (non-secure)
- Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
- Stack Pointer Limit register hence the write is silently ignored.
-
- \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
- */
-__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit)
-{
-#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
- // without main extensions, the non-secure PSPLIM is RAZ/WI
- (void)ProcStackPtrLimit;
-#else
- __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit));
-#endif
-}
-#endif
-
-
-/**
- \brief Get Main Stack Pointer Limit
- Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
- Stack Pointer Limit register hence zero is returned always in non-secure
- mode.
-
- \details Returns the current value of the Main Stack Pointer Limit (MSPLIM).
- \return MSPLIM Register value
- */
-__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void)
-{
-#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
- (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
- // without main extensions, the non-secure MSPLIM is RAZ/WI
- return 0U;
-#else
- uint32_t result;
- __ASM volatile ("MRS %0, msplim" : "=r" (result) );
- return result;
-#endif
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \brief Get Main Stack Pointer Limit (non-secure)
- Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
- Stack Pointer Limit register hence zero is returned always.
-
- \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state.
- \return MSPLIM Register value
- */
-__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void)
-{
-#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
- // without main extensions, the non-secure MSPLIM is RAZ/WI
- return 0U;
-#else
- uint32_t result;
- __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) );
- return result;
-#endif
-}
-#endif
-
-
-/**
- \brief Set Main Stack Pointer Limit
- Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
- Stack Pointer Limit register hence the write is silently ignored in non-secure
- mode.
-
- \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM).
- \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set
- */
-__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit)
-{
-#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
- (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
- // without main extensions, the non-secure MSPLIM is RAZ/WI
- (void)MainStackPtrLimit;
-#else
- __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit));
-#endif
-}
-
-
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
-/**
- \brief Set Main Stack Pointer Limit (non-secure)
- Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
- Stack Pointer Limit register hence the write is silently ignored.
-
- \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
- */
-__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit)
-{
-#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
- // without main extensions, the non-secure MSPLIM is RAZ/WI
- (void)MainStackPtrLimit;
-#else
- __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit));
-#endif
-}
-#endif
-
-#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
- (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */
-
-
-/**
- \brief Get FPSCR
- \details Returns the current value of the Floating Point Status/Control register.
- \return Floating Point Status/Control register value
- */
-__STATIC_FORCEINLINE uint32_t __get_FPSCR(void)
-{
-#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
- (defined (__FPU_USED ) && (__FPU_USED == 1U)) )
-#if __has_builtin(__builtin_arm_get_fpscr)
-// Re-enable using built-in when GCC has been fixed
-// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2)
- /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */
- return __builtin_arm_get_fpscr();
-#else
- uint32_t result;
-
- __ASM volatile ("VMRS %0, fpscr" : "=r" (result) );
- return(result);
-#endif
-#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_FORCEINLINE void __set_FPSCR(uint32_t fpscr)
-{
-#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
- (defined (__FPU_USED ) && (__FPU_USED == 1U)) )
-#if __has_builtin(__builtin_arm_set_fpscr)
-// Re-enable using built-in when GCC has been fixed
-// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2)
- /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */
- __builtin_arm_set_fpscr(fpscr);
-#else
- __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc", "memory");
-#endif
-#else
- (void)fpscr;
-#endif
-}
-
-
-/*@} 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_RW_REG(r) "+l" (r)
-#define __CMSIS_GCC_USE_REG(r) "l" (r)
-#else
-#define __CMSIS_GCC_OUT_REG(r) "=r" (r)
-#define __CMSIS_GCC_RW_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() __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.
- */
-#define __WFI() __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.
- */
-#define __WFE() __ASM volatile ("wfe")
-
-
-/**
- \brief Send Event
- \details Send Event is a hint instruction. It causes an event to be signaled to the CPU.
- */
-#define __SEV() __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.
- */
-__STATIC_FORCEINLINE 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.
- */
-__STATIC_FORCEINLINE 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.
- */
-__STATIC_FORCEINLINE void __DMB(void)
-{
- __ASM volatile ("dmb 0xF":::"memory");
-}
-
-
-/**
- \brief Reverse byte order (32 bit)
- \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.
- \param [in] value Value to reverse
- \return Reversed value
- */
-__STATIC_FORCEINLINE 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 within each halfword of a word. For example, 0x12345678 becomes 0x34127856.
- \param [in] value Value to reverse
- \return Reversed value
- */
-__STATIC_FORCEINLINE 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 (16 bit)
- \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.
- \param [in] value Value to reverse
- \return Reversed value
- */
-__STATIC_FORCEINLINE int16_t __REVSH(int16_t value)
-{
-#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
- return (int16_t)__builtin_bswap16(value);
-#else
- int16_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] op1 Value to rotate
- \param [in] op2 Number of Bits to rotate
- \return Rotated value
- */
-__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
-{
- op2 %= 32U;
- if (op2 == 0U)
- {
- return op1;
- }
- 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
- */
-__STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value)
-{
- uint32_t result;
-
-#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) )
- __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) );
-#else
- uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */
-
- result = value; /* r will be reversed bits of v; first get LSB of v */
- for (value >>= 1U; value != 0U; 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
- */
-__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value)
-{
- /* Even though __builtin_clz produces a CLZ instruction on ARM, formally
- __builtin_clz(0) is undefined behaviour, so handle this case specially.
- This guarantees ARM-compatible results if happening to compile on a non-ARM
- target, and ensures the compiler doesn't decide to activate any
- optimisations using the logic "value was passed to __builtin_clz, so it
- is non-zero".
- ARM GCC 7.3 and possibly earlier will optimise this test away, leaving a
- single CLZ instruction.
- */
- if (value == 0U)
- {
- return 32U;
- }
- return __builtin_clz(value);
-}
-
-
-#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
- (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
-/**
- \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)
- */
-__STATIC_FORCEINLINE 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)
- */
-__STATIC_FORCEINLINE 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)
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE 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.
- */
-__STATIC_FORCEINLINE void __CLREX(void)
-{
- __ASM volatile ("clrex" ::: "memory");
-}
-
-#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
- (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */
-
-
-#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) )
-/**
- \brief Signed Saturate
- \details Saturates a signed value.
- \param [in] ARG1 Value to be saturated
- \param [in] ARG2 Bit position to saturate to (1..32)
- \return Saturated value
- */
-#define __SSAT(ARG1,ARG2) \
-__extension__ \
-({ \
- 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] ARG1 Value to be saturated
- \param [in] ARG2 Bit position to saturate to (0..31)
- \return Saturated value
- */
-#define __USAT(ARG1,ARG2) \
- __extension__ \
-({ \
- 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
- */
-__STATIC_FORCEINLINE 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)
- */
-__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr)
-{
- uint32_t result;
-
-#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
- __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) );
-#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" (ptr) : "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)
- */
-__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr)
-{
- uint32_t result;
-
-#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
- __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) );
-#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" (ptr) : "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)
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr)
-{
- __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) );
-}
-
-#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */
-
-/**
- \brief Signed Saturate
- \details Saturates a signed value.
- \param [in] val Value to be saturated
- \param [in] sat Bit position to saturate to (1..32)
- \return Saturated value
- */
-__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat)
-{
- if ((sat >= 1U) && (sat <= 32U))
- {
- const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);
- const int32_t min = -1 - max ;
- if (val > max)
- {
- return max;
- }
- else if (val < min)
- {
- return min;
- }
- }
- return val;
-}
-
-/**
- \brief Unsigned Saturate
- \details Saturates an unsigned value.
- \param [in] val Value to be saturated
- \param [in] sat Bit position to saturate to (0..31)
- \return Saturated value
- */
-__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat)
-{
- if (sat <= 31U)
- {
- const uint32_t max = ((1U << sat) - 1U);
- if (val > (int32_t)max)
- {
- return max;
- }
- else if (val < 0)
- {
- return 0U;
- }
- }
- return (uint32_t)val;
-}
-
-#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */
-
-
-#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
- (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
-/**
- \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)
- */
-__STATIC_FORCEINLINE 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)
- */
-__STATIC_FORCEINLINE 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)
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE 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
- */
-__STATIC_FORCEINLINE 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)
- */
-__STATIC_FORCEINLINE uint8_t __LDAEXB(volatile uint8_t *ptr)
-{
- uint32_t result;
-
- __ASM volatile ("ldaexb %0, %1" : "=r" (result) : "Q" (*ptr) );
- return ((uint8_t) result);
-}
-
-
-/**
- \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)
- */
-__STATIC_FORCEINLINE uint16_t __LDAEXH(volatile uint16_t *ptr)
-{
- uint32_t result;
-
- __ASM volatile ("ldaexh %0, %1" : "=r" (result) : "Q" (*ptr) );
- return ((uint16_t) result);
-}
-
-
-/**
- \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)
- */
-__STATIC_FORCEINLINE uint32_t __LDAEX(volatile uint32_t *ptr)
-{
- uint32_t result;
-
- __ASM volatile ("ldaex %0, %1" : "=r" (result) : "Q" (*ptr) );
- return(result);
-}
-
-
-/**
- \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
- */
-__STATIC_FORCEINLINE uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr)
-{
- uint32_t result;
-
- __ASM volatile ("stlexb %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) );
- return(result);
-}
-
-
-/**
- \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
- */
-__STATIC_FORCEINLINE uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr)
-{
- uint32_t result;
-
- __ASM volatile ("stlexh %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) );
- return(result);
-}
-
-
-/**
- \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
- */
-__STATIC_FORCEINLINE uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr)
-{
- uint32_t result;
-
- __ASM volatile ("stlex %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) );
- return(result);
-}
-
-#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
- (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */
-
-/*@}*/ /* end of group CMSIS_Core_InstructionInterface */
-
-
-/* ################### Compiler specific Intrinsics ########################### */
-/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
- Access to dedicated SIMD instructions
- @{
-*/
-
-#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1))
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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; \
- })
-
-__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1)
-{
- uint32_t result;
-
- __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1));
- return(result);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1)
-{
- uint32_t result;
-
- __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1));
- return(result);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-__STATIC_FORCEINLINE 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);
-}
-
-#if 0
-#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; \
- })
-#endif
-
-#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) )
-
-__STATIC_FORCEINLINE int32_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 == 1) */
-/*@} end of group CMSIS_SIMD_intrinsics */
-
-
-#pragma GCC diagnostic pop
-
-#endif /* __CMSIS_GCC_H */
diff --git a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/cmsis_version.h b/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/cmsis_version.h
deleted file mode 100755
index 660f612a..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/cmsis_version.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**************************************************************************//**
- * @file cmsis_version.h
- * @brief CMSIS Core(M) Version definitions
- * @version V5.0.2
- * @date 19. April 2017
- ******************************************************************************/
-/*
- * Copyright (c) 2009-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
- *
- * www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#if defined ( __ICCARM__ )
- #pragma system_include /* treat file as system include file for MISRA check */
-#elif defined (__clang__)
- #pragma clang system_header /* treat file as system include file */
-#endif
-
-#ifndef __CMSIS_VERSION_H
-#define __CMSIS_VERSION_H
-
-/* CMSIS Version definitions */
-#define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */
-#define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */
-#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \
- __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */
-#endif
diff --git a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/core_cm0.h b/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/core_cm0.h
deleted file mode 100755
index e2cf6b96..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/core_cm0.h
+++ /dev/null
@@ -1,950 +0,0 @@
-/**************************************************************************//**
- * @file core_cm0.h
- * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File
- * @version V5.0.6
- * @date 13. March 2019
- ******************************************************************************/
-/*
- * Copyright (c) 2009-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
- *
- * 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.
- */
- /* Copyright (c) 2019 Modified by Dialog Semiconductor */
-
-#if defined ( __ICCARM__ )
- #pragma system_include /* treat file as system include file for MISRA check */
-#elif defined (__clang__)
- #pragma clang system_header /* treat file as system include file */
-#endif
-
-#ifndef __CORE_CM0_H_GENERIC
-#define __CORE_CM0_H_GENERIC
-
-#include <stdint.h>
-
-#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.<br>
- Function definitions in header files are used to allow 'inlining'.
-
- \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
- Unions are used for effective representation of core registers.
-
- \li Advisory Rule 19.7, Function-like macro defined.<br>
- Function-like macros are used to allow more efficient code.
- */
-
-
-/*******************************************************************************
- * CMSIS definitions
- ******************************************************************************/
-/**
- \ingroup Cortex_M0
- @{
- */
-
-#include "cmsis_version.h"
-
-/* CMSIS CM0 definitions */
-#define __CM0_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */
-#define __CM0_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */
-#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16U) | \
- __CM0_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */
-
-#define __CORTEX_M (0U) /*!< Cortex-M Core */
-
-/** __FPU_USED indicates whether an FPU is used or not.
- This core does not support an FPU at all
-*/
-#define __FPU_USED 0U
-
-#if defined ( __CC_ARM )
- #if defined __TARGET_FPU_VFP
- #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
- #endif
-
-#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
- #if defined __ARM_FP
- #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
- #endif
-
-#elif defined ( __GNUC__ )
- #if defined (__VFP_FP__) && !defined(__SOFTFP__)
- #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
- #endif
-
-#elif defined ( __ICCARM__ )
- #if defined __ARMVFP__
- #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
- #endif
-
-#elif defined ( __TI_ARM__ )
- #if defined __TI_VFP_SUPPORT__
- #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
- #endif
-
-#elif defined ( __TASKING__ )
- #if defined __FPU_VFP__
- #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
- #endif
-
-#elif defined ( __CSMC__ )
- #if ( __CSMC__ & 0x400U)
- #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
- #endif
-
-#endif
-
-#include "cmsis_compiler.h" /* CMSIS compiler specific defines */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __CORE_CM0_H_GENERIC */
-
-#ifndef __CMSIS_GENERIC
-
-#ifndef __CORE_CM0_H_DEPENDANT
-#define __CORE_CM0_H_DEPENDANT
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* check device defines and use defaults */
-#if defined __CHECK_DEVICE_DEFINES
- #ifndef __CM0_REV
- #define __CM0_REV 0x0000U
- #warning "__CM0_REV not defined in device header file; using default!"
- #endif
-
- #ifndef __NVIC_PRIO_BITS
- #define __NVIC_PRIO_BITS 2U
- #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
-
- <strong>IO Type Qualifiers</strong> 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_M0 */
-
-
-
-/*******************************************************************************
- * Register Abstraction
- Core Register contain:
- - Core Register
- - Core NVIC Register
- - Core SCB Register
- - Core SysTick 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:28; /*!< bit: 0..27 Reserved */
- 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 */
-
-
-/**
- \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:15; /*!< bit: 9..23 Reserved */
- uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
- uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */
- 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_T_Pos 24U /*!< xPSR: T Position */
-#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T 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 _reserved0:1; /*!< bit: 0 Reserved */
- uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
- uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */
- } b; /*!< Structure used for bit access */
- uint32_t w; /*!< Type used for word access */
-} CONTROL_Type;
-
-/* CONTROL Register Definitions */
-#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */
-#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL 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[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
- uint32_t RESERVED0[31U];
- __IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
- uint32_t RESERVED1[31U];
- __IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
- uint32_t RESERVED2[31U];
- __IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
- uint32_t RESERVED3[31U];
- uint32_t RESERVED4[64U];
- __IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */
-} NVIC_Type;
-
-/*@} 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 */
- uint32_t RESERVED0;
- __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 */
- uint32_t RESERVED1;
- __IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */
- __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State 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_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */
-#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE 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_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 */
-
-/* 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_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 */
-
-/* SCB System Handler Control and State Register Definitions */
-#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */
-#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
-
-/*@} end of group CMSIS_SCB */
-
-
-/**
- \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_CoreDebug Core Debug Registers (CoreDebug)
- \brief Cortex-M0 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor.
- Therefore they are not covered by the Cortex-M0 header file.
- @{
- */
-/*@} 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. This parameter is interpreted as an uint32_t type.
- \return Masked and shifted value.
-*/
-#define _VAL2FLD(field, value) (((uint32_t)(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. This parameter is interpreted as an uint32_t type.
- \return Masked and shifted bit field value.
-*/
-#define _FLD2VAL(field, value) (((uint32_t)(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 Core Hardware */
-#define SCS_BASE (0xE000E000UL) /*!< System Control Space 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 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 */
-
-
-/*@} */
-
-
-
-/*******************************************************************************
- * Hardware Abstraction Layer
- Core Function Interface contains:
- - Core NVIC Functions
- - Core SysTick 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.
- @{
- */
-
-#ifdef CMSIS_NVIC_VIRTUAL
- #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
- #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
- #endif
- #include CMSIS_NVIC_VIRTUAL_HEADER_FILE
-#else
- #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping
- #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping
- #define NVIC_EnableIRQ __NVIC_EnableIRQ
- #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ
- #define NVIC_DisableIRQ __NVIC_DisableIRQ
- #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ
- #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ
- #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ
-/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M0 */
- #define NVIC_SetPriority __NVIC_SetPriority
- #define NVIC_GetPriority __NVIC_GetPriority
- #define NVIC_SystemReset __NVIC_SystemReset
-#endif /* CMSIS_NVIC_VIRTUAL */
-
-#ifdef CMSIS_VECTAB_VIRTUAL
- #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
- #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
- #endif
- #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
-#else
- #define NVIC_SetVector __NVIC_SetVector
- #define NVIC_GetVector __NVIC_GetVector
-#endif /* (CMSIS_VECTAB_VIRTUAL) */
-
-#define NVIC_USER_IRQ_OFFSET 16
-
-
-/* The following EXC_RETURN values are saved the LR on exception entry */
-#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */
-#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */
-#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */
-
-
-/* Interrupt Priorities are WORD accessible only under Armv6-M */
-/* The following MACROS handle generation of the register offset and byte masks */
-#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL)
-#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )
-#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )
-
-#define __NVIC_SetPriorityGrouping(X) (void)(X)
-#define __NVIC_GetPriorityGrouping() (0U)
-
-/**
- \brief Enable Interrupt
- \details Enables a device specific interrupt in the NVIC interrupt controller.
- \param [in] IRQn Device specific interrupt number.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- }
-}
-
-
-/**
- \brief Get Interrupt Enable status
- \details Returns a device specific interrupt enable status from the NVIC interrupt controller.
- \param [in] IRQn Device specific interrupt number.
- \return 0 Interrupt is not enabled.
- \return 1 Interrupt is enabled.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
- }
- else
- {
- return(0U);
- }
-}
-
-
-/**
- \brief Disable Interrupt
- \details Disables a device specific interrupt in the NVIC interrupt controller.
- \param [in] IRQn Device specific interrupt number.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- __DSB();
- __ISB();
- }
-}
-
-
-/**
- \brief Get Pending Interrupt
- \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.
- \param [in] IRQn Device specific interrupt number.
- \return 0 Interrupt status is not pending.
- \return 1 Interrupt status is pending.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
- }
- else
- {
- return(0U);
- }
-}
-
-
-/**
- \brief Set Pending Interrupt
- \details Sets the pending bit of a device specific interrupt in the NVIC pending register.
- \param [in] IRQn Device specific interrupt number.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- }
-}
-
-
-/**
- \brief Clear Pending Interrupt
- \details Clears the pending bit of a device specific interrupt in the NVIC pending register.
- \param [in] IRQn Device specific interrupt number.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- }
-}
-
-
-/**
- \brief Set Interrupt Priority
- \details Sets the priority of a device specific interrupt or a processor exception.
- The interrupt number can be positive to specify a device specific interrupt,
- or negative to specify a processor exception.
- \param [in] IRQn Interrupt number.
- \param [in] priority Priority to set.
- \note The priority cannot be set for every processor exception.
- */
-__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
- (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
- }
- else
- {
- SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
- (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
- }
-}
-
-
-/**
- \brief Get Interrupt Priority
- \details Reads the priority of a device specific interrupt or a processor exception.
- The interrupt number can be positive to specify a device specific interrupt,
- or negative to specify a processor exception.
- \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)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
- }
- else
- {
- return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (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 Set Interrupt Vector
- \details Sets an interrupt vector in SRAM based interrupt vector table.
- The interrupt number can be positive to specify a device specific interrupt,
- or negative to specify a processor exception.
- Address 0 must be mapped to SRAM.
- \param [in] IRQn Interrupt number
- \param [in] vector Address of interrupt handler function
- */
-__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
-{
- uint32_t vectors = 0x0U;
- (* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)) = vector;
-}
-
-
-/**
- \brief Get Interrupt Vector
- \details Reads an interrupt vector from interrupt vector table.
- The interrupt number can be positive to specify a device specific interrupt,
- or negative to specify a processor exception.
- \param [in] IRQn Interrupt number.
- \return Address of interrupt handler function
- */
-__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
-{
- uint32_t vectors = 0x0U;
- return (uint32_t)(* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4));
-}
-
-
-/**
- \brief System Reset
- \details Initiates a system reset request to reset the MCU.
- */
-__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
-{
- __DSB(); /* Ensure all outstanding memory accesses included
- buffered write are completed before reset */
- SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
- SCB_AIRCR_SYSRESETREQ_Msk);
- __DSB(); /* Ensure completion of memory access */
-
- for(;;) /* wait until reset */
- {
- __NOP();
- }
-}
-
-/*@} end of CMSIS_Core_NVICFunctions */
-
-
-/* ########################## FPU functions #################################### */
-/**
- \ingroup CMSIS_Core_FunctionInterface
- \defgroup CMSIS_Core_FpuFunctions FPU Functions
- \brief Function that provides FPU type.
- @{
- */
-
-/**
- \brief get FPU type
- \details returns the FPU type
- \returns
- - \b 0: No FPU
- - \b 1: Single precision FPU
- - \b 2: Double + Single precision FPU
- */
-__STATIC_INLINE uint32_t SCB_GetFPUType(void)
-{
- return 0U; /* No FPU */
-}
-
-
-/*@} end of CMSIS_Core_FpuFunctions */
-
-
-
-/* ################################## SysTick function ############################################ */
-/**
- \ingroup CMSIS_Core_FunctionInterface
- \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
- \brief Functions that configure the System.
- @{
- */
-
-#if defined (__Vendor_SysTickConfig) && (__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 <b>__Vendor_SysTickConfig</b> is set to 1, then the
- function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
- 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 */
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __CORE_CM0_H_DEPENDANT */
-
-#endif /* __CMSIS_GENERIC */
diff --git a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/core_cm33.h b/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/core_cm33.h
deleted file mode 100755
index 7249e133..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/core_cm33.h
+++ /dev/null
@@ -1,2908 +0,0 @@
-/**************************************************************************//**
- * @file core_cm33.h
- * @brief CMSIS Cortex-M33 Core Peripheral Access Layer Header File
- * @version V5.1.0
- * @date 12. November 2018
- ******************************************************************************/
-/*
- * Copyright (c) 2009-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
- *
- * 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.
- */
- /* Copyright (c) 2019 Modified by Dialog Semiconductor */
-
-#if defined ( __ICCARM__ )
- #pragma system_include /* treat file as system include file for MISRA check */
-#elif defined (__clang__)
- #pragma clang system_header /* treat file as system include file */
-#endif
-
-#ifndef __CORE_CM33_H_GENERIC
-#define __CORE_CM33_H_GENERIC
-
-#include <stdint.h>
-
-#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.<br>
- Function definitions in header files are used to allow 'inlining'.
-
- \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
- Unions are used for effective representation of core registers.
-
- \li Advisory Rule 19.7, Function-like macro defined.<br>
- Function-like macros are used to allow more efficient code.
- */
-
-
-/*******************************************************************************
- * CMSIS definitions
- ******************************************************************************/
-/**
- \ingroup Cortex_M33
- @{
- */
-
-#include "cmsis_version.h"
-
-/* CMSIS CM33 definitions */
-#define __CM33_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */
-#define __CM33_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */
-#define __CM33_CMSIS_VERSION ((__CM33_CMSIS_VERSION_MAIN << 16U) | \
- __CM33_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */
-
-#define __CORTEX_M (33U) /*!< Cortex-M Core */
-
-/** __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 defined (__FPU_PRESENT) && (__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
-
- #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U)
- #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U)
- #define __DSP_USED 1U
- #else
- #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"
- #define __DSP_USED 0U
- #endif
- #else
- #define __DSP_USED 0U
- #endif
-
-#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
- #if defined (__ARM_FP)
- #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
- #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
-
- #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U)
- #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U)
- #define __DSP_USED 1U
- #else
- #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"
- #define __DSP_USED 0U
- #endif
- #else
- #define __DSP_USED 0U
- #endif
-
-#elif defined ( __GNUC__ )
- #if defined (__VFP_FP__) && !defined(__SOFTFP__)
- #if defined (__FPU_PRESENT) && (__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
-
- #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U)
- #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U)
- #define __DSP_USED 1U
- #else
- #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"
- #define __DSP_USED 0U
- #endif
- #else
- #define __DSP_USED 0U
- #endif
-
-#elif defined ( __ICCARM__ )
- #if defined (__ARMVFP__)
- #if defined (__FPU_PRESENT) && (__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
-
- #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U)
- #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U)
- #define __DSP_USED 1U
- #else
- #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)"
- #define __DSP_USED 0U
- #endif
- #else
- #define __DSP_USED 0U
- #endif
-
-#elif defined ( __TI_ARM__ )
- #if defined (__TI_VFP_SUPPORT__)
- #if defined (__FPU_PRESENT) && (__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 defined (__FPU_PRESENT) && (__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 defined (__FPU_PRESENT) && (__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 "cmsis_compiler.h" /* CMSIS compiler specific defines */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __CORE_CM33_H_GENERIC */
-
-#ifndef __CMSIS_GENERIC
-
-#ifndef __CORE_CM33_H_DEPENDANT
-#define __CORE_CM33_H_DEPENDANT
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/* check device defines and use defaults */
-#if defined __CHECK_DEVICE_DEFINES
- #ifndef __CM33_REV
- #define __CM33_REV 0x0000U
- #warning "__CM33_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 __SAUREGION_PRESENT
- #define __SAUREGION_PRESENT 0U
- #warning "__SAUREGION_PRESENT not defined in device header file; using default!"
- #endif
-
- #ifndef __DSP_PRESENT
- #define __DSP_PRESENT 0U
- #warning "__DSP_PRESENT not defined in device header file; using default!"
- #endif
-
- #ifndef __NVIC_PRIO_BITS
- #define __NVIC_PRIO_BITS 3U
- #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
-
- <strong>IO Type Qualifiers</strong> 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_M33 */
-
-
-
-/*******************************************************************************
- * Register Abstraction
- Core Register contain:
- - Core Register
- - Core NVIC Register
- - Core SCB Register
- - Core SysTick Register
- - Core Debug Register
- - Core MPU Register
- - Core SAU 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-pointer select */
- uint32_t FPCA:1; /*!< bit: 2 Floating-point context active */
- uint32_t SFPA:1; /*!< bit: 3 Secure floating-point active */
- uint32_t _reserved1:28; /*!< bit: 4..31 Reserved */
- } b; /*!< Structure used for bit access */
- uint32_t w; /*!< Type used for word access */
-} CONTROL_Type;
-
-/* CONTROL Register Definitions */
-#define CONTROL_SFPA_Pos 3U /*!< CONTROL: SFPA Position */
-#define CONTROL_SFPA_Msk (1UL << CONTROL_SFPA_Pos) /*!< CONTROL: SFPA Mask */
-
-#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[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
- uint32_t RESERVED0[16U];
- __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
- uint32_t RSERVED1[16U];
- __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
- uint32_t RESERVED2[16U];
- __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
- uint32_t RESERVED3[16U];
- __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */
- uint32_t RESERVED4[16U];
- __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */
- uint32_t RESERVED5[16U];
- __IOM uint8_t IPR[496U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */
- uint32_t RESERVED6[580U];
- __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 SHPR[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 ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */
- __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */
- __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */
- __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */
- __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */
- __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */
- __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */
- __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */
- __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */
- __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */
- __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */
- uint32_t RESERVED3[92U];
- __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */
- uint32_t RESERVED4[15U];
- __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */
- __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */
- __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */
- uint32_t RESERVED5[1U];
- __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */
- uint32_t RESERVED6[1U];
- __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */
- __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */
- __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */
- __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */
- __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */
- __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */
- __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */
- __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */
-} 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_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */
-#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */
-
-#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */
-#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */
-
-#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */
-#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR 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_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */
-#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */
-
-#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_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */
-#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */
-
-#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */
-#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS 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_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */
-#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS 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 */
-
-/* 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_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */
-#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS 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_BP_Pos 18U /*!< SCB CCR: BP Position */
-#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */
-
-#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */
-#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */
-
-#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */
-#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */
-
-#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */
-#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN 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 */
-
-/* SCB System Handler Control and State Register Definitions */
-#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */
-#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */
-
-#define SCB_SHCSR_SECUREFAULTPENDED_Pos 20U /*!< SCB SHCSR: SECUREFAULTPENDED Position */
-#define SCB_SHCSR_SECUREFAULTPENDED_Msk (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos) /*!< SCB SHCSR: SECUREFAULTPENDED Mask */
-
-#define SCB_SHCSR_SECUREFAULTENA_Pos 19U /*!< SCB SHCSR: SECUREFAULTENA Position */
-#define SCB_SHCSR_SECUREFAULTENA_Msk (1UL << SCB_SHCSR_SECUREFAULTENA_Pos) /*!< SCB SHCSR: SECUREFAULTENA Mask */
-
-#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_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */
-#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */
-
-#define SCB_SHCSR_SECUREFAULTACT_Pos 4U /*!< SCB SHCSR: SECUREFAULTACT Position */
-#define SCB_SHCSR_SECUREFAULTACT_Msk (1UL << SCB_SHCSR_SECUREFAULTACT_Pos) /*!< SCB SHCSR: SECUREFAULTACT 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_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */
-#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT 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 */
-
-/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */
-#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */
-#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */
-
-#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */
-#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */
-
-#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */
-#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */
-
-#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */
-#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */
-
-#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */
-#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */
-
-#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */
-#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */
-
-/* BusFault Status Register (part of SCB Configurable Fault Status Register) */
-#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */
-#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */
-
-#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */
-#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */
-
-#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */
-#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */
-
-#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */
-#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */
-
-#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */
-#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */
-
-#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */
-#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */
-
-#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */
-#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */
-
-/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */
-#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */
-#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */
-
-#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */
-#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */
-
-#define SCB_CFSR_STKOF_Pos (SCB_CFSR_USGFAULTSR_Pos + 4U) /*!< SCB CFSR (UFSR): STKOF Position */
-#define SCB_CFSR_STKOF_Msk (1UL << SCB_CFSR_STKOF_Pos) /*!< SCB CFSR (UFSR): STKOF Mask */
-
-#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */
-#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */
-
-#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */
-#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */
-
-#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */
-#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */
-
-#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */
-#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR 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 */
-
-/* SCB Non-Secure Access Control Register Definitions */
-#define SCB_NSACR_CP11_Pos 11U /*!< SCB NSACR: CP11 Position */
-#define SCB_NSACR_CP11_Msk (1UL << SCB_NSACR_CP11_Pos) /*!< SCB NSACR: CP11 Mask */
-
-#define SCB_NSACR_CP10_Pos 10U /*!< SCB NSACR: CP10 Position */
-#define SCB_NSACR_CP10_Msk (1UL << SCB_NSACR_CP10_Pos) /*!< SCB NSACR: CP10 Mask */
-
-#define SCB_NSACR_CPn_Pos 0U /*!< SCB NSACR: CPn Position */
-#define SCB_NSACR_CPn_Msk (1UL /*<< SCB_NSACR_CPn_Pos*/) /*!< SCB NSACR: CPn Mask */
-
-/* SCB Cache Level ID Register Definitions */
-#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */
-#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */
-
-#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */
-#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */
-
-/* SCB Cache Type Register Definitions */
-#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */
-#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */
-
-#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */
-#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */
-
-#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */
-#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */
-
-#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */
-#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */
-
-#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */
-#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */
-
-/* SCB Cache Size ID Register Definitions */
-#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */
-#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */
-
-#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */
-#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */
-
-#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */
-#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */
-
-#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */
-#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */
-
-#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */
-#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */
-
-#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */
-#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */
-
-#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */
-#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */
-
-/* SCB Cache Size Selection Register Definitions */
-#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */
-#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */
-
-#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */
-#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */
-
-/* SCB Software Triggered Interrupt Register Definitions */
-#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */
-#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */
-
-/* SCB D-Cache Invalidate by Set-way Register Definitions */
-#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */
-#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */
-
-#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */
-#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */
-
-/* SCB D-Cache Clean by Set-way Register Definitions */
-#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */
-#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */
-
-#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */
-#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */
-
-/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */
-#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */
-#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */
-
-#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */
-#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set 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 */
- __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power 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 */
-
-/*@} 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[32U];
- 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[1U];
- __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */
- uint32_t RESERVED6[4U];
- __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 Stimulus Port Register Definitions */
-#define ITM_STIM_DISABLED_Pos 1U /*!< ITM STIM: DISABLED Position */
-#define ITM_STIM_DISABLED_Msk (0x1UL << ITM_STIM_DISABLED_Pos) /*!< ITM STIM: DISABLED Mask */
-
-#define ITM_STIM_FIFOREADY_Pos 0U /*!< ITM STIM: FIFOREADY Position */
-#define ITM_STIM_FIFOREADY_Msk (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/) /*!< ITM STIM: FIFOREADY Mask */
-
-/* ITM Trace Privilege Register Definitions */
-#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */
-#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< 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_STALLENA_Pos 5U /*!< ITM TCR: STALLENA Position */
-#define ITM_TCR_STALLENA_Msk (1UL << ITM_TCR_STALLENA_Pos) /*!< ITM TCR: STALLENA 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 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 */
- uint32_t RESERVED1[1U];
- __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */
- uint32_t RESERVED2[1U];
- __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */
- uint32_t RESERVED3[1U];
- __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */
- uint32_t RESERVED4[1U];
- __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */
- uint32_t RESERVED5[1U];
- __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */
- uint32_t RESERVED6[1U];
- __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */
- uint32_t RESERVED7[1U];
- __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */
- uint32_t RESERVED8[1U];
- __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */
- uint32_t RESERVED9[1U];
- __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */
- uint32_t RESERVED10[1U];
- __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */
- uint32_t RESERVED11[1U];
- __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */
- uint32_t RESERVED12[1U];
- __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */
- uint32_t RESERVED13[1U];
- __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */
- uint32_t RESERVED14[1U];
- __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */
- uint32_t RESERVED15[1U];
- __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */
- uint32_t RESERVED16[1U];
- __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */
- uint32_t RESERVED17[1U];
- __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */
- uint32_t RESERVED18[1U];
- __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */
- uint32_t RESERVED19[1U];
- __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */
- uint32_t RESERVED20[1U];
- __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */
- uint32_t RESERVED21[1U];
- __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */
- uint32_t RESERVED22[1U];
- __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */
- uint32_t RESERVED23[1U];
- __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */
- uint32_t RESERVED24[1U];
- __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */
- uint32_t RESERVED25[1U];
- __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */
- uint32_t RESERVED26[1U];
- __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */
- uint32_t RESERVED27[1U];
- __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */
- uint32_t RESERVED28[1U];
- __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */
- uint32_t RESERVED29[1U];
- __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */
- uint32_t RESERVED30[1U];
- __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */
- uint32_t RESERVED31[1U];
- __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */
- uint32_t RESERVED32[934U];
- __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */
- uint32_t RESERVED33[1U];
- __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Architecture Register */
-} 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_CYCDISS_Pos 23U /*!< DWT CTRL: CYCDISS Position */
-#define DWT_CTRL_CYCDISS_Msk (0x1UL << DWT_CTRL_CYCDISS_Pos) /*!< DWT CTRL: CYCDISS 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 Function Register Definitions */
-#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */
-#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */
-
-#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_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */
-#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */
-
-#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */
-#define DWT_FUNCTION_ACTION_Msk (0x1UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */
-
-#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */
-#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH 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
-{
- __IM 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 */
- __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */
- uint32_t RESERVED3[759U];
- __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */
- __IM uint32_t ITFTTD0; /*!< Offset: 0xEEC (R/ ) Integration Test FIFO Test Data 0 Register */
- __IOM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/W) Integration Test ATB Control Register 2 */
- uint32_t RESERVED4[1U];
- __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) Integration Test ATB Control Register 0 */
- __IM uint32_t ITFTTD1; /*!< Offset: 0xEFC (R/ ) Integration Test FIFO Test Data 1 Register */
- __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/ ) Device Configuration Register */
- __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Identifier Register */
-} 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_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */
-#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan 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 Test FIFO Test Data 0 Register Definitions */
-#define TPI_ITFTTD0_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD0: ATB Interface 2 ATVALIDPosition */
-#define TPI_ITFTTD0_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 2 ATVALID Mask */
-
-#define TPI_ITFTTD0_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD0: ATB Interface 2 byte count Position */
-#define TPI_ITFTTD0_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 2 byte count Mask */
-
-#define TPI_ITFTTD0_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Position */
-#define TPI_ITFTTD0_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Mask */
-
-#define TPI_ITFTTD0_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD0: ATB Interface 1 byte count Position */
-#define TPI_ITFTTD0_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 1 byte countt Mask */
-
-#define TPI_ITFTTD0_ATB_IF1_data2_Pos 16U /*!< TPI ITFTTD0: ATB Interface 1 data2 Position */
-#define TPI_ITFTTD0_ATB_IF1_data2_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data2 Mask */
-
-#define TPI_ITFTTD0_ATB_IF1_data1_Pos 8U /*!< TPI ITFTTD0: ATB Interface 1 data1 Position */
-#define TPI_ITFTTD0_ATB_IF1_data1_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data1 Mask */
-
-#define TPI_ITFTTD0_ATB_IF1_data0_Pos 0U /*!< TPI ITFTTD0: ATB Interface 1 data0 Position */
-#define TPI_ITFTTD0_ATB_IF1_data0_Msk (0xFFUL /*<< TPI_ITFTTD0_ATB_IF1_data0_Pos*/) /*!< TPI ITFTTD0: ATB Interface 1 data0 Mask */
-
-/* TPI Integration Test ATB Control Register 2 Register Definitions */
-#define TPI_ITATBCTR2_AFVALID2S_Pos 1U /*!< TPI ITATBCTR2: AFVALID2S Position */
-#define TPI_ITATBCTR2_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID2S_Pos) /*!< TPI ITATBCTR2: AFVALID2SS Mask */
-
-#define TPI_ITATBCTR2_AFVALID1S_Pos 1U /*!< TPI ITATBCTR2: AFVALID1S Position */
-#define TPI_ITATBCTR2_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID1S_Pos) /*!< TPI ITATBCTR2: AFVALID1SS Mask */
-
-#define TPI_ITATBCTR2_ATREADY2S_Pos 0U /*!< TPI ITATBCTR2: ATREADY2S Position */
-#define TPI_ITATBCTR2_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2S_Pos*/) /*!< TPI ITATBCTR2: ATREADY2S Mask */
-
-#define TPI_ITATBCTR2_ATREADY1S_Pos 0U /*!< TPI ITATBCTR2: ATREADY1S Position */
-#define TPI_ITATBCTR2_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1S_Pos*/) /*!< TPI ITATBCTR2: ATREADY1S Mask */
-
-/* TPI Integration Test FIFO Test Data 1 Register Definitions */
-#define TPI_ITFTTD1_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Position */
-#define TPI_ITFTTD1_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Mask */
-
-#define TPI_ITFTTD1_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD1: ATB Interface 2 byte count Position */
-#define TPI_ITFTTD1_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 2 byte count Mask */
-
-#define TPI_ITFTTD1_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Position */
-#define TPI_ITFTTD1_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Mask */
-
-#define TPI_ITFTTD1_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD1: ATB Interface 1 byte count Position */
-#define TPI_ITFTTD1_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 1 byte countt Mask */
-
-#define TPI_ITFTTD1_ATB_IF2_data2_Pos 16U /*!< TPI ITFTTD1: ATB Interface 2 data2 Position */
-#define TPI_ITFTTD1_ATB_IF2_data2_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data2 Mask */
-
-#define TPI_ITFTTD1_ATB_IF2_data1_Pos 8U /*!< TPI ITFTTD1: ATB Interface 2 data1 Position */
-#define TPI_ITFTTD1_ATB_IF2_data1_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data1 Mask */
-
-#define TPI_ITFTTD1_ATB_IF2_data0_Pos 0U /*!< TPI ITFTTD1: ATB Interface 2 data0 Position */
-#define TPI_ITFTTD1_ATB_IF2_data0_Msk (0xFFUL /*<< TPI_ITFTTD1_ATB_IF2_data0_Pos*/) /*!< TPI ITFTTD1: ATB Interface 2 data0 Mask */
-
-/* TPI Integration Test ATB Control Register 0 Definitions */
-#define TPI_ITATBCTR0_AFVALID2S_Pos 1U /*!< TPI ITATBCTR0: AFVALID2S Position */
-#define TPI_ITATBCTR0_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID2S_Pos) /*!< TPI ITATBCTR0: AFVALID2SS Mask */
-
-#define TPI_ITATBCTR0_AFVALID1S_Pos 1U /*!< TPI ITATBCTR0: AFVALID1S Position */
-#define TPI_ITATBCTR0_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID1S_Pos) /*!< TPI ITATBCTR0: AFVALID1SS Mask */
-
-#define TPI_ITATBCTR0_ATREADY2S_Pos 0U /*!< TPI ITATBCTR0: ATREADY2S Position */
-#define TPI_ITATBCTR0_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2S_Pos*/) /*!< TPI ITATBCTR0: ATREADY2S Mask */
-
-#define TPI_ITATBCTR0_ATREADY1S_Pos 0U /*!< TPI ITATBCTR0: ATREADY1S Position */
-#define TPI_ITATBCTR0_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1S_Pos*/) /*!< TPI ITATBCTR0: ATREADY1S Mask */
-
-/* TPI Integration Mode Control Register Definitions */
-#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */
-#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< 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_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFOSZ Position */
-#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFOSZ Mask */
-
-#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */
-#define TPI_DEVID_NrTraceInput_Msk (0x3FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */
-
-/* TPI DEVTYPE Register Definitions */
-#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */
-#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */
-
-#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */
-#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */
-
-/*@}*/ /* end of group CMSIS_TPI */
-
-
-#if defined (__MPU_PRESENT) && (__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 Number Register */
- __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */
- __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */
- __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Region Base Address Register Alias 1 */
- __IOM uint32_t RLAR_A1; /*!< Offset: 0x018 (R/W) MPU Region Limit Address Register Alias 1 */
- __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Region Base Address Register Alias 2 */
- __IOM uint32_t RLAR_A2; /*!< Offset: 0x020 (R/W) MPU Region Limit Address Register Alias 2 */
- __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Region Base Address Register Alias 3 */
- __IOM uint32_t RLAR_A3; /*!< Offset: 0x028 (R/W) MPU Region Limit Address Register Alias 3 */
- uint32_t RESERVED0[1];
- union {
- __IOM uint32_t MAIR[2];
- struct {
- __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */
- __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */
- };
- };
-} MPU_Type;
-
-#define MPU_TYPE_RALIASES 4U
-
-/* 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_BASE_Pos 5U /*!< MPU RBAR: BASE Position */
-#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */
-
-#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */
-#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */
-
-#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */
-#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */
-
-#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */
-#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */
-
-/* MPU Region Limit Address Register Definitions */
-#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */
-#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */
-
-#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */
-#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */
-
-#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: Region enable bit Position */
-#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: Region enable bit Disable Mask */
-
-/* MPU Memory Attribute Indirection Register 0 Definitions */
-#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */
-#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */
-
-#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */
-#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */
-
-#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */
-#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */
-
-#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */
-#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */
-
-/* MPU Memory Attribute Indirection Register 1 Definitions */
-#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */
-#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */
-
-#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */
-#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */
-
-#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */
-#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */
-
-#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */
-#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */
-
-/*@} end of group CMSIS_MPU */
-#endif
-
-
-#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
-/**
- \ingroup CMSIS_core_register
- \defgroup CMSIS_SAU Security Attribution Unit (SAU)
- \brief Type definitions for the Security Attribution Unit (SAU)
- @{
- */
-
-/**
- \brief Structure type to access the Security Attribution Unit (SAU).
- */
-typedef struct
-{
- __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */
- __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */
-#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)
- __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */
- __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */
- __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */
-#else
- uint32_t RESERVED0[3];
-#endif
- __IOM uint32_t SFSR; /*!< Offset: 0x014 (R/W) Secure Fault Status Register */
- __IOM uint32_t SFAR; /*!< Offset: 0x018 (R/W) Secure Fault Address Register */
-} SAU_Type;
-
-/* SAU Control Register Definitions */
-#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */
-#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */
-
-#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */
-#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */
-
-/* SAU Type Register Definitions */
-#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */
-#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */
-
-#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U)
-/* SAU Region Number Register Definitions */
-#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */
-#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */
-
-/* SAU Region Base Address Register Definitions */
-#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */
-#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */
-
-/* SAU Region Limit Address Register Definitions */
-#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */
-#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */
-
-#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */
-#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */
-
-#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */
-#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */
-
-#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */
-
-/* Secure Fault Status Register Definitions */
-#define SAU_SFSR_LSERR_Pos 7U /*!< SAU SFSR: LSERR Position */
-#define SAU_SFSR_LSERR_Msk (1UL << SAU_SFSR_LSERR_Pos) /*!< SAU SFSR: LSERR Mask */
-
-#define SAU_SFSR_SFARVALID_Pos 6U /*!< SAU SFSR: SFARVALID Position */
-#define SAU_SFSR_SFARVALID_Msk (1UL << SAU_SFSR_SFARVALID_Pos) /*!< SAU SFSR: SFARVALID Mask */
-
-#define SAU_SFSR_LSPERR_Pos 5U /*!< SAU SFSR: LSPERR Position */
-#define SAU_SFSR_LSPERR_Msk (1UL << SAU_SFSR_LSPERR_Pos) /*!< SAU SFSR: LSPERR Mask */
-
-#define SAU_SFSR_INVTRAN_Pos 4U /*!< SAU SFSR: INVTRAN Position */
-#define SAU_SFSR_INVTRAN_Msk (1UL << SAU_SFSR_INVTRAN_Pos) /*!< SAU SFSR: INVTRAN Mask */
-
-#define SAU_SFSR_AUVIOL_Pos 3U /*!< SAU SFSR: AUVIOL Position */
-#define SAU_SFSR_AUVIOL_Msk (1UL << SAU_SFSR_AUVIOL_Pos) /*!< SAU SFSR: AUVIOL Mask */
-
-#define SAU_SFSR_INVER_Pos 2U /*!< SAU SFSR: INVER Position */
-#define SAU_SFSR_INVER_Msk (1UL << SAU_SFSR_INVER_Pos) /*!< SAU SFSR: INVER Mask */
-
-#define SAU_SFSR_INVIS_Pos 1U /*!< SAU SFSR: INVIS Position */
-#define SAU_SFSR_INVIS_Msk (1UL << SAU_SFSR_INVIS_Pos) /*!< SAU SFSR: INVIS Mask */
-
-#define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */
-#define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */
-
-/*@} end of group CMSIS_SAU */
-#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
-
-
-/**
- \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_LSPENS_Pos 29U /*!< FPCCR: LSPENS Position */
-#define FPU_FPCCR_LSPENS_Msk (1UL << FPU_FPCCR_LSPENS_Pos) /*!< FPCCR: LSPENS bit Mask */
-
-#define FPU_FPCCR_CLRONRET_Pos 28U /*!< FPCCR: CLRONRET Position */
-#define FPU_FPCCR_CLRONRET_Msk (1UL << FPU_FPCCR_CLRONRET_Pos) /*!< FPCCR: CLRONRET bit Mask */
-
-#define FPU_FPCCR_CLRONRETS_Pos 27U /*!< FPCCR: CLRONRETS Position */
-#define FPU_FPCCR_CLRONRETS_Msk (1UL << FPU_FPCCR_CLRONRETS_Pos) /*!< FPCCR: CLRONRETS bit Mask */
-
-#define FPU_FPCCR_TS_Pos 26U /*!< FPCCR: TS Position */
-#define FPU_FPCCR_TS_Msk (1UL << FPU_FPCCR_TS_Pos) /*!< FPCCR: TS bit Mask */
-
-#define FPU_FPCCR_UFRDY_Pos 10U /*!< FPCCR: UFRDY Position */
-#define FPU_FPCCR_UFRDY_Msk (1UL << FPU_FPCCR_UFRDY_Pos) /*!< FPCCR: UFRDY bit Mask */
-
-#define FPU_FPCCR_SPLIMVIOL_Pos 9U /*!< FPCCR: SPLIMVIOL Position */
-#define FPU_FPCCR_SPLIMVIOL_Msk (1UL << FPU_FPCCR_SPLIMVIOL_Pos) /*!< FPCCR: SPLIMVIOL 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_SFRDY_Pos 7U /*!< FPCCR: SFRDY Position */
-#define FPU_FPCCR_SFRDY_Msk (1UL << FPU_FPCCR_SFRDY_Pos) /*!< FPCCR: SFRDY 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_S_Pos 2U /*!< FPCCR: Security status of the FP context bit Position */
-#define FPU_FPCCR_S_Msk (1UL << FPU_FPCCR_S_Pos) /*!< FPCCR: Security status of the FP context 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 */
-
-
-/**
- \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 */
- uint32_t RESERVED4[1U];
- __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */
- __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status 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_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */
-#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST 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 */
-
-/* Debug Authentication Control Register Definitions */
-#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */
-#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */
-
-#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */
-#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */
-
-#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */
-#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */
-
-#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */
-#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */
-
-/* Debug Security Control and Status Register Definitions */
-#define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */
-#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */
-
-#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */
-#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */
-
-#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */
-#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN 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. This parameter is interpreted as an uint32_t type.
- \return Masked and shifted value.
-*/
-#define _VAL2FLD(field, value) (((uint32_t)(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. This parameter is interpreted as an uint32_t type.
- \return Masked and shifted bit field value.
-*/
-#define _FLD2VAL(field, value) (((uint32_t)(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 Core 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 defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
- #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */
- #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */
- #endif
-
- #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
- #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */
- #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */
- #endif
-
- #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */
- #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */
-
-#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
- #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */
- #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */
- #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */
- #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */
- #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */
-
- #define SCnSCB_NS ((SCnSCB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */
- #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */
- #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */
- #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */
- #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */
-
- #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
- #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */
- #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */
- #endif
-
- #define FPU_BASE_NS (SCS_BASE_NS + 0x0F30UL) /*!< Floating Point Unit (non-secure address space) */
- #define FPU_NS ((FPU_Type *) FPU_BASE_NS ) /*!< Floating Point Unit (non-secure address space) */
-
-#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
-/*@} */
-
-
-
-/*******************************************************************************
- * 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.
- @{
- */
-
-#ifdef CMSIS_NVIC_VIRTUAL
- #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
- #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
- #endif
- #include CMSIS_NVIC_VIRTUAL_HEADER_FILE
-#else
- #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping
- #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping
- #define NVIC_EnableIRQ __NVIC_EnableIRQ
- #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ
- #define NVIC_DisableIRQ __NVIC_DisableIRQ
- #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ
- #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ
- #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ
- #define NVIC_GetActive __NVIC_GetActive
- #define NVIC_SetPriority __NVIC_SetPriority
- #define NVIC_GetPriority __NVIC_GetPriority
- #define NVIC_SystemReset __NVIC_SystemReset
-#endif /* CMSIS_NVIC_VIRTUAL */
-
-#ifdef CMSIS_VECTAB_VIRTUAL
- #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
- #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
- #endif
- #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
-#else
- #define NVIC_SetVector __NVIC_SetVector
- #define NVIC_GetVector __NVIC_GetVector
-#endif /* (CMSIS_VECTAB_VIRTUAL) */
-
-#define NVIC_USER_IRQ_OFFSET 16
-
-
-/* Special LR values for Secure/Non-Secure call handling and exception handling */
-
-/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */
-#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */
-
-/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */
-#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */
-#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */
-#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */
-#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */
-#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */
-#define EXC_RETURN_SPSEL (0x00000004UL) /* bit [2] stack pointer used to restore context: 0=MSP 1=PSP */
-#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */
-
-/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */
-#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */
-#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */
-#else
-#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */
-#endif
-
-
-/**
- \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 << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority 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 Interrupt
- \details Enables a device specific interrupt in the NVIC interrupt controller.
- \param [in] IRQn Device specific interrupt number.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- }
-}
-
-
-/**
- \brief Get Interrupt Enable status
- \details Returns a device specific interrupt enable status from the NVIC interrupt controller.
- \param [in] IRQn Device specific interrupt number.
- \return 0 Interrupt is not enabled.
- \return 1 Interrupt is enabled.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
- }
- else
- {
- return(0U);
- }
-}
-
-
-/**
- \brief Disable Interrupt
- \details Disables a device specific interrupt in the NVIC interrupt controller.
- \param [in] IRQn Device specific interrupt number.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- __DSB();
- __ISB();
- }
-}
-
-
-/**
- \brief Get Pending Interrupt
- \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.
- \param [in] IRQn Device specific interrupt number.
- \return 0 Interrupt status is not pending.
- \return 1 Interrupt status is pending.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
- }
- else
- {
- return(0U);
- }
-}
-
-
-/**
- \brief Set Pending Interrupt
- \details Sets the pending bit of a device specific interrupt in the NVIC pending register.
- \param [in] IRQn Device specific interrupt number.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- }
-}
-
-
-/**
- \brief Clear Pending Interrupt
- \details Clears the pending bit of a device specific interrupt in the NVIC pending register.
- \param [in] IRQn Device specific interrupt number.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- }
-}
-
-
-/**
- \brief Get Active Interrupt
- \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.
- \param [in] IRQn Device specific interrupt number.
- \return 0 Interrupt status is not active.
- \return 1 Interrupt status is active.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
- }
- else
- {
- return(0U);
- }
-}
-
-
-#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
-/**
- \brief Get Interrupt Target State
- \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.
- \param [in] IRQn Device specific interrupt number.
- \return 0 if interrupt is assigned to Secure
- \return 1 if interrupt is assigned to Non Secure
- \note IRQn must not be negative.
- */
-__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
- }
- else
- {
- return(0U);
- }
-}
-
-
-/**
- \brief Set Interrupt Target State
- \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.
- \param [in] IRQn Device specific interrupt number.
- \return 0 if interrupt is assigned to Secure
- 1 if interrupt is assigned to Non Secure
- \note IRQn must not be negative.
- */
-__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));
- return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
- }
- else
- {
- return(0U);
- }
-}
-
-
-/**
- \brief Clear Interrupt Target State
- \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt.
- \param [in] IRQn Device specific interrupt number.
- \return 0 if interrupt is assigned to Secure
- 1 if interrupt is assigned to Non Secure
- \note IRQn must not be negative.
- */
-__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)));
- return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
- }
- else
- {
- return(0U);
- }
-}
-#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
-
-
-/**
- \brief Set Interrupt Priority
- \details Sets the priority of a device specific interrupt or a processor exception.
- The interrupt number can be positive to specify a device specific interrupt,
- or negative to specify a processor exception.
- \param [in] IRQn Interrupt number.
- \param [in] priority Priority to set.
- \note The priority cannot be set for every processor exception.
- */
-__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
- }
- else
- {
- SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
- }
-}
-
-
-/**
- \brief Get Interrupt Priority
- \details Reads the priority of a device specific interrupt or a processor exception.
- The interrupt number can be positive to specify a device specific interrupt,
- or negative to specify a processor exception.
- \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)NVIC->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS)));
- }
- else
- {
- return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (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 \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 Set Interrupt Vector
- \details Sets an interrupt vector in SRAM based interrupt vector table.
- The interrupt number can be positive to specify a device specific interrupt,
- or negative to specify a processor exception.
- VTOR must been relocated to SRAM before.
- \param [in] IRQn Interrupt number
- \param [in] vector Address of interrupt handler function
- */
-__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
-{
- uint32_t *vectors = (uint32_t *)SCB->VTOR;
- vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
-}
-
-
-/**
- \brief Get Interrupt Vector
- \details Reads an interrupt vector from interrupt vector table.
- The interrupt number can be positive to specify a device specific interrupt,
- or negative to specify a processor exception.
- \param [in] IRQn Interrupt number.
- \return Address of interrupt handler function
- */
-__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
-{
- uint32_t *vectors = (uint32_t *)SCB->VTOR;
- return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];
-}
-
-
-/**
- \brief System Reset
- \details Initiates a system reset request to reset the MCU.
- */
-__NO_RETURN __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();
- }
-}
-
-#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
-/**
- \brief Set Priority Grouping (non-secure)
- \details Sets the non-secure priority grouping field when in secure state 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 TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup)
-{
- uint32_t reg_value;
- uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
-
- reg_value = SCB_NS->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 << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */
- SCB_NS->AIRCR = reg_value;
-}
-
-
-/**
- \brief Get Priority Grouping (non-secure)
- \details Reads the priority grouping field from the non-secure NVIC when in secure state.
- \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).
- */
-__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void)
-{
- return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));
-}
-
-
-/**
- \brief Enable Interrupt (non-secure)
- \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.
- \param [in] IRQn Device specific interrupt number.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- }
-}
-
-
-/**
- \brief Get Interrupt Enable status (non-secure)
- \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state.
- \param [in] IRQn Device specific interrupt number.
- \return 0 Interrupt is not enabled.
- \return 1 Interrupt is enabled.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
- }
- else
- {
- return(0U);
- }
-}
-
-
-/**
- \brief Disable Interrupt (non-secure)
- \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state.
- \param [in] IRQn Device specific interrupt number.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- }
-}
-
-
-/**
- \brief Get Pending Interrupt (non-secure)
- \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt.
- \param [in] IRQn Device specific interrupt number.
- \return 0 Interrupt status is not pending.
- \return 1 Interrupt status is pending.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
- }
- else
- {
- return(0U);
- }
-}
-
-
-/**
- \brief Set Pending Interrupt (non-secure)
- \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.
- \param [in] IRQn Device specific interrupt number.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- }
-}
-
-
-/**
- \brief Clear Pending Interrupt (non-secure)
- \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state.
- \param [in] IRQn Device specific interrupt number.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- }
-}
-
-
-/**
- \brief Get Active Interrupt (non-secure)
- \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt.
- \param [in] IRQn Device specific interrupt number.
- \return 0 Interrupt status is not active.
- \return 1 Interrupt status is active.
- \note IRQn must not be negative.
- */
-__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
- }
- else
- {
- return(0U);
- }
-}
-
-
-/**
- \brief Set Interrupt Priority (non-secure)
- \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.
- The interrupt number can be positive to specify a device specific interrupt,
- or negative to specify a processor exception.
- \param [in] IRQn Interrupt number.
- \param [in] priority Priority to set.
- \note The priority cannot be set for every non-secure processor exception.
- */
-__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- NVIC_NS->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
- }
- else
- {
- SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
- }
-}
-
-
-/**
- \brief Get Interrupt Priority (non-secure)
- \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state.
- The interrupt number can be positive to specify a device specific interrupt,
- or negative to specify a processor exception.
- \param [in] IRQn Interrupt number.
- \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller.
- */
-__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn)
-{
-
- if ((int32_t)(IRQn) >= 0)
- {
- return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS)));
- }
- else
- {
- return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));
- }
-}
-#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */
-
-/*@} end of CMSIS_Core_NVICFunctions */
-
-/* ########################## MPU functions #################################### */
-
-#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
-
-#include "mpu_armv8.h"
-
-#endif
-
-/* ########################## FPU functions #################################### */
-/**
- \ingroup CMSIS_Core_FunctionInterface
- \defgroup CMSIS_Core_FpuFunctions FPU Functions
- \brief Function that provides FPU type.
- @{
- */
-
-/**
- \brief get FPU type
- \details returns the FPU type
- \returns
- - \b 0: No FPU
- - \b 1: Single precision FPU
- - \b 2: Double + Single precision FPU
- */
-__STATIC_INLINE uint32_t SCB_GetFPUType(void)
-{
- uint32_t mvfr0;
-
- mvfr0 = FPU->MVFR0;
- if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U)
- {
- return 2U; /* Double + Single precision FPU */
- }
- else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U)
- {
- return 1U; /* Single precision FPU */
- }
- else
- {
- return 0U; /* No FPU */
- }
-}
-
-
-/*@} end of CMSIS_Core_FpuFunctions */
-
-
-
-/* ########################## SAU functions #################################### */
-/**
- \ingroup CMSIS_Core_FunctionInterface
- \defgroup CMSIS_Core_SAUFunctions SAU Functions
- \brief Functions that configure the SAU.
- @{
- */
-
-#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
-
-/**
- \brief Enable SAU
- \details Enables the Security Attribution Unit (SAU).
- */
-__STATIC_INLINE void TZ_SAU_Enable(void)
-{
- SAU->CTRL |= (SAU_CTRL_ENABLE_Msk);
-}
-
-
-
-/**
- \brief Disable SAU
- \details Disables the Security Attribution Unit (SAU).
- */
-__STATIC_INLINE void TZ_SAU_Disable(void)
-{
- SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk);
-}
-
-#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
-
-/*@} end of CMSIS_Core_SAUFunctions */
-
-
-
-
-/* ################################## SysTick function ############################################ */
-/**
- \ingroup CMSIS_Core_FunctionInterface
- \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
- \brief Functions that configure the System.
- @{
- */
-
-#if defined (__Vendor_SysTickConfig) && (__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 <b>__Vendor_SysTickConfig</b> is set to 1, then the
- function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
- 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 */
-}
-
-#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
-/**
- \brief System Tick Configuration (non-secure)
- \details Initializes the non-secure System Timer and its interrupt when in secure state, 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 <b>__Vendor_SysTickConfig</b> is set to 1, then the
- function <b>TZ_SysTick_Config_NS</b> is not included. In this case, the file <b><i>device</i>.h</b>
- must contain a vendor-specific implementation of this function.
-
- */
-__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks)
-{
- if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
- {
- return (1UL); /* Reload value impossible */
- }
-
- SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
- TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
- SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */
- SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
- SysTick_CTRL_TICKINT_Msk |
- SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
- return (0UL); /* Function successful */
-}
-#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
-
-#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 ((int32_t)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_CM33_H_DEPENDANT */
-
-#endif /* __CMSIS_GENERIC */
diff --git a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/mpu_armv8.h b/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/mpu_armv8.h
deleted file mode 100755
index bc3b0510..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/mpu_armv8.h
+++ /dev/null
@@ -1,347 +0,0 @@
-/******************************************************************************
- * @file mpu_armv8.h
- * @brief CMSIS MPU API for Armv8-M and Armv8.1-M MPU
- * @version V5.1.0
- * @date 08. March 2019
- ******************************************************************************/
-/*
- * Copyright (c) 2017-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
- *
- * 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.
- */
- /* Copyright (c) 2019 Modified by Dialog Semiconductor */
-
-#if defined ( __ICCARM__ )
- #pragma system_include /* treat file as system include file for MISRA check */
-#elif defined (__clang__)
- #pragma clang system_header /* treat file as system include file */
-#endif
-
-#ifndef ARM_MPU_ARMV8_H
-#define ARM_MPU_ARMV8_H
-
-/** \brief Attribute for device memory (outer only) */
-#define ARM_MPU_ATTR_DEVICE ( 0U )
-
-/** \brief Attribute for non-cacheable, normal memory */
-#define ARM_MPU_ATTR_NON_CACHEABLE ( 4U )
-
-/** \brief Attribute for normal memory (outer and inner)
-* \param NT Non-Transient: Set to 1 for non-transient data.
-* \param WB Write-Back: Set to 1 to use write-back update policy.
-* \param RA Read Allocation: Set to 1 to use cache allocation on read miss.
-* \param WA Write Allocation: Set to 1 to use cache allocation on write miss.
-*/
-#define ARM_MPU_ATTR_MEMORY_(NT, WB, RA, WA) \
- (((NT & 1U) << 3U) | ((WB & 1U) << 2U) | ((RA & 1U) << 1U) | (WA & 1U))
-
-/** \brief Device memory type non Gathering, non Re-ordering, non Early Write Acknowledgement */
-#define ARM_MPU_ATTR_DEVICE_nGnRnE (0U)
-
-/** \brief Device memory type non Gathering, non Re-ordering, Early Write Acknowledgement */
-#define ARM_MPU_ATTR_DEVICE_nGnRE (1U)
-
-/** \brief Device memory type non Gathering, Re-ordering, Early Write Acknowledgement */
-#define ARM_MPU_ATTR_DEVICE_nGRE (2U)
-
-/** \brief Device memory type Gathering, Re-ordering, Early Write Acknowledgement */
-#define ARM_MPU_ATTR_DEVICE_GRE (3U)
-
-/** \brief Memory Attribute
-* \param O Outer memory attributes
-* \param I O == ARM_MPU_ATTR_DEVICE: Device memory attributes, else: Inner memory attributes
-*/
-#define ARM_MPU_ATTR(O, I) (((O & 0xFU) << 4U) | (((O & 0xFU) != 0U) ? (I & 0xFU) : ((I & 0x3U) << 2U)))
-
-/** \brief Normal memory non-shareable */
-#define ARM_MPU_SH_NON (0U)
-
-/** \brief Normal memory outer shareable */
-#define ARM_MPU_SH_OUTER (2U)
-
-/** \brief Normal memory inner shareable */
-#define ARM_MPU_SH_INNER (3U)
-
-/** \brief Memory access permissions
-* \param RO Read-Only: Set to 1 for read-only memory.
-* \param NP Non-Privileged: Set to 1 for non-privileged memory.
-*/
-#define ARM_MPU_AP_(RO, NP) (((RO & 1U) << 1U) | (NP & 1U))
-
-/** \brief Region Base Address Register value
-* \param BASE The base address bits [31:5] of a memory region. The value is zero extended. Effective address gets 32 byte aligned.
-* \param SH Defines the Shareability domain for this memory region.
-* \param RO Read-Only: Set to 1 for a read-only memory region.
-* \param NP Non-Privileged: Set to 1 for a non-privileged memory region.
-* \param XN eXecute Never: Set to 1 for a non-executable memory region.
-*/
-#define ARM_MPU_RBAR(BASE, SH, RO, NP, XN) \
- ((BASE & MPU_RBAR_BASE_Msk) | \
- ((SH << MPU_RBAR_SH_Pos) & MPU_RBAR_SH_Msk) | \
- ((ARM_MPU_AP_(RO, NP) << MPU_RBAR_AP_Pos) & MPU_RBAR_AP_Msk) | \
- ((XN << MPU_RBAR_XN_Pos) & MPU_RBAR_XN_Msk))
-
-/** \brief Region Limit Address Register value
-* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended.
-* \param IDX The attribute index to be associated with this memory region.
-*/
-#define ARM_MPU_RLAR(LIMIT, IDX) \
- ((LIMIT & MPU_RLAR_LIMIT_Msk) | \
- ((IDX << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \
- (MPU_RLAR_EN_Msk))
-
-#if defined(MPU_RLAR_PXN_Pos)
-
-/** \brief Region Limit Address Register with PXN value
-* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended.
-* \param PXN Privileged execute never. Defines whether code can be executed from this privileged region.
-* \param IDX The attribute index to be associated with this memory region.
-*/
-#define ARM_MPU_RLAR_PXN(LIMIT, PXN, IDX) \
- ((LIMIT & MPU_RLAR_LIMIT_Msk) | \
- ((PXN << MPU_RLAR_PXN_Pos) & MPU_RLAR_PXN_Msk) | \
- ((IDX << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \
- (MPU_RLAR_EN_Msk))
-
-#endif
-
-/**
-* Struct for a single MPU Region
-*/
-typedef struct {
- uint32_t RBAR; /*!< Region Base Address Register value */
- uint32_t RLAR; /*!< Region Limit Address Register value */
-} ARM_MPU_Region_t;
-
-/** Enable the MPU.
-* \param MPU_Control Default access permissions for unconfigured regions.
-*/
-__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control)
-{
- MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
-#ifdef SCB_SHCSR_MEMFAULTENA_Msk
- SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
-#endif
- __DSB();
- __ISB();
-}
-
-/** Disable the MPU.
-*/
-__STATIC_INLINE void ARM_MPU_Disable(void)
-{
- __DMB();
-#ifdef SCB_SHCSR_MEMFAULTENA_Msk
- SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
-#endif
- MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk;
-}
-
-#ifdef MPU_NS
-/** Enable the Non-secure MPU.
-* \param MPU_Control Default access permissions for unconfigured regions.
-*/
-__STATIC_INLINE void ARM_MPU_Enable_NS(uint32_t MPU_Control)
-{
- MPU_NS->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
-#ifdef SCB_SHCSR_MEMFAULTENA_Msk
- SCB_NS->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
-#endif
- __DSB();
- __ISB();
-}
-
-/** Disable the Non-secure MPU.
-*/
-__STATIC_INLINE void ARM_MPU_Disable_NS(void)
-{
- __DMB();
-#ifdef SCB_SHCSR_MEMFAULTENA_Msk
- SCB_NS->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
-#endif
- MPU_NS->CTRL &= ~MPU_CTRL_ENABLE_Msk;
-}
-#endif
-
-/** Set the memory attribute encoding to the given MPU.
-* \param mpu Pointer to the MPU to be configured.
-* \param idx The attribute index to be set [0-7]
-* \param attr The attribute value to be set.
-*/
-__STATIC_INLINE void ARM_MPU_SetMemAttrEx(MPU_Type* mpu, uint8_t idx, uint8_t attr)
-{
- const uint8_t reg = idx / 4U;
- const uint32_t pos = ((idx % 4U) * 8U);
- const uint32_t mask = 0xFFU << pos;
-
- if (reg >= (sizeof(mpu->MAIR) / sizeof(mpu->MAIR[0]))) {
- return; // invalid index
- }
-
- mpu->MAIR[reg] = ((mpu->MAIR[reg] & ~mask) | ((attr << pos) & mask));
-}
-
-/** Set the memory attribute encoding.
-* \param idx The attribute index to be set [0-7]
-* \param attr The attribute value to be set.
-*/
-__STATIC_INLINE void ARM_MPU_SetMemAttr(uint8_t idx, uint8_t attr)
-{
- ARM_MPU_SetMemAttrEx(MPU, idx, attr);
-}
-
-#ifdef MPU_NS
-/** Set the memory attribute encoding to the Non-secure MPU.
-* \param idx The attribute index to be set [0-7]
-* \param attr The attribute value to be set.
-*/
-__STATIC_INLINE void ARM_MPU_SetMemAttr_NS(uint8_t idx, uint8_t attr)
-{
- ARM_MPU_SetMemAttrEx(MPU_NS, idx, attr);
-}
-#endif
-
-/** Clear and disable the given MPU region of the given MPU.
-* \param mpu Pointer to MPU to be used.
-* \param rnr Region number to be cleared.
-*/
-__STATIC_INLINE void ARM_MPU_ClrRegionEx(MPU_Type* mpu, uint32_t rnr)
-{
- mpu->RNR = rnr;
- mpu->RLAR = 0U;
-}
-
-/** Clear and disable the given MPU region.
-* \param rnr Region number to be cleared.
-*/
-__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr)
-{
- ARM_MPU_ClrRegionEx(MPU, rnr);
-}
-
-#ifdef MPU_NS
-/** Clear and disable the given Non-secure MPU region.
-* \param rnr Region number to be cleared.
-*/
-__STATIC_INLINE void ARM_MPU_ClrRegion_NS(uint32_t rnr)
-{
- ARM_MPU_ClrRegionEx(MPU_NS, rnr);
-}
-#endif
-
-/** Configure the given MPU region of the given MPU.
-* \param mpu Pointer to MPU to be used.
-* \param rnr Region number to be configured.
-* \param rbar Value for RBAR register.
-* \param rlar Value for RLAR register.
-*/
-__STATIC_INLINE void ARM_MPU_SetRegionEx(MPU_Type* mpu, uint32_t rnr, uint32_t rbar, uint32_t rlar)
-{
- mpu->RNR = rnr;
- mpu->RBAR = rbar;
- mpu->RLAR = rlar;
-}
-
-/** Configure the given MPU region.
-* \param rnr Region number to be configured.
-* \param rbar Value for RBAR register.
-* \param rlar Value for RLAR register.
-*/
-__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rnr, uint32_t rbar, uint32_t rlar)
-{
- ARM_MPU_SetRegionEx(MPU, rnr, rbar, rlar);
-}
-
-#ifdef MPU_NS
-/** Configure the given Non-secure MPU region.
-* \param rnr Region number to be configured.
-* \param rbar Value for RBAR register.
-* \param rlar Value for RLAR register.
-*/
-__STATIC_INLINE void ARM_MPU_SetRegion_NS(uint32_t rnr, uint32_t rbar, uint32_t rlar)
-{
- ARM_MPU_SetRegionEx(MPU_NS, rnr, rbar, rlar);
-}
-#endif
-
-/** Memcopy with strictly ordered memory access, e.g. for register targets.
-* \param dst Destination data is copied to.
-* \param src Source data is copied from.
-* \param len Amount of data words to be copied.
-*/
-__STATIC_INLINE void ARM_MPU_OrderedMemcpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len)
-{
- uint32_t i;
- for (i = 0U; i < len; ++i)
- {
- dst[i] = src[i];
- }
-}
-
-/** Load the given number of MPU regions from a table to the given MPU.
-* \param mpu Pointer to the MPU registers to be used.
-* \param rnr First region number to be configured.
-* \param table Pointer to the MPU configuration table.
-* \param cnt Amount of regions to be configured.
-*/
-__STATIC_INLINE void ARM_MPU_LoadEx(MPU_Type* mpu, uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt)
-{
- const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U;
- if (cnt == 1U) {
- mpu->RNR = rnr;
- ARM_MPU_OrderedMemcpy(&(mpu->RBAR), &(table->RBAR), rowWordSize);
- } else {
- uint32_t rnrBase = rnr & ~(MPU_TYPE_RALIASES-1U);
- uint32_t rnrOffset = rnr % MPU_TYPE_RALIASES;
-
- mpu->RNR = rnrBase;
- while ((rnrOffset + cnt) > MPU_TYPE_RALIASES) {
- uint32_t c = MPU_TYPE_RALIASES - rnrOffset;
- ARM_MPU_OrderedMemcpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), c*rowWordSize);
- table += c;
- cnt -= c;
- rnrOffset = 0U;
- rnrBase += MPU_TYPE_RALIASES;
- mpu->RNR = rnrBase;
- }
-
- ARM_MPU_OrderedMemcpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), cnt*rowWordSize);
- }
-}
-
-/** Load the given number of MPU regions from a table.
-* \param rnr First region number to be configured.
-* \param table Pointer to the MPU configuration table.
-* \param cnt Amount of regions to be configured.
-*/
-__STATIC_INLINE void ARM_MPU_Load(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt)
-{
- ARM_MPU_LoadEx(MPU, rnr, table, cnt);
-}
-
-#ifdef MPU_NS
-/** Load the given number of MPU regions from a table to the Non-secure MPU.
-* \param rnr First region number to be configured.
-* \param table Pointer to the MPU configuration table.
-* \param cnt Amount of regions to be configured.
-*/
-__STATIC_INLINE void ARM_MPU_Load_NS(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt)
-{
- ARM_MPU_LoadEx(MPU_NS, rnr, table, cnt);
-}
-#endif
-
-#endif
-
diff --git a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/system_ARMCM0.h b/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/system_ARMCM0.h
deleted file mode 100755
index 7fe7e914..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/system_ARMCM0.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/**************************************************************************//**
- * @file system_ARMCM0.h
- * @brief CMSIS Device System Header File for
- * ARMCM0 Device
- * @version V5.3.1
- * @date 09. July 2018
- ******************************************************************************/
-/*
- * Copyright (c) 2009-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
- *
- * www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SYSTEM_ARMCM0_H
-#define SYSTEM_ARMCM0_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
-
-
-/**
- \brief Setup the microcontroller system.
-
- Initialize the System and update the SystemCoreClock variable.
- */
-extern void SystemInit (void);
-
-
-/**
- \brief Update SystemCoreClock variable.
-
- Updates the SystemCoreClock with current core Clock retrieved from cpu registers.
- */
-extern void SystemCoreClockUpdate (void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SYSTEM_ARMCM0_H */
diff --git a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/system_DA1469x.h b/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/system_DA1469x.h
deleted file mode 100755
index 6c53ee9a..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/SDK_10.0.8.105/sdk/bsp/include/system_DA1469x.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/**************************************************************************//**
- * @file system_DA1469x.h
- * @brief CMSIS Device System Header File for DA1469x Device
- * @version V5.3.1
- * @date 17. May 2019
- ******************************************************************************/
-/*
- * Copyright (c) 2009-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
- *
- * 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.
- */
-/* Copyright (c) 2017 Modified by Dialog Semiconductor */
-
-
-#ifndef SYSTEM_DA1469x_H
-#define SYSTEM_DA1469x_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-#include <stdbool.h>
-
-extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
-
-
-/**
- \brief Setup the microcontroller system.
-
- Initialize the System and update the SystemCoreClock variable.
- */
-extern void SystemInit (void);
-
-
-/**
- \brief Update SystemCoreClock variable.
- Updates the SystemCoreClock with current core Clock retrieved from cpu registers.
- */
-extern void SystemCoreClockUpdate (void);
-
-/**
- * \brief Convert a CPU address to a physical address
- *
- * To calculate the physical address, the current remapping (SYS_CTRL_REG.REMAP_ADR0)
- * is used.
- *
- * \param [in] addr address seen by CPU
- *
- * \return physical address (for DMA, AES/HASH etc.) -- can be same or different as addr
- *
- */
-extern uint32_t black_orca_phy_addr(uint32_t addr);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SYSTEM_DA1469x_H */
diff --git a/tinyusb/hw/mcu/dialog/da1469x/da1469x.ld b/tinyusb/hw/mcu/dialog/da1469x/da1469x.ld
deleted file mode 100755
index c91dea84..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/da1469x.ld
+++ /dev/null
@@ -1,228 +0,0 @@
-/* Linker script for Dialog DA1469x devices
- *
- * Version: Sourcery G++ 4.5-1
- * Support: https://support.codesourcery.com/GNUToolchain/
- *
- * Copyright (c) 2007, 2008, 2009, 2010 CodeSourcery, Inc.
- *
- * The authors hereby grant permission to use, copy, modify, distribute,
- * and license this software and its documentation for any purpose, provided
- * that existing copyright notices are retained in all copies and that this
- * notice is included verbatim in any distributions. No written agreement,
- * license, or royalty fee is required for any of the authorized uses.
- * Modifications to this software may be copyrighted by their authors
- * and need not follow the licensing terms described here, provided that
- * the new terms are clearly indicated on the first page of each file where
- * they apply.
- */
-OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
-
-/* Linker script to place sections and symbol values. Should be used together
- * with other linker script that defines memory regions FLASH and RAM.
- * It references following symbols, which must be defined in code:
- * Reset_Handler : Entry of reset handler
- *
- * It defines following symbols, which code can use without definition:
- * __exidx_start
- * __exidx_end
- * __etext
- * __data_start__
- * __preinit_array_start
- * __preinit_array_end
- * __init_array_start
- * __init_array_end
- * __fini_array_start
- * __fini_array_end
- * __data_end__
- * __bss_start__
- * __bss_end__
- * __HeapBase
- * __HeapLimit
- * __StackLimit
- * __StackTop
- * __stack
- * __bssnz_start__
- * __bssnz_end__
- */
-ENTRY(Reset_Handler)
-
-SECTIONS
-{
- .imghdr (NOLOAD):
- {
- . = . + _imghdr_size;
- } > FLASH
-
- __text = .;
-
- .text :
- {
- __isr_vector_start = .;
- KEEP(*(.isr_vector))
- /* ISR vector shall have exactly 512 bytes */
- . = __isr_vector_start + 0x200;
- __isr_vector_end = .;
-
- *(.text)
- *(.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*)
-
- *(.eh_frame*)
- . = ALIGN(4);
- } > FLASH
-
- .ARM.extab :
- {
- *(.ARM.extab* .gnu.linkonce.armextab.*)
- . = ALIGN(4);
- } > FLASH
-
- __exidx_start = .;
- .ARM.exidx :
- {
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- . = ALIGN(4);
- } > FLASH
- __exidx_end = .;
-
- .intvect :
- {
- . = ALIGN(4);
- __intvect_start__ = .;
- . = . + (__isr_vector_end - __isr_vector_start);
- . = ALIGN(4);
- } > RAM
-
- .sleep_state (NOLOAD) :
- {
- . = ALIGN(4);
- *(sleep_state)
- } > RAM
-
- /* This section will be zeroed by RTT package init */
- .rtt (NOLOAD):
- {
- . = ALIGN(4);
- *(.rtt)
- . = ALIGN(4);
- } > RAM
-
- __text_ram_addr = LOADADDR(.text_ram);
-
- .text_ram :
- {
- . = ALIGN(4);
- __text_ram_start__ = .;
- *(.text_ram*)
- . = ALIGN(4);
- __text_ram_end__ = .;
- } > RAM AT > FLASH
-
- __etext = LOADADDR(.data);
-
- .data :
- {
- __data_start__ = .;
- *(vtable)
- *(.data*)
-
- . = ALIGN(4);
- /* preinit data */
- PROVIDE_HIDDEN (__preinit_array_start = .);
- *(.preinit_array)
- PROVIDE_HIDDEN (__preinit_array_end = .);
-
- . = ALIGN(4);
- /* init data */
- PROVIDE_HIDDEN (__init_array_start = .);
- *(SORT(.init_array.*))
- *(.init_array)
- PROVIDE_HIDDEN (__init_array_end = .);
-
-
- . = ALIGN(4);
- /* finit data */
- PROVIDE_HIDDEN (__fini_array_start = .);
- *(SORT(.fini_array.*))
- *(.fini_array)
- PROVIDE_HIDDEN (__fini_array_end = .);
-
- *(.jcr)
- . = ALIGN(4);
- /* All data end */
- __data_end__ = .;
- } > RAM AT > FLASH
-
- .bssnz :
- {
- . = ALIGN(4);
- __bssnz_start__ = .;
- *(.bss.core.nz*)
- . = ALIGN(4);
- __bssnz_end__ = .;
- } > RAM
-
- .bss :
- {
- . = ALIGN(4);
- __bss_start__ = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4);
- __bss_end__ = .;
- } > RAM
-
- .cmac (NOLOAD) :
- {
- . = ALIGN(0x400);
- *(.libcmac.ram)
- } > RAM
-
- /* Heap starts after BSS */
- . = ALIGN(8);
- __HeapBase = .;
-
- /* .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):
- {
- *(.stack*)
- } > RAM
-
- _ram_start = ORIGIN(RAM);
-
- /* 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);
-
- /* Top of head is the bottom of the stack */
- __HeapLimit = __StackLimit;
-
- /* Check if data + heap + stack exceeds RAM limit */
- ASSERT(__HeapBase <= __HeapLimit, "region RAM overflowed with stack")
-
- /* Check that intvect is at the beginning of RAM */
- ASSERT(__intvect_start__ == ORIGIN(RAM), "intvect is not at beginning of RAM")
-}
-
diff --git a/tinyusb/hw/mcu/dialog/da1469x/include/hal/hal_gpio.h b/tinyusb/hw/mcu/dialog/da1469x/include/hal/hal_gpio.h
deleted file mode 100755
index 67fc3c14..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/include/hal/hal_gpio.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-
-/**
- * @addtogroup HAL
- * @{
- * @defgroup HALGpio HAL GPIO
- * @{
- */
-
-#ifndef H_HAL_GPIO_
-#define H_HAL_GPIO_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * The "mode" of the gpio. The gpio is either an input, output, or it is
- * "not connected" (the pin specified is not functioning as a gpio)
- */
-enum hal_gpio_mode_e {
- /** Not connected */
- HAL_GPIO_MODE_NC = -1,
- /** Input */
- HAL_GPIO_MODE_IN = 0,
- /** Output */
- HAL_GPIO_MODE_OUT = 1
-};
-typedef enum hal_gpio_mode_e hal_gpio_mode_t;
-
-/*
- * The "pull" of the gpio. This is either an input or an output.
- */
-enum hal_gpio_pull {
- /** Pull-up/down not enabled */
- HAL_GPIO_PULL_NONE = 0,
- /** Pull-up enabled */
- HAL_GPIO_PULL_UP = 1,
- /** Pull-down enabled */
- HAL_GPIO_PULL_DOWN = 2
-};
-typedef enum hal_gpio_pull hal_gpio_pull_t;
-
-/*
- * IRQ trigger type.
- */
-enum hal_gpio_irq_trigger {
- HAL_GPIO_TRIG_NONE = 0,
- /** IRQ occurs on rising edge */
- HAL_GPIO_TRIG_RISING = 1,
- /** IRQ occurs on falling edge */
- HAL_GPIO_TRIG_FALLING = 2,
- /** IRQ occurs on either edge */
- HAL_GPIO_TRIG_BOTH = 3,
- /** IRQ occurs when line is low */
- HAL_GPIO_TRIG_LOW = 4,
- /** IRQ occurs when line is high */
- HAL_GPIO_TRIG_HIGH = 5
-};
-typedef enum hal_gpio_irq_trigger hal_gpio_irq_trig_t;
-
-/* Function proto for GPIO irq handler functions */
-typedef void (*hal_gpio_irq_handler_t)(void *arg);
-
-/**
- * Initializes the specified pin as an input
- *
- * @param pin Pin number to set as input
- * @param pull pull type
- *
- * @return int 0: no error; -1 otherwise.
- */
-int hal_gpio_init_in(int pin, hal_gpio_pull_t pull);
-
-/**
- * Initialize the specified pin as an output, setting the pin to the specified
- * value.
- *
- * @param pin Pin number to set as output
- * @param val Value to set pin
- *
- * @return int 0: no error; -1 otherwise.
- */
-int hal_gpio_init_out(int pin, int val);
-
-/**
- * Deinitialize the specified pin to revert the previous initialization
- *
- * @param pin Pin number to unset
- *
- * @return int 0: no error; -1 otherwise.
- */
-int hal_gpio_deinit(int pin);
-
-/**
- * Write a value (either high or low) to the specified pin.
- *
- * @param pin Pin to set
- * @param val Value to set pin (0:low 1:high)
- */
-void hal_gpio_write(int pin, int val);
-
-/**
- * Reads the specified pin.
- *
- * @param pin Pin number to read
- *
- * @return int 0: low, 1: high
- */
-int hal_gpio_read(int pin);
-
-/**
- * Toggles the specified pin
- *
- * @param pin Pin number to toggle
- *
- * @return current gpio state int 0: low, 1: high
- */
-int hal_gpio_toggle(int pin);
-
-/**
- * Initialize a given pin to trigger a GPIO IRQ callback.
- *
- * @param pin The pin to trigger GPIO interrupt on
- * @param handler The handler function to call
- * @param arg The argument to provide to the IRQ handler
- * @param trig The trigger mode (e.g. rising, falling)
- * @param pull The mode of the pin (e.g. pullup, pulldown)
- *
- * @return 0 on success, non-zero error code on failure.
- */
-int hal_gpio_irq_init(int pin, hal_gpio_irq_handler_t handler, void *arg,
- hal_gpio_irq_trig_t trig, hal_gpio_pull_t pull);
-
-/**
- * Release a pin from being configured to trigger IRQ on state change.
- *
- * @param pin The pin to release
- */
-void hal_gpio_irq_release(int pin);
-
-/**
- * Enable IRQs on the passed pin
- *
- * @param pin The pin to enable IRQs on
- */
-void hal_gpio_irq_enable(int pin);
-
-/**
- * Disable IRQs on the passed pin
- *
- * @param pin The pin to disable IRQs on
- */
-void hal_gpio_irq_disable(int pin);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_HAL_GPIO_ */
-
-/**
- * @} HALGpio
- * @} HAL
- */
diff --git a/tinyusb/hw/mcu/dialog/da1469x/include/mcu/da1469x_clock.h b/tinyusb/hw/mcu/dialog/da1469x/include/mcu/da1469x_clock.h
deleted file mode 100755
index 3c697747..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/include/mcu/da1469x_clock.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef __MCU_DA1469X_CLOCK_H_
-#define __MCU_DA1469X_CLOCK_H_
-
-#include <stdint.h>
-#include "mcu/da1469x_hal.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Initialize XTAL32M
- */
-void da1469x_clock_sys_xtal32m_init(void);
-
-/**
- * Enable XTAL32M
- */
-void da1469x_clock_sys_xtal32m_enable(void);
-
-/**
- * Wait for XTAL32M to settle
- */
-void da1469x_clock_sys_xtal32m_wait_to_settle(void);
-
-/**
- * Switch sys_clk to XTAL32M
- *
- * Caller shall ensure that XTAL32M is already settled.
- */
-void da1469x_clock_sys_xtal32m_switch(void);
-
-/**
- * Switch sys_clk to XTAL32M
- *
- * Waits for XTAL32M to settle before switching.
- */
-void da1469x_clock_sys_xtal32m_switch_safe(void);
-
-/**
- * Disable RC32M
- */
-void da1469x_clock_sys_rc32m_disable(void);
-
-/**
- * Enable AMBA clock(s)
- *
- * @param mask
- */
-static inline void
-da1469x_clock_amba_enable(uint32_t mask)
-{
- uint32_t primask;
-
- __HAL_DISABLE_INTERRUPTS(primask);
- CRG_TOP->CLK_AMBA_REG |= mask;
- __HAL_ENABLE_INTERRUPTS(primask);
-}
-
-/**
- * Disable AMBA clock(s)
- *
- * @param uint32_t mask
- */
-static inline void
-da1469x_clock_amba_disable(uint32_t mask)
-{
- uint32_t primask;
-
- __HAL_DISABLE_INTERRUPTS(primask);
- CRG_TOP->CLK_AMBA_REG &= ~mask;
- __HAL_ENABLE_INTERRUPTS(primask);
-}
-
-/**
- * Enable PLL96
- */
-static inline void
-da1469x_clock_sys_pll_enable(void)
-{
- CRG_XTAL->PLL_SYS_CTRL1_REG |= CRG_XTAL_PLL_SYS_CTRL1_REG_PLL_EN_Msk |
- CRG_XTAL_PLL_SYS_CTRL1_REG_LDO_PLL_ENABLE_Msk;
-}
-
-/**
- * Disable PLL96
- *
- * If PLL was used as SYS_CLOCK switches to XTAL32M.
- */
-void da1469x_clock_sys_pll_disable(void);
-
-/**
- * Checks whether PLL96 is locked and can be use as system clock or USB clock
- *
- * @return 0 if PLL is off, non-0 it its running
- */
-static inline int
-da1469x_clock_is_pll_locked(void)
-{
- return 0 != (CRG_XTAL->PLL_SYS_STATUS_REG & CRG_XTAL_PLL_SYS_STATUS_REG_PLL_LOCK_FINE_Msk);
-}
-
-/**
- * Waits for PLL96 to lock.
- */
-void da1469x_clock_pll_wait_to_lock(void);
-
-/**
- * Switches system clock to PLL96
- *
- * Caller shall ensure that PLL is already locked.
- */
-void da1469x_clock_sys_pll_switch(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __MCU_DA1469X_CLOCK_H_ */
diff --git a/tinyusb/hw/mcu/dialog/da1469x/include/mcu/da1469x_hal.h b/tinyusb/hw/mcu/dialog/da1469x/include/mcu/da1469x_hal.h
deleted file mode 100755
index 28fa1aa8..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/include/mcu/da1469x_hal.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef __MCU_DA1469X_HAL_H_
-#define __MCU_DA1469X_HAL_H_
-
-#include <assert.h>
-#include "mcu/mcu.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Helper functions to enable/disable interrupts. */
-#define __HAL_DISABLE_INTERRUPTS(x) \
- do { \
- x = __get_PRIMASK(); \
- __disable_irq(); \
- } while (0)
-
-#define __HAL_ENABLE_INTERRUPTS(x) \
- do { \
- if (!x) { \
- __enable_irq(); \
- } \
- } while (0)
-
-#define __HAL_ASSERT_CRITICAL() \
- do { \
- assert(__get_PRIMASK() & 1); \
- } while (0)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __MCU_DA1469X_HAL_H_ */
diff --git a/tinyusb/hw/mcu/dialog/da1469x/include/mcu/mcu.h b/tinyusb/hw/mcu/dialog/da1469x/include/mcu/mcu.h
deleted file mode 100755
index 1e673678..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/include/mcu/mcu.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef __MCU_MCU_H_
-#define __MCU_MCU_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "DA1469xAB.h"
-
-#define sec_text_ram_core __attribute__((section(".text_ram"))) __attribute__((noinline))
-
-#define MCU_SYSVIEW_INTERRUPTS \
- "I#1=Reset,I#2=MNI,I#3=HardFault,I#4=MemoryMgmt,I#5=BusFault,I#6=UsageFault," \
- "I#7=SecureFault,I#11=SVCall,I#12=DebugMonitor,I#14=PendSV,I#15=SysTick," \
- "I#16=SENSOR_NODE,I#17=DMA,I#18=CHARGER_STATE,I#19=CHARGER_ERROR," \
- "I#20=CMAC2SYS,I#21=UART,I#22=UART2,I#23=UART3,I#24=I2C,I#25=I2C2,I#26=SPI," \
- "I#27=SPI2,I#28=PCM,I#29=SRC_IN,I#30=SRC_OUT,I#31=USB,I#32=TIMER," \
- "I#33=TIMER2,I#34=RTC,I#35=KEY_WKUP_GPIO,I#36=PDC,I#37=VBUS,I#38=MRM," \
- "I#39=MOTOR_CONTROLLER,I#40=TRNG,I#41=DCDC,I#42=XTAL32M_RDY,I#43=ADC," \
- "I#44=ADC2,I#45=CRYPTO,I#46=CAPTIMER1,I#47=RFDIAG,I#48=LCD_CONTROLLER," \
- "I#49=PLL_LOCK,I#50=TIMER3,I#51=TIMER4,I#52=LRA,I#53=RTC_EVENT," \
- "I#54=GPIO_P0,I#55=GPIO_P1"
-
-/**
-* \brief GPIO function
-*
-*/
-typedef enum {
- MCU_GPIO_FUNC_GPIO = 0, /**< GPIO */
- MCU_GPIO_FUNC_UART_RX = 1, /**< GPIO as UART RX */
- MCU_GPIO_FUNC_UART_TX = 2, /**< GPIO as UART TX */
- MCU_GPIO_FUNC_UART2_RX = 3, /**< GPIO as UART2 RX */
- MCU_GPIO_FUNC_UART2_TX = 4, /**< GPIO as UART2 TX */
- MCU_GPIO_FUNC_UART2_CTSN = 5, /**< GPIO as UART2 CTSN */
- MCU_GPIO_FUNC_UART2_RTSN = 6, /**< GPIO as UART2 RTSN */
- MCU_GPIO_FUNC_UART3_RX = 7, /**< GPIO as UART3 RX */
- MCU_GPIO_FUNC_UART3_TX = 8, /**< GPIO as UART3 TX */
- MCU_GPIO_FUNC_UART3_CTSN = 9, /**< GPIO as UART3 CTSN */
- MCU_GPIO_FUNC_UART3_RTSN = 10, /**< GPIO as UART3 RTSN */
- MCU_GPIO_FUNC_ISO_CLK = 11, /**< GPIO as ISO CLK */
- MCU_GPIO_FUNC_ISO_DATA = 12, /**< GPIO as ISO DATA */
- MCU_GPIO_FUNC_SPI_DI = 13, /**< GPIO as SPI DI */
- MCU_GPIO_FUNC_SPI_DO = 14, /**< GPIO as SPI DO */
- MCU_GPIO_FUNC_SPI_CLK = 15, /**< GPIO as SPI CLK */
- MCU_GPIO_FUNC_SPI_EN = 16, /**< GPIO as SPI EN */
- MCU_GPIO_FUNC_SPI2_DI = 17, /**< GPIO as SPI2 DI */
- MCU_GPIO_FUNC_SPI2_DO = 18, /**< GPIO as SPI2 DO */
- MCU_GPIO_FUNC_SPI2_CLK = 19, /**< GPIO as SPI2 CLK */
- MCU_GPIO_FUNC_SPI2_EN = 20, /**< GPIO as SPI2 EN */
- MCU_GPIO_FUNC_I2C_SCL = 21, /**< GPIO as I2C SCL */
- MCU_GPIO_FUNC_I2C_SDA = 22, /**< GPIO as I2C SDA */
- MCU_GPIO_FUNC_I2C2_SCL = 23, /**< GPIO as I2C2 SCL */
- MCU_GPIO_FUNC_I2C2_SDA = 24, /**< GPIO as I2C2 SDA */
- MCU_GPIO_FUNC_USB_SOF = 25, /**< GPIO as USB SOF */
- MCU_GPIO_FUNC_ADC = 26, /**< GPIO as ADC (dedicated pin) */
- MCU_GPIO_FUNC_USB = 27, /**< GPIO as USB */
- MCU_GPIO_FUNC_PCM_DI = 28, /**< GPIO as PCM DI */
- MCU_GPIO_FUNC_PCM_DO = 29, /**< GPIO as PCM DO */
- MCU_GPIO_FUNC_PCM_FSC = 30, /**< GPIO as PCM FSC */
- MCU_GPIO_FUNC_PCM_CLK = 31, /**< GPIO as PCM CLK */
- MCU_GPIO_FUNC_PDM_DATA = 32, /**< GPIO as PDM DATA */
- MCU_GPIO_FUNC_PDM_CLK = 33, /**< GPIO as PDM CLK */
- MCU_GPIO_FUNC_COEX_EXT_ACT = 34, /**< GPIO as COEX EXT ACT0 */
- MCU_GPIO_FUNC_COEX_SMART_ACT = 35, /**< GPIO as COEX SMART ACT */
- MCU_GPIO_FUNC_COEX_SMART_PRI = 36, /**< GPIO as COEX SMART PRI */
- MCU_GPIO_FUNC_PORT0_DCF = 37, /**< GPIO as PORT0 DCF */
- MCU_GPIO_FUNC_PORT1_DCF = 38, /**< GPIO as PORT1 DCF */
- MCU_GPIO_FUNC_PORT2_DCF = 39, /**< GPIO as PORT2 DCF */
- MCU_GPIO_FUNC_PORT3_DCF = 40, /**< GPIO as PORT3 DCF */
- MCU_GPIO_FUNC_PORT4_DCF = 41, /**< GPIO as PORT4 DCF */
- MCU_GPIO_FUNC_CLOCK = 42, /**< GPIO as CLOCK */
- MCU_GPIO_FUNC_PG = 43, /**< GPIO as PG */
- MCU_GPIO_FUNC_LCD = 44, /**< GPIO as LCD */
- MCU_GPIO_FUNC_LCD_SPI_DC = 45, /**< GPIO as LCD SPI DC */
- MCU_GPIO_FUNC_LCD_SPI_DO = 46, /**< GPIO as LCD SPI DO */
- MCU_GPIO_FUNC_LCD_SPI_CLK = 47, /**< GPIO as LCD SPI CLK */
- MCU_GPIO_FUNC_LCD_SPI_EN = 48, /**< GPIO as LCD SPI EN */
- MCU_GPIO_FUNC_TIM_PWM = 49, /**< GPIO as TIM PWM */
- MCU_GPIO_FUNC_TIM2_PWM = 50, /**< GPIO as TIM2 PWM */
- MCU_GPIO_FUNC_TIM_1SHOT = 51, /**< GPIO as TIM 1SHOT */
- MCU_GPIO_FUNC_TIM2_1SHOT = 52, /**< GPIO as TIM2 1SHOT */
- MCU_GPIO_FUNC_TIM3_PWM = 53, /**< GPIO as TIM3 PWM */
- MCU_GPIO_FUNC_TIM4_PWM = 54, /**< GPIO as TIM4 PWM */
- MCU_GPIO_FUNC_AGC_EXT = 55, /**< GPIO as AGC EXT */
- MCU_GPIO_FUNC_CMAC_DIAG0 = 56, /**< GPIO as CMAC DIAG0 */
- MCU_GPIO_FUNC_CMAC_DIAG1 = 57, /**< GPIO as CMAC DIAG1 */
- MCU_GPIO_FUNC_CMAC_DIAG2 = 58, /**< GPIO as CMAC DIAG2 */
- MCU_GPIO_FUNC_CMAC_DIAGX = 59, /**< GPIO as CMAC DIAGX */
- MCU_GPIO_FUNC_LAST,
-} mcu_gpio_func;
-
-#define MCU_GPIO_MODE_INPUT 0x000 /**< GPIO as an input */
-#define MCU_GPIO_MODE_INPUT_PULLUP 0x100 /**< GPIO as an input with pull-up */
-#define MCU_GPIO_MODE_INPUT_PULLDOWN 0x200 /**< GPIO as an input with pull-down */
-#define MCU_GPIO_MODE_OUTPUT 0x300 /**< GPIO as an output */
-#define MCU_GPIO_MODE_OUTPUT_OPEN_DRAIN 0x700 /**< GPIO as an open-drain output */
-
-#define MCU_GPIO_PORT0_PIN_COUNT 32
-#define MCU_GPIO_PORT0(pin) ((0 * 32) + (pin))
-#define MCU_GPIO_PORT1(pin) ((1 * 32) + (pin))
-#define MCU_DMA_CHAN_MAX 8
-
-#define MCU_PIN_GPADC_SEL0 MCU_GPIO_PORT1(9)
-#define MCU_PIN_GPADC_SEL1 MCU_GPIO_PORT0(25)
-#define MCU_PIN_GPADC_SEL2 MCU_GPIO_PORT0(8)
-#define MCU_PIN_GPADC_SEL3 MCU_GPIO_PORT0(9)
-#define MCU_PIN_GPADC_SEL16 MCU_GPIO_PORT1(13)
-#define MCU_PIN_GPADC_SEL17 MCU_GPIO_PORT1(12)
-#define MCU_PIN_GPADC_SEL18 MCU_GPIO_PORT1(18)
-#define MCU_PIN_GPADC_SEL19 MCU_GPIO_PORT1(19)
-#define MCU_PIN_GPADC_DIFF0_P0 MCU_GPIO_PORT1(9)
-#define MCU_PIN_GPADC_DIFF0_P1 MCU_GPIO_PORT0(25)
-#define MCU_PIN_GPADC_DIFF1_P0 MCU_GPIO_PORT0(8)
-#define MCU_PIN_GPADC_DIFF1_P1 MCU_GPIO_PORT0(9)
-
-#define MCU_PIN_SDADC0 MCU_GPIO_PORT1(9)
-#define MCU_PIN_SDADC1 MCU_GPIO_PORT0(25)
-#define MCU_PIN_SDADC2 MCU_GPIO_PORT0(8)
-#define MCU_PIN_SDADC3 MCU_GPIO_PORT0(9)
-#define MCU_PIN_SDADC4 MCU_GPIO_PORT1(14)
-#define MCU_PIN_SDADC5 MCU_GPIO_PORT1(20)
-#define MCU_PIN_SDADC6 MCU_GPIO_PORT1(21)
-#define MCU_PIN_SDADC7 MCU_GPIO_PORT1(22)
-
-void mcu_gpio_set_pin_function(int pin, int mode, mcu_gpio_func func);
-void mcu_gpio_enter_sleep(void);
-void mcu_gpio_exit_sleep(void);
-
-#define MCU_MEM_QSPIF_M_END_REMAP_ADDRESS (0x800000)
-#define MCU_MEM_QSPIF_M_START_ADDRESS (0x16000000)
-#define MCU_MEM_QSPIF_M_END_ADDRESS (0x18000000)
-#define MCU_MEM_SYSRAM_START_ADDRESS (0x20000000)
-#define MCU_MEM_SYSRAM_END_ADDRESS (0x20080000)
-
-#define MCU_OTPM_BASE 0x30080000UL
-#define MCU_OTPM_SIZE 4096
-
-/* Largest group id seen on a DA14699 was 18 so far */
-#define MCU_TRIMV_GROUP_ID_MAX (18)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __MCU_MCU_H_ */
-
diff --git a/tinyusb/hw/mcu/dialog/da1469x/src/da1469x_clock.c b/tinyusb/hw/mcu/dialog/da1469x/src/da1469x_clock.c
deleted file mode 100755
index 6b4f0e6c..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/src/da1469x_clock.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include "syscfg/syscfg.h"
-#include "mcu/da1469x_hal.h"
-#include "mcu/da1469x_clock.h"
-
-static inline bool
-da1469x_clock_is_xtal32m_settled(void)
-{
- return ((*(uint32_t *)0x5001001c & 0xff00) == 0) &&
- ((*(uint32_t *)0x50010054 & 0x000f) != 0xb);
-}
-
-void
-da1469x_clock_sys_xtal32m_init(void)
-{
- uint32_t reg;
- int xtalrdy_cnt;
-
- /* Number of lp_clk cycles (~30.5us) */
- xtalrdy_cnt = MYNEWT_VAL(MCU_CLOCK_XTAL32M_SETTLE_TIME_US) * 10 / 305;
-
- reg = CRG_XTAL->XTALRDY_CTRL_REG;
- reg &= ~(CRG_XTAL_XTALRDY_CTRL_REG_XTALRDY_CLK_SEL_Msk |
- CRG_XTAL_XTALRDY_CTRL_REG_XTALRDY_CNT_Msk);
- reg |= xtalrdy_cnt;
- CRG_XTAL->XTALRDY_CTRL_REG = reg;
-}
-
-void
-da1469x_clock_sys_xtal32m_enable(void)
-{
- PDC->PDC_CTRL0_REG = (2 << PDC_PDC_CTRL0_REG_TRIG_SELECT_Pos) |
- (15 << PDC_PDC_CTRL0_REG_TRIG_ID_Pos) |
- (1 << PDC_PDC_CTRL0_REG_PDC_MASTER_Pos) |
- (1 << PDC_PDC_CTRL0_REG_EN_XTAL_Pos);
-
- PDC->PDC_SET_PENDING_REG = 0;
- PDC->PDC_ACKNOWLEDGE_REG = 0;
-}
-
-void
-da1469x_clock_sys_xtal32m_switch(void)
-{
- if (CRG_TOP->CLK_CTRL_REG & CRG_TOP_CLK_CTRL_REG_RUNNING_AT_RC32M_Msk) {
- CRG_TOP->CLK_SWITCH2XTAL_REG = CRG_TOP_CLK_SWITCH2XTAL_REG_SWITCH2XTAL_Msk;
- } else {
- CRG_TOP->CLK_CTRL_REG &= ~CRG_TOP_CLK_CTRL_REG_SYS_CLK_SEL_Msk;
- }
-
- while (!(CRG_TOP->CLK_CTRL_REG & CRG_TOP_CLK_CTRL_REG_RUNNING_AT_XTAL32M_Msk));
-}
-
-void
-da1469x_clock_sys_xtal32m_wait_to_settle(void)
-{
- uint32_t primask;
-
- __HAL_DISABLE_INTERRUPTS(primask);
-
- NVIC_ClearPendingIRQ(XTAL32M_RDY_IRQn);
-
- if (!da1469x_clock_is_xtal32m_settled()) {
- NVIC_EnableIRQ(XTAL32M_RDY_IRQn);
- while (!NVIC_GetPendingIRQ(XTAL32M_RDY_IRQn)) {
- __WFI();
- }
- NVIC_DisableIRQ(XTAL32M_RDY_IRQn);
- }
-
- __HAL_ENABLE_INTERRUPTS(primask);
-}
-
-void
-da1469x_clock_sys_xtal32m_switch_safe(void)
-{
- da1469x_clock_sys_xtal32m_wait_to_settle();
-
- da1469x_clock_sys_xtal32m_switch();
-}
-
-void
-da1469x_clock_sys_rc32m_disable(void)
-{
- CRG_TOP->CLK_RC32M_REG &= ~CRG_TOP_CLK_RC32M_REG_RC32M_ENABLE_Msk;
-}
-
-void
-da1469x_clock_lp_xtal32k_enable(void)
-{
- CRG_TOP->CLK_XTAL32K_REG |= CRG_TOP_CLK_XTAL32K_REG_XTAL32K_ENABLE_Msk;
-}
-
-void
-da1469x_clock_lp_xtal32k_switch(void)
-{
- CRG_TOP->CLK_CTRL_REG = (CRG_TOP->CLK_CTRL_REG &
- ~CRG_TOP_CLK_CTRL_REG_LP_CLK_SEL_Msk) |
- (2 << CRG_TOP_CLK_CTRL_REG_LP_CLK_SEL_Pos);
-}
-
-void
-da1469x_clock_pll_disable(void)
-{
- while (CRG_TOP->CLK_CTRL_REG & CRG_TOP_CLK_CTRL_REG_RUNNING_AT_PLL96M_Msk) {
- CRG_TOP->CLK_SWITCH2XTAL_REG = CRG_TOP_CLK_SWITCH2XTAL_REG_SWITCH2XTAL_Msk;
- }
-
- CRG_XTAL->PLL_SYS_CTRL1_REG &= ~CRG_XTAL_PLL_SYS_CTRL1_REG_PLL_EN_Msk;
-}
-
-void
-da1469x_clock_pll_wait_to_lock(void)
-{
- uint32_t primask;
-
- __HAL_DISABLE_INTERRUPTS(primask);
-
- NVIC_ClearPendingIRQ(PLL_LOCK_IRQn);
-
- if (!da1469x_clock_is_pll_locked()) {
- NVIC_EnableIRQ(PLL_LOCK_IRQn);
- while (!NVIC_GetPendingIRQ(PLL_LOCK_IRQn)) {
- __WFI();
- }
- NVIC_DisableIRQ(PLL_LOCK_IRQn);
- }
-
- __HAL_ENABLE_INTERRUPTS(primask);
-}
-
-void
-da1469x_clock_sys_pll_switch(void)
-{
- /* CLK_SEL_Msk == 3 means PLL */
- CRG_TOP->CLK_CTRL_REG |= CRG_TOP_CLK_CTRL_REG_SYS_CLK_SEL_Msk;
-
- while (!(CRG_TOP->CLK_CTRL_REG & CRG_TOP_CLK_CTRL_REG_RUNNING_AT_PLL96M_Msk));
-}
diff --git a/tinyusb/hw/mcu/dialog/da1469x/src/hal_gpio.c b/tinyusb/hw/mcu/dialog/da1469x/src/hal_gpio.c
deleted file mode 100755
index e105cf2b..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/src/hal_gpio.c
+++ /dev/null
@@ -1,478 +0,0 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <stddef.h>
-#include "syscfg/syscfg.h"
-#include "mcu/da1469x_hal.h"
-#include <mcu/mcu.h>
-#include "hal/hal_gpio.h"
-
-/* GPIO interrupts */
-#define HAL_GPIO_MAX_IRQ MYNEWT_VAL(MCU_GPIO_MAX_IRQ)
-
-#define GPIO_REG(name) ((__IO uint32_t *)(GPIO_BASE + offsetof(GPIO_Type, name)))
-#define WAKEUP_REG(name) ((__IO uint32_t *)(WAKEUP_BASE + offsetof(WAKEUP_Type, name)))
-#define CRG_TOP_REG(name) ((__IO uint32_t *)(CRG_TOP_BASE + offsetof(CRG_TOP_Type, name)))
-
-#ifndef MCU_GPIO_PORT0_PIN_COUNT
-#define MCU_GPIO_PORT0_PIN_COUNT 32
-#endif
-
-#if (MCU_GPIO_PORT0_PIN_COUNT) == 32
-#define GPIO_PORT(pin) (((unsigned)(pin)) >> 5U)
-#define GPIO_PORT_PIN(pin) (((unsigned)(pin)) & 31U)
-#else
-#define GPIO_PORT(pin) (((unsigned)(pin)) < MCU_GPIO_PORT0_PIN_COUNT ? 0 : 1)
-#define GPIO_PORT_PIN(pin) ((unsigned)(pin) < MCU_GPIO_PORT0_PIN_COUNT ? \
- (pin) : (pin) - MCU_GPIO_PORT0_PIN_COUNT)
-#endif
-
-#define GPIO_PIN_BIT(pin) (1 << GPIO_PORT_PIN(pin))
-
-#define GPIO_PIN_DATA_REG_ADDR(pin) (GPIO_REG(P0_DATA_REG) + GPIO_PORT(pin))
-#define GPIO_PIN_DATA_REG(pin) *GPIO_PIN_DATA_REG_ADDR(pin)
-#define GPIO_PIN_SET_DATA_REG_ADDR(pin) (GPIO_REG(P0_SET_DATA_REG) + GPIO_PORT(pin))
-#define GPIO_PIN_SET_DATA_REG(pin) *GPIO_PIN_SET_DATA_REG_ADDR(pin)
-#define GPIO_PIN_RESET_DATA_REG_ADDR(pin) (GPIO_REG(P0_RESET_DATA_REG) + GPIO_PORT(pin))
-#define GPIO_PIN_RESET_DATA_REG(pin) *GPIO_PIN_RESET_DATA_REG_ADDR(pin)
-#define GPIO_PIN_MODE_REG_ADDR(pin) (GPIO_REG(P0_00_MODE_REG) + (pin))
-#define GPIO_PIN_MODE_REG(pin) *GPIO_PIN_MODE_REG_ADDR(pin)
-#define GPIO_PIN_PADPWR_CTRL_REG_ADDR(pin) (GPIO_REG(P0_PADPWR_CTRL_REG) + GPIO_PORT(pin))
-#define GPIO_PIN_PADPWR_CTRL_REG(pin) *GPIO_PIN_PADPWR_CTRL_REG_ADDR(pin)
-#define GPIO_PIN_UNLATCH_ADDR(pin) (CRG_TOP_REG(P0_SET_PAD_LATCH_REG) + GPIO_PORT(pin) * 3)
-#define GPIO_PIN_LATCH_ADDR(pin) (CRG_TOP_REG(P0_RESET_PAD_LATCH_REG) + GPIO_PORT(pin) * 3)
-
-#define WKUP_CTRL_REG_ADDR (WAKEUP_REG(WKUP_CTRL_REG))
-#define WKUP_RESET_IRQ_REG_ADDR (WAKEUP_REG(WKUP_RESET_IRQ_REG))
-#define WKUP_SELECT_PX_REG_ADDR(pin) (WAKEUP_REG(WKUP_SELECT_P0_REG) + GPIO_PORT(pin))
-#define WKUP_SELECT_PX_REG(pin) *(WKUP_SELECT_PX_REG_ADDR(pin))
-#define WKUP_POL_PX_REG_ADDR(pin) (WAKEUP_REG(WKUP_POL_P0_REG) + GPIO_PORT(pin))
-#define WKUP_POL_PX_SET_FALLING(pin) do { *(WKUP_POL_PX_REG_ADDR(pin)) |= GPIO_PIN_BIT(pin); } while (0)
-#define WKUP_POL_PX_SET_RISING(pin) do { *(WKUP_POL_PX_REG_ADDR(pin)) &= ~GPIO_PIN_BIT(pin); } while (0)
-#define WKUP_STAT_PX_REG_ADDR(pin) (WAKEUP_REG(WKUP_STATUS_P0_REG) + GPIO_PORT(pin))
-#define WKUP_STAT(pin) ((*(WKUP_STAT_PX_REG_ADDR(pin)) >> GPIO_PORT_PIN(pin)) & 1)
-#define WKUP_CLEAR_PX_REG_ADDR(pin) (WAKEUP_REG(WKUP_CLEAR_P0_REG) + GPIO_PORT(pin))
-#define WKUP_CLEAR_PX(pin) do { (*(WKUP_CLEAR_PX_REG_ADDR(pin)) = GPIO_PIN_BIT(pin)); } while (0)
-#define WKUP_SEL_GPIO_PX_REG_ADDR(pin) (WAKEUP_REG(WKUP_SEL_GPIO_P0_REG) + GPIO_PORT(pin))
-#define WKUP_SEL_GPIO_PX_REG(pin) *(WKUP_SEL_GPIO_PX_REG_ADDR(pin))
-
-/* Storage for GPIO callbacks. */
-struct hal_gpio_irq {
- int pin;
- hal_gpio_irq_handler_t func;
- void *arg;
-};
-
-static struct hal_gpio_irq hal_gpio_irqs[HAL_GPIO_MAX_IRQ];
-
-#if MYNEWT_VAL(MCU_GPIO_RETAINABLE_NUM) >= 0
-static uint32_t g_mcu_gpio_latch_state[2];
-static uint8_t g_mcu_gpio_retained_num;
-static struct da1469x_retreg g_mcu_gpio_retained[MYNEWT_VAL(MCU_GPIO_RETAINABLE_NUM)];
-#endif
-
-/*
- * We assume that any latched pin has default configuration, i.e. was either
- * not configured or was deinited. Any unlatched pin is considered to be used
- * by someone.
- *
- * By default, all pins are assumed to have default configuration and are
- * latched. This allows PD_COM to be disabled (if no other peripheral needs
- * it) since we do not need GPIO mux to be active.
- *
- * Configuration of any pin shall be done as follows, with interrupts disabled:
- * 1. call mcu_gpio_unlatch_prepare() to enable PD_COM if needed
- * 2. configure pin
- * 3. call mcu_gpio_unlatch() to actually unlatch pin
- *
- * Once pin is restored to default configuration it shall be latched again by
- * calling mcu_gpio_latch().
- */
-
-#if MYNEWT_VAL(MCU_GPIO_RETAINABLE_NUM) >= 0
-static void
-mcu_gpio_retained_add_port(uint32_t latch_val, volatile uint32_t *base_reg)
-{
- struct da1469x_retreg *retreg;
- int pin;
-
- retreg = &g_mcu_gpio_retained[g_mcu_gpio_retained_num];
-
- while (latch_val) {
- assert(g_mcu_gpio_retained_num < MYNEWT_VAL(MCU_GPIO_RETAINABLE_NUM));
-
- pin = __builtin_ctz(latch_val);
- latch_val &= ~(1 << pin);
-
- da1469x_retreg_assign(retreg, &base_reg[pin]);
-
- g_mcu_gpio_retained_num++;
- retreg++;
- }
-}
-#endif
-
-static void
-mcu_gpio_retained_refresh(void)
-{
-#if MYNEWT_VAL(MCU_GPIO_RETAINABLE_NUM) >= 0
- g_mcu_gpio_retained_num = 0;
-
- mcu_gpio_retained_add_port(CRG_TOP->P0_PAD_LATCH_REG, &GPIO->P0_00_MODE_REG);
- mcu_gpio_retained_add_port(CRG_TOP->P1_PAD_LATCH_REG, &GPIO->P1_00_MODE_REG);
-#endif
-}
-
-static inline void
-mcu_gpio_unlatch_prepare(int pin)
-{
- __HAL_ASSERT_CRITICAL();
- (void)pin;
-
- /* Acquire PD_COM if first pin will be unlatched */
-// if ((CRG_TOP->P0_PAD_LATCH_REG | CRG_TOP->P1_PAD_LATCH_REG) == 0) {
-// da1469x_pd_acquire(MCU_PD_DOMAIN_COM);
-// }
-}
-
-static inline void
-mcu_gpio_unlatch(int pin)
-{
- __HAL_ASSERT_CRITICAL();
-
- *GPIO_PIN_UNLATCH_ADDR(pin) = GPIO_PIN_BIT(pin);
- mcu_gpio_retained_refresh();
-}
-
-static inline void
-mcu_gpio_latch(int pin)
-{
- (void)pin;
-// uint32_t primask;
-// uint32_t latch_pre;
-// uint32_t latch_post;
-//
-// __HAL_DISABLE_INTERRUPTS(primask);
-//
-// latch_pre = CRG_TOP->P0_PAD_LATCH_REG | CRG_TOP->P1_PAD_LATCH_REG;
-//
-// *GPIO_PIN_LATCH_ADDR(pin) = GPIO_PIN_BIT(pin);
-// mcu_gpio_retained_refresh();
-//
-// latch_post = CRG_TOP->P0_PAD_LATCH_REG | CRG_TOP->P1_PAD_LATCH_REG;
-//
-// /* Release PD_COM if last pin was latched */
-// if (latch_pre && !latch_post) {
-// da1469x_pd_release(MCU_PD_DOMAIN_COM);
-// }
-//
-// __HAL_ENABLE_INTERRUPTS(primask);
-}
-
-int
-hal_gpio_init_in(int pin, hal_gpio_pull_t pull)
-{
- volatile uint32_t *px_xx_mod_reg = GPIO_PIN_MODE_REG_ADDR(pin);
- uint32_t regval;
- uint32_t primask;
-
- switch (pull) {
- case HAL_GPIO_PULL_UP:
- regval = MCU_GPIO_FUNC_GPIO | MCU_GPIO_MODE_INPUT_PULLUP;
- break;
- case HAL_GPIO_PULL_DOWN:
- regval = MCU_GPIO_FUNC_GPIO | MCU_GPIO_MODE_INPUT_PULLDOWN;
- break;
- case HAL_GPIO_PULL_NONE:
- regval = MCU_GPIO_FUNC_GPIO | MCU_GPIO_MODE_INPUT;
- break;
- default:
- return -1;
- }
-
- __HAL_DISABLE_INTERRUPTS(primask);
-
- mcu_gpio_unlatch_prepare(pin);
-
- *px_xx_mod_reg = regval;
-
- mcu_gpio_unlatch(pin);
-
- __HAL_ENABLE_INTERRUPTS(primask);
-
- return 0;
-}
-
-int
-hal_gpio_init_out(int pin, int val)
-{
- uint32_t primask;
-
- __HAL_DISABLE_INTERRUPTS(primask);
-
- mcu_gpio_unlatch_prepare(pin);
-
- GPIO_PIN_MODE_REG(pin) = MCU_GPIO_MODE_OUTPUT;
-
- if (val) {
- GPIO_PIN_SET_DATA_REG(pin) = GPIO_PIN_BIT(pin);
- } else {
- GPIO_PIN_RESET_DATA_REG(pin) = GPIO_PIN_BIT(pin);
- }
-
- mcu_gpio_unlatch(pin);
-
- __HAL_ENABLE_INTERRUPTS(primask);
-
- return 0;
-}
-
-int
-hal_gpio_deinit(int pin)
-{
- /* Reset mode to default value and latch pin */
- GPIO_PIN_MODE_REG(pin) = 0x200;
- GPIO_PIN_RESET_DATA_REG(pin) = GPIO_PIN_BIT(pin);
-
- mcu_gpio_latch(pin);
-
- return 0;
-}
-
-void
-hal_gpio_write(int pin, int val)
-{
- if (val) {
- GPIO_PIN_SET_DATA_REG(pin) = GPIO_PIN_BIT(pin);
- } else {
- GPIO_PIN_RESET_DATA_REG(pin) = GPIO_PIN_BIT(pin);
- }
-}
-
-int
-hal_gpio_read(int pin)
-{
- return (GPIO_PIN_DATA_REG(pin) >> GPIO_PORT_PIN(pin)) & 1;
-}
-
-int
-hal_gpio_toggle(int pin)
-{
- int new_value = hal_gpio_read(pin) == 0;
-
- hal_gpio_write(pin, new_value);
-
- return new_value;
-}
-
-static void
-hal_gpio_irq_handler(void)
-{
- struct hal_gpio_irq *irq;
- uint32_t stat;
- int i;
-
- *WKUP_RESET_IRQ_REG_ADDR = 1;
- NVIC_ClearPendingIRQ(KEY_WKUP_GPIO_IRQn);
-
- for (i = 0; i < HAL_GPIO_MAX_IRQ; i++) {
- irq = &hal_gpio_irqs[i];
-
- /* Read latched status value from relevant GPIO port */
- stat = WKUP_STAT(irq->pin);
-
- if (irq->func && stat) {
- irq->func(irq->arg);
- }
-
- WKUP_CLEAR_PX(irq->pin);
- }
-}
-
-static void
-hal_gpio_irq_setup(void)
-{
- static uint8_t irq_setup;
- int sr;
-
- if (!irq_setup) {
- __HAL_DISABLE_INTERRUPTS(sr);
-
- irq_setup = 1;
-
- NVIC_ClearPendingIRQ(GPIO_P0_IRQn);
- NVIC_ClearPendingIRQ(GPIO_P1_IRQn);
- NVIC_SetVector(GPIO_P0_IRQn, (uint32_t)hal_gpio_irq_handler);
- NVIC_SetVector(GPIO_P1_IRQn, (uint32_t)hal_gpio_irq_handler);
- WAKEUP->WKUP_CTRL_REG = 0;
- WAKEUP->WKUP_CLEAR_P0_REG = 0xFFFFFFFF;
- WAKEUP->WKUP_CLEAR_P1_REG = 0x007FFFFF;
- WAKEUP->WKUP_SELECT_P0_REG = 0;
- WAKEUP->WKUP_SELECT_P1_REG = 0;
- WAKEUP->WKUP_SEL_GPIO_P0_REG = 0;
- WAKEUP->WKUP_SEL_GPIO_P1_REG = 0;
- WAKEUP->WKUP_RESET_IRQ_REG = 0;
-
- CRG_TOP->CLK_TMR_REG |= CRG_TOP_CLK_TMR_REG_WAKEUPCT_ENABLE_Msk;
-
- __HAL_ENABLE_INTERRUPTS(sr);
- NVIC_EnableIRQ(GPIO_P0_IRQn);
- NVIC_EnableIRQ(GPIO_P1_IRQn);
- }
-}
-
-static int
-hal_gpio_find_empty_slot(void)
-{
- int i;
-
- for (i = 0; i < HAL_GPIO_MAX_IRQ; i++) {
- if (hal_gpio_irqs[i].func == NULL) {
- return i;
- }
- }
-
- return -1;
-}
-
-int
-hal_gpio_irq_init(int pin, hal_gpio_irq_handler_t handler, void *arg,
- hal_gpio_irq_trig_t trig, hal_gpio_pull_t pull)
-{
- int i;
-
- hal_gpio_irq_setup();
-
- i = hal_gpio_find_empty_slot();
- /* If assert failed increase syscfg value MCU_GPIO_MAX_IRQ */
- assert(i >= 0);
- if (i < 0) {
- return -1;
- }
-
- hal_gpio_init_in(pin, pull);
-
- switch (trig) {
- case HAL_GPIO_TRIG_RISING:
- WKUP_POL_PX_SET_RISING(pin);
- break;
- case HAL_GPIO_TRIG_FALLING:
- WKUP_POL_PX_SET_FALLING(pin);
- break;
- case HAL_GPIO_TRIG_BOTH:
- /* Not supported */
- default:
- return -1;
- }
-
- hal_gpio_irqs[i].pin = pin;
- hal_gpio_irqs[i].func = handler;
- hal_gpio_irqs[i].arg = arg;
-
- return 0;
-}
-
-void
-hal_gpio_irq_release(int pin)
-{
- int i;
-
- hal_gpio_irq_disable(pin);
-
- for (i = 0; i < HAL_GPIO_MAX_IRQ; i++) {
- if (hal_gpio_irqs[i].pin == pin && hal_gpio_irqs[i].func) {
- hal_gpio_irqs[i].pin = -1;
- hal_gpio_irqs[i].arg = NULL;
- hal_gpio_irqs[i].func = NULL;
- }
- }
-}
-
-void
-hal_gpio_irq_enable(int pin)
-{
- WKUP_SEL_GPIO_PX_REG(pin) |= GPIO_PIN_BIT(pin);
-}
-
-void
-hal_gpio_irq_disable(int pin)
-{
- WKUP_SEL_GPIO_PX_REG(pin) &= ~GPIO_PIN_BIT(pin);
- WKUP_CLEAR_PX(pin);
-}
-
-void
-mcu_gpio_set_pin_function(int pin, int mode, mcu_gpio_func func)
-{
- uint32_t primask;
-
- __HAL_DISABLE_INTERRUPTS(primask);
-
- mcu_gpio_unlatch_prepare(pin);
-
- GPIO_PIN_MODE_REG(pin) = (func & GPIO_P0_00_MODE_REG_PID_Msk) |
- (mode & (GPIO_P0_00_MODE_REG_PUPD_Msk | GPIO_P0_00_MODE_REG_PPOD_Msk));
-
- mcu_gpio_unlatch(pin);
-
- __HAL_ENABLE_INTERRUPTS(primask);
-}
-
-void
-mcu_gpio_enter_sleep(void)
-{
-#if MYNEWT_VAL(MCU_GPIO_RETAINABLE_NUM) >= 0
- if (g_mcu_gpio_retained_num == 0) {
- return;
- }
-
- g_mcu_gpio_latch_state[0] = CRG_TOP->P0_PAD_LATCH_REG;
- g_mcu_gpio_latch_state[1] = CRG_TOP->P1_PAD_LATCH_REG;
-
- da1469x_retreg_update(g_mcu_gpio_retained, g_mcu_gpio_retained_num);
-
- CRG_TOP->P0_RESET_PAD_LATCH_REG = CRG_TOP_P0_PAD_LATCH_REG_P0_LATCH_EN_Msk;
- CRG_TOP->P1_RESET_PAD_LATCH_REG = CRG_TOP_P1_PAD_LATCH_REG_P1_LATCH_EN_Msk;
-
- da1469x_pd_release(MCU_PD_DOMAIN_COM);
-#endif
-}
-
-void
-mcu_gpio_exit_sleep(void)
-{
-#if MYNEWT_VAL(MCU_GPIO_RETAINABLE_NUM) >= 0
- if (g_mcu_gpio_retained_num == 0) {
- return;
- }
-
- da1469x_pd_acquire(MCU_PD_DOMAIN_COM);
-
- da1469x_retreg_restore(g_mcu_gpio_retained, g_mcu_gpio_retained_num);
-
- /* Set pins states to their latched values */
- GPIO->P0_DATA_REG = GPIO->P0_DATA_REG;
- GPIO->P1_DATA_REG = GPIO->P1_DATA_REG;
-
- CRG_TOP->P0_PAD_LATCH_REG = g_mcu_gpio_latch_state[0];
- CRG_TOP->P1_PAD_LATCH_REG = g_mcu_gpio_latch_state[1];
-#endif
-}
diff --git a/tinyusb/hw/mcu/dialog/da1469x/src/hal_system.c b/tinyusb/hw/mcu/dialog/da1469x/src/hal_system.c
deleted file mode 100755
index 2841979f..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/src/hal_system.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include "syscfg/syscfg.h"
-#include "mcu/da1469x_clock.h"
-#include "mcu/da1469x_lpclk.h"
-#include "mcu/da1469x_pd.h"
-#include "mcu/da1469x_pdc.h"
-#include "mcu/da1469x_prail.h"
-#include "hal/hal_system.h"
-#include "os/os_cputime.h"
-
-#if !MYNEWT_VAL(BOOT_LOADER)
-static enum hal_reset_reason g_hal_reset_reason;
-#endif
-
-void
-hal_system_init(void)
-{
-#if MYNEWT_VAL(MCU_DCDC_ENABLE)
- da1469x_prail_dcdc_enable();
-#endif
-
- /*
- * RESET_STAT_REG has to be cleared to allow HW set bits during next reset
- * so we should read it now and keep result for application to check at any
- * time. This does not happen for bootloader since reading reset reason in
- * bootloader would prevent application from reading it.
- */
-
-#if !MYNEWT_VAL(BOOT_LOADER)
- uint32_t reg;
-
- reg = CRG_TOP->RESET_STAT_REG;
- CRG_TOP->RESET_STAT_REG = 0;
-
- if (reg & CRG_TOP_RESET_STAT_REG_PORESET_STAT_Msk) {
- g_hal_reset_reason = HAL_RESET_POR;
- } else if (reg & CRG_TOP_RESET_STAT_REG_WDOGRESET_STAT_Msk) {
- g_hal_reset_reason = HAL_RESET_WATCHDOG;
- } else if (reg & CRG_TOP_RESET_STAT_REG_SWRESET_STAT_Msk) {
- g_hal_reset_reason = HAL_RESET_SOFT;
- } else if (reg & CRG_TOP_RESET_STAT_REG_HWRESET_STAT_Msk) {
- g_hal_reset_reason = HAL_RESET_PIN;
- } else {
- g_hal_reset_reason = 0;
- }
-#endif
-}
-
-void
-hal_system_reset(void)
-{
-
-#if MYNEWT_VAL(HAL_SYSTEM_RESET_CB)
- hal_system_reset_cb();
-#endif
-
- while (1) {
- HAL_DEBUG_BREAK();
- CRG_TOP->SYS_CTRL_REG = 0x20;
- NVIC_SystemReset();
- }
-}
-
-int
-hal_debugger_connected(void)
-{
- return CRG_TOP->SYS_STAT_REG & CRG_TOP_SYS_STAT_REG_DBG_IS_ACTIVE_Msk;
-}
-
-void
-hal_system_clock_start(void)
-{
- /* Reset clock dividers to 0 */
- CRG_TOP->CLK_AMBA_REG &= ~(CRG_TOP_CLK_AMBA_REG_HCLK_DIV_Msk | CRG_TOP_CLK_AMBA_REG_PCLK_DIV_Msk);
-
- /* PD_TIM is already started in SystemInit */
-
- da1469x_clock_sys_xtal32m_init();
- da1469x_clock_sys_xtal32m_enable();
-#if MYNEWT_VAL(MCU_PLL_ENABLE)
- da1469x_clock_sys_pll_enable();
-#endif
-#if MYNEWT_VAL_CHOICE(MCU_SYSCLK_SOURCE, PLL96)
- da1469x_clock_pll_wait_to_lock();
- da1469x_clock_sys_pll_switch();
-#endif
-#if MYNEWT_VAL_CHOICE(MCU_SYSCLK_SOURCE, XTAL32M)
- /* Switch to XTAL32M and disable RC32M */
- da1469x_clock_sys_xtal32m_switch_safe();
-#endif
- da1469x_clock_sys_rc32m_disable();
-
-#if MYNEWT_VAL_CHOICE(MCU_LPCLK_SOURCE, RCX)
- /* Switch to RCX and calibrate it */
- da1469x_clock_lp_rcx_enable();
- da1469x_clock_lp_rcx_switch();
- da1469x_clock_lp_rcx_calibrate();
- da1469x_lpclk_enabled();
-#else
- /*
- * We cannot switch lp_clk to XTAL32K here since it needs some time to
- * settle, so we just disable RCX (we don't need it) and then we'll handle
- * switch to XTAL32K from sysinit since we need os_cputime for this.
- */
- da1469x_clock_lp_rcx_disable();
-#endif
-}
-
-enum hal_reset_reason
-hal_reset_cause(void)
-{
-#if MYNEWT_VAL(BOOT_LOADER)
- return 0;
-#else
- return g_hal_reset_reason;
-#endif
-}
diff --git a/tinyusb/hw/mcu/dialog/da1469x/src/hal_system_start.c b/tinyusb/hw/mcu/dialog/da1469x/src/hal_system_start.c
deleted file mode 100755
index bd246504..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/src/hal_system_start.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <stdint.h>
-#include "mcu/mcu.h"
-#include "mcu/da1469x_hal.h"
-#include <flash_map/flash_map.h>
-#include <mcu/da1469x_clock.h>
-#if MCUBOOT_MYNEWT
-#include "bootutil/bootutil.h"
-#include "bootutil/image.h"
-#include "bootutil/bootutil_log.h"
-#include "mcu/da1469x_dma.h"
-#include "mcu/da1469x_otp.h"
-#endif
-
-#if MYNEWT_VAL(BOOT_CUSTOM_START) && MCUBOOT_MYNEWT
-sec_text_ram_core
-#endif
-void __attribute__((naked))
-hal_system_start(void *img_start)
-{
- uint32_t img_data_addr;
- uint32_t *img_data;
-
- img_data_addr = MCU_MEM_QSPIF_M_START_ADDRESS + (uint32_t)img_start;
-
- assert(img_data_addr < MCU_MEM_QSPIF_M_END_ADDRESS);
-
- img_data = (uint32_t *)img_data_addr;
-
- asm volatile (".syntax unified \n"
- /* 1st word is stack pointer */
- " msr msp, %0 \n"
- /* 2nd word is a reset handler (image entry) */
- " bx %1 \n"
- : /* no output */
- : "r" (img_data[0]), "r" (img_data[1]));
-}
-
-void
-hal_system_restart(void *img_start)
-{
- uint32_t primask __attribute__((unused));
- int i;
-
- /*
- * Disable interrupts, and leave them disabled.
- * They get re-enabled when system starts coming back again.
- */
- __HAL_DISABLE_INTERRUPTS(primask);
-
- for (i = 0; i < sizeof(NVIC->ICER) / sizeof(NVIC->ICER[0]); i++) {
- NVIC->ICER[i] = 0xffffffff;
- }
-
- hal_system_start(img_start);
-}
-
-#if MYNEWT_VAL(BOOT_CUSTOM_START) && MCUBOOT_MYNEWT
-#define IMAGE_TLV_AES_NONCE 0x50
-#define IMAGE_TLV_SECRET_ID 0x60
-
-sec_text_ram_core void
-boot_custom_start(uintptr_t flash_base, struct boot_rsp *rsp)
-{
- int rc;
- struct image_tlv_iter it;
- const struct flash_area *fap;
- uint32_t off;
- uint16_t len;
- uint16_t type;
- uint8_t buf[8];
- uint8_t key;
- uint32_t nonce[2];
- bool has_aes_nonce;
- bool has_secret_id;
- DMA_Type *dma_regs = DMA;
- uint32_t jump_offset = rsp->br_image_off + rsp->br_hdr->ih_hdr_size;
-
- BOOT_LOG_INF("Custom initialization");
-
- /* skip to booting if we are running nonsecure mode */
- if (!(CRG_TOP->SECURE_BOOT_REG & 0x1)) {
- hal_system_start((void *)(flash_base + jump_offset));
- }
-
- rc = flash_area_open(flash_area_id_from_image_slot(0), &fap);
- assert(rc == 0);
-
- rc = bootutil_tlv_iter_begin(&it, rsp->br_hdr, fap, IMAGE_TLV_ANY, true);
- assert(rc == 0);
-
- has_aes_nonce = has_secret_id = false;
- while (true) {
- rc = bootutil_tlv_iter_next(&it, &off, &len, &type);
- assert(rc >= 0);
-
- if (rc > 0) {
- break;
- }
-
- if (type == IMAGE_TLV_AES_NONCE) {
- assert(len == 8);
-
- rc = flash_area_read(fap, off, buf, len);
- assert(rc == 0);
-
- nonce[0] = __builtin_bswap32(*(uint32_t *)buf);
- nonce[1] = __builtin_bswap32(*(uint32_t *)(buf + 4));
- has_aes_nonce = true;
- } else if (type == IMAGE_TLV_SECRET_ID) {
- assert(len == 4);
-
- rc = flash_area_read(fap, off, buf, len);
- assert(rc == 0);
-
- key = buf[0];
- has_secret_id = true;
- }
- }
-
- assert(has_aes_nonce && has_secret_id && key <= 7);
-
- /* enable OTP clock and set in read mode */
- da1469x_clock_amba_enable(CRG_TOP_CLK_AMBA_REG_OTP_ENABLE_Msk);
- da1469x_otp_set_mode(OTPC_MODE_READ);
-
- /* disable decrypt on the fly and program start and end addresses */
- QSPIC->QSPIC_CTR_CTRL_REG = 0;
- QSPIC->QSPIC_CTR_SADDR_REG = jump_offset;
- QSPIC->QSPIC_CTR_EADDR_REG = QSPIC->QSPIC_CTR_SADDR_REG +
- rsp->br_hdr->ih_img_size - 1;
-
- /* securely DMA hardware key from secret storage to QSPI decrypt engine */
- dma_regs->DMA_REQ_MUX_REG |= 0xf000;
- dma_regs->DMA7_LEN_REG = 8;
- dma_regs->DMA7_A_START_REG = MCU_OTPM_BASE + OTP_SEGMENT_QSPI_FW_KEYS +
- (32 * key);
- dma_regs->DMA7_B_START_REG = (uint32_t)&QSPIC->QSPIC_CTR_KEY_0_3_REG;
- dma_regs->DMA7_CTRL_REG = DMA_DMA7_CTRL_REG_AINC_Msk |
- DMA_DMA7_CTRL_REG_BINC_Msk |
- (MCU_DMA_BUS_WIDTH_4B << DMA_DMA7_CTRL_REG_BW_Pos) |
- DMA_DMA7_CTRL_REG_DMA_ON_Msk;
- while (dma_regs->DMA7_IDX_REG != 8);
-
- /* program NONCE */
- QSPIC->QSPIC_CTR_NONCE_0_3_REG = nonce[0];
- QSPIC->QSPIC_CTR_NONCE_4_7_REG = nonce[1];
-
- /* turn back on decrypt on the fly */
- QSPIC->QSPIC_CTR_CTRL_REG = 1;
-
- /* set OTP to standby and turn off clock */
- da1469x_otp_set_mode(OTPC_MODE_STBY);
- da1469x_clock_amba_disable(CRG_TOP_CLK_AMBA_REG_OTP_ENABLE_Msk);
-
- hal_system_start((void *)(flash_base + jump_offset));
-}
-#endif
diff --git a/tinyusb/hw/mcu/dialog/da1469x/src/system_da1469x.c b/tinyusb/hw/mcu/dialog/da1469x/src/system_da1469x.c
deleted file mode 100755
index 538bac79..00000000
--- a/tinyusb/hw/mcu/dialog/da1469x/src/system_da1469x.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "mcu/mcu.h"
-#include <mcu/da1469x_clock.h>
-
-extern uint8_t __StackLimit;
-
-uint32_t SystemCoreClock = 32000000;
-
-void
-SystemInit(void)
-{
- /* Enable FPU when using hard-float */
-#if (__FPU_USED == 1)
- SCB->CPACR |= (3UL << 20) | (3UL << 22);
- __DSB();
- __ISB();
-#endif
-
- /* Freez watchdog */
- GPREG->SET_FREEZE_REG |= GPREG_SET_FREEZE_REG_FRZ_SYS_WDOG_Msk;
- /* Initialize power domains (disable radio only) */
- CRG_TOP->PMU_CTRL_REG = CRG_TOP_PMU_CTRL_REG_RADIO_SLEEP_Msk;
-
- CRG_TOP->P0_SET_PAD_LATCH_REG = CRG_TOP_P0_PAD_LATCH_REG_P0_LATCH_EN_Msk;
- CRG_TOP->P1_SET_PAD_LATCH_REG = CRG_TOP_P1_PAD_LATCH_REG_P1_LATCH_EN_Msk;
-
- /* Reset clock dividers to 0 */
- CRG_TOP->CLK_AMBA_REG &= ~(CRG_TOP_CLK_AMBA_REG_HCLK_DIV_Msk | CRG_TOP_CLK_AMBA_REG_PCLK_DIV_Msk);
-
- /* PD_TIM is already started in SystemInit */
-
- da1469x_clock_sys_xtal32m_init();
- da1469x_clock_sys_xtal32m_enable();
- da1469x_clock_sys_pll_enable();
- da1469x_clock_pll_wait_to_lock();
- /* Switch to XTAL32M and disable RC32M */
- da1469x_clock_sys_xtal32m_switch_safe();
- da1469x_clock_sys_rc32m_disable();
-}
-
-void _init(void)
-{
-}
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble.h
deleted file mode 100755
index 76a432bf..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble.h
+++ /dev/null
@@ -1,685 +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.
- */
-
-/**
- @addtogroup BLE_COMMON BLE SoftDevice Common
- @{
- @defgroup ble_api Events, type definitions and API calls
- @{
-
- @brief Module independent events, type definitions and API calls for the BLE SoftDevice.
-
- */
-
-#ifndef BLE_H__
-#define BLE_H__
-
-#include <stdint.h>
-#include "nrf_svc.h"
-#include "nrf_error.h"
-#include "ble_err.h"
-#include "ble_gap.h"
-#include "ble_l2cap.h"
-#include "ble_gatt.h"
-#include "ble_gattc.h"
-#include "ble_gatts.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup BLE_COMMON_ENUMERATIONS Enumerations
- * @{ */
-
-/**
- * @brief Common API SVC numbers.
- */
-enum BLE_COMMON_SVCS
-{
- SD_BLE_ENABLE = BLE_SVC_BASE, /**< Enable and initialize the BLE stack */
- SD_BLE_EVT_GET, /**< Get an event from the pending events queue. */
- SD_BLE_UUID_VS_ADD, /**< Add a Vendor Specific base UUID. */
- SD_BLE_UUID_DECODE, /**< Decode UUID bytes. */
- SD_BLE_UUID_ENCODE, /**< Encode UUID bytes. */
- SD_BLE_VERSION_GET, /**< Get the local version information (company ID, Link Layer Version, Link Layer Subversion). */
- SD_BLE_USER_MEM_REPLY, /**< User Memory Reply. */
- SD_BLE_OPT_SET, /**< Set a BLE option. */
- SD_BLE_OPT_GET, /**< Get a BLE option. */
- SD_BLE_CFG_SET, /**< Add a configuration to the BLE stack. */
- SD_BLE_UUID_VS_REMOVE, /**< Remove a Vendor Specific base UUID. */
-};
-
-/**
- * @brief BLE Module Independent Event IDs.
- */
-enum BLE_COMMON_EVTS
-{
- BLE_EVT_USER_MEM_REQUEST = BLE_EVT_BASE + 0, /**< User Memory request. @ref ble_evt_user_mem_request_t */
- BLE_EVT_USER_MEM_RELEASE = BLE_EVT_BASE + 1, /**< User Memory release. @ref ble_evt_user_mem_release_t */
-};
-
-/**@brief BLE Connection Configuration IDs.
- *
- * IDs that uniquely identify a connection configuration.
- */
-enum BLE_CONN_CFGS
-{
- BLE_CONN_CFG_GAP = BLE_CONN_CFG_BASE + 0, /**< BLE GAP specific connection configuration. */
- BLE_CONN_CFG_GATTC = BLE_CONN_CFG_BASE + 1, /**< BLE GATTC specific connection configuration. */
- BLE_CONN_CFG_GATTS = BLE_CONN_CFG_BASE + 2, /**< BLE GATTS specific connection configuration. */
- BLE_CONN_CFG_GATT = BLE_CONN_CFG_BASE + 3, /**< BLE GATT specific connection configuration. */
- BLE_CONN_CFG_L2CAP = BLE_CONN_CFG_BASE + 4, /**< BLE L2CAP specific connection configuration. */
-};
-
-/**@brief BLE Common Configuration IDs.
- *
- * IDs that uniquely identify a common configuration.
- */
-enum BLE_COMMON_CFGS
-{
- BLE_COMMON_CFG_VS_UUID = BLE_CFG_BASE, /**< Vendor specific base UUID configuration */
-};
-
-/**@brief Common Option IDs.
- * IDs that uniquely identify a common option.
- */
-enum BLE_COMMON_OPTS
-{
- BLE_COMMON_OPT_PA_LNA = BLE_OPT_BASE + 0, /**< PA and LNA options */
- BLE_COMMON_OPT_CONN_EVT_EXT = BLE_OPT_BASE + 1, /**< Extended connection events option */
- BLE_COMMON_OPT_EXTENDED_RC_CAL = BLE_OPT_BASE + 2, /**< Extended RC calibration option */
- BLE_COMMON_OPT_ADV_SCHED_CFG = BLE_OPT_BASE + 3, /**< Advertiser role scheduling configuration option */
-};
-
-/** @} */
-
-/** @addtogroup BLE_COMMON_DEFINES Defines
- * @{ */
-
-/** @brief Required pointer alignment for BLE Events.
-*/
-#define BLE_EVT_PTR_ALIGNMENT 4
-
-/** @brief Leaves the maximum of the two arguments.
-*/
-#define BLE_MAX(a, b) ((a) < (b) ? (b) : (a))
-
-/** @brief Maximum possible length for BLE Events.
- * @note The highest value used for @ref ble_gatt_conn_cfg_t::att_mtu in any connection configuration shall be used as a parameter.
- * If that value has not been configured for any connections then @ref BLE_GATT_ATT_MTU_DEFAULT must be used instead.
-*/
-#define BLE_EVT_LEN_MAX(ATT_MTU) ( \
- offsetof(ble_evt_t, evt.gattc_evt.params.prim_srvc_disc_rsp.services) + ((ATT_MTU) - 1) / 4 * sizeof(ble_gattc_service_t) \
-)
-
-/** @defgroup ADV_SCHED_CFG Advertiser Role Scheduling Configuration
- * @{ */
-#define ADV_SCHED_CFG_DEFAULT 0 /**< Default advertiser role scheduling configuration. */
-#define ADV_SCHED_CFG_IMPROVED 1 /**< Improved advertiser role scheduling configuration in which the housekeeping time is reduced. */
-/** @} */
-
-/** @defgroup BLE_USER_MEM_TYPES User Memory Types
- * @{ */
-#define BLE_USER_MEM_TYPE_INVALID 0x00 /**< Invalid User Memory Types. */
-#define BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES 0x01 /**< User Memory for GATTS queued writes. */
-/** @} */
-
-/** @defgroup BLE_UUID_VS_COUNTS Vendor Specific base UUID counts
- * @{
- */
-#define BLE_UUID_VS_COUNT_DEFAULT 10 /**< Default VS UUID count. */
-#define BLE_UUID_VS_COUNT_MAX 254 /**< Maximum VS UUID count. */
-/** @} */
-
-/** @defgroup BLE_COMMON_CFG_DEFAULTS Configuration defaults.
- * @{
- */
-#define BLE_CONN_CFG_TAG_DEFAULT 0 /**< Default configuration tag, SoftDevice default connection configuration. */
-
-/** @} */
-
-/** @} */
-
-/** @addtogroup BLE_COMMON_STRUCTURES Structures
- * @{ */
-
-/**@brief User Memory Block. */
-typedef struct
-{
- uint8_t *p_mem; /**< Pointer to the start of the user memory block. */
- uint16_t len; /**< Length in bytes of the user memory block. */
-} ble_user_mem_block_t;
-
-/**@brief Event structure for @ref BLE_EVT_USER_MEM_REQUEST. */
-typedef struct
-{
- uint8_t type; /**< User memory type, see @ref BLE_USER_MEM_TYPES. */
-} ble_evt_user_mem_request_t;
-
-/**@brief Event structure for @ref BLE_EVT_USER_MEM_RELEASE. */
-typedef struct
-{
- uint8_t type; /**< User memory type, see @ref BLE_USER_MEM_TYPES. */
- ble_user_mem_block_t mem_block; /**< User memory block */
-} ble_evt_user_mem_release_t;
-
-/**@brief Event structure for events not associated with a specific function module. */
-typedef struct
-{
- uint16_t conn_handle; /**< Connection Handle on which this event occurred. */
- union
- {
- ble_evt_user_mem_request_t user_mem_request; /**< User Memory Request Event Parameters. */
- ble_evt_user_mem_release_t user_mem_release; /**< User Memory Release Event Parameters. */
- } params; /**< Event parameter union. */
-} ble_common_evt_t;
-
-/**@brief BLE Event header. */
-typedef struct
-{
- uint16_t evt_id; /**< Value from a BLE_<module>_EVT series. */
- uint16_t evt_len; /**< Length in octets including this header. */
-} ble_evt_hdr_t;
-
-/**@brief Common BLE Event type, wrapping the module specific event reports. */
-typedef struct
-{
- ble_evt_hdr_t header; /**< Event header. */
- union
- {
- ble_common_evt_t common_evt; /**< Common Event, evt_id in BLE_EVT_* series. */
- ble_gap_evt_t gap_evt; /**< GAP originated event, evt_id in BLE_GAP_EVT_* series. */
- ble_gattc_evt_t gattc_evt; /**< GATT client originated event, evt_id in BLE_GATTC_EVT* series. */
- ble_gatts_evt_t gatts_evt; /**< GATT server originated event, evt_id in BLE_GATTS_EVT* series. */
- ble_l2cap_evt_t l2cap_evt; /**< L2CAP originated event, evt_id in BLE_L2CAP_EVT* series. */
- } evt; /**< Event union. */
-} ble_evt_t;
-
-
-/**
- * @brief Version Information.
- */
-typedef struct
-{
- uint8_t version_number; /**< Link Layer Version number. See https://www.bluetooth.org/en-us/specification/assigned-numbers/link-layer for assigned values. */
- uint16_t company_id; /**< Company ID, Nordic Semiconductor's company ID is 89 (0x0059) (https://www.bluetooth.org/apps/content/Default.aspx?doc_id=49708). */
- uint16_t subversion_number; /**< Link Layer Sub Version number, corresponds to the SoftDevice Config ID or Firmware ID (FWID). */
-} ble_version_t;
-
-/**
- * @brief Configuration parameters for the 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 toggle for this amplifier */
-} ble_pa_lna_cfg_t;
-
-/**
- * @brief PA & LNA GPIO toggle configuration
- *
- * This option configures the SoftDevice 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 @ref sd_ble_opt_get is not supported for this option.
- * @note Setting this option while the radio is in use (i.e. any of the roles are active) may have undefined consequences
- * and must be avoided by the application.
- */
-typedef struct
-{
- ble_pa_lna_cfg_t pa_cfg; /**< Power Amplifier configuration */
- ble_pa_lna_cfg_t lna_cfg; /**< Low Noise Amplifier configuration */
-
- uint8_t ppi_ch_id_set; /**< PPI channel used for radio pin setting */
- uint8_t ppi_ch_id_clr; /**< PPI channel used for radio pin clearing */
- uint8_t gpiote_ch_id; /**< GPIOTE channel used for radio pin toggling */
-} ble_common_opt_pa_lna_t;
-
-/**
- * @brief Configuration of extended BLE connection events.
- *
- * When enabled the SoftDevice will dynamically extend the connection event when possible.
- *
- * The connection event length is controlled by the connection configuration as set by @ref ble_gap_conn_cfg_t::event_length.
- * The connection event can be extended if there is time to send another packet pair before the start of the next connection interval,
- * and if there are no conflicts with other BLE roles requesting radio time.
- *
- * @note @ref sd_ble_opt_get is not supported for this option.
- */
-typedef struct
-{
- uint8_t enable : 1; /**< Enable extended BLE connection events, disabled by default. */
-} ble_common_opt_conn_evt_ext_t;
-
-/**
- * @brief Enable/disable extended RC calibration.
- *
- * If extended RC calibration is enabled and the internal RC oscillator (@ref NRF_CLOCK_LF_SRC_RC) is used as the SoftDevice
- * LFCLK source, the SoftDevice as a peripheral will by default try to increase the receive window if two consecutive packets
- * are not received. If it turns out that the packets were not received due to clock drift, the RC calibration is started.
- * This calibration comes in addition to the periodic calibration that is configured by @ref sd_softdevice_enable(). When
- * using only peripheral connections, the periodic calibration can therefore be configured with a much longer interval as the
- * peripheral will be able to detect and adjust automatically to clock drift, and calibrate on demand.
- *
- * If extended RC calibration is disabled and the internal RC oscillator is used as the SoftDevice LFCLK source, the
- * RC oscillator is calibrated periodically as configured by @ref sd_softdevice_enable().
- *
- * @note @ref sd_ble_opt_get is not supported for this option.
- */
-typedef struct
-{
- uint8_t enable : 1; /**< Enable extended RC calibration, enabled by default. */
-} ble_common_opt_extended_rc_cal_t;
-
-/**
- * @brief Configuration of BLE advertiser role scheduling.
- *
- * @note @ref sd_ble_opt_get is not supported for this option.
- */
-typedef struct
-{
- uint8_t sched_cfg; /**< See @ref ADV_SCHED_CFG. */
-} ble_common_opt_adv_sched_cfg_t;
-
-/**@brief Option structure for common options. */
-typedef union
-{
- ble_common_opt_pa_lna_t pa_lna; /**< Parameters for controlling PA and LNA pin toggling. */
- ble_common_opt_conn_evt_ext_t conn_evt_ext; /**< Parameters for enabling extended connection events. */
- ble_common_opt_extended_rc_cal_t extended_rc_cal; /**< Parameters for enabling extended RC calibration. */
- ble_common_opt_adv_sched_cfg_t adv_sched_cfg; /**< Parameters for configuring advertiser role scheduling. */
-} ble_common_opt_t;
-
-/**@brief Common BLE Option type, wrapping the module specific options. */
-typedef union
-{
- ble_common_opt_t common_opt; /**< COMMON options, opt_id in @ref BLE_COMMON_OPTS series. */
- ble_gap_opt_t gap_opt; /**< GAP option, opt_id in @ref BLE_GAP_OPTS series. */
-} ble_opt_t;
-
-/**@brief BLE connection configuration type, wrapping the module specific configurations, set with
- * @ref sd_ble_cfg_set.
- *
- * @note Connection configurations don't have to be set.
- * In the case that no configurations has been set, or fewer connection configurations has been set than enabled connections,
- * the default connection configuration will be automatically added for the remaining connections.
- * When creating connections with the default configuration, @ref BLE_CONN_CFG_TAG_DEFAULT should be used in
- * place of @ref ble_conn_cfg_t::conn_cfg_tag.
- *
- * @sa sd_ble_gap_adv_start()
- * @sa sd_ble_gap_connect()
- *
- * @mscs
- * @mmsc{@ref BLE_CONN_CFG}
- * @endmscs
-
- */
-typedef struct
-{
- uint8_t conn_cfg_tag; /**< The application chosen tag it can use with the
- @ref sd_ble_gap_adv_start() and @ref sd_ble_gap_connect() calls
- to select this configuration when creating a connection.
- Must be different for all connection configurations added and not @ref BLE_CONN_CFG_TAG_DEFAULT. */
- union {
- ble_gap_conn_cfg_t gap_conn_cfg; /**< GAP connection configuration, cfg_id is @ref BLE_CONN_CFG_GAP. */
- ble_gattc_conn_cfg_t gattc_conn_cfg; /**< GATTC connection configuration, cfg_id is @ref BLE_CONN_CFG_GATTC. */
- ble_gatts_conn_cfg_t gatts_conn_cfg; /**< GATTS connection configuration, cfg_id is @ref BLE_CONN_CFG_GATTS. */
- ble_gatt_conn_cfg_t gatt_conn_cfg; /**< GATT connection configuration, cfg_id is @ref BLE_CONN_CFG_GATT. */
- ble_l2cap_conn_cfg_t l2cap_conn_cfg; /**< L2CAP connection configuration, cfg_id is @ref BLE_CONN_CFG_L2CAP. */
- } params; /**< Connection configuration union. */
-} ble_conn_cfg_t;
-
-/**
- * @brief Configuration of Vendor Specific base UUIDs, set with @ref sd_ble_cfg_set.
- *
- * @retval ::NRF_ERROR_INVALID_PARAM Too many UUIDs configured.
- */
-typedef struct
-{
- uint8_t vs_uuid_count; /**< Number of 128-bit Vendor Specific base UUID bases to allocate memory for.
- Default value is @ref BLE_UUID_VS_COUNT_DEFAULT. Maximum value is
- @ref BLE_UUID_VS_COUNT_MAX. */
-} ble_common_cfg_vs_uuid_t;
-
-/**@brief Common BLE Configuration type, wrapping the common configurations. */
-typedef union
-{
- ble_common_cfg_vs_uuid_t vs_uuid_cfg; /**< Vendor Specific base UUID configuration, cfg_id is @ref BLE_COMMON_CFG_VS_UUID. */
-} ble_common_cfg_t;
-
-/**@brief BLE Configuration type, wrapping the module specific configurations. */
-typedef union
-{
- ble_conn_cfg_t conn_cfg; /**< Connection specific configurations, cfg_id in @ref BLE_CONN_CFGS series. */
- ble_common_cfg_t common_cfg; /**< Global common configurations, cfg_id in @ref BLE_COMMON_CFGS series. */
- ble_gap_cfg_t gap_cfg; /**< Global GAP configurations, cfg_id in @ref BLE_GAP_CFGS series. */
- ble_gatts_cfg_t gatts_cfg; /**< Global GATTS configuration, cfg_id in @ref BLE_GATTS_CFGS series. */
-} ble_cfg_t;
-
-/** @} */
-
-/** @addtogroup BLE_COMMON_FUNCTIONS Functions
- * @{ */
-
-/**@brief Enable the BLE stack
- *
- * @param[in, out] p_app_ram_base Pointer to a variable containing the start address of the
- * application RAM region (APP_RAM_BASE). On return, this will
- * contain the minimum start address of the application RAM region
- * required by the SoftDevice for this configuration.
- *
- * @note The memory requirement for a specific configuration will not increase between SoftDevices
- * with the same major version number.
- *
- * @note At runtime the IC's RAM is split into 2 regions: The SoftDevice RAM region is located
- * between 0x20000000 and APP_RAM_BASE-1 and the application's RAM region is located between
- * APP_RAM_BASE and the start of the call stack.
- *
- * @details This call initializes the BLE stack, no BLE related function other than @ref
- * sd_ble_cfg_set can be called before this one.
- *
- * @mscs
- * @mmsc{@ref BLE_COMMON_ENABLE}
- * @endmscs
- *
- * @retval ::NRF_SUCCESS The BLE stack has been initialized successfully.
- * @retval ::NRF_ERROR_INVALID_STATE The BLE stack had already been initialized and cannot be reinitialized.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied.
- * @retval ::NRF_ERROR_NO_MEM One or more of the following is true:
- * - The amount of memory assigned to the SoftDevice by *p_app_ram_base is not
- * large enough to fit this configuration's memory requirement. Check *p_app_ram_base
- * and set the start address of the application RAM region accordingly.
- * - Dynamic part of the SoftDevice RAM region is larger then 64 kB which
- * is currently not supported.
- * @retval ::NRF_ERROR_RESOURCES The total number of L2CAP Channels configured using @ref sd_ble_cfg_set is too large.
- */
-SVCALL(SD_BLE_ENABLE, uint32_t, sd_ble_enable(uint32_t * p_app_ram_base));
-
-/**@brief Add configurations for the BLE stack
- *
- * @param[in] cfg_id Config ID, see @ref BLE_CONN_CFGS, @ref BLE_COMMON_CFGS, @ref
- * BLE_GAP_CFGS or @ref BLE_GATTS_CFGS.
- * @param[in] p_cfg Pointer to a ble_cfg_t structure containing the configuration value.
- * @param[in] app_ram_base The start address of the application RAM region (APP_RAM_BASE).
- * See @ref sd_ble_enable for details about APP_RAM_BASE.
- *
- * @note The memory requirement for a specific configuration will not increase between SoftDevices
- * with the same major version number.
- *
- * @note If a configuration is set more than once, the last one set is the one that takes effect on
- * @ref sd_ble_enable.
- *
- * @note Any part of the BLE stack that is NOT configured with @ref sd_ble_cfg_set will have default
- * configuration.
- *
- * @note @ref sd_ble_cfg_set may be called at any time when the SoftDevice is enabled (see @ref
- * sd_softdevice_enable) while the BLE part of the SoftDevice is not enabled (see @ref
- * sd_ble_enable).
- *
- * @note Error codes for the configurations are described in the configuration structs.
- *
- * @mscs
- * @mmsc{@ref BLE_COMMON_ENABLE}
- * @endmscs
- *
- * @retval ::NRF_SUCCESS The configuration has been added successfully.
- * @retval ::NRF_ERROR_INVALID_STATE The BLE stack had already been initialized.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid cfg_id supplied.
- * @retval ::NRF_ERROR_NO_MEM The amount of memory assigned to the SoftDevice by app_ram_base is not
- * large enough to fit this configuration's memory requirement.
- */
-SVCALL(SD_BLE_CFG_SET, uint32_t, sd_ble_cfg_set(uint32_t cfg_id, ble_cfg_t const * p_cfg, uint32_t app_ram_base));
-
-/**@brief Get an event from the pending events queue.
- *
- * @param[out] p_dest Pointer to buffer to be filled in with an event, or NULL to retrieve the event length.
- * This buffer <b>must be aligned to the extend defined by @ref BLE_EVT_PTR_ALIGNMENT</b>.
- * The buffer should be interpreted as a @ref ble_evt_t struct.
- * @param[in, out] p_len Pointer the length of the buffer, on return it is filled with the event length.
- *
- * @details This call allows the application to pull a BLE event from the BLE stack. The application is signaled that
- * an event is available from the BLE stack by the triggering of the SD_EVT_IRQn interrupt.
- * The application is free to choose whether to call this function from thread mode (main context) or directly from the
- * Interrupt Service Routine that maps to SD_EVT_IRQn. In any case however, and because the BLE stack runs at a higher
- * priority than the application, this function should be called in a loop (until @ref NRF_ERROR_NOT_FOUND is returned)
- * every time SD_EVT_IRQn is raised to ensure that all available events are pulled from the BLE stack. Failure to do so
- * could potentially leave events in the internal queue without the application being aware of this fact.
- *
- * Sizing the p_dest buffer is equally important, since the application needs to provide all the memory necessary for the event to
- * be copied into application memory. If the buffer provided is not large enough to fit the entire contents of the event,
- * @ref NRF_ERROR_DATA_SIZE will be returned and the application can then call again with a larger buffer size.
- * The maximum possible event length is defined by @ref BLE_EVT_LEN_MAX. The application may also "peek" the event length
- * by providing p_dest as a NULL pointer and inspecting the value of *p_len upon return:
- *
- * \code
- * uint16_t len;
- * errcode = sd_ble_evt_get(NULL, &len);
- * \endcode
- *
- * @mscs
- * @mmsc{@ref BLE_COMMON_IRQ_EVT_MSC}
- * @mmsc{@ref BLE_COMMON_THREAD_EVT_MSC}
- * @endmscs
- *
- * @retval ::NRF_SUCCESS Event pulled and stored into the supplied buffer.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied.
- * @retval ::NRF_ERROR_NOT_FOUND No events ready to be pulled.
- * @retval ::NRF_ERROR_DATA_SIZE Event ready but could not fit into the supplied buffer.
- */
-SVCALL(SD_BLE_EVT_GET, uint32_t, sd_ble_evt_get(uint8_t *p_dest, uint16_t *p_len));
-
-
-/**@brief Add a Vendor Specific base UUID.
- *
- * @details This call enables the application to add a Vendor Specific base UUID to the BLE stack's table, for later
- * use with all other modules and APIs. This then allows the application to use the shorter, 24-bit @ref ble_uuid_t
- * format when dealing with both 16-bit and 128-bit UUIDs without having to check for lengths and having split code
- * paths. This is accomplished by extending the grouping mechanism that the Bluetooth SIG standard base UUID uses
- * for all other 128-bit UUIDs. The type field in the @ref ble_uuid_t structure is an index (relative to
- * @ref BLE_UUID_TYPE_VENDOR_BEGIN) to the table populated by multiple calls to this function, and the UUID field
- * in the same structure contains the 2 bytes at indexes 12 and 13. The number of possible 128-bit UUIDs available to
- * the application is therefore the number of Vendor Specific UUIDs added with the help of this function times 65536,
- * although restricted to modifying bytes 12 and 13 for each of the entries in the supplied array.
- *
- * @note Bytes 12 and 13 of the provided UUID will not be used internally, since those are always replaced by
- * the 16-bit uuid field in @ref ble_uuid_t.
- *
- * @note If a UUID is already present in the BLE stack's internal table, the corresponding index will be returned in
- * p_uuid_type along with an @ref NRF_SUCCESS error code.
- *
- * @param[in] p_vs_uuid Pointer to a 16-octet (128-bit) little endian Vendor Specific base UUID disregarding
- * bytes 12 and 13.
- * @param[out] p_uuid_type Pointer to a uint8_t where the type field in @ref ble_uuid_t corresponding to this UUID will be stored.
- *
- * @retval ::NRF_SUCCESS Successfully added the Vendor Specific base UUID.
- * @retval ::NRF_ERROR_INVALID_ADDR If p_vs_uuid or p_uuid_type is NULL or invalid.
- * @retval ::NRF_ERROR_NO_MEM If there are no more free slots for VS UUIDs.
- */
-SVCALL(SD_BLE_UUID_VS_ADD, uint32_t, sd_ble_uuid_vs_add(ble_uuid128_t const *p_vs_uuid, uint8_t *p_uuid_type));
-
-
-/**@brief Remove a Vendor Specific base UUID.
- *
- * @details This call removes a Vendor Specific base UUID that has been added with @ref sd_ble_uuid_vs_add. This function allows
- * the application to reuse memory allocated for Vendor Specific base UUIDs.
- *
- * @note Currently this function can only be called with a p_uuid_type set to @ref BLE_UUID_TYPE_UNKNOWN or the last added UUID type.
- *
- * @param[in] p_uuid_type Pointer to a uint8_t where the type field in @ref ble_uuid_t::type corresponds to the UUID type that
- * shall be removed. If the type is set to @ref BLE_UUID_TYPE_UNKNOWN, or the pointer is NULL, the last
- * Vendor Specific base UUID will be removed.
- * @param[out] p_uuid_type Pointer to a uint8_t where the type field in @ref ble_uuid_t corresponds to the UUID type that was
- * removed. If function returns with a failure, it contains the last type that is in use by the ATT Server.
- *
- * @retval ::NRF_SUCCESS Successfully removed the Vendor Specific base UUID.
- * @retval ::NRF_ERROR_INVALID_ADDR If p_uuid_type is invalid.
- * @retval ::NRF_ERROR_INVALID_PARAM If p_uuid_type points to a non-valid UUID type.
- * @retval ::NRF_ERROR_FORBIDDEN If the Vendor Specific base UUID is in use by the ATT Server.
- */
-
-SVCALL(SD_BLE_UUID_VS_REMOVE, uint32_t, sd_ble_uuid_vs_remove(uint8_t *p_uuid_type));
-
-
-/** @brief Decode little endian raw UUID bytes (16-bit or 128-bit) into a 24 bit @ref ble_uuid_t structure.
- *
- * @details The raw UUID bytes excluding bytes 12 and 13 (i.e. bytes 0-11 and 14-15) of p_uuid_le are compared
- * to the corresponding ones in each entry of the table of Vendor Specific base UUIDs populated with @ref sd_ble_uuid_vs_add
- * to look for a match. If there is such a match, bytes 12 and 13 are returned as p_uuid->uuid and the index
- * relative to @ref BLE_UUID_TYPE_VENDOR_BEGIN as p_uuid->type.
- *
- * @note If the UUID length supplied is 2, then the type set by this call will always be @ref BLE_UUID_TYPE_BLE.
- *
- * @param[in] uuid_le_len Length in bytes of the buffer pointed to by p_uuid_le (must be 2 or 16 bytes).
- * @param[in] p_uuid_le Pointer pointing to little endian raw UUID bytes.
- * @param[out] p_uuid Pointer to a @ref ble_uuid_t structure to be filled in.
- *
- * @retval ::NRF_SUCCESS Successfully decoded into the @ref ble_uuid_t structure.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_LENGTH Invalid UUID length.
- * @retval ::NRF_ERROR_NOT_FOUND For a 128-bit UUID, no match in the populated table of UUIDs.
- */
-SVCALL(SD_BLE_UUID_DECODE, uint32_t, sd_ble_uuid_decode(uint8_t uuid_le_len, uint8_t const *p_uuid_le, ble_uuid_t *p_uuid));
-
-
-/** @brief Encode a @ref ble_uuid_t structure into little endian raw UUID bytes (16-bit or 128-bit).
- *
- * @note The pointer to the destination buffer p_uuid_le may be NULL, in which case only the validity and size of p_uuid is computed.
- *
- * @param[in] p_uuid Pointer to a @ref ble_uuid_t structure that will be encoded into bytes.
- * @param[out] p_uuid_le_len Pointer to a uint8_t that will be filled with the encoded length (2 or 16 bytes).
- * @param[out] p_uuid_le Pointer to a buffer where the little endian raw UUID bytes (2 or 16) will be stored.
- *
- * @retval ::NRF_SUCCESS Successfully encoded into the buffer.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid UUID type.
- */
-SVCALL(SD_BLE_UUID_ENCODE, uint32_t, sd_ble_uuid_encode(ble_uuid_t const *p_uuid, uint8_t *p_uuid_le_len, uint8_t *p_uuid_le));
-
-
-/**@brief Get Version Information.
- *
- * @details This call allows the application to get the BLE stack version information.
- *
- * @param[out] p_version Pointer to a ble_version_t structure to be filled in.
- *
- * @retval ::NRF_SUCCESS Version information stored successfully.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_BUSY The BLE stack is busy (typically doing a locally-initiated disconnection procedure).
- */
-SVCALL(SD_BLE_VERSION_GET, uint32_t, sd_ble_version_get(ble_version_t *p_version));
-
-
-/**@brief Provide a user memory block.
- *
- * @note This call can only be used as a response to a @ref BLE_EVT_USER_MEM_REQUEST event issued to the application.
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] p_block Pointer to a user memory block structure or NULL if memory is managed by the application.
- *
- * @mscs
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC}
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC}
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC}
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC}
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_NOAUTH_MSC}
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC}
- * @endmscs
- *
- * @retval ::NRF_SUCCESS Successfully queued a response to the peer.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_LENGTH Invalid user memory block length supplied.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection state or no user memory request pending.
- */
-SVCALL(SD_BLE_USER_MEM_REPLY, uint32_t, sd_ble_user_mem_reply(uint16_t conn_handle, ble_user_mem_block_t const *p_block));
-
-/**@brief Set a BLE option.
- *
- * @details This call allows the application to set the value of an option.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_PERIPH_BONDING_STATIC_PK_MSC}
- * @endmscs
- *
- * @param[in] opt_id Option ID, see @ref BLE_COMMON_OPTS and @ref BLE_GAP_OPTS.
- * @param[in] p_opt Pointer to a ble_opt_t structure containing the option value.
- *
- * @retval ::NRF_SUCCESS Option set successfully.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints.
- * @retval ::NRF_ERROR_INVALID_STATE Unable to set the parameter at this time.
- * @retval ::NRF_ERROR_BUSY The BLE stack is busy or the previous procedure has not completed.
- */
-SVCALL(SD_BLE_OPT_SET, uint32_t, sd_ble_opt_set(uint32_t opt_id, ble_opt_t const *p_opt));
-
-
-/**@brief Get a BLE option.
- *
- * @details This call allows the application to retrieve the value of an option.
- *
- * @param[in] opt_id Option ID, see @ref BLE_COMMON_OPTS and @ref BLE_GAP_OPTS.
- * @param[out] p_opt Pointer to a ble_opt_t structure to be filled in.
- *
- * @retval ::NRF_SUCCESS Option retrieved successfully.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints.
- * @retval ::NRF_ERROR_INVALID_STATE Unable to retrieve the parameter at this time.
- * @retval ::NRF_ERROR_BUSY The BLE stack is busy or the previous procedure has not completed.
- * @retval ::NRF_ERROR_NOT_SUPPORTED This option is not supported.
- *
- */
-SVCALL(SD_BLE_OPT_GET, uint32_t, sd_ble_opt_get(uint32_t opt_id, ble_opt_t *p_opt));
-
-/** @} */
-#ifdef __cplusplus
-}
-#endif
-#endif /* BLE_H__ */
-
-/**
- @}
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_err.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_err.h
deleted file mode 100755
index 1b4820dc..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_err.h
+++ /dev/null
@@ -1,93 +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.
- */
-
-/**
- @addtogroup BLE_COMMON
- @{
- @addtogroup nrf_error
- @{
- @ingroup BLE_COMMON
- @}
-
- @defgroup ble_err General error codes
- @{
-
- @brief General error code definitions for the BLE API.
-
- @ingroup BLE_COMMON
-*/
-#ifndef NRF_BLE_ERR_H__
-#define NRF_BLE_ERR_H__
-
-#include "nrf_error.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* @defgroup BLE_ERRORS Error Codes
- * @{ */
-#define BLE_ERROR_NOT_ENABLED (NRF_ERROR_STK_BASE_NUM+0x001) /**< @ref sd_ble_enable has not been called. */
-#define BLE_ERROR_INVALID_CONN_HANDLE (NRF_ERROR_STK_BASE_NUM+0x002) /**< Invalid connection handle. */
-#define BLE_ERROR_INVALID_ATTR_HANDLE (NRF_ERROR_STK_BASE_NUM+0x003) /**< Invalid attribute handle. */
-#define BLE_ERROR_INVALID_ADV_HANDLE (NRF_ERROR_STK_BASE_NUM+0x004) /**< Invalid advertising handle. */
-#define BLE_ERROR_INVALID_ROLE (NRF_ERROR_STK_BASE_NUM+0x005) /**< Invalid role. */
-#define BLE_ERROR_BLOCKED_BY_OTHER_LINKS (NRF_ERROR_STK_BASE_NUM+0x006) /**< The attempt to change link settings failed due to the scheduling of other links. */
-/** @} */
-
-
-/** @defgroup BLE_ERROR_SUBRANGES Module specific error code subranges
- * @brief Assignment of subranges for module specific error codes.
- * @note For specific error codes, see ble_<module>.h or ble_error_<module>.h.
- * @{ */
-#define NRF_L2CAP_ERR_BASE (NRF_ERROR_STK_BASE_NUM+0x100) /**< L2CAP specific errors. */
-#define NRF_GAP_ERR_BASE (NRF_ERROR_STK_BASE_NUM+0x200) /**< GAP specific errors. */
-#define NRF_GATTC_ERR_BASE (NRF_ERROR_STK_BASE_NUM+0x300) /**< GATT client specific errors. */
-#define NRF_GATTS_ERR_BASE (NRF_ERROR_STK_BASE_NUM+0x400) /**< GATT server specific errors. */
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
-/**
- @}
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gap.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gap.h
deleted file mode 100755
index c434fefb..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gap.h
+++ /dev/null
@@ -1,2696 +0,0 @@
-/*
- * Copyright (c) 2011 - 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.
- */
-
-/**
- @addtogroup BLE_GAP Generic Access Profile (GAP)
- @{
- @brief Definitions and prototypes for the GAP interface.
- */
-
-#ifndef BLE_GAP_H__
-#define BLE_GAP_H__
-
-#include <stdint.h>
-#include "nrf_svc.h"
-#include "nrf_error.h"
-#include "ble_hci.h"
-#include "ble_ranges.h"
-#include "ble_types.h"
-#include "ble_err.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@addtogroup BLE_GAP_ENUMERATIONS Enumerations
- * @{ */
-
-/**@brief GAP API SVC numbers.
- */
-enum BLE_GAP_SVCS
-{
- SD_BLE_GAP_ADDR_SET = BLE_GAP_SVC_BASE, /**< Set own Bluetooth Address. */
- SD_BLE_GAP_ADDR_GET = BLE_GAP_SVC_BASE + 1, /**< Get own Bluetooth Address. */
- SD_BLE_GAP_WHITELIST_SET = BLE_GAP_SVC_BASE + 2, /**< Set active whitelist. */
- SD_BLE_GAP_DEVICE_IDENTITIES_SET = BLE_GAP_SVC_BASE + 3, /**< Set device identity list. */
- SD_BLE_GAP_PRIVACY_SET = BLE_GAP_SVC_BASE + 4, /**< Set Privacy settings*/
- SD_BLE_GAP_PRIVACY_GET = BLE_GAP_SVC_BASE + 5, /**< Get Privacy settings*/
- SD_BLE_GAP_ADV_SET_CONFIGURE = BLE_GAP_SVC_BASE + 6, /**< Configure an advertising set. */
- SD_BLE_GAP_ADV_START = BLE_GAP_SVC_BASE + 7, /**< Start Advertising. */
- SD_BLE_GAP_ADV_STOP = BLE_GAP_SVC_BASE + 8, /**< Stop Advertising. */
- SD_BLE_GAP_CONN_PARAM_UPDATE = BLE_GAP_SVC_BASE + 9, /**< Connection Parameter Update. */
- SD_BLE_GAP_DISCONNECT = BLE_GAP_SVC_BASE + 10, /**< Disconnect. */
- SD_BLE_GAP_TX_POWER_SET = BLE_GAP_SVC_BASE + 11, /**< Set TX Power. */
- SD_BLE_GAP_APPEARANCE_SET = BLE_GAP_SVC_BASE + 12, /**< Set Appearance. */
- SD_BLE_GAP_APPEARANCE_GET = BLE_GAP_SVC_BASE + 13, /**< Get Appearance. */
- SD_BLE_GAP_PPCP_SET = BLE_GAP_SVC_BASE + 14, /**< Set PPCP. */
- SD_BLE_GAP_PPCP_GET = BLE_GAP_SVC_BASE + 15, /**< Get PPCP. */
- SD_BLE_GAP_DEVICE_NAME_SET = BLE_GAP_SVC_BASE + 16, /**< Set Device Name. */
- SD_BLE_GAP_DEVICE_NAME_GET = BLE_GAP_SVC_BASE + 17, /**< Get Device Name. */
- SD_BLE_GAP_AUTHENTICATE = BLE_GAP_SVC_BASE + 18, /**< Initiate Pairing/Bonding. */
- SD_BLE_GAP_SEC_PARAMS_REPLY = BLE_GAP_SVC_BASE + 19, /**< Reply with Security Parameters. */
- SD_BLE_GAP_AUTH_KEY_REPLY = BLE_GAP_SVC_BASE + 20, /**< Reply with an authentication key. */
- SD_BLE_GAP_LESC_DHKEY_REPLY = BLE_GAP_SVC_BASE + 21, /**< Reply with an LE Secure Connections DHKey. */
- SD_BLE_GAP_KEYPRESS_NOTIFY = BLE_GAP_SVC_BASE + 22, /**< Notify of a keypress during an authentication procedure. */
- SD_BLE_GAP_LESC_OOB_DATA_GET = BLE_GAP_SVC_BASE + 23, /**< Get the local LE Secure Connections OOB data. */
- SD_BLE_GAP_LESC_OOB_DATA_SET = BLE_GAP_SVC_BASE + 24, /**< Set the remote LE Secure Connections OOB data. */
- SD_BLE_GAP_ENCRYPT = BLE_GAP_SVC_BASE + 25, /**< Initiate encryption procedure. */
- SD_BLE_GAP_SEC_INFO_REPLY = BLE_GAP_SVC_BASE + 26, /**< Reply with Security Information. */
- SD_BLE_GAP_CONN_SEC_GET = BLE_GAP_SVC_BASE + 27, /**< Obtain connection security level. */
- SD_BLE_GAP_RSSI_START = BLE_GAP_SVC_BASE + 28, /**< Start reporting of changes in RSSI. */
- SD_BLE_GAP_RSSI_STOP = BLE_GAP_SVC_BASE + 29, /**< Stop reporting of changes in RSSI. */
- SD_BLE_GAP_SCAN_START = BLE_GAP_SVC_BASE + 30, /**< Start Scanning. */
- SD_BLE_GAP_SCAN_STOP = BLE_GAP_SVC_BASE + 31, /**< Stop Scanning. */
- SD_BLE_GAP_CONNECT = BLE_GAP_SVC_BASE + 32, /**< Connect. */
- SD_BLE_GAP_CONNECT_CANCEL = BLE_GAP_SVC_BASE + 33, /**< Cancel ongoing connection procedure. */
- SD_BLE_GAP_RSSI_GET = BLE_GAP_SVC_BASE + 34, /**< Get the last RSSI sample. */
- SD_BLE_GAP_PHY_UPDATE = BLE_GAP_SVC_BASE + 35, /**< Initiate or respond to a PHY Update Procedure. */
- SD_BLE_GAP_DATA_LENGTH_UPDATE = BLE_GAP_SVC_BASE + 36, /**< Initiate or respond to a Data Length Update Procedure. */
- SD_BLE_GAP_QOS_CHANNEL_SURVEY_START = BLE_GAP_SVC_BASE + 37, /**< Start Quality of Service (QoS) channel survey module. */
- SD_BLE_GAP_QOS_CHANNEL_SURVEY_STOP = BLE_GAP_SVC_BASE + 38, /**< Stop Quality of Service (QoS) channel survey module. */
- SD_BLE_GAP_ADV_ADDR_GET = BLE_GAP_SVC_BASE + 39, /**< Get the Address used on air while Advertising. */
-};
-
-/**@brief GAP Event IDs.
- * IDs that uniquely identify an event coming from the stack to the application.
- */
-enum BLE_GAP_EVTS
-{
- BLE_GAP_EVT_CONNECTED = BLE_GAP_EVT_BASE, /**< Connected to peer. \n See @ref ble_gap_evt_connected_t */
- BLE_GAP_EVT_DISCONNECTED = BLE_GAP_EVT_BASE + 1, /**< Disconnected from peer. \n See @ref ble_gap_evt_disconnected_t. */
- BLE_GAP_EVT_CONN_PARAM_UPDATE = BLE_GAP_EVT_BASE + 2, /**< Connection Parameters updated. \n See @ref ble_gap_evt_conn_param_update_t. */
- BLE_GAP_EVT_SEC_PARAMS_REQUEST = BLE_GAP_EVT_BASE + 3, /**< Request to provide security parameters. \n Reply with @ref sd_ble_gap_sec_params_reply. \n See @ref ble_gap_evt_sec_params_request_t. */
- BLE_GAP_EVT_SEC_INFO_REQUEST = BLE_GAP_EVT_BASE + 4, /**< Request to provide security information. \n Reply with @ref sd_ble_gap_sec_info_reply. \n See @ref ble_gap_evt_sec_info_request_t. */
- BLE_GAP_EVT_PASSKEY_DISPLAY = BLE_GAP_EVT_BASE + 5, /**< Request to display a passkey to the user. \n In LESC Numeric Comparison, reply with @ref sd_ble_gap_auth_key_reply. \n See @ref ble_gap_evt_passkey_display_t. */
- BLE_GAP_EVT_KEY_PRESSED = BLE_GAP_EVT_BASE + 6, /**< Notification of a keypress on the remote device.\n See @ref ble_gap_evt_key_pressed_t */
- BLE_GAP_EVT_AUTH_KEY_REQUEST = BLE_GAP_EVT_BASE + 7, /**< Request to provide an authentication key. \n Reply with @ref sd_ble_gap_auth_key_reply. \n See @ref ble_gap_evt_auth_key_request_t. */
- BLE_GAP_EVT_LESC_DHKEY_REQUEST = BLE_GAP_EVT_BASE + 8, /**< Request to calculate an LE Secure Connections DHKey. \n Reply with @ref sd_ble_gap_lesc_dhkey_reply. \n See @ref ble_gap_evt_lesc_dhkey_request_t */
- BLE_GAP_EVT_AUTH_STATUS = BLE_GAP_EVT_BASE + 9, /**< Authentication procedure completed with status. \n See @ref ble_gap_evt_auth_status_t. */
- BLE_GAP_EVT_CONN_SEC_UPDATE = BLE_GAP_EVT_BASE + 10, /**< Connection security updated. \n See @ref ble_gap_evt_conn_sec_update_t. */
- BLE_GAP_EVT_TIMEOUT = BLE_GAP_EVT_BASE + 11, /**< Timeout expired. \n See @ref ble_gap_evt_timeout_t. */
- BLE_GAP_EVT_RSSI_CHANGED = BLE_GAP_EVT_BASE + 12, /**< RSSI report. \n See @ref ble_gap_evt_rssi_changed_t. */
- BLE_GAP_EVT_ADV_REPORT = BLE_GAP_EVT_BASE + 13, /**< Advertising report. \n See @ref ble_gap_evt_adv_report_t. */
- BLE_GAP_EVT_SEC_REQUEST = BLE_GAP_EVT_BASE + 14, /**< Security Request. \n See @ref ble_gap_evt_sec_request_t. */
- BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST = BLE_GAP_EVT_BASE + 15, /**< Connection Parameter Update Request. \n Reply with @ref sd_ble_gap_conn_param_update. \n See @ref ble_gap_evt_conn_param_update_request_t. */
- BLE_GAP_EVT_SCAN_REQ_REPORT = BLE_GAP_EVT_BASE + 16, /**< Scan request report. \n See @ref ble_gap_evt_scan_req_report_t. */
- BLE_GAP_EVT_PHY_UPDATE_REQUEST = BLE_GAP_EVT_BASE + 17, /**< PHY Update Request. \n Reply with @ref sd_ble_gap_phy_update. \n See @ref ble_gap_evt_phy_update_request_t. */
- BLE_GAP_EVT_PHY_UPDATE = BLE_GAP_EVT_BASE + 18, /**< PHY Update Procedure is complete. \n See @ref ble_gap_evt_phy_update_t. */
- BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST = BLE_GAP_EVT_BASE + 19, /**< Data Length Update Request. \n Reply with @ref sd_ble_gap_data_length_update.\n See @ref ble_gap_evt_data_length_update_request_t. */
- BLE_GAP_EVT_DATA_LENGTH_UPDATE = BLE_GAP_EVT_BASE + 20, /**< LL Data Channel PDU payload length updated. \n See @ref ble_gap_evt_data_length_update_t. */
- BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT = BLE_GAP_EVT_BASE + 21, /**< Channel survey report. \n See @ref ble_gap_evt_qos_channel_survey_report_t. */
- BLE_GAP_EVT_ADV_SET_TERMINATED = BLE_GAP_EVT_BASE + 22, /**< Advertising set terminated. \n See @ref ble_gap_evt_adv_set_terminated_t. */
-};
-
-/**@brief GAP Option IDs.
- * IDs that uniquely identify a GAP option.
- */
-enum BLE_GAP_OPTS
-{
- BLE_GAP_OPT_CH_MAP = BLE_GAP_OPT_BASE, /**< Channel Map. @ref ble_gap_opt_ch_map_t */
- BLE_GAP_OPT_LOCAL_CONN_LATENCY = BLE_GAP_OPT_BASE + 1, /**< Local connection latency. @ref ble_gap_opt_local_conn_latency_t */
- BLE_GAP_OPT_PASSKEY = BLE_GAP_OPT_BASE + 2, /**< Set passkey. @ref ble_gap_opt_passkey_t */
- BLE_GAP_OPT_COMPAT_MODE_1 = BLE_GAP_OPT_BASE + 3, /**< Compatibility mode. @ref ble_gap_opt_compat_mode_1_t */
- BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT = BLE_GAP_OPT_BASE + 4, /**< Set Authenticated payload timeout. @ref ble_gap_opt_auth_payload_timeout_t */
- BLE_GAP_OPT_SLAVE_LATENCY_DISABLE = BLE_GAP_OPT_BASE + 5, /**< Disable slave latency. @ref ble_gap_opt_slave_latency_disable_t */
-};
-
-/**@brief GAP Configuration IDs.
- *
- * IDs that uniquely identify a GAP configuration.
- */
-enum BLE_GAP_CFGS
-{
- BLE_GAP_CFG_ROLE_COUNT = BLE_GAP_CFG_BASE, /**< Role count configuration. */
- BLE_GAP_CFG_DEVICE_NAME = BLE_GAP_CFG_BASE + 1, /**< Device name configuration. */
-};
-
-/**@brief GAP TX Power roles.
- */
-enum BLE_GAP_TX_POWER_ROLES
-{
- BLE_GAP_TX_POWER_ROLE_ADV = 1, /**< Advertiser role. */
- BLE_GAP_TX_POWER_ROLE_SCAN_INIT = 2, /**< Scanner and initiator role. */
- BLE_GAP_TX_POWER_ROLE_CONN = 3, /**< Connection role. */
-};
-
-/** @} */
-
-/**@addtogroup BLE_GAP_DEFINES Defines
- * @{ */
-
-/**@defgroup BLE_ERRORS_GAP SVC return values specific to GAP
- * @{ */
-#define BLE_ERROR_GAP_UUID_LIST_MISMATCH (NRF_GAP_ERR_BASE + 0x000) /**< UUID list does not contain an integral number of UUIDs. */
-#define BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST (NRF_GAP_ERR_BASE + 0x001) /**< Use of Whitelist not permitted with discoverable advertising. */
-#define BLE_ERROR_GAP_INVALID_BLE_ADDR (NRF_GAP_ERR_BASE + 0x002) /**< The upper two bits of the address do not correspond to the specified address type. */
-#define BLE_ERROR_GAP_WHITELIST_IN_USE (NRF_GAP_ERR_BASE + 0x003) /**< Attempt to modify the whitelist while already in use by another operation. */
-#define BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE (NRF_GAP_ERR_BASE + 0x004) /**< Attempt to modify the device identity list while already in use by another operation. */
-#define BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE (NRF_GAP_ERR_BASE + 0x005) /**< The device identity list contains entries with duplicate identity addresses. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_ROLES GAP Roles
- * @{ */
-#define BLE_GAP_ROLE_INVALID 0x0 /**< Invalid Role. */
-#define BLE_GAP_ROLE_PERIPH 0x1 /**< Peripheral Role. */
-#define BLE_GAP_ROLE_CENTRAL 0x2 /**< Central Role. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_TIMEOUT_SOURCES GAP Timeout sources
- * @{ */
-#define BLE_GAP_TIMEOUT_SRC_SCAN 0x01 /**< Scanning timeout. */
-#define BLE_GAP_TIMEOUT_SRC_CONN 0x02 /**< Connection timeout. */
-#define BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD 0x03 /**< Authenticated payload timeout. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_ADDR_TYPES GAP Address types
- * @{ */
-#define BLE_GAP_ADDR_TYPE_PUBLIC 0x00 /**< Public (identity) address.*/
-#define BLE_GAP_ADDR_TYPE_RANDOM_STATIC 0x01 /**< Random static (identity) address. */
-#define BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE 0x02 /**< Random private resolvable address. */
-#define BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE 0x03 /**< Random private non-resolvable address. */
-#define BLE_GAP_ADDR_TYPE_ANONYMOUS 0x7F /**< An advertiser may advertise without its address.
- This type of advertising is called anonymous. */
-/**@} */
-
-
-/**@brief The default interval in seconds at which a private address is refreshed. */
-#define BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S (900) /* 15 minutes. */
-/**@brief The maximum interval in seconds at which a private address can be refreshed. */
-#define BLE_GAP_MAX_PRIVATE_ADDR_CYCLE_INTERVAL_S (41400) /* 11 hours 30 minutes. */
-
-
-/** @brief BLE address length. */
-#define BLE_GAP_ADDR_LEN (6)
-
-/**@defgroup BLE_GAP_PRIVACY_MODES Privacy modes
- * @{ */
-#define BLE_GAP_PRIVACY_MODE_OFF 0x00 /**< Device will send and accept its identity address for its own address. */
-#define BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY 0x01 /**< Device will send and accept only private addresses for its own address. */
-#define BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY 0x02 /**< Device will send and accept only private addresses for its own address,
- and will not accept a peer using identity address as sender address when
- the peer IRK is exchanged, non-zero and added to the identity list. */
-/**@} */
-
-/** @brief Invalid power level. */
-#define BLE_GAP_POWER_LEVEL_INVALID 127
-
-/** @brief Advertising set handle not set. */
-#define BLE_GAP_ADV_SET_HANDLE_NOT_SET (0xFF)
-
-/** @brief The default number of advertising sets. */
-#define BLE_GAP_ADV_SET_COUNT_DEFAULT (1)
-
-/** @brief The maximum number of advertising sets supported by this SoftDevice. */
-#define BLE_GAP_ADV_SET_COUNT_MAX (1)
-
-/**@defgroup BLE_GAP_ADV_SET_DATA_SIZES Advertising data sizes.
- * @{ */
-#define BLE_GAP_ADV_SET_DATA_SIZE_MAX (31) /**< Maximum data length for an advertising set.
- If more advertising data is required, use extended advertising instead. */
-#define BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED (255) /**< Maximum supported data length for an extended advertising set. */
-
-#define BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED (238) /**< Maximum supported data length for an extended connectable advertising set. */
-/**@}. */
-
-/** @brief Set ID not available in advertising report. */
-#define BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE 0xFF
-
-/**@defgroup BLE_GAP_EVT_ADV_SET_TERMINATED_REASON GAP Advertising Set Terminated reasons
- * @{ */
-#define BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_TIMEOUT 0x01 /**< Timeout value reached. */
-#define BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_LIMIT_REACHED 0x02 /**< @ref ble_gap_adv_params_t::max_adv_evts was reached. */
-/**@} */
-
-/**@defgroup BLE_GAP_AD_TYPE_DEFINITIONS GAP Advertising and Scan Response Data format
- * @note Found at https://www.bluetooth.org/Technical/AssignedNumbers/generic_access_profile.htm
- * @{ */
-#define BLE_GAP_AD_TYPE_FLAGS 0x01 /**< Flags for discoverability. */
-#define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE 0x02 /**< Partial list of 16 bit service UUIDs. */
-#define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE 0x03 /**< Complete list of 16 bit service UUIDs. */
-#define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE 0x04 /**< Partial list of 32 bit service UUIDs. */
-#define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE 0x05 /**< Complete list of 32 bit service UUIDs. */
-#define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE 0x06 /**< Partial list of 128 bit service UUIDs. */
-#define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE 0x07 /**< Complete list of 128 bit service UUIDs. */
-#define BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME 0x08 /**< Short local device name. */
-#define BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME 0x09 /**< Complete local device name. */
-#define BLE_GAP_AD_TYPE_TX_POWER_LEVEL 0x0A /**< Transmit power level. */
-#define BLE_GAP_AD_TYPE_CLASS_OF_DEVICE 0x0D /**< Class of device. */
-#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C 0x0E /**< Simple Pairing Hash C. */
-#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R 0x0F /**< Simple Pairing Randomizer R. */
-#define BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE 0x10 /**< Security Manager TK Value. */
-#define BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS 0x11 /**< Security Manager Out Of Band Flags. */
-#define BLE_GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE 0x12 /**< Slave Connection Interval Range. */
-#define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT 0x14 /**< List of 16-bit Service Solicitation UUIDs. */
-#define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT 0x15 /**< List of 128-bit Service Solicitation UUIDs. */
-#define BLE_GAP_AD_TYPE_SERVICE_DATA 0x16 /**< Service Data - 16-bit UUID. */
-#define BLE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS 0x17 /**< Public Target Address. */
-#define BLE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS 0x18 /**< Random Target Address. */
-#define BLE_GAP_AD_TYPE_APPEARANCE 0x19 /**< Appearance. */
-#define BLE_GAP_AD_TYPE_ADVERTISING_INTERVAL 0x1A /**< Advertising Interval. */
-#define BLE_GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS 0x1B /**< LE Bluetooth Device Address. */
-#define BLE_GAP_AD_TYPE_LE_ROLE 0x1C /**< LE Role. */
-#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256 0x1D /**< Simple Pairing Hash C-256. */
-#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256 0x1E /**< Simple Pairing Randomizer R-256. */
-#define BLE_GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID 0x20 /**< Service Data - 32-bit UUID. */
-#define BLE_GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID 0x21 /**< Service Data - 128-bit UUID. */
-#define BLE_GAP_AD_TYPE_LESC_CONFIRMATION_VALUE 0x22 /**< LE Secure Connections Confirmation Value */
-#define BLE_GAP_AD_TYPE_LESC_RANDOM_VALUE 0x23 /**< LE Secure Connections Random Value */
-#define BLE_GAP_AD_TYPE_URI 0x24 /**< URI */
-#define BLE_GAP_AD_TYPE_3D_INFORMATION_DATA 0x3D /**< 3D Information Data. */
-#define BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA 0xFF /**< Manufacturer Specific Data. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_ADV_FLAGS GAP Advertisement Flags
- * @{ */
-#define BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE (0x01) /**< LE Limited Discoverable Mode. */
-#define BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE (0x02) /**< LE General Discoverable Mode. */
-#define BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED (0x04) /**< BR/EDR not supported. */
-#define BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER (0x08) /**< Simultaneous LE and BR/EDR, Controller. */
-#define BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST (0x10) /**< Simultaneous LE and BR/EDR, Host. */
-#define BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE (BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED) /**< LE Limited Discoverable Mode, BR/EDR not supported. */
-#define BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE (BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED) /**< LE General Discoverable Mode, BR/EDR not supported. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_ADV_INTERVALS GAP Advertising interval max and min
- * @{ */
-#define BLE_GAP_ADV_INTERVAL_MIN 0x000020 /**< Minimum Advertising interval in 625 us units, i.e. 20 ms. */
-#define BLE_GAP_ADV_INTERVAL_MAX 0x004000 /**< Maximum Advertising interval in 625 us units, i.e. 10.24 s. */
- /**@} */
-
-
-/**@defgroup BLE_GAP_SCAN_INTERVALS GAP Scan interval max and min
- * @{ */
-#define BLE_GAP_SCAN_INTERVAL_MIN 0x0004 /**< Minimum Scan interval in 625 us units, i.e. 2.5 ms. */
-#define BLE_GAP_SCAN_INTERVAL_MAX 0xFFFF /**< Maximum Scan interval in 625 us units, i.e. 40,959.375 s. */
- /** @} */
-
-
-/**@defgroup BLE_GAP_SCAN_WINDOW GAP Scan window max and min
- * @{ */
-#define BLE_GAP_SCAN_WINDOW_MIN 0x0004 /**< Minimum Scan window in 625 us units, i.e. 2.5 ms. */
-#define BLE_GAP_SCAN_WINDOW_MAX 0xFFFF /**< Maximum Scan window in 625 us units, i.e. 40,959.375 s. */
- /** @} */
-
-
-/**@defgroup BLE_GAP_SCAN_TIMEOUT GAP Scan timeout max and min
- * @{ */
-#define BLE_GAP_SCAN_TIMEOUT_MIN 0x0001 /**< Minimum Scan timeout in 10 ms units, i.e 10 ms. */
-#define BLE_GAP_SCAN_TIMEOUT_UNLIMITED 0x0000 /**< Continue to scan forever. */
- /** @} */
-
-/**@defgroup BLE_GAP_SCAN_BUFFER_SIZE GAP Minimum scanner buffer size
- *
- * Scan buffers are used for storing advertising data received from an advertiser.
- * If ble_gap_scan_params_t::extended is set to 0, @ref BLE_GAP_SCAN_BUFFER_MIN is the minimum scan buffer length.
- * else the minimum scan buffer size is @ref BLE_GAP_SCAN_BUFFER_EXTENDED_MIN.
- * @{ */
-#define BLE_GAP_SCAN_BUFFER_MIN (31) /**< Minimum data length for an
- advertising set. */
-#define BLE_GAP_SCAN_BUFFER_MAX (31) /**< Maximum data length for an
- advertising set. */
-#define BLE_GAP_SCAN_BUFFER_EXTENDED_MIN (255) /**< Minimum data length for an
- extended advertising set. */
-#define BLE_GAP_SCAN_BUFFER_EXTENDED_MAX (1650) /**< Maximum data length for an
- extended advertising set. */
-#define BLE_GAP_SCAN_BUFFER_EXTENDED_MAX_SUPPORTED (255) /**< Maximum supported data length for
- an extended advertising set. */
-/** @} */
-
-/**@defgroup BLE_GAP_ADV_TYPES GAP Advertising types
- *
- * Advertising types defined in Bluetooth Core Specification v5.0, Vol 6, Part B, Section 4.4.2.
- *
- * The maximum advertising data length is defined by @ref BLE_GAP_ADV_SET_DATA_SIZE_MAX.
- * The maximum supported data length for an extended advertiser is defined by
- * @ref BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED
- * Note that some of the advertising types do not support advertising data. Non-scannable types do not support
- * scan response data.
- *
- * @{ */
-#define BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED 0x01 /**< Connectable and scannable undirected
- advertising events. */
-#define BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE 0x02 /**< Connectable non-scannable directed advertising
- events. Advertising interval is less that 3.75 ms.
- Use this type for fast reconnections.
- @note Advertising data is not supported. */
-#define BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED 0x03 /**< Connectable non-scannable directed advertising
- events.
- @note Advertising data is not supported. */
-#define BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED 0x04 /**< Non-connectable scannable undirected
- advertising events. */
-#define BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED 0x05 /**< Non-connectable non-scannable undirected
- advertising events. */
-#define BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED 0x06 /**< Connectable non-scannable undirected advertising
- events using extended advertising PDUs. */
-#define BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_DIRECTED 0x07 /**< Connectable non-scannable directed advertising
- events using extended advertising PDUs. */
-#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED 0x08 /**< Non-connectable scannable undirected advertising
- events using extended advertising PDUs.
- @note Only scan response data is supported. */
-#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_DIRECTED 0x09 /**< Non-connectable scannable directed advertising
- events using extended advertising PDUs.
- @note Only scan response data is supported. */
-#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED 0x0A /**< Non-connectable non-scannable undirected advertising
- events using extended advertising PDUs. */
-#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_DIRECTED 0x0B /**< Non-connectable non-scannable directed advertising
- events using extended advertising PDUs. */
-/**@} */
-
-/**@defgroup BLE_GAP_ADV_FILTER_POLICIES GAP Advertising filter policies
- * @{ */
-#define BLE_GAP_ADV_FP_ANY 0x00 /**< Allow scan requests and connect requests from any device. */
-#define BLE_GAP_ADV_FP_FILTER_SCANREQ 0x01 /**< Filter scan requests with whitelist. */
-#define BLE_GAP_ADV_FP_FILTER_CONNREQ 0x02 /**< Filter connect requests with whitelist. */
-#define BLE_GAP_ADV_FP_FILTER_BOTH 0x03 /**< Filter both scan and connect requests with whitelist. */
-/**@} */
-
-/**@defgroup BLE_GAP_ADV_DATA_STATUS GAP Advertising data status
- * @{ */
-#define BLE_GAP_ADV_DATA_STATUS_COMPLETE 0x00 /**< All data in the advertising event have been received. */
-#define BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA 0x01 /**< More data to be received.
- @note This value will only be used if
- @ref ble_gap_scan_params_t::report_incomplete_evts and
- @ref ble_gap_adv_report_type_t::extended_pdu are set to true. */
-#define BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_TRUNCATED 0x02 /**< Incomplete data. Buffer size insufficient to receive more.
- @note This value will only be used if
- @ref ble_gap_adv_report_type_t::extended_pdu is set to true. */
-#define BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MISSED 0x03 /**< Failed to receive the remaining data.
- @note This value will only be used if
- @ref ble_gap_adv_report_type_t::extended_pdu is set to true. */
-/**@} */
-
-/**@defgroup BLE_GAP_SCAN_FILTER_POLICIES GAP Scanner filter policies
- * @{ */
-#define BLE_GAP_SCAN_FP_ACCEPT_ALL 0x00 /**< Accept all advertising packets except directed advertising packets
- not addressed to this device. */
-#define BLE_GAP_SCAN_FP_WHITELIST 0x01 /**< Accept advertising packets from devices in the whitelist except directed
- packets not addressed to this device. */
-#define BLE_GAP_SCAN_FP_ALL_NOT_RESOLVED_DIRECTED 0x02 /**< Accept all advertising packets specified in @ref BLE_GAP_SCAN_FP_ACCEPT_ALL.
- In addition, accept directed advertising packets, where the advertiser's
- address is a resolvable private address that cannot be resolved. */
-#define BLE_GAP_SCAN_FP_WHITELIST_NOT_RESOLVED_DIRECTED 0x03 /**< Accept all advertising packets specified in @ref BLE_GAP_SCAN_FP_WHITELIST.
- In addition, accept directed advertising packets, where the advertiser's
- address is a resolvable private address that cannot be resolved. */
-/**@} */
-
-/**@defgroup BLE_GAP_ADV_TIMEOUT_VALUES GAP Advertising timeout values in 10 ms units
- * @{ */
-#define BLE_GAP_ADV_TIMEOUT_HIGH_DUTY_MAX (128) /**< Maximum high duty advertising time in 10 ms units. Corresponds to 1.28 s. */
-#define BLE_GAP_ADV_TIMEOUT_LIMITED_MAX (18000) /**< Maximum advertising time in 10 ms units corresponding to TGAP(lim_adv_timeout) = 180 s in limited discoverable mode. */
-#define BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED (0) /**< Unlimited advertising in general discoverable mode.
- For high duty cycle advertising, this corresponds to @ref BLE_GAP_ADV_TIMEOUT_HIGH_DUTY_MAX. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_DISC_MODES GAP Discovery modes
- * @{ */
-#define BLE_GAP_DISC_MODE_NOT_DISCOVERABLE 0x00 /**< Not discoverable discovery Mode. */
-#define BLE_GAP_DISC_MODE_LIMITED 0x01 /**< Limited Discovery Mode. */
-#define BLE_GAP_DISC_MODE_GENERAL 0x02 /**< General Discovery Mode. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_IO_CAPS GAP IO Capabilities
- * @{ */
-#define BLE_GAP_IO_CAPS_DISPLAY_ONLY 0x00 /**< Display Only. */
-#define BLE_GAP_IO_CAPS_DISPLAY_YESNO 0x01 /**< Display and Yes/No entry. */
-#define BLE_GAP_IO_CAPS_KEYBOARD_ONLY 0x02 /**< Keyboard Only. */
-#define BLE_GAP_IO_CAPS_NONE 0x03 /**< No I/O capabilities. */
-#define BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY 0x04 /**< Keyboard and Display. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_AUTH_KEY_TYPES GAP Authentication Key Types
- * @{ */
-#define BLE_GAP_AUTH_KEY_TYPE_NONE 0x00 /**< No key (may be used to reject). */
-#define BLE_GAP_AUTH_KEY_TYPE_PASSKEY 0x01 /**< 6-digit Passkey. */
-#define BLE_GAP_AUTH_KEY_TYPE_OOB 0x02 /**< Out Of Band data. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_KP_NOT_TYPES GAP Keypress Notification Types
- * @{ */
-#define BLE_GAP_KP_NOT_TYPE_PASSKEY_START 0x00 /**< Passkey entry started. */
-#define BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_IN 0x01 /**< Passkey digit entered. */
-#define BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_OUT 0x02 /**< Passkey digit erased. */
-#define BLE_GAP_KP_NOT_TYPE_PASSKEY_CLEAR 0x03 /**< Passkey cleared. */
-#define BLE_GAP_KP_NOT_TYPE_PASSKEY_END 0x04 /**< Passkey entry completed. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_SEC_STATUS GAP Security status
- * @{ */
-#define BLE_GAP_SEC_STATUS_SUCCESS 0x00 /**< Procedure completed with success. */
-#define BLE_GAP_SEC_STATUS_TIMEOUT 0x01 /**< Procedure timed out. */
-#define BLE_GAP_SEC_STATUS_PDU_INVALID 0x02 /**< Invalid PDU received. */
-#define BLE_GAP_SEC_STATUS_RFU_RANGE1_BEGIN 0x03 /**< Reserved for Future Use range #1 begin. */
-#define BLE_GAP_SEC_STATUS_RFU_RANGE1_END 0x80 /**< Reserved for Future Use range #1 end. */
-#define BLE_GAP_SEC_STATUS_PASSKEY_ENTRY_FAILED 0x81 /**< Passkey entry failed (user canceled or other). */
-#define BLE_GAP_SEC_STATUS_OOB_NOT_AVAILABLE 0x82 /**< Out of Band Key not available. */
-#define BLE_GAP_SEC_STATUS_AUTH_REQ 0x83 /**< Authentication requirements not met. */
-#define BLE_GAP_SEC_STATUS_CONFIRM_VALUE 0x84 /**< Confirm value failed. */
-#define BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP 0x85 /**< Pairing not supported. */
-#define BLE_GAP_SEC_STATUS_ENC_KEY_SIZE 0x86 /**< Encryption key size. */
-#define BLE_GAP_SEC_STATUS_SMP_CMD_UNSUPPORTED 0x87 /**< Unsupported SMP command. */
-#define BLE_GAP_SEC_STATUS_UNSPECIFIED 0x88 /**< Unspecified reason. */
-#define BLE_GAP_SEC_STATUS_REPEATED_ATTEMPTS 0x89 /**< Too little time elapsed since last attempt. */
-#define BLE_GAP_SEC_STATUS_INVALID_PARAMS 0x8A /**< Invalid parameters. */
-#define BLE_GAP_SEC_STATUS_DHKEY_FAILURE 0x8B /**< DHKey check failure. */
-#define BLE_GAP_SEC_STATUS_NUM_COMP_FAILURE 0x8C /**< Numeric Comparison failure. */
-#define BLE_GAP_SEC_STATUS_BR_EDR_IN_PROG 0x8D /**< BR/EDR pairing in progress. */
-#define BLE_GAP_SEC_STATUS_X_TRANS_KEY_DISALLOWED 0x8E /**< BR/EDR Link Key cannot be used for LE keys. */
-#define BLE_GAP_SEC_STATUS_RFU_RANGE2_BEGIN 0x8F /**< Reserved for Future Use range #2 begin. */
-#define BLE_GAP_SEC_STATUS_RFU_RANGE2_END 0xFF /**< Reserved for Future Use range #2 end. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_SEC_STATUS_SOURCES GAP Security status sources
- * @{ */
-#define BLE_GAP_SEC_STATUS_SOURCE_LOCAL 0x00 /**< Local failure. */
-#define BLE_GAP_SEC_STATUS_SOURCE_REMOTE 0x01 /**< Remote failure. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_CP_LIMITS GAP Connection Parameters Limits
- * @{ */
-#define BLE_GAP_CP_MIN_CONN_INTVL_NONE 0xFFFF /**< No new minimum connection interval specified in connect parameters. */
-#define BLE_GAP_CP_MIN_CONN_INTVL_MIN 0x0006 /**< Lowest minimum connection interval permitted, in units of 1.25 ms, i.e. 7.5 ms. */
-#define BLE_GAP_CP_MIN_CONN_INTVL_MAX 0x0C80 /**< Highest minimum connection interval permitted, in units of 1.25 ms, i.e. 4 s. */
-#define BLE_GAP_CP_MAX_CONN_INTVL_NONE 0xFFFF /**< No new maximum connection interval specified in connect parameters. */
-#define BLE_GAP_CP_MAX_CONN_INTVL_MIN 0x0006 /**< Lowest maximum connection interval permitted, in units of 1.25 ms, i.e. 7.5 ms. */
-#define BLE_GAP_CP_MAX_CONN_INTVL_MAX 0x0C80 /**< Highest maximum connection interval permitted, in units of 1.25 ms, i.e. 4 s. */
-#define BLE_GAP_CP_SLAVE_LATENCY_MAX 0x01F3 /**< Highest slave latency permitted, in connection events. */
-#define BLE_GAP_CP_CONN_SUP_TIMEOUT_NONE 0xFFFF /**< No new supervision timeout specified in connect parameters. */
-#define BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN 0x000A /**< Lowest supervision timeout permitted, in units of 10 ms, i.e. 100 ms. */
-#define BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX 0x0C80 /**< Highest supervision timeout permitted, in units of 10 ms, i.e. 32 s. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_DEVNAME GAP device name defines.
- * @{ */
-#define BLE_GAP_DEVNAME_DEFAULT "nRF5x" /**< Default device name value. */
-#define BLE_GAP_DEVNAME_DEFAULT_LEN 31 /**< Default number of octets in device name. */
-#define BLE_GAP_DEVNAME_MAX_LEN 248 /**< Maximum number of octets in device name. */
-/**@} */
-
-
-/**@brief Disable RSSI events for connections */
-#define BLE_GAP_RSSI_THRESHOLD_INVALID 0xFF
-
-/**@defgroup BLE_GAP_PHYS GAP PHYs
- * @{ */
-#define BLE_GAP_PHY_AUTO 0x00 /**< Automatic PHY selection. Refer @ref sd_ble_gap_phy_update for more information.*/
-#define BLE_GAP_PHY_1MBPS 0x01 /**< 1 Mbps PHY. */
-#define BLE_GAP_PHY_2MBPS 0x02 /**< 2 Mbps PHY. */
-#define BLE_GAP_PHY_CODED 0x04 /**< Coded PHY. */
-#define BLE_GAP_PHY_NOT_SET 0xFF /**< PHY is not configured. */
-
-/**@brief Supported PHYs in connections, for scanning, and for advertising. */
-#define BLE_GAP_PHYS_SUPPORTED (BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS | BLE_GAP_PHY_CODED) /**< All PHYs are supported. */
-
-/**@} */
-
-/**@defgroup BLE_GAP_CONN_SEC_MODE_SET_MACROS GAP attribute security requirement setters
- *
- * See @ref ble_gap_conn_sec_mode_t.
- * @{ */
-/**@brief Set sec_mode pointed to by ptr to have no access rights.*/
-#define BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(ptr) do {(ptr)->sm = 0; (ptr)->lv = 0;} while(0)
-/**@brief Set sec_mode pointed to by ptr to require no protection, open link.*/
-#define BLE_GAP_CONN_SEC_MODE_SET_OPEN(ptr) do {(ptr)->sm = 1; (ptr)->lv = 1;} while(0)
-/**@brief Set sec_mode pointed to by ptr to require encryption, but no MITM protection.*/
-#define BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 2;} while(0)
-/**@brief Set sec_mode pointed to by ptr to require encryption and MITM protection.*/
-#define BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 3;} while(0)
-/**@brief Set sec_mode pointed to by ptr to require LESC encryption and MITM protection.*/
-#define BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 4;} while(0)
-/**@brief Set sec_mode pointed to by ptr to require signing or encryption, no MITM protection needed.*/
-#define BLE_GAP_CONN_SEC_MODE_SET_SIGNED_NO_MITM(ptr) do {(ptr)->sm = 2; (ptr)->lv = 1;} while(0)
-/**@brief Set sec_mode pointed to by ptr to require signing or encryption with MITM protection.*/
-#define BLE_GAP_CONN_SEC_MODE_SET_SIGNED_WITH_MITM(ptr) do {(ptr)->sm = 2; (ptr)->lv = 2;} while(0)
-/**@} */
-
-
-/**@brief GAP Security Random Number Length. */
-#define BLE_GAP_SEC_RAND_LEN 8
-
-
-/**@brief GAP Security Key Length. */
-#define BLE_GAP_SEC_KEY_LEN 16
-
-
-/**@brief GAP LE Secure Connections Elliptic Curve Diffie-Hellman P-256 Public Key Length. */
-#define BLE_GAP_LESC_P256_PK_LEN 64
-
-
-/**@brief GAP LE Secure Connections Elliptic Curve Diffie-Hellman DHKey Length. */
-#define BLE_GAP_LESC_DHKEY_LEN 32
-
-
-/**@brief GAP Passkey Length. */
-#define BLE_GAP_PASSKEY_LEN 6
-
-
-/**@brief Maximum amount of addresses in the whitelist. */
-#define BLE_GAP_WHITELIST_ADDR_MAX_COUNT (8)
-
-
-/**@brief Maximum amount of identities in the device identities list. */
-#define BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT (8)
-
-
-/**@brief Default connection count for a configuration. */
-#define BLE_GAP_CONN_COUNT_DEFAULT (1)
-
-
-/**@defgroup BLE_GAP_EVENT_LENGTH GAP event length defines.
- * @{ */
-#define BLE_GAP_EVENT_LENGTH_MIN (2) /**< Minimum event length, in 1.25 ms units. */
-#define BLE_GAP_EVENT_LENGTH_CODED_PHY_MIN (6) /**< The shortest event length in 1.25 ms units supporting LE Coded PHY. */
-#define BLE_GAP_EVENT_LENGTH_DEFAULT (3) /**< Default event length, in 1.25 ms units. */
-/**@} */
-
-
-/**@defgroup BLE_GAP_ROLE_COUNT GAP concurrent connection count defines.
- * @{ */
-#define BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT (1) /**< Default maximum number of connections concurrently acting as peripherals. */
-#define BLE_GAP_ROLE_COUNT_CENTRAL_DEFAULT (3) /**< Default maximum number of connections concurrently acting as centrals. */
-#define BLE_GAP_ROLE_COUNT_CENTRAL_SEC_DEFAULT (1) /**< Default number of SMP instances shared between all connections acting as centrals. */
-#define BLE_GAP_ROLE_COUNT_COMBINED_MAX (20) /**< Maximum supported number of concurrent connections in the peripheral and central roles combined. */
-
-/**@} */
-
-/**@brief Automatic data length parameter. */
-#define BLE_GAP_DATA_LENGTH_AUTO 0
-
-/**@defgroup BLE_GAP_AUTH_PAYLOAD_TIMEOUT Authenticated payload timeout defines.
- * @{ */
-#define BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX (48000) /**< Maximum authenticated payload timeout in 10 ms units, i.e. 8 minutes. */
-#define BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MIN (1) /**< Minimum authenticated payload timeout in 10 ms units, i.e. 10 ms. */
-/**@} */
-
-/**@defgroup GAP_SEC_MODES GAP Security Modes
- * @{ */
-#define BLE_GAP_SEC_MODE 0x00 /**< No key (may be used to reject). */
-/**@} */
-
-/**@brief The total number of channels in Bluetooth Low Energy. */
-#define BLE_GAP_CHANNEL_COUNT (40)
-
-/**@defgroup BLE_GAP_QOS_CHANNEL_SURVEY_INTERVALS Quality of Service (QoS) Channel survey interval defines
- * @{ */
-#define BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_CONTINUOUS (0) /**< Continuous channel survey. */
-#define BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_MIN_US (7500) /**< Minimum channel survey interval in microseconds (7.5 ms). */
-#define BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_MAX_US (4000000) /**< Maximum channel survey interval in microseconds (4 s). */
- /**@} */
-
-/** @} */
-
-
-/**@addtogroup BLE_GAP_STRUCTURES Structures
- * @{ */
-
-/**@brief Advertising event properties. */
-typedef struct
-{
- uint8_t type; /**< Advertising type. See @ref BLE_GAP_ADV_TYPES. */
- uint8_t anonymous : 1; /**< Omit advertiser's address from all PDUs.
- @note Anonymous advertising is only available for
- @ref BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED and
- @ref BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_DIRECTED. */
- uint8_t include_tx_power : 1; /**< This feature is not supported on this SoftDevice. */
-} ble_gap_adv_properties_t;
-
-
-/**@brief Advertising report type. */
-typedef struct
-{
- uint16_t connectable : 1; /**< Connectable advertising event type. */
- uint16_t scannable : 1; /**< Scannable advertising event type. */
- uint16_t directed : 1; /**< Directed advertising event type. */
- uint16_t scan_response : 1; /**< Received a scan response. */
- uint16_t extended_pdu : 1; /**< Received an extended advertising set. */
- uint16_t status : 2; /**< Data status. See @ref BLE_GAP_ADV_DATA_STATUS. */
- uint16_t reserved : 9; /**< Reserved for future use. */
-} ble_gap_adv_report_type_t;
-
-/**@brief Advertising Auxiliary Pointer. */
-typedef struct
-{
- uint16_t aux_offset; /**< Time offset from the beginning of advertising packet to the auxiliary packet in 100 us units. */
- uint8_t aux_phy; /**< Indicates the PHY on which the auxiliary advertising packet is sent. See @ref BLE_GAP_PHYS. */
-} ble_gap_aux_pointer_t;
-
-/**@brief Bluetooth Low Energy address. */
-typedef struct
-{
- uint8_t addr_id_peer : 1; /**< Only valid for peer addresses.
- This bit is set by the SoftDevice to indicate whether the address has been resolved from
- a Resolvable Private Address (when the peer is using privacy).
- If set to 1, @ref addr and @ref addr_type refer to the identity address of the resolved address.
-
- This bit is ignored when a variable of type @ref ble_gap_addr_t is used as input to API functions. */
- uint8_t addr_type : 7; /**< See @ref BLE_GAP_ADDR_TYPES. */
- uint8_t addr[BLE_GAP_ADDR_LEN]; /**< 48-bit address, LSB format.
- @ref addr is not used if @ref addr_type is @ref BLE_GAP_ADDR_TYPE_ANONYMOUS. */
-} ble_gap_addr_t;
-
-
-/**@brief GAP connection parameters.
- *
- * @note When ble_conn_params_t is received in an event, both min_conn_interval and
- * max_conn_interval will be equal to the connection interval set by the central.
- *
- * @note If both conn_sup_timeout and max_conn_interval are specified, then the following constraint applies:
- * conn_sup_timeout * 4 > (1 + slave_latency) * max_conn_interval
- * that corresponds to the following Bluetooth Spec requirement:
- * The Supervision_Timeout in milliseconds shall be larger than
- * (1 + Conn_Latency) * Conn_Interval_Max * 2, where Conn_Interval_Max is given in milliseconds.
- */
-typedef struct
-{
- uint16_t min_conn_interval; /**< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/
- uint16_t max_conn_interval; /**< Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/
- uint16_t slave_latency; /**< Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS.*/
- uint16_t conn_sup_timeout; /**< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS.*/
-} ble_gap_conn_params_t;
-
-
-/**@brief GAP connection security modes.
- *
- * Security Mode 0 Level 0: No access permissions at all (this level is not defined by the Bluetooth Core specification).\n
- * Security Mode 1 Level 1: No security is needed (aka open link).\n
- * Security Mode 1 Level 2: Encrypted link required, MITM protection not necessary.\n
- * Security Mode 1 Level 3: MITM protected encrypted link required.\n
- * Security Mode 1 Level 4: LESC MITM protected encrypted link using a 128-bit strength encryption key required.\n
- * Security Mode 2 Level 1: Signing or encryption required, MITM protection not necessary.\n
- * Security Mode 2 Level 2: MITM protected signing required, unless link is MITM protected encrypted.\n
- */
-typedef struct
-{
- uint8_t sm : 4; /**< Security Mode (1 or 2), 0 for no permissions at all. */
- uint8_t lv : 4; /**< Level (1, 2, 3 or 4), 0 for no permissions at all. */
-
-} ble_gap_conn_sec_mode_t;
-
-
-/**@brief GAP connection security status.*/
-typedef struct
-{
- ble_gap_conn_sec_mode_t sec_mode; /**< Currently active security mode for this connection.*/
- uint8_t encr_key_size; /**< Length of currently active encryption key, 7 to 16 octets (only applicable for bonding procedures). */
-} ble_gap_conn_sec_t;
-
-/**@brief Identity Resolving Key. */
-typedef struct
-{
- uint8_t irk[BLE_GAP_SEC_KEY_LEN]; /**< Array containing IRK. */
-} ble_gap_irk_t;
-
-
-/**@brief Channel mask (40 bits).
- * Every channel is represented with a bit positioned as per channel index defined in Bluetooth Core Specification v5.0,
- * Vol 6, Part B, Section 1.4.1. The LSB contained in array element 0 represents channel index 0, and bit 39 represents
- * channel index 39. If a bit is set to 1, the channel is not used.
- */
-typedef uint8_t ble_gap_ch_mask_t[5];
-
-
-/**@brief GAP advertising parameters. */
-typedef struct
-{
- ble_gap_adv_properties_t properties; /**< The properties of the advertising events. */
- ble_gap_addr_t const *p_peer_addr; /**< Address of a known peer.
- @note ble_gap_addr_t::addr_type cannot be
- @ref BLE_GAP_ADDR_TYPE_ANONYMOUS.
- - When privacy is enabled and the local device uses
- @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE addresses,
- the device identity list is searched for a matching entry. If
- the local IRK for that device identity is set, the local IRK
- for that device will be used to generate the advertiser address
- field in the advertising packet.
- - If @ref ble_gap_adv_properties_t::type is directed, this must be
- set to the targeted scanner or initiator. If the peer address is
- in the device identity list, the peer IRK for that device will be
- used to generate @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE
- target addresses used in the advertising event PDUs. */
- uint32_t interval; /**< Advertising interval in 625 us units. @sa BLE_GAP_ADV_INTERVALS.
- @note If @ref ble_gap_adv_properties_t::type is set to
- @ref BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE
- advertising, this parameter is ignored. */
- uint16_t duration; /**< Advertising duration in 10 ms units. When timeout is reached,
- an event of type @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised.
- @sa BLE_GAP_ADV_TIMEOUT_VALUES.
- @note The SoftDevice will always complete at least one advertising
- event even if the duration is set too low. */
- uint8_t max_adv_evts; /**< Maximum advertising events that shall be sent prior to disabling
- advertising. Setting the value to 0 disables the limitation. When
- the count of advertising events specified by this parameter
- (if not 0) is reached, advertising will be automatically stopped
- and an event of type @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised
- @note If @ref ble_gap_adv_properties_t::type is set to
- @ref BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE,
- this parameter is ignored. */
- ble_gap_ch_mask_t channel_mask; /**< Channel mask for primary and secondary advertising channels.
- At least one of the primary channels, that is channel index 37-39, must be used.
- Masking away secondary advertising channels is not supported. */
- uint8_t filter_policy; /**< Filter Policy. @sa BLE_GAP_ADV_FILTER_POLICIES. */
- uint8_t primary_phy; /**< Indicates the PHY on which the primary advertising channel packets
- are transmitted. If set to @ref BLE_GAP_PHY_AUTO, @ref BLE_GAP_PHY_1MBPS
- will be used.
- Valid values are @ref BLE_GAP_PHY_1MBPS and @ref BLE_GAP_PHY_CODED.
- @note The primary_phy shall indicate @ref BLE_GAP_PHY_1MBPS if
- @ref ble_gap_adv_properties_t::type is not an extended advertising type. */
- uint8_t secondary_phy; /**< Indicates the PHY on which the secondary advertising channel packets
- are transmitted.
- If set to @ref BLE_GAP_PHY_AUTO, @ref BLE_GAP_PHY_1MBPS will be used.
- Valid values are
- @ref BLE_GAP_PHY_1MBPS, @ref BLE_GAP_PHY_2MBPS, and @ref BLE_GAP_PHY_CODED.
- If @ref ble_gap_adv_properties_t::type is an extended advertising type
- and connectable, this is the PHY that will be used to establish a
- connection and send AUX_ADV_IND packets on.
- @note This parameter will be ignored when
- @ref ble_gap_adv_properties_t::type is not an extended advertising type. */
- uint8_t set_id:4; /**< The advertising set identifier distinguishes this advertising set from other
- advertising sets transmitted by this and other devices.
- @note This parameter will be ignored when
- @ref ble_gap_adv_properties_t::type is not an extended advertising type. */
- uint8_t scan_req_notification:1; /**< Enable scan request notifications for this advertising set. When a
- scan request is received and the scanner address is allowed
- by the filter policy, @ref BLE_GAP_EVT_SCAN_REQ_REPORT is raised.
- @note This parameter will be ignored when
- @ref ble_gap_adv_properties_t::type is a non-scannable
- advertising type. */
-} ble_gap_adv_params_t;
-
-
-/**@brief GAP advertising data buffers.
- *
- * The application must provide the buffers for advertisement. The memory shall reside in application RAM, and
- * shall never be modified while advertising. The data shall be kept alive until either:
- * - @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised.
- * - @ref BLE_GAP_EVT_CONNECTED is raised with @ref ble_gap_evt_connected_t::adv_handle set to the corresponding
- * advertising handle.
- * - Advertising is stopped.
- * - Advertising data is changed.
- * To update advertising data while advertising, provide new buffers to @ref sd_ble_gap_adv_set_configure. */
-typedef struct
-{
- ble_data_t adv_data; /**< Advertising data.
- @note
- Advertising data can only be specified for a @ref ble_gap_adv_properties_t::type
- that is allowed to contain advertising data. */
- ble_data_t scan_rsp_data; /**< Scan response data.
- @note
- Scan response data can only be specified for a @ref ble_gap_adv_properties_t::type
- that is scannable. */
-} ble_gap_adv_data_t;
-
-
-/**@brief GAP scanning parameters. */
-typedef struct
-{
- uint8_t extended : 1; /**< If 1, the scanner will accept extended advertising packets.
- If set to 0, the scanner will not receive advertising packets
- on secondary advertising channels, and will not be able
- to receive long advertising PDUs. */
- uint8_t report_incomplete_evts : 1; /**< If 1, events of type @ref ble_gap_evt_adv_report_t may have
- @ref ble_gap_adv_report_type_t::status set to
- @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA.
- This parameter is ignored when used with @ref sd_ble_gap_connect
- @note This may be used to abort receiving more packets from an extended
- advertising event, and is only available for extended
- scanning, see @ref sd_ble_gap_scan_start.
- @note This feature is not supported by this SoftDevice. */
- uint8_t active : 1; /**< If 1, perform active scanning by sending scan requests.
- This parameter is ignored when used with @ref sd_ble_gap_connect. */
- uint8_t filter_policy : 2; /**< Scanning filter policy. @sa BLE_GAP_SCAN_FILTER_POLICIES.
- @note Only @ref BLE_GAP_SCAN_FP_ACCEPT_ALL and
- @ref BLE_GAP_SCAN_FP_WHITELIST are valid when used with
- @ref sd_ble_gap_connect */
- uint8_t scan_phys; /**< Bitfield of PHYs to scan on. If set to @ref BLE_GAP_PHY_AUTO,
- scan_phys will default to @ref BLE_GAP_PHY_1MBPS.
- - If @ref ble_gap_scan_params_t::extended is set to 0, the only
- supported PHY is @ref BLE_GAP_PHY_1MBPS.
- - When used with @ref sd_ble_gap_scan_start,
- the bitfield indicates the PHYs the scanner will use for scanning
- on primary advertising channels. The scanner will accept
- @ref BLE_GAP_PHYS_SUPPORTED as secondary advertising channel PHYs.
- - When used with @ref sd_ble_gap_connect, the bitfield indicates
- the PHYs the initiator will use for scanning on primary advertising
- channels. The initiator will accept connections initiated on either
- of the @ref BLE_GAP_PHYS_SUPPORTED PHYs.
- If scan_phys contains @ref BLE_GAP_PHY_1MBPS and/or @ref BLE_GAP_PHY_2MBPS,
- the primary scan PHY is @ref BLE_GAP_PHY_1MBPS.
- If scan_phys also contains @ref BLE_GAP_PHY_CODED, the primary scan
- PHY will also contain @ref BLE_GAP_PHY_CODED. If the only scan PHY is
- @ref BLE_GAP_PHY_CODED, the primary scan PHY is
- @ref BLE_GAP_PHY_CODED only. */
- uint16_t interval; /**< Scan interval in 625 us units. @sa BLE_GAP_SCAN_INTERVALS. */
- uint16_t window; /**< Scan window in 625 us units. @sa BLE_GAP_SCAN_WINDOW.
- If scan_phys contains both @ref BLE_GAP_PHY_1MBPS and
- @ref BLE_GAP_PHY_CODED interval shall be larger than or
- equal to twice the scan window. */
- uint16_t timeout; /**< Scan timeout in 10 ms units. @sa BLE_GAP_SCAN_TIMEOUT. */
- ble_gap_ch_mask_t channel_mask; /**< Channel mask for primary and secondary advertising channels.
- At least one of the primary channels, that is channel index 37-39, must be
- set to 0.
- Masking away secondary channels is not supported. */
-} ble_gap_scan_params_t;
-
-
-/**@brief Privacy.
- *
- * The privacy feature provides a way for the device to avoid being tracked over a period of time.
- * The privacy feature, when enabled, hides the local device identity and replaces it with a private address
- * that is automatically refreshed at a specified interval.
- *
- * If a device still wants to be recognized by other peers, it needs to share it's Identity Resolving Key (IRK).
- * With this key, a device can generate a random private address that can only be recognized by peers in possession of that key,
- * and devices can establish connections without revealing their real identities.
- *
- * Both network privacy (@ref BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY) and device privacy (@ref BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY)
- * are supported.
- *
- * @note If the device IRK is updated, the new IRK becomes the one to be distributed in all
- * bonding procedures performed after @ref sd_ble_gap_privacy_set returns.
- * The IRK distributed during bonding procedure is the device IRK that is active when @ref sd_ble_gap_sec_params_reply is called.
- */
-typedef struct
-{
- uint8_t privacy_mode; /**< Privacy mode, see @ref BLE_GAP_PRIVACY_MODES. Default is @ref BLE_GAP_PRIVACY_MODE_OFF. */
- uint8_t private_addr_type; /**< The private address type must be either @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE or @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE. */
- uint16_t private_addr_cycle_s; /**< Private address cycle interval in seconds. Providing an address cycle value of 0 will use the default value defined by @ref BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S. */
- ble_gap_irk_t *p_device_irk; /**< When used as input, pointer to IRK structure that will be used as the default IRK. If NULL, the device default IRK will be used.
- When used as output, pointer to IRK structure where the current default IRK will be written to. If NULL, this argument is ignored.
- By default, the default IRK is used to generate random private resolvable addresses for the local device unless instructed otherwise. */
-} ble_gap_privacy_params_t;
-
-
-/**@brief PHY preferences for TX and RX
- * @note tx_phys and rx_phys are bit fields. Multiple bits can be set in them to indicate multiple preferred PHYs for each direction.
- * @code
- * p_gap_phys->tx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS;
- * p_gap_phys->rx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS;
- * @endcode
- *
- */
-typedef struct
-{
- uint8_t tx_phys; /**< Preferred transmit PHYs, see @ref BLE_GAP_PHYS. */
- uint8_t rx_phys; /**< Preferred receive PHYs, see @ref BLE_GAP_PHYS. */
-} ble_gap_phys_t;
-
-/** @brief Keys that can be exchanged during a bonding procedure. */
-typedef struct
-{
- uint8_t enc : 1; /**< Long Term Key and Master Identification. */
- uint8_t id : 1; /**< Identity Resolving Key and Identity Address Information. */
- uint8_t sign : 1; /**< Connection Signature Resolving Key. */
- uint8_t link : 1; /**< Derive the Link Key from the LTK. */
-} ble_gap_sec_kdist_t;
-
-
-/**@brief GAP security parameters. */
-typedef struct
-{
- uint8_t bond : 1; /**< Perform bonding. */
- uint8_t mitm : 1; /**< Enable Man In The Middle protection. */
- uint8_t lesc : 1; /**< Enable LE Secure Connection pairing. */
- uint8_t keypress : 1; /**< Enable generation of keypress notifications. */
- uint8_t io_caps : 3; /**< IO capabilities, see @ref BLE_GAP_IO_CAPS. */
- uint8_t oob : 1; /**< The OOB data flag.
- - In LE legacy pairing, this flag is set if a device has out of band authentication data.
- The OOB method is used if both of the devices have out of band authentication data.
- - In LE Secure Connections pairing, this flag is set if a device has the peer device's out of band authentication data.
- The OOB method is used if at least one device has the peer device's OOB data available. */
- uint8_t min_key_size; /**< Minimum encryption key size in octets between 7 and 16. If 0 then not applicable in this instance. */
- uint8_t max_key_size; /**< Maximum encryption key size in octets between min_key_size and 16. */
- ble_gap_sec_kdist_t kdist_own; /**< Key distribution bitmap: keys that the local device will distribute. */
- ble_gap_sec_kdist_t kdist_peer; /**< Key distribution bitmap: keys that the remote device will distribute. */
-} ble_gap_sec_params_t;
-
-
-/**@brief GAP Encryption Information. */
-typedef struct
-{
- uint8_t ltk[BLE_GAP_SEC_KEY_LEN]; /**< Long Term Key. */
- uint8_t lesc : 1; /**< Key generated using LE Secure Connections. */
- uint8_t auth : 1; /**< Authenticated Key. */
- uint8_t ltk_len : 6; /**< LTK length in octets. */
-} ble_gap_enc_info_t;
-
-
-/**@brief GAP Master Identification. */
-typedef struct
-{
- uint16_t ediv; /**< Encrypted Diversifier. */
- uint8_t rand[BLE_GAP_SEC_RAND_LEN]; /**< Random Number. */
-} ble_gap_master_id_t;
-
-
-/**@brief GAP Signing Information. */
-typedef struct
-{
- uint8_t csrk[BLE_GAP_SEC_KEY_LEN]; /**< Connection Signature Resolving Key. */
-} ble_gap_sign_info_t;
-
-
-/**@brief GAP LE Secure Connections P-256 Public Key. */
-typedef struct
-{
- uint8_t pk[BLE_GAP_LESC_P256_PK_LEN]; /**< LE Secure Connections Elliptic Curve Diffie-Hellman P-256 Public Key. Stored in the standard SMP protocol format: {X,Y} both in little-endian. */
-} ble_gap_lesc_p256_pk_t;
-
-
-/**@brief GAP LE Secure Connections DHKey. */
-typedef struct
-{
- uint8_t key[BLE_GAP_LESC_DHKEY_LEN]; /**< LE Secure Connections Elliptic Curve Diffie-Hellman Key. Stored in little-endian. */
-} ble_gap_lesc_dhkey_t;
-
-
-/**@brief GAP LE Secure Connections OOB data. */
-typedef struct
-{
- ble_gap_addr_t addr; /**< Bluetooth address of the device. */
- uint8_t r[BLE_GAP_SEC_KEY_LEN]; /**< Random Number. */
- uint8_t c[BLE_GAP_SEC_KEY_LEN]; /**< Confirm Value. */
-} ble_gap_lesc_oob_data_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_CONNECTED. */
-typedef struct
-{
- ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1
- and the address is the device's identity address. */
- uint8_t role; /**< BLE role for this connection, see @ref BLE_GAP_ROLES */
- ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */
- uint8_t adv_handle; /**< Advertising handle in which advertising has ended.
- This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH. */
- ble_gap_adv_data_t adv_data; /**< Advertising buffers corresponding to the terminated
- advertising set. The advertising buffers provided in
- @ref sd_ble_gap_adv_set_configure are now released.
- This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH. */
-} ble_gap_evt_connected_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_DISCONNECTED. */
-typedef struct
-{
- uint8_t reason; /**< HCI error code, see @ref BLE_HCI_STATUS_CODES. */
-} ble_gap_evt_disconnected_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_CONN_PARAM_UPDATE. */
-typedef struct
-{
- ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */
-} ble_gap_evt_conn_param_update_t;
-
-/**@brief Event structure for @ref BLE_GAP_EVT_PHY_UPDATE_REQUEST. */
-typedef struct
-{
- ble_gap_phys_t peer_preferred_phys; /**< The PHYs the peer prefers to use. */
-} ble_gap_evt_phy_update_request_t;
-
-/**@brief Event Structure for @ref BLE_GAP_EVT_PHY_UPDATE. */
-typedef struct
-{
- uint8_t status; /**< Status of the procedure, see @ref BLE_HCI_STATUS_CODES.*/
- uint8_t tx_phy; /**< TX PHY for this connection, see @ref BLE_GAP_PHYS. */
- uint8_t rx_phy; /**< RX PHY for this connection, see @ref BLE_GAP_PHYS. */
-} ble_gap_evt_phy_update_t;
-
-/**@brief Event structure for @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST. */
-typedef struct
-{
- ble_gap_sec_params_t peer_params; /**< Initiator Security Parameters. */
-} ble_gap_evt_sec_params_request_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_SEC_INFO_REQUEST. */
-typedef struct
-{
- ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. */
- ble_gap_master_id_t master_id; /**< Master Identification for LTK lookup. */
- uint8_t enc_info : 1; /**< If 1, Encryption Information required. */
- uint8_t id_info : 1; /**< If 1, Identity Information required. */
- uint8_t sign_info : 1; /**< If 1, Signing Information required. */
-} ble_gap_evt_sec_info_request_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_PASSKEY_DISPLAY. */
-typedef struct
-{
- uint8_t passkey[BLE_GAP_PASSKEY_LEN]; /**< 6-digit passkey in ASCII ('0'-'9' digits only). */
- uint8_t match_request : 1; /**< If 1 requires the application to report the match using @ref sd_ble_gap_auth_key_reply
- with either @ref BLE_GAP_AUTH_KEY_TYPE_NONE if there is no match or
- @ref BLE_GAP_AUTH_KEY_TYPE_PASSKEY if there is a match. */
-} ble_gap_evt_passkey_display_t;
-
-/**@brief Event structure for @ref BLE_GAP_EVT_KEY_PRESSED. */
-typedef struct
-{
- uint8_t kp_not; /**< Keypress notification type, see @ref BLE_GAP_KP_NOT_TYPES. */
-} ble_gap_evt_key_pressed_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_AUTH_KEY_REQUEST. */
-typedef struct
-{
- uint8_t key_type; /**< See @ref BLE_GAP_AUTH_KEY_TYPES. */
-} ble_gap_evt_auth_key_request_t;
-
-/**@brief Event structure for @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST. */
-typedef struct
-{
- ble_gap_lesc_p256_pk_t *p_pk_peer; /**< LE Secure Connections remote P-256 Public Key. This will point to the application-supplied memory
- inside the keyset during the call to @ref sd_ble_gap_sec_params_reply. */
- uint8_t oobd_req :1; /**< LESC OOB data required. A call to @ref sd_ble_gap_lesc_oob_data_set is required to complete the procedure. */
-} ble_gap_evt_lesc_dhkey_request_t;
-
-
-/**@brief Security levels supported.
- * @note See Bluetooth Specification Version 4.2 Volume 3, Part C, Chapter 10, Section 10.2.1.
-*/
-typedef struct
-{
- uint8_t lv1 : 1; /**< If 1: Level 1 is supported. */
- uint8_t lv2 : 1; /**< If 1: Level 2 is supported. */
- uint8_t lv3 : 1; /**< If 1: Level 3 is supported. */
- uint8_t lv4 : 1; /**< If 1: Level 4 is supported. */
-} ble_gap_sec_levels_t;
-
-
-/**@brief Encryption Key. */
-typedef struct
-{
- ble_gap_enc_info_t enc_info; /**< Encryption Information. */
- ble_gap_master_id_t master_id; /**< Master Identification. */
-} ble_gap_enc_key_t;
-
-
-/**@brief Identity Key. */
-typedef struct
-{
- ble_gap_irk_t id_info; /**< Identity Resolving Key. */
- ble_gap_addr_t id_addr_info; /**< Identity Address. */
-} ble_gap_id_key_t;
-
-
-/**@brief Security Keys. */
-typedef struct
-{
- ble_gap_enc_key_t *p_enc_key; /**< Encryption Key, or NULL. */
- ble_gap_id_key_t *p_id_key; /**< Identity Key, or NULL. */
- ble_gap_sign_info_t *p_sign_key; /**< Signing Key, or NULL. */
- ble_gap_lesc_p256_pk_t *p_pk; /**< LE Secure Connections P-256 Public Key. When in debug mode the application must use the value defined
- in the Core Bluetooth Specification v4.2 Vol.3, Part H, Section 2.3.5.6.1 */
-} ble_gap_sec_keys_t;
-
-
-/**@brief Security key set for both local and peer keys. */
-typedef struct
-{
- ble_gap_sec_keys_t keys_own; /**< Keys distributed by the local device. For LE Secure Connections the encryption key will be generated locally and will always be stored if bonding. */
- ble_gap_sec_keys_t keys_peer; /**< Keys distributed by the remote device. For LE Secure Connections, p_enc_key must always be NULL. */
-} ble_gap_sec_keyset_t;
-
-
-/**@brief Data Length Update Procedure parameters. */
-typedef struct
-{
- uint16_t max_tx_octets; /**< Maximum number of payload octets that a Controller supports for transmission of a single Link Layer Data Channel PDU. */
- uint16_t max_rx_octets; /**< Maximum number of payload octets that a Controller supports for reception of a single Link Layer Data Channel PDU. */
- uint16_t max_tx_time_us; /**< Maximum time, in microseconds, that a Controller supports for transmission of a single Link Layer Data Channel PDU. */
- uint16_t max_rx_time_us; /**< Maximum time, in microseconds, that a Controller supports for reception of a single Link Layer Data Channel PDU. */
-} ble_gap_data_length_params_t;
-
-
-/**@brief Data Length Update Procedure local limitation. */
-typedef struct
-{
- uint16_t tx_payload_limited_octets; /**< If > 0, the requested TX packet length is too long by this many octets. */
- uint16_t rx_payload_limited_octets; /**< If > 0, the requested RX packet length is too long by this many octets. */
- uint16_t tx_rx_time_limited_us; /**< If > 0, the requested combination of TX and RX packet lengths is too long by this many microseconds. */
-} ble_gap_data_length_limitation_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_AUTH_STATUS. */
-typedef struct
-{
- uint8_t auth_status; /**< Authentication status, see @ref BLE_GAP_SEC_STATUS. */
- uint8_t error_src : 2; /**< On error, source that caused the failure, see @ref BLE_GAP_SEC_STATUS_SOURCES. */
- uint8_t bonded : 1; /**< Procedure resulted in a bond. */
- uint8_t lesc : 1; /**< Procedure resulted in a LE Secure Connection. */
- ble_gap_sec_levels_t sm1_levels; /**< Levels supported in Security Mode 1. */
- ble_gap_sec_levels_t sm2_levels; /**< Levels supported in Security Mode 2. */
- ble_gap_sec_kdist_t kdist_own; /**< Bitmap stating which keys were exchanged (distributed) by the local device. If bonding with LE Secure Connections, the enc bit will be always set. */
- ble_gap_sec_kdist_t kdist_peer; /**< Bitmap stating which keys were exchanged (distributed) by the remote device. If bonding with LE Secure Connections, the enc bit will never be set. */
-} ble_gap_evt_auth_status_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_CONN_SEC_UPDATE. */
-typedef struct
-{
- ble_gap_conn_sec_t conn_sec; /**< Connection security level. */
-} ble_gap_evt_conn_sec_update_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_TIMEOUT. */
-typedef struct
-{
- uint8_t src; /**< Source of timeout event, see @ref BLE_GAP_TIMEOUT_SOURCES. */
- union
- {
- ble_data_t adv_report_buffer; /**< If source is set to @ref BLE_GAP_TIMEOUT_SRC_SCAN, the released
- scan buffer is contained in this field. */
- } params; /**< Event Parameters. */
-} ble_gap_evt_timeout_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_RSSI_CHANGED. */
-typedef struct
-{
- int8_t rssi; /**< Received Signal Strength Indication in dBm.
- @note ERRATA-153 requires the rssi sample to be compensated based on a temperature measurement. */
- uint8_t ch_index; /**< Data Channel Index on which the Signal Strength is measured (0-36). */
-} ble_gap_evt_rssi_changed_t;
-
-/**@brief Event structure for @ref BLE_GAP_EVT_ADV_SET_TERMINATED */
-typedef struct
-{
- uint8_t reason; /**< Reason for why the advertising set terminated. See
- @ref BLE_GAP_EVT_ADV_SET_TERMINATED_REASON. */
- uint8_t adv_handle; /**< Advertising handle in which advertising has ended. */
- uint8_t num_completed_adv_events; /**< If @ref ble_gap_adv_params_t::max_adv_evts was not set to 0,
- this field indicates the number of completed advertising events. */
- ble_gap_adv_data_t adv_data; /**< Advertising buffers corresponding to the terminated
- advertising set. The advertising buffers provided in
- @ref sd_ble_gap_adv_set_configure are now released. */
-} ble_gap_evt_adv_set_terminated_t;
-
-/**@brief Event structure for @ref BLE_GAP_EVT_ADV_REPORT.
- *
- * @note If @ref ble_gap_adv_report_type_t::status is set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA,
- * not all fields in the advertising report may be available.
- *
- * @note When ble_gap_adv_report_type_t::status is not set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA,
- * scanning will be paused. To continue scanning, call @ref sd_ble_gap_scan_start.
- */
-typedef struct
-{
- ble_gap_adv_report_type_t type; /**< Advertising report type. See @ref ble_gap_adv_report_type_t. */
- ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. If the peer_addr is resolved:
- @ref ble_gap_addr_t::addr_id_peer is set to 1 and the address is the
- peer's identity address. */
- ble_gap_addr_t direct_addr; /**< Contains the target address of the advertising event if
- @ref ble_gap_adv_report_type_t::directed is set to 1. If the
- SoftDevice was able to resolve the address,
- @ref ble_gap_addr_t::addr_id_peer is set to 1 and the direct_addr
- contains the local identity address. If the target address of the
- advertising event is @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE,
- and the SoftDevice was unable to resolve it, the application may try
- to resolve this address to find out if the advertising event was
- directed to us. */
- uint8_t primary_phy; /**< Indicates the PHY on which the primary advertising packet was received.
- See @ref BLE_GAP_PHYS. */
- uint8_t secondary_phy; /**< Indicates the PHY on which the secondary advertising packet was received.
- See @ref BLE_GAP_PHYS. This field is set to @ref BLE_GAP_PHY_NOT_SET if no packets
- were received on a secondary advertising channel. */
- int8_t tx_power; /**< TX Power reported by the advertiser in the last packet header received.
- This field is set to @ref BLE_GAP_POWER_LEVEL_INVALID if the
- last received packet did not contain the Tx Power field.
- @note TX Power is only included in extended advertising packets. */
- int8_t rssi; /**< Received Signal Strength Indication in dBm of the last packet received.
- @note ERRATA-153 requires the rssi sample to be compensated based on a temperature measurement. */
- uint8_t ch_index; /**< Channel Index on which the last advertising packet is received (0-39). */
- uint8_t set_id; /**< Set ID of the received advertising data. Set ID is not present
- if set to @ref BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE. */
- uint16_t data_id:12; /**< The advertising data ID of the received advertising data. Data ID
- is not present if @ref ble_gap_evt_adv_report_t::set_id is set to
- @ref BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE. */
- ble_data_t data; /**< Received advertising or scan response data. If
- @ref ble_gap_adv_report_type_t::status is not set to
- @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, the data buffer provided
- in @ref sd_ble_gap_scan_start is now released. */
- ble_gap_aux_pointer_t aux_pointer; /**< The offset and PHY of the next advertising packet in this extended advertising
- event. @note This field is only set if @ref ble_gap_adv_report_type_t::status
- is set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA. */
-} ble_gap_evt_adv_report_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_SEC_REQUEST. */
-typedef struct
-{
- uint8_t bond : 1; /**< Perform bonding. */
- uint8_t mitm : 1; /**< Man In The Middle protection requested. */
- uint8_t lesc : 1; /**< LE Secure Connections requested. */
- uint8_t keypress : 1; /**< Generation of keypress notifications requested. */
-} ble_gap_evt_sec_request_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST. */
-typedef struct
-{
- ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */
-} ble_gap_evt_conn_param_update_request_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_SCAN_REQ_REPORT. */
-typedef struct
-{
- uint8_t adv_handle; /**< Advertising handle for the advertising set which received the Scan Request */
- int8_t rssi; /**< Received Signal Strength Indication in dBm.
- @note ERRATA-153 requires the rssi sample to be compensated based on a temperature measurement. */
- ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1
- and the address is the device's identity address. */
-} ble_gap_evt_scan_req_report_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST. */
-typedef struct
-{
- ble_gap_data_length_params_t peer_params; /**< Peer data length parameters. */
-} ble_gap_evt_data_length_update_request_t;
-
-/**@brief Event structure for @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE. */
-typedef struct
-{
- ble_gap_data_length_params_t effective_params; /**< The effective data length parameters. */
-} ble_gap_evt_data_length_update_t;
-
-
-/**@brief Event structure for @ref BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT. */
-typedef struct
-{
- int8_t channel_energy[BLE_GAP_CHANNEL_COUNT]; /**< The measured energy on the Bluetooth Low Energy
- channels, in dBm, indexed by Channel Index.
- If no measurement is available for the given channel, channel_energy is set to
- @ref BLE_GAP_POWER_LEVEL_INVALID. */
-} ble_gap_evt_qos_channel_survey_report_t;
-
-/**@brief GAP event structure. */
-typedef struct
-{
- uint16_t conn_handle; /**< Connection Handle on which event occurred. */
- union /**< union alternative identified by evt_id in enclosing struct. */
- {
- ble_gap_evt_connected_t connected; /**< Connected Event Parameters. */
- ble_gap_evt_disconnected_t disconnected; /**< Disconnected Event Parameters. */
- ble_gap_evt_conn_param_update_t conn_param_update; /**< Connection Parameter Update Parameters. */
- ble_gap_evt_sec_params_request_t sec_params_request; /**< Security Parameters Request Event Parameters. */
- ble_gap_evt_sec_info_request_t sec_info_request; /**< Security Information Request Event Parameters. */
- ble_gap_evt_passkey_display_t passkey_display; /**< Passkey Display Event Parameters. */
- ble_gap_evt_key_pressed_t key_pressed; /**< Key Pressed Event Parameters. */
- ble_gap_evt_auth_key_request_t auth_key_request; /**< Authentication Key Request Event Parameters. */
- ble_gap_evt_lesc_dhkey_request_t lesc_dhkey_request; /**< LE Secure Connections DHKey calculation request. */
- ble_gap_evt_auth_status_t auth_status; /**< Authentication Status Event Parameters. */
- ble_gap_evt_conn_sec_update_t conn_sec_update; /**< Connection Security Update Event Parameters. */
- ble_gap_evt_timeout_t timeout; /**< Timeout Event Parameters. */
- ble_gap_evt_rssi_changed_t rssi_changed; /**< RSSI Event Parameters. */
- ble_gap_evt_adv_report_t adv_report; /**< Advertising Report Event Parameters. */
- ble_gap_evt_adv_set_terminated_t adv_set_terminated; /**< Advertising Set Terminated Event Parameters. */
- ble_gap_evt_sec_request_t sec_request; /**< Security Request Event Parameters. */
- ble_gap_evt_conn_param_update_request_t conn_param_update_request; /**< Connection Parameter Update Parameters. */
- ble_gap_evt_scan_req_report_t scan_req_report; /**< Scan Request Report Parameters. */
- ble_gap_evt_phy_update_request_t phy_update_request; /**< PHY Update Request Event Parameters. */
- ble_gap_evt_phy_update_t phy_update; /**< PHY Update Parameters. */
- ble_gap_evt_data_length_update_request_t data_length_update_request; /**< Data Length Update Request Event Parameters. */
- ble_gap_evt_data_length_update_t data_length_update; /**< Data Length Update Event Parameters. */
- ble_gap_evt_qos_channel_survey_report_t qos_channel_survey_report; /**< Quality of Service (QoS) Channel Survey Report Parameters. */
- } params; /**< Event Parameters. */
-} ble_gap_evt_t;
-
-
-/**
- * @brief BLE GAP connection configuration parameters, set with @ref sd_ble_cfg_set.
- *
- * @retval ::NRF_ERROR_CONN_COUNT The connection count for the connection configurations is zero.
- * @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true:
- * - The sum of conn_count for all connection configurations combined exceeds UINT8_MAX.
- * - The event length is smaller than @ref BLE_GAP_EVENT_LENGTH_MIN.
- */
-typedef struct
-{
- uint8_t conn_count; /**< The number of concurrent connections the application can create with this configuration.
- The default and minimum value is @ref BLE_GAP_CONN_COUNT_DEFAULT. */
- uint16_t event_length; /**< The time set aside for this connection on every connection interval in 1.25 ms units.
- The default value is @ref BLE_GAP_EVENT_LENGTH_DEFAULT, the minimum value is @ref BLE_GAP_EVENT_LENGTH_MIN.
- The event length and the connection interval are the primary parameters
- for setting the throughput of a connection.
- See the SoftDevice Specification for details on throughput. */
-} ble_gap_conn_cfg_t;
-
-
-/**
- * @brief Configuration of maximum concurrent connections in the different connected roles, set with
- * @ref sd_ble_cfg_set.
- *
- * @retval ::NRF_ERROR_CONN_COUNT The sum of periph_role_count and central_role_count is too
- * large. The maximum supported sum of concurrent connections is
- * @ref BLE_GAP_ROLE_COUNT_COMBINED_MAX.
- * @retval ::NRF_ERROR_INVALID_PARAM central_sec_count is larger than central_role_count.
- * @retval ::NRF_ERROR_RESOURCES The adv_set_count is too large. The maximum
- * supported advertising handles is
- * @ref BLE_GAP_ADV_SET_COUNT_MAX.
- */
-typedef struct
-{
- uint8_t adv_set_count; /**< Maximum number of advertising sets. Default value is @ref BLE_GAP_ADV_SET_COUNT_DEFAULT. */
- uint8_t periph_role_count; /**< Maximum number of connections concurrently acting as a peripheral. Default value is @ref BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT. */
- uint8_t central_role_count; /**< Maximum number of connections concurrently acting as a central. Default value is @ref BLE_GAP_ROLE_COUNT_CENTRAL_DEFAULT. */
- uint8_t central_sec_count; /**< Number of SMP instances shared between all connections acting as a central. Default value is @ref BLE_GAP_ROLE_COUNT_CENTRAL_SEC_DEFAULT. */
- uint8_t qos_channel_survey_role_available:1; /**< If set, the Quality of Service (QoS) channel survey module is available to the
- application using @ref sd_ble_gap_qos_channel_survey_start. */
-} ble_gap_cfg_role_count_t;
-
-
-/**
- * @brief Device name and its properties, set with @ref sd_ble_cfg_set.
- *
- * @note If the device name is not configured, the default device name will be
- * @ref BLE_GAP_DEVNAME_DEFAULT, the maximum device name length will be
- * @ref BLE_GAP_DEVNAME_DEFAULT_LEN, vloc will be set to @ref BLE_GATTS_VLOC_STACK and the device name
- * will have no write access.
- *
- * @note If @ref max_len is more than @ref BLE_GAP_DEVNAME_DEFAULT_LEN and vloc is set to @ref BLE_GATTS_VLOC_STACK,
- * the attribute table size must be increased to have room for the longer device name (see
- * @ref sd_ble_cfg_set and @ref ble_gatts_cfg_attr_tab_size_t).
- *
- * @note If vloc is @ref BLE_GATTS_VLOC_STACK :
- * - p_value must point to non-volatile memory (flash) or be NULL.
- * - If p_value is NULL, the device name will initially be empty.
- *
- * @note If vloc is @ref BLE_GATTS_VLOC_USER :
- * - p_value cannot be NULL.
- * - If the device name is writable, p_value must point to volatile memory (RAM).
- *
- * @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true:
- * - Invalid device name location (vloc).
- * - Invalid device name security mode.
- * @retval ::NRF_ERROR_INVALID_LENGTH One or more of the following is true:
- * - The device name length is invalid (must be between 0 and @ref BLE_GAP_DEVNAME_MAX_LEN).
- * - The device name length is too long for the given Attribute Table.
- * @retval ::NRF_ERROR_NOT_SUPPORTED Device name security mode is not supported.
- */
-typedef struct
-{
- ble_gap_conn_sec_mode_t write_perm; /**< Write permissions. */
- uint8_t vloc:2; /**< Value location, see @ref BLE_GATTS_VLOCS.*/
- uint8_t *p_value; /**< Pointer to where the value (device name) is stored or will be stored. */
- uint16_t current_len; /**< Current length in bytes of the memory pointed to by p_value.*/
- uint16_t max_len; /**< Maximum length in bytes of the memory pointed to by p_value.*/
-} ble_gap_cfg_device_name_t;
-
-
-/**@brief Configuration structure for GAP configurations. */
-typedef union
-{
- ble_gap_cfg_role_count_t role_count_cfg; /**< Role count configuration, cfg_id is @ref BLE_GAP_CFG_ROLE_COUNT. */
- ble_gap_cfg_device_name_t device_name_cfg; /**< Device name configuration, cfg_id is @ref BLE_GAP_CFG_DEVICE_NAME. */
-} ble_gap_cfg_t;
-
-
-/**@brief Channel Map option.
- *
- * @details Used with @ref sd_ble_opt_get to get the current channel map
- * or @ref sd_ble_opt_set to set a new channel map. When setting the
- * channel map, it applies to all current and future connections. When getting the
- * current channel map, it applies to a single connection and the connection handle
- * must be supplied.
- *
- * @note Setting the channel map may take some time, depending on connection parameters.
- * The time taken may be different for each connection and the get operation will
- * return the previous channel map until the new one has taken effect.
- *
- * @note After setting the channel map, by spec it can not be set again until at least 1 s has passed.
- * See Bluetooth Specification Version 4.1 Volume 2, Part E, Section 7.3.46.
- *
- * @retval ::NRF_SUCCESS Get or set successful.
- * @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true:
- * - Less then two bits in @ref ch_map are set.
- * - Bits for primary advertising channels (37-39) are set.
- * @retval ::NRF_ERROR_BUSY Channel map was set again before enough time had passed.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied for get.
- *
- */
-typedef struct
-{
- uint16_t conn_handle; /**< Connection Handle (only applicable for get) */
- uint8_t ch_map[5]; /**< Channel Map (37-bit). */
-} ble_gap_opt_ch_map_t;
-
-
-/**@brief Local connection latency option.
- *
- * @details Local connection latency is a feature which enables the slave to improve
- * current consumption by ignoring the slave latency set by the peer. The
- * local connection latency can only be set to a multiple of the slave latency,
- * and cannot be longer than half of the supervision timeout.
- *
- * @details Used with @ref sd_ble_opt_set to set the local connection latency. The
- * @ref sd_ble_opt_get is not supported for this option, but the actual
- * local connection latency (unless set to NULL) is set as a return parameter
- * when setting the option.
- *
- * @note The latency set will be truncated down to the closest slave latency event
- * multiple, or the nearest multiple before half of the supervision timeout.
- *
- * @note The local connection latency is disabled by default, and needs to be enabled for new
- * connections and whenever the connection is updated.
- *
- * @retval ::NRF_SUCCESS Set successfully.
- * @retval ::NRF_ERROR_NOT_SUPPORTED Get is not supported.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter.
- */
-typedef struct
-{
- uint16_t conn_handle; /**< Connection Handle */
- uint16_t requested_latency; /**< Requested local connection latency. */
- uint16_t * p_actual_latency; /**< Pointer to storage for the actual local connection latency (can be set to NULL to skip return value). */
-} ble_gap_opt_local_conn_latency_t;
-
-/**@brief Disable slave latency
- *
- * @details Used with @ref sd_ble_opt_set to temporarily disable slave latency of a peripheral connection
- * (see @ref ble_gap_conn_params_t::slave_latency). And to re-enable it again. When disabled, the
- * peripheral will ignore the slave_latency set by the central.
- *
- * @note Shall only be called on peripheral links.
- *
- * @retval ::NRF_SUCCESS Set successfully.
- * @retval ::NRF_ERROR_NOT_SUPPORTED Get is not supported.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter.
- */
-typedef struct
-{
- uint16_t conn_handle; /**< Connection Handle */
- uint8_t disable : 1; /**< Set to 1 to disable slave latency. Set to 0 enable it again.*/
-} ble_gap_opt_slave_latency_disable_t;
-
-/**@brief Passkey Option.
- *
- * @details Structure containing the passkey to be used during pairing. This can be used with @ref
- * sd_ble_opt_set to make the SoftDevice use a preprogrammed passkey for authentication
- * instead of generating a random one.
- *
- * @note Repeated pairing attempts using the same preprogrammed passkey makes pairing vulnerable to MITM attacks.
- *
- * @note @ref sd_ble_opt_get is not supported for this option.
- *
- */
-typedef struct
-{
- uint8_t const * p_passkey; /**< Pointer to 6-digit ASCII string (digit 0..9 only, no NULL termination) passkey to be used during pairing. If this is NULL, the SoftDevice will generate a random passkey if required.*/
-} ble_gap_opt_passkey_t;
-
-
-/**@brief Compatibility mode 1 option.
- *
- * @details This can be used with @ref sd_ble_opt_set to enable and disable
- * compatibility mode 1. Compatibility mode 1 is disabled by default.
- *
- * @note Compatibility mode 1 enables interoperability with devices that do not support a value of
- * 0 for the WinOffset parameter in the Link Layer CONNECT_IND packet. This applies to a
- * limited set of legacy peripheral devices from another vendor. Enabling this compatibility
- * mode will only have an effect if the local device will act as a central device and
- * initiate a connection to a peripheral device. In that case it may lead to the connection
- * creation taking up to one connection interval longer to complete for all connections.
- *
- * @retval ::NRF_SUCCESS Set successfully.
- * @retval ::NRF_ERROR_INVALID_STATE When connection creation is ongoing while mode 1 is set.
- */
-typedef struct
-{
- uint8_t enable : 1; /**< Enable compatibility mode 1.*/
-} ble_gap_opt_compat_mode_1_t;
-
-
-/**@brief Authenticated payload timeout option.
- *
- * @details This can be used with @ref sd_ble_opt_set to change the Authenticated payload timeout to a value other
- * than the default of @ref BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX.
- *
- * @note The authenticated payload timeout event ::BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD will be generated
- * if auth_payload_timeout time has elapsed without receiving a packet with a valid MIC on an encrypted
- * link.
- *
- * @note The LE ping procedure will be initiated before the timer expires to give the peer a chance
- * to reset the timer. In addition the stack will try to prioritize running of LE ping over other
- * activities to increase chances of finishing LE ping before timer expires. To avoid side-effects
- * on other activities, it is recommended to use high timeout values.
- * Recommended timeout > 2*(connInterval * (6 + connSlaveLatency)).
- *
- * @retval ::NRF_SUCCESS Set successfully.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. auth_payload_timeout was outside of allowed range.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter.
- */
-typedef struct
-{
- uint16_t conn_handle; /**< Connection Handle */
- uint16_t auth_payload_timeout; /**< Requested timeout in 10 ms unit, see @ref BLE_GAP_AUTH_PAYLOAD_TIMEOUT. */
-} ble_gap_opt_auth_payload_timeout_t;
-
-/**@brief Option structure for GAP options. */
-typedef union
-{
- ble_gap_opt_ch_map_t ch_map; /**< Parameters for the Channel Map option. */
- ble_gap_opt_local_conn_latency_t local_conn_latency; /**< Parameters for the Local connection latency option */
- ble_gap_opt_passkey_t passkey; /**< Parameters for the Passkey option.*/
- ble_gap_opt_compat_mode_1_t compat_mode_1; /**< Parameters for the compatibility mode 1 option.*/
- ble_gap_opt_auth_payload_timeout_t auth_payload_timeout; /**< Parameters for the authenticated payload timeout option.*/
- ble_gap_opt_slave_latency_disable_t slave_latency_disable; /**< Parameters for the Disable slave latency option */
-} ble_gap_opt_t;
-/**@} */
-
-
-/**@addtogroup BLE_GAP_FUNCTIONS Functions
- * @{ */
-
-/**@brief Set the local Bluetooth identity address.
- *
- * The local Bluetooth identity address is the address that identifies this device to other peers.
- * The address type must be either @ref BLE_GAP_ADDR_TYPE_PUBLIC or @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC.
- *
- * @note The identity address cannot be changed while advertising, scanning or creating a connection.
- *
- * @note This address will be distributed to the peer during bonding.
- * If the address changes, the address stored in the peer device will not be valid and the ability to
- * reconnect using the old address will be lost.
- *
- * @note By default the SoftDevice will set an address of type @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC upon being
- * enabled. The address is a random number populated during the IC manufacturing process and remains unchanged
- * for the lifetime of each IC.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_ADV_MSC}
- * @endmscs
- *
- * @param[in] p_addr Pointer to address structure.
- *
- * @retval ::NRF_SUCCESS Address successfully set.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address.
- * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry.
- * @retval ::NRF_ERROR_INVALID_STATE The identity address cannot be changed while advertising,
- * scanning or creating a connection.
- */
-SVCALL(SD_BLE_GAP_ADDR_SET, uint32_t, sd_ble_gap_addr_set(ble_gap_addr_t const *p_addr));
-
-
-/**@brief Get local Bluetooth identity address.
- *
- * @note This will always return the identity address irrespective of the privacy settings,
- * i.e. the address type will always be either @ref BLE_GAP_ADDR_TYPE_PUBLIC or @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC.
- *
- * @param[out] p_addr Pointer to address structure to be filled in.
- *
- * @retval ::NRF_SUCCESS Address successfully retrieved.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied.
- */
-SVCALL(SD_BLE_GAP_ADDR_GET, uint32_t, sd_ble_gap_addr_get(ble_gap_addr_t *p_addr));
-
-
-/**@brief Get the Bluetooth device address used by the advertiser.
- *
- * @note This function will return the local Bluetooth address used in advertising PDUs. When
- * using privacy, the SoftDevice will generate a new private address every
- * @ref ble_gap_privacy_params_t::private_addr_cycle_s configured using
- * @ref sd_ble_gap_privacy_set. Hence depending on when the application calls this API, the
- * address returned may not be the latest address that is used in the advertising PDUs.
- *
- * @param[in] adv_handle The advertising handle to get the address from.
- * @param[out] p_addr Pointer to address structure to be filled in.
- *
- * @retval ::NRF_SUCCESS Address successfully retrieved.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied.
- * @retval ::BLE_ERROR_INVALID_ADV_HANDLE The provided advertising handle was not found.
- * @retval ::NRF_ERROR_INVALID_STATE The advertising set is currently not advertising.
- */
-SVCALL(SD_BLE_GAP_ADV_ADDR_GET, uint32_t, sd_ble_gap_adv_addr_get(uint8_t adv_handle, ble_gap_addr_t *p_addr));
-
-
-/**@brief Set the active whitelist in the SoftDevice.
- *
- * @note Only one whitelist can be used at a time and the whitelist is shared between the BLE roles.
- * The whitelist cannot be set if a BLE role is using the whitelist.
- *
- * @note If an address is resolved using the information in the device identity list, then the whitelist
- * filter policy applies to the peer identity address and not the resolvable address sent on air.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_WL_SHARE_MSC}
- * @mmsc{@ref BLE_GAP_PRIVACY_SCAN_PRIVATE_SCAN_MSC}
- * @endmscs
- *
- * @param[in] pp_wl_addrs Pointer to a whitelist of peer addresses, if NULL the whitelist will be cleared.
- * @param[in] len Length of the whitelist, maximum @ref BLE_GAP_WHITELIST_ADDR_MAX_COUNT.
- *
- * @retval ::NRF_SUCCESS The whitelist is successfully set/cleared.
- * @retval ::NRF_ERROR_INVALID_ADDR The whitelist (or one of its entries) provided is invalid.
- * @retval ::BLE_ERROR_GAP_WHITELIST_IN_USE The whitelist is in use by a BLE role and cannot be set or cleared.
- * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied.
- * @retval ::NRF_ERROR_DATA_SIZE The given whitelist size is invalid (zero or too large); this can only return when
- * pp_wl_addrs is not NULL.
- */
-SVCALL(SD_BLE_GAP_WHITELIST_SET, uint32_t, sd_ble_gap_whitelist_set(ble_gap_addr_t const * const * pp_wl_addrs, uint8_t len));
-
-
-/**@brief Set device identity list.
- *
- * @note Only one device identity list can be used at a time and the list is shared between the BLE roles.
- * The device identity list cannot be set if a BLE role is using the list.
- *
- * @param[in] pp_id_keys Pointer to an array of peer identity addresses and peer IRKs, if NULL the device identity list will be cleared.
- * @param[in] pp_local_irks Pointer to an array of local IRKs. Each entry in the array maps to the entry in pp_id_keys at the same index.
- * To fill in the list with the currently set device IRK for all peers, set to NULL.
- * @param[in] len Length of the device identity list, maximum @ref BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_PRIVACY_ADV_MSC}
- * @mmsc{@ref BLE_GAP_PRIVACY_SCAN_MSC}
- * @mmsc{@ref BLE_GAP_PRIVACY_SCAN_PRIVATE_SCAN_MSC}
- * @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_CONN_PRIV_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_CONN_PRIV_MSC}
- * @endmscs
- *
- * @retval ::NRF_SUCCESS The device identity list successfully set/cleared.
- * @retval ::NRF_ERROR_INVALID_ADDR The device identity list (or one of its entries) provided is invalid.
- * This code may be returned if the local IRK list also has an invalid entry.
- * @retval ::BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE The device identity list is in use and cannot be set or cleared.
- * @retval ::BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE The device identity list contains multiple entries with the same identity address.
- * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied.
- * @retval ::NRF_ERROR_DATA_SIZE The given device identity list size invalid (zero or too large); this can
- * only return when pp_id_keys is not NULL.
- */
-SVCALL(SD_BLE_GAP_DEVICE_IDENTITIES_SET, uint32_t, sd_ble_gap_device_identities_set(ble_gap_id_key_t const * const * pp_id_keys, ble_gap_irk_t const * const * pp_local_irks, uint8_t len));
-
-
-/**@brief Set privacy settings.
- *
- * @note Privacy settings cannot be changed while advertising, scanning or creating a connection.
- *
- * @param[in] p_privacy_params Privacy settings.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_PRIVACY_ADV_MSC}
- * @mmsc{@ref BLE_GAP_PRIVACY_SCAN_MSC}
- * @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC}
- * @endmscs
- *
- * @retval ::NRF_SUCCESS Set successfully.
- * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry.
- * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied.
- * @retval ::NRF_ERROR_INVALID_ADDR The pointer to privacy settings is NULL or invalid.
- * Otherwise, the p_device_irk pointer in privacy parameter is an invalid pointer.
- * @retval ::NRF_ERROR_INVALID_PARAM Out of range parameters are provided.
- * @retval ::NRF_ERROR_INVALID_STATE Privacy settings cannot be changed while advertising, scanning
- * or creating a connection.
- */
-SVCALL(SD_BLE_GAP_PRIVACY_SET, uint32_t, sd_ble_gap_privacy_set(ble_gap_privacy_params_t const *p_privacy_params));
-
-
-/**@brief Get privacy settings.
- *
- * @note ::ble_gap_privacy_params_t::p_device_irk must be initialized to NULL or a valid address before this function is called.
- * If it is initialized to a valid address, the address pointed to will contain the current device IRK on return.
- *
- * @param[in,out] p_privacy_params Privacy settings.
- *
- * @retval ::NRF_SUCCESS Privacy settings read.
- * @retval ::NRF_ERROR_INVALID_ADDR The pointer given for returning the privacy settings may be NULL or invalid.
- * Otherwise, the p_device_irk pointer in privacy parameter is an invalid pointer.
- */
-SVCALL(SD_BLE_GAP_PRIVACY_GET, uint32_t, sd_ble_gap_privacy_get(ble_gap_privacy_params_t *p_privacy_params));
-
-
-/**@brief Configure an advertising set. Set, clear or update advertising and scan response data.
- *
- * @note The format of the advertising data will be checked by this call to ensure interoperability.
- * Limitations imposed by this API call to the data provided include having a flags data type in the scan response data and
- * duplicating the local name in the advertising data and scan response data.
- *
- * @note In order to update advertising data while advertising, new advertising buffers must be provided.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_ADV_MSC}
- * @mmsc{@ref BLE_GAP_WL_SHARE_MSC}
- * @endmscs
- *
- * @param[in,out] p_adv_handle Provide a pointer to a handle containing @ref BLE_GAP_ADV_SET_HANDLE_NOT_SET to configure
- * a new advertising set. On success, a new handle is then returned through the pointer.
- * Provide a pointer to an existing advertising handle to configure an existing advertising set.
- * @param[in] p_adv_data Advertising data. If set to NULL, no advertising data will be used. See @ref ble_gap_adv_data_t.
- * @param[in] p_adv_params Advertising parameters. When this function is used to update advertising data while advertising,
- * this parameter must be NULL. See @ref ble_gap_adv_params_t.
- *
- * @retval ::NRF_SUCCESS Advertising set successfully configured.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied:
- * - Invalid advertising data configuration specified. See @ref ble_gap_adv_data_t.
- * - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t.
- * - Use of whitelist requested but whitelist has not been set,
- * see @ref sd_ble_gap_whitelist_set.
- * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR ble_gap_adv_params_t::p_peer_addr is invalid.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:
- * - It is invalid to provide non-NULL advertising set parameters while advertising.
- * - It is invalid to provide the same data buffers while advertising. To update
- * advertising data, provide new advertising buffers.
- * @retval ::BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST Discoverable mode and whitelist incompatible.
- * @retval ::BLE_ERROR_INVALID_ADV_HANDLE The provided advertising handle was not found. Use @ref BLE_GAP_ADV_SET_HANDLE_NOT_SET to
- * configure a new advertising handle.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_FLAGS Invalid combination of advertising flags supplied.
- * @retval ::NRF_ERROR_INVALID_DATA Invalid data type(s) supplied. Check the advertising data format specification
- * given in Bluetooth Specification Version 5.0, Volume 3, Part C, Chapter 11.
- * @retval ::NRF_ERROR_INVALID_LENGTH Invalid data length(s) supplied.
- * @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported data length or advertising parameter configuration.
- * @retval ::NRF_ERROR_NO_MEM Not enough memory to configure a new advertising handle. Update an
- * existing advertising handle instead.
- * @retval ::BLE_ERROR_GAP_UUID_LIST_MISMATCH Invalid UUID list supplied.
- */
-SVCALL(SD_BLE_GAP_ADV_SET_CONFIGURE, uint32_t, sd_ble_gap_adv_set_configure(uint8_t *p_adv_handle, ble_gap_adv_data_t const *p_adv_data, ble_gap_adv_params_t const *p_adv_params));
-
-
-/**@brief Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).
- *
- * @note Only one advertiser may be active at any time.
- *
- * @events
- * @event{@ref BLE_GAP_EVT_CONNECTED, Generated after connection has been established through connectable advertising.}
- * @event{@ref BLE_GAP_EVT_ADV_SET_TERMINATED, Advertising set has terminated.}
- * @event{@ref BLE_GAP_EVT_SCAN_REQ_REPORT, A scan request was received.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_ADV_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_CONN_PRIV_MSC}
- * @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC}
- * @mmsc{@ref BLE_GAP_WL_SHARE_MSC}
- * @endmscs
- *
- * @param[in] adv_handle Advertising handle to advertise on, received from @ref sd_ble_gap_adv_set_configure.
- * @param[in] conn_cfg_tag Tag identifying a configuration set by @ref sd_ble_cfg_set or
- * @ref BLE_CONN_CFG_TAG_DEFAULT to use the default connection configuration. For non-connectable
- * advertising, this is ignored.
- *
- * @retval ::NRF_SUCCESS The BLE stack has started advertising.
- * @retval ::NRF_ERROR_INVALID_STATE adv_handle is not configured or already advertising.
- * @retval ::NRF_ERROR_CONN_COUNT The limit of available connections has been reached; connectable advertiser cannot be started.
- * @retval ::BLE_ERROR_INVALID_ADV_HANDLE Advertising handle not found. Configure a new adveriting handle with @ref sd_ble_gap_adv_set_configure.
- * @retval ::NRF_ERROR_NOT_FOUND conn_cfg_tag not found.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied:
- * - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t.
- * - Use of whitelist requested but whitelist has not been set, see @ref sd_ble_gap_whitelist_set.
- * @retval ::NRF_ERROR_RESOURCES Either:
- * - adv_handle is configured with connectable advertising, but the event_length parameter
- * associated with conn_cfg_tag is too small to be able to establish a connection on
- * the selected advertising phys. Use @ref sd_ble_cfg_set to increase the event length.
- * - Not enough BLE role slots available.
- Stop one or more currently active roles (Central, Peripheral, Broadcaster or Observer) and try again.
- * - p_adv_params is configured with connectable advertising, but the event_length parameter
- * associated with conn_cfg_tag is too small to be able to establish a connection on
- * the selected advertising phys. Use @ref sd_ble_cfg_set to increase the event length.
- */
-SVCALL(SD_BLE_GAP_ADV_START, uint32_t, sd_ble_gap_adv_start(uint8_t adv_handle, uint8_t conn_cfg_tag));
-
-
-/**@brief Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_ADV_MSC}
- * @mmsc{@ref BLE_GAP_WL_SHARE_MSC}
- * @endmscs
- *
- * @param[in] adv_handle The advertising handle that should stop advertising.
- *
- * @retval ::NRF_SUCCESS The BLE stack has stopped advertising.
- * @retval ::BLE_ERROR_INVALID_ADV_HANDLE Invalid advertising handle.
- * @retval ::NRF_ERROR_INVALID_STATE The advertising handle is not advertising.
- */
-SVCALL(SD_BLE_GAP_ADV_STOP, uint32_t, sd_ble_gap_adv_stop(uint8_t adv_handle));
-
-
-
-/**@brief Update connection parameters.
- *
- * @details In the central role this will initiate a Link Layer connection parameter update procedure,
- * otherwise in the peripheral role, this will send the corresponding L2CAP request and wait for
- * the central to perform the procedure. In both cases, and regardless of success or failure, the application
- * will be informed of the result with a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE event.
- *
- * @details This function can be used as a central both to reply to a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST or to start the procedure unrequested.
- *
- * @events
- * @event{@ref BLE_GAP_EVT_CONN_PARAM_UPDATE, Result of the connection parameter update procedure.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_CPU_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC}
- * @mmsc{@ref BLE_GAP_MULTILINK_CPU_MSC}
- * @mmsc{@ref BLE_GAP_MULTILINK_CTRL_PROC_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_CPU_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] p_conn_params Pointer to desired connection parameters. If NULL is provided on a peripheral role,
- * the parameters in the PPCP characteristic of the GAP service will be used instead.
- * If NULL is provided on a central role and in response to a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST, the peripheral request will be rejected
- *
- * @retval ::NRF_SUCCESS The Connection Update procedure has been started successfully.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints.
- * @retval ::NRF_ERROR_INVALID_STATE Disconnection in progress or link has not been established.
- * @retval ::NRF_ERROR_BUSY Procedure already in progress, wait for pending procedures to complete and retry.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation.
- */
-SVCALL(SD_BLE_GAP_CONN_PARAM_UPDATE, uint32_t, sd_ble_gap_conn_param_update(uint16_t conn_handle, ble_gap_conn_params_t const *p_conn_params));
-
-
-/**@brief Disconnect (GAP Link Termination).
- *
- * @details This call initiates the disconnection procedure, and its completion will be communicated to the application
- * with a @ref BLE_GAP_EVT_DISCONNECTED event.
- *
- * @events
- * @event{@ref BLE_GAP_EVT_DISCONNECTED, Generated when disconnection procedure is complete.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_CONN_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] hci_status_code HCI status code, see @ref BLE_HCI_STATUS_CODES (accepted values are @ref BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION and @ref BLE_HCI_CONN_INTERVAL_UNACCEPTABLE).
- *
- * @retval ::NRF_SUCCESS The disconnection procedure has been started successfully.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- * @retval ::NRF_ERROR_INVALID_STATE Disconnection in progress or link has not been established.
- */
-SVCALL(SD_BLE_GAP_DISCONNECT, uint32_t, sd_ble_gap_disconnect(uint16_t conn_handle, uint8_t hci_status_code));
-
-
-/**@brief Set the radio's transmit power.
- *
- * @param[in] role The role to set the transmit power for, see @ref BLE_GAP_TX_POWER_ROLES for
- * possible roles.
- * @param[in] handle The handle parameter is interpreted depending on role:
- * - If role is @ref BLE_GAP_TX_POWER_ROLE_CONN, this value is the specific connection handle.
- * - If role is @ref BLE_GAP_TX_POWER_ROLE_ADV, the advertising set identified with the advertising handle,
- * will use the specified transmit power, and include it in the advertising packet headers if
- * @ref ble_gap_adv_properties_t::include_tx_power set.
- * - For all other roles handle is ignored.
- * @param[in] tx_power Radio transmit power in dBm (see note for accepted values).
- *
- * @note Supported tx_power values: -40dBm, -20dBm, -16dBm, -12dBm, -8dBm, -4dBm, 0dBm, +2dBm, +3dBm, +4dBm, +5dBm, +6dBm, +7dBm and +8dBm.
- * @note The initiator will have the same transmit power as the scanner.
- * @note When a connection is created it will inherit the transmit power from the initiator or
- * advertiser leading to the connection.
- *
- * @retval ::NRF_SUCCESS Successfully changed the transmit power.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::BLE_ERROR_INVALID_ADV_HANDLE Advertising handle not found.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- */
-SVCALL(SD_BLE_GAP_TX_POWER_SET, uint32_t, sd_ble_gap_tx_power_set(uint8_t role, uint16_t handle, int8_t tx_power));
-
-
-/**@brief Set GAP Appearance value.
- *
- * @param[in] appearance Appearance (16-bit), see @ref BLE_APPEARANCES.
- *
- * @retval ::NRF_SUCCESS Appearance value set successfully.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- */
-SVCALL(SD_BLE_GAP_APPEARANCE_SET, uint32_t, sd_ble_gap_appearance_set(uint16_t appearance));
-
-
-/**@brief Get GAP Appearance value.
- *
- * @param[out] p_appearance Pointer to appearance (16-bit) to be filled in, see @ref BLE_APPEARANCES.
- *
- * @retval ::NRF_SUCCESS Appearance value retrieved successfully.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- */
-SVCALL(SD_BLE_GAP_APPEARANCE_GET, uint32_t, sd_ble_gap_appearance_get(uint16_t *p_appearance));
-
-
-/**@brief Set GAP Peripheral Preferred Connection Parameters.
- *
- * @param[in] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure with the desired parameters.
- *
- * @retval ::NRF_SUCCESS Peripheral Preferred Connection Parameters set successfully.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- */
-SVCALL(SD_BLE_GAP_PPCP_SET, uint32_t, sd_ble_gap_ppcp_set(ble_gap_conn_params_t const *p_conn_params));
-
-
-/**@brief Get GAP Peripheral Preferred Connection Parameters.
- *
- * @param[out] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure where the parameters will be stored.
- *
- * @retval ::NRF_SUCCESS Peripheral Preferred Connection Parameters retrieved successfully.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- */
-SVCALL(SD_BLE_GAP_PPCP_GET, uint32_t, sd_ble_gap_ppcp_get(ble_gap_conn_params_t *p_conn_params));
-
-
-/**@brief Set GAP device name.
- *
- * @note If the device name is located in application flash memory (see @ref ble_gap_cfg_device_name_t),
- * it cannot be changed. Then @ref NRF_ERROR_FORBIDDEN will be returned.
- *
- * @param[in] p_write_perm Write permissions for the Device Name characteristic, see @ref ble_gap_conn_sec_mode_t.
- * @param[in] p_dev_name Pointer to a UTF-8 encoded, <b>non NULL-terminated</b> string.
- * @param[in] len Length of the UTF-8, <b>non NULL-terminated</b> string pointed to by p_dev_name in octets (must be smaller or equal than @ref BLE_GAP_DEVNAME_MAX_LEN).
- *
- * @retval ::NRF_SUCCESS GAP device name and permissions set successfully.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied.
- * @retval ::NRF_ERROR_FORBIDDEN Device name is not writable.
- */
-SVCALL(SD_BLE_GAP_DEVICE_NAME_SET, uint32_t, sd_ble_gap_device_name_set(ble_gap_conn_sec_mode_t const *p_write_perm, uint8_t const *p_dev_name, uint16_t len));
-
-
-/**@brief Get GAP device name.
- *
- * @note If the device name is longer than the size of the supplied buffer,
- * p_len will return the complete device name length,
- * and not the number of bytes actually returned in p_dev_name.
- * The application may use this information to allocate a suitable buffer size.
- *
- * @param[out] p_dev_name Pointer to an empty buffer where the UTF-8 <b>non NULL-terminated</b> string will be placed. Set to NULL to obtain the complete device name length.
- * @param[in,out] p_len Length of the buffer pointed by p_dev_name, complete device name length on output.
- *
- * @retval ::NRF_SUCCESS GAP device name retrieved successfully.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied.
- */
-SVCALL(SD_BLE_GAP_DEVICE_NAME_GET, uint32_t, sd_ble_gap_device_name_get(uint8_t *p_dev_name, uint16_t *p_len));
-
-
-/**@brief Initiate the GAP Authentication procedure.
- *
- * @details In the central role, this function will send an SMP Pairing Request (or an SMP Pairing Failed if rejected),
- * otherwise in the peripheral role, an SMP Security Request will be sent.
- *
- * @events
- * @event{Depending on the security parameters set and the packet exchanges with the peer\, the following events may be generated:}
- * @event{@ref BLE_GAP_EVT_SEC_PARAMS_REQUEST}
- * @event{@ref BLE_GAP_EVT_SEC_INFO_REQUEST}
- * @event{@ref BLE_GAP_EVT_PASSKEY_DISPLAY}
- * @event{@ref BLE_GAP_EVT_KEY_PRESSED}
- * @event{@ref BLE_GAP_EVT_AUTH_KEY_REQUEST}
- * @event{@ref BLE_GAP_EVT_LESC_DHKEY_REQUEST}
- * @event{@ref BLE_GAP_EVT_CONN_SEC_UPDATE}
- * @event{@ref BLE_GAP_EVT_AUTH_STATUS}
- * @event{@ref BLE_GAP_EVT_TIMEOUT}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_PERIPH_SEC_REQ_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_SEC_REQ_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_PAIRING_JW_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_JW_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] p_sec_params Pointer to the @ref ble_gap_sec_params_t structure with the security parameters to be used during the pairing or bonding procedure.
- * In the peripheral role, only the bond, mitm, lesc and keypress fields of this structure are used.
- * In the central role, this pointer may be NULL to reject a Security Request.
- *
- * @retval ::NRF_SUCCESS Successfully initiated authentication procedure.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:
- * - No link has been established.
- * - An encryption is already executing or queued.
- * @retval ::NRF_ERROR_NO_MEM The maximum number of authentication procedures that can run in parallel for the given role is reached.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- * @retval ::NRF_ERROR_NOT_SUPPORTED Setting of sign or link fields in @ref ble_gap_sec_kdist_t not supported.
- * @retval ::NRF_ERROR_TIMEOUT A SMP timeout has occurred, and further SMP operations on this link is prohibited.
- */
-SVCALL(SD_BLE_GAP_AUTHENTICATE, uint32_t, sd_ble_gap_authenticate(uint16_t conn_handle, ble_gap_sec_params_t const *p_sec_params));
-
-
-/**@brief Reply with GAP security parameters.
- *
- * @details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE.
- * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters.
- *
- * @events
- * @event{This function is used during authentication procedures\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_JW_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_BONDING_JW_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_PERIPH_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_BONDING_STATIC_PK_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_CONFIRM_FAIL_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_KS_TOO_SMALL_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_APP_ERROR_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_REMOTE_PAIRING_FAIL_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_TIMEOUT_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_PAIRING_JW_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_JW_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] sec_status Security status, see @ref BLE_GAP_SEC_STATUS.
- * @param[in] p_sec_params Pointer to a @ref ble_gap_sec_params_t security parameters structure. In the central role this must be set to NULL, as the parameters have
- * already been provided during a previous call to @ref sd_ble_gap_authenticate.
- * @param[in,out] p_sec_keyset Pointer to a @ref ble_gap_sec_keyset_t security keyset structure. Any keys generated and/or distributed as a result of the ongoing security procedure
- * will be stored into the memory referenced by the pointers inside this structure. The keys will be stored and available to the application
- * upon reception of a @ref BLE_GAP_EVT_AUTH_STATUS event.
- * Note that the SoftDevice expects the application to provide memory for storing the
- * peer's keys. So it must be ensured that the relevant pointers inside this structure are not NULL. The pointers to the local key
- * can, however, be NULL, in which case, the local key data will not be available to the application upon reception of the
- * @ref BLE_GAP_EVT_AUTH_STATUS event.
- *
- * @retval ::NRF_SUCCESS Successfully accepted security parameter from the application.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_INVALID_STATE Security parameters has not been requested.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- * @retval ::NRF_ERROR_NOT_SUPPORTED Setting of sign or link fields in @ref ble_gap_sec_kdist_t not supported.
- */
-SVCALL(SD_BLE_GAP_SEC_PARAMS_REPLY, uint32_t, sd_ble_gap_sec_params_reply(uint16_t conn_handle, uint8_t sec_status, ble_gap_sec_params_t const *p_sec_params, ble_gap_sec_keyset_t const *p_sec_keyset));
-
-
-/**@brief Reply with an authentication key.
- *
- * @details This function is only used to reply to a @ref BLE_GAP_EVT_AUTH_KEY_REQUEST or a @ref BLE_GAP_EVT_PASSKEY_DISPLAY, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE.
- * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters.
- *
- * @events
- * @event{This function is used during authentication procedures\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] key_type See @ref BLE_GAP_AUTH_KEY_TYPES.
- * @param[in] p_key If key type is @ref BLE_GAP_AUTH_KEY_TYPE_NONE, then NULL.
- * If key type is @ref BLE_GAP_AUTH_KEY_TYPE_PASSKEY, then a 6-byte ASCII string (digit 0..9 only, no NULL termination)
- * or NULL when confirming LE Secure Connections Numeric Comparison.
- * If key type is @ref BLE_GAP_AUTH_KEY_TYPE_OOB, then a 16-byte OOB key value in little-endian format.
- *
- * @retval ::NRF_SUCCESS Authentication key successfully set.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_INVALID_STATE Authentication key has not been requested.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- */
-SVCALL(SD_BLE_GAP_AUTH_KEY_REPLY, uint32_t, sd_ble_gap_auth_key_reply(uint16_t conn_handle, uint8_t key_type, uint8_t const *p_key));
-
-
-/**@brief Reply with an LE Secure connections DHKey.
- *
- * @details This function is only used to reply to a @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE.
- * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters.
- *
- * @events
- * @event{This function is used during authentication procedures\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC}
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] p_dhkey LE Secure Connections DHKey.
- *
- * @retval ::NRF_SUCCESS DHKey successfully set.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:
- * - The peer is not authenticated.
- * - The application has not pulled a @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST event.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- */
-SVCALL(SD_BLE_GAP_LESC_DHKEY_REPLY, uint32_t, sd_ble_gap_lesc_dhkey_reply(uint16_t conn_handle, ble_gap_lesc_dhkey_t const *p_dhkey));
-
-
-/**@brief Notify the peer of a local keypress.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] kp_not See @ref BLE_GAP_KP_NOT_TYPES.
- *
- * @retval ::NRF_SUCCESS Keypress notification successfully queued for transmission.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:
- * - Authentication key not requested.
- * - Passkey has not been entered.
- * - Keypresses have not been enabled by both peers.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- * @retval ::NRF_ERROR_BUSY The BLE stack is busy. Retry at later time.
- */
-SVCALL(SD_BLE_GAP_KEYPRESS_NOTIFY, uint32_t, sd_ble_gap_keypress_notify(uint16_t conn_handle, uint8_t kp_not));
-
-
-/**@brief Generate a set of OOB data to send to a peer out of band.
- *
- * @note The @ref ble_gap_addr_t included in the OOB data returned will be the currently active one (or, if a connection has already been established,
- * the one used during connection setup). The application may manually overwrite it with an updated value.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle. Can be @ref BLE_CONN_HANDLE_INVALID if a BLE connection has not been established yet.
- * @param[in] p_pk_own LE Secure Connections local P-256 Public Key.
- * @param[out] p_oobd_own The OOB data to be sent out of band to a peer.
- *
- * @retval ::NRF_SUCCESS OOB data successfully generated.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- */
-SVCALL(SD_BLE_GAP_LESC_OOB_DATA_GET, uint32_t, sd_ble_gap_lesc_oob_data_get(uint16_t conn_handle, ble_gap_lesc_p256_pk_t const *p_pk_own, ble_gap_lesc_oob_data_t *p_oobd_own));
-
-/**@brief Provide the OOB data sent/received out of band.
- *
- * @note An authentication procedure with OOB selected as an algorithm must be in progress when calling this function.
- * @note A @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST event with the oobd_req set to 1 must have been received prior to calling this function.
- *
- * @events
- * @event{This function is used during authentication procedures\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] p_oobd_own The OOB data sent out of band to a peer or NULL if the peer has not received OOB data.
- * Must correspond to @ref ble_gap_sec_params_t::oob flag in @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST.
- * @param[in] p_oobd_peer The OOB data received out of band from a peer or NULL if none received.
- * Must correspond to @ref ble_gap_sec_params_t::oob flag
- * in @ref sd_ble_gap_authenticate in the central role or
- * in @ref sd_ble_gap_sec_params_reply in the peripheral role.
- *
- * @retval ::NRF_SUCCESS OOB data accepted.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:
- * - Authentication key not requested
- * - Not expecting LESC OOB data
- * - Have not actually exchanged passkeys.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- */
-SVCALL(SD_BLE_GAP_LESC_OOB_DATA_SET, uint32_t, sd_ble_gap_lesc_oob_data_set(uint16_t conn_handle, ble_gap_lesc_oob_data_t const *p_oobd_own, ble_gap_lesc_oob_data_t const *p_oobd_peer));
-
-
-/**@brief Initiate GAP Encryption procedure.
- *
- * @details In the central role, this function will initiate the encryption procedure using the encryption information provided.
- *
- * @events
- * @event{@ref BLE_GAP_EVT_CONN_SEC_UPDATE, The connection security has been updated.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_ENC_MSC}
- * @mmsc{@ref BLE_GAP_MULTILINK_CTRL_PROC_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_SEC_REQ_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] p_master_id Pointer to a @ref ble_gap_master_id_t master identification structure.
- * @param[in] p_enc_info Pointer to a @ref ble_gap_enc_info_t encryption information structure.
- *
- * @retval ::NRF_SUCCESS Successfully initiated authentication procedure.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_STATE No link has been established.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- * @retval ::BLE_ERROR_INVALID_ROLE Operation is not supported in the Peripheral role.
- * @retval ::NRF_ERROR_BUSY Procedure already in progress or not allowed at this time, wait for pending procedures to complete and retry.
- */
-SVCALL(SD_BLE_GAP_ENCRYPT, uint32_t, sd_ble_gap_encrypt(uint16_t conn_handle, ble_gap_master_id_t const *p_master_id, ble_gap_enc_info_t const *p_enc_info));
-
-
-/**@brief Reply with GAP security information.
- *
- * @details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_INFO_REQUEST, calling it at other times will result in @ref NRF_ERROR_INVALID_STATE.
- * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters.
- * @note Data signing is not yet supported, and p_sign_info must therefore be NULL.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_PERIPH_ENC_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] p_enc_info Pointer to a @ref ble_gap_enc_info_t encryption information structure. May be NULL to signal none is available.
- * @param[in] p_id_info Pointer to a @ref ble_gap_irk_t identity information structure. May be NULL to signal none is available.
- * @param[in] p_sign_info Pointer to a @ref ble_gap_sign_info_t signing information structure. May be NULL to signal none is available.
- *
- * @retval ::NRF_SUCCESS Successfully accepted security information.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:
- * - No link has been established.
- * - No @ref BLE_GAP_EVT_SEC_REQUEST pending.
- * - LE long term key requested command not allowed.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- */
-SVCALL(SD_BLE_GAP_SEC_INFO_REPLY, uint32_t, sd_ble_gap_sec_info_reply(uint16_t conn_handle, ble_gap_enc_info_t const *p_enc_info, ble_gap_irk_t const *p_id_info, ble_gap_sign_info_t const *p_sign_info));
-
-
-/**@brief Get the current connection security.
- *
- * @param[in] conn_handle Connection handle.
- * @param[out] p_conn_sec Pointer to a @ref ble_gap_conn_sec_t structure to be filled in.
- *
- * @retval ::NRF_SUCCESS Current connection security successfully retrieved.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- */
-SVCALL(SD_BLE_GAP_CONN_SEC_GET, uint32_t, sd_ble_gap_conn_sec_get(uint16_t conn_handle, ble_gap_conn_sec_t *p_conn_sec));
-
-
-/**@brief Start reporting the received signal strength to the application.
- *
- * A new event is reported whenever the RSSI value changes, until @ref sd_ble_gap_rssi_stop is called.
- *
- * @events
- * @event{@ref BLE_GAP_EVT_RSSI_CHANGED, New RSSI data available. How often the event is generated is
- * dependent on the settings of the <code>threshold_dbm</code>
- * and <code>skip_count</code> input parameters.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}
- * @mmsc{@ref BLE_GAP_RSSI_FILT_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] threshold_dbm Minimum change in dBm before triggering the @ref BLE_GAP_EVT_RSSI_CHANGED event. Events are disabled if threshold_dbm equals @ref BLE_GAP_RSSI_THRESHOLD_INVALID.
- * @param[in] skip_count Number of RSSI samples with a change of threshold_dbm or more before sending a new @ref BLE_GAP_EVT_RSSI_CHANGED event.
- *
- * @retval ::NRF_SUCCESS Successfully activated RSSI reporting.
- * @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is already ongoing.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- */
-SVCALL(SD_BLE_GAP_RSSI_START, uint32_t, sd_ble_gap_rssi_start(uint16_t conn_handle, uint8_t threshold_dbm, uint8_t skip_count));
-
-
-/**@brief Stop reporting the received signal strength.
- *
- * @note An RSSI change detected before the call but not yet received by the application
- * may be reported after @ref sd_ble_gap_rssi_stop has been called.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}
- * @mmsc{@ref BLE_GAP_RSSI_FILT_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- *
- * @retval ::NRF_SUCCESS Successfully deactivated RSSI reporting.
- * @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is not ongoing.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- */
-SVCALL(SD_BLE_GAP_RSSI_STOP, uint32_t, sd_ble_gap_rssi_stop(uint16_t conn_handle));
-
-
-/**@brief Get the received signal strength for the last connection event.
- *
- * @ref sd_ble_gap_rssi_start must be called to start reporting RSSI before using this function. @ref NRF_ERROR_NOT_FOUND
- * will be returned until RSSI was sampled for the first time after calling @ref sd_ble_gap_rssi_start.
- * @note ERRATA-153 requires the rssi sample to be compensated based on a temperature measurement.
- * @mscs
- * @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[out] p_rssi Pointer to the location where the RSSI measurement shall be stored.
- * @param[out] p_ch_index Pointer to the location where Channel Index for the RSSI measurement shall be stored.
- *
- * @retval ::NRF_SUCCESS Successfully read the RSSI.
- * @retval ::NRF_ERROR_NOT_FOUND No sample is available.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- * @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is not ongoing.
- */
-SVCALL(SD_BLE_GAP_RSSI_GET, uint32_t, sd_ble_gap_rssi_get(uint16_t conn_handle, int8_t *p_rssi, uint8_t *p_ch_index));
-
-
-/**@brief Start or continue scanning (GAP Discovery procedure, Observer Procedure).
- *
- * @note A call to this function will require the application to keep the memory pointed by
- * p_adv_report_buffer alive until the buffer is released. The buffer is released when the scanner is stopped
- * or when this function is called with another buffer.
- *
- * @note The scanner will automatically stop in the following cases:
- * - @ref sd_ble_gap_scan_stop is called.
- * - @ref sd_ble_gap_connect is called.
- * - A @ref BLE_GAP_EVT_TIMEOUT with source set to @ref BLE_GAP_TIMEOUT_SRC_SCAN is received.
- * - When a @ref BLE_GAP_EVT_ADV_REPORT event is received and @ref ble_gap_adv_report_type_t::status is not set to
- * @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA. In this case scanning is only paused to let the application
- * access received data. The application must call this function to continue scanning, or call @ref sd_ble_gap_scan_stop
- * to stop scanning.
- *
- * @note If a @ref BLE_GAP_EVT_ADV_REPORT event is received with @ref ble_gap_adv_report_type_t::status set to
- * @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, the scanner will continue scanning, and the application will
- * receive more reports from this advertising event. The following reports will include the old and new received data.
- *
- * @events
- * @event{@ref BLE_GAP_EVT_ADV_REPORT, An advertising or scan response packet has been received.}
- * @event{@ref BLE_GAP_EVT_TIMEOUT, Scanner has timed out.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_SCAN_MSC}
- * @mmsc{@ref BLE_GAP_WL_SHARE_MSC}
- * @endmscs
- *
- * @param[in] p_scan_params Pointer to scan parameters structure. When this function is used to continue
- * scanning, this parameter must be NULL.
- * @param[in] p_adv_report_buffer Pointer to buffer used to store incoming advertising data.
- * The memory pointed to should be kept alive until the scanning is stopped.
- * See @ref BLE_GAP_SCAN_BUFFER_SIZE for minimum and maximum buffer size.
- * If the scanner receives advertising data larger than can be stored in the buffer,
- * a @ref BLE_GAP_EVT_ADV_REPORT will be raised with @ref ble_gap_adv_report_type_t::status
- * set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_TRUNCATED.
- *
- * @retval ::NRF_SUCCESS Successfully initiated scanning procedure.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:
- * - Scanning is already ongoing and p_scan_params was not NULL
- * - Scanning is not running and p_scan_params was NULL.
- * - The scanner has timed out when this function is called to continue scanning.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. See @ref ble_gap_scan_params_t.
- * @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported parameters supplied. See @ref ble_gap_scan_params_t.
- * @retval ::NRF_ERROR_INVALID_LENGTH The provided buffer length is invalid. See @ref BLE_GAP_SCAN_BUFFER_MIN.
- * @retval ::NRF_ERROR_RESOURCES Not enough BLE role slots available.
- * Stop one or more currently active roles (Central, Peripheral or Broadcaster) and try again
- */
-SVCALL(SD_BLE_GAP_SCAN_START, uint32_t, sd_ble_gap_scan_start(ble_gap_scan_params_t const *p_scan_params, ble_data_t const * p_adv_report_buffer));
-
-
-/**@brief Stop scanning (GAP Discovery procedure, Observer Procedure).
- *
- * @note The buffer provided in @ref sd_ble_gap_scan_start is released.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_SCAN_MSC}
- * @mmsc{@ref BLE_GAP_WL_SHARE_MSC}
- * @endmscs
- *
- * @retval ::NRF_SUCCESS Successfully stopped scanning procedure.
- * @retval ::NRF_ERROR_INVALID_STATE Not in the scanning state.
- */
-SVCALL(SD_BLE_GAP_SCAN_STOP, uint32_t, sd_ble_gap_scan_stop(void));
-
-
-/**@brief Create a connection (GAP Link Establishment).
- *
- * @note If a scanning procedure is currently in progress it will be automatically stopped when calling this function.
- * The scanning procedure will be stopped even if the function returns an error.
- *
- * @events
- * @event{@ref BLE_GAP_EVT_CONNECTED, A connection was established.}
- * @event{@ref BLE_GAP_EVT_TIMEOUT, Failed to establish a connection.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_WL_SHARE_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_CONN_PRIV_MSC}
- * @mmsc{@ref BLE_GAP_CENTRAL_CONN_MSC}
- * @endmscs
- *
- * @param[in] p_peer_addr Pointer to peer identity address. If @ref ble_gap_scan_params_t::filter_policy is set to use
- * whitelist, then p_peer_addr is ignored.
- * @param[in] p_scan_params Pointer to scan parameters structure.
- * @param[in] p_conn_params Pointer to desired connection parameters.
- * @param[in] conn_cfg_tag Tag identifying a configuration set by @ref sd_ble_cfg_set or
- * @ref BLE_CONN_CFG_TAG_DEFAULT to use the default connection configuration.
- *
- * @retval ::NRF_SUCCESS Successfully initiated connection procedure.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid parameter(s) pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * - Invalid parameter(s) in p_scan_params or p_conn_params.
- * - Use of whitelist requested but whitelist has not been set, see @ref sd_ble_gap_whitelist_set.
- * - Peer address was not present in the device identity list, see @ref sd_ble_gap_device_identities_set.
- * @retval ::NRF_ERROR_NOT_FOUND conn_cfg_tag not found.
- * @retval ::NRF_ERROR_INVALID_STATE The SoftDevice is in an invalid state to perform this operation. This may be due to an
- * existing locally initiated connect procedure, which must complete before initiating again.
- * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid Peer address.
- * @retval ::NRF_ERROR_CONN_COUNT The limit of available connections has been reached.
- * @retval ::NRF_ERROR_RESOURCES Either:
- * - Not enough BLE role slots available.
- * Stop one or more currently active roles (Central, Peripheral or Observer) and try again.
- * - The event_length parameter associated with conn_cfg_tag is too small to be able to
- * establish a connection on the selected @ref ble_gap_scan_params_t::scan_phys.
- * Use @ref sd_ble_cfg_set to increase the event length.
- */
-SVCALL(SD_BLE_GAP_CONNECT, uint32_t, sd_ble_gap_connect(ble_gap_addr_t const *p_peer_addr, ble_gap_scan_params_t const *p_scan_params, ble_gap_conn_params_t const *p_conn_params, uint8_t conn_cfg_tag));
-
-
-/**@brief Cancel a connection establishment.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_CENTRAL_CONN_MSC}
- * @endmscs
- *
- * @retval ::NRF_SUCCESS Successfully canceled an ongoing connection procedure.
- * @retval ::NRF_ERROR_INVALID_STATE No locally initiated connect procedure started or connection
- * completed occurred.
- */
-SVCALL(SD_BLE_GAP_CONNECT_CANCEL, uint32_t, sd_ble_gap_connect_cancel(void));
-
-
-/**@brief Initiate or respond to a PHY Update Procedure
- *
- * @details This function is used to initiate or respond to a PHY Update Procedure. It will always
- * generate a @ref BLE_GAP_EVT_PHY_UPDATE event if successfully executed.
- * If this function is used to initiate a PHY Update procedure and the only option
- * provided in @ref ble_gap_phys_t::tx_phys and @ref ble_gap_phys_t::rx_phys is the
- * currently active PHYs in the respective directions, the SoftDevice will generate a
- * @ref BLE_GAP_EVT_PHY_UPDATE with the current PHYs set and will not initiate the
- * procedure in the Link Layer.
- *
- * If @ref ble_gap_phys_t::tx_phys or @ref ble_gap_phys_t::rx_phys is @ref BLE_GAP_PHY_AUTO,
- * then the stack will select PHYs based on the peer's PHY preferences and the local link
- * configuration. The PHY Update procedure will for this case result in a PHY combination
- * that respects the time constraints configured with @ref sd_ble_cfg_set and the current
- * link layer data length.
- *
- * When acting as a central, the SoftDevice will select the fastest common PHY in each direction.
- *
- * If the peer does not support the PHY Update Procedure, then the resulting
- * @ref BLE_GAP_EVT_PHY_UPDATE event will have a status set to
- * @ref BLE_HCI_UNSUPPORTED_REMOTE_FEATURE.
- *
- * If the PHY procedure was rejected by the peer due to a procedure collision, the status
- * will be @ref BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION or
- * @ref BLE_HCI_DIFFERENT_TRANSACTION_COLLISION.
- * If the peer responds to the PHY Update procedure with invalid parameters, the status
- * will be @ref BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS.
- * If the PHY procedure was rejected by the peer for a different reason, the status will
- * contain the reason as specified by the peer.
- *
- * @events
- * @event{@ref BLE_GAP_EVT_PHY_UPDATE, Result of the PHY Update Procedure.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_CENTRAL_PHY_UPDATE}
- * @mmsc{@ref BLE_GAP_PERIPHERAL_PHY_UPDATE}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle to indicate the connection for which the PHY Update is requested.
- * @param[in] p_gap_phys Pointer to PHY structure.
- *
- * @retval ::NRF_SUCCESS Successfully requested a PHY Update.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_INVALID_STATE No link has been established.
- * @retval ::NRF_ERROR_RESOURCES The connection event length configured for this link is not sufficient for the combination of
- * @ref ble_gap_phys_t::tx_phys, @ref ble_gap_phys_t::rx_phys, and @ref ble_gap_data_length_params_t.
- * The connection event length is configured with @ref BLE_CONN_CFG_GAP using @ref sd_ble_cfg_set.
- * @retval ::NRF_ERROR_BUSY Procedure is already in progress or not allowed at this time. Process pending events and wait for the pending procedure to complete and retry.
- *
- */
-SVCALL(SD_BLE_GAP_PHY_UPDATE, uint32_t, sd_ble_gap_phy_update(uint16_t conn_handle, ble_gap_phys_t const *p_gap_phys));
-
-
-/**@brief Initiate or respond to a Data Length Update Procedure.
- *
- * @note If the application uses @ref BLE_GAP_DATA_LENGTH_AUTO for one or more members of
- * p_dl_params, the SoftDevice will choose the highest value supported in current
- * configuration and connection parameters.
- * @note If the link PHY is Coded, the SoftDevice will ensure that the MaxTxTime and/or MaxRxTime
- * used in the Data Length Update procedure is at least 2704 us. Otherwise, MaxTxTime and
- * MaxRxTime will be limited to maximum 2120 us.
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] p_dl_params Pointer to local parameters to be used in Data Length Update
- * Procedure. Set any member to @ref BLE_GAP_DATA_LENGTH_AUTO to let
- * the SoftDevice automatically decide the value for that member.
- * Set to NULL to use automatic values for all members.
- * @param[out] p_dl_limitation Pointer to limitation to be written when local device does not
- * have enough resources or does not support the requested Data Length
- * Update parameters. Ignored if NULL.
- *
- * @mscs
- * @mmsc{@ref BLE_GAP_DATA_LENGTH_UPDATE_PROCEDURE_MSC}
- * @endmscs
- *
- * @retval ::NRF_SUCCESS Successfully set Data Length Extension initiation/response parameters.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter supplied.
- * @retval ::NRF_ERROR_INVALID_STATE No link has been established.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameters supplied.
- * @retval ::NRF_ERROR_NOT_SUPPORTED The requested parameters are not supported by the SoftDevice. Inspect
- * p_dl_limitation to see which parameter is not supported.
- * @retval ::NRF_ERROR_RESOURCES The connection event length configured for this link is not sufficient for the requested parameters.
- * Use @ref sd_ble_cfg_set with @ref BLE_CONN_CFG_GAP to increase the connection event length.
- * Inspect p_dl_limitation to see where the limitation is.
- * @retval ::NRF_ERROR_BUSY Peer has already initiated a Data Length Update Procedure. Process the
- * pending @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST event to respond.
- */
-SVCALL(SD_BLE_GAP_DATA_LENGTH_UPDATE, uint32_t, sd_ble_gap_data_length_update(uint16_t conn_handle, ble_gap_data_length_params_t const *p_dl_params, ble_gap_data_length_limitation_t *p_dl_limitation));
-
-/**@brief Start the Quality of Service (QoS) channel survey module.
- *
- * @details The channel survey module provides measurements of the energy levels on
- * the Bluetooth Low Energy channels. When the module is enabled, @ref BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT
- * events will periodically report the measured energy levels for each channel.
- *
- * @note The measurements are scheduled with lower priority than other Bluetooth Low Energy roles,
- * Radio Timeslot API events and Flash API events.
- *
- * @note The channel survey module will attempt to do measurements so that the average interval
- * between measurements will be interval_us. However due to the channel survey module
- * having the lowest priority of all roles and modules, this may not be possible. In that
- * case fewer than expected channel survey reports may be given.
- *
- * @note In order to use the channel survey module, @ref ble_gap_cfg_role_count_t::qos_channel_survey_role_available
- * must be set. This is done using @ref sd_ble_cfg_set.
- *
- * @param[in] interval_us Requested average interval for the measurements and reports. See
- * @ref BLE_GAP_QOS_CHANNEL_SURVEY_INTERVALS for valid ranges. If set
- * to @ref BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_CONTINUOUS, the channel
- * survey role will be scheduled at every available opportunity.
- *
- * @retval ::NRF_SUCCESS The module is successfully started.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter supplied. interval_us is out of the
- * allowed range.
- * @retval ::NRF_ERROR_INVALID_STATE Trying to start the module when already running.
- * @retval ::NRF_ERROR_RESOURCES The channel survey module is not available to the application.
- * Set @ref ble_gap_cfg_role_count_t::qos_channel_survey_role_available using
- * @ref sd_ble_cfg_set.
- */
-SVCALL(SD_BLE_GAP_QOS_CHANNEL_SURVEY_START, uint32_t, sd_ble_gap_qos_channel_survey_start(uint32_t interval_us));
-
-/**@brief Stop the Quality of Service (QoS) channel survey module.
- *
- * @retval ::NRF_SUCCESS The module is successfully stopped.
- * @retval ::NRF_ERROR_INVALID_STATE Trying to stop the module when it is not running.
- */
-SVCALL(SD_BLE_GAP_QOS_CHANNEL_SURVEY_STOP, uint32_t, sd_ble_gap_qos_channel_survey_stop(void));
-
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-#endif // BLE_GAP_H__
-
-/**
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gatt.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gatt.h
deleted file mode 100755
index 9cb577cc..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gatt.h
+++ /dev/null
@@ -1,229 +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.
- */
-
-/**
- @addtogroup BLE_GATT Generic Attribute Profile (GATT) Common
- @{
- @brief Common definitions and prototypes for the GATT interfaces.
- */
-
-#ifndef BLE_GATT_H__
-#define BLE_GATT_H__
-
-#include <stdint.h>
-#include "nrf_svc.h"
-#include "nrf_error.h"
-#include "ble_hci.h"
-#include "ble_ranges.h"
-#include "ble_types.h"
-#include "ble_err.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup BLE_GATT_DEFINES Defines
- * @{ */
-
-/** @brief Default ATT MTU, in bytes. */
-#define BLE_GATT_ATT_MTU_DEFAULT 23
-
-/**@brief Invalid Attribute Handle. */
-#define BLE_GATT_HANDLE_INVALID 0x0000
-
-/**@brief First Attribute Handle. */
-#define BLE_GATT_HANDLE_START 0x0001
-
-/**@brief Last Attribute Handle. */
-#define BLE_GATT_HANDLE_END 0xFFFF
-
-/** @defgroup BLE_GATT_TIMEOUT_SOURCES GATT Timeout sources
- * @{ */
-#define BLE_GATT_TIMEOUT_SRC_PROTOCOL 0x00 /**< ATT Protocol timeout. */
-/** @} */
-
-/** @defgroup BLE_GATT_WRITE_OPS GATT Write operations
- * @{ */
-#define BLE_GATT_OP_INVALID 0x00 /**< Invalid Operation. */
-#define BLE_GATT_OP_WRITE_REQ 0x01 /**< Write Request. */
-#define BLE_GATT_OP_WRITE_CMD 0x02 /**< Write Command. */
-#define BLE_GATT_OP_SIGN_WRITE_CMD 0x03 /**< Signed Write Command. */
-#define BLE_GATT_OP_PREP_WRITE_REQ 0x04 /**< Prepare Write Request. */
-#define BLE_GATT_OP_EXEC_WRITE_REQ 0x05 /**< Execute Write Request. */
-/** @} */
-
-/** @defgroup BLE_GATT_EXEC_WRITE_FLAGS GATT Execute Write flags
- * @{ */
-#define BLE_GATT_EXEC_WRITE_FLAG_PREPARED_CANCEL 0x00 /**< Cancel prepared write. */
-#define BLE_GATT_EXEC_WRITE_FLAG_PREPARED_WRITE 0x01 /**< Execute prepared write. */
-/** @} */
-
-/** @defgroup BLE_GATT_HVX_TYPES GATT Handle Value operations
- * @{ */
-#define BLE_GATT_HVX_INVALID 0x00 /**< Invalid Operation. */
-#define BLE_GATT_HVX_NOTIFICATION 0x01 /**< Handle Value Notification. */
-#define BLE_GATT_HVX_INDICATION 0x02 /**< Handle Value Indication. */
-/** @} */
-
-/** @defgroup BLE_GATT_STATUS_CODES GATT Status Codes
- * @{ */
-#define BLE_GATT_STATUS_SUCCESS 0x0000 /**< Success. */
-#define BLE_GATT_STATUS_UNKNOWN 0x0001 /**< Unknown or not applicable status. */
-#define BLE_GATT_STATUS_ATTERR_INVALID 0x0100 /**< ATT Error: Invalid Error Code. */
-#define BLE_GATT_STATUS_ATTERR_INVALID_HANDLE 0x0101 /**< ATT Error: Invalid Attribute Handle. */
-#define BLE_GATT_STATUS_ATTERR_READ_NOT_PERMITTED 0x0102 /**< ATT Error: Read not permitted. */
-#define BLE_GATT_STATUS_ATTERR_WRITE_NOT_PERMITTED 0x0103 /**< ATT Error: Write not permitted. */
-#define BLE_GATT_STATUS_ATTERR_INVALID_PDU 0x0104 /**< ATT Error: Used in ATT as Invalid PDU. */
-#define BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION 0x0105 /**< ATT Error: Authenticated link required. */
-#define BLE_GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED 0x0106 /**< ATT Error: Used in ATT as Request Not Supported. */
-#define BLE_GATT_STATUS_ATTERR_INVALID_OFFSET 0x0107 /**< ATT Error: Offset specified was past the end of the attribute. */
-#define BLE_GATT_STATUS_ATTERR_INSUF_AUTHORIZATION 0x0108 /**< ATT Error: Used in ATT as Insufficient Authorization. */
-#define BLE_GATT_STATUS_ATTERR_PREPARE_QUEUE_FULL 0x0109 /**< ATT Error: Used in ATT as Prepare Queue Full. */
-#define BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND 0x010A /**< ATT Error: Used in ATT as Attribute not found. */
-#define BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_LONG 0x010B /**< ATT Error: Attribute cannot be read or written using read/write blob requests. */
-#define BLE_GATT_STATUS_ATTERR_INSUF_ENC_KEY_SIZE 0x010C /**< ATT Error: Encryption key size used is insufficient. */
-#define BLE_GATT_STATUS_ATTERR_INVALID_ATT_VAL_LENGTH 0x010D /**< ATT Error: Invalid value size. */
-#define BLE_GATT_STATUS_ATTERR_UNLIKELY_ERROR 0x010E /**< ATT Error: Very unlikely error. */
-#define BLE_GATT_STATUS_ATTERR_INSUF_ENCRYPTION 0x010F /**< ATT Error: Encrypted link required. */
-#define BLE_GATT_STATUS_ATTERR_UNSUPPORTED_GROUP_TYPE 0x0110 /**< ATT Error: Attribute type is not a supported grouping attribute. */
-#define BLE_GATT_STATUS_ATTERR_INSUF_RESOURCES 0x0111 /**< ATT Error: Encrypted link required. */
-#define BLE_GATT_STATUS_ATTERR_RFU_RANGE1_BEGIN 0x0112 /**< ATT Error: Reserved for Future Use range #1 begin. */
-#define BLE_GATT_STATUS_ATTERR_RFU_RANGE1_END 0x017F /**< ATT Error: Reserved for Future Use range #1 end. */
-#define BLE_GATT_STATUS_ATTERR_APP_BEGIN 0x0180 /**< ATT Error: Application range begin. */
-#define BLE_GATT_STATUS_ATTERR_APP_END 0x019F /**< ATT Error: Application range end. */
-#define BLE_GATT_STATUS_ATTERR_RFU_RANGE2_BEGIN 0x01A0 /**< ATT Error: Reserved for Future Use range #2 begin. */
-#define BLE_GATT_STATUS_ATTERR_RFU_RANGE2_END 0x01DF /**< ATT Error: Reserved for Future Use range #2 end. */
-#define BLE_GATT_STATUS_ATTERR_RFU_RANGE3_BEGIN 0x01E0 /**< ATT Error: Reserved for Future Use range #3 begin. */
-#define BLE_GATT_STATUS_ATTERR_RFU_RANGE3_END 0x01FC /**< ATT Error: Reserved for Future Use range #3 end. */
-#define BLE_GATT_STATUS_ATTERR_CPS_WRITE_REQ_REJECTED 0x01FC /**< ATT Common Profile and Service Error: Write request rejected. */
-#define BLE_GATT_STATUS_ATTERR_CPS_CCCD_CONFIG_ERROR 0x01FD /**< ATT Common Profile and Service Error: Client Characteristic Configuration Descriptor improperly configured. */
-#define BLE_GATT_STATUS_ATTERR_CPS_PROC_ALR_IN_PROG 0x01FE /**< ATT Common Profile and Service Error: Procedure Already in Progress. */
-#define BLE_GATT_STATUS_ATTERR_CPS_OUT_OF_RANGE 0x01FF /**< ATT Common Profile and Service Error: Out Of Range. */
-/** @} */
-
-
-/** @defgroup BLE_GATT_CPF_FORMATS Characteristic Presentation Formats
- * @note Found at http://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml
- * @{ */
-#define BLE_GATT_CPF_FORMAT_RFU 0x00 /**< Reserved For Future Use. */
-#define BLE_GATT_CPF_FORMAT_BOOLEAN 0x01 /**< Boolean. */
-#define BLE_GATT_CPF_FORMAT_2BIT 0x02 /**< Unsigned 2-bit integer. */
-#define BLE_GATT_CPF_FORMAT_NIBBLE 0x03 /**< Unsigned 4-bit integer. */
-#define BLE_GATT_CPF_FORMAT_UINT8 0x04 /**< Unsigned 8-bit integer. */
-#define BLE_GATT_CPF_FORMAT_UINT12 0x05 /**< Unsigned 12-bit integer. */
-#define BLE_GATT_CPF_FORMAT_UINT16 0x06 /**< Unsigned 16-bit integer. */
-#define BLE_GATT_CPF_FORMAT_UINT24 0x07 /**< Unsigned 24-bit integer. */
-#define BLE_GATT_CPF_FORMAT_UINT32 0x08 /**< Unsigned 32-bit integer. */
-#define BLE_GATT_CPF_FORMAT_UINT48 0x09 /**< Unsigned 48-bit integer. */
-#define BLE_GATT_CPF_FORMAT_UINT64 0x0A /**< Unsigned 64-bit integer. */
-#define BLE_GATT_CPF_FORMAT_UINT128 0x0B /**< Unsigned 128-bit integer. */
-#define BLE_GATT_CPF_FORMAT_SINT8 0x0C /**< Signed 2-bit integer. */
-#define BLE_GATT_CPF_FORMAT_SINT12 0x0D /**< Signed 12-bit integer. */
-#define BLE_GATT_CPF_FORMAT_SINT16 0x0E /**< Signed 16-bit integer. */
-#define BLE_GATT_CPF_FORMAT_SINT24 0x0F /**< Signed 24-bit integer. */
-#define BLE_GATT_CPF_FORMAT_SINT32 0x10 /**< Signed 32-bit integer. */
-#define BLE_GATT_CPF_FORMAT_SINT48 0x11 /**< Signed 48-bit integer. */
-#define BLE_GATT_CPF_FORMAT_SINT64 0x12 /**< Signed 64-bit integer. */
-#define BLE_GATT_CPF_FORMAT_SINT128 0x13 /**< Signed 128-bit integer. */
-#define BLE_GATT_CPF_FORMAT_FLOAT32 0x14 /**< IEEE-754 32-bit floating point. */
-#define BLE_GATT_CPF_FORMAT_FLOAT64 0x15 /**< IEEE-754 64-bit floating point. */
-#define BLE_GATT_CPF_FORMAT_SFLOAT 0x16 /**< IEEE-11073 16-bit SFLOAT. */
-#define BLE_GATT_CPF_FORMAT_FLOAT 0x17 /**< IEEE-11073 32-bit FLOAT. */
-#define BLE_GATT_CPF_FORMAT_DUINT16 0x18 /**< IEEE-20601 format. */
-#define BLE_GATT_CPF_FORMAT_UTF8S 0x19 /**< UTF-8 string. */
-#define BLE_GATT_CPF_FORMAT_UTF16S 0x1A /**< UTF-16 string. */
-#define BLE_GATT_CPF_FORMAT_STRUCT 0x1B /**< Opaque Structure. */
-/** @} */
-
-/** @defgroup BLE_GATT_CPF_NAMESPACES GATT Bluetooth Namespaces
- * @{
- */
-#define BLE_GATT_CPF_NAMESPACE_BTSIG 0x01 /**< Bluetooth SIG defined Namespace. */
-#define BLE_GATT_CPF_NAMESPACE_DESCRIPTION_UNKNOWN 0x0000 /**< Namespace Description Unknown. */
-/** @} */
-
-/** @} */
-
-/** @addtogroup BLE_GATT_STRUCTURES Structures
- * @{ */
-
-/**
- * @brief BLE GATT connection configuration parameters, set with @ref sd_ble_cfg_set.
- *
- * @retval ::NRF_ERROR_INVALID_PARAM att_mtu is smaller than @ref BLE_GATT_ATT_MTU_DEFAULT.
- */
-typedef struct
-{
- uint16_t att_mtu; /**< Maximum size of ATT packet the SoftDevice can send or receive.
- The default and minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT.
- @mscs
- @mmsc{@ref BLE_GATTC_MTU_EXCHANGE}
- @mmsc{@ref BLE_GATTS_MTU_EXCHANGE}
- @endmscs
- */
-} ble_gatt_conn_cfg_t;
-
-/**@brief GATT Characteristic Properties. */
-typedef struct
-{
- /* Standard properties */
- uint8_t broadcast :1; /**< Broadcasting of the value permitted. */
- uint8_t read :1; /**< Reading the value permitted. */
- uint8_t write_wo_resp :1; /**< Writing the value with Write Command permitted. */
- uint8_t write :1; /**< Writing the value with Write Request permitted. */
- uint8_t notify :1; /**< Notification of the value permitted. */
- uint8_t indicate :1; /**< Indications of the value permitted. */
- uint8_t auth_signed_wr :1; /**< Writing the value with Signed Write Command permitted. */
-} ble_gatt_char_props_t;
-
-/**@brief GATT Characteristic Extended Properties. */
-typedef struct
-{
- /* Extended properties */
- uint8_t reliable_wr :1; /**< Writing the value with Queued Write operations permitted. */
- uint8_t wr_aux :1; /**< Writing the Characteristic User Description descriptor permitted. */
-} ble_gatt_char_ext_props_t;
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-#endif // BLE_GATT_H__
-
-/** @} */
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gattc.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gattc.h
deleted file mode 100755
index 7fb39202..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gattc.h
+++ /dev/null
@@ -1,715 +0,0 @@
-/*
- * Copyright (c) 2011 - 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, 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.
- */
-
-/**
- @addtogroup BLE_GATTC Generic Attribute Profile (GATT) Client
- @{
- @brief Definitions and prototypes for the GATT Client interface.
- */
-
-#ifndef BLE_GATTC_H__
-#define BLE_GATTC_H__
-
-#include <stdint.h>
-#include "nrf.h"
-#include "nrf_svc.h"
-#include "nrf_error.h"
-#include "ble_ranges.h"
-#include "ble_types.h"
-#include "ble_err.h"
-#include "ble_gatt.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup BLE_GATTC_ENUMERATIONS Enumerations
- * @{ */
-
-/**@brief GATTC API SVC numbers. */
-enum BLE_GATTC_SVCS
-{
- SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER = BLE_GATTC_SVC_BASE, /**< Primary Service Discovery. */
- SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, /**< Relationship Discovery. */
- SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, /**< Characteristic Discovery. */
- SD_BLE_GATTC_DESCRIPTORS_DISCOVER, /**< Characteristic Descriptor Discovery. */
- SD_BLE_GATTC_ATTR_INFO_DISCOVER, /**< Attribute Information Discovery. */
- SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, /**< Read Characteristic Value by UUID. */
- SD_BLE_GATTC_READ, /**< Generic read. */
- SD_BLE_GATTC_CHAR_VALUES_READ, /**< Read multiple Characteristic Values. */
- SD_BLE_GATTC_WRITE, /**< Generic write. */
- SD_BLE_GATTC_HV_CONFIRM, /**< Handle Value Confirmation. */
- SD_BLE_GATTC_EXCHANGE_MTU_REQUEST, /**< Exchange MTU Request. */
-};
-
-/**
- * @brief GATT Client Event IDs.
- */
-enum BLE_GATTC_EVTS
-{
- BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP = BLE_GATTC_EVT_BASE, /**< Primary Service Discovery Response event. \n See @ref ble_gattc_evt_prim_srvc_disc_rsp_t. */
- BLE_GATTC_EVT_REL_DISC_RSP, /**< Relationship Discovery Response event. \n See @ref ble_gattc_evt_rel_disc_rsp_t. */
- BLE_GATTC_EVT_CHAR_DISC_RSP, /**< Characteristic Discovery Response event. \n See @ref ble_gattc_evt_char_disc_rsp_t. */
- BLE_GATTC_EVT_DESC_DISC_RSP, /**< Descriptor Discovery Response event. \n See @ref ble_gattc_evt_desc_disc_rsp_t. */
- BLE_GATTC_EVT_ATTR_INFO_DISC_RSP, /**< Attribute Information Response event. \n See @ref ble_gattc_evt_attr_info_disc_rsp_t. */
- BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP, /**< Read By UUID Response event. \n See @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t. */
- BLE_GATTC_EVT_READ_RSP, /**< Read Response event. \n See @ref ble_gattc_evt_read_rsp_t. */
- BLE_GATTC_EVT_CHAR_VALS_READ_RSP, /**< Read multiple Response event. \n See @ref ble_gattc_evt_char_vals_read_rsp_t. */
- BLE_GATTC_EVT_WRITE_RSP, /**< Write Response event. \n See @ref ble_gattc_evt_write_rsp_t. */
- BLE_GATTC_EVT_HVX, /**< Handle Value Notification or Indication event. \n Confirm indication with @ref sd_ble_gattc_hv_confirm. \n See @ref ble_gattc_evt_hvx_t. */
- BLE_GATTC_EVT_EXCHANGE_MTU_RSP, /**< Exchange MTU Response event. \n See @ref ble_gattc_evt_exchange_mtu_rsp_t. */
- BLE_GATTC_EVT_TIMEOUT, /**< Timeout event. \n See @ref ble_gattc_evt_timeout_t. */
- BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE /**< Write without Response transmission complete. \n See @ref ble_gattc_evt_write_cmd_tx_complete_t. */
-};
-
-/** @} */
-
-/** @addtogroup BLE_GATTC_DEFINES Defines
- * @{ */
-
-/** @defgroup BLE_ERRORS_GATTC SVC return values specific to GATTC
- * @{ */
-#define BLE_ERROR_GATTC_PROC_NOT_PERMITTED (NRF_GATTC_ERR_BASE + 0x000) /**< Procedure not Permitted. */
-/** @} */
-
-/** @defgroup BLE_GATTC_ATTR_INFO_FORMAT Attribute Information Formats
- * @{ */
-#define BLE_GATTC_ATTR_INFO_FORMAT_16BIT 1 /**< 16-bit Attribute Information Format. */
-#define BLE_GATTC_ATTR_INFO_FORMAT_128BIT 2 /**< 128-bit Attribute Information Format. */
-/** @} */
-
-/** @defgroup BLE_GATTC_DEFAULTS GATT Client defaults
- * @{ */
-#define BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT 1 /**< Default number of Write without Response that can be queued for transmission. */
-/** @} */
-
-/** @} */
-
-/** @addtogroup BLE_GATTC_STRUCTURES Structures
- * @{ */
-
-/**
- * @brief BLE GATTC connection configuration parameters, set with @ref sd_ble_cfg_set.
- */
-typedef struct
-{
- uint8_t write_cmd_tx_queue_size; /**< The guaranteed minimum number of Write without Response that can be queued for transmission.
- The default value is @ref BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT */
-} ble_gattc_conn_cfg_t;
-
-/**@brief Operation Handle Range. */
-typedef struct
-{
- uint16_t start_handle; /**< Start Handle. */
- uint16_t end_handle; /**< End Handle. */
-} ble_gattc_handle_range_t;
-
-
-/**@brief GATT service. */
-typedef struct
-{
- ble_uuid_t uuid; /**< Service UUID. */
- ble_gattc_handle_range_t handle_range; /**< Service Handle Range. */
-} ble_gattc_service_t;
-
-
-/**@brief GATT include. */
-typedef struct
-{
- uint16_t handle; /**< Include Handle. */
- ble_gattc_service_t included_srvc; /**< Handle of the included service. */
-} ble_gattc_include_t;
-
-
-/**@brief GATT characteristic. */
-typedef struct
-{
- ble_uuid_t uuid; /**< Characteristic UUID. */
- ble_gatt_char_props_t char_props; /**< Characteristic Properties. */
- uint8_t char_ext_props : 1; /**< Extended properties present. */
- uint16_t handle_decl; /**< Handle of the Characteristic Declaration. */
- uint16_t handle_value; /**< Handle of the Characteristic Value. */
-} ble_gattc_char_t;
-
-
-/**@brief GATT descriptor. */
-typedef struct
-{
- uint16_t handle; /**< Descriptor Handle. */
- ble_uuid_t uuid; /**< Descriptor UUID. */
-} ble_gattc_desc_t;
-
-
-/**@brief Write Parameters. */
-typedef struct
-{
- uint8_t write_op; /**< Write Operation to be performed, see @ref BLE_GATT_WRITE_OPS. */
- uint8_t flags; /**< Flags, see @ref BLE_GATT_EXEC_WRITE_FLAGS. */
- uint16_t handle; /**< Handle to the attribute to be written. */
- uint16_t offset; /**< Offset in bytes. @note For WRITE_CMD and WRITE_REQ, offset must be 0. */
- uint16_t len; /**< Length of data in bytes. */
- uint8_t const *p_value; /**< Pointer to the value data. */
-} ble_gattc_write_params_t;
-
-/**@brief Attribute Information for 16-bit Attribute UUID. */
-typedef struct
-{
- uint16_t handle; /**< Attribute handle. */
- ble_uuid_t uuid; /**< 16-bit Attribute UUID. */
-} ble_gattc_attr_info16_t;
-
-/**@brief Attribute Information for 128-bit Attribute UUID. */
-typedef struct
-{
- uint16_t handle; /**< Attribute handle. */
- ble_uuid128_t uuid; /**< 128-bit Attribute UUID. */
-} ble_gattc_attr_info128_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP. */
-typedef struct
-{
- uint16_t count; /**< Service count. */
- ble_gattc_service_t services[1]; /**< Service data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
- See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
-} ble_gattc_evt_prim_srvc_disc_rsp_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_REL_DISC_RSP. */
-typedef struct
-{
- uint16_t count; /**< Include count. */
- ble_gattc_include_t includes[1]; /**< Include data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
- See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
-} ble_gattc_evt_rel_disc_rsp_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_DISC_RSP. */
-typedef struct
-{
- uint16_t count; /**< Characteristic count. */
- ble_gattc_char_t chars[1]; /**< Characteristic data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
- See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
-} ble_gattc_evt_char_disc_rsp_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_DESC_DISC_RSP. */
-typedef struct
-{
- uint16_t count; /**< Descriptor count. */
- ble_gattc_desc_t descs[1]; /**< Descriptor data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
- See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
-} ble_gattc_evt_desc_disc_rsp_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP. */
-typedef struct
-{
- uint16_t count; /**< Attribute count. */
- uint8_t format; /**< Attribute information format, see @ref BLE_GATTC_ATTR_INFO_FORMAT. */
- union {
- ble_gattc_attr_info16_t attr_info16[1]; /**< Attribute information for 16-bit Attribute UUID.
- @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
- See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
- ble_gattc_attr_info128_t attr_info128[1]; /**< Attribute information for 128-bit Attribute UUID.
- @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
- See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
- } info; /**< Attribute information union. */
-} ble_gattc_evt_attr_info_disc_rsp_t;
-
-/**@brief GATT read by UUID handle value pair. */
-typedef struct
-{
- uint16_t handle; /**< Attribute Handle. */
- uint8_t *p_value; /**< Pointer to the Attribute Value, length is available in @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t::value_len. */
-} ble_gattc_handle_value_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP. */
-typedef struct
-{
- uint16_t count; /**< Handle-Value Pair Count. */
- uint16_t value_len; /**< Length of the value in Handle-Value(s) list. */
- uint8_t handle_value[1]; /**< Handle-Value(s) list. To iterate through the list use @ref sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter.
- @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
- See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
-} ble_gattc_evt_char_val_by_uuid_read_rsp_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_READ_RSP. */
-typedef struct
-{
- uint16_t handle; /**< Attribute Handle. */
- uint16_t offset; /**< Offset of the attribute data. */
- uint16_t len; /**< Attribute data length. */
- uint8_t data[1]; /**< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
- See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
-} ble_gattc_evt_read_rsp_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP. */
-typedef struct
-{
- uint16_t len; /**< Concatenated Attribute values length. */
- uint8_t values[1]; /**< Attribute values. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
- See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
-} ble_gattc_evt_char_vals_read_rsp_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_WRITE_RSP. */
-typedef struct
-{
- uint16_t handle; /**< Attribute Handle. */
- uint8_t write_op; /**< Type of write operation, see @ref BLE_GATT_WRITE_OPS. */
- uint16_t offset; /**< Data offset. */
- uint16_t len; /**< Data length. */
- uint8_t data[1]; /**< Data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
- See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
-} ble_gattc_evt_write_rsp_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_HVX. */
-typedef struct
-{
- uint16_t handle; /**< Handle to which the HVx operation applies. */
- uint8_t type; /**< Indication or Notification, see @ref BLE_GATT_HVX_TYPES. */
- uint16_t len; /**< Attribute data length. */
- uint8_t data[1]; /**< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
- See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
-} ble_gattc_evt_hvx_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP. */
-typedef struct
-{
- uint16_t server_rx_mtu; /**< Server RX MTU size. */
-} ble_gattc_evt_exchange_mtu_rsp_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_TIMEOUT. */
-typedef struct
-{
- uint8_t src; /**< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES. */
-} ble_gattc_evt_timeout_t;
-
-/**@brief Event structure for @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE. */
-typedef struct
-{
- uint8_t count; /**< Number of write without response transmissions completed. */
-} ble_gattc_evt_write_cmd_tx_complete_t;
-
-/**@brief GATTC event structure. */
-typedef struct
-{
- uint16_t conn_handle; /**< Connection Handle on which event occurred. */
- uint16_t gatt_status; /**< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES. */
- uint16_t error_handle; /**< In case of error: The handle causing the error. In all other cases @ref BLE_GATT_HANDLE_INVALID. */
- union
- {
- ble_gattc_evt_prim_srvc_disc_rsp_t prim_srvc_disc_rsp; /**< Primary Service Discovery Response Event Parameters. */
- ble_gattc_evt_rel_disc_rsp_t rel_disc_rsp; /**< Relationship Discovery Response Event Parameters. */
- ble_gattc_evt_char_disc_rsp_t char_disc_rsp; /**< Characteristic Discovery Response Event Parameters. */
- ble_gattc_evt_desc_disc_rsp_t desc_disc_rsp; /**< Descriptor Discovery Response Event Parameters. */
- ble_gattc_evt_char_val_by_uuid_read_rsp_t char_val_by_uuid_read_rsp; /**< Characteristic Value Read by UUID Response Event Parameters. */
- ble_gattc_evt_read_rsp_t read_rsp; /**< Read Response Event Parameters. */
- ble_gattc_evt_char_vals_read_rsp_t char_vals_read_rsp; /**< Characteristic Values Read Response Event Parameters. */
- ble_gattc_evt_write_rsp_t write_rsp; /**< Write Response Event Parameters. */
- ble_gattc_evt_hvx_t hvx; /**< Handle Value Notification/Indication Event Parameters. */
- ble_gattc_evt_exchange_mtu_rsp_t exchange_mtu_rsp; /**< Exchange MTU Response Event Parameters. */
- ble_gattc_evt_timeout_t timeout; /**< Timeout Event Parameters. */
- ble_gattc_evt_attr_info_disc_rsp_t attr_info_disc_rsp; /**< Attribute Information Discovery Event Parameters. */
- ble_gattc_evt_write_cmd_tx_complete_t write_cmd_tx_complete; /**< Write without Response transmission complete Event Parameters. */
- } params; /**< Event Parameters. @note Only valid if @ref gatt_status == @ref BLE_GATT_STATUS_SUCCESS. */
-} ble_gattc_evt_t;
-/** @} */
-
-/** @addtogroup BLE_GATTC_FUNCTIONS Functions
- * @{ */
-
-/**@brief Initiate or continue a GATT Primary Service Discovery procedure.
- *
- * @details This function initiates or resumes a Primary Service discovery procedure, starting from the supplied handle.
- * If the last service has not been reached, this function must be called again with an updated start handle value to continue the search.
- *
- * @note If any of the discovered services have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with
- * type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event.
- *
- * @events
- * @event{@ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GATTC_PRIM_SRVC_DISC_MSC}
- * @endmscs
- *
- * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
- * @param[in] start_handle Handle to start searching from.
- * @param[in] p_srvc_uuid Pointer to the service UUID to be found. If it is NULL, all primary services will be returned.
- *
- * @retval ::NRF_SUCCESS Successfully started or resumed the Primary Service Discovery procedure.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER, uint32_t, sd_ble_gattc_primary_services_discover(uint16_t conn_handle, uint16_t start_handle, ble_uuid_t const *p_srvc_uuid));
-
-
-/**@brief Initiate or continue a GATT Relationship Discovery procedure.
- *
- * @details This function initiates or resumes the Find Included Services sub-procedure. If the last included service has not been reached,
- * this must be called again with an updated handle range to continue the search.
- *
- * @events
- * @event{@ref BLE_GATTC_EVT_REL_DISC_RSP}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GATTC_REL_DISC_MSC}
- * @endmscs
- *
- * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
- * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on.
- *
- * @retval ::NRF_SUCCESS Successfully started or resumed the Relationship Discovery procedure.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, uint32_t, sd_ble_gattc_relationships_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range));
-
-
-/**@brief Initiate or continue a GATT Characteristic Discovery procedure.
- *
- * @details This function initiates or resumes a Characteristic discovery procedure. If the last Characteristic has not been reached,
- * this must be called again with an updated handle range to continue the discovery.
- *
- * @note If any of the discovered characteristics have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with
- * type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event.
- *
- * @events
- * @event{@ref BLE_GATTC_EVT_CHAR_DISC_RSP}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GATTC_CHAR_DISC_MSC}
- * @endmscs
- *
- * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
- * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on.
- *
- * @retval ::NRF_SUCCESS Successfully started or resumed the Characteristic Discovery procedure.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, uint32_t, sd_ble_gattc_characteristics_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range));
-
-
-/**@brief Initiate or continue a GATT Characteristic Descriptor Discovery procedure.
- *
- * @details This function initiates or resumes a Characteristic Descriptor discovery procedure. If the last Descriptor has not been reached,
- * this must be called again with an updated handle range to continue the discovery.
- *
- * @events
- * @event{@ref BLE_GATTC_EVT_DESC_DISC_RSP}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GATTC_DESC_DISC_MSC}
- * @endmscs
- *
- * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
- * @param[in] p_handle_range A pointer to the range of handles of the Characteristic to perform this procedure on.
- *
- * @retval ::NRF_SUCCESS Successfully started or resumed the Descriptor Discovery procedure.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTC_DESCRIPTORS_DISCOVER, uint32_t, sd_ble_gattc_descriptors_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range));
-
-
-/**@brief Initiate or continue a GATT Read using Characteristic UUID procedure.
- *
- * @details This function initiates or resumes a Read using Characteristic UUID procedure. If the last Characteristic has not been reached,
- * this must be called again with an updated handle range to continue the discovery.
- *
- * @events
- * @event{@ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GATTC_READ_UUID_MSC}
- * @endmscs
- *
- * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
- * @param[in] p_uuid Pointer to a Characteristic value UUID to read.
- * @param[in] p_handle_range A pointer to the range of handles to perform this procedure on.
- *
- * @retval ::NRF_SUCCESS Successfully started or resumed the Read using Characteristic UUID procedure.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, uint32_t, sd_ble_gattc_char_value_by_uuid_read(uint16_t conn_handle, ble_uuid_t const *p_uuid, ble_gattc_handle_range_t const *p_handle_range));
-
-
-/**@brief Initiate or continue a GATT Read (Long) Characteristic or Descriptor procedure.
- *
- * @details This function initiates or resumes a GATT Read (Long) Characteristic or Descriptor procedure. If the Characteristic or Descriptor
- * to be read is longer than ATT_MTU - 1, this function must be called multiple times with appropriate offset to read the
- * complete value.
- *
- * @events
- * @event{@ref BLE_GATTC_EVT_READ_RSP}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GATTC_VALUE_READ_MSC}
- * @endmscs
- *
- * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
- * @param[in] handle The handle of the attribute to be read.
- * @param[in] offset Offset into the attribute value to be read.
- *
- * @retval ::NRF_SUCCESS Successfully started or resumed the Read (Long) procedure.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
- * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTC_READ, uint32_t, sd_ble_gattc_read(uint16_t conn_handle, uint16_t handle, uint16_t offset));
-
-
-/**@brief Initiate a GATT Read Multiple Characteristic Values procedure.
- *
- * @details This function initiates a GATT Read Multiple Characteristic Values procedure.
- *
- * @events
- * @event{@ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GATTC_READ_MULT_MSC}
- * @endmscs
- *
- * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
- * @param[in] p_handles A pointer to the handle(s) of the attribute(s) to be read.
- * @param[in] handle_count The number of handles in p_handles.
- *
- * @retval ::NRF_SUCCESS Successfully started the Read Multiple Characteristic Values procedure.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTC_CHAR_VALUES_READ, uint32_t, sd_ble_gattc_char_values_read(uint16_t conn_handle, uint16_t const *p_handles, uint16_t handle_count));
-
-
-/**@brief Perform a Write (Characteristic Value or Descriptor, with or without response, signed or not, long or reliable) procedure.
- *
- * @details This function can perform all write procedures described in GATT.
- *
- * @note Only one write with response procedure can be ongoing per connection at a time.
- * If the application tries to write with response while another write with response procedure is ongoing,
- * the function call will return @ref NRF_ERROR_BUSY.
- * A @ref BLE_GATTC_EVT_WRITE_RSP event will be issued as soon as the write response arrives from the peer.
- *
- * @note The number of Write without Response that can be queued is configured by @ref ble_gattc_conn_cfg_t::write_cmd_tx_queue_size
- * When the queue is full, the function call will return @ref NRF_ERROR_RESOURCES.
- * A @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event will be issued as soon as the transmission of the write without response is complete.
- *
- * @note The application can keep track of the available queue element count for writes without responses by following the procedure below:
- * - Store initial queue element count in a variable.
- * - Decrement the variable, which stores the currently available queue element count, by one when a call to this function returns @ref NRF_SUCCESS.
- * - Increment the variable, which stores the current available queue element count, by the count variable in @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event.
- *
- * @events
- * @event{@ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE, Write without response transmission complete.}
- * @event{@ref BLE_GATTC_EVT_WRITE_RSP, Write response received from the peer.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GATTC_VALUE_WRITE_WITHOUT_RESP_MSC}
- * @mmsc{@ref BLE_GATTC_VALUE_WRITE_MSC}
- * @mmsc{@ref BLE_GATTC_VALUE_LONG_WRITE_MSC}
- * @mmsc{@ref BLE_GATTC_VALUE_RELIABLE_WRITE_MSC}
- * @endmscs
- *
- * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
- * @param[in] p_write_params A pointer to a write parameters structure.
- *
- * @retval ::NRF_SUCCESS Successfully started the Write procedure.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied.
- * @retval ::NRF_ERROR_BUSY For write with response, procedure already in progress. Wait for a @ref BLE_GATTC_EVT_WRITE_RSP event and retry.
- * @retval ::NRF_ERROR_RESOURCES Too many writes without responses queued.
- * Wait for a @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event and retry.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTC_WRITE, uint32_t, sd_ble_gattc_write(uint16_t conn_handle, ble_gattc_write_params_t const *p_write_params));
-
-
-/**@brief Send a Handle Value Confirmation to the GATT Server.
- *
- * @mscs
- * @mmsc{@ref BLE_GATTC_HVI_MSC}
- * @endmscs
- *
- * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
- * @param[in] handle The handle of the attribute in the indication.
- *
- * @retval ::NRF_SUCCESS Successfully queued the Handle Value Confirmation for transmission.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no Indication pending to be confirmed.
- * @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTC_HV_CONFIRM, uint32_t, sd_ble_gattc_hv_confirm(uint16_t conn_handle, uint16_t handle));
-
-/**@brief Discovers information about a range of attributes on a GATT server.
- *
- * @events
- * @event{@ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP, Generated when information about a range of attributes has been received.}
- * @endevents
- *
- * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
- * @param[in] p_handle_range The range of handles to request information about.
- *
- * @retval ::NRF_SUCCESS Successfully started an attribute information discovery procedure.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid connection state
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTC_ATTR_INFO_DISCOVER, uint32_t, sd_ble_gattc_attr_info_discover(uint16_t conn_handle, ble_gattc_handle_range_t const * p_handle_range));
-
-/**@brief Start an ATT_MTU exchange by sending an Exchange MTU Request to the server.
- *
- * @details The SoftDevice sets ATT_MTU to the minimum of:
- * - The Client RX MTU value, and
- * - The Server RX MTU value from @ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP.
- *
- * However, the SoftDevice never sets ATT_MTU lower than @ref BLE_GATT_ATT_MTU_DEFAULT.
- *
- * @events
- * @event{@ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GATTC_MTU_EXCHANGE}
- * @endmscs
- *
- * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
- * @param[in] client_rx_mtu Client RX MTU size.
- * - The minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT.
- * - The maximum value is @ref ble_gatt_conn_cfg_t::att_mtu in the connection configuration
- used for this connection.
- * - The value must be equal to Server RX MTU size given in @ref sd_ble_gatts_exchange_mtu_reply
- * if an ATT_MTU exchange has already been performed in the other direction.
- *
- * @retval ::NRF_SUCCESS Successfully sent request to the server.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid connection state or an ATT_MTU exchange was already requested once.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid Client RX MTU size supplied.
- * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTC_EXCHANGE_MTU_REQUEST, uint32_t, sd_ble_gattc_exchange_mtu_request(uint16_t conn_handle, uint16_t client_rx_mtu));
-
-/**@brief Iterate through Handle-Value(s) list in @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP event.
- *
- * @param[in] p_gattc_evt Pointer to event buffer containing @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP event.
- * @note If the buffer contains different event, behavior is undefined.
- * @param[in,out] p_iter Iterator, points to @ref ble_gattc_handle_value_t structure that will be filled in with
- * the next Handle-Value pair in each iteration. If the function returns other than
- * @ref NRF_SUCCESS, it will not be changed.
- * - To start iteration, initialize the structure to zero.
- * - To continue, pass the value from previous iteration.
- *
- * \code
- * ble_gattc_handle_value_t iter;
- * memset(&iter, 0, sizeof(ble_gattc_handle_value_t));
- * while (sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter(&ble_evt.evt.gattc_evt, &iter) == NRF_SUCCESS)
- * {
- * app_handle = iter.handle;
- * memcpy(app_value, iter.p_value, ble_evt.evt.gattc_evt.params.char_val_by_uuid_read_rsp.value_len);
- * }
- * \endcode
- *
- * @retval ::NRF_SUCCESS Successfully retrieved the next Handle-Value pair.
- * @retval ::NRF_ERROR_NOT_FOUND No more Handle-Value pairs available in the list.
- */
-__STATIC_INLINE uint32_t sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter(ble_gattc_evt_t *p_gattc_evt, ble_gattc_handle_value_t *p_iter);
-
-/** @} */
-
-#ifndef SUPPRESS_INLINE_IMPLEMENTATION
-
-__STATIC_INLINE uint32_t sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter(ble_gattc_evt_t *p_gattc_evt, ble_gattc_handle_value_t *p_iter)
-{
- uint32_t value_len = p_gattc_evt->params.char_val_by_uuid_read_rsp.value_len;
- uint8_t *p_first = p_gattc_evt->params.char_val_by_uuid_read_rsp.handle_value;
- uint8_t *p_next = p_iter->p_value ? p_iter->p_value + value_len : p_first;
-
- if ((p_next - p_first) / (sizeof(uint16_t) + value_len) < p_gattc_evt->params.char_val_by_uuid_read_rsp.count)
- {
- p_iter->handle = (uint16_t)p_next[1] << 8 | p_next[0];
- p_iter->p_value = p_next + sizeof(uint16_t);
- return NRF_SUCCESS;
- }
- else
- {
- return NRF_ERROR_NOT_FOUND;
- }
-}
-
-#endif /* SUPPRESS_INLINE_IMPLEMENTATION */
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* BLE_GATTC_H__ */
-
-/**
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gatts.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gatts.h
deleted file mode 100755
index 394d8d18..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_gatts.h
+++ /dev/null
@@ -1,845 +0,0 @@
-/*
- * Copyright (c) 2011 - 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.
- */
-
-/**
- @addtogroup BLE_GATTS Generic Attribute Profile (GATT) Server
- @{
- @brief Definitions and prototypes for the GATTS interface.
- */
-
-#ifndef BLE_GATTS_H__
-#define BLE_GATTS_H__
-
-#include <stdint.h>
-#include "nrf_svc.h"
-#include "nrf_error.h"
-#include "ble_hci.h"
-#include "ble_ranges.h"
-#include "ble_types.h"
-#include "ble_err.h"
-#include "ble_gatt.h"
-#include "ble_gap.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup BLE_GATTS_ENUMERATIONS Enumerations
- * @{ */
-
-/**
- * @brief GATTS API SVC numbers.
- */
-enum BLE_GATTS_SVCS
-{
- SD_BLE_GATTS_SERVICE_ADD = BLE_GATTS_SVC_BASE, /**< Add a service. */
- SD_BLE_GATTS_INCLUDE_ADD, /**< Add an included service. */
- SD_BLE_GATTS_CHARACTERISTIC_ADD, /**< Add a characteristic. */
- SD_BLE_GATTS_DESCRIPTOR_ADD, /**< Add a generic attribute. */
- SD_BLE_GATTS_VALUE_SET, /**< Set an attribute value. */
- SD_BLE_GATTS_VALUE_GET, /**< Get an attribute value. */
- SD_BLE_GATTS_HVX, /**< Handle Value Notification or Indication. */
- SD_BLE_GATTS_SERVICE_CHANGED, /**< Perform a Service Changed Indication to one or more peers. */
- SD_BLE_GATTS_RW_AUTHORIZE_REPLY, /**< Reply to an authorization request for a read or write operation on one or more attributes. */
- SD_BLE_GATTS_SYS_ATTR_SET, /**< Set the persistent system attributes for a connection. */
- SD_BLE_GATTS_SYS_ATTR_GET, /**< Retrieve the persistent system attributes. */
- SD_BLE_GATTS_INITIAL_USER_HANDLE_GET, /**< Retrieve the first valid user handle. */
- SD_BLE_GATTS_ATTR_GET, /**< Retrieve the UUID and/or metadata of an attribute. */
- SD_BLE_GATTS_EXCHANGE_MTU_REPLY /**< Reply to Exchange MTU Request. */
-};
-
-/**
- * @brief GATT Server Event IDs.
- */
-enum BLE_GATTS_EVTS
-{
- BLE_GATTS_EVT_WRITE = BLE_GATTS_EVT_BASE, /**< Write operation performed. \n See @ref ble_gatts_evt_write_t. */
- BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST, /**< Read/Write Authorization request. \n Reply with @ref sd_ble_gatts_rw_authorize_reply. \n See @ref ble_gatts_evt_rw_authorize_request_t. */
- BLE_GATTS_EVT_SYS_ATTR_MISSING, /**< A persistent system attribute access is pending. \n Respond with @ref sd_ble_gatts_sys_attr_set. \n See @ref ble_gatts_evt_sys_attr_missing_t. */
- BLE_GATTS_EVT_HVC, /**< Handle Value Confirmation. \n See @ref ble_gatts_evt_hvc_t. */
- BLE_GATTS_EVT_SC_CONFIRM, /**< Service Changed Confirmation. \n No additional event structure applies. */
- BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST, /**< Exchange MTU Request. \n Reply with @ref sd_ble_gatts_exchange_mtu_reply. \n See @ref ble_gatts_evt_exchange_mtu_request_t. */
- BLE_GATTS_EVT_TIMEOUT, /**< Peer failed to respond to an ATT request in time. \n See @ref ble_gatts_evt_timeout_t. */
- BLE_GATTS_EVT_HVN_TX_COMPLETE /**< Handle Value Notification transmission complete. \n See @ref ble_gatts_evt_hvn_tx_complete_t. */
-};
-
-/**@brief GATTS Configuration IDs.
- *
- * IDs that uniquely identify a GATTS configuration.
- */
-enum BLE_GATTS_CFGS
-{
- BLE_GATTS_CFG_SERVICE_CHANGED = BLE_GATTS_CFG_BASE, /**< Service changed configuration. */
- BLE_GATTS_CFG_ATTR_TAB_SIZE, /**< Attribute table size configuration. */
-};
-
-/** @} */
-
-/** @addtogroup BLE_GATTS_DEFINES Defines
- * @{ */
-
-/** @defgroup BLE_ERRORS_GATTS SVC return values specific to GATTS
- * @{ */
-#define BLE_ERROR_GATTS_INVALID_ATTR_TYPE (NRF_GATTS_ERR_BASE + 0x000) /**< Invalid attribute type. */
-#define BLE_ERROR_GATTS_SYS_ATTR_MISSING (NRF_GATTS_ERR_BASE + 0x001) /**< System Attributes missing. */
-/** @} */
-
-/** @defgroup BLE_GATTS_ATTR_LENS_MAX Maximum attribute lengths
- * @{ */
-#define BLE_GATTS_FIX_ATTR_LEN_MAX (510) /**< Maximum length for fixed length Attribute Values. */
-#define BLE_GATTS_VAR_ATTR_LEN_MAX (512) /**< Maximum length for variable length Attribute Values. */
-/** @} */
-
-/** @defgroup BLE_GATTS_SRVC_TYPES GATT Server Service Types
- * @{ */
-#define BLE_GATTS_SRVC_TYPE_INVALID 0x00 /**< Invalid Service Type. */
-#define BLE_GATTS_SRVC_TYPE_PRIMARY 0x01 /**< Primary Service. */
-#define BLE_GATTS_SRVC_TYPE_SECONDARY 0x02 /**< Secondary Type. */
-/** @} */
-
-
-/** @defgroup BLE_GATTS_ATTR_TYPES GATT Server Attribute Types
- * @{ */
-#define BLE_GATTS_ATTR_TYPE_INVALID 0x00 /**< Invalid Attribute Type. */
-#define BLE_GATTS_ATTR_TYPE_PRIM_SRVC_DECL 0x01 /**< Primary Service Declaration. */
-#define BLE_GATTS_ATTR_TYPE_SEC_SRVC_DECL 0x02 /**< Secondary Service Declaration. */
-#define BLE_GATTS_ATTR_TYPE_INC_DECL 0x03 /**< Include Declaration. */
-#define BLE_GATTS_ATTR_TYPE_CHAR_DECL 0x04 /**< Characteristic Declaration. */
-#define BLE_GATTS_ATTR_TYPE_CHAR_VAL 0x05 /**< Characteristic Value. */
-#define BLE_GATTS_ATTR_TYPE_DESC 0x06 /**< Descriptor. */
-#define BLE_GATTS_ATTR_TYPE_OTHER 0x07 /**< Other, non-GATT specific type. */
-/** @} */
-
-
-/** @defgroup BLE_GATTS_OPS GATT Server Operations
- * @{ */
-#define BLE_GATTS_OP_INVALID 0x00 /**< Invalid Operation. */
-#define BLE_GATTS_OP_WRITE_REQ 0x01 /**< Write Request. */
-#define BLE_GATTS_OP_WRITE_CMD 0x02 /**< Write Command. */
-#define BLE_GATTS_OP_SIGN_WRITE_CMD 0x03 /**< Signed Write Command. */
-#define BLE_GATTS_OP_PREP_WRITE_REQ 0x04 /**< Prepare Write Request. */
-#define BLE_GATTS_OP_EXEC_WRITE_REQ_CANCEL 0x05 /**< Execute Write Request: Cancel all prepared writes. */
-#define BLE_GATTS_OP_EXEC_WRITE_REQ_NOW 0x06 /**< Execute Write Request: Immediately execute all prepared writes. */
-/** @} */
-
-/** @defgroup BLE_GATTS_VLOCS GATT Value Locations
- * @{ */
-#define BLE_GATTS_VLOC_INVALID 0x00 /**< Invalid Location. */
-#define BLE_GATTS_VLOC_STACK 0x01 /**< Attribute Value is located in stack memory, no user memory is required. */
-#define BLE_GATTS_VLOC_USER 0x02 /**< Attribute Value is located in user memory. This requires the user to maintain a valid buffer through the lifetime of the attribute, since the stack
- will read and write directly to the memory using the pointer provided in the APIs. There are no alignment requirements for the buffer. */
-/** @} */
-
-/** @defgroup BLE_GATTS_AUTHORIZE_TYPES GATT Server Authorization Types
- * @{ */
-#define BLE_GATTS_AUTHORIZE_TYPE_INVALID 0x00 /**< Invalid Type. */
-#define BLE_GATTS_AUTHORIZE_TYPE_READ 0x01 /**< Authorize a Read Operation. */
-#define BLE_GATTS_AUTHORIZE_TYPE_WRITE 0x02 /**< Authorize a Write Request Operation. */
-/** @} */
-
-/** @defgroup BLE_GATTS_SYS_ATTR_FLAGS System Attribute Flags
- * @{ */
-#define BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS (1 << 0) /**< Restrict system attributes to system services only. */
-#define BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS (1 << 1) /**< Restrict system attributes to user services only. */
-/** @} */
-
-/** @defgroup BLE_GATTS_SERVICE_CHANGED Service Changed Inclusion Values
- * @{
- */
-#define BLE_GATTS_SERVICE_CHANGED_DEFAULT (1) /**< Default is to include the Service Changed characteristic in the Attribute Table. */
-/** @} */
-
-/** @defgroup BLE_GATTS_ATTR_TAB_SIZE Attribute Table size
- * @{
- */
-#define BLE_GATTS_ATTR_TAB_SIZE_MIN (248) /**< Minimum Attribute Table size */
-#define BLE_GATTS_ATTR_TAB_SIZE_DEFAULT (1408) /**< Default Attribute Table size. */
-/** @} */
-
-/** @defgroup BLE_GATTS_DEFAULTS GATT Server defaults
- * @{
- */
-#define BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT 1 /**< Default number of Handle Value Notifications that can be queued for transmission. */
-/** @} */
-
-/** @} */
-
-/** @addtogroup BLE_GATTS_STRUCTURES Structures
- * @{ */
-
-/**
- * @brief BLE GATTS connection configuration parameters, set with @ref sd_ble_cfg_set.
- */
-typedef struct
-{
- uint8_t hvn_tx_queue_size; /**< Minimum guaranteed number of Handle Value Notifications that can be queued for transmission.
- The default value is @ref BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT */
-} ble_gatts_conn_cfg_t;
-
-/**@brief Attribute metadata. */
-typedef struct
-{
- ble_gap_conn_sec_mode_t read_perm; /**< Read permissions. */
- ble_gap_conn_sec_mode_t write_perm; /**< Write permissions. */
- uint8_t vlen :1; /**< Variable length attribute. */
- uint8_t vloc :2; /**< Value location, see @ref BLE_GATTS_VLOCS.*/
- uint8_t rd_auth :1; /**< Read authorization and value will be requested from the application on every read operation. */
- uint8_t wr_auth :1; /**< Write authorization will be requested from the application on every Write Request operation (but not Write Command). */
-} ble_gatts_attr_md_t;
-
-
-/**@brief GATT Attribute. */
-typedef struct
-{
- ble_uuid_t const *p_uuid; /**< Pointer to the attribute UUID. */
- ble_gatts_attr_md_t const *p_attr_md; /**< Pointer to the attribute metadata structure. */
- uint16_t init_len; /**< Initial attribute value length in bytes. */
- uint16_t init_offs; /**< Initial attribute value offset in bytes. If different from zero, the first init_offs bytes of the attribute value will be left uninitialized. */
- uint16_t max_len; /**< Maximum attribute value length in bytes, see @ref BLE_GATTS_ATTR_LENS_MAX for maximum values. */
- uint8_t *p_value; /**< Pointer to the attribute data. Please note that if the @ref BLE_GATTS_VLOC_USER value location is selected in the attribute metadata, this will have to point to a buffer
- that remains valid through the lifetime of the attribute. This excludes usage of automatic variables that may go out of scope or any other temporary location.
- The stack may access that memory directly without the application's knowledge. For writable characteristics, this value must not be a location in flash memory.*/
-} ble_gatts_attr_t;
-
-/**@brief GATT Attribute Value. */
-typedef struct
-{
- uint16_t len; /**< Length in bytes to be written or read. Length in bytes written or read after successful return.*/
- uint16_t offset; /**< Attribute value offset. */
- uint8_t *p_value; /**< Pointer to where value is stored or will be stored.
- If value is stored in user memory, only the attribute length is updated when p_value == NULL.
- Set to NULL when reading to obtain the complete length of the attribute value */
-} ble_gatts_value_t;
-
-
-/**@brief GATT Characteristic Presentation Format. */
-typedef struct
-{
- uint8_t format; /**< Format of the value, see @ref BLE_GATT_CPF_FORMATS. */
- int8_t exponent; /**< Exponent for integer data types. */
- uint16_t unit; /**< Unit from Bluetooth Assigned Numbers. */
- uint8_t name_space; /**< Namespace from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES. */
- uint16_t desc; /**< Namespace description from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES. */
-} ble_gatts_char_pf_t;
-
-
-/**@brief GATT Characteristic metadata. */
-typedef struct
-{
- ble_gatt_char_props_t char_props; /**< Characteristic Properties. */
- ble_gatt_char_ext_props_t char_ext_props; /**< Characteristic Extended Properties. */
- uint8_t const *p_char_user_desc; /**< Pointer to a UTF-8 encoded string (non-NULL terminated), NULL if the descriptor is not required. */
- uint16_t char_user_desc_max_size; /**< The maximum size in bytes of the user description descriptor. */
- uint16_t char_user_desc_size; /**< The size of the user description, must be smaller or equal to char_user_desc_max_size. */
- ble_gatts_char_pf_t const *p_char_pf; /**< Pointer to a presentation format structure or NULL if the CPF descriptor is not required. */
- ble_gatts_attr_md_t const *p_user_desc_md; /**< Attribute metadata for the User Description descriptor, or NULL for default values. */
- ble_gatts_attr_md_t const *p_cccd_md; /**< Attribute metadata for the Client Characteristic Configuration Descriptor, or NULL for default values. */
- ble_gatts_attr_md_t const *p_sccd_md; /**< Attribute metadata for the Server Characteristic Configuration Descriptor, or NULL for default values. */
-} ble_gatts_char_md_t;
-
-
-/**@brief GATT Characteristic Definition Handles. */
-typedef struct
-{
- uint16_t value_handle; /**< Handle to the characteristic value. */
- uint16_t user_desc_handle; /**< Handle to the User Description descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present. */
- uint16_t cccd_handle; /**< Handle to the Client Characteristic Configuration Descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present. */
- uint16_t sccd_handle; /**< Handle to the Server Characteristic Configuration Descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present. */
-} ble_gatts_char_handles_t;
-
-
-/**@brief GATT HVx parameters. */
-typedef struct
-{
- uint16_t handle; /**< Characteristic Value Handle. */
- uint8_t type; /**< Indication or Notification, see @ref BLE_GATT_HVX_TYPES. */
- uint16_t offset; /**< Offset within the attribute value. */
- uint16_t *p_len; /**< Length in bytes to be written, length in bytes written after return. */
- uint8_t const *p_data; /**< Actual data content, use NULL to use the current attribute value. */
-} ble_gatts_hvx_params_t;
-
-/**@brief GATT Authorization parameters. */
-typedef struct
-{
- uint16_t gatt_status; /**< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES. */
- uint8_t update : 1; /**< If set, data supplied in p_data will be used to update the attribute value.
- Please note that for @ref BLE_GATTS_AUTHORIZE_TYPE_WRITE operations this bit must always be set,
- as the data to be written needs to be stored and later provided by the application. */
- uint16_t offset; /**< Offset of the attribute value being updated. */
- uint16_t len; /**< Length in bytes of the value in p_data pointer, see @ref BLE_GATTS_ATTR_LENS_MAX. */
- uint8_t const *p_data; /**< Pointer to new value used to update the attribute value. */
-} ble_gatts_authorize_params_t;
-
-/**@brief GATT Read or Write Authorize Reply parameters. */
-typedef struct
-{
- uint8_t type; /**< Type of authorize operation, see @ref BLE_GATTS_AUTHORIZE_TYPES. */
- union {
- ble_gatts_authorize_params_t read; /**< Read authorization parameters. */
- ble_gatts_authorize_params_t write; /**< Write authorization parameters. */
- } params; /**< Reply Parameters. */
-} ble_gatts_rw_authorize_reply_params_t;
-
-/**@brief Service Changed Inclusion configuration parameters, set with @ref sd_ble_cfg_set. */
-typedef struct
-{
- uint8_t service_changed : 1; /**< If 1, include the Service Changed characteristic in the Attribute Table. Default is @ref BLE_GATTS_SERVICE_CHANGED_DEFAULT. */
-} ble_gatts_cfg_service_changed_t;
-
-/**@brief Attribute table size configuration parameters, set with @ref sd_ble_cfg_set.
- *
- * @retval ::NRF_ERROR_INVALID_LENGTH One or more of the following is true:
- * - The specified Attribute Table size is too small.
- * The minimum acceptable size is defined by @ref BLE_GATTS_ATTR_TAB_SIZE_MIN.
- * - The specified Attribute Table size is not a multiple of 4.
- */
-typedef struct
-{
- uint32_t attr_tab_size; /**< Attribute table size. Default is @ref BLE_GATTS_ATTR_TAB_SIZE_DEFAULT, minimum is @ref BLE_GATTS_ATTR_TAB_SIZE_MIN. */
-} ble_gatts_cfg_attr_tab_size_t;
-
-/**@brief Config structure for GATTS configurations. */
-typedef union
-{
- ble_gatts_cfg_service_changed_t service_changed; /**< Include service changed characteristic, cfg_id is @ref BLE_GATTS_CFG_SERVICE_CHANGED. */
- ble_gatts_cfg_attr_tab_size_t attr_tab_size; /**< Attribute table size, cfg_id is @ref BLE_GATTS_CFG_ATTR_TAB_SIZE. */
-} ble_gatts_cfg_t;
-
-
-/**@brief Event structure for @ref BLE_GATTS_EVT_WRITE. */
-typedef struct
-{
- uint16_t handle; /**< Attribute Handle. */
- ble_uuid_t uuid; /**< Attribute UUID. */
- uint8_t op; /**< Type of write operation, see @ref BLE_GATTS_OPS. */
- uint8_t auth_required; /**< Writing operation deferred due to authorization requirement. Application may use @ref sd_ble_gatts_value_set to finalize the writing operation. */
- uint16_t offset; /**< Offset for the write operation. */
- uint16_t len; /**< Length of the received data. */
- uint8_t data[1]; /**< Received data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
- See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
-} ble_gatts_evt_write_t;
-
-/**@brief Event substructure for authorized read requests, see @ref ble_gatts_evt_rw_authorize_request_t. */
-typedef struct
-{
- uint16_t handle; /**< Attribute Handle. */
- ble_uuid_t uuid; /**< Attribute UUID. */
- uint16_t offset; /**< Offset for the read operation. */
-} ble_gatts_evt_read_t;
-
-/**@brief Event structure for @ref BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST. */
-typedef struct
-{
- uint8_t type; /**< Type of authorize operation, see @ref BLE_GATTS_AUTHORIZE_TYPES. */
- union {
- ble_gatts_evt_read_t read; /**< Attribute Read Parameters. */
- ble_gatts_evt_write_t write; /**< Attribute Write Parameters. */
- } request; /**< Request Parameters. */
-} ble_gatts_evt_rw_authorize_request_t;
-
-/**@brief Event structure for @ref BLE_GATTS_EVT_SYS_ATTR_MISSING. */
-typedef struct
-{
- uint8_t hint; /**< Hint (currently unused). */
-} ble_gatts_evt_sys_attr_missing_t;
-
-
-/**@brief Event structure for @ref BLE_GATTS_EVT_HVC. */
-typedef struct
-{
- uint16_t handle; /**< Attribute Handle. */
-} ble_gatts_evt_hvc_t;
-
-/**@brief Event structure for @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST. */
-typedef struct
-{
- uint16_t client_rx_mtu; /**< Client RX MTU size. */
-} ble_gatts_evt_exchange_mtu_request_t;
-
-/**@brief Event structure for @ref BLE_GATTS_EVT_TIMEOUT. */
-typedef struct
-{
- uint8_t src; /**< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES. */
-} ble_gatts_evt_timeout_t;
-
-/**@brief Event structure for @ref BLE_GATTS_EVT_HVN_TX_COMPLETE. */
-typedef struct
-{
- uint8_t count; /**< Number of notification transmissions completed. */
-} ble_gatts_evt_hvn_tx_complete_t;
-
-/**@brief GATTS event structure. */
-typedef struct
-{
- uint16_t conn_handle; /**< Connection Handle on which the event occurred. */
- union
- {
- ble_gatts_evt_write_t write; /**< Write Event Parameters. */
- ble_gatts_evt_rw_authorize_request_t authorize_request; /**< Read or Write Authorize Request Parameters. */
- ble_gatts_evt_sys_attr_missing_t sys_attr_missing; /**< System attributes missing. */
- ble_gatts_evt_hvc_t hvc; /**< Handle Value Confirmation Event Parameters. */
- ble_gatts_evt_exchange_mtu_request_t exchange_mtu_request; /**< Exchange MTU Request Event Parameters. */
- ble_gatts_evt_timeout_t timeout; /**< Timeout Event. */
- ble_gatts_evt_hvn_tx_complete_t hvn_tx_complete; /**< Handle Value Notification transmission complete Event Parameters. */
- } params; /**< Event Parameters. */
-} ble_gatts_evt_t;
-
-/** @} */
-
-/** @addtogroup BLE_GATTS_FUNCTIONS Functions
- * @{ */
-
-/**@brief Add a service declaration to the Attribute Table.
- *
- * @note Secondary Services are only relevant in the context of the entity that references them, it is therefore forbidden to
- * add a secondary service declaration that is not referenced by another service later in the Attribute Table.
- *
- * @mscs
- * @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC}
- * @endmscs
- *
- * @param[in] type Toggles between primary and secondary services, see @ref BLE_GATTS_SRVC_TYPES.
- * @param[in] p_uuid Pointer to service UUID.
- * @param[out] p_handle Pointer to a 16-bit word where the assigned handle will be stored.
- *
- * @retval ::NRF_SUCCESS Successfully added a service declaration.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, Vendor Specific UUIDs need to be present in the table.
- * @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack.
- * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation.
- */
-SVCALL(SD_BLE_GATTS_SERVICE_ADD, uint32_t, sd_ble_gatts_service_add(uint8_t type, ble_uuid_t const *p_uuid, uint16_t *p_handle));
-
-
-/**@brief Add an include declaration to the Attribute Table.
- *
- * @note It is currently only possible to add an include declaration to the last added service (i.e. only sequential population is supported at this time).
- *
- * @note The included service must already be present in the Attribute Table prior to this call.
- *
- * @mscs
- * @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC}
- * @endmscs
- *
- * @param[in] service_handle Handle of the service where the included service is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially.
- * @param[in] inc_srvc_handle Handle of the included service.
- * @param[out] p_include_handle Pointer to a 16-bit word where the assigned handle will be stored.
- *
- * @retval ::NRF_SUCCESS Successfully added an include declaration.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, handle values need to match previously added services.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a service context is required.
- * @retval ::NRF_ERROR_NOT_SUPPORTED Feature is not supported, service_handle must be that of the last added service.
- * @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, self inclusions are not allowed.
- * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation.
- * @retval ::NRF_ERROR_NOT_FOUND Attribute not found.
- */
-SVCALL(SD_BLE_GATTS_INCLUDE_ADD, uint32_t, sd_ble_gatts_include_add(uint16_t service_handle, uint16_t inc_srvc_handle, uint16_t *p_include_handle));
-
-
-/**@brief Add a characteristic declaration, a characteristic value declaration and optional characteristic descriptor declarations to the Attribute Table.
- *
- * @note It is currently only possible to add a characteristic to the last added service (i.e. only sequential population is supported at this time).
- *
- * @note Several restrictions apply to the parameters, such as matching permissions between the user description descriptor and the writable auxiliaries bits,
- * readable (no security) and writable (selectable) CCCDs and SCCDs and valid presentation format values.
- *
- * @note If no metadata is provided for the optional descriptors, their permissions will be derived from the characteristic permissions.
- *
- * @mscs
- * @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC}
- * @endmscs
- *
- * @param[in] service_handle Handle of the service where the characteristic is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially.
- * @param[in] p_char_md Characteristic metadata.
- * @param[in] p_attr_char_value Pointer to the attribute structure corresponding to the characteristic value.
- * @param[out] p_handles Pointer to the structure where the assigned handles will be stored.
- *
- * @retval ::NRF_SUCCESS Successfully added a characteristic.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, service handle, Vendor Specific UUIDs, lengths, and permissions need to adhere to the constraints.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a service context is required.
- * @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack.
- * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation.
- * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX.
- */
-SVCALL(SD_BLE_GATTS_CHARACTERISTIC_ADD, uint32_t, sd_ble_gatts_characteristic_add(uint16_t service_handle, ble_gatts_char_md_t const *p_char_md, ble_gatts_attr_t const *p_attr_char_value, ble_gatts_char_handles_t *p_handles));
-
-
-/**@brief Add a descriptor to the Attribute Table.
- *
- * @note It is currently only possible to add a descriptor to the last added characteristic (i.e. only sequential population is supported at this time).
- *
- * @mscs
- * @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC}
- * @endmscs
- *
- * @param[in] char_handle Handle of the characteristic where the descriptor is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially.
- * @param[in] p_attr Pointer to the attribute structure.
- * @param[out] p_handle Pointer to a 16-bit word where the assigned handle will be stored.
- *
- * @retval ::NRF_SUCCESS Successfully added a descriptor.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, characteristic handle, Vendor Specific UUIDs, lengths, and permissions need to adhere to the constraints.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a characteristic context is required.
- * @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack.
- * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation.
- * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX.
- */
-SVCALL(SD_BLE_GATTS_DESCRIPTOR_ADD, uint32_t, sd_ble_gatts_descriptor_add(uint16_t char_handle, ble_gatts_attr_t const *p_attr, uint16_t *p_handle));
-
-/**@brief Set the value of a given attribute.
- *
- * @note Values other than system attributes can be set at any time, regardless of whether any active connections exist.
- *
- * @mscs
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC}
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle. Ignored if the value does not belong to a system attribute.
- * @param[in] handle Attribute handle.
- * @param[in,out] p_value Attribute value information.
- *
- * @retval ::NRF_SUCCESS Successfully set the value of the attribute.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_NOT_FOUND Attribute not found.
- * @retval ::NRF_ERROR_FORBIDDEN Forbidden handle supplied, certain attributes are not modifiable by the application.
- * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied on a system attribute.
- */
-SVCALL(SD_BLE_GATTS_VALUE_SET, uint32_t, sd_ble_gatts_value_set(uint16_t conn_handle, uint16_t handle, ble_gatts_value_t *p_value));
-
-/**@brief Get the value of a given attribute.
- *
- * @note If the attribute value is longer than the size of the supplied buffer,
- * @ref ble_gatts_value_t::len will return the total attribute value length (excluding offset),
- * and not the number of bytes actually returned in @ref ble_gatts_value_t::p_value.
- * The application may use this information to allocate a suitable buffer size.
- *
- * @note When retrieving system attribute values with this function, the connection handle
- * may refer to an already disconnected connection. Refer to the documentation of
- * @ref sd_ble_gatts_sys_attr_get for further information.
- *
- * @param[in] conn_handle Connection handle. Ignored if the value does not belong to a system attribute.
- * @param[in] handle Attribute handle.
- * @param[in,out] p_value Attribute value information.
- *
- * @retval ::NRF_SUCCESS Successfully retrieved the value of the attribute.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_NOT_FOUND Attribute not found.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid attribute offset supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied on a system attribute.
- * @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value.
- */
-SVCALL(SD_BLE_GATTS_VALUE_GET, uint32_t, sd_ble_gatts_value_get(uint16_t conn_handle, uint16_t handle, ble_gatts_value_t *p_value));
-
-/**@brief Notify or Indicate an attribute value.
- *
- * @details This function checks for the relevant Client Characteristic Configuration descriptor value to verify that the relevant operation
- * (notification or indication) has been enabled by the client. It is also able to update the attribute value before issuing the PDU, so that
- * the application can atomically perform a value update and a server initiated transaction with a single API call.
- *
- * @note The local attribute value may be updated even if an outgoing packet is not sent to the peer due to an error during execution.
- * The Attribute Table has been updated if one of the following error codes is returned: @ref NRF_ERROR_INVALID_STATE, @ref NRF_ERROR_BUSY,
- * @ref NRF_ERROR_FORBIDDEN, @ref BLE_ERROR_GATTS_SYS_ATTR_MISSING and @ref NRF_ERROR_RESOURCES.
- * The caller can check whether the value has been updated by looking at the contents of *(@ref ble_gatts_hvx_params_t::p_len).
- *
- * @note Only one indication procedure can be ongoing per connection at a time.
- * If the application tries to indicate an attribute value while another indication procedure is ongoing,
- * the function call will return @ref NRF_ERROR_BUSY.
- * A @ref BLE_GATTS_EVT_HVC event will be issued as soon as the confirmation arrives from the peer.
- *
- * @note The number of Handle Value Notifications that can be queued is configured by @ref ble_gatts_conn_cfg_t::hvn_tx_queue_size
- * When the queue is full, the function call will return @ref NRF_ERROR_RESOURCES.
- * A @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event will be issued as soon as the transmission of the notification is complete.
- *
- * @note The application can keep track of the available queue element count for notifications by following the procedure below:
- * - Store initial queue element count in a variable.
- * - Decrement the variable, which stores the currently available queue element count, by one when a call to this function returns @ref NRF_SUCCESS.
- * - Increment the variable, which stores the current available queue element count, by the count variable in @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event.
- *
- * @events
- * @event{@ref BLE_GATTS_EVT_HVN_TX_COMPLETE, Notification transmission complete.}
- * @event{@ref BLE_GATTS_EVT_HVC, Confirmation received from the peer.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GATTS_HVX_SYS_ATTRS_MISSING_MSC}
- * @mmsc{@ref BLE_GATTS_HVN_MSC}
- * @mmsc{@ref BLE_GATTS_HVI_MSC}
- * @mmsc{@ref BLE_GATTS_HVX_DISABLED_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in,out] p_hvx_params Pointer to an HVx parameters structure. If @ref ble_gatts_hvx_params_t::p_data
- * contains a non-NULL pointer the attribute value will be updated with the contents
- * pointed by it before sending the notification or indication. If the attribute value
- * is updated, @ref ble_gatts_hvx_params_t::p_len is updated by the SoftDevice to
- * contain the number of actual bytes written, else it will be set to 0.
- *
- * @retval ::NRF_SUCCESS Successfully queued a notification or indication for transmission, and optionally updated the attribute value.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE One or more of the following is true:
- * - Invalid Connection State
- * - Notifications and/or indications not enabled in the CCCD
- * - An ATT_MTU exchange is ongoing
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle(s) supplied. Only attributes added directly by the application are available to notify and indicate.
- * @retval ::BLE_ERROR_GATTS_INVALID_ATTR_TYPE Invalid attribute type(s) supplied, only characteristic values may be notified and indicated.
- * @retval ::NRF_ERROR_NOT_FOUND Attribute not found.
- * @retval ::NRF_ERROR_FORBIDDEN The connection's current security level is lower than the one required by the write permissions of the CCCD associated with this characteristic.
- * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied.
- * @retval ::NRF_ERROR_BUSY For @ref BLE_GATT_HVX_INDICATION Procedure already in progress. Wait for a @ref BLE_GATTS_EVT_HVC event and retry.
- * @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value.
- * @retval ::NRF_ERROR_RESOURCES Too many notifications queued.
- * Wait for a @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event and retry.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTS_HVX, uint32_t, sd_ble_gatts_hvx(uint16_t conn_handle, ble_gatts_hvx_params_t const *p_hvx_params));
-
-/**@brief Indicate the Service Changed attribute value.
- *
- * @details This call will send a Handle Value Indication to one or more peers connected to inform them that the Attribute
- * Table layout has changed. As soon as the peer has confirmed the indication, a @ref BLE_GATTS_EVT_SC_CONFIRM event will
- * be issued.
- *
- * @note Some of the restrictions and limitations that apply to @ref sd_ble_gatts_hvx also apply here.
- *
- * @events
- * @event{@ref BLE_GATTS_EVT_SC_CONFIRM, Confirmation of attribute table change received from peer.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_GATTS_SC_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] start_handle Start of affected attribute handle range.
- * @param[in] end_handle End of affected attribute handle range.
- *
- * @retval ::NRF_SUCCESS Successfully queued the Service Changed indication for transmission.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_NOT_SUPPORTED Service Changed not enabled at initialization. See @ref
- * sd_ble_cfg_set and @ref ble_gatts_cfg_service_changed_t.
- * @retval ::NRF_ERROR_INVALID_STATE One or more of the following is true:
- * - Invalid Connection State
- * - Notifications and/or indications not enabled in the CCCD
- * - An ATT_MTU exchange is ongoing
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle(s) supplied, handles must be in the range populated by the application.
- * @retval ::NRF_ERROR_BUSY Procedure already in progress.
- * @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTS_SERVICE_CHANGED, uint32_t, sd_ble_gatts_service_changed(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle));
-
-/**@brief Respond to a Read/Write authorization request.
- *
- * @note This call should only be used as a response to a @ref BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event issued to the application.
- *
- * @mscs
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC}
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC}
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC}
- * @mmsc{@ref BLE_GATTS_READ_REQ_AUTH_MSC}
- * @mmsc{@ref BLE_GATTS_WRITE_REQ_AUTH_MSC}
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC}
- * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] p_rw_authorize_reply_params Pointer to a structure with the attribute provided by the application.
- *
- * @note @ref ble_gatts_authorize_params_t::p_data is ignored when this function is used to respond
- * to a @ref BLE_GATTS_AUTHORIZE_TYPE_READ event if @ref ble_gatts_authorize_params_t::update
- * is set to 0.
- *
- * @retval ::NRF_SUCCESS Successfully queued a response to the peer, and in the case of a write operation, Attribute Table updated.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no authorization request pending.
- * @retval ::NRF_ERROR_INVALID_PARAM Authorization op invalid,
- * handle supplied does not match requested handle,
- * or invalid data to be written provided by the application.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTS_RW_AUTHORIZE_REPLY, uint32_t, sd_ble_gatts_rw_authorize_reply(uint16_t conn_handle, ble_gatts_rw_authorize_reply_params_t const *p_rw_authorize_reply_params));
-
-
-/**@brief Update persistent system attribute information.
- *
- * @details Supply information about persistent system attributes to the stack,
- * previously obtained using @ref sd_ble_gatts_sys_attr_get.
- * This call is only allowed for active connections, and is usually
- * made immediately after a connection is established with an known bonded device,
- * often as a response to a @ref BLE_GATTS_EVT_SYS_ATTR_MISSING.
- *
- * p_sysattrs may point directly to the application's stored copy of the system attributes
- * obtained using @ref sd_ble_gatts_sys_attr_get.
- * If the pointer is NULL, the system attribute info is initialized, assuming that
- * the application does not have any previously saved system attribute data for this device.
- *
- * @note The state of persistent system attributes is reset upon connection establishment and then remembered for its duration.
- *
- * @note If this call returns with an error code different from @ref NRF_SUCCESS, the storage of persistent system attributes may have been completed only partially.
- * This means that the state of the attribute table is undefined, and the application should either provide a new set of attributes using this same call or
- * reset the SoftDevice to return to a known state.
- *
- * @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be modified.
- * @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be modified.
- *
- * @mscs
- * @mmsc{@ref BLE_GATTS_HVX_SYS_ATTRS_MISSING_MSC}
- * @mmsc{@ref BLE_GATTS_SYS_ATTRS_UNK_PEER_MSC}
- * @mmsc{@ref BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle.
- * @param[in] p_sys_attr_data Pointer to a saved copy of system attributes supplied to the stack, or NULL.
- * @param[in] len Size of data pointed by p_sys_attr_data, in octets.
- * @param[in] flags Optional additional flags, see @ref BLE_GATTS_SYS_ATTR_FLAGS
- *
- * @retval ::NRF_SUCCESS Successfully set the system attribute information.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid flags supplied.
- * @retval ::NRF_ERROR_INVALID_DATA Invalid data supplied, the data should be exactly the same as retrieved with @ref sd_ble_gatts_sys_attr_get.
- * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation.
- */
-SVCALL(SD_BLE_GATTS_SYS_ATTR_SET, uint32_t, sd_ble_gatts_sys_attr_set(uint16_t conn_handle, uint8_t const *p_sys_attr_data, uint16_t len, uint32_t flags));
-
-
-/**@brief Retrieve persistent system attribute information from the stack.
- *
- * @details This call is used to retrieve information about values to be stored persistently by the application
- * during the lifetime of a connection or after it has been terminated. When a new connection is established with the same bonded device,
- * the system attribute information retrieved with this function should be restored using using @ref sd_ble_gatts_sys_attr_set.
- * If retrieved after disconnection, the data should be read before a new connection established. The connection handle for
- * the previous, now disconnected, connection will remain valid until a new one is created to allow this API call to refer to it.
- * Connection handles belonging to active connections can be used as well, but care should be taken since the system attributes
- * may be written to at any time by the peer during a connection's lifetime.
- *
- * @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be returned.
- * @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be returned.
- *
- * @mscs
- * @mmsc{@ref BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection handle of the recently terminated connection.
- * @param[out] p_sys_attr_data Pointer to a buffer where updated information about system attributes will be filled in. The format of the data is described
- * in @ref BLE_GATTS_SYS_ATTRS_FORMAT. NULL can be provided to obtain the length of the data.
- * @param[in,out] p_len Size of application buffer if p_sys_attr_data is not NULL. Unconditionally updated to actual length of system attribute data.
- * @param[in] flags Optional additional flags, see @ref BLE_GATTS_SYS_ATTR_FLAGS
- *
- * @retval ::NRF_SUCCESS Successfully retrieved the system attribute information.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid flags supplied.
- * @retval ::NRF_ERROR_DATA_SIZE The system attribute information did not fit into the provided buffer.
- * @retval ::NRF_ERROR_NOT_FOUND No system attributes found.
- */
-SVCALL(SD_BLE_GATTS_SYS_ATTR_GET, uint32_t, sd_ble_gatts_sys_attr_get(uint16_t conn_handle, uint8_t *p_sys_attr_data, uint16_t *p_len, uint32_t flags));
-
-
-/**@brief Retrieve the first valid user attribute handle.
- *
- * @param[out] p_handle Pointer to an integer where the handle will be stored.
- *
- * @retval ::NRF_SUCCESS Successfully retrieved the handle.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- */
-SVCALL(SD_BLE_GATTS_INITIAL_USER_HANDLE_GET, uint32_t, sd_ble_gatts_initial_user_handle_get(uint16_t *p_handle));
-
-/**@brief Retrieve the attribute UUID and/or metadata.
- *
- * @param[in] handle Attribute handle
- * @param[out] p_uuid UUID of the attribute. Use NULL to omit this field.
- * @param[out] p_md Metadata of the attribute. Use NULL to omit this field.
- *
- * @retval ::NRF_SUCCESS Successfully retrieved the attribute metadata,
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameters supplied. Returned when both @c p_uuid and @c p_md are NULL.
- * @retval ::NRF_ERROR_NOT_FOUND Attribute was not found.
- */
-SVCALL(SD_BLE_GATTS_ATTR_GET, uint32_t, sd_ble_gatts_attr_get(uint16_t handle, ble_uuid_t * p_uuid, ble_gatts_attr_md_t * p_md));
-
-/**@brief Reply to an ATT_MTU exchange request by sending an Exchange MTU Response to the client.
- *
- * @details This function is only used to reply to a @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST event.
- *
- * @details The SoftDevice sets ATT_MTU to the minimum of:
- * - The Client RX MTU value from @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST, and
- * - The Server RX MTU value.
- *
- * However, the SoftDevice never sets ATT_MTU lower than @ref BLE_GATT_ATT_MTU_DEFAULT.
- *
- * @mscs
- * @mmsc{@ref BLE_GATTS_MTU_EXCHANGE}
- * @endmscs
- *
- * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
- * @param[in] server_rx_mtu Server RX MTU size.
- * - The minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT.
- * - The maximum value is @ref ble_gatt_conn_cfg_t::att_mtu in the connection configuration
- * used for this connection.
- * - The value must be equal to Client RX MTU size given in @ref sd_ble_gattc_exchange_mtu_request
- * if an ATT_MTU exchange has already been performed in the other direction.
- *
- * @retval ::NRF_SUCCESS Successfully sent response to the client.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no ATT_MTU exchange request pending.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid Server RX MTU size supplied.
- * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection.
- */
-SVCALL(SD_BLE_GATTS_EXCHANGE_MTU_REPLY, uint32_t, sd_ble_gatts_exchange_mtu_reply(uint16_t conn_handle, uint16_t server_rx_mtu));
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-#endif // BLE_GATTS_H__
-
-/**
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_hci.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_hci.h
deleted file mode 100755
index f0dde9a0..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_hci.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2012 - 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, 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.
- */
-
-/**
- @addtogroup BLE_COMMON
- @{
-*/
-
-
-#ifndef BLE_HCI_H__
-#define BLE_HCI_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @defgroup BLE_HCI_STATUS_CODES Bluetooth status codes
- * @{ */
-
-#define BLE_HCI_STATUS_CODE_SUCCESS 0x00 /**< Success. */
-#define BLE_HCI_STATUS_CODE_UNKNOWN_BTLE_COMMAND 0x01 /**< Unknown BLE Command. */
-#define BLE_HCI_STATUS_CODE_UNKNOWN_CONNECTION_IDENTIFIER 0x02 /**< Unknown Connection Identifier. */
-/*0x03 Hardware Failure
-0x04 Page Timeout
-*/
-#define BLE_HCI_AUTHENTICATION_FAILURE 0x05 /**< Authentication Failure. */
-#define BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING 0x06 /**< Pin or Key missing. */
-#define BLE_HCI_MEMORY_CAPACITY_EXCEEDED 0x07 /**< Memory Capacity Exceeded. */
-#define BLE_HCI_CONNECTION_TIMEOUT 0x08 /**< Connection Timeout. */
-/*0x09 Connection Limit Exceeded
-0x0A Synchronous Connection Limit To A Device Exceeded
-0x0B ACL Connection Already Exists*/
-#define BLE_HCI_STATUS_CODE_COMMAND_DISALLOWED 0x0C /**< Command Disallowed. */
-/*0x0D Connection Rejected due to Limited Resources
-0x0E Connection Rejected Due To Security Reasons
-0x0F Connection Rejected due to Unacceptable BD_ADDR
-0x10 Connection Accept Timeout Exceeded
-0x11 Unsupported Feature or Parameter Value*/
-#define BLE_HCI_STATUS_CODE_INVALID_BTLE_COMMAND_PARAMETERS 0x12 /**< Invalid BLE Command Parameters. */
-#define BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION 0x13 /**< Remote User Terminated Connection. */
-#define BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES 0x14 /**< Remote Device Terminated Connection due to low resources.*/
-#define BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF 0x15 /**< Remote Device Terminated Connection due to power off. */
-#define BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION 0x16 /**< Local Host Terminated Connection. */
-/*
-0x17 Repeated Attempts
-0x18 Pairing Not Allowed
-0x19 Unknown LMP PDU
-*/
-#define BLE_HCI_UNSUPPORTED_REMOTE_FEATURE 0x1A /**< Unsupported Remote Feature. */
-/*
-0x1B SCO Offset Rejected
-0x1C SCO Interval Rejected
-0x1D SCO Air Mode Rejected*/
-#define BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS 0x1E /**< Invalid LMP Parameters. */
-#define BLE_HCI_STATUS_CODE_UNSPECIFIED_ERROR 0x1F /**< Unspecified Error. */
-/*0x20 Unsupported LMP Parameter Value
-0x21 Role Change Not Allowed
-*/
-#define BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT 0x22 /**< LMP Response Timeout. */
-#define BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION 0x23 /**< LMP Error Transaction Collision/LL Procedure Collision. */
-#define BLE_HCI_STATUS_CODE_LMP_PDU_NOT_ALLOWED 0x24 /**< LMP PDU Not Allowed. */
-/*0x25 Encryption Mode Not Acceptable
-0x26 Link Key Can Not be Changed
-0x27 Requested QoS Not Supported
-*/
-#define BLE_HCI_INSTANT_PASSED 0x28 /**< Instant Passed. */
-#define BLE_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED 0x29 /**< Pairing with Unit Key Unsupported. */
-#define BLE_HCI_DIFFERENT_TRANSACTION_COLLISION 0x2A /**< Different Transaction Collision. */
-/*
-0x2B Reserved
-0x2C QoS Unacceptable Parameter
-0x2D QoS Rejected
-0x2E Channel Classification Not Supported
-0x2F Insufficient Security
-*/
-#define BLE_HCI_PARAMETER_OUT_OF_MANDATORY_RANGE 0x30 /**< Parameter Out Of Mandatory Range. */
-/*
-0x31 Reserved
-0x32 Role Switch Pending
-0x33 Reserved
-0x34 Reserved Slot Violation
-0x35 Role Switch Failed
-0x36 Extended Inquiry Response Too Large
-0x37 Secure Simple Pairing Not Supported By Host.
-0x38 Host Busy - Pairing
-0x39 Connection Rejected due to No Suitable Channel Found*/
-#define BLE_HCI_CONTROLLER_BUSY 0x3A /**< Controller Busy. */
-#define BLE_HCI_CONN_INTERVAL_UNACCEPTABLE 0x3B /**< Connection Interval Unacceptable. */
-#define BLE_HCI_DIRECTED_ADVERTISER_TIMEOUT 0x3C /**< Directed Advertisement Timeout. */
-#define BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE 0x3D /**< Connection Terminated due to MIC Failure. */
-#define BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED 0x3E /**< Connection Failed to be Established. */
-
-/** @} */
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif // BLE_HCI_H__
-
-/** @} */
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_l2cap.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_l2cap.h
deleted file mode 100755
index edaf6641..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_l2cap.h
+++ /dev/null
@@ -1,506 +0,0 @@
-/*
- * Copyright (c) 2011 - 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.
- */
-
-/**
- @addtogroup BLE_L2CAP Logical Link Control and Adaptation Protocol (L2CAP)
- @{
- @brief Definitions and prototypes for the L2CAP interface.
- */
-
-#ifndef BLE_L2CAP_H__
-#define BLE_L2CAP_H__
-
-#include <stdint.h>
-#include "nrf_svc.h"
-#include "nrf_error.h"
-#include "ble_ranges.h"
-#include "ble_types.h"
-#include "ble_err.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@addtogroup BLE_L2CAP_TERMINOLOGY Terminology
- * @{
- * @details
- *
- * L2CAP SDU
- * - A data unit that the application can send/receive to/from a peer.
- *
- * L2CAP PDU
- * - A data unit that is exchanged between local and remote L2CAP entities.
- * It consists of L2CAP protocol control information and payload fields.
- * The payload field can contain an L2CAP SDU or a part of an L2CAP SDU.
- *
- * L2CAP MTU
- * - The maximum length of an L2CAP SDU.
- *
- * L2CAP MPS
- * - The maximum length of an L2CAP PDU payload field.
- *
- * Credits
- * - A value indicating the number of L2CAP PDUs that the receiver of the credit can send to the peer.
- * @} */
-
-/**@addtogroup BLE_L2CAP_ENUMERATIONS Enumerations
- * @{ */
-
-/**@brief L2CAP API SVC numbers. */
-enum BLE_L2CAP_SVCS
-{
- SD_BLE_L2CAP_CH_SETUP = BLE_L2CAP_SVC_BASE + 0, /**< Set up an L2CAP channel. */
- SD_BLE_L2CAP_CH_RELEASE = BLE_L2CAP_SVC_BASE + 1, /**< Release an L2CAP channel. */
- SD_BLE_L2CAP_CH_RX = BLE_L2CAP_SVC_BASE + 2, /**< Receive an SDU on an L2CAP channel. */
- SD_BLE_L2CAP_CH_TX = BLE_L2CAP_SVC_BASE + 3, /**< Transmit an SDU on an L2CAP channel. */
- SD_BLE_L2CAP_CH_FLOW_CONTROL = BLE_L2CAP_SVC_BASE + 4, /**< Advanced SDU reception flow control. */
-};
-
-/**@brief L2CAP Event IDs. */
-enum BLE_L2CAP_EVTS
-{
- BLE_L2CAP_EVT_CH_SETUP_REQUEST = BLE_L2CAP_EVT_BASE + 0, /**< L2CAP Channel Setup Request event.
- \n See @ref ble_l2cap_evt_ch_setup_request_t. */
- BLE_L2CAP_EVT_CH_SETUP_REFUSED = BLE_L2CAP_EVT_BASE + 1, /**< L2CAP Channel Setup Refused event.
- \n See @ref ble_l2cap_evt_ch_setup_refused_t. */
- BLE_L2CAP_EVT_CH_SETUP = BLE_L2CAP_EVT_BASE + 2, /**< L2CAP Channel Setup Completed event.
- \n See @ref ble_l2cap_evt_ch_setup_t. */
- BLE_L2CAP_EVT_CH_RELEASED = BLE_L2CAP_EVT_BASE + 3, /**< L2CAP Channel Released event.
- \n No additional event structure applies. */
- BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED = BLE_L2CAP_EVT_BASE + 4, /**< L2CAP Channel SDU data buffer released event.
- \n See @ref ble_l2cap_evt_ch_sdu_buf_released_t. */
- BLE_L2CAP_EVT_CH_CREDIT = BLE_L2CAP_EVT_BASE + 5, /**< L2CAP Channel Credit received.
- \n See @ref ble_l2cap_evt_ch_credit_t. */
- BLE_L2CAP_EVT_CH_RX = BLE_L2CAP_EVT_BASE + 6, /**< L2CAP Channel SDU received.
- \n See @ref ble_l2cap_evt_ch_rx_t. */
- BLE_L2CAP_EVT_CH_TX = BLE_L2CAP_EVT_BASE + 7, /**< L2CAP Channel SDU transmitted.
- \n See @ref ble_l2cap_evt_ch_tx_t. */
-};
-
-/** @} */
-
-/**@addtogroup BLE_L2CAP_DEFINES Defines
- * @{ */
-
-/**@brief Maximum number of L2CAP channels per connection. */
-#define BLE_L2CAP_CH_COUNT_MAX (64)
-
-/**@brief Minimum L2CAP MTU, in bytes. */
-#define BLE_L2CAP_MTU_MIN (23)
-
-/**@brief Minimum L2CAP MPS, in bytes. */
-#define BLE_L2CAP_MPS_MIN (23)
-
-/**@brief Invalid CID. */
-#define BLE_L2CAP_CID_INVALID (0x0000)
-
-/**@brief Default number of credits for @ref sd_ble_l2cap_ch_flow_control. */
-#define BLE_L2CAP_CREDITS_DEFAULT (1)
-
-/**@defgroup BLE_L2CAP_CH_SETUP_REFUSED_SRCS L2CAP channel setup refused sources
- * @{ */
-#define BLE_L2CAP_CH_SETUP_REFUSED_SRC_LOCAL (0x01) /**< Local. */
-#define BLE_L2CAP_CH_SETUP_REFUSED_SRC_REMOTE (0x02) /**< Remote. */
- /** @} */
-
- /** @defgroup BLE_L2CAP_CH_STATUS_CODES L2CAP channel status codes
- * @{ */
-#define BLE_L2CAP_CH_STATUS_CODE_SUCCESS (0x0000) /**< Success. */
-#define BLE_L2CAP_CH_STATUS_CODE_LE_PSM_NOT_SUPPORTED (0x0002) /**< LE_PSM not supported. */
-#define BLE_L2CAP_CH_STATUS_CODE_NO_RESOURCES (0x0004) /**< No resources available. */
-#define BLE_L2CAP_CH_STATUS_CODE_INSUFF_AUTHENTICATION (0x0005) /**< Insufficient authentication. */
-#define BLE_L2CAP_CH_STATUS_CODE_INSUFF_AUTHORIZATION (0x0006) /**< Insufficient authorization. */
-#define BLE_L2CAP_CH_STATUS_CODE_INSUFF_ENC_KEY_SIZE (0x0007) /**< Insufficient encryption key size. */
-#define BLE_L2CAP_CH_STATUS_CODE_INSUFF_ENC (0x0008) /**< Insufficient encryption. */
-#define BLE_L2CAP_CH_STATUS_CODE_INVALID_SCID (0x0009) /**< Invalid Source CID. */
-#define BLE_L2CAP_CH_STATUS_CODE_SCID_ALLOCATED (0x000A) /**< Source CID already allocated. */
-#define BLE_L2CAP_CH_STATUS_CODE_UNACCEPTABLE_PARAMS (0x000B) /**< Unacceptable parameters. */
-#define BLE_L2CAP_CH_STATUS_CODE_NOT_UNDERSTOOD (0x8000) /**< Command Reject received instead of LE Credit Based Connection Response. */
-#define BLE_L2CAP_CH_STATUS_CODE_TIMEOUT (0xC000) /**< Operation timed out. */
-/** @} */
-
-/** @} */
-
-/**@addtogroup BLE_L2CAP_STRUCTURES Structures
- * @{ */
-
-/**
- * @brief BLE L2CAP connection configuration parameters, set with @ref sd_ble_cfg_set.
- *
- * @note These parameters are set per connection, so all L2CAP channels created on this connection
- * will have the same parameters.
- *
- * @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true:
- * - rx_mps is smaller than @ref BLE_L2CAP_MPS_MIN.
- * - tx_mps is smaller than @ref BLE_L2CAP_MPS_MIN.
- * - ch_count is greater than @ref BLE_L2CAP_CH_COUNT_MAX.
- * @retval ::NRF_ERROR_NO_MEM rx_mps or tx_mps is set too high.
- */
-typedef struct
-{
- uint16_t rx_mps; /**< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall
- be able to receive on L2CAP channels on connections with this
- configuration. The minimum value is @ref BLE_L2CAP_MPS_MIN. */
- uint16_t tx_mps; /**< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall
- be able to transmit on L2CAP channels on connections with this
- configuration. The minimum value is @ref BLE_L2CAP_MPS_MIN. */
- uint8_t rx_queue_size; /**< Number of SDU data buffers that can be queued for reception per
- L2CAP channel. The minimum value is one. */
- uint8_t tx_queue_size; /**< Number of SDU data buffers that can be queued for transmission
- per L2CAP channel. The minimum value is one. */
- uint8_t ch_count; /**< Number of L2CAP channels the application can create per connection
- with this configuration. The default value is zero, the maximum
- value is @ref BLE_L2CAP_CH_COUNT_MAX.
- @note if this parameter is set to zero, all other parameters in
- @ref ble_l2cap_conn_cfg_t are ignored. */
-} ble_l2cap_conn_cfg_t;
-
-/**@brief L2CAP channel RX parameters. */
-typedef struct
-{
- uint16_t rx_mtu; /**< The maximum L2CAP SDU size, in bytes, that L2CAP shall be able to
- receive on this L2CAP channel.
- - Must be equal to or greater than @ref BLE_L2CAP_MTU_MIN. */
- uint16_t rx_mps; /**< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall be
- able to receive on this L2CAP channel.
- - Must be equal to or greater than @ref BLE_L2CAP_MPS_MIN.
- - Must be equal to or less than @ref ble_l2cap_conn_cfg_t::rx_mps. */
- ble_data_t sdu_buf; /**< SDU data buffer for reception.
- - If @ref ble_data_t::p_data is non-NULL, initial credits are
- issued to the peer.
- - If @ref ble_data_t::p_data is NULL, no initial credits are
- issued to the peer. */
-} ble_l2cap_ch_rx_params_t;
-
-/**@brief L2CAP channel setup parameters. */
-typedef struct
-{
- ble_l2cap_ch_rx_params_t rx_params; /**< L2CAP channel RX parameters. */
- uint16_t le_psm; /**< LE Protocol/Service Multiplexer. Used when requesting
- setup of an L2CAP channel, ignored otherwise. */
- uint16_t status; /**< Status code, see @ref BLE_L2CAP_CH_STATUS_CODES.
- Used when replying to a setup request of an L2CAP
- channel, ignored otherwise. */
-} ble_l2cap_ch_setup_params_t;
-
-/**@brief L2CAP channel TX parameters. */
-typedef struct
-{
- uint16_t tx_mtu; /**< The maximum L2CAP SDU size, in bytes, that L2CAP is able to
- transmit on this L2CAP channel. */
- uint16_t peer_mps; /**< The maximum L2CAP PDU payload size, in bytes, that the peer is
- able to receive on this L2CAP channel. */
- uint16_t tx_mps; /**< The maximum L2CAP PDU payload size, in bytes, that L2CAP is able
- to transmit on this L2CAP channel. This is effective tx_mps,
- selected by the SoftDevice as
- MIN( @ref ble_l2cap_ch_tx_params_t::peer_mps, @ref ble_l2cap_conn_cfg_t::tx_mps ) */
- uint16_t credits; /**< Initial credits given by the peer. */
-} ble_l2cap_ch_tx_params_t;
-
-/**@brief L2CAP Channel Setup Request event. */
-typedef struct
-{
- ble_l2cap_ch_tx_params_t tx_params; /**< L2CAP channel TX parameters. */
- uint16_t le_psm; /**< LE Protocol/Service Multiplexer. */
-} ble_l2cap_evt_ch_setup_request_t;
-
-/**@brief L2CAP Channel Setup Refused event. */
-typedef struct
-{
- uint8_t source; /**< Source, see @ref BLE_L2CAP_CH_SETUP_REFUSED_SRCS */
- uint16_t status; /**< Status code, see @ref BLE_L2CAP_CH_STATUS_CODES */
-} ble_l2cap_evt_ch_setup_refused_t;
-
-/**@brief L2CAP Channel Setup Completed event. */
-typedef struct
-{
- ble_l2cap_ch_tx_params_t tx_params; /**< L2CAP channel TX parameters. */
-} ble_l2cap_evt_ch_setup_t;
-
-/**@brief L2CAP Channel SDU Data Buffer Released event. */
-typedef struct
-{
- ble_data_t sdu_buf; /**< Returned reception or transmission SDU data buffer. The SoftDevice
- returns SDU data buffers supplied by the application, which have
- not yet been returned previously via a @ref BLE_L2CAP_EVT_CH_RX or
- @ref BLE_L2CAP_EVT_CH_TX event. */
-} ble_l2cap_evt_ch_sdu_buf_released_t;
-
-/**@brief L2CAP Channel Credit received event. */
-typedef struct
-{
- uint16_t credits; /**< Additional credits given by the peer. */
-} ble_l2cap_evt_ch_credit_t;
-
-/**@brief L2CAP Channel received SDU event. */
-typedef struct
-{
- uint16_t sdu_len; /**< Total SDU length, in bytes. */
- ble_data_t sdu_buf; /**< SDU data buffer.
- @note If there is not enough space in the buffer
- (sdu_buf.len < sdu_len) then the rest of the SDU will be
- silently discarded by the SoftDevice. */
-} ble_l2cap_evt_ch_rx_t;
-
-/**@brief L2CAP Channel transmitted SDU event. */
-typedef struct
-{
- ble_data_t sdu_buf; /**< SDU data buffer. */
-} ble_l2cap_evt_ch_tx_t;
-
-/**@brief L2CAP event structure. */
-typedef struct
-{
- uint16_t conn_handle; /**< Connection Handle on which the event occured. */
- uint16_t local_cid; /**< Local Channel ID of the L2CAP channel, or
- @ref BLE_L2CAP_CID_INVALID if not present. */
- union
- {
- ble_l2cap_evt_ch_setup_request_t ch_setup_request; /**< L2CAP Channel Setup Request Event Parameters. */
- ble_l2cap_evt_ch_setup_refused_t ch_setup_refused; /**< L2CAP Channel Setup Refused Event Parameters. */
- ble_l2cap_evt_ch_setup_t ch_setup; /**< L2CAP Channel Setup Completed Event Parameters. */
- ble_l2cap_evt_ch_sdu_buf_released_t ch_sdu_buf_released;/**< L2CAP Channel SDU Data Buffer Released Event Parameters. */
- ble_l2cap_evt_ch_credit_t credit; /**< L2CAP Channel Credit Received Event Parameters. */
- ble_l2cap_evt_ch_rx_t rx; /**< L2CAP Channel SDU Received Event Parameters. */
- ble_l2cap_evt_ch_tx_t tx; /**< L2CAP Channel SDU Transmitted Event Parameters. */
- } params; /**< Event Parameters. */
-} ble_l2cap_evt_t;
-
-/** @} */
-
-/**@addtogroup BLE_L2CAP_FUNCTIONS Functions
- * @{ */
-
-/**@brief Set up an L2CAP channel.
- *
- * @details This function is used to:
- * - Request setup of an L2CAP channel: sends an LE Credit Based Connection Request packet to a peer.
- * - Reply to a setup request of an L2CAP channel (if called in response to a
- * @ref BLE_L2CAP_EVT_CH_SETUP_REQUEST event): sends an LE Credit Based Connection
- * Response packet to a peer.
- *
- * @note A call to this function will require the application to keep the SDU data buffer alive
- * until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_RX or
- * @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event.
- *
- * @events
- * @event{@ref BLE_L2CAP_EVT_CH_SETUP, Setup successful.}
- * @event{@ref BLE_L2CAP_EVT_CH_SETUP_REFUSED, Setup failed.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_L2CAP_CH_SETUP_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection Handle.
- * @param[in,out] p_local_cid Pointer to a uint16_t containing Local Channel ID of the L2CAP channel:
- * - As input: @ref BLE_L2CAP_CID_INVALID when requesting setup of an L2CAP
- * channel or local_cid provided in the @ref BLE_L2CAP_EVT_CH_SETUP_REQUEST
- * event when replying to a setup request of an L2CAP channel.
- * - As output: local_cid for this channel.
- * @param[in] p_params L2CAP channel parameters.
- *
- * @retval ::NRF_SUCCESS Successfully queued request or response for transmission.
- * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
- * @retval ::NRF_ERROR_INVALID_LENGTH Supplied higher rx_mps than has been configured on this link.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (L2CAP channel already set up).
- * @retval ::NRF_ERROR_NOT_FOUND CID not found.
- * @retval ::NRF_ERROR_RESOURCES The limit has been reached for available L2CAP channels,
- * see @ref ble_l2cap_conn_cfg_t::ch_count.
- */
-SVCALL(SD_BLE_L2CAP_CH_SETUP, uint32_t, sd_ble_l2cap_ch_setup(uint16_t conn_handle, uint16_t *p_local_cid, ble_l2cap_ch_setup_params_t const *p_params));
-
-/**@brief Release an L2CAP channel.
- *
- * @details This sends a Disconnection Request packet to a peer.
- *
- * @events
- * @event{@ref BLE_L2CAP_EVT_CH_RELEASED, Release complete.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_L2CAP_CH_RELEASE_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection Handle.
- * @param[in] local_cid Local Channel ID of the L2CAP channel.
- *
- * @retval ::NRF_SUCCESS Successfully queued request for transmission.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is
- * in progress for the L2CAP channel).
- * @retval ::NRF_ERROR_NOT_FOUND CID not found.
- */
-SVCALL(SD_BLE_L2CAP_CH_RELEASE, uint32_t, sd_ble_l2cap_ch_release(uint16_t conn_handle, uint16_t local_cid));
-
-/**@brief Receive an SDU on an L2CAP channel.
- *
- * @details This may issue additional credits to the peer using an LE Flow Control Credit packet.
- *
- * @note A call to this function will require the application to keep the memory pointed by
- * @ref ble_data_t::p_data alive until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_RX
- * or @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event.
- *
- * @note The SoftDevice can queue up to @ref ble_l2cap_conn_cfg_t::rx_queue_size SDU data buffers
- * for reception per L2CAP channel.
- *
- * @events
- * @event{@ref BLE_L2CAP_EVT_CH_RX, The SDU is received.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_L2CAP_CH_RX_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection Handle.
- * @param[in] local_cid Local Channel ID of the L2CAP channel.
- * @param[in] p_sdu_buf Pointer to the SDU data buffer.
- *
- * @retval ::NRF_SUCCESS Buffer accepted.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is
- * in progress for an L2CAP channel).
- * @retval ::NRF_ERROR_NOT_FOUND CID not found.
- * @retval ::NRF_ERROR_RESOURCES Too many SDU data buffers supplied. Wait for a
- * @ref BLE_L2CAP_EVT_CH_RX event and retry.
- */
-SVCALL(SD_BLE_L2CAP_CH_RX, uint32_t, sd_ble_l2cap_ch_rx(uint16_t conn_handle, uint16_t local_cid, ble_data_t const *p_sdu_buf));
-
-/**@brief Transmit an SDU on an L2CAP channel.
- *
- * @note A call to this function will require the application to keep the memory pointed by
- * @ref ble_data_t::p_data alive until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_TX
- * or @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event.
- *
- * @note The SoftDevice can queue up to @ref ble_l2cap_conn_cfg_t::tx_queue_size SDUs for
- * transmission per L2CAP channel.
- *
- * @note The application can keep track of the available credits for transmission by following
- * the procedure below:
- * - Store initial credits given by the peer in a variable.
- * (Initial credits are provided in a @ref BLE_L2CAP_EVT_CH_SETUP event.)
- * - Decrement the variable, which stores the currently available credits, by
- * ceiling((@ref ble_data_t::len + 2) / tx_mps) when a call to this function returns
- * @ref NRF_SUCCESS. (tx_mps is provided in a @ref BLE_L2CAP_EVT_CH_SETUP event.)
- * - Increment the variable, which stores the currently available credits, by additional
- * credits given by the peer in a @ref BLE_L2CAP_EVT_CH_CREDIT event.
- *
- * @events
- * @event{@ref BLE_L2CAP_EVT_CH_TX, The SDU is transmitted.}
- * @endevents
- *
- * @mscs
- * @mmsc{@ref BLE_L2CAP_CH_TX_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection Handle.
- * @param[in] local_cid Local Channel ID of the L2CAP channel.
- * @param[in] p_sdu_buf Pointer to the SDU data buffer.
- *
- * @retval ::NRF_SUCCESS Successfully queued L2CAP SDU for transmission.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is
- * in progress for the L2CAP channel).
- * @retval ::NRF_ERROR_NOT_FOUND CID not found.
- * @retval ::NRF_ERROR_DATA_SIZE Invalid SDU length supplied, must not be more than
- * @ref ble_l2cap_ch_tx_params_t::tx_mtu provided in
- * @ref BLE_L2CAP_EVT_CH_SETUP event.
- * @retval ::NRF_ERROR_RESOURCES Too many SDUs queued for transmission. Wait for a
- * @ref BLE_L2CAP_EVT_CH_TX event and retry.
- */
-SVCALL(SD_BLE_L2CAP_CH_TX, uint32_t, sd_ble_l2cap_ch_tx(uint16_t conn_handle, uint16_t local_cid, ble_data_t const *p_sdu_buf));
-
-/**@brief Advanced SDU reception flow control.
- *
- * @details Adjust the way the SoftDevice issues credits to the peer.
- * This may issue additional credits to the peer using an LE Flow Control Credit packet.
- *
- * @mscs
- * @mmsc{@ref BLE_L2CAP_CH_FLOW_CONTROL_MSC}
- * @endmscs
- *
- * @param[in] conn_handle Connection Handle.
- * @param[in] local_cid Local Channel ID of the L2CAP channel or @ref BLE_L2CAP_CID_INVALID to set
- * the value that will be used for newly created channels.
- * @param[in] credits Number of credits that the SoftDevice will make sure the peer has every
- * time it starts using a new reception buffer.
- * - @ref BLE_L2CAP_CREDITS_DEFAULT is the default value the SoftDevice will
- * use if this function is not called.
- * - If set to zero, the SoftDevice will stop issuing credits for new reception
- * buffers the application provides or has provided. SDU reception that is
- * currently ongoing will be allowed to complete.
- * @param[out] p_credits NULL or pointer to a uint16_t. If a valid pointer is provided, it will be
- * written by the SoftDevice with the number of credits that is or will be
- * available to the peer. If the value written by the SoftDevice is 0 when
- * credits parameter was set to 0, the peer will not be able to send more
- * data until more credits are provided by calling this function again with
- * credits > 0. This parameter is ignored when local_cid is set to
- * @ref BLE_L2CAP_CID_INVALID.
- *
- * @note Application should take care when setting number of credits higher than default value. In
- * this case the application must make sure that the SoftDevice always has reception buffers
- * available (see @ref sd_ble_l2cap_ch_rx) for that channel. If the SoftDevice does not have
- * such buffers available, packets may be NACKed on the Link Layer and all Bluetooth traffic
- * on the connection handle may be stalled until the SoftDevice again has an available
- * reception buffer. This applies even if the application has used this call to set the
- * credits back to default, or zero.
- *
- * @retval ::NRF_SUCCESS Flow control parameters accepted.
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
- * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
- * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is
- * in progress for an L2CAP channel).
- * @retval ::NRF_ERROR_NOT_FOUND CID not found.
- */
-SVCALL(SD_BLE_L2CAP_CH_FLOW_CONTROL, uint32_t, sd_ble_l2cap_ch_flow_control(uint16_t conn_handle, uint16_t local_cid, uint16_t credits, uint16_t *p_credits));
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-#endif // BLE_L2CAP_H__
-
-/**
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_ranges.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_ranges.h
deleted file mode 100755
index 0935bca0..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_ranges.h
+++ /dev/null
@@ -1,156 +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.
- */
-
-/**
- @addtogroup BLE_COMMON
- @{
- @defgroup ble_ranges Module specific SVC, event and option number subranges
- @{
-
- @brief Definition of SVC, event and option number subranges for each API module.
-
- @note
- SVCs, event and option numbers are split into subranges for each API module.
- Each module receives its entire allocated range of SVC calls, whether implemented or not,
- but return BLE_ERROR_NOT_SUPPORTED for unimplemented or undefined calls in its range.
-
- Note that the symbols BLE_<module>_SVC_LAST is the end of the allocated SVC range,
- rather than the last SVC function call actually defined and implemented.
-
- Specific SVC, event and option values are defined in each module's ble_<module>.h file,
- which defines names of each individual SVC code based on the range start value.
-*/
-
-#ifndef BLE_RANGES_H__
-#define BLE_RANGES_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define BLE_SVC_BASE 0x60 /**< Common BLE SVC base. */
-#define BLE_SVC_LAST 0x6B /**< Common BLE SVC last. */
-
-#define BLE_GAP_SVC_BASE 0x6C /**< GAP BLE SVC base. */
-#define BLE_GAP_SVC_LAST 0x9A /**< GAP BLE SVC last. */
-
-#define BLE_GATTC_SVC_BASE 0x9B /**< GATTC BLE SVC base. */
-#define BLE_GATTC_SVC_LAST 0xA7 /**< GATTC BLE SVC last. */
-
-#define BLE_GATTS_SVC_BASE 0xA8 /**< GATTS BLE SVC base. */
-#define BLE_GATTS_SVC_LAST 0xB7 /**< GATTS BLE SVC last. */
-
-#define BLE_L2CAP_SVC_BASE 0xB8 /**< L2CAP BLE SVC base. */
-#define BLE_L2CAP_SVC_LAST 0xBF /**< L2CAP BLE SVC last. */
-
-
-#define BLE_EVT_INVALID 0x00 /**< Invalid BLE Event. */
-
-#define BLE_EVT_BASE 0x01 /**< Common BLE Event base. */
-#define BLE_EVT_LAST 0x0F /**< Common BLE Event last. */
-
-#define BLE_GAP_EVT_BASE 0x10 /**< GAP BLE Event base. */
-#define BLE_GAP_EVT_LAST 0x2F /**< GAP BLE Event last. */
-
-#define BLE_GATTC_EVT_BASE 0x30 /**< GATTC BLE Event base. */
-#define BLE_GATTC_EVT_LAST 0x4F /**< GATTC BLE Event last. */
-
-#define BLE_GATTS_EVT_BASE 0x50 /**< GATTS BLE Event base. */
-#define BLE_GATTS_EVT_LAST 0x6F /**< GATTS BLE Event last. */
-
-#define BLE_L2CAP_EVT_BASE 0x70 /**< L2CAP BLE Event base. */
-#define BLE_L2CAP_EVT_LAST 0x8F /**< L2CAP BLE Event last. */
-
-
-#define BLE_OPT_INVALID 0x00 /**< Invalid BLE Option. */
-
-#define BLE_OPT_BASE 0x01 /**< Common BLE Option base. */
-#define BLE_OPT_LAST 0x1F /**< Common BLE Option last. */
-
-#define BLE_GAP_OPT_BASE 0x20 /**< GAP BLE Option base. */
-#define BLE_GAP_OPT_LAST 0x3F /**< GAP BLE Option last. */
-
-#define BLE_GATT_OPT_BASE 0x40 /**< GATT BLE Option base. */
-#define BLE_GATT_OPT_LAST 0x5F /**< GATT BLE Option last. */
-
-#define BLE_GATTC_OPT_BASE 0x60 /**< GATTC BLE Option base. */
-#define BLE_GATTC_OPT_LAST 0x7F /**< GATTC BLE Option last. */
-
-#define BLE_GATTS_OPT_BASE 0x80 /**< GATTS BLE Option base. */
-#define BLE_GATTS_OPT_LAST 0x9F /**< GATTS BLE Option last. */
-
-#define BLE_L2CAP_OPT_BASE 0xA0 /**< L2CAP BLE Option base. */
-#define BLE_L2CAP_OPT_LAST 0xBF /**< L2CAP BLE Option last. */
-
-
-#define BLE_CFG_INVALID 0x00 /**< Invalid BLE configuration. */
-
-#define BLE_CFG_BASE 0x01 /**< Common BLE configuration base. */
-#define BLE_CFG_LAST 0x1F /**< Common BLE configuration last. */
-
-#define BLE_CONN_CFG_BASE 0x20 /**< BLE connection configuration base. */
-#define BLE_CONN_CFG_LAST 0x3F /**< BLE connection configuration last. */
-
-#define BLE_GAP_CFG_BASE 0x40 /**< GAP BLE configuration base. */
-#define BLE_GAP_CFG_LAST 0x5F /**< GAP BLE configuration last. */
-
-#define BLE_GATT_CFG_BASE 0x60 /**< GATT BLE configuration base. */
-#define BLE_GATT_CFG_LAST 0x7F /**< GATT BLE configuration last. */
-
-#define BLE_GATTC_CFG_BASE 0x80 /**< GATTC BLE configuration base. */
-#define BLE_GATTC_CFG_LAST 0x9F /**< GATTC BLE configuration last. */
-
-#define BLE_GATTS_CFG_BASE 0xA0 /**< GATTS BLE configuration base. */
-#define BLE_GATTS_CFG_LAST 0xBF /**< GATTS BLE configuration last. */
-
-#define BLE_L2CAP_CFG_BASE 0xC0 /**< L2CAP BLE configuration base. */
-#define BLE_L2CAP_CFG_LAST 0xDF /**< L2CAP BLE configuration last. */
-
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* BLE_RANGES_H__ */
-
-/**
- @}
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_types.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_types.h
deleted file mode 100755
index 88c93180..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/ble_types.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 2012 - 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, 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.
- */
-
-/**
- @addtogroup BLE_COMMON
- @{
- @defgroup ble_types Common types and macro definitions
- @{
-
- @brief Common types and macro definitions for the BLE SoftDevice.
- */
-
-#ifndef BLE_TYPES_H__
-#define BLE_TYPES_H__
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup BLE_TYPES_DEFINES Defines
- * @{ */
-
-/** @defgroup BLE_CONN_HANDLES BLE Connection Handles
- * @{ */
-#define BLE_CONN_HANDLE_INVALID 0xFFFF /**< Invalid Connection Handle. */
-#define BLE_CONN_HANDLE_ALL 0xFFFE /**< Applies to all Connection Handles. */
-/** @} */
-
-
-/** @defgroup BLE_UUID_VALUES Assigned Values for BLE UUIDs
- * @{ */
-/* Generic UUIDs, applicable to all services */
-#define BLE_UUID_UNKNOWN 0x0000 /**< Reserved UUID. */
-#define BLE_UUID_SERVICE_PRIMARY 0x2800 /**< Primary Service. */
-#define BLE_UUID_SERVICE_SECONDARY 0x2801 /**< Secondary Service. */
-#define BLE_UUID_SERVICE_INCLUDE 0x2802 /**< Include. */
-#define BLE_UUID_CHARACTERISTIC 0x2803 /**< Characteristic. */
-#define BLE_UUID_DESCRIPTOR_CHAR_EXT_PROP 0x2900 /**< Characteristic Extended Properties Descriptor. */
-#define BLE_UUID_DESCRIPTOR_CHAR_USER_DESC 0x2901 /**< Characteristic User Description Descriptor. */
-#define BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG 0x2902 /**< Client Characteristic Configuration Descriptor. */
-#define BLE_UUID_DESCRIPTOR_SERVER_CHAR_CONFIG 0x2903 /**< Server Characteristic Configuration Descriptor. */
-#define BLE_UUID_DESCRIPTOR_CHAR_PRESENTATION_FORMAT 0x2904 /**< Characteristic Presentation Format Descriptor. */
-#define BLE_UUID_DESCRIPTOR_CHAR_AGGREGATE_FORMAT 0x2905 /**< Characteristic Aggregate Format Descriptor. */
-/* GATT specific UUIDs */
-#define BLE_UUID_GATT 0x1801 /**< Generic Attribute Profile. */
-#define BLE_UUID_GATT_CHARACTERISTIC_SERVICE_CHANGED 0x2A05 /**< Service Changed Characteristic. */
-/* GAP specific UUIDs */
-#define BLE_UUID_GAP 0x1800 /**< Generic Access Profile. */
-#define BLE_UUID_GAP_CHARACTERISTIC_DEVICE_NAME 0x2A00 /**< Device Name Characteristic. */
-#define BLE_UUID_GAP_CHARACTERISTIC_APPEARANCE 0x2A01 /**< Appearance Characteristic. */
-#define BLE_UUID_GAP_CHARACTERISTIC_RECONN_ADDR 0x2A03 /**< Reconnection Address Characteristic. */
-#define BLE_UUID_GAP_CHARACTERISTIC_PPCP 0x2A04 /**< Peripheral Preferred Connection Parameters Characteristic. */
-#define BLE_UUID_GAP_CHARACTERISTIC_CAR 0x2AA6 /**< Central Address Resolution Characteristic. */
-#define BLE_UUID_GAP_CHARACTERISTIC_RPA_ONLY 0x2AC9 /**< Resolvable Private Address Only Characteristic. */
-/** @} */
-
-
-/** @defgroup BLE_UUID_TYPES Types of UUID
- * @{ */
-#define BLE_UUID_TYPE_UNKNOWN 0x00 /**< Invalid UUID type. */
-#define BLE_UUID_TYPE_BLE 0x01 /**< Bluetooth SIG UUID (16-bit). */
-#define BLE_UUID_TYPE_VENDOR_BEGIN 0x02 /**< Vendor UUID types start at this index (128-bit). */
-/** @} */
-
-
-/** @defgroup BLE_APPEARANCES Bluetooth Appearance values
- * @note Retrieved from http://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml
- * @{ */
-#define BLE_APPEARANCE_UNKNOWN 0 /**< Unknown. */
-#define BLE_APPEARANCE_GENERIC_PHONE 64 /**< Generic Phone. */
-#define BLE_APPEARANCE_GENERIC_COMPUTER 128 /**< Generic Computer. */
-#define BLE_APPEARANCE_GENERIC_WATCH 192 /**< Generic Watch. */
-#define BLE_APPEARANCE_WATCH_SPORTS_WATCH 193 /**< Watch: Sports Watch. */
-#define BLE_APPEARANCE_GENERIC_CLOCK 256 /**< Generic Clock. */
-#define BLE_APPEARANCE_GENERIC_DISPLAY 320 /**< Generic Display. */
-#define BLE_APPEARANCE_GENERIC_REMOTE_CONTROL 384 /**< Generic Remote Control. */
-#define BLE_APPEARANCE_GENERIC_EYE_GLASSES 448 /**< Generic Eye-glasses. */
-#define BLE_APPEARANCE_GENERIC_TAG 512 /**< Generic Tag. */
-#define BLE_APPEARANCE_GENERIC_KEYRING 576 /**< Generic Keyring. */
-#define BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 640 /**< Generic Media Player. */
-#define BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 704 /**< Generic Barcode Scanner. */
-#define BLE_APPEARANCE_GENERIC_THERMOMETER 768 /**< Generic Thermometer. */
-#define BLE_APPEARANCE_THERMOMETER_EAR 769 /**< Thermometer: Ear. */
-#define BLE_APPEARANCE_GENERIC_HEART_RATE_SENSOR 832 /**< Generic Heart rate Sensor. */
-#define BLE_APPEARANCE_HEART_RATE_SENSOR_HEART_RATE_BELT 833 /**< Heart Rate Sensor: Heart Rate Belt. */
-#define BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 896 /**< Generic Blood Pressure. */
-#define BLE_APPEARANCE_BLOOD_PRESSURE_ARM 897 /**< Blood Pressure: Arm. */
-#define BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 898 /**< Blood Pressure: Wrist. */
-#define BLE_APPEARANCE_GENERIC_HID 960 /**< Human Interface Device (HID). */
-#define BLE_APPEARANCE_HID_KEYBOARD 961 /**< Keyboard (HID Subtype). */
-#define BLE_APPEARANCE_HID_MOUSE 962 /**< Mouse (HID Subtype). */
-#define BLE_APPEARANCE_HID_JOYSTICK 963 /**< Joystick (HID Subtype). */
-#define BLE_APPEARANCE_HID_GAMEPAD 964 /**< Gamepad (HID Subtype). */
-#define BLE_APPEARANCE_HID_DIGITIZERSUBTYPE 965 /**< Digitizer Tablet (HID Subtype). */
-#define BLE_APPEARANCE_HID_CARD_READER 966 /**< Card Reader (HID Subtype). */
-#define BLE_APPEARANCE_HID_DIGITAL_PEN 967 /**< Digital Pen (HID Subtype). */
-#define BLE_APPEARANCE_HID_BARCODE 968 /**< Barcode Scanner (HID Subtype). */
-#define BLE_APPEARANCE_GENERIC_GLUCOSE_METER 1024 /**< Generic Glucose Meter. */
-#define BLE_APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR 1088 /**< Generic Running Walking Sensor. */
-#define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE 1089 /**< Running Walking Sensor: In-Shoe. */
-#define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE 1090 /**< Running Walking Sensor: On-Shoe. */
-#define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP 1091 /**< Running Walking Sensor: On-Hip. */
-#define BLE_APPEARANCE_GENERIC_CYCLING 1152 /**< Generic Cycling. */
-#define BLE_APPEARANCE_CYCLING_CYCLING_COMPUTER 1153 /**< Cycling: Cycling Computer. */
-#define BLE_APPEARANCE_CYCLING_SPEED_SENSOR 1154 /**< Cycling: Speed Sensor. */
-#define BLE_APPEARANCE_CYCLING_CADENCE_SENSOR 1155 /**< Cycling: Cadence Sensor. */
-#define BLE_APPEARANCE_CYCLING_POWER_SENSOR 1156 /**< Cycling: Power Sensor. */
-#define BLE_APPEARANCE_CYCLING_SPEED_CADENCE_SENSOR 1157 /**< Cycling: Speed and Cadence Sensor. */
-#define BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 3136 /**< Generic Pulse Oximeter. */
-#define BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 3137 /**< Fingertip (Pulse Oximeter subtype). */
-#define BLE_APPEARANCE_PULSE_OXIMETER_WRIST_WORN 3138 /**< Wrist Worn(Pulse Oximeter subtype). */
-#define BLE_APPEARANCE_GENERIC_WEIGHT_SCALE 3200 /**< Generic Weight Scale. */
-#define BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS_ACT 5184 /**< Generic Outdoor Sports Activity. */
-#define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_DISP 5185 /**< Location Display Device (Outdoor Sports Activity subtype). */
-#define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_DISP 5186 /**< Location and Navigation Display Device (Outdoor Sports Activity subtype). */
-#define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_POD 5187 /**< Location Pod (Outdoor Sports Activity subtype). */
-#define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_POD 5188 /**< Location and Navigation Pod (Outdoor Sports Activity subtype). */
-/** @} */
-
-/** @brief Set .type and .uuid fields of ble_uuid_struct to specified UUID value. */
-#define BLE_UUID_BLE_ASSIGN(instance, value) do {\
- instance.type = BLE_UUID_TYPE_BLE; \
- instance.uuid = value;} while(0)
-
-/** @brief Copy type and uuid members from src to dst ble_uuid_t pointer. Both pointers must be valid/non-null. */
-#define BLE_UUID_COPY_PTR(dst, src) do {\
- (dst)->type = (src)->type; \
- (dst)->uuid = (src)->uuid;} while(0)
-
-/** @brief Copy type and uuid members from src to dst ble_uuid_t struct. */
-#define BLE_UUID_COPY_INST(dst, src) do {\
- (dst).type = (src).type; \
- (dst).uuid = (src).uuid;} while(0)
-
-/** @brief Compare for equality both type and uuid members of two (valid, non-null) ble_uuid_t pointers. */
-#define BLE_UUID_EQ(p_uuid1, p_uuid2) \
- (((p_uuid1)->type == (p_uuid2)->type) && ((p_uuid1)->uuid == (p_uuid2)->uuid))
-
-/** @brief Compare for difference both type and uuid members of two (valid, non-null) ble_uuid_t pointers. */
-#define BLE_UUID_NEQ(p_uuid1, p_uuid2) \
- (((p_uuid1)->type != (p_uuid2)->type) || ((p_uuid1)->uuid != (p_uuid2)->uuid))
-
-/** @} */
-
-/** @addtogroup BLE_TYPES_STRUCTURES Structures
- * @{ */
-
-/** @brief 128 bit UUID values. */
-typedef struct
-{
- uint8_t uuid128[16]; /**< Little-Endian UUID bytes. */
-} ble_uuid128_t;
-
-/** @brief Bluetooth Low Energy UUID type, encapsulates both 16-bit and 128-bit UUIDs. */
-typedef struct
-{
- uint16_t uuid; /**< 16-bit UUID value or octets 12-13 of 128-bit UUID. */
- uint8_t type; /**< UUID type, see @ref BLE_UUID_TYPES. If type is @ref BLE_UUID_TYPE_UNKNOWN, the value of uuid is undefined. */
-} ble_uuid_t;
-
-/**@brief Data structure. */
-typedef struct
-{
- uint8_t *p_data; /**< Pointer to the data buffer provided to/from the application. */
- uint16_t len; /**< Length of the data buffer, in bytes. */
-} ble_data_t;
-
-/** @} */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BLE_TYPES_H__ */
-
-/**
- @}
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf52/nrf_mbr.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf52/nrf_mbr.h
deleted file mode 100755
index 42e09fc8..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf52/nrf_mbr.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright (c) 2014 - 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, 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.
- */
-
-/**
- @defgroup nrf_mbr_api Master Boot Record API
- @{
-
- @brief APIs for updating SoftDevice and BootLoader
-
-*/
-
-#ifndef NRF_MBR_H__
-#define NRF_MBR_H__
-
-#include "nrf_svc.h"
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup NRF_MBR_DEFINES Defines
- * @{ */
-
-/**@brief MBR SVC Base number. */
-#define MBR_SVC_BASE (0x18)
-
-/**@brief Page size in words. */
-#define MBR_PAGE_SIZE_IN_WORDS (1024)
-
-/** @brief The size that must be reserved for the MBR when a SoftDevice is written to flash.
-This is the offset where the first byte of the SoftDevice hex file is written. */
-#define MBR_SIZE (0x1000)
-
-/** @brief Location (in the flash memory) of the bootloader address. */
-#define MBR_BOOTLOADER_ADDR (0xFF8)
-
-/** @brief Location (in UICR) of the bootloader address. */
-#define MBR_UICR_BOOTLOADER_ADDR (&(NRF_UICR->NRFFW[0]))
-
-/** @brief Location (in the flash memory) of the address of the MBR parameter page. */
-#define MBR_PARAM_PAGE_ADDR (0xFFC)
-
-/** @brief Location (in UICR) of the address of the MBR parameter page. */
-#define MBR_UICR_PARAM_PAGE_ADDR (&(NRF_UICR->NRFFW[1]))
-
-
-/** @} */
-
-/** @addtogroup NRF_MBR_ENUMS Enumerations
- * @{ */
-
-/**@brief nRF Master Boot Record API SVC numbers. */
-enum NRF_MBR_SVCS
-{
- SD_MBR_COMMAND = MBR_SVC_BASE, /**< ::sd_mbr_command */
-};
-
-/**@brief Possible values for ::sd_mbr_command_t.command */
-enum NRF_MBR_COMMANDS
-{
- SD_MBR_COMMAND_COPY_BL, /**< Copy a new BootLoader. @see ::sd_mbr_command_copy_bl_t*/
- SD_MBR_COMMAND_COPY_SD, /**< Copy a new SoftDevice. @see ::sd_mbr_command_copy_sd_t*/
- SD_MBR_COMMAND_INIT_SD, /**< Initialize forwarding interrupts to SD, and run reset function in SD. Does not require any parameters in ::sd_mbr_command_t params.*/
- SD_MBR_COMMAND_COMPARE, /**< This command works like memcmp. @see ::sd_mbr_command_compare_t*/
- SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET, /**< Change the address the MBR starts after a reset. @see ::sd_mbr_command_vector_table_base_set_t*/
- SD_MBR_COMMAND_RESERVED,
- SD_MBR_COMMAND_IRQ_FORWARD_ADDRESS_SET, /**< Start forwarding all interrupts to this address. @see ::sd_mbr_command_irq_forward_address_set_t*/
-};
-
-/** @} */
-
-/** @addtogroup NRF_MBR_TYPES Types
- * @{ */
-
-/**@brief This command copies part of a new SoftDevice
- *
- * The destination area is erased before copying.
- * If dst is in the middle of a flash page, that whole flash page will be erased.
- * If (dst+len) is in the middle of a flash page, that whole flash page will be erased.
- *
- * The user of this function is responsible for setting the BPROT registers.
- *
- * @retval ::NRF_SUCCESS indicates that the contents of the memory blocks where copied correctly.
- * @retval ::NRF_ERROR_INTERNAL indicates that the contents of the memory blocks where not verified correctly after copying.
- */
-typedef struct
-{
- uint32_t *src; /**< Pointer to the source of data to be copied.*/
- uint32_t *dst; /**< Pointer to the destination where the content is to be copied.*/
- uint32_t len; /**< Number of 32 bit words to copy. Must be a multiple of @ref MBR_PAGE_SIZE_IN_WORDS words.*/
-} sd_mbr_command_copy_sd_t;
-
-
-/**@brief This command works like memcmp, but takes the length in words.
- *
- * @retval ::NRF_SUCCESS indicates that the contents of both memory blocks are equal.
- * @retval ::NRF_ERROR_NULL indicates that the contents of the memory blocks are not equal.
- */
-typedef struct
-{
- uint32_t *ptr1; /**< Pointer to block of memory. */
- uint32_t *ptr2; /**< Pointer to block of memory. */
- uint32_t len; /**< Number of 32 bit words to compare.*/
-} sd_mbr_command_compare_t;
-
-
-/**@brief This command copies a new BootLoader.
- *
- * The MBR assumes that either @ref MBR_BOOTLOADER_ADDR or @ref MBR_UICR_BOOTLOADER_ADDR is set to
- * the address where the bootloader will be copied. If both addresses are set, the MBR will prioritize
- * @ref MBR_BOOTLOADER_ADDR.
- *
- * The bootloader destination is erased by this function.
- * If (destination+bl_len) is in the middle of a flash page, that whole flash page will be erased.
- *
- * This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set,
- * see @ref sd_mbr_command.
- *
- * This command will use the flash protect peripheral (BPROT or ACL) to protect the flash that is
- * not intended to be written.
- *
- * On success, this function will not return. It will start the new bootloader from reset-vector as normal.
- *
- * @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen.
- * @retval ::NRF_ERROR_FORBIDDEN if the bootloader address is not set.
- * @retval ::NRF_ERROR_INVALID_LENGTH if parameters attempts to read or write outside flash area.
- * @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command.
- */
-typedef struct
-{
- uint32_t *bl_src; /**< Pointer to the source of the bootloader to be be copied.*/
- uint32_t bl_len; /**< Number of 32 bit words to copy for BootLoader. */
-} sd_mbr_command_copy_bl_t;
-
-/**@brief Change the address the MBR starts after a reset
- *
- * Once this function has been called, this address is where the MBR will start to forward
- * interrupts to after a reset.
- *
- * To restore default forwarding, this function should be called with @ref address set to 0. If a
- * bootloader is present, interrupts will be forwarded to the bootloader. If not, interrupts will
- * be forwarded to the SoftDevice.
- *
- * The location of a bootloader can be specified in @ref MBR_BOOTLOADER_ADDR or
- * @ref MBR_UICR_BOOTLOADER_ADDR. If both addresses are set, the MBR will prioritize
- * @ref MBR_BOOTLOADER_ADDR.
- *
- * This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set,
- * see @ref sd_mbr_command.
- *
- * On success, this function will not return. It will reset the device.
- *
- * @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen.
- * @retval ::NRF_ERROR_INVALID_ADDR if parameter address is outside of the flash size.
- * @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command.
- */
-typedef struct
-{
- uint32_t address; /**< The base address of the interrupt vector table for forwarded interrupts.*/
-} sd_mbr_command_vector_table_base_set_t;
-
-/**@brief Sets the base address of the interrupt vector table for interrupts forwarded from the MBR
- *
- * Unlike sd_mbr_command_vector_table_base_set_t, this function does not reset, and it does not
- * change where the MBR starts after reset.
- *
- * @retval ::NRF_SUCCESS
- */
-typedef struct
-{
- uint32_t address; /**< The base address of the interrupt vector table for forwarded interrupts.*/
-} sd_mbr_command_irq_forward_address_set_t;
-
-/**@brief Input structure containing data used when calling ::sd_mbr_command
- *
- * Depending on what command value that is set, the corresponding params value type must also be
- * set. See @ref NRF_MBR_COMMANDS for command types and corresponding params value type. If command
- * @ref SD_MBR_COMMAND_INIT_SD is set, it is not necessary to set any values under params.
- */
-typedef struct
-{
- uint32_t command; /**< Type of command to be issued. See @ref NRF_MBR_COMMANDS. */
- union
- {
- sd_mbr_command_copy_sd_t copy_sd; /**< Parameters for copy SoftDevice.*/
- sd_mbr_command_compare_t compare; /**< Parameters for verify.*/
- sd_mbr_command_copy_bl_t copy_bl; /**< Parameters for copy BootLoader. Requires parameter page. */
- sd_mbr_command_vector_table_base_set_t base_set; /**< Parameters for vector table base set. Requires parameter page.*/
- sd_mbr_command_irq_forward_address_set_t irq_forward_address_set; /**< Parameters for irq forward address set*/
- } params; /**< Command parameters. */
-} sd_mbr_command_t;
-
-/** @} */
-
-/** @addtogroup NRF_MBR_FUNCTIONS Functions
- * @{ */
-
-/**@brief Issue Master Boot Record commands
- *
- * Commands used when updating a SoftDevice and bootloader.
- *
- * The @ref SD_MBR_COMMAND_COPY_BL and @ref SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET requires
- * parameters to be retained by the MBR when resetting the IC. This is done in a separate flash
- * page. The location of the flash page should be provided by the application in either
- * @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR. If both addresses are set, the MBR
- * will prioritize @ref MBR_PARAM_PAGE_ADDR. This page will be cleared by the MBR and is used to
- * store the command before reset. When an address is specified, the page it refers to must not be
- * used by the application. If no address is provided by the application, i.e. both
- * @ref MBR_PARAM_PAGE_ADDR and @ref MBR_UICR_PARAM_PAGE_ADDR is 0xFFFFFFFF, MBR commands which use
- * flash will be unavailable and return @ref NRF_ERROR_NO_MEM.
- *
- * @param[in] param Pointer to a struct describing the command.
- *
- * @note For a complete set of return values, see ::sd_mbr_command_copy_sd_t,
- * ::sd_mbr_command_copy_bl_t, ::sd_mbr_command_compare_t,
- * ::sd_mbr_command_vector_table_base_set_t, ::sd_mbr_command_irq_forward_address_set_t
- *
- * @retval ::NRF_ERROR_NO_MEM No MBR parameter page provided
- * @retval ::NRF_ERROR_INVALID_PARAM if an invalid command is given.
-*/
-SVCALL(SD_MBR_COMMAND, uint32_t, sd_mbr_command(sd_mbr_command_t* param));
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-#endif // NRF_MBR_H__
-
-/**
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_error.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_error.h
deleted file mode 100755
index 6badee98..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_error.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2014 - 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, 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.
- */
-
- /**
- @defgroup nrf_error SoftDevice Global Error Codes
- @{
-
- @brief Global Error definitions
-*/
-
-/* Header guard */
-#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) ///< Invalid Data size
-#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
-#define NRF_ERROR_CONN_COUNT (NRF_ERROR_BASE_NUM + 18) ///< Maximum connection count exceeded.
-#define NRF_ERROR_RESOURCES (NRF_ERROR_BASE_NUM + 19) ///< Not enough resources for operation
-
-#ifdef __cplusplus
-}
-#endif
-#endif // NRF_ERROR_H__
-
-/**
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_error_sdm.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_error_sdm.h
deleted file mode 100755
index 530959b9..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_error_sdm.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2012 - 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, 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.
- */
-
- /**
- @addtogroup nrf_sdm_api
- @{
- @defgroup nrf_sdm_error SoftDevice Manager Error Codes
- @{
-
- @brief Error definitions for the SDM API
-*/
-
-/* Header guard */
-#ifndef NRF_ERROR_SDM_H__
-#define NRF_ERROR_SDM_H__
-
-#include "nrf_error.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN (NRF_ERROR_SDM_BASE_NUM + 0) ///< Unknown LFCLK source.
-#define NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION (NRF_ERROR_SDM_BASE_NUM + 1) ///< Incorrect interrupt configuration (can be caused by using illegal priority levels, or having enabled SoftDevice interrupts).
-#define NRF_ERROR_SDM_INCORRECT_CLENR0 (NRF_ERROR_SDM_BASE_NUM + 2) ///< Incorrect CLENR0 (can be caused by erroneous SoftDevice flashing).
-
-#ifdef __cplusplus
-}
-#endif
-#endif // NRF_ERROR_SDM_H__
-
-/**
- @}
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_error_soc.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_error_soc.h
deleted file mode 100755
index 1e784b8d..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_error_soc.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2012 - 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, 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.
- */
-
-/**
- @addtogroup nrf_soc_api
- @{
- @defgroup nrf_soc_error SoC Library Error Codes
- @{
-
- @brief Error definitions for the SoC library
-
-*/
-
-/* Header guard */
-#ifndef NRF_ERROR_SOC_H__
-#define NRF_ERROR_SOC_H__
-
-#include "nrf_error.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Mutex Errors */
-#define NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN (NRF_ERROR_SOC_BASE_NUM + 0) ///< Mutex already taken
-
-/* NVIC errors */
-#define NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE (NRF_ERROR_SOC_BASE_NUM + 1) ///< NVIC interrupt not available
-#define NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED (NRF_ERROR_SOC_BASE_NUM + 2) ///< NVIC interrupt priority not allowed
-#define NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN (NRF_ERROR_SOC_BASE_NUM + 3) ///< NVIC should not return
-
-/* Power errors */
-#define NRF_ERROR_SOC_POWER_MODE_UNKNOWN (NRF_ERROR_SOC_BASE_NUM + 4) ///< Power mode unknown
-#define NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN (NRF_ERROR_SOC_BASE_NUM + 5) ///< Power POF threshold unknown
-#define NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN (NRF_ERROR_SOC_BASE_NUM + 6) ///< Power off should not return
-
-/* Rand errors */
-#define NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES (NRF_ERROR_SOC_BASE_NUM + 7) ///< RAND not enough values
-
-/* PPI errors */
-#define NRF_ERROR_SOC_PPI_INVALID_CHANNEL (NRF_ERROR_SOC_BASE_NUM + 8) ///< Invalid PPI Channel
-#define NRF_ERROR_SOC_PPI_INVALID_GROUP (NRF_ERROR_SOC_BASE_NUM + 9) ///< Invalid PPI Group
-
-#ifdef __cplusplus
-}
-#endif
-#endif // NRF_ERROR_SOC_H__
-/**
- @}
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_nvic.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_nvic.h
deleted file mode 100755
index 1f79cc3c..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_nvic.h
+++ /dev/null
@@ -1,491 +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.
- */
-
-/**
- * @defgroup nrf_nvic_api SoftDevice NVIC API
- * @{
- *
- * @note In order to use this module, the following code has to be added to a .c file:
- * \code
- * nrf_nvic_state_t nrf_nvic_state = {0};
- * \endcode
- *
- * @note Definitions and declarations starting with __ (double underscore) in this header file are
- * not intended for direct use by the application.
- *
- * @brief APIs for the accessing NVIC when using a SoftDevice.
- *
- */
-
-#ifndef NRF_NVIC_H__
-#define NRF_NVIC_H__
-
-#include <stdint.h>
-#include "nrf.h"
-#include "nrf_svc.h"
-#include "nrf_error.h"
-#include "nrf_error_soc.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@addtogroup NRF_NVIC_DEFINES Defines
- * @{ */
-
-/**@defgroup NRF_NVIC_ISER_DEFINES SoftDevice NVIC internal definitions
- * @{ */
-
-#define __NRF_NVIC_NVMC_IRQn (30) /**< The peripheral ID of the NVMC. IRQ numbers are used to identify peripherals, but the NVMC doesn't have an IRQ number in the MDK. */
-
-#define __NRF_NVIC_ISER_COUNT (2) /**< The number of ISER/ICER registers in the NVIC that are used. */
-
-/**@brief Interrupt priority levels used by the SoftDevice. */
-#define __NRF_NVIC_SD_IRQ_PRIOS ((uint8_t)( \
- (1U << 0) /**< Priority level high .*/ \
- | (1U << 1) /**< Priority level medium. */ \
- | (1U << 4) /**< Priority level low. */ \
- ))
-
-/**@brief Interrupt priority levels available to the application. */
-#define __NRF_NVIC_APP_IRQ_PRIOS ((uint8_t)~__NRF_NVIC_SD_IRQ_PRIOS)
-
-/**@brief Interrupts used by the SoftDevice, with IRQn in the range 0-31. */
-#define __NRF_NVIC_SD_IRQS_0 ((uint32_t)( \
- (1U << POWER_CLOCK_IRQn) \
- | (1U << RADIO_IRQn) \
- | (1U << RTC0_IRQn) \
- | (1U << TIMER0_IRQn) \
- | (1U << RNG_IRQn) \
- | (1U << ECB_IRQn) \
- | (1U << CCM_AAR_IRQn) \
- | (1U << TEMP_IRQn) \
- | (1U << __NRF_NVIC_NVMC_IRQn) \
- | (1U << (uint32_t)SWI5_IRQn) \
- ))
-
-/**@brief Interrupts used by the SoftDevice, with IRQn in the range 32-63. */
-#define __NRF_NVIC_SD_IRQS_1 ((uint32_t)0)
-
-/**@brief Interrupts available for to application, with IRQn in the range 0-31. */
-#define __NRF_NVIC_APP_IRQS_0 (~__NRF_NVIC_SD_IRQS_0)
-
-/**@brief Interrupts available for to application, with IRQn in the range 32-63. */
-#define __NRF_NVIC_APP_IRQS_1 (~__NRF_NVIC_SD_IRQS_1)
-
-/**@} */
-
-/**@} */
-
-/**@addtogroup NRF_NVIC_VARIABLES Variables
- * @{ */
-
-/**@brief Type representing the state struct for the SoftDevice NVIC module. */
-typedef struct
-{
- uint32_t volatile __irq_masks[__NRF_NVIC_ISER_COUNT]; /**< IRQs enabled by the application in the NVIC. */
- uint32_t volatile __cr_flag; /**< Non-zero if already in a critical region */
-} nrf_nvic_state_t;
-
-/**@brief Variable keeping the state for the SoftDevice NVIC module. This must be declared in an
- * application source file. */
-extern nrf_nvic_state_t nrf_nvic_state;
-
-/**@} */
-
-/**@addtogroup NRF_NVIC_INTERNAL_FUNCTIONS SoftDevice NVIC internal functions
- * @{ */
-
-/**@brief Disables IRQ interrupts globally, including the SoftDevice's interrupts.
- *
- * @retval The value of PRIMASK prior to disabling the interrupts.
- */
-__STATIC_INLINE int __sd_nvic_irq_disable(void);
-
-/**@brief Enables IRQ interrupts globally, including the SoftDevice's interrupts.
- */
-__STATIC_INLINE void __sd_nvic_irq_enable(void);
-
-/**@brief Checks if IRQn is available to application
- * @param[in] IRQn IRQ to check
- *
- * @retval 1 (true) if the IRQ to check is available to the application
- */
-__STATIC_INLINE uint32_t __sd_nvic_app_accessible_irq(IRQn_Type IRQn);
-
-/**@brief Checks if priority is available to application
- * @param[in] priority priority to check
- *
- * @retval 1 (true) if the priority to check is available to the application
- */
-__STATIC_INLINE uint32_t __sd_nvic_is_app_accessible_priority(uint32_t priority);
-
-/**@} */
-
-/**@addtogroup NRF_NVIC_FUNCTIONS SoftDevice NVIC public functions
- * @{ */
-
-/**@brief Enable External Interrupt.
- * @note Corresponds to NVIC_EnableIRQ in CMSIS.
- *
- * @pre IRQn is valid and not reserved by the stack.
- *
- * @param[in] IRQn See the NVIC_EnableIRQ documentation in CMSIS.
- *
- * @retval ::NRF_SUCCESS The interrupt was enabled.
- * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE The interrupt is not available for the application.
- * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED The interrupt has a priority not available for the application.
- */
-__STATIC_INLINE uint32_t sd_nvic_EnableIRQ(IRQn_Type IRQn);
-
-/**@brief Disable External Interrupt.
- * @note Corresponds to NVIC_DisableIRQ in CMSIS.
- *
- * @pre IRQn is valid and not reserved by the stack.
- *
- * @param[in] IRQn See the NVIC_DisableIRQ documentation in CMSIS.
- *
- * @retval ::NRF_SUCCESS The interrupt was disabled.
- * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE The interrupt is not available for the application.
- */
-__STATIC_INLINE uint32_t sd_nvic_DisableIRQ(IRQn_Type IRQn);
-
-/**@brief Get Pending Interrupt.
- * @note Corresponds to NVIC_GetPendingIRQ in CMSIS.
- *
- * @pre IRQn is valid and not reserved by the stack.
- *
- * @param[in] IRQn See the NVIC_GetPendingIRQ documentation in CMSIS.
- * @param[out] p_pending_irq Return value from NVIC_GetPendingIRQ.
- *
- * @retval ::NRF_SUCCESS The interrupt is available for the application.
- * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application.
- */
-__STATIC_INLINE uint32_t sd_nvic_GetPendingIRQ(IRQn_Type IRQn, uint32_t * p_pending_irq);
-
-/**@brief Set Pending Interrupt.
- * @note Corresponds to NVIC_SetPendingIRQ in CMSIS.
- *
- * @pre IRQn is valid and not reserved by the stack.
- *
- * @param[in] IRQn See the NVIC_SetPendingIRQ documentation in CMSIS.
- *
- * @retval ::NRF_SUCCESS The interrupt is set pending.
- * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application.
- */
-__STATIC_INLINE uint32_t sd_nvic_SetPendingIRQ(IRQn_Type IRQn);
-
-/**@brief Clear Pending Interrupt.
- * @note Corresponds to NVIC_ClearPendingIRQ in CMSIS.
- *
- * @pre IRQn is valid and not reserved by the stack.
- *
- * @param[in] IRQn See the NVIC_ClearPendingIRQ documentation in CMSIS.
- *
- * @retval ::NRF_SUCCESS The interrupt pending flag is cleared.
- * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application.
- */
-__STATIC_INLINE uint32_t sd_nvic_ClearPendingIRQ(IRQn_Type IRQn);
-
-/**@brief Set Interrupt Priority.
- * @note Corresponds to NVIC_SetPriority in CMSIS.
- *
- * @pre IRQn is valid and not reserved by the stack.
- * @pre Priority is valid and not reserved by the stack.
- *
- * @param[in] IRQn See the NVIC_SetPriority documentation in CMSIS.
- * @param[in] priority A valid IRQ priority for use by the application.
- *
- * @retval ::NRF_SUCCESS The interrupt and priority level is available for the application.
- * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application.
- * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED The interrupt priority is not available for the application.
- */
-__STATIC_INLINE uint32_t sd_nvic_SetPriority(IRQn_Type IRQn, uint32_t priority);
-
-/**@brief Get Interrupt Priority.
- * @note Corresponds to NVIC_GetPriority in CMSIS.
- *
- * @pre IRQn is valid and not reserved by the stack.
- *
- * @param[in] IRQn See the NVIC_GetPriority documentation in CMSIS.
- * @param[out] p_priority Return value from NVIC_GetPriority.
- *
- * @retval ::NRF_SUCCESS The interrupt priority is returned in p_priority.
- * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE - IRQn is not available for the application.
- */
-__STATIC_INLINE uint32_t sd_nvic_GetPriority(IRQn_Type IRQn, uint32_t * p_priority);
-
-/**@brief System Reset.
- * @note Corresponds to NVIC_SystemReset in CMSIS.
- *
- * @retval ::NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN
- */
-__STATIC_INLINE uint32_t sd_nvic_SystemReset(void);
-
-/**@brief Enter critical region.
- *
- * @post Application interrupts will be disabled.
- * @note sd_nvic_critical_region_enter() and ::sd_nvic_critical_region_exit() must be called in matching pairs inside each
- * execution context
- * @sa sd_nvic_critical_region_exit
- *
- * @param[out] p_is_nested_critical_region If 1, the application is now in a nested critical region.
- *
- * @retval ::NRF_SUCCESS
- */
-__STATIC_INLINE uint32_t sd_nvic_critical_region_enter(uint8_t * p_is_nested_critical_region);
-
-/**@brief Exit critical region.
- *
- * @pre Application has entered a critical region using ::sd_nvic_critical_region_enter.
- * @post If not in a nested critical region, the application interrupts will restored to the state before ::sd_nvic_critical_region_enter was called.
- *
- * @param[in] is_nested_critical_region If this is set to 1, the critical region won't be exited. @sa sd_nvic_critical_region_enter.
- *
- * @retval ::NRF_SUCCESS
- */
-__STATIC_INLINE uint32_t sd_nvic_critical_region_exit(uint8_t is_nested_critical_region);
-
-/**@} */
-
-#ifndef SUPPRESS_INLINE_IMPLEMENTATION
-
-__STATIC_INLINE int __sd_nvic_irq_disable(void)
-{
- int pm = __get_PRIMASK();
- __disable_irq();
- return pm;
-}
-
-__STATIC_INLINE void __sd_nvic_irq_enable(void)
-{
- __enable_irq();
-}
-
-__STATIC_INLINE uint32_t __sd_nvic_app_accessible_irq(IRQn_Type IRQn)
-{
- if (IRQn < 32)
- {
- return ((1UL<<IRQn) & __NRF_NVIC_APP_IRQS_0) != 0;
- }
- else if (IRQn < 64)
- {
- return ((1UL<<(IRQn-32)) & __NRF_NVIC_APP_IRQS_1) != 0;
- }
- else
- {
- return 1;
- }
-}
-
-__STATIC_INLINE uint32_t __sd_nvic_is_app_accessible_priority(uint32_t priority)
-{
- if( (priority >= (1 << __NVIC_PRIO_BITS))
- || (((1 << priority) & __NRF_NVIC_APP_IRQ_PRIOS) == 0)
- )
- {
- return 0;
- }
- return 1;
-}
-
-
-__STATIC_INLINE uint32_t sd_nvic_EnableIRQ(IRQn_Type IRQn)
-{
- if (!__sd_nvic_app_accessible_irq(IRQn))
- {
- return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE;
- }
- if (!__sd_nvic_is_app_accessible_priority(NVIC_GetPriority(IRQn)))
- {
- return NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED;
- }
-
- if (nrf_nvic_state.__cr_flag)
- {
- nrf_nvic_state.__irq_masks[(uint32_t)((int32_t)IRQn) >> 5] |= (uint32_t)(1 << ((uint32_t)((int32_t)IRQn) & (uint32_t)0x1F));
- }
- else
- {
- NVIC_EnableIRQ(IRQn);
- }
- return NRF_SUCCESS;
-}
-
-__STATIC_INLINE uint32_t sd_nvic_DisableIRQ(IRQn_Type IRQn)
-{
- if (!__sd_nvic_app_accessible_irq(IRQn))
- {
- return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE;
- }
-
- if (nrf_nvic_state.__cr_flag)
- {
- nrf_nvic_state.__irq_masks[(uint32_t)((int32_t)IRQn) >> 5] &= ~(1UL << ((uint32_t)(IRQn) & 0x1F));
- }
- else
- {
- NVIC_DisableIRQ(IRQn);
- }
-
- return NRF_SUCCESS;
-}
-
-__STATIC_INLINE uint32_t sd_nvic_GetPendingIRQ(IRQn_Type IRQn, uint32_t * p_pending_irq)
-{
- if (__sd_nvic_app_accessible_irq(IRQn))
- {
- *p_pending_irq = NVIC_GetPendingIRQ(IRQn);
- return NRF_SUCCESS;
- }
- else
- {
- return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE;
- }
-}
-
-__STATIC_INLINE uint32_t sd_nvic_SetPendingIRQ(IRQn_Type IRQn)
-{
- if (__sd_nvic_app_accessible_irq(IRQn))
- {
- NVIC_SetPendingIRQ(IRQn);
- return NRF_SUCCESS;
- }
- else
- {
- return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE;
- }
-}
-
-__STATIC_INLINE uint32_t sd_nvic_ClearPendingIRQ(IRQn_Type IRQn)
-{
- if (__sd_nvic_app_accessible_irq(IRQn))
- {
- NVIC_ClearPendingIRQ(IRQn);
- return NRF_SUCCESS;
- }
- else
- {
- return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE;
- }
-}
-
-__STATIC_INLINE uint32_t sd_nvic_SetPriority(IRQn_Type IRQn, uint32_t priority)
-{
- if (!__sd_nvic_app_accessible_irq(IRQn))
- {
- return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE;
- }
-
- if (!__sd_nvic_is_app_accessible_priority(priority))
- {
- return NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED;
- }
-
- NVIC_SetPriority(IRQn, (uint32_t)priority);
- return NRF_SUCCESS;
-}
-
-__STATIC_INLINE uint32_t sd_nvic_GetPriority(IRQn_Type IRQn, uint32_t * p_priority)
-{
- if (__sd_nvic_app_accessible_irq(IRQn))
- {
- *p_priority = (NVIC_GetPriority(IRQn) & 0xFF);
- return NRF_SUCCESS;
- }
- else
- {
- return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE;
- }
-}
-
-__STATIC_INLINE uint32_t sd_nvic_SystemReset(void)
-{
- NVIC_SystemReset();
- return NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN;
-}
-
-__STATIC_INLINE uint32_t sd_nvic_critical_region_enter(uint8_t * p_is_nested_critical_region)
-{
- int was_masked = __sd_nvic_irq_disable();
- if (!nrf_nvic_state.__cr_flag)
- {
- nrf_nvic_state.__cr_flag = 1;
- nrf_nvic_state.__irq_masks[0] = ( NVIC->ICER[0] & __NRF_NVIC_APP_IRQS_0 );
- NVIC->ICER[0] = __NRF_NVIC_APP_IRQS_0;
- nrf_nvic_state.__irq_masks[1] = ( NVIC->ICER[1] & __NRF_NVIC_APP_IRQS_1 );
- NVIC->ICER[1] = __NRF_NVIC_APP_IRQS_1;
- *p_is_nested_critical_region = 0;
- }
- else
- {
- *p_is_nested_critical_region = 1;
- }
- if (!was_masked)
- {
- __sd_nvic_irq_enable();
- }
- return NRF_SUCCESS;
-}
-
-__STATIC_INLINE uint32_t sd_nvic_critical_region_exit(uint8_t is_nested_critical_region)
-{
- if (nrf_nvic_state.__cr_flag && (is_nested_critical_region == 0))
- {
- int was_masked = __sd_nvic_irq_disable();
- NVIC->ISER[0] = nrf_nvic_state.__irq_masks[0];
- NVIC->ISER[1] = nrf_nvic_state.__irq_masks[1];
- nrf_nvic_state.__cr_flag = 0;
- if (!was_masked)
- {
- __sd_nvic_irq_enable();
- }
- }
-
- return NRF_SUCCESS;
-}
-
-#endif /* SUPPRESS_INLINE_IMPLEMENTATION */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NRF_NVIC_H__
-
-/**@} */
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_sdm.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_sdm.h
deleted file mode 100755
index 5dfbb287..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_sdm.h
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * Copyright (c) 2015 - 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.
- */
-
-/**
- @defgroup nrf_sdm_api SoftDevice Manager API
- @{
-
- @brief APIs for SoftDevice management.
-
-*/
-
-#ifndef NRF_SDM_H__
-#define NRF_SDM_H__
-
-#include <stdint.h>
-#include "nrf.h"
-#include "nrf_svc.h"
-#include "nrf_error.h"
-#include "nrf_error_sdm.h"
-#include "nrf_soc.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup NRF_SDM_DEFINES Defines
- * @{ */
-#ifdef NRFSOC_DOXYGEN
-/// Declared in nrf_mbr.h
-#define MBR_SIZE 0
-#warning test
-#endif
-
-/** @brief The major version for the SoftDevice binary distributed with this header file. */
-#define SD_MAJOR_VERSION (6)
-
-/** @brief The minor version for the SoftDevice binary distributed with this header file. */
-#define SD_MINOR_VERSION (1)
-
-/** @brief The bugfix version for the SoftDevice binary distributed with this header file. */
-#define SD_BUGFIX_VERSION (1)
-
-/** @brief The SoftDevice variant of this firmware. */
-#define SD_VARIANT_ID 140
-
-/** @brief The full version number for the SoftDevice binary this header file was distributed
- * with, as 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 SD_VERSION (SD_MAJOR_VERSION * 1000000 + SD_MINOR_VERSION * 1000 + SD_BUGFIX_VERSION)
-
-/** @brief SoftDevice Manager SVC Base number. */
-#define SDM_SVC_BASE 0x10
-
-/** @brief SoftDevice unique string size in bytes. */
-#define SD_UNIQUE_STR_SIZE 20
-
-/** @brief Invalid info field. Returned when an info field does not exist. */
-#define SDM_INFO_FIELD_INVALID (0)
-
-/** @brief Defines the SoftDevice Information Structure location (address) as an offset from
-the start of the SoftDevice (without MBR)*/
-#define SOFTDEVICE_INFO_STRUCT_OFFSET (0x2000)
-
-/** @brief Defines the absolute SoftDevice Information Structure location (address) when the
- * SoftDevice is installed just above the MBR (the usual case). */
-#define SOFTDEVICE_INFO_STRUCT_ADDRESS (SOFTDEVICE_INFO_STRUCT_OFFSET + MBR_SIZE)
-
-/** @brief Defines the offset for the SoftDevice Information Structure size value relative to the
- * SoftDevice base address. The size value is of type uint8_t. */
-#define SD_INFO_STRUCT_SIZE_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET)
-
-/** @brief Defines the offset for the SoftDevice size value relative to the SoftDevice base address.
- * The size value is of type uint32_t. */
-#define SD_SIZE_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x08)
-
-/** @brief Defines the offset for FWID value relative to the SoftDevice base address. The FWID value
- * is of type uint16_t. */
-#define SD_FWID_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x0C)
-
-/** @brief Defines the offset for the SoftDevice ID relative to the SoftDevice base address. The ID
- * is of type uint32_t. */
-#define SD_ID_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x10)
-
-/** @brief Defines the offset for the SoftDevice version relative to the SoftDevice base address in
- * the same format as @ref SD_VERSION, stored as an uint32_t. */
-#define SD_VERSION_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x14)
-
-/** @brief Defines the offset for the SoftDevice unique string relative to the SoftDevice base address.
- * The SD_UNIQUE_STR is stored as an array of uint8_t. The size of array is @ref SD_UNIQUE_STR_SIZE.
- */
-#define SD_UNIQUE_STR_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x18)
-
-/** @brief Defines a macro for retrieving the actual SoftDevice Information Structure size value
- * from a given base address. Use @ref MBR_SIZE as the argument when the SoftDevice is
- * installed just above the MBR (the usual case). */
-#define SD_INFO_STRUCT_SIZE_GET(baseaddr) (*((uint8_t *) ((baseaddr) + SD_INFO_STRUCT_SIZE_OFFSET)))
-
-/** @brief Defines a macro for retrieving the actual SoftDevice size value from a given base
- * address. Use @ref MBR_SIZE as the argument when the SoftDevice is installed just above
- * the MBR (the usual case). */
-#define SD_SIZE_GET(baseaddr) (*((uint32_t *) ((baseaddr) + SD_SIZE_OFFSET)))
-
-/** @brief Defines the amount of flash that is used by the SoftDevice.
- * Add @ref MBR_SIZE to find the first available flash address when the SoftDevice is installed
- * just above the MBR (the usual case).
- */
-#define SD_FLASH_SIZE 0x25000
-
-/** @brief Defines a macro for retrieving the actual FWID value from a given base address. Use
- * @ref MBR_SIZE as the argument when the SoftDevice is installed just above the MBR (the usual
- * case). */
-#define SD_FWID_GET(baseaddr) (*((uint16_t *) ((baseaddr) + SD_FWID_OFFSET)))
-
-/** @brief Defines a macro for retrieving the actual SoftDevice ID from a given base address. Use
- * @ref MBR_SIZE as the argument when the SoftDevice is installed just above the MBR (the
- * usual case). */
-#define SD_ID_GET(baseaddr) ((SD_INFO_STRUCT_SIZE_GET(baseaddr) > (SD_ID_OFFSET - SOFTDEVICE_INFO_STRUCT_OFFSET)) \
- ? (*((uint32_t *) ((baseaddr) + SD_ID_OFFSET))) : SDM_INFO_FIELD_INVALID)
-
-/** @brief Defines a macro for retrieving the actual SoftDevice version from a given base address.
- * Use @ref MBR_SIZE as the argument when the SoftDevice is installed just above the MBR
- * (the usual case). */
-#define SD_VERSION_GET(baseaddr) ((SD_INFO_STRUCT_SIZE_GET(baseaddr) > (SD_VERSION_OFFSET - SOFTDEVICE_INFO_STRUCT_OFFSET)) \
- ? (*((uint32_t *) ((baseaddr) + SD_VERSION_OFFSET))) : SDM_INFO_FIELD_INVALID)
-
-/** @brief Defines a macro for retrieving the address of SoftDevice unique str based on a given base address.
- * Use @ref MBR_SIZE as the argument when the SoftDevice is installed just above the MBR
- * (the usual case). */
-#define SD_UNIQUE_STR_ADDR_GET(baseaddr) ((SD_INFO_STRUCT_SIZE_GET(baseaddr) > (SD_UNIQUE_STR_OFFSET - SOFTDEVICE_INFO_STRUCT_OFFSET)) \
- ? (((uint8_t *) ((baseaddr) + SD_UNIQUE_STR_OFFSET))) : SDM_INFO_FIELD_INVALID)
-
-/**@defgroup NRF_FAULT_ID_RANGES Fault ID ranges
- * @{ */
-#define NRF_FAULT_ID_SD_RANGE_START 0x00000000 /**< SoftDevice ID range start. */
-#define NRF_FAULT_ID_APP_RANGE_START 0x00001000 /**< Application ID range start. */
-/**@} */
-
-/**@defgroup NRF_FAULT_IDS Fault ID types
- * @{ */
-#define NRF_FAULT_ID_SD_ASSERT (NRF_FAULT_ID_SD_RANGE_START + 1) /**< SoftDevice assertion. The info parameter is reserved for future used. */
-#define NRF_FAULT_ID_APP_MEMACC (NRF_FAULT_ID_APP_RANGE_START + 1) /**< Application invalid memory access. The info parameter will contain 0x00000000,
- in case of SoftDevice RAM access violation. In case of SoftDevice peripheral
- register violation the info parameter will contain the sub-region number of
- PREGION[0], on whose address range the disallowed write access caused the
- memory access fault. */
-/**@} */
-
-/** @} */
-
-/** @addtogroup NRF_SDM_ENUMS Enumerations
- * @{ */
-
-/**@brief nRF SoftDevice Manager API SVC numbers. */
-enum NRF_SD_SVCS
-{
- SD_SOFTDEVICE_ENABLE = SDM_SVC_BASE, /**< ::sd_softdevice_enable */
- SD_SOFTDEVICE_DISABLE, /**< ::sd_softdevice_disable */
- SD_SOFTDEVICE_IS_ENABLED, /**< ::sd_softdevice_is_enabled */
- SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET, /**< ::sd_softdevice_vector_table_base_set */
- SVC_SDM_LAST /**< Placeholder for last SDM SVC */
-};
-
-/** @} */
-
-/** @addtogroup NRF_SDM_DEFINES Defines
- * @{ */
-
-/**@defgroup NRF_CLOCK_LF_ACCURACY Clock accuracy
- * @{ */
-
-#define NRF_CLOCK_LF_ACCURACY_250_PPM (0) /**< Default: 250 ppm */
-#define NRF_CLOCK_LF_ACCURACY_500_PPM (1) /**< 500 ppm */
-#define NRF_CLOCK_LF_ACCURACY_150_PPM (2) /**< 150 ppm */
-#define NRF_CLOCK_LF_ACCURACY_100_PPM (3) /**< 100 ppm */
-#define NRF_CLOCK_LF_ACCURACY_75_PPM (4) /**< 75 ppm */
-#define NRF_CLOCK_LF_ACCURACY_50_PPM (5) /**< 50 ppm */
-#define NRF_CLOCK_LF_ACCURACY_30_PPM (6) /**< 30 ppm */
-#define NRF_CLOCK_LF_ACCURACY_20_PPM (7) /**< 20 ppm */
-#define NRF_CLOCK_LF_ACCURACY_10_PPM (8) /**< 10 ppm */
-#define NRF_CLOCK_LF_ACCURACY_5_PPM (9) /**< 5 ppm */
-#define NRF_CLOCK_LF_ACCURACY_2_PPM (10) /**< 2 ppm */
-#define NRF_CLOCK_LF_ACCURACY_1_PPM (11) /**< 1 ppm */
-
-/** @} */
-
-/**@defgroup NRF_CLOCK_LF_SRC Possible LFCLK oscillator sources
- * @{ */
-
-#define NRF_CLOCK_LF_SRC_RC (0) /**< LFCLK RC oscillator. */
-#define NRF_CLOCK_LF_SRC_XTAL (1) /**< LFCLK crystal oscillator. */
-#define NRF_CLOCK_LF_SRC_SYNTH (2) /**< LFCLK Synthesized from HFCLK. */
-
-/** @} */
-
-/** @} */
-
-/** @addtogroup NRF_SDM_TYPES Types
- * @{ */
-
-/**@brief Type representing LFCLK oscillator source. */
-typedef struct
-{
- uint8_t source; /**< LF oscillator clock source, see @ref NRF_CLOCK_LF_SRC. */
- uint8_t rc_ctiv; /**< Only for ::NRF_CLOCK_LF_SRC_RC: Calibration timer interval in 1/4 second
- units (nRF52: 1-32).
- @note To avoid excessive clock drift, 0.5 degrees Celsius is the
- maximum temperature change allowed in one calibration timer
- interval. The interval should be selected to ensure this.
-
- @note Must be 0 if source is not ::NRF_CLOCK_LF_SRC_RC. */
- uint8_t rc_temp_ctiv; /**< Only for ::NRF_CLOCK_LF_SRC_RC: How often (in number of calibration
- intervals) the RC oscillator shall be calibrated if the temperature
- hasn't changed.
- 0: Always calibrate even if the temperature hasn't changed.
- 1: Only calibrate if the temperature has changed (legacy - nRF51 only).
- 2-33: Check the temperature and only calibrate if it has changed,
- however calibration will take place every rc_temp_ctiv
- intervals in any case.
-
- @note Must be 0 if source is not ::NRF_CLOCK_LF_SRC_RC.
-
- @note For nRF52, the application must ensure calibration at least once
- every 8 seconds to ensure +/-500 ppm clock stability. The
- recommended configuration for ::NRF_CLOCK_LF_SRC_RC on nRF52 is
- rc_ctiv=16 and rc_temp_ctiv=2. This will ensure calibration at
- least once every 8 seconds and for temperature changes of 0.5
- degrees Celsius every 4 seconds. See the Product Specification
- for the nRF52 device being used for more information.*/
- uint8_t accuracy; /**< External clock accuracy used in the LL to compute timing
- windows, see @ref NRF_CLOCK_LF_ACCURACY.*/
-} nrf_clock_lf_cfg_t;
-
-/**@brief Fault Handler type.
- *
- * When certain unrecoverable errors occur within the application or SoftDevice the fault handler will be called back.
- * The protocol stack will be in an undefined state when this happens and the only way to recover will be to
- * perform a reset, using e.g. CMSIS NVIC_SystemReset().
- * If the application returns from the fault handler the SoftDevice will call NVIC_SystemReset().
- *
- * @note This callback is executed in HardFault context, thus SVC functions cannot be called from the fault callback.
- *
- * @param[in] id Fault identifier. See @ref NRF_FAULT_IDS.
- * @param[in] pc The program counter of the instruction that triggered the fault.
- * @param[in] info Optional additional information regarding the fault. Refer to each Fault identifier for details.
- *
- * @note When id is set to @ref NRF_FAULT_ID_APP_MEMACC, pc will contain the address of the instruction being executed at the time when
- * the fault is detected by the CPU. The CPU program counter may have advanced up to 2 instructions (no branching) after the one that triggered the fault.
- */
-typedef void (*nrf_fault_handler_t)(uint32_t id, uint32_t pc, uint32_t info);
-
-/** @} */
-
-/** @addtogroup NRF_SDM_FUNCTIONS Functions
- * @{ */
-
-/**@brief Enables the SoftDevice and by extension the protocol stack.
- *
- * @note Some care must be taken if a low frequency clock source is already running when calling this function:
- * If the LF clock has a different source then the one currently running, it will be stopped. Then, the new
- * clock source will be started.
- *
- * @note This function has no effect when returning with an error.
- *
- * @post If return code is ::NRF_SUCCESS
- * - SoC library and protocol stack APIs are made available.
- * - A portion of RAM will be unavailable (see relevant SDS documentation).
- * - Some peripherals will be unavailable or available only through the SoC API (see relevant SDS documentation).
- * - Interrupts will not arrive from protected peripherals or interrupts.
- * - nrf_nvic_ functions must be used instead of CMSIS NVIC_ functions for reliable usage of the SoftDevice.
- * - Interrupt latency may be affected by the SoftDevice (see relevant SDS documentation).
- * - Chosen low frequency clock source will be running.
- *
- * @param p_clock_lf_cfg Low frequency clock source and accuracy.
- If NULL the clock will be configured as an RC source with rc_ctiv = 16 and .rc_temp_ctiv = 2
- In the case of XTAL source, the PPM accuracy of the chosen clock source must be greater than or equal to the actual characteristics of your XTAL clock.
- * @param fault_handler Callback to be invoked in case of fault, cannot be NULL.
- *
- * @retval ::NRF_SUCCESS
- * @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied.
- * @retval ::NRF_ERROR_INVALID_STATE SoftDevice is already enabled, and the clock source and fault handler cannot be updated.
- * @retval ::NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION SoftDevice interrupt is already enabled, or an enabled interrupt has an illegal priority level.
- * @retval ::NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN Unknown low frequency clock source selected.
- * @retval ::NRF_ERROR_INVALID_PARAM Invalid clock source configuration supplied in p_clock_lf_cfg.
- */
-SVCALL(SD_SOFTDEVICE_ENABLE, uint32_t, sd_softdevice_enable(nrf_clock_lf_cfg_t const * p_clock_lf_cfg, nrf_fault_handler_t fault_handler));
-
-
-/**@brief Disables the SoftDevice and by extension the protocol stack.
- *
- * Idempotent function to disable the SoftDevice.
- *
- * @post SoC library and protocol stack APIs are made unavailable.
- * @post All interrupts that was protected by the SoftDevice will be disabled and initialized to priority 0 (highest).
- * @post All peripherals used by the SoftDevice will be reset to default values.
- * @post All of RAM become available.
- * @post All interrupts are forwarded to the application.
- * @post LFCLK source chosen in ::sd_softdevice_enable will be left running.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_SOFTDEVICE_DISABLE, uint32_t, sd_softdevice_disable(void));
-
-/**@brief Check if the SoftDevice is enabled.
- *
- * @param[out] p_softdevice_enabled If the SoftDevice is enabled: 1 else 0.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_SOFTDEVICE_IS_ENABLED, uint32_t, sd_softdevice_is_enabled(uint8_t * p_softdevice_enabled));
-
-/**@brief Sets the base address of the interrupt vector table for interrupts forwarded from the SoftDevice
- *
- * This function is only intended to be called when a bootloader is enabled.
- *
- * @param[in] address The base address of the interrupt vector table for forwarded interrupts.
-
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET, uint32_t, sd_softdevice_vector_table_base_set(uint32_t address));
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-#endif // NRF_SDM_H__
-
-/**
- @}
-*/
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_soc.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_soc.h
deleted file mode 100755
index beb4d3a5..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_soc.h
+++ /dev/null
@@ -1,1079 +0,0 @@
-/*
- * Copyright (c) 2015 - 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.
- */
-
-/**
- * @defgroup nrf_soc_api SoC Library API
- * @{
- *
- * @brief APIs for the SoC library.
- *
- */
-
-#ifndef NRF_SOC_H__
-#define NRF_SOC_H__
-
-#include <stdint.h>
-#include "nrf.h"
-#include "nrf_svc.h"
-#include "nrf_error.h"
-#include "nrf_error_soc.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@addtogroup NRF_SOC_DEFINES Defines
- * @{ */
-
-/**@brief The number of the lowest SVC number reserved for the SoC library. */
-#define SOC_SVC_BASE (0x20) /**< Base value for SVCs that are available when the SoftDevice is disabled. */
-#define SOC_SVC_BASE_NOT_AVAILABLE (0x2C) /**< Base value for SVCs that are not available when the SoftDevice is disabled. */
-
-/**@brief Guaranteed time for application to process radio inactive notification. */
-#define NRF_RADIO_NOTIFICATION_INACTIVE_GUARANTEED_TIME_US (62)
-
-/**@brief The minimum allowed timeslot extension time. */
-#define NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US (200)
-
-/**@brief The maximum processing time to handle a timeslot extension. */
-#define NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US (17)
-
-/**@brief The latest time before the end of a timeslot the timeslot can be extended. */
-#define NRF_RADIO_MIN_EXTENSION_MARGIN_US (79)
-
-#define SOC_ECB_KEY_LENGTH (16) /**< ECB key length. */
-#define SOC_ECB_CLEARTEXT_LENGTH (16) /**< ECB cleartext length. */
-#define SOC_ECB_CIPHERTEXT_LENGTH (SOC_ECB_CLEARTEXT_LENGTH) /**< ECB ciphertext length. */
-
-#define SD_EVT_IRQn (SWI2_IRQn) /**< SoftDevice Event IRQ number. Used for both protocol events and SoC events. */
-#define SD_EVT_IRQHandler (SWI2_IRQHandler) /**< SoftDevice Event IRQ handler. Used for both protocol events and SoC events.
- The default interrupt priority for this handler is set to 6 */
-#define RADIO_NOTIFICATION_IRQn (SWI1_IRQn) /**< The radio notification IRQ number. */
-#define RADIO_NOTIFICATION_IRQHandler (SWI1_IRQHandler) /**< The radio notification IRQ handler.
- The default interrupt priority for this handler is set to 6 */
-#define NRF_RADIO_LENGTH_MIN_US (100) /**< The shortest allowed radio timeslot, in microseconds. */
-#define NRF_RADIO_LENGTH_MAX_US (100000) /**< The longest allowed radio timeslot, in microseconds. */
-
-#define NRF_RADIO_DISTANCE_MAX_US (128000000UL - 1UL) /**< The longest timeslot distance, in microseconds, allowed for the distance parameter (see @ref nrf_radio_request_normal_t) in the request. */
-
-#define NRF_RADIO_EARLIEST_TIMEOUT_MAX_US (128000000UL - 1UL) /**< The longest timeout, in microseconds, allowed when requesting the earliest possible timeslot. */
-
-#define NRF_RADIO_START_JITTER_US (2) /**< The maximum jitter in @ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START relative to the requested start time. */
-
-/**@brief Mask of PPI channels reserved by the SoftDevice when the SoftDevice is disabled. */
-#define NRF_SOC_SD_PPI_CHANNELS_SD_DISABLED_MSK ((uint32_t)(0))
-
-/**@brief Mask of PPI channels reserved by the SoftDevice when the SoftDevice is enabled. */
-#define NRF_SOC_SD_PPI_CHANNELS_SD_ENABLED_MSK ((uint32_t)( \
- (1U << 17) \
- | (1U << 18) \
- | (1U << 19) \
- | (1U << 20) \
- | (1U << 21) \
- | (1U << 22) \
- | (1U << 23) \
- | (1U << 24) \
- | (1U << 25) \
- | (1U << 26) \
- | (1U << 27) \
- | (1U << 28) \
- | (1U << 29) \
- | (1U << 30) \
- | (1U << 31) \
- ))
-
-/**@brief Mask of PPI channels available to the application when the SoftDevice is disabled. */
-#define NRF_SOC_APP_PPI_CHANNELS_SD_DISABLED_MSK (~NRF_SOC_SD_PPI_CHANNELS_SD_DISABLED_MSK)
-
-/**@brief Mask of PPI channels available to the application when the SoftDevice is enabled. */
-#define NRF_SOC_APP_PPI_CHANNELS_SD_ENABLED_MSK (~NRF_SOC_SD_PPI_CHANNELS_SD_ENABLED_MSK)
-
-/**@brief Mask of PPI groups reserved by the SoftDevice when the SoftDevice is disabled. */
-#define NRF_SOC_SD_PPI_GROUPS_SD_DISABLED_MSK ((uint32_t)(0))
-
-/**@brief Mask of PPI groups reserved by the SoftDevice when the SoftDevice is enabled. */
-#define NRF_SOC_SD_PPI_GROUPS_SD_ENABLED_MSK ((uint32_t)( \
- (1U << 4) \
- | (1U << 5) \
- ))
-
-/**@brief Mask of PPI groups available to the application when the SoftDevice is disabled. */
-#define NRF_SOC_APP_PPI_GROUPS_SD_DISABLED_MSK (~NRF_SOC_SD_PPI_GROUPS_SD_DISABLED_MSK)
-
-/**@brief Mask of PPI groups available to the application when the SoftDevice is enabled. */
-#define NRF_SOC_APP_PPI_GROUPS_SD_ENABLED_MSK (~NRF_SOC_SD_PPI_GROUPS_SD_ENABLED_MSK)
-
-/**@} */
-
-/**@addtogroup NRF_SOC_ENUMS Enumerations
- * @{ */
-
-/**@brief The SVC numbers used by the SVC functions in the SoC library. */
-enum NRF_SOC_SVCS
-{
- SD_PPI_CHANNEL_ENABLE_GET = SOC_SVC_BASE,
- SD_PPI_CHANNEL_ENABLE_SET = SOC_SVC_BASE + 1,
- SD_PPI_CHANNEL_ENABLE_CLR = SOC_SVC_BASE + 2,
- SD_PPI_CHANNEL_ASSIGN = SOC_SVC_BASE + 3,
- SD_PPI_GROUP_TASK_ENABLE = SOC_SVC_BASE + 4,
- SD_PPI_GROUP_TASK_DISABLE = SOC_SVC_BASE + 5,
- SD_PPI_GROUP_ASSIGN = SOC_SVC_BASE + 6,
- SD_PPI_GROUP_GET = SOC_SVC_BASE + 7,
- SD_FLASH_PAGE_ERASE = SOC_SVC_BASE + 8,
- SD_FLASH_WRITE = SOC_SVC_BASE + 9,
- SD_PROTECTED_REGISTER_WRITE = SOC_SVC_BASE + 11,
- SD_MUTEX_NEW = SOC_SVC_BASE_NOT_AVAILABLE,
- SD_MUTEX_ACQUIRE = SOC_SVC_BASE_NOT_AVAILABLE + 1,
- SD_MUTEX_RELEASE = SOC_SVC_BASE_NOT_AVAILABLE + 2,
- SD_RAND_APPLICATION_POOL_CAPACITY_GET = SOC_SVC_BASE_NOT_AVAILABLE + 3,
- SD_RAND_APPLICATION_BYTES_AVAILABLE_GET = SOC_SVC_BASE_NOT_AVAILABLE + 4,
- SD_RAND_APPLICATION_VECTOR_GET = SOC_SVC_BASE_NOT_AVAILABLE + 5,
- SD_POWER_MODE_SET = SOC_SVC_BASE_NOT_AVAILABLE + 6,
- SD_POWER_SYSTEM_OFF = SOC_SVC_BASE_NOT_AVAILABLE + 7,
- SD_POWER_RESET_REASON_GET = SOC_SVC_BASE_NOT_AVAILABLE + 8,
- SD_POWER_RESET_REASON_CLR = SOC_SVC_BASE_NOT_AVAILABLE + 9,
- SD_POWER_POF_ENABLE = SOC_SVC_BASE_NOT_AVAILABLE + 10,
- SD_POWER_POF_THRESHOLD_SET = SOC_SVC_BASE_NOT_AVAILABLE + 11,
- SD_POWER_POF_THRESHOLDVDDH_SET = SOC_SVC_BASE_NOT_AVAILABLE + 12,
- SD_POWER_RAM_POWER_SET = SOC_SVC_BASE_NOT_AVAILABLE + 13,
- SD_POWER_RAM_POWER_CLR = SOC_SVC_BASE_NOT_AVAILABLE + 14,
- SD_POWER_RAM_POWER_GET = SOC_SVC_BASE_NOT_AVAILABLE + 15,
- SD_POWER_GPREGRET_SET = SOC_SVC_BASE_NOT_AVAILABLE + 16,
- SD_POWER_GPREGRET_CLR = SOC_SVC_BASE_NOT_AVAILABLE + 17,
- SD_POWER_GPREGRET_GET = SOC_SVC_BASE_NOT_AVAILABLE + 18,
- SD_POWER_DCDC_MODE_SET = SOC_SVC_BASE_NOT_AVAILABLE + 19,
- SD_POWER_DCDC0_MODE_SET = SOC_SVC_BASE_NOT_AVAILABLE + 20,
- SD_APP_EVT_WAIT = SOC_SVC_BASE_NOT_AVAILABLE + 21,
- SD_CLOCK_HFCLK_REQUEST = SOC_SVC_BASE_NOT_AVAILABLE + 22,
- SD_CLOCK_HFCLK_RELEASE = SOC_SVC_BASE_NOT_AVAILABLE + 23,
- SD_CLOCK_HFCLK_IS_RUNNING = SOC_SVC_BASE_NOT_AVAILABLE + 24,
- SD_RADIO_NOTIFICATION_CFG_SET = SOC_SVC_BASE_NOT_AVAILABLE + 25,
- SD_ECB_BLOCK_ENCRYPT = SOC_SVC_BASE_NOT_AVAILABLE + 26,
- SD_ECB_BLOCKS_ENCRYPT = SOC_SVC_BASE_NOT_AVAILABLE + 27,
- SD_RADIO_SESSION_OPEN = SOC_SVC_BASE_NOT_AVAILABLE + 28,
- SD_RADIO_SESSION_CLOSE = SOC_SVC_BASE_NOT_AVAILABLE + 29,
- SD_RADIO_REQUEST = SOC_SVC_BASE_NOT_AVAILABLE + 30,
- SD_EVT_GET = SOC_SVC_BASE_NOT_AVAILABLE + 31,
- SD_TEMP_GET = SOC_SVC_BASE_NOT_AVAILABLE + 32,
- SD_POWER_USBPWRRDY_ENABLE = SOC_SVC_BASE_NOT_AVAILABLE + 33,
- SD_POWER_USBDETECTED_ENABLE = SOC_SVC_BASE_NOT_AVAILABLE + 34,
- SD_POWER_USBREMOVED_ENABLE = SOC_SVC_BASE_NOT_AVAILABLE + 35,
- SD_POWER_USBREGSTATUS_GET = SOC_SVC_BASE_NOT_AVAILABLE + 36,
- SVC_SOC_LAST = SOC_SVC_BASE_NOT_AVAILABLE + 37
-};
-
-/**@brief Possible values of a ::nrf_mutex_t. */
-enum NRF_MUTEX_VALUES
-{
- NRF_MUTEX_FREE,
- NRF_MUTEX_TAKEN
-};
-
-/**@brief Power modes. */
-enum NRF_POWER_MODES
-{
- NRF_POWER_MODE_CONSTLAT, /**< Constant latency mode. See power management in the reference manual. */
- NRF_POWER_MODE_LOWPWR /**< Low power mode. See power management in the reference manual. */
-};
-
-
-/**@brief Power failure thresholds */
-enum NRF_POWER_THRESHOLDS
-{
- NRF_POWER_THRESHOLD_V17 = 4UL, /**< 1.7 Volts power failure threshold. */
- NRF_POWER_THRESHOLD_V18, /**< 1.8 Volts power failure threshold. */
- NRF_POWER_THRESHOLD_V19, /**< 1.9 Volts power failure threshold. */
- NRF_POWER_THRESHOLD_V20, /**< 2.0 Volts power failure threshold. */
- NRF_POWER_THRESHOLD_V21, /**< 2.1 Volts power failure threshold. */
- NRF_POWER_THRESHOLD_V22, /**< 2.2 Volts power failure threshold. */
- NRF_POWER_THRESHOLD_V23, /**< 2.3 Volts power failure threshold. */
- NRF_POWER_THRESHOLD_V24, /**< 2.4 Volts power failure threshold. */
- NRF_POWER_THRESHOLD_V25, /**< 2.5 Volts power failure threshold. */
- NRF_POWER_THRESHOLD_V26, /**< 2.6 Volts power failure threshold. */
- NRF_POWER_THRESHOLD_V27, /**< 2.7 Volts power failure threshold. */
- NRF_POWER_THRESHOLD_V28 /**< 2.8 Volts power failure threshold. */
-};
-
-/**@brief Power failure thresholds for high voltage */
-enum NRF_POWER_THRESHOLDVDDHS
-{
- NRF_POWER_THRESHOLDVDDH_V27, /**< 2.7 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V28, /**< 2.8 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V29, /**< 2.9 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V30, /**< 3.0 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V31, /**< 3.1 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V32, /**< 3.2 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V33, /**< 3.3 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V34, /**< 3.4 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V35, /**< 3.5 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V36, /**< 3.6 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V37, /**< 3.7 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V38, /**< 3.8 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V39, /**< 3.9 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V40, /**< 4.0 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V41, /**< 4.1 Volts power failure threshold. */
- NRF_POWER_THRESHOLDVDDH_V42 /**< 4.2 Volts power failure threshold. */
-};
-
-
-/**@brief DC/DC converter modes. */
-enum NRF_POWER_DCDC_MODES
-{
- NRF_POWER_DCDC_DISABLE, /**< The DCDC is disabled. */
- NRF_POWER_DCDC_ENABLE /**< The DCDC is enabled. */
-};
-
-/**@brief Radio notification distances. */
-enum NRF_RADIO_NOTIFICATION_DISTANCES
-{
- NRF_RADIO_NOTIFICATION_DISTANCE_NONE = 0, /**< The event does not have a notification. */
- NRF_RADIO_NOTIFICATION_DISTANCE_800US, /**< The distance from the active notification to start of radio activity. */
- NRF_RADIO_NOTIFICATION_DISTANCE_1740US, /**< The distance from the active notification to start of radio activity. */
- NRF_RADIO_NOTIFICATION_DISTANCE_2680US, /**< The distance from the active notification to start of radio activity. */
- NRF_RADIO_NOTIFICATION_DISTANCE_3620US, /**< The distance from the active notification to start of radio activity. */
- NRF_RADIO_NOTIFICATION_DISTANCE_4560US, /**< The distance from the active notification to start of radio activity. */
- NRF_RADIO_NOTIFICATION_DISTANCE_5500US /**< The distance from the active notification to start of radio activity. */
-};
-
-
-/**@brief Radio notification types. */
-enum NRF_RADIO_NOTIFICATION_TYPES
-{
- NRF_RADIO_NOTIFICATION_TYPE_NONE = 0, /**< The event does not have a radio notification signal. */
- NRF_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE, /**< Using interrupt for notification when the radio will be enabled. */
- NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE, /**< Using interrupt for notification when the radio has been disabled. */
- NRF_RADIO_NOTIFICATION_TYPE_INT_ON_BOTH, /**< Using interrupt for notification both when the radio will be enabled and disabled. */
-};
-
-/**@brief The Radio signal callback types. */
-enum NRF_RADIO_CALLBACK_SIGNAL_TYPE
-{
- NRF_RADIO_CALLBACK_SIGNAL_TYPE_START, /**< This signal indicates the start of the radio timeslot. */
- NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0, /**< This signal indicates the NRF_TIMER0 interrupt. */
- NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO, /**< This signal indicates the NRF_RADIO interrupt. */
- NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_FAILED, /**< This signal indicates extend action failed. */
- NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED /**< This signal indicates extend action succeeded. */
-};
-
-/**@brief The actions requested by the signal callback.
- *
- * This code gives the SOC instructions about what action to take when the signal callback has
- * returned.
- */
-enum NRF_RADIO_SIGNAL_CALLBACK_ACTION
-{
- NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE, /**< Return without action. */
- NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND, /**< Request an extension of the current
- timeslot. Maximum execution time for this action:
- @ref NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US.
- This action must be started at least
- @ref NRF_RADIO_MIN_EXTENSION_MARGIN_US before
- the end of the timeslot. */
- NRF_RADIO_SIGNAL_CALLBACK_ACTION_END, /**< End the current radio timeslot. */
- NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END /**< Request a new radio timeslot and end the current timeslot. */
-};
-
-/**@brief Radio timeslot high frequency clock source configuration. */
-enum NRF_RADIO_HFCLK_CFG
-{
- NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED, /**< The SoftDevice will guarantee that the high frequency clock source is the
- external crystal for the whole duration of the timeslot. This should be the
- preferred option for events that use the radio or require high timing accuracy.
- @note The SoftDevice will automatically turn on and off the external crystal,
- at the beginning and end of the timeslot, respectively. The crystal may also
- intentionally be left running after the timeslot, in cases where it is needed
- by the SoftDevice shortly after the end of the timeslot. */
- NRF_RADIO_HFCLK_CFG_NO_GUARANTEE /**< This configuration allows for earlier and tighter scheduling of timeslots.
- The RC oscillator may be the clock source in part or for the whole duration of the timeslot.
- The RC oscillator's accuracy must therefore be taken into consideration.
- @note If the application will use the radio peripheral in timeslots with this configuration,
- it must make sure that the crystal is running and stable before starting the radio. */
-};
-
-/**@brief Radio timeslot priorities. */
-enum NRF_RADIO_PRIORITY
-{
- NRF_RADIO_PRIORITY_HIGH, /**< High (equal priority as the normal connection priority of the SoftDevice stack(s)). */
- NRF_RADIO_PRIORITY_NORMAL, /**< Normal (equal priority as the priority of secondary activities of the SoftDevice stack(s)). */
-};
-
-/**@brief Radio timeslot request type. */
-enum NRF_RADIO_REQUEST_TYPE
-{
- NRF_RADIO_REQ_TYPE_EARLIEST, /**< Request radio timeslot as early as possible. This should always be used for the first request in a session. */
- NRF_RADIO_REQ_TYPE_NORMAL /**< Normal radio timeslot request. */
-};
-
-/**@brief SoC Events. */
-enum NRF_SOC_EVTS
-{
- NRF_EVT_HFCLKSTARTED, /**< Event indicating that the HFCLK has started. */
- NRF_EVT_POWER_FAILURE_WARNING, /**< Event indicating that a power failure warning has occurred. */
- NRF_EVT_FLASH_OPERATION_SUCCESS, /**< Event indicating that the ongoing flash operation has completed successfully. */
- NRF_EVT_FLASH_OPERATION_ERROR, /**< Event indicating that the ongoing flash operation has timed out with an error. */
- NRF_EVT_RADIO_BLOCKED, /**< Event indicating that a radio timeslot was blocked. */
- NRF_EVT_RADIO_CANCELED, /**< Event indicating that a radio timeslot was canceled by SoftDevice. */
- NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN, /**< Event indicating that a radio timeslot signal callback handler return was invalid. */
- NRF_EVT_RADIO_SESSION_IDLE, /**< Event indicating that a radio timeslot session is idle. */
- NRF_EVT_RADIO_SESSION_CLOSED, /**< Event indicating that a radio timeslot session is closed. */
- NRF_EVT_POWER_USB_POWER_READY, /**< Event indicating that a USB 3.3 V supply is ready. */
- NRF_EVT_POWER_USB_DETECTED, /**< Event indicating that voltage supply is detected on VBUS. */
- NRF_EVT_POWER_USB_REMOVED, /**< Event indicating that voltage supply is removed from VBUS. */
- NRF_EVT_NUMBER_OF_EVTS
-};
-
-/**@} */
-
-
-/**@addtogroup NRF_SOC_STRUCTURES Structures
- * @{ */
-
-/**@brief Represents a mutex for use with the nrf_mutex functions.
- * @note Accessing the value directly is not safe, use the mutex functions!
- */
-typedef volatile uint8_t nrf_mutex_t;
-
-/**@brief Parameters for a request for a timeslot as early as possible. */
-typedef struct
-{
- uint8_t hfclk; /**< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG. */
- uint8_t priority; /**< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY. */
- uint32_t length_us; /**< The radio timeslot length (in the range 100 to 100,000] microseconds). */
- uint32_t timeout_us; /**< Longest acceptable delay until the start of the requested timeslot (up to @ref NRF_RADIO_EARLIEST_TIMEOUT_MAX_US microseconds). */
-} nrf_radio_request_earliest_t;
-
-/**@brief Parameters for a normal radio timeslot request. */
-typedef struct
-{
- uint8_t hfclk; /**< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG. */
- uint8_t priority; /**< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY. */
- uint32_t distance_us; /**< Distance from the start of the previous radio timeslot (up to @ref NRF_RADIO_DISTANCE_MAX_US microseconds). */
- uint32_t length_us; /**< The radio timeslot length (in the range [100..100,000] microseconds). */
-} nrf_radio_request_normal_t;
-
-/**@brief Radio timeslot request parameters. */
-typedef struct
-{
- uint8_t request_type; /**< Type of request, see @ref NRF_RADIO_REQUEST_TYPE. */
- union
- {
- nrf_radio_request_earliest_t earliest; /**< Parameters for requesting a radio timeslot as early as possible. */
- nrf_radio_request_normal_t normal; /**< Parameters for requesting a normal radio timeslot. */
- } params; /**< Parameter union. */
-} nrf_radio_request_t;
-
-/**@brief Return parameters of the radio timeslot signal callback. */
-typedef struct
-{
- uint8_t callback_action; /**< The action requested by the application when returning from the signal callback, see @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION. */
- union
- {
- struct
- {
- nrf_radio_request_t * p_next; /**< The request parameters for the next radio timeslot. */
- } request; /**< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END. */
- struct
- {
- uint32_t length_us; /**< Requested extension of the radio timeslot duration (microseconds) (for minimum time see @ref NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US). */
- } extend; /**< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND. */
- } params; /**< Parameter union. */
-} nrf_radio_signal_callback_return_param_t;
-
-/**@brief The radio timeslot signal callback type.
- *
- * @note In case of invalid return parameters, the radio timeslot will automatically end
- * immediately after returning from the signal callback and the
- * @ref NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN event will be sent.
- * @note The returned struct pointer must remain valid after the signal callback
- * function returns. For instance, this means that it must not point to a stack variable.
- *
- * @param[in] signal_type Type of signal, see @ref NRF_RADIO_CALLBACK_SIGNAL_TYPE.
- *
- * @return Pointer to structure containing action requested by the application.
- */
-typedef nrf_radio_signal_callback_return_param_t * (*nrf_radio_signal_callback_t) (uint8_t signal_type);
-
-/**@brief AES ECB parameter typedefs */
-typedef uint8_t soc_ecb_key_t[SOC_ECB_KEY_LENGTH]; /**< Encryption key type. */
-typedef uint8_t soc_ecb_cleartext_t[SOC_ECB_CLEARTEXT_LENGTH]; /**< Cleartext data type. */
-typedef uint8_t soc_ecb_ciphertext_t[SOC_ECB_CIPHERTEXT_LENGTH]; /**< Ciphertext data type. */
-
-/**@brief AES ECB data structure */
-typedef struct
-{
- soc_ecb_key_t key; /**< Encryption key. */
- soc_ecb_cleartext_t cleartext; /**< Cleartext data. */
- soc_ecb_ciphertext_t ciphertext; /**< Ciphertext data. */
-} nrf_ecb_hal_data_t;
-
-/**@brief AES ECB block. Used to provide multiple blocks in a single call
- to @ref sd_ecb_blocks_encrypt.*/
-typedef struct
-{
- soc_ecb_key_t const * p_key; /**< Pointer to the Encryption key. */
- soc_ecb_cleartext_t const * p_cleartext; /**< Pointer to the Cleartext data. */
- soc_ecb_ciphertext_t * p_ciphertext; /**< Pointer to the Ciphertext data. */
-} nrf_ecb_hal_data_block_t;
-
-/**@} */
-
-/**@addtogroup NRF_SOC_FUNCTIONS Functions
- * @{ */
-
-/**@brief Initialize a mutex.
- *
- * @param[in] p_mutex Pointer to the mutex to initialize.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_MUTEX_NEW, uint32_t, sd_mutex_new(nrf_mutex_t * p_mutex));
-
-/**@brief Attempt to acquire a mutex.
- *
- * @param[in] p_mutex Pointer to the mutex to acquire.
- *
- * @retval ::NRF_SUCCESS The mutex was successfully acquired.
- * @retval ::NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN The mutex could not be acquired.
- */
-SVCALL(SD_MUTEX_ACQUIRE, uint32_t, sd_mutex_acquire(nrf_mutex_t * p_mutex));
-
-/**@brief Release a mutex.
- *
- * @param[in] p_mutex Pointer to the mutex to release.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_MUTEX_RELEASE, uint32_t, sd_mutex_release(nrf_mutex_t * p_mutex));
-
-/**@brief Query the capacity of the application random pool.
- *
- * @param[out] p_pool_capacity The capacity of the pool.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_RAND_APPLICATION_POOL_CAPACITY_GET, uint32_t, sd_rand_application_pool_capacity_get(uint8_t * p_pool_capacity));
-
-/**@brief Get number of random bytes available to the application.
- *
- * @param[out] p_bytes_available The number of bytes currently available in the pool.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_RAND_APPLICATION_BYTES_AVAILABLE_GET, uint32_t, sd_rand_application_bytes_available_get(uint8_t * p_bytes_available));
-
-/**@brief Get random bytes from the application pool.
- *
- * @param[out] p_buff Pointer to unit8_t buffer for storing the bytes.
- * @param[in] length Number of bytes to take from pool and place in p_buff.
- *
- * @retval ::NRF_SUCCESS The requested bytes were written to p_buff.
- * @retval ::NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES No bytes were written to the buffer, because there were not enough bytes available.
-*/
-SVCALL(SD_RAND_APPLICATION_VECTOR_GET, uint32_t, sd_rand_application_vector_get(uint8_t * p_buff, uint8_t length));
-
-/**@brief Gets the reset reason register.
- *
- * @param[out] p_reset_reason Contents of the NRF_POWER->RESETREAS register.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_RESET_REASON_GET, uint32_t, sd_power_reset_reason_get(uint32_t * p_reset_reason));
-
-/**@brief Clears the bits of the reset reason register.
- *
- * @param[in] reset_reason_clr_msk Contains the bits to clear from the reset reason register.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_RESET_REASON_CLR, uint32_t, sd_power_reset_reason_clr(uint32_t reset_reason_clr_msk));
-
-/**@brief Sets the power mode when in CPU sleep.
- *
- * @param[in] power_mode The power mode to use when in CPU sleep, see @ref NRF_POWER_MODES. @sa sd_app_evt_wait
- *
- * @retval ::NRF_SUCCESS The power mode was set.
- * @retval ::NRF_ERROR_SOC_POWER_MODE_UNKNOWN The power mode was unknown.
- */
-SVCALL(SD_POWER_MODE_SET, uint32_t, sd_power_mode_set(uint8_t power_mode));
-
-/**@brief Puts the chip in System OFF mode.
- *
- * @retval ::NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN
- */
-SVCALL(SD_POWER_SYSTEM_OFF, uint32_t, sd_power_system_off(void));
-
-/**@brief Enables or disables the power-fail comparator.
- *
- * Enabling this will give a SoftDevice event (NRF_EVT_POWER_FAILURE_WARNING) when the power failure warning occurs.
- * The event can be retrieved with sd_evt_get();
- *
- * @param[in] pof_enable True if the power-fail comparator should be enabled, false if it should be disabled.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_POF_ENABLE, uint32_t, sd_power_pof_enable(uint8_t pof_enable));
-
-/**@brief Enables or disables the USB power ready event.
- *
- * Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_POWER_READY) when a USB 3.3 V supply is ready.
- * The event can be retrieved with sd_evt_get();
- *
- * @param[in] usbpwrrdy_enable True if the power ready event should be enabled, false if it should be disabled.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_USBPWRRDY_ENABLE, uint32_t, sd_power_usbpwrrdy_enable(uint8_t usbpwrrdy_enable));
-
-/**@brief Enables or disables the power USB-detected event.
- *
- * Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_DETECTED) when a voltage supply is detected on VBUS.
- * The event can be retrieved with sd_evt_get();
- *
- * @param[in] usbdetected_enable True if the power ready event should be enabled, false if it should be disabled.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_USBDETECTED_ENABLE, uint32_t, sd_power_usbdetected_enable(uint8_t usbdetected_enable));
-
-/**@brief Enables or disables the power USB-removed event.
- *
- * Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_REMOVED) when a voltage supply is removed from VBUS.
- * The event can be retrieved with sd_evt_get();
- *
- * @param[in] usbremoved_enable True if the power ready event should be enabled, false if it should be disabled.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_USBREMOVED_ENABLE, uint32_t, sd_power_usbremoved_enable(uint8_t usbremoved_enable));
-
-/**@brief Get USB supply status register content.
- *
- * @param[out] usbregstatus The content of USBREGSTATUS register.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_USBREGSTATUS_GET, uint32_t, sd_power_usbregstatus_get(uint32_t * usbregstatus));
-
-/**@brief Sets the power failure comparator threshold value.
- *
- * @note: Power failure comparator threshold setting. This setting applies both for normal voltage
- * mode (supply connected to both VDD and VDDH) and high voltage mode (supply connected to
- * VDDH only).
- *
- * @param[in] threshold The power-fail threshold value to use, see @ref NRF_POWER_THRESHOLDS.
- *
- * @retval ::NRF_SUCCESS The power failure threshold was set.
- * @retval ::NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN The power failure threshold is unknown.
- */
-SVCALL(SD_POWER_POF_THRESHOLD_SET, uint32_t, sd_power_pof_threshold_set(uint8_t threshold));
-
-/**@brief Sets the power failure comparator threshold value for high voltage.
- *
- * @note: Power failure comparator threshold setting for high voltage mode (supply connected to
- * VDDH only). This setting does not apply for normal voltage mode (supply connected to both
- * VDD and VDDH).
- *
- * @param[in] threshold The power-fail threshold value to use, see @ref NRF_POWER_THRESHOLDVDDHS.
- *
- * @retval ::NRF_SUCCESS The power failure threshold was set.
- * @retval ::NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN The power failure threshold is unknown.
- */
-SVCALL(SD_POWER_POF_THRESHOLDVDDH_SET, uint32_t, sd_power_pof_thresholdvddh_set(uint8_t threshold));
-
-/**@brief Writes the NRF_POWER->RAM[index].POWERSET register.
- *
- * @param[in] index Contains the index in the NRF_POWER->RAM[index].POWERSET register to write to.
- * @param[in] ram_powerset Contains the word to write to the NRF_POWER->RAM[index].POWERSET register.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_RAM_POWER_SET, uint32_t, sd_power_ram_power_set(uint8_t index, uint32_t ram_powerset));
-
-/**@brief Writes the NRF_POWER->RAM[index].POWERCLR register.
- *
- * @param[in] index Contains the index in the NRF_POWER->RAM[index].POWERCLR register to write to.
- * @param[in] ram_powerclr Contains the word to write to the NRF_POWER->RAM[index].POWERCLR register.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_RAM_POWER_CLR, uint32_t, sd_power_ram_power_clr(uint8_t index, uint32_t ram_powerclr));
-
-/**@brief Get contents of NRF_POWER->RAM[index].POWER register, indicates power status of RAM[index] blocks.
- *
- * @param[in] index Contains the index in the NRF_POWER->RAM[index].POWER register to read from.
- * @param[out] p_ram_power Content of NRF_POWER->RAM[index].POWER register.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_RAM_POWER_GET, uint32_t, sd_power_ram_power_get(uint8_t index, uint32_t * p_ram_power));
-
-/**@brief Set bits in the general purpose retention registers (NRF_POWER->GPREGRET*).
- *
- * @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2.
- * @param[in] gpregret_msk Bits to be set in the GPREGRET register.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_GPREGRET_SET, uint32_t, sd_power_gpregret_set(uint32_t gpregret_id, uint32_t gpregret_msk));
-
-/**@brief Clear bits in the general purpose retention registers (NRF_POWER->GPREGRET*).
- *
- * @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2.
- * @param[in] gpregret_msk Bits to be clear in the GPREGRET register.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_GPREGRET_CLR, uint32_t, sd_power_gpregret_clr(uint32_t gpregret_id, uint32_t gpregret_msk));
-
-/**@brief Get contents of the general purpose retention registers (NRF_POWER->GPREGRET*).
- *
- * @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2.
- * @param[out] p_gpregret Contents of the GPREGRET register.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_POWER_GPREGRET_GET, uint32_t, sd_power_gpregret_get(uint32_t gpregret_id, uint32_t *p_gpregret));
-
-/**@brief Enable or disable the DC/DC regulator for the regulator stage 1 (REG1).
- *
- * @param[in] dcdc_mode The mode of the DCDC, see @ref NRF_POWER_DCDC_MODES.
- *
- * @retval ::NRF_SUCCESS
- * @retval ::NRF_ERROR_INVALID_PARAM The DCDC mode is invalid.
- */
-SVCALL(SD_POWER_DCDC_MODE_SET, uint32_t, sd_power_dcdc_mode_set(uint8_t dcdc_mode));
-
-/**@brief Enable or disable the DC/DC regulator for the regulator stage 0 (REG0).
- *
- * For more details on the REG0 stage, please see product specification.
- *
- * @param[in] dcdc_mode The mode of the DCDC0, see @ref NRF_POWER_DCDC_MODES.
- *
- * @retval ::NRF_SUCCESS
- * @retval ::NRF_ERROR_INVALID_PARAM The dcdc_mode is invalid.
- */
-SVCALL(SD_POWER_DCDC0_MODE_SET, uint32_t, sd_power_dcdc0_mode_set(uint8_t dcdc_mode));
-
-/**@brief Request the high frequency crystal oscillator.
- *
- * Will start the high frequency crystal oscillator, the startup time of the crystal varies
- * and the ::sd_clock_hfclk_is_running function can be polled to check if it has started.
- *
- * @see sd_clock_hfclk_is_running
- * @see sd_clock_hfclk_release
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_CLOCK_HFCLK_REQUEST, uint32_t, sd_clock_hfclk_request(void));
-
-/**@brief Releases the high frequency crystal oscillator.
- *
- * Will stop the high frequency crystal oscillator, this happens immediately.
- *
- * @see sd_clock_hfclk_is_running
- * @see sd_clock_hfclk_request
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_CLOCK_HFCLK_RELEASE, uint32_t, sd_clock_hfclk_release(void));
-
-/**@brief Checks if the high frequency crystal oscillator is running.
- *
- * @see sd_clock_hfclk_request
- * @see sd_clock_hfclk_release
- *
- * @param[out] p_is_running 1 if the external crystal oscillator is running, 0 if not.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_CLOCK_HFCLK_IS_RUNNING, uint32_t, sd_clock_hfclk_is_running(uint32_t * p_is_running));
-
-/**@brief Waits for an application event.
- *
- * An application event is either an application interrupt or a pended interrupt when the interrupt
- * is disabled.
- *
- * When the application waits for an application event by calling this function, an interrupt that
- * is enabled will be taken immediately on pending since this function will wait in thread mode,
- * then the execution will return in the application's main thread.
- *
- * In order to wake up from disabled interrupts, the SEVONPEND flag has to be set in the Cortex-M
- * MCU's System Control Register (SCR), CMSIS_SCB. In that case, when a disabled interrupt gets
- * pended, this function will return to the application's main thread.
- *
- * @note The application must ensure that the pended flag is cleared using ::sd_nvic_ClearPendingIRQ
- * in order to sleep using this function. This is only necessary for disabled interrupts, as
- * the interrupt handler will clear the pending flag automatically for enabled interrupts.
- *
- * @note If an application interrupt has happened since the last time sd_app_evt_wait was
- * called this function will return immediately and not go to sleep. This is to avoid race
- * conditions that can occur when a flag is updated in the interrupt handler and processed
- * in the main loop.
- *
- * @post An application interrupt has happened or a interrupt pending flag is set.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_APP_EVT_WAIT, uint32_t, sd_app_evt_wait(void));
-
-/**@brief Get PPI channel enable register contents.
- *
- * @param[out] p_channel_enable The contents of the PPI CHEN register.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_PPI_CHANNEL_ENABLE_GET, uint32_t, sd_ppi_channel_enable_get(uint32_t * p_channel_enable));
-
-/**@brief Set PPI channel enable register.
- *
- * @param[in] channel_enable_set_msk Mask containing the bits to set in the PPI CHEN register.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_PPI_CHANNEL_ENABLE_SET, uint32_t, sd_ppi_channel_enable_set(uint32_t channel_enable_set_msk));
-
-/**@brief Clear PPI channel enable register.
- *
- * @param[in] channel_enable_clr_msk Mask containing the bits to clear in the PPI CHEN register.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_PPI_CHANNEL_ENABLE_CLR, uint32_t, sd_ppi_channel_enable_clr(uint32_t channel_enable_clr_msk));
-
-/**@brief Assign endpoints to a PPI channel.
- *
- * @param[in] channel_num Number of the PPI channel to assign.
- * @param[in] evt_endpoint Event endpoint of the PPI channel.
- * @param[in] task_endpoint Task endpoint of the PPI channel.
- *
- * @retval ::NRF_ERROR_SOC_PPI_INVALID_CHANNEL The channel number is invalid.
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_PPI_CHANNEL_ASSIGN, uint32_t, sd_ppi_channel_assign(uint8_t channel_num, const volatile void * evt_endpoint, const volatile void * task_endpoint));
-
-/**@brief Task to enable a channel group.
- *
- * @param[in] group_num Number of the channel group.
- *
- * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_PPI_GROUP_TASK_ENABLE, uint32_t, sd_ppi_group_task_enable(uint8_t group_num));
-
-/**@brief Task to disable a channel group.
- *
- * @param[in] group_num Number of the PPI group.
- *
- * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid.
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_PPI_GROUP_TASK_DISABLE, uint32_t, sd_ppi_group_task_disable(uint8_t group_num));
-
-/**@brief Assign PPI channels to a channel group.
- *
- * @param[in] group_num Number of the channel group.
- * @param[in] channel_msk Mask of the channels to assign to the group.
- *
- * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid.
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_PPI_GROUP_ASSIGN, uint32_t, sd_ppi_group_assign(uint8_t group_num, uint32_t channel_msk));
-
-/**@brief Gets the PPI channels of a channel group.
- *
- * @param[in] group_num Number of the channel group.
- * @param[out] p_channel_msk Mask of the channels assigned to the group.
- *
- * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid.
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_PPI_GROUP_GET, uint32_t, sd_ppi_group_get(uint8_t group_num, uint32_t * p_channel_msk));
-
-/**@brief Configures the Radio Notification signal.
- *
- * @note
- * - The notification signal latency depends on the interrupt priority settings of SWI used
- * for notification signal.
- * - To ensure that the radio notification signal behaves in a consistent way, the radio
- * notifications must be configured when there is no protocol stack or other SoftDevice
- * activity in progress. It is recommended that the radio notification signal is
- * configured directly after the SoftDevice has been enabled.
- * - In the period between the ACTIVE signal and the start of the Radio Event, the SoftDevice
- * will interrupt the application to do Radio Event preparation.
- * - Using the Radio Notification feature may limit the bandwidth, as the SoftDevice may have
- * to shorten the connection events to have time for the Radio Notification signals.
- *
- * @param[in] type Type of notification signal, see @ref NRF_RADIO_NOTIFICATION_TYPES.
- * @ref NRF_RADIO_NOTIFICATION_TYPE_NONE shall be used to turn off radio
- * notification. Using @ref NRF_RADIO_NOTIFICATION_DISTANCE_NONE is
- * recommended (but not required) to be used with
- * @ref NRF_RADIO_NOTIFICATION_TYPE_NONE.
- *
- * @param[in] distance Distance between the notification signal and start of radio activity, see @ref NRF_RADIO_NOTIFICATION_DISTANCES.
- * This parameter is ignored when @ref NRF_RADIO_NOTIFICATION_TYPE_NONE or
- * @ref NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE is used.
- *
- * @retval ::NRF_ERROR_INVALID_PARAM The group number is invalid.
- * @retval ::NRF_ERROR_INVALID_STATE A protocol stack or other SoftDevice is running. Stop all
- * running activities and retry.
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_RADIO_NOTIFICATION_CFG_SET, uint32_t, sd_radio_notification_cfg_set(uint8_t type, uint8_t distance));
-
-/**@brief Encrypts a block according to the specified parameters.
- *
- * 128-bit AES encryption.
- *
- * @note:
- * - The application may set the SEVONPEND bit in the SCR to 1 to make the SoftDevice sleep while
- * the ECB is running. The SEVONPEND bit should only be cleared (set to 0) from application
- * main or low interrupt level.
- *
- * @param[in, out] p_ecb_data Pointer to the ECB parameters' struct (two input
- * parameters and one output parameter).
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_ECB_BLOCK_ENCRYPT, uint32_t, sd_ecb_block_encrypt(nrf_ecb_hal_data_t * p_ecb_data));
-
-/**@brief Encrypts multiple data blocks provided as an array of data block structures.
- *
- * @details: Performs 128-bit AES encryption on multiple data blocks
- *
- * @note:
- * - The application may set the SEVONPEND bit in the SCR to 1 to make the SoftDevice sleep while
- * the ECB is running. The SEVONPEND bit should only be cleared (set to 0) from application
- * main or low interrupt level.
- *
- * @param[in] block_count Count of blocks in the p_data_blocks array.
- * @param[in,out] p_data_blocks Pointer to the first entry in a contiguous array of
- * @ref nrf_ecb_hal_data_block_t structures.
- *
- * @retval ::NRF_SUCCESS
- */
-SVCALL(SD_ECB_BLOCKS_ENCRYPT, uint32_t, sd_ecb_blocks_encrypt(uint8_t block_count, nrf_ecb_hal_data_block_t * p_data_blocks));
-
-/**@brief Gets any pending events generated by the SoC API.
- *
- * The application should keep calling this function to get events, until ::NRF_ERROR_NOT_FOUND is returned.
- *
- * @param[out] p_evt_id Set to one of the values in @ref NRF_SOC_EVTS, if any events are pending.
- *
- * @retval ::NRF_SUCCESS An event was pending. The event id is written in the p_evt_id parameter.
- * @retval ::NRF_ERROR_NOT_FOUND No pending events.
- */
-SVCALL(SD_EVT_GET, uint32_t, sd_evt_get(uint32_t * p_evt_id));
-
-/**@brief Get the temperature measured on the chip
- *
- * This function will block until the temperature measurement is done.
- * It takes around 50 us from call to return.
- *
- * @param[out] p_temp Result of temperature measurement. Die temperature in 0.25 degrees Celsius.
- *
- * @retval ::NRF_SUCCESS A temperature measurement was done, and the temperature was written to temp
- */
-SVCALL(SD_TEMP_GET, uint32_t, sd_temp_get(int32_t * p_temp));
-
-/**@brief Flash Write
-*
-* Commands to write a buffer to flash
-*
-* If the SoftDevice is enabled:
-* This call initiates the flash access command, and its completion will be communicated to the
-* application with exactly one of the following events:
-* - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed.
-* - @ref NRF_EVT_FLASH_OPERATION_ERROR - The command could not be started.
-*
-* If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the
- * write has been completed
-*
-* @note
-* - This call takes control over the radio and the CPU during flash erase and write to make sure that
-* they will not interfere with the flash access. This means that all interrupts will be blocked
-* for a predictable time (depending on the NVMC specification in the device's Product Specification
-* and the command parameters).
-* - The data in the p_src buffer should not be modified before the @ref NRF_EVT_FLASH_OPERATION_SUCCESS
-* or the @ref NRF_EVT_FLASH_OPERATION_ERROR have been received if the SoftDevice is enabled.
-* - This call will make the SoftDevice trigger a hardfault when the page is written, if it is
-* protected.
-*
-*
-* @param[in] p_dst Pointer to start of flash location to be written.
-* @param[in] p_src Pointer to buffer with data to be written.
-* @param[in] size Number of 32-bit words to write. Maximum size is the number of words in one
-* flash page. See the device's Product Specification for details.
-*
-* @retval ::NRF_ERROR_INVALID_ADDR Tried to write to a non existing flash address, or p_dst or p_src was unaligned.
-* @retval ::NRF_ERROR_BUSY The previous command has not yet completed.
-* @retval ::NRF_ERROR_INVALID_LENGTH Size was 0, or higher than the maximum allowed size.
-* @retval ::NRF_ERROR_FORBIDDEN Tried to write to an address outside the application flash area.
-* @retval ::NRF_SUCCESS The command was accepted.
-*/
-SVCALL(SD_FLASH_WRITE, uint32_t, sd_flash_write(uint32_t * p_dst, uint32_t const * p_src, uint32_t size));
-
-
-/**@brief Flash Erase page
-*
-* Commands to erase a flash page
-* If the SoftDevice is enabled:
-* This call initiates the flash access command, and its completion will be communicated to the
-* application with exactly one of the following events:
-* - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed.
-* - @ref NRF_EVT_FLASH_OPERATION_ERROR - The command could not be started.
-*
-* If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the
-* erase has been completed
-*
-* @note
-* - This call takes control over the radio and the CPU during flash erase and write to make sure that
-* they will not interfere with the flash access. This means that all interrupts will be blocked
-* for a predictable time (depending on the NVMC specification in the device's Product Specification
-* and the command parameters).
-* - This call will make the SoftDevice trigger a hardfault when the page is erased, if it is
-* protected.
-*
-*
-* @param[in] page_number Page number of the page to erase
-*
-* @retval ::NRF_ERROR_INTERNAL If a new session could not be opened due to an internal error.
-* @retval ::NRF_ERROR_INVALID_ADDR Tried to erase to a non existing flash page.
-* @retval ::NRF_ERROR_BUSY The previous command has not yet completed.
-* @retval ::NRF_ERROR_FORBIDDEN Tried to erase a page outside the application flash area.
-* @retval ::NRF_SUCCESS The command was accepted.
-*/
-SVCALL(SD_FLASH_PAGE_ERASE, uint32_t, sd_flash_page_erase(uint32_t page_number));
-
-
-
-/**@brief Opens a session for radio timeslot requests.
- *
- * @note Only one session can be open at a time.
- * @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) will be called when the radio timeslot
- * starts. From this point the NRF_RADIO and NRF_TIMER0 peripherals can be freely accessed
- * by the application.
- * @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0) is called whenever the NRF_TIMER0
- * interrupt occurs.
- * @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO) is called whenever the NRF_RADIO
- * interrupt occurs.
- * @note p_radio_signal_callback() will be called at ARM interrupt priority level 0. This
- * implies that none of the sd_* API calls can be used from p_radio_signal_callback().
- *
- * @param[in] p_radio_signal_callback The signal callback.
- *
- * @retval ::NRF_ERROR_INVALID_ADDR p_radio_signal_callback is an invalid function pointer.
- * @retval ::NRF_ERROR_BUSY If session cannot be opened.
- * @retval ::NRF_ERROR_INTERNAL If a new session could not be opened due to an internal error.
- * @retval ::NRF_SUCCESS Otherwise.
- */
- SVCALL(SD_RADIO_SESSION_OPEN, uint32_t, sd_radio_session_open(nrf_radio_signal_callback_t p_radio_signal_callback));
-
-/**@brief Closes a session for radio timeslot requests.
- *
- * @note Any current radio timeslot will be finished before the session is closed.
- * @note If a radio timeslot is scheduled when the session is closed, it will be canceled.
- * @note The application cannot consider the session closed until the @ref NRF_EVT_RADIO_SESSION_CLOSED
- * event is received.
- *
- * @retval ::NRF_ERROR_FORBIDDEN If session not opened.
- * @retval ::NRF_ERROR_BUSY If session is currently being closed.
- * @retval ::NRF_SUCCESS Otherwise.
- */
- SVCALL(SD_RADIO_SESSION_CLOSE, uint32_t, sd_radio_session_close(void));
-
-/**@brief Requests a radio timeslot.
- *
- * @note The request type is determined by p_request->request_type, and can be one of @ref NRF_RADIO_REQ_TYPE_EARLIEST
- * and @ref NRF_RADIO_REQ_TYPE_NORMAL. The first request in a session must always be of type @ref NRF_RADIO_REQ_TYPE_EARLIEST.
- * @note For a normal request (@ref NRF_RADIO_REQ_TYPE_NORMAL), the start time of a radio timeslot is specified by
- * p_request->distance_us and is given relative to the start of the previous timeslot.
- * @note A too small p_request->distance_us will lead to a @ref NRF_EVT_RADIO_BLOCKED event.
- * @note Timeslots scheduled too close will lead to a @ref NRF_EVT_RADIO_BLOCKED event.
- * @note See the SoftDevice Specification for more on radio timeslot scheduling, distances and lengths.
- * @note If an opportunity for the first radio timeslot is not found before 100 ms after the call to this
- * function, it is not scheduled, and instead a @ref NRF_EVT_RADIO_BLOCKED event is sent.
- * The application may then try to schedule the first radio timeslot again.
- * @note Successful requests will result in nrf_radio_signal_callback_t(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START).
- * Unsuccessful requests will result in a @ref NRF_EVT_RADIO_BLOCKED event, see @ref NRF_SOC_EVTS.
- * @note The jitter in the start time of the radio timeslots is +/- @ref NRF_RADIO_START_JITTER_US us.
- * @note The nrf_radio_signal_callback_t(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) call has a latency relative to the
- * specified radio timeslot start, but this does not affect the actual start time of the timeslot.
- * @note NRF_TIMER0 is reset at the start of the radio timeslot, and is clocked at 1MHz from the high frequency
- * (16 MHz) clock source. If p_request->hfclk_force_xtal is true, the high frequency clock is
- * guaranteed to be clocked from the external crystal.
- * @note The SoftDevice will neither access the NRF_RADIO peripheral nor the NRF_TIMER0 peripheral
- * during the radio timeslot.
- *
- * @param[in] p_request Pointer to the request parameters.
- *
- * @retval ::NRF_ERROR_FORBIDDEN If session not opened or the session is not IDLE.
- * @retval ::NRF_ERROR_INVALID_ADDR If the p_request pointer is invalid.
- * @retval ::NRF_ERROR_INVALID_PARAM If the parameters of p_request are not valid.
- * @retval ::NRF_SUCCESS Otherwise.
- */
- SVCALL(SD_RADIO_REQUEST, uint32_t, sd_radio_request(nrf_radio_request_t const * p_request));
-
-/**@brief Write register protected by the SoftDevice
- *
- * This function writes to a register that is write-protected by the SoftDevice. Please refer to your
- * SoftDevice Specification for more details about which registers that are protected by SoftDevice.
- * This function can write to the following protected peripheral:
- * - ACL
- *
- * @note Protected registers may be read directly.
- * @note Register that are write-once will return @ref NRF_SUCCESS on second set, even the value in
- * the register has not changed. See the Product Specification for more details about register
- * properties.
- *
- * @param[in] p_register Pointer to register to be written.
- * @param[in] value Value to be written to the register.
- *
- * @retval ::NRF_ERROR_INVALID_ADDR This function can not write to the reguested register.
- * @retval ::NRF_SUCCESS Value successfully written to register.
- *
- */
-SVCALL(SD_PROTECTED_REGISTER_WRITE, uint32_t, sd_protected_register_write(volatile uint32_t * p_register, uint32_t value));
-
-/**@} */
-
-#ifdef __cplusplus
-}
-#endif
-#endif // NRF_SOC_H__
-
-/**@} */
diff --git a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_svc.h b/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_svc.h
deleted file mode 100755
index 292c6929..00000000
--- a/tinyusb/hw/mcu/nordic/nrf5x/s140_nrf52_6.1.1_API/include/nrf_svc.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2012 - 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, 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_SVC__
-#define NRF_SVC__
-
-#include "stdint.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef SVCALL_AS_NORMAL_FUNCTION
-#define SVCALL(number, return_type, signature) return_type signature
-#else
-
-#ifndef SVCALL
-#if defined (__CC_ARM)
-#define SVCALL(number, return_type, signature) return_type __svc(number) signature
-#elif defined (__GNUC__)
-#ifdef __cplusplus
-#define GCC_CAST_CPP (uint16_t)
-#else
-#define GCC_CAST_CPP
-#endif
-#define SVCALL(number, return_type, signature) \
- _Pragma("GCC diagnostic push") \
- _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \
- __attribute__((naked)) \
- __attribute__((unused)) \
- static return_type signature \
- { \
- __asm( \
- "svc %0\n" \
- "bx r14" : : "I" (GCC_CAST_CPP number) : "r0" \
- ); \
- } \
- _Pragma("GCC diagnostic pop")
-
-#elif defined (__ICCARM__)
-#define PRAGMA(x) _Pragma(#x)
-#define SVCALL(number, return_type, signature) \
-PRAGMA(swi_number = (number)) \
- __swi return_type signature;
-#else
-#define SVCALL(number, return_type, signature) return_type signature
-#endif
-#endif // SVCALL
-
-#endif // SVCALL_AS_NORMAL_FUNCTION
-
-#ifdef __cplusplus
-}
-#endif
-#endif // NRF_SVC__
diff --git a/tinyusb/hw/mcu/nordic/nrfx_config.h b/tinyusb/hw/mcu/nordic/nrfx_config.h
deleted file mode 100755
index 6a974ba7..00000000
--- a/tinyusb/hw/mcu/nordic/nrfx_config.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef NRFX_CONFIG_H__
-#define NRFX_CONFIG_H__
-
-#define NRFX_POWER_ENABLED 1
-#define NRFX_POWER_DEFAULT_CONFIG_IRQ_PRIORITY 7
-
-#define NRFX_CLOCK_ENABLED 0
-
-#define NRFX_UARTE_ENABLED 1
-#define NRFX_UARTE0_ENABLED 1
-
-#define NRFX_UARTE1_ENABLED 0
-#define NRFX_UARTE2_ENABLED 0
-#define NRFX_UARTE3_ENABLED 0
-
-#define NRFX_PRS_ENABLED 0
-
-#endif // NRFX_CONFIG_H__
diff --git a/tinyusb/hw/mcu/nordic/nrfx_glue.h b/tinyusb/hw/mcu/nordic/nrfx_glue.h
deleted file mode 100755
index cdf49b4a..00000000
--- a/tinyusb/hw/mcu/nordic/nrfx_glue.h
+++ /dev/null
@@ -1,227 +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 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 NRFX_GLUE_H__
-#define NRFX_GLUE_H__
-
-// THIS IS A TEMPLATE FILE.
-// It should be copied to a suitable location within the host environment into
-// which nrfx is integrated, and the following macros should be provided with
-// appropriate implementations.
-// And this comment should be removed from the customized file.
-
-#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.
- */
-
-// Uncomment this line to use the standard MDK way of binding IRQ handlers
-// at linking time.
-#include <soc/nrfx_irqs.h>
-
-//------------------------------------------------------------------------------
-
-/**
- * @brief Macro for placing a runtime assertion.
- *
- * @param expression Expression to evaluate.
- */
-#define NRFX_ASSERT(expression)
-
-/**
- * @brief Macro for placing a compile time assertion.
- *
- * @param expression Expression to evaluate.
- */
-#define NRFX_STATIC_ASSERT(expression)
-
-//------------------------------------------------------------------------------
-
-/**
- * @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)
-{
- NRFX_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_ClearPendingIRQ(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);
-}
-
-/**
- * @brief Macro for entering into a critical section.
- */
-#define NRFX_CRITICAL_SECTION_ENTER()
-
-/**
- * @brief Macro for exiting from a critical section.
- */
-#define NRFX_CRITICAL_SECTION_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
-
-/**
- * @brief Macro for delaying the code execution for at least the specified time.
- *
- * @param us_time Number of microseconds to wait.
- */
-#include <soc/nrfx_coredep.h>
-#define NRFX_DELAY_US(us_time) nrfx_coredep_delay_us(us_time)
-
-//------------------------------------------------------------------------------
-
-/**
- * @brief When set to a non-zero value, this macro specifies that the
- * @ref nrfx_error_codes and the @ref nrfx_err_t type itself are defined
- * in a customized way and the default definitions from @c <nrfx_error.h>
- * should not be used.
- */
-#define NRFX_CUSTOM_ERROR_CODES 0
-
-//------------------------------------------------------------------------------
-
-/**
- * @brief Bitmask defining PPI channels reserved to be used outside of nrfx.
- */
-#define NRFX_PPI_CHANNELS_USED 0
-
-/**
- * @brief Bitmask defining PPI groups reserved to be used outside of nrfx.
- */
-#define NRFX_PPI_GROUPS_USED 0
-
-/**
- * @brief Bitmask defining SWI instances reserved to be used outside of nrfx.
- */
-#define NRFX_SWI_USED 0
-
-/**
- * @brief Bitmask defining TIMER instances reserved to be used outside of nrfx.
- */
-#define NRFX_TIMERS_USED 0
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NRFX_GLUE_H__
diff --git a/tinyusb/hw/mcu/nordic/nrfx_log.h b/tinyusb/hw/mcu/nordic/nrfx_log.h
deleted file mode 100755
index 3bc1b424..00000000
--- a/tinyusb/hw/mcu/nordic/nrfx_log.h
+++ /dev/null
@@ -1,135 +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.
- */
-
-#ifndef NRFX_LOG_H__
-#define NRFX_LOG_H__
-
-// THIS IS A TEMPLATE FILE.
-// It should be copied to a suitable location within the host environment into
-// which nrfx is integrated, and the following macros should be provided with
-// appropriate implementations.
-// And this comment should be removed from the customized file.
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @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.
- *
- * @param format printf-style format string, optionally followed by arguments
- * to be formatted and inserted in the resulting string.
- */
-#define NRFX_LOG_ERROR(format, ...)
-
-/**
- * @brief Macro for logging a message with the severity level WARNING.
- *
- * @param format printf-style format string, optionally followed by arguments
- * to be formatted and inserted in the resulting string.
- */
-#define NRFX_LOG_WARNING(format, ...)
-
-/**
- * @brief Macro for logging a message with the severity level INFO.
- *
- * @param format printf-style format string, optionally followed by arguments
- * to be formatted and inserted in the resulting string.
- */
-#define NRFX_LOG_INFO(format, ...)
-
-/**
- * @brief Macro for logging a message with the severity level DEBUG.
- *
- * @param format printf-style format string, optionally followed by arguments
- * to be formatted and inserted in the resulting string.
- */
-#define NRFX_LOG_DEBUG(format, ...)
-
-
-/**
- * @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)
-
-/**
- * @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)
-
-/**
- * @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)
-
-/**
- * @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)
-
-
-/**
- * @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)
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NRFX_LOG_H__
diff --git a/tinyusb/hw/mcu/sony/cxd56/mkspk/.gitignore b/tinyusb/hw/mcu/sony/cxd56/mkspk/.gitignore
deleted file mode 100755
index 4c3d12e3..00000000
--- a/tinyusb/hw/mcu/sony/cxd56/mkspk/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/mkspk
-/mkspk.exe
diff --git a/tinyusb/hw/mcu/sony/cxd56/mkspk/Makefile b/tinyusb/hw/mcu/sony/cxd56/mkspk/Makefile
deleted file mode 100755
index d91d17a3..00000000
--- a/tinyusb/hw/mcu/sony/cxd56/mkspk/Makefile
+++ /dev/null
@@ -1,51 +0,0 @@
-############################################################################
-# tools/mkspk/Makefile
-#
-# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
-# Author: Gregory Nutt <gnutt@nuttx.org>
-#
-# 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 NuttX 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.
-#
-############################################################################
-
-all: mkspk
-default: mkspk
-.PHONY: clean
-
-# Add CFLAGS=-g on the make command line to build debug versions
-
-CFLAGS = -O2 -Wall -I.
-
-# mkspk - Convert nuttx.hex image to nuttx.spk image
-
-mkspk:
- @gcc $(CFLAGS) -o mkspk mkspk.c clefia.c
-
-clean:
- @rm -f *.o *.a *.dSYM *~ .*.swp
- @rm -f mkspk mkspk.exe
diff --git a/tinyusb/hw/mcu/sony/cxd56/mkspk/clefia.c b/tinyusb/hw/mcu/sony/cxd56/mkspk/clefia.c
deleted file mode 100755
index 02a17550..00000000
--- a/tinyusb/hw/mcu/sony/cxd56/mkspk/clefia.c
+++ /dev/null
@@ -1,517 +0,0 @@
-/****************************************************************************
- * tools/cxd56/clefia.c
- *
- * Copyright (C) 2007, 2008 Sony Corporation
- *
- * 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 NuttX 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.
- *****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <assert.h>
-
-#include "clefia.h"
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#define clefiamul4(_x) (clefiamul2(clefiamul2((_x))))
-#define clefiamul6(_x) (clefiamul2((_x)) ^ clefiamul4((_x)))
-#define clefiamul8(_x) (clefiamul2(clefiamul4((_x))))
-#define clefiamula(_x) (clefiamul2((_x)) ^ clefiamul8((_x)))
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/* S0 (8-bit S-box based on four 4-bit S-boxes) */
-
-static const unsigned char clefia_s0[256] =
-{
- 0x57u, 0x49u, 0xd1u, 0xc6u, 0x2fu, 0x33u, 0x74u, 0xfbu,
- 0x95u, 0x6du, 0x82u, 0xeau, 0x0eu, 0xb0u, 0xa8u, 0x1cu,
- 0x28u, 0xd0u, 0x4bu, 0x92u, 0x5cu, 0xeeu, 0x85u, 0xb1u,
- 0xc4u, 0x0au, 0x76u, 0x3du, 0x63u, 0xf9u, 0x17u, 0xafu,
- 0xbfu, 0xa1u, 0x19u, 0x65u, 0xf7u, 0x7au, 0x32u, 0x20u,
- 0x06u, 0xceu, 0xe4u, 0x83u, 0x9du, 0x5bu, 0x4cu, 0xd8u,
- 0x42u, 0x5du, 0x2eu, 0xe8u, 0xd4u, 0x9bu, 0x0fu, 0x13u,
- 0x3cu, 0x89u, 0x67u, 0xc0u, 0x71u, 0xaau, 0xb6u, 0xf5u,
- 0xa4u, 0xbeu, 0xfdu, 0x8cu, 0x12u, 0x00u, 0x97u, 0xdau,
- 0x78u, 0xe1u, 0xcfu, 0x6bu, 0x39u, 0x43u, 0x55u, 0x26u,
- 0x30u, 0x98u, 0xccu, 0xddu, 0xebu, 0x54u, 0xb3u, 0x8fu,
- 0x4eu, 0x16u, 0xfau, 0x22u, 0xa5u, 0x77u, 0x09u, 0x61u,
- 0xd6u, 0x2au, 0x53u, 0x37u, 0x45u, 0xc1u, 0x6cu, 0xaeu,
- 0xefu, 0x70u, 0x08u, 0x99u, 0x8bu, 0x1du, 0xf2u, 0xb4u,
- 0xe9u, 0xc7u, 0x9fu, 0x4au, 0x31u, 0x25u, 0xfeu, 0x7cu,
- 0xd3u, 0xa2u, 0xbdu, 0x56u, 0x14u, 0x88u, 0x60u, 0x0bu,
- 0xcdu, 0xe2u, 0x34u, 0x50u, 0x9eu, 0xdcu, 0x11u, 0x05u,
- 0x2bu, 0xb7u, 0xa9u, 0x48u, 0xffu, 0x66u, 0x8au, 0x73u,
- 0x03u, 0x75u, 0x86u, 0xf1u, 0x6au, 0xa7u, 0x40u, 0xc2u,
- 0xb9u, 0x2cu, 0xdbu, 0x1fu, 0x58u, 0x94u, 0x3eu, 0xedu,
- 0xfcu, 0x1bu, 0xa0u, 0x04u, 0xb8u, 0x8du, 0xe6u, 0x59u,
- 0x62u, 0x93u, 0x35u, 0x7eu, 0xcau, 0x21u, 0xdfu, 0x47u,
- 0x15u, 0xf3u, 0xbau, 0x7fu, 0xa6u, 0x69u, 0xc8u, 0x4du,
- 0x87u, 0x3bu, 0x9cu, 0x01u, 0xe0u, 0xdeu, 0x24u, 0x52u,
- 0x7bu, 0x0cu, 0x68u, 0x1eu, 0x80u, 0xb2u, 0x5au, 0xe7u,
- 0xadu, 0xd5u, 0x23u, 0xf4u, 0x46u, 0x3fu, 0x91u, 0xc9u,
- 0x6eu, 0x84u, 0x72u, 0xbbu, 0x0du, 0x18u, 0xd9u, 0x96u,
- 0xf0u, 0x5fu, 0x41u, 0xacu, 0x27u, 0xc5u, 0xe3u, 0x3au,
- 0x81u, 0x6fu, 0x07u, 0xa3u, 0x79u, 0xf6u, 0x2du, 0x38u,
- 0x1au, 0x44u, 0x5eu, 0xb5u, 0xd2u, 0xecu, 0xcbu, 0x90u,
- 0x9au, 0x36u, 0xe5u, 0x29u, 0xc3u, 0x4fu, 0xabu, 0x64u,
- 0x51u, 0xf8u, 0x10u, 0xd7u, 0xbcu, 0x02u, 0x7du, 0x8eu
-};
-
-/* S1 (8-bit S-box based on inverse function) */
-
-static const unsigned char clefia_s1[256] =
-{
- 0x6cu, 0xdau, 0xc3u, 0xe9u, 0x4eu, 0x9du, 0x0au, 0x3du,
- 0xb8u, 0x36u, 0xb4u, 0x38u, 0x13u, 0x34u, 0x0cu, 0xd9u,
- 0xbfu, 0x74u, 0x94u, 0x8fu, 0xb7u, 0x9cu, 0xe5u, 0xdcu,
- 0x9eu, 0x07u, 0x49u, 0x4fu, 0x98u, 0x2cu, 0xb0u, 0x93u,
- 0x12u, 0xebu, 0xcdu, 0xb3u, 0x92u, 0xe7u, 0x41u, 0x60u,
- 0xe3u, 0x21u, 0x27u, 0x3bu, 0xe6u, 0x19u, 0xd2u, 0x0eu,
- 0x91u, 0x11u, 0xc7u, 0x3fu, 0x2au, 0x8eu, 0xa1u, 0xbcu,
- 0x2bu, 0xc8u, 0xc5u, 0x0fu, 0x5bu, 0xf3u, 0x87u, 0x8bu,
- 0xfbu, 0xf5u, 0xdeu, 0x20u, 0xc6u, 0xa7u, 0x84u, 0xceu,
- 0xd8u, 0x65u, 0x51u, 0xc9u, 0xa4u, 0xefu, 0x43u, 0x53u,
- 0x25u, 0x5du, 0x9bu, 0x31u, 0xe8u, 0x3eu, 0x0du, 0xd7u,
- 0x80u, 0xffu, 0x69u, 0x8au, 0xbau, 0x0bu, 0x73u, 0x5cu,
- 0x6eu, 0x54u, 0x15u, 0x62u, 0xf6u, 0x35u, 0x30u, 0x52u,
- 0xa3u, 0x16u, 0xd3u, 0x28u, 0x32u, 0xfau, 0xaau, 0x5eu,
- 0xcfu, 0xeau, 0xedu, 0x78u, 0x33u, 0x58u, 0x09u, 0x7bu,
- 0x63u, 0xc0u, 0xc1u, 0x46u, 0x1eu, 0xdfu, 0xa9u, 0x99u,
- 0x55u, 0x04u, 0xc4u, 0x86u, 0x39u, 0x77u, 0x82u, 0xecu,
- 0x40u, 0x18u, 0x90u, 0x97u, 0x59u, 0xddu, 0x83u, 0x1fu,
- 0x9au, 0x37u, 0x06u, 0x24u, 0x64u, 0x7cu, 0xa5u, 0x56u,
- 0x48u, 0x08u, 0x85u, 0xd0u, 0x61u, 0x26u, 0xcau, 0x6fu,
- 0x7eu, 0x6au, 0xb6u, 0x71u, 0xa0u, 0x70u, 0x05u, 0xd1u,
- 0x45u, 0x8cu, 0x23u, 0x1cu, 0xf0u, 0xeeu, 0x89u, 0xadu,
- 0x7au, 0x4bu, 0xc2u, 0x2fu, 0xdbu, 0x5au, 0x4du, 0x76u,
- 0x67u, 0x17u, 0x2du, 0xf4u, 0xcbu, 0xb1u, 0x4au, 0xa8u,
- 0xb5u, 0x22u, 0x47u, 0x3au, 0xd5u, 0x10u, 0x4cu, 0x72u,
- 0xccu, 0x00u, 0xf9u, 0xe0u, 0xfdu, 0xe2u, 0xfeu, 0xaeu,
- 0xf8u, 0x5fu, 0xabu, 0xf1u, 0x1bu, 0x42u, 0x81u, 0xd6u,
- 0xbeu, 0x44u, 0x29u, 0xa6u, 0x57u, 0xb9u, 0xafu, 0xf2u,
- 0xd4u, 0x75u, 0x66u, 0xbbu, 0x68u, 0x9fu, 0x50u, 0x02u,
- 0x01u, 0x3cu, 0x7fu, 0x8du, 0x1au, 0x88u, 0xbdu, 0xacu,
- 0xf7u, 0xe4u, 0x79u, 0x96u, 0xa2u, 0xfcu, 0x6du, 0xb2u,
- 0x6bu, 0x03u, 0xe1u, 0x2eu, 0x7du, 0x14u, 0x95u, 0x1du
-};
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-static void bytecpy(unsigned char *dst, const unsigned char *src, int bytelen)
-{
- while (bytelen-- > 0)
- {
- *dst++ = *src++;
- }
-}
-
-static unsigned char clefiamul2(unsigned char x)
-{
- /* multiplication over GF(2^8) (p(x) = '11d') */
-
- if (x & 0x80u)
- {
- x ^= 0x0eu;
- }
-
- return ((x << 1) | (x >> 7));
-}
-
-static void clefiaf0xor(unsigned char *dst, const unsigned char *src,
- const unsigned char *rk)
-{
- unsigned char x[4];
- unsigned char y[4];
- unsigned char z[4];
-
- /* F0 */
-
- /* Key addition */
-
- bytexor(x, src, rk, 4);
-
- /* Substitution layer */
-
- z[0] = clefia_s0[x[0]];
- z[1] = clefia_s1[x[1]];
- z[2] = clefia_s0[x[2]];
- z[3] = clefia_s1[x[3]];
-
- /* Diffusion layer (M0) */
-
- y[0] = z[0] ^ clefiamul2(z[1]) ^ clefiamul4(z[2]) ^ clefiamul6(z[3]);
- y[1] = clefiamul2(z[0]) ^ z[1] ^ clefiamul6(z[2]) ^ clefiamul4(z[3]);
- y[2] = clefiamul4(z[0]) ^ clefiamul6(z[1]) ^ z[2] ^ clefiamul2(z[3]);
- y[3] = clefiamul6(z[0]) ^ clefiamul4(z[1]) ^ clefiamul2(z[2]) ^ z[3];
-
- /* Xoring after F0 */
-
- bytecpy(dst + 0, src + 0, 4);
- bytexor(dst + 4, src + 4, y, 4);
-}
-
-static void clefiaf1xor(unsigned char *dst, const unsigned char *src,
- const unsigned char *rk)
-{
- unsigned char x[4];
- unsigned char y[4];
- unsigned char z[4];
-
- /* F1 */
-
- /* Key addition */
-
- bytexor(x, src, rk, 4);
-
- /* Substitution layer */
-
- z[0] = clefia_s1[x[0]];
- z[1] = clefia_s0[x[1]];
- z[2] = clefia_s1[x[2]];
- z[3] = clefia_s0[x[3]];
-
- /* Diffusion layer (M1) */
-
- y[0] = z[0] ^ clefiamul8(z[1]) ^ clefiamul2(z[2]) ^ clefiamula(z[3]);
- y[1] = clefiamul8(z[0]) ^ z[1] ^ clefiamula(z[2]) ^ clefiamul2(z[3]);
- y[2] = clefiamul2(z[0]) ^ clefiamula(z[1]) ^ z[2] ^ clefiamul8(z[3]);
- y[3] = clefiamula(z[0]) ^ clefiamul2(z[1]) ^ clefiamul8(z[2]) ^ z[3];
-
- /* Xoring after F1 */
-
- bytecpy(dst + 0, src + 0, 4);
- bytexor(dst + 4, src + 4, y, 4);
-}
-
-static void clefiagfn4(unsigned char *y, const unsigned char *x,
- const unsigned char *rk, int r)
-{
- unsigned char fin[16];
- unsigned char fout[16];
-
- bytecpy(fin, x, 16);
- while (r-- > 0)
- {
- clefiaf0xor(fout + 0, fin + 0, rk + 0);
- clefiaf1xor(fout + 8, fin + 8, rk + 4);
- rk += 8;
- if (r)
- {
- /* swapping for encryption */
-
- bytecpy(fin + 0, fout + 4, 12);
- bytecpy(fin + 12, fout + 0, 4);
- }
- }
-
- bytecpy(y, fout, 16);
-}
-
-#if 0 /* Not used */
-static void clefiagfn8(unsigned char *y, const unsigned char *x,
- const unsigned char *rk, int r)
-{
- unsigned char fin[32];
- unsigned char fout[32];
-
- bytecpy(fin, x, 32);
- while (r-- > 0)
- {
- clefiaf0xor(fout + 0, fin + 0, rk + 0);
- clefiaf1xor(fout + 8, fin + 8, rk + 4);
- clefiaf0xor(fout + 16, fin + 16, rk + 8);
- clefiaf1xor(fout + 24, fin + 24, rk + 12);
- rk += 16;
- if (r)
- {
- /* swapping for encryption */
-
- bytecpy(fin + 0, fout + 4, 28);
- bytecpy(fin + 28, fout + 0, 4);
- }
- }
-
- bytecpy(y, fout, 32);
-}
-#endif
-
-#if 0 /* Not used */
-static void clefiagfn4inv(unsigned char *y, const unsigned char *x,
- const unsigned char *rk, int r)
-{
- unsigned char fin[16];
- unsigned char fout[16];
-
- rk += (r - 1) * 8;
- bytecpy(fin, x, 16);
- while (r-- > 0)
- {
- clefiaf0xor(fout + 0, fin + 0, rk + 0);
- clefiaf1xor(fout + 8, fin + 8, rk + 4);
- rk -= 8;
- if (r)
- {
- /* swapping for decryption */
-
- bytecpy(fin + 0, fout + 12, 4);
- bytecpy(fin + 4, fout + 0, 12);
- }
- }
-
- bytecpy(y, fout, 16);
-}
-#endif
-
-static void clefiadoubleswap(unsigned char *lk)
-{
- unsigned char t[16];
-
- t[0] = (lk[0] << 7) | (lk[1] >> 1);
- t[1] = (lk[1] << 7) | (lk[2] >> 1);
- t[2] = (lk[2] << 7) | (lk[3] >> 1);
- t[3] = (lk[3] << 7) | (lk[4] >> 1);
- t[4] = (lk[4] << 7) | (lk[5] >> 1);
- t[5] = (lk[5] << 7) | (lk[6] >> 1);
- t[6] = (lk[6] << 7) | (lk[7] >> 1);
- t[7] = (lk[7] << 7) | (lk[15] & 0x7fu);
-
- t[8] = (lk[8] >> 7) | (lk[0] & 0xfeu);
- t[9] = (lk[9] >> 7) | (lk[8] << 1);
- t[10] = (lk[10] >> 7) | (lk[9] << 1);
- t[11] = (lk[11] >> 7) | (lk[10] << 1);
- t[12] = (lk[12] >> 7) | (lk[11] << 1);
- t[13] = (lk[13] >> 7) | (lk[12] << 1);
- t[14] = (lk[14] >> 7) | (lk[13] << 1);
- t[15] = (lk[15] >> 7) | (lk[14] << 1);
-
- bytecpy(lk, t, 16);
-}
-
-static void clefiaconset(unsigned char *con, const unsigned char *iv, int lk)
-{
- unsigned char t[2];
- unsigned char tmp;
-
- bytecpy(t, iv, 2);
- while (lk-- > 0)
- {
- con[0] = t[0] ^ 0xb7u; /* P_16 = 0xb7e1 (natural logarithm) */
- con[1] = t[1] ^ 0xe1u;
- con[2] = ~((t[0] << 1) | (t[1] >> 7));
- con[3] = ~((t[1] << 1) | (t[0] >> 7));
- con[4] = ~t[0] ^ 0x24u; /* Q_16 = 0x243f (circle ratio) */
- con[5] = ~t[1] ^ 0x3fu;
- con[6] = t[1];
- con[7] = t[0];
- con += 8;
-
- /* updating T */
-
- if (t[1] & 0x01u)
- {
- t[0] ^= 0xa8u;
- t[1] ^= 0x30u;
- }
-
- tmp = t[0] << 7;
- t[0] = (t[0] >> 1) | (t[1] << 7);
- t[1] = (t[1] >> 1) | tmp;
- }
-}
-
-static void left_shift_one(uint8_t * in, uint8_t * out)
-{
- int i;
- int overflow;
-
- overflow = 0;
- for (i = 15; i >= 0; i--)
- {
- out[i] = in[i] << 1;
- out[i] |= overflow;
- overflow = (in[i] >> 7) & 1;
- }
-}
-
-static void gen_subkey(struct cipher *c)
-{
- uint8_t L[16];
-
- memset(L, 0, 16);
- clefiaencrypt(L, L, c->rk, c->round);
-
- left_shift_one(L, c->k1);
- if (L[0] & 0x80)
- {
- c->k1[15] = c->k1[15] ^ 0x87;
- }
-
- left_shift_one(c->k1, c->k2);
- if (c->k1[0] & 0x80)
- {
- c->k2[15] = c->k2[15] ^ 0x87;
- }
-
- memset(L, 0, 16);
-}
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-struct cipher *cipher_init(uint8_t * key, uint8_t * iv)
-{
- struct cipher *c;
-
- c = (struct cipher *)malloc(sizeof(*c));
- if (!c)
- {
- return NULL;
- }
-
- c->round = clefiakeyset(c->rk, key);
-
- gen_subkey(c);
- memset(c->vector, 0, 16);
-
- return c;
-}
-
-void cipher_deinit(struct cipher *c)
-{
- memset(c, 0, sizeof(*c));
- free(c);
-}
-
-int cipher_calc_cmac(struct cipher *c, void *data, int size, void *cmac)
-{
- uint8_t m[16];
- uint8_t *p;
-
- if (size & 0xf)
- {
- return -1;
- }
-
- p = (uint8_t *) data;
- while (size)
- {
- bytexor(m, c->vector, p, 16);
- clefiaencrypt(c->vector, m, c->rk, c->round);
- size -= 16;
- p += 16;
- }
-
- bytexor(cmac, m, c->k1, 16);
- clefiaencrypt(cmac, cmac, c->rk, c->round);
- memset(m, 0, 16);
-
- return 0;
-}
-
-void bytexor(unsigned char *dst, const unsigned char *a,
- const unsigned char *b, int bytelen)
-{
- while (bytelen-- > 0)
- {
- *dst++ = *a++ ^ *b++;
- }
-}
-
-int clefiakeyset(unsigned char *rk, const unsigned char *skey)
-{
- const unsigned char iv[2] =
- {
- 0x42u, 0x8au /* cubic root of 2 */
- };
-
- unsigned char lk[16];
- unsigned char con128[4 * 60];
- int i;
-
- /* generating CONi^(128) (0 <= i < 60, lk = 30) */
-
- clefiaconset(con128, iv, 30);
-
- /* GFN_{4,12} (generating L from K) */
-
- clefiagfn4(lk, skey, con128, 12);
-
- bytecpy(rk, skey, 8); /* initial whitening key (WK0, WK1) */
- rk += 8;
- for (i = 0; i < 9; i++)
- {
- /* round key (RKi (0 <= i < 36)) */
-
- bytexor(rk, lk, con128 + i * 16 + (4 * 24), 16);
- if (i % 2)
- {
- bytexor(rk, rk, skey, 16); /* Xoring K */
- }
-
- clefiadoubleswap(lk); /* Updating L (DoubleSwap function) */
- rk += 16;
- }
-
- bytecpy(rk, skey + 8, 8); /* final whitening key (WK2, WK3) */
-
- return 18;
-}
-
-void clefiaencrypt(unsigned char *ct, const unsigned char *pt,
- const unsigned char *rk, const int r)
-{
- unsigned char rin[16];
- unsigned char rout[16];
-
- bytecpy(rin, pt, 16);
-
- bytexor(rin + 4, rin + 4, rk + 0, 4); /* initial key whitening */
- bytexor(rin + 12, rin + 12, rk + 4, 4);
- rk += 8;
-
- clefiagfn4(rout, rin, rk, r); /* GFN_{4,r} */
-
- bytecpy(ct, rout, 16);
- bytexor(ct + 4, ct + 4, rk + r * 8 + 0, 4); /* final key whitening */
- bytexor(ct + 12, ct + 12, rk + r * 8 + 4, 4);
-}
diff --git a/tinyusb/hw/mcu/sony/cxd56/mkspk/clefia.h b/tinyusb/hw/mcu/sony/cxd56/mkspk/clefia.h
deleted file mode 100755
index a0e02587..00000000
--- a/tinyusb/hw/mcu/sony/cxd56/mkspk/clefia.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
- * tools/cxd56/clefia.h
- *
- * Copyright (C) 2007, 2008 Sony Corporation
- *
- * 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 NuttX 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.
- *****************************************************************************/
-
-#ifndef _TOOLS_CXD56_CLEFIA_H_
-#define _TOOLS_CXD56_CLEFIA_H_
-
-/****************************************************************************
- * Public Types
- ****************************************************************************/
-
-struct cipher
- {
- int mode;
- int dir;
- uint8_t rk[8 * 26 + 16];
- uint8_t vector[16];
- int round;
- uint8_t k1[16];
- uint8_t k2[16];
- };
-
-/****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
-
-struct cipher *cipher_init(uint8_t * key, uint8_t * iv);
-void cipher_deinit(struct cipher *c);
-int cipher_calc_cmac(struct cipher *c, void *data, int size, void *cmac);
-void bytexor(unsigned char *dst, const unsigned char *a,
- const unsigned char *b, int bytelen);
-int clefiakeyset(unsigned char *rk, const unsigned char *skey);
-void clefiaencrypt(unsigned char *ct, const unsigned char *pt,
- const unsigned char *rk, const int r);
-
-#endif
diff --git a/tinyusb/hw/mcu/sony/cxd56/mkspk/elf32.h b/tinyusb/hw/mcu/sony/cxd56/mkspk/elf32.h
deleted file mode 100755
index 94a9c81b..00000000
--- a/tinyusb/hw/mcu/sony/cxd56/mkspk/elf32.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/****************************************************************************
- * include/elf32.h
- *
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <gnutt@nuttx.org>
- *
- * Reference: System V Application Binary Interface, Edition 4.1, March 18,
- * 1997, The Santa Cruz Operation, Inc.
- *
- * 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 NuttX 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.
- *
- ****************************************************************************/
-
-#ifndef __INCLUDE_ELF32_H
-#define __INCLUDE_ELF32_H
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <stdint.h>
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#define EI_NIDENT 16 /* Size of e_ident[] */
-
-#define ELF32_ST_BIND(i) ((i) >> 4)
-#define ELF32_ST_TYPE(i) ((i) & 0xf)
-#define ELF32_ST_INFO(b,t) (((b) << 4) | ((t) & 0xf))
-
-/* Definitions for Elf32_Rel*::r_info */
-
-#define ELF32_R_SYM(i) ((i) >> 8)
-#define ELF32_R_TYPE(i) ((i) & 0xff)
-#define ELF32_R_INFO(s,t) (((s)<< 8) | ((t) & 0xff))
-
-#define ELF_R_SYM(i) ELF32_R_SYM(i)
-
-/****************************************************************************
- * Public Type Definitions
- ****************************************************************************/
-
-/* Figure 4.2: 32-Bit Data Types */
-
-typedef uint32_t Elf32_Addr; /* Unsigned program address */
-typedef uint16_t Elf32_Half; /* Unsigned medium integer */
-typedef uint32_t Elf32_Off; /* Unsigned file offset */
-typedef int32_t Elf32_Sword; /* Signed large integer */
-typedef uint32_t Elf32_Word; /* Unsigned large integer */
-
-/* Figure 4-3: ELF Header */
-
-typedef struct
-{
- unsigned char e_ident[EI_NIDENT];
- Elf32_Half e_type;
- Elf32_Half e_machine;
- Elf32_Word e_version;
- Elf32_Addr e_entry;
- Elf32_Off e_phoff;
- Elf32_Off e_shoff;
- Elf32_Word e_flags;
- Elf32_Half e_ehsize;
- Elf32_Half e_phentsize;
- Elf32_Half e_phnum;
- Elf32_Half e_shentsize;
- Elf32_Half e_shnum;
- Elf32_Half e_shstrndx;
-} Elf32_Ehdr;
-
-/* Figure 4-8: Section Header */
-
-typedef struct
-{
- Elf32_Word sh_name;
- Elf32_Word sh_type;
- Elf32_Word sh_flags;
- Elf32_Addr sh_addr;
- Elf32_Off sh_offset;
- Elf32_Word sh_size;
- Elf32_Word sh_link;
- Elf32_Word sh_info;
- Elf32_Word sh_addralign;
- Elf32_Word sh_entsize;
-} Elf32_Shdr;
-
-/* Figure 4-15: Symbol Table Entry */
-
-typedef struct
-{
- Elf32_Word st_name;
- Elf32_Addr st_value;
- Elf32_Word st_size;
- unsigned char st_info;
- unsigned char st_other;
- Elf32_Half st_shndx;
-} Elf32_Sym;
-
-/* Figure 4-19: Relocation Entries */
-
-typedef struct
-{
- Elf32_Addr r_offset;
- Elf32_Word r_info;
-} Elf32_Rel;
-
-typedef struct
-{
- Elf32_Addr r_offset;
- Elf32_Word r_info;
- Elf32_Sword r_addend;
-} Elf32_Rela;
-
-/* Figure 5-1: Program Header */
-
-typedef struct
-{
- Elf32_Word p_type;
- Elf32_Off p_offset;
- Elf32_Addr p_vaddr;
- Elf32_Addr p_paddr;
- Elf32_Word p_filesz;
- Elf32_Word p_memsz;
- Elf32_Word p_flags;
- Elf32_Word p_align;
-} Elf32_Phdr;
-
-/* Figure 5-9: Dynamic Structure */
-
-typedef struct
-{
- Elf32_Sword d_tag;
- union
- {
- Elf32_Word d_val;
- Elf32_Addr d_ptr;
- } d_un;
-} Elf32_Dyn;
-
-typedef Elf32_Addr Elf_Addr;
-typedef Elf32_Ehdr Elf_Ehdr;
-typedef Elf32_Rel Elf_Rel;
-typedef Elf32_Rela Elf_Rela;
-typedef Elf32_Sym Elf_Sym;
-typedef Elf32_Shdr Elf_Shdr;
-typedef Elf32_Word Elf_Word;
-
-#endif /* __INCLUDE_ELF32_H */
diff --git a/tinyusb/hw/mcu/sony/cxd56/mkspk/mkspk.c b/tinyusb/hw/mcu/sony/cxd56/mkspk/mkspk.c
deleted file mode 100755
index c447ad7d..00000000
--- a/tinyusb/hw/mcu/sony/cxd56/mkspk/mkspk.c
+++ /dev/null
@@ -1,383 +0,0 @@
-/****************************************************************************
- * tools/cxd56/mkspk.c
- *
- * Copyright (C) 2007, 2008 Sony Corporation
- *
- * 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 NuttX 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.
- *****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <assert.h>
-
-#include "mkspk.h"
-
-/****************************************************************************
- * Private Types
- ****************************************************************************/
-
-struct args
-{
- int core;
- char *elffile;
- char *savename;
- char *outputfile;
-};
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-static uint8_t vmk[16] =
- "\x27\xc0\xaf\x1b\x5d\xcb\xc6\xc5\x58\x22\x1c\xdd\xaf\xf3\x20\x21";
-
-static struct args g_options =
-{
- 0
-};
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-static struct args *parse_args(int argc, char **argv)
-{
- int opt;
- int show_help;
- struct args *args = &g_options;
- char *endp;
-
- show_help = 0;
-
- if (argc < 2)
- {
- show_help = 1;
- }
-
- memset(args, 0, sizeof(*args));
- args->core = -1;
-
- while ((opt = getopt(argc, argv, "h:c:")) != -1)
- {
- switch (opt)
- {
- case 'c':
- args->core = strtol(optarg, &endp, 0);
- if (*endp)
- {
- fprintf(stderr, "Invalid core number \"%s\"\n", optarg);
- show_help = 1;
- }
- break;
-
- case 'h':
- default:
- show_help = 1;
- }
- }
-
- argc -= optind;
- argv += optind;
-
- args->elffile = argv[0];
- args->savename = argv[1];
- argc -= 2;
- argv += 2;
-
- if (argc > 0)
- {
- args->outputfile = strdup(argv[0]);
- }
- else
- {
- show_help = 1;
- }
-
- /* Sanity checks for options */
-
- if (show_help == 1)
- {
- fprintf(stderr,
- "mkspk [-c <number>] <filename> <save name> [<output file>]\n");
- exit(EXIT_FAILURE);
- }
-
- if (args->core < 0)
- {
- fprintf(stderr, "Core number is not set. Please use -c option.\n");
- exit(EXIT_FAILURE);
- }
-
- if (strlen(args->savename) > 63)
- {
- fprintf(stderr, "savename too long.\n");
- exit(EXIT_FAILURE);
- }
-
- return args;
-}
-
-static struct elf_file *load_elf(const char *filename)
-{
- size_t fsize;
- int pos;
- char *buf;
- FILE *fp;
- struct elf_file *ef;
- Elf32_Shdr *sh;
- uint16_t i;
- int ret;
-
- fp = fopen(filename, "rb");
- if (!fp)
- {
- return NULL;
- }
-
- ef = (struct elf_file *)malloc(sizeof(*ef));
- if (!ef)
- {
- return NULL;
- }
-
- pos = fseek(fp, 0, SEEK_END);
- fsize = (size_t) ftell(fp);
- fseek(fp, pos, SEEK_SET);
-
- buf = (char *)malloc(fsize);
- if (!buf)
- {
- return NULL;
- }
-
- ret = fread(buf, fsize, 1, fp);
- fclose(fp);
- if (ret != 1)
- {
- return NULL;
- }
-
- ef->data = buf;
-
- ef->ehdr = (Elf32_Ehdr *) buf;
-
- Elf32_Ehdr *h = (Elf32_Ehdr *) buf;
-
- if (!(h->e_ident[EI_MAG0] == 0x7f &&
- h->e_ident[EI_MAG1] == 'E' &&
- h->e_ident[EI_MAG2] == 'L' && h->e_ident[EI_MAG3] == 'F'))
- {
- free(ef);
- free(buf);
- return NULL;
- }
-
- ef->phdr = (Elf32_Phdr *) (buf + ef->ehdr->e_phoff);
- ef->shdr = (Elf32_Shdr *) (buf + ef->ehdr->e_shoff);
- ef->shstring = buf + ef->shdr[ef->ehdr->e_shstrndx].sh_offset;
-
- for (i = 0, sh = ef->shdr; i < ef->ehdr->e_shnum; i++, sh++)
- {
- if (sh->sh_type == SHT_SYMTAB)
- {
- ef->symtab = (Elf32_Sym *) (buf + sh->sh_offset);
- ef->nsyms = sh->sh_size / sh->sh_entsize;
- continue;
- }
-
- if (sh->sh_type == SHT_STRTAB)
- {
- if (!strcmp(".strtab", ef->shstring + sh->sh_name))
- {
- ef->string = buf + sh->sh_offset;
- }
- }
- }
-
- return ef;
-}
-
-static void *create_image(struct elf_file *elf, int core, char *savename,
- int *image_size)
-{
- char *img;
- struct spk_header *header;
- struct spk_prog_info *pi;
- Elf32_Phdr *ph;
- Elf32_Sym *sym;
- char *name;
- int snlen;
- int nphs, psize, imgsize;
- int i;
- int j;
- uint32_t offset;
- uint32_t sp;
-
- snlen = alignup(strlen(savename) + 1, 16);
-
- nphs = 0;
- psize = 0;
- for (i = 0, ph = elf->phdr; i < elf->ehdr->e_phnum; i++, ph++)
- {
- if (ph->p_type != PT_LOAD || ph->p_filesz == 0)
- {
- continue;
- }
-
- nphs++;
- psize += alignup(ph->p_filesz, 16);
- }
-
- imgsize = sizeof(*header) + snlen + (nphs * 16) + psize;
-
- img = (char *)malloc(imgsize + 32);
- if (!img)
- {
- return NULL;
- }
-
- *image_size = imgsize;
- sym = elf->symtab;
- name = elf->string;
- sp = 0;
-
- for (j = 0; j < elf->nsyms; j++, sym++)
- {
- if (!strcmp("__stack", name + sym->st_name))
- {
- sp = sym->st_value;
- }
- }
-
- memset(img, 0, imgsize);
-
- header = (struct spk_header *)img;
- header->magic[0] = 0xef;
- header->magic[1] = 'M';
- header->magic[2] = 'O';
- header->magic[3] = 'D';
- header->cpu = core;
-
- header->entry = elf->ehdr->e_entry;
- header->stack = sp;
- header->core = core;
-
- header->binaries = nphs;
- header->phoffs = sizeof(*header) + snlen;
- header->mode = 0777;
-
- strncpy(img + sizeof(*header), savename, 63);
-
- ph = elf->phdr;
- pi = (struct spk_prog_info *)(img + header->phoffs);
- offset = ((char *)pi - img) + (nphs * sizeof(*pi));
- for (i = 0; i < elf->ehdr->e_phnum; i++, ph++)
- {
- if (ph->p_type != PT_LOAD || ph->p_filesz == 0)
- continue;
- pi->load_address = ph->p_paddr;
- pi->offset = offset;
- pi->size = alignup(ph->p_filesz, 16); /* need 16 bytes align for
- * decryption */
- pi->memsize = ph->p_memsz;
-
- memcpy(img + pi->offset, elf->data + ph->p_offset, ph->p_filesz);
-
- offset += alignup(ph->p_filesz, 16);
- pi++;
- }
-
- return img;
-}
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-int main(int argc, char **argv)
-{
- struct args *args;
- struct elf_file *elf;
- struct cipher *c;
- uint8_t *spkimage;
- int size = 0;
- FILE *fp;
- char footer[16];
-
- args = parse_args(argc, argv);
-
- elf = load_elf(args->elffile);
- if (!elf)
- {
- fprintf(stderr, "Loading ELF %s failure.\n", args->elffile);
- exit(EXIT_FAILURE);
- }
-
- spkimage = create_image(elf, args->core, args->savename, &size);
- free(elf);
-
- c = cipher_init(vmk, NULL);
- cipher_calc_cmac(c, spkimage, size, (uint8_t *) spkimage + size);
- cipher_deinit(c);
-
- size += 16; /* Extend CMAC size */
-
- snprintf(footer, 16, "MKSPK_BN_HOOTER");
- footer[15] = '\0';
-
- fp = fopen(args->outputfile, "wb");
- if (!fp)
- {
- fprintf(stderr, "Output file open error.\n");
- free(spkimage);
- exit(EXIT_FAILURE);
- }
-
- fwrite(spkimage, size, 1, fp);
- fwrite(footer, 16, 1, fp);
-
- fclose(fp);
-
- printf("File %s is successfully created.\n", args->outputfile);
- free(args->outputfile);
-
- memset(spkimage, 0, size);
- free(spkimage);
-
- exit(EXIT_SUCCESS);
-}
diff --git a/tinyusb/hw/mcu/sony/cxd56/mkspk/mkspk.h b/tinyusb/hw/mcu/sony/cxd56/mkspk/mkspk.h
deleted file mode 100755
index 5c1b979c..00000000
--- a/tinyusb/hw/mcu/sony/cxd56/mkspk/mkspk.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
- * tools/cxd56/mkspk.h
- *
- * Copyright (C) 2007, 2008 Sony Corporation
- *
- * 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 NuttX 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.
- *****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include "clefia.h"
-#include "elf32.h"
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#define EI_MAG0 0 /* File identification */
-#define EI_MAG1 1
-#define EI_MAG2 2
-#define EI_MAG3 3
-
-#define SHT_SYMTAB 2
-#define SHT_STRTAB 3
-
-#define PT_LOAD 1
-
-#define alignup(x, a) (((x) + ((a) - 1)) & ~((a) - 1))
-#define swap(a, b) { (a) ^= (b); (b) ^= (a); (a) ^= (b); }
-
-/****************************************************************************
- * Public Types
- ****************************************************************************/
-
-struct spk_header
- {
- uint8_t magic[4];
- uint8_t cpu;
- uint8_t reserved[11];
- uint32_t entry;
- uint32_t stack;
- uint16_t core;
- uint16_t binaries;
- uint16_t phoffs;
- uint16_t mode;
- };
-
-struct spk_prog_info
- {
- uint32_t load_address;
- uint32_t offset;
- uint32_t size;
- uint32_t memsize;
- };
-
-struct elf_file
- {
- Elf32_Ehdr *ehdr;
- Elf32_Phdr *phdr;
- Elf32_Shdr *shdr;
- Elf32_Sym *symtab;
- int nsyms;
- char *shstring;
- char *string;
- char *data;
- };
diff --git a/tinyusb/hw/mcu/sony/cxd56/tools/__pycache__/xmodem.cpython-36.pyc b/tinyusb/hw/mcu/sony/cxd56/tools/__pycache__/xmodem.cpython-36.pyc
deleted file mode 100755
index cfa917f7..00000000
--- a/tinyusb/hw/mcu/sony/cxd56/tools/__pycache__/xmodem.cpython-36.pyc
+++ /dev/null
Binary files differ
diff --git a/tinyusb/hw/mcu/sony/cxd56/tools/flash_writer.py b/tinyusb/hw/mcu/sony/cxd56/tools/flash_writer.py
deleted file mode 100755
index 840f10c3..00000000
--- a/tinyusb/hw/mcu/sony/cxd56/tools/flash_writer.py
+++ /dev/null
@@ -1,580 +0,0 @@
-#! /usr/bin/env python3
-
-# Copyright (C) 2018 Sony Semiconductor Solutions Corp.
-#
-# 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 NuttX 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.
-#
-
-import time
-import sys
-import os
-import struct
-import glob
-import fnmatch
-import errno
-import telnetlib
-import argparse
-import shutil
-import subprocess
-import re
-import xmodem
-
-import_serial_module = True
-
-# When SDK release, plase set SDK_RELEASE as True.
-SDK_RELEASE = False
-
-if SDK_RELEASE :
- PRINT_RAW_COMMAND = False
- REBOOT_AT_END = True
-else :
- PRINT_RAW_COMMAND = True
- REBOOT_AT_END = True
-
-try:
- import serial
-except:
- import_serial_module = False
-
-# supported environment various
-# CXD56_PORT
-# CXD56_TELNETSRV_PORT
-# CXD56_TELNETSRV_IP
-
-PROTOCOL_SERIAL = 0
-PROTOCOL_TELNET = 1
-
-MAX_DOT_COUNT = 70
-
-# configure parameters and default value
-class ConfigArgs:
- PROTOCOL_TYPE = None
- SERIAL_PORT = "COM1"
- SERVER_PORT = 4569
- SERVER_IP = "localhost"
- EOL = bytes([10])
- WAIT_RESET = True
- AUTO_RESET = False
- DTR_RESET = False
- XMODEM_BAUD = 0
- NO_SET_BOOTABLE = False
- PACKAGE_NAME = []
- FILE_NAME = []
- ERASE_NAME = []
- PKGSYS_NAME = []
- PKGAPP_NAME = []
- PKGUPD_NAME = []
-
-ROM_MSG = [b"Welcome to nash"]
-XMDM_MSG = "Waiting for XMODEM (CRC or 1K) transfer. Ctrl-X to cancel."
-
-class ConfigArgsLoader():
- def __init__(self):
- self.parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter)
- self.parser.add_argument("package_name", help="the name of the package to install", nargs='*')
- self.parser.add_argument("-f", "--file", dest="file_name", help="save file", action='append')
- self.parser.add_argument("-e", "--erase", dest="erase_name", help="erase file", action='append')
-
- self.parser.add_argument("-S", "--sys", dest="pkgsys_name", help="the name of the system package to install", action='append')
- self.parser.add_argument("-A", "--app", dest="pkgapp_name", help="the name of the application package to install", action='append')
- self.parser.add_argument("-U", "--upd", dest="pkgupd_name", help="the name of the updater package to install", action='append')
-
- self.parser.add_argument("-a", "--auto-reset", dest="auto_reset",
- action="store_true", default=None,
- help="try to auto reset develop board if possible")
- self.parser.add_argument("-d", "--dtr-reset", dest="dtr_reset",
- action="store_true", default=None,
- help="try to auto reset develop board if possible")
- self.parser.add_argument("-n", "--no-set-bootable", dest="no_set_bootable",
- action="store_true", default=None,
- help="not to set bootable")
-
- group = self.parser.add_argument_group()
- group.add_argument("-i", "--server-ip", dest="server_ip",
- help="the ip address connected to the telnet server")
- group.add_argument("-p", "--server-port", dest="server_port", type=int,
- help="the port connected to the telnet server")
-
- group = self.parser.add_argument_group()
- group.add_argument("-c", "--serial-port", dest="serial_port", help="the serial port")
- group.add_argument("-b", "--xmodem-baudrate", dest="xmodem_baud", help="Use the faster baudrate in xmodem")
-
- mutually_group = self.parser.add_mutually_exclusive_group()
- mutually_group.add_argument("-t", "--telnet-protocol", dest="telnet_protocol",
- action="store_true", default=None,
- help="use the telnet protocol for binary transmission")
- mutually_group.add_argument("-s", "--serial-protocol", dest="serial_protocol",
- action="store_true", default=None,
- help="use the serial port for binary transmission, default options")
-
- mutually_group2 = self.parser.add_mutually_exclusive_group()
- mutually_group2.add_argument("-F", "--force-wait-reset", dest="wait_reset",
- action="store_true", default=None,
- help="force wait for pressing RESET button")
- mutually_group2.add_argument("-N", "--no-wait-reset", dest="wait_reset",
- action="store_false", default=None,
- help="if possible, skip to wait for pressing RESET button")
-
- def update_config(self):
- args = self.parser.parse_args()
-
- ConfigArgs.PACKAGE_NAME = args.package_name
- ConfigArgs.FILE_NAME = args.file_name
- ConfigArgs.ERASE_NAME = args.erase_name
- ConfigArgs.PKGSYS_NAME = args.pkgsys_name
- ConfigArgs.PKGAPP_NAME = args.pkgapp_name
- ConfigArgs.PKGUPD_NAME = args.pkgupd_name
-
- # Get serial port or telnet server ip etc
- if args.serial_protocol == True:
- ConfigArgs.PROTOCOL_TYPE = PROTOCOL_SERIAL
- elif args.telnet_protocol == True:
- ConfigArgs.PROTOCOL_TYPE = PROTOCOL_TELNET
-
- if ConfigArgs.PROTOCOL_TYPE == None:
- proto = os.environ.get("CXD56_PROTOCOL")
- if proto is not None:
- if 's' in proto:
- ConfigArgs.PROTOCOL_TYPE = PROTOCOL_SERIAL
- elif 't' in proto:
- ConfigArgs.PROTOCOL_TYPE = PROTOCOL_TELNET
-
- if ConfigArgs.PROTOCOL_TYPE == None:
- ConfigArgs.PROTOCOL_TYPE = PROTOCOL_SERIAL
-
- if ConfigArgs.PROTOCOL_TYPE == PROTOCOL_SERIAL:
- if args.serial_port is not None:
- ConfigArgs.SERIAL_PORT = args.serial_port
- else:
- # Get serial port from the environment
- port = os.environ.get("CXD56_PORT")
- if port is not None:
- ConfigArgs.SERIAL_PORT = port
- else:
- print("CXD56_PORT is not set, Use " + ConfigArgs.SERIAL_PORT + ".")
- else:
- ConfigArgs.PROTOCOL_TYPE = PROTOCOL_TELNET
- if args.server_port is not None:
- ConfigArgs.SERVER_PORT = args.server_port
- else:
- port = os.environ.get("CXD56_TELNETSRV_PORT")
- if port is not None:
- ConfigArgs.SERVER_PORT = port
- else:
- print("CXD56_TELNETSRV_PORT is not set, Use " + str(ConfigArgs.SERVER_PORT) + ".")
- if args.server_ip is not None:
- ConfigArgs.SERVER_IP = args.server_ip
- else:
- ip = os.environ.get("CXD56_TELNETSRV_IP")
- if ip is not None:
- ConfigArgs.SERVER_IP = ip
- else:
- print("CXD56_TELNETSRV_IP is not set, Use " + ConfigArgs.SERVER_IP + ".")
-
- if args.xmodem_baud is not None:
- ConfigArgs.XMODEM_BAUD = args.xmodem_baud
-
- if args.auto_reset is not None:
- ConfigArgs.AUTO_RESET = args.auto_reset
-
- if args.dtr_reset is not None:
- ConfigArgs.DTR_RESET = args.dtr_reset
-
- if args.no_set_bootable is not None:
- ConfigArgs.NO_SET_BOOTABLE = args.no_set_bootable
-
- if args.wait_reset is not None:
- ConfigArgs.WAIT_RESET = args.wait_reset
-
-class TelnetDev:
- def __init__(self):
- srv_ipaddr = ConfigArgs.SERVER_IP
- srv_port = ConfigArgs.SERVER_PORT
- self.recvbuf = b'';
- try:
- self.telnet = telnetlib.Telnet(host=srv_ipaddr, port=srv_port, timeout=10)
- # There is a ack to be sent after connecting to the telnet server.
- self.telnet.write(b"\xff")
- except Exception as e:
- print("Cannot connect to the server %s:%d" % (srv_ipaddr, srv_port))
- sys.exit(e.args[0])
-
- def readline(self, size=None):
- res = b''
- ch = b''
- while ch != ConfigArgs.EOL:
- ch = self.getc_raw(1, timeout=0.1)
- if ch == b'':
- return res
- res += ch
- return res
-
- def getc_raw(self, size, timeout=1):
- res = b''
- tm = time.monotonic()
- while size > 0:
- while self.recvbuf == b'':
- self.recvbuf = self.telnet.read_eager()
- if self.recvbuf == b'':
- if (time.monotonic() - tm) > timeout:
- return res
- time.sleep(0.1)
- res += self.recvbuf[0:1]
- self.recvbuf = self.recvbuf[1:]
- size -= 1
- return res
-
- def write(self, buffer):
- self.telnet.write(buffer)
-
- def discard_inputs(self, timeout=1.0):
- while True:
- ch = self.getc_raw(1, timeout=timeout)
- if ch == b'':
- break
-
- def getc(self, size, timeout=1):
- c = self.getc_raw(size, timeout)
- return c
-
- def putc(self, buffer, timeout=1):
- self.telnet.write(buffer)
- self.show_progress(len(buffer))
-
- def reboot(self):
- # no-op
- pass
-
- def set_file_size(self, filesize):
- self.bytes_transfered = 0
- self.filesize = filesize
- self.count = 0
-
- def show_progress(self, sendsize):
- if PRINT_RAW_COMMAND:
- if self.count < MAX_DOT_COUNT:
- self.bytes_transfered = self.bytes_transfered + sendsize
- cur_count = int(self.bytes_transfered * MAX_DOT_COUNT / self.filesize)
- if MAX_DOT_COUNT < cur_count:
- cur_count = MAX_DOT_COUNT
- for idx in range(cur_count - self.count):
- print('#',end='')
- sys.stdout.flush()
- self.count = cur_count
- if self.count == MAX_DOT_COUNT:
- print("\n")
-
-class SerialDev:
- def __init__(self):
- if import_serial_module is False:
- print("Cannot import serial module, maybe it's not install yet.")
- print("\n", end="")
- print("Please install python-setuptool by Cygwin installer.")
- print("After that use easy_intall command to install serial module")
- print(" $ cd tool/")
- print(" $ python3 -m easy_install pyserial-2.7.tar.gz")
- quit()
- else:
- port = ConfigArgs.SERIAL_PORT
- try:
- self.serial = serial.Serial(port, baudrate=115200,
- parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE,
- bytesize=serial.EIGHTBITS, timeout=0.1)
- except Exception as e:
- print("Cannot open port : " + port)
- sys.exit(e.args[0])
-
- def readline(self, size=None):
- return self.serial.readline(size)
-
- def write(self, buffer):
- self.serial.write(buffer)
- self.serial.flush()
-
- def discard_inputs(self, timeout=1.0):
- time.sleep(timeout)
- self.serial.flushInput()
-
- def getc(self, size, timeout=1):
- self.serial.timeout = timeout
- c = self.serial.read(size)
- self.serial.timeout = 0.1
- return c
-
- def putc(self, buffer, timeout=1):
- self.serial.timeout = timeout
- self.serial.write(buffer)
- self.serial.flush()
- self.serial.timeout = 0.1
- self.show_progress(len(buffer))
-
- # Note: windows platform dependent code
- def putc_win(self, buffer, timeout=1):
- self.serial.write(buffer)
- self.show_progress(len(buffer))
- while True:
- if self.serial.out_waiting == 0:
- break
-
- def setBaudrate(self, baudrate):
-# self.serial.setBaudrate(baudrate)
- self.serial.baudrate = baudrate
-
- def reboot(self):
- # Target Reset by DTR
- self.serial.setDTR(False)
- self.serial.setDTR(True)
- self.serial.setDTR(False)
-
- def set_file_size(self, filesize):
- self.bytes_transfered = 0
- self.filesize = filesize
- self.count = 0
-
- def show_progress(self, sendsize):
- if PRINT_RAW_COMMAND:
- if self.count < MAX_DOT_COUNT:
- self.bytes_transfered = self.bytes_transfered + sendsize
- cur_count = int(self.bytes_transfered * MAX_DOT_COUNT / self.filesize)
- if MAX_DOT_COUNT < cur_count:
- cur_count = MAX_DOT_COUNT
- for idx in range(cur_count - self.count):
- print('#',end='')
- sys.stdout.flush()
- self.count = cur_count
- if self.count == MAX_DOT_COUNT:
- print("\n")
-
-class FlashWriter:
- def __init__(self, protocol_sel=PROTOCOL_SERIAL):
- if protocol_sel == PROTOCOL_TELNET:
- self.serial = TelnetDev()
- else:
- self.serial = SerialDev()
-
- def cancel_autoboot(self) :
- boot_msg = ''
- self.serial.reboot() # Target reboot before send 'r'
- while boot_msg == '' :
- rx = self.serial.readline().strip()
- self.serial.write(b"r") # Send "r" key to avoid auto boot
- for msg in ROM_MSG :
- if msg in rx :
- boot_msg = msg
- break
- while True :
- rx = self.serial.readline().decode(errors="replace").strip()
- if "updater" in rx :
- # Workaround : Sometime first character is dropped.
- # Send line feed as air shot before actual command.
- self.serial.write(b"\n") # Send line feed
- self.serial.discard_inputs()# Clear input buffer to sync
- return boot_msg.decode(errors="ignore")
-
- def recv(self):
- rx = self.serial.readline()
- if PRINT_RAW_COMMAND :
- serial_line = rx.decode(errors="replace")
- if serial_line.strip() != "" and not serial_line.startswith(XMDM_MSG):
- print(serial_line, end="")
- return rx
-
- def wait(self, string):
- while True:
- rx = self.recv()
- if string.encode() in rx:
- time.sleep(0.1)
- break
-
- def wait_for_prompt(self):
- prompt_pat = re.compile(b"updater")
- while True:
- rx = self.recv()
- if prompt_pat.search(rx):
- time.sleep(0.1)
- break
-
- def send(self, string):
- self.serial.write(str(string).encode() + b"\n")
- rx = self.serial.readline()
- if PRINT_RAW_COMMAND :
- print(rx.decode(errors="replace"), end="")
-
- def read_output(self, prompt_text) :
- output = []
- while True :
- rx = self.serial.readline()
- if prompt_text.encode() in rx :
- time.sleep(0.1)
- break
- if rx != "" :
- output.append(rx.decode(errors="ignore").rstrip())
- return output
-
- def install_files(self, files, command) :
- if ConfigArgs.XMODEM_BAUD:
- command += " -b " + ConfigArgs.XMODEM_BAUD
- if os.name == 'nt':
- modem = xmodem.XMODEM(self.serial.getc, self.serial.putc_win, 'xmodem1k')
- else:
- modem = xmodem.XMODEM(self.serial.getc, self.serial.putc, 'xmodem1k')
- for file in files:
- with open(file, "rb") as bin :
- self.send(command)
- print("Install " + file)
- self.wait(XMDM_MSG)
- print("|0%" +
- "-" * (int(MAX_DOT_COUNT / 2) - 6) +
- "50%" +
- "-" * (MAX_DOT_COUNT - int(MAX_DOT_COUNT / 2) - 5) +
- "100%|")
- if ConfigArgs.XMODEM_BAUD:
- self.serial.setBaudrate(ConfigArgs.XMODEM_BAUD)
- self.serial.discard_inputs() # Clear input buffer to sync
- self.serial.set_file_size(os.path.getsize(file))
- modem.send(bin)
- if ConfigArgs.XMODEM_BAUD:
- self.serial.setBaudrate(115200)
- self.wait_for_prompt()
-
- def save_files(self, files) :
- if ConfigArgs.XMODEM_BAUD:
- command = "save_file -b " + ConfigArgs.XMODEM_BAUD + " -x "
- else:
- command = "save_file -x "
- if os.name == 'nt':
- modem = xmodem.XMODEM(self.serial.getc, self.serial.putc_win, 'xmodem1k')
- else:
- modem = xmodem.XMODEM(self.serial.getc, self.serial.putc, 'xmodem1k')
- for file in files:
- with open(file, "rb") as bin :
- self.send(command + os.path.basename(file))
- print("Save " + file)
- self.wait(XMDM_MSG)
- if ConfigArgs.XMODEM_BAUD:
- self.serial.setBaudrate(ConfigArgs.XMODEM_BAUD)
- self.serial.discard_inputs() # Clear input buffer to sync
- self.serial.set_file_size(os.path.getsize(file))
- modem.send(bin)
- if ConfigArgs.XMODEM_BAUD:
- self.serial.setBaudrate(115200)
- self.wait_for_prompt()
- self.send("chmod d+rw " + os.path.basename(file))
- self.wait_for_prompt()
-
- def delete_files(self, files) :
- for file in files :
- self.delete_binary(file)
-
- def delete_binary(self, bin_name) :
- self.send("rm " + bin_name)
- self.wait_for_prompt()
-
-def main():
- try:
- config_loader = ConfigArgsLoader()
- config_loader.update_config()
- except:
- return errno.EINVAL
-
- # Wait to reset the board
- writer = FlashWriter(ConfigArgs.PROTOCOL_TYPE)
-
- do_wait_reset = True
- if ConfigArgs.AUTO_RESET:
- if subprocess.call("cd " + sys.path[0] + "; ./reset_board.sh", shell=True) == 0:
- print("auto reset board sucess!!")
- do_wait_reset = False
- bootrom_msg = writer.cancel_autoboot()
-
- if ConfigArgs.DTR_RESET:
- do_wait_reset = False
- bootrom_msg = writer.cancel_autoboot()
-
- if ConfigArgs.WAIT_RESET == False and do_wait_reset == True:
- rx = writer.recv()
- time.sleep(1)
- for i in range(3):
- writer.send("")
- rx = writer.recv()
- if "updater".encode() in rx:
- # No need to wait for reset
- do_wait_reset = False
- break
- time.sleep(1)
-
- if do_wait_reset:
- # Wait to reset the board
- print('Please press RESET button on target board')
- sys.stdout.flush()
- bootrom_msg = writer.cancel_autoboot()
-
- # Remove files
- if ConfigArgs.ERASE_NAME :
- print(">>> Remove exisiting files ...")
- writer.delete_files(ConfigArgs.ERASE_NAME)
-
- # Install files
- if ConfigArgs.PACKAGE_NAME or ConfigArgs.PKGSYS_NAME or ConfigArgs.PKGAPP_NAME or ConfigArgs.PKGUPD_NAME:
- print(">>> Install files ...")
- if ConfigArgs.PACKAGE_NAME :
- writer.install_files(ConfigArgs.PACKAGE_NAME, "install")
- if ConfigArgs.PKGSYS_NAME :
- writer.install_files(ConfigArgs.PKGSYS_NAME, "install")
- if ConfigArgs.PKGAPP_NAME :
- writer.install_files(ConfigArgs.PKGAPP_NAME, "install")
- if ConfigArgs.PKGUPD_NAME :
- writer.install_files(ConfigArgs.PKGUPD_NAME, "install -k updater.key")
-
- # Save files
- if ConfigArgs.FILE_NAME :
- print(">>> Save files ...")
- writer.save_files(ConfigArgs.FILE_NAME)
-
- # Set auto boot
- if not ConfigArgs.NO_SET_BOOTABLE:
- print(">>> Save Configuration to FlashROM ...")
- writer.send("set bootable M0P")
- writer.wait_for_prompt()
-
- # Sync all cached data to flash
- writer.send("sync")
- writer.wait_for_prompt()
-
- if REBOOT_AT_END :
- print("Restarting the board ...")
- writer.send("reboot")
-
- return 0
-
-if __name__ == "__main__":
- try:
- sys.exit(main())
- except KeyboardInterrupt:
- print("Canceled by keyboard interrupt.")
- pass
diff --git a/tinyusb/hw/mcu/sony/cxd56/tools/xmodem.py b/tinyusb/hw/mcu/sony/cxd56/tools/xmodem.py
deleted file mode 100755
index c9343005..00000000
--- a/tinyusb/hw/mcu/sony/cxd56/tools/xmodem.py
+++ /dev/null
@@ -1,590 +0,0 @@
-'''
-===============================
- XMODEM file transfer protocol
-===============================
-
-.. $Id$
-
-This is a literal implementation of XMODEM.TXT_, XMODEM1K.TXT_ and
-XMODMCRC.TXT_, support for YMODEM and ZMODEM is pending. YMODEM should
-be fairly easy to implement as it is a hack on top of the XMODEM
-protocol using sequence bytes ``0x00`` for sending file names (and some
-meta data).
-
-.. _XMODEM.TXT: doc/XMODEM.TXT
-.. _XMODEM1K.TXT: doc/XMODEM1K.TXT
-.. _XMODMCRC.TXT: doc/XMODMCRC.TXT
-
-Data flow example including error recovery
-==========================================
-
-Here is a sample of the data flow, sending a 3-block message.
-It includes the two most common line hits - a garbaged block,
-and an ``ACK`` reply getting garbaged. ``CRC`` or ``CSUM`` represents
-the checksum bytes.
-
-XMODEM 128 byte blocks
-----------------------
-
-::
-
- SENDER RECEIVER
-
- <-- NAK
- SOH 01 FE Data[128] CSUM -->
- <-- ACK
- SOH 02 FD Data[128] CSUM -->
- <-- ACK
- SOH 03 FC Data[128] CSUM -->
- <-- ACK
- SOH 04 FB Data[128] CSUM -->
- <-- ACK
- SOH 05 FA Data[100] CPMEOF[28] CSUM -->
- <-- ACK
- EOT -->
- <-- ACK
-
-XMODEM-1k blocks, CRC mode
---------------------------
-
-::
-
- SENDER RECEIVER
-
- <-- C
- STX 01 FE Data[1024] CRC CRC -->
- <-- ACK
- STX 02 FD Data[1024] CRC CRC -->
- <-- ACK
- STX 03 FC Data[1000] CPMEOF[24] CRC CRC -->
- <-- ACK
- EOT -->
- <-- ACK
-
-Mixed 1024 and 128 byte Blocks
-------------------------------
-
-::
-
- SENDER RECEIVER
-
- <-- C
- STX 01 FE Data[1024] CRC CRC -->
- <-- ACK
- STX 02 FD Data[1024] CRC CRC -->
- <-- ACK
- SOH 03 FC Data[128] CRC CRC -->
- <-- ACK
- SOH 04 FB Data[100] CPMEOF[28] CRC CRC -->
- <-- ACK
- EOT -->
- <-- ACK
-
-YMODEM Batch Transmission Session (1 file)
-------------------------------------------
-
-::
-
- SENDER RECEIVER
- <-- C (command:rb)
- SOH 00 FF foo.c NUL[123] CRC CRC -->
- <-- ACK
- <-- C
- SOH 01 FE Data[128] CRC CRC -->
- <-- ACK
- SOH 02 FC Data[128] CRC CRC -->
- <-- ACK
- SOH 03 FB Data[100] CPMEOF[28] CRC CRC -->
- <-- ACK
- EOT -->
- <-- NAK
- EOT -->
- <-- ACK
- <-- C
- SOH 00 FF NUL[128] CRC CRC -->
- <-- ACK
-
-
-'''
-
-__author__ = 'Wijnand Modderman <maze@pyth0n.org>'
-__copyright__ = ['Copyright (c) 2010 Wijnand Modderman',
- 'Copyright (c) 1981 Chuck Forsberg']
-__license__ = 'MIT'
-__version__ = '0.3.2'
-
-import logging
-import time
-import sys
-from functools import partial
-import collections
-
-# Loggerr
-log = logging.getLogger('xmodem')
-
-# Protocol bytes
-SOH = bytes([0x01])
-STX = bytes([0x02])
-EOT = bytes([0x04])
-ACK = bytes([0x06])
-DLE = bytes([0x10])
-NAK = bytes([0x15])
-CAN = bytes([0x18])
-CRC = bytes([0x43]) # C
-
-
-class XMODEM(object):
- '''
- XMODEM Protocol handler, expects an object to read from and an object to
- write to.
-
- >>> def getc(size, timeout=1):
- ... return data or None
- ...
- >>> def putc(data, timeout=1):
- ... return size or None
- ...
- >>> modem = XMODEM(getc, putc)
-
-
- :param getc: Function to retreive bytes from a stream
- :type getc: callable
- :param putc: Function to transmit bytes to a stream
- :type putc: callable
- :param mode: XMODEM protocol mode
- :type mode: string
- :param pad: Padding character to make the packets match the packet size
- :type pad: char
-
- '''
-
- # crctab calculated by Mark G. Mendel, Network Systems Corporation
- crctable = [
- 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
- 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
- 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
- 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
- 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
- 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
- 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
- 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
- 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
- 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
- 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
- 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
- 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
- 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
- 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
- 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
- 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
- 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
- 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
- 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
- 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
- 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
- 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
- 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
- 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
- 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
- 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
- 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
- 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
- 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
- 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
- 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0,
- ]
-
- def __init__(self, getc, putc, mode='xmodem', pad=b'\x1a'):
- self.getc = getc
- self.putc = putc
- self.mode = mode
- self.pad = pad
-
- def abort(self, count=2, timeout=60):
- '''
- Send an abort sequence using CAN bytes.
- '''
- for counter in range(0, count):
- self.putc(CAN, timeout)
-
- def send(self, stream, retry=32, timeout=360, quiet=0, callback=None):
- '''
- Send a stream via the XMODEM protocol.
-
- >>> stream = file('/etc/issue', 'rb')
- >>> print modem.send(stream)
- True
-
- Returns ``True`` upon succesful transmission or ``False`` in case of
- failure.
-
- :param stream: The stream object to send data from.
- :type stream: stream (file, etc.)
- :param retry: The maximum number of times to try to resend a failed
- packet before failing.
- :type retry: int
- :param timeout: The number of seconds to wait for a response before
- timing out.
- :type timeout: int
- :param quiet: If 0, it prints info to stderr. If 1, it does not print any info.
- :type quiet: int
- :param callback: Reference to a callback function that has the
- following signature. This is useful for
- getting status updates while a xmodem
- transfer is underway.
- Expected callback signature:
- def callback(total_packets, success_count, error_count)
- :type callback: callable
- '''
-
- # initialize protocol
- try:
- packet_size = dict(
- xmodem = 128,
- xmodem1k = 1024,
- )[self.mode]
- except AttributeError:
- raise ValueError("An invalid mode was supplied")
-
- error_count = 0
- crc_mode = 0
- cancel = 0
- while True:
- char = self.getc(1)
- if char:
- if char == NAK:
- crc_mode = 0
- break
- elif char == CRC:
- crc_mode = 1
- break
- elif char == CAN:
- if not quiet:
- print('received CAN', file=sys.stderr)
- if cancel:
- return False
- else:
- cancel = 1
- else:
- log.error('send ERROR expected NAK/CRC, got %s' % \
- (ord(char),))
-
- error_count += 1
- if error_count >= retry:
- self.abort(timeout=timeout)
- return False
-
- # send data
- error_count = 0
- success_count = 0
- total_packets = 0
- sequence = 1
- while True:
- data = stream.read(packet_size)
- if not data:
- log.info('sending EOT')
- # end of stream
- break
- total_packets += 1
- data = data.ljust(packet_size, self.pad)
- if crc_mode:
- crc = self.calc_crc(data)
- else:
- crc = self.calc_checksum(data)
-
- # emit packet
- while True:
- if packet_size == 128:
- self.putc(SOH)
- else: # packet_size == 1024
- self.putc(STX)
- self.putc(bytes([sequence]))
- self.putc(bytes([0xff - sequence]))
- self.putc(data)
- if crc_mode:
- self.putc(bytes([crc >> 8]))
- self.putc(bytes([crc & 0xff]))
- else:
- self.putc(bytes([crc]))
-
- char = self.getc(1, timeout)
- if char == ACK:
- success_count += 1
- if isinstance(callback, collections.Callable):
- callback(total_packets, success_count, error_count)
- break
- if char == NAK:
- error_count += 1
- if isinstance(callback, collections.Callable):
- callback(total_packets, success_count, error_count)
- if error_count >= retry:
- # excessive amounts of retransmissions requested,
- # abort transfer
- self.abort(timeout=timeout)
- log.warning('excessive NAKs, transfer aborted')
- return False
-
- # return to loop and resend
- continue
- else:
- log.error('Not ACK, Not NAK')
- error_count += 1
- if isinstance(callback, collections.Callable):
- callback(total_packets, success_count, error_count)
- if error_count >= retry:
- # excessive amounts of retransmissions requested,
- # abort transfer
- self.abort(timeout=timeout)
- log.warning('excessive protocol errors, transfer aborted')
- return False
-
- # return to loop and resend
- continue
-
- # protocol error
- self.abort(timeout=timeout)
- log.error('protocol error')
- return False
-
- # keep track of sequence
- sequence = (sequence + 1) % 0x100
-
- while True:
- # end of transmission
- self.putc(EOT)
-
- #An ACK should be returned
- char = self.getc(1, timeout)
- if char == ACK:
- break
- else:
- error_count += 1
- if error_count >= retry:
- self.abort(timeout=timeout)
- log.warning('EOT was not ACKd, transfer aborted')
- return False
-
- return True
-
- def recv(self, stream, crc_mode=1, retry=16, timeout=60, delay=1, quiet=0):
- '''
- Receive a stream via the XMODEM protocol.
-
- >>> stream = file('/etc/issue', 'wb')
- >>> print modem.recv(stream)
- 2342
-
- Returns the number of bytes received on success or ``None`` in case of
- failure.
- '''
-
- # initiate protocol
- error_count = 0
- char = 0
- cancel = 0
- while True:
- # first try CRC mode, if this fails,
- # fall back to checksum mode
- if error_count >= retry:
- self.abort(timeout=timeout)
- return None
- elif crc_mode and error_count < (retry / 2):
- if not self.putc(CRC):
- time.sleep(delay)
- error_count += 1
- else:
- crc_mode = 0
- if not self.putc(NAK):
- time.sleep(delay)
- error_count += 1
-
- char = self.getc(1, timeout)
- if not char:
- error_count += 1
- continue
- elif char == SOH:
- #crc_mode = 0
- break
- elif char == STX:
- break
- elif char == CAN:
- if cancel:
- return None
- else:
- cancel = 1
- else:
- error_count += 1
-
- # read data
- error_count = 0
- income_size = 0
- packet_size = 128
- sequence = 1
- cancel = 0
- while True:
- while True:
- if char == SOH:
- packet_size = 128
- break
- elif char == STX:
- packet_size = 1024
- break
- elif char == EOT:
- # We received an EOT, so send an ACK and return the received
- # data length
- self.putc(ACK)
- return income_size
- elif char == CAN:
- # cancel at two consecutive cancels
- if cancel:
- return None
- else:
- cancel = 1
- else:
- if not quiet:
- print('recv ERROR expected SOH/EOT, got', ord(char), file=sys.stderr)
- error_count += 1
- if error_count >= retry:
- self.abort()
- return None
- # read sequence
- error_count = 0
- cancel = 0
- seq1 = ord(self.getc(1))
- seq2 = 0xff - ord(self.getc(1))
- if seq1 == sequence and seq2 == sequence:
- # sequence is ok, read packet
- # packet_size + checksum
- data = self.getc(packet_size + 1 + crc_mode, timeout)
- if crc_mode:
- csum = (ord(data[-2]) << 8) + ord(data[-1])
- data = data[:-2]
- log.debug('CRC (%04x <> %04x)' % \
- (csum, self.calc_crc(data)))
- valid = csum == self.calc_crc(data)
- else:
- csum = data[-1]
- data = data[:-1]
- log.debug('checksum (checksum(%02x <> %02x)' % \
- (ord(csum), self.calc_checksum(data)))
- valid = ord(csum) == self.calc_checksum(data)
-
- # valid data, append chunk
- if valid:
- income_size += len(data)
- stream.write(data)
- self.putc(ACK)
- sequence = (sequence + 1) % 0x100
- char = self.getc(1, timeout)
- continue
- else:
- # consume data
- self.getc(packet_size + 1 + crc_mode)
- self.debug('expecting sequence %d, got %d/%d' % \
- (sequence, seq1, seq2))
-
- # something went wrong, request retransmission
- self.putc(NAK)
-
- def calc_checksum(self, data, checksum=0):
- '''
- Calculate the checksum for a given block of data, can also be used to
- update a checksum.
-
- >>> csum = modem.calc_checksum('hello')
- >>> csum = modem.calc_checksum('world', csum)
- >>> hex(csum)
- '0x3c'
-
- '''
- return (sum(map(ord, data)) + checksum) % 256
-
- def calc_crc(self, data, crc=0):
- '''
- Calculate the Cyclic Redundancy Check for a given block of data, can
- also be used to update a CRC.
-
- >>> crc = modem.calc_crc('hello')
- >>> crc = modem.calc_crc('world', crc)
- >>> hex(crc)
- '0xd5e3'
-
- '''
- for char in data:
- crc = (crc << 8) ^ self.crctable[((crc >> 8) ^ int(char)) & 0xff]
- return crc & 0xffff
-
-
-XMODEM1k = partial(XMODEM, mode='xmodem1k')
-
-
-def run():
- import optparse
- import subprocess
-
- parser = optparse.OptionParser(usage='%prog [<options>] <send|recv> filename filename')
- parser.add_option('-m', '--mode', default='xmodem',
- help='XMODEM mode (xmodem, xmodem1k)')
-
- options, args = parser.parse_args()
- if len(args) != 3:
- parser.error('invalid arguments')
- return 1
-
- elif args[0] not in ('send', 'recv'):
- parser.error('invalid mode')
- return 1
-
- def _func(so, si):
- import select
- import subprocess
-
- print('si', si)
- print('so', so)
-
- def getc(size, timeout=3):
- w,t,f = select.select([so], [], [], timeout)
- if w:
- data = so.read(size)
- else:
- data = None
-
- print('getc(', repr(data), ')')
- return data
-
- def putc(data, timeout=3):
- w,t,f = select.select([], [si], [], timeout)
- if t:
- si.write(data)
- si.flush()
- size = len(data)
- else:
- size = None
-
- print('putc(', repr(data), repr(size), ')')
- return size
-
- return getc, putc
-
- def _pipe(*command):
- pipe = subprocess.Popen(command,
- stdout=subprocess.PIPE, stdin=subprocess.PIPE)
- return pipe.stdout, pipe.stdin
-
- if args[0] == 'recv':
- import io
- getc, putc = _func(*_pipe('sz', '--xmodem', args[2]))
- stream = open(args[1], 'wb')
- xmodem = XMODEM(getc, putc, mode=options.mode)
- status = xmodem.recv(stream, retry=8)
- stream.close()
-
- elif args[0] == 'send':
- getc, putc = _func(*_pipe('rz', '--xmodem', args[2]))
- stream = open(args[1], 'rb')
- xmodem = XMODEM(getc, putc, mode=options.mode)
- status = xmodem.send(stream, retry=8)
- stream.close()
-
-if __name__ == '__main__':
- sys.exit(run())
diff --git a/tinyusb/lib/SEGGER_RTT/License.txt b/tinyusb/lib/SEGGER_RTT/License.txt
deleted file mode 100755
index e1f5f89f..00000000
--- a/tinyusb/lib/SEGGER_RTT/License.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-Important - Read carefully:
-
-SEGGER RTT - Real Time Transfer for embedded targets
-
-All rights reserved.
-
-SEGGER strongly recommends to not make any changes
-to or modify the source code of this software in order to stay
-compatible with the RTT protocol and J-Link.
-
-Redistribution and use in source and binary forms, with or
-without modification, are permitted provided that the following
-condition is met:
-
-o Redistributions of source code must retain the above copyright
- notice, this condition and the following disclaimer.
-
-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 SEGGER Microcontroller 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.
-
-
-(c) 2014 - 2016 SEGGER Microcontroller GmbH
-www.segger.com
diff --git a/tinyusb/lib/SEGGER_RTT/README.txt b/tinyusb/lib/SEGGER_RTT/README.txt
deleted file mode 100755
index 49ec655c..00000000
--- a/tinyusb/lib/SEGGER_RTT/README.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-README.txt for the SEGGER RTT Implementation Pack.
-
-Included files:
-===============
-Root Directory
- - Examples
- - Main_RTT_InputEchoApp.c - Sample application which echoes input on Channel 0.
- - Main_RTT_MenuApp.c - Sample application to demonstrate RTT bi-directional functionality.
- - Main_RTT_PrintfTest.c - Sample application to test RTT small printf implementation.
- - Main_RTT_SpeedTestApp.c - Sample application for measuring RTT performance. embOS needed.
- - RTT
- - SEGGER_RTT.c - The RTT implementation.
- - SEGGER_RTT.h - Header for RTT implementation.
- - SEGGER_RTT_Conf.h - Pre-processor configuration for the RTT implementation.
- - SEGGER_RTT_Printf.c - Simple implementation of printf to write formatted strings via RTT.
- - Syscalls
- - RTT_Syscalls_GCC.c - Low-level syscalls to retarget printf() to RTT with GCC / Newlib.
- - RTT_Syscalls_IAR.c - Low-level syscalls to retarget printf() to RTT with IAR compiler.
- - RTT_Syscalls_KEIL.c - Low-level syscalls to retarget printf() to RTT with KEIL/uVision compiler.
- - RTT_Syscalls_SES.c - Low-level syscalls to retarget printf() to RTT with SEGGER Embedded Studio.
diff --git a/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT.c b/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT.c
deleted file mode 100755
index 3ad2b1a1..00000000
--- a/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT.c
+++ /dev/null
@@ -1,2005 +0,0 @@
-/*********************************************************************
-* SEGGER Microcontroller GmbH *
-* The Embedded Experts *
-**********************************************************************
-* *
-* (c) 1995 - 2019 SEGGER Microcontroller GmbH *
-* *
-* www.segger.com Support: support@segger.com *
-* *
-**********************************************************************
-* *
-* SEGGER RTT * Real Time Transfer for embedded targets *
-* *
-**********************************************************************
-* *
-* All rights reserved. *
-* *
-* SEGGER strongly recommends to not make any changes *
-* to or modify the source code of this software in order to stay *
-* compatible with the RTT protocol and J-Link. *
-* *
-* Redistribution and use in source and binary forms, with or *
-* without modification, are permitted provided that the following *
-* condition is met: *
-* *
-* o Redistributions of source code must retain the above copyright *
-* notice, this condition and the following disclaimer. *
-* *
-* 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 SEGGER Microcontroller 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. *
-* *
-**********************************************************************
----------------------------END-OF-HEADER------------------------------
-File : SEGGER_RTT.c
-Purpose : Implementation of SEGGER real-time transfer (RTT) which
- allows real-time communication on targets which support
- debugger memory accesses while the CPU is running.
-Revision: $Rev: 17697 $
-
-Additional information:
- Type "int" is assumed to be 32-bits in size
- H->T Host to target communication
- T->H Target to host communication
-
- RTT channel 0 is always present and reserved for Terminal usage.
- Name is fixed to "Terminal"
-
- Effective buffer size: SizeOfBuffer - 1
-
- WrOff == RdOff: Buffer is empty
- WrOff == (RdOff - 1): Buffer is full
- WrOff > RdOff: Free space includes wrap-around
- WrOff < RdOff: Used space includes wrap-around
- (WrOff == (SizeOfBuffer - 1)) && (RdOff == 0):
- Buffer full and wrap-around after next byte
-
-
-----------------------------------------------------------------------
-*/
-
-#include "SEGGER_RTT.h"
-
-#include <string.h> // for memcpy
-
-/*********************************************************************
-*
-* Configuration, default values
-*
-**********************************************************************
-*/
-
-#ifndef BUFFER_SIZE_UP
- #define BUFFER_SIZE_UP 1024 // Size of the buffer for terminal output of target, up to host
-#endif
-
-#ifndef BUFFER_SIZE_DOWN
- #define BUFFER_SIZE_DOWN 16 // Size of the buffer for terminal input to target from host (Usually keyboard input)
-#endif
-
-#ifndef SEGGER_RTT_MAX_NUM_UP_BUFFERS
- #define SEGGER_RTT_MAX_NUM_UP_BUFFERS 2 // Number of up-buffers (T->H) available on this target
-#endif
-
-#ifndef SEGGER_RTT_MAX_NUM_DOWN_BUFFERS
- #define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS 2 // Number of down-buffers (H->T) available on this target
-#endif
-
-#ifndef SEGGER_RTT_BUFFER_SECTION
- #if defined(SEGGER_RTT_SECTION)
- #define SEGGER_RTT_BUFFER_SECTION SEGGER_RTT_SECTION
- #endif
-#endif
-
-#ifndef SEGGER_RTT_ALIGNMENT
- #define SEGGER_RTT_ALIGNMENT 0
-#endif
-
-#ifndef SEGGER_RTT_BUFFER_ALIGNMENT
- #define SEGGER_RTT_BUFFER_ALIGNMENT 0
-#endif
-
-#ifndef SEGGER_RTT_MODE_DEFAULT
- #define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_NO_BLOCK_SKIP
-#endif
-
-#ifndef SEGGER_RTT_LOCK
- #define SEGGER_RTT_LOCK()
-#endif
-
-#ifndef SEGGER_RTT_UNLOCK
- #define SEGGER_RTT_UNLOCK()
-#endif
-
-#ifndef STRLEN
- #define STRLEN(a) strlen((a))
-#endif
-
-#ifndef STRCPY
- #define STRCPY(pDest, pSrc, NumBytes) strcpy((pDest), (pSrc))
-#endif
-
-#ifndef SEGGER_RTT_MEMCPY_USE_BYTELOOP
- #define SEGGER_RTT_MEMCPY_USE_BYTELOOP 0
-#endif
-
-#ifndef SEGGER_RTT_MEMCPY
- #ifdef MEMCPY
- #define SEGGER_RTT_MEMCPY(pDest, pSrc, NumBytes) MEMCPY((pDest), (pSrc), (NumBytes))
- #else
- #define SEGGER_RTT_MEMCPY(pDest, pSrc, NumBytes) memcpy((pDest), (pSrc), (NumBytes))
- #endif
-#endif
-
-#ifndef MIN
- #define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-
-#ifndef MAX
- #define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#endif
-//
-// For some environments, NULL may not be defined until certain headers are included
-//
-#ifndef NULL
- #define NULL 0
-#endif
-
-/*********************************************************************
-*
-* Defines, fixed
-*
-**********************************************************************
-*/
-#if (defined __ICCARM__) || (defined __ICCRX__)
- #define RTT_PRAGMA(P) _Pragma(#P)
-#endif
-
-#if SEGGER_RTT_ALIGNMENT || SEGGER_RTT_BUFFER_ALIGNMENT
- #if (defined __GNUC__)
- #define SEGGER_RTT_ALIGN(Var, Alignment) Var __attribute__ ((aligned (Alignment)))
- #elif (defined __ICCARM__) || (defined __ICCRX__)
- #define PRAGMA(A) _Pragma(#A)
-#define SEGGER_RTT_ALIGN(Var, Alignment) RTT_PRAGMA(data_alignment=Alignment) \
- Var
- #elif (defined __CC_ARM)
- #define SEGGER_RTT_ALIGN(Var, Alignment) Var __attribute__ ((aligned (Alignment)))
- #else
- #error "Alignment not supported for this compiler."
- #endif
-#else
- #define SEGGER_RTT_ALIGN(Var, Alignment) Var
-#endif
-
-#if defined(SEGGER_RTT_SECTION) || defined (SEGGER_RTT_BUFFER_SECTION)
- #if (defined __GNUC__)
- #define SEGGER_RTT_PUT_SECTION(Var, Section) __attribute__ ((section (Section))) Var
- #elif (defined __ICCARM__) || (defined __ICCRX__)
-#define SEGGER_RTT_PUT_SECTION(Var, Section) RTT_PRAGMA(location=Section) \
- Var
- #elif (defined __CC_ARM)
- #define SEGGER_RTT_PUT_SECTION(Var, Section) __attribute__ ((section (Section), zero_init)) Var
- #else
- #error "Section placement not supported for this compiler."
- #endif
-#else
- #define SEGGER_RTT_PUT_SECTION(Var, Section) Var
-#endif
-
-
-#if SEGGER_RTT_ALIGNMENT
- #define SEGGER_RTT_CB_ALIGN(Var) SEGGER_RTT_ALIGN(Var, SEGGER_RTT_ALIGNMENT)
-#else
- #define SEGGER_RTT_CB_ALIGN(Var) Var
-#endif
-
-#if SEGGER_RTT_BUFFER_ALIGNMENT
- #define SEGGER_RTT_BUFFER_ALIGN(Var) SEGGER_RTT_ALIGN(Var, SEGGER_RTT_BUFFER_ALIGNMENT)
-#else
- #define SEGGER_RTT_BUFFER_ALIGN(Var) Var
-#endif
-
-
-#if defined(SEGGER_RTT_SECTION)
- #define SEGGER_RTT_PUT_CB_SECTION(Var) SEGGER_RTT_PUT_SECTION(Var, SEGGER_RTT_SECTION)
-#else
- #define SEGGER_RTT_PUT_CB_SECTION(Var) Var
-#endif
-
-#if defined(SEGGER_RTT_BUFFER_SECTION)
- #define SEGGER_RTT_PUT_BUFFER_SECTION(Var) SEGGER_RTT_PUT_SECTION(Var, SEGGER_RTT_BUFFER_SECTION)
-#else
- #define SEGGER_RTT_PUT_BUFFER_SECTION(Var) Var
-#endif
-
-/*********************************************************************
-*
-* Static const data
-*
-**********************************************************************
-*/
-
-static unsigned char _aTerminalId[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
-
-/*********************************************************************
-*
-* Static data
-*
-**********************************************************************
-*/
-//
-// RTT Control Block and allocate buffers for channel 0
-//
-SEGGER_RTT_PUT_CB_SECTION(SEGGER_RTT_CB_ALIGN(SEGGER_RTT_CB _SEGGER_RTT));
-
-SEGGER_RTT_PUT_BUFFER_SECTION(SEGGER_RTT_BUFFER_ALIGN(static char _acUpBuffer [BUFFER_SIZE_UP]));
-SEGGER_RTT_PUT_BUFFER_SECTION(SEGGER_RTT_BUFFER_ALIGN(static char _acDownBuffer[BUFFER_SIZE_DOWN]));
-
-static unsigned char _ActiveTerminal;
-
-/*********************************************************************
-*
-* Static functions
-*
-**********************************************************************
-*/
-
-/*********************************************************************
-*
-* _DoInit()
-*
-* Function description
-* Initializes the control block an buffers.
-* May only be called via INIT() to avoid overriding settings.
-*
-*/
-#define INIT() do { \
- if (_SEGGER_RTT.acID[0] == '\0') { _DoInit(); } \
- } while (0)
-static void _DoInit(void) {
- SEGGER_RTT_CB* p;
- //
- // Initialize control block
- //
- p = &_SEGGER_RTT;
- p->MaxNumUpBuffers = SEGGER_RTT_MAX_NUM_UP_BUFFERS;
- p->MaxNumDownBuffers = SEGGER_RTT_MAX_NUM_DOWN_BUFFERS;
- //
- // Initialize up buffer 0
- //
- p->aUp[0].sName = "Terminal";
- p->aUp[0].pBuffer = _acUpBuffer;
- p->aUp[0].SizeOfBuffer = sizeof(_acUpBuffer);
- p->aUp[0].RdOff = 0u;
- p->aUp[0].WrOff = 0u;
- p->aUp[0].Flags = SEGGER_RTT_MODE_DEFAULT;
- //
- // Initialize down buffer 0
- //
- p->aDown[0].sName = "Terminal";
- p->aDown[0].pBuffer = _acDownBuffer;
- p->aDown[0].SizeOfBuffer = sizeof(_acDownBuffer);
- p->aDown[0].RdOff = 0u;
- p->aDown[0].WrOff = 0u;
- p->aDown[0].Flags = SEGGER_RTT_MODE_DEFAULT;
- //
- // Finish initialization of the control block.
- // Copy Id string in three steps to make sure "SEGGER RTT" is not found
- // in initializer memory (usually flash) by J-Link
- //
- STRCPY(&p->acID[7], "RTT", 9);
- STRCPY(&p->acID[0], "SEGGER", 7);
- p->acID[6] = ' ';
-}
-
-/*********************************************************************
-*
-* _WriteBlocking()
-*
-* Function description
-* Stores a specified number of characters in SEGGER RTT ring buffer
-* and updates the associated write pointer which is periodically
-* read by the host.
-* The caller is responsible for managing the write chunk sizes as
-* _WriteBlocking() will block until all data has been posted successfully.
-*
-* Parameters
-* pRing Ring buffer to post to.
-* pBuffer Pointer to character array. Does not need to point to a \0 terminated string.
-* NumBytes Number of bytes to be stored in the SEGGER RTT control block.
-*
-* Return value
-* >= 0 - Number of bytes written into buffer.
-*/
-static unsigned _WriteBlocking(SEGGER_RTT_BUFFER_UP* pRing, const char* pBuffer, unsigned NumBytes) {
- unsigned NumBytesToWrite;
- unsigned NumBytesWritten;
- unsigned RdOff;
- unsigned WrOff;
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- char* pDst;
-#endif
- //
- // Write data to buffer and handle wrap-around if necessary
- //
- NumBytesWritten = 0u;
- WrOff = pRing->WrOff;
- do {
- RdOff = pRing->RdOff; // May be changed by host (debug probe) in the meantime
- if (RdOff > WrOff) {
- NumBytesToWrite = RdOff - WrOff - 1u;
- } else {
- NumBytesToWrite = pRing->SizeOfBuffer - (WrOff - RdOff + 1u);
- }
- NumBytesToWrite = MIN(NumBytesToWrite, (pRing->SizeOfBuffer - WrOff)); // Number of bytes that can be written until buffer wrap-around
- NumBytesToWrite = MIN(NumBytesToWrite, NumBytes);
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- pDst = pRing->pBuffer + WrOff;
- NumBytesWritten += NumBytesToWrite;
- NumBytes -= NumBytesToWrite;
- WrOff += NumBytesToWrite;
- while (NumBytesToWrite--) {
- *pDst++ = *pBuffer++;
- };
-#else
- SEGGER_RTT_MEMCPY(pRing->pBuffer + WrOff, pBuffer, NumBytesToWrite);
- NumBytesWritten += NumBytesToWrite;
- pBuffer += NumBytesToWrite;
- NumBytes -= NumBytesToWrite;
- WrOff += NumBytesToWrite;
-#endif
- if (WrOff == pRing->SizeOfBuffer) {
- WrOff = 0u;
- }
- pRing->WrOff = WrOff;
- } while (NumBytes);
- //
- return NumBytesWritten;
-}
-
-/*********************************************************************
-*
-* _WriteNoCheck()
-*
-* Function description
-* Stores a specified number of characters in SEGGER RTT ring buffer
-* and updates the associated write pointer which is periodically
-* read by the host.
-* It is callers responsibility to make sure data actually fits in buffer.
-*
-* Parameters
-* pRing Ring buffer to post to.
-* pBuffer Pointer to character array. Does not need to point to a \0 terminated string.
-* NumBytes Number of bytes to be stored in the SEGGER RTT control block.
-*
-* Notes
-* (1) If there might not be enough space in the "Up"-buffer, call _WriteBlocking
-*/
-static void _WriteNoCheck(SEGGER_RTT_BUFFER_UP* pRing, const char* pData, unsigned NumBytes) {
- unsigned NumBytesAtOnce;
- unsigned WrOff;
- unsigned Rem;
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- char* pDst;
-#endif
-
- WrOff = pRing->WrOff;
- Rem = pRing->SizeOfBuffer - WrOff;
- if (Rem > NumBytes) {
- //
- // All data fits before wrap around
- //
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- pDst = pRing->pBuffer + WrOff;
- WrOff += NumBytes;
- while (NumBytes--) {
- *pDst++ = *pData++;
- };
- pRing->WrOff = WrOff;
-#else
- SEGGER_RTT_MEMCPY(pRing->pBuffer + WrOff, pData, NumBytes);
- pRing->WrOff = WrOff + NumBytes;
-#endif
- } else {
- //
- // We reach the end of the buffer, so need to wrap around
- //
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- pDst = pRing->pBuffer + WrOff;
- NumBytesAtOnce = Rem;
- while (NumBytesAtOnce--) {
- *pDst++ = *pData++;
- };
- pDst = pRing->pBuffer;
- NumBytesAtOnce = NumBytes - Rem;
- while (NumBytesAtOnce--) {
- *pDst++ = *pData++;
- };
- pRing->WrOff = NumBytes - Rem;
-#else
- NumBytesAtOnce = Rem;
- SEGGER_RTT_MEMCPY(pRing->pBuffer + WrOff, pData, NumBytesAtOnce);
- NumBytesAtOnce = NumBytes - Rem;
- SEGGER_RTT_MEMCPY(pRing->pBuffer, pData + Rem, NumBytesAtOnce);
- pRing->WrOff = NumBytesAtOnce;
-#endif
- }
-}
-
-/*********************************************************************
-*
-* _PostTerminalSwitch()
-*
-* Function description
-* Switch terminal to the given terminal ID. It is the caller's
-* responsibility to ensure the terminal ID is correct and there is
-* enough space in the buffer for this to complete successfully.
-*
-* Parameters
-* pRing Ring buffer to post to.
-* TerminalId Terminal ID to switch to.
-*/
-static void _PostTerminalSwitch(SEGGER_RTT_BUFFER_UP* pRing, unsigned char TerminalId) {
- unsigned char ac[2];
-
- ac[0] = 0xFFu;
- ac[1] = _aTerminalId[TerminalId]; // Caller made already sure that TerminalId does not exceed our terminal limit
- _WriteBlocking(pRing, (const char*)ac, 2u);
-}
-
-/*********************************************************************
-*
-* _GetAvailWriteSpace()
-*
-* Function description
-* Returns the number of bytes that can be written to the ring
-* buffer without blocking.
-*
-* Parameters
-* pRing Ring buffer to check.
-*
-* Return value
-* Number of bytes that are free in the buffer.
-*/
-static unsigned _GetAvailWriteSpace(SEGGER_RTT_BUFFER_UP* pRing) {
- unsigned RdOff;
- unsigned WrOff;
- unsigned r;
- //
- // Avoid warnings regarding volatile access order. It's not a problem
- // in this case, but dampen compiler enthusiasm.
- //
- RdOff = pRing->RdOff;
- WrOff = pRing->WrOff;
- if (RdOff <= WrOff) {
- r = pRing->SizeOfBuffer - 1u - WrOff + RdOff;
- } else {
- r = RdOff - WrOff - 1u;
- }
- return r;
-}
-
-/*********************************************************************
-*
-* Public code
-*
-**********************************************************************
-*/
-/*********************************************************************
-*
-* SEGGER_RTT_ReadUpBufferNoLock()
-*
-* Function description
-* Reads characters from SEGGER real-time-terminal control block
-* which have been previously stored by the application.
-* Do not lock against interrupts and multiple access.
-* Used to do the same operation that J-Link does, to transfer
-* RTT data via other channels, such as TCP/IP or UART.
-*
-* Parameters
-* BufferIndex Index of Up-buffer to be used.
-* pBuffer Pointer to buffer provided by target application, to copy characters from RTT-up-buffer to.
-* BufferSize Size of the target application buffer.
-*
-* Return value
-* Number of bytes that have been read.
-*
-* Additional information
-* This function must not be called when J-Link might also do RTT.
-*/
-unsigned SEGGER_RTT_ReadUpBufferNoLock(unsigned BufferIndex, void* pData, unsigned BufferSize) {
- unsigned NumBytesRem;
- unsigned NumBytesRead;
- unsigned RdOff;
- unsigned WrOff;
- unsigned char* pBuffer;
- SEGGER_RTT_BUFFER_UP* pRing;
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- const char* pSrc;
-#endif
- //
- INIT();
- pRing = &_SEGGER_RTT.aUp[BufferIndex];
- pBuffer = (unsigned char*)pData;
- RdOff = pRing->RdOff;
- WrOff = pRing->WrOff;
- NumBytesRead = 0u;
- //
- // Read from current read position to wrap-around of buffer, first
- //
- if (RdOff > WrOff) {
- NumBytesRem = pRing->SizeOfBuffer - RdOff;
- NumBytesRem = MIN(NumBytesRem, BufferSize);
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- pSrc = pRing->pBuffer + RdOff;
- NumBytesRead += NumBytesRem;
- BufferSize -= NumBytesRem;
- RdOff += NumBytesRem;
- while (NumBytesRem--) {
- *pBuffer++ = *pSrc++;
- };
-#else
- SEGGER_RTT_MEMCPY(pBuffer, pRing->pBuffer + RdOff, NumBytesRem);
- NumBytesRead += NumBytesRem;
- pBuffer += NumBytesRem;
- BufferSize -= NumBytesRem;
- RdOff += NumBytesRem;
-#endif
- //
- // Handle wrap-around of buffer
- //
- if (RdOff == pRing->SizeOfBuffer) {
- RdOff = 0u;
- }
- }
- //
- // Read remaining items of buffer
- //
- NumBytesRem = WrOff - RdOff;
- NumBytesRem = MIN(NumBytesRem, BufferSize);
- if (NumBytesRem > 0u) {
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- pSrc = pRing->pBuffer + RdOff;
- NumBytesRead += NumBytesRem;
- BufferSize -= NumBytesRem;
- RdOff += NumBytesRem;
- while (NumBytesRem--) {
- *pBuffer++ = *pSrc++;
- };
-#else
- SEGGER_RTT_MEMCPY(pBuffer, pRing->pBuffer + RdOff, NumBytesRem);
- NumBytesRead += NumBytesRem;
- pBuffer += NumBytesRem;
- BufferSize -= NumBytesRem;
- RdOff += NumBytesRem;
-#endif
- }
- //
- // Update read offset of buffer
- //
- if (NumBytesRead) {
- pRing->RdOff = RdOff;
- }
- //
- return NumBytesRead;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_ReadNoLock()
-*
-* Function description
-* Reads characters from SEGGER real-time-terminal control block
-* which have been previously stored by the host.
-* Do not lock against interrupts and multiple access.
-*
-* Parameters
-* BufferIndex Index of Down-buffer to be used (e.g. 0 for "Terminal").
-* pBuffer Pointer to buffer provided by target application, to copy characters from RTT-down-buffer to.
-* BufferSize Size of the target application buffer.
-*
-* Return value
-* Number of bytes that have been read.
-*/
-unsigned SEGGER_RTT_ReadNoLock(unsigned BufferIndex, void* pData, unsigned BufferSize) {
- unsigned NumBytesRem;
- unsigned NumBytesRead;
- unsigned RdOff;
- unsigned WrOff;
- unsigned char* pBuffer;
- SEGGER_RTT_BUFFER_DOWN* pRing;
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- const char* pSrc;
-#endif
- //
- INIT();
- pRing = &_SEGGER_RTT.aDown[BufferIndex];
- pBuffer = (unsigned char*)pData;
- RdOff = pRing->RdOff;
- WrOff = pRing->WrOff;
- NumBytesRead = 0u;
- //
- // Read from current read position to wrap-around of buffer, first
- //
- if (RdOff > WrOff) {
- NumBytesRem = pRing->SizeOfBuffer - RdOff;
- NumBytesRem = MIN(NumBytesRem, BufferSize);
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- pSrc = pRing->pBuffer + RdOff;
- NumBytesRead += NumBytesRem;
- BufferSize -= NumBytesRem;
- RdOff += NumBytesRem;
- while (NumBytesRem--) {
- *pBuffer++ = *pSrc++;
- };
-#else
- SEGGER_RTT_MEMCPY(pBuffer, pRing->pBuffer + RdOff, NumBytesRem);
- NumBytesRead += NumBytesRem;
- pBuffer += NumBytesRem;
- BufferSize -= NumBytesRem;
- RdOff += NumBytesRem;
-#endif
- //
- // Handle wrap-around of buffer
- //
- if (RdOff == pRing->SizeOfBuffer) {
- RdOff = 0u;
- }
- }
- //
- // Read remaining items of buffer
- //
- NumBytesRem = WrOff - RdOff;
- NumBytesRem = MIN(NumBytesRem, BufferSize);
- if (NumBytesRem > 0u) {
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- pSrc = pRing->pBuffer + RdOff;
- NumBytesRead += NumBytesRem;
- BufferSize -= NumBytesRem;
- RdOff += NumBytesRem;
- while (NumBytesRem--) {
- *pBuffer++ = *pSrc++;
- };
-#else
- SEGGER_RTT_MEMCPY(pBuffer, pRing->pBuffer + RdOff, NumBytesRem);
- NumBytesRead += NumBytesRem;
- pBuffer += NumBytesRem;
- BufferSize -= NumBytesRem;
- RdOff += NumBytesRem;
-#endif
- }
- if (NumBytesRead) {
- pRing->RdOff = RdOff;
- }
- //
- return NumBytesRead;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_ReadUpBuffer
-*
-* Function description
-* Reads characters from SEGGER real-time-terminal control block
-* which have been previously stored by the application.
-* Used to do the same operation that J-Link does, to transfer
-* RTT data via other channels, such as TCP/IP or UART.
-*
-* Parameters
-* BufferIndex Index of Up-buffer to be used.
-* pBuffer Pointer to buffer provided by target application, to copy characters from RTT-up-buffer to.
-* BufferSize Size of the target application buffer.
-*
-* Return value
-* Number of bytes that have been read.
-*
-* Additional information
-* This function must not be called when J-Link might also do RTT.
-* This function locks against all other RTT operations. I.e. during
-* the read operation, writing is also locked.
-* If only one consumer reads from the up buffer,
-* call sEGGER_RTT_ReadUpBufferNoLock() instead.
-*/
-unsigned SEGGER_RTT_ReadUpBuffer(unsigned BufferIndex, void* pBuffer, unsigned BufferSize) {
- unsigned NumBytesRead;
- //
- SEGGER_RTT_LOCK();
- //
- // Call the non-locking read function
- //
- NumBytesRead = SEGGER_RTT_ReadUpBufferNoLock(BufferIndex, pBuffer, BufferSize);
- //
- // Finish up.
- //
- SEGGER_RTT_UNLOCK();
- //
- return NumBytesRead;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_Read
-*
-* Function description
-* Reads characters from SEGGER real-time-terminal control block
-* which have been previously stored by the host.
-*
-* Parameters
-* BufferIndex Index of Down-buffer to be used (e.g. 0 for "Terminal").
-* pBuffer Pointer to buffer provided by target application, to copy characters from RTT-down-buffer to.
-* BufferSize Size of the target application buffer.
-*
-* Return value
-* Number of bytes that have been read.
-*/
-unsigned SEGGER_RTT_Read(unsigned BufferIndex, void* pBuffer, unsigned BufferSize) {
- unsigned NumBytesRead;
- //
- SEGGER_RTT_LOCK();
- //
- // Call the non-locking read function
- //
- NumBytesRead = SEGGER_RTT_ReadNoLock(BufferIndex, pBuffer, BufferSize);
- //
- // Finish up.
- //
- SEGGER_RTT_UNLOCK();
- //
- return NumBytesRead;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_WriteWithOverwriteNoLock
-*
-* Function description
-* Stores a specified number of characters in SEGGER RTT
-* control block.
-* SEGGER_RTT_WriteWithOverwriteNoLock does not lock the application
-* and overwrites data if the data does not fit into the buffer.
-*
-* Parameters
-* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
-* pBuffer Pointer to character array. Does not need to point to a \0 terminated string.
-* NumBytes Number of bytes to be stored in the SEGGER RTT control block.
-*
-* Notes
-* (1) If there is not enough space in the "Up"-buffer, data is overwritten.
-* (2) For performance reasons this function does not call Init()
-* and may only be called after RTT has been initialized.
-* Either by calling SEGGER_RTT_Init() or calling another RTT API function first.
-* (3) Do not use SEGGER_RTT_WriteWithOverwriteNoLock if a J-Link
-* connection reads RTT data.
-*/
-void SEGGER_RTT_WriteWithOverwriteNoLock(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes) {
- const char* pData;
- SEGGER_RTT_BUFFER_UP* pRing;
- unsigned Avail;
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- char* pDst;
-#endif
-
- pData = (const char *)pBuffer;
- //
- // Get "to-host" ring buffer and copy some elements into local variables.
- //
- pRing = &_SEGGER_RTT.aUp[BufferIndex];
- //
- // Check if we will overwrite data and need to adjust the RdOff.
- //
- if (pRing->WrOff == pRing->RdOff) {
- Avail = pRing->SizeOfBuffer - 1u;
- } else if ( pRing->WrOff < pRing->RdOff) {
- Avail = pRing->RdOff - pRing->WrOff - 1u;
- } else {
- Avail = pRing->RdOff - pRing->WrOff - 1u + pRing->SizeOfBuffer;
- }
- if (NumBytes > Avail) {
- pRing->RdOff += (NumBytes - Avail);
- while (pRing->RdOff >= pRing->SizeOfBuffer) {
- pRing->RdOff -= pRing->SizeOfBuffer;
- }
- }
- //
- // Write all data, no need to check the RdOff, but possibly handle multiple wrap-arounds
- //
- Avail = pRing->SizeOfBuffer - pRing->WrOff;
- do {
- if (Avail > NumBytes) {
- //
- // Last round
- //
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- pDst = pRing->pBuffer + pRing->WrOff;
- Avail = NumBytes;
- while (NumBytes--) {
- *pDst++ = *pData++;
- };
- pRing->WrOff += Avail;
-#else
- SEGGER_RTT_MEMCPY(pRing->pBuffer + pRing->WrOff, pData, NumBytes);
- pRing->WrOff += NumBytes;
-#endif
- break;
- } else {
- //
- // Wrap-around necessary, write until wrap-around and reset WrOff
- //
-#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
- pDst = pRing->pBuffer + pRing->WrOff;
- NumBytes -= Avail;
- while (Avail--) {
- *pDst++ = *pData++;
- };
- pRing->WrOff = 0;
-#else
- SEGGER_RTT_MEMCPY(pRing->pBuffer + pRing->WrOff, pData, Avail);
- pData += Avail;
- pRing->WrOff = 0;
- NumBytes -= Avail;
-#endif
- Avail = (pRing->SizeOfBuffer - 1);
- }
- } while (NumBytes);
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_WriteSkipNoLock
-*
-* Function description
-* Stores a specified number of characters in SEGGER RTT
-* control block which is then read by the host.
-* SEGGER_RTT_WriteSkipNoLock does not lock the application and
-* skips all data, if the data does not fit into the buffer.
-*
-* Parameters
-* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
-* pBuffer Pointer to character array. Does not need to point to a \0 terminated string.
-* NumBytes Number of bytes to be stored in the SEGGER RTT control block.
-* MUST be > 0!!!
-* This is done for performance reasons, so no initial check has do be done.
-*
-* Return value
-* 1: Data has been copied
-* 0: No space, data has not been copied
-*
-* Notes
-* (1) If there is not enough space in the "Up"-buffer, all data is dropped.
-* (2) For performance reasons this function does not call Init()
-* and may only be called after RTT has been initialized.
-* Either by calling SEGGER_RTT_Init() or calling another RTT API function first.
-*/
-#if (RTT_USE_ASM == 0)
-unsigned SEGGER_RTT_WriteSkipNoLock(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes) {
- const char* pData;
- SEGGER_RTT_BUFFER_UP* pRing;
- unsigned Avail;
- unsigned RdOff;
- unsigned WrOff;
- unsigned Rem;
- //
- // Cases:
- // 1) RdOff <= WrOff => Space until wrap-around is sufficient
- // 2) RdOff <= WrOff => Space after wrap-around needed (copy in 2 chunks)
- // 3) RdOff < WrOff => No space in buf
- // 4) RdOff > WrOff => Space is sufficient
- // 5) RdOff > WrOff => No space in buf
- //
- // 1) is the most common case for large buffers and assuming that J-Link reads the data fast enough
- //
- pData = (const char *)pBuffer;
- pRing = &_SEGGER_RTT.aUp[BufferIndex];
- RdOff = pRing->RdOff;
- WrOff = pRing->WrOff;
- if (RdOff <= WrOff) { // Case 1), 2) or 3)
- Avail = pRing->SizeOfBuffer - WrOff - 1u; // Space until wrap-around (assume 1 byte not usable for case that RdOff == 0)
- if (Avail >= NumBytes) { // Case 1)?
-CopyStraight:
- memcpy(pRing->pBuffer + WrOff, pData, NumBytes);
- pRing->WrOff = WrOff + NumBytes;
- return 1;
- }
- Avail += RdOff; // Space incl. wrap-around
- if (Avail >= NumBytes) { // Case 2? => If not, we have case 3) (does not fit)
- Rem = pRing->SizeOfBuffer - WrOff; // Space until end of buffer
- memcpy(pRing->pBuffer + WrOff, pData, Rem); // Copy 1st chunk
- NumBytes -= Rem;
- //
- // Special case: First check that assumed RdOff == 0 calculated that last element before wrap-around could not be used
- // But 2nd check (considering space until wrap-around and until RdOff) revealed that RdOff is not 0, so we can use the last element
- // In this case, we may use a copy straight until buffer end anyway without needing to copy 2 chunks
- // Therefore, check if 2nd memcpy is necessary at all
- //
- if (NumBytes) {
- memcpy(pRing->pBuffer, pData + Rem, NumBytes);
- }
- pRing->WrOff = NumBytes;
- return 1;
- }
- } else { // Potential case 4)
- Avail = RdOff - WrOff - 1u;
- if (Avail >= NumBytes) { // Case 4)? => If not, we have case 5) (does not fit)
- goto CopyStraight;
- }
- }
- return 0; // No space in buffer
-}
-#endif
-
-/*********************************************************************
-*
-* SEGGER_RTT_WriteDownBufferNoLock
-*
-* Function description
-* Stores a specified number of characters in SEGGER RTT
-* control block inside a <Down> buffer.
-* SEGGER_RTT_WriteDownBufferNoLock does not lock the application.
-* Used to do the same operation that J-Link does, to transfer
-* RTT data from other channels, such as TCP/IP or UART.
-*
-* Parameters
-* BufferIndex Index of "Down"-buffer to be used.
-* pBuffer Pointer to character array. Does not need to point to a \0 terminated string.
-* NumBytes Number of bytes to be stored in the SEGGER RTT control block.
-*
-* Return value
-* Number of bytes which have been stored in the "Down"-buffer.
-*
-* Notes
-* (1) Data is stored according to buffer flags.
-* (2) For performance reasons this function does not call Init()
-* and may only be called after RTT has been initialized.
-* Either by calling SEGGER_RTT_Init() or calling another RTT API function first.
-*
-* Additional information
-* This function must not be called when J-Link might also do RTT.
-*/
-unsigned SEGGER_RTT_WriteDownBufferNoLock(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes) {
- unsigned Status;
- unsigned Avail;
- const char* pData;
- SEGGER_RTT_BUFFER_UP* pRing;
-
- pData = (const char *)pBuffer;
- //
- // Get "to-target" ring buffer.
- // It is save to cast that to a "to-host" buffer. Up and Down buffer differ in volatility of offsets that might be modified by J-Link.
- //
- pRing = (SEGGER_RTT_BUFFER_UP*)&_SEGGER_RTT.aDown[BufferIndex];
- //
- // How we output depends upon the mode...
- //
- switch (pRing->Flags) {
- case SEGGER_RTT_MODE_NO_BLOCK_SKIP:
- //
- // If we are in skip mode and there is no space for the whole
- // of this output, don't bother.
- //
- Avail = _GetAvailWriteSpace(pRing);
- if (Avail < NumBytes) {
- Status = 0u;
- } else {
- Status = NumBytes;
- _WriteNoCheck(pRing, pData, NumBytes);
- }
- break;
- case SEGGER_RTT_MODE_NO_BLOCK_TRIM:
- //
- // If we are in trim mode, trim to what we can output without blocking.
- //
- Avail = _GetAvailWriteSpace(pRing);
- Status = Avail < NumBytes ? Avail : NumBytes;
- _WriteNoCheck(pRing, pData, Status);
- break;
- case SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL:
- //
- // If we are in blocking mode, output everything.
- //
- Status = _WriteBlocking(pRing, pData, NumBytes);
- break;
- default:
- Status = 0u;
- break;
- }
- //
- // Finish up.
- //
- return Status;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_WriteNoLock
-*
-* Function description
-* Stores a specified number of characters in SEGGER RTT
-* control block which is then read by the host.
-* SEGGER_RTT_WriteNoLock does not lock the application.
-*
-* Parameters
-* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
-* pBuffer Pointer to character array. Does not need to point to a \0 terminated string.
-* NumBytes Number of bytes to be stored in the SEGGER RTT control block.
-*
-* Return value
-* Number of bytes which have been stored in the "Up"-buffer.
-*
-* Notes
-* (1) Data is stored according to buffer flags.
-* (2) For performance reasons this function does not call Init()
-* and may only be called after RTT has been initialized.
-* Either by calling SEGGER_RTT_Init() or calling another RTT API function first.
-*/
-unsigned SEGGER_RTT_WriteNoLock(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes) {
- unsigned Status;
- unsigned Avail;
- const char* pData;
- SEGGER_RTT_BUFFER_UP* pRing;
-
- pData = (const char *)pBuffer;
- //
- // Get "to-host" ring buffer.
- //
- pRing = &_SEGGER_RTT.aUp[BufferIndex];
- //
- // How we output depends upon the mode...
- //
- switch (pRing->Flags) {
- case SEGGER_RTT_MODE_NO_BLOCK_SKIP:
- //
- // If we are in skip mode and there is no space for the whole
- // of this output, don't bother.
- //
- Avail = _GetAvailWriteSpace(pRing);
- if (Avail < NumBytes) {
- Status = 0u;
- } else {
- Status = NumBytes;
- _WriteNoCheck(pRing, pData, NumBytes);
- }
- break;
- case SEGGER_RTT_MODE_NO_BLOCK_TRIM:
- //
- // If we are in trim mode, trim to what we can output without blocking.
- //
- Avail = _GetAvailWriteSpace(pRing);
- Status = Avail < NumBytes ? Avail : NumBytes;
- _WriteNoCheck(pRing, pData, Status);
- break;
- case SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL:
- //
- // If we are in blocking mode, output everything.
- //
- Status = _WriteBlocking(pRing, pData, NumBytes);
- break;
- default:
- Status = 0u;
- break;
- }
- //
- // Finish up.
- //
- return Status;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_WriteDownBuffer
-*
-* Function description
-* Stores a specified number of characters in SEGGER RTT control block in a <Down> buffer.
-*
-* Parameters
-* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
-* pBuffer Pointer to character array. Does not need to point to a \0 terminated string.
-* NumBytes Number of bytes to be stored in the SEGGER RTT control block.
-*
-* Return value
-* Number of bytes which have been stored in the "Down"-buffer.
-*
-* Notes
-* (1) Data is stored according to buffer flags.
-*
-* Additional information
-* This function must not be called when J-Link might also do RTT.
-* This function locks against all other RTT operations. I.e. during
-* the write operation, writing from the application is also locked.
-* If only one consumer writes to the down buffer,
-* call SEGGER_RTT_WriteDownBufferNoLock() instead.
-*/
-unsigned SEGGER_RTT_WriteDownBuffer(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes) {
- unsigned Status;
- //
- INIT();
- SEGGER_RTT_LOCK();
- //
- // Call the non-locking write function
- //
- Status = SEGGER_RTT_WriteDownBufferNoLock(BufferIndex, pBuffer, NumBytes);
- //
- // Finish up.
- //
- SEGGER_RTT_UNLOCK();
- //
- return Status;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_Write
-*
-* Function description
-* Stores a specified number of characters in SEGGER RTT
-* control block which is then read by the host.
-*
-* Parameters
-* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
-* pBuffer Pointer to character array. Does not need to point to a \0 terminated string.
-* NumBytes Number of bytes to be stored in the SEGGER RTT control block.
-*
-* Return value
-* Number of bytes which have been stored in the "Up"-buffer.
-*
-* Notes
-* (1) Data is stored according to buffer flags.
-*/
-unsigned SEGGER_RTT_Write(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes) {
- unsigned Status;
- //
- INIT();
- SEGGER_RTT_LOCK();
- //
- // Call the non-locking write function
- //
- Status = SEGGER_RTT_WriteNoLock(BufferIndex, pBuffer, NumBytes);
- //
- // Finish up.
- //
- SEGGER_RTT_UNLOCK();
- //
- return Status;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_WriteString
-*
-* Function description
-* Stores string in SEGGER RTT control block.
-* This data is read by the host.
-*
-* Parameters
-* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
-* s Pointer to string.
-*
-* Return value
-* Number of bytes which have been stored in the "Up"-buffer.
-*
-* Notes
-* (1) Data is stored according to buffer flags.
-* (2) String passed to this function has to be \0 terminated
-* (3) \0 termination character is *not* stored in RTT buffer
-*/
-unsigned SEGGER_RTT_WriteString(unsigned BufferIndex, const char* s) {
- unsigned Len;
-
- Len = STRLEN(s);
- return SEGGER_RTT_Write(BufferIndex, s, Len);
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_PutCharSkipNoLock
-*
-* Function description
-* Stores a single character/byte in SEGGER RTT buffer.
-* SEGGER_RTT_PutCharSkipNoLock does not lock the application and
-* skips the byte, if it does not fit into the buffer.
-*
-* Parameters
-* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
-* c Byte to be stored.
-*
-* Return value
-* Number of bytes which have been stored in the "Up"-buffer.
-*
-* Notes
-* (1) If there is not enough space in the "Up"-buffer, the character is dropped.
-* (2) For performance reasons this function does not call Init()
-* and may only be called after RTT has been initialized.
-* Either by calling SEGGER_RTT_Init() or calling another RTT API function first.
-*/
-
-unsigned SEGGER_RTT_PutCharSkipNoLock(unsigned BufferIndex, char c) {
- SEGGER_RTT_BUFFER_UP* pRing;
- unsigned WrOff;
- unsigned Status;
- //
- // Get "to-host" ring buffer.
- //
- pRing = &_SEGGER_RTT.aUp[BufferIndex];
- //
- // Get write position and handle wrap-around if necessary
- //
- WrOff = pRing->WrOff + 1;
- if (WrOff == pRing->SizeOfBuffer) {
- WrOff = 0;
- }
- //
- // Output byte if free space is available
- //
- if (WrOff != pRing->RdOff) {
- pRing->pBuffer[pRing->WrOff] = c;
- pRing->WrOff = WrOff;
- Status = 1;
- } else {
- Status = 0;
- }
- //
- return Status;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_PutCharSkip
-*
-* Function description
-* Stores a single character/byte in SEGGER RTT buffer.
-*
-* Parameters
-* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
-* c Byte to be stored.
-*
-* Return value
-* Number of bytes which have been stored in the "Up"-buffer.
-*
-* Notes
-* (1) If there is not enough space in the "Up"-buffer, the character is dropped.
-*/
-
-unsigned SEGGER_RTT_PutCharSkip(unsigned BufferIndex, char c) {
- SEGGER_RTT_BUFFER_UP* pRing;
- unsigned WrOff;
- unsigned Status;
- //
- // Prepare
- //
- INIT();
- SEGGER_RTT_LOCK();
- //
- // Get "to-host" ring buffer.
- //
- pRing = &_SEGGER_RTT.aUp[BufferIndex];
- //
- // Get write position and handle wrap-around if necessary
- //
- WrOff = pRing->WrOff + 1;
- if (WrOff == pRing->SizeOfBuffer) {
- WrOff = 0;
- }
- //
- // Output byte if free space is available
- //
- if (WrOff != pRing->RdOff) {
- pRing->pBuffer[pRing->WrOff] = c;
- pRing->WrOff = WrOff;
- Status = 1;
- } else {
- Status = 0;
- }
- //
- // Finish up.
- //
- SEGGER_RTT_UNLOCK();
- //
- return Status;
-}
-
- /*********************************************************************
-*
-* SEGGER_RTT_PutChar
-*
-* Function description
-* Stores a single character/byte in SEGGER RTT buffer.
-*
-* Parameters
-* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
-* c Byte to be stored.
-*
-* Return value
-* Number of bytes which have been stored in the "Up"-buffer.
-*
-* Notes
-* (1) Data is stored according to buffer flags.
-*/
-
-unsigned SEGGER_RTT_PutChar(unsigned BufferIndex, char c) {
- SEGGER_RTT_BUFFER_UP* pRing;
- unsigned WrOff;
- unsigned Status;
- //
- // Prepare
- //
- INIT();
- SEGGER_RTT_LOCK();
- //
- // Get "to-host" ring buffer.
- //
- pRing = &_SEGGER_RTT.aUp[BufferIndex];
- //
- // Get write position and handle wrap-around if necessary
- //
- WrOff = pRing->WrOff + 1;
- if (WrOff == pRing->SizeOfBuffer) {
- WrOff = 0;
- }
- //
- // Wait for free space if mode is set to blocking
- //
- if (pRing->Flags == SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL) {
- while (WrOff == pRing->RdOff) {
- ;
- }
- }
- //
- // Output byte if free space is available
- //
- if (WrOff != pRing->RdOff) {
- pRing->pBuffer[pRing->WrOff] = c;
- pRing->WrOff = WrOff;
- Status = 1;
- } else {
- Status = 0;
- }
- //
- // Finish up.
- //
- SEGGER_RTT_UNLOCK();
- //
- return Status;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_GetKey
-*
-* Function description
-* Reads one character from the SEGGER RTT buffer.
-* Host has previously stored data there.
-*
-* Return value
-* < 0 - No character available (buffer empty).
-* >= 0 - Character which has been read. (Possible values: 0 - 255)
-*
-* Notes
-* (1) This function is only specified for accesses to RTT buffer 0.
-*/
-int SEGGER_RTT_GetKey(void) {
- char c;
- int r;
-
- r = (int)SEGGER_RTT_Read(0u, &c, 1u);
- if (r == 1) {
- r = (int)(unsigned char)c;
- } else {
- r = -1;
- }
- return r;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_WaitKey
-*
-* Function description
-* Waits until at least one character is avaible in the SEGGER RTT buffer.
-* Once a character is available, it is read and this function returns.
-*
-* Return value
-* >=0 - Character which has been read.
-*
-* Notes
-* (1) This function is only specified for accesses to RTT buffer 0
-* (2) This function is blocking if no character is present in RTT buffer
-*/
-int SEGGER_RTT_WaitKey(void) {
- int r;
-
- do {
- r = SEGGER_RTT_GetKey();
- } while (r < 0);
- return r;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_HasKey
-*
-* Function description
-* Checks if at least one character for reading is available in the SEGGER RTT buffer.
-*
-* Return value
-* == 0 - No characters are available to read.
-* == 1 - At least one character is available.
-*
-* Notes
-* (1) This function is only specified for accesses to RTT buffer 0
-*/
-int SEGGER_RTT_HasKey(void) {
- unsigned RdOff;
- int r;
-
- INIT();
- RdOff = _SEGGER_RTT.aDown[0].RdOff;
- if (RdOff != _SEGGER_RTT.aDown[0].WrOff) {
- r = 1;
- } else {
- r = 0;
- }
- return r;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_HasData
-*
-* Function description
-* Check if there is data from the host in the given buffer.
-*
-* Return value:
-* ==0: No data
-* !=0: Data in buffer
-*
-*/
-unsigned SEGGER_RTT_HasData(unsigned BufferIndex) {
- SEGGER_RTT_BUFFER_DOWN* pRing;
- unsigned v;
-
- pRing = &_SEGGER_RTT.aDown[BufferIndex];
- v = pRing->WrOff;
- return v - pRing->RdOff;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_HasDataUp
-*
-* Function description
-* Check if there is data remaining to be sent in the given buffer.
-*
-* Return value:
-* ==0: No data
-* !=0: Data in buffer
-*
-*/
-unsigned SEGGER_RTT_HasDataUp(unsigned BufferIndex) {
- SEGGER_RTT_BUFFER_UP* pRing;
- unsigned v;
-
- pRing = &_SEGGER_RTT.aUp[BufferIndex];
- v = pRing->RdOff;
- return pRing->WrOff - v;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_AllocDownBuffer
-*
-* Function description
-* Run-time configuration of the next down-buffer (H->T).
-* The next buffer, which is not used yet is configured.
-* This includes: Buffer address, size, name, flags, ...
-*
-* Parameters
-* sName Pointer to a constant name string.
-* pBuffer Pointer to a buffer to be used.
-* BufferSize Size of the buffer.
-* Flags Operating modes. Define behavior if buffer is full (not enough space for entire message).
-*
-* Return value
-* >= 0 - O.K. Buffer Index
-* < 0 - Error
-*/
-int SEGGER_RTT_AllocDownBuffer(const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags) {
- int BufferIndex;
-
- INIT();
- SEGGER_RTT_LOCK();
- BufferIndex = 0;
- do {
- if (_SEGGER_RTT.aDown[BufferIndex].pBuffer == NULL) {
- break;
- }
- BufferIndex++;
- } while (BufferIndex < _SEGGER_RTT.MaxNumDownBuffers);
- if (BufferIndex < _SEGGER_RTT.MaxNumDownBuffers) {
- _SEGGER_RTT.aDown[BufferIndex].sName = sName;
- _SEGGER_RTT.aDown[BufferIndex].pBuffer = (char*)pBuffer;
- _SEGGER_RTT.aDown[BufferIndex].SizeOfBuffer = BufferSize;
- _SEGGER_RTT.aDown[BufferIndex].RdOff = 0u;
- _SEGGER_RTT.aDown[BufferIndex].WrOff = 0u;
- _SEGGER_RTT.aDown[BufferIndex].Flags = Flags;
- } else {
- BufferIndex = -1;
- }
- SEGGER_RTT_UNLOCK();
- return BufferIndex;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_AllocUpBuffer
-*
-* Function description
-* Run-time configuration of the next up-buffer (T->H).
-* The next buffer, which is not used yet is configured.
-* This includes: Buffer address, size, name, flags, ...
-*
-* Parameters
-* sName Pointer to a constant name string.
-* pBuffer Pointer to a buffer to be used.
-* BufferSize Size of the buffer.
-* Flags Operating modes. Define behavior if buffer is full (not enough space for entire message).
-*
-* Return value
-* >= 0 - O.K. Buffer Index
-* < 0 - Error
-*/
-int SEGGER_RTT_AllocUpBuffer(const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags) {
- int BufferIndex;
-
- INIT();
- SEGGER_RTT_LOCK();
- BufferIndex = 0;
- do {
- if (_SEGGER_RTT.aUp[BufferIndex].pBuffer == NULL) {
- break;
- }
- BufferIndex++;
- } while (BufferIndex < _SEGGER_RTT.MaxNumUpBuffers);
- if (BufferIndex < _SEGGER_RTT.MaxNumUpBuffers) {
- _SEGGER_RTT.aUp[BufferIndex].sName = sName;
- _SEGGER_RTT.aUp[BufferIndex].pBuffer = (char*)pBuffer;
- _SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer = BufferSize;
- _SEGGER_RTT.aUp[BufferIndex].RdOff = 0u;
- _SEGGER_RTT.aUp[BufferIndex].WrOff = 0u;
- _SEGGER_RTT.aUp[BufferIndex].Flags = Flags;
- } else {
- BufferIndex = -1;
- }
- SEGGER_RTT_UNLOCK();
- return BufferIndex;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_ConfigUpBuffer
-*
-* Function description
-* Run-time configuration of a specific up-buffer (T->H).
-* Buffer to be configured is specified by index.
-* This includes: Buffer address, size, name, flags, ...
-*
-* Parameters
-* BufferIndex Index of the buffer to configure.
-* sName Pointer to a constant name string.
-* pBuffer Pointer to a buffer to be used.
-* BufferSize Size of the buffer.
-* Flags Operating modes. Define behavior if buffer is full (not enough space for entire message).
-*
-* Return value
-* >= 0 - O.K.
-* < 0 - Error
-*
-* Additional information
-* Buffer 0 is configured on compile-time.
-* May only be called once per buffer.
-* Buffer name and flags can be reconfigured using the appropriate functions.
-*/
-int SEGGER_RTT_ConfigUpBuffer(unsigned BufferIndex, const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags) {
- int r;
-
- INIT();
- if (BufferIndex < (unsigned)_SEGGER_RTT.MaxNumUpBuffers) {
- SEGGER_RTT_LOCK();
- if (BufferIndex > 0u) {
- _SEGGER_RTT.aUp[BufferIndex].sName = sName;
- _SEGGER_RTT.aUp[BufferIndex].pBuffer = (char*)pBuffer;
- _SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer = BufferSize;
- _SEGGER_RTT.aUp[BufferIndex].RdOff = 0u;
- _SEGGER_RTT.aUp[BufferIndex].WrOff = 0u;
- }
- _SEGGER_RTT.aUp[BufferIndex].Flags = Flags;
- SEGGER_RTT_UNLOCK();
- r = 0;
- } else {
- r = -1;
- }
- return r;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_ConfigDownBuffer
-*
-* Function description
-* Run-time configuration of a specific down-buffer (H->T).
-* Buffer to be configured is specified by index.
-* This includes: Buffer address, size, name, flags, ...
-*
-* Parameters
-* BufferIndex Index of the buffer to configure.
-* sName Pointer to a constant name string.
-* pBuffer Pointer to a buffer to be used.
-* BufferSize Size of the buffer.
-* Flags Operating modes. Define behavior if buffer is full (not enough space for entire message).
-*
-* Return value
-* >= 0 O.K.
-* < 0 Error
-*
-* Additional information
-* Buffer 0 is configured on compile-time.
-* May only be called once per buffer.
-* Buffer name and flags can be reconfigured using the appropriate functions.
-*/
-int SEGGER_RTT_ConfigDownBuffer(unsigned BufferIndex, const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags) {
- int r;
-
- INIT();
- if (BufferIndex < (unsigned)_SEGGER_RTT.MaxNumDownBuffers) {
- SEGGER_RTT_LOCK();
- if (BufferIndex > 0u) {
- _SEGGER_RTT.aDown[BufferIndex].sName = sName;
- _SEGGER_RTT.aDown[BufferIndex].pBuffer = (char*)pBuffer;
- _SEGGER_RTT.aDown[BufferIndex].SizeOfBuffer = BufferSize;
- _SEGGER_RTT.aDown[BufferIndex].RdOff = 0u;
- _SEGGER_RTT.aDown[BufferIndex].WrOff = 0u;
- }
- _SEGGER_RTT.aDown[BufferIndex].Flags = Flags;
- SEGGER_RTT_UNLOCK();
- r = 0;
- } else {
- r = -1;
- }
- return r;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_SetNameUpBuffer
-*
-* Function description
-* Run-time configuration of a specific up-buffer name (T->H).
-* Buffer to be configured is specified by index.
-*
-* Parameters
-* BufferIndex Index of the buffer to renamed.
-* sName Pointer to a constant name string.
-*
-* Return value
-* >= 0 O.K.
-* < 0 Error
-*/
-int SEGGER_RTT_SetNameUpBuffer(unsigned BufferIndex, const char* sName) {
- int r;
-
- INIT();
- if (BufferIndex < (unsigned)_SEGGER_RTT.MaxNumUpBuffers) {
- SEGGER_RTT_LOCK();
- _SEGGER_RTT.aUp[BufferIndex].sName = sName;
- SEGGER_RTT_UNLOCK();
- r = 0;
- } else {
- r = -1;
- }
- return r;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_SetNameDownBuffer
-*
-* Function description
-* Run-time configuration of a specific Down-buffer name (T->H).
-* Buffer to be configured is specified by index.
-*
-* Parameters
-* BufferIndex Index of the buffer to renamed.
-* sName Pointer to a constant name string.
-*
-* Return value
-* >= 0 O.K.
-* < 0 Error
-*/
-int SEGGER_RTT_SetNameDownBuffer(unsigned BufferIndex, const char* sName) {
- int r;
-
- INIT();
- if (BufferIndex < (unsigned)_SEGGER_RTT.MaxNumDownBuffers) {
- SEGGER_RTT_LOCK();
- _SEGGER_RTT.aDown[BufferIndex].sName = sName;
- SEGGER_RTT_UNLOCK();
- r = 0;
- } else {
- r = -1;
- }
- return r;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_SetFlagsUpBuffer
-*
-* Function description
-* Run-time configuration of specific up-buffer flags (T->H).
-* Buffer to be configured is specified by index.
-*
-* Parameters
-* BufferIndex Index of the buffer.
-* Flags Flags to set for the buffer.
-*
-* Return value
-* >= 0 O.K.
-* < 0 Error
-*/
-int SEGGER_RTT_SetFlagsUpBuffer(unsigned BufferIndex, unsigned Flags) {
- int r;
-
- INIT();
- if (BufferIndex < (unsigned)_SEGGER_RTT.MaxNumUpBuffers) {
- SEGGER_RTT_LOCK();
- _SEGGER_RTT.aUp[BufferIndex].Flags = Flags;
- SEGGER_RTT_UNLOCK();
- r = 0;
- } else {
- r = -1;
- }
- return r;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_SetFlagsDownBuffer
-*
-* Function description
-* Run-time configuration of specific Down-buffer flags (T->H).
-* Buffer to be configured is specified by index.
-*
-* Parameters
-* BufferIndex Index of the buffer to renamed.
-* Flags Flags to set for the buffer.
-*
-* Return value
-* >= 0 O.K.
-* < 0 Error
-*/
-int SEGGER_RTT_SetFlagsDownBuffer(unsigned BufferIndex, unsigned Flags) {
- int r;
-
- INIT();
- if (BufferIndex < (unsigned)_SEGGER_RTT.MaxNumDownBuffers) {
- SEGGER_RTT_LOCK();
- _SEGGER_RTT.aDown[BufferIndex].Flags = Flags;
- SEGGER_RTT_UNLOCK();
- r = 0;
- } else {
- r = -1;
- }
- return r;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_Init
-*
-* Function description
-* Initializes the RTT Control Block.
-* Should be used in RAM targets, at start of the application.
-*
-*/
-void SEGGER_RTT_Init (void) {
- _DoInit();
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_SetTerminal
-*
-* Function description
-* Sets the terminal to be used for output on channel 0.
-*
-* Parameters
-* TerminalId Index of the terminal.
-*
-* Return value
-* >= 0 O.K.
-* < 0 Error (e.g. if RTT is configured for non-blocking mode and there was no space in the buffer to set the new terminal Id)
-*/
-int SEGGER_RTT_SetTerminal (unsigned char TerminalId) {
- unsigned char ac[2];
- SEGGER_RTT_BUFFER_UP* pRing;
- unsigned Avail;
- int r;
- //
- INIT();
- //
- r = 0;
- ac[0] = 0xFFu;
- if (TerminalId < sizeof(_aTerminalId)) { // We only support a certain number of channels
- ac[1] = _aTerminalId[TerminalId];
- pRing = &_SEGGER_RTT.aUp[0]; // Buffer 0 is always reserved for terminal I/O, so we can use index 0 here, fixed
- SEGGER_RTT_LOCK(); // Lock to make sure that no other task is writing into buffer, while we are and number of free bytes in buffer does not change downwards after checking and before writing
- if ((pRing->Flags & SEGGER_RTT_MODE_MASK) == SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL) {
- _ActiveTerminal = TerminalId;
- _WriteBlocking(pRing, (const char*)ac, 2u);
- } else { // Skipping mode or trim mode? => We cannot trim this command so handling is the same for both modes
- Avail = _GetAvailWriteSpace(pRing);
- if (Avail >= 2) {
- _ActiveTerminal = TerminalId; // Only change active terminal in case of success
- _WriteNoCheck(pRing, (const char*)ac, 2u);
- } else {
- r = -1;
- }
- }
- SEGGER_RTT_UNLOCK();
- } else {
- r = -1;
- }
- return r;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_TerminalOut
-*
-* Function description
-* Writes a string to the given terminal
-* without changing the terminal for channel 0.
-*
-* Parameters
-* TerminalId Index of the terminal.
-* s String to be printed on the terminal.
-*
-* Return value
-* >= 0 - Number of bytes written.
-* < 0 - Error.
-*
-*/
-int SEGGER_RTT_TerminalOut (unsigned char TerminalId, const char* s) {
- int Status;
- unsigned FragLen;
- unsigned Avail;
- SEGGER_RTT_BUFFER_UP* pRing;
- //
- INIT();
- //
- // Validate terminal ID.
- //
- if (TerminalId < (char)sizeof(_aTerminalId)) { // We only support a certain number of channels
- //
- // Get "to-host" ring buffer.
- //
- pRing = &_SEGGER_RTT.aUp[0];
- //
- // Need to be able to change terminal, write data, change back.
- // Compute the fixed and variable sizes.
- //
- FragLen = STRLEN(s);
- //
- // How we output depends upon the mode...
- //
- SEGGER_RTT_LOCK();
- Avail = _GetAvailWriteSpace(pRing);
- switch (pRing->Flags & SEGGER_RTT_MODE_MASK) {
- case SEGGER_RTT_MODE_NO_BLOCK_SKIP:
- //
- // If we are in skip mode and there is no space for the whole
- // of this output, don't bother switching terminals at all.
- //
- if (Avail < (FragLen + 4u)) {
- Status = 0;
- } else {
- _PostTerminalSwitch(pRing, TerminalId);
- Status = (int)_WriteBlocking(pRing, s, FragLen);
- _PostTerminalSwitch(pRing, _ActiveTerminal);
- }
- break;
- case SEGGER_RTT_MODE_NO_BLOCK_TRIM:
- //
- // If we are in trim mode and there is not enough space for everything,
- // trim the output but always include the terminal switch. If no room
- // for terminal switch, skip that totally.
- //
- if (Avail < 4u) {
- Status = -1;
- } else {
- _PostTerminalSwitch(pRing, TerminalId);
- Status = (int)_WriteBlocking(pRing, s, (FragLen < (Avail - 4u)) ? FragLen : (Avail - 4u));
- _PostTerminalSwitch(pRing, _ActiveTerminal);
- }
- break;
- case SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL:
- //
- // If we are in blocking mode, output everything.
- //
- _PostTerminalSwitch(pRing, TerminalId);
- Status = (int)_WriteBlocking(pRing, s, FragLen);
- _PostTerminalSwitch(pRing, _ActiveTerminal);
- break;
- default:
- Status = -1;
- break;
- }
- //
- // Finish up.
- //
- SEGGER_RTT_UNLOCK();
- } else {
- Status = -1;
- }
- return Status;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_GetAvailWriteSpace
-*
-* Function description
-* Returns the number of bytes available in the ring buffer.
-*
-* Parameters
-* BufferIndex Index of the up buffer.
-*
-* Return value
-* Number of bytes that are free in the selected up buffer.
-*/
-unsigned SEGGER_RTT_GetAvailWriteSpace (unsigned BufferIndex){
- return _GetAvailWriteSpace(&_SEGGER_RTT.aUp[BufferIndex]);
-}
-
-
-/*********************************************************************
-*
-* SEGGER_RTT_GetBytesInBuffer()
-*
-* Function description
-* Returns the number of bytes currently used in the up buffer.
-*
-* Parameters
-* BufferIndex Index of the up buffer.
-*
-* Return value
-* Number of bytes that are used in the buffer.
-*/
-unsigned SEGGER_RTT_GetBytesInBuffer(unsigned BufferIndex) {
- unsigned RdOff;
- unsigned WrOff;
- unsigned r;
- //
- // Avoid warnings regarding volatile access order. It's not a problem
- // in this case, but dampen compiler enthusiasm.
- //
- RdOff = _SEGGER_RTT.aUp[BufferIndex].RdOff;
- WrOff = _SEGGER_RTT.aUp[BufferIndex].WrOff;
- if (RdOff <= WrOff) {
- r = WrOff - RdOff;
- } else {
- r = _SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer - (WrOff - RdOff);
- }
- return r;
-}
-
-/*************************** End of file ****************************/
diff --git a/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT.h b/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT.h
deleted file mode 100755
index 3c04df55..00000000
--- a/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT.h
+++ /dev/null
@@ -1,321 +0,0 @@
-/*********************************************************************
-* SEGGER Microcontroller GmbH *
-* The Embedded Experts *
-**********************************************************************
-* *
-* (c) 1995 - 2019 SEGGER Microcontroller GmbH *
-* *
-* www.segger.com Support: support@segger.com *
-* *
-**********************************************************************
-* *
-* SEGGER RTT * Real Time Transfer for embedded targets *
-* *
-**********************************************************************
-* *
-* All rights reserved. *
-* *
-* SEGGER strongly recommends to not make any changes *
-* to or modify the source code of this software in order to stay *
-* compatible with the RTT protocol and J-Link. *
-* *
-* Redistribution and use in source and binary forms, with or *
-* without modification, are permitted provided that the following *
-* condition is met: *
-* *
-* o Redistributions of source code must retain the above copyright *
-* notice, this condition and the following disclaimer. *
-* *
-* 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 SEGGER Microcontroller 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. *
-* *
-**********************************************************************
----------------------------END-OF-HEADER------------------------------
-File : SEGGER_RTT.h
-Purpose : Implementation of SEGGER real-time transfer which allows
- real-time communication on targets which support debugger
- memory accesses while the CPU is running.
-Revision: $Rev: 17697 $
-----------------------------------------------------------------------
-*/
-
-#ifndef SEGGER_RTT_H
-#define SEGGER_RTT_H
-
-#include "SEGGER_RTT_Conf.h"
-
-
-
-/*********************************************************************
-*
-* Defines, defaults
-*
-**********************************************************************
-*/
-#ifndef RTT_USE_ASM
- #if (defined __SES_ARM) // SEGGER Embedded Studio
- #define _CC_HAS_RTT_ASM_SUPPORT 1
- #elif (defined __CROSSWORKS_ARM) // Rowley Crossworks
- #define _CC_HAS_RTT_ASM_SUPPORT 1
- #elif (defined __GNUC__) // GCC
- #define _CC_HAS_RTT_ASM_SUPPORT 1
- #elif (defined __clang__) // Clang compiler
- #define _CC_HAS_RTT_ASM_SUPPORT 1
- #elif (defined __IASMARM__) // IAR assembler
- #define _CC_HAS_RTT_ASM_SUPPORT 1
- #elif (defined __ICCARM__) // IAR compiler
- #define _CC_HAS_RTT_ASM_SUPPORT 1
- #else
- #define _CC_HAS_RTT_ASM_SUPPORT 0
- #endif
- #if (defined __ARM_ARCH_7M__) // Cortex-M3/4
- #define _CORE_HAS_RTT_ASM_SUPPORT 1
- #elif (defined __ARM_ARCH_7EM__) // Cortex-M7
- #define _CORE_HAS_RTT_ASM_SUPPORT 1
- #elif (defined __ARM_ARCH_8M_MAIN__) // Cortex-M33
- #define _CORE_HAS_RTT_ASM_SUPPORT 1
- #elif (defined __ARM7M__) // IAR Cortex-M3/4
- #if (__CORE__ == __ARM7M__)
- #define _CORE_HAS_RTT_ASM_SUPPORT 1
- #else
- #define _CORE_HAS_RTT_ASM_SUPPORT 0
- #endif
- #elif (defined __ARM7EM__) // IAR Cortex-M7
- #if (__CORE__ == __ARM7EM__)
- #define _CORE_HAS_RTT_ASM_SUPPORT 1
- #else
- #define _CORE_HAS_RTT_ASM_SUPPORT 0
- #endif
- #else
- #define _CORE_HAS_RTT_ASM_SUPPORT 0
- #endif
- //
- // If IDE and core support the ASM version, enable ASM version by default
- //
- #if (_CC_HAS_RTT_ASM_SUPPORT && _CORE_HAS_RTT_ASM_SUPPORT)
- #define RTT_USE_ASM (1)
- #else
- #define RTT_USE_ASM (0)
- #endif
-#endif
-
-#ifndef SEGGER_RTT_ASM // defined when SEGGER_RTT.h is included from assembly file
-#include <stdlib.h>
-#include <stdarg.h>
-
-/*********************************************************************
-*
-* Defines, fixed
-*
-**********************************************************************
-*/
-
-/*********************************************************************
-*
-* Types
-*
-**********************************************************************
-*/
-
-//
-// Description for a circular buffer (also called "ring buffer")
-// which is used as up-buffer (T->H)
-//
-typedef struct {
- const char* sName; // Optional name. Standard names so far are: "Terminal", "SysView", "J-Scope_t4i4"
- char* pBuffer; // Pointer to start of buffer
- unsigned SizeOfBuffer; // Buffer size in bytes. Note that one byte is lost, as this implementation does not fill up the buffer in order to avoid the problem of being unable to distinguish between full and empty.
- unsigned WrOff; // Position of next item to be written by either target.
- volatile unsigned RdOff; // Position of next item to be read by host. Must be volatile since it may be modified by host.
- unsigned Flags; // Contains configuration flags
-} SEGGER_RTT_BUFFER_UP;
-
-//
-// Description for a circular buffer (also called "ring buffer")
-// which is used as down-buffer (H->T)
-//
-typedef struct {
- const char* sName; // Optional name. Standard names so far are: "Terminal", "SysView", "J-Scope_t4i4"
- char* pBuffer; // Pointer to start of buffer
- unsigned SizeOfBuffer; // Buffer size in bytes. Note that one byte is lost, as this implementation does not fill up the buffer in order to avoid the problem of being unable to distinguish between full and empty.
- volatile unsigned WrOff; // Position of next item to be written by host. Must be volatile since it may be modified by host.
- unsigned RdOff; // Position of next item to be read by target (down-buffer).
- unsigned Flags; // Contains configuration flags
-} SEGGER_RTT_BUFFER_DOWN;
-
-//
-// RTT control block which describes the number of buffers available
-// as well as the configuration for each buffer
-//
-//
-typedef struct {
- char acID[16]; // Initialized to "SEGGER RTT"
- int MaxNumUpBuffers; // Initialized to SEGGER_RTT_MAX_NUM_UP_BUFFERS (type. 2)
- int MaxNumDownBuffers; // Initialized to SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (type. 2)
- SEGGER_RTT_BUFFER_UP aUp[SEGGER_RTT_MAX_NUM_UP_BUFFERS]; // Up buffers, transferring information up from target via debug probe to host
- SEGGER_RTT_BUFFER_DOWN aDown[SEGGER_RTT_MAX_NUM_DOWN_BUFFERS]; // Down buffers, transferring information down from host via debug probe to target
-} SEGGER_RTT_CB;
-
-/*********************************************************************
-*
-* Global data
-*
-**********************************************************************
-*/
-extern SEGGER_RTT_CB _SEGGER_RTT;
-
-/*********************************************************************
-*
-* RTT API functions
-*
-**********************************************************************
-*/
-#ifdef __cplusplus
- extern "C" {
-#endif
-int SEGGER_RTT_AllocDownBuffer (const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags);
-int SEGGER_RTT_AllocUpBuffer (const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags);
-int SEGGER_RTT_ConfigUpBuffer (unsigned BufferIndex, const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags);
-int SEGGER_RTT_ConfigDownBuffer (unsigned BufferIndex, const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags);
-int SEGGER_RTT_GetKey (void);
-unsigned SEGGER_RTT_HasData (unsigned BufferIndex);
-int SEGGER_RTT_HasKey (void);
-unsigned SEGGER_RTT_HasDataUp (unsigned BufferIndex);
-void SEGGER_RTT_Init (void);
-unsigned SEGGER_RTT_Read (unsigned BufferIndex, void* pBuffer, unsigned BufferSize);
-unsigned SEGGER_RTT_ReadNoLock (unsigned BufferIndex, void* pData, unsigned BufferSize);
-int SEGGER_RTT_SetNameDownBuffer (unsigned BufferIndex, const char* sName);
-int SEGGER_RTT_SetNameUpBuffer (unsigned BufferIndex, const char* sName);
-int SEGGER_RTT_SetFlagsDownBuffer (unsigned BufferIndex, unsigned Flags);
-int SEGGER_RTT_SetFlagsUpBuffer (unsigned BufferIndex, unsigned Flags);
-int SEGGER_RTT_WaitKey (void);
-unsigned SEGGER_RTT_Write (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
-unsigned SEGGER_RTT_WriteNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
-unsigned SEGGER_RTT_WriteSkipNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
-unsigned SEGGER_RTT_ASM_WriteSkipNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
-unsigned SEGGER_RTT_WriteString (unsigned BufferIndex, const char* s);
-void SEGGER_RTT_WriteWithOverwriteNoLock(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
-unsigned SEGGER_RTT_PutChar (unsigned BufferIndex, char c);
-unsigned SEGGER_RTT_PutCharSkip (unsigned BufferIndex, char c);
-unsigned SEGGER_RTT_PutCharSkipNoLock (unsigned BufferIndex, char c);
-unsigned SEGGER_RTT_GetAvailWriteSpace (unsigned BufferIndex);
-unsigned SEGGER_RTT_GetBytesInBuffer (unsigned BufferIndex);
-//
-// Function macro for performance optimization
-//
-#define SEGGER_RTT_HASDATA(n) (_SEGGER_RTT.aDown[n].WrOff - _SEGGER_RTT.aDown[n].RdOff)
-
-#if RTT_USE_ASM
- #define SEGGER_RTT_WriteSkipNoLock SEGGER_RTT_ASM_WriteSkipNoLock
-#endif
-
-/*********************************************************************
-*
-* RTT transfer functions to send RTT data via other channels.
-*
-**********************************************************************
-*/
-unsigned SEGGER_RTT_ReadUpBuffer (unsigned BufferIndex, void* pBuffer, unsigned BufferSize);
-unsigned SEGGER_RTT_ReadUpBufferNoLock (unsigned BufferIndex, void* pData, unsigned BufferSize);
-unsigned SEGGER_RTT_WriteDownBuffer (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
-unsigned SEGGER_RTT_WriteDownBufferNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
-
-#define SEGGER_RTT_HASDATA_UP(n) (_SEGGER_RTT.aUp[n].WrOff - _SEGGER_RTT.aUp[n].RdOff)
-
-/*********************************************************************
-*
-* RTT "Terminal" API functions
-*
-**********************************************************************
-*/
-int SEGGER_RTT_SetTerminal (unsigned char TerminalId);
-int SEGGER_RTT_TerminalOut (unsigned char TerminalId, const char* s);
-
-/*********************************************************************
-*
-* RTT printf functions (require SEGGER_RTT_printf.c)
-*
-**********************************************************************
-*/
-int SEGGER_RTT_printf(unsigned BufferIndex, const char * sFormat, ...);
-int SEGGER_RTT_vprintf(unsigned BufferIndex, const char * sFormat, va_list * pParamList);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif // ifndef(SEGGER_RTT_ASM)
-
-/*********************************************************************
-*
-* Defines
-*
-**********************************************************************
-*/
-
-//
-// Operating modes. Define behavior if buffer is full (not enough space for entire message)
-//
-#define SEGGER_RTT_MODE_NO_BLOCK_SKIP (0) // Skip. Do not block, output nothing. (Default)
-#define SEGGER_RTT_MODE_NO_BLOCK_TRIM (1) // Trim: Do not block, output as much as fits.
-#define SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL (2) // Block: Wait until there is space in the buffer.
-#define SEGGER_RTT_MODE_MASK (3)
-
-//
-// Control sequences, based on ANSI.
-// Can be used to control color, and clear the screen
-//
-#define RTT_CTRL_RESET "\x1B[0m" // Reset to default colors
-#define RTT_CTRL_CLEAR "\x1B[2J" // Clear screen, reposition cursor to top left
-
-#define RTT_CTRL_TEXT_BLACK "\x1B[2;30m"
-#define RTT_CTRL_TEXT_RED "\x1B[2;31m"
-#define RTT_CTRL_TEXT_GREEN "\x1B[2;32m"
-#define RTT_CTRL_TEXT_YELLOW "\x1B[2;33m"
-#define RTT_CTRL_TEXT_BLUE "\x1B[2;34m"
-#define RTT_CTRL_TEXT_MAGENTA "\x1B[2;35m"
-#define RTT_CTRL_TEXT_CYAN "\x1B[2;36m"
-#define RTT_CTRL_TEXT_WHITE "\x1B[2;37m"
-
-#define RTT_CTRL_TEXT_BRIGHT_BLACK "\x1B[1;30m"
-#define RTT_CTRL_TEXT_BRIGHT_RED "\x1B[1;31m"
-#define RTT_CTRL_TEXT_BRIGHT_GREEN "\x1B[1;32m"
-#define RTT_CTRL_TEXT_BRIGHT_YELLOW "\x1B[1;33m"
-#define RTT_CTRL_TEXT_BRIGHT_BLUE "\x1B[1;34m"
-#define RTT_CTRL_TEXT_BRIGHT_MAGENTA "\x1B[1;35m"
-#define RTT_CTRL_TEXT_BRIGHT_CYAN "\x1B[1;36m"
-#define RTT_CTRL_TEXT_BRIGHT_WHITE "\x1B[1;37m"
-
-#define RTT_CTRL_BG_BLACK "\x1B[24;40m"
-#define RTT_CTRL_BG_RED "\x1B[24;41m"
-#define RTT_CTRL_BG_GREEN "\x1B[24;42m"
-#define RTT_CTRL_BG_YELLOW "\x1B[24;43m"
-#define RTT_CTRL_BG_BLUE "\x1B[24;44m"
-#define RTT_CTRL_BG_MAGENTA "\x1B[24;45m"
-#define RTT_CTRL_BG_CYAN "\x1B[24;46m"
-#define RTT_CTRL_BG_WHITE "\x1B[24;47m"
-
-#define RTT_CTRL_BG_BRIGHT_BLACK "\x1B[4;40m"
-#define RTT_CTRL_BG_BRIGHT_RED "\x1B[4;41m"
-#define RTT_CTRL_BG_BRIGHT_GREEN "\x1B[4;42m"
-#define RTT_CTRL_BG_BRIGHT_YELLOW "\x1B[4;43m"
-#define RTT_CTRL_BG_BRIGHT_BLUE "\x1B[4;44m"
-#define RTT_CTRL_BG_BRIGHT_MAGENTA "\x1B[4;45m"
-#define RTT_CTRL_BG_BRIGHT_CYAN "\x1B[4;46m"
-#define RTT_CTRL_BG_BRIGHT_WHITE "\x1B[4;47m"
-
-
-#endif
-
-/*************************** End of file ****************************/
diff --git a/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_ASM_ARMv7M.S b/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_ASM_ARMv7M.S
deleted file mode 100755
index 78cde4d7..00000000
--- a/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_ASM_ARMv7M.S
+++ /dev/null
@@ -1,235 +0,0 @@
-/*********************************************************************
-* (c) SEGGER Microcontroller GmbH *
-* The Embedded Experts *
-* www.segger.com *
-**********************************************************************
-
--------------------------- END-OF-HEADER -----------------------------
-
-File : SEGGER_RTT_ASM_ARMv7M.S
-Purpose : Assembler implementation of RTT functions for ARMv7M
-
-Additional information:
- This module is written to be assembler-independent and works with
- GCC and clang (Embedded Studio) and IAR.
-*/
-
-#define SEGGER_RTT_ASM // Used to control processed input from header file
-#include "SEGGER_RTT.h"
-
-/*********************************************************************
-*
-* Defines, fixed
-*
-**********************************************************************
-*/
-#define _CCIAR 0
-#define _CCCLANG 1
-
-#if (defined __SES_ARM) || (defined __GNUC__) || (defined __clang__)
- #define _CC_TYPE _CCCLANG
- #define _PUB_SYM .global
- #define _EXT_SYM .extern
- #define _END .end
- #define _WEAK .weak
- #define _THUMB_FUNC .thumb_func
- #define _THUMB_CODE .code 16
- #define _WORD .word
- #define _SECTION(Sect, Type, AlignExp) .section Sect ##, "ax"
- #define _ALIGN(Exp) .align Exp
- #define _PLACE_LITS .ltorg
- #define _DATA_SECT_START
- #define _C_STARTUP _start
- #define _STACK_END __stack_end__
- #define _RAMFUNC
- //
- // .text => Link to flash
- // .fast => Link to RAM
- // OtherSect => Usually link to RAM
- // Alignment is 2^x
- //
-#elif defined (__IASMARM__)
- #define _CC_TYPE _CCIAR
- #define _PUB_SYM PUBLIC
- #define _EXT_SYM EXTERN
- #define _END END
- #define _WEAK _WEAK
- #define _THUMB_FUNC
- #define _THUMB_CODE THUMB
- #define _WORD DCD
- #define _SECTION(Sect, Type, AlignExp) SECTION Sect ## : ## Type ## :REORDER:NOROOT ## (AlignExp)
- #define _ALIGN(Exp) alignrom Exp
- #define _PLACE_LITS
- #define _DATA_SECT_START DATA
- #define _C_STARTUP __iar_program_start
- #define _STACK_END sfe(CSTACK)
- #define _RAMFUNC SECTION_TYPE SHT_PROGBITS, SHF_WRITE | SHF_EXECINSTR
- //
- // .text => Link to flash
- // .textrw => Link to RAM
- // OtherSect => Usually link to RAM
- // NOROOT => Allows linker to throw away the function, if not referenced
- // Alignment is 2^x
- //
-#endif
-
-#if (_CC_TYPE == _CCIAR)
- NAME SEGGER_RTT_ASM_ARMv7M
-#else
- .syntax unified
-#endif
-
-#if defined (RTT_USE_ASM) && (RTT_USE_ASM == 1)
- #define SHT_PROGBITS 0x1
-
-/*********************************************************************
-*
-* Public / external symbols
-*
-**********************************************************************
-*/
-
- _EXT_SYM __aeabi_memcpy
- _EXT_SYM __aeabi_memcpy4
- _EXT_SYM _SEGGER_RTT
-
- _PUB_SYM SEGGER_RTT_ASM_WriteSkipNoLock
-
-/*********************************************************************
-*
-* SEGGER_RTT_WriteSkipNoLock
-*
-* Function description
-* Stores a specified number of characters in SEGGER RTT
-* control block which is then read by the host.
-* SEGGER_RTT_WriteSkipNoLock does not lock the application and
-* skips all data, if the data does not fit into the buffer.
-*
-* Parameters
-* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
-* pBuffer Pointer to character array. Does not need to point to a \0 terminated string.
-* NumBytes Number of bytes to be stored in the SEGGER RTT control block.
-* MUST be > 0!!!
-* This is done for performance reasons, so no initial check has do be done.
-*
-* Return value
-* 1: Data has been copied
-* 0: No space, data has not been copied
-*
-* Notes
-* (1) If there is not enough space in the "Up"-buffer, all data is dropped.
-* (2) For performance reasons this function does not call Init()
-* and may only be called after RTT has been initialized.
-* Either by calling SEGGER_RTT_Init() or calling another RTT API function first.
-*/
- _SECTION(.text, CODE, 2)
- _ALIGN(2)
- _THUMB_FUNC
-SEGGER_RTT_ASM_WriteSkipNoLock: // unsigned SEGGER_RTT_WriteSkipNoLock(unsigned BufferIndex, const void* pData, unsigned NumBytes) {
- //
- // Cases:
- // 1) RdOff <= WrOff => Space until wrap-around is sufficient
- // 2) RdOff <= WrOff => Space after wrap-around needed (copy in 2 chunks)
- // 3) RdOff < WrOff => No space in buf
- // 4) RdOff > WrOff => Space is sufficient
- // 5) RdOff > WrOff => No space in buf
- //
- // 1) is the most common case for large buffers and assuming that J-Link reads the data fast enough
- //
- // Register usage:
- // R0 Temporary needed as RdOff, <Tmp> register later on
- // R1 pData
- // R2 <NumBytes>
- // R3 <Tmp> register. Hold free for subroutine calls
- // R4 <Rem>
- // R5 pRing->pBuffer
- // R6 pRing (Points to active struct SEGGER_RTT_BUFFER_DOWN)
- // R7 WrOff
- //
- PUSH {R4-R7}
- ADD R3,R0,R0, LSL #+1
- LDR.W R0,=_SEGGER_RTT // pRing = &_SEGGER_RTT.aUp[BufferIndex];
- ADD R0,R0,R3, LSL #+3
- ADD R6,R0,#+24
- LDR R0,[R6, #+16] // RdOff = pRing->RdOff;
- LDR R7,[R6, #+12] // WrOff = pRing->WrOff;
- LDR R5,[R6, #+4] // pRing->pBuffer
- CMP R7,R0
- BCC.N _CheckCase4 // if (RdOff <= WrOff) { => Case 1), 2) or 3)
- //
- // Handling for case 1, later on identical to case 4
- //
- LDR R3,[R6, #+8] // Avail = pRing->SizeOfBuffer - WrOff - 1u; => Space until wrap-around (assume 1 byte not usable for case that RdOff == 0)
- SUBS R4,R3,R7 // <Rem> (Used in case we jump into case 2 afterwards)
- SUBS R3,R4,#+1 // <Avail>
- CMP R3,R2
- BCC.N _CheckCase2 // if (Avail >= NumBytes) { => Case 1)?
-_Case4:
- ADDS R5,R7,R5 // pBuffer += WrOff
- ADDS R0,R2,R7 // v = WrOff + NumBytes
- //
- // 2x unrolling for the copy loop that is used most of the time
- // This is a special optimization for small SystemView packets and makes them even faster
- //
- _ALIGN(2)
-_LoopCopyStraight: // memcpy(pRing->pBuffer + WrOff, pData, NumBytes);
- LDRB R3,[R1], #+1
- STRB R3,[R5], #+1 // *pDest++ = *pSrc++
- SUBS R2,R2,#+1
- BEQ _CSDone
- LDRB R3,[R1], #+1
- STRB R3,[R5], #+1 // *pDest++ = *pSrc++
- SUBS R2,R2,#+1
- BNE _LoopCopyStraight
-_CSDone:
- STR R0,[R6, #+12] // pRing->WrOff = WrOff + NumBytes;
- MOVS R0,#+1
- POP {R4-R7}
- BX LR // Return 1
-_CheckCase2:
- ADDS R0,R0,R3 // Avail += RdOff; => Space incl. wrap-around
- CMP R0,R2
- BCC.N _Case3 // if (Avail >= NumBytes) { => Case 2? => If not, we have case 3) (does not fit)
- //
- // Handling for case 2
- //
- ADDS R0,R7,R5 // v = pRing->pBuffer + WrOff => Do not change pRing->pBuffer here because 2nd chunk needs org. value
- SUBS R2,R2,R4 // NumBytes -= Rem; (Rem = pRing->SizeOfBuffer - WrOff; => Space until end of buffer)
-_LoopCopyBeforeWrapAround: // memcpy(pRing->pBuffer + WrOff, pData, Rem); => Copy 1st chunk
- LDRB R3,[R1], #+1
- STRB R3,[R0], #+1 // *pDest++ = *pSrc++
- SUBS R4,R4,#+1
- BNE _LoopCopyBeforeWrapAround
- //
- // Special case: First check that assumed RdOff == 0 calculated that last element before wrap-around could not be used
- // But 2nd check (considering space until wrap-around and until RdOff) revealed that RdOff is not 0, so we can use the last element
- // In this case, we may use a copy straight until buffer end anyway without needing to copy 2 chunks
- // Therefore, check if 2nd memcpy is necessary at all
- //
- ADDS R4,R2,#+0 // Save <NumBytes> (needed as counter in loop but must be written to <WrOff> after the loop). Also use this inst to update the flags to skip 2nd loop if possible
- BEQ.N _No2ChunkNeeded // if (NumBytes) {
-_LoopCopyAfterWrapAround: // memcpy(pRing->pBuffer, pData + Rem, NumBytes);
- LDRB R3,[R1], #+1 // pData already points to the next src byte due to copy loop increment before this loop
- STRB R3,[R5], #+1 // *pDest++ = *pSrc++
- SUBS R2,R2,#+1
- BNE _LoopCopyAfterWrapAround
-_No2ChunkNeeded:
- STR R4,[R6, #+12] // pRing->WrOff = NumBytes; => Must be written after copying data because J-Link may read control block asynchronously while writing into buffer
- MOVS R0,#+1
- POP {R4-R7}
- BX LR // Return 1
-_CheckCase4:
- SUBS R0,R0,R7
- SUBS R0,R0,#+1 // Avail = RdOff - WrOff - 1u;
- CMP R0,R2
- BCS.N _Case4 // if (Avail >= NumBytes) { => Case 4) == 1) ? => If not, we have case 5) == 3) (does not fit)
-_Case3:
- MOVS R0,#+0
- POP {R4-R7}
- BX LR // Return 0
- _PLACE_LITS
-
-#endif // defined (RTT_USE_ASM) && (RTT_USE_ASM == 1)
- _END
-
-/*************************** End of file ****************************/
diff --git a/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_Conf.h b/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_Conf.h
deleted file mode 100755
index 5e79d7e6..00000000
--- a/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_Conf.h
+++ /dev/null
@@ -1,384 +0,0 @@
-/*********************************************************************
-* SEGGER Microcontroller GmbH *
-* The Embedded Experts *
-**********************************************************************
-* *
-* (c) 1995 - 2019 SEGGER Microcontroller GmbH *
-* *
-* www.segger.com Support: support@segger.com *
-* *
-**********************************************************************
-* *
-* SEGGER RTT * Real Time Transfer for embedded targets *
-* *
-**********************************************************************
-* *
-* All rights reserved. *
-* *
-* SEGGER strongly recommends to not make any changes *
-* to or modify the source code of this software in order to stay *
-* compatible with the RTT protocol and J-Link. *
-* *
-* Redistribution and use in source and binary forms, with or *
-* without modification, are permitted provided that the following *
-* condition is met: *
-* *
-* o Redistributions of source code must retain the above copyright *
-* notice, this condition and the following disclaimer. *
-* *
-* 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 SEGGER Microcontroller 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. *
-* *
-**********************************************************************
----------------------------END-OF-HEADER------------------------------
-File : SEGGER_RTT_Conf.h
-Purpose : Implementation of SEGGER real-time transfer (RTT) which
- allows real-time communication on targets which support
- debugger memory accesses while the CPU is running.
-Revision: $Rev: 18601 $
-
-*/
-
-#ifndef SEGGER_RTT_CONF_H
-#define SEGGER_RTT_CONF_H
-
-#ifdef __IAR_SYSTEMS_ICC__
- #include <intrinsics.h>
-#endif
-
-/*********************************************************************
-*
-* Defines, configurable
-*
-**********************************************************************
-*/
-#ifndef SEGGER_RTT_MAX_NUM_UP_BUFFERS
- #define SEGGER_RTT_MAX_NUM_UP_BUFFERS (3) // Max. number of up-buffers (T->H) available on this target (Default: 3)
-#endif
-
-#ifndef SEGGER_RTT_MAX_NUM_DOWN_BUFFERS
- #define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (3) // Max. number of down-buffers (H->T) available on this target (Default: 3)
-#endif
-
-#ifndef BUFFER_SIZE_UP
- #define BUFFER_SIZE_UP (1024) // Size of the buffer for terminal output of target, up to host (Default: 1k)
-#endif
-
-#ifndef BUFFER_SIZE_DOWN
- #define BUFFER_SIZE_DOWN (16) // Size of the buffer for terminal input to target from host (Usually keyboard input) (Default: 16)
-#endif
-
-#ifndef SEGGER_RTT_PRINTF_BUFFER_SIZE
- #define SEGGER_RTT_PRINTF_BUFFER_SIZE (64u) // Size of buffer for RTT printf to bulk-send chars via RTT (Default: 64)
-#endif
-
-#ifndef SEGGER_RTT_MODE_DEFAULT
- #define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_NO_BLOCK_SKIP // Mode for pre-initialized terminal channel (buffer 0)
-#endif
-
-/*********************************************************************
-*
-* RTT memcpy configuration
-*
-* memcpy() is good for large amounts of data,
-* but the overhead is big for small amounts, which are usually stored via RTT.
-* With SEGGER_RTT_MEMCPY_USE_BYTELOOP a simple byte loop can be used instead.
-*
-* SEGGER_RTT_MEMCPY() can be used to replace standard memcpy() in RTT functions.
-* This is may be required with memory access restrictions,
-* such as on Cortex-A devices with MMU.
-*/
-#ifndef SEGGER_RTT_MEMCPY_USE_BYTELOOP
- #define SEGGER_RTT_MEMCPY_USE_BYTELOOP 0 // 0: Use memcpy/SEGGER_RTT_MEMCPY, 1: Use a simple byte-loop
-#endif
-//
-// Example definition of SEGGER_RTT_MEMCPY to external memcpy with GCC toolchains and Cortex-A targets
-//
-//#if ((defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__)) && (defined (__ARM_ARCH_7A__))
-// #define SEGGER_RTT_MEMCPY(pDest, pSrc, NumBytes) SEGGER_memcpy((pDest), (pSrc), (NumBytes))
-//#endif
-
-//
-// Target is not allowed to perform other RTT operations while string still has not been stored completely.
-// Otherwise we would probably end up with a mixed string in the buffer.
-// If using RTT from within interrupts, multiple tasks or multi processors, define the SEGGER_RTT_LOCK() and SEGGER_RTT_UNLOCK() function here.
-//
-// SEGGER_RTT_MAX_INTERRUPT_PRIORITY can be used in the sample lock routines on Cortex-M3/4.
-// Make sure to mask all interrupts which can send RTT data, i.e. generate SystemView events, or cause task switches.
-// When high-priority interrupts must not be masked while sending RTT data, SEGGER_RTT_MAX_INTERRUPT_PRIORITY needs to be adjusted accordingly.
-// (Higher priority = lower priority number)
-// Default value for embOS: 128u
-// Default configuration in FreeRTOS: configMAX_SYSCALL_INTERRUPT_PRIORITY: ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
-// In case of doubt mask all interrupts: 1 << (8 - BASEPRI_PRIO_BITS) i.e. 1 << 5 when 3 bits are implemented in NVIC
-// or define SEGGER_RTT_LOCK() to completely disable interrupts.
-//
-#ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY
- #define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20) // Interrupt priority to lock on SEGGER_RTT_LOCK on Cortex-M3/4 (Default: 0x20)
-#endif
-
-/*********************************************************************
-*
-* RTT lock configuration for SEGGER Embedded Studio,
-* Rowley CrossStudio and GCC
-*/
-#if ((defined(__SES_ARM) || defined(__SES_RISCV) || defined(__CROSSWORKS_ARM) || defined(__GNUC__) || defined(__clang__)) && !defined (__CC_ARM) && !defined(WIN32))
- #if (defined(__ARM_ARCH_6M__) || defined(__ARM_ARCH_8M_BASE__))
- #define SEGGER_RTT_LOCK() { \
- unsigned int LockState; \
- __asm volatile ("mrs %0, primask \n\t" \
- "movs r1, $1 \n\t" \
- "msr primask, r1 \n\t" \
- : "=r" (LockState) \
- : \
- : "r1" \
- );
-
- #define SEGGER_RTT_UNLOCK() __asm volatile ("msr primask, %0 \n\t" \
- : \
- : "r" (LockState) \
- : \
- ); \
- }
- #elif (defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_8M_MAIN__))
- #ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY
- #define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20)
- #endif
- #define SEGGER_RTT_LOCK() { \
- unsigned int LockState; \
- __asm volatile ("mrs %0, basepri \n\t" \
- "mov r1, %1 \n\t" \
- "msr basepri, r1 \n\t" \
- : "=r" (LockState) \
- : "i"(SEGGER_RTT_MAX_INTERRUPT_PRIORITY) \
- : "r1" \
- );
-
- #define SEGGER_RTT_UNLOCK() __asm volatile ("msr basepri, %0 \n\t" \
- : \
- : "r" (LockState) \
- : \
- ); \
- }
-
- #elif defined(__ARM_ARCH_7A__)
- #define SEGGER_RTT_LOCK() { \
- unsigned int LockState; \
- __asm volatile ("mrs r1, CPSR \n\t" \
- "mov %0, r1 \n\t" \
- "orr r1, r1, #0xC0 \n\t" \
- "msr CPSR_c, r1 \n\t" \
- : "=r" (LockState) \
- : \
- : "r1" \
- );
-
- #define SEGGER_RTT_UNLOCK() __asm volatile ("mov r0, %0 \n\t" \
- "mrs r1, CPSR \n\t" \
- "bic r1, r1, #0xC0 \n\t" \
- "and r0, r0, #0xC0 \n\t" \
- "orr r1, r1, r0 \n\t" \
- "msr CPSR_c, r1 \n\t" \
- : \
- : "r" (LockState) \
- : "r0", "r1" \
- ); \
- }
- #elif defined(__riscv) || defined(__riscv_xlen)
- #define SEGGER_RTT_LOCK() { \
- unsigned int LockState; \
- __asm volatile ("csrr %0, mstatus \n\t" \
- "csrci mstatus, 8 \n\t" \
- "andi %0, %0, 8 \n\t" \
- : "=r" (LockState) \
- : \
- : \
- );
-
- #define SEGGER_RTT_UNLOCK() __asm volatile ("csrr a1, mstatus \n\t" \
- "or %0, %0, a1 \n\t" \
- "csrs mstatus, %0 \n\t" \
- : \
- : "r" (LockState) \
- : "a1" \
- ); \
- }
- #else
- #define SEGGER_RTT_LOCK()
- #define SEGGER_RTT_UNLOCK()
- #endif
-#endif
-
-/*********************************************************************
-*
-* RTT lock configuration for IAR EWARM
-*/
-#ifdef __ICCARM__
- #if (defined (__ARM6M__) && (__CORE__ == __ARM6M__)) || \
- (defined (__ARM8M_BASELINE__) && (__CORE__ == __ARM8M_BASELINE__))
- #define SEGGER_RTT_LOCK() { \
- unsigned int LockState; \
- LockState = __get_PRIMASK(); \
- __set_PRIMASK(1);
-
- #define SEGGER_RTT_UNLOCK() __set_PRIMASK(LockState); \
- }
- #elif (defined (__ARM7EM__) && (__CORE__ == __ARM7EM__)) || \
- (defined (__ARM7M__) && (__CORE__ == __ARM7M__)) || \
- (defined (__ARM8M_MAINLINE__) && (__CORE__ == __ARM8M_MAINLINE__)) || \
- (defined (__ARM8M_MAINLINE__) && (__CORE__ == __ARM8M_MAINLINE__))
- #ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY
- #define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20)
- #endif
- #define SEGGER_RTT_LOCK() { \
- unsigned int LockState; \
- LockState = __get_BASEPRI(); \
- __set_BASEPRI(SEGGER_RTT_MAX_INTERRUPT_PRIORITY);
-
- #define SEGGER_RTT_UNLOCK() __set_BASEPRI(LockState); \
- }
- #endif
-#endif
-
-/*********************************************************************
-*
-* RTT lock configuration for IAR RX
-*/
-#ifdef __ICCRX__
- #define SEGGER_RTT_LOCK() { \
- unsigned long LockState; \
- LockState = __get_interrupt_state(); \
- __disable_interrupt();
-
- #define SEGGER_RTT_UNLOCK() __set_interrupt_state(LockState); \
- }
-#endif
-
-/*********************************************************************
-*
-* RTT lock configuration for IAR RL78
-*/
-#ifdef __ICCRL78__
- #define SEGGER_RTT_LOCK() { \
- __istate_t LockState; \
- LockState = __get_interrupt_state(); \
- __disable_interrupt();
-
- #define SEGGER_RTT_UNLOCK() __set_interrupt_state(LockState); \
- }
-#endif
-
-/*********************************************************************
-*
-* RTT lock configuration for KEIL ARM
-*/
-#ifdef __CC_ARM
- #if (defined __TARGET_ARCH_6S_M)
- #define SEGGER_RTT_LOCK() { \
- unsigned int LockState; \
- register unsigned char PRIMASK __asm( "primask"); \
- LockState = PRIMASK; \
- PRIMASK = 1u; \
- __schedule_barrier();
-
- #define SEGGER_RTT_UNLOCK() PRIMASK = LockState; \
- __schedule_barrier(); \
- }
- #elif (defined(__TARGET_ARCH_7_M) || defined(__TARGET_ARCH_7E_M))
- #ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY
- #define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20)
- #endif
- #define SEGGER_RTT_LOCK() { \
- unsigned int LockState; \
- register unsigned char BASEPRI __asm( "basepri"); \
- LockState = BASEPRI; \
- BASEPRI = SEGGER_RTT_MAX_INTERRUPT_PRIORITY; \
- __schedule_barrier();
-
- #define SEGGER_RTT_UNLOCK() BASEPRI = LockState; \
- __schedule_barrier(); \
- }
- #endif
-#endif
-
-/*********************************************************************
-*
-* RTT lock configuration for TI ARM
-*/
-#ifdef __TI_ARM__
- #if defined (__TI_ARM_V6M0__)
- #define SEGGER_RTT_LOCK() { \
- unsigned int LockState; \
- LockState = __get_PRIMASK(); \
- __set_PRIMASK(1);
-
- #define SEGGER_RTT_UNLOCK() __set_PRIMASK(LockState); \
- }
- #elif (defined (__TI_ARM_V7M3__) || defined (__TI_ARM_V7M4__))
- #ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY
- #define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20)
- #endif
- #define SEGGER_RTT_LOCK() { \
- unsigned int LockState; \
- LockState = _set_interrupt_priority(SEGGER_RTT_MAX_INTERRUPT_PRIORITY);
-
- #define SEGGER_RTT_UNLOCK() _set_interrupt_priority(LockState); \
- }
- #endif
-#endif
-
-/*********************************************************************
-*
-* RTT lock configuration for CCRX
-*/
-#ifdef __RX
- #define SEGGER_RTT_LOCK() { \
- unsigned long LockState; \
- LockState = get_psw() & 0x010000; \
- clrpsw_i();
-
- #define SEGGER_RTT_UNLOCK() set_psw(get_psw() | LockState); \
- }
-#endif
-
-/*********************************************************************
-*
-* RTT lock configuration for embOS Simulation on Windows
-* (Can also be used for generic RTT locking with embOS)
-*/
-#if defined(WIN32) || defined(SEGGER_RTT_LOCK_EMBOS)
-
-void OS_SIM_EnterCriticalSection(void);
-void OS_SIM_LeaveCriticalSection(void);
-
-#define SEGGER_RTT_LOCK() { \
- OS_SIM_EnterCriticalSection();
-
-#define SEGGER_RTT_UNLOCK() OS_SIM_LeaveCriticalSection(); \
- }
-#endif
-
-/*********************************************************************
-*
-* RTT lock configuration fallback
-*/
-#ifndef SEGGER_RTT_LOCK
- #define SEGGER_RTT_LOCK() // Lock RTT (nestable) (i.e. disable interrupts)
-#endif
-
-#ifndef SEGGER_RTT_UNLOCK
- #define SEGGER_RTT_UNLOCK() // Unlock RTT (nestable) (i.e. enable previous interrupt lock state)
-#endif
-
-#endif
-/*************************** End of file ****************************/
diff --git a/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_printf.c b/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_printf.c
deleted file mode 100755
index 4c996b40..00000000
--- a/tinyusb/lib/SEGGER_RTT/RTT/SEGGER_RTT_printf.c
+++ /dev/null
@@ -1,500 +0,0 @@
-/*********************************************************************
-* SEGGER Microcontroller GmbH *
-* The Embedded Experts *
-**********************************************************************
-* *
-* (c) 1995 - 2019 SEGGER Microcontroller GmbH *
-* *
-* www.segger.com Support: support@segger.com *
-* *
-**********************************************************************
-* *
-* SEGGER RTT * Real Time Transfer for embedded targets *
-* *
-**********************************************************************
-* *
-* All rights reserved. *
-* *
-* SEGGER strongly recommends to not make any changes *
-* to or modify the source code of this software in order to stay *
-* compatible with the RTT protocol and J-Link. *
-* *
-* Redistribution and use in source and binary forms, with or *
-* without modification, are permitted provided that the following *
-* condition is met: *
-* *
-* o Redistributions of source code must retain the above copyright *
-* notice, this condition and the following disclaimer. *
-* *
-* 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 SEGGER Microcontroller 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. *
-* *
-**********************************************************************
----------------------------END-OF-HEADER------------------------------
-File : SEGGER_RTT_printf.c
-Purpose : Replacement for printf to write formatted data via RTT
-Revision: $Rev: 17697 $
-----------------------------------------------------------------------
-*/
-#include "SEGGER_RTT.h"
-#include "SEGGER_RTT_Conf.h"
-
-/*********************************************************************
-*
-* Defines, configurable
-*
-**********************************************************************
-*/
-
-#ifndef SEGGER_RTT_PRINTF_BUFFER_SIZE
- #define SEGGER_RTT_PRINTF_BUFFER_SIZE (64)
-#endif
-
-#include <stdlib.h>
-#include <stdarg.h>
-
-
-#define FORMAT_FLAG_LEFT_JUSTIFY (1u << 0)
-#define FORMAT_FLAG_PAD_ZERO (1u << 1)
-#define FORMAT_FLAG_PRINT_SIGN (1u << 2)
-#define FORMAT_FLAG_ALTERNATE (1u << 3)
-
-/*********************************************************************
-*
-* Types
-*
-**********************************************************************
-*/
-
-typedef struct {
- char* pBuffer;
- unsigned BufferSize;
- unsigned Cnt;
-
- int ReturnValue;
-
- unsigned RTTBufferIndex;
-} SEGGER_RTT_PRINTF_DESC;
-
-/*********************************************************************
-*
-* Function prototypes
-*
-**********************************************************************
-*/
-
-/*********************************************************************
-*
-* Static code
-*
-**********************************************************************
-*/
-/*********************************************************************
-*
-* _StoreChar
-*/
-static void _StoreChar(SEGGER_RTT_PRINTF_DESC * p, char c) {
- unsigned Cnt;
-
- Cnt = p->Cnt;
- if ((Cnt + 1u) <= p->BufferSize) {
- *(p->pBuffer + Cnt) = c;
- p->Cnt = Cnt + 1u;
- p->ReturnValue++;
- }
- //
- // Write part of string, when the buffer is full
- //
- if (p->Cnt == p->BufferSize) {
- if (SEGGER_RTT_Write(p->RTTBufferIndex, p->pBuffer, p->Cnt) != p->Cnt) {
- p->ReturnValue = -1;
- } else {
- p->Cnt = 0u;
- }
- }
-}
-
-/*********************************************************************
-*
-* _PrintUnsigned
-*/
-static void _PrintUnsigned(SEGGER_RTT_PRINTF_DESC * pBufferDesc, unsigned v, unsigned Base, unsigned NumDigits, unsigned FieldWidth, unsigned FormatFlags) {
- static const char _aV2C[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
- unsigned Div;
- unsigned Digit;
- unsigned Number;
- unsigned Width;
- char c;
-
- Number = v;
- Digit = 1u;
- //
- // Get actual field width
- //
- Width = 1u;
- while (Number >= Base) {
- Number = (Number / Base);
- Width++;
- }
- if (NumDigits > Width) {
- Width = NumDigits;
- }
- //
- // Print leading chars if necessary
- //
- if ((FormatFlags & FORMAT_FLAG_LEFT_JUSTIFY) == 0u) {
- if (FieldWidth != 0u) {
- if (((FormatFlags & FORMAT_FLAG_PAD_ZERO) == FORMAT_FLAG_PAD_ZERO) && (NumDigits == 0u)) {
- c = '0';
- } else {
- c = ' ';
- }
- while ((FieldWidth != 0u) && (Width < FieldWidth)) {
- FieldWidth--;
- _StoreChar(pBufferDesc, c);
- if (pBufferDesc->ReturnValue < 0) {
- break;
- }
- }
- }
- }
- if (pBufferDesc->ReturnValue >= 0) {
- //
- // Compute Digit.
- // Loop until Digit has the value of the highest digit required.
- // Example: If the output is 345 (Base 10), loop 2 times until Digit is 100.
- //
- while (1) {
- if (NumDigits > 1u) { // User specified a min number of digits to print? => Make sure we loop at least that often, before checking anything else (> 1 check avoids problems with NumDigits being signed / unsigned)
- NumDigits--;
- } else {
- Div = v / Digit;
- if (Div < Base) { // Is our divider big enough to extract the highest digit from value? => Done
- break;
- }
- }
- Digit *= Base;
- }
- //
- // Output digits
- //
- do {
- Div = v / Digit;
- v -= Div * Digit;
- _StoreChar(pBufferDesc, _aV2C[Div]);
- if (pBufferDesc->ReturnValue < 0) {
- break;
- }
- Digit /= Base;
- } while (Digit);
- //
- // Print trailing spaces if necessary
- //
- if ((FormatFlags & FORMAT_FLAG_LEFT_JUSTIFY) == FORMAT_FLAG_LEFT_JUSTIFY) {
- if (FieldWidth != 0u) {
- while ((FieldWidth != 0u) && (Width < FieldWidth)) {
- FieldWidth--;
- _StoreChar(pBufferDesc, ' ');
- if (pBufferDesc->ReturnValue < 0) {
- break;
- }
- }
- }
- }
- }
-}
-
-/*********************************************************************
-*
-* _PrintInt
-*/
-static void _PrintInt(SEGGER_RTT_PRINTF_DESC * pBufferDesc, int v, unsigned Base, unsigned NumDigits, unsigned FieldWidth, unsigned FormatFlags) {
- unsigned Width;
- int Number;
-
- Number = (v < 0) ? -v : v;
-
- //
- // Get actual field width
- //
- Width = 1u;
- while (Number >= (int)Base) {
- Number = (Number / (int)Base);
- Width++;
- }
- if (NumDigits > Width) {
- Width = NumDigits;
- }
- if ((FieldWidth > 0u) && ((v < 0) || ((FormatFlags & FORMAT_FLAG_PRINT_SIGN) == FORMAT_FLAG_PRINT_SIGN))) {
- FieldWidth--;
- }
-
- //
- // Print leading spaces if necessary
- //
- if ((((FormatFlags & FORMAT_FLAG_PAD_ZERO) == 0u) || (NumDigits != 0u)) && ((FormatFlags & FORMAT_FLAG_LEFT_JUSTIFY) == 0u)) {
- if (FieldWidth != 0u) {
- while ((FieldWidth != 0u) && (Width < FieldWidth)) {
- FieldWidth--;
- _StoreChar(pBufferDesc, ' ');
- if (pBufferDesc->ReturnValue < 0) {
- break;
- }
- }
- }
- }
- //
- // Print sign if necessary
- //
- if (pBufferDesc->ReturnValue >= 0) {
- if (v < 0) {
- v = -v;
- _StoreChar(pBufferDesc, '-');
- } else if ((FormatFlags & FORMAT_FLAG_PRINT_SIGN) == FORMAT_FLAG_PRINT_SIGN) {
- _StoreChar(pBufferDesc, '+');
- } else {
-
- }
- if (pBufferDesc->ReturnValue >= 0) {
- //
- // Print leading zeros if necessary
- //
- if (((FormatFlags & FORMAT_FLAG_PAD_ZERO) == FORMAT_FLAG_PAD_ZERO) && ((FormatFlags & FORMAT_FLAG_LEFT_JUSTIFY) == 0u) && (NumDigits == 0u)) {
- if (FieldWidth != 0u) {
- while ((FieldWidth != 0u) && (Width < FieldWidth)) {
- FieldWidth--;
- _StoreChar(pBufferDesc, '0');
- if (pBufferDesc->ReturnValue < 0) {
- break;
- }
- }
- }
- }
- if (pBufferDesc->ReturnValue >= 0) {
- //
- // Print number without sign
- //
- _PrintUnsigned(pBufferDesc, (unsigned)v, Base, NumDigits, FieldWidth, FormatFlags);
- }
- }
- }
-}
-
-/*********************************************************************
-*
-* Public code
-*
-**********************************************************************
-*/
-/*********************************************************************
-*
-* SEGGER_RTT_vprintf
-*
-* Function description
-* Stores a formatted string in SEGGER RTT control block.
-* This data is read by the host.
-*
-* Parameters
-* BufferIndex Index of "Up"-buffer to be used. (e.g. 0 for "Terminal")
-* sFormat Pointer to format string
-* pParamList Pointer to the list of arguments for the format string
-*
-* Return values
-* >= 0: Number of bytes which have been stored in the "Up"-buffer.
-* < 0: Error
-*/
-int SEGGER_RTT_vprintf(unsigned BufferIndex, const char * sFormat, va_list * pParamList) {
- char c;
- SEGGER_RTT_PRINTF_DESC BufferDesc;
- int v;
- unsigned NumDigits;
- unsigned FormatFlags;
- unsigned FieldWidth;
- char acBuffer[SEGGER_RTT_PRINTF_BUFFER_SIZE];
-
- BufferDesc.pBuffer = acBuffer;
- BufferDesc.BufferSize = SEGGER_RTT_PRINTF_BUFFER_SIZE;
- BufferDesc.Cnt = 0u;
- BufferDesc.RTTBufferIndex = BufferIndex;
- BufferDesc.ReturnValue = 0;
-
- do {
- c = *sFormat;
- sFormat++;
- if (c == 0u) {
- break;
- }
- if (c == '%') {
- //
- // Filter out flags
- //
- FormatFlags = 0u;
- v = 1;
- do {
- c = *sFormat;
- switch (c) {
- case '-': FormatFlags |= FORMAT_FLAG_LEFT_JUSTIFY; sFormat++; break;
- case '0': FormatFlags |= FORMAT_FLAG_PAD_ZERO; sFormat++; break;
- case '+': FormatFlags |= FORMAT_FLAG_PRINT_SIGN; sFormat++; break;
- case '#': FormatFlags |= FORMAT_FLAG_ALTERNATE; sFormat++; break;
- default: v = 0; break;
- }
- } while (v);
- //
- // filter out field with
- //
- FieldWidth = 0u;
- do {
- c = *sFormat;
- if ((c < '0') || (c > '9')) {
- break;
- }
- sFormat++;
- FieldWidth = (FieldWidth * 10u) + ((unsigned)c - '0');
- } while (1);
-
- //
- // Filter out precision (number of digits to display)
- //
- NumDigits = 0u;
- c = *sFormat;
- if (c == '.') {
- sFormat++;
- do {
- c = *sFormat;
- if ((c < '0') || (c > '9')) {
- break;
- }
- sFormat++;
- NumDigits = NumDigits * 10u + ((unsigned)c - '0');
- } while (1);
- }
- //
- // Filter out length modifier
- //
- c = *sFormat;
- do {
- if ((c == 'l') || (c == 'h')) {
- sFormat++;
- c = *sFormat;
- } else {
- break;
- }
- } while (1);
- //
- // Handle specifiers
- //
- switch (c) {
- case 'c': {
- char c0;
- v = va_arg(*pParamList, int);
- c0 = (char)v;
- _StoreChar(&BufferDesc, c0);
- break;
- }
- case 'd':
- v = va_arg(*pParamList, int);
- _PrintInt(&BufferDesc, v, 10u, NumDigits, FieldWidth, FormatFlags);
- break;
- case 'u':
- v = va_arg(*pParamList, int);
- _PrintUnsigned(&BufferDesc, (unsigned)v, 10u, NumDigits, FieldWidth, FormatFlags);
- break;
- case 'x':
- case 'X':
- v = va_arg(*pParamList, int);
- _PrintUnsigned(&BufferDesc, (unsigned)v, 16u, NumDigits, FieldWidth, FormatFlags);
- break;
- case 's':
- {
- const char * s = va_arg(*pParamList, const char *);
- do {
- c = *s;
- s++;
- if (c == '\0') {
- break;
- }
- _StoreChar(&BufferDesc, c);
- } while (BufferDesc.ReturnValue >= 0);
- }
- break;
- case 'p':
- v = va_arg(*pParamList, int);
- _PrintUnsigned(&BufferDesc, (unsigned)v, 16u, 8u, 8u, 0u);
- break;
- case '%':
- _StoreChar(&BufferDesc, '%');
- break;
- default:
- break;
- }
- sFormat++;
- } else {
- _StoreChar(&BufferDesc, c);
- }
- } while (BufferDesc.ReturnValue >= 0);
-
- if (BufferDesc.ReturnValue > 0) {
- //
- // Write remaining data, if any
- //
- if (BufferDesc.Cnt != 0u) {
- SEGGER_RTT_Write(BufferIndex, acBuffer, BufferDesc.Cnt);
- }
- BufferDesc.ReturnValue += (int)BufferDesc.Cnt;
- }
- return BufferDesc.ReturnValue;
-}
-
-/*********************************************************************
-*
-* SEGGER_RTT_printf
-*
-* Function description
-* Stores a formatted string in SEGGER RTT control block.
-* This data is read by the host.
-*
-* Parameters
-* BufferIndex Index of "Up"-buffer to be used. (e.g. 0 for "Terminal")
-* sFormat Pointer to format string, followed by the arguments for conversion
-*
-* Return values
-* >= 0: Number of bytes which have been stored in the "Up"-buffer.
-* < 0: Error
-*
-* Notes
-* (1) Conversion specifications have following syntax:
-* %[flags][FieldWidth][.Precision]ConversionSpecifier
-* (2) Supported flags:
-* -: Left justify within the field width
-* +: Always print sign extension for signed conversions
-* 0: Pad with 0 instead of spaces. Ignored when using '-'-flag or precision
-* Supported conversion specifiers:
-* c: Print the argument as one char
-* d: Print the argument as a signed integer
-* u: Print the argument as an unsigned integer
-* x: Print the argument as an hexadecimal integer
-* s: Print the string pointed to by the argument
-* p: Print the argument as an 8-digit hexadecimal integer. (Argument shall be a pointer to void.)
-*/
-int SEGGER_RTT_printf(unsigned BufferIndex, const char * sFormat, ...) {
- int r;
- va_list ParamList;
-
- va_start(ParamList, sFormat);
- r = SEGGER_RTT_vprintf(BufferIndex, sFormat, &ParamList);
- va_end(ParamList);
- return r;
-}
-/*************************** End of file ****************************/
diff --git a/tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_GCC.c b/tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_GCC.c
deleted file mode 100755
index da4a4b5f..00000000
--- a/tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_GCC.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*********************************************************************
-* SEGGER Microcontroller GmbH *
-* The Embedded Experts *
-**********************************************************************
-* *
-* (c) 1995 - 2019 SEGGER Microcontroller GmbH *
-* *
-* www.segger.com Support: support@segger.com *
-* *
-**********************************************************************
-* *
-* SEGGER RTT * Real Time Transfer for embedded targets *
-* *
-**********************************************************************
-* *
-* All rights reserved. *
-* *
-* SEGGER strongly recommends to not make any changes *
-* to or modify the source code of this software in order to stay *
-* compatible with the RTT protocol and J-Link. *
-* *
-* Redistribution and use in source and binary forms, with or *
-* without modification, are permitted provided that the following *
-* condition is met: *
-* *
-* o Redistributions of source code must retain the above copyright *
-* notice, this condition and the following disclaimer. *
-* *
-* 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 SEGGER Microcontroller 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. *
-* *
-**********************************************************************
----------------------------END-OF-HEADER------------------------------
-File : SEGGER_RTT_Syscalls_GCC.c
-Purpose : Low-level functions for using printf() via RTT in GCC.
- To use RTT for printf output, include this file in your
- application.
-Revision: $Rev: 17697 $
-----------------------------------------------------------------------
-*/
-#if (defined __GNUC__) && !(defined __SES_ARM) && !(defined __CROSSWORKS_ARM)
-
-#include <reent.h> // required for _write_r
-#include "SEGGER_RTT.h"
-
-
-/*********************************************************************
-*
-* Types
-*
-**********************************************************************
-*/
-//
-// If necessary define the _reent struct
-// to match the one passed by the used standard library.
-//
-struct _reent;
-
-/*********************************************************************
-*
-* Function prototypes
-*
-**********************************************************************
-*/
-int _write(int file, char *ptr, int len);
-int _write_r(struct _reent *r, int file, const void *ptr, int len);
-
-/*********************************************************************
-*
-* Global functions
-*
-**********************************************************************
-*/
-
-/*********************************************************************
-*
-* _write()
-*
-* Function description
-* Low-level write function.
-* libc subroutines will use this system routine for output to all files,
-* including stdout.
-* Write data via RTT.
-*/
-int _write(int file, char *ptr, int len) {
- (void) file; /* Not used, avoid warning */
- SEGGER_RTT_Write(0, ptr, len);
- return len;
-}
-
-/*********************************************************************
-*
-* _write_r()
-*
-* Function description
-* Low-level reentrant write function.
-* libc subroutines will use this system routine for output to all files,
-* including stdout.
-* Write data via RTT.
-*/
-int _write_r(struct _reent *r, int file, const void *ptr, int len) {
- (void) file; /* Not used, avoid warning */
- (void) r; /* Not used, avoid warning */
- SEGGER_RTT_Write(0, ptr, len);
- return len;
-}
-
-#endif
-/****** End Of File *************************************************/
diff --git a/tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_IAR.c b/tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_IAR.c
deleted file mode 100755
index 4c76752b..00000000
--- a/tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_IAR.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*********************************************************************
-* SEGGER Microcontroller GmbH *
-* The Embedded Experts *
-**********************************************************************
-* *
-* (c) 1995 - 2019 SEGGER Microcontroller GmbH *
-* *
-* www.segger.com Support: support@segger.com *
-* *
-**********************************************************************
-* *
-* SEGGER RTT * Real Time Transfer for embedded targets *
-* *
-**********************************************************************
-* *
-* All rights reserved. *
-* *
-* SEGGER strongly recommends to not make any changes *
-* to or modify the source code of this software in order to stay *
-* compatible with the RTT protocol and J-Link. *
-* *
-* Redistribution and use in source and binary forms, with or *
-* without modification, are permitted provided that the following *
-* condition is met: *
-* *
-* o Redistributions of source code must retain the above copyright *
-* notice, this condition and the following disclaimer. *
-* *
-* 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 SEGGER Microcontroller 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. *
-* *
-**********************************************************************
----------------------------END-OF-HEADER------------------------------
-File : SEGGER_RTT_Syscalls_IAR.c
-Purpose : Low-level functions for using printf() via RTT in IAR.
- To use RTT for printf output, include this file in your
- application and set the Library Configuration to Normal.
-Revision: $Rev: 17697 $
-----------------------------------------------------------------------
-*/
-#ifdef __IAR_SYSTEMS_ICC__
-
-//
-// Since IAR EWARM V8 and EWRX V4, yfuns.h is considered as deprecated and LowLevelIOInterface.h
-// shall be used instead. To not break any compatibility with older compiler versions, we have a
-// version check in here.
-//
-#if ((defined __ICCARM__) && (__VER__ >= 8000000)) || ((defined __ICCRX__) && (__VER__ >= 400))
- #include <LowLevelIOInterface.h>
-#else
- #include <yfuns.h>
-#endif
-
-#include "SEGGER_RTT.h"
-#pragma module_name = "?__write"
-
-/*********************************************************************
-*
-* Function prototypes
-*
-**********************************************************************
-*/
-size_t __write(int handle, const unsigned char * buffer, size_t size);
-
-/*********************************************************************
-*
-* Global functions
-*
-**********************************************************************
-*/
-/*********************************************************************
-*
-* __write()
-*
-* Function description
-* Low-level write function.
-* Standard library subroutines will use this system routine
-* for output to all files, including stdout.
-* Write data via RTT.
-*/
-size_t __write(int handle, const unsigned char * buffer, size_t size) {
- (void) handle; /* Not used, avoid warning */
- SEGGER_RTT_Write(0, (const char*)buffer, size);
- return size;
-}
-
-/*********************************************************************
-*
-* __write_buffered()
-*
-* Function description
-* Low-level write function.
-* Standard library subroutines will use this system routine
-* for output to all files, including stdout.
-* Write data via RTT.
-*/
-size_t __write_buffered(int handle, const unsigned char * buffer, size_t size) {
- (void) handle; /* Not used, avoid warning */
- SEGGER_RTT_Write(0, (const char*)buffer, size);
- return size;
-}
-
-#endif
-/****** End Of File *************************************************/
diff --git a/tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_KEIL.c b/tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_KEIL.c
deleted file mode 100755
index f7f5aed4..00000000
--- a/tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_KEIL.c
+++ /dev/null
@@ -1,386 +0,0 @@
-/*********************************************************************
-* SEGGER Microcontroller GmbH *
-* The Embedded Experts *
-**********************************************************************
-* *
-* (c) 1995 - 2019 SEGGER Microcontroller GmbH *
-* *
-* www.segger.com Support: support@segger.com *
-* *
-**********************************************************************
-* *
-* SEGGER RTT * Real Time Transfer for embedded targets *
-* *
-**********************************************************************
-* *
-* All rights reserved. *
-* *
-* SEGGER strongly recommends to not make any changes *
-* to or modify the source code of this software in order to stay *
-* compatible with the RTT protocol and J-Link. *
-* *
-* Redistribution and use in source and binary forms, with or *
-* without modification, are permitted provided that the following *
-* condition is met: *
-* *
-* o Redistributions of source code must retain the above copyright *
-* notice, this condition and the following disclaimer. *
-* *
-* 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 SEGGER Microcontroller 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. *
-* *
-**********************************************************************
----------------------------END-OF-HEADER------------------------------
-File : RTT_Syscalls_KEIL.c
-Purpose : Retargeting module for KEIL MDK-CM3.
- Low-level functions for using printf() via RTT
-Revision: $Rev: 17697 $
-----------------------------------------------------------------------
-*/
-#ifdef __CC_ARM
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <rt_sys.h>
-#include <rt_misc.h>
-
-#include "SEGGER_RTT.h"
-/*********************************************************************
-*
-* #pragmas
-*
-**********************************************************************
-*/
-#pragma import(__use_no_semihosting)
-
-#ifdef _MICROLIB
- #pragma import(__use_full_stdio)
-#endif
-
-/*********************************************************************
-*
-* Defines non-configurable
-*
-**********************************************************************
-*/
-
-/* Standard IO device handles - arbitrary, but any real file system handles must be
- less than 0x8000. */
-#define STDIN 0x8001 // Standard Input Stream
-#define STDOUT 0x8002 // Standard Output Stream
-#define STDERR 0x8003 // Standard Error Stream
-
-/*********************************************************************
-*
-* Public const
-*
-**********************************************************************
-*/
-#if __ARMCC_VERSION < 5000000
-//const char __stdin_name[] = "STDIN";
-const char __stdout_name[] = "STDOUT";
-const char __stderr_name[] = "STDERR";
-#endif
-
-/*********************************************************************
-*
-* Public code
-*
-**********************************************************************
-*/
-
-/*********************************************************************
-*
-* _ttywrch
-*
-* Function description:
-* Outputs a character to the console
-*
-* Parameters:
-* c - character to output
-*
-*/
-void _ttywrch(int c) {
- fputc(c, stdout); // stdout
- fflush(stdout);
-}
-
-/*********************************************************************
-*
-* _sys_open
-*
-* Function description:
-* Opens the device/file in order to do read/write operations
-*
-* Parameters:
-* sName - sName of the device/file to open
-* OpenMode - This parameter is currently ignored
-*
-* Return value:
-* != 0 - Handle to the object to open, otherwise
-* == 0 -"device" is not handled by this module
-*
-*/
-FILEHANDLE _sys_open(const char * sName, int OpenMode) {
- (void)OpenMode;
- // Register standard Input Output devices.
- if (strcmp(sName, __stdout_name) == 0) {
- return (STDOUT);
- } else if (strcmp(sName, __stderr_name) == 0) {
- return (STDERR);
- } else
- return (0); // Not implemented
-}
-
-/*********************************************************************
-*
-* _sys_close
-*
-* Function description:
-* Closes the handle to the open device/file
-*
-* Parameters:
-* hFile - Handle to a file opened via _sys_open
-*
-* Return value:
-* 0 - device/file closed
-*
-*/
-int _sys_close(FILEHANDLE hFile) {
- (void)hFile;
- return 0; // Not implemented
-}
-
-/*********************************************************************
-*
-* _sys_write
-*
-* Function description:
-* Writes the data to an open handle.
-* Currently this function only outputs data to the console
-*
-* Parameters:
-* hFile - Handle to a file opened via _sys_open
-* pBuffer - Pointer to the data that shall be written
-* NumBytes - Number of bytes to write
-* Mode - The Mode that shall be used
-*
-* Return value:
-* Number of bytes *not* written to the file/device
-*
-*/
-int _sys_write(FILEHANDLE hFile, const unsigned char * pBuffer, unsigned NumBytes, int Mode) {
- int r = 0;
-
- (void)Mode;
- if (hFile == STDOUT) {
- SEGGER_RTT_Write(0, (const char*)pBuffer, NumBytes);
- return 0;
- }
- return r;
-}
-
-/*********************************************************************
-*
-* _sys_read
-*
-* Function description:
-* Reads data from an open handle.
-* Currently this modules does nothing.
-*
-* Parameters:
-* hFile - Handle to a file opened via _sys_open
-* pBuffer - Pointer to buffer to store the read data
-* NumBytes - Number of bytes to read
-* Mode - The Mode that shall be used
-*
-* Return value:
-* Number of bytes read from the file/device
-*
-*/
-int _sys_read(FILEHANDLE hFile, unsigned char * pBuffer, unsigned NumBytes, int Mode) {
- (void)hFile;
- (void)pBuffer;
- (void)NumBytes;
- (void)Mode;
- return (0); // Not implemented
-}
-
-/*********************************************************************
-*
-* _sys_istty
-*
-* Function description:
-* This function shall return whether the opened file
-* is a console device or not.
-*
-* Parameters:
-* hFile - Handle to a file opened via _sys_open
-*
-* Return value:
-* 1 - Device is a console
-* 0 - Device is not a console
-*
-*/
-int _sys_istty(FILEHANDLE hFile) {
- if (hFile > 0x8000) {
- return (1);
- }
- return (0); // Not implemented
-}
-
-/*********************************************************************
-*
-* _sys_seek
-*
-* Function description:
-* Seeks via the file to a specific position
-*
-* Parameters:
-* hFile - Handle to a file opened via _sys_open
-* Pos -
-*
-* Return value:
-* int -
-*
-*/
-int _sys_seek(FILEHANDLE hFile, long Pos) {
- (void)hFile;
- (void)Pos;
- return (0); // Not implemented
-}
-
-/*********************************************************************
-*
-* _sys_ensure
-*
-* Function description:
-*
-*
-* Parameters:
-* hFile - Handle to a file opened via _sys_open
-*
-* Return value:
-* int -
-*
-*/
-int _sys_ensure(FILEHANDLE hFile) {
- (void)hFile;
- return (-1); // Not implemented
-}
-
-/*********************************************************************
-*
-* _sys_flen
-*
-* Function description:
-* Returns the length of the opened file handle
-*
-* Parameters:
-* hFile - Handle to a file opened via _sys_open
-*
-* Return value:
-* Length of the file
-*
-*/
-long _sys_flen(FILEHANDLE hFile) {
- (void)hFile;
- return (0); // Not implemented
-}
-
-/*********************************************************************
-*
-* _sys_tmpnam
-*
-* Function description:
-* This function converts the file number fileno for a temporary
-* file to a unique filename, for example, tmp0001.
-*
-* Parameters:
-* pBuffer - Pointer to a buffer to store the name
-* FileNum - file number to convert
-* MaxLen - Size of the buffer
-*
-* Return value:
-* 1 - Error
-* 0 - Success
-*
-*/
-int _sys_tmpnam(char * pBuffer, int FileNum, unsigned MaxLen) {
- (void)pBuffer;
- (void)FileNum;
- (void)MaxLen;
- return (1); // Not implemented
-}
-
-/*********************************************************************
-*
-* _sys_command_string
-*
-* Function description:
-* This function shall execute a system command.
-*
-* Parameters:
-* cmd - Pointer to the command string
-* len - Length of the string
-*
-* Return value:
-* == NULL - Command was not successfully executed
-* == sCmd - Command was passed successfully
-*
-*/
-char * _sys_command_string(char * cmd, int len) {
- (void)len;
- return cmd; // Not implemented
-}
-
-/*********************************************************************
-*
-* _sys_exit
-*
-* Function description:
-* This function is called when the application returns from main
-*
-* Parameters:
-* ReturnCode - Return code from the main function
-*
-*
-*/
-void _sys_exit(int ReturnCode) {
- (void)ReturnCode;
- while (1); // Not implemented
-}
-
-#if __ARMCC_VERSION >= 5000000
-/*********************************************************************
-*
-* stdout_putchar
-*
-* Function description:
-* Put a character to the stdout
-*
-* Parameters:
-* ch - Character to output
-*
-*
-*/
-int stdout_putchar(int ch) {
- (void)ch;
- return ch; // Not implemented
-}
-#endif
-
-#endif
-/*************************** End of file ****************************/
diff --git a/tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_SES.c b/tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_SES.c
deleted file mode 100755
index 5ce8457e..00000000
--- a/tinyusb/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_SES.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/*********************************************************************
-* SEGGER Microcontroller GmbH *
-* The Embedded Experts *
-**********************************************************************
-* *
-* (c) 1995 - 2019 SEGGER Microcontroller GmbH *
-* *
-* www.segger.com Support: support@segger.com *
-* *
-**********************************************************************
-* *
-* SEGGER RTT * Real Time Transfer for embedded targets *
-* *
-**********************************************************************
-* *
-* All rights reserved. *
-* *
-* SEGGER strongly recommends to not make any changes *
-* to or modify the source code of this software in order to stay *
-* compatible with the RTT protocol and J-Link. *
-* *
-* Redistribution and use in source and binary forms, with or *
-* without modification, are permitted provided that the following *
-* condition is met: *
-* *
-* o Redistributions of source code must retain the above copyright *
-* notice, this condition and the following disclaimer. *
-* *
-* 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 SEGGER Microcontroller 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. *
-* *
-**********************************************************************
----------------------------END-OF-HEADER------------------------------
-File : SEGGER_RTT_Syscalls_SES.c
-Purpose : Reimplementation of printf, puts and __getchar using RTT
- in SEGGER Embedded Studio.
- To use RTT for printf output, include this file in your
- application.
-Revision: $Rev: 18539 $
-----------------------------------------------------------------------
-*/
-#if (defined __SES_ARM) || (defined __SES_RISCV) || (defined __CROSSWORKS_ARM)
-
-#include "SEGGER_RTT.h"
-#include <stdarg.h>
-#include <stdio.h>
-#include "limits.h"
-#include "__libc.h"
-#include "__vfprintf.h"
-
-/*********************************************************************
-*
-* Defines, configurable
-*
-**********************************************************************
-*/
-//
-// Select string formatting implementation.
-//
-// RTT printf formatting
-// - Configurable stack usage. (SEGGER_RTT_PRINTF_BUFFER_SIZE in SEGGER_RTT_Conf.h)
-// - No maximum string length.
-// - Limited conversion specifiers and flags. (See SEGGER_RTT_printf.c)
-// Standard library printf formatting
-// - Configurable formatting capabilities.
-// - Full conversion specifier and flag support.
-// - Maximum string length has to be known or (slightly) slower character-wise output.
-//
-// #define PRINTF_USE_SEGGER_RTT_FORMATTING 0 // Use standard library formatting
-// #define PRINTF_USE_SEGGER_RTT_FORMATTING 1 // Use RTT formatting
-//
-#ifndef PRINTF_USE_SEGGER_RTT_FORMATTING
- #define PRINTF_USE_SEGGER_RTT_FORMATTING 0
-#endif
-//
-// If using standard library formatting,
-// select maximum output string buffer size or character-wise output.
-//
-// #define PRINTF_BUFFER_SIZE 0 // Use character-wise output
-// #define PRINTF_BUFFER_SIZE 128 // Default maximum string length
-//
-#ifndef PRINTF_BUFFER_SIZE
- #define PRINTF_BUFFER_SIZE 128
-#endif
-
-#if PRINTF_USE_SEGGER_RTT_FORMATTING // Use SEGGER RTT formatting implementation
-/*********************************************************************
-*
-* Function prototypes
-*
-**********************************************************************
-*/
-int SEGGER_RTT_vprintf(unsigned BufferIndex, const char * sFormat, va_list * pParamList);
-
-/*********************************************************************
-*
-* Global functions, printf
-*
-**********************************************************************
-*/
-/*********************************************************************
-*
-* printf()
-*
-* Function description
-* print a formatted string using RTT and SEGGER RTT formatting.
-*/
-int printf(const char *fmt,...) {
- int n;
- va_list args;
-
- va_start (args, fmt);
- n = SEGGER_RTT_vprintf(0, fmt, &args);
- va_end(args);
- return n;
-}
-
-#elif PRINTF_BUFFER_SIZE == 0 // Use standard library formatting with character-wise output
-
-/*********************************************************************
-*
-* Static functions
-*
-**********************************************************************
-*/
-static int _putchar(int x, __printf_tag_ptr ctx) {
- (void)ctx;
- SEGGER_RTT_Write(0, (char *)&x, 1);
- return x;
-}
-
-/*********************************************************************
-*
-* Global functions, printf
-*
-**********************************************************************
-*/
-/*********************************************************************
-*
-* printf()
-*
-* Function description
-* print a formatted string character-wise, using RTT and standard
-* library formatting.
-*/
-int printf(const char *fmt, ...) {
- int n;
- va_list args;
- __printf_t iod;
-
- va_start(args, fmt);
- iod.string = 0;
- iod.maxchars = INT_MAX;
- iod.output_fn = _putchar;
- SEGGER_RTT_LOCK();
- n = __vfprintf(&iod, fmt, args);
- SEGGER_RTT_UNLOCK();
- va_end(args);
- return n;
-}
-
-#else // Use standard library formatting with static buffer
-
-/*********************************************************************
-*
-* Global functions, printf
-*
-**********************************************************************
-*/
-/*********************************************************************
-*
-* printf()
-*
-* Function description
-* print a formatted string using RTT and standard library formatting.
-*/
-int printf(const char *fmt,...) {
- int n;
- char aBuffer[PRINTF_BUFFER_SIZE];
- va_list args;
-
- va_start (args, fmt);
- n = vsnprintf(aBuffer, sizeof(aBuffer), fmt, args);
- if (n > (int)sizeof(aBuffer)) {
- SEGGER_RTT_Write(0, aBuffer, sizeof(aBuffer));
- } else if (n > 0) {
- SEGGER_RTT_Write(0, aBuffer, n);
- }
- va_end(args);
- return n;
-}
-#endif
-
-/*********************************************************************
-*
-* Global functions
-*
-**********************************************************************
-*/
-/*********************************************************************
-*
-* puts()
-*
-* Function description
-* print a string using RTT.
-*/
-int puts(const char *s) {
- return SEGGER_RTT_WriteString(0, s);
-}
-
-/*********************************************************************
-*
-* __putchar()
-*
-* Function description
-* Write one character via RTT.
-*/
-int __putchar(int x, __printf_tag_ptr ctx) {
- (void)ctx;
- SEGGER_RTT_Write(0, (char *)&x, 1);
- return x;
-}
-
-/*********************************************************************
-*
-* __getchar()
-*
-* Function description
-* Wait for and get a character via RTT.
-*/
-int __getchar() {
- return SEGGER_RTT_WaitKey();
-}
-
-#endif
-/****** End Of File *************************************************/
diff --git a/tinyusb/lib/fatfs/00readme.txt b/tinyusb/lib/fatfs/00readme.txt
deleted file mode 100755
index f7330e92..00000000
--- a/tinyusb/lib/fatfs/00readme.txt
+++ /dev/null
@@ -1,138 +0,0 @@
-FatFs Module Source Files R0.09b (C)ChaN, 2013
-
-
-FILES
-
- ffconf.h Configuration file for FatFs module.
- ff.h Common include file for FatFs and application module.
- ff.c FatFs module.
- diskio.h Common include file for FatFs and disk I/O module.
- diskio.c An example of glue function to attach existing disk I/O module to FatFs.
- integer.h Integer type definitions for FatFs.
- option Optional external functions.
-
- Low level disk I/O module is not included in this archive because the FatFs
- module is only a generic file system layer and not depend on any specific
- storage device. You have to provide a low level disk I/O module that written
- to control your storage device.
-
-
-
-AGREEMENTS
-
- FatFs module is an open source software to implement FAT file system to
- small embedded systems. This is a free software and is opened for education,
- research and commercial developments under license policy of following trems.
-
- Copyright (C) 2012, ChaN, all right reserved.
-
- * The FatFs module is a free software and there is NO WARRANTY.
- * No restriction on use. You can use, modify and redistribute it for
- personal, non-profit or commercial product UNDER YOUR RESPONSIBILITY.
- * Redistributions of source code must retain the above copyright notice.
-
-
-
-REVISION HISTORY
-
- Feb 26, 2006 R0.00 Prototype
-
- Apr 29, 2006 R0.01 First release.
-
- Jun 01, 2006 R0.02 Added FAT12.
- Removed unbuffered mode.
- Fixed a problem on small (<32M) patition.
-
- Jun 10, 2006 R0.02a Added a configuration option _FS_MINIMUM.
-
- Sep 22, 2006 R0.03 Added f_rename.
- Changed option _FS_MINIMUM to _FS_MINIMIZE.
-
- Dec 11, 2006 R0.03a Improved cluster scan algolithm to write files fast.
- Fixed f_mkdir creates incorrect directory on FAT32.
-
- Feb 04, 2007 R0.04 Supported multiple drive system. (FatFs)
- Changed some APIs for multiple drive system.
- Added f_mkfs. (FatFs)
- Added _USE_FAT32 option. (Tiny-FatFs)
-
- Apr 01, 2007 R0.04a Supported multiple partitions on a plysical drive. (FatFs)
- Fixed an endian sensitive code in f_mkfs. (FatFs)
- Added a capability of extending the file size to f_lseek.
- Added minimization level 3.
- Fixed a problem that can collapse a sector when recreate an
- existing file in any sub-directory at non FAT32 cfg. (Tiny-FatFs)
-
- May 05, 2007 R0.04b Added _USE_NTFLAG option.
- Added FSInfo support.
- Fixed some problems corresponds to FAT32. (Tiny-FatFs)
- Fixed DBCS name can result FR_INVALID_NAME.
- Fixed short seek (0 < ofs <= csize) collapses the file object.
-
- Aug 25, 2007 R0.05 Changed arguments of f_read, f_write.
- Changed arguments of f_mkfs. (FatFs)
- Fixed f_mkfs on FAT32 creates incorrect FSInfo. (FatFs)
- Fixed f_mkdir on FAT32 creates incorrect directory. (FatFs)
-
- Feb 03, 2008 R0.05a Added f_truncate().
- Added f_utime().
- Fixed off by one error at FAT sub-type determination.
- Fixed btr in f_read() can be mistruncated.
- Fixed cached sector is not flushed when create and close without write.
-
- Apr 01, 2008 R0.06 Added f_forward(). (Tiny-FatFs)
- Added string functions: fputc(), fputs(), fprintf() and fgets().
- Improved performance of f_lseek() on move to the same or following cluster.
-
- Apr 01, 2009, R0.07 Merged Tiny-FatFs as a buffer configuration option.
- Added long file name support.
- Added multiple code page support.
- Added re-entrancy for multitask operation.
- Added auto cluster size selection to f_mkfs().
- Added rewind option to f_readdir().
- Changed result code of critical errors.
- Renamed string functions to avoid name collision.
-
- Apr 14, 2009, R0.07a Separated out OS dependent code on reentrant cfg.
- Added multiple sector size support.
-
- Jun 21, 2009, R0.07c Fixed f_unlink() may return FR_OK on error.
- Fixed wrong cache control in f_lseek().
- Added relative path feature.
- Added f_chdir().
- Added f_chdrive().
- Added proper case conversion for extended characters.
-
- Nov 03, 2009 R0.07e Separated out configuration options from ff.h to ffconf.h.
- Added a configuration option, _LFN_UNICODE.
- Fixed f_unlink() fails to remove a sub-dir on _FS_RPATH.
- Fixed name matching error on the 13 char boundary.
- Changed f_readdir() to return the SFN with always upper case on non-LFN cfg.
-
- May 15, 2010, R0.08 Added a memory configuration option. (_USE_LFN)
- Added file lock feature. (_FS_SHARE)
- Added fast seek feature. (_USE_FASTSEEK)
- Changed some types on the API, XCHAR->TCHAR.
- Changed fname member in the FILINFO structure on Unicode cfg.
- String functions support UTF-8 encoding files on Unicode cfg.
-
- Aug 16,'10 R0.08a Added f_getcwd(). (_FS_RPATH = 2)
- Added sector erase feature. (_USE_ERASE)
- Moved file lock semaphore table from fs object to the bss.
- Fixed a wrong directory entry is created on non-LFN cfg when the given name contains ';'.
- Fixed f_mkfs() creates wrong FAT32 volume.
-
- Jan 15,'11 R0.08b Fast seek feature is also applied to f_read() and f_write().
- f_lseek() reports required table size on creating CLMP.
- Extended format syntax of f_printf function.
- Ignores duplicated directory separators in given path names.
-
- Sep 06,'11 R0.09 f_mkfs() supports multiple partition to finish the multiple partition feature.
- Added f_fdisk(). (_MULTI_PARTITION = 2)
-
- Aug 27,'12 R0.09a Fixed assertion failure due to OS/2 EA on FAT12/16.
- Changed f_open() and f_opendir() reject null object pointer to avoid crash.
- Changed option name _FS_SHARE to _FS_LOCK.
-
- Jan 23,'13 R0.09b Added f_getlabel() and f_setlabel(). (_USE_LABEL == 1)
-
diff --git a/tinyusb/lib/fatfs/ccsbcs.c b/tinyusb/lib/fatfs/ccsbcs.c
deleted file mode 100755
index 07d6f098..00000000
--- a/tinyusb/lib/fatfs/ccsbcs.c
+++ /dev/null
@@ -1,543 +0,0 @@
-/*------------------------------------------------------------------------*/
-/* Unicode - Local code bidirectional converter (C)ChaN, 2012 */
-/* (SBCS code pages) */
-/*------------------------------------------------------------------------*/
-/* 437 U.S. (OEM)
-/ 720 Arabic (OEM)
-/ 1256 Arabic (Windows)
-/ 737 Greek (OEM)
-/ 1253 Greek (Windows)
-/ 1250 Central Europe (Windows)
-/ 775 Baltic (OEM)
-/ 1257 Baltic (Windows)
-/ 850 Multilingual Latin 1 (OEM)
-/ 852 Latin 2 (OEM)
-/ 1252 Latin 1 (Windows)
-/ 855 Cyrillic (OEM)
-/ 1251 Cyrillic (Windows)
-/ 866 Russian (OEM)
-/ 857 Turkish (OEM)
-/ 1254 Turkish (Windows)
-/ 858 Multilingual Latin 1 + Euro (OEM)
-/ 862 Hebrew (OEM)
-/ 1255 Hebrew (Windows)
-/ 874 Thai (OEM, Windows)
-/ 1258 Vietnam (OEM, Windows)
-*/
-
-#include "ff.h"
-
-#if CFG_TUH_MSC
-
-#if _CODE_PAGE == 437
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP437(0x80-0xFF) to Unicode conversion table */
- 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7,
- 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
- 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9,
- 0x00FF, 0x00D6, 0x00DC, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192,
- 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA,
- 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
- 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
- 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B,
- 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
- 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4,
- 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229,
- 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248,
- 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 720
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP720(0x80-0xFF) to Unicode conversion table */
- 0x0000, 0x0000, 0x00E9, 0x00E2, 0x0000, 0x00E0, 0x0000, 0x00E7,
- 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0651, 0x0652, 0x00F4, 0x00A4, 0x0640, 0x00FB, 0x00F9,
- 0x0621, 0x0622, 0x0623, 0x0624, 0x00A3, 0x0625, 0x0626, 0x0627,
- 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
- 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
- 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
- 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B,
- 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
- 0x0636, 0x0637, 0x0638, 0x0639, 0x063A, 0x0641, 0x00B5, 0x0642,
- 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064A,
- 0x2261, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F, 0x0650, 0x2248,
- 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 737
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP737(0x80-0xFF) to Unicode conversion table */
- 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398,
- 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0,
- 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9,
- 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8,
- 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0,
- 0x03C1, 0x03C3, 0x03C2, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
- 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
- 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B,
- 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
- 0x03C9, 0x03AC, 0x03AD, 0x03AE, 0x03CA, 0x03AF, 0x03CC, 0x03CD,
- 0x03CB, 0x03CE, 0x0386, 0x0388, 0x0389, 0x038A, 0x038C, 0x038E,
- 0x038F, 0x00B1, 0x2265, 0x2264, 0x03AA, 0x03AB, 0x00F7, 0x2248,
- 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 775
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP775(0x80-0xFF) to Unicode conversion table */
- 0x0106, 0x00FC, 0x00E9, 0x0101, 0x00E4, 0x0123, 0x00E5, 0x0107,
- 0x0142, 0x0113, 0x0156, 0x0157, 0x012B, 0x0179, 0x00C4, 0x00C5,
- 0x00C9, 0x00E6, 0x00C6, 0x014D, 0x00F6, 0x0122, 0x00A2, 0x015A,
- 0x015B, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x00A4,
- 0x0100, 0x012A, 0x00F3, 0x017B, 0x017C, 0x017A, 0x201D, 0x00A6,
- 0x00A9, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x0141, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x0104, 0x010C, 0x0118,
- 0x0116, 0x2563, 0x2551, 0x2557, 0x255D, 0x012E, 0x0160, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x0172, 0x016A,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x017D,
- 0x0105, 0x010D, 0x0119, 0x0117, 0x012F, 0x0161, 0x0173, 0x016B,
- 0x017E, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
- 0x00D3, 0x00DF, 0x014C, 0x0143, 0x00F5, 0x00D5, 0x00B5, 0x0144,
- 0x0136, 0x0137, 0x013B, 0x013C, 0x0146, 0x0112, 0x0145, 0x2019,
- 0x00AD, 0x00B1, 0x201C, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x201E,
- 0x00B0, 0x2219, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 850
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP850(0x80-0xFF) to Unicode conversion table */
- 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7,
- 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
- 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9,
- 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192,
- 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA,
- 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0,
- 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, 0x00A5, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4,
- 0x00F0, 0x00D0, 0x00CA, 0x00CB, 0x00C8, 0x0131, 0x00CD, 0x00CE,
- 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00A6, 0x00CC, 0x2580,
- 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0x00FE,
- 0x00DE, 0x00DA, 0x00DB, 0x00D9, 0x00FD, 0x00DD, 0x00AF, 0x00B4,
- 0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8,
- 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 852
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP852(0x80-0xFF) to Unicode conversion table */
- 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x016F, 0x0107, 0x00E7,
- 0x0142, 0x00EB, 0x0150, 0x0151, 0x00EE, 0x0179, 0x00C4, 0x0106,
- 0x00C9, 0x0139, 0x013A, 0x00F4, 0x00F6, 0x013D, 0x013E, 0x015A,
- 0x015B, 0x00D6, 0x00DC, 0x0164, 0x0165, 0x0141, 0x00D7, 0x010D,
- 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x0104, 0x0105, 0x017D, 0x017E,
- 0x0118, 0x0119, 0x00AC, 0x017A, 0x010C, 0x015F, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x011A,
- 0x015E, 0x2563, 0x2551, 0x2557, 0x255D, 0x017B, 0x017C, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x0102, 0x0103,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4,
- 0x0111, 0x0110, 0x010E, 0x00CB, 0x010F, 0x0147, 0x00CD, 0x00CE,
- 0x011B, 0x2518, 0x250C, 0x2588, 0x2584, 0x0162, 0x016E, 0x2580,
- 0x00D3, 0x00DF, 0x00D4, 0x0143, 0x0144, 0x0148, 0x0160, 0x0161,
- 0x0154, 0x00DA, 0x0155, 0x0170, 0x00FD, 0x00DD, 0x0163, 0x00B4,
- 0x00AD, 0x02DD, 0x02DB, 0x02C7, 0x02D8, 0x00A7, 0x00F7, 0x00B8,
- 0x00B0, 0x00A8, 0x02D9, 0x0171, 0x0158, 0x0159, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 855
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP855(0x80-0xFF) to Unicode conversion table */
- 0x0452, 0x0402, 0x0453, 0x0403, 0x0451, 0x0401, 0x0454, 0x0404,
- 0x0455, 0x0405, 0x0456, 0x0406, 0x0457, 0x0407, 0x0458, 0x0408,
- 0x0459, 0x0409, 0x045A, 0x040A, 0x045B, 0x040B, 0x045C, 0x040C,
- 0x045E, 0x040E, 0x045F, 0x040F, 0x044E, 0x042E, 0x044A, 0x042A,
- 0x0430, 0x0410, 0x0431, 0x0411, 0x0446, 0x0426, 0x0434, 0x0414,
- 0x0435, 0x0415, 0x0444, 0x0424, 0x0433, 0x0413, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x0445, 0x0425, 0x0438,
- 0x0418, 0x2563, 0x2551, 0x2557, 0x255D, 0x0439, 0x0419, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x043A, 0x041A,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4,
- 0x043B, 0x041B, 0x043C, 0x041C, 0x043D, 0x041D, 0x043E, 0x041E,
- 0x043F, 0x2518, 0x250C, 0x2588, 0x2584, 0x041F, 0x044F, 0x2580,
- 0x042F, 0x0440, 0x0420, 0x0441, 0x0421, 0x0442, 0x0422, 0x0443,
- 0x0423, 0x0436, 0x0416, 0x0432, 0x0412, 0x044C, 0x042C, 0x2116,
- 0x00AD, 0x044B, 0x042B, 0x0437, 0x0417, 0x0448, 0x0428, 0x044D,
- 0x042D, 0x0449, 0x0429, 0x0447, 0x0427, 0x00A7, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 857
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP857(0x80-0xFF) to Unicode conversion table */
- 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7,
- 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0131, 0x00C4, 0x00C5,
- 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9,
- 0x0130, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x015E, 0x015F,
- 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x011E, 0x011F,
- 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0,
- 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, 0x00A5, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4,
- 0x00BA, 0x00AA, 0x00CA, 0x00CB, 0x00C8, 0x0000, 0x00CD, 0x00CE,
- 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00A6, 0x00CC, 0x2580,
- 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0x0000,
- 0x00D7, 0x00DA, 0x00DB, 0x00D9, 0x00EC, 0x00FF, 0x00AF, 0x00B4,
- 0x00AD, 0x00B1, 0x0000, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8,
- 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 858
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP858(0x80-0xFF) to Unicode conversion table */
- 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7,
- 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
- 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9,
- 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192,
- 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA,
- 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0,
- 0x00A9, 0x2563, 0x2551, 0x2557, 0x2550, 0x00A2, 0x00A5, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4,
- 0x00F0, 0x00D0, 0x00CA, 0x00CB, 0x00C8, 0x20AC, 0x00CD, 0x00CE,
- 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00C6, 0x00CC, 0x2580,
- 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0x00FE,
- 0x00DE, 0x00DA, 0x00DB, 0x00D9, 0x00FD, 0x00DD, 0x00AF, 0x00B4,
- 0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8,
- 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 862
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP862(0x80-0xFF) to Unicode conversion table */
- 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7,
- 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
- 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7,
- 0x05E8, 0x05E9, 0x05EA, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192,
- 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA,
- 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
- 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
- 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B,
- 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
- 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4,
- 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229,
- 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248,
- 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 866
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP866(0x80-0xFF) to Unicode conversion table */
- 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
- 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
- 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
- 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
- 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
- 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
- 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B,
- 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
- 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
- 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F,
- 0x0401, 0x0451, 0x0404, 0x0454, 0x0407, 0x0457, 0x040E, 0x045E,
- 0x00B0, 0x2219, 0x00B7, 0x221A, 0x2116, 0x00A4, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 874
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP874(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x2026, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07,
- 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F,
- 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17,
- 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F,
- 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27,
- 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F,
- 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37,
- 0x0E38, 0x0E39, 0x0E3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0E3F,
- 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47,
- 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
- 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57,
- 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0x0000, 0x0000, 0x0000, 0x0000
-};
-
-#elif _CODE_PAGE == 1250
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1250(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x0000, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A,
- 0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B,
- 0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x0105, 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C,
- 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7,
- 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E,
- 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7,
- 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF,
- 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7,
- 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
- 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7,
- 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9
-};
-
-#elif _CODE_PAGE == 1251
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1251(0x80-0xFF) to Unicode conversion table */
- 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
- 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x2111, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F,
- 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7,
- 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407,
- 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7,
- 0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457,
- 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
- 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
- 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
- 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
- 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
- 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
- 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F
-};
-
-#elif _CODE_PAGE == 1252
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1252(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x017E, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
- 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
- 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF
-};
-
-#elif _CODE_PAGE == 1253
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1253(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x0000, 0x2030, 0x0000, 0x2039, 0x000C, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x00A0, 0x0385, 0x0386, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x0000, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7,
- 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
- 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
- 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
- 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7,
- 0x03A8, 0x03A9, 0x03AA, 0x03AD, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
- 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7,
- 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
- 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7,
- 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000
-};
-
-#elif _CODE_PAGE == 1254
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1254(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x210A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
- 0x00D8, 0x00D9, 0x00DA, 0x00BD, 0x00DC, 0x0130, 0x015E, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
- 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF
-};
-
-#elif _CODE_PAGE == 1255
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1255(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7,
- 0x05B8, 0x05B9, 0x0000, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF,
- 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05F0, 0x05F1, 0x05F2, 0x05F3,
- 0x05F4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7,
- 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
- 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7,
- 0x05E8, 0x05E9, 0x05EA, 0x0000, 0x0000, 0x200E, 0x200F, 0x0000
-};
-
-#elif _CODE_PAGE == 1256
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1256(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688,
- 0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA,
- 0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F,
- 0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
- 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
- 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7,
- 0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0640, 0x0642, 0x0643,
- 0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF,
- 0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7,
- 0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2
-}
-
-#elif _CODE_PAGE == 1257
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1257(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x00A8, 0x02C7, 0x00B8,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x00AF, 0x02DB, 0x0000,
- 0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x0000, 0x00A6, 0x00A7,
- 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6,
- 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112,
- 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B,
- 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7,
- 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF,
- 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113,
- 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
- 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7,
- 0x0173, 0x014E, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x02D9
-};
-
-#elif _CODE_PAGE == 1258
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1258(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0000, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0x0000, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x0300, 0x00CD, 0x00CE, 0x00CF,
- 0x0110, 0x00D1, 0x0309, 0x00D3, 0x00D4, 0x01A0, 0x00D6, 0x00D7,
- 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x01AF, 0x0303, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0301, 0x00ED, 0x00EE, 0x00EF,
- 0x0111, 0x00F1, 0x0323, 0x00F3, 0x00F4, 0x01A1, 0x00F6, 0x00F7,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x01B0, 0x20AB, 0x00FF
-};
-
-#endif
-
-
-#if !_TBLDEF || !_USE_LFN
-#error This file is not needed in current configuration. Remove from the project.
-#endif
-
-
-WCHAR ff_convert ( /* Converted character, Returns zero on error */
- WCHAR chr, /* Character code to be converted */
- UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */
-)
-{
- WCHAR c;
-
-
- if (chr < 0x80) { /* ASCII */
- c = chr;
-
- } else {
- if (dir) { /* OEMCP to Unicode */
- c = (chr >= 0x100) ? 0 : Tbl[chr - 0x80];
-
- } else { /* Unicode to OEMCP */
- for (c = 0; c < 0x80; c++) {
- if (chr == Tbl[c]) break;
- }
- c = (c + 0x80) & 0xFF;
- }
- }
-
- return c;
-}
-
-
-WCHAR ff_wtoupper ( /* Upper converted character */
- WCHAR chr /* Input character */
-)
-{
- static const WCHAR tbl_lower[] = { 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0xA1, 0x00A2, 0x00A3, 0x00A5, 0x00AC, 0x00AF, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0x0FF, 0x101, 0x103, 0x105, 0x107, 0x109, 0x10B, 0x10D, 0x10F, 0x111, 0x113, 0x115, 0x117, 0x119, 0x11B, 0x11D, 0x11F, 0x121, 0x123, 0x125, 0x127, 0x129, 0x12B, 0x12D, 0x12F, 0x131, 0x133, 0x135, 0x137, 0x13A, 0x13C, 0x13E, 0x140, 0x142, 0x144, 0x146, 0x148, 0x14B, 0x14D, 0x14F, 0x151, 0x153, 0x155, 0x157, 0x159, 0x15B, 0x15D, 0x15F, 0x161, 0x163, 0x165, 0x167, 0x169, 0x16B, 0x16D, 0x16F, 0x171, 0x173, 0x175, 0x177, 0x17A, 0x17C, 0x17E, 0x192, 0x3B1, 0x3B2, 0x3B3, 0x3B4, 0x3B5, 0x3B6, 0x3B7, 0x3B8, 0x3B9, 0x3BA, 0x3BB, 0x3BC, 0x3BD, 0x3BE, 0x3BF, 0x3C0, 0x3C1, 0x3C3, 0x3C4, 0x3C5, 0x3C6, 0x3C7, 0x3C8, 0x3C9, 0x3CA, 0x430, 0x431, 0x432, 0x433, 0x434, 0x435, 0x436, 0x437, 0x438, 0x439, 0x43A, 0x43B, 0x43C, 0x43D, 0x43E, 0x43F, 0x440, 0x441, 0x442, 0x443, 0x444, 0x445, 0x446, 0x447, 0x448, 0x449, 0x44A, 0x44B, 0x44C, 0x44D, 0x44E, 0x44F, 0x451, 0x452, 0x453, 0x454, 0x455, 0x456, 0x457, 0x458, 0x459, 0x45A, 0x45B, 0x45C, 0x45E, 0x45F, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217A, 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, 0xFF48, 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, 0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, 0xFF58, 0xFF59, 0xFF5A, 0 };
- static const WCHAR tbl_upper[] = { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x21, 0xFFE0, 0xFFE1, 0xFFE5, 0xFFE2, 0xFFE3, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0x178, 0x100, 0x102, 0x104, 0x106, 0x108, 0x10A, 0x10C, 0x10E, 0x110, 0x112, 0x114, 0x116, 0x118, 0x11A, 0x11C, 0x11E, 0x120, 0x122, 0x124, 0x126, 0x128, 0x12A, 0x12C, 0x12E, 0x130, 0x132, 0x134, 0x136, 0x139, 0x13B, 0x13D, 0x13F, 0x141, 0x143, 0x145, 0x147, 0x14A, 0x14C, 0x14E, 0x150, 0x152, 0x154, 0x156, 0x158, 0x15A, 0x15C, 0x15E, 0x160, 0x162, 0x164, 0x166, 0x168, 0x16A, 0x16C, 0x16E, 0x170, 0x172, 0x174, 0x176, 0x179, 0x17B, 0x17D, 0x191, 0x391, 0x392, 0x393, 0x394, 0x395, 0x396, 0x397, 0x398, 0x399, 0x39A, 0x39B, 0x39C, 0x39D, 0x39E, 0x39F, 0x3A0, 0x3A1, 0x3A3, 0x3A4, 0x3A5, 0x3A6, 0x3A7, 0x3A8, 0x3A9, 0x3AA, 0x410, 0x411, 0x412, 0x413, 0x414, 0x415, 0x416, 0x417, 0x418, 0x419, 0x41A, 0x41B, 0x41C, 0x41D, 0x41E, 0x41F, 0x420, 0x421, 0x422, 0x423, 0x424, 0x425, 0x426, 0x427, 0x428, 0x429, 0x42A, 0x42B, 0x42C, 0x42D, 0x42E, 0x42F, 0x401, 0x402, 0x403, 0x404, 0x405, 0x406, 0x407, 0x408, 0x409, 0x40A, 0x40B, 0x40C, 0x40E, 0x40F, 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x216A, 0x216B, 0x216C, 0x216D, 0x216E, 0x216F, 0xFF21, 0xFF22, 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27, 0xFF28, 0xFF29, 0xFF2A, 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F, 0xFF30, 0xFF31, 0xFF32, 0xFF33, 0xFF34, 0xFF35, 0xFF36, 0xFF37, 0xFF38, 0xFF39, 0xFF3A, 0 };
- int i;
-
-
- for (i = 0; tbl_lower[i] && chr != tbl_lower[i]; i++) ;
-
- return tbl_lower[i] ? tbl_upper[i] : chr;
-}
-
-#endif // CFG_TUH_MSC
diff --git a/tinyusb/lib/fatfs/diskio.c b/tinyusb/lib/fatfs/diskio.c
deleted file mode 100755
index a6132f27..00000000
--- a/tinyusb/lib/fatfs/diskio.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb.h"
-
-#if CFG_TUH_MSC
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "ffconf.h"
-#include "diskio.h"
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-// TODO change it to portable init
-static DSTATUS disk_state[CFG_TUH_DEVICE_MAX];
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-
-//--------------------------------------------------------------------+
-// IMPLEMENTATION
-//--------------------------------------------------------------------+
-static DRESULT wait_for_io_complete(uint8_t usb_addr)
-{
- // TODO with RTOS, this should use semaphore instead of blocking
- while ( !tuh_msc_ready(usb_addr) )
- {
- // TODO should have timeout here
- #if CFG_TUSB_OS != OPT_OS_NONE
- osal_task_delay(10);
- #endif
- }
-
- return RES_OK;
-}
-
-void diskio_init(void)
-{
- memset(disk_state, STA_NOINIT, CFG_TUH_DEVICE_MAX);
-}
-
-//pdrv Specifies the physical drive number.
-DSTATUS disk_initialize ( BYTE pdrv )
-{
- disk_state[pdrv] &= (~STA_NOINIT); // clear NOINIT bit
- return disk_state[pdrv];
-}
-
-void disk_deinitialize ( BYTE pdrv )
-{
- disk_state[pdrv] |= STA_NOINIT; // set NOINIT bit
-}
-
-DSTATUS disk_status (BYTE pdrv)
-{
- return disk_state[pdrv];
-}
-
-//pdrv
-// Specifies the physical drive number --> == dev_addr-1
-//buff
-// Pointer to the byte array to store the read data. The size of buffer must be in sector size * sector count.
-//sector
-// Specifies the start sector number in logical block address (LBA).
-//count
-// Specifies number of sectors to read. The value can be 1 to 128. Generally, a multiple sector transfer request
-// must not be split into single sector transactions to the device, or you may not get good read performance.
-DRESULT disk_read (BYTE pdrv, BYTE*buff, DWORD sector, BYTE count)
-{
- uint8_t usb_addr = pdrv+1;
-
- if ( TUSB_ERROR_NONE != tuh_msc_read10(usb_addr, 0, buff, sector, count) ) return RES_ERROR;
-
- return wait_for_io_complete(usb_addr);
-}
-
-
-DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, BYTE count)
-{
- uint8_t usb_addr = pdrv+1;
-
- if ( TUSB_ERROR_NONE != tuh_msc_write10(usb_addr, 0, buff, sector, count) ) return RES_ERROR;
-
- return wait_for_io_complete(usb_addr);
-}
-
-/* [IN] Drive number */
-/* [IN] Control command code */
-/* [I/O] Parameter and data buffer */
-DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff)
-{
- (void) buff; (void) pdrv; // compiler warnings
-
- if (cmd != CTRL_SYNC) return RES_ERROR;
- return RES_OK;
-}
-
-static inline uint8_t month2number(char* p_ch)
-{
- char const * const month_str[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
-
- for(uint8_t i=0; i<12; i++)
- {
- if ( strncmp(p_ch, month_str[i], 3) == 0 ) return i+1;
- }
-
- return 1;
-}
-
-static inline uint8_t c2i(char ch)
-{
- return ch - '0';
-}
-
-DWORD get_fattime (void)
-{
- union {
- struct {
- DWORD second : 5;
- DWORD minute : 6;
- DWORD hour : 5;
- DWORD day_in_month : 5;
- DWORD month : 4;
- DWORD year : 7;
- };
-
- DWORD value;
- } timestamp;
-
- //------------- Date is compiled date-------------//
- char compile_date[] = __DATE__; // eg. "Sep 26 2013"
- char* p_ch;
-
- p_ch = strtok (compile_date, " ");
- timestamp.month = month2number(p_ch);
-
- p_ch = strtok (NULL, " ");
- timestamp.day_in_month = 10*c2i(p_ch[0])+ c2i(p_ch[1]);
-
- p_ch = strtok (NULL, " ");
- timestamp.year = 1000*c2i(p_ch[0]) + 100*c2i(p_ch[1]) + 10*c2i(p_ch[2]) + c2i(p_ch[3]) - 1980;
-
- //------------- Time each time this function call --> sec ++ -------------//
- static uint8_t sec = 0;
- static uint8_t min = 0;
- static uint8_t hour = 0;
-
- if (++sec >= 60)
- {
- sec = 0;
- if (++min >= 60)
- {
- min = 0;
- if (++hour >= 24)
- {
- hour = 0; // assume demo wont call this function more than 24*60*60 times
- }
- }
- }
-
- timestamp.hour = hour;
- timestamp.minute = min;
- timestamp.second = sec;
-
- return timestamp.value;
-}
-
-#endif // CFG_TUH_MSC
diff --git a/tinyusb/lib/fatfs/diskio.h b/tinyusb/lib/fatfs/diskio.h
deleted file mode 100755
index f1f4bd32..00000000
--- a/tinyusb/lib/fatfs/diskio.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*-----------------------------------------------------------------------
-/ Low level disk interface modlue include file (C)ChaN, 2013
-/-----------------------------------------------------------------------*/
-
-#ifndef _DISKIO_DEFINED
-#define _DISKIO_DEFINED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define _USE_WRITE 1 /* 1: Enable disk_write function */
-#define _USE_IOCTL 1 /* 1: Enable disk_ioctl fucntion */
-
-#include "integer.h"
-#include <stdbool.h>
-
-/* Status of Disk Functions */
-typedef BYTE DSTATUS;
-
-/* Results of Disk Functions */
-typedef enum {
- RES_OK = 0, /* 0: Successful */
- RES_ERROR, /* 1: R/W Error */
- RES_WRPRT, /* 2: Write Protected */
- RES_NOTRDY, /* 3: Not Ready */
- RES_PARERR /* 4: Invalid Parameter */
-} DRESULT;
-
-
-/* Disk Status Bits (DSTATUS) */
-#define STA_NOINIT 0x01 /* Drive not initialized */
-#define STA_NODISK 0x02 /* No medium in the drive */
-#define STA_PROTECT 0x04 /* Write protected */
-
-
-/* Command code for disk_ioctrl fucntion */
-
-/* Generic command (used by FatFs) */
-#define CTRL_SYNC 0 /* Flush disk cache (for write functions) */
-#define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */
-#define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */
-#define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */
-#define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */
-
-/* Generic command (not used by FatFs) */
-#define CTRL_POWER 5 /* Get/Set power status */
-#define CTRL_LOCK 6 /* Lock/Unlock media removal */
-#define CTRL_EJECT 7 /* Eject media */
-#define CTRL_FORMAT 8 /* Create physical format on the media */
-
-/* MMC/SDC specific ioctl command */
-#define MMC_GET_TYPE 10 /* Get card type */
-#define MMC_GET_CSD 11 /* Get CSD */
-#define MMC_GET_CID 12 /* Get CID */
-#define MMC_GET_OCR 13 /* Get OCR */
-#define MMC_GET_SDSTAT 14 /* Get SD status */
-
-/* ATA/CF specific ioctl command */
-#define ATA_GET_REV 20 /* Get F/W revision */
-#define ATA_GET_MODEL 21 /* Get model name */
-#define ATA_GET_SN 22 /* Get serial number */
-
-
-/* MMC card type flags (MMC_GET_TYPE) */
-#define CT_MMC 0x01 /* MMC ver 3 */
-#define CT_SD1 0x02 /* SD ver 1 */
-#define CT_SD2 0x04 /* SD ver 2 */
-#define CT_SDC (CT_SD1|CT_SD2) /* SD */
-#define CT_BLOCK 0x08 /* Block addressing */
-
-/*---------------------------------------*/
-/* Prototypes for disk control functions */
-
-void diskio_init(void);
-void disk_deinitialize ( BYTE pdrv );
-DSTATUS disk_initialize (BYTE pdrv);
-DSTATUS disk_status (BYTE pdrv);
-DRESULT disk_read (BYTE pdrv, BYTE*buff, DWORD sector, BYTE count);
-DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, BYTE count);
-DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
-
-static inline bool disk_is_ready(BYTE pdrv);
-static inline bool disk_is_ready(BYTE pdrv)
-{
- return (pdrv < CFG_TUH_DEVICE_MAX) &&
- ( (disk_status(pdrv) & (STA_NOINIT | STA_NODISK)) == 0 );
-}
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tinyusb/lib/fatfs/ff.c b/tinyusb/lib/fatfs/ff.c
deleted file mode 100755
index 79414af0..00000000
--- a/tinyusb/lib/fatfs/ff.c
+++ /dev/null
@@ -1,4330 +0,0 @@
-/*----------------------------------------------------------------------------/
-/ FatFs - FAT file system module R0.09b (C)ChaN, 2013
-/-----------------------------------------------------------------------------/
-/ FatFs module is a generic FAT file system module for small embedded systems.
-/ This is a free software that opened for education, research and commercial
-/ developments under license policy of following terms.
-/
-/ Copyright (C) 2013, ChaN, all right reserved.
-/
-/ * The FatFs module is a free software and there is NO WARRANTY.
-/ * No restriction on use. You can use, modify and redistribute it for
-/ personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.
-/ * Redistributions of source code must retain the above copyright notice.
-/
-/-----------------------------------------------------------------------------/
-/ Feb 26,'06 R0.00 Prototype.
-/
-/ Apr 29,'06 R0.01 First stable version.
-/
-/ Jun 01,'06 R0.02 Added FAT12 support.
-/ Removed unbuffered mode.
-/ Fixed a problem on small (<32M) partition.
-/ Jun 10,'06 R0.02a Added a configuration option (_FS_MINIMUM).
-/
-/ Sep 22,'06 R0.03 Added f_rename().
-/ Changed option _FS_MINIMUM to _FS_MINIMIZE.
-/ Dec 11,'06 R0.03a Improved cluster scan algorithm to write files fast.
-/ Fixed f_mkdir() creates incorrect directory on FAT32.
-/
-/ Feb 04,'07 R0.04 Supported multiple drive system.
-/ Changed some interfaces for multiple drive system.
-/ Changed f_mountdrv() to f_mount().
-/ Added f_mkfs().
-/ Apr 01,'07 R0.04a Supported multiple partitions on a physical drive.
-/ Added a capability of extending file size to f_lseek().
-/ Added minimization level 3.
-/ Fixed an endian sensitive code in f_mkfs().
-/ May 05,'07 R0.04b Added a configuration option _USE_NTFLAG.
-/ Added FSInfo support.
-/ Fixed DBCS name can result FR_INVALID_NAME.
-/ Fixed short seek (<= csize) collapses the file object.
-/
-/ Aug 25,'07 R0.05 Changed arguments of f_read(), f_write() and f_mkfs().
-/ Fixed f_mkfs() on FAT32 creates incorrect FSInfo.
-/ Fixed f_mkdir() on FAT32 creates incorrect directory.
-/ Feb 03,'08 R0.05a Added f_truncate() and f_utime().
-/ Fixed off by one error at FAT sub-type determination.
-/ Fixed btr in f_read() can be mistruncated.
-/ Fixed cached sector is not flushed when create and close without write.
-/
-/ Apr 01,'08 R0.06 Added fputc(), fputs(), fprintf() and fgets().
-/ Improved performance of f_lseek() on moving to the same or following cluster.
-/
-/ Apr 01,'09 R0.07 Merged Tiny-FatFs as a configuration option. (_FS_TINY)
-/ Added long file name feature.
-/ Added multiple code page feature.
-/ Added re-entrancy for multitask operation.
-/ Added auto cluster size selection to f_mkfs().
-/ Added rewind option to f_readdir().
-/ Changed result code of critical errors.
-/ Renamed string functions to avoid name collision.
-/ Apr 14,'09 R0.07a Separated out OS dependent code on reentrant cfg.
-/ Added multiple sector size feature.
-/ Jun 21,'09 R0.07c Fixed f_unlink() can return FR_OK on error.
-/ Fixed wrong cache control in f_lseek().
-/ Added relative path feature.
-/ Added f_chdir() and f_chdrive().
-/ Added proper case conversion to extended char.
-/ Nov 03,'09 R0.07e Separated out configuration options from ff.h to ffconf.h.
-/ Fixed f_unlink() fails to remove a sub-dir on _FS_RPATH.
-/ Fixed name matching error on the 13 char boundary.
-/ Added a configuration option, _LFN_UNICODE.
-/ Changed f_readdir() to return the SFN with always upper case on non-LFN cfg.
-/
-/ May 15,'10 R0.08 Added a memory configuration option. (_USE_LFN = 3)
-/ Added file lock feature. (_FS_SHARE)
-/ Added fast seek feature. (_USE_FASTSEEK)
-/ Changed some types on the API, XCHAR->TCHAR.
-/ Changed fname member in the FILINFO structure on Unicode cfg.
-/ String functions support UTF-8 encoding files on Unicode cfg.
-/ Aug 16,'10 R0.08a Added f_getcwd(). (_FS_RPATH = 2)
-/ Added sector erase feature. (_USE_ERASE)
-/ Moved file lock semaphore table from fs object to the bss.
-/ Fixed a wrong directory entry is created on non-LFN cfg when the given name contains ';'.
-/ Fixed f_mkfs() creates wrong FAT32 volume.
-/ Jan 15,'11 R0.08b Fast seek feature is also applied to f_read() and f_write().
-/ f_lseek() reports required table size on creating CLMP.
-/ Extended format syntax of f_printf function.
-/ Ignores duplicated directory separators in given path name.
-/
-/ Sep 06,'11 R0.09 f_mkfs() supports multiple partition to finish the multiple partition feature.
-/ Added f_fdisk(). (_MULTI_PARTITION = 2)
-/ Aug 27,'12 R0.09a Fixed assertion failure due to OS/2 EA on FAT12/16 volume.
-/ Changed f_open() and f_opendir reject null object pointer to avoid crash.
-/ Changed option name _FS_SHARE to _FS_LOCK.
-/ Jan 24,'13 R0.09b Added f_setlabel() and f_getlabel(). (_USE_LABEL = 1)
-/---------------------------------------------------------------------------*/
-
-#include "ff.h" /* FatFs configurations and declarations */
-#include "diskio.h" /* Declarations of low level disk I/O functions */
-
-#if CFG_TUH_MSC
-/*--------------------------------------------------------------------------
-
- Module Private Definitions
-
----------------------------------------------------------------------------*/
-
-#if _FATFS != 82786 /* Revision ID */
-#error Wrong include file (ff.h).
-#endif
-
-
-/* Definitions on sector size */
-#if _MAX_SS != 512 && _MAX_SS != 1024 && _MAX_SS != 2048 && _MAX_SS != 4096
-#error Wrong sector size.
-#endif
-#if _MAX_SS != 512
-#define SS(fs) ((fs)->ssize) /* Variable sector size */
-#else
-#define SS(fs) 512U /* Fixed sector size */
-#endif
-
-
-/* Reentrancy related */
-#if _FS_REENTRANT
-#if _USE_LFN == 1
-#error Static LFN work area must not be used in re-entrant configuration.
-#endif
-#define ENTER_FF(fs) { if (!lock_fs(fs)) return FR_TIMEOUT; }
-#define LEAVE_FF(fs, res) { unlock_fs(fs, res); return res; }
-#else
-#define ENTER_FF(fs)
-#define LEAVE_FF(fs, res) return res
-#endif
-
-#define ABORT(fs, res) { fp->flag |= FA__ERROR; LEAVE_FF(fs, res); }
-
-
-/* File access control feature */
-#if _FS_LOCK
-#if _FS_READONLY
-#error _FS_LOCK must be 0 on read-only cfg.
-#endif
-typedef struct {
- FATFS *fs; /* File ID 1, volume (NULL:blank entry) */
- DWORD clu; /* File ID 2, directory */
- WORD idx; /* File ID 3, directory index */
- WORD ctr; /* File open counter, 0:none, 0x01..0xFF:read open count, 0x100:write mode */
-} FILESEM;
-#endif
-
-
-
-/* DBCS code ranges and SBCS extend char conversion table */
-
-#if _CODE_PAGE == 932 /* Japanese Shift-JIS */
-#define _DF1S 0x81 /* DBC 1st byte range 1 start */
-#define _DF1E 0x9F /* DBC 1st byte range 1 end */
-#define _DF2S 0xE0 /* DBC 1st byte range 2 start */
-#define _DF2E 0xFC /* DBC 1st byte range 2 end */
-#define _DS1S 0x40 /* DBC 2nd byte range 1 start */
-#define _DS1E 0x7E /* DBC 2nd byte range 1 end */
-#define _DS2S 0x80 /* DBC 2nd byte range 2 start */
-#define _DS2E 0xFC /* DBC 2nd byte range 2 end */
-
-#elif _CODE_PAGE == 936 /* Simplified Chinese GBK */
-#define _DF1S 0x81
-#define _DF1E 0xFE
-#define _DS1S 0x40
-#define _DS1E 0x7E
-#define _DS2S 0x80
-#define _DS2E 0xFE
-
-#elif _CODE_PAGE == 949 /* Korean */
-#define _DF1S 0x81
-#define _DF1E 0xFE
-#define _DS1S 0x41
-#define _DS1E 0x5A
-#define _DS2S 0x61
-#define _DS2E 0x7A
-#define _DS3S 0x81
-#define _DS3E 0xFE
-
-#elif _CODE_PAGE == 950 /* Traditional Chinese Big5 */
-#define _DF1S 0x81
-#define _DF1E 0xFE
-#define _DS1S 0x40
-#define _DS1E 0x7E
-#define _DS2S 0xA1
-#define _DS2E 0xFE
-
-#elif _CODE_PAGE == 437 /* U.S. (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F,0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 720 /* Arabic (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x45,0x41,0x84,0x41,0x86,0x43,0x45,0x45,0x45,0x49,0x49,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x49,0x49,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 737 /* Greek (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x96,0x97,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, \
- 0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0xAA,0x92,0x93,0x94,0x95,0x96,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0x97,0xEA,0xEB,0xEC,0xE4,0xED,0xEE,0xE7,0xE8,0xF1,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 775 /* Baltic (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x9A,0x91,0xA0,0x8E,0x95,0x8F,0x80,0xAD,0xED,0x8A,0x8A,0xA1,0x8D,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0x95,0x96,0x97,0x97,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
- 0xA0,0xA1,0xE0,0xA3,0xA3,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xB5,0xB6,0xB7,0xB8,0xBD,0xBE,0xC6,0xC7,0xA5,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE3,0xE8,0xE8,0xEA,0xEA,0xEE,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 850 /* Multilingual Latin 1 (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
- 0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 852 /* Latin 2 (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xDE,0x8F,0x80,0x9D,0xD3,0x8A,0x8A,0xD7,0x8D,0x8E,0x8F,0x90,0x91,0x91,0xE2,0x99,0x95,0x95,0x97,0x97,0x99,0x9A,0x9B,0x9B,0x9D,0x9E,0x9F, \
- 0xB5,0xD6,0xE0,0xE9,0xA4,0xA4,0xA6,0xA6,0xA8,0xA8,0xAA,0x8D,0xAC,0xB8,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBD,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC6,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD2,0xD5,0xD6,0xD7,0xB7,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE3,0xD5,0xE6,0xE6,0xE8,0xE9,0xE8,0xEB,0xED,0xED,0xDD,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF}
-
-#elif _CODE_PAGE == 855 /* Cyrillic (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x81,0x81,0x83,0x83,0x85,0x85,0x87,0x87,0x89,0x89,0x8B,0x8B,0x8D,0x8D,0x8F,0x8F,0x91,0x91,0x93,0x93,0x95,0x95,0x97,0x97,0x99,0x99,0x9B,0x9B,0x9D,0x9D,0x9F,0x9F, \
- 0xA1,0xA1,0xA3,0xA3,0xA5,0xA5,0xA7,0xA7,0xA9,0xA9,0xAB,0xAB,0xAD,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB6,0xB6,0xB8,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD3,0xD3,0xD5,0xD5,0xD7,0xD7,0xDD,0xD9,0xDA,0xDB,0xDC,0xDD,0xE0,0xDF, \
- 0xE0,0xE2,0xE2,0xE4,0xE4,0xE6,0xE6,0xE8,0xE8,0xEA,0xEA,0xEC,0xEC,0xEE,0xEE,0xEF,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 857 /* Turkish (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0x98,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x98,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9E, \
- 0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA6,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xDE,0x59,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 858 /* Multilingual Latin 1 + Euro (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
- 0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 862 /* Hebrew (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 866 /* Russian (OEM) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0x90,0x91,0x92,0x93,0x9d,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 874 /* Thai (OEM, Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 1250 /* Central Europe (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \
- 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF}
-
-#elif _CODE_PAGE == 1251 /* Cyrillic (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x82,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \
- 0xA0,0xA2,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF}
-
-#elif _CODE_PAGE == 1252 /* Latin 1 (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0xAd,0x9B,0x8C,0x9D,0xAE,0x9F, \
- 0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
-
-#elif _CODE_PAGE == 1253 /* Greek (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xA2,0xB8,0xB9,0xBA, \
- 0xE0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xFB,0xBC,0xFD,0xBF,0xFF}
-
-#elif _CODE_PAGE == 1254 /* Turkish (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x9E,0x9F, \
- 0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
-
-#elif _CODE_PAGE == 1255 /* Hebrew (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 1256 /* Arabic (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x8C,0x9D,0x9E,0x9F, \
- 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0x41,0xE1,0x41,0xE3,0xE4,0xE5,0xE6,0x43,0x45,0x45,0x45,0x45,0xEC,0xED,0x49,0x49,0xF0,0xF1,0xF2,0xF3,0x4F,0xF5,0xF6,0xF7,0xF8,0x55,0xFA,0x55,0x55,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 1257 /* Baltic (Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
- 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF}
-
-#elif _CODE_PAGE == 1258 /* Vietnam (OEM, Windows) */
-#define _DF1S 0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0xAC,0x9D,0x9E,0x9F, \
- 0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
- 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xEC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xFE,0x9F}
-
-#elif _CODE_PAGE == 1 /* ASCII (for only non-LFN cfg) */
-#if _USE_LFN
-#error Cannot use LFN feature without valid code page.
-#endif
-#define _DF1S 0
-
-#else
-#error Unknown code page
-
-#endif
-
-
-/* Character code support macros */
-#define IsUpper(c) (((c)>='A')&&((c)<='Z'))
-#define IsLower(c) (((c)>='a')&&((c)<='z'))
-#define IsDigit(c) (((c)>='0')&&((c)<='9'))
-
-#if _DF1S /* Code page is DBCS */
-
-#ifdef _DF2S /* Two 1st byte areas */
-#define IsDBCS1(c) (((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E) || ((BYTE)(c) >= _DF2S && (BYTE)(c) <= _DF2E))
-#else /* One 1st byte area */
-#define IsDBCS1(c) ((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E)
-#endif
-
-#ifdef _DS3S /* Three 2nd byte areas */
-#define IsDBCS2(c) (((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E) || ((BYTE)(c) >= _DS3S && (BYTE)(c) <= _DS3E))
-#else /* Two 2nd byte areas */
-#define IsDBCS2(c) (((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E))
-#endif
-
-#else /* Code page is SBCS */
-
-#define IsDBCS1(c) 0
-#define IsDBCS2(c) 0
-
-#endif /* _DF1S */
-
-
-/* Name status flags */
-#define NS 11 /* Index of name status byte in fn[] */
-#define NS_LOSS 0x01 /* Out of 8.3 format */
-#define NS_LFN 0x02 /* Force to create LFN entry */
-#define NS_LAST 0x04 /* Last segment */
-#define NS_BODY 0x08 /* Lower case flag (body) */
-#define NS_EXT 0x10 /* Lower case flag (ext) */
-#define NS_DOT 0x20 /* Dot entry */
-
-
-/* FAT sub-type boundaries */
-/* Note that the FAT spec by Microsoft says 4085 but Windows works with 4087! */
-#define MIN_FAT16 4086 /* Minimum number of clusters for FAT16 */
-#define MIN_FAT32 65526 /* Minimum number of clusters for FAT32 */
-
-
-/* FatFs refers the members in the FAT structures as byte array instead of
-/ structure member because the structure is not binary compatible between
-/ different platforms */
-
-#define BS_jmpBoot 0 /* Jump instruction (3) */
-#define BS_OEMName 3 /* OEM name (8) */
-#define BPB_BytsPerSec 11 /* Sector size [byte] (2) */
-#define BPB_SecPerClus 13 /* Cluster size [sector] (1) */
-#define BPB_RsvdSecCnt 14 /* Size of reserved area [sector] (2) */
-#define BPB_NumFATs 16 /* Number of FAT copies (1) */
-#define BPB_RootEntCnt 17 /* Number of root dir entries for FAT12/16 (2) */
-#define BPB_TotSec16 19 /* Volume size [sector] (2) */
-#define BPB_Media 21 /* Media descriptor (1) */
-#define BPB_FATSz16 22 /* FAT size [sector] (2) */
-#define BPB_SecPerTrk 24 /* Track size [sector] (2) */
-#define BPB_NumHeads 26 /* Number of heads (2) */
-#define BPB_HiddSec 28 /* Number of special hidden sectors (4) */
-#define BPB_TotSec32 32 /* Volume size [sector] (4) */
-#define BS_DrvNum 36 /* Physical drive number (2) */
-#define BS_BootSig 38 /* Extended boot signature (1) */
-#define BS_VolID 39 /* Volume serial number (4) */
-#define BS_VolLab 43 /* Volume label (8) */
-#define BS_FilSysType 54 /* File system type (1) */
-#define BPB_FATSz32 36 /* FAT size [sector] (4) */
-#define BPB_ExtFlags 40 /* Extended flags (2) */
-#define BPB_FSVer 42 /* File system version (2) */
-#define BPB_RootClus 44 /* Root dir first cluster (4) */
-#define BPB_FSInfo 48 /* Offset of FSInfo sector (2) */
-#define BPB_BkBootSec 50 /* Offset of backup boot sector (2) */
-#define BS_DrvNum32 64 /* Physical drive number (2) */
-#define BS_BootSig32 66 /* Extended boot signature (1) */
-#define BS_VolID32 67 /* Volume serial number (4) */
-#define BS_VolLab32 71 /* Volume label (8) */
-#define BS_FilSysType32 82 /* File system type (1) */
-#define FSI_LeadSig 0 /* FSI: Leading signature (4) */
-#define FSI_StrucSig 484 /* FSI: Structure signature (4) */
-#define FSI_Free_Count 488 /* FSI: Number of free clusters (4) */
-#define FSI_Nxt_Free 492 /* FSI: Last allocated cluster (4) */
-#define MBR_Table 446 /* MBR: Partition table offset (2) */
-#define SZ_PTE 16 /* MBR: Size of a partition table entry */
-#define BS_55AA 510 /* Boot sector signature (2) */
-
-#define DIR_Name 0 /* Short file name (11) */
-#define DIR_Attr 11 /* Attribute (1) */
-#define DIR_NTres 12 /* NT flag (1) */
-#define DIR_CrtTimeTenth 13 /* Created time sub-second (1) */
-#define DIR_CrtTime 14 /* Created time (2) */
-#define DIR_CrtDate 16 /* Created date (2) */
-#define DIR_LstAccDate 18 /* Last accessed date (2) */
-#define DIR_FstClusHI 20 /* Higher 16-bit of first cluster (2) */
-#define DIR_WrtTime 22 /* Modified time (2) */
-#define DIR_WrtDate 24 /* Modified date (2) */
-#define DIR_FstClusLO 26 /* Lower 16-bit of first cluster (2) */
-#define DIR_FileSize 28 /* File size (4) */
-#define LDIR_Ord 0 /* LFN entry order and LLE flag (1) */
-#define LDIR_Attr 11 /* LFN attribute (1) */
-#define LDIR_Type 12 /* LFN type (1) */
-#define LDIR_Chksum 13 /* Sum of corresponding SFN entry */
-#define LDIR_FstClusLO 26 /* Filled by zero (0) */
-#define SZ_DIR 32 /* Size of a directory entry */
-#define LLE 0x40 /* Last long entry flag in LDIR_Ord */
-#define DDE 0xE5 /* Deleted directory entry mark in DIR_Name[0] */
-#define NDDE 0x05 /* Replacement of the character collides with DDE */
-
-
-/*------------------------------------------------------------*/
-/* Module private work area */
-/*------------------------------------------------------------*/
-/* Note that uninitialized variables with static duration are
-/ zeroed/nulled at start-up. If not, the compiler or start-up
-/ routine is out of ANSI-C standard.
-*/
-
-#if _VOLUMES
-static
-FATFS *FatFs[_VOLUMES]; /* Pointer to the file system objects (logical drives) */
-#else
-#error Number of volumes must not be 0.
-#endif
-
-static
-WORD Fsid; /* File system mount ID */
-
-#if _FS_RPATH
-static
-BYTE CurrVol; /* Current drive */
-#endif
-
-#if _FS_LOCK
-static
-FILESEM Files[_FS_LOCK]; /* File lock semaphores */
-#endif
-
-#if _USE_LFN == 0 /* No LFN feature */
-#define DEF_NAMEBUF BYTE sfn[12]
-#define INIT_BUF(dobj) (dobj).fn = sfn
-#define FREE_BUF()
-
-#elif _USE_LFN == 1 /* LFN feature with static working buffer */
-static WCHAR LfnBuf[_MAX_LFN+1];
-#define DEF_NAMEBUF BYTE sfn[12]
-#define INIT_BUF(dobj) { (dobj).fn = sfn; (dobj).lfn = LfnBuf; }
-#define FREE_BUF()
-
-#elif _USE_LFN == 2 /* LFN feature with dynamic working buffer on the stack */
-#define DEF_NAMEBUF BYTE sfn[12]; WCHAR lbuf[_MAX_LFN+1]
-#define INIT_BUF(dobj) { (dobj).fn = sfn; (dobj).lfn = lbuf; }
-#define FREE_BUF()
-
-#elif _USE_LFN == 3 /* LFN feature with dynamic working buffer on the heap */
-#define DEF_NAMEBUF BYTE sfn[12]; WCHAR *lfn
-#define INIT_BUF(dobj) { lfn = ff_memalloc((_MAX_LFN + 1) * 2); \
- if (!lfn) LEAVE_FF((dobj).fs, FR_NOT_ENOUGH_CORE); \
- (dobj).lfn = lfn; (dobj).fn = sfn; }
-#define FREE_BUF() ff_memfree(lfn)
-
-#else
-#error Wrong LFN configuration.
-#endif
-
-
-#ifdef _EXCVT
-static
-const BYTE ExCvt[] = _EXCVT; /* Upper conversion table for extended chars */
-#endif
-
-
-
-
-
-
-/*--------------------------------------------------------------------------
-
- Module Private Functions
-
----------------------------------------------------------------------------*/
-
-
-/*-----------------------------------------------------------------------*/
-/* String functions */
-/*-----------------------------------------------------------------------*/
-
-/* Copy memory to memory */
-static
-void mem_cpy (void* dst, const void* src, UINT cnt) {
- BYTE *d = (BYTE*)dst;
- const BYTE *s = (const BYTE*)src;
-
-#if _WORD_ACCESS == 1
- while (cnt >= sizeof (int)) {
- *(int*)d = *(int*)s;
- d += sizeof (int); s += sizeof (int);
- cnt -= sizeof (int);
- }
-#endif
- while (cnt--)
- *d++ = *s++;
-}
-
-/* Fill memory */
-static
-void mem_set (void* dst, int val, UINT cnt) {
- BYTE *d = (BYTE*)dst;
-
- while (cnt--)
- *d++ = (BYTE)val;
-}
-
-/* Compare memory to memory */
-static
-int mem_cmp (const void* dst, const void* src, UINT cnt) {
- const BYTE *d = (const BYTE *)dst, *s = (const BYTE *)src;
- int r = 0;
-
- while (cnt-- && (r = *d++ - *s++) == 0) ;
- return r;
-}
-
-/* Check if chr is contained in the string */
-static
-int chk_chr (const char* str, int chr) {
- while (*str && *str != chr) str++;
- return *str;
-}
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Request/Release grant to access the volume */
-/*-----------------------------------------------------------------------*/
-#if _FS_REENTRANT
-
-static
-int lock_fs (
- FATFS *fs /* File system object */
-)
-{
- return ff_req_grant(fs->sobj);
-}
-
-
-static
-void unlock_fs (
- FATFS *fs, /* File system object */
- FRESULT res /* Result code to be returned */
-)
-{
- if (fs &&
- res != FR_NOT_ENABLED &&
- res != FR_INVALID_DRIVE &&
- res != FR_INVALID_OBJECT &&
- res != FR_TIMEOUT) {
- ff_rel_grant(fs->sobj);
- }
-}
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* File lock control functions */
-/*-----------------------------------------------------------------------*/
-#if _FS_LOCK
-
-static
-FRESULT chk_lock ( /* Check if the file can be accessed */
- DIR* dj, /* Directory object pointing the file to be checked */
- int acc /* Desired access (0:Read, 1:Write, 2:Delete/Rename) */
-)
-{
- UINT i, be;
-
- /* Search file semaphore table */
- for (i = be = 0; i < _FS_LOCK; i++) {
- if (Files[i].fs) { /* Existing entry */
- if (Files[i].fs == dj->fs && /* Check if the file matched with an open file */
- Files[i].clu == dj->sclust &&
- Files[i].idx == dj->index) break;
- } else { /* Blank entry */
- be++;
- }
- }
- if (i == _FS_LOCK) /* The file is not opened */
- return (be || acc == 2) ? FR_OK : FR_TOO_MANY_OPEN_FILES; /* Is there a blank entry for new file? */
-
- /* The file has been opened. Reject any open against writing file and all write mode open */
- return (acc || Files[i].ctr == 0x100) ? FR_LOCKED : FR_OK;
-}
-
-
-static
-int enq_lock (void) /* Check if an entry is available for a new file */
-{
- UINT i;
-
- for (i = 0; i < _FS_LOCK && Files[i].fs; i++) ;
- return (i == _FS_LOCK) ? 0 : 1;
-}
-
-
-static
-UINT inc_lock ( /* Increment file open counter and returns its index (0:int error) */
- DIR* dj, /* Directory object pointing the file to register or increment */
- int acc /* Desired access mode (0:Read, !0:Write) */
-)
-{
- UINT i;
-
-
- for (i = 0; i < _FS_LOCK; i++) { /* Find the file */
- if (Files[i].fs == dj->fs &&
- Files[i].clu == dj->sclust &&
- Files[i].idx == dj->index) break;
- }
-
- if (i == _FS_LOCK) { /* Not opened. Register it as new. */
- for (i = 0; i < _FS_LOCK && Files[i].fs; i++) ;
- if (i == _FS_LOCK) return 0; /* No space to register (int err) */
- Files[i].fs = dj->fs;
- Files[i].clu = dj->sclust;
- Files[i].idx = dj->index;
- Files[i].ctr = 0;
- }
-
- if (acc && Files[i].ctr) return 0; /* Access violation (int err) */
-
- Files[i].ctr = acc ? 0x100 : Files[i].ctr + 1; /* Set semaphore value */
-
- return i + 1;
-}
-
-
-static
-FRESULT dec_lock ( /* Decrement file open counter */
- UINT i /* Semaphore index */
-)
-{
- WORD n;
- FRESULT res;
-
-
- if (--i < _FS_LOCK) {
- n = Files[i].ctr;
- if (n == 0x100) n = 0;
- if (n) n--;
- Files[i].ctr = n;
- if (!n) Files[i].fs = 0;
- res = FR_OK;
- } else {
- res = FR_INT_ERR;
- }
- return res;
-}
-
-
-static
-void clear_lock ( /* Clear lock entries of the volume */
- FATFS *fs
-)
-{
- UINT i;
-
- for (i = 0; i < _FS_LOCK; i++) {
- if (Files[i].fs == fs) Files[i].fs = 0;
- }
-}
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Move/Flush disk access window */
-/*-----------------------------------------------------------------------*/
-
-
-#if !_FS_READONLY
-static
-FRESULT sync_window (
- FATFS *fs /* File system object */
-)
-{
- DWORD wsect;
- UINT nf;
-
-
- if (fs->wflag) { /* Write back the sector if it is dirty */
- wsect = fs->winsect; /* Current sector number */
- if (disk_write(fs->drv, fs->win, wsect, 1) != RES_OK)
- return FR_DISK_ERR;
- fs->wflag = 0;
- if (wsect >= fs->fatbase && wsect < (fs->fatbase + fs->fsize)) { /* In FAT area? */
- for (nf = fs->n_fats; nf >= 2; nf--) { /* Reflect the change to all FAT copies */
- wsect += fs->fsize;
- disk_write(fs->drv, fs->win, wsect, 1);
- }
- }
- }
- return FR_OK;
-}
-#endif
-
-
-static
-FRESULT move_window (
- FATFS *fs, /* File system object */
- DWORD sector /* Sector number to make appearance in the fs->win[] */
-)
-{
- if (sector != fs->winsect) { /* Changed current window */
-#if !_FS_READONLY
- if (sync_window(fs) != FR_OK)
- return FR_DISK_ERR;
-#endif
- if (disk_read(fs->drv, fs->win, sector, 1) != RES_OK)
- return FR_DISK_ERR;
- fs->winsect = sector;
- }
-
- return FR_OK;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Synchronize file system and strage device */
-/*-----------------------------------------------------------------------*/
-#if !_FS_READONLY
-static
-FRESULT sync_fs ( /* FR_OK: successful, FR_DISK_ERR: failed */
- FATFS *fs /* File system object */
-)
-{
- FRESULT res;
-
-
- res = sync_window(fs);
- if (res == FR_OK) {
- /* Update FSInfo sector if needed */
- if (fs->fs_type == FS_FAT32 && fs->fsi_flag) {
- fs->winsect = 0;
- /* Create FSInfo structure */
- mem_set(fs->win, 0, 512);
- ST_WORD(fs->win+BS_55AA, 0xAA55);
- ST_DWORD(fs->win+FSI_LeadSig, 0x41615252);
- ST_DWORD(fs->win+FSI_StrucSig, 0x61417272);
- ST_DWORD(fs->win+FSI_Free_Count, fs->free_clust);
- ST_DWORD(fs->win+FSI_Nxt_Free, fs->last_clust);
- /* Write it into the FSInfo sector */
- disk_write(fs->drv, fs->win, fs->fsi_sector, 1);
- fs->fsi_flag = 0;
- }
- /* Make sure that no pending write process in the physical drive */
- if (disk_ioctl(fs->drv, CTRL_SYNC, 0) != RES_OK)
- res = FR_DISK_ERR;
- }
-
- return res;
-}
-#endif
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Get sector# from cluster# */
-/*-----------------------------------------------------------------------*/
-
-
-DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
- FATFS *fs, /* File system object */
- DWORD clst /* Cluster# to be converted */
-)
-{
- clst -= 2;
- if (clst >= (fs->n_fatent - 2)) return 0; /* Invalid cluster# */
- return clst * fs->csize + fs->database;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* FAT access - Read value of a FAT entry */
-/*-----------------------------------------------------------------------*/
-
-
-DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, Else:Cluster status */
- FATFS *fs, /* File system object */
- DWORD clst /* Cluster# to get the link information */
-)
-{
- UINT wc, bc;
- BYTE *p;
-
-
- if (clst < 2 || clst >= fs->n_fatent) /* Check range */
- return 1;
-
- switch (fs->fs_type) {
- case FS_FAT12 :
- bc = (UINT)clst; bc += bc / 2;
- if (move_window(fs, fs->fatbase + (bc / SS(fs)))) break;
- wc = fs->win[bc % SS(fs)]; bc++;
- if (move_window(fs, fs->fatbase + (bc / SS(fs)))) break;
- wc |= fs->win[bc % SS(fs)] << 8;
- return (clst & 1) ? (wc >> 4) : (wc & 0xFFF);
-
- case FS_FAT16 :
- if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 2)))) break;
- p = &fs->win[clst * 2 % SS(fs)];
- return LD_WORD(p);
-
- case FS_FAT32 :
- if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4)))) break;
- p = &fs->win[clst * 4 % SS(fs)];
- return LD_DWORD(p) & 0x0FFFFFFF;
- }
-
- return 0xFFFFFFFF; /* An error occurred at the disk I/O layer */
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* FAT access - Change value of a FAT entry */
-/*-----------------------------------------------------------------------*/
-#if !_FS_READONLY
-
-FRESULT put_fat (
- FATFS *fs, /* File system object */
- DWORD clst, /* Cluster# to be changed in range of 2 to fs->n_fatent - 1 */
- DWORD val /* New value to mark the cluster */
-)
-{
- UINT bc;
- BYTE *p;
- FRESULT res;
-
-
- if (clst < 2 || clst >= fs->n_fatent) { /* Check range */
- res = FR_INT_ERR;
-
- } else {
- switch (fs->fs_type) {
- case FS_FAT12 :
- bc = (UINT)clst; bc += bc / 2;
- res = move_window(fs, fs->fatbase + (bc / SS(fs)));
- if (res != FR_OK) break;
- p = &fs->win[bc % SS(fs)];
- *p = (clst & 1) ? ((*p & 0x0F) | ((BYTE)val << 4)) : (BYTE)val;
- bc++;
- fs->wflag = 1;
- res = move_window(fs, fs->fatbase + (bc / SS(fs)));
- if (res != FR_OK) break;
- p = &fs->win[bc % SS(fs)];
- *p = (clst & 1) ? (BYTE)(val >> 4) : ((*p & 0xF0) | ((BYTE)(val >> 8) & 0x0F));
- break;
-
- case FS_FAT16 :
- res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 2)));
- if (res != FR_OK) break;
- p = &fs->win[clst * 2 % SS(fs)];
- ST_WORD(p, (WORD)val);
- break;
-
- case FS_FAT32 :
- res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 4)));
- if (res != FR_OK) break;
- p = &fs->win[clst * 4 % SS(fs)];
- val |= LD_DWORD(p) & 0xF0000000;
- ST_DWORD(p, val);
- break;
-
- default :
- res = FR_INT_ERR;
- }
- fs->wflag = 1;
- }
-
- return res;
-}
-#endif /* !_FS_READONLY */
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* FAT handling - Remove a cluster chain */
-/*-----------------------------------------------------------------------*/
-#if !_FS_READONLY
-static
-FRESULT remove_chain (
- FATFS *fs, /* File system object */
- DWORD clst /* Cluster# to remove a chain from */
-)
-{
- FRESULT res;
- DWORD nxt;
-#if _USE_ERASE
- DWORD scl = clst, ecl = clst, rt[2];
-#endif
-
- if (clst < 2 || clst >= fs->n_fatent) { /* Check range */
- res = FR_INT_ERR;
-
- } else {
- res = FR_OK;
- while (clst < fs->n_fatent) { /* Not a last link? */
- nxt = get_fat(fs, clst); /* Get cluster status */
- if (nxt == 0) break; /* Empty cluster? */
- if (nxt == 1) { res = FR_INT_ERR; break; } /* Internal error? */
- if (nxt == 0xFFFFFFFF) { res = FR_DISK_ERR; break; } /* Disk error? */
- res = put_fat(fs, clst, 0); /* Mark the cluster "empty" */
- if (res != FR_OK) break;
- if (fs->free_clust != 0xFFFFFFFF) { /* Update FSInfo */
- fs->free_clust++;
- fs->fsi_flag = 1;
- }
-#if _USE_ERASE
- if (ecl + 1 == nxt) { /* Is next cluster contiguous? */
- ecl = nxt;
- } else { /* End of contiguous clusters */
- rt[0] = clust2sect(fs, scl); /* Start sector */
- rt[1] = clust2sect(fs, ecl) + fs->csize - 1; /* End sector */
- disk_ioctl(fs->drv, CTRL_ERASE_SECTOR, rt); /* Erase the block */
- scl = ecl = nxt;
- }
-#endif
- clst = nxt; /* Next cluster */
- }
- }
-
- return res;
-}
-#endif
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* FAT handling - Stretch or Create a cluster chain */
-/*-----------------------------------------------------------------------*/
-#if !_FS_READONLY
-static
-DWORD create_chain ( /* 0:No free cluster, 1:Internal error, 0xFFFFFFFF:Disk error, >=2:New cluster# */
- FATFS *fs, /* File system object */
- DWORD clst /* Cluster# to stretch. 0 means create a new chain. */
-)
-{
- DWORD cs, ncl, scl;
- FRESULT res;
-
-
- if (clst == 0) { /* Create a new chain */
- scl = fs->last_clust; /* Get suggested start point */
- if (!scl || scl >= fs->n_fatent) scl = 1;
- }
- else { /* Stretch the current chain */
- cs = get_fat(fs, clst); /* Check the cluster status */
- if (cs < 2) return 1; /* It is an invalid cluster */
- if (cs < fs->n_fatent) return cs; /* It is already followed by next cluster */
- scl = clst;
- }
-
- ncl = scl; /* Start cluster */
- for (;;) {
- ncl++; /* Next cluster */
- if (ncl >= fs->n_fatent) { /* Wrap around */
- ncl = 2;
- if (ncl > scl) return 0; /* No free cluster */
- }
- cs = get_fat(fs, ncl); /* Get the cluster status */
- if (cs == 0) break; /* Found a free cluster */
- if (cs == 0xFFFFFFFF || cs == 1)/* An error occurred */
- return cs;
- if (ncl == scl) return 0; /* No free cluster */
- }
-
- res = put_fat(fs, ncl, 0x0FFFFFFF); /* Mark the new cluster "last link" */
- if (res == FR_OK && clst != 0) {
- res = put_fat(fs, clst, ncl); /* Link it to the previous one if needed */
- }
- if (res == FR_OK) {
- fs->last_clust = ncl; /* Update FSINFO */
- if (fs->free_clust != 0xFFFFFFFF) {
- fs->free_clust--;
- fs->fsi_flag = 1;
- }
- } else {
- ncl = (res == FR_DISK_ERR) ? 0xFFFFFFFF : 1;
- }
-
- return ncl; /* Return new cluster number or error code */
-}
-#endif /* !_FS_READONLY */
-
-
-
-/*-----------------------------------------------------------------------*/
-/* FAT handling - Convert offset into cluster with link map table */
-/*-----------------------------------------------------------------------*/
-
-#if _USE_FASTSEEK
-static
-DWORD clmt_clust ( /* <2:Error, >=2:Cluster number */
- FIL* fp, /* Pointer to the file object */
- DWORD ofs /* File offset to be converted to cluster# */
-)
-{
- DWORD cl, ncl, *tbl;
-
-
- tbl = fp->cltbl + 1; /* Top of CLMT */
- cl = ofs / SS(fp->fs) / fp->fs->csize; /* Cluster order from top of the file */
- for (;;) {
- ncl = *tbl++; /* Number of cluters in the fragment */
- if (!ncl) return 0; /* End of table? (error) */
- if (cl < ncl) break; /* In this fragment? */
- cl -= ncl; tbl++; /* Next fragment */
- }
- return cl + *tbl; /* Return the cluster number */
-}
-#endif /* _USE_FASTSEEK */
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Directory handling - Set directory index */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT dir_sdi (
- DIR *dj, /* Pointer to directory object */
- WORD idx /* Index of directory table */
-)
-{
- DWORD clst;
- WORD ic;
-
-
- dj->index = idx;
- clst = dj->sclust;
- if (clst == 1 || clst >= dj->fs->n_fatent) /* Check start cluster range */
- return FR_INT_ERR;
- if (!clst && dj->fs->fs_type == FS_FAT32) /* Replace cluster# 0 with root cluster# if in FAT32 */
- clst = dj->fs->dirbase;
-
- if (clst == 0) { /* Static table (root-dir in FAT12/16) */
- dj->clust = clst;
- if (idx >= dj->fs->n_rootdir) /* Index is out of range */
- return FR_INT_ERR;
- dj->sect = dj->fs->dirbase + idx / (SS(dj->fs) / SZ_DIR); /* Sector# */
- }
- else { /* Dynamic table (sub-dirs or root-dir in FAT32) */
- ic = SS(dj->fs) / SZ_DIR * dj->fs->csize; /* Entries per cluster */
- while (idx >= ic) { /* Follow cluster chain */
- clst = get_fat(dj->fs, clst); /* Get next cluster */
- if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */
- if (clst < 2 || clst >= dj->fs->n_fatent) /* Reached to end of table or int error */
- return FR_INT_ERR;
- idx -= ic;
- }
- dj->clust = clst;
- dj->sect = clust2sect(dj->fs, clst) + idx / (SS(dj->fs) / SZ_DIR); /* Sector# */
- }
-
- dj->dir = dj->fs->win + (idx % (SS(dj->fs) / SZ_DIR)) * SZ_DIR; /* Ptr to the entry in the sector */
-
- return FR_OK; /* Seek succeeded */
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Directory handling - Move directory table index next */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT dir_next ( /* FR_OK:Succeeded, FR_NO_FILE:End of table, FR_DENIED:Could not stretch */
- DIR *dj, /* Pointer to the directory object */
- int stretch /* 0: Do not stretch table, 1: Stretch table if needed */
-)
-{
- DWORD clst;
- WORD i;
-
-
- stretch = stretch; /* To suppress warning on read-only cfg. */
- i = dj->index + 1;
- if (!i || !dj->sect) /* Report EOT when index has reached 65535 */
- return FR_NO_FILE;
-
- if (!(i % (SS(dj->fs) / SZ_DIR))) { /* Sector changed? */
- dj->sect++; /* Next sector */
-
- if (dj->clust == 0) { /* Static table */
- if (i >= dj->fs->n_rootdir) /* Report EOT when end of table */
- return FR_NO_FILE;
- }
- else { /* Dynamic table */
- if (((i / (SS(dj->fs) / SZ_DIR)) & (dj->fs->csize - 1)) == 0) { /* Cluster changed? */
- clst = get_fat(dj->fs, dj->clust); /* Get next cluster */
- if (clst <= 1) return FR_INT_ERR;
- if (clst == 0xFFFFFFFF) return FR_DISK_ERR;
- if (clst >= dj->fs->n_fatent) { /* When it reached end of dynamic table */
-#if !_FS_READONLY
- BYTE c;
- if (!stretch) return FR_NO_FILE; /* When do not stretch, report EOT */
- clst = create_chain(dj->fs, dj->clust); /* Stretch cluster chain */
- if (clst == 0) return FR_DENIED; /* No free cluster */
- if (clst == 1) return FR_INT_ERR;
- if (clst == 0xFFFFFFFF) return FR_DISK_ERR;
- /* Clean-up stretched table */
- if (sync_window(dj->fs)) return FR_DISK_ERR; /* Flush active window */
- mem_set(dj->fs->win, 0, SS(dj->fs)); /* Clear window buffer */
- dj->fs->winsect = clust2sect(dj->fs, clst); /* Cluster start sector */
- for (c = 0; c < dj->fs->csize; c++) { /* Fill the new cluster with 0 */
- dj->fs->wflag = 1;
- if (sync_window(dj->fs)) return FR_DISK_ERR;
- dj->fs->winsect++;
- }
- dj->fs->winsect -= c; /* Rewind window address */
-#else
- return FR_NO_FILE; /* Report EOT */
-#endif
- }
- dj->clust = clst; /* Initialize data for new cluster */
- dj->sect = clust2sect(dj->fs, clst);
- }
- }
- }
-
- dj->index = i;
- dj->dir = dj->fs->win + (i % (SS(dj->fs) / SZ_DIR)) * SZ_DIR;
-
- return FR_OK;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Directory handling - Reserve directory entry */
-/*-----------------------------------------------------------------------*/
-
-#if !_FS_READONLY
-static
-FRESULT dir_alloc (
- DIR* dj, /* Pointer to the directory object */
- UINT nent /* Number of contiguous entries to allocate (1-21) */
-)
-{
- FRESULT res;
- UINT n;
-
-
- res = dir_sdi(dj, 0);
- if (res == FR_OK) {
- n = 0;
- do {
- res = move_window(dj->fs, dj->sect);
- if (res != FR_OK) break;
- if (dj->dir[0] == DDE || dj->dir[0] == 0) { /* Is it a blank entry? */
- if (++n == nent) break; /* A block of contiguous entry is found */
- } else {
- n = 0; /* Not a blank entry. Restart to search */
- }
- res = dir_next(dj, 1); /* Next entry with table stretch enabled */
- } while (res == FR_OK);
- }
- return res;
-}
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Directory handling - Load/Store start cluster number */
-/*-----------------------------------------------------------------------*/
-
-static
-DWORD ld_clust (
- FATFS *fs, /* Pointer to the fs object */
- BYTE *dir /* Pointer to the directory entry */
-)
-{
- DWORD cl;
-
- cl = LD_WORD(dir+DIR_FstClusLO);
- if (fs->fs_type == FS_FAT32)
- cl |= (DWORD)LD_WORD(dir+DIR_FstClusHI) << 16;
-
- return cl;
-}
-
-
-#if !_FS_READONLY
-static
-void st_clust (
- BYTE *dir, /* Pointer to the directory entry */
- DWORD cl /* Value to be set */
-)
-{
- ST_WORD(dir+DIR_FstClusLO, cl);
- ST_WORD(dir+DIR_FstClusHI, cl >> 16);
-}
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* LFN handling - Test/Pick/Fit an LFN segment from/to directory entry */
-/*-----------------------------------------------------------------------*/
-#if _USE_LFN
-static
-const BYTE LfnOfs[] = {1,3,5,7,9,14,16,18,20,22,24,28,30}; /* Offset of LFN chars in the directory entry */
-
-
-static
-int cmp_lfn ( /* 1:Matched, 0:Not matched */
- WCHAR *lfnbuf, /* Pointer to the LFN to be compared */
- BYTE *dir /* Pointer to the directory entry containing a part of LFN */
-)
-{
- UINT i, s;
- WCHAR wc, uc;
-
-
- i = ((dir[LDIR_Ord] & ~LLE) - 1) * 13; /* Get offset in the LFN buffer */
- s = 0; wc = 1;
- do {
- uc = LD_WORD(dir+LfnOfs[s]); /* Pick an LFN character from the entry */
- if (wc) { /* Last char has not been processed */
- wc = ff_wtoupper(uc); /* Convert it to upper case */
- if (i >= _MAX_LFN || wc != ff_wtoupper(lfnbuf[i++])) /* Compare it */
- return 0; /* Not matched */
- } else {
- if (uc != 0xFFFF) return 0; /* Check filler */
- }
- } while (++s < 13); /* Repeat until all chars in the entry are checked */
-
- if ((dir[LDIR_Ord] & LLE) && wc && lfnbuf[i]) /* Last segment matched but different length */
- return 0;
-
- return 1; /* The part of LFN matched */
-}
-
-
-
-static
-int pick_lfn ( /* 1:Succeeded, 0:Buffer overflow */
- WCHAR *lfnbuf, /* Pointer to the Unicode-LFN buffer */
- BYTE *dir /* Pointer to the directory entry */
-)
-{
- UINT i, s;
- WCHAR wc, uc;
-
-
- i = ((dir[LDIR_Ord] & 0x3F) - 1) * 13; /* Offset in the LFN buffer */
-
- s = 0; wc = 1;
- do {
- uc = LD_WORD(dir+LfnOfs[s]); /* Pick an LFN character from the entry */
- if (wc) { /* Last char has not been processed */
- if (i >= _MAX_LFN) return 0; /* Buffer overflow? */
- lfnbuf[i++] = wc = uc; /* Store it */
- } else {
- if (uc != 0xFFFF) return 0; /* Check filler */
- }
- } while (++s < 13); /* Read all character in the entry */
-
- if (dir[LDIR_Ord] & LLE) { /* Put terminator if it is the last LFN part */
- if (i >= _MAX_LFN) return 0; /* Buffer overflow? */
- lfnbuf[i] = 0;
- }
-
- return 1;
-}
-
-
-#if !_FS_READONLY
-static
-void fit_lfn (
- const WCHAR *lfnbuf, /* Pointer to the LFN buffer */
- BYTE *dir, /* Pointer to the directory entry */
- BYTE ord, /* LFN order (1-20) */
- BYTE sum /* SFN sum */
-)
-{
- UINT i, s;
- WCHAR wc;
-
-
- dir[LDIR_Chksum] = sum; /* Set check sum */
- dir[LDIR_Attr] = AM_LFN; /* Set attribute. LFN entry */
- dir[LDIR_Type] = 0;
- ST_WORD(dir+LDIR_FstClusLO, 0);
-
- i = (ord - 1) * 13; /* Get offset in the LFN buffer */
- s = wc = 0;
- do {
- if (wc != 0xFFFF) wc = lfnbuf[i++]; /* Get an effective char */
- ST_WORD(dir+LfnOfs[s], wc); /* Put it */
- if (!wc) wc = 0xFFFF; /* Padding chars following last char */
- } while (++s < 13);
- if (wc == 0xFFFF || !lfnbuf[i]) ord |= LLE; /* Bottom LFN part is the start of LFN sequence */
- dir[LDIR_Ord] = ord; /* Set the LFN order */
-}
-
-#endif
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Create numbered name */
-/*-----------------------------------------------------------------------*/
-#if _USE_LFN
-void gen_numname (
- BYTE *dst, /* Pointer to generated SFN */
- const BYTE *src, /* Pointer to source SFN to be modified */
- const WCHAR *lfn, /* Pointer to LFN */
- WORD seq /* Sequence number */
-)
-{
- BYTE ns[8], c;
- UINT i, j;
-
-
- mem_cpy(dst, src, 11);
-
- if (seq > 5) { /* On many collisions, generate a hash number instead of sequential number */
- do seq = (seq >> 1) + (seq << 15) + (WORD)*lfn++; while (*lfn);
- }
-
- /* itoa (hexdecimal) */
- i = 7;
- do {
- c = (seq % 16) + '0';
- if (c > '9') c += 7;
- ns[i--] = c;
- seq /= 16;
- } while (seq);
- ns[i] = '~';
-
- /* Append the number */
- for (j = 0; j < i && dst[j] != ' '; j++) {
- if (IsDBCS1(dst[j])) {
- if (j == i - 1) break;
- j++;
- }
- }
- do {
- dst[j++] = (i < 8) ? ns[i++] : ' ';
- } while (j < 8);
-}
-#endif
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Calculate sum of an SFN */
-/*-----------------------------------------------------------------------*/
-#if _USE_LFN
-static
-BYTE sum_sfn (
- const BYTE *dir /* Ptr to directory entry */
-)
-{
- BYTE sum = 0;
- UINT n = 11;
-
- do sum = (sum >> 1) + (sum << 7) + *dir++; while (--n);
- return sum;
-}
-#endif
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Directory handling - Find an object in the directory */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT dir_find (
- DIR *dj /* Pointer to the directory object linked to the file name */
-)
-{
- FRESULT res;
- BYTE c, *dir;
-#if _USE_LFN
- BYTE a, ord, sum;
-#endif
-
- res = dir_sdi(dj, 0); /* Rewind directory object */
- if (res != FR_OK) return res;
-
-#if _USE_LFN
- ord = sum = 0xFF;
-#endif
- do {
- res = move_window(dj->fs, dj->sect);
- if (res != FR_OK) break;
- dir = dj->dir; /* Ptr to the directory entry of current index */
- c = dir[DIR_Name];
- if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */
-#if _USE_LFN /* LFN configuration */
- a = dir[DIR_Attr] & AM_MASK;
- if (c == DDE || ((a & AM_VOL) && a != AM_LFN)) { /* An entry without valid data */
- ord = 0xFF;
- } else {
- if (a == AM_LFN) { /* An LFN entry is found */
- if (dj->lfn) {
- if (c & LLE) { /* Is it start of LFN sequence? */
- sum = dir[LDIR_Chksum];
- c &= ~LLE; ord = c; /* LFN start order */
- dj->lfn_idx = dj->index;
- }
- /* Check validity of the LFN entry and compare it with given name */
- ord = (c == ord && sum == dir[LDIR_Chksum] && cmp_lfn(dj->lfn, dir)) ? ord - 1 : 0xFF;
- }
- } else { /* An SFN entry is found */
- if (!ord && sum == sum_sfn(dir)) break; /* LFN matched? */
- ord = 0xFF; dj->lfn_idx = 0xFFFF; /* Reset LFN sequence */
- if (!(dj->fn[NS] & NS_LOSS) && !mem_cmp(dir, dj->fn, 11)) break; /* SFN matched? */
- }
- }
-#else /* Non LFN configuration */
- if (!(dir[DIR_Attr] & AM_VOL) && !mem_cmp(dir, dj->fn, 11)) /* Is it a valid entry? */
- break;
-#endif
- res = dir_next(dj, 0); /* Next entry */
- } while (res == FR_OK);
-
- return res;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Read an object from the directory */
-/*-----------------------------------------------------------------------*/
-#if _FS_MINIMIZE <= 1 || _USE_LABEL || _FS_RPATH >= 2
-static
-FRESULT dir_read (
- DIR *dj, /* Pointer to the directory object */
- int vol /* Filtered by 0:file/dir or 1:volume label */
-)
-{
- FRESULT res;
- BYTE a, c, *dir;
-#if _USE_LFN
- BYTE ord = 0xFF, sum = 0xFF;
-#endif
-
- res = FR_NO_FILE;
- while (dj->sect) {
- res = move_window(dj->fs, dj->sect);
- if (res != FR_OK) break;
- dir = dj->dir; /* Ptr to the directory entry of current index */
- c = dir[DIR_Name];
- if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */
- a = dir[DIR_Attr] & AM_MASK;
-#if _USE_LFN /* LFN configuration */
- if (c == DDE || (!_FS_RPATH && c == '.') || (a == AM_VOL) != vol) { /* An entry without valid data */
- ord = 0xFF;
- } else {
- if (a == AM_LFN) { /* An LFN entry is found */
- if (c & LLE) { /* Is it start of LFN sequence? */
- sum = dir[LDIR_Chksum];
- c &= ~LLE; ord = c;
- dj->lfn_idx = dj->index;
- }
- /* Check LFN validity and capture it */
- ord = (c == ord && sum == dir[LDIR_Chksum] && pick_lfn(dj->lfn, dir)) ? ord - 1 : 0xFF;
- } else { /* An SFN entry is found */
- if (ord || sum != sum_sfn(dir)) /* Is there a valid LFN? */
- dj->lfn_idx = 0xFFFF; /* It has no LFN. */
- break;
- }
- }
-#else /* Non LFN configuration */
- if (c != DDE && (_FS_RPATH || c != '.') && a != AM_LFN && (a == AM_VOL) == vol) /* Is it a valid entry? */
- break;
-#endif
- res = dir_next(dj, 0); /* Next entry */
- if (res != FR_OK) break;
- }
-
- if (res != FR_OK) dj->sect = 0;
-
- return res;
-}
-#endif /* _FS_MINIMIZE <= 1 || _USE_LABEL || _FS_RPATH >= 2 */
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Register an object to the directory */
-/*-----------------------------------------------------------------------*/
-#if !_FS_READONLY
-static
-FRESULT dir_register ( /* FR_OK:Successful, FR_DENIED:No free entry or too many SFN collision, FR_DISK_ERR:Disk error */
- DIR *dj /* Target directory with object name to be created */
-)
-{
- FRESULT res;
-#if _USE_LFN /* LFN configuration */
- WORD n, ne;
- BYTE sn[12], *fn, sum;
- WCHAR *lfn;
-
-
- fn = dj->fn; lfn = dj->lfn;
- mem_cpy(sn, fn, 12);
-
- if (_FS_RPATH && (sn[NS] & NS_DOT)) /* Cannot create dot entry */
- return FR_INVALID_NAME;
-
- if (sn[NS] & NS_LOSS) { /* When LFN is out of 8.3 format, generate a numbered name */
- fn[NS] = 0; dj->lfn = 0; /* Find only SFN */
- for (n = 1; n < 100; n++) {
- gen_numname(fn, sn, lfn, n); /* Generate a numbered name */
- res = dir_find(dj); /* Check if the name collides with existing SFN */
- if (res != FR_OK) break;
- }
- if (n == 100) return FR_DENIED; /* Abort if too many collisions */
- if (res != FR_NO_FILE) return res; /* Abort if the result is other than 'not collided' */
- fn[NS] = sn[NS]; dj->lfn = lfn;
- }
-
- if (sn[NS] & NS_LFN) { /* When LFN is to be created, allocate entries for an SFN + LFNs. */
- for (n = 0; lfn[n]; n++) ;
- ne = (n + 25) / 13;
- } else { /* Otherwise allocate an entry for an SFN */
- ne = 1;
- }
- res = dir_alloc(dj, ne); /* Allocate entries */
-
- if (res == FR_OK && --ne) { /* Set LFN entry if needed */
- res = dir_sdi(dj, (WORD)(dj->index - ne));
- if (res == FR_OK) {
- sum = sum_sfn(dj->fn); /* Sum value of the SFN tied to the LFN */
- do { /* Store LFN entries in bottom first */
- res = move_window(dj->fs, dj->sect);
- if (res != FR_OK) break;
- fit_lfn(dj->lfn, dj->dir, (BYTE)ne, sum);
- dj->fs->wflag = 1;
- res = dir_next(dj, 0); /* Next entry */
- } while (res == FR_OK && --ne);
- }
- }
-#else /* Non LFN configuration */
- res = dir_alloc(dj, 1); /* Allocate an entry for SFN */
-#endif
-
- if (res == FR_OK) { /* Set SFN entry */
- res = move_window(dj->fs, dj->sect);
- if (res == FR_OK) {
- mem_set(dj->dir, 0, SZ_DIR); /* Clean the entry */
- mem_cpy(dj->dir, dj->fn, 11); /* Put SFN */
-#if _USE_LFN
- dj->dir[DIR_NTres] = *(dj->fn+NS) & (NS_BODY | NS_EXT); /* Put NT flag */
-#endif
- dj->fs->wflag = 1;
- }
- }
-
- return res;
-}
-#endif /* !_FS_READONLY */
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Remove an object from the directory */
-/*-----------------------------------------------------------------------*/
-#if !_FS_READONLY && !_FS_MINIMIZE
-static
-FRESULT dir_remove ( /* FR_OK: Successful, FR_DISK_ERR: A disk error */
- DIR *dj /* Directory object pointing the entry to be removed */
-)
-{
- FRESULT res;
-#if _USE_LFN /* LFN configuration */
- WORD i;
-
- i = dj->index; /* SFN index */
- res = dir_sdi(dj, (WORD)((dj->lfn_idx == 0xFFFF) ? i : dj->lfn_idx)); /* Goto the SFN or top of the LFN entries */
- if (res == FR_OK) {
- do {
- res = move_window(dj->fs, dj->sect);
- if (res != FR_OK) break;
- *dj->dir = DDE; /* Mark the entry "deleted" */
- dj->fs->wflag = 1;
- if (dj->index >= i) break; /* When reached SFN, all entries of the object has been deleted. */
- res = dir_next(dj, 0); /* Next entry */
- } while (res == FR_OK);
- if (res == FR_NO_FILE) res = FR_INT_ERR;
- }
-
-#else /* Non LFN configuration */
- res = dir_sdi(dj, dj->index);
- if (res == FR_OK) {
- res = move_window(dj->fs, dj->sect);
- if (res == FR_OK) {
- *dj->dir = DDE; /* Mark the entry "deleted" */
- dj->fs->wflag = 1;
- }
- }
-#endif
-
- return res;
-}
-#endif /* !_FS_READONLY */
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Pick a segment and create the object name in directory form */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT create_name (
- DIR *dj, /* Pointer to the directory object */
- const TCHAR **path /* Pointer to pointer to the segment in the path string */
-)
-{
-#if _USE_LFN /* LFN configuration */
- BYTE b, cf;
- WCHAR w, *lfn;
- UINT i, ni, si, di;
- const TCHAR *p;
-
- /* Create LFN in Unicode */
- for (p = *path; *p == '/' || *p == '\\'; p++) ; /* Strip duplicated separator */
- lfn = dj->lfn;
- si = di = 0;
- for (;;) {
- w = p[si++]; /* Get a character */
- if (w < ' ' || w == '/' || w == '\\') break; /* Break on end of segment */
- if (di >= _MAX_LFN) /* Reject too long name */
- return FR_INVALID_NAME;
-#if !_LFN_UNICODE
- w &= 0xFF;
- if (IsDBCS1(w)) { /* Check if it is a DBC 1st byte (always false on SBCS cfg) */
- b = (BYTE)p[si++]; /* Get 2nd byte */
- if (!IsDBCS2(b))
- return FR_INVALID_NAME; /* Reject invalid sequence */
- w = (w << 8) + b; /* Create a DBC */
- }
- w = ff_convert(w, 1); /* Convert ANSI/OEM to Unicode */
- if (!w) return FR_INVALID_NAME; /* Reject invalid code */
-#endif
- if (w < 0x80 && chk_chr("\"*:<>\?|\x7F", w)) /* Reject illegal chars for LFN */
- return FR_INVALID_NAME;
- lfn[di++] = w; /* Store the Unicode char */
- }
- *path = &p[si]; /* Return pointer to the next segment */
- cf = (w < ' ') ? NS_LAST : 0; /* Set last segment flag if end of path */
-#if _FS_RPATH
- if ((di == 1 && lfn[di-1] == '.') || /* Is this a dot entry? */
- (di == 2 && lfn[di-1] == '.' && lfn[di-2] == '.')) {
- lfn[di] = 0;
- for (i = 0; i < 11; i++)
- dj->fn[i] = (i < di) ? '.' : ' ';
- dj->fn[i] = cf | NS_DOT; /* This is a dot entry */
- return FR_OK;
- }
-#endif
- while (di) { /* Strip trailing spaces and dots */
- w = lfn[di-1];
- if (w != ' ' && w != '.') break;
- di--;
- }
- if (!di) return FR_INVALID_NAME; /* Reject nul string */
-
- lfn[di] = 0; /* LFN is created */
-
- /* Create SFN in directory form */
- mem_set(dj->fn, ' ', 11);
- for (si = 0; lfn[si] == ' ' || lfn[si] == '.'; si++) ; /* Strip leading spaces and dots */
- if (si) cf |= NS_LOSS | NS_LFN;
- while (di && lfn[di - 1] != '.') di--; /* Find extension (di<=si: no extension) */
-
- b = i = 0; ni = 8;
- for (;;) {
- w = lfn[si++]; /* Get an LFN char */
- if (!w) break; /* Break on end of the LFN */
- if (w == ' ' || (w == '.' && si != di)) { /* Remove spaces and dots */
- cf |= NS_LOSS | NS_LFN; continue;
- }
-
- if (i >= ni || si == di) { /* Extension or end of SFN */
- if (ni == 11) { /* Long extension */
- cf |= NS_LOSS | NS_LFN; break;
- }
- if (si != di) cf |= NS_LOSS | NS_LFN; /* Out of 8.3 format */
- if (si > di) break; /* No extension */
- si = di; i = 8; ni = 11; /* Enter extension section */
- b <<= 2; continue;
- }
-
- if (w >= 0x80) { /* Non ASCII char */
-#ifdef _EXCVT
- w = ff_convert(w, 0); /* Unicode -> OEM code */
- if (w) w = ExCvt[w - 0x80]; /* Convert extended char to upper (SBCS) */
-#else
- w = ff_convert(ff_wtoupper(w), 0); /* Upper converted Unicode -> OEM code */
-#endif
- cf |= NS_LFN; /* Force create LFN entry */
- }
-
- if (_DF1S && w >= 0x100) { /* Double byte char (always false on SBCS cfg) */
- if (i >= ni - 1) {
- cf |= NS_LOSS | NS_LFN; i = ni; continue;
- }
- dj->fn[i++] = (BYTE)(w >> 8);
- } else { /* Single byte char */
- if (!w || chk_chr("+,;=[]", w)) { /* Replace illegal chars for SFN */
- w = '_'; cf |= NS_LOSS | NS_LFN;/* Lossy conversion */
- } else {
- if (IsUpper(w)) { /* ASCII large capital */
- b |= 2;
- } else {
- if (IsLower(w)) { /* ASCII small capital */
- b |= 1; w -= 0x20;
- }
- }
- }
- }
- dj->fn[i++] = (BYTE)w;
- }
-
- if (dj->fn[0] == DDE) dj->fn[0] = NDDE; /* If the first char collides with deleted mark, replace it with 0x05 */
-
- if (ni == 8) b <<= 2;
- if ((b & 0x0C) == 0x0C || (b & 0x03) == 0x03) /* Create LFN entry when there are composite capitals */
- cf |= NS_LFN;
- if (!(cf & NS_LFN)) { /* When LFN is in 8.3 format without extended char, NT flags are created */
- if ((b & 0x03) == 0x01) cf |= NS_EXT; /* NT flag (Extension has only small capital) */
- if ((b & 0x0C) == 0x04) cf |= NS_BODY; /* NT flag (Filename has only small capital) */
- }
-
- dj->fn[NS] = cf; /* SFN is created */
-
- return FR_OK;
-
-
-#else /* Non-LFN configuration */
- BYTE b, c, d, *sfn;
- UINT ni, si, i;
- const char *p;
-
- /* Create file name in directory form */
- for (p = *path; *p == '/' || *p == '\\'; p++) ; /* Strip duplicated separator */
- sfn = dj->fn;
- mem_set(sfn, ' ', 11);
- si = i = b = 0; ni = 8;
-#if _FS_RPATH
- if (p[si] == '.') { /* Is this a dot entry? */
- for (;;) {
- c = (BYTE)p[si++];
- if (c != '.' || si >= 3) break;
- sfn[i++] = c;
- }
- if (c != '/' && c != '\\' && c > ' ') return FR_INVALID_NAME;
- *path = &p[si]; /* Return pointer to the next segment */
- sfn[NS] = (c <= ' ') ? NS_LAST | NS_DOT : NS_DOT; /* Set last segment flag if end of path */
- return FR_OK;
- }
-#endif
- for (;;) {
- c = (BYTE)p[si++];
- if (c <= ' ' || c == '/' || c == '\\') break; /* Break on end of segment */
- if (c == '.' || i >= ni) {
- if (ni != 8 || c != '.') return FR_INVALID_NAME;
- i = 8; ni = 11;
- b <<= 2; continue;
- }
- if (c >= 0x80) { /* Extended char? */
- b |= 3; /* Eliminate NT flag */
-#ifdef _EXCVT
- c = ExCvt[c - 0x80]; /* To upper extended chars (SBCS cfg) */
-#else
-#if !_DF1S
- return FR_INVALID_NAME; /* Reject extended chars (ASCII cfg) */
-#endif
-#endif
- }
- if (IsDBCS1(c)) { /* Check if it is a DBC 1st byte (always false on SBCS cfg) */
- d = (BYTE)p[si++]; /* Get 2nd byte */
- if (!IsDBCS2(d) || i >= ni - 1) /* Reject invalid DBC */
- return FR_INVALID_NAME;
- sfn[i++] = c;
- sfn[i++] = d;
- } else { /* Single byte code */
- if (chk_chr("\"*+,:;<=>\?[]|\x7F", c)) /* Reject illegal chrs for SFN */
- return FR_INVALID_NAME;
- if (IsUpper(c)) { /* ASCII large capital? */
- b |= 2;
- } else {
- if (IsLower(c)) { /* ASCII small capital? */
- b |= 1; c -= 0x20;
- }
- }
- sfn[i++] = c;
- }
- }
- *path = &p[si]; /* Return pointer to the next segment */
- c = (c <= ' ') ? NS_LAST : 0; /* Set last segment flag if end of path */
-
- if (!i) return FR_INVALID_NAME; /* Reject nul string */
- if (sfn[0] == DDE) sfn[0] = NDDE; /* When first char collides with DDE, replace it with 0x05 */
-
- if (ni == 8) b <<= 2;
- if ((b & 0x03) == 0x01) c |= NS_EXT; /* NT flag (Name extension has only small capital) */
- if ((b & 0x0C) == 0x04) c |= NS_BODY; /* NT flag (Name body has only small capital) */
-
- sfn[NS] = c; /* Store NT flag, File name is created */
-
- return FR_OK;
-#endif
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Get file information from directory entry */
-/*-----------------------------------------------------------------------*/
-#if _FS_MINIMIZE <= 1 || _FS_RPATH >= 2
-static
-void get_fileinfo ( /* No return code */
- DIR *dj, /* Pointer to the directory object */
- FILINFO *fno /* Pointer to the file information to be filled */
-)
-{
- UINT i;
- BYTE nt, *dir;
- TCHAR *p, c;
-
-
- p = fno->fname;
- if (dj->sect) {
- dir = dj->dir;
- nt = dir[DIR_NTres]; /* NT flag */
- for (i = 0; i < 8; i++) { /* Copy name body */
- c = dir[i];
- if (c == ' ') break;
- if (c == NDDE) c = (TCHAR)DDE;
- if (_USE_LFN && (nt & NS_BODY) && IsUpper(c)) c += 0x20;
-#if _LFN_UNICODE
- if (IsDBCS1(c) && i < 7 && IsDBCS2(dir[i+1]))
- c = (c << 8) | dir[++i];
- c = ff_convert(c, 1);
- if (!c) c = '?';
-#endif
- *p++ = c;
- }
- if (dir[8] != ' ') { /* Copy name extension */
- *p++ = '.';
- for (i = 8; i < 11; i++) {
- c = dir[i];
- if (c == ' ') break;
- if (_USE_LFN && (nt & NS_EXT) && IsUpper(c)) c += 0x20;
-#if _LFN_UNICODE
- if (IsDBCS1(c) && i < 10 && IsDBCS2(dir[i+1]))
- c = (c << 8) | dir[++i];
- c = ff_convert(c, 1);
- if (!c) c = '?';
-#endif
- *p++ = c;
- }
- }
- fno->fattrib = dir[DIR_Attr]; /* Attribute */
- fno->fsize = LD_DWORD(dir+DIR_FileSize); /* Size */
- fno->fdate = LD_WORD(dir+DIR_WrtDate); /* Date */
- fno->ftime = LD_WORD(dir+DIR_WrtTime); /* Time */
- }
- *p = 0; /* Terminate SFN str by a \0 */
-
-#if _USE_LFN
- if (fno->lfname && fno->lfsize) {
- TCHAR *tp = fno->lfname;
- WCHAR w, *lfn;
-
- i = 0;
- if (dj->sect && dj->lfn_idx != 0xFFFF) {/* Get LFN if available */
- lfn = dj->lfn;
- while ((w = *lfn++) != 0) { /* Get an LFN char */
-#if !_LFN_UNICODE
- w = ff_convert(w, 0); /* Unicode -> OEM conversion */
- if (!w) { i = 0; break; } /* Could not convert, no LFN */
- if (_DF1S && w >= 0x100) /* Put 1st byte if it is a DBC (always false on SBCS cfg) */
- tp[i++] = (TCHAR)(w >> 8);
-#endif
- if (i >= fno->lfsize - 1) { i = 0; break; } /* Buffer overflow, no LFN */
- tp[i++] = (TCHAR)w;
- }
- }
- tp[i] = 0; /* Terminate the LFN str by a \0 */
- }
-#endif
-}
-#endif /* _FS_MINIMIZE <= 1 || _FS_RPATH >= 2*/
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Follow a file path */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */
- DIR *dj, /* Directory object to return last directory and found object */
- const TCHAR *path /* Full-path string to find a file or directory */
-)
-{
- FRESULT res;
- BYTE *dir, ns;
-
-
-#if _FS_RPATH
- if (*path == '/' || *path == '\\') { /* There is a heading separator */
- path++; dj->sclust = 0; /* Strip it and start from the root dir */
- } else { /* No heading separator */
- dj->sclust = dj->fs->cdir; /* Start from the current dir */
- }
-#else
- if (*path == '/' || *path == '\\') /* Strip heading separator if exist */
- path++;
- dj->sclust = 0; /* Start from the root dir */
-#endif
-
- if ((UINT)*path < ' ') { /* Nul path means the start directory itself */
- res = dir_sdi(dj, 0);
- dj->dir = 0;
- } else { /* Follow path */
- for (;;) {
- res = create_name(dj, &path); /* Get a segment */
- if (res != FR_OK) break;
- res = dir_find(dj); /* Find it */
- ns = *(dj->fn+NS);
- if (res != FR_OK) { /* Failed to find the object */
- if (res != FR_NO_FILE) break; /* Abort if any hard error occurred */
- /* Object not found */
- if (_FS_RPATH && (ns & NS_DOT)) { /* If dot entry is not exit */
- dj->sclust = 0; dj->dir = 0; /* It is the root dir */
- res = FR_OK;
- if (!(ns & NS_LAST)) continue;
- } else { /* Could not find the object */
- if (!(ns & NS_LAST)) res = FR_NO_PATH;
- }
- break;
- }
- if (ns & NS_LAST) break; /* Last segment match. Function completed. */
- dir = dj->dir; /* There is next segment. Follow the sub directory */
- if (!(dir[DIR_Attr] & AM_DIR)) { /* Cannot follow because it is a file */
- res = FR_NO_PATH; break;
- }
- dj->sclust = ld_clust(dj->fs, dir);
- }
- }
-
- return res;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Load a sector and check if it is an FAT Volume Boot Record */
-/*-----------------------------------------------------------------------*/
-
-static
-BYTE check_fs ( /* 0:FAT-VBR, 1:Any BR but not FAT, 2:Not a BR, 3:Disk error */
- FATFS *fs, /* File system object */
- DWORD sect /* Sector# (lba) to check if it is an FAT boot record or not */
-)
-{
- if (disk_read(fs->drv, fs->win, sect, 1) != RES_OK) /* Load boot record */
- return 3;
- if (LD_WORD(&fs->win[BS_55AA]) != 0xAA55) /* Check record signature (always placed at offset 510 even if the sector size is >512) */
- return 2;
-
- if ((LD_DWORD(&fs->win[BS_FilSysType]) & 0xFFFFFF) == 0x544146) /* Check "FAT" string */
- return 0;
- if ((LD_DWORD(&fs->win[BS_FilSysType32]) & 0xFFFFFF) == 0x544146)
- return 0;
-
- return 1;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Check if the file system object is valid or not */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT chk_mounted ( /* FR_OK(0): successful, !=0: any error occurred */
- const TCHAR **path, /* Pointer to pointer to the path name (drive number) */
- FATFS **rfs, /* Pointer to pointer to the found file system object */
- BYTE wmode /* !=0: Check write protection for write access */
-)
-{
- BYTE fmt, b, pi, *tbl;
- UINT vol;
- DSTATUS stat;
- DWORD bsect, fasize, tsect, sysect, nclst, szbfat;
- WORD nrsv;
- const TCHAR *p = *path;
- FATFS *fs;
-
-
- /* Get logical drive number from the path name */
- vol = p[0] - '0'; /* Is there a drive number? */
- if (vol <= 9 && p[1] == ':') { /* Found a drive number, get and strip it */
- p += 2; *path = p; /* Return pointer to the path name */
- } else { /* No drive number, use default drive */
-#if _FS_RPATH
- vol = CurrVol; /* Use current drive */
-#else
- vol = 0; /* Use drive 0 */
-#endif
- }
-
- /* Check if the file system object is valid or not */
- *rfs = 0;
- if (vol >= _VOLUMES) /* Is the drive number valid? */
- return FR_INVALID_DRIVE;
- fs = FatFs[vol]; /* Get corresponding file system object */
- if (!fs) return FR_NOT_ENABLED; /* Is the file system object available? */
-
- ENTER_FF(fs); /* Lock volume */
-
- *rfs = fs; /* Return pointer to the corresponding file system object */
- if (fs->fs_type) { /* If the volume has been mounted */
- stat = disk_status(fs->drv);
- if (!(stat & STA_NOINIT)) { /* and the physical drive is kept initialized (has not been changed), */
- if (!_FS_READONLY && wmode && (stat & STA_PROTECT)) /* Check write protection if needed */
- return FR_WRITE_PROTECTED;
- return FR_OK; /* The file system object is valid */
- }
- }
-
- /* The file system object is not valid. */
- /* Following code attempts to mount the volume. (analyze BPB and initialize the fs object) */
-
- fs->fs_type = 0; /* Clear the file system object */
- fs->drv = LD2PD(vol); /* Bind the logical drive and a physical drive */
- stat = disk_initialize(fs->drv); /* Initialize the physical drive */
- if (stat & STA_NOINIT) /* Check if the initialization succeeded */
- return FR_NOT_READY; /* Failed to initialize due to no medium or hard error */
- if (!_FS_READONLY && wmode && (stat & STA_PROTECT)) /* Check disk write protection if needed */
- return FR_WRITE_PROTECTED;
-#if _MAX_SS != 512 /* Get disk sector size (variable sector size cfg only) */
- if (disk_ioctl(fs->drv, GET_SECTOR_SIZE, &fs->ssize) != RES_OK)
- return FR_DISK_ERR;
-#endif
- /* Search FAT partition on the drive. Supports only generic partitions, FDISK and SFD. */
- fmt = check_fs(fs, bsect = 0); /* Load sector 0 and check if it is an FAT-VBR (in SFD) */
- if (LD2PT(vol) && !fmt) fmt = 1; /* Force non-SFD if the volume is forced partition */
- if (fmt == 1) { /* Not an FAT-VBR, the physical drive can be partitioned */
- /* Check the partition listed in the partition table */
- pi = LD2PT(vol);
- if (pi) pi--;
- tbl = &fs->win[MBR_Table + pi * SZ_PTE];/* Partition table */
- if (tbl[4]) { /* Is the partition existing? */
- bsect = LD_DWORD(&tbl[8]); /* Partition offset in LBA */
- fmt = check_fs(fs, bsect); /* Check the partition */
- }
- }
- if (fmt == 3) return FR_DISK_ERR;
- if (fmt) return FR_NO_FILESYSTEM; /* No FAT volume is found */
-
- /* An FAT volume is found. Following code initializes the file system object */
-
- if (LD_WORD(fs->win+BPB_BytsPerSec) != SS(fs)) /* (BPB_BytsPerSec must be equal to the physical sector size) */
- return FR_NO_FILESYSTEM;
-
- fasize = LD_WORD(fs->win+BPB_FATSz16); /* Number of sectors per FAT */
- if (!fasize) fasize = LD_DWORD(fs->win+BPB_FATSz32);
- fs->fsize = fasize;
-
- fs->n_fats = b = fs->win[BPB_NumFATs]; /* Number of FAT copies */
- if (b != 1 && b != 2) return FR_NO_FILESYSTEM; /* (Must be 1 or 2) */
- fasize *= b; /* Number of sectors for FAT area */
-
- fs->csize = b = fs->win[BPB_SecPerClus]; /* Number of sectors per cluster */
- if (!b || (b & (b - 1))) return FR_NO_FILESYSTEM; /* (Must be power of 2) */
-
- fs->n_rootdir = LD_WORD(fs->win+BPB_RootEntCnt); /* Number of root directory entries */
- if (fs->n_rootdir % (SS(fs) / SZ_DIR)) return FR_NO_FILESYSTEM; /* (BPB_RootEntCnt must be sector aligned) */
-
- tsect = LD_WORD(fs->win+BPB_TotSec16); /* Number of sectors on the volume */
- if (!tsect) tsect = LD_DWORD(fs->win+BPB_TotSec32);
-
- nrsv = LD_WORD(fs->win+BPB_RsvdSecCnt); /* Number of reserved sectors */
- if (!nrsv) return FR_NO_FILESYSTEM; /* (BPB_RsvdSecCnt must not be 0) */
-
- /* Determine the FAT sub type */
- sysect = nrsv + fasize + fs->n_rootdir / (SS(fs) / SZ_DIR); /* RSV+FAT+DIR */
- if (tsect < sysect) return FR_NO_FILESYSTEM; /* (Invalid volume size) */
- nclst = (tsect - sysect) / fs->csize; /* Number of clusters */
- if (!nclst) return FR_NO_FILESYSTEM; /* (Invalid volume size) */
- fmt = FS_FAT12;
- if (nclst >= MIN_FAT16) fmt = FS_FAT16;
- if (nclst >= MIN_FAT32) fmt = FS_FAT32;
-
- /* Boundaries and Limits */
- fs->n_fatent = nclst + 2; /* Number of FAT entries */
- fs->volbase = bsect; /* Volume start sector */
- fs->fatbase = bsect + nrsv; /* FAT start sector */
- fs->database = bsect + sysect; /* Data start sector */
- if (fmt == FS_FAT32) {
- if (fs->n_rootdir) return FR_NO_FILESYSTEM; /* (BPB_RootEntCnt must be 0) */
- fs->dirbase = LD_DWORD(fs->win+BPB_RootClus); /* Root directory start cluster */
- szbfat = fs->n_fatent * 4; /* (Required FAT size) */
- } else {
- if (!fs->n_rootdir) return FR_NO_FILESYSTEM; /* (BPB_RootEntCnt must not be 0) */
- fs->dirbase = fs->fatbase + fasize; /* Root directory start sector */
- szbfat = (fmt == FS_FAT16) ? /* (Required FAT size) */
- fs->n_fatent * 2 : fs->n_fatent * 3 / 2 + (fs->n_fatent & 1);
- }
- if (fs->fsize < (szbfat + (SS(fs) - 1)) / SS(fs)) /* (BPB_FATSz must not be less than required) */
- return FR_NO_FILESYSTEM;
-
-#if !_FS_READONLY
- /* Initialize cluster allocation information */
- fs->free_clust = 0xFFFFFFFF;
- fs->last_clust = 0;
-
- /* Get fsinfo if available */
- if (fmt == FS_FAT32) {
- fs->fsi_flag = 0;
- fs->fsi_sector = bsect + LD_WORD(fs->win+BPB_FSInfo);
- if (disk_read(fs->drv, fs->win, fs->fsi_sector, 1) == RES_OK &&
- LD_WORD(fs->win+BS_55AA) == 0xAA55 &&
- LD_DWORD(fs->win+FSI_LeadSig) == 0x41615252 &&
- LD_DWORD(fs->win+FSI_StrucSig) == 0x61417272) {
- fs->last_clust = LD_DWORD(fs->win+FSI_Nxt_Free);
- fs->free_clust = LD_DWORD(fs->win+FSI_Free_Count);
- }
- }
-#endif
- fs->fs_type = fmt; /* FAT sub-type */
- fs->id = ++Fsid; /* File system mount ID */
- fs->winsect = 0; /* Invalidate sector cache */
- fs->wflag = 0;
-#if _FS_RPATH
- fs->cdir = 0; /* Current directory (root dir) */
-#endif
-#if _FS_LOCK /* Clear file lock semaphores */
- clear_lock(fs);
-#endif
-
- return FR_OK;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Check if the file/dir object is valid or not */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT validate ( /* FR_OK(0): The object is valid, !=0: Invalid */
- void* obj /* Pointer to the object FIL/DIR to check validity */
-)
-{
- FIL *fil = (FIL*)obj; /* Assuming offset of fs and id in the FIL/DIR is identical */
-
-
- if (!fil || !fil->fs || !fil->fs->fs_type || fil->fs->id != fil->id)
- return FR_INVALID_OBJECT;
-
- ENTER_FF(fil->fs); /* Lock file system */
-
- if (disk_status(fil->fs->drv) & STA_NOINIT)
- return FR_NOT_READY;
-
- return FR_OK;
-}
-
-
-
-
-/*--------------------------------------------------------------------------
-
- Public Functions
-
---------------------------------------------------------------------------*/
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Mount/Unmount a Logical Drive */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_mount (
- BYTE vol, /* Logical drive number to be mounted/unmounted */
- FATFS *fs /* Pointer to new file system object (NULL for unmount)*/
-)
-{
- FATFS *rfs;
-
-
- if (vol >= _VOLUMES) /* Check if the drive number is valid */
- return FR_INVALID_DRIVE;
- rfs = FatFs[vol]; /* Get current fs object */
-
- if (rfs) {
-#if _FS_LOCK
- clear_lock(rfs);
-#endif
-#if _FS_REENTRANT /* Discard sync object of the current volume */
- if (!ff_del_syncobj(rfs->sobj)) return FR_INT_ERR;
-#endif
- rfs->fs_type = 0; /* Clear old fs object */
- }
-
- if (fs) {
- fs->fs_type = 0; /* Clear new fs object */
-#if _FS_REENTRANT /* Create sync object for the new volume */
- if (!ff_cre_syncobj(vol, &fs->sobj)) return FR_INT_ERR;
-#endif
- }
- FatFs[vol] = fs; /* Register new fs object */
-
- return FR_OK;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Open or Create a File */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_open (
- FIL *fp, /* Pointer to the blank file object */
- const TCHAR *path, /* Pointer to the file name */
- BYTE mode /* Access mode and file open mode flags */
-)
-{
- FRESULT res;
- DIR dj;
- BYTE *dir;
- DEF_NAMEBUF;
-
-
- if (!fp) return FR_INVALID_OBJECT;
- fp->fs = 0; /* Clear file object */
-
-#if !_FS_READONLY
- mode &= FA_READ | FA_WRITE | FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW;
- res = chk_mounted(&path, &dj.fs, (BYTE)(mode & ~FA_READ));
-#else
- mode &= FA_READ;
- res = chk_mounted(&path, &dj.fs, 0);
-#endif
- if (res == FR_OK) {
- INIT_BUF(dj);
- res = follow_path(&dj, path); /* Follow the file path */
- dir = dj.dir;
-#if !_FS_READONLY /* R/W configuration */
- if (res == FR_OK) {
- if (!dir) /* Current dir itself */
- res = FR_INVALID_NAME;
-#if _FS_LOCK
- else
- res = chk_lock(&dj, (mode & ~FA_READ) ? 1 : 0);
-#endif
- }
- /* Create or Open a file */
- if (mode & (FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW)) {
- DWORD dw, cl;
-
- if (res != FR_OK) { /* No file, create new */
- if (res == FR_NO_FILE) /* There is no file to open, create a new entry */
-#if _FS_LOCK
- res = enq_lock() ? dir_register(&dj) : FR_TOO_MANY_OPEN_FILES;
-#else
- res = dir_register(&dj);
-#endif
- mode |= FA_CREATE_ALWAYS; /* File is created */
- dir = dj.dir; /* New entry */
- }
- else { /* Any object is already existing */
- if (dir[DIR_Attr] & (AM_RDO | AM_DIR)) { /* Cannot overwrite it (R/O or DIR) */
- res = FR_DENIED;
- } else {
- if (mode & FA_CREATE_NEW) /* Cannot create as new file */
- res = FR_EXIST;
- }
- }
- if (res == FR_OK && (mode & FA_CREATE_ALWAYS)) { /* Truncate it if overwrite mode */
- dw = get_fattime(); /* Created time */
- ST_DWORD(dir+DIR_CrtTime, dw);
- dir[DIR_Attr] = 0; /* Reset attribute */
- ST_DWORD(dir+DIR_FileSize, 0); /* size = 0 */
- cl = ld_clust(dj.fs, dir); /* Get start cluster */
- st_clust(dir, 0); /* cluster = 0 */
- dj.fs->wflag = 1;
- if (cl) { /* Remove the cluster chain if exist */
- dw = dj.fs->winsect;
- res = remove_chain(dj.fs, cl);
- if (res == FR_OK) {
- dj.fs->last_clust = cl - 1; /* Reuse the cluster hole */
- res = move_window(dj.fs, dw);
- }
- }
- }
- }
- else { /* Open an existing file */
- if (res == FR_OK) { /* Follow succeeded */
- if (dir[DIR_Attr] & AM_DIR) { /* It is a directory */
- res = FR_NO_FILE;
- } else {
- if ((mode & FA_WRITE) && (dir[DIR_Attr] & AM_RDO)) /* R/O violation */
- res = FR_DENIED;
- }
- }
- }
- if (res == FR_OK) {
- if (mode & FA_CREATE_ALWAYS) /* Set file change flag if created or overwritten */
- mode |= FA__WRITTEN;
- fp->dir_sect = dj.fs->winsect; /* Pointer to the directory entry */
- fp->dir_ptr = dir;
-#if _FS_LOCK
- fp->lockid = inc_lock(&dj, (mode & ~FA_READ) ? 1 : 0);
- if (!fp->lockid) res = FR_INT_ERR;
-#endif
- }
-
-#else /* R/O configuration */
- if (res == FR_OK) { /* Follow succeeded */
- dir = dj.dir;
- if (!dir) { /* Current dir itself */
- res = FR_INVALID_NAME;
- } else {
- if (dir[DIR_Attr] & AM_DIR) /* It is a directory */
- res = FR_NO_FILE;
- }
- }
-#endif
- FREE_BUF();
-
- if (res == FR_OK) {
- fp->flag = mode; /* File access mode */
- fp->sclust = ld_clust(dj.fs, dir); /* File start cluster */
- fp->fsize = LD_DWORD(dir+DIR_FileSize); /* File size */
- fp->fptr = 0; /* File pointer */
- fp->dsect = 0;
-#if _USE_FASTSEEK
- fp->cltbl = 0; /* Normal seek mode */
-#endif
- fp->fs = dj.fs; fp->id = dj.fs->id; /* Validate file object */
- }
- }
-
- LEAVE_FF(dj.fs, res);
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Read File */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_read (
- FIL *fp, /* Pointer to the file object */
- void *buff, /* Pointer to data buffer */
- UINT btr, /* Number of bytes to read */
- UINT *br /* Pointer to number of bytes read */
-)
-{
- FRESULT res;
- DWORD clst, sect, remain;
- UINT rcnt, cc;
- BYTE csect, *rbuff = (BYTE*)buff;
-
-
- *br = 0; /* Clear read byte counter */
-
- res = validate(fp); /* Check validity */
- if (res != FR_OK) LEAVE_FF(fp->fs, res);
- if (fp->flag & FA__ERROR) /* Aborted file? */
- LEAVE_FF(fp->fs, FR_INT_ERR);
- if (!(fp->flag & FA_READ)) /* Check access mode */
- LEAVE_FF(fp->fs, FR_DENIED);
- remain = fp->fsize - fp->fptr;
- if (btr > remain) btr = (UINT)remain; /* Truncate btr by remaining bytes */
-
- for ( ; btr; /* Repeat until all data read */
- rbuff += rcnt, fp->fptr += rcnt, *br += rcnt, btr -= rcnt) {
- if ((fp->fptr % SS(fp->fs)) == 0) { /* On the sector boundary? */
- csect = (BYTE)(fp->fptr / SS(fp->fs) & (fp->fs->csize - 1)); /* Sector offset in the cluster */
- if (!csect) { /* On the cluster boundary? */
- if (fp->fptr == 0) { /* On the top of the file? */
- clst = fp->sclust; /* Follow from the origin */
- } else { /* Middle or end of the file */
-#if _USE_FASTSEEK
- if (fp->cltbl)
- clst = clmt_clust(fp, fp->fptr); /* Get cluster# from the CLMT */
- else
-#endif
- clst = get_fat(fp->fs, fp->clust); /* Follow cluster chain on the FAT */
- }
- if (clst < 2) ABORT(fp->fs, FR_INT_ERR);
- if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
- fp->clust = clst; /* Update current cluster */
- }
- sect = clust2sect(fp->fs, fp->clust); /* Get current sector */
- if (!sect) ABORT(fp->fs, FR_INT_ERR);
- sect += csect;
- cc = btr / SS(fp->fs); /* When remaining bytes >= sector size, */
- if (cc) { /* Read maximum contiguous sectors directly */
- if (csect + cc > fp->fs->csize) /* Clip at cluster boundary */
- cc = fp->fs->csize - csect;
- if (disk_read(fp->fs->drv, rbuff, sect, (BYTE)cc) != RES_OK)
- ABORT(fp->fs, FR_DISK_ERR);
-#if !_FS_READONLY && _FS_MINIMIZE <= 2 /* Replace one of the read sectors with cached data if it contains a dirty sector */
-#if _FS_TINY
- if (fp->fs->wflag && fp->fs->winsect - sect < cc)
- mem_cpy(rbuff + ((fp->fs->winsect - sect) * SS(fp->fs)), fp->fs->win, SS(fp->fs));
-#else
- if ((fp->flag & FA__DIRTY) && fp->dsect - sect < cc)
- mem_cpy(rbuff + ((fp->dsect - sect) * SS(fp->fs)), fp->buf, SS(fp->fs));
-#endif
-#endif
- rcnt = SS(fp->fs) * cc; /* Number of bytes transferred */
- continue;
- }
-#if !_FS_TINY
- if (fp->dsect != sect) { /* Load data sector if not in cache */
-#if !_FS_READONLY
- if (fp->flag & FA__DIRTY) { /* Write-back dirty sector cache */
- if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1) != RES_OK)
- ABORT(fp->fs, FR_DISK_ERR);
- fp->flag &= ~FA__DIRTY;
- }
-#endif
- if (disk_read(fp->fs->drv, fp->buf, sect, 1) != RES_OK) /* Fill sector cache */
- ABORT(fp->fs, FR_DISK_ERR);
- }
-#endif
- fp->dsect = sect;
- }
- rcnt = SS(fp->fs) - ((UINT)fp->fptr % SS(fp->fs)); /* Get partial sector data from sector buffer */
- if (rcnt > btr) rcnt = btr;
-#if _FS_TINY
- if (move_window(fp->fs, fp->dsect)) /* Move sector window */
- ABORT(fp->fs, FR_DISK_ERR);
- mem_cpy(rbuff, &fp->fs->win[fp->fptr % SS(fp->fs)], rcnt); /* Pick partial sector */
-#else
- mem_cpy(rbuff, &fp->buf[fp->fptr % SS(fp->fs)], rcnt); /* Pick partial sector */
-#endif
- }
-
- LEAVE_FF(fp->fs, FR_OK);
-}
-
-
-
-
-#if !_FS_READONLY
-/*-----------------------------------------------------------------------*/
-/* Write File */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_write (
- FIL *fp, /* Pointer to the file object */
- const void *buff, /* Pointer to the data to be written */
- UINT btw, /* Number of bytes to write */
- UINT *bw /* Pointer to number of bytes written */
-)
-{
- FRESULT res;
- DWORD clst, sect;
- UINT wcnt, cc;
- const BYTE *wbuff = (const BYTE*)buff;
- BYTE csect;
-
-
- *bw = 0; /* Clear write byte counter */
-
- res = validate(fp); /* Check validity */
- if (res != FR_OK) LEAVE_FF(fp->fs, res);
- if (fp->flag & FA__ERROR) /* Aborted file? */
- LEAVE_FF(fp->fs, FR_INT_ERR);
- if (!(fp->flag & FA_WRITE)) /* Check access mode */
- LEAVE_FF(fp->fs, FR_DENIED);
- if ((DWORD)(fp->fsize + btw) < fp->fsize) btw = 0; /* File size cannot reach 4GB */
-
- for ( ; btw; /* Repeat until all data written */
- wbuff += wcnt, fp->fptr += wcnt, *bw += wcnt, btw -= wcnt) {
- if ((fp->fptr % SS(fp->fs)) == 0) { /* On the sector boundary? */
- csect = (BYTE)(fp->fptr / SS(fp->fs) & (fp->fs->csize - 1)); /* Sector offset in the cluster */
- if (!csect) { /* On the cluster boundary? */
- if (fp->fptr == 0) { /* On the top of the file? */
- clst = fp->sclust; /* Follow from the origin */
- if (clst == 0) /* When no cluster is allocated, */
- fp->sclust = clst = create_chain(fp->fs, 0); /* Create a new cluster chain */
- } else { /* Middle or end of the file */
-#if _USE_FASTSEEK
- if (fp->cltbl)
- clst = clmt_clust(fp, fp->fptr); /* Get cluster# from the CLMT */
- else
-#endif
- clst = create_chain(fp->fs, fp->clust); /* Follow or stretch cluster chain on the FAT */
- }
- if (clst == 0) break; /* Could not allocate a new cluster (disk full) */
- if (clst == 1) ABORT(fp->fs, FR_INT_ERR);
- if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
- fp->clust = clst; /* Update current cluster */
- }
-#if _FS_TINY
- if (fp->fs->winsect == fp->dsect && sync_window(fp->fs)) /* Write-back sector cache */
- ABORT(fp->fs, FR_DISK_ERR);
-#else
- if (fp->flag & FA__DIRTY) { /* Write-back sector cache */
- if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1) != RES_OK)
- ABORT(fp->fs, FR_DISK_ERR);
- fp->flag &= ~FA__DIRTY;
- }
-#endif
- sect = clust2sect(fp->fs, fp->clust); /* Get current sector */
- if (!sect) ABORT(fp->fs, FR_INT_ERR);
- sect += csect;
- cc = btw / SS(fp->fs); /* When remaining bytes >= sector size, */
- if (cc) { /* Write maximum contiguous sectors directly */
- if (csect + cc > fp->fs->csize) /* Clip at cluster boundary */
- cc = fp->fs->csize - csect;
- if (disk_write(fp->fs->drv, wbuff, sect, (BYTE)cc) != RES_OK)
- ABORT(fp->fs, FR_DISK_ERR);
-#if _FS_TINY
- if (fp->fs->winsect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */
- mem_cpy(fp->fs->win, wbuff + ((fp->fs->winsect - sect) * SS(fp->fs)), SS(fp->fs));
- fp->fs->wflag = 0;
- }
-#else
- if (fp->dsect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */
- mem_cpy(fp->buf, wbuff + ((fp->dsect - sect) * SS(fp->fs)), SS(fp->fs));
- fp->flag &= ~FA__DIRTY;
- }
-#endif
- wcnt = SS(fp->fs) * cc; /* Number of bytes transferred */
- continue;
- }
-#if _FS_TINY
- if (fp->fptr >= fp->fsize) { /* Avoid silly cache filling at growing edge */
- if (sync_window(fp->fs)) ABORT(fp->fs, FR_DISK_ERR);
- fp->fs->winsect = sect;
- }
-#else
- if (fp->dsect != sect) { /* Fill sector cache with file data */
- if (fp->fptr < fp->fsize &&
- disk_read(fp->fs->drv, fp->buf, sect, 1) != RES_OK)
- ABORT(fp->fs, FR_DISK_ERR);
- }
-#endif
- fp->dsect = sect;
- }
- wcnt = SS(fp->fs) - ((UINT)fp->fptr % SS(fp->fs));/* Put partial sector into file I/O buffer */
- if (wcnt > btw) wcnt = btw;
-#if _FS_TINY
- if (move_window(fp->fs, fp->dsect)) /* Move sector window */
- ABORT(fp->fs, FR_DISK_ERR);
- mem_cpy(&fp->fs->win[fp->fptr % SS(fp->fs)], wbuff, wcnt); /* Fit partial sector */
- fp->fs->wflag = 1;
-#else
- mem_cpy(&fp->buf[fp->fptr % SS(fp->fs)], wbuff, wcnt); /* Fit partial sector */
- fp->flag |= FA__DIRTY;
-#endif
- }
-
- if (fp->fptr > fp->fsize) fp->fsize = fp->fptr; /* Update file size if needed */
- fp->flag |= FA__WRITTEN; /* Set file change flag */
-
- LEAVE_FF(fp->fs, FR_OK);
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Synchronize the File Object */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_sync (
- FIL *fp /* Pointer to the file object */
-)
-{
- FRESULT res;
- DWORD tm;
- BYTE *dir;
-
-
- res = validate(fp); /* Check validity of the object */
- if (res == FR_OK) {
- if (fp->flag & FA__WRITTEN) { /* Has the file been written? */
-#if !_FS_TINY /* Write-back dirty buffer */
- if (fp->flag & FA__DIRTY) {
- if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1) != RES_OK)
- LEAVE_FF(fp->fs, FR_DISK_ERR);
- fp->flag &= ~FA__DIRTY;
- }
-#endif
- /* Update the directory entry */
- res = move_window(fp->fs, fp->dir_sect);
- if (res == FR_OK) {
- dir = fp->dir_ptr;
- dir[DIR_Attr] |= AM_ARC; /* Set archive bit */
- ST_DWORD(dir+DIR_FileSize, fp->fsize); /* Update file size */
- st_clust(dir, fp->sclust); /* Update start cluster */
- tm = get_fattime(); /* Update updated time */
- ST_DWORD(dir+DIR_WrtTime, tm);
- ST_WORD(dir+DIR_LstAccDate, 0);
- fp->flag &= ~FA__WRITTEN;
- fp->fs->wflag = 1;
- res = sync_fs(fp->fs);
- }
- }
- }
-
- LEAVE_FF(fp->fs, res);
-}
-
-#endif /* !_FS_READONLY */
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Close File */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_close (
- FIL *fp /* Pointer to the file object to be closed */
-)
-{
- FRESULT res;
-
-
-#if _FS_READONLY
- res = validate(fp);
- {
-#if _FS_REENTRANT
- FATFS *fs = fp->fs;
-#endif
- if (res == FR_OK) fp->fs = 0; /* Discard file object */
- LEAVE_FF(fs, res);
- }
-#else
- res = f_sync(fp); /* Flush cached data */
-#if _FS_LOCK
- if (res == FR_OK) { /* Decrement open counter */
-#if _FS_REENTRANT
- FATFS *fs = fp->fs;;
- res = validate(fp);
- if (res == FR_OK) {
- res = dec_lock(fp->lockid);
- unlock_fs(fs, FR_OK);
- }
-#else
- res = dec_lock(fp->lockid);
-#endif
- }
-#endif
- if (res == FR_OK) fp->fs = 0; /* Discard file object */
- return res;
-#endif
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Current Drive/Directory Handlings */
-/*-----------------------------------------------------------------------*/
-
-#if _FS_RPATH >= 1
-
-FRESULT f_chdrive (
- BYTE drv /* Drive number */
-)
-{
- if (drv >= _VOLUMES) return FR_INVALID_DRIVE;
-
- CurrVol = drv;
-
- return FR_OK;
-}
-
-BYTE f_get_current_drive(void)
-{
- return CurrVol;
-}
-
-FRESULT f_chdir (
- const TCHAR *path /* Pointer to the directory path */
-)
-{
- FRESULT res;
- DIR dj;
- DEF_NAMEBUF;
-
-
- res = chk_mounted(&path, &dj.fs, 0);
- if (res == FR_OK) {
- INIT_BUF(dj);
- res = follow_path(&dj, path); /* Follow the path */
- FREE_BUF();
- if (res == FR_OK) { /* Follow completed */
- if (!dj.dir) {
- dj.fs->cdir = dj.sclust; /* Start directory itself */
- } else {
- if (dj.dir[DIR_Attr] & AM_DIR) /* Reached to the directory */
- dj.fs->cdir = ld_clust(dj.fs, dj.dir);
- else
- res = FR_NO_PATH; /* Reached but a file */
- }
- }
- if (res == FR_NO_FILE) res = FR_NO_PATH;
- }
-
- LEAVE_FF(dj.fs, res);
-}
-
-
-#if _FS_RPATH >= 2
-FRESULT f_getcwd (
- TCHAR *buff, /* Pointer to the directory path */
- UINT len /* Size of path */
-)
-{
- FRESULT res;
- DIR dj;
- UINT i, n;
- DWORD ccl;
- TCHAR *tp;
- FILINFO fno;
- DEF_NAMEBUF;
-
-
- *buff = 0;
- res = chk_mounted((const TCHAR**)&buff, &dj.fs, 0); /* Get current volume */
- if (res == FR_OK) {
- INIT_BUF(dj);
- i = len; /* Bottom of buffer (dir stack base) */
- dj.sclust = dj.fs->cdir; /* Start to follow upper dir from current dir */
- while ((ccl = dj.sclust) != 0) { /* Repeat while current dir is a sub-dir */
- res = dir_sdi(&dj, 1); /* Get parent dir */
- if (res != FR_OK) break;
- res = dir_read(&dj, 0);
- if (res != FR_OK) break;
- dj.sclust = ld_clust(dj.fs, dj.dir); /* Goto parent dir */
- res = dir_sdi(&dj, 0);
- if (res != FR_OK) break;
- do { /* Find the entry links to the child dir */
- res = dir_read(&dj, 0);
- if (res != FR_OK) break;
- if (ccl == ld_clust(dj.fs, dj.dir)) break; /* Found the entry */
- res = dir_next(&dj, 0);
- } while (res == FR_OK);
- if (res == FR_NO_FILE) res = FR_INT_ERR;/* It cannot be 'not found'. */
- if (res != FR_OK) break;
-#if _USE_LFN
- fno.lfname = buff;
- fno.lfsize = i;
-#endif
- get_fileinfo(&dj, &fno); /* Get the dir name and push it to the buffer */
- tp = fno.fname;
- if (_USE_LFN && *buff) tp = buff;
- for (n = 0; tp[n]; n++) ;
- if (i < n + 3) {
- res = FR_NOT_ENOUGH_CORE; break;
- }
- while (n) buff[--i] = tp[--n];
- buff[--i] = '/';
- }
- tp = buff;
- if (res == FR_OK) {
- *tp++ = '0' + CurrVol; /* Put drive number */
- *tp++ = ':';
- if (i == len) { /* Root-dir */
- *tp++ = '/';
- } else { /* Sub-dir */
- do /* Add stacked path str */
- *tp++ = buff[i++];
- while (i < len);
- }
- }
- *tp = 0;
- FREE_BUF();
- }
-
- LEAVE_FF(dj.fs, res);
-}
-#endif /* _FS_RPATH >= 2 */
-#endif /* _FS_RPATH >= 1 */
-
-
-
-#if _FS_MINIMIZE <= 2
-/*-----------------------------------------------------------------------*/
-/* Seek File R/W Pointer */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_lseek (
- FIL *fp, /* Pointer to the file object */
- DWORD ofs /* File pointer from top of file */
-)
-{
- FRESULT res;
-
-
- res = validate(fp); /* Check validity of the object */
- if (res != FR_OK) LEAVE_FF(fp->fs, res);
- if (fp->flag & FA__ERROR) /* Check abort flag */
- LEAVE_FF(fp->fs, FR_INT_ERR);
-
-#if _USE_FASTSEEK
- if (fp->cltbl) { /* Fast seek */
- DWORD cl, pcl, ncl, tcl, dsc, tlen, ulen, *tbl;
-
- if (ofs == CREATE_LINKMAP) { /* Create CLMT */
- tbl = fp->cltbl;
- tlen = *tbl++; ulen = 2; /* Given table size and required table size */
- cl = fp->sclust; /* Top of the chain */
- if (cl) {
- do {
- /* Get a fragment */
- tcl = cl; ncl = 0; ulen += 2; /* Top, length and used items */
- do {
- pcl = cl; ncl++;
- cl = get_fat(fp->fs, cl);
- if (cl <= 1) ABORT(fp->fs, FR_INT_ERR);
- if (cl == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
- } while (cl == pcl + 1);
- if (ulen <= tlen) { /* Store the length and top of the fragment */
- *tbl++ = ncl; *tbl++ = tcl;
- }
- } while (cl < fp->fs->n_fatent); /* Repeat until end of chain */
- }
- *fp->cltbl = ulen; /* Number of items used */
- if (ulen <= tlen)
- *tbl = 0; /* Terminate table */
- else
- res = FR_NOT_ENOUGH_CORE; /* Given table size is smaller than required */
-
- } else { /* Fast seek */
- if (ofs > fp->fsize) /* Clip offset at the file size */
- ofs = fp->fsize;
- fp->fptr = ofs; /* Set file pointer */
- if (ofs) {
- fp->clust = clmt_clust(fp, ofs - 1);
- dsc = clust2sect(fp->fs, fp->clust);
- if (!dsc) ABORT(fp->fs, FR_INT_ERR);
- dsc += (ofs - 1) / SS(fp->fs) & (fp->fs->csize - 1);
- if (fp->fptr % SS(fp->fs) && dsc != fp->dsect) { /* Refill sector cache if needed */
-#if !_FS_TINY
-#if !_FS_READONLY
- if (fp->flag & FA__DIRTY) { /* Write-back dirty sector cache */
- if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1) != RES_OK)
- ABORT(fp->fs, FR_DISK_ERR);
- fp->flag &= ~FA__DIRTY;
- }
-#endif
- if (disk_read(fp->fs->drv, fp->buf, dsc, 1) != RES_OK) /* Load current sector */
- ABORT(fp->fs, FR_DISK_ERR);
-#endif
- fp->dsect = dsc;
- }
- }
- }
- } else
-#endif
-
- /* Normal Seek */
- {
- DWORD clst, bcs, nsect, ifptr;
-
- if (ofs > fp->fsize /* In read-only mode, clip offset with the file size */
-#if !_FS_READONLY
- && !(fp->flag & FA_WRITE)
-#endif
- ) ofs = fp->fsize;
-
- ifptr = fp->fptr;
- fp->fptr = nsect = 0;
- if (ofs) {
- bcs = (DWORD)fp->fs->csize * SS(fp->fs); /* Cluster size (byte) */
- if (ifptr > 0 &&
- (ofs - 1) / bcs >= (ifptr - 1) / bcs) { /* When seek to same or following cluster, */
- fp->fptr = (ifptr - 1) & ~(bcs - 1); /* start from the current cluster */
- ofs -= fp->fptr;
- clst = fp->clust;
- } else { /* When seek to back cluster, */
- clst = fp->sclust; /* start from the first cluster */
-#if !_FS_READONLY
- if (clst == 0) { /* If no cluster chain, create a new chain */
- clst = create_chain(fp->fs, 0);
- if (clst == 1) ABORT(fp->fs, FR_INT_ERR);
- if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
- fp->sclust = clst;
- }
-#endif
- fp->clust = clst;
- }
- if (clst != 0) {
- while (ofs > bcs) { /* Cluster following loop */
-#if !_FS_READONLY
- if (fp->flag & FA_WRITE) { /* Check if in write mode or not */
- clst = create_chain(fp->fs, clst); /* Force stretch if in write mode */
- if (clst == 0) { /* When disk gets full, clip file size */
- ofs = bcs; break;
- }
- } else
-#endif
- clst = get_fat(fp->fs, clst); /* Follow cluster chain if not in write mode */
- if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
- if (clst <= 1 || clst >= fp->fs->n_fatent) ABORT(fp->fs, FR_INT_ERR);
- fp->clust = clst;
- fp->fptr += bcs;
- ofs -= bcs;
- }
- fp->fptr += ofs;
- if (ofs % SS(fp->fs)) {
- nsect = clust2sect(fp->fs, clst); /* Current sector */
- if (!nsect) ABORT(fp->fs, FR_INT_ERR);
- nsect += ofs / SS(fp->fs);
- }
- }
- }
- if (fp->fptr % SS(fp->fs) && nsect != fp->dsect) { /* Fill sector cache if needed */
-#if !_FS_TINY
-#if !_FS_READONLY
- if (fp->flag & FA__DIRTY) { /* Write-back dirty sector cache */
- if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1) != RES_OK)
- ABORT(fp->fs, FR_DISK_ERR);
- fp->flag &= ~FA__DIRTY;
- }
-#endif
- if (disk_read(fp->fs->drv, fp->buf, nsect, 1) != RES_OK) /* Fill sector cache */
- ABORT(fp->fs, FR_DISK_ERR);
-#endif
- fp->dsect = nsect;
- }
-#if !_FS_READONLY
- if (fp->fptr > fp->fsize) { /* Set file change flag if the file size is extended */
- fp->fsize = fp->fptr;
- fp->flag |= FA__WRITTEN;
- }
-#endif
- }
-
- LEAVE_FF(fp->fs, res);
-}
-
-
-
-#if _FS_MINIMIZE <= 1
-/*-----------------------------------------------------------------------*/
-/* Create a Directory Object */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_opendir (
- DIR *dj, /* Pointer to directory object to create */
- const TCHAR *path /* Pointer to the directory path */
-)
-{
- FRESULT res;
- FATFS *fs;
- DEF_NAMEBUF;
-
-
- if (!dj) return FR_INVALID_OBJECT;
-
- res = chk_mounted(&path, &dj->fs, 0);
- fs = dj->fs;
- if (res == FR_OK) {
- INIT_BUF(*dj);
- res = follow_path(dj, path); /* Follow the path to the directory */
- FREE_BUF();
- if (res == FR_OK) { /* Follow completed */
- if (dj->dir) { /* It is not the root dir */
- if (dj->dir[DIR_Attr] & AM_DIR) { /* The object is a directory */
- dj->sclust = ld_clust(fs, dj->dir);
- } else { /* The object is not a directory */
- res = FR_NO_PATH;
- }
- }
- if (res == FR_OK) {
- dj->id = fs->id;
- res = dir_sdi(dj, 0); /* Rewind dir */
- }
- }
- if (res == FR_NO_FILE) res = FR_NO_PATH;
- if (res != FR_OK) dj->fs = 0; /* Invalidate the dir object if function faild */
- } else {
- dj->fs = 0;
- }
-
- LEAVE_FF(fs, res);
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Read Directory Entry in Sequence */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_readdir (
- DIR *dj, /* Pointer to the open directory object */
- FILINFO *fno /* Pointer to file information to return */
-)
-{
- FRESULT res;
- DEF_NAMEBUF;
-
-
- res = validate(dj); /* Check validity of the object */
- if (res == FR_OK) {
- if (!fno) {
- res = dir_sdi(dj, 0); /* Rewind the directory object */
- } else {
- INIT_BUF(*dj);
- res = dir_read(dj, 0); /* Read an item */
- if (res == FR_NO_FILE) { /* Reached end of dir */
- dj->sect = 0;
- res = FR_OK;
- }
- if (res == FR_OK) { /* A valid entry is found */
- get_fileinfo(dj, fno); /* Get the object information */
- res = dir_next(dj, 0); /* Increment index for next */
- if (res == FR_NO_FILE) {
- dj->sect = 0;
- res = FR_OK;
- }
- }
- FREE_BUF();
- }
- }
-
- LEAVE_FF(dj->fs, res);
-}
-
-
-
-#if _FS_MINIMIZE == 0
-/*-----------------------------------------------------------------------*/
-/* Get File Status */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_stat (
- const TCHAR *path, /* Pointer to the file path */
- FILINFO *fno /* Pointer to file information to return */
-)
-{
- FRESULT res;
- DIR dj;
- DEF_NAMEBUF;
-
-
- res = chk_mounted(&path, &dj.fs, 0);
- if (res == FR_OK) {
- INIT_BUF(dj);
- res = follow_path(&dj, path); /* Follow the file path */
- if (res == FR_OK) { /* Follow completed */
- if (dj.dir) /* Found an object */
- get_fileinfo(&dj, fno);
- else /* It is root dir */
- res = FR_INVALID_NAME;
- }
- FREE_BUF();
- }
-
- LEAVE_FF(dj.fs, res);
-}
-
-
-
-#if !_FS_READONLY
-/*-----------------------------------------------------------------------*/
-/* Get Number of Free Clusters */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_getfree (
- const TCHAR *path, /* Path name of the logical drive number */
- DWORD *nclst, /* Pointer to a variable to return number of free clusters */
- FATFS **fatfs /* Pointer to return pointer to corresponding file system object */
-)
-{
- FRESULT res;
- FATFS *fs;
- DWORD n, clst, sect, stat;
- UINT i;
- BYTE fat, *p;
-
-
- /* Get drive number */
- res = chk_mounted(&path, fatfs, 0);
- fs = *fatfs;
- if (res == FR_OK) {
- /* If free_clust is valid, return it without full cluster scan */
- if (fs->free_clust <= fs->n_fatent - 2) {
- *nclst = fs->free_clust;
- } else {
- /* Get number of free clusters */
- fat = fs->fs_type;
- n = 0;
- if (fat == FS_FAT12) {
- clst = 2;
- do {
- stat = get_fat(fs, clst);
- if (stat == 0xFFFFFFFF) { res = FR_DISK_ERR; break; }
- if (stat == 1) { res = FR_INT_ERR; break; }
- if (stat == 0) n++;
- } while (++clst < fs->n_fatent);
- } else {
- clst = fs->n_fatent;
- sect = fs->fatbase;
- i = 0; p = 0;
- do {
- if (!i) {
- res = move_window(fs, sect++);
- if (res != FR_OK) break;
- p = fs->win;
- i = SS(fs);
- }
- if (fat == FS_FAT16) {
- if (LD_WORD(p) == 0) n++;
- p += 2; i -= 2;
- } else {
- if ((LD_DWORD(p) & 0x0FFFFFFF) == 0) n++;
- p += 4; i -= 4;
- }
- } while (--clst);
- }
- fs->free_clust = n;
- if (fat == FS_FAT32) fs->fsi_flag = 1;
- *nclst = n;
- }
- }
- LEAVE_FF(fs, res);
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Truncate File */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_truncate (
- FIL *fp /* Pointer to the file object */
-)
-{
- FRESULT res;
- DWORD ncl;
-
-
- res = validate(fp); /* Check validity of the object */
- if (res == FR_OK) {
- if (fp->flag & FA__ERROR) { /* Check abort flag */
- res = FR_INT_ERR;
- } else {
- if (!(fp->flag & FA_WRITE)) /* Check access mode */
- res = FR_DENIED;
- }
- }
- if (res == FR_OK) {
- if (fp->fsize > fp->fptr) {
- fp->fsize = fp->fptr; /* Set file size to current R/W point */
- fp->flag |= FA__WRITTEN;
- if (fp->fptr == 0) { /* When set file size to zero, remove entire cluster chain */
- res = remove_chain(fp->fs, fp->sclust);
- fp->sclust = 0;
- } else { /* When truncate a part of the file, remove remaining clusters */
- ncl = get_fat(fp->fs, fp->clust);
- res = FR_OK;
- if (ncl == 0xFFFFFFFF) res = FR_DISK_ERR;
- if (ncl == 1) res = FR_INT_ERR;
- if (res == FR_OK && ncl < fp->fs->n_fatent) {
- res = put_fat(fp->fs, fp->clust, 0x0FFFFFFF);
- if (res == FR_OK) res = remove_chain(fp->fs, ncl);
- }
- }
- }
- if (res != FR_OK) fp->flag |= FA__ERROR;
- }
-
- LEAVE_FF(fp->fs, res);
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Delete a File or Directory */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_unlink (
- const TCHAR *path /* Pointer to the file or directory path */
-)
-{
- FRESULT res;
- DIR dj, sdj;
- BYTE *dir;
- DWORD dclst;
- DEF_NAMEBUF;
-
-
- res = chk_mounted(&path, &dj.fs, 1);
- if (res == FR_OK) {
- INIT_BUF(dj);
- res = follow_path(&dj, path); /* Follow the file path */
- if (_FS_RPATH && res == FR_OK && (dj.fn[NS] & NS_DOT))
- res = FR_INVALID_NAME; /* Cannot remove dot entry */
-#if _FS_LOCK
- if (res == FR_OK) res = chk_lock(&dj, 2); /* Cannot remove open file */
-#endif
- if (res == FR_OK) { /* The object is accessible */
- dir = dj.dir;
- if (!dir) {
- res = FR_INVALID_NAME; /* Cannot remove the start directory */
- } else {
- if (dir[DIR_Attr] & AM_RDO)
- res = FR_DENIED; /* Cannot remove R/O object */
- }
- dclst = ld_clust(dj.fs, dir);
- if (res == FR_OK && (dir[DIR_Attr] & AM_DIR)) { /* Is it a sub-dir? */
- if (dclst < 2) {
- res = FR_INT_ERR;
- } else {
- mem_cpy(&sdj, &dj, sizeof (DIR)); /* Check if the sub-dir is empty or not */
- sdj.sclust = dclst;
- res = dir_sdi(&sdj, 2); /* Exclude dot entries */
- if (res == FR_OK) {
- res = dir_read(&sdj, 0); /* Read an item */
- if (res == FR_OK /* Not empty dir */
-#if _FS_RPATH
- || dclst == dj.fs->cdir /* Current dir */
-#endif
- ) res = FR_DENIED;
- if (res == FR_NO_FILE) res = FR_OK; /* Empty */
- }
- }
- }
- if (res == FR_OK) {
- res = dir_remove(&dj); /* Remove the directory entry */
- if (res == FR_OK) {
- if (dclst) /* Remove the cluster chain if exist */
- res = remove_chain(dj.fs, dclst);
- if (res == FR_OK) res = sync_fs(dj.fs);
- }
- }
- }
- FREE_BUF();
- }
-
- LEAVE_FF(dj.fs, res);
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Create a Directory */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_mkdir (
- const TCHAR *path /* Pointer to the directory path */
-)
-{
- FRESULT res;
- DIR dj;
- BYTE *dir, n;
- DWORD dsc, dcl, pcl, tm = get_fattime();
- DEF_NAMEBUF;
-
-
- res = chk_mounted(&path, &dj.fs, 1);
- if (res == FR_OK) {
- INIT_BUF(dj);
- res = follow_path(&dj, path); /* Follow the file path */
- if (res == FR_OK) res = FR_EXIST; /* Any object with same name is already existing */
- if (_FS_RPATH && res == FR_NO_FILE && (dj.fn[NS] & NS_DOT))
- res = FR_INVALID_NAME;
- if (res == FR_NO_FILE) { /* Can create a new directory */
- dcl = create_chain(dj.fs, 0); /* Allocate a cluster for the new directory table */
- res = FR_OK;
- if (dcl == 0) res = FR_DENIED; /* No space to allocate a new cluster */
- if (dcl == 1) res = FR_INT_ERR;
- if (dcl == 0xFFFFFFFF) res = FR_DISK_ERR;
- if (res == FR_OK) /* Flush FAT */
- res = sync_window(dj.fs);
- if (res == FR_OK) { /* Initialize the new directory table */
- dsc = clust2sect(dj.fs, dcl);
- dir = dj.fs->win;
- mem_set(dir, 0, SS(dj.fs));
- mem_set(dir+DIR_Name, ' ', 11); /* Create "." entry */
- dir[DIR_Name] = '.';
- dir[DIR_Attr] = AM_DIR;
- ST_DWORD(dir+DIR_WrtTime, tm);
- st_clust(dir, dcl);
- mem_cpy(dir+SZ_DIR, dir, SZ_DIR); /* Create ".." entry */
- dir[33] = '.'; pcl = dj.sclust;
- if (dj.fs->fs_type == FS_FAT32 && pcl == dj.fs->dirbase)
- pcl = 0;
- st_clust(dir+SZ_DIR, pcl);
- for (n = dj.fs->csize; n; n--) { /* Write dot entries and clear following sectors */
- dj.fs->winsect = dsc++;
- dj.fs->wflag = 1;
- res = sync_window(dj.fs);
- if (res != FR_OK) break;
- mem_set(dir, 0, SS(dj.fs));
- }
- }
- if (res == FR_OK) res = dir_register(&dj); /* Register the object to the directoy */
- if (res != FR_OK) {
- remove_chain(dj.fs, dcl); /* Could not register, remove cluster chain */
- } else {
- dir = dj.dir;
- dir[DIR_Attr] = AM_DIR; /* Attribute */
- ST_DWORD(dir+DIR_WrtTime, tm); /* Created time */
- st_clust(dir, dcl); /* Table start cluster */
- dj.fs->wflag = 1;
- res = sync_fs(dj.fs);
- }
- }
- FREE_BUF();
- }
-
- LEAVE_FF(dj.fs, res);
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Change Attribute */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_chmod (
- const TCHAR *path, /* Pointer to the file path */
- BYTE value, /* Attribute bits */
- BYTE mask /* Attribute mask to change */
-)
-{
- FRESULT res;
- DIR dj;
- BYTE *dir;
- DEF_NAMEBUF;
-
-
- res = chk_mounted(&path, &dj.fs, 1);
- if (res == FR_OK) {
- INIT_BUF(dj);
- res = follow_path(&dj, path); /* Follow the file path */
- FREE_BUF();
- if (_FS_RPATH && res == FR_OK && (dj.fn[NS] & NS_DOT))
- res = FR_INVALID_NAME;
- if (res == FR_OK) {
- dir = dj.dir;
- if (!dir) { /* Is it a root directory? */
- res = FR_INVALID_NAME;
- } else { /* File or sub directory */
- mask &= AM_RDO|AM_HID|AM_SYS|AM_ARC; /* Valid attribute mask */
- dir[DIR_Attr] = (value & mask) | (dir[DIR_Attr] & (BYTE)~mask); /* Apply attribute change */
- dj.fs->wflag = 1;
- res = sync_fs(dj.fs);
- }
- }
- }
-
- LEAVE_FF(dj.fs, res);
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Change Timestamp */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_utime (
- const TCHAR *path, /* Pointer to the file/directory name */
- const FILINFO *fno /* Pointer to the time stamp to be set */
-)
-{
- FRESULT res;
- DIR dj;
- BYTE *dir;
- DEF_NAMEBUF;
-
-
- res = chk_mounted(&path, &dj.fs, 1);
- if (res == FR_OK) {
- INIT_BUF(dj);
- res = follow_path(&dj, path); /* Follow the file path */
- FREE_BUF();
- if (_FS_RPATH && res == FR_OK && (dj.fn[NS] & NS_DOT))
- res = FR_INVALID_NAME;
- if (res == FR_OK) {
- dir = dj.dir;
- if (!dir) { /* Root directory */
- res = FR_INVALID_NAME;
- } else { /* File or sub-directory */
- ST_WORD(dir+DIR_WrtTime, fno->ftime);
- ST_WORD(dir+DIR_WrtDate, fno->fdate);
- dj.fs->wflag = 1;
- res = sync_fs(dj.fs);
- }
- }
- }
-
- LEAVE_FF(dj.fs, res);
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Rename File/Directory */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_rename (
- const TCHAR *path_old, /* Pointer to the old name */
- const TCHAR *path_new /* Pointer to the new name */
-)
-{
- FRESULT res;
- DIR djo, djn;
- BYTE buf[21], *dir;
- DWORD dw;
- DEF_NAMEBUF;
-
-
- res = chk_mounted(&path_old, &djo.fs, 1);
- if (res == FR_OK) {
- djn.fs = djo.fs;
- INIT_BUF(djo);
- res = follow_path(&djo, path_old); /* Check old object */
- if (_FS_RPATH && res == FR_OK && (djo.fn[NS] & NS_DOT))
- res = FR_INVALID_NAME;
-#if _FS_LOCK
- if (res == FR_OK) res = chk_lock(&djo, 2);
-#endif
- if (res == FR_OK) { /* Old object is found */
- if (!djo.dir) { /* Is root dir? */
- res = FR_NO_FILE;
- } else {
- mem_cpy(buf, djo.dir+DIR_Attr, 21); /* Save the object information except for name */
- mem_cpy(&djn, &djo, sizeof (DIR)); /* Check new object */
- res = follow_path(&djn, path_new);
- if (res == FR_OK) res = FR_EXIST; /* The new object name is already existing */
- if (res == FR_NO_FILE) { /* Is it a valid path and no name collision? */
-/* Start critical section that any interruption can cause a cross-link */
- res = dir_register(&djn); /* Register the new entry */
- if (res == FR_OK) {
- dir = djn.dir; /* Copy object information except for name */
- mem_cpy(dir+13, buf+2, 19);
- dir[DIR_Attr] = buf[0] | AM_ARC;
- djo.fs->wflag = 1;
- if (djo.sclust != djn.sclust && (dir[DIR_Attr] & AM_DIR)) { /* Update .. entry in the directory if needed */
- dw = clust2sect(djo.fs, ld_clust(djo.fs, dir));
- if (!dw) {
- res = FR_INT_ERR;
- } else {
- res = move_window(djo.fs, dw);
- dir = djo.fs->win+SZ_DIR; /* .. entry */
- if (res == FR_OK && dir[1] == '.') {
- dw = (djo.fs->fs_type == FS_FAT32 && djn.sclust == djo.fs->dirbase) ? 0 : djn.sclust;
- st_clust(dir, dw);
- djo.fs->wflag = 1;
- }
- }
- }
- if (res == FR_OK) {
- res = dir_remove(&djo); /* Remove old entry */
- if (res == FR_OK)
- res = sync_fs(djo.fs);
- }
- }
-/* End critical section */
- }
- }
- }
- FREE_BUF();
- }
-
- LEAVE_FF(djo.fs, res);
-}
-
-#endif /* !_FS_READONLY */
-#endif /* _FS_MINIMIZE == 0 */
-#endif /* _FS_MINIMIZE <= 1 */
-#endif /* _FS_MINIMIZE <= 2 */
-
-
-
-#if _USE_LABEL
-/*-----------------------------------------------------------------------*/
-/* Get volume label */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_getlabel (
- const TCHAR* path, /* Path name of the logical drive number */
- TCHAR* label, /* Pointer to a buffer to return the volume label */
- DWORD* sn /* Pointer to a variable to return the volume serial number */
-)
-{
- FRESULT res;
- DIR dj;
- UINT i, j;
-
-
- /* Get logical drive */
- res = chk_mounted(&path, &dj.fs, 0);
-
- /* Get volume label */
- if (res == FR_OK && label) {
- dj.sclust = 0; /* Open root dir */
- res = dir_sdi(&dj, 0);
- if (res == FR_OK) {
- res = dir_read(&dj, 1); /* Get an entry with AM_VOL */
- if (res == FR_OK) { /* A volume label is exist */
-#if _LFN_UNICODE
- WCHAR w;
- i = j = 0;
- do {
- w = (i < 11) ? dj.dir[i++] : ' ';
- if (IsDBCS1(w) && i < 11 && IsDBCS2(dj.dir[i]))
- w = (w << 8) | dj.dir[i++];
- label[j++] = ff_convert(w, 1);
- } while (j < 11);
-#else
- mem_cpy(label, dj.dir, 11);
-#endif
- j = 11;
- do {
- label[j] = 0;
- if (!j) break;
- } while (label[--j] == ' ');
- }
- if (res == FR_NO_FILE) { /* No label, return nul string */
- label[0] = 0;
- res = FR_OK;
- }
- }
- }
-
- /* Get volume serial number */
- if (res == FR_OK && sn) {
- res = move_window(dj.fs, dj.fs->volbase);
- if (res == FR_OK) {
- i = dj.fs->fs_type == FS_FAT32 ? BS_VolID32 : BS_VolID;
- *sn = LD_DWORD(&dj.fs->win[i]);
- }
- }
-
- LEAVE_FF(dj.fs, res);
-}
-
-
-
-#if !_FS_READONLY
-/*-----------------------------------------------------------------------*/
-/* Set volume label */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_setlabel (
- const TCHAR* label /* Pointer to the volume label to set */
-)
-{
- FRESULT res;
- DIR dj;
- BYTE vn[11];
- UINT i, j, sl;
- WCHAR w;
- DWORD tm;
-
-
- /* Get logical drive */
- res = chk_mounted(&label, &dj.fs, 1);
- if (res) LEAVE_FF(dj.fs, res);
-
- /* Create a volume label in directory form */
- vn[0] = 0;
- for (sl = 0; label[sl]; sl++) ; /* Get name length */
- for ( ; sl && label[sl-1] == ' '; sl--) ; /* Remove trailing spaces */
- if (sl) { /* Create volume label in directory form */
- i = j = 0;
- do {
-#if _LFN_UNICODE
- w = ff_convert(ff_wtoupper(label[i++]), 0);
-#else
- w = (BYTE)label[i++];
- if (IsDBCS1(w))
- w = (j < 10 && i < sl && IsDBCS2(label[i])) ? (w << 8) | (BYTE)label[i++] : 0;
-#if _USE_LFN
- w = ff_convert(ff_wtoupper(ff_convert(w, 1)), 0);
-#else
- if (IsLower(w)) w -= 0x20; /* To upper ASCII chars */
-#ifdef _EXCVT
- if (w >= 0x80) w = ExCvt[w - 0x80]; /* To upper extended chars (SBCS cfg) */
-#else
- if (!_DF1S && w >= 0x80) w = 0; /* Reject extended chars (ASCII cfg) */
-#endif
-#endif
-#endif
- if (!w || chk_chr("\"*+,.:;<=>\?[]|\x7F", w) || j >= (UINT)((w >= 0x100) ? 10 : 11)) /* Reject invalid chars for volume label */
- LEAVE_FF(dj.fs, FR_INVALID_NAME);
- if (w >= 0x100) vn[j++] = (BYTE)(w >> 8);
- vn[j++] = (BYTE)w;
- } while (i < sl);
- while (j < 11) vn[j++] = ' ';
- }
-
- /* Set volume label */
- dj.sclust = 0; /* Open root dir */
- res = dir_sdi(&dj, 0);
- if (res == FR_OK) {
- res = dir_read(&dj, 1); /* Get an entry with AM_VOL */
- if (res == FR_OK) { /* A volume label is found */
- if (vn[0]) {
- mem_cpy(dj.dir, vn, 11); /* Change the volume label name */
- tm = get_fattime();
- ST_DWORD(dj.dir+DIR_WrtTime, tm);
- } else {
- dj.dir[0] = DDE; /* Remove the volume label */
- }
- dj.fs->wflag = 1;
- res = sync_fs(dj.fs);
- } else { /* No volume label is found or error */
- if (res == FR_NO_FILE) {
- res = FR_OK;
- if (vn[0]) { /* Create volume label as new */
- res = dir_alloc(&dj, 1); /* Allocate an entry for volume label */
- if (res == FR_OK) {
- mem_set(dj.dir, 0, SZ_DIR); /* Set volume label */
- mem_cpy(dj.dir, vn, 11);
- dj.dir[DIR_Attr] = AM_VOL;
- tm = get_fattime();
- ST_DWORD(dj.dir+DIR_WrtTime, tm);
- dj.fs->wflag = 1;
- res = sync_fs(dj.fs);
- }
- }
- }
- }
- }
-
- LEAVE_FF(dj.fs, res);
-}
-
-#endif /* !_FS_READONLY */
-#endif /* _USE_LABEL */
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Forward data to the stream directly (available on only tiny cfg) */
-/*-----------------------------------------------------------------------*/
-#if _USE_FORWARD && _FS_TINY
-
-FRESULT f_forward (
- FIL *fp, /* Pointer to the file object */
- UINT (*func)(const BYTE*,UINT), /* Pointer to the streaming function */
- UINT btf, /* Number of bytes to forward */
- UINT *bf /* Pointer to number of bytes forwarded */
-)
-{
- FRESULT res;
- DWORD remain, clst, sect;
- UINT rcnt;
- BYTE csect;
-
-
- *bf = 0; /* Clear transfer byte counter */
-
- res = validate(fp); /* Check validity of the object */
- if (res != FR_OK) LEAVE_FF(fp->fs, res);
- if (fp->flag & FA__ERROR) /* Check error flag */
- LEAVE_FF(fp->fs, FR_INT_ERR);
- if (!(fp->flag & FA_READ)) /* Check access mode */
- LEAVE_FF(fp->fs, FR_DENIED);
-
- remain = fp->fsize - fp->fptr;
- if (btf > remain) btf = (UINT)remain; /* Truncate btf by remaining bytes */
-
- for ( ; btf && (*func)(0, 0); /* Repeat until all data transferred or stream becomes busy */
- fp->fptr += rcnt, *bf += rcnt, btf -= rcnt) {
- csect = (BYTE)(fp->fptr / SS(fp->fs) & (fp->fs->csize - 1)); /* Sector offset in the cluster */
- if ((fp->fptr % SS(fp->fs)) == 0) { /* On the sector boundary? */
- if (!csect) { /* On the cluster boundary? */
- clst = (fp->fptr == 0) ? /* On the top of the file? */
- fp->sclust : get_fat(fp->fs, fp->clust);
- if (clst <= 1) ABORT(fp->fs, FR_INT_ERR);
- if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
- fp->clust = clst; /* Update current cluster */
- }
- }
- sect = clust2sect(fp->fs, fp->clust); /* Get current data sector */
- if (!sect) ABORT(fp->fs, FR_INT_ERR);
- sect += csect;
- if (move_window(fp->fs, sect)) /* Move sector window */
- ABORT(fp->fs, FR_DISK_ERR);
- fp->dsect = sect;
- rcnt = SS(fp->fs) - (WORD)(fp->fptr % SS(fp->fs)); /* Forward data from sector window */
- if (rcnt > btf) rcnt = btf;
- rcnt = (*func)(&fp->fs->win[(WORD)fp->fptr % SS(fp->fs)], rcnt);
- if (!rcnt) ABORT(fp->fs, FR_INT_ERR);
- }
-
- LEAVE_FF(fp->fs, FR_OK);
-}
-#endif /* _USE_FORWARD */
-
-
-
-#if _USE_MKFS && !_FS_READONLY
-/*-----------------------------------------------------------------------*/
-/* Create File System on the Drive */
-/*-----------------------------------------------------------------------*/
-#define N_ROOTDIR 512 /* Number of root dir entries for FAT12/16 */
-#define N_FATS 1 /* Number of FAT copies (1 or 2) */
-
-
-FRESULT f_mkfs (
- BYTE vol, /* Logical drive number */
- BYTE sfd, /* Partitioning rule 0:FDISK, 1:SFD */
- UINT au /* Allocation unit size [bytes] */
-)
-{
- static const WORD vst[] = { 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 0};
- static const WORD cst[] = {32768, 16384, 8192, 4096, 2048, 16384, 8192, 4096, 2048, 1024, 512};
- BYTE fmt, md, sys, *tbl, pdrv, part;
- DWORD n_clst, vs, n, wsect;
- UINT i;
- DWORD b_vol, b_fat, b_dir, b_data; /* LBA */
- DWORD n_vol, n_rsv, n_fat, n_dir; /* Size */
- FATFS *fs;
- DSTATUS stat;
-
-
- /* Check mounted drive and clear work area */
- if (vol >= _VOLUMES) return FR_INVALID_DRIVE;
- if (sfd > 1) return FR_INVALID_PARAMETER;
- if (au & (au - 1)) return FR_INVALID_PARAMETER;
- fs = FatFs[vol];
- if (!fs) return FR_NOT_ENABLED;
- fs->fs_type = 0;
- pdrv = LD2PD(vol); /* Physical drive */
- part = LD2PT(vol); /* Partition (0:auto detect, 1-4:get from partition table)*/
-
- /* Get disk statics */
- stat = disk_initialize(pdrv);
- if (stat & STA_NOINIT) return FR_NOT_READY;
- if (stat & STA_PROTECT) return FR_WRITE_PROTECTED;
-#if _MAX_SS != 512 /* Get disk sector size */
- if (disk_ioctl(pdrv, GET_SECTOR_SIZE, &SS(fs)) != RES_OK || SS(fs) > _MAX_SS)
- return FR_DISK_ERR;
-#endif
- if (_MULTI_PARTITION && part) {
- /* Get partition information from partition table in the MBR */
- if (disk_read(pdrv, fs->win, 0, 1) != RES_OK) return FR_DISK_ERR;
- if (LD_WORD(fs->win+BS_55AA) != 0xAA55) return FR_MKFS_ABORTED;
- tbl = &fs->win[MBR_Table + (part - 1) * SZ_PTE];
- if (!tbl[4]) return FR_MKFS_ABORTED; /* No partition? */
- b_vol = LD_DWORD(tbl+8); /* Volume start sector */
- n_vol = LD_DWORD(tbl+12); /* Volume size */
- } else {
- /* Create a partition in this function */
- if (disk_ioctl(pdrv, GET_SECTOR_COUNT, &n_vol) != RES_OK || n_vol < 128)
- return FR_DISK_ERR;
- b_vol = (sfd) ? 0 : 63; /* Volume start sector */
- n_vol -= b_vol; /* Volume size */
- }
-
- if (!au) { /* AU auto selection */
- vs = n_vol / (2000 / (SS(fs) / 512));
- for (i = 0; vs < vst[i]; i++) ;
- au = cst[i];
- }
- au /= SS(fs); /* Number of sectors per cluster */
- if (au == 0) au = 1;
- if (au > 128) au = 128;
-
- /* Pre-compute number of clusters and FAT sub-type */
- n_clst = n_vol / au;
- fmt = FS_FAT12;
- if (n_clst >= MIN_FAT16) fmt = FS_FAT16;
- if (n_clst >= MIN_FAT32) fmt = FS_FAT32;
-
- /* Determine offset and size of FAT structure */
- if (fmt == FS_FAT32) {
- n_fat = ((n_clst * 4) + 8 + SS(fs) - 1) / SS(fs);
- n_rsv = 32;
- n_dir = 0;
- } else {
- n_fat = (fmt == FS_FAT12) ? (n_clst * 3 + 1) / 2 + 3 : (n_clst * 2) + 4;
- n_fat = (n_fat + SS(fs) - 1) / SS(fs);
- n_rsv = 1;
- n_dir = (DWORD)N_ROOTDIR * SZ_DIR / SS(fs);
- }
- b_fat = b_vol + n_rsv; /* FAT area start sector */
- b_dir = b_fat + n_fat * N_FATS; /* Directory area start sector */
- b_data = b_dir + n_dir; /* Data area start sector */
- if (n_vol < b_data + au - b_vol) return FR_MKFS_ABORTED; /* Too small volume */
-
- /* Align data start sector to erase block boundary (for flash memory media) */
- if (disk_ioctl(pdrv, GET_BLOCK_SIZE, &n) != RES_OK || !n || n > 32768) n = 1;
- n = (b_data + n - 1) & ~(n - 1); /* Next nearest erase block from current data start */
- n = (n - b_data) / N_FATS;
- if (fmt == FS_FAT32) { /* FAT32: Move FAT offset */
- n_rsv += n;
- b_fat += n;
- } else { /* FAT12/16: Expand FAT size */
- n_fat += n;
- }
-
- /* Determine number of clusters and final check of validity of the FAT sub-type */
- n_clst = (n_vol - n_rsv - n_fat * N_FATS - n_dir) / au;
- if ( (fmt == FS_FAT16 && n_clst < MIN_FAT16)
- || (fmt == FS_FAT32 && n_clst < MIN_FAT32))
- return FR_MKFS_ABORTED;
-
- switch (fmt) { /* Determine system ID for partition table */
- case FS_FAT12: sys = 0x01; break;
- case FS_FAT16: sys = (n_vol < 0x10000) ? 0x04 : 0x06; break;
- default: sys = 0x0C;
- }
-
- if (_MULTI_PARTITION && part) {
- /* Update system ID in the partition table */
- tbl = &fs->win[MBR_Table + (part - 1) * SZ_PTE];
- tbl[4] = sys;
- if (disk_write(pdrv, fs->win, 0, 1) != RES_OK) return FR_DISK_ERR;
- md = 0xF8;
- } else {
- if (sfd) { /* No partition table (SFD) */
- md = 0xF0;
- } else { /* Create partition table (FDISK) */
- mem_set(fs->win, 0, SS(fs));
- tbl = fs->win+MBR_Table; /* Create partition table for single partition in the drive */
- tbl[1] = 1; /* Partition start head */
- tbl[2] = 1; /* Partition start sector */
- tbl[3] = 0; /* Partition start cylinder */
- tbl[4] = sys; /* System type */
- tbl[5] = 254; /* Partition end head */
- n = (b_vol + n_vol) / 63 / 255;
- tbl[6] = (BYTE)((n >> 2) | 63); /* Partition end sector */
- tbl[7] = (BYTE)n; /* End cylinder */
- ST_DWORD(tbl+8, 63); /* Partition start in LBA */
- ST_DWORD(tbl+12, n_vol); /* Partition size in LBA */
- ST_WORD(fs->win+BS_55AA, 0xAA55); /* MBR signature */
- if (disk_write(pdrv, fs->win, 0, 1) != RES_OK) /* Write it to the MBR sector */
- return FR_DISK_ERR;
- md = 0xF8;
- }
- }
-
- /* Create BPB in the VBR */
- tbl = fs->win; /* Clear sector */
- mem_set(tbl, 0, SS(fs));
- mem_cpy(tbl, "\xEB\xFE\x90" "MSDOS5.0", 11);/* Boot jump code, OEM name */
- i = SS(fs); /* Sector size */
- ST_WORD(tbl+BPB_BytsPerSec, i);
- tbl[BPB_SecPerClus] = (BYTE)au; /* Sectors per cluster */
- ST_WORD(tbl+BPB_RsvdSecCnt, n_rsv); /* Reserved sectors */
- tbl[BPB_NumFATs] = N_FATS; /* Number of FATs */
- i = (fmt == FS_FAT32) ? 0 : N_ROOTDIR; /* Number of rootdir entries */
- ST_WORD(tbl+BPB_RootEntCnt, i);
- if (n_vol < 0x10000) { /* Number of total sectors */
- ST_WORD(tbl+BPB_TotSec16, n_vol);
- } else {
- ST_DWORD(tbl+BPB_TotSec32, n_vol);
- }
- tbl[BPB_Media] = md; /* Media descriptor */
- ST_WORD(tbl+BPB_SecPerTrk, 63); /* Number of sectors per track */
- ST_WORD(tbl+BPB_NumHeads, 255); /* Number of heads */
- ST_DWORD(tbl+BPB_HiddSec, b_vol); /* Hidden sectors */
- n = get_fattime(); /* Use current time as VSN */
- if (fmt == FS_FAT32) {
- ST_DWORD(tbl+BS_VolID32, n); /* VSN */
- ST_DWORD(tbl+BPB_FATSz32, n_fat); /* Number of sectors per FAT */
- ST_DWORD(tbl+BPB_RootClus, 2); /* Root directory start cluster (2) */
- ST_WORD(tbl+BPB_FSInfo, 1); /* FSInfo record offset (VBR+1) */
- ST_WORD(tbl+BPB_BkBootSec, 6); /* Backup boot record offset (VBR+6) */
- tbl[BS_DrvNum32] = 0x80; /* Drive number */
- tbl[BS_BootSig32] = 0x29; /* Extended boot signature */
- mem_cpy(tbl+BS_VolLab32, "NO NAME " "FAT32 ", 19); /* Volume label, FAT signature */
- } else {
- ST_DWORD(tbl+BS_VolID, n); /* VSN */
- ST_WORD(tbl+BPB_FATSz16, n_fat); /* Number of sectors per FAT */
- tbl[BS_DrvNum] = 0x80; /* Drive number */
- tbl[BS_BootSig] = 0x29; /* Extended boot signature */
- mem_cpy(tbl+BS_VolLab, "NO NAME " "FAT ", 19); /* Volume label, FAT signature */
- }
- ST_WORD(tbl+BS_55AA, 0xAA55); /* Signature (Offset is fixed here regardless of sector size) */
- if (disk_write(pdrv, tbl, b_vol, 1) != RES_OK) /* Write it to the VBR sector */
- return FR_DISK_ERR;
- if (fmt == FS_FAT32) /* Write backup VBR if needed (VBR+6) */
- disk_write(pdrv, tbl, b_vol + 6, 1);
-
- /* Initialize FAT area */
- wsect = b_fat;
- for (i = 0; i < N_FATS; i++) { /* Initialize each FAT copy */
- mem_set(tbl, 0, SS(fs)); /* 1st sector of the FAT */
- n = md; /* Media descriptor byte */
- if (fmt != FS_FAT32) {
- n |= (fmt == FS_FAT12) ? 0x00FFFF00 : 0xFFFFFF00;
- ST_DWORD(tbl+0, n); /* Reserve cluster #0-1 (FAT12/16) */
- } else {
- n |= 0xFFFFFF00;
- ST_DWORD(tbl+0, n); /* Reserve cluster #0-1 (FAT32) */
- ST_DWORD(tbl+4, 0xFFFFFFFF);
- ST_DWORD(tbl+8, 0x0FFFFFFF); /* Reserve cluster #2 for root dir */
- }
- if (disk_write(pdrv, tbl, wsect++, 1) != RES_OK)
- return FR_DISK_ERR;
- mem_set(tbl, 0, SS(fs)); /* Fill following FAT entries with zero */
- for (n = 1; n < n_fat; n++) { /* This loop may take a time on FAT32 volume due to many single sector writes */
- if (disk_write(pdrv, tbl, wsect++, 1) != RES_OK)
- return FR_DISK_ERR;
- }
- }
-
- /* Initialize root directory */
- i = (fmt == FS_FAT32) ? au : n_dir;
- do {
- if (disk_write(pdrv, tbl, wsect++, 1) != RES_OK)
- return FR_DISK_ERR;
- } while (--i);
-
-#if _USE_ERASE /* Erase data area if needed */
- {
- DWORD eb[2];
-
- eb[0] = wsect; eb[1] = wsect + (n_clst - ((fmt == FS_FAT32) ? 1 : 0)) * au - 1;
- disk_ioctl(pdrv, CTRL_ERASE_SECTOR, eb);
- }
-#endif
-
- /* Create FSInfo if needed */
- if (fmt == FS_FAT32) {
- ST_DWORD(tbl+FSI_LeadSig, 0x41615252);
- ST_DWORD(tbl+FSI_StrucSig, 0x61417272);
- ST_DWORD(tbl+FSI_Free_Count, n_clst - 1); /* Number of free clusters */
- ST_DWORD(tbl+FSI_Nxt_Free, 2); /* Last allocated cluster# */
- ST_WORD(tbl+BS_55AA, 0xAA55);
- disk_write(pdrv, tbl, b_vol + 1, 1); /* Write original (VBR+1) */
- disk_write(pdrv, tbl, b_vol + 7, 1); /* Write backup (VBR+7) */
- }
-
- return (disk_ioctl(pdrv, CTRL_SYNC, 0) == RES_OK) ? FR_OK : FR_DISK_ERR;
-}
-
-
-#if _MULTI_PARTITION
-/*-----------------------------------------------------------------------*/
-/* Divide Physical Drive */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_fdisk (
- BYTE pdrv, /* Physical drive number */
- const DWORD szt[], /* Pointer to the size table for each partitions */
- void* work /* Pointer to the working buffer */
-)
-{
- UINT i, n, sz_cyl, tot_cyl, b_cyl, e_cyl, p_cyl;
- BYTE s_hd, e_hd, *p, *buf = (BYTE*)work;
- DSTATUS stat;
- DWORD sz_disk, sz_part, s_part;
-
-
- stat = disk_initialize(pdrv);
- if (stat & STA_NOINIT) return FR_NOT_READY;
- if (stat & STA_PROTECT) return FR_WRITE_PROTECTED;
- if (disk_ioctl(pdrv, GET_SECTOR_COUNT, &sz_disk)) return FR_DISK_ERR;
-
- /* Determine CHS in the table regardless of the drive geometry */
- for (n = 16; n < 256 && sz_disk / n / 63 > 1024; n *= 2) ;
- if (n == 256) n--;
- e_hd = n - 1;
- sz_cyl = 63 * n;
- tot_cyl = sz_disk / sz_cyl;
-
- /* Create partition table */
- mem_set(buf, 0, _MAX_SS);
- p = buf + MBR_Table; b_cyl = 0;
- for (i = 0; i < 4; i++, p += SZ_PTE) {
- p_cyl = (szt[i] <= 100) ? (DWORD)tot_cyl * szt[i] / 100 : szt[i] / sz_cyl;
- if (!p_cyl) continue;
- s_part = (DWORD)sz_cyl * b_cyl;
- sz_part = (DWORD)sz_cyl * p_cyl;
- if (i == 0) { /* Exclude first track of cylinder 0 */
- s_hd = 1;
- s_part += 63; sz_part -= 63;
- } else {
- s_hd = 0;
- }
- e_cyl = b_cyl + p_cyl - 1;
- if (e_cyl >= tot_cyl) return FR_INVALID_PARAMETER;
-
- /* Set partition table */
- p[1] = s_hd; /* Start head */
- p[2] = (BYTE)((b_cyl >> 2) + 1); /* Start sector */
- p[3] = (BYTE)b_cyl; /* Start cylinder */
- p[4] = 0x06; /* System type (temporary setting) */
- p[5] = e_hd; /* End head */
- p[6] = (BYTE)((e_cyl >> 2) + 63); /* End sector */
- p[7] = (BYTE)e_cyl; /* End cylinder */
- ST_DWORD(p + 8, s_part); /* Start sector in LBA */
- ST_DWORD(p + 12, sz_part); /* Partition size */
-
- /* Next partition */
- b_cyl += p_cyl;
- }
- ST_WORD(p, 0xAA55);
-
- /* Write it to the MBR */
- return (disk_write(pdrv, buf, 0, 1) || disk_ioctl(pdrv, CTRL_SYNC, 0)) ? FR_DISK_ERR : FR_OK;
-}
-
-
-#endif /* _MULTI_PARTITION */
-#endif /* _USE_MKFS && !_FS_READONLY */
-
-
-
-
-#if _USE_STRFUNC
-/*-----------------------------------------------------------------------*/
-/* Get a string from the file */
-/*-----------------------------------------------------------------------*/
-
-TCHAR* f_gets (
- TCHAR* buff, /* Pointer to the string buffer to read */
- int len, /* Size of string buffer (characters) */
- FIL* fp /* Pointer to the file object */
-)
-{
- int n = 0;
- TCHAR c, *p = buff;
- BYTE s[2];
- UINT rc;
-
-
- while (n < len - 1) { /* Read bytes until buffer gets filled */
- f_read(fp, s, 1, &rc);
- if (rc != 1) break; /* Break on EOF or error */
- c = s[0];
-#if _LFN_UNICODE /* Read a character in UTF-8 encoding */
- if (c >= 0x80) {
- if (c < 0xC0) continue; /* Skip stray trailer */
- if (c < 0xE0) { /* Two-byte sequence */
- f_read(fp, s, 1, &rc);
- if (rc != 1) break;
- c = ((c & 0x1F) << 6) | (s[0] & 0x3F);
- if (c < 0x80) c = '?';
- } else {
- if (c < 0xF0) { /* Three-byte sequence */
- f_read(fp, s, 2, &rc);
- if (rc != 2) break;
- c = (c << 12) | ((s[0] & 0x3F) << 6) | (s[1] & 0x3F);
- if (c < 0x800) c = '?';
- } else { /* Reject four-byte sequence */
- c = '?';
- }
- }
- }
-#endif
-#if _USE_STRFUNC >= 2
- if (c == '\r') continue; /* Strip '\r' */
-#endif
- *p++ = c;
- n++;
- if (c == '\n') break; /* Break on EOL */
- }
- *p = 0;
- return n ? buff : 0; /* When no data read (eof or error), return with error. */
-}
-
-
-
-#if !_FS_READONLY
-#include <stdarg.h>
-/*-----------------------------------------------------------------------*/
-/* Put a character to the file */
-/*-----------------------------------------------------------------------*/
-
-int f_putc (
- TCHAR c, /* A character to be output */
- FIL* fp /* Pointer to the file object */
-)
-{
- UINT bw, btw;
- BYTE s[3];
-
-
-#if _USE_STRFUNC >= 2
- if (c == '\n') f_putc ('\r', fp); /* LF -> CRLF conversion */
-#endif
-
-#if _LFN_UNICODE /* Write the character in UTF-8 encoding */
- if (c < 0x80) { /* 7-bit */
- s[0] = (BYTE)c;
- btw = 1;
- } else {
- if (c < 0x800) { /* 11-bit */
- s[0] = (BYTE)(0xC0 | (c >> 6));
- s[1] = (BYTE)(0x80 | (c & 0x3F));
- btw = 2;
- } else { /* 16-bit */
- s[0] = (BYTE)(0xE0 | (c >> 12));
- s[1] = (BYTE)(0x80 | ((c >> 6) & 0x3F));
- s[2] = (BYTE)(0x80 | (c & 0x3F));
- btw = 3;
- }
- }
-#else /* Write the character without conversion */
- s[0] = (BYTE)c;
- btw = 1;
-#endif
- f_write(fp, s, btw, &bw); /* Write the char to the file */
- return (bw == btw) ? 1 : EOF; /* Return the result */
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Put a string to the file */
-/*-----------------------------------------------------------------------*/
-
-int f_puts (
- const TCHAR* str, /* Pointer to the string to be output */
- FIL* fp /* Pointer to the file object */
-)
-{
- int n;
-
-
- for (n = 0; *str; str++, n++) {
- if (f_putc(*str, fp) == EOF) return EOF;
- }
- return n;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Put a formatted string to the file */
-/*-----------------------------------------------------------------------*/
-
-int f_printf (
- FIL* fp, /* Pointer to the file object */
- const TCHAR* str, /* Pointer to the format string */
- ... /* Optional arguments... */
-)
-{
- va_list arp;
- BYTE f, r;
- UINT i, j, w;
- ULONG v;
- TCHAR c, d, s[16], *p;
- int res, chc, cc;
-
-
- va_start(arp, str);
-
- for (cc = res = 0; cc != EOF; res += cc) {
- c = *str++;
- if (c == 0) break; /* End of string */
- if (c != '%') { /* Non escape character */
- cc = f_putc(c, fp);
- if (cc != EOF) cc = 1;
- continue;
- }
- w = f = 0;
- c = *str++;
- if (c == '0') { /* Flag: '0' padding */
- f = 1; c = *str++;
- } else {
- if (c == '-') { /* Flag: left justified */
- f = 2; c = *str++;
- }
- }
- while (IsDigit(c)) { /* Precision */
- w = w * 10 + c - '0';
- c = *str++;
- }
- if (c == 'l' || c == 'L') { /* Prefix: Size is long int */
- f |= 4; c = *str++;
- }
- if (!c) break;
- d = c;
- if (IsLower(d)) d -= 0x20;
- switch (d) { /* Type is... */
- case 'S' : /* String */
- p = va_arg(arp, TCHAR*);
- for (j = 0; p[j]; j++) ;
- chc = 0;
- if (!(f & 2)) {
- while (j++ < w) chc += (cc = f_putc(' ', fp));
- }
- chc += (cc = f_puts(p, fp));
- while (j++ < w) chc += (cc = f_putc(' ', fp));
- if (cc != EOF) cc = chc;
- continue;
- case 'C' : /* Character */
- cc = f_putc((TCHAR)va_arg(arp, int), fp); continue;
- case 'B' : /* Binary */
- r = 2; break;
- case 'O' : /* Octal */
- r = 8; break;
- case 'D' : /* Signed decimal */
- case 'U' : /* Unsigned decimal */
- r = 10; break;
- case 'X' : /* Hexdecimal */
- r = 16; break;
- default: /* Unknown type (pass-through) */
- cc = f_putc(c, fp); continue;
- }
-
- /* Get an argument and put it in numeral */
- v = (f & 4) ? (ULONG)va_arg(arp, long) : ((d == 'D') ? (ULONG)(long)va_arg(arp, int) : (ULONG)va_arg(arp, unsigned int));
- if (d == 'D' && (v & 0x80000000)) {
- v = 0 - v;
- f |= 8;
- }
- i = 0;
- do {
- d = (TCHAR)(v % r); v /= r;
- if (d > 9) d += (c == 'x') ? 0x27 : 0x07;
- s[i++] = d + '0';
- } while (v && i < sizeof s / sizeof s[0]);
- if (f & 8) s[i++] = '-';
- j = i; d = (f & 1) ? '0' : ' ';
- chc = 0;
- while (!(f & 2) && j++ < w) chc += (cc = f_putc(d, fp));
- do chc += (cc = f_putc(s[--i], fp)); while(i);
- while (j++ < w) chc += (cc = f_putc(' ', fp));
- if (cc != EOF) cc = chc;
- }
-
- va_end(arp);
- return (cc == EOF) ? cc : res;
-}
-
-#endif /* !_FS_READONLY */
-#endif /* _USE_STRFUNC */
-
-#endif // CFG_TUH_MSC
diff --git a/tinyusb/lib/fatfs/ff.h b/tinyusb/lib/fatfs/ff.h
deleted file mode 100755
index 5c2a611a..00000000
--- a/tinyusb/lib/fatfs/ff.h
+++ /dev/null
@@ -1,342 +0,0 @@
-/*---------------------------------------------------------------------------/
-/ FatFs - FAT file system module include file R0.09b (C)ChaN, 2013
-/----------------------------------------------------------------------------/
-/ FatFs module is a generic FAT file system module for small embedded systems.
-/ This is a free software that opened for education, research and commercial
-/ developments under license policy of following terms.
-/
-/ Copyright (C) 2013, ChaN, all right reserved.
-/
-/ * The FatFs module is a free software and there is NO WARRANTY.
-/ * No restriction on use. You can use, modify and redistribute it for
-/ personal, non-profit or commercial product UNDER YOUR RESPONSIBILITY.
-/ * Redistributions of source code must retain the above copyright notice.
-/
-/----------------------------------------------------------------------------*/
-
-#ifndef _FATFS
-#define _FATFS 82786 /* Revision ID */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "integer.h" /* Basic integer types */
-#include "ffconf.h" /* FatFs configuration options */
-#include "tusb_config.h"
-
-#if _FATFS != _FFCONF
-#error Wrong configuration file (ffconf.h).
-#endif
-
-
-
-/* Definitions of volume management */
-
-#if _MULTI_PARTITION /* Multiple partition configuration */
-typedef struct {
- BYTE pd; /* Physical drive number */
- BYTE pt; /* Partition: 0:Auto detect, 1-4:Forced partition) */
-} PARTITION;
-extern PARTITION VolToPart[]; /* Volume - Partition resolution table */
-#define LD2PD(vol) (VolToPart[vol].pd) /* Get physical drive number */
-#define LD2PT(vol) (VolToPart[vol].pt) /* Get partition index */
-
-#else /* Single partition configuration */
-#define LD2PD(vol) (BYTE)(vol) /* Each logical drive is bound to the same physical drive number */
-#define LD2PT(vol) 0 /* Always mounts the 1st partition or in SFD */
-
-#endif
-
-
-
-/* Type of path name strings on FatFs API */
-
-#if _LFN_UNICODE /* Unicode string */
-#if !_USE_LFN
-#error _LFN_UNICODE must be 0 in non-LFN cfg.
-#endif
-#ifndef _INC_TCHAR
-typedef WCHAR TCHAR;
-#define _T(x) L ## x
-#define _TEXT(x) L ## x
-#endif
-
-#else /* ANSI/OEM string */
-#ifndef _INC_TCHAR
-typedef char TCHAR;
-#define _T(x) x
-#define _TEXT(x) x
-#endif
-
-#endif
-
-
-
-/* File system object structure (FATFS) */
-
-typedef struct {
- BYTE fs_type; /* FAT sub-type (0:Not mounted) */
- BYTE drv; /* Physical drive number */
- BYTE csize; /* Sectors per cluster (1,2,4...128) */
- BYTE n_fats; /* Number of FAT copies (1,2) */
- BYTE wflag; /* win[] dirty flag (1:must be written back) */
- BYTE fsi_flag; /* fsinfo dirty flag (1:must be written back) */
- WORD id; /* File system mount ID */
- WORD n_rootdir; /* Number of root directory entries (FAT12/16) */
-#if _MAX_SS != 512
- WORD ssize; /* Bytes per sector (512, 1024, 2048 or 4096) */
-#endif
-#if _FS_REENTRANT
- _SYNC_t sobj; /* Identifier of sync object */
-#endif
-#if !_FS_READONLY
- DWORD last_clust; /* Last allocated cluster */
- DWORD free_clust; /* Number of free clusters */
- DWORD fsi_sector; /* fsinfo sector (FAT32) */
-#endif
-#if _FS_RPATH
- DWORD cdir; /* Current directory start cluster (0:root) */
-#endif
- DWORD n_fatent; /* Number of FAT entries (= number of clusters + 2) */
- DWORD fsize; /* Sectors per FAT */
- DWORD volbase; /* Volume start sector */
- DWORD fatbase; /* FAT start sector */
- DWORD dirbase; /* Root directory start sector (FAT32:Cluster#) */
- DWORD database; /* Data start sector */
- DWORD winsect; /* Current sector appearing in the win[] */
- BYTE win[_MAX_SS]; /* Disk access window for Directory, FAT (and Data on tiny cfg) */
-} FATFS;
-
-
-
-/* File object structure (FIL) */
-
-typedef struct {
- FATFS* fs; /* Pointer to the related file system object (**do not change order**) */
- WORD id; /* Owner file system mount ID (**do not change order**) */
- BYTE flag; /* File status flags */
- BYTE pad1;
- DWORD fptr; /* File read/write pointer (0ed on file open) */
- DWORD fsize; /* File size */
- DWORD sclust; /* File data start cluster (0:no data cluster, always 0 when fsize is 0) */
- DWORD clust; /* Current cluster of fpter */
- DWORD dsect; /* Current data sector of fpter */
-#if !_FS_READONLY
- DWORD dir_sect; /* Sector containing the directory entry */
- BYTE* dir_ptr; /* Pointer to the directory entry in the window */
-#endif
-#if _USE_FASTSEEK
- DWORD* cltbl; /* Pointer to the cluster link map table (null on file open) */
-#endif
-#if _FS_LOCK
- UINT lockid; /* File lock ID (index of file semaphore table Files[]) */
-#endif
-#if !_FS_TINY
- BYTE buf[_MAX_SS]; /* File data read/write buffer */
-#endif
-} FIL;
-
-
-
-/* Directory object structure (DIR) */
-
-typedef struct {
- FATFS* fs; /* Pointer to the owner file system object (**do not change order**) */
- WORD id; /* Owner file system mount ID (**do not change order**) */
- WORD index; /* Current read/write index number */
- DWORD sclust; /* Table start cluster (0:Root dir) */
- DWORD clust; /* Current cluster */
- DWORD sect; /* Current sector */
- BYTE* dir; /* Pointer to the current SFN entry in the win[] */
- BYTE* fn; /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
-#if _USE_LFN
- WCHAR* lfn; /* Pointer to the LFN working buffer */
- WORD lfn_idx; /* Last matched LFN index number (0xFFFF:No LFN) */
-#endif
-} DIR;
-
-
-
-/* File status structure (FILINFO) */
-
-typedef struct {
- DWORD fsize; /* File size */
- WORD fdate; /* Last modified date */
- WORD ftime; /* Last modified time */
- BYTE fattrib; /* Attribute */
- TCHAR fname[13]; /* Short file name (8.3 format) */
-#if _USE_LFN
- TCHAR* lfname; /* Pointer to the LFN buffer */
- UINT lfsize; /* Size of LFN buffer in TCHAR */
-#endif
-} FILINFO;
-
-
-
-/* File function return code (FRESULT) */
-
-typedef enum {
- FR_OK = 0, /* (0) Succeeded */
- FR_DISK_ERR, /* (1) A hard error occurred in the low level disk I/O layer */
- FR_INT_ERR, /* (2) Assertion failed */
- FR_NOT_READY, /* (3) The physical drive cannot work */
- FR_NO_FILE, /* (4) Could not find the file */
- FR_NO_PATH, /* (5) Could not find the path */
- FR_INVALID_NAME, /* (6) The path name format is invalid */
- FR_DENIED, /* (7) Access denied due to prohibited access or directory full */
- FR_EXIST, /* (8) Access denied due to prohibited access */
- FR_INVALID_OBJECT, /* (9) The file/directory object is invalid */
- FR_WRITE_PROTECTED, /* (10) The physical drive is write protected */
- FR_INVALID_DRIVE, /* (11) The logical drive number is invalid */
- FR_NOT_ENABLED, /* (12) The volume has no work area */
- FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume */
- FR_MKFS_ABORTED, /* (14) The f_mkfs() aborted due to any parameter error */
- FR_TIMEOUT, /* (15) Could not get a grant to access the volume within defined period */
- FR_LOCKED, /* (16) The operation is rejected according to the file sharing policy */
- FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated */
- FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > _FS_SHARE */
- FR_INVALID_PARAMETER /* (19) Given parameter is invalid */
-} FRESULT;
-
-
-
-/*--------------------------------------------------------------*/
-/* FatFs module application interface */
-
-FRESULT f_mount (BYTE vol, FATFS* fs); /* Mount/Unmount a logical drive */
-FRESULT f_open (FIL* fp, const TCHAR* path, BYTE mode); /* Open or create a file */
-FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br); /* Read data from a file */
-FRESULT f_lseek (FIL* fp, DWORD ofs); /* Move file pointer of a file object */
-FRESULT f_close (FIL* fp); /* Close an open file object */
-FRESULT f_opendir (DIR* dj, const TCHAR* path); /* Open an existing directory */
-FRESULT f_readdir (DIR* dj, FILINFO* fno); /* Read a directory item */
-FRESULT f_stat (const TCHAR* path, FILINFO* fno); /* Get file status */
-FRESULT f_write (FIL* fp, const void* buff, UINT btw, UINT* bw); /* Write data to a file */
-FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs); /* Get number of free clusters on the drive */
-FRESULT f_truncate (FIL* fp); /* Truncate file */
-FRESULT f_sync (FIL* fp); /* Flush cached data of a writing file */
-FRESULT f_unlink (const TCHAR* path); /* Delete an existing file or directory */
-FRESULT f_mkdir (const TCHAR* path); /* Create a new directory */
-FRESULT f_chmod (const TCHAR* path, BYTE value, BYTE mask); /* Change attribute of the file/dir */
-FRESULT f_utime (const TCHAR* path, const FILINFO* fno); /* Change times-tamp of the file/dir */
-FRESULT f_rename (const TCHAR* path_old, const TCHAR* path_new); /* Rename/Move a file or directory */
-FRESULT f_chdrive (BYTE drv); /* Change current drive */
-BYTE f_get_current_drive(void);
-FRESULT f_chdir (const TCHAR* path); /* Change current directory */
-FRESULT f_getcwd (TCHAR* buff, UINT len); /* Get current directory */
-FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* sn); /* Get volume label */
-FRESULT f_setlabel (const TCHAR* label); /* Set volume label */
-FRESULT f_forward (FIL* fp, UINT(*func)(const BYTE*,UINT), UINT btf, UINT* bf); /* Forward data to the stream */
-FRESULT f_mkfs (BYTE vol, BYTE sfd, UINT au); /* Create a file system on the drive */
-FRESULT f_fdisk (BYTE pdrv, const DWORD szt[], void* work); /* Divide a physical drive into some partitions */
-int f_putc (TCHAR c, FIL* fp); /* Put a character to the file */
-int f_puts (const TCHAR* str, FIL* cp); /* Put a string to the file */
-int f_printf (FIL* fp, const TCHAR* str, ...); /* Put a formatted string to the file */
-TCHAR* f_gets (TCHAR* buff, int len, FIL* fp); /* Get a string from the file */
-
-#define f_eof(fp) (((fp)->fptr == (fp)->fsize) ? 1 : 0)
-#define f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)
-#define f_tell(fp) ((fp)->fptr)
-#define f_size(fp) ((fp)->fsize)
-
-#ifndef EOF
-#define EOF (-1)
-#endif
-
-
-
-
-/*--------------------------------------------------------------*/
-/* Additional user defined functions */
-
-/* RTC function */
-#if !_FS_READONLY
-DWORD get_fattime (void);
-#endif
-
-/* Unicode support functions */
-#if _USE_LFN /* Unicode - OEM code conversion */
-WCHAR ff_convert (WCHAR chr, UINT dir); /* OEM-Unicode bidirectional conversion */
-WCHAR ff_wtoupper (WCHAR chr); /* Unicode upper-case conversion */
-#if _USE_LFN == 3 /* Memory functions */
-void* ff_memalloc (UINT msize); /* Allocate memory block */
-void ff_memfree (void* mblock); /* Free memory block */
-#endif
-#endif
-
-/* Sync functions */
-#if _FS_REENTRANT
-int ff_cre_syncobj (BYTE vol, _SYNC_t* sobj); /* Create a sync object */
-int ff_req_grant (_SYNC_t sobj); /* Lock sync object */
-void ff_rel_grant (_SYNC_t sobj); /* Unlock sync object */
-int ff_del_syncobj (_SYNC_t sobj); /* Delete a sync object */
-#endif
-
-
-
-
-/*--------------------------------------------------------------*/
-/* Flags and offset address */
-
-
-/* File access control and file status flags (FIL.flag) */
-
-#define FA_READ 0x01
-#define FA_OPEN_EXISTING 0x00
-#define FA__ERROR 0x80
-
-#if !_FS_READONLY
-#define FA_WRITE 0x02
-#define FA_CREATE_NEW 0x04
-#define FA_CREATE_ALWAYS 0x08
-#define FA_OPEN_ALWAYS 0x10
-#define FA__WRITTEN 0x20
-#define FA__DIRTY 0x40
-#endif
-
-
-/* FAT sub type (FATFS.fs_type) */
-
-#define FS_FAT12 1
-#define FS_FAT16 2
-#define FS_FAT32 3
-
-
-/* File attribute bits for directory entry */
-
-#define AM_RDO 0x01 /* Read only */
-#define AM_HID 0x02 /* Hidden */
-#define AM_SYS 0x04 /* System */
-#define AM_VOL 0x08 /* Volume label */
-#define AM_LFN 0x0F /* LFN entry */
-#define AM_DIR 0x10 /* Directory */
-#define AM_ARC 0x20 /* Archive */
-#define AM_MASK 0x3F /* Mask of defined bits */
-
-
-/* Fast seek feature */
-#define CREATE_LINKMAP 0xFFFFFFFF
-
-
-
-/*--------------------------------*/
-/* Multi-byte word access macros */
-
-#if _WORD_ACCESS == 1 /* Enable word access to the FAT structure */
-#define LD_WORD(ptr) (WORD)(*(WORD*)(BYTE*)(ptr))
-#define LD_DWORD(ptr) (DWORD)(*(DWORD*)(BYTE*)(ptr))
-#define ST_WORD(ptr,val) *(WORD*)(BYTE*)(ptr)=(WORD)(val)
-#define ST_DWORD(ptr,val) *(DWORD*)(BYTE*)(ptr)=(DWORD)(val)
-#else /* Use byte-by-byte access to the FAT structure */
-#define LD_WORD(ptr) (WORD)(((WORD)*((BYTE*)(ptr)+1)<<8)|(WORD)*(BYTE*)(ptr))
-#define LD_DWORD(ptr) (DWORD)(((DWORD)*((BYTE*)(ptr)+3)<<24)|((DWORD)*((BYTE*)(ptr)+2)<<16)|((WORD)*((BYTE*)(ptr)+1)<<8)|*(BYTE*)(ptr))
-#define ST_WORD(ptr,val) *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8)
-#define ST_DWORD(ptr,val) *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8); *((BYTE*)(ptr)+2)=(BYTE)((DWORD)(val)>>16); *((BYTE*)(ptr)+3)=(BYTE)((DWORD)(val)>>24)
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _FATFS */
diff --git a/tinyusb/lib/fatfs/ffconf.h b/tinyusb/lib/fatfs/ffconf.h
deleted file mode 100755
index 782057ea..00000000
--- a/tinyusb/lib/fatfs/ffconf.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/*---------------------------------------------------------------------------/
-/ FatFs - FAT file system module configuration file R0.09b (C)ChaN, 2013
-/----------------------------------------------------------------------------/
-/
-/ CAUTION! Do not forget to make clean the project after any changes to
-/ the configuration options.
-/
-/----------------------------------------------------------------------------*/
-#ifndef _FFCONF
-#define _FFCONF 82786 /* Revision ID */
-
-#include "tusb_config.h"
-
-/*---------------------------------------------------------------------------/
-/ Functions and Buffer Configurations
-/----------------------------------------------------------------------------*/
-
-#define _FS_TINY 0 /* 0:Normal or 1:Tiny */
-/* When _FS_TINY is set to 1, FatFs uses the sector buffer in the file system
-/ object instead of the sector buffer in the individual file object for file
-/ data transfer. This reduces memory consumption 512 bytes each file object. */
-
-
-#define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */
-/* Setting _FS_READONLY to 1 defines read only configuration. This removes
-/ writing functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename,
-/ f_truncate and useless f_getfree. */
-
-
-#define _FS_MINIMIZE 0 /* 0 to 3 */
-/* The _FS_MINIMIZE option defines minimization level to remove some functions.
-/
-/ 0: Full function.
-/ 1: f_stat, f_getfree, f_unlink, f_mkdir, f_chmod, f_truncate and f_rename
-/ are removed.
-/ 2: f_opendir and f_readdir are removed in addition to 1.
-/ 3: f_lseek is removed in addition to 2. */
-
-
-#define _USE_STRFUNC 0 /* 0:Disable or 1-2:Enable */
-/* To enable string functions, set _USE_STRFUNC to 1 or 2. */
-
-
-#define _USE_MKFS 0 /* 0:Disable or 1:Enable */
-/* To enable f_mkfs function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */
-
-
-#define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */
-/* To enable fast seek feature, set _USE_FASTSEEK to 1. */
-
-
-#define _USE_LABEL 1 /* 0:Disable or 1:Enable */
-/* To enable volume label functions, set _USE_LAVEL to 1 */
-
-
-#define _USE_FORWARD 0 /* 0:Disable or 1:Enable */
-/* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
-
-
-/*---------------------------------------------------------------------------/
-/ Locale and Namespace Configurations
-/----------------------------------------------------------------------------*/
-
-#define _CODE_PAGE 437
-/* The _CODE_PAGE specifies the OEM code page to be used on the target system.
-/ Incorrect setting of the code page can cause a file open failure.
-/
-/ 932 - Japanese Shift-JIS (DBCS, OEM, Windows)
-/ 936 - Simplified Chinese GBK (DBCS, OEM, Windows)
-/ 949 - Korean (DBCS, OEM, Windows)
-/ 950 - Traditional Chinese Big5 (DBCS, OEM, Windows)
-/ 1250 - Central Europe (Windows)
-/ 1251 - Cyrillic (Windows)
-/ 1252 - Latin 1 (Windows)
-/ 1253 - Greek (Windows)
-/ 1254 - Turkish (Windows)
-/ 1255 - Hebrew (Windows)
-/ 1256 - Arabic (Windows)
-/ 1257 - Baltic (Windows)
-/ 1258 - Vietnam (OEM, Windows)
-/ 437 - U.S. (OEM)
-/ 720 - Arabic (OEM)
-/ 737 - Greek (OEM)
-/ 775 - Baltic (OEM)
-/ 850 - Multilingual Latin 1 (OEM)
-/ 858 - Multilingual Latin 1 + Euro (OEM)
-/ 852 - Latin 2 (OEM)
-/ 855 - Cyrillic (OEM)
-/ 866 - Russian (OEM)
-/ 857 - Turkish (OEM)
-/ 862 - Hebrew (OEM)
-/ 874 - Thai (OEM, Windows)
-/ 1 - ASCII only (Valid for non LFN cfg.)
-*/
-
-
-#define _USE_LFN 1 /* 0 to 3 */
-#define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */
-/* The _USE_LFN option switches the LFN support.
-/
-/ 0: Disable LFN feature. _MAX_LFN and _LFN_UNICODE have no effect.
-/ 1: Enable LFN with static working buffer on the BSS. Always NOT reentrant.
-/ 2: Enable LFN with dynamic working buffer on the STACK.
-/ 3: Enable LFN with dynamic working buffer on the HEAP.
-/
-/ The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. To enable LFN,
-/ Unicode handling functions ff_convert() and ff_wtoupper() must be added
-/ to the project. When enable to use heap, memory control functions
-/ ff_memalloc() and ff_memfree() must be added to the project. */
-
-
-#define _LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */
-/* To switch the character code set on FatFs API to Unicode,
-/ enable LFN feature and set _LFN_UNICODE to 1. */
-
-
-#define _FS_RPATH 2 /* 0 to 2 */
-/* The _FS_RPATH option configures relative path feature.
-/
-/ 0: Disable relative path feature and remove related functions.
-/ 1: Enable relative path. f_chdrive() and f_chdir() are available.
-/ 2: f_getcwd() is available in addition to 1.
-/
-/ Note that output of the f_readdir fnction is affected by this option. */
-
-
-/*---------------------------------------------------------------------------/
-/ Physical Drive Configurations
-/----------------------------------------------------------------------------*/
-
-#define _VOLUMES CFG_TUH_DEVICE_MAX
-/* Number of volumes (logical drives) to be used. */
-
-
-#define _MAX_SS 512 /* 512, 1024, 2048 or 4096 */
-/* Maximum sector size to be handled.
-/ Always set 512 for memory card and hard disk but a larger value may be
-/ required for on-board flash memory, floppy disk and optical disk.
-/ When _MAX_SS is larger than 512, it configures FatFs to variable sector size
-/ and GET_SECTOR_SIZE command must be implememted to the disk_ioctl function. */
-
-
-#define _MULTI_PARTITION 0 /* 0:Single partition, 1:Enable multiple partition */
-/* When set to 0, each volume is bound to the same physical drive number and
-/ it can mount only first primaly partition. When it is set to 1, each volume
-/ is tied to the partitions listed in VolToPart[]. */
-
-
-#define _USE_ERASE 0 /* 0:Disable or 1:Enable */
-/* To enable sector erase feature, set _USE_ERASE to 1. CTRL_ERASE_SECTOR command
-/ should be added to the disk_ioctl functio. */
-
-
-
-/*---------------------------------------------------------------------------/
-/ System Configurations
-/----------------------------------------------------------------------------*/
-
-#define _WORD_ACCESS 0 /* 0 or 1 */
-/* Set 0 first and it is always compatible with all platforms. The _WORD_ACCESS
-/ option defines which access method is used to the word data on the FAT volume.
-/
-/ 0: Byte-by-byte access.
-/ 1: Word access. Do not choose this unless following condition is met.
-/
-/ When the byte order on the memory is big-endian or address miss-aligned word
-/ access results incorrect behavior, the _WORD_ACCESS must be set to 0.
-/ If it is not the case, the value can also be set to 1 to improve the
-/ performance and code size.
-*/
-
-
-/* A header file that defines sync object types on the O/S, such as
-/ windows.h, ucos_ii.h and semphr.h, must be included prior to ff.h. */
-
-#define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */
-#define _FS_TIMEOUT 1000 /* Timeout period in unit of time ticks */
-#define _SYNC_t HANDLE /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */
-
-/* The _FS_REENTRANT option switches the reentrancy (thread safe) of the FatFs module.
-/
-/ 0: Disable reentrancy. _SYNC_t and _FS_TIMEOUT have no effect.
-/ 1: Enable reentrancy. Also user provided synchronization handlers,
-/ ff_req_grant, ff_rel_grant, ff_del_syncobj and ff_cre_syncobj
-/ function must be added to the project. */
-
-
-#define _FS_LOCK 0 /* 0:Disable or >=1:Enable */
-/* To enable file lock control feature, set _FS_LOCK to 1 or greater.
- The value defines how many files can be opened simultaneously. */
-
-
-#endif /* _FFCONFIG */
diff --git a/tinyusb/lib/fatfs/integer.h b/tinyusb/lib/fatfs/integer.h
deleted file mode 100755
index f34f56d9..00000000
--- a/tinyusb/lib/fatfs/integer.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*-------------------------------------------*/
-/* Integer type definitions for FatFs module */
-/*-------------------------------------------*/
-
-#ifndef _INTEGER
-#define _INTEGER
-
-#ifdef _WIN32 /* FatFs development platform */
-
-#include <windows.h>
-#include <tchar.h>
-
-#else /* Embedded platform */
-
-/* These types must be 16-bit, 32-bit or larger integer */
-typedef int INT;
-typedef unsigned int UINT;
-
-/* These types must be 8-bit integer */
-typedef unsigned char UCHAR;
-typedef unsigned char BYTE;
-
-/* These types must be 16-bit integer */
-typedef short SHORT;
-typedef unsigned short USHORT;
-typedef unsigned short WORD;
-typedef unsigned short WCHAR;
-
-/* These types must be 32-bit integer */
-typedef long LONG;
-typedef unsigned long ULONG;
-typedef unsigned long DWORD;
-
-#endif
-
-#endif
diff --git a/tinyusb/lib/networking/dhserver.c b/tinyusb/lib/networking/dhserver.c
deleted file mode 100755
index 9287858e..00000000
--- a/tinyusb/lib/networking/dhserver.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 by Sergey Fetisov <fsenok@gmail.com>
- *
- * 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.
- */
-
-#include "dhserver.h"
-
-/* DHCP message type */
-#define DHCP_DISCOVER 1
-#define DHCP_OFFER 2
-#define DHCP_REQUEST 3
-#define DHCP_DECLINE 4
-#define DHCP_ACK 5
-#define DHCP_NAK 6
-#define DHCP_RELEASE 7
-#define DHCP_INFORM 8
-
-/* DHCP options */
-enum DHCP_OPTIONS
-{
- DHCP_PAD = 0,
- DHCP_SUBNETMASK = 1,
- DHCP_ROUTER = 3,
- DHCP_DNSSERVER = 6,
- DHCP_HOSTNAME = 12,
- DHCP_DNSDOMAIN = 15,
- DHCP_MTU = 26,
- DHCP_BROADCAST = 28,
- DHCP_PERFORMROUTERDISC = 31,
- DHCP_STATICROUTE = 33,
- DHCP_NISDOMAIN = 40,
- DHCP_NISSERVER = 41,
- DHCP_NTPSERVER = 42,
- DHCP_VENDOR = 43,
- DHCP_IPADDRESS = 50,
- DHCP_LEASETIME = 51,
- DHCP_OPTIONSOVERLOADED = 52,
- DHCP_MESSAGETYPE = 53,
- DHCP_SERVERID = 54,
- DHCP_PARAMETERREQUESTLIST = 55,
- DHCP_MESSAGE = 56,
- DHCP_MAXMESSAGESIZE = 57,
- DHCP_RENEWALTIME = 58,
- DHCP_REBINDTIME = 59,
- DHCP_CLASSID = 60,
- DHCP_CLIENTID = 61,
- DHCP_USERCLASS = 77, /* RFC 3004 */
- DHCP_FQDN = 81,
- DHCP_DNSSEARCH = 119, /* RFC 3397 */
- DHCP_CSR = 121, /* RFC 3442 */
- DHCP_MSCSR = 249, /* MS code for RFC 3442 */
- DHCP_END = 255
-};
-
-typedef struct
-{
- uint8_t dp_op; /* packet opcode type */
- uint8_t dp_htype; /* hardware addr type */
- uint8_t dp_hlen; /* hardware addr length */
- uint8_t dp_hops; /* gateway hops */
- uint32_t dp_xid; /* transaction ID */
- uint16_t dp_secs; /* seconds since boot began */
- uint16_t dp_flags;
- uint8_t dp_ciaddr[4]; /* client IP address */
- uint8_t dp_yiaddr[4]; /* 'your' IP address */
- uint8_t dp_siaddr[4]; /* server IP address */
- uint8_t dp_giaddr[4]; /* gateway IP address */
- uint8_t dp_chaddr[16]; /* client hardware address */
- uint8_t dp_legacy[192];
- uint8_t dp_magic[4];
- uint8_t dp_options[275]; /* options area */
-} DHCP_TYPE;
-
-DHCP_TYPE dhcp_data;
-static struct udp_pcb *pcb = NULL;
-static const dhcp_config_t *config = NULL;
-
-char magic_cookie[] = {0x63,0x82,0x53,0x63};
-
-static ip_addr_t get_ip(const uint8_t *pnt)
-{
- ip_addr_t result;
- memcpy(&result, pnt, sizeof(result));
- return result;
-}
-
-static void set_ip(uint8_t *pnt, ip_addr_t value)
-{
- memcpy(pnt, &value.addr, sizeof(value.addr));
-}
-
-static dhcp_entry_t *entry_by_ip(ip_addr_t ip)
-{
- int i;
- for (i = 0; i < config->num_entry; i++)
- if (config->entries[i].addr.addr == ip.addr)
- return &config->entries[i];
- return NULL;
-}
-
-static dhcp_entry_t *entry_by_mac(uint8_t *mac)
-{
- int i;
- for (i = 0; i < config->num_entry; i++)
- if (memcmp(config->entries[i].mac, mac, 6) == 0)
- return &config->entries[i];
- return NULL;
-}
-
-static __inline bool is_vacant(dhcp_entry_t *entry)
-{
- return memcmp("\0\0\0\0\0", entry->mac, 6) == 0;
-}
-
-static dhcp_entry_t *vacant_address(void)
-{
- int i;
- for (i = 0; i < config->num_entry; i++)
- if (is_vacant(config->entries + i))
- return config->entries + i;
- return NULL;
-}
-
-static __inline void free_entry(dhcp_entry_t *entry)
-{
- memset(entry->mac, 0, 6);
-}
-
-uint8_t *find_dhcp_option(uint8_t *attrs, int size, uint8_t attr)
-{
- int i = 0;
- while ((i + 1) < size)
- {
- int next = i + attrs[i + 1] + 2;
- if (next > size) return NULL;
- if (attrs[i] == attr)
- return attrs + i;
- i = next;
- }
- return NULL;
-}
-
-int fill_options(void *dest,
- uint8_t msg_type,
- const char *domain,
- ip_addr_t dns,
- int lease_time,
- ip_addr_t serverid,
- ip_addr_t router,
- ip_addr_t subnet)
-{
- uint8_t *ptr = (uint8_t *)dest;
- /* ACK message type */
- *ptr++ = 53;
- *ptr++ = 1;
- *ptr++ = msg_type;
-
- /* dhcp server identifier */
- *ptr++ = DHCP_SERVERID;
- *ptr++ = 4;
- set_ip(ptr, serverid);
- ptr += 4;
-
- /* lease time */
- *ptr++ = DHCP_LEASETIME;
- *ptr++ = 4;
- *ptr++ = (lease_time >> 24) & 0xFF;
- *ptr++ = (lease_time >> 16) & 0xFF;
- *ptr++ = (lease_time >> 8) & 0xFF;
- *ptr++ = (lease_time >> 0) & 0xFF;
-
- /* subnet mask */
- *ptr++ = DHCP_SUBNETMASK;
- *ptr++ = 4;
- set_ip(ptr, subnet);
- ptr += 4;
-
- /* router */
- if (router.addr != 0)
- {
- *ptr++ = DHCP_ROUTER;
- *ptr++ = 4;
- set_ip(ptr, router);
- ptr += 4;
- }
-
- /* domain name */
- if (domain != NULL)
- {
- int len = strlen(domain);
- *ptr++ = DHCP_DNSDOMAIN;
- *ptr++ = len;
- memcpy(ptr, domain, len);
- ptr += len;
- }
-
- /* domain name server (DNS) */
- if (dns.addr != 0)
- {
- *ptr++ = DHCP_DNSSERVER;
- *ptr++ = 4;
- set_ip(ptr, dns);
- ptr += 4;
- }
-
- /* end */
- *ptr++ = DHCP_END;
- return ptr - (uint8_t *)dest;
-}
-
-static void udp_recv_proc(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port)
-{
- uint8_t *ptr;
- dhcp_entry_t *entry;
- struct pbuf *pp;
- struct netif *netif = netif_get_by_index(p->if_idx);
-
- (void)arg;
- (void)addr;
-
- unsigned n = p->len;
- if (n > sizeof(dhcp_data)) n = sizeof(dhcp_data);
- memcpy(&dhcp_data, p->payload, n);
- switch (dhcp_data.dp_options[2])
- {
- case DHCP_DISCOVER:
- entry = entry_by_mac(dhcp_data.dp_chaddr);
- if (entry == NULL) entry = vacant_address();
- if (entry == NULL) break;
-
- dhcp_data.dp_op = 2; /* reply */
- dhcp_data.dp_secs = 0;
- dhcp_data.dp_flags = 0;
- set_ip(dhcp_data.dp_yiaddr, entry->addr);
- memcpy(dhcp_data.dp_magic, magic_cookie, 4);
-
- memset(dhcp_data.dp_options, 0, sizeof(dhcp_data.dp_options));
-
- fill_options(dhcp_data.dp_options,
- DHCP_OFFER,
- config->domain,
- config->dns,
- entry->lease,
- *netif_ip4_addr(netif),
- config->router,
- *netif_ip4_netmask(netif));
-
- pp = pbuf_alloc(PBUF_TRANSPORT, sizeof(dhcp_data), PBUF_POOL);
- if (pp == NULL) break;
- memcpy(pp->payload, &dhcp_data, sizeof(dhcp_data));
- udp_sendto(upcb, pp, IP_ADDR_BROADCAST, port);
- pbuf_free(pp);
- break;
-
- case DHCP_REQUEST:
- /* 1. find requested ipaddr in option list */
- ptr = find_dhcp_option(dhcp_data.dp_options, sizeof(dhcp_data.dp_options), DHCP_IPADDRESS);
- if (ptr == NULL) break;
- if (ptr[1] != 4) break;
- ptr += 2;
-
- /* 2. does hw-address registered? */
- entry = entry_by_mac(dhcp_data.dp_chaddr);
- if (entry != NULL) free_entry(entry);
-
- /* 3. find requested ipaddr */
- entry = entry_by_ip(get_ip(ptr));
- if (entry == NULL) break;
- if (!is_vacant(entry)) break;
-
- /* 4. fill struct fields */
- memcpy(dhcp_data.dp_yiaddr, ptr, 4);
- dhcp_data.dp_op = 2; /* reply */
- dhcp_data.dp_secs = 0;
- dhcp_data.dp_flags = 0;
- memcpy(dhcp_data.dp_magic, magic_cookie, 4);
-
- /* 5. fill options */
- memset(dhcp_data.dp_options, 0, sizeof(dhcp_data.dp_options));
-
- fill_options(dhcp_data.dp_options,
- DHCP_ACK,
- config->domain,
- config->dns,
- entry->lease,
- *netif_ip4_addr(netif),
- config->router,
- *netif_ip4_netmask(netif));
-
- /* 6. send ACK */
- pp = pbuf_alloc(PBUF_TRANSPORT, sizeof(dhcp_data), PBUF_POOL);
- if (pp == NULL) break;
- memcpy(entry->mac, dhcp_data.dp_chaddr, 6);
- memcpy(pp->payload, &dhcp_data, sizeof(dhcp_data));
- udp_sendto(upcb, pp, IP_ADDR_BROADCAST, port);
- pbuf_free(pp);
- break;
-
- default:
- break;
- }
- pbuf_free(p);
-}
-
-err_t dhserv_init(const dhcp_config_t *c)
-{
- err_t err;
- udp_init();
- dhserv_free();
- pcb = udp_new();
- if (pcb == NULL)
- return ERR_MEM;
- err = udp_bind(pcb, IP_ADDR_ANY, c->port);
- if (err != ERR_OK)
- {
- dhserv_free();
- return err;
- }
- udp_recv(pcb, udp_recv_proc, NULL);
- config = c;
- return ERR_OK;
-}
-
-void dhserv_free(void)
-{
- if (pcb == NULL) return;
- udp_remove(pcb);
- pcb = NULL;
-}
diff --git a/tinyusb/lib/networking/dhserver.h b/tinyusb/lib/networking/dhserver.h
deleted file mode 100755
index 0d22461c..00000000
--- a/tinyusb/lib/networking/dhserver.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 by Sergey Fetisov <fsenok@gmail.com>
- *
- * 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.
- */
-
-/*
- * version: 1.0 demo (7.02.2015)
- * brief: tiny dhcp ipv4 server using lwip (pcb)
- * ref: https://lists.gnu.org/archive/html/lwip-users/2012-12/msg00016.html
- */
-
-#ifndef DHSERVER_H
-#define DHSERVER_H
-
-#include <stdint.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-#include "lwip/err.h"
-#include "lwip/udp.h"
-#include "netif/etharp.h"
-
-typedef struct dhcp_entry
-{
- uint8_t mac[6];
- ip_addr_t addr;
- uint32_t lease;
-} dhcp_entry_t;
-
-typedef struct dhcp_config
-{
- ip_addr_t router;
- uint16_t port;
- ip_addr_t dns;
- const char *domain;
- int num_entry;
- dhcp_entry_t *entries;
-} dhcp_config_t;
-
-err_t dhserv_init(const dhcp_config_t *config);
-void dhserv_free(void);
-
-#endif /* DHSERVER_H */
diff --git a/tinyusb/lib/networking/dnserver.c b/tinyusb/lib/networking/dnserver.c
deleted file mode 100755
index 6df0bd0c..00000000
--- a/tinyusb/lib/networking/dnserver.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 by Sergey Fetisov <fsenok@gmail.com>
- *
- * 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.
- */
-
-/*
- * version: 1.0 demo (7.02.2015)
- * brief: tiny dns ipv4 server using lwip (pcb)
- */
-
-#include "dnserver.h"
-
-#define DNS_MAX_HOST_NAME_LEN 128
-
-static struct udp_pcb *pcb = NULL;
-dns_query_proc_t query_proc = NULL;
-
-#pragma pack(push, 1)
-typedef struct
-{
-#if BYTE_ORDER == LITTLE_ENDIAN
- uint8_t rd: 1, /* Recursion Desired */
- tc: 1, /* Truncation Flag */
- aa: 1, /* Authoritative Answer Flag */
- opcode: 4, /* Operation code */
- qr: 1; /* Query/Response Flag */
- uint8_t rcode: 4, /* Response Code */
- z: 3, /* Zero */
- ra: 1; /* Recursion Available */
-#else
- uint8_t qr: 1, /* Query/Response Flag */
- opcode: 4, /* Operation code */
- aa: 1, /* Authoritative Answer Flag */
- tc: 1, /* Truncation Flag */
- rd: 1; /* Recursion Desired */
- uint8_t ra: 1, /* Recursion Available */
- z: 3, /* Zero */
- rcode: 4; /* Response Code */
-#endif
-} dns_header_flags_t;
-
-typedef struct
-{
- uint16_t id;
- dns_header_flags_t flags;
- uint16_t n_record[4];
-} dns_header_t;
-
-typedef struct dns_answer
-{
- uint16_t name;
- uint16_t type;
- uint16_t Class;
- uint32_t ttl;
- uint16_t len;
- uint32_t addr;
-} dns_answer_t;
-#pragma pack(pop)
-
-typedef struct dns_query
-{
- char name[DNS_MAX_HOST_NAME_LEN];
- uint16_t type;
- uint16_t Class;
-} dns_query_t;
-
-static uint16_t get_uint16(const uint8_t *pnt)
-{
- uint16_t result;
- memcpy(&result, pnt, sizeof(result));
- return result;
-}
-
-static int parse_next_query(void *data, int size, dns_query_t *query)
-{
- int len;
- int lables;
- uint8_t *ptr;
-
- len = 0;
- lables = 0;
- ptr = (uint8_t *)data;
-
- while (true)
- {
- uint8_t lable_len;
- if (size <= 0) return -1;
- lable_len = *ptr++;
- size--;
- if (lable_len == 0) break;
- if (lables > 0)
- {
- if (len == DNS_MAX_HOST_NAME_LEN) return -2;
- query->name[len++] = '.';
- }
- if (lable_len > size) return -1;
- if (len + lable_len >= DNS_MAX_HOST_NAME_LEN) return -2;
- memcpy(&query->name[len], ptr, lable_len);
- len += lable_len;
- ptr += lable_len;
- size -= lable_len;
- lables++;
- }
-
- if (size < 4) return -1;
- query->name[len] = 0;
- query->type = get_uint16(ptr);
- ptr += 2;
- query->Class = get_uint16(ptr);
- ptr += 2;
- return ptr - (uint8_t *)data;
-}
-
-static void udp_recv_proc(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port)
-{
- int len;
- dns_header_t *header;
- static dns_query_t query;
- struct pbuf *out;
- ip_addr_t host_addr;
- dns_answer_t *answer;
-
- (void)arg;
-
- if (p->len <= sizeof(dns_header_t)) goto error;
- header = (dns_header_t *)p->payload;
- if (header->flags.qr != 0) goto error;
- if (ntohs(header->n_record[0]) != 1) goto error;
-
- len = parse_next_query(header + 1, p->len - sizeof(dns_header_t), &query);
- if (len < 0) goto error;
- if (!query_proc(query.name, &host_addr)) goto error;
-
- len += sizeof(dns_header_t);
- out = pbuf_alloc(PBUF_TRANSPORT, len + 16, PBUF_POOL);
- if (out == NULL) goto error;
-
- memcpy(out->payload, p->payload, len);
- header = (dns_header_t *)out->payload;
- header->flags.qr = 1;
- header->n_record[1] = htons(1);
- answer = (struct dns_answer *)((uint8_t *)out->payload + len);
- answer->name = htons(0xC00C);
- answer->type = htons(1);
- answer->Class = htons(1);
- answer->ttl = htonl(32);
- answer->len = htons(4);
- answer->addr = host_addr.addr;
-
- udp_sendto(upcb, out, addr, port);
- pbuf_free(out);
-
-error:
- pbuf_free(p);
-}
-
-err_t dnserv_init(const ip_addr_t *bind, uint16_t port, dns_query_proc_t qp)
-{
- err_t err;
- udp_init();
- dnserv_free();
- pcb = udp_new();
- if (pcb == NULL)
- return ERR_MEM;
- err = udp_bind(pcb, bind, port);
- if (err != ERR_OK)
- {
- dnserv_free();
- return err;
- }
- udp_recv(pcb, udp_recv_proc, NULL);
- query_proc = qp;
- return ERR_OK;
-}
-
-void dnserv_free()
-{
- if (pcb == NULL) return;
- udp_remove(pcb);
- pcb = NULL;
-}
diff --git a/tinyusb/lib/networking/dnserver.h b/tinyusb/lib/networking/dnserver.h
deleted file mode 100755
index 130991f5..00000000
--- a/tinyusb/lib/networking/dnserver.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 by Sergey Fetisov <fsenok@gmail.com>
- *
- * 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.
- */
-
-/*
- * version: 1.0 demo (7.02.2015)
- * brief: tiny dns ipv4 server using lwip (pcb)
- */
-
-#ifndef DNSERVER
-#define DNSERVER
-
-#include <stdint.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-#include "lwip/def.h"
-#include "lwip/err.h"
-#include "lwip/udp.h"
-#include "netif/etharp.h"
-
-typedef bool (*dns_query_proc_t)(const char *name, ip_addr_t *addr);
-
-err_t dnserv_init(const ip_addr_t *bind, uint16_t port, dns_query_proc_t query_proc);
-void dnserv_free(void);
-
-#endif
diff --git a/tinyusb/lib/networking/ndis.h b/tinyusb/lib/networking/ndis.h
deleted file mode 100755
index 1c737574..00000000
--- a/tinyusb/lib/networking/ndis.h
+++ /dev/null
@@ -1,266 +0,0 @@
-/* This file has been prepared for Doxygen automatic documentation generation.*/
-/*! \file ndis.h ***************************************************************
- *
- * \brief
- * This file contains the possible external configuration of the USB.
- *
- * \addtogroup usbstick
- *
- *
- ******************************************************************************/
-
-/**
- \ingroup usbstick
- \defgroup RNDIS RNDIS Support
- @{
- */
-
-/*
- * ndis.h
- *
- * Modified by Colin O'Flynn <coflynn@newae.com>
- * ntddndis.h modified by Benedikt Spranger <b.spranger@pengutronix.de>
- *
- * Thanks to the cygwin development team,
- * espacially to Casper S. Hornstrup <chorns@users.sourceforge.net>
- *
- * THIS SOFTWARE IS NOT COPYRIGHTED
- *
- * This source code is offered for use in the public domain. You may
- * use, modify or distribute it freely.
- *
- * This code is distributed in the hope that it will be useful but
- * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
- * DISCLAIMED. This includes but is not limited to warranties of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- */
-
-#ifndef _LINUX_NDIS_H
-#define _LINUX_NDIS_H
-
-
-#define NDIS_STATUS_MULTICAST_FULL 0xC0010009
-#define NDIS_STATUS_MULTICAST_EXISTS 0xC001000A
-#define NDIS_STATUS_MULTICAST_NOT_FOUND 0xC001000B
-
-/* from drivers/net/sk98lin/h/skgepnmi.h */
-#define OID_PNP_CAPABILITIES 0xFD010100
-#define OID_PNP_SET_POWER 0xFD010101
-#define OID_PNP_QUERY_POWER 0xFD010102
-#define OID_PNP_ADD_WAKE_UP_PATTERN 0xFD010103
-#define OID_PNP_REMOVE_WAKE_UP_PATTERN 0xFD010104
-#define OID_PNP_ENABLE_WAKE_UP 0xFD010106
-
-enum NDIS_DEVICE_POWER_STATE {
- NdisDeviceStateUnspecified = 0,
- NdisDeviceStateD0,
- NdisDeviceStateD1,
- NdisDeviceStateD2,
- NdisDeviceStateD3,
- NdisDeviceStateMaximum
-};
-
-struct NDIS_PM_WAKE_UP_CAPABILITIES {
- enum NDIS_DEVICE_POWER_STATE MinMagicPacketWakeUp;
- enum NDIS_DEVICE_POWER_STATE MinPatternWakeUp;
- enum NDIS_DEVICE_POWER_STATE MinLinkChangeWakeUp;
-};
-
-/* NDIS_PNP_CAPABILITIES.Flags constants */
-#define NDIS_DEVICE_WAKE_UP_ENABLE 0x00000001
-#define NDIS_DEVICE_WAKE_ON_PATTERN_MATCH_ENABLE 0x00000002
-#define NDIS_DEVICE_WAKE_ON_MAGIC_PACKET_ENABLE 0x00000004
-
-/*
-struct NDIS_PNP_CAPABILITIES {
- __le32 Flags;
- struct NDIS_PM_WAKE_UP_CAPABILITIES WakeUpCapabilities;
-};
-
-struct NDIS_PM_PACKET_PATTERN {
- __le32 Priority;
- __le32 Reserved;
- __le32 MaskSize;
- __le32 PatternOffset;
- __le32 PatternSize;
- __le32 PatternFlags;
-};
-*/
-
-/* Required Object IDs (OIDs) */
-#define OID_GEN_SUPPORTED_LIST 0x00010101
-#define OID_GEN_HARDWARE_STATUS 0x00010102
-#define OID_GEN_MEDIA_SUPPORTED 0x00010103
-#define OID_GEN_MEDIA_IN_USE 0x00010104
-#define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105
-#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106
-#define OID_GEN_LINK_SPEED 0x00010107
-#define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108
-#define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109
-#define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A
-#define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B
-#define OID_GEN_VENDOR_ID 0x0001010C
-#define OID_GEN_VENDOR_DESCRIPTION 0x0001010D
-#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E
-#define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F
-#define OID_GEN_DRIVER_VERSION 0x00010110
-#define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111
-#define OID_GEN_PROTOCOL_OPTIONS 0x00010112
-#define OID_GEN_MAC_OPTIONS 0x00010113
-#define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114
-#define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115
-#define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116
-#define OID_GEN_SUPPORTED_GUIDS 0x00010117
-#define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118
-#define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119
-#define OID_GEN_MACHINE_NAME 0x0001021A
-#define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B
-#define OID_GEN_VLAN_ID 0x0001021C
-
-/* Optional OIDs */
-#define OID_GEN_MEDIA_CAPABILITIES 0x00010201
-#define OID_GEN_PHYSICAL_MEDIUM 0x00010202
-
-/* Required statistics OIDs */
-#define OID_GEN_XMIT_OK 0x00020101
-#define OID_GEN_RCV_OK 0x00020102
-#define OID_GEN_XMIT_ERROR 0x00020103
-#define OID_GEN_RCV_ERROR 0x00020104
-#define OID_GEN_RCV_NO_BUFFER 0x00020105
-
-/* Optional statistics OIDs */
-#define OID_GEN_DIRECTED_BYTES_XMIT 0x00020201
-#define OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202
-#define OID_GEN_MULTICAST_BYTES_XMIT 0x00020203
-#define OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204
-#define OID_GEN_BROADCAST_BYTES_XMIT 0x00020205
-#define OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206
-#define OID_GEN_DIRECTED_BYTES_RCV 0x00020207
-#define OID_GEN_DIRECTED_FRAMES_RCV 0x00020208
-#define OID_GEN_MULTICAST_BYTES_RCV 0x00020209
-#define OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A
-#define OID_GEN_BROADCAST_BYTES_RCV 0x0002020B
-#define OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C
-#define OID_GEN_RCV_CRC_ERROR 0x0002020D
-#define OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E
-#define OID_GEN_GET_TIME_CAPS 0x0002020F
-#define OID_GEN_GET_NETCARD_TIME 0x00020210
-#define OID_GEN_NETCARD_LOAD 0x00020211
-#define OID_GEN_DEVICE_PROFILE 0x00020212
-#define OID_GEN_INIT_TIME_MS 0x00020213
-#define OID_GEN_RESET_COUNTS 0x00020214
-#define OID_GEN_MEDIA_SENSE_COUNTS 0x00020215
-#define OID_GEN_FRIENDLY_NAME 0x00020216
-#define OID_GEN_MINIPORT_INFO 0x00020217
-#define OID_GEN_RESET_VERIFY_PARAMETERS 0x00020218
-
-/* IEEE 802.3 (Ethernet) OIDs */
-#define NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001
-
-#define OID_802_3_PERMANENT_ADDRESS 0x01010101
-#define OID_802_3_CURRENT_ADDRESS 0x01010102
-#define OID_802_3_MULTICAST_LIST 0x01010103
-#define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104
-#define OID_802_3_MAC_OPTIONS 0x01010105
-#define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101
-#define OID_802_3_XMIT_ONE_COLLISION 0x01020102
-#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103
-#define OID_802_3_XMIT_DEFERRED 0x01020201
-#define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202
-#define OID_802_3_RCV_OVERRUN 0x01020203
-#define OID_802_3_XMIT_UNDERRUN 0x01020204
-#define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205
-#define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206
-#define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207
-
-/* Wireless LAN OIDs */
-/* Mandatory */
-#define OID_802_11_BSSID 0x0D010101 /* Q S */
-#define OID_802_11_SSID 0x0D010102 /* Q S */
-#define OID_802_11_NETWORK_TYPE_IN_USE 0x0D010204 /* Q S */
-#define OID_802_11_RSSI 0x0D010206 /* Q I */
-#define OID_802_11_BSSID_LIST 0x0D010217 /* Q */
-#define OID_802_11_BSSID_LIST_SCAN 0x0D01011A /* S */
-#define OID_802_11_INFRASTRUCTURE_MODE 0x0D010108 /* Q S */
-#define OID_802_11_SUPPORTED_RATES 0x0D01020E /* Q */
-#define OID_802_11_CONFIGURATION 0x0D010211 /* Q S */
-#define OID_802_11_ADD_WEP 0x0D010113 /* S */
-#define OID_802_11_WEP_STATUS 0x0D01011B /* Q S */
-#define OID_802_11_REMOVE_WEP 0x0D010114 /* S */
-#define OID_802_11_DISASSOCIATE 0x0D010115 /* S */
-#define OID_802_11_AUTHENTICATION_MODE 0x0D010118 /* Q S */
-#define OID_802_11_RELOAD_DEFAULTS 0x0D01011C /* S */
-
-
-
-/* OID_GEN_MINIPORT_INFO constants */
-#define NDIS_MINIPORT_BUS_MASTER 0x00000001
-#define NDIS_MINIPORT_WDM_DRIVER 0x00000002
-#define NDIS_MINIPORT_SG_LIST 0x00000004
-#define NDIS_MINIPORT_SUPPORTS_MEDIA_QUERY 0x00000008
-#define NDIS_MINIPORT_INDICATES_PACKETS 0x00000010
-#define NDIS_MINIPORT_IGNORE_PACKET_QUEUE 0x00000020
-#define NDIS_MINIPORT_IGNORE_REQUEST_QUEUE 0x00000040
-#define NDIS_MINIPORT_IGNORE_TOKEN_RING_ERRORS 0x00000080
-#define NDIS_MINIPORT_INTERMEDIATE_DRIVER 0x00000100
-#define NDIS_MINIPORT_IS_NDIS_5 0x00000200
-#define NDIS_MINIPORT_IS_CO 0x00000400
-#define NDIS_MINIPORT_DESERIALIZE 0x00000800
-#define NDIS_MINIPORT_REQUIRES_MEDIA_POLLING 0x00001000
-#define NDIS_MINIPORT_SUPPORTS_MEDIA_SENSE 0x00002000
-#define NDIS_MINIPORT_NETBOOT_CARD 0x00004000
-#define NDIS_MINIPORT_PM_SUPPORTED 0x00008000
-#define NDIS_MINIPORT_SUPPORTS_MAC_ADDRESS_OVERWRITE 0x00010000
-#define NDIS_MINIPORT_USES_SAFE_BUFFER_APIS 0x00020000
-#define NDIS_MINIPORT_HIDDEN 0x00040000
-#define NDIS_MINIPORT_SWENUM 0x00080000
-#define NDIS_MINIPORT_SURPRISE_REMOVE_OK 0x00100000
-#define NDIS_MINIPORT_NO_HALT_ON_SUSPEND 0x00200000
-#define NDIS_MINIPORT_HARDWARE_DEVICE 0x00400000
-#define NDIS_MINIPORT_SUPPORTS_CANCEL_SEND_PACKETS 0x00800000
-#define NDIS_MINIPORT_64BITS_DMA 0x01000000
-
-#define NDIS_MEDIUM_802_3 0x00000000
-#define NDIS_MEDIUM_802_5 0x00000001
-#define NDIS_MEDIUM_FDDI 0x00000002
-#define NDIS_MEDIUM_WAN 0x00000003
-#define NDIS_MEDIUM_LOCAL_TALK 0x00000004
-#define NDIS_MEDIUM_DIX 0x00000005
-#define NDIS_MEDIUM_ARCENT_RAW 0x00000006
-#define NDIS_MEDIUM_ARCENT_878_2 0x00000007
-#define NDIS_MEDIUM_ATM 0x00000008
-#define NDIS_MEDIUM_WIRELESS_LAN 0x00000009
-#define NDIS_MEDIUM_IRDA 0x0000000A
-#define NDIS_MEDIUM_BPC 0x0000000B
-#define NDIS_MEDIUM_CO_WAN 0x0000000C
-#define NDIS_MEDIUM_1394 0x0000000D
-
-#define NDIS_PACKET_TYPE_DIRECTED 0x00000001
-#define NDIS_PACKET_TYPE_MULTICAST 0x00000002
-#define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004
-#define NDIS_PACKET_TYPE_BROADCAST 0x00000008
-#define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
-#define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020
-#define NDIS_PACKET_TYPE_SMT 0x00000040
-#define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080
-#define NDIS_PACKET_TYPE_GROUP 0x00000100
-#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00000200
-#define NDIS_PACKET_TYPE_FUNCTIONAL 0x00000400
-#define NDIS_PACKET_TYPE_MAC_FRAME 0x00000800
-
-#define NDIS_MEDIA_STATE_CONNECTED 0x00000000
-#define NDIS_MEDIA_STATE_DISCONNECTED 0x00000001
-
-#define NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA 0x00000001
-#define NDIS_MAC_OPTION_RECEIVE_SERIALIZED 0x00000002
-#define NDIS_MAC_OPTION_TRANSFERS_NOT_PEND 0x00000004
-#define NDIS_MAC_OPTION_NO_LOOPBACK 0x00000008
-#define NDIS_MAC_OPTION_FULL_DUPLEX 0x00000010
-#define NDIS_MAC_OPTION_EOTX_INDICATION 0x00000020
-#define NDIS_MAC_OPTION_8021P_PRIORITY 0x00000040
-#define NDIS_MAC_OPTION_RESERVED 0x80000000
-
-#endif /* _LINUX_NDIS_H */
-
-/** @} */
diff --git a/tinyusb/lib/networking/rndis_protocol.h b/tinyusb/lib/networking/rndis_protocol.h
deleted file mode 100755
index b45860ee..00000000
--- a/tinyusb/lib/networking/rndis_protocol.h
+++ /dev/null
@@ -1,307 +0,0 @@
-/**
- * \file rndis_protocol.h
- * RNDIS Defines
- *
- * \author
- * Colin O'Flynn <coflynn@newae.com>
- *
- * \addtogroup usbstick
- */
-
-/* Copyright (c) 2008 Colin O'Flynn
-
- 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 the copyright holders nor the names of
- 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.
-*/
-
-#ifndef _RNDIS_H
-#define _RNDIS_H
-
-/**
- \addtogroup RNDIS
- @{
- */
-
-#include <stdint.h>
-
-#define RNDIS_MAJOR_VERSION 1
-#define RNDIS_MINOR_VERSION 0
-
-#define RNDIS_STATUS_SUCCESS 0X00000000
-#define RNDIS_STATUS_FAILURE 0XC0000001
-#define RNDIS_STATUS_INVALID_DATA 0XC0010015
-#define RNDIS_STATUS_NOT_SUPPORTED 0XC00000BB
-#define RNDIS_STATUS_MEDIA_CONNECT 0X4001000B
-#define RNDIS_STATUS_MEDIA_DISCONNECT 0X4001000C
-
-
-/* Message set for Connectionless (802.3) Devices */
-#define REMOTE_NDIS_PACKET_MSG 0x00000001
-#define REMOTE_NDIS_INITIALIZE_MSG 0X00000002
-#define REMOTE_NDIS_HALT_MSG 0X00000003
-#define REMOTE_NDIS_QUERY_MSG 0X00000004
-#define REMOTE_NDIS_SET_MSG 0X00000005
-#define REMOTE_NDIS_RESET_MSG 0X00000006
-#define REMOTE_NDIS_INDICATE_STATUS_MSG 0X00000007
-#define REMOTE_NDIS_KEEPALIVE_MSG 0X00000008
-#define REMOTE_NDIS_INITIALIZE_CMPLT 0X80000002
-#define REMOTE_NDIS_QUERY_CMPLT 0X80000004
-#define REMOTE_NDIS_SET_CMPLT 0X80000005
-#define REMOTE_NDIS_RESET_CMPLT 0X80000006
-#define REMOTE_NDIS_KEEPALIVE_CMPLT 0X80000008
-
-typedef uint32_t rndis_MessageType_t;
-typedef uint32_t rndis_MessageLength_t;
-typedef uint32_t rndis_RequestId_t;
-typedef uint32_t rndis_MajorVersion_t;
-typedef uint32_t rndis_MinorVersion_t;
-typedef uint32_t rndis_MaxTransferSize_t;
-typedef uint32_t rndis_Status_t;
-
-
-/* Device Flags */
-#define RNDIS_DF_CONNECTIONLESS 0x00000001
-#define RNDIS_DF_CONNECTION_ORIENTED 0x00000002
-typedef uint32_t rndis_DeviceFlags_t;
-
-/* Mediums */
-#define RNDIS_MEDIUM_802_3 0x00000000
-typedef uint32_t rndis_Medium_t;
-
-
-typedef uint32_t rndis_MaxPacketsPerTransfer_t;
-typedef uint32_t rndis_PacketAlignmentFactor_t;
-typedef uint32_t rndis_AfListOffset_t;
-typedef uint32_t rndis_AfListSize_t;
-
-/*** Remote NDIS Generic Message type ***/
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- } rndis_generic_msg_t;
-
-
-/*** Remote NDIS Initialize Message ***/
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_RequestId_t RequestId;
- rndis_MajorVersion_t MajorVersion;
- rndis_MinorVersion_t MinorVersion;
- rndis_MaxTransferSize_t MaxTransferSize;
- } rndis_initialize_msg_t;
-
-/* Response: */
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_RequestId_t RequestId;
- rndis_Status_t Status;
- rndis_MajorVersion_t MajorVersion;
- rndis_MinorVersion_t MinorVersion;
- rndis_DeviceFlags_t DeviceFlags;
- rndis_Medium_t Medium;
- rndis_MaxPacketsPerTransfer_t MaxPacketsPerTransfer;
- rndis_MaxTransferSize_t MaxTransferSize;
- rndis_PacketAlignmentFactor_t PacketAlignmentFactor;
- rndis_AfListOffset_t AfListOffset;
- rndis_AfListSize_t AfListSize;
- } rndis_initialize_cmplt_t;
-
-
-/*** Remote NDIS Halt Message ***/
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_RequestId_t RequestId;
- } rndis_halt_msg_t;
-
-typedef uint32_t rndis_Oid_t;
-typedef uint32_t rndis_InformationBufferLength_t;
-typedef uint32_t rndis_InformationBufferOffset_t;
-typedef uint32_t rndis_DeviceVcHandle_t;
-
-/*** Remote NDIS Query Message ***/
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_RequestId_t RequestId;
- rndis_Oid_t Oid;
- rndis_InformationBufferLength_t InformationBufferLength;
- rndis_InformationBufferOffset_t InformationBufferOffset;
- rndis_DeviceVcHandle_t DeviceVcHandle;
- } rndis_query_msg_t;
-
-/* Response: */
-
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_RequestId_t RequestId;
- rndis_Status_t Status;
- rndis_InformationBufferLength_t InformationBufferLength;
- rndis_InformationBufferOffset_t InformationBufferOffset;
- } rndis_query_cmplt_t;
-
-/*** Remote NDIS Set Message ***/
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_RequestId_t RequestId;
- rndis_Oid_t Oid;
- rndis_InformationBufferLength_t InformationBufferLength;
- rndis_InformationBufferOffset_t InformationBufferOffset;
- rndis_DeviceVcHandle_t DeviceVcHandle;
- } rndis_set_msg_t;
-
-/* Response */
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_RequestId_t RequestId;
- rndis_Status_t Status;
- }rndis_set_cmplt_t;
-
-/* Information buffer layout for OID_GEN_RNDIS_CONFIG_PARAMETER */
-typedef uint32_t rndis_ParameterNameOffset_t;
-typedef uint32_t rndis_ParameterNameLength_t;
-typedef uint32_t rndis_ParameterType_t;
-typedef uint32_t rndis_ParameterValueOffset_t;
-typedef uint32_t rndis_ParameterValueLength_t;
-
-#define PARAMETER_TYPE_STRING 2
-#define PARAMETER_TYPE_NUMERICAL 0
-
-typedef struct{
- rndis_ParameterNameOffset_t ParameterNameOffset;
- rndis_ParameterNameLength_t ParameterNameLength;
- rndis_ParameterType_t ParameterType;
- rndis_ParameterValueOffset_t ParameterValueOffset;
- rndis_ParameterValueLength_t ParameterValueLength;
- }rndis_config_parameter_t;
-
-typedef uint32_t rndis_Reserved_t;
-
-/*** Remote NDIS Soft Reset Message ***/
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_Reserved_t Reserved;
- } rndis_reset_msg_t;
-
-typedef uint32_t rndis_AddressingReset_t;
-
-/* Response: */
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_Status_t Status;
- rndis_AddressingReset_t AddressingReset;
- } rndis_reset_cmplt_t;
-
-/*** Remote NDIS Indicate Status Message ***/
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_Status_t Status;
- rndis_Status_t StatusBufferLength;
- rndis_Status_t StatusBufferOffset;
- } rndis_indicate_status_t;
-
-typedef uint32_t rndis_DiagStatus_t;
-typedef uint32_t rndis_ErrorOffset_t;
-
-typedef struct {
- rndis_DiagStatus_t DiagStatus;
- rndis_ErrorOffset_t ErrorOffset;
- }rndis_diagnostic_info_t;
-
-/*** Remote NDIS Keepalive Message */
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_RequestId_t RequestId;
- }rndis_keepalive_msg_t;
-
-/* Response: */
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_RequestId_t RequestId;
- rndis_Status_t Status;
- }rndis_keepalive_cmplt_t;
-
-/*** Remote NDIS Data Packet ***/
-
-typedef uint32_t rndis_DataOffset_t;
-typedef uint32_t rndis_DataLength_t;
-typedef uint32_t rndis_OOBDataOffset_t;
-typedef uint32_t rndis_OOBDataLength_t;
-typedef uint32_t rndis_NumOOBDataElements_t;
-typedef uint32_t rndis_PerPacketInfoOffset_t;
-typedef uint32_t rndis_PerPacketInfoLength_t;
-
-typedef struct{
- rndis_MessageType_t MessageType;
- rndis_MessageLength_t MessageLength;
- rndis_DataOffset_t DataOffset;
- rndis_DataLength_t DataLength;
- rndis_OOBDataOffset_t OOBDataOffset;
- rndis_OOBDataLength_t OOBDataLength;
- rndis_NumOOBDataElements_t NumOOBDataElements;
- rndis_PerPacketInfoOffset_t PerPacketInfoOffset;
- rndis_PerPacketInfoLength_t PerPacketInfoLength;
- rndis_DeviceVcHandle_t DeviceVcHandle;
- rndis_Reserved_t Reserved;
- }rndis_data_packet_t;
-
-typedef uint32_t rndis_ClassInformationOffset_t;
-typedef uint32_t rndis_Size_t;
-typedef uint32_t rndis_Type_t;
-
-typedef struct{
- rndis_Size_t Size;
- rndis_Type_t Type;
- rndis_ClassInformationOffset_t ClassInformationType;
- }rndis_OOB_packet_t;
-
-#include "ndis.h"
-
-typedef enum rnids_state_e {
- rndis_uninitialized,
- rndis_initialized,
- rndis_data_initialized
- } rndis_state_t;
-
-typedef struct {
- uint32_t txok;
- uint32_t rxok;
- uint32_t txbad;
- uint32_t rxbad;
-} usb_eth_stat_t;
-
-#endif /* _RNDIS_H */
-
-/** @} */
diff --git a/tinyusb/lib/networking/rndis_reports.c b/tinyusb/lib/networking/rndis_reports.c
deleted file mode 100755
index ee611c88..00000000
--- a/tinyusb/lib/networking/rndis_reports.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- The original version of this code was lrndis/usbd_rndis_core.c from https://github.com/fetisov/lrndis
- It has since been overhauled to suit this application
-*/
-
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 by Sergey Fetisov <fsenok@gmail.com>
- *
- * 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.
- */
-
-#include <stdalign.h>
-#include <string.h>
-#include "class/net/net_device.h"
-#include "rndis_protocol.h"
-#include "netif/ethernet.h"
-
-#define RNDIS_LINK_SPEED 12000000 /* Link baudrate (12Mbit/s for USB-FS) */
-#define RNDIS_VENDOR "TinyUSB" /* NIC vendor name */
-
-static const uint8_t *const station_hwaddr = tud_network_mac_address;
-static const uint8_t *const permanent_hwaddr = tud_network_mac_address;
-
-static usb_eth_stat_t usb_eth_stat = { 0, 0, 0, 0 };
-static uint32_t oid_packet_filter = 0x0000000;
-static rndis_state_t rndis_state;
-
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static uint8_t ndis_report[8] = { 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
-
-static const uint32_t OIDSupportedList[] =
-{
- OID_GEN_SUPPORTED_LIST,
- OID_GEN_HARDWARE_STATUS,
- OID_GEN_MEDIA_SUPPORTED,
- OID_GEN_MEDIA_IN_USE,
- OID_GEN_MAXIMUM_FRAME_SIZE,
- OID_GEN_LINK_SPEED,
- OID_GEN_TRANSMIT_BLOCK_SIZE,
- OID_GEN_RECEIVE_BLOCK_SIZE,
- OID_GEN_VENDOR_ID,
- OID_GEN_VENDOR_DESCRIPTION,
- OID_GEN_VENDOR_DRIVER_VERSION,
- OID_GEN_CURRENT_PACKET_FILTER,
- OID_GEN_MAXIMUM_TOTAL_SIZE,
- OID_GEN_PROTOCOL_OPTIONS,
- OID_GEN_MAC_OPTIONS,
- OID_GEN_MEDIA_CONNECT_STATUS,
- OID_GEN_MAXIMUM_SEND_PACKETS,
- OID_802_3_PERMANENT_ADDRESS,
- OID_802_3_CURRENT_ADDRESS,
- OID_802_3_MULTICAST_LIST,
- OID_802_3_MAXIMUM_LIST_SIZE,
- OID_802_3_MAC_OPTIONS
-};
-
-#define OID_LIST_LENGTH TU_ARRAY_SIZE(OIDSupportedList)
-#define ENC_BUF_SIZE (OID_LIST_LENGTH * 4 + 32)
-
-static void *encapsulated_buffer;
-
-static void rndis_report(void)
-{
- netd_report(ndis_report, sizeof(ndis_report));
-}
-
-static void rndis_query_cmplt32(int status, uint32_t data)
-{
- rndis_query_cmplt_t *c;
- c = (rndis_query_cmplt_t *)encapsulated_buffer;
- c->MessageType = REMOTE_NDIS_QUERY_CMPLT;
- c->MessageLength = sizeof(rndis_query_cmplt_t) + 4;
- c->InformationBufferLength = 4;
- c->InformationBufferOffset = 16;
- c->Status = status;
- memcpy(c + 1, &data, sizeof(data));
- rndis_report();
-}
-
-static void rndis_query_cmplt(int status, const void *data, int size)
-{
- rndis_query_cmplt_t *c;
- c = (rndis_query_cmplt_t *)encapsulated_buffer;
- c->MessageType = REMOTE_NDIS_QUERY_CMPLT;
- c->MessageLength = sizeof(rndis_query_cmplt_t) + size;
- c->InformationBufferLength = size;
- c->InformationBufferOffset = 16;
- c->Status = status;
- memcpy(c + 1, data, size);
- rndis_report();
-}
-
-#define MAC_OPT NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA | \
- NDIS_MAC_OPTION_RECEIVE_SERIALIZED | \
- NDIS_MAC_OPTION_TRANSFERS_NOT_PEND | \
- NDIS_MAC_OPTION_NO_LOOPBACK
-
-static const char *rndis_vendor = RNDIS_VENDOR;
-
-static void rndis_query(void)
-{
- switch (((rndis_query_msg_t *)encapsulated_buffer)->Oid)
- {
- case OID_GEN_SUPPORTED_LIST: rndis_query_cmplt(RNDIS_STATUS_SUCCESS, OIDSupportedList, 4 * OID_LIST_LENGTH); return;
- case OID_GEN_VENDOR_DRIVER_VERSION: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, 0x00001000); return;
- case OID_802_3_CURRENT_ADDRESS: rndis_query_cmplt(RNDIS_STATUS_SUCCESS, station_hwaddr, 6); return;
- case OID_802_3_PERMANENT_ADDRESS: rndis_query_cmplt(RNDIS_STATUS_SUCCESS, permanent_hwaddr, 6); return;
- case OID_GEN_MEDIA_SUPPORTED: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, NDIS_MEDIUM_802_3); return;
- case OID_GEN_MEDIA_IN_USE: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, NDIS_MEDIUM_802_3); return;
- case OID_GEN_PHYSICAL_MEDIUM: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, NDIS_MEDIUM_802_3); return;
- case OID_GEN_HARDWARE_STATUS: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, 0); return;
- case OID_GEN_LINK_SPEED: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, RNDIS_LINK_SPEED / 100); return;
- case OID_GEN_VENDOR_ID: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, 0x00FFFFFF); return;
- case OID_GEN_VENDOR_DESCRIPTION: rndis_query_cmplt(RNDIS_STATUS_SUCCESS, rndis_vendor, strlen(rndis_vendor) + 1); return;
- case OID_GEN_CURRENT_PACKET_FILTER: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, oid_packet_filter); return;
- case OID_GEN_MAXIMUM_FRAME_SIZE: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, CFG_TUD_NET_MTU - SIZEOF_ETH_HDR); return;
- case OID_GEN_MAXIMUM_TOTAL_SIZE: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, CFG_TUD_NET_MTU); return;
- case OID_GEN_TRANSMIT_BLOCK_SIZE: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, CFG_TUD_NET_MTU); return;
- case OID_GEN_RECEIVE_BLOCK_SIZE: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, CFG_TUD_NET_MTU); return;
- case OID_GEN_MEDIA_CONNECT_STATUS: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, NDIS_MEDIA_STATE_CONNECTED); return;
- case OID_GEN_RNDIS_CONFIG_PARAMETER: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, 0); return;
- case OID_802_3_MAXIMUM_LIST_SIZE: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, 1); return;
- case OID_802_3_MULTICAST_LIST: rndis_query_cmplt32(RNDIS_STATUS_NOT_SUPPORTED, 0); return;
- case OID_802_3_MAC_OPTIONS: rndis_query_cmplt32(RNDIS_STATUS_NOT_SUPPORTED, 0); return;
- case OID_GEN_MAC_OPTIONS: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, /*MAC_OPT*/ 0); return;
- case OID_802_3_RCV_ERROR_ALIGNMENT: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, 0); return;
- case OID_802_3_XMIT_ONE_COLLISION: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, 0); return;
- case OID_802_3_XMIT_MORE_COLLISIONS: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, 0); return;
- case OID_GEN_XMIT_OK: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, usb_eth_stat.txok); return;
- case OID_GEN_RCV_OK: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, usb_eth_stat.rxok); return;
- case OID_GEN_RCV_ERROR: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, usb_eth_stat.rxbad); return;
- case OID_GEN_XMIT_ERROR: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, usb_eth_stat.txbad); return;
- case OID_GEN_RCV_NO_BUFFER: rndis_query_cmplt32(RNDIS_STATUS_SUCCESS, 0); return;
- default: rndis_query_cmplt(RNDIS_STATUS_FAILURE, NULL, 0); return;
- }
-}
-
-#define INFBUF ((uint8_t *)&(m->RequestId) + m->InformationBufferOffset)
-
-static void rndis_handle_config_parm(const char *data, int keyoffset, int valoffset, int keylen, int vallen)
-{
- (void)data;
- (void)keyoffset;
- (void)valoffset;
- (void)keylen;
- (void)vallen;
-}
-
-static void rndis_packetFilter(uint32_t newfilter)
-{
- (void)newfilter;
-}
-
-static void rndis_handle_set_msg(void)
-{
- rndis_set_cmplt_t *c;
- rndis_set_msg_t *m;
- rndis_Oid_t oid;
-
- c = (rndis_set_cmplt_t *)encapsulated_buffer;
- m = (rndis_set_msg_t *)encapsulated_buffer;
-
- oid = m->Oid;
- c->MessageType = REMOTE_NDIS_SET_CMPLT;
- c->MessageLength = sizeof(rndis_set_cmplt_t);
- c->Status = RNDIS_STATUS_SUCCESS;
-
- switch (oid)
- {
- /* Parameters set up in 'Advanced' tab */
- case OID_GEN_RNDIS_CONFIG_PARAMETER:
- {
- rndis_config_parameter_t *p;
- char *ptr = (char *)m;
- ptr += sizeof(rndis_generic_msg_t);
- ptr += m->InformationBufferOffset;
- p = (rndis_config_parameter_t *) ((void*) ptr);
- rndis_handle_config_parm(ptr, p->ParameterNameOffset, p->ParameterValueOffset, p->ParameterNameLength, p->ParameterValueLength);
- }
- break;
-
- /* Mandatory general OIDs */
- case OID_GEN_CURRENT_PACKET_FILTER:
- memcpy(&oid_packet_filter, INFBUF, 4);
- if (oid_packet_filter)
- {
- rndis_packetFilter(oid_packet_filter);
- rndis_state = rndis_data_initialized;
- }
- else
- {
- rndis_state = rndis_initialized;
- }
- break;
-
- case OID_GEN_CURRENT_LOOKAHEAD:
- break;
-
- case OID_GEN_PROTOCOL_OPTIONS:
- break;
-
- /* Mandatory 802_3 OIDs */
- case OID_802_3_MULTICAST_LIST:
- break;
-
- /* Power Managment: fails for now */
- case OID_PNP_ADD_WAKE_UP_PATTERN:
- case OID_PNP_REMOVE_WAKE_UP_PATTERN:
- case OID_PNP_ENABLE_WAKE_UP:
- default:
- c->Status = RNDIS_STATUS_FAILURE;
- break;
- }
-
- /* c->MessageID is same as before */
- rndis_report();
- return;
-}
-
-void rndis_class_set_handler(uint8_t *data, int size)
-{
- encapsulated_buffer = data;
- (void)size;
-
- switch (((rndis_generic_msg_t *)encapsulated_buffer)->MessageType)
- {
- case REMOTE_NDIS_INITIALIZE_MSG:
- {
- rndis_initialize_cmplt_t *m;
- m = ((rndis_initialize_cmplt_t *)encapsulated_buffer);
- /* m->MessageID is same as before */
- m->MessageType = REMOTE_NDIS_INITIALIZE_CMPLT;
- m->MessageLength = sizeof(rndis_initialize_cmplt_t);
- m->MajorVersion = RNDIS_MAJOR_VERSION;
- m->MinorVersion = RNDIS_MINOR_VERSION;
- m->Status = RNDIS_STATUS_SUCCESS;
- m->DeviceFlags = RNDIS_DF_CONNECTIONLESS;
- m->Medium = RNDIS_MEDIUM_802_3;
- m->MaxPacketsPerTransfer = 1;
- m->MaxTransferSize = CFG_TUD_NET_MTU + sizeof(rndis_data_packet_t);
- m->PacketAlignmentFactor = 0;
- m->AfListOffset = 0;
- m->AfListSize = 0;
- rndis_state = rndis_initialized;
- rndis_report();
- }
- break;
-
- case REMOTE_NDIS_QUERY_MSG:
- rndis_query();
- break;
-
- case REMOTE_NDIS_SET_MSG:
- rndis_handle_set_msg();
- break;
-
- case REMOTE_NDIS_RESET_MSG:
- {
- rndis_reset_cmplt_t * m;
- m = ((rndis_reset_cmplt_t *)encapsulated_buffer);
- rndis_state = rndis_uninitialized;
- m->MessageType = REMOTE_NDIS_RESET_CMPLT;
- m->MessageLength = sizeof(rndis_reset_cmplt_t);
- m->Status = RNDIS_STATUS_SUCCESS;
- m->AddressingReset = 1; /* Make it look like we did something */
- /* m->AddressingReset = 0; - Windows halts if set to 1 for some reason */
- rndis_report();
- }
- break;
-
- case REMOTE_NDIS_KEEPALIVE_MSG:
- {
- rndis_keepalive_cmplt_t * m;
- m = (rndis_keepalive_cmplt_t *)encapsulated_buffer;
- m->MessageType = REMOTE_NDIS_KEEPALIVE_CMPLT;
- m->MessageLength = sizeof(rndis_keepalive_cmplt_t);
- m->Status = RNDIS_STATUS_SUCCESS;
- }
- /* We have data to send back */
- rndis_report();
- break;
-
- default:
- break;
- }
-}
diff --git a/tinyusb/pkg.yml b/tinyusb/pkg.yml
deleted file mode 100755
index 33144502..00000000
--- a/tinyusb/pkg.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-pkg.name: tinyusb
-pkg.description: A silly USB stack for embedded
-pkg.author: "Ha Thach <thach@tinyusb.org>"
-pkg.homepage: "https://github.com/hathach/tinyusb"
-pkg.keywords:
- - usb
-
-pkg.type: sdk
-
-pkg.deps:
- - "@apache-mynewt-core/kernel/os"
-
-pkg.include_dirs:
- - src
diff --git a/tinyusb/repository.yml b/tinyusb/repository.yml
deleted file mode 100755
index 16afbca5..00000000
--- a/tinyusb/repository.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-repo.name: tinyusb
-repo.versions:
- "0.0.0": "master"
- "0.5.0": "0.5.0"
- "0.6.0": "0.6.0"
- "0.7.0": "0.7.0"
- "0.8.0": "0.8.0"
- "0.9.0": "0.9.0"
-
- "0-dev": "0.0.0" # master
- "0-latest": "0.9.0" # latest stable release
-
diff --git a/tinyusb/src/class/audio/audio.h b/tinyusb/src/class/audio/audio.h
deleted file mode 100755
index f99061ea..00000000
--- a/tinyusb/src/class/audio/audio.h
+++ /dev/null
@@ -1,945 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- * Copyright (c) 2020 Reinhard Panhuber
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup group_class
- * \defgroup ClassDriver_Audio Audio
- * Currently only MIDI subclass is supported
- * @{ */
-
-#ifndef _TUSB_AUDIO_H__
-#define _TUSB_AUDIO_H__
-
-#include "common/tusb_common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/// Audio Device Class Codes
-
-/// A.2 - Audio Function Subclass Codes
-typedef enum
-{
- AUDIO_FUNCTION_SUBCLASS_UNDEFINED = 0x00,
-} audio_function_subclass_type_t;
-
-/// A.3 - Audio Function Protocol Codes
-typedef enum
-{
- AUDIO_FUNC_PROTOCOL_CODE_UNDEF = 0x00,
- AUDIO_FUNC_PROTOCOL_CODE_V2 = 0x20, ///< Version 2.0
-} audio_function_protocol_code_t;
-
-/// A.5 - Audio Interface Subclass Codes
-typedef enum
-{
- AUDIO_SUBCLASS_UNDEFINED = 0x00,
- AUDIO_SUBCLASS_CONTROL , ///< Audio Control
- AUDIO_SUBCLASS_STREAMING , ///< Audio Streaming
- AUDIO_SUBCLASS_MIDI_STREAMING , ///< MIDI Streaming
-} audio_subclass_type_t;
-
-/// A.6 - Audio Interface Protocol Codes
-typedef enum
-{
- AUDIO_INT_PROTOCOL_CODE_UNDEF = 0x00,
- AUDIO_INT_PROTOCOL_CODE_V2 = 0x20, ///< Version 2.0
-} audio_interface_protocol_code_t;
-
-/// A.7 - Audio Function Category Codes
-typedef enum
-{
- AUDIO_FUNC_UNDEF = 0x00,
- AUDIO_FUNC_DESKTOP_SPEAKER = 0x01,
- AUDIO_FUNC_HOME_THEATER = 0x02,
- AUDIO_FUNC_MICROPHONE = 0x03,
- AUDIO_FUNC_HEADSET = 0x04,
- AUDIO_FUNC_TELEPHONE = 0x05,
- AUDIO_FUNC_CONVERTER = 0x06,
- AUDIO_FUNC_SOUND_RECODER = 0x07,
- AUDIO_FUNC_IO_BOX = 0x08,
- AUDIO_FUNC_MUSICAL_INSTRUMENT = 0x09,
- AUDIO_FUNC_PRO_AUDIO = 0x0A,
- AUDIO_FUNC_AUDIO_VIDEO = 0x0B,
- AUDIO_FUNC_CONTROL_PANEL = 0x0C,
- AUDIO_FUNC_OTHER = 0xFF,
-} audio_function_code_t;
-
-/// A.9 - Audio Class-Specific AC Interface Descriptor Subtypes UAC2
-typedef enum
-{
- AUDIO_CS_AC_INTERFACE_AC_DESCRIPTOR_UNDEF = 0x00,
- AUDIO_CS_AC_INTERFACE_HEADER = 0x01,
- AUDIO_CS_AC_INTERFACE_INPUT_TERMINAL = 0x02,
- AUDIO_CS_AC_INTERFACE_OUTPUT_TERMINAL = 0x03,
- AUDIO_CS_AC_INTERFACE_MIXER_UNIT = 0x04,
- AUDIO_CS_AC_INTERFACE_SELECTOR_UNIT = 0x05,
- AUDIO_CS_AC_INTERFACE_FEATURE_UNIT = 0x06,
- AUDIO_CS_AC_INTERFACE_EFFECT_UNIT = 0x07,
- AUDIO_CS_AC_INTERFACE_PROCESSING_UNIT = 0x08,
- AUDIO_CS_AC_INTERFACE_EXTENSION_UNIT = 0x09,
- AUDIO_CS_AC_INTERFACE_CLOCK_SOURCE = 0x0A,
- AUDIO_CS_AC_INTERFACE_CLOCK_SELECTOR = 0x0B,
- AUDIO_CS_AC_INTERFACE_CLOCK_MULTIPLIER = 0x0C,
- AUDIO_CS_AC_INTERFACE_SAMPLE_RATE_CONVERTER = 0x0D,
-} audio_cs_ac_interface_subtype_t;
-
-/// A.10 - Audio Class-Specific AS Interface Descriptor Subtypes UAC2
-typedef enum
-{
- AUDIO_CS_AS_INTERFACE_AS_DESCRIPTOR_UNDEF = 0x00,
- AUDIO_CS_AS_INTERFACE_AS_GENERAL = 0x01,
- AUDIO_CS_AS_INTERFACE_FORMAT_TYPE = 0x02,
- AUDIO_CS_AS_INTERFACE_ENCODER = 0x03,
- AUDIO_CS_AS_INTERFACE_DECODER = 0x04,
-} audio_cs_as_interface_subtype_t;
-
-/// A.11 - Effect Unit Effect Types
-typedef enum
-{
- AUDIO_EFFECT_TYPE_UNDEF = 0x00,
- AUDIO_EFFECT_TYPE_PARAM_EQ_SECTION = 0x01,
- AUDIO_EFFECT_TYPE_REVERBERATION = 0x02,
- AUDIO_EFFECT_TYPE_MOD_DELAY = 0x03,
- AUDIO_EFFECT_TYPE_DYN_RANGE_COMP = 0x04,
-} audio_effect_unit_effect_type_t;
-
-/// A.12 - Processing Unit Process Types
-typedef enum
-{
- AUDIO_PROCESS_TYPE_UNDEF = 0x00,
- AUDIO_PROCESS_TYPE_UP_DOWN_MIX = 0x01,
- AUDIO_PROCESS_TYPE_DOLBY_PROLOGIC = 0x02,
- AUDIO_PROCESS_TYPE_STEREO_EXTENDER = 0x03,
-} audio_processing_unit_process_type_t;
-
-/// A.13 - Audio Class-Specific EP Descriptor Subtypes UAC2
-typedef enum
-{
- AUDIO_CS_EP_SUBTYPE_UNDEF = 0x00,
- AUDIO_CS_EP_SUBTYPE_GENERAL = 0x01,
-} audio_cs_ep_subtype_t;
-
-/// A.14 - Audio Class-Specific Request Codes
-typedef enum
-{
- AUDIO_CS_REQ_UNDEF = 0x00,
- AUDIO_CS_REQ_CUR = 0x01,
- AUDIO_CS_REQ_RANGE = 0x02,
- AUDIO_CS_REQ_MEM = 0x03,
-} audio_cs_req_t;
-
-/// A.17 - Control Selector Codes
-
-/// A.17.1 - Clock Source Control Selectors
-typedef enum
-{
- AUDIO_CS_CTRL_UNDEF = 0x00,
- AUDIO_CS_CTRL_SAM_FREQ = 0x01,
- AUDIO_CS_CTRL_CLK_VALID = 0x02,
-} audio_clock_src_control_selector_t;
-
-/// A.17.2 - Clock Selector Control Selectors
-typedef enum
-{
- AUDIO_CX_CTRL_UNDEF = 0x00,
- AUDIO_CX_CTRL_CONTROL = 0x01,
-} audio_clock_sel_control_selector_t;
-
-/// A.17.3 - Clock Multiplier Control Selectors
-typedef enum
-{
- AUDIO_CM_CTRL_UNDEF = 0x00,
- AUDIO_CM_CTRL_NUMERATOR_CONTROL = 0x01,
- AUDIO_CM_CTRL_DENOMINATOR_CONTROL = 0x02,
-} audio_clock_mul_control_selector_t;
-
-/// A.17.4 - Terminal Control Selectors
-typedef enum
-{
- AUDIO_TE_CTRL_UNDEF = 0x00,
- AUDIO_TE_CTRL_COPY_PROTECT = 0x01,
- AUDIO_TE_CTRL_CONNECTOR = 0x02,
- AUDIO_TE_CTRL_OVERLOAD = 0x03,
- AUDIO_TE_CTRL_CLUSTER = 0x04,
- AUDIO_TE_CTRL_UNDERFLOW = 0x05,
- AUDIO_TE_CTRL_OVERFLOW = 0x06,
- AUDIO_TE_CTRL_LATENCY = 0x07,
-} audio_terminal_control_selector_t;
-
-/// A.17.5 - Mixer Control Selectors
-typedef enum
-{
- AUDIO_MU_CTRL_UNDEF = 0x00,
- AUDIO_MU_CTRL_MIXER = 0x01,
- AUDIO_MU_CTRL_CLUSTER = 0x02,
- AUDIO_MU_CTRL_UNDERFLOW = 0x03,
- AUDIO_MU_CTRL_OVERFLOW = 0x04,
- AUDIO_MU_CTRL_LATENCY = 0x05,
-} audio_mixer_control_selector_t;
-
-/// A.17.6 - Selector Control Selectors
-typedef enum
-{
- AUDIO_SU_CTRL_UNDEF = 0x00,
- AUDIO_SU_CTRL_SELECTOR = 0x01,
- AUDIO_SU_CTRL_LATENCY = 0x02,
-} audio_sel_control_selector_t;
-
-/// A.17.7 - Feature Unit Control Selectors
-typedef enum
-{
- AUDIO_FU_CTRL_UNDEF = 0x00,
- AUDIO_FU_CTRL_MUTE = 0x01,
- AUDIO_FU_CTRL_VOLUME = 0x02,
- AUDIO_FU_CTRL_BASS = 0x03,
- AUDIO_FU_CTRL_MID = 0x04,
- AUDIO_FU_CTRL_TREBLE = 0x05,
- AUDIO_FU_CTRL_GRAPHIC_EQUALIZER = 0x06,
- AUDIO_FU_CTRL_AGC = 0x07,
- AUDIO_FU_CTRL_DELAY = 0x08,
- AUDIO_FU_CTRL_BASS_BOOST = 0x09,
- AUDIO_FU_CTRL_LOUDNESS = 0x0A,
- AUDIO_FU_CTRL_INPUT_GAIN = 0x0B,
- AUDIO_FU_CTRL_GAIN_PAD = 0x0C,
- AUDIO_FU_CTRL_INVERTER = 0x0D,
- AUDIO_FU_CTRL_UNDERFLOW = 0x0E,
- AUDIO_FU_CTRL_OVERVLOW = 0x0F,
- AUDIO_FU_CTRL_LATENCY = 0x10,
-} audio_feature_unit_control_selector_t;
-
-/// A.17.8 Effect Unit Control Selectors
-
-/// A.17.8.1 Parametric Equalizer Section Effect Unit Control Selectors
-typedef enum
-{
- AUDIO_PE_CTRL_UNDEF = 0x00,
- AUDIO_PE_CTRL_ENABLE = 0x01,
- AUDIO_PE_CTRL_CENTERFREQ = 0x02,
- AUDIO_PE_CTRL_QFACTOR = 0x03,
- AUDIO_PE_CTRL_GAIN = 0x04,
- AUDIO_PE_CTRL_UNDERFLOW = 0x05,
- AUDIO_PE_CTRL_OVERFLOW = 0x06,
- AUDIO_PE_CTRL_LATENCY = 0x07,
-} audio_parametric_equalizer_control_selector_t;
-
-/// A.17.8.2 Reverberation Effect Unit Control Selectors
-typedef enum
-{
- AUDIO_RV_CTRL_UNDEF = 0x00,
- AUDIO_RV_CTRL_ENABLE = 0x01,
- AUDIO_RV_CTRL_TYPE = 0x02,
- AUDIO_RV_CTRL_LEVEL = 0x03,
- AUDIO_RV_CTRL_TIME = 0x04,
- AUDIO_RV_CTRL_FEEDBACK = 0x05,
- AUDIO_RV_CTRL_PREDELAY = 0x06,
- AUDIO_RV_CTRL_DENSITY = 0x07,
- AUDIO_RV_CTRL_HIFREQ_ROLLOFF = 0x08,
- AUDIO_RV_CTRL_UNDERFLOW = 0x09,
- AUDIO_RV_CTRL_OVERFLOW = 0x0A,
- AUDIO_RV_CTRL_LATENCY = 0x0B,
-} audio_reverberation_effect_control_selector_t;
-
-/// A.17.8.3 Modulation Delay Effect Unit Control Selectors
-typedef enum
-{
- AUDIO_MD_CTRL_UNDEF = 0x00,
- AUDIO_MD_CTRL_ENABLE = 0x01,
- AUDIO_MD_CTRL_BALANCE = 0x02,
- AUDIO_MD_CTRL_RATE = 0x03,
- AUDIO_MD_CTRL_DEPTH = 0x04,
- AUDIO_MD_CTRL_TIME = 0x05,
- AUDIO_MD_CTRL_FEEDBACK = 0x06,
- AUDIO_MD_CTRL_UNDERFLOW = 0x07,
- AUDIO_MD_CTRL_OVERFLOW = 0x08,
- AUDIO_MD_CTRL_LATENCY = 0x09,
-} audio_modulation_delay_control_selector_t;
-
-/// A.17.8.4 Dynamic Range Compressor Effect Unit Control Selectors
-typedef enum
-{
- AUDIO_DR_CTRL_UNDEF = 0x00,
- AUDIO_DR_CTRL_ENABLE = 0x01,
- AUDIO_DR_CTRL_COMPRESSION_RATE = 0x02,
- AUDIO_DR_CTRL_MAXAMPL = 0x03,
- AUDIO_DR_CTRL_THRESHOLD = 0x04,
- AUDIO_DR_CTRL_ATTACK_TIME = 0x05,
- AUDIO_DR_CTRL_RELEASE_TIME = 0x06,
- AUDIO_DR_CTRL_UNDERFLOW = 0x07,
- AUDIO_DR_CTRL_OVERFLOW = 0x08,
- AUDIO_DR_CTRL_LATENCY = 0x09,
-} audio_dynamic_range_compression_control_selector_t;
-
-/// A.17.9 Processing Unit Control Selectors
-
-/// A.17.9.1 Up/Down-mix Processing Unit Control Selectors
-typedef enum
-{
- AUDIO_UD_CTRL_UNDEF = 0x00,
- AUDIO_UD_CTRL_ENABLE = 0x01,
- AUDIO_UD_CTRL_MODE_SELECT = 0x02,
- AUDIO_UD_CTRL_CLUSTER = 0x03,
- AUDIO_UD_CTRL_UNDERFLOW = 0x04,
- AUDIO_UD_CTRL_OVERFLOW = 0x05,
- AUDIO_UD_CTRL_LATENCY = 0x06,
-} audio_up_down_mix_control_selector_t;
-
-/// A.17.9.2 Dolby Prologic ™ Processing Unit Control Selectors
-typedef enum
-{
- AUDIO_DP_CTRL_UNDEF = 0x00,
- AUDIO_DP_CTRL_ENABLE = 0x01,
- AUDIO_DP_CTRL_MODE_SELECT = 0x02,
- AUDIO_DP_CTRL_CLUSTER = 0x03,
- AUDIO_DP_CTRL_UNDERFLOW = 0x04,
- AUDIO_DP_CTRL_OVERFLOW = 0x05,
- AUDIO_DP_CTRL_LATENCY = 0x06,
-} audio_dolby_prologic_control_selector_t;
-
-/// A.17.9.3 Stereo Extender Processing Unit Control Selectors
-typedef enum
-{
- AUDIO_ST_EXT_CTRL_UNDEF = 0x00,
- AUDIO_ST_EXT_CTRL_ENABLE = 0x01,
- AUDIO_ST_EXT_CTRL_WIDTH = 0x02,
- AUDIO_ST_EXT_CTRL_UNDERFLOW = 0x03,
- AUDIO_ST_EXT_CTRL_OVERFLOW = 0x04,
- AUDIO_ST_EXT_CTRL_LATENCY = 0x05,
-} audio_stereo_extender_control_selector_t;
-
-/// A.17.10 Extension Unit Control Selectors
-typedef enum
-{
- AUDIO_XU_CTRL_UNDEF = 0x00,
- AUDIO_XU_CTRL_ENABLE = 0x01,
- AUDIO_XU_CTRL_CLUSTER = 0x02,
- AUDIO_XU_CTRL_UNDERFLOW = 0x03,
- AUDIO_XU_CTRL_OVERFLOW = 0x04,
- AUDIO_XU_CTRL_LATENCY = 0x05,
-} audio_extension_unit_control_selector_t;
-
-/// A.17.11 AudioStreaming Interface Control Selectors
-typedef enum
-{
- AUDIO_AS_CTRL_UNDEF = 0x00,
- AUDIO_AS_CTRL_ACT_ALT_SETTING = 0x01,
- AUDIO_AS_CTRL_VAL_ALT_SETTINGS = 0x02,
- AUDIO_AS_CTRL_AUDIO_DATA_FORMAT = 0x03,
-} audio_audiostreaming_interface_control_selector_t;
-
-/// A.17.12 Encoder Control Selectors
-typedef enum
-{
- AUDIO_EN_CTRL_UNDEF = 0x00,
- AUDIO_EN_CTRL_BIT_RATE = 0x01,
- AUDIO_EN_CTRL_QUALITY = 0x02,
- AUDIO_EN_CTRL_VBR = 0x03,
- AUDIO_EN_CTRL_TYPE = 0x04,
- AUDIO_EN_CTRL_UNDERFLOW = 0x05,
- AUDIO_EN_CTRL_OVERFLOW = 0x06,
- AUDIO_EN_CTRL_ENCODER_ERROR = 0x07,
- AUDIO_EN_CTRL_PARAM1 = 0x08,
- AUDIO_EN_CTRL_PARAM2 = 0x09,
- AUDIO_EN_CTRL_PARAM3 = 0x0A,
- AUDIO_EN_CTRL_PARAM4 = 0x0B,
- AUDIO_EN_CTRL_PARAM5 = 0x0C,
- AUDIO_EN_CTRL_PARAM6 = 0x0D,
- AUDIO_EN_CTRL_PARAM7 = 0x0E,
- AUDIO_EN_CTRL_PARAM8 = 0x0F,
-} audio_encoder_control_selector_t;
-
-/// A.17.13 Decoder Control Selectors
-
-/// A.17.13.1 MPEG Decoder Control Selectors
-typedef enum
-{
- AUDIO_MPD_CTRL_UNDEF = 0x00,
- AUDIO_MPD_CTRL_DUAL_CHANNEL = 0x01,
- AUDIO_MPD_CTRL_SECOND_STEREO = 0x02,
- AUDIO_MPD_CTRL_MULTILINGUAL = 0x03,
- AUDIO_MPD_CTRL_DYN_RANGE = 0x04,
- AUDIO_MPD_CTRL_SCALING = 0x05,
- AUDIO_MPD_CTRL_HILO_SCALING = 0x06,
- AUDIO_MPD_CTRL_UNDERFLOW = 0x07,
- AUDIO_MPD_CTRL_OVERFLOW = 0x08,
- AUDIO_MPD_CTRL_DECODER_ERROR = 0x09,
-} audio_MPEG_decoder_control_selector_t;
-
-/// A.17.13.2 AC-3 Decoder Control Selectors
-typedef enum
-{
- AUDIO_AD_CTRL_UNDEF = 0x00,
- AUDIO_AD_CTRL_MODE = 0x01,
- AUDIO_AD_CTRL_DYN_RANGE = 0x02,
- AUDIO_AD_CTRL_SCALING = 0x03,
- AUDIO_AD_CTRL_HILO_SCALING = 0x04,
- AUDIO_AD_CTRL_UNDERFLOW = 0x05,
- AUDIO_AD_CTRL_OVERFLOW = 0x06,
- AUDIO_AD_CTRL_DECODER_ERROR = 0x07,
-} audio_AC3_decoder_control_selector_t;
-
-/// A.17.13.3 WMA Decoder Control Selectors
-typedef enum
-{
- AUDIO_WD_CTRL_UNDEF = 0x00,
- AUDIO_WD_CTRL_UNDERFLOW = 0x01,
- AUDIO_WD_CTRL_OVERFLOW = 0x02,
- AUDIO_WD_CTRL_DECODER_ERROR = 0x03,
-} audio_WMA_decoder_control_selector_t;
-
-/// A.17.13.4 DTS Decoder Control Selectors
-typedef enum
-{
- AUDIO_DD_CTRL_UNDEF = 0x00,
- AUDIO_DD_CTRL_UNDERFLOW = 0x01,
- AUDIO_DD_CTRL_OVERFLOW = 0x02,
- AUDIO_DD_CTRL_DECODER_ERROR = 0x03,
-} audio_DTS_decoder_control_selector_t;
-
-/// A.17.14 Endpoint Control Selectors
-typedef enum
-{
- AUDIO_EP_CTRL_UNDEF = 0x00,
- AUDIO_EP_CTRL_PITCH = 0x01,
- AUDIO_EP_CTRL_DATA_OVERRUN = 0x02,
- AUDIO_EP_CTRL_DATA_UNDERRUN = 0x03,
-} audio_EP_control_selector_t;
-
-/// Terminal Types
-
-/// 2.1 - Audio Class-Terminal Types UAC2
-typedef enum
-{
- AUDIO_TERM_TYPE_USB_UNDEFINED = 0x0100,
- AUDIO_TERM_TYPE_USB_STREAMING = 0x0101,
- AUDIO_TERM_TYPE_USB_VENDOR_SPEC = 0x01FF,
-} audio_terminal_type_t;
-
-/// 2.2 - Audio Class-Input Terminal Types UAC2
-typedef enum
-{
- AUDIO_TERM_TYPE_IN_UNDEFINED = 0x0200,
- AUDIO_TERM_TYPE_IN_GENERIC_MIC = 0x0201,
- AUDIO_TERM_TYPE_IN_DESKTOP_MIC = 0x0202,
- AUDIO_TERM_TYPE_IN_PERSONAL_MIC = 0x0203,
- AUDIO_TERM_TYPE_IN_OMNI_MIC = 0x0204,
- AUDIO_TERM_TYPE_IN_ARRAY_MIC = 0x0205,
- AUDIO_TERM_TYPE_IN_PROC_ARRAY_MIC = 0x0206,
-} audio_terminal_input_type_t;
-
-/// 2.3 - Audio Class-Output Terminal Types UAC2
-typedef enum
-{
- AUDIO_TERM_TYPE_OUT_UNDEFINED = 0x0300,
- AUDIO_TERM_TYPE_OUT_GENERIC_SPEAKER = 0x0301,
- AUDIO_TERM_TYPE_OUT_HEADPHONES = 0x0302,
- AUDIO_TERM_TYPE_OUT_HEAD_MNT_DISP_AUIDO = 0x0303,
- AUDIO_TERM_TYPE_OUT_DESKTOP_SPEAKER = 0x0304,
- AUDIO_TERM_TYPE_OUT_ROOM_SPEAKER = 0x0305,
- AUDIO_TERM_TYPE_OUT_COMMUNICATION_SPEAKER = 0x0306,
- AUDIO_TERM_TYPE_OUT_LOW_FRQ_EFFECTS_SPEAKER = 0x0307,
-} audio_terminal_output_type_t;
-
-/// Rest is yet to be implemented
-
-/// Additional Audio Device Class Codes - Source: Audio Data Formats
-
-/// A.1 - Audio Class-Format Type Codes UAC2
-typedef enum
-{
- AUDIO_FORMAT_TYPE_UNDEFINED = 0x00,
- AUDIO_FORMAT_TYPE_I = 0x01,
- AUDIO_FORMAT_TYPE_II = 0x02,
- AUDIO_FORMAT_TYPE_III = 0x03,
- AUDIO_FORMAT_TYPE_IV = 0x04,
- AUDIO_EXT_FORMAT_TYPE_I = 0x81,
- AUDIO_EXT_FORMAT_TYPE_II = 0x82,
- AUDIO_EXT_FORMAT_TYPE_III = 0x83,
-} audio_format_type_t;
-
-// A.2.1 - Audio Class-Audio Data Format Type I UAC2
-typedef enum
-{
- AUDIO_DATA_FORMAT_TYPE_I_PCM = (uint32_t) (1 << 0),
- AUDIO_DATA_FORMAT_TYPE_I_PCM8 = (uint32_t) (1 << 1),
- AUDIO_DATA_FORMAT_TYPE_I_IEEE_FLOAT = (uint32_t) (1 << 2),
- AUDIO_DATA_FORMAT_TYPE_I_ALAW = (uint32_t) (1 << 3),
- AUDIO_DATA_FORMAT_TYPE_I_MULAW = (uint32_t) (1 << 4),
- AUDIO_DATA_FORMAT_TYPE_I_RAW_DATA = 0x80000000,
-} audio_data_format_type_I_t;
-
-/// All remaining definitions are taken from the descriptor descriptions in the UAC2 main specification
-
-/// Isochronous End Point Attributes
-typedef enum
-{
- TUSB_ISO_EP_ATT_NO_SYNC = 0x00,
- TUSB_ISO_EP_ATT_ASYNCHRONOUS = 0x04,
- TUSB_ISO_EP_ATT_ADAPTIVE = 0x08,
- TUSB_ISO_EP_ATT_SYNCHRONOUS = 0x0C,
- TUSB_ISO_EP_ATT_DATA = 0x00, ///< Data End Point
- TUSB_ISO_EP_ATT_EXPLICIT_FB = 0x10, ///< Feedback End Point
- TUSB_ISO_EP_ATT_IMPLICIT_FB = 0x20, ///< Data endpoint that also serves as an implicit feedback
-} tusb_iso_ep_attribute_t;
-
-/// Audio Class-Control Values UAC2
-typedef enum
-{
- AUDIO_CTRL_NONE = 0x00, ///< No Host access
- AUDIO_CTRL_R = 0x01, ///< Host read access only
- AUDIO_CTRL_RW = 0x03, ///< Host read write access
-} audio_control_t;
-
-/// Audio Class-Specific AC Interface Descriptor Controls UAC2
-typedef enum
-{
- AUDIO_CS_AS_INTERFACE_CTRL_LATENCY_POS = 0,
-} audio_cs_ac_interface_control_pos_t;
-
-/// Audio Class-Specific AS Interface Descriptor Controls UAC2
-typedef enum
-{
- AUDIO_CS_AS_INTERFACE_CTRL_ACTIVE_ALT_SET_POS = 0,
- AUDIO_CS_AS_INTERFACE_CTRL_VALID_ALT_SET_POS = 2,
-} audio_cs_as_interface_control_pos_t;
-
-/// Audio Class-Specific AS Isochronous Data EP Attributes UAC2
-typedef enum
-{
- AUDIO_CS_AS_ISO_DATA_EP_ATT_MAX_PACKETS_ONLY = 0x80,
- AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK = 0x00,
-} audio_cs_as_iso_data_ep_attribute_t;
-
-/// Audio Class-Specific AS Isochronous Data EP Controls UAC2
-typedef enum
-{
- AUDIO_CS_AS_ISO_DATA_EP_CTRL_PITCH_POS = 0,
- AUDIO_CS_AS_ISO_DATA_EP_CTRL_DATA_OVERRUN_POS = 2,
- AUDIO_CS_AS_ISO_DATA_EP_CTRL_DATA_UNDERRUN_POS = 4,
-} audio_cs_as_iso_data_ep_control_pos_t;
-
-/// Audio Class-Specific AS Isochronous Data EP Lock Delay Units UAC2
-typedef enum
-{
- AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_UNDEFINED = 0x00,
- AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_MILLISEC = 0x01,
- AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_PCM_SAMPLES = 0x02,
-} audio_cs_as_iso_data_ep_lock_delay_unit_t;
-
-/// Audio Class-Clock Source Attributes UAC2
-typedef enum
-{
- AUDIO_CLOCK_SOURCE_ATT_EXT_CLK = 0x00,
- AUDIO_CLOCK_SOURCE_ATT_INT_FIX_CLK = 0x01,
- AUDIO_CLOCK_SOURCE_ATT_INT_VAR_CLK = 0x02,
- AUDIO_CLOCK_SOURCE_ATT_INT_PRO_CLK = 0x03,
- AUDIO_CLOCK_SOURCE_ATT_CLK_SYC_SOF = 0x04,
-} audio_clock_source_attribute_t;
-
-/// Audio Class-Clock Source Controls UAC2
-typedef enum
-{
- AUDIO_CLOCK_SOURCE_CTRL_CLK_FRQ_POS = 0,
- AUDIO_CLOCK_SOURCE_CTRL_CLK_VAL_POS = 2,
-} audio_clock_source_control_pos_t;
-
-/// Audio Class-Clock Selector Controls UAC2
-typedef enum
-{
- AUDIO_CLOCK_SELECTOR_CTRL_POS = 0,
-} audio_clock_selector_control_pos_t;
-
-/// Audio Class-Clock Multiplier Controls UAC2
-typedef enum
-{
- AUDIO_CLOCK_MULTIPLIER_CTRL_NUMERATOR_POS = 0,
- AUDIO_CLOCK_MULTIPLIER_CTRL_DENOMINATOR_POS = 2,
-} audio_clock_multiplier_control_pos_t;
-
-/// Audio Class-Input Terminal Controls UAC2
-typedef enum
-{
- AUDIO_IN_TERM_CTRL_CPY_PROT_POS = 0,
- AUDIO_IN_TERM_CTRL_CONNECTOR_POS = 2,
- AUDIO_IN_TERM_CTRL_OVERLOAD_POS = 4,
- AUDIO_IN_TERM_CTRL_CLUSTER_POS = 6,
- AUDIO_IN_TERM_CTRL_UNDERFLOW_POS = 8,
- AUDIO_IN_TERM_CTRL_OVERFLOW_POS = 10,
-} audio_terminal_input_control_pos_t;
-
-/// Audio Class-Output Terminal Controls UAC2
-typedef enum
-{
- AUDIO_OUT_TERM_CTRL_CPY_PROT_POS = 0,
- AUDIO_OUT_TERM_CTRL_CONNECTOR_POS = 2,
- AUDIO_OUT_TERM_CTRL_OVERLOAD_POS = 4,
- AUDIO_OUT_TERM_CTRL_UNDERFLOW_POS = 6,
- AUDIO_OUT_TERM_CTRL_OVERFLOW_POS = 8,
-} audio_terminal_output_control_pos_t;
-
-/// Audio Class-Feature Unit Controls UAC2
-typedef enum
-{
- AUDIO_FEATURE_UNIT_CTRL_MUTE_POS = 0,
- AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS = 2,
- AUDIO_FEATURE_UNIT_CTRL_BASS_POS = 4,
- AUDIO_FEATURE_UNIT_CTRL_MID_POS = 6,
- AUDIO_FEATURE_UNIT_CTRL_TREBLE_POS = 8,
- AUDIO_FEATURE_UNIT_CTRL_GRAPHIC_EQU_POS = 10,
- AUDIO_FEATURE_UNIT_CTRL_AGC_POS = 12,
- AUDIO_FEATURE_UNIT_CTRL_DELAY_POS = 14,
- AUDIO_FEATURE_UNIT_CTRL_BASS_BOOST_POS = 16,
- AUDIO_FEATURE_UNIT_CTRL_LOUDNESS_POS = 18,
- AUDIO_FEATURE_UNIT_CTRL_INPUT_GAIN_POS = 20,
- AUDIO_FEATURE_UNIT_CTRL_INPUT_GAIN_PAD_POS = 22,
- AUDIO_FEATURE_UNIT_CTRL_PHASE_INV_POS = 24,
- AUDIO_FEATURE_UNIT_CTRL_UNDERFLOW_POS = 26,
- AUDIO_FEATURE_UNIT_CTRL_OVERFLOW_POS = 28,
-} audio_feature_unit_control_pos_t;
-
-/// Audio Class-Audio Channel Configuration UAC2
-typedef enum
-{
- AUDIO_CHANNEL_CONFIG_NON_PREDEFINED = 0x00000000,
- AUDIO_CHANNEL_CONFIG_FRONT_LEFT = 0x00000001,
- AUDIO_CHANNEL_CONFIG_FRONT_RIGHT = 0x00000002,
- AUDIO_CHANNEL_CONFIG_FRONT_CENTER = 0x00000004,
- AUDIO_CHANNEL_CONFIG_LOW_FRQ_EFFECTS = 0x00000008,
- AUDIO_CHANNEL_CONFIG_BACK_LEFT = 0x00000010,
- AUDIO_CHANNEL_CONFIG_BACK_RIGHT = 0x00000020,
- AUDIO_CHANNEL_CONFIG_FRONT_LEFT_OF_CENTER = 0x00000040,
- AUDIO_CHANNEL_CONFIG_FRONT_RIGHT_OF_CENTER = 0x00000080,
- AUDIO_CHANNEL_CONFIG_BACK_CENTER = 0x00000100,
- AUDIO_CHANNEL_CONFIG_SIDE_LEFT = 0x00000200,
- AUDIO_CHANNEL_CONFIG_SIDE_RIGHT = 0x00000400,
- AUDIO_CHANNEL_CONFIG_TOP_CENTER = 0x00000800,
- AUDIO_CHANNEL_CONFIG_TOP_FRONT_LEFT = 0x00001000,
- AUDIO_CHANNEL_CONFIG_TOP_FRONT_CENTER = 0x00002000,
- AUDIO_CHANNEL_CONFIG_TOP_FRONT_RIGHT = 0x00004000,
- AUDIO_CHANNEL_CONFIG_TOP_BACK_LEFT = 0x00008000,
- AUDIO_CHANNEL_CONFIG_TOP_BACK_CENTER = 0x00010000,
- AUDIO_CHANNEL_CONFIG_TOP_BACK_RIGHT = 0x00020000,
- AUDIO_CHANNEL_CONFIG_TOP_FRONT_LEFT_OF_CENTER = 0x00040000,
- AUDIO_CHANNEL_CONFIG_TOP_FRONT_RIGHT_OF_CENTER = 0x00080000,
- AUDIO_CHANNEL_CONFIG_LEFT_LOW_FRQ_EFFECTS = 0x00100000,
- AUDIO_CHANNEL_CONFIG_RIGHT_LOW_FRQ_EFFECTS = 0x00200000,
- AUDIO_CHANNEL_CONFIG_TOP_SIDE_LEFT = 0x00400000,
- AUDIO_CHANNEL_CONFIG_TOP_SIDE_RIGHT = 0x00800000,
- AUDIO_CHANNEL_CONFIG_BOTTOM_CENTER = 0x01000000,
- AUDIO_CHANNEL_CONFIG_BACK_LEFT_OF_CENTER = 0x02000000,
- AUDIO_CHANNEL_CONFIG_BACK_RIGHT_OF_CENTER = 0x04000000,
- AUDIO_CHANNEL_CONFIG_RAW_DATA = 0x80000000,
-} audio_channel_config_t;
-
-/// AUDIO Channel Cluster Descriptor (4.1)
-typedef struct TU_ATTR_PACKED {
- uint8_t bNrChannels; ///< Number of channels currently connected.
- audio_channel_config_t bmChannelConfig; ///< Bitmap according to 'audio_channel_config_t' with a 1 set if channel is connected and 0 else. In case channels are non-predefined ignore them here (see UAC2 specification 4.1 Audio Channel Cluster Descriptor.
- uint8_t iChannelNames; ///< Index of a string descriptor, describing the name of the first inserted channel with a non-predefined spatial location.
-} audio_desc_channel_cluster_t;
-
-/// AUDIO Class-Specific AC Interface Header Descriptor (4.7.2)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes: 9.
- uint8_t bDescriptorType ; ///< Descriptor Type. Value: TUSB_DESC_CS_INTERFACE.
- uint8_t bDescriptorSubType ; ///< Descriptor SubType. Value: AUDIO_CS_AC_INTERFACE_HEADER.
- uint16_t bcdADC ; ///< Audio Device Class Specification Release Number in Binary-Coded Decimal. Value: U16_TO_U8S_LE(0x0200).
- uint8_t bCategory ; ///< Constant, indicating the primary use of this audio function, as intended by the manufacturer. See: audio_function_t.
- uint16_t wTotalLength ; ///< Total number of bytes returned for the class-specific AudioControl interface descriptor. Includes the combined length of this descriptor header and all Clock Source, Unit and Terminal descriptors.
- uint8_t bmControls ; ///< See: audio_cs_ac_interface_control_pos_t.
-} audio_desc_cs_ac_interface_t;
-
-/// AUDIO Clock Source Descriptor (4.7.2.1)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes: 8.
- uint8_t bDescriptorType ; ///< Descriptor Type. Value: TUSB_DESC_CS_INTERFACE.
- uint8_t bDescriptorSubType ; ///< Descriptor SubType. Value: AUDIO_CS_AC_INTERFACE_CLOCK_SOURCE.
- uint8_t bClockID ; ///< Constant uniquely identifying the Clock Source Entity within the audio function. This value is used in all requests to address this Entity.
- uint8_t bmAttributes ; ///< See: audio_clock_source_attribute_t.
- uint8_t bmControls ; ///< See: audio_clock_source_control_pos_t.
- uint8_t bAssocTerminal ; ///< Terminal ID of the Terminal that is associated with this Clock Source.
- uint8_t iClockSource ; ///< Index of a string descriptor, describing the Clock Source Entity.
-} audio_desc_clock_source_t;
-
-/// AUDIO Clock Selector Descriptor (4.7.2.2) for ONE pin
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor, in bytes: 7+p.
- uint8_t bDescriptorType ; ///< Descriptor Type. Value: TUSB_DESC_CS_INTERFACE.
- uint8_t bDescriptorSubType ; ///< Descriptor SubType. Value: AUDIO_CS_AC_INTERFACE_CLOCK_SELECTOR.
- uint8_t bClockID ; ///< Constant uniquely identifying the Clock Selector Entity within the audio function. This value is used in all requests to address this Entity.
- uint8_t bNrInPins ; ///< Number of Input Pins of this Unit: p = 1 thus bNrInPins = 1.
- uint8_t baCSourceID ; ///< ID of the Clock Entity to which the first Clock Input Pin of this Clock Selector Entity is connected..
- uint8_t bmControls ; ///< See: audio_clock_selector_control_pos_t.
- uint8_t iClockSource ; ///< Index of a string descriptor, describing the Clock Selector Entity.
-} audio_desc_clock_selector_t;
-
-/// AUDIO Clock Selector Descriptor (4.7.2.2) for multiple pins
-#define audio_desc_clock_selector_n_t(source_num) \
- struct TU_ATTR_PACKED { \
- uint8_t bLength ; \
- uint8_t bDescriptorType ; \
- uint8_t bDescriptorSubType ; \
- uint8_t bClockID ; \
- uint8_t bNrInPins ; \
- struct TU_ATTR_PACKED { \
- uint8_t baSourceID ; \
- } sourceID[source_num] ; \
- uint8_t bmControls ; \
- uint8_t iClockSource ; \
-}
-
-/// AUDIO Clock Multiplier Descriptor (4.7.2.3)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor, in bytes: 7.
- uint8_t bDescriptorType ; ///< Descriptor Type. Value: TUSB_DESC_CS_INTERFACE.
- uint8_t bDescriptorSubType ; ///< Descriptor SubType. Value: AUDIO_CS_AC_INTERFACE_CLOCK_MULTIPLIER.
- uint8_t bClockID ; ///< Constant uniquely identifying the Clock Multiplier Entity within the audio function. This value is used in all requests to address this Entity.
- uint8_t bCSourceID ; ///< ID of the Clock Entity to which the last Clock Input Pin of this Clock Selector Entity is connected.
- uint8_t bmControls ; ///< See: audio_clock_multiplier_control_pos_t.
- uint8_t iClockSource ; ///< Index of a string descriptor, describing the Clock Multiplier Entity.
-} audio_desc_clock_multiplier_t;
-
-/// AUDIO Input Terminal Descriptor(4.7.2.4)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor, in bytes: 17.
- uint8_t bDescriptorType ; ///< Descriptor Type. Value: TUSB_DESC_CS_INTERFACE.
- uint8_t bDescriptorSubType ; ///< Descriptor SubType. Value: AUDIO_CS_AC_INTERFACE_INPUT_TERMINAL.
- uint16_t wTerminalType ; ///< Constant characterizing the type of Terminal. See: audio_terminal_type_t for USB streaming and audio_terminal_input_type_t for other input types.
- uint8_t bAssocTerminal ; ///< ID of the Output Terminal to which this Input Terminal is associated.
- uint8_t bCSourceID ; ///< ID of the Clock Entity to which this Input Terminal is connected.
- uint8_t bNrChannels ; ///< Number of logical output channels in the Terminal’s output audio channel cluster.
- uint32_t bmChannelConfig ; ///< Describes the spatial location of the logical channels. See:audio_channel_config_t.
- uint16_t bmControls ; ///< See: audio_terminal_input_control_pos_t.
- uint8_t iTerminal ; ///< Index of a string descriptor, describing the Input Terminal.
-} audio_desc_input_terminal_t;
-
-/// AUDIO Output Terminal Descriptor(4.7.2.5)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor, in bytes: 12.
- uint8_t bDescriptorType ; ///< Descriptor Type. Value: TUSB_DESC_CS_INTERFACE.
- uint8_t bDescriptorSubType ; ///< Descriptor SubType. Value: AUDIO_CS_AC_INTERFACE_OUTPUT_TERMINAL.
- uint8_t bTerminalID ; ///< Constant uniquely identifying the Terminal within the audio function. This value is used in all requests to address this Terminal.
- uint16_t wTerminalType ; ///< Constant characterizing the type of Terminal. See: audio_terminal_type_t for USB streaming and audio_terminal_output_type_t for other output types.
- uint8_t bAssocTerminal ; ///< Constant, identifying the Input Terminal to which this Output Terminal is associated.
- uint8_t bSourceID ; ///< ID of the Unit or Terminal to which this Terminal is connected.
- uint8_t bCSourceID ; ///< ID of the Clock Entity to which this Output Terminal is connected.
- uint16_t bmControls ; ///< See: audio_terminal_output_type_t.
- uint8_t iTerminal ; ///< Index of a string descriptor, describing the Output Terminal.
-} audio_desc_output_terminal_t;
-
-/// AUDIO Feature Unit Descriptor(4.7.2.8) for ONE channel
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor, in bytes: 14.
- uint8_t bDescriptorType ; ///< Descriptor Type. Value: TUSB_DESC_CS_INTERFACE.
- uint8_t bDescriptorSubType ; ///< Descriptor SubType. Value: AUDIO_CS_AC_INTERFACE_FEATURE_UNIT.
- uint8_t bUnitID ; ///< Constant uniquely identifying the Unit within the audio function. This value is used in all requests to address this Unit.
- uint8_t bSourceID ; ///< ID of the Unit or Terminal to which this Feature Unit is connected.
- struct TU_ATTR_PACKED {
- uint32_t bmaControls ; ///< See: audio_feature_unit_control_pos_t. Controls0 is master channel 0 (always present) and Controls1 is logical channel 1.
- } controls[2] ;
- uint8_t iTerminal ; ///< Index of a string descriptor, describing this Feature Unit.
-} audio_desc_feature_unit_t;
-
-/// AUDIO Feature Unit Descriptor(4.7.2.8) for multiple channels
-#define audio_desc_feature_unit_n_t(ch_num)\
- struct TU_ATTR_PACKED { \
- uint8_t bLength ; /* 6+(ch_num+1)*4 */\
- uint8_t bDescriptorType ; \
- uint8_t bDescriptorSubType ; \
- uint8_t bUnitID ; \
- uint8_t bSourceID ; \
- struct TU_ATTR_PACKED { \
- uint32_t bmaControls ; \
- } controls[ch_num+1] ; \
- uint8_t iTerminal ; \
-}
-
-/// AUDIO Class-Specific AS Interface Descriptor(4.9.2)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor, in bytes: 16.
- uint8_t bDescriptorType ; ///< Descriptor Type. Value: TUSB_DESC_CS_INTERFACE.
- uint8_t bDescriptorSubType ; ///< Descriptor SubType. Value: AUDIO_CS_AS_INTERFACE_AS_GENERAL.
- uint8_t bTerminalLink ; ///< The Terminal ID of the Terminal to which this interface is connected.
- uint8_t bmControls ; ///< See: audio_cs_as_interface_control_pos_t.
- uint8_t bFormatType ; ///< Constant identifying the Format Type the AudioStreaming interface is using. See: audio_format_type_t.
- uint32_t bmFormats ; ///< The Audio Data Format(s) that can be used to communicate with this interface.See: audio_data_format_type_I_t.
- uint8_t bNrChannels ; ///< Number of physical channels in the AS Interface audio channel cluster.
- uint32_t bmChannelConfig ; ///< Describes the spatial location of the physical channels. See: audio_channel_config_t.
- uint8_t iChannelNames ; ///< Index of a string descriptor, describing the name of the first physical channel.
-} audio_desc_cs_as_interface_t;
-
-/// AUDIO Type I Format Type Descriptor(2.3.1.6 - Audio Formats)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor, in bytes: 6.
- uint8_t bDescriptorType ; ///< Descriptor Type. Value: TUSB_DESC_CS_INTERFACE.
- uint8_t bDescriptorSubType ; ///< Descriptor SubType. Value: AUDIO_CS_AS_INTERFACE_FORMAT_TYPE.
- uint8_t bFormatType ; ///< Constant identifying the Format Type the AudioStreaming interface is using. Value: AUDIO_FORMAT_TYPE_I.
- uint8_t bSubslotSize ; ///< The number of bytes occupied by one audio subslot. Can be 1, 2, 3 or 4.
- uint8_t bBitResolution ; ///< The number of effectively used bits from the available bits in an audio subslot.
-} audio_desc_type_I_format_t;
-
-/// AUDIO Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor, in bytes: 8.
- uint8_t bDescriptorType ; ///< Descriptor Type. Value: TUSB_DESC_CS_ENDPOINT.
- uint8_t bDescriptorSubType ; ///< Descriptor SubType. Value: AUDIO_CS_EP_SUBTYPE_GENERAL.
- uint8_t bmAttributes ; ///< See: audio_cs_as_iso_data_ep_attribute_t.
- uint8_t bmControls ; ///< See: audio_cs_as_iso_data_ep_control_pos_t.
- uint8_t bLockDelayUnits ; ///< Indicates the units used for the wLockDelay field. See: audio_cs_as_iso_data_ep_lock_delay_unit_t.
- uint16_t wLockDelay ; ///< Indicates the time it takes this endpoint to reliably lock its internal clock recovery circuitry. Units used depend on the value of the bLockDelayUnits field.
-} audio_desc_cs_as_iso_data_ep_t;
-
-// 5.2.2 Control Request Layout
-typedef struct TU_ATTR_PACKED
-{
- union
- {
- struct TU_ATTR_PACKED
- {
- uint8_t recipient : 5; ///< Recipient type tusb_request_recipient_t.
- uint8_t type : 2; ///< Request type tusb_request_type_t.
- uint8_t direction : 1; ///< Direction type. tusb_dir_t
- } bmRequestType_bit;
-
- uint8_t bmRequestType;
- };
-
- uint8_t bRequest; ///< Request type audio_cs_req_t
- uint8_t bChannelNumber;
- uint8_t bControlSelector;
- union
- {
- uint8_t bInterface;
- uint8_t bEndpoint;
- };
- uint8_t bEntityID;
- uint16_t wLength;
-} audio_control_request_t;
-
-//// 5.2.3 Control Request Parameter Block Layout
-
-// 5.2.3.1 1-byte Control CUR Parameter Block
-typedef struct TU_ATTR_PACKED
-{
- int8_t bCur ; ///< The setting for the CUR attribute of the addressed Control
-} audio_control_cur_1_t;
-
-// 5.2.3.2 2-byte Control CUR Parameter Block
-typedef struct TU_ATTR_PACKED
-{
- int16_t bCur ; ///< The setting for the CUR attribute of the addressed Control
-} audio_control_cur_2_t;
-
-// 5.2.3.3 4-byte Control CUR Parameter Block
-typedef struct TU_ATTR_PACKED
-{
- int32_t bCur ; ///< The setting for the CUR attribute of the addressed Control
-} audio_control_cur_4_t;
-
-// Use the following ONLY for RECEIVED data - compiler does not know how many subranges are defined! Use the one below for predefined lengths - or if you know what you are doing do what you like
-// 5.2.3.1 1-byte Control RANGE Parameter Block
-typedef struct TU_ATTR_PACKED {
- uint16_t wNumSubRanges;
- struct TU_ATTR_PACKED {
- int8_t bMin ; /*The setting for the MIN attribute of the nth subrange of the addressed Control*/
- int8_t bMax ; /*The setting for the MAX attribute of the nth subrange of the addressed Control*/
- uint8_t bRes ; /*The setting for the RES attribute of the nth subrange of the addressed Control*/
- } subrange[] ;
-} audio_control_range_1_t;
-
-// 5.2.3.2 2-byte Control RANGE Parameter Block
-typedef struct TU_ATTR_PACKED {
- uint16_t wNumSubRanges;
- struct TU_ATTR_PACKED {
- int16_t bMin ; /*The setting for the MIN attribute of the nth subrange of the addressed Control*/
- int16_t bMax ; /*The setting for the MAX attribute of the nth subrange of the addressed Control*/
- uint16_t bRes ; /*The setting for the RES attribute of the nth subrange of the addressed Control*/
- } subrange[] ;
-} audio_control_range_2_t;
-
-// 5.2.3.3 4-byte Control RANGE Parameter Block
-typedef struct TU_ATTR_PACKED {
- uint16_t wNumSubRanges;
- struct TU_ATTR_PACKED {
- int32_t bMin ; /*The setting for the MIN attribute of the nth subrange of the addressed Control*/
- int32_t bMax ; /*The setting for the MAX attribute of the nth subrange of the addressed Control*/
- uint32_t bRes ; /*The setting for the RES attribute of the nth subrange of the addressed Control*/
- } subrange[] ;
-} audio_control_range_4_t;
-
-// 5.2.3.1 1-byte Control RANGE Parameter Block
-#define audio_control_range_1_n_t(numSubRanges) \
- struct TU_ATTR_PACKED { \
- uint16_t wNumSubRanges; \
- struct TU_ATTR_PACKED { \
- int8_t bMin ; /*The setting for the MIN attribute of the nth subrange of the addressed Control*/\
- int8_t bMax ; /*The setting for the MAX attribute of the nth subrange of the addressed Control*/\
- uint8_t bRes ; /*The setting for the RES attribute of the nth subrange of the addressed Control*/\
- } subrange[numSubRanges] ; \
-}
-
-/// 5.2.3.2 2-byte Control RANGE Parameter Block
-#define audio_control_range_2_n_t(numSubRanges) \
- struct TU_ATTR_PACKED { \
- uint16_t wNumSubRanges; \
- struct TU_ATTR_PACKED { \
- int16_t bMin ; /*The setting for the MIN attribute of the nth subrange of the addressed Control*/\
- int16_t bMax ; /*The setting for the MAX attribute of the nth subrange of the addressed Control*/\
- uint16_t bRes ; /*The setting for the RES attribute of the nth subrange of the addressed Control*/\
- } subrange[numSubRanges]; \
-}
-
-// 5.2.3.3 4-byte Control RANGE Parameter Block
-#define audio_control_range_4_n_t(numSubRanges) \
- struct TU_ATTR_PACKED { \
- uint16_t wNumSubRanges; \
- struct TU_ATTR_PACKED { \
- int32_t bMin ; /*The setting for the MIN attribute of the nth subrange of the addressed Control*/\
- int32_t bMax ; /*The setting for the MAX attribute of the nth subrange of the addressed Control*/\
- uint32_t bRes ; /*The setting for the RES attribute of the nth subrange of the addressed Control*/\
- } subrange[numSubRanges]; \
-}
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-/** @} */
diff --git a/tinyusb/src/class/audio/audio_device.c b/tinyusb/src/class/audio/audio_device.c
deleted file mode 100755
index ff4e312a..00000000
--- a/tinyusb/src/class/audio/audio_device.c
+++ /dev/null
@@ -1,2272 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Reinhard Panhuber, Jerzy Kasenberg
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/*
- * This driver supports at most one out EP, one in EP, one control EP, and one feedback EP and one alternative interface other than zero. Hence, only one input terminal and one output terminal are support, if you need more adjust the driver!
- * It supports multiple TX and RX channels.
- *
- * In case you need more alternate interfaces, you need to define additional defines for this specific alternate interface. Just define them and set them in the set_interface function.
- *
- * There are three data flow structures currently implemented, where at least one SW-FIFO is used to decouple the asynchronous processes MCU vs. host
- *
- * 1. Input data -> SW-FIFO -> MCU USB
- *
- * The most easiest version, available in case the target MCU can handle the software FIFO (SW-FIFO) and if it is implemented in the device driver (if yes then dcd_edpt_xfer_fifo() is available)
- *
- * 2. Input data -> SW-FIFO -> Linear buffer -> MCU USB
- *
- * In case the target MCU can not handle a SW-FIFO, a linear buffer is used. This uses the default function dcd_edpt_xfer(). In this case more memory is required.
- *
- * 3. (Input data 1 | Input data 2 | ... | Input data N) -> (SW-FIFO 1 | SW-FIFO 2 | ... | SW-FIFO N) -> Linear buffer -> MCU USB
- *
- * This case is used if you have more channels which need to be combined into one stream. Every channel has its own SW-FIFO. All data is encoded into an Linear buffer.
- *
- * The same holds in the RX case.
- *
- * */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_AUDIO)
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "device/usbd.h"
-#include "device/usbd_pvt.h"
-
-#include "audio_device.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-// Linear buffer in case target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer
-// is available or driver is would need to be changed dramatically
-
-// Only STM32 synopsys use non-linear buffer for now
-// Synopsys detection copied from dcd_synopsys.c (refactor later on)
-#if defined (STM32F105x8) || defined (STM32F105xB) || defined (STM32F105xC) || \
- defined (STM32F107xB) || defined (STM32F107xC)
-#define STM32F1_SYNOPSYS
-#endif
-
-#if defined (STM32L475xx) || defined (STM32L476xx) || \
- defined (STM32L485xx) || defined (STM32L486xx) || defined (STM32L496xx) || \
- defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || \
- defined (STM32L4S5xx) || defined (STM32L4S7xx) || defined (STM32L4S9xx)
-#define STM32L4_SYNOPSYS
-#endif
-
-#if (CFG_TUSB_MCU == OPT_MCU_STM32F1 && defined(STM32F1_SYNOPSYS)) || \
- CFG_TUSB_MCU == OPT_MCU_STM32F2 || \
- CFG_TUSB_MCU == OPT_MCU_STM32F4 || \
- CFG_TUSB_MCU == OPT_MCU_STM32F7 || \
- CFG_TUSB_MCU == OPT_MCU_STM32H7 || \
- (CFG_TUSB_MCU == OPT_MCU_STM32L4 && defined(STM32L4_SYNOPSYS)) || \
- CFG_TUSB_MCU == OPT_MCU_RX63X || \
- CFG_TUSB_MCU == OPT_MCU_RX65X || \
- CFG_TUSB_MCU == OPT_MCU_RX72N || \
- CFG_TUSB_MCU == OPT_MCU_GD32VF103
-#define USE_LINEAR_BUFFER 0
-#else
-#define USE_LINEAR_BUFFER 1
-#endif
-
-// Declaration of buffers
-
-// Check for maximum supported numbers
-#if CFG_TUD_AUDIO > 3
-#error Maximum number of audio functions restricted to three!
-#endif
-
-// EP IN software buffers and mutexes
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
-#if CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_in_sw_buf_1[CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ];
-#if CFG_FIFO_MUTEX
-osal_mutex_def_t ep_in_ff_mutex_wr_1; // No need for read mutex as only USB driver reads from FIFO
-#endif
-#endif // CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ > 0
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_in_sw_buf_2[CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ];
-#if CFG_FIFO_MUTEX
-osal_mutex_def_t ep_in_ff_mutex_wr_2; // No need for read mutex as only USB driver reads from FIFO
-#endif
-#endif // CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ > 0
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_in_sw_buf_3[CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ];
-#if CFG_FIFO_MUTEX
-osal_mutex_def_t ep_in_ff_mutex_wr_3; // No need for read mutex as only USB driver reads from FIFO
-#endif
-#endif // CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ > 0
-#endif // CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
-
-// Linear buffer TX in case:
-// - target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer is available or driver is would need to be changed dramatically OR
-// - the software encoding is used - in this case the linear buffers serve as a target memory where logical channels are encoded into
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_ENCODING)
-#if CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_in_1[CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX];
-#endif
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_IN_SZ_MAX > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_in_2[CFG_TUD_AUDIO_FUNC_2_EP_IN_SZ_MAX];
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_IN_SZ_MAX > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_in_3[CFG_TUD_AUDIO_FUNC_3_EP_IN_SZ_MAX];
-#endif
-#endif // CFG_TUD_AUDIO_ENABLE_EP_IN && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_DECODING)
-
-// EP OUT software buffers and mutexes
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
-#if CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_out_sw_buf_1[CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ];
-#if CFG_FIFO_MUTEX
-osal_mutex_def_t ep_out_ff_mutex_rd_1; // No need for write mutex as only USB driver writes into FIFO
-#endif
-#endif // CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ > 0
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_out_sw_buf_2[CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ];
-#if CFG_FIFO_MUTEX
-osal_mutex_def_t ep_out_ff_mutex_rd_2; // No need for write mutex as only USB driver writes into FIFO
-#endif
-#endif // CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ > 0
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t audio_ep_out_sw_buf_3[CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ];
-#if CFG_FIFO_MUTEX
-osal_mutex_def_t ep_out_ff_mutex_rd_3; // No need for write mutex as only USB driver writes into FIFO
-#endif
-#endif // CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ > 0
-#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
-
-// Linear buffer RX in case:
-// - target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer is available or driver is would need to be changed dramatically OR
-// - the software encoding is used - in this case the linear buffers serve as a target memory where logical channels are encoded into
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_DECODING)
-#if CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_out_1[CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX];
-#endif
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_OUT_SZ_MAX > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_out_2[CFG_TUD_AUDIO_FUNC_2_EP_OUT_SZ_MAX];
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_OUT_SZ_MAX > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t lin_buf_out_3[CFG_TUD_AUDIO_FUNC_3_EP_OUT_SZ_MAX];
-#endif
-#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_DECODING)
-
-// Control buffers
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t ctrl_buf_1[CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ];
-#if CFG_TUD_AUDIO > 1
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t ctrl_buf_2[CFG_TUD_AUDIO_FUNC_2_CTRL_BUF_SZ];
-#endif
-#if CFG_TUD_AUDIO > 2
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t ctrl_buf_3[CFG_TUD_AUDIO_FUNC_3_CTRL_BUF_SZ];
-#endif
-
-// Active alternate setting of interfaces
-uint8_t alt_setting_1[CFG_TUD_AUDIO_FUNC_1_N_AS_INT];
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_N_AS_INT > 0
-uint8_t alt_setting_2[CFG_TUD_AUDIO_FUNC_2_N_AS_INT];
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_N_AS_INT > 0
-uint8_t alt_setting_3[CFG_TUD_AUDIO_FUNC_3_N_AS_INT];
-#endif
-
-// Software encoding/decoding support FIFOs
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
-#if CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t tx_supp_ff_buf_1[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ];
-tu_fifo_t tx_supp_ff_1[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO];
-#if CFG_FIFO_MUTEX
-osal_mutex_def_t tx_supp_ff_mutex_wr_1[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO]; // No need for read mutex as only USB driver reads from FIFO
-#endif
-#endif
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t tx_supp_ff_buf_2[CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ];
-tu_fifo_t tx_supp_ff_2[CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO];
-#if CFG_FIFO_MUTEX
-osal_mutex_def_t tx_supp_ff_mutex_wr_2[CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO]; // No need for read mutex as only USB driver reads from FIFO
-#endif
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_TX_SUPP_SW_FIFO_SZ > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t tx_supp_ff_buf_3[CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_3_TX_SUPP_SW_FIFO_SZ];
-tu_fifo_t tx_supp_ff_3[CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO];
-#if CFG_FIFO_MUTEX
-osal_mutex_def_t tx_supp_ff_mutex_wr_3[CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO]; // No need for read mutex as only USB driver reads from FIFO
-#endif
-#endif
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
-#if CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t rx_supp_ff_buf_1[CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ];
-tu_fifo_t rx_supp_ff_1[CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO];
-#if CFG_FIFO_MUTEX
-osal_mutex_def_t rx_supp_ff_mutex_rd_1[CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO]; // No need for write mutex as only USB driver writes into FIFO
-#endif
-#endif
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t rx_supp_ff_buf_2[CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ];
-tu_fifo_t rx_supp_ff_2[CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO];
-#if CFG_FIFO_MUTEX
-osal_mutex_def_t rx_supp_ff_mutex_rd_2[CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO]; // No need for write mutex as only USB driver writes into FIFO
-#endif
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_RX_SUPP_SW_FIFO_SZ > 0
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t rx_supp_ff_buf_3[CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_3_RX_SUPP_SW_FIFO_SZ];
-tu_fifo_t rx_supp_ff_3[CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO];
-#if CFG_FIFO_MUTEX
-osal_mutex_def_t rx_supp_ff_mutex_rd_3[CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO]; // No need for write mutex as only USB driver writes into FIFO
-#endif
-#endif
-#endif
-
-typedef struct
-{
- uint8_t rhport;
- uint8_t const * p_desc; // Pointer pointing to Standard AC Interface Descriptor(4.7.1) - Audio Control descriptor defining audio function
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN
- uint8_t ep_in; // TX audio data EP.
- uint16_t ep_in_sz; // Current size of TX EP
- uint8_t ep_in_as_intf_num; // Corresponding Standard AS Interface Descriptor (4.9.1) belonging to output terminal to which this EP belongs - 0 is invalid (this fits to UAC2 specification since AS interfaces can not have interface number equal to zero)
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
- uint8_t ep_out; // Incoming (into uC) audio data EP.
- uint16_t ep_out_sz; // Current size of RX EP
- uint8_t ep_out_as_intf_num; // Corresponding Standard AS Interface Descriptor (4.9.1) belonging to input terminal to which this EP belongs - 0 is invalid (this fits to UAC2 specification since AS interfaces can not have interface number equal to zero)
-
-#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
- uint8_t ep_fb; // Feedback EP.
-#endif
-
-#endif
-
-#if CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
- uint8_t ep_int_ctr; // Audio control interrupt EP.
-#endif
-
- /*------------- From this point, data is not cleared by bus reset -------------*/
-
- uint16_t desc_length; // Length of audio function descriptor
-
- // Buffer for control requests
- uint8_t * ctrl_buf;
- uint8_t ctrl_buf_sz;
-
- // Current active alternate settings
- uint8_t * alt_setting; // We need to save the current alternate setting this way, because it is possible that there are AS interfaces which do not have an EP!
-
- // EP Transfer buffers and FIFOs
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
-#if !CFG_TUD_AUDIO_ENABLE_DECODING
- tu_fifo_t ep_out_ff;
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
- uint32_t fb_val; // Feedback value for asynchronous mode (in 16.16 format).
-#endif
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
- tu_fifo_t ep_in_ff;
-#endif
-
- // Audio control interrupt buffer - no FIFO - 6 Bytes according to UAC 2 specification (p. 74)
-#if CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
- CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN uint8_t ep_int_ctr_buf[CFG_TUD_AUDIO_INT_CTR_EP_IN_SW_BUFFER_SIZE];
-#endif
-
- // Decoding parameters - parameters are set when alternate AS interface is set by host
- // Coding is currently only supported for EP. Software coding corresponding to AS interfaces without EPs are not supported currently.
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
- audio_format_type_t format_type_rx;
- uint8_t n_channels_rx;
-
-#if CFG_TUD_AUDIO_ENABLE_TYPE_I_DECODING
- audio_data_format_type_I_t format_type_I_rx;
- uint8_t n_bytes_per_sampe_rx;
- uint8_t n_channels_per_ff_rx;
- uint8_t n_ff_used_rx;
-#endif
-#endif
-
- // Encoding parameters - parameters are set when alternate AS interface is set by host
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
- audio_format_type_t format_type_tx;
- uint8_t n_channels_tx;
-
-#if CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING
- audio_data_format_type_I_t format_type_I_tx;
- uint8_t n_bytes_per_sampe_tx;
- uint8_t n_channels_per_ff_tx;
- uint8_t n_ff_used_tx;
-#endif
-#endif
-
- // Support FIFOs for software encoding and decoding
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
- tu_fifo_t * rx_supp_ff;
- uint8_t n_rx_supp_ff;
- uint16_t rx_supp_ff_sz_max;
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
- tu_fifo_t * tx_supp_ff;
- uint8_t n_tx_supp_ff;
- uint16_t tx_supp_ff_sz_max;
-#endif
-
- // Linear buffer in case target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer is available or driver is would need to be changed dramatically OR the support FIFOs are used
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_DECODING)
- uint8_t * lin_buf_out;
-#define USE_LINEAR_BUFFER_RX 1
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && (USE_LINEAR_BUFFER || CFG_TUD_AUDIO_ENABLE_ENCODING)
- uint8_t * lin_buf_in;
-#define USE_LINEAR_BUFFER_TX 1
-#endif
-
-} audiod_function_t;
-
-#ifndef USE_LINEAR_BUFFER_TX
-#define USE_LINEAR_BUFFER_TX 0
-#endif
-
-#ifndef USE_LINEAR_BUFFER_RX
-#define USE_LINEAR_BUFFER_RX 0
-#endif
-
-#define ITF_MEM_RESET_SIZE offsetof(audiod_function_t, ctrl_buf)
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-CFG_TUSB_MEM_SECTION audiod_function_t _audiod_fct[CFG_TUD_AUDIO];
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
-static bool audiod_rx_done_cb(uint8_t rhport, audiod_function_t* audio, uint16_t n_bytes_received);
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_DECODING && CFG_TUD_AUDIO_ENABLE_EP_OUT
-static bool audiod_decode_type_I_pcm(uint8_t rhport, audiod_function_t* audio, uint16_t n_bytes_received);
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN
-static bool audiod_tx_done_cb(uint8_t rhport, audiod_function_t* audio);
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_ENCODING && CFG_TUD_AUDIO_ENABLE_EP_IN
-static uint16_t audiod_encode_type_I_pcm(uint8_t rhport, audiod_function_t* audio);
-#endif
-
-static bool audiod_get_interface(uint8_t rhport, tusb_control_request_t const * p_request);
-static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const * p_request);
-
-static bool audiod_get_AS_interface_index_global(uint8_t itf, uint8_t *func_id, uint8_t *idxItf, uint8_t const **pp_desc_int);
-static bool audiod_get_AS_interface_index(uint8_t itf, audiod_function_t * audio, uint8_t *idxItf, uint8_t const **pp_desc_int);
-static bool audiod_verify_entity_exists(uint8_t itf, uint8_t entityID, uint8_t *func_id);
-static bool audiod_verify_itf_exists(uint8_t itf, uint8_t *func_id);
-static bool audiod_verify_ep_exists(uint8_t ep, uint8_t *func_id);
-static uint8_t audiod_get_audio_fct_idx(audiod_function_t * audio);
-
-#if CFG_TUD_AUDIO_ENABLE_ENCODING || CFG_TUD_AUDIO_ENABLE_DECODING
-static void audiod_parse_for_AS_params(audiod_function_t* audio, uint8_t const * p_desc, uint8_t const * p_desc_end, uint8_t const as_itf);
-
-static inline uint8_t tu_desc_subtype(void const* desc)
-{
- return ((uint8_t const*) desc)[2];
-}
-#endif
-
-bool tud_audio_n_mounted(uint8_t func_id)
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO);
- audiod_function_t* audio = &_audiod_fct[func_id];
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
- if (audio->ep_out == 0) return false;
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN
- if (audio->ep_in == 0) return false;
-#endif
-
-#if CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
- if (audio->ep_int_ctr == 0) return false;
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
- if (audio->ep_fb == 0) return false;
-#endif
-
- return true;
-}
-
-//--------------------------------------------------------------------+
-// READ API
-//--------------------------------------------------------------------+
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
-
-uint16_t tud_audio_n_available(uint8_t func_id)
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL);
- return tu_fifo_count(&_audiod_fct[func_id].ep_out_ff);
-}
-
-uint16_t tud_audio_n_read(uint8_t func_id, void* buffer, uint16_t bufsize)
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL);
- return tu_fifo_read_n(&_audiod_fct[func_id].ep_out_ff, buffer, bufsize);
-}
-
-bool tud_audio_n_clear_ep_out_ff(uint8_t func_id)
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL);
- return tu_fifo_clear(&_audiod_fct[func_id].ep_out_ff);
-}
-
-tu_fifo_t* tud_audio_n_get_ep_out_ff(uint8_t func_id)
-{
- if(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL) return &_audiod_fct[func_id].ep_out_ff;
- return NULL;
-}
-
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_DECODING && CFG_TUD_AUDIO_ENABLE_EP_OUT
-// Delete all content in the support RX FIFOs
-bool tud_audio_n_clear_rx_support_ff(uint8_t func_id, uint8_t ff_idx)
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_rx_supp_ff);
- return tu_fifo_clear(&_audiod_fct[func_id].rx_supp_ff[ff_idx]);
-}
-
-uint16_t tud_audio_n_available_support_ff(uint8_t func_id, uint8_t ff_idx)
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_rx_supp_ff);
- return tu_fifo_count(&_audiod_fct[func_id].rx_supp_ff[ff_idx]);
-}
-
-uint16_t tud_audio_n_read_support_ff(uint8_t func_id, uint8_t ff_idx, void* buffer, uint16_t bufsize)
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_rx_supp_ff);
- return tu_fifo_read_n(&_audiod_fct[func_id].rx_supp_ff[ff_idx], buffer, bufsize);
-}
-
-tu_fifo_t* tud_audio_n_get_rx_support_ff(uint8_t func_id, uint8_t ff_idx)
-{
- if(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_rx_supp_ff) return &_audiod_fct[func_id].rx_supp_ff[ff_idx];
- return NULL;
-}
-#endif
-
-// This function is called once an audio packet is received by the USB and is responsible for putting data from USB memory into EP_OUT_FIFO (or support FIFOs + decoding of received stream into audio channels).
-// If you prefer your own (more efficient) implementation suiting your purpose set CFG_TUD_AUDIO_ENABLE_DECODING = 0.
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
-
-static bool audiod_rx_done_cb(uint8_t rhport, audiod_function_t* audio, uint16_t n_bytes_received)
-{
- uint8_t idxItf;
- uint8_t const *dummy2;
- uint8_t idx_audio_fct = 0;
-
- if (tud_audio_rx_done_pre_read_cb || tud_audio_rx_done_post_read_cb)
- {
- idx_audio_fct = audiod_get_audio_fct_idx(audio);
- TU_VERIFY(audiod_get_AS_interface_index(audio->ep_out_as_intf_num, audio, &idxItf, &dummy2));
- }
-
- // Call a weak callback here - a possibility for user to get informed an audio packet was received and data gets now loaded into EP FIFO (or decoded into support RX software FIFO)
- if (tud_audio_rx_done_pre_read_cb) TU_VERIFY(tud_audio_rx_done_pre_read_cb(rhport, n_bytes_received, idx_audio_fct, audio->ep_out, audio->alt_setting[idxItf]));
-
-#if CFG_TUD_AUDIO_ENABLE_DECODING && CFG_TUD_AUDIO_ENABLE_EP_OUT
-
- switch (audio->format_type_rx)
- {
- case AUDIO_FORMAT_TYPE_UNDEFINED:
- // INDIVIDUAL DECODING PROCEDURE REQUIRED HERE!
- TU_LOG2(" Desired CFG_TUD_AUDIO_FORMAT encoding not implemented!\r\n");
- TU_BREAKPOINT();
- break;
-
- case AUDIO_FORMAT_TYPE_I:
-
- switch (audio->format_type_I_tx)
- {
- case AUDIO_DATA_FORMAT_TYPE_I_PCM:
- TU_VERIFY(audiod_decode_type_I_pcm(rhport, audio, n_bytes_received));
- break;
-
- default:
- // DESIRED CFG_TUD_AUDIO_FORMAT_TYPE_I_RX NOT IMPLEMENTED!
- TU_LOG2(" Desired CFG_TUD_AUDIO_FORMAT_TYPE_I_RX encoding not implemented!\r\n");
- TU_BREAKPOINT();
- break;
- }
- break;
-
- default:
- // Desired CFG_TUD_AUDIO_FORMAT_TYPE_RX not implemented!
- TU_LOG2(" Desired CFG_TUD_AUDIO_FORMAT_TYPE_RX not implemented!\r\n");
- TU_BREAKPOINT();
- break;
- }
-
- // Prepare for next transmission
- TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_out, audio->lin_buf_out, audio->ep_out_sz), false);
-
-#else
-
-#if USE_LINEAR_BUFFER_RX
- // Data currently is in linear buffer, copy into EP OUT FIFO
- TU_VERIFY(tu_fifo_write_n(&audio->ep_out_ff, audio->lin_buf_out, n_bytes_received));
-
- // Schedule for next receive
- TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_out, audio->lin_buf_out, audio->ep_out_sz), false);
-#else
- // Data is already placed in EP FIFO, schedule for next receive
- TU_VERIFY(usbd_edpt_xfer_fifo(rhport, audio->ep_out, &audio->ep_out_ff, audio->ep_out_sz), false);
-#endif
-
-#endif
-
- // Call a weak callback here - a possibility for user to get informed decoding was completed
- if (tud_audio_rx_done_post_read_cb) TU_VERIFY(tud_audio_rx_done_post_read_cb(rhport, n_bytes_received, idx_audio_fct, audio->ep_out, audio->alt_setting[idxItf]));
-
- return true;
-}
-
-#endif //CFG_TUD_AUDIO_ENABLE_EP_OUT
-
-// The following functions are used in case CFG_TUD_AUDIO_ENABLE_DECODING != 0
-#if CFG_TUD_AUDIO_ENABLE_DECODING && CFG_TUD_AUDIO_ENABLE_EP_OUT
-
-// Decoding according to 2.3.1.5 Audio Streams
-
-// Helper function
-static inline uint8_t * audiod_interleaved_copy_bytes_fast_decode(uint16_t const nBytesToCopy, void * dst, uint8_t * dst_end, uint8_t * src, uint8_t const n_ff_used)
-{
-
- // This function is an optimized version of
- // while((uint8_t *)dst < dst_end)
- // {
- // memcpy(dst, src, nBytesToCopy);
- // dst = (uint8_t *)dst + nBytesToCopy;
- // src += nBytesToCopy * n_ff_used;
- // }
-
- // Optimize for fast half word copies
- typedef struct{
- uint16_t val;
- } __attribute((__packed__)) unaligned_uint16_t;
-
- // Optimize for fast word copies
- typedef struct{
- uint32_t val;
- } __attribute((__packed__)) unaligned_uint32_t;
-
- switch (nBytesToCopy)
- {
- case 1:
- while((uint8_t *)dst < dst_end)
- {
- *(uint8_t *)dst++ = *src;
- src += n_ff_used;
- }
- break;
-
- case 2:
- while((uint8_t *)dst < dst_end)
- {
- *(unaligned_uint16_t*)dst = *(unaligned_uint16_t*)src;
- dst += 2;
- src += 2 * n_ff_used;
- }
- break;
-
- case 3:
- while((uint8_t *)dst < dst_end)
- {
- // memcpy(dst, src, 3);
- // dst = (uint8_t *)dst + 3;
- // src += 3 * n_ff_used;
-
- // TODO: Is there a faster way to copy 3 bytes?
- *(uint8_t *)dst++ = *src++;
- *(uint8_t *)dst++ = *src++;
- *(uint8_t *)dst++ = *src++;
-
- src += 3 * (n_ff_used - 1);
- }
- break;
-
- case 4:
- while((uint8_t *)dst < dst_end)
- {
- *(unaligned_uint32_t*)dst = *(unaligned_uint32_t*)src;
- dst += 4;
- src += 4 * n_ff_used;
- }
- break;
- }
-
- return src;
-}
-
-static bool audiod_decode_type_I_pcm(uint8_t rhport, audiod_function_t* audio, uint16_t n_bytes_received)
-{
- (void) rhport;
-
- // Determine amount of samples
- uint8_t const n_ff_used = audio->n_ff_used_rx;
- uint16_t const nBytesPerFFToRead = n_bytes_received / n_ff_used;
- uint8_t cnt_ff;
-
- // Decode
- uint8_t * src;
- uint8_t * dst_end;
-
- tu_fifo_buffer_info_t info;
-
- for (cnt_ff = 0; cnt_ff < n_ff_used; cnt_ff++)
- {
- tu_fifo_get_write_info(&audio->rx_supp_ff[cnt_ff], &info);
-
- if (info.len_lin != 0)
- {
- info.len_lin = tu_min16(nBytesPerFFToRead, info.len_lin);
- src = &audio->lin_buf_out[cnt_ff*audio->n_channels_per_ff_rx * audio->n_bytes_per_sampe_rx];
- dst_end = info.ptr_lin + info.len_lin;
- src = audiod_interleaved_copy_bytes_fast_decode(audio->n_bytes_per_sampe_rx, info.ptr_lin, dst_end, src, n_ff_used);
-
- // Handle wrapped part of FIFO
- info.len_wrap = tu_min16(nBytesPerFFToRead - info.len_lin, info.len_wrap);
- if (info.len_wrap != 0)
- {
- dst_end = info.ptr_wrap + info.len_wrap;
- audiod_interleaved_copy_bytes_fast_decode(audio->n_bytes_per_sampe_rx, info.ptr_wrap, dst_end, src, n_ff_used);
- }
- tu_fifo_advance_write_pointer(&audio->rx_supp_ff[cnt_ff], info.len_lin + info.len_wrap);
- }
- }
-
- // Number of bytes should be a multiple of CFG_TUD_AUDIO_N_BYTES_PER_SAMPLE_RX * CFG_TUD_AUDIO_N_CHANNELS_RX but checking makes no sense - no way to correct it
- // TU_VERIFY(cnt != n_bytes);
-
- return true;
-}
-#endif //CFG_TUD_AUDIO_ENABLE_DECODING
-
-//--------------------------------------------------------------------+
-// WRITE API
-//--------------------------------------------------------------------+
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
-
-/**
- * \brief Write data to EP in buffer
- *
- * Write data to buffer. If it is full, new data can be inserted once a transmit was scheduled. See audiod_tx_done_cb().
- * If TX FIFOs are used, this function is not available in order to not let the user mess up the encoding process.
- *
- * \param[in] func_id: Index of audio function interface
- * \param[in] data: Pointer to data array to be copied from
- * \param[in] len: # of array elements to copy
- * \return Number of bytes actually written
- */
-uint16_t tud_audio_n_write(uint8_t func_id, const void * data, uint16_t len)
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL);
- return tu_fifo_write_n(&_audiod_fct[func_id].ep_in_ff, data, len);
-}
-
-bool tud_audio_n_clear_ep_in_ff(uint8_t func_id) // Delete all content in the EP IN FIFO
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL);
- return tu_fifo_clear(&_audiod_fct[func_id].ep_in_ff);
-}
-
-tu_fifo_t* tud_audio_n_get_ep_in_ff(uint8_t func_id)
-{
- if(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL) return &_audiod_fct[func_id].ep_in_ff;
- return NULL;
-}
-
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_ENCODING && CFG_TUD_AUDIO_ENABLE_EP_IN
-
-uint16_t tud_audio_n_flush_tx_support_ff(uint8_t func_id) // Force all content in the support TX FIFOs to be written into linear buffer and schedule a transmit
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL);
- audiod_function_t* audio = &_audiod_fct[func_id];
-
- uint16_t n_bytes_copied = tu_fifo_count(&audio->tx_supp_ff[0]);
-
- TU_VERIFY(audiod_tx_done_cb(audio->rhport, audio));
-
- n_bytes_copied -= tu_fifo_count(&audio->tx_supp_ff[0]);
- n_bytes_copied = n_bytes_copied*audio->tx_supp_ff[0].item_size;
-
- return n_bytes_copied;
-}
-
-bool tud_audio_n_clear_tx_support_ff(uint8_t func_id, uint8_t ff_idx)
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_tx_supp_ff);
- return tu_fifo_clear(&_audiod_fct[func_id].tx_supp_ff[ff_idx]);
-}
-
-uint16_t tud_audio_n_write_support_ff(uint8_t func_id, uint8_t ff_idx, const void * data, uint16_t len)
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_tx_supp_ff);
- return tu_fifo_write_n(&_audiod_fct[func_id].tx_supp_ff[ff_idx], data, len);
-}
-
-tu_fifo_t* tud_audio_n_get_tx_support_ff(uint8_t func_id, uint8_t ff_idx)
-{
- if(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL && ff_idx < _audiod_fct[func_id].n_tx_supp_ff) return &_audiod_fct[func_id].tx_supp_ff[ff_idx];
- return NULL;
-}
-
-#endif
-
-
-#if CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
-
-// If no interrupt transmit is pending bytes get written into buffer and a transmit is scheduled - once transmit completed tud_audio_int_ctr_done_cb() is called in inform user
-uint16_t tud_audio_int_ctr_n_write(uint8_t func_id, uint8_t const* buffer, uint16_t len)
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL);
-
- // We write directly into the EP's buffer - abort if previous transfer not complete
- TU_VERIFY(!usbd_edpt_busy(_audiod_fct[func_id].rhport, _audiod_fct[func_id].ep_int_ctr));
-
- // Check length
- TU_VERIFY(len <= CFG_TUD_AUDIO_INT_CTR_EP_IN_SW_BUFFER_SIZE);
-
- memcpy(_audiod_fct[func_id].ep_int_ctr_buf, buffer, len);
-
- // Schedule transmit
- TU_VERIFY(usbd_edpt_xfer(_audiod_fct[func_id].rhport, _audiod_fct[func_id].ep_int_ctr, _audiod_fct[func_id].ep_int_ctr_buf, len));
-
- return true;
-}
-
-#endif
-
-
-// This function is called once a transmit of an audio packet was successfully completed. Here, we encode samples and place it in IN EP's buffer for next transmission.
-// If you prefer your own (more efficient) implementation suiting your purpose set CFG_TUD_AUDIO_ENABLE_ENCODING = 0 and use tud_audio_n_write.
-
-// n_bytes_copied - Informs caller how many bytes were loaded. In case n_bytes_copied = 0, a ZLP is scheduled to inform host no data is available for current frame.
-#if CFG_TUD_AUDIO_ENABLE_EP_IN
-static bool audiod_tx_done_cb(uint8_t rhport, audiod_function_t * audio)
-{
- uint8_t idxItf;
- uint8_t const *dummy2;
-
- uint8_t idx_audio_fct = audiod_get_audio_fct_idx(audio);
- TU_VERIFY(audiod_get_AS_interface_index(audio->ep_in_as_intf_num, audio, &idxItf, &dummy2));
-
- // Only send something if current alternate interface is not 0 as in this case nothing is to be sent due to UAC2 specifications
- if (audio->alt_setting[idxItf] == 0) return false;
-
- // Call a weak callback here - a possibility for user to get informed former TX was completed and data gets now loaded into EP in buffer (in case FIFOs are used) or
- // if no FIFOs are used the user may use this call back to load its data into the EP IN buffer by use of tud_audio_n_write_ep_in_buffer().
- if (tud_audio_tx_done_pre_load_cb) TU_VERIFY(tud_audio_tx_done_pre_load_cb(rhport, idx_audio_fct, audio->ep_in, audio->alt_setting[idxItf]));
-
- // Send everything in ISO EP FIFO
- uint16_t n_bytes_tx;
-
- // If support FIFOs are used, encode and schedule transmit
-#if CFG_TUD_AUDIO_ENABLE_ENCODING && CFG_TUD_AUDIO_ENABLE_EP_IN
- switch (audio->format_type_tx)
- {
- case AUDIO_FORMAT_TYPE_UNDEFINED:
- // INDIVIDUAL ENCODING PROCEDURE REQUIRED HERE!
- TU_LOG2(" Desired CFG_TUD_AUDIO_FORMAT encoding not implemented!\r\n");
- TU_BREAKPOINT();
- n_bytes_tx = 0;
- break;
-
- case AUDIO_FORMAT_TYPE_I:
-
- switch (audio->format_type_I_tx)
- {
- case AUDIO_DATA_FORMAT_TYPE_I_PCM:
-
- n_bytes_tx = audiod_encode_type_I_pcm(rhport, audio);
- break;
-
- default:
- // YOUR ENCODING IS REQUIRED HERE!
- TU_LOG2(" Desired CFG_TUD_AUDIO_FORMAT_TYPE_I_TX encoding not implemented!\r\n");
- TU_BREAKPOINT();
- n_bytes_tx = 0;
- break;
- }
- break;
-
- default:
- // Desired CFG_TUD_AUDIO_FORMAT_TYPE_TX not implemented!
- TU_LOG2(" Desired CFG_TUD_AUDIO_FORMAT_TYPE_TX not implemented!\r\n");
- TU_BREAKPOINT();
- n_bytes_tx = 0;
- break;
- }
-
- TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_in, audio->lin_buf_in, n_bytes_tx));
-
-#else
- // No support FIFOs, if no linear buffer required schedule transmit, else put data into linear buffer and schedule
-
- n_bytes_tx = tu_min16(tu_fifo_count(&audio->ep_in_ff), audio->ep_in_sz); // Limit up to max packet size, more can not be done for ISO
-
-#if USE_LINEAR_BUFFER_TX
- tu_fifo_read_n(&audio->ep_in_ff, audio->lin_buf_in, n_bytes_tx);
- TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_in, audio->lin_buf_in, n_bytes_tx));
-#else
- // Send everything in ISO EP FIFO
- TU_VERIFY(usbd_edpt_xfer_fifo(rhport, audio->ep_in, &audio->ep_in_ff, n_bytes_tx));
-#endif
-
-#endif
-
- // Call a weak callback here - a possibility for user to get informed former TX was completed and how many bytes were loaded for the next frame
- if (tud_audio_tx_done_post_load_cb) TU_VERIFY(tud_audio_tx_done_post_load_cb(rhport, n_bytes_tx, idx_audio_fct, audio->ep_in, audio->alt_setting[idxItf]));
-
- return true;
-}
-
-#endif //CFG_TUD_AUDIO_ENABLE_EP_IN
-
-#if CFG_TUD_AUDIO_ENABLE_ENCODING && CFG_TUD_AUDIO_ENABLE_EP_IN
-// Take samples from the support buffer and encode them into the IN EP software FIFO
-// Returns number of bytes written into linear buffer
-
-/* 2.3.1.7.1 PCM Format
-The PCM (Pulse Coded Modulation) format is the most commonly used audio format to represent audio
-data streams. The audio data is not compressed and uses a signed two’s-complement fixed point format. It
-is left-justified (the sign bit is the Msb) and data is padded with trailing zeros to fill the remaining unused
-bits of the subslot. The binary point is located to the right of the sign bit so that all values lie within the
-range [-1, +1)
- */
-
-/*
- * This function encodes channels saved within the support FIFOs into one stream by interleaving the PCM samples
- * in the support FIFOs according to 2.3.1.5 Audio Streams. It does not control justification (left or right) and
- * does not change the number of bytes per sample.
- * */
-
-// Helper function
-static inline uint8_t * audiod_interleaved_copy_bytes_fast_encode(uint16_t const nBytesToCopy, uint8_t * src, uint8_t * src_end, uint8_t * dst, uint8_t const n_ff_used)
-{
- // Optimize for fast half word copies
- typedef struct{
- uint16_t val;
- } __attribute((__packed__)) unaligned_uint16_t;
-
- // Optimize for fast word copies
- typedef struct{
- uint32_t val;
- } __attribute((__packed__)) unaligned_uint32_t;
-
- switch (nBytesToCopy)
- {
- case 1:
- while(src < src_end)
- {
- *dst = *src++;
- dst += n_ff_used;
- }
- break;
-
- case 2:
- while(src < src_end)
- {
- *(unaligned_uint16_t*)dst = *(unaligned_uint16_t*)src;
- src += 2;
- dst += 2 * n_ff_used;
- }
- break;
-
- case 3:
- while(src < src_end)
- {
- // memcpy(dst, src, 3);
- // src = (uint8_t *)src + 3;
- // dst += 3 * n_ff_used;
-
- // TODO: Is there a faster way to copy 3 bytes?
- *dst++ = *src++;
- *dst++ = *src++;
- *dst++ = *src++;
-
- dst += 3 * (n_ff_used - 1);
- }
- break;
-
- case 4:
- while(src < src_end)
- {
- *(unaligned_uint32_t*)dst = *(unaligned_uint32_t*)src;
- src += 4;
- dst += 4 * n_ff_used;
- }
- break;
- }
-
- return dst;
-}
-
-static uint16_t audiod_encode_type_I_pcm(uint8_t rhport, audiod_function_t* audio)
-{
- // This function relies on the fact that the length of the support FIFOs was configured to be a multiple of the active sample size in bytes s.t. no sample is split within a wrap
- // This is ensured within set_interface, where the FIFOs are reconfigured according to this size
-
- // We encode directly into IN EP's linear buffer - abort if previous transfer not complete
- TU_VERIFY(!usbd_edpt_busy(rhport, audio->ep_in));
-
- // Determine amount of samples
- uint8_t const n_ff_used = audio->n_ff_used_tx;
- uint16_t const nBytesToCopy = audio->n_channels_per_ff_tx * audio->n_bytes_per_sampe_tx;
- uint16_t const capPerFF = audio->ep_in_sz / n_ff_used; // Sample capacity per FIFO in bytes
- uint16_t nBytesPerFFToSend = tu_fifo_count(&audio->tx_supp_ff[0]);
- uint8_t cnt_ff;
-
- for (cnt_ff = 1; cnt_ff < n_ff_used; cnt_ff++)
- {
- uint16_t const count = tu_fifo_count(&audio->tx_supp_ff[cnt_ff]);
- if (count < nBytesPerFFToSend)
- {
- nBytesPerFFToSend = count;
- }
- }
-
- // Check if there is enough
- if (nBytesPerFFToSend == 0) return 0;
-
- // Limit to maximum sample number - THIS IS A POSSIBLE ERROR SOURCE IF TOO MANY SAMPLE WOULD NEED TO BE SENT BUT CAN NOT!
- nBytesPerFFToSend = tu_min16(nBytesPerFFToSend, capPerFF);
-
- // Round to full number of samples (flooring)
- nBytesPerFFToSend = (nBytesPerFFToSend / nBytesToCopy) * nBytesToCopy;
-
- // Encode
- uint8_t * dst;
- uint8_t * src_end;
-
- tu_fifo_buffer_info_t info;
-
- for (cnt_ff = 0; cnt_ff < n_ff_used; cnt_ff++)
- {
- dst = &audio->lin_buf_in[cnt_ff*audio->n_channels_per_ff_tx*audio->n_bytes_per_sampe_tx];
-
- tu_fifo_get_read_info(&audio->tx_supp_ff[cnt_ff], &info);
-
- if (info.len_lin != 0)
- {
- info.len_lin = tu_min16(nBytesPerFFToSend, info.len_lin); // Limit up to desired length
- src_end = (uint8_t *)info.ptr_lin + info.len_lin;
- dst = audiod_interleaved_copy_bytes_fast_encode(audio->n_bytes_per_sampe_tx, info.ptr_lin, src_end, dst, n_ff_used);
-
- // Limit up to desired length
- info.len_wrap = tu_min16(nBytesPerFFToSend - info.len_lin, info.len_wrap);
-
- // Handle wrapped part of FIFO
- if (info.len_wrap != 0)
- {
- src_end = (uint8_t *)info.ptr_wrap + info.len_wrap;
- audiod_interleaved_copy_bytes_fast_encode(audio->n_bytes_per_sampe_tx, info.ptr_wrap, src_end, dst, n_ff_used);
- }
-
- tu_fifo_advance_read_pointer(&audio->tx_supp_ff[cnt_ff], info.len_lin + info.len_wrap);
- }
- }
-
- return nBytesPerFFToSend * n_ff_used;
-}
-#endif //CFG_TUD_AUDIO_ENABLE_ENCODING
-
-// This function is called once a transmit of a feedback packet was successfully completed. Here, we get the next feedback value to be sent
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
-static inline bool audiod_fb_send(uint8_t rhport, audiod_function_t *audio)
-{
- return usbd_edpt_xfer(rhport, audio->ep_fb, (uint8_t *) &audio->fb_val, 4);
-}
-#endif
-
-//--------------------------------------------------------------------+
-// USBD Driver API
-//--------------------------------------------------------------------+
-void audiod_init(void)
-{
- tu_memclr(_audiod_fct, sizeof(_audiod_fct));
-
- for(uint8_t i=0; i<CFG_TUD_AUDIO; i++)
- {
- audiod_function_t* audio = &_audiod_fct[i];
-
- // Initialize control buffers
- switch (i)
- {
- case 0:
- audio->ctrl_buf = ctrl_buf_1;
- audio->ctrl_buf_sz = CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ;
- break;
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_CTRL_BUF_SZ > 0
- case 1:
- audio->ctrl_buf = ctrl_buf_2;
- audio->ctrl_buf_sz = CFG_TUD_AUDIO_FUNC_2_CTRL_BUF_SZ;
- break;
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_CTRL_BUF_SZ > 0
- case 2:
- audio->ctrl_buf = ctrl_buf_3;
- audio->ctrl_buf_sz = CFG_TUD_AUDIO_FUNC_3_CTRL_BUF_SZ;
- break;
-#endif
- }
-
- // Initialize active alternate interface buffers
- switch (i)
- {
-#if CFG_TUD_AUDIO_FUNC_1_N_AS_INT > 0
- case 0:
- audio->alt_setting = alt_setting_1;
- break;
-#endif
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_N_AS_INT > 0
- case 1:
- audio->alt_setting = alt_setting_2;
- break;
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_N_AS_INT > 0
- case 2:
- audio->alt_setting = alt_setting_3;
- break;
-#endif
- }
-
- // Initialize IN EP FIFO if required
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
-
- switch (i)
- {
-#if CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ > 0
- case 0:
- tu_fifo_config(&audio->ep_in_ff, audio_ep_in_sw_buf_1, CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ, 1, true);
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&audio->ep_in_ff, osal_mutex_create(&ep_in_ff_mutex_wr_1), NULL);
-#endif
- break;
-#endif
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ > 0
- case 1:
- tu_fifo_config(&audio->ep_in_ff, audio_ep_in_sw_buf_2, CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ, 1, true);
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&audio->ep_in_ff, osal_mutex_create(&ep_in_ff_mutex_wr_2), NULL);
-#endif
- break;
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ > 0
- case 2:
- tu_fifo_config(&audio->ep_in_ff, audio_ep_in_sw_buf_3, CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ, 1, true);
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&audio->ep_in_ff, osal_mutex_create(&ep_in_ff_mutex_wr_3), NULL);
-#endif
- break;
-#endif
- }
-#endif // CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
-
- // Initialize linear buffers
-#if USE_LINEAR_BUFFER_TX
- switch (i)
- {
-#if CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX > 0
- case 0:
- audio->lin_buf_in = lin_buf_in_1;
- break;
-#endif
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_IN_SZ_MAX > 0
- case 1:
- audio->lin_buf_in = lin_buf_in_2;
- break;
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_IN_SZ_MAX > 0
- case 2:
- audio->lin_buf_in = lin_buf_in_3;
- break;
-#endif
- }
-#endif // USE_LINEAR_BUFFER_TX
-
- // Initialize OUT EP FIFO if required
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
-
- switch (i)
- {
-#if CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ > 0
- case 0:
- tu_fifo_config(&audio->ep_out_ff, audio_ep_out_sw_buf_1, CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ, 1, true);
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&audio->ep_out_ff, NULL, osal_mutex_create(&ep_out_ff_mutex_rd_1));
-#endif
- break;
-#endif
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ > 0
- case 1:
- tu_fifo_config(&audio->ep_out_ff, audio_ep_out_sw_buf_2, CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ, 1, true);
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&audio->ep_out_ff, NULL, osal_mutex_create(&ep_out_ff_mutex_rd_2));
-#endif
- break;
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ > 0
- case 2:
- tu_fifo_config(&audio->ep_out_ff, audio_ep_out_sw_buf_3, CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ, 1, true);
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&audio->ep_out_ff, NULL, osal_mutex_create(&ep_out_ff_mutex_rd_3));
-#endif
- break;
-#endif
- }
-#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
-
- // Initialize linear buffers
-#if USE_LINEAR_BUFFER_RX
- switch (i)
- {
-#if CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX > 0
- case 0:
- audio->lin_buf_out = lin_buf_out_1;
- break;
-#endif
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_EP_OUT_SZ_MAX > 0
- case 1:
- audio->lin_buf_out = lin_buf_out_2;
- break;
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_EP_OUT_SZ_MAX > 0
- case 2:
- audio->lin_buf_out = lin_buf_out_3;
- break;
-#endif
- }
-#endif // USE_LINEAR_BUFFER_TX
-
- // Initialize TX support FIFOs if required
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
-
- switch (i)
- {
-#if CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ > 0
- case 0:
- audio->tx_supp_ff = tx_supp_ff_1;
- audio->n_tx_supp_ff = CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO;
- audio->tx_supp_ff_sz_max = CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ;
- for (uint8_t cnt = 0; cnt < CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO; cnt++)
- {
- tu_fifo_config(&tx_supp_ff_1[cnt], tx_supp_ff_buf_1[cnt], CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ, 1, true);
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&tx_supp_ff_1[cnt], osal_mutex_create(&tx_supp_ff_mutex_wr_1[cnt]), NULL);
-#endif
- }
-
- break;
-#endif // CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ > 0
-
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ > 0
- case 1:
- audio->tx_supp_ff = tx_supp_ff_2;
- audio->n_tx_supp_ff = CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO;
- audio->tx_supp_ff_sz_max = CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ;
- for (uint8_t cnt = 0; cnt < CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO; cnt++)
- {
- tu_fifo_config(&tx_supp_ff_2[cnt], tx_supp_ff_buf_2[cnt], CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ, 1, true);
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&tx_supp_ff_2[cnt], osal_mutex_create(&tx_supp_ff_mutex_wr_2[cnt]), NULL);
-#endif
- }
-
- break;
-#endif // CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ > 0
-
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_TX_SUPP_SW_FIFO_SZ > 0
- case 2:
- audio->tx_supp_ff = tx_supp_ff_3;
- audio->n_tx_supp_ff = CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO;
- audio->tx_supp_ff_sz_max = CFG_TUD_AUDIO_FUNC_3_TX_SUPP_SW_FIFO_SZ;
- for (uint8_t cnt = 0; cnt < CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO; cnt++)
- {
- tu_fifo_config(&tx_supp_ff_3[cnt], tx_supp_ff_buf_3[cnt], CFG_TUD_AUDIO_FUNC_3_TX_SUPP_SW_FIFO_SZ, 1, true);
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&tx_supp_ff_3[cnt], osal_mutex_create(&tx_supp_ff_mutex_wr_3[cnt]), NULL);
-#endif
- }
-
- break;
-#endif // CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ > 0
- }
-#endif // CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
-
- // Set encoding parameters for Type_I formats
-#if CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING
- switch (i)
- {
-#if CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ > 0
- case 0:
- audio->n_channels_per_ff_tx = CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX;
- break;
-#endif
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ > 0
- case 1:
- audio->n_channels_per_ff_tx = CFG_TUD_AUDIO_FUNC_2_CHANNEL_PER_FIFO_TX;
- break;
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_TX_SUPP_SW_FIFO_SZ > 0
- case 2:
- audio->n_channels_per_ff_tx = CFG_TUD_AUDIO_FUNC_3_CHANNEL_PER_FIFO_TX;
- break;
-#endif
- }
-#endif // CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING
-
- // Initialize RX support FIFOs if required
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
-
- switch (i)
- {
-#if CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ > 0
- case 0:
- audio->rx_supp_ff = rx_supp_ff_1;
- audio->n_rx_supp_ff = CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO;
- audio->rx_supp_ff_sz_max = CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ;
- for (uint8_t cnt = 0; cnt < CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO; cnt++)
- {
- tu_fifo_config(&rx_supp_ff_1[cnt], rx_supp_ff_buf_1[cnt], CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ, 1, true);
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&rx_supp_ff_1[cnt], osal_mutex_create(&rx_supp_ff_mutex_rd_1[cnt]), NULL);
-#endif
- }
-
- break;
-#endif // CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ > 0
-
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ > 0
- case 1:
- audio->rx_supp_ff = rx_supp_ff_2;
- audio->n_rx_supp_ff = CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO;
- audio->rx_supp_ff_sz_max = CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ;
- for (uint8_t cnt = 0; cnt < CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO; cnt++)
- {
- tu_fifo_config(&rx_supp_ff_2[cnt], rx_supp_ff_buf_2[cnt], CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ, 1, true);
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&rx_supp_ff_2[cnt], osal_mutex_create(&rx_supp_ff_mutex_rd_2[cnt]), NULL);
-#endif
- }
-
- break;
-#endif // CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ > 0
-
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_RX_SUPP_SW_FIFO_SZ > 0
- case 2:
- audio->rx_supp_ff = rx_supp_ff_3;
- audio->n_rx_supp_ff = CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO;
- audio->rx_supp_ff_sz_max = CFG_TUD_AUDIO_FUNC_3_RX_SUPP_SW_FIFO_SZ;
- for (uint8_t cnt = 0; cnt < CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO; cnt++)
- {
- tu_fifo_config(&rx_supp_ff_3[cnt], rx_supp_ff_buf_3[cnt], CFG_TUD_AUDIO_FUNC_3_RX_SUPP_SW_FIFO_SZ, 1, true);
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&rx_supp_ff_3[cnt], osal_mutex_create(&rx_supp_ff_mutex_rd_3[cnt]), NULL);
-#endif
- }
-
- break;
-#endif // CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ > 0
- }
-#endif // CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
-
- // Set encoding parameters for Type_I formats
-#if CFG_TUD_AUDIO_ENABLE_TYPE_I_DECODING
- switch (i)
- {
-#if CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ > 0
- case 0:
- audio->n_channels_per_ff_rx = CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_RX;
- break;
-#endif
-#if CFG_TUD_AUDIO > 1 && CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ > 0
- case 1:
- audio->n_channels_per_ff_rx = CFG_TUD_AUDIO_FUNC_2_CHANNEL_PER_FIFO_RX;
- break;
-#endif
-#if CFG_TUD_AUDIO > 2 && CFG_TUD_AUDIO_FUNC_3_RX_SUPP_SW_FIFO_SZ > 0
- case 2:
- audio->n_channels_per_ff_rx = CFG_TUD_AUDIO_FUNC_3_CHANNEL_PER_FIFO_RX;
- break;
-#endif
- }
-#endif // CFG_TUD_AUDIO_ENABLE_TYPE_I_DECODING
- }
-}
-
-void audiod_reset(uint8_t rhport)
-{
- (void) rhport;
-
- for(uint8_t i=0; i<CFG_TUD_AUDIO; i++)
- {
- audiod_function_t* audio = &_audiod_fct[i];
- tu_memclr(audio, ITF_MEM_RESET_SIZE);
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
- tu_fifo_clear(&audio->ep_in_ff);
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
- tu_fifo_clear(&audio->ep_out_ff);
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
- for (uint8_t cnt = 0; cnt < audio->n_tx_supp_ff; cnt++)
- {
- tu_fifo_clear(&audio->tx_supp_ff[cnt]);
- }
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
- for (uint8_t cnt = 0; cnt < audio->n_rx_supp_ff; cnt++)
- {
- tu_fifo_clear(&audio->rx_supp_ff[cnt]);
- }
-#endif
- }
-}
-
-uint16_t audiod_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len)
-{
- (void) max_len;
-
- TU_VERIFY ( TUSB_CLASS_AUDIO == itf_desc->bInterfaceClass &&
- AUDIO_SUBCLASS_CONTROL == itf_desc->bInterfaceSubClass);
-
- // Verify version is correct - this check can be omitted
- TU_VERIFY(itf_desc->bInterfaceProtocol == AUDIO_INT_PROTOCOL_CODE_V2);
-
- // Verify interrupt control EP is enabled if demanded by descriptor - this should be best some static check however - this check can be omitted
- if (itf_desc->bNumEndpoints == 1) // 0 or 1 EPs are allowed
- {
- TU_VERIFY(CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN > 0);
- }
-
- // Alternate setting MUST be zero - this check can be omitted
- TU_VERIFY(itf_desc->bAlternateSetting == 0);
-
- // Find available audio driver interface
- uint8_t i;
- for (i = 0; i < CFG_TUD_AUDIO; i++)
- {
- if (!_audiod_fct[i].p_desc)
- {
- _audiod_fct[i].p_desc = (uint8_t const *)itf_desc; // Save pointer to AC descriptor which is by specification always the first one
- _audiod_fct[i].rhport = rhport;
-
- // Setup descriptor lengths
- switch (i)
- {
- case 0:
- _audiod_fct[i].desc_length = CFG_TUD_AUDIO_FUNC_1_DESC_LEN;
- break;
-#if CFG_TUD_AUDIO > 1
- case 1:
- _audiod_fct[i].desc_length = CFG_TUD_AUDIO_FUNC_2_DESC_LEN;
- break;
-#endif
-#if CFG_TUD_AUDIO > 2
- case 2:
- _audiod_fct[i].desc_length = CFG_TUD_AUDIO_FUNC_3_DESC_LEN;
- break;
-#endif
- }
-
- break;
- }
- }
-
- // Verify we found a free one
- TU_ASSERT( i < CFG_TUD_AUDIO );
-
- // This is all we need so far - the EPs are setup by a later set_interface request (as per UAC2 specification)
- uint16_t drv_len = _audiod_fct[i].desc_length - TUD_AUDIO_DESC_IAD_LEN; // - TUD_AUDIO_DESC_IAD_LEN since tinyUSB already handles the IAD descriptor
-
- return drv_len;
-}
-
-static bool audiod_get_interface(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- uint8_t const itf = tu_u16_low(p_request->wIndex);
-
- // Find index of audio streaming interface
- uint8_t func_id, idxItf;
- uint8_t const *dummy;
-
- TU_VERIFY(audiod_get_AS_interface_index_global(itf, &func_id, &idxItf, &dummy));
- TU_VERIFY(tud_control_xfer(rhport, p_request, &_audiod_fct[func_id].alt_setting[idxItf], 1));
-
- TU_LOG2(" Get itf: %u - current alt: %u\r\n", itf, _audiod_fct[func_id].alt_setting[idxItf]);
-
- return true;
-}
-
-static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- (void) rhport;
-
- // Here we need to do the following:
-
- // 1. Find the audio driver assigned to the given interface to be set
- // Since one audio driver interface has to be able to cover an unknown number of interfaces (AC, AS + its alternate settings), the best memory efficient way to solve this is to always search through the descriptors.
- // The audio driver is mapped to an audio function by a reference pointer to the corresponding AC interface of this audio function which serves as a starting point for searching
-
- // 2. Close EPs which are currently open
- // To do so it is not necessary to know the current active alternate interface since we already save the current EP addresses - we simply close them
-
- // 3. Open new EP
-
- uint8_t const itf = tu_u16_low(p_request->wIndex);
- uint8_t const alt = tu_u16_low(p_request->wValue);
-
- TU_LOG2(" Set itf: %u - alt: %u\r\n", itf, alt);
-
- // Find index of audio streaming interface and index of interface
- uint8_t func_id, idxItf;
- uint8_t const *p_desc;
- TU_VERIFY(audiod_get_AS_interface_index_global(itf, &func_id, &idxItf, &p_desc));
-
- audiod_function_t* audio = &_audiod_fct[func_id];
-
- // Look if there is an EP to be closed - for this driver, there are only 3 possible EPs which may be closed (only AS related EPs can be closed, AC EP (if present) is always open)
-#if CFG_TUD_AUDIO_ENABLE_EP_IN
- if (audio->ep_in_as_intf_num == itf)
- {
- audio->ep_in_as_intf_num = 0;
- usbd_edpt_close(rhport, audio->ep_in);
-
- // Clear FIFOs, since data is no longer valid
-#if !CFG_TUD_AUDIO_ENABLE_ENCODING
- tu_fifo_clear(&audio->ep_in_ff);
-#else
- for (uint8_t cnt = 0; cnt < audio->n_tx_supp_ff; cnt++)
- {
- tu_fifo_clear(&audio->tx_supp_ff[cnt]);
- }
-#endif
-
- // Invoke callback - can be used to stop data sampling
- if (tud_audio_set_itf_close_EP_cb) TU_VERIFY(tud_audio_set_itf_close_EP_cb(rhport, p_request));
-
- audio->ep_in = 0; // Necessary?
-
- }
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
- if (audio->ep_out_as_intf_num == itf)
- {
- audio->ep_out_as_intf_num = 0;
- usbd_edpt_close(rhport, audio->ep_out);
-
- // Clear FIFOs, since data is no longer valid
-#if !CFG_TUD_AUDIO_ENABLE_DECODING
- tu_fifo_clear(&audio->ep_out_ff);
-#else
- for (uint8_t cnt = 0; cnt < audio->n_rx_supp_ff; cnt++)
- {
- tu_fifo_clear(&audio->rx_supp_ff[cnt]);
- }
-#endif
-
- // Invoke callback - can be used to stop data sampling
- if (tud_audio_set_itf_close_EP_cb) TU_VERIFY(tud_audio_set_itf_close_EP_cb(rhport, p_request));
-
- audio->ep_out = 0; // Necessary?
-
- // Close corresponding feedback EP
-#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
- usbd_edpt_close(rhport, audio->ep_fb);
- audio->ep_fb = 0; // Necessary?
-#endif
- }
-#endif
-
- // Save current alternative interface setting
- audio->alt_setting[idxItf] = alt;
-
- // Open new EP if necessary - EPs are only to be closed or opened for AS interfaces - Look for AS interface with correct alternate interface
- // Get pointer at end
- uint8_t const *p_desc_end = audio->p_desc + audio->desc_length - TUD_AUDIO_DESC_IAD_LEN;
-
- // p_desc starts at required interface with alternate setting zero
- while (p_desc < p_desc_end)
- {
- // Find correct interface
- if (tu_desc_type(p_desc) == TUSB_DESC_INTERFACE && ((tusb_desc_interface_t const * )p_desc)->bInterfaceNumber == itf && ((tusb_desc_interface_t const * )p_desc)->bAlternateSetting == alt)
- {
-#if CFG_TUD_AUDIO_ENABLE_ENCODING || CFG_TUD_AUDIO_ENABLE_DECODING
- uint8_t const * p_desc_parse_for_params = p_desc;
-#endif
- // From this point forward follow the EP descriptors associated to the current alternate setting interface - Open EPs if necessary
- uint8_t foundEPs = 0, nEps = ((tusb_desc_interface_t const * )p_desc)->bNumEndpoints;
- while (foundEPs < nEps && p_desc < p_desc_end)
- {
- if (tu_desc_type(p_desc) == TUSB_DESC_ENDPOINT)
- {
- TU_ASSERT(usbd_edpt_open(rhport, (tusb_desc_endpoint_t const *)p_desc));
-
- uint8_t ep_addr = ((tusb_desc_endpoint_t const *) p_desc)->bEndpointAddress;
-
- //TODO: We need to set EP non busy since this is not taken care of right now in ep_close() - THIS IS A WORKAROUND!
- usbd_edpt_clear_stall(rhport, ep_addr);
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN
- if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN && ((tusb_desc_endpoint_t const *) p_desc)->bmAttributes.usage == 0x00) // Check if usage is data EP
- {
- // Save address
- audio->ep_in = ep_addr;
- audio->ep_in_as_intf_num = itf;
- audio->ep_in_sz = ((tusb_desc_endpoint_t const *) p_desc)->wMaxPacketSize.size;
-
- // If software encoding is enabled, parse for the corresponding parameters - doing this here means only AS interfaces with EPs get scanned for parameters
-#if CFG_TUD_AUDIO_ENABLE_ENCODING
- audiod_parse_for_AS_params(audio, p_desc_parse_for_params, p_desc_end, itf);
-
- // Reconfigure size of support FIFOs - this is necessary to avoid samples to get split in case of a wrap
-#if CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING
- const uint16_t active_fifo_depth = (audio->tx_supp_ff_sz_max / audio->n_bytes_per_sampe_tx) * audio->n_bytes_per_sampe_tx;
- for (uint8_t cnt = 0; cnt < audio->n_tx_supp_ff; cnt++)
- {
- tu_fifo_config(&audio->tx_supp_ff[cnt], audio->tx_supp_ff[cnt].buffer, active_fifo_depth, 1, true);
- }
- audio->n_ff_used_tx = audio->n_channels_tx / audio->n_channels_per_ff_tx;
- TU_ASSERT( audio->n_ff_used_tx <= audio->n_tx_supp_ff );
-#endif
-
-#endif
- // Invoke callback - can be used to trigger data sampling if not already running
- if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
-
- // Schedule first transmit if alternate interface is not zero i.e. streaming is disabled - in case no sample data is available a ZLP is loaded
- // It is necessary to trigger this here since the refill is done with an RX FIFO empty interrupt which can only trigger if something was in there
- TU_VERIFY(audiod_tx_done_cb(rhport, &_audiod_fct[func_id]));
- }
-#endif // CFG_TUD_AUDIO_ENABLE_EP_IN
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
-
- if (tu_edpt_dir(ep_addr) == TUSB_DIR_OUT) // Checking usage not necessary
- {
- // Save address
- audio->ep_out = ep_addr;
- audio->ep_out_as_intf_num = itf;
- audio->ep_out_sz = ((tusb_desc_endpoint_t const *) p_desc)->wMaxPacketSize.size;
-
-#if CFG_TUD_AUDIO_ENABLE_DECODING
- audiod_parse_for_AS_params(audio, p_desc_parse_for_params, p_desc_end, itf);
-
- // Reconfigure size of support FIFOs - this is necessary to avoid samples to get split in case of a wrap
-#if CFG_TUD_AUDIO_ENABLE_TYPE_I_DECODING
- const uint16_t active_fifo_depth = (audio->rx_supp_ff_sz_max / audio->n_bytes_per_sampe_rx) * audio->n_bytes_per_sampe_rx;
- for (uint8_t cnt = 0; cnt < audio->n_rx_supp_ff; cnt++)
- {
- tu_fifo_config(&audio->rx_supp_ff[cnt], audio->rx_supp_ff[cnt].buffer, active_fifo_depth, 1, true);
- }
- audio->n_ff_used_rx = audio->n_channels_rx / audio->n_channels_per_ff_rx;
- TU_ASSERT( audio->n_ff_used_rx <= audio->n_rx_supp_ff );
-#endif
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
- // In case of asynchronous EP, call Cb after ep_fb is set
- if (!(((tusb_desc_endpoint_t const *) p_desc)->bmAttributes.sync == 0x01 && audio->ep_fb == 0))
- {
- if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
- }
-#else
- // Invoke callback
- if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
-#endif
- // Prepare for incoming data
-#if USE_LINEAR_BUFFER_RX
- TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_out, audio->lin_buf_out, audio->ep_out_sz), false);
-#else
- TU_VERIFY(usbd_edpt_xfer_fifo(rhport, audio->ep_out, &audio->ep_out_ff, audio->ep_out_sz), false);
-#endif
- }
-
-#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
- if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN && ((tusb_desc_endpoint_t const *) p_desc)->bmAttributes.usage == 1) // Check if usage is explicit data feedback
- {
- audio->ep_fb = ep_addr;
-
- // Invoke callback after ep_out is set
- if (audio->ep_out != 0)
- {
- if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
- }
- }
-#endif
-#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT
-
- foundEPs += 1;
- }
- p_desc = tu_desc_next(p_desc);
- }
-
- TU_VERIFY(foundEPs == nEps);
-
- // We are done - abort loop
- break;
- }
-
- // Moving forward
- p_desc = tu_desc_next(p_desc);
- }
-
- tud_control_status(rhport, p_request);
-
- return true;
-}
-
-// Invoked when class request DATA stage is finished.
-// return false to stall control EP (e.g Host send non-sense DATA)
-static bool audiod_control_complete(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- // Handle audio class specific set requests
- if(p_request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS && p_request->bmRequestType_bit.direction == TUSB_DIR_OUT)
- {
- uint8_t func_id;
-
- switch (p_request->bmRequestType_bit.recipient)
- {
- case TUSB_REQ_RCPT_INTERFACE:
- {
- uint8_t itf = TU_U16_LOW(p_request->wIndex);
- uint8_t entityID = TU_U16_HIGH(p_request->wIndex);
-
- if (entityID != 0)
- {
- if (tud_audio_set_req_entity_cb)
- {
- // Check if entity is present and get corresponding driver index
- TU_VERIFY(audiod_verify_entity_exists(itf, entityID, &func_id));
-
- // Invoke callback
- return tud_audio_set_req_entity_cb(rhport, p_request, _audiod_fct[func_id].ctrl_buf);
- }
- else
- {
- TU_LOG2(" No entity set request callback available!\r\n");
- return false; // In case no callback function is present or request can not be conducted we stall it
- }
- }
- else
- {
- if (tud_audio_set_req_itf_cb)
- {
- // Find index of audio driver structure and verify interface really exists
- TU_VERIFY(audiod_verify_itf_exists(itf, &func_id));
-
- // Invoke callback
- return tud_audio_set_req_itf_cb(rhport, p_request, _audiod_fct[func_id].ctrl_buf);
- }
- else
- {
- TU_LOG2(" No interface set request callback available!\r\n");
- return false; // In case no callback function is present or request can not be conducted we stall it
- }
- }
- }
- break;
-
- case TUSB_REQ_RCPT_ENDPOINT:
- {
- uint8_t ep = TU_U16_LOW(p_request->wIndex);
-
- if (tud_audio_set_req_ep_cb)
- {
- // Check if entity is present and get corresponding driver index
- TU_VERIFY(audiod_verify_ep_exists(ep, &func_id));
-
- // Invoke callback
- return tud_audio_set_req_ep_cb(rhport, p_request, _audiod_fct[func_id].ctrl_buf);
- }
- else
- {
- TU_LOG2(" No EP set request callback available!\r\n");
- return false; // In case no callback function is present or request can not be conducted we stall it
- }
- }
- break;
- // Unknown/Unsupported recipient
- default: TU_BREAKPOINT(); return false;
- }
- }
- return true;
-}
-
-// Handle class control request
-// return false to stall control endpoint (e.g unsupported request)
-static bool audiod_control_request(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- (void) rhport;
-
- // Handle standard requests - standard set requests usually have no data stage so we also handle set requests here
- if (p_request->bmRequestType_bit.type == TUSB_REQ_TYPE_STANDARD)
- {
- switch (p_request->bRequest)
- {
- case TUSB_REQ_GET_INTERFACE:
- return audiod_get_interface(rhport, p_request);
-
- case TUSB_REQ_SET_INTERFACE:
- return audiod_set_interface(rhport, p_request);
-
- // Unknown/Unsupported request
- default: TU_BREAKPOINT(); return false;
- }
- }
-
- // Handle class requests
- if (p_request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS)
- {
- uint8_t itf = TU_U16_LOW(p_request->wIndex);
- uint8_t func_id;
-
- // Conduct checks which depend on the recipient
- switch (p_request->bmRequestType_bit.recipient)
- {
- case TUSB_REQ_RCPT_INTERFACE:
- {
- uint8_t entityID = TU_U16_HIGH(p_request->wIndex);
-
- // Verify if entity is present
- if (entityID != 0)
- {
- // Find index of audio driver structure and verify entity really exists
- TU_VERIFY(audiod_verify_entity_exists(itf, entityID, &func_id));
-
- // In case we got a get request invoke callback - callback needs to answer as defined in UAC2 specification page 89 - 5. Requests
- if (p_request->bmRequestType_bit.direction == TUSB_DIR_IN)
- {
- if (tud_audio_get_req_entity_cb)
- {
- return tud_audio_get_req_entity_cb(rhport, p_request);
- }
- else
- {
- TU_LOG2(" No entity get request callback available!\r\n");
- return false; // Stall
- }
- }
- }
- else
- {
- // Find index of audio driver structure and verify interface really exists
- TU_VERIFY(audiod_verify_itf_exists(itf, &func_id));
-
- // In case we got a get request invoke callback - callback needs to answer as defined in UAC2 specification page 89 - 5. Requests
- if (p_request->bmRequestType_bit.direction == TUSB_DIR_IN)
- {
- if (tud_audio_get_req_itf_cb)
- {
- return tud_audio_get_req_itf_cb(rhport, p_request);
- }
- else
- {
- TU_LOG2(" No interface get request callback available!\r\n");
- return false; // Stall
- }
- }
- }
- }
- break;
-
- case TUSB_REQ_RCPT_ENDPOINT:
- {
- uint8_t ep = TU_U16_LOW(p_request->wIndex);
-
- // Find index of audio driver structure and verify EP really exists
- TU_VERIFY(audiod_verify_ep_exists(ep, &func_id));
-
- // In case we got a get request invoke callback - callback needs to answer as defined in UAC2 specification page 89 - 5. Requests
- if (p_request->bmRequestType_bit.direction == TUSB_DIR_IN)
- {
- if (tud_audio_get_req_ep_cb)
- {
- return tud_audio_get_req_ep_cb(rhport, p_request);
- }
- else
- {
- TU_LOG2(" No EP get request callback available!\r\n");
- return false; // Stall
- }
- }
- }
- break;
-
- // Unknown/Unsupported recipient
- default: TU_LOG2(" Unsupported recipient: %d\r\n", p_request->bmRequestType_bit.recipient); TU_BREAKPOINT(); return false;
- }
-
- // If we end here, the received request is a set request - we schedule a receive for the data stage and return true here. We handle the rest later in audiod_control_complete() once the data stage was finished
- TU_VERIFY(tud_control_xfer(rhport, p_request, _audiod_fct[func_id].ctrl_buf, _audiod_fct[func_id].ctrl_buf_sz));
- return true;
- }
-
- // There went something wrong - unsupported control request type
- TU_BREAKPOINT();
- return false;
-}
-
-bool audiod_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
-{
- if ( stage == CONTROL_STAGE_SETUP )
- {
- return audiod_control_request(rhport, request);
- }
- else if ( stage == CONTROL_STAGE_DATA )
- {
- return audiod_control_complete(rhport, request);
- }
-
- return true;
-}
-
-bool audiod_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
-{
- (void) result;
- (void) xferred_bytes;
-
- // Search for interface belonging to given end point address and proceed as required
- uint8_t func_id;
- for (func_id = 0; func_id < CFG_TUD_AUDIO; func_id++)
- {
-
-#if CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
-
- // Data transmission of control interrupt finished
- if (_audiod_fct[func_id].ep_int_ctr == ep_addr)
- {
- // According to USB2 specification, maximum payload of interrupt EP is 8 bytes on low speed, 64 bytes on full speed, and 1024 bytes on high speed (but only if an alternate interface other than 0 is used - see specification p. 49)
- // In case there is nothing to send we have to return a NAK - this is taken care of by PHY ???
- // In case of an erroneous transmission a retransmission is conducted - this is taken care of by PHY ???
-
- // I assume here, that things above are handled by PHY
- // All transmission is done - what remains to do is to inform job was completed
-
- if (tud_audio_int_ctr_done_cb) TU_VERIFY(tud_audio_int_ctr_done_cb(rhport, (uint16_t) xferred_bytes));
- }
-
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN
-
- // Data transmission of audio packet finished
- if (_audiod_fct[func_id].ep_in == ep_addr && _audiod_fct[func_id].alt_setting != 0)
- {
- // USB 2.0, section 5.6.4, third paragraph, states "An isochronous endpoint must specify its required bus access period. However, an isochronous endpoint must be prepared to handle poll rates faster than the one specified."
- // That paragraph goes on to say "An isochronous IN endpoint must return a zero-length packet whenever data is requested at a faster interval than the specified interval and data is not available."
- // This can only be solved reliably if we load a ZLP after every IN transmission since we can not say if the host requests samples earlier than we declared! Once all samples are collected we overwrite the loaded ZLP.
-
- // Check if there is data to load into EPs buffer - if not load it with ZLP
- // Be aware - we as a device are not able to know if the host polls for data with a faster rate as we stated this in the descriptors. Therefore we always have to put something into the EPs buffer. However, once we did that, there is no way of aborting this or replacing what we put into the buffer before!
- // This is the only place where we can fill something into the EPs buffer!
-
- // Load new data
- TU_VERIFY(audiod_tx_done_cb(rhport, &_audiod_fct[func_id]));
-
- // Transmission of ZLP is done by audiod_tx_done_cb()
- return true;
- }
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
-
- // New audio packet received
- if (_audiod_fct[func_id].ep_out == ep_addr)
- {
- TU_VERIFY(audiod_rx_done_cb(rhport, &_audiod_fct[func_id], (uint16_t) xferred_bytes));
- return true;
- }
-
-
-#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
- // Transmission of feedback EP finished
- if (_audiod_fct[func_id].ep_fb == ep_addr)
- {
- if (tud_audio_fb_done_cb) TU_VERIFY(tud_audio_fb_done_cb(rhport));
-
- // Schedule a transmit with the new value if EP is not busy
- if (!usbd_edpt_busy(rhport, _audiod_fct[func_id].ep_fb))
- {
- // Schedule next transmission - value is changed bytud_audio_n_fb_set() in the meantime or the old value gets sent
- return audiod_fb_send(rhport, &_audiod_fct[func_id]);
- }
- }
-#endif
-#endif
- }
-
- return false;
-}
-
-bool tud_audio_buffer_and_schedule_control_xfer(uint8_t rhport, tusb_control_request_t const * p_request, void* data, uint16_t len)
-{
- // Handles only sending of data not receiving
- if (p_request->bmRequestType_bit.direction == TUSB_DIR_OUT) return false;
-
- // Get corresponding driver index
- uint8_t func_id;
- uint8_t itf = TU_U16_LOW(p_request->wIndex);
-
- // Conduct checks which depend on the recipient
- switch (p_request->bmRequestType_bit.recipient)
- {
- case TUSB_REQ_RCPT_INTERFACE:
- {
- uint8_t entityID = TU_U16_HIGH(p_request->wIndex);
-
- // Verify if entity is present
- if (entityID != 0)
- {
- // Find index of audio driver structure and verify entity really exists
- TU_VERIFY(audiod_verify_entity_exists(itf, entityID, &func_id));
- }
- else
- {
- // Find index of audio driver structure and verify interface really exists
- TU_VERIFY(audiod_verify_itf_exists(itf, &func_id));
- }
- }
- break;
-
- case TUSB_REQ_RCPT_ENDPOINT:
- {
- uint8_t ep = TU_U16_LOW(p_request->wIndex);
-
- // Find index of audio driver structure and verify EP really exists
- TU_VERIFY(audiod_verify_ep_exists(ep, &func_id));
- }
- break;
-
- // Unknown/Unsupported recipient
- default: TU_LOG2(" Unsupported recipient: %d\r\n", p_request->bmRequestType_bit.recipient); TU_BREAKPOINT(); return false;
- }
-
- // Crop length
- if (len > _audiod_fct[func_id].ctrl_buf_sz) len = _audiod_fct[func_id].ctrl_buf_sz;
-
- // Copy into buffer
- memcpy((void *)_audiod_fct[func_id].ctrl_buf, data, (size_t)len);
-
- // Schedule transmit
- return tud_control_xfer(rhport, p_request, (void*)_audiod_fct[func_id].ctrl_buf, len);
-}
-
-// This helper function finds for a given audio function and AS interface number the index of the attached driver structure, the index of the interface in the audio function
-// (e.g. the std. AS interface with interface number 15 is the first AS interface for the given audio function and thus gets index zero), and
-// finally a pointer to the std. AS interface, where the pointer always points to the first alternate setting i.e. alternate interface zero.
-static bool audiod_get_AS_interface_index(uint8_t itf, audiod_function_t * audio, uint8_t *idxItf, uint8_t const **pp_desc_int)
-{
- if (audio->p_desc)
- {
- // Get pointer at end
- uint8_t const *p_desc_end = audio->p_desc + audio->desc_length - TUD_AUDIO_DESC_IAD_LEN;
-
- // Advance past AC descriptors
- uint8_t const *p_desc = tu_desc_next(audio->p_desc);
- p_desc += ((audio_desc_cs_ac_interface_t const *)p_desc)->wTotalLength;
-
- uint8_t tmp = 0;
- while (p_desc < p_desc_end)
- {
- // We assume the number of alternate settings is increasing thus we return the index of alternate setting zero!
- if (tu_desc_type(p_desc) == TUSB_DESC_INTERFACE && ((tusb_desc_interface_t const * )p_desc)->bAlternateSetting == 0)
- {
- if (((tusb_desc_interface_t const * )p_desc)->bInterfaceNumber == itf)
- {
- *idxItf = tmp;
- *pp_desc_int = p_desc;
- return true;
- }
- // Increase index, bytes read, and pointer
- tmp++;
- }
- p_desc = tu_desc_next(p_desc);
- }
- }
- return false;
-}
-
-// This helper function finds for a given AS interface number the index of the attached driver structure, the index of the interface in the audio function
-// (e.g. the std. AS interface with interface number 15 is the first AS interface for the given audio function and thus gets index zero), and
-// finally a pointer to the std. AS interface, where the pointer always points to the first alternate setting i.e. alternate interface zero.
-static bool audiod_get_AS_interface_index_global(uint8_t itf, uint8_t *func_id, uint8_t *idxItf, uint8_t const **pp_desc_int)
-{
- // Loop over audio driver interfaces
- uint8_t i;
- for (i = 0; i < CFG_TUD_AUDIO; i++)
- {
- if (audiod_get_AS_interface_index(itf, &_audiod_fct[i], idxItf, pp_desc_int))
- {
- *func_id = i;
- return true;
- }
- }
-
- return false;
-}
-
-// Verify an entity with the given ID exists and returns also the corresponding driver index
-static bool audiod_verify_entity_exists(uint8_t itf, uint8_t entityID, uint8_t *func_id)
-{
- uint8_t i;
- for (i = 0; i < CFG_TUD_AUDIO; i++)
- {
- // Look for the correct driver by checking if the unique standard AC interface number fits
- if (_audiod_fct[i].p_desc && ((tusb_desc_interface_t const *)_audiod_fct[i].p_desc)->bInterfaceNumber == itf)
- {
- // Get pointers after class specific AC descriptors and end of AC descriptors - entities are defined in between
- uint8_t const *p_desc = tu_desc_next(_audiod_fct[i].p_desc); // Points to CS AC descriptor
- uint8_t const *p_desc_end = ((audio_desc_cs_ac_interface_t const *)p_desc)->wTotalLength + p_desc;
- p_desc = tu_desc_next(p_desc); // Get past CS AC descriptor
-
- while (p_desc < p_desc_end)
- {
- if (p_desc[3] == entityID) // Entity IDs are always at offset 3
- {
- *func_id = i;
- return true;
- }
- p_desc = tu_desc_next(p_desc);
- }
- }
- }
- return false;
-}
-
-static bool audiod_verify_itf_exists(uint8_t itf, uint8_t *func_id)
-{
- uint8_t i;
- for (i = 0; i < CFG_TUD_AUDIO; i++)
- {
- if (_audiod_fct[i].p_desc)
- {
- // Get pointer at beginning and end
- uint8_t const *p_desc = _audiod_fct[i].p_desc;
- uint8_t const *p_desc_end = _audiod_fct[i].p_desc + _audiod_fct[i].desc_length - TUD_AUDIO_DESC_IAD_LEN;
-
- while (p_desc < p_desc_end)
- {
- if (tu_desc_type(p_desc) == TUSB_DESC_INTERFACE && ((tusb_desc_interface_t const *)_audiod_fct[i].p_desc)->bInterfaceNumber == itf)
- {
- *func_id = i;
- return true;
- }
- p_desc = tu_desc_next(p_desc);
- }
- }
- }
- return false;
-}
-
-static bool audiod_verify_ep_exists(uint8_t ep, uint8_t *func_id)
-{
- uint8_t i;
- for (i = 0; i < CFG_TUD_AUDIO; i++)
- {
- if (_audiod_fct[i].p_desc)
- {
- // Get pointer at end
- uint8_t const *p_desc_end = _audiod_fct[i].p_desc + _audiod_fct[i].desc_length;
-
- // Advance past AC descriptors - EP we look for are streaming EPs
- uint8_t const *p_desc = tu_desc_next(_audiod_fct[i].p_desc);
- p_desc += ((audio_desc_cs_ac_interface_t const *)p_desc)->wTotalLength;
-
- while (p_desc < p_desc_end)
- {
- if (tu_desc_type(p_desc) == TUSB_DESC_ENDPOINT && ((tusb_desc_endpoint_t const * )p_desc)->bEndpointAddress == ep)
- {
- *func_id = i;
- return true;
- }
- p_desc = tu_desc_next(p_desc);
- }
- }
- }
- return false;
-}
-
-#if CFG_TUD_AUDIO_ENABLE_ENCODING || CFG_TUD_AUDIO_ENABLE_DECODING
-// p_desc points to the AS interface of alternate setting zero
-// itf is the interface number of the corresponding interface - we check if the interface belongs to EP in or EP out to see if it is a TX or RX parameter
-// Currently, only AS interfaces with an EP (in or out) are supposed to be parsed for!
-static void audiod_parse_for_AS_params(audiod_function_t* audio, uint8_t const * p_desc, uint8_t const * p_desc_end, uint8_t const as_itf)
-{
- p_desc = tu_desc_next(p_desc); // Exclude standard AS interface descriptor of current alternate interface descriptor
-
- while (p_desc < p_desc_end)
- {
- // Abort if follow up descriptor is a new standard interface descriptor - indicates the last AS descriptor was already finished
- if (tu_desc_type(p_desc) == TUSB_DESC_INTERFACE) break;
-
- // Look for a Class-Specific AS Interface Descriptor(4.9.2) to verify format type and format and also to get number of physical channels
- if (tu_desc_type(p_desc) == TUSB_DESC_CS_INTERFACE && tu_desc_subtype(p_desc) == AUDIO_CS_AS_INTERFACE_AS_GENERAL)
- {
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_EP_OUT
- if (as_itf != audio->ep_in_as_intf_num && as_itf != audio->ep_out_as_intf_num) break; // Abort loop, this interface has no EP, this driver does not support this currently
-#endif
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_EP_OUT
- if (as_itf != audio->ep_in_as_intf_num) break;
-#endif
-#if !CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_EP_OUT
- if (as_itf != audio->ep_out_as_intf_num) break;
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN
- if (as_itf == audio->ep_in_as_intf_num)
- {
- audio->n_channels_tx = ((audio_desc_cs_as_interface_t const * )p_desc)->bNrChannels;
- audio->format_type_tx = (audio_format_type_t)(((audio_desc_cs_as_interface_t const * )p_desc)->bFormatType);
-
-#if CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING
- audio->format_type_I_tx = (audio_data_format_type_I_t)(((audio_desc_cs_as_interface_t const * )p_desc)->bmFormats);
-#endif
- }
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
- if (as_itf == audio->ep_out_as_intf_num)
- {
- audio->n_channels_rx = ((audio_desc_cs_as_interface_t const * )p_desc)->bNrChannels;
- audio->format_type_rx = ((audio_desc_cs_as_interface_t const * )p_desc)->bFormatType;
-#if CFG_TUD_AUDIO_ENABLE_TYPE_I_DECODING
- audio->format_type_I_rx = ((audio_desc_cs_as_interface_t const * )p_desc)->bmFormats;
-#endif
- }
-#endif
- }
-
- // Look for a Type I Format Type Descriptor(2.3.1.6 - Audio Formats)
-#if CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING || CFG_TUD_AUDIO_ENABLE_TYPE_I_DECODING
- if (tu_desc_type(p_desc) == TUSB_DESC_CS_INTERFACE && tu_desc_subtype(p_desc) == AUDIO_CS_AS_INTERFACE_FORMAT_TYPE && ((audio_desc_type_I_format_t const * )p_desc)->bFormatType == AUDIO_FORMAT_TYPE_I)
- {
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_EP_OUT
- if (as_itf != audio->ep_in_as_intf_num && as_itf != audio->ep_out_as_intf_num) break; // Abort loop, this interface has no EP, this driver does not support this currently
-#endif
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_EP_OUT
- if (as_itf != audio->ep_in_as_intf_num) break;
-#endif
-#if !CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_EP_OUT
- if (as_itf != audio->ep_out_as_intf_num) break;
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN
- if (as_itf == audio->ep_in_as_intf_num)
- {
- audio->n_bytes_per_sampe_tx = ((audio_desc_type_I_format_t const * )p_desc)->bSubslotSize;
- }
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
- if (as_itf == audio->ep_out_as_intf_num)
- {
- audio->n_bytes_per_sampe_rx = ((audio_desc_type_I_format_t const * )p_desc)->bSubslotSize;
- }
-#endif
- }
-#endif
-
- // Other format types are not supported yet
-
- p_desc = tu_desc_next(p_desc);
- }
-}
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
-
-// Input value feedback has to be in 16.16 format - the format will be converted according to speed settings automatically
-bool tud_audio_n_fb_set(uint8_t func_id, uint32_t feedback)
-{
- TU_VERIFY(func_id < CFG_TUD_AUDIO && _audiod_fct[func_id].p_desc != NULL);
-
- // Format the feedback value
-#if !TUD_OPT_HIGH_SPEED
- uint8_t * fb = (uint8_t *) &_audiod_fct[func_id].fb_val;
-
- // For FS format is 10.14
- *(fb++) = (feedback >> 2) & 0xFF;
- *(fb++) = (feedback >> 10) & 0xFF;
- *(fb++) = (feedback >> 18) & 0xFF;
- // 4th byte is needed to work correctly with MS Windows
- *fb = 0;
-#else
- // For HS format is 16.16 as originally demanded
- _audiod_fct[func_id].fb_val = feedback;
-#endif
-
- // Schedule a transmit with the new value if EP is not busy - this triggers repetitive scheduling of the feedback value
- if (!usbd_edpt_busy(_audiod_fct[func_id].rhport, _audiod_fct[func_id].ep_fb))
- {
- return audiod_fb_send(_audiod_fct[func_id].rhport, &_audiod_fct[func_id]);
- }
-
- return true;
-}
-#endif
-
-// No security checks here - internal function only which should always succeed
-uint8_t audiod_get_audio_fct_idx(audiod_function_t * audio)
-{
- for (uint8_t cnt=0; cnt < CFG_TUD_AUDIO; cnt++)
- {
- if (&_audiod_fct[cnt] == audio) return cnt;
- }
- return 0;
-}
-
-#endif //TUSB_OPT_DEVICE_ENABLED && CFG_TUD_AUDIO
diff --git a/tinyusb/src/class/audio/audio_device.h b/tinyusb/src/class/audio/audio_device.h
deleted file mode 100755
index 5a469523..00000000
--- a/tinyusb/src/class/audio/audio_device.h
+++ /dev/null
@@ -1,627 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Ha Thach (tinyusb.org)
- * Copyright (c) 2020 Reinhard Panhuber
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_AUDIO_DEVICE_H_
-#define _TUSB_AUDIO_DEVICE_H_
-
-#include "audio.h"
-
-//--------------------------------------------------------------------+
-// Class Driver Configuration
-//--------------------------------------------------------------------+
-
-// All sizes are in bytes!
-
-#ifndef CFG_TUD_AUDIO_FUNC_1_DESC_LEN
-#error You must tell the driver the length of the audio function descriptor including IAD descriptor
-#endif
-#if CFG_TUD_AUDIO > 1
-#ifndef CFG_TUD_AUDIO_FUNC_2_DESC_LEN
-#error You must tell the driver the length of the audio function descriptor including IAD descriptor
-#endif
-#endif
-#if CFG_TUD_AUDIO > 2
-#ifndef CFG_TUD_AUDIO_FUNC_3_DESC_LEN
-#error You must tell the driver the length of the audio function descriptor including IAD descriptor
-#endif
-#endif
-
-// Number of Standard AS Interface Descriptors (4.9.1) defined per audio function - this is required to be able to remember the current alternate settings of these interfaces
-#ifndef CFG_TUD_AUDIO_FUNC_1_N_AS_INT
-#error You must tell the driver the number of Standard AS Interface Descriptors you have defined in the audio function descriptor!
-#endif
-#if CFG_TUD_AUDIO > 1
-#ifndef CFG_TUD_AUDIO_FUNC_2_N_AS_INT
-#error You must tell the driver the number of Standard AS Interface Descriptors you have defined in the audio function descriptor!
-#endif
-#endif
-#if CFG_TUD_AUDIO > 2
-#ifndef CFG_TUD_AUDIO_FUNC_3_N_AS_INT
-#error You must tell the driver the number of Standard AS Interface Descriptors you have defined in the audio function descriptor!
-#endif
-#endif
-
-// Size of control buffer used to receive and send control messages via EP0 - has to be big enough to hold your biggest request structure e.g. range requests with multiple intervals defined or cluster descriptors
-#ifndef CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ
-#error You must define an audio class control request buffer size!
-#endif
-
-#if CFG_TUD_AUDIO > 1
-#ifndef CFG_TUD_AUDIO_FUNC_2_CTRL_BUF_SZ
-#error You must define an audio class control request buffer size!
-#endif
-#endif
-
-#if CFG_TUD_AUDIO > 2
-#ifndef CFG_TUD_AUDIO_FUNC_3_CTRL_BUF_SZ
-#error You must define an audio class control request buffer size!
-#endif
-#endif
-
-// End point sizes IN BYTES - Limits: Full Speed <= 1023, High Speed <= 1024
-#ifndef CFG_TUD_AUDIO_ENABLE_EP_IN
-#define CFG_TUD_AUDIO_ENABLE_EP_IN 0 // TX
-#endif
-
-#ifndef CFG_TUD_AUDIO_ENABLE_EP_OUT
-#define CFG_TUD_AUDIO_ENABLE_EP_OUT 0 // RX
-#endif
-
-// Maximum EP sizes for all alternate AS interface settings - used for checks and buffer allocation
-#if CFG_TUD_AUDIO_ENABLE_EP_IN
-#ifndef CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX
-#error You must tell the driver the biggest EP IN size!
-#endif
-#if CFG_TUD_AUDIO > 1
-#ifndef CFG_TUD_AUDIO_FUNC_2_EP_IN_SZ_MAX
-#error You must tell the driver the biggest EP IN size!
-#endif
-#endif
-#if CFG_TUD_AUDIO > 2
-#ifndef CFG_TUD_AUDIO_FUNC_3_EP_IN_SZ_MAX
-#error You must tell the driver the biggest EP IN size!
-#endif
-#endif
-#endif // CFG_TUD_AUDIO_ENABLE_EP_IN
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
-#ifndef CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX
-#error You must tell the driver the biggest EP OUT size!
-#endif
-#if CFG_TUD_AUDIO > 1
-#ifndef CFG_TUD_AUDIO_FUNC_2_EP_OUT_SZ_MAX
-#error You must tell the driver the biggest EP OUT size!
-#endif
-#endif
-#if CFG_TUD_AUDIO > 2
-#ifndef CFG_TUD_AUDIO_FUNC_3_EP_OUT_SZ_MAX
-#error You must tell the driver the biggest EP OUT size!
-#endif
-#endif
-#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT
-
-// Software EP FIFO buffer sizes - must be >= max EP SIZEs!
-#ifndef CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ
-#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ 0
-#endif
-#ifndef CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ
-#define CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ 0
-#endif
-#ifndef CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ
-#define CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ 0
-#endif
-
-#ifndef CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ
-#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ 0
-#endif
-#ifndef CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ
-#define CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ 0
-#endif
-#ifndef CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ
-#define CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ 0
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN
-#if CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ < CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX
-#error EP software buffer size MUST BE at least as big as maximum EP size
-#endif
-
-#if CFG_TUD_AUDIO > 1
-#if CFG_TUD_AUDIO_FUNC_2_EP_IN_SW_BUF_SZ < CFG_TUD_AUDIO_FUNC_2_EP_IN_SZ_MAX
-#error EP software buffer size MUST BE at least as big as maximum EP size
-#endif
-#endif
-
-#if CFG_TUD_AUDIO > 2
-#if CFG_TUD_AUDIO_FUNC_3_EP_IN_SW_BUF_SZ < CFG_TUD_AUDIO_FUNC_3_EP_IN_SZ_MAX
-#error EP software buffer size MUST BE at least as big as maximum EP size
-#endif
-#endif
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
-#if CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ < CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX
-#error EP software buffer size MUST BE at least as big as maximum EP size
-#endif
-
-#if CFG_TUD_AUDIO > 1
-#if CFG_TUD_AUDIO_FUNC_2_EP_OUT_SW_BUF_SZ < CFG_TUD_AUDIO_FUNC_2_EP_OUT_SZ_MAX
-#error EP software buffer size MUST BE at least as big as maximum EP size
-#endif
-#endif
-
-#if CFG_TUD_AUDIO > 2
-#if CFG_TUD_AUDIO_FUNC_3_EP_OUT_SW_BUF_SZ < CFG_TUD_AUDIO_FUNC_3_EP_OUT_SZ_MAX
-#error EP software buffer size MUST BE at least as big as maximum EP size
-#endif
-#endif
-#endif
-
-// Enable/disable feedback EP (required for asynchronous RX applications)
-#ifndef CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
-#define CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP 0 // Feedback - 0 or 1
-#endif
-
-// Audio interrupt control EP size - disabled if 0
-#ifndef CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
-#define CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN 0 // Audio interrupt control - if required - 6 Bytes according to UAC 2 specification (p. 74)
-#endif
-
-#ifndef CFG_TUD_AUDIO_INT_CTR_EP_IN_SW_BUFFER_SIZE
-#define CFG_TUD_AUDIO_INT_CTR_EP_IN_SW_BUFFER_SIZE 6 // Buffer size of audio control interrupt EP - 6 Bytes according to UAC 2 specification (p. 74)
-#endif
-
-// Use software encoding/decoding
-
-// The software coding feature of the driver is not mandatory. It is useful if, for instance, you have two I2S streams which need to be interleaved
-// into a single PCM stream as SAMPLE_1 | SAMPLE_2 | SAMPLE_3 | SAMPLE_4.
-//
-// Currently, only PCM type I encoding/decoding is supported!
-//
-// If the coding feature is to be used, support FIFOs need to be configured. Their sizes and numbers are defined below.
-
-// Encoding/decoding is done in software and thus time consuming. If you can encode/decode your stream more efficiently do not use the
-// support FIFOs but write/read directly into/from the EP_X_SW_BUFFER_FIFOs using
-// - tud_audio_n_write() or
-// - tud_audio_n_read().
-// To write/read to/from the support FIFOs use
-// - tud_audio_n_write_support_ff() or
-// - tud_audio_n_read_support_ff().
-//
-// The encoding/decoding format type done is defined below.
-//
-// The encoding/decoding starts when the private callback functions
-// - audio_tx_done_cb()
-// - audio_rx_done_cb()
-// are invoked. If support FIFOs are used, the corresponding encoding/decoding functions are called from there.
-// Once encoding/decoding is done the result is put directly into the EP_X_SW_BUFFER_FIFOs. You can use the public callback functions
-// - tud_audio_tx_done_pre_load_cb() or tud_audio_tx_done_post_load_cb()
-// - tud_audio_rx_done_pre_read_cb() or tud_audio_rx_done_post_read_cb()
-// if you want to get informed what happened.
-//
-// If you don't use the support FIFOs you may use the public callback functions
-// - tud_audio_tx_done_pre_load_cb() or tud_audio_tx_done_post_load_cb()
-// - tud_audio_rx_done_pre_read_cb() or tud_audio_rx_done_post_read_cb()
-// to write/read from/into the EP_X_SW_BUFFER_FIFOs at the right time.
-//
-// If you need a different encoding which is not support so far implement it in the
-// - audio_tx_done_cb()
-// - audio_rx_done_cb()
-// functions.
-
-// Enable encoding/decodings - for these to work, support FIFOs need to be setup in appropriate numbers and size
-// The actual coding parameters of active AS alternate interface is parsed from the descriptors
-
-// The item size of the FIFO is always fixed to one i.e. bytes! Furthermore, the actively used FIFO depth is reconfigured such that the depth is a multiple of the current sample size in order to avoid samples to get split up in case of a wrap in the FIFO ring buffer (depth = (max_depth / sampe_sz) * sampe_sz)!
-// This is important to remind in case you use DMAs! If the sample sizes changes, the DMA MUST BE RECONFIGURED just like the FIFOs for a different depth!!!
-
-// For PCM encoding/decoding
-
-#ifndef CFG_TUD_AUDIO_ENABLE_ENCODING
-#define CFG_TUD_AUDIO_ENABLE_ENCODING 0
-#endif
-
-#ifndef CFG_TUD_AUDIO_ENABLE_DECODING
-#define CFG_TUD_AUDIO_ENABLE_DECODING 0
-#endif
-
-// This enabling allows to save the current coding parameters e.g. # of bytes per sample etc. - TYPE_I includes common PCM encoding
-#ifndef CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING
-#define CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING 0
-#endif
-
-#ifndef CFG_TUD_AUDIO_ENABLE_TYPE_I_DECODING
-#define CFG_TUD_AUDIO_ENABLE_TYPE_I_DECODING 0
-#endif
-
-// Type I Coding parameters not given within UAC2 descriptors
-// It would be possible to allow for a more flexible setting and not fix this parameter as done below. However, this is most often not needed and kept for later if really necessary. The more flexible setting could be implemented within set_interface(), however, how the values are saved per alternate setting is to be determined!
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING && CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING
-#ifndef CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX
-#error You must tell the driver the number of channels per FIFO for the interleaved encoding! E.g. for an I2S interface having two channels, CHANNEL_PER_FIFO = 2 as the I2S stream having two channels is usually saved within one FIFO
-#endif
-#if CFG_TUD_AUDIO > 1
-#ifndef CFG_TUD_AUDIO_FUNC_2_CHANNEL_PER_FIFO_TX
-#error You must tell the driver the number of channels per FIFO for the interleaved encoding! E.g. for an I2S interface having two channels, CHANNEL_PER_FIFO = 2 as the I2S stream having two channels is usually saved within one FIFO
-#endif
-#endif
-#if CFG_TUD_AUDIO > 2
-#ifndef CFG_TUD_AUDIO_FUNC_3_CHANNEL_PER_FIFO_TX
-#error You must tell the driver the number of channels per FIFO for the interleaved encoding! E.g. for an I2S interface having two channels, CHANNEL_PER_FIFO = 2 as the I2S stream having two channels is usually saved within one FIFO
-#endif
-#endif
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING && CFG_TUD_AUDIO_ENABLE_TYPE_I_DECODING
-#ifndef CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_RX
-#error You must tell the driver the number of channels per FIFO for the interleaved encoding! E.g. for an I2S interface having two channels, CHANNEL_PER_FIFO = 2 as the I2S stream having two channels is usually saved within one FIFO
-#endif
-#if CFG_TUD_AUDIO > 1
-#ifndef CFG_TUD_AUDIO_FUNC_2_CHANNEL_PER_FIFO_RX
-#error You must tell the driver the number of channels per FIFO for the interleaved encoding! E.g. for an I2S interface having two channels, CHANNEL_PER_FIFO = 2 as the I2S stream having two channels is usually saved within one FIFO
-#endif
-#endif
-#if CFG_TUD_AUDIO > 2
-#ifndef CFG_TUD_AUDIO_FUNC_3_CHANNEL_PER_FIFO_RX
-#error You must tell the driver the number of channels per FIFO for the interleaved encoding! E.g. for an I2S interface having two channels, CHANNEL_PER_FIFO = 2 as the I2S stream having two channels is usually saved within one FIFO
-#endif
-#endif
-#endif
-
-// Remaining types not support so far
-
-// Number of support FIFOs to set up - multiple channels can be handled by one FIFO - very common is two channels per FIFO stemming from one I2S interface
-#ifndef CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO
-#define CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO 0
-#endif
-#ifndef CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO
-#define CFG_TUD_AUDIO_FUNC_2_N_TX_SUPP_SW_FIFO 0
-#endif
-#ifndef CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO
-#define CFG_TUD_AUDIO_FUNC_3_N_TX_SUPP_SW_FIFO 0
-#endif
-
-#ifndef CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO
-#define CFG_TUD_AUDIO_FUNC_1_N_RX_SUPP_SW_FIFO 0
-#endif
-#ifndef CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO
-#define CFG_TUD_AUDIO_FUNC_2_N_RX_SUPP_SW_FIFO 0
-#endif
-#ifndef CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO
-#define CFG_TUD_AUDIO_FUNC_3_N_RX_SUPP_SW_FIFO 0
-#endif
-
-// Size of support FIFOs IN BYTES - if size > 0 there are as many FIFOs set up as CFG_TUD_AUDIO_FUNC_X_N_TX_SUPP_SW_FIFO and CFG_TUD_AUDIO_FUNC_X_N_RX_SUPP_SW_FIFO
-#ifndef CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ
-#define CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ 0 // FIFO size - minimum size: ceil(f_s/1000) * max(# of TX channels) / (# of TX support FIFOs) * max(# of bytes per sample)
-#endif
-#ifndef CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ
-#define CFG_TUD_AUDIO_FUNC_2_TX_SUPP_SW_FIFO_SZ 0
-#endif
-#ifndef CFG_TUD_AUDIO_FUNC_3_TX_SUPP_SW_FIFO_SZ
-#define CFG_TUD_AUDIO_FUNC_3_TX_SUPP_SW_FIFO_SZ 0
-#endif
-
-#ifndef CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ
-#define CFG_TUD_AUDIO_FUNC_1_RX_SUPP_SW_FIFO_SZ 0 // FIFO size - minimum size: ceil(f_s/1000) * max(# of RX channels) / (# of RX support FIFOs) * max(# of bytes per sample)
-#endif
-#ifndef CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ
-#define CFG_TUD_AUDIO_FUNC_2_RX_SUPP_SW_FIFO_SZ 0
-#endif
-#ifndef CFG_TUD_AUDIO_FUNC_3_RX_SUPP_SW_FIFO_SZ
-#define CFG_TUD_AUDIO_FUNC_3_RX_SUPP_SW_FIFO_SZ 0
-#endif
-
-//static_assert(sizeof(tud_audio_desc_lengths) != CFG_TUD_AUDIO, "Supply audio function descriptor pack length!");
-
-// Supported types of this driver:
-// AUDIO_DATA_FORMAT_TYPE_I_PCM - Required definitions: CFG_TUD_AUDIO_N_CHANNELS and CFG_TUD_AUDIO_BYTES_PER_CHANNEL
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** \addtogroup AUDIO_Serial Serial
- * @{
- * \defgroup AUDIO_Serial_Device Device
- * @{ */
-
-//--------------------------------------------------------------------+
-// Application API (Multiple Interfaces)
-// CFG_TUD_AUDIO > 1
-//--------------------------------------------------------------------+
-bool tud_audio_n_mounted (uint8_t func_id);
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
-uint16_t tud_audio_n_available (uint8_t func_id);
-uint16_t tud_audio_n_read (uint8_t func_id, void* buffer, uint16_t bufsize);
-bool tud_audio_n_clear_ep_out_ff (uint8_t func_id); // Delete all content in the EP OUT FIFO
-tu_fifo_t* tud_audio_n_get_ep_out_ff (uint8_t func_id);
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
-bool tud_audio_n_clear_rx_support_ff (uint8_t func_id, uint8_t ff_idx); // Delete all content in the support RX FIFOs
-uint16_t tud_audio_n_available_support_ff (uint8_t func_id, uint8_t ff_idx);
-uint16_t tud_audio_n_read_support_ff (uint8_t func_id, uint8_t ff_idx, void* buffer, uint16_t bufsize);
-tu_fifo_t* tud_audio_n_get_rx_support_ff (uint8_t func_id, uint8_t ff_idx);
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
-uint16_t tud_audio_n_write (uint8_t func_id, const void * data, uint16_t len);
-bool tud_audio_n_clear_ep_in_ff (uint8_t func_id); // Delete all content in the EP IN FIFO
-tu_fifo_t* tud_audio_n_get_ep_in_ff (uint8_t func_id);
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
-uint16_t tud_audio_n_flush_tx_support_ff (uint8_t func_id); // Force all content in the support TX FIFOs to be written into EP SW FIFO
-bool tud_audio_n_clear_tx_support_ff (uint8_t func_id, uint8_t ff_idx);
-uint16_t tud_audio_n_write_support_ff (uint8_t func_id, uint8_t ff_idx, const void * data, uint16_t len);
-tu_fifo_t* tud_audio_n_get_tx_support_ff (uint8_t func_id, uint8_t ff_idx);
-#endif
-
-#if CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
-uint16_t tud_audio_int_ctr_n_write (uint8_t func_id, uint8_t const* buffer, uint16_t len);
-#endif
-
-//--------------------------------------------------------------------+
-// Application API (Interface0)
-//--------------------------------------------------------------------+
-
-static inline bool tud_audio_mounted (void);
-
-// RX API
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
-static inline uint16_t tud_audio_available (void);
-static inline bool tud_audio_clear_ep_out_ff (void); // Delete all content in the EP OUT FIFO
-static inline uint16_t tud_audio_read (void* buffer, uint16_t bufsize);
-static inline tu_fifo_t* tud_audio_get_ep_out_ff (void);
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
-static inline bool tud_audio_clear_rx_support_ff (uint8_t ff_idx);
-static inline uint16_t tud_audio_available_support_ff (uint8_t ff_idx);
-static inline uint16_t tud_audio_read_support_ff (uint8_t ff_idx, void* buffer, uint16_t bufsize);
-static inline tu_fifo_t* tud_audio_get_rx_support_ff (uint8_t ff_idx);
-#endif
-
-// TX API
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
-static inline uint16_t tud_audio_write (const void * data, uint16_t len);
-static inline bool tud_audio_clear_ep_in_ff (void);
-static inline tu_fifo_t* tud_audio_get_ep_in_ff (void);
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
-static inline uint16_t tud_audio_flush_tx_support_ff (void);
-static inline uint16_t tud_audio_clear_tx_support_ff (uint8_t ff_idx);
-static inline uint16_t tud_audio_write_support_ff (uint8_t ff_idx, const void * data, uint16_t len);
-static inline tu_fifo_t* tud_audio_get_tx_support_ff (uint8_t ff_idx);
-#endif
-
-// INT CTR API
-
-#if CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
-static inline uint16_t tud_audio_int_ctr_write (uint8_t const* buffer, uint16_t len);
-#endif
-
-// Buffer control EP data and schedule a transmit
-// This function is intended to be used if you do not have a persistent buffer or memory location available (e.g. non-local variables) and need to answer onto a
-// get request. This function buffers your answer request frame into the control buffer of the corresponding audio driver and schedules a transmit for sending it.
-// Since transmission is triggered via interrupts, a persistent memory location is required onto which the buffer pointer in pointing. If you already have such
-// available you may directly use 'tud_control_xfer(...)'. In this case data does not need to be copied into an additional buffer and you save some time.
-// If the request's wLength is zero, a status packet is sent instead.
-bool tud_audio_buffer_and_schedule_control_xfer(uint8_t rhport, tusb_control_request_t const * p_request, void* data, uint16_t len);
-
-//--------------------------------------------------------------------+
-// Application Callback API (weak is optional)
-//--------------------------------------------------------------------+
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN
-TU_ATTR_WEAK bool tud_audio_tx_done_pre_load_cb(uint8_t rhport, uint8_t func_id, uint8_t ep_in, uint8_t cur_alt_setting);
-TU_ATTR_WEAK bool tud_audio_tx_done_post_load_cb(uint8_t rhport, uint16_t n_bytes_copied, uint8_t func_id, uint8_t ep_in, uint8_t cur_alt_setting);
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT
-TU_ATTR_WEAK bool tud_audio_rx_done_pre_read_cb(uint8_t rhport, uint16_t n_bytes_received, uint8_t func_id, uint8_t ep_out, uint8_t cur_alt_setting);
-TU_ATTR_WEAK bool tud_audio_rx_done_post_read_cb(uint8_t rhport, uint16_t n_bytes_received, uint8_t func_id, uint8_t ep_out, uint8_t cur_alt_setting);
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
-TU_ATTR_WEAK bool tud_audio_fb_done_cb(uint8_t rhport);
-// User code should call this function with feedback value in 16.16 format for FS and HS.
-// Value will be corrected for FS to 10.14 format automatically.
-// (see Universal Serial Bus Specification Revision 2.0 5.12.4.2).
-// Feedback value will be sent at FB endpoint interval till it's changed.
-bool tud_audio_n_fb_set(uint8_t func_id, uint32_t feedback);
-static inline bool tud_audio_fb_set(uint32_t feedback);
-#endif
-
-#if CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
-TU_ATTR_WEAK bool tud_audio_int_ctr_done_cb(uint8_t rhport, uint16_t n_bytes_copied);
-#endif
-
-// Invoked when audio set interface request received
-TU_ATTR_WEAK bool tud_audio_set_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request);
-
-// Invoked when audio set interface request received which closes an EP
-TU_ATTR_WEAK bool tud_audio_set_itf_close_EP_cb(uint8_t rhport, tusb_control_request_t const * p_request);
-
-// Invoked when audio class specific set request received for an EP
-TU_ATTR_WEAK bool tud_audio_set_req_ep_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff);
-
-// Invoked when audio class specific set request received for an interface
-TU_ATTR_WEAK bool tud_audio_set_req_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff);
-
-// Invoked when audio class specific set request received for an entity
-TU_ATTR_WEAK bool tud_audio_set_req_entity_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff);
-
-// Invoked when audio class specific get request received for an EP
-TU_ATTR_WEAK bool tud_audio_get_req_ep_cb(uint8_t rhport, tusb_control_request_t const * p_request);
-
-// Invoked when audio class specific get request received for an interface
-TU_ATTR_WEAK bool tud_audio_get_req_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request);
-
-// Invoked when audio class specific get request received for an entity
-TU_ATTR_WEAK bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const * p_request);
-
-//--------------------------------------------------------------------+
-// Inline Functions
-//--------------------------------------------------------------------+
-
-static inline bool tud_audio_mounted(void)
-{
- return tud_audio_n_mounted(0);
-}
-
-// RX API
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && !CFG_TUD_AUDIO_ENABLE_DECODING
-
-static inline uint16_t tud_audio_available(void)
-{
- return tud_audio_n_available(0);
-}
-
-static inline uint16_t tud_audio_read(void* buffer, uint16_t bufsize)
-{
- return tud_audio_n_read(0, buffer, bufsize);
-}
-
-static inline bool tud_audio_clear_ep_out_ff(void)
-{
- return tud_audio_n_clear_ep_out_ff(0);
-}
-
-static inline tu_fifo_t* tud_audio_get_ep_out_ff(void)
-{
- return tud_audio_n_get_ep_out_ff(0);
-}
-
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING
-
-static inline bool tud_audio_clear_rx_support_ff(uint8_t ff_idx)
-{
- return tud_audio_n_clear_rx_support_ff(0, ff_idx);
-}
-
-static inline uint16_t tud_audio_available_support_ff(uint8_t ff_idx)
-{
- return tud_audio_n_available_support_ff(0, ff_idx);
-}
-
-static inline uint16_t tud_audio_read_support_ff(uint8_t ff_idx, void* buffer, uint16_t bufsize)
-{
- return tud_audio_n_read_support_ff(0, ff_idx, buffer, bufsize);
-}
-
-static inline tu_fifo_t* tud_audio_get_rx_support_ff(uint8_t ff_idx)
-{
- return tud_audio_n_get_rx_support_ff(0, ff_idx);
-}
-
-#endif
-
-// TX API
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && !CFG_TUD_AUDIO_ENABLE_ENCODING
-
-static inline uint16_t tud_audio_write(const void * data, uint16_t len)
-{
- return tud_audio_n_write(0, data, len);
-}
-
-static inline bool tud_audio_clear_ep_in_ff(void)
-{
- return tud_audio_n_clear_ep_in_ff(0);
-}
-
-static inline tu_fifo_t* tud_audio_get_ep_in_ff(void)
-{
- return tud_audio_n_get_ep_in_ff(0);
-}
-
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_IN && CFG_TUD_AUDIO_ENABLE_ENCODING
-
-static inline uint16_t tud_audio_flush_tx_support_ff(void)
-{
- return tud_audio_n_flush_tx_support_ff(0);
-}
-
-static inline uint16_t tud_audio_clear_tx_support_ff(uint8_t ff_idx)
-{
- return tud_audio_n_clear_tx_support_ff(0, ff_idx);
-}
-
-static inline uint16_t tud_audio_write_support_ff(uint8_t ff_idx, const void * data, uint16_t len)
-{
- return tud_audio_n_write_support_ff(0, ff_idx, data, len);
-}
-
-static inline tu_fifo_t* tud_audio_get_tx_support_ff(uint8_t ff_idx)
-{
- return tud_audio_n_get_tx_support_ff(0, ff_idx);
-}
-
-#endif
-
-#if CFG_TUD_AUDIO_INT_CTR_EPSIZE_IN
-static inline uint16_t tud_audio_int_ctr_write(uint8_t const* buffer, uint16_t len)
-{
- return tud_audio_int_ctr_n_write(0, buffer, len);
-}
-#endif
-
-#if CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
-static inline bool tud_audio_fb_set(uint32_t feedback)
-{
- return tud_audio_n_fb_set(0, feedback);
-}
-#endif
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-void audiod_init (void);
-void audiod_reset (uint8_t rhport);
-uint16_t audiod_open (uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
-bool audiod_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
-bool audiod_xfer_cb (uint8_t rhport, uint8_t edpt_addr, xfer_result_t result, uint32_t xferred_bytes);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TUSB_AUDIO_DEVICE_H_ */
-
-/** @} */
-/** @} */
diff --git a/tinyusb/src/class/bth/bth_device.c b/tinyusb/src/class/bth/bth_device.c
deleted file mode 100755
index 1d27ae7c..00000000
--- a/tinyusb/src/class/bth/bth_device.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Jerzy Kasenberg
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_BTH)
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "bth_device.h"
-#include <device/usbd_pvt.h>
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-typedef struct
-{
- uint8_t itf_num;
- uint8_t ep_ev;
- uint8_t ep_acl_in;
- uint8_t ep_acl_out;
- uint8_t ep_voice[2]; // Not used yet
- uint8_t ep_voice_size[2][CFG_TUD_BTH_ISO_ALT_COUNT];
-
- // Endpoint Transfer buffer
- CFG_TUSB_MEM_ALIGN bt_hci_cmd_t hci_cmd;
- CFG_TUSB_MEM_ALIGN uint8_t epout_buf[CFG_TUD_BTH_DATA_EPSIZE];
-
-} btd_interface_t;
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-CFG_TUSB_MEM_SECTION btd_interface_t _btd_itf;
-
-static bool bt_tx_data(uint8_t ep, void *data, uint16_t len)
-{
- // skip if previous transfer not complete
- TU_VERIFY(!usbd_edpt_busy(TUD_OPT_RHPORT, ep));
-
- TU_ASSERT(usbd_edpt_xfer(TUD_OPT_RHPORT, ep, data, len));
-
- return true;
-}
-
-//--------------------------------------------------------------------+
-// READ API
-//--------------------------------------------------------------------+
-
-
-//--------------------------------------------------------------------+
-// WRITE API
-//--------------------------------------------------------------------+
-
-bool tud_bt_event_send(void *event, uint16_t event_len)
-{
- return bt_tx_data(_btd_itf.ep_ev, event, event_len);
-}
-
-bool tud_bt_acl_data_send(void *event, uint16_t event_len)
-{
- return bt_tx_data(_btd_itf.ep_acl_in, event, event_len);
-}
-
-//--------------------------------------------------------------------+
-// USBD Driver API
-//--------------------------------------------------------------------+
-void btd_init(void)
-{
- tu_memclr(&_btd_itf, sizeof(_btd_itf));
-}
-
-void btd_reset(uint8_t rhport)
-{
- (void)rhport;
-}
-
-uint16_t btd_open(uint8_t rhport, tusb_desc_interface_t const *itf_desc, uint16_t max_len)
-{
- tusb_desc_endpoint_t const *desc_ep;
- uint16_t drv_len = 0;
- // Size of single alternative of ISO interface
- const uint16_t iso_alt_itf_size = sizeof(tusb_desc_interface_t) + 2 * sizeof(tusb_desc_endpoint_t);
- // Size of hci interface
- const uint16_t hci_itf_size = sizeof(tusb_desc_interface_t) + 3 * sizeof(tusb_desc_endpoint_t);
- // Ensure this is BT Primary Controller
- TU_VERIFY(TUSB_CLASS_WIRELESS_CONTROLLER == itf_desc->bInterfaceClass &&
- TUD_BT_APP_SUBCLASS == itf_desc->bInterfaceSubClass &&
- TUD_BT_PROTOCOL_PRIMARY_CONTROLLER == itf_desc->bInterfaceProtocol, 0);
-
- // Distinguish interface by number of endpoints, as both interface have same class, subclass and protocol
- if (itf_desc->bNumEndpoints == 3 && max_len >= hci_itf_size)
- {
- _btd_itf.itf_num = itf_desc->bInterfaceNumber;
-
- desc_ep = (tusb_desc_endpoint_t const *) tu_desc_next(itf_desc);
-
- TU_ASSERT(TUSB_DESC_ENDPOINT == desc_ep->bDescriptorType && TUSB_XFER_INTERRUPT == desc_ep->bmAttributes.xfer, 0);
- TU_ASSERT(usbd_edpt_open(rhport, desc_ep), 0);
- _btd_itf.ep_ev = desc_ep->bEndpointAddress;
-
- // Open endpoint pair
- TU_ASSERT(usbd_open_edpt_pair(rhport, tu_desc_next(desc_ep), 2, TUSB_XFER_BULK, &_btd_itf.ep_acl_out,
- &_btd_itf.ep_acl_in), 0);
-
- // Prepare for incoming data from host
- TU_ASSERT(usbd_edpt_xfer(rhport, _btd_itf.ep_acl_out, _btd_itf.epout_buf, CFG_TUD_BTH_DATA_EPSIZE), 0);
-
- drv_len = hci_itf_size;
- }
- else if (itf_desc->bNumEndpoints == 2 && max_len >= iso_alt_itf_size)
- {
- uint8_t dir;
-
- desc_ep = (tusb_desc_endpoint_t const *)tu_desc_next(itf_desc);
- TU_ASSERT(itf_desc->bAlternateSetting < CFG_TUD_BTH_ISO_ALT_COUNT, 0);
- TU_ASSERT(desc_ep->bDescriptorType == TUSB_DESC_ENDPOINT, 0);
- dir = tu_edpt_dir(desc_ep->bEndpointAddress);
- _btd_itf.ep_voice[dir] = desc_ep->bEndpointAddress;
- // Store endpoint size for alternative
- _btd_itf.ep_voice_size[dir][itf_desc->bAlternateSetting] = (uint8_t)desc_ep->wMaxPacketSize.size;
-
- desc_ep = (tusb_desc_endpoint_t const *)tu_desc_next(desc_ep);
- TU_ASSERT(desc_ep->bDescriptorType == TUSB_DESC_ENDPOINT, 0);
- dir = tu_edpt_dir(desc_ep->bEndpointAddress);
- _btd_itf.ep_voice[dir] = desc_ep->bEndpointAddress;
- // Store endpoint size for alternative
- _btd_itf.ep_voice_size[dir][itf_desc->bAlternateSetting] = (uint8_t)desc_ep->wMaxPacketSize.size;
- drv_len += iso_alt_itf_size;
-
- for (int i = 1; i < CFG_TUD_BTH_ISO_ALT_COUNT && drv_len + iso_alt_itf_size <= max_len; ++i) {
- // Make sure rest of alternatives matches
- itf_desc = (tusb_desc_interface_t const *)tu_desc_next(desc_ep);
- if (itf_desc->bDescriptorType != TUSB_DESC_INTERFACE ||
- TUSB_CLASS_WIRELESS_CONTROLLER != itf_desc->bInterfaceClass ||
- TUD_BT_APP_SUBCLASS != itf_desc->bInterfaceSubClass ||
- TUD_BT_PROTOCOL_PRIMARY_CONTROLLER != itf_desc->bInterfaceProtocol)
- {
- // Not an Iso interface instance
- break;
- }
- TU_ASSERT(itf_desc->bAlternateSetting < CFG_TUD_BTH_ISO_ALT_COUNT, 0);
-
- desc_ep = (tusb_desc_endpoint_t const *)tu_desc_next(itf_desc);
- dir = tu_edpt_dir(desc_ep->bEndpointAddress);
- // Verify that alternative endpoint are same as first ones
- TU_ASSERT(desc_ep->bDescriptorType == TUSB_DESC_ENDPOINT &&
- _btd_itf.ep_voice[dir] == desc_ep->bEndpointAddress, 0);
- _btd_itf.ep_voice_size[dir][itf_desc->bAlternateSetting] = (uint8_t)desc_ep->wMaxPacketSize.size;
-
- desc_ep = (tusb_desc_endpoint_t const *)tu_desc_next(desc_ep);
- dir = tu_edpt_dir(desc_ep->bEndpointAddress);
- // Verify that alternative endpoint are same as first ones
- TU_ASSERT(desc_ep->bDescriptorType == TUSB_DESC_ENDPOINT &&
- _btd_itf.ep_voice[dir] == desc_ep->bEndpointAddress, 0);
- _btd_itf.ep_voice_size[dir][itf_desc->bAlternateSetting] = (uint8_t)desc_ep->wMaxPacketSize.size;
- drv_len += iso_alt_itf_size;
- }
- }
-
- return drv_len;
-}
-
-// Invoked when a control transfer occurred on an interface of this class
-// Driver response accordingly to the request and the transfer stage (setup/data/ack)
-// return false to stall control endpoint (e.g unsupported request)
-bool btd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const *request)
-{
- (void)rhport;
-
- if ( stage == CONTROL_STAGE_SETUP )
- {
- if (request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS &&
- request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_DEVICE)
- {
- // HCI command packet addressing for single function Primary Controllers
- TU_VERIFY(request->bRequest == 0 && request->wValue == 0 && request->wIndex == 0);
- }
- else if (request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_INTERFACE)
- {
- if (request->bRequest == TUSB_REQ_SET_INTERFACE && _btd_itf.itf_num + 1 == request->wIndex)
- {
- // TODO: Set interface it would involve changing size of endpoint size
- }
- else
- {
- // HCI command packet for Primary Controller function in a composite device
- TU_VERIFY(request->bRequest == 0 && request->wValue == 0 && request->wIndex == _btd_itf.itf_num);
- }
- }
- else return false;
-
- return tud_control_xfer(rhport, request, &_btd_itf.hci_cmd, request->wLength);
- }
- else if ( stage == CONTROL_STAGE_DATA )
- {
- // Handle class request only
- TU_VERIFY(request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS);
-
- if (tud_bt_hci_cmd_cb) tud_bt_hci_cmd_cb(&_btd_itf.hci_cmd, request->wLength);
- }
-
- return true;
-}
-
-bool btd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
-{
- (void)result;
-
- // received new data from host
- if (ep_addr == _btd_itf.ep_acl_out)
- {
- if (tud_bt_acl_data_received_cb) tud_bt_acl_data_received_cb(_btd_itf.epout_buf, xferred_bytes);
-
- // prepare for next data
- TU_ASSERT(usbd_edpt_xfer(rhport, _btd_itf.ep_acl_out, _btd_itf.epout_buf, CFG_TUD_BTH_DATA_EPSIZE));
- }
- else if (ep_addr == _btd_itf.ep_ev)
- {
- if (tud_bt_event_sent_cb) tud_bt_event_sent_cb((uint16_t)xferred_bytes);
- }
- else if (ep_addr == _btd_itf.ep_acl_in)
- {
- if (tud_bt_acl_data_sent_cb) tud_bt_acl_data_sent_cb((uint16_t)xferred_bytes);
- }
-
- return true;
-}
-
-#endif
diff --git a/tinyusb/src/class/bth/bth_device.h b/tinyusb/src/class/bth/bth_device.h
deleted file mode 100755
index 1b90d091..00000000
--- a/tinyusb/src/class/bth/bth_device.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Jerzy Kasenberg
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_BTH_DEVICE_H_
-#define _TUSB_BTH_DEVICE_H_
-
-#include <common/tusb_common.h>
-#include <device/usbd.h>
-
-//--------------------------------------------------------------------+
-// Class Driver Configuration
-//--------------------------------------------------------------------+
-#ifndef CFG_TUD_BTH_EVENT_EPSIZE
-#define CFG_TUD_BTH_EVENT_EPSIZE 16
-#endif
-#ifndef CFG_TUD_BTH_DATA_EPSIZE
-#define CFG_TUD_BTH_DATA_EPSIZE 64
-#endif
-
-typedef struct TU_ATTR_PACKED
-{
- uint16_t op_code;
- uint8_t param_length;
- uint8_t param[255];
-} bt_hci_cmd_t;
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Application Callback API (weak is optional)
-//--------------------------------------------------------------------+
-
-// Invoked when HCI command was received over USB from Bluetooth host.
-// Detailed format is described in Bluetooth core specification Vol 2,
-// Part E, 5.4.1.
-// Length of the command is from 3 bytes (2 bytes for OpCode,
-// 1 byte for parameter total length) to 258.
-TU_ATTR_WEAK void tud_bt_hci_cmd_cb(void *hci_cmd, size_t cmd_len);
-
-// Invoked when ACL data was received over USB from Bluetooth host.
-// Detailed format is described in Bluetooth core specification Vol 2,
-// Part E, 5.4.2.
-// Length is from 4 bytes, (12 bits for Handle, 4 bits for flags
-// and 16 bits for data total length) to endpoint size.
-TU_ATTR_WEAK void tud_bt_acl_data_received_cb(void *acl_data, uint16_t data_len);
-
-// Called when event sent with tud_bt_event_send() was delivered to BT stack.
-// Controller can release/reuse buffer with Event packet at this point.
-TU_ATTR_WEAK void tud_bt_event_sent_cb(uint16_t sent_bytes);
-
-// Called when ACL data that was sent with tud_bt_acl_data_send()
-// was delivered to BT stack.
-// Controller can release/reuse buffer with ACL packet at this point.
-TU_ATTR_WEAK void tud_bt_acl_data_sent_cb(uint16_t sent_bytes);
-
-// Bluetooth controller calls this function when it wants to send even packet
-// as described in Bluetooth core specification Vol 2, Part E, 5.4.4.
-// Event has at least 2 bytes, first is Event code second contains parameter
-// total length. Controller can release/reuse event memory after
-// tud_bt_event_sent_cb() is called.
-bool tud_bt_event_send(void *event, uint16_t event_len);
-
-// Bluetooth controller calls this to send ACL data packet
-// as described in Bluetooth core specification Vol 2, Part E, 5.4.2
-// Minimum length is 4 bytes, (12 bits for Handle, 4 bits for flags
-// and 16 bits for data total length). Upper limit is not limited
-// to endpoint size since buffer is allocate by controller
-// and must not be reused till tud_bt_acl_data_sent_cb() is called.
-bool tud_bt_acl_data_send(void *acl_data, uint16_t data_len);
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-void btd_init (void);
-void btd_reset (uint8_t rhport);
-uint16_t btd_open (uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
-bool btd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request);
-bool btd_xfer_cb (uint8_t rhport, uint8_t edpt_addr, xfer_result_t result, uint32_t xferred_bytes);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_BTH_DEVICE_H_ */
diff --git a/tinyusb/src/class/cdc/cdc.h b/tinyusb/src/class/cdc/cdc.h
deleted file mode 100755
index 5df47f70..00000000
--- a/tinyusb/src/class/cdc/cdc.h
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup group_class
- * \defgroup ClassDriver_CDC Communication Device Class (CDC)
- * Currently only Abstract Control Model subclass is supported
- * @{ */
-
-#ifndef _TUSB_CDC_H__
-#define _TUSB_CDC_H__
-
-#include "common/tusb_common.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/** \defgroup ClassDriver_CDC_Common Common Definitions
- * @{ */
-
-// TODO remove
-/// CDC Pipe ID, used to indicate which pipe the API is addressing to (Notification, Out, In)
-typedef enum
-{
- CDC_PIPE_NOTIFICATION , ///< Notification pipe
- CDC_PIPE_DATA_IN , ///< Data in pipe
- CDC_PIPE_DATA_OUT , ///< Data out pipe
- CDC_PIPE_ERROR , ///< Invalid Pipe ID
-}cdc_pipeid_t;
-
-//--------------------------------------------------------------------+
-// CDC Communication Interface Class
-//--------------------------------------------------------------------+
-
-/// Communication Interface Subclass Codes
-typedef enum
-{
- CDC_COMM_SUBCLASS_DIRECT_LINE_CONTROL_MODEL = 0x01 , ///< Direct Line Control Model [USBPSTN1.2]
- CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL , ///< Abstract Control Model [USBPSTN1.2]
- CDC_COMM_SUBCLASS_TELEPHONE_CONTROL_MODEL , ///< Telephone Control Model [USBPSTN1.2]
- CDC_COMM_SUBCLASS_MULTICHANNEL_CONTROL_MODEL , ///< Multi-Channel Control Model [USBISDN1.2]
- CDC_COMM_SUBCLASS_CAPI_CONTROL_MODEL , ///< CAPI Control Model [USBISDN1.2]
- CDC_COMM_SUBCLASS_ETHERNET_CONTROL_MODEL , ///< Ethernet Networking Control Model [USBECM1.2]
- CDC_COMM_SUBCLASS_ATM_NETWORKING_CONTROL_MODEL , ///< ATM Networking Control Model [USBATM1.2]
- CDC_COMM_SUBCLASS_WIRELESS_HANDSET_CONTROL_MODEL , ///< Wireless Handset Control Model [USBWMC1.1]
- CDC_COMM_SUBCLASS_DEVICE_MANAGEMENT , ///< Device Management [USBWMC1.1]
- CDC_COMM_SUBCLASS_MOBILE_DIRECT_LINE_MODEL , ///< Mobile Direct Line Model [USBWMC1.1]
- CDC_COMM_SUBCLASS_OBEX , ///< OBEX [USBWMC1.1]
- CDC_COMM_SUBCLASS_ETHERNET_EMULATION_MODEL ///< Ethernet Emulation Model [USBEEM1.0]
-} cdc_comm_sublcass_type_t;
-
-/// Communication Interface Protocol Codes
-typedef enum
-{
- CDC_COMM_PROTOCOL_NONE = 0x00 , ///< No specific protocol
- CDC_COMM_PROTOCOL_ATCOMMAND , ///< AT Commands: V.250 etc
- CDC_COMM_PROTOCOL_ATCOMMAND_PCCA_101 , ///< AT Commands defined by PCCA-101
- CDC_COMM_PROTOCOL_ATCOMMAND_PCCA_101_AND_ANNEXO , ///< AT Commands defined by PCCA-101 & Annex O
- CDC_COMM_PROTOCOL_ATCOMMAND_GSM_707 , ///< AT Commands defined by GSM 07.07
- CDC_COMM_PROTOCOL_ATCOMMAND_3GPP_27007 , ///< AT Commands defined by 3GPP 27.007
- CDC_COMM_PROTOCOL_ATCOMMAND_CDMA , ///< AT Commands defined by TIA for CDMA
- CDC_COMM_PROTOCOL_ETHERNET_EMULATION_MODEL ///< Ethernet Emulation Model
-} cdc_comm_protocol_type_t;
-
-//------------- SubType Descriptor in COMM Functional Descriptor -------------//
-/// Communication Interface SubType Descriptor
-typedef enum
-{
- CDC_FUNC_DESC_HEADER = 0x00 , ///< Header Functional Descriptor, which marks the beginning of the concatenated set of functional descriptors for the interface.
- CDC_FUNC_DESC_CALL_MANAGEMENT = 0x01 , ///< Call Management Functional Descriptor.
- CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT = 0x02 , ///< Abstract Control Management Functional Descriptor.
- CDC_FUNC_DESC_DIRECT_LINE_MANAGEMENT = 0x03 , ///< Direct Line Management Functional Descriptor.
- CDC_FUNC_DESC_TELEPHONE_RINGER = 0x04 , ///< Telephone Ringer Functional Descriptor.
- CDC_FUNC_DESC_TELEPHONE_CALL_AND_LINE_STATE_REPORTING_CAPACITY = 0x05 , ///< Telephone Call and Line State Reporting Capabilities Functional Descriptor.
- CDC_FUNC_DESC_UNION = 0x06 , ///< Union Functional Descriptor
- CDC_FUNC_DESC_COUNTRY_SELECTION = 0x07 , ///< Country Selection Functional Descriptor
- CDC_FUNC_DESC_TELEPHONE_OPERATIONAL_MODES = 0x08 , ///< Telephone Operational ModesFunctional Descriptor
- CDC_FUNC_DESC_USB_TERMINAL = 0x09 , ///< USB Terminal Functional Descriptor
- CDC_FUNC_DESC_NETWORK_CHANNEL_TERMINAL = 0x0A , ///< Network Channel Terminal Descriptor
- CDC_FUNC_DESC_PROTOCOL_UNIT = 0x0B , ///< Protocol Unit Functional Descriptor
- CDC_FUNC_DESC_EXTENSION_UNIT = 0x0C , ///< Extension Unit Functional Descriptor
- CDC_FUNC_DESC_MULTICHANEL_MANAGEMENT = 0x0D , ///< Multi-Channel Management Functional Descriptor
- CDC_FUNC_DESC_CAPI_CONTROL_MANAGEMENT = 0x0E , ///< CAPI Control Management Functional Descriptor
- CDC_FUNC_DESC_ETHERNET_NETWORKING = 0x0F , ///< Ethernet Networking Functional Descriptor
- CDC_FUNC_DESC_ATM_NETWORKING = 0x10 , ///< ATM Networking Functional Descriptor
- CDC_FUNC_DESC_WIRELESS_HANDSET_CONTROL_MODEL = 0x11 , ///< Wireless Handset Control Model Functional Descriptor
- CDC_FUNC_DESC_MOBILE_DIRECT_LINE_MODEL = 0x12 , ///< Mobile Direct Line Model Functional Descriptor
- CDC_FUNC_DESC_MOBILE_DIRECT_LINE_MODEL_DETAIL = 0x13 , ///< MDLM Detail Functional Descriptor
- CDC_FUNC_DESC_DEVICE_MANAGEMENT_MODEL = 0x14 , ///< Device Management Model Functional Descriptor
- CDC_FUNC_DESC_OBEX = 0x15 , ///< OBEX Functional Descriptor
- CDC_FUNC_DESC_COMMAND_SET = 0x16 , ///< Command Set Functional Descriptor
- CDC_FUNC_DESC_COMMAND_SET_DETAIL = 0x17 , ///< Command Set Detail Functional Descriptor
- CDC_FUNC_DESC_TELEPHONE_CONTROL_MODEL = 0x18 , ///< Telephone Control Model Functional Descriptor
- CDC_FUNC_DESC_OBEX_SERVICE_IDENTIFIER = 0x19 ///< OBEX Service Identifier Functional Descriptor
-}cdc_func_desc_type_t;
-
-//--------------------------------------------------------------------+
-// CDC Data Interface Class
-//--------------------------------------------------------------------+
-
-// SUBCLASS code of Data Interface is not used and should/must be zero
-/// Data Interface Protocol Codes
-typedef enum{
- CDC_DATA_PROTOCOL_ISDN_BRI = 0x30, ///< Physical interface protocol for ISDN BRI
- CDC_DATA_PROTOCOL_HDLC = 0x31, ///< HDLC
- CDC_DATA_PROTOCOL_TRANSPARENT = 0x32, ///< Transparent
- CDC_DATA_PROTOCOL_Q921_MANAGEMENT = 0x50, ///< Management protocol for Q.921 data link protocol
- CDC_DATA_PROTOCOL_Q921_DATA_LINK = 0x51, ///< Data link protocol for Q.931
- CDC_DATA_PROTOCOL_Q921_TEI_MULTIPLEXOR = 0x52, ///< TEI-multiplexor for Q.921 data link protocol
- CDC_DATA_PROTOCOL_V42BIS_DATA_COMPRESSION = 0x90, ///< Data compression procedures
- CDC_DATA_PROTOCOL_EURO_ISDN = 0x91, ///< Euro-ISDN protocol control
- CDC_DATA_PROTOCOL_V24_RATE_ADAPTION_TO_ISDN = 0x92, ///< V.24 rate adaptation to ISDN
- CDC_DATA_PROTOCOL_CAPI_COMMAND = 0x93, ///< CAPI Commands
- CDC_DATA_PROTOCOL_HOST_BASED_DRIVER = 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.
- CDC_DATA_PROTOCOL_IN_PROTOCOL_UNIT_FUNCTIONAL_DESCRIPTOR = 0xFE ///< The protocol(s) are described using a ProtocolUnit Functional Descriptors on Communications Class Interface
-}cdc_data_protocol_type_t;
-
-//--------------------------------------------------------------------+
-// Management Element Request (Control Endpoint)
-//--------------------------------------------------------------------+
-
-/// Communication Interface Management Element Request Codes
-typedef enum
-{
- CDC_REQUEST_SEND_ENCAPSULATED_COMMAND = 0x00, ///< is used to issue a command in the format of the supported control protocol of the Communications Class interface
- CDC_REQUEST_GET_ENCAPSULATED_RESPONSE = 0x01, ///< is used to request a response in the format of the supported control protocol of the Communications Class interface.
-
- CDC_REQUEST_SET_COMM_FEATURE = 0x02,
- CDC_REQUEST_GET_COMM_FEATURE = 0x03,
- CDC_REQUEST_CLEAR_COMM_FEATURE = 0x04,
-
- CDC_REQUEST_SET_AUX_LINE_STATE = 0x10,
- CDC_REQUEST_SET_HOOK_STATE = 0x11,
- CDC_REQUEST_PULSE_SETUP = 0x12,
- CDC_REQUEST_SEND_PULSE = 0x13,
- CDC_REQUEST_SET_PULSE_TIME = 0x14,
- CDC_REQUEST_RING_AUX_JACK = 0x15,
-
- CDC_REQUEST_SET_LINE_CODING = 0x20,
- CDC_REQUEST_GET_LINE_CODING = 0x21,
- CDC_REQUEST_SET_CONTROL_LINE_STATE = 0x22,
- CDC_REQUEST_SEND_BREAK = 0x23,
-
- CDC_REQUEST_SET_RINGER_PARMS = 0x30,
- CDC_REQUEST_GET_RINGER_PARMS = 0x31,
- CDC_REQUEST_SET_OPERATION_PARMS = 0x32,
- CDC_REQUEST_GET_OPERATION_PARMS = 0x33,
- CDC_REQUEST_SET_LINE_PARMS = 0x34,
- CDC_REQUEST_GET_LINE_PARMS = 0x35,
- CDC_REQUEST_DIAL_DIGITS = 0x36,
- CDC_REQUEST_SET_UNIT_PARAMETER = 0x37,
- CDC_REQUEST_GET_UNIT_PARAMETER = 0x38,
- CDC_REQUEST_CLEAR_UNIT_PARAMETER = 0x39,
- CDC_REQUEST_GET_PROFILE = 0x3A,
-
- CDC_REQUEST_SET_ETHERNET_MULTICAST_FILTERS = 0x40,
- CDC_REQUEST_SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER = 0x41,
- CDC_REQUEST_GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER = 0x42,
- CDC_REQUEST_SET_ETHERNET_PACKET_FILTER = 0x43,
- CDC_REQUEST_GET_ETHERNET_STATISTIC = 0x44,
-
- CDC_REQUEST_SET_ATM_DATA_FORMAT = 0x50,
- CDC_REQUEST_GET_ATM_DEVICE_STATISTICS = 0x51,
- CDC_REQUEST_SET_ATM_DEFAULT_VC = 0x52,
- CDC_REQUEST_GET_ATM_VC_STATISTICS = 0x53,
-
- CDC_REQUEST_MDLM_SEMANTIC_MODEL = 0x60,
-}cdc_management_request_t;
-
-//--------------------------------------------------------------------+
-// Management Elemenent Notification (Notification Endpoint)
-//--------------------------------------------------------------------+
-
-/// Communication Interface Management Element Notification Codes
-typedef enum
-{
- NETWORK_CONNECTION = 0x00, ///< This notification allows the device to notify the host about network connection status.
- RESPONSE_AVAILABLE = 0x01, ///< This notification allows the device to notify the hostthat a response is available. This response can be retrieved with a subsequent \ref CDC_REQUEST_GET_ENCAPSULATED_RESPONSE request.
-
- AUX_JACK_HOOK_STATE = 0x08,
- RING_DETECT = 0x09,
-
- SERIAL_STATE = 0x20,
-
- CALL_STATE_CHANGE = 0x28,
- LINE_STATE_CHANGE = 0x29,
- CONNECTION_SPEED_CHANGE = 0x2A, ///< This notification allows the device to inform the host-networking driver that a change in either the upstream or the downstream bit rate of the connection has occurred
- MDLM_SEMANTIC_MODEL_NOTIFICATION = 0x40,
-}cdc_notification_request_t;
-
-//--------------------------------------------------------------------+
-// Class Specific Functional Descriptor (Communication Interface)
-//--------------------------------------------------------------------+
-
-// Start of all packed definitions for compiler without per-type packed
-TU_ATTR_PACKED_BEGIN
-TU_ATTR_BIT_FIELD_ORDER_BEGIN
-
-/// Header Functional Descriptor (Communication Interface)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUNC_DESC_
- uint16_t bcdCDC ; ///< CDC release number in Binary-Coded Decimal
-}cdc_desc_func_header_t;
-
-/// Union Functional Descriptor (Communication Interface)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
- uint8_t bControlInterface ; ///< Interface number of Communication Interface
- uint8_t bSubordinateInterface ; ///< Array of Interface number of Data Interface
-}cdc_desc_func_union_t;
-
-#define cdc_desc_func_union_n_t(no_slave)\
- struct TU_ATTR_PACKED { \
- uint8_t bLength ;\
- uint8_t bDescriptorType ;\
- uint8_t bDescriptorSubType ;\
- uint8_t bControlInterface ;\
- uint8_t bSubordinateInterface[no_slave] ;\
-}
-
-/// Country Selection Functional Descriptor (Communication Interface)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
- uint8_t iCountryCodeRelDate ; ///< Index of a string giving the release date for the implemented ISO 3166 Country Codes.
- uint16_t wCountryCode ; ///< Country code in the format as defined in [ISO3166], release date as specified inoffset 3 for the first supported country.
-}cdc_desc_func_country_selection_t;
-
-#define cdc_desc_func_country_selection_n_t(no_country) \
- struct TU_ATTR_PACKED { \
- uint8_t bLength ;\
- uint8_t bDescriptorType ;\
- uint8_t bDescriptorSubType ;\
- uint8_t iCountryCodeRelDate ;\
- uint16_t wCountryCode[no_country] ;\
-}
-
-//--------------------------------------------------------------------+
-// PUBLIC SWITCHED TELEPHONE NETWORK (PSTN) SUBCLASS
-//--------------------------------------------------------------------+
-
-/// \brief Call Management Functional Descriptor
-/// \details This functional descriptor describes the processing of calls for the Communications Class interface.
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
-
- struct {
- uint8_t handle_call : 1; ///< 0 - Device sends/receives call management information only over the Communications Class interface. 1 - Device can send/receive call management information over a Data Class interface.
- uint8_t send_recv_call : 1; ///< 0 - Device does not handle call management itself. 1 - Device handles call management itself.
- uint8_t TU_RESERVED : 6;
- } bmCapabilities;
-
- uint8_t bDataInterface;
-}cdc_desc_func_call_management_t;
-
-typedef struct TU_ATTR_PACKED
-{
- uint8_t support_comm_request : 1; ///< Device supports the request combination of Set_Comm_Feature, Clear_Comm_Feature, and Get_Comm_Feature.
- uint8_t support_line_request : 1; ///< Device supports the request combination of Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and the notification Serial_State.
- uint8_t support_send_break : 1; ///< Device supports the request Send_Break
- uint8_t support_notification_network_connection : 1; ///< Device supports the notification Network_Connection.
- uint8_t TU_RESERVED : 4;
-}cdc_acm_capability_t;
-
-TU_VERIFY_STATIC(sizeof(cdc_acm_capability_t) == 1, "mostly problem with compiler");
-
-/// Abstract Control Management Functional Descriptor
-/// This functional descriptor describes the commands supported by by the Communications Class interface with SubClass code of \ref CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
- cdc_acm_capability_t bmCapabilities ;
-}cdc_desc_func_acm_t;
-
-/// \brief Direct Line Management Functional Descriptor
-/// \details This functional descriptor describes the commands supported by the Communications Class interface with SubClass code of \ref CDC_FUNC_DESC_DIRECT_LINE_MANAGEMENT
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
- struct {
- uint8_t require_pulse_setup : 1; ///< Device requires extra Pulse_Setup request during pulse dialing sequence to disengage holding circuit.
- uint8_t support_aux_request : 1; ///< Device supports the request combination of Set_Aux_Line_State, Ring_Aux_Jack, and notification Aux_Jack_Hook_State.
- uint8_t support_pulse_request : 1; ///< Device supports the request combination of Pulse_Setup, Send_Pulse, and Set_Pulse_Time.
- uint8_t TU_RESERVED : 5;
- } bmCapabilities;
-}cdc_desc_func_direct_line_management_t;
-
-/// \brief Telephone Ringer Functional Descriptor
-/// \details The Telephone Ringer functional descriptor describes the ringer capabilities supported by the Communications Class interface,
-/// with the SubClass code of \ref CDC_COMM_SUBCLASS_TELEPHONE_CONTROL_MODEL
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
- uint8_t bRingerVolSteps ;
- uint8_t bNumRingerPatterns ;
-}cdc_desc_func_telephone_ringer_t;
-
-/// \brief Telephone Operational Modes Functional Descriptor
-/// \details The Telephone Operational Modes functional descriptor describes the operational modes supported by
-/// the Communications Class interface, with the SubClass code of \ref CDC_COMM_SUBCLASS_TELEPHONE_CONTROL_MODEL
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
- struct {
- uint8_t simple_mode : 1;
- uint8_t standalone_mode : 1;
- uint8_t computer_centric_mode : 1;
- uint8_t TU_RESERVED : 5;
- } bmCapabilities;
-}cdc_desc_func_telephone_operational_modes_t;
-
-/// \brief Telephone Call and Line State Reporting Capabilities Descriptor
-/// \details The Telephone Call and Line State Reporting Capabilities functional descriptor describes the abilities of a
-/// telephone device to report optional call and line states.
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
- struct {
- uint32_t interrupted_dialtone : 1; ///< 0 : Reports only dialtone (does not differentiate between normal and interrupted dialtone). 1 : Reports interrupted dialtone in addition to normal dialtone
- uint32_t ringback_busy_fastbusy : 1; ///< 0 : Reports only dialing state. 1 : Reports ringback, busy, and fast busy states.
- uint32_t caller_id : 1; ///< 0 : Does not report caller ID. 1 : Reports caller ID information.
- uint32_t incoming_distinctive : 1; ///< 0 : Reports only incoming ringing. 1 : Reports incoming distinctive ringing patterns.
- uint32_t dual_tone_multi_freq : 1; ///< 0 : Cannot report dual tone multi-frequency (DTMF) digits input remotely over the telephone line. 1 : Can report DTMF digits input remotely over the telephone line.
- uint32_t line_state_change : 1; ///< 0 : Does not support line state change notification. 1 : Does support line state change notification
- uint32_t TU_RESERVED : 26;
- } bmCapabilities;
-}cdc_desc_func_telephone_call_state_reporting_capabilities_t;
-
-// TODO remove
-static inline uint8_t cdc_functional_desc_typeof(uint8_t const * p_desc)
-{
- return p_desc[2];
-}
-
-//--------------------------------------------------------------------+
-// Requests
-//--------------------------------------------------------------------+
-typedef struct TU_ATTR_PACKED
-{
- uint32_t bit_rate;
- uint8_t stop_bits; ///< 0: 1 stop bit - 1: 1.5 stop bits - 2: 2 stop bits
- uint8_t parity; ///< 0: None - 1: Odd - 2: Even - 3: Mark - 4: Space
- uint8_t data_bits; ///< can be 5, 6, 7, 8 or 16
-} cdc_line_coding_t;
-
-TU_VERIFY_STATIC(sizeof(cdc_line_coding_t) == 7, "size is not correct");
-
-typedef struct TU_ATTR_PACKED
-{
- uint16_t dte_is_present : 1; ///< Indicates to DCE if DTE is presentor not. This signal corresponds to V.24 signal 108/2 and RS-232 signal DTR.
- uint16_t half_duplex_carrier_control : 1;
- uint16_t : 14;
-} cdc_line_control_state_t;
-
-TU_VERIFY_STATIC(sizeof(cdc_line_control_state_t) == 2, "size is not correct");
-
-TU_ATTR_PACKED_END // End of all packed definitions
-TU_ATTR_BIT_FIELD_ORDER_END
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
-
-/** @} */
diff --git a/tinyusb/src/class/cdc/cdc_device.c b/tinyusb/src/class/cdc/cdc_device.c
deleted file mode 100755
index e622bd61..00000000
--- a/tinyusb/src/class/cdc/cdc_device.c
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_CDC)
-
-#include "device/usbd.h"
-#include "device/usbd_pvt.h"
-
-#include "cdc_device.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-enum
-{
- BULK_PACKET_SIZE = (TUD_OPT_HIGH_SPEED ? 512 : 64)
-};
-
-typedef struct
-{
- uint8_t itf_num;
- uint8_t ep_notif;
- uint8_t ep_in;
- uint8_t ep_out;
-
- // Bit 0: DTR (Data Terminal Ready), Bit 1: RTS (Request to Send)
- uint8_t line_state;
-
- /*------------- From this point, data is not cleared by bus reset -------------*/
- char wanted_char;
- cdc_line_coding_t line_coding;
-
- // FIFO
- tu_fifo_t rx_ff;
- tu_fifo_t tx_ff;
-
- uint8_t rx_ff_buf[CFG_TUD_CDC_RX_BUFSIZE];
- uint8_t tx_ff_buf[CFG_TUD_CDC_TX_BUFSIZE];
-
-#if CFG_FIFO_MUTEX
- osal_mutex_def_t rx_ff_mutex;
- osal_mutex_def_t tx_ff_mutex;
-#endif
-
- // Endpoint Transfer buffer
- CFG_TUSB_MEM_ALIGN uint8_t epout_buf[CFG_TUD_CDC_EP_BUFSIZE];
- CFG_TUSB_MEM_ALIGN uint8_t epin_buf[CFG_TUD_CDC_EP_BUFSIZE];
-
-}cdcd_interface_t;
-
-#define ITF_MEM_RESET_SIZE offsetof(cdcd_interface_t, wanted_char)
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-CFG_TUSB_MEM_SECTION static cdcd_interface_t _cdcd_itf[CFG_TUD_CDC];
-
-static void _prep_out_transaction (cdcd_interface_t* p_cdc)
-{
- uint8_t const rhport = TUD_OPT_RHPORT;
- uint16_t available = tu_fifo_remaining(&p_cdc->rx_ff);
-
- // Prepare for incoming data but only allow what we can store in the ring buffer.
- // TODO Actually we can still carry out the transfer, keeping count of received bytes
- // and slowly move it to the FIFO when read().
- // This pre-check reduces endpoint claiming
- TU_VERIFY(available >= sizeof(p_cdc->epout_buf), );
-
- // claim endpoint
- TU_VERIFY(usbd_edpt_claim(rhport, p_cdc->ep_out), );
-
- // fifo can be changed before endpoint is claimed
- available = tu_fifo_remaining(&p_cdc->rx_ff);
-
- if ( available >= sizeof(p_cdc->epout_buf) )
- {
- usbd_edpt_xfer(rhport, p_cdc->ep_out, p_cdc->epout_buf, sizeof(p_cdc->epout_buf));
- }else
- {
- // Release endpoint since we don't make any transfer
- usbd_edpt_release(rhport, p_cdc->ep_out);
- }
-}
-
-//--------------------------------------------------------------------+
-// APPLICATION API
-//--------------------------------------------------------------------+
-bool tud_cdc_n_connected(uint8_t itf)
-{
- // DTR (bit 0) active is considered as connected
- return tud_ready() && tu_bit_test(_cdcd_itf[itf].line_state, 0);
-}
-
-uint8_t tud_cdc_n_get_line_state (uint8_t itf)
-{
- return _cdcd_itf[itf].line_state;
-}
-
-void tud_cdc_n_get_line_coding (uint8_t itf, cdc_line_coding_t* coding)
-{
- (*coding) = _cdcd_itf[itf].line_coding;
-}
-
-void tud_cdc_n_set_wanted_char (uint8_t itf, char wanted)
-{
- _cdcd_itf[itf].wanted_char = wanted;
-}
-
-
-//--------------------------------------------------------------------+
-// READ API
-//--------------------------------------------------------------------+
-uint32_t tud_cdc_n_available(uint8_t itf)
-{
- return tu_fifo_count(&_cdcd_itf[itf].rx_ff);
-}
-
-uint32_t tud_cdc_n_read(uint8_t itf, void* buffer, uint32_t bufsize)
-{
- cdcd_interface_t* p_cdc = &_cdcd_itf[itf];
- uint32_t num_read = tu_fifo_read_n(&p_cdc->rx_ff, buffer, bufsize);
- _prep_out_transaction(p_cdc);
- return num_read;
-}
-
-bool tud_cdc_n_peek(uint8_t itf, uint8_t* chr)
-{
- return tu_fifo_peek(&_cdcd_itf[itf].rx_ff, chr);
-}
-
-void tud_cdc_n_read_flush (uint8_t itf)
-{
- cdcd_interface_t* p_cdc = &_cdcd_itf[itf];
- tu_fifo_clear(&p_cdc->rx_ff);
- _prep_out_transaction(p_cdc);
-}
-
-//--------------------------------------------------------------------+
-// WRITE API
-//--------------------------------------------------------------------+
-uint32_t tud_cdc_n_write(uint8_t itf, void const* buffer, uint32_t bufsize)
-{
- cdcd_interface_t* p_cdc = &_cdcd_itf[itf];
- uint16_t ret = tu_fifo_write_n(&p_cdc->tx_ff, buffer, bufsize);
-
- // flush if queue more than packet size
- if ( tu_fifo_count(&p_cdc->tx_ff) >= BULK_PACKET_SIZE )
- {
- tud_cdc_n_write_flush(itf);
- }
-
- return ret;
-}
-
-uint32_t tud_cdc_n_write_flush (uint8_t itf)
-{
- cdcd_interface_t* p_cdc = &_cdcd_itf[itf];
-
- // Skip if usb is not ready yet
- TU_VERIFY( tud_ready(), 0 );
-
- // No data to send
- if ( !tu_fifo_count(&p_cdc->tx_ff) ) return 0;
-
- uint8_t const rhport = TUD_OPT_RHPORT;
-
- // Claim the endpoint
- TU_VERIFY( usbd_edpt_claim(rhport, p_cdc->ep_in), 0 );
-
- // Pull data from FIFO
- uint16_t const count = tu_fifo_read_n(&p_cdc->tx_ff, p_cdc->epin_buf, sizeof(p_cdc->epin_buf));
-
- if ( count )
- {
- TU_ASSERT( usbd_edpt_xfer(rhport, p_cdc->ep_in, p_cdc->epin_buf, count), 0 );
- return count;
- }else
- {
- // Release endpoint since we don't make any transfer
- // Note: data is dropped if terminal is not connected
- usbd_edpt_release(rhport, p_cdc->ep_in);
- return 0;
- }
-}
-
-uint32_t tud_cdc_n_write_available (uint8_t itf)
-{
- return tu_fifo_remaining(&_cdcd_itf[itf].tx_ff);
-}
-
-bool tud_cdc_n_write_clear (uint8_t itf)
-{
- return tu_fifo_clear(&_cdcd_itf[itf].tx_ff);
-}
-
-//--------------------------------------------------------------------+
-// USBD Driver API
-//--------------------------------------------------------------------+
-void cdcd_init(void)
-{
- tu_memclr(_cdcd_itf, sizeof(_cdcd_itf));
-
- for(uint8_t i=0; i<CFG_TUD_CDC; i++)
- {
- cdcd_interface_t* p_cdc = &_cdcd_itf[i];
-
- p_cdc->wanted_char = -1;
-
- // default line coding is : stop bit = 1, parity = none, data bits = 8
- p_cdc->line_coding.bit_rate = 115200;
- p_cdc->line_coding.stop_bits = 0;
- p_cdc->line_coding.parity = 0;
- p_cdc->line_coding.data_bits = 8;
-
- // Config RX fifo
- tu_fifo_config(&p_cdc->rx_ff, p_cdc->rx_ff_buf, TU_ARRAY_SIZE(p_cdc->rx_ff_buf), 1, false);
-
- // Config TX fifo as overwritable at initialization and will be changed to non-overwritable
- // if terminal supports DTR bit. Without DTR we do not know if data is actually polled by terminal.
- // In this way, the most current data is prioritized.
- tu_fifo_config(&p_cdc->tx_ff, p_cdc->tx_ff_buf, TU_ARRAY_SIZE(p_cdc->tx_ff_buf), 1, true);
-
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&p_cdc->rx_ff, NULL, osal_mutex_create(&p_cdc->rx_ff_mutex));
- tu_fifo_config_mutex(&p_cdc->tx_ff, osal_mutex_create(&p_cdc->tx_ff_mutex), NULL);
-#endif
- }
-}
-
-void cdcd_reset(uint8_t rhport)
-{
- (void) rhport;
-
- for(uint8_t i=0; i<CFG_TUD_CDC; i++)
- {
- cdcd_interface_t* p_cdc = &_cdcd_itf[i];
-
- tu_memclr(p_cdc, ITF_MEM_RESET_SIZE);
- tu_fifo_clear(&p_cdc->rx_ff);
- tu_fifo_clear(&p_cdc->tx_ff);
- tu_fifo_set_overwritable(&p_cdc->tx_ff, true);
- }
-}
-
-uint16_t cdcd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len)
-{
- // Only support ACM subclass
- TU_VERIFY( TUSB_CLASS_CDC == itf_desc->bInterfaceClass &&
- CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL == itf_desc->bInterfaceSubClass, 0);
-
- // Find available interface
- cdcd_interface_t * p_cdc = NULL;
- for(uint8_t cdc_id=0; cdc_id<CFG_TUD_CDC; cdc_id++)
- {
- if ( _cdcd_itf[cdc_id].ep_in == 0 )
- {
- p_cdc = &_cdcd_itf[cdc_id];
- break;
- }
- }
- TU_ASSERT(p_cdc, 0);
-
- //------------- Control Interface -------------//
- p_cdc->itf_num = itf_desc->bInterfaceNumber;
-
- uint16_t drv_len = sizeof(tusb_desc_interface_t);
- uint8_t const * p_desc = tu_desc_next( itf_desc );
-
- // Communication Functional Descriptors
- while ( TUSB_DESC_CS_INTERFACE == tu_desc_type(p_desc) && drv_len <= max_len )
- {
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
- }
-
- if ( TUSB_DESC_ENDPOINT == tu_desc_type(p_desc) )
- {
- // notification endpoint
- tusb_desc_endpoint_t const * desc_ep = (tusb_desc_endpoint_t const *) p_desc;
-
- TU_ASSERT( usbd_edpt_open(rhport, desc_ep), 0 );
- p_cdc->ep_notif = desc_ep->bEndpointAddress;
-
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
- }
-
- //------------- Data Interface (if any) -------------//
- if ( (TUSB_DESC_INTERFACE == tu_desc_type(p_desc)) &&
- (TUSB_CLASS_CDC_DATA == ((tusb_desc_interface_t const *) p_desc)->bInterfaceClass) )
- {
- // next to endpoint descriptor
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
-
- // Open endpoint pair
- TU_ASSERT( usbd_open_edpt_pair(rhport, p_desc, 2, TUSB_XFER_BULK, &p_cdc->ep_out, &p_cdc->ep_in), 0 );
-
- drv_len += 2*sizeof(tusb_desc_endpoint_t);
- }
-
- // Prepare for incoming data
- _prep_out_transaction(p_cdc);
-
- return drv_len;
-}
-
-// Invoked when a control transfer occurred on an interface of this class
-// Driver response accordingly to the request and the transfer stage (setup/data/ack)
-// return false to stall control endpoint (e.g unsupported request)
-bool cdcd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
-{
- // Handle class request only
- TU_VERIFY(request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS);
-
- uint8_t itf = 0;
- cdcd_interface_t* p_cdc = _cdcd_itf;
-
- // Identify which interface to use
- for ( ; ; itf++, p_cdc++)
- {
- if (itf >= TU_ARRAY_SIZE(_cdcd_itf)) return false;
-
- if ( p_cdc->itf_num == request->wIndex ) break;
- }
-
- switch ( request->bRequest )
- {
- case CDC_REQUEST_SET_LINE_CODING:
- if (stage == CONTROL_STAGE_SETUP)
- {
- TU_LOG2(" Set Line Coding\r\n");
- tud_control_xfer(rhport, request, &p_cdc->line_coding, sizeof(cdc_line_coding_t));
- }
- else if ( stage == CONTROL_STAGE_ACK)
- {
- if ( tud_cdc_line_coding_cb ) tud_cdc_line_coding_cb(itf, &p_cdc->line_coding);
- }
- break;
-
- case CDC_REQUEST_GET_LINE_CODING:
- if (stage == CONTROL_STAGE_SETUP)
- {
- TU_LOG2(" Get Line Coding\r\n");
- tud_control_xfer(rhport, request, &p_cdc->line_coding, sizeof(cdc_line_coding_t));
- }
- break;
-
- case CDC_REQUEST_SET_CONTROL_LINE_STATE:
- if (stage == CONTROL_STAGE_SETUP)
- {
- tud_control_status(rhport, request);
- }
- else if (stage == CONTROL_STAGE_ACK)
- {
- // CDC PSTN v1.2 section 6.3.12
- // Bit 0: Indicates if DTE is present or not.
- // This signal corresponds to V.24 signal 108/2 and RS-232 signal DTR (Data Terminal Ready)
- // Bit 1: Carrier control for half-duplex modems.
- // This signal corresponds to V.24 signal 105 and RS-232 signal RTS (Request to Send)
- bool const dtr = tu_bit_test(request->wValue, 0);
- bool const rts = tu_bit_test(request->wValue, 1);
-
- p_cdc->line_state = (uint8_t) request->wValue;
-
- // Disable fifo overwriting if DTR bit is set
- tu_fifo_set_overwritable(&p_cdc->tx_ff, !dtr);
-
- TU_LOG2(" Set Control Line State: DTR = %d, RTS = %d\r\n", dtr, rts);
-
- // Invoke callback
- if ( tud_cdc_line_state_cb ) tud_cdc_line_state_cb(itf, dtr, rts);
- }
- break;
- case CDC_REQUEST_SEND_BREAK:
- if (stage == CONTROL_STAGE_SETUP)
- {
- tud_control_status(rhport, request);
- }
- else if (stage == CONTROL_STAGE_ACK)
- {
- TU_LOG2(" Send Break\r\n");
- if ( tud_cdc_send_break_cb ) tud_cdc_send_break_cb(itf, request->wValue);
- }
- break;
-
- default: return false; // stall unsupported request
- }
-
- return true;
-}
-
-bool cdcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
-{
- (void) result;
-
- uint8_t itf;
- cdcd_interface_t* p_cdc;
-
- // Identify which interface to use
- for (itf = 0; itf < CFG_TUD_CDC; itf++)
- {
- p_cdc = &_cdcd_itf[itf];
- if ( ( ep_addr == p_cdc->ep_out ) || ( ep_addr == p_cdc->ep_in ) ) break;
- }
- TU_ASSERT(itf < CFG_TUD_CDC);
-
- // Received new data
- if ( ep_addr == p_cdc->ep_out )
- {
- tu_fifo_write_n(&p_cdc->rx_ff, &p_cdc->epout_buf, xferred_bytes);
-
- // Check for wanted char and invoke callback if needed
- if ( tud_cdc_rx_wanted_cb && (((signed char) p_cdc->wanted_char) != -1) )
- {
- for ( uint32_t i = 0; i < xferred_bytes; i++ )
- {
- if ( (p_cdc->wanted_char == p_cdc->epout_buf[i]) && !tu_fifo_empty(&p_cdc->rx_ff) )
- {
- tud_cdc_rx_wanted_cb(itf, p_cdc->wanted_char);
- }
- }
- }
-
- // invoke receive callback (if there is still data)
- if (tud_cdc_rx_cb && !tu_fifo_empty(&p_cdc->rx_ff) ) tud_cdc_rx_cb(itf);
-
- // prepare for OUT transaction
- _prep_out_transaction(p_cdc);
- }
-
- // Data sent to host, we continue to fetch from tx fifo to send.
- // Note: This will cause incorrect baudrate set in line coding.
- // Though maybe the baudrate is not really important !!!
- if ( ep_addr == p_cdc->ep_in )
- {
- // invoke transmit callback to possibly refill tx fifo
- if ( tud_cdc_tx_complete_cb ) tud_cdc_tx_complete_cb(itf);
-
- if ( 0 == tud_cdc_n_write_flush(itf) )
- {
- // If there is no data left, a ZLP should be sent if
- // xferred_bytes is multiple of EP Packet size and not zero
- if ( !tu_fifo_count(&p_cdc->tx_ff) && xferred_bytes && (0 == (xferred_bytes & (BULK_PACKET_SIZE-1))) )
- {
- if ( usbd_edpt_claim(rhport, p_cdc->ep_in) )
- {
- usbd_edpt_xfer(rhport, p_cdc->ep_in, NULL, 0);
- }
- }
- }
- }
-
- // nothing to do with notif endpoint for now
-
- return true;
-}
-
-#endif
diff --git a/tinyusb/src/class/cdc/cdc_device.h b/tinyusb/src/class/cdc/cdc_device.h
deleted file mode 100755
index 7ff757ad..00000000
--- a/tinyusb/src/class/cdc/cdc_device.h
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_CDC_DEVICE_H_
-#define _TUSB_CDC_DEVICE_H_
-
-#include "common/tusb_common.h"
-#include "cdc.h"
-
-//--------------------------------------------------------------------+
-// Class Driver Configuration
-//--------------------------------------------------------------------+
-#if !defined(CFG_TUD_CDC_EP_BUFSIZE) && defined(CFG_TUD_CDC_EPSIZE)
- #warning CFG_TUD_CDC_EPSIZE is renamed to CFG_TUD_CDC_EP_BUFSIZE, please update to use the new name
- #define CFG_TUD_CDC_EP_BUFSIZE CFG_TUD_CDC_EPSIZE
-#endif
-
-#ifndef CFG_TUD_CDC_EP_BUFSIZE
- #define CFG_TUD_CDC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-#endif
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/** \addtogroup CDC_Serial Serial
- * @{
- * \defgroup CDC_Serial_Device Device
- * @{ */
-
-//--------------------------------------------------------------------+
-// Application API (Multiple Ports)
-// CFG_TUD_CDC > 1
-//--------------------------------------------------------------------+
-
-// Check if terminal is connected to this port
-bool tud_cdc_n_connected (uint8_t itf);
-
-// Get current line state. Bit 0: DTR (Data Terminal Ready), Bit 1: RTS (Request to Send)
-uint8_t tud_cdc_n_get_line_state (uint8_t itf);
-
-// Get current line encoding: bit rate, stop bits parity etc ..
-void tud_cdc_n_get_line_coding (uint8_t itf, cdc_line_coding_t* coding);
-
-// Set special character that will trigger tud_cdc_rx_wanted_cb() callback on receiving
-void tud_cdc_n_set_wanted_char (uint8_t itf, char wanted);
-
-// Get the number of bytes available for reading
-uint32_t tud_cdc_n_available (uint8_t itf);
-
-// Read received bytes
-uint32_t tud_cdc_n_read (uint8_t itf, void* buffer, uint32_t bufsize);
-
-// Read a byte, return -1 if there is none
-static inline
-int32_t tud_cdc_n_read_char (uint8_t itf);
-
-// Clear the received FIFO
-void tud_cdc_n_read_flush (uint8_t itf);
-
-// Get a byte from FIFO at the specified position without removing it
-bool tud_cdc_n_peek (uint8_t itf, uint8_t* u8);
-
-// Write bytes to TX FIFO, data may remain in the FIFO for a while
-uint32_t tud_cdc_n_write (uint8_t itf, void const* buffer, uint32_t bufsize);
-
-// Write a byte
-static inline
-uint32_t tud_cdc_n_write_char (uint8_t itf, char ch);
-
-// Write a null-terminated string
-static inline
-uint32_t tud_cdc_n_write_str (uint8_t itf, char const* str);
-
-// Force sending data if possible, return number of forced bytes
-uint32_t tud_cdc_n_write_flush (uint8_t itf);
-
-// Return the number of bytes (characters) available for writing to TX FIFO buffer in a single n_write operation.
-uint32_t tud_cdc_n_write_available (uint8_t itf);
-
-// Clear the transmit FIFO
-bool tud_cdc_n_write_clear (uint8_t itf);
-
-//--------------------------------------------------------------------+
-// Application API (Single Port)
-//--------------------------------------------------------------------+
-static inline bool tud_cdc_connected (void);
-static inline uint8_t tud_cdc_get_line_state (void);
-static inline void tud_cdc_get_line_coding (cdc_line_coding_t* coding);
-static inline void tud_cdc_set_wanted_char (char wanted);
-
-static inline uint32_t tud_cdc_available (void);
-static inline int32_t tud_cdc_read_char (void);
-static inline uint32_t tud_cdc_read (void* buffer, uint32_t bufsize);
-static inline void tud_cdc_read_flush (void);
-static inline bool tud_cdc_peek (uint8_t* u8);
-
-static inline uint32_t tud_cdc_write_char (char ch);
-static inline uint32_t tud_cdc_write (void const* buffer, uint32_t bufsize);
-static inline uint32_t tud_cdc_write_str (char const* str);
-static inline uint32_t tud_cdc_write_flush (void);
-static inline uint32_t tud_cdc_write_available (void);
-static inline bool tud_cdc_write_clear (void);
-
-//--------------------------------------------------------------------+
-// Application Callback API (weak is optional)
-//--------------------------------------------------------------------+
-
-// Invoked when received new data
-TU_ATTR_WEAK void tud_cdc_rx_cb(uint8_t itf);
-
-// Invoked when received `wanted_char`
-TU_ATTR_WEAK void tud_cdc_rx_wanted_cb(uint8_t itf, char wanted_char);
-
-// Invoked when space becomes available in TX buffer
-TU_ATTR_WEAK void tud_cdc_tx_complete_cb(uint8_t itf);
-
-// Invoked when line state DTR & RTS are changed via SET_CONTROL_LINE_STATE
-TU_ATTR_WEAK void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts);
-
-// Invoked when line coding is change via SET_LINE_CODING
-TU_ATTR_WEAK void tud_cdc_line_coding_cb(uint8_t itf, cdc_line_coding_t const* p_line_coding);
-
-// Invoked when received send break
-TU_ATTR_WEAK void tud_cdc_send_break_cb(uint8_t itf, uint16_t duration_ms);
-
-//--------------------------------------------------------------------+
-// Inline Functions
-//--------------------------------------------------------------------+
-static inline int32_t tud_cdc_n_read_char (uint8_t itf)
-{
- uint8_t ch;
- return tud_cdc_n_read(itf, &ch, 1) ? (int32_t) ch : -1;
-}
-
-static inline uint32_t tud_cdc_n_write_char(uint8_t itf, char ch)
-{
- return tud_cdc_n_write(itf, &ch, 1);
-}
-
-static inline uint32_t tud_cdc_n_write_str (uint8_t itf, char const* str)
-{
- return tud_cdc_n_write(itf, str, strlen(str));
-}
-
-static inline bool tud_cdc_connected (void)
-{
- return tud_cdc_n_connected(0);
-}
-
-static inline uint8_t tud_cdc_get_line_state (void)
-{
- return tud_cdc_n_get_line_state(0);
-}
-
-static inline void tud_cdc_get_line_coding (cdc_line_coding_t* coding)
-{
- tud_cdc_n_get_line_coding(0, coding);
-}
-
-static inline void tud_cdc_set_wanted_char (char wanted)
-{
- tud_cdc_n_set_wanted_char(0, wanted);
-}
-
-static inline uint32_t tud_cdc_available (void)
-{
- return tud_cdc_n_available(0);
-}
-
-static inline int32_t tud_cdc_read_char (void)
-{
- return tud_cdc_n_read_char(0);
-}
-
-static inline uint32_t tud_cdc_read (void* buffer, uint32_t bufsize)
-{
- return tud_cdc_n_read(0, buffer, bufsize);
-}
-
-static inline void tud_cdc_read_flush (void)
-{
- tud_cdc_n_read_flush(0);
-}
-
-static inline bool tud_cdc_peek (uint8_t* u8)
-{
- return tud_cdc_n_peek(0, u8);
-}
-
-static inline uint32_t tud_cdc_write_char (char ch)
-{
- return tud_cdc_n_write_char(0, ch);
-}
-
-static inline uint32_t tud_cdc_write (void const* buffer, uint32_t bufsize)
-{
- return tud_cdc_n_write(0, buffer, bufsize);
-}
-
-static inline uint32_t tud_cdc_write_str (char const* str)
-{
- return tud_cdc_n_write_str(0, str);
-}
-
-static inline uint32_t tud_cdc_write_flush (void)
-{
- return tud_cdc_n_write_flush(0);
-}
-
-static inline uint32_t tud_cdc_write_available(void)
-{
- return tud_cdc_n_write_available(0);
-}
-
-static inline bool tud_cdc_write_clear(void)
-{
- return tud_cdc_n_write_clear(0);
-}
-
-/** @} */
-/** @} */
-
-//--------------------------------------------------------------------+
-// INTERNAL USBD-CLASS DRIVER API
-//--------------------------------------------------------------------+
-void cdcd_init (void);
-void cdcd_reset (uint8_t rhport);
-uint16_t cdcd_open (uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
-bool cdcd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
-bool cdcd_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CDC_DEVICE_H_ */
diff --git a/tinyusb/src/class/cdc/cdc_host.c b/tinyusb/src/class/cdc/cdc_host.c
deleted file mode 100755
index e7eaf4d0..00000000
--- a/tinyusb/src/class/cdc/cdc_host.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_HOST_ENABLED && CFG_TUH_CDC)
-
-#include "host/usbh.h"
-#include "host/usbh_classdriver.h"
-
-#include "cdc_host.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-typedef struct {
- uint8_t itf_num;
- uint8_t itf_protocol;
-
- uint8_t ep_notif;
- uint8_t ep_in;
- uint8_t ep_out;
-
- cdc_acm_capability_t acm_capability;
-
-} cdch_data_t;
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-static cdch_data_t cdch_data[CFG_TUH_DEVICE_MAX];
-
-static inline cdch_data_t* get_itf(uint8_t dev_addr)
-{
- return &cdch_data[dev_addr-1];
-}
-
-bool tuh_cdc_mounted(uint8_t dev_addr)
-{
- cdch_data_t* cdc = get_itf(dev_addr);
- return cdc->ep_in && cdc->ep_out;
-}
-
-bool tuh_cdc_is_busy(uint8_t dev_addr, cdc_pipeid_t pipeid)
-{
- if ( !tuh_cdc_mounted(dev_addr) ) return false;
-
- cdch_data_t const * p_cdc = get_itf(dev_addr);
-
- switch (pipeid)
- {
- case CDC_PIPE_NOTIFICATION:
- return usbh_edpt_busy(dev_addr, p_cdc->ep_notif );
-
- case CDC_PIPE_DATA_IN:
- return usbh_edpt_busy(dev_addr, p_cdc->ep_in );
-
- case CDC_PIPE_DATA_OUT:
- return usbh_edpt_busy(dev_addr, p_cdc->ep_out );
-
- default:
- return false;
- }
-}
-
-//--------------------------------------------------------------------+
-// APPLICATION API (parameter validation needed)
-//--------------------------------------------------------------------+
-bool tuh_cdc_serial_is_mounted(uint8_t dev_addr)
-{
- // TODO consider all AT Command as serial candidate
- return tuh_cdc_mounted(dev_addr) &&
- (cdch_data[dev_addr-1].itf_protocol <= CDC_COMM_PROTOCOL_ATCOMMAND_CDMA);
-}
-
-bool tuh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool is_notify)
-{
- (void) is_notify;
- TU_VERIFY( tuh_cdc_mounted(dev_addr) );
- TU_VERIFY( p_data != NULL && length, TUSB_ERROR_INVALID_PARA);
-
- uint8_t const ep_out = cdch_data[dev_addr-1].ep_out;
- if ( usbh_edpt_busy(dev_addr, ep_out) ) return false;
-
- return usbh_edpt_xfer(dev_addr, ep_out, (void *) p_data, length);
-}
-
-bool tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify)
-{
- (void) is_notify;
- TU_VERIFY( tuh_cdc_mounted(dev_addr) );
- TU_VERIFY( p_buffer != NULL && length, TUSB_ERROR_INVALID_PARA);
-
- uint8_t const ep_in = cdch_data[dev_addr-1].ep_in;
- if ( usbh_edpt_busy(dev_addr, ep_in) ) return false;
-
- return usbh_edpt_xfer(dev_addr, ep_in, p_buffer, length);
-}
-
-bool tuh_cdc_set_control_line_state(uint8_t dev_addr, bool dtr, bool rts, tuh_control_complete_cb_t complete_cb)
-{
- cdch_data_t const * p_cdc = get_itf(dev_addr);
- tusb_control_request_t const request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_INTERFACE,
- .type = TUSB_REQ_TYPE_CLASS,
- .direction = TUSB_DIR_OUT
- },
- .bRequest = CDC_REQUEST_SET_CONTROL_LINE_STATE,
- .wValue = (rts ? 2 : 0) | (dtr ? 1 : 0),
- .wIndex = p_cdc->itf_num,
- .wLength = 0
- };
-
- TU_ASSERT( tuh_control_xfer(dev_addr, &request, NULL, complete_cb) );
- return true;
-}
-
-//--------------------------------------------------------------------+
-// USBH-CLASS DRIVER API
-//--------------------------------------------------------------------+
-void cdch_init(void)
-{
- tu_memclr(cdch_data, sizeof(cdch_data));
-}
-
-bool cdch_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *itf_desc, uint16_t max_len)
-{
- (void) max_len;
-
- // Only support ACM subclass
- // Protocol 0xFF can be RNDIS device for windows XP
- TU_VERIFY( TUSB_CLASS_CDC == itf_desc->bInterfaceClass &&
- CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL == itf_desc->bInterfaceSubClass &&
- 0xFF != itf_desc->bInterfaceProtocol);
-
- cdch_data_t * p_cdc = get_itf(dev_addr);
-
- p_cdc->itf_num = itf_desc->bInterfaceNumber;
- p_cdc->itf_protocol = itf_desc->bInterfaceProtocol;
-
- //------------- Communication Interface -------------//
- uint16_t drv_len = tu_desc_len(itf_desc);
- uint8_t const * p_desc = tu_desc_next(itf_desc);
-
- // Communication Functional Descriptors
- while( TUSB_DESC_CS_INTERFACE == tu_desc_type(p_desc) && drv_len <= max_len )
- {
- if ( CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT == cdc_functional_desc_typeof(p_desc) )
- {
- // save ACM bmCapabilities
- p_cdc->acm_capability = ((cdc_desc_func_acm_t const *) p_desc)->bmCapabilities;
- }
-
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
- }
-
- if ( TUSB_DESC_ENDPOINT == tu_desc_type(p_desc) )
- {
- // notification endpoint
- tusb_desc_endpoint_t const * desc_ep = (tusb_desc_endpoint_t const *) p_desc;
-
- TU_ASSERT( usbh_edpt_open(rhport, dev_addr, desc_ep) );
- p_cdc->ep_notif = desc_ep->bEndpointAddress;
-
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
- }
-
- //------------- Data Interface (if any) -------------//
- if ( (TUSB_DESC_INTERFACE == tu_desc_type(p_desc)) &&
- (TUSB_CLASS_CDC_DATA == ((tusb_desc_interface_t const *) p_desc)->bInterfaceClass) )
- {
- // next to endpoint descriptor
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
-
- // data endpoints expected to be in pairs
- for(uint32_t i=0; i<2; i++)
- {
- tusb_desc_endpoint_t const *desc_ep = (tusb_desc_endpoint_t const *) p_desc;
- TU_ASSERT(TUSB_DESC_ENDPOINT == desc_ep->bDescriptorType && TUSB_XFER_BULK == desc_ep->bmAttributes.xfer);
-
- TU_ASSERT(usbh_edpt_open(rhport, dev_addr, desc_ep));
-
- if ( tu_edpt_dir(desc_ep->bEndpointAddress) == TUSB_DIR_IN )
- {
- p_cdc->ep_in = desc_ep->bEndpointAddress;
- }else
- {
- p_cdc->ep_out = desc_ep->bEndpointAddress;
- }
-
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next( p_desc );
- }
- }
-
- return true;
-}
-
-bool cdch_set_config(uint8_t dev_addr, uint8_t itf_num)
-{
- (void) dev_addr; (void) itf_num;
- return true;
-}
-
-bool cdch_xfer_cb(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes)
-{
- (void) ep_addr;
- tuh_cdc_xfer_isr( dev_addr, event, 0, xferred_bytes );
- return true;
-}
-
-void cdch_close(uint8_t dev_addr)
-{
- TU_VERIFY(dev_addr <= CFG_TUH_DEVICE_MAX, );
-
- cdch_data_t * p_cdc = get_itf(dev_addr);
- tu_memclr(p_cdc, sizeof(cdch_data_t));
-}
-
-#endif
diff --git a/tinyusb/src/class/cdc/cdc_host.h b/tinyusb/src/class/cdc/cdc_host.h
deleted file mode 100755
index 0d435138..00000000
--- a/tinyusb/src/class/cdc/cdc_host.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_CDC_HOST_H_
-#define _TUSB_CDC_HOST_H_
-
-#include "cdc.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// CDC APPLICATION PUBLIC API
-//--------------------------------------------------------------------+
-/** \ingroup ClassDriver_CDC Communication Device Class (CDC)
- * \addtogroup CDC_Serial Serial
- * @{
- * \defgroup CDC_Serial_Host Host
- * @{ */
-
-bool tuh_cdc_set_control_line_state(uint8_t dev_addr, bool dtr, bool rts, tuh_control_complete_cb_t complete_cb);
-
-static inline bool tuh_cdc_connect(uint8_t dev_addr, tuh_control_complete_cb_t complete_cb)
-{
- return tuh_cdc_set_control_line_state(dev_addr, true, true, complete_cb);
-}
-
-static inline bool tuh_cdc_disconnect(uint8_t dev_addr, tuh_control_complete_cb_t complete_cb)
-{
- return tuh_cdc_set_control_line_state(dev_addr, false, false, complete_cb);
-}
-
-/** \brief Check if device support CDC Serial interface or not
- * \param[in] dev_addr device address
- * \retval true if device supports
- * \retval false if device does not support or is not mounted
- */
-bool tuh_cdc_serial_is_mounted(uint8_t dev_addr);
-
-/** \brief Check if the interface is currently busy or not
- * \param[in] dev_addr device address
- * \param[in] pipeid value from \ref cdc_pipeid_t to indicate target pipe.
- * \retval true if the interface is busy, meaning the stack is still transferring/waiting data from/to device
- * \retval false if the interface is not busy, meaning the stack successfully transferred data from/to device
- * \note This function is used to check if previous transfer is complete (success or error), so that the next transfer
- * can be scheduled. User needs to make sure the corresponding interface is mounted
- * (by \ref tuh_cdc_serial_is_mounted) before calling this function.
- */
-bool tuh_cdc_is_busy(uint8_t dev_addr, cdc_pipeid_t pipeid);
-
-/** \brief Perform USB OUT transfer to device
- * \param[in] dev_addr device address
- * \param[in] p_data Buffer containing data. Must be accessible by USB controller (see \ref CFG_TUSB_MEM_SECTION)
- * \param[in] length Number of bytes to be transferred via USB bus
- * \retval TUSB_ERROR_NONE on success
- * \retval TUSB_ERROR_INTERFACE_IS_BUSY if the interface is already transferring data with device
- * \retval TUSB_ERROR_DEVICE_NOT_READY if device is not yet configured (by SET CONFIGURED request)
- * \retval TUSB_ERROR_INVALID_PARA if input parameters are not correct
- * \note This function is non-blocking and returns immediately. The result of USB transfer will be reported by the
- * interface's callback function. \a p_data must be declared with \ref CFG_TUSB_MEM_SECTION.
- */
-bool tuh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool is_notify);
-
-/** \brief Perform USB IN transfer to get data from device
- * \param[in] dev_addr device address
- * \param[in] p_buffer Buffer containing received data. Must be accessible by USB controller (see \ref CFG_TUSB_MEM_SECTION)
- * \param[in] length Number of bytes to be transferred via USB bus
- * \retval TUSB_ERROR_NONE on success
- * \retval TUSB_ERROR_INTERFACE_IS_BUSY if the interface is already transferring data with device
- * \retval TUSB_ERROR_DEVICE_NOT_READY if device is not yet configured (by SET CONFIGURED request)
- * \retval TUSB_ERROR_INVALID_PARA if input parameters are not correct
- * \note This function is non-blocking and returns immediately. The result of USB transfer will be reported by the
- * interface's callback function. \a p_data must be declared with \ref CFG_TUSB_MEM_SECTION.
- */
-bool tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify);
-
-//--------------------------------------------------------------------+
-// CDC APPLICATION CALLBACKS
-//--------------------------------------------------------------------+
-
-/** \brief Callback function that is invoked when an transferring event occurred
- * \param[in] dev_addr Address of device
- * \param[in] event an value from \ref xfer_result_t
- * \param[in] pipe_id value from \ref cdc_pipeid_t indicate the pipe
- * \param[in] xferred_bytes Number of bytes transferred via USB bus
- * \note event can be one of following
- * - XFER_RESULT_SUCCESS : previously scheduled transfer completes successfully.
- * - XFER_RESULT_FAILED : previously scheduled transfer encountered a transaction error.
- * - XFER_RESULT_STALLED : previously scheduled transfer is stalled by device.
- * \note
- */
-void tuh_cdc_xfer_isr(uint8_t dev_addr, xfer_result_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes);
-
-/// @} // group CDC_Serial_Host
-/// @}
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-void cdch_init (void);
-bool cdch_open (uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *itf_desc, uint16_t max_len);
-bool cdch_set_config (uint8_t dev_addr, uint8_t itf_num);
-bool cdch_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes);
-void cdch_close (uint8_t dev_addr);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CDC_HOST_H_ */
diff --git a/tinyusb/src/class/cdc/cdc_rndis.h b/tinyusb/src/class/cdc/cdc_rndis.h
deleted file mode 100755
index e0f129fe..00000000
--- a/tinyusb/src/class/cdc/cdc_rndis.h
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup ClassDriver_CDC Communication Device Class (CDC)
- * \defgroup CDC_RNDIS Remote Network Driver Interface Specification (RNDIS)
- * @{
- * \defgroup CDC_RNDIS_Common Common Definitions
- * @{ */
-
-#ifndef _TUSB_CDC_RNDIS_H_
-#define _TUSB_CDC_RNDIS_H_
-
-#include "cdc.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#ifdef __CC_ARM
-#pragma diag_suppress 66 // Suppress Keil warnings #66-D: enumeration value is out of "int" range
-#endif
-
-/// RNDIS Message Types
-typedef enum
-{
- RNDIS_MSG_PACKET = 0x00000001UL, ///< The host and device use this to send network data to one another.
-
- RNDIS_MSG_INITIALIZE = 0x00000002UL, ///< Sent by the host to initialize the device.
- RNDIS_MSG_INITIALIZE_CMPLT = 0x80000002UL, ///< Device response to an initialize message.
-
- RNDIS_MSG_HALT = 0x00000003UL, ///< Sent by the host to halt the device. This does not have a response. It is optional for the device to send this message to the host.
-
- RNDIS_MSG_QUERY = 0x00000004UL, ///< Sent by the host to send a query OID.
- RNDIS_MSG_QUERY_CMPLT = 0x80000004UL, ///< Device response to a query OID.
-
- RNDIS_MSG_SET = 0x00000005UL, ///< Sent by the host to send a set OID.
- RNDIS_MSG_SET_CMPLT = 0x80000005UL, ///< Device response to a set OID.
-
- RNDIS_MSG_RESET = 0x00000006UL, ///< Sent by the host to perform a soft reset on the device.
- RNDIS_MSG_RESET_CMPLT = 0x80000006UL, ///< Device response to reset message.
-
- RNDIS_MSG_INDICATE_STATUS = 0x00000007UL, ///< Sent by the device to indicate its status or an error when an unrecognized message is received.
-
- RNDIS_MSG_KEEP_ALIVE = 0x00000008UL, ///< During idle periods, sent every few seconds by the host to check that the device is still responsive. It is optional for the device to send this message to check if the host is active.
- RNDIS_MSG_KEEP_ALIVE_CMPLT = 0x80000008UL ///< The device response to a keepalivemessage. The host can respond with this message to a keepalive message from the device when the device implements the optional KeepAliveTimer.
-}rndis_msg_type_t;
-
-/// RNDIS Message Status Values
-typedef enum
-{
- RNDIS_STATUS_SUCCESS = 0x00000000UL, ///< Success
- RNDIS_STATUS_FAILURE = 0xC0000001UL, ///< Unspecified error
- RNDIS_STATUS_INVALID_DATA = 0xC0010015UL, ///< Invalid data error
- RNDIS_STATUS_NOT_SUPPORTED = 0xC00000BBUL, ///< Unsupported request error
- RNDIS_STATUS_MEDIA_CONNECT = 0x4001000BUL, ///< Device is connected to a network medium.
- RNDIS_STATUS_MEDIA_DISCONNECT = 0x4001000CUL ///< Device is disconnected from the medium.
-}rndis_msg_status_t;
-
-#ifdef __CC_ARM
-#pragma diag_default 66 // return Keil 66 to normal severity
-#endif
-
-//--------------------------------------------------------------------+
-// MESSAGE STRUCTURE
-//--------------------------------------------------------------------+
-
-//------------- Initialize -------------//
-/// \brief Initialize Message
-/// \details This message MUST be sent by the host to initialize the device.
-typedef struct {
- uint32_t type ; ///< Message type, must be \ref RNDIS_MSG_INITIALIZE
- uint32_t length ; ///< Message length in bytes, must be 0x18
- uint32_t request_id ; ///< A 32-bit integer value, generated by the host, used to match the host's sent request to the response from the device.
- uint32_t major_version ; ///< The major version of the RNDIS Protocol implemented by the host.
- uint32_t minor_version ; ///< The minor version of the RNDIS Protocol implemented by the host
- uint32_t max_xfer_size ; ///< The maximum size, in bytes, of any single bus data transfer that the host expects to receive from the device.
-}rndis_msg_initialize_t;
-
-/// \brief Initialize Complete Message
-/// \details This message MUST be sent by the device in response to an initialize message.
-typedef struct {
- uint32_t type ; ///< Message Type, must be \ref RNDIS_MSG_INITIALIZE_CMPLT
- uint32_t length ; ///< Message length in bytes, must be 0x30
- uint32_t request_id ; ///< A 32-bit integer value from \a request_id field of the \ref rndis_msg_initialize_t to which this message is a response.
- uint32_t status ; ///< The initialization status of the device, has value from \ref rndis_msg_status_t
- uint32_t major_version ; ///< the highest-numbered RNDIS Protocol version supported by the device.
- uint32_t minor_version ; ///< the highest-numbered RNDIS Protocol version supported by the device.
- uint32_t device_flags ; ///< MUST be set to 0x000000010. Other values are reserved for future use.
- uint32_t medium ; ///< is 0x00 for RNDIS_MEDIUM_802_3
- uint32_t max_packet_per_xfer ; ///< The maximum number of concatenated \ref RNDIS_MSG_PACKET messages that the device can handle in a single bus transfer to it. This value MUST be at least 1.
- uint32_t max_xfer_size ; ///< The maximum size, in bytes, of any single bus data transfer that the device expects to receive from the host.
- uint32_t packet_alignment_factor ; ///< The byte alignment the device expects for each RNDIS message that is part of a multimessage transfer to it. The value is specified as an exponent of 2; for example, the host uses 2<SUP>{PacketAlignmentFactor}</SUP> as the alignment value.
- uint32_t reserved[2] ;
-} rndis_msg_initialize_cmplt_t;
-
-//------------- Query -------------//
-/// \brief Query Message
-/// \details This message MUST be sent by the host to query an OID.
-typedef struct {
- uint32_t type ; ///< Message Type, must be \ref RNDIS_MSG_QUERY
- uint32_t length ; ///< Message length in bytes, including the header and the \a oid_buffer
- uint32_t request_id ; ///< A 32-bit integer value, generated by the host, used to match the host's sent request to the response from the device.
- uint32_t oid ; ///< The integer value of the host operating system-defined identifier, for the parameter of the device being queried for.
- uint32_t buffer_length ; ///< The length, in bytes, of the input data required for the OID query. This MUST be set to 0 when there is no input data associated with the OID.
- uint32_t buffer_offset ; ///< The offset, in bytes, from the beginning of \a request_id field where the input data for the query is located in the message. This value MUST be set to 0 when there is no input data associated with the OID.
- uint32_t reserved ;
- uint8_t oid_buffer[] ; ///< Flexible array contains the input data supplied by the host, required for the OID query request processing by the device, as per the host NDIS specification.
-} rndis_msg_query_t, rndis_msg_set_t;
-
-TU_VERIFY_STATIC(sizeof(rndis_msg_query_t) == 28, "Make sure flexible array member does not affect layout");
-
-/// \brief Query Complete Message
-/// \details This message MUST be sent by the device in response to a query OID message.
-typedef struct {
- uint32_t type ; ///< Message Type, must be \ref RNDIS_MSG_QUERY_CMPLT
- uint32_t length ; ///< Message length in bytes, including the header and the \a oid_buffer
- uint32_t request_id ; ///< A 32-bit integer value from \a request_id field of the \ref rndis_msg_query_t to which this message is a response.
- uint32_t status ; ///< The status of processing for the query request, has value from \ref rndis_msg_status_t.
- uint32_t buffer_length ; ///< The length, in bytes, of the data in the response to the query. This MUST be set to 0 when there is no OIDInputBuffer.
- uint32_t buffer_offset ; ///< The offset, in bytes, from the beginning of \a request_id field where the response data for the query is located in the message. This MUST be set to 0 when there is no \ref oid_buffer.
- uint8_t oid_buffer[] ; ///< Flexible array member contains the response data to the OID query request as specified by the host.
-} rndis_msg_query_cmplt_t;
-
-TU_VERIFY_STATIC(sizeof(rndis_msg_query_cmplt_t) == 24, "Make sure flexible array member does not affect layout");
-
-//------------- Reset -------------//
-/// \brief Reset Message
-/// \details This message MUST be sent by the host to perform a soft reset on the device.
-typedef struct {
- uint32_t type ; ///< Message Type, must be \ref RNDIS_MSG_RESET
- uint32_t length ; ///< Message length in bytes, MUST be 0x06
- uint32_t reserved ;
-} rndis_msg_reset_t;
-
-/// \brief Reset Complete Message
-/// \details This message MUST be sent by the device in response to a reset message.
-typedef struct {
- uint32_t type ; ///< Message Type, must be \ref RNDIS_MSG_RESET_CMPLT
- uint32_t length ; ///< Message length in bytes, MUST be 0x10
- uint32_t status ; ///< The status of processing for the \ref rndis_msg_reset_t, has value from \ref rndis_msg_status_t.
- uint32_t addressing_reset ; ///< This field indicates whether the addressing information, which is the multicast address list or packet filter, has been lost during the reset operation. This MUST be set to 0x00000001 if the device requires that the host to resend addressing information or MUST be set to zero otherwise.
-} rndis_msg_reset_cmplt_t;
-
-//typedef struct {
-// uint32_t type;
-// uint32_t length;
-// uint32_t status;
-// uint32_t buffer_length;
-// uint32_t buffer_offset;
-// uint32_t diagnostic_status; // optional
-// uint32_t diagnostic_error_offset; // optional
-// uint32_t status_buffer[0]; // optional
-//} rndis_msg_indicate_status_t;
-
-/// \brief Keep Alive Message
-/// \details This message MUST be sent by the host to check that device is still responsive. It is optional for the device to send this message to check if the host is active
-typedef struct {
- uint32_t type ; ///< Message Type
- uint32_t length ; ///< Message length in bytes, MUST be 0x10
- uint32_t request_id ;
-} rndis_msg_keep_alive_t, rndis_msg_halt_t;
-
-/// \brief Set Complete Message
-/// \brief This message MUST be sent in response to a the request message
-typedef struct {
- uint32_t type ; ///< Message Type
- uint32_t length ; ///< Message length in bytes, MUST be 0x10
- uint32_t request_id ; ///< must be the same as requesting message
- uint32_t status ; ///< The status of processing for the request message request by the device to which this message is the response.
-} rndis_msg_set_cmplt_t, rndis_msg_keep_alive_cmplt_t;
-
-/// \brief Packet Data Message
-/// \brief This message MUST be used by the host and the device to send network data to one another.
-typedef struct {
- uint32_t type ; ///< Message Type, must be \ref RNDIS_MSG_PACKET
- uint32_t length ; ///< Message length in bytes, The total length of this RNDIS message including the header, payload, and padding.
- uint32_t data_offset ; ///< Specifies the offset, in bytes, from the start of this \a data_offset field of this message to the start of the data. This MUST be an integer multiple of 4.
- uint32_t data_length ; ///< Specifies the number of bytes in the payload of this message.
- uint32_t out_of_band_data_offet ; ///< Specifies the offset, in bytes, of the first out-of-band data record from the start of the DataOffset field in this message. MUST be an integer multiple of 4 when out-of-band data is present or set to 0 otherwise. When there are multiple out-ofband data records, each subsequent record MUST immediately follow the previous out-of-band data record.
- uint32_t out_of_band_data_length ; ///< Specifies, in bytes, the total length of the out-of-band data.
- uint32_t num_out_of_band_data_elements ; ///< Specifies the number of out-of-band records in this message.
- uint32_t per_packet_info_offset ; ///< Specifies the offset, in bytes, of the start of per-packet-info data record from the start of the \a data_offset field in this message. MUST be an integer multiple of 4 when per-packet-info data record is present or MUST be set to 0 otherwise. When there are multiple per-packet-info data records, each subsequent record MUST immediately follow the previous record.
- uint32_t per_packet_info_length ; ///< Specifies, in bytes, the total length of per-packetinformation contained in this message.
- uint32_t reserved[2] ;
- uint32_t payload[0] ; ///< Network data contained in this message.
-
- // uint8_t padding[0]
- // Additional bytes of zeros added at the end of the message to comply with
- // the internal and external padding requirements. Internal padding SHOULD be as per the
- // specification of the out-of-band data record and per-packet-info data record. The external
- //padding size SHOULD be determined based on the PacketAlignmentFactor field specification
- //in REMOTE_NDIS_INITIALIZE_CMPLT message by the device, when multiple
- //REMOTE_NDIS_PACKET_MSG messages are bundled together in a single bus-native message.
- //In this case, all but the very last REMOTE_NDIS_PACKET_MSG MUST respect the
- //PacketAlignmentFactor field.
-
- // rndis_msg_packet_t [0] : (optional) more packet if multiple packet per bus transaction is supported
-} rndis_msg_packet_t;
-
-
-typedef struct {
- uint32_t size ; ///< Length, in bytes, of this header and appended data and padding. This value MUST be an integer multiple of 4.
- uint32_t type ; ///< MUST be as per host operating system specification.
- uint32_t offset ; ///< The byte offset from the beginning of this record to the beginning of data.
- uint32_t data[0] ; ///< Flexible array contains data
-} rndis_msg_out_of_band_data_t, rndis_msg_per_packet_info_t;
-
-//--------------------------------------------------------------------+
-// NDIS Object ID
-//--------------------------------------------------------------------+
-
-/// NDIS Object ID
-typedef enum
-{
- //------------- General Required OIDs -------------//
- RNDIS_OID_GEN_SUPPORTED_LIST = 0x00010101, ///< List of supported OIDs
- RNDIS_OID_GEN_HARDWARE_STATUS = 0x00010102, ///< Hardware status
- RNDIS_OID_GEN_MEDIA_SUPPORTED = 0x00010103, ///< Media types supported (encoded)
- RNDIS_OID_GEN_MEDIA_IN_USE = 0x00010104, ///< Media types in use (encoded)
- RNDIS_OID_GEN_MAXIMUM_LOOKAHEAD = 0x00010105, ///<
- RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE = 0x00010106, ///< Maximum frame size in bytes
- RNDIS_OID_GEN_LINK_SPEED = 0x00010107, ///< Link speed in units of 100 bps
- RNDIS_OID_GEN_TRANSMIT_BUFFER_SPACE = 0x00010108, ///< Transmit buffer space
- RNDIS_OID_GEN_RECEIVE_BUFFER_SPACE = 0x00010109, ///< Receive buffer space
- RNDIS_OID_GEN_TRANSMIT_BLOCK_SIZE = 0x0001010A, ///< Minimum amount of storage, in bytes, that a single packet occupies in the transmit buffer space of the NIC
- RNDIS_OID_GEN_RECEIVE_BLOCK_SIZE = 0x0001010B, ///< Amount of storage, in bytes, that a single packet occupies in the receive buffer space of the NIC
- RNDIS_OID_GEN_VENDOR_ID = 0x0001010C, ///< Vendor NIC code
- RNDIS_OID_GEN_VENDOR_DESCRIPTION = 0x0001010D, ///< Vendor network card description
- RNDIS_OID_GEN_CURRENT_PACKET_FILTER = 0x0001010E, ///< Current packet filter (encoded)
- RNDIS_OID_GEN_CURRENT_LOOKAHEAD = 0x0001010F, ///< Current lookahead size in bytes
- RNDIS_OID_GEN_DRIVER_VERSION = 0x00010110, ///< NDIS version number used by the driver
- RNDIS_OID_GEN_MAXIMUM_TOTAL_SIZE = 0x00010111, ///< Maximum total packet length in bytes
- RNDIS_OID_GEN_PROTOCOL_OPTIONS = 0x00010112, ///< Optional protocol flags (encoded)
- RNDIS_OID_GEN_MAC_OPTIONS = 0x00010113, ///< Optional NIC flags (encoded)
- RNDIS_OID_GEN_MEDIA_CONNECT_STATUS = 0x00010114, ///< Whether the NIC is connected to the network
- RNDIS_OID_GEN_MAXIMUM_SEND_PACKETS = 0x00010115, ///< The maximum number of send packets the driver can accept per call to its MiniportSendPacketsfunction
-
- //------------- General Optional OIDs -------------//
- RNDIS_OID_GEN_VENDOR_DRIVER_VERSION = 0x00010116, ///< Vendor-assigned version number of the driver
- RNDIS_OID_GEN_SUPPORTED_GUIDS = 0x00010117, ///< The custom GUIDs (Globally Unique Identifier) supported by the miniport driver
- RNDIS_OID_GEN_NETWORK_LAYER_ADDRESSES = 0x00010118, ///< List of network-layer addresses associated with the binding between a transport and the driver
- RNDIS_OID_GEN_TRANSPORT_HEADER_OFFSET = 0x00010119, ///< Size of packets' additional headers
- RNDIS_OID_GEN_MEDIA_CAPABILITIES = 0x00010201, ///<
- RNDIS_OID_GEN_PHYSICAL_MEDIUM = 0x00010202, ///< Physical media supported by the miniport driver (encoded)
-
- //------------- 802.3 Objects (Ethernet) -------------//
- RNDIS_OID_802_3_PERMANENT_ADDRESS = 0x01010101, ///< Permanent station address
- RNDIS_OID_802_3_CURRENT_ADDRESS = 0x01010102, ///< Current station address
- RNDIS_OID_802_3_MULTICAST_LIST = 0x01010103, ///< Current multicast address list
- RNDIS_OID_802_3_MAXIMUM_LIST_SIZE = 0x01010104, ///< Maximum size of multicast address list
-} rndis_oid_type_t;
-
-/// RNDIS Packet Filter Bits \ref RNDIS_OID_GEN_CURRENT_PACKET_FILTER.
-typedef enum
-{
- RNDIS_PACKET_TYPE_DIRECTED = 0x00000001, ///< Directed packets. Directed packets contain a destination address equal to the station address of the NIC.
- RNDIS_PACKET_TYPE_MULTICAST = 0x00000002, ///< Multicast address packets sent to addresses in the multicast address list.
- RNDIS_PACKET_TYPE_ALL_MULTICAST = 0x00000004, ///< All multicast address packets, not just the ones enumerated in the multicast address list.
- RNDIS_PACKET_TYPE_BROADCAST = 0x00000008, ///< Broadcast packets.
- RNDIS_PACKET_TYPE_SOURCE_ROUTING = 0x00000010, ///< All source routing packets. If the protocol driver sets this bit, the NDIS library attempts to act as a source routing bridge.
- RNDIS_PACKET_TYPE_PROMISCUOUS = 0x00000020, ///< Specifies all packets regardless of whether VLAN filtering is enabled or not and whether the VLAN identifier matches or not.
- RNDIS_PACKET_TYPE_SMT = 0x00000040, ///< SMT packets that an FDDI NIC receives.
- RNDIS_PACKET_TYPE_ALL_LOCAL = 0x00000080, ///< All packets sent by installed protocols and all packets indicated by the NIC that is identified by a given NdisBindingHandle.
- RNDIS_PACKET_TYPE_GROUP = 0x00001000, ///< Packets sent to the current group address.
- RNDIS_PACKET_TYPE_ALL_FUNCTIONAL = 0x00002000, ///< All functional address packets, not just the ones in the current functional address.
- RNDIS_PACKET_TYPE_FUNCTIONAL = 0x00004000, ///< Functional address packets sent to addresses included in the current functional address.
- RNDIS_PACKET_TYPE_MAC_FRAME = 0x00008000, ///< NIC driver frames that a Token Ring NIC receives.
- RNDIS_PACKET_TYPE_NO_LOCAL = 0x00010000,
-} rndis_packet_filter_type_t;
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CDC_RNDIS_H_ */
-
-/** @} */
-/** @} */
diff --git a/tinyusb/src/class/cdc/cdc_rndis_host.c b/tinyusb/src/class/cdc/cdc_rndis_host.c
deleted file mode 100755
index cc4ffd1c..00000000
--- a/tinyusb/src/class/cdc/cdc_rndis_host.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_HOST_ENABLED && CFG_TUH_CDC && CFG_TUH_CDC_RNDIS)
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "common/tusb_common.h"
-#include "cdc_host.h"
-#include "cdc_rndis_host.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-#define RNDIS_MSG_PAYLOAD_MAX (1024*4)
-
-CFG_TUSB_MEM_SECTION static uint8_t msg_notification[CFG_TUH_DEVICE_MAX][8];
-CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(4) static uint8_t msg_payload[RNDIS_MSG_PAYLOAD_MAX];
-
-static rndish_data_t rndish_data[CFG_TUH_DEVICE_MAX];
-
-// TODO Microsoft requires message length for any get command must be at least 4096 bytes
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-static tusb_error_t rndis_body_subtask(void);
-static tusb_error_t send_message_get_response_subtask( uint8_t dev_addr, cdch_data_t *p_cdc,
- uint8_t * p_mess, uint32_t mess_length,
- uint8_t *p_response );
-
-//--------------------------------------------------------------------+
-// APPLICATION API
-//--------------------------------------------------------------------+
-tusb_error_t tusbh_cdc_rndis_get_mac_addr(uint8_t dev_addr, uint8_t mac_address[6])
-{
- TU_ASSERT( tusbh_cdc_rndis_is_mounted(dev_addr), TUSB_ERROR_CDCH_DEVICE_NOT_MOUNTED);
- TU_VERIFY( mac_address, TUSB_ERROR_INVALID_PARA);
-
- memcpy(mac_address, rndish_data[dev_addr-1].mac_address, 6);
-
- return TUSB_ERROR_NONE;
-}
-
-//--------------------------------------------------------------------+
-// IMPLEMENTATION
-//--------------------------------------------------------------------+
-
-// To enable the TASK_ASSERT style (quick return on false condition) in a real RTOS, a task must act as a wrapper
-// and is used mainly to call subtasks. Within a subtask return statement can be called freely, the task with
-// forever loop cannot have any return at all.
-OSAL_TASK_FUNCTION(cdch_rndis_task) (void* param;)
-{
- OSAL_TASK_BEGIN
- rndis_body_subtask();
- OSAL_TASK_END
-}
-
-static tusb_error_t rndis_body_subtask(void)
-{
- static uint8_t relative_addr;
-
- OSAL_SUBTASK_BEGIN
-
- for (relative_addr = 0; relative_addr < CFG_TUH_DEVICE_MAX; relative_addr++)
- {
-
- }
-
- osal_task_delay(100);
-
- OSAL_SUBTASK_END
-}
-
-//--------------------------------------------------------------------+
-// RNDIS-CDC Driver API
-//--------------------------------------------------------------------+
-void rndish_init(void)
-{
- tu_memclr(rndish_data, sizeof(rndish_data_t)*CFG_TUH_DEVICE_MAX);
-
- //------------- Task creation -------------//
-
- //------------- semaphore creation for notificaiton pipe -------------//
- for(uint8_t i=0; i<CFG_TUH_DEVICE_MAX; i++)
- {
- rndish_data[i].sem_notification_hdl = osal_semaphore_create( OSAL_SEM_REF(rndish_data[i].semaphore_notification) );
- }
-}
-
-void rndish_close(uint8_t dev_addr)
-{
- osal_semaphore_reset( rndish_data[dev_addr-1].sem_notification_hdl );
-// tu_memclr(&rndish_data[dev_addr-1], sizeof(rndish_data_t)); TODO need to move semaphore & its handle out before memclr
-}
-
-
-static rndis_msg_initialize_t const msg_init =
-{
- .type = RNDIS_MSG_INITIALIZE,
- .length = sizeof(rndis_msg_initialize_t),
- .request_id = 1, // TODO should use some magic number
- .major_version = 1,
- .minor_version = 0,
- .max_xfer_size = 0x4000 // TODO mimic windows
-};
-
-static rndis_msg_query_t const msg_query_permanent_addr =
-{
- .type = RNDIS_MSG_QUERY,
- .length = sizeof(rndis_msg_query_t)+6,
- .request_id = 1,
- .oid = RNDIS_OID_802_3_PERMANENT_ADDRESS,
- .buffer_length = 6,
- .buffer_offset = 20,
-};
-
-static rndis_msg_set_t const msg_set_packet_filter =
-{
- .type = RNDIS_MSG_SET,
- .length = sizeof(rndis_msg_set_t)+4,
- .request_id = 1,
- .oid = RNDIS_OID_GEN_CURRENT_PACKET_FILTER,
- .buffer_length = 4,
- .buffer_offset = 20,
-};
-
-tusb_error_t rndish_open_subtask(uint8_t dev_addr, cdch_data_t *p_cdc)
-{
- tusb_error_t error;
-
- OSAL_SUBTASK_BEGIN
-
- //------------- Message Initialize -------------//
- memcpy(msg_payload, &msg_init, sizeof(rndis_msg_initialize_t));
- STASK_INVOKE(
- send_message_get_response_subtask( dev_addr, p_cdc,
- msg_payload, sizeof(rndis_msg_initialize_t),
- msg_payload),
- error
- );
- if ( TUSB_ERROR_NONE != error ) STASK_RETURN(error);
-
- // TODO currently not support multiple data packets per xfer
- rndis_msg_initialize_cmplt_t * const p_init_cmpt = (rndis_msg_initialize_cmplt_t *) msg_payload;
- STASK_ASSERT(p_init_cmpt->type == RNDIS_MSG_INITIALIZE_CMPLT && p_init_cmpt->status == RNDIS_STATUS_SUCCESS &&
- p_init_cmpt->max_packet_per_xfer == 1 && p_init_cmpt->max_xfer_size <= RNDIS_MSG_PAYLOAD_MAX);
- rndish_data[dev_addr-1].max_xfer_size = p_init_cmpt->max_xfer_size;
-
- //------------- Message Query 802.3 Permanent Address -------------//
- memcpy(msg_payload, &msg_query_permanent_addr, sizeof(rndis_msg_query_t));
- tu_memclr(msg_payload + sizeof(rndis_msg_query_t), 6); // 6 bytes for MAC address
-
- STASK_INVOKE(
- send_message_get_response_subtask( dev_addr, p_cdc,
- msg_payload, sizeof(rndis_msg_query_t) + 6,
- msg_payload),
- error
- );
- if ( TUSB_ERROR_NONE != error ) STASK_RETURN(error);
-
- rndis_msg_query_cmplt_t * const p_query_cmpt = (rndis_msg_query_cmplt_t *) msg_payload;
- STASK_ASSERT(p_query_cmpt->type == RNDIS_MSG_QUERY_CMPLT && p_query_cmpt->status == RNDIS_STATUS_SUCCESS);
- memcpy(rndish_data[dev_addr-1].mac_address, msg_payload + 8 + p_query_cmpt->buffer_offset, 6);
-
- //------------- Set OID_GEN_CURRENT_PACKET_FILTER to (DIRECTED | MULTICAST | BROADCAST) -------------//
- memcpy(msg_payload, &msg_set_packet_filter, sizeof(rndis_msg_set_t));
- tu_memclr(msg_payload + sizeof(rndis_msg_set_t), 4); // 4 bytes for filter flags
- ((rndis_msg_set_t*) msg_payload)->oid_buffer[0] = (RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_MULTICAST | RNDIS_PACKET_TYPE_BROADCAST);
-
- STASK_INVOKE(
- send_message_get_response_subtask( dev_addr, p_cdc,
- msg_payload, sizeof(rndis_msg_set_t) + 4,
- msg_payload),
- error
- );
- if ( TUSB_ERROR_NONE != error ) STASK_RETURN(error);
-
- rndis_msg_set_cmplt_t * const p_set_cmpt = (rndis_msg_set_cmplt_t *) msg_payload;
- STASK_ASSERT(p_set_cmpt->type == RNDIS_MSG_SET_CMPLT && p_set_cmpt->status == RNDIS_STATUS_SUCCESS);
-
- tusbh_cdc_rndis_mounted_cb(dev_addr);
-
- OSAL_SUBTASK_END
-}
-
-void rndish_xfer_isr(cdch_data_t *p_cdc, pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes)
-{
- if ( pipehandle_is_equal(pipe_hdl, p_cdc->pipe_notification) )
- {
- osal_semaphore_post( rndish_data[pipe_hdl.dev_addr-1].sem_notification_hdl );
- }
-}
-
-//--------------------------------------------------------------------+
-// INTERNAL & HELPER
-//--------------------------------------------------------------------+
-static tusb_error_t send_message_get_response_subtask( uint8_t dev_addr, cdch_data_t *p_cdc,
- uint8_t * p_mess, uint32_t mess_length,
- uint8_t *p_response)
-{
- tusb_error_t error;
-
- OSAL_SUBTASK_BEGIN
-
- //------------- Send RNDIS Control Message -------------//
- STASK_INVOKE(
- usbh_control_xfer_subtask( dev_addr, bm_request_type(TUSB_DIR_OUT, TUSB_REQ_TYPE_CLASS, TUSB_REQ_RCPT_INTERFACE),
- CDC_REQUEST_SEND_ENCAPSULATED_COMMAND, 0, p_cdc->interface_number,
- mess_length, p_mess),
- error
- );
- if ( TUSB_ERROR_NONE != error ) STASK_RETURN(error);
-
- //------------- waiting for Response Available notification -------------//
- (void) usbh_edpt_xfer(p_cdc->pipe_notification, msg_notification[dev_addr-1], 8);
- osal_semaphore_wait(rndish_data[dev_addr-1].sem_notification_hdl, OSAL_TIMEOUT_NORMAL, &error);
- if ( TUSB_ERROR_NONE != error ) STASK_RETURN(error);
- STASK_ASSERT(msg_notification[dev_addr-1][0] == 1);
-
- //------------- Get RNDIS Message Initialize Complete -------------//
- STASK_INVOKE(
- usbh_control_xfer_subtask( dev_addr, bm_request_type(TUSB_DIR_IN, TUSB_REQ_TYPE_CLASS, TUSB_REQ_RCPT_INTERFACE),
- CDC_REQUEST_GET_ENCAPSULATED_RESPONSE, 0, p_cdc->interface_number,
- RNDIS_MSG_PAYLOAD_MAX, p_response),
- error
- );
- if ( TUSB_ERROR_NONE != error ) STASK_RETURN(error);
-
- OSAL_SUBTASK_END
-}
-
-//static tusb_error_t send_process_msg_initialize_subtask(uint8_t dev_addr, cdch_data_t *p_cdc)
-//{
-// tusb_error_t error;
-//
-// OSAL_SUBTASK_BEGIN
-//
-// *((rndis_msg_initialize_t*) msg_payload) = (rndis_msg_initialize_t)
-// {
-// .type = RNDIS_MSG_INITIALIZE,
-// .length = sizeof(rndis_msg_initialize_t),
-// .request_id = 1, // TODO should use some magic number
-// .major_version = 1,
-// .minor_version = 0,
-// .max_xfer_size = 0x4000 // TODO mimic windows
-// };
-//
-//
-//
-// OSAL_SUBTASK_END
-//}
-#endif
diff --git a/tinyusb/src/class/cdc/cdc_rndis_host.h b/tinyusb/src/class/cdc/cdc_rndis_host.h
deleted file mode 100755
index 170cb3b0..00000000
--- a/tinyusb/src/class/cdc/cdc_rndis_host.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup CDC_RNDIS
- * \defgroup CDC_RNSID_Host Host
- * @{ */
-
-#ifndef _TUSB_CDC_RNDIS_HOST_H_
-#define _TUSB_CDC_RNDIS_HOST_H_
-
-#include "common/tusb_common.h"
-#include "host/usbh.h"
-#include "cdc_rndis.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// INTERNAL RNDIS-CDC Driver API
-//--------------------------------------------------------------------+
-typedef struct {
- OSAL_SEM_DEF(semaphore_notification);
- osal_semaphore_handle_t sem_notification_hdl; // used to wait on notification pipe
- uint32_t max_xfer_size; // got from device's msg initialize complete
- uint8_t mac_address[6];
-}rndish_data_t;
-
-void rndish_init(void);
-tusb_error_t rndish_open_subtask(uint8_t dev_addr, cdch_data_t *p_cdc);
-void rndish_xfer_isr(cdch_data_t *p_cdc, pipe_handle_t pipe_hdl, xfer_result_t event, uint32_t xferred_bytes);
-void rndish_close(uint8_t dev_addr);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CDC_RNDIS_HOST_H_ */
-
-/** @} */
diff --git a/tinyusb/src/class/dfu/dfu.h b/tinyusb/src/class/dfu/dfu.h
deleted file mode 100755
index 114c827b..00000000
--- a/tinyusb/src/class/dfu/dfu.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021 XMOS LIMITED
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_DFU_H_
-#define _TUSB_DFU_H_
-
-#include "common/tusb_common.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Common Definitions
-//--------------------------------------------------------------------+
-
-// DFU Protocol
-typedef enum
-{
- DFU_PROTOCOL_RT = 0x01,
- DFU_PROTOCOL_DFU = 0x02,
-} dfu_protocol_type_t;
-
-// DFU Descriptor Type
-typedef enum
-{
- DFU_DESC_FUNCTIONAL = 0x21,
-} dfu_descriptor_type_t;
-
-// DFU Requests
-typedef enum {
- DFU_REQUEST_DETACH = 0,
- DFU_REQUEST_DNLOAD = 1,
- DFU_REQUEST_UPLOAD = 2,
- DFU_REQUEST_GETSTATUS = 3,
- DFU_REQUEST_CLRSTATUS = 4,
- DFU_REQUEST_GETSTATE = 5,
- DFU_REQUEST_ABORT = 6,
-} dfu_requests_t;
-
-// DFU States
-typedef enum {
- APP_IDLE = 0,
- APP_DETACH = 1,
- DFU_IDLE = 2,
- DFU_DNLOAD_SYNC = 3,
- DFU_DNBUSY = 4,
- DFU_DNLOAD_IDLE = 5,
- DFU_MANIFEST_SYNC = 6,
- DFU_MANIFEST = 7,
- DFU_MANIFEST_WAIT_RESET = 8,
- DFU_UPLOAD_IDLE = 9,
- DFU_ERROR = 10,
-} dfu_state_t;
-
-// DFU Status
-typedef enum {
- DFU_STATUS_OK = 0x00,
- DFU_STATUS_ERR_TARGET = 0x01,
- DFU_STATUS_ERR_FILE = 0x02,
- DFU_STATUS_ERR_WRITE = 0x03,
- DFU_STATUS_ERR_ERASE = 0x04,
- DFU_STATUS_ERR_CHECK_ERASED = 0x05,
- DFU_STATUS_ERR_PROG = 0x06,
- DFU_STATUS_ERR_VERIFY = 0x07,
- DFU_STATUS_ERR_ADDRESS = 0x08,
- DFU_STATUS_ERR_NOTDONE = 0x09,
- DFU_STATUS_ERR_FIRMWARE = 0x0A,
- DFU_STATUS_ERR_VENDOR = 0x0B,
- DFU_STATUS_ERR_USBR = 0x0C,
- DFU_STATUS_ERR_POR = 0x0D,
- DFU_STATUS_ERR_UNKNOWN = 0x0E,
- DFU_STATUS_ERR_STALLEDPKT = 0x0F,
-} dfu_status_t;
-
-#define DFU_ATTR_CAN_DOWNLOAD (1u << 0)
-#define DFU_ATTR_CAN_UPLOAD (1u << 1)
-#define DFU_ATTR_MANIFESTATION_TOLERANT (1u << 2)
-#define DFU_ATTR_WILL_DETACH (1u << 3)
-
-// DFU Status Request Payload
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bStatus;
- uint8_t bwPollTimeout[3];
- uint8_t bState;
- uint8_t iString;
-} dfu_status_response_t;
-
-TU_VERIFY_STATIC( sizeof(dfu_status_response_t) == 6, "size is not correct");
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_DFU_H_ */
diff --git a/tinyusb/src/class/dfu/dfu_device.c b/tinyusb/src/class/dfu/dfu_device.c
deleted file mode 100755
index 28abf6e8..00000000
--- a/tinyusb/src/class/dfu/dfu_device.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021 XMOS LIMITED
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_DFU)
-
-#include "device/usbd.h"
-#include "device/usbd_pvt.h"
-
-#include "dfu_device.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-typedef struct
-{
- uint8_t attrs;
- uint8_t alt;
-
- dfu_state_t state;
- dfu_status_t status;
-
- bool flashing_in_progress;
- uint16_t block;
- uint16_t length;
-
- CFG_TUSB_MEM_ALIGN uint8_t transfer_buf[CFG_TUD_DFU_XFER_BUFSIZE];
-} dfu_state_ctx_t;
-
-// Only a single dfu state is allowed
-CFG_TUSB_MEM_SECTION static dfu_state_ctx_t _dfu_ctx;
-
-static void reset_state(void)
-{
- _dfu_ctx.state = DFU_IDLE;
- _dfu_ctx.status = DFU_STATUS_OK;
- _dfu_ctx.flashing_in_progress = false;
-}
-
-static bool reply_getstatus(uint8_t rhport, tusb_control_request_t const * request, dfu_state_t state, dfu_status_t status, uint32_t timeout);
-static bool process_download_get_status(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
-static bool process_manifest_get_status(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
-
-//--------------------------------------------------------------------+
-// Debug
-//--------------------------------------------------------------------+
-#if CFG_TUSB_DEBUG >= 2
-
-static tu_lookup_entry_t const _dfu_request_lookup[] =
-{
- { .key = DFU_REQUEST_DETACH , .data = "DETACH" },
- { .key = DFU_REQUEST_DNLOAD , .data = "DNLOAD" },
- { .key = DFU_REQUEST_UPLOAD , .data = "UPLOAD" },
- { .key = DFU_REQUEST_GETSTATUS , .data = "GETSTATUS" },
- { .key = DFU_REQUEST_CLRSTATUS , .data = "CLRSTATUS" },
- { .key = DFU_REQUEST_GETSTATE , .data = "GETSTATE" },
- { .key = DFU_REQUEST_ABORT , .data = "ABORT" },
-};
-
-static tu_lookup_table_t const _dfu_request_table =
-{
- .count = TU_ARRAY_SIZE(_dfu_request_lookup),
- .items = _dfu_request_lookup
-};
-
-static tu_lookup_entry_t const _dfu_state_lookup[] =
-{
- { .key = APP_IDLE , .data = "APP_IDLE" },
- { .key = APP_DETACH , .data = "APP_DETACH" },
- { .key = DFU_IDLE , .data = "IDLE" },
- { .key = DFU_DNLOAD_SYNC , .data = "DNLOAD_SYNC" },
- { .key = DFU_DNBUSY , .data = "DNBUSY" },
- { .key = DFU_DNLOAD_IDLE , .data = "DNLOAD_IDLE" },
- { .key = DFU_MANIFEST_SYNC , .data = "MANIFEST_SYNC" },
- { .key = DFU_MANIFEST , .data = "MANIFEST" },
- { .key = DFU_MANIFEST_WAIT_RESET , .data = "MANIFEST_WAIT_RESET" },
- { .key = DFU_UPLOAD_IDLE , .data = "UPLOAD_IDLE" },
- { .key = DFU_ERROR , .data = "ERROR" },
-};
-
-static tu_lookup_table_t const _dfu_state_table =
-{
- .count = TU_ARRAY_SIZE(_dfu_state_lookup),
- .items = _dfu_state_lookup
-};
-
-static tu_lookup_entry_t const _dfu_status_lookup[] =
-{
- { .key = DFU_STATUS_OK , .data = "OK" },
- { .key = DFU_STATUS_ERR_TARGET , .data = "errTARGET" },
- { .key = DFU_STATUS_ERR_FILE , .data = "errFILE" },
- { .key = DFU_STATUS_ERR_WRITE , .data = "errWRITE" },
- { .key = DFU_STATUS_ERR_ERASE , .data = "errERASE" },
- { .key = DFU_STATUS_ERR_CHECK_ERASED , .data = "errCHECK_ERASED" },
- { .key = DFU_STATUS_ERR_PROG , .data = "errPROG" },
- { .key = DFU_STATUS_ERR_VERIFY , .data = "errVERIFY" },
- { .key = DFU_STATUS_ERR_ADDRESS , .data = "errADDRESS" },
- { .key = DFU_STATUS_ERR_NOTDONE , .data = "errNOTDONE" },
- { .key = DFU_STATUS_ERR_FIRMWARE , .data = "errFIRMWARE" },
- { .key = DFU_STATUS_ERR_VENDOR , .data = "errVENDOR" },
- { .key = DFU_STATUS_ERR_USBR , .data = "errUSBR" },
- { .key = DFU_STATUS_ERR_POR , .data = "errPOR" },
- { .key = DFU_STATUS_ERR_UNKNOWN , .data = "errUNKNOWN" },
- { .key = DFU_STATUS_ERR_STALLEDPKT , .data = "errSTALLEDPKT" },
-};
-
-static tu_lookup_table_t const _dfu_status_table =
-{
- .count = TU_ARRAY_SIZE(_dfu_status_lookup),
- .items = _dfu_status_lookup
-};
-
-#endif
-
-//--------------------------------------------------------------------+
-// USBD Driver API
-//--------------------------------------------------------------------+
-void dfu_moded_reset(uint8_t rhport)
-{
- (void) rhport;
-
- _dfu_ctx.attrs = 0;
- _dfu_ctx.alt = 0;
-
- reset_state();
-}
-
-void dfu_moded_init(void)
-{
- dfu_moded_reset(0);
-}
-
-uint16_t dfu_moded_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len)
-{
- (void) rhport;
-
- //------------- Interface (with Alt) descriptor -------------//
- uint8_t const itf_num = itf_desc->bInterfaceNumber;
- uint8_t alt_count = 0;
-
- uint16_t drv_len = 0;
- while(itf_desc->bInterfaceSubClass == TUD_DFU_APP_SUBCLASS && itf_desc->bInterfaceProtocol == DFU_PROTOCOL_DFU)
- {
- TU_ASSERT(max_len > drv_len, 0);
-
- // Alternate must have the same interface number
- TU_ASSERT(itf_desc->bInterfaceNumber == itf_num, 0);
-
- // Alt should increase by one every time
- TU_ASSERT(itf_desc->bAlternateSetting == alt_count, 0);
- alt_count++;
-
- drv_len += tu_desc_len(itf_desc);
- itf_desc = (tusb_desc_interface_t const *) tu_desc_next(itf_desc);
- }
-
- //------------- DFU Functional descriptor -------------//
- tusb_desc_dfu_functional_t const *func_desc = (tusb_desc_dfu_functional_t const *) itf_desc;
- TU_ASSERT(tu_desc_type(func_desc) == TUSB_DESC_FUNCTIONAL, 0);
- drv_len += sizeof(tusb_desc_dfu_functional_t);
-
- _dfu_ctx.attrs = func_desc->bAttributes;
-
- // CFG_TUD_DFU_XFER_BUFSIZE has to be set to the buffer size used in TUD_DFU_DESCRIPTOR
- uint16_t const transfer_size = tu_le16toh( tu_unaligned_read16((uint8_t*) func_desc + offsetof(tusb_desc_dfu_functional_t, wTransferSize)) );
- TU_ASSERT(transfer_size <= CFG_TUD_DFU_XFER_BUFSIZE, drv_len);
-
- return drv_len;
-}
-
-// Invoked when a control transfer occurred on an interface of this class
-// Driver response accordingly to the request and the transfer stage (setup/data/ack)
-// return false to stall control endpoint (e.g unsupported request)
-bool dfu_moded_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
-{
- TU_VERIFY(request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_INTERFACE);
-
- TU_LOG2(" DFU State : %s, Status: %s\r\n", tu_lookup_find(&_dfu_state_table, _dfu_ctx.state), tu_lookup_find(&_dfu_status_table, _dfu_ctx.status));
-
- if ( request->bmRequestType_bit.type == TUSB_REQ_TYPE_STANDARD )
- {
- // Standard request include GET/SET_INTERFACE
- switch ( request->bRequest )
- {
- case TUSB_REQ_SET_INTERFACE:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- // Switch Alt interface and reset state machine
- _dfu_ctx.alt = (uint8_t) request->wValue;
- reset_state();
- return tud_control_status(rhport, request);
- }
- break;
-
- case TUSB_REQ_GET_INTERFACE:
- if(stage == CONTROL_STAGE_SETUP)
- {
- return tud_control_xfer(rhport, request, &_dfu_ctx.alt, 1);
- }
- break;
-
- // unsupported request
- default: return false;
- }
- }
- else if ( request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS )
- {
- TU_LOG2(" DFU Request: %s\r\n", tu_lookup_find(&_dfu_request_table, request->bRequest));
-
- // Class request
- switch ( request->bRequest )
- {
- case DFU_REQUEST_DETACH:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- tud_control_status(rhport, request);
- }
- else if ( stage == CONTROL_STAGE_ACK )
- {
- if ( tud_dfu_detach_cb ) tud_dfu_detach_cb();
- }
- break;
-
- case DFU_REQUEST_CLRSTATUS:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- reset_state();
- tud_control_status(rhport, request);
- }
- break;
-
- case DFU_REQUEST_GETSTATE:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- tud_control_xfer(rhport, request, &_dfu_ctx.state, 1);
- }
- break;
-
- case DFU_REQUEST_ABORT:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- reset_state();
- tud_control_status(rhport, request);
- }
- else if ( stage == CONTROL_STAGE_ACK )
- {
- if ( tud_dfu_abort_cb ) tud_dfu_abort_cb(_dfu_ctx.alt);
- }
- break;
-
- case DFU_REQUEST_UPLOAD:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- TU_VERIFY(_dfu_ctx.attrs & DFU_ATTR_CAN_UPLOAD);
- TU_VERIFY(tud_dfu_upload_cb);
- TU_VERIFY(request->wLength <= CFG_TUD_DFU_XFER_BUFSIZE);
-
- uint16_t const xfer_len = tud_dfu_upload_cb(_dfu_ctx.alt, request->wValue, _dfu_ctx.transfer_buf, request->wLength);
-
- return tud_control_xfer(rhport, request, _dfu_ctx.transfer_buf, xfer_len);
- }
- break;
-
- case DFU_REQUEST_DNLOAD:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- TU_VERIFY(_dfu_ctx.attrs & DFU_ATTR_CAN_DOWNLOAD);
- TU_VERIFY(_dfu_ctx.state == DFU_IDLE || _dfu_ctx.state == DFU_DNLOAD_IDLE);
- TU_VERIFY(request->wLength <= CFG_TUD_DFU_XFER_BUFSIZE);
-
- // set to true for both download and manifest
- _dfu_ctx.flashing_in_progress = true;
-
- // save block and length for flashing
- _dfu_ctx.block = request->wValue;
- _dfu_ctx.length = request->wLength;
-
- if ( request->wLength )
- {
- // Download with payload -> transition to DOWNLOAD SYNC
- _dfu_ctx.state = DFU_DNLOAD_SYNC;
- return tud_control_xfer(rhport, request, _dfu_ctx.transfer_buf, request->wLength);
- }
- else
- {
- // Download is complete -> transition to MANIFEST SYNC
- _dfu_ctx.state = DFU_MANIFEST_SYNC;
- return tud_control_status(rhport, request);
- }
- }
- break;
-
- case DFU_REQUEST_GETSTATUS:
- switch ( _dfu_ctx.state )
- {
- case DFU_DNLOAD_SYNC:
- return process_download_get_status(rhport, stage, request);
- break;
-
- case DFU_MANIFEST_SYNC:
- return process_manifest_get_status(rhport, stage, request);
- break;
-
- default:
- if ( stage == CONTROL_STAGE_SETUP ) return reply_getstatus(rhport, request, _dfu_ctx.state, _dfu_ctx.status, 0);
- break;
- }
- break;
-
- default: return false; // stall unsupported request
- }
- }else
- {
- return false; // unsupported request
- }
-
- return true;
-}
-
-void tud_dfu_finish_flashing(uint8_t status)
-{
- _dfu_ctx.flashing_in_progress = false;
-
- if ( status == DFU_STATUS_OK )
- {
- if (_dfu_ctx.state == DFU_DNBUSY)
- {
- _dfu_ctx.state = DFU_DNLOAD_SYNC;
- }
- else if (_dfu_ctx.state == DFU_MANIFEST)
- {
- _dfu_ctx.state = (_dfu_ctx.attrs & DFU_ATTR_MANIFESTATION_TOLERANT)
- ? DFU_MANIFEST_SYNC : DFU_MANIFEST_WAIT_RESET;
- }
- }
- else
- {
- // failed while flashing, move to dfuError
- _dfu_ctx.state = DFU_ERROR;
- _dfu_ctx.status = (dfu_status_t)status;
- }
-}
-
-static bool process_download_get_status(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
-{
- if ( stage == CONTROL_STAGE_SETUP )
- {
- // only transition to next state on CONTROL_STAGE_ACK
- dfu_state_t next_state;
- uint32_t timeout;
-
- if ( _dfu_ctx.flashing_in_progress )
- {
- next_state = DFU_DNBUSY;
- timeout = tud_dfu_get_timeout_cb(_dfu_ctx.alt, (uint8_t) next_state);
- }
- else
- {
- next_state = DFU_DNLOAD_IDLE;
- timeout = 0;
- }
-
- return reply_getstatus(rhport, request, next_state, _dfu_ctx.status, timeout);
- }
- else if ( stage == CONTROL_STAGE_ACK )
- {
- if ( _dfu_ctx.flashing_in_progress )
- {
- _dfu_ctx.state = DFU_DNBUSY;
- tud_dfu_download_cb(_dfu_ctx.alt, _dfu_ctx.block, _dfu_ctx.transfer_buf, _dfu_ctx.length);
- }else
- {
- _dfu_ctx.state = DFU_DNLOAD_IDLE;
- }
- }
-
- return true;
-}
-
-static bool process_manifest_get_status(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
-{
- if ( stage == CONTROL_STAGE_SETUP )
- {
- // only transition to next state on CONTROL_STAGE_ACK
- dfu_state_t next_state;
- uint32_t timeout;
-
- if ( _dfu_ctx.flashing_in_progress )
- {
- next_state = DFU_MANIFEST;
- timeout = tud_dfu_get_timeout_cb(_dfu_ctx.alt, next_state);
- }
- else
- {
- next_state = DFU_IDLE;
- timeout = 0;
- }
-
- return reply_getstatus(rhport, request, next_state, _dfu_ctx.status, timeout);
- }
- else if ( stage == CONTROL_STAGE_ACK )
- {
- if ( _dfu_ctx.flashing_in_progress )
- {
- _dfu_ctx.state = DFU_MANIFEST;
- tud_dfu_manifest_cb(_dfu_ctx.alt);
- }
- else
- {
- _dfu_ctx.state = DFU_IDLE;
- }
- }
-
- return true;
-}
-
-static bool reply_getstatus(uint8_t rhport, tusb_control_request_t const * request, dfu_state_t state, dfu_status_t status, uint32_t timeout)
-{
- dfu_status_response_t resp;
- resp.bStatus = (uint8_t) status;
- resp.bwPollTimeout[0] = TU_U32_BYTE0(timeout);
- resp.bwPollTimeout[1] = TU_U32_BYTE1(timeout);
- resp.bwPollTimeout[2] = TU_U32_BYTE2(timeout);
- resp.bState = (uint8_t) state;
- resp.iString = 0;
-
- return tud_control_xfer(rhport, request, &resp, sizeof(dfu_status_response_t));
-}
-
-#endif
diff --git a/tinyusb/src/class/dfu/dfu_device.h b/tinyusb/src/class/dfu/dfu_device.h
deleted file mode 100755
index fecf8596..00000000
--- a/tinyusb/src/class/dfu/dfu_device.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021 XMOS LIMITED
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_DFU_DEVICE_H_
-#define _TUSB_DFU_DEVICE_H_
-
-#include "dfu.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Class Driver Default Configure & Validation
-//--------------------------------------------------------------------+
-
-#if !defined(CFG_TUD_DFU_XFER_BUFSIZE)
- #error "CFG_TUD_DFU_XFER_BUFSIZE must be defined, it has to be set to the buffer size used in TUD_DFU_DESCRIPTOR"
-#endif
-
-//--------------------------------------------------------------------+
-// Application API
-//--------------------------------------------------------------------+
-
-// Must be called when the application is done with flashing started by
-// tud_dfu_download_cb() and tud_dfu_manifest_cb().
-// status is DFU_STATUS_OK if successful, any other error status will cause state to enter dfuError
-void tud_dfu_finish_flashing(uint8_t status);
-
-//--------------------------------------------------------------------+
-// Application Callback API (weak is optional)
-//--------------------------------------------------------------------+
-
-// Note: alt is used as the partition number, in order to support multiple partitions like FLASH, EEPROM, etc.
-
-// Invoked right before tud_dfu_download_cb() (state=DFU_DNBUSY) or tud_dfu_manifest_cb() (state=DFU_MANIFEST)
-// Application return timeout in milliseconds (bwPollTimeout) for the next download/manifest operation.
-// During this period, USB host won't try to communicate with us.
-uint32_t tud_dfu_get_timeout_cb(uint8_t alt, uint8_t state);
-
-// Invoked when received DFU_DNLOAD (wLength>0) following by DFU_GETSTATUS (state=DFU_DNBUSY) requests
-// This callback could be returned before flashing op is complete (async).
-// Once finished flashing, application must call tud_dfu_finish_flashing()
-void tud_dfu_download_cb (uint8_t alt, uint16_t block_num, uint8_t const *data, uint16_t length);
-
-// Invoked when download process is complete, received DFU_DNLOAD (wLength=0) following by DFU_GETSTATUS (state=Manifest)
-// Application can do checksum, or actual flashing if buffered entire image previously.
-// Once finished flashing, application must call tud_dfu_finish_flashing()
-void tud_dfu_manifest_cb(uint8_t alt);
-
-// Invoked when received DFU_UPLOAD request
-// Application must populate data with up to length bytes and
-// Return the number of written bytes
-TU_ATTR_WEAK uint16_t tud_dfu_upload_cb(uint8_t alt, uint16_t block_num, uint8_t* data, uint16_t length);
-
-// Invoked when a DFU_DETACH request is received
-TU_ATTR_WEAK void tud_dfu_detach_cb(void);
-
-// Invoked when the Host has terminated a download or upload transfer
-TU_ATTR_WEAK void tud_dfu_abort_cb(uint8_t alt);
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-void dfu_moded_init(void);
-void dfu_moded_reset(uint8_t rhport);
-uint16_t dfu_moded_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
-bool dfu_moded_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
-
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_DFU_MODE_DEVICE_H_ */
diff --git a/tinyusb/src/class/dfu/dfu_rt_device.c b/tinyusb/src/class/dfu/dfu_rt_device.c
deleted file mode 100755
index afee2aa1..00000000
--- a/tinyusb/src/class/dfu/dfu_rt_device.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Sylvain Munaut <tnt@246tNt.com>
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_DFU_RUNTIME)
-
-#include "device/usbd.h"
-#include "device/usbd_pvt.h"
-
-#include "dfu_rt_device.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-
-//--------------------------------------------------------------------+
-// USBD Driver API
-//--------------------------------------------------------------------+
-void dfu_rtd_init(void)
-{
-}
-
-void dfu_rtd_reset(uint8_t rhport)
-{
- (void) rhport;
-}
-
-uint16_t dfu_rtd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len)
-{
- (void) rhport;
- (void) max_len;
-
- // Ensure this is DFU Runtime
- TU_VERIFY((itf_desc->bInterfaceSubClass == TUD_DFU_APP_SUBCLASS) &&
- (itf_desc->bInterfaceProtocol == DFU_PROTOCOL_RT), 0);
-
- uint8_t const * p_desc = tu_desc_next( itf_desc );
- uint16_t drv_len = sizeof(tusb_desc_interface_t);
-
- if ( TUSB_DESC_FUNCTIONAL == tu_desc_type(p_desc) )
- {
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
- }
-
- return drv_len;
-}
-
-// Invoked when a control transfer occurred on an interface of this class
-// Driver response accordingly to the request and the transfer stage (setup/data/ack)
-// return false to stall control endpoint (e.g unsupported request)
-bool dfu_rtd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
-{
- // nothing to do with DATA or ACK stage
- if ( stage != CONTROL_STAGE_SETUP ) return true;
-
- TU_VERIFY(request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_INTERFACE);
-
- // dfu-util will try to claim the interface with SET_INTERFACE request before sending DFU request
- if ( TUSB_REQ_TYPE_STANDARD == request->bmRequestType_bit.type &&
- TUSB_REQ_SET_INTERFACE == request->bRequest )
- {
- tud_control_status(rhport, request);
- return true;
- }
-
- // Handle class request only from here
- TU_VERIFY(request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS);
-
- switch (request->bRequest)
- {
- case DFU_REQUEST_DETACH:
- {
- TU_LOG2(" DFU RT Request: DETACH\r\n");
- tud_control_status(rhport, request);
- tud_dfu_runtime_reboot_to_dfu_cb();
- }
- break;
-
- case DFU_REQUEST_GETSTATUS:
- {
- TU_LOG2(" DFU RT Request: GETSTATUS\r\n");
- dfu_status_response_t resp;
- // Status = OK, Poll timeout is ignored during RT, State = APP_IDLE, IString = 0
- memset(&resp, 0x00, sizeof(dfu_status_response_t));
- tud_control_xfer(rhport, request, &resp, sizeof(dfu_status_response_t));
- }
- break;
-
- default:
- {
- TU_LOG2(" DFU RT Unexpected Request: %d\r\n", request->bRequest);
- return false; // stall unsupported request
- }
- }
-
- return true;
-}
-
-#endif
diff --git a/tinyusb/src/class/dfu/dfu_rt_device.h b/tinyusb/src/class/dfu/dfu_rt_device.h
deleted file mode 100755
index babaa821..00000000
--- a/tinyusb/src/class/dfu/dfu_rt_device.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Sylvain Munaut <tnt@246tNt.com>
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_DFU_RT_DEVICE_H_
-#define _TUSB_DFU_RT_DEVICE_H_
-
-#include "dfu.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Application Callback API (weak is optional)
-//--------------------------------------------------------------------+
-// Invoked when a DFU_DETACH request is received and bitWillDetach is set
-void tud_dfu_runtime_reboot_to_dfu_cb(void);
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-void dfu_rtd_init(void);
-void dfu_rtd_reset(uint8_t rhport);
-uint16_t dfu_rtd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
-bool dfu_rtd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_DFU_RT_DEVICE_H_ */
diff --git a/tinyusb/src/class/hid/hid.h b/tinyusb/src/class/hid/hid.h
deleted file mode 100755
index 9265a2ed..00000000
--- a/tinyusb/src/class/hid/hid.h
+++ /dev/null
@@ -1,1119 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup group_class
- * \defgroup ClassDriver_HID Human Interface Device (HID)
- * @{ */
-
-#ifndef _TUSB_HID_H_
-#define _TUSB_HID_H_
-
-#include "common/tusb_common.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Common Definitions
-//--------------------------------------------------------------------+
-/** \defgroup ClassDriver_HID_Common Common Definitions
- * @{ */
-
- /// USB HID Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength; /**< Numeric expression that is the total size of the HID descriptor */
- uint8_t bDescriptorType; /**< Constant name specifying type of HID descriptor. */
-
- uint16_t bcdHID; /**< Numeric expression identifying the HID Class Specification release */
- uint8_t bCountryCode; /**< Numeric expression identifying country code of the localized hardware. */
- uint8_t bNumDescriptors; /**< Numeric expression specifying the number of class descriptors */
-
- uint8_t bReportType; /**< Type of HID class report. */
- uint16_t wReportLength; /**< the total size of the Report descriptor. */
-} tusb_hid_descriptor_hid_t;
-
-/// HID Subclass
-typedef enum
-{
- HID_SUBCLASS_NONE = 0, ///< No Subclass
- HID_SUBCLASS_BOOT = 1 ///< Boot Interface Subclass
-}hid_subclass_enum_t;
-
-/// HID Interface Protocol
-typedef enum
-{
- HID_ITF_PROTOCOL_NONE = 0, ///< None
- HID_ITF_PROTOCOL_KEYBOARD = 1, ///< Keyboard
- HID_ITF_PROTOCOL_MOUSE = 2 ///< Mouse
-}hid_interface_protocol_enum_t;
-
-/// HID Descriptor Type
-typedef enum
-{
- HID_DESC_TYPE_HID = 0x21, ///< HID Descriptor
- HID_DESC_TYPE_REPORT = 0x22, ///< Report Descriptor
- HID_DESC_TYPE_PHYSICAL = 0x23 ///< Physical Descriptor
-}hid_descriptor_enum_t;
-
-/// HID Request Report Type
-typedef enum
-{
- HID_REPORT_TYPE_INVALID = 0,
- HID_REPORT_TYPE_INPUT, ///< Input
- HID_REPORT_TYPE_OUTPUT, ///< Output
- HID_REPORT_TYPE_FEATURE ///< Feature
-}hid_report_type_t;
-
-/// HID Class Specific Control Request
-typedef enum
-{
- HID_REQ_CONTROL_GET_REPORT = 0x01, ///< Get Report
- HID_REQ_CONTROL_GET_IDLE = 0x02, ///< Get Idle
- HID_REQ_CONTROL_GET_PROTOCOL = 0x03, ///< Get Protocol
- HID_REQ_CONTROL_SET_REPORT = 0x09, ///< Set Report
- HID_REQ_CONTROL_SET_IDLE = 0x0a, ///< Set Idle
- HID_REQ_CONTROL_SET_PROTOCOL = 0x0b ///< Set Protocol
-}hid_request_enum_t;
-
-/// HID Local Code
-typedef enum
-{
- HID_LOCAL_NotSupported = 0 , ///< NotSupported
- HID_LOCAL_Arabic , ///< Arabic
- HID_LOCAL_Belgian , ///< Belgian
- HID_LOCAL_Canadian_Bilingual , ///< Canadian_Bilingual
- HID_LOCAL_Canadian_French , ///< Canadian_French
- HID_LOCAL_Czech_Republic , ///< Czech_Republic
- HID_LOCAL_Danish , ///< Danish
- HID_LOCAL_Finnish , ///< Finnish
- HID_LOCAL_French , ///< French
- HID_LOCAL_German , ///< German
- HID_LOCAL_Greek , ///< Greek
- HID_LOCAL_Hebrew , ///< Hebrew
- HID_LOCAL_Hungary , ///< Hungary
- HID_LOCAL_International , ///< International
- HID_LOCAL_Italian , ///< Italian
- HID_LOCAL_Japan_Katakana , ///< Japan_Katakana
- HID_LOCAL_Korean , ///< Korean
- HID_LOCAL_Latin_American , ///< Latin_American
- HID_LOCAL_Netherlands_Dutch , ///< Netherlands/Dutch
- HID_LOCAL_Norwegian , ///< Norwegian
- HID_LOCAL_Persian_Farsi , ///< Persian (Farsi)
- HID_LOCAL_Poland , ///< Poland
- HID_LOCAL_Portuguese , ///< Portuguese
- HID_LOCAL_Russia , ///< Russia
- HID_LOCAL_Slovakia , ///< Slovakia
- HID_LOCAL_Spanish , ///< Spanish
- HID_LOCAL_Swedish , ///< Swedish
- HID_LOCAL_Swiss_French , ///< Swiss/French
- HID_LOCAL_Swiss_German , ///< Swiss/German
- HID_LOCAL_Switzerland , ///< Switzerland
- HID_LOCAL_Taiwan , ///< Taiwan
- HID_LOCAL_Turkish_Q , ///< Turkish-Q
- HID_LOCAL_UK , ///< UK
- HID_LOCAL_US , ///< US
- HID_LOCAL_Yugoslavia , ///< Yugoslavia
- HID_LOCAL_Turkish_F ///< Turkish-F
-} hid_local_enum_t;
-
-// HID protocol value used by GetProtocol / SetProtocol
-typedef enum
-{
- HID_PROTOCOL_BOOT = 0,
- HID_PROTOCOL_REPORT = 1
-} hid_protocol_mode_enum_t;
-
-/** @} */
-
-//--------------------------------------------------------------------+
-// GAMEPAD
-//--------------------------------------------------------------------+
-/** \addtogroup ClassDriver_HID_Gamepad Gamepad
- * @{ */
-
-/* From https://www.kernel.org/doc/html/latest/input/gamepad.html
- ____________________________ __
- / [__ZL__] [__ZR__] \ |
- / [__ TL __] [__ TR __] \ | Front Triggers
- __/________________________________\__ __|
- / _ \ |
- / /\ __ (N) \ |
- / || __ |MO| __ _ _ \ | Main Pad
- | <===DP===> |SE| |ST| (W) -|- (E) | |
- \ || ___ ___ _ / |
- /\ \/ / \ / \ (S) /\ __|
- / \________ | LS | ____ | RS | ________/ \ |
-| / \ \___/ / \ \___/ / \ | | Control Sticks
-| / \_____/ \_____/ \ | __|
-| / \ |
- \_____/ \_____/
-
- |________|______| |______|___________|
- D-Pad Left Right Action Pad
- Stick Stick
-
- |_____________|
- Menu Pad
-
- Most gamepads have the following features:
- - Action-Pad 4 buttons in diamonds-shape (on the right side) NORTH, SOUTH, WEST and EAST.
- - D-Pad (Direction-pad) 4 buttons (on the left side) that point up, down, left and right.
- - Menu-Pad Different constellations, but most-times 2 buttons: SELECT - START.
- - Analog-Sticks provide freely moveable sticks to control directions, Analog-sticks may also
- provide a digital button if you press them.
- - Triggers are located on the upper-side of the pad in vertical direction. The upper buttons
- are normally named Left- and Right-Triggers, the lower buttons Z-Left and Z-Right.
- - Rumble Many devices provide force-feedback features. But are mostly just simple rumble motors.
- */
-
-/// HID Gamepad Protocol Report.
-typedef struct TU_ATTR_PACKED
-{
- int8_t x; ///< Delta x movement of left analog-stick
- int8_t y; ///< Delta y movement of left analog-stick
- int8_t z; ///< Delta z movement of right analog-joystick
- int8_t rz; ///< Delta Rz movement of right analog-joystick
- int8_t rx; ///< Delta Rx movement of analog left trigger
- int8_t ry; ///< Delta Ry movement of analog right trigger
- uint8_t hat; ///< Buttons mask for currently pressed buttons in the DPad/hat
- uint32_t buttons; ///< Buttons mask for currently pressed buttons
-}hid_gamepad_report_t;
-
-/// Standard Gamepad Buttons Bitmap
-typedef enum
-{
- GAMEPAD_BUTTON_0 = TU_BIT(0),
- GAMEPAD_BUTTON_1 = TU_BIT(1),
- GAMEPAD_BUTTON_2 = TU_BIT(2),
- GAMEPAD_BUTTON_3 = TU_BIT(3),
- GAMEPAD_BUTTON_4 = TU_BIT(4),
- GAMEPAD_BUTTON_5 = TU_BIT(5),
- GAMEPAD_BUTTON_6 = TU_BIT(6),
- GAMEPAD_BUTTON_7 = TU_BIT(7),
- GAMEPAD_BUTTON_8 = TU_BIT(8),
- GAMEPAD_BUTTON_9 = TU_BIT(9),
- GAMEPAD_BUTTON_10 = TU_BIT(10),
- GAMEPAD_BUTTON_11 = TU_BIT(11),
- GAMEPAD_BUTTON_12 = TU_BIT(12),
- GAMEPAD_BUTTON_13 = TU_BIT(13),
- GAMEPAD_BUTTON_14 = TU_BIT(14),
- GAMEPAD_BUTTON_15 = TU_BIT(15),
- GAMEPAD_BUTTON_16 = TU_BIT(16),
- GAMEPAD_BUTTON_17 = TU_BIT(17),
- GAMEPAD_BUTTON_18 = TU_BIT(18),
- GAMEPAD_BUTTON_19 = TU_BIT(19),
- GAMEPAD_BUTTON_20 = TU_BIT(20),
- GAMEPAD_BUTTON_21 = TU_BIT(21),
- GAMEPAD_BUTTON_22 = TU_BIT(22),
- GAMEPAD_BUTTON_23 = TU_BIT(23),
- GAMEPAD_BUTTON_24 = TU_BIT(24),
- GAMEPAD_BUTTON_25 = TU_BIT(25),
- GAMEPAD_BUTTON_26 = TU_BIT(26),
- GAMEPAD_BUTTON_27 = TU_BIT(27),
- GAMEPAD_BUTTON_28 = TU_BIT(28),
- GAMEPAD_BUTTON_29 = TU_BIT(29),
- GAMEPAD_BUTTON_30 = TU_BIT(30),
- GAMEPAD_BUTTON_31 = TU_BIT(31),
-}hid_gamepad_button_bm_t;
-
-/// Standard Gamepad Buttons Naming from Linux input event codes
-/// https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h
-#define GAMEPAD_BUTTON_A GAMEPAD_BUTTON_0
-#define GAMEPAD_BUTTON_SOUTH GAMEPAD_BUTTON_0
-
-#define GAMEPAD_BUTTON_B GAMEPAD_BUTTON_1
-#define GAMEPAD_BUTTON_EAST GAMEPAD_BUTTON_1
-
-#define GAMEPAD_BUTTON_C GAMEPAD_BUTTON_2
-
-#define GAMEPAD_BUTTON_X GAMEPAD_BUTTON_3
-#define GAMEPAD_BUTTON_NORTH GAMEPAD_BUTTON_3
-
-#define GAMEPAD_BUTTON_Y GAMEPAD_BUTTON_4
-#define GAMEPAD_BUTTON_WEST GAMEPAD_BUTTON_4
-
-#define GAMEPAD_BUTTON_Z GAMEPAD_BUTTON_5
-#define GAMEPAD_BUTTON_TL GAMEPAD_BUTTON_6
-#define GAMEPAD_BUTTON_TR GAMEPAD_BUTTON_7
-#define GAMEPAD_BUTTON_TL2 GAMEPAD_BUTTON_8
-#define GAMEPAD_BUTTON_TR2 GAMEPAD_BUTTON_9
-#define GAMEPAD_BUTTON_SELECT GAMEPAD_BUTTON_10
-#define GAMEPAD_BUTTON_START GAMEPAD_BUTTON_11
-#define GAMEPAD_BUTTON_MODE GAMEPAD_BUTTON_12
-#define GAMEPAD_BUTTON_THUMBL GAMEPAD_BUTTON_13
-#define GAMEPAD_BUTTON_THUMBR GAMEPAD_BUTTON_14
-
-/// Standard Gamepad HAT/DPAD Buttons (from Linux input event codes)
-typedef enum
-{
- GAMEPAD_HAT_CENTERED = 0, ///< DPAD_CENTERED
- GAMEPAD_HAT_UP = 1, ///< DPAD_UP
- GAMEPAD_HAT_UP_RIGHT = 2, ///< DPAD_UP_RIGHT
- GAMEPAD_HAT_RIGHT = 3, ///< DPAD_RIGHT
- GAMEPAD_HAT_DOWN_RIGHT = 4, ///< DPAD_DOWN_RIGHT
- GAMEPAD_HAT_DOWN = 5, ///< DPAD_DOWN
- GAMEPAD_HAT_DOWN_LEFT = 6, ///< DPAD_DOWN_LEFT
- GAMEPAD_HAT_LEFT = 7, ///< DPAD_LEFT
- GAMEPAD_HAT_UP_LEFT = 8, ///< DPAD_UP_LEFT
-}hid_gamepad_hat_t;
-
-/// @}
-
-//--------------------------------------------------------------------+
-// MOUSE
-//--------------------------------------------------------------------+
-/** \addtogroup ClassDriver_HID_Mouse Mouse
- * @{ */
-
-/// Standard HID Boot Protocol Mouse Report.
-typedef struct TU_ATTR_PACKED
-{
- uint8_t buttons; /**< buttons mask for currently pressed buttons in the mouse. */
- int8_t x; /**< Current delta x movement of the mouse. */
- int8_t y; /**< Current delta y movement on the mouse. */
- int8_t wheel; /**< Current delta wheel movement on the mouse. */
- int8_t pan; // using AC Pan
-} hid_mouse_report_t;
-
-/// Standard Mouse Buttons Bitmap
-typedef enum
-{
- MOUSE_BUTTON_LEFT = TU_BIT(0), ///< Left button
- MOUSE_BUTTON_RIGHT = TU_BIT(1), ///< Right button
- MOUSE_BUTTON_MIDDLE = TU_BIT(2), ///< Middle button
- MOUSE_BUTTON_BACKWARD = TU_BIT(3), ///< Backward button,
- MOUSE_BUTTON_FORWARD = TU_BIT(4), ///< Forward button,
-}hid_mouse_button_bm_t;
-
-/// @}
-
-//--------------------------------------------------------------------+
-// Keyboard
-//--------------------------------------------------------------------+
-/** \addtogroup ClassDriver_HID_Keyboard Keyboard
- * @{ */
-
-/// Standard HID Boot Protocol Keyboard Report.
-typedef struct TU_ATTR_PACKED
-{
- uint8_t modifier; /**< Keyboard modifier (KEYBOARD_MODIFIER_* masks). */
- uint8_t reserved; /**< Reserved for OEM use, always set to 0. */
- uint8_t keycode[6]; /**< Key codes of the currently pressed keys. */
-} hid_keyboard_report_t;
-
-/// Keyboard modifier codes bitmap
-typedef enum
-{
- KEYBOARD_MODIFIER_LEFTCTRL = TU_BIT(0), ///< Left Control
- KEYBOARD_MODIFIER_LEFTSHIFT = TU_BIT(1), ///< Left Shift
- KEYBOARD_MODIFIER_LEFTALT = TU_BIT(2), ///< Left Alt
- KEYBOARD_MODIFIER_LEFTGUI = TU_BIT(3), ///< Left Window
- KEYBOARD_MODIFIER_RIGHTCTRL = TU_BIT(4), ///< Right Control
- KEYBOARD_MODIFIER_RIGHTSHIFT = TU_BIT(5), ///< Right Shift
- KEYBOARD_MODIFIER_RIGHTALT = TU_BIT(6), ///< Right Alt
- KEYBOARD_MODIFIER_RIGHTGUI = TU_BIT(7) ///< Right Window
-}hid_keyboard_modifier_bm_t;
-
-typedef enum
-{
- KEYBOARD_LED_NUMLOCK = TU_BIT(0), ///< Num Lock LED
- KEYBOARD_LED_CAPSLOCK = TU_BIT(1), ///< Caps Lock LED
- KEYBOARD_LED_SCROLLLOCK = TU_BIT(2), ///< Scroll Lock LED
- KEYBOARD_LED_COMPOSE = TU_BIT(3), ///< Composition Mode
- KEYBOARD_LED_KANA = TU_BIT(4) ///< Kana mode
-}hid_keyboard_led_bm_t;
-
-/// @}
-
-//--------------------------------------------------------------------+
-// HID KEYCODE
-//--------------------------------------------------------------------+
-#define HID_KEY_NONE 0x00
-#define HID_KEY_A 0x04
-#define HID_KEY_B 0x05
-#define HID_KEY_C 0x06
-#define HID_KEY_D 0x07
-#define HID_KEY_E 0x08
-#define HID_KEY_F 0x09
-#define HID_KEY_G 0x0A
-#define HID_KEY_H 0x0B
-#define HID_KEY_I 0x0C
-#define HID_KEY_J 0x0D
-#define HID_KEY_K 0x0E
-#define HID_KEY_L 0x0F
-#define HID_KEY_M 0x10
-#define HID_KEY_N 0x11
-#define HID_KEY_O 0x12
-#define HID_KEY_P 0x13
-#define HID_KEY_Q 0x14
-#define HID_KEY_R 0x15
-#define HID_KEY_S 0x16
-#define HID_KEY_T 0x17
-#define HID_KEY_U 0x18
-#define HID_KEY_V 0x19
-#define HID_KEY_W 0x1A
-#define HID_KEY_X 0x1B
-#define HID_KEY_Y 0x1C
-#define HID_KEY_Z 0x1D
-#define HID_KEY_1 0x1E
-#define HID_KEY_2 0x1F
-#define HID_KEY_3 0x20
-#define HID_KEY_4 0x21
-#define HID_KEY_5 0x22
-#define HID_KEY_6 0x23
-#define HID_KEY_7 0x24
-#define HID_KEY_8 0x25
-#define HID_KEY_9 0x26
-#define HID_KEY_0 0x27
-#define HID_KEY_ENTER 0x28
-#define HID_KEY_ESCAPE 0x29
-#define HID_KEY_BACKSPACE 0x2A
-#define HID_KEY_TAB 0x2B
-#define HID_KEY_SPACE 0x2C
-#define HID_KEY_MINUS 0x2D
-#define HID_KEY_EQUAL 0x2E
-#define HID_KEY_BRACKET_LEFT 0x2F
-#define HID_KEY_BRACKET_RIGHT 0x30
-#define HID_KEY_BACKSLASH 0x31
-#define HID_KEY_EUROPE_1 0x32
-#define HID_KEY_SEMICOLON 0x33
-#define HID_KEY_APOSTROPHE 0x34
-#define HID_KEY_GRAVE 0x35
-#define HID_KEY_COMMA 0x36
-#define HID_KEY_PERIOD 0x37
-#define HID_KEY_SLASH 0x38
-#define HID_KEY_CAPS_LOCK 0x39
-#define HID_KEY_F1 0x3A
-#define HID_KEY_F2 0x3B
-#define HID_KEY_F3 0x3C
-#define HID_KEY_F4 0x3D
-#define HID_KEY_F5 0x3E
-#define HID_KEY_F6 0x3F
-#define HID_KEY_F7 0x40
-#define HID_KEY_F8 0x41
-#define HID_KEY_F9 0x42
-#define HID_KEY_F10 0x43
-#define HID_KEY_F11 0x44
-#define HID_KEY_F12 0x45
-#define HID_KEY_PRINT_SCREEN 0x46
-#define HID_KEY_SCROLL_LOCK 0x47
-#define HID_KEY_PAUSE 0x48
-#define HID_KEY_INSERT 0x49
-#define HID_KEY_HOME 0x4A
-#define HID_KEY_PAGE_UP 0x4B
-#define HID_KEY_DELETE 0x4C
-#define HID_KEY_END 0x4D
-#define HID_KEY_PAGE_DOWN 0x4E
-#define HID_KEY_ARROW_RIGHT 0x4F
-#define HID_KEY_ARROW_LEFT 0x50
-#define HID_KEY_ARROW_DOWN 0x51
-#define HID_KEY_ARROW_UP 0x52
-#define HID_KEY_NUM_LOCK 0x53
-#define HID_KEY_KEYPAD_DIVIDE 0x54
-#define HID_KEY_KEYPAD_MULTIPLY 0x55
-#define HID_KEY_KEYPAD_SUBTRACT 0x56
-#define HID_KEY_KEYPAD_ADD 0x57
-#define HID_KEY_KEYPAD_ENTER 0x58
-#define HID_KEY_KEYPAD_1 0x59
-#define HID_KEY_KEYPAD_2 0x5A
-#define HID_KEY_KEYPAD_3 0x5B
-#define HID_KEY_KEYPAD_4 0x5C
-#define HID_KEY_KEYPAD_5 0x5D
-#define HID_KEY_KEYPAD_6 0x5E
-#define HID_KEY_KEYPAD_7 0x5F
-#define HID_KEY_KEYPAD_8 0x60
-#define HID_KEY_KEYPAD_9 0x61
-#define HID_KEY_KEYPAD_0 0x62
-#define HID_KEY_KEYPAD_DECIMAL 0x63
-#define HID_KEY_EUROPE_2 0x64
-#define HID_KEY_APPLICATION 0x65
-#define HID_KEY_POWER 0x66
-#define HID_KEY_KEYPAD_EQUAL 0x67
-#define HID_KEY_F13 0x68
-#define HID_KEY_F14 0x69
-#define HID_KEY_F15 0x6A
-#define HID_KEY_F16 0x6B
-#define HID_KEY_F17 0x6C
-#define HID_KEY_F18 0x6D
-#define HID_KEY_F19 0x6E
-#define HID_KEY_F20 0x6F
-#define HID_KEY_F21 0x70
-#define HID_KEY_F22 0x71
-#define HID_KEY_F23 0x72
-#define HID_KEY_F24 0x73
-#define HID_KEY_EXECUTE 0x74
-#define HID_KEY_HELP 0x75
-#define HID_KEY_MENU 0x76
-#define HID_KEY_SELECT 0x77
-#define HID_KEY_STOP 0x78
-#define HID_KEY_AGAIN 0x79
-#define HID_KEY_UNDO 0x7A
-#define HID_KEY_CUT 0x7B
-#define HID_KEY_COPY 0x7C
-#define HID_KEY_PASTE 0x7D
-#define HID_KEY_FIND 0x7E
-#define HID_KEY_MUTE 0x7F
-#define HID_KEY_VOLUME_UP 0x80
-#define HID_KEY_VOLUME_DOWN 0x81
-#define HID_KEY_LOCKING_CAPS_LOCK 0x82
-#define HID_KEY_LOCKING_NUM_LOCK 0x83
-#define HID_KEY_LOCKING_SCROLL_LOCK 0x84
-#define HID_KEY_KEYPAD_COMMA 0x85
-#define HID_KEY_KEYPAD_EQUAL_SIGN 0x86
-#define HID_KEY_KANJI1 0x87
-#define HID_KEY_KANJI2 0x88
-#define HID_KEY_KANJI3 0x89
-#define HID_KEY_KANJI4 0x8A
-#define HID_KEY_KANJI5 0x8B
-#define HID_KEY_KANJI6 0x8C
-#define HID_KEY_KANJI7 0x8D
-#define HID_KEY_KANJI8 0x8E
-#define HID_KEY_KANJI9 0x8F
-#define HID_KEY_LANG1 0x90
-#define HID_KEY_LANG2 0x91
-#define HID_KEY_LANG3 0x92
-#define HID_KEY_LANG4 0x93
-#define HID_KEY_LANG5 0x94
-#define HID_KEY_LANG6 0x95
-#define HID_KEY_LANG7 0x96
-#define HID_KEY_LANG8 0x97
-#define HID_KEY_LANG9 0x98
-#define HID_KEY_ALTERNATE_ERASE 0x99
-#define HID_KEY_SYSREQ_ATTENTION 0x9A
-#define HID_KEY_CANCEL 0x9B
-#define HID_KEY_CLEAR 0x9C
-#define HID_KEY_PRIOR 0x9D
-#define HID_KEY_RETURN 0x9E
-#define HID_KEY_SEPARATOR 0x9F
-#define HID_KEY_OUT 0xA0
-#define HID_KEY_OPER 0xA1
-#define HID_KEY_CLEAR_AGAIN 0xA2
-#define HID_KEY_CRSEL_PROPS 0xA3
-#define HID_KEY_EXSEL 0xA4
-// RESERVED 0xA5-DF
-#define HID_KEY_CONTROL_LEFT 0xE0
-#define HID_KEY_SHIFT_LEFT 0xE1
-#define HID_KEY_ALT_LEFT 0xE2
-#define HID_KEY_GUI_LEFT 0xE3
-#define HID_KEY_CONTROL_RIGHT 0xE4
-#define HID_KEY_SHIFT_RIGHT 0xE5
-#define HID_KEY_ALT_RIGHT 0xE6
-#define HID_KEY_GUI_RIGHT 0xE7
-
-
-//--------------------------------------------------------------------+
-// REPORT DESCRIPTOR
-//--------------------------------------------------------------------+
-
-//------------- ITEM & TAG -------------//
-#define HID_REPORT_DATA_0(data)
-#define HID_REPORT_DATA_1(data) , data
-#define HID_REPORT_DATA_2(data) , U16_TO_U8S_LE(data)
-#define HID_REPORT_DATA_3(data) , U32_TO_U8S_LE(data)
-
-#define HID_REPORT_ITEM(data, tag, type, size) \
- (((tag) << 4) | ((type) << 2) | (size)) HID_REPORT_DATA_##size(data)
-
-// Report Item Types
-enum {
- RI_TYPE_MAIN = 0,
- RI_TYPE_GLOBAL = 1,
- RI_TYPE_LOCAL = 2
-};
-
-//------------- Main Items - HID 1.11 section 6.2.2.4 -------------//
-
-// Report Item Main group
-enum {
- RI_MAIN_INPUT = 8,
- RI_MAIN_OUTPUT = 9,
- RI_MAIN_COLLECTION = 10,
- RI_MAIN_FEATURE = 11,
- RI_MAIN_COLLECTION_END = 12
-};
-
-#define HID_INPUT(x) HID_REPORT_ITEM(x, RI_MAIN_INPUT , RI_TYPE_MAIN, 1)
-#define HID_OUTPUT(x) HID_REPORT_ITEM(x, RI_MAIN_OUTPUT , RI_TYPE_MAIN, 1)
-#define HID_COLLECTION(x) HID_REPORT_ITEM(x, RI_MAIN_COLLECTION , RI_TYPE_MAIN, 1)
-#define HID_FEATURE(x) HID_REPORT_ITEM(x, RI_MAIN_FEATURE , RI_TYPE_MAIN, 1)
-#define HID_COLLECTION_END HID_REPORT_ITEM(x, RI_MAIN_COLLECTION_END, RI_TYPE_MAIN, 0)
-
-//------------- Input, Output, Feature - HID 1.11 section 6.2.2.5 -------------//
-#define HID_DATA (0<<0)
-#define HID_CONSTANT (1<<0)
-
-#define HID_ARRAY (0<<1)
-#define HID_VARIABLE (1<<1)
-
-#define HID_ABSOLUTE (0<<2)
-#define HID_RELATIVE (1<<2)
-
-#define HID_WRAP_NO (0<<3)
-#define HID_WRAP (1<<3)
-
-#define HID_LINEAR (0<<4)
-#define HID_NONLINEAR (1<<4)
-
-#define HID_PREFERRED_STATE (0<<5)
-#define HID_PREFERRED_NO (1<<5)
-
-#define HID_NO_NULL_POSITION (0<<6)
-#define HID_NULL_STATE (1<<6)
-
-#define HID_NON_VOLATILE (0<<7)
-#define HID_VOLATILE (1<<7)
-
-#define HID_BITFIELD (0<<8)
-#define HID_BUFFERED_BYTES (1<<8)
-
-//------------- Collection Item - HID 1.11 section 6.2.2.6 -------------//
-enum {
- HID_COLLECTION_PHYSICAL = 0,
- HID_COLLECTION_APPLICATION,
- HID_COLLECTION_LOGICAL,
- HID_COLLECTION_REPORT,
- HID_COLLECTION_NAMED_ARRAY,
- HID_COLLECTION_USAGE_SWITCH,
- HID_COLLECTION_USAGE_MODIFIER
-};
-
-//------------- Global Items - HID 1.11 section 6.2.2.7 -------------//
-
-// Report Item Global group
-enum {
- RI_GLOBAL_USAGE_PAGE = 0,
- RI_GLOBAL_LOGICAL_MIN = 1,
- RI_GLOBAL_LOGICAL_MAX = 2,
- RI_GLOBAL_PHYSICAL_MIN = 3,
- RI_GLOBAL_PHYSICAL_MAX = 4,
- RI_GLOBAL_UNIT_EXPONENT = 5,
- RI_GLOBAL_UNIT = 6,
- RI_GLOBAL_REPORT_SIZE = 7,
- RI_GLOBAL_REPORT_ID = 8,
- RI_GLOBAL_REPORT_COUNT = 9,
- RI_GLOBAL_PUSH = 10,
- RI_GLOBAL_POP = 11
-};
-
-#define HID_USAGE_PAGE(x) HID_REPORT_ITEM(x, RI_GLOBAL_USAGE_PAGE, RI_TYPE_GLOBAL, 1)
-#define HID_USAGE_PAGE_N(x, n) HID_REPORT_ITEM(x, RI_GLOBAL_USAGE_PAGE, RI_TYPE_GLOBAL, n)
-
-#define HID_LOGICAL_MIN(x) HID_REPORT_ITEM(x, RI_GLOBAL_LOGICAL_MIN, RI_TYPE_GLOBAL, 1)
-#define HID_LOGICAL_MIN_N(x, n) HID_REPORT_ITEM(x, RI_GLOBAL_LOGICAL_MIN, RI_TYPE_GLOBAL, n)
-
-#define HID_LOGICAL_MAX(x) HID_REPORT_ITEM(x, RI_GLOBAL_LOGICAL_MAX, RI_TYPE_GLOBAL, 1)
-#define HID_LOGICAL_MAX_N(x, n) HID_REPORT_ITEM(x, RI_GLOBAL_LOGICAL_MAX, RI_TYPE_GLOBAL, n)
-
-#define HID_PHYSICAL_MIN(x) HID_REPORT_ITEM(x, RI_GLOBAL_PHYSICAL_MIN, RI_TYPE_GLOBAL, 1)
-#define HID_PHYSICAL_MIN_N(x, n) HID_REPORT_ITEM(x, RI_GLOBAL_PHYSICAL_MIN, RI_TYPE_GLOBAL, n)
-
-#define HID_PHYSICAL_MAX(x) HID_REPORT_ITEM(x, RI_GLOBAL_PHYSICAL_MAX, RI_TYPE_GLOBAL, 1)
-#define HID_PHYSICAL_MAX_N(x, n) HID_REPORT_ITEM(x, RI_GLOBAL_PHYSICAL_MAX, RI_TYPE_GLOBAL, n)
-
-#define HID_UNIT_EXPONENT(x) HID_REPORT_ITEM(x, RI_GLOBAL_UNIT_EXPONENT, RI_TYPE_GLOBAL, 1)
-#define HID_UNIT_EXPONENT_N(x, n) HID_REPORT_ITEM(x, RI_GLOBAL_UNIT_EXPONENT, RI_TYPE_GLOBAL, n)
-
-#define HID_UNIT(x) HID_REPORT_ITEM(x, RI_GLOBAL_UNIT, RI_TYPE_GLOBAL, 1)
-#define HID_UNIT_N(x, n) HID_REPORT_ITEM(x, RI_GLOBAL_UNIT, RI_TYPE_GLOBAL, n)
-
-#define HID_REPORT_SIZE(x) HID_REPORT_ITEM(x, RI_GLOBAL_REPORT_SIZE, RI_TYPE_GLOBAL, 1)
-#define HID_REPORT_SIZE_N(x, n) HID_REPORT_ITEM(x, RI_GLOBAL_REPORT_SIZE, RI_TYPE_GLOBAL, n)
-
-#define HID_REPORT_ID(x) HID_REPORT_ITEM(x, RI_GLOBAL_REPORT_ID, RI_TYPE_GLOBAL, 1),
-#define HID_REPORT_ID_N(x) HID_REPORT_ITEM(x, RI_GLOBAL_REPORT_ID, RI_TYPE_GLOBAL, n),
-
-#define HID_REPORT_COUNT(x) HID_REPORT_ITEM(x, RI_GLOBAL_REPORT_COUNT, RI_TYPE_GLOBAL, 1)
-#define HID_REPORT_COUNT_N(x, n) HID_REPORT_ITEM(x, RI_GLOBAL_REPORT_COUNT, RI_TYPE_GLOBAL, n)
-
-#define HID_PUSH HID_REPORT_ITEM(x, RI_GLOBAL_PUSH, RI_TYPE_GLOBAL, 0)
-#define HID_POP HID_REPORT_ITEM(x, RI_GLOBAL_POP, RI_TYPE_GLOBAL, 0)
-
-//------------- LOCAL ITEMS 6.2.2.8 -------------//
-
-enum {
- RI_LOCAL_USAGE = 0,
- RI_LOCAL_USAGE_MIN = 1,
- RI_LOCAL_USAGE_MAX = 2,
- RI_LOCAL_DESIGNATOR_INDEX = 3,
- RI_LOCAL_DESIGNATOR_MIN = 4,
- RI_LOCAL_DESIGNATOR_MAX = 5,
- // 6 is reserved
- RI_LOCAL_STRING_INDEX = 7,
- RI_LOCAL_STRING_MIN = 8,
- RI_LOCAL_STRING_MAX = 9,
- RI_LOCAL_DELIMITER = 10,
-};
-
-#define HID_USAGE(x) HID_REPORT_ITEM(x, RI_LOCAL_USAGE, RI_TYPE_LOCAL, 1)
-#define HID_USAGE_N(x, n) HID_REPORT_ITEM(x, RI_LOCAL_USAGE, RI_TYPE_LOCAL, n)
-
-#define HID_USAGE_MIN(x) HID_REPORT_ITEM(x, RI_LOCAL_USAGE_MIN, RI_TYPE_LOCAL, 1)
-#define HID_USAGE_MIN_N(x, n) HID_REPORT_ITEM(x, RI_LOCAL_USAGE_MIN, RI_TYPE_LOCAL, n)
-
-#define HID_USAGE_MAX(x) HID_REPORT_ITEM(x, RI_LOCAL_USAGE_MAX, RI_TYPE_LOCAL, 1)
-#define HID_USAGE_MAX_N(x, n) HID_REPORT_ITEM(x, RI_LOCAL_USAGE_MAX, RI_TYPE_LOCAL, n)
-
-//--------------------------------------------------------------------+
-// Usage Table
-//--------------------------------------------------------------------+
-
-/// HID Usage Table - Table 1: Usage Page Summary
-enum {
- HID_USAGE_PAGE_DESKTOP = 0x01,
- HID_USAGE_PAGE_SIMULATE = 0x02,
- HID_USAGE_PAGE_VIRTUAL_REALITY = 0x03,
- HID_USAGE_PAGE_SPORT = 0x04,
- HID_USAGE_PAGE_GAME = 0x05,
- HID_USAGE_PAGE_GENERIC_DEVICE = 0x06,
- HID_USAGE_PAGE_KEYBOARD = 0x07,
- HID_USAGE_PAGE_LED = 0x08,
- HID_USAGE_PAGE_BUTTON = 0x09,
- HID_USAGE_PAGE_ORDINAL = 0x0a,
- HID_USAGE_PAGE_TELEPHONY = 0x0b,
- HID_USAGE_PAGE_CONSUMER = 0x0c,
- HID_USAGE_PAGE_DIGITIZER = 0x0d,
- HID_USAGE_PAGE_PID = 0x0f,
- HID_USAGE_PAGE_UNICODE = 0x10,
- HID_USAGE_PAGE_ALPHA_DISPLAY = 0x14,
- HID_USAGE_PAGE_MEDICAL = 0x40,
- HID_USAGE_PAGE_MONITOR = 0x80, //0x80 - 0x83
- HID_USAGE_PAGE_POWER = 0x84, // 0x084 - 0x87
- HID_USAGE_PAGE_BARCODE_SCANNER = 0x8c,
- HID_USAGE_PAGE_SCALE = 0x8d,
- HID_USAGE_PAGE_MSR = 0x8e,
- HID_USAGE_PAGE_CAMERA = 0x90,
- HID_USAGE_PAGE_ARCADE = 0x91,
- HID_USAGE_PAGE_VENDOR = 0xFF00 // 0xFF00 - 0xFFFF
-};
-
-/// HID Usage Table - Table 6: Generic Desktop Page
-enum {
- HID_USAGE_DESKTOP_POINTER = 0x01,
- HID_USAGE_DESKTOP_MOUSE = 0x02,
- HID_USAGE_DESKTOP_JOYSTICK = 0x04,
- HID_USAGE_DESKTOP_GAMEPAD = 0x05,
- HID_USAGE_DESKTOP_KEYBOARD = 0x06,
- HID_USAGE_DESKTOP_KEYPAD = 0x07,
- HID_USAGE_DESKTOP_MULTI_AXIS_CONTROLLER = 0x08,
- HID_USAGE_DESKTOP_TABLET_PC_SYSTEM = 0x09,
- HID_USAGE_DESKTOP_X = 0x30,
- HID_USAGE_DESKTOP_Y = 0x31,
- HID_USAGE_DESKTOP_Z = 0x32,
- HID_USAGE_DESKTOP_RX = 0x33,
- HID_USAGE_DESKTOP_RY = 0x34,
- HID_USAGE_DESKTOP_RZ = 0x35,
- HID_USAGE_DESKTOP_SLIDER = 0x36,
- HID_USAGE_DESKTOP_DIAL = 0x37,
- HID_USAGE_DESKTOP_WHEEL = 0x38,
- HID_USAGE_DESKTOP_HAT_SWITCH = 0x39,
- HID_USAGE_DESKTOP_COUNTED_BUFFER = 0x3a,
- HID_USAGE_DESKTOP_BYTE_COUNT = 0x3b,
- HID_USAGE_DESKTOP_MOTION_WAKEUP = 0x3c,
- HID_USAGE_DESKTOP_START = 0x3d,
- HID_USAGE_DESKTOP_SELECT = 0x3e,
- HID_USAGE_DESKTOP_VX = 0x40,
- HID_USAGE_DESKTOP_VY = 0x41,
- HID_USAGE_DESKTOP_VZ = 0x42,
- HID_USAGE_DESKTOP_VBRX = 0x43,
- HID_USAGE_DESKTOP_VBRY = 0x44,
- HID_USAGE_DESKTOP_VBRZ = 0x45,
- HID_USAGE_DESKTOP_VNO = 0x46,
- HID_USAGE_DESKTOP_FEATURE_NOTIFICATION = 0x47,
- HID_USAGE_DESKTOP_RESOLUTION_MULTIPLIER = 0x48,
- HID_USAGE_DESKTOP_SYSTEM_CONTROL = 0x80,
- HID_USAGE_DESKTOP_SYSTEM_POWER_DOWN = 0x81,
- HID_USAGE_DESKTOP_SYSTEM_SLEEP = 0x82,
- HID_USAGE_DESKTOP_SYSTEM_WAKE_UP = 0x83,
- HID_USAGE_DESKTOP_SYSTEM_CONTEXT_MENU = 0x84,
- HID_USAGE_DESKTOP_SYSTEM_MAIN_MENU = 0x85,
- HID_USAGE_DESKTOP_SYSTEM_APP_MENU = 0x86,
- HID_USAGE_DESKTOP_SYSTEM_MENU_HELP = 0x87,
- HID_USAGE_DESKTOP_SYSTEM_MENU_EXIT = 0x88,
- HID_USAGE_DESKTOP_SYSTEM_MENU_SELECT = 0x89,
- HID_USAGE_DESKTOP_SYSTEM_MENU_RIGHT = 0x8A,
- HID_USAGE_DESKTOP_SYSTEM_MENU_LEFT = 0x8B,
- HID_USAGE_DESKTOP_SYSTEM_MENU_UP = 0x8C,
- HID_USAGE_DESKTOP_SYSTEM_MENU_DOWN = 0x8D,
- HID_USAGE_DESKTOP_SYSTEM_COLD_RESTART = 0x8E,
- HID_USAGE_DESKTOP_SYSTEM_WARM_RESTART = 0x8F,
- HID_USAGE_DESKTOP_DPAD_UP = 0x90,
- HID_USAGE_DESKTOP_DPAD_DOWN = 0x91,
- HID_USAGE_DESKTOP_DPAD_RIGHT = 0x92,
- HID_USAGE_DESKTOP_DPAD_LEFT = 0x93,
- HID_USAGE_DESKTOP_SYSTEM_DOCK = 0xA0,
- HID_USAGE_DESKTOP_SYSTEM_UNDOCK = 0xA1,
- HID_USAGE_DESKTOP_SYSTEM_SETUP = 0xA2,
- HID_USAGE_DESKTOP_SYSTEM_BREAK = 0xA3,
- HID_USAGE_DESKTOP_SYSTEM_DEBUGGER_BREAK = 0xA4,
- HID_USAGE_DESKTOP_APPLICATION_BREAK = 0xA5,
- HID_USAGE_DESKTOP_APPLICATION_DEBUGGER_BREAK = 0xA6,
- HID_USAGE_DESKTOP_SYSTEM_SPEAKER_MUTE = 0xA7,
- HID_USAGE_DESKTOP_SYSTEM_HIBERNATE = 0xA8,
- HID_USAGE_DESKTOP_SYSTEM_DISPLAY_INVERT = 0xB0,
- HID_USAGE_DESKTOP_SYSTEM_DISPLAY_INTERNAL = 0xB1,
- HID_USAGE_DESKTOP_SYSTEM_DISPLAY_EXTERNAL = 0xB2,
- HID_USAGE_DESKTOP_SYSTEM_DISPLAY_BOTH = 0xB3,
- HID_USAGE_DESKTOP_SYSTEM_DISPLAY_DUAL = 0xB4,
- HID_USAGE_DESKTOP_SYSTEM_DISPLAY_TOGGLE_INT_EXT = 0xB5,
- HID_USAGE_DESKTOP_SYSTEM_DISPLAY_SWAP_PRIMARY_SECONDARY = 0xB6,
- HID_USAGE_DESKTOP_SYSTEM_DISPLAY_LCD_AUTOSCALE = 0xB7
-};
-
-
-/// HID Usage Table: Consumer Page (0x0C)
-/// Only contains controls that supported by Windows (whole list is too long)
-enum
-{
- // Generic Control
- HID_USAGE_CONSUMER_CONTROL = 0x0001,
-
- // Power Control
- HID_USAGE_CONSUMER_POWER = 0x0030,
- HID_USAGE_CONSUMER_RESET = 0x0031,
- HID_USAGE_CONSUMER_SLEEP = 0x0032,
-
- // Screen Brightness
- HID_USAGE_CONSUMER_BRIGHTNESS_INCREMENT = 0x006F,
- HID_USAGE_CONSUMER_BRIGHTNESS_DECREMENT = 0x0070,
-
- // These HID usages operate only on mobile systems (battery powered) and
- // require Windows 8 (build 8302 or greater).
- HID_USAGE_CONSUMER_WIRELESS_RADIO_CONTROLS = 0x000C,
- HID_USAGE_CONSUMER_WIRELESS_RADIO_BUTTONS = 0x00C6,
- HID_USAGE_CONSUMER_WIRELESS_RADIO_LED = 0x00C7,
- HID_USAGE_CONSUMER_WIRELESS_RADIO_SLIDER_SWITCH = 0x00C8,
-
- // Media Control
- HID_USAGE_CONSUMER_PLAY_PAUSE = 0x00CD,
- HID_USAGE_CONSUMER_SCAN_NEXT = 0x00B5,
- HID_USAGE_CONSUMER_SCAN_PREVIOUS = 0x00B6,
- HID_USAGE_CONSUMER_STOP = 0x00B7,
- HID_USAGE_CONSUMER_VOLUME = 0x00E0,
- HID_USAGE_CONSUMER_MUTE = 0x00E2,
- HID_USAGE_CONSUMER_BASS = 0x00E3,
- HID_USAGE_CONSUMER_TREBLE = 0x00E4,
- HID_USAGE_CONSUMER_BASS_BOOST = 0x00E5,
- HID_USAGE_CONSUMER_VOLUME_INCREMENT = 0x00E9,
- HID_USAGE_CONSUMER_VOLUME_DECREMENT = 0x00EA,
- HID_USAGE_CONSUMER_BASS_INCREMENT = 0x0152,
- HID_USAGE_CONSUMER_BASS_DECREMENT = 0x0153,
- HID_USAGE_CONSUMER_TREBLE_INCREMENT = 0x0154,
- HID_USAGE_CONSUMER_TREBLE_DECREMENT = 0x0155,
-
- // Application Launcher
- HID_USAGE_CONSUMER_AL_CONSUMER_CONTROL_CONFIGURATION = 0x0183,
- HID_USAGE_CONSUMER_AL_EMAIL_READER = 0x018A,
- HID_USAGE_CONSUMER_AL_CALCULATOR = 0x0192,
- HID_USAGE_CONSUMER_AL_LOCAL_BROWSER = 0x0194,
-
- // Browser/Explorer Specific
- HID_USAGE_CONSUMER_AC_SEARCH = 0x0221,
- HID_USAGE_CONSUMER_AC_HOME = 0x0223,
- HID_USAGE_CONSUMER_AC_BACK = 0x0224,
- HID_USAGE_CONSUMER_AC_FORWARD = 0x0225,
- HID_USAGE_CONSUMER_AC_STOP = 0x0226,
- HID_USAGE_CONSUMER_AC_REFRESH = 0x0227,
- HID_USAGE_CONSUMER_AC_BOOKMARKS = 0x022A,
-
- // Mouse Horizontal scroll
- HID_USAGE_CONSUMER_AC_PAN = 0x0238,
-};
-
-/*--------------------------------------------------------------------
- * ASCII to KEYCODE Conversion
- * Expand to array of [128][2] (shift, keycode)
- *
- * Usage: example to convert input chr into keyboard report (modifier + keycode)
- *
- * uint8_t const conv_table[128][2] = { HID_ASCII_TO_KEYCODE };
- *
- * uint8_t keycode[6] = { 0 };
- * uint8_t modifier = 0;
- *
- * if ( conv_table[chr][0] ) modifier = KEYBOARD_MODIFIER_LEFTSHIFT;
- * keycode[0] = conv_table[chr][1];
- * tud_hid_keyboard_report(report_id, modifier, keycode);
- *
- *--------------------------------------------------------------------*/
-#define HID_ASCII_TO_KEYCODE \
- {0, 0 }, /* 0x00 Null */ \
- {0, 0 }, /* 0x01 */ \
- {0, 0 }, /* 0x02 */ \
- {0, 0 }, /* 0x03 */ \
- {0, 0 }, /* 0x04 */ \
- {0, 0 }, /* 0x05 */ \
- {0, 0 }, /* 0x06 */ \
- {0, 0 }, /* 0x07 */ \
- {0, HID_KEY_BACKSPACE }, /* 0x08 Backspace */ \
- {0, HID_KEY_TAB }, /* 0x09 Tab */ \
- {0, HID_KEY_ENTER }, /* 0x0A Line Feed */ \
- {0, 0 }, /* 0x0B */ \
- {0, 0 }, /* 0x0C */ \
- {0, HID_KEY_ENTER }, /* 0x0D CR */ \
- {0, 0 }, /* 0x0E */ \
- {0, 0 }, /* 0x0F */ \
- {0, 0 }, /* 0x10 */ \
- {0, 0 }, /* 0x11 */ \
- {0, 0 }, /* 0x12 */ \
- {0, 0 }, /* 0x13 */ \
- {0, 0 }, /* 0x14 */ \
- {0, 0 }, /* 0x15 */ \
- {0, 0 }, /* 0x16 */ \
- {0, 0 }, /* 0x17 */ \
- {0, 0 }, /* 0x18 */ \
- {0, 0 }, /* 0x19 */ \
- {0, 0 }, /* 0x1A */ \
- {0, HID_KEY_ESCAPE }, /* 0x1B Escape */ \
- {0, 0 }, /* 0x1C */ \
- {0, 0 }, /* 0x1D */ \
- {0, 0 }, /* 0x1E */ \
- {0, 0 }, /* 0x1F */ \
- \
- {0, HID_KEY_SPACE }, /* 0x20 */ \
- {1, HID_KEY_1 }, /* 0x21 ! */ \
- {1, HID_KEY_APOSTROPHE }, /* 0x22 " */ \
- {1, HID_KEY_3 }, /* 0x23 # */ \
- {1, HID_KEY_4 }, /* 0x24 $ */ \
- {1, HID_KEY_5 }, /* 0x25 % */ \
- {1, HID_KEY_7 }, /* 0x26 & */ \
- {0, HID_KEY_APOSTROPHE }, /* 0x27 ' */ \
- {1, HID_KEY_9 }, /* 0x28 ( */ \
- {1, HID_KEY_0 }, /* 0x29 ) */ \
- {1, HID_KEY_8 }, /* 0x2A * */ \
- {1, HID_KEY_EQUAL }, /* 0x2B + */ \
- {0, HID_KEY_COMMA }, /* 0x2C , */ \
- {0, HID_KEY_MINUS }, /* 0x2D - */ \
- {0, HID_KEY_PERIOD }, /* 0x2E . */ \
- {0, HID_KEY_SLASH }, /* 0x2F / */ \
- {0, HID_KEY_0 }, /* 0x30 0 */ \
- {0, HID_KEY_1 }, /* 0x31 1 */ \
- {0, HID_KEY_2 }, /* 0x32 2 */ \
- {0, HID_KEY_3 }, /* 0x33 3 */ \
- {0, HID_KEY_4 }, /* 0x34 4 */ \
- {0, HID_KEY_5 }, /* 0x35 5 */ \
- {0, HID_KEY_6 }, /* 0x36 6 */ \
- {0, HID_KEY_7 }, /* 0x37 7 */ \
- {0, HID_KEY_8 }, /* 0x38 8 */ \
- {0, HID_KEY_9 }, /* 0x39 9 */ \
- {1, HID_KEY_SEMICOLON }, /* 0x3A : */ \
- {0, HID_KEY_SEMICOLON }, /* 0x3B ; */ \
- {1, HID_KEY_COMMA }, /* 0x3C < */ \
- {0, HID_KEY_EQUAL }, /* 0x3D = */ \
- {1, HID_KEY_PERIOD }, /* 0x3E > */ \
- {1, HID_KEY_SLASH }, /* 0x3F ? */ \
- \
- {1, HID_KEY_2 }, /* 0x40 @ */ \
- {1, HID_KEY_A }, /* 0x41 A */ \
- {1, HID_KEY_B }, /* 0x42 B */ \
- {1, HID_KEY_C }, /* 0x43 C */ \
- {1, HID_KEY_D }, /* 0x44 D */ \
- {1, HID_KEY_E }, /* 0x45 E */ \
- {1, HID_KEY_F }, /* 0x46 F */ \
- {1, HID_KEY_G }, /* 0x47 G */ \
- {1, HID_KEY_H }, /* 0x48 H */ \
- {1, HID_KEY_I }, /* 0x49 I */ \
- {1, HID_KEY_J }, /* 0x4A J */ \
- {1, HID_KEY_K }, /* 0x4B K */ \
- {1, HID_KEY_L }, /* 0x4C L */ \
- {1, HID_KEY_M }, /* 0x4D M */ \
- {1, HID_KEY_N }, /* 0x4E N */ \
- {1, HID_KEY_O }, /* 0x4F O */ \
- {1, HID_KEY_P }, /* 0x50 P */ \
- {1, HID_KEY_Q }, /* 0x51 Q */ \
- {1, HID_KEY_R }, /* 0x52 R */ \
- {1, HID_KEY_S }, /* 0x53 S */ \
- {1, HID_KEY_T }, /* 0x55 T */ \
- {1, HID_KEY_U }, /* 0x55 U */ \
- {1, HID_KEY_V }, /* 0x56 V */ \
- {1, HID_KEY_W }, /* 0x57 W */ \
- {1, HID_KEY_X }, /* 0x58 X */ \
- {1, HID_KEY_Y }, /* 0x59 Y */ \
- {1, HID_KEY_Z }, /* 0x5A Z */ \
- {0, HID_KEY_BRACKET_LEFT }, /* 0x5B [ */ \
- {0, HID_KEY_BACKSLASH }, /* 0x5C '\' */ \
- {0, HID_KEY_BRACKET_RIGHT }, /* 0x5D ] */ \
- {1, HID_KEY_6 }, /* 0x5E ^ */ \
- {1, HID_KEY_MINUS }, /* 0x5F _ */ \
- \
- {0, HID_KEY_GRAVE }, /* 0x60 ` */ \
- {0, HID_KEY_A }, /* 0x61 a */ \
- {0, HID_KEY_B }, /* 0x62 b */ \
- {0, HID_KEY_C }, /* 0x63 c */ \
- {0, HID_KEY_D }, /* 0x66 d */ \
- {0, HID_KEY_E }, /* 0x65 e */ \
- {0, HID_KEY_F }, /* 0x66 f */ \
- {0, HID_KEY_G }, /* 0x67 g */ \
- {0, HID_KEY_H }, /* 0x68 h */ \
- {0, HID_KEY_I }, /* 0x69 i */ \
- {0, HID_KEY_J }, /* 0x6A j */ \
- {0, HID_KEY_K }, /* 0x6B k */ \
- {0, HID_KEY_L }, /* 0x6C l */ \
- {0, HID_KEY_M }, /* 0x6D m */ \
- {0, HID_KEY_N }, /* 0x6E n */ \
- {0, HID_KEY_O }, /* 0x6F o */ \
- {0, HID_KEY_P }, /* 0x70 p */ \
- {0, HID_KEY_Q }, /* 0x71 q */ \
- {0, HID_KEY_R }, /* 0x72 r */ \
- {0, HID_KEY_S }, /* 0x73 s */ \
- {0, HID_KEY_T }, /* 0x75 t */ \
- {0, HID_KEY_U }, /* 0x75 u */ \
- {0, HID_KEY_V }, /* 0x76 v */ \
- {0, HID_KEY_W }, /* 0x77 w */ \
- {0, HID_KEY_X }, /* 0x78 x */ \
- {0, HID_KEY_Y }, /* 0x79 y */ \
- {0, HID_KEY_Z }, /* 0x7A z */ \
- {1, HID_KEY_BRACKET_LEFT }, /* 0x7B { */ \
- {1, HID_KEY_BACKSLASH }, /* 0x7C | */ \
- {1, HID_KEY_BRACKET_RIGHT }, /* 0x7D } */ \
- {1, HID_KEY_GRAVE }, /* 0x7E ~ */ \
- {0, HID_KEY_DELETE } /* 0x7F Delete */ \
-
-/*--------------------------------------------------------------------
- * KEYCODE to Ascii Conversion
- * Expand to array of [128][2] (ascii without shift, ascii with shift)
- *
- * Usage: example to convert ascii from keycode (key) and shift modifier (shift).
- * Here we assume key < 128 ( printable )
- *
- * uint8_t const conv_table[128][2] = { HID_KEYCODE_TO_ASCII };
- * char ch = shift ? conv_table[chr][1] : conv_table[chr][0];
- *
- *--------------------------------------------------------------------*/
-#define HID_KEYCODE_TO_ASCII \
- {0 , 0 }, /* 0x00 */ \
- {0 , 0 }, /* 0x01 */ \
- {0 , 0 }, /* 0x02 */ \
- {0 , 0 }, /* 0x03 */ \
- {'a' , 'A' }, /* 0x04 */ \
- {'b' , 'B' }, /* 0x05 */ \
- {'c' , 'C' }, /* 0x06 */ \
- {'d' , 'D' }, /* 0x07 */ \
- {'e' , 'E' }, /* 0x08 */ \
- {'f' , 'F' }, /* 0x09 */ \
- {'g' , 'G' }, /* 0x0a */ \
- {'h' , 'H' }, /* 0x0b */ \
- {'i' , 'I' }, /* 0x0c */ \
- {'j' , 'J' }, /* 0x0d */ \
- {'k' , 'K' }, /* 0x0e */ \
- {'l' , 'L' }, /* 0x0f */ \
- {'m' , 'M' }, /* 0x10 */ \
- {'n' , 'N' }, /* 0x11 */ \
- {'o' , 'O' }, /* 0x12 */ \
- {'p' , 'P' }, /* 0x13 */ \
- {'q' , 'Q' }, /* 0x14 */ \
- {'r' , 'R' }, /* 0x15 */ \
- {'s' , 'S' }, /* 0x16 */ \
- {'t' , 'T' }, /* 0x17 */ \
- {'u' , 'U' }, /* 0x18 */ \
- {'v' , 'V' }, /* 0x19 */ \
- {'w' , 'W' }, /* 0x1a */ \
- {'x' , 'X' }, /* 0x1b */ \
- {'y' , 'Y' }, /* 0x1c */ \
- {'z' , 'Z' }, /* 0x1d */ \
- {'1' , '!' }, /* 0x1e */ \
- {'2' , '@' }, /* 0x1f */ \
- {'3' , '#' }, /* 0x20 */ \
- {'4' , '$' }, /* 0x21 */ \
- {'5' , '%' }, /* 0x22 */ \
- {'6' , '^' }, /* 0x23 */ \
- {'7' , '&' }, /* 0x24 */ \
- {'8' , '*' }, /* 0x25 */ \
- {'9' , '(' }, /* 0x26 */ \
- {'0' , ')' }, /* 0x27 */ \
- {'\r' , '\r' }, /* 0x28 */ \
- {'\x1b', '\x1b' }, /* 0x29 */ \
- {'\b' , '\b' }, /* 0x2a */ \
- {'\t' , '\t' }, /* 0x2b */ \
- {' ' , ' ' }, /* 0x2c */ \
- {'-' , '_' }, /* 0x2d */ \
- {'=' , '+' }, /* 0x2e */ \
- {'[' , '{' }, /* 0x2f */ \
- {']' , '}' }, /* 0x30 */ \
- {'\\' , '|' }, /* 0x31 */ \
- {'#' , '~' }, /* 0x32 */ \
- {';' , ':' }, /* 0x33 */ \
- {'\'' , '\"' }, /* 0x34 */ \
- {'`' , '~' }, /* 0x35 */ \
- {',' , '<' }, /* 0x36 */ \
- {'.' , '>' }, /* 0x37 */ \
- {'/' , '?' }, /* 0x38 */ \
- \
- {0 , 0 }, /* 0x39 */ \
- {0 , 0 }, /* 0x3a */ \
- {0 , 0 }, /* 0x3b */ \
- {0 , 0 }, /* 0x3c */ \
- {0 , 0 }, /* 0x3d */ \
- {0 , 0 }, /* 0x3e */ \
- {0 , 0 }, /* 0x3f */ \
- {0 , 0 }, /* 0x40 */ \
- {0 , 0 }, /* 0x41 */ \
- {0 , 0 }, /* 0x42 */ \
- {0 , 0 }, /* 0x43 */ \
- {0 , 0 }, /* 0x44 */ \
- {0 , 0 }, /* 0x45 */ \
- {0 , 0 }, /* 0x46 */ \
- {0 , 0 }, /* 0x47 */ \
- {0 , 0 }, /* 0x48 */ \
- {0 , 0 }, /* 0x49 */ \
- {0 , 0 }, /* 0x4a */ \
- {0 , 0 }, /* 0x4b */ \
- {0 , 0 }, /* 0x4c */ \
- {0 , 0 }, /* 0x4d */ \
- {0 , 0 }, /* 0x4e */ \
- {0 , 0 }, /* 0x4f */ \
- {0 , 0 }, /* 0x50 */ \
- {0 , 0 }, /* 0x51 */ \
- {0 , 0 }, /* 0x52 */ \
- {0 , 0 }, /* 0x53 */ \
- \
- {'/' , '/' }, /* 0x54 */ \
- {'*' , '*' }, /* 0x55 */ \
- {'-' , '-' }, /* 0x56 */ \
- {'+' , '+' }, /* 0x57 */ \
- {'\r' , '\r' }, /* 0x58 */ \
- {'1' , 0 }, /* 0x59 */ \
- {'2' , 0 }, /* 0x5a */ \
- {'3' , 0 }, /* 0x5b */ \
- {'4' , 0 }, /* 0x5c */ \
- {'5' , '5' }, /* 0x5d */ \
- {'6' , 0 }, /* 0x5e */ \
- {'7' , 0 }, /* 0x5f */ \
- {'8' , 0 }, /* 0x60 */ \
- {'9' , 0 }, /* 0x61 */ \
- {'0' , 0 }, /* 0x62 */ \
- {'0' , 0 }, /* 0x63 */ \
- {'=' , '=' }, /* 0x67 */ \
-
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_HID_H__ */
-
-/// @}
diff --git a/tinyusb/src/class/hid/hid_device.c b/tinyusb/src/class/hid/hid_device.c
deleted file mode 100755
index 2ee80750..00000000
--- a/tinyusb/src/class/hid/hid_device.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_HID)
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "device/usbd.h"
-#include "device/usbd_pvt.h"
-
-#include "hid_device.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-typedef struct
-{
- uint8_t itf_num;
- uint8_t ep_in;
- uint8_t ep_out; // optional Out endpoint
- uint8_t itf_protocol; // Boot mouse or keyboard
-
- uint8_t protocol_mode; // Boot (0) or Report protocol (1)
- uint8_t idle_rate; // up to application to handle idle rate
- uint16_t report_desc_len;
-
- CFG_TUSB_MEM_ALIGN uint8_t epin_buf[CFG_TUD_HID_EP_BUFSIZE];
- CFG_TUSB_MEM_ALIGN uint8_t epout_buf[CFG_TUD_HID_EP_BUFSIZE];
-
- // TODO save hid descriptor since host can specifically request this after enumeration
- // Note: HID descriptor may be not available from application after enumeration
- tusb_hid_descriptor_hid_t const * hid_descriptor;
-} hidd_interface_t;
-
-CFG_TUSB_MEM_SECTION static hidd_interface_t _hidd_itf[CFG_TUD_HID];
-
-/*------------- Helpers -------------*/
-static inline uint8_t get_index_by_itfnum(uint8_t itf_num)
-{
- for (uint8_t i=0; i < CFG_TUD_HID; i++ )
- {
- if ( itf_num == _hidd_itf[i].itf_num ) return i;
- }
-
- return 0xFF;
-}
-
-//--------------------------------------------------------------------+
-// APPLICATION API
-//--------------------------------------------------------------------+
-bool tud_hid_n_ready(uint8_t instance)
-{
- uint8_t const ep_in = _hidd_itf[instance].ep_in;
- return tud_ready() && (ep_in != 0) && !usbd_edpt_busy(TUD_OPT_RHPORT, ep_in);
-}
-
-bool tud_hid_n_report(uint8_t instance, uint8_t report_id, void const* report, uint8_t len)
-{
- uint8_t const rhport = 0;
- hidd_interface_t * p_hid = &_hidd_itf[instance];
-
- // claim endpoint
- TU_VERIFY( usbd_edpt_claim(rhport, p_hid->ep_in) );
-
- // prepare data
- if (report_id)
- {
- len = tu_min8(len, CFG_TUD_HID_EP_BUFSIZE-1);
-
- p_hid->epin_buf[0] = report_id;
- memcpy(p_hid->epin_buf+1, report, len);
- len++;
- }else
- {
- // If report id = 0, skip ID field
- len = tu_min8(len, CFG_TUD_HID_EP_BUFSIZE);
- memcpy(p_hid->epin_buf, report, len);
- }
-
- return usbd_edpt_xfer(TUD_OPT_RHPORT, p_hid->ep_in, p_hid->epin_buf, len);
-}
-
-uint8_t tud_hid_n_interface_protocol(uint8_t instance)
-{
- return _hidd_itf[instance].itf_protocol;
-}
-
-uint8_t tud_hid_n_get_protocol(uint8_t instance)
-{
- return _hidd_itf[instance].protocol_mode;
-}
-
-bool tud_hid_n_keyboard_report(uint8_t instance, uint8_t report_id, uint8_t modifier, uint8_t keycode[6])
-{
- hid_keyboard_report_t report;
-
- report.modifier = modifier;
- report.reserved = 0;
-
- if ( keycode )
- {
- memcpy(report.keycode, keycode, 6);
- }else
- {
- tu_memclr(report.keycode, 6);
- }
-
- return tud_hid_n_report(instance, report_id, &report, sizeof(report));
-}
-
-bool tud_hid_n_mouse_report(uint8_t instance, uint8_t report_id,
- uint8_t buttons, int8_t x, int8_t y, int8_t vertical, int8_t horizontal)
-{
- hid_mouse_report_t report =
- {
- .buttons = buttons,
- .x = x,
- .y = y,
- .wheel = vertical,
- .pan = horizontal
- };
-
- return tud_hid_n_report(instance, report_id, &report, sizeof(report));
-}
-
-bool tud_hid_n_gamepad_report(uint8_t instance, uint8_t report_id,
- int8_t x, int8_t y, int8_t z, int8_t rz, int8_t rx, int8_t ry, uint8_t hat, uint32_t buttons)
-{
- hid_gamepad_report_t report =
- {
- .x = x,
- .y = y,
- .z = z,
- .rz = rz,
- .rx = rx,
- .ry = ry,
- .hat = hat,
- .buttons = buttons,
- };
-
- return tud_hid_n_report(instance, report_id, &report, sizeof(report));
-}
-
-//--------------------------------------------------------------------+
-// USBD-CLASS API
-//--------------------------------------------------------------------+
-void hidd_init(void)
-{
- hidd_reset(TUD_OPT_RHPORT);
-}
-
-void hidd_reset(uint8_t rhport)
-{
- (void) rhport;
- tu_memclr(_hidd_itf, sizeof(_hidd_itf));
-}
-
-uint16_t hidd_open(uint8_t rhport, tusb_desc_interface_t const * desc_itf, uint16_t max_len)
-{
- TU_VERIFY(TUSB_CLASS_HID == desc_itf->bInterfaceClass, 0);
-
- // len = interface + hid + n*endpoints
- uint16_t const drv_len = sizeof(tusb_desc_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + desc_itf->bNumEndpoints*sizeof(tusb_desc_endpoint_t);
- TU_ASSERT(max_len >= drv_len, 0);
-
- // Find available interface
- hidd_interface_t * p_hid = NULL;
- uint8_t hid_id;
- for(hid_id=0; hid_id<CFG_TUD_HID; hid_id++)
- {
- if ( _hidd_itf[hid_id].ep_in == 0 )
- {
- p_hid = &_hidd_itf[hid_id];
- break;
- }
- }
- TU_ASSERT(p_hid, 0);
-
- uint8_t const *p_desc = (uint8_t const *) desc_itf;
-
- //------------- HID descriptor -------------//
- p_desc = tu_desc_next(p_desc);
- p_hid->hid_descriptor = (tusb_hid_descriptor_hid_t const *) p_desc;
- TU_ASSERT(HID_DESC_TYPE_HID == p_hid->hid_descriptor->bDescriptorType, 0);
-
- //------------- Endpoint Descriptor -------------//
- p_desc = tu_desc_next(p_desc);
- TU_ASSERT(usbd_open_edpt_pair(rhport, p_desc, desc_itf->bNumEndpoints, TUSB_XFER_INTERRUPT, &p_hid->ep_out, &p_hid->ep_in), 0);
-
- if ( desc_itf->bInterfaceSubClass == HID_SUBCLASS_BOOT ) p_hid->itf_protocol = desc_itf->bInterfaceProtocol;
-
- p_hid->protocol_mode = HID_PROTOCOL_REPORT; // Per Specs: default is report mode
- p_hid->itf_num = desc_itf->bInterfaceNumber;
-
- // Use offsetof to avoid pointer to the odd/misaligned address
- memcpy(&p_hid->report_desc_len, (uint8_t*) p_hid->hid_descriptor + offsetof(tusb_hid_descriptor_hid_t, wReportLength), 2);
-
- // Prepare for output endpoint
- if (p_hid->ep_out)
- {
- if ( !usbd_edpt_xfer(rhport, p_hid->ep_out, p_hid->epout_buf, sizeof(p_hid->epout_buf)) )
- {
- TU_LOG_FAILED();
- TU_BREAKPOINT();
- }
- }
-
- return drv_len;
-}
-
-// Invoked when a control transfer occurred on an interface of this class
-// Driver response accordingly to the request and the transfer stage (setup/data/ack)
-// return false to stall control endpoint (e.g unsupported request)
-bool hidd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
-{
- TU_VERIFY(request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_INTERFACE);
-
- uint8_t const hid_itf = get_index_by_itfnum((uint8_t) request->wIndex);
- TU_VERIFY(hid_itf < CFG_TUD_HID);
-
- hidd_interface_t* p_hid = &_hidd_itf[hid_itf];
-
- if (request->bmRequestType_bit.type == TUSB_REQ_TYPE_STANDARD)
- {
- //------------- STD Request -------------//
- if ( stage == CONTROL_STAGE_SETUP )
- {
- uint8_t const desc_type = tu_u16_high(request->wValue);
- //uint8_t const desc_index = tu_u16_low (request->wValue);
-
- if (request->bRequest == TUSB_REQ_GET_DESCRIPTOR && desc_type == HID_DESC_TYPE_HID)
- {
- TU_VERIFY(p_hid->hid_descriptor != NULL);
- TU_VERIFY(tud_control_xfer(rhport, request, (void*) p_hid->hid_descriptor, p_hid->hid_descriptor->bLength));
- }
- else if (request->bRequest == TUSB_REQ_GET_DESCRIPTOR && desc_type == HID_DESC_TYPE_REPORT)
- {
- uint8_t const * desc_report = tud_hid_descriptor_report_cb(hid_itf);
- tud_control_xfer(rhport, request, (void*) desc_report, p_hid->report_desc_len);
- }
- else
- {
- return false; // stall unsupported request
- }
- }
- }
- else if (request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS)
- {
- //------------- Class Specific Request -------------//
- switch( request->bRequest )
- {
- case HID_REQ_CONTROL_GET_REPORT:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- uint8_t const report_type = tu_u16_high(request->wValue);
- uint8_t const report_id = tu_u16_low(request->wValue);
-
- uint8_t* report_buf = p_hid->epin_buf;
- uint16_t req_len = request->wLength;
-
- uint16_t xferlen = 0;
-
- // If host request a specific Report ID, add ID to as 1 byte of response
- if ( (report_id != HID_REPORT_TYPE_INVALID) && (req_len > 1) )
- {
- *report_buf++ = report_id;
- req_len--;
-
- xferlen++;
- }
-
- xferlen += tud_hid_get_report_cb(hid_itf, report_id, (hid_report_type_t) report_type, report_buf, req_len);
- TU_ASSERT( xferlen > 0 );
-
- tud_control_xfer(rhport, request, p_hid->epin_buf, xferlen);
- }
- break;
-
- case HID_REQ_CONTROL_SET_REPORT:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- TU_VERIFY(request->wLength <= sizeof(p_hid->epout_buf));
- tud_control_xfer(rhport, request, p_hid->epout_buf, request->wLength);
- }
- else if ( stage == CONTROL_STAGE_ACK )
- {
- uint8_t const report_type = tu_u16_high(request->wValue);
- uint8_t const report_id = tu_u16_low(request->wValue);
-
- uint8_t const* report_buf = p_hid->epout_buf;
- uint16_t report_len = request->wLength;
-
- // If host request a specific Report ID, extract report ID in buffer before invoking callback
- if ( (report_id != HID_REPORT_TYPE_INVALID) && (report_len > 1) && (report_id == report_buf[0]) )
- {
- report_buf++;
- report_len--;
- }
-
- tud_hid_set_report_cb(hid_itf, report_id, (hid_report_type_t) report_type, report_buf, report_len);
- }
- break;
-
- case HID_REQ_CONTROL_SET_IDLE:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- p_hid->idle_rate = tu_u16_high(request->wValue);
- if ( tud_hid_set_idle_cb )
- {
- // stall request if callback return false
- TU_VERIFY( tud_hid_set_idle_cb( hid_itf, p_hid->idle_rate) );
- }
-
- tud_control_status(rhport, request);
- }
- break;
-
- case HID_REQ_CONTROL_GET_IDLE:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- // TODO idle rate of report
- tud_control_xfer(rhport, request, &p_hid->idle_rate, 1);
- }
- break;
-
- case HID_REQ_CONTROL_GET_PROTOCOL:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- tud_control_xfer(rhport, request, &p_hid->protocol_mode, 1);
- }
- break;
-
- case HID_REQ_CONTROL_SET_PROTOCOL:
- if ( stage == CONTROL_STAGE_SETUP )
- {
- tud_control_status(rhport, request);
- }
- else if ( stage == CONTROL_STAGE_ACK )
- {
- p_hid->protocol_mode = (uint8_t) request->wValue;
- if (tud_hid_set_protocol_cb)
- {
- tud_hid_set_protocol_cb(hid_itf, p_hid->protocol_mode);
- }
- }
- break;
-
- default: return false; // stall unsupported request
- }
- }else
- {
- return false; // stall unsupported request
- }
-
- return true;
-}
-
-bool hidd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
-{
- (void) result;
-
- uint8_t instance = 0;
- hidd_interface_t * p_hid = _hidd_itf;
-
- // Identify which interface to use
- for (instance = 0; instance < CFG_TUD_HID; instance++)
- {
- p_hid = &_hidd_itf[instance];
- if ( (ep_addr == p_hid->ep_out) || (ep_addr == p_hid->ep_in) ) break;
- }
- TU_ASSERT(instance < CFG_TUD_HID);
-
- // Sent report successfully
- if (ep_addr == p_hid->ep_in)
- {
- if (tud_hid_report_complete_cb)
- {
- tud_hid_report_complete_cb(instance, p_hid->epin_buf, (uint8_t) xferred_bytes);
- }
- }
- // Received report
- else if (ep_addr == p_hid->ep_out)
- {
- tud_hid_set_report_cb(instance, 0, HID_REPORT_TYPE_INVALID, p_hid->epout_buf, xferred_bytes);
- TU_ASSERT(usbd_edpt_xfer(rhport, p_hid->ep_out, p_hid->epout_buf, sizeof(p_hid->epout_buf)));
- }
-
- return true;
-}
-
-#endif
diff --git a/tinyusb/src/class/hid/hid_device.h b/tinyusb/src/class/hid/hid_device.h
deleted file mode 100755
index e2c950dd..00000000
--- a/tinyusb/src/class/hid/hid_device.h
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_HID_DEVICE_H_
-#define _TUSB_HID_DEVICE_H_
-
-#include "hid.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Class Driver Default Configure & Validation
-//--------------------------------------------------------------------+
-
-#if !defined(CFG_TUD_HID_EP_BUFSIZE) & defined(CFG_TUD_HID_BUFSIZE)
- // TODO warn user to use new name later on
- // #warning CFG_TUD_HID_BUFSIZE is renamed to CFG_TUD_HID_EP_BUFSIZE, please update to use the new name
- #define CFG_TUD_HID_EP_BUFSIZE CFG_TUD_HID_BUFSIZE
-#endif
-
-#ifndef CFG_TUD_HID_EP_BUFSIZE
- #define CFG_TUD_HID_EP_BUFSIZE 64
-#endif
-
-//--------------------------------------------------------------------+
-// Application API (Multiple Instances)
-// CFG_TUD_HID > 1
-//--------------------------------------------------------------------+
-
-// Check if the interface is ready to use
-bool tud_hid_n_ready(uint8_t instance);
-
-// Get interface supported protocol (bInterfaceProtocol) check out hid_interface_protocol_enum_t for possible values
-uint8_t tud_hid_n_interface_protocol(uint8_t instance);
-
-// Get current active protocol: HID_PROTOCOL_BOOT (0) or HID_PROTOCOL_REPORT (1)
-uint8_t tud_hid_n_get_protocol(uint8_t instance);
-
-// Send report to host
-bool tud_hid_n_report(uint8_t instance, uint8_t report_id, void const* report, uint8_t len);
-
-// KEYBOARD: convenient helper to send keyboard report if application
-// use template layout report as defined by hid_keyboard_report_t
-bool tud_hid_n_keyboard_report(uint8_t instance, uint8_t report_id, uint8_t modifier, uint8_t keycode[6]);
-
-// MOUSE: convenient helper to send mouse report if application
-// use template layout report as defined by hid_mouse_report_t
-bool tud_hid_n_mouse_report(uint8_t instance, uint8_t report_id, uint8_t buttons, int8_t x, int8_t y, int8_t vertical, int8_t horizontal);
-
-// Gamepad: convenient helper to send gamepad report if application
-// use template layout report TUD_HID_REPORT_DESC_GAMEPAD
-bool tud_hid_n_gamepad_report(uint8_t instance, uint8_t report_id, int8_t x, int8_t y, int8_t z, int8_t rz, int8_t rx, int8_t ry, uint8_t hat, uint32_t buttons);
-
-//--------------------------------------------------------------------+
-// Application API (Single Port)
-//--------------------------------------------------------------------+
-static inline bool tud_hid_ready(void);
-static inline uint8_t tud_hid_interface_protocol(void);
-static inline uint8_t tud_hid_get_protocol(void);
-static inline bool tud_hid_report(uint8_t report_id, void const* report, uint8_t len);
-static inline bool tud_hid_keyboard_report(uint8_t report_id, uint8_t modifier, uint8_t keycode[6]);
-static inline bool tud_hid_mouse_report(uint8_t report_id, uint8_t buttons, int8_t x, int8_t y, int8_t vertical, int8_t horizontal);
-static inline bool tud_hid_gamepad_report(uint8_t report_id, int8_t x, int8_t y, int8_t z, int8_t rz, int8_t rx, int8_t ry, uint8_t hat, uint32_t buttons);
-
-//--------------------------------------------------------------------+
-// Callbacks (Weak is optional)
-//--------------------------------------------------------------------+
-
-// Invoked when received GET HID REPORT DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint8_t const * tud_hid_descriptor_report_cb(uint8_t instance);
-
-// Invoked when received GET_REPORT control request
-// Application must fill buffer report's content and return its length.
-// Return zero will cause the stack to STALL request
-uint16_t tud_hid_get_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen);
-
-// Invoked when received SET_REPORT control request or
-// received data on OUT endpoint ( Report ID = 0, Type = 0 )
-void tud_hid_set_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize);
-
-// Invoked when received SET_PROTOCOL request
-// protocol is either HID_PROTOCOL_BOOT (0) or HID_PROTOCOL_REPORT (1)
-TU_ATTR_WEAK void tud_hid_set_protocol_cb(uint8_t instance, uint8_t protocol);
-
-// Invoked when received SET_IDLE request. return false will stall the request
-// - Idle Rate = 0 : only send report if there is changes, i.e skip duplication
-// - Idle Rate > 0 : skip duplication, but send at least 1 report every idle rate (in unit of 4 ms).
-TU_ATTR_WEAK bool tud_hid_set_idle_cb(uint8_t instance, uint8_t idle_rate);
-
-// Invoked when sent REPORT successfully to host
-// Application can use this to send the next report
-// Note: For composite reports, report[0] is report ID
-TU_ATTR_WEAK void tud_hid_report_complete_cb(uint8_t instance, uint8_t const* report, uint8_t len);
-
-
-//--------------------------------------------------------------------+
-// Inline Functions
-//--------------------------------------------------------------------+
-static inline bool tud_hid_ready(void)
-{
- return tud_hid_n_ready(0);
-}
-
-static inline uint8_t tud_hid_interface_protocol(void)
-{
- return tud_hid_n_interface_protocol(0);
-}
-
-static inline uint8_t tud_hid_get_protocol(void)
-{
- return tud_hid_n_get_protocol(0);
-}
-
-static inline bool tud_hid_report(uint8_t report_id, void const* report, uint8_t len)
-{
- return tud_hid_n_report(0, report_id, report, len);
-}
-
-static inline bool tud_hid_keyboard_report(uint8_t report_id, uint8_t modifier, uint8_t keycode[6])
-{
- return tud_hid_n_keyboard_report(0, report_id, modifier, keycode);
-}
-
-static inline bool tud_hid_mouse_report(uint8_t report_id, uint8_t buttons, int8_t x, int8_t y, int8_t vertical, int8_t horizontal)
-{
- return tud_hid_n_mouse_report(0, report_id, buttons, x, y, vertical, horizontal);
-}
-
-static inline bool tud_hid_gamepad_report(uint8_t report_id, int8_t x, int8_t y, int8_t z, int8_t rz, int8_t rx, int8_t ry, uint8_t hat, uint32_t buttons)
-{
- return tud_hid_n_gamepad_report(0, report_id, x, y, z, rz, rx, ry, hat, buttons);
-}
-
-/* --------------------------------------------------------------------+
- * HID Report Descriptor Template
- *
- * Convenient for declaring popular HID device (keyboard, mouse, consumer,
- * gamepad etc...). Templates take "HID_REPORT_ID(n)" as input, leave
- * empty if multiple reports is not used
- *
- * - Only 1 report: no parameter
- * uint8_t const report_desc[] = { TUD_HID_REPORT_DESC_KEYBOARD() };
- *
- * - Multiple Reports: "HID_REPORT_ID(ID)" must be passed to template
- * uint8_t const report_desc[] =
- * {
- * TUD_HID_REPORT_DESC_KEYBOARD( HID_REPORT_ID(1) ) ,
- * TUD_HID_REPORT_DESC_MOUSE ( HID_REPORT_ID(2) )
- * };
- *--------------------------------------------------------------------*/
-
-// Keyboard Report Descriptor Template
-#define TUD_HID_REPORT_DESC_KEYBOARD(...) \
- HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_KEYBOARD ) ,\
- HID_COLLECTION ( HID_COLLECTION_APPLICATION ) ,\
- /* Report ID if any */\
- __VA_ARGS__ \
- /* 8 bits Modifier Keys (Shfit, Control, Alt) */ \
- HID_USAGE_PAGE ( HID_USAGE_PAGE_KEYBOARD ) ,\
- HID_USAGE_MIN ( 224 ) ,\
- HID_USAGE_MAX ( 231 ) ,\
- HID_LOGICAL_MIN ( 0 ) ,\
- HID_LOGICAL_MAX ( 1 ) ,\
- HID_REPORT_COUNT ( 8 ) ,\
- HID_REPORT_SIZE ( 1 ) ,\
- HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
- /* 8 bit reserved */ \
- HID_REPORT_COUNT ( 1 ) ,\
- HID_REPORT_SIZE ( 8 ) ,\
- HID_INPUT ( HID_CONSTANT ) ,\
- /* 6-byte Keycodes */ \
- HID_USAGE_PAGE ( HID_USAGE_PAGE_KEYBOARD ) ,\
- HID_USAGE_MIN ( 0 ) ,\
- HID_USAGE_MAX_N ( 255, 2 ) ,\
- HID_LOGICAL_MIN ( 0 ) ,\
- HID_LOGICAL_MAX_N( 255, 2 ) ,\
- HID_REPORT_COUNT ( 6 ) ,\
- HID_REPORT_SIZE ( 8 ) ,\
- HID_INPUT ( HID_DATA | HID_ARRAY | HID_ABSOLUTE ) ,\
- /* 5-bit LED Indicator Kana | Compose | ScrollLock | CapsLock | NumLock */ \
- HID_USAGE_PAGE ( HID_USAGE_PAGE_LED ) ,\
- HID_USAGE_MIN ( 1 ) ,\
- HID_USAGE_MAX ( 5 ) ,\
- HID_REPORT_COUNT ( 5 ) ,\
- HID_REPORT_SIZE ( 1 ) ,\
- HID_OUTPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
- /* led padding */ \
- HID_REPORT_COUNT ( 1 ) ,\
- HID_REPORT_SIZE ( 3 ) ,\
- HID_OUTPUT ( HID_CONSTANT ) ,\
- HID_COLLECTION_END \
-
-// Mouse Report Descriptor Template
-#define TUD_HID_REPORT_DESC_MOUSE(...) \
- HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_MOUSE ) ,\
- HID_COLLECTION ( HID_COLLECTION_APPLICATION ) ,\
- /* Report ID if any */\
- __VA_ARGS__ \
- HID_USAGE ( HID_USAGE_DESKTOP_POINTER ) ,\
- HID_COLLECTION ( HID_COLLECTION_PHYSICAL ) ,\
- HID_USAGE_PAGE ( HID_USAGE_PAGE_BUTTON ) ,\
- HID_USAGE_MIN ( 1 ) ,\
- HID_USAGE_MAX ( 5 ) ,\
- HID_LOGICAL_MIN ( 0 ) ,\
- HID_LOGICAL_MAX ( 1 ) ,\
- /* Left, Right, Middle, Backward, Forward buttons */ \
- HID_REPORT_COUNT( 5 ) ,\
- HID_REPORT_SIZE ( 1 ) ,\
- HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
- /* 3 bit padding */ \
- HID_REPORT_COUNT( 1 ) ,\
- HID_REPORT_SIZE ( 3 ) ,\
- HID_INPUT ( HID_CONSTANT ) ,\
- HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\
- /* X, Y position [-127, 127] */ \
- HID_USAGE ( HID_USAGE_DESKTOP_X ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_Y ) ,\
- HID_LOGICAL_MIN ( 0x81 ) ,\
- HID_LOGICAL_MAX ( 0x7f ) ,\
- HID_REPORT_COUNT( 2 ) ,\
- HID_REPORT_SIZE ( 8 ) ,\
- HID_INPUT ( HID_DATA | HID_VARIABLE | HID_RELATIVE ) ,\
- /* Verital wheel scroll [-127, 127] */ \
- HID_USAGE ( HID_USAGE_DESKTOP_WHEEL ) ,\
- HID_LOGICAL_MIN ( 0x81 ) ,\
- HID_LOGICAL_MAX ( 0x7f ) ,\
- HID_REPORT_COUNT( 1 ) ,\
- HID_REPORT_SIZE ( 8 ) ,\
- HID_INPUT ( HID_DATA | HID_VARIABLE | HID_RELATIVE ) ,\
- HID_USAGE_PAGE ( HID_USAGE_PAGE_CONSUMER ), \
- /* Horizontal wheel scroll [-127, 127] */ \
- HID_USAGE_N ( HID_USAGE_CONSUMER_AC_PAN, 2 ), \
- HID_LOGICAL_MIN ( 0x81 ), \
- HID_LOGICAL_MAX ( 0x7f ), \
- HID_REPORT_COUNT( 1 ), \
- HID_REPORT_SIZE ( 8 ), \
- HID_INPUT ( HID_DATA | HID_VARIABLE | HID_RELATIVE ), \
- HID_COLLECTION_END , \
- HID_COLLECTION_END \
-
-// Consumer Control Report Descriptor Template
-#define TUD_HID_REPORT_DESC_CONSUMER(...) \
- HID_USAGE_PAGE ( HID_USAGE_PAGE_CONSUMER ) ,\
- HID_USAGE ( HID_USAGE_CONSUMER_CONTROL ) ,\
- HID_COLLECTION ( HID_COLLECTION_APPLICATION ) ,\
- /* Report ID if any */\
- __VA_ARGS__ \
- HID_LOGICAL_MIN ( 0x00 ) ,\
- HID_LOGICAL_MAX_N( 0x03FF, 2 ) ,\
- HID_USAGE_MIN ( 0x00 ) ,\
- HID_USAGE_MAX_N ( 0x03FF, 2 ) ,\
- HID_REPORT_COUNT ( 1 ) ,\
- HID_REPORT_SIZE ( 16 ) ,\
- HID_INPUT ( HID_DATA | HID_ARRAY | HID_ABSOLUTE ) ,\
- HID_COLLECTION_END \
-
-/* System Control Report Descriptor Template
- * 0x00 - do nothing
- * 0x01 - Power Off
- * 0x02 - Standby
- * 0x03 - Wake Host
- */
-#define TUD_HID_REPORT_DESC_SYSTEM_CONTROL(...) \
- HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_SYSTEM_CONTROL ) ,\
- HID_COLLECTION ( HID_COLLECTION_APPLICATION ) ,\
- /* Report ID if any */\
- __VA_ARGS__ \
- /* 2 bit system power control */ \
- HID_LOGICAL_MIN ( 1 ) ,\
- HID_LOGICAL_MAX ( 3 ) ,\
- HID_REPORT_COUNT ( 1 ) ,\
- HID_REPORT_SIZE ( 2 ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_SYSTEM_POWER_DOWN ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_SYSTEM_SLEEP ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_SYSTEM_WAKE_UP ) ,\
- HID_INPUT ( HID_DATA | HID_ARRAY | HID_ABSOLUTE ) ,\
- /* 6 bit padding */ \
- HID_REPORT_COUNT ( 1 ) ,\
- HID_REPORT_SIZE ( 6 ) ,\
- HID_INPUT ( HID_CONSTANT ) ,\
- HID_COLLECTION_END \
-
-// Gamepad Report Descriptor Template
-// with 16 buttons, 2 joysticks and 1 hat/dpad with following layout
-// | X | Y | Z | Rz | Rx | Ry (1 byte each) | hat/DPAD (1 byte) | Button Map (2 bytes) |
-#define TUD_HID_REPORT_DESC_GAMEPAD(...) \
- HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_GAMEPAD ) ,\
- HID_COLLECTION ( HID_COLLECTION_APPLICATION ) ,\
- /* Report ID if any */\
- __VA_ARGS__ \
- /* 8 bit X, Y, Z, Rz, Rx, Ry (min -127, max 127 ) */ \
- HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_X ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_Y ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_Z ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_RZ ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_RX ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_RY ) ,\
- HID_LOGICAL_MIN ( 0x81 ) ,\
- HID_LOGICAL_MAX ( 0x7f ) ,\
- HID_REPORT_COUNT ( 6 ) ,\
- HID_REPORT_SIZE ( 8 ) ,\
- HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
- /* 8 bit DPad/Hat Button Map */ \
- HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\
- HID_USAGE ( HID_USAGE_DESKTOP_HAT_SWITCH ) ,\
- HID_LOGICAL_MIN ( 1 ) ,\
- HID_LOGICAL_MAX ( 8 ) ,\
- HID_PHYSICAL_MIN ( 0 ) ,\
- HID_PHYSICAL_MAX_N ( 315, 2 ) ,\
- HID_REPORT_COUNT ( 1 ) ,\
- HID_REPORT_SIZE ( 8 ) ,\
- HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
- /* 16 bit Button Map */ \
- HID_USAGE_PAGE ( HID_USAGE_PAGE_BUTTON ) ,\
- HID_USAGE_MIN ( 1 ) ,\
- HID_USAGE_MAX ( 32 ) ,\
- HID_LOGICAL_MIN ( 0 ) ,\
- HID_LOGICAL_MAX ( 1 ) ,\
- HID_REPORT_COUNT ( 32 ) ,\
- HID_REPORT_SIZE ( 1 ) ,\
- HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
- HID_COLLECTION_END \
-
-// HID Generic Input & Output
-// - 1st parameter is report size (mandatory)
-// - 2nd parameter is report id HID_REPORT_ID(n) (optional)
-#define TUD_HID_REPORT_DESC_GENERIC_INOUT(report_size, ...) \
- HID_USAGE_PAGE_N ( HID_USAGE_PAGE_VENDOR, 2 ),\
- HID_USAGE ( 0x01 ),\
- HID_COLLECTION ( HID_COLLECTION_APPLICATION ),\
- /* Report ID if any */\
- __VA_ARGS__ \
- /* Input */ \
- HID_USAGE ( 0x02 ),\
- HID_LOGICAL_MIN ( 0x00 ),\
- HID_LOGICAL_MAX ( 0xff ),\
- HID_REPORT_SIZE ( 8 ),\
- HID_REPORT_COUNT( report_size ),\
- HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ),\
- /* Output */ \
- HID_USAGE ( 0x03 ),\
- HID_LOGICAL_MIN ( 0x00 ),\
- HID_LOGICAL_MAX ( 0xff ),\
- HID_REPORT_SIZE ( 8 ),\
- HID_REPORT_COUNT( report_size ),\
- HID_OUTPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ),\
- HID_COLLECTION_END \
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-void hidd_init (void);
-void hidd_reset (uint8_t rhport);
-uint16_t hidd_open (uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
-bool hidd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
-bool hidd_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_HID_DEVICE_H_ */
diff --git a/tinyusb/src/class/hid/hid_host.c b/tinyusb/src/class/hid/hid_host.c
deleted file mode 100755
index 8c66477b..00000000
--- a/tinyusb/src/class/hid/hid_host.c
+++ /dev/null
@@ -1,628 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_HOST_ENABLED && CFG_TUH_HID)
-
-#include "host/usbh.h"
-#include "host/usbh_classdriver.h"
-
-#include "hid_host.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-typedef struct
-{
- uint8_t itf_num;
- uint8_t ep_in;
- uint8_t ep_out;
-
- uint8_t itf_protocol; // None, Keyboard, Mouse
- uint8_t protocol_mode; // Boot (0) or Report protocol (1)
-
- uint8_t report_desc_type;
- uint16_t report_desc_len;
-
- uint16_t epin_size;
- uint16_t epout_size;
-
- uint8_t epin_buf[CFG_TUH_HID_EPIN_BUFSIZE];
- uint8_t epout_buf[CFG_TUH_HID_EPOUT_BUFSIZE];
-} hidh_interface_t;
-
-typedef struct
-{
- uint8_t inst_count;
- hidh_interface_t instances[CFG_TUH_HID];
-} hidh_device_t;
-
-static hidh_device_t _hidh_dev[CFG_TUH_DEVICE_MAX];
-
-//------------- Internal prototypes -------------//
-
-// Get HID device & interface
-TU_ATTR_ALWAYS_INLINE static inline hidh_device_t* get_dev(uint8_t dev_addr);
-TU_ATTR_ALWAYS_INLINE static inline hidh_interface_t* get_instance(uint8_t dev_addr, uint8_t instance);
-static uint8_t get_instance_id_by_itfnum(uint8_t dev_addr, uint8_t itf);
-static uint8_t get_instance_id_by_epaddr(uint8_t dev_addr, uint8_t ep_addr);
-
-//--------------------------------------------------------------------+
-// Interface API
-//--------------------------------------------------------------------+
-
-uint8_t tuh_hid_instance_count(uint8_t dev_addr)
-{
- return get_dev(dev_addr)->inst_count;
-}
-
-bool tuh_hid_mounted(uint8_t dev_addr, uint8_t instance)
-{
- hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
- return (hid_itf->ep_in != 0) || (hid_itf->ep_out != 0);
-}
-
-uint8_t tuh_hid_interface_protocol(uint8_t dev_addr, uint8_t instance)
-{
- hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
- return hid_itf->itf_protocol;
-}
-
-//--------------------------------------------------------------------+
-// Control Endpoint API
-//--------------------------------------------------------------------+
-
-uint8_t tuh_hid_get_protocol(uint8_t dev_addr, uint8_t instance)
-{
- hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
- return hid_itf->protocol_mode;
-}
-
-static bool set_protocol_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- uint8_t const itf_num = (uint8_t) request->wIndex;
- uint8_t const instance = get_instance_id_by_itfnum(dev_addr, itf_num);
- hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
-
- if (XFER_RESULT_SUCCESS == result) hid_itf->protocol_mode = (uint8_t) request->wValue;
-
- if (tuh_hid_set_protocol_complete_cb)
- {
- tuh_hid_set_protocol_complete_cb(dev_addr, instance, hid_itf->protocol_mode);
- }
-
- return true;
-}
-
-bool tuh_hid_set_protocol(uint8_t dev_addr, uint8_t instance, uint8_t protocol)
-{
- hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
- TU_VERIFY(hid_itf->itf_protocol != HID_ITF_PROTOCOL_NONE);
-
- TU_LOG2("HID Set Protocol = %d\r\n", protocol);
-
- tusb_control_request_t const request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_INTERFACE,
- .type = TUSB_REQ_TYPE_CLASS,
- .direction = TUSB_DIR_OUT
- },
- .bRequest = HID_REQ_CONTROL_SET_PROTOCOL,
- .wValue = protocol,
- .wIndex = hid_itf->itf_num,
- .wLength = 0
- };
-
- TU_ASSERT( tuh_control_xfer(dev_addr, &request, NULL, set_protocol_complete) );
- return true;
-}
-
-static bool set_report_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- TU_LOG2("HID Set Report complete\r\n");
-
- if (tuh_hid_set_report_complete_cb)
- {
- uint8_t const itf_num = (uint8_t) request->wIndex;
- uint8_t const instance = get_instance_id_by_itfnum(dev_addr, itf_num);
-
- uint8_t const report_type = tu_u16_high(request->wValue);
- uint8_t const report_id = tu_u16_low(request->wValue);
-
- tuh_hid_set_report_complete_cb(dev_addr, instance, report_id, report_type, (result == XFER_RESULT_SUCCESS) ? request->wLength : 0);
- }
-
- return true;
-}
-
-bool tuh_hid_set_report(uint8_t dev_addr, uint8_t instance, uint8_t report_id, uint8_t report_type, void* report, uint16_t len)
-{
- hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
- TU_LOG2("HID Set Report: id = %u, type = %u, len = %u\r\n", report_id, report_type, len);
-
- tusb_control_request_t const request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_INTERFACE,
- .type = TUSB_REQ_TYPE_CLASS,
- .direction = TUSB_DIR_OUT
- },
- .bRequest = HID_REQ_CONTROL_SET_REPORT,
- .wValue = tu_u16(report_type, report_id),
- .wIndex = hid_itf->itf_num,
- .wLength = len
- };
-
- TU_ASSERT( tuh_control_xfer(dev_addr, &request, report, set_report_complete) );
- return true;
-}
-
-//--------------------------------------------------------------------+
-// Interrupt Endpoint API
-//--------------------------------------------------------------------+
-
-bool tuh_hid_receive_report(uint8_t dev_addr, uint8_t instance)
-{
- hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
-
- // claim endpoint
- TU_VERIFY( usbh_edpt_claim(dev_addr, hid_itf->ep_in) );
-
- return usbh_edpt_xfer(dev_addr, hid_itf->ep_in, hid_itf->epin_buf, hid_itf->epin_size);
-}
-
-//bool tuh_n_hid_n_ready(uint8_t dev_addr, uint8_t instance)
-//{
-// TU_VERIFY(tuh_n_hid_n_mounted(dev_addr, instance));
-//
-// hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
-// return !usbh_edpt_busy(dev_addr, hid_itf->ep_in);
-//}
-
-//void tuh_hid_send_report(uint8_t dev_addr, uint8_t instance, uint8_t report_id, uint8_t const* report, uint16_t len);
-
-//--------------------------------------------------------------------+
-// USBH API
-//--------------------------------------------------------------------+
-void hidh_init(void)
-{
- tu_memclr(_hidh_dev, sizeof(_hidh_dev));
-}
-
-bool hidh_xfer_cb(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
-{
- (void) result;
-
- uint8_t const dir = tu_edpt_dir(ep_addr);
- uint8_t const instance = get_instance_id_by_epaddr(dev_addr, ep_addr);
- hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
-
- if ( dir == TUSB_DIR_IN )
- {
- TU_LOG2(" Get Report callback (%u, %u)\r\n", dev_addr, instance);
- TU_LOG3_MEM(hid_itf->epin_buf, xferred_bytes, 2);
- tuh_hid_report_received_cb(dev_addr, instance, hid_itf->epin_buf, xferred_bytes);
- }else
- {
- if (tuh_hid_report_sent_cb) tuh_hid_report_sent_cb(dev_addr, instance, hid_itf->epout_buf, xferred_bytes);
- }
-
- return true;
-}
-
-void hidh_close(uint8_t dev_addr)
-{
- TU_VERIFY(dev_addr <= CFG_TUH_DEVICE_MAX, );
-
- hidh_device_t* hid_dev = get_dev(dev_addr);
-
- if (tuh_hid_umount_cb)
- {
- for (uint8_t inst = 0; inst < hid_dev->inst_count; inst++ ) tuh_hid_umount_cb(dev_addr, inst);
- }
-
- tu_memclr(hid_dev, sizeof(hidh_device_t));
-}
-
-//--------------------------------------------------------------------+
-// Enumeration
-//--------------------------------------------------------------------+
-
-static bool config_set_protocol (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-static bool config_get_report_desc (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-static bool config_get_report_desc_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-
-static void config_driver_mount_complete(uint8_t dev_addr, uint8_t instance, uint8_t const* desc_report, uint16_t desc_len);
-
-bool hidh_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *desc_itf, uint16_t max_len)
-{
- (void) max_len;
-
- TU_VERIFY(TUSB_CLASS_HID == desc_itf->bInterfaceClass);
-
- TU_LOG2("HID opening Interface %u (addr = %u)\r\n", desc_itf->bInterfaceNumber, dev_addr);
-
- // len = interface + hid + n*endpoints
- uint16_t const drv_len = sizeof(tusb_desc_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + desc_itf->bNumEndpoints*sizeof(tusb_desc_endpoint_t);
- TU_ASSERT(max_len >= drv_len);
-
- uint8_t const *p_desc = (uint8_t const *) desc_itf;
-
- //------------- HID descriptor -------------//
- p_desc = tu_desc_next(p_desc);
- tusb_hid_descriptor_hid_t const *desc_hid = (tusb_hid_descriptor_hid_t const *) p_desc;
- TU_ASSERT(HID_DESC_TYPE_HID == desc_hid->bDescriptorType);
-
- // not enough interface, try to increase CFG_TUH_HID
- // TODO multiple devices
- hidh_device_t* hid_dev = get_dev(dev_addr);
- TU_ASSERT(hid_dev->inst_count < CFG_TUH_HID, 0);
-
- //------------- Endpoint Descriptor -------------//
- p_desc = tu_desc_next(p_desc);
- tusb_desc_endpoint_t const * desc_ep = (tusb_desc_endpoint_t const *) p_desc;
- TU_ASSERT(TUSB_DESC_ENDPOINT == desc_ep->bDescriptorType);
-
- // TODO also open endpoint OUT
- TU_ASSERT( usbh_edpt_open(rhport, dev_addr, desc_ep) );
-
- hidh_interface_t* hid_itf = get_instance(dev_addr, hid_dev->inst_count);
- hid_dev->inst_count++;
-
- hid_itf->itf_num = desc_itf->bInterfaceNumber;
- hid_itf->ep_in = desc_ep->bEndpointAddress;
- hid_itf->epin_size = desc_ep->wMaxPacketSize.size;
-
- // Assume bNumDescriptors = 1
- hid_itf->report_desc_type = desc_hid->bReportType;
- hid_itf->report_desc_len = tu_unaligned_read16(&desc_hid->wReportLength);
-
- // Per HID Specs: default is Report protocol, though we will force Boot protocol when set_config
- hid_itf->protocol_mode = HID_PROTOCOL_BOOT;
- if ( HID_SUBCLASS_BOOT == desc_itf->bInterfaceSubClass ) hid_itf->itf_protocol = desc_itf->bInterfaceProtocol;
-
- return true;
-}
-
-bool hidh_set_config(uint8_t dev_addr, uint8_t itf_num)
-{
- uint8_t const instance = get_instance_id_by_itfnum(dev_addr, itf_num);
- hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
-
- // Idle rate = 0 mean only report when there is changes
- uint16_t const idle_rate = 0;
-
- // SET IDLE request, device can stall if not support this request
- TU_LOG2("HID Set Idle \r\n");
- tusb_control_request_t const request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_INTERFACE,
- .type = TUSB_REQ_TYPE_CLASS,
- .direction = TUSB_DIR_OUT
- },
- .bRequest = HID_REQ_CONTROL_SET_IDLE,
- .wValue = idle_rate,
- .wIndex = itf_num,
- .wLength = 0
- };
-
- TU_ASSERT( tuh_control_xfer(dev_addr, &request, NULL, (hid_itf->itf_protocol != HID_ITF_PROTOCOL_NONE) ? config_set_protocol : config_get_report_desc) );
-
- return true;
-}
-
-// Force device to work in BOOT protocol
-static bool config_set_protocol(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- // Stall is a valid response for SET_IDLE, therefore we could ignore its result
- (void) result;
-
- uint8_t const itf_num = (uint8_t) request->wIndex;
- uint8_t const instance = get_instance_id_by_itfnum(dev_addr, itf_num);
- hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
-
- TU_LOG2("HID Set Protocol to Boot Mode\r\n");
- hid_itf->protocol_mode = HID_PROTOCOL_BOOT;
- tusb_control_request_t const new_request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_INTERFACE,
- .type = TUSB_REQ_TYPE_CLASS,
- .direction = TUSB_DIR_OUT
- },
- .bRequest = HID_REQ_CONTROL_SET_PROTOCOL,
- .wValue = HID_PROTOCOL_BOOT,
- .wIndex = hid_itf->itf_num,
- .wLength = 0
- };
-
- TU_ASSERT( tuh_control_xfer(dev_addr, &new_request, NULL, config_get_report_desc) );
- return true;
-}
-
-static bool config_get_report_desc(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- // We can be here after SET_IDLE or SET_PROTOCOL (boot device)
- // Trigger assert if result is not successful with set protocol
- if ( request->bRequest != HID_REQ_CONTROL_SET_IDLE )
- {
- TU_ASSERT(result == XFER_RESULT_SUCCESS);
- }
-
- uint8_t const itf_num = (uint8_t) request->wIndex;
- uint8_t const instance = get_instance_id_by_itfnum(dev_addr, itf_num);
- hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
-
- // Get Report Descriptor if possible
- // using usbh enumeration buffer since report descriptor can be very long
- if( hid_itf->report_desc_len > CFG_TUH_ENUMERATION_BUFSIZE )
- {
- TU_LOG2("HID Skip Report Descriptor since it is too large %u bytes\r\n", hid_itf->report_desc_len);
-
- // Driver is mounted without report descriptor
- config_driver_mount_complete(dev_addr, instance, NULL, 0);
- }else
- {
- TU_LOG2("HID Get Report Descriptor\r\n");
- tusb_control_request_t const new_request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_INTERFACE,
- .type = TUSB_REQ_TYPE_STANDARD,
- .direction = TUSB_DIR_IN
- },
- .bRequest = TUSB_REQ_GET_DESCRIPTOR,
- .wValue = tu_u16(hid_itf->report_desc_type, 0),
- .wIndex = itf_num,
- .wLength = hid_itf->report_desc_len
- };
-
- TU_ASSERT(tuh_control_xfer(dev_addr, &new_request, usbh_get_enum_buf(), config_get_report_desc_complete));
- }
-
- return true;
-}
-
-static bool config_get_report_desc_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- TU_ASSERT(XFER_RESULT_SUCCESS == result);
-
- uint8_t const itf_num = (uint8_t) request->wIndex;
- uint8_t const instance = get_instance_id_by_itfnum(dev_addr, itf_num);
-
- uint8_t const* desc_report = usbh_get_enum_buf();
- uint16_t const desc_len = request->wLength;
-
- config_driver_mount_complete(dev_addr, instance, desc_report, desc_len);
-
- return true;
-}
-
-static void config_driver_mount_complete(uint8_t dev_addr, uint8_t instance, uint8_t const* desc_report, uint16_t desc_len)
-{
- hidh_interface_t* hid_itf = get_instance(dev_addr, instance);
-
- // enumeration is complete
- tuh_hid_mount_cb(dev_addr, instance, desc_report, desc_len);
-
- // notify usbh that driver enumeration is complete
- usbh_driver_set_config_complete(dev_addr, hid_itf->itf_num);
-}
-
-//--------------------------------------------------------------------+
-// Report Descriptor Parser
-//--------------------------------------------------------------------+
-
-uint8_t tuh_hid_parse_report_descriptor(tuh_hid_report_info_t* report_info_arr, uint8_t arr_count, uint8_t const* desc_report, uint16_t desc_len)
-{
- // Report Item 6.2.2.2 USB HID 1.11
- union TU_ATTR_PACKED
- {
- uint8_t byte;
- struct TU_ATTR_PACKED
- {
- uint8_t size : 2;
- uint8_t type : 2;
- uint8_t tag : 4;
- };
- } header;
-
- tu_memclr(report_info_arr, arr_count*sizeof(tuh_hid_report_info_t));
-
- uint8_t report_num = 0;
- tuh_hid_report_info_t* info = report_info_arr;
-
- // current parsed report count & size from descriptor
-// uint8_t ri_report_count = 0;
-// uint8_t ri_report_size = 0;
-
- uint8_t ri_collection_depth = 0;
-
- while(desc_len && report_num < arr_count)
- {
- header.byte = *desc_report++;
- desc_len--;
-
- uint8_t const tag = header.tag;
- uint8_t const type = header.type;
- uint8_t const size = header.size;
-
- uint8_t const data8 = desc_report[0];
-
- TU_LOG(3, "tag = %d, type = %d, size = %d, data = ", tag, type, size);
- for(uint32_t i=0; i<size; i++) TU_LOG(3, "%02X ", desc_report[i]);
- TU_LOG(3, "\r\n");
-
- switch(type)
- {
- case RI_TYPE_MAIN:
- switch (tag)
- {
- case RI_MAIN_INPUT: break;
- case RI_MAIN_OUTPUT: break;
- case RI_MAIN_FEATURE: break;
-
- case RI_MAIN_COLLECTION:
- ri_collection_depth++;
- break;
-
- case RI_MAIN_COLLECTION_END:
- ri_collection_depth--;
- if (ri_collection_depth == 0)
- {
- info++;
- report_num++;
- }
- break;
-
- default: break;
- }
- break;
-
- case RI_TYPE_GLOBAL:
- switch(tag)
- {
- case RI_GLOBAL_USAGE_PAGE:
- // only take in account the "usage page" before REPORT ID
- if ( ri_collection_depth == 0 ) memcpy(&info->usage_page, desc_report, size);
- break;
-
- case RI_GLOBAL_LOGICAL_MIN : break;
- case RI_GLOBAL_LOGICAL_MAX : break;
- case RI_GLOBAL_PHYSICAL_MIN : break;
- case RI_GLOBAL_PHYSICAL_MAX : break;
-
- case RI_GLOBAL_REPORT_ID:
- info->report_id = data8;
- break;
-
- case RI_GLOBAL_REPORT_SIZE:
-// ri_report_size = data8;
- break;
-
- case RI_GLOBAL_REPORT_COUNT:
-// ri_report_count = data8;
- break;
-
- case RI_GLOBAL_UNIT_EXPONENT : break;
- case RI_GLOBAL_UNIT : break;
- case RI_GLOBAL_PUSH : break;
- case RI_GLOBAL_POP : break;
-
- default: break;
- }
- break;
-
- case RI_TYPE_LOCAL:
- switch(tag)
- {
- case RI_LOCAL_USAGE:
- // only take in account the "usage" before starting REPORT ID
- if ( ri_collection_depth == 0 ) info->usage = data8;
- break;
-
- case RI_LOCAL_USAGE_MIN : break;
- case RI_LOCAL_USAGE_MAX : break;
- case RI_LOCAL_DESIGNATOR_INDEX : break;
- case RI_LOCAL_DESIGNATOR_MIN : break;
- case RI_LOCAL_DESIGNATOR_MAX : break;
- case RI_LOCAL_STRING_INDEX : break;
- case RI_LOCAL_STRING_MIN : break;
- case RI_LOCAL_STRING_MAX : break;
- case RI_LOCAL_DELIMITER : break;
- default: break;
- }
- break;
-
- // error
- default: break;
- }
-
- desc_report += size;
- desc_len -= size;
- }
-
- for ( uint8_t i = 0; i < report_num; i++ )
- {
- info = report_info_arr+i;
- TU_LOG2("%u: id = %u, usage_page = %u, usage = %u\r\n", i, info->report_id, info->usage_page, info->usage);
- }
-
- return report_num;
-}
-
-//--------------------------------------------------------------------+
-// Helper
-//--------------------------------------------------------------------+
-
-// Get Device by address
-TU_ATTR_ALWAYS_INLINE static inline hidh_device_t* get_dev(uint8_t dev_addr)
-{
- return &_hidh_dev[dev_addr-1];
-}
-
-// Get Interface by instance number
-TU_ATTR_ALWAYS_INLINE static inline hidh_interface_t* get_instance(uint8_t dev_addr, uint8_t instance)
-{
- return &_hidh_dev[dev_addr-1].instances[instance];
-}
-
-// Get instance ID by interface number
-static uint8_t get_instance_id_by_itfnum(uint8_t dev_addr, uint8_t itf)
-{
- for ( uint8_t inst = 0; inst < CFG_TUH_HID; inst++ )
- {
- hidh_interface_t *hid = get_instance(dev_addr, inst);
-
- if ( (hid->itf_num == itf) && (hid->ep_in || hid->ep_out) ) return inst;
- }
-
- return 0xff;
-}
-
-// Get instance ID by endpoint address
-static uint8_t get_instance_id_by_epaddr(uint8_t dev_addr, uint8_t ep_addr)
-{
- for ( uint8_t inst = 0; inst < CFG_TUH_HID; inst++ )
- {
- hidh_interface_t *hid = get_instance(dev_addr, inst);
-
- if ( (ep_addr == hid->ep_in) || ( ep_addr == hid->ep_out) ) return inst;
- }
-
- return 0xff;
-}
-
-#endif
diff --git a/tinyusb/src/class/hid/hid_host.h b/tinyusb/src/class/hid/hid_host.h
deleted file mode 100755
index fe09b03b..00000000
--- a/tinyusb/src/class/hid/hid_host.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_HID_HOST_H_
-#define _TUSB_HID_HOST_H_
-
-#include "hid.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Class Driver Configuration
-//--------------------------------------------------------------------+
-
-// TODO Highspeed interrupt can be up to 512 bytes
-#ifndef CFG_TUH_HID_EPIN_BUFSIZE
-#define CFG_TUH_HID_EPIN_BUFSIZE 64
-#endif
-
-#ifndef CFG_TUH_HID_EPOUT_BUFSIZE
-#define CFG_TUH_HID_EPOUT_BUFSIZE 64
-#endif
-
-
-typedef struct
-{
- uint8_t report_id;
- uint8_t usage;
- uint16_t usage_page;
-
- // TODO still use the endpoint size for now
-// uint8_t in_len; // length of IN report
-// uint8_t out_len; // length of OUT report
-} tuh_hid_report_info_t;
-
-//--------------------------------------------------------------------+
-// Interface API
-//--------------------------------------------------------------------+
-
-// Get the number of HID instances
-uint8_t tuh_hid_instance_count(uint8_t dev_addr);
-
-// Check if HID instance is mounted
-bool tuh_hid_mounted(uint8_t dev_addr, uint8_t instance);
-
-// Get interface supported protocol (bInterfaceProtocol) check out hid_interface_protocol_enum_t for possible values
-uint8_t tuh_hid_interface_protocol(uint8_t dev_addr, uint8_t instance);
-
-// Parse report descriptor into array of report_info struct and return number of reports.
-// For complicated report, application should write its own parser.
-uint8_t tuh_hid_parse_report_descriptor(tuh_hid_report_info_t* reports_info_arr, uint8_t arr_count, uint8_t const* desc_report, uint16_t desc_len) TU_ATTR_UNUSED;
-
-//--------------------------------------------------------------------+
-// Control Endpoint API
-//--------------------------------------------------------------------+
-
-// Get current protocol: HID_PROTOCOL_BOOT (0) or HID_PROTOCOL_REPORT (1)
-// Note: Device will be initialized in Boot protocol for simplicity.
-// Application can use set_protocol() to switch back to Report protocol.
-uint8_t tuh_hid_get_protocol(uint8_t dev_addr, uint8_t instance);
-
-// Set protocol to HID_PROTOCOL_BOOT (0) or HID_PROTOCOL_REPORT (1)
-// This function is only supported by Boot interface (tuh_n_hid_interface_protocol() != NONE)
-bool tuh_hid_set_protocol(uint8_t dev_addr, uint8_t instance, uint8_t protocol);
-
-// Set Report using control endpoint
-// report_type is either Intput, Output or Feature, (value from hid_report_type_t)
-bool tuh_hid_set_report(uint8_t dev_addr, uint8_t instance, uint8_t report_id, uint8_t report_type, void* report, uint16_t len);
-
-//--------------------------------------------------------------------+
-// Interrupt Endpoint API
-//--------------------------------------------------------------------+
-
-// Check if the interface is ready to use
-//bool tuh_n_hid_n_ready(uint8_t dev_addr, uint8_t instance);
-
-// Try to receive next report on Interrupt Endpoint. Immediately return
-// - true If succeeded, tuh_hid_report_received_cb() callback will be invoked when report is available
-// - false if failed to queue the transfer e.g endpoint is busy
-bool tuh_hid_receive_report(uint8_t dev_addr, uint8_t instance);
-
-// Send report using interrupt endpoint
-// If report_id > 0 (composite), it will be sent as 1st byte, then report contents. Otherwise only report content is sent.
-//void tuh_hid_send_report(uint8_t dev_addr, uint8_t instance, uint8_t report_id, uint8_t const* report, uint16_t len);
-
-//--------------------------------------------------------------------+
-// Callbacks (Weak is optional)
-//--------------------------------------------------------------------+
-
-// Invoked when device with hid interface is mounted
-// Report descriptor is also available for use. tuh_hid_parse_report_descriptor()
-// can be used to parse common/simple enough descriptor.
-// Note: if report descriptor length > CFG_TUH_ENUMERATION_BUFSIZE, it will be skipped
-// therefore report_desc = NULL, desc_len = 0
-void tuh_hid_mount_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* report_desc, uint16_t desc_len);
-
-// Invoked when device with hid interface is un-mounted
-TU_ATTR_WEAK void tuh_hid_umount_cb(uint8_t dev_addr, uint8_t instance);
-
-// Invoked when received report from device via interrupt endpoint
-// Note: if there is report ID (composite), it is 1st byte of report
-void tuh_hid_report_received_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* report, uint16_t len);
-
-// Invoked when sent report to device successfully via interrupt endpoint
-TU_ATTR_WEAK void tuh_hid_report_sent_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* report, uint16_t len);
-
-// Invoked when Sent Report to device via either control endpoint
-// len = 0 indicate there is error in the transfer e.g stalled response
-TU_ATTR_WEAK void tuh_hid_set_report_complete_cb(uint8_t dev_addr, uint8_t instance, uint8_t report_id, uint8_t report_type, uint16_t len);
-
-// Invoked when Set Protocol request is complete
-TU_ATTR_WEAK void tuh_hid_set_protocol_complete_cb(uint8_t dev_addr, uint8_t instance, uint8_t protocol);
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-void hidh_init (void);
-bool hidh_open (uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *desc_itf, uint16_t max_len);
-bool hidh_set_config (uint8_t dev_addr, uint8_t itf_num);
-bool hidh_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes);
-void hidh_close (uint8_t dev_addr);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TUSB_HID_HOST_H_ */
diff --git a/tinyusb/src/class/midi/midi.h b/tinyusb/src/class/midi/midi.h
deleted file mode 100755
index 74dc4174..00000000
--- a/tinyusb/src/class/midi/midi.h
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup group_class
- * \defgroup ClassDriver_CDC Communication Device Class (CDC)
- * Currently only Abstract Control Model subclass is supported
- * @{ */
-
-#ifndef _TUSB_MIDI_H__
-#define _TUSB_MIDI_H__
-
-#include "common/tusb_common.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Class Specific Descriptor
-//--------------------------------------------------------------------+
-
-typedef enum
-{
- MIDI_CS_INTERFACE_HEADER = 0x01,
- MIDI_CS_INTERFACE_IN_JACK = 0x02,
- MIDI_CS_INTERFACE_OUT_JACK = 0x03,
- MIDI_CS_INTERFACE_ELEMENT = 0x04,
-} midi_cs_interface_subtype_t;
-
-typedef enum
-{
- MIDI_CS_ENDPOINT_GENERAL = 0x01
-} midi_cs_endpoint_subtype_t;
-
-typedef enum
-{
- MIDI_JACK_EMBEDDED = 0x01,
- MIDI_JACK_EXTERNAL = 0x02
-} midi_jack_type_t;
-
-typedef enum
-{
- MIDI_CIN_MISC = 0,
- MIDI_CIN_CABLE_EVENT = 1,
- MIDI_CIN_SYSCOM_2BYTE = 2, // 2 byte system common message e.g MTC, SongSelect
- MIDI_CIN_SYSCOM_3BYTE = 3, // 3 byte system common message e.g SPP
- MIDI_CIN_SYSEX_START = 4, // SysEx starts or continue
- MIDI_CIN_SYSEX_END_1BYTE = 5, // SysEx ends with 1 data, or 1 byte system common message
- MIDI_CIN_SYSEX_END_2BYTE = 6, // SysEx ends with 2 data
- MIDI_CIN_SYSEX_END_3BYTE = 7, // SysEx ends with 3 data
- MIDI_CIN_NOTE_ON = 8,
- MIDI_CIN_NOTE_OFF = 9,
- MIDI_CIN_POLY_KEYPRESS = 10,
- MIDI_CIN_CONTROL_CHANGE = 11,
- MIDI_CIN_PROGRAM_CHANGE = 12,
- MIDI_CIN_CHANNEL_PRESSURE = 13,
- MIDI_CIN_PITCH_BEND_CHANGE = 14,
- MIDI_CIN_1BYTE_DATA = 15
-} midi_code_index_number_t;
-
-// MIDI 1.0 status byte
-enum
-{
- //------------- System Exclusive -------------//
- MIDI_STATUS_SYSEX_START = 0xF0,
- MIDI_STATUS_SYSEX_END = 0xF7,
-
- //------------- System Common -------------//
- MIDI_STATUS_SYSCOM_TIME_CODE_QUARTER_FRAME = 0xF1,
- MIDI_STATUS_SYSCOM_SONG_POSITION_POINTER = 0xF2,
- MIDI_STATUS_SYSCOM_SONG_SELECT = 0xF3,
- // F4, F5 is undefined
- MIDI_STATUS_SYSCOM_TUNE_REQUEST = 0xF6,
-
- //------------- System RealTime -------------//
- MIDI_STATUS_SYSREAL_TIMING_CLOCK = 0xF8,
- // 0xF9 is undefined
- MIDI_STATUS_SYSREAL_START = 0xFA,
- MIDI_STATUS_SYSREAL_CONTINUE = 0xFB,
- MIDI_STATUS_SYSREAL_STOP = 0xFC,
- // 0xFD is undefined
- MIDI_STATUS_SYSREAL_ACTIVE_SENSING = 0xFE,
- MIDI_STATUS_SYSREAL_SYSTEM_RESET = 0xFF,
-};
-
-/// MIDI Interface Header Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType
- uint16_t bcdMSC ; ///< MidiStreaming SubClass release number in Binary-Coded Decimal
- uint16_t wTotalLength ;
-} midi_desc_header_t;
-
-/// MIDI In Jack Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType
- uint8_t bJackType ; ///< Embedded or External
- uint8_t bJackID ; ///< Unique ID for MIDI IN Jack
- uint8_t iJack ; ///< string descriptor
-} midi_desc_in_jack_t;
-
-
-/// MIDI Out Jack Descriptor with single pin
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType
- uint8_t bJackType ; ///< Embedded or External
- uint8_t bJackID ; ///< Unique ID for MIDI IN Jack
- uint8_t bNrInputPins;
-
- uint8_t baSourceID;
- uint8_t baSourcePin;
-
- uint8_t iJack ; ///< string descriptor
-} midi_desc_out_jack_t ;
-
-/// MIDI Out Jack Descriptor with multiple pins
-#define midi_desc_out_jack_n_t(input_num) \
- struct TU_ATTR_PACKED { \
- uint8_t bLength ; \
- uint8_t bDescriptorType ; \
- uint8_t bDescriptorSubType ; \
- uint8_t bJackType ; \
- uint8_t bJackID ; \
- uint8_t bNrInputPins ; \
- struct TU_ATTR_PACKED { \
- uint8_t baSourceID; \
- uint8_t baSourcePin; \
- } pins[input_num]; \
- uint8_t iJack ; \
- }
-
-/// MIDI Element Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
- uint8_t bDescriptorSubType ; ///< Descriptor SubType
- uint8_t bElementID;
-
- uint8_t bNrInputPins;
- uint8_t baSourceID;
- uint8_t baSourcePin;
-
- uint8_t bNrOutputPins;
- uint8_t bInTerminalLink;
- uint8_t bOutTerminalLink;
- uint8_t bElCapsSize;
-
- uint16_t bmElementCaps;
- uint8_t iElement;
-} midi_desc_element_t;
-
-/// MIDI Element Descriptor with multiple pins
-#define midi_desc_element_n_t(input_num) \
- struct TU_ATTR_PACKED { \
- uint8_t bLength; \
- uint8_t bDescriptorType; \
- uint8_t bDescriptorSubType; \
- uint8_t bElementID; \
- uint8_t bNrInputPins; \
- struct TU_ATTR_PACKED { \
- uint8_t baSourceID; \
- uint8_t baSourcePin; \
- } pins[input_num]; \
- uint8_t bNrOutputPins; \
- uint8_t bInTerminalLink; \
- uint8_t bOutTerminalLink; \
- uint8_t bElCapsSize; \
- uint16_t bmElementCaps; \
- uint8_t iElement; \
- }
-
-/** @} */
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
-
-/** @} */
diff --git a/tinyusb/src/class/midi/midi_device.c b/tinyusb/src/class/midi/midi_device.c
deleted file mode 100755
index eb85b668..00000000
--- a/tinyusb/src/class/midi/midi_device.c
+++ /dev/null
@@ -1,538 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_MIDI)
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "device/usbd.h"
-#include "device/usbd_pvt.h"
-
-#include "midi_device.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-typedef struct
-{
- uint8_t buffer[4];
- uint8_t index;
- uint8_t total;
-}midid_stream_t;
-
-typedef struct
-{
- uint8_t itf_num;
- uint8_t ep_in;
- uint8_t ep_out;
-
- // For Stream read()/write() API
- // Messages are always 4 bytes long, queue them for reading and writing so the
- // callers can use the Stream interface with single-byte read/write calls.
- midid_stream_t stream_write;
- midid_stream_t stream_read;
-
- /*------------- From this point, data is not cleared by bus reset -------------*/
- // FIFO
- tu_fifo_t rx_ff;
- tu_fifo_t tx_ff;
- uint8_t rx_ff_buf[CFG_TUD_MIDI_RX_BUFSIZE];
- uint8_t tx_ff_buf[CFG_TUD_MIDI_TX_BUFSIZE];
-
- #if CFG_FIFO_MUTEX
- osal_mutex_def_t rx_ff_mutex;
- osal_mutex_def_t tx_ff_mutex;
- #endif
-
- // Endpoint Transfer buffer
- CFG_TUSB_MEM_ALIGN uint8_t epout_buf[CFG_TUD_MIDI_EP_BUFSIZE];
- CFG_TUSB_MEM_ALIGN uint8_t epin_buf[CFG_TUD_MIDI_EP_BUFSIZE];
-
-} midid_interface_t;
-
-#define ITF_MEM_RESET_SIZE offsetof(midid_interface_t, rx_ff)
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-CFG_TUSB_MEM_SECTION midid_interface_t _midid_itf[CFG_TUD_MIDI];
-
-bool tud_midi_n_mounted (uint8_t itf)
-{
- midid_interface_t* midi = &_midid_itf[itf];
- return midi->ep_in && midi->ep_out;
-}
-
-static void _prep_out_transaction (midid_interface_t* p_midi)
-{
- uint8_t const rhport = TUD_OPT_RHPORT;
- uint16_t available = tu_fifo_remaining(&p_midi->rx_ff);
-
- // Prepare for incoming data but only allow what we can store in the ring buffer.
- // TODO Actually we can still carry out the transfer, keeping count of received bytes
- // and slowly move it to the FIFO when read().
- // This pre-check reduces endpoint claiming
- TU_VERIFY(available >= sizeof(p_midi->epout_buf), );
-
- // claim endpoint
- TU_VERIFY(usbd_edpt_claim(rhport, p_midi->ep_out), );
-
- // fifo can be changed before endpoint is claimed
- available = tu_fifo_remaining(&p_midi->rx_ff);
-
- if ( available >= sizeof(p_midi->epout_buf) ) {
- usbd_edpt_xfer(rhport, p_midi->ep_out, p_midi->epout_buf, sizeof(p_midi->epout_buf));
- }else
- {
- // Release endpoint since we don't make any transfer
- usbd_edpt_release(rhport, p_midi->ep_out);
- }
-}
-
-//--------------------------------------------------------------------+
-// READ API
-//--------------------------------------------------------------------+
-uint32_t tud_midi_n_available(uint8_t itf, uint8_t cable_num)
-{
- (void) cable_num;
-
- midid_interface_t* midi = &_midid_itf[itf];
- midid_stream_t const* stream = &midi->stream_read;
-
- // when using with packet API stream total & index are both zero
- return tu_fifo_count(&midi->rx_ff) + (stream->total - stream->index);
-}
-
-uint32_t tud_midi_n_stream_read(uint8_t itf, uint8_t cable_num, void* buffer, uint32_t bufsize)
-{
- (void) cable_num;
- TU_VERIFY(bufsize, 0);
-
- uint8_t* buf8 = (uint8_t*) buffer;
-
- midid_interface_t* midi = &_midid_itf[itf];
- midid_stream_t* stream = &midi->stream_read;
-
- uint32_t total_read = 0;
- while( bufsize )
- {
- // Get new packet from fifo, then set packet expected bytes
- if ( stream->total == 0 )
- {
- // return if there is no more data from fifo
- if ( !tud_midi_n_packet_read(itf, stream->buffer) ) return total_read;
-
- uint8_t const code_index = stream->buffer[0] & 0x0f;
-
- // MIDI 1.0 Table 4-1: Code Index Number Classifications
- switch(code_index)
- {
- case MIDI_CIN_MISC:
- case MIDI_CIN_CABLE_EVENT:
- // These are reserved and unused, possibly issue somewhere, skip this packet
- return 0;
- break;
-
- case MIDI_CIN_SYSEX_END_1BYTE:
- case MIDI_CIN_1BYTE_DATA:
- stream->total = 1;
- break;
-
- case MIDI_CIN_SYSCOM_2BYTE :
- case MIDI_CIN_SYSEX_END_2BYTE :
- case MIDI_CIN_PROGRAM_CHANGE :
- case MIDI_CIN_CHANNEL_PRESSURE :
- stream->total = 2;
- break;
-
- default:
- stream->total = 3;
- break;
- }
- }
-
- // Copy data up to bufsize
- uint32_t const count = tu_min32(stream->total - stream->index, bufsize);
-
- // Skip the header (1st byte) in the buffer
- memcpy(buf8, stream->buffer + 1 + stream->index, count);
-
- total_read += count;
- stream->index += count;
- buf8 += count;
- bufsize -= count;
-
- // complete current event packet, reset stream
- if ( stream->total == stream->index )
- {
- stream->index = 0;
- stream->total = 0;
- }
- }
-
- return total_read;
-}
-
-bool tud_midi_n_packet_read (uint8_t itf, uint8_t packet[4])
-{
- midid_interface_t* midi = &_midid_itf[itf];
- TU_VERIFY(midi->ep_out);
-
- uint32_t const num_read = tu_fifo_read_n(&midi->rx_ff, packet, 4);
- _prep_out_transaction(midi);
- return (num_read == 4);
-}
-
-//--------------------------------------------------------------------+
-// WRITE API
-//--------------------------------------------------------------------+
-
-static uint32_t write_flush(midid_interface_t* midi)
-{
- // No data to send
- if ( !tu_fifo_count(&midi->tx_ff) ) return 0;
-
- uint8_t const rhport = TUD_OPT_RHPORT;
-
- // skip if previous transfer not complete
- TU_VERIFY( usbd_edpt_claim(rhport, midi->ep_in), 0 );
-
- uint16_t count = tu_fifo_read_n(&midi->tx_ff, midi->epin_buf, CFG_TUD_MIDI_EP_BUFSIZE);
-
- if (count)
- {
- TU_ASSERT( usbd_edpt_xfer(rhport, midi->ep_in, midi->epin_buf, count), 0 );
- return count;
- }else
- {
- // Release endpoint since we don't make any transfer
- usbd_edpt_release(rhport, midi->ep_in);
- return 0;
- }
-}
-
-uint32_t tud_midi_n_stream_write(uint8_t itf, uint8_t cable_num, uint8_t const* buffer, uint32_t bufsize)
-{
- midid_interface_t* midi = &_midid_itf[itf];
- TU_VERIFY(midi->ep_in, 0);
-
- midid_stream_t* stream = &midi->stream_write;
-
- uint32_t i = 0;
- while ( (i < bufsize) && (tu_fifo_remaining(&midi->tx_ff) >= 4) )
- {
- uint8_t const data = buffer[i];
- i++;
-
- if ( stream->index == 0 )
- {
- //------------- New event packet -------------//
-
- uint8_t const msg = data >> 4;
-
- stream->index = 2;
- stream->buffer[1] = data;
-
- // Check to see if we're still in a SysEx transmit.
- if ( stream->buffer[0] == MIDI_CIN_SYSEX_START )
- {
- if ( data == MIDI_STATUS_SYSEX_END )
- {
- stream->buffer[0] = MIDI_CIN_SYSEX_END_1BYTE;
- stream->total = 2;
- }
- else
- {
- stream->total = 4;
- }
- }
- else if ( (msg >= 0x8 && msg <= 0xB) || msg == 0xE )
- {
- // Channel Voice Messages
- stream->buffer[0] = (cable_num << 4) | msg;
- stream->total = 4;
- }
- else if ( msg == 0xf )
- {
- // System message
- if ( data == MIDI_STATUS_SYSEX_START )
- {
- stream->buffer[0] = MIDI_CIN_SYSEX_START;
- stream->total = 4;
- }
- else if ( data == MIDI_STATUS_SYSCOM_TIME_CODE_QUARTER_FRAME || data == MIDI_STATUS_SYSCOM_SONG_SELECT )
- {
- stream->buffer[0] = MIDI_CIN_SYSCOM_2BYTE;
- stream->total = 3;
- }
- else if ( data == MIDI_STATUS_SYSCOM_SONG_POSITION_POINTER )
- {
- stream->buffer[0] = MIDI_CIN_SYSCOM_3BYTE;
- stream->total = 4;
- }
- else
- {
- stream->buffer[0] = MIDI_CIN_SYSEX_END_1BYTE;
- stream->total = 2;
- }
- }
- else
- {
- // Pack individual bytes if we don't support packing them into words.
- stream->buffer[0] = cable_num << 4 | 0xf;
- stream->buffer[2] = 0;
- stream->buffer[3] = 0;
- stream->index = 2;
- stream->total = 2;
- }
- }
- else
- {
- //------------- On-going (buffering) packet -------------//
-
- TU_ASSERT(stream->index < 4, i);
- stream->buffer[stream->index] = data;
- stream->index++;
-
- // See if this byte ends a SysEx.
- if ( stream->buffer[0] == MIDI_CIN_SYSEX_START && data == MIDI_STATUS_SYSEX_END )
- {
- stream->buffer[0] = MIDI_CIN_SYSEX_START + (stream->index - 1);
- stream->total = stream->index;
- }
- }
-
- // Send out packet
- if ( stream->index == stream->total )
- {
- // zeroes unused bytes
- for(uint8_t idx = stream->total; idx < 4; idx++) stream->buffer[idx] = 0;
-
- uint16_t const count = tu_fifo_write_n(&midi->tx_ff, stream->buffer, 4);
-
- // complete current event packet, reset stream
- stream->index = stream->total = 0;
-
- // FIFO overflown, since we already check fifo remaining. It is probably race condition
- TU_ASSERT(count == 4, i);
- }
- }
-
- write_flush(midi);
-
- return i;
-}
-
-bool tud_midi_n_packet_write (uint8_t itf, uint8_t const packet[4])
-{
- midid_interface_t* midi = &_midid_itf[itf];
- TU_VERIFY(midi->ep_in);
-
- if (tu_fifo_remaining(&midi->tx_ff) < 4) return false;
-
- tu_fifo_write_n(&midi->tx_ff, packet, 4);
- write_flush(midi);
-
- return true;
-}
-
-//--------------------------------------------------------------------+
-// USBD Driver API
-//--------------------------------------------------------------------+
-void midid_init(void)
-{
- tu_memclr(_midid_itf, sizeof(_midid_itf));
-
- for(uint8_t i=0; i<CFG_TUD_MIDI; i++)
- {
- midid_interface_t* midi = &_midid_itf[i];
-
- // config fifo
- tu_fifo_config(&midi->rx_ff, midi->rx_ff_buf, CFG_TUD_MIDI_RX_BUFSIZE, 1, false); // true, true
- tu_fifo_config(&midi->tx_ff, midi->tx_ff_buf, CFG_TUD_MIDI_TX_BUFSIZE, 1, false); // OBVS.
-
- #if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&midi->rx_ff, NULL, osal_mutex_create(&midi->rx_ff_mutex));
- tu_fifo_config_mutex(&midi->tx_ff, osal_mutex_create(&midi->tx_ff_mutex), NULL);
- #endif
- }
-}
-
-void midid_reset(uint8_t rhport)
-{
- (void) rhport;
-
- for(uint8_t i=0; i<CFG_TUD_MIDI; i++)
- {
- midid_interface_t* midi = &_midid_itf[i];
- tu_memclr(midi, ITF_MEM_RESET_SIZE);
- tu_fifo_clear(&midi->rx_ff);
- tu_fifo_clear(&midi->tx_ff);
- }
-}
-
-uint16_t midid_open(uint8_t rhport, tusb_desc_interface_t const * desc_itf, uint16_t max_len)
-{
- // 1st Interface is Audio Control v1
- TU_VERIFY(TUSB_CLASS_AUDIO == desc_itf->bInterfaceClass &&
- AUDIO_SUBCLASS_CONTROL == desc_itf->bInterfaceSubClass &&
- AUDIO_FUNC_PROTOCOL_CODE_UNDEF == desc_itf->bInterfaceProtocol, 0);
-
- uint16_t drv_len = tu_desc_len(desc_itf);
- uint8_t const * p_desc = tu_desc_next(desc_itf);
-
- // Skip Class Specific descriptors
- while ( TUSB_DESC_CS_INTERFACE == tu_desc_type(p_desc) && drv_len <= max_len )
- {
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
- }
-
- // 2nd Interface is MIDI Streaming
- TU_VERIFY(TUSB_DESC_INTERFACE == tu_desc_type(p_desc), 0);
- tusb_desc_interface_t const * desc_midi = (tusb_desc_interface_t const *) p_desc;
-
- TU_VERIFY(TUSB_CLASS_AUDIO == desc_midi->bInterfaceClass &&
- AUDIO_SUBCLASS_MIDI_STREAMING == desc_midi->bInterfaceSubClass &&
- AUDIO_FUNC_PROTOCOL_CODE_UNDEF == desc_midi->bInterfaceProtocol, 0);
-
- // Find available interface
- midid_interface_t * p_midi = NULL;
- for(uint8_t i=0; i<CFG_TUD_MIDI; i++)
- {
- if ( _midid_itf[i].ep_in == 0 && _midid_itf[i].ep_out == 0 )
- {
- p_midi = &_midid_itf[i];
- break;
- }
- }
-
- p_midi->itf_num = desc_midi->bInterfaceNumber;
- (void) p_midi->itf_num;
-
- // next descriptor
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
-
- // Find and open endpoint descriptors
- uint8_t found_endpoints = 0;
- while ( (found_endpoints < desc_midi->bNumEndpoints) && (drv_len <= max_len) )
- {
- if ( TUSB_DESC_ENDPOINT == tu_desc_type(p_desc) )
- {
- TU_ASSERT(usbd_edpt_open(rhport, (tusb_desc_endpoint_t const *) p_desc), 0);
- uint8_t ep_addr = ((tusb_desc_endpoint_t const *) p_desc)->bEndpointAddress;
-
- if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN)
- {
- p_midi->ep_in = ep_addr;
- } else {
- p_midi->ep_out = ep_addr;
- }
-
- // Class Specific MIDI Stream endpoint descriptor
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
-
- found_endpoints += 1;
- }
-
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
- }
-
- // Prepare for incoming data
- _prep_out_transaction(p_midi);
-
- return drv_len;
-}
-
-// Invoked when a control transfer occurred on an interface of this class
-// Driver response accordingly to the request and the transfer stage (setup/data/ack)
-// return false to stall control endpoint (e.g unsupported request)
-bool midid_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
-{
- (void) rhport;
- (void) stage;
- (void) request;
-
- // driver doesn't support any request yet
- return false;
-}
-
-bool midid_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
-{
- (void) result;
- (void) rhport;
-
- uint8_t itf;
- midid_interface_t* p_midi;
-
- // Identify which interface to use
- for (itf = 0; itf < CFG_TUD_MIDI; itf++)
- {
- p_midi = &_midid_itf[itf];
- if ( ( ep_addr == p_midi->ep_out ) || ( ep_addr == p_midi->ep_in ) ) break;
- }
- TU_ASSERT(itf < CFG_TUD_MIDI);
-
- // receive new data
- if ( ep_addr == p_midi->ep_out )
- {
- tu_fifo_write_n(&p_midi->rx_ff, p_midi->epout_buf, xferred_bytes);
-
- // invoke receive callback if available
- if (tud_midi_rx_cb) tud_midi_rx_cb(itf);
-
- // prepare for next
- // TODO for now ep_out is not used by public API therefore there is no race condition,
- // and does not need to claim like ep_in
- _prep_out_transaction(p_midi);
- }
- else if ( ep_addr == p_midi->ep_in )
- {
- if (0 == write_flush(p_midi))
- {
- // If there is no data left, a ZLP should be sent if
- // xferred_bytes is multiple of EP size and not zero
- if ( !tu_fifo_count(&p_midi->tx_ff) && xferred_bytes && (0 == (xferred_bytes % CFG_TUD_MIDI_EP_BUFSIZE)) )
- {
- if ( usbd_edpt_claim(rhport, p_midi->ep_in) )
- {
- usbd_edpt_xfer(rhport, p_midi->ep_in, NULL, 0);
- }
- }
- }
- }
-
- return true;
-}
-
-#endif
diff --git a/tinyusb/src/class/midi/midi_device.h b/tinyusb/src/class/midi/midi_device.h
deleted file mode 100755
index 211edc8d..00000000
--- a/tinyusb/src/class/midi/midi_device.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_MIDI_DEVICE_H_
-#define _TUSB_MIDI_DEVICE_H_
-
-#include "class/audio/audio.h"
-#include "midi.h"
-
-//--------------------------------------------------------------------+
-// Class Driver Configuration
-//--------------------------------------------------------------------+
-
-#if !defined(CFG_TUD_MIDI_EP_BUFSIZE) && defined(CFG_TUD_MIDI_EPSIZE)
- #warning CFG_TUD_MIDI_EPSIZE is renamed to CFG_TUD_MIDI_EP_BUFSIZE, please update to use the new name
- #define CFG_TUD_MIDI_EP_BUFSIZE CFG_TUD_MIDI_EPSIZE
-#endif
-
-#ifndef CFG_TUD_MIDI_EP_BUFSIZE
- #define CFG_TUD_MIDI_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-#endif
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/** \addtogroup MIDI_Serial Serial
- * @{
- * \defgroup MIDI_Serial_Device Device
- * @{ */
-
-//--------------------------------------------------------------------+
-// Application API (Multiple Interfaces)
-// CFG_TUD_MIDI > 1
-//--------------------------------------------------------------------+
-
-// Check if midi interface is mounted
-bool tud_midi_n_mounted (uint8_t itf);
-
-// Get the number of bytes available for reading
-uint32_t tud_midi_n_available (uint8_t itf, uint8_t cable_num);
-
-// Read byte stream (legacy)
-uint32_t tud_midi_n_stream_read (uint8_t itf, uint8_t cable_num, void* buffer, uint32_t bufsize);
-
-// Write byte Stream (legacy)
-uint32_t tud_midi_n_stream_write (uint8_t itf, uint8_t cable_num, uint8_t const* buffer, uint32_t bufsize);
-
-// Read event packet (4 bytes)
-bool tud_midi_n_packet_read (uint8_t itf, uint8_t packet[4]);
-
-// Write event packet (4 bytes)
-bool tud_midi_n_packet_write (uint8_t itf, uint8_t const packet[4]);
-
-//--------------------------------------------------------------------+
-// Application API (Single Interface)
-//--------------------------------------------------------------------+
-static inline bool tud_midi_mounted (void);
-static inline uint32_t tud_midi_available (void);
-
-static inline uint32_t tud_midi_stream_read (void* buffer, uint32_t bufsize);
-static inline uint32_t tud_midi_stream_write (uint8_t cable_num, uint8_t const* buffer, uint32_t bufsize);
-
-static inline bool tud_midi_packet_read (uint8_t packet[4]);
-static inline bool tud_midi_packet_write (uint8_t const packet[4]);
-
-//------------- Deprecated API name -------------//
-// TODO remove after 0.10.0 release
-
-TU_ATTR_DEPRECATED("tud_midi_read() is renamed to tud_midi_stream_read()")
-static inline uint32_t tud_midi_read (void* buffer, uint32_t bufsize)
-{
- return tud_midi_stream_read(buffer, bufsize);
-}
-
-TU_ATTR_DEPRECATED("tud_midi_write() is renamed to tud_midi_stream_write()")
-static inline uint32_t tud_midi_write(uint8_t cable_num, uint8_t const* buffer, uint32_t bufsize)
-{
- return tud_midi_stream_write(cable_num, buffer, bufsize);
-}
-
-
-TU_ATTR_DEPRECATED("tud_midi_send() is renamed to tud_midi_packet_write()")
-static inline bool tud_midi_send(uint8_t packet[4])
-{
- return tud_midi_packet_write(packet);
-}
-
-TU_ATTR_DEPRECATED("tud_midi_receive() is renamed to tud_midi_packet_read()")
-static inline bool tud_midi_receive(uint8_t packet[4])
-{
- return tud_midi_packet_read(packet);
-}
-
-//--------------------------------------------------------------------+
-// Application Callback API (weak is optional)
-//--------------------------------------------------------------------+
-TU_ATTR_WEAK void tud_midi_rx_cb(uint8_t itf);
-
-//--------------------------------------------------------------------+
-// Inline Functions
-//--------------------------------------------------------------------+
-
-static inline bool tud_midi_mounted (void)
-{
- return tud_midi_n_mounted(0);
-}
-
-static inline uint32_t tud_midi_available (void)
-{
- return tud_midi_n_available(0, 0);
-}
-
-static inline uint32_t tud_midi_stream_read (void* buffer, uint32_t bufsize)
-{
- return tud_midi_n_stream_read(0, 0, buffer, bufsize);
-}
-
-static inline uint32_t tud_midi_stream_write (uint8_t cable_num, uint8_t const* buffer, uint32_t bufsize)
-{
- return tud_midi_n_stream_write(0, cable_num, buffer, bufsize);
-}
-
-static inline bool tud_midi_packet_read (uint8_t packet[4])
-{
- return tud_midi_n_packet_read(0, packet);
-}
-
-static inline bool tud_midi_packet_write (uint8_t const packet[4])
-{
- return tud_midi_n_packet_write(0, packet);
-}
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-void midid_init (void);
-void midid_reset (uint8_t rhport);
-uint16_t midid_open (uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
-bool midid_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
-bool midid_xfer_cb (uint8_t rhport, uint8_t edpt_addr, xfer_result_t result, uint32_t xferred_bytes);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_MIDI_DEVICE_H_ */
-
-/** @} */
-/** @} */
diff --git a/tinyusb/src/class/msc/msc.h b/tinyusb/src/class/msc/msc.h
deleted file mode 100755
index 84b6e4d7..00000000
--- a/tinyusb/src/class/msc/msc.h
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_MSC_H_
-#define _TUSB_MSC_H_
-
-#include "common/tusb_common.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Mass Storage Class Constant
-//--------------------------------------------------------------------+
-/// MassStorage Subclass
-typedef enum
-{
- MSC_SUBCLASS_RBC = 1 , ///< Reduced Block Commands (RBC) T10 Project 1240-D
- MSC_SUBCLASS_SFF_MMC , ///< SFF-8020i, MMC-2 (ATAPI). Typically used by a CD/DVD device
- MSC_SUBCLASS_QIC , ///< QIC-157. Typically used by a tape device
- MSC_SUBCLASS_UFI , ///< UFI. Typically used by Floppy Disk Drive (FDD) device
- MSC_SUBCLASS_SFF , ///< SFF-8070i. Can be used by Floppy Disk Drive (FDD) device
- MSC_SUBCLASS_SCSI ///< SCSI transparent command set
-}msc_subclass_type_t;
-
-enum {
- MSC_CBW_SIGNATURE = 0x43425355, ///< Constant value of 43425355h (little endian)
- MSC_CSW_SIGNATURE = 0x53425355 ///< Constant value of 53425355h (little endian)
-};
-
-/// \brief MassStorage Protocol.
-/// \details CBI only approved to use with full-speed floopy disk & should not used with highspeed or device other than floopy
-typedef enum
-{
- MSC_PROTOCOL_CBI = 0 , ///< Control/Bulk/Interrupt protocol (with command completion interrupt)
- MSC_PROTOCOL_CBI_NO_INTERRUPT = 1 , ///< Control/Bulk/Interrupt protocol (without command completion interrupt)
- MSC_PROTOCOL_BOT = 0x50 ///< Bulk-Only Transport
-}msc_protocol_type_t;
-
-/// MassStorage Class-Specific Control Request
-typedef enum
-{
- MSC_REQ_GET_MAX_LUN = 254, ///< The Get Max LUN device request is used to determine the number of logical units supported by the device. Logical Unit Numbers on the device shall be numbered contiguously starting from LUN 0 to a maximum LUN of 15
- MSC_REQ_RESET = 255 ///< This request is used to reset the mass storage device and its associated interface. This class-specific request shall ready the device for the next CBW from the host.
-}msc_request_type_t;
-
-/// \brief Command Block Status Values
-/// \details Indicates the success or failure of the command. The device shall set this byte to zero if the command completed
-/// successfully. A non-zero value shall indicate a failure during command execution according to the following
-typedef enum
-{
- MSC_CSW_STATUS_PASSED = 0 , ///< MSC_CSW_STATUS_PASSED
- MSC_CSW_STATUS_FAILED , ///< MSC_CSW_STATUS_FAILED
- MSC_CSW_STATUS_PHASE_ERROR ///< MSC_CSW_STATUS_PHASE_ERROR
-}msc_csw_status_t;
-
-/// Command Block Wrapper
-typedef struct TU_ATTR_PACKED
-{
- uint32_t signature; ///< Signature that helps identify this data packet as a CBW. The signature field shall contain the value 43425355h (little endian), indicating a CBW.
- uint32_t tag; ///< Tag sent by the host. The device shall echo the contents of this field back to the host in the dCSWTagfield of the associated CSW. The dCSWTagpositively associates a CSW with the corresponding CBW.
- uint32_t total_bytes; ///< The number of bytes of data that the host expects to transfer on the Bulk-In or Bulk-Out endpoint (as indicated by the Direction bit) during the execution of this command. If this field is zero, the device and the host shall transfer no data between the CBW and the associated CSW, and the device shall ignore the value of the Direction bit in bmCBWFlags.
- uint8_t dir; ///< Bit 7 of this field define transfer direction \n - 0 : Data-Out from host to the device. \n - 1 : Data-In from the device to the host.
- uint8_t lun; ///< The device Logical Unit Number (LUN) to which the command block is being sent. For devices that support multiple LUNs, the host shall place into this field the LUN to which this command block is addressed. Otherwise, the host shall set this field to zero.
- uint8_t cmd_len; ///< The valid length of the CBWCBin bytes. This defines the valid length of the command block. The only legal values are 1 through 16
- uint8_t command[16]; ///< The command block to be executed by the device. The device shall interpret the first cmd_len bytes in this field as a command block
-}msc_cbw_t;
-
-TU_VERIFY_STATIC(sizeof(msc_cbw_t) == 31, "size is not correct");
-
-/// Command Status Wrapper
-typedef struct TU_ATTR_PACKED
-{
- uint32_t signature ; ///< Signature that helps identify this data packet as a CSW. The signature field shall contain the value 53425355h (little endian), indicating CSW.
- uint32_t tag ; ///< The device shall set this field to the value received in the dCBWTag of the associated CBW.
- uint32_t data_residue ; ///< For Data-Out the device shall report in the dCSWDataResiduethe difference between the amount of data expected as stated in the dCBWDataTransferLength, and the actual amount of data processed by the device. For Data-In the device shall report in the dCSWDataResiduethe difference between the amount of data expected as stated in the dCBWDataTransferLengthand the actual amount of relevant data sent by the device
- uint8_t status ; ///< indicates the success or failure of the command. Values from \ref msc_csw_status_t
-}msc_csw_t;
-
-TU_VERIFY_STATIC(sizeof(msc_csw_t) == 13, "size is not correct");
-
-//--------------------------------------------------------------------+
-// SCSI Constant
-//--------------------------------------------------------------------+
-
-/// SCSI Command Operation Code
-typedef enum
-{
- SCSI_CMD_TEST_UNIT_READY = 0x00, ///< The SCSI Test Unit Ready command is used to determine if a device is ready to transfer data (read/write), i.e. if a disk has spun up, if a tape is loaded and ready etc. The device does not perform a self-test operation.
- SCSI_CMD_INQUIRY = 0x12, ///< The SCSI Inquiry command is used to obtain basic information from a target device.
- SCSI_CMD_MODE_SELECT_6 = 0x15, ///< provides a means for the application client to specify medium, logical unit, or peripheral device parameters to the device server. Device servers that implement the MODE SELECT(6) command shall also implement the MODE SENSE(6) command. Application clients should issue MODE SENSE(6) prior to each MODE SELECT(6) to determine supported mode pages, page lengths, and other parameters.
- SCSI_CMD_MODE_SENSE_6 = 0x1A, ///< provides a means for a device server to report parameters to an application client. It is a complementary command to the MODE SELECT(6) command. Device servers that implement the MODE SENSE(6) command shall also implement the MODE SELECT(6) command.
- SCSI_CMD_START_STOP_UNIT = 0x1B,
- SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E,
- SCSI_CMD_READ_CAPACITY_10 = 0x25, ///< The SCSI Read Capacity command is used to obtain data capacity information from a target device.
- SCSI_CMD_REQUEST_SENSE = 0x03, ///< The SCSI Request Sense command is part of the SCSI computer protocol standard. This command is used to obtain sense data -- status/error information -- from a target device.
- SCSI_CMD_READ_FORMAT_CAPACITY = 0x23, ///< The command allows the Host to request a list of the possible format capacities for an installed writable media. This command also has the capability to report the writable capacity for a media when it is installed
- SCSI_CMD_READ_10 = 0x28, ///< The READ (10) command requests that the device server read the specified logical block(s) and transfer them to the data-in buffer.
- SCSI_CMD_WRITE_10 = 0x2A, ///< The WRITE (10) command requests thatthe device server transfer the specified logical block(s) from the data-out buffer and write them.
-}scsi_cmd_type_t;
-
-/// SCSI Sense Key
-typedef enum
-{
- SCSI_SENSE_NONE = 0x00, ///< no specific Sense Key. This would be the case for a successful command
- SCSI_SENSE_RECOVERED_ERROR = 0x01, ///< ndicates the last command completed successfully with some recovery action performed by the disc drive.
- SCSI_SENSE_NOT_READY = 0x02, ///< Indicates the logical unit addressed cannot be accessed.
- SCSI_SENSE_MEDIUM_ERROR = 0x03, ///< Indicates the command terminated with a non-recovered error condition.
- SCSI_SENSE_HARDWARE_ERROR = 0x04, ///< Indicates the disc drive detected a nonrecoverable hardware failure while performing the command or during a self test.
- SCSI_SENSE_ILLEGAL_REQUEST = 0x05, ///< Indicates an illegal parameter in the command descriptor block or in the additional parameters
- SCSI_SENSE_UNIT_ATTENTION = 0x06, ///< Indicates the disc drive may have been reset.
- SCSI_SENSE_DATA_PROTECT = 0x07, ///< Indicates that a command that reads or writes the medium was attempted on a block that is protected from this operation. The read or write operation is not performed.
- SCSI_SENSE_FIRMWARE_ERROR = 0x08, ///< Vendor specific sense key.
- SCSI_SENSE_ABORTED_COMMAND = 0x0b, ///< Indicates the disc drive aborted the command.
- SCSI_SENSE_EQUAL = 0x0c, ///< Indicates a SEARCH DATA command has satisfied an equal comparison.
- SCSI_SENSE_VOLUME_OVERFLOW = 0x0d, ///< Indicates a buffered peripheral device has reached the end of medium partition and data remains in the buffer that has not been written to the medium.
- SCSI_SENSE_MISCOMPARE = 0x0e ///< ndicates that the source data did not match the data read from the medium.
-}scsi_sense_key_type_t;
-
-//--------------------------------------------------------------------+
-// SCSI Primary Command (SPC-4)
-//--------------------------------------------------------------------+
-
-/// SCSI Test Unit Ready Command
-typedef struct TU_ATTR_PACKED
-{
- uint8_t cmd_code ; ///< SCSI OpCode for \ref SCSI_CMD_TEST_UNIT_READY
- uint8_t lun ; ///< Logical Unit
- uint8_t reserved[3] ;
- uint8_t control ;
-} scsi_test_unit_ready_t;
-
-TU_VERIFY_STATIC(sizeof(scsi_test_unit_ready_t) == 6, "size is not correct");
-
-/// SCSI Inquiry Command
-typedef struct TU_ATTR_PACKED
-{
- uint8_t cmd_code ; ///< SCSI OpCode for \ref SCSI_CMD_INQUIRY
- uint8_t reserved1 ;
- uint8_t page_code ;
- uint8_t reserved2 ;
- uint8_t alloc_length ; ///< specifies the maximum number of bytes that USB host has allocated in the Data-In Buffer. An allocation length of zero specifies that no data shall be transferred.
- uint8_t control ;
-} scsi_inquiry_t, scsi_request_sense_t;
-
-TU_VERIFY_STATIC(sizeof(scsi_inquiry_t) == 6, "size is not correct");
-
-/// SCSI Inquiry Response Data
-typedef struct TU_ATTR_PACKED
-{
- uint8_t peripheral_device_type : 5;
- uint8_t peripheral_qualifier : 3;
-
- uint8_t : 7;
- uint8_t is_removable : 1;
-
- uint8_t version;
-
- uint8_t response_data_format : 4;
- uint8_t hierarchical_support : 1;
- uint8_t normal_aca : 1;
- uint8_t : 2;
-
- uint8_t additional_length;
-
- uint8_t protect : 1;
- uint8_t : 2;
- uint8_t third_party_copy : 1;
- uint8_t target_port_group_support : 2;
- uint8_t access_control_coordinator : 1;
- uint8_t scc_support : 1;
-
- uint8_t addr16 : 1;
- uint8_t : 3;
- uint8_t multi_port : 1;
- uint8_t : 1; // vendor specific
- uint8_t enclosure_service : 1;
- uint8_t : 1;
-
- uint8_t : 1; // vendor specific
- uint8_t cmd_que : 1;
- uint8_t : 2;
- uint8_t sync : 1;
- uint8_t wbus16 : 1;
- uint8_t : 2;
-
- uint8_t vendor_id[8] ; ///< 8 bytes of ASCII data identifying the vendor of the product.
- uint8_t product_id[16]; ///< 16 bytes of ASCII data defined by the vendor.
- uint8_t product_rev[4]; ///< 4 bytes of ASCII data defined by the vendor.
-} scsi_inquiry_resp_t;
-
-TU_VERIFY_STATIC(sizeof(scsi_inquiry_resp_t) == 36, "size is not correct");
-
-
-typedef struct TU_ATTR_PACKED
-{
- uint8_t response_code : 7; ///< 70h - current errors, Fixed Format 71h - deferred errors, Fixed Format
- uint8_t valid : 1;
-
- uint8_t reserved;
-
- uint8_t sense_key : 4;
- uint8_t : 1;
- uint8_t ili : 1; ///< Incorrect length indicator
- uint8_t end_of_medium : 1;
- uint8_t filemark : 1;
-
- uint32_t information;
- uint8_t add_sense_len;
- uint32_t command_specific_info;
- uint8_t add_sense_code;
- uint8_t add_sense_qualifier;
- uint8_t field_replaceable_unit_code;
-
- uint8_t sense_key_specific[3]; ///< sense key specific valid bit is bit 7 of key[0], aka MSB in Big Endian layout
-
-} scsi_sense_fixed_resp_t;
-
-TU_VERIFY_STATIC(sizeof(scsi_sense_fixed_resp_t) == 18, "size is not correct");
-
-typedef struct TU_ATTR_PACKED
-{
- uint8_t cmd_code ; ///< SCSI OpCode for \ref SCSI_CMD_MODE_SENSE_6
-
- uint8_t : 3;
- uint8_t disable_block_descriptor : 1;
- uint8_t : 4;
-
- uint8_t page_code : 6;
- uint8_t page_control : 2;
-
- uint8_t subpage_code;
- uint8_t alloc_length;
- uint8_t control;
-} scsi_mode_sense6_t;
-
-TU_VERIFY_STATIC( sizeof(scsi_mode_sense6_t) == 6, "size is not correct");
-
-// This is only a Mode parameter header(6).
-typedef struct TU_ATTR_PACKED
-{
- uint8_t data_len;
- uint8_t medium_type;
-
- uint8_t reserved : 7;
- bool write_protected : 1;
-
- uint8_t block_descriptor_len;
-} scsi_mode_sense6_resp_t;
-
-TU_VERIFY_STATIC( sizeof(scsi_mode_sense6_resp_t) == 4, "size is not correct");
-
-typedef struct TU_ATTR_PACKED
-{
- uint8_t cmd_code; ///< SCSI OpCode for \ref SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL
- uint8_t reserved[3];
- uint8_t prohibit_removal;
- uint8_t control;
-} scsi_prevent_allow_medium_removal_t;
-
-TU_VERIFY_STATIC( sizeof(scsi_prevent_allow_medium_removal_t) == 6, "size is not correct");
-
-typedef struct TU_ATTR_PACKED
-{
- uint8_t cmd_code;
-
- uint8_t immded : 1;
- uint8_t : 7;
-
- uint8_t TU_RESERVED;
-
- uint8_t power_condition_mod : 4;
- uint8_t : 4;
-
- uint8_t start : 1;
- uint8_t load_eject : 1;
- uint8_t no_flush : 1;
- uint8_t : 1;
- uint8_t power_condition : 4;
-
- uint8_t control;
-} scsi_start_stop_unit_t;
-
-TU_VERIFY_STATIC( sizeof(scsi_start_stop_unit_t) == 6, "size is not correct");
-
-//--------------------------------------------------------------------+
-// SCSI MMC
-//--------------------------------------------------------------------+
-/// SCSI Read Format Capacity: Write Capacity
-typedef struct TU_ATTR_PACKED
-{
- uint8_t cmd_code;
- uint8_t reserved[6];
- uint16_t alloc_length;
- uint8_t control;
-} scsi_read_format_capacity_t;
-
-TU_VERIFY_STATIC( sizeof(scsi_read_format_capacity_t) == 10, "size is not correct");
-
-typedef struct TU_ATTR_PACKED{
- uint8_t reserved[3];
- uint8_t list_length; /// must be 8*n, length in bytes of formattable capacity descriptor followed it.
-
- uint32_t block_num; /// Number of Logical Blocks
- uint8_t descriptor_type; // 00: reserved, 01 unformatted media , 10 Formatted media, 11 No media present
-
- uint8_t reserved2;
- uint16_t block_size_u16;
-
-} scsi_read_format_capacity_data_t;
-
-TU_VERIFY_STATIC( sizeof(scsi_read_format_capacity_data_t) == 12, "size is not correct");
-
-//--------------------------------------------------------------------+
-// SCSI Block Command (SBC-3)
-// NOTE: All data in SCSI command are in Big Endian
-//--------------------------------------------------------------------+
-
-/// SCSI Read Capacity 10 Command: Read Capacity
-typedef struct TU_ATTR_PACKED
-{
- uint8_t cmd_code ; ///< SCSI OpCode for \ref SCSI_CMD_READ_CAPACITY_10
- uint8_t reserved1 ;
- uint32_t lba ; ///< The first Logical Block Address (LBA) accessed by this command
- uint16_t reserved2 ;
- uint8_t partial_medium_indicator ;
- uint8_t control ;
-} scsi_read_capacity10_t;
-
-TU_VERIFY_STATIC(sizeof(scsi_read_capacity10_t) == 10, "size is not correct");
-
-/// SCSI Read Capacity 10 Response Data
-typedef struct {
- uint32_t last_lba ; ///< The last Logical Block Address of the device
- uint32_t block_size ; ///< Block size in bytes
-} scsi_read_capacity10_resp_t;
-
-TU_VERIFY_STATIC(sizeof(scsi_read_capacity10_resp_t) == 8, "size is not correct");
-
-/// SCSI Read 10 Command
-typedef struct TU_ATTR_PACKED
-{
- uint8_t cmd_code ; ///< SCSI OpCode
- uint8_t reserved ; // has LUN according to wiki
- uint32_t lba ; ///< The first Logical Block Address (LBA) accessed by this command
- uint8_t reserved2 ;
- uint16_t block_count ; ///< Number of Blocks used by this command
- uint8_t control ;
-} scsi_read10_t, scsi_write10_t;
-
-TU_VERIFY_STATIC(sizeof(scsi_read10_t) == 10, "size is not correct");
-TU_VERIFY_STATIC(sizeof(scsi_write10_t) == 10, "size is not correct");
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_MSC_H_ */
diff --git a/tinyusb/src/class/msc/msc_device.c b/tinyusb/src/class/msc/msc_device.c
deleted file mode 100755
index 014e8b69..00000000
--- a/tinyusb/src/class/msc/msc_device.c
+++ /dev/null
@@ -1,705 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_MSC)
-
-#include "device/usbd.h"
-#include "device/usbd_pvt.h"
-#include "device/dcd.h" // for faking dcd_event_xfer_complete
-
-#include "msc_device.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-// Can be selectively disabled to reduce logging when troubleshooting other driver
-#define MSC_DEBUG 2
-
-enum
-{
- MSC_STAGE_CMD = 0,
- MSC_STAGE_DATA,
- MSC_STAGE_STATUS,
- MSC_STAGE_STATUS_SENT
-};
-
-typedef struct
-{
- // TODO optimize alignment
- CFG_TUSB_MEM_ALIGN msc_cbw_t cbw;
- CFG_TUSB_MEM_ALIGN msc_csw_t csw;
-
- uint8_t itf_num;
- uint8_t ep_in;
- uint8_t ep_out;
-
- // Bulk Only Transfer (BOT) Protocol
- uint8_t stage;
- uint32_t total_len;
- uint32_t xferred_len; // numbered of bytes transferred so far in the Data Stage
-
- // Sense Response Data
- uint8_t sense_key;
- uint8_t add_sense_code;
- uint8_t add_sense_qualifier;
-}mscd_interface_t;
-
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static mscd_interface_t _mscd_itf;
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static uint8_t _mscd_buf[CFG_TUD_MSC_EP_BUFSIZE];
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-static int32_t proc_builtin_scsi(uint8_t lun, uint8_t const scsi_cmd[16], uint8_t* buffer, uint32_t bufsize);
-static void proc_read10_cmd(uint8_t rhport, mscd_interface_t* p_msc);
-static void proc_write10_cmd(uint8_t rhport, mscd_interface_t* p_msc);
-
-static inline uint32_t rdwr10_get_lba(uint8_t const command[])
-{
- // use offsetof to avoid pointer to the odd/unaligned address
- uint32_t const lba = tu_unaligned_read32(command + offsetof(scsi_write10_t, lba));
-
- // lba is in Big Endian
- return tu_ntohl(lba);
-}
-
-static inline uint16_t rdwr10_get_blockcount(uint8_t const command[])
-{
- // use offsetof to avoid pointer to the odd/misaligned address
- uint16_t const block_count = tu_unaligned_read16(command + offsetof(scsi_write10_t, block_count));
-
- // block count is in Big Endian
- return tu_ntohs(block_count);
-}
-
-//--------------------------------------------------------------------+
-// Debug
-//--------------------------------------------------------------------+
-#if CFG_TUSB_DEBUG >= 2
-
-TU_ATTR_UNUSED static tu_lookup_entry_t const _msc_scsi_cmd_lookup[] =
-{
- { .key = SCSI_CMD_TEST_UNIT_READY , .data = "Test Unit Ready" },
- { .key = SCSI_CMD_INQUIRY , .data = "Inquiry" },
- { .key = SCSI_CMD_MODE_SELECT_6 , .data = "Mode_Select 6" },
- { .key = SCSI_CMD_MODE_SENSE_6 , .data = "Mode_Sense 6" },
- { .key = SCSI_CMD_START_STOP_UNIT , .data = "Start Stop Unit" },
- { .key = SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL , .data = "Prevent Allow Medium Removal" },
- { .key = SCSI_CMD_READ_CAPACITY_10 , .data = "Read Capacity10" },
- { .key = SCSI_CMD_REQUEST_SENSE , .data = "Request Sense" },
- { .key = SCSI_CMD_READ_FORMAT_CAPACITY , .data = "Read Format Capacity" },
- { .key = SCSI_CMD_READ_10 , .data = "Read10" },
- { .key = SCSI_CMD_WRITE_10 , .data = "Write10" }
-};
-
-TU_ATTR_UNUSED static tu_lookup_table_t const _msc_scsi_cmd_table =
-{
- .count = TU_ARRAY_SIZE(_msc_scsi_cmd_lookup),
- .items = _msc_scsi_cmd_lookup
-};
-
-#endif
-
-//--------------------------------------------------------------------+
-// APPLICATION API
-//--------------------------------------------------------------------+
-bool tud_msc_set_sense(uint8_t lun, uint8_t sense_key, uint8_t add_sense_code, uint8_t add_sense_qualifier)
-{
- (void) lun;
-
- _mscd_itf.sense_key = sense_key;
- _mscd_itf.add_sense_code = add_sense_code;
- _mscd_itf.add_sense_qualifier = add_sense_qualifier;
-
- return true;
-}
-
-//--------------------------------------------------------------------+
-// USBD Driver API
-//--------------------------------------------------------------------+
-void mscd_init(void)
-{
- tu_memclr(&_mscd_itf, sizeof(mscd_interface_t));
-}
-
-void mscd_reset(uint8_t rhport)
-{
- (void) rhport;
- tu_memclr(&_mscd_itf, sizeof(mscd_interface_t));
-}
-
-uint16_t mscd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len)
-{
- // only support SCSI's BOT protocol
- TU_VERIFY(TUSB_CLASS_MSC == itf_desc->bInterfaceClass &&
- MSC_SUBCLASS_SCSI == itf_desc->bInterfaceSubClass &&
- MSC_PROTOCOL_BOT == itf_desc->bInterfaceProtocol, 0);
-
- // msc driver length is fixed
- uint16_t const drv_len = sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t);
-
- // Max length mus be at least 1 interface + 2 endpoints
- TU_ASSERT(max_len >= drv_len, 0);
-
- mscd_interface_t * p_msc = &_mscd_itf;
- p_msc->itf_num = itf_desc->bInterfaceNumber;
-
- // Open endpoint pair
- TU_ASSERT( usbd_open_edpt_pair(rhport, tu_desc_next(itf_desc), 2, TUSB_XFER_BULK, &p_msc->ep_out, &p_msc->ep_in), 0 );
-
- // Prepare for Command Block Wrapper
- if ( !usbd_edpt_xfer(rhport, p_msc->ep_out, (uint8_t*) &p_msc->cbw, sizeof(msc_cbw_t)) )
- {
- TU_LOG_FAILED();
- TU_BREAKPOINT();
- }
-
- return drv_len;
-}
-
-// Invoked when a control transfer occurred on an interface of this class
-// Driver response accordingly to the request and the transfer stage (setup/data/ack)
-// return false to stall control endpoint (e.g unsupported request)
-bool mscd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * p_request)
-{
- // nothing to do with DATA & ACK stage
- if (stage != CONTROL_STAGE_SETUP) return true;
-
- // Handle class request only
- TU_VERIFY(p_request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS);
-
- switch ( p_request->bRequest )
- {
- case MSC_REQ_RESET:
- // TODO: Actually reset interface.
- tud_control_status(rhport, p_request);
- break;
-
- case MSC_REQ_GET_MAX_LUN:
- {
- uint8_t maxlun = 1;
- if (tud_msc_get_maxlun_cb) maxlun = tud_msc_get_maxlun_cb();
- TU_VERIFY(maxlun);
-
- // MAX LUN is minus 1 by specs
- maxlun--;
-
- tud_control_xfer(rhport, p_request, &maxlun, 1);
- }
- break;
-
- default: return false; // stall unsupported request
- }
-
- return true;
-}
-
-bool mscd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes)
-{
- mscd_interface_t* p_msc = &_mscd_itf;
- msc_cbw_t const * p_cbw = &p_msc->cbw;
- msc_csw_t * p_csw = &p_msc->csw;
-
- switch (p_msc->stage)
- {
- case MSC_STAGE_CMD:
- //------------- new CBW received -------------//
- // Complete IN while waiting for CMD is usually Status of previous SCSI op, ignore it
- if(ep_addr != p_msc->ep_out) return true;
-
- TU_ASSERT( event == XFER_RESULT_SUCCESS &&
- xferred_bytes == sizeof(msc_cbw_t) && p_cbw->signature == MSC_CBW_SIGNATURE );
-
- TU_LOG(MSC_DEBUG, " SCSI Command: %s\r\n", tu_lookup_find(&_msc_scsi_cmd_table, p_cbw->command[0]));
- // TU_LOG_MEM(MSC_DEBUG, p_cbw, xferred_bytes, 2);
-
- p_csw->signature = MSC_CSW_SIGNATURE;
- p_csw->tag = p_cbw->tag;
- p_csw->data_residue = 0;
-
- /*------------- Parse command and prepare DATA -------------*/
- p_msc->stage = MSC_STAGE_DATA;
- p_msc->total_len = p_cbw->total_bytes;
- p_msc->xferred_len = 0;
-
- if (SCSI_CMD_READ_10 == p_cbw->command[0])
- {
- proc_read10_cmd(rhport, p_msc);
- }
- else if (SCSI_CMD_WRITE_10 == p_cbw->command[0])
- {
- proc_write10_cmd(rhport, p_msc);
- }
- else
- {
- // For other SCSI commands
- // 1. OUT : queue transfer (invoke app callback after done)
- // 2. IN & Zero: Process if is built-in, else Invoke app callback. Skip DATA if zero length
- if ( (p_cbw->total_bytes > 0 ) && !tu_bit_test(p_cbw->dir, 7) )
- {
- // queue transfer
- TU_ASSERT( usbd_edpt_xfer(rhport, p_msc->ep_out, _mscd_buf, p_msc->total_len) );
- }else
- {
- int32_t resplen;
-
- // First process if it is a built-in commands
- resplen = proc_builtin_scsi(p_cbw->lun, p_cbw->command, _mscd_buf, sizeof(_mscd_buf));
-
- // Not built-in, invoke user callback
- if ( (resplen < 0) && (p_msc->sense_key == 0) )
- {
- resplen = tud_msc_scsi_cb(p_cbw->lun, p_cbw->command, _mscd_buf, p_msc->total_len);
- }
-
- if ( resplen < 0 )
- {
- p_msc->total_len = 0;
- p_csw->status = MSC_CSW_STATUS_FAILED;
- p_msc->stage = MSC_STAGE_STATUS;
-
- // failed but senskey is not set: default to Illegal Request
- if ( p_msc->sense_key == 0 ) tud_msc_set_sense(p_cbw->lun, SCSI_SENSE_ILLEGAL_REQUEST, 0x20, 0x00);
-
- // Stall bulk In if needed
- if (p_cbw->total_bytes) usbd_edpt_stall(rhport, p_msc->ep_in);
- }
- else
- {
- p_msc->total_len = (uint32_t) resplen;
- p_csw->status = MSC_CSW_STATUS_PASSED;
-
- if (p_msc->total_len)
- {
- TU_ASSERT( p_cbw->total_bytes >= p_msc->total_len ); // cannot return more than host expect
- TU_ASSERT( usbd_edpt_xfer(rhport, p_msc->ep_in, _mscd_buf, p_msc->total_len) );
- }else
- {
- p_msc->stage = MSC_STAGE_STATUS;
- }
- }
- }
- }
- break;
-
- case MSC_STAGE_DATA:
- TU_LOG(MSC_DEBUG, " SCSI Data\r\n");
- //TU_LOG_MEM(MSC_DEBUG, _mscd_buf, xferred_bytes, 2);
-
- // OUT transfer, invoke callback if needed
- if ( !tu_bit_test(p_cbw->dir, 7) )
- {
- if ( SCSI_CMD_WRITE_10 != p_cbw->command[0] )
- {
- int32_t cb_result = tud_msc_scsi_cb(p_cbw->lun, p_cbw->command, _mscd_buf, p_msc->total_len);
-
- if ( cb_result < 0 )
- {
- p_csw->status = MSC_CSW_STATUS_FAILED;
- tud_msc_set_sense(p_cbw->lun, SCSI_SENSE_ILLEGAL_REQUEST, 0x20, 0x00); // Sense = Invalid Command Operation
- }else
- {
- p_csw->status = MSC_CSW_STATUS_PASSED;
- }
- }
- else
- {
- uint16_t const block_sz = p_cbw->total_bytes / rdwr10_get_blockcount(p_cbw->command);
-
- // Adjust lba with transferred bytes
- uint32_t const lba = rdwr10_get_lba(p_cbw->command) + (p_msc->xferred_len / block_sz);
-
- // Application can consume smaller bytes
- int32_t nbytes = tud_msc_write10_cb(p_cbw->lun, lba, p_msc->xferred_len % block_sz, _mscd_buf, xferred_bytes);
-
- if ( nbytes < 0 )
- {
- // negative means error -> skip to status phase, status in CSW set to failed
- p_csw->data_residue = p_cbw->total_bytes - p_msc->xferred_len;
- p_csw->status = MSC_CSW_STATUS_FAILED;
- p_msc->stage = MSC_STAGE_STATUS;
-
- tud_msc_set_sense(p_cbw->lun, SCSI_SENSE_ILLEGAL_REQUEST, 0x20, 0x00); // Sense = Invalid Command Operation
- break;
- }else
- {
- // Application consume less than what we got (including zero)
- if ( nbytes < (int32_t) xferred_bytes )
- {
- if ( nbytes > 0 )
- {
- p_msc->xferred_len += nbytes;
- memmove(_mscd_buf, _mscd_buf+nbytes, xferred_bytes-nbytes);
- }
-
- // simulate an transfer complete with adjusted parameters --> this driver callback will fired again
- dcd_event_xfer_complete(rhport, p_msc->ep_out, xferred_bytes-nbytes, XFER_RESULT_SUCCESS, false);
-
- return true; // skip the rest
- }
- else
- {
- // Application consume all bytes in our buffer. Nothing to do, process with normal flow
- }
- }
- }
- }
-
- // Accumulate data so far
- p_msc->xferred_len += xferred_bytes;
-
- if ( p_msc->xferred_len >= p_msc->total_len )
- {
- // Data Stage is complete
- p_msc->stage = MSC_STAGE_STATUS;
- }
- else
- {
- // READ10 & WRITE10 Can be executed with large bulk of data e.g write 8K bytes (several flash write)
- // We break it into multiple smaller command whose data size is up to CFG_TUD_MSC_EP_BUFSIZE
- if (SCSI_CMD_READ_10 == p_cbw->command[0])
- {
- proc_read10_cmd(rhport, p_msc);
- }
- else if (SCSI_CMD_WRITE_10 == p_cbw->command[0])
- {
- proc_write10_cmd(rhport, p_msc);
- }else
- {
- // No other command take more than one transfer yet -> unlikely error
- TU_BREAKPOINT();
- }
- }
- break;
-
- case MSC_STAGE_STATUS:
- // processed immediately after this switch, supposedly to be empty
- break;
-
- case MSC_STAGE_STATUS_SENT:
- // Wait for the Status phase to complete
- if( (ep_addr == p_msc->ep_in) && (xferred_bytes == sizeof(msc_csw_t)) )
- {
- TU_LOG(MSC_DEBUG, " SCSI Status: %u\r\n", p_csw->status);
- // TU_LOG_MEM(MSC_DEBUG, p_csw, xferred_bytes, 2);
-
- // Invoke complete callback if defined
- // Note: There is racing issue with samd51 + qspi flash testing with arduino
- // if complete_cb() is invoked after queuing the status.
- switch(p_cbw->command[0])
- {
- case SCSI_CMD_READ_10:
- if ( tud_msc_read10_complete_cb ) tud_msc_read10_complete_cb(p_cbw->lun);
- break;
-
- case SCSI_CMD_WRITE_10:
- if ( tud_msc_write10_complete_cb ) tud_msc_write10_complete_cb(p_cbw->lun);
- break;
-
- default:
- if ( tud_msc_scsi_complete_cb ) tud_msc_scsi_complete_cb(p_cbw->lun, p_cbw->command);
- break;
- }
-
- // Move to default CMD stage
- p_msc->stage = MSC_STAGE_CMD;
-
- // Queue for the next CBW
- TU_ASSERT( usbd_edpt_xfer(rhport, p_msc->ep_out, (uint8_t*) &p_msc->cbw, sizeof(msc_cbw_t)) );
- }
- break;
-
- default : break;
- }
-
- if ( p_msc->stage == MSC_STAGE_STATUS )
- {
- // Either endpoints is stalled, need to wait until it is cleared by host
- if ( usbd_edpt_stalled(rhport, p_msc->ep_in) || usbd_edpt_stalled(rhport, p_msc->ep_out) )
- {
- // simulate an transfer complete with adjusted parameters --> this driver callback will fired again
- // and response with status phase after halted endpoints are cleared.
- // note: use ep_out to prevent confusing with STATUS complete
- dcd_event_xfer_complete(rhport, p_msc->ep_out, 0, XFER_RESULT_SUCCESS, false);
- }
- else
- {
- // Move to Status Sent stage
- p_msc->stage = MSC_STAGE_STATUS_SENT;
-
- // Send SCSI Status
- TU_ASSERT(usbd_edpt_xfer(rhport, p_msc->ep_in , (uint8_t*) &p_msc->csw, sizeof(msc_csw_t)));
- }
- }
-
- return true;
-}
-
-/*------------------------------------------------------------------*/
-/* SCSI Command Process
- *------------------------------------------------------------------*/
-
-// return response's length (copied to buffer). Negative if it is not an built-in command or indicate Failed status (CSW)
-// In case of a failed status, sense key must be set for reason of failure
-static int32_t proc_builtin_scsi(uint8_t lun, uint8_t const scsi_cmd[16], uint8_t* buffer, uint32_t bufsize)
-{
- (void) bufsize; // TODO refractor later
- int32_t resplen;
-
- switch ( scsi_cmd[0] )
- {
- case SCSI_CMD_TEST_UNIT_READY:
- resplen = 0;
- if ( !tud_msc_test_unit_ready_cb(lun) )
- {
- // Failed status response
- resplen = - 1;
-
- // If sense key is not set by callback, default to Logical Unit Not Ready, Cause Not Reportable
- if ( _mscd_itf.sense_key == 0 ) tud_msc_set_sense(lun, SCSI_SENSE_NOT_READY, 0x04, 0x00);
- }
- break;
-
- case SCSI_CMD_START_STOP_UNIT:
- resplen = 0;
-
- if (tud_msc_start_stop_cb)
- {
- scsi_start_stop_unit_t const * start_stop = (scsi_start_stop_unit_t const *) scsi_cmd;
- if ( !tud_msc_start_stop_cb(lun, start_stop->power_condition, start_stop->start, start_stop->load_eject) )
- {
- // Failed status response
- resplen = - 1;
-
- // If sense key is not set by callback, default to Logical Unit Not Ready, Cause Not Reportable
- if ( _mscd_itf.sense_key == 0 ) tud_msc_set_sense(lun, SCSI_SENSE_NOT_READY, 0x04, 0x00);
- }
- }
- break;
-
- case SCSI_CMD_READ_CAPACITY_10:
- {
- uint32_t block_count;
- uint32_t block_size;
- uint16_t block_size_u16;
-
- tud_msc_capacity_cb(lun, &block_count, &block_size_u16);
- block_size = (uint32_t) block_size_u16;
-
- // Invalid block size/count from callback, possibly unit is not ready
- // stall this request, set sense key to NOT READY
- if (block_count == 0 || block_size == 0)
- {
- resplen = -1;
-
- // If sense key is not set by callback, default to Logical Unit Not Ready, Cause Not Reportable
- if ( _mscd_itf.sense_key == 0 ) tud_msc_set_sense(lun, SCSI_SENSE_NOT_READY, 0x04, 0x00);
- }else
- {
- scsi_read_capacity10_resp_t read_capa10;
-
- read_capa10.last_lba = tu_htonl(block_count-1);
- read_capa10.block_size = tu_htonl(block_size);
-
- resplen = sizeof(read_capa10);
- memcpy(buffer, &read_capa10, resplen);
- }
- }
- break;
-
- case SCSI_CMD_READ_FORMAT_CAPACITY:
- {
- scsi_read_format_capacity_data_t read_fmt_capa =
- {
- .list_length = 8,
- .block_num = 0,
- .descriptor_type = 2, // formatted media
- .block_size_u16 = 0
- };
-
- uint32_t block_count;
- uint16_t block_size;
-
- tud_msc_capacity_cb(lun, &block_count, &block_size);
-
- // Invalid block size/count from callback, possibly unit is not ready
- // stall this request, set sense key to NOT READY
- if (block_count == 0 || block_size == 0)
- {
- resplen = -1;
-
- // If sense key is not set by callback, default to Logical Unit Not Ready, Cause Not Reportable
- if ( _mscd_itf.sense_key == 0 ) tud_msc_set_sense(lun, SCSI_SENSE_NOT_READY, 0x04, 0x00);
- }else
- {
- read_fmt_capa.block_num = tu_htonl(block_count);
- read_fmt_capa.block_size_u16 = tu_htons(block_size);
-
- resplen = sizeof(read_fmt_capa);
- memcpy(buffer, &read_fmt_capa, resplen);
- }
- }
- break;
-
- case SCSI_CMD_INQUIRY:
- {
- scsi_inquiry_resp_t inquiry_rsp =
- {
- .is_removable = 1,
- .version = 2,
- .response_data_format = 2,
- };
-
- // vendor_id, product_id, product_rev is space padded string
- memset(inquiry_rsp.vendor_id , ' ', sizeof(inquiry_rsp.vendor_id));
- memset(inquiry_rsp.product_id , ' ', sizeof(inquiry_rsp.product_id));
- memset(inquiry_rsp.product_rev, ' ', sizeof(inquiry_rsp.product_rev));
-
- tud_msc_inquiry_cb(lun, inquiry_rsp.vendor_id, inquiry_rsp.product_id, inquiry_rsp.product_rev);
-
- resplen = sizeof(inquiry_rsp);
- memcpy(buffer, &inquiry_rsp, resplen);
- }
- break;
-
- case SCSI_CMD_MODE_SENSE_6:
- {
- scsi_mode_sense6_resp_t mode_resp =
- {
- .data_len = 3,
- .medium_type = 0,
- .write_protected = false,
- .reserved = 0,
- .block_descriptor_len = 0 // no block descriptor are included
- };
-
- bool writable = true;
- if (tud_msc_is_writable_cb) {
- writable = tud_msc_is_writable_cb(lun);
- }
- mode_resp.write_protected = !writable;
-
- resplen = sizeof(mode_resp);
- memcpy(buffer, &mode_resp, resplen);
- }
- break;
-
- case SCSI_CMD_REQUEST_SENSE:
- {
- scsi_sense_fixed_resp_t sense_rsp =
- {
- .response_code = 0x70,
- .valid = 1
- };
-
- sense_rsp.add_sense_len = sizeof(scsi_sense_fixed_resp_t) - 8;
-
- sense_rsp.sense_key = _mscd_itf.sense_key;
- sense_rsp.add_sense_code = _mscd_itf.add_sense_code;
- sense_rsp.add_sense_qualifier = _mscd_itf.add_sense_qualifier;
-
- resplen = sizeof(sense_rsp);
- memcpy(buffer, &sense_rsp, resplen);
-
- // Clear sense data after copy
- tud_msc_set_sense(lun, 0, 0, 0);
- }
- break;
-
- default: resplen = -1; break;
- }
-
- return resplen;
-}
-
-static void proc_read10_cmd(uint8_t rhport, mscd_interface_t* p_msc)
-{
- msc_cbw_t const * p_cbw = &p_msc->cbw;
- msc_csw_t * p_csw = &p_msc->csw;
-
- uint16_t const block_cnt = rdwr10_get_blockcount(p_cbw->command);
- TU_ASSERT(block_cnt, ); // prevent div by zero
-
- uint16_t const block_sz = p_cbw->total_bytes / block_cnt;
- TU_ASSERT(block_sz, ); // prevent div by zero
-
- // Adjust lba with transferred bytes
- uint32_t const lba = rdwr10_get_lba(p_cbw->command) + (p_msc->xferred_len / block_sz);
-
- // remaining bytes capped at class buffer
- int32_t nbytes = (int32_t) tu_min32(sizeof(_mscd_buf), p_cbw->total_bytes-p_msc->xferred_len);
-
- // Application can consume smaller bytes
- nbytes = tud_msc_read10_cb(p_cbw->lun, lba, p_msc->xferred_len % block_sz, _mscd_buf, (uint32_t) nbytes);
-
- if ( nbytes < 0 )
- {
- // negative means error -> pipe is stalled & status in CSW set to failed
- p_csw->data_residue = p_cbw->total_bytes - p_msc->xferred_len;
- p_csw->status = MSC_CSW_STATUS_FAILED;
-
- tud_msc_set_sense(p_cbw->lun, SCSI_SENSE_ILLEGAL_REQUEST, 0x20, 0x00); // Sense = Invalid Command Operation
- usbd_edpt_stall(rhport, p_msc->ep_in);
- }
- else if ( nbytes == 0 )
- {
- // zero means not ready -> simulate an transfer complete so that this driver callback will fired again
- dcd_event_xfer_complete(rhport, p_msc->ep_in, 0, XFER_RESULT_SUCCESS, false);
- }
- else
- {
- TU_ASSERT( usbd_edpt_xfer(rhport, p_msc->ep_in, _mscd_buf, nbytes), );
- }
-}
-
-static void proc_write10_cmd(uint8_t rhport, mscd_interface_t* p_msc)
-{
- msc_cbw_t const * p_cbw = &p_msc->cbw;
- bool writable = true;
- if (tud_msc_is_writable_cb) {
- writable = tud_msc_is_writable_cb(p_cbw->lun);
- }
- if (!writable) {
- msc_csw_t* p_csw = &p_msc->csw;
- p_csw->data_residue = p_cbw->total_bytes;
- p_csw->status = MSC_CSW_STATUS_FAILED;
-
- tud_msc_set_sense(p_cbw->lun, SCSI_SENSE_DATA_PROTECT, 0x27, 0x00); // Sense = Write protected
- usbd_edpt_stall(rhport, p_msc->ep_out);
- return;
- }
-
- // remaining bytes capped at class buffer
- int32_t nbytes = (int32_t) tu_min32(sizeof(_mscd_buf), p_cbw->total_bytes-p_msc->xferred_len);
-
- // Write10 callback will be called later when usb transfer complete
- TU_ASSERT( usbd_edpt_xfer(rhport, p_msc->ep_out, _mscd_buf, nbytes), );
-}
-
-#endif
diff --git a/tinyusb/src/class/msc/msc_device.h b/tinyusb/src/class/msc/msc_device.h
deleted file mode 100755
index 8f90ef4a..00000000
--- a/tinyusb/src/class/msc/msc_device.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_MSC_DEVICE_H_
-#define _TUSB_MSC_DEVICE_H_
-
-#include "common/tusb_common.h"
-#include "msc.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Class Driver Configuration
-//--------------------------------------------------------------------+
-
-#if !defined(CFG_TUD_MSC_EP_BUFSIZE) & defined(CFG_TUD_MSC_BUFSIZE)
- // TODO warn user to use new name later on
- // #warning CFG_TUD_MSC_BUFSIZE is renamed to CFG_TUD_MSC_EP_BUFSIZE, please update to use the new name
- #define CFG_TUD_MSC_EP_BUFSIZE CFG_TUD_MSC_BUFSIZE
-#endif
-
-#ifndef CFG_TUD_MSC_EP_BUFSIZE
- #error CFG_TUD_MSC_EP_BUFSIZE must be defined, value of a block size should work well, the more the better
-#endif
-
-TU_VERIFY_STATIC(CFG_TUD_MSC_EP_BUFSIZE < UINT16_MAX, "Size is not correct");
-
-//--------------------------------------------------------------------+
-// Application API
-//--------------------------------------------------------------------+
-
-// Set SCSI sense response
-bool tud_msc_set_sense(uint8_t lun, uint8_t sense_key, uint8_t add_sense_code, uint8_t add_sense_qualifier);
-
-//--------------------------------------------------------------------+
-// Application Callbacks (WEAK is optional)
-//--------------------------------------------------------------------+
-
-// Invoked when received SCSI READ10 command
-// - Address = lba * BLOCK_SIZE + offset
-// - offset is only needed if CFG_TUD_MSC_EP_BUFSIZE is smaller than BLOCK_SIZE.
-//
-// - Application fill the buffer (up to bufsize) with address contents and return number of read byte. If
-// - read < bufsize : These bytes are transferred first and callback invoked again for remaining data.
-//
-// - read == 0 : Indicate application is not ready yet e.g disk I/O busy.
-// Callback invoked again with the same parameters later on.
-//
-// - read < 0 : Indicate application error e.g invalid address. This request will be STALLed
-// and return failed status in command status wrapper phase.
-int32_t tud_msc_read10_cb (uint8_t lun, uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize);
-
-// Invoked when received SCSI WRITE10 command
-// - Address = lba * BLOCK_SIZE + offset
-// - offset is only needed if CFG_TUD_MSC_EP_BUFSIZE is smaller than BLOCK_SIZE.
-//
-// - Application write data from buffer to address contents (up to bufsize) and return number of written byte. If
-// - write < bufsize : callback invoked again with remaining data later on.
-//
-// - write == 0 : Indicate application is not ready yet e.g disk I/O busy.
-// Callback invoked again with the same parameters later on.
-//
-// - write < 0 : Indicate application error e.g invalid address. This request will be STALLed
-// and return failed status in command status wrapper phase.
-//
-// TODO change buffer to const uint8_t*
-int32_t tud_msc_write10_cb (uint8_t lun, uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize);
-
-// Invoked when received SCSI_CMD_INQUIRY
-// Application fill vendor id, product id and revision with string up to 8, 16, 4 characters respectively
-void tud_msc_inquiry_cb(uint8_t lun, uint8_t vendor_id[8], uint8_t product_id[16], uint8_t product_rev[4]);
-
-// Invoked when received Test Unit Ready command.
-// return true allowing host to read/write this LUN e.g SD card inserted
-bool tud_msc_test_unit_ready_cb(uint8_t lun);
-
-// Invoked when received SCSI_CMD_READ_CAPACITY_10 and SCSI_CMD_READ_FORMAT_CAPACITY to determine the disk size
-// Application update block count and block size
-void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_size);
-
-/**
- * Invoked when received an SCSI command not in built-in list below.
- * - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, TEST_UNIT_READY, START_STOP_UNIT, MODE_SENSE6, REQUEST_SENSE
- * - READ10 and WRITE10 has their own callbacks
- *
- * \param[in] lun Logical unit number
- * \param[in] scsi_cmd SCSI command contents which application must examine to response accordingly
- * \param[out] buffer Buffer for SCSI Data Stage.
- * - For INPUT: application must fill this with response.
- * - For OUTPUT it holds the Data from host
- * \param[in] bufsize Buffer's length.
- *
- * \return Actual bytes processed, can be zero for no-data command.
- * \retval negative Indicate error e.g unsupported command, tinyusb will \b STALL the corresponding
- * endpoint and return failed status in command status wrapper phase.
- */
-int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize);
-
-/*------------- Optional callbacks -------------*/
-
-// Invoked when received GET_MAX_LUN request, required for multiple LUNs implementation
-TU_ATTR_WEAK uint8_t tud_msc_get_maxlun_cb(void);
-
-// Invoked when received Start Stop Unit command
-// - Start = 0 : stopped power mode, if load_eject = 1 : unload disk storage
-// - Start = 1 : active mode, if load_eject = 1 : load disk storage
-TU_ATTR_WEAK bool tud_msc_start_stop_cb(uint8_t lun, uint8_t power_condition, bool start, bool load_eject);
-
-// Invoked when Read10 command is complete
-TU_ATTR_WEAK void tud_msc_read10_complete_cb(uint8_t lun);
-
-// Invoke when Write10 command is complete, can be used to flush flash caching
-TU_ATTR_WEAK void tud_msc_write10_complete_cb(uint8_t lun);
-
-// Invoked when command in tud_msc_scsi_cb is complete
-TU_ATTR_WEAK void tud_msc_scsi_complete_cb(uint8_t lun, uint8_t const scsi_cmd[16]);
-
-// Hook to make a mass storage device read-only. TODO remove
-TU_ATTR_WEAK bool tud_msc_is_writable_cb(uint8_t lun);
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-void mscd_init (void);
-void mscd_reset (uint8_t rhport);
-uint16_t mscd_open (uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
-bool mscd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const * p_request);
-bool mscd_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_MSC_DEVICE_H_ */
diff --git a/tinyusb/src/class/msc/msc_host.c b/tinyusb/src/class/msc/msc_host.c
deleted file mode 100755
index 8069353c..00000000
--- a/tinyusb/src/class/msc/msc_host.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_HOST_ENABLED & CFG_TUH_MSC
-
-#include "host/usbh.h"
-#include "host/usbh_classdriver.h"
-
-#include "msc_host.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-enum
-{
- MSC_STAGE_IDLE = 0,
- MSC_STAGE_CMD,
- MSC_STAGE_DATA,
- MSC_STAGE_STATUS,
-};
-
-typedef struct
-{
- uint8_t itf_num;
- uint8_t ep_in;
- uint8_t ep_out;
-
- uint8_t max_lun;
-
- volatile bool configured; // Receive SET_CONFIGURE
- volatile bool mounted; // Enumeration is complete
-
- struct {
- uint32_t block_size;
- uint32_t block_count;
- } capacity[CFG_TUH_MSC_MAXLUN];
-
- //------------- SCSI -------------//
- uint8_t stage;
- void* buffer;
- tuh_msc_complete_cb_t complete_cb;
-
- msc_cbw_t cbw;
- msc_csw_t csw;
-}msch_interface_t;
-
-CFG_TUSB_MEM_SECTION static msch_interface_t _msch_itf[CFG_TUH_DEVICE_MAX];
-
-// buffer used to read scsi information when mounted
-// largest response data currently is inquiry TODO Inquiry is not part of enum anymore
-CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(4)
-static uint8_t _msch_buffer[sizeof(scsi_inquiry_resp_t)];
-
-TU_ATTR_ALWAYS_INLINE
-static inline msch_interface_t* get_itf(uint8_t dev_addr)
-{
- return &_msch_itf[dev_addr-1];
-}
-
-//--------------------------------------------------------------------+
-// PUBLIC API
-//--------------------------------------------------------------------+
-uint8_t tuh_msc_get_maxlun(uint8_t dev_addr)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- return p_msc->max_lun;
-}
-
-uint32_t tuh_msc_get_block_count(uint8_t dev_addr, uint8_t lun)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- return p_msc->capacity[lun].block_count;
-}
-
-uint32_t tuh_msc_get_block_size(uint8_t dev_addr, uint8_t lun)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- return p_msc->capacity[lun].block_size;
-}
-
-bool tuh_msc_mounted(uint8_t dev_addr)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- return p_msc->mounted;
-}
-
-bool tuh_msc_ready(uint8_t dev_addr)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- return p_msc->mounted && !usbh_edpt_busy(dev_addr, p_msc->ep_in);
-}
-
-//--------------------------------------------------------------------+
-// PUBLIC API: SCSI COMMAND
-//--------------------------------------------------------------------+
-static inline void cbw_init(msc_cbw_t *cbw, uint8_t lun)
-{
- tu_memclr(cbw, sizeof(msc_cbw_t));
- cbw->signature = MSC_CBW_SIGNATURE;
- cbw->tag = 0x54555342; // TUSB
- cbw->lun = lun;
-}
-
-bool tuh_msc_scsi_command(uint8_t dev_addr, msc_cbw_t const* cbw, void* data, tuh_msc_complete_cb_t complete_cb)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- TU_VERIFY(p_msc->configured);
-
- // TODO claim endpoint
-
- p_msc->cbw = *cbw;
- p_msc->stage = MSC_STAGE_CMD;
- p_msc->buffer = data;
- p_msc->complete_cb = complete_cb;
-
- TU_ASSERT(usbh_edpt_xfer(dev_addr, p_msc->ep_out, (uint8_t*) &p_msc->cbw, sizeof(msc_cbw_t)));
-
- return true;
-}
-
-bool tuh_msc_read_capacity(uint8_t dev_addr, uint8_t lun, scsi_read_capacity10_resp_t* response, tuh_msc_complete_cb_t complete_cb)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- TU_VERIFY(p_msc->configured);
-
- msc_cbw_t cbw;
- cbw_init(&cbw, lun);
-
- cbw.total_bytes = sizeof(scsi_read_capacity10_resp_t);
- cbw.dir = TUSB_DIR_IN_MASK;
- cbw.cmd_len = sizeof(scsi_read_capacity10_t);
- cbw.command[0] = SCSI_CMD_READ_CAPACITY_10;
-
- return tuh_msc_scsi_command(dev_addr, &cbw, response, complete_cb);
-}
-
-bool tuh_msc_inquiry(uint8_t dev_addr, uint8_t lun, scsi_inquiry_resp_t* response, tuh_msc_complete_cb_t complete_cb)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- TU_VERIFY(p_msc->mounted);
-
- msc_cbw_t cbw;
- cbw_init(&cbw, lun);
-
- cbw.total_bytes = sizeof(scsi_inquiry_resp_t);
- cbw.dir = TUSB_DIR_IN_MASK;
- cbw.cmd_len = sizeof(scsi_inquiry_t);
-
- scsi_inquiry_t const cmd_inquiry =
- {
- .cmd_code = SCSI_CMD_INQUIRY,
- .alloc_length = sizeof(scsi_inquiry_resp_t)
- };
- memcpy(cbw.command, &cmd_inquiry, cbw.cmd_len);
-
- return tuh_msc_scsi_command(dev_addr, &cbw, response, complete_cb);
-}
-
-bool tuh_msc_test_unit_ready(uint8_t dev_addr, uint8_t lun, tuh_msc_complete_cb_t complete_cb)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- TU_VERIFY(p_msc->configured);
-
- msc_cbw_t cbw;
- cbw_init(&cbw, lun);
-
- cbw.total_bytes = 0;
- cbw.dir = TUSB_DIR_OUT;
- cbw.cmd_len = sizeof(scsi_test_unit_ready_t);
- cbw.command[0] = SCSI_CMD_TEST_UNIT_READY;
- cbw.command[1] = lun; // according to wiki TODO need verification
-
- return tuh_msc_scsi_command(dev_addr, &cbw, NULL, complete_cb);
-}
-
-bool tuh_msc_request_sense(uint8_t dev_addr, uint8_t lun, void *resposne, tuh_msc_complete_cb_t complete_cb)
-{
- msc_cbw_t cbw;
- cbw_init(&cbw, lun);
-
- cbw.total_bytes = 18; // TODO sense response
- cbw.dir = TUSB_DIR_IN_MASK;
- cbw.cmd_len = sizeof(scsi_request_sense_t);
-
- scsi_request_sense_t const cmd_request_sense =
- {
- .cmd_code = SCSI_CMD_REQUEST_SENSE,
- .alloc_length = 18
- };
-
- memcpy(cbw.command, &cmd_request_sense, cbw.cmd_len);
-
- return tuh_msc_scsi_command(dev_addr, &cbw, resposne, complete_cb);
-}
-
-bool tuh_msc_read10(uint8_t dev_addr, uint8_t lun, void * buffer, uint32_t lba, uint16_t block_count, tuh_msc_complete_cb_t complete_cb)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- TU_VERIFY(p_msc->mounted);
-
- msc_cbw_t cbw;
- cbw_init(&cbw, lun);
-
- cbw.total_bytes = block_count*p_msc->capacity[lun].block_size;
- cbw.dir = TUSB_DIR_IN_MASK;
- cbw.cmd_len = sizeof(scsi_read10_t);
-
- scsi_read10_t const cmd_read10 =
- {
- .cmd_code = SCSI_CMD_READ_10,
- .lba = tu_htonl(lba),
- .block_count = tu_htons(block_count)
- };
-
- memcpy(cbw.command, &cmd_read10, cbw.cmd_len);
-
- return tuh_msc_scsi_command(dev_addr, &cbw, buffer, complete_cb);
-}
-
-bool tuh_msc_write10(uint8_t dev_addr, uint8_t lun, void const * buffer, uint32_t lba, uint16_t block_count, tuh_msc_complete_cb_t complete_cb)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- TU_VERIFY(p_msc->mounted);
-
- msc_cbw_t cbw;
- cbw_init(&cbw, lun);
-
- cbw.total_bytes = block_count*p_msc->capacity[lun].block_size;
- cbw.dir = TUSB_DIR_OUT;
- cbw.cmd_len = sizeof(scsi_write10_t);
-
- scsi_write10_t const cmd_write10 =
- {
- .cmd_code = SCSI_CMD_WRITE_10,
- .lba = tu_htonl(lba),
- .block_count = tu_htons(block_count)
- };
-
- memcpy(cbw.command, &cmd_write10, cbw.cmd_len);
-
- return tuh_msc_scsi_command(dev_addr, &cbw, (void*) buffer, complete_cb);
-}
-
-#if 0
-// MSC interface Reset (not used now)
-bool tuh_msc_reset(uint8_t dev_addr)
-{
- tusb_control_request_t const new_request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_INTERFACE,
- .type = TUSB_REQ_TYPE_CLASS,
- .direction = TUSB_DIR_OUT
- },
- .bRequest = MSC_REQ_RESET,
- .wValue = 0,
- .wIndex = p_msc->itf_num,
- .wLength = 0
- };
- TU_ASSERT( usbh_control_xfer( dev_addr, &new_request, NULL ) );
-}
-#endif
-
-//--------------------------------------------------------------------+
-// CLASS-USBH API
-//--------------------------------------------------------------------+
-void msch_init(void)
-{
- tu_memclr(_msch_itf, sizeof(_msch_itf));
-}
-
-void msch_close(uint8_t dev_addr)
-{
- TU_VERIFY(dev_addr <= CFG_TUH_DEVICE_MAX, );
-
- msch_interface_t* p_msc = get_itf(dev_addr);
-
- // invoke Application Callback
- if (p_msc->mounted && tuh_msc_umount_cb) tuh_msc_umount_cb(dev_addr);
-
- tu_memclr(p_msc, sizeof(msch_interface_t));
-}
-
-bool msch_xfer_cb(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- msc_cbw_t const * cbw = &p_msc->cbw;
- msc_csw_t * csw = &p_msc->csw;
-
- switch (p_msc->stage)
- {
- case MSC_STAGE_CMD:
- // Must be Command Block
- TU_ASSERT(ep_addr == p_msc->ep_out && event == XFER_RESULT_SUCCESS && xferred_bytes == sizeof(msc_cbw_t));
-
- if ( cbw->total_bytes && p_msc->buffer )
- {
- // Data stage if any
- p_msc->stage = MSC_STAGE_DATA;
-
- uint8_t const ep_data = (cbw->dir & TUSB_DIR_IN_MASK) ? p_msc->ep_in : p_msc->ep_out;
- TU_ASSERT(usbh_edpt_xfer(dev_addr, ep_data, p_msc->buffer, cbw->total_bytes));
- }else
- {
- // Status stage
- p_msc->stage = MSC_STAGE_STATUS;
- TU_ASSERT(usbh_edpt_xfer(dev_addr, p_msc->ep_in, (uint8_t*) &p_msc->csw, sizeof(msc_csw_t)));
- }
- break;
-
- case MSC_STAGE_DATA:
- // Status stage
- p_msc->stage = MSC_STAGE_STATUS;
- TU_ASSERT(usbh_edpt_xfer(dev_addr, p_msc->ep_in, (uint8_t*) &p_msc->csw, sizeof(msc_csw_t)));
- break;
-
- case MSC_STAGE_STATUS:
- // SCSI op is complete
- p_msc->stage = MSC_STAGE_IDLE;
-
- if (p_msc->complete_cb) p_msc->complete_cb(dev_addr, cbw, csw);
- break;
-
- // unknown state
- default: break;
- }
-
- return true;
-}
-
-//--------------------------------------------------------------------+
-// MSC Enumeration
-//--------------------------------------------------------------------+
-
-static bool config_get_maxlun_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-static bool config_test_unit_ready_complete(uint8_t dev_addr, msc_cbw_t const* cbw, msc_csw_t const* csw);
-static bool config_request_sense_complete(uint8_t dev_addr, msc_cbw_t const* cbw, msc_csw_t const* csw);
-static bool config_read_capacity_complete(uint8_t dev_addr, msc_cbw_t const* cbw, msc_csw_t const* csw);
-
-bool msch_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *desc_itf, uint16_t max_len)
-{
- TU_VERIFY (MSC_SUBCLASS_SCSI == desc_itf->bInterfaceSubClass &&
- MSC_PROTOCOL_BOT == desc_itf->bInterfaceProtocol);
-
- // msc driver length is fixed
- uint16_t const drv_len = sizeof(tusb_desc_interface_t) + desc_itf->bNumEndpoints*sizeof(tusb_desc_endpoint_t);
- TU_ASSERT(drv_len <= max_len);
-
- msch_interface_t* p_msc = get_itf(dev_addr);
- tusb_desc_endpoint_t const * ep_desc = (tusb_desc_endpoint_t const *) tu_desc_next(desc_itf);
-
- for(uint32_t i=0; i<2; i++)
- {
- TU_ASSERT(TUSB_DESC_ENDPOINT == ep_desc->bDescriptorType && TUSB_XFER_BULK == ep_desc->bmAttributes.xfer);
- TU_ASSERT(usbh_edpt_open(rhport, dev_addr, ep_desc));
-
- if ( tu_edpt_dir(ep_desc->bEndpointAddress) == TUSB_DIR_IN )
- {
- p_msc->ep_in = ep_desc->bEndpointAddress;
- }else
- {
- p_msc->ep_out = ep_desc->bEndpointAddress;
- }
-
- ep_desc = (tusb_desc_endpoint_t const *) tu_desc_next(ep_desc);
- }
-
- p_msc->itf_num = desc_itf->bInterfaceNumber;
-
- return true;
-}
-
-bool msch_set_config(uint8_t dev_addr, uint8_t itf_num)
-{
- msch_interface_t* p_msc = get_itf(dev_addr);
- TU_ASSERT(p_msc->itf_num == itf_num);
-
- p_msc->configured = true;
-
- //------------- Get Max Lun -------------//
- TU_LOG2("MSC Get Max Lun\r\n");
- tusb_control_request_t request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_INTERFACE,
- .type = TUSB_REQ_TYPE_CLASS,
- .direction = TUSB_DIR_IN
- },
- .bRequest = MSC_REQ_GET_MAX_LUN,
- .wValue = 0,
- .wIndex = itf_num,
- .wLength = 1
- };
- TU_ASSERT(tuh_control_xfer(dev_addr, &request, &p_msc->max_lun, config_get_maxlun_complete));
-
- return true;
-}
-
-static bool config_get_maxlun_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- (void) request;
-
- msch_interface_t* p_msc = get_itf(dev_addr);
-
- // STALL means zero
- p_msc->max_lun = (XFER_RESULT_SUCCESS == result) ? _msch_buffer[0] : 0;
- p_msc->max_lun++; // MAX LUN is minus 1 by specs
-
- // TODO multiple LUN support
- TU_LOG2("SCSI Test Unit Ready\r\n");
- uint8_t const lun = 0;
- tuh_msc_test_unit_ready(dev_addr, lun, config_test_unit_ready_complete);
-
- return true;
-}
-
-static bool config_test_unit_ready_complete(uint8_t dev_addr, msc_cbw_t const* cbw, msc_csw_t const* csw)
-{
- if (csw->status == 0)
- {
- // Unit is ready, read its capacity
- TU_LOG2("SCSI Read Capacity\r\n");
- tuh_msc_read_capacity(dev_addr, cbw->lun, (scsi_read_capacity10_resp_t*) ((void*) _msch_buffer), config_read_capacity_complete);
- }else
- {
- // Note: During enumeration, some device fails Test Unit Ready and require a few retries
- // with Request Sense to start working !!
- // TODO limit number of retries
- TU_LOG2("SCSI Request Sense\r\n");
- TU_ASSERT(tuh_msc_request_sense(dev_addr, cbw->lun, _msch_buffer, config_request_sense_complete));
- }
-
- return true;
-}
-
-static bool config_request_sense_complete(uint8_t dev_addr, msc_cbw_t const* cbw, msc_csw_t const* csw)
-{
- TU_ASSERT(csw->status == 0);
- TU_ASSERT(tuh_msc_test_unit_ready(dev_addr, cbw->lun, config_test_unit_ready_complete));
- return true;
-}
-
-static bool config_read_capacity_complete(uint8_t dev_addr, msc_cbw_t const* cbw, msc_csw_t const* csw)
-{
- TU_ASSERT(csw->status == 0);
-
- msch_interface_t* p_msc = get_itf(dev_addr);
-
- // Capacity response field: Block size and Last LBA are both Big-Endian
- scsi_read_capacity10_resp_t* resp = (scsi_read_capacity10_resp_t*) ((void*) _msch_buffer);
- p_msc->capacity[cbw->lun].block_count = tu_ntohl(resp->last_lba) + 1;
- p_msc->capacity[cbw->lun].block_size = tu_ntohl(resp->block_size);
-
- // Mark enumeration is complete
- p_msc->mounted = true;
- if (tuh_msc_mount_cb) tuh_msc_mount_cb(dev_addr);
-
- // notify usbh that driver enumeration is complete
- usbh_driver_set_config_complete(dev_addr, p_msc->itf_num);
-
- return true;
-}
-
-#endif
diff --git a/tinyusb/src/class/msc/msc_host.h b/tinyusb/src/class/msc/msc_host.h
deleted file mode 100755
index 7718ad4f..00000000
--- a/tinyusb/src/class/msc/msc_host.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_MSC_HOST_H_
-#define _TUSB_MSC_HOST_H_
-
-#include "msc.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Class Driver Configuration
-//--------------------------------------------------------------------+
-
-#ifndef CFG_TUH_MSC_MAXLUN
-#define CFG_TUH_MSC_MAXLUN 4
-#endif
-
-typedef bool (*tuh_msc_complete_cb_t)(uint8_t dev_addr, msc_cbw_t const* cbw, msc_csw_t const* csw);
-
-//--------------------------------------------------------------------+
-// Application API
-//--------------------------------------------------------------------+
-
-// Check if device supports MassStorage interface.
-// This function true after tuh_msc_mounted_cb() and false after tuh_msc_unmounted_cb()
-bool tuh_msc_mounted(uint8_t dev_addr);
-
-// Check if the interface is currently ready or busy transferring data
-bool tuh_msc_ready(uint8_t dev_addr);
-
-// Get Max Lun
-uint8_t tuh_msc_get_maxlun(uint8_t dev_addr);
-
-// Get number of block
-uint32_t tuh_msc_get_block_count(uint8_t dev_addr, uint8_t lun);
-
-// Get block size in bytes
-uint32_t tuh_msc_get_block_size(uint8_t dev_addr, uint8_t lun);
-
-// Perform a full SCSI command (cbw, data, csw) in non-blocking manner.
-// Complete callback is invoked when SCSI op is complete.
-// return true if success, false if there is already pending operation.
-bool tuh_msc_scsi_command(uint8_t dev_addr, msc_cbw_t const* cbw, void* data, tuh_msc_complete_cb_t complete_cb);
-
-// Perform SCSI Inquiry command
-// Complete callback is invoked when SCSI op is complete.
-bool tuh_msc_inquiry(uint8_t dev_addr, uint8_t lun, scsi_inquiry_resp_t* response, tuh_msc_complete_cb_t complete_cb);
-
-// Perform SCSI Test Unit Ready command
-// Complete callback is invoked when SCSI op is complete.
-bool tuh_msc_test_unit_ready(uint8_t dev_addr, uint8_t lun, tuh_msc_complete_cb_t complete_cb);
-
-// Perform SCSI Request Sense 10 command
-// Complete callback is invoked when SCSI op is complete.
-bool tuh_msc_request_sense(uint8_t dev_addr, uint8_t lun, void *resposne, tuh_msc_complete_cb_t complete_cb);
-
-// Perform SCSI Read 10 command. Read n blocks starting from LBA to buffer
-// Complete callback is invoked when SCSI op is complete.
-bool tuh_msc_read10(uint8_t dev_addr, uint8_t lun, void * buffer, uint32_t lba, uint16_t block_count, tuh_msc_complete_cb_t complete_cb);
-
-// Perform SCSI Write 10 command. Write n blocks starting from LBA to device
-// Complete callback is invoked when SCSI op is complete.
-bool tuh_msc_write10(uint8_t dev_addr, uint8_t lun, void const * buffer, uint32_t lba, uint16_t block_count, tuh_msc_complete_cb_t complete_cb);
-
-// Perform SCSI Read Capacity 10 command
-// Complete callback is invoked when SCSI op is complete.
-// Note: during enumeration, host stack already carried out this request. Application can retrieve capacity by
-// simply call tuh_msc_get_block_count() and tuh_msc_get_block_size()
-bool tuh_msc_read_capacity(uint8_t dev_addr, uint8_t lun, scsi_read_capacity10_resp_t* response, tuh_msc_complete_cb_t complete_cb);
-
-//------------- Application Callback -------------//
-
-// Invoked when a device with MassStorage interface is mounted
-TU_ATTR_WEAK void tuh_msc_mount_cb(uint8_t dev_addr);
-
-// Invoked when a device with MassStorage interface is unmounted
-TU_ATTR_WEAK void tuh_msc_umount_cb(uint8_t dev_addr);
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-
-void msch_init (void);
-bool msch_open (uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *desc_itf, uint16_t max_len);
-bool msch_set_config (uint8_t dev_addr, uint8_t itf_num);
-void msch_close (uint8_t dev_addr);
-bool msch_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_MSC_HOST_H_ */
diff --git a/tinyusb/src/class/net/net_device.c b/tinyusb/src/class/net/net_device.c
deleted file mode 100755
index 9d9719ce..00000000
--- a/tinyusb/src/class/net/net_device.c
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Peter Lawrence
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if ( TUSB_OPT_DEVICE_ENABLED && CFG_TUD_NET )
-
-#include "device/usbd.h"
-#include "device/usbd_pvt.h"
-
-#include "net_device.h"
-#include "rndis_protocol.h"
-
-void rndis_class_set_handler(uint8_t *data, int size); /* found in ./misc/networking/rndis_reports.c */
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-typedef struct
-{
- uint8_t itf_num; // Index number of Management Interface, +1 for Data Interface
- uint8_t itf_data_alt; // Alternate setting of Data Interface. 0 : inactive, 1 : active
-
- uint8_t ep_notif;
- uint8_t ep_in;
- uint8_t ep_out;
-
- bool ecm_mode;
-
- // Endpoint descriptor use to open/close when receving SetInterface
- // TODO since configuration descriptor may not be long-lived memory, we should
- // keep a copy of endpoint attribute instead
- uint8_t const * ecm_desc_epdata;
-
-} netd_interface_t;
-
-#define CFG_TUD_NET_PACKET_PREFIX_LEN sizeof(rndis_data_packet_t)
-#define CFG_TUD_NET_PACKET_SUFFIX_LEN 0
-
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static uint8_t received[CFG_TUD_NET_PACKET_PREFIX_LEN + CFG_TUD_NET_MTU + CFG_TUD_NET_PACKET_PREFIX_LEN];
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static uint8_t transmitted[CFG_TUD_NET_PACKET_PREFIX_LEN + CFG_TUD_NET_MTU + CFG_TUD_NET_PACKET_PREFIX_LEN];
-
-struct ecm_notify_struct
-{
- tusb_control_request_t header;
- uint32_t downlink, uplink;
-};
-
-static const struct ecm_notify_struct ecm_notify_nc =
-{
- .header = {
- .bmRequestType = 0xA1,
- .bRequest = 0 /* NETWORK_CONNECTION aka NetworkConnection */,
- .wValue = 1 /* Connected */,
- .wLength = 0,
- },
-};
-
-static const struct ecm_notify_struct ecm_notify_csc =
-{
- .header = {
- .bmRequestType = 0xA1,
- .bRequest = 0x2A /* CONNECTION_SPEED_CHANGE aka ConnectionSpeedChange */,
- .wLength = 8,
- },
- .downlink = 9728000,
- .uplink = 9728000,
-};
-
-// TODO remove CFG_TUSB_MEM_SECTION, control internal buffer is already in this special section
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static union
-{
- uint8_t rndis_buf[120];
- struct ecm_notify_struct ecm_buf;
-} notify;
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-// TODO remove CFG_TUSB_MEM_SECTION
-CFG_TUSB_MEM_SECTION static netd_interface_t _netd_itf;
-
-static bool can_xmit;
-
-void tud_network_recv_renew(void)
-{
- usbd_edpt_xfer(TUD_OPT_RHPORT, _netd_itf.ep_out, received, sizeof(received));
-}
-
-static void do_in_xfer(uint8_t *buf, uint16_t len)
-{
- can_xmit = false;
- usbd_edpt_xfer(TUD_OPT_RHPORT, _netd_itf.ep_in, buf, len);
-}
-
-void netd_report(uint8_t *buf, uint16_t len)
-{
- usbd_edpt_xfer(TUD_OPT_RHPORT, _netd_itf.ep_notif, buf, len);
-}
-
-//--------------------------------------------------------------------+
-// USBD Driver API
-//--------------------------------------------------------------------+
-void netd_init(void)
-{
- tu_memclr(&_netd_itf, sizeof(_netd_itf));
-}
-
-void netd_reset(uint8_t rhport)
-{
- (void) rhport;
-
- netd_init();
-}
-
-uint16_t netd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len)
-{
- bool const is_rndis = (TUD_RNDIS_ITF_CLASS == itf_desc->bInterfaceClass &&
- TUD_RNDIS_ITF_SUBCLASS == itf_desc->bInterfaceSubClass &&
- TUD_RNDIS_ITF_PROTOCOL == itf_desc->bInterfaceProtocol);
-
- bool const is_ecm = (TUSB_CLASS_CDC == itf_desc->bInterfaceClass &&
- CDC_COMM_SUBCLASS_ETHERNET_CONTROL_MODEL == itf_desc->bInterfaceSubClass &&
- 0x00 == itf_desc->bInterfaceProtocol);
-
- TU_VERIFY(is_rndis || is_ecm, 0);
-
- // confirm interface hasn't already been allocated
- TU_ASSERT(0 == _netd_itf.ep_notif, 0);
-
- // sanity check the descriptor
- _netd_itf.ecm_mode = is_ecm;
-
- //------------- Management Interface -------------//
- _netd_itf.itf_num = itf_desc->bInterfaceNumber;
-
- uint16_t drv_len = sizeof(tusb_desc_interface_t);
- uint8_t const * p_desc = tu_desc_next( itf_desc );
-
- // Communication Functional Descriptors
- while ( TUSB_DESC_CS_INTERFACE == tu_desc_type(p_desc) && drv_len <= max_len )
- {
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
- }
-
- // notification endpoint (if any)
- if ( TUSB_DESC_ENDPOINT == tu_desc_type(p_desc) )
- {
- TU_ASSERT( usbd_edpt_open(rhport, (tusb_desc_endpoint_t const *) p_desc), 0 );
-
- _netd_itf.ep_notif = ((tusb_desc_endpoint_t const *) p_desc)->bEndpointAddress;
-
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
- }
-
- //------------- Data Interface -------------//
- // - RNDIS Data followed immediately by a pair of endpoints
- // - CDC-ECM data interface has 2 alternate settings
- // - 0 : zero endpoints for inactive (default)
- // - 1 : IN & OUT endpoints for active networking
- TU_ASSERT(TUSB_DESC_INTERFACE == tu_desc_type(p_desc), 0);
-
- do
- {
- tusb_desc_interface_t const * data_itf_desc = (tusb_desc_interface_t const *) p_desc;
- TU_ASSERT(TUSB_CLASS_CDC_DATA == data_itf_desc->bInterfaceClass, 0);
-
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
- }while( _netd_itf.ecm_mode && (TUSB_DESC_INTERFACE == tu_desc_type(p_desc)) && (drv_len <= max_len) );
-
- // Pair of endpoints
- TU_ASSERT(TUSB_DESC_ENDPOINT == tu_desc_type(p_desc), 0);
-
- if ( _netd_itf.ecm_mode )
- {
- // ECM by default is in-active, save the endpoint attribute
- // to open later when received setInterface
- _netd_itf.ecm_desc_epdata = p_desc;
- }else
- {
- // Open endpoint pair for RNDIS
- TU_ASSERT( usbd_open_edpt_pair(rhport, p_desc, 2, TUSB_XFER_BULK, &_netd_itf.ep_out, &_netd_itf.ep_in), 0 );
-
- tud_network_init_cb();
-
- // we are ready to transmit a packet
- can_xmit = true;
-
- // prepare for incoming packets
- tud_network_recv_renew();
- }
-
- drv_len += 2*sizeof(tusb_desc_endpoint_t);
-
- return drv_len;
-}
-
-static void ecm_report(bool nc)
-{
- notify.ecm_buf = (nc) ? ecm_notify_nc : ecm_notify_csc;
- notify.ecm_buf.header.wIndex = _netd_itf.itf_num;
- netd_report((uint8_t *)&notify.ecm_buf, (nc) ? sizeof(notify.ecm_buf.header) : sizeof(notify.ecm_buf));
-}
-
-// Invoked when a control transfer occurred on an interface of this class
-// Driver response accordingly to the request and the transfer stage (setup/data/ack)
-// return false to stall control endpoint (e.g unsupported request)
-bool netd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
-{
- if ( stage == CONTROL_STAGE_SETUP )
- {
- switch ( request->bmRequestType_bit.type )
- {
- case TUSB_REQ_TYPE_STANDARD:
- switch ( request->bRequest )
- {
- case TUSB_REQ_GET_INTERFACE:
- {
- uint8_t const req_itfnum = (uint8_t) request->wIndex;
- TU_VERIFY(_netd_itf.itf_num+1 == req_itfnum);
-
- tud_control_xfer(rhport, request, &_netd_itf.itf_data_alt, 1);
- }
- break;
-
- case TUSB_REQ_SET_INTERFACE:
- {
- uint8_t const req_itfnum = (uint8_t) request->wIndex;
- uint8_t const req_alt = (uint8_t) request->wValue;
-
- // Only valid for Data Interface with Alternate is either 0 or 1
- TU_VERIFY(_netd_itf.itf_num+1 == req_itfnum && req_alt < 2);
-
- // ACM-ECM only: qequest to enable/disable network activities
- TU_VERIFY(_netd_itf.ecm_mode);
-
- _netd_itf.itf_data_alt = req_alt;
-
- if ( _netd_itf.itf_data_alt )
- {
- // TODO since we don't actually close endpoint
- // hack here to not re-open it
- if ( _netd_itf.ep_in == 0 && _netd_itf.ep_out == 0 )
- {
- TU_ASSERT(_netd_itf.ecm_desc_epdata);
- TU_ASSERT( usbd_open_edpt_pair(rhport, _netd_itf.ecm_desc_epdata, 2, TUSB_XFER_BULK, &_netd_itf.ep_out, &_netd_itf.ep_in) );
-
- // TODO should be merge with RNDIS's after endpoint opened
- // Also should have opposite callback for application to disable network !!
- tud_network_init_cb();
- can_xmit = true; // we are ready to transmit a packet
- tud_network_recv_renew(); // prepare for incoming packets
- }
- }else
- {
- // TODO close the endpoint pair
- // For now pretend that we did, this should have no harm since host won't try to
- // communicate with the endpoints again
- // _netd_itf.ep_in = _netd_itf.ep_out = 0
- }
-
- tud_control_status(rhport, request);
- }
- break;
-
- // unsupported request
- default: return false;
- }
- break;
-
- case TUSB_REQ_TYPE_CLASS:
- TU_VERIFY (_netd_itf.itf_num == request->wIndex);
-
- if (_netd_itf.ecm_mode)
- {
- /* the only required CDC-ECM Management Element Request is SetEthernetPacketFilter */
- if (0x43 /* SET_ETHERNET_PACKET_FILTER */ == request->bRequest)
- {
- tud_control_xfer(rhport, request, NULL, 0);
- ecm_report(true);
- }
- }
- else
- {
- if (request->bmRequestType_bit.direction == TUSB_DIR_IN)
- {
- rndis_generic_msg_t *rndis_msg = (rndis_generic_msg_t *) ((void*) notify.rndis_buf);
- uint32_t msglen = tu_le32toh(rndis_msg->MessageLength);
- TU_ASSERT(msglen <= sizeof(notify.rndis_buf));
- tud_control_xfer(rhport, request, notify.rndis_buf, msglen);
- }
- else
- {
- tud_control_xfer(rhport, request, notify.rndis_buf, sizeof(notify.rndis_buf));
- }
- }
- break;
-
- // unsupported request
- default: return false;
- }
- }
- else if ( stage == CONTROL_STAGE_DATA )
- {
- // Handle RNDIS class control OUT only
- if (request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS &&
- request->bmRequestType_bit.direction == TUSB_DIR_OUT &&
- _netd_itf.itf_num == request->wIndex)
- {
- if ( !_netd_itf.ecm_mode )
- {
- rndis_class_set_handler(notify.rndis_buf, request->wLength);
- }
- }
- }
-
- return true;
-}
-
-static void handle_incoming_packet(uint32_t len)
-{
- uint8_t *pnt = received;
- uint32_t size = 0;
-
- if (_netd_itf.ecm_mode)
- {
- size = len;
- }
- else
- {
- rndis_data_packet_t *r = (rndis_data_packet_t *) ((void*) pnt);
- if (len >= sizeof(rndis_data_packet_t))
- if ( (r->MessageType == REMOTE_NDIS_PACKET_MSG) && (r->MessageLength <= len))
- if ( (r->DataOffset + offsetof(rndis_data_packet_t, DataOffset) + r->DataLength) <= len)
- {
- pnt = &received[r->DataOffset + offsetof(rndis_data_packet_t, DataOffset)];
- size = r->DataLength;
- }
- }
-
- if (!tud_network_recv_cb(pnt, size))
- {
- /* if a buffer was never handled by user code, we must renew on the user's behalf */
- tud_network_recv_renew();
- }
-}
-
-bool netd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
-{
- (void) rhport;
- (void) result;
-
- /* new packet received */
- if ( ep_addr == _netd_itf.ep_out )
- {
- handle_incoming_packet(xferred_bytes);
- }
-
- /* data transmission finished */
- if ( ep_addr == _netd_itf.ep_in )
- {
- /* TinyUSB requires the class driver to implement ZLP (since ZLP usage is class-specific) */
-
- if ( xferred_bytes && (0 == (xferred_bytes % CFG_TUD_NET_ENDPOINT_SIZE)) )
- {
- do_in_xfer(NULL, 0); /* a ZLP is needed */
- }
- else
- {
- /* we're finally finished */
- can_xmit = true;
- }
- }
-
- if ( _netd_itf.ecm_mode && (ep_addr == _netd_itf.ep_notif) )
- {
- if (sizeof(notify.ecm_buf.header) == xferred_bytes) ecm_report(false);
- }
-
- return true;
-}
-
-bool tud_network_can_xmit(void)
-{
- return can_xmit;
-}
-
-void tud_network_xmit(void *ref, uint16_t arg)
-{
- uint8_t *data;
- uint16_t len;
-
- if (!can_xmit)
- return;
-
- len = (_netd_itf.ecm_mode) ? 0 : CFG_TUD_NET_PACKET_PREFIX_LEN;
- data = transmitted + len;
-
- len += tud_network_xmit_cb(data, ref, arg);
-
- if (!_netd_itf.ecm_mode)
- {
- rndis_data_packet_t *hdr = (rndis_data_packet_t *) ((void*) transmitted);
- memset(hdr, 0, sizeof(rndis_data_packet_t));
- hdr->MessageType = REMOTE_NDIS_PACKET_MSG;
- hdr->MessageLength = len;
- hdr->DataOffset = sizeof(rndis_data_packet_t) - offsetof(rndis_data_packet_t, DataOffset);
- hdr->DataLength = len - sizeof(rndis_data_packet_t);
- }
-
- do_in_xfer(transmitted, len);
-}
-
-#endif
diff --git a/tinyusb/src/class/net/net_device.h b/tinyusb/src/class/net/net_device.h
deleted file mode 100755
index f030f307..00000000
--- a/tinyusb/src/class/net/net_device.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Peter Lawrence
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_NET_DEVICE_H_
-#define _TUSB_NET_DEVICE_H_
-
-#include "class/cdc/cdc.h"
-
-/* declared here, NOT in usb_descriptors.c, so that the driver can intelligently ZLP as needed */
-#define CFG_TUD_NET_ENDPOINT_SIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
-
-/* Maximum Tranmission Unit (in bytes) of the network, including Ethernet header */
-#ifndef CFG_TUD_NET_MTU
-#define CFG_TUD_NET_MTU 1514
-#endif
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Application API
-//--------------------------------------------------------------------+
-
-// client must provide this: initialize any network state back to the beginning
-void tud_network_init_cb(void);
-
-// client must provide this: return false if the packet buffer was not accepted
-bool tud_network_recv_cb(const uint8_t *src, uint16_t size);
-
-// client must provide this: copy from network stack packet pointer to dst
-uint16_t tud_network_xmit_cb(uint8_t *dst, void *ref, uint16_t arg);
-
-// client must provide this: 48-bit MAC address
-// TODO removed later since it is not part of tinyusb stack
-extern const uint8_t tud_network_mac_address[6];
-
-// indicate to network driver that client has finished with the packet provided to network_recv_cb()
-void tud_network_recv_renew(void);
-
-// poll network driver for its ability to accept another packet to transmit
-bool tud_network_can_xmit(void);
-
-// if network_can_xmit() returns true, network_xmit() can be called once
-void tud_network_xmit(void *ref, uint16_t arg);
-
-//--------------------------------------------------------------------+
-// INTERNAL USBD-CLASS DRIVER API
-//--------------------------------------------------------------------+
-void netd_init (void);
-void netd_reset (uint8_t rhport);
-uint16_t netd_open (uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
-bool netd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
-bool netd_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes);
-void netd_report (uint8_t *buf, uint16_t len);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_NET_DEVICE_H_ */
diff --git a/tinyusb/src/class/usbtmc/usbtmc.h b/tinyusb/src/class/usbtmc/usbtmc.h
deleted file mode 100755
index 7d7005c2..00000000
--- a/tinyusb/src/class/usbtmc/usbtmc.h
+++ /dev/null
@@ -1,316 +0,0 @@
-
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 N Conrad
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_USBTMC_H__
-#define _TUSB_USBTMC_H__
-
-#include "common/tusb_common.h"
-
-
-/* Implements USBTMC Revision 1.0, April 14, 2003
-
- String descriptors must have a "LANGID=0x409"/US English string.
- Characters must be 0x20 (' ') to 0x7E ('~') ASCII,
- But MUST not contain: "/:?\*
- Also must not have leading or trailing space (' ')
- Device descriptor must state USB version 0x0200 or greater
-
- If USB488DeviceCapabilites.D2 = 1 (SR1), then there must be a INT endpoint.
-*/
-
-#define USBTMC_VERSION 0x0100
-#define USBTMC_488_VERSION 0x0100
-
-typedef enum {
- USBTMC_MSGID_DEV_DEP_MSG_OUT = 1u,
- USBTMC_MSGID_DEV_DEP_MSG_IN = 2u,
- USBTMC_MSGID_VENDOR_SPECIFIC_MSG_OUT = 126u,
- USBTMC_MSGID_VENDOR_SPECIFIC_IN = 127u,
- USBTMC_MSGID_USB488_TRIGGER = 128u,
-} usbtmc_msgid_enum;
-
-/// \brief Message header (For BULK OUT and BULK IN); 4 bytes
-typedef struct TU_ATTR_PACKED
-{
- uint8_t MsgID ; ///< Message type ID (usbtmc_msgid_enum)
- uint8_t bTag ; ///< Transfer ID 1<=bTag<=255
- uint8_t bTagInverse ; ///< Complement of the tag
- uint8_t _reserved ; ///< Must be 0x00
-} usbtmc_msg_header_t;
-
-typedef struct TU_ATTR_PACKED
-{
- usbtmc_msg_header_t header;
- uint8_t data[8];
-} usbtmc_msg_generic_t;
-
-/* Uses on the bulk-out endpoint: */
-// Next 8 bytes are message-specific
-typedef struct TU_ATTR_PACKED {
- usbtmc_msg_header_t header ; ///< Header
- uint32_t TransferSize ; ///< Transfer size; LSB first
- struct TU_ATTR_PACKED
- {
- unsigned int EOM : 1 ; ///< EOM set on last byte
- } bmTransferAttributes;
- uint8_t _reserved[3];
-} usbtmc_msg_request_dev_dep_out;
-
-TU_VERIFY_STATIC(sizeof(usbtmc_msg_request_dev_dep_out) == 12u, "struct wrong length");
-
-// Next 8 bytes are message-specific
-typedef struct TU_ATTR_PACKED
-{
- usbtmc_msg_header_t header ; ///< Header
- uint32_t TransferSize ; ///< Transfer size; LSB first
- struct TU_ATTR_PACKED
- {
- unsigned int TermCharEnabled : 1 ; ///< "The Bulk-IN transfer must terminate on the specified TermChar."; CAPABILITIES must list TermChar
- } bmTransferAttributes;
- uint8_t TermChar;
- uint8_t _reserved[2];
-} usbtmc_msg_request_dev_dep_in;
-
-TU_VERIFY_STATIC(sizeof(usbtmc_msg_request_dev_dep_in) == 12u, "struct wrong length");
-
-/* Bulk-in headers */
-
-typedef struct TU_ATTR_PACKED
-{
- usbtmc_msg_header_t header;
- uint32_t TransferSize;
- struct TU_ATTR_PACKED
- {
- uint8_t EOM: 1; ///< Last byte of transfer is the end of the message
- uint8_t UsingTermChar: 1; ///< Support TermChar && Request.TermCharEnabled && last char in transfer is TermChar
- } bmTransferAttributes;
- uint8_t _reserved[3];
-} usbtmc_msg_dev_dep_msg_in_header_t;
-
-TU_VERIFY_STATIC(sizeof(usbtmc_msg_dev_dep_msg_in_header_t) == 12u, "struct wrong length");
-
-/* Unsupported vendor things.... Are these ever used?*/
-
-typedef struct TU_ATTR_PACKED
-{
- usbtmc_msg_header_t header ; ///< Header
- uint32_t TransferSize ; ///< Transfer size; LSB first
- uint8_t _reserved[4];
-} usbtmc_msg_request_vendor_specific_out;
-
-
-TU_VERIFY_STATIC(sizeof(usbtmc_msg_request_vendor_specific_out) == 12u, "struct wrong length");
-
-typedef struct TU_ATTR_PACKED
-{
- usbtmc_msg_header_t header ; ///< Header
- uint32_t TransferSize ; ///< Transfer size; LSB first
- uint8_t _reserved[4];
-} usbtmc_msg_request_vendor_specific_in;
-
-TU_VERIFY_STATIC(sizeof(usbtmc_msg_request_vendor_specific_in) == 12u, "struct wrong length");
-
-// Control request type should use tusb_control_request_t
-
-/*
-typedef struct TU_ATTR_PACKED {
- struct {
- unsigned int Recipient : 5 ; ///< EOM set on last byte
- unsigned int Type : 2 ; ///< EOM set on last byte
- unsigned int DirectionToHost : 1 ; ///< 0 is OUT, 1 is IN
- } bmRequestType;
- uint8_t bRequest ; ///< If bmRequestType.Type = Class, see usmtmc_request_type_enum
- uint16_t wValue ;
- uint16_t wIndex ;
- uint16_t wLength ; // Number of bytes in data stage
-} usbtmc_class_specific_control_req;
-
-*/
-// bulk-in protocol errors
-enum {
- USBTMC_BULK_IN_ERR_INCOMPLETE_HEADER = 1u,
- USBTMC_BULK_IN_ERR_UNSUPPORTED = 2u,
- USBTMC_BULK_IN_ERR_BAD_PARAMETER = 3u,
- USBTMC_BULK_IN_ERR_DATA_TOO_SHORT = 4u,
- USBTMC_BULK_IN_ERR_DATA_TOO_LONG = 5u,
-};
-// bult-in halt errors
-enum {
- USBTMC_BULK_IN_ERR = 1u, ///< receives a USBTMC command message that expects a response while a
- /// Bulk-IN transfer is in progress
-};
-
-typedef enum {
- USBTMC_bREQUEST_INITIATE_ABORT_BULK_OUT = 1u,
- USBTMC_bREQUEST_CHECK_ABORT_BULK_OUT_STATUS = 2u,
- USBTMC_bREQUEST_INITIATE_ABORT_BULK_IN = 3u,
- USBTMC_bREQUEST_CHECK_ABORT_BULK_IN_STATUS = 4u,
- USBTMC_bREQUEST_INITIATE_CLEAR = 5u,
- USBTMC_bREQUEST_CHECK_CLEAR_STATUS = 6u,
- USBTMC_bREQUEST_GET_CAPABILITIES = 7u,
-
- USBTMC_bREQUEST_INDICATOR_PULSE = 64u, // Optional
-
- /****** USBTMC 488 *************/
- USB488_bREQUEST_READ_STATUS_BYTE = 128u,
- USB488_bREQUEST_REN_CONTROL = 160u,
- USB488_bREQUEST_GO_TO_LOCAL = 161u,
- USB488_bREQUEST_LOCAL_LOCKOUT = 162u,
-
-} usmtmc_request_type_enum;
-
-typedef enum {
- USBTMC_STATUS_SUCCESS = 0x01,
- USBTMC_STATUS_PENDING = 0x02,
- USBTMC_STATUS_FAILED = 0x80,
- USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS = 0x81,
- USBTMC_STATUS_SPLIT_NOT_IN_PROGRESS = 0x82,
- USBTMC_STATUS_SPLIT_IN_PROGRESS = 0x83
-} usbtmc_status_enum;
-
-/************************************************************
- * Control Responses
- */
-
-typedef struct TU_ATTR_PACKED {
- uint8_t USBTMC_status; ///< usbtmc_status_enum
- uint8_t _reserved;
- uint16_t bcdUSBTMC; ///< USBTMC_VERSION
-
- struct TU_ATTR_PACKED
- {
- unsigned int listenOnly :1;
- unsigned int talkOnly :1;
- unsigned int supportsIndicatorPulse :1;
- } bmIntfcCapabilities;
- struct TU_ATTR_PACKED
- {
- unsigned int canEndBulkInOnTermChar :1;
- } bmDevCapabilities;
- uint8_t _reserved2[6];
- uint8_t _reserved3[12];
-} usbtmc_response_capabilities_t;
-
-TU_VERIFY_STATIC(sizeof(usbtmc_response_capabilities_t) == 0x18, "struct wrong length");
-
-typedef struct TU_ATTR_PACKED
-{
- uint8_t USBTMC_status;
- struct TU_ATTR_PACKED
- {
- unsigned int BulkInFifoBytes :1;
- } bmClear;
-} usbtmc_get_clear_status_rsp_t;
-
-TU_VERIFY_STATIC(sizeof(usbtmc_get_clear_status_rsp_t) == 2u, "struct wrong length");
-
-// Used for both abort bulk IN and bulk OUT
-typedef struct TU_ATTR_PACKED
-{
- uint8_t USBTMC_status;
- uint8_t bTag;
-} usbtmc_initiate_abort_rsp_t;
-
-TU_VERIFY_STATIC(sizeof(usbtmc_get_clear_status_rsp_t) == 2u, "struct wrong length");
-
-// Used for both check_abort_bulk_in_status and check_abort_bulk_out_status
-typedef struct TU_ATTR_PACKED
-{
- uint8_t USBTMC_status;
- struct TU_ATTR_PACKED
- {
- unsigned int BulkInFifoBytes : 1; ///< Has queued data or a short packet that is queued
- } bmAbortBulkIn;
- uint8_t _reserved[2]; ///< Must be zero
- uint32_t NBYTES_RXD_TXD;
-} usbtmc_check_abort_bulk_rsp_t;
-
-TU_VERIFY_STATIC(sizeof(usbtmc_check_abort_bulk_rsp_t) == 8u, "struct wrong length");
-
-typedef struct TU_ATTR_PACKED
-{
- uint8_t USBTMC_status; ///< usbtmc_status_enum
- uint8_t _reserved;
- uint16_t bcdUSBTMC; ///< USBTMC_VERSION
-
- struct TU_ATTR_PACKED
- {
- unsigned int listenOnly :1;
- unsigned int talkOnly :1;
- unsigned int supportsIndicatorPulse :1;
- } bmIntfcCapabilities;
-
- struct TU_ATTR_PACKED
- {
- unsigned int canEndBulkInOnTermChar :1;
- } bmDevCapabilities;
-
- uint8_t _reserved2[6];
- uint16_t bcdUSB488;
-
- struct TU_ATTR_PACKED
- {
- unsigned int is488_2 :1;
- unsigned int supportsREN_GTL_LLO :1;
- unsigned int supportsTrigger :1;
- } bmIntfcCapabilities488;
-
- struct TU_ATTR_PACKED
- {
- unsigned int SCPI :1;
- unsigned int SR1 :1;
- unsigned int RL1 :1;
- unsigned int DT1 :1;
- } bmDevCapabilities488;
- uint8_t _reserved3[8];
-} usbtmc_response_capabilities_488_t;
-
-TU_VERIFY_STATIC(sizeof(usbtmc_response_capabilities_488_t) == 0x18, "struct wrong length");
-
-typedef struct TU_ATTR_PACKED
-{
- uint8_t USBTMC_status;
- uint8_t bTag;
- uint8_t statusByte;
-} usbtmc_read_stb_rsp_488_t;
-
-TU_VERIFY_STATIC(sizeof(usbtmc_read_stb_rsp_488_t) == 3u, "struct wrong length");
-
-typedef struct TU_ATTR_PACKED
-{
- struct TU_ATTR_PACKED
- {
- unsigned int bTag : 7;
- unsigned int one : 1;
- } bNotify1;
- uint8_t StatusByte;
-} usbtmc_read_stb_interrupt_488_t;
-
-TU_VERIFY_STATIC(sizeof(usbtmc_read_stb_interrupt_488_t) == 2u, "struct wrong length");
-
-#endif
-
diff --git a/tinyusb/src/class/usbtmc/usbtmc_device.c b/tinyusb/src/class/usbtmc/usbtmc_device.c
deleted file mode 100755
index c1ee49f4..00000000
--- a/tinyusb/src/class/usbtmc/usbtmc_device.c
+++ /dev/null
@@ -1,860 +0,0 @@
-/*
- * usbtmc.c
- *
- * Created on: Sep 9, 2019
- * Author: nconrad
- */
-
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Nathan Conrad
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/*
- * This library is not fully reentrant, though it is reentrant from the view
- * of either the application layer or the USB stack. Due to its locking,
- * it is not safe to call its functions from interrupts.
- *
- * The one exception is that its functions may not be called from the application
- * until the USB stack is initialized. This should not be a problem since the
- * device shouldn't be sending messages until it receives a request from the
- * host.
- */
-
-
-/*
- * In the case of single-CPU "no OS", this task is never preempted other than by
- * interrupts, and the USBTMC code isn't called by interrupts, so all is OK. For "no OS",
- * the mutex structure's main effect is to disable the USB interrupts.
- * With an OS, this class driver uses the OSAL to perform locking. The code uses a single lock
- * and does not call outside of this class with a lock held, so deadlocks won't happen.
- */
-
-//Limitations:
-// "vendor-specific" commands are not handled.
-// Dealing with "termchar" must be handled by the application layer,
-// though additional error checking is does in this module.
-// talkOnly and listenOnly are NOT supported. They're not permitted
-// in USB488, anyway.
-
-/* Supported:
- *
- * Notification pulse
- * Trigger
- * Read status byte (both by interrupt endpoint and control message)
- *
- */
-
-
-// TODO:
-// USBTMC 3.2.2 error conditions not strictly followed
-// No local lock-out, REN, or GTL.
-// Clear message available status byte at the correct time? (488 4.3.1.3)
-
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_USBTMC)
-
-#include "device/usbd.h"
-#include "device/usbd_pvt.h"
-
-#include "usbtmc_device.h"
-
-#ifdef xDEBUG
-#include "uart_util.h"
-static char logMsg[150];
-#endif
-
-/*
- * The state machine does not allow simultaneous reading and writing. This is
- * consistent with USBTMC.
- */
-
-typedef enum
-{
- STATE_CLOSED, // Endpoints have not yet been opened since USB reset
- STATE_NAK, // Bulk-out endpoint is in NAK state.
- STATE_IDLE, // Bulk-out endpoint is waiting for CMD.
- STATE_RCV, // Bulk-out is receiving DEV_DEP message
- STATE_TX_REQUESTED,
- STATE_TX_INITIATED,
- STATE_TX_SHORTED,
- STATE_CLEARING,
- STATE_ABORTING_BULK_IN,
- STATE_ABORTING_BULK_IN_SHORTED, // aborting, and short packet has been queued for transmission
- STATE_ABORTING_BULK_IN_ABORTED, // aborting, and short packet has been transmitted
- STATE_ABORTING_BULK_OUT,
- STATE_NUM_STATES
-} usbtmcd_state_enum;
-
-#if (CFG_TUD_USBTMC_ENABLE_488)
- typedef usbtmc_response_capabilities_488_t usbtmc_capabilities_specific_t;
-#else
- typedef usbtmc_response_capabilities_t usbtmc_capabilities_specific_t;
-#endif
-
-
-typedef struct
-{
- volatile usbtmcd_state_enum state;
-
- uint8_t itf_id;
- uint8_t rhport;
- uint8_t ep_bulk_in;
- uint8_t ep_bulk_out;
- uint8_t ep_int_in;
- // IN buffer is only used for first packet, not the remainder
- // in order to deal with prepending header
- CFG_TUSB_MEM_ALIGN uint8_t ep_bulk_in_buf[USBTMCD_MAX_PACKET_SIZE];
- // OUT buffer receives one packet at a time
- CFG_TUSB_MEM_ALIGN uint8_t ep_bulk_out_buf[USBTMCD_MAX_PACKET_SIZE];
- uint32_t transfer_size_remaining; // also used for requested length for bulk IN.
- uint32_t transfer_size_sent; // To keep track of data bytes that have been queued in FIFO (not header bytes)
-
- uint8_t lastBulkOutTag; // used for aborts (mostly)
- uint8_t lastBulkInTag; // used for aborts (mostly)
-
- uint8_t const * devInBuffer; // pointer to application-layer used for transmissions
-
- usbtmc_capabilities_specific_t const * capabilities;
-} usbtmc_interface_state_t;
-
-CFG_TUSB_MEM_SECTION static usbtmc_interface_state_t usbtmc_state =
-{
- .itf_id = 0xFF,
-};
-
-// We need all headers to fit in a single packet in this implementation.
-TU_VERIFY_STATIC(USBTMCD_MAX_PACKET_SIZE >= 32u,"USBTMC dev EP packet size too small");
-TU_VERIFY_STATIC(
- (sizeof(usbtmc_state.ep_bulk_in_buf) % USBTMCD_MAX_PACKET_SIZE) == 0,
- "packet buffer must be a multiple of the packet size");
-
-static bool handle_devMsgOutStart(uint8_t rhport, void *data, size_t len);
-static bool handle_devMsgOut(uint8_t rhport, void *data, size_t len, size_t packetLen);
-
-static uint8_t termChar;
-static uint8_t termCharRequested = false;
-
-
-osal_mutex_def_t usbtmcLockBuffer;
-static osal_mutex_t usbtmcLock;
-
-// Our own private lock, mostly for the state variable.
-#define criticalEnter() do {osal_mutex_lock(usbtmcLock,OSAL_TIMEOUT_WAIT_FOREVER); } while (0)
-#define criticalLeave() do {osal_mutex_unlock(usbtmcLock); } while (0)
-
-bool atomicChangeState(usbtmcd_state_enum expectedState, usbtmcd_state_enum newState)
-{
- bool ret = true;
- criticalEnter();
- usbtmcd_state_enum oldState = usbtmc_state.state;
- if (oldState == expectedState)
- {
- usbtmc_state.state = newState;
- }
- else
- {
- ret = false;
- }
- criticalLeave();
- return ret;
-}
-
-// called from app
-// We keep a reference to the buffer, so it MUST not change until the app is
-// notified that the transfer is complete.
-// length of data is specified in the hdr.
-
-// We can't just send the whole thing at once because we need to concatanate the
-// header with the data.
-bool tud_usbtmc_transmit_dev_msg_data(
- const void * data, size_t len,
- bool endOfMessage,
- bool usingTermChar)
-{
- const unsigned int txBufLen = sizeof(usbtmc_state.ep_bulk_in_buf);
-
-#ifndef NDEBUG
- TU_ASSERT(len > 0u);
- TU_ASSERT(len <= usbtmc_state.transfer_size_remaining);
- TU_ASSERT(usbtmc_state.transfer_size_sent == 0u);
- if(usingTermChar)
- {
- TU_ASSERT(usbtmc_state.capabilities->bmDevCapabilities.canEndBulkInOnTermChar);
- TU_ASSERT(termCharRequested);
- TU_ASSERT(((uint8_t*)data)[len-1u] == termChar);
- }
-#endif
-
- TU_VERIFY(usbtmc_state.state == STATE_TX_REQUESTED);
- usbtmc_msg_dev_dep_msg_in_header_t *hdr = (usbtmc_msg_dev_dep_msg_in_header_t*)usbtmc_state.ep_bulk_in_buf;
- tu_varclr(hdr);
- hdr->header.MsgID = USBTMC_MSGID_DEV_DEP_MSG_IN;
- hdr->header.bTag = usbtmc_state.lastBulkInTag;
- hdr->header.bTagInverse = (uint8_t)~(usbtmc_state.lastBulkInTag);
- hdr->TransferSize = len;
- hdr->bmTransferAttributes.EOM = endOfMessage;
- hdr->bmTransferAttributes.UsingTermChar = usingTermChar;
-
- // Copy in the header
- const size_t headerLen = sizeof(*hdr);
- const size_t dataLen = ((headerLen + hdr->TransferSize) <= txBufLen) ?
- len : (txBufLen - headerLen);
- const size_t packetLen = headerLen + dataLen;
-
- memcpy((uint8_t*)(usbtmc_state.ep_bulk_in_buf) + headerLen, data, dataLen);
- usbtmc_state.transfer_size_remaining = len - dataLen;
- usbtmc_state.transfer_size_sent = dataLen;
- usbtmc_state.devInBuffer = (uint8_t*)data + (dataLen);
-
- bool stateChanged =
- atomicChangeState(STATE_TX_REQUESTED, (packetLen >= txBufLen) ? STATE_TX_INITIATED : STATE_TX_SHORTED);
- TU_VERIFY(stateChanged);
- TU_VERIFY(usbd_edpt_xfer(usbtmc_state.rhport, usbtmc_state.ep_bulk_in, usbtmc_state.ep_bulk_in_buf, (uint16_t)packetLen));
- return true;
-}
-
-void usbtmcd_init_cb(void)
-{
- usbtmc_state.capabilities = tud_usbtmc_get_capabilities_cb();
-#ifndef NDEBUG
-# if CFG_TUD_USBTMC_ENABLE_488
- if(usbtmc_state.capabilities->bmIntfcCapabilities488.supportsTrigger)
- TU_ASSERT(&tud_usbtmc_msg_trigger_cb != NULL,);
- // Per USB488 spec: table 8
- TU_ASSERT(!usbtmc_state.capabilities->bmIntfcCapabilities.listenOnly,);
- TU_ASSERT(!usbtmc_state.capabilities->bmIntfcCapabilities.talkOnly,);
-# endif
- if(usbtmc_state.capabilities->bmIntfcCapabilities.supportsIndicatorPulse)
- TU_ASSERT(&tud_usbtmc_indicator_pulse_cb != NULL,);
-#endif
-
- usbtmcLock = osal_mutex_create(&usbtmcLockBuffer);
-}
-
-uint16_t usbtmcd_open_cb(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len)
-{
- (void)rhport;
-
- uint16_t drv_len;
- uint8_t const * p_desc;
- uint8_t found_endpoints = 0;
-
- TU_VERIFY(itf_desc->bInterfaceClass == TUD_USBTMC_APP_CLASS , 0);
- TU_VERIFY(itf_desc->bInterfaceSubClass == TUD_USBTMC_APP_SUBCLASS, 0);
-
-#ifndef NDEBUG
- // Only 2 or 3 endpoints are allowed for USBTMC.
- TU_ASSERT((itf_desc->bNumEndpoints == 2) || (itf_desc->bNumEndpoints ==3), 0);
-#endif
-
- TU_ASSERT(usbtmc_state.state == STATE_CLOSED, 0);
-
- // Interface
- drv_len = 0u;
- p_desc = (uint8_t const *) itf_desc;
-
- usbtmc_state.itf_id = itf_desc->bInterfaceNumber;
- usbtmc_state.rhport = rhport;
-
- while (found_endpoints < itf_desc->bNumEndpoints && drv_len <= max_len)
- {
- if ( TUSB_DESC_ENDPOINT == p_desc[DESC_OFFSET_TYPE])
- {
- tusb_desc_endpoint_t const *ep_desc = (tusb_desc_endpoint_t const *)p_desc;
- switch(ep_desc->bmAttributes.xfer) {
- case TUSB_XFER_BULK:
- TU_ASSERT(ep_desc->wMaxPacketSize.size == USBTMCD_MAX_PACKET_SIZE, 0);
- if (tu_edpt_dir(ep_desc->bEndpointAddress) == TUSB_DIR_IN)
- {
- usbtmc_state.ep_bulk_in = ep_desc->bEndpointAddress;
- } else {
- usbtmc_state.ep_bulk_out = ep_desc->bEndpointAddress;
- }
-
- break;
- case TUSB_XFER_INTERRUPT:
-#ifndef NDEBUG
- TU_ASSERT(tu_edpt_dir(ep_desc->bEndpointAddress) == TUSB_DIR_IN, 0);
- TU_ASSERT(usbtmc_state.ep_int_in == 0, 0);
-#endif
- usbtmc_state.ep_int_in = ep_desc->bEndpointAddress;
- break;
- default:
- TU_ASSERT(false, 0);
- }
- TU_ASSERT( usbd_edpt_open(rhport, ep_desc), 0);
- found_endpoints++;
- }
-
- drv_len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
- }
-
- // bulk endpoints are required, but interrupt IN is optional
-#ifndef NDEBUG
- TU_ASSERT(usbtmc_state.ep_bulk_in != 0, 0);
- TU_ASSERT(usbtmc_state.ep_bulk_out != 0, 0);
- if (itf_desc->bNumEndpoints == 2)
- {
- TU_ASSERT(usbtmc_state.ep_int_in == 0, 0);
- }
- else if (itf_desc->bNumEndpoints == 3)
- {
- TU_ASSERT(usbtmc_state.ep_int_in != 0, 0);
- }
-#if (CFG_TUD_USBTMC_ENABLE_488)
- if(usbtmc_state.capabilities->bmIntfcCapabilities488.is488_2 ||
- usbtmc_state.capabilities->bmDevCapabilities488.SR1)
- {
- TU_ASSERT(usbtmc_state.ep_int_in != 0, 0);
- }
-#endif
-#endif
- atomicChangeState(STATE_CLOSED, STATE_NAK);
- tud_usbtmc_open_cb(itf_desc->iInterface);
-
- return drv_len;
-}
-// Tell USBTMC class to set its bulk-in EP to ACK so that it can
-// receive USBTMC commands.
-// Returns false if it was already in an ACK state or is busy
-// processing a command (such as a clear). Returns true if it was
-// in the NAK state and successfully transitioned to the ACK wait
-// state.
-bool tud_usbtmc_start_bus_read()
-{
- usbtmcd_state_enum oldState = usbtmc_state.state;
- switch(oldState)
- {
- // These may transition to IDLE
- case STATE_NAK:
- case STATE_ABORTING_BULK_IN_ABORTED:
- TU_VERIFY(atomicChangeState(oldState, STATE_IDLE));
- break;
- // When receiving, let it remain receiving
- case STATE_RCV:
- break;
- default:
- TU_VERIFY(false);
- }
- TU_VERIFY(usbd_edpt_xfer(usbtmc_state.rhport, usbtmc_state.ep_bulk_out, usbtmc_state.ep_bulk_out_buf, 64));
- return true;
-}
-
-void usbtmcd_reset_cb(uint8_t rhport)
-{
- (void)rhport;
- usbtmc_capabilities_specific_t const * capabilities = tud_usbtmc_get_capabilities_cb();
-
- criticalEnter();
- tu_varclr(&usbtmc_state);
- usbtmc_state.capabilities = capabilities;
- usbtmc_state.itf_id = 0xFFu;
- criticalLeave();
-}
-
-static bool handle_devMsgOutStart(uint8_t rhport, void *data, size_t len)
-{
- (void)rhport;
- // return true upon failure, as we can assume error is being handled elsewhere.
- TU_VERIFY(atomicChangeState(STATE_IDLE, STATE_RCV), true);
- usbtmc_state.transfer_size_sent = 0u;
-
- // must be a header, should have been confirmed before calling here.
- usbtmc_msg_request_dev_dep_out *msg = (usbtmc_msg_request_dev_dep_out*)data;
- usbtmc_state.transfer_size_remaining = msg->TransferSize;
- TU_VERIFY(tud_usbtmc_msgBulkOut_start_cb(msg));
-
- TU_VERIFY(handle_devMsgOut(rhport, (uint8_t*)data + sizeof(*msg), len - sizeof(*msg), len));
- usbtmc_state.lastBulkOutTag = msg->header.bTag;
- return true;
-}
-
-static bool handle_devMsgOut(uint8_t rhport, void *data, size_t len, size_t packetLen)
-{
- (void)rhport;
- // return true upon failure, as we can assume error is being handled elsewhere.
- TU_VERIFY(usbtmc_state.state == STATE_RCV,true);
-
- bool shortPacket = (packetLen < USBTMCD_MAX_PACKET_SIZE);
-
- // Packet is to be considered complete when we get enough data or at a short packet.
- bool atEnd = false;
- if(len >= usbtmc_state.transfer_size_remaining || shortPacket)
- {
- atEnd = true;
- TU_VERIFY(atomicChangeState(STATE_RCV, STATE_NAK));
- }
-
- len = tu_min32(len, usbtmc_state.transfer_size_remaining);
-
- usbtmc_state.transfer_size_remaining -= len;
- usbtmc_state.transfer_size_sent += len;
-
- // App may (should?) call the wait_for_bus() command at this point
- if(!tud_usbtmc_msg_data_cb(data, len, atEnd))
- {
- // TODO: Go to an error state upon failure other than just stalling the EP?
- return false;
- }
-
-
- return true;
-}
-
-static bool handle_devMsgIn(void *data, size_t len)
-{
- TU_VERIFY(len == sizeof(usbtmc_msg_request_dev_dep_in));
- usbtmc_msg_request_dev_dep_in *msg = (usbtmc_msg_request_dev_dep_in*)data;
- bool stateChanged = atomicChangeState(STATE_IDLE, STATE_TX_REQUESTED);
- TU_VERIFY(stateChanged);
- usbtmc_state.lastBulkInTag = msg->header.bTag;
- usbtmc_state.transfer_size_remaining = msg->TransferSize;
- usbtmc_state.transfer_size_sent = 0u;
-
- termCharRequested = msg->bmTransferAttributes.TermCharEnabled;
- termChar = msg->TermChar;
-
- if(termCharRequested)
- TU_VERIFY(usbtmc_state.capabilities->bmDevCapabilities.canEndBulkInOnTermChar);
-
- TU_VERIFY(tud_usbtmc_msgBulkIn_request_cb(msg));
- return true;
-}
-
-bool usbtmcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
-{
- TU_VERIFY(result == XFER_RESULT_SUCCESS);
- //uart_tx_str_sync("TMC XFER CB\r\n");
- if(usbtmc_state.state == STATE_CLEARING) {
- return true; /* I think we can ignore everything here */
- }
-
- if(ep_addr == usbtmc_state.ep_bulk_out)
- {
- usbtmc_msg_generic_t *msg = NULL;
-
- switch(usbtmc_state.state)
- {
- case STATE_IDLE:
- TU_VERIFY(xferred_bytes >= sizeof(usbtmc_msg_generic_t));
- msg = (usbtmc_msg_generic_t*)(usbtmc_state.ep_bulk_out_buf);
- uint8_t invInvTag = (uint8_t)~(msg->header.bTagInverse);
- TU_VERIFY(msg->header.bTag == invInvTag);
- TU_VERIFY(msg->header.bTag != 0x00);
-
- switch(msg->header.MsgID) {
- case USBTMC_MSGID_DEV_DEP_MSG_OUT:
- if(!handle_devMsgOutStart(rhport, msg, xferred_bytes))
- {
- usbd_edpt_stall(rhport, usbtmc_state.ep_bulk_out);
- TU_VERIFY(false);
- }
- break;
-
- case USBTMC_MSGID_DEV_DEP_MSG_IN:
- TU_VERIFY(handle_devMsgIn(msg, xferred_bytes));
- break;
-
-#if (CFG_TUD_USBTMC_ENABLE_488)
- case USBTMC_MSGID_USB488_TRIGGER:
- // Spec says we halt the EP if we didn't declare we support it.
- TU_VERIFY(usbtmc_state.capabilities->bmIntfcCapabilities488.supportsTrigger);
- TU_VERIFY(tud_usbtmc_msg_trigger_cb(msg));
-
- break;
-#endif
- case USBTMC_MSGID_VENDOR_SPECIFIC_MSG_OUT:
- case USBTMC_MSGID_VENDOR_SPECIFIC_IN:
- default:
- usbd_edpt_stall(rhport, usbtmc_state.ep_bulk_out);
- TU_VERIFY(false);
- return false;
- }
- return true;
-
- case STATE_RCV:
- if(!handle_devMsgOut(rhport, usbtmc_state.ep_bulk_out_buf, xferred_bytes, xferred_bytes))
- {
- usbd_edpt_stall(rhport, usbtmc_state.ep_bulk_out);
- TU_VERIFY(false);
- }
- return true;
-
- case STATE_ABORTING_BULK_OUT:
- TU_VERIFY(false);
- return false; // Should be stalled by now, shouldn't have received a packet.
- case STATE_TX_REQUESTED:
- case STATE_TX_INITIATED:
- case STATE_ABORTING_BULK_IN:
- case STATE_ABORTING_BULK_IN_SHORTED:
- case STATE_ABORTING_BULK_IN_ABORTED:
- default:
-
- TU_VERIFY(false);
- }
- }
- else if(ep_addr == usbtmc_state.ep_bulk_in)
- {
- switch(usbtmc_state.state) {
- case STATE_TX_SHORTED:
- TU_VERIFY(atomicChangeState(STATE_TX_SHORTED, STATE_NAK));
- TU_VERIFY(tud_usbtmc_msgBulkIn_complete_cb());
- break;
-
- case STATE_TX_INITIATED:
- if(usbtmc_state.transfer_size_remaining >=sizeof(usbtmc_state.ep_bulk_in_buf))
- {
- // FIXME! This removes const below!
- TU_VERIFY( usbd_edpt_xfer(rhport, usbtmc_state.ep_bulk_in,
- (void*)usbtmc_state.devInBuffer,sizeof(usbtmc_state.ep_bulk_in_buf)));
- usbtmc_state.devInBuffer += sizeof(usbtmc_state.ep_bulk_in_buf);
- usbtmc_state.transfer_size_remaining -= sizeof(usbtmc_state.ep_bulk_in_buf);
- usbtmc_state.transfer_size_sent += sizeof(usbtmc_state.ep_bulk_in_buf);
- }
- else // last packet
- {
- size_t packetLen = usbtmc_state.transfer_size_remaining;
- memcpy(usbtmc_state.ep_bulk_in_buf, usbtmc_state.devInBuffer, usbtmc_state.transfer_size_remaining);
- usbtmc_state.transfer_size_sent += sizeof(usbtmc_state.transfer_size_remaining);
- usbtmc_state.transfer_size_remaining = 0;
- usbtmc_state.devInBuffer = NULL;
- TU_VERIFY( usbd_edpt_xfer(rhport, usbtmc_state.ep_bulk_in, usbtmc_state.ep_bulk_in_buf,(uint16_t)packetLen));
- if(((packetLen % USBTMCD_MAX_PACKET_SIZE) != 0) || (packetLen == 0 ))
- {
- usbtmc_state.state = STATE_TX_SHORTED;
- }
- }
- return true;
- case STATE_ABORTING_BULK_IN:
- // need to send short packet (ZLP?)
- TU_VERIFY( usbd_edpt_xfer(rhport, usbtmc_state.ep_bulk_in, usbtmc_state.ep_bulk_in_buf,(uint16_t)0u));
- usbtmc_state.state = STATE_ABORTING_BULK_IN_SHORTED;
- return true;
- case STATE_ABORTING_BULK_IN_SHORTED:
- /* Done. :)*/
- usbtmc_state.state = STATE_ABORTING_BULK_IN_ABORTED;
- return true;
- default:
- TU_ASSERT(false);
- return false;
- }
- }
- else if (ep_addr == usbtmc_state.ep_int_in) {
- // Good?
- return true;
- }
- return false;
-}
-
-// Invoked when a control transfer occurred on an interface of this class
-// Driver response accordingly to the request and the transfer stage (setup/data/ack)
-// return false to stall control endpoint (e.g unsupported request)
-bool usbtmcd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
-{
- // nothing to do with DATA and ACK stage
- if ( stage != CONTROL_STAGE_SETUP ) return true;
-
- uint8_t tmcStatusCode = USBTMC_STATUS_FAILED;
-#if (CFG_TUD_USBTMC_ENABLE_488)
- uint8_t bTag;
-#endif
-
- if((request->bmRequestType_bit.type == TUSB_REQ_TYPE_STANDARD) &&
- (request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_ENDPOINT) &&
- (request->bRequest == TUSB_REQ_CLEAR_FEATURE) &&
- (request->wValue == TUSB_REQ_FEATURE_EDPT_HALT))
- {
- uint32_t ep_addr = (request->wIndex);
-
- if(ep_addr == usbtmc_state.ep_bulk_out)
- {
- criticalEnter();
- usbtmc_state.state = STATE_NAK; // USBD core has placed EP in NAK state for us
- criticalLeave();
- tud_usbtmc_bulkOut_clearFeature_cb();
- }
- else if (ep_addr == usbtmc_state.ep_bulk_in)
- {
- tud_usbtmc_bulkIn_clearFeature_cb();
- }
- else
- {
- return false;
- }
- return true;
- }
-
- // Otherwise, we only handle class requests.
- if(request->bmRequestType_bit.type != TUSB_REQ_TYPE_CLASS)
- {
- return false;
- }
-
- // Verification that we own the interface is unneeded since it's been routed to us specifically.
-
- switch(request->bRequest)
- {
- // USBTMC required requests
- case USBTMC_bREQUEST_INITIATE_ABORT_BULK_OUT:
- {
- usbtmc_initiate_abort_rsp_t rsp = {
- .bTag = usbtmc_state.lastBulkOutTag,
- };
- TU_VERIFY(request->bmRequestType == 0xA2); // in,class,interface
- TU_VERIFY(request->wLength == sizeof(rsp));
- TU_VERIFY(request->wIndex == usbtmc_state.ep_bulk_out);
-
- // wValue is the requested bTag to abort
- if(usbtmc_state.state != STATE_RCV)
- {
- rsp.USBTMC_status = USBTMC_STATUS_FAILED;
- }
- else if(usbtmc_state.lastBulkOutTag == (request->wValue & 0x7Fu))
- {
- rsp.USBTMC_status = USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS;
- }
- else
- {
- rsp.USBTMC_status = USBTMC_STATUS_SUCCESS;
- // Check if we've queued a short packet
- criticalEnter();
- usbtmc_state.state = STATE_ABORTING_BULK_OUT;
- criticalLeave();
- TU_VERIFY(tud_usbtmc_initiate_abort_bulk_out_cb(&(rsp.USBTMC_status)));
- usbd_edpt_stall(rhport, usbtmc_state.ep_bulk_out);
- }
- TU_VERIFY(tud_control_xfer(rhport, request, (void*)&rsp,sizeof(rsp)));
- return true;
- }
-
- case USBTMC_bREQUEST_CHECK_ABORT_BULK_OUT_STATUS:
- {
- usbtmc_check_abort_bulk_rsp_t rsp = {
- .USBTMC_status = USBTMC_STATUS_SUCCESS,
- .NBYTES_RXD_TXD = usbtmc_state.transfer_size_sent
- };
- TU_VERIFY(request->bmRequestType == 0xA2); // in,class,EP
- TU_VERIFY(request->wLength == sizeof(rsp));
- TU_VERIFY(request->wIndex == usbtmc_state.ep_bulk_out);
- TU_VERIFY(tud_usbtmc_check_abort_bulk_out_cb(&rsp));
- TU_VERIFY(tud_control_xfer(rhport, request, (void*)&rsp,sizeof(rsp)));
- return true;
- }
-
- case USBTMC_bREQUEST_INITIATE_ABORT_BULK_IN:
- {
- usbtmc_initiate_abort_rsp_t rsp = {
- .bTag = usbtmc_state.lastBulkInTag,
- };
- TU_VERIFY(request->bmRequestType == 0xA2); // in,class,interface
- TU_VERIFY(request->wLength == sizeof(rsp));
- TU_VERIFY(request->wIndex == usbtmc_state.ep_bulk_in);
- // wValue is the requested bTag to abort
- if((usbtmc_state.state == STATE_TX_REQUESTED || usbtmc_state.state == STATE_TX_INITIATED) &&
- usbtmc_state.lastBulkInTag == (request->wValue & 0x7Fu))
- {
- rsp.USBTMC_status = USBTMC_STATUS_SUCCESS;
- usbtmc_state.transfer_size_remaining = 0u;
- // Check if we've queued a short packet
- criticalEnter();
- usbtmc_state.state = ((usbtmc_state.transfer_size_sent % USBTMCD_MAX_PACKET_SIZE) == 0) ?
- STATE_ABORTING_BULK_IN : STATE_ABORTING_BULK_IN_SHORTED;
- criticalLeave();
- if(usbtmc_state.transfer_size_sent == 0)
- {
- // Send short packet, nothing is in the buffer yet
- TU_VERIFY( usbd_edpt_xfer(rhport, usbtmc_state.ep_bulk_in, usbtmc_state.ep_bulk_in_buf,(uint16_t)0u));
- usbtmc_state.state = STATE_ABORTING_BULK_IN_SHORTED;
- }
- TU_VERIFY(tud_usbtmc_initiate_abort_bulk_in_cb(&(rsp.USBTMC_status)));
- }
- else if((usbtmc_state.state == STATE_TX_REQUESTED || usbtmc_state.state == STATE_TX_INITIATED))
- { // FIXME: Unsure how to check if the OUT endpoint fifo is non-empty....
- rsp.USBTMC_status = USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS;
- }
- else
- {
- rsp.USBTMC_status = USBTMC_STATUS_FAILED;
- }
- TU_VERIFY(tud_control_xfer(rhport, request, (void*)&rsp,sizeof(rsp)));
- return true;
- }
-
- case USBTMC_bREQUEST_CHECK_ABORT_BULK_IN_STATUS:
- {
- TU_VERIFY(request->bmRequestType == 0xA2); // in,class,EP
- TU_VERIFY(request->wLength == 8u);
-
- usbtmc_check_abort_bulk_rsp_t rsp =
- {
- .USBTMC_status = USBTMC_STATUS_FAILED,
- .bmAbortBulkIn =
- {
- .BulkInFifoBytes = (usbtmc_state.state != STATE_ABORTING_BULK_IN_ABORTED)
- },
- .NBYTES_RXD_TXD = usbtmc_state.transfer_size_sent,
- };
- TU_VERIFY(tud_usbtmc_check_abort_bulk_in_cb(&rsp));
- criticalEnter();
- switch(usbtmc_state.state)
- {
- case STATE_ABORTING_BULK_IN_ABORTED:
- rsp.USBTMC_status = USBTMC_STATUS_SUCCESS;
- usbtmc_state.state = STATE_IDLE;
- break;
- case STATE_ABORTING_BULK_IN:
- case STATE_ABORTING_BULK_OUT:
- rsp.USBTMC_status = USBTMC_STATUS_PENDING;
- break;
- default:
- break;
- }
- criticalLeave();
- TU_VERIFY(tud_control_xfer(rhport, request, (void*)&rsp,sizeof(rsp)));
-
- return true;
- }
-
- case USBTMC_bREQUEST_INITIATE_CLEAR:
- {
- TU_VERIFY(request->bmRequestType == 0xA1); // in,class,interface
- TU_VERIFY(request->wLength == sizeof(tmcStatusCode));
- // After receiving an INITIATE_CLEAR request, the device must Halt the Bulk-OUT endpoint, queue the
- // control endpoint response shown in Table 31, and clear all input buffers and output buffers.
- usbd_edpt_stall(rhport, usbtmc_state.ep_bulk_out);
- usbtmc_state.transfer_size_remaining = 0;
- criticalEnter();
- usbtmc_state.state = STATE_CLEARING;
- criticalLeave();
- TU_VERIFY(tud_usbtmc_initiate_clear_cb(&tmcStatusCode));
- TU_VERIFY(tud_control_xfer(rhport, request, (void*)&tmcStatusCode,sizeof(tmcStatusCode)));
- return true;
- }
-
- case USBTMC_bREQUEST_CHECK_CLEAR_STATUS:
- {
- TU_VERIFY(request->bmRequestType == 0xA1); // in,class,interface
- usbtmc_get_clear_status_rsp_t clearStatusRsp = {0};
- TU_VERIFY(request->wLength == sizeof(clearStatusRsp));
-
- if(usbd_edpt_busy(rhport, usbtmc_state.ep_bulk_in))
- {
- // Stuff stuck in TX buffer?
- clearStatusRsp.bmClear.BulkInFifoBytes = 1;
- clearStatusRsp.USBTMC_status = USBTMC_STATUS_PENDING;
- }
- else
- {
- // Let app check if it's clear
- TU_VERIFY(tud_usbtmc_check_clear_cb(&clearStatusRsp));
- }
- if(clearStatusRsp.USBTMC_status == USBTMC_STATUS_SUCCESS)
- {
- criticalEnter();
- usbtmc_state.state = STATE_IDLE;
- criticalLeave();
- }
- TU_VERIFY(tud_control_xfer(rhport, request, (void*)&clearStatusRsp,sizeof(clearStatusRsp)));
- return true;
- }
-
- case USBTMC_bREQUEST_GET_CAPABILITIES:
- {
- TU_VERIFY(request->bmRequestType == 0xA1); // in,class,interface
- TU_VERIFY(request->wLength == sizeof(*(usbtmc_state.capabilities)));
- TU_VERIFY(tud_control_xfer(rhport, request, (void*)usbtmc_state.capabilities, sizeof(*usbtmc_state.capabilities)));
- return true;
- }
- // USBTMC Optional Requests
-
- case USBTMC_bREQUEST_INDICATOR_PULSE: // Optional
- {
- TU_VERIFY(request->bmRequestType == 0xA1); // in,class,interface
- TU_VERIFY(request->wLength == sizeof(tmcStatusCode));
- TU_VERIFY(usbtmc_state.capabilities->bmIntfcCapabilities.supportsIndicatorPulse);
- TU_VERIFY(tud_usbtmc_indicator_pulse_cb(request, &tmcStatusCode));
- TU_VERIFY(tud_control_xfer(rhport, request, (void*)&tmcStatusCode, sizeof(tmcStatusCode)));
- return true;
- }
-#if (CFG_TUD_USBTMC_ENABLE_488)
-
- // USB488 required requests
- case USB488_bREQUEST_READ_STATUS_BYTE:
- {
- usbtmc_read_stb_rsp_488_t rsp;
- TU_VERIFY(request->bmRequestType == 0xA1); // in,class,interface
- TU_VERIFY(request->wLength == sizeof(rsp)); // in,class,interface
-
- bTag = request->wValue & 0x7F;
- TU_VERIFY(request->bmRequestType == 0xA1);
- TU_VERIFY((request->wValue & (~0x7F)) == 0u); // Other bits are required to be zero
- TU_VERIFY(bTag >= 0x02 && bTag <= 127);
- TU_VERIFY(request->wIndex == usbtmc_state.itf_id);
- TU_VERIFY(request->wLength == 0x0003);
- rsp.bTag = (uint8_t)bTag;
- if(usbtmc_state.ep_int_in != 0)
- {
- rsp.USBTMC_status = USBTMC_STATUS_SUCCESS;
- rsp.statusByte = 0x00; // Use interrupt endpoint, instead.
-
- usbtmc_read_stb_interrupt_488_t intMsg =
- {
- .bNotify1 = {
- .one = 1,
- .bTag = bTag & 0x7Fu,
- },
- .StatusByte = tud_usbtmc_get_stb_cb(&(rsp.USBTMC_status))
- };
- usbd_edpt_xfer(rhport, usbtmc_state.ep_int_in, (void*)&intMsg, sizeof(intMsg));
- }
- else
- {
- rsp.statusByte = tud_usbtmc_get_stb_cb(&(rsp.USBTMC_status));
- }
- TU_VERIFY(tud_control_xfer(rhport, request, (void*)&rsp, sizeof(rsp)));
- return true;
- }
- // USB488 optional requests
- case USB488_bREQUEST_REN_CONTROL:
- case USB488_bREQUEST_GO_TO_LOCAL:
- case USB488_bREQUEST_LOCAL_LOCKOUT:
- {
- TU_VERIFY(request->bmRequestType == 0xA1); // in,class,interface
- TU_VERIFY(false);
- return false;
- }
-#endif
-
- default:
- TU_VERIFY(false);
- return false;
- }
- TU_VERIFY(false);
-}
-
-#endif /* CFG_TUD_TSMC */
diff --git a/tinyusb/src/class/usbtmc/usbtmc_device.h b/tinyusb/src/class/usbtmc/usbtmc_device.h
deleted file mode 100755
index 62280031..00000000
--- a/tinyusb/src/class/usbtmc/usbtmc_device.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * usbtmc_device.h
- *
- * Created on: Sep 10, 2019
- * Author: nconrad
- */
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 N Conrad
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-
-#ifndef CLASS_USBTMC_USBTMC_DEVICE_H_
-#define CLASS_USBTMC_USBTMC_DEVICE_H_
-
-#include "usbtmc.h"
-
-// Enable 488 mode by default
-#if !defined(CFG_TUD_USBTMC_ENABLE_488)
-#define CFG_TUD_USBTMC_ENABLE_488 (1)
-#endif
-
-// USB spec says that full-speed must be 8,16,32, or 64.
-// However, this driver implementation requires it to be >=32
-#define USBTMCD_MAX_PACKET_SIZE (64u)
-
-/***********************************************
- * Functions to be implemeted by the class implementation
- */
-
-// In order to proceed, app must call call tud_usbtmc_start_bus_read(rhport) during or soon after:
-// * tud_usbtmc_open_cb
-// * tud_usbtmc_msg_data_cb
-// * tud_usbtmc_msgBulkIn_complete_cb
-// * tud_usbtmc_msg_trigger_cb
-// * (successful) tud_usbtmc_check_abort_bulk_out_cb
-// * (successful) tud_usbtmc_check_abort_bulk_in_cb
-// * (successful) tud_usmtmc_bulkOut_clearFeature_cb
-
-#if (CFG_TUD_USBTMC_ENABLE_488)
-usbtmc_response_capabilities_488_t const * tud_usbtmc_get_capabilities_cb(void);
-#else
-usbtmc_response_capabilities_t const * tud_usbtmc_get_capabilities_cb(void);
-#endif
-
-void tud_usbtmc_open_cb(uint8_t interface_id);
-
-bool tud_usbtmc_msgBulkOut_start_cb(usbtmc_msg_request_dev_dep_out const * msgHeader);
-// transfer_complete does not imply that a message is complete.
-bool tud_usbtmc_msg_data_cb( void *data, size_t len, bool transfer_complete);
-void tud_usbtmc_bulkOut_clearFeature_cb(void); // Notice to clear and abort the pending BULK out transfer
-
-bool tud_usbtmc_msgBulkIn_request_cb(usbtmc_msg_request_dev_dep_in const * request);
-bool tud_usbtmc_msgBulkIn_complete_cb(void);
-void tud_usbtmc_bulkIn_clearFeature_cb(void); // Notice to clear and abort the pending BULK out transfer
-
-bool tud_usbtmc_initiate_abort_bulk_in_cb(uint8_t *tmcResult);
-bool tud_usbtmc_initiate_abort_bulk_out_cb(uint8_t *tmcResult);
-bool tud_usbtmc_initiate_clear_cb(uint8_t *tmcResult);
-
-bool tud_usbtmc_check_abort_bulk_in_cb(usbtmc_check_abort_bulk_rsp_t *rsp);
-bool tud_usbtmc_check_abort_bulk_out_cb(usbtmc_check_abort_bulk_rsp_t *rsp);
-bool tud_usbtmc_check_clear_cb(usbtmc_get_clear_status_rsp_t *rsp);
-
-// Indicator pulse should be 0.5 to 1.0 seconds long
-TU_ATTR_WEAK bool tud_usbtmc_indicator_pulse_cb(tusb_control_request_t const * msg, uint8_t *tmcResult);
-
-#if (CFG_TUD_USBTMC_ENABLE_488)
-uint8_t tud_usbtmc_get_stb_cb(uint8_t *tmcResult);
-TU_ATTR_WEAK bool tud_usbtmc_msg_trigger_cb(usbtmc_msg_generic_t* msg);
-//TU_ATTR_WEAK bool tud_usbtmc_app_go_to_local_cb();
-#endif
-
-/*******************************************
- * Called from app
- *
- * We keep a reference to the buffer, so it MUST not change until the app is
- * notified that the transfer is complete.
- ******************************************/
-
-bool tud_usbtmc_transmit_dev_msg_data(
- const void * data, size_t len,
- bool endOfMessage, bool usingTermChar);
-
-bool tud_usbtmc_start_bus_read(void);
-
-
-/* "callbacks" from USB device core */
-
-uint16_t usbtmcd_open_cb(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
-void usbtmcd_reset_cb(uint8_t rhport);
-bool usbtmcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes);
-bool usbtmcd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
-void usbtmcd_init_cb(void);
-
-/************************************************************
- * USBTMC Descriptor Templates
- *************************************************************/
-
-
-#endif /* CLASS_USBTMC_USBTMC_DEVICE_H_ */
diff --git a/tinyusb/src/class/vendor/vendor_device.c b/tinyusb/src/class/vendor/vendor_device.c
deleted file mode 100755
index 8c59b4ea..00000000
--- a/tinyusb/src/class/vendor/vendor_device.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_VENDOR)
-
-#include "device/usbd.h"
-#include "device/usbd_pvt.h"
-
-#include "vendor_device.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-typedef struct
-{
- uint8_t itf_num;
- uint8_t ep_in;
- uint8_t ep_out;
-
- /*------------- From this point, data is not cleared by bus reset -------------*/
- tu_fifo_t rx_ff;
- tu_fifo_t tx_ff;
-
- uint8_t rx_ff_buf[CFG_TUD_VENDOR_RX_BUFSIZE];
- uint8_t tx_ff_buf[CFG_TUD_VENDOR_TX_BUFSIZE];
-
-#if CFG_FIFO_MUTEX
- osal_mutex_def_t rx_ff_mutex;
- osal_mutex_def_t tx_ff_mutex;
-#endif
-
- // Endpoint Transfer buffer
- CFG_TUSB_MEM_ALIGN uint8_t epout_buf[CFG_TUD_VENDOR_EPSIZE];
- CFG_TUSB_MEM_ALIGN uint8_t epin_buf[CFG_TUD_VENDOR_EPSIZE];
-} vendord_interface_t;
-
-CFG_TUSB_MEM_SECTION static vendord_interface_t _vendord_itf[CFG_TUD_VENDOR];
-
-#define ITF_MEM_RESET_SIZE offsetof(vendord_interface_t, rx_ff)
-
-
-bool tud_vendor_n_mounted (uint8_t itf)
-{
- return _vendord_itf[itf].ep_in && _vendord_itf[itf].ep_out;
-}
-
-uint32_t tud_vendor_n_available (uint8_t itf)
-{
- return tu_fifo_count(&_vendord_itf[itf].rx_ff);
-}
-
-bool tud_vendor_n_peek(uint8_t itf, uint8_t* u8)
-{
- return tu_fifo_peek(&_vendord_itf[itf].rx_ff, u8);
-}
-
-//--------------------------------------------------------------------+
-// Read API
-//--------------------------------------------------------------------+
-static void _prep_out_transaction (vendord_interface_t* p_itf)
-{
- // skip if previous transfer not complete
- if ( usbd_edpt_busy(TUD_OPT_RHPORT, p_itf->ep_out) ) return;
-
- // Prepare for incoming data but only allow what we can store in the ring buffer.
- uint16_t max_read = tu_fifo_remaining(&p_itf->rx_ff);
- if ( max_read >= CFG_TUD_VENDOR_EPSIZE )
- {
- usbd_edpt_xfer(TUD_OPT_RHPORT, p_itf->ep_out, p_itf->epout_buf, CFG_TUD_VENDOR_EPSIZE);
- }
-}
-
-uint32_t tud_vendor_n_read (uint8_t itf, void* buffer, uint32_t bufsize)
-{
- vendord_interface_t* p_itf = &_vendord_itf[itf];
- uint32_t num_read = tu_fifo_read_n(&p_itf->rx_ff, buffer, bufsize);
- _prep_out_transaction(p_itf);
- return num_read;
-}
-
-void tud_vendor_n_read_flush (uint8_t itf)
-{
- vendord_interface_t* p_itf = &_vendord_itf[itf];
- tu_fifo_clear(&p_itf->rx_ff);
- _prep_out_transaction(p_itf);
-}
-
-//--------------------------------------------------------------------+
-// Write API
-//--------------------------------------------------------------------+
-static bool maybe_transmit(vendord_interface_t* p_itf)
-{
- // skip if previous transfer not complete
- TU_VERIFY( !usbd_edpt_busy(TUD_OPT_RHPORT, p_itf->ep_in) );
-
- uint16_t count = tu_fifo_read_n(&p_itf->tx_ff, p_itf->epin_buf, CFG_TUD_VENDOR_EPSIZE);
- if (count > 0)
- {
- TU_ASSERT( usbd_edpt_xfer(TUD_OPT_RHPORT, p_itf->ep_in, p_itf->epin_buf, count) );
- }
- return true;
-}
-
-uint32_t tud_vendor_n_write (uint8_t itf, void const* buffer, uint32_t bufsize)
-{
- vendord_interface_t* p_itf = &_vendord_itf[itf];
- uint16_t ret = tu_fifo_write_n(&p_itf->tx_ff, buffer, bufsize);
- maybe_transmit(p_itf);
- return ret;
-}
-
-uint32_t tud_vendor_n_write_available (uint8_t itf)
-{
- return tu_fifo_remaining(&_vendord_itf[itf].tx_ff);
-}
-
-//--------------------------------------------------------------------+
-// USBD Driver API
-//--------------------------------------------------------------------+
-void vendord_init(void)
-{
- tu_memclr(_vendord_itf, sizeof(_vendord_itf));
-
- for(uint8_t i=0; i<CFG_TUD_VENDOR; i++)
- {
- vendord_interface_t* p_itf = &_vendord_itf[i];
-
- // config fifo
- tu_fifo_config(&p_itf->rx_ff, p_itf->rx_ff_buf, CFG_TUD_VENDOR_RX_BUFSIZE, 1, false);
- tu_fifo_config(&p_itf->tx_ff, p_itf->tx_ff_buf, CFG_TUD_VENDOR_TX_BUFSIZE, 1, false);
-
-#if CFG_FIFO_MUTEX
- tu_fifo_config_mutex(&p_itf->rx_ff, NULL, osal_mutex_create(&p_itf->rx_ff_mutex));
- tu_fifo_config_mutex(&p_itf->tx_ff, osal_mutex_create(&p_itf->tx_ff_mutex), NULL);
-#endif
- }
-}
-
-void vendord_reset(uint8_t rhport)
-{
- (void) rhport;
-
- for(uint8_t i=0; i<CFG_TUD_VENDOR; i++)
- {
- vendord_interface_t* p_itf = &_vendord_itf[i];
-
- tu_memclr(p_itf, ITF_MEM_RESET_SIZE);
- tu_fifo_clear(&p_itf->rx_ff);
- tu_fifo_clear(&p_itf->tx_ff);
- }
-}
-
-uint16_t vendord_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len)
-{
- TU_VERIFY(TUSB_CLASS_VENDOR_SPECIFIC == itf_desc->bInterfaceClass, 0);
-
- uint16_t const drv_len = sizeof(tusb_desc_interface_t) + itf_desc->bNumEndpoints*sizeof(tusb_desc_endpoint_t);
- TU_VERIFY(max_len >= drv_len, 0);
-
- // Find available interface
- vendord_interface_t* p_vendor = NULL;
- for(uint8_t i=0; i<CFG_TUD_VENDOR; i++)
- {
- if ( _vendord_itf[i].ep_in == 0 && _vendord_itf[i].ep_out == 0 )
- {
- p_vendor = &_vendord_itf[i];
- break;
- }
- }
- TU_VERIFY(p_vendor, 0);
-
- // Open endpoint pair with usbd helper
- TU_ASSERT(usbd_open_edpt_pair(rhport, tu_desc_next(itf_desc), 2, TUSB_XFER_BULK, &p_vendor->ep_out, &p_vendor->ep_in), 0);
-
- p_vendor->itf_num = itf_desc->bInterfaceNumber;
-
- // Prepare for incoming data
- if ( !usbd_edpt_xfer(rhport, p_vendor->ep_out, p_vendor->epout_buf, sizeof(p_vendor->epout_buf)) )
- {
- TU_LOG_FAILED();
- TU_BREAKPOINT();
- }
-
- maybe_transmit(p_vendor);
-
- return drv_len;
-}
-
-bool vendord_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
-{
- (void) rhport;
- (void) result;
-
- uint8_t itf = 0;
- vendord_interface_t* p_itf = _vendord_itf;
-
- for ( ; ; itf++, p_itf++)
- {
- if (itf >= TU_ARRAY_SIZE(_vendord_itf)) return false;
-
- if ( ( ep_addr == p_itf->ep_out ) || ( ep_addr == p_itf->ep_in ) ) break;
- }
-
- if ( ep_addr == p_itf->ep_out )
- {
- // Receive new data
- tu_fifo_write_n(&p_itf->rx_ff, p_itf->epout_buf, xferred_bytes);
-
- // Invoked callback if any
- if (tud_vendor_rx_cb) tud_vendor_rx_cb(itf);
-
- _prep_out_transaction(p_itf);
- }
- else if ( ep_addr == p_itf->ep_in )
- {
- // Send complete, try to send more if possible
- maybe_transmit(p_itf);
- }
-
- return true;
-}
-
-#endif
diff --git a/tinyusb/src/class/vendor/vendor_device.h b/tinyusb/src/class/vendor/vendor_device.h
deleted file mode 100755
index 844693c6..00000000
--- a/tinyusb/src/class/vendor/vendor_device.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_VENDOR_DEVICE_H_
-#define _TUSB_VENDOR_DEVICE_H_
-
-#include "common/tusb_common.h"
-
-#ifndef CFG_TUD_VENDOR_EPSIZE
-#define CFG_TUD_VENDOR_EPSIZE 64
-#endif
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Application API (Multiple Interfaces)
-//--------------------------------------------------------------------+
-bool tud_vendor_n_mounted (uint8_t itf);
-
-uint32_t tud_vendor_n_available (uint8_t itf);
-uint32_t tud_vendor_n_read (uint8_t itf, void* buffer, uint32_t bufsize);
-bool tud_vendor_n_peek (uint8_t itf, uint8_t* u8);
-void tud_vendor_n_read_flush (uint8_t itf);
-
-uint32_t tud_vendor_n_write (uint8_t itf, void const* buffer, uint32_t bufsize);
-uint32_t tud_vendor_n_write_available (uint8_t itf);
-
-static inline
-uint32_t tud_vendor_n_write_str (uint8_t itf, char const* str);
-
-//--------------------------------------------------------------------+
-// Application API (Single Port)
-//--------------------------------------------------------------------+
-static inline bool tud_vendor_mounted (void);
-static inline uint32_t tud_vendor_available (void);
-static inline uint32_t tud_vendor_read (void* buffer, uint32_t bufsize);
-static inline bool tud_vendor_peek (uint8_t* u8);
-static inline void tud_vendor_read_flush (void);
-static inline uint32_t tud_vendor_write (void const* buffer, uint32_t bufsize);
-static inline uint32_t tud_vendor_write_str (char const* str);
-static inline uint32_t tud_vendor_write_available (void);
-
-//--------------------------------------------------------------------+
-// Application Callback API (weak is optional)
-//--------------------------------------------------------------------+
-
-// Invoked when received new data
-TU_ATTR_WEAK void tud_vendor_rx_cb(uint8_t itf);
-
-//--------------------------------------------------------------------+
-// Inline Functions
-//--------------------------------------------------------------------+
-
-static inline uint32_t tud_vendor_n_write_str (uint8_t itf, char const* str)
-{
- return tud_vendor_n_write(itf, str, strlen(str));
-}
-
-static inline bool tud_vendor_mounted (void)
-{
- return tud_vendor_n_mounted(0);
-}
-
-static inline uint32_t tud_vendor_available (void)
-{
- return tud_vendor_n_available(0);
-}
-
-static inline uint32_t tud_vendor_read (void* buffer, uint32_t bufsize)
-{
- return tud_vendor_n_read(0, buffer, bufsize);
-}
-
-static inline bool tud_vendor_peek (uint8_t* u8)
-{
- return tud_vendor_n_peek(0, u8);
-}
-
-static inline void tud_vendor_read_flush(void)
-{
- tud_vendor_n_read_flush(0);
-}
-
-static inline uint32_t tud_vendor_write (void const* buffer, uint32_t bufsize)
-{
- return tud_vendor_n_write(0, buffer, bufsize);
-}
-
-static inline uint32_t tud_vendor_write_str (char const* str)
-{
- return tud_vendor_n_write_str(0, str);
-}
-
-static inline uint32_t tud_vendor_write_available (void)
-{
- return tud_vendor_n_write_available(0);
-}
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-void vendord_init(void);
-void vendord_reset(uint8_t rhport);
-uint16_t vendord_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
-bool vendord_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_VENDOR_DEVICE_H_ */
diff --git a/tinyusb/src/class/vendor/vendor_host.c b/tinyusb/src/class/vendor/vendor_host.c
deleted file mode 100755
index 1e28e9af..00000000
--- a/tinyusb/src/class/vendor/vendor_host.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_HOST_ENABLED && CFG_TUH_VENDOR)
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "host/usbh.h"
-#include "vendor_host.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-custom_interface_info_t custom_interface[CFG_TUH_DEVICE_MAX];
-
-static tusb_error_t cush_validate_paras(uint8_t dev_addr, uint16_t vendor_id, uint16_t product_id, void * p_buffer, uint16_t length)
-{
- if ( !tusbh_custom_is_mounted(dev_addr, vendor_id, product_id) )
- {
- return TUSB_ERROR_DEVICE_NOT_READY;
- }
-
- TU_ASSERT( p_buffer != NULL && length != 0, TUSB_ERROR_INVALID_PARA);
-
- return TUSB_ERROR_NONE;
-}
-//--------------------------------------------------------------------+
-// APPLICATION API (need to check parameters)
-//--------------------------------------------------------------------+
-tusb_error_t tusbh_custom_read(uint8_t dev_addr, uint16_t vendor_id, uint16_t product_id, void * p_buffer, uint16_t length)
-{
- TU_ASSERT_ERR( cush_validate_paras(dev_addr, vendor_id, product_id, p_buffer, length) );
-
- if ( !hcd_pipe_is_idle(custom_interface[dev_addr-1].pipe_in) )
- {
- return TUSB_ERROR_INTERFACE_IS_BUSY;
- }
-
- (void) usbh_edpt_xfer( custom_interface[dev_addr-1].pipe_in, p_buffer, length);
-
- return TUSB_ERROR_NONE;
-}
-
-tusb_error_t tusbh_custom_write(uint8_t dev_addr, uint16_t vendor_id, uint16_t product_id, void const * p_data, uint16_t length)
-{
- TU_ASSERT_ERR( cush_validate_paras(dev_addr, vendor_id, product_id, p_data, length) );
-
- if ( !hcd_pipe_is_idle(custom_interface[dev_addr-1].pipe_out) )
- {
- return TUSB_ERROR_INTERFACE_IS_BUSY;
- }
-
- (void) usbh_edpt_xfer( custom_interface[dev_addr-1].pipe_out, p_data, length);
-
- return TUSB_ERROR_NONE;
-}
-
-//--------------------------------------------------------------------+
-// USBH-CLASS API
-//--------------------------------------------------------------------+
-void cush_init(void)
-{
- tu_memclr(&custom_interface, sizeof(custom_interface_info_t) * CFG_TUH_DEVICE_MAX);
-}
-
-tusb_error_t cush_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length)
-{
- // FIXME quick hack to test lpc1k custom class with 2 bulk endpoints
- uint8_t const *p_desc = (uint8_t const *) p_interface_desc;
- p_desc = tu_desc_next(p_desc);
-
- //------------- Bulk Endpoints Descriptor -------------//
- for(uint32_t i=0; i<2; i++)
- {
- tusb_desc_endpoint_t const *p_endpoint = (tusb_desc_endpoint_t const *) p_desc;
- TU_ASSERT(TUSB_DESC_ENDPOINT == p_endpoint->bDescriptorType, TUSB_ERROR_INVALID_PARA);
-
- pipe_handle_t * p_pipe_hdl = ( p_endpoint->bEndpointAddress & TUSB_DIR_IN_MASK ) ?
- &custom_interface[dev_addr-1].pipe_in : &custom_interface[dev_addr-1].pipe_out;
- *p_pipe_hdl = usbh_edpt_open(dev_addr, p_endpoint, TUSB_CLASS_VENDOR_SPECIFIC);
- TU_ASSERT ( pipehandle_is_valid(*p_pipe_hdl), TUSB_ERROR_HCD_OPEN_PIPE_FAILED );
-
- p_desc = tu_desc_next(p_desc);
- }
-
- (*p_length) = sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t);
- return TUSB_ERROR_NONE;
-}
-
-void cush_isr(pipe_handle_t pipe_hdl, xfer_result_t event)
-{
-
-}
-
-void cush_close(uint8_t dev_addr)
-{
- tusb_error_t err1, err2;
- custom_interface_info_t * p_interface = &custom_interface[dev_addr-1];
-
- // TODO re-consider to check pipe valid before calling pipe_close
- if( pipehandle_is_valid( p_interface->pipe_in ) )
- {
- err1 = hcd_pipe_close( p_interface->pipe_in );
- }
-
- if ( pipehandle_is_valid( p_interface->pipe_out ) )
- {
- err2 = hcd_pipe_close( p_interface->pipe_out );
- }
-
- tu_memclr(p_interface, sizeof(custom_interface_info_t));
-
- TU_ASSERT(err1 == TUSB_ERROR_NONE && err2 == TUSB_ERROR_NONE, (void) 0 );
-}
-
-#endif
diff --git a/tinyusb/src/class/vendor/vendor_host.h b/tinyusb/src/class/vendor/vendor_host.h
deleted file mode 100755
index 07fa56c6..00000000
--- a/tinyusb/src/class/vendor/vendor_host.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_VENDOR_HOST_H_
-#define _TUSB_VENDOR_HOST_H_
-
-#include "common/tusb_common.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-typedef struct {
- pipe_handle_t pipe_in;
- pipe_handle_t pipe_out;
-}custom_interface_info_t;
-
-//--------------------------------------------------------------------+
-// USBH-CLASS DRIVER API
-//--------------------------------------------------------------------+
-static inline bool tusbh_custom_is_mounted(uint8_t dev_addr, uint16_t vendor_id, uint16_t product_id)
-{
- (void) vendor_id; // TODO check this later
- (void) product_id;
-// return (tusbh_device_get_mounted_class_flag(dev_addr) & TU_BIT(TUSB_CLASS_MAPPED_INDEX_END-1) ) != 0;
- return false;
-}
-
-tusb_error_t tusbh_custom_read(uint8_t dev_addr, uint16_t vendor_id, uint16_t product_id, void * p_buffer, uint16_t length);
-tusb_error_t tusbh_custom_write(uint8_t dev_addr, uint16_t vendor_id, uint16_t product_id, void const * p_data, uint16_t length);
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-void cush_init(void);
-tusb_error_t cush_open_subtask(uint8_t dev_addr, tusb_desc_interface_t const *p_interface_desc, uint16_t *p_length);
-void cush_isr(pipe_handle_t pipe_hdl, xfer_result_t event);
-void cush_close(uint8_t dev_addr);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_VENDOR_HOST_H_ */
diff --git a/tinyusb/src/common/tusb_common.h b/tinyusb/src/common/tusb_common.h
deleted file mode 100755
index c2356ffe..00000000
--- a/tinyusb/src/common/tusb_common.h
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_COMMON_H_
-#define _TUSB_COMMON_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Macros Helper
-//--------------------------------------------------------------------+
-#define TU_ARRAY_SIZE(_arr) ( sizeof(_arr) / sizeof(_arr[0]) )
-#define TU_MIN(_x, _y) ( ( (_x) < (_y) ) ? (_x) : (_y) )
-#define TU_MAX(_x, _y) ( ( (_x) > (_y) ) ? (_x) : (_y) )
-
-#define TU_U16_HIGH(u16) ((uint8_t) (((u16) >> 8) & 0x00ff))
-#define TU_U16_LOW(u16) ((uint8_t) ((u16) & 0x00ff))
-#define U16_TO_U8S_BE(u16) TU_U16_HIGH(u16), TU_U16_LOW(u16)
-#define U16_TO_U8S_LE(u16) TU_U16_LOW(u16), TU_U16_HIGH(u16)
-
-#define TU_U32_BYTE3(u32) ((uint8_t) ((((uint32_t) u32) >> 24) & 0x000000ff)) // MSB
-#define TU_U32_BYTE2(u32) ((uint8_t) ((((uint32_t) u32) >> 16) & 0x000000ff))
-#define TU_U32_BYTE1(u32) ((uint8_t) ((((uint32_t) u32) >> 8) & 0x000000ff))
-#define TU_U32_BYTE0(u32) ((uint8_t) (((uint32_t) u32) & 0x000000ff)) // LSB
-
-#define U32_TO_U8S_BE(u32) TU_U32_BYTE3(u32), TU_U32_BYTE2(u32), TU_U32_BYTE1(u32), TU_U32_BYTE0(u32)
-#define U32_TO_U8S_LE(u32) TU_U32_BYTE0(u32), TU_U32_BYTE1(u32), TU_U32_BYTE2(u32), TU_U32_BYTE3(u32)
-
-#define TU_BIT(n) (1UL << (n))
-
-//--------------------------------------------------------------------+
-// Includes
-//--------------------------------------------------------------------+
-
-// Standard Headers
-#include <stdbool.h>
-#include <stdint.h>
-#include <stddef.h>
-#include <string.h>
-#include <stdio.h>
-
-// Tinyusb Common Headers
-#include "tusb_option.h"
-#include "tusb_compiler.h"
-#include "tusb_verify.h"
-#include "tusb_types.h"
-
-#include "tusb_error.h" // TODO remove
-#include "tusb_timeout.h" // TODO remove
-
-//--------------------------------------------------------------------+
-// Internal Helper used by Host and Device Stack
-//--------------------------------------------------------------------+
-
-// Check if endpoint descriptor is valid per USB specs
-bool tu_edpt_validate(tusb_desc_endpoint_t const * desc_ep, tusb_speed_t speed);
-
-// Bind all endpoint of a interface descriptor to class driver
-void tu_edpt_bind_driver(uint8_t ep2drv[][2], tusb_desc_interface_t const* p_desc, uint16_t desc_len, uint8_t driver_id);
-
-// Calculate total length of n interfaces (depending on IAD)
-uint16_t tu_desc_get_interface_total_len(tusb_desc_interface_t const* desc_itf, uint8_t itf_count, uint16_t max_len);
-
-//--------------------------------------------------------------------+
-// Internal Inline Functions
-//--------------------------------------------------------------------+
-
-//------------- Mem -------------//
-#define tu_memclr(buffer, size) memset((buffer), 0, (size))
-#define tu_varclr(_var) tu_memclr(_var, sizeof(*(_var)))
-
-//------------- Bytes -------------//
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_u32(uint8_t b3, uint8_t b2, uint8_t b1, uint8_t b0)
-{
- return ( ((uint32_t) b3) << 24) | ( ((uint32_t) b2) << 16) | ( ((uint32_t) b1) << 8) | b0;
-}
-
-TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_u16(uint8_t high, uint8_t low)
-{
- return (uint16_t) ((((uint16_t) high) << 8) | low);
-}
-
-TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_u32_byte3(uint32_t u32) { return TU_U32_BYTE3(u32); }
-TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_u32_byte2(uint32_t u32) { return TU_U32_BYTE2(u32); }
-TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_u32_byte1(uint32_t u32) { return TU_U32_BYTE1(u32); }
-TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_u32_byte0(uint32_t u32) { return TU_U32_BYTE0(u32); }
-
-TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_u16_high(uint16_t u16) { return TU_U16_HIGH(u16); }
-TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_u16_low (uint16_t u16) { return TU_U16_LOW(u16); }
-
-//------------- Bits -------------//
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_bit_set (uint32_t value, uint8_t pos) { return value | TU_BIT(pos); }
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_bit_clear(uint32_t value, uint8_t pos) { return value & (~TU_BIT(pos)); }
-TU_ATTR_ALWAYS_INLINE static inline bool tu_bit_test (uint32_t value, uint8_t pos) { return (value & TU_BIT(pos)) ? true : false; }
-
-//------------- Min -------------//
-TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_min8 (uint8_t x, uint8_t y ) { return (x < y) ? x : y; }
-TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_min16 (uint16_t x, uint16_t y) { return (x < y) ? x : y; }
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_min32 (uint32_t x, uint32_t y) { return (x < y) ? x : y; }
-
-//------------- Max -------------//
-TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_max8 (uint8_t x, uint8_t y ) { return (x > y) ? x : y; }
-TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_max16 (uint16_t x, uint16_t y) { return (x > y) ? x : y; }
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_max32 (uint32_t x, uint32_t y) { return (x > y) ? x : y; }
-
-//------------- Align -------------//
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_align(uint32_t value, uint32_t alignment)
-{
- return value & ((uint32_t) ~(alignment-1));
-}
-
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_align16 (uint32_t value) { return (value & 0xFFFFFFF0UL); }
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_align32 (uint32_t value) { return (value & 0xFFFFFFE0UL); }
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_align4k (uint32_t value) { return (value & 0xFFFFF000UL); }
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_offset4k(uint32_t value) { return (value & 0xFFFUL); }
-
-//------------- Mathematics -------------//
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_div_ceil(uint32_t v, uint32_t d) { return (v + d -1)/d; }
-
-/// inclusive range checking TODO remove
-TU_ATTR_ALWAYS_INLINE static inline bool tu_within(uint32_t lower, uint32_t value, uint32_t upper)
-{
- return (lower <= value) && (value <= upper);
-}
-
-// log2 of a value is its MSB's position
-// TODO use clz TODO remove
-static inline uint8_t tu_log2(uint32_t value)
-{
- uint8_t result = 0;
- while (value >>= 1) { result++; }
- return result;
-}
-
-//------------- Unaligned Access -------------//
-#if TUP_ARCH_STRICT_ALIGN
-
-// Rely on compiler to generate correct code for unaligned access
-
-typedef struct { uint16_t val; } TU_ATTR_PACKED tu_unaligned_uint16_t;
-typedef struct { uint32_t val; } TU_ATTR_PACKED tu_unaligned_uint32_t;
-
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_unaligned_read32(const void* mem)
-{
- tu_unaligned_uint32_t const* ua32 = (tu_unaligned_uint32_t const*) mem;
- return ua32->val;
-}
-
-TU_ATTR_ALWAYS_INLINE static inline void tu_unaligned_write32(void* mem, uint32_t value)
-{
- tu_unaligned_uint32_t* ua32 = (tu_unaligned_uint32_t*) mem;
- ua32->val = value;
-}
-
-TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_unaligned_read16(const void* mem)
-{
- tu_unaligned_uint16_t const* ua16 = (tu_unaligned_uint16_t const*) mem;
- return ua16->val;
-}
-
-TU_ATTR_ALWAYS_INLINE static inline void tu_unaligned_write16(void* mem, uint16_t value)
-{
- tu_unaligned_uint16_t* ua16 = (tu_unaligned_uint16_t*) mem;
- ua16->val = value;
-}
-
-#elif TUP_MCU_STRICT_ALIGN
-
-// MCU such as LPC_IP3511 Highspeed cannot access unaligned memory on USB_RAM although it is ARM M4.
-// We have to manually pick up bytes since tu_unaligned_uint32_t will still generate unaligned code
-// NOTE: volatile cast to memory to prevent compiler to optimize and generate unaligned code
-// TODO Big Endian may need minor changes
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_unaligned_read32(const void* mem)
-{
- volatile uint8_t const* buf8 = (uint8_t const*) mem;
- return tu_u32(buf8[3], buf8[2], buf8[1], buf8[0]);
-}
-
-TU_ATTR_ALWAYS_INLINE static inline void tu_unaligned_write32(void* mem, uint32_t value)
-{
- volatile uint8_t* buf8 = (uint8_t*) mem;
- buf8[0] = tu_u32_byte0(value);
- buf8[1] = tu_u32_byte1(value);
- buf8[2] = tu_u32_byte2(value);
- buf8[3] = tu_u32_byte3(value);
-}
-
-TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_unaligned_read16(const void* mem)
-{
- volatile uint8_t const* buf8 = (uint8_t const*) mem;
- return tu_u16(buf8[1], buf8[0]);
-}
-
-TU_ATTR_ALWAYS_INLINE static inline void tu_unaligned_write16(void* mem, uint16_t value)
-{
- volatile uint8_t* buf8 = (uint8_t*) mem;
- buf8[0] = tu_u16_low(value);
- buf8[1] = tu_u16_high(value);
-}
-
-
-#else
-
-// MCU that could access unaligned memory natively
-TU_ATTR_ALWAYS_INLINE static inline uint32_t tu_unaligned_read32 (const void* mem ) { return *((uint32_t*) mem); }
-TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_unaligned_read16 (const void* mem ) { return *((uint16_t*) mem); }
-
-TU_ATTR_ALWAYS_INLINE static inline void tu_unaligned_write32 (void* mem, uint32_t value ) { *((uint32_t*) mem) = value; }
-TU_ATTR_ALWAYS_INLINE static inline void tu_unaligned_write16 (void* mem, uint16_t value ) { *((uint16_t*) mem) = value; }
-
-#endif
-
-/*------------------------------------------------------------------*/
-/* Count number of arguments of __VA_ARGS__
- * - reference https://groups.google.com/forum/#!topic/comp.std.c/d-6Mj5Lko_s
- * - _GET_NTH_ARG() takes args >= N (64) but only expand to Nth one (64th)
- * - _RSEQ_N() is reverse sequential to N to add padding to have
- * Nth position is the same as the number of arguments
- * - ##__VA_ARGS__ is used to deal with 0 paramerter (swallows comma)
- *------------------------------------------------------------------*/
-#ifndef TU_ARGS_NUM
-
-#define TU_ARGS_NUM(...) _TU_NARG(_0, ##__VA_ARGS__,_RSEQ_N())
-
-#define _TU_NARG(...) _GET_NTH_ARG(__VA_ARGS__)
-#define _GET_NTH_ARG( \
- _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,_63,N,...) N
-#define _RSEQ_N() \
- 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
-#endif
-
-// To be removed
-//------------- Binary constant -------------//
-#if defined(__GNUC__) && !defined(__CC_ARM)
-
-#define TU_BIN8(x) ((uint8_t) (0b##x))
-#define TU_BIN16(b1, b2) ((uint16_t) (0b##b1##b2))
-#define TU_BIN32(b1, b2, b3, b4) ((uint32_t) (0b##b1##b2##b3##b4))
-
-#else
-
-// internal macro of B8, B16, B32
-#define _B8__(x) (((x&0x0000000FUL)?1:0) \
- +((x&0x000000F0UL)?2:0) \
- +((x&0x00000F00UL)?4:0) \
- +((x&0x0000F000UL)?8:0) \
- +((x&0x000F0000UL)?16:0) \
- +((x&0x00F00000UL)?32:0) \
- +((x&0x0F000000UL)?64:0) \
- +((x&0xF0000000UL)?128:0))
-
-#define TU_BIN8(d) ((uint8_t) _B8__(0x##d##UL))
-#define TU_BIN16(dmsb,dlsb) (((uint16_t)TU_BIN8(dmsb)<<8) + TU_BIN8(dlsb))
-#define TU_BIN32(dmsb,db2,db3,dlsb) \
- (((uint32_t)TU_BIN8(dmsb)<<24) \
- + ((uint32_t)TU_BIN8(db2)<<16) \
- + ((uint32_t)TU_BIN8(db3)<<8) \
- + TU_BIN8(dlsb))
-#endif
-
-//--------------------------------------------------------------------+
-// Debug Function
-//--------------------------------------------------------------------+
-
-// CFG_TUSB_DEBUG for debugging
-// 0 : no debug
-// 1 : print error
-// 2 : print warning
-// 3 : print info
-#if CFG_TUSB_DEBUG
-
-void tu_print_mem(void const *buf, uint32_t count, uint8_t indent);
-
-#ifdef CFG_TUSB_DEBUG_PRINTF
- extern int CFG_TUSB_DEBUG_PRINTF(const char *format, ...);
- #define tu_printf CFG_TUSB_DEBUG_PRINTF
-#else
- #define tu_printf printf
-#endif
-
-static inline
-void tu_print_var(uint8_t const* buf, uint32_t bufsize)
-{
- for(uint32_t i=0; i<bufsize; i++) tu_printf("%02X ", buf[i]);
-}
-
-// Log with Level
-#define TU_LOG(n, ...) TU_XSTRCAT(TU_LOG, n)(__VA_ARGS__)
-#define TU_LOG_MEM(n, ...) TU_XSTRCAT3(TU_LOG, n, _MEM)(__VA_ARGS__)
-#define TU_LOG_VAR(n, ...) TU_XSTRCAT3(TU_LOG, n, _VAR)(__VA_ARGS__)
-#define TU_LOG_INT(n, ...) TU_XSTRCAT3(TU_LOG, n, _INT)(__VA_ARGS__)
-#define TU_LOG_HEX(n, ...) TU_XSTRCAT3(TU_LOG, n, _HEX)(__VA_ARGS__)
-#define TU_LOG_LOCATION() tu_printf("%s: %d:\r\n", __PRETTY_FUNCTION__, __LINE__)
-#define TU_LOG_FAILED() tu_printf("%s: %d: Failed\r\n", __PRETTY_FUNCTION__, __LINE__)
-
-// Log Level 1: Error
-#define TU_LOG1 tu_printf
-#define TU_LOG1_MEM tu_print_mem
-#define TU_LOG1_VAR(_x) tu_print_var((uint8_t const*)(_x), sizeof(*(_x)))
-#define TU_LOG1_INT(_x) tu_printf(#_x " = %ld\r\n", (uint32_t) (_x) )
-#define TU_LOG1_HEX(_x) tu_printf(#_x " = %lX\r\n", (uint32_t) (_x) )
-
-// Log Level 2: Warn
-#if CFG_TUSB_DEBUG >= 2
- #define TU_LOG2 TU_LOG1
- #define TU_LOG2_MEM TU_LOG1_MEM
- #define TU_LOG2_VAR TU_LOG1_VAR
- #define TU_LOG2_INT TU_LOG1_INT
- #define TU_LOG2_HEX TU_LOG1_HEX
-#endif
-
-// Log Level 3: Info
-#if CFG_TUSB_DEBUG >= 3
- #define TU_LOG3 TU_LOG1
- #define TU_LOG3_MEM TU_LOG1_MEM
- #define TU_LOG3_VAR TU_LOG1_VAR
- #define TU_LOG3_INT TU_LOG1_INT
- #define TU_LOG3_HEX TU_LOG1_HEX
-#endif
-
-typedef struct
-{
- uint32_t key;
- const char* data;
-} tu_lookup_entry_t;
-
-typedef struct
-{
- uint16_t count;
- tu_lookup_entry_t const* items;
-} tu_lookup_table_t;
-
-static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint32_t key)
-{
- for(uint16_t i=0; i<p_table->count; i++)
- {
- if (p_table->items[i].key == key) return p_table->items[i].data;
- }
-
- return NULL;
-}
-
-#endif // CFG_TUSB_DEBUG
-
-#ifndef TU_LOG
-#define TU_LOG(n, ...)
-#define TU_LOG_MEM(n, ...)
-#define TU_LOG_VAR(n, ...)
-#define TU_LOG_INT(n, ...)
-#define TU_LOG_HEX(n, ...)
-#define TU_LOG_LOCATION()
-#define TU_LOG_FAILED()
-#endif
-
-// TODO replace all TU_LOGn with TU_LOG(n)
-
-#define TU_LOG0(...)
-#define TU_LOG0_MEM(...)
-#define TU_LOG0_VAR(...)
-#define TU_LOG0_INT(...)
-#define TU_LOG0_HEX(...)
-
-
-#ifndef TU_LOG1
- #define TU_LOG1(...)
- #define TU_LOG1_MEM(...)
- #define TU_LOG1_VAR(...)
- #define TU_LOG1_INT(...)
- #define TU_LOG1_HEX(...)
-#endif
-
-#ifndef TU_LOG2
- #define TU_LOG2(...)
- #define TU_LOG2_MEM(...)
- #define TU_LOG2_VAR(...)
- #define TU_LOG2_INT(...)
- #define TU_LOG2_HEX(...)
-#endif
-
-#ifndef TU_LOG3
- #define TU_LOG3(...)
- #define TU_LOG3_MEM(...)
- #define TU_LOG3_VAR(...)
- #define TU_LOG3_INT(...)
- #define TU_LOG3_HEX(...)
-#endif
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_COMMON_H_ */
diff --git a/tinyusb/src/common/tusb_compiler.h b/tinyusb/src/common/tusb_compiler.h
deleted file mode 100755
index d3adbbc2..00000000
--- a/tinyusb/src/common/tusb_compiler.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup Group_Common
- * \defgroup Group_Compiler Compiler
- * \brief Group_Compiler brief
- * @{ */
-
-#ifndef _TUSB_COMPILER_H_
-#define _TUSB_COMPILER_H_
-
-#define TU_STRING(x) #x ///< stringify without expand
-#define TU_XSTRING(x) TU_STRING(x) ///< expand then stringify
-
-#define TU_STRCAT(a, b) a##b ///< concat without expand
-#define TU_STRCAT3(a, b, c) a##b##c ///< concat without expand
-
-#define TU_XSTRCAT(a, b) TU_STRCAT(a, b) ///< expand then concat
-#define TU_XSTRCAT3(a, b, c) TU_STRCAT3(a, b, c) ///< expand then concat 3 tokens
-
-#if defined __COUNTER__ && __COUNTER__ != __COUNTER__
- #define _TU_COUNTER_ __COUNTER__
-#else
- #define _TU_COUNTER_ __LINE__
-#endif
-
-// Compile-time Assert
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
- #define TU_VERIFY_STATIC _Static_assert
-#elif defined (__cplusplus) && __cplusplus >= 201103L
- #define TU_VERIFY_STATIC static_assert
-#elif defined(__CCRX__)
- #define TU_VERIFY_STATIC(const_expr, _mess) typedef char TU_XSTRCAT(Line, __LINE__)[(const_expr) ? 1 : 0];
-#else
- #define TU_VERIFY_STATIC(const_expr, _mess) enum { TU_XSTRCAT(_verify_static_, _TU_COUNTER_) = 1/(!!(const_expr)) }
-#endif
-
-// for declaration of reserved field, make use of _TU_COUNTER_
-#define TU_RESERVED TU_XSTRCAT(reserved, _TU_COUNTER_)
-
-#define TU_LITTLE_ENDIAN (0x12u)
-#define TU_BIG_ENDIAN (0x21u)
-
-//--------------------------------------------------------------------+
-// Compiler porting with Attribute and Endian
-//--------------------------------------------------------------------+
-
-// TODO refactor since __attribute__ is supported across many compiler
-#if defined(__GNUC__)
- #define TU_ATTR_ALIGNED(Bytes) __attribute__ ((aligned(Bytes)))
- #define TU_ATTR_SECTION(sec_name) __attribute__ ((section(#sec_name)))
- #define TU_ATTR_PACKED __attribute__ ((packed))
- #define TU_ATTR_WEAK __attribute__ ((weak))
- #define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
- #define TU_ATTR_DEPRECATED(mess) __attribute__ ((deprecated(mess))) // warn if function with this attribute is used
- #define TU_ATTR_UNUSED __attribute__ ((unused)) // Function/Variable is meant to be possibly unused
- #define TU_ATTR_USED __attribute__ ((used)) // Function/Variable is meant to be used
-
- #define TU_ATTR_PACKED_BEGIN
- #define TU_ATTR_PACKED_END
- #define TU_ATTR_BIT_FIELD_ORDER_BEGIN
- #define TU_ATTR_BIT_FIELD_ORDER_END
-
- // Endian conversion use well-known host to network (big endian) naming
- #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define TU_BYTE_ORDER TU_LITTLE_ENDIAN
- #else
- #define TU_BYTE_ORDER TU_BIG_ENDIAN
- #endif
-
- #define TU_BSWAP16(u16) (__builtin_bswap16(u16))
- #define TU_BSWAP32(u32) (__builtin_bswap32(u32))
-
- // List of obsolete callback function that is renamed and should not be defined.
- // Put it here since only gcc support this pragma
- #pragma GCC poison tud_vendor_control_request_cb
-
-#elif defined(__TI_COMPILER_VERSION__)
- #define TU_ATTR_ALIGNED(Bytes) __attribute__ ((aligned(Bytes)))
- #define TU_ATTR_SECTION(sec_name) __attribute__ ((section(#sec_name)))
- #define TU_ATTR_PACKED __attribute__ ((packed))
- #define TU_ATTR_WEAK __attribute__ ((weak))
- #define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
- #define TU_ATTR_DEPRECATED(mess) __attribute__ ((deprecated(mess))) // warn if function with this attribute is used
- #define TU_ATTR_UNUSED __attribute__ ((unused)) // Function/Variable is meant to be possibly unused
- #define TU_ATTR_USED __attribute__ ((used))
-
- #define TU_ATTR_PACKED_BEGIN
- #define TU_ATTR_PACKED_END
- #define TU_ATTR_BIT_FIELD_ORDER_BEGIN
- #define TU_ATTR_BIT_FIELD_ORDER_END
-
- // __BYTE_ORDER is defined in the TI ARM compiler, but not MSP430 (which is little endian)
- #if ((__BYTE_ORDER__) == (__ORDER_LITTLE_ENDIAN__)) || defined(__MSP430__)
- #define TU_BYTE_ORDER TU_LITTLE_ENDIAN
- #else
- #define TU_BYTE_ORDER TU_BIG_ENDIAN
- #endif
-
- #define TU_BSWAP16(u16) (__builtin_bswap16(u16))
- #define TU_BSWAP32(u32) (__builtin_bswap32(u32))
-
-#elif defined(__ICCARM__)
- #include <intrinsics.h>
- #define TU_ATTR_ALIGNED(Bytes) __attribute__ ((aligned(Bytes)))
- #define TU_ATTR_SECTION(sec_name) __attribute__ ((section(#sec_name)))
- #define TU_ATTR_PACKED __attribute__ ((packed))
- #define TU_ATTR_WEAK __attribute__ ((weak))
- #define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
- #define TU_ATTR_DEPRECATED(mess) __attribute__ ((deprecated(mess))) // warn if function with this attribute is used
- #define TU_ATTR_UNUSED __attribute__ ((unused)) // Function/Variable is meant to be possibly unused
- #define TU_ATTR_USED __attribute__ ((used)) // Function/Variable is meant to be used
-
- #define TU_ATTR_PACKED_BEGIN
- #define TU_ATTR_PACKED_END
- #define TU_ATTR_BIT_FIELD_ORDER_BEGIN
- #define TU_ATTR_BIT_FIELD_ORDER_END
-
- // Endian conversion use well-known host to network (big endian) naming
- #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define TU_BYTE_ORDER TU_LITTLE_ENDIAN
- #else
- #define TU_BYTE_ORDER TU_BIG_ENDIAN
- #endif
-
- #define TU_BSWAP16(u16) (__iar_builtin_REV16(u16))
- #define TU_BSWAP32(u32) (__iar_builtin_REV(u32))
-
-#elif defined(__CCRX__)
- #define TU_ATTR_ALIGNED(Bytes)
- #define TU_ATTR_SECTION(sec_name)
- #define TU_ATTR_PACKED
- #define TU_ATTR_WEAK
- #define TU_ATTR_ALWAYS_INLINE
- #define TU_ATTR_DEPRECATED(mess)
- #define TU_ATTR_UNUSED
- #define TU_ATTR_USED
-
- #define TU_ATTR_PACKED_BEGIN _Pragma("pack")
- #define TU_ATTR_PACKED_END _Pragma("packoption")
- #define TU_ATTR_BIT_FIELD_ORDER_BEGIN _Pragma("bit_order right")
- #define TU_ATTR_BIT_FIELD_ORDER_END _Pragma("bit_order")
-
- // Endian conversion use well-known host to network (big endian) naming
- #if defined(__LIT)
- #define TU_BYTE_ORDER TU_LITTLE_ENDIAN
- #else
- #define TU_BYTE_ORDER TU_BIG_ENDIAN
- #endif
-
- #define TU_BSWAP16(u16) ((unsigned short)_builtin_revw((unsigned long)u16))
- #define TU_BSWAP32(u32) (_builtin_revl(u32))
-
-#else
- #error "Compiler attribute porting is required"
-#endif
-
-#if (TU_BYTE_ORDER == TU_LITTLE_ENDIAN)
-
- #define tu_htons(u16) (TU_BSWAP16(u16))
- #define tu_ntohs(u16) (TU_BSWAP16(u16))
-
- #define tu_htonl(u32) (TU_BSWAP32(u32))
- #define tu_ntohl(u32) (TU_BSWAP32(u32))
-
- #define tu_htole16(u16) (u16)
- #define tu_le16toh(u16) (u16)
-
- #define tu_htole32(u32) (u32)
- #define tu_le32toh(u32) (u32)
-
-#elif (TU_BYTE_ORDER == TU_BIG_ENDIAN)
-
- #define tu_htons(u16) (u16)
- #define tu_ntohs(u16) (u16)
-
- #define tu_htonl(u32) (u32)
- #define tu_ntohl(u32) (u32)
-
- #define tu_htole16(u16) (TU_BSWAP16(u16))
- #define tu_le16toh(u16) (TU_BSWAP16(u16))
-
- #define tu_htole32(u32) (TU_BSWAP32(u32))
- #define tu_le32toh(u32) (TU_BSWAP32(u32))
-
-#else
- #error Byte order is undefined
-#endif
-
-#endif /* _TUSB_COMPILER_H_ */
-
-/// @}
diff --git a/tinyusb/src/common/tusb_error.h b/tinyusb/src/common/tusb_error.h
deleted file mode 100755
index d7ad8c31..00000000
--- a/tinyusb/src/common/tusb_error.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup Group_Common
- * \defgroup Group_Error Error Codes
- * @{ */
-
-#ifndef _TUSB_ERRORS_H_
-#define _TUSB_ERRORS_H_
-
-#include "tusb_option.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define ERROR_ENUM(x) x,
-#define ERROR_STRING(x) #x,
-
-#define ERROR_TABLE(ENTRY) \
- ENTRY(TUSB_ERROR_NONE )\
- ENTRY(TUSB_ERROR_INVALID_PARA )\
- ENTRY(TUSB_ERROR_DEVICE_NOT_READY )\
- ENTRY(TUSB_ERROR_INTERFACE_IS_BUSY )\
- ENTRY(TUSB_ERROR_HCD_OPEN_PIPE_FAILED )\
- ENTRY(TUSB_ERROR_OSAL_TIMEOUT )\
- ENTRY(TUSB_ERROR_CDCH_DEVICE_NOT_MOUNTED )\
- ENTRY(TUSB_ERROR_MSCH_DEVICE_NOT_MOUNTED )\
- ENTRY(TUSB_ERROR_NOT_SUPPORTED )\
- ENTRY(TUSB_ERROR_NOT_ENOUGH_MEMORY )\
- ENTRY(TUSB_ERROR_FAILED )\
-
-/// \brief Error Code returned
-/// TODO obsolete and to be remove
-typedef enum
-{
- ERROR_TABLE(ERROR_ENUM)
- TUSB_ERROR_COUNT
-}tusb_error_t;
-
-#if CFG_TUSB_DEBUG
-/// Enum to String for debugging purposes. Only available if \ref CFG_TUSB_DEBUG > 0
-extern char const* const tusb_strerr[TUSB_ERROR_COUNT];
-#endif
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_ERRORS_H_ */
-
-/** @} */
diff --git a/tinyusb/src/common/tusb_fifo.c b/tinyusb/src/common/tusb_fifo.c
deleted file mode 100755
index 11b8fc5f..00000000
--- a/tinyusb/src/common/tusb_fifo.c
+++ /dev/null
@@ -1,1000 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- * Copyright (c) 2020 Reinhard Panhuber - rework to unmasked pointers
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "osal/osal.h"
-#include "tusb_fifo.h"
-
-// Supress IAR warning
-// Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement
-#if defined(__ICCARM__)
-#pragma diag_suppress = Pa082
-#endif
-
-// implement mutex lock and unlock
-#if CFG_FIFO_MUTEX
-
-static inline void _ff_lock(tu_fifo_mutex_t mutex)
-{
- if (mutex) osal_mutex_lock(mutex, OSAL_TIMEOUT_WAIT_FOREVER);
-}
-
-static inline void _ff_unlock(tu_fifo_mutex_t mutex)
-{
- if (mutex) osal_mutex_unlock(mutex);
-}
-
-#else
-
-#define _ff_lock(_mutex)
-#define _ff_unlock(_mutex)
-
-#endif
-
-/** \enum tu_fifo_copy_mode_t
- * \brief Write modes intended to allow special read and write functions to be able to
- * copy data to and from USB hardware FIFOs as needed for e.g. STM32s and others
- */
-typedef enum
-{
- TU_FIFO_COPY_INC, ///< Copy from/to an increasing source/destination address - default mode
- TU_FIFO_COPY_CST_FULL_WORDS, ///< Copy from/to a constant source/destination address - required for e.g. STM32 to write into USB hardware FIFO
-} tu_fifo_copy_mode_t;
-
-bool tu_fifo_config(tu_fifo_t *f, void* buffer, uint16_t depth, uint16_t item_size, bool overwritable)
-{
- if (depth > 0x8000) return false; // Maximum depth is 2^15 items
-
- _ff_lock(f->mutex_wr);
- _ff_lock(f->mutex_rd);
-
- f->buffer = (uint8_t*) buffer;
- f->depth = depth;
- f->item_size = item_size;
- f->overwritable = overwritable;
-
- // Limit index space to 2*depth - this allows for a fast "modulo" calculation
- // but limits the maximum depth to 2^16/2 = 2^15 and buffer overflows are detectable
- // only if overflow happens once (important for unsupervised DMA applications)
- f->max_pointer_idx = 2*depth - 1;
- f->non_used_index_space = UINT16_MAX - f->max_pointer_idx;
-
- f->rd_idx = f->wr_idx = 0;
-
- _ff_unlock(f->mutex_wr);
- _ff_unlock(f->mutex_rd);
-
- return true;
-}
-
-// Static functions are intended to work on local variables
-static inline uint16_t _ff_mod(uint16_t idx, uint16_t depth)
-{
- while ( idx >= depth) idx -= depth;
- return idx;
-}
-
-// Intended to be used to read from hardware USB FIFO in e.g. STM32 where all data is read from a constant address
-// Code adapted from dcd_synopsis.c
-// TODO generalize with configurable 1 byte or 4 byte each read
-static void _ff_push_const_addr(uint8_t * ff_buf, const void * app_buf, uint16_t len)
-{
- volatile uint32_t * rx_fifo = (volatile uint32_t *) app_buf;
-
- // Reading full available 32 bit words from const app address
- uint16_t full_words = len >> 2;
- while(full_words--)
- {
- tu_unaligned_write32(ff_buf, *rx_fifo);
- ff_buf += 4;
- }
-
- // Read the remaining 1-3 bytes from const app address
- uint8_t const bytes_rem = len & 0x03;
- if ( bytes_rem )
- {
- uint32_t tmp32 = *rx_fifo;
- memcpy(ff_buf, &tmp32, bytes_rem);
- }
-}
-
-// Intended to be used to write to hardware USB FIFO in e.g. STM32
-// where all data is written to a constant address in full word copies
-static void _ff_pull_const_addr(void * app_buf, const uint8_t * ff_buf, uint16_t len)
-{
- volatile uint32_t * tx_fifo = (volatile uint32_t *) app_buf;
-
- // Pushing full available 32 bit words to const app address
- uint16_t full_words = len >> 2;
- while(full_words--)
- {
- *tx_fifo = tu_unaligned_read32(ff_buf);
- ff_buf += 4;
- }
-
- // Write the remaining 1-3 bytes into const app address
- uint8_t const bytes_rem = len & 0x03;
- if ( bytes_rem )
- {
- uint32_t tmp32 = 0;
- memcpy(&tmp32, ff_buf, bytes_rem);
-
- *tx_fifo = tmp32;
- }
-}
-
-// send one item to FIFO WITHOUT updating write pointer
-static inline void _ff_push(tu_fifo_t* f, void const * app_buf, uint16_t rel)
-{
- memcpy(f->buffer + (rel * f->item_size), app_buf, f->item_size);
-}
-
-// send n items to FIFO WITHOUT updating write pointer
-static void _ff_push_n(tu_fifo_t* f, void const * app_buf, uint16_t n, uint16_t rel, tu_fifo_copy_mode_t copy_mode)
-{
- uint16_t const nLin = f->depth - rel;
- uint16_t const nWrap = n - nLin;
-
- uint16_t nLin_bytes = nLin * f->item_size;
- uint16_t nWrap_bytes = nWrap * f->item_size;
-
- // current buffer of fifo
- uint8_t* ff_buf = f->buffer + (rel * f->item_size);
-
- switch (copy_mode)
- {
- case TU_FIFO_COPY_INC:
- if(n <= nLin)
- {
- // Linear only
- memcpy(ff_buf, app_buf, n*f->item_size);
- }
- else
- {
- // Wrap around
-
- // Write data to linear part of buffer
- memcpy(ff_buf, app_buf, nLin_bytes);
-
- // Write data wrapped around
- memcpy(f->buffer, ((uint8_t const*) app_buf) + nLin_bytes, nWrap_bytes);
- }
- break;
-
- case TU_FIFO_COPY_CST_FULL_WORDS:
- // Intended for hardware buffers from which it can be read word by word only
- if(n <= nLin)
- {
- // Linear only
- _ff_push_const_addr(ff_buf, app_buf, n*f->item_size);
- }
- else
- {
- // Wrap around case
-
- // Write full words to linear part of buffer
- uint16_t nLin_4n_bytes = nLin_bytes & 0xFFFC;
- _ff_push_const_addr(ff_buf, app_buf, nLin_4n_bytes);
- ff_buf += nLin_4n_bytes;
-
- // There could be odd 1-3 bytes before the wrap-around boundary
- volatile uint32_t * rx_fifo = (volatile uint32_t *) app_buf;
- uint8_t rem = nLin_bytes & 0x03;
- if (rem > 0)
- {
- uint8_t remrem = tu_min16(nWrap_bytes, 4-rem);
- nWrap_bytes -= remrem;
-
- uint32_t tmp32 = *rx_fifo;
- uint8_t * src_u8 = ((uint8_t *) &tmp32);
-
- // Write 1-3 bytes before wrapped boundary
- while(rem--) *ff_buf++ = *src_u8++;
-
- // Read more bytes to beginning to complete a word
- ff_buf = f->buffer;
- while(remrem--) *ff_buf++ = *src_u8++;
- }
- else
- {
- ff_buf = f->buffer; // wrap around to beginning
- }
-
- // Write data wrapped part
- if (nWrap_bytes > 0) _ff_push_const_addr(ff_buf, app_buf, nWrap_bytes);
- }
- break;
- }
-}
-
-// get one item from FIFO WITHOUT updating read pointer
-static inline void _ff_pull(tu_fifo_t* f, void * app_buf, uint16_t rel)
-{
- memcpy(app_buf, f->buffer + (rel * f->item_size), f->item_size);
-}
-
-// get n items from FIFO WITHOUT updating read pointer
-static void _ff_pull_n(tu_fifo_t* f, void* app_buf, uint16_t n, uint16_t rel, tu_fifo_copy_mode_t copy_mode)
-{
- uint16_t const nLin = f->depth - rel;
- uint16_t const nWrap = n - nLin; // only used if wrapped
-
- uint16_t nLin_bytes = nLin * f->item_size;
- uint16_t nWrap_bytes = nWrap * f->item_size;
-
- // current buffer of fifo
- uint8_t* ff_buf = f->buffer + (rel * f->item_size);
-
- switch (copy_mode)
- {
- case TU_FIFO_COPY_INC:
- if ( n <= nLin )
- {
- // Linear only
- memcpy(app_buf, ff_buf, n*f->item_size);
- }
- else
- {
- // Wrap around
-
- // Read data from linear part of buffer
- memcpy(app_buf, ff_buf, nLin_bytes);
-
- // Read data wrapped part
- memcpy((uint8_t*) app_buf + nLin_bytes, f->buffer, nWrap_bytes);
- }
- break;
-
- case TU_FIFO_COPY_CST_FULL_WORDS:
- if ( n <= nLin )
- {
- // Linear only
- _ff_pull_const_addr(app_buf, ff_buf, n*f->item_size);
- }
- else
- {
- // Wrap around case
-
- // Read full words from linear part of buffer
- uint16_t nLin_4n_bytes = nLin_bytes & 0xFFFC;
- _ff_pull_const_addr(app_buf, ff_buf, nLin_4n_bytes);
- ff_buf += nLin_4n_bytes;
-
- // There could be odd 1-3 bytes before the wrap-around boundary
- volatile uint32_t * tx_fifo = (volatile uint32_t *) app_buf;
- uint8_t rem = nLin_bytes & 0x03;
- if (rem > 0)
- {
- uint8_t remrem = tu_min16(nWrap_bytes, 4-rem);
- nWrap_bytes -= remrem;
-
- uint32_t tmp32=0;
- uint8_t * dst_u8 = (uint8_t *)&tmp32;
-
- // Read 1-3 bytes before wrapped boundary
- while(rem--) *dst_u8++ = *ff_buf++;
-
- // Read more bytes from beginning to complete a word
- ff_buf = f->buffer;
- while(remrem--) *dst_u8++ = *ff_buf++;
-
- *tx_fifo = tmp32;
- }
- else
- {
- ff_buf = f->buffer; // wrap around to beginning
- }
-
- // Read data wrapped part
- if (nWrap_bytes > 0) _ff_pull_const_addr(app_buf, ff_buf, nWrap_bytes);
- }
- break;
-
- default: break;
- }
-}
-
-// Advance an absolute pointer
-static uint16_t advance_pointer(tu_fifo_t* f, uint16_t p, uint16_t offset)
-{
- // We limit the index space of p such that a correct wrap around happens
- // Check for a wrap around or if we are in unused index space - This has to be checked first!!
- // We are exploiting the wrap around to the correct index
- if ((p > (uint16_t)(p + offset)) || ((uint16_t)(p + offset) > f->max_pointer_idx))
- {
- p = (p + offset) + f->non_used_index_space;
- }
- else
- {
- p += offset;
- }
- return p;
-}
-
-// Backward an absolute pointer
-static uint16_t backward_pointer(tu_fifo_t* f, uint16_t p, uint16_t offset)
-{
- // We limit the index space of p such that a correct wrap around happens
- // Check for a wrap around or if we are in unused index space - This has to be checked first!!
- // We are exploiting the wrap around to the correct index
- if ((p < (uint16_t)(p - offset)) || ((uint16_t)(p - offset) > f->max_pointer_idx))
- {
- p = (p - offset) - f->non_used_index_space;
- }
- else
- {
- p -= offset;
- }
- return p;
-}
-
-// get relative from absolute pointer
-static uint16_t get_relative_pointer(tu_fifo_t* f, uint16_t p)
-{
- return _ff_mod(p, f->depth);
-}
-
-// Works on local copies of w and r - return only the difference and as such can be used to determine an overflow
-static inline uint16_t _tu_fifo_count(tu_fifo_t* f, uint16_t wAbs, uint16_t rAbs)
-{
- uint16_t cnt = wAbs-rAbs;
-
- // In case we have non-power of two depth we need a further modification
- if (rAbs > wAbs) cnt -= f->non_used_index_space;
-
- return cnt;
-}
-
-// Works on local copies of w and r
-static inline bool _tu_fifo_empty(uint16_t wAbs, uint16_t rAbs)
-{
- return wAbs == rAbs;
-}
-
-// Works on local copies of w and r
-static inline bool _tu_fifo_full(tu_fifo_t* f, uint16_t wAbs, uint16_t rAbs)
-{
- return (_tu_fifo_count(f, wAbs, rAbs) == f->depth);
-}
-
-// Works on local copies of w and r
-// BE AWARE - THIS FUNCTION MIGHT NOT GIVE A CORRECT ANSWERE IN CASE WRITE POINTER "OVERFLOWS"
-// Only one overflow is allowed for this function to work e.g. if depth = 100, you must not
-// write more than 2*depth-1 items in one rush without updating write pointer. Otherwise
-// write pointer wraps and you pointer states are messed up. This can only happen if you
-// use DMAs, write functions do not allow such an error.
-static inline bool _tu_fifo_overflowed(tu_fifo_t* f, uint16_t wAbs, uint16_t rAbs)
-{
- return (_tu_fifo_count(f, wAbs, rAbs) > f->depth);
-}
-
-// Works on local copies of w
-// For more details see _tu_fifo_overflow()!
-static inline void _tu_fifo_correct_read_pointer(tu_fifo_t* f, uint16_t wAbs)
-{
- f->rd_idx = backward_pointer(f, wAbs, f->depth);
-}
-
-// Works on local copies of w and r
-// Must be protected by mutexes since in case of an overflow read pointer gets modified
-static bool _tu_fifo_peek(tu_fifo_t* f, void * p_buffer, uint16_t wAbs, uint16_t rAbs)
-{
- uint16_t cnt = _tu_fifo_count(f, wAbs, rAbs);
-
- // Check overflow and correct if required
- if (cnt > f->depth)
- {
- _tu_fifo_correct_read_pointer(f, wAbs);
- cnt = f->depth;
- }
-
- // Skip beginning of buffer
- if (cnt == 0) return false;
-
- uint16_t rRel = get_relative_pointer(f, rAbs);
-
- // Peek data
- _ff_pull(f, p_buffer, rRel);
-
- return true;
-}
-
-// Works on local copies of w and r
-// Must be protected by mutexes since in case of an overflow read pointer gets modified
-static uint16_t _tu_fifo_peek_n(tu_fifo_t* f, void * p_buffer, uint16_t n, uint16_t wAbs, uint16_t rAbs, tu_fifo_copy_mode_t copy_mode)
-{
- uint16_t cnt = _tu_fifo_count(f, wAbs, rAbs);
-
- // Check overflow and correct if required
- if (cnt > f->depth)
- {
- _tu_fifo_correct_read_pointer(f, wAbs);
- rAbs = f->rd_idx;
- cnt = f->depth;
- }
-
- // Skip beginning of buffer
- if (cnt == 0) return 0;
-
- // Check if we can read something at and after offset - if too less is available we read what remains
- if (cnt < n) n = cnt;
-
- uint16_t rRel = get_relative_pointer(f, rAbs);
-
- // Peek data
- _ff_pull_n(f, p_buffer, n, rRel, copy_mode);
-
- return n;
-}
-
-// Works on local copies of w and r
-static inline uint16_t _tu_fifo_remaining(tu_fifo_t* f, uint16_t wAbs, uint16_t rAbs)
-{
- return f->depth - _tu_fifo_count(f, wAbs, rAbs);
-}
-
-static uint16_t _tu_fifo_write_n(tu_fifo_t* f, const void * data, uint16_t n, tu_fifo_copy_mode_t copy_mode)
-{
- if ( n == 0 ) return 0;
-
- _ff_lock(f->mutex_wr);
-
- uint16_t w = f->wr_idx, r = f->rd_idx;
- uint8_t const* buf8 = (uint8_t const*) data;
-
- if (!f->overwritable)
- {
- // Not overwritable limit up to full
- n = tu_min16(n, _tu_fifo_remaining(f, w, r));
- }
- else if (n >= f->depth)
- {
- // Only copy last part
- buf8 = buf8 + (n - f->depth) * f->item_size;
- n = f->depth;
-
- // We start writing at the read pointer's position since we fill the complete
- // buffer and we do not want to modify the read pointer within a write function!
- // This would end up in a race condition with read functions!
- w = r;
- }
-
- uint16_t wRel = get_relative_pointer(f, w);
-
- // Write data
- _ff_push_n(f, buf8, n, wRel, copy_mode);
-
- // Advance pointer
- f->wr_idx = advance_pointer(f, w, n);
-
- _ff_unlock(f->mutex_wr);
-
- return n;
-}
-
-static uint16_t _tu_fifo_read_n(tu_fifo_t* f, void * buffer, uint16_t n, tu_fifo_copy_mode_t copy_mode)
-{
- _ff_lock(f->mutex_rd);
-
- // Peek the data
- // f->rd_idx might get modified in case of an overflow so we can not use a local variable
- n = _tu_fifo_peek_n(f, buffer, n, f->wr_idx, f->rd_idx, copy_mode);
-
- // Advance read pointer
- f->rd_idx = advance_pointer(f, f->rd_idx, n);
-
- _ff_unlock(f->mutex_rd);
- return n;
-}
-
-/******************************************************************************/
-/*!
- @brief Get number of items in FIFO.
-
- As this function only reads the read and write pointers once, this function is
- reentrant and thus thread and ISR save without any mutexes. In case an
- overflow occurred, this function return f.depth at maximum. Overflows are
- checked and corrected for in the read functions!
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
-
- @returns Number of items in FIFO
- */
-/******************************************************************************/
-uint16_t tu_fifo_count(tu_fifo_t* f)
-{
- return tu_min16(_tu_fifo_count(f, f->wr_idx, f->rd_idx), f->depth);
-}
-
-/******************************************************************************/
-/*!
- @brief Check if FIFO is empty.
-
- As this function only reads the read and write pointers once, this function is
- reentrant and thus thread and ISR save without any mutexes.
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
-
- @returns Number of items in FIFO
- */
-/******************************************************************************/
-bool tu_fifo_empty(tu_fifo_t* f)
-{
- return _tu_fifo_empty(f->wr_idx, f->rd_idx);
-}
-
-/******************************************************************************/
-/*!
- @brief Check if FIFO is full.
-
- As this function only reads the read and write pointers once, this function is
- reentrant and thus thread and ISR save without any mutexes.
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
-
- @returns Number of items in FIFO
- */
-/******************************************************************************/
-bool tu_fifo_full(tu_fifo_t* f)
-{
- return _tu_fifo_full(f, f->wr_idx, f->rd_idx);
-}
-
-/******************************************************************************/
-/*!
- @brief Get remaining space in FIFO.
-
- As this function only reads the read and write pointers once, this function is
- reentrant and thus thread and ISR save without any mutexes.
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
-
- @returns Number of items in FIFO
- */
-/******************************************************************************/
-uint16_t tu_fifo_remaining(tu_fifo_t* f)
-{
- return _tu_fifo_remaining(f, f->wr_idx, f->rd_idx);
-}
-
-/******************************************************************************/
-/*!
- @brief Check if overflow happened.
-
- BE AWARE - THIS FUNCTION MIGHT NOT GIVE A CORRECT ANSWERE IN CASE WRITE POINTER "OVERFLOWS"
- Only one overflow is allowed for this function to work e.g. if depth = 100, you must not
- write more than 2*depth-1 items in one rush without updating write pointer. Otherwise
- write pointer wraps and your pointer states are messed up. This can only happen if you
- use DMAs, write functions do not allow such an error. Avoid such nasty things!
-
- All reading functions (read, peek) check for overflows and correct read pointer on their own such
- that latest items are read.
- If required (e.g. for DMA use) you can also correct the read pointer by
- tu_fifo_correct_read_pointer().
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
-
- @returns True if overflow happened
- */
-/******************************************************************************/
-bool tu_fifo_overflowed(tu_fifo_t* f)
-{
- return _tu_fifo_overflowed(f, f->wr_idx, f->rd_idx);
-}
-
-// Only use in case tu_fifo_overflow() returned true!
-void tu_fifo_correct_read_pointer(tu_fifo_t* f)
-{
- _ff_lock(f->mutex_rd);
- _tu_fifo_correct_read_pointer(f, f->wr_idx);
- _ff_unlock(f->mutex_rd);
-}
-
-/******************************************************************************/
-/*!
- @brief Read one element out of the buffer.
-
- This function will return the element located at the array index of the
- read pointer, and then increment the read pointer index.
- This function checks for an overflow and corrects read pointer if required.
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
- @param[in] buffer
- Pointer to the place holder for data read from the buffer
-
- @returns TRUE if the queue is not empty
- */
-/******************************************************************************/
-bool tu_fifo_read(tu_fifo_t* f, void * buffer)
-{
- _ff_lock(f->mutex_rd);
-
- // Peek the data
- // f->rd_idx might get modified in case of an overflow so we can not use a local variable
- bool ret = _tu_fifo_peek(f, buffer, f->wr_idx, f->rd_idx);
-
- // Advance pointer
- f->rd_idx = advance_pointer(f, f->rd_idx, ret);
-
- _ff_unlock(f->mutex_rd);
- return ret;
-}
-
-/******************************************************************************/
-/*!
- @brief This function will read n elements from the array index specified by
- the read pointer and increment the read index.
- This function checks for an overflow and corrects read pointer if required.
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
- @param[in] buffer
- The pointer to data location
- @param[in] n
- Number of element that buffer can afford
-
- @returns number of items read from the FIFO
- */
-/******************************************************************************/
-uint16_t tu_fifo_read_n(tu_fifo_t* f, void * buffer, uint16_t n)
-{
- return _tu_fifo_read_n(f, buffer, n, TU_FIFO_COPY_INC);
-}
-
-uint16_t tu_fifo_read_n_const_addr_full_words(tu_fifo_t* f, void * buffer, uint16_t n)
-{
- return _tu_fifo_read_n(f, buffer, n, TU_FIFO_COPY_CST_FULL_WORDS);
-}
-
-/******************************************************************************/
-/*!
- @brief Read one item without removing it from the FIFO.
- This function checks for an overflow and corrects read pointer if required.
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
- @param[in] offset
- Position to read from in the FIFO buffer with respect to read pointer
- @param[in] p_buffer
- Pointer to the place holder for data read from the buffer
-
- @returns TRUE if the queue is not empty
- */
-/******************************************************************************/
-bool tu_fifo_peek(tu_fifo_t* f, void * p_buffer)
-{
- _ff_lock(f->mutex_rd);
- bool ret = _tu_fifo_peek(f, p_buffer, f->wr_idx, f->rd_idx);
- _ff_unlock(f->mutex_rd);
- return ret;
-}
-
-/******************************************************************************/
-/*!
- @brief Read n items without removing it from the FIFO
- This function checks for an overflow and corrects read pointer if required.
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
- @param[in] p_buffer
- Pointer to the place holder for data read from the buffer
- @param[in] n
- Number of items to peek
-
- @returns Number of bytes written to p_buffer
- */
-/******************************************************************************/
-uint16_t tu_fifo_peek_n(tu_fifo_t* f, void * p_buffer, uint16_t n)
-{
- _ff_lock(f->mutex_rd);
- bool ret = _tu_fifo_peek_n(f, p_buffer, n, f->wr_idx, f->rd_idx, TU_FIFO_COPY_INC);
- _ff_unlock(f->mutex_rd);
- return ret;
-}
-
-/******************************************************************************/
-/*!
- @brief Write one element into the buffer.
-
- This function will write one element into the array index specified by
- the write pointer and increment the write index.
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
- @param[in] data
- The byte to add to the FIFO
-
- @returns TRUE if the data was written to the FIFO (overwrittable
- FIFO will always return TRUE)
- */
-/******************************************************************************/
-bool tu_fifo_write(tu_fifo_t* f, const void * data)
-{
- _ff_lock(f->mutex_wr);
-
- uint16_t w = f->wr_idx;
-
- if ( _tu_fifo_full(f, w, f->rd_idx) && !f->overwritable ) return false;
-
- uint16_t wRel = get_relative_pointer(f, w);
-
- // Write data
- _ff_push(f, data, wRel);
-
- // Advance pointer
- f->wr_idx = advance_pointer(f, w, 1);
-
- _ff_unlock(f->mutex_wr);
-
- return true;
-}
-
-/******************************************************************************/
-/*!
- @brief This function will write n elements into the array index specified by
- the write pointer and increment the write index.
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
- @param[in] data
- The pointer to data to add to the FIFO
- @param[in] count
- Number of element
- @return Number of written elements
- */
-/******************************************************************************/
-uint16_t tu_fifo_write_n(tu_fifo_t* f, const void * data, uint16_t n)
-{
- return _tu_fifo_write_n(f, data, n, TU_FIFO_COPY_INC);
-}
-
-/******************************************************************************/
-/*!
- @brief This function will write n elements into the array index specified by
- the write pointer and increment the write index. The source address will
- not be incremented which is useful for reading from registers.
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
- @param[in] data
- The pointer to data to add to the FIFO
- @param[in] count
- Number of element
- @return Number of written elements
- */
-/******************************************************************************/
-uint16_t tu_fifo_write_n_const_addr_full_words(tu_fifo_t* f, const void * data, uint16_t n)
-{
- return _tu_fifo_write_n(f, data, n, TU_FIFO_COPY_CST_FULL_WORDS);
-}
-
-/******************************************************************************/
-/*!
- @brief Clear the fifo read and write pointers
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
- */
-/******************************************************************************/
-bool tu_fifo_clear(tu_fifo_t *f)
-{
- _ff_lock(f->mutex_wr);
- _ff_lock(f->mutex_rd);
-
- f->rd_idx = f->wr_idx = 0;
- f->max_pointer_idx = 2*f->depth-1;
- f->non_used_index_space = UINT16_MAX - f->max_pointer_idx;
-
- _ff_unlock(f->mutex_wr);
- _ff_unlock(f->mutex_rd);
- return true;
-}
-
-/******************************************************************************/
-/*!
- @brief Change the fifo mode to overwritable or not overwritable
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
- @param[in] overwritable
- Overwritable mode the fifo is set to
- */
-/******************************************************************************/
-bool tu_fifo_set_overwritable(tu_fifo_t *f, bool overwritable)
-{
- _ff_lock(f->mutex_wr);
- _ff_lock(f->mutex_rd);
-
- f->overwritable = overwritable;
-
- _ff_unlock(f->mutex_wr);
- _ff_unlock(f->mutex_rd);
-
- return true;
-}
-
-/******************************************************************************/
-/*!
- @brief Advance write pointer - intended to be used in combination with DMA.
- It is possible to fill the FIFO by use of a DMA in circular mode. Within
- DMA ISRs you may update the write pointer to be able to read from the FIFO.
- As long as the DMA is the only process writing into the FIFO this is safe
- to use.
-
- USE WITH CARE - WE DO NOT CONDUCT SAFTY CHECKS HERE!
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
- @param[in] n
- Number of items the write pointer moves forward
- */
-/******************************************************************************/
-void tu_fifo_advance_write_pointer(tu_fifo_t *f, uint16_t n)
-{
- f->wr_idx = advance_pointer(f, f->wr_idx, n);
-}
-
-/******************************************************************************/
-/*!
- @brief Advance read pointer - intended to be used in combination with DMA.
- It is possible to read from the FIFO by use of a DMA in linear mode. Within
- DMA ISRs you may update the read pointer to be able to again write into the
- FIFO. As long as the DMA is the only process reading from the FIFO this is
- safe to use.
-
- USE WITH CARE - WE DO NOT CONDUCT SAFTY CHECKS HERE!
-
- @param[in] f
- Pointer to the FIFO buffer to manipulate
- @param[in] n
- Number of items the read pointer moves forward
- */
-/******************************************************************************/
-void tu_fifo_advance_read_pointer(tu_fifo_t *f, uint16_t n)
-{
- f->rd_idx = advance_pointer(f, f->rd_idx, n);
-}
-
-/******************************************************************************/
-/*!
- @brief Get read info
-
- Returns the length and pointer from which bytes can be read in a linear manner.
- This is of major interest for DMA transmissions. If returned length is zero the
- corresponding pointer is invalid.
- The read pointer does NOT get advanced, use tu_fifo_advance_read_pointer() to
- do so!
- @param[in] f
- Pointer to FIFO
- @param[out] *info
- Pointer to struct which holds the desired infos
- */
-/******************************************************************************/
-void tu_fifo_get_read_info(tu_fifo_t *f, tu_fifo_buffer_info_t *info)
-{
- // Operate on temporary values in case they change in between
- uint16_t w = f->wr_idx, r = f->rd_idx;
-
- uint16_t cnt = _tu_fifo_count(f, w, r);
-
- // Check overflow and correct if required - may happen in case a DMA wrote too fast
- if (cnt > f->depth)
- {
- _ff_lock(f->mutex_rd);
- _tu_fifo_correct_read_pointer(f, w);
- _ff_unlock(f->mutex_rd);
- r = f->rd_idx;
- cnt = f->depth;
- }
-
- // Check if fifo is empty
- if (cnt == 0)
- {
- info->len_lin = 0;
- info->len_wrap = 0;
- info->ptr_lin = NULL;
- info->ptr_wrap = NULL;
- return;
- }
-
- // Get relative pointers
- w = get_relative_pointer(f, w);
- r = get_relative_pointer(f, r);
-
- // Copy pointer to buffer to start reading from
- info->ptr_lin = &f->buffer[r];
-
- // Check if there is a wrap around necessary
- if (w > r) {
- // Non wrapping case
- info->len_lin = cnt;
- info->len_wrap = 0;
- info->ptr_wrap = NULL;
- }
- else
- {
- info->len_lin = f->depth - r; // Also the case if FIFO was full
- info->len_wrap = cnt - info->len_lin;
- info->ptr_wrap = f->buffer;
- }
-}
-
-/******************************************************************************/
-/*!
- @brief Get linear write info
-
- Returns the length and pointer to which bytes can be written into FIFO in a linear manner.
- This is of major interest for DMA transmissions not using circular mode. If a returned length is zero the
- corresponding pointer is invalid. The returned lengths summed up are the currently free space in the FIFO.
- The write pointer does NOT get advanced, use tu_fifo_advance_write_pointer() to do so!
- TAKE CARE TO NOT OVERFLOW THE BUFFER MORE THAN TWO TIMES THE FIFO DEPTH - IT CAN NOT RECOVERE OTHERWISE!
- @param[in] f
- Pointer to FIFO
- @param[out] *info
- Pointer to struct which holds the desired infos
- */
-/******************************************************************************/
-void tu_fifo_get_write_info(tu_fifo_t *f, tu_fifo_buffer_info_t *info)
-{
- uint16_t w = f->wr_idx, r = f->rd_idx;
- uint16_t free = _tu_fifo_remaining(f, w, r);
-
- if (free == 0)
- {
- info->len_lin = 0;
- info->len_wrap = 0;
- info->ptr_lin = NULL;
- info->ptr_wrap = NULL;
- return;
- }
-
- // Get relative pointers
- w = get_relative_pointer(f, w);
- r = get_relative_pointer(f, r);
-
- // Copy pointer to buffer to start writing to
- info->ptr_lin = &f->buffer[w];
-
- if (w < r)
- {
- // Non wrapping case
- info->len_lin = r-w;
- info->len_wrap = 0;
- info->ptr_wrap = NULL;
- }
- else
- {
- info->len_lin = f->depth - w;
- info->len_wrap = free - info->len_lin; // Remaining length - n already was limited to free or FIFO depth
- info->ptr_wrap = f->buffer; // Always start of buffer
- }
-}
diff --git a/tinyusb/src/common/tusb_fifo.h b/tinyusb/src/common/tusb_fifo.h
deleted file mode 100755
index 18db289a..00000000
--- a/tinyusb/src/common/tusb_fifo.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- * Copyright (c) 2020 Reinhard Panhuber - rework to unmasked pointers
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_FIFO_H_
-#define _TUSB_FIFO_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Due to the use of unmasked pointers, this FIFO does not suffer from loosing
-// one item slice. Furthermore, write and read operations are completely
-// decoupled as write and read functions do not modify a common state. Henceforth,
-// writing or reading from the FIFO within an ISR is safe as long as no other
-// process (thread or ISR) interferes.
-// Also, this FIFO is ready to be used in combination with a DMA as the write and
-// read pointers can be updated from within a DMA ISR. Overflows are detectable
-// within a certain number (see tu_fifo_overflow()).
-
-#include "common/tusb_common.h"
-
-// mutex is only needed for RTOS
-// for OS None, we don't get preempted
-#define CFG_FIFO_MUTEX (CFG_TUSB_OS != OPT_OS_NONE)
-
-#if CFG_FIFO_MUTEX
-#include "osal/osal.h"
-#define tu_fifo_mutex_t osal_mutex_t
-#endif
-
-typedef struct
-{
- uint8_t* buffer ; ///< buffer pointer
- uint16_t depth ; ///< max items
- uint16_t item_size ; ///< size of each item
- bool overwritable ;
-
- uint16_t non_used_index_space ; ///< required for non-power-of-two buffer length
- uint16_t max_pointer_idx ; ///< maximum absolute pointer index
-
- volatile uint16_t wr_idx ; ///< write pointer
- volatile uint16_t rd_idx ; ///< read pointer
-
-#if CFG_FIFO_MUTEX
- tu_fifo_mutex_t mutex_wr;
- tu_fifo_mutex_t mutex_rd;
-#endif
-
-} tu_fifo_t;
-
-typedef struct
-{
- uint16_t len_lin ; ///< linear length in item size
- uint16_t len_wrap ; ///< wrapped length in item size
- void * ptr_lin ; ///< linear part start pointer
- void * ptr_wrap ; ///< wrapped part start pointer
-} tu_fifo_buffer_info_t;
-
-#define TU_FIFO_INIT(_buffer, _depth, _type, _overwritable) \
-{ \
- .buffer = _buffer, \
- .depth = _depth, \
- .item_size = sizeof(_type), \
- .overwritable = _overwritable, \
- .non_used_index_space = UINT16_MAX - (2*(_depth)-1), \
- .max_pointer_idx = 2*(_depth)-1, \
-}
-
-#define TU_FIFO_DEF(_name, _depth, _type, _overwritable) \
- uint8_t _name##_buf[_depth*sizeof(_type)]; \
- tu_fifo_t _name = TU_FIFO_INIT(_name##_buf, _depth, _type, _overwritable)
-
-
-bool tu_fifo_set_overwritable(tu_fifo_t *f, bool overwritable);
-bool tu_fifo_clear(tu_fifo_t *f);
-bool tu_fifo_config(tu_fifo_t *f, void* buffer, uint16_t depth, uint16_t item_size, bool overwritable);
-
-#if CFG_FIFO_MUTEX
-TU_ATTR_ALWAYS_INLINE static inline
-void tu_fifo_config_mutex(tu_fifo_t *f, tu_fifo_mutex_t write_mutex_hdl, tu_fifo_mutex_t read_mutex_hdl)
-{
- f->mutex_wr = write_mutex_hdl;
- f->mutex_rd = read_mutex_hdl;
-}
-#endif
-
-bool tu_fifo_write (tu_fifo_t* f, void const * p_data);
-uint16_t tu_fifo_write_n (tu_fifo_t* f, void const * p_data, uint16_t n);
-uint16_t tu_fifo_write_n_const_addr_full_words (tu_fifo_t* f, const void * data, uint16_t n);
-
-bool tu_fifo_read (tu_fifo_t* f, void * p_buffer);
-uint16_t tu_fifo_read_n (tu_fifo_t* f, void * p_buffer, uint16_t n);
-uint16_t tu_fifo_read_n_const_addr_full_words (tu_fifo_t* f, void * buffer, uint16_t n);
-
-bool tu_fifo_peek (tu_fifo_t* f, void * p_buffer);
-uint16_t tu_fifo_peek_n (tu_fifo_t* f, void * p_buffer, uint16_t n);
-
-uint16_t tu_fifo_count (tu_fifo_t* f);
-uint16_t tu_fifo_remaining (tu_fifo_t* f);
-bool tu_fifo_empty (tu_fifo_t* f);
-bool tu_fifo_full (tu_fifo_t* f);
-bool tu_fifo_overflowed (tu_fifo_t* f);
-void tu_fifo_correct_read_pointer (tu_fifo_t* f);
-
-TU_ATTR_ALWAYS_INLINE static inline
-uint16_t tu_fifo_depth(tu_fifo_t* f)
-{
- return f->depth;
-}
-
-// Pointer modifications intended to be used in combinations with DMAs.
-// USE WITH CARE - NO SAFTY CHECKS CONDUCTED HERE! NOT MUTEX PROTECTED!
-void tu_fifo_advance_write_pointer(tu_fifo_t *f, uint16_t n);
-void tu_fifo_advance_read_pointer (tu_fifo_t *f, uint16_t n);
-
-// If you want to read/write from/to the FIFO by use of a DMA, you may need to conduct two copies
-// to handle a possible wrapping part. These functions deliver a pointer to start
-// reading/writing from/to and a valid linear length along which no wrap occurs.
-void tu_fifo_get_read_info (tu_fifo_t *f, tu_fifo_buffer_info_t *info);
-void tu_fifo_get_write_info(tu_fifo_t *f, tu_fifo_buffer_info_t *info);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TUSB_FIFO_H_ */
diff --git a/tinyusb/src/common/tusb_timeout.h b/tinyusb/src/common/tusb_timeout.h
deleted file mode 100755
index ce53955f..00000000
--- a/tinyusb/src/common/tusb_timeout.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup Group_Common Common Files
- * \defgroup Group_TimeoutTimer timeout timer
- * @{ */
-
-#ifndef _TUSB_TIMEOUT_H_
-#define _TUSB_TIMEOUT_H_
-
-#include <stdbool.h>
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct {
- uint32_t start;
- uint32_t interval;
-}tu_timeout_t;
-
-#if 0
-
-extern uint32_t tusb_hal_millis(void);
-
-static inline void tu_timeout_set(tu_timeout_t* tt, uint32_t msec)
-{
- tt->interval = msec;
- tt->start = tusb_hal_millis();
-}
-
-static inline bool tu_timeout_expired(tu_timeout_t* tt)
-{
- return ( tusb_hal_millis() - tt->start ) >= tt->interval;
-}
-
-// For used with periodic event to prevent drift
-static inline void tu_timeout_reset(tu_timeout_t* tt)
-{
- tt->start += tt->interval;
-}
-
-static inline void tu_timeout_restart(tu_timeout_t* tt)
-{
- tt->start = tusb_hal_millis();
-}
-
-#endif
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_TIMEOUT_H_ */
-
-/** @} */
diff --git a/tinyusb/src/common/tusb_types.h b/tinyusb/src/common/tusb_types.h
deleted file mode 100755
index d23c6b2d..00000000
--- a/tinyusb/src/common/tusb_types.h
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup group_usb_definitions
- * \defgroup USBDef_Type USB Types
- * @{ */
-
-#ifndef _TUSB_TYPES_H_
-#define _TUSB_TYPES_H_
-
-#include <stdbool.h>
-#include <stdint.h>
-#include "tusb_compiler.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/*------------------------------------------------------------------*/
-/* CONSTANTS
- *------------------------------------------------------------------*/
-
-/// defined base on EHCI specs value for Endpoint Speed
-typedef enum
-{
- TUSB_SPEED_FULL = 0,
- TUSB_SPEED_LOW ,
- TUSB_SPEED_HIGH,
- TUSB_SPEED_INVALID = 0xff,
-}tusb_speed_t;
-
-/// defined base on USB Specs Endpoint's bmAttributes
-typedef enum
-{
- TUSB_XFER_CONTROL = 0 ,
- TUSB_XFER_ISOCHRONOUS ,
- TUSB_XFER_BULK ,
- TUSB_XFER_INTERRUPT
-}tusb_xfer_type_t;
-
-typedef enum
-{
- TUSB_DIR_OUT = 0,
- TUSB_DIR_IN = 1,
-
- TUSB_DIR_IN_MASK = 0x80
-}tusb_dir_t;
-
-/// USB Descriptor Types
-typedef enum
-{
- TUSB_DESC_DEVICE = 0x01,
- TUSB_DESC_CONFIGURATION = 0x02,
- TUSB_DESC_STRING = 0x03,
- TUSB_DESC_INTERFACE = 0x04,
- TUSB_DESC_ENDPOINT = 0x05,
- TUSB_DESC_DEVICE_QUALIFIER = 0x06,
- TUSB_DESC_OTHER_SPEED_CONFIG = 0x07,
- TUSB_DESC_INTERFACE_POWER = 0x08,
- TUSB_DESC_OTG = 0x09,
- TUSB_DESC_DEBUG = 0x0A,
- TUSB_DESC_INTERFACE_ASSOCIATION = 0x0B,
-
- TUSB_DESC_BOS = 0x0F,
- TUSB_DESC_DEVICE_CAPABILITY = 0x10,
-
- TUSB_DESC_FUNCTIONAL = 0x21,
-
- // Class Specific Descriptor
- TUSB_DESC_CS_DEVICE = 0x21,
- TUSB_DESC_CS_CONFIGURATION = 0x22,
- TUSB_DESC_CS_STRING = 0x23,
- TUSB_DESC_CS_INTERFACE = 0x24,
- TUSB_DESC_CS_ENDPOINT = 0x25,
-
- TUSB_DESC_SUPERSPEED_ENDPOINT_COMPANION = 0x30,
- TUSB_DESC_SUPERSPEED_ISO_ENDPOINT_COMPANION = 0x31
-}tusb_desc_type_t;
-
-typedef enum
-{
- TUSB_REQ_GET_STATUS = 0 ,
- TUSB_REQ_CLEAR_FEATURE = 1 ,
- TUSB_REQ_RESERVED = 2 ,
- TUSB_REQ_SET_FEATURE = 3 ,
- TUSB_REQ_RESERVED2 = 4 ,
- TUSB_REQ_SET_ADDRESS = 5 ,
- TUSB_REQ_GET_DESCRIPTOR = 6 ,
- TUSB_REQ_SET_DESCRIPTOR = 7 ,
- TUSB_REQ_GET_CONFIGURATION = 8 ,
- TUSB_REQ_SET_CONFIGURATION = 9 ,
- TUSB_REQ_GET_INTERFACE = 10 ,
- TUSB_REQ_SET_INTERFACE = 11 ,
- TUSB_REQ_SYNCH_FRAME = 12
-}tusb_request_code_t;
-
-typedef enum
-{
- TUSB_REQ_FEATURE_EDPT_HALT = 0,
- TUSB_REQ_FEATURE_REMOTE_WAKEUP = 1,
- TUSB_REQ_FEATURE_TEST_MODE = 2
-}tusb_request_feature_selector_t;
-
-typedef enum
-{
- TUSB_REQ_TYPE_STANDARD = 0,
- TUSB_REQ_TYPE_CLASS,
- TUSB_REQ_TYPE_VENDOR,
- TUSB_REQ_TYPE_INVALID
-} tusb_request_type_t;
-
-typedef enum
-{
- TUSB_REQ_RCPT_DEVICE =0,
- TUSB_REQ_RCPT_INTERFACE,
- TUSB_REQ_RCPT_ENDPOINT,
- TUSB_REQ_RCPT_OTHER
-} tusb_request_recipient_t;
-
-// https://www.usb.org/defined-class-codes
-typedef enum
-{
- TUSB_CLASS_UNSPECIFIED = 0 ,
- TUSB_CLASS_AUDIO = 1 ,
- TUSB_CLASS_CDC = 2 ,
- TUSB_CLASS_HID = 3 ,
- TUSB_CLASS_RESERVED_4 = 4 ,
- TUSB_CLASS_PHYSICAL = 5 ,
- TUSB_CLASS_IMAGE = 6 ,
- TUSB_CLASS_PRINTER = 7 ,
- TUSB_CLASS_MSC = 8 ,
- TUSB_CLASS_HUB = 9 ,
- TUSB_CLASS_CDC_DATA = 10 ,
- TUSB_CLASS_SMART_CARD = 11 ,
- TUSB_CLASS_RESERVED_12 = 12 ,
- TUSB_CLASS_CONTENT_SECURITY = 13 ,
- TUSB_CLASS_VIDEO = 14 ,
- TUSB_CLASS_PERSONAL_HEALTHCARE = 15 ,
- TUSB_CLASS_AUDIO_VIDEO = 16 ,
-
- TUSB_CLASS_DIAGNOSTIC = 0xDC ,
- TUSB_CLASS_WIRELESS_CONTROLLER = 0xE0 ,
- TUSB_CLASS_MISC = 0xEF ,
- TUSB_CLASS_APPLICATION_SPECIFIC = 0xFE ,
- TUSB_CLASS_VENDOR_SPECIFIC = 0xFF
-}tusb_class_code_t;
-
-typedef enum
-{
- MISC_SUBCLASS_COMMON = 2
-}misc_subclass_type_t;
-
-typedef enum
-{
- MISC_PROTOCOL_IAD = 1
-}misc_protocol_type_t;
-
-typedef enum
-{
- APP_SUBCLASS_USBTMC = 0x03,
- APP_SUBCLASS_DFU_RUNTIME = 0x01
-} app_subclass_type_t;
-
-typedef enum
-{
- DEVICE_CAPABILITY_WIRELESS_USB = 0x01,
- DEVICE_CAPABILITY_USB20_EXTENSION = 0x02,
- DEVICE_CAPABILITY_SUPERSPEED_USB = 0x03,
- DEVICE_CAPABILITY_CONTAINER_id = 0x04,
- DEVICE_CAPABILITY_PLATFORM = 0x05,
- DEVICE_CAPABILITY_POWER_DELIVERY = 0x06,
- DEVICE_CAPABILITY_BATTERY_INFO = 0x07,
- DEVICE_CAPABILITY_PD_CONSUMER_PORT = 0x08,
- DEVICE_CAPABILITY_PD_PROVIDER_PORT = 0x09,
- DEVICE_CAPABILITY_SUPERSPEED_PLUS = 0x0A,
- DEVICE_CAPABILITY_PRECESION_TIME_MEASUREMENT = 0x0B,
- DEVICE_CAPABILITY_WIRELESS_USB_EXT = 0x0C,
- DEVICE_CAPABILITY_BILLBOARD = 0x0D,
- DEVICE_CAPABILITY_AUTHENTICATION = 0x0E,
- DEVICE_CAPABILITY_BILLBOARD_EX = 0x0F,
- DEVICE_CAPABILITY_CONFIGURATION_SUMMARY = 0x10
-}device_capability_type_t;
-
-enum {
- TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP = TU_BIT(5),
- TUSB_DESC_CONFIG_ATT_SELF_POWERED = TU_BIT(6),
-};
-
-#define TUSB_DESC_CONFIG_POWER_MA(x) ((x)/2)
-
-/// Device State TODO remove
-typedef enum
-{
- TUSB_DEVICE_STATE_UNPLUG = 0 ,
- TUSB_DEVICE_STATE_CONFIGURED ,
- TUSB_DEVICE_STATE_SUSPENDED ,
-}tusb_device_state_t;
-
-typedef enum
-{
- XFER_RESULT_SUCCESS,
- XFER_RESULT_FAILED,
- XFER_RESULT_STALLED,
-}xfer_result_t;
-
-enum // TODO remove
-{
- DESC_OFFSET_LEN = 0,
- DESC_OFFSET_TYPE = 1
-};
-
-enum
-{
- INTERFACE_INVALID_NUMBER = 0xff
-};
-
-
-typedef enum
-{
- MS_OS_20_SET_HEADER_DESCRIPTOR = 0x00,
- MS_OS_20_SUBSET_HEADER_CONFIGURATION = 0x01,
- MS_OS_20_SUBSET_HEADER_FUNCTION = 0x02,
- MS_OS_20_FEATURE_COMPATBLE_ID = 0x03,
- MS_OS_20_FEATURE_REG_PROPERTY = 0x04,
- MS_OS_20_FEATURE_MIN_RESUME_TIME = 0x05,
- MS_OS_20_FEATURE_MODEL_ID = 0x06,
- MS_OS_20_FEATURE_CCGP_DEVICE = 0x07,
- MS_OS_20_FEATURE_VENDOR_REVISION = 0x08
-} microsoft_os_20_type_t;
-
-enum
-{
- CONTROL_STAGE_SETUP,
- CONTROL_STAGE_DATA,
- CONTROL_STAGE_ACK
-};
-
-//--------------------------------------------------------------------+
-// USB Descriptors
-//--------------------------------------------------------------------+
-
-// Start of all packed definitions for compiler without per-type packed
-TU_ATTR_PACKED_BEGIN
-TU_ATTR_BIT_FIELD_ORDER_BEGIN
-
-/// USB Device Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes.
- uint8_t bDescriptorType ; ///< DEVICE Descriptor Type.
- uint16_t bcdUSB ; ///< BUSB Specification Release Number in Binary-Coded Decimal (i.e., 2.10 is 210H). This field identifies the release of the USB Specification with which the device and its descriptors are compliant.
-
- uint8_t bDeviceClass ; ///< Class code (assigned by the USB-IF). \li If this field is reset to zero, each interface within a configuration specifies its own class information and the various interfaces operate independently. \li If this field is set to a value between 1 and FEH, the device supports different class specifications on different interfaces and the interfaces may not operate independently. This value identifies the class definition used for the aggregate interfaces. \li If this field is set to FFH, the device class is vendor-specific.
- uint8_t bDeviceSubClass ; ///< Subclass code (assigned by the USB-IF). These codes are qualified by the value of the bDeviceClass field. \li If the bDeviceClass field is reset to zero, this field must also be reset to zero. \li If the bDeviceClass field is not set to FFH, all values are reserved for assignment by the USB-IF.
- uint8_t bDeviceProtocol ; ///< Protocol code (assigned by the USB-IF). These codes are qualified by the value of the bDeviceClass and the bDeviceSubClass fields. If a device supports class-specific protocols on a device basis as opposed to an interface basis, this code identifies the protocols that the device uses as defined by the specification of the device class. \li If this field is reset to zero, the device does not use class-specific protocols on a device basis. However, it may use classspecific protocols on an interface basis. \li If this field is set to FFH, the device uses a vendor-specific protocol on a device basis.
- uint8_t bMaxPacketSize0 ; ///< Maximum packet size for endpoint zero (only 8, 16, 32, or 64 are valid). For HS devices is fixed to 64.
-
- uint16_t idVendor ; ///< Vendor ID (assigned by the USB-IF).
- uint16_t idProduct ; ///< Product ID (assigned by the manufacturer).
- uint16_t bcdDevice ; ///< Device release number in binary-coded decimal.
- uint8_t iManufacturer ; ///< Index of string descriptor describing manufacturer.
- uint8_t iProduct ; ///< Index of string descriptor describing product.
- uint8_t iSerialNumber ; ///< Index of string descriptor describing the device's serial number.
-
- uint8_t bNumConfigurations ; ///< Number of possible configurations.
-} tusb_desc_device_t;
-
-TU_VERIFY_STATIC( sizeof(tusb_desc_device_t) == 18, "size is not correct");
-
-// USB Binary Device Object Store (BOS) Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes
- uint8_t bDescriptorType ; ///< CONFIGURATION Descriptor Type
- uint16_t wTotalLength ; ///< Total length of data returned for this descriptor
- uint8_t bNumDeviceCaps ; ///< Number of device capability descriptors in the BOS
-} tusb_desc_bos_t;
-
-TU_VERIFY_STATIC( sizeof(tusb_desc_bos_t) == 5, "size is not correct");
-
-/// USB Configuration Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes
- uint8_t bDescriptorType ; ///< CONFIGURATION Descriptor Type
- uint16_t wTotalLength ; ///< Total length of data returned for this configuration. Includes the combined length of all descriptors (configuration, interface, endpoint, and class- or vendor-specific) returned for this configuration.
-
- uint8_t bNumInterfaces ; ///< Number of interfaces supported by this configuration
- uint8_t bConfigurationValue ; ///< Value to use as an argument to the SetConfiguration() request to select this configuration.
- uint8_t iConfiguration ; ///< Index of string descriptor describing this configuration
- uint8_t bmAttributes ; ///< Configuration characteristics \n D7: Reserved (set to one)\n D6: Self-powered \n D5: Remote Wakeup \n D4...0: Reserved (reset to zero) \n D7 is reserved and must be set to one for historical reasons. \n A device configuration that uses power from the bus and a local source reports a non-zero value in bMaxPower to indicate the amount of bus power required and sets D6. The actual power source at runtime may be determined using the GetStatus(DEVICE) request (see USB 2.0 spec Section 9.4.5). \n If a device configuration supports remote wakeup, D5 is set to one.
- uint8_t bMaxPower ; ///< Maximum power consumption of the USB device from the bus in this specific configuration when the device is fully operational. Expressed in 2 mA units (i.e., 50 = 100 mA).
-} tusb_desc_configuration_t;
-
-TU_VERIFY_STATIC( sizeof(tusb_desc_configuration_t) == 9, "size is not correct");
-
-/// USB Interface Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes
- uint8_t bDescriptorType ; ///< INTERFACE Descriptor Type
-
- uint8_t bInterfaceNumber ; ///< Number of this interface. Zero-based value identifying the index in the array of concurrent interfaces supported by this configuration.
- uint8_t bAlternateSetting ; ///< Value used to select this alternate setting for the interface identified in the prior field
- uint8_t bNumEndpoints ; ///< Number of endpoints used by this interface (excluding endpoint zero). If this value is zero, this interface only uses the Default Control Pipe.
- uint8_t bInterfaceClass ; ///< Class code (assigned by the USB-IF). \li A value of zero is reserved for future standardization. \li If this field is set to FFH, the interface class is vendor-specific. \li All other values are reserved for assignment by the USB-IF.
- uint8_t bInterfaceSubClass ; ///< Subclass code (assigned by the USB-IF). \n These codes are qualified by the value of the bInterfaceClass field. \li If the bInterfaceClass field is reset to zero, this field must also be reset to zero. \li If the bInterfaceClass field is not set to FFH, all values are reserved for assignment by the USB-IF.
- uint8_t bInterfaceProtocol ; ///< Protocol code (assigned by the USB). \n These codes are qualified by the value of the bInterfaceClass and the bInterfaceSubClass fields. If an interface supports class-specific requests, this code identifies the protocols that the device uses as defined by the specification of the device class. \li If this field is reset to zero, the device does not use a class-specific protocol on this interface. \li If this field is set to FFH, the device uses a vendor-specific protocol for this interface.
- uint8_t iInterface ; ///< Index of string descriptor describing this interface
-} tusb_desc_interface_t;
-
-TU_VERIFY_STATIC( sizeof(tusb_desc_interface_t) == 9, "size is not correct");
-
-/// USB Endpoint Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes
- uint8_t bDescriptorType ; ///< ENDPOINT Descriptor Type
-
- uint8_t bEndpointAddress ; ///< The address of the endpoint on the USB device described by this descriptor. The address is encoded as follows: \n Bit 3...0: The endpoint number \n Bit 6...4: Reserved, reset to zero \n Bit 7: Direction, ignored for control endpoints 0 = OUT endpoint 1 = IN endpoint.
-
- struct TU_ATTR_PACKED {
- uint8_t xfer : 2;
- uint8_t sync : 2;
- uint8_t usage : 2;
- uint8_t : 2;
- } bmAttributes ; ///< This field describes the endpoint's attributes when it is configured using the bConfigurationValue. \n Bits 1..0: Transfer Type \n- 00 = Control \n- 01 = Isochronous \n- 10 = Bulk \n- 11 = Interrupt \n If not an isochronous endpoint, bits 5..2 are reserved and must be set to zero. If isochronous, they are defined as follows: \n Bits 3..2: Synchronization Type \n- 00 = No Synchronization \n- 01 = Asynchronous \n- 10 = Adaptive \n- 11 = Synchronous \n Bits 5..4: Usage Type \n- 00 = Data endpoint \n- 01 = Feedback endpoint \n- 10 = Implicit feedback Data endpoint \n- 11 = Reserved \n Refer to Chapter 5 of USB 2.0 specification for more information. \n All other bits are reserved and must be reset to zero. Reserved bits must be ignored by the host.
-
- struct TU_ATTR_PACKED {
-#if defined(__CCRX__)
- //FIXME the original defined bit field has a problem with the CCRX toolchain, so only a size field is defined
- uint16_t size;
-#else
- uint16_t size : 11; ///< Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected. \n For isochronous endpoints, this value is used to reserve the bus time in the schedule, required for the per-(micro)frame data payloads. The pipe may, on an ongoing basis, actually use less bandwidth than that reserved. The device reports, if necessary, the actual bandwidth used via its normal, non-USB defined mechanisms. \n For all endpoints, bits 10..0 specify the maximum packet size (in bytes). \n For high-speed isochronous and interrupt endpoints: \n Bits 12..11 specify the number of additional transaction opportunities per microframe: \n- 00 = None (1 transaction per microframe) \n- 01 = 1 additional (2 per microframe) \n- 10 = 2 additional (3 per microframe) \n- 11 = Reserved \n Bits 15..13 are reserved and must be set to zero.
- uint16_t hs_period_mult : 2;
- uint16_t TU_RESERVED : 3;
-#endif
- }wMaxPacketSize;
-
- uint8_t bInterval ; ///< Interval for polling endpoint for data transfers. Expressed in frames or microframes depending on the device operating speed (i.e., either 1 millisecond or 125 us units). \n- For full-/high-speed isochronous endpoints, this value must be in the range from 1 to 16. The bInterval value is used as the exponent for a \f$ 2^(bInterval-1) \f$ value; e.g., a bInterval of 4 means a period of 8 (\f$ 2^(4-1) \f$). \n- For full-/low-speed interrupt endpoints, the value of this field may be from 1 to 255. \n- For high-speed interrupt endpoints, the bInterval value is used as the exponent for a \f$ 2^(bInterval-1) \f$ value; e.g., a bInterval of 4 means a period of 8 (\f$ 2^(4-1) \f$) . This value must be from 1 to 16. \n- For high-speed bulk/control OUT endpoints, the bInterval must specify the maximum NAK rate of the endpoint. A value of 0 indicates the endpoint never NAKs. Other values indicate at most 1 NAK each bInterval number of microframes. This value must be in the range from 0 to 255. \n Refer to Chapter 5 of USB 2.0 specification for more information.
-} tusb_desc_endpoint_t;
-
-/// USB Other Speed Configuration Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of descriptor
- uint8_t bDescriptorType ; ///< Other_speed_Configuration Type
- uint16_t wTotalLength ; ///< Total length of data returned
-
- uint8_t bNumInterfaces ; ///< Number of interfaces supported by this speed configuration
- uint8_t bConfigurationValue ; ///< Value to use to select configuration
- uint8_t IConfiguration ; ///< Index of string descriptor
- uint8_t bmAttributes ; ///< Same as Configuration descriptor
- uint8_t bMaxPower ; ///< Same as Configuration descriptor
-} tusb_desc_other_speed_t;
-
-/// USB Device Qualifier Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of descriptor
- uint8_t bDescriptorType ; ///< Device Qualifier Type
- uint16_t bcdUSB ; ///< USB specification version number (e.g., 0200H for V2.00)
-
- uint8_t bDeviceClass ; ///< Class Code
- uint8_t bDeviceSubClass ; ///< SubClass Code
- uint8_t bDeviceProtocol ; ///< Protocol Code
- uint8_t bMaxPacketSize0 ; ///< Maximum packet size for other speed
- uint8_t bNumConfigurations ; ///< Number of Other-speed Configurations
- uint8_t bReserved ; ///< Reserved for future use, must be zero
-} tusb_desc_device_qualifier_t;
-
-/// USB Interface Association Descriptor (IAD ECN)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of descriptor
- uint8_t bDescriptorType ; ///< Other_speed_Configuration Type
-
- uint8_t bFirstInterface ; ///< Index of the first associated interface.
- uint8_t bInterfaceCount ; ///< Total number of associated interfaces.
-
- uint8_t bFunctionClass ; ///< Interface class ID.
- uint8_t bFunctionSubClass ; ///< Interface subclass ID.
- uint8_t bFunctionProtocol ; ///< Interface protocol ID.
-
- uint8_t iFunction ; ///< Index of the string descriptor describing the interface association.
-} tusb_desc_interface_assoc_t;
-
-// USB String Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength ; ///< Size of this descriptor in bytes
- uint8_t bDescriptorType ; ///< Descriptor Type
- uint16_t unicode_string[];
-} tusb_desc_string_t;
-
-// USB Binary Device Object Store (BOS)
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength;
- uint8_t bDescriptorType ;
- uint8_t bDevCapabilityType;
- uint8_t bReserved;
- uint8_t PlatformCapabilityUUID[16];
- uint8_t CapabilityData[];
-} tusb_desc_bos_platform_t;
-
-// USB WebuSB URL Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength;
- uint8_t bDescriptorType;
- uint8_t bScheme;
- char url[];
-} tusb_desc_webusb_url_t;
-
-// DFU Functional Descriptor
-typedef struct TU_ATTR_PACKED
-{
- uint8_t bLength;
- uint8_t bDescriptorType;
-
- union {
- struct TU_ATTR_PACKED {
- uint8_t bitCanDnload : 1;
- uint8_t bitCanUpload : 1;
- uint8_t bitManifestationTolerant : 1;
- uint8_t bitWillDetach : 1;
- uint8_t reserved : 4;
- } bmAttributes;
-
- uint8_t bAttributes;
- };
-
- uint16_t wDetachTimeOut;
- uint16_t wTransferSize;
- uint16_t bcdDFUVersion;
-} tusb_desc_dfu_functional_t;
-
-/*------------------------------------------------------------------*/
-/* Types
- *------------------------------------------------------------------*/
-typedef struct TU_ATTR_PACKED{
- union {
- struct TU_ATTR_PACKED {
- uint8_t recipient : 5; ///< Recipient type tusb_request_recipient_t.
- uint8_t type : 2; ///< Request type tusb_request_type_t.
- uint8_t direction : 1; ///< Direction type. tusb_dir_t
- } bmRequestType_bit;
-
- uint8_t bmRequestType;
- };
-
- uint8_t bRequest;
- uint16_t wValue;
- uint16_t wIndex;
- uint16_t wLength;
-} tusb_control_request_t;
-
-TU_VERIFY_STATIC( sizeof(tusb_control_request_t) == 8, "size is not correct");
-
-
-TU_ATTR_PACKED_END // End of all packed definitions
-TU_ATTR_BIT_FIELD_ORDER_END
-
-//--------------------------------------------------------------------+
-// Endpoint helper
-//--------------------------------------------------------------------+
-
-// Get direction from Endpoint address
-static inline tusb_dir_t tu_edpt_dir(uint8_t addr)
-{
- return (addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT;
-}
-
-// Get Endpoint number from address
-static inline uint8_t tu_edpt_number(uint8_t addr)
-{
- return (uint8_t)(addr & (~TUSB_DIR_IN_MASK));
-}
-
-static inline uint8_t tu_edpt_addr(uint8_t num, uint8_t dir)
-{
- return (uint8_t)(num | (dir ? TUSB_DIR_IN_MASK : 0));
-}
-
-//--------------------------------------------------------------------+
-// Descriptor helper
-//--------------------------------------------------------------------+
-static inline uint8_t const * tu_desc_next(void const* desc)
-{
- uint8_t const* desc8 = (uint8_t const*) desc;
- return desc8 + desc8[DESC_OFFSET_LEN];
-}
-
-static inline uint8_t tu_desc_type(void const* desc)
-{
- return ((uint8_t const*) desc)[DESC_OFFSET_TYPE];
-}
-
-static inline uint8_t tu_desc_len(void const* desc)
-{
- return ((uint8_t const*) desc)[DESC_OFFSET_LEN];
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_TYPES_H_ */
-
-/** @} */
diff --git a/tinyusb/src/common/tusb_verify.h b/tinyusb/src/common/tusb_verify.h
deleted file mode 100755
index 56ba8bcd..00000000
--- a/tinyusb/src/common/tusb_verify.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-#ifndef TUSB_VERIFY_H_
-#define TUSB_VERIFY_H_
-
-#include <stdbool.h>
-#include <stdint.h>
-#include "tusb_option.h"
-#include "tusb_compiler.h"
-
-/*------------------------------------------------------------------*/
-/* This file use an advanced macro technique to mimic the default parameter
- * as C++ for the sake of code simplicity. Beware of a headache macro
- * manipulation that you are told to stay away.
- *
- * This contains macros for both VERIFY and ASSERT:
- *
- * VERIFY: Used when there is an error condition which is not the
- * fault of the MCU. For example, bounds checking on data
- * sent to the micro over USB should use this function.
- * Another example is checking for buffer overflows, where
- * returning from the active function causes a NAK.
- *
- * ASSERT: Used for error conditions that are caused by MCU firmware
- * bugs. This is used to discover bugs in the code more
- * quickly. One example would be adding assertions in library
- * function calls to confirm a function's (untainted)
- * parameters are valid.
- *
- * The difference in behavior is that ASSERT triggers a breakpoint while
- * verify does not.
- *
- * #define TU_VERIFY(cond) if(cond) return false;
- * #define TU_VERIFY(cond,ret) if(cond) return ret;
- *
- * #define TU_VERIFY_HDLR(cond,handler) if(cond) {handler; return false;}
- * #define TU_VERIFY_HDLR(cond,ret,handler) if(cond) {handler; return ret;}
- *
- * #define TU_ASSERT(cond) if(cond) {_MESS_FAILED(); TU_BREAKPOINT(), return false;}
- * #define TU_ASSERT(cond,ret) if(cond) {_MESS_FAILED(); TU_BREAKPOINT(), return ret;}
- *
- *------------------------------------------------------------------*/
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// TU_VERIFY Helper
-//--------------------------------------------------------------------+
-
-#if CFG_TUSB_DEBUG
- #include <stdio.h>
- #define _MESS_ERR(_err) tu_printf("%s %d: failed, error = %s\r\n", __func__, __LINE__, tusb_strerr[_err])
- #define _MESS_FAILED() tu_printf("%s %d: ASSERT FAILED\r\n", __func__, __LINE__)
-#else
- #define _MESS_ERR(_err) do {} while (0)
- #define _MESS_FAILED() do {} while (0)
-#endif
-
-// Halt CPU (breakpoint) when hitting error, only apply for Cortex M3, M4, M7
-#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
- #define TU_BREAKPOINT() do \
- { \
- volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL); /* Cortex M CoreDebug->DHCSR */ \
- if ( (*ARM_CM_DHCSR) & 1UL ) __asm("BKPT #0\n"); /* Only halt mcu if debugger is attached */ \
- } while(0)
-
-#elif defined(__riscv)
- #define TU_BREAKPOINT() do { __asm("ebreak\n"); } while(0)
-
-#else
- #define TU_BREAKPOINT() do {} while (0)
-#endif
-
-/*------------------------------------------------------------------*/
-/* Macro Generator
- *------------------------------------------------------------------*/
-
-// Helper to implement optional parameter for TU_VERIFY Macro family
-#define GET_3RD_ARG(arg1, arg2, arg3, ...) arg3
-#define GET_4TH_ARG(arg1, arg2, arg3, arg4, ...) arg4
-
-/*------------- Generator for TU_VERIFY and TU_VERIFY_HDLR -------------*/
-#define TU_VERIFY_DEFINE(_cond, _handler, _ret) do \
-{ \
- if ( !(_cond) ) { _handler; return _ret; } \
-} while(0)
-
-/*------------------------------------------------------------------*/
-/* TU_VERIFY
- * - TU_VERIFY_1ARGS : return false if failed
- * - TU_VERIFY_2ARGS : return provided value if failed
- *------------------------------------------------------------------*/
-#define TU_VERIFY_1ARGS(_cond) TU_VERIFY_DEFINE(_cond, , false)
-#define TU_VERIFY_2ARGS(_cond, _ret) TU_VERIFY_DEFINE(_cond, , _ret)
-
-#define TU_VERIFY(...) GET_3RD_ARG(__VA_ARGS__, TU_VERIFY_2ARGS, TU_VERIFY_1ARGS, UNUSED)(__VA_ARGS__)
-
-
-/*------------------------------------------------------------------*/
-/* TU_VERIFY WITH HANDLER
- * - TU_VERIFY_HDLR_2ARGS : execute handler, return false if failed
- * - TU_VERIFY_HDLR_3ARGS : execute handler, return provided error if failed
- *------------------------------------------------------------------*/
-#define TU_VERIFY_HDLR_2ARGS(_cond, _handler) TU_VERIFY_DEFINE(_cond, _handler, false)
-#define TU_VERIFY_HDLR_3ARGS(_cond, _handler, _ret) TU_VERIFY_DEFINE(_cond, _handler, _ret)
-
-#define TU_VERIFY_HDLR(...) GET_4TH_ARG(__VA_ARGS__, TU_VERIFY_HDLR_3ARGS, TU_VERIFY_HDLR_2ARGS,UNUSED)(__VA_ARGS__)
-
-/*------------------------------------------------------------------*/
-/* ASSERT
- * basically TU_VERIFY with TU_BREAKPOINT() as handler
- * - 1 arg : return false if failed
- * - 2 arg : return error if failed
- *------------------------------------------------------------------*/
-#define ASSERT_1ARGS(_cond) TU_VERIFY_DEFINE(_cond, _MESS_FAILED(); TU_BREAKPOINT(), false)
-#define ASSERT_2ARGS(_cond, _ret) TU_VERIFY_DEFINE(_cond, _MESS_FAILED(); TU_BREAKPOINT(), _ret)
-
-#ifndef TU_ASSERT
-#define TU_ASSERT(...) GET_3RD_ARG(__VA_ARGS__, ASSERT_2ARGS, ASSERT_1ARGS,UNUSED)(__VA_ARGS__)
-#endif
-
-// TODO remove TU_ASSERT_ERR() later
-
-/*------------- Generator for TU_VERIFY_ERR and TU_VERIFY_ERR_HDLR -------------*/
-#define TU_VERIFY_ERR_DEF2(_error, _handler) do \
-{ \
- uint32_t _err = (uint32_t)(_error); \
- if ( 0 != _err ) { _MESS_ERR(_err); _handler; return _err; } \
-} while(0)
-
-#define TU_VERIFY_ERR_DEF3(_error, _handler, _ret) do \
-{ \
- uint32_t _err = (uint32_t)(_error); \
- if ( 0 != _err ) { _MESS_ERR(_err); _handler; return _ret; } \
-} while(0)
-
-/*------------------------------------------------------------------*/
-/* ASSERT Error
- * basically TU_VERIFY Error with TU_BREAKPOINT() as handler
- *------------------------------------------------------------------*/
-#define ASSERT_ERR_1ARGS(_error) TU_VERIFY_ERR_DEF2(_error, TU_BREAKPOINT())
-#define ASSERT_ERR_2ARGS(_error, _ret) TU_VERIFY_ERR_DEF3(_error, TU_BREAKPOINT(), _ret)
-
-#ifndef TU_ASSERT_ERR
-#define TU_ASSERT_ERR(...) GET_3RD_ARG(__VA_ARGS__, ASSERT_ERR_2ARGS, ASSERT_ERR_1ARGS,UNUSED)(__VA_ARGS__)
-#endif
-
-/*------------------------------------------------------------------*/
-/* ASSERT HDLR
- *------------------------------------------------------------------*/
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* TUSB_VERIFY_H_ */
diff --git a/tinyusb/src/device/dcd.h b/tinyusb/src/device/dcd.h
deleted file mode 100755
index 66767c1f..00000000
--- a/tinyusb/src/device/dcd.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_DCD_H_
-#define _TUSB_DCD_H_
-
-#include "common/tusb_common.h"
-#include "osal/osal.h"
-#include "common/tusb_fifo.h"
-#include "dcd_attr.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Configuration
-//--------------------------------------------------------------------+
-
-#ifndef CFG_TUD_ENDPPOINT_MAX
- #define CFG_TUD_ENDPPOINT_MAX DCD_ATTR_ENDPOINT_MAX
-#endif
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF PROTYPES
-//--------------------------------------------------------------------+
-
-typedef enum
-{
- DCD_EVENT_INVALID = 0,
- DCD_EVENT_BUS_RESET,
- DCD_EVENT_UNPLUGGED,
- DCD_EVENT_SOF,
- DCD_EVENT_SUSPEND, // TODO LPM Sleep L1 support
- DCD_EVENT_RESUME,
-
- DCD_EVENT_SETUP_RECEIVED,
- DCD_EVENT_XFER_COMPLETE,
-
- // Not an DCD event, just a convenient way to defer ISR function
- USBD_EVENT_FUNC_CALL,
-
- DCD_EVENT_COUNT
-} dcd_eventid_t;
-
-typedef struct TU_ATTR_ALIGNED(4)
-{
- uint8_t rhport;
- uint8_t event_id;
-
- union
- {
- // BUS RESET
- struct {
- tusb_speed_t speed;
- } bus_reset;
-
- // SETUP_RECEIVED
- tusb_control_request_t setup_received;
-
- // XFER_COMPLETE
- struct {
- uint8_t ep_addr;
- uint8_t result;
- uint32_t len;
- }xfer_complete;
-
- // FUNC_CALL
- struct {
- void (*func) (void*);
- void* param;
- }func_call;
- };
-} dcd_event_t;
-
-//TU_VERIFY_STATIC(sizeof(dcd_event_t) <= 12, "size is not correct");
-
-//--------------------------------------------------------------------+
-// Controller API
-//--------------------------------------------------------------------+
-
-// Initialize controller to device mode
-void dcd_init (uint8_t rhport);
-
-// Interrupt Handler
-void dcd_int_handler(uint8_t rhport);
-
-// Enable device interrupt
-void dcd_int_enable (uint8_t rhport);
-
-// Disable device interrupt
-void dcd_int_disable(uint8_t rhport);
-
-// Receive Set Address request, mcu port must also include status IN response
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr);
-
-// Wake up host
-void dcd_remote_wakeup(uint8_t rhport);
-
-// Connect by enabling internal pull-up resistor on D+/D-
-void dcd_connect(uint8_t rhport) TU_ATTR_WEAK;
-
-// Disconnect by disabling internal pull-up resistor on D+/D-
-void dcd_disconnect(uint8_t rhport) TU_ATTR_WEAK;
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-
-// Invoked when a control transfer's status stage is complete.
-// May help DCD to prepare for next control transfer, this API is optional.
-void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * request) TU_ATTR_WEAK;
-
-// Configure endpoint's registers according to descriptor
-bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_ep);
-
-// Close an endpoint.
-// Since it is weak, caller must TU_ASSERT this function's existence before calling it.
-void dcd_edpt_close (uint8_t rhport, uint8_t ep_addr) TU_ATTR_WEAK;
-
-// Submit a transfer, When complete dcd_event_xfer_complete() is invoked to notify the stack
-bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes);
-
-// Submit an transfer using fifo, When complete dcd_event_xfer_complete() is invoked to notify the stack
-// This API is optional, may be useful for register-based for transferring data.
-bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes) TU_ATTR_WEAK;
-
-// Stall endpoint
-void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr);
-
-// clear stall, data toggle is also reset to DATA0
-// This API never calls with control endpoints, since it is auto cleared when receiving setup packet
-void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr);
-
-//--------------------------------------------------------------------+
-// Event API (implemented by stack)
-//--------------------------------------------------------------------+
-
-// Called by DCD to notify device stack
-extern void dcd_event_handler(dcd_event_t const * event, bool in_isr);
-
-// helper to send bus signal event
-extern void dcd_event_bus_signal (uint8_t rhport, dcd_eventid_t eid, bool in_isr);
-
-// helper to send bus reset event
-extern void dcd_event_bus_reset (uint8_t rhport, tusb_speed_t speed, bool in_isr);
-
-// helper to send setup received
-extern void dcd_event_setup_received(uint8_t rhport, uint8_t const * setup, bool in_isr);
-
-// helper to send transfer complete event
-extern void dcd_event_xfer_complete (uint8_t rhport, uint8_t ep_addr, uint32_t xferred_bytes, uint8_t result, bool in_isr);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_DCD_H_ */
diff --git a/tinyusb/src/device/dcd_attr.h b/tinyusb/src/device/dcd_attr.h
deleted file mode 100755
index a35fc0ac..00000000
--- a/tinyusb/src/device/dcd_attr.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef TUSB_DCD_ATTR_H_
-#define TUSB_DCD_ATTR_H_
-
-#include "tusb_option.h"
-
-// Attribute includes
-// - ENDPOINT_MAX: max (logical) number of endpoint
-// - ENDPOINT_EXCLUSIVE_NUMBER: endpoint number with different direction IN and OUT aren't allowed,
-// e.g EP1 OUT & EP1 IN cannot exist together
-// - PORT_HIGHSPEED: mask to indicate which port support highspeed mode, bit0 for port0 and so on.
-
-//------------- NXP -------------//
-#if TU_CHECK_MCU(LPC11UXX) || TU_CHECK_MCU(LPC13XX) || TU_CHECK_MCU(LPC15XX)
- #define DCD_ATTR_ENDPOINT_MAX 5
-
-#elif TU_CHECK_MCU(LPC175X_6X) || TU_CHECK_MCU(LPC177X_8X) || TU_CHECK_MCU(LPC40XX)
- #define DCD_ATTR_ENDPOINT_MAX 16
-
-#elif TU_CHECK_MCU(LPC18XX) || TU_CHECK_MCU(LPC43XX)
- // TODO USB0 has 6, USB1 has 4
- #define DCD_ATTR_ENDPOINT_MAX 6
-
-#elif TU_CHECK_MCU(LPC51UXX)
- #define DCD_ATTR_ENDPOINT_MAX 5
-
-#elif TU_CHECK_MCU(LPC54XXX)
- // TODO USB0 has 5, USB1 has 6
- #define DCD_ATTR_ENDPOINT_MAX 6
-
-#elif TU_CHECK_MCU(LPC55XX)
- // TODO USB0 has 5, USB1 has 6
- #define DCD_ATTR_ENDPOINT_MAX 6
-
-#elif TU_CHECK_MCU(MIMXRT10XX)
- #define DCD_ATTR_ENDPOINT_MAX 8
-
-#elif TU_CHECK_MCU(MKL25ZXX) || TU_CHECK_MCU(K32L2BXX)
- #define DCD_ATTR_ENDPOINT_MAX 16
-
-//------------- Nordic -------------//
-#elif TU_CHECK_MCU(NRF5X)
- // 8 CBI + 1 ISO
- #define DCD_ATTR_ENDPOINT_MAX 9
-
-//------------- Microchip -------------//
-#elif TU_CHECK_MCU(SAMD21) || TU_CHECK_MCU(SAMD51) || TU_CHECK_MCU(SAME5X) || \
- TU_CHECK_MCU(SAMD11) || TU_CHECK_MCU(SAML21) || TU_CHECK_MCU(SAML22)
- #define DCD_ATTR_ENDPOINT_MAX 8
-
-#elif TU_CHECK_MCU(SAMG)
- #define DCD_ATTR_ENDPOINT_MAX 6
- #define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
-
-#elif TU_CHECK_MCU(SAMX7X)
- #define DCD_ATTR_ENDPOINT_MAX 10
- #define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
-
-//------------- ST -------------//
-#elif TU_CHECK_MCU(STM32F0) || TU_CHECK_MCU(STM32F1) || TU_CHECK_MCU(STM32F3) || \
- TU_CHECK_MCU(STM32L0) || TU_CHECK_MCU(STM32L1) || TU_CHECK_MCU(STM32L4)
- // F1: F102, F103
- // L4: L4x2, L4x3
- #define DCD_ATTR_ENDPOINT_MAX 8
-
-#elif TU_CHECK_MCU(STM32F2) || TU_CHECK_MCU(STM32F4) || TU_CHECK_MCU(STM32F3)
- // F1: F105, F107 only has 4
- // L4: L4x5, L4x6 has 6
- // For most mcu, FS has 4, HS has 6
- #define DCD_ATTR_ENDPOINT_MAX 6
-
-#elif TU_CHECK_MCU(STM32F7)
- // FS has 6, HS has 9
- #define DCD_ATTR_ENDPOINT_MAX 9
-
-#elif TU_CHECK_MCU(STM32H7)
- #define DCD_ATTR_ENDPOINT_MAX 9
-
-//------------- Sony -------------//
-#elif TU_CHECK_MCU(CXD56)
- #define DCD_ATTR_ENDPOINT_MAX 7
- #define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
-
-//------------- TI -------------//
-#elif TU_CHECK_MCU(MSP430x5xx)
- #define DCD_ATTR_ENDPOINT_MAX 8
-
-//------------- ValentyUSB -------------//
-#elif TU_CHECK_MCU(VALENTYUSB_EPTRI)
- #define DCD_ATTR_ENDPOINT_MAX 16
-
-//------------- Nuvoton -------------//
-#elif TU_CHECK_MCU(NUC121) || TU_CHECK_MCU(NUC126)
- #define DCD_ATTR_ENDPOINT_MAX 8
-
-#elif TU_CHECK_MCU(NUC120)
- #define DCD_ATTR_ENDPOINT_MAX 6
-
-#elif TU_CHECK_MCU(NUC505)
- #define DCD_ATTR_ENDPOINT_MAX 12
-
-//------------- Espressif -------------//
-#elif TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3)
- #define DCD_ATTR_ENDPOINT_MAX 6
-
-//------------- Dialog -------------//
-#elif TU_CHECK_MCU(DA1469X)
- #define DCD_ATTR_ENDPOINT_MAX 4
-
-//------------- Raspberry Pi -------------//
-#elif TU_CHECK_MCU(RP2040)
- #define DCD_ATTR_ENDPOINT_MAX 16
-
-//------------- Silabs -------------//
-#elif TU_CHECK_MCU(EFM32GG) || TU_CHECK_MCU(EFM32GG11) || TU_CHECK_MCU(EFM32GG12)
- #define DCD_ATTR_ENDPOINT_MAX 7
-
-//------------- Renesas -------------//
-#elif TU_CHECK_MCU(RX63X) || TU_CHECK_MCU(RX65X) || TU_CHECK_MCU(RX72N)
- #define DCD_ATTR_ENDPOINT_MAX 10
-
-//#elif TU_CHECK_MCU(MM32F327X)
-// #define DCD_ATTR_ENDPOINT_MAX not known yet
-
-//------------- GigaDevice -------------//
-#elif TU_CHECK_MCU(GD32VF103)
- #define DCD_ATTR_ENDPOINT_MAX 4
-
-#else
- #warning "DCD_ATTR_ENDPOINT_MAX is not defined for this MCU, default to 8"
- #define DCD_ATTR_ENDPOINT_MAX 8
-#endif
-
-// Default to fullspeed if not defined
-//#ifndef PORT_HIGHSPEED
-// #define DCD_ATTR_PORT_HIGHSPEED 0x00
-//#endif
-
-#endif
diff --git a/tinyusb/src/device/usbd.c b/tinyusb/src/device/usbd.c
deleted file mode 100755
index e12dafcf..00000000
--- a/tinyusb/src/device/usbd.c
+++ /dev/null
@@ -1,1353 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED
-
-#include "tusb.h"
-#include "device/usbd.h"
-#include "device/usbd_pvt.h"
-#include "device/dcd.h"
-
-//--------------------------------------------------------------------+
-// USBD Configuration
-//--------------------------------------------------------------------+
-
-// Debug level of USBD
-#define USBD_DBG_LVL 2
-
-#ifndef CFG_TUD_TASK_QUEUE_SZ
- #define CFG_TUD_TASK_QUEUE_SZ 16
-#endif
-
-//--------------------------------------------------------------------+
-// Device Data
-//--------------------------------------------------------------------+
-
-// Invalid driver ID in itf2drv[] ep2drv[][] mapping
-enum { DRVID_INVALID = 0xFFu };
-
-typedef struct
-{
- struct TU_ATTR_PACKED
- {
- volatile uint8_t connected : 1;
- volatile uint8_t addressed : 1;
- volatile uint8_t suspended : 1;
-
- uint8_t remote_wakeup_en : 1; // enable/disable by host
- uint8_t remote_wakeup_support : 1; // configuration descriptor's attribute
- uint8_t self_powered : 1; // configuration descriptor's attribute
- };
-
- volatile uint8_t cfg_num; // current active configuration (0x00 is not configured)
- uint8_t speed;
-
- uint8_t itf2drv[16]; // map interface number to driver (0xff is invalid)
- uint8_t ep2drv[CFG_TUD_ENDPPOINT_MAX][2]; // map endpoint to driver ( 0xff is invalid )
-
- struct TU_ATTR_PACKED
- {
- volatile bool busy : 1;
- volatile bool stalled : 1;
- volatile bool claimed : 1;
-
- // TODO merge ep2drv here, 4-bit should be sufficient
- }ep_status[CFG_TUD_ENDPPOINT_MAX][2];
-
-}usbd_device_t;
-
-static usbd_device_t _usbd_dev;
-
-//--------------------------------------------------------------------+
-// Class Driver
-//--------------------------------------------------------------------+
-#if CFG_TUSB_DEBUG >= 2
- #define DRIVER_NAME(_name) .name = _name,
-#else
- #define DRIVER_NAME(_name)
-#endif
-
-// Built-in class drivers
-static usbd_class_driver_t const _usbd_driver[] =
-{
- #if CFG_TUD_CDC
- {
- DRIVER_NAME("CDC")
- .init = cdcd_init,
- .reset = cdcd_reset,
- .open = cdcd_open,
- .control_xfer_cb = cdcd_control_xfer_cb,
- .xfer_cb = cdcd_xfer_cb,
- .sof = NULL
- },
- #endif
-
- #if CFG_TUD_MSC
- {
- DRIVER_NAME("MSC")
- .init = mscd_init,
- .reset = mscd_reset,
- .open = mscd_open,
- .control_xfer_cb = mscd_control_xfer_cb,
- .xfer_cb = mscd_xfer_cb,
- .sof = NULL
- },
- #endif
-
- #if CFG_TUD_HID
- {
- DRIVER_NAME("HID")
- .init = hidd_init,
- .reset = hidd_reset,
- .open = hidd_open,
- .control_xfer_cb = hidd_control_xfer_cb,
- .xfer_cb = hidd_xfer_cb,
- .sof = NULL
- },
- #endif
-
- #if CFG_TUD_AUDIO
- {
- DRIVER_NAME("AUDIO")
- .init = audiod_init,
- .reset = audiod_reset,
- .open = audiod_open,
- .control_xfer_cb = audiod_control_xfer_cb,
- .xfer_cb = audiod_xfer_cb,
- .sof = NULL
- },
- #endif
-
- #if CFG_TUD_MIDI
- {
- DRIVER_NAME("MIDI")
- .init = midid_init,
- .open = midid_open,
- .reset = midid_reset,
- .control_xfer_cb = midid_control_xfer_cb,
- .xfer_cb = midid_xfer_cb,
- .sof = NULL
- },
- #endif
-
- #if CFG_TUD_VENDOR
- {
- DRIVER_NAME("VENDOR")
- .init = vendord_init,
- .reset = vendord_reset,
- .open = vendord_open,
- .control_xfer_cb = tud_vendor_control_xfer_cb,
- .xfer_cb = vendord_xfer_cb,
- .sof = NULL
- },
- #endif
-
- #if CFG_TUD_USBTMC
- {
- DRIVER_NAME("TMC")
- .init = usbtmcd_init_cb,
- .reset = usbtmcd_reset_cb,
- .open = usbtmcd_open_cb,
- .control_xfer_cb = usbtmcd_control_xfer_cb,
- .xfer_cb = usbtmcd_xfer_cb,
- .sof = NULL
- },
- #endif
-
- #if CFG_TUD_DFU_RUNTIME
- {
- DRIVER_NAME("DFU-RUNTIME")
- .init = dfu_rtd_init,
- .reset = dfu_rtd_reset,
- .open = dfu_rtd_open,
- .control_xfer_cb = dfu_rtd_control_xfer_cb,
- .xfer_cb = NULL,
- .sof = NULL
- },
- #endif
-
- #if CFG_TUD_DFU
- {
- DRIVER_NAME("DFU")
- .init = dfu_moded_init,
- .reset = dfu_moded_reset,
- .open = dfu_moded_open,
- .control_xfer_cb = dfu_moded_control_xfer_cb,
- .xfer_cb = NULL,
- .sof = NULL
- },
- #endif
-
- #if CFG_TUD_NET
- {
- DRIVER_NAME("NET")
- .init = netd_init,
- .reset = netd_reset,
- .open = netd_open,
- .control_xfer_cb = netd_control_xfer_cb,
- .xfer_cb = netd_xfer_cb,
- .sof = NULL,
- },
- #endif
-
- #if CFG_TUD_BTH
- {
- DRIVER_NAME("BTH")
- .init = btd_init,
- .reset = btd_reset,
- .open = btd_open,
- .control_xfer_cb = btd_control_xfer_cb,
- .xfer_cb = btd_xfer_cb,
- .sof = NULL
- },
- #endif
-};
-
-enum { BUILTIN_DRIVER_COUNT = TU_ARRAY_SIZE(_usbd_driver) };
-
-// Additional class drivers implemented by application
-static usbd_class_driver_t const * _app_driver = NULL;
-static uint8_t _app_driver_count = 0;
-
-// virtually joins built-in and application drivers together.
-// Application is positioned first to allow overwriting built-in ones.
-static inline usbd_class_driver_t const * get_driver(uint8_t drvid)
-{
- // Application drivers
- if ( usbd_app_driver_get_cb )
- {
- if ( drvid < _app_driver_count ) return &_app_driver[drvid];
- drvid -= _app_driver_count;
- }
-
- // Built-in drivers
- if (drvid < BUILTIN_DRIVER_COUNT) return &_usbd_driver[drvid];
-
- return NULL;
-}
-
-#define TOTAL_DRIVER_COUNT (_app_driver_count + BUILTIN_DRIVER_COUNT)
-
-//--------------------------------------------------------------------+
-// DCD Event
-//--------------------------------------------------------------------+
-
-static bool _usbd_initialized = false;
-
-// Event queue
-// OPT_MODE_DEVICE is used by OS NONE for mutex (disable usb isr)
-OSAL_QUEUE_DEF(OPT_MODE_DEVICE, _usbd_qdef, CFG_TUD_TASK_QUEUE_SZ, dcd_event_t);
-static osal_queue_t _usbd_q;
-
-// Mutex for claiming endpoint, only needed when using with preempted RTOS
-#if CFG_TUSB_OS != OPT_OS_NONE
-static osal_mutex_def_t _ubsd_mutexdef;
-static osal_mutex_t _usbd_mutex;
-#endif
-
-
-//--------------------------------------------------------------------+
-// Prototypes
-//--------------------------------------------------------------------+
-static bool process_control_request(uint8_t rhport, tusb_control_request_t const * p_request);
-static bool process_set_config(uint8_t rhport, uint8_t cfg_num);
-static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const * p_request);
-
-// from usbd_control.c
-void usbd_control_reset(void);
-void usbd_control_set_request(tusb_control_request_t const *request);
-void usbd_control_set_complete_callback( usbd_control_xfer_cb_t fp );
-bool usbd_control_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes);
-
-
-//--------------------------------------------------------------------+
-// Debug
-//--------------------------------------------------------------------+
-#if CFG_TUSB_DEBUG >= 2
-static char const* const _usbd_event_str[DCD_EVENT_COUNT] =
-{
- "Invalid" ,
- "Bus Reset" ,
- "Unplugged" ,
- "SOF" ,
- "Suspend" ,
- "Resume" ,
- "Setup Received" ,
- "Xfer Complete" ,
- "Func Call"
-};
-
-static char const* const _tusb_std_request_str[] =
-{
- "Get Status" ,
- "Clear Feature" ,
- "Reserved" ,
- "Set Feature" ,
- "Reserved" ,
- "Set Address" ,
- "Get Descriptor" ,
- "Set Descriptor" ,
- "Get Configuration" ,
- "Set Configuration" ,
- "Get Interface" ,
- "Set Interface" ,
- "Synch Frame"
-};
-
-static char const* const _tusb_speed_str[] = { "Full", "Low", "High" };
-
-// for usbd_control to print the name of control complete driver
-void usbd_driver_print_control_complete_name(usbd_control_xfer_cb_t callback)
-{
- for (uint8_t i = 0; i < TOTAL_DRIVER_COUNT; i++)
- {
- usbd_class_driver_t const * driver = get_driver(i);
- if ( driver->control_xfer_cb == callback )
- {
- TU_LOG2(" %s control complete\r\n", driver->name);
- return;
- }
- }
-}
-
-#endif
-
-//--------------------------------------------------------------------+
-// Application API
-//--------------------------------------------------------------------+
-tusb_speed_t tud_speed_get(void)
-{
- return (tusb_speed_t) _usbd_dev.speed;
-}
-
-bool tud_connected(void)
-{
- return _usbd_dev.connected;
-}
-
-bool tud_mounted(void)
-{
- return _usbd_dev.cfg_num ? true : false;
-}
-
-bool tud_suspended(void)
-{
- return _usbd_dev.suspended;
-}
-
-bool tud_remote_wakeup(void)
-{
- // only wake up host if this feature is supported and enabled and we are suspended
- TU_VERIFY (_usbd_dev.suspended && _usbd_dev.remote_wakeup_support && _usbd_dev.remote_wakeup_en );
- dcd_remote_wakeup(TUD_OPT_RHPORT);
- return true;
-}
-
-bool tud_disconnect(void)
-{
- TU_VERIFY(dcd_disconnect);
- dcd_disconnect(TUD_OPT_RHPORT);
- return true;
-}
-
-bool tud_connect(void)
-{
- TU_VERIFY(dcd_connect);
- dcd_connect(TUD_OPT_RHPORT);
- return true;
-}
-
-//--------------------------------------------------------------------+
-// USBD Task
-//--------------------------------------------------------------------+
-bool tud_inited(void)
-{
- return _usbd_initialized;
-}
-
-bool tud_init (uint8_t rhport)
-{
- // skip if already initialized
- if (_usbd_initialized) return _usbd_initialized;
-
- TU_LOG2("USBD init\r\n");
-
- tu_varclr(&_usbd_dev);
-
-#if CFG_TUSB_OS != OPT_OS_NONE
- // Init device mutex
- _usbd_mutex = osal_mutex_create(&_ubsd_mutexdef);
- TU_ASSERT(_usbd_mutex);
-#endif
-
- // Init device queue & task
- _usbd_q = osal_queue_create(&_usbd_qdef);
- TU_ASSERT(_usbd_q);
-
- // Get application driver if available
- if ( usbd_app_driver_get_cb )
- {
- _app_driver = usbd_app_driver_get_cb(&_app_driver_count);
- }
-
- // Init class drivers
- for (uint8_t i = 0; i < TOTAL_DRIVER_COUNT; i++)
- {
- usbd_class_driver_t const * driver = get_driver(i);
- TU_LOG2("%s init\r\n", driver->name);
- driver->init();
- }
-
- // Init device controller driver
- dcd_init(rhport);
- dcd_int_enable(rhport);
-
- _usbd_initialized = true;
-
- return true;
-}
-
-static void usbd_reset(uint8_t rhport)
-{
- tu_varclr(&_usbd_dev);
-
- memset(_usbd_dev.itf2drv, DRVID_INVALID, sizeof(_usbd_dev.itf2drv)); // invalid mapping
- memset(_usbd_dev.ep2drv , DRVID_INVALID, sizeof(_usbd_dev.ep2drv )); // invalid mapping
-
- usbd_control_reset();
-
- for ( uint8_t i = 0; i < TOTAL_DRIVER_COUNT; i++ )
- {
- get_driver(i)->reset(rhport);
- }
-}
-
-bool tud_task_event_ready(void)
-{
- // Skip if stack is not initialized
- if ( !tusb_inited() ) return false;
-
- return !osal_queue_empty(_usbd_q);
-}
-
-/* USB Device Driver task
- * This top level thread manages all device controller event and delegates events to class-specific drivers.
- * This should be called periodically within the mainloop or rtos thread.
- *
- @code
- int main(void)
- {
- application_init();
- tusb_init();
-
- while(1) // the mainloop
- {
- application_code();
- tud_task(); // tinyusb device task
- }
- }
- @endcode
- */
-void tud_task (void)
-{
- // Skip if stack is not initialized
- if ( !tusb_inited() ) return;
-
- // Loop until there is no more events in the queue
- while (1)
- {
- dcd_event_t event;
-
- if ( !osal_queue_receive(_usbd_q, &event) ) return;
-
-#if CFG_TUSB_DEBUG >= 2
- if (event.event_id == DCD_EVENT_SETUP_RECEIVED) TU_LOG2("\r\n"); // extra line for setup
- TU_LOG2("USBD %s ", event.event_id < DCD_EVENT_COUNT ? _usbd_event_str[event.event_id] : "CORRUPTED");
-#endif
-
- switch ( event.event_id )
- {
- case DCD_EVENT_BUS_RESET:
- TU_LOG2(": %s Speed\r\n", _tusb_speed_str[event.bus_reset.speed]);
- usbd_reset(event.rhport);
- _usbd_dev.speed = event.bus_reset.speed;
- break;
-
- case DCD_EVENT_UNPLUGGED:
- TU_LOG2("\r\n");
- usbd_reset(event.rhport);
-
- // invoke callback
- if (tud_umount_cb) tud_umount_cb();
- break;
-
- case DCD_EVENT_SETUP_RECEIVED:
- TU_LOG2_VAR(&event.setup_received);
- TU_LOG2("\r\n");
-
- // Mark as connected after receiving 1st setup packet.
- // But it is easier to set it every time instead of wasting time to check then set
- _usbd_dev.connected = 1;
-
- // mark both in & out control as free
- _usbd_dev.ep_status[0][TUSB_DIR_OUT].busy = false;
- _usbd_dev.ep_status[0][TUSB_DIR_OUT].claimed = 0;
- _usbd_dev.ep_status[0][TUSB_DIR_IN ].busy = false;
- _usbd_dev.ep_status[0][TUSB_DIR_IN ].claimed = 0;
-
- // Process control request
- if ( !process_control_request(event.rhport, &event.setup_received) )
- {
- TU_LOG2(" Stall EP0\r\n");
- // Failed -> stall both control endpoint IN and OUT
- dcd_edpt_stall(event.rhport, 0);
- dcd_edpt_stall(event.rhport, 0 | TUSB_DIR_IN_MASK);
- }
- break;
-
- case DCD_EVENT_XFER_COMPLETE:
- {
- // Invoke the class callback associated with the endpoint address
- uint8_t const ep_addr = event.xfer_complete.ep_addr;
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const ep_dir = tu_edpt_dir(ep_addr);
-
- TU_LOG2("on EP %02X with %u bytes\r\n", ep_addr, (unsigned int) event.xfer_complete.len);
-
- _usbd_dev.ep_status[epnum][ep_dir].busy = false;
- _usbd_dev.ep_status[epnum][ep_dir].claimed = 0;
-
- if ( 0 == epnum )
- {
- usbd_control_xfer_cb(event.rhport, ep_addr, (xfer_result_t)event.xfer_complete.result, event.xfer_complete.len);
- }
- else
- {
- usbd_class_driver_t const * driver = get_driver( _usbd_dev.ep2drv[epnum][ep_dir] );
- TU_ASSERT(driver, );
-
- TU_LOG2(" %s xfer callback\r\n", driver->name);
- driver->xfer_cb(event.rhport, ep_addr, (xfer_result_t)event.xfer_complete.result, event.xfer_complete.len);
- }
- }
- break;
-
- case DCD_EVENT_SUSPEND:
- // NOTE: When plugging/unplugging device, the D+/D- state are unstable and
- // can accidentally meet the SUSPEND condition ( Bus Idle for 3ms ), which result in a series of event
- // e.g suspend -> resume -> unplug/plug. Skip suspend/resume if not connected
- if ( _usbd_dev.connected )
- {
- TU_LOG2(": Remote Wakeup = %u\r\n", _usbd_dev.remote_wakeup_en);
- if (tud_suspend_cb) tud_suspend_cb(_usbd_dev.remote_wakeup_en);
- }else
- {
- TU_LOG2(" Skipped\r\n");
- }
- break;
-
- case DCD_EVENT_RESUME:
- if ( _usbd_dev.connected )
- {
- TU_LOG2("\r\n");
- if (tud_resume_cb) tud_resume_cb();
- }else
- {
- TU_LOG2(" Skipped\r\n");
- }
- break;
-
- case DCD_EVENT_SOF:
- TU_LOG2("\r\n");
- for ( uint8_t i = 0; i < TOTAL_DRIVER_COUNT; i++ )
- {
- usbd_class_driver_t const * driver = get_driver(i);
- if ( driver->sof ) driver->sof(event.rhport);
- }
- break;
-
- case USBD_EVENT_FUNC_CALL:
- TU_LOG2("\r\n");
- if ( event.func_call.func ) event.func_call.func(event.func_call.param);
- break;
-
- default:
- TU_BREAKPOINT();
- break;
- }
- }
-}
-
-//--------------------------------------------------------------------+
-// Control Request Parser & Handling
-//--------------------------------------------------------------------+
-
-// Helper to invoke class driver control request handler
-static bool invoke_class_control(uint8_t rhport, usbd_class_driver_t const * driver, tusb_control_request_t const * request)
-{
- usbd_control_set_complete_callback(driver->control_xfer_cb);
- TU_LOG2(" %s control request\r\n", driver->name);
- return driver->control_xfer_cb(rhport, CONTROL_STAGE_SETUP, request);
-}
-
-// This handles the actual request and its response.
-// return false will cause its caller to stall control endpoint
-static bool process_control_request(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- usbd_control_set_complete_callback(NULL);
-
- TU_ASSERT(p_request->bmRequestType_bit.type < TUSB_REQ_TYPE_INVALID);
-
- // Vendor request
- if ( p_request->bmRequestType_bit.type == TUSB_REQ_TYPE_VENDOR )
- {
- TU_VERIFY(tud_vendor_control_xfer_cb);
-
- usbd_control_set_complete_callback(tud_vendor_control_xfer_cb);
- return tud_vendor_control_xfer_cb(rhport, CONTROL_STAGE_SETUP, p_request);
- }
-
-#if CFG_TUSB_DEBUG >= 2
- if (TUSB_REQ_TYPE_STANDARD == p_request->bmRequestType_bit.type && p_request->bRequest <= TUSB_REQ_SYNCH_FRAME)
- {
- TU_LOG2(" %s", _tusb_std_request_str[p_request->bRequest]);
- if (TUSB_REQ_GET_DESCRIPTOR != p_request->bRequest) TU_LOG2("\r\n");
- }
-#endif
-
- switch ( p_request->bmRequestType_bit.recipient )
- {
- //------------- Device Requests e.g in enumeration -------------//
- case TUSB_REQ_RCPT_DEVICE:
- if ( TUSB_REQ_TYPE_CLASS == p_request->bmRequestType_bit.type )
- {
- uint8_t const itf = tu_u16_low(p_request->wIndex);
- TU_VERIFY(itf < TU_ARRAY_SIZE(_usbd_dev.itf2drv));
-
- usbd_class_driver_t const * driver = get_driver(_usbd_dev.itf2drv[itf]);
- TU_VERIFY(driver);
-
- // forward to class driver: "non-STD request to Interface"
- return invoke_class_control(rhport, driver, p_request);
- }
-
- if ( TUSB_REQ_TYPE_STANDARD != p_request->bmRequestType_bit.type )
- {
- // Non standard request is not supported
- TU_BREAKPOINT();
- return false;
- }
-
- switch ( p_request->bRequest )
- {
- case TUSB_REQ_SET_ADDRESS:
- // Depending on mcu, status phase could be sent either before or after changing device address,
- // or even require stack to not response with status at all
- // Therefore DCD must take full responsibility to response and include zlp status packet if needed.
- usbd_control_set_request(p_request); // set request since DCD has no access to tud_control_status() API
- dcd_set_address(rhport, (uint8_t) p_request->wValue);
- // skip tud_control_status()
- _usbd_dev.addressed = 1;
- break;
-
- case TUSB_REQ_GET_CONFIGURATION:
- {
- uint8_t cfg_num = _usbd_dev.cfg_num;
- tud_control_xfer(rhport, p_request, &cfg_num, 1);
- }
- break;
-
- case TUSB_REQ_SET_CONFIGURATION:
- {
- uint8_t const cfg_num = (uint8_t) p_request->wValue;
-
- if ( !_usbd_dev.cfg_num && cfg_num ) TU_ASSERT( process_set_config(rhport, cfg_num) );
- _usbd_dev.cfg_num = cfg_num;
-
- tud_control_status(rhport, p_request);
- }
- break;
-
- case TUSB_REQ_GET_DESCRIPTOR:
- TU_VERIFY( process_get_descriptor(rhport, p_request) );
- break;
-
- case TUSB_REQ_SET_FEATURE:
- // Only support remote wakeup for device feature
- TU_VERIFY(TUSB_REQ_FEATURE_REMOTE_WAKEUP == p_request->wValue);
-
- TU_LOG(USBD_DBG_LVL, " Enable Remote Wakeup\r\n");
-
- // Host may enable remote wake up before suspending especially HID device
- _usbd_dev.remote_wakeup_en = true;
- tud_control_status(rhport, p_request);
- break;
-
- case TUSB_REQ_CLEAR_FEATURE:
- // Only support remote wakeup for device feature
- TU_VERIFY(TUSB_REQ_FEATURE_REMOTE_WAKEUP == p_request->wValue);
-
- TU_LOG(USBD_DBG_LVL, " Disable Remote Wakeup\r\n");
-
- // Host may disable remote wake up after resuming
- _usbd_dev.remote_wakeup_en = false;
- tud_control_status(rhport, p_request);
- break;
-
- case TUSB_REQ_GET_STATUS:
- {
- // Device status bit mask
- // - Bit 0: Self Powered
- // - Bit 1: Remote Wakeup enabled
- uint16_t status = (_usbd_dev.self_powered ? 1 : 0) | (_usbd_dev.remote_wakeup_en ? 2 : 0);
- tud_control_xfer(rhport, p_request, &status, 2);
- }
- break;
-
- // Unknown/Unsupported request
- default: TU_BREAKPOINT(); return false;
- }
- break;
-
- //------------- Class/Interface Specific Request -------------//
- case TUSB_REQ_RCPT_INTERFACE:
- {
- uint8_t const itf = tu_u16_low(p_request->wIndex);
- TU_VERIFY(itf < TU_ARRAY_SIZE(_usbd_dev.itf2drv));
-
- usbd_class_driver_t const * driver = get_driver(_usbd_dev.itf2drv[itf]);
- TU_VERIFY(driver);
-
- // all requests to Interface (STD or Class) is forwarded to class driver.
- // notable requests are: GET HID REPORT DESCRIPTOR, SET_INTERFACE, GET_INTERFACE
- if ( !invoke_class_control(rhport, driver, p_request) )
- {
- // For GET_INTERFACE and SET_INTERFACE, it is mandatory to respond even if the class
- // driver doesn't use alternate settings or implement this
- TU_VERIFY(TUSB_REQ_TYPE_STANDARD == p_request->bmRequestType_bit.type);
-
- if (TUSB_REQ_GET_INTERFACE == p_request->bRequest)
- {
- uint8_t alternate = 0;
- tud_control_xfer(rhport, p_request, &alternate, 1);
- }else if (TUSB_REQ_SET_INTERFACE == p_request->bRequest)
- {
- tud_control_status(rhport, p_request);
- } else
- {
- return false;
- }
- }
- }
- break;
-
- //------------- Endpoint Request -------------//
- case TUSB_REQ_RCPT_ENDPOINT:
- {
- uint8_t const ep_addr = tu_u16_low(p_request->wIndex);
- uint8_t const ep_num = tu_edpt_number(ep_addr);
- uint8_t const ep_dir = tu_edpt_dir(ep_addr);
-
- TU_ASSERT(ep_num < TU_ARRAY_SIZE(_usbd_dev.ep2drv) );
-
- usbd_class_driver_t const * driver = get_driver(_usbd_dev.ep2drv[ep_num][ep_dir]);
-
- if ( TUSB_REQ_TYPE_STANDARD != p_request->bmRequestType_bit.type )
- {
- // Forward class request to its driver
- TU_VERIFY(driver);
- return invoke_class_control(rhport, driver, p_request);
- }
- else
- {
- // Handle STD request to endpoint
- switch ( p_request->bRequest )
- {
- case TUSB_REQ_GET_STATUS:
- {
- uint16_t status = usbd_edpt_stalled(rhport, ep_addr) ? 0x0001 : 0x0000;
- tud_control_xfer(rhport, p_request, &status, 2);
- }
- break;
-
- case TUSB_REQ_CLEAR_FEATURE:
- case TUSB_REQ_SET_FEATURE:
- {
- if ( TUSB_REQ_FEATURE_EDPT_HALT == p_request->wValue )
- {
- if ( TUSB_REQ_CLEAR_FEATURE == p_request->bRequest )
- {
- usbd_edpt_clear_stall(rhport, ep_addr);
- }else
- {
- usbd_edpt_stall(rhport, ep_addr);
- }
- }
-
- if (driver)
- {
- // Some classes such as USBTMC needs to clear/re-init its buffer when receiving CLEAR_FEATURE request
- // We will also forward std request targeted endpoint to class drivers as well
-
- // STD request must always be ACKed regardless of driver returned value
- // Also clear complete callback if driver set since it can also stall the request.
- (void) invoke_class_control(rhport, driver, p_request);
- usbd_control_set_complete_callback(NULL);
-
- // skip ZLP status if driver already did that
- if ( !_usbd_dev.ep_status[0][TUSB_DIR_IN].busy ) tud_control_status(rhport, p_request);
- }
- }
- break;
-
- // Unknown/Unsupported request
- default: TU_BREAKPOINT(); return false;
- }
- }
- }
- break;
-
- // Unknown recipient
- default: TU_BREAKPOINT(); return false;
- }
-
- return true;
-}
-
-// Process Set Configure Request
-// This function parse configuration descriptor & open drivers accordingly
-static bool process_set_config(uint8_t rhport, uint8_t cfg_num)
-{
- tusb_desc_configuration_t const * desc_cfg = (tusb_desc_configuration_t const *) tud_descriptor_configuration_cb(cfg_num-1); // index is cfg_num-1
- TU_ASSERT(desc_cfg != NULL && desc_cfg->bDescriptorType == TUSB_DESC_CONFIGURATION);
-
- // Parse configuration descriptor
- _usbd_dev.remote_wakeup_support = (desc_cfg->bmAttributes & TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP) ? 1 : 0;
- _usbd_dev.self_powered = (desc_cfg->bmAttributes & TUSB_DESC_CONFIG_ATT_SELF_POWERED) ? 1 : 0;
-
- // Parse interface descriptor
- uint8_t const * p_desc = ((uint8_t const*) desc_cfg) + sizeof(tusb_desc_configuration_t);
- uint8_t const * desc_end = ((uint8_t const*) desc_cfg) + tu_le16toh(desc_cfg->wTotalLength);
-
- while( p_desc < desc_end )
- {
- tusb_desc_interface_assoc_t const * desc_iad = NULL;
-
- // Class will always starts with Interface Association (if any) and then Interface descriptor
- if ( TUSB_DESC_INTERFACE_ASSOCIATION == tu_desc_type(p_desc) )
- {
- desc_iad = (tusb_desc_interface_assoc_t const *) p_desc;
- p_desc = tu_desc_next(p_desc); // next to Interface
- }
-
- TU_ASSERT( TUSB_DESC_INTERFACE == tu_desc_type(p_desc) );
-
- tusb_desc_interface_t const * desc_itf = (tusb_desc_interface_t const*) p_desc;
- uint16_t const remaining_len = desc_end-p_desc;
-
- // Interface number must not be used already
- TU_ASSERT(DRVID_INVALID == _usbd_dev.itf2drv[desc_itf->bInterfaceNumber]);
-
- // TODO usbd can calculate the total length used for driver --> driver open() does not need to calculate it
- // uint16_t const drv_len = tu_desc_get_interface_total_len(desc_itf, desc_iad ? desc_iad->bInterfaceCount : 1, desc_end-p_desc);
-
- // Find driver for this interface
- uint8_t drv_id;
- for (drv_id = 0; drv_id < TOTAL_DRIVER_COUNT; drv_id++)
- {
- usbd_class_driver_t const *driver = get_driver(drv_id);
- uint16_t const drv_len = driver->open(rhport, desc_itf, remaining_len);
-
- if ( drv_len > 0 )
- {
- // Open successfully, check if length is correct
- TU_ASSERT( sizeof(tusb_desc_interface_t) <= drv_len && drv_len <= remaining_len);
-
- TU_LOG2(" %s opened\r\n", driver->name);
-
- // bind interface to found driver
- _usbd_dev.itf2drv[desc_itf->bInterfaceNumber] = drv_id;
-
- // If using IAD, bind all interfaces to the same driver
- if (desc_iad)
- {
- // IAD's first interface number and class should match with opened interface
- TU_ASSERT(desc_iad->bFirstInterface == desc_itf->bInterfaceNumber &&
- desc_iad->bFunctionClass == desc_itf->bInterfaceClass);
-
- for(uint8_t i=1; i<desc_iad->bInterfaceCount; i++)
- {
- _usbd_dev.itf2drv[desc_itf->bInterfaceNumber+i] = drv_id;
- }
- }
-
- // bind all endpoints to found driver
- tu_edpt_bind_driver(_usbd_dev.ep2drv, desc_itf, drv_len, drv_id);
-
- p_desc += drv_len; // next interface
-
- break; // exit driver find loop
- }
- }
-
- // Failed if cannot find supported driver
- TU_ASSERT(drv_id < TOTAL_DRIVER_COUNT);
- }
-
- // invoke callback
- if (tud_mount_cb) tud_mount_cb();
-
- return true;
-}
-
-// return descriptor's buffer and update desc_len
-static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const * p_request)
-{
- tusb_desc_type_t const desc_type = (tusb_desc_type_t) tu_u16_high(p_request->wValue);
- uint8_t const desc_index = tu_u16_low( p_request->wValue );
-
- switch(desc_type)
- {
- case TUSB_DESC_DEVICE:
- {
- TU_LOG2(" Device\r\n");
-
- uint16_t len = sizeof(tusb_desc_device_t);
-
- // Only send up to EP0 Packet Size if not addressed
- // This only happens with the very first get device descriptor and EP0 size = 8 or 16.
- if ((CFG_TUD_ENDPOINT0_SIZE < sizeof(tusb_desc_device_t)) && !_usbd_dev.addressed)
- {
- len = CFG_TUD_ENDPOINT0_SIZE;
-
- // Hack here: we modify the request length to prevent usbd_control response with zlp
- ((tusb_control_request_t*) p_request)->wLength = CFG_TUD_ENDPOINT0_SIZE;
- }
-
- return tud_control_xfer(rhport, p_request, (void*) tud_descriptor_device_cb(), len);
- }
- break;
-
- case TUSB_DESC_BOS:
- {
- TU_LOG2(" BOS\r\n");
-
- // requested by host if USB > 2.0 ( i.e 2.1 or 3.x )
- if (!tud_descriptor_bos_cb) return false;
-
- tusb_desc_bos_t const* desc_bos = (tusb_desc_bos_t const*) tud_descriptor_bos_cb();
-
- // Use offsetof to avoid pointer to the odd/misaligned address
- uint16_t const total_len = tu_le16toh( tu_unaligned_read16((uint8_t*) desc_bos + offsetof(tusb_desc_bos_t, wTotalLength)) );
-
- return tud_control_xfer(rhport, p_request, (void*) desc_bos, total_len);
- }
- break;
-
- case TUSB_DESC_CONFIGURATION:
- {
- TU_LOG2(" Configuration[%u]\r\n", desc_index);
-
- tusb_desc_configuration_t const* desc_config = (tusb_desc_configuration_t const*) tud_descriptor_configuration_cb(desc_index);
- TU_ASSERT(desc_config);
-
- // Use offsetof to avoid pointer to the odd/misaligned address
- uint16_t const total_len = tu_le16toh( tu_unaligned_read16((uint8_t*) desc_config + offsetof(tusb_desc_configuration_t, wTotalLength)) );
-
- return tud_control_xfer(rhport, p_request, (void*) desc_config, total_len);
- }
- break;
-
- case TUSB_DESC_STRING:
- {
- TU_LOG2(" String[%u]\r\n", desc_index);
-
- // String Descriptor always uses the desc set from user
- uint8_t const* desc_str = (uint8_t const*) tud_descriptor_string_cb(desc_index, p_request->wIndex);
- TU_VERIFY(desc_str);
-
- // first byte of descriptor is its size
- return tud_control_xfer(rhport, p_request, (void*) desc_str, desc_str[0]);
- }
- break;
-
- case TUSB_DESC_DEVICE_QUALIFIER:
- TU_LOG2(" Device Qualifier\r\n");
-
- // Host sends this request to ask why our device with USB BCD from 2.0
- // but is running at Full/Low Speed. If not highspeed capable stall this request,
- // otherwise return the descriptor that could work in highspeed mode
- if ( tud_descriptor_device_qualifier_cb )
- {
- uint8_t const* desc_qualifier = tud_descriptor_device_qualifier_cb();
- TU_ASSERT(desc_qualifier);
-
- // first byte of descriptor is its size
- return tud_control_xfer(rhport, p_request, (void*) desc_qualifier, desc_qualifier[0]);
- }else
- {
- return false;
- }
- break;
-
- case TUSB_DESC_OTHER_SPEED_CONFIG:
- TU_LOG2(" Other Speed Configuration\r\n");
-
- // After Device Qualifier descriptor is received host will ask for this descriptor
- return false; // not supported
- break;
-
- default: return false;
- }
-}
-
-//--------------------------------------------------------------------+
-// DCD Event Handler
-//--------------------------------------------------------------------+
-void dcd_event_handler(dcd_event_t const * event, bool in_isr)
-{
- switch (event->event_id)
- {
- case DCD_EVENT_UNPLUGGED:
- // UNPLUGGED event can be bouncing, only processing if we are currently connected
- if ( _usbd_dev.connected )
- {
- _usbd_dev.connected = 0;
- _usbd_dev.addressed = 0;
- _usbd_dev.cfg_num = 0;
- _usbd_dev.suspended = 0;
- osal_queue_send(_usbd_q, event, in_isr);
- }
- break;
-
- case DCD_EVENT_SUSPEND:
- // NOTE: When plugging/unplugging device, the D+/D- state are unstable and
- // can accidentally meet the SUSPEND condition ( Bus Idle for 3ms ).
- // In addition, some MCUs such as SAMD or boards that haven no VBUS detection cannot distinguish
- // suspended vs disconnected. We will skip handling SUSPEND/RESUME event if not currently connected
- if ( _usbd_dev.connected )
- {
- _usbd_dev.suspended = 1;
- osal_queue_send(_usbd_q, event, in_isr);
- }
- break;
-
- case DCD_EVENT_RESUME:
- // skip event if not connected (especially required for SAMD)
- if ( _usbd_dev.connected )
- {
- _usbd_dev.suspended = 0;
- osal_queue_send(_usbd_q, event, in_isr);
- }
- break;
-
- case DCD_EVENT_SOF:
- // Some MCUs after running dcd_remote_wakeup() does not have way to detect the end of remote wakeup
- // which last 1-15 ms. DCD can use SOF as a clear indicator that bus is back to operational
- if ( _usbd_dev.suspended )
- {
- _usbd_dev.suspended = 0;
- dcd_event_t const event_resume = { .rhport = event->rhport, .event_id = DCD_EVENT_RESUME };
- osal_queue_send(_usbd_q, &event_resume, in_isr);
- }
- break;
-
- default:
- osal_queue_send(_usbd_q, event, in_isr);
- break;
- }
-}
-
-void dcd_event_bus_signal (uint8_t rhport, dcd_eventid_t eid, bool in_isr)
-{
- dcd_event_t event = { .rhport = rhport, .event_id = eid };
- dcd_event_handler(&event, in_isr);
-}
-
-void dcd_event_bus_reset (uint8_t rhport, tusb_speed_t speed, bool in_isr)
-{
- dcd_event_t event = { .rhport = rhport, .event_id = DCD_EVENT_BUS_RESET };
- event.bus_reset.speed = speed;
- dcd_event_handler(&event, in_isr);
-}
-
-void dcd_event_setup_received(uint8_t rhport, uint8_t const * setup, bool in_isr)
-{
- dcd_event_t event = { .rhport = rhport, .event_id = DCD_EVENT_SETUP_RECEIVED };
- memcpy(&event.setup_received, setup, 8);
-
- dcd_event_handler(&event, in_isr);
-}
-
-void dcd_event_xfer_complete (uint8_t rhport, uint8_t ep_addr, uint32_t xferred_bytes, uint8_t result, bool in_isr)
-{
- dcd_event_t event = { .rhport = rhport, .event_id = DCD_EVENT_XFER_COMPLETE };
-
- event.xfer_complete.ep_addr = ep_addr;
- event.xfer_complete.len = xferred_bytes;
- event.xfer_complete.result = result;
-
- dcd_event_handler(&event, in_isr);
-}
-
-//--------------------------------------------------------------------+
-// USBD API For Class Driver
-//--------------------------------------------------------------------+
-
-// Parse consecutive endpoint descriptors (IN & OUT)
-bool usbd_open_edpt_pair(uint8_t rhport, uint8_t const* p_desc, uint8_t ep_count, uint8_t xfer_type, uint8_t* ep_out, uint8_t* ep_in)
-{
- for(int i=0; i<ep_count; i++)
- {
- tusb_desc_endpoint_t const * desc_ep = (tusb_desc_endpoint_t const *) p_desc;
-
- TU_ASSERT(TUSB_DESC_ENDPOINT == desc_ep->bDescriptorType && xfer_type == desc_ep->bmAttributes.xfer);
- TU_ASSERT(usbd_edpt_open(rhport, desc_ep));
-
- if ( tu_edpt_dir(desc_ep->bEndpointAddress) == TUSB_DIR_IN )
- {
- (*ep_in) = desc_ep->bEndpointAddress;
- }else
- {
- (*ep_out) = desc_ep->bEndpointAddress;
- }
-
- p_desc = tu_desc_next(p_desc);
- }
-
- return true;
-}
-
-// Helper to defer an isr function
-void usbd_defer_func(osal_task_func_t func, void* param, bool in_isr)
-{
- dcd_event_t event =
- {
- .rhport = 0,
- .event_id = USBD_EVENT_FUNC_CALL,
- };
-
- event.func_call.func = func;
- event.func_call.param = param;
-
- dcd_event_handler(&event, in_isr);
-}
-
-//--------------------------------------------------------------------+
-// USBD Endpoint API
-//--------------------------------------------------------------------+
-
-bool usbd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * desc_ep)
-{
- TU_ASSERT(tu_edpt_number(desc_ep->bEndpointAddress) < CFG_TUD_ENDPPOINT_MAX);
- TU_ASSERT(tu_edpt_validate(desc_ep, (tusb_speed_t) _usbd_dev.speed));
-
- return dcd_edpt_open(rhport, desc_ep);
-}
-
-bool usbd_edpt_claim(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- // TODO add this check later, also make sure we don't starve an out endpoint while suspending
- // TU_VERIFY(tud_ready());
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
-#if CFG_TUSB_OS != OPT_OS_NONE
- // pre-check to help reducing mutex lock
- TU_VERIFY((_usbd_dev.ep_status[epnum][dir].busy == 0) && (_usbd_dev.ep_status[epnum][dir].claimed == 0));
- osal_mutex_lock(_usbd_mutex, OSAL_TIMEOUT_WAIT_FOREVER);
-#endif
-
- // can only claim the endpoint if it is not busy and not claimed yet.
- bool const ret = (_usbd_dev.ep_status[epnum][dir].busy == 0) && (_usbd_dev.ep_status[epnum][dir].claimed == 0);
- if (ret)
- {
- _usbd_dev.ep_status[epnum][dir].claimed = 1;
- }
-
-#if CFG_TUSB_OS != OPT_OS_NONE
- osal_mutex_unlock(_usbd_mutex);
-#endif
-
- return ret;
-}
-
-bool usbd_edpt_release(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
-#if CFG_TUSB_OS != OPT_OS_NONE
- osal_mutex_lock(_usbd_mutex, OSAL_TIMEOUT_WAIT_FOREVER);
-#endif
-
- // can only release the endpoint if it is claimed and not busy
- bool const ret = (_usbd_dev.ep_status[epnum][dir].busy == 0) && (_usbd_dev.ep_status[epnum][dir].claimed == 1);
- if (ret)
- {
- _usbd_dev.ep_status[epnum][dir].claimed = 0;
- }
-
-#if CFG_TUSB_OS != OPT_OS_NONE
- osal_mutex_unlock(_usbd_mutex);
-#endif
-
- return ret;
-}
-
-bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- // TODO skip ready() check for now since enumeration also use this API
- // TU_VERIFY(tud_ready());
-
- TU_LOG2(" Queue EP %02X with %u bytes ...\r\n", ep_addr, total_bytes);
-
- // Attempt to transfer on a busy endpoint, sound like an race condition !
- TU_ASSERT(_usbd_dev.ep_status[epnum][dir].busy == 0);
-
- // Set busy first since the actual transfer can be complete before dcd_edpt_xfer()
- // could return and USBD task can preempt and clear the busy
- _usbd_dev.ep_status[epnum][dir].busy = true;
-
- if ( dcd_edpt_xfer(rhport, ep_addr, buffer, total_bytes) )
- {
- return true;
- }else
- {
- // DCD error, mark endpoint as ready to allow next transfer
- _usbd_dev.ep_status[epnum][dir].busy = false;
- _usbd_dev.ep_status[epnum][dir].claimed = 0;
- TU_LOG2("FAILED\r\n");
- TU_BREAKPOINT();
- return false;
- }
-}
-
-// The number of bytes has to be given explicitly to allow more flexible control of how many
-// bytes should be written and second to keep the return value free to give back a boolean
-// success message. If total_bytes is too big, the FIFO will copy only what is available
-// into the USB buffer!
-bool usbd_edpt_xfer_fifo(uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- TU_LOG2(" Queue ISO EP %02X with %u bytes ... ", ep_addr, total_bytes);
-
- // Attempt to transfer on a busy endpoint, sound like an race condition !
- TU_ASSERT(_usbd_dev.ep_status[epnum][dir].busy == 0);
-
- // Set busy first since the actual transfer can be complete before dcd_edpt_xfer() could return
- // and usbd task can preempt and clear the busy
- _usbd_dev.ep_status[epnum][dir].busy = true;
-
- if (dcd_edpt_xfer_fifo(rhport, ep_addr, ff, total_bytes))
- {
- TU_LOG2("OK\r\n");
- return true;
- }else
- {
- // DCD error, mark endpoint as ready to allow next transfer
- _usbd_dev.ep_status[epnum][dir].busy = false;
- _usbd_dev.ep_status[epnum][dir].claimed = 0;
- TU_LOG2("failed\r\n");
- TU_BREAKPOINT();
- return false;
- }
-}
-
-bool usbd_edpt_busy(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- return _usbd_dev.ep_status[epnum][dir].busy;
-}
-
-void usbd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- TU_LOG(USBD_DBG_LVL, " Stall EP %02X", ep_addr);
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- dcd_edpt_stall(rhport, ep_addr);
- _usbd_dev.ep_status[epnum][dir].stalled = true;
- _usbd_dev.ep_status[epnum][dir].busy = true;
-}
-
-void usbd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- TU_LOG(USBD_DBG_LVL, " Clear Stall EP %02X", ep_addr);
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
-
- dcd_edpt_clear_stall(rhport, ep_addr);
- _usbd_dev.ep_status[epnum][dir].stalled = false;
- _usbd_dev.ep_status[epnum][dir].busy = false;
-}
-
-bool usbd_edpt_stalled(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- return _usbd_dev.ep_status[epnum][dir].stalled;
-}
-
-/**
- * usbd_edpt_close will disable an endpoint.
- *
- * In progress transfers on this EP may be delivered after this call.
- *
- */
-void usbd_edpt_close(uint8_t rhport, uint8_t ep_addr)
-{
- TU_ASSERT(dcd_edpt_close, /**/);
- TU_LOG2(" CLOSING Endpoint: 0x%02X\r\n", ep_addr);
-
- dcd_edpt_close(rhport, ep_addr);
-
- return;
-}
-
-#endif
diff --git a/tinyusb/src/device/usbd.h b/tinyusb/src/device/usbd.h
deleted file mode 100755
index c85616c9..00000000
--- a/tinyusb/src/device/usbd.h
+++ /dev/null
@@ -1,783 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_USBD_H_
-#define _TUSB_USBD_H_
-
-#include "common/tusb_common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Application API
-//--------------------------------------------------------------------+
-
-// Init device stack
-bool tud_init (uint8_t rhport);
-
-// Check if device stack is already initialized
-bool tud_inited(void);
-
-// Task function should be called in main/rtos loop
-void tud_task (void);
-
-// Check if there is pending events need proccessing by tud_task()
-bool tud_task_event_ready(void);
-
-// Interrupt handler, name alias to DCD
-extern void dcd_int_handler(uint8_t rhport);
-#define tud_int_handler dcd_int_handler
-
-// Get current bus speed
-tusb_speed_t tud_speed_get(void);
-
-// Check if device is connected (may not mounted/configured yet)
-// True if just got out of Bus Reset and received the very first data from host
-bool tud_connected(void);
-
-// Check if device is connected and configured
-bool tud_mounted(void);
-
-// Check if device is suspended
-bool tud_suspended(void);
-
-// Check if device is ready to transfer
-TU_ATTR_ALWAYS_INLINE static inline
-bool tud_ready(void)
-{
- return tud_mounted() && !tud_suspended();
-}
-
-// Remote wake up host, only if suspended and enabled by host
-bool tud_remote_wakeup(void);
-
-// Enable pull-up resistor on D+ D-
-// Return false on unsupported MCUs
-bool tud_disconnect(void);
-
-// Disable pull-up resistor on D+ D-
-// Return false on unsupported MCUs
-bool tud_connect(void);
-
-// Carry out Data and Status stage of control transfer
-// - If len = 0, it is equivalent to sending status only
-// - If len > wLength : it will be truncated
-bool tud_control_xfer(uint8_t rhport, tusb_control_request_t const * request, void* buffer, uint16_t len);
-
-// Send STATUS (zero length) packet
-bool tud_control_status(uint8_t rhport, tusb_control_request_t const * request);
-
-//--------------------------------------------------------------------+
-// Application Callbacks (WEAK is optional)
-//--------------------------------------------------------------------+
-
-// Invoked when received GET DEVICE DESCRIPTOR request
-// Application return pointer to descriptor
-uint8_t const * tud_descriptor_device_cb(void);
-
-// Invoked when received GET CONFIGURATION DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index);
-
-// Invoked when received GET STRING DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid);
-
-// Invoked when received GET BOS DESCRIPTOR request
-// Application return pointer to descriptor
-TU_ATTR_WEAK uint8_t const * tud_descriptor_bos_cb(void);
-
-// Invoked when received GET DEVICE QUALIFIER DESCRIPTOR request
-// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
-TU_ATTR_WEAK uint8_t const* tud_descriptor_device_qualifier_cb(void);
-
-// Invoked when device is mounted (configured)
-TU_ATTR_WEAK void tud_mount_cb(void);
-
-// Invoked when device is unmounted
-TU_ATTR_WEAK void tud_umount_cb(void);
-
-// Invoked when usb bus is suspended
-// Within 7ms, device must draw an average of current less than 2.5 mA from bus
-TU_ATTR_WEAK void tud_suspend_cb(bool remote_wakeup_en);
-
-// Invoked when usb bus is resumed
-TU_ATTR_WEAK void tud_resume_cb(void);
-
-// Invoked when received control request with VENDOR TYPE
-TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
-
-//--------------------------------------------------------------------+
-// Binary Device Object Store (BOS) Descriptor Templates
-//--------------------------------------------------------------------+
-
-#define TUD_BOS_DESC_LEN 5
-
-// total length, number of device caps
-#define TUD_BOS_DESCRIPTOR(_total_len, _caps_num) \
- 5, TUSB_DESC_BOS, U16_TO_U8S_LE(_total_len), _caps_num
-
-// Device Capability Platform 128-bit UUID + Data
-#define TUD_BOS_PLATFORM_DESCRIPTOR(...) \
- 4+TU_ARGS_NUM(__VA_ARGS__), TUSB_DESC_DEVICE_CAPABILITY, DEVICE_CAPABILITY_PLATFORM, 0x00, __VA_ARGS__
-
-//------------- WebUSB BOS Platform -------------//
-
-// Descriptor Length
-#define TUD_BOS_WEBUSB_DESC_LEN 24
-
-// Vendor Code, iLandingPage
-#define TUD_BOS_WEBUSB_DESCRIPTOR(_vendor_code, _ipage) \
- TUD_BOS_PLATFORM_DESCRIPTOR(TUD_BOS_WEBUSB_UUID, U16_TO_U8S_LE(0x0100), _vendor_code, _ipage)
-
-#define TUD_BOS_WEBUSB_UUID \
- 0x38, 0xB6, 0x08, 0x34, 0xA9, 0x09, 0xA0, 0x47, \
- 0x8B, 0xFD, 0xA0, 0x76, 0x88, 0x15, 0xB6, 0x65
-
-//------------- Microsoft OS 2.0 Platform -------------//
-#define TUD_BOS_MICROSOFT_OS_DESC_LEN 28
-
-// Total Length of descriptor set, vendor code
-#define TUD_BOS_MS_OS_20_DESCRIPTOR(_desc_set_len, _vendor_code) \
- TUD_BOS_PLATFORM_DESCRIPTOR(TUD_BOS_MS_OS_20_UUID, U32_TO_U8S_LE(0x06030000), U16_TO_U8S_LE(_desc_set_len), _vendor_code, 0)
-
-#define TUD_BOS_MS_OS_20_UUID \
- 0xDF, 0x60, 0xDD, 0xD8, 0x89, 0x45, 0xC7, 0x4C, \
- 0x9C, 0xD2, 0x65, 0x9D, 0x9E, 0x64, 0x8A, 0x9F
-
-//--------------------------------------------------------------------+
-// Configuration & Interface Descriptor Templates
-//--------------------------------------------------------------------+
-
-//------------- Configuration -------------//
-#define TUD_CONFIG_DESC_LEN (9)
-
-// Config number, interface count, string index, total length, attribute, power in mA
-#define TUD_CONFIG_DESCRIPTOR(config_num, _itfcount, _stridx, _total_len, _attribute, _power_ma) \
- 9, TUSB_DESC_CONFIGURATION, U16_TO_U8S_LE(_total_len), _itfcount, config_num, _stridx, TU_BIT(7) | _attribute, (_power_ma)/2
-
-//------------- CDC -------------//
-
-// Length of template descriptor: 66 bytes
-#define TUD_CDC_DESC_LEN (8+9+5+5+4+5+7+9+7+7)
-
-// CDC Descriptor Template
-// Interface number, string index, EP notification address and size, EP data address (out, in) and size.
-#define TUD_CDC_DESCRIPTOR(_itfnum, _stridx, _ep_notif, _ep_notif_size, _epout, _epin, _epsize) \
- /* Interface Associate */\
- 8, TUSB_DESC_INTERFACE_ASSOCIATION, _itfnum, 2, TUSB_CLASS_CDC, CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL, CDC_COMM_PROTOCOL_NONE, 0,\
- /* CDC Control Interface */\
- 9, TUSB_DESC_INTERFACE, _itfnum, 0, 1, TUSB_CLASS_CDC, CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL, CDC_COMM_PROTOCOL_NONE, _stridx,\
- /* CDC Header */\
- 5, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_HEADER, U16_TO_U8S_LE(0x0120),\
- /* CDC Call */\
- 5, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_CALL_MANAGEMENT, 0, (uint8_t)((_itfnum) + 1),\
- /* CDC ACM: support line request */\
- 4, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, 2,\
- /* CDC Union */\
- 5, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_UNION, _itfnum, (uint8_t)((_itfnum) + 1),\
- /* Endpoint Notification */\
- 7, TUSB_DESC_ENDPOINT, _ep_notif, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_ep_notif_size), 16,\
- /* CDC Data Interface */\
- 9, TUSB_DESC_INTERFACE, (uint8_t)((_itfnum)+1), 0, 2, TUSB_CLASS_CDC_DATA, 0, 0, 0,\
- /* Endpoint Out */\
- 7, TUSB_DESC_ENDPOINT, _epout, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0,\
- /* Endpoint In */\
- 7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0
-
-//------------- MSC -------------//
-
-// Length of template descriptor: 23 bytes
-#define TUD_MSC_DESC_LEN (9 + 7 + 7)
-
-// Interface number, string index, EP Out & EP In address, EP size
-#define TUD_MSC_DESCRIPTOR(_itfnum, _stridx, _epout, _epin, _epsize) \
- /* Interface */\
- 9, TUSB_DESC_INTERFACE, _itfnum, 0, 2, TUSB_CLASS_MSC, MSC_SUBCLASS_SCSI, MSC_PROTOCOL_BOT, _stridx,\
- /* Endpoint Out */\
- 7, TUSB_DESC_ENDPOINT, _epout, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0,\
- /* Endpoint In */\
- 7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0
-
-//------------- HID -------------//
-
-// Length of template descriptor: 25 bytes
-#define TUD_HID_DESC_LEN (9 + 9 + 7)
-
-// HID Input only descriptor
-// Interface number, string index, protocol, report descriptor len, EP In address, size & polling interval
-#define TUD_HID_DESCRIPTOR(_itfnum, _stridx, _boot_protocol, _report_desc_len, _epin, _epsize, _ep_interval) \
- /* Interface */\
- 9, TUSB_DESC_INTERFACE, _itfnum, 0, 1, TUSB_CLASS_HID, (uint8_t)((_boot_protocol) ? (uint8_t)HID_SUBCLASS_BOOT : 0), _boot_protocol, _stridx,\
- /* HID descriptor */\
- 9, HID_DESC_TYPE_HID, U16_TO_U8S_LE(0x0111), 0, 1, HID_DESC_TYPE_REPORT, U16_TO_U8S_LE(_report_desc_len),\
- /* Endpoint In */\
- 7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_epsize), _ep_interval
-
-// Length of template descriptor: 32 bytes
-#define TUD_HID_INOUT_DESC_LEN (9 + 9 + 7 + 7)
-
-// HID Input & Output descriptor
-// Interface number, string index, protocol, report descriptor len, EP OUT & IN address, size & polling interval
-#define TUD_HID_INOUT_DESCRIPTOR(_itfnum, _stridx, _boot_protocol, _report_desc_len, _epout, _epin, _epsize, _ep_interval) \
- /* Interface */\
- 9, TUSB_DESC_INTERFACE, _itfnum, 0, 2, TUSB_CLASS_HID, (uint8_t)((_boot_protocol) ? (uint8_t)HID_SUBCLASS_BOOT : 0), _boot_protocol, _stridx,\
- /* HID descriptor */\
- 9, HID_DESC_TYPE_HID, U16_TO_U8S_LE(0x0111), 0, 1, HID_DESC_TYPE_REPORT, U16_TO_U8S_LE(_report_desc_len),\
- /* Endpoint Out */\
- 7, TUSB_DESC_ENDPOINT, _epout, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_epsize), _ep_interval, \
- /* Endpoint In */\
- 7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_epsize), _ep_interval
-
-//------------- MIDI -------------//
-// MIDI v1.0 is based on Audio v1.0
-
-#define TUD_MIDI_DESC_HEAD_LEN (9 + 9 + 9 + 7)
-#define TUD_MIDI_DESC_HEAD(_itfnum, _stridx, _numcables) \
- /* Audio Control (AC) Interface */\
- 9, TUSB_DESC_INTERFACE, _itfnum, 0, 0, TUSB_CLASS_AUDIO, AUDIO_SUBCLASS_CONTROL, AUDIO_FUNC_PROTOCOL_CODE_UNDEF, _stridx,\
- /* AC Header */\
- 9, TUSB_DESC_CS_INTERFACE, AUDIO_CS_AC_INTERFACE_HEADER, U16_TO_U8S_LE(0x0100), U16_TO_U8S_LE(0x0009), 1, (uint8_t)((_itfnum) + 1),\
- /* MIDI Streaming (MS) Interface */\
- 9, TUSB_DESC_INTERFACE, (uint8_t)((_itfnum) + 1), 0, 2, TUSB_CLASS_AUDIO, AUDIO_SUBCLASS_MIDI_STREAMING, AUDIO_FUNC_PROTOCOL_CODE_UNDEF, 0,\
- /* MS Header */\
- 7, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_HEADER, U16_TO_U8S_LE(0x0100), U16_TO_U8S_LE(7 + (_numcables) * TUD_MIDI_DESC_JACK_LEN)
-
-#define TUD_MIDI_JACKID_IN_EMB(_cablenum) \
- (uint8_t)(((_cablenum) - 1) * 4 + 1)
-
-#define TUD_MIDI_JACKID_IN_EXT(_cablenum) \
- (uint8_t)(((_cablenum) - 1) * 4 + 2)
-
-#define TUD_MIDI_JACKID_OUT_EMB(_cablenum) \
- (uint8_t)(((_cablenum) - 1) * 4 + 3)
-
-#define TUD_MIDI_JACKID_OUT_EXT(_cablenum) \
- (uint8_t)(((_cablenum) - 1) * 4 + 4)
-
-#define TUD_MIDI_DESC_JACK_LEN (6 + 6 + 9 + 9)
-#define TUD_MIDI_DESC_JACK(_cablenum) \
- /* MS In Jack (Embedded) */\
- 6, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_IN_JACK, MIDI_JACK_EMBEDDED, TUD_MIDI_JACKID_IN_EMB(_cablenum), 0,\
- /* MS In Jack (External) */\
- 6, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_IN_JACK, MIDI_JACK_EXTERNAL, TUD_MIDI_JACKID_IN_EXT(_cablenum), 0,\
- /* MS Out Jack (Embedded), connected to In Jack External */\
- 9, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_OUT_JACK, MIDI_JACK_EMBEDDED, TUD_MIDI_JACKID_OUT_EMB(_cablenum), 1, TUD_MIDI_JACKID_IN_EXT(_cablenum), 1, 0,\
- /* MS Out Jack (External), connected to In Jack Embedded */\
- 9, TUSB_DESC_CS_INTERFACE, MIDI_CS_INTERFACE_OUT_JACK, MIDI_JACK_EXTERNAL, TUD_MIDI_JACKID_OUT_EXT(_cablenum), 1, TUD_MIDI_JACKID_IN_EMB(_cablenum), 1, 0
-
-#define TUD_MIDI_DESC_EP_LEN(_numcables) (9 + 4 + (_numcables))
-#define TUD_MIDI_DESC_EP(_epout, _epsize, _numcables) \
- /* Endpoint: Note Audio v1.0's endpoint has 9 bytes instead of 7 */\
- 9, TUSB_DESC_ENDPOINT, _epout, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0, 0, 0, \
- /* MS Endpoint (connected to embedded jack) */\
- (uint8_t)(4 + (_numcables)), TUSB_DESC_CS_ENDPOINT, MIDI_CS_ENDPOINT_GENERAL, _numcables
-
-// Length of template descriptor (88 bytes)
-#define TUD_MIDI_DESC_LEN (TUD_MIDI_DESC_HEAD_LEN + TUD_MIDI_DESC_JACK_LEN + TUD_MIDI_DESC_EP_LEN(1) * 2)
-
-// MIDI simple descriptor
-// - 1 Embedded Jack In connected to 1 External Jack Out
-// - 1 Embedded Jack out connected to 1 External Jack In
-#define TUD_MIDI_DESCRIPTOR(_itfnum, _stridx, _epout, _epin, _epsize) \
- TUD_MIDI_DESC_HEAD(_itfnum, _stridx, 1),\
- TUD_MIDI_DESC_JACK(1),\
- TUD_MIDI_DESC_EP(_epout, _epsize, 1),\
- TUD_MIDI_JACKID_IN_EMB(1),\
- TUD_MIDI_DESC_EP(_epin, _epsize, 1),\
- TUD_MIDI_JACKID_OUT_EMB(1)
-
-//------------- AUDIO -------------//
-
-/* Standard Interface Association Descriptor (IAD) */
-#define TUD_AUDIO_DESC_IAD_LEN 8
-#define TUD_AUDIO_DESC_IAD(_firstitfs, _nitfs, _stridx) \
- TUD_AUDIO_DESC_IAD_LEN, TUSB_DESC_INTERFACE_ASSOCIATION, _firstitfs, _nitfs, TUSB_CLASS_AUDIO, AUDIO_FUNCTION_SUBCLASS_UNDEFINED, AUDIO_FUNC_PROTOCOL_CODE_V2, _stridx
-
-/* Standard AC Interface Descriptor(4.7.1) */
-#define TUD_AUDIO_DESC_STD_AC_LEN 9
-#define TUD_AUDIO_DESC_STD_AC(_itfnum, _nEPs, _stridx) /* _nEPs is 0 or 1 */\
- TUD_AUDIO_DESC_STD_AC_LEN, TUSB_DESC_INTERFACE, _itfnum, /* fixed to zero */ 0x00, _nEPs, TUSB_CLASS_AUDIO, AUDIO_SUBCLASS_CONTROL, AUDIO_INT_PROTOCOL_CODE_V2, _stridx
-
-/* Class-Specific AC Interface Header Descriptor(4.7.2) */
-#define TUD_AUDIO_DESC_CS_AC_LEN 9
-#define TUD_AUDIO_DESC_CS_AC(_bcdADC, _category, _totallen, _ctrl) /* _bcdADC : Audio Device Class Specification Release Number in Binary-Coded Decimal, _category : see audio_function_t, _totallen : Total number of bytes returned for the class-specific AudioControl interface i.e. Clock Source, Unit and Terminal descriptors - Do not include TUD_AUDIO_DESC_CS_AC_LEN, we already do this here*/ \
- TUD_AUDIO_DESC_CS_AC_LEN, TUSB_DESC_CS_INTERFACE, AUDIO_CS_AC_INTERFACE_HEADER, U16_TO_U8S_LE(_bcdADC), _category, U16_TO_U8S_LE(_totallen + TUD_AUDIO_DESC_CS_AC_LEN), _ctrl
-
-/* Clock Source Descriptor(4.7.2.1) */
-#define TUD_AUDIO_DESC_CLK_SRC_LEN 8
-#define TUD_AUDIO_DESC_CLK_SRC(_clkid, _attr, _ctrl, _assocTerm, _stridx) \
- TUD_AUDIO_DESC_CLK_SRC_LEN, TUSB_DESC_CS_INTERFACE, AUDIO_CS_AC_INTERFACE_CLOCK_SOURCE, _clkid, _attr, _ctrl, _assocTerm, _stridx
-
-/* Input Terminal Descriptor(4.7.2.4) */
-#define TUD_AUDIO_DESC_INPUT_TERM_LEN 17
-#define TUD_AUDIO_DESC_INPUT_TERM(_termid, _termtype, _assocTerm, _clkid, _nchannelslogical, _channelcfg, _idxchannelnames, _ctrl, _stridx) \
- TUD_AUDIO_DESC_INPUT_TERM_LEN, TUSB_DESC_CS_INTERFACE, AUDIO_CS_AC_INTERFACE_INPUT_TERMINAL, _termid, U16_TO_U8S_LE(_termtype), _assocTerm, _clkid, _nchannelslogical, U32_TO_U8S_LE(_channelcfg), _idxchannelnames, U16_TO_U8S_LE(_ctrl), _stridx
-
-/* Output Terminal Descriptor(4.7.2.5) */
-#define TUD_AUDIO_DESC_OUTPUT_TERM_LEN 12
-#define TUD_AUDIO_DESC_OUTPUT_TERM(_termid, _termtype, _assocTerm, _srcid, _clkid, _ctrl, _stridx) \
- TUD_AUDIO_DESC_OUTPUT_TERM_LEN, TUSB_DESC_CS_INTERFACE, AUDIO_CS_AC_INTERFACE_OUTPUT_TERMINAL, _termid, U16_TO_U8S_LE(_termtype), _assocTerm, _srcid, _clkid, U16_TO_U8S_LE(_ctrl), _stridx
-
-/* Feature Unit Descriptor(4.7.2.8) */
-// 1 - Channel
-#define TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL_LEN 6+(1+1)*4
-#define TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL(_unitid, _srcid, _ctrlch0master, _ctrlch1, _stridx) \
- TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL_LEN, TUSB_DESC_CS_INTERFACE, AUDIO_CS_AC_INTERFACE_FEATURE_UNIT, _unitid, _srcid, U32_TO_U8S_LE(_ctrlch0master), U32_TO_U8S_LE(_ctrlch1), _stridx
-
-// 2 - Channels
-#define TUD_AUDIO_DESC_FEATURE_UNIT_TWO_CHANNEL_LEN (6+(2+1)*4)
-#define TUD_AUDIO_DESC_FEATURE_UNIT_TWO_CHANNEL(_unitid, _srcid, _ctrlch0master, _ctrlch1, _ctrlch2, _stridx) \
- TUD_AUDIO_DESC_FEATURE_UNIT_TWO_CHANNEL_LEN, TUSB_DESC_CS_INTERFACE, AUDIO_CS_AC_INTERFACE_FEATURE_UNIT, _unitid, _srcid, U32_TO_U8S_LE(_ctrlch0master), U32_TO_U8S_LE(_ctrlch1), U32_TO_U8S_LE(_ctrlch2), _stridx
-// 4 - Channels
-#define TUD_AUDIO_DESC_FEATURE_UNIT_FOUR_CHANNEL_LEN (6+(4+1)*4)
-#define TUD_AUDIO_DESC_FEATURE_UNIT_FOUR_CHANNEL(_unitid, _srcid, _ctrlch0master, _ctrlch1, _ctrlch2, _ctrlch3, _ctrlch4, _stridx) \
- TUD_AUDIO_DESC_FEATURE_UNIT_FOUR_CHANNEL_LEN, TUSB_DESC_CS_INTERFACE, AUDIO_CS_AC_INTERFACE_FEATURE_UNIT, _unitid, _srcid, U32_TO_U8S_LE(_ctrlch0master), U32_TO_U8S_LE(_ctrlch1), U32_TO_U8S_LE(_ctrlch2), U32_TO_U8S_LE(_ctrlch3), U32_TO_U8S_LE(_ctrlch4), _stridx
-
-// For more channels, add definitions here
-
-/* Standard AS Interface Descriptor(4.9.1) */
-#define TUD_AUDIO_DESC_STD_AS_INT_LEN 9
-#define TUD_AUDIO_DESC_STD_AS_INT(_itfnum, _altset, _nEPs, _stridx) \
- TUD_AUDIO_DESC_STD_AS_INT_LEN, TUSB_DESC_INTERFACE, _itfnum, _altset, _nEPs, TUSB_CLASS_AUDIO, AUDIO_SUBCLASS_STREAMING, AUDIO_INT_PROTOCOL_CODE_V2, _stridx
-
-/* Class-Specific AS Interface Descriptor(4.9.2) */
-#define TUD_AUDIO_DESC_CS_AS_INT_LEN 16
-#define TUD_AUDIO_DESC_CS_AS_INT(_termid, _ctrl, _formattype, _formats, _nchannelsphysical, _channelcfg, _stridx) \
- TUD_AUDIO_DESC_CS_AS_INT_LEN, TUSB_DESC_CS_INTERFACE, AUDIO_CS_AS_INTERFACE_AS_GENERAL, _termid, _ctrl, _formattype, U32_TO_U8S_LE(_formats), _nchannelsphysical, U32_TO_U8S_LE(_channelcfg), _stridx
-
-/* Type I Format Type Descriptor(2.3.1.6 - Audio Formats) */
-#define TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN 6
-#define TUD_AUDIO_DESC_TYPE_I_FORMAT(_subslotsize, _bitresolution) /* _subslotsize is number of bytes per sample (i.e. subslot) and can be 1,2,3, or 4 */\
- TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN, TUSB_DESC_CS_INTERFACE, AUDIO_CS_AS_INTERFACE_FORMAT_TYPE, AUDIO_FORMAT_TYPE_I, _subslotsize, _bitresolution
-
-/* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */
-#define TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN 7
-#define TUD_AUDIO_DESC_STD_AS_ISO_EP(_ep, _attr, _maxEPsize, _interval) \
- TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN, TUSB_DESC_ENDPOINT, _ep, _attr, U16_TO_U8S_LE(_maxEPsize), _interval
-
-/* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */
-#define TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN 8
-#define TUD_AUDIO_DESC_CS_AS_ISO_EP(_attr, _ctrl, _lockdelayunit, _lockdelay) \
- TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN, TUSB_DESC_CS_ENDPOINT, AUDIO_CS_EP_SUBTYPE_GENERAL, _attr, _ctrl, _lockdelayunit, U16_TO_U8S_LE(_lockdelay)
-
-/* Standard AS Isochronous Feedback Endpoint Descriptor(4.10.2.1) */
-#define TUD_AUDIO_DESC_STD_AS_ISO_FB_EP_LEN 7
-#define TUD_AUDIO_DESC_STD_AS_ISO_FB_EP(_ep, _interval) \
- TUD_AUDIO_DESC_STD_AS_ISO_FB_EP_LEN, TUSB_DESC_ENDPOINT, _ep, (TUSB_XFER_ISOCHRONOUS | TUSB_ISO_EP_ATT_NO_SYNC | TUSB_ISO_EP_ATT_EXPLICIT_FB), U16_TO_U8S_LE(4), _interval
-
-// AUDIO simple descriptor (UAC2) for 1 microphone input
-// - 1 Input Terminal, 1 Feature Unit (Mute and Volume Control), 1 Output Terminal, 1 Clock Source
-
-#define TUD_AUDIO_MIC_ONE_CH_DESC_LEN (TUD_AUDIO_DESC_IAD_LEN\
- + TUD_AUDIO_DESC_STD_AC_LEN\
- + TUD_AUDIO_DESC_CS_AC_LEN\
- + TUD_AUDIO_DESC_CLK_SRC_LEN\
- + TUD_AUDIO_DESC_INPUT_TERM_LEN\
- + TUD_AUDIO_DESC_OUTPUT_TERM_LEN\
- + TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL_LEN\
- + TUD_AUDIO_DESC_STD_AS_INT_LEN\
- + TUD_AUDIO_DESC_STD_AS_INT_LEN\
- + TUD_AUDIO_DESC_CS_AS_INT_LEN\
- + TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN\
- + TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN\
- + TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN)
-
-#define TUD_AUDIO_MIC_ONE_CH_DESC_N_AS_INT 1 // Number of AS interfaces
-
-#define TUD_AUDIO_MIC_ONE_CH_DESCRIPTOR(_itfnum, _stridx, _nBytesPerSample, _nBitsUsedPerSample, _epin, _epsize) \
- /* Standard Interface Association Descriptor (IAD) */\
- TUD_AUDIO_DESC_IAD(/*_firstitfs*/ _itfnum, /*_nitfs*/ 0x02, /*_stridx*/ 0x00),\
- /* Standard AC Interface Descriptor(4.7.1) */\
- TUD_AUDIO_DESC_STD_AC(/*_itfnum*/ _itfnum, /*_nEPs*/ 0x00, /*_stridx*/ _stridx),\
- /* Class-Specific AC Interface Header Descriptor(4.7.2) */\
- TUD_AUDIO_DESC_CS_AC(/*_bcdADC*/ 0x0200, /*_category*/ AUDIO_FUNC_MICROPHONE, /*_totallen*/ TUD_AUDIO_DESC_CLK_SRC_LEN+TUD_AUDIO_DESC_INPUT_TERM_LEN+TUD_AUDIO_DESC_OUTPUT_TERM_LEN+TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL_LEN, /*_ctrl*/ AUDIO_CS_AS_INTERFACE_CTRL_LATENCY_POS),\
- /* Clock Source Descriptor(4.7.2.1) */\
- TUD_AUDIO_DESC_CLK_SRC(/*_clkid*/ 0x04, /*_attr*/ AUDIO_CLOCK_SOURCE_ATT_INT_FIX_CLK, /*_ctrl*/ (AUDIO_CTRL_R << AUDIO_CLOCK_SOURCE_CTRL_CLK_FRQ_POS), /*_assocTerm*/ 0x01, /*_stridx*/ 0x00),\
- /* Input Terminal Descriptor(4.7.2.4) */\
- TUD_AUDIO_DESC_INPUT_TERM(/*_termid*/ 0x01, /*_termtype*/ AUDIO_TERM_TYPE_IN_GENERIC_MIC, /*_assocTerm*/ 0x03, /*_clkid*/ 0x04, /*_nchannelslogical*/ 0x01, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_idxchannelnames*/ 0x00, /*_ctrl*/ AUDIO_CTRL_R << AUDIO_IN_TERM_CTRL_CONNECTOR_POS, /*_stridx*/ 0x00),\
- /* Output Terminal Descriptor(4.7.2.5) */\
- TUD_AUDIO_DESC_OUTPUT_TERM(/*_termid*/ 0x03, /*_termtype*/ AUDIO_TERM_TYPE_USB_STREAMING, /*_assocTerm*/ 0x01, /*_srcid*/ 0x02, /*_clkid*/ 0x04, /*_ctrl*/ 0x0000, /*_stridx*/ 0x00),\
- /* Feature Unit Descriptor(4.7.2.8) */\
- TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL(/*_unitid*/ 0x02, /*_srcid*/ 0x01, /*_ctrlch0master*/ AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS, /*_ctrlch1*/ AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS, /*_stridx*/ 0x00),\
- /* Standard AS Interface Descriptor(4.9.1) */\
- /* Interface 1, Alternate 0 - default alternate setting with 0 bandwidth */\
- TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)((_itfnum)+1), /*_altset*/ 0x00, /*_nEPs*/ 0x00, /*_stridx*/ 0x00),\
- /* Standard AS Interface Descriptor(4.9.1) */\
- /* Interface 1, Alternate 1 - alternate interface for data streaming */\
- TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)((_itfnum)+1), /*_altset*/ 0x01, /*_nEPs*/ 0x01, /*_stridx*/ 0x00),\
- /* Class-Specific AS Interface Descriptor(4.9.2) */\
- TUD_AUDIO_DESC_CS_AS_INT(/*_termid*/ 0x03, /*_ctrl*/ AUDIO_CTRL_NONE, /*_formattype*/ AUDIO_FORMAT_TYPE_I, /*_formats*/ AUDIO_DATA_FORMAT_TYPE_I_PCM, /*_nchannelsphysical*/ 0x01, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_stridx*/ 0x00),\
- /* Type I Format Type Descriptor(2.3.1.6 - Audio Formats) */\
- TUD_AUDIO_DESC_TYPE_I_FORMAT(_nBytesPerSample, _nBitsUsedPerSample),\
- /* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
- TUD_AUDIO_DESC_STD_AS_ISO_EP(/*_ep*/ _epin, /*_attr*/ (TUSB_XFER_ISOCHRONOUS | TUSB_ISO_EP_ATT_ASYNCHRONOUS | TUSB_ISO_EP_ATT_DATA), /*_maxEPsize*/ _epsize, /*_interval*/ (CFG_TUSB_RHPORT0_MODE & OPT_MODE_HIGH_SPEED) ? 0x04 : 0x01),\
- /* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
- TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_UNDEFINED, /*_lockdelay*/ 0x0000)
-
-// AUDIO simple descriptor (UAC2) for 4 microphone input
-// - 1 Input Terminal, 1 Feature Unit (Mute and Volume Control), 1 Output Terminal, 1 Clock Source
-
-#define TUD_AUDIO_MIC_FOUR_CH_DESC_LEN (TUD_AUDIO_DESC_IAD_LEN\
- + TUD_AUDIO_DESC_STD_AC_LEN\
- + TUD_AUDIO_DESC_CS_AC_LEN\
- + TUD_AUDIO_DESC_CLK_SRC_LEN\
- + TUD_AUDIO_DESC_INPUT_TERM_LEN\
- + TUD_AUDIO_DESC_OUTPUT_TERM_LEN\
- + TUD_AUDIO_DESC_FEATURE_UNIT_FOUR_CHANNEL_LEN\
- + TUD_AUDIO_DESC_STD_AS_INT_LEN\
- + TUD_AUDIO_DESC_STD_AS_INT_LEN\
- + TUD_AUDIO_DESC_CS_AS_INT_LEN\
- + TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN\
- + TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN\
- + TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN)
-
-#define TUD_AUDIO_MIC_FOUR_CH_DESC_N_AS_INT 1 // Number of AS interfaces
-
-#define TUD_AUDIO_MIC_FOUR_CH_DESCRIPTOR(_itfnum, _stridx, _nBytesPerSample, _nBitsUsedPerSample, _epin, _epsize) \
- /* Standard Interface Association Descriptor (IAD) */\
- TUD_AUDIO_DESC_IAD(/*_firstitfs*/ _itfnum, /*_nitfs*/ 0x02, /*_stridx*/ 0x00),\
- /* Standard AC Interface Descriptor(4.7.1) */\
- TUD_AUDIO_DESC_STD_AC(/*_itfnum*/ _itfnum, /*_nEPs*/ 0x00, /*_stridx*/ _stridx),\
- /* Class-Specific AC Interface Header Descriptor(4.7.2) */\
- TUD_AUDIO_DESC_CS_AC(/*_bcdADC*/ 0x0200, /*_category*/ AUDIO_FUNC_MICROPHONE, /*_totallen*/ TUD_AUDIO_DESC_CLK_SRC_LEN+TUD_AUDIO_DESC_INPUT_TERM_LEN+TUD_AUDIO_DESC_OUTPUT_TERM_LEN+TUD_AUDIO_DESC_FEATURE_UNIT_FOUR_CHANNEL_LEN, /*_ctrl*/ AUDIO_CS_AS_INTERFACE_CTRL_LATENCY_POS),\
- /* Clock Source Descriptor(4.7.2.1) */\
- TUD_AUDIO_DESC_CLK_SRC(/*_clkid*/ 0x04, /*_attr*/ AUDIO_CLOCK_SOURCE_ATT_INT_FIX_CLK, /*_ctrl*/ (AUDIO_CTRL_R << AUDIO_CLOCK_SOURCE_CTRL_CLK_FRQ_POS), /*_assocTerm*/ 0x01, /*_stridx*/ 0x00),\
- /* Input Terminal Descriptor(4.7.2.4) */\
- TUD_AUDIO_DESC_INPUT_TERM(/*_termid*/ 0x01, /*_termtype*/ AUDIO_TERM_TYPE_IN_GENERIC_MIC, /*_assocTerm*/ 0x03, /*_clkid*/ 0x04, /*_nchannelslogical*/ 0x04, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_idxchannelnames*/ 0x00, /*_ctrl*/ AUDIO_CTRL_R << AUDIO_IN_TERM_CTRL_CONNECTOR_POS, /*_stridx*/ 0x00),\
- /* Output Terminal Descriptor(4.7.2.5) */\
- TUD_AUDIO_DESC_OUTPUT_TERM(/*_termid*/ 0x03, /*_termtype*/ AUDIO_TERM_TYPE_USB_STREAMING, /*_assocTerm*/ 0x01, /*_srcid*/ 0x02, /*_clkid*/ 0x04, /*_ctrl*/ 0x0000, /*_stridx*/ 0x00),\
- /* Feature Unit Descriptor(4.7.2.8) */\
- TUD_AUDIO_DESC_FEATURE_UNIT_FOUR_CHANNEL(/*_unitid*/ 0x02, /*_srcid*/ 0x01, /*_ctrlch0master*/ AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS, /*_ctrlch1*/ AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS, /*_ctrlch2*/ AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS, /*_ctrlch3*/ AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS, /*_ctrlch4*/ AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS, /*_stridx*/ 0x00),\
- /* Standard AS Interface Descriptor(4.9.1) */\
- /* Interface 1, Alternate 0 - default alternate setting with 0 bandwidth */\
- TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)((_itfnum)+1), /*_altset*/ 0x00, /*_nEPs*/ 0x00, /*_stridx*/ 0x00),\
- /* Standard AS Interface Descriptor(4.9.1) */\
- /* Interface 1, Alternate 1 - alternate interface for data streaming */\
- TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)((_itfnum)+1), /*_altset*/ 0x01, /*_nEPs*/ 0x01, /*_stridx*/ 0x00),\
- /* Class-Specific AS Interface Descriptor(4.9.2) */\
- TUD_AUDIO_DESC_CS_AS_INT(/*_termid*/ 0x03, /*_ctrl*/ AUDIO_CTRL_NONE, /*_formattype*/ AUDIO_FORMAT_TYPE_I, /*_formats*/ AUDIO_DATA_FORMAT_TYPE_I_PCM, /*_nchannelsphysical*/ 0x04, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_stridx*/ 0x00),\
- /* Type I Format Type Descriptor(2.3.1.6 - Audio Formats) */\
- TUD_AUDIO_DESC_TYPE_I_FORMAT(_nBytesPerSample, _nBitsUsedPerSample),\
- /* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
- TUD_AUDIO_DESC_STD_AS_ISO_EP(/*_ep*/ _epin, /*_attr*/ (TUSB_XFER_ISOCHRONOUS | TUSB_ISO_EP_ATT_ASYNCHRONOUS | TUSB_ISO_EP_ATT_DATA), /*_maxEPsize*/ _epsize, /*_interval*/ (CFG_TUSB_RHPORT0_MODE & OPT_MODE_HIGH_SPEED) ? 0x04 : 0x01),\
- /* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
- TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_UNDEFINED, /*_lockdelay*/ 0x0000)
-
-// AUDIO simple descriptor (UAC2) for mono speaker
-// - 1 Input Terminal, 2 Feature Unit (Mute and Volume Control), 3 Output Terminal, 4 Clock Source
-
-#define TUD_AUDIO_SPEAKER_MONO_FB_DESC_LEN (TUD_AUDIO_DESC_IAD_LEN\
- + TUD_AUDIO_DESC_STD_AC_LEN\
- + TUD_AUDIO_DESC_CS_AC_LEN\
- + TUD_AUDIO_DESC_CLK_SRC_LEN\
- + TUD_AUDIO_DESC_INPUT_TERM_LEN\
- + TUD_AUDIO_DESC_OUTPUT_TERM_LEN\
- + TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL_LEN\
- + TUD_AUDIO_DESC_STD_AS_INT_LEN\
- + TUD_AUDIO_DESC_STD_AS_INT_LEN\
- + TUD_AUDIO_DESC_CS_AS_INT_LEN\
- + TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN\
- + TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN\
- + TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN\
- + TUD_AUDIO_DESC_STD_AS_ISO_FB_EP_LEN)
-
-#define TUD_AUDIO_SPEAKER_MONO_FB_DESCRIPTOR(_itfnum, _stridx, _nBytesPerSample, _nBitsUsedPerSample, _epout, _epsize, _epfb) \
- /* Standard Interface Association Descriptor (IAD) */\
- TUD_AUDIO_DESC_IAD(/*_firstitfs*/ _itfnum, /*_nitfs*/ 0x02, /*_stridx*/ 0x00),\
- /* Standard AC Interface Descriptor(4.7.1) */\
- TUD_AUDIO_DESC_STD_AC(/*_itfnum*/ _itfnum, /*_nEPs*/ 0x00, /*_stridx*/ _stridx),\
- /* Class-Specific AC Interface Header Descriptor(4.7.2) */\
- TUD_AUDIO_DESC_CS_AC(/*_bcdADC*/ 0x0200, /*_category*/ AUDIO_FUNC_DESKTOP_SPEAKER, /*_totallen*/ TUD_AUDIO_DESC_CLK_SRC_LEN+TUD_AUDIO_DESC_INPUT_TERM_LEN+TUD_AUDIO_DESC_OUTPUT_TERM_LEN+TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL_LEN, /*_ctrl*/ AUDIO_CS_AS_INTERFACE_CTRL_LATENCY_POS),\
- /* Clock Source Descriptor(4.7.2.1) */\
- TUD_AUDIO_DESC_CLK_SRC(/*_clkid*/ 0x04, /*_attr*/ AUDIO_CLOCK_SOURCE_ATT_INT_FIX_CLK, /*_ctrl*/ (AUDIO_CTRL_R << AUDIO_CLOCK_SOURCE_CTRL_CLK_FRQ_POS), /*_assocTerm*/ 0x01, /*_stridx*/ 0x00),\
- /* Input Terminal Descriptor(4.7.2.4) */\
- TUD_AUDIO_DESC_INPUT_TERM(/*_termid*/ 0x01, /*_termtype*/ AUDIO_TERM_TYPE_USB_STREAMING, /*_assocTerm*/ 0x00, /*_clkid*/ 0x04, /*_nchannelslogical*/ 0x01, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_idxchannelnames*/ 0x00, /*_ctrl*/ 0 * (AUDIO_CTRL_R << AUDIO_IN_TERM_CTRL_CONNECTOR_POS), /*_stridx*/ 0x00),\
- /* Output Terminal Descriptor(4.7.2.5) */\
- TUD_AUDIO_DESC_OUTPUT_TERM(/*_termid*/ 0x03, /*_termtype*/ AUDIO_TERM_TYPE_OUT_DESKTOP_SPEAKER, /*_assocTerm*/ 0x01, /*_srcid*/ 0x02, /*_clkid*/ 0x04, /*_ctrl*/ 0x0000, /*_stridx*/ 0x00),\
- /* Feature Unit Descriptor(4.7.2.8) */\
- TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL(/*_unitid*/ 0x02, /*_srcid*/ 0x01, /*_ctrlch0master*/ 0 * (AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS), /*_ctrlch1*/ 0 * (AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS), /*_stridx*/ 0x00),\
- /* Standard AS Interface Descriptor(4.9.1) */\
- /* Interface 1, Alternate 0 - default alternate setting with 0 bandwidth */\
- TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)((_itfnum) + 1), /*_altset*/ 0x00, /*_nEPs*/ 0x00, /*_stridx*/ 0x00),\
- /* Standard AS Interface Descriptor(4.9.1) */\
- /* Interface 1, Alternate 1 - alternate interface for data streaming */\
- TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)((_itfnum) + 1), /*_altset*/ 0x01, /*_nEPs*/ 0x02, /*_stridx*/ 0x00),\
- /* Class-Specific AS Interface Descriptor(4.9.2) */\
- TUD_AUDIO_DESC_CS_AS_INT(/*_termid*/ 0x01, /*_ctrl*/ AUDIO_CTRL_NONE, /*_formattype*/ AUDIO_FORMAT_TYPE_I, /*_formats*/ AUDIO_DATA_FORMAT_TYPE_I_PCM, /*_nchannelsphysical*/ 0x01, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_stridx*/ 0x00),\
- /* Type I Format Type Descriptor(2.3.1.6 - Audio Formats) */\
- TUD_AUDIO_DESC_TYPE_I_FORMAT(_nBytesPerSample, _nBitsUsedPerSample),\
- /* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
- TUD_AUDIO_DESC_STD_AS_ISO_EP(/*_ep*/ _epout, /*_attr*/ (TUSB_XFER_ISOCHRONOUS | TUSB_ISO_EP_ATT_ASYNCHRONOUS | TUSB_ISO_EP_ATT_DATA), /*_maxEPsize*/ _epsize, /*_interval*/ (CFG_TUSB_RHPORT0_MODE & OPT_MODE_HIGH_SPEED) ? 0x04 : 0x01),\
- /* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
- TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_UNDEFINED, /*_lockdelay*/ 0x0000),\
- /* Standard AS Isochronous Feedback Endpoint Descriptor(4.10.2.1) */\
- TUD_AUDIO_DESC_STD_AS_ISO_FB_EP(/*_ep*/ _epfb, /*_interval*/ 1)\
-
-// Calculate wMaxPacketSize of Endpoints
-#define TUD_AUDIO_EP_SIZE(_maxFrequency, _nBytesPerSample, _nChannels) \
- ((((_maxFrequency + ((CFG_TUSB_RHPORT0_MODE & OPT_MODE_HIGH_SPEED) ? 7999 : 999)) / ((CFG_TUSB_RHPORT0_MODE & OPT_MODE_HIGH_SPEED) ? 8000 : 1000)) + 1) * _nBytesPerSample * _nChannels)
-
-
-//------------- TUD_USBTMC/USB488 -------------//
-#define TUD_USBTMC_APP_CLASS (TUSB_CLASS_APPLICATION_SPECIFIC)
-#define TUD_USBTMC_APP_SUBCLASS 0x03u
-
-#define TUD_USBTMC_PROTOCOL_STD 0x00u
-#define TUD_USBTMC_PROTOCOL_USB488 0x01u
-
-// Interface number, number of endpoints, EP string index, USB_TMC_PROTOCOL*, bulk-out endpoint ID,
-// bulk-in endpoint ID
-#define TUD_USBTMC_IF_DESCRIPTOR(_itfnum, _bNumEndpoints, _stridx, _itfProtocol) \
- /* Interface */ \
- 0x09, TUSB_DESC_INTERFACE, _itfnum, 0x00, _bNumEndpoints, TUD_USBTMC_APP_CLASS, TUD_USBTMC_APP_SUBCLASS, _itfProtocol, _stridx
-
-#define TUD_USBTMC_IF_DESCRIPTOR_LEN 9u
-
-#define TUD_USBTMC_BULK_DESCRIPTORS(_epout, _epin, _bulk_epsize) \
- /* Endpoint Out */ \
- 7, TUSB_DESC_ENDPOINT, _epout, TUSB_XFER_BULK, U16_TO_U8S_LE(_bulk_epsize), 0u, \
- /* Endpoint In */ \
- 7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_BULK, U16_TO_U8S_LE(_bulk_epsize), 0u
-
-#define TUD_USBTMC_BULK_DESCRIPTORS_LEN (7u+7u)
-
-/* optional interrupt endpoint */ \
-// _int_pollingInterval : for LS/FS, expressed in frames (1ms each). 16 may be a good number?
-#define TUD_USBTMC_INT_DESCRIPTOR(_ep_interrupt, _ep_interrupt_size, _int_pollingInterval ) \
- 7, TUSB_DESC_ENDPOINT, _ep_interrupt, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_ep_interrupt_size), 0x16
-
-#define TUD_USBTMC_INT_DESCRIPTOR_LEN (7u)
-
-
-//------------- Vendor -------------//
-#define TUD_VENDOR_DESC_LEN (9+7+7)
-
-// Interface number, string index, EP Out & IN address, EP size
-#define TUD_VENDOR_DESCRIPTOR(_itfnum, _stridx, _epout, _epin, _epsize) \
- /* Interface */\
- 9, TUSB_DESC_INTERFACE, _itfnum, 0, 2, TUSB_CLASS_VENDOR_SPECIFIC, 0x00, 0x00, _stridx,\
- /* Endpoint Out */\
- 7, TUSB_DESC_ENDPOINT, _epout, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0,\
- /* Endpoint In */\
- 7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0
-
-//------------- DFU Runtime -------------//
-#define TUD_DFU_APP_CLASS (TUSB_CLASS_APPLICATION_SPECIFIC)
-#define TUD_DFU_APP_SUBCLASS (APP_SUBCLASS_DFU_RUNTIME)
-
-// Length of template descriptr: 18 bytes
-#define TUD_DFU_RT_DESC_LEN (9 + 9)
-
-// DFU runtime descriptor
-// Interface number, string index, attributes, detach timeout, transfer size
-#define TUD_DFU_RT_DESCRIPTOR(_itfnum, _stridx, _attr, _timeout, _xfer_size) \
- /* Interface */ \
- 9, TUSB_DESC_INTERFACE, _itfnum, 0, 0, TUD_DFU_APP_CLASS, TUD_DFU_APP_SUBCLASS, DFU_PROTOCOL_RT, _stridx, \
- /* Function */ \
- 9, DFU_DESC_FUNCTIONAL, _attr, U16_TO_U8S_LE(_timeout), U16_TO_U8S_LE(_xfer_size), U16_TO_U8S_LE(0x0101)
-
-// Length of template descriptor: 9 bytes + number of alternatives * 9
-#define TUD_DFU_DESC_LEN(_alt_count) (9 + (_alt_count) * 9)
-
-// Interface number, Alternate count, starting string index, attributes, detach timeout, transfer size
-// Note: Alternate count must be numberic or macro, string index is increased by one for each Alt interface
-#define TUD_DFU_DESCRIPTOR(_itfnum, _alt_count, _stridx, _attr, _timeout, _xfer_size) \
- TU_XSTRCAT(_TUD_DFU_ALT_,_alt_count)(_itfnum, 0, _stridx), \
- /* Function */ \
- 9, DFU_DESC_FUNCTIONAL, _attr, U16_TO_U8S_LE(_timeout), U16_TO_U8S_LE(_xfer_size), U16_TO_U8S_LE(0x0101)
-
-#define _TUD_DFU_ALT(_itfnum, _alt, _stridx) \
- /* Interface */ \
- 9, TUSB_DESC_INTERFACE, _itfnum, _alt, 0, TUD_DFU_APP_CLASS, TUD_DFU_APP_SUBCLASS, DFU_PROTOCOL_DFU, _stridx
-
-#define _TUD_DFU_ALT_1(_itfnum, _alt_count, _stridx) \
- _TUD_DFU_ALT(_itfnum, _alt_count, _stridx)
-
-#define _TUD_DFU_ALT_2(_itfnum, _alt_count, _stridx) \
- _TUD_DFU_ALT(_itfnum, _alt_count, _stridx), \
- _TUD_DFU_ALT_1(_itfnum, _alt_count+1, _stridx+1)
-
-#define _TUD_DFU_ALT_3(_itfnum, _alt_count, _stridx) \
- _TUD_DFU_ALT(_itfnum, _alt_count, _stridx), \
- _TUD_DFU_ALT_2(_itfnum, _alt_count+1, _stridx+1)
-
-#define _TUD_DFU_ALT_4(_itfnum, _alt_count, _stridx) \
- _TUD_DFU_ALT(_itfnum, _alt_count, _stridx), \
- _TUD_DFU_ALT_3(_itfnum, _alt_count+1, _stridx+1)
-
-#define _TUD_DFU_ALT_5(_itfnum, _alt_count, _stridx) \
- _TUD_DFU_ALT(_itfnum, _alt_count, _stridx), \
- _TUD_DFU_ALT_4(_itfnum, _alt_count+1, _stridx+1)
-
-#define _TUD_DFU_ALT_6(_itfnum, _alt_count, _stridx) \
- _TUD_DFU_ALT(_itfnum, _alt_count, _stridx), \
- _TUD_DFU_ALT_5(_itfnum, _alt_count+1, _stridx+1)
-
-#define _TUD_DFU_ALT_7(_itfnum, _alt_count, _stridx) \
- _TUD_DFU_ALT(_itfnum, _alt_count, _stridx), \
- _TUD_DFU_ALT_6(_itfnum, _alt_count+1, _stridx+1)
-
-#define _TUD_DFU_ALT_8(_itfnum, _alt_count, _stridx) \
- _TUD_DFU_ALT(_itfnum, _alt_count, _stridx), \
- _TUD_DFU_ALT_7(_itfnum, _alt_count+1, _stridx+1)
-
-
-//------------- CDC-ECM -------------//
-
-// Length of template descriptor: 71 bytes
-#define TUD_CDC_ECM_DESC_LEN (8+9+5+5+13+7+9+9+7+7)
-
-// CDC-ECM Descriptor Template
-// Interface number, description string index, MAC address string index, EP notification address and size, EP data address (out, in), and size, max segment size.
-#define TUD_CDC_ECM_DESCRIPTOR(_itfnum, _desc_stridx, _mac_stridx, _ep_notif, _ep_notif_size, _epout, _epin, _epsize, _maxsegmentsize) \
- /* Interface Association */\
- 8, TUSB_DESC_INTERFACE_ASSOCIATION, _itfnum, 2, TUSB_CLASS_CDC, CDC_COMM_SUBCLASS_ETHERNET_CONTROL_MODEL, 0, 0,\
- /* CDC Control Interface */\
- 9, TUSB_DESC_INTERFACE, _itfnum, 0, 1, TUSB_CLASS_CDC, CDC_COMM_SUBCLASS_ETHERNET_CONTROL_MODEL, 0, _desc_stridx,\
- /* CDC-ECM Header */\
- 5, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_HEADER, U16_TO_U8S_LE(0x0120),\
- /* CDC-ECM Union */\
- 5, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_UNION, _itfnum, (uint8_t)((_itfnum) + 1),\
- /* CDC-ECM Functional Descriptor */\
- 13, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_ETHERNET_NETWORKING, _mac_stridx, 0, 0, 0, 0, U16_TO_U8S_LE(_maxsegmentsize), U16_TO_U8S_LE(0), 0,\
- /* Endpoint Notification */\
- 7, TUSB_DESC_ENDPOINT, _ep_notif, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_ep_notif_size), 1,\
- /* CDC Data Interface (default inactive) */\
- 9, TUSB_DESC_INTERFACE, (uint8_t)((_itfnum)+1), 0, 0, TUSB_CLASS_CDC_DATA, 0, 0, 0,\
- /* CDC Data Interface (alternative active) */\
- 9, TUSB_DESC_INTERFACE, (uint8_t)((_itfnum)+1), 1, 2, TUSB_CLASS_CDC_DATA, 0, 0, 0,\
- /* Endpoint In */\
- 7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0,\
- /* Endpoint Out */\
- 7, TUSB_DESC_ENDPOINT, _epout, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0
-
-
-//------------- RNDIS -------------//
-
-#if 0
-/* Windows XP */
-#define TUD_RNDIS_ITF_CLASS TUSB_CLASS_CDC
-#define TUD_RNDIS_ITF_SUBCLASS CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL
-#define TUD_RNDIS_ITF_PROTOCOL 0xFF /* CDC_COMM_PROTOCOL_MICROSOFT_RNDIS */
-#else
-/* Windows 7+ */
-#define TUD_RNDIS_ITF_CLASS TUSB_CLASS_WIRELESS_CONTROLLER
-#define TUD_RNDIS_ITF_SUBCLASS 0x01
-#define TUD_RNDIS_ITF_PROTOCOL 0x03
-#endif
-
-// Length of template descriptor: 66 bytes
-#define TUD_RNDIS_DESC_LEN (8+9+5+5+4+5+7+9+7+7)
-
-// RNDIS Descriptor Template
-// Interface number, string index, EP notification address and size, EP data address (out, in) and size.
-#define TUD_RNDIS_DESCRIPTOR(_itfnum, _stridx, _ep_notif, _ep_notif_size, _epout, _epin, _epsize) \
- /* Interface Association */\
- 8, TUSB_DESC_INTERFACE_ASSOCIATION, _itfnum, 2, TUD_RNDIS_ITF_CLASS, TUD_RNDIS_ITF_SUBCLASS, TUD_RNDIS_ITF_PROTOCOL, 0,\
- /* CDC Control Interface */\
- 9, TUSB_DESC_INTERFACE, _itfnum, 0, 1, TUD_RNDIS_ITF_CLASS, TUD_RNDIS_ITF_SUBCLASS, TUD_RNDIS_ITF_PROTOCOL, _stridx,\
- /* CDC-ACM Header */\
- 5, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_HEADER, U16_TO_U8S_LE(0x0110),\
- /* CDC Call Management */\
- 5, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_CALL_MANAGEMENT, 0, (uint8_t)((_itfnum) + 1),\
- /* ACM */\
- 4, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, 0,\
- /* CDC Union */\
- 5, TUSB_DESC_CS_INTERFACE, CDC_FUNC_DESC_UNION, _itfnum, (uint8_t)((_itfnum) + 1),\
- /* Endpoint Notification */\
- 7, TUSB_DESC_ENDPOINT, _ep_notif, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_ep_notif_size), 1,\
- /* CDC Data Interface */\
- 9, TUSB_DESC_INTERFACE, (uint8_t)((_itfnum)+1), 0, 2, TUSB_CLASS_CDC_DATA, 0, 0, 0,\
- /* Endpoint In */\
- 7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0,\
- /* Endpoint Out */\
- 7, TUSB_DESC_ENDPOINT, _epout, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0
-
-//------------- BT Radio -------------//
-#define TUD_BT_APP_CLASS (TUSB_CLASS_WIRELESS_CONTROLLER)
-#define TUD_BT_APP_SUBCLASS 0x01
-#define TUD_BT_PROTOCOL_PRIMARY_CONTROLLER 0x01
-#define TUD_BT_PROTOCOL_AMP_CONTROLLER 0x02
-
-#ifndef CFG_TUD_BTH_ISO_ALT_COUNT
-#define CFG_TUD_BTH_ISO_ALT_COUNT 0
-#endif
-
-// Length of template descriptor: 30 bytes + number of ISO alternatives * 23
-#define TUD_BTH_DESC_LEN (9 + 7 + 7 + 7 + (CFG_TUD_BTH_ISO_ALT_COUNT) * (9 + 7 + 7))
-
-/* Primary Interface */
-#define TUD_BTH_PRI_ITF(_itfnum, _stridx, _ep_evt, _ep_evt_size, _ep_evt_interval, _ep_in, _ep_out, _ep_size) \
- 9, TUSB_DESC_INTERFACE, _itfnum, _stridx, 3, TUD_BT_APP_CLASS, TUD_BT_APP_SUBCLASS, TUD_BT_PROTOCOL_PRIMARY_CONTROLLER, 0, \
- /* Endpoint In for events */ \
- 7, TUSB_DESC_ENDPOINT, _ep_evt, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_ep_evt_size), _ep_evt_interval, \
- /* Endpoint In for ACL data */ \
- 7, TUSB_DESC_ENDPOINT, _ep_in, TUSB_XFER_BULK, U16_TO_U8S_LE(_ep_size), 1, \
- /* Endpoint Out for ACL data */ \
- 7, TUSB_DESC_ENDPOINT, _ep_out, TUSB_XFER_BULK, U16_TO_U8S_LE(_ep_size), 1
-
-#define TUD_BTH_ISO_ITF(_itfnum, _alt, _ep_in, _ep_out, _n) ,\
- /* Interface with 2 endpoints */ \
- 9, TUSB_DESC_INTERFACE, _itfnum, _alt, 2, TUD_BT_APP_CLASS, TUD_BT_APP_SUBCLASS, TUD_BT_PROTOCOL_PRIMARY_CONTROLLER, 0, \
- /* Isochronous endpoints */ \
- 7, TUSB_DESC_ENDPOINT, _ep_in, TUSB_XFER_ISOCHRONOUS, U16_TO_U8S_LE(_n), 1, \
- 7, TUSB_DESC_ENDPOINT, _ep_out, TUSB_XFER_ISOCHRONOUS, U16_TO_U8S_LE(_n), 1
-
-#define _FIRST(a, ...) a
-#define _REST(a, ...) __VA_ARGS__
-
-#define TUD_BTH_ISO_ITF_0(_itfnum, ...)
-#define TUD_BTH_ISO_ITF_1(_itfnum, _ep_in, _ep_out, ...) TUD_BTH_ISO_ITF(_itfnum, (CFG_TUD_BTH_ISO_ALT_COUNT) - 1, _ep_in, _ep_out, _FIRST(__VA_ARGS__))
-#define TUD_BTH_ISO_ITF_2(_itfnum, _ep_in, _ep_out, ...) TUD_BTH_ISO_ITF(_itfnum, (CFG_TUD_BTH_ISO_ALT_COUNT) - 2, _ep_in, _ep_out, _FIRST(__VA_ARGS__)) \
- TUD_BTH_ISO_ITF_1(_itfnum, _ep_in, _ep_out, _REST(__VA_ARGS__))
-#define TUD_BTH_ISO_ITF_3(_itfnum, _ep_in, _ep_out, ...) TUD_BTH_ISO_ITF(_itfnum, (CFG_TUD_BTH_ISO_ALT_COUNT) - 3, _ep_in, _ep_out, _FIRST(__VA_ARGS__)) \
- TUD_BTH_ISO_ITF_2(_itfnum, _ep_in, _ep_out, _REST(__VA_ARGS__))
-#define TUD_BTH_ISO_ITF_4(_itfnum, _ep_in, _ep_out, ...) TUD_BTH_ISO_ITF(_itfnum, (CFG_TUD_BTH_ISO_ALT_COUNT) - 4, _ep_in, _ep_out, _FIRST(__VA_ARGS__)) \
- TUD_BTH_ISO_ITF_3(_itfnum, _ep_in, _ep_out, _REST(__VA_ARGS__))
-#define TUD_BTH_ISO_ITF_5(_itfnum, _ep_in, _ep_out, ...) TUD_BTH_ISO_ITF(_itfnum, (CFG_TUD_BTH_ISO_ALT_COUNT) - 5, _ep_in, _ep_out, _FIRST(__VA_ARGS__)) \
- TUD_BTH_ISO_ITF_4(_itfnum, _ep_in, _ep_out, _REST(__VA_ARGS__))
-#define TUD_BTH_ISO_ITF_6(_itfnum, _ep_in, _ep_out, ...) TUD_BTH_ISO_ITF(_itfnum, (CFG_TUD_BTH_ISO_ALT_COUNT) - 6, _ep_in, _ep_out, _FIRST(__VA_ARGS__)) \
- TUD_BTH_ISO_ITF_5(_itfnum, _ep_in, _ep_out, _REST(__VA_ARGS__))
-
-#define TUD_BTH_ISO_ITFS(_itfnum, _ep_in, _ep_out, ...) \
- TU_XSTRCAT(TUD_BTH_ISO_ITF_, CFG_TUD_BTH_ISO_ALT_COUNT)(_itfnum, _ep_in, _ep_out, __VA_ARGS__)
-
-// BT Primary controller descriptor
-// Interface number, string index, attributes, event endpoint, event endpoint size, interval, data in, data out, data endpoint size, iso endpoint sizes
-#define TUD_BTH_DESCRIPTOR(_itfnum, _stridx, _ep_evt, _ep_evt_size, _ep_evt_interval, _ep_in, _ep_out, _ep_size,...) \
- TUD_BTH_PRI_ITF(_itfnum, _stridx, _ep_evt, _ep_evt_size, _ep_evt_interval, _ep_in, _ep_out, _ep_size) \
- TUD_BTH_ISO_ITFS(_itfnum + 1, _ep_in + 1, _ep_out + 1, __VA_ARGS__)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TUSB_USBD_H_ */
-
-/** @} */
diff --git a/tinyusb/src/device/usbd_control.c b/tinyusb/src/device/usbd_control.c
deleted file mode 100755
index 7a824469..00000000
--- a/tinyusb/src/device/usbd_control.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED
-
-#include "tusb.h"
-#include "device/usbd_pvt.h"
-#include "dcd.h"
-
-#if CFG_TUSB_DEBUG >= 2
-extern void usbd_driver_print_control_complete_name(usbd_control_xfer_cb_t callback);
-#endif
-
-enum
-{
- EDPT_CTRL_OUT = 0x00,
- EDPT_CTRL_IN = 0x80
-};
-
-typedef struct
-{
- tusb_control_request_t request;
-
- uint8_t* buffer;
- uint16_t data_len;
- uint16_t total_xferred;
-
- usbd_control_xfer_cb_t complete_cb;
-} usbd_control_xfer_t;
-
-static usbd_control_xfer_t _ctrl_xfer;
-
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN
-static uint8_t _usbd_ctrl_buf[CFG_TUD_ENDPOINT0_SIZE];
-
-//--------------------------------------------------------------------+
-// Application API
-//--------------------------------------------------------------------+
-
-// Queue ZLP status transaction
-static inline bool _status_stage_xact(uint8_t rhport, tusb_control_request_t const * request)
-{
- // Opposite to endpoint in Data Phase
- uint8_t const ep_addr = request->bmRequestType_bit.direction ? EDPT_CTRL_OUT : EDPT_CTRL_IN;
- return usbd_edpt_xfer(rhport, ep_addr, NULL, 0);
-}
-
-// Status phase
-bool tud_control_status(uint8_t rhport, tusb_control_request_t const * request)
-{
- _ctrl_xfer.request = (*request);
- _ctrl_xfer.buffer = NULL;
- _ctrl_xfer.total_xferred = 0;
- _ctrl_xfer.data_len = 0;
-
- return _status_stage_xact(rhport, request);
-}
-
-// Queue a transaction in Data Stage
-// Each transaction has up to Endpoint0's max packet size.
-// This function can also transfer an zero-length packet
-static bool _data_stage_xact(uint8_t rhport)
-{
- uint16_t const xact_len = tu_min16(_ctrl_xfer.data_len - _ctrl_xfer.total_xferred, CFG_TUD_ENDPOINT0_SIZE);
-
- uint8_t ep_addr = EDPT_CTRL_OUT;
-
- if ( _ctrl_xfer.request.bmRequestType_bit.direction == TUSB_DIR_IN )
- {
- ep_addr = EDPT_CTRL_IN;
- if ( xact_len ) memcpy(_usbd_ctrl_buf, _ctrl_xfer.buffer, xact_len);
- }
-
- return usbd_edpt_xfer(rhport, ep_addr, xact_len ? _usbd_ctrl_buf : NULL, xact_len);
-}
-
-// Transmit data to/from the control endpoint.
-// If the request's wLength is zero, a status packet is sent instead.
-bool tud_control_xfer(uint8_t rhport, tusb_control_request_t const * request, void* buffer, uint16_t len)
-{
- _ctrl_xfer.request = (*request);
- _ctrl_xfer.buffer = (uint8_t*) buffer;
- _ctrl_xfer.total_xferred = 0U;
- _ctrl_xfer.data_len = tu_min16(len, request->wLength);
-
- if (request->wLength > 0U)
- {
- if(_ctrl_xfer.data_len > 0U)
- {
- TU_ASSERT(buffer);
- }
-
-// TU_LOG2(" Control total data length is %u bytes\r\n", _ctrl_xfer.data_len);
-
- // Data stage
- TU_ASSERT( _data_stage_xact(rhport) );
- }
- else
- {
- // Status stage
- TU_ASSERT( _status_stage_xact(rhport, request) );
- }
-
- return true;
-}
-
-//--------------------------------------------------------------------+
-// USBD API
-//--------------------------------------------------------------------+
-
-void usbd_control_reset(void);
-void usbd_control_set_request(tusb_control_request_t const *request);
-void usbd_control_set_complete_callback( usbd_control_xfer_cb_t fp );
-bool usbd_control_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes);
-
-void usbd_control_reset(void)
-{
- tu_varclr(&_ctrl_xfer);
-}
-
-// Set complete callback
-void usbd_control_set_complete_callback( usbd_control_xfer_cb_t fp )
-{
- _ctrl_xfer.complete_cb = fp;
-}
-
-// for dcd_set_address where DCD is responsible for status response
-void usbd_control_set_request(tusb_control_request_t const *request)
-{
- _ctrl_xfer.request = (*request);
- _ctrl_xfer.buffer = NULL;
- _ctrl_xfer.total_xferred = 0;
- _ctrl_xfer.data_len = 0;
-}
-
-// callback when a transaction complete on
-// - DATA stage of control endpoint or
-// - Status stage
-bool usbd_control_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
-{
- (void) result;
-
- // Endpoint Address is opposite to direction bit, this is Status Stage complete event
- if ( tu_edpt_dir(ep_addr) != _ctrl_xfer.request.bmRequestType_bit.direction )
- {
- TU_ASSERT(0 == xferred_bytes);
-
- // invoke optional dcd hook if available
- if (dcd_edpt0_status_complete) dcd_edpt0_status_complete(rhport, &_ctrl_xfer.request);
-
- if (_ctrl_xfer.complete_cb)
- {
- // TODO refactor with usbd_driver_print_control_complete_name
- _ctrl_xfer.complete_cb(rhport, CONTROL_STAGE_ACK, &_ctrl_xfer.request);
- }
-
- return true;
- }
-
- if ( _ctrl_xfer.request.bmRequestType_bit.direction == TUSB_DIR_OUT )
- {
- TU_VERIFY(_ctrl_xfer.buffer);
- memcpy(_ctrl_xfer.buffer, _usbd_ctrl_buf, xferred_bytes);
- TU_LOG_MEM(2, _usbd_ctrl_buf, xferred_bytes, 2);
- }
-
- _ctrl_xfer.total_xferred += xferred_bytes;
- _ctrl_xfer.buffer += xferred_bytes;
-
- // Data Stage is complete when all request's length are transferred or
- // a short packet is sent including zero-length packet.
- if ( (_ctrl_xfer.request.wLength == _ctrl_xfer.total_xferred) || (xferred_bytes < CFG_TUD_ENDPOINT0_SIZE) )
- {
- // DATA stage is complete
- bool is_ok = true;
-
- // invoke complete callback if set
- // callback can still stall control in status phase e.g out data does not make sense
- if ( _ctrl_xfer.complete_cb )
- {
- #if CFG_TUSB_DEBUG >= 2
- usbd_driver_print_control_complete_name(_ctrl_xfer.complete_cb);
- #endif
-
- is_ok = _ctrl_xfer.complete_cb(rhport, CONTROL_STAGE_DATA, &_ctrl_xfer.request);
- }
-
- if ( is_ok )
- {
- // Send status
- TU_ASSERT( _status_stage_xact(rhport, &_ctrl_xfer.request) );
- }else
- {
- // Stall both IN and OUT control endpoint
- dcd_edpt_stall(rhport, EDPT_CTRL_OUT);
- dcd_edpt_stall(rhport, EDPT_CTRL_IN);
- }
- }
- else
- {
- // More data to transfer
- TU_ASSERT( _data_stage_xact(rhport) );
- }
-
- return true;
-}
-
-#endif
diff --git a/tinyusb/src/device/usbd_pvt.h b/tinyusb/src/device/usbd_pvt.h
deleted file mode 100755
index 6a4b3095..00000000
--- a/tinyusb/src/device/usbd_pvt.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-#ifndef USBD_PVT_H_
-#define USBD_PVT_H_
-
-#include "osal/osal.h"
-#include "common/tusb_fifo.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Class Driver API
-//--------------------------------------------------------------------+
-
-typedef struct
-{
- #if CFG_TUSB_DEBUG >= 2
- char const* name;
- #endif
-
- void (* init ) (void);
- void (* reset ) (uint8_t rhport);
- uint16_t (* open ) (uint8_t rhport, tusb_desc_interface_t const * desc_intf, uint16_t max_len);
- bool (* control_xfer_cb ) (uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
- bool (* xfer_cb ) (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes);
- void (* sof ) (uint8_t rhport); /* optional */
-} usbd_class_driver_t;
-
-// Invoked when initializing device stack to get additional class drivers.
-// Can optionally implemented by application to extend/overwrite class driver support.
-// Note: The drivers array must be accessible at all time when stack is active
-usbd_class_driver_t const* usbd_app_driver_get_cb(uint8_t* driver_count) TU_ATTR_WEAK;
-
-typedef bool (*usbd_control_xfer_cb_t)(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
-
-//--------------------------------------------------------------------+
-// USBD Endpoint API
-//--------------------------------------------------------------------+
-
-// Open an endpoint
-bool usbd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * desc_ep);
-
-// Close an endpoint
-void usbd_edpt_close(uint8_t rhport, uint8_t ep_addr);
-
-// Submit a usb transfer
-bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes);
-
-// Submit a usb ISO transfer by use of a FIFO (ring buffer) - all bytes in FIFO get transmitted
-bool usbd_edpt_xfer_fifo(uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes);
-
-// Claim an endpoint before submitting a transfer.
-// If caller does not make any transfer, it must release endpoint for others.
-bool usbd_edpt_claim(uint8_t rhport, uint8_t ep_addr);
-
-// Release an endpoint without submitting a transfer
-bool usbd_edpt_release(uint8_t rhport, uint8_t ep_addr);
-
-// Check if endpoint transferring is complete
-bool usbd_edpt_busy(uint8_t rhport, uint8_t ep_addr);
-
-// Stall endpoint
-void usbd_edpt_stall(uint8_t rhport, uint8_t ep_addr);
-
-// Clear stalled endpoint
-void usbd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr);
-
-// Check if endpoint is stalled
-bool usbd_edpt_stalled(uint8_t rhport, uint8_t ep_addr);
-
-TU_ATTR_ALWAYS_INLINE static inline
-bool usbd_edpt_ready(uint8_t rhport, uint8_t ep_addr)
-{
- return !usbd_edpt_busy(rhport, ep_addr) && !usbd_edpt_stalled(rhport, ep_addr);
-}
-
-/*------------------------------------------------------------------*/
-/* Helper
- *------------------------------------------------------------------*/
-
-bool usbd_open_edpt_pair(uint8_t rhport, uint8_t const* p_desc, uint8_t ep_count, uint8_t xfer_type, uint8_t* ep_out, uint8_t* ep_in);
-void usbd_defer_func( osal_task_func_t func, void* param, bool in_isr );
-
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* USBD_PVT_H_ */
diff --git a/tinyusb/src/host/hcd.h b/tinyusb/src/host/hcd.h
deleted file mode 100755
index eb53d2e8..00000000
--- a/tinyusb/src/host/hcd.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_HCD_H_
-#define _TUSB_HCD_H_
-
-#include "common/tusb_common.h"
-#include "osal/osal.h"
-#include "common/tusb_fifo.h"
-#include "hcd_attr.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
- //--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-typedef enum
-{
- HCD_EVENT_DEVICE_ATTACH,
- HCD_EVENT_DEVICE_REMOVE,
- HCD_EVENT_XFER_COMPLETE,
-
- // Not an HCD event, just a convenient way to defer ISR function
- USBH_EVENT_FUNC_CALL,
-
- HCD_EVENT_COUNT
-} hcd_eventid_t;
-
-typedef struct
-{
- uint8_t rhport;
- uint8_t event_id;
- uint8_t dev_addr;
-
- union
- {
- // Attach, Remove
- struct {
- uint8_t hub_addr;
- uint8_t hub_port;
- uint8_t speed;
- } connection;
-
- // XFER_COMPLETE
- struct {
- uint8_t ep_addr;
- uint8_t result;
- uint32_t len;
- } xfer_complete;
-
- // FUNC_CALL
- struct {
- void (*func) (void*);
- void* param;
- }func_call;
- };
-
-} hcd_event_t;
-
-#if TUSB_OPT_HOST_ENABLED
-// Max number of endpoints per device
-enum {
- // TODO better computation
- HCD_MAX_ENDPOINT = CFG_TUH_DEVICE_MAX*(CFG_TUH_HUB + CFG_TUH_HID*2 + CFG_TUH_MSC*2 + CFG_TUH_CDC*3),
- HCD_MAX_XFER = HCD_MAX_ENDPOINT*2,
-};
-
-//#define HCD_MAX_ENDPOINT 16
-//#define HCD_MAX_XFER 16
-
-typedef struct {
- uint8_t rhport;
- uint8_t hub_addr;
- uint8_t hub_port;
- uint8_t speed;
-} hcd_devtree_info_t;
-
-#endif
-
-//--------------------------------------------------------------------+
-// Controller API
-//--------------------------------------------------------------------+
-
-// Initialize controller to host mode
-bool hcd_init(uint8_t rhport);
-
-// Interrupt Handler
-void hcd_int_handler(uint8_t rhport);
-
-// Enable USB interrupt
-void hcd_int_enable (uint8_t rhport);
-
-// Disable USB interrupt
-void hcd_int_disable(uint8_t rhport);
-
-// Get frame number (1ms)
-uint32_t hcd_frame_number(uint8_t rhport);
-
-//--------------------------------------------------------------------+
-// Port API
-//--------------------------------------------------------------------+
-
-// Get the current connect status of roothub port
-bool hcd_port_connect_status(uint8_t rhport);
-
-// Reset USB bus on the port
-void hcd_port_reset(uint8_t rhport);
-
-// TODO implement later
-void hcd_port_reset_end(uint8_t rhport);
-
-// Get port link speed
-tusb_speed_t hcd_port_speed_get(uint8_t rhport);
-
-// HCD closes all opened endpoints belong to this device
-void hcd_device_close(uint8_t rhport, uint8_t dev_addr);
-
-//--------------------------------------------------------------------+
-// Endpoints API
-//--------------------------------------------------------------------+
-
-bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet[8]);
-bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const * ep_desc);
-bool hcd_edpt_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t * buffer, uint16_t buflen);
-bool hcd_edpt_clear_stall(uint8_t dev_addr, uint8_t ep_addr);
-
-//--------------------------------------------------------------------+
-// USBH implemented API
-//--------------------------------------------------------------------+
-
-// Get device tree information of a device
-// USB device tree can be complicated and manged by USBH, this help HCD to retrieve
-// needed topology info to carry out its work
-extern void hcd_devtree_get_info(uint8_t dev_addr, hcd_devtree_info_t* devtree_info);
-
-//------------- Event API -------------//
-
-// Called by HCD to notify stack
-extern void hcd_event_handler(hcd_event_t const* event, bool in_isr);
-
-// Helper to send device attach event
-extern void hcd_event_device_attach(uint8_t rhport, bool in_isr);
-
-// Helper to send device removal event
-extern void hcd_event_device_remove(uint8_t rhport, bool in_isr);
-
-// Helper to send USB transfer event
-extern void hcd_event_xfer_complete(uint8_t dev_addr, uint8_t ep_addr, uint32_t xferred_bytes, xfer_result_t result, bool in_isr);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_HCD_H_ */
diff --git a/tinyusb/src/host/hcd_attr.h b/tinyusb/src/host/hcd_attr.h
deleted file mode 100755
index 729fc407..00000000
--- a/tinyusb/src/host/hcd_attr.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef TUSB_HCD_ATTR_H_
-#define TUSB_HCD_ATTR_H_
-
-#include "tusb_option.h"
-
-// Attribute includes
-// - ENDPOINT_MAX: max (logical) number of endpoint
-// - PORT_HIGHSPEED: mask to indicate which port support highspeed mode, bit0 for port0 and so on.
-
-//------------- NXP -------------//
-#if TU_CHECK_MCU(LPC175X_6X) || TU_CHECK_MCU(LPC177X_8X) || TU_CHECK_MCU(LPC40XX)
- #define HCD_ATTR_OHCI
-
-#elif TU_CHECK_MCU(LPC18XX) || TU_CHECK_MCU(LPC43XX)
- #define HCD_ATTR_EHCI_TRANSDIMENSION
-
-#elif TU_CHECK_MCU(LPC54XXX)
- // #define HCD_ATTR_EHCI_NXP_PTD
-
-#elif TU_CHECK_MCU(LPC55XX)
- // #define HCD_ATTR_EHCI_NXP_PTD
-
-#elif TU_CHECK_MCU(MIMXRT10XX)
- #define HCD_ATTR_EHCI_TRANSDIMENSION
-
-#elif TU_CHECK_MCU(MKL25ZXX)
-
-//------------- Microchip -------------//
-#elif TU_CHECK_MCU(SAMD21) || TU_CHECK_MCU(SAMD51) || TU_CHECK_MCU(SAME5X) || \
- TU_CHECK_MCU(SAMD11) || TU_CHECK_MCU(SAML21) || TU_CHECK_MCU(SAML22)
-
-#elif TU_CHECK_MCU(SAMG)
-
-#elif TU_CHECK_MCU(SAMX7X)
-
-//------------- ST -------------//
-#elif TU_CHECK_MCU(STM32F0) || TU_CHECK_MCU(STM32F1) || TU_CHECK_MCU(STM32F3) || \
- TU_CHECK_MCU(STM32L0) || TU_CHECK_MCU(STM32L1) || TU_CHECK_MCU(STM32L4)
-
-#elif TU_CHECK_MCU(STM32F2) || TU_CHECK_MCU(STM32F4) || TU_CHECK_MCU(STM32F3)
-
-#elif TU_CHECK_MCU(STM32F7)
-
-#elif TU_CHECK_MCU(STM32H7)
-
-//------------- Sony -------------//
-#elif TU_CHECK_MCU(CXD56)
-
-//------------- Nuvoton -------------//
-#elif TU_CHECK_MCU(NUC505)
-
-//------------- Espressif -------------//
-#elif TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3)
-
-//------------- Raspberry Pi -------------//
-#elif TU_CHECK_MCU(RP2040)
-
-//------------- Silabs -------------//
-#elif TU_CHECK_MCU(EFM32GG) || TU_CHECK_MCU(EFM32GG11) || TU_CHECK_MCU(EFM32GG12)
-
-//------------- Renesas -------------//
-#elif TU_CHECK_MCU(RX63X) || TU_CHECK_MCU(RX65X) || TU_CHECK_MCU(RX72N)
-
-//#elif TU_CHECK_MCU(MM32F327X)
-// #define DCD_ATTR_ENDPOINT_MAX not known yet
-
-//------------- GigaDevice -------------//
-#elif TU_CHECK_MCU(GD32VF103)
-
-#else
-// #warning "DCD_ATTR_ENDPOINT_MAX is not defined for this MCU, default to 8"
-#endif
-
-// Default to fullspeed if not defined
-//#ifndef PORT_HIGHSPEED
-// #define DCD_ATTR_PORT_HIGHSPEED 0x00
-//#endif
-
-#endif
diff --git a/tinyusb/src/host/hub.c b/tinyusb/src/host/hub.c
deleted file mode 100755
index fd4dbd04..00000000
--- a/tinyusb/src/host/hub.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (TUSB_OPT_HOST_ENABLED && CFG_TUH_HUB)
-
-#include "usbh.h"
-#include "usbh_classdriver.h"
-#include "hub.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-typedef struct
-{
- uint8_t itf_num;
- uint8_t ep_in;
- uint8_t port_count;
- uint8_t status_change; // data from status change interrupt endpoint
-
- hub_port_status_response_t port_status;
-} hub_interface_t;
-
-CFG_TUSB_MEM_SECTION static hub_interface_t hub_data[CFG_TUH_HUB];
-CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(4) static uint8_t _hub_buffer[sizeof(descriptor_hub_desc_t)];
-
-TU_ATTR_ALWAYS_INLINE
-static inline hub_interface_t* get_itf(uint8_t dev_addr)
-{
- return &hub_data[dev_addr-1-CFG_TUH_DEVICE_MAX];
-}
-
-#if CFG_TUSB_DEBUG
-static char const* const _hub_feature_str[] =
-{
- [HUB_FEATURE_PORT_CONNECTION ] = "PORT_CONNECTION",
- [HUB_FEATURE_PORT_ENABLE ] = "PORT_ENABLE",
- [HUB_FEATURE_PORT_SUSPEND ] = "PORT_SUSPEND",
- [HUB_FEATURE_PORT_OVER_CURRENT ] = "PORT_OVER_CURRENT",
- [HUB_FEATURE_PORT_RESET ] = "PORT_RESET",
- [HUB_FEATURE_PORT_POWER ] = "PORT_POWER",
- [HUB_FEATURE_PORT_LOW_SPEED ] = "PORT_LOW_SPEED",
- [HUB_FEATURE_PORT_CONNECTION_CHANGE ] = "PORT_CONNECTION_CHANGE",
- [HUB_FEATURE_PORT_ENABLE_CHANGE ] = "PORT_ENABLE_CHANGE",
- [HUB_FEATURE_PORT_SUSPEND_CHANGE ] = "PORT_SUSPEND_CHANGE",
- [HUB_FEATURE_PORT_OVER_CURRENT_CHANGE ] = "PORT_OVER_CURRENT_CHANGE",
- [HUB_FEATURE_PORT_RESET_CHANGE ] = "PORT_RESET_CHANGE",
- [HUB_FEATURE_PORT_TEST ] = "PORT_TEST",
- [HUB_FEATURE_PORT_INDICATOR ] = "PORT_INDICATOR",
-};
-#endif
-
-//--------------------------------------------------------------------+
-// HUB
-//--------------------------------------------------------------------+
-bool hub_port_clear_feature(uint8_t hub_addr, uint8_t hub_port, uint8_t feature, tuh_control_complete_cb_t complete_cb)
-{
- tusb_control_request_t const request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_OTHER,
- .type = TUSB_REQ_TYPE_CLASS,
- .direction = TUSB_DIR_OUT
- },
- .bRequest = HUB_REQUEST_CLEAR_FEATURE,
- .wValue = feature,
- .wIndex = hub_port,
- .wLength = 0
- };
-
- TU_LOG2("HUB Clear Feature: %s, addr = %u port = %u\r\n", _hub_feature_str[feature], hub_addr, hub_port);
- TU_ASSERT( tuh_control_xfer(hub_addr, &request, NULL, complete_cb) );
- return true;
-}
-
-bool hub_port_set_feature(uint8_t hub_addr, uint8_t hub_port, uint8_t feature, tuh_control_complete_cb_t complete_cb)
-{
- tusb_control_request_t const request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_OTHER,
- .type = TUSB_REQ_TYPE_CLASS,
- .direction = TUSB_DIR_OUT
- },
- .bRequest = HUB_REQUEST_SET_FEATURE,
- .wValue = feature,
- .wIndex = hub_port,
- .wLength = 0
- };
-
- TU_LOG2("HUB Set Feature: %s, addr = %u port = %u\r\n", _hub_feature_str[feature], hub_addr, hub_port);
- TU_ASSERT( tuh_control_xfer(hub_addr, &request, NULL, complete_cb) );
- return true;
-}
-
-bool hub_port_reset(uint8_t hub_addr, uint8_t hub_port, tuh_control_complete_cb_t complete_cb)
-{
- return hub_port_set_feature(hub_addr, hub_port, HUB_FEATURE_PORT_RESET, complete_cb);
-}
-
-bool hub_port_get_status(uint8_t hub_addr, uint8_t hub_port, void* resp, tuh_control_complete_cb_t complete_cb)
-{
- tusb_control_request_t const request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_OTHER,
- .type = TUSB_REQ_TYPE_CLASS,
- .direction = TUSB_DIR_IN
- },
- .bRequest = HUB_REQUEST_GET_STATUS,
- .wValue = 0,
- .wIndex = hub_port,
- .wLength = 4
- };
-
- TU_LOG2("HUB Get Port Status: addr = %u port = %u\r\n", hub_addr, hub_port);
- TU_ASSERT( tuh_control_xfer( hub_addr, &request, resp, complete_cb) );
- return true;
-}
-
-//--------------------------------------------------------------------+
-// CLASS-USBH API (don't require to verify parameters)
-//--------------------------------------------------------------------+
-void hub_init(void)
-{
- tu_memclr(hub_data, sizeof(hub_data));
-}
-
-bool hub_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *itf_desc, uint16_t max_len)
-{
- TU_VERIFY(TUSB_CLASS_HUB == itf_desc->bInterfaceClass &&
- 0 == itf_desc->bInterfaceSubClass);
-
- // hub driver does not support multiple TT yet
- TU_VERIFY(itf_desc->bInterfaceProtocol <= 1);
-
- // msc driver length is fixed
- uint16_t const drv_len = sizeof(tusb_desc_interface_t) + sizeof(tusb_desc_endpoint_t);
- TU_ASSERT(drv_len <= max_len);
-
- //------------- Interrupt Status endpoint -------------//
- tusb_desc_endpoint_t const *desc_ep = (tusb_desc_endpoint_t const *) tu_desc_next(itf_desc);
-
- TU_ASSERT(TUSB_DESC_ENDPOINT == desc_ep->bDescriptorType &&
- TUSB_XFER_INTERRUPT == desc_ep->bmAttributes.xfer, 0);
-
- TU_ASSERT(usbh_edpt_open(rhport, dev_addr, desc_ep));
-
- hub_interface_t* p_hub = get_itf(dev_addr);
-
- p_hub->itf_num = itf_desc->bInterfaceNumber;
- p_hub->ep_in = desc_ep->bEndpointAddress;
-
- return true;
-}
-
-void hub_close(uint8_t dev_addr)
-{
- TU_VERIFY(dev_addr > CFG_TUH_DEVICE_MAX, );
- hub_interface_t* p_hub = get_itf(dev_addr);
-
- if (p_hub->ep_in) tu_memclr(p_hub, sizeof( hub_interface_t));
-}
-
-bool hub_status_pipe_queue(uint8_t dev_addr)
-{
- hub_interface_t* hub_itf = get_itf(dev_addr);
- return usbh_edpt_xfer(dev_addr, hub_itf->ep_in, &hub_itf->status_change, 1);
-}
-
-
-//--------------------------------------------------------------------+
-// Set Configure
-//--------------------------------------------------------------------+
-
-static bool config_set_port_power (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-static bool config_port_power_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-
-bool hub_set_config(uint8_t dev_addr, uint8_t itf_num)
-{
- hub_interface_t* p_hub = get_itf(dev_addr);
- TU_ASSERT(itf_num == p_hub->itf_num);
-
- // Get Hub Descriptor
- tusb_control_request_t const request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_DEVICE,
- .type = TUSB_REQ_TYPE_CLASS,
- .direction = TUSB_DIR_IN
- },
- .bRequest = HUB_REQUEST_GET_DESCRIPTOR,
- .wValue = 0,
- .wIndex = 0,
- .wLength = sizeof(descriptor_hub_desc_t)
- };
-
- TU_ASSERT( tuh_control_xfer(dev_addr, &request, _hub_buffer, config_set_port_power) );
-
- return true;
-}
-
-static bool config_set_port_power (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- (void) request;
- TU_ASSERT(XFER_RESULT_SUCCESS == result);
-
- hub_interface_t* p_hub = get_itf(dev_addr);
-
- // only use number of ports in hub descriptor
- descriptor_hub_desc_t const* desc_hub = (descriptor_hub_desc_t const*) _hub_buffer;
- p_hub->port_count = desc_hub->bNbrPorts;
-
- // May need to GET_STATUS
-
- // Set Port Power to be able to detect connection, starting with port 1
- uint8_t const hub_port = 1;
- return hub_port_set_feature(dev_addr, hub_port, HUB_FEATURE_PORT_POWER, config_port_power_complete);
-}
-
-static bool config_port_power_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- TU_ASSERT(XFER_RESULT_SUCCESS == result);
- hub_interface_t* p_hub = get_itf(dev_addr);
-
- if (request->wIndex == p_hub->port_count)
- {
- // All ports are power -> queue notification status endpoint and
- // complete the SET CONFIGURATION
- TU_ASSERT( usbh_edpt_xfer(dev_addr, p_hub->ep_in, &p_hub->status_change, 1) );
-
- usbh_driver_set_config_complete(dev_addr, p_hub->itf_num);
- }else
- {
- // power next port
- uint8_t const hub_port = (uint8_t) (request->wIndex + 1);
- return hub_port_set_feature(dev_addr, hub_port, HUB_FEATURE_PORT_POWER, config_port_power_complete);
- }
-
- return true;
-}
-
-//--------------------------------------------------------------------+
-// Connection Changes
-//--------------------------------------------------------------------+
-
-static bool connection_get_status_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-static bool connection_clear_conn_change_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-static bool connection_port_reset_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-
-// callback as response of interrupt endpoint polling
-bool hub_xfer_cb(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
-{
- (void) xferred_bytes; // TODO can be more than 1 for hub with lots of ports
- (void) ep_addr;
- TU_ASSERT(result == XFER_RESULT_SUCCESS);
-
- hub_interface_t* p_hub = get_itf(dev_addr);
-
- TU_LOG2(" Port Status Change = 0x%02X\r\n", p_hub->status_change);
-
- // Hub ignore bit0 in status change
- for (uint8_t port=1; port <= p_hub->port_count; port++)
- {
- if ( tu_bit_test(p_hub->status_change, port) )
- {
- hub_port_get_status(dev_addr, port, &p_hub->port_status, connection_get_status_complete);
- break;
- }
- }
-
- // NOTE: next status transfer is queued by usbh.c after handling this request
-
- return true;
-}
-
-static bool connection_get_status_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- TU_ASSERT(result == XFER_RESULT_SUCCESS);
-
- hub_interface_t* p_hub = get_itf(dev_addr);
- uint8_t const port_num = (uint8_t) request->wIndex;
-
- // Connection change
- if (p_hub->port_status.change.connection)
- {
- // Port is powered and enabled
- //TU_VERIFY(port_status.status_current.port_power && port_status.status_current.port_enable, );
-
- // Acknowledge Port Connection Change
- hub_port_clear_feature(dev_addr, port_num, HUB_FEATURE_PORT_CONNECTION_CHANGE, connection_clear_conn_change_complete);
- }else
- {
- // Other changes are: Enable, Suspend, Over Current, Reset, L1 state
- // TODO clear change
-
- // prepare for next hub status
- // TODO continue with status_change, or maybe we can do it again with status
- hub_status_pipe_queue(dev_addr);
- }
-
- return true;
-}
-
-static bool connection_clear_conn_change_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- TU_ASSERT(result == XFER_RESULT_SUCCESS);
-
- hub_interface_t* p_hub = get_itf(dev_addr);
- uint8_t const port_num = (uint8_t) request->wIndex;
-
- if ( p_hub->port_status.status.connection )
- {
- // Reset port if attach event
- hub_port_reset(dev_addr, port_num, connection_port_reset_complete);
- }else
- {
- // submit detach event
- hcd_event_t event =
- {
- .rhport = usbh_get_rhport(dev_addr),
- .event_id = HCD_EVENT_DEVICE_REMOVE,
- .connection =
- {
- .hub_addr = dev_addr,
- .hub_port = port_num
- }
- };
-
- hcd_event_handler(&event, false);
- }
-
- return true;
-}
-
-static bool connection_port_reset_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- TU_ASSERT(result == XFER_RESULT_SUCCESS);
-
- // hub_interface_t* p_hub = get_itf(dev_addr);
- uint8_t const port_num = (uint8_t) request->wIndex;
-
- // submit attach event
- hcd_event_t event =
- {
- .rhport = usbh_get_rhport(dev_addr),
- .event_id = HCD_EVENT_DEVICE_ATTACH,
- .connection =
- {
- .hub_addr = dev_addr,
- .hub_port = port_num
- }
- };
-
- hcd_event_handler(&event, false);
-
- return true;
-}
-
-#endif
diff --git a/tinyusb/src/host/hub.h b/tinyusb/src/host/hub.h
deleted file mode 100755
index c4d54419..00000000
--- a/tinyusb/src/host/hub.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/** \ingroup group_class
- * \defgroup ClassDriver_Hub Hub (Host only)
- * \details Like most PC's OS, Hub support is completely hidden from Application. In fact, application cannot determine whether
- * a device is mounted directly via roothub or via a hub's port. All Hub-related procedures are performed and managed
- * by tinyusb stack. Unless you are trying to develop the stack itself, there are nothing else can be used by Application.
- * \note Due to my laziness, only 1-level of Hub is supported. In other way, the stack cannot mount a hub via another hub.
- * @{
- */
-
-#ifndef _TUSB_HUB_H_
-#define _TUSB_HUB_H_
-
-#include "common/tusb_common.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//D1...D0: Logical Power Switching Mode
-//00: Ganged power switching (all ports’power at
-//once)
-//01: Individual port power switching
-//1X: Reserved. Used only on 1.0 compliant hubs
-//that implement no power switching
-//D2: Identifies a Compound Device
-//0: Hub is not part of a compound device.
-//1: Hub is part of a compound device.
-//D4...D3: Over-current Protection Mode
-//00: Global Over-current Protection. The hub
-//reports over-current as a summation of all
-//ports’current draw, without a breakdown of
-//individual port over-current status.
-//01: Individual Port Over-current Protection. The
-//hub reports over-current on a per-port basis.
-//Each port has an over-current status.
-//1X: No Over-current Protection. This option is
-//allowed only for bus-powered hubs that do not
-//implement over-current protection.
-//
-//D6...D5: TT Think TIme
-//00: TT requires at most 8 FS bit times of inter
-//transaction gap on a full-/low-speed
-//downstream bus.
-//01: TT requires at most 16 FS bit times.
-//10: TT requires at most 24 FS bit times.
-//11: TT requires at most 32 FS bit times.
-//D7: Port Indicators Supported
-//0: Port Indicators are not supported on its
-//downstream facing ports and the
-//PORT_INDICATOR request has no effect.
-//1: Port Indicators are supported on its
-//downstream facing ports and the
-//PORT_INDICATOR request controls the
-//indicators. See Section 11.5.3.
-//D15...D8: Reserved
-
-typedef struct TU_ATTR_PACKED{
- uint8_t bLength ; ///< Size of descriptor
- uint8_t bDescriptorType ; ///< Other_speed_Configuration Type
- uint8_t bNbrPorts;
- uint16_t wHubCharacteristics;
- uint8_t bPwrOn2PwrGood;
- uint8_t bHubContrCurrent;
- uint8_t DeviceRemovable; // bitmap each bit for a port (from bit1)
- uint8_t PortPwrCtrlMask; // just for compatibility, should be 0xff
-} descriptor_hub_desc_t;
-
-TU_VERIFY_STATIC( sizeof(descriptor_hub_desc_t) == 9, "size is not correct");
-
-enum {
- HUB_REQUEST_GET_STATUS = 0 ,
- HUB_REQUEST_CLEAR_FEATURE = 1 ,
-
- HUB_REQUEST_SET_FEATURE = 3 ,
-
- HUB_REQUEST_GET_DESCRIPTOR = 6 ,
- HUB_REQUEST_SET_DESCRIPTOR = 7 ,
- HUB_REQUEST_CLEAR_TT_BUFFER = 8 ,
- HUB_REQUEST_RESET_TT = 9 ,
- HUB_REQUEST_GET_TT_STATE = 10 ,
- HUB_REQUEST_STOP_TT = 11
-};
-
-enum {
- HUB_FEATURE_HUB_LOCAL_POWER_CHANGE = 0,
- HUB_FEATURE_HUB_OVER_CURRENT_CHANGE
-};
-
-enum{
- HUB_FEATURE_PORT_CONNECTION = 0,
- HUB_FEATURE_PORT_ENABLE = 1,
- HUB_FEATURE_PORT_SUSPEND = 2,
- HUB_FEATURE_PORT_OVER_CURRENT = 3,
- HUB_FEATURE_PORT_RESET = 4,
-
- HUB_FEATURE_PORT_POWER = 8,
- HUB_FEATURE_PORT_LOW_SPEED = 9,
-
- HUB_FEATURE_PORT_CONNECTION_CHANGE = 16,
- HUB_FEATURE_PORT_ENABLE_CHANGE = 17,
- HUB_FEATURE_PORT_SUSPEND_CHANGE = 18,
- HUB_FEATURE_PORT_OVER_CURRENT_CHANGE = 19,
- HUB_FEATURE_PORT_RESET_CHANGE = 20,
- HUB_FEATURE_PORT_TEST = 21,
- HUB_FEATURE_PORT_INDICATOR = 22
-};
-
-// data in response of HUB_REQUEST_GET_STATUS, wIndex = 0 (hub)
-typedef struct {
- union{
- struct TU_ATTR_PACKED {
- uint16_t local_power_source : 1;
- uint16_t over_current : 1;
- uint16_t : 14;
- };
-
- uint16_t value;
- } status, change;
-} hub_status_response_t;
-
-TU_VERIFY_STATIC( sizeof(hub_status_response_t) == 4, "size is not correct");
-
-// data in response of HUB_REQUEST_GET_STATUS, wIndex = Port num
-typedef struct {
- union {
- struct TU_ATTR_PACKED {
- uint16_t connection : 1;
- uint16_t port_enable : 1;
- uint16_t suspend : 1;
- uint16_t over_current : 1;
- uint16_t reset : 1;
-
- uint16_t : 3;
- uint16_t port_power : 1;
- uint16_t low_speed : 1;
- uint16_t high_speed : 1;
- uint16_t port_test_mode : 1;
- uint16_t port_indicator_control : 1;
- uint16_t TU_RESERVED : 3;
- };
-
- uint16_t value;
- } status, change;
-} hub_port_status_response_t;
-
-TU_VERIFY_STATIC( sizeof(hub_port_status_response_t) == 4, "size is not correct");
-
-bool hub_port_clear_feature(uint8_t hub_addr, uint8_t hub_port, uint8_t feature, tuh_control_complete_cb_t complete_cb);
-bool hub_port_set_feature(uint8_t hub_addr, uint8_t hub_port, uint8_t feature, tuh_control_complete_cb_t complete_cb);
-
-bool hub_port_reset(uint8_t hub_addr, uint8_t hub_port, tuh_control_complete_cb_t complete_cb);
-bool hub_port_get_status(uint8_t hub_addr, uint8_t hub_port, void* resp, tuh_control_complete_cb_t complete_cb);
-bool hub_status_pipe_queue(uint8_t dev_addr);
-
-//--------------------------------------------------------------------+
-// Internal Class Driver API
-//--------------------------------------------------------------------+
-void hub_init (void);
-bool hub_open (uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *itf_desc, uint16_t max_len);
-bool hub_set_config (uint8_t dev_addr, uint8_t itf_num);
-bool hub_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes);
-void hub_close (uint8_t dev_addr);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_HUB_H_ */
-
-/** @} */
diff --git a/tinyusb/src/host/usbh.c b/tinyusb/src/host/usbh.c
deleted file mode 100755
index 51b8f85b..00000000
--- a/tinyusb/src/host/usbh.c
+++ /dev/null
@@ -1,1188 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_HOST_ENABLED
-
-#include "tusb.h"
-#include "host/usbh.h"
-#include "host/usbh_classdriver.h"
-#include "hub.h"
-
-//--------------------------------------------------------------------+
-// USBH Configuration
-//--------------------------------------------------------------------+
-
-// TODO remove,update
-#ifndef CFG_TUH_EP_MAX
-#define CFG_TUH_EP_MAX 9
-#endif
-
-#ifndef CFG_TUH_TASK_QUEUE_SZ
-#define CFG_TUH_TASK_QUEUE_SZ 16
-#endif
-
-// Debug level of USBD
-#define USBH_DBG_LVL 2
-
-//--------------------------------------------------------------------+
-// USBH-HCD common data structure
-//--------------------------------------------------------------------+
-
-typedef struct {
- //------------- port -------------//
- uint8_t rhport;
- uint8_t hub_addr;
- uint8_t hub_port;
- uint8_t speed;
-
- //------------- device descriptor -------------//
- uint16_t vid;
- uint16_t pid;
-
- uint8_t ep0_size;
- uint8_t i_manufacturer;
- uint8_t i_product;
- uint8_t i_serial;
-
- //------------- configuration descriptor -------------//
- // uint8_t interface_count; // bNumInterfaces alias
-
- //------------- device -------------//
- struct TU_ATTR_PACKED
- {
- uint8_t connected : 1;
- uint8_t addressed : 1;
- uint8_t configured : 1;
- uint8_t suspended : 1;
- };
-
- volatile uint8_t state; // device state, value from enum tusbh_device_state_t
-
- uint8_t itf2drv[16]; // map interface number to driver (0xff is invalid)
- uint8_t ep2drv[CFG_TUH_EP_MAX][2]; // map endpoint to driver ( 0xff is invalid )
-
- struct TU_ATTR_PACKED
- {
- volatile bool busy : 1;
- volatile bool stalled : 1;
- volatile bool claimed : 1;
-
- // TODO merge ep2drv here, 4-bit should be sufficient
- }ep_status[CFG_TUH_EP_MAX][2];
-
- // Mutex for claiming endpoint, only needed when using with preempted RTOS
-#if CFG_TUSB_OS != OPT_OS_NONE
- osal_mutex_def_t mutexdef;
- osal_mutex_t mutex;
-#endif
-
-} usbh_device_t;
-
-typedef struct
-{
- uint8_t rhport;
- uint8_t hub_addr;
- uint8_t hub_port;
- uint8_t speed;
-
- volatile uint8_t connected;
-} usbh_dev0_t;
-
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-// Invalid driver ID in itf2drv[] ep2drv[][] mapping
-enum { DRVID_INVALID = 0xFFu };
-enum { ADDR_INVALID = 0xFFu };
-
-#if CFG_TUSB_DEBUG >= 2
- #define DRIVER_NAME(_name) .name = _name,
-#else
- #define DRIVER_NAME(_name)
-#endif
-
-static usbh_class_driver_t const usbh_class_drivers[] =
-{
- #if CFG_TUH_CDC
- {
- DRIVER_NAME("CDC")
- .init = cdch_init,
- .open = cdch_open,
- .set_config = cdch_set_config,
- .xfer_cb = cdch_xfer_cb,
- .close = cdch_close
- },
- #endif
-
- #if CFG_TUH_MSC
- {
- DRIVER_NAME("MSC")
- .init = msch_init,
- .open = msch_open,
- .set_config = msch_set_config,
- .xfer_cb = msch_xfer_cb,
- .close = msch_close
- },
- #endif
-
- #if CFG_TUH_HID
- {
- DRIVER_NAME("HID")
- .init = hidh_init,
- .open = hidh_open,
- .set_config = hidh_set_config,
- .xfer_cb = hidh_xfer_cb,
- .close = hidh_close
- },
- #endif
-
- #if CFG_TUH_HUB
- {
- DRIVER_NAME("HUB")
- .init = hub_init,
- .open = hub_open,
- .set_config = hub_set_config,
- .xfer_cb = hub_xfer_cb,
- .close = hub_close
- },
- #endif
-
- #if CFG_TUH_VENDOR
- {
- DRIVER_NAME("VENDOR")
- .init = cush_init,
- .open = cush_open_subtask,
- .xfer_cb = cush_isr,
- .close = cush_close
- }
- #endif
-};
-
-enum { USBH_CLASS_DRIVER_COUNT = TU_ARRAY_SIZE(usbh_class_drivers) };
-
-enum { RESET_DELAY = 500 }; // 200 USB specs say only 50ms but many devices require much longer
-
-enum { CONFIG_NUM = 1 }; // default to use configuration 1
-
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-
-static bool _usbh_initialized = false;
-
-// Device with address = 0 for enumeration
-static usbh_dev0_t _dev0;
-
-// all devices excluding zero-address
-// hub address start from CFG_TUH_DEVICE_MAX+1
-CFG_TUSB_MEM_SECTION usbh_device_t _usbh_devices[CFG_TUH_DEVICE_MAX + CFG_TUH_HUB];
-
-// Event queue
-// role device/host is used by OS NONE for mutex (disable usb isr)
-OSAL_QUEUE_DEF(OPT_MODE_HOST, _usbh_qdef, CFG_TUH_TASK_QUEUE_SZ, hcd_event_t);
-static osal_queue_t _usbh_q;
-
-CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static uint8_t _usbh_ctrl_buf[CFG_TUH_ENUMERATION_BUFSIZE];
-
-//------------- Helper Function -------------//
-
-TU_ATTR_ALWAYS_INLINE
-static inline usbh_device_t* get_device(uint8_t dev_addr)
-{
- TU_ASSERT(dev_addr, NULL);
- return &_usbh_devices[dev_addr-1];
-}
-
-static bool enum_new_device(hcd_event_t* event);
-static void process_device_unplugged(uint8_t rhport, uint8_t hub_addr, uint8_t hub_port);
-static bool usbh_edpt_control_open(uint8_t dev_addr, uint8_t max_packet_size);
-
-// from usbh_control.c
-extern bool usbh_control_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes);
-
-//--------------------------------------------------------------------+
-// PUBLIC API (Parameter Verification is required)
-//--------------------------------------------------------------------+
-bool tuh_mounted(uint8_t dev_addr)
-{
- return get_device(dev_addr)->configured;
-}
-
-bool tuh_vid_pid_get(uint8_t dev_addr, uint16_t* vid, uint16_t* pid)
-{
- *vid = *pid = 0;
-
- TU_VERIFY(tuh_mounted(dev_addr));
-
- usbh_device_t const* dev = get_device(dev_addr);
-
- *vid = dev->vid;
- *pid = dev->pid;
-
- return true;
-}
-
-tusb_speed_t tuh_speed_get (uint8_t dev_addr)
-{
- return (tusb_speed_t) (dev_addr ? get_device(dev_addr)->speed : _dev0.speed);
-}
-
-#if CFG_TUSB_OS == OPT_OS_NONE
-void osal_task_delay(uint32_t msec)
-{
- (void) msec;
-
- const uint32_t start = hcd_frame_number(TUH_OPT_RHPORT);
- while ( ( hcd_frame_number(TUH_OPT_RHPORT) - start ) < msec ) {}
-}
-#endif
-
-//--------------------------------------------------------------------+
-// CLASS-USBD API (don't require to verify parameters)
-//--------------------------------------------------------------------+
-
-bool tuh_inited(void)
-{
- return _usbh_initialized;
-}
-
-bool tuh_init(uint8_t rhport)
-{
- // skip if already initialized
- if (_usbh_initialized) return _usbh_initialized;
-
- TU_LOG2("USBH init\r\n");
-
- tu_memclr(_usbh_devices, sizeof(_usbh_devices));
- tu_memclr(&_dev0, sizeof(_dev0));
-
- //------------- Enumeration & Reporter Task init -------------//
- _usbh_q = osal_queue_create( &_usbh_qdef );
- TU_ASSERT(_usbh_q != NULL);
-
- //------------- Semaphore, Mutex for Control Pipe -------------//
- for(uint8_t i=0; i<TU_ARRAY_SIZE(_usbh_devices); i++)
- {
- usbh_device_t * dev = &_usbh_devices[i];
-
-#if CFG_TUSB_OS != OPT_OS_NONE
- dev->mutex = osal_mutex_create(&dev->mutexdef);
- TU_ASSERT(dev->mutex);
-#endif
-
- memset(dev->itf2drv, DRVID_INVALID, sizeof(dev->itf2drv)); // invalid mapping
- memset(dev->ep2drv , DRVID_INVALID, sizeof(dev->ep2drv )); // invalid mapping
- }
-
- // Class drivers init
- for (uint8_t drv_id = 0; drv_id < USBH_CLASS_DRIVER_COUNT; drv_id++)
- {
- TU_LOG2("%s init\r\n", usbh_class_drivers[drv_id].name);
- usbh_class_drivers[drv_id].init();
- }
-
- TU_ASSERT(hcd_init(rhport));
- hcd_int_enable(rhport);
-
- _usbh_initialized = true;
- return true;
-}
-
-/* USB Host Driver task
- * This top level thread manages all host controller event and delegates events to class-specific drivers.
- * This should be called periodically within the mainloop or rtos thread.
- *
- @code
- int main(void)
- {
- application_init();
- tusb_init();
-
- while(1) // the mainloop
- {
- application_code();
- tuh_task(); // tinyusb host task
- }
- }
- @endcode
- */
-void tuh_task(void)
-{
- // Skip if stack is not initialized
- if ( !tusb_inited() ) return;
-
- // Loop until there is no more events in the queue
- while (1)
- {
- hcd_event_t event;
- if ( !osal_queue_receive(_usbh_q, &event) ) return;
-
- switch (event.event_id)
- {
- case HCD_EVENT_DEVICE_ATTACH:
- // TODO due to the shared _usbh_ctrl_buf, we must complete enumerating
- // one device before enumerating another one.
- TU_LOG2("USBH DEVICE ATTACH\r\n");
- enum_new_device(&event);
- break;
-
- case HCD_EVENT_DEVICE_REMOVE:
- TU_LOG2("USBH DEVICE REMOVED\r\n");
- process_device_unplugged(event.rhport, event.connection.hub_addr, event.connection.hub_port);
-
- #if CFG_TUH_HUB
- // TODO remove
- if ( event.connection.hub_addr != 0)
- {
- // done with hub, waiting for next data on status pipe
- (void) hub_status_pipe_queue( event.connection.hub_addr );
- }
- #endif
- break;
-
- case HCD_EVENT_XFER_COMPLETE:
- {
- uint8_t const ep_addr = event.xfer_complete.ep_addr;
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const ep_dir = tu_edpt_dir(ep_addr);
-
- TU_LOG2("on EP %02X with %u bytes\r\n", ep_addr, (unsigned int) event.xfer_complete.len);
-
- if (event.dev_addr == 0)
- {
- // device 0 only has control endpoint
- TU_ASSERT(epnum == 0, );
- usbh_control_xfer_cb(event.dev_addr, ep_addr, event.xfer_complete.result, event.xfer_complete.len);
- }
- else
- {
- usbh_device_t* dev = get_device(event.dev_addr);
- dev->ep_status[epnum][ep_dir].busy = false;
- dev->ep_status[epnum][ep_dir].claimed = 0;
-
- if ( 0 == epnum )
- {
- usbh_control_xfer_cb(event.dev_addr, ep_addr, event.xfer_complete.result, event.xfer_complete.len);
- }else
- {
- uint8_t drv_id = dev->ep2drv[epnum][ep_dir];
- TU_ASSERT(drv_id < USBH_CLASS_DRIVER_COUNT, );
-
- TU_LOG2("%s xfer callback\r\n", usbh_class_drivers[drv_id].name);
- usbh_class_drivers[drv_id].xfer_cb(event.dev_addr, ep_addr, event.xfer_complete.result, event.xfer_complete.len);
- }
- }
- }
- break;
-
- case USBH_EVENT_FUNC_CALL:
- if ( event.func_call.func ) event.func_call.func(event.func_call.param);
- break;
-
- default: break;
- }
- }
-}
-
-//--------------------------------------------------------------------+
-// USBH API For Class Driver
-//--------------------------------------------------------------------+
-
-uint8_t usbh_get_rhport(uint8_t dev_addr)
-{
- return (dev_addr == 0) ? _dev0.rhport : get_device(dev_addr)->rhport;
-}
-
-uint8_t* usbh_get_enum_buf(void)
-{
- return _usbh_ctrl_buf;
-}
-
-//--------------------------------------------------------------------+
-// HCD Event Handler
-//--------------------------------------------------------------------+
-
-void hcd_devtree_get_info(uint8_t dev_addr, hcd_devtree_info_t* devtree_info)
-{
- if (dev_addr)
- {
- usbh_device_t const* dev = get_device(dev_addr);
-
- devtree_info->rhport = dev->rhport;
- devtree_info->hub_addr = dev->hub_addr;
- devtree_info->hub_port = dev->hub_port;
- devtree_info->speed = dev->speed;
- }else
- {
- devtree_info->rhport = _dev0.rhport;
- devtree_info->hub_addr = _dev0.hub_addr;
- devtree_info->hub_port = _dev0.hub_port;
- devtree_info->speed = _dev0.speed;
- }
-}
-
-void hcd_event_handler(hcd_event_t const* event, bool in_isr)
-{
- switch (event->event_id)
- {
- default:
- osal_queue_send(_usbh_q, event, in_isr);
- break;
- }
-}
-
-void hcd_event_xfer_complete(uint8_t dev_addr, uint8_t ep_addr, uint32_t xferred_bytes, xfer_result_t result, bool in_isr)
-{
- hcd_event_t event =
- {
- .rhport = 0, // TODO correct rhport
- .event_id = HCD_EVENT_XFER_COMPLETE,
- .dev_addr = dev_addr,
- .xfer_complete =
- {
- .ep_addr = ep_addr,
- .result = result,
- .len = xferred_bytes
- }
- };
-
- hcd_event_handler(&event, in_isr);
-}
-
-void hcd_event_device_attach(uint8_t rhport, bool in_isr)
-{
- hcd_event_t event =
- {
- .rhport = rhport,
- .event_id = HCD_EVENT_DEVICE_ATTACH
- };
-
- event.connection.hub_addr = 0;
- event.connection.hub_port = 0;
-
- hcd_event_handler(&event, in_isr);
-}
-
-void hcd_event_device_remove(uint8_t hostid, bool in_isr)
-{
- hcd_event_t event =
- {
- .rhport = hostid,
- .event_id = HCD_EVENT_DEVICE_REMOVE
- };
-
- event.connection.hub_addr = 0;
- event.connection.hub_port = 0;
-
- hcd_event_handler(&event, in_isr);
-}
-
-
-// a device unplugged on hostid, hub_addr, hub_port
-// return true if found and unmounted device, false if cannot find
-void process_device_unplugged(uint8_t rhport, uint8_t hub_addr, uint8_t hub_port)
-{
- //------------- find the all devices (star-network) under port that is unplugged -------------//
- // TODO mark as disconnected in ISR, also handle dev0
- for ( uint8_t dev_id = 0; dev_id < TU_ARRAY_SIZE(_usbh_devices); dev_id++ )
- {
- usbh_device_t* dev = &_usbh_devices[dev_id];
- uint8_t const dev_addr = dev_id+1;
-
- // TODO Hub multiple level
- if (dev->rhport == rhport &&
- (hub_addr == 0 || dev->hub_addr == hub_addr) && // hub_addr == 0 & hub_port == 0 means roothub
- (hub_port == 0 || dev->hub_port == hub_port) &&
- dev->state != TUSB_DEVICE_STATE_UNPLUG)
- {
- // Invoke callback before close driver
- if (tuh_umount_cb) tuh_umount_cb(dev_addr);
-
- // Close class driver
- for (uint8_t drv_id = 0; drv_id < USBH_CLASS_DRIVER_COUNT; drv_id++)
- {
- TU_LOG2("%s close\r\n", usbh_class_drivers[drv_id].name);
- usbh_class_drivers[drv_id].close(dev_addr);
- }
-
- memset(dev->itf2drv, DRVID_INVALID, sizeof(dev->itf2drv)); // invalid mapping
- memset(dev->ep2drv , DRVID_INVALID, sizeof(dev->ep2drv )); // invalid mapping
-
- hcd_device_close(rhport, dev_addr);
-
- dev->state = TUSB_DEVICE_STATE_UNPLUG;
- }
- }
-}
-
-//--------------------------------------------------------------------+
-// INTERNAL HELPER
-//--------------------------------------------------------------------+
-static uint8_t get_new_address(bool is_hub)
-{
- uint8_t const start = (is_hub ? CFG_TUH_DEVICE_MAX : 0) + 1;
- uint8_t const count = (is_hub ? CFG_TUH_HUB : CFG_TUH_DEVICE_MAX);
-
- for (uint8_t i=0; i < count; i++)
- {
- uint8_t const addr = start + i;
- if (get_device(addr)->state == TUSB_DEVICE_STATE_UNPLUG) return addr;
- }
- return ADDR_INVALID;
-}
-
-void usbh_driver_set_config_complete(uint8_t dev_addr, uint8_t itf_num)
-{
- usbh_device_t* dev = get_device(dev_addr);
-
- for(itf_num++; itf_num < sizeof(dev->itf2drv); itf_num++)
- {
- // continue with next valid interface
- // TODO skip IAD binding interface such as CDCs
- uint8_t const drv_id = dev->itf2drv[itf_num];
- if (drv_id != DRVID_INVALID)
- {
- usbh_class_driver_t const * driver = &usbh_class_drivers[drv_id];
- TU_LOG2("%s set config: itf = %u\r\n", driver->name, itf_num);
- driver->set_config(dev_addr, itf_num);
- break;
- }
- }
-
- // all interface are configured
- if (itf_num == sizeof(dev->itf2drv))
- {
- // Invoke callback if available
- if (tuh_mount_cb) tuh_mount_cb(dev_addr);
- }
-}
-
-//--------------------------------------------------------------------+
-// Enumeration Process
-// is a lengthy process with a seires of control transfer to configure
-// newly attached device. Each step is handled by a function in this
-// section
-// TODO due to the shared _usbh_ctrl_buf, we must complete enumerating
-// one device before enumerating another one.
-//--------------------------------------------------------------------+
-
-static bool enum_request_addr0_device_desc(void);
-static bool enum_request_set_addr(void);
-
-static bool enum_get_addr0_device_desc_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-static bool enum_set_address_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-static bool enum_get_device_desc_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-static bool enum_get_9byte_config_desc_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-static bool enum_get_config_desc_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-static bool enum_set_config_complete (uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-static bool parse_configuration_descriptor (uint8_t dev_addr, tusb_desc_configuration_t const* desc_cfg);
-
-#if CFG_TUH_HUB
-static bool enum_hub_clear_reset0_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- (void) dev_addr; (void) request;
- TU_ASSERT(XFER_RESULT_SUCCESS == result);
- enum_request_addr0_device_desc();
- return true;
-}
-
-static bool enum_hub_clear_reset1_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- (void) dev_addr; (void) request;
- TU_ASSERT(XFER_RESULT_SUCCESS == result);
-
- enum_request_set_addr();
-
- // done with hub, waiting for next data on status pipe
- (void) hub_status_pipe_queue( _dev0.hub_addr );
-
- return true;
-}
-
-static bool enum_hub_get_status1_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- (void) dev_addr; (void) request;
- TU_ASSERT(XFER_RESULT_SUCCESS == result);
-
- hub_port_status_response_t port_status;
- memcpy(&port_status, _usbh_ctrl_buf, sizeof(hub_port_status_response_t));
-
- // Acknowledge Port Reset Change if Reset Successful
- if (port_status.change.reset)
- {
- TU_ASSERT( hub_port_clear_feature(_dev0.hub_addr, _dev0.hub_port, HUB_FEATURE_PORT_RESET_CHANGE, enum_hub_clear_reset1_complete) );
- }
-
- return true;
-}
-
-static bool enum_hub_get_status0_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- (void) dev_addr; (void) request;
- TU_ASSERT(XFER_RESULT_SUCCESS == result);
-
- hub_port_status_response_t port_status;
- memcpy(&port_status, _usbh_ctrl_buf, sizeof(hub_port_status_response_t));
-
- if ( !port_status.status.connection )
- {
- // device unplugged while delaying, nothing else to do, queue hub status
- return hub_status_pipe_queue(dev_addr);
- }
-
- _dev0.speed = (port_status.status.high_speed) ? TUSB_SPEED_HIGH :
- (port_status.status.low_speed ) ? TUSB_SPEED_LOW : TUSB_SPEED_FULL;
-
- // Acknowledge Port Reset Change
- if (port_status.change.reset)
- {
- hub_port_clear_feature(_dev0.hub_addr, _dev0.hub_port, HUB_FEATURE_PORT_RESET_CHANGE, enum_hub_clear_reset0_complete);
- }
-
- return true;
-}
-#endif
-
-static bool enum_new_device(hcd_event_t* event)
-{
- _dev0.rhport = event->rhport; // TODO refractor integrate to device_pool
- _dev0.hub_addr = event->connection.hub_addr;
- _dev0.hub_port = event->connection.hub_port;
-
- //------------- connected/disconnected directly with roothub -------------//
- if (_dev0.hub_addr == 0)
- {
- // wait until device is stable TODO non blocking
- osal_task_delay(RESET_DELAY);
-
- // device unplugged while delaying
- if ( !hcd_port_connect_status(_dev0.rhport) ) return true;
-
- _dev0.speed = hcd_port_speed_get(_dev0.rhport );
-
- enum_request_addr0_device_desc();
- }
-#if CFG_TUH_HUB
- //------------- connected/disconnected via hub -------------//
- else
- {
- // wait until device is stable
- osal_task_delay(RESET_DELAY);
- TU_ASSERT( hub_port_get_status(_dev0.hub_addr, _dev0.hub_port, _usbh_ctrl_buf, enum_hub_get_status0_complete) );
- }
-#endif // CFG_TUH_HUB
-
- return true;
-}
-
-static bool enum_request_addr0_device_desc(void)
-{
- // TODO probably doesn't need to open/close each enumeration
- uint8_t const addr0 = 0;
- TU_ASSERT( usbh_edpt_control_open(addr0, 8) );
-
- //------------- Get first 8 bytes of device descriptor to get Control Endpoint Size -------------//
- TU_LOG2("Get 8 byte of Device Descriptor\r\n");
- tusb_control_request_t const request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_DEVICE,
- .type = TUSB_REQ_TYPE_STANDARD,
- .direction = TUSB_DIR_IN
- },
- .bRequest = TUSB_REQ_GET_DESCRIPTOR,
- .wValue = TUSB_DESC_DEVICE << 8,
- .wIndex = 0,
- .wLength = 8
- };
- TU_ASSERT( tuh_control_xfer(addr0, &request, _usbh_ctrl_buf, enum_get_addr0_device_desc_complete) );
-
- return true;
-}
-
-// After Get Device Descriptor of Address 0
-static bool enum_get_addr0_device_desc_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- (void) request;
- TU_ASSERT(0 == dev_addr);
-
- if (XFER_RESULT_SUCCESS != result)
- {
-#if CFG_TUH_HUB
- // TODO remove, waiting for next data on status pipe
- if (_dev0.hub_addr != 0) hub_status_pipe_queue(_dev0.hub_addr);
-#endif
-
- return false;
- }
-
- tusb_desc_device_t const * desc_device = (tusb_desc_device_t const*) _usbh_ctrl_buf;
- TU_ASSERT( tu_desc_type(desc_device) == TUSB_DESC_DEVICE );
-
- // Reset device again before Set Address
- TU_LOG2("Port reset \r\n");
-
- if (_dev0.hub_addr == 0)
- {
- // connected directly to roothub
- hcd_port_reset( _dev0.rhport ); // reset port after 8 byte descriptor
- osal_task_delay(RESET_DELAY);
-
- enum_request_set_addr();
- }
-#if CFG_TUH_HUB
- else
- {
- // after RESET_DELAY the hub_port_reset() already complete
- TU_ASSERT( hub_port_reset(_dev0.hub_addr, _dev0.hub_port, NULL) );
- osal_task_delay(RESET_DELAY);
-
- tuh_task(); // FIXME temporarily to clean up port_reset control transfer
-
- TU_ASSERT( hub_port_get_status(_dev0.hub_addr, _dev0.hub_port, _usbh_ctrl_buf, enum_hub_get_status1_complete) );
- }
-#endif
-
- return true;
-}
-
-static bool enum_request_set_addr(void)
-{
- uint8_t const addr0 = 0;
- tusb_desc_device_t const * desc_device = (tusb_desc_device_t const*) _usbh_ctrl_buf;
-
- // Get new address
- uint8_t const new_addr = get_new_address(desc_device->bDeviceClass == TUSB_CLASS_HUB);
- TU_ASSERT(new_addr != ADDR_INVALID);
-
- TU_LOG2("Set Address = %d\r\n", new_addr);
-
- usbh_device_t* new_dev = get_device(new_addr);
-
- new_dev->rhport = _dev0.rhport;
- new_dev->hub_addr = _dev0.hub_addr;
- new_dev->hub_port = _dev0.hub_port;
- new_dev->speed = _dev0.speed;
- new_dev->connected = 1;
- new_dev->ep0_size = desc_device->bMaxPacketSize0;
-
- tusb_control_request_t const new_request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_DEVICE,
- .type = TUSB_REQ_TYPE_STANDARD,
- .direction = TUSB_DIR_OUT
- },
- .bRequest = TUSB_REQ_SET_ADDRESS,
- .wValue = new_addr,
- .wIndex = 0,
- .wLength = 0
- };
-
- TU_ASSERT( tuh_control_xfer(addr0, &new_request, NULL, enum_set_address_complete) );
-
- return true;
-}
-
-// After SET_ADDRESS is complete
-static bool enum_set_address_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- TU_ASSERT(0 == dev_addr);
- TU_ASSERT(XFER_RESULT_SUCCESS == result);
-
- uint8_t const new_addr = (uint8_t const) request->wValue;
-
- usbh_device_t* new_dev = get_device(new_addr);
- new_dev->addressed = 1;
-
- // TODO close device 0, may not be needed
- hcd_device_close(_dev0.rhport, 0);
-
- // open control pipe for new address
- TU_ASSERT( usbh_edpt_control_open(new_addr, new_dev->ep0_size) );
-
- // Get full device descriptor
- TU_LOG2("Get Device Descriptor\r\n");
- tusb_control_request_t const new_request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_DEVICE,
- .type = TUSB_REQ_TYPE_STANDARD,
- .direction = TUSB_DIR_IN
- },
- .bRequest = TUSB_REQ_GET_DESCRIPTOR,
- .wValue = TUSB_DESC_DEVICE << 8,
- .wIndex = 0,
- .wLength = sizeof(tusb_desc_device_t)
- };
-
- TU_ASSERT(tuh_control_xfer(new_addr, &new_request, _usbh_ctrl_buf, enum_get_device_desc_complete));
-
- return true;
-}
-
-static bool enum_get_device_desc_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- (void) request;
- TU_ASSERT(XFER_RESULT_SUCCESS == result);
-
- tusb_desc_device_t const * desc_device = (tusb_desc_device_t const*) _usbh_ctrl_buf;
- usbh_device_t* dev = get_device(dev_addr);
-
- dev->vid = desc_device->idVendor;
- dev->pid = desc_device->idProduct;
- dev->i_manufacturer = desc_device->iManufacturer;
- dev->i_product = desc_device->iProduct;
- dev->i_serial = desc_device->iSerialNumber;
-
-// if (tuh_attach_cb) tuh_attach_cb((tusb_desc_device_t*) _usbh_ctrl_buf);
-
- TU_LOG2("Get 9 bytes of Configuration Descriptor\r\n");
- tusb_control_request_t const new_request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_DEVICE,
- .type = TUSB_REQ_TYPE_STANDARD,
- .direction = TUSB_DIR_IN
- },
- .bRequest = TUSB_REQ_GET_DESCRIPTOR,
- .wValue = (TUSB_DESC_CONFIGURATION << 8) | (CONFIG_NUM - 1),
- .wIndex = 0,
- .wLength = 9
- };
-
- TU_ASSERT( tuh_control_xfer(dev_addr, &new_request, _usbh_ctrl_buf, enum_get_9byte_config_desc_complete) );
-
- return true;
-}
-
-static bool enum_get_9byte_config_desc_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- (void) request;
- TU_ASSERT(XFER_RESULT_SUCCESS == result);
-
- // TODO not enough buffer to hold configuration descriptor
- tusb_desc_configuration_t const * desc_config = (tusb_desc_configuration_t const*) _usbh_ctrl_buf;
- uint16_t total_len;
-
- // Use offsetof to avoid pointer to the odd/misaligned address
- memcpy(&total_len, (uint8_t*) desc_config + offsetof(tusb_desc_configuration_t, wTotalLength), 2);
-
- TU_ASSERT(total_len <= CFG_TUH_ENUMERATION_BUFSIZE);
-
- // Get full configuration descriptor
- TU_LOG2("Get Configuration Descriptor\r\n");
- tusb_control_request_t const new_request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_DEVICE,
- .type = TUSB_REQ_TYPE_STANDARD,
- .direction = TUSB_DIR_IN
- },
- .bRequest = TUSB_REQ_GET_DESCRIPTOR,
- .wValue = (TUSB_DESC_CONFIGURATION << 8) | (CONFIG_NUM - 1),
- .wIndex = 0,
- .wLength = total_len
-
- };
-
- TU_ASSERT( tuh_control_xfer(dev_addr, &new_request, _usbh_ctrl_buf, enum_get_config_desc_complete) );
-
- return true;
-}
-
-static bool enum_get_config_desc_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- (void) request;
- TU_ASSERT(XFER_RESULT_SUCCESS == result);
-
- // Parse configuration & set up drivers
- // Driver open aren't allowed to make any usb transfer yet
- TU_ASSERT( parse_configuration_descriptor(dev_addr, (tusb_desc_configuration_t*) _usbh_ctrl_buf) );
-
- TU_LOG2("Set Configuration = %d\r\n", CONFIG_NUM);
- tusb_control_request_t const new_request =
- {
- .bmRequestType_bit =
- {
- .recipient = TUSB_REQ_RCPT_DEVICE,
- .type = TUSB_REQ_TYPE_STANDARD,
- .direction = TUSB_DIR_OUT
- },
- .bRequest = TUSB_REQ_SET_CONFIGURATION,
- .wValue = CONFIG_NUM,
- .wIndex = 0,
- .wLength = 0
- };
-
- TU_ASSERT( tuh_control_xfer(dev_addr, &new_request, NULL, enum_set_config_complete) );
-
- return true;
-}
-
-static bool enum_set_config_complete(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result)
-{
- (void) request;
- TU_ASSERT(XFER_RESULT_SUCCESS == result);
-
- TU_LOG2("Device configured\r\n");
- usbh_device_t* dev = get_device(dev_addr);
- dev->configured = 1;
- dev->state = TUSB_DEVICE_STATE_CONFIGURED;
-
- // Start the Set Configuration process for interfaces (itf = DRVID_INVALID)
- // Since driver can perform control transfer within its set_config, this is done asynchronously.
- // The process continue with next interface when class driver complete its sequence with usbh_driver_set_config_complete()
- // TODO use separated API instead of using DRVID_INVALID
- usbh_driver_set_config_complete(dev_addr, DRVID_INVALID);
-
- return true;
-}
-
-static bool parse_configuration_descriptor(uint8_t dev_addr, tusb_desc_configuration_t const* desc_cfg)
-{
- usbh_device_t* dev = get_device(dev_addr);
-
- uint8_t const* desc_end = ((uint8_t const*) desc_cfg) + tu_le16toh(desc_cfg->wTotalLength);
- uint8_t const* p_desc = tu_desc_next(desc_cfg);
-
- // parse each interfaces
- while( p_desc < desc_end )
- {
- // TODO Do we need to use IAD
- tusb_desc_interface_assoc_t const * desc_iad = NULL;
-
- // Class will always starts with Interface Association (if any) and then Interface descriptor
- if ( TUSB_DESC_INTERFACE_ASSOCIATION == tu_desc_type(p_desc) )
- {
- desc_iad = (tusb_desc_interface_assoc_t const *) p_desc;
- p_desc = tu_desc_next(p_desc);
- }
-
- TU_ASSERT( TUSB_DESC_INTERFACE == tu_desc_type(p_desc) );
-
- tusb_desc_interface_t const* desc_itf = (tusb_desc_interface_t const*) p_desc;
-
- // Interface number must not be used already
- TU_ASSERT( dev->itf2drv[desc_itf->bInterfaceNumber] == DRVID_INVALID );
-
- uint16_t const drv_len = tu_desc_get_interface_total_len(desc_itf, desc_iad ? desc_iad->bInterfaceCount : 1, desc_end-p_desc);
- TU_ASSERT(drv_len);
-
- if (desc_itf->bInterfaceClass == TUSB_CLASS_HUB && dev->hub_addr != 0)
- {
- // TODO Attach hub to Hub is not currently supported
- // skip this interface
- TU_LOG(USBH_DBG_LVL, "Only 1 level of HUB is supported\r\n");
- }
- else
- {
- // Find driver for this interface
- uint8_t drv_id;
- for (drv_id = 0; drv_id < USBH_CLASS_DRIVER_COUNT; drv_id++)
- {
- usbh_class_driver_t const * driver = &usbh_class_drivers[drv_id];
-
- if ( driver->open(dev->rhport, dev_addr, desc_itf, drv_len) )
- {
- // open successfully
- TU_LOG2(" Opened successfully\r\n");
-
- // bind interface to found driver
- dev->itf2drv[desc_itf->bInterfaceNumber] = drv_id;
-
- // If using IAD, bind all interfaces to the same driver
- if (desc_iad)
- {
- // IAD's first interface number and class should match with opened interface
- TU_ASSERT(desc_iad->bFirstInterface == desc_itf->bInterfaceNumber &&
- desc_iad->bFunctionClass == desc_itf->bInterfaceClass);
-
- for(uint8_t i=1; i<desc_iad->bInterfaceCount; i++)
- {
- dev->itf2drv[desc_itf->bInterfaceNumber+i] = drv_id;
- }
- }
-
- // bind all endpoints to found driver
- tu_edpt_bind_driver(dev->ep2drv, desc_itf, drv_len, drv_id);
-
- break; // exit driver find loop
- }
- }
-
- if( drv_id >= USBH_CLASS_DRIVER_COUNT )
- {
- TU_LOG(USBH_DBG_LVL, "Interface %u: class = %u subclass = %u protocol = %u is not supported\r\n",
- desc_itf->bInterfaceNumber, desc_itf->bInterfaceClass, desc_itf->bInterfaceSubClass, desc_itf->bInterfaceProtocol);
- }
- }
-
- // next Interface or IAD descriptor
- p_desc += drv_len;
- }
-
- return true;
-}
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-
-// TODO has some duplication code with device, refactor later
-bool usbh_edpt_claim(uint8_t dev_addr, uint8_t ep_addr)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- usbh_device_t* dev = get_device(dev_addr);
-
-#if CFG_TUSB_OS != OPT_OS_NONE
- // pre-check to help reducing mutex lock
- TU_VERIFY((dev->ep_status[epnum][dir].busy == 0) && (dev->ep_status[epnum][dir].claimed == 0));
- osal_mutex_lock(dev->mutex, OSAL_TIMEOUT_WAIT_FOREVER);
-#endif
-
- // can only claim the endpoint if it is not busy and not claimed yet.
- bool const ret = (dev->ep_status[epnum][dir].busy == 0) && (dev->ep_status[epnum][dir].claimed == 0);
- if (ret)
- {
- dev->ep_status[epnum][dir].claimed = 1;
- }
-
-#if CFG_TUSB_OS != OPT_OS_NONE
- osal_mutex_unlock(dev->mutex);
-#endif
-
- return ret;
-}
-
-// TODO has some duplication code with device, refactor later
-bool usbh_edpt_release(uint8_t dev_addr, uint8_t ep_addr)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- usbh_device_t* dev = get_device(dev_addr);
-
-#if CFG_TUSB_OS != OPT_OS_NONE
- osal_mutex_lock(dev->mutex, OSAL_TIMEOUT_WAIT_FOREVER);
-#endif
-
- // can only release the endpoint if it is claimed and not busy
- bool const ret = (dev->ep_status[epnum][dir].busy == 0) && (dev->ep_status[epnum][dir].claimed == 1);
- if (ret)
- {
- dev->ep_status[epnum][dir].claimed = 0;
- }
-
-#if CFG_TUSB_OS != OPT_OS_NONE
- osal_mutex_unlock(dev->mutex);
-#endif
-
- return ret;
-}
-
-// TODO has some duplication code with device, refactor later
-bool usbh_edpt_xfer(uint8_t dev_addr, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- usbh_device_t* dev = get_device(dev_addr);
-
- TU_LOG2(" Queue EP %02X with %u bytes ... ", ep_addr, total_bytes);
-
- // Attempt to transfer on a busy endpoint, sound like an race condition !
- TU_ASSERT(dev->ep_status[epnum][dir].busy == 0);
-
- // Set busy first since the actual transfer can be complete before hcd_edpt_xfer()
- // could return and USBH task can preempt and clear the busy
- dev->ep_status[epnum][dir].busy = true;
-
- if ( hcd_edpt_xfer(dev->rhport, dev_addr, ep_addr, buffer, total_bytes) )
- {
- TU_LOG2("OK\r\n");
- return true;
- }else
- {
- // HCD error, mark endpoint as ready to allow next transfer
- dev->ep_status[epnum][dir].busy = false;
- dev->ep_status[epnum][dir].claimed = 0;
- TU_LOG2("failed\r\n");
- TU_BREAKPOINT();
- return false;
- }
-}
-
-static bool usbh_edpt_control_open(uint8_t dev_addr, uint8_t max_packet_size)
-{
- TU_LOG2("Open EP0 with Size = %u (addr = %u)\r\n", max_packet_size, dev_addr);
-
- tusb_desc_endpoint_t ep0_desc =
- {
- .bLength = sizeof(tusb_desc_endpoint_t),
- .bDescriptorType = TUSB_DESC_ENDPOINT,
- .bEndpointAddress = 0,
- .bmAttributes = { .xfer = TUSB_XFER_CONTROL },
- .wMaxPacketSize = { .size = max_packet_size },
- .bInterval = 0
- };
-
- return hcd_edpt_open(usbh_get_rhport(dev_addr), dev_addr, &ep0_desc);
-}
-
-bool usbh_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const * desc_ep)
-{
- usbh_device_t* dev = get_device(dev_addr);
- TU_ASSERT(tu_edpt_validate(desc_ep, (tusb_speed_t) dev->speed));
-
- return hcd_edpt_open(rhport, dev_addr, desc_ep);
-}
-
-bool usbh_edpt_busy(uint8_t dev_addr, uint8_t ep_addr)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- usbh_device_t* dev = get_device(dev_addr);
-
- return dev->ep_status[epnum][dir].busy;
-}
-
-
-
-#endif
diff --git a/tinyusb/src/host/usbh.h b/tinyusb/src/host/usbh.h
deleted file mode 100755
index 8411cad2..00000000
--- a/tinyusb/src/host/usbh.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_USBH_H_
-#define _TUSB_USBH_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "common/tusb_common.h"
-#include "hcd.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-typedef bool (*tuh_control_complete_cb_t)(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result);
-
-//--------------------------------------------------------------------+
-// APPLICATION API
-//--------------------------------------------------------------------+
-
-// Init host stack
-bool tuh_init(uint8_t rhport);
-
-// Check if host stack is already initialized
-bool tuh_inited(void);
-
-// Task function should be called in main/rtos loop
-void tuh_task(void);
-
-// Interrupt handler, name alias to HCD
-extern void hcd_int_handler(uint8_t rhport);
-#define tuh_int_handler hcd_int_handler
-
-bool tuh_vid_pid_get(uint8_t dev_addr, uint16_t* vid, uint16_t* pid);
-tusb_speed_t tuh_speed_get(uint8_t dev_addr);
-
-// Check if device is connected and configured
-bool tuh_mounted(uint8_t dev_addr);
-
-// Check if device is suspended
-static inline bool tuh_suspended(uint8_t dev_addr)
-{
- // TODO implement suspend & resume on host
- (void) dev_addr;
- return false;
-}
-
-// Check if device is ready to communicate with
-TU_ATTR_ALWAYS_INLINE
-static inline bool tuh_ready(uint8_t dev_addr)
-{
- return tuh_mounted(dev_addr) && !tuh_suspended(dev_addr);
-}
-
-// Carry out control transfer
-bool tuh_control_xfer (uint8_t dev_addr, tusb_control_request_t const* request, void* buffer, tuh_control_complete_cb_t complete_cb);
-
-//--------------------------------------------------------------------+
-// APPLICATION CALLBACK
-//--------------------------------------------------------------------+
-//TU_ATTR_WEAK uint8_t tuh_attach_cb (tusb_desc_device_t const *desc_device);
-
-// Invoked when device is mounted (configured)
-TU_ATTR_WEAK void tuh_mount_cb (uint8_t dev_addr);
-
-/// Invoked when device is unmounted (bus reset/unplugged)
-TU_ATTR_WEAK void tuh_umount_cb(uint8_t dev_addr);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/src/host/usbh_classdriver.h b/tinyusb/src/host/usbh_classdriver.h
deleted file mode 100755
index 8bc2622a..00000000
--- a/tinyusb/src/host/usbh_classdriver.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_USBH_CLASSDRIVER_H_
-#define _TUSB_USBH_CLASSDRIVER_H_
-
-#include "osal/osal.h"
-#include "common/tusb_fifo.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Class Driver API
-//--------------------------------------------------------------------+
-
-typedef struct {
- #if CFG_TUSB_DEBUG >= 2
- char const* name;
- #endif
-
- void (* const init )(void);
- bool (* const open )(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
- bool (* const set_config )(uint8_t dev_addr, uint8_t itf_num);
- bool (* const xfer_cb )(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes);
- void (* const close )(uint8_t dev_addr);
-} usbh_class_driver_t;
-
-// Call by class driver to tell USBH that it has complete the enumeration
-void usbh_driver_set_config_complete(uint8_t dev_addr, uint8_t itf_num);
-
-uint8_t usbh_get_rhport(uint8_t dev_addr);
-
-uint8_t* usbh_get_enum_buf(void);
-
-//--------------------------------------------------------------------+
-// USBH Endpoint API
-//--------------------------------------------------------------------+
-
-// Open an endpoint
-bool usbh_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const * desc_ep);
-
-// Submit a usb transfer
-bool usbh_edpt_xfer(uint8_t dev_addr, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes);
-
-// Claim an endpoint before submitting a transfer.
-// If caller does not make any transfer, it must release endpoint for others.
-bool usbh_edpt_claim(uint8_t dev_addr, uint8_t ep_addr);
-
-bool usbh_edpt_release(uint8_t dev_addr, uint8_t ep_addr);
-
-// Check if endpoint transferring is complete
-bool usbh_edpt_busy(uint8_t dev_addr, uint8_t ep_addr);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/src/host/usbh_control.c b/tinyusb/src/host/usbh_control.c
deleted file mode 100755
index 9204576a..00000000
--- a/tinyusb/src/host/usbh_control.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_HOST_ENABLED
-
-#include "tusb.h"
-#include "usbh_classdriver.h"
-
-enum
-{
- STAGE_SETUP,
- STAGE_DATA,
- STAGE_ACK
-};
-
-typedef struct
-{
- tusb_control_request_t request TU_ATTR_ALIGNED(4);
-
- uint8_t stage;
- uint8_t* buffer;
- tuh_control_complete_cb_t complete_cb;
-} usbh_control_xfer_t;
-
-static usbh_control_xfer_t _ctrl_xfer;
-
-//CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN
-//static uint8_t _tuh_ctrl_buf[CFG_TUH_ENUMERATION_BUFSIZE];
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-bool tuh_control_xfer (uint8_t dev_addr, tusb_control_request_t const* request, void* buffer, tuh_control_complete_cb_t complete_cb)
-{
- // TODO need to claim the endpoint first
- const uint8_t rhport = usbh_get_rhport(dev_addr);
-
- _ctrl_xfer.request = (*request);
- _ctrl_xfer.buffer = buffer;
- _ctrl_xfer.stage = STAGE_SETUP;
- _ctrl_xfer.complete_cb = complete_cb;
-
- TU_LOG2("Control Setup (addr = %u): ", dev_addr);
- TU_LOG2_VAR(request);
- TU_LOG2("\r\n");
-
- // Send setup packet
- TU_ASSERT( hcd_setup_send(rhport, dev_addr, (uint8_t const*) &_ctrl_xfer.request) );
-
- return true;
-}
-
-static void _xfer_complete(uint8_t dev_addr, xfer_result_t result)
-{
- TU_LOG2("\r\n");
- if (_ctrl_xfer.complete_cb) _ctrl_xfer.complete_cb(dev_addr, &_ctrl_xfer.request, result);
-}
-
-bool usbh_control_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
-{
- (void) ep_addr;
- (void) xferred_bytes;
-
- const uint8_t rhport = usbh_get_rhport(dev_addr);
-
- tusb_control_request_t const * request = &_ctrl_xfer.request;
-
- if (XFER_RESULT_SUCCESS != result)
- {
- TU_LOG2("Control failed: result = %d\r\n", result);
-
- // terminate transfer if any stage failed
- _xfer_complete(dev_addr, result);
- }else
- {
- switch(_ctrl_xfer.stage)
- {
- case STAGE_SETUP:
- _ctrl_xfer.stage = STAGE_DATA;
- if (request->wLength)
- {
- // DATA stage: initial data toggle is always 1
- hcd_edpt_xfer(rhport, dev_addr, tu_edpt_addr(0, request->bmRequestType_bit.direction), _ctrl_xfer.buffer, request->wLength);
- return true;
- }
- __attribute__((fallthrough));
-
- case STAGE_DATA:
- _ctrl_xfer.stage = STAGE_ACK;
-
- if (request->wLength)
- {
- TU_LOG2("Control data (addr = %u):\r\n", dev_addr);
- TU_LOG2_MEM(_ctrl_xfer.buffer, request->wLength, 2);
- }
-
- // ACK stage: toggle is always 1
- hcd_edpt_xfer(rhport, dev_addr, tu_edpt_addr(0, 1-request->bmRequestType_bit.direction), NULL, 0);
- break;
-
- case STAGE_ACK:
- _xfer_complete(dev_addr, result);
- break;
-
- default: return false;
- }
- }
-
- return true;
-}
-
-#endif
diff --git a/tinyusb/src/osal/osal.h b/tinyusb/src/osal/osal.h
deleted file mode 100755
index 28bdf479..00000000
--- a/tinyusb/src/osal/osal.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_OSAL_H_
-#define _TUSB_OSAL_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/** \addtogroup group_osal
- * @{ */
-
-#include "common/tusb_common.h"
-
-// Return immediately
-#define OSAL_TIMEOUT_NOTIMEOUT (0)
-// Default timeout
-#define OSAL_TIMEOUT_NORMAL (10)
-// Wait forever
-#define OSAL_TIMEOUT_WAIT_FOREVER (UINT32_MAX)
-
-#define OSAL_TIMEOUT_CONTROL_XFER OSAL_TIMEOUT_WAIT_FOREVER
-
-typedef void (*osal_task_func_t)( void * );
-
-#if CFG_TUSB_OS == OPT_OS_NONE
- #include "osal_none.h"
-#elif CFG_TUSB_OS == OPT_OS_FREERTOS
- #include "osal_freertos.h"
-#elif CFG_TUSB_OS == OPT_OS_MYNEWT
- #include "osal_mynewt.h"
-#elif CFG_TUSB_OS == OPT_OS_PICO
- #include "osal_pico.h"
-#elif CFG_TUSB_OS == OPT_OS_RTTHREAD
- #include "osal_rtthread.h"
-#elif CFG_TUSB_OS == OPT_OS_CUSTOM
- #include "tusb_os_custom.h" // implemented by application
-#else
- #error OS is not supported yet
-#endif
-
-//--------------------------------------------------------------------+
-// OSAL Porting API
-//--------------------------------------------------------------------+
-
-//------------- Semaphore -------------//
-static inline osal_semaphore_t osal_semaphore_create(osal_semaphore_def_t* semdef);
-static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr);
-static inline bool osal_semaphore_wait(osal_semaphore_t sem_hdl, uint32_t msec);
-
-static inline void osal_semaphore_reset(osal_semaphore_t sem_hdl); // TODO removed
-
-//------------- Mutex -------------//
-static inline osal_mutex_t osal_mutex_create(osal_mutex_def_t* mdef);
-static inline bool osal_mutex_lock (osal_mutex_t sem_hdl, uint32_t msec);
-static inline bool osal_mutex_unlock(osal_mutex_t mutex_hdl);
-
-//------------- Queue -------------//
-static inline osal_queue_t osal_queue_create(osal_queue_def_t* qdef);
-static inline bool osal_queue_receive(osal_queue_t qhdl, void* data);
-static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr);
-static inline bool osal_queue_empty(osal_queue_t qhdl);
-
-#if 0 // TODO remove subtask related macros later
-// Sub Task
-#define OSAL_SUBTASK_BEGIN
-#define OSAL_SUBTASK_END return TUSB_ERROR_NONE;
-
-#define STASK_RETURN(_error) return _error;
-#define STASK_INVOKE(_subtask, _status) (_status) = _subtask
-#define STASK_ASSERT(_cond) TU_VERIFY(_cond, TUSB_ERROR_OSAL_TASK_FAILED)
-#endif
-
-#ifdef __cplusplus
- }
-#endif
-
-/** @} */
-
-#endif /* _TUSB_OSAL_H_ */
diff --git a/tinyusb/src/osal/osal_freertos.h b/tinyusb/src/osal/osal_freertos.h
deleted file mode 100755
index 66070c27..00000000
--- a/tinyusb/src/osal/osal_freertos.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_OSAL_FREERTOS_H_
-#define _TUSB_OSAL_FREERTOS_H_
-
-// FreeRTOS Headers
-#include "FreeRTOS.h"
-#include "semphr.h"
-#include "queue.h"
-#include "task.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// TASK API
-//--------------------------------------------------------------------+
-static inline void osal_task_delay(uint32_t msec)
-{
- vTaskDelay( pdMS_TO_TICKS(msec) );
-}
-
-//--------------------------------------------------------------------+
-// Semaphore API
-//--------------------------------------------------------------------+
-typedef StaticSemaphore_t osal_semaphore_def_t;
-typedef SemaphoreHandle_t osal_semaphore_t;
-
-static inline osal_semaphore_t osal_semaphore_create(osal_semaphore_def_t* semdef)
-{
- return xSemaphoreCreateBinaryStatic(semdef);
-}
-
-static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr)
-{
- if ( !in_isr )
- {
- return xSemaphoreGive(sem_hdl) != 0;
- }
- else
- {
- BaseType_t xHigherPriorityTaskWoken;
- BaseType_t res = xSemaphoreGiveFromISR(sem_hdl, &xHigherPriorityTaskWoken);
-
-#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
- if ( xHigherPriorityTaskWoken ) portYIELD_FROM_ISR();
-#else
- portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
-#endif
-
- return res != 0;
- }
-}
-
-static inline bool osal_semaphore_wait (osal_semaphore_t sem_hdl, uint32_t msec)
-{
- uint32_t const ticks = (msec == OSAL_TIMEOUT_WAIT_FOREVER) ? portMAX_DELAY : pdMS_TO_TICKS(msec);
- return xSemaphoreTake(sem_hdl, ticks);
-}
-
-static inline void osal_semaphore_reset(osal_semaphore_t const sem_hdl)
-{
- xQueueReset(sem_hdl);
-}
-
-//--------------------------------------------------------------------+
-// MUTEX API (priority inheritance)
-//--------------------------------------------------------------------+
-typedef StaticSemaphore_t osal_mutex_def_t;
-typedef SemaphoreHandle_t osal_mutex_t;
-
-static inline osal_mutex_t osal_mutex_create(osal_mutex_def_t* mdef)
-{
- return xSemaphoreCreateMutexStatic(mdef);
-}
-
-static inline bool osal_mutex_lock (osal_mutex_t mutex_hdl, uint32_t msec)
-{
- return osal_semaphore_wait(mutex_hdl, msec);
-}
-
-static inline bool osal_mutex_unlock(osal_mutex_t mutex_hdl)
-{
- return xSemaphoreGive(mutex_hdl);
-}
-
-//--------------------------------------------------------------------+
-// QUEUE API
-//--------------------------------------------------------------------+
-
-// role device/host is used by OS NONE for mutex (disable usb isr) only
-#define OSAL_QUEUE_DEF(_role, _name, _depth, _type) \
- static _type _name##_##buf[_depth];\
- osal_queue_def_t _name = { .depth = _depth, .item_sz = sizeof(_type), .buf = _name##_##buf };
-
-typedef struct
-{
- uint16_t depth;
- uint16_t item_sz;
- void* buf;
-
- StaticQueue_t sq;
-}osal_queue_def_t;
-
-typedef QueueHandle_t osal_queue_t;
-
-static inline osal_queue_t osal_queue_create(osal_queue_def_t* qdef)
-{
- return xQueueCreateStatic(qdef->depth, qdef->item_sz, (uint8_t*) qdef->buf, &qdef->sq);
-}
-
-static inline bool osal_queue_receive(osal_queue_t qhdl, void* data)
-{
- return xQueueReceive(qhdl, data, portMAX_DELAY);
-}
-
-static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr)
-{
- if ( !in_isr )
- {
- return xQueueSendToBack(qhdl, data, OSAL_TIMEOUT_WAIT_FOREVER) != 0;
- }
- else
- {
- BaseType_t xHigherPriorityTaskWoken;
- BaseType_t res = xQueueSendToBackFromISR(qhdl, data, &xHigherPriorityTaskWoken);
-
-#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
- if ( xHigherPriorityTaskWoken ) portYIELD_FROM_ISR();
-#else
- portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
-#endif
-
- return res != 0;
- }
-}
-
-static inline bool osal_queue_empty(osal_queue_t qhdl)
-{
- return uxQueueMessagesWaiting(qhdl) == 0;
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_OSAL_FREERTOS_H_ */
diff --git a/tinyusb/src/osal/osal_mynewt.h b/tinyusb/src/osal/osal_mynewt.h
deleted file mode 100755
index 6882329c..00000000
--- a/tinyusb/src/osal/osal_mynewt.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef OSAL_MYNEWT_H_
-#define OSAL_MYNEWT_H_
-
-#include "os/os.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// TASK API
-//--------------------------------------------------------------------+
-static inline void osal_task_delay(uint32_t msec)
-{
- os_time_delay( os_time_ms_to_ticks32(msec) );
-}
-
-//--------------------------------------------------------------------+
-// Semaphore API
-//--------------------------------------------------------------------+
-typedef struct os_sem osal_semaphore_def_t;
-typedef struct os_sem* osal_semaphore_t;
-
-static inline osal_semaphore_t osal_semaphore_create(osal_semaphore_def_t* semdef)
-{
- return (os_sem_init(semdef, 0) == OS_OK) ? (osal_semaphore_t) semdef : NULL;
-}
-
-static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr)
-{
- (void) in_isr;
- return os_sem_release(sem_hdl) == OS_OK;
-}
-
-static inline bool osal_semaphore_wait(osal_semaphore_t sem_hdl, uint32_t msec)
-{
- uint32_t const ticks = (msec == OSAL_TIMEOUT_WAIT_FOREVER) ? OS_TIMEOUT_NEVER : os_time_ms_to_ticks32(msec);
- return os_sem_pend(sem_hdl, ticks) == OS_OK;
-}
-
-static inline void osal_semaphore_reset(osal_semaphore_t sem_hdl)
-{
- // TODO implement later
-}
-
-//--------------------------------------------------------------------+
-// MUTEX API (priority inheritance)
-//--------------------------------------------------------------------+
-typedef struct os_mutex osal_mutex_def_t;
-typedef struct os_mutex* osal_mutex_t;
-
-static inline osal_mutex_t osal_mutex_create(osal_mutex_def_t* mdef)
-{
- return (os_mutex_init(mdef) == OS_OK) ? (osal_mutex_t) mdef : NULL;
-}
-
-static inline bool osal_mutex_lock(osal_mutex_t mutex_hdl, uint32_t msec)
-{
- uint32_t const ticks = (msec == OSAL_TIMEOUT_WAIT_FOREVER) ? OS_TIMEOUT_NEVER : os_time_ms_to_ticks32(msec);
- return os_mutex_pend(mutex_hdl, ticks) == OS_OK;
-}
-
-static inline bool osal_mutex_unlock(osal_mutex_t mutex_hdl)
-{
- return os_mutex_release(mutex_hdl) == OS_OK;
-}
-
-//--------------------------------------------------------------------+
-// QUEUE API
-//--------------------------------------------------------------------+
-
-// role device/host is used by OS NONE for mutex (disable usb isr) only
-#define OSAL_QUEUE_DEF(_role, _name, _depth, _type) \
- static _type _name##_##buf[_depth];\
- static struct os_event _name##_##evbuf[_depth];\
- osal_queue_def_t _name = { .depth = _depth, .item_sz = sizeof(_type), .buf = _name##_##buf, .evbuf = _name##_##evbuf};\
-
-typedef struct
-{
- uint16_t depth;
- uint16_t item_sz;
- void* buf;
- void* evbuf;
-
- struct os_mempool mpool;
- struct os_mempool epool;
-
- struct os_eventq evq;
-}osal_queue_def_t;
-
-typedef osal_queue_def_t* osal_queue_t;
-
-static inline osal_queue_t osal_queue_create(osal_queue_def_t* qdef)
-{
- if ( OS_OK != os_mempool_init(&qdef->mpool, qdef->depth, qdef->item_sz, qdef->buf, "usbd queue") ) return NULL;
- if ( OS_OK != os_mempool_init(&qdef->epool, qdef->depth, sizeof(struct os_event), qdef->evbuf, "usbd evqueue") ) return NULL;
-
- os_eventq_init(&qdef->evq);
- return (osal_queue_t) qdef;
-}
-
-static inline bool osal_queue_receive(osal_queue_t qhdl, void* data)
-{
- struct os_event* ev;
- ev = os_eventq_get(&qhdl->evq);
-
- memcpy(data, ev->ev_arg, qhdl->item_sz); // copy message
- os_memblock_put(&qhdl->mpool, ev->ev_arg); // put back mem block
- os_memblock_put(&qhdl->epool, ev); // put back ev block
-
- return true;
-}
-
-static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr)
-{
- (void) in_isr;
-
- // get a block from mem pool for data
- void* ptr = os_memblock_get(&qhdl->mpool);
- if (!ptr) return false;
- memcpy(ptr, data, qhdl->item_sz);
-
- // get a block from event pool to put into queue
- struct os_event* ev = (struct os_event*) os_memblock_get(&qhdl->epool);
- if (!ev)
- {
- os_memblock_put(&qhdl->mpool, ptr);
- return false;
- }
- tu_memclr(ev, sizeof(struct os_event));
- ev->ev_arg = ptr;
-
- os_eventq_put(&qhdl->evq, ev);
-
- return true;
-}
-
-static inline bool osal_queue_empty(osal_queue_t qhdl)
-{
- return STAILQ_EMPTY(&qhdl->evq.evq_list);
-}
-
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* OSAL_MYNEWT_H_ */
diff --git a/tinyusb/src/osal/osal_none.h b/tinyusb/src/osal/osal_none.h
deleted file mode 100755
index a1f997cf..00000000
--- a/tinyusb/src/osal/osal_none.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_OSAL_NONE_H_
-#define _TUSB_OSAL_NONE_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// TASK API
-//--------------------------------------------------------------------+
-
-
-//--------------------------------------------------------------------+
-// Binary Semaphore API
-//--------------------------------------------------------------------+
-typedef struct
-{
- volatile uint16_t count;
-}osal_semaphore_def_t;
-
-typedef osal_semaphore_def_t* osal_semaphore_t;
-
-static inline osal_semaphore_t osal_semaphore_create(osal_semaphore_def_t* semdef)
-{
- semdef->count = 0;
- return semdef;
-}
-
-static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr)
-{
- (void) in_isr;
- sem_hdl->count++;
- return true;
-}
-
-// TODO blocking for now
-static inline bool osal_semaphore_wait (osal_semaphore_t sem_hdl, uint32_t msec)
-{
- (void) msec;
-
- while (sem_hdl->count == 0) { }
- sem_hdl->count--;
-
- return true;
-}
-
-static inline void osal_semaphore_reset(osal_semaphore_t sem_hdl)
-{
- sem_hdl->count = 0;
-}
-
-//--------------------------------------------------------------------+
-// MUTEX API
-// Within tinyusb, mutex is never used in ISR context
-//--------------------------------------------------------------------+
-typedef osal_semaphore_def_t osal_mutex_def_t;
-typedef osal_semaphore_t osal_mutex_t;
-
-static inline osal_mutex_t osal_mutex_create(osal_mutex_def_t* mdef)
-{
- mdef->count = 1;
- return mdef;
-}
-
-static inline bool osal_mutex_lock (osal_mutex_t mutex_hdl, uint32_t msec)
-{
- return osal_semaphore_wait(mutex_hdl, msec);
-}
-
-static inline bool osal_mutex_unlock(osal_mutex_t mutex_hdl)
-{
- return osal_semaphore_post(mutex_hdl, false);
-}
-
-//--------------------------------------------------------------------+
-// QUEUE API
-//--------------------------------------------------------------------+
-#include "common/tusb_fifo.h"
-
-// extern to avoid including dcd.h and hcd.h
-#if TUSB_OPT_DEVICE_ENABLED
-extern void dcd_int_disable(uint8_t rhport);
-extern void dcd_int_enable(uint8_t rhport);
-#endif
-
-#if TUSB_OPT_HOST_ENABLED
-extern void hcd_int_disable(uint8_t rhport);
-extern void hcd_int_enable(uint8_t rhport);
-#endif
-
-typedef struct
-{
- uint8_t role; // device or host
- tu_fifo_t ff;
-}osal_queue_def_t;
-
-typedef osal_queue_def_t* osal_queue_t;
-
-// role device/host is used by OS NONE for mutex (disable usb isr) only
-#define OSAL_QUEUE_DEF(_role, _name, _depth, _type) \
- uint8_t _name##_buf[_depth*sizeof(_type)]; \
- osal_queue_def_t _name = { \
- .role = _role, \
- .ff = TU_FIFO_INIT(_name##_buf, _depth, _type, false) \
- }
-
-// lock queue by disable USB interrupt
-static inline void _osal_q_lock(osal_queue_t qhdl)
-{
- (void) qhdl;
-
-#if TUSB_OPT_DEVICE_ENABLED
- if (qhdl->role == OPT_MODE_DEVICE) dcd_int_disable(TUD_OPT_RHPORT);
-#endif
-
-#if TUSB_OPT_HOST_ENABLED
- if (qhdl->role == OPT_MODE_HOST) hcd_int_disable(TUH_OPT_RHPORT);
-#endif
-}
-
-// unlock queue
-static inline void _osal_q_unlock(osal_queue_t qhdl)
-{
- (void) qhdl;
-
-#if TUSB_OPT_DEVICE_ENABLED
- if (qhdl->role == OPT_MODE_DEVICE) dcd_int_enable(TUD_OPT_RHPORT);
-#endif
-
-#if TUSB_OPT_HOST_ENABLED
- if (qhdl->role == OPT_MODE_HOST) hcd_int_enable(TUH_OPT_RHPORT);
-#endif
-}
-
-static inline osal_queue_t osal_queue_create(osal_queue_def_t* qdef)
-{
- tu_fifo_clear(&qdef->ff);
- return (osal_queue_t) qdef;
-}
-
-static inline bool osal_queue_receive(osal_queue_t qhdl, void* data)
-{
- _osal_q_lock(qhdl);
- bool success = tu_fifo_read(&qhdl->ff, data);
- _osal_q_unlock(qhdl);
-
- return success;
-}
-
-static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr)
-{
- if (!in_isr) {
- _osal_q_lock(qhdl);
- }
-
- bool success = tu_fifo_write(&qhdl->ff, data);
-
- if (!in_isr) {
- _osal_q_unlock(qhdl);
- }
-
- TU_ASSERT(success);
-
- return success;
-}
-
-static inline bool osal_queue_empty(osal_queue_t qhdl)
-{
- // Skip queue lock/unlock since this function is primarily called
- // with interrupt disabled before going into low power mode
- return tu_fifo_empty(&qhdl->ff);
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_OSAL_NONE_H_ */
diff --git a/tinyusb/src/osal/osal_pico.h b/tinyusb/src/osal/osal_pico.h
deleted file mode 100755
index 1c3366e0..00000000
--- a/tinyusb/src/osal/osal_pico.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_OSAL_PICO_H_
-#define _TUSB_OSAL_PICO_H_
-
-#include "pico/time.h"
-#include "pico/sem.h"
-#include "pico/mutex.h"
-#include "pico/critical_section.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// TASK API
-//--------------------------------------------------------------------+
-static inline void osal_task_delay(uint32_t msec)
-{
- sleep_ms(msec);
-}
-
-//--------------------------------------------------------------------+
-// Binary Semaphore API
-//--------------------------------------------------------------------+
-typedef struct semaphore osal_semaphore_def_t, *osal_semaphore_t;
-
-static inline osal_semaphore_t osal_semaphore_create(osal_semaphore_def_t* semdef)
-{
- sem_init(semdef, 0, 255);
- return semdef;
-}
-
-static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr)
-{
- (void) in_isr;
- sem_release(sem_hdl);
- return true;
-}
-
-static inline bool osal_semaphore_wait (osal_semaphore_t sem_hdl, uint32_t msec)
-{
- return sem_acquire_timeout_ms(sem_hdl, msec);
-}
-
-static inline void osal_semaphore_reset(osal_semaphore_t sem_hdl)
-{
- sem_reset(sem_hdl, 0);
-}
-
-//--------------------------------------------------------------------+
-// MUTEX API
-// Within tinyusb, mutex is never used in ISR context
-//--------------------------------------------------------------------+
-typedef struct mutex osal_mutex_def_t, *osal_mutex_t;
-
-static inline osal_mutex_t osal_mutex_create(osal_mutex_def_t* mdef)
-{
- mutex_init(mdef);
- return mdef;
-}
-
-static inline bool osal_mutex_lock (osal_mutex_t mutex_hdl, uint32_t msec)
-{
- return mutex_enter_timeout_ms(mutex_hdl, msec);
-}
-
-static inline bool osal_mutex_unlock(osal_mutex_t mutex_hdl)
-{
- mutex_exit(mutex_hdl);
- return true;
-}
-
-//--------------------------------------------------------------------+
-// QUEUE API
-//--------------------------------------------------------------------+
-#include "common/tusb_fifo.h"
-
-#if TUSB_OPT_HOST_ENABLED
-extern void hcd_int_disable(uint8_t rhport);
-extern void hcd_int_enable(uint8_t rhport);
-#endif
-
-typedef struct
-{
- tu_fifo_t ff;
- struct critical_section critsec; // osal_queue may be used in IRQs, so need critical section
-} osal_queue_def_t;
-
-typedef osal_queue_def_t* osal_queue_t;
-
-// role device/host is used by OS NONE for mutex (disable usb isr) only
-#define OSAL_QUEUE_DEF(_role, _name, _depth, _type) \
- uint8_t _name##_buf[_depth*sizeof(_type)]; \
- osal_queue_def_t _name = { \
- .ff = TU_FIFO_INIT(_name##_buf, _depth, _type, false) \
- }
-
-// lock queue by disable USB interrupt
-static inline void _osal_q_lock(osal_queue_t qhdl)
-{
- critical_section_enter_blocking(&qhdl->critsec);
-}
-
-// unlock queue
-static inline void _osal_q_unlock(osal_queue_t qhdl)
-{
- critical_section_exit(&qhdl->critsec);
-}
-
-static inline osal_queue_t osal_queue_create(osal_queue_def_t* qdef)
-{
- critical_section_init(&qdef->critsec);
- tu_fifo_clear(&qdef->ff);
- return (osal_queue_t) qdef;
-}
-
-static inline bool osal_queue_receive(osal_queue_t qhdl, void* data)
-{
- // TODO: revisit... docs say that mutexes are never used from IRQ context,
- // however osal_queue_recieve may be. therefore my assumption is that
- // the fifo mutex is not populated for queues used from an IRQ context
- //assert(!qhdl->ff.mutex);
-
- _osal_q_lock(qhdl);
- bool success = tu_fifo_read(&qhdl->ff, data);
- _osal_q_unlock(qhdl);
-
- return success;
-}
-
-static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr)
-{
- // TODO: revisit... docs say that mutexes are never used from IRQ context,
- // however osal_queue_recieve may be. therefore my assumption is that
- // the fifo mutex is not populated for queues used from an IRQ context
- //assert(!qhdl->ff.mutex);
- (void) in_isr;
-
- _osal_q_lock(qhdl);
- bool success = tu_fifo_write(&qhdl->ff, data);
- _osal_q_unlock(qhdl);
-
- TU_ASSERT(success);
-
- return success;
-}
-
-static inline bool osal_queue_empty(osal_queue_t qhdl)
-{
- // TODO: revisit; whether this is true or not currently, tu_fifo_empty is a single
- // volatile read.
-
- // Skip queue lock/unlock since this function is primarily called
- // with interrupt disabled before going into low power mode
- return tu_fifo_empty(&qhdl->ff);
-}
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_OSAL_PICO_H_ */
diff --git a/tinyusb/src/osal/osal_rtthread.h b/tinyusb/src/osal/osal_rtthread.h
deleted file mode 100755
index d5c062ac..00000000
--- a/tinyusb/src/osal/osal_rtthread.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 tfx2001 (2479727366@qq.com)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_OSAL_RTTHREAD_H_
-#define _TUSB_OSAL_RTTHREAD_H_
-
-// RT-Thread Headers
-#include "rtthread.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// TASK API
-//--------------------------------------------------------------------+
-static inline void osal_task_delay(uint32_t msec) {
- rt_thread_mdelay(msec);
-}
-
-//--------------------------------------------------------------------+
-// Semaphore API
-//--------------------------------------------------------------------+
-typedef struct rt_semaphore osal_semaphore_def_t;
-typedef rt_sem_t osal_semaphore_t;
-
-static inline osal_semaphore_t
-osal_semaphore_create(osal_semaphore_def_t *semdef) {
- rt_sem_init(semdef, "tusb", 0, RT_IPC_FLAG_FIFO);
- return semdef;
-}
-
-static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr) {
- (void) in_isr;
- return rt_sem_release(sem_hdl) == RT_EOK;
-}
-
-static inline bool osal_semaphore_wait(osal_semaphore_t sem_hdl, uint32_t msec) {
- return rt_sem_take(sem_hdl, rt_tick_from_millisecond(msec)) == RT_EOK;
-}
-
-static inline void osal_semaphore_reset(osal_semaphore_t const sem_hdl) {
- // TODO: implement
-}
-
-//--------------------------------------------------------------------+
-// MUTEX API (priority inheritance)
-//--------------------------------------------------------------------+
-typedef struct rt_mutex osal_mutex_def_t;
-typedef rt_mutex_t osal_mutex_t;
-
-static inline osal_mutex_t osal_mutex_create(osal_mutex_def_t *mdef) {
- rt_mutex_init(mdef, "tusb", RT_IPC_FLAG_FIFO);
- return mdef;
-}
-
-static inline bool osal_mutex_lock(osal_mutex_t mutex_hdl, uint32_t msec) {
- return rt_mutex_take(mutex_hdl, rt_tick_from_millisecond(msec)) == RT_EOK;
-}
-
-static inline bool osal_mutex_unlock(osal_mutex_t mutex_hdl) {
- return rt_mutex_release(mutex_hdl) == RT_EOK;
-}
-
-//--------------------------------------------------------------------+
-// QUEUE API
-//--------------------------------------------------------------------+
-
-// role device/host is used by OS NONE for mutex (disable usb isr) only
-#define OSAL_QUEUE_DEF(_role, _name, _depth, _type) \
- static _type _name##_##buf[_depth]; \
- osal_queue_def_t _name = { .depth = _depth, .item_sz = sizeof(_type), .buf = _name##_##buf };
-
-typedef struct {
- uint16_t depth;
- uint16_t item_sz;
- void *buf;
-
- struct rt_messagequeue sq;
-} osal_queue_def_t;
-
-typedef rt_mq_t osal_queue_t;
-
-static inline osal_queue_t osal_queue_create(osal_queue_def_t *qdef) {
- rt_mq_init(&(qdef->sq), "tusb", qdef->buf, qdef->item_sz,
- qdef->item_sz * qdef->depth, RT_IPC_FLAG_FIFO);
- return &(qdef->sq);
-}
-
-static inline bool osal_queue_receive(osal_queue_t qhdl, void *data) {
- return rt_mq_recv(qhdl, data, qhdl->msg_size, RT_WAITING_FOREVER) == RT_EOK;
-}
-
-static inline bool osal_queue_send(osal_queue_t qhdl, void const *data, bool in_isr) {
- (void) in_isr;
- return rt_mq_send(qhdl, (void *)data, qhdl->msg_size) == RT_EOK;
-}
-
-static inline bool osal_queue_empty(osal_queue_t qhdl) {
- return (qhdl->entry) == 0;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TUSB_OSAL_RTTHREAD_H_ */
diff --git a/tinyusb/src/portable/dialog/da146xx/dcd_da146xx.c b/tinyusb/src/portable/dialog/da146xx/dcd_da146xx.c
deleted file mode 100755
index 5fcf3bc5..00000000
--- a/tinyusb/src/portable/dialog/da146xx/dcd_da146xx.c
+++ /dev/null
@@ -1,1067 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Jerzy Kasenberg
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_DA1469X
-
-#include "mcu/mcu.h"
-
-#include "device/dcd.h"
-
-/*------------------------------------------------------------------*/
-/* MACRO TYPEDEF CONSTANT ENUM
- *------------------------------------------------------------------*/
-
-// Since TinyUSB doesn't use SOF for now, and this interrupt too often (1ms interval)
-// We disable SOF for now until needed later on
-#define USE_SOF 0
-
-// Size of RX or TX FIFO.
-#define FIFO_SIZE 64
-
-#ifndef TU_DA1469X_FIFO_READ_THRESHOLD
-// RX FIFO is 64 bytes. When endpoint size is greater then 64, FIFO warning interrupt
-// is enabled to allow read incoming data during frame reception.
-// It is possible to stay in interrupt reading whole packet at once, but it may be
-// more efficient for MCU to read as much data as possible and when FIFO is hardly
-// filled exit interrupt handler waiting for next FIFO warning level interrupt
-// or packet end.
-// When running at 96MHz code that reads FIFO based on number of bytes stored in
-// USB_RXSx_REG.USB_RXCOUNT takes enough time to fill FIFO with two additional bytes.
-// Settings this threshold above this allows to leave interrupt handler and wait
-// for more bytes to before next ISR. This allows reduce overall ISR time to 1/3
-// of time that would be needed if ISR read as fast as possible.
-#define TU_DA1469X_FIFO_READ_THRESHOLD 4
-#endif
-
-#define EP_MAX 4
-
-#define NFSR_NODE_RESET 0
-#define NFSR_NODE_RESUME 1
-#define NFSR_NODE_OPERATIONAL 2
-#define NFSR_NODE_SUSPEND 3
-
-static TU_ATTR_ALIGNED(4) uint8_t _setup_packet[8];
-
-typedef struct
-{
- union
- {
- __IOM uint32_t epc_in;
- __IOM uint32_t USB_EPC0_REG; /*!< (@ 0x00000080) Endpoint Control 0 Register */
- __IOM uint32_t USB_EPC1_REG; /*!< (@ 0x000000A0) Endpoint Control Register 1 */
- __IOM uint32_t USB_EPC3_REG; /*!< (@ 0x000000C0) Endpoint Control Register 3 */
- __IOM uint32_t USB_EPC5_REG; /*!< (@ 0x000000E0) Endpoint Control Register 5 */
- };
- union
- {
- __IOM uint32_t txd;
- __IOM uint32_t USB_TXD0_REG; /*!< (@ 0x00000084) Transmit Data 0 Register */
- __IOM uint32_t USB_TXD1_REG; /*!< (@ 0x000000A4) Transmit Data Register 1 */
- __IOM uint32_t USB_TXD2_REG; /*!< (@ 0x000000C4) Transmit Data Register 2 */
- __IOM uint32_t USB_TXD3_REG; /*!< (@ 0x000000E4) Transmit Data Register 3 */
- };
- union
- {
- __IOM uint32_t txs;
- __IOM uint32_t USB_TXS0_REG; /*!< (@ 0x00000088) Transmit Status 0 Register */
- __IOM uint32_t USB_TXS1_REG; /*!< (@ 0x000000A8) Transmit Status Register 1 */
- __IOM uint32_t USB_TXS2_REG; /*!< (@ 0x000000C8) Transmit Status Register 2 */
- __IOM uint32_t USB_TXS3_REG; /*!< (@ 0x000000E8) Transmit Status Register 3 */
- };
- union
- {
- __IOM uint32_t txc;
- __IOM uint32_t USB_TXC0_REG; /*!< (@ 0x0000008C) Transmit command 0 Register */
- __IOM uint32_t USB_TXC1_REG; /*!< (@ 0x000000AC) Transmit Command Register 1 */
- __IOM uint32_t USB_TXC2_REG; /*!< (@ 0x000000CC) Transmit Command Register 2 */
- __IOM uint32_t USB_TXC3_REG; /*!< (@ 0x000000EC) Transmit Command Register 3 */
- };
- union
- {
- __IOM uint32_t epc_out;
- __IOM uint32_t USB_EP0_NAK_REG; /*!< (@ 0x00000090) EP0 INNAK and OUTNAK Register */
- __IOM uint32_t USB_EPC2_REG; /*!< (@ 0x000000B0) Endpoint Control Register 2 */
- __IOM uint32_t USB_EPC4_REG; /*!< (@ 0x000000D0) Endpoint Control Register 4 */
- __IOM uint32_t USB_EPC6_REG; /*!< (@ 0x000000F0) Endpoint Control Register 6 */
- };
- union
- {
- __IOM uint32_t rxd;
- __IOM uint32_t USB_RXD0_REG; /*!< (@ 0x00000094) Receive Data 0 Register */
- __IOM uint32_t USB_RXD1_REG; /*!< (@ 0x000000B4) Receive Data Register,1 */
- __IOM uint32_t USB_RXD2_REG; /*!< (@ 0x000000D4) Receive Data Register 2 */
- __IOM uint32_t USB_RXD3_REG; /*!< (@ 0x000000F4) Receive Data Register 3 */
- };
- union
- {
- __IOM uint32_t rxs;
- __IOM uint32_t USB_RXS0_REG; /*!< (@ 0x00000098) Receive Status 0 Register */
- __IOM uint32_t USB_RXS1_REG; /*!< (@ 0x000000B8) Receive Status Register 1 */
- __IOM uint32_t USB_RXS2_REG; /*!< (@ 0x000000D8) Receive Status Register 2 */
- __IOM uint32_t USB_RXS3_REG; /*!< (@ 0x000000F8) Receive Status Register 3 */
- };
- union
- {
- __IOM uint32_t rxc;
- __IOM uint32_t USB_RXC0_REG; /*!< (@ 0x0000009C) Receive Command 0 Register */
- __IOM uint32_t USB_RXC1_REG; /*!< (@ 0x000000BC) Receive Command Register 1 */
- __IOM uint32_t USB_RXC2_REG; /*!< (@ 0x000000DC) Receive Command Register 2 */
- __IOM uint32_t USB_RXC3_REG; /*!< (@ 0x000000FC) Receive Command Register 3 */
- };
-} EPx_REGS;
-
-#define EP_REGS(first_ep_reg) (EPx_REGS*)(&USB->first_ep_reg)
-
-// DMA channel pair to use, channel 6 will be used for RX channel 7 for TX direction.
-#ifndef TU_DA146XX_DMA_RX_CHANNEL
-#define TU_DA146XX_DMA_RX_CHANNEL 6
-#endif
-#define DA146XX_DMA_USB_MUX (0x6 << (TU_DA146XX_DMA_RX_CHANNEL * 2))
-#define DA146XX_DMA_USB_MUX_MASK (0xF << (TU_DA146XX_DMA_RX_CHANNEL * 2))
-
-typedef struct
-{
- __IOM uint32_t DMAx_A_START_REG;
- __IOM uint32_t DMAx_B_START_REG;
- __IOM uint32_t DMAx_INT_REG;
- __IOM uint32_t DMAx_LEN_REG;
- __IOM uint32_t DMAx_CTRL_REG;
- __IOM uint32_t DMAx_IDX_REG;
- __IM uint32_t RESERVED[2]; // Extend structure size for array like usage, registers for each channel are 0x20 bytes apart.
-} da146xx_dma_channel_t;
-
-#define DMA_CHANNEL_REGS(n) ((da146xx_dma_channel_t *)(DMA) + n)
-#define RX_DMA_REGS DMA_CHANNEL_REGS(TU_DA146XX_DMA_RX_CHANNEL)
-#define TX_DMA_REGS DMA_CHANNEL_REGS((TU_DA146XX_DMA_RX_CHANNEL) + 1)
-
-#define RX_DMA_START ((1 << DMA_DMA0_CTRL_REG_DMA_ON_Pos) |\
- (0 << DMA_DMA0_CTRL_REG_BW_Pos) | \
- (1 << DMA_DMA0_CTRL_REG_DREQ_MODE_Pos) | \
- (1 << DMA_DMA0_CTRL_REG_BINC_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_AINC_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_CIRCULAR_Pos) | \
- (2 << DMA_DMA0_CTRL_REG_DMA_PRIO_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_DMA_IDLE_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_DMA_INIT_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_REQ_SENSE_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_BURST_MODE_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_BUS_ERROR_DETECT_Pos))
-
-#define TX_DMA_START ((1 << DMA_DMA0_CTRL_REG_DMA_ON_Pos) |\
- (0 << DMA_DMA0_CTRL_REG_BW_Pos) | \
- (1 << DMA_DMA0_CTRL_REG_DREQ_MODE_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_BINC_Pos) | \
- (1 << DMA_DMA0_CTRL_REG_AINC_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_CIRCULAR_Pos) | \
- (2 << DMA_DMA0_CTRL_REG_DMA_PRIO_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_DMA_IDLE_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_DMA_INIT_Pos) | \
- (1 << DMA_DMA0_CTRL_REG_REQ_SENSE_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_BURST_MODE_Pos) | \
- (0 << DMA_DMA0_CTRL_REG_BUS_ERROR_DETECT_Pos))
-
-// Dialog register fields and bit mask are very long. Filed masks repeat register names.
-// Those convenience macros are a way to reduce complexity of register modification lines.
-#define GET_BIT(val, field) (val & field ## _Msk) >> field ## _Pos
-#define REG_GET_BIT(reg, field) (USB->reg & USB_ ## reg ## _ ## field ## _Msk)
-#define REG_SET_BIT(reg, field) USB->reg |= USB_ ## reg ## _ ## field ## _Msk
-#define REG_CLR_BIT(reg, field) USB->reg &= ~USB_ ## reg ## _ ## field ## _Msk
-#define REG_SET_VAL(reg, field, val) USB->reg = (USB->reg & ~USB_ ## reg ## _ ## field ## _Msk) | (val << USB_ ## reg ## _ ## field ## _Pos)
-
-typedef struct {
- EPx_REGS * regs;
- uint8_t * buffer;
- // Total length of current transfer
- uint16_t total_len;
- // Bytes transferred so far
- uint16_t transferred;
- uint16_t max_packet_size;
- // Packet size sent or received so far. It is used to modify transferred field
- // after ACK is received or when filling ISO endpoint with size larger then
- // FIFO size.
- uint16_t last_packet_size;
- uint8_t ep_addr;
- // DATA0/1 toggle bit 1 DATA1 is expected or transmitted
- uint8_t data1 : 1;
- // Endpoint is stalled
- uint8_t stall : 1;
- // ISO endpoint
- uint8_t iso : 1;
-} xfer_ctl_t;
-
-static struct
-{
- bool vbus_present;
- bool in_reset;
- xfer_ctl_t xfer_status[EP_MAX][2];
- // Endpoints that use DMA, one for each direction
- uint8_t dma_ep[2];
-} _dcd =
-{
- .vbus_present = false,
- .xfer_status =
- {
- { { .regs = EP_REGS(USB_EPC0_REG) }, { .regs = EP_REGS(USB_EPC0_REG) } },
- { { .regs = EP_REGS(USB_EPC1_REG) }, { .regs = EP_REGS(USB_EPC1_REG) } },
- { { .regs = EP_REGS(USB_EPC3_REG) }, { .regs = EP_REGS(USB_EPC3_REG) } },
- { { .regs = EP_REGS(USB_EPC5_REG) }, { .regs = EP_REGS(USB_EPC5_REG) } },
- }
-};
-
-// Two endpoint 0 descriptor definition for unified dcd_edpt_open()
-static const tusb_desc_endpoint_t ep0OUT_desc =
-{
- .bLength = sizeof(tusb_desc_endpoint_t),
- .bDescriptorType = TUSB_DESC_ENDPOINT,
-
- .bEndpointAddress = 0x00,
- .bmAttributes = { .xfer = TUSB_XFER_CONTROL },
- .wMaxPacketSize = { .size = CFG_TUD_ENDPOINT0_SIZE },
- .bInterval = 0
-};
-
-static const tusb_desc_endpoint_t ep0IN_desc =
-{
- .bLength = sizeof(tusb_desc_endpoint_t),
- .bDescriptorType = TUSB_DESC_ENDPOINT,
-
- .bEndpointAddress = 0x80,
- .bmAttributes = { .xfer = TUSB_XFER_CONTROL },
- .wMaxPacketSize = { .size = CFG_TUD_ENDPOINT0_SIZE },
- .bInterval = 0
-};
-
-#define XFER_CTL_BASE(_ep, _dir) &_dcd.xfer_status[_ep][_dir]
-
-static void fill_tx_fifo(xfer_ctl_t * xfer)
-{
- int left_to_send;
- uint8_t const *src;
- EPx_REGS *regs = xfer->regs;
- uint8_t const epnum = tu_edpt_number(xfer->ep_addr);
-
- src = &xfer->buffer[xfer->transferred];
- left_to_send = xfer->total_len - xfer->transferred;
- if (left_to_send > xfer->max_packet_size - xfer->last_packet_size)
- {
- left_to_send = xfer->max_packet_size - xfer->last_packet_size;
- }
-
- // Loop checks TCOUNT all the time since this value is saturated to 31
- // and can't be read just once before.
- while ((regs->txs & USB_USB_TXS1_REG_USB_TCOUNT_Msk) > 0 && left_to_send > 0)
- {
- regs->txd = *src++;
- xfer->last_packet_size++;
- left_to_send--;
- }
- if (epnum != 0)
- {
- if (left_to_send > 0)
- {
- // Max packet size is set to value greater then FIFO. Enable fifo level warning
- // to handle larger packets.
- regs->txc |= (3 << USB_USB_TXC1_REG_USB_TFWL_Pos);
- USB->USB_FWMSK_REG |= 1 << (epnum - 1 + USB_USB_FWMSK_REG_USB_M_TXWARN31_Pos);
- }
- else
- {
- xfer->regs->txc &= ~USB_USB_TXC1_REG_USB_TFWL_Msk;
- USB->USB_FWMSK_REG &= ~(1 << (epnum - 1 + USB_USB_FWMSK_REG_USB_M_TXWARN31_Pos));
- // Whole packet already in fifo, no need to refill it later. Mark last.
- regs->txc |= USB_USB_TXC1_REG_USB_LAST_Msk;
- }
- }
-}
-
-static bool try_allocate_dma(uint8_t epnum, uint8_t dir)
-{
- // TODO: Disable interrupts while checking
- if (_dcd.dma_ep[dir] == 0)
- {
- _dcd.dma_ep[dir] = epnum;
- if (dir == TUSB_DIR_OUT)
- USB->USB_DMA_CTRL_REG = (USB->USB_DMA_CTRL_REG & ~USB_USB_DMA_CTRL_REG_USB_DMA_RX_Msk) |
- ((epnum - 1) << USB_USB_DMA_CTRL_REG_USB_DMA_RX_Pos);
- else
- USB->USB_DMA_CTRL_REG = (USB->USB_DMA_CTRL_REG & ~USB_USB_DMA_CTRL_REG_USB_DMA_TX_Msk) |
- ((epnum - 1) << USB_USB_DMA_CTRL_REG_USB_DMA_TX_Pos);
- USB->USB_DMA_CTRL_REG |= USB_USB_DMA_CTRL_REG_USB_DMA_EN_Msk;
- }
- return _dcd.dma_ep[dir] == epnum;
-}
-
-static void start_rx_dma(volatile void *src, void *dst, uint16_t size)
-{
- // Setup SRC and DST registers
- RX_DMA_REGS->DMAx_A_START_REG = (uint32_t)src;
- RX_DMA_REGS->DMAx_B_START_REG = (uint32_t)dst;
- // Don't need DMA interrupt, read end is determined by RX_LAST or RX_ERR events.
- RX_DMA_REGS->DMAx_INT_REG = size - 1;
- RX_DMA_REGS->DMAx_LEN_REG = size - 1;
- RX_DMA_REGS->DMAx_CTRL_REG = RX_DMA_START;
-}
-
-static void start_rx_packet(xfer_ctl_t *xfer)
-{
- uint8_t const epnum = tu_edpt_number(xfer->ep_addr);
- uint16_t remaining = xfer->total_len - xfer->transferred;
- uint16_t size = tu_min16(remaining, xfer->max_packet_size);
-
- xfer->last_packet_size = 0;
- if (xfer->max_packet_size > FIFO_SIZE && remaining > FIFO_SIZE)
- {
- if (try_allocate_dma(epnum, TUSB_DIR_OUT))
- {
- start_rx_dma(&xfer->regs->rxd, xfer->buffer + xfer->transferred, size);
- }
- else
- {
- // Other endpoint is using DMA in that direction, fall back to interrupts.
- // For endpoint size greater then FIFO size enable FIFO level warning interrupt
- // when FIFO has less then 17 bytes free.
- xfer->regs->rxc |= USB_USB_RXC1_REG_USB_RFWL_Msk;
- USB->USB_FWMSK_REG |= 1 << (epnum - 1 + USB_USB_FWMSK_REG_USB_M_RXWARN31_Pos);
- }
- }
- else if (epnum != 0)
- {
- // If max_packet_size would fit in FIFO no need for FIFO level warning interrupt.
- xfer->regs->rxc &= ~USB_USB_RXC1_REG_USB_RFWL_Msk;
- USB->USB_FWMSK_REG &= ~(1 << (epnum - 1 + USB_USB_FWMSK_REG_USB_M_RXWARN31_Pos));
- }
- xfer->regs->rxc |= USB_USB_RXC1_REG_USB_RX_EN_Msk;
-}
-
-static void start_tx_dma(void *src, volatile void *dst, uint16_t size)
-{
- // Setup SRC and DST registers
- TX_DMA_REGS->DMAx_A_START_REG = (uint32_t)src;
- TX_DMA_REGS->DMAx_B_START_REG = (uint32_t)dst;
- // Interrupt not needed
- TX_DMA_REGS->DMAx_INT_REG = size;
- TX_DMA_REGS->DMAx_LEN_REG = size - 1;
- TX_DMA_REGS->DMAx_CTRL_REG = TX_DMA_START;
-}
-
-static void start_tx_packet(xfer_ctl_t *xfer)
-{
- uint8_t const epnum = tu_edpt_number(xfer->ep_addr);
- uint16_t remaining = xfer->total_len - xfer->transferred;
- uint16_t size = tu_min16(remaining, xfer->max_packet_size);
- EPx_REGS *regs = xfer->regs;
-
- xfer->last_packet_size = 0;
-
- regs->txc = USB_USB_TXC1_REG_USB_FLUSH_Msk;
- regs->txc = USB_USB_TXC1_REG_USB_IGN_ISOMSK_Msk;
- if (xfer->data1) xfer->regs->txc |= USB_USB_TXC1_REG_USB_TOGGLE_TX_Msk;
-
- if (xfer->max_packet_size > FIFO_SIZE && remaining > FIFO_SIZE && try_allocate_dma(epnum, TUSB_DIR_IN))
- {
- // Whole packet will be put in FIFO by DMA. Set LAST bit before start.
- start_tx_dma(xfer->buffer + xfer->transferred, &regs->txd, size);
- regs->txc |= USB_USB_TXC1_REG_USB_LAST_Msk;
- }
- else
- {
- fill_tx_fifo(xfer);
- }
- regs->txc |= USB_USB_TXC1_REG_USB_TX_EN_Msk;
-}
-
-static void read_rx_fifo(xfer_ctl_t *xfer, uint16_t bytes_in_fifo)
-{
- EPx_REGS *regs = xfer->regs;
- uint16_t remaining = xfer->total_len - xfer->transferred - xfer->last_packet_size;
- uint16_t receive_this_time = bytes_in_fifo;
-
- if (remaining < bytes_in_fifo) receive_this_time = remaining;
-
- uint8_t *buf = xfer->buffer + xfer->transferred + xfer->last_packet_size;
-
- for (int i = 0; i < receive_this_time; ++i) buf[i] = regs->rxd;
-
- xfer->last_packet_size += receive_this_time;
-}
-
-static void handle_ep0_rx(void)
-{
- int fifo_bytes;
- uint32_t rxs0 = USB->USB_RXS0_REG;
-
- xfer_ctl_t *xfer = XFER_CTL_BASE(0, TUSB_DIR_OUT);
-
- fifo_bytes = GET_BIT(rxs0, USB_USB_RXS0_REG_USB_RCOUNT);
- if (rxs0 & USB_USB_RXS0_REG_USB_SETUP_Msk)
- {
- xfer_ctl_t *xfer_in = XFER_CTL_BASE(0, TUSB_DIR_IN);
- // Setup packet is in
- for (int i = 0; i < fifo_bytes; ++i) _setup_packet[i] = USB->USB_RXD0_REG;
-
- xfer->stall = 0;
- xfer->data1 = 1;
- xfer_in->stall = 0;
- xfer_in->data1 = 1;
- REG_SET_BIT(USB_TXC0_REG, USB_TOGGLE_TX0);
- REG_CLR_BIT(USB_EPC0_REG, USB_STALL);
- dcd_event_setup_received(0, _setup_packet,true);
- }
- else
- {
- if (GET_BIT(rxs0, USB_USB_RXS0_REG_USB_TOGGLE_RX0) != xfer->data1)
- {
- // Toggle bit does not match discard packet
- REG_SET_BIT(USB_RXC0_REG, USB_FLUSH);
- xfer->last_packet_size = 0;
- }
- else
- {
- read_rx_fifo(xfer, fifo_bytes);
- if (rxs0 & USB_USB_RXS0_REG_USB_RX_LAST_Msk)
- {
- xfer->transferred += xfer->last_packet_size;
- xfer->data1 ^= 1;
-
- if (xfer->total_len == xfer->transferred || xfer->last_packet_size < xfer->max_packet_size)
- {
- dcd_event_xfer_complete(0, 0, xfer->transferred, XFER_RESULT_SUCCESS, true);
- }
- else
- {
- // Re-enable reception
- REG_SET_BIT(USB_RXC0_REG, USB_RX_EN);
- }
- xfer->last_packet_size = 0;
- }
- }
- }
-}
-
-static void handle_ep0_tx(void)
-{
- uint32_t txs0;
- xfer_ctl_t *xfer = XFER_CTL_BASE(0, TUSB_DIR_IN);
- EPx_REGS *regs = xfer->regs;
-
- txs0 = regs->USB_TXS0_REG;
-
- if (GET_BIT(txs0, USB_USB_TXS0_REG_USB_TX_DONE))
- {
- // ACK received
- if (GET_BIT(txs0, USB_USB_TXS0_REG_USB_ACK_STAT))
- {
- xfer->transferred += xfer->last_packet_size;
- xfer->last_packet_size = 0;
- xfer->data1 ^= 1;
- REG_SET_VAL(USB_TXC0_REG, USB_TOGGLE_TX0, xfer->data1);
- if (xfer->transferred == xfer->total_len)
- {
- dcd_event_xfer_complete(0, 0 | TUSB_DIR_IN_MASK, xfer->total_len, XFER_RESULT_SUCCESS, true);
- return;
- }
- }
- else
- {
- // Start from the beginning
- xfer->last_packet_size = 0;
- }
- fill_tx_fifo(xfer);
- }
-}
-
-static void handle_epx_rx_ev(uint8_t ep)
-{
- uint32_t rxs;
- int fifo_bytes;
- xfer_ctl_t *xfer = XFER_CTL_BASE(ep, TUSB_DIR_OUT);
-
- EPx_REGS *regs = xfer->regs;
-
- do
- {
- rxs = regs->rxs;
-
- if (GET_BIT(rxs, USB_USB_RXS1_REG_USB_RX_ERR))
- {
- regs->rxc |= USB_USB_RXC1_REG_USB_FLUSH_Msk;
- xfer->last_packet_size = 0;
- if (_dcd.dma_ep[TUSB_DIR_OUT] == ep)
- {
- // Stop DMA
- RX_DMA_REGS->DMAx_CTRL_REG &= ~DMA_DMA0_CTRL_REG_DMA_ON_Msk;
- // Restart DMA since packet was dropped, all parameters should still work.
- RX_DMA_REGS->DMAx_CTRL_REG |= DMA_DMA0_CTRL_REG_DMA_ON_Msk;
- }
- break;
- }
- else
- {
- if (_dcd.dma_ep[TUSB_DIR_OUT] == ep)
- {
- // Disable DMA and update last_packet_size with what DMA reported.
- RX_DMA_REGS->DMAx_CTRL_REG &= ~DMA_DMA0_CTRL_REG_DMA_ON_Msk;
- xfer->last_packet_size = RX_DMA_REGS->DMAx_IDX_REG;
- // When DMA did not finished (packet was smaller then MPS), DMAx_IDX_REG holds exact number of bytes transmitted.
- // When DMA finished value in DMAx_IDX_REG is one less then actual number of transmitted bytes.
- if (xfer->last_packet_size == RX_DMA_REGS->DMAx_LEN_REG) xfer->last_packet_size++;
- // Release DMA to use by other endpoints.
- _dcd.dma_ep[TUSB_DIR_OUT] = 0;
- }
- fifo_bytes = GET_BIT(rxs, USB_USB_RXS1_REG_USB_RXCOUNT);
- // FIFO maybe empty if DMA read it before or it's final iteration and function already read all that was to read.
- if (fifo_bytes > 0)
- {
- read_rx_fifo(xfer, fifo_bytes);
- }
- if (GET_BIT(rxs, USB_USB_RXS1_REG_USB_RX_LAST))
- {
- if (!xfer->iso && GET_BIT(rxs, USB_USB_RXS1_REG_USB_TOGGLE_RX) != xfer->data1)
- {
- // Toggle bit does not match discard packet
- regs->rxc |= USB_USB_RXC1_REG_USB_FLUSH_Msk;
- }
- else
- {
- xfer->data1 ^= 1;
- xfer->transferred += xfer->last_packet_size;
- if (xfer->total_len == xfer->transferred || xfer->last_packet_size < xfer->max_packet_size || xfer->iso)
- {
- dcd_event_xfer_complete(0, xfer->ep_addr, xfer->transferred, XFER_RESULT_SUCCESS, true);
- }
- else
- {
- // Re-enable reception
- start_rx_packet(xfer);
- }
- }
- xfer->last_packet_size = 0;
- }
- }
- } while (fifo_bytes > TU_DA1469X_FIFO_READ_THRESHOLD);
-}
-
-static void handle_rx_ev(void)
-{
- if (USB->USB_RXEV_REG & 1)
- handle_epx_rx_ev(1);
- if (USB->USB_RXEV_REG & 2)
- handle_epx_rx_ev(2);
- if (USB->USB_RXEV_REG & 4)
- handle_epx_rx_ev(3);
-}
-
-static void handle_epx_tx_ev(xfer_ctl_t *xfer)
-{
- uint8_t const epnum = tu_edpt_number(xfer->ep_addr);
- uint32_t txs;
- EPx_REGS *regs = xfer->regs;
-
- txs = regs->txs;
-
- if (GET_BIT(txs, USB_USB_TXS1_REG_USB_TX_DONE))
- {
- if (_dcd.dma_ep[TUSB_DIR_IN] == epnum)
- {
- // Disable DMA and update last_packet_size with what DMA reported.
- TX_DMA_REGS->DMAx_CTRL_REG &= ~DMA_DMA1_CTRL_REG_DMA_ON_Msk;
- xfer->last_packet_size = TX_DMA_REGS->DMAx_IDX_REG + 1;
- // Release DMA to used by other endpoints.
- _dcd.dma_ep[TUSB_DIR_IN] = 0;
- }
- if (GET_BIT(txs, USB_USB_TXS1_REG_USB_ACK_STAT))
- {
- // ACK received, update transfer state and DATA0/1 bit
- xfer->transferred += xfer->last_packet_size;
- xfer->last_packet_size = 0;
- xfer->data1 ^= 1;
-
- if (xfer->transferred == xfer->total_len)
- {
- dcd_event_xfer_complete(0, xfer->ep_addr, xfer->total_len, XFER_RESULT_SUCCESS, true);
- return;
- }
- }
- }
- if (txs & USB_USB_TXS1_REG_USB_TX_URUN_Msk)
- {
- TU_LOG1("EP %d FIFO underrun\n", epnum);
- }
- // Start next or repeated packet.
- start_tx_packet(xfer);
-}
-
-static void handle_tx_ev(void)
-{
- if (USB->USB_TXEV_REG & 1)
- handle_epx_tx_ev(XFER_CTL_BASE(1, TUSB_DIR_IN));
- if (USB->USB_TXEV_REG & 2)
- handle_epx_tx_ev(XFER_CTL_BASE(2, TUSB_DIR_IN));
- if (USB->USB_TXEV_REG & 4)
- handle_epx_tx_ev(XFER_CTL_BASE(3, TUSB_DIR_IN));
-}
-
-static void handle_bus_reset(void)
-{
- USB->USB_NFSR_REG = 0;
- USB->USB_FAR_REG = 0x80;
- USB->USB_ALTMSK_REG = 0;
- USB->USB_NFSR_REG = NFSR_NODE_RESET;
- USB->USB_TXMSK_REG = 0;
- USB->USB_RXMSK_REG = 0;
- (void)USB->USB_ALTEV_REG;
- _dcd.in_reset = true;
-
- dcd_event_bus_reset(0, TUSB_SPEED_FULL, true);
- USB->USB_DMA_CTRL_REG = 0;
-
- USB->USB_MAMSK_REG = USB_USB_MAMSK_REG_USB_M_INTR_Msk |
-#if USE_SOF
- USB_USB_MAMSK_REG_USB_M_FRAME_Msk |
-#endif
- USB_USB_MAMSK_REG_USB_M_WARN_Msk |
- USB_USB_MAMSK_REG_USB_M_ALT_Msk;
- USB->USB_NFSR_REG = NFSR_NODE_OPERATIONAL;
- USB->USB_ALTMSK_REG = USB_USB_ALTMSK_REG_USB_M_SD3_Msk |
- USB_USB_ALTMSK_REG_USB_M_RESUME_Msk;
- // There is no information about end of reset state
- // USB_FRAME event will be used to enable reset detection again
- REG_SET_BIT(USB_MAEV_REG, USB_FRAME);
- dcd_edpt_open (0, &ep0OUT_desc);
- dcd_edpt_open (0, &ep0IN_desc);
-}
-
-static void handle_alt_ev(void)
-{
- uint32_t alt_ev = USB->USB_ALTEV_REG;
-
- if (GET_BIT(alt_ev, USB_USB_ALTEV_REG_USB_RESET))
- {
- handle_bus_reset();
- }
- else
- {
- if (GET_BIT(alt_ev, USB_USB_ALTEV_REG_USB_RESUME))
- {
- USB->USB_NFSR_REG = NFSR_NODE_OPERATIONAL;
- USB->USB_ALTMSK_REG &= ~USB_USB_ALTMSK_REG_USB_M_RESUME_Msk;
- USB->USB_ALTMSK_REG |= USB_USB_ALTMSK_REG_USB_M_SD3_Msk;
- dcd_event_bus_signal(0, DCD_EVENT_RESUME, true);
- }
- if (GET_BIT(alt_ev, USB_USB_ALTEV_REG_USB_SD3))
- {
- USB->USB_NFSR_REG = NFSR_NODE_SUSPEND;
- USB->USB_ALTMSK_REG |= USB_USB_ALTMSK_REG_USB_M_RESUME_Msk;
- USB->USB_ALTMSK_REG &= ~USB_USB_ALTMSK_REG_USB_M_SD3_Msk | USB_USB_ALTMSK_REG_USB_M_SD5_Msk;
- dcd_event_bus_signal(0, DCD_EVENT_SUSPEND, true);
- }
- }
-}
-
-static void handle_epx_tx_warn_ev(uint8_t ep)
-{
- fill_tx_fifo(XFER_CTL_BASE(ep, TUSB_DIR_IN));
-}
-
-static void handle_fifo_warning(void)
-{
- uint32_t fifo_warning = USB->USB_FWEV_REG;
-
- if (fifo_warning & 0x01)
- handle_epx_tx_warn_ev(1);
- if (fifo_warning & 0x02)
- handle_epx_tx_warn_ev(2);
- if (fifo_warning & 0x04)
- handle_epx_tx_warn_ev(3);
- if (fifo_warning & 0x10)
- handle_epx_rx_ev(1);
- if (fifo_warning & 0x20)
- handle_epx_rx_ev(2);
- if (fifo_warning & 0x40)
- handle_epx_rx_ev(3);
-}
-
-static void handle_ep0_nak(void)
-{
- uint32_t ep0_nak = USB->USB_EP0_NAK_REG;
-
- if (REG_GET_BIT(USB_EPC0_REG, USB_STALL))
- {
- if (GET_BIT(ep0_nak, USB_USB_EP0_NAK_REG_USB_EP0_INNAK))
- {
- // EP0 is stalled and NAK was sent, it means that RX is enabled
- // Disable RX for now.
- REG_CLR_BIT(USB_RXC0_REG, USB_RX_EN);
- REG_SET_BIT(USB_TXC0_REG, USB_TX_EN);
- }
- if (GET_BIT(ep0_nak, USB_USB_EP0_NAK_REG_USB_EP0_OUTNAK))
- {
- REG_SET_BIT(USB_RXC0_REG, USB_RX_EN);
- }
- }
- else
- {
- REG_CLR_BIT(USB_MAMSK_REG, USB_M_EP0_NAK);
- }
-}
-
-/*------------------------------------------------------------------*/
-/* Controller API
- *------------------------------------------------------------------*/
-void dcd_init(uint8_t rhport)
-{
- USB->USB_MCTRL_REG = USB_USB_MCTRL_REG_USBEN_Msk;
- USB->USB_NFSR_REG = 0;
- USB->USB_FAR_REG = 0x80;
- USB->USB_NFSR_REG = NFSR_NODE_RESET;
- USB->USB_TXMSK_REG = 0;
- USB->USB_RXMSK_REG = 0;
-
- USB->USB_MAMSK_REG = USB_USB_MAMSK_REG_USB_M_INTR_Msk |
- USB_USB_MAMSK_REG_USB_M_ALT_Msk |
- USB_USB_MAMSK_REG_USB_M_WARN_Msk;
- USB->USB_ALTMSK_REG = USB_USB_ALTMSK_REG_USB_M_RESET_Msk;
-
- dcd_connect(rhport);
-}
-
-void dcd_int_enable(uint8_t rhport)
-{
- (void)rhport;
-
- NVIC_EnableIRQ(USB_IRQn);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void)rhport;
-
- NVIC_DisableIRQ(USB_IRQn);
-}
-
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- (void)rhport;
-
- // Set default address for one ZLP
- USB->USB_EPC0_REG = USB_USB_EPC0_REG_USB_DEF_Msk;
- USB->USB_FAR_REG = (dev_addr & USB_USB_FAR_REG_USB_AD_Msk) | USB_USB_FAR_REG_USB_AD_EN_Msk;
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void)rhport;
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void)rhport;
-
- REG_SET_BIT(USB_MCTRL_REG, USB_NAT);
-
- // Select chosen DMA to be triggered by USB.
- DMA->DMA_REQ_MUX_REG = (DMA->DMA_REQ_MUX_REG & ~DA146XX_DMA_USB_MUX_MASK) | DA146XX_DMA_USB_MUX;
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void)rhport;
-
- REG_CLR_BIT(USB_MCTRL_REG, USB_NAT);
-}
-
-
-/*------------------------------------------------------------------*/
-/* DCD Endpoint port
- *------------------------------------------------------------------*/
-
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
-{
- (void)rhport;
-
- uint8_t const epnum = tu_edpt_number(desc_edpt->bEndpointAddress);
- uint8_t const dir = tu_edpt_dir(desc_edpt->bEndpointAddress);
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
- uint8_t iso_mask = 0;
-
- TU_ASSERT(epnum < EP_MAX);
-
- xfer->max_packet_size = desc_edpt->wMaxPacketSize.size;
- xfer->ep_addr = desc_edpt->bEndpointAddress;
- xfer->data1 = 0;
- xfer->iso = 0;
-
- if (epnum != 0 && desc_edpt->bmAttributes.xfer == 1)
- {
- iso_mask = USB_USB_EPC1_REG_USB_ISO_Msk;
- xfer->iso = 1;
- }
-
- if (epnum == 0)
- {
- USB->USB_MAMSK_REG |= USB_USB_MAMSK_REG_USB_M_EP0_RX_Msk |
- USB_USB_MAMSK_REG_USB_M_EP0_TX_Msk;
- }
- else
- {
- if (dir == TUSB_DIR_OUT)
- {
- xfer->regs->epc_out = epnum | USB_USB_EPC1_REG_USB_EP_EN_Msk | iso_mask;
- USB->USB_RXMSK_REG |= 0x101 << (epnum - 1);
- REG_SET_BIT(USB_MAMSK_REG, USB_M_RX_EV);
- }
- else
- {
- xfer->regs->epc_in = epnum | USB_USB_EPC1_REG_USB_EP_EN_Msk | iso_mask;
- USB->USB_TXMSK_REG |= 0x101 << (epnum - 1);
- REG_SET_BIT(USB_MAMSK_REG, USB_M_TX_EV);
- }
- }
-
- return true;
-}
-
-void dcd_edpt_close(uint8_t rhport, uint8_t ep_addr)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
-
- (void)rhport;
-
- TU_ASSERT(epnum < EP_MAX,);
-
- if (epnum == 0)
- {
- USB->USB_MAMSK_REG &= ~(USB_USB_MAMSK_REG_USB_M_EP0_RX_Msk |
- USB_USB_MAMSK_REG_USB_M_EP0_TX_Msk);
- }
- else
- {
- if (dir == TUSB_DIR_OUT)
- {
- xfer->regs->rxc = USB_USB_RXC1_REG_USB_FLUSH_Msk;
- xfer->regs->epc_out = 0;
- USB->USB_RXMSK_REG &= ~(0x101 << (epnum - 1));
- // Release DMA if needed
- if (_dcd.dma_ep[TUSB_DIR_OUT] == epnum)
- {
- RX_DMA_REGS->DMAx_CTRL_REG &= ~DMA_DMA0_CTRL_REG_DMA_ON_Msk;
- _dcd.dma_ep[TUSB_DIR_OUT] = 0;
- }
- }
- else
- {
- xfer->regs->txc = USB_USB_TXC1_REG_USB_FLUSH_Msk;
- xfer->regs->epc_in = 0;
- USB->USB_TXMSK_REG &= ~(0x101 << (epnum - 1));
- // Release DMA if needed
- if (_dcd.dma_ep[TUSB_DIR_IN] == epnum)
- {
- TX_DMA_REGS->DMAx_CTRL_REG &= ~DMA_DMA1_CTRL_REG_DMA_ON_Msk;
- _dcd.dma_ep[TUSB_DIR_IN] = 0;
- }
- }
- }
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
-
- (void)rhport;
-
- xfer->buffer = buffer;
- xfer->total_len = total_bytes;
- xfer->last_packet_size = 0;
- xfer->transferred = 0;
-
- if (dir == TUSB_DIR_OUT)
- {
- start_rx_packet(xfer);
- }
- else // IN
- {
- start_tx_packet(xfer);
- }
-
- return true;
-}
-
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- (void)rhport;
-
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
- xfer->stall = 1;
-
- if (epnum == 0)
- {
- // EP0 has just one registers to control stall for IN and OUT
- REG_SET_BIT(USB_EPC0_REG, USB_STALL);
- if (dir == TUSB_DIR_OUT)
- {
- xfer->regs->USB_RXC0_REG = USB_USB_RXC0_REG_USB_RX_EN_Msk;
- }
- else
- {
- if (xfer->regs->USB_RXC0_REG & USB_USB_RXC0_REG_USB_RX_EN_Msk)
- {
- // If RX is also enabled TX will not be stalled since RX has
- // higher priority. Enable NAK interrupt to handle stall.
- REG_SET_BIT(USB_MAMSK_REG, USB_M_EP0_NAK);
- }
- else
- {
- xfer->regs->USB_TXC0_REG |= USB_USB_TXC0_REG_USB_TX_EN_Msk;
- }
- }
- }
- else
- {
- if (dir == TUSB_DIR_OUT)
- {
- xfer->regs->epc_out |= USB_USB_EPC1_REG_USB_STALL_Msk;
- xfer->regs->rxc |= USB_USB_RXC1_REG_USB_RX_EN_Msk;
- }
- else
- {
- xfer->regs->epc_in |= USB_USB_EPC1_REG_USB_STALL_Msk;
- xfer->regs->txc |= USB_USB_TXC1_REG_USB_TX_EN_Msk | USB_USB_TXC1_REG_USB_LAST_Msk;
- }
- }
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- (void)rhport;
-
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
-
- // Clear stall is called in response to Clear Feature ENDPOINT_HALT, reset toggle
- xfer->data1 = 0;
- xfer->stall = 0;
-
- if (dir == TUSB_DIR_OUT)
- {
- xfer->regs->epc_out &= ~USB_USB_EPC1_REG_USB_STALL_Msk;
- }
- else
- {
- xfer->regs->epc_in &= ~USB_USB_EPC1_REG_USB_STALL_Msk;
- }
- if (epnum == 0)
- {
- REG_CLR_BIT(USB_MAMSK_REG, USB_M_EP0_NAK);
- }
-}
-
-/*------------------------------------------------------------------*/
-/* Interrupt Handler
- *------------------------------------------------------------------*/
-
-void dcd_int_handler(uint8_t rhport)
-{
- uint32_t int_status = USB->USB_MAEV_REG;
-
- (void)rhport;
-
- if (GET_BIT(int_status, USB_USB_MAEV_REG_USB_WARN))
- {
- handle_fifo_warning();
- }
-
- if (GET_BIT(int_status, USB_USB_MAEV_REG_USB_CH_EV))
- {
- // TODO: for now just clear interrupt
- (void)USB->USB_CHARGER_STAT_REG;
- }
-
- if (GET_BIT(int_status, USB_USB_MAEV_REG_USB_EP0_NAK))
- {
- handle_ep0_nak();
- }
-
- if (GET_BIT(int_status, USB_USB_MAEV_REG_USB_EP0_RX))
- {
- handle_ep0_rx();
- }
-
- if (GET_BIT(int_status, USB_USB_MAEV_REG_USB_EP0_TX))
- {
- handle_ep0_tx();
- }
-
- if (GET_BIT(int_status, USB_USB_MAEV_REG_USB_RX_EV))
- {
- handle_rx_ev();
- }
-
- if (GET_BIT(int_status, USB_USB_MAEV_REG_USB_NAK))
- {
- (void)USB->USB_NAKEV_REG;
- }
-
- if (GET_BIT(int_status, USB_USB_MAEV_REG_USB_FRAME))
- {
- if (_dcd.in_reset)
- {
- // Enable reset detection
- _dcd.in_reset = false;
- (void)USB->USB_ALTEV_REG;
- }
-#if USE_SOF
- dcd_event_bus_signal(0, DCD_EVENT_SOF, true);
-#else
- // SOF was used to re-enable reset detection
- // No need to keep it enabled
- USB->USB_MAMSK_REG &= ~USB_USB_MAMSK_REG_USB_M_FRAME_Msk;
-#endif
- }
-
- if (GET_BIT(int_status, USB_USB_MAEV_REG_USB_TX_EV))
- {
- handle_tx_ev();
- }
-
- if (GET_BIT(int_status, USB_USB_MAEV_REG_USB_ALT))
- {
- handle_alt_ev();
- }
-}
-
-#endif
diff --git a/tinyusb/src/portable/ehci/ehci.c b/tinyusb/src/portable/ehci/ehci.c
deleted file mode 100755
index e3b7499c..00000000
--- a/tinyusb/src/portable/ehci/ehci.c
+++ /dev/null
@@ -1,893 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "host/hcd_attr.h"
-
-#if TUSB_OPT_HOST_ENABLED && defined(HCD_ATTR_EHCI_TRANSDIMENSION)
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "osal/osal.h"
-
-#include "host/hcd.h"
-#include "ehci_api.h"
-#include "ehci.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-// Debug level of EHCI
-#define EHCI_DBG 2
-
-// Framelist size as small as possible to save SRAM
-#ifdef HCD_ATTR_EHCI_TRANSDIMENSION
- // NXP Transdimension: 8 elements
- #define FRAMELIST_SIZE_BIT_VALUE 7u
- #define FRAMELIST_SIZE_USBCMD_VALUE (((FRAMELIST_SIZE_BIT_VALUE & 3) << EHCI_USBCMD_POS_FRAMELIST_SIZE) | \
- ((FRAMELIST_SIZE_BIT_VALUE >> 2) << EHCI_USBCMD_POS_NXP_FRAMELIST_SIZE_MSB))
-#else
- // STD EHCI: 256 elements
- #define FRAMELIST_SIZE_BIT_VALUE 2u
- #define FRAMELIST_SIZE_USBCMD_VALUE ((FRAMELIST_SIZE_BIT_VALUE & 3) << EHCI_USBCMD_POS_FRAMELIST_SIZE)
-#endif
-
-#define FRAMELIST_SIZE (1024 >> FRAMELIST_SIZE_BIT_VALUE)
-
-typedef struct
-{
- ehci_link_t period_framelist[FRAMELIST_SIZE];
-
- // TODO only implement 1 ms & 2 ms & 4 ms, 8 ms (framelist)
- // [0] : 1ms, [1] : 2ms, [2] : 4ms, [3] : 8 ms
- // TODO better implementation without dummy head to save SRAM
- ehci_qhd_t period_head_arr[4];
-
- // Note control qhd of dev0 is used as head of async list
- struct {
- ehci_qhd_t qhd;
- ehci_qtd_t qtd;
- }control[CFG_TUH_DEVICE_MAX+CFG_TUH_HUB+1];
-
- ehci_qhd_t qhd_pool[HCD_MAX_ENDPOINT];
- ehci_qtd_t qtd_pool[HCD_MAX_XFER] TU_ATTR_ALIGNED(32);
-
- ehci_registers_t* regs;
-
- volatile uint32_t uframe_number;
-}ehci_data_t;
-
-// Periodic frame list must be 4K alignment
-CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(4096) static ehci_data_t ehci_data;
-
-//--------------------------------------------------------------------+
-// PROTOTYPE
-//--------------------------------------------------------------------+
-static inline ehci_link_t* get_period_head(uint8_t rhport, uint32_t interval_ms)
-{
- (void) rhport;
- return (ehci_link_t*) &ehci_data.period_head_arr[ tu_log2( tu_min32(FRAMELIST_SIZE, interval_ms) ) ];
-}
-
-static inline ehci_qhd_t* qhd_control(uint8_t dev_addr)
-{
- return &ehci_data.control[dev_addr].qhd;
-}
-
-static inline ehci_qhd_t* qhd_async_head(uint8_t rhport)
-{
- (void) rhport;
- // control qhd of dev0 is used as async head
- return qhd_control(0);
-}
-
-static inline ehci_qtd_t* qtd_control(uint8_t dev_addr)
-{
- return &ehci_data.control[dev_addr].qtd;
-}
-
-
-static inline ehci_qhd_t* qhd_next (ehci_qhd_t const * p_qhd);
-static inline ehci_qhd_t* qhd_find_free (void);
-static inline ehci_qhd_t* qhd_get_from_addr (uint8_t dev_addr, uint8_t ep_addr);
-
-// determine if a queue head has bus-related error
-static inline bool qhd_has_xact_error (ehci_qhd_t * p_qhd)
-{
- return (p_qhd->qtd_overlay.buffer_err || p_qhd->qtd_overlay.babble_err || p_qhd->qtd_overlay.xact_err);
- //p_qhd->qtd_overlay.non_hs_period_missed_uframe || p_qhd->qtd_overlay.pingstate_err TODO split transaction error
-}
-
-static void qhd_init(ehci_qhd_t *p_qhd, uint8_t dev_addr, tusb_desc_endpoint_t const * ep_desc);
-
-static inline ehci_qtd_t* qtd_find_free (void);
-static inline ehci_qtd_t* qtd_next (ehci_qtd_t const * p_qtd);
-static inline void qtd_insert_to_qhd (ehci_qhd_t *p_qhd, ehci_qtd_t *p_qtd_new);
-static inline void qtd_remove_1st_from_qhd (ehci_qhd_t *p_qhd);
-static void qtd_init (ehci_qtd_t* p_qtd, void* buffer, uint16_t total_bytes);
-
-static inline void list_insert (ehci_link_t *current, ehci_link_t *new, uint8_t new_type);
-static inline ehci_link_t* list_next (ehci_link_t *p_link_pointer);
-
-//--------------------------------------------------------------------+
-// HCD API
-//--------------------------------------------------------------------+
-
-uint32_t hcd_frame_number(uint8_t rhport)
-{
- (void) rhport;
- return (ehci_data.uframe_number + ehci_data.regs->frame_index) >> 3;
-}
-
-void hcd_port_reset(uint8_t rhport)
-{
- (void) rhport;
-
- ehci_registers_t* regs = ehci_data.regs;
-
-// regs->portsc_bm.port_enabled = 0; // disable port before reset
-// regs->portsc_bm.port_reset = 1;
-
- uint32_t portsc = regs->portsc;
-
- portsc &= ~(EHCI_PORTSC_MASK_PORT_EANBLED);
- portsc |= EHCI_PORTSC_MASK_PORT_RESET;
-
- regs->portsc = portsc;
-}
-
-#if 0
-void hcd_port_reset_end(uint8_t rhport)
-{
- (void) rhport;
-
- ehci_registers_t* regs = ehci_data.regs;
- regs->portsc_bm.port_reset = 0;
-}
-#endif
-
-bool hcd_port_connect_status(uint8_t rhport)
-{
- (void) rhport;
- return ehci_data.regs->portsc_bm.current_connect_status;
-}
-
-tusb_speed_t hcd_port_speed_get(uint8_t rhport)
-{
- (void) rhport;
- return (tusb_speed_t) ehci_data.regs->portsc_bm.nxp_port_speed; // NXP specific port speed
-}
-
-static void list_remove_qhd_by_addr(ehci_link_t* list_head, uint8_t dev_addr)
-{
- for(ehci_link_t* prev = list_head;
- !prev->terminate && (tu_align32(prev->address) != (uint32_t) list_head);
- prev = list_next(prev) )
- {
- // TODO check type for ISO iTD and siTD
- ehci_qhd_t* qhd = (ehci_qhd_t*) list_next(prev);
- if ( qhd->dev_addr == dev_addr )
- {
- // TODO deactive all TD, wait for QHD to inactive before removal
- prev->address = qhd->next.address;
-
- // EHCI 4.8.2 link the removed qhd to async head (which always reachable by Host Controller)
- qhd->next.address = ((uint32_t) list_head) | (EHCI_QTYPE_QHD << 1);
-
- if ( qhd->int_smask )
- {
- // period list queue element is guarantee to be free in the next frame (1 ms)
- qhd->used = 0;
- }else
- {
- // async list use async advance handshake
- // mark as removing, will completely re-usable when async advance isr occurs
- qhd->removing = 1;
- }
- }
- }
-}
-
-// Close all opened endpoint belong to this device
-void hcd_device_close(uint8_t rhport, uint8_t dev_addr)
-{
- // skip dev0
- if (dev_addr == 0) return;
-
- // Remove from async list
- list_remove_qhd_by_addr( (ehci_link_t*) qhd_async_head(rhport), dev_addr );
-
- // Remove from all interval period list
- for(uint8_t i = 0; i < TU_ARRAY_SIZE(ehci_data.period_head_arr); i++)
- {
- list_remove_qhd_by_addr( (ehci_link_t*) &ehci_data.period_head_arr[i], dev_addr);
- }
-
- // Async doorbell (EHCI 4.8.2 for operational details)
- ehci_data.regs->command_bm.async_adv_doorbell = 1;
-}
-
-bool ehci_init(uint8_t rhport, uint32_t capability_reg, uint32_t operatial_reg)
-{
- (void) capability_reg; // not used yet
-
- tu_memclr(&ehci_data, sizeof(ehci_data_t));
-
- ehci_data.regs = (ehci_registers_t* ) operatial_reg;
-
- ehci_registers_t* regs = ehci_data.regs;
-
- //------------- CTRLDSSEGMENT Register (skip) -------------//
- //------------- USB INT Register -------------//
- regs->inten = 0; // 1. disable all the interrupt
- regs->status = EHCI_INT_MASK_ALL; // 2. clear all status
-
- regs->inten = EHCI_INT_MASK_ERROR | EHCI_INT_MASK_PORT_CHANGE | EHCI_INT_MASK_ASYNC_ADVANCE |
- EHCI_INT_MASK_NXP_PERIODIC | EHCI_INT_MASK_NXP_ASYNC | EHCI_INT_MASK_FRAMELIST_ROLLOVER;
-
- //------------- Asynchronous List -------------//
- ehci_qhd_t * const async_head = qhd_async_head(rhport);
- tu_memclr(async_head, sizeof(ehci_qhd_t));
-
- async_head->next.address = (uint32_t) async_head; // circular list, next is itself
- async_head->next.type = EHCI_QTYPE_QHD;
- async_head->head_list_flag = 1;
- async_head->qtd_overlay.halted = 1; // inactive most of time
- async_head->qtd_overlay.next.terminate = 1; // TODO removed if verified
-
- regs->async_list_addr = (uint32_t) async_head;
-
- //------------- Periodic List -------------//
- // Build the polling interval tree with 1 ms, 2 ms, 4 ms and 8 ms (framesize) only
- for ( uint32_t i = 0; i < TU_ARRAY_SIZE(ehci_data.period_head_arr); i++ )
- {
- ehci_data.period_head_arr[i].int_smask = 1; // queue head in period list must have smask non-zero
- ehci_data.period_head_arr[i].qtd_overlay.halted = 1; // dummy node, always inactive
- }
-
- ehci_link_t * const framelist = ehci_data.period_framelist;
- ehci_link_t * const period_1ms = get_period_head(rhport, 1u);
-
- // all links --> period_head_arr[0] (1ms)
- // 0, 2, 4, 6 etc --> period_head_arr[1] (2ms)
- // 1, 5 --> period_head_arr[2] (4ms)
- // 3 --> period_head_arr[3] (8ms)
-
- // TODO EHCI_FRAMELIST_SIZE with other size than 8
- for(uint32_t i=0; i<FRAMELIST_SIZE; i++)
- {
- framelist[i].address = (uint32_t) period_1ms;
- framelist[i].type = EHCI_QTYPE_QHD;
- }
-
- for(uint32_t i=0; i<FRAMELIST_SIZE; i+=2)
- {
- list_insert(framelist + i, get_period_head(rhport, 2u), EHCI_QTYPE_QHD);
- }
-
- for(uint32_t i=1; i<FRAMELIST_SIZE; i+=4)
- {
- list_insert(framelist + i, get_period_head(rhport, 4u), EHCI_QTYPE_QHD);
- }
-
- list_insert(framelist+3, get_period_head(rhport, 8u), EHCI_QTYPE_QHD);
-
- period_1ms->terminate = 1;
-
- regs->periodic_list_base = (uint32_t) framelist;
-
- //------------- TT Control (NXP only) -------------//
- regs->nxp_tt_control = 0;
-
- //------------- USB CMD Register -------------//
- regs->command |= TU_BIT(EHCI_USBCMD_POS_RUN_STOP) | TU_BIT(EHCI_USBCMD_POS_ASYNC_ENABLE) |
- TU_BIT(EHCI_USBCMD_POS_PERIOD_ENABLE) | // TODO enable period list only there is int/iso endpoint
- FRAMELIST_SIZE_USBCMD_VALUE;
-
- //------------- ConfigFlag Register (skip) -------------//
- regs->portsc_bm.port_power = 1; // enable port power
-
- return true;
-}
-
-#if 0
-static void ehci_stop(uint8_t rhport)
-{
- (void) rhport;
-
- ehci_registers_t* regs = ehci_data.regs;
-
- regs->command_bm.run_stop = 0;
-
- // USB Spec: controller has to stop within 16 uframe = 2 frames
- while( regs->status_bm.hc_halted == 0 ) {}
-}
-#endif
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-
-bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const * ep_desc)
-{
- (void) rhport;
-
- // TODO not support ISO yet
- TU_ASSERT (ep_desc->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS);
-
- //------------- Prepare Queue Head -------------//
- ehci_qhd_t * p_qhd;
-
- if ( ep_desc->bEndpointAddress == 0 )
- {
- p_qhd = qhd_control(dev_addr);
- }else
- {
- p_qhd = qhd_find_free();
- }
- TU_ASSERT(p_qhd);
-
- qhd_init(p_qhd, dev_addr, ep_desc);
-
- // control of dev0 is always present as async head
- if ( dev_addr == 0 ) return true;
-
- // Insert to list
- ehci_link_t * list_head = NULL;
-
- switch (ep_desc->bmAttributes.xfer)
- {
- case TUSB_XFER_CONTROL:
- case TUSB_XFER_BULK:
- list_head = (ehci_link_t*) qhd_async_head(rhport);
- break;
-
- case TUSB_XFER_INTERRUPT:
- list_head = get_period_head(rhport, p_qhd->interval_ms);
- break;
-
- case TUSB_XFER_ISOCHRONOUS:
- // TODO iso is not supported
- break;
-
- default: break;
- }
-
- TU_ASSERT(list_head);
-
- // TODO might need to disable async/period list
- list_insert(list_head, (ehci_link_t*) p_qhd, EHCI_QTYPE_QHD);
-
- return true;
-}
-
-bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet[8])
-{
- (void) rhport;
-
- ehci_qhd_t* qhd = &ehci_data.control[dev_addr].qhd;
- ehci_qtd_t* td = &ehci_data.control[dev_addr].qtd;
-
- qtd_init(td, (void*) setup_packet, 8);
- td->pid = EHCI_PID_SETUP;
- td->int_on_complete = 1;
- td->next.terminate = 1;
-
- // sw region
- qhd->p_qtd_list_head = td;
- qhd->p_qtd_list_tail = td;
-
- // attach TD
- qhd->qtd_overlay.next.address = (uint32_t) td;
-
- return true;
-}
-
-bool hcd_edpt_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t * buffer, uint16_t buflen)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- if ( epnum == 0 )
- {
- ehci_qhd_t* qhd = qhd_control(dev_addr);
- ehci_qtd_t* qtd = qtd_control(dev_addr);
-
- qtd_init(qtd, buffer, buflen);
-
- // first first data toggle is always 1 (data & setup stage)
- qtd->data_toggle = 1;
- qtd->pid = dir ? EHCI_PID_IN : EHCI_PID_OUT;
- qtd->int_on_complete = 1;
- qtd->next.terminate = 1;
-
- // sw region
- qhd->p_qtd_list_head = qtd;
- qhd->p_qtd_list_tail = qtd;
-
- // attach TD
- qhd->qtd_overlay.next.address = (uint32_t) qtd;
- }else
- {
- ehci_qhd_t *p_qhd = qhd_get_from_addr(dev_addr, ep_addr);
- ehci_qtd_t *p_qtd = qtd_find_free();
- TU_ASSERT(p_qtd);
-
- qtd_init(p_qtd, buffer, buflen);
- p_qtd->pid = p_qhd->pid;
-
- // Insert TD to QH
- qtd_insert_to_qhd(p_qhd, p_qtd);
-
- p_qhd->p_qtd_list_tail->int_on_complete = 1;
-
- // attach head QTD to QHD start transferring
- p_qhd->qtd_overlay.next.address = (uint32_t) p_qhd->p_qtd_list_head;
- }
-
- return true;
-}
-
-bool hcd_edpt_clear_stall(uint8_t dev_addr, uint8_t ep_addr)
-{
- ehci_qhd_t *p_qhd = qhd_get_from_addr(dev_addr, ep_addr);
- p_qhd->qtd_overlay.halted = 0;
- // TODO reset data toggle ?
- return true;
-}
-
-//--------------------------------------------------------------------+
-// EHCI Interrupt Handler
-//--------------------------------------------------------------------+
-
-// async_advance is handshake between usb stack & ehci controller.
-// This isr mean it is safe to modify previously removed queue head from async list.
-// In tinyusb, queue head is only removed when device is unplugged.
-static void async_advance_isr(uint8_t rhport)
-{
- (void) rhport;
-
- ehci_qhd_t* qhd_pool = ehci_data.qhd_pool;
- for(uint32_t i = 0; i < HCD_MAX_ENDPOINT; i++)
- {
- if ( qhd_pool[i].removing )
- {
- qhd_pool[i].removing = 0;
- qhd_pool[i].used = 0;
- }
- }
-}
-
-static void port_connect_status_change_isr(uint8_t rhport)
-{
- // NOTE There is an sequence plug->unplug->…..-> plug if device is powering with pre-plugged device
- if (ehci_data.regs->portsc_bm.current_connect_status)
- {
- hcd_port_reset(rhport);
- hcd_event_device_attach(rhport, true);
- }else // device unplugged
- {
- hcd_event_device_remove(rhport, true);
- }
-}
-
-static void qhd_xfer_complete_isr(ehci_qhd_t * p_qhd)
-{
- // free all TDs from the head td to the first active TD
- while(p_qhd->p_qtd_list_head != NULL && !p_qhd->p_qtd_list_head->active)
- {
- ehci_qtd_t * volatile qtd = (ehci_qtd_t * volatile) p_qhd->p_qtd_list_head;
- bool const is_ioc = (qtd->int_on_complete != 0);
- uint8_t const ep_addr = tu_edpt_addr(p_qhd->ep_number, qtd->pid == EHCI_PID_IN ? 1 : 0);
-
- p_qhd->total_xferred_bytes += qtd->expected_bytes - qtd->total_bytes;
-
- // TD need to be freed and removed from qhd, before invoking callback
- qtd->used = 0; // free QTD
- qtd_remove_1st_from_qhd(p_qhd);
-
- if (is_ioc)
- {
- hcd_event_xfer_complete(p_qhd->dev_addr, ep_addr, p_qhd->total_xferred_bytes, XFER_RESULT_SUCCESS, true);
- p_qhd->total_xferred_bytes = 0;
- }
- }
-}
-
-static void async_list_xfer_complete_isr(ehci_qhd_t * const async_head)
-{
- ehci_qhd_t *p_qhd = async_head;
- do
- {
- if ( !p_qhd->qtd_overlay.halted ) // halted or error is processed in error isr
- {
- qhd_xfer_complete_isr(p_qhd);
- }
- p_qhd = qhd_next(p_qhd);
- }while(p_qhd != async_head); // async list traversal, stop if loop around
-}
-
-static void period_list_xfer_complete_isr(uint8_t hostid, uint32_t interval_ms)
-{
- uint16_t max_loop = 0;
- uint32_t const period_1ms_addr = (uint32_t) get_period_head(hostid, 1u);
- ehci_link_t next_item = * get_period_head(hostid, interval_ms);
-
- // TODO abstract max loop guard for period
- while( !next_item.terminate &&
- !(interval_ms > 1 && period_1ms_addr == tu_align32(next_item.address)) &&
- max_loop < (HCD_MAX_ENDPOINT + EHCI_MAX_ITD + EHCI_MAX_SITD)*CFG_TUH_DEVICE_MAX)
- {
- switch ( next_item.type )
- {
- case EHCI_QTYPE_QHD:
- {
- ehci_qhd_t *p_qhd_int = (ehci_qhd_t *) tu_align32(next_item.address);
- if ( !p_qhd_int->qtd_overlay.halted )
- {
- qhd_xfer_complete_isr(p_qhd_int);
- }
- }
- break;
-
- case EHCI_QTYPE_ITD: // TODO support hs/fs ISO
- case EHCI_QTYPE_SITD:
- case EHCI_QTYPE_FSTN:
-
- default: break;
- }
-
- next_item = *list_next(&next_item);
- max_loop++;
- }
-}
-
-static void qhd_xfer_error_isr(ehci_qhd_t * p_qhd)
-{
- if ( (p_qhd->dev_addr != 0 && p_qhd->qtd_overlay.halted) || // addr0 cannot be protocol STALL
- qhd_has_xact_error(p_qhd) )
- {
- // current qhd has error in transaction
- xfer_result_t error_event;
-
- // no error bits are set, endpoint is halted due to STALL
- error_event = qhd_has_xact_error(p_qhd) ? XFER_RESULT_FAILED : XFER_RESULT_STALLED;
-
- p_qhd->total_xferred_bytes += p_qhd->p_qtd_list_head->expected_bytes - p_qhd->p_qtd_list_head->total_bytes;
-
-// if ( XFER_RESULT_FAILED == error_event ) TU_BREAKPOINT(); // TODO skip unplugged device
-
- p_qhd->p_qtd_list_head->used = 0; // free QTD
- qtd_remove_1st_from_qhd(p_qhd);
-
- if ( 0 == p_qhd->ep_number )
- {
- // control cannot be halted --> clear all qtd list
- p_qhd->p_qtd_list_head = NULL;
- p_qhd->p_qtd_list_tail = NULL;
-
- p_qhd->qtd_overlay.next.terminate = 1;
- p_qhd->qtd_overlay.alternate.terminate = 1;
- p_qhd->qtd_overlay.halted = 0;
-
- ehci_qtd_t *p_setup = qtd_control(p_qhd->dev_addr);
- p_setup->used = 0;
- }
-
- // call USBH callback
- hcd_event_xfer_complete(p_qhd->dev_addr, tu_edpt_addr(p_qhd->ep_number, p_qhd->pid == EHCI_PID_IN ? 1 : 0), p_qhd->total_xferred_bytes, error_event, true);
-
- p_qhd->total_xferred_bytes = 0;
- }
-}
-
-static void xfer_error_isr(uint8_t hostid)
-{
- //------------- async list -------------//
- ehci_qhd_t * const async_head = qhd_async_head(hostid);
- ehci_qhd_t *p_qhd = async_head;
- do
- {
- qhd_xfer_error_isr( p_qhd );
- p_qhd = qhd_next(p_qhd);
- }while(p_qhd != async_head); // async list traversal, stop if loop around
-
- //------------- TODO refractor period list -------------//
- uint32_t const period_1ms_addr = (uint32_t) get_period_head(hostid, 1u);
- for (uint32_t interval_ms=1; interval_ms <= FRAMELIST_SIZE; interval_ms *= 2)
- {
- ehci_link_t next_item = * get_period_head(hostid, interval_ms);
-
- // TODO abstract max loop guard for period
- while( !next_item.terminate &&
- !(interval_ms > 1 && period_1ms_addr == tu_align32(next_item.address)) )
- {
- switch ( next_item.type )
- {
- case EHCI_QTYPE_QHD:
- {
- ehci_qhd_t *p_qhd_int = (ehci_qhd_t *) tu_align32(next_item.address);
- qhd_xfer_error_isr(p_qhd_int);
- }
- break;
-
- // TODO support hs/fs ISO
- case EHCI_QTYPE_ITD:
- case EHCI_QTYPE_SITD:
- case EHCI_QTYPE_FSTN:
- default: break;
- }
-
- next_item = *list_next(&next_item);
- }
- }
-}
-
-//------------- Host Controller Driver's Interrupt Handler -------------//
-void hcd_int_handler(uint8_t rhport)
-{
- ehci_registers_t* regs = ehci_data.regs;
-
- uint32_t int_status = regs->status;
- int_status &= regs->inten;
-
- regs->status |= int_status; // Acknowledge handled interrupt
-
- if (int_status == 0) return;
-
- if (int_status & EHCI_INT_MASK_FRAMELIST_ROLLOVER)
- {
- ehci_data.uframe_number += (FRAMELIST_SIZE << 3);
- }
-
- if (int_status & EHCI_INT_MASK_PORT_CHANGE)
- {
- uint32_t port_status = regs->portsc & EHCI_PORTSC_MASK_ALL;
-
- TU_LOG_HEX(EHCI_DBG, regs->portsc);
-
- if (regs->portsc_bm.connect_status_change)
- {
- port_connect_status_change_isr(rhport);
- }
-
- regs->portsc |= port_status; // Acknowledge change bits in portsc
- }
-
- if (int_status & EHCI_INT_MASK_ERROR)
- {
- xfer_error_isr(rhport);
- }
-
- //------------- some QTD/SITD/ITD with IOC set is completed -------------//
- if (int_status & EHCI_INT_MASK_NXP_ASYNC)
- {
- async_list_xfer_complete_isr( qhd_async_head(rhport) );
- }
-
- if (int_status & EHCI_INT_MASK_NXP_PERIODIC)
- {
- for (uint32_t i=1; i <= FRAMELIST_SIZE; i *= 2)
- {
- period_list_xfer_complete_isr( rhport, i );
- }
- }
-
- //------------- There is some removed async previously -------------//
- if (int_status & EHCI_INT_MASK_ASYNC_ADVANCE) // need to place after EHCI_INT_MASK_NXP_ASYNC
- {
- async_advance_isr(rhport);
- }
-}
-
-//--------------------------------------------------------------------+
-// HELPER
-//--------------------------------------------------------------------+
-
-
-//------------- queue head helper -------------//
-static inline ehci_qhd_t* qhd_find_free (void)
-{
- for (uint32_t i=0; i<HCD_MAX_ENDPOINT; i++)
- {
- if ( !ehci_data.qhd_pool[i].used ) return &ehci_data.qhd_pool[i];
- }
-
- return NULL;
-}
-
-static inline ehci_qhd_t* qhd_next(ehci_qhd_t const * p_qhd)
-{
- return (ehci_qhd_t*) tu_align32(p_qhd->next.address);
-}
-
-static inline ehci_qhd_t* qhd_get_from_addr(uint8_t dev_addr, uint8_t ep_addr)
-{
- ehci_qhd_t* qhd_pool = ehci_data.qhd_pool;
-
- for(uint32_t i=0; i<HCD_MAX_ENDPOINT; i++)
- {
- if ( (qhd_pool[i].dev_addr == dev_addr) &&
- ep_addr == tu_edpt_addr(qhd_pool[i].ep_number, qhd_pool[i].pid) )
- {
- return &qhd_pool[i];
- }
- }
-
- return NULL;
-}
-
-//------------- TD helper -------------//
-static inline ehci_qtd_t* qtd_find_free(void)
-{
- for (uint32_t i=0; i<HCD_MAX_XFER; i++)
- {
- if ( !ehci_data.qtd_pool[i].used ) return &ehci_data.qtd_pool[i];
- }
-
- return NULL;
-}
-
-static inline ehci_qtd_t* qtd_next(ehci_qtd_t const * p_qtd )
-{
- return (ehci_qtd_t*) tu_align32(p_qtd->next.address);
-}
-
-static inline void qtd_remove_1st_from_qhd(ehci_qhd_t *p_qhd)
-{
- if (p_qhd->p_qtd_list_head == p_qhd->p_qtd_list_tail) // last TD --> make it NULL
- {
- p_qhd->p_qtd_list_head = p_qhd->p_qtd_list_tail = NULL;
- }else
- {
- p_qhd->p_qtd_list_head = qtd_next( p_qhd->p_qtd_list_head );
- }
-}
-
-static inline void qtd_insert_to_qhd(ehci_qhd_t *p_qhd, ehci_qtd_t *p_qtd_new)
-{
- if (p_qhd->p_qtd_list_head == NULL) // empty list
- {
- p_qhd->p_qtd_list_head = p_qhd->p_qtd_list_tail = p_qtd_new;
- }else
- {
- p_qhd->p_qtd_list_tail->next.address = (uint32_t) p_qtd_new;
- p_qhd->p_qtd_list_tail = p_qtd_new;
- }
-}
-
-static void qhd_init(ehci_qhd_t *p_qhd, uint8_t dev_addr, tusb_desc_endpoint_t const * ep_desc)
-{
- // address 0 is used as async head, which always on the list --> cannot be cleared (ehci halted otherwise)
- if (dev_addr != 0)
- {
- tu_memclr(p_qhd, sizeof(ehci_qhd_t));
- }
-
- hcd_devtree_info_t devtree_info;
- hcd_devtree_get_info(dev_addr, &devtree_info);
-
- uint8_t const xfer_type = ep_desc->bmAttributes.xfer;
- uint8_t const interval = ep_desc->bInterval;
-
- p_qhd->dev_addr = dev_addr;
- p_qhd->fl_inactive_next_xact = 0;
- p_qhd->ep_number = tu_edpt_number(ep_desc->bEndpointAddress);
- p_qhd->ep_speed = devtree_info.speed;
- p_qhd->data_toggle_control= (xfer_type == TUSB_XFER_CONTROL) ? 1 : 0;
- p_qhd->head_list_flag = (dev_addr == 0) ? 1 : 0; // addr0's endpoint is the static asyn list head
- p_qhd->max_packet_size = ep_desc->wMaxPacketSize.size;
- p_qhd->fl_ctrl_ep_flag = ((xfer_type == TUSB_XFER_CONTROL) && (p_qhd->ep_speed != TUSB_SPEED_HIGH)) ? 1 : 0;
- p_qhd->nak_reload = 0;
-
- // Bulk/Control -> smask = cmask = 0
- // TODO Isochronous
- if (TUSB_XFER_INTERRUPT == xfer_type)
- {
- if (TUSB_SPEED_HIGH == p_qhd->ep_speed)
- {
- TU_ASSERT( interval <= 16, );
- if ( interval < 4) // sub milisecond interval
- {
- p_qhd->interval_ms = 0;
- p_qhd->int_smask = (interval == 1) ? TU_BIN8(11111111) :
- (interval == 2) ? TU_BIN8(10101010) : TU_BIN8(01000100);
- }else
- {
- p_qhd->interval_ms = (uint8_t) tu_min16( 1 << (interval-4), 255 );
- p_qhd->int_smask = TU_BIT(interval % 8);
- }
- }else
- {
- TU_ASSERT( 0 != interval, );
- // Full/Low: 4.12.2.1 (EHCI) case 1 schedule start split at 1 us & complete split at 2,3,4 uframes
- p_qhd->int_smask = 0x01;
- p_qhd->fl_int_cmask = TU_BIN8(11100);
- p_qhd->interval_ms = interval;
- }
- }else
- {
- p_qhd->int_smask = p_qhd->fl_int_cmask = 0;
- }
-
- p_qhd->fl_hub_addr = devtree_info.hub_addr;
- p_qhd->fl_hub_port = devtree_info.hub_port;
- p_qhd->mult = 1; // TODO not use high bandwidth/park mode yet
-
- //------------- HCD Management Data -------------//
- p_qhd->used = 1;
- p_qhd->removing = 0;
- p_qhd->p_qtd_list_head = NULL;
- p_qhd->p_qtd_list_tail = NULL;
- p_qhd->pid = tu_edpt_dir(ep_desc->bEndpointAddress) ? EHCI_PID_IN : EHCI_PID_OUT; // PID for TD under this endpoint
-
- //------------- active, but no TD list -------------//
- p_qhd->qtd_overlay.halted = 0;
- p_qhd->qtd_overlay.next.terminate = 1;
- p_qhd->qtd_overlay.alternate.terminate = 1;
- if (TUSB_XFER_BULK == xfer_type && p_qhd->ep_speed == TUSB_SPEED_HIGH && p_qhd->pid == EHCI_PID_OUT)
- {
- p_qhd->qtd_overlay.ping_err = 1; // do PING for Highspeed Bulk OUT, EHCI section 4.11
- }
-}
-
-static void qtd_init(ehci_qtd_t* p_qtd, void* buffer, uint16_t total_bytes)
-{
- tu_memclr(p_qtd, sizeof(ehci_qtd_t));
-
- p_qtd->used = 1;
-
- p_qtd->next.terminate = 1; // init to null
- p_qtd->alternate.terminate = 1; // not used, always set to terminated
- p_qtd->active = 1;
- p_qtd->err_count = 3; // TODO 3 consecutive errors tolerance
- p_qtd->data_toggle = 0;
- p_qtd->total_bytes = total_bytes;
- p_qtd->expected_bytes = total_bytes;
-
- p_qtd->buffer[0] = (uint32_t) buffer;
- for(uint8_t i=1; i<5; i++)
- {
- p_qtd->buffer[i] |= tu_align4k( p_qtd->buffer[i-1] ) + 4096;
- }
-}
-
-//------------- List Managing Helper -------------//
-static inline void list_insert(ehci_link_t *current, ehci_link_t *new, uint8_t new_type)
-{
- new->address = current->address;
- current->address = ((uint32_t) new) | (new_type << 1);
-}
-
-static inline ehci_link_t* list_next(ehci_link_t *p_link_pointer)
-{
- return (ehci_link_t*) tu_align32(p_link_pointer->address);
-}
-
-#endif
diff --git a/tinyusb/src/portable/ehci/ehci.h b/tinyusb/src/portable/ehci/ehci.h
deleted file mode 100755
index c2bee67a..00000000
--- a/tinyusb/src/portable/ehci/ehci.h
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_EHCI_H_
-#define _TUSB_EHCI_H_
-
-
-/* Abbreviation
- * HC: Host Controller
- * HCD: Host Controller Driver
- * QHD: Queue Head for non-ISO transfer
- * QTD: Queue Transfer Descriptor for non-ISO transfer
- * ITD: Iso Transfer Descriptor for highspeed
- * SITD: Split ISO Transfer Descriptor for full-speed
- * SMASK: Start Split mask for Slipt Transaction
- * CMASK: Complete Split mask for Slipt Transaction
-*/
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// EHCI CONFIGURATION & CONSTANTS
-//--------------------------------------------------------------------+
-
-// TODO merge OHCI with EHCI
-enum {
- EHCI_MAX_ITD = 4,
- EHCI_MAX_SITD = 16
-};
-
-//--------------------------------------------------------------------+
-// EHCI Data Structure
-//--------------------------------------------------------------------+
-enum
-{
- EHCI_QTYPE_ITD = 0 ,
- EHCI_QTYPE_QHD ,
- EHCI_QTYPE_SITD ,
- EHCI_QTYPE_FSTN
-};
-
-/// EHCI PID
-enum
-{
- EHCI_PID_OUT = 0 ,
- EHCI_PID_IN ,
- EHCI_PID_SETUP
-};
-
-/// Link pointer
-typedef union {
- uint32_t address;
- struct {
- uint32_t terminate : 1;
- uint32_t type : 2;
- };
-}ehci_link_t;
-
-/// Queue Element Transfer Descriptor
-/// Qtd is used to declare overlay in ehci_qhd_t -> cannot be declared with TU_ATTR_ALIGNED(32)
-typedef struct
-{
- // Word 0: Next QTD Pointer
- ehci_link_t next;
-
- // Word 1: Alternate Next QTD Pointer (not used)
- union{
- ehci_link_t alternate;
- struct {
- uint32_t : 5;
- uint32_t used : 1;
- uint32_t : 10;
- uint32_t expected_bytes : 16;
- };
- };
-
- // Word 2: qTQ Token
- volatile uint32_t ping_err : 1 ; ///< For Highspeed: 0 Out, 1 Ping. Full/Slow used as error indicator
- volatile uint32_t non_hs_split_state : 1 ; ///< Used by HC to track the state of slipt transaction
- volatile uint32_t non_hs_missed_uframe : 1 ; ///< HC misses a complete slip transaction
- volatile uint32_t xact_err : 1 ; ///< Error (Timeout, CRC, Bad PID ... )
- volatile uint32_t babble_err : 1 ; ///< Babble detected, also set Halted bit to 1
- volatile uint32_t buffer_err : 1 ; ///< Data overrun/underrun error
- volatile uint32_t halted : 1 ; ///< Serious error or STALL received
- volatile uint32_t active : 1 ; ///< Start transfer, clear by HC when complete
-
- uint32_t pid : 2 ; ///< 0: OUT, 1: IN, 2 Setup
- volatile uint32_t err_count : 2 ; ///< Error Counter of consecutive errors
- volatile uint32_t current_page : 3 ; ///< Index into the qTD buffer pointer list
- uint32_t int_on_complete : 1 ; ///< Interrupt on complete
- volatile uint32_t total_bytes : 15 ; ///< Transfer bytes, decreased during transaction
- volatile uint32_t data_toggle : 1 ; ///< Data Toogle bit
-
-
- /// Buffer Page Pointer List, Each element in the list is a 4K page aligned, physical memory address. The lower 12 bits in each pointer are reserved (except for the first one) as each memory pointer must reference the start of a 4K page
- uint32_t buffer[5];
-} ehci_qtd_t;
-
-TU_VERIFY_STATIC( sizeof(ehci_qtd_t) == 32, "size is not correct" );
-
-/// Queue Head
-typedef struct TU_ATTR_ALIGNED(32)
-{
- // Word 0: Next QHD
- ehci_link_t next;
-
- // Word 1: Endpoint Characteristics
- uint32_t dev_addr : 7 ; ///< device address
- uint32_t fl_inactive_next_xact : 1 ; ///< Only valid for Periodic with Full/Slow speed
- uint32_t ep_number : 4 ; ///< EP number
- uint32_t ep_speed : 2 ; ///< 0: Full, 1: Low, 2: High
- uint32_t data_toggle_control : 1 ; ///< 0: use DT in qHD, 1: use DT in qTD
- uint32_t head_list_flag : 1 ; ///< Head of the queue
- uint32_t max_packet_size : 11 ; ///< Max packet size
- uint32_t fl_ctrl_ep_flag : 1 ; ///< 1 if is Full/Low speed control endpoint
- uint32_t nak_reload : 4 ; ///< Used by HC
-
- // Word 2: Endpoint Capabilities
- uint32_t int_smask : 8 ; ///< Interrupt Schedule Mask
- uint32_t fl_int_cmask : 8 ; ///< Split Completion Mask for Full/Slow speed
- uint32_t fl_hub_addr : 7 ; ///< Hub Address for Full/Slow speed
- uint32_t fl_hub_port : 7 ; ///< Hub Port for Full/Slow speed
- uint32_t mult : 2 ; ///< Transaction per micro frame
-
- // Word 3: Current qTD Pointer
- volatile uint32_t qtd_addr;
-
- // Word 4-11: Transfer Overlay
- volatile ehci_qtd_t qtd_overlay;
-
- //--------------------------------------------------------------------+
- /// Due to the fact QHD is 32 bytes aligned but occupies only 48 bytes
- /// thus there are 16 bytes padding free that we can make use of.
- //--------------------------------------------------------------------+
- uint8_t used;
- uint8_t removing; // removed from asyn list, waiting for async advance
- uint8_t pid;
- uint8_t interval_ms; // polling interval in frames (or milisecond)
-
- uint16_t total_xferred_bytes; // number of bytes xferred until a qtd with ioc bit set
- uint8_t reserved2[2];
-
- ehci_qtd_t * volatile p_qtd_list_head; // head of the scheduled TD list
- ehci_qtd_t * volatile p_qtd_list_tail; // tail of the scheduled TD list
-} ehci_qhd_t;
-
-TU_VERIFY_STATIC( sizeof(ehci_qhd_t) == 64, "size is not correct" );
-
-/// Highspeed Isochronous Transfer Descriptor (section 3.3)
-typedef struct TU_ATTR_ALIGNED(32) {
- // Word 0: Next Link Pointer
- ehci_link_t next;
-
- // Word 1-8: iTD Transaction Status and Control List
- struct {
- // iTD Control
- volatile uint32_t offset : 12 ; ///< This field is a value that is an offset, expressed in bytes, from the beginning of a buffer.
- volatile uint32_t page_select : 3 ; ///< These bits are set by software to indicate which of the buffer page pointers the offset field in this slot should be concatenated to produce the starting memory address for this transaction. The valid range of values for this field is 0 to 6
- uint32_t int_on_complete : 1 ; ///< If this bit is set to a one, it specifies that when this transaction completes, the Host Controller should issue an interrupt at the next interrupt threshold
- volatile uint32_t length : 12 ; ///< For an OUT, this field is the number of data bytes the host controller will send during the transaction. The host controller is not required to update this field to reflect the actual number of bytes transferred during the transfer
- ///< For an IN, the initial value of the field is the number of bytes the host expects the endpoint to deliver. During the status update, the host controller writes back the number of bytes successfully received. The value in this register is the actual byte count
- // iTD Status
- volatile uint32_t error : 1 ; ///< Set to a one by the Host Controller during status update in the case where the host did not receive a valid response from the device (Timeout, CRC, Bad PID, etc.). This bit may only be set for isochronous IN transactions.
- volatile uint32_t babble_err : 1 ; ///< Set to a 1 by the Host Controller during status update when a babble is detected during the transaction
- volatile uint32_t buffer_err : 1 ; ///< Set to a 1 by the Host Controller during status update to indicate that the Host Controller is unable to keep up with the reception of incoming data (overrun) or is unable to supply data fast enough during transmission (underrun).
- volatile uint32_t active : 1 ; ///< Set to 1 by software to enable the execution of an isochronous transaction by the Host Controller
- } xact[8];
-
- // Word 9-15 Buffer Page Pointer List (Plus)
- uint32_t BufferPointer[7];
-
-// // FIXME: Store meta data into buffer pointer reserved for saving memory
-// /*---------- HCD Area ----------*/
-// uint32_t used;
-// uint32_t IhdIdx;
-// uint32_t reserved[6];
-} ehci_itd_t;
-
-TU_VERIFY_STATIC( sizeof(ehci_itd_t) == 64, "size is not correct" );
-
-/// Split (Full-Speed) Isochronous Transfer Descriptor
-typedef struct TU_ATTR_ALIGNED(32)
-{
- // Word 0: Next Link Pointer
- ehci_link_t next;
-
- // Word 1: siTD Endpoint Characteristics
- uint32_t dev_addr : 7; ///< This field selects the specific device serving as the data source or sink.
- uint32_t : 1; ///< reserved
- uint32_t ep_number : 4; ///< This 4-bit field selects the particular endpoint number on the device serving as the data source or sink.
- uint32_t : 4; ///< This field is reserved and should be set to zero.
- uint32_t hub_addr : 7; ///< This field holds the device address of the transaction translators’ hub.
- uint32_t : 1; ///< reserved
- uint32_t port_number : 7; ///< This field is the port number of the recipient transaction translator.
- uint32_t direction : 1; ///< 0 = OUT; 1 = IN. This field encodes whether the full-speed transaction should be an IN or OUT.
-
- // Word 2: Micro-frame Schedule Control
- uint8_t int_smask ; ///< This field (along with the Activeand SplitX-statefields in the Statusbyte) are used to determine during which micro-frames the host controller should execute complete-split transactions
- uint8_t fl_int_cmask; ///< This field (along with the Activeand SplitX-statefields in the Statusbyte) are used to determine during which micro-frames the host controller should execute start-split transactions.
- uint16_t reserved ; ///< reserved
-
- // Word 3: siTD Transfer Status and Control
- // Status [7:0] TODO indentical to qTD Token'status --> refractor later
- volatile uint32_t : 1 ; // reserved
- volatile uint32_t split_state : 1 ;
- volatile uint32_t missed_uframe : 1 ;
- volatile uint32_t xact_err : 1 ;
- volatile uint32_t babble_err : 1 ;
- volatile uint32_t buffer_err : 1 ;
- volatile uint32_t error : 1 ;
- volatile uint32_t active : 1 ;
- // Micro-frame Schedule Control
- volatile uint32_t cmask_progress : 8 ; ///< This field is used by the host controller to record which split-completes have been executed. See Section 4.12.3.3.2 for behavioral requirements.
- volatile uint32_t total_bytes : 10 ; ///< This field is initialized by software to the total number of bytes expected in this transfer. Maximum value is 1023
- volatile uint32_t : 4 ; ///< reserved
- volatile uint32_t page_select : 1 ; ///< Used to indicate which data page pointer should be concatenated with the CurrentOffsetfield to construct a data buffer pointer
- uint32_t int_on_complete : 1 ; ///< Do not interrupt when transaction is complete. 1 = Do interrupt when transaction is complete
- uint32_t : 0 ; // padding to the end of current storage unit
-
- /// Word 4-5: Buffer Pointer List
- uint32_t buffer[2]; // buffer[1] TP: Transaction Position - T-Count: Transaction Count
-
-// union{
-// uint32_t BufferPointer1;
-// struct {
-// volatile uint32_t TCount : 3;
-// volatile uint32_t TPosition : 2;
-// };
-// };
-
- /*---------- Word 6 ----------*/
- ehci_link_t back;
-
- /// SITD is 32-byte aligned but occupies only 28 --> 4 bytes for storing extra data
- uint8_t used;
- uint8_t ihd_idx;
- uint8_t reserved2[2];
-} ehci_sitd_t;
-
-TU_VERIFY_STATIC( sizeof(ehci_sitd_t) == 32, "size is not correct" );
-
-//--------------------------------------------------------------------+
-// EHCI Operational Register
-//--------------------------------------------------------------------+
-enum ehci_interrupt_mask_{
- EHCI_INT_MASK_USB = TU_BIT(0),
- EHCI_INT_MASK_ERROR = TU_BIT(1),
- EHCI_INT_MASK_PORT_CHANGE = TU_BIT(2),
-
- EHCI_INT_MASK_FRAMELIST_ROLLOVER = TU_BIT(3),
- EHCI_INT_MASK_PCI_HOST_SYSTEM_ERROR = TU_BIT(4),
- EHCI_INT_MASK_ASYNC_ADVANCE = TU_BIT(5),
- EHCI_INT_MASK_NXP_SOF = TU_BIT(7),
-
- EHCI_INT_MASK_NXP_ASYNC = TU_BIT(18),
- EHCI_INT_MASK_NXP_PERIODIC = TU_BIT(19),
-
- EHCI_INT_MASK_ALL =
- EHCI_INT_MASK_USB | EHCI_INT_MASK_ERROR | EHCI_INT_MASK_PORT_CHANGE |
- EHCI_INT_MASK_FRAMELIST_ROLLOVER | EHCI_INT_MASK_PCI_HOST_SYSTEM_ERROR |
- EHCI_INT_MASK_ASYNC_ADVANCE | EHCI_INT_MASK_NXP_SOF |
- EHCI_INT_MASK_NXP_ASYNC | EHCI_INT_MASK_NXP_PERIODIC
-};
-
-enum ehci_usbcmd_pos_ {
- EHCI_USBCMD_POS_RUN_STOP = 0,
- EHCI_USBCMD_POS_FRAMELIST_SIZE = 2,
- EHCI_USBCMD_POS_PERIOD_ENABLE = 4,
- EHCI_USBCMD_POS_ASYNC_ENABLE = 5,
- EHCI_USBCMD_POS_NXP_FRAMELIST_SIZE_MSB = 15,
- EHCI_USBCMD_POS_INTERRUPT_THRESHOLD = 16
-};
-
-enum ehci_portsc_change_mask_{
- EHCI_PORTSC_MASK_CURRENT_CONNECT_STATUS = TU_BIT(0),
- EHCI_PORTSC_MASK_CONNECT_STATUS_CHANGE = TU_BIT(1),
- EHCI_PORTSC_MASK_PORT_EANBLED = TU_BIT(2),
- EHCI_PORTSC_MASK_PORT_ENABLE_CHAGNE = TU_BIT(3),
- EHCI_PORTSC_MASK_OVER_CURRENT_CHANGE = TU_BIT(5),
- EHCI_PORTSC_MASK_PORT_RESET = TU_BIT(8),
-
- EHCI_PORTSC_MASK_ALL =
- EHCI_PORTSC_MASK_CONNECT_STATUS_CHANGE |
- EHCI_PORTSC_MASK_PORT_ENABLE_CHAGNE |
- EHCI_PORTSC_MASK_OVER_CURRENT_CHANGE
-};
-
-typedef volatile struct
-{
- union {
- uint32_t command;
-
- struct {
- uint32_t run_stop : 1 ; ///< 1=Run. 0=Stop
- uint32_t reset : 1 ; ///< SW write 1 to reset HC, clear by HC when complete
- uint32_t framelist_size : 2 ; ///< Frame List size 0: 1024, 1: 512, 2: 256
- uint32_t periodic_enable : 1 ; ///< This bit controls whether the host controller skips processing the Periodic Schedule. Values mean: 0b Do not process the Periodic Schedule 1b Use the PERIODICLISTBASE register to access the Periodic Schedule.
- uint32_t async_enable : 1 ; ///< This bit controls whether the host controller skips processing the Asynchronous Schedule. Values mean: 0b Do not process the Asynchronous Schedule 1b Use the ASYNCLISTADDR register to access the Asynchronous Schedule.
- uint32_t async_adv_doorbell : 1 ; ///< Tell HC to interrupt next time it advances async list. Clear by HC
- uint32_t light_reset : 1 ; ///< Reset HC without affecting ports state
- uint32_t async_park_count : 2 ; ///< not used by tinyusb
- uint32_t : 1 ;
- uint32_t async_park_enable : 1 ; ///< Enable park mode, not used by tinyusb
- uint32_t : 3 ;
- uint32_t nxp_framelist_size_msb : 1 ; ///< NXP customized : Bit 2 of the Frame List Size bits \n 011b: 128 elements \n 100b: 64 elements \n 101b: 32 elements \n 110b: 16 elements \n 111b: 8 elements
- uint32_t int_threshold : 8 ; ///< Default 08h. Interrupt rate in unit of micro frame
- }command_bm;
- };
-
- union {
- uint32_t status;
-
- struct {
- uint32_t usb : 1 ; ///< qTD with IOC is retired
- uint32_t usb_error : 1 ; ///< qTD retired due to error
- uint32_t port_change_detect : 1 ; ///< Set when PortOwner or ForcePortResume change from 0 -> 1
- uint32_t framelist_rollover : 1 ; ///< R/WC The Host Controller sets this bit to a one when the Frame List Index(see Section 2.3.4) rolls over from its maximum value to zero. The exact value at which the rollover occurs depends on the frame list size. For example, if the frame list size (as programmed in the Frame List Sizefield of the USBCMD register) is 1024, the Frame Index Registerrolls over every time FRINDEX[13] toggles. Similarly, if the size is 512, the Host Controller sets this bit to a one every time FRINDEX[12] toggles.
- uint32_t pci_host_system_error : 1 ; ///< R/WC (not used by NXP) The Host Controller sets this bit to 1 when a serious error occurs during a host system access involving the Host Controller module. In a PCI system, conditions that set this bit to 1 include PCI Parity error, PCI Master Abort, and PCI Target Abort. When this error occurs, the Host Controller clears the Run/Stop bit in the Command register to prevent further execution of the scheduled TDs.
- uint32_t async_adv : 1 ; ///< Async Advance interrupt
- uint32_t : 1 ;
- uint32_t nxp_int_sof : 1 ; ///< NXP customized: this bit will be set every 125us and can be used by host controller driver as a time base.
- uint32_t : 4 ;
- uint32_t hc_halted : 1 ; ///< Opposite value to run_stop bit.
- uint32_t reclamation : 1 ; ///< Used to detect empty async shecudle
- uint32_t periodic_status : 1 ; ///< Periodic schedule status
- uint32_t async_status : 1 ; ///< Async schedule status
- uint32_t : 2 ;
- uint32_t nxp_int_async : 1 ; ///< NXP customized: This bit is set by the Host Controller when the cause of an interrupt is a completion of a USB transaction where the Transfer Descriptor (TD) has an interrupt on complete (IOC) bit set andthe TD was from the asynchronous schedule. This bit is also set by the Host when a short packet is detected andthe packet is on the asynchronous schedule.
- uint32_t nxp_int_period : 1 ; ///< NXP customized: This bit is set by the Host Controller when the cause of an interrupt is a completion of a USB transaction where the Transfer Descriptor (TD) has an interrupt on complete (IOC) bit set andthe TD was from the periodic schedule.
- uint32_t : 12 ;
- }status_bm;
- };
-
- union{
- uint32_t inten;
-
- struct {
- uint32_t usb : 1 ;
- uint32_t usb_error : 1 ;
- uint32_t port_change_detect : 1 ;
- uint32_t framelist_rollover : 1 ;
- uint32_t pci_host_system_error : 1 ;
- uint32_t async_adv : 1 ;
- uint32_t : 1 ;
- uint32_t nxp_int_sof : 1 ;
- uint32_t : 10 ;
- uint32_t nxp_int_async : 1 ;
- uint32_t nxp_int_period : 1 ;
- uint32_t : 12 ;
- }inten_bm;
- };
-
- uint32_t frame_index ; ///< Micro frame counter
- uint32_t ctrl_ds_seg ; ///< Control Data Structure Segment
- uint32_t periodic_list_base ; ///< Beginning address of perodic frame list
- uint32_t async_list_addr ; ///< Address of next async QHD to be executed
- uint32_t nxp_tt_control ; ///< nxp embedded transaction translator (reserved by EHCI specs)
- uint32_t reserved[8] ;
- uint32_t config_flag ; ///< not used by NXP
-
- union {
- uint32_t portsc ; ///< port status and control
- struct {
- uint32_t current_connect_status : 1; ///< 0: No device, 1: Device is present on port
- uint32_t connect_status_change : 1; ///< Change in Current Connect Status
- uint32_t port_enabled : 1; ///< Ports can only be enabled by HC as a part of the reset and enable. SW can write 0 to disable
- uint32_t port_enable_change : 1; ///< Port Enabled has changed
- uint32_t over_current_active : 1; ///< Port has an over-current condition
- uint32_t over_current_change : 1; ///< Change to Over-current Active
- uint32_t force_port_resume : 1; ///< Resume detected/driven on port. This functionality defined for manipulating this bit depends on the value of the Suspend bit.
- uint32_t suspend : 1; ///< Port in suspend state
- uint32_t port_reset : 1; ///< 1=Port is in Reset. 0=Port is not in Reset
- uint32_t nxp_highspeed_status : 1; ///< NXP customized: 0=connected to the port is not in High-speed mode, 1=connected to the port is in High-speed mode
- uint32_t line_status : 2; ///< D+/D- state: 00: SE0, 10: J-state, 01: K-state
- uint32_t port_power : 1; ///< 0= power off, 1= power on
- uint32_t port_owner : 1; ///< not used by NXP
- uint32_t port_indicator_control : 2; ///< 00b: off, 01b: Amber, 10b: green, 11b: undefined
- uint32_t port_test_control : 4; ///< Port test mode, not used by tinyusb
- uint32_t wake_on_connect_enable : 1; ///< Enables device connects as wake-up events
- uint32_t wake_on_disconnect_enable : 1; ///< Enables device disconnects as wake-up events
- uint32_t wake_on_over_current_enable : 1; ///< Enables over-current conditions as wake-up events
- uint32_t nxp_phy_clock_disable : 1; ///< NXP customized: the PHY can be put into Low Power Suspend – Clock Disable when the downstream device has been put into suspend mode or when no downstream device is connected. Low power suspend is completely under the control of software. 0: enable PHY clock, 1: disable PHY clock
- uint32_t nxp_port_force_fullspeed : 1; ///< NXP customized: Writing this bit to a 1 will force the port to only connect at Full Speed. It disables the chirp sequence that allowsthe port to identify itself as High Speed. This is useful for testing FS configurations with a HS host, hub or device.
- uint32_t TU_RESERVED : 1;
- uint32_t nxp_port_speed : 2; ///< NXP customized: This register field indicates the speed atwhich the port is operating. For HS mode operation in the host controllerand HS/FS operation in the device controller the port routing steers data to the Protocol engine. For FS and LS mode operation in the host controller, the port routing steers data to the Protocol Engine w/ Embedded Transaction Translator. 0x0: Fullspeed, 0x1: Lowspeed, 0x2: Highspeed
- uint32_t TU_RESERVED : 4;
- }portsc_bm;
- };
-}ehci_registers_t;
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_EHCI_H_ */
diff --git a/tinyusb/src/portable/ehci/ehci_api.h b/tinyusb/src/portable/ehci/ehci_api.h
deleted file mode 100755
index 12e0a73d..00000000
--- a/tinyusb/src/portable/ehci/ehci_api.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_EHCI_API_H_
-#define _TUSB_EHCI_API_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// API Implemented by EHCI
-//--------------------------------------------------------------------+
-
-// Initialize EHCI driver
-bool ehci_init(uint8_t rhport, uint32_t capability_reg, uint32_t operatial_reg);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c b/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c
deleted file mode 100755
index d728487c..00000000
--- a/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c
+++ /dev/null
@@ -1,867 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018 Scott Shawcroft, 2019 William D. Jones for Adafruit Industries
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- * Additions Copyright (c) 2020, Espressif Systems (Shanghai) Co. Ltd.
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if (((CFG_TUSB_MCU == OPT_MCU_ESP32S2) || (CFG_TUSB_MCU == OPT_MCU_ESP32S3)) && TUSB_OPT_DEVICE_ENABLED)
-
-// Espressif
-#include "driver/periph_ctrl.h"
-#include "freertos/xtensa_api.h"
-#include "esp_intr_alloc.h"
-#include "esp_log.h"
-#include "driver/gpio.h"
-#include "soc/dport_reg.h"
-#include "soc/gpio_sig_map.h"
-#include "soc/usb_periph.h"
-
-#include "device/dcd.h"
-
-// Since TinyUSB doesn't use SOF for now, and this interrupt too often (1ms interval)
-// We disable SOF for now until needed later on
-#define USE_SOF 0
-
-// Max number of bi-directional endpoints including EP0
-// Note: ESP32S2 specs say there are only up to 5 IN active endpoints include EP0
-// We should probably prohibit enabling Endpoint IN > 4 (not done yet)
-#define EP_MAX USB_OUT_EP_NUM
-
-// FIFO size in bytes
-#define EP_FIFO_SIZE 1024
-
-// Max number of IN EP FIFOs
-#define EP_FIFO_NUM 5
-
-typedef struct {
- uint8_t *buffer;
- // tu_fifo_t * ff; // TODO support dcd_edpt_xfer_fifo API
- uint16_t total_len;
- uint16_t queued_len;
- uint16_t max_size;
- bool short_packet;
-} xfer_ctl_t;
-
-static const char *TAG = "TUSB:DCD";
-static intr_handle_t usb_ih;
-
-
-static uint32_t _setup_packet[2];
-
-#define XFER_CTL_BASE(_ep, _dir) &xfer_status[_ep][_dir]
-static xfer_ctl_t xfer_status[EP_MAX][2];
-
-// Keep count of how many FIFOs are in use
-static uint8_t _allocated_fifos = 1; //FIFO0 is always in use
-
-// Will either return an unused FIFO number, or 0 if all are used.
-static uint8_t get_free_fifo(void)
-{
- if (_allocated_fifos < EP_FIFO_NUM) return _allocated_fifos++;
- return 0;
-}
-
-// Setup the control endpoint 0.
-static void bus_reset(void)
-{
- for (int ep_num = 0; ep_num < USB_OUT_EP_NUM; ep_num++) {
- USB0.out_ep_reg[ep_num].doepctl |= USB_DO_SNAK0_M; // DOEPCTL0_SNAK
- }
-
- USB0.dcfg &= ~USB_DEVADDR_M; // reset address
-
- USB0.daintmsk |= USB_OUTEPMSK0_M | USB_INEPMSK0_M;
- USB0.doepmsk |= USB_SETUPMSK_M | USB_XFERCOMPLMSK;
- USB0.diepmsk |= USB_TIMEOUTMSK_M | USB_DI_XFERCOMPLMSK_M /*| USB_INTKNTXFEMPMSK_M*/;
-
- // "USB Data FIFOs" section in reference manual
- // Peripheral FIFO architecture
- //
- // --------------- 320 or 1024 ( 1280 or 4096 bytes )
- // | IN FIFO MAX |
- // ---------------
- // | ... |
- // --------------- y + x + 16 + GRXFSIZ
- // | IN FIFO 2 |
- // --------------- x + 16 + GRXFSIZ
- // | IN FIFO 1 |
- // --------------- 16 + GRXFSIZ
- // | IN FIFO 0 |
- // --------------- GRXFSIZ
- // | OUT FIFO |
- // | ( Shared ) |
- // --------------- 0
- //
- // According to "FIFO RAM allocation" section in RM, FIFO RAM are allocated as follows (each word 32-bits):
- // - Each EP IN needs at least max packet size, 16 words is sufficient for EP0 IN
- //
- // - All EP OUT shared a unique OUT FIFO which uses
- // * 10 locations in hardware for setup packets + setup control words (up to 3 setup packets).
- // * 2 locations for OUT endpoint control words.
- // * 16 for largest packet size of 64 bytes. ( TODO Highspeed is 512 bytes)
- // * 1 location for global NAK (not required/used here).
- // * It is recommended to allocate 2 times the largest packet size, therefore
- // Recommended value = 10 + 1 + 2 x (16+2) = 47 --> Let's make it 52
- USB0.grstctl |= 0x10 << USB_TXFNUM_S; // fifo 0x10,
- USB0.grstctl |= USB_TXFFLSH_M; // Flush fifo
- USB0.grxfsiz = 52;
-
- // Control IN uses FIFO 0 with 64 bytes ( 16 32-bit word )
- USB0.gnptxfsiz = (16 << USB_NPTXFDEP_S) | (USB0.grxfsiz & 0x0000ffffUL);
-
- // Ready to receive SETUP packet
- USB0.out_ep_reg[0].doeptsiz |= USB_SUPCNT0_M;
-
- USB0.gintmsk |= USB_IEPINTMSK_M | USB_OEPINTMSK_M;
-}
-
-static void enum_done_processing(void)
-{
- ESP_EARLY_LOGV(TAG, "dcd_int_handler - Speed enumeration done! Sending DCD_EVENT_BUS_RESET then");
- // On current silicon on the Full Speed core, speed is fixed to Full Speed.
- // However, keep for debugging and in case Low Speed is ever supported.
- uint32_t enum_spd = (USB0.dsts >> USB_ENUMSPD_S) & (USB_ENUMSPD_V);
-
- // Maximum packet size for EP 0 is set for both directions by writing DIEPCTL
- if (enum_spd == 0x03) { // Full-Speed (PHY on 48 MHz)
- USB0.in_ep_reg[0].diepctl &= ~USB_D_MPS0_V; // 64 bytes
- USB0.in_ep_reg[0].diepctl &= ~USB_D_STALL0_M; // clear Stall
- xfer_status[0][TUSB_DIR_OUT].max_size = 64;
- xfer_status[0][TUSB_DIR_IN].max_size = 64;
- } else {
- USB0.in_ep_reg[0].diepctl |= USB_D_MPS0_V; // 8 bytes
- USB0.in_ep_reg[0].diepctl &= ~USB_D_STALL0_M; // clear Stall
- xfer_status[0][TUSB_DIR_OUT].max_size = 8;
- xfer_status[0][TUSB_DIR_IN].max_size = 8;
- }
-}
-
-
-/*------------------------------------------------------------------*/
-/* Controller API
- *------------------------------------------------------------------*/
-void dcd_init(uint8_t rhport)
-{
- ESP_LOGV(TAG, "DCD init - Start");
-
- // A. Disconnect
- ESP_LOGV(TAG, "DCD init - Soft DISCONNECT and Setting up");
- USB0.dctl |= USB_SFTDISCON_M; // Soft disconnect
-
- // B. Programming DCFG
- /* If USB host misbehaves during status portion of control xfer
- (non zero-length packet), send STALL back and discard. Full speed. */
- USB0.dcfg |= USB_NZSTSOUTHSHK_M | // NonZero .... STALL
- (3 << 0); // dev speed: fullspeed 1.1 on 48 mhz // TODO no value in usb_reg.h (IDF-1476)
-
- USB0.gahbcfg |= USB_NPTXFEMPLVL_M | USB_GLBLLNTRMSK_M; // Global interruptions ON
- USB0.gusbcfg |= USB_FORCEDEVMODE_M; // force devmode
- USB0.gotgctl &= ~(USB_BVALIDOVVAL_M | USB_BVALIDOVEN_M | USB_VBVALIDOVVAL_M); //no overrides
-
- // C. Setting SNAKs, then connect
- for (int n = 0; n < USB_OUT_EP_NUM; n++) {
- USB0.out_ep_reg[n].doepctl |= USB_DO_SNAK0_M; // DOEPCTL0_SNAK
- }
-
- // D. Interruption masking
- USB0.gintmsk = 0; //mask all
- USB0.gotgint = ~0U; //clear OTG ints
- USB0.gintsts = ~0U; //clear pending ints
- USB0.gintmsk = USB_OTGINTMSK_M |
- USB_MODEMISMSK_M |
- #if USE_SOF
- USB_SOFMSK_M |
- #endif
- USB_RXFLVIMSK_M |
- USB_ERLYSUSPMSK_M |
- USB_USBSUSPMSK_M |
- USB_USBRSTMSK_M |
- USB_ENUMDONEMSK_M |
- USB_RESETDETMSK_M |
- USB_DISCONNINTMSK_M; // host most only
-
- dcd_connect(rhport);
-}
-
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- (void)rhport;
- ESP_LOGV(TAG, "DCD init - Set address : %u", dev_addr);
- USB0.dcfg |= ((dev_addr & USB_DEVADDR_V) << USB_DEVADDR_S);
- // Response with status after changing device address
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void)rhport;
-
- // TODO must manually clear this bit after 1-15 ms
- // USB0.DCTL |= USB_RMTWKUPSIG_M;
-}
-
-// connect by enabling internal pull-up resistor on D+/D-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- USB0.dctl &= ~USB_SFTDISCON_M;
-}
-
-// disconnect by disabling internal pull-up resistor on D+/D-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- USB0.dctl |= USB_SFTDISCON_M;
-}
-
-/*------------------------------------------------------------------*/
-/* DCD Endpoint port
- *------------------------------------------------------------------*/
-
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const *desc_edpt)
-{
- ESP_LOGV(TAG, "DCD endpoint opened");
- (void)rhport;
-
- usb_out_endpoint_t *out_ep = &(USB0.out_ep_reg[0]);
- usb_in_endpoint_t *in_ep = &(USB0.in_ep_reg[0]);
-
- uint8_t const epnum = tu_edpt_number(desc_edpt->bEndpointAddress);
- uint8_t const dir = tu_edpt_dir(desc_edpt->bEndpointAddress);
-
- TU_ASSERT(desc_edpt->wMaxPacketSize.size <= 64);
- TU_ASSERT(epnum < EP_MAX);
-
- xfer_ctl_t *xfer = XFER_CTL_BASE(epnum, dir);
- xfer->max_size = desc_edpt->wMaxPacketSize.size;
-
- if (dir == TUSB_DIR_OUT) {
- out_ep[epnum].doepctl |= USB_USBACTEP0_M |
- desc_edpt->bmAttributes.xfer << USB_EPTYPE0_S |
- desc_edpt->wMaxPacketSize.size << USB_MPS0_S;
- USB0.daintmsk |= (1 << (16 + epnum));
- } else {
- // "USB Data FIFOs" section in reference manual
- // Peripheral FIFO architecture
- //
- // --------------- 320 or 1024 ( 1280 or 4096 bytes )
- // | IN FIFO MAX |
- // ---------------
- // | ... |
- // --------------- y + x + 16 + GRXFSIZ
- // | IN FIFO 2 |
- // --------------- x + 16 + GRXFSIZ
- // | IN FIFO 1 |
- // --------------- 16 + GRXFSIZ
- // | IN FIFO 0 |
- // --------------- GRXFSIZ
- // | OUT FIFO |
- // | ( Shared ) |
- // --------------- 0
- //
- // Since OUT FIFO = GRXFSIZ, FIFO 0 = 16, for simplicity, we equally allocated for the rest of endpoints
- // - Size : (FIFO_SIZE/4 - GRXFSIZ - 16) / (EP_MAX-1)
- // - Offset: GRXFSIZ + 16 + Size*(epnum-1)
- // - IN EP 1 gets FIFO 1, IN EP "n" gets FIFO "n".
-
- uint8_t fifo_num = get_free_fifo();
- TU_ASSERT(fifo_num != 0);
-
- in_ep[epnum].diepctl &= ~(USB_D_TXFNUM1_M | USB_D_EPTYPE1_M | USB_DI_SETD0PID1 | USB_D_MPS1_M);
- in_ep[epnum].diepctl |= USB_D_USBACTEP1_M |
- fifo_num << USB_D_TXFNUM1_S |
- desc_edpt->bmAttributes.xfer << USB_D_EPTYPE1_S |
- (desc_edpt->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS ? (1 << USB_DI_SETD0PID1_S) : 0) |
- desc_edpt->wMaxPacketSize.size << 0;
-
- USB0.daintmsk |= (1 << (0 + epnum));
-
- // Both TXFD and TXSA are in unit of 32-bit words.
- // IN FIFO 0 was configured during enumeration, hence the "+ 16".
- uint16_t const allocated_size = (USB0.grxfsiz & 0x0000ffff) + 16;
- uint16_t const fifo_size = (EP_FIFO_SIZE/4 - allocated_size) / (EP_FIFO_NUM-1);
- uint32_t const fifo_offset = allocated_size + fifo_size*(fifo_num-1);
-
- // DIEPTXF starts at FIFO #1.
- USB0.dieptxf[epnum - 1] = (fifo_size << USB_NPTXFDEP_S) | fifo_offset;
- }
- return true;
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t total_bytes)
-{
- (void)rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
- xfer->buffer = buffer;
- // xfer->ff = NULL; // TODO support dcd_edpt_xfer_fifo API
- xfer->total_len = total_bytes;
- xfer->queued_len = 0;
- xfer->short_packet = false;
-
- uint16_t num_packets = (total_bytes / xfer->max_size);
- uint8_t short_packet_size = total_bytes % xfer->max_size;
-
- // Zero-size packet is special case.
- if (short_packet_size > 0 || (total_bytes == 0)) {
- num_packets++;
- }
-
- ESP_LOGV(TAG, "Transfer <-> EP%i, %s, pkgs: %i, bytes: %i",
- epnum, ((dir == TUSB_DIR_IN) ? "USB0.HOST (in)" : "HOST->DEV (out)"),
- num_packets, total_bytes);
-
- // IN and OUT endpoint xfers are interrupt-driven, we just schedule them
- // here.
- if (dir == TUSB_DIR_IN) {
- // A full IN transfer (multiple packets, possibly) triggers XFRC.
- USB0.in_ep_reg[epnum].dieptsiz = (num_packets << USB_D_PKTCNT0_S) | total_bytes;
- USB0.in_ep_reg[epnum].diepctl |= USB_D_EPENA1_M | USB_D_CNAK1_M; // Enable | CNAK
-
- // Enable fifo empty interrupt only if there are something to put in the fifo.
- if(total_bytes != 0) {
- USB0.dtknqr4_fifoemptymsk |= (1 << epnum);
- }
- } else {
- // Each complete packet for OUT xfers triggers XFRC.
- USB0.out_ep_reg[epnum].doeptsiz |= USB_PKTCNT0_M | ((xfer->max_size & USB_XFERSIZE0_V) << USB_XFERSIZE0_S);
- USB0.out_ep_reg[epnum].doepctl |= USB_EPENA0_M | USB_CNAK0_M;
- }
- return true;
-}
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
-bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
-{
- (void)rhport;
-
- // USB buffers always work in bytes so to avoid unnecessary divisions we demand item_size = 1
- TU_ASSERT(ff->item_size == 1);
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
- xfer->buffer = NULL;
- xfer->ff = ff;
- xfer->total_len = total_bytes;
- xfer->queued_len = 0;
- xfer->short_packet = false;
-
- uint16_t num_packets = (total_bytes / xfer->max_size);
- uint8_t short_packet_size = total_bytes % xfer->max_size;
-
- // Zero-size packet is special case.
- if (short_packet_size > 0 || (total_bytes == 0)) {
- num_packets++;
- }
-
- ESP_LOGV(TAG, "Transfer <-> EP%i, %s, pkgs: %i, bytes: %i",
- epnum, ((dir == TUSB_DIR_IN) ? "USB0.HOST (in)" : "HOST->DEV (out)"),
- num_packets, total_bytes);
-
- // IN and OUT endpoint xfers are interrupt-driven, we just schedule them
- // here.
- if (dir == TUSB_DIR_IN) {
- // A full IN transfer (multiple packets, possibly) triggers XFRC.
- USB0.in_ep_reg[epnum].dieptsiz = (num_packets << USB_D_PKTCNT0_S) | total_bytes;
- USB0.in_ep_reg[epnum].diepctl |= USB_D_EPENA1_M | USB_D_CNAK1_M; // Enable | CNAK
-
- // Enable fifo empty interrupt only if there are something to put in the fifo.
- if(total_bytes != 0) {
- USB0.dtknqr4_fifoemptymsk |= (1 << epnum);
- }
- } else {
- // Each complete packet for OUT xfers triggers XFRC.
- USB0.out_ep_reg[epnum].doeptsiz |= USB_PKTCNT0_M | ((xfer->max_size & USB_XFERSIZE0_V) << USB_XFERSIZE0_S);
- USB0.out_ep_reg[epnum].doepctl |= USB_EPENA0_M | USB_CNAK0_M;
- }
- return true;
-}
-#endif
-
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void)rhport;
-
- usb_out_endpoint_t *out_ep = &(USB0.out_ep_reg[0]);
- usb_in_endpoint_t *in_ep = &(USB0.in_ep_reg[0]);
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- if (dir == TUSB_DIR_IN) {
- // Only disable currently enabled non-control endpoint
- if ((epnum == 0) || !(in_ep[epnum].diepctl & USB_D_EPENA1_M)) {
- in_ep[epnum].diepctl |= (USB_DI_SNAK1_M | USB_D_STALL1_M);
- } else {
- // Stop transmitting packets and NAK IN xfers.
- in_ep[epnum].diepctl |= USB_DI_SNAK1_M;
- while ((in_ep[epnum].diepint & USB_DI_SNAK1_M) == 0) ;
-
- // Disable the endpoint. Note that both SNAK and STALL are set here.
- in_ep[epnum].diepctl |= (USB_DI_SNAK1_M | USB_D_STALL1_M | USB_D_EPDIS1_M);
- while ((in_ep[epnum].diepint & USB_D_EPDISBLD0_M) == 0) ;
- in_ep[epnum].diepint = USB_D_EPDISBLD0_M;
- }
-
- // Flush the FIFO, and wait until we have confirmed it cleared.
- uint8_t const fifo_num = ((in_ep[epnum].diepctl >> USB_D_TXFNUM1_S) & USB_D_TXFNUM1_V);
- USB0.grstctl |= (fifo_num << USB_TXFNUM_S);
- USB0.grstctl |= USB_TXFFLSH_M;
- while ((USB0.grstctl & USB_TXFFLSH_M) != 0) ;
- } else {
- // Only disable currently enabled non-control endpoint
- if ((epnum == 0) || !(out_ep[epnum].doepctl & USB_EPENA0_M)) {
- out_ep[epnum].doepctl |= USB_STALL0_M;
- } else {
- // Asserting GONAK is required to STALL an OUT endpoint.
- // Simpler to use polling here, we don't use the "B"OUTNAKEFF interrupt
- // anyway, and it can't be cleared by user code. If this while loop never
- // finishes, we have bigger problems than just the stack.
- USB0.dctl |= USB_SGOUTNAK_M;
- while ((USB0.gintsts & USB_GOUTNAKEFF_M) == 0) ;
-
- // Ditto here- disable the endpoint. Note that only STALL and not SNAK
- // is set here.
- out_ep[epnum].doepctl |= (USB_STALL0_M | USB_EPDIS0_M);
- while ((out_ep[epnum].doepint & USB_EPDISBLD0_M) == 0) ;
- out_ep[epnum].doepint = USB_EPDISBLD0_M;
-
- // Allow other OUT endpoints to keep receiving.
- USB0.dctl |= USB_CGOUTNAK_M;
- }
- }
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void)rhport;
-
- usb_out_endpoint_t *out_ep = &(USB0.out_ep_reg[0]);
- usb_in_endpoint_t *in_ep = &(USB0.in_ep_reg[0]);
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- if (dir == TUSB_DIR_IN) {
- in_ep[epnum].diepctl &= ~USB_D_STALL1_M;
-
- uint8_t eptype = (in_ep[epnum].diepctl & USB_D_EPTYPE1_M) >> USB_D_EPTYPE1_S;
- // Required by USB spec to reset DATA toggle bit to DATA0 on interrupt
- // and bulk endpoints.
- if (eptype == 2 || eptype == 3) {
- in_ep[epnum].diepctl |= USB_DI_SETD0PID1_M;
- }
- } else {
- out_ep[epnum].doepctl &= ~USB_STALL1_M;
-
- uint8_t eptype = (out_ep[epnum].doepctl & USB_EPTYPE1_M) >> USB_EPTYPE1_S;
- // Required by USB spec to reset DATA toggle bit to DATA0 on interrupt
- // and bulk endpoints.
- if (eptype == 2 || eptype == 3) {
- out_ep[epnum].doepctl |= USB_DO_SETD0PID1_M;
- }
- }
-}
-
-/*------------------------------------------------------------------*/
-
-static void receive_packet(xfer_ctl_t *xfer, /* usb_out_endpoint_t * out_ep, */ uint16_t xfer_size)
-{
- ESP_EARLY_LOGV(TAG, "USB - receive_packet");
- volatile uint32_t *rx_fifo = USB0.fifo[0];
-
- // See above TODO
- // uint16_t remaining = (out_ep->DOEPTSIZ & UsbDOEPTSIZ_XFRSIZ_Msk) >> UsbDOEPTSIZ_XFRSIZ_Pos;
- // xfer->queued_len = xfer->total_len - remaining;
-
- uint16_t remaining = xfer->total_len - xfer->queued_len;
- uint16_t to_recv_size;
-
- if (remaining <= xfer->max_size) {
- // Avoid buffer overflow.
- to_recv_size = (xfer_size > remaining) ? remaining : xfer_size;
- } else {
- // Room for full packet, choose recv_size based on what the microcontroller
- // claims.
- to_recv_size = (xfer_size > xfer->max_size) ? xfer->max_size : xfer_size;
- }
-
- // Common buffer read
-#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- // Ring buffer
- tu_fifo_write_n_const_addr_full_words(xfer->ff, (const void *) rx_fifo, to_recv_size);
- }
- else
-#endif
- {
- uint8_t to_recv_rem = to_recv_size % 4;
- uint16_t to_recv_size_aligned = to_recv_size - to_recv_rem;
-
- // Do not assume xfer buffer is aligned.
- uint8_t *base = (xfer->buffer + xfer->queued_len);
-
- // This for loop always runs at least once- skip if less than 4 bytes
- // to collect.
- if (to_recv_size >= 4) {
- for (uint16_t i = 0; i < to_recv_size_aligned; i += 4) {
- uint32_t tmp = (*rx_fifo);
- base[i] = tmp & 0x000000FF;
- base[i + 1] = (tmp & 0x0000FF00) >> 8;
- base[i + 2] = (tmp & 0x00FF0000) >> 16;
- base[i + 3] = (tmp & 0xFF000000) >> 24;
- }
- }
-
- // Do not read invalid bytes from RX FIFO.
- if (to_recv_rem != 0) {
- uint32_t tmp = (*rx_fifo);
- uint8_t *last_32b_bound = base + to_recv_size_aligned;
-
- last_32b_bound[0] = tmp & 0x000000FF;
- if (to_recv_rem > 1) {
- last_32b_bound[1] = (tmp & 0x0000FF00) >> 8;
- }
- if (to_recv_rem > 2) {
- last_32b_bound[2] = (tmp & 0x00FF0000) >> 16;
- }
- }
- }
-
- xfer->queued_len += xfer_size;
-
- // Per USB spec, a short OUT packet (including length 0) is always
- // indicative of the end of a transfer (at least for ctl, bulk, int).
- xfer->short_packet = (xfer_size < xfer->max_size);
-}
-
-static void transmit_packet(xfer_ctl_t *xfer, volatile usb_in_endpoint_t *in_ep, uint8_t fifo_num)
-{
- ESP_EARLY_LOGV(TAG, "USB - transmit_packet");
- volatile uint32_t *tx_fifo = USB0.fifo[fifo_num];
-
- uint16_t remaining = (in_ep->dieptsiz & 0x7FFFFU) >> USB_D_XFERSIZE0_S;
- xfer->queued_len = xfer->total_len - remaining;
-
- uint16_t to_xfer_size = (remaining > xfer->max_size) ? xfer->max_size : remaining;
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- tu_fifo_read_n_const_addr_full_words(xfer->ff, (void *) tx_fifo, to_xfer_size);
- }
- else
-#endif
- {
- uint8_t to_xfer_rem = to_xfer_size % 4;
- uint16_t to_xfer_size_aligned = to_xfer_size - to_xfer_rem;
-
- // Buffer might not be aligned to 32b, so we need to force alignment
- // by copying to a temp var.
- uint8_t *base = (xfer->buffer + xfer->queued_len);
-
- // This for loop always runs at least once- skip if less than 4 bytes
- // to send off.
- if (to_xfer_size >= 4) {
- for (uint16_t i = 0; i < to_xfer_size_aligned; i += 4) {
- uint32_t tmp = base[i] | (base[i + 1] << 8) |
- (base[i + 2] << 16) | (base[i + 3] << 24);
- (*tx_fifo) = tmp;
- }
- }
-
- // Do not read beyond end of buffer if not divisible by 4.
- if (to_xfer_rem != 0) {
- uint32_t tmp = 0;
- uint8_t *last_32b_bound = base + to_xfer_size_aligned;
-
- tmp |= last_32b_bound[0];
- if (to_xfer_rem > 1) {
- tmp |= (last_32b_bound[1] << 8);
- }
- if (to_xfer_rem > 2) {
- tmp |= (last_32b_bound[2] << 16);
- }
-
- (*tx_fifo) = tmp;
- }
- }
-}
-
-static void read_rx_fifo(void)
-{
- // Pop control word off FIFO (completed xfers will have 2 control words,
- // we only pop one ctl word each interrupt).
- uint32_t const ctl_word = USB0.grxstsp;
- uint8_t const pktsts = (ctl_word & USB_PKTSTS_M) >> USB_PKTSTS_S;
- uint8_t const epnum = (ctl_word & USB_CHNUM_M ) >> USB_CHNUM_S;
- uint16_t const bcnt = (ctl_word & USB_BCNT_M ) >> USB_BCNT_S;
-
- switch (pktsts) {
- case 0x01: // Global OUT NAK (Interrupt)
- ESP_EARLY_LOGV(TAG, "TUSB IRQ - RX type : Global OUT NAK");
- break;
-
- case 0x02: { // Out packet recvd
- ESP_EARLY_LOGV(TAG, "TUSB IRQ - RX type : Out packet");
- xfer_ctl_t *xfer = XFER_CTL_BASE(epnum, TUSB_DIR_OUT);
- receive_packet(xfer, bcnt);
- }
- break;
-
- case 0x03: // Out packet done (Interrupt)
- ESP_EARLY_LOGV(TAG, "TUSB IRQ - RX type : Out packet done");
- break;
-
- case 0x04: // Step 2: Setup transaction completed (Interrupt)
- // After this event, OEPINT interrupt will occur with SETUP bit set
- ESP_EARLY_LOGV(TAG, "TUSB IRQ - RX : Setup packet done");
- USB0.out_ep_reg[epnum].doeptsiz |= USB_SUPCNT0_M;
- break;
-
- case 0x06: { // Step1: Setup data packet received
- volatile uint32_t *rx_fifo = USB0.fifo[0];
-
- // We can receive up to three setup packets in succession, but
- // only the last one is valid. Therefore we just overwrite it
- _setup_packet[0] = (*rx_fifo);
- _setup_packet[1] = (*rx_fifo);
-
- ESP_EARLY_LOGV(TAG, "TUSB IRQ - RX : Setup packet : 0x%08x 0x%08x", _setup_packet[0], _setup_packet[1]);
- }
- break;
-
- default: // Invalid, do something here, like breakpoint?
- TU_BREAKPOINT();
- break;
- }
-}
-
-static void handle_epout_ints(void)
-{
- // GINTSTS will be cleared with DAINT == 0
- // DAINT for a given EP clears when DOEPINTx is cleared.
- // DOEPINT will be cleared when DAINT's out bits are cleared.
- for (int n = 0; n < USB_OUT_EP_NUM; n++) {
- xfer_ctl_t *xfer = XFER_CTL_BASE(n, TUSB_DIR_OUT);
-
- if (USB0.daint & (1 << (16 + n))) {
- // SETUP packet Setup Phase done.
- if ((USB0.out_ep_reg[n].doepint & USB_SETUP0_M)) {
- USB0.out_ep_reg[n].doepint = USB_STUPPKTRCVD0_M | USB_SETUP0_M; // clear
- dcd_event_setup_received(0, (uint8_t *)&_setup_packet[0], true);
- }
-
- // OUT XFER complete (single packet).q
- if (USB0.out_ep_reg[n].doepint & USB_XFERCOMPL0_M) {
-
- ESP_EARLY_LOGV(TAG, "TUSB IRQ - EP OUT - XFER complete (single packet)");
- USB0.out_ep_reg[n].doepint = USB_XFERCOMPL0_M;
-
- // Transfer complete if short packet or total len is transferred
- if (xfer->short_packet || (xfer->queued_len == xfer->total_len)) {
- xfer->short_packet = false;
- dcd_event_xfer_complete(0, n, xfer->queued_len, XFER_RESULT_SUCCESS, true);
- } else {
- // Schedule another packet to be received.
- USB0.out_ep_reg[n].doeptsiz |= USB_PKTCNT0_M | ((xfer->max_size & USB_XFERSIZE0_V) << USB_XFERSIZE0_S);
- USB0.out_ep_reg[n].doepctl |= USB_EPENA0_M | USB_CNAK0_M;
- }
- }
- }
- }
-}
-
-static void handle_epin_ints(void)
-{
- // GINTSTS will be cleared with DAINT == 0
- // DAINT for a given EP clears when DIEPINTx is cleared.
- // IEPINT will be cleared when DAINT's out bits are cleared.
- for (uint32_t n = 0; n < USB_IN_EP_NUM; n++) {
- xfer_ctl_t *xfer = &xfer_status[n][TUSB_DIR_IN];
-
- if (USB0.daint & (1 << (0 + n))) {
- ESP_EARLY_LOGV(TAG, "TUSB IRQ - EP IN %u", n);
- // IN XFER complete (entire xfer).
- if (USB0.in_ep_reg[n].diepint & USB_D_XFERCOMPL0_M) {
- ESP_EARLY_LOGV(TAG, "TUSB IRQ - IN XFER complete!");
- USB0.in_ep_reg[n].diepint = USB_D_XFERCOMPL0_M;
- dcd_event_xfer_complete(0, n | TUSB_DIR_IN_MASK, xfer->total_len, XFER_RESULT_SUCCESS, true);
- }
-
- // XFER FIFO empty
- if (USB0.in_ep_reg[n].diepint & USB_D_TXFEMP0_M) {
- ESP_EARLY_LOGV(TAG, "TUSB IRQ - IN XFER FIFO empty!");
- USB0.in_ep_reg[n].diepint = USB_D_TXFEMP0_M;
- transmit_packet(xfer, &USB0.in_ep_reg[n], n);
-
- // Turn off TXFE if all bytes are written.
- if (xfer->queued_len == xfer->total_len)
- {
- USB0.dtknqr4_fifoemptymsk &= ~(1 << n);
- }
- }
-
- // XFER Timeout
- if (USB0.in_ep_reg[n].diepint & USB_D_TIMEOUT0_M) {
- // Clear interrupt or enpoint will hang.
- USB0.in_ep_reg[n].diepint = USB_D_TIMEOUT0_M;
- // Maybe retry?
- }
- }
- }
-}
-
-
-static void _dcd_int_handler(void* arg)
-{
- (void) arg;
- uint8_t const rhport = 0;
-
- const uint32_t int_status = USB0.gintsts;
- //const uint32_t int_msk = USB0.gintmsk;
-
- if (int_status & USB_USBRST_M) {
- // start of reset
- ESP_EARLY_LOGV(TAG, "dcd_int_handler - reset");
- USB0.gintsts = USB_USBRST_M;
- // FIFOs will be reassigned when the endpoints are reopen
- _allocated_fifos = 1;
- bus_reset();
- }
-
- if (int_status & USB_RESETDET_M) {
- ESP_EARLY_LOGV(TAG, "dcd_int_handler - reset while suspend");
- USB0.gintsts = USB_RESETDET_M;
- bus_reset();
- }
-
- if (int_status & USB_ENUMDONE_M) {
- // ENUMDNE detects speed of the link. For full-speed, we
- // always expect the same value. This interrupt is considered
- // the end of reset.
- USB0.gintsts = USB_ENUMDONE_M;
- enum_done_processing();
- dcd_event_bus_reset(rhport, TUSB_SPEED_FULL, true);
- }
-
- if(int_status & USB_USBSUSP_M)
- {
- USB0.gintsts = USB_USBSUSP_M;
- dcd_event_bus_signal(rhport, DCD_EVENT_SUSPEND, true);
- }
-
- if(int_status & USB_WKUPINT_M)
- {
- USB0.gintsts = USB_WKUPINT_M;
- dcd_event_bus_signal(rhport, DCD_EVENT_RESUME, true);
- }
-
- if (int_status & USB_OTGINT_M)
- {
- // OTG INT bit is read-only
- ESP_EARLY_LOGV(TAG, "dcd_int_handler - disconnected");
-
- uint32_t const otg_int = USB0.gotgint;
-
- if (otg_int & USB_SESENDDET_M)
- {
- dcd_event_bus_signal(rhport, DCD_EVENT_UNPLUGGED, true);
- }
-
- USB0.gotgint = otg_int;
- }
-
-#if USE_SOF
- if (int_status & USB_SOF_M) {
- USB0.gintsts = USB_SOF_M;
- dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true); // do nothing actually
- }
-#endif
-
- if (int_status & USB_RXFLVI_M) {
- // RXFLVL bit is read-only
- ESP_EARLY_LOGV(TAG, "dcd_int_handler - rx!");
-
- // Mask out RXFLVL while reading data from FIFO
- USB0.gintmsk &= ~USB_RXFLVIMSK_M;
- read_rx_fifo();
- USB0.gintmsk |= USB_RXFLVIMSK_M;
- }
-
- // OUT endpoint interrupt handling.
- if (int_status & USB_OEPINT_M) {
- // OEPINT is read-only
- ESP_EARLY_LOGV(TAG, "dcd_int_handler - OUT endpoint!");
- handle_epout_ints();
- }
-
- // IN endpoint interrupt handling.
- if (int_status & USB_IEPINT_M) {
- // IEPINT bit read-only
- ESP_EARLY_LOGV(TAG, "dcd_int_handler - IN endpoint!");
- handle_epin_ints();
- }
-
- // Without handling
- USB0.gintsts |= USB_CURMOD_INT_M |
- USB_MODEMIS_M |
- USB_OTGINT_M |
- USB_NPTXFEMP_M |
- USB_GINNAKEFF_M |
- USB_GOUTNAKEFF |
- USB_ERLYSUSP_M |
- USB_USBSUSP_M |
- USB_ISOOUTDROP_M |
- USB_EOPF_M |
- USB_EPMIS_M |
- USB_INCOMPISOIN_M |
- USB_INCOMPIP_M |
- USB_FETSUSP_M |
- USB_PTXFEMP_M;
-}
-
-void dcd_int_enable (uint8_t rhport)
-{
- (void) rhport;
- esp_intr_alloc(ETS_USB_INTR_SOURCE, ESP_INTR_FLAG_LOWMED, (intr_handler_t) _dcd_int_handler, NULL, &usb_ih);
-}
-
-void dcd_int_disable (uint8_t rhport)
-{
- (void) rhport;
- esp_intr_free(usb_ih);
-}
-
-#endif // #if OPT_MCU_ESP32S2 || OPT_MCU_ESP32S3
-
diff --git a/tinyusb/src/portable/microchip/samd/dcd_samd.c b/tinyusb/src/portable/microchip/samd/dcd_samd.c
deleted file mode 100755
index 577bd0e0..00000000
--- a/tinyusb/src/portable/microchip/samd/dcd_samd.c
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && \
- (CFG_TUSB_MCU == OPT_MCU_SAMD11 || CFG_TUSB_MCU == OPT_MCU_SAMD21 || \
- CFG_TUSB_MCU == OPT_MCU_SAMD51 || CFG_TUSB_MCU == OPT_MCU_SAME5X || \
- CFG_TUSB_MCU == OPT_MCU_SAML22 || CFG_TUSB_MCU == OPT_MCU_SAML21)
-
-#include "sam.h"
-#include "device/dcd.h"
-
-/*------------------------------------------------------------------*/
-/* MACRO TYPEDEF CONSTANT ENUM
- *------------------------------------------------------------------*/
-static TU_ATTR_ALIGNED(4) UsbDeviceDescBank sram_registers[8][2];
-
-// Setup packet is only 8 bytes in length. However under certain scenario,
-// USB DMA controller may decide to overwrite/overflow the buffer with
-// 2 extra bytes of CRC. From datasheet's "Management of SETUP Transactions" section
-// If the number of received data bytes is the maximum data payload specified by
-// PCKSIZE.SIZE minus one, only the first CRC data is written to the data buffer.
-// If the number of received data is equal or less than the data payload specified
-// by PCKSIZE.SIZE minus two, both CRC data bytes are written to the data buffer.
-// Therefore we will need to increase it to 10 bytes here.
-static TU_ATTR_ALIGNED(4) uint8_t _setup_packet[8+2];
-
-// ready for receiving SETUP packet
-static inline void prepare_setup(void)
-{
- // Only make sure the EP0 OUT buffer is ready
- sram_registers[0][0].ADDR.reg = (uint32_t) _setup_packet;
- sram_registers[0][0].PCKSIZE.bit.MULTI_PACKET_SIZE = sizeof(tusb_control_request_t);
- sram_registers[0][0].PCKSIZE.bit.BYTE_COUNT = 0;
-}
-
-// Setup the control endpoint 0.
-static void bus_reset(void)
-{
- // Max size of packets is 64 bytes.
- UsbDeviceDescBank* bank_out = &sram_registers[0][TUSB_DIR_OUT];
- bank_out->PCKSIZE.bit.SIZE = 0x3;
- UsbDeviceDescBank* bank_in = &sram_registers[0][TUSB_DIR_IN];
- bank_in->PCKSIZE.bit.SIZE = 0x3;
-
- UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[0];
- ep->EPCFG.reg = USB_DEVICE_EPCFG_EPTYPE0(0x1) | USB_DEVICE_EPCFG_EPTYPE1(0x1);
- ep->EPINTENSET.reg = USB_DEVICE_EPINTENSET_TRCPT0 | USB_DEVICE_EPINTENSET_TRCPT1 | USB_DEVICE_EPINTENSET_RXSTP;
-
- // Prepare for setup packet
- prepare_setup();
-}
-
-/*------------------------------------------------------------------*/
-/* Controller API
- *------------------------------------------------------------------*/
-void dcd_init (uint8_t rhport)
-{
- (void) rhport;
-
- // Reset to get in a clean state.
- USB->DEVICE.CTRLA.bit.SWRST = true;
- while (USB->DEVICE.SYNCBUSY.bit.SWRST == 0) {}
- while (USB->DEVICE.SYNCBUSY.bit.SWRST == 1) {}
-
- USB->DEVICE.PADCAL.bit.TRANSP = (*((uint32_t*) USB_FUSES_TRANSP_ADDR) & USB_FUSES_TRANSP_Msk) >> USB_FUSES_TRANSP_Pos;
- USB->DEVICE.PADCAL.bit.TRANSN = (*((uint32_t*) USB_FUSES_TRANSN_ADDR) & USB_FUSES_TRANSN_Msk) >> USB_FUSES_TRANSN_Pos;
- USB->DEVICE.PADCAL.bit.TRIM = (*((uint32_t*) USB_FUSES_TRIM_ADDR) & USB_FUSES_TRIM_Msk) >> USB_FUSES_TRIM_Pos;
-
- USB->DEVICE.QOSCTRL.bit.CQOS = 3; // High Quality
- USB->DEVICE.QOSCTRL.bit.DQOS = 3; // High Quality
-
- // Configure registers
- USB->DEVICE.DESCADD.reg = (uint32_t) &sram_registers;
- USB->DEVICE.CTRLB.reg = USB_DEVICE_CTRLB_SPDCONF_FS;
- USB->DEVICE.CTRLA.reg = USB_CTRLA_MODE_DEVICE | USB_CTRLA_ENABLE | USB_CTRLA_RUNSTDBY;
- while (USB->DEVICE.SYNCBUSY.bit.ENABLE == 1) {}
-
- USB->DEVICE.INTFLAG.reg |= USB->DEVICE.INTFLAG.reg; // clear pending
- USB->DEVICE.INTENSET.reg = /* USB_DEVICE_INTENSET_SOF | */ USB_DEVICE_INTENSET_EORST;
-}
-
-#if CFG_TUSB_MCU == OPT_MCU_SAMD51 || CFG_TUSB_MCU == OPT_MCU_SAME5X
-
-void dcd_int_enable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_EnableIRQ(USB_0_IRQn);
- NVIC_EnableIRQ(USB_1_IRQn);
- NVIC_EnableIRQ(USB_2_IRQn);
- NVIC_EnableIRQ(USB_3_IRQn);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ(USB_3_IRQn);
- NVIC_DisableIRQ(USB_2_IRQn);
- NVIC_DisableIRQ(USB_1_IRQn);
- NVIC_DisableIRQ(USB_0_IRQn);
-}
-
-#elif CFG_TUSB_MCU == OPT_MCU_SAMD11 || CFG_TUSB_MCU == OPT_MCU_SAMD21 || \
- CFG_TUSB_MCU == OPT_MCU_SAML22 || CFG_TUSB_MCU == OPT_MCU_SAML21
-
-void dcd_int_enable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_EnableIRQ(USB_IRQn);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ(USB_IRQn);
-}
-
-#else
-
-#error "No implementation available for dcd_int_enable / dcd_int_disable"
-
-#endif
-
-void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
-{
- (void) dev_addr;
-
- // Response with zlp status
- dcd_edpt_xfer(rhport, 0x80, NULL, 0);
-
- // DCD can only set address after status for this request is complete
- // do it at dcd_edpt0_status_complete()
-
- // Enable SUSPEND interrupt since the bus signal D+/D- are stable now.
- USB->DEVICE.INTFLAG.reg = USB_DEVICE_INTENCLR_SUSPEND; // clear pending
- USB->DEVICE.INTENSET.reg = USB_DEVICE_INTENSET_SUSPEND;
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
- USB->DEVICE.CTRLB.bit.UPRSM = 1;
-}
-
-// disconnect by disabling internal pull-up resistor on D+/D-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- USB->DEVICE.CTRLB.reg |= USB_DEVICE_CTRLB_DETACH;
-}
-
-// connect by enabling internal pull-up resistor on D+/D-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- USB->DEVICE.CTRLB.reg &= ~USB_DEVICE_CTRLB_DETACH;
-}
-
-/*------------------------------------------------------------------*/
-/* DCD Endpoint port
- *------------------------------------------------------------------*/
-
-// Invoked when a control transfer's status stage is complete.
-// May help DCD to prepare for next control transfer, this API is optional.
-void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * request)
-{
- (void) rhport;
-
- if (request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_DEVICE &&
- request->bmRequestType_bit.type == TUSB_REQ_TYPE_STANDARD &&
- request->bRequest == TUSB_REQ_SET_ADDRESS )
- {
- uint8_t const dev_addr = (uint8_t) request->wValue;
- USB->DEVICE.DADD.reg = USB_DEVICE_DADD_DADD(dev_addr) | USB_DEVICE_DADD_ADDEN;
- }
-
- // Just finished status stage, prepare for next setup packet
- // Note: we may already prepare setup when queueing the control status.
- // but it has no harm to do it again here
- prepare_setup();
-}
-
-bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(desc_edpt->bEndpointAddress);
- uint8_t const dir = tu_edpt_dir(desc_edpt->bEndpointAddress);
-
- UsbDeviceDescBank* bank = &sram_registers[epnum][dir];
- uint32_t size_value = 0;
- while (size_value < 7) {
- if (1 << (size_value + 3) == desc_edpt->wMaxPacketSize.size) {
- break;
- }
- size_value++;
- }
-
- // unsupported endpoint size
- if ( size_value == 7 && desc_edpt->wMaxPacketSize.size != 1023 ) return false;
-
- bank->PCKSIZE.bit.SIZE = size_value;
-
- UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
-
- if ( dir == TUSB_DIR_OUT )
- {
- ep->EPCFG.bit.EPTYPE0 = desc_edpt->bmAttributes.xfer + 1;
- ep->EPINTENSET.bit.TRCPT0 = true;
- }else
- {
- ep->EPCFG.bit.EPTYPE1 = desc_edpt->bmAttributes.xfer + 1;
- ep->EPINTENSET.bit.TRCPT1 = true;
- }
-
- return true;
-}
-
-bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- UsbDeviceDescBank* bank = &sram_registers[epnum][dir];
- UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
-
- bank->ADDR.reg = (uint32_t) buffer;
-
- // A SETUP token can occur immediately after an ZLP Status.
- // So make sure we have a valid buffer for setup packet.
- // Status = ZLP EP0 with direction opposite to one in the dir bit of current setup
- if ( (epnum == 0) && (buffer == NULL) && (total_bytes == 0) && (dir != tu_edpt_dir(_setup_packet[0])) ) {
- prepare_setup();
- }
-
- if ( dir == TUSB_DIR_OUT )
- {
- bank->PCKSIZE.bit.MULTI_PACKET_SIZE = total_bytes;
- bank->PCKSIZE.bit.BYTE_COUNT = 0;
- ep->EPSTATUSCLR.reg |= USB_DEVICE_EPSTATUSCLR_BK0RDY;
- ep->EPINTFLAG.reg |= USB_DEVICE_EPINTFLAG_TRFAIL0;
- } else
- {
- bank->PCKSIZE.bit.MULTI_PACKET_SIZE = 0;
- bank->PCKSIZE.bit.BYTE_COUNT = total_bytes;
- ep->EPSTATUSSET.reg |= USB_DEVICE_EPSTATUSSET_BK1RDY;
- ep->EPINTFLAG.reg |= USB_DEVICE_EPINTFLAG_TRFAIL1;
- }
-
- return true;
-}
-
-void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
-
- if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN) {
- ep->EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ1;
- } else {
- ep->EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ0;
- }
-}
-
-void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
-
- if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN) {
- ep->EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_STALLRQ1 | USB_DEVICE_EPSTATUSCLR_DTGLIN;
- } else {
- ep->EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_STALLRQ0 | USB_DEVICE_EPSTATUSCLR_DTGLOUT;
- }
-}
-
-//--------------------------------------------------------------------+
-// Interrupt Handler
-//--------------------------------------------------------------------+
-void maybe_transfer_complete(void) {
- uint32_t epints = USB->DEVICE.EPINTSMRY.reg;
-
- for (uint8_t epnum = 0; epnum < USB_EPT_NUM; epnum++) {
- if ((epints & (1 << epnum)) == 0) {
- continue;
- }
-
- UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
- uint32_t epintflag = ep->EPINTFLAG.reg;
-
- // Handle IN completions
- if ((epintflag & USB_DEVICE_EPINTFLAG_TRCPT1) != 0) {
- UsbDeviceDescBank* bank = &sram_registers[epnum][TUSB_DIR_IN];
- uint16_t const total_transfer_size = bank->PCKSIZE.bit.BYTE_COUNT;
-
- dcd_event_xfer_complete(0, epnum | TUSB_DIR_IN_MASK, total_transfer_size, XFER_RESULT_SUCCESS, true);
-
- ep->EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRCPT1;
- }
-
- // Handle OUT completions
- if ((epintflag & USB_DEVICE_EPINTFLAG_TRCPT0) != 0) {
- UsbDeviceDescBank* bank = &sram_registers[epnum][TUSB_DIR_OUT];
- uint16_t const total_transfer_size = bank->PCKSIZE.bit.BYTE_COUNT;
-
- dcd_event_xfer_complete(0, epnum, total_transfer_size, XFER_RESULT_SUCCESS, true);
-
- ep->EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRCPT0;
- }
- }
-}
-
-
-void dcd_int_handler (uint8_t rhport)
-{
- (void) rhport;
-
- uint32_t int_status = USB->DEVICE.INTFLAG.reg & USB->DEVICE.INTENSET.reg;
-
- // Start of Frame
- if ( int_status & USB_DEVICE_INTFLAG_SOF )
- {
- USB->DEVICE.INTFLAG.reg = USB_DEVICE_INTFLAG_SOF;
- dcd_event_bus_signal(0, DCD_EVENT_SOF, true);
- }
-
- // SAMD doesn't distinguish between Suspend and Disconnect state.
- // Both condition will cause SUSPEND interrupt triggered.
- // To prevent being triggered when D+/D- are not stable, SUSPEND interrupt is only
- // enabled when we received SET_ADDRESS request and cleared on Bus Reset
- if ( int_status & USB_DEVICE_INTFLAG_SUSPEND )
- {
- USB->DEVICE.INTFLAG.reg = USB_DEVICE_INTFLAG_SUSPEND;
-
- // Enable wakeup interrupt
- USB->DEVICE.INTFLAG.reg = USB_DEVICE_INTFLAG_WAKEUP; // clear pending
- USB->DEVICE.INTENSET.reg = USB_DEVICE_INTFLAG_WAKEUP;
-
- dcd_event_bus_signal(0, DCD_EVENT_SUSPEND, true);
- }
-
- // Wakeup interrupt is only enabled when we got suspended.
- // Wakeup interrupt will disable itself
- if ( int_status & USB_DEVICE_INTFLAG_WAKEUP )
- {
- USB->DEVICE.INTFLAG.reg = USB_DEVICE_INTFLAG_WAKEUP;
-
- // disable wakeup interrupt itself
- USB->DEVICE.INTENCLR.reg = USB_DEVICE_INTFLAG_WAKEUP;
- dcd_event_bus_signal(0, DCD_EVENT_RESUME, true);
- }
-
- // Enable of Reset
- if ( int_status & USB_DEVICE_INTFLAG_EORST )
- {
- USB->DEVICE.INTFLAG.reg = USB_DEVICE_INTFLAG_EORST;
-
- // Disable both suspend and wakeup interrupt
- USB->DEVICE.INTENCLR.reg = USB_DEVICE_INTFLAG_WAKEUP | USB_DEVICE_INTFLAG_SUSPEND;
-
- bus_reset();
- dcd_event_bus_reset(0, TUSB_SPEED_FULL, true);
- }
-
- // Handle SETUP packet
- if (USB->DEVICE.DeviceEndpoint[0].EPINTFLAG.bit.RXSTP)
- {
- // This copies the data elsewhere so we can reuse the buffer.
- dcd_event_setup_received(0, _setup_packet, true);
-
- // Although Setup packet only set RXSTP bit,
- // TRCPT0 bit could already be set by previous ZLP OUT Status (not handled until now).
- // Since control status complete event is optional, we can just clear TRCPT0 and skip the status event
- USB->DEVICE.DeviceEndpoint[0].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_RXSTP | USB_DEVICE_EPINTFLAG_TRCPT0;
- }
-
- // Handle complete transfer
- maybe_transfer_complete();
-}
-
-#endif
diff --git a/tinyusb/src/portable/microchip/samg/dcd_samg.c b/tinyusb/src/portable/microchip/samg/dcd_samg.c
deleted file mode 100755
index d50621ce..00000000
--- a/tinyusb/src/portable/microchip/samg/dcd_samg.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018, hathach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if CFG_TUSB_MCU == OPT_MCU_SAMG
-
-#include "sam.h"
-#include "device/dcd.h"
-
-// TODO should support (SAM3S || SAM4S || SAM4E || SAMG55)
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-#define EP_COUNT 6
-
-// Transfer descriptor
-typedef struct
-{
- uint8_t* buffer;
- // tu_fifo_t* ff; // TODO support dcd_edpt_xfer_fifo API
- uint16_t total_len;
- volatile uint16_t actual_len;
- uint16_t epsize;
-} xfer_desc_t;
-
-// Endpoint 0-5, each can only be either OUT or In
-xfer_desc_t _dcd_xfer[EP_COUNT];
-
-void xfer_epsize_set(xfer_desc_t* xfer, uint16_t epsize)
-{
- xfer->epsize = epsize;
-}
-
-void xfer_begin(xfer_desc_t* xfer, uint8_t * buffer, uint16_t total_bytes)
-{
- xfer->buffer = buffer;
- // xfer->ff = NULL; // TODO support dcd_edpt_xfer_fifo API
- xfer->total_len = total_bytes;
- xfer->actual_len = 0;
-}
-
-void xfer_end(xfer_desc_t* xfer)
-{
- xfer->buffer = NULL;
- // xfer->ff = NULL; // TODO support dcd_edpt_xfer_fifo API
- xfer->total_len = 0;
- xfer->actual_len = 0;
-}
-
-uint16_t xfer_packet_len(xfer_desc_t* xfer)
-{
- // also cover zero-length packet
- return tu_min16(xfer->total_len - xfer->actual_len, xfer->epsize);
-}
-
-void xfer_packet_done(xfer_desc_t* xfer)
-{
- uint16_t const xact_len = xfer_packet_len(xfer);
-
- xfer->buffer += xact_len;
- xfer->actual_len += xact_len;
-}
-
-//------------- Transaction helpers -------------//
-
-// Write data to EP FIFO, return number of written bytes
-static void xact_ep_write(uint8_t epnum, uint8_t* buffer, uint16_t xact_len)
-{
- for(uint16_t i=0; i<xact_len; i++)
- {
- UDP->UDP_FDR[epnum] = (uint32_t) buffer[i];
- }
-}
-
-// Read data from EP FIFO
-static void xact_ep_read(uint8_t epnum, uint8_t* buffer, uint16_t xact_len)
-{
- for(uint16_t i=0; i<xact_len; i++)
- {
- buffer[i] = (uint8_t) UDP->UDP_FDR[epnum];
- }
-}
-
-
-//! Bitmap for all status bits in CSR that are not affected by a value 1.
-#define CSR_NO_EFFECT_1_ALL (UDP_CSR_RX_DATA_BK0 | UDP_CSR_RX_DATA_BK1 | UDP_CSR_STALLSENT | UDP_CSR_RXSETUP | UDP_CSR_TXCOMP)
-
-// Per Specs: CSR need synchronization each write
-static inline void csr_write(uint8_t epnum, uint32_t value)
-{
- uint32_t const csr = value;
- UDP->UDP_CSR[epnum] = csr;
-
- volatile uint32_t nop_count;
- for (nop_count = 0; nop_count < 20; nop_count ++) __NOP();
-}
-
-// Per Specs: CSR need synchronization each write
-static inline void csr_set(uint8_t epnum, uint32_t mask)
-{
- csr_write(epnum, UDP->UDP_CSR[epnum] | CSR_NO_EFFECT_1_ALL | mask);
-}
-
-// Per Specs: CSR need synchronization each write
-static inline void csr_clear(uint8_t epnum, uint32_t mask)
-{
- csr_write(epnum, (UDP->UDP_CSR[epnum] | CSR_NO_EFFECT_1_ALL) & ~mask);
-}
-
-/*------------------------------------------------------------------*/
-/* Device API
- *------------------------------------------------------------------*/
-
-// Set up endpoint 0, clear all other endpoints
-static void bus_reset(void)
-{
- tu_memclr(_dcd_xfer, sizeof(_dcd_xfer));
-
- xfer_epsize_set(&_dcd_xfer[0], CFG_TUD_ENDPOINT0_SIZE);
-
- // Enable EP0 control
- csr_write(0, UDP_CSR_EPEDS_Msk);
-
- // Enable interrupt : EP0, Suspend, Resume, Wakeup
- UDP->UDP_IER = UDP_IER_EP0INT_Msk | UDP_IER_RXSUSP_Msk | UDP_IER_RXRSM_Msk | UDP_IER_WAKEUP_Msk;
-
- // Enable transceiver
- UDP->UDP_TXVC &= ~UDP_TXVC_TXVDIS_Msk;
-}
-
-// Initialize controller to device mode
-void dcd_init (uint8_t rhport)
-{
- tu_memclr(_dcd_xfer, sizeof(_dcd_xfer));
- dcd_connect(rhport);
-}
-
-// Enable device interrupt
-void dcd_int_enable (uint8_t rhport)
-{
- (void) rhport;
- NVIC_EnableIRQ(UDP_IRQn);
-}
-
-// Disable device interrupt
-void dcd_int_disable (uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ(UDP_IRQn);
-}
-
-// Receive Set Address request, mcu port must also include status IN response
-void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
- (void) dev_addr;
-
- // Response with zlp status
- dcd_edpt_xfer(rhport, 0x80, NULL, 0);
-
- // DCD can only set address after status for this request is complete.
- // do it at dcd_edpt0_status_complete()
-}
-
-// Wake up host
-void dcd_remote_wakeup (uint8_t rhport)
-{
- (void) rhport;
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
-
- // Enable pull-up, disable transceiver
- UDP->UDP_TXVC = UDP_TXVC_PUON | UDP_TXVC_TXVDIS_Msk;
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
-
- // disable both pullup and transceiver
- UDP->UDP_TXVC = UDP_TXVC_TXVDIS_Msk;
-}
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-
-// Invoked when a control transfer's status stage is complete.
-// May help DCD to prepare for next control transfer, this API is optional.
-void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * request)
-{
- (void) rhport;
-
- if (request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_DEVICE &&
- request->bmRequestType_bit.type == TUSB_REQ_TYPE_STANDARD )
- {
- if (request->bRequest == TUSB_REQ_SET_ADDRESS)
- {
- uint8_t const dev_addr = (uint8_t) request->wValue;
-
- // Enable addressed state
- UDP->UDP_GLB_STAT |= UDP_GLB_STAT_FADDEN_Msk;
-
- // Set new address & Function enable bit
- UDP->UDP_FADDR = UDP_FADDR_FEN_Msk | UDP_FADDR_FADD(dev_addr);
- }
- else if (request->bRequest == TUSB_REQ_SET_CONFIGURATION)
- {
- // Configured State
- UDP->UDP_GLB_STAT |= UDP_GLB_STAT_CONFG_Msk;
- }
- }
-}
-
-// Configure endpoint's registers according to descriptor
-// SAMG doesn't support a same endpoint number with IN and OUT
-// e.g EP1 OUT & EP1 IN cannot exist together
-bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * ep_desc)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_desc->bEndpointAddress);
- uint8_t const dir = tu_edpt_dir(ep_desc->bEndpointAddress);
-
- // TODO Isochronous is not supported yet
- TU_VERIFY(ep_desc->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS);
- TU_VERIFY(epnum < EP_COUNT);
-
- // Must not already enabled
- TU_ASSERT((UDP->UDP_CSR[epnum] & UDP_CSR_EPEDS_Msk) == 0);
-
- xfer_epsize_set(&_dcd_xfer[epnum], ep_desc->wMaxPacketSize.size);
-
- // Configure type and enable EP
- csr_write(epnum, UDP_CSR_EPEDS_Msk | UDP_CSR_EPTYPE(ep_desc->bmAttributes.xfer + 4*dir));
-
- // Enable EP Interrupt for IN
- if (dir == TUSB_DIR_IN) UDP->UDP_IER |= (1 << epnum);
-
- return true;
-}
-
-// Submit a transfer, When complete dcd_event_xfer_complete() is invoked to notify the stack
-bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_desc_t* xfer = &_dcd_xfer[epnum];
- xfer_begin(xfer, buffer, total_bytes);
-
- if (dir == TUSB_DIR_OUT)
- {
- // Enable interrupt when starting OUT transfer
- if (epnum != 0) UDP->UDP_IER |= (1 << epnum);
- }
- else
- {
- xact_ep_write(epnum, xfer->buffer, xfer_packet_len(xfer));
-
- // TX ready for transfer
- csr_set(epnum, UDP_CSR_TXPKTRDY_Msk);
- }
-
- return true;
-}
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
-bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
-{
- (void) rhport;
- return true;
-}
-#endif
-
-// Stall endpoint
-void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- // For EP0 USBD will stall both EP0 Out and In with 0x00 and 0x80
- // only handle one by skipping 0x80
- if ( ep_addr == tu_edpt_addr(0, TUSB_DIR_IN_MASK) ) return;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
-
- // Set force stall bit
- csr_set(epnum, UDP_CSR_FORCESTALL_Msk);
-}
-
-// clear stall, data toggle is also reset to DATA0
-void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
-
- // clear stall
- csr_clear(epnum, UDP_CSR_FORCESTALL_Msk);
-
- // must also reset EP to clear data toggle
- UDP->UDP_RST_EP |= (1 << epnum);
- UDP->UDP_RST_EP &= ~(1 << epnum);
-}
-
-//--------------------------------------------------------------------+
-// ISR
-//--------------------------------------------------------------------+
-void dcd_int_handler(uint8_t rhport)
-{
- uint32_t const intr_mask = UDP->UDP_IMR;
- uint32_t const intr_status = UDP->UDP_ISR & intr_mask;
-
- // clear interrupt
- UDP->UDP_ICR = intr_status;
-
- // Bus reset
- if (intr_status & UDP_ISR_ENDBUSRES_Msk)
- {
- bus_reset();
- dcd_event_bus_reset(rhport, TUSB_SPEED_FULL, true);
- }
-
- // SOF
-// if (intr_status & UDP_ISR_SOFINT_Msk) dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true);
-
- // Suspend
- if (intr_status & UDP_ISR_RXSUSP_Msk) dcd_event_bus_signal(rhport, DCD_EVENT_SUSPEND, true);
-
- // Resume
- if (intr_status & UDP_ISR_RXRSM_Msk) dcd_event_bus_signal(rhport, DCD_EVENT_RESUME, true);
-
- // Wakeup
- if (intr_status & UDP_ISR_WAKEUP_Msk) dcd_event_bus_signal(rhport, DCD_EVENT_RESUME, true);
-
- //------------- Endpoints -------------//
-
- if ( intr_status & TU_BIT(0) )
- {
- // setup packet
- if ( UDP->UDP_CSR[0] & UDP_CSR_RXSETUP )
- {
- // get setup from FIFO
- uint8_t setup[8];
- for(uint8_t i=0; i<sizeof(setup); i++)
- {
- setup[i] = (uint8_t) UDP->UDP_FDR[0];
- }
-
- // notify usbd
- dcd_event_setup_received(rhport, setup, true);
-
- // Set EP direction bit according to DATA stage
- // MUST only be set before RXSETUP is clear per specs
- if ( tu_edpt_dir(setup[0]) )
- {
- csr_set(0, UDP_CSR_DIR_Msk);
- }
- else
- {
- csr_clear(0, UDP_CSR_DIR_Msk);
- }
-
- // Clear Setup, stall and other on-going transfer bits
- csr_clear(0, UDP_CSR_RXSETUP_Msk | UDP_CSR_TXPKTRDY_Msk | UDP_CSR_TXCOMP_Msk | UDP_CSR_RX_DATA_BK0 | UDP_CSR_RX_DATA_BK1 | UDP_CSR_STALLSENT_Msk | UDP_CSR_FORCESTALL_Msk);
- }
- }
-
- for(uint8_t epnum = 0; epnum < EP_COUNT; epnum++)
- {
- if ( intr_status & TU_BIT(epnum) )
- {
- xfer_desc_t* xfer = &_dcd_xfer[epnum];
-
- //------------- Endpoint IN -------------//
- if (UDP->UDP_CSR[epnum] & UDP_CSR_TXCOMP_Msk)
- {
- xfer_packet_done(xfer);
-
- uint16_t const xact_len = xfer_packet_len(xfer);
-
- if (xact_len)
- {
- // write to EP fifo
-#if 0 // TODO support dcd_edpt_xfer_fifo
- if (xfer->ff)
- {
- tu_fifo_read_n_const_addr_full_words(xfer->ff, (void *) &UDP->UDP_FDR[epnum], xact_len);
- }
- else
-#endif
- {
- xact_ep_write(epnum, xfer->buffer, xact_len);
- }
-
- // TX ready for transfer
- csr_set(epnum, UDP_CSR_TXPKTRDY_Msk);
- }else
- {
- // xfer is complete
- dcd_event_xfer_complete(rhport, epnum | TUSB_DIR_IN_MASK, xfer->actual_len, XFER_RESULT_SUCCESS, true);
-
- // Required since control OUT can happen right after before stack handle this event
- xfer_end(xfer);
- }
-
- // Clear TX Complete bit
- csr_clear(epnum, UDP_CSR_TXCOMP_Msk);
- }
-
- //------------- Endpoint OUT -------------//
- // Ping-Pong is a MUST for Bulk/Iso
- // NOTE: When both Bank0 and Bank1 are both set, there is no way to know which one comes first
- uint32_t const banks_complete = UDP->UDP_CSR[epnum] & (UDP_CSR_RX_DATA_BK0_Msk | UDP_CSR_RX_DATA_BK1_Msk);
- if (banks_complete)
- {
- uint16_t const xact_len = (uint16_t) ((UDP->UDP_CSR[epnum] & UDP_CSR_RXBYTECNT_Msk) >> UDP_CSR_RXBYTECNT_Pos);
-
- // Read from EP fifo
-#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- tu_fifo_write_n_const_addr_full_words(xfer->ff, (const void *) &UDP->UDP_FDR[epnum], xact_len);
- }
- else
-#endif
- {
- xact_ep_read(epnum, xfer->buffer, xact_len);
- }
-
- xfer_packet_done(xfer);
-
- if ( 0 == xfer_packet_len(xfer) )
- {
- // Disable OUT EP interrupt when transfer is complete
- if (epnum != 0) UDP->UDP_IDR |= (1 << epnum);
-
- dcd_event_xfer_complete(rhport, epnum, xfer->actual_len, XFER_RESULT_SUCCESS, true);
- xfer_end(xfer);
- }
-
- // Clear DATA Bank0/1 bit
- csr_clear(epnum, banks_complete);
- }
-
- // Stall sent to host
- if (UDP->UDP_CSR[epnum] & UDP_CSR_STALLSENT_Msk)
- {
- csr_clear(epnum, UDP_CSR_STALLSENT_Msk);
- }
- }
- }
-}
-
-#endif
diff --git a/tinyusb/src/portable/microchip/samx7x/common_usb_regs.h b/tinyusb/src/portable/microchip/samx7x/common_usb_regs.h
deleted file mode 100755
index d232f0bc..00000000
--- a/tinyusb/src/portable/microchip/samx7x/common_usb_regs.h
+++ /dev/null
@@ -1,2108 +0,0 @@
- /*
-* The MIT License (MIT)
-*
-* Copyright (c) 2019 Microchip Technology Inc.
-* Copyright (c) 2018, hathach (tinyusb.org)
-* Copyright (c) 2021, HiFiPhile
-*
-* 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 file is part of the TinyUSB stack.
-*/
-
-#ifndef _COMMON_USB_REGS_H_
-#define _COMMON_USB_REGS_H_
-
-#if CFG_TUSB_MCU == OPT_MCU_SAMX7X
-
-/* -------- DEVDMANXTDSC : (USBHS Offset: 0x00) (R/W 32) Device DMA Channel Next Descriptor Address Register -------- */
-
-#define DEVDMANXTDSC_OFFSET (0x00) /**< (DEVDMANXTDSC) Device DMA Channel Next Descriptor Address Register Offset */
-
-#define DEVDMANXTDSC_NXT_DSC_ADD_Pos 0 /**< (DEVDMANXTDSC) Next Descriptor Address Position */
-#define DEVDMANXTDSC_NXT_DSC_ADD (_U_(0xFFFFFFFF) << DEVDMANXTDSC_NXT_DSC_ADD_Pos) /**< (DEVDMANXTDSC) Next Descriptor Address Mask */
-#define DEVDMANXTDSC_Msk _U_(0xFFFFFFFF) /**< (DEVDMANXTDSC) Register Mask */
-
-
-/* -------- DEVDMAADDRESS : (USBHS Offset: 0x04) (R/W 32) Device DMA Channel Address Register -------- */
-
-#define DEVDMAADDRESS_OFFSET (0x04) /**< (DEVDMAADDRESS) Device DMA Channel Address Register Offset */
-
-#define DEVDMAADDRESS_BUFF_ADD_Pos 0 /**< (DEVDMAADDRESS) Buffer Address Position */
-#define DEVDMAADDRESS_BUFF_ADD (_U_(0xFFFFFFFF) << DEVDMAADDRESS_BUFF_ADD_Pos) /**< (DEVDMAADDRESS) Buffer Address Mask */
-#define DEVDMAADDRESS_Msk _U_(0xFFFFFFFF) /**< (DEVDMAADDRESS) Register Mask */
-
-
-/* -------- DEVDMACONTROL : (USBHS Offset: 0x08) (R/W 32) Device DMA Channel Control Register -------- */
-
-#define DEVDMACONTROL_OFFSET (0x08) /**< (DEVDMACONTROL) Device DMA Channel Control Register Offset */
-
-#define DEVDMACONTROL_CHANN_ENB_Pos 0 /**< (DEVDMACONTROL) Channel Enable Command Position */
-#define DEVDMACONTROL_CHANN_ENB (_U_(0x1) << DEVDMACONTROL_CHANN_ENB_Pos) /**< (DEVDMACONTROL) Channel Enable Command Mask */
-#define DEVDMACONTROL_LDNXT_DSC_Pos 1 /**< (DEVDMACONTROL) Load Next Channel Transfer Descriptor Enable Command Position */
-#define DEVDMACONTROL_LDNXT_DSC (_U_(0x1) << DEVDMACONTROL_LDNXT_DSC_Pos) /**< (DEVDMACONTROL) Load Next Channel Transfer Descriptor Enable Command Mask */
-#define DEVDMACONTROL_END_TR_EN_Pos 2 /**< (DEVDMACONTROL) End of Transfer Enable Control (OUT transfers only) Position */
-#define DEVDMACONTROL_END_TR_EN (_U_(0x1) << DEVDMACONTROL_END_TR_EN_Pos) /**< (DEVDMACONTROL) End of Transfer Enable Control (OUT transfers only) Mask */
-#define DEVDMACONTROL_END_B_EN_Pos 3 /**< (DEVDMACONTROL) End of Buffer Enable Control Position */
-#define DEVDMACONTROL_END_B_EN (_U_(0x1) << DEVDMACONTROL_END_B_EN_Pos) /**< (DEVDMACONTROL) End of Buffer Enable Control Mask */
-#define DEVDMACONTROL_END_TR_IT_Pos 4 /**< (DEVDMACONTROL) End of Transfer Interrupt Enable Position */
-#define DEVDMACONTROL_END_TR_IT (_U_(0x1) << DEVDMACONTROL_END_TR_IT_Pos) /**< (DEVDMACONTROL) End of Transfer Interrupt Enable Mask */
-#define DEVDMACONTROL_END_BUFFIT_Pos 5 /**< (DEVDMACONTROL) End of Buffer Interrupt Enable Position */
-#define DEVDMACONTROL_END_BUFFIT (_U_(0x1) << DEVDMACONTROL_END_BUFFIT_Pos) /**< (DEVDMACONTROL) End of Buffer Interrupt Enable Mask */
-#define DEVDMACONTROL_DESC_LD_IT_Pos 6 /**< (DEVDMACONTROL) Descriptor Loaded Interrupt Enable Position */
-#define DEVDMACONTROL_DESC_LD_IT (_U_(0x1) << DEVDMACONTROL_DESC_LD_IT_Pos) /**< (DEVDMACONTROL) Descriptor Loaded Interrupt Enable Mask */
-#define DEVDMACONTROL_BURST_LCK_Pos 7 /**< (DEVDMACONTROL) Burst Lock Enable Position */
-#define DEVDMACONTROL_BURST_LCK (_U_(0x1) << DEVDMACONTROL_BURST_LCK_Pos) /**< (DEVDMACONTROL) Burst Lock Enable Mask */
-#define DEVDMACONTROL_BUFF_LENGTH_Pos 16 /**< (DEVDMACONTROL) Buffer Byte Length (Write-only) Position */
-#define DEVDMACONTROL_BUFF_LENGTH (_U_(0xFFFF) << DEVDMACONTROL_BUFF_LENGTH_Pos) /**< (DEVDMACONTROL) Buffer Byte Length (Write-only) Mask */
-#define DEVDMACONTROL_Msk _U_(0xFFFF00FF) /**< (DEVDMACONTROL) Register Mask */
-
-
-/* -------- DEVDMASTATUS : (USBHS Offset: 0x0c) (R/W 32) Device DMA Channel Status Register -------- */
-
-#define DEVDMASTATUS_OFFSET (0x0C) /**< (DEVDMASTATUS) Device DMA Channel Status Register Offset */
-
-#define DEVDMASTATUS_CHANN_ENB_Pos 0 /**< (DEVDMASTATUS) Channel Enable Status Position */
-#define DEVDMASTATUS_CHANN_ENB (_U_(0x1) << DEVDMASTATUS_CHANN_ENB_Pos) /**< (DEVDMASTATUS) Channel Enable Status Mask */
-#define DEVDMASTATUS_CHANN_ACT_Pos 1 /**< (DEVDMASTATUS) Channel Active Status Position */
-#define DEVDMASTATUS_CHANN_ACT (_U_(0x1) << DEVDMASTATUS_CHANN_ACT_Pos) /**< (DEVDMASTATUS) Channel Active Status Mask */
-#define DEVDMASTATUS_END_TR_ST_Pos 4 /**< (DEVDMASTATUS) End of Channel Transfer Status Position */
-#define DEVDMASTATUS_END_TR_ST (_U_(0x1) << DEVDMASTATUS_END_TR_ST_Pos) /**< (DEVDMASTATUS) End of Channel Transfer Status Mask */
-#define DEVDMASTATUS_END_BF_ST_Pos 5 /**< (DEVDMASTATUS) End of Channel Buffer Status Position */
-#define DEVDMASTATUS_END_BF_ST (_U_(0x1) << DEVDMASTATUS_END_BF_ST_Pos) /**< (DEVDMASTATUS) End of Channel Buffer Status Mask */
-#define DEVDMASTATUS_DESC_LDST_Pos 6 /**< (DEVDMASTATUS) Descriptor Loaded Status Position */
-#define DEVDMASTATUS_DESC_LDST (_U_(0x1) << DEVDMASTATUS_DESC_LDST_Pos) /**< (DEVDMASTATUS) Descriptor Loaded Status Mask */
-#define DEVDMASTATUS_BUFF_COUNT_Pos 16 /**< (DEVDMASTATUS) Buffer Byte Count Position */
-#define DEVDMASTATUS_BUFF_COUNT (_U_(0xFFFF) << DEVDMASTATUS_BUFF_COUNT_Pos) /**< (DEVDMASTATUS) Buffer Byte Count Mask */
-#define DEVDMASTATUS_Msk _U_(0xFFFF0073) /**< (DEVDMASTATUS) Register Mask */
-
-
-/* -------- HSTDMANXTDSC : (USBHS Offset: 0x00) (R/W 32) Host DMA Channel Next Descriptor Address Register -------- */
-
-#define HSTDMANXTDSC_OFFSET (0x00) /**< (HSTDMANXTDSC) Host DMA Channel Next Descriptor Address Register Offset */
-
-#define HSTDMANXTDSC_NXT_DSC_ADD_Pos 0 /**< (HSTDMANXTDSC) Next Descriptor Address Position */
-#define HSTDMANXTDSC_NXT_DSC_ADD (_U_(0xFFFFFFFF) << HSTDMANXTDSC_NXT_DSC_ADD_Pos) /**< (HSTDMANXTDSC) Next Descriptor Address Mask */
-#define HSTDMANXTDSC_Msk _U_(0xFFFFFFFF) /**< (HSTDMANXTDSC) Register Mask */
-
-
-/* -------- HSTDMAADDRESS : (USBHS Offset: 0x04) (R/W 32) Host DMA Channel Address Register -------- */
-
-#define HSTDMAADDRESS_OFFSET (0x04) /**< (HSTDMAADDRESS) Host DMA Channel Address Register Offset */
-
-#define HSTDMAADDRESS_BUFF_ADD_Pos 0 /**< (HSTDMAADDRESS) Buffer Address Position */
-#define HSTDMAADDRESS_BUFF_ADD (_U_(0xFFFFFFFF) << HSTDMAADDRESS_BUFF_ADD_Pos) /**< (HSTDMAADDRESS) Buffer Address Mask */
-#define HSTDMAADDRESS_Msk _U_(0xFFFFFFFF) /**< (HSTDMAADDRESS) Register Mask */
-
-
-/* -------- HSTDMACONTROL : (USBHS Offset: 0x08) (R/W 32) Host DMA Channel Control Register -------- */
-
-#define HSTDMACONTROL_OFFSET (0x08) /**< (HSTDMACONTROL) Host DMA Channel Control Register Offset */
-
-#define HSTDMACONTROL_CHANN_ENB_Pos 0 /**< (HSTDMACONTROL) Channel Enable Command Position */
-#define HSTDMACONTROL_CHANN_ENB (_U_(0x1) << HSTDMACONTROL_CHANN_ENB_Pos) /**< (HSTDMACONTROL) Channel Enable Command Mask */
-#define HSTDMACONTROL_LDNXT_DSC_Pos 1 /**< (HSTDMACONTROL) Load Next Channel Transfer Descriptor Enable Command Position */
-#define HSTDMACONTROL_LDNXT_DSC (_U_(0x1) << HSTDMACONTROL_LDNXT_DSC_Pos) /**< (HSTDMACONTROL) Load Next Channel Transfer Descriptor Enable Command Mask */
-#define HSTDMACONTROL_END_TR_EN_Pos 2 /**< (HSTDMACONTROL) End of Transfer Enable Control (OUT transfers only) Position */
-#define HSTDMACONTROL_END_TR_EN (_U_(0x1) << HSTDMACONTROL_END_TR_EN_Pos) /**< (HSTDMACONTROL) End of Transfer Enable Control (OUT transfers only) Mask */
-#define HSTDMACONTROL_END_B_EN_Pos 3 /**< (HSTDMACONTROL) End of Buffer Enable Control Position */
-#define HSTDMACONTROL_END_B_EN (_U_(0x1) << HSTDMACONTROL_END_B_EN_Pos) /**< (HSTDMACONTROL) End of Buffer Enable Control Mask */
-#define HSTDMACONTROL_END_TR_IT_Pos 4 /**< (HSTDMACONTROL) End of Transfer Interrupt Enable Position */
-#define HSTDMACONTROL_END_TR_IT (_U_(0x1) << HSTDMACONTROL_END_TR_IT_Pos) /**< (HSTDMACONTROL) End of Transfer Interrupt Enable Mask */
-#define HSTDMACONTROL_END_BUFFIT_Pos 5 /**< (HSTDMACONTROL) End of Buffer Interrupt Enable Position */
-#define HSTDMACONTROL_END_BUFFIT (_U_(0x1) << HSTDMACONTROL_END_BUFFIT_Pos) /**< (HSTDMACONTROL) End of Buffer Interrupt Enable Mask */
-#define HSTDMACONTROL_DESC_LD_IT_Pos 6 /**< (HSTDMACONTROL) Descriptor Loaded Interrupt Enable Position */
-#define HSTDMACONTROL_DESC_LD_IT (_U_(0x1) << HSTDMACONTROL_DESC_LD_IT_Pos) /**< (HSTDMACONTROL) Descriptor Loaded Interrupt Enable Mask */
-#define HSTDMACONTROL_BURST_LCK_Pos 7 /**< (HSTDMACONTROL) Burst Lock Enable Position */
-#define HSTDMACONTROL_BURST_LCK (_U_(0x1) << HSTDMACONTROL_BURST_LCK_Pos) /**< (HSTDMACONTROL) Burst Lock Enable Mask */
-#define HSTDMACONTROL_BUFF_LENGTH_Pos 16 /**< (HSTDMACONTROL) Buffer Byte Length (Write-only) Position */
-#define HSTDMACONTROL_BUFF_LENGTH (_U_(0xFFFF) << HSTDMACONTROL_BUFF_LENGTH_Pos) /**< (HSTDMACONTROL) Buffer Byte Length (Write-only) Mask */
-#define HSTDMACONTROL_Msk _U_(0xFFFF00FF) /**< (HSTDMACONTROL) Register Mask */
-
-
-/* -------- HSTDMASTATUS : (USBHS Offset: 0x0c) (R/W 32) Host DMA Channel Status Register -------- */
-
-#define HSTDMASTATUS_OFFSET (0x0C) /**< (HSTDMASTATUS) Host DMA Channel Status Register Offset */
-
-#define HSTDMASTATUS_CHANN_ENB_Pos 0 /**< (HSTDMASTATUS) Channel Enable Status Position */
-#define HSTDMASTATUS_CHANN_ENB (_U_(0x1) << HSTDMASTATUS_CHANN_ENB_Pos) /**< (HSTDMASTATUS) Channel Enable Status Mask */
-#define HSTDMASTATUS_CHANN_ACT_Pos 1 /**< (HSTDMASTATUS) Channel Active Status Position */
-#define HSTDMASTATUS_CHANN_ACT (_U_(0x1) << HSTDMASTATUS_CHANN_ACT_Pos) /**< (HSTDMASTATUS) Channel Active Status Mask */
-#define HSTDMASTATUS_END_TR_ST_Pos 4 /**< (HSTDMASTATUS) End of Channel Transfer Status Position */
-#define HSTDMASTATUS_END_TR_ST (_U_(0x1) << HSTDMASTATUS_END_TR_ST_Pos) /**< (HSTDMASTATUS) End of Channel Transfer Status Mask */
-#define HSTDMASTATUS_END_BF_ST_Pos 5 /**< (HSTDMASTATUS) End of Channel Buffer Status Position */
-#define HSTDMASTATUS_END_BF_ST (_U_(0x1) << HSTDMASTATUS_END_BF_ST_Pos) /**< (HSTDMASTATUS) End of Channel Buffer Status Mask */
-#define HSTDMASTATUS_DESC_LDST_Pos 6 /**< (HSTDMASTATUS) Descriptor Loaded Status Position */
-#define HSTDMASTATUS_DESC_LDST (_U_(0x1) << HSTDMASTATUS_DESC_LDST_Pos) /**< (HSTDMASTATUS) Descriptor Loaded Status Mask */
-#define HSTDMASTATUS_BUFF_COUNT_Pos 16 /**< (HSTDMASTATUS) Buffer Byte Count Position */
-#define HSTDMASTATUS_BUFF_COUNT (_U_(0xFFFF) << HSTDMASTATUS_BUFF_COUNT_Pos) /**< (HSTDMASTATUS) Buffer Byte Count Mask */
-#define HSTDMASTATUS_Msk _U_(0xFFFF0073) /**< (HSTDMASTATUS) Register Mask */
-
-
-/* -------- DEVCTRL : (USBHS Offset: 0x00) (R/W 32) Device General Control Register -------- */
-
-#define DEVCTRL_OFFSET (0x00) /**< (DEVCTRL) Device General Control Register Offset */
-
-#define DEVCTRL_UADD_Pos 0 /**< (DEVCTRL) USB Address Position */
-#define DEVCTRL_UADD (_U_(0x7F) << DEVCTRL_UADD_Pos) /**< (DEVCTRL) USB Address Mask */
-#define DEVCTRL_ADDEN_Pos 7 /**< (DEVCTRL) Address Enable Position */
-#define DEVCTRL_ADDEN (_U_(0x1) << DEVCTRL_ADDEN_Pos) /**< (DEVCTRL) Address Enable Mask */
-#define DEVCTRL_DETACH_Pos 8 /**< (DEVCTRL) Detach Position */
-#define DEVCTRL_DETACH (_U_(0x1) << DEVCTRL_DETACH_Pos) /**< (DEVCTRL) Detach Mask */
-#define DEVCTRL_RMWKUP_Pos 9 /**< (DEVCTRL) Remote Wake-Up Position */
-#define DEVCTRL_RMWKUP (_U_(0x1) << DEVCTRL_RMWKUP_Pos) /**< (DEVCTRL) Remote Wake-Up Mask */
-#define DEVCTRL_SPDCONF_Pos 10 /**< (DEVCTRL) Mode Configuration Position */
-#define DEVCTRL_SPDCONF (_U_(0x3) << DEVCTRL_SPDCONF_Pos) /**< (DEVCTRL) Mode Configuration Mask */
-#define DEVCTRL_SPDCONF_NORMAL_Val _U_(0x0) /**< (DEVCTRL) The peripheral starts in Full-speed mode and performs a high-speed reset to switch to High-speed mode if the host is high-speed-capable. */
-#define DEVCTRL_SPDCONF_LOW_POWER_Val _U_(0x1) /**< (DEVCTRL) For a better consumption, if high speed is not needed. */
-#define DEVCTRL_SPDCONF_HIGH_SPEED_Val _U_(0x2) /**< (DEVCTRL) Forced high speed. */
-#define DEVCTRL_SPDCONF_FORCED_FS_Val _U_(0x3) /**< (DEVCTRL) The peripheral remains in Full-speed mode whatever the host speed capability. */
-#define DEVCTRL_SPDCONF_NORMAL (DEVCTRL_SPDCONF_NORMAL_Val << DEVCTRL_SPDCONF_Pos) /**< (DEVCTRL) The peripheral starts in Full-speed mode and performs a high-speed reset to switch to High-speed mode if the host is high-speed-capable. Position */
-#define DEVCTRL_SPDCONF_LOW_POWER (DEVCTRL_SPDCONF_LOW_POWER_Val << DEVCTRL_SPDCONF_Pos) /**< (DEVCTRL) For a better consumption, if high speed is not needed. Position */
-#define DEVCTRL_SPDCONF_HIGH_SPEED (DEVCTRL_SPDCONF_HIGH_SPEED_Val << DEVCTRL_SPDCONF_Pos) /**< (DEVCTRL) Forced high speed. Position */
-#define DEVCTRL_SPDCONF_FORCED_FS (DEVCTRL_SPDCONF_FORCED_FS_Val << DEVCTRL_SPDCONF_Pos) /**< (DEVCTRL) The peripheral remains in Full-speed mode whatever the host speed capability. Position */
-#define DEVCTRL_LS_Pos 12 /**< (DEVCTRL) Low-Speed Mode Force Position */
-#define DEVCTRL_LS (_U_(0x1) << DEVCTRL_LS_Pos) /**< (DEVCTRL) Low-Speed Mode Force Mask */
-#define DEVCTRL_TSTJ_Pos 13 /**< (DEVCTRL) Test mode J Position */
-#define DEVCTRL_TSTJ (_U_(0x1) << DEVCTRL_TSTJ_Pos) /**< (DEVCTRL) Test mode J Mask */
-#define DEVCTRL_TSTK_Pos 14 /**< (DEVCTRL) Test mode K Position */
-#define DEVCTRL_TSTK (_U_(0x1) << DEVCTRL_TSTK_Pos) /**< (DEVCTRL) Test mode K Mask */
-#define DEVCTRL_TSTPCKT_Pos 15 /**< (DEVCTRL) Test packet mode Position */
-#define DEVCTRL_TSTPCKT (_U_(0x1) << DEVCTRL_TSTPCKT_Pos) /**< (DEVCTRL) Test packet mode Mask */
-#define DEVCTRL_OPMODE2_Pos 16 /**< (DEVCTRL) Specific Operational mode Position */
-#define DEVCTRL_OPMODE2 (_U_(0x1) << DEVCTRL_OPMODE2_Pos) /**< (DEVCTRL) Specific Operational mode Mask */
-#define DEVCTRL_Msk _U_(0x1FFFF) /**< (DEVCTRL) Register Mask */
-
-#define DEVCTRL_OPMODE_Pos 16 /**< (DEVCTRL Position) Specific Operational mode */
-#define DEVCTRL_OPMODE (_U_(0x1) << DEVCTRL_OPMODE_Pos) /**< (DEVCTRL Mask) OPMODE */
-
-/* -------- DEVISR : (USBHS Offset: 0x04) (R/ 32) Device Global Interrupt Status Register -------- */
-
-#define DEVISR_OFFSET (0x04) /**< (DEVISR) Device Global Interrupt Status Register Offset */
-
-#define DEVISR_SUSP_Pos 0 /**< (DEVISR) Suspend Interrupt Position */
-#define DEVISR_SUSP (_U_(0x1) << DEVISR_SUSP_Pos) /**< (DEVISR) Suspend Interrupt Mask */
-#define DEVISR_MSOF_Pos 1 /**< (DEVISR) Micro Start of Frame Interrupt Position */
-#define DEVISR_MSOF (_U_(0x1) << DEVISR_MSOF_Pos) /**< (DEVISR) Micro Start of Frame Interrupt Mask */
-#define DEVISR_SOF_Pos 2 /**< (DEVISR) Start of Frame Interrupt Position */
-#define DEVISR_SOF (_U_(0x1) << DEVISR_SOF_Pos) /**< (DEVISR) Start of Frame Interrupt Mask */
-#define DEVISR_EORST_Pos 3 /**< (DEVISR) End of Reset Interrupt Position */
-#define DEVISR_EORST (_U_(0x1) << DEVISR_EORST_Pos) /**< (DEVISR) End of Reset Interrupt Mask */
-#define DEVISR_WAKEUP_Pos 4 /**< (DEVISR) Wake-Up Interrupt Position */
-#define DEVISR_WAKEUP (_U_(0x1) << DEVISR_WAKEUP_Pos) /**< (DEVISR) Wake-Up Interrupt Mask */
-#define DEVISR_EORSM_Pos 5 /**< (DEVISR) End of Resume Interrupt Position */
-#define DEVISR_EORSM (_U_(0x1) << DEVISR_EORSM_Pos) /**< (DEVISR) End of Resume Interrupt Mask */
-#define DEVISR_UPRSM_Pos 6 /**< (DEVISR) Upstream Resume Interrupt Position */
-#define DEVISR_UPRSM (_U_(0x1) << DEVISR_UPRSM_Pos) /**< (DEVISR) Upstream Resume Interrupt Mask */
-#define DEVISR_PEP_0_Pos 12 /**< (DEVISR) Endpoint 0 Interrupt Position */
-#define DEVISR_PEP_0 (_U_(0x1) << DEVISR_PEP_0_Pos) /**< (DEVISR) Endpoint 0 Interrupt Mask */
-#define DEVISR_PEP_1_Pos 13 /**< (DEVISR) Endpoint 1 Interrupt Position */
-#define DEVISR_PEP_1 (_U_(0x1) << DEVISR_PEP_1_Pos) /**< (DEVISR) Endpoint 1 Interrupt Mask */
-#define DEVISR_PEP_2_Pos 14 /**< (DEVISR) Endpoint 2 Interrupt Position */
-#define DEVISR_PEP_2 (_U_(0x1) << DEVISR_PEP_2_Pos) /**< (DEVISR) Endpoint 2 Interrupt Mask */
-#define DEVISR_PEP_3_Pos 15 /**< (DEVISR) Endpoint 3 Interrupt Position */
-#define DEVISR_PEP_3 (_U_(0x1) << DEVISR_PEP_3_Pos) /**< (DEVISR) Endpoint 3 Interrupt Mask */
-#define DEVISR_PEP_4_Pos 16 /**< (DEVISR) Endpoint 4 Interrupt Position */
-#define DEVISR_PEP_4 (_U_(0x1) << DEVISR_PEP_4_Pos) /**< (DEVISR) Endpoint 4 Interrupt Mask */
-#define DEVISR_PEP_5_Pos 17 /**< (DEVISR) Endpoint 5 Interrupt Position */
-#define DEVISR_PEP_5 (_U_(0x1) << DEVISR_PEP_5_Pos) /**< (DEVISR) Endpoint 5 Interrupt Mask */
-#define DEVISR_PEP_6_Pos 18 /**< (DEVISR) Endpoint 6 Interrupt Position */
-#define DEVISR_PEP_6 (_U_(0x1) << DEVISR_PEP_6_Pos) /**< (DEVISR) Endpoint 6 Interrupt Mask */
-#define DEVISR_PEP_7_Pos 19 /**< (DEVISR) Endpoint 7 Interrupt Position */
-#define DEVISR_PEP_7 (_U_(0x1) << DEVISR_PEP_7_Pos) /**< (DEVISR) Endpoint 7 Interrupt Mask */
-#define DEVISR_PEP_8_Pos 20 /**< (DEVISR) Endpoint 8 Interrupt Position */
-#define DEVISR_PEP_8 (_U_(0x1) << DEVISR_PEP_8_Pos) /**< (DEVISR) Endpoint 8 Interrupt Mask */
-#define DEVISR_PEP_9_Pos 21 /**< (DEVISR) Endpoint 9 Interrupt Position */
-#define DEVISR_PEP_9 (_U_(0x1) << DEVISR_PEP_9_Pos) /**< (DEVISR) Endpoint 9 Interrupt Mask */
-#define DEVISR_DMA_1_Pos 25 /**< (DEVISR) DMA Channel 1 Interrupt Position */
-#define DEVISR_DMA_1 (_U_(0x1) << DEVISR_DMA_1_Pos) /**< (DEVISR) DMA Channel 1 Interrupt Mask */
-#define DEVISR_DMA_2_Pos 26 /**< (DEVISR) DMA Channel 2 Interrupt Position */
-#define DEVISR_DMA_2 (_U_(0x1) << DEVISR_DMA_2_Pos) /**< (DEVISR) DMA Channel 2 Interrupt Mask */
-#define DEVISR_DMA_3_Pos 27 /**< (DEVISR) DMA Channel 3 Interrupt Position */
-#define DEVISR_DMA_3 (_U_(0x1) << DEVISR_DMA_3_Pos) /**< (DEVISR) DMA Channel 3 Interrupt Mask */
-#define DEVISR_DMA_4_Pos 28 /**< (DEVISR) DMA Channel 4 Interrupt Position */
-#define DEVISR_DMA_4 (_U_(0x1) << DEVISR_DMA_4_Pos) /**< (DEVISR) DMA Channel 4 Interrupt Mask */
-#define DEVISR_DMA_5_Pos 29 /**< (DEVISR) DMA Channel 5 Interrupt Position */
-#define DEVISR_DMA_5 (_U_(0x1) << DEVISR_DMA_5_Pos) /**< (DEVISR) DMA Channel 5 Interrupt Mask */
-#define DEVISR_DMA_6_Pos 30 /**< (DEVISR) DMA Channel 6 Interrupt Position */
-#define DEVISR_DMA_6 (_U_(0x1) << DEVISR_DMA_6_Pos) /**< (DEVISR) DMA Channel 6 Interrupt Mask */
-#define DEVISR_DMA_7_Pos 31 /**< (DEVISR) DMA Channel 7 Interrupt Position */
-#define DEVISR_DMA_7 (_U_(0x1) << DEVISR_DMA_7_Pos) /**< (DEVISR) DMA Channel 7 Interrupt Mask */
-#define DEVISR_Msk _U_(0xFE3FF07F) /**< (DEVISR) Register Mask */
-
-#define DEVISR_PEP__Pos 12 /**< (DEVISR Position) Endpoint x Interrupt */
-#define DEVISR_PEP_ (_U_(0x3FF) << DEVISR_PEP__Pos) /**< (DEVISR Mask) PEP_ */
-#define DEVISR_DMA__Pos 25 /**< (DEVISR Position) DMA Channel 7 Interrupt */
-#define DEVISR_DMA_ (_U_(0x7F) << DEVISR_DMA__Pos) /**< (DEVISR Mask) DMA_ */
-
-/* -------- DEVICR : (USBHS Offset: 0x08) (/W 32) Device Global Interrupt Clear Register -------- */
-
-#define DEVICR_OFFSET (0x08) /**< (DEVICR) Device Global Interrupt Clear Register Offset */
-
-#define DEVICR_SUSPC_Pos 0 /**< (DEVICR) Suspend Interrupt Clear Position */
-#define DEVICR_SUSPC (_U_(0x1) << DEVICR_SUSPC_Pos) /**< (DEVICR) Suspend Interrupt Clear Mask */
-#define DEVICR_MSOFC_Pos 1 /**< (DEVICR) Micro Start of Frame Interrupt Clear Position */
-#define DEVICR_MSOFC (_U_(0x1) << DEVICR_MSOFC_Pos) /**< (DEVICR) Micro Start of Frame Interrupt Clear Mask */
-#define DEVICR_SOFC_Pos 2 /**< (DEVICR) Start of Frame Interrupt Clear Position */
-#define DEVICR_SOFC (_U_(0x1) << DEVICR_SOFC_Pos) /**< (DEVICR) Start of Frame Interrupt Clear Mask */
-#define DEVICR_EORSTC_Pos 3 /**< (DEVICR) End of Reset Interrupt Clear Position */
-#define DEVICR_EORSTC (_U_(0x1) << DEVICR_EORSTC_Pos) /**< (DEVICR) End of Reset Interrupt Clear Mask */
-#define DEVICR_WAKEUPC_Pos 4 /**< (DEVICR) Wake-Up Interrupt Clear Position */
-#define DEVICR_WAKEUPC (_U_(0x1) << DEVICR_WAKEUPC_Pos) /**< (DEVICR) Wake-Up Interrupt Clear Mask */
-#define DEVICR_EORSMC_Pos 5 /**< (DEVICR) End of Resume Interrupt Clear Position */
-#define DEVICR_EORSMC (_U_(0x1) << DEVICR_EORSMC_Pos) /**< (DEVICR) End of Resume Interrupt Clear Mask */
-#define DEVICR_UPRSMC_Pos 6 /**< (DEVICR) Upstream Resume Interrupt Clear Position */
-#define DEVICR_UPRSMC (_U_(0x1) << DEVICR_UPRSMC_Pos) /**< (DEVICR) Upstream Resume Interrupt Clear Mask */
-#define DEVICR_Msk _U_(0x7F) /**< (DEVICR) Register Mask */
-
-
-/* -------- DEVIFR : (USBHS Offset: 0x0c) (/W 32) Device Global Interrupt Set Register -------- */
-
-#define DEVIFR_OFFSET (0x0C) /**< (DEVIFR) Device Global Interrupt Set Register Offset */
-
-#define DEVIFR_SUSPS_Pos 0 /**< (DEVIFR) Suspend Interrupt Set Position */
-#define DEVIFR_SUSPS (_U_(0x1) << DEVIFR_SUSPS_Pos) /**< (DEVIFR) Suspend Interrupt Set Mask */
-#define DEVIFR_MSOFS_Pos 1 /**< (DEVIFR) Micro Start of Frame Interrupt Set Position */
-#define DEVIFR_MSOFS (_U_(0x1) << DEVIFR_MSOFS_Pos) /**< (DEVIFR) Micro Start of Frame Interrupt Set Mask */
-#define DEVIFR_SOFS_Pos 2 /**< (DEVIFR) Start of Frame Interrupt Set Position */
-#define DEVIFR_SOFS (_U_(0x1) << DEVIFR_SOFS_Pos) /**< (DEVIFR) Start of Frame Interrupt Set Mask */
-#define DEVIFR_EORSTS_Pos 3 /**< (DEVIFR) End of Reset Interrupt Set Position */
-#define DEVIFR_EORSTS (_U_(0x1) << DEVIFR_EORSTS_Pos) /**< (DEVIFR) End of Reset Interrupt Set Mask */
-#define DEVIFR_WAKEUPS_Pos 4 /**< (DEVIFR) Wake-Up Interrupt Set Position */
-#define DEVIFR_WAKEUPS (_U_(0x1) << DEVIFR_WAKEUPS_Pos) /**< (DEVIFR) Wake-Up Interrupt Set Mask */
-#define DEVIFR_EORSMS_Pos 5 /**< (DEVIFR) End of Resume Interrupt Set Position */
-#define DEVIFR_EORSMS (_U_(0x1) << DEVIFR_EORSMS_Pos) /**< (DEVIFR) End of Resume Interrupt Set Mask */
-#define DEVIFR_UPRSMS_Pos 6 /**< (DEVIFR) Upstream Resume Interrupt Set Position */
-#define DEVIFR_UPRSMS (_U_(0x1) << DEVIFR_UPRSMS_Pos) /**< (DEVIFR) Upstream Resume Interrupt Set Mask */
-#define DEVIFR_DMA_1_Pos 25 /**< (DEVIFR) DMA Channel 1 Interrupt Set Position */
-#define DEVIFR_DMA_1 (_U_(0x1) << DEVIFR_DMA_1_Pos) /**< (DEVIFR) DMA Channel 1 Interrupt Set Mask */
-#define DEVIFR_DMA_2_Pos 26 /**< (DEVIFR) DMA Channel 2 Interrupt Set Position */
-#define DEVIFR_DMA_2 (_U_(0x1) << DEVIFR_DMA_2_Pos) /**< (DEVIFR) DMA Channel 2 Interrupt Set Mask */
-#define DEVIFR_DMA_3_Pos 27 /**< (DEVIFR) DMA Channel 3 Interrupt Set Position */
-#define DEVIFR_DMA_3 (_U_(0x1) << DEVIFR_DMA_3_Pos) /**< (DEVIFR) DMA Channel 3 Interrupt Set Mask */
-#define DEVIFR_DMA_4_Pos 28 /**< (DEVIFR) DMA Channel 4 Interrupt Set Position */
-#define DEVIFR_DMA_4 (_U_(0x1) << DEVIFR_DMA_4_Pos) /**< (DEVIFR) DMA Channel 4 Interrupt Set Mask */
-#define DEVIFR_DMA_5_Pos 29 /**< (DEVIFR) DMA Channel 5 Interrupt Set Position */
-#define DEVIFR_DMA_5 (_U_(0x1) << DEVIFR_DMA_5_Pos) /**< (DEVIFR) DMA Channel 5 Interrupt Set Mask */
-#define DEVIFR_DMA_6_Pos 30 /**< (DEVIFR) DMA Channel 6 Interrupt Set Position */
-#define DEVIFR_DMA_6 (_U_(0x1) << DEVIFR_DMA_6_Pos) /**< (DEVIFR) DMA Channel 6 Interrupt Set Mask */
-#define DEVIFR_DMA_7_Pos 31 /**< (DEVIFR) DMA Channel 7 Interrupt Set Position */
-#define DEVIFR_DMA_7 (_U_(0x1) << DEVIFR_DMA_7_Pos) /**< (DEVIFR) DMA Channel 7 Interrupt Set Mask */
-#define DEVIFR_Msk _U_(0xFE00007F) /**< (DEVIFR) Register Mask */
-
-#define DEVIFR_DMA__Pos 25 /**< (DEVIFR Position) DMA Channel 7 Interrupt Set */
-#define DEVIFR_DMA_ (_U_(0x7F) << DEVIFR_DMA__Pos) /**< (DEVIFR Mask) DMA_ */
-
-/* -------- DEVIMR : (USBHS Offset: 0x10) (R/ 32) Device Global Interrupt Mask Register -------- */
-
-#define DEVIMR_OFFSET (0x10) /**< (DEVIMR) Device Global Interrupt Mask Register Offset */
-
-#define DEVIMR_SUSPE_Pos 0 /**< (DEVIMR) Suspend Interrupt Mask Position */
-#define DEVIMR_SUSPE (_U_(0x1) << DEVIMR_SUSPE_Pos) /**< (DEVIMR) Suspend Interrupt Mask Mask */
-#define DEVIMR_MSOFE_Pos 1 /**< (DEVIMR) Micro Start of Frame Interrupt Mask Position */
-#define DEVIMR_MSOFE (_U_(0x1) << DEVIMR_MSOFE_Pos) /**< (DEVIMR) Micro Start of Frame Interrupt Mask Mask */
-#define DEVIMR_SOFE_Pos 2 /**< (DEVIMR) Start of Frame Interrupt Mask Position */
-#define DEVIMR_SOFE (_U_(0x1) << DEVIMR_SOFE_Pos) /**< (DEVIMR) Start of Frame Interrupt Mask Mask */
-#define DEVIMR_EORSTE_Pos 3 /**< (DEVIMR) End of Reset Interrupt Mask Position */
-#define DEVIMR_EORSTE (_U_(0x1) << DEVIMR_EORSTE_Pos) /**< (DEVIMR) End of Reset Interrupt Mask Mask */
-#define DEVIMR_WAKEUPE_Pos 4 /**< (DEVIMR) Wake-Up Interrupt Mask Position */
-#define DEVIMR_WAKEUPE (_U_(0x1) << DEVIMR_WAKEUPE_Pos) /**< (DEVIMR) Wake-Up Interrupt Mask Mask */
-#define DEVIMR_EORSME_Pos 5 /**< (DEVIMR) End of Resume Interrupt Mask Position */
-#define DEVIMR_EORSME (_U_(0x1) << DEVIMR_EORSME_Pos) /**< (DEVIMR) End of Resume Interrupt Mask Mask */
-#define DEVIMR_UPRSME_Pos 6 /**< (DEVIMR) Upstream Resume Interrupt Mask Position */
-#define DEVIMR_UPRSME (_U_(0x1) << DEVIMR_UPRSME_Pos) /**< (DEVIMR) Upstream Resume Interrupt Mask Mask */
-#define DEVIMR_PEP_0_Pos 12 /**< (DEVIMR) Endpoint 0 Interrupt Mask Position */
-#define DEVIMR_PEP_0 (_U_(0x1) << DEVIMR_PEP_0_Pos) /**< (DEVIMR) Endpoint 0 Interrupt Mask Mask */
-#define DEVIMR_PEP_1_Pos 13 /**< (DEVIMR) Endpoint 1 Interrupt Mask Position */
-#define DEVIMR_PEP_1 (_U_(0x1) << DEVIMR_PEP_1_Pos) /**< (DEVIMR) Endpoint 1 Interrupt Mask Mask */
-#define DEVIMR_PEP_2_Pos 14 /**< (DEVIMR) Endpoint 2 Interrupt Mask Position */
-#define DEVIMR_PEP_2 (_U_(0x1) << DEVIMR_PEP_2_Pos) /**< (DEVIMR) Endpoint 2 Interrupt Mask Mask */
-#define DEVIMR_PEP_3_Pos 15 /**< (DEVIMR) Endpoint 3 Interrupt Mask Position */
-#define DEVIMR_PEP_3 (_U_(0x1) << DEVIMR_PEP_3_Pos) /**< (DEVIMR) Endpoint 3 Interrupt Mask Mask */
-#define DEVIMR_PEP_4_Pos 16 /**< (DEVIMR) Endpoint 4 Interrupt Mask Position */
-#define DEVIMR_PEP_4 (_U_(0x1) << DEVIMR_PEP_4_Pos) /**< (DEVIMR) Endpoint 4 Interrupt Mask Mask */
-#define DEVIMR_PEP_5_Pos 17 /**< (DEVIMR) Endpoint 5 Interrupt Mask Position */
-#define DEVIMR_PEP_5 (_U_(0x1) << DEVIMR_PEP_5_Pos) /**< (DEVIMR) Endpoint 5 Interrupt Mask Mask */
-#define DEVIMR_PEP_6_Pos 18 /**< (DEVIMR) Endpoint 6 Interrupt Mask Position */
-#define DEVIMR_PEP_6 (_U_(0x1) << DEVIMR_PEP_6_Pos) /**< (DEVIMR) Endpoint 6 Interrupt Mask Mask */
-#define DEVIMR_PEP_7_Pos 19 /**< (DEVIMR) Endpoint 7 Interrupt Mask Position */
-#define DEVIMR_PEP_7 (_U_(0x1) << DEVIMR_PEP_7_Pos) /**< (DEVIMR) Endpoint 7 Interrupt Mask Mask */
-#define DEVIMR_PEP_8_Pos 20 /**< (DEVIMR) Endpoint 8 Interrupt Mask Position */
-#define DEVIMR_PEP_8 (_U_(0x1) << DEVIMR_PEP_8_Pos) /**< (DEVIMR) Endpoint 8 Interrupt Mask Mask */
-#define DEVIMR_PEP_9_Pos 21 /**< (DEVIMR) Endpoint 9 Interrupt Mask Position */
-#define DEVIMR_PEP_9 (_U_(0x1) << DEVIMR_PEP_9_Pos) /**< (DEVIMR) Endpoint 9 Interrupt Mask Mask */
-#define DEVIMR_DMA_1_Pos 25 /**< (DEVIMR) DMA Channel 1 Interrupt Mask Position */
-#define DEVIMR_DMA_1 (_U_(0x1) << DEVIMR_DMA_1_Pos) /**< (DEVIMR) DMA Channel 1 Interrupt Mask Mask */
-#define DEVIMR_DMA_2_Pos 26 /**< (DEVIMR) DMA Channel 2 Interrupt Mask Position */
-#define DEVIMR_DMA_2 (_U_(0x1) << DEVIMR_DMA_2_Pos) /**< (DEVIMR) DMA Channel 2 Interrupt Mask Mask */
-#define DEVIMR_DMA_3_Pos 27 /**< (DEVIMR) DMA Channel 3 Interrupt Mask Position */
-#define DEVIMR_DMA_3 (_U_(0x1) << DEVIMR_DMA_3_Pos) /**< (DEVIMR) DMA Channel 3 Interrupt Mask Mask */
-#define DEVIMR_DMA_4_Pos 28 /**< (DEVIMR) DMA Channel 4 Interrupt Mask Position */
-#define DEVIMR_DMA_4 (_U_(0x1) << DEVIMR_DMA_4_Pos) /**< (DEVIMR) DMA Channel 4 Interrupt Mask Mask */
-#define DEVIMR_DMA_5_Pos 29 /**< (DEVIMR) DMA Channel 5 Interrupt Mask Position */
-#define DEVIMR_DMA_5 (_U_(0x1) << DEVIMR_DMA_5_Pos) /**< (DEVIMR) DMA Channel 5 Interrupt Mask Mask */
-#define DEVIMR_DMA_6_Pos 30 /**< (DEVIMR) DMA Channel 6 Interrupt Mask Position */
-#define DEVIMR_DMA_6 (_U_(0x1) << DEVIMR_DMA_6_Pos) /**< (DEVIMR) DMA Channel 6 Interrupt Mask Mask */
-#define DEVIMR_DMA_7_Pos 31 /**< (DEVIMR) DMA Channel 7 Interrupt Mask Position */
-#define DEVIMR_DMA_7 (_U_(0x1) << DEVIMR_DMA_7_Pos) /**< (DEVIMR) DMA Channel 7 Interrupt Mask Mask */
-#define DEVIMR_Msk _U_(0xFE3FF07F) /**< (DEVIMR) Register Mask */
-
-#define DEVIMR_PEP__Pos 12 /**< (DEVIMR Position) Endpoint x Interrupt Mask */
-#define DEVIMR_PEP_ (_U_(0x3FF) << DEVIMR_PEP__Pos) /**< (DEVIMR Mask) PEP_ */
-#define DEVIMR_DMA__Pos 25 /**< (DEVIMR Position) DMA Channel 7 Interrupt Mask */
-#define DEVIMR_DMA_ (_U_(0x7F) << DEVIMR_DMA__Pos) /**< (DEVIMR Mask) DMA_ */
-
-/* -------- DEVIDR : (USBHS Offset: 0x14) (/W 32) Device Global Interrupt Disable Register -------- */
-
-#define DEVIDR_OFFSET (0x14) /**< (DEVIDR) Device Global Interrupt Disable Register Offset */
-
-#define DEVIDR_SUSPEC_Pos 0 /**< (DEVIDR) Suspend Interrupt Disable Position */
-#define DEVIDR_SUSPEC (_U_(0x1) << DEVIDR_SUSPEC_Pos) /**< (DEVIDR) Suspend Interrupt Disable Mask */
-#define DEVIDR_MSOFEC_Pos 1 /**< (DEVIDR) Micro Start of Frame Interrupt Disable Position */
-#define DEVIDR_MSOFEC (_U_(0x1) << DEVIDR_MSOFEC_Pos) /**< (DEVIDR) Micro Start of Frame Interrupt Disable Mask */
-#define DEVIDR_SOFEC_Pos 2 /**< (DEVIDR) Start of Frame Interrupt Disable Position */
-#define DEVIDR_SOFEC (_U_(0x1) << DEVIDR_SOFEC_Pos) /**< (DEVIDR) Start of Frame Interrupt Disable Mask */
-#define DEVIDR_EORSTEC_Pos 3 /**< (DEVIDR) End of Reset Interrupt Disable Position */
-#define DEVIDR_EORSTEC (_U_(0x1) << DEVIDR_EORSTEC_Pos) /**< (DEVIDR) End of Reset Interrupt Disable Mask */
-#define DEVIDR_WAKEUPEC_Pos 4 /**< (DEVIDR) Wake-Up Interrupt Disable Position */
-#define DEVIDR_WAKEUPEC (_U_(0x1) << DEVIDR_WAKEUPEC_Pos) /**< (DEVIDR) Wake-Up Interrupt Disable Mask */
-#define DEVIDR_EORSMEC_Pos 5 /**< (DEVIDR) End of Resume Interrupt Disable Position */
-#define DEVIDR_EORSMEC (_U_(0x1) << DEVIDR_EORSMEC_Pos) /**< (DEVIDR) End of Resume Interrupt Disable Mask */
-#define DEVIDR_UPRSMEC_Pos 6 /**< (DEVIDR) Upstream Resume Interrupt Disable Position */
-#define DEVIDR_UPRSMEC (_U_(0x1) << DEVIDR_UPRSMEC_Pos) /**< (DEVIDR) Upstream Resume Interrupt Disable Mask */
-#define DEVIDR_PEP_0_Pos 12 /**< (DEVIDR) Endpoint 0 Interrupt Disable Position */
-#define DEVIDR_PEP_0 (_U_(0x1) << DEVIDR_PEP_0_Pos) /**< (DEVIDR) Endpoint 0 Interrupt Disable Mask */
-#define DEVIDR_PEP_1_Pos 13 /**< (DEVIDR) Endpoint 1 Interrupt Disable Position */
-#define DEVIDR_PEP_1 (_U_(0x1) << DEVIDR_PEP_1_Pos) /**< (DEVIDR) Endpoint 1 Interrupt Disable Mask */
-#define DEVIDR_PEP_2_Pos 14 /**< (DEVIDR) Endpoint 2 Interrupt Disable Position */
-#define DEVIDR_PEP_2 (_U_(0x1) << DEVIDR_PEP_2_Pos) /**< (DEVIDR) Endpoint 2 Interrupt Disable Mask */
-#define DEVIDR_PEP_3_Pos 15 /**< (DEVIDR) Endpoint 3 Interrupt Disable Position */
-#define DEVIDR_PEP_3 (_U_(0x1) << DEVIDR_PEP_3_Pos) /**< (DEVIDR) Endpoint 3 Interrupt Disable Mask */
-#define DEVIDR_PEP_4_Pos 16 /**< (DEVIDR) Endpoint 4 Interrupt Disable Position */
-#define DEVIDR_PEP_4 (_U_(0x1) << DEVIDR_PEP_4_Pos) /**< (DEVIDR) Endpoint 4 Interrupt Disable Mask */
-#define DEVIDR_PEP_5_Pos 17 /**< (DEVIDR) Endpoint 5 Interrupt Disable Position */
-#define DEVIDR_PEP_5 (_U_(0x1) << DEVIDR_PEP_5_Pos) /**< (DEVIDR) Endpoint 5 Interrupt Disable Mask */
-#define DEVIDR_PEP_6_Pos 18 /**< (DEVIDR) Endpoint 6 Interrupt Disable Position */
-#define DEVIDR_PEP_6 (_U_(0x1) << DEVIDR_PEP_6_Pos) /**< (DEVIDR) Endpoint 6 Interrupt Disable Mask */
-#define DEVIDR_PEP_7_Pos 19 /**< (DEVIDR) Endpoint 7 Interrupt Disable Position */
-#define DEVIDR_PEP_7 (_U_(0x1) << DEVIDR_PEP_7_Pos) /**< (DEVIDR) Endpoint 7 Interrupt Disable Mask */
-#define DEVIDR_PEP_8_Pos 20 /**< (DEVIDR) Endpoint 8 Interrupt Disable Position */
-#define DEVIDR_PEP_8 (_U_(0x1) << DEVIDR_PEP_8_Pos) /**< (DEVIDR) Endpoint 8 Interrupt Disable Mask */
-#define DEVIDR_PEP_9_Pos 21 /**< (DEVIDR) Endpoint 9 Interrupt Disable Position */
-#define DEVIDR_PEP_9 (_U_(0x1) << DEVIDR_PEP_9_Pos) /**< (DEVIDR) Endpoint 9 Interrupt Disable Mask */
-#define DEVIDR_DMA_1_Pos 25 /**< (DEVIDR) DMA Channel 1 Interrupt Disable Position */
-#define DEVIDR_DMA_1 (_U_(0x1) << DEVIDR_DMA_1_Pos) /**< (DEVIDR) DMA Channel 1 Interrupt Disable Mask */
-#define DEVIDR_DMA_2_Pos 26 /**< (DEVIDR) DMA Channel 2 Interrupt Disable Position */
-#define DEVIDR_DMA_2 (_U_(0x1) << DEVIDR_DMA_2_Pos) /**< (DEVIDR) DMA Channel 2 Interrupt Disable Mask */
-#define DEVIDR_DMA_3_Pos 27 /**< (DEVIDR) DMA Channel 3 Interrupt Disable Position */
-#define DEVIDR_DMA_3 (_U_(0x1) << DEVIDR_DMA_3_Pos) /**< (DEVIDR) DMA Channel 3 Interrupt Disable Mask */
-#define DEVIDR_DMA_4_Pos 28 /**< (DEVIDR) DMA Channel 4 Interrupt Disable Position */
-#define DEVIDR_DMA_4 (_U_(0x1) << DEVIDR_DMA_4_Pos) /**< (DEVIDR) DMA Channel 4 Interrupt Disable Mask */
-#define DEVIDR_DMA_5_Pos 29 /**< (DEVIDR) DMA Channel 5 Interrupt Disable Position */
-#define DEVIDR_DMA_5 (_U_(0x1) << DEVIDR_DMA_5_Pos) /**< (DEVIDR) DMA Channel 5 Interrupt Disable Mask */
-#define DEVIDR_DMA_6_Pos 30 /**< (DEVIDR) DMA Channel 6 Interrupt Disable Position */
-#define DEVIDR_DMA_6 (_U_(0x1) << DEVIDR_DMA_6_Pos) /**< (DEVIDR) DMA Channel 6 Interrupt Disable Mask */
-#define DEVIDR_DMA_7_Pos 31 /**< (DEVIDR) DMA Channel 7 Interrupt Disable Position */
-#define DEVIDR_DMA_7 (_U_(0x1) << DEVIDR_DMA_7_Pos) /**< (DEVIDR) DMA Channel 7 Interrupt Disable Mask */
-#define DEVIDR_Msk _U_(0xFE3FF07F) /**< (DEVIDR) Register Mask */
-
-#define DEVIDR_PEP__Pos 12 /**< (DEVIDR Position) Endpoint x Interrupt Disable */
-#define DEVIDR_PEP_ (_U_(0x3FF) << DEVIDR_PEP__Pos) /**< (DEVIDR Mask) PEP_ */
-#define DEVIDR_DMA__Pos 25 /**< (DEVIDR Position) DMA Channel 7 Interrupt Disable */
-#define DEVIDR_DMA_ (_U_(0x7F) << DEVIDR_DMA__Pos) /**< (DEVIDR Mask) DMA_ */
-
-/* -------- DEVIER : (USBHS Offset: 0x18) (/W 32) Device Global Interrupt Enable Register -------- */
-
-#define DEVIER_OFFSET (0x18) /**< (DEVIER) Device Global Interrupt Enable Register Offset */
-
-#define DEVIER_SUSPES_Pos 0 /**< (DEVIER) Suspend Interrupt Enable Position */
-#define DEVIER_SUSPES (_U_(0x1) << DEVIER_SUSPES_Pos) /**< (DEVIER) Suspend Interrupt Enable Mask */
-#define DEVIER_MSOFES_Pos 1 /**< (DEVIER) Micro Start of Frame Interrupt Enable Position */
-#define DEVIER_MSOFES (_U_(0x1) << DEVIER_MSOFES_Pos) /**< (DEVIER) Micro Start of Frame Interrupt Enable Mask */
-#define DEVIER_SOFES_Pos 2 /**< (DEVIER) Start of Frame Interrupt Enable Position */
-#define DEVIER_SOFES (_U_(0x1) << DEVIER_SOFES_Pos) /**< (DEVIER) Start of Frame Interrupt Enable Mask */
-#define DEVIER_EORSTES_Pos 3 /**< (DEVIER) End of Reset Interrupt Enable Position */
-#define DEVIER_EORSTES (_U_(0x1) << DEVIER_EORSTES_Pos) /**< (DEVIER) End of Reset Interrupt Enable Mask */
-#define DEVIER_WAKEUPES_Pos 4 /**< (DEVIER) Wake-Up Interrupt Enable Position */
-#define DEVIER_WAKEUPES (_U_(0x1) << DEVIER_WAKEUPES_Pos) /**< (DEVIER) Wake-Up Interrupt Enable Mask */
-#define DEVIER_EORSMES_Pos 5 /**< (DEVIER) End of Resume Interrupt Enable Position */
-#define DEVIER_EORSMES (_U_(0x1) << DEVIER_EORSMES_Pos) /**< (DEVIER) End of Resume Interrupt Enable Mask */
-#define DEVIER_UPRSMES_Pos 6 /**< (DEVIER) Upstream Resume Interrupt Enable Position */
-#define DEVIER_UPRSMES (_U_(0x1) << DEVIER_UPRSMES_Pos) /**< (DEVIER) Upstream Resume Interrupt Enable Mask */
-#define DEVIER_PEP_0_Pos 12 /**< (DEVIER) Endpoint 0 Interrupt Enable Position */
-#define DEVIER_PEP_0 (_U_(0x1) << DEVIER_PEP_0_Pos) /**< (DEVIER) Endpoint 0 Interrupt Enable Mask */
-#define DEVIER_PEP_1_Pos 13 /**< (DEVIER) Endpoint 1 Interrupt Enable Position */
-#define DEVIER_PEP_1 (_U_(0x1) << DEVIER_PEP_1_Pos) /**< (DEVIER) Endpoint 1 Interrupt Enable Mask */
-#define DEVIER_PEP_2_Pos 14 /**< (DEVIER) Endpoint 2 Interrupt Enable Position */
-#define DEVIER_PEP_2 (_U_(0x1) << DEVIER_PEP_2_Pos) /**< (DEVIER) Endpoint 2 Interrupt Enable Mask */
-#define DEVIER_PEP_3_Pos 15 /**< (DEVIER) Endpoint 3 Interrupt Enable Position */
-#define DEVIER_PEP_3 (_U_(0x1) << DEVIER_PEP_3_Pos) /**< (DEVIER) Endpoint 3 Interrupt Enable Mask */
-#define DEVIER_PEP_4_Pos 16 /**< (DEVIER) Endpoint 4 Interrupt Enable Position */
-#define DEVIER_PEP_4 (_U_(0x1) << DEVIER_PEP_4_Pos) /**< (DEVIER) Endpoint 4 Interrupt Enable Mask */
-#define DEVIER_PEP_5_Pos 17 /**< (DEVIER) Endpoint 5 Interrupt Enable Position */
-#define DEVIER_PEP_5 (_U_(0x1) << DEVIER_PEP_5_Pos) /**< (DEVIER) Endpoint 5 Interrupt Enable Mask */
-#define DEVIER_PEP_6_Pos 18 /**< (DEVIER) Endpoint 6 Interrupt Enable Position */
-#define DEVIER_PEP_6 (_U_(0x1) << DEVIER_PEP_6_Pos) /**< (DEVIER) Endpoint 6 Interrupt Enable Mask */
-#define DEVIER_PEP_7_Pos 19 /**< (DEVIER) Endpoint 7 Interrupt Enable Position */
-#define DEVIER_PEP_7 (_U_(0x1) << DEVIER_PEP_7_Pos) /**< (DEVIER) Endpoint 7 Interrupt Enable Mask */
-#define DEVIER_PEP_8_Pos 20 /**< (DEVIER) Endpoint 8 Interrupt Enable Position */
-#define DEVIER_PEP_8 (_U_(0x1) << DEVIER_PEP_8_Pos) /**< (DEVIER) Endpoint 8 Interrupt Enable Mask */
-#define DEVIER_PEP_9_Pos 21 /**< (DEVIER) Endpoint 9 Interrupt Enable Position */
-#define DEVIER_PEP_9 (_U_(0x1) << DEVIER_PEP_9_Pos) /**< (DEVIER) Endpoint 9 Interrupt Enable Mask */
-#define DEVIER_DMA_1_Pos 25 /**< (DEVIER) DMA Channel 1 Interrupt Enable Position */
-#define DEVIER_DMA_1 (_U_(0x1) << DEVIER_DMA_1_Pos) /**< (DEVIER) DMA Channel 1 Interrupt Enable Mask */
-#define DEVIER_DMA_2_Pos 26 /**< (DEVIER) DMA Channel 2 Interrupt Enable Position */
-#define DEVIER_DMA_2 (_U_(0x1) << DEVIER_DMA_2_Pos) /**< (DEVIER) DMA Channel 2 Interrupt Enable Mask */
-#define DEVIER_DMA_3_Pos 27 /**< (DEVIER) DMA Channel 3 Interrupt Enable Position */
-#define DEVIER_DMA_3 (_U_(0x1) << DEVIER_DMA_3_Pos) /**< (DEVIER) DMA Channel 3 Interrupt Enable Mask */
-#define DEVIER_DMA_4_Pos 28 /**< (DEVIER) DMA Channel 4 Interrupt Enable Position */
-#define DEVIER_DMA_4 (_U_(0x1) << DEVIER_DMA_4_Pos) /**< (DEVIER) DMA Channel 4 Interrupt Enable Mask */
-#define DEVIER_DMA_5_Pos 29 /**< (DEVIER) DMA Channel 5 Interrupt Enable Position */
-#define DEVIER_DMA_5 (_U_(0x1) << DEVIER_DMA_5_Pos) /**< (DEVIER) DMA Channel 5 Interrupt Enable Mask */
-#define DEVIER_DMA_6_Pos 30 /**< (DEVIER) DMA Channel 6 Interrupt Enable Position */
-#define DEVIER_DMA_6 (_U_(0x1) << DEVIER_DMA_6_Pos) /**< (DEVIER) DMA Channel 6 Interrupt Enable Mask */
-#define DEVIER_DMA_7_Pos 31 /**< (DEVIER) DMA Channel 7 Interrupt Enable Position */
-#define DEVIER_DMA_7 (_U_(0x1) << DEVIER_DMA_7_Pos) /**< (DEVIER) DMA Channel 7 Interrupt Enable Mask */
-#define DEVIER_Msk _U_(0xFE3FF07F) /**< (DEVIER) Register Mask */
-
-#define DEVIER_PEP__Pos 12 /**< (DEVIER Position) Endpoint x Interrupt Enable */
-#define DEVIER_PEP_ (_U_(0x3FF) << DEVIER_PEP__Pos) /**< (DEVIER Mask) PEP_ */
-#define DEVIER_DMA__Pos 25 /**< (DEVIER Position) DMA Channel 7 Interrupt Enable */
-#define DEVIER_DMA_ (_U_(0x7F) << DEVIER_DMA__Pos) /**< (DEVIER Mask) DMA_ */
-
-/* -------- DEVEPT : (USBHS Offset: 0x1c) (R/W 32) Device Endpoint Register -------- */
-
-#define DEVEPT_OFFSET (0x1C) /**< (DEVEPT) Device Endpoint Register Offset */
-
-#define DEVEPT_EPEN0_Pos 0 /**< (DEVEPT) Endpoint 0 Enable Position */
-#define DEVEPT_EPEN0 (_U_(0x1) << DEVEPT_EPEN0_Pos) /**< (DEVEPT) Endpoint 0 Enable Mask */
-#define DEVEPT_EPEN1_Pos 1 /**< (DEVEPT) Endpoint 1 Enable Position */
-#define DEVEPT_EPEN1 (_U_(0x1) << DEVEPT_EPEN1_Pos) /**< (DEVEPT) Endpoint 1 Enable Mask */
-#define DEVEPT_EPEN2_Pos 2 /**< (DEVEPT) Endpoint 2 Enable Position */
-#define DEVEPT_EPEN2 (_U_(0x1) << DEVEPT_EPEN2_Pos) /**< (DEVEPT) Endpoint 2 Enable Mask */
-#define DEVEPT_EPEN3_Pos 3 /**< (DEVEPT) Endpoint 3 Enable Position */
-#define DEVEPT_EPEN3 (_U_(0x1) << DEVEPT_EPEN3_Pos) /**< (DEVEPT) Endpoint 3 Enable Mask */
-#define DEVEPT_EPEN4_Pos 4 /**< (DEVEPT) Endpoint 4 Enable Position */
-#define DEVEPT_EPEN4 (_U_(0x1) << DEVEPT_EPEN4_Pos) /**< (DEVEPT) Endpoint 4 Enable Mask */
-#define DEVEPT_EPEN5_Pos 5 /**< (DEVEPT) Endpoint 5 Enable Position */
-#define DEVEPT_EPEN5 (_U_(0x1) << DEVEPT_EPEN5_Pos) /**< (DEVEPT) Endpoint 5 Enable Mask */
-#define DEVEPT_EPEN6_Pos 6 /**< (DEVEPT) Endpoint 6 Enable Position */
-#define DEVEPT_EPEN6 (_U_(0x1) << DEVEPT_EPEN6_Pos) /**< (DEVEPT) Endpoint 6 Enable Mask */
-#define DEVEPT_EPEN7_Pos 7 /**< (DEVEPT) Endpoint 7 Enable Position */
-#define DEVEPT_EPEN7 (_U_(0x1) << DEVEPT_EPEN7_Pos) /**< (DEVEPT) Endpoint 7 Enable Mask */
-#define DEVEPT_EPEN8_Pos 8 /**< (DEVEPT) Endpoint 8 Enable Position */
-#define DEVEPT_EPEN8 (_U_(0x1) << DEVEPT_EPEN8_Pos) /**< (DEVEPT) Endpoint 8 Enable Mask */
-#define DEVEPT_EPEN9_Pos 9 /**< (DEVEPT) Endpoint 9 Enable Position */
-#define DEVEPT_EPEN9 (_U_(0x1) << DEVEPT_EPEN9_Pos) /**< (DEVEPT) Endpoint 9 Enable Mask */
-#define DEVEPT_EPRST0_Pos 16 /**< (DEVEPT) Endpoint 0 Reset Position */
-#define DEVEPT_EPRST0 (_U_(0x1) << DEVEPT_EPRST0_Pos) /**< (DEVEPT) Endpoint 0 Reset Mask */
-#define DEVEPT_EPRST1_Pos 17 /**< (DEVEPT) Endpoint 1 Reset Position */
-#define DEVEPT_EPRST1 (_U_(0x1) << DEVEPT_EPRST1_Pos) /**< (DEVEPT) Endpoint 1 Reset Mask */
-#define DEVEPT_EPRST2_Pos 18 /**< (DEVEPT) Endpoint 2 Reset Position */
-#define DEVEPT_EPRST2 (_U_(0x1) << DEVEPT_EPRST2_Pos) /**< (DEVEPT) Endpoint 2 Reset Mask */
-#define DEVEPT_EPRST3_Pos 19 /**< (DEVEPT) Endpoint 3 Reset Position */
-#define DEVEPT_EPRST3 (_U_(0x1) << DEVEPT_EPRST3_Pos) /**< (DEVEPT) Endpoint 3 Reset Mask */
-#define DEVEPT_EPRST4_Pos 20 /**< (DEVEPT) Endpoint 4 Reset Position */
-#define DEVEPT_EPRST4 (_U_(0x1) << DEVEPT_EPRST4_Pos) /**< (DEVEPT) Endpoint 4 Reset Mask */
-#define DEVEPT_EPRST5_Pos 21 /**< (DEVEPT) Endpoint 5 Reset Position */
-#define DEVEPT_EPRST5 (_U_(0x1) << DEVEPT_EPRST5_Pos) /**< (DEVEPT) Endpoint 5 Reset Mask */
-#define DEVEPT_EPRST6_Pos 22 /**< (DEVEPT) Endpoint 6 Reset Position */
-#define DEVEPT_EPRST6 (_U_(0x1) << DEVEPT_EPRST6_Pos) /**< (DEVEPT) Endpoint 6 Reset Mask */
-#define DEVEPT_EPRST7_Pos 23 /**< (DEVEPT) Endpoint 7 Reset Position */
-#define DEVEPT_EPRST7 (_U_(0x1) << DEVEPT_EPRST7_Pos) /**< (DEVEPT) Endpoint 7 Reset Mask */
-#define DEVEPT_EPRST8_Pos 24 /**< (DEVEPT) Endpoint 8 Reset Position */
-#define DEVEPT_EPRST8 (_U_(0x1) << DEVEPT_EPRST8_Pos) /**< (DEVEPT) Endpoint 8 Reset Mask */
-#define DEVEPT_EPRST9_Pos 25 /**< (DEVEPT) Endpoint 9 Reset Position */
-#define DEVEPT_EPRST9 (_U_(0x1) << DEVEPT_EPRST9_Pos) /**< (DEVEPT) Endpoint 9 Reset Mask */
-#define DEVEPT_Msk _U_(0x3FF03FF) /**< (DEVEPT) Register Mask */
-
-#define DEVEPT_EPEN_Pos 0 /**< (DEVEPT Position) Endpoint x Enable */
-#define DEVEPT_EPEN (_U_(0x3FF) << DEVEPT_EPEN_Pos) /**< (DEVEPT Mask) EPEN */
-#define DEVEPT_EPRST_Pos 16 /**< (DEVEPT Position) Endpoint 9 Reset */
-#define DEVEPT_EPRST (_U_(0x3FF) << DEVEPT_EPRST_Pos) /**< (DEVEPT Mask) EPRST */
-
-/* -------- DEVFNUM : (USBHS Offset: 0x20) (R/ 32) Device Frame Number Register -------- */
-
-#define DEVFNUM_OFFSET (0x20) /**< (DEVFNUM) Device Frame Number Register Offset */
-
-#define DEVFNUM_MFNUM_Pos 0 /**< (DEVFNUM) Micro Frame Number Position */
-#define DEVFNUM_MFNUM (_U_(0x7) << DEVFNUM_MFNUM_Pos) /**< (DEVFNUM) Micro Frame Number Mask */
-#define DEVFNUM_FNUM_Pos 3 /**< (DEVFNUM) Frame Number Position */
-#define DEVFNUM_FNUM (_U_(0x7FF) << DEVFNUM_FNUM_Pos) /**< (DEVFNUM) Frame Number Mask */
-#define DEVFNUM_FNCERR_Pos 15 /**< (DEVFNUM) Frame Number CRC Error Position */
-#define DEVFNUM_FNCERR (_U_(0x1) << DEVFNUM_FNCERR_Pos) /**< (DEVFNUM) Frame Number CRC Error Mask */
-#define DEVFNUM_Msk _U_(0xBFFF) /**< (DEVFNUM) Register Mask */
-
-
-/* -------- DEVEPTCFG : (USBHS Offset: 0x100) (R/W 32) Device Endpoint Configuration Register -------- */
-
-#define DEVEPTCFG_OFFSET (0x100) /**< (DEVEPTCFG) Device Endpoint Configuration Register Offset */
-
-#define DEVEPTCFG_ALLOC_Pos 1 /**< (DEVEPTCFG) Endpoint Memory Allocate Position */
-#define DEVEPTCFG_ALLOC (_U_(0x1) << DEVEPTCFG_ALLOC_Pos) /**< (DEVEPTCFG) Endpoint Memory Allocate Mask */
-#define DEVEPTCFG_EPBK_Pos 2 /**< (DEVEPTCFG) Endpoint Banks Position */
-#define DEVEPTCFG_EPBK (_U_(0x3) << DEVEPTCFG_EPBK_Pos) /**< (DEVEPTCFG) Endpoint Banks Mask */
-#define DEVEPTCFG_EPBK_1_BANK_Val _U_(0x0) /**< (DEVEPTCFG) Single-bank endpoint */
-#define DEVEPTCFG_EPBK_2_BANK_Val _U_(0x1) /**< (DEVEPTCFG) Double-bank endpoint */
-#define DEVEPTCFG_EPBK_3_BANK_Val _U_(0x2) /**< (DEVEPTCFG) Triple-bank endpoint */
-#define DEVEPTCFG_EPBK_1_BANK (DEVEPTCFG_EPBK_1_BANK_Val << DEVEPTCFG_EPBK_Pos) /**< (DEVEPTCFG) Single-bank endpoint Position */
-#define DEVEPTCFG_EPBK_2_BANK (DEVEPTCFG_EPBK_2_BANK_Val << DEVEPTCFG_EPBK_Pos) /**< (DEVEPTCFG) Double-bank endpoint Position */
-#define DEVEPTCFG_EPBK_3_BANK (DEVEPTCFG_EPBK_3_BANK_Val << DEVEPTCFG_EPBK_Pos) /**< (DEVEPTCFG) Triple-bank endpoint Position */
-#define DEVEPTCFG_EPSIZE_Pos 4 /**< (DEVEPTCFG) Endpoint Size Position */
-#define DEVEPTCFG_EPSIZE (_U_(0x7) << DEVEPTCFG_EPSIZE_Pos) /**< (DEVEPTCFG) Endpoint Size Mask */
-#define DEVEPTCFG_EPSIZE_8_BYTE_Val _U_(0x0) /**< (DEVEPTCFG) 8 bytes */
-#define DEVEPTCFG_EPSIZE_16_BYTE_Val _U_(0x1) /**< (DEVEPTCFG) 16 bytes */
-#define DEVEPTCFG_EPSIZE_32_BYTE_Val _U_(0x2) /**< (DEVEPTCFG) 32 bytes */
-#define DEVEPTCFG_EPSIZE_64_BYTE_Val _U_(0x3) /**< (DEVEPTCFG) 64 bytes */
-#define DEVEPTCFG_EPSIZE_128_BYTE_Val _U_(0x4) /**< (DEVEPTCFG) 128 bytes */
-#define DEVEPTCFG_EPSIZE_256_BYTE_Val _U_(0x5) /**< (DEVEPTCFG) 256 bytes */
-#define DEVEPTCFG_EPSIZE_512_BYTE_Val _U_(0x6) /**< (DEVEPTCFG) 512 bytes */
-#define DEVEPTCFG_EPSIZE_1024_BYTE_Val _U_(0x7) /**< (DEVEPTCFG) 1024 bytes */
-#define DEVEPTCFG_EPSIZE_8_BYTE (DEVEPTCFG_EPSIZE_8_BYTE_Val << DEVEPTCFG_EPSIZE_Pos) /**< (DEVEPTCFG) 8 bytes Position */
-#define DEVEPTCFG_EPSIZE_16_BYTE (DEVEPTCFG_EPSIZE_16_BYTE_Val << DEVEPTCFG_EPSIZE_Pos) /**< (DEVEPTCFG) 16 bytes Position */
-#define DEVEPTCFG_EPSIZE_32_BYTE (DEVEPTCFG_EPSIZE_32_BYTE_Val << DEVEPTCFG_EPSIZE_Pos) /**< (DEVEPTCFG) 32 bytes Position */
-#define DEVEPTCFG_EPSIZE_64_BYTE (DEVEPTCFG_EPSIZE_64_BYTE_Val << DEVEPTCFG_EPSIZE_Pos) /**< (DEVEPTCFG) 64 bytes Position */
-#define DEVEPTCFG_EPSIZE_128_BYTE (DEVEPTCFG_EPSIZE_128_BYTE_Val << DEVEPTCFG_EPSIZE_Pos) /**< (DEVEPTCFG) 128 bytes Position */
-#define DEVEPTCFG_EPSIZE_256_BYTE (DEVEPTCFG_EPSIZE_256_BYTE_Val << DEVEPTCFG_EPSIZE_Pos) /**< (DEVEPTCFG) 256 bytes Position */
-#define DEVEPTCFG_EPSIZE_512_BYTE (DEVEPTCFG_EPSIZE_512_BYTE_Val << DEVEPTCFG_EPSIZE_Pos) /**< (DEVEPTCFG) 512 bytes Position */
-#define DEVEPTCFG_EPSIZE_1024_BYTE (DEVEPTCFG_EPSIZE_1024_BYTE_Val << DEVEPTCFG_EPSIZE_Pos) /**< (DEVEPTCFG) 1024 bytes Position */
-#define DEVEPTCFG_EPDIR_Pos 8 /**< (DEVEPTCFG) Endpoint Direction Position */
-#define DEVEPTCFG_EPDIR (_U_(0x1) << DEVEPTCFG_EPDIR_Pos) /**< (DEVEPTCFG) Endpoint Direction Mask */
-#define DEVEPTCFG_EPDIR_OUT_Val _U_(0x0) /**< (DEVEPTCFG) The endpoint direction is OUT. */
-#define DEVEPTCFG_EPDIR_IN_Val _U_(0x1) /**< (DEVEPTCFG) The endpoint direction is IN (nor for control endpoints). */
-#define DEVEPTCFG_EPDIR_OUT (DEVEPTCFG_EPDIR_OUT_Val << DEVEPTCFG_EPDIR_Pos) /**< (DEVEPTCFG) The endpoint direction is OUT. Position */
-#define DEVEPTCFG_EPDIR_IN (DEVEPTCFG_EPDIR_IN_Val << DEVEPTCFG_EPDIR_Pos) /**< (DEVEPTCFG) The endpoint direction is IN (nor for control endpoints). Position */
-#define DEVEPTCFG_AUTOSW_Pos 9 /**< (DEVEPTCFG) Automatic Switch Position */
-#define DEVEPTCFG_AUTOSW (_U_(0x1) << DEVEPTCFG_AUTOSW_Pos) /**< (DEVEPTCFG) Automatic Switch Mask */
-#define DEVEPTCFG_EPTYPE_Pos 11 /**< (DEVEPTCFG) Endpoint Type Position */
-#define DEVEPTCFG_EPTYPE (_U_(0x3) << DEVEPTCFG_EPTYPE_Pos) /**< (DEVEPTCFG) Endpoint Type Mask */
-#define DEVEPTCFG_EPTYPE_CTRL_Val _U_(0x0) /**< (DEVEPTCFG) Control */
-#define DEVEPTCFG_EPTYPE_ISO_Val _U_(0x1) /**< (DEVEPTCFG) Isochronous */
-#define DEVEPTCFG_EPTYPE_BLK_Val _U_(0x2) /**< (DEVEPTCFG) Bulk */
-#define DEVEPTCFG_EPTYPE_INTRPT_Val _U_(0x3) /**< (DEVEPTCFG) Interrupt */
-#define DEVEPTCFG_EPTYPE_CTRL (DEVEPTCFG_EPTYPE_CTRL_Val << DEVEPTCFG_EPTYPE_Pos) /**< (DEVEPTCFG) Control Position */
-#define DEVEPTCFG_EPTYPE_ISO (DEVEPTCFG_EPTYPE_ISO_Val << DEVEPTCFG_EPTYPE_Pos) /**< (DEVEPTCFG) Isochronous Position */
-#define DEVEPTCFG_EPTYPE_BLK (DEVEPTCFG_EPTYPE_BLK_Val << DEVEPTCFG_EPTYPE_Pos) /**< (DEVEPTCFG) Bulk Position */
-#define DEVEPTCFG_EPTYPE_INTRPT (DEVEPTCFG_EPTYPE_INTRPT_Val << DEVEPTCFG_EPTYPE_Pos) /**< (DEVEPTCFG) Interrupt Position */
-#define DEVEPTCFG_NBTRANS_Pos 13 /**< (DEVEPTCFG) Number of transactions per microframe for isochronous endpoint Position */
-#define DEVEPTCFG_NBTRANS (_U_(0x3) << DEVEPTCFG_NBTRANS_Pos) /**< (DEVEPTCFG) Number of transactions per microframe for isochronous endpoint Mask */
-#define DEVEPTCFG_NBTRANS_0_TRANS_Val _U_(0x0) /**< (DEVEPTCFG) Reserved to endpoint that does not have the high-bandwidth isochronous capability. */
-#define DEVEPTCFG_NBTRANS_1_TRANS_Val _U_(0x1) /**< (DEVEPTCFG) Default value: one transaction per microframe. */
-#define DEVEPTCFG_NBTRANS_2_TRANS_Val _U_(0x2) /**< (DEVEPTCFG) Two transactions per microframe. This endpoint should be configured as double-bank. */
-#define DEVEPTCFG_NBTRANS_3_TRANS_Val _U_(0x3) /**< (DEVEPTCFG) Three transactions per microframe. This endpoint should be configured as triple-bank. */
-#define DEVEPTCFG_NBTRANS_0_TRANS (DEVEPTCFG_NBTRANS_0_TRANS_Val << DEVEPTCFG_NBTRANS_Pos) /**< (DEVEPTCFG) Reserved to endpoint that does not have the high-bandwidth isochronous capability. Position */
-#define DEVEPTCFG_NBTRANS_1_TRANS (DEVEPTCFG_NBTRANS_1_TRANS_Val << DEVEPTCFG_NBTRANS_Pos) /**< (DEVEPTCFG) Default value: one transaction per microframe. Position */
-#define DEVEPTCFG_NBTRANS_2_TRANS (DEVEPTCFG_NBTRANS_2_TRANS_Val << DEVEPTCFG_NBTRANS_Pos) /**< (DEVEPTCFG) Two transactions per microframe. This endpoint should be configured as double-bank. Position */
-#define DEVEPTCFG_NBTRANS_3_TRANS (DEVEPTCFG_NBTRANS_3_TRANS_Val << DEVEPTCFG_NBTRANS_Pos) /**< (DEVEPTCFG) Three transactions per microframe. This endpoint should be configured as triple-bank. Position */
-#define DEVEPTCFG_Msk _U_(0x7B7E) /**< (DEVEPTCFG) Register Mask */
-
-
-/* -------- DEVEPTISR : (USBHS Offset: 0x130) (R/ 32) Device Endpoint Interrupt Status Register -------- */
-
-#define DEVEPTISR_OFFSET (0x130) /**< (DEVEPTISR) Device Endpoint Interrupt Status Register Offset */
-
-#define DEVEPTISR_TXINI_Pos 0 /**< (DEVEPTISR) Transmitted IN Data Interrupt Position */
-#define DEVEPTISR_TXINI (_U_(0x1) << DEVEPTISR_TXINI_Pos) /**< (DEVEPTISR) Transmitted IN Data Interrupt Mask */
-#define DEVEPTISR_RXOUTI_Pos 1 /**< (DEVEPTISR) Received OUT Data Interrupt Position */
-#define DEVEPTISR_RXOUTI (_U_(0x1) << DEVEPTISR_RXOUTI_Pos) /**< (DEVEPTISR) Received OUT Data Interrupt Mask */
-#define DEVEPTISR_OVERFI_Pos 5 /**< (DEVEPTISR) Overflow Interrupt Position */
-#define DEVEPTISR_OVERFI (_U_(0x1) << DEVEPTISR_OVERFI_Pos) /**< (DEVEPTISR) Overflow Interrupt Mask */
-#define DEVEPTISR_SHORTPACKET_Pos 7 /**< (DEVEPTISR) Short Packet Interrupt Position */
-#define DEVEPTISR_SHORTPACKET (_U_(0x1) << DEVEPTISR_SHORTPACKET_Pos) /**< (DEVEPTISR) Short Packet Interrupt Mask */
-#define DEVEPTISR_DTSEQ_Pos 8 /**< (DEVEPTISR) Data Toggle Sequence Position */
-#define DEVEPTISR_DTSEQ (_U_(0x3) << DEVEPTISR_DTSEQ_Pos) /**< (DEVEPTISR) Data Toggle Sequence Mask */
-#define DEVEPTISR_DTSEQ_DATA0_Val _U_(0x0) /**< (DEVEPTISR) Data0 toggle sequence */
-#define DEVEPTISR_DTSEQ_DATA1_Val _U_(0x1) /**< (DEVEPTISR) Data1 toggle sequence */
-#define DEVEPTISR_DTSEQ_DATA2_Val _U_(0x2) /**< (DEVEPTISR) Reserved for high-bandwidth isochronous endpoint */
-#define DEVEPTISR_DTSEQ_MDATA_Val _U_(0x3) /**< (DEVEPTISR) Reserved for high-bandwidth isochronous endpoint */
-#define DEVEPTISR_DTSEQ_DATA0 (DEVEPTISR_DTSEQ_DATA0_Val << DEVEPTISR_DTSEQ_Pos) /**< (DEVEPTISR) Data0 toggle sequence Position */
-#define DEVEPTISR_DTSEQ_DATA1 (DEVEPTISR_DTSEQ_DATA1_Val << DEVEPTISR_DTSEQ_Pos) /**< (DEVEPTISR) Data1 toggle sequence Position */
-#define DEVEPTISR_DTSEQ_DATA2 (DEVEPTISR_DTSEQ_DATA2_Val << DEVEPTISR_DTSEQ_Pos) /**< (DEVEPTISR) Reserved for high-bandwidth isochronous endpoint Position */
-#define DEVEPTISR_DTSEQ_MDATA (DEVEPTISR_DTSEQ_MDATA_Val << DEVEPTISR_DTSEQ_Pos) /**< (DEVEPTISR) Reserved for high-bandwidth isochronous endpoint Position */
-#define DEVEPTISR_NBUSYBK_Pos 12 /**< (DEVEPTISR) Number of Busy Banks Position */
-#define DEVEPTISR_NBUSYBK (_U_(0x3) << DEVEPTISR_NBUSYBK_Pos) /**< (DEVEPTISR) Number of Busy Banks Mask */
-#define DEVEPTISR_NBUSYBK_0_BUSY_Val _U_(0x0) /**< (DEVEPTISR) 0 busy bank (all banks free) */
-#define DEVEPTISR_NBUSYBK_1_BUSY_Val _U_(0x1) /**< (DEVEPTISR) 1 busy bank */
-#define DEVEPTISR_NBUSYBK_2_BUSY_Val _U_(0x2) /**< (DEVEPTISR) 2 busy banks */
-#define DEVEPTISR_NBUSYBK_3_BUSY_Val _U_(0x3) /**< (DEVEPTISR) 3 busy banks */
-#define DEVEPTISR_NBUSYBK_0_BUSY (DEVEPTISR_NBUSYBK_0_BUSY_Val << DEVEPTISR_NBUSYBK_Pos) /**< (DEVEPTISR) 0 busy bank (all banks free) Position */
-#define DEVEPTISR_NBUSYBK_1_BUSY (DEVEPTISR_NBUSYBK_1_BUSY_Val << DEVEPTISR_NBUSYBK_Pos) /**< (DEVEPTISR) 1 busy bank Position */
-#define DEVEPTISR_NBUSYBK_2_BUSY (DEVEPTISR_NBUSYBK_2_BUSY_Val << DEVEPTISR_NBUSYBK_Pos) /**< (DEVEPTISR) 2 busy banks Position */
-#define DEVEPTISR_NBUSYBK_3_BUSY (DEVEPTISR_NBUSYBK_3_BUSY_Val << DEVEPTISR_NBUSYBK_Pos) /**< (DEVEPTISR) 3 busy banks Position */
-#define DEVEPTISR_CURRBK_Pos 14 /**< (DEVEPTISR) Current Bank Position */
-#define DEVEPTISR_CURRBK (_U_(0x3) << DEVEPTISR_CURRBK_Pos) /**< (DEVEPTISR) Current Bank Mask */
-#define DEVEPTISR_CURRBK_BANK0_Val _U_(0x0) /**< (DEVEPTISR) Current bank is bank0 */
-#define DEVEPTISR_CURRBK_BANK1_Val _U_(0x1) /**< (DEVEPTISR) Current bank is bank1 */
-#define DEVEPTISR_CURRBK_BANK2_Val _U_(0x2) /**< (DEVEPTISR) Current bank is bank2 */
-#define DEVEPTISR_CURRBK_BANK0 (DEVEPTISR_CURRBK_BANK0_Val << DEVEPTISR_CURRBK_Pos) /**< (DEVEPTISR) Current bank is bank0 Position */
-#define DEVEPTISR_CURRBK_BANK1 (DEVEPTISR_CURRBK_BANK1_Val << DEVEPTISR_CURRBK_Pos) /**< (DEVEPTISR) Current bank is bank1 Position */
-#define DEVEPTISR_CURRBK_BANK2 (DEVEPTISR_CURRBK_BANK2_Val << DEVEPTISR_CURRBK_Pos) /**< (DEVEPTISR) Current bank is bank2 Position */
-#define DEVEPTISR_RWALL_Pos 16 /**< (DEVEPTISR) Read/Write Allowed Position */
-#define DEVEPTISR_RWALL (_U_(0x1) << DEVEPTISR_RWALL_Pos) /**< (DEVEPTISR) Read/Write Allowed Mask */
-#define DEVEPTISR_CFGOK_Pos 18 /**< (DEVEPTISR) Configuration OK Status Position */
-#define DEVEPTISR_CFGOK (_U_(0x1) << DEVEPTISR_CFGOK_Pos) /**< (DEVEPTISR) Configuration OK Status Mask */
-#define DEVEPTISR_BYCT_Pos 20 /**< (DEVEPTISR) Byte Count Position */
-#define DEVEPTISR_BYCT (_U_(0x7FF) << DEVEPTISR_BYCT_Pos) /**< (DEVEPTISR) Byte Count Mask */
-#define DEVEPTISR_Msk _U_(0x7FF5F3A3) /**< (DEVEPTISR) Register Mask */
-
-/* CTRL mode */
-#define DEVEPTISR_CTRL_RXSTPI_Pos 2 /**< (DEVEPTISR) Received SETUP Interrupt Position */
-#define DEVEPTISR_CTRL_RXSTPI (_U_(0x1) << DEVEPTISR_CTRL_RXSTPI_Pos) /**< (DEVEPTISR) Received SETUP Interrupt Mask */
-#define DEVEPTISR_CTRL_NAKOUTI_Pos 3 /**< (DEVEPTISR) NAKed OUT Interrupt Position */
-#define DEVEPTISR_CTRL_NAKOUTI (_U_(0x1) << DEVEPTISR_CTRL_NAKOUTI_Pos) /**< (DEVEPTISR) NAKed OUT Interrupt Mask */
-#define DEVEPTISR_CTRL_NAKINI_Pos 4 /**< (DEVEPTISR) NAKed IN Interrupt Position */
-#define DEVEPTISR_CTRL_NAKINI (_U_(0x1) << DEVEPTISR_CTRL_NAKINI_Pos) /**< (DEVEPTISR) NAKed IN Interrupt Mask */
-#define DEVEPTISR_CTRL_STALLEDI_Pos 6 /**< (DEVEPTISR) STALLed Interrupt Position */
-#define DEVEPTISR_CTRL_STALLEDI (_U_(0x1) << DEVEPTISR_CTRL_STALLEDI_Pos) /**< (DEVEPTISR) STALLed Interrupt Mask */
-#define DEVEPTISR_CTRL_CTRLDIR_Pos 17 /**< (DEVEPTISR) Control Direction Position */
-#define DEVEPTISR_CTRL_CTRLDIR (_U_(0x1) << DEVEPTISR_CTRL_CTRLDIR_Pos) /**< (DEVEPTISR) Control Direction Mask */
-#define DEVEPTISR_CTRL_Msk _U_(0x2005C) /**< (DEVEPTISR_CTRL) Register Mask */
-
-/* ISO mode */
-#define DEVEPTISR_ISO_UNDERFI_Pos 2 /**< (DEVEPTISR) Underflow Interrupt Position */
-#define DEVEPTISR_ISO_UNDERFI (_U_(0x1) << DEVEPTISR_ISO_UNDERFI_Pos) /**< (DEVEPTISR) Underflow Interrupt Mask */
-#define DEVEPTISR_ISO_HBISOINERRI_Pos 3 /**< (DEVEPTISR) High Bandwidth Isochronous IN Underflow Error Interrupt Position */
-#define DEVEPTISR_ISO_HBISOINERRI (_U_(0x1) << DEVEPTISR_ISO_HBISOINERRI_Pos) /**< (DEVEPTISR) High Bandwidth Isochronous IN Underflow Error Interrupt Mask */
-#define DEVEPTISR_ISO_HBISOFLUSHI_Pos 4 /**< (DEVEPTISR) High Bandwidth Isochronous IN Flush Interrupt Position */
-#define DEVEPTISR_ISO_HBISOFLUSHI (_U_(0x1) << DEVEPTISR_ISO_HBISOFLUSHI_Pos) /**< (DEVEPTISR) High Bandwidth Isochronous IN Flush Interrupt Mask */
-#define DEVEPTISR_ISO_CRCERRI_Pos 6 /**< (DEVEPTISR) CRC Error Interrupt Position */
-#define DEVEPTISR_ISO_CRCERRI (_U_(0x1) << DEVEPTISR_ISO_CRCERRI_Pos) /**< (DEVEPTISR) CRC Error Interrupt Mask */
-#define DEVEPTISR_ISO_ERRORTRANS_Pos 10 /**< (DEVEPTISR) High-bandwidth Isochronous OUT Endpoint Transaction Error Interrupt Position */
-#define DEVEPTISR_ISO_ERRORTRANS (_U_(0x1) << DEVEPTISR_ISO_ERRORTRANS_Pos) /**< (DEVEPTISR) High-bandwidth Isochronous OUT Endpoint Transaction Error Interrupt Mask */
-#define DEVEPTISR_ISO_Msk _U_(0x45C) /**< (DEVEPTISR_ISO) Register Mask */
-
-/* BLK mode */
-#define DEVEPTISR_BLK_RXSTPI_Pos 2 /**< (DEVEPTISR) Received SETUP Interrupt Position */
-#define DEVEPTISR_BLK_RXSTPI (_U_(0x1) << DEVEPTISR_BLK_RXSTPI_Pos) /**< (DEVEPTISR) Received SETUP Interrupt Mask */
-#define DEVEPTISR_BLK_NAKOUTI_Pos 3 /**< (DEVEPTISR) NAKed OUT Interrupt Position */
-#define DEVEPTISR_BLK_NAKOUTI (_U_(0x1) << DEVEPTISR_BLK_NAKOUTI_Pos) /**< (DEVEPTISR) NAKed OUT Interrupt Mask */
-#define DEVEPTISR_BLK_NAKINI_Pos 4 /**< (DEVEPTISR) NAKed IN Interrupt Position */
-#define DEVEPTISR_BLK_NAKINI (_U_(0x1) << DEVEPTISR_BLK_NAKINI_Pos) /**< (DEVEPTISR) NAKed IN Interrupt Mask */
-#define DEVEPTISR_BLK_STALLEDI_Pos 6 /**< (DEVEPTISR) STALLed Interrupt Position */
-#define DEVEPTISR_BLK_STALLEDI (_U_(0x1) << DEVEPTISR_BLK_STALLEDI_Pos) /**< (DEVEPTISR) STALLed Interrupt Mask */
-#define DEVEPTISR_BLK_CTRLDIR_Pos 17 /**< (DEVEPTISR) Control Direction Position */
-#define DEVEPTISR_BLK_CTRLDIR (_U_(0x1) << DEVEPTISR_BLK_CTRLDIR_Pos) /**< (DEVEPTISR) Control Direction Mask */
-#define DEVEPTISR_BLK_Msk _U_(0x2005C) /**< (DEVEPTISR_BLK) Register Mask */
-
-/* INTRPT mode */
-#define DEVEPTISR_INTRPT_RXSTPI_Pos 2 /**< (DEVEPTISR) Received SETUP Interrupt Position */
-#define DEVEPTISR_INTRPT_RXSTPI (_U_(0x1) << DEVEPTISR_INTRPT_RXSTPI_Pos) /**< (DEVEPTISR) Received SETUP Interrupt Mask */
-#define DEVEPTISR_INTRPT_NAKOUTI_Pos 3 /**< (DEVEPTISR) NAKed OUT Interrupt Position */
-#define DEVEPTISR_INTRPT_NAKOUTI (_U_(0x1) << DEVEPTISR_INTRPT_NAKOUTI_Pos) /**< (DEVEPTISR) NAKed OUT Interrupt Mask */
-#define DEVEPTISR_INTRPT_NAKINI_Pos 4 /**< (DEVEPTISR) NAKed IN Interrupt Position */
-#define DEVEPTISR_INTRPT_NAKINI (_U_(0x1) << DEVEPTISR_INTRPT_NAKINI_Pos) /**< (DEVEPTISR) NAKed IN Interrupt Mask */
-#define DEVEPTISR_INTRPT_STALLEDI_Pos 6 /**< (DEVEPTISR) STALLed Interrupt Position */
-#define DEVEPTISR_INTRPT_STALLEDI (_U_(0x1) << DEVEPTISR_INTRPT_STALLEDI_Pos) /**< (DEVEPTISR) STALLed Interrupt Mask */
-#define DEVEPTISR_INTRPT_CTRLDIR_Pos 17 /**< (DEVEPTISR) Control Direction Position */
-#define DEVEPTISR_INTRPT_CTRLDIR (_U_(0x1) << DEVEPTISR_INTRPT_CTRLDIR_Pos) /**< (DEVEPTISR) Control Direction Mask */
-#define DEVEPTISR_INTRPT_Msk _U_(0x2005C) /**< (DEVEPTISR_INTRPT) Register Mask */
-
-
-/* -------- DEVEPTICR : (USBHS Offset: 0x160) (/W 32) Device Endpoint Interrupt Clear Register -------- */
-
-#define DEVEPTICR_OFFSET (0x160) /**< (DEVEPTICR) Device Endpoint Interrupt Clear Register Offset */
-
-#define DEVEPTICR_TXINIC_Pos 0 /**< (DEVEPTICR) Transmitted IN Data Interrupt Clear Position */
-#define DEVEPTICR_TXINIC (_U_(0x1) << DEVEPTICR_TXINIC_Pos) /**< (DEVEPTICR) Transmitted IN Data Interrupt Clear Mask */
-#define DEVEPTICR_RXOUTIC_Pos 1 /**< (DEVEPTICR) Received OUT Data Interrupt Clear Position */
-#define DEVEPTICR_RXOUTIC (_U_(0x1) << DEVEPTICR_RXOUTIC_Pos) /**< (DEVEPTICR) Received OUT Data Interrupt Clear Mask */
-#define DEVEPTICR_OVERFIC_Pos 5 /**< (DEVEPTICR) Overflow Interrupt Clear Position */
-#define DEVEPTICR_OVERFIC (_U_(0x1) << DEVEPTICR_OVERFIC_Pos) /**< (DEVEPTICR) Overflow Interrupt Clear Mask */
-#define DEVEPTICR_SHORTPACKETC_Pos 7 /**< (DEVEPTICR) Short Packet Interrupt Clear Position */
-#define DEVEPTICR_SHORTPACKETC (_U_(0x1) << DEVEPTICR_SHORTPACKETC_Pos) /**< (DEVEPTICR) Short Packet Interrupt Clear Mask */
-#define DEVEPTICR_Msk _U_(0xA3) /**< (DEVEPTICR) Register Mask */
-
-/* CTRL mode */
-#define DEVEPTICR_CTRL_RXSTPIC_Pos 2 /**< (DEVEPTICR) Received SETUP Interrupt Clear Position */
-#define DEVEPTICR_CTRL_RXSTPIC (_U_(0x1) << DEVEPTICR_CTRL_RXSTPIC_Pos) /**< (DEVEPTICR) Received SETUP Interrupt Clear Mask */
-#define DEVEPTICR_CTRL_NAKOUTIC_Pos 3 /**< (DEVEPTICR) NAKed OUT Interrupt Clear Position */
-#define DEVEPTICR_CTRL_NAKOUTIC (_U_(0x1) << DEVEPTICR_CTRL_NAKOUTIC_Pos) /**< (DEVEPTICR) NAKed OUT Interrupt Clear Mask */
-#define DEVEPTICR_CTRL_NAKINIC_Pos 4 /**< (DEVEPTICR) NAKed IN Interrupt Clear Position */
-#define DEVEPTICR_CTRL_NAKINIC (_U_(0x1) << DEVEPTICR_CTRL_NAKINIC_Pos) /**< (DEVEPTICR) NAKed IN Interrupt Clear Mask */
-#define DEVEPTICR_CTRL_STALLEDIC_Pos 6 /**< (DEVEPTICR) STALLed Interrupt Clear Position */
-#define DEVEPTICR_CTRL_STALLEDIC (_U_(0x1) << DEVEPTICR_CTRL_STALLEDIC_Pos) /**< (DEVEPTICR) STALLed Interrupt Clear Mask */
-#define DEVEPTICR_CTRL_Msk _U_(0x5C) /**< (DEVEPTICR_CTRL) Register Mask */
-
-/* ISO mode */
-#define DEVEPTICR_ISO_UNDERFIC_Pos 2 /**< (DEVEPTICR) Underflow Interrupt Clear Position */
-#define DEVEPTICR_ISO_UNDERFIC (_U_(0x1) << DEVEPTICR_ISO_UNDERFIC_Pos) /**< (DEVEPTICR) Underflow Interrupt Clear Mask */
-#define DEVEPTICR_ISO_HBISOINERRIC_Pos 3 /**< (DEVEPTICR) High Bandwidth Isochronous IN Underflow Error Interrupt Clear Position */
-#define DEVEPTICR_ISO_HBISOINERRIC (_U_(0x1) << DEVEPTICR_ISO_HBISOINERRIC_Pos) /**< (DEVEPTICR) High Bandwidth Isochronous IN Underflow Error Interrupt Clear Mask */
-#define DEVEPTICR_ISO_HBISOFLUSHIC_Pos 4 /**< (DEVEPTICR) High Bandwidth Isochronous IN Flush Interrupt Clear Position */
-#define DEVEPTICR_ISO_HBISOFLUSHIC (_U_(0x1) << DEVEPTICR_ISO_HBISOFLUSHIC_Pos) /**< (DEVEPTICR) High Bandwidth Isochronous IN Flush Interrupt Clear Mask */
-#define DEVEPTICR_ISO_CRCERRIC_Pos 6 /**< (DEVEPTICR) CRC Error Interrupt Clear Position */
-#define DEVEPTICR_ISO_CRCERRIC (_U_(0x1) << DEVEPTICR_ISO_CRCERRIC_Pos) /**< (DEVEPTICR) CRC Error Interrupt Clear Mask */
-#define DEVEPTICR_ISO_Msk _U_(0x5C) /**< (DEVEPTICR_ISO) Register Mask */
-
-/* BLK mode */
-#define DEVEPTICR_BLK_RXSTPIC_Pos 2 /**< (DEVEPTICR) Received SETUP Interrupt Clear Position */
-#define DEVEPTICR_BLK_RXSTPIC (_U_(0x1) << DEVEPTICR_BLK_RXSTPIC_Pos) /**< (DEVEPTICR) Received SETUP Interrupt Clear Mask */
-#define DEVEPTICR_BLK_NAKOUTIC_Pos 3 /**< (DEVEPTICR) NAKed OUT Interrupt Clear Position */
-#define DEVEPTICR_BLK_NAKOUTIC (_U_(0x1) << DEVEPTICR_BLK_NAKOUTIC_Pos) /**< (DEVEPTICR) NAKed OUT Interrupt Clear Mask */
-#define DEVEPTICR_BLK_NAKINIC_Pos 4 /**< (DEVEPTICR) NAKed IN Interrupt Clear Position */
-#define DEVEPTICR_BLK_NAKINIC (_U_(0x1) << DEVEPTICR_BLK_NAKINIC_Pos) /**< (DEVEPTICR) NAKed IN Interrupt Clear Mask */
-#define DEVEPTICR_BLK_STALLEDIC_Pos 6 /**< (DEVEPTICR) STALLed Interrupt Clear Position */
-#define DEVEPTICR_BLK_STALLEDIC (_U_(0x1) << DEVEPTICR_BLK_STALLEDIC_Pos) /**< (DEVEPTICR) STALLed Interrupt Clear Mask */
-#define DEVEPTICR_BLK_Msk _U_(0x5C) /**< (DEVEPTICR_BLK) Register Mask */
-
-/* INTRPT mode */
-#define DEVEPTICR_INTRPT_RXSTPIC_Pos 2 /**< (DEVEPTICR) Received SETUP Interrupt Clear Position */
-#define DEVEPTICR_INTRPT_RXSTPIC (_U_(0x1) << DEVEPTICR_INTRPT_RXSTPIC_Pos) /**< (DEVEPTICR) Received SETUP Interrupt Clear Mask */
-#define DEVEPTICR_INTRPT_NAKOUTIC_Pos 3 /**< (DEVEPTICR) NAKed OUT Interrupt Clear Position */
-#define DEVEPTICR_INTRPT_NAKOUTIC (_U_(0x1) << DEVEPTICR_INTRPT_NAKOUTIC_Pos) /**< (DEVEPTICR) NAKed OUT Interrupt Clear Mask */
-#define DEVEPTICR_INTRPT_NAKINIC_Pos 4 /**< (DEVEPTICR) NAKed IN Interrupt Clear Position */
-#define DEVEPTICR_INTRPT_NAKINIC (_U_(0x1) << DEVEPTICR_INTRPT_NAKINIC_Pos) /**< (DEVEPTICR) NAKed IN Interrupt Clear Mask */
-#define DEVEPTICR_INTRPT_STALLEDIC_Pos 6 /**< (DEVEPTICR) STALLed Interrupt Clear Position */
-#define DEVEPTICR_INTRPT_STALLEDIC (_U_(0x1) << DEVEPTICR_INTRPT_STALLEDIC_Pos) /**< (DEVEPTICR) STALLed Interrupt Clear Mask */
-#define DEVEPTICR_INTRPT_Msk _U_(0x5C) /**< (DEVEPTICR_INTRPT) Register Mask */
-
-
-/* -------- DEVEPTIFR : (USBHS Offset: 0x190) (/W 32) Device Endpoint Interrupt Set Register -------- */
-
-#define DEVEPTIFR_OFFSET (0x190) /**< (DEVEPTIFR) Device Endpoint Interrupt Set Register Offset */
-
-#define DEVEPTIFR_TXINIS_Pos 0 /**< (DEVEPTIFR) Transmitted IN Data Interrupt Set Position */
-#define DEVEPTIFR_TXINIS (_U_(0x1) << DEVEPTIFR_TXINIS_Pos) /**< (DEVEPTIFR) Transmitted IN Data Interrupt Set Mask */
-#define DEVEPTIFR_RXOUTIS_Pos 1 /**< (DEVEPTIFR) Received OUT Data Interrupt Set Position */
-#define DEVEPTIFR_RXOUTIS (_U_(0x1) << DEVEPTIFR_RXOUTIS_Pos) /**< (DEVEPTIFR) Received OUT Data Interrupt Set Mask */
-#define DEVEPTIFR_OVERFIS_Pos 5 /**< (DEVEPTIFR) Overflow Interrupt Set Position */
-#define DEVEPTIFR_OVERFIS (_U_(0x1) << DEVEPTIFR_OVERFIS_Pos) /**< (DEVEPTIFR) Overflow Interrupt Set Mask */
-#define DEVEPTIFR_SHORTPACKETS_Pos 7 /**< (DEVEPTIFR) Short Packet Interrupt Set Position */
-#define DEVEPTIFR_SHORTPACKETS (_U_(0x1) << DEVEPTIFR_SHORTPACKETS_Pos) /**< (DEVEPTIFR) Short Packet Interrupt Set Mask */
-#define DEVEPTIFR_NBUSYBKS_Pos 12 /**< (DEVEPTIFR) Number of Busy Banks Interrupt Set Position */
-#define DEVEPTIFR_NBUSYBKS (_U_(0x1) << DEVEPTIFR_NBUSYBKS_Pos) /**< (DEVEPTIFR) Number of Busy Banks Interrupt Set Mask */
-#define DEVEPTIFR_Msk _U_(0x10A3) /**< (DEVEPTIFR) Register Mask */
-
-/* CTRL mode */
-#define DEVEPTIFR_CTRL_RXSTPIS_Pos 2 /**< (DEVEPTIFR) Received SETUP Interrupt Set Position */
-#define DEVEPTIFR_CTRL_RXSTPIS (_U_(0x1) << DEVEPTIFR_CTRL_RXSTPIS_Pos) /**< (DEVEPTIFR) Received SETUP Interrupt Set Mask */
-#define DEVEPTIFR_CTRL_NAKOUTIS_Pos 3 /**< (DEVEPTIFR) NAKed OUT Interrupt Set Position */
-#define DEVEPTIFR_CTRL_NAKOUTIS (_U_(0x1) << DEVEPTIFR_CTRL_NAKOUTIS_Pos) /**< (DEVEPTIFR) NAKed OUT Interrupt Set Mask */
-#define DEVEPTIFR_CTRL_NAKINIS_Pos 4 /**< (DEVEPTIFR) NAKed IN Interrupt Set Position */
-#define DEVEPTIFR_CTRL_NAKINIS (_U_(0x1) << DEVEPTIFR_CTRL_NAKINIS_Pos) /**< (DEVEPTIFR) NAKed IN Interrupt Set Mask */
-#define DEVEPTIFR_CTRL_STALLEDIS_Pos 6 /**< (DEVEPTIFR) STALLed Interrupt Set Position */
-#define DEVEPTIFR_CTRL_STALLEDIS (_U_(0x1) << DEVEPTIFR_CTRL_STALLEDIS_Pos) /**< (DEVEPTIFR) STALLed Interrupt Set Mask */
-#define DEVEPTIFR_CTRL_Msk _U_(0x5C) /**< (DEVEPTIFR_CTRL) Register Mask */
-
-/* ISO mode */
-#define DEVEPTIFR_ISO_UNDERFIS_Pos 2 /**< (DEVEPTIFR) Underflow Interrupt Set Position */
-#define DEVEPTIFR_ISO_UNDERFIS (_U_(0x1) << DEVEPTIFR_ISO_UNDERFIS_Pos) /**< (DEVEPTIFR) Underflow Interrupt Set Mask */
-#define DEVEPTIFR_ISO_HBISOINERRIS_Pos 3 /**< (DEVEPTIFR) High Bandwidth Isochronous IN Underflow Error Interrupt Set Position */
-#define DEVEPTIFR_ISO_HBISOINERRIS (_U_(0x1) << DEVEPTIFR_ISO_HBISOINERRIS_Pos) /**< (DEVEPTIFR) High Bandwidth Isochronous IN Underflow Error Interrupt Set Mask */
-#define DEVEPTIFR_ISO_HBISOFLUSHIS_Pos 4 /**< (DEVEPTIFR) High Bandwidth Isochronous IN Flush Interrupt Set Position */
-#define DEVEPTIFR_ISO_HBISOFLUSHIS (_U_(0x1) << DEVEPTIFR_ISO_HBISOFLUSHIS_Pos) /**< (DEVEPTIFR) High Bandwidth Isochronous IN Flush Interrupt Set Mask */
-#define DEVEPTIFR_ISO_CRCERRIS_Pos 6 /**< (DEVEPTIFR) CRC Error Interrupt Set Position */
-#define DEVEPTIFR_ISO_CRCERRIS (_U_(0x1) << DEVEPTIFR_ISO_CRCERRIS_Pos) /**< (DEVEPTIFR) CRC Error Interrupt Set Mask */
-#define DEVEPTIFR_ISO_Msk _U_(0x5C) /**< (DEVEPTIFR_ISO) Register Mask */
-
-/* BLK mode */
-#define DEVEPTIFR_BLK_RXSTPIS_Pos 2 /**< (DEVEPTIFR) Received SETUP Interrupt Set Position */
-#define DEVEPTIFR_BLK_RXSTPIS (_U_(0x1) << DEVEPTIFR_BLK_RXSTPIS_Pos) /**< (DEVEPTIFR) Received SETUP Interrupt Set Mask */
-#define DEVEPTIFR_BLK_NAKOUTIS_Pos 3 /**< (DEVEPTIFR) NAKed OUT Interrupt Set Position */
-#define DEVEPTIFR_BLK_NAKOUTIS (_U_(0x1) << DEVEPTIFR_BLK_NAKOUTIS_Pos) /**< (DEVEPTIFR) NAKed OUT Interrupt Set Mask */
-#define DEVEPTIFR_BLK_NAKINIS_Pos 4 /**< (DEVEPTIFR) NAKed IN Interrupt Set Position */
-#define DEVEPTIFR_BLK_NAKINIS (_U_(0x1) << DEVEPTIFR_BLK_NAKINIS_Pos) /**< (DEVEPTIFR) NAKed IN Interrupt Set Mask */
-#define DEVEPTIFR_BLK_STALLEDIS_Pos 6 /**< (DEVEPTIFR) STALLed Interrupt Set Position */
-#define DEVEPTIFR_BLK_STALLEDIS (_U_(0x1) << DEVEPTIFR_BLK_STALLEDIS_Pos) /**< (DEVEPTIFR) STALLed Interrupt Set Mask */
-#define DEVEPTIFR_BLK_Msk _U_(0x5C) /**< (DEVEPTIFR_BLK) Register Mask */
-
-/* INTRPT mode */
-#define DEVEPTIFR_INTRPT_RXSTPIS_Pos 2 /**< (DEVEPTIFR) Received SETUP Interrupt Set Position */
-#define DEVEPTIFR_INTRPT_RXSTPIS (_U_(0x1) << DEVEPTIFR_INTRPT_RXSTPIS_Pos) /**< (DEVEPTIFR) Received SETUP Interrupt Set Mask */
-#define DEVEPTIFR_INTRPT_NAKOUTIS_Pos 3 /**< (DEVEPTIFR) NAKed OUT Interrupt Set Position */
-#define DEVEPTIFR_INTRPT_NAKOUTIS (_U_(0x1) << DEVEPTIFR_INTRPT_NAKOUTIS_Pos) /**< (DEVEPTIFR) NAKed OUT Interrupt Set Mask */
-#define DEVEPTIFR_INTRPT_NAKINIS_Pos 4 /**< (DEVEPTIFR) NAKed IN Interrupt Set Position */
-#define DEVEPTIFR_INTRPT_NAKINIS (_U_(0x1) << DEVEPTIFR_INTRPT_NAKINIS_Pos) /**< (DEVEPTIFR) NAKed IN Interrupt Set Mask */
-#define DEVEPTIFR_INTRPT_STALLEDIS_Pos 6 /**< (DEVEPTIFR) STALLed Interrupt Set Position */
-#define DEVEPTIFR_INTRPT_STALLEDIS (_U_(0x1) << DEVEPTIFR_INTRPT_STALLEDIS_Pos) /**< (DEVEPTIFR) STALLed Interrupt Set Mask */
-#define DEVEPTIFR_INTRPT_Msk _U_(0x5C) /**< (DEVEPTIFR_INTRPT) Register Mask */
-
-
-/* -------- DEVEPTIMR : (USBHS Offset: 0x1c0) (R/ 32) Device Endpoint Interrupt Mask Register -------- */
-
-#define DEVEPTIMR_OFFSET (0x1C0) /**< (DEVEPTIMR) Device Endpoint Interrupt Mask Register Offset */
-
-#define DEVEPTIMR_TXINE_Pos 0 /**< (DEVEPTIMR) Transmitted IN Data Interrupt Position */
-#define DEVEPTIMR_TXINE (_U_(0x1) << DEVEPTIMR_TXINE_Pos) /**< (DEVEPTIMR) Transmitted IN Data Interrupt Mask */
-#define DEVEPTIMR_RXOUTE_Pos 1 /**< (DEVEPTIMR) Received OUT Data Interrupt Position */
-#define DEVEPTIMR_RXOUTE (_U_(0x1) << DEVEPTIMR_RXOUTE_Pos) /**< (DEVEPTIMR) Received OUT Data Interrupt Mask */
-#define DEVEPTIMR_OVERFE_Pos 5 /**< (DEVEPTIMR) Overflow Interrupt Position */
-#define DEVEPTIMR_OVERFE (_U_(0x1) << DEVEPTIMR_OVERFE_Pos) /**< (DEVEPTIMR) Overflow Interrupt Mask */
-#define DEVEPTIMR_SHORTPACKETE_Pos 7 /**< (DEVEPTIMR) Short Packet Interrupt Position */
-#define DEVEPTIMR_SHORTPACKETE (_U_(0x1) << DEVEPTIMR_SHORTPACKETE_Pos) /**< (DEVEPTIMR) Short Packet Interrupt Mask */
-#define DEVEPTIMR_NBUSYBKE_Pos 12 /**< (DEVEPTIMR) Number of Busy Banks Interrupt Position */
-#define DEVEPTIMR_NBUSYBKE (_U_(0x1) << DEVEPTIMR_NBUSYBKE_Pos) /**< (DEVEPTIMR) Number of Busy Banks Interrupt Mask */
-#define DEVEPTIMR_KILLBK_Pos 13 /**< (DEVEPTIMR) Kill IN Bank Position */
-#define DEVEPTIMR_KILLBK (_U_(0x1) << DEVEPTIMR_KILLBK_Pos) /**< (DEVEPTIMR) Kill IN Bank Mask */
-#define DEVEPTIMR_FIFOCON_Pos 14 /**< (DEVEPTIMR) FIFO Control Position */
-#define DEVEPTIMR_FIFOCON (_U_(0x1) << DEVEPTIMR_FIFOCON_Pos) /**< (DEVEPTIMR) FIFO Control Mask */
-#define DEVEPTIMR_EPDISHDMA_Pos 16 /**< (DEVEPTIMR) Endpoint Interrupts Disable HDMA Request Position */
-#define DEVEPTIMR_EPDISHDMA (_U_(0x1) << DEVEPTIMR_EPDISHDMA_Pos) /**< (DEVEPTIMR) Endpoint Interrupts Disable HDMA Request Mask */
-#define DEVEPTIMR_RSTDT_Pos 18 /**< (DEVEPTIMR) Reset Data Toggle Position */
-#define DEVEPTIMR_RSTDT (_U_(0x1) << DEVEPTIMR_RSTDT_Pos) /**< (DEVEPTIMR) Reset Data Toggle Mask */
-#define DEVEPTIMR_Msk _U_(0x570A3) /**< (DEVEPTIMR) Register Mask */
-
-/* CTRL mode */
-#define DEVEPTIMR_CTRL_RXSTPE_Pos 2 /**< (DEVEPTIMR) Received SETUP Interrupt Position */
-#define DEVEPTIMR_CTRL_RXSTPE (_U_(0x1) << DEVEPTIMR_CTRL_RXSTPE_Pos) /**< (DEVEPTIMR) Received SETUP Interrupt Mask */
-#define DEVEPTIMR_CTRL_NAKOUTE_Pos 3 /**< (DEVEPTIMR) NAKed OUT Interrupt Position */
-#define DEVEPTIMR_CTRL_NAKOUTE (_U_(0x1) << DEVEPTIMR_CTRL_NAKOUTE_Pos) /**< (DEVEPTIMR) NAKed OUT Interrupt Mask */
-#define DEVEPTIMR_CTRL_NAKINE_Pos 4 /**< (DEVEPTIMR) NAKed IN Interrupt Position */
-#define DEVEPTIMR_CTRL_NAKINE (_U_(0x1) << DEVEPTIMR_CTRL_NAKINE_Pos) /**< (DEVEPTIMR) NAKed IN Interrupt Mask */
-#define DEVEPTIMR_CTRL_STALLEDE_Pos 6 /**< (DEVEPTIMR) STALLed Interrupt Position */
-#define DEVEPTIMR_CTRL_STALLEDE (_U_(0x1) << DEVEPTIMR_CTRL_STALLEDE_Pos) /**< (DEVEPTIMR) STALLed Interrupt Mask */
-#define DEVEPTIMR_CTRL_NYETDIS_Pos 17 /**< (DEVEPTIMR) NYET Token Disable Position */
-#define DEVEPTIMR_CTRL_NYETDIS (_U_(0x1) << DEVEPTIMR_CTRL_NYETDIS_Pos) /**< (DEVEPTIMR) NYET Token Disable Mask */
-#define DEVEPTIMR_CTRL_STALLRQ_Pos 19 /**< (DEVEPTIMR) STALL Request Position */
-#define DEVEPTIMR_CTRL_STALLRQ (_U_(0x1) << DEVEPTIMR_CTRL_STALLRQ_Pos) /**< (DEVEPTIMR) STALL Request Mask */
-#define DEVEPTIMR_CTRL_Msk _U_(0xA005C) /**< (DEVEPTIMR_CTRL) Register Mask */
-
-/* ISO mode */
-#define DEVEPTIMR_ISO_UNDERFE_Pos 2 /**< (DEVEPTIMR) Underflow Interrupt Position */
-#define DEVEPTIMR_ISO_UNDERFE (_U_(0x1) << DEVEPTIMR_ISO_UNDERFE_Pos) /**< (DEVEPTIMR) Underflow Interrupt Mask */
-#define DEVEPTIMR_ISO_HBISOINERRE_Pos 3 /**< (DEVEPTIMR) High Bandwidth Isochronous IN Underflow Error Interrupt Position */
-#define DEVEPTIMR_ISO_HBISOINERRE (_U_(0x1) << DEVEPTIMR_ISO_HBISOINERRE_Pos) /**< (DEVEPTIMR) High Bandwidth Isochronous IN Underflow Error Interrupt Mask */
-#define DEVEPTIMR_ISO_HBISOFLUSHE_Pos 4 /**< (DEVEPTIMR) High Bandwidth Isochronous IN Flush Interrupt Position */
-#define DEVEPTIMR_ISO_HBISOFLUSHE (_U_(0x1) << DEVEPTIMR_ISO_HBISOFLUSHE_Pos) /**< (DEVEPTIMR) High Bandwidth Isochronous IN Flush Interrupt Mask */
-#define DEVEPTIMR_ISO_CRCERRE_Pos 6 /**< (DEVEPTIMR) CRC Error Interrupt Position */
-#define DEVEPTIMR_ISO_CRCERRE (_U_(0x1) << DEVEPTIMR_ISO_CRCERRE_Pos) /**< (DEVEPTIMR) CRC Error Interrupt Mask */
-#define DEVEPTIMR_ISO_MDATAE_Pos 8 /**< (DEVEPTIMR) MData Interrupt Position */
-#define DEVEPTIMR_ISO_MDATAE (_U_(0x1) << DEVEPTIMR_ISO_MDATAE_Pos) /**< (DEVEPTIMR) MData Interrupt Mask */
-#define DEVEPTIMR_ISO_DATAXE_Pos 9 /**< (DEVEPTIMR) DataX Interrupt Position */
-#define DEVEPTIMR_ISO_DATAXE (_U_(0x1) << DEVEPTIMR_ISO_DATAXE_Pos) /**< (DEVEPTIMR) DataX Interrupt Mask */
-#define DEVEPTIMR_ISO_ERRORTRANSE_Pos 10 /**< (DEVEPTIMR) Transaction Error Interrupt Position */
-#define DEVEPTIMR_ISO_ERRORTRANSE (_U_(0x1) << DEVEPTIMR_ISO_ERRORTRANSE_Pos) /**< (DEVEPTIMR) Transaction Error Interrupt Mask */
-#define DEVEPTIMR_ISO_Msk _U_(0x75C) /**< (DEVEPTIMR_ISO) Register Mask */
-
-/* BLK mode */
-#define DEVEPTIMR_BLK_RXSTPE_Pos 2 /**< (DEVEPTIMR) Received SETUP Interrupt Position */
-#define DEVEPTIMR_BLK_RXSTPE (_U_(0x1) << DEVEPTIMR_BLK_RXSTPE_Pos) /**< (DEVEPTIMR) Received SETUP Interrupt Mask */
-#define DEVEPTIMR_BLK_NAKOUTE_Pos 3 /**< (DEVEPTIMR) NAKed OUT Interrupt Position */
-#define DEVEPTIMR_BLK_NAKOUTE (_U_(0x1) << DEVEPTIMR_BLK_NAKOUTE_Pos) /**< (DEVEPTIMR) NAKed OUT Interrupt Mask */
-#define DEVEPTIMR_BLK_NAKINE_Pos 4 /**< (DEVEPTIMR) NAKed IN Interrupt Position */
-#define DEVEPTIMR_BLK_NAKINE (_U_(0x1) << DEVEPTIMR_BLK_NAKINE_Pos) /**< (DEVEPTIMR) NAKed IN Interrupt Mask */
-#define DEVEPTIMR_BLK_STALLEDE_Pos 6 /**< (DEVEPTIMR) STALLed Interrupt Position */
-#define DEVEPTIMR_BLK_STALLEDE (_U_(0x1) << DEVEPTIMR_BLK_STALLEDE_Pos) /**< (DEVEPTIMR) STALLed Interrupt Mask */
-#define DEVEPTIMR_BLK_NYETDIS_Pos 17 /**< (DEVEPTIMR) NYET Token Disable Position */
-#define DEVEPTIMR_BLK_NYETDIS (_U_(0x1) << DEVEPTIMR_BLK_NYETDIS_Pos) /**< (DEVEPTIMR) NYET Token Disable Mask */
-#define DEVEPTIMR_BLK_STALLRQ_Pos 19 /**< (DEVEPTIMR) STALL Request Position */
-#define DEVEPTIMR_BLK_STALLRQ (_U_(0x1) << DEVEPTIMR_BLK_STALLRQ_Pos) /**< (DEVEPTIMR) STALL Request Mask */
-#define DEVEPTIMR_BLK_Msk _U_(0xA005C) /**< (DEVEPTIMR_BLK) Register Mask */
-
-/* INTRPT mode */
-#define DEVEPTIMR_INTRPT_RXSTPE_Pos 2 /**< (DEVEPTIMR) Received SETUP Interrupt Position */
-#define DEVEPTIMR_INTRPT_RXSTPE (_U_(0x1) << DEVEPTIMR_INTRPT_RXSTPE_Pos) /**< (DEVEPTIMR) Received SETUP Interrupt Mask */
-#define DEVEPTIMR_INTRPT_NAKOUTE_Pos 3 /**< (DEVEPTIMR) NAKed OUT Interrupt Position */
-#define DEVEPTIMR_INTRPT_NAKOUTE (_U_(0x1) << DEVEPTIMR_INTRPT_NAKOUTE_Pos) /**< (DEVEPTIMR) NAKed OUT Interrupt Mask */
-#define DEVEPTIMR_INTRPT_NAKINE_Pos 4 /**< (DEVEPTIMR) NAKed IN Interrupt Position */
-#define DEVEPTIMR_INTRPT_NAKINE (_U_(0x1) << DEVEPTIMR_INTRPT_NAKINE_Pos) /**< (DEVEPTIMR) NAKed IN Interrupt Mask */
-#define DEVEPTIMR_INTRPT_STALLEDE_Pos 6 /**< (DEVEPTIMR) STALLed Interrupt Position */
-#define DEVEPTIMR_INTRPT_STALLEDE (_U_(0x1) << DEVEPTIMR_INTRPT_STALLEDE_Pos) /**< (DEVEPTIMR) STALLed Interrupt Mask */
-#define DEVEPTIMR_INTRPT_NYETDIS_Pos 17 /**< (DEVEPTIMR) NYET Token Disable Position */
-#define DEVEPTIMR_INTRPT_NYETDIS (_U_(0x1) << DEVEPTIMR_INTRPT_NYETDIS_Pos) /**< (DEVEPTIMR) NYET Token Disable Mask */
-#define DEVEPTIMR_INTRPT_STALLRQ_Pos 19 /**< (DEVEPTIMR) STALL Request Position */
-#define DEVEPTIMR_INTRPT_STALLRQ (_U_(0x1) << DEVEPTIMR_INTRPT_STALLRQ_Pos) /**< (DEVEPTIMR) STALL Request Mask */
-#define DEVEPTIMR_INTRPT_Msk _U_(0xA005C) /**< (DEVEPTIMR_INTRPT) Register Mask */
-
-
-/* -------- DEVEPTIER : (USBHS Offset: 0x1f0) (/W 32) Device Endpoint Interrupt Enable Register -------- */
-
-#define DEVEPTIER_OFFSET (0x1F0) /**< (DEVEPTIER) Device Endpoint Interrupt Enable Register Offset */
-
-#define DEVEPTIER_TXINES_Pos 0 /**< (DEVEPTIER) Transmitted IN Data Interrupt Enable Position */
-#define DEVEPTIER_TXINES (_U_(0x1) << DEVEPTIER_TXINES_Pos) /**< (DEVEPTIER) Transmitted IN Data Interrupt Enable Mask */
-#define DEVEPTIER_RXOUTES_Pos 1 /**< (DEVEPTIER) Received OUT Data Interrupt Enable Position */
-#define DEVEPTIER_RXOUTES (_U_(0x1) << DEVEPTIER_RXOUTES_Pos) /**< (DEVEPTIER) Received OUT Data Interrupt Enable Mask */
-#define DEVEPTIER_OVERFES_Pos 5 /**< (DEVEPTIER) Overflow Interrupt Enable Position */
-#define DEVEPTIER_OVERFES (_U_(0x1) << DEVEPTIER_OVERFES_Pos) /**< (DEVEPTIER) Overflow Interrupt Enable Mask */
-#define DEVEPTIER_SHORTPACKETES_Pos 7 /**< (DEVEPTIER) Short Packet Interrupt Enable Position */
-#define DEVEPTIER_SHORTPACKETES (_U_(0x1) << DEVEPTIER_SHORTPACKETES_Pos) /**< (DEVEPTIER) Short Packet Interrupt Enable Mask */
-#define DEVEPTIER_NBUSYBKES_Pos 12 /**< (DEVEPTIER) Number of Busy Banks Interrupt Enable Position */
-#define DEVEPTIER_NBUSYBKES (_U_(0x1) << DEVEPTIER_NBUSYBKES_Pos) /**< (DEVEPTIER) Number of Busy Banks Interrupt Enable Mask */
-#define DEVEPTIER_KILLBKS_Pos 13 /**< (DEVEPTIER) Kill IN Bank Position */
-#define DEVEPTIER_KILLBKS (_U_(0x1) << DEVEPTIER_KILLBKS_Pos) /**< (DEVEPTIER) Kill IN Bank Mask */
-#define DEVEPTIER_FIFOCONS_Pos 14 /**< (DEVEPTIER) FIFO Control Position */
-#define DEVEPTIER_FIFOCONS (_U_(0x1) << DEVEPTIER_FIFOCONS_Pos) /**< (DEVEPTIER) FIFO Control Mask */
-#define DEVEPTIER_EPDISHDMAS_Pos 16 /**< (DEVEPTIER) Endpoint Interrupts Disable HDMA Request Enable Position */
-#define DEVEPTIER_EPDISHDMAS (_U_(0x1) << DEVEPTIER_EPDISHDMAS_Pos) /**< (DEVEPTIER) Endpoint Interrupts Disable HDMA Request Enable Mask */
-#define DEVEPTIER_RSTDTS_Pos 18 /**< (DEVEPTIER) Reset Data Toggle Enable Position */
-#define DEVEPTIER_RSTDTS (_U_(0x1) << DEVEPTIER_RSTDTS_Pos) /**< (DEVEPTIER) Reset Data Toggle Enable Mask */
-#define DEVEPTIER_Msk _U_(0x570A3) /**< (DEVEPTIER) Register Mask */
-
-/* CTRL mode */
-#define DEVEPTIER_CTRL_RXSTPES_Pos 2 /**< (DEVEPTIER) Received SETUP Interrupt Enable Position */
-#define DEVEPTIER_CTRL_RXSTPES (_U_(0x1) << DEVEPTIER_CTRL_RXSTPES_Pos) /**< (DEVEPTIER) Received SETUP Interrupt Enable Mask */
-#define DEVEPTIER_CTRL_NAKOUTES_Pos 3 /**< (DEVEPTIER) NAKed OUT Interrupt Enable Position */
-#define DEVEPTIER_CTRL_NAKOUTES (_U_(0x1) << DEVEPTIER_CTRL_NAKOUTES_Pos) /**< (DEVEPTIER) NAKed OUT Interrupt Enable Mask */
-#define DEVEPTIER_CTRL_NAKINES_Pos 4 /**< (DEVEPTIER) NAKed IN Interrupt Enable Position */
-#define DEVEPTIER_CTRL_NAKINES (_U_(0x1) << DEVEPTIER_CTRL_NAKINES_Pos) /**< (DEVEPTIER) NAKed IN Interrupt Enable Mask */
-#define DEVEPTIER_CTRL_STALLEDES_Pos 6 /**< (DEVEPTIER) STALLed Interrupt Enable Position */
-#define DEVEPTIER_CTRL_STALLEDES (_U_(0x1) << DEVEPTIER_CTRL_STALLEDES_Pos) /**< (DEVEPTIER) STALLed Interrupt Enable Mask */
-#define DEVEPTIER_CTRL_NYETDISS_Pos 17 /**< (DEVEPTIER) NYET Token Disable Enable Position */
-#define DEVEPTIER_CTRL_NYETDISS (_U_(0x1) << DEVEPTIER_CTRL_NYETDISS_Pos) /**< (DEVEPTIER) NYET Token Disable Enable Mask */
-#define DEVEPTIER_CTRL_STALLRQS_Pos 19 /**< (DEVEPTIER) STALL Request Enable Position */
-#define DEVEPTIER_CTRL_STALLRQS (_U_(0x1) << DEVEPTIER_CTRL_STALLRQS_Pos) /**< (DEVEPTIER) STALL Request Enable Mask */
-#define DEVEPTIER_CTRL_Msk _U_(0xA005C) /**< (DEVEPTIER_CTRL) Register Mask */
-
-/* ISO mode */
-#define DEVEPTIER_ISO_UNDERFES_Pos 2 /**< (DEVEPTIER) Underflow Interrupt Enable Position */
-#define DEVEPTIER_ISO_UNDERFES (_U_(0x1) << DEVEPTIER_ISO_UNDERFES_Pos) /**< (DEVEPTIER) Underflow Interrupt Enable Mask */
-#define DEVEPTIER_ISO_HBISOINERRES_Pos 3 /**< (DEVEPTIER) High Bandwidth Isochronous IN Underflow Error Interrupt Enable Position */
-#define DEVEPTIER_ISO_HBISOINERRES (_U_(0x1) << DEVEPTIER_ISO_HBISOINERRES_Pos) /**< (DEVEPTIER) High Bandwidth Isochronous IN Underflow Error Interrupt Enable Mask */
-#define DEVEPTIER_ISO_HBISOFLUSHES_Pos 4 /**< (DEVEPTIER) High Bandwidth Isochronous IN Flush Interrupt Enable Position */
-#define DEVEPTIER_ISO_HBISOFLUSHES (_U_(0x1) << DEVEPTIER_ISO_HBISOFLUSHES_Pos) /**< (DEVEPTIER) High Bandwidth Isochronous IN Flush Interrupt Enable Mask */
-#define DEVEPTIER_ISO_CRCERRES_Pos 6 /**< (DEVEPTIER) CRC Error Interrupt Enable Position */
-#define DEVEPTIER_ISO_CRCERRES (_U_(0x1) << DEVEPTIER_ISO_CRCERRES_Pos) /**< (DEVEPTIER) CRC Error Interrupt Enable Mask */
-#define DEVEPTIER_ISO_MDATAES_Pos 8 /**< (DEVEPTIER) MData Interrupt Enable Position */
-#define DEVEPTIER_ISO_MDATAES (_U_(0x1) << DEVEPTIER_ISO_MDATAES_Pos) /**< (DEVEPTIER) MData Interrupt Enable Mask */
-#define DEVEPTIER_ISO_DATAXES_Pos 9 /**< (DEVEPTIER) DataX Interrupt Enable Position */
-#define DEVEPTIER_ISO_DATAXES (_U_(0x1) << DEVEPTIER_ISO_DATAXES_Pos) /**< (DEVEPTIER) DataX Interrupt Enable Mask */
-#define DEVEPTIER_ISO_ERRORTRANSES_Pos 10 /**< (DEVEPTIER) Transaction Error Interrupt Enable Position */
-#define DEVEPTIER_ISO_ERRORTRANSES (_U_(0x1) << DEVEPTIER_ISO_ERRORTRANSES_Pos) /**< (DEVEPTIER) Transaction Error Interrupt Enable Mask */
-#define DEVEPTIER_ISO_Msk _U_(0x75C) /**< (DEVEPTIER_ISO) Register Mask */
-
-/* BLK mode */
-#define DEVEPTIER_BLK_RXSTPES_Pos 2 /**< (DEVEPTIER) Received SETUP Interrupt Enable Position */
-#define DEVEPTIER_BLK_RXSTPES (_U_(0x1) << DEVEPTIER_BLK_RXSTPES_Pos) /**< (DEVEPTIER) Received SETUP Interrupt Enable Mask */
-#define DEVEPTIER_BLK_NAKOUTES_Pos 3 /**< (DEVEPTIER) NAKed OUT Interrupt Enable Position */
-#define DEVEPTIER_BLK_NAKOUTES (_U_(0x1) << DEVEPTIER_BLK_NAKOUTES_Pos) /**< (DEVEPTIER) NAKed OUT Interrupt Enable Mask */
-#define DEVEPTIER_BLK_NAKINES_Pos 4 /**< (DEVEPTIER) NAKed IN Interrupt Enable Position */
-#define DEVEPTIER_BLK_NAKINES (_U_(0x1) << DEVEPTIER_BLK_NAKINES_Pos) /**< (DEVEPTIER) NAKed IN Interrupt Enable Mask */
-#define DEVEPTIER_BLK_STALLEDES_Pos 6 /**< (DEVEPTIER) STALLed Interrupt Enable Position */
-#define DEVEPTIER_BLK_STALLEDES (_U_(0x1) << DEVEPTIER_BLK_STALLEDES_Pos) /**< (DEVEPTIER) STALLed Interrupt Enable Mask */
-#define DEVEPTIER_BLK_NYETDISS_Pos 17 /**< (DEVEPTIER) NYET Token Disable Enable Position */
-#define DEVEPTIER_BLK_NYETDISS (_U_(0x1) << DEVEPTIER_BLK_NYETDISS_Pos) /**< (DEVEPTIER) NYET Token Disable Enable Mask */
-#define DEVEPTIER_BLK_STALLRQS_Pos 19 /**< (DEVEPTIER) STALL Request Enable Position */
-#define DEVEPTIER_BLK_STALLRQS (_U_(0x1) << DEVEPTIER_BLK_STALLRQS_Pos) /**< (DEVEPTIER) STALL Request Enable Mask */
-#define DEVEPTIER_BLK_Msk _U_(0xA005C) /**< (DEVEPTIER_BLK) Register Mask */
-
-/* INTRPT mode */
-#define DEVEPTIER_INTRPT_RXSTPES_Pos 2 /**< (DEVEPTIER) Received SETUP Interrupt Enable Position */
-#define DEVEPTIER_INTRPT_RXSTPES (_U_(0x1) << DEVEPTIER_INTRPT_RXSTPES_Pos) /**< (DEVEPTIER) Received SETUP Interrupt Enable Mask */
-#define DEVEPTIER_INTRPT_NAKOUTES_Pos 3 /**< (DEVEPTIER) NAKed OUT Interrupt Enable Position */
-#define DEVEPTIER_INTRPT_NAKOUTES (_U_(0x1) << DEVEPTIER_INTRPT_NAKOUTES_Pos) /**< (DEVEPTIER) NAKed OUT Interrupt Enable Mask */
-#define DEVEPTIER_INTRPT_NAKINES_Pos 4 /**< (DEVEPTIER) NAKed IN Interrupt Enable Position */
-#define DEVEPTIER_INTRPT_NAKINES (_U_(0x1) << DEVEPTIER_INTRPT_NAKINES_Pos) /**< (DEVEPTIER) NAKed IN Interrupt Enable Mask */
-#define DEVEPTIER_INTRPT_STALLEDES_Pos 6 /**< (DEVEPTIER) STALLed Interrupt Enable Position */
-#define DEVEPTIER_INTRPT_STALLEDES (_U_(0x1) << DEVEPTIER_INTRPT_STALLEDES_Pos) /**< (DEVEPTIER) STALLed Interrupt Enable Mask */
-#define DEVEPTIER_INTRPT_NYETDISS_Pos 17 /**< (DEVEPTIER) NYET Token Disable Enable Position */
-#define DEVEPTIER_INTRPT_NYETDISS (_U_(0x1) << DEVEPTIER_INTRPT_NYETDISS_Pos) /**< (DEVEPTIER) NYET Token Disable Enable Mask */
-#define DEVEPTIER_INTRPT_STALLRQS_Pos 19 /**< (DEVEPTIER) STALL Request Enable Position */
-#define DEVEPTIER_INTRPT_STALLRQS (_U_(0x1) << DEVEPTIER_INTRPT_STALLRQS_Pos) /**< (DEVEPTIER) STALL Request Enable Mask */
-#define DEVEPTIER_INTRPT_Msk _U_(0xA005C) /**< (DEVEPTIER_INTRPT) Register Mask */
-
-
-/* -------- DEVEPTIDR : (USBHS Offset: 0x220) (/W 32) Device Endpoint Interrupt Disable Register -------- */
-
-#define DEVEPTIDR_OFFSET (0x220) /**< (DEVEPTIDR) Device Endpoint Interrupt Disable Register Offset */
-
-#define DEVEPTIDR_TXINEC_Pos 0 /**< (DEVEPTIDR) Transmitted IN Interrupt Clear Position */
-#define DEVEPTIDR_TXINEC (_U_(0x1) << DEVEPTIDR_TXINEC_Pos) /**< (DEVEPTIDR) Transmitted IN Interrupt Clear Mask */
-#define DEVEPTIDR_RXOUTEC_Pos 1 /**< (DEVEPTIDR) Received OUT Data Interrupt Clear Position */
-#define DEVEPTIDR_RXOUTEC (_U_(0x1) << DEVEPTIDR_RXOUTEC_Pos) /**< (DEVEPTIDR) Received OUT Data Interrupt Clear Mask */
-#define DEVEPTIDR_OVERFEC_Pos 5 /**< (DEVEPTIDR) Overflow Interrupt Clear Position */
-#define DEVEPTIDR_OVERFEC (_U_(0x1) << DEVEPTIDR_OVERFEC_Pos) /**< (DEVEPTIDR) Overflow Interrupt Clear Mask */
-#define DEVEPTIDR_SHORTPACKETEC_Pos 7 /**< (DEVEPTIDR) Shortpacket Interrupt Clear Position */
-#define DEVEPTIDR_SHORTPACKETEC (_U_(0x1) << DEVEPTIDR_SHORTPACKETEC_Pos) /**< (DEVEPTIDR) Shortpacket Interrupt Clear Mask */
-#define DEVEPTIDR_NBUSYBKEC_Pos 12 /**< (DEVEPTIDR) Number of Busy Banks Interrupt Clear Position */
-#define DEVEPTIDR_NBUSYBKEC (_U_(0x1) << DEVEPTIDR_NBUSYBKEC_Pos) /**< (DEVEPTIDR) Number of Busy Banks Interrupt Clear Mask */
-#define DEVEPTIDR_FIFOCONC_Pos 14 /**< (DEVEPTIDR) FIFO Control Clear Position */
-#define DEVEPTIDR_FIFOCONC (_U_(0x1) << DEVEPTIDR_FIFOCONC_Pos) /**< (DEVEPTIDR) FIFO Control Clear Mask */
-#define DEVEPTIDR_EPDISHDMAC_Pos 16 /**< (DEVEPTIDR) Endpoint Interrupts Disable HDMA Request Clear Position */
-#define DEVEPTIDR_EPDISHDMAC (_U_(0x1) << DEVEPTIDR_EPDISHDMAC_Pos) /**< (DEVEPTIDR) Endpoint Interrupts Disable HDMA Request Clear Mask */
-#define DEVEPTIDR_Msk _U_(0x150A3) /**< (DEVEPTIDR) Register Mask */
-
-/* CTRL mode */
-#define DEVEPTIDR_CTRL_RXSTPEC_Pos 2 /**< (DEVEPTIDR) Received SETUP Interrupt Clear Position */
-#define DEVEPTIDR_CTRL_RXSTPEC (_U_(0x1) << DEVEPTIDR_CTRL_RXSTPEC_Pos) /**< (DEVEPTIDR) Received SETUP Interrupt Clear Mask */
-#define DEVEPTIDR_CTRL_NAKOUTEC_Pos 3 /**< (DEVEPTIDR) NAKed OUT Interrupt Clear Position */
-#define DEVEPTIDR_CTRL_NAKOUTEC (_U_(0x1) << DEVEPTIDR_CTRL_NAKOUTEC_Pos) /**< (DEVEPTIDR) NAKed OUT Interrupt Clear Mask */
-#define DEVEPTIDR_CTRL_NAKINEC_Pos 4 /**< (DEVEPTIDR) NAKed IN Interrupt Clear Position */
-#define DEVEPTIDR_CTRL_NAKINEC (_U_(0x1) << DEVEPTIDR_CTRL_NAKINEC_Pos) /**< (DEVEPTIDR) NAKed IN Interrupt Clear Mask */
-#define DEVEPTIDR_CTRL_STALLEDEC_Pos 6 /**< (DEVEPTIDR) STALLed Interrupt Clear Position */
-#define DEVEPTIDR_CTRL_STALLEDEC (_U_(0x1) << DEVEPTIDR_CTRL_STALLEDEC_Pos) /**< (DEVEPTIDR) STALLed Interrupt Clear Mask */
-#define DEVEPTIDR_CTRL_NYETDISC_Pos 17 /**< (DEVEPTIDR) NYET Token Disable Clear Position */
-#define DEVEPTIDR_CTRL_NYETDISC (_U_(0x1) << DEVEPTIDR_CTRL_NYETDISC_Pos) /**< (DEVEPTIDR) NYET Token Disable Clear Mask */
-#define DEVEPTIDR_CTRL_STALLRQC_Pos 19 /**< (DEVEPTIDR) STALL Request Clear Position */
-#define DEVEPTIDR_CTRL_STALLRQC (_U_(0x1) << DEVEPTIDR_CTRL_STALLRQC_Pos) /**< (DEVEPTIDR) STALL Request Clear Mask */
-#define DEVEPTIDR_CTRL_Msk _U_(0xA005C) /**< (DEVEPTIDR_CTRL) Register Mask */
-
-/* ISO mode */
-#define DEVEPTIDR_ISO_UNDERFEC_Pos 2 /**< (DEVEPTIDR) Underflow Interrupt Clear Position */
-#define DEVEPTIDR_ISO_UNDERFEC (_U_(0x1) << DEVEPTIDR_ISO_UNDERFEC_Pos) /**< (DEVEPTIDR) Underflow Interrupt Clear Mask */
-#define DEVEPTIDR_ISO_HBISOINERREC_Pos 3 /**< (DEVEPTIDR) High Bandwidth Isochronous IN Underflow Error Interrupt Clear Position */
-#define DEVEPTIDR_ISO_HBISOINERREC (_U_(0x1) << DEVEPTIDR_ISO_HBISOINERREC_Pos) /**< (DEVEPTIDR) High Bandwidth Isochronous IN Underflow Error Interrupt Clear Mask */
-#define DEVEPTIDR_ISO_HBISOFLUSHEC_Pos 4 /**< (DEVEPTIDR) High Bandwidth Isochronous IN Flush Interrupt Clear Position */
-#define DEVEPTIDR_ISO_HBISOFLUSHEC (_U_(0x1) << DEVEPTIDR_ISO_HBISOFLUSHEC_Pos) /**< (DEVEPTIDR) High Bandwidth Isochronous IN Flush Interrupt Clear Mask */
-#define DEVEPTIDR_ISO_MDATAEC_Pos 8 /**< (DEVEPTIDR) MData Interrupt Clear Position */
-#define DEVEPTIDR_ISO_MDATAEC (_U_(0x1) << DEVEPTIDR_ISO_MDATAEC_Pos) /**< (DEVEPTIDR) MData Interrupt Clear Mask */
-#define DEVEPTIDR_ISO_DATAXEC_Pos 9 /**< (DEVEPTIDR) DataX Interrupt Clear Position */
-#define DEVEPTIDR_ISO_DATAXEC (_U_(0x1) << DEVEPTIDR_ISO_DATAXEC_Pos) /**< (DEVEPTIDR) DataX Interrupt Clear Mask */
-#define DEVEPTIDR_ISO_ERRORTRANSEC_Pos 10 /**< (DEVEPTIDR) Transaction Error Interrupt Clear Position */
-#define DEVEPTIDR_ISO_ERRORTRANSEC (_U_(0x1) << DEVEPTIDR_ISO_ERRORTRANSEC_Pos) /**< (DEVEPTIDR) Transaction Error Interrupt Clear Mask */
-#define DEVEPTIDR_ISO_Msk _U_(0x71C) /**< (DEVEPTIDR_ISO) Register Mask */
-
-/* BLK mode */
-#define DEVEPTIDR_BLK_RXSTPEC_Pos 2 /**< (DEVEPTIDR) Received SETUP Interrupt Clear Position */
-#define DEVEPTIDR_BLK_RXSTPEC (_U_(0x1) << DEVEPTIDR_BLK_RXSTPEC_Pos) /**< (DEVEPTIDR) Received SETUP Interrupt Clear Mask */
-#define DEVEPTIDR_BLK_NAKOUTEC_Pos 3 /**< (DEVEPTIDR) NAKed OUT Interrupt Clear Position */
-#define DEVEPTIDR_BLK_NAKOUTEC (_U_(0x1) << DEVEPTIDR_BLK_NAKOUTEC_Pos) /**< (DEVEPTIDR) NAKed OUT Interrupt Clear Mask */
-#define DEVEPTIDR_BLK_NAKINEC_Pos 4 /**< (DEVEPTIDR) NAKed IN Interrupt Clear Position */
-#define DEVEPTIDR_BLK_NAKINEC (_U_(0x1) << DEVEPTIDR_BLK_NAKINEC_Pos) /**< (DEVEPTIDR) NAKed IN Interrupt Clear Mask */
-#define DEVEPTIDR_BLK_STALLEDEC_Pos 6 /**< (DEVEPTIDR) STALLed Interrupt Clear Position */
-#define DEVEPTIDR_BLK_STALLEDEC (_U_(0x1) << DEVEPTIDR_BLK_STALLEDEC_Pos) /**< (DEVEPTIDR) STALLed Interrupt Clear Mask */
-#define DEVEPTIDR_BLK_NYETDISC_Pos 17 /**< (DEVEPTIDR) NYET Token Disable Clear Position */
-#define DEVEPTIDR_BLK_NYETDISC (_U_(0x1) << DEVEPTIDR_BLK_NYETDISC_Pos) /**< (DEVEPTIDR) NYET Token Disable Clear Mask */
-#define DEVEPTIDR_BLK_STALLRQC_Pos 19 /**< (DEVEPTIDR) STALL Request Clear Position */
-#define DEVEPTIDR_BLK_STALLRQC (_U_(0x1) << DEVEPTIDR_BLK_STALLRQC_Pos) /**< (DEVEPTIDR) STALL Request Clear Mask */
-#define DEVEPTIDR_BLK_Msk _U_(0xA005C) /**< (DEVEPTIDR_BLK) Register Mask */
-
-/* INTRPT mode */
-#define DEVEPTIDR_INTRPT_RXSTPEC_Pos 2 /**< (DEVEPTIDR) Received SETUP Interrupt Clear Position */
-#define DEVEPTIDR_INTRPT_RXSTPEC (_U_(0x1) << DEVEPTIDR_INTRPT_RXSTPEC_Pos) /**< (DEVEPTIDR) Received SETUP Interrupt Clear Mask */
-#define DEVEPTIDR_INTRPT_NAKOUTEC_Pos 3 /**< (DEVEPTIDR) NAKed OUT Interrupt Clear Position */
-#define DEVEPTIDR_INTRPT_NAKOUTEC (_U_(0x1) << DEVEPTIDR_INTRPT_NAKOUTEC_Pos) /**< (DEVEPTIDR) NAKed OUT Interrupt Clear Mask */
-#define DEVEPTIDR_INTRPT_NAKINEC_Pos 4 /**< (DEVEPTIDR) NAKed IN Interrupt Clear Position */
-#define DEVEPTIDR_INTRPT_NAKINEC (_U_(0x1) << DEVEPTIDR_INTRPT_NAKINEC_Pos) /**< (DEVEPTIDR) NAKed IN Interrupt Clear Mask */
-#define DEVEPTIDR_INTRPT_STALLEDEC_Pos 6 /**< (DEVEPTIDR) STALLed Interrupt Clear Position */
-#define DEVEPTIDR_INTRPT_STALLEDEC (_U_(0x1) << DEVEPTIDR_INTRPT_STALLEDEC_Pos) /**< (DEVEPTIDR) STALLed Interrupt Clear Mask */
-#define DEVEPTIDR_INTRPT_NYETDISC_Pos 17 /**< (DEVEPTIDR) NYET Token Disable Clear Position */
-#define DEVEPTIDR_INTRPT_NYETDISC (_U_(0x1) << DEVEPTIDR_INTRPT_NYETDISC_Pos) /**< (DEVEPTIDR) NYET Token Disable Clear Mask */
-#define DEVEPTIDR_INTRPT_STALLRQC_Pos 19 /**< (DEVEPTIDR) STALL Request Clear Position */
-#define DEVEPTIDR_INTRPT_STALLRQC (_U_(0x1) << DEVEPTIDR_INTRPT_STALLRQC_Pos) /**< (DEVEPTIDR) STALL Request Clear Mask */
-#define DEVEPTIDR_INTRPT_Msk _U_(0xA005C) /**< (DEVEPTIDR_INTRPT) Register Mask */
-
-
-/* -------- HSTCTRL : (USBHS Offset: 0x400) (R/W 32) Host General Control Register -------- */
-
-#define HSTCTRL_OFFSET (0x400) /**< (HSTCTRL) Host General Control Register Offset */
-
-#define HSTCTRL_SOFE_Pos 8 /**< (HSTCTRL) Start of Frame Generation Enable Position */
-#define HSTCTRL_SOFE (_U_(0x1) << HSTCTRL_SOFE_Pos) /**< (HSTCTRL) Start of Frame Generation Enable Mask */
-#define HSTCTRL_RESET_Pos 9 /**< (HSTCTRL) Send USB Reset Position */
-#define HSTCTRL_RESET (_U_(0x1) << HSTCTRL_RESET_Pos) /**< (HSTCTRL) Send USB Reset Mask */
-#define HSTCTRL_RESUME_Pos 10 /**< (HSTCTRL) Send USB Resume Position */
-#define HSTCTRL_RESUME (_U_(0x1) << HSTCTRL_RESUME_Pos) /**< (HSTCTRL) Send USB Resume Mask */
-#define HSTCTRL_SPDCONF_Pos 12 /**< (HSTCTRL) Mode Configuration Position */
-#define HSTCTRL_SPDCONF (_U_(0x3) << HSTCTRL_SPDCONF_Pos) /**< (HSTCTRL) Mode Configuration Mask */
-#define HSTCTRL_SPDCONF_NORMAL_Val _U_(0x0) /**< (HSTCTRL) The host starts in Full-speed mode and performs a high-speed reset to switch to High-speed mode if the downstream peripheral is high-speed capable. */
-#define HSTCTRL_SPDCONF_LOW_POWER_Val _U_(0x1) /**< (HSTCTRL) For a better consumption, if high speed is not needed. */
-#define HSTCTRL_SPDCONF_HIGH_SPEED_Val _U_(0x2) /**< (HSTCTRL) Forced high speed. */
-#define HSTCTRL_SPDCONF_FORCED_FS_Val _U_(0x3) /**< (HSTCTRL) The host remains in Full-speed mode whatever the peripheral speed capability. */
-#define HSTCTRL_SPDCONF_NORMAL (HSTCTRL_SPDCONF_NORMAL_Val << HSTCTRL_SPDCONF_Pos) /**< (HSTCTRL) The host starts in Full-speed mode and performs a high-speed reset to switch to High-speed mode if the downstream peripheral is high-speed capable. Position */
-#define HSTCTRL_SPDCONF_LOW_POWER (HSTCTRL_SPDCONF_LOW_POWER_Val << HSTCTRL_SPDCONF_Pos) /**< (HSTCTRL) For a better consumption, if high speed is not needed. Position */
-#define HSTCTRL_SPDCONF_HIGH_SPEED (HSTCTRL_SPDCONF_HIGH_SPEED_Val << HSTCTRL_SPDCONF_Pos) /**< (HSTCTRL) Forced high speed. Position */
-#define HSTCTRL_SPDCONF_FORCED_FS (HSTCTRL_SPDCONF_FORCED_FS_Val << HSTCTRL_SPDCONF_Pos) /**< (HSTCTRL) The host remains in Full-speed mode whatever the peripheral speed capability. Position */
-#define HSTCTRL_Msk _U_(0x3700) /**< (HSTCTRL) Register Mask */
-
-
-/* -------- HSTISR : (USBHS Offset: 0x404) (R/ 32) Host Global Interrupt Status Register -------- */
-
-#define HSTISR_OFFSET (0x404) /**< (HSTISR) Host Global Interrupt Status Register Offset */
-
-#define HSTISR_DCONNI_Pos 0 /**< (HSTISR) Device Connection Interrupt Position */
-#define HSTISR_DCONNI (_U_(0x1) << HSTISR_DCONNI_Pos) /**< (HSTISR) Device Connection Interrupt Mask */
-#define HSTISR_DDISCI_Pos 1 /**< (HSTISR) Device Disconnection Interrupt Position */
-#define HSTISR_DDISCI (_U_(0x1) << HSTISR_DDISCI_Pos) /**< (HSTISR) Device Disconnection Interrupt Mask */
-#define HSTISR_RSTI_Pos 2 /**< (HSTISR) USB Reset Sent Interrupt Position */
-#define HSTISR_RSTI (_U_(0x1) << HSTISR_RSTI_Pos) /**< (HSTISR) USB Reset Sent Interrupt Mask */
-#define HSTISR_RSMEDI_Pos 3 /**< (HSTISR) Downstream Resume Sent Interrupt Position */
-#define HSTISR_RSMEDI (_U_(0x1) << HSTISR_RSMEDI_Pos) /**< (HSTISR) Downstream Resume Sent Interrupt Mask */
-#define HSTISR_RXRSMI_Pos 4 /**< (HSTISR) Upstream Resume Received Interrupt Position */
-#define HSTISR_RXRSMI (_U_(0x1) << HSTISR_RXRSMI_Pos) /**< (HSTISR) Upstream Resume Received Interrupt Mask */
-#define HSTISR_HSOFI_Pos 5 /**< (HSTISR) Host Start of Frame Interrupt Position */
-#define HSTISR_HSOFI (_U_(0x1) << HSTISR_HSOFI_Pos) /**< (HSTISR) Host Start of Frame Interrupt Mask */
-#define HSTISR_HWUPI_Pos 6 /**< (HSTISR) Host Wake-Up Interrupt Position */
-#define HSTISR_HWUPI (_U_(0x1) << HSTISR_HWUPI_Pos) /**< (HSTISR) Host Wake-Up Interrupt Mask */
-#define HSTISR_PEP_0_Pos 8 /**< (HSTISR) Pipe 0 Interrupt Position */
-#define HSTISR_PEP_0 (_U_(0x1) << HSTISR_PEP_0_Pos) /**< (HSTISR) Pipe 0 Interrupt Mask */
-#define HSTISR_PEP_1_Pos 9 /**< (HSTISR) Pipe 1 Interrupt Position */
-#define HSTISR_PEP_1 (_U_(0x1) << HSTISR_PEP_1_Pos) /**< (HSTISR) Pipe 1 Interrupt Mask */
-#define HSTISR_PEP_2_Pos 10 /**< (HSTISR) Pipe 2 Interrupt Position */
-#define HSTISR_PEP_2 (_U_(0x1) << HSTISR_PEP_2_Pos) /**< (HSTISR) Pipe 2 Interrupt Mask */
-#define HSTISR_PEP_3_Pos 11 /**< (HSTISR) Pipe 3 Interrupt Position */
-#define HSTISR_PEP_3 (_U_(0x1) << HSTISR_PEP_3_Pos) /**< (HSTISR) Pipe 3 Interrupt Mask */
-#define HSTISR_PEP_4_Pos 12 /**< (HSTISR) Pipe 4 Interrupt Position */
-#define HSTISR_PEP_4 (_U_(0x1) << HSTISR_PEP_4_Pos) /**< (HSTISR) Pipe 4 Interrupt Mask */
-#define HSTISR_PEP_5_Pos 13 /**< (HSTISR) Pipe 5 Interrupt Position */
-#define HSTISR_PEP_5 (_U_(0x1) << HSTISR_PEP_5_Pos) /**< (HSTISR) Pipe 5 Interrupt Mask */
-#define HSTISR_PEP_6_Pos 14 /**< (HSTISR) Pipe 6 Interrupt Position */
-#define HSTISR_PEP_6 (_U_(0x1) << HSTISR_PEP_6_Pos) /**< (HSTISR) Pipe 6 Interrupt Mask */
-#define HSTISR_PEP_7_Pos 15 /**< (HSTISR) Pipe 7 Interrupt Position */
-#define HSTISR_PEP_7 (_U_(0x1) << HSTISR_PEP_7_Pos) /**< (HSTISR) Pipe 7 Interrupt Mask */
-#define HSTISR_PEP_8_Pos 16 /**< (HSTISR) Pipe 8 Interrupt Position */
-#define HSTISR_PEP_8 (_U_(0x1) << HSTISR_PEP_8_Pos) /**< (HSTISR) Pipe 8 Interrupt Mask */
-#define HSTISR_PEP_9_Pos 17 /**< (HSTISR) Pipe 9 Interrupt Position */
-#define HSTISR_PEP_9 (_U_(0x1) << HSTISR_PEP_9_Pos) /**< (HSTISR) Pipe 9 Interrupt Mask */
-#define HSTISR_DMA_0_Pos 25 /**< (HSTISR) DMA Channel 0 Interrupt Position */
-#define HSTISR_DMA_0 (_U_(0x1) << HSTISR_DMA_0_Pos) /**< (HSTISR) DMA Channel 0 Interrupt Mask */
-#define HSTISR_DMA_1_Pos 26 /**< (HSTISR) DMA Channel 1 Interrupt Position */
-#define HSTISR_DMA_1 (_U_(0x1) << HSTISR_DMA_1_Pos) /**< (HSTISR) DMA Channel 1 Interrupt Mask */
-#define HSTISR_DMA_2_Pos 27 /**< (HSTISR) DMA Channel 2 Interrupt Position */
-#define HSTISR_DMA_2 (_U_(0x1) << HSTISR_DMA_2_Pos) /**< (HSTISR) DMA Channel 2 Interrupt Mask */
-#define HSTISR_DMA_3_Pos 28 /**< (HSTISR) DMA Channel 3 Interrupt Position */
-#define HSTISR_DMA_3 (_U_(0x1) << HSTISR_DMA_3_Pos) /**< (HSTISR) DMA Channel 3 Interrupt Mask */
-#define HSTISR_DMA_4_Pos 29 /**< (HSTISR) DMA Channel 4 Interrupt Position */
-#define HSTISR_DMA_4 (_U_(0x1) << HSTISR_DMA_4_Pos) /**< (HSTISR) DMA Channel 4 Interrupt Mask */
-#define HSTISR_DMA_5_Pos 30 /**< (HSTISR) DMA Channel 5 Interrupt Position */
-#define HSTISR_DMA_5 (_U_(0x1) << HSTISR_DMA_5_Pos) /**< (HSTISR) DMA Channel 5 Interrupt Mask */
-#define HSTISR_DMA_6_Pos 31 /**< (HSTISR) DMA Channel 6 Interrupt Position */
-#define HSTISR_DMA_6 (_U_(0x1) << HSTISR_DMA_6_Pos) /**< (HSTISR) DMA Channel 6 Interrupt Mask */
-#define HSTISR_Msk _U_(0xFE03FF7F) /**< (HSTISR) Register Mask */
-
-#define HSTISR_PEP__Pos 8 /**< (HSTISR Position) Pipe x Interrupt */
-#define HSTISR_PEP_ (_U_(0x3FF) << HSTISR_PEP__Pos) /**< (HSTISR Mask) PEP_ */
-#define HSTISR_DMA__Pos 25 /**< (HSTISR Position) DMA Channel 6 Interrupt */
-#define HSTISR_DMA_ (_U_(0x7F) << HSTISR_DMA__Pos) /**< (HSTISR Mask) DMA_ */
-
-/* -------- HSTICR : (USBHS Offset: 0x408) (/W 32) Host Global Interrupt Clear Register -------- */
-
-#define HSTICR_OFFSET (0x408) /**< (HSTICR) Host Global Interrupt Clear Register Offset */
-
-#define HSTICR_DCONNIC_Pos 0 /**< (HSTICR) Device Connection Interrupt Clear Position */
-#define HSTICR_DCONNIC (_U_(0x1) << HSTICR_DCONNIC_Pos) /**< (HSTICR) Device Connection Interrupt Clear Mask */
-#define HSTICR_DDISCIC_Pos 1 /**< (HSTICR) Device Disconnection Interrupt Clear Position */
-#define HSTICR_DDISCIC (_U_(0x1) << HSTICR_DDISCIC_Pos) /**< (HSTICR) Device Disconnection Interrupt Clear Mask */
-#define HSTICR_RSTIC_Pos 2 /**< (HSTICR) USB Reset Sent Interrupt Clear Position */
-#define HSTICR_RSTIC (_U_(0x1) << HSTICR_RSTIC_Pos) /**< (HSTICR) USB Reset Sent Interrupt Clear Mask */
-#define HSTICR_RSMEDIC_Pos 3 /**< (HSTICR) Downstream Resume Sent Interrupt Clear Position */
-#define HSTICR_RSMEDIC (_U_(0x1) << HSTICR_RSMEDIC_Pos) /**< (HSTICR) Downstream Resume Sent Interrupt Clear Mask */
-#define HSTICR_RXRSMIC_Pos 4 /**< (HSTICR) Upstream Resume Received Interrupt Clear Position */
-#define HSTICR_RXRSMIC (_U_(0x1) << HSTICR_RXRSMIC_Pos) /**< (HSTICR) Upstream Resume Received Interrupt Clear Mask */
-#define HSTICR_HSOFIC_Pos 5 /**< (HSTICR) Host Start of Frame Interrupt Clear Position */
-#define HSTICR_HSOFIC (_U_(0x1) << HSTICR_HSOFIC_Pos) /**< (HSTICR) Host Start of Frame Interrupt Clear Mask */
-#define HSTICR_HWUPIC_Pos 6 /**< (HSTICR) Host Wake-Up Interrupt Clear Position */
-#define HSTICR_HWUPIC (_U_(0x1) << HSTICR_HWUPIC_Pos) /**< (HSTICR) Host Wake-Up Interrupt Clear Mask */
-#define HSTICR_Msk _U_(0x7F) /**< (HSTICR) Register Mask */
-
-
-/* -------- HSTIFR : (USBHS Offset: 0x40c) (/W 32) Host Global Interrupt Set Register -------- */
-
-#define HSTIFR_OFFSET (0x40C) /**< (HSTIFR) Host Global Interrupt Set Register Offset */
-
-#define HSTIFR_DCONNIS_Pos 0 /**< (HSTIFR) Device Connection Interrupt Set Position */
-#define HSTIFR_DCONNIS (_U_(0x1) << HSTIFR_DCONNIS_Pos) /**< (HSTIFR) Device Connection Interrupt Set Mask */
-#define HSTIFR_DDISCIS_Pos 1 /**< (HSTIFR) Device Disconnection Interrupt Set Position */
-#define HSTIFR_DDISCIS (_U_(0x1) << HSTIFR_DDISCIS_Pos) /**< (HSTIFR) Device Disconnection Interrupt Set Mask */
-#define HSTIFR_RSTIS_Pos 2 /**< (HSTIFR) USB Reset Sent Interrupt Set Position */
-#define HSTIFR_RSTIS (_U_(0x1) << HSTIFR_RSTIS_Pos) /**< (HSTIFR) USB Reset Sent Interrupt Set Mask */
-#define HSTIFR_RSMEDIS_Pos 3 /**< (HSTIFR) Downstream Resume Sent Interrupt Set Position */
-#define HSTIFR_RSMEDIS (_U_(0x1) << HSTIFR_RSMEDIS_Pos) /**< (HSTIFR) Downstream Resume Sent Interrupt Set Mask */
-#define HSTIFR_RXRSMIS_Pos 4 /**< (HSTIFR) Upstream Resume Received Interrupt Set Position */
-#define HSTIFR_RXRSMIS (_U_(0x1) << HSTIFR_RXRSMIS_Pos) /**< (HSTIFR) Upstream Resume Received Interrupt Set Mask */
-#define HSTIFR_HSOFIS_Pos 5 /**< (HSTIFR) Host Start of Frame Interrupt Set Position */
-#define HSTIFR_HSOFIS (_U_(0x1) << HSTIFR_HSOFIS_Pos) /**< (HSTIFR) Host Start of Frame Interrupt Set Mask */
-#define HSTIFR_HWUPIS_Pos 6 /**< (HSTIFR) Host Wake-Up Interrupt Set Position */
-#define HSTIFR_HWUPIS (_U_(0x1) << HSTIFR_HWUPIS_Pos) /**< (HSTIFR) Host Wake-Up Interrupt Set Mask */
-#define HSTIFR_DMA_0_Pos 25 /**< (HSTIFR) DMA Channel 0 Interrupt Set Position */
-#define HSTIFR_DMA_0 (_U_(0x1) << HSTIFR_DMA_0_Pos) /**< (HSTIFR) DMA Channel 0 Interrupt Set Mask */
-#define HSTIFR_DMA_1_Pos 26 /**< (HSTIFR) DMA Channel 1 Interrupt Set Position */
-#define HSTIFR_DMA_1 (_U_(0x1) << HSTIFR_DMA_1_Pos) /**< (HSTIFR) DMA Channel 1 Interrupt Set Mask */
-#define HSTIFR_DMA_2_Pos 27 /**< (HSTIFR) DMA Channel 2 Interrupt Set Position */
-#define HSTIFR_DMA_2 (_U_(0x1) << HSTIFR_DMA_2_Pos) /**< (HSTIFR) DMA Channel 2 Interrupt Set Mask */
-#define HSTIFR_DMA_3_Pos 28 /**< (HSTIFR) DMA Channel 3 Interrupt Set Position */
-#define HSTIFR_DMA_3 (_U_(0x1) << HSTIFR_DMA_3_Pos) /**< (HSTIFR) DMA Channel 3 Interrupt Set Mask */
-#define HSTIFR_DMA_4_Pos 29 /**< (HSTIFR) DMA Channel 4 Interrupt Set Position */
-#define HSTIFR_DMA_4 (_U_(0x1) << HSTIFR_DMA_4_Pos) /**< (HSTIFR) DMA Channel 4 Interrupt Set Mask */
-#define HSTIFR_DMA_5_Pos 30 /**< (HSTIFR) DMA Channel 5 Interrupt Set Position */
-#define HSTIFR_DMA_5 (_U_(0x1) << HSTIFR_DMA_5_Pos) /**< (HSTIFR) DMA Channel 5 Interrupt Set Mask */
-#define HSTIFR_DMA_6_Pos 31 /**< (HSTIFR) DMA Channel 6 Interrupt Set Position */
-#define HSTIFR_DMA_6 (_U_(0x1) << HSTIFR_DMA_6_Pos) /**< (HSTIFR) DMA Channel 6 Interrupt Set Mask */
-#define HSTIFR_Msk _U_(0xFE00007F) /**< (HSTIFR) Register Mask */
-
-#define HSTIFR_DMA__Pos 25 /**< (HSTIFR Position) DMA Channel 6 Interrupt Set */
-#define HSTIFR_DMA_ (_U_(0x7F) << HSTIFR_DMA__Pos) /**< (HSTIFR Mask) DMA_ */
-
-/* -------- HSTIMR : (USBHS Offset: 0x410) (R/ 32) Host Global Interrupt Mask Register -------- */
-
-#define HSTIMR_OFFSET (0x410) /**< (HSTIMR) Host Global Interrupt Mask Register Offset */
-
-#define HSTIMR_DCONNIE_Pos 0 /**< (HSTIMR) Device Connection Interrupt Enable Position */
-#define HSTIMR_DCONNIE (_U_(0x1) << HSTIMR_DCONNIE_Pos) /**< (HSTIMR) Device Connection Interrupt Enable Mask */
-#define HSTIMR_DDISCIE_Pos 1 /**< (HSTIMR) Device Disconnection Interrupt Enable Position */
-#define HSTIMR_DDISCIE (_U_(0x1) << HSTIMR_DDISCIE_Pos) /**< (HSTIMR) Device Disconnection Interrupt Enable Mask */
-#define HSTIMR_RSTIE_Pos 2 /**< (HSTIMR) USB Reset Sent Interrupt Enable Position */
-#define HSTIMR_RSTIE (_U_(0x1) << HSTIMR_RSTIE_Pos) /**< (HSTIMR) USB Reset Sent Interrupt Enable Mask */
-#define HSTIMR_RSMEDIE_Pos 3 /**< (HSTIMR) Downstream Resume Sent Interrupt Enable Position */
-#define HSTIMR_RSMEDIE (_U_(0x1) << HSTIMR_RSMEDIE_Pos) /**< (HSTIMR) Downstream Resume Sent Interrupt Enable Mask */
-#define HSTIMR_RXRSMIE_Pos 4 /**< (HSTIMR) Upstream Resume Received Interrupt Enable Position */
-#define HSTIMR_RXRSMIE (_U_(0x1) << HSTIMR_RXRSMIE_Pos) /**< (HSTIMR) Upstream Resume Received Interrupt Enable Mask */
-#define HSTIMR_HSOFIE_Pos 5 /**< (HSTIMR) Host Start of Frame Interrupt Enable Position */
-#define HSTIMR_HSOFIE (_U_(0x1) << HSTIMR_HSOFIE_Pos) /**< (HSTIMR) Host Start of Frame Interrupt Enable Mask */
-#define HSTIMR_HWUPIE_Pos 6 /**< (HSTIMR) Host Wake-Up Interrupt Enable Position */
-#define HSTIMR_HWUPIE (_U_(0x1) << HSTIMR_HWUPIE_Pos) /**< (HSTIMR) Host Wake-Up Interrupt Enable Mask */
-#define HSTIMR_PEP_0_Pos 8 /**< (HSTIMR) Pipe 0 Interrupt Enable Position */
-#define HSTIMR_PEP_0 (_U_(0x1) << HSTIMR_PEP_0_Pos) /**< (HSTIMR) Pipe 0 Interrupt Enable Mask */
-#define HSTIMR_PEP_1_Pos 9 /**< (HSTIMR) Pipe 1 Interrupt Enable Position */
-#define HSTIMR_PEP_1 (_U_(0x1) << HSTIMR_PEP_1_Pos) /**< (HSTIMR) Pipe 1 Interrupt Enable Mask */
-#define HSTIMR_PEP_2_Pos 10 /**< (HSTIMR) Pipe 2 Interrupt Enable Position */
-#define HSTIMR_PEP_2 (_U_(0x1) << HSTIMR_PEP_2_Pos) /**< (HSTIMR) Pipe 2 Interrupt Enable Mask */
-#define HSTIMR_PEP_3_Pos 11 /**< (HSTIMR) Pipe 3 Interrupt Enable Position */
-#define HSTIMR_PEP_3 (_U_(0x1) << HSTIMR_PEP_3_Pos) /**< (HSTIMR) Pipe 3 Interrupt Enable Mask */
-#define HSTIMR_PEP_4_Pos 12 /**< (HSTIMR) Pipe 4 Interrupt Enable Position */
-#define HSTIMR_PEP_4 (_U_(0x1) << HSTIMR_PEP_4_Pos) /**< (HSTIMR) Pipe 4 Interrupt Enable Mask */
-#define HSTIMR_PEP_5_Pos 13 /**< (HSTIMR) Pipe 5 Interrupt Enable Position */
-#define HSTIMR_PEP_5 (_U_(0x1) << HSTIMR_PEP_5_Pos) /**< (HSTIMR) Pipe 5 Interrupt Enable Mask */
-#define HSTIMR_PEP_6_Pos 14 /**< (HSTIMR) Pipe 6 Interrupt Enable Position */
-#define HSTIMR_PEP_6 (_U_(0x1) << HSTIMR_PEP_6_Pos) /**< (HSTIMR) Pipe 6 Interrupt Enable Mask */
-#define HSTIMR_PEP_7_Pos 15 /**< (HSTIMR) Pipe 7 Interrupt Enable Position */
-#define HSTIMR_PEP_7 (_U_(0x1) << HSTIMR_PEP_7_Pos) /**< (HSTIMR) Pipe 7 Interrupt Enable Mask */
-#define HSTIMR_PEP_8_Pos 16 /**< (HSTIMR) Pipe 8 Interrupt Enable Position */
-#define HSTIMR_PEP_8 (_U_(0x1) << HSTIMR_PEP_8_Pos) /**< (HSTIMR) Pipe 8 Interrupt Enable Mask */
-#define HSTIMR_PEP_9_Pos 17 /**< (HSTIMR) Pipe 9 Interrupt Enable Position */
-#define HSTIMR_PEP_9 (_U_(0x1) << HSTIMR_PEP_9_Pos) /**< (HSTIMR) Pipe 9 Interrupt Enable Mask */
-#define HSTIMR_DMA_0_Pos 25 /**< (HSTIMR) DMA Channel 0 Interrupt Enable Position */
-#define HSTIMR_DMA_0 (_U_(0x1) << HSTIMR_DMA_0_Pos) /**< (HSTIMR) DMA Channel 0 Interrupt Enable Mask */
-#define HSTIMR_DMA_1_Pos 26 /**< (HSTIMR) DMA Channel 1 Interrupt Enable Position */
-#define HSTIMR_DMA_1 (_U_(0x1) << HSTIMR_DMA_1_Pos) /**< (HSTIMR) DMA Channel 1 Interrupt Enable Mask */
-#define HSTIMR_DMA_2_Pos 27 /**< (HSTIMR) DMA Channel 2 Interrupt Enable Position */
-#define HSTIMR_DMA_2 (_U_(0x1) << HSTIMR_DMA_2_Pos) /**< (HSTIMR) DMA Channel 2 Interrupt Enable Mask */
-#define HSTIMR_DMA_3_Pos 28 /**< (HSTIMR) DMA Channel 3 Interrupt Enable Position */
-#define HSTIMR_DMA_3 (_U_(0x1) << HSTIMR_DMA_3_Pos) /**< (HSTIMR) DMA Channel 3 Interrupt Enable Mask */
-#define HSTIMR_DMA_4_Pos 29 /**< (HSTIMR) DMA Channel 4 Interrupt Enable Position */
-#define HSTIMR_DMA_4 (_U_(0x1) << HSTIMR_DMA_4_Pos) /**< (HSTIMR) DMA Channel 4 Interrupt Enable Mask */
-#define HSTIMR_DMA_5_Pos 30 /**< (HSTIMR) DMA Channel 5 Interrupt Enable Position */
-#define HSTIMR_DMA_5 (_U_(0x1) << HSTIMR_DMA_5_Pos) /**< (HSTIMR) DMA Channel 5 Interrupt Enable Mask */
-#define HSTIMR_DMA_6_Pos 31 /**< (HSTIMR) DMA Channel 6 Interrupt Enable Position */
-#define HSTIMR_DMA_6 (_U_(0x1) << HSTIMR_DMA_6_Pos) /**< (HSTIMR) DMA Channel 6 Interrupt Enable Mask */
-#define HSTIMR_Msk _U_(0xFE03FF7F) /**< (HSTIMR) Register Mask */
-
-#define HSTIMR_PEP__Pos 8 /**< (HSTIMR Position) Pipe x Interrupt Enable */
-#define HSTIMR_PEP_ (_U_(0x3FF) << HSTIMR_PEP__Pos) /**< (HSTIMR Mask) PEP_ */
-#define HSTIMR_DMA__Pos 25 /**< (HSTIMR Position) DMA Channel 6 Interrupt Enable */
-#define HSTIMR_DMA_ (_U_(0x7F) << HSTIMR_DMA__Pos) /**< (HSTIMR Mask) DMA_ */
-
-/* -------- HSTIDR : (USBHS Offset: 0x414) (/W 32) Host Global Interrupt Disable Register -------- */
-
-#define HSTIDR_OFFSET (0x414) /**< (HSTIDR) Host Global Interrupt Disable Register Offset */
-
-#define HSTIDR_DCONNIEC_Pos 0 /**< (HSTIDR) Device Connection Interrupt Disable Position */
-#define HSTIDR_DCONNIEC (_U_(0x1) << HSTIDR_DCONNIEC_Pos) /**< (HSTIDR) Device Connection Interrupt Disable Mask */
-#define HSTIDR_DDISCIEC_Pos 1 /**< (HSTIDR) Device Disconnection Interrupt Disable Position */
-#define HSTIDR_DDISCIEC (_U_(0x1) << HSTIDR_DDISCIEC_Pos) /**< (HSTIDR) Device Disconnection Interrupt Disable Mask */
-#define HSTIDR_RSTIEC_Pos 2 /**< (HSTIDR) USB Reset Sent Interrupt Disable Position */
-#define HSTIDR_RSTIEC (_U_(0x1) << HSTIDR_RSTIEC_Pos) /**< (HSTIDR) USB Reset Sent Interrupt Disable Mask */
-#define HSTIDR_RSMEDIEC_Pos 3 /**< (HSTIDR) Downstream Resume Sent Interrupt Disable Position */
-#define HSTIDR_RSMEDIEC (_U_(0x1) << HSTIDR_RSMEDIEC_Pos) /**< (HSTIDR) Downstream Resume Sent Interrupt Disable Mask */
-#define HSTIDR_RXRSMIEC_Pos 4 /**< (HSTIDR) Upstream Resume Received Interrupt Disable Position */
-#define HSTIDR_RXRSMIEC (_U_(0x1) << HSTIDR_RXRSMIEC_Pos) /**< (HSTIDR) Upstream Resume Received Interrupt Disable Mask */
-#define HSTIDR_HSOFIEC_Pos 5 /**< (HSTIDR) Host Start of Frame Interrupt Disable Position */
-#define HSTIDR_HSOFIEC (_U_(0x1) << HSTIDR_HSOFIEC_Pos) /**< (HSTIDR) Host Start of Frame Interrupt Disable Mask */
-#define HSTIDR_HWUPIEC_Pos 6 /**< (HSTIDR) Host Wake-Up Interrupt Disable Position */
-#define HSTIDR_HWUPIEC (_U_(0x1) << HSTIDR_HWUPIEC_Pos) /**< (HSTIDR) Host Wake-Up Interrupt Disable Mask */
-#define HSTIDR_PEP_0_Pos 8 /**< (HSTIDR) Pipe 0 Interrupt Disable Position */
-#define HSTIDR_PEP_0 (_U_(0x1) << HSTIDR_PEP_0_Pos) /**< (HSTIDR) Pipe 0 Interrupt Disable Mask */
-#define HSTIDR_PEP_1_Pos 9 /**< (HSTIDR) Pipe 1 Interrupt Disable Position */
-#define HSTIDR_PEP_1 (_U_(0x1) << HSTIDR_PEP_1_Pos) /**< (HSTIDR) Pipe 1 Interrupt Disable Mask */
-#define HSTIDR_PEP_2_Pos 10 /**< (HSTIDR) Pipe 2 Interrupt Disable Position */
-#define HSTIDR_PEP_2 (_U_(0x1) << HSTIDR_PEP_2_Pos) /**< (HSTIDR) Pipe 2 Interrupt Disable Mask */
-#define HSTIDR_PEP_3_Pos 11 /**< (HSTIDR) Pipe 3 Interrupt Disable Position */
-#define HSTIDR_PEP_3 (_U_(0x1) << HSTIDR_PEP_3_Pos) /**< (HSTIDR) Pipe 3 Interrupt Disable Mask */
-#define HSTIDR_PEP_4_Pos 12 /**< (HSTIDR) Pipe 4 Interrupt Disable Position */
-#define HSTIDR_PEP_4 (_U_(0x1) << HSTIDR_PEP_4_Pos) /**< (HSTIDR) Pipe 4 Interrupt Disable Mask */
-#define HSTIDR_PEP_5_Pos 13 /**< (HSTIDR) Pipe 5 Interrupt Disable Position */
-#define HSTIDR_PEP_5 (_U_(0x1) << HSTIDR_PEP_5_Pos) /**< (HSTIDR) Pipe 5 Interrupt Disable Mask */
-#define HSTIDR_PEP_6_Pos 14 /**< (HSTIDR) Pipe 6 Interrupt Disable Position */
-#define HSTIDR_PEP_6 (_U_(0x1) << HSTIDR_PEP_6_Pos) /**< (HSTIDR) Pipe 6 Interrupt Disable Mask */
-#define HSTIDR_PEP_7_Pos 15 /**< (HSTIDR) Pipe 7 Interrupt Disable Position */
-#define HSTIDR_PEP_7 (_U_(0x1) << HSTIDR_PEP_7_Pos) /**< (HSTIDR) Pipe 7 Interrupt Disable Mask */
-#define HSTIDR_PEP_8_Pos 16 /**< (HSTIDR) Pipe 8 Interrupt Disable Position */
-#define HSTIDR_PEP_8 (_U_(0x1) << HSTIDR_PEP_8_Pos) /**< (HSTIDR) Pipe 8 Interrupt Disable Mask */
-#define HSTIDR_PEP_9_Pos 17 /**< (HSTIDR) Pipe 9 Interrupt Disable Position */
-#define HSTIDR_PEP_9 (_U_(0x1) << HSTIDR_PEP_9_Pos) /**< (HSTIDR) Pipe 9 Interrupt Disable Mask */
-#define HSTIDR_DMA_0_Pos 25 /**< (HSTIDR) DMA Channel 0 Interrupt Disable Position */
-#define HSTIDR_DMA_0 (_U_(0x1) << HSTIDR_DMA_0_Pos) /**< (HSTIDR) DMA Channel 0 Interrupt Disable Mask */
-#define HSTIDR_DMA_1_Pos 26 /**< (HSTIDR) DMA Channel 1 Interrupt Disable Position */
-#define HSTIDR_DMA_1 (_U_(0x1) << HSTIDR_DMA_1_Pos) /**< (HSTIDR) DMA Channel 1 Interrupt Disable Mask */
-#define HSTIDR_DMA_2_Pos 27 /**< (HSTIDR) DMA Channel 2 Interrupt Disable Position */
-#define HSTIDR_DMA_2 (_U_(0x1) << HSTIDR_DMA_2_Pos) /**< (HSTIDR) DMA Channel 2 Interrupt Disable Mask */
-#define HSTIDR_DMA_3_Pos 28 /**< (HSTIDR) DMA Channel 3 Interrupt Disable Position */
-#define HSTIDR_DMA_3 (_U_(0x1) << HSTIDR_DMA_3_Pos) /**< (HSTIDR) DMA Channel 3 Interrupt Disable Mask */
-#define HSTIDR_DMA_4_Pos 29 /**< (HSTIDR) DMA Channel 4 Interrupt Disable Position */
-#define HSTIDR_DMA_4 (_U_(0x1) << HSTIDR_DMA_4_Pos) /**< (HSTIDR) DMA Channel 4 Interrupt Disable Mask */
-#define HSTIDR_DMA_5_Pos 30 /**< (HSTIDR) DMA Channel 5 Interrupt Disable Position */
-#define HSTIDR_DMA_5 (_U_(0x1) << HSTIDR_DMA_5_Pos) /**< (HSTIDR) DMA Channel 5 Interrupt Disable Mask */
-#define HSTIDR_DMA_6_Pos 31 /**< (HSTIDR) DMA Channel 6 Interrupt Disable Position */
-#define HSTIDR_DMA_6 (_U_(0x1) << HSTIDR_DMA_6_Pos) /**< (HSTIDR) DMA Channel 6 Interrupt Disable Mask */
-#define HSTIDR_Msk _U_(0xFE03FF7F) /**< (HSTIDR) Register Mask */
-
-#define HSTIDR_PEP__Pos 8 /**< (HSTIDR Position) Pipe x Interrupt Disable */
-#define HSTIDR_PEP_ (_U_(0x3FF) << HSTIDR_PEP__Pos) /**< (HSTIDR Mask) PEP_ */
-#define HSTIDR_DMA__Pos 25 /**< (HSTIDR Position) DMA Channel 6 Interrupt Disable */
-#define HSTIDR_DMA_ (_U_(0x7F) << HSTIDR_DMA__Pos) /**< (HSTIDR Mask) DMA_ */
-
-/* -------- HSTIER : (USBHS Offset: 0x418) (/W 32) Host Global Interrupt Enable Register -------- */
-
-#define HSTIER_OFFSET (0x418) /**< (HSTIER) Host Global Interrupt Enable Register Offset */
-
-#define HSTIER_DCONNIES_Pos 0 /**< (HSTIER) Device Connection Interrupt Enable Position */
-#define HSTIER_DCONNIES (_U_(0x1) << HSTIER_DCONNIES_Pos) /**< (HSTIER) Device Connection Interrupt Enable Mask */
-#define HSTIER_DDISCIES_Pos 1 /**< (HSTIER) Device Disconnection Interrupt Enable Position */
-#define HSTIER_DDISCIES (_U_(0x1) << HSTIER_DDISCIES_Pos) /**< (HSTIER) Device Disconnection Interrupt Enable Mask */
-#define HSTIER_RSTIES_Pos 2 /**< (HSTIER) USB Reset Sent Interrupt Enable Position */
-#define HSTIER_RSTIES (_U_(0x1) << HSTIER_RSTIES_Pos) /**< (HSTIER) USB Reset Sent Interrupt Enable Mask */
-#define HSTIER_RSMEDIES_Pos 3 /**< (HSTIER) Downstream Resume Sent Interrupt Enable Position */
-#define HSTIER_RSMEDIES (_U_(0x1) << HSTIER_RSMEDIES_Pos) /**< (HSTIER) Downstream Resume Sent Interrupt Enable Mask */
-#define HSTIER_RXRSMIES_Pos 4 /**< (HSTIER) Upstream Resume Received Interrupt Enable Position */
-#define HSTIER_RXRSMIES (_U_(0x1) << HSTIER_RXRSMIES_Pos) /**< (HSTIER) Upstream Resume Received Interrupt Enable Mask */
-#define HSTIER_HSOFIES_Pos 5 /**< (HSTIER) Host Start of Frame Interrupt Enable Position */
-#define HSTIER_HSOFIES (_U_(0x1) << HSTIER_HSOFIES_Pos) /**< (HSTIER) Host Start of Frame Interrupt Enable Mask */
-#define HSTIER_HWUPIES_Pos 6 /**< (HSTIER) Host Wake-Up Interrupt Enable Position */
-#define HSTIER_HWUPIES (_U_(0x1) << HSTIER_HWUPIES_Pos) /**< (HSTIER) Host Wake-Up Interrupt Enable Mask */
-#define HSTIER_PEP_0_Pos 8 /**< (HSTIER) Pipe 0 Interrupt Enable Position */
-#define HSTIER_PEP_0 (_U_(0x1) << HSTIER_PEP_0_Pos) /**< (HSTIER) Pipe 0 Interrupt Enable Mask */
-#define HSTIER_PEP_1_Pos 9 /**< (HSTIER) Pipe 1 Interrupt Enable Position */
-#define HSTIER_PEP_1 (_U_(0x1) << HSTIER_PEP_1_Pos) /**< (HSTIER) Pipe 1 Interrupt Enable Mask */
-#define HSTIER_PEP_2_Pos 10 /**< (HSTIER) Pipe 2 Interrupt Enable Position */
-#define HSTIER_PEP_2 (_U_(0x1) << HSTIER_PEP_2_Pos) /**< (HSTIER) Pipe 2 Interrupt Enable Mask */
-#define HSTIER_PEP_3_Pos 11 /**< (HSTIER) Pipe 3 Interrupt Enable Position */
-#define HSTIER_PEP_3 (_U_(0x1) << HSTIER_PEP_3_Pos) /**< (HSTIER) Pipe 3 Interrupt Enable Mask */
-#define HSTIER_PEP_4_Pos 12 /**< (HSTIER) Pipe 4 Interrupt Enable Position */
-#define HSTIER_PEP_4 (_U_(0x1) << HSTIER_PEP_4_Pos) /**< (HSTIER) Pipe 4 Interrupt Enable Mask */
-#define HSTIER_PEP_5_Pos 13 /**< (HSTIER) Pipe 5 Interrupt Enable Position */
-#define HSTIER_PEP_5 (_U_(0x1) << HSTIER_PEP_5_Pos) /**< (HSTIER) Pipe 5 Interrupt Enable Mask */
-#define HSTIER_PEP_6_Pos 14 /**< (HSTIER) Pipe 6 Interrupt Enable Position */
-#define HSTIER_PEP_6 (_U_(0x1) << HSTIER_PEP_6_Pos) /**< (HSTIER) Pipe 6 Interrupt Enable Mask */
-#define HSTIER_PEP_7_Pos 15 /**< (HSTIER) Pipe 7 Interrupt Enable Position */
-#define HSTIER_PEP_7 (_U_(0x1) << HSTIER_PEP_7_Pos) /**< (HSTIER) Pipe 7 Interrupt Enable Mask */
-#define HSTIER_PEP_8_Pos 16 /**< (HSTIER) Pipe 8 Interrupt Enable Position */
-#define HSTIER_PEP_8 (_U_(0x1) << HSTIER_PEP_8_Pos) /**< (HSTIER) Pipe 8 Interrupt Enable Mask */
-#define HSTIER_PEP_9_Pos 17 /**< (HSTIER) Pipe 9 Interrupt Enable Position */
-#define HSTIER_PEP_9 (_U_(0x1) << HSTIER_PEP_9_Pos) /**< (HSTIER) Pipe 9 Interrupt Enable Mask */
-#define HSTIER_DMA_0_Pos 25 /**< (HSTIER) DMA Channel 0 Interrupt Enable Position */
-#define HSTIER_DMA_0 (_U_(0x1) << HSTIER_DMA_0_Pos) /**< (HSTIER) DMA Channel 0 Interrupt Enable Mask */
-#define HSTIER_DMA_1_Pos 26 /**< (HSTIER) DMA Channel 1 Interrupt Enable Position */
-#define HSTIER_DMA_1 (_U_(0x1) << HSTIER_DMA_1_Pos) /**< (HSTIER) DMA Channel 1 Interrupt Enable Mask */
-#define HSTIER_DMA_2_Pos 27 /**< (HSTIER) DMA Channel 2 Interrupt Enable Position */
-#define HSTIER_DMA_2 (_U_(0x1) << HSTIER_DMA_2_Pos) /**< (HSTIER) DMA Channel 2 Interrupt Enable Mask */
-#define HSTIER_DMA_3_Pos 28 /**< (HSTIER) DMA Channel 3 Interrupt Enable Position */
-#define HSTIER_DMA_3 (_U_(0x1) << HSTIER_DMA_3_Pos) /**< (HSTIER) DMA Channel 3 Interrupt Enable Mask */
-#define HSTIER_DMA_4_Pos 29 /**< (HSTIER) DMA Channel 4 Interrupt Enable Position */
-#define HSTIER_DMA_4 (_U_(0x1) << HSTIER_DMA_4_Pos) /**< (HSTIER) DMA Channel 4 Interrupt Enable Mask */
-#define HSTIER_DMA_5_Pos 30 /**< (HSTIER) DMA Channel 5 Interrupt Enable Position */
-#define HSTIER_DMA_5 (_U_(0x1) << HSTIER_DMA_5_Pos) /**< (HSTIER) DMA Channel 5 Interrupt Enable Mask */
-#define HSTIER_DMA_6_Pos 31 /**< (HSTIER) DMA Channel 6 Interrupt Enable Position */
-#define HSTIER_DMA_6 (_U_(0x1) << HSTIER_DMA_6_Pos) /**< (HSTIER) DMA Channel 6 Interrupt Enable Mask */
-#define HSTIER_Msk _U_(0xFE03FF7F) /**< (HSTIER) Register Mask */
-
-#define HSTIER_PEP__Pos 8 /**< (HSTIER Position) Pipe x Interrupt Enable */
-#define HSTIER_PEP_ (_U_(0x3FF) << HSTIER_PEP__Pos) /**< (HSTIER Mask) PEP_ */
-#define HSTIER_DMA__Pos 25 /**< (HSTIER Position) DMA Channel 6 Interrupt Enable */
-#define HSTIER_DMA_ (_U_(0x7F) << HSTIER_DMA__Pos) /**< (HSTIER Mask) DMA_ */
-
-/* -------- HSTPIP : (USBHS Offset: 0x41c) (R/W 32) Host Pipe Register -------- */
-
-#define HSTPIP_OFFSET (0x41C) /**< (HSTPIP) Host Pipe Register Offset */
-
-#define HSTPIP_PEN0_Pos 0 /**< (HSTPIP) Pipe 0 Enable Position */
-#define HSTPIP_PEN0 (_U_(0x1) << HSTPIP_PEN0_Pos) /**< (HSTPIP) Pipe 0 Enable Mask */
-#define HSTPIP_PEN1_Pos 1 /**< (HSTPIP) Pipe 1 Enable Position */
-#define HSTPIP_PEN1 (_U_(0x1) << HSTPIP_PEN1_Pos) /**< (HSTPIP) Pipe 1 Enable Mask */
-#define HSTPIP_PEN2_Pos 2 /**< (HSTPIP) Pipe 2 Enable Position */
-#define HSTPIP_PEN2 (_U_(0x1) << HSTPIP_PEN2_Pos) /**< (HSTPIP) Pipe 2 Enable Mask */
-#define HSTPIP_PEN3_Pos 3 /**< (HSTPIP) Pipe 3 Enable Position */
-#define HSTPIP_PEN3 (_U_(0x1) << HSTPIP_PEN3_Pos) /**< (HSTPIP) Pipe 3 Enable Mask */
-#define HSTPIP_PEN4_Pos 4 /**< (HSTPIP) Pipe 4 Enable Position */
-#define HSTPIP_PEN4 (_U_(0x1) << HSTPIP_PEN4_Pos) /**< (HSTPIP) Pipe 4 Enable Mask */
-#define HSTPIP_PEN5_Pos 5 /**< (HSTPIP) Pipe 5 Enable Position */
-#define HSTPIP_PEN5 (_U_(0x1) << HSTPIP_PEN5_Pos) /**< (HSTPIP) Pipe 5 Enable Mask */
-#define HSTPIP_PEN6_Pos 6 /**< (HSTPIP) Pipe 6 Enable Position */
-#define HSTPIP_PEN6 (_U_(0x1) << HSTPIP_PEN6_Pos) /**< (HSTPIP) Pipe 6 Enable Mask */
-#define HSTPIP_PEN7_Pos 7 /**< (HSTPIP) Pipe 7 Enable Position */
-#define HSTPIP_PEN7 (_U_(0x1) << HSTPIP_PEN7_Pos) /**< (HSTPIP) Pipe 7 Enable Mask */
-#define HSTPIP_PEN8_Pos 8 /**< (HSTPIP) Pipe 8 Enable Position */
-#define HSTPIP_PEN8 (_U_(0x1) << HSTPIP_PEN8_Pos) /**< (HSTPIP) Pipe 8 Enable Mask */
-#define HSTPIP_PRST0_Pos 16 /**< (HSTPIP) Pipe 0 Reset Position */
-#define HSTPIP_PRST0 (_U_(0x1) << HSTPIP_PRST0_Pos) /**< (HSTPIP) Pipe 0 Reset Mask */
-#define HSTPIP_PRST1_Pos 17 /**< (HSTPIP) Pipe 1 Reset Position */
-#define HSTPIP_PRST1 (_U_(0x1) << HSTPIP_PRST1_Pos) /**< (HSTPIP) Pipe 1 Reset Mask */
-#define HSTPIP_PRST2_Pos 18 /**< (HSTPIP) Pipe 2 Reset Position */
-#define HSTPIP_PRST2 (_U_(0x1) << HSTPIP_PRST2_Pos) /**< (HSTPIP) Pipe 2 Reset Mask */
-#define HSTPIP_PRST3_Pos 19 /**< (HSTPIP) Pipe 3 Reset Position */
-#define HSTPIP_PRST3 (_U_(0x1) << HSTPIP_PRST3_Pos) /**< (HSTPIP) Pipe 3 Reset Mask */
-#define HSTPIP_PRST4_Pos 20 /**< (HSTPIP) Pipe 4 Reset Position */
-#define HSTPIP_PRST4 (_U_(0x1) << HSTPIP_PRST4_Pos) /**< (HSTPIP) Pipe 4 Reset Mask */
-#define HSTPIP_PRST5_Pos 21 /**< (HSTPIP) Pipe 5 Reset Position */
-#define HSTPIP_PRST5 (_U_(0x1) << HSTPIP_PRST5_Pos) /**< (HSTPIP) Pipe 5 Reset Mask */
-#define HSTPIP_PRST6_Pos 22 /**< (HSTPIP) Pipe 6 Reset Position */
-#define HSTPIP_PRST6 (_U_(0x1) << HSTPIP_PRST6_Pos) /**< (HSTPIP) Pipe 6 Reset Mask */
-#define HSTPIP_PRST7_Pos 23 /**< (HSTPIP) Pipe 7 Reset Position */
-#define HSTPIP_PRST7 (_U_(0x1) << HSTPIP_PRST7_Pos) /**< (HSTPIP) Pipe 7 Reset Mask */
-#define HSTPIP_PRST8_Pos 24 /**< (HSTPIP) Pipe 8 Reset Position */
-#define HSTPIP_PRST8 (_U_(0x1) << HSTPIP_PRST8_Pos) /**< (HSTPIP) Pipe 8 Reset Mask */
-#define HSTPIP_Msk _U_(0x1FF01FF) /**< (HSTPIP) Register Mask */
-
-#define HSTPIP_PEN_Pos 0 /**< (HSTPIP Position) Pipe x Enable */
-#define HSTPIP_PEN (_U_(0x1FF) << HSTPIP_PEN_Pos) /**< (HSTPIP Mask) PEN */
-#define HSTPIP_PRST_Pos 16 /**< (HSTPIP Position) Pipe 8 Reset */
-#define HSTPIP_PRST (_U_(0x1FF) << HSTPIP_PRST_Pos) /**< (HSTPIP Mask) PRST */
-
-/* -------- HSTFNUM : (USBHS Offset: 0x420) (R/W 32) Host Frame Number Register -------- */
-
-#define HSTFNUM_OFFSET (0x420) /**< (HSTFNUM) Host Frame Number Register Offset */
-
-#define HSTFNUM_MFNUM_Pos 0 /**< (HSTFNUM) Micro Frame Number Position */
-#define HSTFNUM_MFNUM (_U_(0x7) << HSTFNUM_MFNUM_Pos) /**< (HSTFNUM) Micro Frame Number Mask */
-#define HSTFNUM_FNUM_Pos 3 /**< (HSTFNUM) Frame Number Position */
-#define HSTFNUM_FNUM (_U_(0x7FF) << HSTFNUM_FNUM_Pos) /**< (HSTFNUM) Frame Number Mask */
-#define HSTFNUM_FLENHIGH_Pos 16 /**< (HSTFNUM) Frame Length Position */
-#define HSTFNUM_FLENHIGH (_U_(0xFF) << HSTFNUM_FLENHIGH_Pos) /**< (HSTFNUM) Frame Length Mask */
-#define HSTFNUM_Msk _U_(0xFF3FFF) /**< (HSTFNUM) Register Mask */
-
-
-/* -------- HSTADDR1 : (USBHS Offset: 0x424) (R/W 32) Host Address 1 Register -------- */
-
-#define HSTADDR1_OFFSET (0x424) /**< (HSTADDR1) Host Address 1 Register Offset */
-
-#define HSTADDR1_HSTADDRP0_Pos 0 /**< (HSTADDR1) USB Host Address Position */
-#define HSTADDR1_HSTADDRP0 (_U_(0x7F) << HSTADDR1_HSTADDRP0_Pos) /**< (HSTADDR1) USB Host Address Mask */
-#define HSTADDR1_HSTADDRP1_Pos 8 /**< (HSTADDR1) USB Host Address Position */
-#define HSTADDR1_HSTADDRP1 (_U_(0x7F) << HSTADDR1_HSTADDRP1_Pos) /**< (HSTADDR1) USB Host Address Mask */
-#define HSTADDR1_HSTADDRP2_Pos 16 /**< (HSTADDR1) USB Host Address Position */
-#define HSTADDR1_HSTADDRP2 (_U_(0x7F) << HSTADDR1_HSTADDRP2_Pos) /**< (HSTADDR1) USB Host Address Mask */
-#define HSTADDR1_HSTADDRP3_Pos 24 /**< (HSTADDR1) USB Host Address Position */
-#define HSTADDR1_HSTADDRP3 (_U_(0x7F) << HSTADDR1_HSTADDRP3_Pos) /**< (HSTADDR1) USB Host Address Mask */
-#define HSTADDR1_Msk _U_(0x7F7F7F7F) /**< (HSTADDR1) Register Mask */
-
-
-/* -------- HSTADDR2 : (USBHS Offset: 0x428) (R/W 32) Host Address 2 Register -------- */
-
-#define HSTADDR2_OFFSET (0x428) /**< (HSTADDR2) Host Address 2 Register Offset */
-
-#define HSTADDR2_HSTADDRP4_Pos 0 /**< (HSTADDR2) USB Host Address Position */
-#define HSTADDR2_HSTADDRP4 (_U_(0x7F) << HSTADDR2_HSTADDRP4_Pos) /**< (HSTADDR2) USB Host Address Mask */
-#define HSTADDR2_HSTADDRP5_Pos 8 /**< (HSTADDR2) USB Host Address Position */
-#define HSTADDR2_HSTADDRP5 (_U_(0x7F) << HSTADDR2_HSTADDRP5_Pos) /**< (HSTADDR2) USB Host Address Mask */
-#define HSTADDR2_HSTADDRP6_Pos 16 /**< (HSTADDR2) USB Host Address Position */
-#define HSTADDR2_HSTADDRP6 (_U_(0x7F) << HSTADDR2_HSTADDRP6_Pos) /**< (HSTADDR2) USB Host Address Mask */
-#define HSTADDR2_HSTADDRP7_Pos 24 /**< (HSTADDR2) USB Host Address Position */
-#define HSTADDR2_HSTADDRP7 (_U_(0x7F) << HSTADDR2_HSTADDRP7_Pos) /**< (HSTADDR2) USB Host Address Mask */
-#define HSTADDR2_Msk _U_(0x7F7F7F7F) /**< (HSTADDR2) Register Mask */
-
-
-/* -------- HSTADDR3 : (USBHS Offset: 0x42c) (R/W 32) Host Address 3 Register -------- */
-
-#define HSTADDR3_OFFSET (0x42C) /**< (HSTADDR3) Host Address 3 Register Offset */
-
-#define HSTADDR3_HSTADDRP8_Pos 0 /**< (HSTADDR3) USB Host Address Position */
-#define HSTADDR3_HSTADDRP8 (_U_(0x7F) << HSTADDR3_HSTADDRP8_Pos) /**< (HSTADDR3) USB Host Address Mask */
-#define HSTADDR3_HSTADDRP9_Pos 8 /**< (HSTADDR3) USB Host Address Position */
-#define HSTADDR3_HSTADDRP9 (_U_(0x7F) << HSTADDR3_HSTADDRP9_Pos) /**< (HSTADDR3) USB Host Address Mask */
-#define HSTADDR3_Msk _U_(0x7F7F) /**< (HSTADDR3) Register Mask */
-
-
-/* -------- HSTPIPCFG : (USBHS Offset: 0x500) (R/W 32) Host Pipe Configuration Register -------- */
-
-#define HSTPIPCFG_OFFSET (0x500) /**< (HSTPIPCFG) Host Pipe Configuration Register Offset */
-
-#define HSTPIPCFG_ALLOC_Pos 1 /**< (HSTPIPCFG) Pipe Memory Allocate Position */
-#define HSTPIPCFG_ALLOC (_U_(0x1) << HSTPIPCFG_ALLOC_Pos) /**< (HSTPIPCFG) Pipe Memory Allocate Mask */
-#define HSTPIPCFG_PBK_Pos 2 /**< (HSTPIPCFG) Pipe Banks Position */
-#define HSTPIPCFG_PBK (_U_(0x3) << HSTPIPCFG_PBK_Pos) /**< (HSTPIPCFG) Pipe Banks Mask */
-#define HSTPIPCFG_PBK_1_BANK_Val _U_(0x0) /**< (HSTPIPCFG) Single-bank pipe */
-#define HSTPIPCFG_PBK_2_BANK_Val _U_(0x1) /**< (HSTPIPCFG) Double-bank pipe */
-#define HSTPIPCFG_PBK_3_BANK_Val _U_(0x2) /**< (HSTPIPCFG) Triple-bank pipe */
-#define HSTPIPCFG_PBK_1_BANK (HSTPIPCFG_PBK_1_BANK_Val << HSTPIPCFG_PBK_Pos) /**< (HSTPIPCFG) Single-bank pipe Position */
-#define HSTPIPCFG_PBK_2_BANK (HSTPIPCFG_PBK_2_BANK_Val << HSTPIPCFG_PBK_Pos) /**< (HSTPIPCFG) Double-bank pipe Position */
-#define HSTPIPCFG_PBK_3_BANK (HSTPIPCFG_PBK_3_BANK_Val << HSTPIPCFG_PBK_Pos) /**< (HSTPIPCFG) Triple-bank pipe Position */
-#define HSTPIPCFG_PSIZE_Pos 4 /**< (HSTPIPCFG) Pipe Size Position */
-#define HSTPIPCFG_PSIZE (_U_(0x7) << HSTPIPCFG_PSIZE_Pos) /**< (HSTPIPCFG) Pipe Size Mask */
-#define HSTPIPCFG_PSIZE_8_BYTE_Val _U_(0x0) /**< (HSTPIPCFG) 8 bytes */
-#define HSTPIPCFG_PSIZE_16_BYTE_Val _U_(0x1) /**< (HSTPIPCFG) 16 bytes */
-#define HSTPIPCFG_PSIZE_32_BYTE_Val _U_(0x2) /**< (HSTPIPCFG) 32 bytes */
-#define HSTPIPCFG_PSIZE_64_BYTE_Val _U_(0x3) /**< (HSTPIPCFG) 64 bytes */
-#define HSTPIPCFG_PSIZE_128_BYTE_Val _U_(0x4) /**< (HSTPIPCFG) 128 bytes */
-#define HSTPIPCFG_PSIZE_256_BYTE_Val _U_(0x5) /**< (HSTPIPCFG) 256 bytes */
-#define HSTPIPCFG_PSIZE_512_BYTE_Val _U_(0x6) /**< (HSTPIPCFG) 512 bytes */
-#define HSTPIPCFG_PSIZE_1024_BYTE_Val _U_(0x7) /**< (HSTPIPCFG) 1024 bytes */
-#define HSTPIPCFG_PSIZE_8_BYTE (HSTPIPCFG_PSIZE_8_BYTE_Val << HSTPIPCFG_PSIZE_Pos) /**< (HSTPIPCFG) 8 bytes Position */
-#define HSTPIPCFG_PSIZE_16_BYTE (HSTPIPCFG_PSIZE_16_BYTE_Val << HSTPIPCFG_PSIZE_Pos) /**< (HSTPIPCFG) 16 bytes Position */
-#define HSTPIPCFG_PSIZE_32_BYTE (HSTPIPCFG_PSIZE_32_BYTE_Val << HSTPIPCFG_PSIZE_Pos) /**< (HSTPIPCFG) 32 bytes Position */
-#define HSTPIPCFG_PSIZE_64_BYTE (HSTPIPCFG_PSIZE_64_BYTE_Val << HSTPIPCFG_PSIZE_Pos) /**< (HSTPIPCFG) 64 bytes Position */
-#define HSTPIPCFG_PSIZE_128_BYTE (HSTPIPCFG_PSIZE_128_BYTE_Val << HSTPIPCFG_PSIZE_Pos) /**< (HSTPIPCFG) 128 bytes Position */
-#define HSTPIPCFG_PSIZE_256_BYTE (HSTPIPCFG_PSIZE_256_BYTE_Val << HSTPIPCFG_PSIZE_Pos) /**< (HSTPIPCFG) 256 bytes Position */
-#define HSTPIPCFG_PSIZE_512_BYTE (HSTPIPCFG_PSIZE_512_BYTE_Val << HSTPIPCFG_PSIZE_Pos) /**< (HSTPIPCFG) 512 bytes Position */
-#define HSTPIPCFG_PSIZE_1024_BYTE (HSTPIPCFG_PSIZE_1024_BYTE_Val << HSTPIPCFG_PSIZE_Pos) /**< (HSTPIPCFG) 1024 bytes Position */
-#define HSTPIPCFG_PTOKEN_Pos 8 /**< (HSTPIPCFG) Pipe Token Position */
-#define HSTPIPCFG_PTOKEN (_U_(0x3) << HSTPIPCFG_PTOKEN_Pos) /**< (HSTPIPCFG) Pipe Token Mask */
-#define HSTPIPCFG_PTOKEN_SETUP_Val _U_(0x0) /**< (HSTPIPCFG) SETUP */
-#define HSTPIPCFG_PTOKEN_IN_Val _U_(0x1) /**< (HSTPIPCFG) IN */
-#define HSTPIPCFG_PTOKEN_OUT_Val _U_(0x2) /**< (HSTPIPCFG) OUT */
-#define HSTPIPCFG_PTOKEN_SETUP (HSTPIPCFG_PTOKEN_SETUP_Val << HSTPIPCFG_PTOKEN_Pos) /**< (HSTPIPCFG) SETUP Position */
-#define HSTPIPCFG_PTOKEN_IN (HSTPIPCFG_PTOKEN_IN_Val << HSTPIPCFG_PTOKEN_Pos) /**< (HSTPIPCFG) IN Position */
-#define HSTPIPCFG_PTOKEN_OUT (HSTPIPCFG_PTOKEN_OUT_Val << HSTPIPCFG_PTOKEN_Pos) /**< (HSTPIPCFG) OUT Position */
-#define HSTPIPCFG_AUTOSW_Pos 10 /**< (HSTPIPCFG) Automatic Switch Position */
-#define HSTPIPCFG_AUTOSW (_U_(0x1) << HSTPIPCFG_AUTOSW_Pos) /**< (HSTPIPCFG) Automatic Switch Mask */
-#define HSTPIPCFG_PTYPE_Pos 12 /**< (HSTPIPCFG) Pipe Type Position */
-#define HSTPIPCFG_PTYPE (_U_(0x3) << HSTPIPCFG_PTYPE_Pos) /**< (HSTPIPCFG) Pipe Type Mask */
-#define HSTPIPCFG_PTYPE_CTRL_Val _U_(0x0) /**< (HSTPIPCFG) Control */
-#define HSTPIPCFG_PTYPE_ISO_Val _U_(0x1) /**< (HSTPIPCFG) Isochronous */
-#define HSTPIPCFG_PTYPE_BLK_Val _U_(0x2) /**< (HSTPIPCFG) Bulk */
-#define HSTPIPCFG_PTYPE_INTRPT_Val _U_(0x3) /**< (HSTPIPCFG) Interrupt */
-#define HSTPIPCFG_PTYPE_CTRL (HSTPIPCFG_PTYPE_CTRL_Val << HSTPIPCFG_PTYPE_Pos) /**< (HSTPIPCFG) Control Position */
-#define HSTPIPCFG_PTYPE_ISO (HSTPIPCFG_PTYPE_ISO_Val << HSTPIPCFG_PTYPE_Pos) /**< (HSTPIPCFG) Isochronous Position */
-#define HSTPIPCFG_PTYPE_BLK (HSTPIPCFG_PTYPE_BLK_Val << HSTPIPCFG_PTYPE_Pos) /**< (HSTPIPCFG) Bulk Position */
-#define HSTPIPCFG_PTYPE_INTRPT (HSTPIPCFG_PTYPE_INTRPT_Val << HSTPIPCFG_PTYPE_Pos) /**< (HSTPIPCFG) Interrupt Position */
-#define HSTPIPCFG_PEPNUM_Pos 16 /**< (HSTPIPCFG) Pipe Endpoint Number Position */
-#define HSTPIPCFG_PEPNUM (_U_(0xF) << HSTPIPCFG_PEPNUM_Pos) /**< (HSTPIPCFG) Pipe Endpoint Number Mask */
-#define HSTPIPCFG_INTFRQ_Pos 24 /**< (HSTPIPCFG) Pipe Interrupt Request Frequency Position */
-#define HSTPIPCFG_INTFRQ (_U_(0xFF) << HSTPIPCFG_INTFRQ_Pos) /**< (HSTPIPCFG) Pipe Interrupt Request Frequency Mask */
-#define HSTPIPCFG_Msk _U_(0xFF0F377E) /**< (HSTPIPCFG) Register Mask */
-
-/* CTRL_BULK mode */
-#define HSTPIPCFG_CTRL_BULK_PINGEN_Pos 20 /**< (HSTPIPCFG) Ping Enable Position */
-#define HSTPIPCFG_CTRL_BULK_PINGEN (_U_(0x1) << HSTPIPCFG_CTRL_BULK_PINGEN_Pos) /**< (HSTPIPCFG) Ping Enable Mask */
-#define HSTPIPCFG_CTRL_BULK_BINTERVAL_Pos 24 /**< (HSTPIPCFG) bInterval Parameter for the Bulk-Out/Ping Transaction Position */
-#define HSTPIPCFG_CTRL_BULK_BINTERVAL (_U_(0xFF) << HSTPIPCFG_CTRL_BULK_BINTERVAL_Pos) /**< (HSTPIPCFG) bInterval Parameter for the Bulk-Out/Ping Transaction Mask */
-#define HSTPIPCFG_CTRL_BULK_Msk _U_(0xFF100000) /**< (HSTPIPCFG_CTRL_BULK) Register Mask */
-
-
-/* -------- HSTPIPISR : (USBHS Offset: 0x530) (R/ 32) Host Pipe Status Register -------- */
-
-#define HSTPIPISR_OFFSET (0x530) /**< (HSTPIPISR) Host Pipe Status Register Offset */
-
-#define HSTPIPISR_RXINI_Pos 0 /**< (HSTPIPISR) Received IN Data Interrupt Position */
-#define HSTPIPISR_RXINI (_U_(0x1) << HSTPIPISR_RXINI_Pos) /**< (HSTPIPISR) Received IN Data Interrupt Mask */
-#define HSTPIPISR_TXOUTI_Pos 1 /**< (HSTPIPISR) Transmitted OUT Data Interrupt Position */
-#define HSTPIPISR_TXOUTI (_U_(0x1) << HSTPIPISR_TXOUTI_Pos) /**< (HSTPIPISR) Transmitted OUT Data Interrupt Mask */
-#define HSTPIPISR_PERRI_Pos 3 /**< (HSTPIPISR) Pipe Error Interrupt Position */
-#define HSTPIPISR_PERRI (_U_(0x1) << HSTPIPISR_PERRI_Pos) /**< (HSTPIPISR) Pipe Error Interrupt Mask */
-#define HSTPIPISR_NAKEDI_Pos 4 /**< (HSTPIPISR) NAKed Interrupt Position */
-#define HSTPIPISR_NAKEDI (_U_(0x1) << HSTPIPISR_NAKEDI_Pos) /**< (HSTPIPISR) NAKed Interrupt Mask */
-#define HSTPIPISR_OVERFI_Pos 5 /**< (HSTPIPISR) Overflow Interrupt Position */
-#define HSTPIPISR_OVERFI (_U_(0x1) << HSTPIPISR_OVERFI_Pos) /**< (HSTPIPISR) Overflow Interrupt Mask */
-#define HSTPIPISR_SHORTPACKETI_Pos 7 /**< (HSTPIPISR) Short Packet Interrupt Position */
-#define HSTPIPISR_SHORTPACKETI (_U_(0x1) << HSTPIPISR_SHORTPACKETI_Pos) /**< (HSTPIPISR) Short Packet Interrupt Mask */
-#define HSTPIPISR_DTSEQ_Pos 8 /**< (HSTPIPISR) Data Toggle Sequence Position */
-#define HSTPIPISR_DTSEQ (_U_(0x3) << HSTPIPISR_DTSEQ_Pos) /**< (HSTPIPISR) Data Toggle Sequence Mask */
-#define HSTPIPISR_DTSEQ_DATA0_Val _U_(0x0) /**< (HSTPIPISR) Data0 toggle sequence */
-#define HSTPIPISR_DTSEQ_DATA1_Val _U_(0x1) /**< (HSTPIPISR) Data1 toggle sequence */
-#define HSTPIPISR_DTSEQ_DATA0 (HSTPIPISR_DTSEQ_DATA0_Val << HSTPIPISR_DTSEQ_Pos) /**< (HSTPIPISR) Data0 toggle sequence Position */
-#define HSTPIPISR_DTSEQ_DATA1 (HSTPIPISR_DTSEQ_DATA1_Val << HSTPIPISR_DTSEQ_Pos) /**< (HSTPIPISR) Data1 toggle sequence Position */
-#define HSTPIPISR_NBUSYBK_Pos 12 /**< (HSTPIPISR) Number of Busy Banks Position */
-#define HSTPIPISR_NBUSYBK (_U_(0x3) << HSTPIPISR_NBUSYBK_Pos) /**< (HSTPIPISR) Number of Busy Banks Mask */
-#define HSTPIPISR_NBUSYBK_0_BUSY_Val _U_(0x0) /**< (HSTPIPISR) 0 busy bank (all banks free) */
-#define HSTPIPISR_NBUSYBK_1_BUSY_Val _U_(0x1) /**< (HSTPIPISR) 1 busy bank */
-#define HSTPIPISR_NBUSYBK_2_BUSY_Val _U_(0x2) /**< (HSTPIPISR) 2 busy banks */
-#define HSTPIPISR_NBUSYBK_3_BUSY_Val _U_(0x3) /**< (HSTPIPISR) 3 busy banks */
-#define HSTPIPISR_NBUSYBK_0_BUSY (HSTPIPISR_NBUSYBK_0_BUSY_Val << HSTPIPISR_NBUSYBK_Pos) /**< (HSTPIPISR) 0 busy bank (all banks free) Position */
-#define HSTPIPISR_NBUSYBK_1_BUSY (HSTPIPISR_NBUSYBK_1_BUSY_Val << HSTPIPISR_NBUSYBK_Pos) /**< (HSTPIPISR) 1 busy bank Position */
-#define HSTPIPISR_NBUSYBK_2_BUSY (HSTPIPISR_NBUSYBK_2_BUSY_Val << HSTPIPISR_NBUSYBK_Pos) /**< (HSTPIPISR) 2 busy banks Position */
-#define HSTPIPISR_NBUSYBK_3_BUSY (HSTPIPISR_NBUSYBK_3_BUSY_Val << HSTPIPISR_NBUSYBK_Pos) /**< (HSTPIPISR) 3 busy banks Position */
-#define HSTPIPISR_CURRBK_Pos 14 /**< (HSTPIPISR) Current Bank Position */
-#define HSTPIPISR_CURRBK (_U_(0x3) << HSTPIPISR_CURRBK_Pos) /**< (HSTPIPISR) Current Bank Mask */
-#define HSTPIPISR_CURRBK_BANK0_Val _U_(0x0) /**< (HSTPIPISR) Current bank is bank0 */
-#define HSTPIPISR_CURRBK_BANK1_Val _U_(0x1) /**< (HSTPIPISR) Current bank is bank1 */
-#define HSTPIPISR_CURRBK_BANK2_Val _U_(0x2) /**< (HSTPIPISR) Current bank is bank2 */
-#define HSTPIPISR_CURRBK_BANK0 (HSTPIPISR_CURRBK_BANK0_Val << HSTPIPISR_CURRBK_Pos) /**< (HSTPIPISR) Current bank is bank0 Position */
-#define HSTPIPISR_CURRBK_BANK1 (HSTPIPISR_CURRBK_BANK1_Val << HSTPIPISR_CURRBK_Pos) /**< (HSTPIPISR) Current bank is bank1 Position */
-#define HSTPIPISR_CURRBK_BANK2 (HSTPIPISR_CURRBK_BANK2_Val << HSTPIPISR_CURRBK_Pos) /**< (HSTPIPISR) Current bank is bank2 Position */
-#define HSTPIPISR_RWALL_Pos 16 /**< (HSTPIPISR) Read/Write Allowed Position */
-#define HSTPIPISR_RWALL (_U_(0x1) << HSTPIPISR_RWALL_Pos) /**< (HSTPIPISR) Read/Write Allowed Mask */
-#define HSTPIPISR_CFGOK_Pos 18 /**< (HSTPIPISR) Configuration OK Status Position */
-#define HSTPIPISR_CFGOK (_U_(0x1) << HSTPIPISR_CFGOK_Pos) /**< (HSTPIPISR) Configuration OK Status Mask */
-#define HSTPIPISR_PBYCT_Pos 20 /**< (HSTPIPISR) Pipe Byte Count Position */
-#define HSTPIPISR_PBYCT (_U_(0x7FF) << HSTPIPISR_PBYCT_Pos) /**< (HSTPIPISR) Pipe Byte Count Mask */
-#define HSTPIPISR_Msk _U_(0x7FF5F3BB) /**< (HSTPIPISR) Register Mask */
-
-/* CTRL mode */
-#define HSTPIPISR_CTRL_TXSTPI_Pos 2 /**< (HSTPIPISR) Transmitted SETUP Interrupt Position */
-#define HSTPIPISR_CTRL_TXSTPI (_U_(0x1) << HSTPIPISR_CTRL_TXSTPI_Pos) /**< (HSTPIPISR) Transmitted SETUP Interrupt Mask */
-#define HSTPIPISR_CTRL_RXSTALLDI_Pos 6 /**< (HSTPIPISR) Received STALLed Interrupt Position */
-#define HSTPIPISR_CTRL_RXSTALLDI (_U_(0x1) << HSTPIPISR_CTRL_RXSTALLDI_Pos) /**< (HSTPIPISR) Received STALLed Interrupt Mask */
-#define HSTPIPISR_CTRL_Msk _U_(0x44) /**< (HSTPIPISR_CTRL) Register Mask */
-
-/* ISO mode */
-#define HSTPIPISR_ISO_UNDERFI_Pos 2 /**< (HSTPIPISR) Underflow Interrupt Position */
-#define HSTPIPISR_ISO_UNDERFI (_U_(0x1) << HSTPIPISR_ISO_UNDERFI_Pos) /**< (HSTPIPISR) Underflow Interrupt Mask */
-#define HSTPIPISR_ISO_CRCERRI_Pos 6 /**< (HSTPIPISR) CRC Error Interrupt Position */
-#define HSTPIPISR_ISO_CRCERRI (_U_(0x1) << HSTPIPISR_ISO_CRCERRI_Pos) /**< (HSTPIPISR) CRC Error Interrupt Mask */
-#define HSTPIPISR_ISO_Msk _U_(0x44) /**< (HSTPIPISR_ISO) Register Mask */
-
-/* BLK mode */
-#define HSTPIPISR_BLK_TXSTPI_Pos 2 /**< (HSTPIPISR) Transmitted SETUP Interrupt Position */
-#define HSTPIPISR_BLK_TXSTPI (_U_(0x1) << HSTPIPISR_BLK_TXSTPI_Pos) /**< (HSTPIPISR) Transmitted SETUP Interrupt Mask */
-#define HSTPIPISR_BLK_RXSTALLDI_Pos 6 /**< (HSTPIPISR) Received STALLed Interrupt Position */
-#define HSTPIPISR_BLK_RXSTALLDI (_U_(0x1) << HSTPIPISR_BLK_RXSTALLDI_Pos) /**< (HSTPIPISR) Received STALLed Interrupt Mask */
-#define HSTPIPISR_BLK_Msk _U_(0x44) /**< (HSTPIPISR_BLK) Register Mask */
-
-/* INTRPT mode */
-#define HSTPIPISR_INTRPT_UNDERFI_Pos 2 /**< (HSTPIPISR) Underflow Interrupt Position */
-#define HSTPIPISR_INTRPT_UNDERFI (_U_(0x1) << HSTPIPISR_INTRPT_UNDERFI_Pos) /**< (HSTPIPISR) Underflow Interrupt Mask */
-#define HSTPIPISR_INTRPT_RXSTALLDI_Pos 6 /**< (HSTPIPISR) Received STALLed Interrupt Position */
-#define HSTPIPISR_INTRPT_RXSTALLDI (_U_(0x1) << HSTPIPISR_INTRPT_RXSTALLDI_Pos) /**< (HSTPIPISR) Received STALLed Interrupt Mask */
-#define HSTPIPISR_INTRPT_Msk _U_(0x44) /**< (HSTPIPISR_INTRPT) Register Mask */
-
-
-/* -------- HSTPIPICR : (USBHS Offset: 0x560) (/W 32) Host Pipe Clear Register -------- */
-
-#define HSTPIPICR_OFFSET (0x560) /**< (HSTPIPICR) Host Pipe Clear Register Offset */
-
-#define HSTPIPICR_RXINIC_Pos 0 /**< (HSTPIPICR) Received IN Data Interrupt Clear Position */
-#define HSTPIPICR_RXINIC (_U_(0x1) << HSTPIPICR_RXINIC_Pos) /**< (HSTPIPICR) Received IN Data Interrupt Clear Mask */
-#define HSTPIPICR_TXOUTIC_Pos 1 /**< (HSTPIPICR) Transmitted OUT Data Interrupt Clear Position */
-#define HSTPIPICR_TXOUTIC (_U_(0x1) << HSTPIPICR_TXOUTIC_Pos) /**< (HSTPIPICR) Transmitted OUT Data Interrupt Clear Mask */
-#define HSTPIPICR_NAKEDIC_Pos 4 /**< (HSTPIPICR) NAKed Interrupt Clear Position */
-#define HSTPIPICR_NAKEDIC (_U_(0x1) << HSTPIPICR_NAKEDIC_Pos) /**< (HSTPIPICR) NAKed Interrupt Clear Mask */
-#define HSTPIPICR_OVERFIC_Pos 5 /**< (HSTPIPICR) Overflow Interrupt Clear Position */
-#define HSTPIPICR_OVERFIC (_U_(0x1) << HSTPIPICR_OVERFIC_Pos) /**< (HSTPIPICR) Overflow Interrupt Clear Mask */
-#define HSTPIPICR_SHORTPACKETIC_Pos 7 /**< (HSTPIPICR) Short Packet Interrupt Clear Position */
-#define HSTPIPICR_SHORTPACKETIC (_U_(0x1) << HSTPIPICR_SHORTPACKETIC_Pos) /**< (HSTPIPICR) Short Packet Interrupt Clear Mask */
-#define HSTPIPICR_Msk _U_(0xB3) /**< (HSTPIPICR) Register Mask */
-
-/* CTRL mode */
-#define HSTPIPICR_CTRL_TXSTPIC_Pos 2 /**< (HSTPIPICR) Transmitted SETUP Interrupt Clear Position */
-#define HSTPIPICR_CTRL_TXSTPIC (_U_(0x1) << HSTPIPICR_CTRL_TXSTPIC_Pos) /**< (HSTPIPICR) Transmitted SETUP Interrupt Clear Mask */
-#define HSTPIPICR_CTRL_RXSTALLDIC_Pos 6 /**< (HSTPIPICR) Received STALLed Interrupt Clear Position */
-#define HSTPIPICR_CTRL_RXSTALLDIC (_U_(0x1) << HSTPIPICR_CTRL_RXSTALLDIC_Pos) /**< (HSTPIPICR) Received STALLed Interrupt Clear Mask */
-#define HSTPIPICR_CTRL_Msk _U_(0x44) /**< (HSTPIPICR_CTRL) Register Mask */
-
-/* ISO mode */
-#define HSTPIPICR_ISO_UNDERFIC_Pos 2 /**< (HSTPIPICR) Underflow Interrupt Clear Position */
-#define HSTPIPICR_ISO_UNDERFIC (_U_(0x1) << HSTPIPICR_ISO_UNDERFIC_Pos) /**< (HSTPIPICR) Underflow Interrupt Clear Mask */
-#define HSTPIPICR_ISO_CRCERRIC_Pos 6 /**< (HSTPIPICR) CRC Error Interrupt Clear Position */
-#define HSTPIPICR_ISO_CRCERRIC (_U_(0x1) << HSTPIPICR_ISO_CRCERRIC_Pos) /**< (HSTPIPICR) CRC Error Interrupt Clear Mask */
-#define HSTPIPICR_ISO_Msk _U_(0x44) /**< (HSTPIPICR_ISO) Register Mask */
-
-/* BLK mode */
-#define HSTPIPICR_BLK_TXSTPIC_Pos 2 /**< (HSTPIPICR) Transmitted SETUP Interrupt Clear Position */
-#define HSTPIPICR_BLK_TXSTPIC (_U_(0x1) << HSTPIPICR_BLK_TXSTPIC_Pos) /**< (HSTPIPICR) Transmitted SETUP Interrupt Clear Mask */
-#define HSTPIPICR_BLK_RXSTALLDIC_Pos 6 /**< (HSTPIPICR) Received STALLed Interrupt Clear Position */
-#define HSTPIPICR_BLK_RXSTALLDIC (_U_(0x1) << HSTPIPICR_BLK_RXSTALLDIC_Pos) /**< (HSTPIPICR) Received STALLed Interrupt Clear Mask */
-#define HSTPIPICR_BLK_Msk _U_(0x44) /**< (HSTPIPICR_BLK) Register Mask */
-
-/* INTRPT mode */
-#define HSTPIPICR_INTRPT_UNDERFIC_Pos 2 /**< (HSTPIPICR) Underflow Interrupt Clear Position */
-#define HSTPIPICR_INTRPT_UNDERFIC (_U_(0x1) << HSTPIPICR_INTRPT_UNDERFIC_Pos) /**< (HSTPIPICR) Underflow Interrupt Clear Mask */
-#define HSTPIPICR_INTRPT_RXSTALLDIC_Pos 6 /**< (HSTPIPICR) Received STALLed Interrupt Clear Position */
-#define HSTPIPICR_INTRPT_RXSTALLDIC (_U_(0x1) << HSTPIPICR_INTRPT_RXSTALLDIC_Pos) /**< (HSTPIPICR) Received STALLed Interrupt Clear Mask */
-#define HSTPIPICR_INTRPT_Msk _U_(0x44) /**< (HSTPIPICR_INTRPT) Register Mask */
-
-
-/* -------- HSTPIPIFR : (USBHS Offset: 0x590) (/W 32) Host Pipe Set Register -------- */
-
-#define HSTPIPIFR_OFFSET (0x590) /**< (HSTPIPIFR) Host Pipe Set Register Offset */
-
-#define HSTPIPIFR_RXINIS_Pos 0 /**< (HSTPIPIFR) Received IN Data Interrupt Set Position */
-#define HSTPIPIFR_RXINIS (_U_(0x1) << HSTPIPIFR_RXINIS_Pos) /**< (HSTPIPIFR) Received IN Data Interrupt Set Mask */
-#define HSTPIPIFR_TXOUTIS_Pos 1 /**< (HSTPIPIFR) Transmitted OUT Data Interrupt Set Position */
-#define HSTPIPIFR_TXOUTIS (_U_(0x1) << HSTPIPIFR_TXOUTIS_Pos) /**< (HSTPIPIFR) Transmitted OUT Data Interrupt Set Mask */
-#define HSTPIPIFR_PERRIS_Pos 3 /**< (HSTPIPIFR) Pipe Error Interrupt Set Position */
-#define HSTPIPIFR_PERRIS (_U_(0x1) << HSTPIPIFR_PERRIS_Pos) /**< (HSTPIPIFR) Pipe Error Interrupt Set Mask */
-#define HSTPIPIFR_NAKEDIS_Pos 4 /**< (HSTPIPIFR) NAKed Interrupt Set Position */
-#define HSTPIPIFR_NAKEDIS (_U_(0x1) << HSTPIPIFR_NAKEDIS_Pos) /**< (HSTPIPIFR) NAKed Interrupt Set Mask */
-#define HSTPIPIFR_OVERFIS_Pos 5 /**< (HSTPIPIFR) Overflow Interrupt Set Position */
-#define HSTPIPIFR_OVERFIS (_U_(0x1) << HSTPIPIFR_OVERFIS_Pos) /**< (HSTPIPIFR) Overflow Interrupt Set Mask */
-#define HSTPIPIFR_SHORTPACKETIS_Pos 7 /**< (HSTPIPIFR) Short Packet Interrupt Set Position */
-#define HSTPIPIFR_SHORTPACKETIS (_U_(0x1) << HSTPIPIFR_SHORTPACKETIS_Pos) /**< (HSTPIPIFR) Short Packet Interrupt Set Mask */
-#define HSTPIPIFR_NBUSYBKS_Pos 12 /**< (HSTPIPIFR) Number of Busy Banks Set Position */
-#define HSTPIPIFR_NBUSYBKS (_U_(0x1) << HSTPIPIFR_NBUSYBKS_Pos) /**< (HSTPIPIFR) Number of Busy Banks Set Mask */
-#define HSTPIPIFR_Msk _U_(0x10BB) /**< (HSTPIPIFR) Register Mask */
-
-/* CTRL mode */
-#define HSTPIPIFR_CTRL_TXSTPIS_Pos 2 /**< (HSTPIPIFR) Transmitted SETUP Interrupt Set Position */
-#define HSTPIPIFR_CTRL_TXSTPIS (_U_(0x1) << HSTPIPIFR_CTRL_TXSTPIS_Pos) /**< (HSTPIPIFR) Transmitted SETUP Interrupt Set Mask */
-#define HSTPIPIFR_CTRL_RXSTALLDIS_Pos 6 /**< (HSTPIPIFR) Received STALLed Interrupt Set Position */
-#define HSTPIPIFR_CTRL_RXSTALLDIS (_U_(0x1) << HSTPIPIFR_CTRL_RXSTALLDIS_Pos) /**< (HSTPIPIFR) Received STALLed Interrupt Set Mask */
-#define HSTPIPIFR_CTRL_Msk _U_(0x44) /**< (HSTPIPIFR_CTRL) Register Mask */
-
-/* ISO mode */
-#define HSTPIPIFR_ISO_UNDERFIS_Pos 2 /**< (HSTPIPIFR) Underflow Interrupt Set Position */
-#define HSTPIPIFR_ISO_UNDERFIS (_U_(0x1) << HSTPIPIFR_ISO_UNDERFIS_Pos) /**< (HSTPIPIFR) Underflow Interrupt Set Mask */
-#define HSTPIPIFR_ISO_CRCERRIS_Pos 6 /**< (HSTPIPIFR) CRC Error Interrupt Set Position */
-#define HSTPIPIFR_ISO_CRCERRIS (_U_(0x1) << HSTPIPIFR_ISO_CRCERRIS_Pos) /**< (HSTPIPIFR) CRC Error Interrupt Set Mask */
-#define HSTPIPIFR_ISO_Msk _U_(0x44) /**< (HSTPIPIFR_ISO) Register Mask */
-
-/* BLK mode */
-#define HSTPIPIFR_BLK_TXSTPIS_Pos 2 /**< (HSTPIPIFR) Transmitted SETUP Interrupt Set Position */
-#define HSTPIPIFR_BLK_TXSTPIS (_U_(0x1) << HSTPIPIFR_BLK_TXSTPIS_Pos) /**< (HSTPIPIFR) Transmitted SETUP Interrupt Set Mask */
-#define HSTPIPIFR_BLK_RXSTALLDIS_Pos 6 /**< (HSTPIPIFR) Received STALLed Interrupt Set Position */
-#define HSTPIPIFR_BLK_RXSTALLDIS (_U_(0x1) << HSTPIPIFR_BLK_RXSTALLDIS_Pos) /**< (HSTPIPIFR) Received STALLed Interrupt Set Mask */
-#define HSTPIPIFR_BLK_Msk _U_(0x44) /**< (HSTPIPIFR_BLK) Register Mask */
-
-/* INTRPT mode */
-#define HSTPIPIFR_INTRPT_UNDERFIS_Pos 2 /**< (HSTPIPIFR) Underflow Interrupt Set Position */
-#define HSTPIPIFR_INTRPT_UNDERFIS (_U_(0x1) << HSTPIPIFR_INTRPT_UNDERFIS_Pos) /**< (HSTPIPIFR) Underflow Interrupt Set Mask */
-#define HSTPIPIFR_INTRPT_RXSTALLDIS_Pos 6 /**< (HSTPIPIFR) Received STALLed Interrupt Set Position */
-#define HSTPIPIFR_INTRPT_RXSTALLDIS (_U_(0x1) << HSTPIPIFR_INTRPT_RXSTALLDIS_Pos) /**< (HSTPIPIFR) Received STALLed Interrupt Set Mask */
-#define HSTPIPIFR_INTRPT_Msk _U_(0x44) /**< (HSTPIPIFR_INTRPT) Register Mask */
-
-
-/* -------- HSTPIPIMR : (USBHS Offset: 0x5c0) (R/ 32) Host Pipe Mask Register -------- */
-
-#define HSTPIPIMR_OFFSET (0x5C0) /**< (HSTPIPIMR) Host Pipe Mask Register Offset */
-
-#define HSTPIPIMR_RXINE_Pos 0 /**< (HSTPIPIMR) Received IN Data Interrupt Enable Position */
-#define HSTPIPIMR_RXINE (_U_(0x1) << HSTPIPIMR_RXINE_Pos) /**< (HSTPIPIMR) Received IN Data Interrupt Enable Mask */
-#define HSTPIPIMR_TXOUTE_Pos 1 /**< (HSTPIPIMR) Transmitted OUT Data Interrupt Enable Position */
-#define HSTPIPIMR_TXOUTE (_U_(0x1) << HSTPIPIMR_TXOUTE_Pos) /**< (HSTPIPIMR) Transmitted OUT Data Interrupt Enable Mask */
-#define HSTPIPIMR_PERRE_Pos 3 /**< (HSTPIPIMR) Pipe Error Interrupt Enable Position */
-#define HSTPIPIMR_PERRE (_U_(0x1) << HSTPIPIMR_PERRE_Pos) /**< (HSTPIPIMR) Pipe Error Interrupt Enable Mask */
-#define HSTPIPIMR_NAKEDE_Pos 4 /**< (HSTPIPIMR) NAKed Interrupt Enable Position */
-#define HSTPIPIMR_NAKEDE (_U_(0x1) << HSTPIPIMR_NAKEDE_Pos) /**< (HSTPIPIMR) NAKed Interrupt Enable Mask */
-#define HSTPIPIMR_OVERFIE_Pos 5 /**< (HSTPIPIMR) Overflow Interrupt Enable Position */
-#define HSTPIPIMR_OVERFIE (_U_(0x1) << HSTPIPIMR_OVERFIE_Pos) /**< (HSTPIPIMR) Overflow Interrupt Enable Mask */
-#define HSTPIPIMR_SHORTPACKETIE_Pos 7 /**< (HSTPIPIMR) Short Packet Interrupt Enable Position */
-#define HSTPIPIMR_SHORTPACKETIE (_U_(0x1) << HSTPIPIMR_SHORTPACKETIE_Pos) /**< (HSTPIPIMR) Short Packet Interrupt Enable Mask */
-#define HSTPIPIMR_NBUSYBKE_Pos 12 /**< (HSTPIPIMR) Number of Busy Banks Interrupt Enable Position */
-#define HSTPIPIMR_NBUSYBKE (_U_(0x1) << HSTPIPIMR_NBUSYBKE_Pos) /**< (HSTPIPIMR) Number of Busy Banks Interrupt Enable Mask */
-#define HSTPIPIMR_FIFOCON_Pos 14 /**< (HSTPIPIMR) FIFO Control Position */
-#define HSTPIPIMR_FIFOCON (_U_(0x1) << HSTPIPIMR_FIFOCON_Pos) /**< (HSTPIPIMR) FIFO Control Mask */
-#define HSTPIPIMR_PDISHDMA_Pos 16 /**< (HSTPIPIMR) Pipe Interrupts Disable HDMA Request Enable Position */
-#define HSTPIPIMR_PDISHDMA (_U_(0x1) << HSTPIPIMR_PDISHDMA_Pos) /**< (HSTPIPIMR) Pipe Interrupts Disable HDMA Request Enable Mask */
-#define HSTPIPIMR_PFREEZE_Pos 17 /**< (HSTPIPIMR) Pipe Freeze Position */
-#define HSTPIPIMR_PFREEZE (_U_(0x1) << HSTPIPIMR_PFREEZE_Pos) /**< (HSTPIPIMR) Pipe Freeze Mask */
-#define HSTPIPIMR_RSTDT_Pos 18 /**< (HSTPIPIMR) Reset Data Toggle Position */
-#define HSTPIPIMR_RSTDT (_U_(0x1) << HSTPIPIMR_RSTDT_Pos) /**< (HSTPIPIMR) Reset Data Toggle Mask */
-#define HSTPIPIMR_Msk _U_(0x750BB) /**< (HSTPIPIMR) Register Mask */
-
-/* CTRL mode */
-#define HSTPIPIMR_CTRL_TXSTPE_Pos 2 /**< (HSTPIPIMR) Transmitted SETUP Interrupt Enable Position */
-#define HSTPIPIMR_CTRL_TXSTPE (_U_(0x1) << HSTPIPIMR_CTRL_TXSTPE_Pos) /**< (HSTPIPIMR) Transmitted SETUP Interrupt Enable Mask */
-#define HSTPIPIMR_CTRL_RXSTALLDE_Pos 6 /**< (HSTPIPIMR) Received STALLed Interrupt Enable Position */
-#define HSTPIPIMR_CTRL_RXSTALLDE (_U_(0x1) << HSTPIPIMR_CTRL_RXSTALLDE_Pos) /**< (HSTPIPIMR) Received STALLed Interrupt Enable Mask */
-#define HSTPIPIMR_CTRL_Msk _U_(0x44) /**< (HSTPIPIMR_CTRL) Register Mask */
-
-/* ISO mode */
-#define HSTPIPIMR_ISO_UNDERFIE_Pos 2 /**< (HSTPIPIMR) Underflow Interrupt Enable Position */
-#define HSTPIPIMR_ISO_UNDERFIE (_U_(0x1) << HSTPIPIMR_ISO_UNDERFIE_Pos) /**< (HSTPIPIMR) Underflow Interrupt Enable Mask */
-#define HSTPIPIMR_ISO_CRCERRE_Pos 6 /**< (HSTPIPIMR) CRC Error Interrupt Enable Position */
-#define HSTPIPIMR_ISO_CRCERRE (_U_(0x1) << HSTPIPIMR_ISO_CRCERRE_Pos) /**< (HSTPIPIMR) CRC Error Interrupt Enable Mask */
-#define HSTPIPIMR_ISO_Msk _U_(0x44) /**< (HSTPIPIMR_ISO) Register Mask */
-
-/* BLK mode */
-#define HSTPIPIMR_BLK_TXSTPE_Pos 2 /**< (HSTPIPIMR) Transmitted SETUP Interrupt Enable Position */
-#define HSTPIPIMR_BLK_TXSTPE (_U_(0x1) << HSTPIPIMR_BLK_TXSTPE_Pos) /**< (HSTPIPIMR) Transmitted SETUP Interrupt Enable Mask */
-#define HSTPIPIMR_BLK_RXSTALLDE_Pos 6 /**< (HSTPIPIMR) Received STALLed Interrupt Enable Position */
-#define HSTPIPIMR_BLK_RXSTALLDE (_U_(0x1) << HSTPIPIMR_BLK_RXSTALLDE_Pos) /**< (HSTPIPIMR) Received STALLed Interrupt Enable Mask */
-#define HSTPIPIMR_BLK_Msk _U_(0x44) /**< (HSTPIPIMR_BLK) Register Mask */
-
-/* INTRPT mode */
-#define HSTPIPIMR_INTRPT_UNDERFIE_Pos 2 /**< (HSTPIPIMR) Underflow Interrupt Enable Position */
-#define HSTPIPIMR_INTRPT_UNDERFIE (_U_(0x1) << HSTPIPIMR_INTRPT_UNDERFIE_Pos) /**< (HSTPIPIMR) Underflow Interrupt Enable Mask */
-#define HSTPIPIMR_INTRPT_RXSTALLDE_Pos 6 /**< (HSTPIPIMR) Received STALLed Interrupt Enable Position */
-#define HSTPIPIMR_INTRPT_RXSTALLDE (_U_(0x1) << HSTPIPIMR_INTRPT_RXSTALLDE_Pos) /**< (HSTPIPIMR) Received STALLed Interrupt Enable Mask */
-#define HSTPIPIMR_INTRPT_Msk _U_(0x44) /**< (HSTPIPIMR_INTRPT) Register Mask */
-
-
-/* -------- HSTPIPIER : (USBHS Offset: 0x5f0) (/W 32) Host Pipe Enable Register -------- */
-
-#define HSTPIPIER_OFFSET (0x5F0) /**< (HSTPIPIER) Host Pipe Enable Register Offset */
-
-#define HSTPIPIER_RXINES_Pos 0 /**< (HSTPIPIER) Received IN Data Interrupt Enable Position */
-#define HSTPIPIER_RXINES (_U_(0x1) << HSTPIPIER_RXINES_Pos) /**< (HSTPIPIER) Received IN Data Interrupt Enable Mask */
-#define HSTPIPIER_TXOUTES_Pos 1 /**< (HSTPIPIER) Transmitted OUT Data Interrupt Enable Position */
-#define HSTPIPIER_TXOUTES (_U_(0x1) << HSTPIPIER_TXOUTES_Pos) /**< (HSTPIPIER) Transmitted OUT Data Interrupt Enable Mask */
-#define HSTPIPIER_PERRES_Pos 3 /**< (HSTPIPIER) Pipe Error Interrupt Enable Position */
-#define HSTPIPIER_PERRES (_U_(0x1) << HSTPIPIER_PERRES_Pos) /**< (HSTPIPIER) Pipe Error Interrupt Enable Mask */
-#define HSTPIPIER_NAKEDES_Pos 4 /**< (HSTPIPIER) NAKed Interrupt Enable Position */
-#define HSTPIPIER_NAKEDES (_U_(0x1) << HSTPIPIER_NAKEDES_Pos) /**< (HSTPIPIER) NAKed Interrupt Enable Mask */
-#define HSTPIPIER_OVERFIES_Pos 5 /**< (HSTPIPIER) Overflow Interrupt Enable Position */
-#define HSTPIPIER_OVERFIES (_U_(0x1) << HSTPIPIER_OVERFIES_Pos) /**< (HSTPIPIER) Overflow Interrupt Enable Mask */
-#define HSTPIPIER_SHORTPACKETIES_Pos 7 /**< (HSTPIPIER) Short Packet Interrupt Enable Position */
-#define HSTPIPIER_SHORTPACKETIES (_U_(0x1) << HSTPIPIER_SHORTPACKETIES_Pos) /**< (HSTPIPIER) Short Packet Interrupt Enable Mask */
-#define HSTPIPIER_NBUSYBKES_Pos 12 /**< (HSTPIPIER) Number of Busy Banks Enable Position */
-#define HSTPIPIER_NBUSYBKES (_U_(0x1) << HSTPIPIER_NBUSYBKES_Pos) /**< (HSTPIPIER) Number of Busy Banks Enable Mask */
-#define HSTPIPIER_PDISHDMAS_Pos 16 /**< (HSTPIPIER) Pipe Interrupts Disable HDMA Request Enable Position */
-#define HSTPIPIER_PDISHDMAS (_U_(0x1) << HSTPIPIER_PDISHDMAS_Pos) /**< (HSTPIPIER) Pipe Interrupts Disable HDMA Request Enable Mask */
-#define HSTPIPIER_PFREEZES_Pos 17 /**< (HSTPIPIER) Pipe Freeze Enable Position */
-#define HSTPIPIER_PFREEZES (_U_(0x1) << HSTPIPIER_PFREEZES_Pos) /**< (HSTPIPIER) Pipe Freeze Enable Mask */
-#define HSTPIPIER_RSTDTS_Pos 18 /**< (HSTPIPIER) Reset Data Toggle Enable Position */
-#define HSTPIPIER_RSTDTS (_U_(0x1) << HSTPIPIER_RSTDTS_Pos) /**< (HSTPIPIER) Reset Data Toggle Enable Mask */
-#define HSTPIPIER_Msk _U_(0x710BB) /**< (HSTPIPIER) Register Mask */
-
-/* CTRL mode */
-#define HSTPIPIER_CTRL_TXSTPES_Pos 2 /**< (HSTPIPIER) Transmitted SETUP Interrupt Enable Position */
-#define HSTPIPIER_CTRL_TXSTPES (_U_(0x1) << HSTPIPIER_CTRL_TXSTPES_Pos) /**< (HSTPIPIER) Transmitted SETUP Interrupt Enable Mask */
-#define HSTPIPIER_CTRL_RXSTALLDES_Pos 6 /**< (HSTPIPIER) Received STALLed Interrupt Enable Position */
-#define HSTPIPIER_CTRL_RXSTALLDES (_U_(0x1) << HSTPIPIER_CTRL_RXSTALLDES_Pos) /**< (HSTPIPIER) Received STALLed Interrupt Enable Mask */
-#define HSTPIPIER_CTRL_Msk _U_(0x44) /**< (HSTPIPIER_CTRL) Register Mask */
-
-/* ISO mode */
-#define HSTPIPIER_ISO_UNDERFIES_Pos 2 /**< (HSTPIPIER) Underflow Interrupt Enable Position */
-#define HSTPIPIER_ISO_UNDERFIES (_U_(0x1) << HSTPIPIER_ISO_UNDERFIES_Pos) /**< (HSTPIPIER) Underflow Interrupt Enable Mask */
-#define HSTPIPIER_ISO_CRCERRES_Pos 6 /**< (HSTPIPIER) CRC Error Interrupt Enable Position */
-#define HSTPIPIER_ISO_CRCERRES (_U_(0x1) << HSTPIPIER_ISO_CRCERRES_Pos) /**< (HSTPIPIER) CRC Error Interrupt Enable Mask */
-#define HSTPIPIER_ISO_Msk _U_(0x44) /**< (HSTPIPIER_ISO) Register Mask */
-
-/* BLK mode */
-#define HSTPIPIER_BLK_TXSTPES_Pos 2 /**< (HSTPIPIER) Transmitted SETUP Interrupt Enable Position */
-#define HSTPIPIER_BLK_TXSTPES (_U_(0x1) << HSTPIPIER_BLK_TXSTPES_Pos) /**< (HSTPIPIER) Transmitted SETUP Interrupt Enable Mask */
-#define HSTPIPIER_BLK_RXSTALLDES_Pos 6 /**< (HSTPIPIER) Received STALLed Interrupt Enable Position */
-#define HSTPIPIER_BLK_RXSTALLDES (_U_(0x1) << HSTPIPIER_BLK_RXSTALLDES_Pos) /**< (HSTPIPIER) Received STALLed Interrupt Enable Mask */
-#define HSTPIPIER_BLK_Msk _U_(0x44) /**< (HSTPIPIER_BLK) Register Mask */
-
-/* INTRPT mode */
-#define HSTPIPIER_INTRPT_UNDERFIES_Pos 2 /**< (HSTPIPIER) Underflow Interrupt Enable Position */
-#define HSTPIPIER_INTRPT_UNDERFIES (_U_(0x1) << HSTPIPIER_INTRPT_UNDERFIES_Pos) /**< (HSTPIPIER) Underflow Interrupt Enable Mask */
-#define HSTPIPIER_INTRPT_RXSTALLDES_Pos 6 /**< (HSTPIPIER) Received STALLed Interrupt Enable Position */
-#define HSTPIPIER_INTRPT_RXSTALLDES (_U_(0x1) << HSTPIPIER_INTRPT_RXSTALLDES_Pos) /**< (HSTPIPIER) Received STALLed Interrupt Enable Mask */
-#define HSTPIPIER_INTRPT_Msk _U_(0x44) /**< (HSTPIPIER_INTRPT) Register Mask */
-
-
-/* -------- HSTPIPIDR : (USBHS Offset: 0x620) (/W 32) Host Pipe Disable Register -------- */
-
-#define HSTPIPIDR_OFFSET (0x620) /**< (HSTPIPIDR) Host Pipe Disable Register Offset */
-
-#define HSTPIPIDR_RXINEC_Pos 0 /**< (HSTPIPIDR) Received IN Data Interrupt Disable Position */
-#define HSTPIPIDR_RXINEC (_U_(0x1) << HSTPIPIDR_RXINEC_Pos) /**< (HSTPIPIDR) Received IN Data Interrupt Disable Mask */
-#define HSTPIPIDR_TXOUTEC_Pos 1 /**< (HSTPIPIDR) Transmitted OUT Data Interrupt Disable Position */
-#define HSTPIPIDR_TXOUTEC (_U_(0x1) << HSTPIPIDR_TXOUTEC_Pos) /**< (HSTPIPIDR) Transmitted OUT Data Interrupt Disable Mask */
-#define HSTPIPIDR_PERREC_Pos 3 /**< (HSTPIPIDR) Pipe Error Interrupt Disable Position */
-#define HSTPIPIDR_PERREC (_U_(0x1) << HSTPIPIDR_PERREC_Pos) /**< (HSTPIPIDR) Pipe Error Interrupt Disable Mask */
-#define HSTPIPIDR_NAKEDEC_Pos 4 /**< (HSTPIPIDR) NAKed Interrupt Disable Position */
-#define HSTPIPIDR_NAKEDEC (_U_(0x1) << HSTPIPIDR_NAKEDEC_Pos) /**< (HSTPIPIDR) NAKed Interrupt Disable Mask */
-#define HSTPIPIDR_OVERFIEC_Pos 5 /**< (HSTPIPIDR) Overflow Interrupt Disable Position */
-#define HSTPIPIDR_OVERFIEC (_U_(0x1) << HSTPIPIDR_OVERFIEC_Pos) /**< (HSTPIPIDR) Overflow Interrupt Disable Mask */
-#define HSTPIPIDR_SHORTPACKETIEC_Pos 7 /**< (HSTPIPIDR) Short Packet Interrupt Disable Position */
-#define HSTPIPIDR_SHORTPACKETIEC (_U_(0x1) << HSTPIPIDR_SHORTPACKETIEC_Pos) /**< (HSTPIPIDR) Short Packet Interrupt Disable Mask */
-#define HSTPIPIDR_NBUSYBKEC_Pos 12 /**< (HSTPIPIDR) Number of Busy Banks Disable Position */
-#define HSTPIPIDR_NBUSYBKEC (_U_(0x1) << HSTPIPIDR_NBUSYBKEC_Pos) /**< (HSTPIPIDR) Number of Busy Banks Disable Mask */
-#define HSTPIPIDR_FIFOCONC_Pos 14 /**< (HSTPIPIDR) FIFO Control Disable Position */
-#define HSTPIPIDR_FIFOCONC (_U_(0x1) << HSTPIPIDR_FIFOCONC_Pos) /**< (HSTPIPIDR) FIFO Control Disable Mask */
-#define HSTPIPIDR_PDISHDMAC_Pos 16 /**< (HSTPIPIDR) Pipe Interrupts Disable HDMA Request Disable Position */
-#define HSTPIPIDR_PDISHDMAC (_U_(0x1) << HSTPIPIDR_PDISHDMAC_Pos) /**< (HSTPIPIDR) Pipe Interrupts Disable HDMA Request Disable Mask */
-#define HSTPIPIDR_PFREEZEC_Pos 17 /**< (HSTPIPIDR) Pipe Freeze Disable Position */
-#define HSTPIPIDR_PFREEZEC (_U_(0x1) << HSTPIPIDR_PFREEZEC_Pos) /**< (HSTPIPIDR) Pipe Freeze Disable Mask */
-#define HSTPIPIDR_Msk _U_(0x350BB) /**< (HSTPIPIDR) Register Mask */
-
-/* CTRL mode */
-#define HSTPIPIDR_CTRL_TXSTPEC_Pos 2 /**< (HSTPIPIDR) Transmitted SETUP Interrupt Disable Position */
-#define HSTPIPIDR_CTRL_TXSTPEC (_U_(0x1) << HSTPIPIDR_CTRL_TXSTPEC_Pos) /**< (HSTPIPIDR) Transmitted SETUP Interrupt Disable Mask */
-#define HSTPIPIDR_CTRL_RXSTALLDEC_Pos 6 /**< (HSTPIPIDR) Received STALLed Interrupt Disable Position */
-#define HSTPIPIDR_CTRL_RXSTALLDEC (_U_(0x1) << HSTPIPIDR_CTRL_RXSTALLDEC_Pos) /**< (HSTPIPIDR) Received STALLed Interrupt Disable Mask */
-#define HSTPIPIDR_CTRL_Msk _U_(0x44) /**< (HSTPIPIDR_CTRL) Register Mask */
-
-/* ISO mode */
-#define HSTPIPIDR_ISO_UNDERFIEC_Pos 2 /**< (HSTPIPIDR) Underflow Interrupt Disable Position */
-#define HSTPIPIDR_ISO_UNDERFIEC (_U_(0x1) << HSTPIPIDR_ISO_UNDERFIEC_Pos) /**< (HSTPIPIDR) Underflow Interrupt Disable Mask */
-#define HSTPIPIDR_ISO_CRCERREC_Pos 6 /**< (HSTPIPIDR) CRC Error Interrupt Disable Position */
-#define HSTPIPIDR_ISO_CRCERREC (_U_(0x1) << HSTPIPIDR_ISO_CRCERREC_Pos) /**< (HSTPIPIDR) CRC Error Interrupt Disable Mask */
-#define HSTPIPIDR_ISO_Msk _U_(0x44) /**< (HSTPIPIDR_ISO) Register Mask */
-
-/* BLK mode */
-#define HSTPIPIDR_BLK_TXSTPEC_Pos 2 /**< (HSTPIPIDR) Transmitted SETUP Interrupt Disable Position */
-#define HSTPIPIDR_BLK_TXSTPEC (_U_(0x1) << HSTPIPIDR_BLK_TXSTPEC_Pos) /**< (HSTPIPIDR) Transmitted SETUP Interrupt Disable Mask */
-#define HSTPIPIDR_BLK_RXSTALLDEC_Pos 6 /**< (HSTPIPIDR) Received STALLed Interrupt Disable Position */
-#define HSTPIPIDR_BLK_RXSTALLDEC (_U_(0x1) << HSTPIPIDR_BLK_RXSTALLDEC_Pos) /**< (HSTPIPIDR) Received STALLed Interrupt Disable Mask */
-#define HSTPIPIDR_BLK_Msk _U_(0x44) /**< (HSTPIPIDR_BLK) Register Mask */
-
-/* INTRPT mode */
-#define HSTPIPIDR_INTRPT_UNDERFIEC_Pos 2 /**< (HSTPIPIDR) Underflow Interrupt Disable Position */
-#define HSTPIPIDR_INTRPT_UNDERFIEC (_U_(0x1) << HSTPIPIDR_INTRPT_UNDERFIEC_Pos) /**< (HSTPIPIDR) Underflow Interrupt Disable Mask */
-#define HSTPIPIDR_INTRPT_RXSTALLDEC_Pos 6 /**< (HSTPIPIDR) Received STALLed Interrupt Disable Position */
-#define HSTPIPIDR_INTRPT_RXSTALLDEC (_U_(0x1) << HSTPIPIDR_INTRPT_RXSTALLDEC_Pos) /**< (HSTPIPIDR) Received STALLed Interrupt Disable Mask */
-#define HSTPIPIDR_INTRPT_Msk _U_(0x44) /**< (HSTPIPIDR_INTRPT) Register Mask */
-
-
-/* -------- HSTPIPINRQ : (USBHS Offset: 0x650) (R/W 32) Host Pipe IN Request Register -------- */
-
-#define HSTPIPINRQ_OFFSET (0x650) /**< (HSTPIPINRQ) Host Pipe IN Request Register Offset */
-
-#define HSTPIPINRQ_INRQ_Pos 0 /**< (HSTPIPINRQ) IN Request Number before Freeze Position */
-#define HSTPIPINRQ_INRQ (_U_(0xFF) << HSTPIPINRQ_INRQ_Pos) /**< (HSTPIPINRQ) IN Request Number before Freeze Mask */
-#define HSTPIPINRQ_INMODE_Pos 8 /**< (HSTPIPINRQ) IN Request Mode Position */
-#define HSTPIPINRQ_INMODE (_U_(0x1) << HSTPIPINRQ_INMODE_Pos) /**< (HSTPIPINRQ) IN Request Mode Mask */
-#define HSTPIPINRQ_Msk _U_(0x1FF) /**< (HSTPIPINRQ) Register Mask */
-
-
-/* -------- HSTPIPERR : (USBHS Offset: 0x680) (R/W 32) Host Pipe Error Register -------- */
-
-#define HSTPIPERR_OFFSET (0x680) /**< (HSTPIPERR) Host Pipe Error Register Offset */
-
-#define HSTPIPERR_DATATGL_Pos 0 /**< (HSTPIPERR) Data Toggle Error Position */
-#define HSTPIPERR_DATATGL (_U_(0x1) << HSTPIPERR_DATATGL_Pos) /**< (HSTPIPERR) Data Toggle Error Mask */
-#define HSTPIPERR_DATAPID_Pos 1 /**< (HSTPIPERR) Data PID Error Position */
-#define HSTPIPERR_DATAPID (_U_(0x1) << HSTPIPERR_DATAPID_Pos) /**< (HSTPIPERR) Data PID Error Mask */
-#define HSTPIPERR_PID_Pos 2 /**< (HSTPIPERR) Data PID Error Position */
-#define HSTPIPERR_PID (_U_(0x1) << HSTPIPERR_PID_Pos) /**< (HSTPIPERR) Data PID Error Mask */
-#define HSTPIPERR_TIMEOUT_Pos 3 /**< (HSTPIPERR) Time-Out Error Position */
-#define HSTPIPERR_TIMEOUT (_U_(0x1) << HSTPIPERR_TIMEOUT_Pos) /**< (HSTPIPERR) Time-Out Error Mask */
-#define HSTPIPERR_CRC16_Pos 4 /**< (HSTPIPERR) CRC16 Error Position */
-#define HSTPIPERR_CRC16 (_U_(0x1) << HSTPIPERR_CRC16_Pos) /**< (HSTPIPERR) CRC16 Error Mask */
-#define HSTPIPERR_COUNTER_Pos 5 /**< (HSTPIPERR) Error Counter Position */
-#define HSTPIPERR_COUNTER (_U_(0x3) << HSTPIPERR_COUNTER_Pos) /**< (HSTPIPERR) Error Counter Mask */
-#define HSTPIPERR_Msk _U_(0x7F) /**< (HSTPIPERR) Register Mask */
-
-#define HSTPIPERR_CRC_Pos 4 /**< (HSTPIPERR Position) CRCx6 Error */
-#define HSTPIPERR_CRC (_U_(0x1) << HSTPIPERR_CRC_Pos) /**< (HSTPIPERR Mask) CRC */
-
-/* -------- CTRL : (USBHS Offset: 0x800) (R/W 32) General Control Register -------- */
-
-#define CTRL_OFFSET (0x800) /**< (CTRL) General Control Register Offset */
-
-#define CTRL_RDERRE_Pos 4 /**< (CTRL) Remote Device Connection Error Interrupt Enable Position */
-#define CTRL_RDERRE (_U_(0x1) << CTRL_RDERRE_Pos) /**< (CTRL) Remote Device Connection Error Interrupt Enable Mask */
-#define CTRL_VBUSHWC_Pos 8 /**< (CTRL) VBUS Hardware Control Position */
-#define CTRL_VBUSHWC (_U_(0x1) << CTRL_VBUSHWC_Pos) /**< (CTRL) VBUS Hardware Control Mask */
-#define CTRL_FRZCLK_Pos 14 /**< (CTRL) Freeze USB Clock Position */
-#define CTRL_FRZCLK (_U_(0x1) << CTRL_FRZCLK_Pos) /**< (CTRL) Freeze USB Clock Mask */
-#define CTRL_USBE_Pos 15 /**< (CTRL) USBHS Enable Position */
-#define CTRL_USBE (_U_(0x1) << CTRL_USBE_Pos) /**< (CTRL) USBHS Enable Mask */
-#define CTRL_UID_Pos 24 /**< (CTRL) UID Pin Enable Position */
-#define CTRL_UID (_U_(0x1) << CTRL_UID_Pos) /**< (CTRL) UID Pin Enable Mask */
-#define CTRL_UIMOD_Pos 25 /**< (CTRL) USBHS Mode Position */
-#define CTRL_UIMOD (_U_(0x1) << CTRL_UIMOD_Pos) /**< (CTRL) USBHS Mode Mask */
-#define CTRL_UIMOD_HOST_Val _U_(0x0) /**< (CTRL) The module is in USB Host mode. */
-#define CTRL_UIMOD_DEVICE_Val _U_(0x1) /**< (CTRL) The module is in USB Device mode. */
-#define CTRL_UIMOD_HOST (CTRL_UIMOD_HOST_Val << CTRL_UIMOD_Pos) /**< (CTRL) The module is in USB Host mode. Position */
-#define CTRL_UIMOD_DEVICE (CTRL_UIMOD_DEVICE_Val << CTRL_UIMOD_Pos) /**< (CTRL) The module is in USB Device mode. Position */
-#define CTRL_Msk _U_(0x300C110) /**< (CTRL) Register Mask */
-
-
-/* -------- SR : (USBHS Offset: 0x804) (R/ 32) General Status Register -------- */
-
-#define SR_OFFSET (0x804) /**< (SR) General Status Register Offset */
-
-#define SR_RDERRI_Pos 4 /**< (SR) Remote Device Connection Error Interrupt (Host mode only) Position */
-#define SR_RDERRI (_U_(0x1) << SR_RDERRI_Pos) /**< (SR) Remote Device Connection Error Interrupt (Host mode only) Mask */
-#define SR_SPEED_Pos 12 /**< (SR) Speed Status (Device mode only) Position */
-#define SR_SPEED (_U_(0x3) << SR_SPEED_Pos) /**< (SR) Speed Status (Device mode only) Mask */
-#define SR_SPEED_FULL_SPEED_Val _U_(0x0) /**< (SR) Full-Speed mode */
-#define SR_SPEED_HIGH_SPEED_Val _U_(0x1) /**< (SR) High-Speed mode */
-#define SR_SPEED_LOW_SPEED_Val _U_(0x2) /**< (SR) Low-Speed mode */
-#define SR_SPEED_FULL_SPEED (SR_SPEED_FULL_SPEED_Val << SR_SPEED_Pos) /**< (SR) Full-Speed mode Position */
-#define SR_SPEED_HIGH_SPEED (SR_SPEED_HIGH_SPEED_Val << SR_SPEED_Pos) /**< (SR) High-Speed mode Position */
-#define SR_SPEED_LOW_SPEED (SR_SPEED_LOW_SPEED_Val << SR_SPEED_Pos) /**< (SR) Low-Speed mode Position */
-#define SR_CLKUSABLE_Pos 14 /**< (SR) UTMI Clock Usable Position */
-#define SR_CLKUSABLE (_U_(0x1) << SR_CLKUSABLE_Pos) /**< (SR) UTMI Clock Usable Mask */
-#define SR_Msk _U_(0x7010) /**< (SR) Register Mask */
-
-
-/* -------- SCR : (USBHS Offset: 0x808) (/W 32) General Status Clear Register -------- */
-
-#define SCR_OFFSET (0x808) /**< (SCR) General Status Clear Register Offset */
-
-#define SCR_RDERRIC_Pos 4 /**< (SCR) Remote Device Connection Error Interrupt Clear Position */
-#define SCR_RDERRIC (_U_(0x1) << SCR_RDERRIC_Pos) /**< (SCR) Remote Device Connection Error Interrupt Clear Mask */
-#define SCR_Msk _U_(0x10) /**< (SCR) Register Mask */
-
-
-/* -------- SFR : (USBHS Offset: 0x80c) (/W 32) General Status Set Register -------- */
-
-#define SFR_OFFSET (0x80C) /**< (SFR) General Status Set Register Offset */
-
-#define SFR_RDERRIS_Pos 4 /**< (SFR) Remote Device Connection Error Interrupt Set Position */
-#define SFR_RDERRIS (_U_(0x1) << SFR_RDERRIS_Pos) /**< (SFR) Remote Device Connection Error Interrupt Set Mask */
-#define SFR_VBUSRQS_Pos 9 /**< (SFR) VBUS Request Set Position */
-#define SFR_VBUSRQS (_U_(0x1) << SFR_VBUSRQS_Pos) /**< (SFR) VBUS Request Set Mask */
-#define SFR_Msk _U_(0x210) /**< (SFR) Register Mask */
-
-
-/** \brief DEVDMA hardware registers */
-typedef struct
-{
- __IO uint32_t DEVDMANXTDSC; /**< (DEVDMA Offset: 0x00) Device DMA Channel Next Descriptor Address Register */
- __IO uint32_t DEVDMAADDRESS; /**< (DEVDMA Offset: 0x04) Device DMA Channel Address Register */
- __IO uint32_t DEVDMACONTROL; /**< (DEVDMA Offset: 0x08) Device DMA Channel Control Register */
- __IO uint32_t DEVDMASTATUS; /**< (DEVDMA Offset: 0x0C) Device DMA Channel Status Register */
-} devdma_t;
-
-/** \brief HSTDMA hardware registers */
-typedef struct
-{
- __IO uint32_t HSTDMANXTDSC; /**< (HSTDMA Offset: 0x00) Host DMA Channel Next Descriptor Address Register */
- __IO uint32_t HSTDMAADDRESS; /**< (HSTDMA Offset: 0x04) Host DMA Channel Address Register */
- __IO uint32_t HSTDMACONTROL; /**< (HSTDMA Offset: 0x08) Host DMA Channel Control Register */
- __IO uint32_t HSTDMASTATUS; /**< (HSTDMA Offset: 0x0C) Host DMA Channel Status Register */
-} hstdma_t;
-
-/** \brief USBHS hardware registers */
-typedef struct
-{
- __IO uint32_t DEVCTRL; /**< (USBHS Offset: 0x00) Device General Control Register */
- __I uint32_t DEVISR; /**< (USBHS Offset: 0x04) Device Global Interrupt Status Register */
- __O uint32_t DEVICR; /**< (USBHS Offset: 0x08) Device Global Interrupt Clear Register */
- __O uint32_t DEVIFR; /**< (USBHS Offset: 0x0C) Device Global Interrupt Set Register */
- __I uint32_t DEVIMR; /**< (USBHS Offset: 0x10) Device Global Interrupt Mask Register */
- __O uint32_t DEVIDR; /**< (USBHS Offset: 0x14) Device Global Interrupt Disable Register */
- __O uint32_t DEVIER; /**< (USBHS Offset: 0x18) Device Global Interrupt Enable Register */
- __IO uint32_t DEVEPT; /**< (USBHS Offset: 0x1C) Device Endpoint Register */
- __I uint32_t DEVFNUM; /**< (USBHS Offset: 0x20) Device Frame Number Register */
- __I uint8_t Reserved1[220];
- __IO uint32_t DEVEPTCFG[10]; /**< (USBHS Offset: 0x100) Device Endpoint Configuration Register */
- __I uint8_t Reserved2[8];
- __I uint32_t DEVEPTISR[10]; /**< (USBHS Offset: 0x130) Device Endpoint Interrupt Status Register */
- __I uint8_t Reserved3[8];
- __O uint32_t DEVEPTICR[10]; /**< (USBHS Offset: 0x160) Device Endpoint Interrupt Clear Register */
- __I uint8_t Reserved4[8];
- __O uint32_t DEVEPTIFR[10]; /**< (USBHS Offset: 0x190) Device Endpoint Interrupt Set Register */
- __I uint8_t Reserved5[8];
- __I uint32_t DEVEPTIMR[10]; /**< (USBHS Offset: 0x1C0) Device Endpoint Interrupt Mask Register */
- __I uint8_t Reserved6[8];
- __O uint32_t DEVEPTIER[10]; /**< (USBHS Offset: 0x1F0) Device Endpoint Interrupt Enable Register */
- __I uint8_t Reserved7[8];
- __O uint32_t DEVEPTIDR[10]; /**< (USBHS Offset: 0x220) Device Endpoint Interrupt Disable Register */
- __I uint8_t Reserved8[200];
- devdma_t DEVDMA[7]; /**< Offset: 0x310 Device DMA Channel Next Descriptor Address Register */
- __I uint8_t Reserved9[128];
- __IO uint32_t HSTCTRL; /**< (USBHS Offset: 0x400) Host General Control Register */
- __I uint32_t HSTISR; /**< (USBHS Offset: 0x404) Host Global Interrupt Status Register */
- __O uint32_t HSTICR; /**< (USBHS Offset: 0x408) Host Global Interrupt Clear Register */
- __O uint32_t HSTIFR; /**< (USBHS Offset: 0x40C) Host Global Interrupt Set Register */
- __I uint32_t HSTIMR; /**< (USBHS Offset: 0x410) Host Global Interrupt Mask Register */
- __O uint32_t HSTIDR; /**< (USBHS Offset: 0x414) Host Global Interrupt Disable Register */
- __O uint32_t HSTIER; /**< (USBHS Offset: 0x418) Host Global Interrupt Enable Register */
- __IO uint32_t HSTPIP; /**< (USBHS Offset: 0x41C) Host Pipe Register */
- __IO uint32_t HSTFNUM; /**< (USBHS Offset: 0x420) Host Frame Number Register */
- __IO uint32_t HSTADDR1; /**< (USBHS Offset: 0x424) Host Address 1 Register */
- __IO uint32_t HSTADDR2; /**< (USBHS Offset: 0x428) Host Address 2 Register */
- __IO uint32_t HSTADDR3; /**< (USBHS Offset: 0x42C) Host Address 3 Register */
- __I uint8_t Reserved10[208];
- __IO uint32_t HSTPIPCFG[10]; /**< (USBHS Offset: 0x500) Host Pipe Configuration Register */
- __I uint8_t Reserved11[8];
- __I uint32_t HSTPIPISR[10]; /**< (USBHS Offset: 0x530) Host Pipe Status Register */
- __I uint8_t Reserved12[8];
- __O uint32_t HSTPIPICR[10]; /**< (USBHS Offset: 0x560) Host Pipe Clear Register */
- __I uint8_t Reserved13[8];
- __O uint32_t HSTPIPIFR[10]; /**< (USBHS Offset: 0x590) Host Pipe Set Register */
- __I uint8_t Reserved14[8];
- __I uint32_t HSTPIPIMR[10]; /**< (USBHS Offset: 0x5C0) Host Pipe Mask Register */
- __I uint8_t Reserved15[8];
- __O uint32_t HSTPIPIER[10]; /**< (USBHS Offset: 0x5F0) Host Pipe Enable Register */
- __I uint8_t Reserved16[8];
- __O uint32_t HSTPIPIDR[10]; /**< (USBHS Offset: 0x620) Host Pipe Disable Register */
- __I uint8_t Reserved17[8];
- __IO uint32_t HSTPIPINRQ[10]; /**< (USBHS Offset: 0x650) Host Pipe IN Request Register */
- __I uint8_t Reserved18[8];
- __IO uint32_t HSTPIPERR[10]; /**< (USBHS Offset: 0x680) Host Pipe Error Register */
- __I uint8_t Reserved19[104];
- hstdma_t HSTDMA[7]; /**< Offset: 0x710 Host DMA Channel Next Descriptor Address Register */
- __I uint8_t Reserved20[128];
- __IO uint32_t CTRL; /**< (USBHS Offset: 0x800) General Control Register */
- __I uint32_t SR; /**< (USBHS Offset: 0x804) General Status Register */
- __O uint32_t SCR; /**< (USBHS Offset: 0x808) General Status Clear Register */
- __O uint32_t SFR; /**< (USBHS Offset: 0x80C) General Status Set Register */
-} dcd_registers_t;
-
-#define USB_REG ((dcd_registers_t *)0x40038000U) /**< \brief (USBHS) Base Address */
-
-#define EP_MAX 10
-
-#define FIFO_RAM_ADDR 0xA0100000u
-
-// Errata: The DMA feature is not available for Pipe/Endpoint 7
-#define EP_DMA_SUPPORT(epnum) (epnum >= 1 && epnum <= 6)
-
-#else // TODO : SAM3U
-
-
-#endif
-
-#endif /* _COMMON_USB_REGS_H_ */
diff --git a/tinyusb/src/portable/microchip/samx7x/dcd_samx7x.c b/tinyusb/src/portable/microchip/samx7x/dcd_samx7x.c
deleted file mode 100755
index 0d9e184f..00000000
--- a/tinyusb/src/portable/microchip/samx7x/dcd_samx7x.c
+++ /dev/null
@@ -1,762 +0,0 @@
-/*
-* The MIT License (MIT)
-*
-* Copyright (c) 2018, hathach (tinyusb.org)
-* Copyright (c) 2021, HiFiPhile
-*
-* 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 file is part of the TinyUSB stack.
-*/
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_SAMX7X
-
-#include "device/dcd.h"
-#include "sam.h"
-#include "common_usb_regs.h"
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-// Since TinyUSB doesn't use SOF for now, and this interrupt too often (1ms interval)
-// We disable SOF for now until needed later on
-#ifndef USE_SOF
-# define USE_SOF 0
-#endif
-
-// Dual bank can imporve performance, but need 2 times bigger packet buffer
-// As SAM7x has only 4KB packet buffer, use with caution !
-// Enable in FS mode as packets are smaller
-#ifndef USE_DUAL_BANK
-# if TUD_OPT_HIGH_SPEED
-# define USE_DUAL_BANK 0
-# else
-# define USE_DUAL_BANK 1
-# endif
-#endif
-
-#define EP_GET_FIFO_PTR(ep, scale) (((TU_XSTRCAT(TU_STRCAT(uint, scale),_t) (*)[0x8000 / ((scale) / 8)])FIFO_RAM_ADDR)[(ep)])
-
-// DMA Channel Transfer Descriptor
-typedef struct {
- volatile uint32_t next_desc;
- volatile uint32_t buff_addr;
- volatile uint32_t chnl_ctrl;
- uint32_t padding;
-} dma_desc_t;
-
-// Transfer control context
-typedef struct {
- uint8_t * buffer;
- uint16_t total_len;
- uint16_t queued_len;
- uint16_t max_packet_size;
- uint8_t interval;
- tu_fifo_t * fifo;
-} xfer_ctl_t;
-
-static tusb_speed_t get_speed(void);
-static void dcd_transmit_packet(xfer_ctl_t * xfer, uint8_t ep_ix);
-
-// DMA descriptors shouldn't be placed in ITCM !
-CFG_TUSB_MEM_SECTION static dma_desc_t dma_desc[6];
-
-static xfer_ctl_t xfer_status[EP_MAX];
-
-static const tusb_desc_endpoint_t ep0_desc =
-{
- .bEndpointAddress = 0x00,
- .wMaxPacketSize = { .size = CFG_TUD_ENDPOINT0_SIZE },
-};
-
-TU_ATTR_ALWAYS_INLINE static inline void CleanInValidateCache(uint32_t *addr, int32_t size)
-{
- if (SCB->CCR & SCB_CCR_DC_Msk)
- {
- SCB_CleanInvalidateDCache_by_Addr(addr, size);
- }
- else
- {
- __DSB();
- __ISB();
- }
-}
-//------------------------------------------------------------------
-// Device API
-//------------------------------------------------------------------
-
-// Initialize controller to device mode
-void dcd_init (uint8_t rhport)
-{
- dcd_connect(rhport);
-}
-
-// Enable device interrupt
-void dcd_int_enable (uint8_t rhport)
-{
- (void) rhport;
- NVIC_EnableIRQ((IRQn_Type) ID_USBHS);
-}
-
-// Disable device interrupt
-void dcd_int_disable (uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ((IRQn_Type) ID_USBHS);
-}
-
-// Receive Set Address request, mcu port must also include status IN response
-void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
-{
- (void) dev_addr;
- // DCD can only set address after status for this request is complete
- // do it at dcd_edpt0_status_complete()
-
- // Response with zlp status
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-}
-
-// Wake up host
-void dcd_remote_wakeup (uint8_t rhport)
-{
- (void) rhport;
- USB_REG->DEVCTRL |= DEVCTRL_RMWKUP;
-}
-
-// Connect by enabling internal pull-up resistor on D+/D-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- dcd_int_disable(rhport);
- // Enable the USB controller in device mode
- USB_REG->CTRL = CTRL_UIMOD | CTRL_USBE;
- while (!(USB_REG->SR & SR_CLKUSABLE));
-#if TUD_OPT_HIGH_SPEED
- USB_REG->DEVCTRL &= ~DEVCTRL_SPDCONF;
-#else
- USB_REG->DEVCTRL |= DEVCTRL_SPDCONF_LOW_POWER;
-#endif
- // Enable the End Of Reset, Suspend & Wakeup interrupts
- USB_REG->DEVIER = (DEVIER_EORSTES | DEVIER_SUSPES | DEVIER_WAKEUPES);
-#if USE_SOF
- USB_REG->DEVIER = DEVIER_SOFES;
-#endif
- // Clear the End Of Reset, SOF & Wakeup interrupts
- USB_REG->DEVICR = (DEVICR_EORSTC | DEVICR_SOFC | DEVICR_WAKEUPC);
- // Manually set the Suspend Interrupt
- USB_REG->DEVIFR |= DEVIFR_SUSPS;
- // Ack the Wakeup Interrupt
- USB_REG->DEVICR = DEVICR_WAKEUPC;
- // Attach the device
- USB_REG->DEVCTRL &= ~DEVCTRL_DETACH;
- // Freeze USB clock
- USB_REG->CTRL |= CTRL_FRZCLK;
-}
-
-// Disconnect by disabling internal pull-up resistor on D+/D-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- dcd_int_disable(rhport);
- // Disable all endpoints
- USB_REG->DEVEPT &= ~(0x3FF << DEVEPT_EPEN0_Pos);
- // Unfreeze USB clock
- USB_REG->CTRL &= ~CTRL_FRZCLK;
- while (!(USB_REG->SR & SR_CLKUSABLE));
- // Clear all the pending interrupts
- USB_REG->DEVICR = DEVICR_Msk;
- // Disable all interrupts
- USB_REG->DEVIDR = DEVIDR_Msk;
- // Detach the device
- USB_REG->DEVCTRL |= DEVCTRL_DETACH;
- // Disable the device address
- USB_REG->DEVCTRL &=~(DEVCTRL_ADDEN | DEVCTRL_UADD);
-}
-
-static tusb_speed_t get_speed(void)
-{
- switch (USB_REG->SR & SR_SPEED) {
- case SR_SPEED_FULL_SPEED:
- default:
- return TUSB_SPEED_FULL;
- case SR_SPEED_HIGH_SPEED:
- return TUSB_SPEED_HIGH;
- case SR_SPEED_LOW_SPEED:
- return TUSB_SPEED_LOW;
- }
-}
-
-static void dcd_ep_handler(uint8_t ep_ix)
-{
- uint32_t int_status = USB_REG->DEVEPTISR[ep_ix];
- int_status &= USB_REG->DEVEPTIMR[ep_ix];
-
- uint16_t count = (USB_REG->DEVEPTISR[ep_ix] &
- DEVEPTISR_BYCT) >> DEVEPTISR_BYCT_Pos;
- xfer_ctl_t *xfer = &xfer_status[ep_ix];
-
- if (ep_ix == 0U)
- {
- static uint8_t ctrl_dir;
-
- if (int_status & DEVEPTISR_CTRL_RXSTPI)
- {
- ctrl_dir = (USB_REG->DEVEPTISR[0] & DEVEPTISR_CTRL_CTRLDIR) >> DEVEPTISR_CTRL_CTRLDIR_Pos;
- // Setup packet should always be 8 bytes. If not, ignore it, and try again.
- if (count == 8)
- {
- uint8_t *ptr = EP_GET_FIFO_PTR(0,8);
- dcd_event_setup_received(0, ptr, true);
- }
- // Ack and disable SETUP interrupt
- USB_REG->DEVEPTICR[0] = DEVEPTICR_CTRL_RXSTPIC;
- USB_REG->DEVEPTIDR[0] = DEVEPTIDR_CTRL_RXSTPEC;
- }
- if (int_status & DEVEPTISR_RXOUTI)
- {
- uint8_t *ptr = EP_GET_FIFO_PTR(0,8);
-
- if (count && xfer->total_len)
- {
- uint16_t remain = xfer->total_len - xfer->queued_len;
- if (count > remain)
- {
- count = remain;
- }
- if (xfer->buffer)
- {
- memcpy(xfer->buffer + xfer->queued_len, ptr, count);
- } else
- {
- tu_fifo_write_n(xfer->fifo, ptr, count);
- }
- xfer->queued_len = (uint16_t)(xfer->queued_len + count);
- }
- // Acknowledge the interrupt
- USB_REG->DEVEPTICR[0] = DEVEPTICR_RXOUTIC;
- if ((count < xfer->max_packet_size) || (xfer->queued_len == xfer->total_len))
- {
- // RX COMPLETE
- dcd_event_xfer_complete(0, 0, xfer->queued_len, XFER_RESULT_SUCCESS, true);
- // Disable the interrupt
- USB_REG->DEVEPTIDR[0] = DEVEPTIDR_RXOUTEC;
- // Re-enable SETUP interrupt
- if (ctrl_dir == 1)
- {
- USB_REG->DEVEPTIER[0] = DEVEPTIER_CTRL_RXSTPES;
- }
- }
- }
- if (int_status & DEVEPTISR_TXINI)
- {
- // Disable the interrupt
- USB_REG->DEVEPTIDR[0] = DEVEPTIDR_TXINEC;
- if ((xfer->total_len != xfer->queued_len))
- {
- // TX not complete
- dcd_transmit_packet(xfer, 0);
- } else
- {
- // TX complete
- dcd_event_xfer_complete(0, 0x80 + 0, xfer->total_len, XFER_RESULT_SUCCESS, true);
- // Re-enable SETUP interrupt
- if (ctrl_dir == 0)
- {
- USB_REG->DEVEPTIER[0] = DEVEPTIER_CTRL_RXSTPES;
- }
- }
- }
- } else
- {
- if (int_status & DEVEPTISR_RXOUTI)
- {
- if (count && xfer->total_len)
- {
- uint16_t remain = xfer->total_len - xfer->queued_len;
- if (count > remain)
- {
- count = remain;
- }
- uint8_t *ptr = EP_GET_FIFO_PTR(ep_ix,8);
- if (xfer->buffer)
- {
- memcpy(xfer->buffer + xfer->queued_len, ptr, count);
- } else {
- tu_fifo_write_n(xfer->fifo, ptr, count);
- }
- xfer->queued_len = (uint16_t)(xfer->queued_len + count);
- }
- // Clear the FIFO control flag to receive more data.
- USB_REG->DEVEPTIDR[ep_ix] = DEVEPTIDR_FIFOCONC;
- // Acknowledge the interrupt
- USB_REG->DEVEPTICR[ep_ix] = DEVEPTICR_RXOUTIC;
- if ((count < xfer->max_packet_size) || (xfer->queued_len == xfer->total_len))
- {
- // RX COMPLETE
- dcd_event_xfer_complete(0, ep_ix, xfer->queued_len, XFER_RESULT_SUCCESS, true);
- // Disable the interrupt
- USB_REG->DEVEPTIDR[ep_ix] = DEVEPTIDR_RXOUTEC;
- // Though the host could still send, we don't know.
- }
- }
- if (int_status & DEVEPTISR_TXINI)
- {
- // Acknowledge the interrupt
- USB_REG->DEVEPTICR[ep_ix] = DEVEPTICR_TXINIC;
- if ((xfer->total_len != xfer->queued_len))
- {
- // TX not complete
- dcd_transmit_packet(xfer, ep_ix);
- } else
- {
- // TX complete
- dcd_event_xfer_complete(0, 0x80 + ep_ix, xfer->total_len, XFER_RESULT_SUCCESS, true);
- // Disable the interrupt
- USB_REG->DEVEPTIDR[ep_ix] = DEVEPTIDR_TXINEC;
- }
- }
- }
-}
-
-static void dcd_dma_handler(uint8_t ep_ix)
-{
- uint32_t status = USB_REG->DEVDMA[ep_ix - 1].DEVDMASTATUS;
- if (status & DEVDMASTATUS_CHANN_ENB)
- {
- return; // Ignore EOT_STA interrupt
- }
- // Disable DMA interrupt
- USB_REG->DEVIDR = DEVIDR_DMA_1 << (ep_ix - 1);
-
- xfer_ctl_t *xfer = &xfer_status[ep_ix];
- uint16_t count = xfer->total_len - ((status & DEVDMASTATUS_BUFF_COUNT) >> DEVDMASTATUS_BUFF_COUNT_Pos);
- if(USB_REG->DEVEPTCFG[ep_ix] & DEVEPTCFG_EPDIR)
- {
- dcd_event_xfer_complete(0, 0x80 + ep_ix, count, XFER_RESULT_SUCCESS, true);
- } else
- {
- dcd_event_xfer_complete(0, ep_ix, count, XFER_RESULT_SUCCESS, true);
- }
-}
-
-void dcd_int_handler(uint8_t rhport)
-{
- (void) rhport;
- uint32_t int_status = USB_REG->DEVISR;
- int_status &= USB_REG->DEVIMR;
- // End of reset interrupt
- if (int_status & DEVISR_EORST)
- {
- // Unfreeze USB clock
- USB_REG->CTRL &= ~CTRL_FRZCLK;
- while(!(USB_REG->SR & SR_CLKUSABLE));
- // Reset all endpoints
- for (int ep_ix = 1; ep_ix < EP_MAX; ep_ix++)
- {
- USB_REG->DEVEPT |= 1 << (DEVEPT_EPRST0_Pos + ep_ix);
- USB_REG->DEVEPT &=~(1 << (DEVEPT_EPRST0_Pos + ep_ix));
- }
- dcd_edpt_open (0, &ep0_desc);
- USB_REG->DEVICR = DEVICR_EORSTC;
- USB_REG->DEVICR = DEVICR_WAKEUPC;
- USB_REG->DEVICR = DEVICR_SUSPC;
- USB_REG->DEVIER = DEVIER_SUSPES;
-
- dcd_event_bus_reset(rhport, get_speed(), true);
- }
- // End of Wakeup interrupt
- if (int_status & DEVISR_WAKEUP)
- {
- USB_REG->CTRL &= ~CTRL_FRZCLK;
- while (!(USB_REG->SR & SR_CLKUSABLE));
- USB_REG->DEVICR = DEVICR_WAKEUPC;
- USB_REG->DEVIDR = DEVIDR_WAKEUPEC;
- USB_REG->DEVIER = DEVIER_SUSPES;
-
- dcd_event_bus_signal(0, DCD_EVENT_RESUME, true);
- }
- // Suspend interrupt
- if (int_status & DEVISR_SUSP)
- {
- // Unfreeze USB clock
- USB_REG->CTRL &= ~CTRL_FRZCLK;
- while (!(USB_REG->SR & SR_CLKUSABLE));
- USB_REG->DEVICR = DEVICR_SUSPC;
- USB_REG->DEVIDR = DEVIDR_SUSPEC;
- USB_REG->DEVIER = DEVIER_WAKEUPES;
- USB_REG->CTRL |= CTRL_FRZCLK;
-
- dcd_event_bus_signal(0, DCD_EVENT_SUSPEND, true);
- }
-#if USE_SOF
- if(int_status & DEVISR_SOF)
- {
- USB_REG->DEVICR = DEVICR_SOFC;
-
- dcd_event_bus_signal(0, DCD_EVENT_SOF, true);
- }
-#endif
- // Endpoints interrupt
- for (int ep_ix = 0; ep_ix < EP_MAX; ep_ix++)
- {
- if (int_status & (DEVISR_PEP_0 << ep_ix))
- {
- dcd_ep_handler(ep_ix);
- }
- }
- // Endpoints DMA interrupt
- for (int ep_ix = 0; ep_ix < EP_MAX; ep_ix++)
- {
- if (EP_DMA_SUPPORT(ep_ix))
- {
- if (int_status & (DEVISR_DMA_1 << (ep_ix - 1)))
- {
- dcd_dma_handler(ep_ix);
- }
- }
- }
-}
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-// Invoked when a control transfer's status stage is complete.
-// May help DCD to prepare for next control transfer, this API is optional.
-void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * request)
-{
- (void) rhport;
-
- if (request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_DEVICE &&
- request->bmRequestType_bit.type == TUSB_REQ_TYPE_STANDARD &&
- request->bRequest == TUSB_REQ_SET_ADDRESS )
- {
- uint8_t const dev_addr = (uint8_t) request->wValue;
-
- USB_REG->DEVCTRL |= dev_addr | DEVCTRL_ADDEN;
- }
-}
-
-// Configure endpoint's registers according to descriptor
-bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * ep_desc)
-{
- (void) rhport;
- uint8_t const epnum = tu_edpt_number(ep_desc->bEndpointAddress);
- uint8_t const dir = tu_edpt_dir(ep_desc->bEndpointAddress);
- uint16_t const epMaxPktSize = ep_desc->wMaxPacketSize.size;
- tusb_xfer_type_t const eptype = (tusb_xfer_type_t)ep_desc->bmAttributes.xfer;
- uint8_t fifoSize = 0; // FIFO size
- uint16_t defaultEndpointSize = 8; // Default size of Endpoint
- // Find upper 2 power number of epMaxPktSize
- if (epMaxPktSize)
- {
- while (defaultEndpointSize < epMaxPktSize)
- {
- fifoSize++;
- defaultEndpointSize <<= 1;
- }
- }
- xfer_status[epnum].max_packet_size = epMaxPktSize;
-
- USB_REG->DEVEPT |= 1 << (DEVEPT_EPRST0_Pos + epnum);
- USB_REG->DEVEPT &=~(1 << (DEVEPT_EPRST0_Pos + epnum));
-
- if (epnum == 0)
- {
- // Enable the control endpoint - Endpoint 0
- USB_REG->DEVEPT |= DEVEPT_EPEN0;
- // Configure the Endpoint 0 configuration register
- USB_REG->DEVEPTCFG[0] =
- (
- (fifoSize << DEVEPTCFG_EPSIZE_Pos) |
- (TUSB_XFER_CONTROL << DEVEPTCFG_EPTYPE_Pos) |
- (DEVEPTCFG_EPBK_1_BANK << DEVEPTCFG_EPBK_Pos) |
- DEVEPTCFG_ALLOC
- );
- USB_REG->DEVEPTIER[0] = DEVEPTIER_RSTDTS;
- USB_REG->DEVEPTIDR[0] = DEVEPTIDR_CTRL_STALLRQC;
- if (DEVEPTISR_CFGOK == (USB_REG->DEVEPTISR[0] & DEVEPTISR_CFGOK))
- {
- // Endpoint configuration is successful
- USB_REG->DEVEPTIER[0] = DEVEPTIER_CTRL_RXSTPES;
- // Enable Endpoint 0 Interrupts
- USB_REG->DEVIER = DEVIER_PEP_0;
- return true;
- } else
- {
- // Endpoint configuration is not successful
- return false;
- }
- } else
- {
- // Enable the endpoint
- USB_REG->DEVEPT |= ((0x01 << epnum) << DEVEPT_EPEN0_Pos);
- // Set up the maxpacket size, fifo start address fifosize
- // and enable the interrupt. CLear the data toggle.
- // AUTOSW is needed for DMA ack !
- USB_REG->DEVEPTCFG[epnum] =
- (
- (fifoSize << DEVEPTCFG_EPSIZE_Pos) |
- (eptype << DEVEPTCFG_EPTYPE_Pos) |
- (DEVEPTCFG_EPBK_1_BANK << DEVEPTCFG_EPBK_Pos) |
- DEVEPTCFG_AUTOSW |
- ((dir & 0x01) << DEVEPTCFG_EPDIR_Pos)
- );
- if (eptype == TUSB_XFER_ISOCHRONOUS)
- {
- USB_REG->DEVEPTCFG[epnum] |= DEVEPTCFG_NBTRANS_1_TRANS;
- }
-#if USE_DUAL_BANK
- if (eptype == TUSB_XFER_ISOCHRONOUS || eptype == TUSB_XFER_BULK)
- {
- USB_REG->DEVEPTCFG[epnum] |= DEVEPTCFG_EPBK_2_BANK;
- }
-#endif
- USB_REG->DEVEPTCFG[epnum] |= DEVEPTCFG_ALLOC;
- USB_REG->DEVEPTIER[epnum] = DEVEPTIER_RSTDTS;
- USB_REG->DEVEPTIDR[epnum] = DEVEPTIDR_CTRL_STALLRQC;
- if (DEVEPTISR_CFGOK == (USB_REG->DEVEPTISR[epnum] & DEVEPTISR_CFGOK))
- {
- USB_REG->DEVIER = ((0x01 << epnum) << DEVIER_PEP_0_Pos);
- return true;
- } else
- {
- // Endpoint configuration is not successful
- return false;
- }
- }
-}
-
-void dcd_edpt_close(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- uint8_t const epnum = tu_edpt_number(ep_addr);
-
- // Disable endpoint interrupt
- USB_REG->DEVIDR = 1 << (DEVIDR_PEP_0_Pos + epnum);
- // Disable EP
- USB_REG->DEVEPT &=~(1 << (DEVEPT_EPEN0_Pos + epnum));
-}
-
-static void dcd_transmit_packet(xfer_ctl_t * xfer, uint8_t ep_ix)
-{
- uint16_t len = (uint16_t)(xfer->total_len - xfer->queued_len);
- if (len)
- {
- if (len > xfer->max_packet_size)
- {
- len = xfer->max_packet_size;
- }
- uint8_t *ptr = EP_GET_FIFO_PTR(ep_ix,8);
- if(xfer->buffer)
- {
- memcpy(ptr, xfer->buffer + xfer->queued_len, len);
- }
- else
- {
- tu_fifo_read_n(xfer->fifo, ptr, len);
- }
- __DSB();
- __ISB();
- xfer->queued_len = (uint16_t)(xfer->queued_len + len);
- }
- if (ep_ix == 0U)
- {
- // Control endpoint: clear the interrupt flag to send the data
- USB_REG->DEVEPTICR[0] = DEVEPTICR_TXINIC;
- } else
- {
- // Other endpoint types: clear the FIFO control flag to send the data
- USB_REG->DEVEPTIDR[ep_ix] = DEVEPTIDR_FIFOCONC;
- }
- USB_REG->DEVEPTIER[ep_ix] = DEVEPTIER_TXINES;
-}
-
-// Submit a transfer, When complete dcd_event_xfer_complete() is invoked to notify the stack
-bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- (void) rhport;
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_ctl_t * xfer = &xfer_status[epnum];
-
- xfer->buffer = buffer;
- xfer->total_len = total_bytes;
- xfer->queued_len = 0;
- xfer->fifo = NULL;
-
- if (EP_DMA_SUPPORT(epnum) && total_bytes != 0)
- {
- // Force the CPU to flush the buffer. We increase the size by 32 because the call aligns the
- // address to 32-byte boundaries.
- CleanInValidateCache((uint32_t*) tu_align((uint32_t) buffer, 4), total_bytes + 31);
- uint32_t udd_dma_ctrl = total_bytes << DEVDMACONTROL_BUFF_LENGTH_Pos;
- if (dir == TUSB_DIR_OUT)
- {
- udd_dma_ctrl |= DEVDMACONTROL_END_TR_IT | DEVDMACONTROL_END_TR_EN;
- } else {
- udd_dma_ctrl |= DEVDMACONTROL_END_B_EN;
- }
- USB_REG->DEVDMA[epnum - 1].DEVDMAADDRESS = (uint32_t)buffer;
- udd_dma_ctrl |= DEVDMACONTROL_END_BUFFIT | DEVDMACONTROL_CHANN_ENB;
- // Disable IRQs to have a short sequence
- // between read of EOT_STA and DMA enable
- uint32_t irq_state = __get_PRIMASK();
- __disable_irq();
- if (!(USB_REG->DEVDMA[epnum - 1].DEVDMASTATUS & DEVDMASTATUS_END_TR_ST))
- {
- USB_REG->DEVDMA[epnum - 1].DEVDMACONTROL = udd_dma_ctrl;
- USB_REG->DEVIER = DEVIER_DMA_1 << (epnum - 1);
- __set_PRIMASK(irq_state);
- return true;
- }
- __set_PRIMASK(irq_state);
-
- // Here a ZLP has been recieved
- // and the DMA transfer must be not started.
- // It is the end of transfer
- return false;
- } else
- {
- if (dir == TUSB_DIR_OUT)
- {
- USB_REG->DEVEPTIER[epnum] = DEVEPTIER_RXOUTES;
- } else
- {
- dcd_transmit_packet(xfer,epnum);
- }
- }
- return true;
-}
-
-// The number of bytes has to be given explicitly to allow more flexible control of how many
-// bytes should be written and second to keep the return value free to give back a boolean
-// success message. If total_bytes is too big, the FIFO will copy only what is available
-// into the USB buffer!
-bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
-{
- (void) rhport;
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_ctl_t * xfer = &xfer_status[epnum];
- if(epnum == 0x80)
- xfer = &xfer_status[EP_MAX];
-
- xfer->buffer = NULL;
- xfer->total_len = total_bytes;
- xfer->queued_len = 0;
- xfer->fifo = ff;
-
- if (EP_DMA_SUPPORT(epnum) && total_bytes != 0)
- {
- tu_fifo_buffer_info_t info;
- uint32_t udd_dma_ctrl_lin = DEVDMACONTROL_CHANN_ENB;
- uint32_t udd_dma_ctrl_wrap = DEVDMACONTROL_CHANN_ENB | DEVDMACONTROL_END_BUFFIT;
- if (dir == TUSB_DIR_OUT)
- {
- tu_fifo_get_write_info(ff, &info);
- udd_dma_ctrl_lin |= DEVDMACONTROL_END_TR_IT | DEVDMACONTROL_END_TR_EN;
- udd_dma_ctrl_wrap |= DEVDMACONTROL_END_TR_IT | DEVDMACONTROL_END_TR_EN;
- } else {
- tu_fifo_get_read_info(ff, &info);
- if(info.len_wrap == 0)
- {
- udd_dma_ctrl_lin |= DEVDMACONTROL_END_B_EN;
- }
- udd_dma_ctrl_wrap |= DEVDMACONTROL_END_B_EN;
- }
-
- // Clean invalidate cache of linear part
- CleanInValidateCache((uint32_t*) tu_align((uint32_t) info.ptr_lin, 4), info.len_lin + 31);
-
- USB_REG->DEVDMA[epnum - 1].DEVDMAADDRESS = (uint32_t)info.ptr_lin;
- if (info.len_wrap)
- {
- // Clean invalidate cache of wrapped part
- CleanInValidateCache((uint32_t*) tu_align((uint32_t) info.ptr_wrap, 4), info.len_wrap + 31);
-
- dma_desc[epnum - 1].next_desc = 0;
- dma_desc[epnum - 1].buff_addr = (uint32_t)info.ptr_wrap;
- dma_desc[epnum - 1].chnl_ctrl =
- udd_dma_ctrl_wrap | (info.len_wrap << DEVDMACONTROL_BUFF_LENGTH_Pos);
- // Clean cache of wrapped DMA descriptor
- CleanInValidateCache((uint32_t*)&dma_desc[epnum - 1], sizeof(dma_desc_t));
-
- udd_dma_ctrl_lin |= DEVDMASTATUS_DESC_LDST;
- USB_REG->DEVDMA[epnum - 1].DEVDMANXTDSC = (uint32_t)&dma_desc[epnum - 1];
- } else {
- udd_dma_ctrl_lin |= DEVDMACONTROL_END_BUFFIT;
- }
- udd_dma_ctrl_lin |= (info.len_lin << DEVDMACONTROL_BUFF_LENGTH_Pos);
- // Disable IRQs to have a short sequence
- // between read of EOT_STA and DMA enable
- uint32_t irq_state = __get_PRIMASK();
- __disable_irq();
- if (!(USB_REG->DEVDMA[epnum - 1].DEVDMASTATUS & DEVDMASTATUS_END_TR_ST))
- {
- USB_REG->DEVDMA[epnum - 1].DEVDMACONTROL = udd_dma_ctrl_lin;
- USB_REG->DEVIER = DEVIER_DMA_1 << (epnum - 1);
- __set_PRIMASK(irq_state);
- return true;
- }
- __set_PRIMASK(irq_state);
-
- // Here a ZLP has been recieved
- // and the DMA transfer must be not started.
- // It is the end of transfer
- return false;
- } else
- {
- if (dir == TUSB_DIR_OUT)
- {
- USB_REG->DEVEPTIER[epnum] = DEVEPTIER_RXOUTES;
- } else
- {
- dcd_transmit_packet(xfer,epnum);
- }
- }
- return true;
-}
-
-// Stall endpoint
-void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- uint8_t const epnum = tu_edpt_number(ep_addr);
- USB_REG->DEVEPTIER[epnum] = DEVEPTIER_CTRL_STALLRQS;
- // Re-enable SETUP interrupt
- if (epnum == 0)
- {
- USB_REG->DEVEPTIER[0] = DEVEPTIER_CTRL_RXSTPES;
- }
-}
-
-// clear stall, data toggle is also reset to DATA0
-void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- uint8_t const epnum = tu_edpt_number(ep_addr);
- USB_REG->DEVEPTIDR[epnum] = DEVEPTIDR_CTRL_STALLRQC;
- USB_REG->DEVEPTIER[epnum] = HSTPIPIER_RSTDTS;
-}
-
-#endif
diff --git a/tinyusb/src/portable/mindmotion/mm32/dcd_mm32f327x_otg.c b/tinyusb/src/portable/mindmotion/mm32/dcd_mm32f327x_otg.c
deleted file mode 100755
index 59a40dc6..00000000
--- a/tinyusb/src/portable/mindmotion/mm32/dcd_mm32f327x_otg.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 SE TEAM
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_MM32F327X )
-
-#include "reg_usb_otg_fs.h"
-#include "mm32_device.h"
-#include "hal_conf.h"
-#include "device/dcd.h"
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-enum {
- TOK_PID_OUT = 0x1u,
- TOK_PID_IN = 0x9u,
- TOK_PID_SETUP = 0xDu,
-};
-
-typedef struct TU_ATTR_PACKED
-{
- union {
- uint32_t head;
- struct {
- union {
- struct {
- uint16_t : 2;
- uint16_t tok_pid : 4;
- uint16_t data : 1;
- uint16_t own : 1;
- uint16_t : 8;
- };
- struct {
- uint16_t : 2;
- uint16_t bdt_stall: 1;
- uint16_t dts : 1;
- uint16_t ninc : 1;
- uint16_t keep : 1;
- uint16_t : 10;
- };
- };
- uint16_t bc : 10;
- uint16_t : 6;
- };
- };
- uint8_t *addr;
-}buffer_descriptor_t;
-
-TU_VERIFY_STATIC( sizeof(buffer_descriptor_t) == 8, "size is not correct" );
-
-typedef struct TU_ATTR_PACKED
-{
- union {
- uint32_t state;
- struct {
- uint32_t max_packet_size :11;
- uint32_t : 5;
- uint32_t odd : 1;
- uint32_t :15;
- };
- };
- uint16_t length;
- uint16_t remaining;
-}endpoint_state_t;
-
-TU_VERIFY_STATIC( sizeof(endpoint_state_t) == 8, "size is not correct" );
-
-typedef struct
-{
- union {
- /* [#EP][OUT,IN][EVEN,ODD] */
- buffer_descriptor_t bdt[16][2][2];
- uint16_t bda[512];
- };
- TU_ATTR_ALIGNED(4) union {
- endpoint_state_t endpoint[16][2];
- endpoint_state_t endpoint_unified[16 * 2];
- };
- uint8_t setup_packet[8];
- uint8_t addr;
-}dcd_data_t;
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-// BDT(Buffer Descriptor Table) must be 256-byte aligned
-CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(512) static dcd_data_t _dcd;
-
-TU_VERIFY_STATIC( sizeof(_dcd.bdt) == 512, "size is not correct" );
-
-static void prepare_next_setup_packet(uint8_t rhport)
-{
- const unsigned out_odd = _dcd.endpoint[0][0].odd;
- const unsigned in_odd = _dcd.endpoint[0][1].odd;
- if (_dcd.bdt[0][0][out_odd].own) {
- TU_LOG1("DCD fail to prepare the next SETUP %d %d\r\n", out_odd, in_odd);
- return;
- }
- _dcd.bdt[0][0][out_odd].data = 0;
- _dcd.bdt[0][0][out_odd ^ 1].data = 1;
- _dcd.bdt[0][1][in_odd].data = 1;
- _dcd.bdt[0][1][in_odd ^ 1].data = 0;
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_OUT),
- _dcd.setup_packet, sizeof(_dcd.setup_packet));
-}
-
-static void process_stall(uint8_t rhport)
-{
- if (USB_OTG_FS->EP_CTL[0] & USB_ENDPT_EPSTALL_MASK) {
- /* clear stall condition of the control pipe */
- prepare_next_setup_packet(rhport);
- USB_OTG_FS->EP_CTL[0] &= ~USB_ENDPT_EPSTALL_MASK;
- }
-}
-
-static void process_tokdne(uint8_t rhport)
-{
- const unsigned s = USB_OTG_FS->STAT;
- USB_OTG_FS->INT_STAT = USB_ISTAT_TOKDNE_MASK; /* fetch the next token if received */
- buffer_descriptor_t *bd = (buffer_descriptor_t *)&_dcd.bda[s];
- endpoint_state_t *ep = &_dcd.endpoint_unified[s >> 3];
- unsigned odd = (s & USB_STAT_ODD_MASK) ? 1 : 0;
-
- /* fetch pid before discarded by the next steps */
- const unsigned pid = bd->tok_pid;
- /* reset values for a next transfer */
- bd->bdt_stall = 0;
- bd->dts = 1;
- bd->ninc = 0;
- bd->keep = 0;
- /* update the odd variable to prepare for the next transfer */
- ep->odd = odd ^ 1;
- if (pid == TOK_PID_SETUP) {
- dcd_event_setup_received(rhport, bd->addr, true);
- USB_OTG_FS->CTL &= ~USB_CTL_TXSUSPENDTOKENBUSY_MASK;
- return;
- }
- if (s >> 4) {
- TU_LOG1("TKDNE %x\r\n", s);
- }
-
- const unsigned bc = bd->bc;
- const unsigned remaining = ep->remaining - bc;
- if (remaining && bc == ep->max_packet_size) {
- /* continue the transferring consecutive data */
- ep->remaining = remaining;
- const int next_remaining = remaining - ep->max_packet_size;
- if (next_remaining > 0) {
- /* prepare to the after next transfer */
- bd->addr += ep->max_packet_size * 2;
- bd->bc = next_remaining > ep->max_packet_size ? ep->max_packet_size: next_remaining;
- __DSB();
- bd->own = 1; /* the own bit must set after addr */
- }
- return;
- }
- const unsigned length = ep->length;
- dcd_event_xfer_complete(rhport,
- ((s & USB_STAT_TX_MASK) << 4) | (s >> USB_STAT_ENDP_SHIFT),
- length - remaining, XFER_RESULT_SUCCESS, true);
- if (0 == (s & USB_STAT_ENDP_MASK) && 0 == length) {
- /* After completion a ZLP of control transfer,
- * it prepares for the next steup transfer. */
- if (_dcd.addr) {
- /* When the transfer was the SetAddress,
- * the device address should be updated here. */
- USB_OTG_FS->ADDR = _dcd.addr;
- _dcd.addr = 0;
- }
- prepare_next_setup_packet(rhport);
- }
-}
-
-static void process_bus_reset(uint8_t rhport)
-{
- USB_OTG_FS->CTL |= USB_CTL_ODDRST_MASK;
- USB_OTG_FS->ADDR = 0;
- USB_OTG_FS->INT_ENB = (USB_OTG_FS->INT_ENB & ~USB_INTEN_RESUMEEN_MASK) | USB_INTEN_SLEEPEN_MASK;
-
- USB_OTG_FS->EP_CTL[0] = USB_ENDPT_EPHSHK_MASK | USB_ENDPT_EPRXEN_MASK | USB_ENDPT_EPTXEN_MASK;
- for (unsigned i = 1; i < 16; ++i) {
- USB_OTG_FS->EP_CTL[i] = 0;
- }
- buffer_descriptor_t *bd = _dcd.bdt[0][0];
- for (unsigned i = 0; i < sizeof(_dcd.bdt)/sizeof(*bd); ++i, ++bd) {
- bd->head = 0;
- }
- const endpoint_state_t ep0 = {
- .max_packet_size = CFG_TUD_ENDPOINT0_SIZE,
- .odd = 0,
- .length = 0,
- .remaining = 0,
- };
- _dcd.endpoint[0][0] = ep0;
- _dcd.endpoint[0][1] = ep0;
- tu_memclr(_dcd.endpoint[1], sizeof(_dcd.endpoint) - sizeof(_dcd.endpoint[0]));
- _dcd.addr = 0;
- prepare_next_setup_packet(rhport);
- USB_OTG_FS->CTL &= ~USB_CTL_ODDRST_MASK;
- dcd_event_bus_reset(rhport, TUSB_SPEED_FULL, true);
-}
-
-static void process_bus_inactive(uint8_t rhport)
-{
- (void) rhport;
- const unsigned inten = USB_OTG_FS->INT_ENB;
- USB_OTG_FS->INT_ENB = (inten & ~USB_INTEN_SLEEPEN_MASK) | USB_INTEN_RESUMEEN_MASK;
- dcd_event_bus_signal(rhport, DCD_EVENT_SUSPEND, true);
-}
-
-static void process_bus_active(uint8_t rhport)
-{
- (void) rhport;
- const unsigned inten = USB_OTG_FS->INT_ENB;
- USB_OTG_FS->INT_ENB = (inten & ~USB_INTEN_RESUMEEN_MASK) | USB_INTEN_SLEEPEN_MASK;
- dcd_event_bus_signal(rhport, DCD_EVENT_RESUME, true);
-}
-
-/*------------------------------------------------------------------*/
-/* Device API
- *------------------------------------------------------------------*/
-void dcd_init(uint8_t rhport)
-{
- (void) rhport;
-
- tu_memclr(&_dcd, sizeof(_dcd));
- USB_OTG_FS->BDT_PAGE_01 = (uint8_t)((uintptr_t)_dcd.bdt >> 8);
- USB_OTG_FS->BDT_PAGE_02 = (uint8_t)((uintptr_t)_dcd.bdt >> 16);
- USB_OTG_FS->BDT_PAGE_03 = (uint8_t)((uintptr_t)_dcd.bdt >> 24);
-
- dcd_connect(rhport);
- NVIC_ClearPendingIRQ(USB_FS_IRQn);
-}
-#define USB_DEVICE_INTERRUPT_PRIORITY (3U)
-void dcd_int_enable(uint8_t rhport)
-{
- uint8_t irqNumber;
- irqNumber = USB_FS_IRQn;
- (void) rhport;
- USB_OTG_FS->INT_ENB = USB_INTEN_USBRSTEN_MASK | USB_INTEN_TOKDNEEN_MASK |
- USB_INTEN_SLEEPEN_MASK | USB_INTEN_ERROREN_MASK | USB_INTEN_STALLEN_MASK;
- NVIC_SetPriority((IRQn_Type)irqNumber, USB_DEVICE_INTERRUPT_PRIORITY);
- NVIC_EnableIRQ(USB_FS_IRQn);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ(USB_FS_IRQn);
- USB_OTG_FS->INT_ENB = 0;
-}
-
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
- _dcd.addr = dev_addr & 0x7F;
- /* Response with status first before changing device address */
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-}
-extern u32 SystemCoreClock ;
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
- unsigned cnt = SystemCoreClock / 100;
- USB_OTG_FS->CTL |= USB_CTL_RESUME_MASK;
- while (cnt--) __NOP();
- USB_OTG_FS->CTL &= ~USB_CTL_RESUME_MASK;
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- USB_OTG_FS->CTL |= USB_CTL_USBENSOFEN_MASK;
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- USB_OTG_FS->CTL = 0;
-}
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * ep_desc)
-{
- (void) rhport;
-
- const unsigned ep_addr = ep_desc->bEndpointAddress;
- const unsigned epn = ep_addr & 0xFu;
- const unsigned dir = (ep_addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT;
- const unsigned xfer = ep_desc->bmAttributes.xfer;
- endpoint_state_t *ep = &_dcd.endpoint[epn][dir];
- const unsigned odd = ep->odd;
- buffer_descriptor_t *bd = &_dcd.bdt[epn][dir][0];
-
- /* No support for control transfer */
- TU_ASSERT(epn && (xfer != TUSB_XFER_CONTROL));
-
- ep->max_packet_size = ep_desc->wMaxPacketSize.size;
- unsigned val = USB_ENDPT_EPCTLDIS_MASK;
- val |= (xfer != TUSB_XFER_ISOCHRONOUS) ? USB_ENDPT_EPHSHK_MASK: 0;
- val |= dir ? USB_ENDPT_EPTXEN_MASK : USB_ENDPT_EPRXEN_MASK;
- USB_OTG_FS->EP_CTL[epn] |= val;
-
- if (xfer != TUSB_XFER_ISOCHRONOUS) {
- bd[odd].dts = 1;
- bd[odd].data = 0;
- bd[odd ^ 1].dts = 1;
- bd[odd ^ 1].data = 1;
- }
-
- return true;
-}
-
-void dcd_edpt_close(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- const unsigned epn = ep_addr & 0xFu;
- const unsigned dir = (ep_addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT;
- endpoint_state_t *ep = &_dcd.endpoint[epn][dir];
- buffer_descriptor_t *bd = &_dcd.bdt[epn][dir][0];
- const unsigned msk = dir ? USB_ENDPT_EPTXEN_MASK : USB_ENDPT_EPRXEN_MASK;
- USB_OTG_FS->EP_CTL[epn] &= ~msk;
- ep->max_packet_size = 0;
- ep->length = 0;
- ep->remaining = 0;
- bd->head = 0;
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t* buffer, uint16_t total_bytes)
-{
- (void) rhport;
- NVIC_DisableIRQ(USB_FS_IRQn);
- const unsigned epn = ep_addr & 0xFu;
- const unsigned dir = (ep_addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT;
- endpoint_state_t *ep = &_dcd.endpoint[epn][dir];
- buffer_descriptor_t *bd = &_dcd.bdt[epn][dir][ep->odd];
-
- if (bd->own) {
- TU_LOG1("DCD XFER fail %x %d %lx %lx\r\n", ep_addr, total_bytes, ep->state, bd->head);
- return false; /* The last transfer has not completed */
- }
- ep->length = total_bytes;
- ep->remaining = total_bytes;
-
- const unsigned mps = ep->max_packet_size;
- if (total_bytes > mps) {
- buffer_descriptor_t *next = ep->odd ? bd - 1: bd + 1;
- /* When total_bytes is greater than the max packet size,
- * it prepares to the next transfer to avoid NAK in advance. */
- next->bc = total_bytes >= 2 * mps ? mps: total_bytes - mps;
- next->addr = buffer + mps;
- next->own = 1;
- }
- bd->bc = total_bytes >= mps ? mps: total_bytes;
- bd->addr = buffer;
- __DSB();
- bd->own = 1; /* the own bit must set after addr */
- NVIC_EnableIRQ(USB_FS_IRQn);
- return true;
-}
-
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- const unsigned epn = ep_addr & 0xFu;
- if (0 == epn) {
- USB_OTG_FS->EP_CTL[epn] |= USB_ENDPT_EPSTALL_MASK;
- } else {
- const unsigned dir = (ep_addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT;
- buffer_descriptor_t *bd = _dcd.bdt[epn][dir];
- bd[0].bdt_stall = 1;
- bd[1].bdt_stall = 1;
- }
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- const unsigned epn = ep_addr & 0xFu;
- const unsigned dir = (ep_addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT;
- const unsigned odd = _dcd.endpoint[epn][dir].odd;
- buffer_descriptor_t *bd = _dcd.bdt[epn][dir];
-
- bd[odd ^ 1].own = 0;
- bd[odd ^ 1].data = 1;
- bd[odd ^ 1].bdt_stall = 0;
- bd[odd].own = 0;
- bd[odd].data = 0;
- bd[odd].bdt_stall = 0;
-}
-
-//--------------------------------------------------------------------+
-// ISR
-//--------------------------------------------------------------------+
-void dcd_int_handler(uint8_t rhport)
-{
- (void) rhport;
-
- uint32_t is = USB_OTG_FS->INT_STAT;
- uint32_t msk = USB_OTG_FS->INT_ENB;
- USB_OTG_FS->INT_STAT = is & ~msk;
- is &= msk;
- if (is & USB_ISTAT_ERROR_MASK) {
- /* TODO: */
- uint32_t es = USB_OTG_FS->ERR_STAT;
- USB_OTG_FS->ERR_STAT = es;
- USB_OTG_FS->INT_STAT = is; /* discard any pending events */
- return;
- }
-
- if (is & USB_ISTAT_USBRST_MASK) {
- USB_OTG_FS->INT_STAT = is; /* discard any pending events */
- process_bus_reset(rhport);
- return;
- }
- if (is & USB_ISTAT_SLEEP_MASK) {
- USB_OTG_FS->INT_STAT = USB_ISTAT_SLEEP_MASK;
- process_bus_inactive(rhport);
- return;
- }
- if (is & USB_ISTAT_RESUME_MASK) {
- USB_OTG_FS->INT_STAT = USB_ISTAT_RESUME_MASK;
- process_bus_active(rhport);
- return;
- }
- if (is & USB_ISTAT_SOFTOK_MASK) {
- USB_OTG_FS->INT_STAT = USB_ISTAT_SOFTOK_MASK;
- dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true);
- return;
- }
- if (is & USB_ISTAT_STALL_MASK) {
- USB_OTG_FS->INT_STAT = USB_ISTAT_STALL_MASK;
- process_stall(rhport);
- return;
- }
- if (is & USB_ISTAT_TOKDNE_MASK) {
- process_tokdne(rhport);
- return;
- }
-}
-
-#endif
diff --git a/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c b/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c
deleted file mode 100755
index f6b64c98..00000000
--- a/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c
+++ /dev/null
@@ -1,1050 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_NRF5X
-
-#include "nrf.h"
-#include "nrf_clock.h"
-#include "nrf_power.h"
-#include "nrfx_usbd_errata.h"
-#include "device/dcd.h"
-
-// TODO remove later
-#include "device/usbd.h"
-#include "device/usbd_pvt.h" // to use defer function helper
-
-/*------------------------------------------------------------------*/
-/* MACRO TYPEDEF CONSTANT ENUM
- *------------------------------------------------------------------*/
-enum
-{
- // Max allowed by USB specs
- MAX_PACKET_SIZE = 64,
-
- // Mask of all END event (IN & OUT) for all endpoints. ENDEPIN0-7, ENDEPOUT0-7, ENDISOIN, ENDISOOUT
- EDPT_END_ALL_MASK = (0xff << USBD_INTEN_ENDEPIN0_Pos) | (0xff << USBD_INTEN_ENDEPOUT0_Pos) |
- USBD_INTENCLR_ENDISOIN_Msk | USBD_INTEN_ENDISOOUT_Msk
-};
-
-enum
-{
- EP_ISO_NUM = 8, // Endpoint number is fixed (8) for ISOOUT and ISOIN
- EP_CBI_COUNT = 8 // Control Bulk Interrupt endpoints count
-};
-
-// Transfer Descriptor
-typedef struct
-{
- uint8_t* buffer;
- uint16_t total_len;
- volatile uint16_t actual_len;
- uint16_t mps; // max packet size
-
- // nRF will auto accept OUT packet after DMA is done
- // indicate packet is already ACK
- volatile bool data_received;
-
- // Set to true when data was transferred from RAM to ISO IN output buffer.
- // New data can be put in ISO IN output buffer after SOF.
- bool iso_in_transfer_ready;
-
-} xfer_td_t;
-
-// Data for managing dcd
-static struct
-{
- // All 8 endpoints including control IN & OUT (offset 1)
- // +1 for ISO endpoints
- xfer_td_t xfer[EP_CBI_COUNT + 1][2];
-
- // Number of pending DMA that is started but not handled yet by dcd_int_handler().
- // Since nRF can only carry one DMA can run at a time, this value is normally be either 0 or 1.
- // However, in critical section with interrupt disabled, the DMA can be finished and added up
- // until handled by dcd_int_handler() when exiting critical section.
- volatile uint8_t dma_pending;
-}_dcd;
-
-/*------------------------------------------------------------------*/
-/* Control / Bulk / Interrupt (CBI) Transfer
- *------------------------------------------------------------------*/
-
-// NVIC_GetEnableIRQ is only available in CMSIS v5
-#ifndef NVIC_GetEnableIRQ
-static inline uint32_t NVIC_GetEnableIRQ(IRQn_Type IRQn)
-{
- if ((int32_t)(IRQn) >= 0)
- {
- return((uint32_t)(((NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
- }
- else
- {
- return(0U);
- }
-}
-#endif
-
-// check if we are in ISR
-TU_ATTR_ALWAYS_INLINE static inline bool is_in_isr(void)
-{
- return (SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) ? true : false;
-}
-
-// helper to start DMA
-// TODO use Cortex M4 LDREX and STREX command (atomic) to have better mutex access to EasyDMA
-// since current implementation does not 100% guarded against race condition
-static void edpt_dma_start(volatile uint32_t* reg_startep)
-{
- // Only one dma can be active
- if ( _dcd.dma_pending )
- {
- if (is_in_isr())
- {
- // Called within ISR, use usbd task to defer later
- usbd_defer_func( (osal_task_func_t) edpt_dma_start, (void*) reg_startep, true );
- return;
- }
- else
- {
- if ( __get_PRIMASK() || !NVIC_GetEnableIRQ(USBD_IRQn) )
- {
- // Called in critical section with interrupt disabled. We have to manually check
- // for the DMA complete by comparing current pending DMA with number of ENDED Events
- uint32_t ended = 0;
-
- while ( _dcd.dma_pending > ((uint8_t) ended) )
- {
- ended = NRF_USBD->EVENTS_ENDISOIN + NRF_USBD->EVENTS_ENDISOOUT;
-
- for (uint8_t i=0; i<EP_CBI_COUNT; i++)
- {
- ended += NRF_USBD->EVENTS_ENDEPIN[i] + NRF_USBD->EVENTS_ENDEPOUT[i];
- }
- }
- }else
- {
- // Called in non-critical thread-mode, should be 99% of the time.
- // Should be safe to blocking wait until previous DMA transfer complete
- while ( _dcd.dma_pending ) { }
- }
- }
- }
-
- _dcd.dma_pending++;
-
- (*reg_startep) = 1;
- __ISB(); __DSB();
-}
-
-// DMA is complete
-static void edpt_dma_end(void)
-{
- TU_ASSERT(_dcd.dma_pending, );
- _dcd.dma_pending = 0;
-}
-
-// helper to set TASKS_EP0STATUS / TASKS_EP0RCVOUT since they also need EasyDMA
-// However TASKS_EP0STATUS doesn't trigger any DMA transfer and got ENDED event subsequently
-// Therefore dma_running state will be corrected right away
-void start_ep0_task(volatile uint32_t* reg_task)
-{
- edpt_dma_start(reg_task);
-
- // correct the dma_running++ in dma start
- if (_dcd.dma_pending) _dcd.dma_pending--;
-}
-
-// helper getting td
-static inline xfer_td_t* get_td(uint8_t epnum, uint8_t dir)
-{
- return &_dcd.xfer[epnum][dir];
-}
-
-// Start DMA to move data from Endpoint -> RAM
-static void xact_out_dma(uint8_t epnum)
-{
- xfer_td_t* xfer = get_td(epnum, TUSB_DIR_OUT);
- uint32_t xact_len;
-
- if (epnum == EP_ISO_NUM)
- {
- xact_len = NRF_USBD->SIZE.ISOOUT;
- // If ZERO bit is set, ignore ISOOUT length
- if (xact_len & USBD_SIZE_ISOOUT_ZERO_Msk) xact_len = 0;
- else
- {
- // Trigger DMA move data from Endpoint -> SRAM
- NRF_USBD->ISOOUT.PTR = (uint32_t) xfer->buffer;
- NRF_USBD->ISOOUT.MAXCNT = xact_len;
-
- edpt_dma_start(&NRF_USBD->TASKS_STARTISOOUT);
- }
- }
- else
- {
- xact_len = (uint8_t)NRF_USBD->SIZE.EPOUT[epnum];
-
- // Trigger DMA move data from Endpoint -> SRAM
- NRF_USBD->EPOUT[epnum].PTR = (uint32_t) xfer->buffer;
- NRF_USBD->EPOUT[epnum].MAXCNT = xact_len;
-
- edpt_dma_start(&NRF_USBD->TASKS_STARTEPOUT[epnum]);
- }
-
- xfer->buffer += xact_len;
- xfer->actual_len += xact_len;
-}
-
-// Prepare for a CBI transaction IN, call at the start
-// it start DMA to transfer data from RAM -> Endpoint
-static void xact_in_dma(uint8_t epnum)
-{
- xfer_td_t* xfer = get_td(epnum, TUSB_DIR_IN);
-
- // Each transaction is up to Max Packet Size
- uint16_t const xact_len = tu_min16(xfer->total_len - xfer->actual_len, xfer->mps);
-
- NRF_USBD->EPIN[epnum].PTR = (uint32_t) xfer->buffer;
- NRF_USBD->EPIN[epnum].MAXCNT = xact_len;
-
- xfer->buffer += xact_len;
-
- edpt_dma_start(&NRF_USBD->TASKS_STARTEPIN[epnum]);
-}
-
-//--------------------------------------------------------------------+
-// Controller API
-//--------------------------------------------------------------------+
-void dcd_init (uint8_t rhport)
-{
- (void) rhport;
-}
-
-void dcd_int_enable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_EnableIRQ(USBD_IRQn);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ(USBD_IRQn);
-}
-
-void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
- (void) dev_addr;
- // Set Address is automatically update by hw controller, nothing to do
-
- // Enable usbevent for suspend and resume detection
- // Since the bus signal D+/D- are stable now.
-
- // Clear current pending first
- NRF_USBD->EVENTCAUSE |= NRF_USBD->EVENTCAUSE;
- NRF_USBD->EVENTS_USBEVENT = 0;
-
- NRF_USBD->INTENSET = USBD_INTEN_USBEVENT_Msk;
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
-
- // Bring controller out of low power mode
- // will start wakeup when USBWUALLOWED is set
- NRF_USBD->LOWPOWER = 0;
-}
-
-// disconnect by disabling internal pull-up resistor on D+/D-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- NRF_USBD->USBPULLUP = 0;
-
- // Disable Pull-up does not trigger Power USB Removed, in fact it have no
- // impact on the USB Power status at all -> need to submit unplugged event to the stack.
- dcd_event_bus_signal(0, DCD_EVENT_UNPLUGGED, false);
-}
-
-// connect by enabling internal pull-up resistor on D+/D-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- NRF_USBD->USBPULLUP = 1;
-}
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(desc_edpt->bEndpointAddress);
- uint8_t const dir = tu_edpt_dir(desc_edpt->bEndpointAddress);
-
- _dcd.xfer[epnum][dir].mps = desc_edpt->wMaxPacketSize.size;
-
- if (desc_edpt->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS)
- {
- if (dir == TUSB_DIR_OUT)
- {
- NRF_USBD->INTENSET = TU_BIT(USBD_INTEN_ENDEPOUT0_Pos + epnum);
- NRF_USBD->EPOUTEN |= TU_BIT(epnum);
-
- // Write any value to SIZE register will allow nRF to ACK/accept data
- NRF_USBD->SIZE.EPOUT[epnum] = 0;
- }else
- {
- NRF_USBD->INTENSET = TU_BIT(USBD_INTEN_ENDEPIN0_Pos + epnum);
- NRF_USBD->EPINEN |= TU_BIT(epnum);
- }
- }
- else
- {
- TU_ASSERT(epnum == EP_ISO_NUM);
- if (dir == TUSB_DIR_OUT)
- {
- // SPLIT ISO buffer when ISO IN endpoint is already opened.
- if (_dcd.xfer[EP_ISO_NUM][TUSB_DIR_IN].mps) NRF_USBD->ISOSPLIT = USBD_ISOSPLIT_SPLIT_HalfIN;
-
- // Clear old events
- NRF_USBD->EVENTS_ENDISOOUT = 0;
-
- // Clear SOF event in case interrupt was not enabled yet.
- if ((NRF_USBD->INTEN & USBD_INTEN_SOF_Msk) == 0) NRF_USBD->EVENTS_SOF = 0;
-
- // Enable SOF and ISOOUT interrupts, and ISOOUT endpoint.
- NRF_USBD->INTENSET = USBD_INTENSET_ENDISOOUT_Msk | USBD_INTENSET_SOF_Msk;
- NRF_USBD->EPOUTEN |= USBD_EPOUTEN_ISOOUT_Msk;
- }
- else
- {
- NRF_USBD->EVENTS_ENDISOIN = 0;
-
- // SPLIT ISO buffer when ISO OUT endpoint is already opened.
- if (_dcd.xfer[EP_ISO_NUM][TUSB_DIR_OUT].mps) NRF_USBD->ISOSPLIT = USBD_ISOSPLIT_SPLIT_HalfIN;
-
- // Clear SOF event in case interrupt was not enabled yet.
- if ((NRF_USBD->INTEN & USBD_INTEN_SOF_Msk) == 0) NRF_USBD->EVENTS_SOF = 0;
-
- // Enable SOF and ISOIN interrupts, and ISOIN endpoint.
- NRF_USBD->INTENSET = USBD_INTENSET_ENDISOIN_Msk | USBD_INTENSET_SOF_Msk;
- NRF_USBD->EPINEN |= USBD_EPINEN_ISOIN_Msk;
- }
- }
- __ISB(); __DSB();
-
- return true;
-}
-
-void dcd_edpt_close (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- if (epnum != EP_ISO_NUM)
- {
- // CBI
- if (dir == TUSB_DIR_OUT)
- {
- NRF_USBD->INTENCLR = TU_BIT(USBD_INTEN_ENDEPOUT0_Pos + epnum);
- NRF_USBD->EPOUTEN &= ~TU_BIT(epnum);
- }
- else
- {
- NRF_USBD->INTENCLR = TU_BIT(USBD_INTEN_ENDEPIN0_Pos + epnum);
- NRF_USBD->EPINEN &= ~TU_BIT(epnum);
- }
- }
- else
- {
- _dcd.xfer[EP_ISO_NUM][dir].mps = 0;
- // ISO
- if (dir == TUSB_DIR_OUT)
- {
- NRF_USBD->INTENCLR = USBD_INTENCLR_ENDISOOUT_Msk;
- NRF_USBD->EPOUTEN &= ~USBD_EPOUTEN_ISOOUT_Msk;
- NRF_USBD->EVENTS_ENDISOOUT = 0;
- }
- else
- {
- NRF_USBD->INTENCLR = USBD_INTENCLR_ENDISOIN_Msk;
- NRF_USBD->EPINEN &= ~USBD_EPINEN_ISOIN_Msk;
- }
- // One of the ISO endpoints closed, no need to split buffers any more.
- NRF_USBD->ISOSPLIT = USBD_ISOSPLIT_SPLIT_OneDir;
- // When both ISO endpoint are close there is no need for SOF any more.
- if (_dcd.xfer[EP_ISO_NUM][TUSB_DIR_IN].mps + _dcd.xfer[EP_ISO_NUM][TUSB_DIR_OUT].mps == 0) NRF_USBD->INTENCLR = USBD_INTENCLR_SOF_Msk;
- }
- __ISB(); __DSB();
-}
-
-bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_td_t* xfer = get_td(epnum, dir);
-
- xfer->buffer = buffer;
- xfer->total_len = total_bytes;
- xfer->actual_len = 0;
-
- // Control endpoint with zero-length packet and opposite direction to 1st request byte --> status stage
- bool const control_status = (epnum == 0 && total_bytes == 0 && dir != tu_edpt_dir(NRF_USBD->BMREQUESTTYPE));
-
- if ( control_status )
- {
- // Status Phase also requires EasyDMA has to be available as well !!!!
- start_ep0_task(&NRF_USBD->TASKS_EP0STATUS);
-
- // The nRF doesn't interrupt on status transmit so we queue up a success response.
- dcd_event_xfer_complete(0, ep_addr, 0, XFER_RESULT_SUCCESS, is_in_isr());
- }
- else if ( dir == TUSB_DIR_OUT )
- {
- if ( epnum == 0 )
- {
- // Accept next Control Out packet. TASKS_EP0RCVOUT also require EasyDMA
- start_ep0_task(&NRF_USBD->TASKS_EP0RCVOUT);
- }else
- {
- if ( xfer->data_received )
- {
- // Data may already be received previously
- xfer->data_received = false;
-
- // start DMA to copy to SRAM
- xact_out_dma(epnum);
- }
- else
- {
- // nRF auto accept next Bulk/Interrupt OUT packet
- // nothing to do
- }
- }
- }
- else
- {
- // Start DMA to copy data from RAM -> Endpoint
- xact_in_dma(epnum);
- }
-
- return true;
-}
-
-void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- uint8_t const epnum = tu_edpt_number(ep_addr);
-
- if ( epnum == 0 )
- {
- NRF_USBD->TASKS_EP0STALL = 1;
- }else if (epnum != EP_ISO_NUM)
- {
- NRF_USBD->EPSTALL = (USBD_EPSTALL_STALL_Stall << USBD_EPSTALL_STALL_Pos) | ep_addr;
- }
-
- __ISB(); __DSB();
-}
-
-void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- if ( epnum != 0 && epnum != EP_ISO_NUM )
- {
- // clear stall
- NRF_USBD->EPSTALL = (USBD_EPSTALL_STALL_UnStall << USBD_EPSTALL_STALL_Pos) | ep_addr;
-
- // reset data toggle to DATA0
- NRF_USBD->DTOGGLE = (USBD_DTOGGLE_VALUE_Data0 << USBD_DTOGGLE_VALUE_Pos) | ep_addr;
-
- // Write any value to SIZE register will allow nRF to ACK/accept data
- // Drop any pending data
- if (dir == TUSB_DIR_OUT) NRF_USBD->SIZE.EPOUT[epnum] = 0;
-
- __ISB(); __DSB();
- }
-}
-
-/*------------------------------------------------------------------*/
-/* Interrupt Handler
- *------------------------------------------------------------------*/
-void bus_reset(void)
-{
- // 6.35.6 USB controller automatically disabled all endpoints (except control)
- // i.e EPOUTEN and EPINEN and reset USBADDR to 0
- for(int i=0; i<8; i++)
- {
- NRF_USBD->TASKS_STARTEPIN[i] = 0;
- NRF_USBD->TASKS_STARTEPOUT[i] = 0;
- }
-
- NRF_USBD->TASKS_STARTISOIN = 0;
- NRF_USBD->TASKS_STARTISOOUT = 0;
-
- // Clear USB Event Interrupt
- NRF_USBD->EVENTS_USBEVENT = 0;
- NRF_USBD->EVENTCAUSE |= NRF_USBD->EVENTCAUSE;
-
- // Reset interrupt
- NRF_USBD->INTENCLR = NRF_USBD->INTEN;
- NRF_USBD->INTENSET = USBD_INTEN_USBRESET_Msk | USBD_INTEN_USBEVENT_Msk | USBD_INTEN_EPDATA_Msk |
- USBD_INTEN_EP0SETUP_Msk | USBD_INTEN_EP0DATADONE_Msk | USBD_INTEN_ENDEPIN0_Msk | USBD_INTEN_ENDEPOUT0_Msk;
-
- tu_varclr(&_dcd);
- _dcd.xfer[0][TUSB_DIR_IN].mps = MAX_PACKET_SIZE;
- _dcd.xfer[0][TUSB_DIR_OUT].mps = MAX_PACKET_SIZE;
-}
-
-void dcd_int_handler(uint8_t rhport)
-{
- (void) rhport;
-
- uint32_t const inten = NRF_USBD->INTEN;
- uint32_t int_status = 0;
-
- volatile uint32_t* regevt = &NRF_USBD->EVENTS_USBRESET;
-
- for(uint8_t i=0; i<USBD_INTEN_EPDATA_Pos+1; i++)
- {
- if ( tu_bit_test(inten, i) && regevt[i] )
- {
- int_status |= TU_BIT(i);
-
- // event clear
- regevt[i] = 0;
- __ISB(); __DSB();
- }
- }
-
- if ( int_status & USBD_INTEN_USBRESET_Msk )
- {
- bus_reset();
- dcd_event_bus_reset(0, TUSB_SPEED_FULL, true);
- }
-
- // ISOIN: Data was moved to endpoint buffer, client will be notified in SOF
- if ( int_status & USBD_INTEN_ENDISOIN_Msk )
- {
- xfer_td_t* xfer = get_td(EP_ISO_NUM, TUSB_DIR_IN);
-
- xfer->actual_len = NRF_USBD->ISOIN.AMOUNT;
- // Data transferred from RAM to endpoint output buffer.
- // Next transfer can be scheduled after SOF.
- xfer->iso_in_transfer_ready = true;
- }
-
- if ( int_status & USBD_INTEN_SOF_Msk )
- {
- bool iso_enabled = false;
-
- // ISOOUT: Transfer data gathered in previous frame from buffer to RAM
- if (NRF_USBD->EPOUTEN & USBD_EPOUTEN_ISOOUT_Msk)
- {
- iso_enabled = true;
- xact_out_dma(EP_ISO_NUM);
- }
-
- // ISOIN: Notify client that data was transferred
- if (NRF_USBD->EPINEN & USBD_EPINEN_ISOIN_Msk)
- {
- iso_enabled = true;
-
- xfer_td_t* xfer = get_td(EP_ISO_NUM, TUSB_DIR_IN);
- if ( xfer->iso_in_transfer_ready )
- {
- xfer->iso_in_transfer_ready = false;
- dcd_event_xfer_complete(0, EP_ISO_NUM | TUSB_DIR_IN_MASK, xfer->actual_len, XFER_RESULT_SUCCESS, true);
- }
- }
-
- if ( !iso_enabled )
- {
- // ISO endpoint is not used, SOF is only enabled one-time for remote wakeup
- // so we disable it now
- NRF_USBD->INTENCLR = USBD_INTENSET_SOF_Msk;
- }
-
- dcd_event_bus_signal(0, DCD_EVENT_SOF, true);
- }
-
- if ( int_status & USBD_INTEN_USBEVENT_Msk )
- {
- TU_LOG(2, "EVENTCAUSE = 0x%04lX\r\n", NRF_USBD->EVENTCAUSE);
-
- enum { EVT_CAUSE_MASK = USBD_EVENTCAUSE_SUSPEND_Msk | USBD_EVENTCAUSE_RESUME_Msk | USBD_EVENTCAUSE_USBWUALLOWED_Msk };
- uint32_t const evt_cause = NRF_USBD->EVENTCAUSE & EVT_CAUSE_MASK;
- NRF_USBD->EVENTCAUSE = evt_cause; // clear interrupt
-
- if ( evt_cause & USBD_EVENTCAUSE_SUSPEND_Msk )
- {
- // Put controller into low power mode
- // Leave HFXO disable to application, since it may be used by other peripherals
- NRF_USBD->LOWPOWER = 1;
-
- dcd_event_bus_signal(0, DCD_EVENT_SUSPEND, true);
- }
-
- if ( evt_cause & USBD_EVENTCAUSE_USBWUALLOWED_Msk )
- {
- // USB is out of low power mode, and wakeup is allowed
- // Initiate RESUME signal
- NRF_USBD->DPDMVALUE = USBD_DPDMVALUE_STATE_Resume;
- NRF_USBD->TASKS_DPDMDRIVE = 1;
-
- // There is no Resume interrupt for remote wakeup, enable SOF for to report bus ready state
- // Clear SOF event in case interrupt was not enabled yet.
- if ((NRF_USBD->INTEN & USBD_INTEN_SOF_Msk) == 0) NRF_USBD->EVENTS_SOF = 0;
- NRF_USBD->INTENSET = USBD_INTENSET_SOF_Msk;
- }
-
- if ( evt_cause & USBD_EVENTCAUSE_RESUME_Msk )
- {
- dcd_event_bus_signal(0, DCD_EVENT_RESUME, true);
- }
- }
-
- // Setup tokens are specific to the Control endpoint.
- if ( int_status & USBD_INTEN_EP0SETUP_Msk )
- {
- uint8_t const setup[8] =
- {
- NRF_USBD->BMREQUESTTYPE , NRF_USBD->BREQUEST, NRF_USBD->WVALUEL , NRF_USBD->WVALUEH,
- NRF_USBD->WINDEXL , NRF_USBD->WINDEXH , NRF_USBD->WLENGTHL, NRF_USBD->WLENGTHH
- };
-
- // nrf5x hw auto handle set address, there is no need to inform usb stack
- tusb_control_request_t const * request = (tusb_control_request_t const *) setup;
-
- if ( !(TUSB_REQ_RCPT_DEVICE == request->bmRequestType_bit.recipient &&
- TUSB_REQ_TYPE_STANDARD == request->bmRequestType_bit.type &&
- TUSB_REQ_SET_ADDRESS == request->bRequest) )
- {
- dcd_event_setup_received(0, setup, true);
- }
- }
-
- if ( int_status & EDPT_END_ALL_MASK )
- {
- // DMA complete move data from SRAM -> Endpoint
- edpt_dma_end();
- }
-
- //--------------------------------------------------------------------+
- /* Control/Bulk/Interrupt (CBI) Transfer
- *
- * Data flow is:
- * (bus) (dma)
- * Host <-------> Endpoint <-------> RAM
- *
- * For CBI OUT:
- * - Host -> Endpoint
- * EPDATA (or EP0DATADONE) interrupted, check EPDATASTATUS.EPOUT[i]
- * to start DMA. For Bulk/Interrupt, this step can occur automatically (without sw),
- * which means data may or may not be ready (data_received flag).
- * - Endpoint -> RAM
- * ENDEPOUT[i] interrupted, transaction complete, sw prepare next transaction
- *
- * For CBI IN:
- * - RAM -> Endpoint
- * ENDEPIN[i] interrupted indicate DMA is complete. HW will start
- * to move data to host
- * - Endpoint -> Host
- * EPDATA (or EP0DATADONE) interrupted, check EPDATASTATUS.EPIN[i].
- * Transaction is complete, sw prepare next transaction
- *
- * Note: in both Control In and Out of Data stage from Host <-> Endpoint
- * EP0DATADONE will be set as interrupt source
- */
- //--------------------------------------------------------------------+
-
- /* CBI OUT: Endpoint -> SRAM (aka transaction complete)
- * Note: Since nRF controller auto ACK next packet without SW awareness
- * We must handle this stage before Host -> Endpoint just in case 2 event happens at once
- *
- * ISO OUT: Transaction must fit in single packet, it can be shorter then total
- * len if Host decides to sent fewer bytes, it this case transaction is also
- * complete and next transfer is not initiated here like for CBI.
- */
- for(uint8_t epnum=0; epnum<EP_CBI_COUNT+1; epnum++)
- {
- if ( tu_bit_test(int_status, USBD_INTEN_ENDEPOUT0_Pos+epnum))
- {
- xfer_td_t* xfer = get_td(epnum, TUSB_DIR_OUT);
- uint8_t const xact_len = NRF_USBD->EPOUT[epnum].AMOUNT;
-
- // Transfer complete if transaction len < Max Packet Size or total len is transferred
- if ( (epnum != EP_ISO_NUM) && (xact_len == xfer->mps) && (xfer->actual_len < xfer->total_len) )
- {
- if ( epnum == 0 )
- {
- // Accept next Control Out packet. TASKS_EP0RCVOUT also require EasyDMA
- if ( _dcd.dma_pending )
- {
- // use usbd task to defer later
- usbd_defer_func( (osal_task_func_t) start_ep0_task, (void*) &NRF_USBD->TASKS_EP0RCVOUT, true );
- }else
- {
- start_ep0_task(&NRF_USBD->TASKS_EP0RCVOUT);
- }
- }else
- {
- // nRF auto accept next Bulk/Interrupt OUT packet
- // nothing to do
- }
- }else
- {
- xfer->total_len = xfer->actual_len;
-
- // CBI OUT complete
- dcd_event_xfer_complete(0, epnum, xfer->actual_len, XFER_RESULT_SUCCESS, true);
- }
- }
-
- // Ended event for CBI IN : nothing to do
- }
-
- // Endpoint <-> Host ( In & OUT )
- if ( int_status & (USBD_INTEN_EPDATA_Msk | USBD_INTEN_EP0DATADONE_Msk) )
- {
- uint32_t data_status = NRF_USBD->EPDATASTATUS;
- NRF_USBD->EPDATASTATUS = data_status;
- __ISB(); __DSB();
-
- // EP0DATADONE is set with either Control Out on IN Data
- // Since EPDATASTATUS cannot be used to determine whether it is control OUT or IN.
- // We will use BMREQUESTTYPE in setup packet to determine the direction
- bool const is_control_in = (int_status & USBD_INTEN_EP0DATADONE_Msk) && (NRF_USBD->BMREQUESTTYPE & TUSB_DIR_IN_MASK);
- bool const is_control_out = (int_status & USBD_INTEN_EP0DATADONE_Msk) && !(NRF_USBD->BMREQUESTTYPE & TUSB_DIR_IN_MASK);
-
- // CBI In: Endpoint -> Host (transaction complete)
- for(uint8_t epnum=0; epnum<EP_CBI_COUNT; epnum++)
- {
- if ( tu_bit_test(data_status, epnum) || (epnum == 0 && is_control_in) )
- {
- xfer_td_t* xfer = get_td(epnum, TUSB_DIR_IN);
-
- xfer->actual_len += NRF_USBD->EPIN[epnum].MAXCNT;
-
- if ( xfer->actual_len < xfer->total_len )
- {
- // Start DMA to copy next data packet
- xact_in_dma(epnum);
- } else
- {
- // CBI IN complete
- dcd_event_xfer_complete(0, epnum | TUSB_DIR_IN_MASK, xfer->actual_len, XFER_RESULT_SUCCESS, true);
- }
- }
- }
-
- // CBI OUT: Host -> Endpoint
- for(uint8_t epnum=0; epnum<EP_CBI_COUNT; epnum++)
- {
- if ( tu_bit_test(data_status, 16+epnum) || (epnum == 0 && is_control_out) )
- {
- xfer_td_t* xfer = get_td(epnum, TUSB_DIR_OUT);
-
- if (xfer->actual_len < xfer->total_len)
- {
- xact_out_dma(epnum);
- }else
- {
- // Data overflow !!! Nah, nRF will auto accept next Bulk/Interrupt OUT packet
- // Mark this endpoint with data received
- xfer->data_received = true;
- }
- }
- }
- }
-}
-
-//--------------------------------------------------------------------+
-// HFCLK helper
-//--------------------------------------------------------------------+
-#ifdef SOFTDEVICE_PRESENT
-
-// For enable/disable hfclk with SoftDevice
-#include "nrf_mbr.h"
-#include "nrf_sdm.h"
-#include "nrf_soc.h"
-
-#ifndef SD_MAGIC_NUMBER
- #define SD_MAGIC_NUMBER 0x51B1E5DB
-#endif
-
-static inline bool is_sd_existed(void)
-{
- return *((uint32_t*)(SOFTDEVICE_INFO_STRUCT_ADDRESS+4)) == SD_MAGIC_NUMBER;
-}
-
-// check if SD is existed and enabled
-static inline bool is_sd_enabled(void)
-{
- if ( !is_sd_existed() ) return false;
-
- uint8_t sd_en = false;
- (void) sd_softdevice_is_enabled(&sd_en);
- return sd_en;
-}
-#endif
-
-static bool hfclk_running(void)
-{
-#ifdef SOFTDEVICE_PRESENT
- if ( is_sd_enabled() )
- {
- uint32_t is_running = 0;
- (void) sd_clock_hfclk_is_running(&is_running);
- return (is_running ? true : false);
- }
-#endif
-
- return nrf_clock_hf_is_running(NRF_CLOCK, NRF_CLOCK_HFCLK_HIGH_ACCURACY);
-}
-
-static void hfclk_enable(void)
-{
- // already running, nothing to do
- if ( hfclk_running() ) return;
-
-#ifdef SOFTDEVICE_PRESENT
- if ( is_sd_enabled() )
- {
- (void)sd_clock_hfclk_request();
- return;
- }
-#endif
-
- nrf_clock_event_clear(NRF_CLOCK, NRF_CLOCK_EVENT_HFCLKSTARTED);
- nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_HFCLKSTART);
-}
-
-static void hfclk_disable(void)
-{
-#ifdef SOFTDEVICE_PRESENT
- if ( is_sd_enabled() )
- {
- (void)sd_clock_hfclk_release();
- return;
- }
-#endif
-
- nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_HFCLKSTOP);
-}
-
-// Power & Clock Peripheral on nRF5x to manage USB
-//
-// USB Bus power is managed by Power module, there are 3 VBUS power events:
-// Detected, Ready, Removed. Upon these power events, This function will
-// enable ( or disable ) usb & hfclk peripheral, set the usb pin pull up
-// accordingly to the controller Startup/Standby Sequence in USBD 51.4 specs.
-//
-// Therefore this function must be called to handle USB power event by
-// - nrfx_power_usbevt_init() : if Softdevice is not used or enabled
-// - SoftDevice SOC event : if SD is used and enabled
-void tusb_hal_nrf_power_event (uint32_t event)
-{
- // Value is chosen to be as same as NRFX_POWER_USB_EVT_* in nrfx_power.h
- enum {
- USB_EVT_DETECTED = 0,
- USB_EVT_REMOVED = 1,
- USB_EVT_READY = 2
- };
-
-#if CFG_TUSB_DEBUG >= 2
- const char* const power_evt_str[] = { "Detected", "Removed", "Ready" };
- TU_LOG(2, "Power USB event: %s\r\n", power_evt_str[event]);
-#endif
-
- switch ( event )
- {
- case USB_EVT_DETECTED:
- if ( !NRF_USBD->ENABLE )
- {
- // Prepare for receiving READY event: disable interrupt since we will blocking wait
- NRF_USBD->INTENCLR = USBD_INTEN_USBEVENT_Msk;
- NRF_USBD->EVENTCAUSE = USBD_EVENTCAUSE_READY_Msk;
- __ISB(); __DSB(); // for sync
-
-#ifdef NRF52_SERIES // NRF53 does not need this errata
- // ERRATA 171, 187, 166
- if ( nrfx_usbd_errata_187() )
- {
- // CRITICAL_REGION_ENTER();
- if ( *((volatile uint32_t *) (0x4006EC00)) == 0x00000000 )
- {
- *((volatile uint32_t *) (0x4006EC00)) = 0x00009375;
- *((volatile uint32_t *) (0x4006ED14)) = 0x00000003;
- *((volatile uint32_t *) (0x4006EC00)) = 0x00009375;
- }
- else
- {
- *((volatile uint32_t *) (0x4006ED14)) = 0x00000003;
- }
- // CRITICAL_REGION_EXIT();
- }
-
- if ( nrfx_usbd_errata_171() )
- {
- // CRITICAL_REGION_ENTER();
- if ( *((volatile uint32_t *) (0x4006EC00)) == 0x00000000 )
- {
- *((volatile uint32_t *) (0x4006EC00)) = 0x00009375;
- *((volatile uint32_t *) (0x4006EC14)) = 0x000000C0;
- *((volatile uint32_t *) (0x4006EC00)) = 0x00009375;
- }
- else
- {
- *((volatile uint32_t *) (0x4006EC14)) = 0x000000C0;
- }
- // CRITICAL_REGION_EXIT();
- }
-#endif
-
- // Enable the peripheral (will cause Ready event)
- NRF_USBD->ENABLE = 1;
- __ISB(); __DSB(); // for sync
-
- // Enable HFCLK
- hfclk_enable();
- }
- break;
-
- case USB_EVT_READY:
- // Skip if pull-up is enabled and HCLK is already running.
- // Application probably call this more than necessary.
- if ( NRF_USBD->USBPULLUP && hfclk_running() ) break;
-
- // Waiting for USBD peripheral enabled
- while ( !(USBD_EVENTCAUSE_READY_Msk & NRF_USBD->EVENTCAUSE) ) { }
-
- NRF_USBD->EVENTCAUSE = USBD_EVENTCAUSE_READY_Msk;
- __ISB(); __DSB(); // for sync
-
-#ifdef NRF52_SERIES
- if ( nrfx_usbd_errata_171() )
- {
- // CRITICAL_REGION_ENTER();
- if ( *((volatile uint32_t *) (0x4006EC00)) == 0x00000000 )
- {
- *((volatile uint32_t *) (0x4006EC00)) = 0x00009375;
- *((volatile uint32_t *) (0x4006EC14)) = 0x00000000;
- *((volatile uint32_t *) (0x4006EC00)) = 0x00009375;
- }
- else
- {
- *((volatile uint32_t *) (0x4006EC14)) = 0x00000000;
- }
-
- // CRITICAL_REGION_EXIT();
- }
-
- if ( nrfx_usbd_errata_187() )
- {
- // CRITICAL_REGION_ENTER();
- if ( *((volatile uint32_t *) (0x4006EC00)) == 0x00000000 )
- {
- *((volatile uint32_t *) (0x4006EC00)) = 0x00009375;
- *((volatile uint32_t *) (0x4006ED14)) = 0x00000000;
- *((volatile uint32_t *) (0x4006EC00)) = 0x00009375;
- }
- else
- {
- *((volatile uint32_t *) (0x4006ED14)) = 0x00000000;
- }
- // CRITICAL_REGION_EXIT();
- }
-
- if ( nrfx_usbd_errata_166() )
- {
- *((volatile uint32_t *) (NRF_USBD_BASE + 0x800)) = 0x7E3;
- *((volatile uint32_t *) (NRF_USBD_BASE + 0x804)) = 0x40;
-
- __ISB(); __DSB();
- }
-#endif
-
- // ISO buffer Lower half for IN, upper half for OUT
- NRF_USBD->ISOSPLIT = USBD_ISOSPLIT_SPLIT_HalfIN;
-
- // Enable bus-reset interrupt
- NRF_USBD->INTENSET = USBD_INTEN_USBRESET_Msk;
-
- // Enable interrupt, priorities should be set by application
- NVIC_ClearPendingIRQ(USBD_IRQn);
- NVIC_EnableIRQ(USBD_IRQn);
-
- // Wait for HFCLK
- while ( !hfclk_running() ) { }
-
- // Enable pull up
- NRF_USBD->USBPULLUP = 1;
- __ISB(); __DSB(); // for sync
- break;
-
- case USB_EVT_REMOVED:
- if ( NRF_USBD->ENABLE )
- {
- // Abort all transfers
-
- // Disable pull up
- NRF_USBD->USBPULLUP = 0;
- __ISB(); __DSB(); // for sync
-
- // Disable Interrupt
- NVIC_DisableIRQ(USBD_IRQn);
-
- // disable all interrupt
- NRF_USBD->INTENCLR = NRF_USBD->INTEN;
-
- NRF_USBD->ENABLE = 0;
- __ISB(); __DSB(); // for sync
-
- hfclk_disable();
-
- dcd_event_bus_signal(0, DCD_EVENT_UNPLUGGED, is_in_isr());
- }
- break;
-
- default: break;
- }
-}
-
-#endif
diff --git a/tinyusb/src/portable/nuvoton/nuc120/dcd_nuc120.c b/tinyusb/src/portable/nuvoton/nuc120/dcd_nuc120.c
deleted file mode 100755
index 57cc76e8..00000000
--- a/tinyusb/src/portable/nuvoton/nuc120/dcd_nuc120.c
+++ /dev/null
@@ -1,494 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019-2020 Peter Lawrence
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/*
- Theory of operation:
-
- The NUC100/NUC120 USBD peripheral has six "EP"s, but each is simplex,
- so two collectively (peripheral nomenclature of "EP0" and "EP1") are needed to
- implement USB EP0. PERIPH_EP0 and PERIPH_EP1 are used by this driver for
- EP0_IN and EP0_OUT respectively. This leaves up to four for user usage.
-*/
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && (CFG_TUSB_MCU == OPT_MCU_NUC120)
-
-#include "device/dcd.h"
-#include "NUC100Series.h"
-
-/* allocation of USBD RAM for Setup, EP0_IN, and and EP_OUT */
-#define PERIPH_SETUP_BUF_BASE 0
-#define PERIPH_SETUP_BUF_LEN 8
-#define PERIPH_EP0_BUF_BASE (PERIPH_SETUP_BUF_BASE + PERIPH_SETUP_BUF_LEN)
-#define PERIPH_EP0_BUF_LEN CFG_TUD_ENDPOINT0_SIZE
-#define PERIPH_EP1_BUF_BASE (PERIPH_EP0_BUF_BASE + PERIPH_EP0_BUF_LEN)
-#define PERIPH_EP1_BUF_LEN CFG_TUD_ENDPOINT0_SIZE
-#define PERIPH_EP2_BUF_BASE (PERIPH_EP1_BUF_BASE + PERIPH_EP1_BUF_LEN)
-
-/* rather important info unfortunately not provided by device include files: how much there is */
-#define USBD_BUF_SIZE 512
-
-enum ep_enum
-{
- PERIPH_EP0 = 0,
- PERIPH_EP1 = 1,
- PERIPH_EP2 = 2,
- PERIPH_EP3 = 3,
- PERIPH_EP4 = 4,
- PERIPH_EP5 = 5,
- PERIPH_MAX_EP,
-};
-
-/* set by dcd_set_address() */
-static volatile uint8_t assigned_address;
-
-/* reset by dcd_init(), this is used by dcd_edpt_open() to assign USBD peripheral buffer addresses */
-static uint32_t bufseg_addr;
-
-/* used by dcd_edpt_xfer() and the ISR to reset the data sync (DATA0/DATA1) in an EP0_IN transfer */
-static bool active_ep0_xfer;
-
-/* RAM table needed to track ongoing transfers performed by dcd_edpt_xfer(), dcd_in_xfer(), and the ISR */
-static struct xfer_ctl_t
-{
- uint8_t *data_ptr; /* data_ptr tracks where to next copy data to (for OUT) or from (for IN) */
- // tu_fifo_t * ff; /* pointer to FIFO required for dcd_edpt_xfer_fifo() */ // TODO support dcd_edpt_xfer_fifo API
- union {
- uint16_t in_remaining_bytes; /* for IN endpoints, we track how many bytes are left to transfer */
- uint16_t out_bytes_so_far; /* but for OUT endpoints, we track how many bytes we've transferred so far */
- };
- uint16_t max_packet_size; /* needed since device driver only finds out this at runtime */
- uint16_t total_bytes; /* quantity needed to pass as argument to dcd_event_xfer_complete() (for IN endpoints) */
-} xfer_table[PERIPH_MAX_EP];
-
-/*
- local helper functions
-*/
-
-static void usb_attach(void)
-{
- USBD->DRVSE0 &= ~USBD_DRVSE0_DRVSE0_Msk;
-}
-
-static void usb_detach(void)
-{
- USBD->DRVSE0 |= USBD_DRVSE0_DRVSE0_Msk;
-}
-
-static inline void usb_memcpy(uint8_t *dest, uint8_t *src, uint16_t size)
-{
- while(size--) *dest++ = *src++;
-}
-
-static void usb_control_send_zlp(void)
-{
- USBD->EP[PERIPH_EP0].CFG |= USBD_CFG_DSQ_SYNC_Msk;
- USBD->EP[PERIPH_EP0].MXPLD = 0;
-}
-
-/* reconstruct ep_addr from particular USB Configuration Register */
-static uint8_t decode_ep_addr(USBD_EP_T *ep)
-{
- uint8_t ep_addr = ep->CFG & USBD_CFG_EP_NUM_Msk;
- if ( USBD_CFG_EPMODE_IN == (ep->CFG & USBD_CFG_STATE_Msk) )
- ep_addr |= TUSB_DIR_IN_MASK;
- return ep_addr;
-}
-
-/* map 8-bit ep_addr into peripheral endpoint index (PERIPH_EP0...) */
-static USBD_EP_T *ep_entry(uint8_t ep_addr, bool add)
-{
- USBD_EP_T *ep;
- enum ep_enum ep_index;
-
- for (ep_index = PERIPH_EP0, ep = USBD->EP; ep_index < PERIPH_MAX_EP; ep_index++, ep++)
- {
- if (add)
- {
- /* take first peripheral endpoint that is unused */
- if (0 == (ep->CFG & USBD_CFG_STATE_Msk)) return ep;
- }
- else
- {
- /* find a peripheral endpoint that matches ep_addr */
- uint8_t candidate_ep_addr = decode_ep_addr(ep);
- if (candidate_ep_addr == ep_addr) return ep;
- }
- }
-
- return NULL;
-}
-
-/* perform an IN endpoint transfer; this is called by dcd_edpt_xfer() and the ISR */
-static void dcd_in_xfer(struct xfer_ctl_t *xfer, USBD_EP_T *ep)
-{
- uint16_t bytes_now = tu_min16(xfer->in_remaining_bytes, xfer->max_packet_size);
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- tu_fifo_read_n(xfer->ff, (void *) (USBD_BUF_BASE + ep->BUFSEG), bytes_now);
- }
- else
-#endif
- {
- // USB SRAM seems to only support byte access and memcpy could possibly do it by words
- usb_memcpy((uint8_t *)(USBD_BUF_BASE + ep->BUFSEG), xfer->data_ptr, bytes_now);
- }
-
- ep->MXPLD = bytes_now;
-}
-
-/* called by dcd_init() as well as by the ISR during a USB bus reset */
-static void bus_reset(void)
-{
- USBD->STBUFSEG = PERIPH_SETUP_BUF_BASE;
-
- for (enum ep_enum ep_index = PERIPH_EP0; ep_index < PERIPH_MAX_EP; ep_index++)
- {
- USBD->EP[ep_index].CFG = 0;
- USBD->EP[ep_index].CFGP = 0;
- }
-
- /* allocate the default EP0 endpoints */
-
- USBD->EP[PERIPH_EP0].CFG = USBD_CFG_CSTALL_Msk | USBD_CFG_EPMODE_IN;
- USBD->EP[PERIPH_EP0].BUFSEG = PERIPH_EP0_BUF_BASE;
- xfer_table[PERIPH_EP0].max_packet_size = PERIPH_EP0_BUF_LEN;
-
- USBD->EP[PERIPH_EP1].CFG = USBD_CFG_CSTALL_Msk | USBD_CFG_EPMODE_OUT;
- USBD->EP[PERIPH_EP1].BUFSEG = PERIPH_EP1_BUF_BASE;
- xfer_table[PERIPH_EP1].max_packet_size = PERIPH_EP1_BUF_LEN;
-
- /* USB RAM beyond what we've allocated above is available to the user */
- bufseg_addr = PERIPH_EP2_BUF_BASE;
-
- /* Reset USB device address */
- USBD->FADDR = 0;
-
- /* reset EP0_IN flag */
- active_ep0_xfer = false;
-}
-
-/* centralized location for USBD interrupt enable bit mask */
-static const uint32_t enabled_irqs = USBD_INTSTS_FLDET_STS_Msk | USBD_INTSTS_BUS_STS_Msk | USBD_INTSTS_SETUP_Msk | USBD_INTSTS_USB_STS_Msk;
-
-/*
- NUC100/NUC120 TinyUSB API driver implementation
-*/
-
-void dcd_init(uint8_t rhport)
-{
- (void) rhport;
-
- USBD->ATTR = 0x7D0;
-
- usb_detach();
-
- bus_reset();
-
- usb_attach();
-
- USBD->INTSTS = enabled_irqs;
- USBD->INTEN = enabled_irqs;
-}
-
-void dcd_int_enable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_EnableIRQ(USBD_IRQn);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ(USBD_IRQn);
-}
-
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
- usb_control_send_zlp(); /* SET_ADDRESS is the one exception where TinyUSB doesn't use dcd_edpt_xfer() to generate a ZLP */
- assigned_address = dev_addr;
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
- USBD->ATTR = USBD_ATTR_RWAKEUP_Msk;
-}
-
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
-{
- (void) rhport;
-
- USBD_EP_T *ep = ep_entry(p_endpoint_desc->bEndpointAddress, true);
- TU_ASSERT(ep);
-
- /* mine the data for the information we need */
- int const dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress);
- int const size = p_endpoint_desc->wMaxPacketSize.size;
- tusb_xfer_type_t const type = (tusb_xfer_type_t) p_endpoint_desc->bmAttributes.xfer;
- struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP];
-
- /* allocate buffer from USB RAM */
- ep->BUFSEG = bufseg_addr;
- bufseg_addr += size;
- TU_ASSERT(bufseg_addr <= USBD_BUF_SIZE);
-
- /* construct USB Configuration Register value and then write it */
- uint32_t cfg = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
- cfg |= (TUSB_DIR_IN == dir) ? USBD_CFG_EPMODE_IN : USBD_CFG_EPMODE_OUT;
- if (TUSB_XFER_ISOCHRONOUS == type)
- cfg |= USBD_CFG_TYPE_ISO;
- ep->CFG = cfg;
-
- /* make a note of the endpoint size */
- xfer->max_packet_size = size;
-
- return true;
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t total_bytes)
-{
- (void) rhport;
-
- /* mine the data for the information we need */
- tusb_dir_t dir = tu_edpt_dir(ep_addr);
- USBD_EP_T *ep = ep_entry(ep_addr, false);
- struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP];
-
- /* store away the information we'll needing now and later */
- xfer->data_ptr = buffer;
- // xfer->ff = NULL; // TODO support dcd_edpt_xfer_fifo API
- xfer->in_remaining_bytes = total_bytes;
- xfer->total_bytes = total_bytes;
-
- /* for the first of one or more EP0_IN packets in a message, the first must be DATA1 */
- if ( (0x80 == ep_addr) && !active_ep0_xfer ) ep->CFG |= USBD_CFG_DSQ_SYNC_Msk;
-
- if (TUSB_DIR_IN == dir)
- {
- dcd_in_xfer(xfer, ep);
- }
- else
- {
- xfer->out_bytes_so_far = 0;
- ep->MXPLD = xfer->max_packet_size;
- }
-
- return true;
-}
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
-bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
-{
- (void) rhport;
-
- /* mine the data for the information we need */
- tusb_dir_t dir = tu_edpt_dir(ep_addr);
- USBD_EP_T *ep = ep_entry(ep_addr, false);
- struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP];
-
- /* store away the information we'll needing now and later */
- xfer->data_ptr = NULL; // Indicates a FIFO shall be used
- xfer->ff = ff;
- xfer->in_remaining_bytes = total_bytes;
- xfer->total_bytes = total_bytes;
-
- if (TUSB_DIR_IN == dir)
- {
- dcd_in_xfer(xfer, ep);
- }
- else
- {
- xfer->out_bytes_so_far = 0;
- ep->MXPLD = xfer->max_packet_size;
- }
-
- return true;
-}
-#endif
-
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- USBD_EP_T *ep = ep_entry(ep_addr, false);
- ep->CFGP |= USBD_CFGP_SSTALL_Msk;
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- USBD_EP_T *ep = ep_entry(ep_addr, false);
- ep->CFG |= USBD_CFG_CSTALL_Msk;
-}
-
-void dcd_int_handler(uint8_t rhport)
-{
- (void) rhport;
-
- uint32_t status = USBD->INTSTS;
- uint32_t state = USBD->ATTR & 0xf;
-
- if(status & USBD_INTSTS_FLDET_STS_Msk)
- {
- if(USBD->FLDET & USBD_FLDET_FLDET_Msk)
- {
- /* USB connect */
- USBD->ATTR |= USBD_ATTR_USB_EN_Msk | USBD_ATTR_PHY_EN_Msk;
- }
- else
- {
- /* USB disconnect */
- USBD->ATTR &= ~USBD_ATTR_USB_EN_Msk;
- }
- }
-
- if(status & USBD_INTSTS_BUS_STS_Msk)
- {
- if(state & USBD_STATE_USBRST)
- {
- /* USB bus reset */
- USBD->ATTR |= USBD_ATTR_USB_EN_Msk | USBD_ATTR_PHY_EN_Msk;
-
- bus_reset();
- dcd_event_bus_reset(0, TUSB_SPEED_FULL, true);
- }
-
- if(state & USBD_STATE_SUSPEND)
- {
- /* Enable USB but disable PHY */
- USBD->ATTR &= ~USBD_ATTR_PHY_EN_Msk;
- dcd_event_bus_signal(0, DCD_EVENT_SUSPEND, true);
- }
-
- if(state & USBD_STATE_RESUME)
- {
- /* Enable USB and enable PHY */
- USBD->ATTR |= USBD_ATTR_USB_EN_Msk | USBD_ATTR_PHY_EN_Msk;
- dcd_event_bus_signal(0, DCD_EVENT_RESUME, true);
- }
- }
-
- if(status & USBD_INTSTS_SETUP_Msk)
- {
- /* clear the data ready flag of control endpoints */
- USBD->EP[PERIPH_EP0].CFGP |= USBD_CFGP_CLRRDY_Msk;
- USBD->EP[PERIPH_EP1].CFGP |= USBD_CFGP_CLRRDY_Msk;
-
- /* get SETUP packet from USB buffer */
- dcd_event_setup_received(0, (uint8_t *)USBD_BUF_BASE, true);
- }
-
- if(status & USBD_INTSTS_USB_STS_Msk)
- {
- if (status & (1UL << USBD_INTSTS_EPEVT_Pos)) /* PERIPH_EP0 (EP0_IN) event: this is treated separately from the rest */
- {
- /* given ACK from host has happened, we can now set the address (if not already done) */
- if((USBD->FADDR != assigned_address) && (USBD->FADDR == 0)) USBD->FADDR = assigned_address;
-
- uint16_t const available_bytes = USBD->EP[PERIPH_EP0].MXPLD;
-
- active_ep0_xfer = (available_bytes == xfer_table[PERIPH_EP0].max_packet_size);
-
- dcd_event_xfer_complete(0, 0x80, available_bytes, XFER_RESULT_SUCCESS, true);
- }
-
- /* service PERIPH_EP1 through PERIPH_EP7 */
- enum ep_enum ep_index;
- uint32_t mask;
- struct xfer_ctl_t *xfer;
- USBD_EP_T *ep;
- for (ep_index = PERIPH_EP1, mask = (2UL << USBD_INTSTS_EPEVT_Pos), xfer = &xfer_table[PERIPH_EP1], ep = &USBD->EP[PERIPH_EP1]; ep_index < PERIPH_MAX_EP; ep_index++, mask <<= 1, xfer++, ep++)
- {
- if(status & mask)
- {
- USBD->INTSTS = mask;
-
- uint16_t const available_bytes = ep->MXPLD;
- uint8_t const ep_addr = decode_ep_addr(ep);
- bool const out_ep = !(ep_addr & TUSB_DIR_IN_MASK);
-
- if (out_ep)
- {
- /* copy the data from the PC to the previously provided buffer */
-#if 0 // // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- tu_fifo_write_n(xfer->ff, (const void *) (USBD_BUF_BASE + ep->BUFSEG), available_bytes);
- }
- else
-#endif
- {
- // USB SRAM seems to only support byte access and memcpy could possibly do it by words
- usb_memcpy(xfer->data_ptr, (uint8_t *)(USBD_BUF_BASE + ep->BUFSEG), available_bytes);
- xfer->data_ptr += available_bytes;
- }
-
- xfer->out_bytes_so_far += available_bytes;
-
- /* when the transfer is finished, alert TinyUSB; otherwise, accept more data */
- if ( (xfer->total_bytes == xfer->out_bytes_so_far) || (available_bytes < xfer->max_packet_size) )
- dcd_event_xfer_complete(0, ep_addr, xfer->out_bytes_so_far, XFER_RESULT_SUCCESS, true);
- else
- ep->MXPLD = xfer->max_packet_size;
- }
- else
- {
- /* update the bookkeeping to reflect the data that has now been sent to the PC */
- xfer->in_remaining_bytes -= available_bytes;
-
- xfer->data_ptr += available_bytes;
-
- /* if more data to send, send it; otherwise, alert TinyUSB that we've finished */
- if (xfer->in_remaining_bytes)
- dcd_in_xfer(xfer, ep);
- else
- dcd_event_xfer_complete(0, ep_addr, xfer->total_bytes, XFER_RESULT_SUCCESS, true);
- }
- }
- }
- }
-
- /* acknowledge all interrupts */
- USBD->INTSTS = status & enabled_irqs;
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- usb_detach();
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- usb_attach();
-}
-
-#endif
diff --git a/tinyusb/src/portable/nuvoton/nuc121/dcd_nuc121.c b/tinyusb/src/portable/nuvoton/nuc121/dcd_nuc121.c
deleted file mode 100755
index a776e46f..00000000
--- a/tinyusb/src/portable/nuvoton/nuc121/dcd_nuc121.c
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Peter Lawrence
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/*
- Theory of operation:
-
- The NUC121/NUC125/NUC126 USBD peripheral has eight "EP"s, but each is simplex,
- so two collectively (peripheral nomenclature of "EP0" and "EP1") are needed to
- implement USB EP0. PERIPH_EP0 and PERIPH_EP1 are used by this driver for
- EP0_IN and EP0_OUT respectively. This leaves up to six for user usage.
-*/
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && ( (CFG_TUSB_MCU == OPT_MCU_NUC121) || (CFG_TUSB_MCU == OPT_MCU_NUC126) )
-
-#include "device/dcd.h"
-#include "NuMicro.h"
-
-// Since TinyUSB doesn't use SOF for now, and this interrupt too often (1ms interval)
-// We disable SOF for now until needed later on
-#ifndef USE_SOF
-# define USE_SOF 0
-#endif
-
-/* allocation of USBD RAM for Setup, EP0_IN, and and EP_OUT */
-#define PERIPH_SETUP_BUF_BASE 0
-#define PERIPH_SETUP_BUF_LEN 8
-#define PERIPH_EP0_BUF_BASE (PERIPH_SETUP_BUF_BASE + PERIPH_SETUP_BUF_LEN)
-#define PERIPH_EP0_BUF_LEN CFG_TUD_ENDPOINT0_SIZE
-#define PERIPH_EP1_BUF_BASE (PERIPH_EP0_BUF_BASE + PERIPH_EP0_BUF_LEN)
-#define PERIPH_EP1_BUF_LEN CFG_TUD_ENDPOINT0_SIZE
-#define PERIPH_EP2_BUF_BASE (PERIPH_EP1_BUF_BASE + PERIPH_EP1_BUF_LEN)
-
-/* rather important info unfortunately not provided by device include files: how much there is */
-#define USBD_BUF_SIZE ((CFG_TUSB_MCU == OPT_MCU_NUC121) ? 768 : 512)
-
-enum ep_enum
-{
- PERIPH_EP0 = 0,
- PERIPH_EP1 = 1,
- PERIPH_EP2 = 2,
- PERIPH_EP3 = 3,
- PERIPH_EP4 = 4,
- PERIPH_EP5 = 5,
- PERIPH_EP6 = 6,
- PERIPH_EP7 = 7,
- PERIPH_MAX_EP,
-};
-
-/* reset by dcd_init(), this is used by dcd_edpt_open() to assign USBD peripheral buffer addresses */
-static uint32_t bufseg_addr;
-
-/* used by dcd_edpt_xfer() and the ISR to reset the data sync (DATA0/DATA1) in an EP0_IN transfer */
-static bool active_ep0_xfer;
-
-/* RAM table needed to track ongoing transfers performed by dcd_edpt_xfer(), dcd_in_xfer(), and the ISR */
-static struct xfer_ctl_t
-{
- uint8_t *data_ptr; /* data_ptr tracks where to next copy data to (for OUT) or from (for IN) */
- // tu_fifo_t * ff; // TODO support dcd_edpt_xfer_fifo API
- union {
- uint16_t in_remaining_bytes; /* for IN endpoints, we track how many bytes are left to transfer */
- uint16_t out_bytes_so_far; /* but for OUT endpoints, we track how many bytes we've transferred so far */
- };
- uint16_t max_packet_size; /* needed since device driver only finds out this at runtime */
- uint16_t total_bytes; /* quantity needed to pass as argument to dcd_event_xfer_complete() (for IN endpoints) */
-} xfer_table[PERIPH_MAX_EP];
-
-/*
- local helper functions
-*/
-
-static void usb_attach(void)
-{
- USBD->SE0 &= ~USBD_SE0_SE0_Msk;
-}
-
-static void usb_detach(void)
-{
- USBD->SE0 |= USBD_SE0_SE0_Msk;
-}
-
-static inline void usb_memcpy(uint8_t *dest, uint8_t *src, uint16_t size)
-{
- while(size--) *dest++ = *src++;
-}
-
-static void usb_control_send_zlp(void)
-{
- USBD->EP[PERIPH_EP0].CFG |= USBD_CFG_DSQSYNC_Msk;
- USBD->EP[PERIPH_EP0].MXPLD = 0;
-}
-
-/* reconstruct ep_addr from particular USB Configuration Register */
-static uint8_t decode_ep_addr(USBD_EP_T *ep)
-{
- uint8_t ep_addr = ep->CFG & USBD_CFG_EPNUM_Msk;
- if ( USBD_CFG_EPMODE_IN == (ep->CFG & USBD_CFG_STATE_Msk) )
- ep_addr |= TUSB_DIR_IN_MASK;
- return ep_addr;
-}
-
-/* map 8-bit ep_addr into peripheral endpoint index (PERIPH_EP0...) */
-static USBD_EP_T *ep_entry(uint8_t ep_addr, bool add)
-{
- USBD_EP_T *ep;
- enum ep_enum ep_index;
-
- for (ep_index = PERIPH_EP0, ep = USBD->EP; ep_index < PERIPH_MAX_EP; ep_index++, ep++)
- {
- if (add)
- {
- /* take first peripheral endpoint that is unused */
- if (0 == (ep->CFG & USBD_CFG_STATE_Msk)) return ep;
- }
- else
- {
- /* find a peripheral endpoint that matches ep_addr */
- uint8_t candidate_ep_addr = decode_ep_addr(ep);
- if (candidate_ep_addr == ep_addr) return ep;
- }
- }
-
- return NULL;
-}
-
-/* perform an IN endpoint transfer; this is called by dcd_edpt_xfer() and the ISR */
-static void dcd_in_xfer(struct xfer_ctl_t *xfer, USBD_EP_T *ep)
-{
- uint16_t bytes_now = tu_min16(xfer->in_remaining_bytes, xfer->max_packet_size);
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- tu_fifo_read_n(xfer->ff, (void *) (USBD_BUF_BASE + ep->BUFSEG), bytes_now);
- }
- else
-#endif
- {
- // USB SRAM seems to only support byte access and memcpy could possibly do it by words
- usb_memcpy((uint8_t *)(USBD_BUF_BASE + ep->BUFSEG), xfer->data_ptr, bytes_now);
- }
-
- ep->MXPLD = bytes_now;
-}
-
-/* called by dcd_init() as well as by the ISR during a USB bus reset */
-static void bus_reset(void)
-{
- USBD->STBUFSEG = PERIPH_SETUP_BUF_BASE;
-
- for (enum ep_enum ep_index = PERIPH_EP0; ep_index < PERIPH_MAX_EP; ep_index++)
- {
- USBD->EP[ep_index].CFG = 0;
- USBD->EP[ep_index].CFGP = 0;
- }
-
- /* allocate the default EP0 endpoints */
-
- USBD->EP[PERIPH_EP0].CFG = USBD_CFG_CSTALL_Msk | USBD_CFG_EPMODE_IN;
- USBD->EP[PERIPH_EP0].BUFSEG = PERIPH_EP0_BUF_BASE;
- xfer_table[PERIPH_EP0].max_packet_size = PERIPH_EP0_BUF_LEN;
-
- USBD->EP[PERIPH_EP1].CFG = USBD_CFG_CSTALL_Msk | USBD_CFG_EPMODE_OUT;
- USBD->EP[PERIPH_EP1].BUFSEG = PERIPH_EP1_BUF_BASE;
- xfer_table[PERIPH_EP1].max_packet_size = PERIPH_EP1_BUF_LEN;
-
- /* USB RAM beyond what we've allocated above is available to the user */
- bufseg_addr = PERIPH_EP2_BUF_BASE;
-
- /* Reset USB device address */
- USBD->FADDR = 0;
-
- /* reset EP0_IN flag */
- active_ep0_xfer = false;
-}
-
-/* centralized location for USBD interrupt enable bit mask */
-#if USE_SOF
-static const uint32_t enabled_irqs = USBD_INTSTS_VBDETIF_Msk | USBD_INTSTS_BUSIF_Msk | USBD_INTSTS_SETUP_Msk | USBD_INTSTS_USBIF_Msk | USBD_INTSTS_SOFIF_Msk;
-#else
-static const uint32_t enabled_irqs = USBD_INTSTS_VBDETIF_Msk | USBD_INTSTS_BUSIF_Msk | USBD_INTSTS_SETUP_Msk | USBD_INTSTS_USBIF_Msk;
-#endif
-
-/*
- NUC121/NUC125/NUC126 TinyUSB API driver implementation
-*/
-
-void dcd_init(uint8_t rhport)
-{
- (void) rhport;
-
-#ifdef SUPPORT_LPM
- USBD->ATTR = 0x7D0 | USBD_LPMACK;
-#else
- USBD->ATTR = 0x7D0;
-#endif
-
- usb_detach();
-
- bus_reset();
-
- usb_attach();
-
- USBD->INTSTS = enabled_irqs;
- USBD->INTEN = enabled_irqs;
-}
-
-void dcd_int_enable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_EnableIRQ(USBD_IRQn);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ(USBD_IRQn);
-}
-
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
- (void) dev_addr;
- usb_control_send_zlp(); /* SET_ADDRESS is the one exception where TinyUSB doesn't use dcd_edpt_xfer() to generate a ZLP */
-
- // DCD can only set address after status for this request is complete.
- // do it at dcd_edpt0_status_complete()
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
- USBD->ATTR = USBD_ATTR_RWAKEUP_Msk;
-}
-
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
-{
- (void) rhport;
-
- USBD_EP_T *ep = ep_entry(p_endpoint_desc->bEndpointAddress, true);
- TU_ASSERT(ep);
-
- /* mine the data for the information we need */
- int const dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress);
- int const size = p_endpoint_desc->wMaxPacketSize.size;
- tusb_xfer_type_t const type = (tusb_xfer_type_t) p_endpoint_desc->bmAttributes.xfer;
- struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP];
-
- /* allocate buffer from USB RAM */
- ep->BUFSEG = bufseg_addr;
- bufseg_addr += size;
- TU_ASSERT(bufseg_addr <= USBD_BUF_SIZE);
-
- /* construct USB Configuration Register value and then write it */
- uint32_t cfg = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
- cfg |= (TUSB_DIR_IN == dir) ? USBD_CFG_EPMODE_IN : USBD_CFG_EPMODE_OUT;
- if (TUSB_XFER_ISOCHRONOUS == type)
- cfg |= USBD_CFG_TYPE_ISO;
- ep->CFG = cfg;
-
- /* make a note of the endpoint size */
- xfer->max_packet_size = size;
-
- return true;
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t total_bytes)
-{
- (void) rhport;
-
- /* mine the data for the information we need */
- tusb_dir_t dir = tu_edpt_dir(ep_addr);
- USBD_EP_T *ep = ep_entry(ep_addr, false);
- struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP];
-
- /* store away the information we'll needing now and later */
- xfer->data_ptr = buffer;
- // xfer->ff = NULL; // TODO support dcd_edpt_xfer_fifo API
- xfer->in_remaining_bytes = total_bytes;
- xfer->total_bytes = total_bytes;
-
- /* for the first of one or more EP0_IN packets in a message, the first must be DATA1 */
- if ( (0x80 == ep_addr) && !active_ep0_xfer ) ep->CFG |= USBD_CFG_DSQSYNC_Msk;
-
- if (TUSB_DIR_IN == dir)
- {
- dcd_in_xfer(xfer, ep);
- }
- else
- {
- xfer->out_bytes_so_far = 0;
- ep->MXPLD = xfer->max_packet_size;
- }
-
- return true;
-}
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
-bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
-{
- (void) rhport;
-
- /* mine the data for the information we need */
- tusb_dir_t dir = tu_edpt_dir(ep_addr);
- USBD_EP_T *ep = ep_entry(ep_addr, false);
- struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP];
-
- /* store away the information we'll needing now and later */
- xfer->data_ptr = NULL; // Indicates a FIFO shall be used
- xfer->ff = ff;
- xfer->in_remaining_bytes = total_bytes;
- xfer->total_bytes = total_bytes;
-
- if (TUSB_DIR_IN == dir)
- {
- dcd_in_xfer(xfer, ep);
- }
- else
- {
- xfer->out_bytes_so_far = 0;
- ep->MXPLD = xfer->max_packet_size;
- }
-
- return true;
-}
-#endif
-
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- USBD_EP_T *ep = ep_entry(ep_addr, false);
- ep->CFGP |= USBD_CFGP_SSTALL_Msk;
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- USBD_EP_T *ep = ep_entry(ep_addr, false);
- ep->CFG |= USBD_CFG_CSTALL_Msk;
-}
-
-void dcd_int_handler(uint8_t rhport)
-{
- (void) rhport;
-
- uint32_t status = USBD->INTSTS;
-#ifdef SUPPORT_LPM
- uint32_t state = USBD->ATTR & 0x300f;
-#else
- uint32_t state = USBD->ATTR & 0xf;
-#endif
-
- if(status & USBD_INTSTS_VBDETIF_Msk)
- {
- if(USBD->VBUSDET & USBD_VBUSDET_VBUSDET_Msk)
- {
- /* USB connect */
- USBD->ATTR |= USBD_ATTR_USBEN_Msk | USBD_ATTR_PHYEN_Msk;
- }
- else
- {
- /* USB disconnect */
- USBD->ATTR &= ~USBD_ATTR_USBEN_Msk;
- }
- }
-
- if(status & USBD_INTSTS_BUSIF_Msk)
- {
- if(state & USBD_ATTR_USBRST_Msk)
- {
- /* USB bus reset */
- USBD->ATTR |= USBD_ATTR_USBEN_Msk | USBD_ATTR_PHYEN_Msk;
-
- bus_reset();
-
- dcd_event_bus_reset(0, TUSB_SPEED_FULL, true);
- }
-
- if(state & USBD_ATTR_SUSPEND_Msk)
- {
- /* Enable USB but disable PHY */
- USBD->ATTR &= ~USBD_ATTR_PHYEN_Msk;
- dcd_event_bus_signal(0, DCD_EVENT_SUSPEND, true);
- }
-
- if(state & USBD_ATTR_RESUME_Msk)
- {
- /* Enable USB and enable PHY */
- USBD->ATTR |= USBD_ATTR_USBEN_Msk | USBD_ATTR_PHYEN_Msk;
- dcd_event_bus_signal(0, DCD_EVENT_RESUME, true);
- }
- }
-
- if(status & USBD_INTSTS_SETUP_Msk)
- {
- /* clear the data ready flag of control endpoints */
- USBD->EP[PERIPH_EP0].CFGP |= USBD_CFGP_CLRRDY_Msk;
- USBD->EP[PERIPH_EP1].CFGP |= USBD_CFGP_CLRRDY_Msk;
-
- /* get SETUP packet from USB buffer */
- dcd_event_setup_received(0, (uint8_t *)USBD_BUF_BASE, true);
- }
-
- if(status & USBD_INTSTS_USBIF_Msk)
- {
- if (status & USBD_INTSTS_EPEVT0_Msk) /* PERIPH_EP0 (EP0_IN) event: this is treated separately from the rest */
- {
- uint16_t const available_bytes = USBD->EP[PERIPH_EP0].MXPLD;
-
- active_ep0_xfer = (available_bytes == xfer_table[PERIPH_EP0].max_packet_size);
-
- dcd_event_xfer_complete(0, 0x80, available_bytes, XFER_RESULT_SUCCESS, true);
- }
-
- /* service PERIPH_EP1 through PERIPH_EP7 */
- enum ep_enum ep_index;
- uint32_t mask;
- struct xfer_ctl_t *xfer;
- USBD_EP_T *ep;
- for (ep_index = PERIPH_EP1, mask = USBD_INTSTS_EPEVT1_Msk, xfer = &xfer_table[PERIPH_EP1], ep = &USBD->EP[PERIPH_EP1]; ep_index <= PERIPH_EP7; ep_index++, mask <<= 1, xfer++, ep++)
- {
- if(status & mask)
- {
- USBD->INTSTS = mask;
-
- uint16_t const available_bytes = ep->MXPLD;
- uint8_t const ep_addr = decode_ep_addr(ep);
- bool const out_ep = !(ep_addr & TUSB_DIR_IN_MASK);
-
- if (out_ep)
- {
- /* copy the data from the PC to the previously provided buffer */
-#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- tu_fifo_write_n(xfer->ff, (const void *) (USBD_BUF_BASE + ep->BUFSEG), available_bytes);
- }
- else
-#endif
- {
- // USB SRAM seems to only support byte access and memcpy could possibly do it by words
- usb_memcpy(xfer->data_ptr, (uint8_t *)(USBD_BUF_BASE + ep->BUFSEG), available_bytes);
- xfer->data_ptr += available_bytes;
- }
-
- xfer->out_bytes_so_far += available_bytes;
-
- /* when the transfer is finished, alert TinyUSB; otherwise, accept more data */
- if ( (xfer->total_bytes == xfer->out_bytes_so_far) || (available_bytes < xfer->max_packet_size) )
- dcd_event_xfer_complete(0, ep_addr, xfer->out_bytes_so_far, XFER_RESULT_SUCCESS, true);
- else
- ep->MXPLD = xfer->max_packet_size;
- }
- else
- {
- /* update the bookkeeping to reflect the data that has now been sent to the PC */
- xfer->in_remaining_bytes -= available_bytes;
- xfer->data_ptr += available_bytes;
-
- /* if more data to send, send it; otherwise, alert TinyUSB that we've finished */
- if (xfer->in_remaining_bytes)
- dcd_in_xfer(xfer, ep);
- else
- dcd_event_xfer_complete(0, ep_addr, xfer->total_bytes, XFER_RESULT_SUCCESS, true);
- }
- }
- }
- }
-
- if(status & USBD_INTSTS_SOFIF_Msk)
- {
- /* Start-Of-Frame event */
- dcd_event_bus_signal(0, DCD_EVENT_SOF, true);
- }
-
- /* acknowledge all interrupts */
- USBD->INTSTS = status & enabled_irqs;
-}
-
-// Invoked when a control transfer's status stage is complete.
-// May help DCD to prepare for next control transfer, this API is optional.
-void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * request)
-{
- (void) rhport;
-
- if (request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_DEVICE &&
- request->bmRequestType_bit.type == TUSB_REQ_TYPE_STANDARD &&
- request->bRequest == TUSB_REQ_SET_ADDRESS )
- {
- uint8_t const dev_addr = (uint8_t) request->wValue;
-
- // Setting new address after the whole request is complete
- USBD->FADDR = dev_addr;
- }
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- usb_detach();
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- usb_attach();
-}
-
-#endif
diff --git a/tinyusb/src/portable/nuvoton/nuc505/dcd_nuc505.c b/tinyusb/src/portable/nuvoton/nuc505/dcd_nuc505.c
deleted file mode 100755
index 4e633086..00000000
--- a/tinyusb/src/portable/nuvoton/nuc505/dcd_nuc505.c
+++ /dev/null
@@ -1,712 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Peter Lawrence
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/*
- Theory of operation:
-
- The NUC505 USBD peripheral has twelve "EP"s, where each is simplex, in addition
- to dedicated support for the control endpoint (EP0). The non-user endpoints
- are referred to as "user" EPs in this code, and follow the datasheet
- nomenclature of EPA through EPL.
-*/
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && (CFG_TUSB_MCU == OPT_MCU_NUC505)
-
-#include "device/dcd.h"
-#include "NUC505Series.h"
-
-/*
- * The DMA functionality of the USBD peripheral does not appear to succeed with
- * transfer lengths that are longer (> 64 bytes) and are not a multiple of 4.
- * Keep disabled for now.
- */
-#define USE_DMA 0
-
-/* rather important info unfortunately not provided by device include files */
-#define USBD_BUF_SIZE 2048 /* how much USB buffer space there is */
-#define USBD_MAX_DMA_LEN 0x1000 /* max bytes that can be DMAed at one time */
-
-enum ep_enum
-{
- PERIPH_EPA = 0,
- PERIPH_EPB = 1,
- PERIPH_EPC = 2,
- PERIPH_EPD = 3,
- PERIPH_EPE = 4,
- PERIPH_EPF = 5,
- PERIPH_EPG = 6,
- PERIPH_EPH = 7,
- PERIPH_EPI = 8,
- PERIPH_EPJ = 9,
- PERIPH_EPK = 10,
- PERIPH_EPL = 11,
- PERIPH_MAX_EP,
-};
-
-static const uint8_t epcfg_eptype_table[] =
-{
- [TUSB_XFER_CONTROL] = 0, /* won't happen, since control EPs have dedicated registers */
- [TUSB_XFER_ISOCHRONOUS] = 3 << USBD_EPCFG_EPTYPE_Pos,
- [TUSB_XFER_BULK] = 1 << USBD_EPCFG_EPTYPE_Pos,
- [TUSB_XFER_INTERRUPT] = 2 << USBD_EPCFG_EPTYPE_Pos,
-};
-
-static const uint8_t eprspctl_eptype_table[] =
-{
- [TUSB_XFER_CONTROL] = 0, /* won't happen, since control EPs have dedicated registers */
- [TUSB_XFER_ISOCHRONOUS] = 2 << USBD_EPRSPCTL_MODE_Pos, /* Fly Mode */
- [TUSB_XFER_BULK] = 0 << USBD_EPRSPCTL_MODE_Pos, /* Auto-Validate Mode */
- [TUSB_XFER_INTERRUPT] = 1 << USBD_EPRSPCTL_MODE_Pos, /* Manual-Validate Mode */
-};
-
-/* set by dcd_set_address() */
-static volatile uint8_t assigned_address;
-
-/* reset by bus_reset(), this is used by dcd_edpt_open() to assign USBD peripheral buffer addresses */
-static uint32_t bufseg_addr;
-
-/* RAM table needed to track ongoing transfers performed by dcd_edpt_xfer(), dcd_userEP_in_xfer(), and the ISR */
-static struct xfer_ctl_t
-{
- uint8_t *data_ptr; /* data_ptr tracks where to next copy data to (for OUT) or from (for IN) */
- // tu_fifo_t* ff; // TODO support dcd_edpt_xfer_fifo API
- union {
- uint16_t in_remaining_bytes; /* for IN endpoints, we track how many bytes are left to transfer */
- uint16_t out_bytes_so_far; /* but for OUT endpoints, we track how many bytes we've transferred so far */
- };
- uint16_t max_packet_size; /* needed since device driver only finds out this at runtime */
- uint16_t total_bytes; /* quantity needed to pass as argument to dcd_event_xfer_complete() (for IN endpoints) */
- uint8_t ep_addr;
- bool dma_requested;
-} xfer_table[PERIPH_MAX_EP];
-
-/* in addition to xfer_table, additional bespoke bookkeeping is maintained for control EP0 IN */
-static struct
-{
- uint8_t *data_ptr;
- uint16_t in_remaining_bytes;
- uint16_t total_bytes;
-} ctrl_in_xfer;
-
-static volatile struct xfer_ctl_t *current_dma_xfer;
-
-
-/*
- local helper functions
-*/
-
-static void usb_attach(void)
-{
- USBD->PHYCTL |= USBD_PHYCTL_DPPUEN_Msk;
-}
-
-static void usb_detach(void)
-{
- USBD->PHYCTL &= ~USBD_PHYCTL_DPPUEN_Msk;
-}
-
-static void usb_control_send_zlp(void)
-{
- USBD->CEPINTSTS = USBD_CEPINTSTS_STSDONEIF_Msk;
- USBD->CEPCTL = 0; /* clear NAKCLR bit */
- USBD->CEPINTEN = USBD_CEPINTEN_STSDONEIEN_Msk;
-}
-
-/* map 8-bit ep_addr into peripheral endpoint index (PERIPH_EPA...) */
-static USBD_EP_T *ep_entry(uint8_t ep_addr, bool add)
-{
- USBD_EP_T *ep;
- enum ep_enum ep_index;
- struct xfer_ctl_t *xfer;
-
- for (ep_index = PERIPH_EPA, xfer = &xfer_table[PERIPH_EPA], ep = USBD->EP; ep_index < PERIPH_MAX_EP; ep_index++, xfer++, ep++)
- {
- if (add)
- {
- /* take first peripheral endpoint that is unused */
- if (0 == (ep->EPCFG & USBD_EPCFG_EPEN_Msk)) return ep;
- }
- else
- {
- /* find a peripheral endpoint that matches ep_addr */
- if (xfer->ep_addr == ep_addr) return ep;
- }
- }
-
- return NULL;
-}
-
-/* perform a non-control IN endpoint transfer; this is called by the ISR */
-static void dcd_userEP_in_xfer(struct xfer_ctl_t *xfer, USBD_EP_T *ep)
-{
- uint16_t const bytes_now = tu_min16(xfer->in_remaining_bytes, xfer->max_packet_size);
-
- /* precompute what amount of data will be left */
- xfer->in_remaining_bytes -= bytes_now;
-
- /*
- if there will be no more data to send, we replace the BUFEMPTYIF EP interrupt with TXPKIF;
- that way, we alert TinyUSB as soon as this last packet has been sent
- */
- if (0 == xfer->in_remaining_bytes)
- {
- ep->EPINTSTS = USBD_EPINTSTS_TXPKIF_Msk;
- ep->EPINTEN = USBD_EPINTEN_TXPKIEN_Msk;
- }
-
- /* provided buffers are thankfully 32-bit aligned, allowing most data to be transfered as 32-bit */
-#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- tu_fifo_read_n_const_addr_full_words(xfer->ff, (void *) (&ep->EPDAT_BYTE), bytes_now);
- }
- else
-#endif
- {
- uint16_t countdown = bytes_now;
- while (countdown > 3)
- {
- uint32_t u32;
- memcpy(&u32, xfer->data_ptr, 4);
-
- ep->EPDAT = u32;
- xfer->data_ptr += 4; countdown -= 4;
- }
-
- while (countdown--) ep->EPDAT_BYTE = *xfer->data_ptr++;
- }
-
- /* for short packets, we must nudge the peripheral to say 'that's all folks' */
- if (bytes_now != xfer->max_packet_size) ep->EPRSPCTL = USBD_EPRSPCTL_SHORTTXEN_Msk;
-}
-
-/* called by dcd_init() as well as by the ISR during a USB bus reset */
-static void bus_reset(void)
-{
- for (enum ep_enum ep_index = PERIPH_EPA; ep_index < PERIPH_MAX_EP; ep_index++)
- {
- USBD->EP[ep_index].EPCFG = 0;
- xfer_table[ep_index].dma_requested = false;
- }
-
- USBD->DMACNT = 0;
- USBD->DMACTL = USBD_DMACTL_DMARST_Msk;
- USBD->DMACTL = 0;
-
- /* allocate the default EP0 endpoints */
-
- USBD->CEPBUFSTART = 0;
- USBD->CEPBUFEND = 0 + CFG_TUD_ENDPOINT0_SIZE - 1;
-
- /* USB RAM beyond what we've allocated above is available to the user */
- bufseg_addr = CFG_TUD_ENDPOINT0_SIZE;
-
- /* Reset USB device address */
- USBD->FADDR = 0;
-
- current_dma_xfer = NULL;
-}
-
-#if USE_DMA
-/* this must only be called by the ISR; it does its best to share the single DMA engine across all user EPs (IN and OUT) */
-static void service_dma(void)
-{
- if (current_dma_xfer)
- return;
-
- enum ep_enum ep_index;
- struct xfer_ctl_t *xfer;
- USBD_EP_T *ep;
-
- for (ep_index = PERIPH_EPA, xfer = &xfer_table[PERIPH_EPA], ep = &USBD->EP[PERIPH_EPA]; ep_index < PERIPH_MAX_EP; ep_index++, xfer++, ep++)
- {
- uint16_t const available_bytes = ep->EPDATCNT & USBD_EPDATCNT_DATCNT_Msk;
-
- if (!xfer->dma_requested || !available_bytes)
- continue;
-
- /*
- instruct DMA to copy the data from the PC to the previously provided buffer
- when the bus interrupt DMADONEIEN subsequently fires, the transfer will have finished
- */
- USBD->DMACTL = xfer->ep_addr & USBD_DMACTL_EPNUM_Msk;
- USBD->DMAADDR = (uint32_t)xfer->data_ptr;
- USBD->DMACNT = available_bytes;
- USBD->BUSINTSTS = USBD_BUSINTSTS_DMADONEIF_Msk;
- xfer->out_bytes_so_far += available_bytes;
- current_dma_xfer = xfer;
- USBD->DMACTL |= USBD_DMACTL_DMAEN_Msk;
-
- return;
- }
-}
-#endif
-
-/* centralized location for USBD interrupt enable bit masks */
-static const uint32_t enabled_irqs = USBD_GINTEN_USBIEN_Msk | \
- USBD_GINTEN_EPAIEN_Msk | USBD_GINTEN_EPBIEN_Msk | USBD_GINTEN_EPCIEN_Msk | USBD_GINTEN_EPDIEN_Msk | USBD_GINTEN_EPEIEN_Msk | USBD_GINTEN_EPFIEN_Msk | \
- USBD_GINTEN_EPGIEN_Msk | USBD_GINTEN_EPHIEN_Msk | USBD_GINTEN_EPIIEN_Msk | USBD_GINTEN_EPJIEN_Msk | USBD_GINTEN_EPKIEN_Msk | USBD_GINTEN_EPLIEN_Msk | \
- USBD_GINTEN_CEPIEN_Msk;
-
-/*
- NUC505 TinyUSB API driver implementation
-*/
-
-void dcd_init(uint8_t rhport)
-{
- (void) rhport;
-
- /* configure interrupts in their initial state; BUSINTEN and CEPINTEN will be subsequently and dynamically re-written as needed */
- USBD->GINTEN = enabled_irqs;
- USBD->BUSINTEN = USBD_BUSINTEN_RSTIEN_Msk | USBD_BUSINTEN_VBUSDETIEN_Msk | USBD_BUSINTEN_RESUMEIEN_Msk | USBD_BUSINTEN_DMADONEIEN_Msk;
- USBD->CEPINTEN = 0;
-
- bus_reset();
-
- usb_attach();
-}
-
-void dcd_int_enable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_EnableIRQ(USBD_IRQn);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ(USBD_IRQn);
-}
-
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
- usb_control_send_zlp(); /* SET_ADDRESS is the one exception where TinyUSB doesn't use dcd_edpt_xfer() to generate a ZLP */
- assigned_address = dev_addr;
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
- USBD->OPER |= USBD_OPER_RESUMEEN_Msk;
-}
-
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
-{
- (void) rhport;
-
- USBD_EP_T *ep = ep_entry(p_endpoint_desc->bEndpointAddress, true);
- TU_ASSERT(ep);
-
- /* mine the data for the information we need */
- int const dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress);
- int const size = p_endpoint_desc->wMaxPacketSize.size;
- tusb_xfer_type_t const type = p_endpoint_desc->bmAttributes.xfer;
- struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP];
-
- /* allocate buffer from USB RAM */
- ep->EPBUFSTART = bufseg_addr;
- bufseg_addr += size;
- ep->EPBUFEND = bufseg_addr - 1;
- TU_ASSERT(bufseg_addr <= USBD_BUF_SIZE);
-
- ep->EPMPS = size;
-
- ep->EPRSPCTL = USB_EP_RSPCTL_FLUSH | eprspctl_eptype_table[type];
-
- /* construct USB Configuration Register value and then write it */
- uint32_t cfg = (uint32_t)tu_edpt_number(p_endpoint_desc->bEndpointAddress) << USBD_EPCFG_EPNUM_Pos;
- if (TUSB_DIR_IN == dir)
- cfg |= USBD_EPCFG_EPDIR_Msk;
- cfg |= epcfg_eptype_table[type] | USBD_EPCFG_EPEN_Msk;
- ep->EPCFG = cfg;
-
- /* make a note of the endpoint particulars */
- xfer->max_packet_size = size;
- xfer->ep_addr = p_endpoint_desc->bEndpointAddress;
-
- return true;
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t total_bytes)
-{
- (void) rhport;
-
- if (0x80 == ep_addr) /* control EP0 IN */
- {
- if (total_bytes)
- {
- USBD->CEPCTL = USBD_CEPCTL_FLUSH_Msk;
- ctrl_in_xfer.data_ptr = buffer;
- ctrl_in_xfer.in_remaining_bytes = total_bytes;
- ctrl_in_xfer.total_bytes = total_bytes;
- USBD->CEPINTSTS = USBD_CEPINTSTS_INTKIF_Msk;
- USBD->CEPINTEN = USBD_CEPINTEN_INTKIEN_Msk;
- }
- else
- {
- usb_control_send_zlp();
- }
- }
- else if (0x00 == ep_addr) /* control EP0 OUT */
- {
- if (total_bytes)
- {
- /* if TinyUSB is asking for EP0 OUT data, it is almost certainly already in the buffer */
- while (total_bytes < USBD->CEPRXCNT);
- for (int count = 0; count < total_bytes; count++)
- *buffer++ = USBD->CEPDAT_BYTE;
-
- dcd_event_xfer_complete(0, ep_addr, total_bytes, XFER_RESULT_SUCCESS, true);
- }
- }
- else
- {
- /* mine the data for the information we need */
- tusb_dir_t dir = tu_edpt_dir(ep_addr);
- USBD_EP_T *ep = ep_entry(ep_addr, false);
- struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP];
-
- /* store away the information we'll needing now and later */
- xfer->data_ptr = buffer;
- // xfer->ff = NULL; // TODO support dcd_edpt_xfer_fifo API
- xfer->in_remaining_bytes = total_bytes;
- xfer->total_bytes = total_bytes;
-
- if (TUSB_DIR_IN == dir)
- {
- ep->EPINTEN = USBD_EPINTEN_BUFEMPTYIEN_Msk;
- }
- else
- {
- xfer->out_bytes_so_far = 0;
- ep->EPINTEN = USBD_EPINTEN_RXPKIEN_Msk;
- }
- }
-
- return true;
-}
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
-bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
-{
- (void) rhport;
-
- TU_ASSERT(0x80 != ep_addr && 0x00 != ep_addr); // Must not be used for control stuff
-
- /* mine the data for the information we need */
- tusb_dir_t dir = tu_edpt_dir(ep_addr);
- USBD_EP_T *ep = ep_entry(ep_addr, false);
- struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP];
-
- /* store away the information we'll needing now and later */
- xfer->data_ptr = NULL; // Indicates a FIFO shall be used
- xfer->ff = ff;
- xfer->in_remaining_bytes = total_bytes;
- xfer->total_bytes = total_bytes;
-
- if (TUSB_DIR_IN == dir)
- {
- ep->EPINTEN = USBD_EPINTEN_BUFEMPTYIEN_Msk;
- }
- else
- {
- xfer->out_bytes_so_far = 0;
- ep->EPINTEN = USBD_EPINTEN_RXPKIEN_Msk;
- }
-
- return true;
-}
-#endif
-
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- if (tu_edpt_number(ep_addr))
- {
- USBD_EP_T *ep = ep_entry(ep_addr, false);
- ep->EPRSPCTL = (ep->EPRSPCTL & 0xf7) | USBD_EPRSPCTL_HALT_Msk;
- }
- else
- {
- USBD->CEPCTL = USBD_CEPCTL_STALLEN_Msk;
- }
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- if (tu_edpt_number(ep_addr))
- {
- USBD_EP_T *ep = ep_entry(ep_addr, false);
- ep->EPRSPCTL = USBD_EPRSPCTL_TOGGLE_Msk;
- }
-}
-
-void dcd_int_handler(uint8_t rhport)
-{
- (void) rhport;
-
- uint32_t status = USBD->GINTSTS;
-
- /* USB interrupt */
- if (status & USBD_GINTSTS_USBIF_Msk)
- {
- uint32_t bus_state = USBD->BUSINTSTS;
-
- if (bus_state & USBD_BUSINTSTS_SOFIF_Msk)
- {
- /* Start-Of-Frame event */
- dcd_event_bus_signal(0, DCD_EVENT_SOF, true);
- }
-
- if (bus_state & USBD_BUSINTSTS_RSTIF_Msk)
- {
- bus_reset();
-
- USBD->CEPINTEN = USBD_CEPINTEN_SETUPPKIEN_Msk;
- USBD->BUSINTEN = USBD_BUSINTEN_RSTIEN_Msk | USBD_BUSINTEN_RESUMEIEN_Msk | USBD_BUSINTEN_SUSPENDIEN_Msk | USBD_BUSINTEN_DMADONEIEN_Msk;
- USBD->CEPINTSTS = 0x1ffc;
-
- tusb_speed_t speed = (USBD->OPER & USBD_OPER_CURSPD_Msk) ? TUSB_SPEED_HIGH : TUSB_SPEED_FULL;
- dcd_event_bus_reset(0, speed, true);
- }
-
- if (bus_state & USBD_BUSINTSTS_RESUMEIF_Msk)
- {
- USBD->BUSINTEN = USBD_BUSINTEN_RSTIEN_Msk | USBD_BUSINTEN_SUSPENDIEN_Msk | USBD_BUSINTEN_DMADONEIEN_Msk;
- dcd_event_bus_signal(0, DCD_EVENT_RESUME, true);
- }
-
- if (bus_state & USBD_BUSINTSTS_SUSPENDIF_Msk)
- {
- USBD->BUSINTEN = USBD_BUSINTEN_RSTIEN_Msk | USBD_BUSINTEN_RESUMEIEN_Msk | USBD_BUSINTEN_DMADONEIEN_Msk;
- dcd_event_bus_signal(0, DCD_EVENT_SUSPEND, true);
- }
-
- if (bus_state & USBD_BUSINTSTS_HISPDIF_Msk)
- {
- USBD->CEPINTEN = USBD_CEPINTEN_SETUPPKIEN_Msk;
- }
-
- if (bus_state & USBD_BUSINTSTS_DMADONEIF_Msk)
- {
-#if USE_DMA
- if (current_dma_xfer)
- {
- current_dma_xfer->dma_requested = false;
-
- uint16_t available_bytes = USBD->DMACNT & USBD_DMACNT_DMACNT_Msk;
-
- /* if the most recent DMA finishes the transfer, alert TinyUSB; otherwise, the next RXPKIF/INTKIF endpoint interrupt will prompt the next DMA */
- if ( (current_dma_xfer->total_bytes == current_dma_xfer->out_bytes_so_far) || (available_bytes < current_dma_xfer->max_packet_size) )
- {
- dcd_event_xfer_complete(0, current_dma_xfer->ep_addr, current_dma_xfer->out_bytes_so_far, XFER_RESULT_SUCCESS, true);
- }
-
- current_dma_xfer = NULL;
- service_dma();
- }
-#endif
- }
-
- if (bus_state & USBD_BUSINTSTS_VBUSDETIF_Msk)
- {
- if (USBD->PHYCTL & USBD_PHYCTL_VBUSDET_Msk)
- {
- /* USB connect */
- USBD->PHYCTL |= USBD_PHYCTL_PHYEN_Msk | USBD_PHYCTL_DPPUEN_Msk;
- }
- else
- {
- /* USB disconnect */
- USBD->PHYCTL &= ~USBD_PHYCTL_DPPUEN_Msk;
- }
- }
-
- USBD->BUSINTSTS = bus_state & (USBD_BUSINTSTS_SOFIF_Msk | USBD_BUSINTSTS_RSTIF_Msk | USBD_BUSINTSTS_RESUMEIF_Msk | USBD_BUSINTSTS_SUSPENDIF_Msk | USBD_BUSINTSTS_HISPDIF_Msk | USBD_BUSINTSTS_DMADONEIF_Msk | USBD_BUSINTSTS_PHYCLKVLDIF_Msk | USBD_BUSINTSTS_VBUSDETIF_Msk);
- }
-
- if (status & USBD_GINTSTS_CEPIF_Msk)
- {
- uint32_t cep_state = USBD->CEPINTSTS & USBD->CEPINTEN;
-
- if (cep_state & USBD_CEPINTSTS_SETUPPKIF_Msk)
- {
- /* get SETUP packet from USB buffer */
- uint8_t setup_packet[8];
- setup_packet[0] = (uint8_t)(USBD->SETUP1_0 >> 0);
- setup_packet[1] = (uint8_t)(USBD->SETUP1_0 >> 8);
- setup_packet[2] = (uint8_t)(USBD->SETUP3_2 >> 0);
- setup_packet[3] = (uint8_t)(USBD->SETUP3_2 >> 8);
- setup_packet[4] = (uint8_t)(USBD->SETUP5_4 >> 0);
- setup_packet[5] = (uint8_t)(USBD->SETUP5_4 >> 8);
- setup_packet[6] = (uint8_t)(USBD->SETUP7_6 >> 0);
- setup_packet[7] = (uint8_t)(USBD->SETUP7_6 >> 8);
- dcd_event_setup_received(0, setup_packet, true);
- }
- else if (cep_state & USBD_CEPINTSTS_INTKIF_Msk)
- {
- USBD->CEPINTSTS = USBD_CEPINTSTS_TXPKIF_Msk;
-
- if (!(cep_state & USBD_CEPINTSTS_STSDONEIF_Msk))
- {
- USBD->CEPINTEN = USBD_CEPINTEN_TXPKIEN_Msk;
- uint16_t bytes_now = tu_min16(ctrl_in_xfer.in_remaining_bytes, CFG_TUD_ENDPOINT0_SIZE);
- for (int count = 0; count < bytes_now; count++)
- USBD->CEPDAT_BYTE = *ctrl_in_xfer.data_ptr++;
- ctrl_in_xfer.in_remaining_bytes -= bytes_now;
- USBD_START_CEP_IN(bytes_now);
- }
- else
- {
- USBD->CEPINTEN = USBD_CEPINTEN_TXPKIEN_Msk | USBD_CEPINTEN_STSDONEIEN_Msk;
- }
- }
- else if (cep_state & USBD_CEPINTSTS_TXPKIF_Msk)
- {
- USBD->CEPINTSTS = USBD_CEPINTSTS_STSDONEIF_Msk;
- USBD_SET_CEP_STATE(USB_CEPCTL_NAKCLR);
-
- /* alert TinyUSB that the EP0 IN transfer has finished */
- if ( (0 == ctrl_in_xfer.in_remaining_bytes) || (0 == ctrl_in_xfer.total_bytes) )
- dcd_event_xfer_complete(0, 0x80, ctrl_in_xfer.total_bytes, XFER_RESULT_SUCCESS, true);
-
- if (ctrl_in_xfer.in_remaining_bytes)
- {
- USBD->CEPINTSTS = USBD_CEPINTSTS_INTKIF_Msk;
- USBD->CEPINTEN = USBD_CEPINTEN_INTKIEN_Msk;
- }
- else
- {
- /* TinyUSB does its own fragmentation and ZLP for EP0; a transfer of zero means a ZLP */
- if (0 == ctrl_in_xfer.total_bytes) USBD->CEPCTL = USBD_CEPCTL_ZEROLEN_Msk;
-
- USBD->CEPINTSTS = USBD_CEPINTSTS_STSDONEIF_Msk;
- USBD->CEPINTEN = USBD_CEPINTEN_SETUPPKIEN_Msk | USBD_CEPINTEN_STSDONEIEN_Msk;
- }
- }
- else if (cep_state & USBD_CEPINTSTS_STSDONEIF_Msk)
- {
- /* given ACK from host has happened, we can now set the address (if not already done) */
- if((USBD->FADDR != assigned_address) && (USBD->FADDR == 0))
- {
- USBD->FADDR = assigned_address;
-
- for (enum ep_enum ep_index = PERIPH_EPA; ep_index < PERIPH_MAX_EP; ep_index++)
- {
- if (USBD->EP[ep_index].EPCFG & USBD_EPCFG_EPEN_Msk) USBD->EP[ep_index].EPRSPCTL = USBD_EPRSPCTL_TOGGLE_Msk;
- }
- }
-
- USBD->CEPINTEN = USBD_CEPINTEN_SETUPPKIEN_Msk;
- }
-
- USBD->CEPINTSTS = cep_state;
-
- return;
- }
-
- if (status & (USBD_GINTSTS_EPAIF_Msk | USBD_GINTSTS_EPBIF_Msk | USBD_GINTSTS_EPCIF_Msk | USBD_GINTSTS_EPDIF_Msk | USBD_GINTSTS_EPEIF_Msk | USBD_GINTSTS_EPFIF_Msk | USBD_GINTSTS_EPGIF_Msk | USBD_GINTSTS_EPHIF_Msk | USBD_GINTSTS_EPIIF_Msk | USBD_GINTSTS_EPJIF_Msk | USBD_GINTSTS_EPKIF_Msk | USBD_GINTSTS_EPLIF_Msk))
- {
- /* service PERIPH_EPA through PERIPH_EPL */
- enum ep_enum ep_index;
- uint32_t mask;
- struct xfer_ctl_t *xfer;
- USBD_EP_T *ep;
- for (ep_index = PERIPH_EPA, mask = USBD_GINTSTS_EPAIF_Msk, xfer = &xfer_table[PERIPH_EPA], ep = &USBD->EP[PERIPH_EPA]; ep_index < PERIPH_MAX_EP; ep_index++, mask <<= 1, xfer++, ep++)
- {
- if(status & mask)
- {
- uint8_t const ep_addr = xfer->ep_addr;
- bool const out_ep = !(ep_addr & TUSB_DIR_IN_MASK);
- uint32_t ep_state = ep->EPINTSTS & ep->EPINTEN;
-
- if (out_ep)
- {
-#if USE_DMA
- xfer->dma_requested = true;
- service_dma();
-#else
- uint16_t const available_bytes = ep->EPDATCNT & USBD_EPDATCNT_DATCNT_Msk;
- /* copy the data from the PC to the previously provided buffer */
-#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- tu_fifo_write_n_const_addr_full_words(xfer->ff, (const void *) &ep->EPDAT_BYTE, tu_min16(available_bytes, xfer->total_bytes - xfer->out_bytes_so_far));
- }
- else
-#endif
- {
- for (int count = 0; (count < available_bytes) && (xfer->out_bytes_so_far < xfer->total_bytes); count++, xfer->out_bytes_so_far++)
- {
- *xfer->data_ptr++ = ep->EPDAT_BYTE;
- }
- }
-
- /* when the transfer is finished, alert TinyUSB; otherwise, continue accepting more data */
- if ( (xfer->total_bytes == xfer->out_bytes_so_far) || (available_bytes < xfer->max_packet_size) )
- {
- dcd_event_xfer_complete(0, ep_addr, xfer->out_bytes_so_far, XFER_RESULT_SUCCESS, true);
- }
-#endif
-
- }
- else if (ep_state & USBD_EPINTSTS_BUFEMPTYIF_Msk)
- {
- /* send any remaining data */
- dcd_userEP_in_xfer(xfer, ep);
- }
- else if (ep_state & USBD_EPINTSTS_TXPKIF_Msk)
- {
- /* alert TinyUSB that we've finished */
- dcd_event_xfer_complete(0, ep_addr, xfer->total_bytes, XFER_RESULT_SUCCESS, true);
- ep->EPINTEN = 0;
- }
-
- ep->EPINTSTS = ep_state;
- }
- }
- }
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- usb_detach();
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- usb_attach();
-}
-
-#endif
diff --git a/tinyusb/src/portable/nxp/khci/dcd_khci.c b/tinyusb/src/portable/nxp/khci/dcd_khci.c
deleted file mode 100755
index dce464fd..00000000
--- a/tinyusb/src/portable/nxp/khci/dcd_khci.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Koji Kitayama
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && ( \
- ( CFG_TUSB_MCU == OPT_MCU_MKL25ZXX ) || ( CFG_TUSB_MCU == OPT_MCU_K32L2BXX ) \
- )
-
-#include "fsl_device_registers.h"
-#define KHCI USB0
-
-#include "device/dcd.h"
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-enum {
- TOK_PID_OUT = 0x1u,
- TOK_PID_IN = 0x9u,
- TOK_PID_SETUP = 0xDu,
-};
-
-typedef struct TU_ATTR_PACKED
-{
- union {
- uint32_t head;
- struct {
- union {
- struct {
- uint16_t : 2;
- uint16_t tok_pid : 4;
- uint16_t data : 1;
- uint16_t own : 1;
- uint16_t : 8;
- };
- struct {
- uint16_t : 2;
- uint16_t bdt_stall: 1;
- uint16_t dts : 1;
- uint16_t ninc : 1;
- uint16_t keep : 1;
- uint16_t : 10;
- };
- };
- uint16_t bc : 10;
- uint16_t : 6;
- };
- };
- uint8_t *addr;
-}buffer_descriptor_t;
-
-TU_VERIFY_STATIC( sizeof(buffer_descriptor_t) == 8, "size is not correct" );
-
-typedef struct TU_ATTR_PACKED
-{
- union {
- uint32_t state;
- struct {
- uint32_t max_packet_size :11;
- uint32_t : 5;
- uint32_t odd : 1;
- uint32_t :15;
- };
- };
- uint16_t length;
- uint16_t remaining;
-}endpoint_state_t;
-
-TU_VERIFY_STATIC( sizeof(endpoint_state_t) == 8, "size is not correct" );
-
-typedef struct
-{
- union {
- /* [#EP][OUT,IN][EVEN,ODD] */
- buffer_descriptor_t bdt[16][2][2];
- uint16_t bda[512];
- };
- TU_ATTR_ALIGNED(4) union {
- endpoint_state_t endpoint[16][2];
- endpoint_state_t endpoint_unified[16 * 2];
- };
- uint8_t setup_packet[8];
- uint8_t addr;
-}dcd_data_t;
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-// BDT(Buffer Descriptor Table) must be 256-byte aligned
-CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(512) static dcd_data_t _dcd;
-
-TU_VERIFY_STATIC( sizeof(_dcd.bdt) == 512, "size is not correct" );
-
-static void prepare_next_setup_packet(uint8_t rhport)
-{
- const unsigned out_odd = _dcd.endpoint[0][0].odd;
- const unsigned in_odd = _dcd.endpoint[0][1].odd;
- if (_dcd.bdt[0][0][out_odd].own) {
- TU_LOG1("DCD fail to prepare the next SETUP %d %d\r\n", out_odd, in_odd);
- return;
- }
- _dcd.bdt[0][0][out_odd].data = 0;
- _dcd.bdt[0][0][out_odd ^ 1].data = 1;
- _dcd.bdt[0][1][in_odd].data = 1;
- _dcd.bdt[0][1][in_odd ^ 1].data = 0;
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_OUT),
- _dcd.setup_packet, sizeof(_dcd.setup_packet));
-}
-
-static void process_stall(uint8_t rhport)
-{
- if (KHCI->ENDPOINT[0].ENDPT & USB_ENDPT_EPSTALL_MASK) {
- /* clear stall condition of the control pipe */
- prepare_next_setup_packet(rhport);
- KHCI->ENDPOINT[0].ENDPT &= ~USB_ENDPT_EPSTALL_MASK;
- }
-}
-
-static void process_tokdne(uint8_t rhport)
-{
- const unsigned s = KHCI->STAT;
- KHCI->ISTAT = USB_ISTAT_TOKDNE_MASK; /* fetch the next token if received */
- buffer_descriptor_t *bd = (buffer_descriptor_t *)&_dcd.bda[s];
- endpoint_state_t *ep = &_dcd.endpoint_unified[s >> 3];
- unsigned odd = (s & USB_STAT_ODD_MASK) ? 1 : 0;
-
- /* fetch pid before discarded by the next steps */
- const unsigned pid = bd->tok_pid;
- /* reset values for a next transfer */
- bd->bdt_stall = 0;
- bd->dts = 1;
- bd->ninc = 0;
- bd->keep = 0;
- /* update the odd variable to prepare for the next transfer */
- ep->odd = odd ^ 1;
- if (pid == TOK_PID_SETUP) {
- dcd_event_setup_received(rhport, bd->addr, true);
- KHCI->CTL &= ~USB_CTL_TXSUSPENDTOKENBUSY_MASK;
- return;
- }
- if (s >> 4) {
- TU_LOG1("TKDNE %x\r\n", s);
- }
-
- const unsigned bc = bd->bc;
- const unsigned remaining = ep->remaining - bc;
- if (remaining && bc == ep->max_packet_size) {
- /* continue the transferring consecutive data */
- ep->remaining = remaining;
- const int next_remaining = remaining - ep->max_packet_size;
- if (next_remaining > 0) {
- /* prepare to the after next transfer */
- bd->addr += ep->max_packet_size * 2;
- bd->bc = next_remaining > ep->max_packet_size ? ep->max_packet_size: next_remaining;
- __DSB();
- bd->own = 1; /* the own bit must set after addr */
- }
- return;
- }
- const unsigned length = ep->length;
- dcd_event_xfer_complete(rhport,
- ((s & USB_STAT_TX_MASK) << 4) | (s >> USB_STAT_ENDP_SHIFT),
- length - remaining, XFER_RESULT_SUCCESS, true);
- if (0 == (s & USB_STAT_ENDP_MASK) && 0 == length) {
- /* After completion a ZLP of control transfer,
- * it prepares for the next steup transfer. */
- if (_dcd.addr) {
- /* When the transfer was the SetAddress,
- * the device address should be updated here. */
- KHCI->ADDR = _dcd.addr;
- _dcd.addr = 0;
- }
- prepare_next_setup_packet(rhport);
- }
-}
-
-static void process_bus_reset(uint8_t rhport)
-{
- KHCI->USBCTRL &= ~USB_USBCTRL_SUSP_MASK;
- KHCI->CTL |= USB_CTL_ODDRST_MASK;
- KHCI->ADDR = 0;
- KHCI->INTEN = (KHCI->INTEN & ~USB_INTEN_RESUMEEN_MASK) | USB_INTEN_SLEEPEN_MASK;
-
- KHCI->ENDPOINT[0].ENDPT = USB_ENDPT_EPHSHK_MASK | USB_ENDPT_EPRXEN_MASK | USB_ENDPT_EPTXEN_MASK;
- for (unsigned i = 1; i < 16; ++i) {
- KHCI->ENDPOINT[i].ENDPT = 0;
- }
- buffer_descriptor_t *bd = _dcd.bdt[0][0];
- for (unsigned i = 0; i < sizeof(_dcd.bdt)/sizeof(*bd); ++i, ++bd) {
- bd->head = 0;
- }
- const endpoint_state_t ep0 = {
- .max_packet_size = CFG_TUD_ENDPOINT0_SIZE,
- .odd = 0,
- .length = 0,
- .remaining = 0,
- };
- _dcd.endpoint[0][0] = ep0;
- _dcd.endpoint[0][1] = ep0;
- tu_memclr(_dcd.endpoint[1], sizeof(_dcd.endpoint) - sizeof(_dcd.endpoint[0]));
- _dcd.addr = 0;
- prepare_next_setup_packet(rhport);
- KHCI->CTL &= ~USB_CTL_ODDRST_MASK;
- dcd_event_bus_reset(rhport, TUSB_SPEED_FULL, true);
-}
-
-static void process_bus_inactive(uint8_t rhport)
-{
- (void) rhport;
- const unsigned inten = KHCI->INTEN;
- KHCI->INTEN = (inten & ~USB_INTEN_SLEEPEN_MASK) | USB_INTEN_RESUMEEN_MASK;
- KHCI->USBCTRL |= USB_USBCTRL_SUSP_MASK;
- dcd_event_bus_signal(rhport, DCD_EVENT_SUSPEND, true);
-}
-
-static void process_bus_active(uint8_t rhport)
-{
- (void) rhport;
- KHCI->USBCTRL &= ~USB_USBCTRL_SUSP_MASK;
- const unsigned inten = KHCI->INTEN;
- KHCI->INTEN = (inten & ~USB_INTEN_RESUMEEN_MASK) | USB_INTEN_SLEEPEN_MASK;
- dcd_event_bus_signal(rhport, DCD_EVENT_RESUME, true);
-}
-
-/*------------------------------------------------------------------*/
-/* Device API
- *------------------------------------------------------------------*/
-void dcd_init(uint8_t rhport)
-{
- (void) rhport;
-
- KHCI->USBTRC0 |= USB_USBTRC0_USBRESET_MASK;
- while (KHCI->USBTRC0 & USB_USBTRC0_USBRESET_MASK);
- tu_memclr(&_dcd, sizeof(_dcd));
- KHCI->USBTRC0 |= TU_BIT(6); /* software must set this bit to 1 */
- KHCI->BDTPAGE1 = (uint8_t)((uintptr_t)_dcd.bdt >> 8);
- KHCI->BDTPAGE2 = (uint8_t)((uintptr_t)_dcd.bdt >> 16);
- KHCI->BDTPAGE3 = (uint8_t)((uintptr_t)_dcd.bdt >> 24);
-
- dcd_connect(rhport);
- NVIC_ClearPendingIRQ(USB0_IRQn);
-}
-
-void dcd_int_enable(uint8_t rhport)
-{
- (void) rhport;
- KHCI->INTEN = USB_INTEN_USBRSTEN_MASK | USB_INTEN_TOKDNEEN_MASK |
- USB_INTEN_SLEEPEN_MASK | USB_INTEN_ERROREN_MASK | USB_INTEN_STALLEN_MASK;
- NVIC_EnableIRQ(USB0_IRQn);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ(USB0_IRQn);
- KHCI->INTEN = 0;
-}
-
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
- _dcd.addr = dev_addr & 0x7F;
- /* Response with status first before changing device address */
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
- unsigned cnt = SystemCoreClock / 100;
- KHCI->CTL |= USB_CTL_RESUME_MASK;
- while (cnt--) __NOP();
- KHCI->CTL &= ~USB_CTL_RESUME_MASK;
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- KHCI->USBCTRL = 0;
- KHCI->CONTROL |= USB_CONTROL_DPPULLUPNONOTG_MASK;
- KHCI->CTL |= USB_CTL_USBENSOFEN_MASK;
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- KHCI->CTL = 0;
- KHCI->CONTROL &= ~USB_CONTROL_DPPULLUPNONOTG_MASK;
-}
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * ep_desc)
-{
- (void) rhport;
-
- const unsigned ep_addr = ep_desc->bEndpointAddress;
- const unsigned epn = ep_addr & 0xFu;
- const unsigned dir = (ep_addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT;
- const unsigned xfer = ep_desc->bmAttributes.xfer;
- endpoint_state_t *ep = &_dcd.endpoint[epn][dir];
- const unsigned odd = ep->odd;
- buffer_descriptor_t *bd = &_dcd.bdt[epn][dir][0];
-
- /* No support for control transfer */
- TU_ASSERT(epn && (xfer != TUSB_XFER_CONTROL));
-
- ep->max_packet_size = ep_desc->wMaxPacketSize.size;
- unsigned val = USB_ENDPT_EPCTLDIS_MASK;
- val |= (xfer != TUSB_XFER_ISOCHRONOUS) ? USB_ENDPT_EPHSHK_MASK: 0;
- val |= dir ? USB_ENDPT_EPTXEN_MASK : USB_ENDPT_EPRXEN_MASK;
- KHCI->ENDPOINT[epn].ENDPT |= val;
-
- if (xfer != TUSB_XFER_ISOCHRONOUS) {
- bd[odd].dts = 1;
- bd[odd].data = 0;
- bd[odd ^ 1].dts = 1;
- bd[odd ^ 1].data = 1;
- }
-
- return true;
-}
-
-void dcd_edpt_close(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- const unsigned epn = ep_addr & 0xFu;
- const unsigned dir = (ep_addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT;
- endpoint_state_t *ep = &_dcd.endpoint[epn][dir];
- buffer_descriptor_t *bd = &_dcd.bdt[epn][dir][0];
- const unsigned msk = dir ? USB_ENDPT_EPTXEN_MASK : USB_ENDPT_EPRXEN_MASK;
- KHCI->ENDPOINT[epn].ENDPT &= ~msk;
- ep->max_packet_size = 0;
- ep->length = 0;
- ep->remaining = 0;
- bd->head = 0;
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t* buffer, uint16_t total_bytes)
-{
- (void) rhport;
- NVIC_DisableIRQ(USB0_IRQn);
- const unsigned epn = ep_addr & 0xFu;
- const unsigned dir = (ep_addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT;
- endpoint_state_t *ep = &_dcd.endpoint[epn][dir];
- buffer_descriptor_t *bd = &_dcd.bdt[epn][dir][ep->odd];
-
- if (bd->own) {
- TU_LOG1("DCD XFER fail %x %d %lx %lx\r\n", ep_addr, total_bytes, ep->state, bd->head);
- return false; /* The last transfer has not completed */
- }
- ep->length = total_bytes;
- ep->remaining = total_bytes;
-
- const unsigned mps = ep->max_packet_size;
- if (total_bytes > mps) {
- buffer_descriptor_t *next = ep->odd ? bd - 1: bd + 1;
- /* When total_bytes is greater than the max packet size,
- * it prepares to the next transfer to avoid NAK in advance. */
- next->bc = total_bytes >= 2 * mps ? mps: total_bytes - mps;
- next->addr = buffer + mps;
- next->own = 1;
- }
- bd->bc = total_bytes >= mps ? mps: total_bytes;
- bd->addr = buffer;
- __DSB();
- bd->own = 1; /* the own bit must set after addr */
- NVIC_EnableIRQ(USB0_IRQn);
- return true;
-}
-
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- const unsigned epn = ep_addr & 0xFu;
- if (0 == epn) {
- KHCI->ENDPOINT[epn].ENDPT |= USB_ENDPT_EPSTALL_MASK;
- } else {
- const unsigned dir = (ep_addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT;
- buffer_descriptor_t *bd = _dcd.bdt[epn][dir];
- bd[0].bdt_stall = 1;
- bd[1].bdt_stall = 1;
- }
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- const unsigned epn = ep_addr & 0xFu;
- const unsigned dir = (ep_addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT;
- const unsigned odd = _dcd.endpoint[epn][dir].odd;
- buffer_descriptor_t *bd = _dcd.bdt[epn][dir];
-
- bd[odd ^ 1].own = 0;
- bd[odd ^ 1].data = 1;
- bd[odd ^ 1].bdt_stall = 0;
- bd[odd].own = 0;
- bd[odd].data = 0;
- bd[odd].bdt_stall = 0;
-}
-
-//--------------------------------------------------------------------+
-// ISR
-//--------------------------------------------------------------------+
-void dcd_int_handler(uint8_t rhport)
-{
- (void) rhport;
-
- uint32_t is = KHCI->ISTAT;
- uint32_t msk = KHCI->INTEN;
- KHCI->ISTAT = is & ~msk;
- is &= msk;
- if (is & USB_ISTAT_ERROR_MASK) {
- /* TODO: */
- uint32_t es = KHCI->ERRSTAT;
- KHCI->ERRSTAT = es;
- KHCI->ISTAT = is; /* discard any pending events */
- return;
- }
-
- if (is & USB_ISTAT_USBRST_MASK) {
- KHCI->ISTAT = is; /* discard any pending events */
- process_bus_reset(rhport);
- return;
- }
- if (is & USB_ISTAT_SLEEP_MASK) {
- KHCI->ISTAT = USB_ISTAT_SLEEP_MASK;
- process_bus_inactive(rhport);
- return;
- }
- if (is & USB_ISTAT_RESUME_MASK) {
- KHCI->ISTAT = USB_ISTAT_RESUME_MASK;
- process_bus_active(rhport);
- return;
- }
- if (is & USB_ISTAT_SOFTOK_MASK) {
- KHCI->ISTAT = USB_ISTAT_SOFTOK_MASK;
- dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true);
- return;
- }
- if (is & USB_ISTAT_STALL_MASK) {
- KHCI->ISTAT = USB_ISTAT_STALL_MASK;
- process_stall(rhport);
- return;
- }
- if (is & USB_ISTAT_TOKDNE_MASK) {
- process_tokdne(rhport);
- return;
- }
-}
-
-#endif
diff --git a/tinyusb/src/portable/nxp/lpc17_40/dcd_lpc17_40.c b/tinyusb/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
deleted file mode 100755
index 519d0915..00000000
--- a/tinyusb/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && \
- (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX)
-
-#include "device/dcd.h"
-#include "dcd_lpc17_40.h"
-#include "chip.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-#define DCD_ENDPOINT_MAX 32
-
-typedef struct TU_ATTR_ALIGNED(4)
-{
- //------------- Word 0 -------------//
- uint32_t next;
-
- //------------- Word 1 -------------//
- uint16_t atle_mode : 2; // 00: normal, 01: ATLE (auto length extraction)
- uint16_t next_valid : 1;
- uint16_t : 1; ///< reserved
- uint16_t isochronous : 1; // is an iso endpoint
- uint16_t max_packet_size : 11;
-
- volatile uint16_t buflen; // bytes for non-iso, number of packets for iso endpoint
-
- //------------- Word 2 -------------//
- volatile uint32_t buffer;
-
- //------------- Word 3 -------------//
- volatile uint16_t retired : 1; // initialized to zero
- volatile uint16_t status : 4;
- volatile uint16_t iso_last_packet_valid : 1;
- volatile uint16_t atle_lsb_extracted : 1; // used in ATLE mode
- volatile uint16_t atle_msb_extracted : 1; // used in ATLE mode
- volatile uint16_t atle_mess_len_position : 6; // used in ATLE mode
- uint16_t : 2;
-
- volatile uint16_t present_count; // For non-iso : The number of bytes transferred by the DMA engine
- // For iso : number of packets
-
- //------------- Word 4 -------------//
- // uint32_t iso_packet_size_addr; // iso only, can be omitted for non-iso
-}dma_desc_t;
-
-TU_VERIFY_STATIC( sizeof(dma_desc_t) == 16, "size is not correct"); // TODO not support ISO for now
-
-typedef struct
-{
- // must be 128 byte aligned
- volatile dma_desc_t* udca[DCD_ENDPOINT_MAX];
-
- // TODO DMA does not support control transfer (0-1 are not used, offset to reduce memory)
- dma_desc_t dd[DCD_ENDPOINT_MAX];
-
- struct
- {
- uint8_t* out_buffer;
- uint8_t out_bytes;
- volatile bool out_received; // indicate if data is already received in endpoint
-
- uint8_t in_bytes;
- } control;
-
-} dcd_data_t;
-
-CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(128) static dcd_data_t _dcd;
-
-
-//--------------------------------------------------------------------+
-// SIE Command
-//--------------------------------------------------------------------+
-static void sie_cmd_code (sie_cmdphase_t phase, uint8_t code_data)
-{
- LPC_USB->DevIntClr = (DEV_INT_COMMAND_CODE_EMPTY_MASK | DEV_INT_COMMAND_DATA_FULL_MASK);
- LPC_USB->CmdCode = (phase << 8) | (code_data << 16);
-
- uint32_t const wait_flag = (phase == SIE_CMDPHASE_READ) ? DEV_INT_COMMAND_DATA_FULL_MASK : DEV_INT_COMMAND_CODE_EMPTY_MASK;
- while ((LPC_USB->DevIntSt & wait_flag) == 0) {}
-
- LPC_USB->DevIntClr = wait_flag;
-}
-
-static void sie_write (uint8_t cmd_code, uint8_t data_len, uint8_t data)
-{
- sie_cmd_code(SIE_CMDPHASE_COMMAND, cmd_code);
-
- if (data_len)
- {
- sie_cmd_code(SIE_CMDPHASE_WRITE, data);
- }
-}
-
-static uint8_t sie_read (uint8_t cmd_code)
-{
- sie_cmd_code(SIE_CMDPHASE_COMMAND , cmd_code);
- sie_cmd_code(SIE_CMDPHASE_READ , cmd_code);
- return (uint8_t) LPC_USB->CmdData;
-}
-
-//--------------------------------------------------------------------+
-// PIPE HELPER
-//--------------------------------------------------------------------+
-static inline uint8_t ep_addr2idx(uint8_t ep_addr)
-{
- return 2*(ep_addr & 0x0F) + ((ep_addr & TUSB_DIR_IN_MASK) ? 1 : 0);
-}
-
-static void set_ep_size(uint8_t ep_id, uint16_t max_packet_size)
-{
- // follows example in 11.10.4.2
- LPC_USB->ReEp |= TU_BIT(ep_id);
- LPC_USB->EpInd = ep_id; // select index before setting packet size
- LPC_USB->MaxPSize = max_packet_size;
-
- while ((LPC_USB->DevIntSt & DEV_INT_ENDPOINT_REALIZED_MASK) == 0) {}
- LPC_USB->DevIntClr = DEV_INT_ENDPOINT_REALIZED_MASK;
-}
-
-
-//--------------------------------------------------------------------+
-// CONTROLLER API
-//--------------------------------------------------------------------+
-static void bus_reset(void)
-{
- // step 7 : slave mode set up
- LPC_USB->EpIntClr = 0xFFFFFFFF; // clear all pending interrupt
- LPC_USB->DevIntClr = 0xFFFFFFFF; // clear all pending interrupt
- LPC_USB->EpIntEn = 0x03UL; // control endpoint cannot use DMA, non-control all use DMA
- LPC_USB->EpIntPri = 0x03UL; // fast for control endpoint
-
- // step 8 : DMA set up
- LPC_USB->EpDMADis = 0xFFFFFFFF; // firstly disable all dma
- LPC_USB->DMARClr = 0xFFFFFFFF; // clear all pending interrupt
- LPC_USB->EoTIntClr = 0xFFFFFFFF;
- LPC_USB->NDDRIntClr = 0xFFFFFFFF;
- LPC_USB->SysErrIntClr = 0xFFFFFFFF;
-
- tu_memclr(&_dcd, sizeof(dcd_data_t));
-}
-
-void dcd_init(uint8_t rhport)
-{
- (void) rhport;
-
- //------------- user manual 11.13 usb device controller initialization -------------//
- // step 6 : set up control endpoint
- set_ep_size(0, CFG_TUD_ENDPOINT0_SIZE);
- set_ep_size(1, CFG_TUD_ENDPOINT0_SIZE);
-
- bus_reset();
-
- LPC_USB->DevIntEn = (DEV_INT_DEVICE_STATUS_MASK | DEV_INT_ENDPOINT_FAST_MASK | DEV_INT_ENDPOINT_SLOW_MASK | DEV_INT_ERROR_MASK);
- LPC_USB->UDCAH = (uint32_t) _dcd.udca;
- LPC_USB->DMAIntEn = (DMA_INT_END_OF_XFER_MASK /*| DMA_INT_NEW_DD_REQUEST_MASK*/ | DMA_INT_ERROR_MASK);
-
- dcd_connect(rhport);
-
- // Clear pending IRQ
- NVIC_ClearPendingIRQ(USB_IRQn);
-}
-
-void dcd_int_enable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_EnableIRQ(USB_IRQn);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ(USB_IRQn);
-}
-
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- // Response with status first before changing device address
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-
- sie_write(SIE_CMDCODE_SET_ADDRESS, 1, 0x80 | dev_addr); // 7th bit is : device_enable
-
- // Also Set Configure Device to enable non-control endpoint response
- sie_write(SIE_CMDCODE_CONFIGURE_DEVICE, 1, 1);
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- sie_write(SIE_CMDCODE_DEVICE_STATUS, 1, SIE_DEV_STATUS_CONNECT_STATUS_MASK);
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- sie_write(SIE_CMDCODE_DEVICE_STATUS, 1, 0);
-}
-
-//--------------------------------------------------------------------+
-// CONTROL HELPER
-//--------------------------------------------------------------------+
-static inline uint8_t byte2dword(uint8_t bytes)
-{
- return (bytes + 3) / 4; // length in dwords
-}
-
-static void control_ep_write(void const * buffer, uint8_t len)
-{
- uint32_t const * buf32 = (uint32_t const *) buffer;
-
- LPC_USB->Ctrl = USBCTRL_WRITE_ENABLE_MASK; // logical endpoint = 0
- LPC_USB->TxPLen = (uint32_t) len;
-
- for (uint8_t count = 0; count < byte2dword(len); count++)
- {
- LPC_USB->TxData = *buf32; // NOTE: cortex M3 have no problem with alignment
- buf32++;
- }
-
- LPC_USB->Ctrl = 0;
-
- // select control IN & validate the endpoint
- sie_write(SIE_CMDCODE_ENDPOINT_SELECT+1, 0, 0);
- sie_write(SIE_CMDCODE_BUFFER_VALIDATE , 0, 0);
-}
-
-static uint8_t control_ep_read(void * buffer, uint8_t len)
-{
- LPC_USB->Ctrl = USBCTRL_READ_ENABLE_MASK; // logical endpoint = 0
- while ((LPC_USB->RxPLen & USBRXPLEN_PACKET_READY_MASK) == 0) {} // TODO blocking, should have timeout
-
- len = tu_min8(len, (uint8_t) (LPC_USB->RxPLen & USBRXPLEN_PACKET_LENGTH_MASK) );
- uint32_t *buf32 = (uint32_t*) buffer;
-
- for (uint8_t count=0; count < byte2dword(len); count++)
- {
- *buf32 = LPC_USB->RxData;
- buf32++;
- }
-
- LPC_USB->Ctrl = 0;
-
- // select control OUT & clear the endpoint
- sie_write(SIE_CMDCODE_ENDPOINT_SELECT+0, 0, 0);
- sie_write(SIE_CMDCODE_BUFFER_CLEAR , 0, 0);
-
- return len;
-}
-
-//--------------------------------------------------------------------+
-// DCD Endpoint Port
-//--------------------------------------------------------------------+
-
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
- uint8_t const ep_id = ep_addr2idx(p_endpoint_desc->bEndpointAddress);
-
- // Endpoint type is fixed to endpoint number
- // 1: interrupt, 2: Bulk, 3: Iso and so on
- switch ( p_endpoint_desc->bmAttributes.xfer )
- {
- case TUSB_XFER_INTERRUPT:
- TU_ASSERT((epnum % 3) == 1);
- break;
-
- case TUSB_XFER_BULK:
- TU_ASSERT((epnum % 3) == 2 || (epnum == 15));
- break;
-
- case TUSB_XFER_ISOCHRONOUS:
- TU_ASSERT((epnum % 3) == 0 && (epnum != 0) && (epnum != 15));
- break;
-
- default:
- break;
- }
-
- //------------- Realize Endpoint with Max Packet Size -------------//
- set_ep_size(ep_id, p_endpoint_desc->wMaxPacketSize.size);
-
- //------------- first DD prepare -------------//
- dma_desc_t* const dd = &_dcd.dd[ep_id];
- tu_memclr(dd, sizeof(dma_desc_t));
-
- dd->isochronous = (p_endpoint_desc->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS) ? 1 : 0;
- dd->max_packet_size = p_endpoint_desc->wMaxPacketSize.size;
- dd->retired = 1; // invalid at first
-
- sie_write(SIE_CMDCODE_ENDPOINT_SET_STATUS + ep_id, 1, 0); // clear all endpoint status
-
- return true;
-}
-
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- if ( tu_edpt_number(ep_addr) == 0 )
- {
- sie_write(SIE_CMDCODE_ENDPOINT_SET_STATUS+0, 1, SIE_SET_ENDPOINT_STALLED_MASK | SIE_SET_ENDPOINT_CONDITION_STALLED_MASK);
- }else
- {
- uint8_t ep_id = ep_addr2idx( ep_addr );
- sie_write(SIE_CMDCODE_ENDPOINT_SET_STATUS+ep_id, 1, SIE_SET_ENDPOINT_STALLED_MASK);
- }
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- uint8_t ep_id = ep_addr2idx(ep_addr);
-
- sie_write(SIE_CMDCODE_ENDPOINT_SET_STATUS+ep_id, 1, 0);
-}
-
-static bool control_xact(uint8_t rhport, uint8_t dir, uint8_t * buffer, uint8_t len)
-{
- (void) rhport;
-
- if ( dir )
- {
- _dcd.control.in_bytes = len;
- control_ep_write(buffer, len);
- }else
- {
- if ( _dcd.control.out_received )
- {
- // Already received the DATA OUT packet
- _dcd.control.out_received = false;
- _dcd.control.out_buffer = NULL;
- _dcd.control.out_bytes = 0;
-
- uint8_t received = control_ep_read(buffer, len);
- dcd_event_xfer_complete(0, 0, received, XFER_RESULT_SUCCESS, true);
- }else
- {
- _dcd.control.out_buffer = buffer;
- _dcd.control.out_bytes = len;
- }
- }
-
- return true;
-}
-
-bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t* buffer, uint16_t total_bytes)
-{
- // Control transfer is not DMA support, and must be done in slave mode
- if ( tu_edpt_number(ep_addr) == 0 )
- {
- return control_xact(rhport, tu_edpt_dir(ep_addr), buffer, (uint8_t) total_bytes);
- }
- else
- {
- uint8_t ep_id = ep_addr2idx(ep_addr);
- dma_desc_t* dd = &_dcd.dd[ep_id];
-
- // Prepare DMA descriptor
- // Isochronous & max packet size must be preserved, Other fields of dd should be clear
- uint16_t const ep_size = dd->max_packet_size;
- uint8_t is_iso = dd->isochronous;
-
- tu_memclr(dd, sizeof(dma_desc_t));
- dd->isochronous = is_iso;
- dd->max_packet_size = ep_size;
- dd->buffer = (uint32_t) buffer;
- dd->buflen = total_bytes;
-
- _dcd.udca[ep_id] = dd;
-
- if ( ep_id % 2 )
- {
- // Clear EP interrupt before Enable DMA
- LPC_USB->EpIntEn &= ~TU_BIT(ep_id);
- LPC_USB->EpDMAEn = TU_BIT(ep_id);
-
- // endpoint IN need to actively raise DMA request
- LPC_USB->DMARSet = TU_BIT(ep_id);
- }else
- {
- // Enable DMA
- LPC_USB->EpDMAEn = TU_BIT(ep_id);
- }
-
- return true;
- }
-}
-
-//--------------------------------------------------------------------+
-// ISR
-//--------------------------------------------------------------------+
-
-// handle control xfer (slave mode)
-static void control_xfer_isr(uint8_t rhport, uint32_t ep_int_status)
-{
- // Control out complete
- if ( ep_int_status & TU_BIT(0) )
- {
- bool is_setup = sie_read(SIE_CMDCODE_ENDPOINT_SELECT+0) & SIE_SELECT_ENDPOINT_SETUP_RECEIVED_MASK;
-
- LPC_USB->EpIntClr = TU_BIT(0);
-
- if (is_setup)
- {
- uint8_t setup_packet[8];
- control_ep_read(setup_packet, 8); // TODO read before clear setup above
-
- dcd_event_setup_received(rhport, setup_packet, true);
- }
- else if ( _dcd.control.out_buffer )
- {
- // software queued transfer previously
- uint8_t received = control_ep_read(_dcd.control.out_buffer, _dcd.control.out_bytes);
-
- _dcd.control.out_buffer = NULL;
- _dcd.control.out_bytes = 0;
-
- dcd_event_xfer_complete(rhport, 0, received, XFER_RESULT_SUCCESS, true);
- }else
- {
- // hardware auto ack packet -> mark as received
- _dcd.control.out_received = true;
- }
- }
-
- // Control In complete
- if ( ep_int_status & TU_BIT(1) )
- {
- LPC_USB->EpIntClr = TU_BIT(1);
- dcd_event_xfer_complete(rhport, TUSB_DIR_IN_MASK, _dcd.control.in_bytes, XFER_RESULT_SUCCESS, true);
- }
-}
-
-// handle bus event signal
-static void bus_event_isr(uint8_t rhport)
-{
- uint8_t const dev_status = sie_read(SIE_CMDCODE_DEVICE_STATUS);
- if (dev_status & SIE_DEV_STATUS_RESET_MASK)
- {
- bus_reset();
- dcd_event_bus_reset(rhport, TUSB_SPEED_FULL, true);
- }
-
- if (dev_status & SIE_DEV_STATUS_CONNECT_CHANGE_MASK)
- {
- // device is disconnected, require using VBUS (P1_30)
- dcd_event_bus_signal(rhport, DCD_EVENT_UNPLUGGED, true);
- }
-
- if (dev_status & SIE_DEV_STATUS_SUSPEND_CHANGE_MASK)
- {
- if (dev_status & SIE_DEV_STATUS_SUSPEND_MASK)
- {
- dcd_event_bus_signal(rhport, DCD_EVENT_SUSPEND, true);
- }
- else
- {
- dcd_event_bus_signal(rhport, DCD_EVENT_RESUME, true);
- }
- }
-}
-
-// Helper to complete a DMA descriptor for non-control transfer
-static void dd_complete_isr(uint8_t rhport, uint8_t ep_id)
-{
- dma_desc_t* const dd = &_dcd.dd[ep_id];
- uint8_t result = (dd->status == DD_STATUS_NORMAL || dd->status == DD_STATUS_DATA_UNDERUN) ? XFER_RESULT_SUCCESS : XFER_RESULT_FAILED;
- uint8_t const ep_addr = (ep_id / 2) | ((ep_id & 0x01) ? TUSB_DIR_IN_MASK : 0);
-
- dcd_event_xfer_complete(rhport, ep_addr, dd->present_count, result, true);
-}
-
-// main USB IRQ handler
-void dcd_int_handler(uint8_t rhport)
-{
- uint32_t const dev_int_status = LPC_USB->DevIntSt & LPC_USB->DevIntEn;
- LPC_USB->DevIntClr = dev_int_status;// Acknowledge handled interrupt
-
- // Bus event
- if (dev_int_status & DEV_INT_DEVICE_STATUS_MASK)
- {
- bus_event_isr(rhport);
- }
-
- // Endpoint interrupt
- uint32_t const ep_int_status = LPC_USB->EpIntSt & LPC_USB->EpIntEn;
-
- // Control Endpoint are fast
- if (dev_int_status & DEV_INT_ENDPOINT_FAST_MASK)
- {
- // Note clear USBEpIntClr will also clear the setup received bit --> clear after handle setup packet
- // Only clear USBEpIntClr 1 endpoint each, and should wait for CDFULL bit set
- control_xfer_isr(rhport, ep_int_status);
- }
-
- // non-control IN are slow
- if (dev_int_status & DEV_INT_ENDPOINT_SLOW_MASK)
- {
- for ( uint8_t ep_id = 3; ep_id < DCD_ENDPOINT_MAX; ep_id += 2 )
- {
- if ( tu_bit_test(ep_int_status, ep_id) )
- {
- LPC_USB->EpIntClr = TU_BIT(ep_id);
-
- // Clear Ep interrupt for next DMA
- LPC_USB->EpIntEn &= ~TU_BIT(ep_id);
-
- dd_complete_isr(rhport, ep_id);
- }
- }
- }
-
- // DMA transfer complete (RAM <-> EP) for Non-Control
- // OUT: USB transfer is fully complete
- // IN : UBS transfer is still on-going -> enable EpIntEn to know when it is complete
- uint32_t const dma_int_status = LPC_USB->DMAIntSt & LPC_USB->DMAIntEn;
- if (dma_int_status & DMA_INT_END_OF_XFER_MASK)
- {
- uint32_t const eot = LPC_USB->EoTIntSt;
- LPC_USB->EoTIntClr = eot; // acknowledge interrupt source
-
- for ( uint8_t ep_id = 2; ep_id < DCD_ENDPOINT_MAX; ep_id++ )
- {
- if ( tu_bit_test(eot, ep_id) )
- {
- if ( ep_id & 0x01 )
- {
- // IN enable EpInt for end of usb transfer
- LPC_USB->EpIntEn |= TU_BIT(ep_id);
- }else
- {
- // OUT
- dd_complete_isr(rhport, ep_id);
- }
- }
- }
- }
-
- // Errors
- if ( (dev_int_status & DEV_INT_ERROR_MASK) || (dma_int_status & DMA_INT_ERROR_MASK) )
- {
- uint32_t error_status = sie_read(SIE_CMDCODE_READ_ERROR_STATUS);
- (void) error_status;
- TU_BREAKPOINT();
- }
-}
-
-#endif
diff --git a/tinyusb/src/portable/nxp/lpc17_40/dcd_lpc17_40.h b/tinyusb/src/portable/nxp/lpc17_40/dcd_lpc17_40.h
deleted file mode 100755
index 07daa32e..00000000
--- a/tinyusb/src/portable/nxp/lpc17_40/dcd_lpc17_40.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_DCD_LPC17_40_H_
-#define _TUSB_DCD_LPC17_40_H_
-
-#include "common/tusb_common.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// Register Interface
-//--------------------------------------------------------------------+
-
-//------------- USB Interrupt USBIntSt -------------//
-//enum {
-// DCD_USB_REQ_LOW_PRIO_MASK = TU_BIT(0),
-// DCD_USB_REQ_HIGH_PRIO_MASK = TU_BIT(1),
-// DCD_USB_REQ_DMA_MASK = TU_BIT(2),
-// DCD_USB_REQ_NEED_CLOCK_MASK = TU_BIT(8),
-// DCD_USB_REQ_ENABLE_MASK = TU_BIT(31)
-//};
-
-//------------- Device Interrupt USBDevInt -------------//
-enum {
- DEV_INT_FRAME_MASK = TU_BIT(0),
- DEV_INT_ENDPOINT_FAST_MASK = TU_BIT(1),
- DEV_INT_ENDPOINT_SLOW_MASK = TU_BIT(2),
- DEV_INT_DEVICE_STATUS_MASK = TU_BIT(3),
- DEV_INT_COMMAND_CODE_EMPTY_MASK = TU_BIT(4),
- DEV_INT_COMMAND_DATA_FULL_MASK = TU_BIT(5),
- DEV_INT_RX_ENDPOINT_PACKET_MASK = TU_BIT(6),
- DEV_INT_TX_ENDPOINT_PACKET_MASK = TU_BIT(7),
- DEV_INT_ENDPOINT_REALIZED_MASK = TU_BIT(8),
- DEV_INT_ERROR_MASK = TU_BIT(9)
-};
-
-//------------- DMA Interrupt USBDMAInt-------------//
-enum {
- DMA_INT_END_OF_XFER_MASK = TU_BIT(0),
- DMA_INT_NEW_DD_REQUEST_MASK = TU_BIT(1),
- DMA_INT_ERROR_MASK = TU_BIT(2)
-};
-
-//------------- USBCtrl -------------//
-enum {
- USBCTRL_READ_ENABLE_MASK = TU_BIT(0),
- USBCTRL_WRITE_ENABLE_MASK = TU_BIT(1),
-};
-
-//------------- USBRxPLen -------------//
-enum {
- USBRXPLEN_PACKET_LENGTH_MASK = (TU_BIT(10)-1),
- USBRXPLEN_DATA_VALID_MASK = TU_BIT(10),
- USBRXPLEN_PACKET_READY_MASK = TU_BIT(11),
-};
-
-//------------- SIE Command Code -------------//
-typedef enum
-{
- SIE_CMDPHASE_WRITE = 1,
- SIE_CMDPHASE_READ = 2,
- SIE_CMDPHASE_COMMAND = 5
-} sie_cmdphase_t;
-
-enum {
- // device commands
- SIE_CMDCODE_SET_ADDRESS = 0xd0,
- SIE_CMDCODE_CONFIGURE_DEVICE = 0xd8,
- SIE_CMDCODE_SET_MODE = 0xf3,
- SIE_CMDCODE_READ_FRAME_NUMBER = 0xf5,
- SIE_CMDCODE_READ_TEST_REGISTER = 0xfd,
- SIE_CMDCODE_DEVICE_STATUS = 0xfe,
- SIE_CMDCODE_GET_ERROR = 0xff,
- SIE_CMDCODE_READ_ERROR_STATUS = 0xfb,
-
- // endpoint commands
- SIE_CMDCODE_ENDPOINT_SELECT = 0x00, // + endpoint index
- SIE_CMDCODE_ENDPOINT_SELECT_CLEAR_INTERRUPT = 0x40, // + endpoint index, should use USBEpIntClr instead
- SIE_CMDCODE_ENDPOINT_SET_STATUS = 0x40, // + endpoint index
- SIE_CMDCODE_BUFFER_CLEAR = 0xf2,
- SIE_CMDCODE_BUFFER_VALIDATE = 0xfa
-};
-
-//------------- SIE Device Status (get/set from SIE_CMDCODE_DEVICE_STATUS) -------------//
-enum {
- SIE_DEV_STATUS_CONNECT_STATUS_MASK = TU_BIT(0),
- SIE_DEV_STATUS_CONNECT_CHANGE_MASK = TU_BIT(1),
- SIE_DEV_STATUS_SUSPEND_MASK = TU_BIT(2),
- SIE_DEV_STATUS_SUSPEND_CHANGE_MASK = TU_BIT(3),
- SIE_DEV_STATUS_RESET_MASK = TU_BIT(4)
-};
-
-//------------- SIE Select Endpoint Command -------------//
-enum {
- SIE_SELECT_ENDPOINT_FULL_EMPTY_MASK = TU_BIT(0), // 0: empty, 1 full. IN endpoint checks empty, OUT endpoint check full
- SIE_SELECT_ENDPOINT_STALL_MASK = TU_BIT(1),
- SIE_SELECT_ENDPOINT_SETUP_RECEIVED_MASK = TU_BIT(2), // clear by SIE_CMDCODE_ENDPOINT_SELECT_CLEAR_INTERRUPT
- SIE_SELECT_ENDPOINT_PACKET_OVERWRITTEN_MASK = TU_BIT(3), // previous packet is overwritten by a SETUP packet
- SIE_SELECT_ENDPOINT_NAK_MASK = TU_BIT(4), // last packet response is NAK (auto clear by an ACK)
- SIE_SELECT_ENDPOINT_BUFFER1_FULL_MASK = TU_BIT(5),
- SIE_SELECT_ENDPOINT_BUFFER2_FULL_MASK = TU_BIT(6)
-};
-
-typedef enum
-{
- SIE_SET_ENDPOINT_STALLED_MASK = TU_BIT(0),
- SIE_SET_ENDPOINT_DISABLED_MASK = TU_BIT(5),
- SIE_SET_ENDPOINT_RATE_FEEDBACK_MASK = TU_BIT(6),
- SIE_SET_ENDPOINT_CONDITION_STALLED_MASK = TU_BIT(7),
-}sie_endpoint_set_status_mask_t;
-
-//------------- DMA Descriptor Status -------------//
-enum {
- DD_STATUS_NOT_SERVICED = 0,
- DD_STATUS_BEING_SERVICED,
- DD_STATUS_NORMAL,
- DD_STATUS_DATA_UNDERUN, // short packet
- DD_STATUS_DATA_OVERRUN,
- DD_STATUS_SYSTEM_ERROR
-};
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif
diff --git a/tinyusb/src/portable/nxp/lpc17_40/hcd_lpc17_40.c b/tinyusb/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
deleted file mode 100755
index 1c1faed9..00000000
--- a/tinyusb/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_HOST_ENABLED && \
- (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX)
-
-#include "chip.h"
-
-void hcd_int_enable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_EnableIRQ(USB_IRQn);
-}
-
-void hcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ(USB_IRQn);
-}
-
-#endif
-
diff --git a/tinyusb/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c b/tinyusb/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
deleted file mode 100755
index 4392d188..00000000
--- a/tinyusb/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
+++ /dev/null
@@ -1,537 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-/* Since 2012 starting with LPC11uxx, NXP start to use common USB Device Controller with code name LPC IP3511
- * for almost their new MCUs. Currently supported and tested families are
- * - LPC11U68, LPC11U37
- * - LPC1347
- * - LPC51U68
- * - LPC54114
- * - LPC55s69
- */
-#if TUSB_OPT_DEVICE_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_LPC11UXX || \
- CFG_TUSB_MCU == OPT_MCU_LPC13XX || \
- CFG_TUSB_MCU == OPT_MCU_LPC15XX || \
- CFG_TUSB_MCU == OPT_MCU_LPC51UXX || \
- CFG_TUSB_MCU == OPT_MCU_LPC54XXX || \
- CFG_TUSB_MCU == OPT_MCU_LPC55XX)
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-
-#if CFG_TUSB_MCU == OPT_MCU_LPC11UXX || CFG_TUSB_MCU == OPT_MCU_LPC13XX || CFG_TUSB_MCU == OPT_MCU_LPC15XX
- // LPCOpen
- #include "chip.h"
-#else
- // SDK
- #include "fsl_device_registers.h"
- #define INCLUDE_FSL_DEVICE_REGISTERS
-#endif
-
-#include "device/dcd.h"
-
-//--------------------------------------------------------------------+
-// IP3511 Registers
-//--------------------------------------------------------------------+
-
-typedef struct {
- __IO uint32_t DEVCMDSTAT; // Device Command/Status register, offset: 0x0
- __I uint32_t INFO; // Info register, offset: 0x4
- __IO uint32_t EPLISTSTART; // EP Command/Status List start address, offset: 0x8
- __IO uint32_t DATABUFSTART; // Data buffer start address, offset: 0xC
- __IO uint32_t LPM; // Link Power Management register, offset: 0x10
- __IO uint32_t EPSKIP; // Endpoint skip, offset: 0x14
- __IO uint32_t EPINUSE; // Endpoint Buffer in use, offset: 0x18
- __IO uint32_t EPBUFCFG; // Endpoint Buffer Configuration register, offset: 0x1C
- __IO uint32_t INTSTAT; // interrupt status register, offset: 0x20
- __IO uint32_t INTEN; // interrupt enable register, offset: 0x24
- __IO uint32_t INTSETSTAT; // set interrupt status register, offset: 0x28
- uint8_t RESERVED_0[8];
- __I uint32_t EPTOGGLE; // Endpoint toggle register, offset: 0x34
-} dcd_registers_t;
-
-// Max nbytes for each control/bulk/interrupt transfer
-enum {
- NBYTES_CBI_FULLSPEED_MAX = 64,
- NBYTES_CBI_HIGHSPEED_MAX = 32767 // can be up to all 15-bit, but only tested with 4096
-};
-
-enum {
- INT_SOF_MASK = TU_BIT(30),
- INT_DEVICE_STATUS_MASK = TU_BIT(31)
-};
-
-enum {
- CMDSTAT_DEVICE_ADDR_MASK = TU_BIT(7 )-1,
- CMDSTAT_DEVICE_ENABLE_MASK = TU_BIT(7 ),
- CMDSTAT_SETUP_RECEIVED_MASK = TU_BIT(8 ),
- CMDSTAT_DEVICE_CONNECT_MASK = TU_BIT(16), // reflect the soft-connect only, does not reflect the actual attached state
- CMDSTAT_DEVICE_SUSPEND_MASK = TU_BIT(17),
- // 23-22 is link speed (only available for HighSpeed port)
- CMDSTAT_CONNECT_CHANGE_MASK = TU_BIT(24),
- CMDSTAT_SUSPEND_CHANGE_MASK = TU_BIT(25),
- CMDSTAT_RESET_CHANGE_MASK = TU_BIT(26),
- CMDSTAT_VBUS_DEBOUNCED_MASK = TU_BIT(28),
-};
-
-enum {
- CMDSTAT_SPEED_SHIFT = 22
-};
-
-//--------------------------------------------------------------------+
-// Endpoint Command/Status List
-//--------------------------------------------------------------------+
-
-// Endpoint Command/Status
-typedef union TU_ATTR_PACKED
-{
- // Full and High speed has different bit layout for buffer_offset and nbytes
-
- // Buffer (aligned 64) = DATABUFSTART [31:22] | buffer_offset [21:6]
- volatile struct {
- uint32_t offset : 16;
- uint32_t nbytes : 10;
- uint32_t TU_RESERVED : 6;
- } buffer_fs;
-
- // Buffer (aligned 64) = USB_RAM [31:17] | buffer_offset [16:6]
- volatile struct {
- uint32_t offset : 11 ;
- uint32_t nbytes : 15 ;
- uint32_t TU_RESERVED : 6 ;
- } buffer_hs;
-
- volatile struct {
- uint32_t TU_RESERVED : 26;
- uint32_t is_iso : 1 ;
- uint32_t toggle_mode : 1 ;
- uint32_t toggle_reset : 1 ;
- uint32_t stall : 1 ;
- uint32_t disable : 1 ;
- uint32_t active : 1 ;
- };
-}ep_cmd_sts_t;
-
-TU_VERIFY_STATIC( sizeof(ep_cmd_sts_t) == 4, "size is not correct" );
-
-// Software transfer management
-typedef struct
-{
- uint16_t total_bytes;
- uint16_t xferred_bytes;
-
- uint16_t nbytes;
-
- // prevent unaligned access on Highspeed port on USB_SRAM
- uint16_t TU_RESERVED;
-}xfer_dma_t;
-
-// Absolute max of endpoints pairs for all port
-// - 11 13 15 51 54 has 5x2 endpoints
-// - 55 usb0 (FS) has 5x2 endpoints, usb1 (HS) has 6x2 endpoints
-#define MAX_EP_PAIRS 6
-
-// NOTE data will be transferred as soon as dcd get request by dcd_pipe(_queue)_xfer using double buffering.
-// current_td is used to keep track of number of remaining & xferred bytes of the current request.
-typedef struct
-{
- // 256 byte aligned, 2 for double buffer (not used)
- // Each cmd_sts can only transfer up to DMA_NBYTES_MAX bytes each
- ep_cmd_sts_t ep[2*MAX_EP_PAIRS][2];
- xfer_dma_t dma[2*MAX_EP_PAIRS];
-
- TU_ATTR_ALIGNED(64) uint8_t setup_packet[8];
-}dcd_data_t;
-
-// EP list must be 256-byte aligned
-// Some MCU controller may require this variable to be placed in specific SRAM region.
-// For example: LPC55s69 port1 Highspeed must be USB_RAM (0x40100000)
-// Use CFG_TUSB_MEM_SECTION to place it accordingly.
-CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(256) static dcd_data_t _dcd;
-
-//--------------------------------------------------------------------+
-// Multiple Controllers
-//--------------------------------------------------------------------+
-
-typedef struct
-{
- dcd_registers_t* regs; // registers
- const tusb_speed_t max_speed; // max link speed
- const IRQn_Type irqnum; // IRQ number
- const uint8_t ep_pairs; // Max bi-directional Endpoints
-}dcd_controller_t;
-
-#ifdef INCLUDE_FSL_DEVICE_REGISTERS
-
-static const dcd_controller_t _dcd_controller[] =
-{
- { .regs = (dcd_registers_t*) USB0_BASE , .max_speed = TUSB_SPEED_FULL, .irqnum = USB0_IRQn, .ep_pairs = FSL_FEATURE_USB_EP_NUM },
- #if defined(FSL_FEATURE_SOC_USBHSD_COUNT) && FSL_FEATURE_SOC_USBHSD_COUNT
- { .regs = (dcd_registers_t*) USBHSD_BASE, .max_speed = TUSB_SPEED_HIGH, .irqnum = USB1_IRQn, .ep_pairs = FSL_FEATURE_USBHSD_EP_NUM }
- #endif
-};
-
-#else
-
-static const dcd_controller_t _dcd_controller[] =
-{
- { .regs = (dcd_registers_t*) LPC_USB0_BASE, .max_speed = TUSB_SPEED_FULL, .irqnum = USB0_IRQn, .ep_pairs = 5 },
-};
-
-#endif
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-
-static inline uint16_t get_buf_offset(void const * buffer)
-{
- uint32_t addr = (uint32_t) buffer;
- TU_ASSERT( (addr & 0x3f) == 0, 0 );
- return ( (addr >> 6) & 0xFFFFUL ) ;
-}
-
-static inline uint8_t ep_addr2id(uint8_t ep_addr)
-{
- return 2*(ep_addr & 0x0F) + ((ep_addr & TUSB_DIR_IN_MASK) ? 1 : 0);
-}
-
-//--------------------------------------------------------------------+
-// CONTROLLER API
-//--------------------------------------------------------------------+
-void dcd_init(uint8_t rhport)
-{
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
-
- dcd_reg->EPLISTSTART = (uint32_t) _dcd.ep;
- dcd_reg->DATABUFSTART = tu_align((uint32_t) &_dcd, TU_BIT(22)); // 22-bit alignment
- dcd_reg->INTSTAT |= dcd_reg->INTSTAT; // clear all pending interrupt
- dcd_reg->INTEN = INT_DEVICE_STATUS_MASK;
- dcd_reg->DEVCMDSTAT |= CMDSTAT_DEVICE_ENABLE_MASK | CMDSTAT_DEVICE_CONNECT_MASK |
- CMDSTAT_RESET_CHANGE_MASK | CMDSTAT_CONNECT_CHANGE_MASK | CMDSTAT_SUSPEND_CHANGE_MASK;
-
- NVIC_ClearPendingIRQ(_dcd_controller[rhport].irqnum);
-}
-
-void dcd_int_enable(uint8_t rhport)
-{
- NVIC_EnableIRQ(_dcd_controller[rhport].irqnum);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- NVIC_DisableIRQ(_dcd_controller[rhport].irqnum);
-}
-
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
-
- // Response with status first before changing device address
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-
- dcd_reg->DEVCMDSTAT &= ~CMDSTAT_DEVICE_ADDR_MASK;
- dcd_reg->DEVCMDSTAT |= dev_addr;
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
-}
-
-void dcd_connect(uint8_t rhport)
-{
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
- dcd_reg->DEVCMDSTAT |= CMDSTAT_DEVICE_CONNECT_MASK;
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
- dcd_reg->DEVCMDSTAT &= ~CMDSTAT_DEVICE_CONNECT_MASK;
-}
-
-//--------------------------------------------------------------------+
-// DCD Endpoint Port
-//--------------------------------------------------------------------+
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- // TODO cannot able to STALL Control OUT endpoint !!!!! FIXME try some walk-around
- uint8_t const ep_id = ep_addr2id(ep_addr);
- _dcd.ep[ep_id][0].stall = 1;
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t const ep_id = ep_addr2id(ep_addr);
-
- _dcd.ep[ep_id][0].stall = 0;
- _dcd.ep[ep_id][0].toggle_reset = 1;
- _dcd.ep[ep_id][0].toggle_mode = 0;
-}
-
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
-{
- (void) rhport;
-
- // TODO not support ISO yet
- TU_VERIFY(p_endpoint_desc->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS);
-
- //------------- Prepare Queue Head -------------//
- uint8_t ep_id = ep_addr2id(p_endpoint_desc->bEndpointAddress);
-
- // Check if endpoint is available
- TU_ASSERT( _dcd.ep[ep_id][0].disable && _dcd.ep[ep_id][1].disable );
-
- tu_memclr(_dcd.ep[ep_id], 2*sizeof(ep_cmd_sts_t));
- _dcd.ep[ep_id][0].is_iso = (p_endpoint_desc->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS);
-
- // Enable EP interrupt
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
- dcd_reg->INTEN |= TU_BIT(ep_id);
-
- return true;
-}
-
-static void prepare_setup_packet(uint8_t rhport)
-{
- if (_dcd_controller[rhport].max_speed == TUSB_SPEED_FULL )
- {
- _dcd.ep[0][1].buffer_fs.offset = get_buf_offset(_dcd.setup_packet);;
- }else
- {
- _dcd.ep[0][1].buffer_hs.offset = get_buf_offset(_dcd.setup_packet);;
- }
-}
-
-static void prepare_ep_xfer(uint8_t rhport, uint8_t ep_id, uint16_t buf_offset, uint16_t total_bytes)
-{
- uint16_t nbytes;
-
- if (_dcd_controller[rhport].max_speed == TUSB_SPEED_FULL )
- {
- // TODO ISO FullSpeed can have up to 1023 bytes
- nbytes = tu_min16(total_bytes, NBYTES_CBI_FULLSPEED_MAX);
- _dcd.ep[ep_id][0].buffer_fs.offset = buf_offset;
- _dcd.ep[ep_id][0].buffer_fs.nbytes = nbytes;
- }else
- {
- nbytes = tu_min16(total_bytes, NBYTES_CBI_HIGHSPEED_MAX);
- _dcd.ep[ep_id][0].buffer_hs.offset = buf_offset;
- _dcd.ep[ep_id][0].buffer_hs.nbytes = nbytes;
- }
-
- _dcd.dma[ep_id].nbytes = nbytes;
-
- _dcd.ep[ep_id][0].active = 1;
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t* buffer, uint16_t total_bytes)
-{
- (void) rhport;
-
- uint8_t const ep_id = ep_addr2id(ep_addr);
-
- tu_memclr(&_dcd.dma[ep_id], sizeof(xfer_dma_t));
- _dcd.dma[ep_id].total_bytes = total_bytes;
-
- prepare_ep_xfer(rhport, ep_id, get_buf_offset(buffer), total_bytes);
-
- return true;
-}
-
-//--------------------------------------------------------------------+
-// IRQ
-//--------------------------------------------------------------------+
-static void bus_reset(uint8_t rhport)
-{
- tu_memclr(&_dcd, sizeof(dcd_data_t));
-
- // disable all non-control endpoints on bus reset
- for(uint8_t ep_id = 2; ep_id < 2*MAX_EP_PAIRS; ep_id++)
- {
- _dcd.ep[ep_id][0].disable = _dcd.ep[ep_id][1].disable = 1;
- }
-
- prepare_setup_packet(rhport);
-
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
-
- dcd_reg->EPINUSE = 0;
- dcd_reg->EPBUFCFG = 0;
- dcd_reg->EPSKIP = 0xFFFFFFFF;
-
- dcd_reg->INTSTAT = dcd_reg->INTSTAT; // clear all pending interrupt
- dcd_reg->DEVCMDSTAT |= CMDSTAT_SETUP_RECEIVED_MASK; // clear setup received interrupt
- dcd_reg->INTEN = INT_DEVICE_STATUS_MASK | TU_BIT(0) | TU_BIT(1); // enable device status & control endpoints
-}
-
-static void process_xfer_isr(uint8_t rhport, uint32_t int_status)
-{
- uint8_t const max_ep = 2*_dcd_controller[rhport].ep_pairs;
-
- for(uint8_t ep_id = 0; ep_id < max_ep; ep_id++ )
- {
- if ( tu_bit_test(int_status, ep_id) )
- {
- ep_cmd_sts_t * ep_cs = &_dcd.ep[ep_id][0];
- xfer_dma_t* xfer_dma = &_dcd.dma[ep_id];
-
- if ( ep_id == 0 || ep_id == 1)
- {
- // For control endpoint, we need to manually clear Active bit
- ep_cs->active = 0;
- }
-
- uint16_t buf_offset;
- uint16_t buf_nbytes;
-
- if (_dcd_controller[rhport].max_speed == TUSB_SPEED_FULL)
- {
- buf_offset = ep_cs->buffer_fs.offset;
- buf_nbytes = ep_cs->buffer_fs.nbytes;
- }else
- {
- buf_offset = ep_cs->buffer_hs.offset;
- buf_nbytes = ep_cs->buffer_hs.nbytes;
- }
-
- xfer_dma->xferred_bytes += xfer_dma->nbytes - buf_nbytes;
-
- if ( (buf_nbytes == 0) && (xfer_dma->total_bytes > xfer_dma->xferred_bytes) )
- {
- // There is more data to transfer
- // buff_offset has been already increased by hw to correct value for next transfer
- prepare_ep_xfer(rhport, ep_id, buf_offset, xfer_dma->total_bytes - xfer_dma->xferred_bytes);
- }
- else
- {
- // for detecting ZLP
- xfer_dma->total_bytes = xfer_dma->xferred_bytes;
-
- uint8_t const ep_addr = tu_edpt_addr(ep_id / 2, ep_id & 0x01);
-
- // TODO no way determine if the transfer is failed or not
- dcd_event_xfer_complete(rhport, ep_addr, xfer_dma->xferred_bytes, XFER_RESULT_SUCCESS, true);
- }
- }
- }
-}
-
-void dcd_int_handler(uint8_t rhport)
-{
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
-
- uint32_t const cmd_stat = dcd_reg->DEVCMDSTAT;
-
- uint32_t int_status = dcd_reg->INTSTAT & dcd_reg->INTEN;
- dcd_reg->INTSTAT = int_status; // Acknowledge handled interrupt
-
- if (int_status == 0) return;
-
- //------------- Device Status -------------//
- if ( int_status & INT_DEVICE_STATUS_MASK )
- {
- dcd_reg->DEVCMDSTAT |= CMDSTAT_RESET_CHANGE_MASK | CMDSTAT_CONNECT_CHANGE_MASK | CMDSTAT_SUSPEND_CHANGE_MASK;
-
- if ( cmd_stat & CMDSTAT_RESET_CHANGE_MASK) // bus reset
- {
- bus_reset(rhport);
-
- tusb_speed_t speed = TUSB_SPEED_FULL;
-
- if (_dcd_controller[rhport].max_speed == TUSB_SPEED_HIGH)
- {
- // 0 : reserved, 1 : full, 2 : high, 3: super
- if ( 2 == ((cmd_stat >> CMDSTAT_SPEED_SHIFT) & 0x3UL) )
- {
- speed= TUSB_SPEED_HIGH;
- }
- }
-
- dcd_event_bus_reset(rhport, speed, true);
- }
-
- if (cmd_stat & CMDSTAT_CONNECT_CHANGE_MASK)
- {
- // device disconnect
- if (cmd_stat & CMDSTAT_DEVICE_ADDR_MASK)
- {
- // debouncing as this can be set when device is powering
- dcd_event_bus_signal(rhport, DCD_EVENT_UNPLUGGED, true);
- }
- }
-
- // TODO support suspend & resume
- if (cmd_stat & CMDSTAT_SUSPEND_CHANGE_MASK)
- {
- if (cmd_stat & CMDSTAT_DEVICE_SUSPEND_MASK)
- { // suspend signal, bus idle for more than 3ms
- // Note: Host may delay more than 3 ms before and/or after bus reset before doing enumeration.
- if (cmd_stat & CMDSTAT_DEVICE_ADDR_MASK)
- {
- dcd_event_bus_signal(rhport, DCD_EVENT_SUSPEND, true);
- }
- }
- }
-// else
-// { // resume signal
-// dcd_event_bus_signal(rhport, DCD_EVENT_RESUME, true);
-// }
-// }
- }
-
- // Setup Receive
- if ( tu_bit_test(int_status, 0) && (cmd_stat & CMDSTAT_SETUP_RECEIVED_MASK) )
- {
- // Follow UM flowchart to clear Active & Stall on both Control IN/OUT endpoints
- _dcd.ep[0][0].active = _dcd.ep[1][0].active = 0;
- _dcd.ep[0][0].stall = _dcd.ep[1][0].stall = 0;
-
- dcd_reg->DEVCMDSTAT |= CMDSTAT_SETUP_RECEIVED_MASK;
-
- dcd_event_setup_received(rhport, _dcd.setup_packet, true);
-
- // keep waiting for next setup
- prepare_setup_packet(rhport);
-
- // clear bit0
- int_status = tu_bit_clear(int_status, 0);
- }
-
- // Endpoint transfer complete interrupt
- process_xfer_isr(rhport, int_status);
-}
-
-#endif
-
diff --git a/tinyusb/src/portable/nxp/transdimension/common_transdimension.h b/tinyusb/src/portable/nxp/transdimension/common_transdimension.h
deleted file mode 100755
index 69074de4..00000000
--- a/tinyusb/src/portable/nxp/transdimension/common_transdimension.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021, Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef COMMON_TRANSDIMENSION_H_
-#define COMMON_TRANSDIMENSION_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-// USBCMD
-enum {
- USBCMD_RUN_STOP = TU_BIT(0),
- USBCMD_RESET = TU_BIT(1),
- USBCMD_SETUP_TRIPWIRE = TU_BIT(13),
- USBCMD_ADD_QTD_TRIPWIRE = TU_BIT(14) ///< This bit is used as a semaphore to ensure the to proper addition of a new dTD to an active (primed) endpoint’s linked list. This bit is set and cleared by software during the process of adding a new dTD
-// Interrupt Threshold bit 23:16
-};
-
-// PORTSC1
-#define PORTSC1_PORT_SPEED_POS 26
-
-enum {
- PORTSC1_CURRENT_CONNECT_STATUS = TU_BIT(0),
- PORTSC1_FORCE_PORT_RESUME = TU_BIT(6),
- PORTSC1_SUSPEND = TU_BIT(7),
- PORTSC1_FORCE_FULL_SPEED = TU_BIT(24),
- PORTSC1_PORT_SPEED = TU_BIT(26) | TU_BIT(27)
-};
-
-// OTGSC
-enum {
- OTGSC_VBUS_DISCHARGE = TU_BIT(0),
- OTGSC_VBUS_CHARGE = TU_BIT(1),
-// OTGSC_HWASSIST_AUTORESET = TU_BIT(2),
- OTGSC_OTG_TERMINATION = TU_BIT(3), ///< Must set to 1 when OTG go to device mode
- OTGSC_DATA_PULSING = TU_BIT(4),
- OTGSC_ID_PULLUP = TU_BIT(5),
-// OTGSC_HWASSIT_DATA_PULSE = TU_BIT(6),
-// OTGSC_HWASSIT_BDIS_ACONN = TU_BIT(7),
- OTGSC_ID = TU_BIT(8), ///< 0 = A device, 1 = B Device
- OTGSC_A_VBUS_VALID = TU_BIT(9),
- OTGSC_A_SESSION_VALID = TU_BIT(10),
- OTGSC_B_SESSION_VALID = TU_BIT(11),
- OTGSC_B_SESSION_END = TU_BIT(12),
- OTGSC_1MS_TOGGLE = TU_BIT(13),
- OTGSC_DATA_BUS_PULSING_STATUS = TU_BIT(14),
-};
-
-// USBMode
-enum {
- USBMODE_CM_DEVICE = 2,
- USBMODE_CM_HOST = 3,
-
- USBMODE_SLOM = TU_BIT(3),
- USBMODE_SDIS = TU_BIT(4),
-
- USBMODE_VBUS_POWER_SELECT = TU_BIT(5), // Need to be enabled for LPC18XX/43XX in host mode
-};
-
-// Device Registers
-typedef struct
-{
- //------------- ID + HW Parameter Registers-------------//
- __I uint32_t TU_RESERVED[64]; ///< For iMX RT10xx, but not used by LPC18XX/LPC43XX
-
- //------------- Capability Registers-------------//
- __I uint8_t CAPLENGTH; ///< Capability Registers Length
- __I uint8_t TU_RESERVED[1];
- __I uint16_t HCIVERSION; ///< Host Controller Interface Version
-
- __I uint32_t HCSPARAMS; ///< Host Controller Structural Parameters
- __I uint32_t HCCPARAMS; ///< Host Controller Capability Parameters
- __I uint32_t TU_RESERVED[5];
-
- __I uint16_t DCIVERSION; ///< Device Controller Interface Version
- __I uint8_t TU_RESERVED[2];
-
- __I uint32_t DCCPARAMS; ///< Device Controller Capability Parameters
- __I uint32_t TU_RESERVED[6];
-
- //------------- Operational Registers -------------//
- __IO uint32_t USBCMD; ///< USB Command Register
- __IO uint32_t USBSTS; ///< USB Status Register
- __IO uint32_t USBINTR; ///< Interrupt Enable Register
- __IO uint32_t FRINDEX; ///< USB Frame Index
- __I uint32_t TU_RESERVED;
- __IO uint32_t DEVICEADDR; ///< Device Address
- __IO uint32_t ENDPTLISTADDR; ///< Endpoint List Address
- __I uint32_t TU_RESERVED;
- __IO uint32_t BURSTSIZE; ///< Programmable Burst Size
- __IO uint32_t TXFILLTUNING; ///< TX FIFO Fill Tuning
- uint32_t TU_RESERVED[4];
- __IO uint32_t ENDPTNAK; ///< Endpoint NAK
- __IO uint32_t ENDPTNAKEN; ///< Endpoint NAK Enable
- __I uint32_t TU_RESERVED;
- __IO uint32_t PORTSC1; ///< Port Status & Control
- __I uint32_t TU_RESERVED[7];
- __IO uint32_t OTGSC; ///< On-The-Go Status & control
- __IO uint32_t USBMODE; ///< USB Device Mode
- __IO uint32_t ENDPTSETUPSTAT; ///< Endpoint Setup Status
- __IO uint32_t ENDPTPRIME; ///< Endpoint Prime
- __IO uint32_t ENDPTFLUSH; ///< Endpoint Flush
- __I uint32_t ENDPTSTAT; ///< Endpoint Status
- __IO uint32_t ENDPTCOMPLETE; ///< Endpoint Complete
- __IO uint32_t ENDPTCTRL[8]; ///< Endpoint Control 0 - 7
-} dcd_registers_t, hcd_registers_t;
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* COMMON_TRANSDIMENSION_H_ */
diff --git a/tinyusb/src/portable/nxp/transdimension/dcd_transdimension.c b/tinyusb/src/portable/nxp/transdimension/dcd_transdimension.c
deleted file mode 100755
index eeab3f48..00000000
--- a/tinyusb/src/portable/nxp/transdimension/dcd_transdimension.c
+++ /dev/null
@@ -1,492 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && \
- (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX)
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#if CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
- #include "fsl_device_registers.h"
- #define INCLUDE_FSL_DEVICE_REGISTERS
-#else
- // LPCOpen for 18xx & 43xx
- #include "chip.h"
-#endif
-
-#include "common/tusb_common.h"
-#include "device/dcd.h"
-#include "common_transdimension.h"
-
-#if defined(__CORTEX_M) && __CORTEX_M == 7 && __DCACHE_PRESENT == 1
- #define CleanInvalidateDCache_by_Addr SCB_CleanInvalidateDCache_by_Addr
-#else
- #define CleanInvalidateDCache_by_Addr(_addr, _dsize)
-#endif
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-// ENDPTCTRL
-enum {
- ENDPTCTRL_STALL = TU_BIT(0),
- ENDPTCTRL_TOGGLE_INHIBIT = TU_BIT(5), ///< used for test only
- ENDPTCTRL_TOGGLE_RESET = TU_BIT(6),
- ENDPTCTRL_ENABLE = TU_BIT(7)
-};
-
-// USBSTS, USBINTR
-enum {
- INTR_USB = TU_BIT(0),
- INTR_ERROR = TU_BIT(1),
- INTR_PORT_CHANGE = TU_BIT(2),
- INTR_RESET = TU_BIT(6),
- INTR_SOF = TU_BIT(7),
- INTR_SUSPEND = TU_BIT(8),
- INTR_NAK = TU_BIT(16)
-};
-
-// Queue Transfer Descriptor
-typedef struct
-{
- // Word 0: Next QTD Pointer
- uint32_t next; ///< Next link pointer This field contains the physical memory address of the next dTD to be processed
-
- // Word 1: qTQ Token
- uint32_t : 3 ;
- volatile uint32_t xact_err : 1 ;
- uint32_t : 1 ;
- volatile uint32_t buffer_err : 1 ;
- volatile uint32_t halted : 1 ;
- volatile uint32_t active : 1 ;
- uint32_t : 2 ;
- uint32_t iso_mult_override : 2 ; ///< This field can be used for transmit ISOs to override the MULT field in the dQH. This field must be zero for all packet types that are not transmit-ISO.
- uint32_t : 3 ;
- uint32_t int_on_complete : 1 ;
- volatile uint32_t total_bytes : 15 ;
- uint32_t : 0 ;
-
- // Word 2-6: Buffer Page Pointer List, Each element in the list is a 4K page aligned, physical memory address. The lower 12 bits in each pointer are reserved (except for the first one) as each memory pointer must reference the start of a 4K page
- uint32_t buffer[5]; ///< buffer1 has frame_n for TODO Isochronous
-
- //------------- DCD Area -------------//
- uint16_t expected_bytes;
- uint8_t reserved[2];
-} dcd_qtd_t;
-
-TU_VERIFY_STATIC( sizeof(dcd_qtd_t) == 32, "size is not correct");
-
-// Queue Head
-typedef struct
-{
- // Word 0: Capabilities and Characteristics
- uint32_t : 15 ; ///< Number of packets executed per transaction descriptor 00 - Execute N transactions as demonstrated by the USB variable length protocol where N is computed using Max_packet_length and the Total_bytes field in the dTD. 01 - Execute one transaction 10 - Execute two transactions 11 - Execute three transactions Remark: Non-isochronous endpoints must set MULT = 00. Remark: Isochronous endpoints must set MULT = 01, 10, or 11 as needed.
- uint32_t int_on_setup : 1 ; ///< Interrupt on setup This bit is used on control type endpoints to indicate if USBINT is set in response to a setup being received.
- uint32_t max_package_size : 11 ; ///< This directly corresponds to the maximum packet size of the associated endpoint (wMaxPacketSize)
- uint32_t : 2 ;
- uint32_t zero_length_termination : 1 ; ///< This bit is used for non-isochronous endpoints to indicate when a zero-length packet is received to terminate transfers in case the total transfer length is “multiple”. 0 - Enable zero-length packet to terminate transfers equal to a multiple of Max_packet_length (default). 1 - Disable zero-length packet on transfers that are equal in length to a multiple Max_packet_length.
- uint32_t iso_mult : 2 ; ///<
- uint32_t : 0 ;
-
- // Word 1: Current qTD Pointer
- volatile uint32_t qtd_addr;
-
- // Word 2-9: Transfer Overlay
- volatile dcd_qtd_t qtd_overlay;
-
- // Word 10-11: Setup request (control OUT only)
- volatile tusb_control_request_t setup_request;
-
- //--------------------------------------------------------------------+
- /// Due to the fact QHD is 64 bytes aligned but occupies only 48 bytes
- /// thus there are 16 bytes padding free that we can make use of.
- //--------------------------------------------------------------------+
- uint8_t reserved[16];
-} dcd_qhd_t;
-
-TU_VERIFY_STATIC( sizeof(dcd_qhd_t) == 64, "size is not correct");
-
-//--------------------------------------------------------------------+
-// Variables
-//--------------------------------------------------------------------+
-
-typedef struct
-{
- dcd_registers_t* regs; // registers
- const IRQn_Type irqnum; // IRQ number
- const uint8_t ep_count; // Max bi-directional Endpoints
-}dcd_controller_t;
-
-#if CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
- // Each endpoint with direction (IN/OUT) occupies a queue head
- // Therefore QHD_MAX is 2 x max endpoint count
- #define QHD_MAX (8*2)
-
- static const dcd_controller_t _dcd_controller[] =
- {
- // RT1010 and RT1020 only has 1 USB controller
- #if FSL_FEATURE_SOC_USBHS_COUNT == 1
- { .regs = (dcd_registers_t*) USB_BASE , .irqnum = USB_OTG1_IRQn, .ep_count = 8 }
- #else
- { .regs = (dcd_registers_t*) USB1_BASE, .irqnum = USB_OTG1_IRQn, .ep_count = 8 },
- { .regs = (dcd_registers_t*) USB2_BASE, .irqnum = USB_OTG2_IRQn, .ep_count = 8 }
- #endif
- };
-
-#else
- #define QHD_MAX (6*2)
-
- static const dcd_controller_t _dcd_controller[] =
- {
- { .regs = (dcd_registers_t*) LPC_USB0_BASE, .irqnum = USB0_IRQn, .ep_count = 6 },
- { .regs = (dcd_registers_t*) LPC_USB1_BASE, .irqnum = USB1_IRQn, .ep_count = 4 }
- };
-#endif
-
-#define QTD_NEXT_INVALID 0x01
-
-typedef struct {
- // Must be at 2K alignment
- dcd_qhd_t qhd[QHD_MAX] TU_ATTR_ALIGNED(64);
- dcd_qtd_t qtd[QHD_MAX] TU_ATTR_ALIGNED(32); // for portability, TinyUSB only queue 1 TD for each Qhd
-}dcd_data_t;
-
-CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(2048)
-static dcd_data_t _dcd_data;
-
-//--------------------------------------------------------------------+
-// Controller API
-//--------------------------------------------------------------------+
-
-/// follows LPC43xx User Manual 23.10.3
-static void bus_reset(uint8_t rhport)
-{
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
-
- // The reset value for all endpoint types is the control endpoint. If one endpoint
- // direction is enabled and the paired endpoint of opposite direction is disabled, then the
- // endpoint type of the unused direction must be changed from the control type to any other
- // type (e.g. bulk). Leaving an un-configured endpoint control will cause undefined behavior
- // for the data PID tracking on the active endpoint.
- for( int i=1; i < _dcd_controller[rhport].ep_count; i++)
- {
- dcd_reg->ENDPTCTRL[i] = (TUSB_XFER_BULK << 2) | (TUSB_XFER_BULK << 18);
- }
-
- //------------- Clear All Registers -------------//
- dcd_reg->ENDPTNAK = dcd_reg->ENDPTNAK;
- dcd_reg->ENDPTNAKEN = 0;
- dcd_reg->USBSTS = dcd_reg->USBSTS;
- dcd_reg->ENDPTSETUPSTAT = dcd_reg->ENDPTSETUPSTAT;
- dcd_reg->ENDPTCOMPLETE = dcd_reg->ENDPTCOMPLETE;
-
- while (dcd_reg->ENDPTPRIME) {}
- dcd_reg->ENDPTFLUSH = 0xFFFFFFFF;
- while (dcd_reg->ENDPTFLUSH) {}
-
- // read reset bit in portsc
-
- //------------- Queue Head & Queue TD -------------//
- tu_memclr(&_dcd_data, sizeof(dcd_data_t));
-
- //------------- Set up Control Endpoints (0 OUT, 1 IN) -------------//
- _dcd_data.qhd[0].zero_length_termination = _dcd_data.qhd[1].zero_length_termination = 1;
- _dcd_data.qhd[0].max_package_size = _dcd_data.qhd[1].max_package_size = CFG_TUD_ENDPOINT0_SIZE;
- _dcd_data.qhd[0].qtd_overlay.next = _dcd_data.qhd[1].qtd_overlay.next = QTD_NEXT_INVALID;
-
- _dcd_data.qhd[0].int_on_setup = 1; // OUT only
-}
-
-void dcd_init(uint8_t rhport)
-{
- tu_memclr(&_dcd_data, sizeof(dcd_data_t));
-
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
-
- // Reset controller
- dcd_reg->USBCMD |= USBCMD_RESET;
- while( dcd_reg->USBCMD & USBCMD_RESET ) {}
-
- // Set mode to device, must be set immediately after reset
- dcd_reg->USBMODE = USBMODE_CM_DEVICE;
- dcd_reg->OTGSC = OTGSC_VBUS_DISCHARGE | OTGSC_OTG_TERMINATION;
-
- // TODO Force fullspeed on non-highspeed port
- // dcd_reg->PORTSC1 = PORTSC1_FORCE_FULL_SPEED;
-
- CleanInvalidateDCache_by_Addr((uint32_t*) &_dcd_data, sizeof(dcd_data_t));
-
- dcd_reg->ENDPTLISTADDR = (uint32_t) _dcd_data.qhd; // Endpoint List Address has to be 2K alignment
- dcd_reg->USBSTS = dcd_reg->USBSTS;
- dcd_reg->USBINTR = INTR_USB | INTR_ERROR | INTR_PORT_CHANGE | INTR_RESET | INTR_SUSPEND /*| INTR_SOF*/;
-
- dcd_reg->USBCMD &= ~0x00FF0000; // Interrupt Threshold Interval = 0
- dcd_reg->USBCMD |= USBCMD_RUN_STOP; // Connect
-}
-
-void dcd_int_enable(uint8_t rhport)
-{
- NVIC_EnableIRQ(_dcd_controller[rhport].irqnum);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- NVIC_DisableIRQ(_dcd_controller[rhport].irqnum);
-}
-
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- // Response with status first before changing device address
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
- dcd_reg->DEVICEADDR = (dev_addr << 25) | TU_BIT(24);
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
-}
-
-void dcd_connect(uint8_t rhport)
-{
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
- dcd_reg->USBCMD |= USBCMD_RUN_STOP;
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
- dcd_reg->USBCMD &= ~USBCMD_RUN_STOP;
-}
-
-//--------------------------------------------------------------------+
-// HELPER
-//--------------------------------------------------------------------+
-// index to bit position in register
-static inline uint8_t ep_idx2bit(uint8_t ep_idx)
-{
- return ep_idx/2 + ( (ep_idx%2) ? 16 : 0);
-}
-
-static void qtd_init(dcd_qtd_t* p_qtd, void * data_ptr, uint16_t total_bytes)
-{
- tu_memclr(p_qtd, sizeof(dcd_qtd_t));
-
- p_qtd->next = QTD_NEXT_INVALID;
- p_qtd->active = 1;
- p_qtd->total_bytes = p_qtd->expected_bytes = total_bytes;
-
- if (data_ptr != NULL)
- {
- p_qtd->buffer[0] = (uint32_t) data_ptr;
- for(uint8_t i=1; i<5; i++)
- {
- p_qtd->buffer[i] |= tu_align4k( p_qtd->buffer[i-1] ) + 4096;
- }
- }
-}
-
-//--------------------------------------------------------------------+
-// DCD Endpoint Port
-//--------------------------------------------------------------------+
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
- dcd_reg->ENDPTCTRL[epnum] |= ENDPTCTRL_STALL << (dir ? 16 : 0);
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- // data toggle also need to be reset
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
- dcd_reg->ENDPTCTRL[epnum] |= ENDPTCTRL_TOGGLE_RESET << ( dir ? 16 : 0 );
- dcd_reg->ENDPTCTRL[epnum] &= ~(ENDPTCTRL_STALL << ( dir ? 16 : 0));
-}
-
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
-{
- // TODO not support ISO yet
- TU_VERIFY ( p_endpoint_desc->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS);
-
- uint8_t const epnum = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
- uint8_t const dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress);
- uint8_t const ep_idx = 2*epnum + dir;
-
- // Must not exceed max endpoint number
- TU_ASSERT( epnum < _dcd_controller[rhport].ep_count );
-
- //------------- Prepare Queue Head -------------//
- dcd_qhd_t * p_qhd = &_dcd_data.qhd[ep_idx];
- tu_memclr(p_qhd, sizeof(dcd_qhd_t));
-
- p_qhd->zero_length_termination = 1;
- p_qhd->max_package_size = p_endpoint_desc->wMaxPacketSize.size;
- p_qhd->qtd_overlay.next = QTD_NEXT_INVALID;
-
- CleanInvalidateDCache_by_Addr((uint32_t*) &_dcd_data, sizeof(dcd_data_t));
-
- // Enable EP Control
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
- dcd_reg->ENDPTCTRL[epnum] |= ((p_endpoint_desc->bmAttributes.xfer << 2) | ENDPTCTRL_ENABLE | ENDPTCTRL_TOGGLE_RESET) << (dir ? 16 : 0);
-
- return true;
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
- uint8_t const ep_idx = 2*epnum + dir;
-
- if ( epnum == 0 )
- {
- // follows UM 24.10.8.1.1 Setup packet handling using setup lockout mechanism
- // wait until ENDPTSETUPSTAT before priming data/status in response TODO add time out
- while(dcd_reg->ENDPTSETUPSTAT & TU_BIT(0)) {}
- }
-
- dcd_qhd_t * p_qhd = &_dcd_data.qhd[ep_idx];
- dcd_qtd_t * p_qtd = &_dcd_data.qtd[ep_idx];
-
- // Force the CPU to flush the buffer. We increase the size by 32 because the call aligns the
- // address to 32-byte boundaries.
- // void* cast to suppress cast-align warning, buffer must be
- CleanInvalidateDCache_by_Addr((uint32_t*) tu_align((uint32_t) buffer, 4), total_bytes + 31);
-
- //------------- Prepare qtd -------------//
- qtd_init(p_qtd, buffer, total_bytes);
- p_qtd->int_on_complete = true;
- p_qhd->qtd_overlay.next = (uint32_t) p_qtd; // link qtd to qhd
-
- CleanInvalidateDCache_by_Addr((uint32_t*) &_dcd_data, sizeof(dcd_data_t));
-
- // start transfer
- dcd_reg->ENDPTPRIME = TU_BIT( ep_idx2bit(ep_idx) ) ;
-
- return true;
-}
-
-//--------------------------------------------------------------------+
-// ISR
-//--------------------------------------------------------------------+
-void dcd_int_handler(uint8_t rhport)
-{
- dcd_registers_t* const dcd_reg = _dcd_controller[rhport].regs;
-
- uint32_t const int_enable = dcd_reg->USBINTR;
- uint32_t const int_status = dcd_reg->USBSTS & int_enable;
- dcd_reg->USBSTS = int_status; // Acknowledge handled interrupt
-
- // disabled interrupt sources
- if (int_status == 0) return;
-
- if (int_status & INTR_RESET)
- {
- bus_reset(rhport);
- uint32_t speed = (dcd_reg->PORTSC1 & PORTSC1_PORT_SPEED) >> PORTSC1_PORT_SPEED_POS;
- dcd_event_bus_reset(rhport, (tusb_speed_t) speed, true);
- }
-
- if (int_status & INTR_SUSPEND)
- {
- if (dcd_reg->PORTSC1 & PORTSC1_SUSPEND)
- {
- // Note: Host may delay more than 3 ms before and/or after bus reset before doing enumeration.
- if ((dcd_reg->DEVICEADDR >> 25) & 0x0f)
- {
- dcd_event_bus_signal(rhport, DCD_EVENT_SUSPEND, true);
- }
- }
- }
-
- // Make sure we read the latest version of _dcd_data.
- CleanInvalidateDCache_by_Addr((uint32_t*) &_dcd_data, sizeof(dcd_data_t));
-
- // TODO disconnection does not generate interrupt !!!!!!
-// if (int_status & INTR_PORT_CHANGE)
-// {
-// if ( !(dcd_reg->PORTSC1 & PORTSC1_CURRENT_CONNECT_STATUS) )
-// {
-// dcd_event_t event = { .rhport = rhport, .event_id = DCD_EVENT_UNPLUGGED };
-// dcd_event_handler(&event, true);
-// }
-// }
-
- if (int_status & INTR_USB)
- {
- uint32_t const edpt_complete = dcd_reg->ENDPTCOMPLETE;
- dcd_reg->ENDPTCOMPLETE = edpt_complete; // acknowledge
-
- if (dcd_reg->ENDPTSETUPSTAT)
- {
- //------------- Set up Received -------------//
- // 23.10.10.2 Operational model for setup transfers
- dcd_reg->ENDPTSETUPSTAT = dcd_reg->ENDPTSETUPSTAT;// acknowledge
-
- dcd_event_setup_received(rhport, (uint8_t*) &_dcd_data.qhd[0].setup_request, true);
- }
-
- if ( edpt_complete )
- {
- for(uint8_t ep_idx = 0; ep_idx < QHD_MAX; ep_idx++)
- {
- if ( tu_bit_test(edpt_complete, ep_idx2bit(ep_idx)) )
- {
- // 23.10.12.3 Failed QTD also get ENDPTCOMPLETE set
- dcd_qtd_t * p_qtd = &_dcd_data.qtd[ep_idx];
-
- uint8_t result = p_qtd->halted ? XFER_RESULT_STALLED :
- ( p_qtd->xact_err ||p_qtd->buffer_err ) ? XFER_RESULT_FAILED : XFER_RESULT_SUCCESS;
-
- uint8_t const ep_addr = (ep_idx/2) | ( (ep_idx & 0x01) ? TUSB_DIR_IN_MASK : 0 );
- dcd_event_xfer_complete(rhport, ep_addr, p_qtd->expected_bytes - p_qtd->total_bytes, result, true); // only number of bytes in the IOC qtd
- }
- }
- }
- }
-
- if (int_status & INTR_SOF)
- {
- dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true);
- }
-
- if (int_status & INTR_NAK) {}
- if (int_status & INTR_ERROR) TU_ASSERT(false, );
-}
-
-#endif
diff --git a/tinyusb/src/portable/nxp/transdimension/hcd_transdimension.c b/tinyusb/src/portable/nxp/transdimension/hcd_transdimension.c
deleted file mode 100755
index d216f072..00000000
--- a/tinyusb/src/portable/nxp/transdimension/hcd_transdimension.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-// NXP Trans-Dimension USB IP implement EHCI for host functionality
-
-#if TUSB_OPT_HOST_ENABLED && \
- (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX)
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#if CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
- #include "fsl_device_registers.h"
-#else
- // LPCOpen for 18xx & 43xx
- #include "chip.h"
-#endif
-
-#include "common/tusb_common.h"
-#include "common_transdimension.h"
-#include "portable/ehci/ehci_api.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-// TODO can be merged with dcd_controller_t
-typedef struct
-{
- uint32_t regs_base; // registers base
- const IRQn_Type irqnum; // IRQ number
-}hcd_controller_t;
-
-#if CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
- static const hcd_controller_t _hcd_controller[] =
- {
- // RT1010 and RT1020 only has 1 USB controller
- #if FSL_FEATURE_SOC_USBHS_COUNT == 1
- { .regs_base = USB_BASE , .irqnum = USB_OTG1_IRQn }
- #else
- { .regs_base = USB1_BASE, .irqnum = USB_OTG1_IRQn },
- { .regs_base = USB2_BASE, .irqnum = USB_OTG2_IRQn }
- #endif
- };
-
-#else
- static const hcd_controller_t _hcd_controller[] =
- {
- { .regs_base = LPC_USB0_BASE, .irqnum = USB0_IRQn },
- { .regs_base = LPC_USB1_BASE, .irqnum = USB1_IRQn }
- };
-#endif
-
-//--------------------------------------------------------------------+
-// Controller API
-//--------------------------------------------------------------------+
-
-bool hcd_init(uint8_t rhport)
-{
- hcd_registers_t* hcd_reg = (hcd_registers_t*) _hcd_controller[rhport].regs_base;
-
- // Reset controller
- hcd_reg->USBCMD |= USBCMD_RESET;
- while( hcd_reg->USBCMD & USBCMD_RESET ) {}
-
- // Set mode to device, must be set immediately after reset
-#if CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX
- // LPC18XX/43XX need to set VBUS Power Select to HIGH
- // RHPORT1 is fullspeed only (need external PHY for Highspeed)
- hcd_reg->USBMODE = USBMODE_CM_HOST | USBMODE_VBUS_POWER_SELECT;
- if (rhport == 1) hcd_reg->PORTSC1 |= PORTSC1_FORCE_FULL_SPEED;
-#else
- hcd_reg->USBMODE = USBMODE_CM_HOST;
-#endif
-
- // FIXME force full speed, still have issue with Highspeed enumeration
- hcd_reg->PORTSC1 |= PORTSC1_FORCE_FULL_SPEED;
-
- return ehci_init(rhport, (uint32_t) &hcd_reg->CAPLENGTH, (uint32_t) &hcd_reg->USBCMD);
-}
-
-void hcd_int_enable(uint8_t rhport)
-{
- NVIC_EnableIRQ(_hcd_controller[rhport].irqnum);
-}
-
-void hcd_int_disable(uint8_t rhport)
-{
- NVIC_DisableIRQ(_hcd_controller[rhport].irqnum);
-}
-
-#endif
diff --git a/tinyusb/src/portable/ohci/ohci.c b/tinyusb/src/portable/ohci/ohci.c
deleted file mode 100755
index bcee3493..00000000
--- a/tinyusb/src/portable/ohci/ohci.c
+++ /dev/null
@@ -1,657 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "host/hcd_attr.h"
-
-#if TUSB_OPT_HOST_ENABLED && defined(HCD_ATTR_OHCI)
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "osal/osal.h"
-
-#include "host/hcd.h"
-#include "ohci.h"
-
-// TODO remove
-#include "chip.h"
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-#define OHCI_REG ((ohci_registers_t *) LPC_USB_BASE)
-
-enum {
- OHCI_CONTROL_FUNCSTATE_RESET = 0,
- OHCI_CONTROL_FUNCSTATE_RESUME,
- OHCI_CONTROL_FUNCSTATE_OPERATIONAL,
- OHCI_CONTROL_FUNCSTATE_SUSPEND
-};
-
-enum {
- OHCI_CONTROL_CONTROL_BULK_RATIO = 3, ///< This specifies the service ratio between Control and Bulk EDs. 0 = 1:1, 3 = 4:1
- OHCI_CONTROL_LIST_PERIODIC_ENABLE_MASK = TU_BIT(2),
- OHCI_CONTROL_LIST_ISOCHRONOUS_ENABLE_MASK = TU_BIT(3),
- OHCI_CONTROL_LIST_CONTROL_ENABLE_MASK = TU_BIT(4),
- OHCI_CONTROL_LIST_BULK_ENABLE_MASK = TU_BIT(5),
-};
-
-enum {
- OHCI_FMINTERVAL_FI = 0x2EDF, // 7.3.1 nominal (reset) value
- OHCI_FMINTERVAL_FSMPS = (6*(OHCI_FMINTERVAL_FI-210)) / 7, // 5.4 calculated based on maximum overhead + bit stuffing
-};
-
-enum {
- OHCI_PERIODIC_START = 0x3E67
-};
-
-enum {
- OHCI_INT_SCHEDULING_OVERUN_MASK = TU_BIT(0),
- OHCI_INT_WRITEBACK_DONEHEAD_MASK = TU_BIT(1),
- OHCI_INT_SOF_MASK = TU_BIT(2),
- OHCI_INT_RESUME_DETECTED_MASK = TU_BIT(3),
- OHCI_INT_UNRECOVERABLE_ERROR_MASK = TU_BIT(4),
- OHCI_INT_FRAME_OVERFLOW_MASK = TU_BIT(5),
- OHCI_INT_RHPORT_STATUS_CHANGE_MASK = TU_BIT(6),
-
- OHCI_INT_OWNERSHIP_CHANGE_MASK = TU_BIT(30),
- OHCI_INT_MASTER_ENABLE_MASK = TU_BIT(31),
-};
-
-enum {
- RHPORT_CURRENT_CONNECT_STATUS_MASK = TU_BIT(0),
- RHPORT_PORT_ENABLE_STATUS_MASK = TU_BIT(1),
- RHPORT_PORT_SUSPEND_STATUS_MASK = TU_BIT(2),
- RHPORT_PORT_OVER_CURRENT_INDICATOR_MASK = TU_BIT(3),
- RHPORT_PORT_RESET_STATUS_MASK = TU_BIT(4), ///< write '1' to reset port
-
- RHPORT_PORT_POWER_STATUS_MASK = TU_BIT(8),
- RHPORT_LOW_SPEED_DEVICE_ATTACHED_MASK = TU_BIT(9),
-
- RHPORT_CONNECT_STATUS_CHANGE_MASK = TU_BIT(16),
- RHPORT_PORT_ENABLE_CHANGE_MASK = TU_BIT(17),
- RHPORT_PORT_SUSPEND_CHANGE_MASK = TU_BIT(18),
- RHPORT_OVER_CURRENT_CHANGE_MASK = TU_BIT(19),
- RHPORT_PORT_RESET_CHANGE_MASK = TU_BIT(20),
-
- RHPORT_ALL_CHANGE_MASK = RHPORT_CONNECT_STATUS_CHANGE_MASK | RHPORT_PORT_ENABLE_CHANGE_MASK |
- RHPORT_PORT_SUSPEND_CHANGE_MASK | RHPORT_OVER_CURRENT_CHANGE_MASK | RHPORT_PORT_RESET_CHANGE_MASK
-};
-
-enum {
- OHCI_CCODE_NO_ERROR = 0,
- OHCI_CCODE_CRC = 1,
- OHCI_CCODE_BIT_STUFFING = 2,
- OHCI_CCODE_DATA_TOGGLE_MISMATCH = 3,
- OHCI_CCODE_STALL = 4,
- OHCI_CCODE_DEVICE_NOT_RESPONDING = 5,
- OHCI_CCODE_PID_CHECK_FAILURE = 6,
- OHCI_CCODE_UNEXPECTED_PID = 7,
- OHCI_CCODE_DATA_OVERRUN = 8,
- OHCI_CCODE_DATA_UNDERRUN = 9,
- OHCI_CCODE_BUFFER_OVERRUN = 12,
- OHCI_CCODE_BUFFER_UNDERRUN = 13,
- OHCI_CCODE_NOT_ACCESSED = 14,
-};
-
-enum {
- OHCI_INT_ON_COMPLETE_YES = 0,
- OHCI_INT_ON_COMPLETE_NO = TU_BIN8(111)
-};
-
-enum {
- GTD_DT_TOGGLE_CARRY = 0,
- GTD_DT_DATA0 = TU_BIT(1) | 0,
- GTD_DT_DATA1 = TU_BIT(1) | 1,
-};
-
-enum {
- PID_SETUP = 0,
- PID_OUT,
- PID_IN,
-};
-
-enum {
- PID_FROM_TD = 0,
-};
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(256) static ohci_data_t ohci_data;
-
-static ohci_ed_t * const p_ed_head[] =
-{
- [TUSB_XFER_CONTROL] = &ohci_data.control[0].ed,
- [TUSB_XFER_BULK ] = &ohci_data.bulk_head_ed,
- [TUSB_XFER_INTERRUPT] = &ohci_data.period_head_ed,
- [TUSB_XFER_ISOCHRONOUS] = NULL // TODO Isochronous
-};
-
-static void ed_list_insert(ohci_ed_t * p_pre, ohci_ed_t * p_ed);
-static void ed_list_remove_by_addr(ohci_ed_t * p_head, uint8_t dev_addr);
-
-//--------------------------------------------------------------------+
-// USBH-HCD API
-//--------------------------------------------------------------------+
-// Initialization according to 5.1.1.4
-bool hcd_init(uint8_t rhport)
-{
- (void) rhport;
-
- //------------- Data Structure init -------------//
- tu_memclr(&ohci_data, sizeof(ohci_data_t));
- for(uint8_t i=0; i<32; i++)
- { // assign all interrupt pointes to period head ed
- ohci_data.hcca.interrupt_table[i] = (uint32_t) &ohci_data.period_head_ed;
- }
-
- ohci_data.control[0].ed.skip = 1;
- ohci_data.bulk_head_ed.skip = 1;
- ohci_data.period_head_ed.skip = 1;
-
- // reset controller
- OHCI_REG->command_status_bit.controller_reset = 1;
- while( OHCI_REG->command_status_bit.controller_reset ) {} // should not take longer than 10 us
-
- //------------- init ohci registers -------------//
- OHCI_REG->control_head_ed = (uint32_t) &ohci_data.control[0].ed;
- OHCI_REG->bulk_head_ed = (uint32_t) &ohci_data.bulk_head_ed;
- OHCI_REG->hcca = (uint32_t) &ohci_data.hcca;
-
- OHCI_REG->interrupt_disable = OHCI_REG->interrupt_enable; // disable all interrupts
- OHCI_REG->interrupt_status = OHCI_REG->interrupt_status; // clear current set bits
- OHCI_REG->interrupt_enable = OHCI_INT_WRITEBACK_DONEHEAD_MASK | OHCI_INT_RESUME_DETECTED_MASK |
- OHCI_INT_UNRECOVERABLE_ERROR_MASK | OHCI_INT_FRAME_OVERFLOW_MASK | OHCI_INT_RHPORT_STATUS_CHANGE_MASK |
- OHCI_INT_MASTER_ENABLE_MASK;
-
- OHCI_REG->control |= OHCI_CONTROL_CONTROL_BULK_RATIO | OHCI_CONTROL_LIST_CONTROL_ENABLE_MASK |
- OHCI_CONTROL_LIST_BULK_ENABLE_MASK | OHCI_CONTROL_LIST_PERIODIC_ENABLE_MASK; // TODO Isochronous
-
- OHCI_REG->frame_interval = (OHCI_FMINTERVAL_FSMPS << 16) | OHCI_FMINTERVAL_FI;
- OHCI_REG->periodic_start = (OHCI_FMINTERVAL_FI * 9) / 10; // Periodic start is 90% of frame interval
-
- OHCI_REG->control_bit.hc_functional_state = OHCI_CONTROL_FUNCSTATE_OPERATIONAL; // make HC's state to operational state TODO use this to suspend (save power)
- OHCI_REG->rh_status_bit.local_power_status_change = 1; // set global power for ports
-
- return true;
-}
-
-uint32_t hcd_frame_number(uint8_t rhport)
-{
- (void) rhport;
- return (ohci_data.frame_number_hi << 16) | OHCI_REG->frame_number;
-}
-
-
-//--------------------------------------------------------------------+
-// PORT API
-//--------------------------------------------------------------------+
-void hcd_port_reset(uint8_t hostid)
-{
- (void) hostid;
- OHCI_REG->rhport_status[0] = RHPORT_PORT_RESET_STATUS_MASK;
-}
-
-bool hcd_port_connect_status(uint8_t hostid)
-{
- (void) hostid;
- return OHCI_REG->rhport_status_bit[0].current_connect_status;
-}
-
-tusb_speed_t hcd_port_speed_get(uint8_t hostid)
-{
- (void) hostid;
- return OHCI_REG->rhport_status_bit[0].low_speed_device_attached ? TUSB_SPEED_LOW : TUSB_SPEED_FULL;
-}
-
-// endpoints are tied to an address, which only reclaim after a long delay when enumerating
-// thus there is no need to make sure ED is not in HC's cahed as it will not for sure
-void hcd_device_close(uint8_t rhport, uint8_t dev_addr)
-{
- // TODO OHCI
- (void) rhport;
-
- // addr0 serves as static head --> only set skip bit
- if ( dev_addr == 0 )
- {
- ohci_data.control[0].ed.skip = 1;
- }else
- {
- // remove control
- ed_list_remove_by_addr( p_ed_head[TUSB_XFER_CONTROL], dev_addr);
-
- // remove bulk
- ed_list_remove_by_addr(p_ed_head[TUSB_XFER_BULK], dev_addr);
-
- // remove interrupt
- ed_list_remove_by_addr(p_ed_head[TUSB_XFER_INTERRUPT], dev_addr);
-
- // TODO remove ISO
- }
-}
-
-//--------------------------------------------------------------------+
-// Controller API
-//--------------------------------------------------------------------+
-
-//--------------------------------------------------------------------+
-// List Helper
-//--------------------------------------------------------------------+
-static inline tusb_xfer_type_t ed_get_xfer_type(ohci_ed_t const * const p_ed)
-{
- return (p_ed->ep_number == 0 ) ? TUSB_XFER_CONTROL :
- (p_ed->is_iso ) ? TUSB_XFER_ISOCHRONOUS :
- (p_ed->is_interrupt_xfer) ? TUSB_XFER_INTERRUPT : TUSB_XFER_BULK;
-}
-
-static void ed_init(ohci_ed_t *p_ed, uint8_t dev_addr, uint16_t ep_size, uint8_t ep_addr, uint8_t xfer_type, uint8_t interval)
-{
- (void) interval;
-
- // address 0 is used as async head, which always on the list --> cannot be cleared
- if (dev_addr != 0)
- {
- tu_memclr(p_ed, sizeof(ohci_ed_t));
- }
-
- hcd_devtree_info_t devtree_info;
- hcd_devtree_get_info(dev_addr, &devtree_info);
-
- p_ed->dev_addr = dev_addr;
- p_ed->ep_number = ep_addr & 0x0F;
- p_ed->pid = (xfer_type == TUSB_XFER_CONTROL) ? PID_FROM_TD : (tu_edpt_dir(ep_addr) ? PID_IN : PID_OUT);
- p_ed->speed = devtree_info.speed;
- p_ed->is_iso = (xfer_type == TUSB_XFER_ISOCHRONOUS) ? 1 : 0;
- p_ed->max_packet_size = ep_size;
-
- p_ed->used = 1;
- p_ed->is_interrupt_xfer = (xfer_type == TUSB_XFER_INTERRUPT ? 1 : 0);
-}
-
-static void gtd_init(ohci_gtd_t* p_td, uint8_t* data_ptr, uint16_t total_bytes)
-{
- tu_memclr(p_td, sizeof(ohci_gtd_t));
-
- p_td->used = 1;
- p_td->expected_bytes = total_bytes;
-
- p_td->buffer_rounding = 1; // less than queued length is not a error
- p_td->delay_interrupt = OHCI_INT_ON_COMPLETE_NO;
- p_td->condition_code = OHCI_CCODE_NOT_ACCESSED;
-
- p_td->current_buffer_pointer = data_ptr;
- p_td->buffer_end = total_bytes ? (data_ptr + total_bytes-1) : data_ptr;
-}
-
-static ohci_ed_t * ed_from_addr(uint8_t dev_addr, uint8_t ep_addr)
-{
- if ( tu_edpt_number(ep_addr) == 0 ) return &ohci_data.control[dev_addr].ed;
-
- ohci_ed_t* ed_pool = ohci_data.ed_pool;
-
- for(uint32_t i=0; i<HCD_MAX_ENDPOINT; i++)
- {
- if ( (ed_pool[i].dev_addr == dev_addr) &&
- ep_addr == tu_edpt_addr(ed_pool[i].ep_number, ed_pool[i].pid == PID_IN) )
- {
- return &ed_pool[i];
- }
- }
-
- return NULL;
-}
-
-static ohci_ed_t * ed_find_free(void)
-{
- ohci_ed_t* ed_pool = ohci_data.ed_pool;
-
- for(uint8_t i = 0; i < HCD_MAX_ENDPOINT; i++)
- {
- if ( !ed_pool[i].used ) return &ed_pool[i];
- }
-
- return NULL;
-}
-
-static void ed_list_insert(ohci_ed_t * p_pre, ohci_ed_t * p_ed)
-{
- p_ed->next = p_pre->next;
- p_pre->next = (uint32_t) p_ed;
-}
-
-static void ed_list_remove_by_addr(ohci_ed_t * p_head, uint8_t dev_addr)
-{
- ohci_ed_t* p_prev = p_head;
-
- while( p_prev->next )
- {
- ohci_ed_t* ed = (ohci_ed_t*) p_prev->next;
-
- if (ed->dev_addr == dev_addr)
- {
- // unlink ed
- p_prev->next = ed->next;
-
- // point the removed ED's next pointer to list head to make sure HC can always safely move away from this ED
- ed->next = (uint32_t) p_head;
- ed->used = 0;
- }
-
- // check next valid since we could remove it
- if (p_prev->next) p_prev = (ohci_ed_t*) p_prev->next;
- }
-}
-
-static ohci_gtd_t * gtd_find_free(void)
-{
- for(uint8_t i=0; i < HCD_MAX_XFER; i++)
- {
- if ( !ohci_data.gtd_pool[i].used ) return &ohci_data.gtd_pool[i];
- }
-
- return NULL;
-}
-
-static void td_insert_to_ed(ohci_ed_t* p_ed, ohci_gtd_t * p_gtd)
-{
- // tail is always NULL
- if ( tu_align16(p_ed->td_head.address) == 0 )
- { // TD queue is empty --> head = TD
- p_ed->td_head.address |= (uint32_t) p_gtd;
- }
- else
- { // TODO currently only support queue up to 2 TD each endpoint at a time
- ((ohci_gtd_t*) tu_align16(p_ed->td_head.address))->next = (uint32_t) p_gtd;
- }
-}
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-
-bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const * ep_desc)
-{
- (void) rhport;
-
- // TODO iso support
- TU_ASSERT(ep_desc->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS);
-
- //------------- Prepare Queue Head -------------//
- ohci_ed_t * p_ed;
-
- if ( ep_desc->bEndpointAddress == 0 )
- {
- p_ed = &ohci_data.control[dev_addr].ed;
- }else
- {
- p_ed = ed_find_free();
- }
- TU_ASSERT(p_ed);
-
- ed_init( p_ed, dev_addr, ep_desc->wMaxPacketSize.size, ep_desc->bEndpointAddress,
- ep_desc->bmAttributes.xfer, ep_desc->bInterval );
-
- // control of dev0 is used as static async head
- if ( dev_addr == 0 )
- {
- p_ed->skip = 0; // only need to clear skip bit
- return true;
- }
-
- ed_list_insert( p_ed_head[ep_desc->bmAttributes.xfer], p_ed );
-
- return true;
-}
-
-bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet[8])
-{
- (void) rhport;
-
- ohci_ed_t* ed = &ohci_data.control[dev_addr].ed;
- ohci_gtd_t *qtd = &ohci_data.control[dev_addr].gtd;
-
- gtd_init(qtd, (uint8_t*) setup_packet, 8);
- qtd->index = dev_addr;
- qtd->pid = PID_SETUP;
- qtd->data_toggle = GTD_DT_DATA0;
- qtd->delay_interrupt = 0;
-
- //------------- Attach TDs list to Control Endpoint -------------//
- ed->td_head.address = (uint32_t) qtd;
-
- OHCI_REG->command_status_bit.control_list_filled = 1;
-
- return true;
-}
-
-bool hcd_edpt_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t * buffer, uint16_t buflen)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- if ( epnum == 0 )
- {
- ohci_ed_t* ed = &ohci_data.control[dev_addr].ed;
- ohci_gtd_t* gtd = &ohci_data.control[dev_addr].gtd;
-
- gtd_init(gtd, buffer, buflen);
-
- gtd->index = dev_addr;
- gtd->pid = dir ? PID_IN : PID_OUT;
- gtd->data_toggle = GTD_DT_DATA1; // Both Data and Ack stage start with DATA1
- gtd->delay_interrupt = 0;
-
- ed->td_head.address = (uint32_t) gtd;
-
- OHCI_REG->command_status_bit.control_list_filled = 1;
- }else
- {
- ohci_ed_t * ed = ed_from_addr(dev_addr, ep_addr);
- ohci_gtd_t* gtd = gtd_find_free();
-
- TU_ASSERT(gtd);
-
- gtd_init(gtd, buffer, buflen);
- gtd->index = ed-ohci_data.ed_pool;
- gtd->delay_interrupt = 0;
-
- td_insert_to_ed(ed, gtd);
-
- tusb_xfer_type_t xfer_type = ed_get_xfer_type( ed_from_addr(dev_addr, ep_addr) );
- if (TUSB_XFER_BULK == xfer_type) OHCI_REG->command_status_bit.bulk_list_filled = 1;
- }
-
- return true;
-}
-
-bool hcd_edpt_clear_stall(uint8_t dev_addr, uint8_t ep_addr)
-{
- ohci_ed_t * const p_ed = ed_from_addr(dev_addr, ep_addr);
-
- p_ed->is_stalled = 0;
- p_ed->td_tail &= 0x0Ful; // set tail pointer back to NULL
-
- p_ed->td_head.toggle = 0; // reset data toggle
- p_ed->td_head.halted = 0;
-
- if ( TUSB_XFER_BULK == ed_get_xfer_type(p_ed) ) OHCI_REG->command_status_bit.bulk_list_filled = 1;
-
- return true;
-}
-
-
-//--------------------------------------------------------------------+
-// OHCI Interrupt Handler
-//--------------------------------------------------------------------+
-static ohci_td_item_t* list_reverse(ohci_td_item_t* td_head)
-{
- ohci_td_item_t* td_reverse_head = NULL;
-
- while(td_head != NULL)
- {
- uint32_t next = td_head->next;
-
- // make current's item become reverse's first item
- td_head->next = (uint32_t) td_reverse_head;
- td_reverse_head = td_head;
-
- td_head = (ohci_td_item_t*) next; // advance to next item
- }
-
- return td_reverse_head;
-}
-
-static inline bool gtd_is_control(ohci_gtd_t const * const p_qtd)
-{
- return ((uint32_t) p_qtd) < ((uint32_t) ohci_data.gtd_pool); // check ohci_data_t for memory layout
-}
-
-static inline ohci_ed_t* gtd_get_ed(ohci_gtd_t const * const p_qtd)
-{
- if ( gtd_is_control(p_qtd) )
- {
- return &ohci_data.control[p_qtd->index].ed;
- }else
- {
- return &ohci_data.ed_pool[p_qtd->index];
- }
-}
-
-static inline uint32_t gtd_xfer_byte_left(uint32_t buffer_end, uint32_t current_buffer)
-{
- // 5.2.9 OHCI sample code
-
- // CBP is 0 mean all data is transferred
- if (current_buffer == 0) return 0;
-
- return (tu_align4k(buffer_end ^ current_buffer) ? 0x1000 : 0) +
- tu_offset4k(buffer_end) - tu_offset4k(current_buffer) + 1;
-}
-
-static void done_queue_isr(uint8_t hostid)
-{
- (void) hostid;
-
- // done head is written in reversed order of completion --> need to reverse the done queue first
- ohci_td_item_t* td_head = list_reverse ( (ohci_td_item_t*) tu_align16(ohci_data.hcca.done_head) );
-
- while( td_head != NULL )
- {
- // TODO check if td_head is iso td
- //------------- Non ISO transfer -------------//
- ohci_gtd_t * const qtd = (ohci_gtd_t *) td_head;
- xfer_result_t const event = (qtd->condition_code == OHCI_CCODE_NO_ERROR) ? XFER_RESULT_SUCCESS :
- (qtd->condition_code == OHCI_CCODE_STALL) ? XFER_RESULT_STALLED : XFER_RESULT_FAILED;
-
- qtd->used = 0; // free TD
- if ( (qtd->delay_interrupt == OHCI_INT_ON_COMPLETE_YES) || (event != XFER_RESULT_SUCCESS) )
- {
- ohci_ed_t * const ed = gtd_get_ed(qtd);
-
- uint32_t const xferred_bytes = qtd->expected_bytes - gtd_xfer_byte_left((uint32_t) qtd->buffer_end, (uint32_t) qtd->current_buffer_pointer);
-
- // NOTE Assuming the current list is BULK and there is no other EDs in the list has queued TDs.
- // When there is a error resulting this ED is halted, and this EP still has other queued TD
- // --> the Bulk list only has this halted EP queueing TDs (remaining)
- // --> Bulk list will be considered as not empty by HC !!! while there is no attempt transaction on this list
- // --> HC will not process Control list (due to service ratio when Bulk list not empty)
- // To walk-around this, the halted ED will have TailP = HeadP (empty list condition), when clearing halt
- // the TailP must be set back to NULL for processing remaining TDs
- if ((event != XFER_RESULT_SUCCESS))
- {
- ed->td_tail &= 0x0Ful;
- ed->td_tail |= tu_align16(ed->td_head.address); // mark halted EP as empty queue
- if ( event == XFER_RESULT_STALLED ) ed->is_stalled = 1;
- }
-
- uint8_t dir = (ed->ep_number == 0) ? (qtd->pid == PID_IN) : (ed->pid == PID_IN);
-
- hcd_event_xfer_complete(ed->dev_addr, tu_edpt_addr(ed->ep_number, dir), xferred_bytes, event, true);
- }
-
- td_head = (ohci_td_item_t*) td_head->next;
- }
-}
-
-void hcd_int_handler(uint8_t hostid)
-{
- uint32_t const int_en = OHCI_REG->interrupt_enable;
- uint32_t const int_status = OHCI_REG->interrupt_status & int_en;
-
- if (int_status == 0) return;
-
- // Frame number overflow
- if ( int_status & OHCI_INT_FRAME_OVERFLOW_MASK )
- {
- ohci_data.frame_number_hi++;
- }
-
- //------------- RootHub status -------------//
- if ( int_status & OHCI_INT_RHPORT_STATUS_CHANGE_MASK )
- {
- uint32_t const rhport_status = OHCI_REG->rhport_status[0] & RHPORT_ALL_CHANGE_MASK;
-
- // TODO dual port is not yet supported
- if ( rhport_status & RHPORT_CONNECT_STATUS_CHANGE_MASK )
- {
- // TODO check if remote wake-up
- if ( OHCI_REG->rhport_status_bit[0].current_connect_status )
- {
- // TODO reset port immediately, without this controller will got 2-3 (debouncing connection status change)
- OHCI_REG->rhport_status[0] = RHPORT_PORT_RESET_STATUS_MASK;
- hcd_event_device_attach(hostid, true);
- }else
- {
- hcd_event_device_remove(hostid, true);
- }
- }
-
- if ( rhport_status & RHPORT_PORT_SUSPEND_CHANGE_MASK)
- {
-
- }
-
- OHCI_REG->rhport_status[0] = rhport_status; // acknowledge all interrupt
- }
-
- //------------- Transfer Complete -------------//
- if (int_status & OHCI_INT_WRITEBACK_DONEHEAD_MASK)
- {
- done_queue_isr(hostid);
- }
-
- OHCI_REG->interrupt_status = int_status; // Acknowledge handled interrupt
-}
-//--------------------------------------------------------------------+
-// HELPER
-//--------------------------------------------------------------------+
-
-
-#endif
-
diff --git a/tinyusb/src/portable/ohci/ohci.h b/tinyusb/src/portable/ohci/ohci.h
deleted file mode 100755
index cd90aa45..00000000
--- a/tinyusb/src/portable/ohci/ohci.h
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_OHCI_H_
-#define _TUSB_OHCI_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// OHCI CONFIGURATION & CONSTANTS
-//--------------------------------------------------------------------+
-#define HOST_HCD_XFER_INTERRUPT // TODO interrupt is used widely, should always be enalbed
-#define OHCI_PERIODIC_LIST (defined HOST_HCD_XFER_INTERRUPT || defined HOST_HCD_XFER_ISOCHRONOUS)
-
-// TODO merge OHCI with EHCI
-enum {
- OHCI_MAX_ITD = 4
-};
-
-//--------------------------------------------------------------------+
-// OHCI Data Structure
-//--------------------------------------------------------------------+
-typedef struct {
- uint32_t interrupt_table[32];
- volatile uint16_t frame_number;
- volatile uint16_t frame_pad;
- volatile uint32_t done_head;
- uint8_t reserved[116+4]; // TODO try to make use of this area if possible, extra 4 byte to make the whole struct size = 256
-}ohci_hcca_t; // TU_ATTR_ALIGNED(256)
-
-TU_VERIFY_STATIC( sizeof(ohci_hcca_t) == 256, "size is not correct" );
-
-typedef struct {
- uint32_t reserved[2];
- volatile uint32_t next;
- uint32_t reserved2;
-}ohci_td_item_t;
-
-typedef struct TU_ATTR_ALIGNED(16)
-{
- // Word 0
- uint32_t used : 1;
- uint32_t index : 4; // endpoint index the td belongs to, or device address in case of control xfer
- uint32_t expected_bytes : 13; // TODO available for hcd
-
- uint32_t buffer_rounding : 1;
- uint32_t pid : 2;
- uint32_t delay_interrupt : 3;
- volatile uint32_t data_toggle : 2;
- volatile uint32_t error_count : 2;
- volatile uint32_t condition_code : 4;
-
- // Word 1
- volatile uint8_t* current_buffer_pointer;
-
- // Word 2 : next TD
- volatile uint32_t next;
-
- // Word 3
- uint8_t* buffer_end;
-} ohci_gtd_t;
-
-TU_VERIFY_STATIC( sizeof(ohci_gtd_t) == 16, "size is not correct" );
-
-typedef struct TU_ATTR_ALIGNED(16)
-{
- // Word 0
- uint32_t dev_addr : 7;
- uint32_t ep_number : 4;
- uint32_t pid : 2;
- uint32_t speed : 1;
- uint32_t skip : 1;
- uint32_t is_iso : 1;
- uint32_t max_packet_size : 11;
- // HCD: make use of 5 reserved bits
- uint32_t used : 1;
- uint32_t is_interrupt_xfer : 1;
- uint32_t is_stalled : 1;
- uint32_t : 2;
-
- // Word 1
- uint32_t td_tail;
-
- // Word 2
- volatile union {
- uint32_t address;
- struct {
- uint32_t halted : 1;
- uint32_t toggle : 1;
- uint32_t : 30;
- };
- }td_head;
-
- // Word 3: next ED
- uint32_t next;
-} ohci_ed_t;
-
-TU_VERIFY_STATIC( sizeof(ohci_ed_t) == 16, "size is not correct" );
-
-typedef struct TU_ATTR_ALIGNED(32)
-{
- /*---------- Word 1 ----------*/
- uint32_t starting_frame : 16;
- uint32_t : 5; // can be used
- uint32_t delay_interrupt : 3;
- uint32_t frame_count : 3;
- uint32_t : 1; // can be used
- volatile uint32_t condition_code : 4;
-
- /*---------- Word 2 ----------*/
- uint32_t buffer_page0; // 12 lsb bits can be used
-
- /*---------- Word 3 ----------*/
- volatile uint32_t next;
-
- /*---------- Word 4 ----------*/
- uint32_t buffer_end;
-
- /*---------- Word 5-8 ----------*/
- volatile uint16_t offset_packetstatus[8];
-} ochi_itd_t;
-
-TU_VERIFY_STATIC( sizeof(ochi_itd_t) == 32, "size is not correct" );
-
-// structure with member alignment required from large to small
-typedef struct TU_ATTR_ALIGNED(256)
-{
- ohci_hcca_t hcca;
-
- ohci_ed_t bulk_head_ed; // static bulk head (dummy)
- ohci_ed_t period_head_ed; // static periodic list head (dummy)
-
- // control endpoints has reserved resources
- struct {
- ohci_ed_t ed;
- ohci_gtd_t gtd;
- }control[CFG_TUH_DEVICE_MAX+1];
-
- // ochi_itd_t itd[OHCI_MAX_ITD]; // itd requires alignment of 32
- ohci_ed_t ed_pool[HCD_MAX_ENDPOINT];
- ohci_gtd_t gtd_pool[HCD_MAX_XFER];
-
- volatile uint16_t frame_number_hi;
-
-} ohci_data_t;
-
-//--------------------------------------------------------------------+
-// OHCI Operational Register
-//--------------------------------------------------------------------+
-
-
-//--------------------------------------------------------------------+
-// OHCI Data Organization
-//--------------------------------------------------------------------+
-typedef volatile struct
-{
- uint32_t revision;
-
- union {
- uint32_t control;
- struct {
- uint32_t control_bulk_service_ratio : 2;
- uint32_t periodic_list_enable : 1;
- uint32_t isochronous_enable : 1;
- uint32_t control_list_enable : 1;
- uint32_t bulk_list_enable : 1;
- uint32_t hc_functional_state : 2;
- uint32_t interrupt_routing : 1;
- uint32_t remote_wakeup_connected : 1;
- uint32_t remote_wakeup_enale : 1;
- uint32_t TU_RESERVED : 21;
- }control_bit;
- };
-
- union {
- uint32_t command_status;
- struct {
- uint32_t controller_reset : 1;
- uint32_t control_list_filled : 1;
- uint32_t bulk_list_filled : 1;
- uint32_t ownership_change_request : 1;
- uint32_t : 12;
- uint32_t scheduling_overrun_count : 2;
- }command_status_bit;
- };
-
- uint32_t interrupt_status;
- uint32_t interrupt_enable;
- uint32_t interrupt_disable;
-
- uint32_t hcca;
- uint32_t period_current_ed;
- uint32_t control_head_ed;
- uint32_t control_current_ed;
- uint32_t bulk_head_ed;
- uint32_t bulk_current_ed;
- uint32_t done_head;
-
- uint32_t frame_interval;
- uint32_t frame_remaining;
- uint32_t frame_number;
- uint32_t periodic_start;
- uint32_t lowspeed_threshold;
-
- uint32_t rh_descriptorA;
- uint32_t rh_descriptorB;
-
- union {
- uint32_t rh_status;
- struct {
- uint32_t local_power_status : 1; // read Local Power Status; write: Clear Global Power
- uint32_t over_current_indicator : 1;
- uint32_t : 13;
- uint32_t device_remote_wakeup_enable : 1;
- uint32_t local_power_status_change : 1;
- uint32_t over_current_indicator_change : 1;
- uint32_t : 13;
- uint32_t clear_remote_wakeup_enable : 1;
- }rh_status_bit;
- };
-
- union {
- uint32_t rhport_status[2]; // TODO NXP OHCI controller only has 2 ports
- struct {
- uint32_t current_connect_status : 1;
- uint32_t port_enable_status : 1;
- uint32_t port_suspend_status : 1;
- uint32_t port_over_current_indicator : 1;
- uint32_t port_reset_status : 1;
- uint32_t : 3;
- uint32_t port_power_status : 1;
- uint32_t low_speed_device_attached : 1;
- uint32_t : 6;
- uint32_t connect_status_change : 1;
- uint32_t port_enable_status_change : 1;
- uint32_t port_suspend_status_change : 1;
- uint32_t port_over_current_indicator_change : 1;
- uint32_t port_reset_status_change : 1;
- uint32_t TU_RESERVED : 11;
- }rhport_status_bit[2];
- };
-}ohci_registers_t;
-
-TU_VERIFY_STATIC( sizeof(ohci_registers_t) == 0x5c, "size is not correct");
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_OHCI_H_ */
diff --git a/tinyusb/src/portable/raspberrypi/rp2040/dcd_rp2040.c b/tinyusb/src/portable/raspberrypi/rp2040/dcd_rp2040.c
deleted file mode 100755
index 49284e92..00000000
--- a/tinyusb/src/portable/raspberrypi/rp2040/dcd_rp2040.c
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_RP2040
-
-#include "pico.h"
-#include "rp2040_usb.h"
-
-#if TUD_OPT_RP2040_USB_DEVICE_ENUMERATION_FIX
-#include "pico/fix/rp2040_usb_device_enumeration.h"
-#endif
-
-#include "device/dcd.h"
-
-// Current implementation force vbus detection as always present, causing device think it is always plugged into host.
-// Therefore it cannot detect disconnect event, mistaken it as suspend.
-// Note: won't work if change to 0 (for now)
-#define FORCE_VBUS_DETECT 1
-
-/*------------------------------------------------------------------*/
-/* Low level controller
- *------------------------------------------------------------------*/
-
-#define usb_hw_set hw_set_alias(usb_hw)
-#define usb_hw_clear hw_clear_alias(usb_hw)
-
-// Init these in dcd_init
-static uint8_t *next_buffer_ptr;
-
-// USB_MAX_ENDPOINTS Endpoints, direction TUSB_DIR_OUT for out and TUSB_DIR_IN for in.
-static struct hw_endpoint hw_endpoints[USB_MAX_ENDPOINTS][2];
-
-static inline struct hw_endpoint *hw_endpoint_get_by_num(uint8_t num, tusb_dir_t dir)
-{
- return &hw_endpoints[num][dir];
-}
-
-static struct hw_endpoint *hw_endpoint_get_by_addr(uint8_t ep_addr)
-{
- uint8_t num = tu_edpt_number(ep_addr);
- tusb_dir_t dir = tu_edpt_dir(ep_addr);
- return hw_endpoint_get_by_num(num, dir);
-}
-
-static void _hw_endpoint_alloc(struct hw_endpoint *ep, uint8_t transfer_type)
-{
- // size must be multiple of 64
- uint16_t size = tu_div_ceil(ep->wMaxPacketSize, 64) * 64u;
-
- // double buffered Bulk endpoint
- if ( transfer_type == TUSB_XFER_BULK )
- {
- size *= 2u;
- }
-
- ep->hw_data_buf = next_buffer_ptr;
- next_buffer_ptr += size;
-
- assert(((uintptr_t )next_buffer_ptr & 0b111111u) == 0);
- uint dpram_offset = hw_data_offset(ep->hw_data_buf);
- assert(hw_data_offset(next_buffer_ptr) <= USB_DPRAM_MAX);
-
- pico_info(" Alloced %d bytes at offset 0x%x (0x%p)\r\n", size, dpram_offset, ep->hw_data_buf);
-
- // Fill in endpoint control register with buffer offset
- uint32_t const reg = EP_CTRL_ENABLE_BITS | (transfer_type << EP_CTRL_BUFFER_TYPE_LSB) | dpram_offset;
-
- *ep->endpoint_control = reg;
-}
-
-#if 0 // todo unused
-static void _hw_endpoint_close(struct hw_endpoint *ep)
-{
- // Clear hardware registers and then zero the struct
- // Clears endpoint enable
- *ep->endpoint_control = 0;
- // Clears buffer available, etc
- *ep->buffer_control = 0;
- // Clear any endpoint state
- memset(ep, 0, sizeof(struct hw_endpoint));
-}
-
-static void hw_endpoint_close(uint8_t ep_addr)
-{
- struct hw_endpoint *ep = hw_endpoint_get_by_addr(ep_addr);
- _hw_endpoint_close(ep);
-}
-#endif
-
-static void hw_endpoint_init(uint8_t ep_addr, uint16_t wMaxPacketSize, uint8_t transfer_type)
-{
- struct hw_endpoint *ep = hw_endpoint_get_by_addr(ep_addr);
-
- const uint8_t num = tu_edpt_number(ep_addr);
- const tusb_dir_t dir = tu_edpt_dir(ep_addr);
-
- ep->ep_addr = ep_addr;
-
- // For device, IN is a tx transfer and OUT is an rx transfer
- ep->rx = (dir == TUSB_DIR_OUT);
-
- // Response to a setup packet on EP0 starts with pid of 1
- ep->next_pid = (num == 0 ? 1u : 0u);
-
- ep->wMaxPacketSize = wMaxPacketSize;
- ep->transfer_type = transfer_type;
-
- // Every endpoint has a buffer control register in dpram
- if ( dir == TUSB_DIR_IN )
- {
- ep->buffer_control = &usb_dpram->ep_buf_ctrl[num].in;
- }
- else
- {
- ep->buffer_control = &usb_dpram->ep_buf_ctrl[num].out;
- }
-
- // Clear existing buffer control state
- *ep->buffer_control = 0;
-
- if ( num == 0 )
- {
- // EP0 has no endpoint control register because
- // the buffer offsets are fixed
- ep->endpoint_control = NULL;
-
- // Buffer offset is fixed (also double buffered)
- ep->hw_data_buf = (uint8_t*) &usb_dpram->ep0_buf_a[0];
- }
- else
- {
- // Set the endpoint control register (starts at EP1, hence num-1)
- if ( dir == TUSB_DIR_IN )
- {
- ep->endpoint_control = &usb_dpram->ep_ctrl[num - 1].in;
- }
- else
- {
- ep->endpoint_control = &usb_dpram->ep_ctrl[num - 1].out;
- }
-
- // alloc a buffer and fill in endpoint control register
- _hw_endpoint_alloc(ep, transfer_type);
- }
-}
-
-static void hw_endpoint_xfer(uint8_t ep_addr, uint8_t *buffer, uint16_t total_bytes)
-{
- struct hw_endpoint *ep = hw_endpoint_get_by_addr(ep_addr);
- hw_endpoint_xfer_start(ep, buffer, total_bytes);
-}
-
-static void hw_handle_buff_status(void)
-{
- uint32_t remaining_buffers = usb_hw->buf_status;
- pico_trace("buf_status 0x%08x\n", remaining_buffers);
- uint bit = 1u;
- for (uint i = 0; remaining_buffers && i < USB_MAX_ENDPOINTS * 2; i++)
- {
- if (remaining_buffers & bit)
- {
- // clear this in advance
- usb_hw_clear->buf_status = bit;
- // IN transfer for even i, OUT transfer for odd i
- struct hw_endpoint *ep = hw_endpoint_get_by_num(i >> 1u, !(i & 1u));
- // Continue xfer
- bool done = hw_endpoint_xfer_continue(ep);
- if (done)
- {
- // Notify
- dcd_event_xfer_complete(0, ep->ep_addr, ep->xferred_len, XFER_RESULT_SUCCESS, true);
- hw_endpoint_reset_transfer(ep);
- }
- remaining_buffers &= ~bit;
- }
- bit <<= 1u;
- }
-}
-
-static void reset_ep0(void)
-{
- // If we have finished this transfer on EP0 set pid back to 1 for next
- // setup transfer. Also clear a stall in case
- uint8_t addrs[] = {0x0, 0x80};
- for (uint i = 0 ; i < TU_ARRAY_SIZE(addrs); i++)
- {
- struct hw_endpoint *ep = hw_endpoint_get_by_addr(addrs[i]);
- ep->next_pid = 1u;
- }
-}
-
-static void reset_all_endpoints(void)
-{
- memset(hw_endpoints, 0, sizeof(hw_endpoints));
- next_buffer_ptr = &usb_dpram->epx_data[0];
-
- // Init Control endpoint out & in
- hw_endpoint_init(0x0, 64, TUSB_XFER_CONTROL);
- hw_endpoint_init(0x80, 64, TUSB_XFER_CONTROL);
-}
-
-static void dcd_rp2040_irq(void)
-{
- uint32_t const status = usb_hw->ints;
- uint32_t handled = 0;
-
- if (status & USB_INTS_SETUP_REQ_BITS)
- {
- handled |= USB_INTS_SETUP_REQ_BITS;
- uint8_t const *setup = (uint8_t const *)&usb_dpram->setup_packet;
- // Clear stall bits and reset pid
- reset_ep0();
- // Pass setup packet to tiny usb
- dcd_event_setup_received(0, setup, true);
- usb_hw_clear->sie_status = USB_SIE_STATUS_SETUP_REC_BITS;
- }
-
- if (status & USB_INTS_BUFF_STATUS_BITS)
- {
- handled |= USB_INTS_BUFF_STATUS_BITS;
- hw_handle_buff_status();
- }
-
-#if FORCE_VBUS_DETECT == 0
- // Since we force VBUS detect On, device will always think it is connected and
- // couldn't distinguish between disconnect and suspend
- if (status & USB_INTS_DEV_CONN_DIS_BITS)
- {
- handled |= USB_INTS_DEV_CONN_DIS_BITS;
-
- if ( usb_hw->sie_status & USB_SIE_STATUS_CONNECTED_BITS )
- {
- // Connected: nothing to do
- }else
- {
- // Disconnected
- dcd_event_bus_signal(0, DCD_EVENT_UNPLUGGED, true);
- }
-
- usb_hw_clear->sie_status = USB_SIE_STATUS_CONNECTED_BITS;
- }
-#endif
-
- // SE0 for 2.5 us or more (will last at least 10ms)
- if (status & USB_INTS_BUS_RESET_BITS)
- {
- pico_trace("BUS RESET\n");
-
- handled |= USB_INTS_BUS_RESET_BITS;
-
- usb_hw->dev_addr_ctrl = 0;
- reset_all_endpoints();
- dcd_event_bus_reset(0, TUSB_SPEED_FULL, true);
- usb_hw_clear->sie_status = USB_SIE_STATUS_BUS_RESET_BITS;
-
-#if TUD_OPT_RP2040_USB_DEVICE_ENUMERATION_FIX
- // Only run enumeration walk-around if pull up is enabled
- if ( usb_hw->sie_ctrl & USB_SIE_CTRL_PULLUP_EN_BITS ) rp2040_usb_device_enumeration_fix();
-#endif
- }
-
- /* Note from pico datasheet 4.1.2.6.4 (v1.2)
- * If you enable the suspend interrupt, it is likely you will see a suspend interrupt when
- * the device is first connected but the bus is idle. The bus can be idle for a few ms before
- * the host begins sending start of frame packets. You will also see a suspend interrupt
- * when the device is disconnected if you do not have a VBUS detect circuit connected. This is
- * because without VBUS detection, it is impossible to tell the difference between
- * being disconnected and suspended.
- */
- if (status & USB_INTS_DEV_SUSPEND_BITS)
- {
- handled |= USB_INTS_DEV_SUSPEND_BITS;
- dcd_event_bus_signal(0, DCD_EVENT_SUSPEND, true);
- usb_hw_clear->sie_status = USB_SIE_STATUS_SUSPENDED_BITS;
- }
-
- if (status & USB_INTS_DEV_RESUME_FROM_HOST_BITS)
- {
- handled |= USB_INTS_DEV_RESUME_FROM_HOST_BITS;
- dcd_event_bus_signal(0, DCD_EVENT_RESUME, true);
- usb_hw_clear->sie_status = USB_SIE_STATUS_RESUME_BITS;
- }
-
- if (status ^ handled)
- {
- panic("Unhandled IRQ 0x%x\n", (uint) (status ^ handled));
- }
-}
-
-#define USB_INTS_ERROR_BITS ( \
- USB_INTS_ERROR_DATA_SEQ_BITS | \
- USB_INTS_ERROR_BIT_STUFF_BITS | \
- USB_INTS_ERROR_CRC_BITS | \
- USB_INTS_ERROR_RX_OVERFLOW_BITS | \
- USB_INTS_ERROR_RX_TIMEOUT_BITS)
-
-/*------------------------------------------------------------------*/
-/* Controller API
- *------------------------------------------------------------------*/
-
-void dcd_init (uint8_t rhport)
-{
- pico_trace("dcd_init %d\n", rhport);
- assert(rhport == 0);
-
- // Reset hardware to default state
- rp2040_usb_init();
-
-#if FORCE_VBUS_DETECT
- // Force VBUS detect so the device thinks it is plugged into a host
- usb_hw->pwr = USB_USB_PWR_VBUS_DETECT_BITS | USB_USB_PWR_VBUS_DETECT_OVERRIDE_EN_BITS;
-#endif
-
- irq_set_exclusive_handler(USBCTRL_IRQ, dcd_rp2040_irq);
-
- // reset endpoints
- reset_all_endpoints();
-
- // Initializes the USB peripheral for device mode and enables it.
- // Don't need to enable the pull up here. Force VBUS
- usb_hw->main_ctrl = USB_MAIN_CTRL_CONTROLLER_EN_BITS;
-
- // Enable individual controller IRQS here. Processor interrupt enable will be used
- // for the global interrupt enable...
- // Note: Force VBUS detect cause disconnection not detectable
- usb_hw->sie_ctrl = USB_SIE_CTRL_EP0_INT_1BUF_BITS;
- usb_hw->inte = USB_INTS_BUFF_STATUS_BITS | USB_INTS_BUS_RESET_BITS | USB_INTS_SETUP_REQ_BITS |
- USB_INTS_DEV_SUSPEND_BITS | USB_INTS_DEV_RESUME_FROM_HOST_BITS |
- (FORCE_VBUS_DETECT ? 0 : USB_INTS_DEV_CONN_DIS_BITS);
-
- dcd_connect(rhport);
-}
-
-void dcd_int_enable(uint8_t rhport)
-{
- assert(rhport == 0);
- irq_set_enabled(USBCTRL_IRQ, true);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- assert(rhport == 0);
- irq_set_enabled(USBCTRL_IRQ, false);
-}
-
-void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
-{
- pico_trace("dcd_set_address %d %d\n", rhport, dev_addr);
- assert(rhport == 0);
-
- // Can't set device address in hardware until status xfer has complete
- // Send 0len complete response on EP0 IN
- reset_ep0();
- hw_endpoint_xfer(0x80, NULL, 0);
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- pico_info("dcd_remote_wakeup %d\n", rhport);
- assert(rhport == 0);
- usb_hw_set->sie_ctrl = USB_SIE_CTRL_RESUME_BITS;
-}
-
-// disconnect by disabling internal pull-up resistor on D+/D-
-void dcd_disconnect(uint8_t rhport)
-{
- pico_info("dcd_disconnect %d\n", rhport);
- assert(rhport == 0);
- usb_hw_clear->sie_ctrl = USB_SIE_CTRL_PULLUP_EN_BITS;
-}
-
-// connect by enabling internal pull-up resistor on D+/D-
-void dcd_connect(uint8_t rhport)
-{
- pico_info("dcd_connect %d\n", rhport);
- assert(rhport == 0);
- usb_hw_set->sie_ctrl = USB_SIE_CTRL_PULLUP_EN_BITS;
-}
-
-/*------------------------------------------------------------------*/
-/* DCD Endpoint port
- *------------------------------------------------------------------*/
-
-void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * request)
-{
- (void) rhport;
-
- if ( request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_DEVICE &&
- request->bmRequestType_bit.type == TUSB_REQ_TYPE_STANDARD &&
- request->bRequest == TUSB_REQ_SET_ADDRESS )
- {
- pico_trace("Set HW address %d\n", request->wValue);
- usb_hw->dev_addr_ctrl = (uint8_t) request->wValue;
- }
-
- reset_ep0();
-}
-
-bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
-{
- assert(rhport == 0);
- hw_endpoint_init(desc_edpt->bEndpointAddress, desc_edpt->wMaxPacketSize.size, desc_edpt->bmAttributes.xfer);
- return true;
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- assert(rhport == 0);
- hw_endpoint_xfer(ep_addr, buffer, total_bytes);
- return true;
-}
-
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- pico_trace("dcd_edpt_stall %02x\n", ep_addr);
- assert(rhport == 0);
-
- if ( tu_edpt_number(ep_addr) == 0 )
- {
- // A stall on EP0 has to be armed so it can be cleared on the next setup packet
- usb_hw_set->ep_stall_arm = (tu_edpt_dir(ep_addr) == TUSB_DIR_IN) ? USB_EP_STALL_ARM_EP0_IN_BITS : USB_EP_STALL_ARM_EP0_OUT_BITS;
- }
-
- struct hw_endpoint *ep = hw_endpoint_get_by_addr(ep_addr);
-
- // TODO check with double buffered
- _hw_endpoint_buffer_control_set_mask32(ep, USB_BUF_CTRL_STALL);
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- pico_trace("dcd_edpt_clear_stall %02x\n", ep_addr);
- assert(rhport == 0);
-
- if (tu_edpt_number(ep_addr))
- {
- struct hw_endpoint *ep = hw_endpoint_get_by_addr(ep_addr);
-
- // clear stall also reset toggle to DATA0
- // TODO check with double buffered
- _hw_endpoint_buffer_control_clear_mask32(ep, USB_BUF_CTRL_STALL | USB_BUF_CTRL_DATA1_PID);
- }
-}
-
-void dcd_edpt_close (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- (void) ep_addr;
-
- // usbd.c says: In progress transfers on this EP may be delivered after this call
- pico_trace("dcd_edpt_close %02x\n", ep_addr);
-}
-
-void dcd_int_handler(uint8_t rhport)
-{
- (void) rhport;
- dcd_rp2040_irq();
-}
-
-#endif
diff --git a/tinyusb/src/portable/raspberrypi/rp2040/hcd_rp2040.c b/tinyusb/src/portable/raspberrypi/rp2040/hcd_rp2040.c
deleted file mode 100755
index e51dfac2..00000000
--- a/tinyusb/src/portable/raspberrypi/rp2040/hcd_rp2040.c
+++ /dev/null
@@ -1,564 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
- * Copyright (c) 2021 Ha Thach (tinyusb.org) for Double Buffered
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_HOST_ENABLED && CFG_TUSB_MCU == OPT_MCU_RP2040
-
-#include "pico.h"
-#include "rp2040_usb.h"
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "osal/osal.h"
-
-#include "host/hcd.h"
-#include "host/usbh.h"
-
-#define ROOT_PORT 0
-
-//--------------------------------------------------------------------+
-// Low level rp2040 controller functions
-//--------------------------------------------------------------------+
-
-#ifndef PICO_USB_HOST_INTERRUPT_ENDPOINTS
-#define PICO_USB_HOST_INTERRUPT_ENDPOINTS (USB_MAX_ENDPOINTS - 1)
-#endif
-static_assert(PICO_USB_HOST_INTERRUPT_ENDPOINTS <= USB_MAX_ENDPOINTS, "");
-
-// Host mode uses one shared endpoint register for non-interrupt endpoint
-static struct hw_endpoint ep_pool[1 + PICO_USB_HOST_INTERRUPT_ENDPOINTS];
-#define epx (ep_pool[0])
-
-#define usb_hw_set hw_set_alias(usb_hw)
-#define usb_hw_clear hw_clear_alias(usb_hw)
-
-// Flags we set by default in sie_ctrl (we add other bits on top)
-enum {
- SIE_CTRL_BASE = USB_SIE_CTRL_SOF_EN_BITS | USB_SIE_CTRL_KEEP_ALIVE_EN_BITS |
- USB_SIE_CTRL_PULLDOWN_EN_BITS | USB_SIE_CTRL_EP0_INT_1BUF_BITS
-};
-
-static struct hw_endpoint *get_dev_ep(uint8_t dev_addr, uint8_t ep_addr)
-{
- uint8_t num = tu_edpt_number(ep_addr);
- if ( num == 0 ) return &epx;
-
- for ( uint32_t i = 1; i < TU_ARRAY_SIZE(ep_pool); i++ )
- {
- struct hw_endpoint *ep = &ep_pool[i];
- if ( ep->configured && (ep->dev_addr == dev_addr) && (ep->ep_addr == ep_addr) ) return ep;
- }
-
- return NULL;
-}
-
-static inline uint8_t dev_speed(void)
-{
- return (usb_hw->sie_status & USB_SIE_STATUS_SPEED_BITS) >> USB_SIE_STATUS_SPEED_LSB;
-}
-
-static bool need_pre(uint8_t dev_addr)
-{
- // If this device is different to the speed of the root device
- // (i.e. is a low speed device on a full speed hub) then need pre
- return hcd_port_speed_get(0) != tuh_speed_get(dev_addr);
-}
-
-static void hw_xfer_complete(struct hw_endpoint *ep, xfer_result_t xfer_result)
-{
- // Mark transfer as done before we tell the tinyusb stack
- uint8_t dev_addr = ep->dev_addr;
- uint8_t ep_addr = ep->ep_addr;
- uint xferred_len = ep->xferred_len;
- hw_endpoint_reset_transfer(ep);
- hcd_event_xfer_complete(dev_addr, ep_addr, xferred_len, xfer_result, true);
-}
-
-static void _handle_buff_status_bit(uint bit, struct hw_endpoint *ep)
-{
- usb_hw_clear->buf_status = bit;
- bool done = hw_endpoint_xfer_continue(ep);
- if (done)
- {
- hw_xfer_complete(ep, XFER_RESULT_SUCCESS);
- }
-}
-
-static void hw_handle_buff_status(void)
-{
- uint32_t remaining_buffers = usb_hw->buf_status;
- pico_trace("buf_status 0x%08x\n", remaining_buffers);
-
- // Check EPX first
- uint bit = 0b1;
- if (remaining_buffers & bit)
- {
- remaining_buffers &= ~bit;
- struct hw_endpoint *ep = &epx;
-
- uint32_t ep_ctrl = *ep->endpoint_control;
- if (ep_ctrl & EP_CTRL_DOUBLE_BUFFERED_BITS)
- {
- TU_LOG(3, "Double Buffered: ");
- }else
- {
- TU_LOG(3, "Single Buffered: ");
- }
- TU_LOG_HEX(3, ep_ctrl);
-
- _handle_buff_status_bit(bit, ep);
- }
-
- // Check interrupt endpoints
- for (uint i = 1; i <= USB_HOST_INTERRUPT_ENDPOINTS && remaining_buffers; i++)
- {
- // EPX is bit 0
- // IEP1 is bit 2
- // IEP2 is bit 4
- // IEP3 is bit 6
- // etc
- bit = 1 << (i*2);
-
- if (remaining_buffers & bit)
- {
- remaining_buffers &= ~bit;
- _handle_buff_status_bit(bit, &ep_pool[i]);
- }
- }
-
- if (remaining_buffers)
- {
- panic("Unhandled buffer %d\n", remaining_buffers);
- }
-}
-
-static void hw_trans_complete(void)
-{
- struct hw_endpoint *ep = &epx;
- assert(ep->active);
-
- if (usb_hw->sie_ctrl & USB_SIE_CTRL_SEND_SETUP_BITS)
- {
- pico_trace("Sent setup packet\n");
- hw_xfer_complete(ep, XFER_RESULT_SUCCESS);
- }
- else
- {
- // Don't care. Will handle this in buff status
- return;
- }
-}
-
-static void hcd_rp2040_irq(void)
-{
- uint32_t status = usb_hw->ints;
- uint32_t handled = 0;
-
- if (status & USB_INTS_HOST_CONN_DIS_BITS)
- {
- handled |= USB_INTS_HOST_CONN_DIS_BITS;
-
- if (dev_speed())
- {
- hcd_event_device_attach(ROOT_PORT, true);
- }
- else
- {
- hcd_event_device_remove(ROOT_PORT, true);
- }
-
- // Clear speed change interrupt
- usb_hw_clear->sie_status = USB_SIE_STATUS_SPEED_BITS;
- }
-
- if (status & USB_INTS_BUFF_STATUS_BITS)
- {
- handled |= USB_INTS_BUFF_STATUS_BITS;
- TU_LOG(2, "Buffer complete\n");
- // print_bufctrl32(*epx.buffer_control);
- hw_handle_buff_status();
- }
-
- if (status & USB_INTS_TRANS_COMPLETE_BITS)
- {
- handled |= USB_INTS_TRANS_COMPLETE_BITS;
- usb_hw_clear->sie_status = USB_SIE_STATUS_TRANS_COMPLETE_BITS;
- TU_LOG(2, "Transfer complete\n");
- hw_trans_complete();
- }
-
- if (status & USB_INTS_STALL_BITS)
- {
- // We have rx'd a stall from the device
- pico_trace("Stall REC\n");
- handled |= USB_INTS_STALL_BITS;
- usb_hw_clear->sie_status = USB_SIE_STATUS_STALL_REC_BITS;
- hw_xfer_complete(&epx, XFER_RESULT_STALLED);
- }
-
- if (status & USB_INTS_ERROR_RX_TIMEOUT_BITS)
- {
- handled |= USB_INTS_ERROR_RX_TIMEOUT_BITS;
- usb_hw_clear->sie_status = USB_SIE_STATUS_RX_TIMEOUT_BITS;
- }
-
- if (status & USB_INTS_ERROR_DATA_SEQ_BITS)
- {
- usb_hw_clear->sie_status = USB_SIE_STATUS_DATA_SEQ_ERROR_BITS;
- print_bufctrl32(*epx.buffer_control);
- panic("Data Seq Error \n");
- }
-
- if (status ^ handled)
- {
- panic("Unhandled IRQ 0x%x\n", (uint) (status ^ handled));
- }
-}
-
-static struct hw_endpoint *_next_free_interrupt_ep(void)
-{
- struct hw_endpoint *ep = NULL;
- for (uint i = 1; i < TU_ARRAY_SIZE(ep_pool); i++)
- {
- ep = &ep_pool[i];
- if (!ep->configured)
- {
- // Will be configured by _hw_endpoint_init / _hw_endpoint_allocate
- ep->interrupt_num = i - 1;
- return ep;
- }
- }
- return ep;
-}
-
-static struct hw_endpoint *_hw_endpoint_allocate(uint8_t transfer_type)
-{
- struct hw_endpoint *ep = NULL;
-
- if (transfer_type == TUSB_XFER_INTERRUPT)
- {
- ep = _next_free_interrupt_ep();
- pico_info("Allocate interrupt ep %d\n", ep->interrupt_num);
- assert(ep);
- ep->buffer_control = &usbh_dpram->int_ep_buffer_ctrl[ep->interrupt_num].ctrl;
- ep->endpoint_control = &usbh_dpram->int_ep_ctrl[ep->interrupt_num].ctrl;
- // 0 for epx (double buffered): TODO increase to 1024 for ISO
- // 2x64 for intep0
- // 3x64 for intep1
- // etc
- ep->hw_data_buf = &usbh_dpram->epx_data[64 * (ep->interrupt_num + 2)];
- }
- else
- {
- ep = &epx;
- ep->buffer_control = &usbh_dpram->epx_buf_ctrl;
- ep->endpoint_control = &usbh_dpram->epx_ctrl;
- ep->hw_data_buf = &usbh_dpram->epx_data[0];
- }
-
- return ep;
-}
-
-static void _hw_endpoint_init(struct hw_endpoint *ep, uint8_t dev_addr, uint8_t ep_addr, uint wMaxPacketSize, uint8_t transfer_type, uint8_t bmInterval)
-{
- // Already has data buffer, endpoint control, and buffer control allocated at this point
- assert(ep->endpoint_control);
- assert(ep->buffer_control);
- assert(ep->hw_data_buf);
-
- uint8_t const num = tu_edpt_number(ep_addr);
- tusb_dir_t const dir = tu_edpt_dir(ep_addr);
-
- ep->ep_addr = ep_addr;
- ep->dev_addr = dev_addr;
-
- // For host, IN to host == RX, anything else rx == false
- ep->rx = (dir == TUSB_DIR_IN);
-
- // Response to a setup packet on EP0 starts with pid of 1
- ep->next_pid = (num == 0 ? 1u : 0u);
- ep->wMaxPacketSize = wMaxPacketSize;
- ep->transfer_type = transfer_type;
-
- pico_trace("hw_endpoint_init dev %d ep %d %s xfer %d\n", ep->dev_addr, tu_edpt_number(ep->ep_addr), ep_dir_string[tu_edpt_dir(ep->ep_addr)], ep->transfer_type);
- pico_trace("dev %d ep %d %s setup buffer @ 0x%p\n", ep->dev_addr, tu_edpt_number(ep->ep_addr), ep_dir_string[tu_edpt_dir(ep->ep_addr)], ep->hw_data_buf);
- uint dpram_offset = hw_data_offset(ep->hw_data_buf);
- // Bits 0-5 should be 0
- assert(!(dpram_offset & 0b111111));
-
- // Fill in endpoint control register with buffer offset
- uint32_t ep_reg = EP_CTRL_ENABLE_BITS
- | EP_CTRL_INTERRUPT_PER_BUFFER
- | (ep->transfer_type << EP_CTRL_BUFFER_TYPE_LSB)
- | dpram_offset;
- ep_reg |= bmInterval ? (bmInterval - 1) << EP_CTRL_HOST_INTERRUPT_INTERVAL_LSB : 0;
- *ep->endpoint_control = ep_reg;
- pico_trace("endpoint control (0x%p) <- 0x%x\n", ep->endpoint_control, ep_reg);
- ep->configured = true;
-
- if (bmInterval)
- {
- // This is an interrupt endpoint
- // so need to set up interrupt endpoint address control register with:
- // device address
- // endpoint number / direction
- // preamble
- uint32_t reg = dev_addr | (num << USB_ADDR_ENDP1_ENDPOINT_LSB);
- // Assert the interrupt endpoint is IN_TO_HOST
- // TODO Interrupt can also be OUT
- assert(dir == TUSB_DIR_IN);
-
- if (need_pre(dev_addr))
- {
- reg |= USB_ADDR_ENDP1_INTEP_PREAMBLE_BITS;
- }
- usb_hw->int_ep_addr_ctrl[ep->interrupt_num] = reg;
-
- // Finally, enable interrupt that endpoint
- usb_hw_set->int_ep_ctrl = 1 << (ep->interrupt_num + 1);
-
- // If it's an interrupt endpoint we need to set up the buffer control
- // register
- }
-}
-
-//--------------------------------------------------------------------+
-// HCD API
-//--------------------------------------------------------------------+
-bool hcd_init(uint8_t rhport)
-{
- pico_trace("hcd_init %d\n", rhport);
- assert(rhport == 0);
-
- // Reset any previous state
- rp2040_usb_init();
-
- // Force VBUS detect to always present, for now we assume vbus is always provided (without using VBUS En)
- usb_hw->pwr = USB_USB_PWR_VBUS_DETECT_BITS | USB_USB_PWR_VBUS_DETECT_OVERRIDE_EN_BITS;
-
- irq_set_exclusive_handler(USBCTRL_IRQ, hcd_rp2040_irq);
-
- // clear epx and interrupt eps
- memset(&ep_pool, 0, sizeof(ep_pool));
-
- // Enable in host mode with SOF / Keep alive on
- usb_hw->main_ctrl = USB_MAIN_CTRL_CONTROLLER_EN_BITS | USB_MAIN_CTRL_HOST_NDEVICE_BITS;
- usb_hw->sie_ctrl = SIE_CTRL_BASE;
- usb_hw->inte = USB_INTE_BUFF_STATUS_BITS |
- USB_INTE_HOST_CONN_DIS_BITS |
- USB_INTE_HOST_RESUME_BITS |
- USB_INTE_STALL_BITS |
- USB_INTE_TRANS_COMPLETE_BITS |
- USB_INTE_ERROR_RX_TIMEOUT_BITS |
- USB_INTE_ERROR_DATA_SEQ_BITS ;
-
- return true;
-}
-
-void hcd_port_reset(uint8_t rhport)
-{
- pico_trace("hcd_port_reset\n");
- assert(rhport == 0);
- // TODO: Nothing to do here yet. Perhaps need to reset some state?
-}
-
-bool hcd_port_connect_status(uint8_t rhport)
-{
- pico_trace("hcd_port_connect_status\n");
- assert(rhport == 0);
- return usb_hw->sie_status & USB_SIE_STATUS_SPEED_BITS;
-}
-
-tusb_speed_t hcd_port_speed_get(uint8_t rhport)
-{
- assert(rhport == 0);
- // TODO: Should enumval this register
- switch (dev_speed())
- {
- case 1:
- return TUSB_SPEED_LOW;
- case 2:
- return TUSB_SPEED_FULL;
- default:
- panic("Invalid speed\n");
- return TUSB_SPEED_INVALID;
- }
-}
-
-// Close all opened endpoint belong to this device
-void hcd_device_close(uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
- (void) dev_addr;
-
- pico_trace("hcd_device_close %d\n", dev_addr);
-}
-
-uint32_t hcd_frame_number(uint8_t rhport)
-{
- (void) rhport;
- return usb_hw->sof_rd;
-}
-
-void hcd_int_enable(uint8_t rhport)
-{
- assert(rhport == 0);
- irq_set_enabled(USBCTRL_IRQ, true);
-}
-
-void hcd_int_disable(uint8_t rhport)
-{
- // todo we should check this is disabling from the correct core; note currently this is never called
- assert(rhport == 0);
- irq_set_enabled(USBCTRL_IRQ, false);
-}
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-
-bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const * ep_desc)
-{
- (void) rhport;
-
- pico_trace("hcd_edpt_open dev_addr %d, ep_addr %d\n", dev_addr, ep_desc->bEndpointAddress);
-
- // Allocated differently based on if it's an interrupt endpoint or not
- struct hw_endpoint *ep = _hw_endpoint_allocate(ep_desc->bmAttributes.xfer);
-
- _hw_endpoint_init(ep,
- dev_addr,
- ep_desc->bEndpointAddress,
- ep_desc->wMaxPacketSize.size,
- ep_desc->bmAttributes.xfer,
- ep_desc->bInterval);
-
- return true;
-}
-
-bool hcd_edpt_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t * buffer, uint16_t buflen)
-{
- (void) rhport;
-
- pico_trace("hcd_edpt_xfer dev_addr %d, ep_addr 0x%x, len %d\n", dev_addr, ep_addr, buflen);
-
- uint8_t const ep_num = tu_edpt_number(ep_addr);
- tusb_dir_t const ep_dir = tu_edpt_dir(ep_addr);
-
- // Get appropriate ep. Either EPX or interrupt endpoint
- struct hw_endpoint *ep = get_dev_ep(dev_addr, ep_addr);
- assert(ep);
-
- // Control endpoint can change direction 0x00 <-> 0x80
- if ( ep_addr != ep->ep_addr )
- {
- assert(ep_num == 0);
-
- // Direction has flipped on endpoint control so re init it but with same properties
- _hw_endpoint_init(ep, dev_addr, ep_addr, ep->wMaxPacketSize, ep->transfer_type, 0);
- }
-
- // If a normal transfer (non-interrupt) then initiate using
- // sie ctrl registers. Otherwise interrupt ep registers should
- // already be configured
- if (ep == &epx) {
- hw_endpoint_xfer_start(ep, buffer, buflen);
-
- // That has set up buffer control, endpoint control etc
- // for host we have to initiate the transfer
- usb_hw->dev_addr_ctrl = dev_addr | (ep_num << USB_ADDR_ENDP_ENDPOINT_LSB);
-
- uint32_t flags = USB_SIE_CTRL_START_TRANS_BITS | SIE_CTRL_BASE |
- (ep_dir ? USB_SIE_CTRL_RECEIVE_DATA_BITS : USB_SIE_CTRL_SEND_DATA_BITS);
- // Set pre if we are a low speed device on full speed hub
- flags |= need_pre(dev_addr) ? USB_SIE_CTRL_PREAMBLE_EN_BITS : 0;
-
- usb_hw->sie_ctrl = flags;
- }else
- {
- hw_endpoint_xfer_start(ep, buffer, buflen);
- }
-
- return true;
-}
-
-bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet[8])
-{
- (void) rhport;
-
- // Copy data into setup packet buffer
- memcpy((void*)&usbh_dpram->setup_packet[0], setup_packet, 8);
-
- // Configure EP0 struct with setup info for the trans complete
- struct hw_endpoint *ep = _hw_endpoint_allocate(0);
-
- // EP0 out
- _hw_endpoint_init(ep, dev_addr, 0x00, ep->wMaxPacketSize, 0, 0);
- assert(ep->configured);
-
- ep->remaining_len = 8;
- ep->active = true;
-
- // Set device address
- usb_hw->dev_addr_ctrl = dev_addr;
-
- // Set pre if we are a low speed device on full speed hub
- uint32_t const flags = SIE_CTRL_BASE | USB_SIE_CTRL_SEND_SETUP_BITS | USB_SIE_CTRL_START_TRANS_BITS |
- (need_pre(dev_addr) ? USB_SIE_CTRL_PREAMBLE_EN_BITS : 0);
-
- usb_hw->sie_ctrl = flags;
-
- return true;
-}
-
-
-//bool hcd_edpt_busy(uint8_t dev_addr, uint8_t ep_addr)
-//{
-// // EPX is shared, so multiple device addresses and endpoint addresses share that
-// // so if any transfer is active on epx, we are busy. Interrupt endpoints have their own
-// // EPX so ep->active will only be busy if there is a pending transfer on that interrupt endpoint
-// // on that device
-// pico_trace("hcd_edpt_busy dev addr %d ep_addr 0x%x\n", dev_addr, ep_addr);
-// struct hw_endpoint *ep = get_dev_ep(dev_addr, ep_addr);
-// assert(ep);
-// bool busy = ep->active;
-// pico_trace("busy == %d\n", busy);
-// return busy;
-//}
-
-bool hcd_edpt_clear_stall(uint8_t dev_addr, uint8_t ep_addr)
-{
- (void) dev_addr;
- (void) ep_addr;
-
- panic("hcd_clear_stall");
- return true;
-}
-
-#endif
diff --git a/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c b/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c
deleted file mode 100755
index 43554d28..00000000
--- a/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
- * Copyright (c) 2021 Ha Thach (tinyusb.org) for Double Buffered
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if CFG_TUSB_MCU == OPT_MCU_RP2040
-
-#include <stdlib.h>
-#include "rp2040_usb.h"
-
-// Direction strings for debug
-const char *ep_dir_string[] = {
- "out",
- "in",
-};
-
-static inline void _hw_endpoint_lock_update(struct hw_endpoint *ep, int delta) {
- // todo add critsec as necessary to prevent issues between worker and IRQ...
- // note that this is perhaps as simple as disabling IRQs because it would make
- // sense to have worker and IRQ on same core, however I think using critsec is about equivalent.
-}
-
-static void _hw_endpoint_xfer_sync(struct hw_endpoint *ep);
-static void _hw_endpoint_start_next_buffer(struct hw_endpoint *ep);
-
-//--------------------------------------------------------------------+
-//
-//--------------------------------------------------------------------+
-
-void rp2040_usb_init(void)
-{
- // Reset usb controller
- reset_block(RESETS_RESET_USBCTRL_BITS);
- unreset_block_wait(RESETS_RESET_USBCTRL_BITS);
-
- // Clear any previous state just in case
- memset(usb_hw, 0, sizeof(*usb_hw));
- memset(usb_dpram, 0, sizeof(*usb_dpram));
-
- // Mux the controller to the onboard usb phy
- usb_hw->muxing = USB_USB_MUXING_TO_PHY_BITS | USB_USB_MUXING_SOFTCON_BITS;
-}
-
-void hw_endpoint_reset_transfer(struct hw_endpoint *ep)
-{
- ep->stalled = false;
- ep->active = false;
- ep->remaining_len = 0;
- ep->xferred_len = 0;
- ep->user_buf = 0;
-}
-
-void _hw_endpoint_buffer_control_update32(struct hw_endpoint *ep, uint32_t and_mask, uint32_t or_mask) {
- uint32_t value = 0;
- if (and_mask) {
- value = *ep->buffer_control & and_mask;
- }
- if (or_mask) {
- value |= or_mask;
- if (or_mask & USB_BUF_CTRL_AVAIL) {
- if (*ep->buffer_control & USB_BUF_CTRL_AVAIL) {
- panic("ep %d %s was already available", tu_edpt_number(ep->ep_addr), ep_dir_string[tu_edpt_dir(ep->ep_addr)]);
- }
- *ep->buffer_control = value & ~USB_BUF_CTRL_AVAIL;
- // 12 cycle delay.. (should be good for 48*12Mhz = 576Mhz)
- // Don't need delay in host mode as host is in charge
-#if !TUSB_OPT_HOST_ENABLED
- __asm volatile (
- "b 1f\n"
- "1: b 1f\n"
- "1: b 1f\n"
- "1: b 1f\n"
- "1: b 1f\n"
- "1: b 1f\n"
- "1:\n"
- : : : "memory");
-#endif
- }
- }
- *ep->buffer_control = value;
-}
-
-// prepare buffer, return buffer control
-static uint32_t prepare_ep_buffer(struct hw_endpoint *ep, uint8_t buf_id)
-{
- uint16_t const buflen = tu_min16(ep->remaining_len, ep->wMaxPacketSize);
- ep->remaining_len -= buflen;
-
- uint32_t buf_ctrl = buflen | USB_BUF_CTRL_AVAIL;
-
- // PID
- buf_ctrl |= ep->next_pid ? USB_BUF_CTRL_DATA1_PID : USB_BUF_CTRL_DATA0_PID;
- ep->next_pid ^= 1u;
-
- if ( !ep->rx )
- {
- // Copy data from user buffer to hw buffer
- memcpy(ep->hw_data_buf + buf_id*64, ep->user_buf, buflen);
- ep->user_buf += buflen;
-
- // Mark as full
- buf_ctrl |= USB_BUF_CTRL_FULL;
- }
-
- // Is this the last buffer? Only really matters for host mode. Will trigger
- // the trans complete irq but also stop it polling. We only really care about
- // trans complete for setup packets being sent
- if (ep->remaining_len == 0)
- {
- buf_ctrl |= USB_BUF_CTRL_LAST;
- }
-
- if (buf_id) buf_ctrl = buf_ctrl << 16;
-
- return buf_ctrl;
-}
-
-// Prepare buffer control register value
-static void _hw_endpoint_start_next_buffer(struct hw_endpoint *ep)
-{
- uint32_t ep_ctrl = *ep->endpoint_control;
-
- // always compute and start with buffer 0
- uint32_t buf_ctrl = prepare_ep_buffer(ep, 0) | USB_BUF_CTRL_SEL;
-
- // For now: skip double buffered for Device mode, OUT endpoint since
- // host could send < 64 bytes and cause short packet on buffer0
- // NOTE this could happen to Host mode IN endpoint
- bool const force_single = !(usb_hw->main_ctrl & USB_MAIN_CTRL_HOST_NDEVICE_BITS) && !tu_edpt_dir(ep->ep_addr);
-
- if(ep->remaining_len && !force_single)
- {
- // Use buffer 1 (double buffered) if there is still data
- // TODO: Isochronous for buffer1 bit-field is different than CBI (control bulk, interrupt)
-
- buf_ctrl |= prepare_ep_buffer(ep, 1);
-
- // Set endpoint control double buffered bit if needed
- ep_ctrl &= ~EP_CTRL_INTERRUPT_PER_BUFFER;
- ep_ctrl |= EP_CTRL_DOUBLE_BUFFERED_BITS | EP_CTRL_INTERRUPT_PER_DOUBLE_BUFFER;
- }else
- {
- // Single buffered since 1 is enough
- ep_ctrl &= ~(EP_CTRL_DOUBLE_BUFFERED_BITS | EP_CTRL_INTERRUPT_PER_DOUBLE_BUFFER);
- ep_ctrl |= EP_CTRL_INTERRUPT_PER_BUFFER;
- }
-
- *ep->endpoint_control = ep_ctrl;
-
- TU_LOG(3, "Prepare Buffer Control:\r\n");
- print_bufctrl32(buf_ctrl);
-
- // Finally, write to buffer_control which will trigger the transfer
- // the next time the controller polls this dpram address
- _hw_endpoint_buffer_control_set_value32(ep, buf_ctrl);
-}
-
-void hw_endpoint_xfer_start(struct hw_endpoint *ep, uint8_t *buffer, uint16_t total_len)
-{
- _hw_endpoint_lock_update(ep, 1);
-
- if ( ep->active )
- {
- // TODO: Is this acceptable for interrupt packets?
- TU_LOG(1, "WARN: starting new transfer on already active ep %d %s\n", tu_edpt_number(ep->ep_addr),
- ep_dir_string[tu_edpt_dir(ep->ep_addr)]);
-
- hw_endpoint_reset_transfer(ep);
- }
-
- // Fill in info now that we're kicking off the hw
- ep->remaining_len = total_len;
- ep->xferred_len = 0;
- ep->active = true;
- ep->user_buf = buffer;
-
- _hw_endpoint_start_next_buffer(ep);
- _hw_endpoint_lock_update(ep, -1);
-}
-
-// sync endpoint buffer and return transferred bytes
-static uint16_t sync_ep_buffer(struct hw_endpoint *ep, uint8_t buf_id)
-{
- uint32_t buf_ctrl = _hw_endpoint_buffer_control_get_value32(ep);
- if (buf_id) buf_ctrl = buf_ctrl >> 16;
-
- uint16_t xferred_bytes = buf_ctrl & USB_BUF_CTRL_LEN_MASK;
-
- if ( !ep->rx )
- {
- // We are continuing a transfer here. If we are TX, we have successfully
- // sent some data can increase the length we have sent
- assert(!(buf_ctrl & USB_BUF_CTRL_FULL));
-
- ep->xferred_len += xferred_bytes;
- }else
- {
- // If we have received some data, so can increase the length
- // we have received AFTER we have copied it to the user buffer at the appropriate offset
- assert(buf_ctrl & USB_BUF_CTRL_FULL);
-
- memcpy(ep->user_buf, ep->hw_data_buf + buf_id*64, xferred_bytes);
- ep->xferred_len += xferred_bytes;
- ep->user_buf += xferred_bytes;
- }
-
- // Short packet
- if (xferred_bytes < ep->wMaxPacketSize)
- {
- pico_trace("Short rx transfer on buffer %d with %u bytes\n", buf_id, xferred_bytes);
- // Reduce total length as this is last packet
- ep->remaining_len = 0;
- }
-
- return xferred_bytes;
-}
-
-static void _hw_endpoint_xfer_sync (struct hw_endpoint *ep)
-{
- // Update hw endpoint struct with info from hardware
- // after a buff status interrupt
-
- uint32_t buf_ctrl = _hw_endpoint_buffer_control_get_value32(ep);
- TU_LOG(3, "_hw_endpoint_xfer_sync:\r\n");
- print_bufctrl32(buf_ctrl);
-
- // always sync buffer 0
- uint16_t buf0_bytes = sync_ep_buffer(ep, 0);
-
- // sync buffer 1 if double buffered
- if ( (*ep->endpoint_control) & EP_CTRL_DOUBLE_BUFFERED_BITS )
- {
- if (buf0_bytes == ep->wMaxPacketSize)
- {
- // sync buffer 1 if not short packet
- sync_ep_buffer(ep, 1);
- }else
- {
- // short packet on buffer 0
- // TODO couldn't figure out how to handle this case which happen with net_lwip_webserver example
- // At this time (currently trigger per 2 buffer), the buffer1 is probably filled with data from
- // the next transfer (not current one). For now we disable double buffered for device OUT
- // NOTE this could happen to Host IN
-#if 0
- uint8_t const ep_num = tu_edpt_number(ep->ep_addr);
- uint8_t const dir = (uint8_t) tu_edpt_dir(ep->ep_addr);
- uint8_t const ep_id = 2*ep_num + (dir ? 0 : 1);
-
- // abort queued transfer on buffer 1
- usb_hw->abort |= TU_BIT(ep_id);
-
- while ( !(usb_hw->abort_done & TU_BIT(ep_id)) ) {}
-
- uint32_t ep_ctrl = *ep->endpoint_control;
- ep_ctrl &= ~(EP_CTRL_DOUBLE_BUFFERED_BITS | EP_CTRL_INTERRUPT_PER_DOUBLE_BUFFER);
- ep_ctrl |= EP_CTRL_INTERRUPT_PER_BUFFER;
-
- _hw_endpoint_buffer_control_set_value32(ep, 0);
-
- usb_hw->abort &= ~TU_BIT(ep_id);
-
- TU_LOG(3, "----SHORT PACKET buffer0 on EP %02X:\r\n", ep->ep_addr);
- print_bufctrl32(buf_ctrl);
-#endif
- }
- }
-}
-
-// Returns true if transfer is complete
-bool hw_endpoint_xfer_continue(struct hw_endpoint *ep)
-{
- _hw_endpoint_lock_update(ep, 1);
- // Part way through a transfer
- if (!ep->active)
- {
- panic("Can't continue xfer on inactive ep %d %s", tu_edpt_number(ep->ep_addr), ep_dir_string);
- }
-
- // Update EP struct from hardware state
- _hw_endpoint_xfer_sync(ep);
-
- // Now we have synced our state with the hardware. Is there more data to transfer?
- // If we are done then notify tinyusb
- if (ep->remaining_len == 0)
- {
- pico_trace("Completed transfer of %d bytes on ep %d %s\n",
- ep->xferred_len, tu_edpt_number(ep->ep_addr), ep_dir_string[tu_edpt_dir(ep->ep_addr)]);
- // Notify caller we are done so it can notify the tinyusb stack
- _hw_endpoint_lock_update(ep, -1);
- return true;
- }
- else
- {
- _hw_endpoint_start_next_buffer(ep);
- }
-
- _hw_endpoint_lock_update(ep, -1);
- // More work to do
- return false;
-}
-
-#endif
diff --git a/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.h b/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.h
deleted file mode 100755
index 5570a731..00000000
--- a/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.h
+++ /dev/null
@@ -1,147 +0,0 @@
-#ifndef RP2040_COMMON_H_
-#define RP2040_COMMON_H_
-
-#if defined(RP2040_USB_HOST_MODE) && defined(RP2040_USB_DEVICE_MODE)
-#error TinyUSB device and host mode not supported at the same time
-#endif
-
-#include "common/tusb_common.h"
-
-#include "pico.h"
-#include "hardware/structs/usb.h"
-#include "hardware/irq.h"
-#include "hardware/resets.h"
-
-#if defined(PICO_RP2040_USB_DEVICE_ENUMERATION_FIX) && !defined(TUD_OPT_RP2040_USB_DEVICE_ENUMERATION_FIX)
-#define TUD_OPT_RP2040_USB_DEVICE_ENUMERATION_FIX PICO_RP2040_USB_DEVICE_ENUMERATION_FIX
-#endif
-
-
-#define pico_info(...) TU_LOG(2, __VA_ARGS__)
-#define pico_trace(...) TU_LOG(3, __VA_ARGS__)
-
-// Hardware information per endpoint
-struct hw_endpoint
-{
- // Is this a valid struct
- bool configured;
-
- // Transfer direction (i.e. IN is rx for host but tx for device)
- // allows us to common up transfer functions
- bool rx;
-
- uint8_t ep_addr;
- uint8_t next_pid;
-
- // Endpoint control register
- io_rw_32 *endpoint_control;
-
- // Buffer control register
- io_rw_32 *buffer_control;
-
- // Buffer pointer in usb dpram
- uint8_t *hw_data_buf;
-
- // Have we been stalled TODO remove later
- bool stalled;
-
- // Current transfer information
- bool active;
- uint16_t remaining_len;
- uint16_t xferred_len;
-
- // User buffer in main memory
- uint8_t *user_buf;
-
- // Data needed from EP descriptor
- uint16_t wMaxPacketSize;
-
- // Interrupt, bulk, etc
- uint8_t transfer_type;
-
-#if TUSB_OPT_HOST_ENABLED
- // Only needed for host
- uint8_t dev_addr;
-
- // If interrupt endpoint
- uint8_t interrupt_num;
-#endif
-};
-
-void rp2040_usb_init(void);
-
-void hw_endpoint_xfer_start(struct hw_endpoint *ep, uint8_t *buffer, uint16_t total_len);
-bool hw_endpoint_xfer_continue(struct hw_endpoint *ep);
-void hw_endpoint_reset_transfer(struct hw_endpoint *ep);
-
-void _hw_endpoint_buffer_control_update32(struct hw_endpoint *ep, uint32_t and_mask, uint32_t or_mask);
-static inline uint32_t _hw_endpoint_buffer_control_get_value32(struct hw_endpoint *ep) {
- return *ep->buffer_control;
-}
-static inline void _hw_endpoint_buffer_control_set_value32(struct hw_endpoint *ep, uint32_t value) {
- return _hw_endpoint_buffer_control_update32(ep, 0, value);
-}
-static inline void _hw_endpoint_buffer_control_set_mask32(struct hw_endpoint *ep, uint32_t value) {
- return _hw_endpoint_buffer_control_update32(ep, ~value, value);
-}
-static inline void _hw_endpoint_buffer_control_clear_mask32(struct hw_endpoint *ep, uint32_t value) {
- return _hw_endpoint_buffer_control_update32(ep, ~value, 0);
-}
-
-static inline uintptr_t hw_data_offset(uint8_t *buf)
-{
- // Remove usb base from buffer pointer
- return (uintptr_t)buf ^ (uintptr_t)usb_dpram;
-}
-
-extern const char *ep_dir_string[];
-
-typedef union TU_ATTR_PACKED
-{
- uint16_t u16;
- struct TU_ATTR_PACKED
- {
- uint16_t xfer_len : 10;
- uint16_t available : 1;
- uint16_t stall : 1;
- uint16_t reset_bufsel : 1;
- uint16_t data_toggle : 1;
- uint16_t last_buf : 1;
- uint16_t full : 1;
- };
-} rp2040_buffer_control_t;
-
-TU_VERIFY_STATIC(sizeof(rp2040_buffer_control_t) == 2, "size is not correct");
-
-#if CFG_TUSB_DEBUG >= 3
-static inline void print_bufctrl16(uint32_t u16)
-{
- rp2040_buffer_control_t bufctrl = {
- .u16 = u16
- };
-
- TU_LOG(3, "len = %u, available = %u, full = %u, last = %u, stall = %u, reset = %u, toggle = %u\r\n",
- bufctrl.xfer_len, bufctrl.available, bufctrl.full, bufctrl.last_buf, bufctrl.stall, bufctrl.reset_bufsel, bufctrl.data_toggle);
-}
-
-static inline void print_bufctrl32(uint32_t u32)
-{
- uint16_t u16;
-
- u16 = u32 >> 16;
- TU_LOG(3, " Buffer Control 1 0x%x: ", u16);
- print_bufctrl16(u16);
-
- u16 = u32 & 0x0000ffff;
- TU_LOG(3, " Buffer Control 0 0x%x: ", u16);
- print_bufctrl16(u16);
-}
-
-#else
-
-#define print_bufctrl16(u16)
-#define print_bufctrl32(u32)
-
-#endif
-
-#endif
diff --git a/tinyusb/src/portable/renesas/usba/dcd_usba.c b/tinyusb/src/portable/renesas/usba/dcd_usba.c
deleted file mode 100755
index 095dcc13..00000000
--- a/tinyusb/src/portable/renesas/usba/dcd_usba.c
+++ /dev/null
@@ -1,891 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 Koji Kitayama
- * Portions copyrighted (c) 2021 Roland Winistoerfer
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-// Since TinyUSB doesn't use SOF for now, and this interrupt too often (1ms interval)
-// We disable SOF for now until needed later on
-#define USE_SOF 0
-
-#if TUSB_OPT_DEVICE_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_RX63X || \
- CFG_TUSB_MCU == OPT_MCU_RX65X || \
- CFG_TUSB_MCU == OPT_MCU_RX72N )
-#include "device/dcd.h"
-#include "iodefine.h"
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-#define SYSTEM_PRCR_PRC1 (1<<1)
-#define SYSTEM_PRCR_PRKEY (0xA5u<<8)
-
-#define USB_FIFOSEL_TX ((uint16_t)(1u<<5))
-#define USB_FIFOSEL_BIGEND ((uint16_t)(1u<<8))
-#define USB_FIFOSEL_MBW_8 ((uint16_t)(0u<<10))
-#define USB_FIFOSEL_MBW_16 ((uint16_t)(1u<<10))
-#define USB_IS0_CTSQ ((uint16_t)(7u))
-#define USB_IS0_DVSQ ((uint16_t)(7u<<4))
-#define USB_IS0_VALID ((uint16_t)(1u<<3))
-#define USB_IS0_BRDY ((uint16_t)(1u<<8))
-#define USB_IS0_NRDY ((uint16_t)(1u<<9))
-#define USB_IS0_BEMP ((uint16_t)(1u<<10))
-#define USB_IS0_CTRT ((uint16_t)(1u<<11))
-#define USB_IS0_DVST ((uint16_t)(1u<<12))
-#define USB_IS0_SOFR ((uint16_t)(1u<<13))
-#define USB_IS0_RESM ((uint16_t)(1u<<14))
-#define USB_IS0_VBINT ((uint16_t)(1u<<15))
-#define USB_IS1_SACK ((uint16_t)(1u<<4))
-#define USB_IS1_SIGN ((uint16_t)(1u<<5))
-#define USB_IS1_EOFERR ((uint16_t)(1u<<6))
-#define USB_IS1_ATTCH ((uint16_t)(1u<<11))
-#define USB_IS1_DTCH ((uint16_t)(1u<<12))
-#define USB_IS1_BCHG ((uint16_t)(1u<<14))
-#define USB_IS1_OVRCR ((uint16_t)(1u<<15))
-
-#define USB_IS0_CTSQ_MSK (7u)
-#define USB_IS0_CTSQ_SETUP (1u)
-#define USB_IS0_DVSQ_DEF (1u<<4)
-#define USB_IS0_DVSQ_ADDR (2u<<4)
-#define USB_IS0_DVSQ_SUSP0 (4u<<4)
-#define USB_IS0_DVSQ_SUSP1 (5u<<4)
-#define USB_IS0_DVSQ_SUSP2 (6u<<4)
-#define USB_IS0_DVSQ_SUSP3 (7u<<4)
-
-#define USB_PIPECTR_PID_NAK (0u)
-#define USB_PIPECTR_PID_BUF (1u)
-#define USB_PIPECTR_PID_STALL (2u)
-#define USB_PIPECTR_CCPL (1u<<2)
-#define USB_PIPECTR_SQMON (1u<<6)
-#define USB_PIPECTR_SQCLR (1u<<8)
-#define USB_PIPECTR_ACLRM (1u<<9)
-#define USB_PIPECTR_INBUFM (1u<<14)
-#define USB_PIPECTR_BSTS (1u<<15)
-
-#define USB_FIFOCTR_DTLN (0x1FF)
-#define USB_FIFOCTR_FRDY (1u<<13)
-#define USB_FIFOCTR_BCLR (1u<<14)
-#define USB_FIFOCTR_BVAL (1u<<15)
-
-#define USB_PIPECFG_SHTNAK (1u<<7)
-#define USB_PIPECFG_DBLB (1u<<9)
-#define USB_PIPECFG_BULK (1u<<14)
-#define USB_PIPECFG_ISO (3u<<14)
-#define USB_PIPECFG_INT (2u<<14)
-
-#define FIFO_REQ_CLR (1u)
-#define FIFO_COMPLETE (1u<<1)
-
-// Start of definition of packed structs (used by the CCRX toolchain)
-TU_ATTR_PACKED_BEGIN
-TU_ATTR_BIT_FIELD_ORDER_BEGIN
-
-typedef struct {
- union {
- struct {
- uint16_t : 8;
- uint16_t TRCLR: 1;
- uint16_t TRENB: 1;
- uint16_t : 0;
- };
- uint16_t TRE;
- };
- uint16_t TRN;
-} reg_pipetre_t;
-
-typedef union {
- struct {
- volatile uint16_t u8: 8;
- volatile uint16_t : 0;
- };
- volatile uint16_t u16;
-} hw_fifo_t;
-
-typedef struct TU_ATTR_PACKED
-{
- void *buf; /* the start address of a transfer data buffer */
- uint16_t length; /* the number of bytes in the buffer */
- uint16_t remaining; /* the number of bytes remaining in the buffer */
- struct {
- uint32_t ep : 8; /* an assigned endpoint address */
- uint32_t ff : 1; /* `buf` is TU_FUFO or POD */
- uint32_t : 0;
- };
-} pipe_state_t;
-
-TU_ATTR_PACKED_END // End of definition of packed structs (used by the CCRX toolchain)
-TU_ATTR_BIT_FIELD_ORDER_END
-
-typedef struct
-{
- pipe_state_t pipe[10];
- uint8_t ep[2][16]; /* a lookup table for a pipe index from an endpoint address */
-} dcd_data_t;
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-static dcd_data_t _dcd;
-
-static uint32_t disable_interrupt(void)
-{
- uint32_t pswi;
-#if defined(__CCRX__)
- pswi = get_psw() & 0x010000;
- clrpsw_i();
-#else
- pswi = __builtin_rx_mvfc(0) & 0x010000;
- __builtin_rx_clrpsw('I');
-#endif
- return pswi;
-}
-
-static void enable_interrupt(uint32_t pswi)
-{
-#if defined(__CCRX__)
- set_psw(get_psw() | pswi);
-#else
- __builtin_rx_mvtc(0, __builtin_rx_mvfc(0) | pswi);
-#endif
-}
-
-static unsigned find_pipe(unsigned xfer)
-{
- switch (xfer) {
- case TUSB_XFER_ISOCHRONOUS:
- for (int i = 1; i <= 2; ++i) {
- if (0 == _dcd.pipe[i].ep) return i;
- }
- break;
- case TUSB_XFER_BULK:
- for (int i = 3; i <= 5; ++i) {
- if (0 == _dcd.pipe[i].ep) return i;
- }
- for (int i = 1; i <= 1; ++i) {
- if (0 == _dcd.pipe[i].ep) return i;
- }
- break;
- case TUSB_XFER_INTERRUPT:
- for (int i = 6; i <= 9; ++i) {
- if (0 == _dcd.pipe[i].ep) return i;
- }
- break;
- default:
- /* No support for control transfer */
- break;
- }
- return 0;
-}
-
-static volatile uint16_t* get_pipectr(unsigned num)
-{
- volatile uint16_t *ctr = NULL;
- if (num) {
- ctr = (volatile uint16_t*)&USB0.PIPE1CTR.WORD;
- ctr += num - 1;
- } else {
- ctr = (volatile uint16_t*)&USB0.DCPCTR.WORD;
- }
- return ctr;
-}
-
-static volatile reg_pipetre_t* get_pipetre(unsigned num)
-{
- volatile reg_pipetre_t* tre = NULL;
- if ((1 <= num) && (num <= 5)) {
- tre = (volatile reg_pipetre_t*)&USB0.PIPE1TRE.WORD;
- tre += num - 1;
- }
- return tre;
-}
-
-static volatile uint16_t* ep_addr_to_pipectr(uint8_t rhport, unsigned ep_addr)
-{
- (void)rhport;
- volatile uint16_t *ctr = NULL;
- const unsigned epn = tu_edpt_number(ep_addr);
- if (epn) {
- const unsigned dir = tu_edpt_dir(ep_addr);
- const unsigned num = _dcd.ep[dir][epn];
- if (num) {
- ctr = (volatile uint16_t*)&USB0.PIPE1CTR.WORD;
- ctr += num - 1;
- }
- } else {
- ctr = (volatile uint16_t*)&USB0.DCPCTR.WORD;
- }
- return ctr;
-}
-
-static unsigned edpt0_max_packet_size(void)
-{
- return USB0.DCPMAXP.BIT.MXPS;
-}
-
-static unsigned edpt_max_packet_size(unsigned num)
-{
- USB0.PIPESEL.WORD = num;
- return USB0.PIPEMAXP.WORD;
-}
-
-static inline void pipe_wait_for_ready(unsigned num)
-{
- while (USB0.D0FIFOSEL.BIT.CURPIPE != num) ;
- while (!USB0.D0FIFOCTR.BIT.FRDY) ;
-}
-
-static void pipe_write_packet(void *buf, volatile void *fifo, unsigned len)
-{
- hw_fifo_t *reg = (hw_fifo_t*)fifo;
- uintptr_t addr = (uintptr_t)buf;
- while (len >= 2) {
- reg->u16 = *(const uint16_t *)addr;
- addr += 2;
- len -= 2;
- }
- if (len) {
- reg->u8 = *(const uint8_t *)addr;
- ++addr;
- }
-}
-
-static void pipe_read_packet(void *buf, volatile void *fifo, unsigned len)
-{
- uint8_t *p = (uint8_t*)buf;
- uint8_t *reg = (uint8_t*)fifo; /* byte access is always at base register address */
- while (len--) *p++ = *reg;
-}
-
-static void pipe_read_write_packet_ff(tu_fifo_t *f, volatile void *fifo, unsigned len, unsigned dir)
-{
- static const struct {
- void (*tu_fifo_get_info)(tu_fifo_t *f, tu_fifo_buffer_info_t *info);
- void (*tu_fifo_advance)(tu_fifo_t *f, uint16_t n);
- void (*pipe_read_write)(void *buf, volatile void *fifo, unsigned len);
- } ops[] = {
- /* OUT */ {tu_fifo_get_write_info,tu_fifo_advance_write_pointer,pipe_read_packet},
- /* IN */ {tu_fifo_get_read_info, tu_fifo_advance_read_pointer, pipe_write_packet},
- };
- tu_fifo_buffer_info_t info;
- ops[dir].tu_fifo_get_info(f, &info);
- unsigned total_len = len;
- len = TU_MIN(total_len, info.len_lin);
- ops[dir].pipe_read_write(info.ptr_lin, fifo, len);
- unsigned rem = total_len - len;
- if (rem) {
- len = TU_MIN(rem, info.len_wrap);
- ops[dir].pipe_read_write(info.ptr_wrap, fifo, len);
- rem -= len;
- }
- ops[dir].tu_fifo_advance(f, total_len - rem);
-}
-
-static bool pipe0_xfer_in(void)
-{
- pipe_state_t *pipe = &_dcd.pipe[0];
- const unsigned rem = pipe->remaining;
- if (!rem) {
- pipe->buf = NULL;
- return true;
- }
- const unsigned mps = edpt0_max_packet_size();
- const unsigned len = TU_MIN(mps, rem);
- void *buf = pipe->buf;
- if (len) {
- if (pipe->ff) {
- pipe_read_write_packet_ff((tu_fifo_t*)buf, (volatile void*)&USB0.CFIFO.WORD, len, TUSB_DIR_IN);
- } else {
- pipe_write_packet(buf, (volatile void*)&USB0.CFIFO.WORD, len);
- pipe->buf = (uint8_t*)buf + len;
- }
- }
- if (len < mps) USB0.CFIFOCTR.WORD = USB_FIFOCTR_BVAL;
- pipe->remaining = rem - len;
- return false;
-}
-
-static bool pipe0_xfer_out(void)
-{
- pipe_state_t *pipe = &_dcd.pipe[0];
- const unsigned rem = pipe->remaining;
-
- const unsigned mps = edpt0_max_packet_size();
- const unsigned vld = USB0.CFIFOCTR.BIT.DTLN;
- const unsigned len = TU_MIN(TU_MIN(rem, mps), vld);
- void *buf = pipe->buf;
- if (len) {
- if (pipe->ff) {
- pipe_read_write_packet_ff((tu_fifo_t*)buf, (volatile void*)&USB0.CFIFO.WORD, len, TUSB_DIR_OUT);
- } else {
- pipe_read_packet(buf, (volatile void*)&USB0.CFIFO.WORD, len);
- pipe->buf = (uint8_t*)buf + len;
- }
- }
- if (len < mps) USB0.CFIFOCTR.WORD = USB_FIFOCTR_BCLR;
- pipe->remaining = rem - len;
- if ((len < mps) || (rem == len)) {
- pipe->buf = NULL;
- return true;
- }
- return false;
-}
-
-static bool pipe_xfer_in(unsigned num)
-{
- pipe_state_t *pipe = &_dcd.pipe[num];
- const unsigned rem = pipe->remaining;
-
- if (!rem) {
- pipe->buf = NULL;
- return true;
- }
-
- USB0.D0FIFOSEL.WORD = num | USB_FIFOSEL_MBW_16 | (TU_BYTE_ORDER == TU_BIG_ENDIAN ? USB_FIFOSEL_BIGEND : 0);
- const unsigned mps = edpt_max_packet_size(num);
- pipe_wait_for_ready(num);
- const unsigned len = TU_MIN(rem, mps);
- void *buf = pipe->buf;
- if (len) {
- if (pipe->ff) {
- pipe_read_write_packet_ff((tu_fifo_t*)buf, (volatile void*)&USB0.D0FIFO.WORD, len, TUSB_DIR_IN);
- } else {
- pipe_write_packet(buf, (volatile void*)&USB0.D0FIFO.WORD, len);
- pipe->buf = (uint8_t*)buf + len;
- }
- }
- if (len < mps) USB0.D0FIFOCTR.WORD = USB_FIFOCTR_BVAL;
- USB0.D0FIFOSEL.WORD = 0;
- while (USB0.D0FIFOSEL.BIT.CURPIPE) ; /* if CURPIPE bits changes, check written value */
- pipe->remaining = rem - len;
- return false;
-}
-
-static bool pipe_xfer_out(unsigned num)
-{
- pipe_state_t *pipe = &_dcd.pipe[num];
- const unsigned rem = pipe->remaining;
-
- USB0.D0FIFOSEL.WORD = num | USB_FIFOSEL_MBW_8;
- const unsigned mps = edpt_max_packet_size(num);
- pipe_wait_for_ready(num);
- const unsigned vld = USB0.D0FIFOCTR.BIT.DTLN;
- const unsigned len = TU_MIN(TU_MIN(rem, mps), vld);
- void *buf = pipe->buf;
- if (len) {
- if (pipe->ff) {
- pipe_read_write_packet_ff((tu_fifo_t*)buf, (volatile void*)&USB0.D0FIFO.WORD, len, TUSB_DIR_OUT);
- } else {
- pipe_read_packet(buf, (volatile void*)&USB0.D0FIFO.WORD, len);
- pipe->buf = (uint8_t*)buf + len;
- }
- }
- if (len < mps) USB0.D0FIFOCTR.WORD = USB_FIFOCTR_BCLR;
- USB0.D0FIFOSEL.WORD = 0;
- while (USB0.D0FIFOSEL.BIT.CURPIPE) ; /* if CURPIPE bits changes, check written value */
- pipe->remaining = rem - len;
- if ((len < mps) || (rem == len)) {
- pipe->buf = NULL;
- return NULL != buf;
- }
- return false;
-}
-
-static void process_setup_packet(uint8_t rhport)
-{
- uint16_t setup_packet[4];
- if (0 == (USB0.INTSTS0.WORD & USB_IS0_VALID)) return;
- USB0.CFIFOCTR.WORD = USB_FIFOCTR_BCLR;
- setup_packet[0] = tu_le16toh(USB0.USBREQ.WORD);
- setup_packet[1] = USB0.USBVAL;
- setup_packet[2] = USB0.USBINDX;
- setup_packet[3] = USB0.USBLENG;
- USB0.INTSTS0.WORD = ~USB_IS0_VALID;
- dcd_event_setup_received(rhport, (const uint8_t*)&setup_packet[0], true);
-}
-
-static void process_status_completion(uint8_t rhport)
-{
- uint8_t ep_addr;
- /* Check the data stage direction */
- if (USB0.CFIFOSEL.WORD & USB_FIFOSEL_TX) {
- /* IN transfer. */
- ep_addr = tu_edpt_addr(0, TUSB_DIR_IN);
- } else {
- /* OUT transfer. */
- ep_addr = tu_edpt_addr(0, TUSB_DIR_OUT);
- }
- dcd_event_xfer_complete(rhport, ep_addr, 0, XFER_RESULT_SUCCESS, true);
-}
-
-static bool process_pipe0_xfer(int buffer_type, uint8_t ep_addr, void* buffer, uint16_t total_bytes)
-{
- /* configure fifo direction and access unit settings */
- if (ep_addr) { /* IN, 2 bytes */
- USB0.CFIFOSEL.WORD = USB_FIFOSEL_TX | USB_FIFOSEL_MBW_16 | (TU_BYTE_ORDER == TU_BIG_ENDIAN ? USB_FIFOSEL_BIGEND : 0);
- while (!(USB0.CFIFOSEL.WORD & USB_FIFOSEL_TX)) ;
- } else { /* OUT, a byte */
- USB0.CFIFOSEL.WORD = USB_FIFOSEL_MBW_8;
- while (USB0.CFIFOSEL.WORD & USB_FIFOSEL_TX) ;
- }
-
- pipe_state_t *pipe = &_dcd.pipe[0];
- pipe->ff = buffer_type;
- pipe->length = total_bytes;
- pipe->remaining = total_bytes;
- if (total_bytes) {
- pipe->buf = buffer;
- if (ep_addr) { /* IN */
- TU_ASSERT(USB0.DCPCTR.BIT.BSTS && (USB0.USBREQ.WORD & 0x80));
- pipe0_xfer_in();
- }
- USB0.DCPCTR.WORD = USB_PIPECTR_PID_BUF;
- } else {
- /* ZLP */
- pipe->buf = NULL;
- USB0.DCPCTR.WORD = USB_PIPECTR_CCPL | USB_PIPECTR_PID_BUF;
- }
- return true;
-}
-
-static bool process_pipe_xfer(int buffer_type, uint8_t ep_addr, void* buffer, uint16_t total_bytes)
-{
- const unsigned epn = tu_edpt_number(ep_addr);
- const unsigned dir = tu_edpt_dir(ep_addr);
- const unsigned num = _dcd.ep[dir][epn];
-
- TU_ASSERT(num);
-
- pipe_state_t *pipe = &_dcd.pipe[num];
- pipe->ff = buffer_type;
- pipe->buf = buffer;
- pipe->length = total_bytes;
- pipe->remaining = total_bytes;
- if (dir) { /* IN */
- if (total_bytes) {
- pipe_xfer_in(num);
- } else { /* ZLP */
- USB0.D0FIFOSEL.WORD = num;
- pipe_wait_for_ready(num);
- USB0.D0FIFOCTR.WORD = USB_FIFOCTR_BVAL;
- USB0.D0FIFOSEL.WORD = 0;
- while (USB0.D0FIFOSEL.BIT.CURPIPE) ; /* if CURPIPE bits changes, check written value */
- }
- } else {
- volatile reg_pipetre_t *pt = get_pipetre(num);
- if (pt) {
- const unsigned mps = edpt_max_packet_size(num);
- volatile uint16_t *ctr = get_pipectr(num);
- if (*ctr & 0x3) *ctr = USB_PIPECTR_PID_NAK;
- pt->TRE = TU_BIT(8);
- pt->TRN = (total_bytes + mps - 1) / mps;
- pt->TRENB = 1;
- *ctr = USB_PIPECTR_PID_BUF;
- }
- }
- // TU_LOG1("X %x %d %d\r\n", ep_addr, total_bytes, buffer_type);
- return true;
-}
-
-static bool process_edpt_xfer(int buffer_type, uint8_t ep_addr, void* buffer, uint16_t total_bytes)
-{
- const unsigned epn = tu_edpt_number(ep_addr);
- if (0 == epn) {
- return process_pipe0_xfer(buffer_type, ep_addr, buffer, total_bytes);
- } else {
- return process_pipe_xfer(buffer_type, ep_addr, buffer, total_bytes);
- }
-}
-
-static void process_pipe0_bemp(uint8_t rhport)
-{
- bool completed = pipe0_xfer_in();
- if (completed) {
- pipe_state_t *pipe = &_dcd.pipe[0];
- dcd_event_xfer_complete(rhport, tu_edpt_addr(0, TUSB_DIR_IN),
- pipe->length, XFER_RESULT_SUCCESS, true);
- }
-}
-
-static void process_pipe_brdy(uint8_t rhport, unsigned num)
-{
- pipe_state_t *pipe = &_dcd.pipe[num];
- const unsigned dir = tu_edpt_dir(pipe->ep);
- bool completed;
-
- if (dir) { /* IN */
- completed = pipe_xfer_in(num);
- } else {
- if (num) {
- completed = pipe_xfer_out(num);
- } else {
- completed = pipe0_xfer_out();
- }
- }
- if (completed) {
- dcd_event_xfer_complete(rhport, pipe->ep,
- pipe->length - pipe->remaining,
- XFER_RESULT_SUCCESS, true);
- // TU_LOG1("C %d %d\r\n", num, pipe->length - pipe->remaining);
- }
-}
-
-static void process_bus_reset(uint8_t rhport)
-{
- USB0.BEMPENB.WORD = 1;
- USB0.BRDYENB.WORD = 1;
- USB0.CFIFOCTR.WORD = USB_FIFOCTR_BCLR;
- USB0.D0FIFOSEL.WORD = 0;
- while (USB0.D0FIFOSEL.BIT.CURPIPE) ; /* if CURPIPE bits changes, check written value */
- USB0.D1FIFOSEL.WORD = 0;
- while (USB0.D1FIFOSEL.BIT.CURPIPE) ; /* if CURPIPE bits changes, check written value */
- volatile uint16_t *ctr = (volatile uint16_t*)((uintptr_t)(&USB0.PIPE1CTR.WORD));
- volatile uint16_t *tre = (volatile uint16_t*)((uintptr_t)(&USB0.PIPE1TRE.WORD));
- for (int i = 1; i <= 5; ++i) {
- USB0.PIPESEL.WORD = i;
- USB0.PIPECFG.WORD = 0;
- *ctr = USB_PIPECTR_ACLRM;
- *ctr = 0;
- ++ctr;
- *tre = TU_BIT(8);
- tre += 2;
- }
- for (int i = 6; i <= 9; ++i) {
- USB0.PIPESEL.WORD = i;
- USB0.PIPECFG.WORD = 0;
- *ctr = USB_PIPECTR_ACLRM;
- *ctr = 0;
- ++ctr;
- }
- tu_varclr(&_dcd);
- dcd_event_bus_reset(rhport, TUSB_SPEED_FULL, true);
-}
-
-static void process_set_address(uint8_t rhport)
-{
- const uint32_t addr = USB0.USBADDR.BIT.USBADDR;
- if (!addr) return;
- const tusb_control_request_t setup_packet = {
-#if defined(__CCRX__)
- .bmRequestType = { 0 }, /* Note: CCRX needs the braces over this struct member */
-#else
- .bmRequestType = 0,
-#endif
- .bRequest = TUSB_REQ_SET_ADDRESS,
- .wValue = addr,
- .wIndex = 0,
- .wLength = 0,
- };
- dcd_event_setup_received(rhport, (const uint8_t*)&setup_packet, true);
-}
-
-/*------------------------------------------------------------------*/
-/* Device API
- *------------------------------------------------------------------*/
-void dcd_init(uint8_t rhport)
-{
- (void)rhport;
- /* Enable USB0 */
- uint32_t pswi = disable_interrupt();
- SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY | SYSTEM_PRCR_PRC1;
- MSTP(USB0) = 0;
- SYSTEM.PRCR.WORD = SYSTEM_PRCR_PRKEY;
- enable_interrupt(pswi);
- USB0.SYSCFG.BIT.SCKE = 1;
- while (!USB0.SYSCFG.BIT.SCKE) ;
- USB0.SYSCFG.BIT.DRPD = 0;
- USB0.SYSCFG.BIT.DCFM = 0;
- USB0.SYSCFG.BIT.USBE = 1;
-
- USB.DPUSR0R.BIT.FIXPHY0 = 0u; /* USB0 Transceiver Output fixed */
-#if ( CFG_TUSB_MCU == OPT_MCU_RX72N )
- USB0.PHYSLEW.LONG = 0x5;
- IR(PERIB, INTB185) = 0;
-#else
- IR(USB0, USBI0) = 0;
-#endif
-
- /* Setup default control pipe */
- USB0.DCPMAXP.BIT.MXPS = 64;
- USB0.INTENB0.WORD = USB_IS0_VBINT | USB_IS0_BRDY | USB_IS0_BEMP |
- USB_IS0_DVST | USB_IS0_CTRT | (USE_SOF ? USB_IS0_SOFR: 0) | USB_IS0_RESM;
- USB0.BEMPENB.WORD = 1;
- USB0.BRDYENB.WORD = 1;
-
- if (USB0.INTSTS0.BIT.VBSTS) {
- dcd_connect(rhport);
- }
-}
-
-void dcd_int_enable(uint8_t rhport)
-{
- (void)rhport;
-#if ( CFG_TUSB_MCU == OPT_MCU_RX72N )
- IEN(PERIB, INTB185) = 1;
-#else
- IEN(USB0, USBI0) = 1;
-#endif
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void)rhport;
-#if ( CFG_TUSB_MCU == OPT_MCU_RX72N )
- IEN(PERIB, INTB185) = 0;
-#else
- IEN(USB0, USBI0) = 0;
-#endif
-}
-
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- (void)rhport;
- (void)dev_addr;
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void)rhport;
- USB0.DVSTCTR0.BIT.WKUP = 1;
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void)rhport;
- USB0.SYSCFG.BIT.DPRPU = 1;
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void)rhport;
- USB0.SYSCFG.BIT.DPRPU = 0;
-}
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * ep_desc)
-{
- (void)rhport;
-
- const unsigned ep_addr = ep_desc->bEndpointAddress;
- const unsigned epn = tu_edpt_number(ep_addr);
- const unsigned dir = tu_edpt_dir(ep_addr);
- const unsigned xfer = ep_desc->bmAttributes.xfer;
-
- const unsigned mps = tu_le16toh(ep_desc->wMaxPacketSize.size);
- if (xfer == TUSB_XFER_ISOCHRONOUS && mps > 256) {
- /* USBa supports up to 256 bytes */
- return false;
- }
-
- const unsigned num = find_pipe(xfer);
- if (!num) return false;
- _dcd.pipe[num].ep = ep_addr;
- _dcd.ep[dir][epn] = num;
-
- /* setup pipe */
- dcd_int_disable(rhport);
- USB0.PIPESEL.WORD = num;
- USB0.PIPEMAXP.WORD = mps;
- volatile uint16_t *ctr = get_pipectr(num);
- *ctr = USB_PIPECTR_ACLRM;
- *ctr = 0;
- unsigned cfg = (dir << 4) | epn;
- if (xfer == TUSB_XFER_BULK) {
- cfg |= USB_PIPECFG_BULK | USB_PIPECFG_SHTNAK | USB_PIPECFG_DBLB;
- } else if (xfer == TUSB_XFER_INTERRUPT) {
- cfg |= USB_PIPECFG_INT;
- } else {
- cfg |= USB_PIPECFG_ISO | USB_PIPECFG_DBLB;
- }
- USB0.PIPECFG.WORD = cfg;
- USB0.BRDYSTS.WORD = 0x1FFu ^ TU_BIT(num);
- USB0.BRDYENB.WORD |= TU_BIT(num);
- if (dir || (xfer != TUSB_XFER_BULK)) {
- *ctr = USB_PIPECTR_PID_BUF;
- }
- // TU_LOG1("O %d %x %x\r\n", USB0.PIPESEL.WORD, USB0.PIPECFG.WORD, USB0.PIPEMAXP.WORD);
- dcd_int_enable(rhport);
-
- return true;
-}
-
-void dcd_edpt_close(uint8_t rhport, uint8_t ep_addr)
-{
- (void)rhport;
- const unsigned epn = tu_edpt_number(ep_addr);
- const unsigned dir = tu_edpt_dir(ep_addr);
- const unsigned num = _dcd.ep[dir][epn];
-
- USB0.BRDYENB.WORD &= ~TU_BIT(num);
- volatile uint16_t *ctr = get_pipectr(num);
- *ctr = 0;
- USB0.PIPESEL.WORD = num;
- USB0.PIPECFG.WORD = 0;
- _dcd.pipe[num].ep = 0;
- _dcd.ep[dir][epn] = 0;
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t* buffer, uint16_t total_bytes)
-{
- bool r;
- dcd_int_disable(rhport);
- r = process_edpt_xfer(0, ep_addr, buffer, total_bytes);
- dcd_int_enable(rhport);
- return r;
-}
-
-bool dcd_edpt_xfer_fifo(uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
-{
- // USB buffers always work in bytes so to avoid unnecessary divisions we demand item_size = 1
- TU_ASSERT(ff->item_size == 1);
- bool r;
- dcd_int_disable(rhport);
- r = process_edpt_xfer(1, ep_addr, ff, total_bytes);
- dcd_int_enable(rhport);
- return r;
-}
-
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- volatile uint16_t *ctr = ep_addr_to_pipectr(rhport, ep_addr);
- if (!ctr) return;
- dcd_int_disable(rhport);
- const uint32_t pid = *ctr & 0x3;
- *ctr = pid | USB_PIPECTR_PID_STALL;
- *ctr = USB_PIPECTR_PID_STALL;
- dcd_int_enable(rhport);
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- volatile uint16_t *ctr = ep_addr_to_pipectr(rhport, ep_addr);
- if (!ctr) return;
- dcd_int_disable(rhport);
- *ctr = USB_PIPECTR_SQCLR;
-
- if (tu_edpt_dir(ep_addr)) { /* IN */
- *ctr = USB_PIPECTR_PID_BUF;
- } else {
- const unsigned num = _dcd.ep[0][tu_edpt_number(ep_addr)];
- USB0.PIPESEL.WORD = num;
- if (USB0.PIPECFG.BIT.TYPE != 1) {
- *ctr = USB_PIPECTR_PID_BUF;
- }
- }
- dcd_int_enable(rhport);
-}
-
-//--------------------------------------------------------------------+
-// ISR
-//--------------------------------------------------------------------+
-void dcd_int_handler(uint8_t rhport)
-{
- (void)rhport;
-
- unsigned is0 = USB0.INTSTS0.WORD;
- /* clear active bits except VALID (don't write 0 to already cleared bits according to the HW manual) */
- USB0.INTSTS0.WORD = ~((USB_IS0_CTRT | USB_IS0_DVST | USB_IS0_SOFR | USB_IS0_RESM | USB_IS0_VBINT) & is0) | USB_IS0_VALID;
- if (is0 & USB_IS0_VBINT) {
- if (USB0.INTSTS0.BIT.VBSTS) {
- dcd_connect(rhport);
- } else {
- dcd_disconnect(rhport);
- }
- }
- if (is0 & USB_IS0_RESM) {
- dcd_event_bus_signal(rhport, DCD_EVENT_RESUME, true);
-#if (0==USE_SOF)
- USB0.INTENB0.BIT.SOFE = 0;
-#endif
- }
- if ((is0 & USB_IS0_SOFR) && USB0.INTENB0.BIT.SOFE) {
- // USBD will exit suspended mode when SOF event is received
- dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true);
-#if (0==USE_SOF)
- USB0.INTENB0.BIT.SOFE = 0;
-#endif
- }
- if (is0 & USB_IS0_DVST) {
- switch (is0 & USB_IS0_DVSQ) {
- case USB_IS0_DVSQ_DEF:
- process_bus_reset(rhport);
- break;
- case USB_IS0_DVSQ_ADDR:
- process_set_address(rhport);
- break;
- case USB_IS0_DVSQ_SUSP0:
- case USB_IS0_DVSQ_SUSP1:
- case USB_IS0_DVSQ_SUSP2:
- case USB_IS0_DVSQ_SUSP3:
- dcd_event_bus_signal(rhport, DCD_EVENT_SUSPEND, true);
-#if (0==USE_SOF)
- USB0.INTENB0.BIT.SOFE = 1;
-#endif
- default:
- break;
- }
- }
- if (is0 & USB_IS0_CTRT) {
- if (is0 & USB_IS0_CTSQ_SETUP) {
- /* A setup packet has been received. */
- process_setup_packet(rhport);
- } else if (0 == (is0 & USB_IS0_CTSQ_MSK)) {
- /* A ZLP has been sent/received. */
- process_status_completion(rhport);
- }
- }
- if (is0 & USB_IS0_BEMP) {
- const unsigned s = USB0.BEMPSTS.WORD;
- USB0.BEMPSTS.WORD = 0;
- if (s & 1) {
- process_pipe0_bemp(rhport);
- }
- }
- if (is0 & USB_IS0_BRDY) {
- const unsigned m = USB0.BRDYENB.WORD;
- unsigned s = USB0.BRDYSTS.WORD & m;
- /* clear active bits (don't write 0 to already cleared bits according to the HW manual) */
- USB0.BRDYSTS.WORD = ~s;
- while (s) {
-#if defined(__CCRX__)
- static const int Mod37BitPosition[] = {
- -1, 0, 1, 26, 2, 23, 27, 0, 3, 16, 24, 30, 28, 11, 0, 13, 4,
- 7, 17, 0, 25, 22, 31, 15, 29, 10, 12, 6, 0, 21, 14, 9, 5,
- 20, 8, 19, 18
- };
-
- const unsigned num = Mod37BitPosition[(-s & s) % 37];
-#else
- const unsigned num = __builtin_ctz(s);
-#endif
- process_pipe_brdy(rhport, num);
- s &= ~TU_BIT(num);
- }
- }
-}
-
-#endif
diff --git a/tinyusb/src/portable/silabs/efm32/dcd_efm32.c b/tinyusb/src/portable/silabs/efm32/dcd_efm32.c
deleted file mode 100755
index bd1f32e6..00000000
--- a/tinyusb/src/portable/silabs/efm32/dcd_efm32.c
+++ /dev/null
@@ -1,931 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2021 Rafael Silva (@perigoso)
- * Copyright (c) 2021 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && ( \
- (CFG_TUSB_MCU == OPT_MCU_EFM32GG) || \
- (CFG_TUSB_MCU == OPT_MCU_EFM32GG11) || \
- (CFG_TUSB_MCU == OPT_MCU_EFM32GG12) )
-
-/* Silabs */
-#include "em_device.h"
-
-#include "device/dcd.h"
-
-/*
- * Since TinyUSB doesn't use SOF for now, and this interrupt too often (1ms interval)
- * We disable SOF for now until needed later on
- */
-#define USE_SOF 0
-
-/*
- * Number of endpoints
- * 12 software-configurable endpoints (6 IN, 6 OUT) in addition to endpoint 0
- */
-#define EP_COUNT 7
-
-/* FIFO size in bytes */
-#define EP_FIFO_SIZE 2048
-
-/* Max number of IN EP FIFOs */
-#define EP_FIFO_NUM 7
-
-/* */
-typedef struct {
- uint8_t *buffer;
- uint16_t total_len;
- uint16_t queued_len;
- uint16_t max_size;
- bool short_packet;
-} xfer_ctl_t;
-
-static uint32_t _setup_packet[2];
-
-#define XFER_CTL_BASE(_ep, _dir) &xfer_status[_ep][_dir]
-static xfer_ctl_t xfer_status[EP_COUNT][2];
-
-/* Keep count of how many FIFOs are in use */
-static uint8_t _allocated_fifos = 1; /* FIFO0 is always in use */
-
-static volatile uint32_t* tx_fifo[EP_FIFO_NUM] = {
- USB->FIFO0D,
- USB->FIFO1D,
- USB->FIFO2D,
- USB->FIFO3D,
- USB->FIFO4D,
- USB->FIFO5D,
- USB->FIFO6D,
-};
-
-/* Register Helpers */
-#define DCTL_WO_BITMASK (USB_DCTL_CGOUTNAK | USB_DCTL_SGOUTNAK | USB_DCTL_CGNPINNAK | USB_DCTL_SGNPINNAK)
-#define GUSBCFG_WO_BITMASK (USB_GUSBCFG_CORRUPTTXPKT)
-#define DEPCTL_WO_BITMASK (USB_DIEP_CTL_CNAK | USB_DIEP_CTL_SNAK | USB_DIEP_CTL_SETD0PIDEF | USB_DIEP_CTL_SETD1PIDOF)
-
-/* Will either return an unused FIFO number, or 0 if all are used. */
-static uint8_t get_free_fifo(void)
-{
- if(_allocated_fifos < EP_FIFO_NUM) return _allocated_fifos++;
- return 0;
-}
-
-/*
-static void flush_rx_fifo(void)
-{
- USB->GRSTCTL = USB_GRSTCTL_RXFFLSH;
- while(USB->GRSTCTL & USB_GRSTCTL_RXFFLSH);
-}
-*/
-
-static void flush_tx_fifo(uint8_t fifo_num)
-{
- USB->GRSTCTL = USB_GRSTCTL_TXFFLSH | (fifo_num << _USB_GRSTCTL_TXFNUM_SHIFT);
- while(USB->GRSTCTL & USB_GRSTCTL_TXFFLSH);
-}
-
-/* Setup the control endpoint 0. */
-static void bus_reset(void)
-{
- USB->DOEP0CTL |= USB_DIEP_CTL_SNAK;
- for(uint8_t i = 0; i < EP_COUNT - 1; i++)
- {
- USB->DOEP[i].CTL |= USB_DIEP_CTL_SNAK;
- }
-
- /* reset address */
- USB->DCFG &= ~_USB_DCFG_DEVADDR_MASK;
-
- USB->DAINTMSK |= USB_DAINTMSK_OUTEPMSK0 | USB_DAINTMSK_INEPMSK0;
- USB->DOEPMSK |= USB_DOEPMSK_SETUPMSK | USB_DOEPMSK_XFERCOMPLMSK;
- USB->DIEPMSK |= USB_DIEPMSK_TIMEOUTMSK | USB_DIEPMSK_XFERCOMPLMSK;
-
- /*
- * - All EP OUT shared a unique OUT FIFO which uses
- * * 10 locations in hardware for setup packets + setup control words (up to 3 setup packets).
- * * 2 locations for OUT endpoint control words.
- * * 16 for largest packet size of 64 bytes. ( TODO Highspeed is 512 bytes)
- * * 1 location for global NAK (not required/used here).
- * * It is recommended to allocate 2 times the largest packet size, therefore
- * Recommended value = 10 + 1 + 2 x (16+2) = 47 --> Let's make it 52
- */
- flush_tx_fifo(_USB_GRSTCTL_TXFNUM_FALL); // Flush All
- USB->GRXFSIZ = 52;
-
- /* Control IN uses FIFO 0 with 64 bytes ( 16 32-bit word ) */
- USB->GNPTXFSIZ = (16 << _USB_GNPTXFSIZ_NPTXFINEPTXF0DEP_SHIFT) | (USB->GRXFSIZ & _USB_GNPTXFSIZ_NPTXFSTADDR_MASK);
-
- /* Ready to receive SETUP packet */
- USB->DOEP0TSIZ |= (1 << _USB_DOEP0TSIZ_SUPCNT_SHIFT);
-
- USB->GINTMSK |= USB_GINTMSK_IEPINTMSK | USB_GINTMSK_OEPINTMSK;
-}
-
-static void enum_done_processing(void)
-{
- /* Maximum packet size for EP 0 is set for both directions by writing DIEPCTL */
- if((USB->DSTS & _USB_DSTS_ENUMSPD_MASK) == USB_DSTS_ENUMSPD_FS)
- {
- /* Full Speed (PHY on 48 MHz) */
- USB->DOEP0CTL = (USB->DOEP0CTL & ~_USB_DOEP0CTL_MPS_MASK) | _USB_DOEP0CTL_MPS_64B; /* Maximum Packet Size 64 bytes */
- USB->DOEP0CTL &= ~_USB_DOEP0CTL_STALL_MASK; /* clear Stall */
- xfer_status[0][TUSB_DIR_OUT].max_size = 64;
- xfer_status[0][TUSB_DIR_IN].max_size = 64;
- }
- else
- {
- /* Low Speed (PHY on 6 MHz) */
- USB->DOEP0CTL = (USB->DOEP0CTL & ~_USB_DOEP0CTL_MPS_MASK) | _USB_DOEP0CTL_MPS_8B; /* Maximum Packet Size 64 bytes */
- USB->DOEP0CTL &= ~_USB_DOEP0CTL_STALL_MASK; /* clear Stall */
- xfer_status[0][TUSB_DIR_OUT].max_size = 8;
- xfer_status[0][TUSB_DIR_IN].max_size = 8;
- }
-}
-
-
-/*------------------------------------------------------------------*/
-/* Controller API */
-/*------------------------------------------------------------------*/
-void dcd_init(uint8_t rhport)
-{
- (void) rhport;
-
- /* Reset Core */
- USB->PCGCCTL &= ~USB_PCGCCTL_STOPPCLK;
- USB->PCGCCTL &= ~(USB_PCGCCTL_PWRCLMP | USB_PCGCCTL_RSTPDWNMODULE);
-
- /* Core Soft Reset */
- USB->GRSTCTL |= USB_GRSTCTL_CSFTRST;
- while(USB->GRSTCTL & USB_GRSTCTL_CSFTRST);
-
- while(!(USB->GRSTCTL & USB_GRSTCTL_AHBIDLE));
-
- /* Enable PHY pins */
- USB->ROUTE = USB_ROUTE_PHYPEN;
-
- dcd_disconnect(rhport);
-
- /*
- * Set device speed (Full speed PHY)
- * Stall on non-zero len status OUT packets (ctrl transfers)
- * periodic frame interval to 80%
- */
- USB->DCFG = (USB->DCFG & ~(_USB_DCFG_DEVSPD_MASK | _USB_DCFG_PERFRINT_MASK)) | USB_DCFG_DEVSPD_FS | USB_DCFG_NZSTSOUTHSHK;
-
- /* Enable Global Interrupts */
- USB->GAHBCFG = (USB->GAHBCFG & ~_USB_GAHBCFG_HBSTLEN_MASK) | USB_GAHBCFG_GLBLINTRMSK;
-
- /* Force Device Mode */
- USB->GUSBCFG = (USB->GUSBCFG & ~(GUSBCFG_WO_BITMASK | USB_GUSBCFG_FORCEHSTMODE)) | USB_GUSBCFG_FORCEDEVMODE;
-
- /* No Overrides */
- USB->GOTGCTL &= ~(USB_GOTGCTL_BVALIDOVVAL | USB_GOTGCTL_BVALIDOVEN | USB_GOTGCTL_VBVALIDOVVAL);
-
- /* Ignore frame numbers on ISO transfers. */
- USB->DCTL = (USB->DCTL & ~DCTL_WO_BITMASK) | USB_DCTL_IGNRFRMNUM;
-
- /* Setting SNAKs */
- USB->DOEP0CTL |= USB_DIEP_CTL_SNAK;
- for(uint8_t i = 0; i < EP_COUNT - 1; i++)
- {
- USB->DOEP[i].CTL |= USB_DIEP_CTL_SNAK;
- }
-
- /* D. Interruption masking */
- /* Disable all device interrupts */
- USB->DIEPMSK = 0;
- USB->DOEPMSK = 0;
- USB->DAINTMSK = 0;
- USB->DIEPEMPMSK = 0;
- USB->GINTMSK = 0;
- USB->GOTGINT = ~0U; /* clear OTG ints */
- USB->GINTSTS = ~0U; /* clear pending ints */
- USB->GINTMSK = USB_GINTMSK_MODEMISMSK |
- #if USE_SOF
- USB_GINTMSK_SOFMSK |
- #endif
- USB_GINTMSK_ERLYSUSPMSK |
- USB_GINTMSK_USBSUSPMSK |
- USB_GINTMSK_USBRSTMSK |
- USB_GINTMSK_ENUMDONEMSK |
- USB_GINTMSK_RESETDETMSK |
- USB_GINTMSK_DISCONNINTMSK;
-
- NVIC_ClearPendingIRQ(USB_IRQn);
-
- dcd_connect(rhport);
-}
-
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
-
- USB->DCFG = (USB->DCFG & ~_USB_DCFG_DEVADDR_MASK) | (dev_addr << _USB_DCFG_DEVADDR_SHIFT);
-
- /* Response with status after changing device address */
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
-
- /* connect by enabling internal pull-up resistor on D+/D- */
- USB->DCTL &= ~(DCTL_WO_BITMASK | USB_DCTL_SFTDISCON);
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
-
- /* disconnect by disabling internal pull-up resistor on D+/D- */
- USB->DCTL = (USB->DCTL & ~(DCTL_WO_BITMASK)) | USB_DCTL_SFTDISCON;
-}
-
-/*------------------------------------------------------------------*/
-/* DCD Endpoint Port */
-/*------------------------------------------------------------------*/
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- if(dir == TUSB_DIR_IN)
- {
- if(epnum == 0)
- {
- USB->DIEP0CTL = (USB->DIEP0CTL & ~DEPCTL_WO_BITMASK) | USB_DIEP0CTL_SNAK | USB_DIEP0CTL_STALL;
-
- flush_tx_fifo(_USB_GRSTCTL_TXFNUM_F0);
- }
- else
- {
- /* Only disable currently enabled non-control endpoint */
- if(USB->DIEP[epnum - 1].CTL & USB_DIEP_CTL_EPENA)
- {
- USB->DIEP[epnum - 1].CTL = (USB->DIEP[epnum - 1].CTL & ~DEPCTL_WO_BITMASK) | USB_DIEP_CTL_EPDIS | USB_DIEP_CTL_SNAK | USB_DIEP_CTL_STALL;
- while(!(USB->DIEP[epnum - 1].INT & USB_DIEP_INT_EPDISBLD));
- USB->DIEP[epnum - 1].INT |= USB_DIEP_INT_EPDISBLD;
- }
- else
- {
- USB->DIEP[epnum - 1].CTL = (USB->DIEP[epnum - 1].CTL & ~DEPCTL_WO_BITMASK) | USB_DIEP_CTL_SNAK | USB_DIEP_CTL_STALL;
- }
-
- /* Flush the FIFO */
- uint8_t const fifo_num = ((USB->DIEP[epnum - 1].CTL & _USB_DIEP_CTL_TXFNUM_MASK) >> _USB_DIEP_CTL_TXFNUM_SHIFT);
- flush_tx_fifo(fifo_num);
- }
- }
- else
- {
- if(epnum == 0)
- {
- USB->DOEP0CTL = (USB->DOEP0CTL & ~DEPCTL_WO_BITMASK) | USB_DIEP0CTL_STALL;
- }
- else
- {
- /* Only disable currently enabled non-control endpoint */
- if(USB->DOEP[epnum - 1].CTL & USB_DIEP_CTL_EPENA)
- {
- /* Asserting GONAK is required to STALL an OUT endpoint. */
- USB->DCTL |= USB_DCTL_SGOUTNAK;
- while(!(USB->GINTSTS & USB_GINTSTS_GOUTNAKEFF));
-
- /* Disable the endpoint. Note that only STALL and not SNAK is set here. */
- USB->DOEP[epnum - 1].CTL = (USB->DOEP[epnum - 1].CTL & ~DEPCTL_WO_BITMASK) | USB_DIEP_CTL_EPDIS | USB_DIEP_CTL_STALL;
- while(USB->DOEP[epnum - 1].INT & USB_DIEP_INT_EPDISBLD);
- USB->DOEP[epnum - 1].INT |= USB_DIEP_INT_EPDISBLD;
-
- /* Allow other OUT endpoints to keep receiving. */
- USB->DCTL |= USB_DCTL_CGOUTNAK;
- }
- else
- {
- USB->DIEP[epnum - 1].CTL = (USB->DIEP[epnum - 1].CTL & ~DEPCTL_WO_BITMASK) | USB_DIEP_CTL_STALL;
- }
- }
- }
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- if(dir == TUSB_DIR_IN)
- {
- if(epnum == 0)
- {
- USB->DIEP0CTL &= ~(DEPCTL_WO_BITMASK | USB_DIEP0CTL_STALL);
- }
- else
- {
- USB->DIEP[epnum - 1].CTL &= ~(DEPCTL_WO_BITMASK | USB_DIEP_CTL_STALL);
-
- /* Required by USB spec to reset DATA toggle bit to DATA0 on interrupt and bulk endpoints. */
- uint8_t eptype = (USB->DIEP[epnum - 1].CTL & _USB_DIEP_CTL_EPTYPE_MASK) >> _USB_DIEP_CTL_EPTYPE_SHIFT;
-
- if((eptype == _USB_DIEP_CTL_EPTYPE_BULK) || (eptype == _USB_DIEP_CTL_EPTYPE_INT))
- {
- USB->DIEP[epnum - 1].CTL |= USB_DIEP_CTL_SETD0PIDEF;
- }
- }
- }
- else
- {
- if(epnum == 0)
- {
- USB->DOEP0CTL &= ~(DEPCTL_WO_BITMASK | USB_DOEP0CTL_STALL);
- }
- else
- {
- USB->DOEP[epnum - 1].CTL &= ~(DEPCTL_WO_BITMASK | USB_DOEP_CTL_STALL);
-
- /* Required by USB spec to reset DATA toggle bit to DATA0 on interrupt and bulk endpoints. */
- uint8_t eptype = (USB->DOEP[epnum - 1].CTL & _USB_DOEP_CTL_EPTYPE_MASK) >> _USB_DOEP_CTL_EPTYPE_SHIFT;
-
- if((eptype == _USB_DOEP_CTL_EPTYPE_BULK) || (eptype == _USB_DOEP_CTL_EPTYPE_INT))
- {
- USB->DOEP[epnum - 1].CTL |= USB_DOEP_CTL_SETD0PIDEF;
- }
- }
- }
-}
-
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
-{
- (void)rhport;
-
- uint8_t const epnum = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
- uint8_t const dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress);
-
- TU_ASSERT(p_endpoint_desc->wMaxPacketSize.size <= 64);
- TU_ASSERT(epnum < EP_COUNT);
- TU_ASSERT(epnum != 0);
-
- xfer_ctl_t *xfer = XFER_CTL_BASE(epnum, dir);
- xfer->max_size = p_endpoint_desc->wMaxPacketSize.size;
-
- if(dir == TUSB_DIR_OUT)
- {
- USB->DOEP[epnum - 1].CTL |= USB_DOEP_CTL_USBACTEP |
- (p_endpoint_desc->bmAttributes.xfer << _USB_DOEP_CTL_EPTYPE_SHIFT) |
- (p_endpoint_desc->wMaxPacketSize.size << _USB_DOEP_CTL_MPS_SHIFT);
- USB->DAINTMSK |= (1 << (_USB_DAINTMSK_OUTEPMSK0_SHIFT + epnum));
- }
- else
- {
- uint8_t fifo_num = get_free_fifo();
- TU_ASSERT(fifo_num != 0);
-
- USB->DIEP[epnum - 1].CTL &= ~(_USB_DIEP_CTL_TXFNUM_MASK | _USB_DIEP_CTL_EPTYPE_MASK | USB_DIEP_CTL_SETD0PIDEF | _USB_DIEP_CTL_MPS_MASK);
- USB->DIEP[epnum - 1].CTL |= USB_DIEP_CTL_USBACTEP |
- (fifo_num << _USB_DIEP_CTL_TXFNUM_SHIFT) |
- (p_endpoint_desc->bmAttributes.xfer << _USB_DIEP_CTL_EPTYPE_SHIFT) |
- ((p_endpoint_desc->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS) ? USB_DIEP_CTL_SETD0PIDEF : 0) |
- (p_endpoint_desc->wMaxPacketSize.size << 0);
-
- USB->DAINTMSK |= (1 << epnum);
-
- /* Both TXFD and TXSA are in unit of 32-bit words. */
- /* IN FIFO 0 was configured during enumeration, hence the "+ 16". */
- uint16_t const allocated_size = (USB->GRXFSIZ & _USB_GRXFSIZ_RXFDEP_MASK) + 16;
- uint16_t const fifo_size = (EP_FIFO_SIZE/4 - allocated_size) / (EP_FIFO_NUM-1);
- uint32_t const fifo_offset = allocated_size + fifo_size*(fifo_num-1);
-
- /* DIEPTXF starts at FIFO #1. */
- volatile uint32_t* usb_dieptxf = &USB->DIEPTXF1;
- usb_dieptxf[epnum - 1] = (fifo_size << _USB_DIEPTXF1_INEPNTXFDEP_SHIFT) | fifo_offset;
- }
- return true;
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t* buffer, uint16_t total_bytes)
-{
- (void)rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
- xfer->buffer = buffer;
- xfer->total_len = total_bytes;
- xfer->queued_len = 0;
- xfer->short_packet = false;
-
- uint16_t num_packets = (total_bytes / xfer->max_size);
- uint8_t short_packet_size = total_bytes % xfer->max_size;
-
- // Zero-size packet is special case.
- if(short_packet_size > 0 || (total_bytes == 0))
- {
- num_packets++;
- }
-
- // IN and OUT endpoint xfers are interrupt-driven, we just schedule them
- // here.
- if(dir == TUSB_DIR_IN)
- {
- if(epnum == 0)
- {
- // A full IN transfer (multiple packets, possibly) triggers XFRC.
- USB->DIEP0TSIZ = (num_packets << _USB_DIEP0TSIZ_PKTCNT_SHIFT) | total_bytes;
- USB->DIEP0CTL |= USB_DIEP0CTL_EPENA | USB_DIEP0CTL_CNAK; // Enable | CNAK
- }
- else
- {
- // A full IN transfer (multiple packets, possibly) triggers XFRC.
- USB->DIEP[epnum - 1].TSIZ = (num_packets << _USB_DIEP_TSIZ_PKTCNT_SHIFT) | total_bytes;
- USB->DIEP[epnum - 1].CTL |= USB_DIEP_CTL_EPENA | USB_DIEP_CTL_CNAK; // Enable | CNAK
- }
-
- // Enable fifo empty interrupt only if there are something to put in the fifo.
- if(total_bytes != 0)
- {
- USB->DIEPEMPMSK |= (1 << epnum);
- }
- }
- else
- {
- if(epnum == 0)
- {
- // A full IN transfer (multiple packets, possibly) triggers XFRC.
- USB->DOEP0TSIZ |= (1 << _USB_DOEP0TSIZ_PKTCNT_SHIFT) | ((xfer->max_size & _USB_DOEP0TSIZ_XFERSIZE_MASK) << _USB_DOEP0TSIZ_XFERSIZE_SHIFT);
- USB->DOEP0CTL |= USB_DOEP0CTL_EPENA | USB_DOEP0CTL_CNAK;
- }
- else
- {
- // A full IN transfer (multiple packets, possibly) triggers XFRC.
- USB->DOEP[epnum - 1].TSIZ |= (1 << _USB_DOEP_TSIZ_PKTCNT_SHIFT) | ((xfer->max_size & _USB_DOEP_TSIZ_XFERSIZE_MASK) << _USB_DOEP_TSIZ_XFERSIZE_SHIFT);
- USB->DOEP[epnum - 1].CTL |= USB_DOEP_CTL_EPENA | USB_DOEP_CTL_CNAK;
- }
- }
- return true;
-}
-
-/*------------------------------------------------------------------*/
-/* IRQ */
-/*------------------------------------------------------------------*/
-void dcd_int_enable(uint8_t rhport)
-{
- (void) rhport;
-
- NVIC_EnableIRQ(USB_IRQn);
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
-
- NVIC_DisableIRQ(USB_IRQn);
-}
-
-static void receive_packet(xfer_ctl_t *xfer, uint16_t xfer_size)
-{
- uint16_t remaining = xfer->total_len - xfer->queued_len;
- uint16_t to_recv_size;
-
- if(remaining <= xfer->max_size)
- {
- /* Avoid buffer overflow. */
- to_recv_size = (xfer_size > remaining) ? remaining : xfer_size;
- }
- else
- {
- /* Room for full packet, choose recv_size based on what the microcontroller claims. */
- to_recv_size = (xfer_size > xfer->max_size) ? xfer->max_size : xfer_size;
- }
-
- uint8_t to_recv_rem = to_recv_size % 4;
- uint16_t to_recv_size_aligned = to_recv_size - to_recv_rem;
-
- /* Do not assume xfer buffer is aligned. */
- uint8_t *base = (xfer->buffer + xfer->queued_len);
-
- /* This for loop always runs at least once- skip if less than 4 bytes to collect. */
- if(to_recv_size >= 4)
- {
- for(uint16_t i = 0; i < to_recv_size_aligned; i += 4)
- {
- uint32_t tmp = (*USB->FIFO0D);
- base[i] = tmp & 0x000000FF;
- base[i + 1] = (tmp & 0x0000FF00) >> 8;
- base[i + 2] = (tmp & 0x00FF0000) >> 16;
- base[i + 3] = (tmp & 0xFF000000) >> 24;
- }
- }
-
- /* Do not read invalid bytes from RX FIFO. */
- if(to_recv_rem != 0)
- {
- uint32_t tmp = (*USB->FIFO0D);
- uint8_t *last_32b_bound = base + to_recv_size_aligned;
-
- last_32b_bound[0] = tmp & 0x000000FF;
- if(to_recv_rem > 1)
- {
- last_32b_bound[1] = (tmp & 0x0000FF00) >> 8;
- }
- if(to_recv_rem > 2)
- {
- last_32b_bound[2] = (tmp & 0x00FF0000) >> 16;
- }
- }
-
- xfer->queued_len += xfer_size;
-
- /* Per USB spec, a short OUT packet (including length 0) is always */
- /* indicative of the end of a transfer (at least for ctl, bulk, int). */
- xfer->short_packet = (xfer_size < xfer->max_size);
-}
-
-static void transmit_packet(xfer_ctl_t *xfer, uint8_t fifo_num)
-{
- uint16_t remaining;
- if(fifo_num == 0)
- {
- remaining = (USB->DIEP0TSIZ & 0x7FFFFU) >> _USB_DIEP0TSIZ_XFERSIZE_SHIFT;
- }
- else
- {
- remaining = (USB->DIEP[fifo_num - 1].TSIZ & 0x7FFFFU) >> _USB_DIEP_TSIZ_XFERSIZE_SHIFT;
- }
- xfer->queued_len = xfer->total_len - remaining;
-
- uint16_t to_xfer_size = (remaining > xfer->max_size) ? xfer->max_size : remaining;
- uint8_t to_xfer_rem = to_xfer_size % 4;
- uint16_t to_xfer_size_aligned = to_xfer_size - to_xfer_rem;
-
- /* Buffer might not be aligned to 32b, so we need to force alignment by copying to a temp var. */
- uint8_t *base = (xfer->buffer + xfer->queued_len);
-
- /* This for loop always runs at least once- skip if less than 4 bytes to send off. */
- if(to_xfer_size >= 4)
- {
- for(uint16_t i = 0; i < to_xfer_size_aligned; i += 4)
- {
- uint32_t tmp = base[i] | (base[i + 1] << 8) | (base[i + 2] << 16) | (base[i + 3] << 24);
- *tx_fifo[fifo_num] = tmp;
- }
- }
-
- /* Do not read beyond end of buffer if not divisible by 4. */
- if(to_xfer_rem != 0)
- {
- uint32_t tmp = 0;
- uint8_t *last_32b_bound = base + to_xfer_size_aligned;
-
- tmp |= last_32b_bound[0];
- if(to_xfer_rem > 1)
- {
- tmp |= (last_32b_bound[1] << 8);
- }
- if(to_xfer_rem > 2)
- {
- tmp |= (last_32b_bound[2] << 16);
- }
-
- *tx_fifo[fifo_num] = tmp;
- }
-}
-
-static void read_rx_fifo(void)
-{
- /*
- * Pop control word off FIFO (completed xfers will have 2 control words,
- * we only pop one ctl word each interrupt).
- */
- uint32_t const ctl_word = USB->GRXSTSP;
- uint8_t const pktsts = (ctl_word & _USB_GRXSTSP_PKTSTS_MASK) >> _USB_GRXSTSP_PKTSTS_SHIFT;
- uint8_t const epnum = (ctl_word & _USB_GRXSTSP_CHNUM_MASK ) >> _USB_GRXSTSP_CHNUM_SHIFT;
- uint16_t const bcnt = (ctl_word & _USB_GRXSTSP_BCNT_MASK ) >> _USB_GRXSTSP_BCNT_SHIFT;
-
- switch(pktsts)
- {
- case 0x01: /* Global OUT NAK (Interrupt) */
- break;
-
- case 0x02:
- {
- /* Out packet recvd */
- xfer_ctl_t *xfer = XFER_CTL_BASE(epnum, TUSB_DIR_OUT);
- receive_packet(xfer, bcnt);
- }
- break;
-
- case 0x03:
- /* Out packet done (Interrupt) */
- break;
-
- case 0x04:
- /* Step 2: Setup transaction completed (Interrupt) */
- /* After this event, OEPINT interrupt will occur with SETUP bit set */
- if(epnum == 0)
- {
- USB->DOEP0TSIZ |= (1 << _USB_DOEP0TSIZ_SUPCNT_SHIFT);
- }
-
- break;
-
- case 0x06:
- {
- /* Step1: Setup data packet received */
-
- /*
- * We can receive up to three setup packets in succession, but
- * only the last one is valid. Therefore we just overwrite it
- */
- _setup_packet[0] = (*USB->FIFO0D);
- _setup_packet[1] = (*USB->FIFO0D);
- }
- break;
-
- default:
- /* Invalid, breakpoint. */
- TU_BREAKPOINT();
- break;
- }
-}
-
-static void handle_epout_ints(void)
-{
- // GINTSTS will be cleared with DAINT == 0
- // DAINT for a given EP clears when DOEPINTx is cleared.
- // DOEPINT will be cleared when DAINT's out bits are cleared.
-
- for(uint8_t n = 0; n < EP_COUNT; n++)
- {
- xfer_ctl_t *xfer = XFER_CTL_BASE(n, TUSB_DIR_OUT);
-
- if(n == 0)
- {
- if(USB->DAINT & (1 << (_USB_DAINT_OUTEPINT0_SHIFT + n)))
- {
- // SETUP packet Setup Phase done.
- if((USB->DOEP0INT & USB_DOEP0INT_SETUP))
- {
- USB->DOEP0INT = USB_DOEP0INT_STUPPKTRCVD | USB_DOEP0INT_SETUP; // clear
- dcd_event_setup_received(0, (uint8_t *)&_setup_packet[0], true);
- }
-
- // OUT XFER complete (single packet).q
- if(USB->DOEP0INT & USB_DOEP0INT_XFERCOMPL)
- {
- USB->DOEP0INT = USB_DOEP0INT_XFERCOMPL;
-
- // Transfer complete if short packet or total len is transferred
- if(xfer->short_packet || (xfer->queued_len == xfer->total_len))
- {
- xfer->short_packet = false;
- dcd_event_xfer_complete(0, n, xfer->queued_len, XFER_RESULT_SUCCESS, true);
- }
- else
- {
- // Schedule another packet to be received.
- USB->DOEP0TSIZ |= (1 << _USB_DOEP0TSIZ_PKTCNT_SHIFT) | ((xfer->max_size & _USB_DOEP0TSIZ_XFERSIZE_MASK) << _USB_DOEP0TSIZ_XFERSIZE_SHIFT);
- USB->DOEP0CTL |= USB_DOEP0CTL_EPENA | USB_DOEP0CTL_CNAK;
- }
- }
- }
- }
- else
- {
- if(USB->DAINT & (1 << (_USB_DAINT_OUTEPINT0_SHIFT + n)))
- {
- // SETUP packet Setup Phase done.
- if((USB->DOEP[n - 1].INT & USB_DOEP_INT_SETUP))
- {
- USB->DOEP[n - 1].INT = USB_DOEP_INT_STUPPKTRCVD | USB_DOEP_INT_SETUP; // clear
- dcd_event_setup_received(0, (uint8_t *)&_setup_packet[0], true);
- }
-
- // OUT XFER complete (single packet).q
- if(USB->DOEP[n - 1].INT & USB_DOEP_INT_XFERCOMPL)
- {
- USB->DOEP[n - 1].INT = USB_DOEP_INT_XFERCOMPL;
-
- // Transfer complete if short packet or total len is transferred
- if(xfer->short_packet || (xfer->queued_len == xfer->total_len))
- {
- xfer->short_packet = false;
- dcd_event_xfer_complete(0, n, xfer->queued_len, XFER_RESULT_SUCCESS, true);
- }
- else
- {
- // Schedule another packet to be received.
- USB->DOEP[n - 1].TSIZ |= (1 << _USB_DOEP_TSIZ_PKTCNT_SHIFT) | ((xfer->max_size & _USB_DOEP_TSIZ_XFERSIZE_MASK) << _USB_DOEP_TSIZ_XFERSIZE_SHIFT);
- USB->DOEP[n - 1].CTL |= USB_DOEP_CTL_EPENA | USB_DOEP_CTL_CNAK;
- }
- }
- }
- }
- }
-}
-
-static void handle_epin_ints(void)
-{
-
- for(uint32_t n = 0; n < EP_COUNT; n++)
- {
- xfer_ctl_t *xfer = &xfer_status[n][TUSB_DIR_IN];
-
- if(n == 0)
- {
- if(USB->DAINT & (1 << n))
- {
- /* IN XFER complete (entire xfer). */
- if(USB->DIEP0INT & USB_DIEP0INT_XFERCOMPL)
- {
- USB->DIEP0INT = USB_DIEP0INT_XFERCOMPL;
- dcd_event_xfer_complete(0, n | TUSB_DIR_IN_MASK, xfer->total_len, XFER_RESULT_SUCCESS, true);
- }
-
- /* XFER FIFO empty */
- if(USB->DIEP0INT & USB_DIEP0INT_TXFEMP)
- {
- USB->DIEP0INT = USB_DIEP0INT_TXFEMP;
- transmit_packet(xfer, n);
-
- /* Turn off TXFE if all bytes are written. */
- if(xfer->queued_len == xfer->total_len)
- {
- USB->DIEPEMPMSK &= ~(1 << n);
- }
- }
-
- /* XFER Timeout */
- if(USB->DIEP0INT & USB_DIEP0INT_TIMEOUT)
- {
- /* Clear interrupt or enpoint will hang. */
- USB->DIEP0INT = USB_DIEP0INT_TIMEOUT;
- }
- }
- }
- else
- {
- if(USB->DAINT & (1 << n))
- {
- /* IN XFER complete (entire xfer). */
- if(USB->DIEP[n - 1].INT & USB_DIEP_INT_XFERCOMPL)
- {
- USB->DIEP[n - 1].INT = USB_DIEP_INT_XFERCOMPL;
- dcd_event_xfer_complete(0, n | TUSB_DIR_IN_MASK, xfer->total_len, XFER_RESULT_SUCCESS, true);
- }
-
- /* XFER FIFO empty */
- if(USB->DIEP[n - 1].INT & USB_DIEP_INT_TXFEMP)
- {
- USB->DIEP[n - 1].INT = USB_DIEP_INT_TXFEMP;
- transmit_packet(xfer, n);
-
- /* Turn off TXFE if all bytes are written. */
- if(xfer->queued_len == xfer->total_len)
- {
- USB->DIEPEMPMSK &= ~(1 << n);
- }
- }
-
- /* XFER Timeout */
- if(USB->DIEP[n - 1].INT & USB_DIEP_INT_TIMEOUT)
- {
- /* Clear interrupt or enpoint will hang. */
- USB->DIEP[n - 1].INT = USB_DIEP_INT_TIMEOUT;
- }
- }
- }
- }
-}
-
-void dcd_int_handler(uint8_t rhport)
-{
- (void) rhport;
-
- const uint32_t int_status = USB->GINTSTS;
-
- /* USB Reset */
- if(int_status & USB_GINTSTS_USBRST)
- {
- /* start of reset */
- USB->GINTSTS = USB_GINTSTS_USBRST;
- /* FIFOs will be reassigned when the endpoints are reopen */
- _allocated_fifos = 1;
- bus_reset();
- }
-
- /* Reset detected Interrupt */
- if(int_status & USB_GINTSTS_RESETDET)
- {
- USB->GINTSTS = USB_GINTSTS_RESETDET;
- bus_reset();
- }
-
- /* Enumeration Done */
- if(int_status & USB_GINTSTS_ENUMDONE)
- {
- /* This interrupt is considered the end of reset. */
- USB->GINTSTS = USB_GINTSTS_ENUMDONE;
- enum_done_processing();
- dcd_event_bus_signal(0, DCD_EVENT_BUS_RESET, true);
- }
-
- /* OTG Interrupt */
- if(int_status & USB_GINTSTS_OTGINT)
- {
- /* OTG INT bit is read-only */
-
- uint32_t const otg_int = USB->GOTGINT;
-
- if(otg_int & USB_GOTGINT_SESENDDET)
- {
- dcd_event_bus_signal(0, DCD_EVENT_UNPLUGGED, true);
- }
-
- USB->GOTGINT = otg_int;
- }
-
- #if USE_SOF
- if(int_status & USB_GINTSTS_SOF)
- {
- USB->GINTSTS = USB_GINTSTS_SOF;
- dcd_event_bus_signal(0, DCD_EVENT_SOF, true);
- }
- #endif
-
- /* RxFIFO Non-Empty */
- if(int_status & USB_GINTSTS_RXFLVL)
- {
- /* RXFLVL bit is read-only */
-
- /* Mask out RXFLVL while reading data from FIFO */
- USB->GINTMSK &= ~USB_GINTMSK_RXFLVLMSK;
- read_rx_fifo();
- USB->GINTMSK |= USB_GINTMSK_RXFLVLMSK;
- }
-
- /* OUT Endpoints Interrupt */
- if(int_status & USB_GINTMSK_OEPINTMSK)
- {
- /* OEPINT is read-only */
- handle_epout_ints();
- }
-
- /* IN Endpoints Interrupt */
- if(int_status & USB_GINTMSK_IEPINTMSK)
- {
- /* IEPINT bit read-only */
- handle_epin_ints();
- }
-
- /* unhandled */
- USB->GINTSTS |= USB_GINTSTS_CURMOD |
- USB_GINTSTS_MODEMIS |
- USB_GINTSTS_OTGINT |
- USB_GINTSTS_NPTXFEMP |
- USB_GINTSTS_GINNAKEFF |
- USB_GINTSTS_GOUTNAKEFF |
- USB_GINTSTS_ERLYSUSP |
- USB_GINTSTS_USBSUSP |
- USB_GINTSTS_ISOOUTDROP |
- USB_GINTSTS_EOPF |
- USB_GINTSTS_EPMIS |
- USB_GINTSTS_INCOMPISOIN |
- USB_GINTSTS_INCOMPLP |
- USB_GINTSTS_FETSUSP |
- USB_GINTSTS_PTXFEMP;
-}
-
-#endif
diff --git a/tinyusb/src/portable/sony/cxd56/dcd_cxd56.c b/tinyusb/src/portable/sony/cxd56/dcd_cxd56.c
deleted file mode 100755
index 83497646..00000000
--- a/tinyusb/src/portable/sony/cxd56/dcd_cxd56.c
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright 2019 Sony Semiconductor Solutions Corporation
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_CXD56
-
-#include <errno.h>
-#include <nuttx/usb/usbdev.h>
-#include <nuttx/arch.h>
-
-#include "device/dcd.h"
-
-#define CXD56_EPNUM (7)
-#define CXD56_SETUP_QUEUE_DEPTH (4)
-#define CXD56_MAX_DATA_OUT_SIZE (64)
-
-OSAL_QUEUE_DEF(OPT_MODE_DEVICE, _setup_queue_def, CXD56_SETUP_QUEUE_DEPTH, struct usb_ctrlreq_s);
-
-struct usbdcd_driver_s
-{
- struct usbdevclass_driver_s usbdevclass_driver;
- FAR struct usbdev_ep_s *ep[CXD56_EPNUM];
- FAR struct usbdev_req_s *req[CXD56_EPNUM];
- osal_queue_t setup_queue;
- bool setup_processed;
- FAR uint8_t dataout[CXD56_MAX_DATA_OUT_SIZE];
- size_t outlen;
-};
-
-static struct usbdcd_driver_s usbdcd_driver;
-static struct usbdev_s *usbdev;
-
-static int _dcd_bind (FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev);
-static void _dcd_unbind (FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev);
-static int _dcd_setup (FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev,
- FAR const struct usb_ctrlreq_s *ctrl, FAR uint8_t *dataout, size_t outlen);
-static void _dcd_disconnect (FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev);
-static void _dcd_suspend (FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev);
-static void _dcd_resume (FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev);
-
-static const struct usbdevclass_driverops_s g_driverops =
-{
- _dcd_bind, /* bind */
- _dcd_unbind, /* unbind */
- _dcd_setup, /* setup */
- _dcd_disconnect, /* disconnect */
- _dcd_suspend, /* suspend */
- _dcd_resume, /* resume */
-};
-
-static void usbdcd_ep0incomplete(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *req)
-{
- (void) ep;
-
- uint8_t ep_addr = (uint32_t)req->priv;
-
- if (req->result || req->xfrd != req->len)
- {
- if (req->len)
- {
- dcd_event_xfer_complete(0, ep_addr, req->xfrd, XFER_RESULT_SUCCESS, true);
- }
- }
- else
- {
- if (req->xfrd)
- {
- dcd_event_xfer_complete(0, ep_addr, req->xfrd, XFER_RESULT_SUCCESS, true);
- }
- }
-}
-
-static int _dcd_bind(FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev)
-{
- (void) driver;
-
- usbdev = dev;
- usbdcd_driver.ep[0] = dev->ep0;
-
- usbdcd_driver.req[0] = EP_ALLOCREQ(usbdcd_driver.ep[0]);
- if (usbdcd_driver.req[0] != NULL)
- {
- usbdcd_driver.req[0]->len = 64;
- usbdcd_driver.req[0]->buf = EP_ALLOCBUFFER(usbdcd_driver.ep[0], 64);
- if (!usbdcd_driver.req[0]->buf)
- {
- EP_FREEREQ(usbdcd_driver.ep[0], usbdcd_driver.req[0]);
- usbdcd_driver.req[0] = NULL;
- }
- }
-
- usbdcd_driver.req[0]->callback = usbdcd_ep0incomplete;
-
- DEV_CONNECT(dev);
- return 0;
-}
-
-static void _dcd_unbind(FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev)
-{
- (void) driver;
- (void) dev;
-}
-
-static int _dcd_setup(FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev,
- FAR const struct usb_ctrlreq_s *ctrl, FAR uint8_t *dataout, size_t outlen)
-{
- (void) driver;
- (void) dev;
-
- if (usbdcd_driver.setup_processed)
- {
- usbdcd_driver.setup_processed = false;
- dcd_event_setup_received(0, (uint8_t *) ctrl, true);
- }
- else
- {
- osal_queue_send(usbdcd_driver.setup_queue, ctrl, true);
- }
-
- if (outlen > 0 && outlen <= CXD56_MAX_DATA_OUT_SIZE)
- {
- memcpy(usbdcd_driver.dataout, dataout, outlen);
- usbdcd_driver.outlen = outlen;
- }
-
- return 0;
-}
-
-static void _dcd_disconnect(FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev)
-{
- (void) driver;
-
- tusb_speed_t speed;
-
- switch (dev->speed)
- {
- case USB_SPEED_LOW:
- speed = TUSB_SPEED_LOW;
- break;
- case USB_SPEED_FULL:
- speed = TUSB_SPEED_FULL;
- break;
- case USB_SPEED_HIGH:
- speed = TUSB_SPEED_HIGH;
- break;
- default:
- speed = TUSB_SPEED_HIGH;
- break;
- }
-
- dcd_event_bus_reset(0, speed, true);
- DEV_CONNECT(dev);
-}
-
-static void _dcd_suspend(FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev)
-{
- (void) driver;
- (void) dev;
-
- dcd_event_bus_signal(0, DCD_EVENT_SUSPEND, true);
-}
-
-static void _dcd_resume(FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev)
-{
- (void) driver;
- (void) dev;
-
- dcd_event_bus_signal(0, DCD_EVENT_RESUME, true);
-}
-
-void dcd_init(uint8_t rhport)
-{
- (void) rhport;
-
- usbdcd_driver.usbdevclass_driver.speed = USB_SPEED_HIGH;
- usbdcd_driver.usbdevclass_driver.ops = &g_driverops;
- usbdcd_driver.setup_processed = true;
- usbdcd_driver.setup_queue = osal_queue_create(&_setup_queue_def);
-
- usbdev_register(&usbdcd_driver.usbdevclass_driver);
-}
-
-// Enable device interrupt
-void dcd_int_enable(uint8_t rhport)
-{
- (void) rhport;
-
- up_enable_irq(CXD56_IRQ_USB_INT);
-}
-
-// Disable device interrupt
-void dcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
-
- up_disable_irq(CXD56_IRQ_USB_INT);
-}
-
-// Receive Set Address request, mcu port must also include status IN response
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
- (void) dev_addr;
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
-
- DEV_WAKEUP(usbdev);
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- DEV_CONNECT(usbdev);
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- DEV_DISCONNECT(usbdev);
-}
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const *p_endpoint_desc)
-{
- (void) rhport;
-
- uint8_t epnum = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
- uint8_t const dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress);
- uint8_t xfrtype = 0;
- struct usb_epdesc_s epdesc;
-
- if (epnum >= CXD56_EPNUM)
- {
- return false;
- }
-
- switch (p_endpoint_desc->bmAttributes.xfer)
- {
- case 1:
- xfrtype = USB_EP_ATTR_XFER_ISOC;
- break;
- case 2:
- xfrtype = USB_EP_ATTR_XFER_BULK;
- break;
- case 3:
- xfrtype = USB_EP_ATTR_XFER_INT;
- break;
- }
-
- usbdcd_driver.ep[epnum] = DEV_ALLOCEP(usbdev, epnum, dir == TUSB_DIR_IN, xfrtype);
- if (usbdcd_driver.ep[epnum] == NULL)
- {
- return false;
- }
-
- usbdcd_driver.req[epnum] = NULL;
- usbdcd_driver.req[epnum] = EP_ALLOCREQ(usbdcd_driver.ep[epnum]);
- if (usbdcd_driver.req[epnum] != NULL)
- {
- usbdcd_driver.req[epnum]->len = p_endpoint_desc->wMaxPacketSize.size;
- }
- else
- {
- return false;
- }
-
- usbdcd_driver.req[epnum]->callback = usbdcd_ep0incomplete;
-
- epdesc.len = p_endpoint_desc->bLength;
- epdesc.type = p_endpoint_desc->bDescriptorType;
- epdesc.addr = p_endpoint_desc->bEndpointAddress;
- epdesc.attr = xfrtype;
- epdesc.mxpacketsize[0] = LSBYTE(p_endpoint_desc->wMaxPacketSize.size);
- epdesc.mxpacketsize[1] = MSBYTE(p_endpoint_desc->wMaxPacketSize.size);
- epdesc.interval = p_endpoint_desc->bInterval;
-
- if (EP_CONFIGURE(usbdcd_driver.ep[epnum], &epdesc, false) < 0)
- {
- return false;
- }
-
- return true;
-}
-
-bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t total_bytes)
-{
- (void) rhport;
-
- bool ret = true;
- uint8_t epnum = tu_edpt_number(ep_addr);
-
- if (epnum >= CXD56_EPNUM)
- {
- return false;
- }
-
- if (epnum == 0)
- {
- if (total_bytes == 0)
- {
- usbdcd_driver.setup_processed = true;
- dcd_event_xfer_complete(0, ep_addr, 0, XFER_RESULT_SUCCESS, false);
- }
- else if (ep_addr == 0x00 && total_bytes == usbdcd_driver.outlen)
- {
- memcpy(buffer, usbdcd_driver.dataout, usbdcd_driver.outlen);
- dcd_event_xfer_complete(0, ep_addr, total_bytes, XFER_RESULT_SUCCESS, false);
- usbdcd_driver.outlen = 0;
- }
- else
- {
- usbdcd_driver.req[epnum]->len = total_bytes;
- usbdcd_driver.req[epnum]->priv = (void *)((uint32_t)ep_addr);
- usbdcd_driver.req[epnum]->flags = total_bytes < usbdcd_driver.ep[epnum]->maxpacket ? USBDEV_REQFLAGS_NULLPKT : 0;
- usbdcd_driver.req[epnum]->buf = buffer;
-
- if (EP_SUBMIT(usbdcd_driver.ep[epnum], usbdcd_driver.req[epnum]) < 0)
- {
- ret = false;
- }
- }
-
- struct usb_ctrlreq_s ctrl;
-
- if (usbdcd_driver.setup_processed)
- {
- if (osal_queue_receive(usbdcd_driver.setup_queue, &ctrl))
- {
- usbdcd_driver.setup_processed = false;
- dcd_event_setup_received(0, (uint8_t *)&ctrl, false);
- }
- }
- }
- else
- {
- usbdcd_driver.req[epnum]->len = total_bytes;
- usbdcd_driver.req[epnum]->priv = (void *)((uint32_t)ep_addr);
- usbdcd_driver.req[epnum]->flags = total_bytes < usbdcd_driver.ep[epnum]->maxpacket ? USBDEV_REQFLAGS_NULLPKT : 0;
- usbdcd_driver.req[epnum]->buf = buffer;
-
- if (EP_SUBMIT(usbdcd_driver.ep[epnum], usbdcd_driver.req[epnum]) < 0)
- {
- ret = false;
- }
- }
-
- return ret;
-}
-
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t epnum = tu_edpt_number(ep_addr);
-
- if (epnum >= CXD56_EPNUM)
- {
- return;
- }
-
- EP_STALL(usbdcd_driver.ep[epnum]);
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t epnum = tu_edpt_number(ep_addr);
-
- if (epnum >= CXD56_EPNUM)
- {
- return;
- }
-
- EP_RESUME(usbdcd_driver.ep[epnum]);
-}
-
-#endif
diff --git a/tinyusb/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/tinyusb/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
deleted file mode 100755
index eeba7204..00000000
--- a/tinyusb/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
+++ /dev/null
@@ -1,1129 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Nathan Conrad
- *
- * Portions:
- * Copyright (c) 2016 STMicroelectronics
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-/**********************************************
- * This driver has been tested with the following MCUs:
- * - F070, F072, L053, F042F6
- *
- * It also should work with minimal changes for any ST MCU with an "USB A"/"PCD"/"HCD" peripheral. This
- * covers:
- *
- * F04x, F072, F078, 070x6/B 1024 byte buffer
- * F102, F103 512 byte buffer; no internal D+ pull-up (maybe many more changes?)
- * F302xB/C, F303xB/C, F373 512 byte buffer; no internal D+ pull-up
- * F302x6/8, F302xD/E2, F303xD/E 1024 byte buffer; no internal D+ pull-up
- * L0x2, L0x3 1024 byte buffer
- * L1 512 byte buffer
- * L4x2, L4x3 1024 byte buffer
- *
- * To use this driver, you must:
- * - If you are using a device with crystal-less USB, set up the clock recovery system (CRS)
- * - Remap pins to be D+/D- on devices that they are shared (for example: F042Fx)
- * - This is different to the normal "alternate function" GPIO interface, needs to go through SYSCFG->CFGRx register
- * - Enable USB clock; Perhaps use __HAL_RCC_USB_CLK_ENABLE();
- * - (Optionally configure GPIO HAL to tell it the USB driver is using the USB pins)
- * - call tusb_init();
- * - periodically call tusb_task();
- *
- * Assumptions of the driver:
- * - You are not using CAN (it must share the packet buffer)
- * - APB clock is >= 10 MHz
- * - On some boards, series resistors are required, but not on others.
- * - On some boards, D+ pull up resistor (1.5kohm) is required, but not on others.
- * - You don't have long-running interrupts; some USB packets must be quickly responded to.
- * - You have the ST CMSIS library linked into the project. HAL is not used.
- *
- * Current driver limitations (i.e., a list of features for you to add):
- * - STALL handled, but not tested.
- * - Does it work? No clue.
- * - All EP BTABLE buffers are created based on max packet size of first EP opened with that address.
- * - No isochronous endpoints
- * - Endpoint index is the ID of the endpoint
- * - This means that priority is given to endpoints with lower ID numbers
- * - Code is mixing up EP IX with EP ID. Everywhere.
- * - Packet buffer memory is copied in the interrupt.
- * - This is better for performance, but means interrupts are disabled for longer
- * - DMA may be the best choice, but it could also be pushed to the USBD task.
- * - No double-buffering
- * - No DMA
- * - Minimal error handling
- * - Perhaps error interrupts should be reported to the stack, or cause a device reset?
- * - Assumes a single USB peripheral; I think that no hardware has multiple so this is fine.
- * - Add a callback for enabling/disabling the D+ PU on devices without an internal PU.
- * - F3 models use three separate interrupts. I think we could only use the LP interrupt for
- * everything? However, the interrupts are configurable so the DisableInt and EnableInt
- * below functions could be adjusting the wrong interrupts (if they had been reconfigured)
- * - LPM is not used correctly, or at all?
- *
- * USB documentation and Reference implementations
- * - STM32 Reference manuals
- * - STM32 USB Hardware Guidelines AN4879
- *
- * - STM32 HAL (much of this driver is based on this)
- * - libopencm3/lib/stm32/common/st_usbfs_core.c
- * - Keil USB Device http://www.keil.com/pack/doc/mw/USB/html/group__usbd.html
- *
- * - YouTube OpenTechLab 011; https://www.youtube.com/watch?v=4FOkJLp_PUw
- *
- * Advantages over HAL driver:
- * - Tiny (saves RAM, assumes a single USB peripheral)
- *
- * Notes:
- * - The buffer table is allocated as endpoints are opened. The allocation is only
- * cleared when the device is reset. This may be bad if the USB device needs
- * to be reconfigured.
- */
-
-#include "tusb_option.h"
-
-#if defined(STM32F102x6) || defined(STM32F102xB) || \
- defined(STM32F103x6) || defined(STM32F103xB) || \
- defined(STM32F103xE) || defined(STM32F103xG)
-#define STM32F1_FSDEV
-#endif
-
-#if (TUSB_OPT_DEVICE_ENABLED) && ( \
- (CFG_TUSB_MCU == OPT_MCU_STM32F0 ) || \
- (CFG_TUSB_MCU == OPT_MCU_STM32F1 && defined(STM32F1_FSDEV)) || \
- (CFG_TUSB_MCU == OPT_MCU_STM32F3 ) || \
- (CFG_TUSB_MCU == OPT_MCU_STM32L0 ) || \
- (CFG_TUSB_MCU == OPT_MCU_STM32L1 ) \
- )
-
-// In order to reduce the dependance on HAL, we undefine this.
-// Some definitions are copied to our private include file.
-#undef USE_HAL_DRIVER
-
-#include "device/dcd.h"
-#include "portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h"
-
-
-/*****************************************************
- * Configuration
- *****************************************************/
-
-// HW supports max of 8 bidirectional endpoints, but this can be reduced to save RAM
-// (8u here would mean 8 IN and 8 OUT)
-#ifndef MAX_EP_COUNT
-# define MAX_EP_COUNT 8U
-#endif
-
-// If sharing with CAN, one can set this to be non-zero to give CAN space where it wants it
-// Both of these MUST be a multiple of 2, and are in byte units.
-#ifndef DCD_STM32_BTABLE_BASE
-# define DCD_STM32_BTABLE_BASE 0U
-#endif
-
-#ifndef DCD_STM32_BTABLE_LENGTH
-# define DCD_STM32_BTABLE_LENGTH (PMA_LENGTH - DCD_STM32_BTABLE_BASE)
-#endif
-
-// Since TinyUSB doesn't use SOF for now, and this interrupt too often (1ms interval)
-// We disable SOF for now until needed later on
-#ifndef USE_SOF
-# define USE_SOF 0
-#endif
-
-/***************************************************
- * Checks, structs, defines, function definitions, etc.
- */
-
-TU_VERIFY_STATIC((MAX_EP_COUNT) <= STFSDEV_EP_COUNT, "Only 8 endpoints supported on the hardware");
-
-TU_VERIFY_STATIC(((DCD_STM32_BTABLE_BASE) + (DCD_STM32_BTABLE_LENGTH))<=(PMA_LENGTH),
- "BTABLE does not fit in PMA RAM");
-
-TU_VERIFY_STATIC(((DCD_STM32_BTABLE_BASE) % 8) == 0, "BTABLE base must be aligned to 8 bytes");
-
-// One of these for every EP IN & OUT, uses a bit of RAM....
-typedef struct
-{
- uint8_t * buffer;
- // tu_fifo_t * ff; // TODO support dcd_edpt_xfer_fifo API
- uint16_t total_len;
- uint16_t queued_len;
- uint16_t pma_ptr;
- uint8_t max_packet_size;
- uint8_t pma_alloc_size;
-} xfer_ctl_t;
-
-static xfer_ctl_t xfer_status[MAX_EP_COUNT][2];
-
-static inline xfer_ctl_t* xfer_ctl_ptr(uint32_t epnum, uint32_t dir)
-{
- return &xfer_status[epnum][dir];
-}
-
-static TU_ATTR_ALIGNED(4) uint32_t _setup_packet[6];
-
-static uint8_t remoteWakeCountdown; // When wake is requested
-
-// into the stack.
-static void dcd_handle_bus_reset(void);
-static void dcd_transmit_packet(xfer_ctl_t * xfer, uint16_t ep_ix);
-static void dcd_ep_ctr_handler(void);
-
-// PMA allocation/access
-static uint8_t open_ep_count;
-static uint16_t ep_buf_ptr; ///< Points to first free memory location
-static void dcd_pma_alloc_reset(void);
-static uint16_t dcd_pma_alloc(uint8_t ep_addr, size_t length);
-static void dcd_pma_free(uint8_t ep_addr);
-static bool dcd_write_packet_memory(uint16_t dst, const void *__restrict src, size_t wNBytes);
-static bool dcd_read_packet_memory(void *__restrict dst, uint16_t src, size_t wNBytes);
-
-//static bool dcd_write_packet_memory_ff(tu_fifo_t * ff, uint16_t dst, uint16_t wNBytes);
-//static bool dcd_read_packet_memory_ff(tu_fifo_t * ff, uint16_t src, uint16_t wNBytes);
-
-// Using a function due to better type checks
-// This seems better than having to do type casts everywhere else
-static inline void reg16_clear_bits(__IO uint16_t *reg, uint16_t mask) {
- *reg = (uint16_t)(*reg & ~mask);
-}
-
-// Bits in ISTR are cleared upon writing 0
-static inline void clear_istr_bits(uint16_t mask) {
- USB->ISTR = ~mask;
-}
-
-void dcd_init (uint8_t rhport)
-{
- /* Clocks should already be enabled */
- /* Use __HAL_RCC_USB_CLK_ENABLE(); to enable the clocks before calling this function */
-
- /* The RM mentions to use a special ordering of PDWN and FRES, but this isn't done in HAL.
- * Here, the RM is followed. */
-
- for(uint32_t i = 0; i<200; i++) // should be a few us
- {
- asm("NOP");
- }
- // Perform USB peripheral reset
- USB->CNTR = USB_CNTR_FRES | USB_CNTR_PDWN;
- for(uint32_t i = 0; i<200; i++) // should be a few us
- {
- asm("NOP");
- }
- reg16_clear_bits(&USB->CNTR, USB_CNTR_PDWN);// Remove powerdown
- // Wait startup time, for F042 and F070, this is <= 1 us.
- for(uint32_t i = 0; i<200; i++) // should be a few us
- {
- asm("NOP");
- }
- USB->CNTR = 0; // Enable USB
-
- USB->BTABLE = DCD_STM32_BTABLE_BASE;
-
- USB->ISTR = 0; // Clear pending interrupts
-
- // Reset endpoints to disabled
- for(uint32_t i=0; i<STFSDEV_EP_COUNT; i++)
- {
- // This doesn't clear all bits since some bits are "toggle", but does set the type to DISABLED.
- pcd_set_endpoint(USB,i,0u);
- }
-
- USB->CNTR |= USB_CNTR_RESETM | (USE_SOF ? USB_CNTR_SOFM : 0) | USB_CNTR_ESOFM | USB_CNTR_CTRM | USB_CNTR_SUSPM | USB_CNTR_WKUPM;
- dcd_handle_bus_reset();
-
- // Enable pull-up if supported
- if ( dcd_connect ) dcd_connect(rhport);
-}
-
-// Define only on MCU with internal pull-up. BSP can define on MCU without internal PU.
-#if defined(USB_BCDR_DPPU)
-
-// Disable internal D+ PU
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- USB->BCDR &= ~(USB_BCDR_DPPU);
-}
-
-// Enable internal D+ PU
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- USB->BCDR |= USB_BCDR_DPPU;
-}
-
-#elif defined(SYSCFG_PMC_USB_PU) // works e.g. on STM32L151
-// Disable internal D+ PU
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- SYSCFG->PMC &= ~(SYSCFG_PMC_USB_PU);
-}
-
-// Enable internal D+ PU
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- SYSCFG->PMC |= SYSCFG_PMC_USB_PU;
-}
-#endif
-
-// Enable device interrupt
-void dcd_int_enable (uint8_t rhport)
-{
- (void)rhport;
- // Member here forces write to RAM before allowing ISR to execute
- __DSB();
- __ISB();
-#if CFG_TUSB_MCU == OPT_MCU_STM32F0 || CFG_TUSB_MCU == OPT_MCU_STM32L0
- NVIC_EnableIRQ(USB_IRQn);
-#elif CFG_TUSB_MCU == OPT_MCU_STM32L1
- NVIC_EnableIRQ(USB_LP_IRQn);
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F3
- // Some STM32F302/F303 devices allow to remap the USB interrupt vectors from
- // shared USB/CAN IRQs to separate CAN and USB IRQs.
- // This dynamically checks if this remap is active to enable the right IRQs.
- #ifdef SYSCFG_CFGR1_USB_IT_RMP
- if (SYSCFG->CFGR1 & SYSCFG_CFGR1_USB_IT_RMP)
- {
- NVIC_EnableIRQ(USB_HP_IRQn);
- NVIC_EnableIRQ(USB_LP_IRQn);
- NVIC_EnableIRQ(USBWakeUp_RMP_IRQn);
- }
- else
- #endif
- {
- NVIC_EnableIRQ(USB_HP_CAN_TX_IRQn);
- NVIC_EnableIRQ(USB_LP_CAN_RX0_IRQn);
- NVIC_EnableIRQ(USBWakeUp_IRQn);
- }
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F1
- NVIC_EnableIRQ(USB_HP_CAN1_TX_IRQn);
- NVIC_EnableIRQ(USB_LP_CAN1_RX0_IRQn);
- NVIC_EnableIRQ(USBWakeUp_IRQn);
-#else
- #error Unknown arch in USB driver
-#endif
-}
-
-// Disable device interrupt
-void dcd_int_disable(uint8_t rhport)
-{
- (void)rhport;
-
-#if CFG_TUSB_MCU == OPT_MCU_STM32F0 || CFG_TUSB_MCU == OPT_MCU_STM32L0
- NVIC_DisableIRQ(USB_IRQn);
-#elif CFG_TUSB_MCU == OPT_MCU_STM32L1
- NVIC_DisableIRQ(USB_LP_IRQn);
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F3
- // Some STM32F302/F303 devices allow to remap the USB interrupt vectors from
- // shared USB/CAN IRQs to separate CAN and USB IRQs.
- // This dynamically checks if this remap is active to disable the right IRQs.
- #ifdef SYSCFG_CFGR1_USB_IT_RMP
- if (SYSCFG->CFGR1 & SYSCFG_CFGR1_USB_IT_RMP)
- {
- NVIC_DisableIRQ(USB_HP_IRQn);
- NVIC_DisableIRQ(USB_LP_IRQn);
- NVIC_DisableIRQ(USBWakeUp_RMP_IRQn);
- }
- else
- #endif
- {
- NVIC_DisableIRQ(USB_HP_CAN_TX_IRQn);
- NVIC_DisableIRQ(USB_LP_CAN_RX0_IRQn);
- NVIC_DisableIRQ(USBWakeUp_IRQn);
- }
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F1
- NVIC_DisableIRQ(USB_HP_CAN1_TX_IRQn);
- NVIC_DisableIRQ(USB_LP_CAN1_RX0_IRQn);
- NVIC_DisableIRQ(USBWakeUp_IRQn);
-#else
- #error Unknown arch in USB driver
-#endif
-
- // CMSIS has a membar after disabling interrupts
-}
-
-// Receive Set Address request, mcu port must also include status IN response
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
- (void) dev_addr;
-
- // Respond with status
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-
- // DCD can only set address after status for this request is complete.
- // do it at dcd_edpt0_status_complete()
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
-
- USB->CNTR |= (uint16_t) USB_CNTR_RESUME;
- remoteWakeCountdown = 4u; // required to be 1 to 15 ms, ESOF should trigger every 1ms.
-}
-
-static const tusb_desc_endpoint_t ep0OUT_desc =
-{
- .bLength = sizeof(tusb_desc_endpoint_t),
- .bDescriptorType = TUSB_DESC_ENDPOINT,
-
- .bEndpointAddress = 0x00,
- .bmAttributes = { .xfer = TUSB_XFER_CONTROL },
- .wMaxPacketSize = { .size = CFG_TUD_ENDPOINT0_SIZE },
- .bInterval = 0
-};
-
-static const tusb_desc_endpoint_t ep0IN_desc =
-{
- .bLength = sizeof(tusb_desc_endpoint_t),
- .bDescriptorType = TUSB_DESC_ENDPOINT,
-
- .bEndpointAddress = 0x80,
- .bmAttributes = { .xfer = TUSB_XFER_CONTROL },
- .wMaxPacketSize = { .size = CFG_TUD_ENDPOINT0_SIZE },
- .bInterval = 0
-};
-
-static void dcd_handle_bus_reset(void)
-{
- //__IO uint16_t * const epreg = &(EPREG(0));
- USB->DADDR = 0u; // disable USB peripheral by clearing the EF flag
-
- // Clear all EPREG (or maybe this is automatic? I'm not sure)
- for(uint32_t i=0; i<STFSDEV_EP_COUNT; i++)
- {
- pcd_set_endpoint(USB,i,0u);
- }
-
- dcd_pma_alloc_reset();
- dcd_edpt_open (0, &ep0OUT_desc);
- dcd_edpt_open (0, &ep0IN_desc);
-
- USB->DADDR = USB_DADDR_EF; // Set enable flag, and leaving the device address as zero.
-}
-
-// Handle CTR interrupt for the TX/IN direction
-//
-// Upon call, (wIstr & USB_ISTR_DIR) == 0U
-static void dcd_ep_ctr_tx_handler(uint32_t wIstr)
-{
- uint32_t EPindex = wIstr & USB_ISTR_EP_ID;
- uint32_t wEPRegVal = pcd_get_endpoint(USB, EPindex);
-
- // Verify the CTR_TX bit is set. This was in the ST Micro code,
- // but I'm not sure it's actually necessary?
- if((wEPRegVal & USB_EP_CTR_TX) == 0U)
- {
- return;
- }
-
- /* clear int flag */
- pcd_clear_tx_ep_ctr(USB, EPindex);
-
- xfer_ctl_t * xfer = xfer_ctl_ptr(EPindex,TUSB_DIR_IN);
- if((xfer->total_len != xfer->queued_len)) /* TX not complete */
- {
- dcd_transmit_packet(xfer, EPindex);
- }
- else /* TX Complete */
- {
- dcd_event_xfer_complete(0, (uint8_t)(0x80 + EPindex), xfer->total_len, XFER_RESULT_SUCCESS, true);
- }
-}
-
-// Handle CTR interrupt for the RX/OUT direction
-//
-// Upon call, (wIstr & USB_ISTR_DIR) == 0U
-static void dcd_ep_ctr_rx_handler(uint32_t wIstr)
-{
- uint32_t EPindex = wIstr & USB_ISTR_EP_ID;
- uint32_t wEPRegVal = pcd_get_endpoint(USB, EPindex);
- uint32_t count = pcd_get_ep_rx_cnt(USB,EPindex);
-
- xfer_ctl_t *xfer = xfer_ctl_ptr(EPindex,TUSB_DIR_OUT);
-
- // Verify the CTR_RX bit is set. This was in the ST Micro code,
- // but I'm not sure it's actually necessary?
- if((wEPRegVal & USB_EP_CTR_RX) == 0U)
- {
- return;
- }
-
- if((EPindex == 0U) && ((wEPRegVal & USB_EP_SETUP) != 0U)) /* Setup packet */
- {
- // The setup_received function uses memcpy, so this must first copy the setup data into
- // user memory, to allow for the 32-bit access that memcpy performs.
- uint8_t userMemBuf[8];
- /* Get SETUP Packet*/
- if(count == 8) // Setup packet should always be 8 bytes. If not, ignore it, and try again.
- {
- // Must reset EP to NAK (in case it had been stalling) (though, maybe too late here)
- pcd_set_ep_rx_status(USB,0u,USB_EP_RX_NAK);
- pcd_set_ep_tx_status(USB,0u,USB_EP_TX_NAK);
- dcd_read_packet_memory(userMemBuf, *pcd_ep_rx_address_ptr(USB,EPindex), 8);
- dcd_event_setup_received(0, (uint8_t*)userMemBuf, true);
- }
- }
- else
- {
- // Clear RX CTR interrupt flag
- if(EPindex != 0u)
- {
- pcd_clear_rx_ep_ctr(USB, EPindex);
- }
-
- if (count != 0U)
- {
-#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- dcd_read_packet_memory_ff(xfer->ff, *pcd_ep_rx_address_ptr(USB,EPindex), count);
- }
- else
-#endif
- {
- dcd_read_packet_memory(&(xfer->buffer[xfer->queued_len]), *pcd_ep_rx_address_ptr(USB,EPindex), count);
- }
-
- xfer->queued_len = (uint16_t)(xfer->queued_len + count);
- }
-
- if ((count < xfer->max_packet_size) || (xfer->queued_len == xfer->total_len))
- {
- /* RX COMPLETE */
- dcd_event_xfer_complete(0, EPindex, xfer->queued_len, XFER_RESULT_SUCCESS, true);
- // Though the host could still send, we don't know.
- // Does the bulk pipe need to be reset to valid to allow for a ZLP?
- }
- else
- {
- uint32_t remaining = (uint32_t)xfer->total_len - (uint32_t)xfer->queued_len;
- if(remaining >= xfer->max_packet_size) {
- pcd_set_ep_rx_cnt(USB, EPindex,xfer->max_packet_size);
- } else {
- pcd_set_ep_rx_cnt(USB, EPindex,remaining);
- }
- pcd_set_ep_rx_status(USB, EPindex, USB_EP_RX_VALID);
- }
- }
-
- // For EP0, prepare to receive another SETUP packet.
- // Clear CTR last so that a new packet does not overwrite the packing being read.
- // (Based on the docs, it seems SETUP will always be accepted after CTR is cleared)
- if(EPindex == 0u)
- {
- // Always be prepared for a status packet...
- pcd_set_ep_rx_cnt(USB, EPindex, CFG_TUD_ENDPOINT0_SIZE);
- pcd_clear_rx_ep_ctr(USB, EPindex);
- }
-}
-
-static void dcd_ep_ctr_handler(void)
-{
- uint32_t wIstr;
-
- /* stay in loop while pending interrupts */
- while (((wIstr = USB->ISTR) & USB_ISTR_CTR) != 0U)
- {
-
- if ((wIstr & USB_ISTR_DIR) == 0U) /* TX/IN */
- {
- dcd_ep_ctr_tx_handler(wIstr);
- }
- else /* RX/OUT*/
- {
- dcd_ep_ctr_rx_handler(wIstr);
- }
- }
-}
-
-void dcd_int_handler(uint8_t rhport) {
-
- (void) rhport;
-
- uint32_t int_status = USB->ISTR;
- //const uint32_t handled_ints = USB_ISTR_CTR | USB_ISTR_RESET | USB_ISTR_WKUP
- // | USB_ISTR_SUSP | USB_ISTR_SOF | USB_ISTR_ESOF;
- // unused IRQs: (USB_ISTR_PMAOVR | USB_ISTR_ERR | USB_ISTR_L1REQ )
-
- // The ST driver loops here on the CTR bit, but that loop has been moved into the
- // dcd_ep_ctr_handler(), so less need to loop here. The other interrupts shouldn't
- // be triggered repeatedly.
-
- if(int_status & USB_ISTR_RESET) {
- // USBRST is start of reset.
- clear_istr_bits(USB_ISTR_RESET);
- dcd_handle_bus_reset();
- dcd_event_bus_reset(0, TUSB_SPEED_FULL, true);
- return; // Don't do the rest of the things here; perhaps they've been cleared?
- }
-
- if (int_status & USB_ISTR_CTR)
- {
- /* servicing of the endpoint correct transfer interrupt */
- /* clear of the CTR flag into the sub */
- dcd_ep_ctr_handler();
- }
-
- if (int_status & USB_ISTR_WKUP)
- {
- reg16_clear_bits(&USB->CNTR, USB_CNTR_LPMODE);
- reg16_clear_bits(&USB->CNTR, USB_CNTR_FSUSP);
- clear_istr_bits(USB_ISTR_WKUP);
- dcd_event_bus_signal(0, DCD_EVENT_RESUME, true);
- }
-
- if (int_status & USB_ISTR_SUSP)
- {
- /* Suspend is asserted for both suspend and unplug events. without Vbus monitoring,
- * these events cannot be differentiated, so we only trigger suspend. */
-
- /* Force low-power mode in the macrocell */
- USB->CNTR |= USB_CNTR_FSUSP;
- USB->CNTR |= USB_CNTR_LPMODE;
-
- /* clear of the ISTR bit must be done after setting of CNTR_FSUSP */
- clear_istr_bits(USB_ISTR_SUSP);
- dcd_event_bus_signal(0, DCD_EVENT_SUSPEND, true);
- }
-
-#if USE_SOF
- if(int_status & USB_ISTR_SOF) {
- clear_istr_bits(USB_ISTR_SOF);
- dcd_event_bus_signal(0, DCD_EVENT_SOF, true);
- }
-#endif
-
- if(int_status & USB_ISTR_ESOF) {
- if(remoteWakeCountdown == 1u)
- {
- USB->CNTR &= (uint16_t)(~USB_CNTR_RESUME);
- }
- if(remoteWakeCountdown > 0u)
- {
- remoteWakeCountdown--;
- }
- clear_istr_bits(USB_ISTR_ESOF);
- }
-}
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-
-// Invoked when a control transfer's status stage is complete.
-// May help DCD to prepare for next control transfer, this API is optional.
-void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * request)
-{
- (void) rhport;
-
- if (request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_DEVICE &&
- request->bmRequestType_bit.type == TUSB_REQ_TYPE_STANDARD &&
- request->bRequest == TUSB_REQ_SET_ADDRESS )
- {
- uint8_t const dev_addr = (uint8_t) request->wValue;
-
- // Setting new address after the whole request is complete
- reg16_clear_bits(&USB->DADDR, USB_DADDR_ADD);
- USB->DADDR = (uint16_t)(USB->DADDR | dev_addr); // leave the enable bit set
- }
-}
-
-static void dcd_pma_alloc_reset(void)
-{
- ep_buf_ptr = DCD_STM32_BTABLE_BASE + 8*MAX_EP_COUNT; // 8 bytes per endpoint (two TX and two RX words, each)
- //TU_LOG2("dcd_pma_alloc_reset()\r\n");
- for(uint32_t i=0; i<MAX_EP_COUNT; i++)
- {
- xfer_ctl_ptr(i,TUSB_DIR_OUT)->pma_alloc_size = 0U;
- xfer_ctl_ptr(i,TUSB_DIR_IN)->pma_alloc_size = 0U;
- xfer_ctl_ptr(i,TUSB_DIR_OUT)->pma_ptr = 0U;
- xfer_ctl_ptr(i,TUSB_DIR_IN)->pma_ptr = 0U;
- }
-}
-
-/***
- * Allocate a section of PMA
- *
- * If the EP number has already been allocated, and the new allocation
- * is larger than the old allocation, then this will fail with a TU_ASSERT.
- * (This is done to simplify the code. More complicated algorithms could be used)
- *
- * During failure, TU_ASSERT is used. If this happens, rework/reallocate memory manually.
- */
-static uint16_t dcd_pma_alloc(uint8_t ep_addr, size_t length)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
- xfer_ctl_t* epXferCtl = xfer_ctl_ptr(epnum,dir);
-
- if(epXferCtl->pma_alloc_size != 0U)
- {
- //TU_LOG2("dcd_pma_alloc(%x,%x)=%x (cached)\r\n",ep_addr,length,epXferCtl->pma_ptr);
- // Previously allocated
- TU_ASSERT(length <= epXferCtl->pma_alloc_size, 0xFFFF); // Verify no larger than previous alloc
- return epXferCtl->pma_ptr;
- }
-
- uint16_t addr = ep_buf_ptr;
- ep_buf_ptr = (uint16_t)(ep_buf_ptr + length); // increment buffer pointer
-
- // Verify no overflow
- TU_ASSERT(ep_buf_ptr <= PMA_LENGTH, 0xFFFF);
-
- epXferCtl->pma_ptr = addr;
- epXferCtl->pma_alloc_size = length;
- //TU_LOG2("dcd_pma_alloc(%x,%x)=%x\r\n",ep_addr,length,addr);
-
- return addr;
-}
-
-/***
- * Free a block of PMA space
- */
-static void dcd_pma_free(uint8_t ep_addr)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- // Presently, this should never be called for EP0 IN/OUT
- TU_ASSERT(open_ep_count > 2, /**/);
- TU_ASSERT(xfer_ctl_ptr(epnum,dir)->max_packet_size != 0, /**/);
- open_ep_count--;
-
- // If count is 2, only EP0 should be open, so allocations can be mostly reset.
-
- if(open_ep_count == 2)
- {
- ep_buf_ptr = DCD_STM32_BTABLE_BASE + 8*MAX_EP_COUNT + 2*CFG_TUD_ENDPOINT0_SIZE; // 8 bytes per endpoint (two TX and two RX words, each), and EP0
-
- // Skip EP0
- for(uint32_t i=1; i<MAX_EP_COUNT; i++)
- {
- xfer_ctl_ptr(i,TUSB_DIR_OUT)->pma_alloc_size = 0U;
- xfer_ctl_ptr(i,TUSB_DIR_IN)->pma_alloc_size = 0U;
- xfer_ctl_ptr(i,TUSB_DIR_OUT)->pma_ptr = 0U;
- xfer_ctl_ptr(i,TUSB_DIR_IN)->pma_ptr = 0U;
- }
- }
-}
-
-// The STM32F0 doesn't seem to like |= or &= to manipulate the EP#R registers,
-// so I'm using the #define from HAL here, instead.
-
-bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
-{
- (void)rhport;
- uint8_t const epnum = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
- uint8_t const dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress);
- const uint16_t epMaxPktSize = p_endpoint_desc->wMaxPacketSize.size;
- uint16_t pma_addr;
- uint32_t wType;
-
- // Isochronous not supported (yet), and some other driver assumptions.
- TU_ASSERT(p_endpoint_desc->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS);
- TU_ASSERT(epnum < MAX_EP_COUNT);
-
- // Set type
- switch(p_endpoint_desc->bmAttributes.xfer) {
- case TUSB_XFER_CONTROL:
- wType = USB_EP_CONTROL;
- break;
-#if (0)
- case TUSB_XFER_ISOCHRONOUS: // FIXME: Not yet supported
- wType = USB_EP_ISOCHRONOUS;
- break;
-#endif
-
- case TUSB_XFER_BULK:
- wType = USB_EP_CONTROL;
- break;
-
- case TUSB_XFER_INTERRUPT:
- wType = USB_EP_INTERRUPT;
- break;
-
- default:
- TU_ASSERT(false);
- }
-
- pcd_set_eptype(USB, epnum, wType);
- pcd_set_ep_address(USB, epnum, epnum);
- // Be normal, for now, instead of only accepting zero-byte packets (on control endpoint)
- // or being double-buffered (bulk endpoints)
- pcd_clear_ep_kind(USB,0);
-
- pma_addr = dcd_pma_alloc(p_endpoint_desc->bEndpointAddress, p_endpoint_desc->wMaxPacketSize.size);
-
- if(dir == TUSB_DIR_IN)
- {
- *pcd_ep_tx_address_ptr(USB, epnum) = pma_addr;
- pcd_set_ep_tx_cnt(USB, epnum, p_endpoint_desc->wMaxPacketSize.size);
- pcd_clear_tx_dtog(USB, epnum);
- pcd_set_ep_tx_status(USB,epnum,USB_EP_TX_NAK);
- }
- else
- {
- *pcd_ep_rx_address_ptr(USB, epnum) = pma_addr;
- pcd_set_ep_rx_cnt(USB, epnum, p_endpoint_desc->wMaxPacketSize.size);
- pcd_clear_rx_dtog(USB, epnum);
- pcd_set_ep_rx_status(USB, epnum, USB_EP_RX_NAK);
- }
-
- xfer_ctl_ptr(epnum, dir)->max_packet_size = epMaxPktSize;
-
- return true;
-}
-
-/**
- * Close an endpoint.
- *
- * This function may be called with interrupts enabled or disabled.
- *
- * This also clears transfers in progress, should there be any.
- */
-void dcd_edpt_close (uint8_t rhport, uint8_t ep_addr)
-{
- (void)rhport;
- uint32_t const epnum = tu_edpt_number(ep_addr);
- uint32_t const dir = tu_edpt_dir(ep_addr);
-
- if(dir == TUSB_DIR_IN)
- {
- pcd_set_ep_tx_status(USB,epnum,USB_EP_TX_DIS);
- }
- else
- {
- pcd_set_ep_rx_status(USB, epnum, USB_EP_RX_DIS);
- }
-
- dcd_pma_free(ep_addr);
-}
-
-// Currently, single-buffered, and only 64 bytes at a time (max)
-
-static void dcd_transmit_packet(xfer_ctl_t * xfer, uint16_t ep_ix)
-{
- uint16_t len = (uint16_t)(xfer->total_len - xfer->queued_len);
-
- if(len > xfer->max_packet_size) // max packet size for FS transfer
- {
- len = xfer->max_packet_size;
- }
- uint16_t oldAddr = *pcd_ep_tx_address_ptr(USB,ep_ix);
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- dcd_write_packet_memory_ff(xfer->ff, oldAddr, len);
- }
- else
-#endif
- {
- dcd_write_packet_memory(oldAddr, &(xfer->buffer[xfer->queued_len]), len);
- }
- xfer->queued_len = (uint16_t)(xfer->queued_len + len);
-
- pcd_set_ep_tx_cnt(USB,ep_ix,len);
- pcd_set_ep_tx_status(USB, ep_ix, USB_EP_TX_VALID);
-}
-
-bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_ctl_t * xfer = xfer_ctl_ptr(epnum,dir);
-
- xfer->buffer = buffer;
- // xfer->ff = NULL; // TODO support dcd_edpt_xfer_fifo API
- xfer->total_len = total_bytes;
- xfer->queued_len = 0;
-
- if ( dir == TUSB_DIR_OUT )
- {
- // A setup token can occur immediately after an OUT STATUS packet so make sure we have a valid
- // buffer for the control endpoint.
- if (epnum == 0 && buffer == NULL)
- {
- xfer->buffer = (uint8_t*)_setup_packet;
- }
- if(total_bytes > xfer->max_packet_size)
- {
- pcd_set_ep_rx_cnt(USB,epnum,xfer->max_packet_size);
- } else {
- pcd_set_ep_rx_cnt(USB,epnum,total_bytes);
- }
- pcd_set_ep_rx_status(USB, epnum, USB_EP_RX_VALID);
- }
- else // IN
- {
- dcd_transmit_packet(xfer,epnum);
- }
- return true;
-}
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
-bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_ctl_t * xfer = xfer_ctl_ptr(epnum,dir);
-
- xfer->buffer = NULL;
- // xfer->ff = ff; // TODO support dcd_edpt_xfer_fifo API
- xfer->total_len = total_bytes;
- xfer->queued_len = 0;
-
- if ( dir == TUSB_DIR_OUT )
- {
- if(total_bytes > xfer->max_packet_size)
- {
- pcd_set_ep_rx_cnt(USB,epnum,xfer->max_packet_size);
- } else {
- pcd_set_ep_rx_cnt(USB,epnum,total_bytes);
- }
- pcd_set_ep_rx_status(USB, epnum, USB_EP_RX_VALID);
- }
- else // IN
- {
- dcd_transmit_packet(xfer,epnum);
- }
- return true;
-}
-#endif
-
-void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void)rhport;
-
- if (ep_addr & 0x80)
- { // IN
- pcd_set_ep_tx_status(USB, ep_addr & 0x7F, USB_EP_TX_STALL);
- }
- else
- { // OUT
- pcd_set_ep_rx_status(USB, ep_addr, USB_EP_RX_STALL);
- }
-}
-
-void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void)rhport;
-
- if (ep_addr & 0x80)
- { // IN
- ep_addr &= 0x7F;
-
- pcd_set_ep_tx_status(USB,ep_addr, USB_EP_TX_NAK);
-
- /* Reset to DATA0 if clearing stall condition. */
- pcd_clear_tx_dtog(USB,ep_addr);
- }
- else
- { // OUT
- /* Reset to DATA0 if clearing stall condition. */
- pcd_clear_rx_dtog(USB,ep_addr);
-
- pcd_set_ep_rx_status(USB,ep_addr, USB_EP_RX_NAK);
- }
-}
-
-// Packet buffer access can only be 8- or 16-bit.
-/**
- * @brief Copy a buffer from user memory area to packet memory area (PMA).
- * This uses byte-access for user memory (so support non-aligned buffers)
- * and 16-bit access for packet memory.
- * @param dst, byte address in PMA; must be 16-bit aligned
- * @param src pointer to user memory area.
- * @param wPMABufAddr address into PMA.
- * @param wNBytes no. of bytes to be copied.
- * @retval None
- */
-static bool dcd_write_packet_memory(uint16_t dst, const void *__restrict src, size_t wNBytes)
-{
- uint32_t n = ((uint32_t)wNBytes + 1U) >> 1U;
- uint32_t i;
- uint16_t temp1, temp2;
- const uint8_t * srcVal;
-
- // The GCC optimizer will combine access to 32-bit sizes if we let it. Force
- // it volatile so that it won't do that.
- __IO uint16_t *pdwVal;
-
- srcVal = src;
- pdwVal = &pma[PMA_STRIDE*(dst>>1)];
-
- for (i = n; i != 0; i--)
- {
- temp1 = (uint16_t) *srcVal;
- srcVal++;
- temp2 = temp1 | ((uint16_t)((uint16_t) ((*srcVal) << 8U))) ;
- *pdwVal = temp2;
- pdwVal += PMA_STRIDE;
- srcVal++;
- }
- return true;
-}
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
-/**
- * @brief Copy from FIFO to packet memory area (PMA).
- * Uses byte-access of system memory and 16-bit access of packet memory
- * @param wNBytes no. of bytes to be copied.
- * @retval None
- */
-
-// THIS FUNCTION IS UNTESTED
-
-static bool dcd_write_packet_memory_ff(tu_fifo_t * ff, uint16_t dst, uint16_t wNBytes)
-{
- // Since we copy from a ring buffer FIFO, a wrap might occur making it necessary to conduct two copies
- // Check for first linear part
- void * src;
- uint16_t len = tu_fifo_get_linear_read_info(ff, 0, &src, wNBytes); // We want to read from the FIFO - THIS FUNCTION CHANGED!!!
- TU_VERIFY(len && dcd_write_packet_memory(dst, src, len)); // and write it into the PMA
- tu_fifo_advance_read_pointer(ff, len);
-
- // Check for wrapped part
- if (len < wNBytes)
- {
- // Get remaining wrapped length
- uint16_t len2 = tu_fifo_get_linear_read_info(ff, 0, &src, wNBytes - len);
- TU_VERIFY(len2);
-
- // Update destination pointer
- dst += len;
-
- // Since PMA is accessed 16-bit wise we need to handle the case when a 16 bit value was split
- if (len % 2) // If len is uneven there is a byte left to copy
- {
- // Since PMA can accessed only 16 bit-wise we copy the last byte again
- tu_fifo_backward_read_pointer(ff, 1); // Move one byte back and copy two bytes for the PMA
- tu_fifo_read_n(ff, (void *) &pma[PMA_STRIDE*(dst>>1)], 2); // Since EP FIFOs must be of item size 1 this is safe to do
- dst++;
- len2--;
- }
-
- TU_VERIFY(dcd_write_packet_memory(dst, src, len2));
- tu_fifo_advance_write_pointer(ff, len2);
- }
-
- return true;
-}
-#endif
-
-/**
- * @brief Copy a buffer from packet memory area (PMA) to user memory area.
- * Uses byte-access of system memory and 16-bit access of packet memory
- * @param wNBytes no. of bytes to be copied.
- * @retval None
- */
-static bool dcd_read_packet_memory(void *__restrict dst, uint16_t src, size_t wNBytes)
-{
- uint32_t n = (uint32_t)wNBytes >> 1U;
- uint32_t i;
- // The GCC optimizer will combine access to 32-bit sizes if we let it. Force
- // it volatile so that it won't do that.
- __IO const uint16_t *pdwVal;
- uint32_t temp;
-
- pdwVal = &pma[PMA_STRIDE*(src>>1)];
- uint8_t *dstVal = (uint8_t*)dst;
-
- for (i = n; i != 0U; i--)
- {
- temp = *pdwVal;
- pdwVal += PMA_STRIDE;
- *dstVal++ = ((temp >> 0) & 0xFF);
- *dstVal++ = ((temp >> 8) & 0xFF);
- }
-
- if (wNBytes % 2)
- {
- temp = *pdwVal;
- pdwVal += PMA_STRIDE;
- *dstVal++ = ((temp >> 0) & 0xFF);
- }
- return true;
-}
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
-/**
- * @brief Copy a buffer from user packet memory area (PMA) to FIFO.
- * Uses byte-access of system memory and 16-bit access of packet memory
- * @param wNBytes no. of bytes to be copied.
- * @retval None
- */
-
-// THIS FUNCTION IS UNTESTED
-
-static bool dcd_read_packet_memory_ff(tu_fifo_t * ff, uint16_t src, uint16_t wNBytes)
-{
- // Since we copy into a ring buffer FIFO, a wrap might occur making it necessary to conduct two copies
- // Check for first linear part
- void * dst;
- uint16_t len = tu_fifo_get_linear_write_info(ff, 0, &dst, wNBytes); // THIS FUNCTION CHANGED!!!!
- TU_VERIFY(len && dcd_read_packet_memory(dst, src, len));
- tu_fifo_advance_write_pointer(ff, len);
-
- // Check for wrapped part
- if (len < wNBytes)
- {
- // Get remaining wrapped length
- uint16_t len2 = tu_fifo_get_linear_write_info(ff, 0, &dst, wNBytes - len);
- TU_VERIFY(len2);
-
- // Update source pointer
- src += len;
-
- // Since PMA is accessed 16-bit wise we need to handle the case when a 16 bit value was split
- if (len % 2) // If len is uneven there is a byte left to copy
- {
- uint32_t temp = pma[PMA_STRIDE*(src>>1)];
- *((uint8_t *)dst++) = ((temp >> 8) & 0xFF);
- src++;
- len2--;
- }
-
- TU_VERIFY(dcd_read_packet_memory(dst, src, len2));
- tu_fifo_advance_write_pointer(ff, len2);
- }
-
- return true;
-}
-
-#endif
-
-#endif
-
diff --git a/tinyusb/src/portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h b/tinyusb/src/portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h
deleted file mode 100755
index eca8bf57..00000000
--- a/tinyusb/src/portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h
+++ /dev/null
@@ -1,411 +0,0 @@
-/**
- ******************************************************************************
- * @file dcd_stm32f0_pvt_st.h
- * @brief DCD utilities from ST code
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
- * <h2><center>&copy; parts COPYRIGHT(c) N Conrad</center></h2>
- *
- * 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 STMicroelectronics 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.
- *
- **********/
-
-// This file contains source copied from ST's HAL, and thus should have their copyright statement.
-
-// PMA_LENGTH is PMA buffer size in bytes.
-// On 512-byte devices, access with a stride of two words (use every other 16-bit address)
-// On 1024-byte devices, access with a stride of one word (use every 16-bit address)
-
-#ifndef PORTABLE_ST_STM32F0_DCD_STM32F0_FSDEV_PVT_ST_H_
-#define PORTABLE_ST_STM32F0_DCD_STM32F0_FSDEV_PVT_ST_H_
-
-#if defined(STM32F042x6) || \
- defined(STM32F070x6) || defined(STM32F070xB) || \
- defined(STM32F072xB) || \
- defined(STM32F078xx)
- #include "stm32f0xx.h"
- #define PMA_LENGTH (1024u)
- // F0x2 models are crystal-less
- // All have internal D+ pull-up
- // 070RB: 2 x 16 bits/word memory LPM Support, BCD Support
- // PMA dedicated to USB (no sharing with CAN)
-
-#elif defined(STM32F1_FSDEV)
- #include "stm32f1xx.h"
- #define PMA_LENGTH (512u)
- // NO internal Pull-ups
- // *B, and *C: 2 x 16 bits/word
-
- // F1 names this differently from the rest
- #define USB_CNTR_LPMODE USB_CNTR_LP_MODE
-
-#elif defined(STM32F302xB) || defined(STM32F302xC) || \
- defined(STM32F303xB) || defined(STM32F303xC) || \
- defined(STM32F373xC)
- #include "stm32f3xx.h"
- #define PMA_LENGTH (512u)
- // NO internal Pull-ups
- // *B, and *C: 1 x 16 bits/word
- // PMA dedicated to USB (no sharing with CAN)
-
-#elif defined(STM32F302x6) || defined(STM32F302x8) || \
- defined(STM32F302xD) || defined(STM32F302xE) || \
- defined(STM32F303xD) || defined(STM32F303xE)
- #include "stm32f3xx.h"
- #define PMA_LENGTH (1024u)
- // NO internal Pull-ups
- // *6, *8, *D, and *E: 2 x 16 bits/word LPM Support
- // When CAN clock is enabled, USB can use first 768 bytes ONLY.
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32L0
- #include "stm32l0xx.h"
- #define PMA_LENGTH (1024u)
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32L1
- #include "stm32l1xx.h"
- #define PMA_LENGTH (512u)
-
-#else
- #error You are using an untested or unimplemented STM32 variant. Please update the driver.
- // This includes L1x0, L1x1, L1x2, L4x2 and L4x3, G1x1, G1x3, and G1x4
-#endif
-
-// For purposes of accessing the packet
-#if ((PMA_LENGTH) == 512u)
- #define PMA_STRIDE (2u)
-#elif ((PMA_LENGTH) == 1024u)
- #define PMA_STRIDE (1u)
-#endif
-
-// And for type-safety create a new macro for the volatile address of PMAADDR
-// The compiler should warn us if we cast it to a non-volatile type?
-// Volatile is also needed to prevent the optimizer from changing access to 32-bit (as 32-bit access is forbidden)
-static __IO uint16_t * const pma = (__IO uint16_t*)USB_PMAADDR;
-
-// prototypes
-static inline __IO uint16_t* pcd_ep_rx_cnt_ptr(USB_TypeDef * USBx, uint32_t bEpNum);
-static inline __IO uint16_t* pcd_ep_tx_cnt_ptr(USB_TypeDef * USBx, uint32_t bEpNum);
-static inline void pcd_set_endpoint(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wRegValue);
-
-
-/* SetENDPOINT */
-static inline void pcd_set_endpoint(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wRegValue)
-{
- __O uint16_t *reg = (__O uint16_t *)((&USBx->EP0R) + bEpNum*2u);
- *reg = (uint16_t)wRegValue;
-}
-
-/* GetENDPOINT */
-static inline uint16_t pcd_get_endpoint(USB_TypeDef * USBx, uint32_t bEpNum) {
- __I uint16_t *reg = (__I uint16_t *)((&USBx->EP0R) + bEpNum*2u);
- return *reg;
-}
-
-static inline void pcd_set_eptype(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wType)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- regVal &= (uint32_t)USB_EP_T_MASK;
- regVal |= wType;
- regVal |= USB_EP_CTR_RX | USB_EP_CTR_TX; // These clear on write0, so must set high
- pcd_set_endpoint(USBx, bEpNum, regVal);
-}
-
-static inline uint32_t pcd_get_eptype(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- regVal &= USB_EP_T_FIELD;
- return regVal;
-}
-/**
- * @brief Clears bit CTR_RX / CTR_TX in the endpoint register.
- * @param USBx USB peripheral instance register address.
- * @param bEpNum Endpoint Number.
- * @retval None
- */
-static inline void pcd_clear_rx_ep_ctr(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- regVal &= USB_EPREG_MASK;
- regVal &= ~USB_EP_CTR_RX;
- regVal |= USB_EP_CTR_TX; // preserve CTR_TX (clears on writing 0)
- pcd_set_endpoint(USBx, bEpNum, regVal);
-}
-static inline void pcd_clear_tx_ep_ctr(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- regVal &= USB_EPREG_MASK;
- regVal &= ~USB_EP_CTR_TX;
- regVal |= USB_EP_CTR_RX; // preserve CTR_RX (clears on writing 0)
- pcd_set_endpoint(USBx, bEpNum,regVal);
-}
-/**
- * @brief gets counter of the tx buffer.
- * @param USBx USB peripheral instance register address.
- * @param bEpNum Endpoint Number.
- * @retval Counter value
- */
-static inline uint32_t pcd_get_ep_tx_cnt(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- __I uint16_t *regPtr = pcd_ep_tx_cnt_ptr(USBx, bEpNum);
- return *regPtr & 0x3ffU;
-}
-
-static inline uint32_t pcd_get_ep_rx_cnt(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- __I uint16_t *regPtr = pcd_ep_rx_cnt_ptr(USBx, bEpNum);
- return *regPtr & 0x3ffU;
-}
-
-/**
- * @brief Sets counter of rx buffer with no. of blocks.
- * @param dwReg Register
- * @param wCount Counter.
- * @param wNBlocks no. of Blocks.
- * @retval None
- */
-
-static inline void pcd_set_ep_cnt_rx_reg(__O uint16_t * pdwReg, size_t wCount) {
- uint32_t wNBlocks;
- if(wCount > 62u)
- {
- wNBlocks = wCount >> 5u;
- if((wCount & 0x1fU) == 0u)
- {
- wNBlocks--;
- }
- wNBlocks = wNBlocks << 10u;
- wNBlocks |= 0x8000u; // Mark block size as 32byte
- *pdwReg = (uint16_t)wNBlocks;
- }
- else
- {
- wNBlocks = wCount >> 1u;
- if((wCount & 0x1U) != 0u)
- {
- wNBlocks++;
- }
- *pdwReg = (uint16_t)((wNBlocks) << 10u);
- }
-}
-
-
-/**
- * @brief Sets address in an endpoint register.
- * @param USBx USB peripheral instance register address.
- * @param bEpNum Endpoint Number.
- * @param bAddr Address.
- * @retval None
- */
-static inline void pcd_set_ep_address(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t bAddr)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- regVal &= USB_EPREG_MASK;
- regVal |= bAddr;
- regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX;
- pcd_set_endpoint(USBx, bEpNum,regVal);
-}
-
-static inline __IO uint16_t * pcd_btable_word_ptr(USB_TypeDef * USBx, size_t x)
-{
- size_t total_word_offset = (((USBx)->BTABLE)>>1) + x;
- total_word_offset *= PMA_STRIDE;
- return &(pma[total_word_offset]);
-}
-
-// Pointers to the PMA table entries (using the ARM address space)
-static inline __IO uint16_t* pcd_ep_tx_address_ptr(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- return pcd_btable_word_ptr(USBx,(bEpNum)*4u + 0u);
-}
-static inline __IO uint16_t* pcd_ep_tx_cnt_ptr(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- return pcd_btable_word_ptr(USBx,(bEpNum)*4u + 1u);
-}
-
-static inline __IO uint16_t* pcd_ep_rx_address_ptr(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- return pcd_btable_word_ptr(USBx,(bEpNum)*4u + 2u);
-}
-
-static inline __IO uint16_t* pcd_ep_rx_cnt_ptr(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- return pcd_btable_word_ptr(USBx,(bEpNum)*4u + 3u);
-}
-
-static inline void pcd_set_ep_tx_cnt(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wCount)
-{
- *pcd_ep_tx_cnt_ptr(USBx, bEpNum) = (uint16_t)wCount;
-}
-
-static inline void pcd_set_ep_rx_cnt(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wCount)
-{
- __IO uint16_t *pdwReg = pcd_ep_rx_cnt_ptr((USBx),(bEpNum));
- pcd_set_ep_cnt_rx_reg(pdwReg, wCount);
-}
-
-/**
- * @brief sets the status for tx transfer (bits STAT_TX[1:0]).
- * @param USBx USB peripheral instance register address.
- * @param bEpNum Endpoint Number.
- * @param wState new state
- * @retval None
- */
-static inline void pcd_set_ep_tx_status(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wState)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- regVal &= USB_EPTX_DTOGMASK;
-
- /* toggle first bit ? */
- if((USB_EPTX_DTOG1 & (wState))!= 0U)
- {
- regVal ^= USB_EPTX_DTOG1;
- }
- /* toggle second bit ? */
- if((USB_EPTX_DTOG2 & ((uint32_t)(wState)))!= 0U)
- {
- regVal ^= USB_EPTX_DTOG2;
- }
- regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX;
- pcd_set_endpoint(USBx, bEpNum, regVal);
-} /* pcd_set_ep_tx_status */
-
-/**
- * @brief sets the status for rx transfer (bits STAT_TX[1:0])
- * @param USBx USB peripheral instance register address.
- * @param bEpNum Endpoint Number.
- * @param wState new state
- * @retval None
- */
-
-static inline void pcd_set_ep_rx_status(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wState)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- regVal &= USB_EPRX_DTOGMASK;
-
- /* toggle first bit ? */
- if((USB_EPRX_DTOG1 & wState)!= 0U)
- {
- regVal ^= USB_EPRX_DTOG1;
- }
- /* toggle second bit ? */
- if((USB_EPRX_DTOG2 & wState)!= 0U)
- {
- regVal ^= USB_EPRX_DTOG2;
- }
- regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX;
- pcd_set_endpoint(USBx, bEpNum, regVal);
-} /* pcd_set_ep_rx_status */
-
-static inline uint32_t pcd_get_ep_rx_status(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- return (regVal & USB_EPRX_STAT) >> (12u);
-} /* pcd_get_ep_rx_status */
-
-
-/**
- * @brief Toggles DTOG_RX / DTOG_TX bit in the endpoint register.
- * @param USBx USB peripheral instance register address.
- * @param bEpNum Endpoint Number.
- * @retval None
- */
-static inline void pcd_rx_dtog(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- regVal &= USB_EPREG_MASK;
- regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX|USB_EP_DTOG_RX;
- pcd_set_endpoint(USBx, bEpNum, regVal);
-}
-
-static inline void pcd_tx_dtog(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- regVal &= USB_EPREG_MASK;
- regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX|USB_EP_DTOG_TX;
- pcd_set_endpoint(USBx, bEpNum, regVal);
-}
-
-/**
- * @brief Clears DTOG_RX / DTOG_TX bit in the endpoint register.
- * @param USBx USB peripheral instance register address.
- * @param bEpNum Endpoint Number.
- * @retval None
- */
-
-static inline void pcd_clear_rx_dtog(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- if((regVal & USB_EP_DTOG_RX) != 0)
- {
- pcd_rx_dtog(USBx,bEpNum);
- }
-}
-
-static inline void pcd_clear_tx_dtog(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- if((regVal & USB_EP_DTOG_TX) != 0)
- {
- pcd_tx_dtog(USBx,bEpNum);
- }
-}
-
-/**
- * @brief set & clear EP_KIND bit.
- * @param USBx USB peripheral instance register address.
- * @param bEpNum Endpoint Number.
- * @retval None
- */
-
-static inline void pcd_set_ep_kind(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- regVal |= USB_EP_KIND;
- regVal &= USB_EPREG_MASK;
- regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX;
- pcd_set_endpoint(USBx, bEpNum, regVal);
-}
-static inline void pcd_clear_ep_kind(USB_TypeDef * USBx, uint32_t bEpNum)
-{
- uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
- regVal &= USB_EPKIND_MASK;
- regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX;
- pcd_set_endpoint(USBx, bEpNum, regVal);
-}
-
-// This checks if the device has "LPM"
-#if defined(USB_ISTR_L1REQ)
-#define USB_ISTR_L1REQ_FORCED (USB_ISTR_L1REQ)
-#else
-#define USB_ISTR_L1REQ_FORCED ((uint16_t)0x0000U)
-#endif
-
-#define USB_ISTR_ALL_EVENTS (USB_ISTR_PMAOVR | USB_ISTR_ERR | USB_ISTR_WKUP | USB_ISTR_SUSP | \
- USB_ISTR_RESET | USB_ISTR_SOF | USB_ISTR_ESOF | USB_ISTR_L1REQ_FORCED )
-
-// Number of endpoints in hardware
-#define STFSDEV_EP_COUNT (8u)
-
-#endif /* PORTABLE_ST_STM32F0_DCD_STM32F0_FSDEV_PVT_ST_H_ */
diff --git a/tinyusb/src/portable/st/synopsys/dcd_synopsys.c b/tinyusb/src/portable/st/synopsys/dcd_synopsys.c
deleted file mode 100755
index 8a998aa3..00000000
--- a/tinyusb/src/portable/st/synopsys/dcd_synopsys.c
+++ /dev/null
@@ -1,1186 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018 Scott Shawcroft, 2019 William D. Jones for Adafruit Industries
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- * Copyright (c) 2020 Jan Duempelmann
- * Copyright (c) 2020 Reinhard Panhuber
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-// Since TinyUSB doesn't use SOF for now, and this interrupt too often (1ms interval)
-// We disable SOF for now until needed later on
-#define USE_SOF 0
-
-#if defined (STM32F105x8) || defined (STM32F105xB) || defined (STM32F105xC) || \
- defined (STM32F107xB) || defined (STM32F107xC)
-#define STM32F1_SYNOPSYS
-#endif
-
-#if defined (STM32L475xx) || defined (STM32L476xx) || \
- defined (STM32L485xx) || defined (STM32L486xx) || defined (STM32L496xx) || \
- defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || \
- defined (STM32L4S5xx) || defined (STM32L4S7xx) || defined (STM32L4S9xx)
-#define STM32L4_SYNOPSYS
-#endif
-
-#if TUSB_OPT_DEVICE_ENABLED && \
- ( (CFG_TUSB_MCU == OPT_MCU_STM32F1 && defined(STM32F1_SYNOPSYS)) || \
- CFG_TUSB_MCU == OPT_MCU_STM32F2 || \
- CFG_TUSB_MCU == OPT_MCU_STM32F4 || \
- CFG_TUSB_MCU == OPT_MCU_STM32F7 || \
- CFG_TUSB_MCU == OPT_MCU_STM32H7 || \
- (CFG_TUSB_MCU == OPT_MCU_STM32L4 && defined(STM32L4_SYNOPSYS) || \
- CFG_TUSB_MCU == OPT_MCU_GD32VF103 ) \
- )
-
-// EP_MAX : Max number of bi-directional endpoints including EP0
-// EP_FIFO_SIZE : Size of dedicated USB SRAM
-#if CFG_TUSB_MCU == OPT_MCU_STM32F1
-#include "stm32f1xx.h"
-#define EP_MAX_FS 4
-#define EP_FIFO_SIZE_FS 1280
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F2
-#include "stm32f2xx.h"
-#define EP_MAX_FS USB_OTG_FS_MAX_IN_ENDPOINTS
-#define EP_FIFO_SIZE_FS USB_OTG_FS_TOTAL_FIFO_SIZE
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F4
-#include "stm32f4xx.h"
-#define EP_MAX_FS USB_OTG_FS_MAX_IN_ENDPOINTS
-#define EP_FIFO_SIZE_FS USB_OTG_FS_TOTAL_FIFO_SIZE
-#define EP_MAX_HS USB_OTG_HS_MAX_IN_ENDPOINTS
-#define EP_FIFO_SIZE_HS USB_OTG_HS_TOTAL_FIFO_SIZE
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32H7
-#include "stm32h7xx.h"
-#define EP_MAX_FS 9
-#define EP_FIFO_SIZE_FS 4096
-#define EP_MAX_HS 9
-#define EP_FIFO_SIZE_HS 4096
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32F7
-#include "stm32f7xx.h"
-#define EP_MAX_FS 6
-#define EP_FIFO_SIZE_FS 1280
-#define EP_MAX_HS 9
-#define EP_FIFO_SIZE_HS 4096
-
-#elif CFG_TUSB_MCU == OPT_MCU_STM32L4
-#include "stm32l4xx.h"
-#define EP_MAX_FS 6
-#define EP_FIFO_SIZE_FS 1280
-
-#elif CFG_TUSB_MCU == OPT_MCU_GD32VF103
-#include "synopsys_common.h"
-
-// These numbers are the same for the whole GD32VF103 family.
-#define OTG_FS_IRQn 86
-#define EP_MAX_FS 4
-#define EP_FIFO_SIZE_FS 1280
-
-// The GD32VF103 is a RISC-V MCU, which implements the ECLIC Core-Local
-// Interrupt Controller by Nuclei. It is nearly API compatible to the
-// NVIC used by ARM MCUs.
-#define ECLIC_INTERRUPT_ENABLE_BASE 0xD2001001UL
-
-#define NVIC_EnableIRQ __eclic_enable_interrupt
-#define NVIC_DisableIRQ __eclic_disable_interrupt
-
-static inline void __eclic_enable_interrupt (uint32_t irq) {
- *(volatile uint8_t*)(ECLIC_INTERRUPT_ENABLE_BASE + (irq * 4)) = 1;
-}
-
-static inline void __eclic_disable_interrupt (uint32_t irq){
- *(volatile uint8_t*)(ECLIC_INTERRUPT_ENABLE_BASE + (irq * 4)) = 0;
-}
-
-#else
-#error "Unsupported MCUs"
-#endif
-
-#include "device/dcd.h"
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM
-//--------------------------------------------------------------------+
-
-// On STM32 we associate Port0 to OTG_FS, and Port1 to OTG_HS
-#if TUD_OPT_RHPORT == 0
-#define EP_MAX EP_MAX_FS
-#define EP_FIFO_SIZE EP_FIFO_SIZE_FS
-#define RHPORT_REGS_BASE USB_OTG_FS_PERIPH_BASE
-#define RHPORT_IRQn OTG_FS_IRQn
-
-#else
-#define EP_MAX EP_MAX_HS
-#define EP_FIFO_SIZE EP_FIFO_SIZE_HS
-#define RHPORT_REGS_BASE USB_OTG_HS_PERIPH_BASE
-#define RHPORT_IRQn OTG_HS_IRQn
-
-#endif
-
-#define GLOBAL_BASE(_port) ((USB_OTG_GlobalTypeDef*) RHPORT_REGS_BASE)
-#define DEVICE_BASE(_port) (USB_OTG_DeviceTypeDef *) (RHPORT_REGS_BASE + USB_OTG_DEVICE_BASE)
-#define OUT_EP_BASE(_port) (USB_OTG_OUTEndpointTypeDef *) (RHPORT_REGS_BASE + USB_OTG_OUT_ENDPOINT_BASE)
-#define IN_EP_BASE(_port) (USB_OTG_INEndpointTypeDef *) (RHPORT_REGS_BASE + USB_OTG_IN_ENDPOINT_BASE)
-#define FIFO_BASE(_port, _x) ((volatile uint32_t *) (RHPORT_REGS_BASE + USB_OTG_FIFO_BASE + (_x) * USB_OTG_FIFO_SIZE))
-
-enum
-{
- DCD_HIGH_SPEED = 0, // Highspeed mode
- DCD_FULL_SPEED_USE_HS = 1, // Full speed in Highspeed port (probably with internal PHY)
- DCD_FULL_SPEED = 3, // Full speed with internal PHY
-};
-
-static TU_ATTR_ALIGNED(4) uint32_t _setup_packet[2];
-
-typedef struct {
- uint8_t * buffer;
- tu_fifo_t * ff;
- uint16_t total_len;
- uint16_t max_size;
- uint8_t interval;
-} xfer_ctl_t;
-
-typedef volatile uint32_t * usb_fifo_t;
-
-xfer_ctl_t xfer_status[EP_MAX][2];
-#define XFER_CTL_BASE(_ep, _dir) &xfer_status[_ep][_dir]
-
-// EP0 transfers are limited to 1 packet - larger sizes has to be split
-static uint16_t ep0_pending[2]; // Index determines direction as tusb_dir_t type
-
-// TX FIFO RAM allocation so far in words - RX FIFO size is readily available from usb_otg->GRXFSIZ
-static uint16_t _allocated_fifo_words_tx; // TX FIFO size in words (IN EPs)
-static bool _out_ep_closed; // Flag to check if RX FIFO size needs an update (reduce its size)
-
-// Calculate the RX FIFO size according to recommendations from reference manual
-static inline uint16_t calc_rx_ff_size(uint16_t ep_size)
-{
- return 15 + 2*(ep_size/4) + 2*EP_MAX;
-}
-
-static void update_grxfsiz(uint8_t rhport)
-{
- (void) rhport;
-
- USB_OTG_GlobalTypeDef * usb_otg = GLOBAL_BASE(rhport);
-
- // Determine largest EP size for RX FIFO
- uint16_t max_epsize = 0;
- for (uint8_t epnum = 0; epnum < EP_MAX; epnum++)
- {
- max_epsize = tu_max16(max_epsize, xfer_status[epnum][TUSB_DIR_OUT].max_size);
- }
-
- // Update size of RX FIFO
- usb_otg->GRXFSIZ = calc_rx_ff_size(max_epsize);
-}
-
-// Setup the control endpoint 0.
-static void bus_reset(uint8_t rhport)
-{
- (void) rhport;
-
- USB_OTG_GlobalTypeDef * usb_otg = GLOBAL_BASE(rhport);
- USB_OTG_DeviceTypeDef * dev = DEVICE_BASE(rhport);
- USB_OTG_OUTEndpointTypeDef * out_ep = OUT_EP_BASE(rhport);
- USB_OTG_INEndpointTypeDef * in_ep = IN_EP_BASE(rhport);
-
- tu_memclr(xfer_status, sizeof(xfer_status));
- _out_ep_closed = false;
-
- for(uint8_t n = 0; n < EP_MAX; n++) {
- out_ep[n].DOEPCTL |= USB_OTG_DOEPCTL_SNAK;
- }
-
- // clear device address
- dev->DCFG &= ~USB_OTG_DCFG_DAD_Msk;
-
- // TODO should probably assign value when reset rather than OR
- dev->DAINTMSK |= (1 << USB_OTG_DAINTMSK_OEPM_Pos) | (1 << USB_OTG_DAINTMSK_IEPM_Pos);
- dev->DOEPMSK |= USB_OTG_DOEPMSK_STUPM | USB_OTG_DOEPMSK_XFRCM;
- dev->DIEPMSK |= USB_OTG_DIEPMSK_TOM | USB_OTG_DIEPMSK_XFRCM;
-
- // "USB Data FIFOs" section in reference manual
- // Peripheral FIFO architecture
- //
- // The FIFO is split up in a lower part where the RX FIFO is located and an upper part where the TX FIFOs start.
- // We do this to allow the RX FIFO to grow dynamically which is possible since the free space is located
- // between the RX and TX FIFOs. This is required by ISO OUT EPs which need a bigger FIFO than the standard
- // configuration done below.
- //
- // Dynamically FIFO sizes are of interest only for ISO EPs since all others are usually not opened and closed.
- // All EPs other than ISO are opened as soon as the driver starts up i.e. when the host sends a
- // configure interface command. Hence, all IN EPs other the ISO will be located at the top. IN ISO EPs are usually
- // opened when the host sends an additional command: setInterface. At this point in time
- // the ISO EP will be located next to the free space and can change its size. In case more IN EPs change its size
- // an additional memory
- //
- // --------------- 320 or 1024 ( 1280 or 4096 bytes )
- // | IN FIFO 0 |
- // --------------- (320 or 1024) - 16
- // | IN FIFO 1 |
- // --------------- (320 or 1024) - 16 - x
- // | . . . . |
- // --------------- (320 or 1024) - 16 - x - y - ... - z
- // | IN FIFO MAX |
- // ---------------
- // | FREE |
- // --------------- GRXFSIZ
- // | OUT FIFO |
- // | ( Shared ) |
- // --------------- 0
- //
- // According to "FIFO RAM allocation" section in RM, FIFO RAM are allocated as follows (each word 32-bits):
- // - Each EP IN needs at least max packet size, 16 words is sufficient for EP0 IN
- //
- // - All EP OUT shared a unique OUT FIFO which uses
- // - 13 for setup packets + control words (up to 3 setup packets).
- // - 1 for global NAK (not required/used here).
- // - Largest-EPsize / 4 + 1. ( FS: 64 bytes, HS: 512 bytes). Recommended is "2 x (Largest-EPsize/4) + 1"
- // - 2 for each used OUT endpoint
- //
- // Therefore GRXFSIZ = 13 + 1 + 1 + 2 x (Largest-EPsize/4) + 2 x EPOUTnum
- // - FullSpeed (64 Bytes ): GRXFSIZ = 15 + 2 x 16 + 2 x EP_MAX = 47 + 2 x EP_MAX
- // - Highspeed (512 bytes): GRXFSIZ = 15 + 2 x 128 + 2 x EP_MAX = 271 + 2 x EP_MAX
- //
- // NOTE: Largest-EPsize & EPOUTnum is actual used endpoints in configuration. Since DCD has no knowledge
- // of the overall picture yet. We will use the worst scenario: largest possible + EP_MAX
- //
- // For Isochronous, largest EP size can be 1023/1024 for FS/HS respectively. In addition if multiple ISO
- // are enabled at least "2 x (Largest-EPsize/4) + 1" are recommended. Maybe provide a macro for application to
- // overwrite this.
-
- usb_otg->GRXFSIZ = calc_rx_ff_size(TUD_OPT_HIGH_SPEED ? 512 : 64);
-
- _allocated_fifo_words_tx = 16;
-
- // Control IN uses FIFO 0 with 64 bytes ( 16 32-bit word )
- usb_otg->DIEPTXF0_HNPTXFSIZ = (16 << USB_OTG_TX0FD_Pos) | (EP_FIFO_SIZE/4 - _allocated_fifo_words_tx);
-
- // Fixed control EP0 size to 64 bytes
- in_ep[0].DIEPCTL &= ~(0x03 << USB_OTG_DIEPCTL_MPSIZ_Pos);
- xfer_status[0][TUSB_DIR_OUT].max_size = xfer_status[0][TUSB_DIR_IN].max_size = 64;
-
- out_ep[0].DOEPTSIZ |= (3 << USB_OTG_DOEPTSIZ_STUPCNT_Pos);
-
- usb_otg->GINTMSK |= USB_OTG_GINTMSK_OEPINT | USB_OTG_GINTMSK_IEPINT;
-}
-
-// Set turn-around timeout according to link speed
-extern uint32_t SystemCoreClock;
-static void set_turnaround(USB_OTG_GlobalTypeDef * usb_otg, tusb_speed_t speed)
-{
- usb_otg->GUSBCFG &= ~USB_OTG_GUSBCFG_TRDT;
-
- if ( speed == TUSB_SPEED_HIGH )
- {
- // Use fixed 0x09 for Highspeed
- usb_otg->GUSBCFG |= (0x09 << USB_OTG_GUSBCFG_TRDT_Pos);
- }
- else
- {
- // Turnaround timeout depends on the MCU clock
- uint32_t turnaround;
-
- TU_LOG_INT(2, SystemCoreClock);
-
- if ( SystemCoreClock >= 32000000U )
- turnaround = 0x6U;
- else if ( SystemCoreClock >= 27500000U )
- turnaround = 0x7U;
- else if ( SystemCoreClock >= 24000000U )
- turnaround = 0x8U;
- else if ( SystemCoreClock >= 21800000U )
- turnaround = 0x9U;
- else if ( SystemCoreClock >= 20000000U )
- turnaround = 0xAU;
- else if ( SystemCoreClock >= 18500000U )
- turnaround = 0xBU;
- else if ( SystemCoreClock >= 17200000U )
- turnaround = 0xCU;
- else if ( SystemCoreClock >= 16000000U )
- turnaround = 0xDU;
- else if ( SystemCoreClock >= 15000000U )
- turnaround = 0xEU;
- else
- turnaround = 0xFU;
-
- // Fullspeed depends on MCU clocks, but we will use 0x06 for 32+ Mhz
- usb_otg->GUSBCFG |= (turnaround << USB_OTG_GUSBCFG_TRDT_Pos);
- }
-}
-
-static tusb_speed_t get_speed(uint8_t rhport)
-{
- (void) rhport;
- USB_OTG_DeviceTypeDef * dev = DEVICE_BASE(rhport);
- uint32_t const enum_spd = (dev->DSTS & USB_OTG_DSTS_ENUMSPD_Msk) >> USB_OTG_DSTS_ENUMSPD_Pos;
- return (enum_spd == DCD_HIGH_SPEED) ? TUSB_SPEED_HIGH : TUSB_SPEED_FULL;
-}
-
-static void set_speed(uint8_t rhport, tusb_speed_t speed)
-{
- uint32_t bitvalue;
-
- if ( rhport == 1 )
- {
- bitvalue = ((TUSB_SPEED_HIGH == speed) ? DCD_HIGH_SPEED : DCD_FULL_SPEED_USE_HS);
- }
- else
- {
- bitvalue = DCD_FULL_SPEED;
- }
-
- USB_OTG_DeviceTypeDef * dev = DEVICE_BASE(rhport);
-
- // Clear and set speed bits
- dev->DCFG &= ~(3 << USB_OTG_DCFG_DSPD_Pos);
- dev->DCFG |= (bitvalue << USB_OTG_DCFG_DSPD_Pos);
-}
-
-#if defined(USB_HS_PHYC)
-static bool USB_HS_PHYCInit(void)
-{
- USB_HS_PHYC_GlobalTypeDef *usb_hs_phyc = (USB_HS_PHYC_GlobalTypeDef*) USB_HS_PHYC_CONTROLLER_BASE;
-
- // Enable LDO
- usb_hs_phyc->USB_HS_PHYC_LDO |= USB_HS_PHYC_LDO_ENABLE;
-
- // Wait until LDO ready
- while ( 0 == (usb_hs_phyc->USB_HS_PHYC_LDO & USB_HS_PHYC_LDO_STATUS) ) {}
-
- uint32_t phyc_pll = 0;
-
- // TODO Try to get HSE_VALUE from registers instead of depending CFLAGS
- switch ( HSE_VALUE )
- {
- case 12000000: phyc_pll = USB_HS_PHYC_PLL1_PLLSEL_12MHZ ; break;
- case 12500000: phyc_pll = USB_HS_PHYC_PLL1_PLLSEL_12_5MHZ ; break;
- case 16000000: phyc_pll = USB_HS_PHYC_PLL1_PLLSEL_16MHZ ; break;
- case 24000000: phyc_pll = USB_HS_PHYC_PLL1_PLLSEL_24MHZ ; break;
- case 25000000: phyc_pll = USB_HS_PHYC_PLL1_PLLSEL_25MHZ ; break;
- case 32000000: phyc_pll = USB_HS_PHYC_PLL1_PLLSEL_Msk ; break; // Value not defined in header
- default:
- TU_ASSERT(0);
- }
- usb_hs_phyc->USB_HS_PHYC_PLL = phyc_pll;
-
- // Control the tuning interface of the High Speed PHY
- // Use magic value (USB_HS_PHYC_TUNE_VALUE) from ST driver
- usb_hs_phyc->USB_HS_PHYC_TUNE |= 0x00000F13U;
-
- // Enable PLL internal PHY
- usb_hs_phyc->USB_HS_PHYC_PLL |= USB_HS_PHYC_PLL_PLLEN;
-
- // Original ST code has 2 ms delay for PLL stabilization.
- // Primitive test shows that more than 10 USB un/replug cycle showed no error with enumeration
-
- return true;
-}
-#endif
-
-static void edpt_schedule_packets(uint8_t rhport, uint8_t const epnum, uint8_t const dir, uint16_t const num_packets, uint16_t total_bytes)
-{
- (void) rhport;
-
- USB_OTG_DeviceTypeDef * dev = DEVICE_BASE(rhport);
- USB_OTG_OUTEndpointTypeDef * out_ep = OUT_EP_BASE(rhport);
- USB_OTG_INEndpointTypeDef * in_ep = IN_EP_BASE(rhport);
-
- // EP0 is limited to one packet each xfer
- // We use multiple transaction of xfer->max_size length to get a whole transfer done
- if(epnum == 0) {
- xfer_ctl_t * const xfer = XFER_CTL_BASE(epnum, dir);
- total_bytes = tu_min16(ep0_pending[dir], xfer->max_size);
- ep0_pending[dir] -= total_bytes;
- }
-
- // IN and OUT endpoint xfers are interrupt-driven, we just schedule them here.
- if(dir == TUSB_DIR_IN) {
- // A full IN transfer (multiple packets, possibly) triggers XFRC.
- in_ep[epnum].DIEPTSIZ = (num_packets << USB_OTG_DIEPTSIZ_PKTCNT_Pos) |
- ((total_bytes << USB_OTG_DIEPTSIZ_XFRSIZ_Pos) & USB_OTG_DIEPTSIZ_XFRSIZ_Msk);
-
- in_ep[epnum].DIEPCTL |= USB_OTG_DIEPCTL_EPENA | USB_OTG_DIEPCTL_CNAK;
- // For ISO endpoint set correct odd/even bit for next frame.
- if ((in_ep[epnum].DIEPCTL & USB_OTG_DIEPCTL_EPTYP) == USB_OTG_DIEPCTL_EPTYP_0 && (XFER_CTL_BASE(epnum, dir))->interval == 1)
- {
- // Take odd/even bit from frame counter.
- uint32_t const odd_frame_now = (dev->DSTS & (1u << USB_OTG_DSTS_FNSOF_Pos));
- in_ep[epnum].DIEPCTL |= (odd_frame_now ? USB_OTG_DIEPCTL_SD0PID_SEVNFRM_Msk : USB_OTG_DIEPCTL_SODDFRM_Msk);
- }
- // Enable fifo empty interrupt only if there are something to put in the fifo.
- if(total_bytes != 0) {
- dev->DIEPEMPMSK |= (1 << epnum);
- }
- } else {
- // A full OUT transfer (multiple packets, possibly) triggers XFRC.
- out_ep[epnum].DOEPTSIZ &= ~(USB_OTG_DOEPTSIZ_PKTCNT_Msk | USB_OTG_DOEPTSIZ_XFRSIZ);
- out_ep[epnum].DOEPTSIZ |= (num_packets << USB_OTG_DOEPTSIZ_PKTCNT_Pos) |
- ((total_bytes << USB_OTG_DOEPTSIZ_XFRSIZ_Pos) & USB_OTG_DOEPTSIZ_XFRSIZ_Msk);
-
- out_ep[epnum].DOEPCTL |= USB_OTG_DOEPCTL_EPENA | USB_OTG_DOEPCTL_CNAK;
- if ((out_ep[epnum].DOEPCTL & USB_OTG_DOEPCTL_EPTYP) == USB_OTG_DOEPCTL_EPTYP_0 && (XFER_CTL_BASE(epnum, dir))->interval == 1)
- {
- // Take odd/even bit from frame counter.
- uint32_t const odd_frame_now = (dev->DSTS & (1u << USB_OTG_DSTS_FNSOF_Pos));
- out_ep[epnum].DOEPCTL |= (odd_frame_now ? USB_OTG_DOEPCTL_SD0PID_SEVNFRM_Msk : USB_OTG_DOEPCTL_SODDFRM_Msk);
- }
- }
-}
-
-/*------------------------------------------------------------------*/
-/* Controller API
- *------------------------------------------------------------------*/
-void dcd_init (uint8_t rhport)
-{
- // Programming model begins in the last section of the chapter on the USB
- // peripheral in each Reference Manual.
-
- USB_OTG_GlobalTypeDef * usb_otg = GLOBAL_BASE(rhport);
-
- // No HNP/SRP (no OTG support), program timeout later.
- if ( rhport == 1 )
- {
- // On selected MCUs HS port1 can be used with external PHY via ULPI interface
-#if CFG_TUSB_RHPORT1_MODE & OPT_MODE_HIGH_SPEED
- // deactivate internal PHY
- usb_otg->GCCFG &= ~USB_OTG_GCCFG_PWRDWN;
-
- // Init The UTMI Interface
- usb_otg->GUSBCFG &= ~(USB_OTG_GUSBCFG_TSDPS | USB_OTG_GUSBCFG_ULPIFSLS | USB_OTG_GUSBCFG_PHYSEL);
-
- // Select default internal VBUS Indicator and Drive for ULPI
- usb_otg->GUSBCFG &= ~(USB_OTG_GUSBCFG_ULPIEVBUSD | USB_OTG_GUSBCFG_ULPIEVBUSI);
-#else
- usb_otg->GUSBCFG |= USB_OTG_GUSBCFG_PHYSEL;
-#endif
-
-#if defined(USB_HS_PHYC)
- // Highspeed with embedded UTMI PHYC
-
- // Select UTMI Interface
- usb_otg->GUSBCFG &= ~USB_OTG_GUSBCFG_ULPI_UTMI_SEL;
- usb_otg->GCCFG |= USB_OTG_GCCFG_PHYHSEN;
-
- // Enables control of a High Speed USB PHY
- USB_HS_PHYCInit();
-#endif
- } else
- {
- // Enable internal PHY
- usb_otg->GUSBCFG |= USB_OTG_GUSBCFG_PHYSEL;
- }
-
- // Reset core after selecting PHY
- // Wait AHB IDLE, reset then wait until it is cleared
- while ((usb_otg->GRSTCTL & USB_OTG_GRSTCTL_AHBIDL) == 0U) {}
- usb_otg->GRSTCTL |= USB_OTG_GRSTCTL_CSRST;
- while ((usb_otg->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST) {}
-
- // Restart PHY clock
- *((volatile uint32_t *)(RHPORT_REGS_BASE + USB_OTG_PCGCCTL_BASE)) = 0;
-
- // Clear all interrupts
- usb_otg->GINTSTS |= usb_otg->GINTSTS;
-
- // Required as part of core initialization.
- // TODO: How should mode mismatch be handled? It will cause
- // the core to stop working/require reset.
- usb_otg->GINTMSK |= USB_OTG_GINTMSK_OTGINT | USB_OTG_GINTMSK_MMISM;
-
- USB_OTG_DeviceTypeDef * dev = DEVICE_BASE(rhport);
-
- // If USB host misbehaves during status portion of control xfer
- // (non zero-length packet), send STALL back and discard.
- dev->DCFG |= USB_OTG_DCFG_NZLSOHSK;
-
- set_speed(rhport, TUD_OPT_HIGH_SPEED ? TUSB_SPEED_HIGH : TUSB_SPEED_FULL);
-
- // Enable internal USB transceiver, unless using HS core (port 1) with external PHY.
- if (!(rhport == 1 && (CFG_TUSB_RHPORT1_MODE & OPT_MODE_HIGH_SPEED))) usb_otg->GCCFG |= USB_OTG_GCCFG_PWRDWN;
-
- usb_otg->GINTMSK |= USB_OTG_GINTMSK_USBRST | USB_OTG_GINTMSK_ENUMDNEM |
- USB_OTG_GINTMSK_USBSUSPM | USB_OTG_GINTMSK_WUIM |
- USB_OTG_GINTMSK_RXFLVLM | (USE_SOF ? USB_OTG_GINTMSK_SOFM : 0);
-
- // Enable global interrupt
- usb_otg->GAHBCFG |= USB_OTG_GAHBCFG_GINT;
-
- dcd_connect(rhport);
-}
-
-void dcd_int_enable (uint8_t rhport)
-{
- (void) rhport;
- NVIC_EnableIRQ(RHPORT_IRQn);
-}
-
-void dcd_int_disable (uint8_t rhport)
-{
- (void) rhport;
- NVIC_DisableIRQ(RHPORT_IRQn);
-}
-
-void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
-{
- USB_OTG_DeviceTypeDef * dev = DEVICE_BASE(rhport);
- dev->DCFG = (dev->DCFG & ~USB_OTG_DCFG_DAD_Msk) | (dev_addr << USB_OTG_DCFG_DAD_Pos);
-
- // Response with status after changing device address
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
-
- // TODO must manually clear this bit after 1-15 ms
- // USB_OTG_DeviceTypeDef * dev = DEVICE_BASE(rhport);
- // dev->DCTL |= USB_OTG_DCTL_RWUSIG;
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- USB_OTG_DeviceTypeDef * dev = DEVICE_BASE(rhport);
- dev->DCTL &= ~USB_OTG_DCTL_SDIS;
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- USB_OTG_DeviceTypeDef * dev = DEVICE_BASE(rhport);
- dev->DCTL |= USB_OTG_DCTL_SDIS;
-}
-
-
-/*------------------------------------------------------------------*/
-/* DCD Endpoint port
- *------------------------------------------------------------------*/
-
-bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
-{
- (void) rhport;
-
- USB_OTG_GlobalTypeDef * usb_otg = GLOBAL_BASE(rhport);
- USB_OTG_DeviceTypeDef * dev = DEVICE_BASE(rhport);
- USB_OTG_OUTEndpointTypeDef * out_ep = OUT_EP_BASE(rhport);
- USB_OTG_INEndpointTypeDef * in_ep = IN_EP_BASE(rhport);
-
- uint8_t const epnum = tu_edpt_number(desc_edpt->bEndpointAddress);
- uint8_t const dir = tu_edpt_dir(desc_edpt->bEndpointAddress);
-
- TU_ASSERT(epnum < EP_MAX);
-
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
- xfer->max_size = desc_edpt->wMaxPacketSize.size;
- xfer->interval = desc_edpt->bInterval;
-
- uint16_t const fifo_size = (desc_edpt->wMaxPacketSize.size + 3) / 4; // Round up to next full word
-
- if(dir == TUSB_DIR_OUT)
- {
- // Calculate required size of RX FIFO
- uint16_t const sz = calc_rx_ff_size(4*fifo_size);
-
- // If size_rx needs to be extended check if possible and if so enlarge it
- if (usb_otg->GRXFSIZ < sz)
- {
- TU_ASSERT(sz + _allocated_fifo_words_tx <= EP_FIFO_SIZE/4);
-
- // Enlarge RX FIFO
- usb_otg->GRXFSIZ = sz;
- }
-
- out_ep[epnum].DOEPCTL |= (1 << USB_OTG_DOEPCTL_USBAEP_Pos) |
- (desc_edpt->bmAttributes.xfer << USB_OTG_DOEPCTL_EPTYP_Pos) |
- (desc_edpt->wMaxPacketSize.size << USB_OTG_DOEPCTL_MPSIZ_Pos);
-
- dev->DAINTMSK |= (1 << (USB_OTG_DAINTMSK_OEPM_Pos + epnum));
- }
- else
- {
- // "USB Data FIFOs" section in reference manual
- // Peripheral FIFO architecture
- //
- // --------------- 320 or 1024 ( 1280 or 4096 bytes )
- // | IN FIFO 0 |
- // --------------- (320 or 1024) - 16
- // | IN FIFO 1 |
- // --------------- (320 or 1024) - 16 - x
- // | . . . . |
- // --------------- (320 or 1024) - 16 - x - y - ... - z
- // | IN FIFO MAX |
- // ---------------
- // | FREE |
- // --------------- GRXFSIZ
- // | OUT FIFO |
- // | ( Shared ) |
- // --------------- 0
- //
- // In FIFO is allocated by following rules:
- // - IN EP 1 gets FIFO 1, IN EP "n" gets FIFO "n".
-
- // Check if free space is available
- TU_ASSERT(_allocated_fifo_words_tx + fifo_size + usb_otg->GRXFSIZ <= EP_FIFO_SIZE/4);
-
- _allocated_fifo_words_tx += fifo_size;
-
- TU_LOG(2, " Allocated %u bytes at offset %u", fifo_size*4, EP_FIFO_SIZE-_allocated_fifo_words_tx*4);
-
- // DIEPTXF starts at FIFO #1.
- // Both TXFD and TXSA are in unit of 32-bit words.
- usb_otg->DIEPTXF[epnum - 1] = (fifo_size << USB_OTG_DIEPTXF_INEPTXFD_Pos) | (EP_FIFO_SIZE/4 - _allocated_fifo_words_tx);
-
- in_ep[epnum].DIEPCTL |= (1 << USB_OTG_DIEPCTL_USBAEP_Pos) |
- (epnum << USB_OTG_DIEPCTL_TXFNUM_Pos) |
- (desc_edpt->bmAttributes.xfer << USB_OTG_DIEPCTL_EPTYP_Pos) |
- (desc_edpt->bmAttributes.xfer != TUSB_XFER_ISOCHRONOUS ? USB_OTG_DOEPCTL_SD0PID_SEVNFRM : 0) |
- (desc_edpt->wMaxPacketSize.size << USB_OTG_DIEPCTL_MPSIZ_Pos);
-
- dev->DAINTMSK |= (1 << (USB_OTG_DAINTMSK_IEPM_Pos + epnum));
- }
-
- return true;
-}
-
-bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
- xfer->buffer = buffer;
- xfer->ff = NULL;
- xfer->total_len = total_bytes;
-
- // EP0 can only handle one packet
- if(epnum == 0) {
- ep0_pending[dir] = total_bytes;
- // Schedule the first transaction for EP0 transfer
- edpt_schedule_packets(rhport, epnum, dir, 1, ep0_pending[dir]);
- return true;
- }
-
- uint16_t num_packets = (total_bytes / xfer->max_size);
- uint16_t const short_packet_size = total_bytes % xfer->max_size;
-
- // Zero-size packet is special case.
- if(short_packet_size > 0 || (total_bytes == 0)) {
- num_packets++;
- }
-
- // Schedule packets to be sent within interrupt
- edpt_schedule_packets(rhport, epnum, dir, num_packets, total_bytes);
-
- return true;
-}
-
-// The number of bytes has to be given explicitly to allow more flexible control of how many
-// bytes should be written and second to keep the return value free to give back a boolean
-// success message. If total_bytes is too big, the FIFO will copy only what is available
-// into the USB buffer!
-bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
-{
- // USB buffers always work in bytes so to avoid unnecessary divisions we demand item_size = 1
- TU_ASSERT(ff->item_size == 1);
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
- xfer->buffer = NULL;
- xfer->ff = ff;
- xfer->total_len = total_bytes;
-
- uint16_t num_packets = (total_bytes / xfer->max_size);
- uint16_t const short_packet_size = total_bytes % xfer->max_size;
-
- // Zero-size packet is special case.
- if(short_packet_size > 0 || (total_bytes == 0)) num_packets++;
-
- // Schedule packets to be sent within interrupt
- edpt_schedule_packets(rhport, epnum, dir, num_packets, total_bytes);
-
- return true;
-}
-
-static void dcd_edpt_disable (uint8_t rhport, uint8_t ep_addr, bool stall)
-{
- (void) rhport;
-
- USB_OTG_GlobalTypeDef * usb_otg = GLOBAL_BASE(rhport);
- USB_OTG_DeviceTypeDef * dev = DEVICE_BASE(rhport);
- USB_OTG_OUTEndpointTypeDef * out_ep = OUT_EP_BASE(rhport);
- USB_OTG_INEndpointTypeDef * in_ep = IN_EP_BASE(rhport);
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- if(dir == TUSB_DIR_IN) {
- // Only disable currently enabled non-control endpoint
- if ( (epnum == 0) || !(in_ep[epnum].DIEPCTL & USB_OTG_DIEPCTL_EPENA) ){
- in_ep[epnum].DIEPCTL |= USB_OTG_DIEPCTL_SNAK | (stall ? USB_OTG_DIEPCTL_STALL : 0);
- } else {
- // Stop transmitting packets and NAK IN xfers.
- in_ep[epnum].DIEPCTL |= USB_OTG_DIEPCTL_SNAK;
- while((in_ep[epnum].DIEPINT & USB_OTG_DIEPINT_INEPNE) == 0);
-
- // Disable the endpoint.
- in_ep[epnum].DIEPCTL |= USB_OTG_DIEPCTL_EPDIS | (stall ? USB_OTG_DIEPCTL_STALL : 0);
- while((in_ep[epnum].DIEPINT & USB_OTG_DIEPINT_EPDISD_Msk) == 0);
- in_ep[epnum].DIEPINT = USB_OTG_DIEPINT_EPDISD;
- }
-
- // Flush the FIFO, and wait until we have confirmed it cleared.
- usb_otg->GRSTCTL |= (epnum << USB_OTG_GRSTCTL_TXFNUM_Pos);
- usb_otg->GRSTCTL |= USB_OTG_GRSTCTL_TXFFLSH;
- while((usb_otg->GRSTCTL & USB_OTG_GRSTCTL_TXFFLSH_Msk) != 0);
- } else {
- // Only disable currently enabled non-control endpoint
- if ( (epnum == 0) || !(out_ep[epnum].DOEPCTL & USB_OTG_DOEPCTL_EPENA) ){
- out_ep[epnum].DOEPCTL |= stall ? USB_OTG_DOEPCTL_STALL : 0;
- } else {
- // Asserting GONAK is required to STALL an OUT endpoint.
- // Simpler to use polling here, we don't use the "B"OUTNAKEFF interrupt
- // anyway, and it can't be cleared by user code. If this while loop never
- // finishes, we have bigger problems than just the stack.
- dev->DCTL |= USB_OTG_DCTL_SGONAK;
- while((usb_otg->GINTSTS & USB_OTG_GINTSTS_BOUTNAKEFF_Msk) == 0);
-
- // Ditto here- disable the endpoint.
- out_ep[epnum].DOEPCTL |= USB_OTG_DOEPCTL_EPDIS | (stall ? USB_OTG_DOEPCTL_STALL : 0);
- while((out_ep[epnum].DOEPINT & USB_OTG_DOEPINT_EPDISD_Msk) == 0);
- out_ep[epnum].DOEPINT = USB_OTG_DOEPINT_EPDISD;
-
- // Allow other OUT endpoints to keep receiving.
- dev->DCTL |= USB_OTG_DCTL_CGONAK;
- }
- }
-}
-
-/**
- * Close an endpoint.
- */
-void dcd_edpt_close (uint8_t rhport, uint8_t ep_addr)
-{
- USB_OTG_GlobalTypeDef * usb_otg = GLOBAL_BASE(rhport);
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- dcd_edpt_disable(rhport, ep_addr, false);
-
- // Update max_size
- xfer_status[epnum][dir].max_size = 0; // max_size = 0 marks a disabled EP - required for changing FIFO allocation
-
- if (dir == TUSB_DIR_IN)
- {
- uint16_t const fifo_size = (usb_otg->DIEPTXF[epnum - 1] & USB_OTG_DIEPTXF_INEPTXFD_Msk) >> USB_OTG_DIEPTXF_INEPTXFD_Pos;
- uint16_t const fifo_start = (usb_otg->DIEPTXF[epnum - 1] & USB_OTG_DIEPTXF_INEPTXSA_Msk) >> USB_OTG_DIEPTXF_INEPTXSA_Pos;
- // For now only the last opened endpoint can be closed without fuss.
- TU_ASSERT(fifo_start == EP_FIFO_SIZE/4 - _allocated_fifo_words_tx,);
- _allocated_fifo_words_tx -= fifo_size;
- }
- else
- {
- _out_ep_closed = true; // Set flag such that RX FIFO gets reduced in size once RX FIFO is empty
- }
-}
-
-void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
-{
- dcd_edpt_disable(rhport, ep_addr, true);
-}
-
-void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- USB_OTG_OUTEndpointTypeDef * out_ep = OUT_EP_BASE(rhport);
- USB_OTG_INEndpointTypeDef * in_ep = IN_EP_BASE(rhport);
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- if(dir == TUSB_DIR_IN) {
- in_ep[epnum].DIEPCTL &= ~USB_OTG_DIEPCTL_STALL;
-
- uint8_t eptype = (in_ep[epnum].DIEPCTL & USB_OTG_DIEPCTL_EPTYP_Msk) >> USB_OTG_DIEPCTL_EPTYP_Pos;
- // Required by USB spec to reset DATA toggle bit to DATA0 on interrupt and bulk endpoints.
- if(eptype == 2 || eptype == 3) {
- in_ep[epnum].DIEPCTL |= USB_OTG_DIEPCTL_SD0PID_SEVNFRM;
- }
- } else {
- out_ep[epnum].DOEPCTL &= ~USB_OTG_DOEPCTL_STALL;
-
- uint8_t eptype = (out_ep[epnum].DOEPCTL & USB_OTG_DOEPCTL_EPTYP_Msk) >> USB_OTG_DOEPCTL_EPTYP_Pos;
- // Required by USB spec to reset DATA toggle bit to DATA0 on interrupt and bulk endpoints.
- if(eptype == 2 || eptype == 3) {
- out_ep[epnum].DOEPCTL |= USB_OTG_DOEPCTL_SD0PID_SEVNFRM;
- }
- }
-}
-
-/*------------------------------------------------------------------*/
-
-// Read a single data packet from receive FIFO
-static void read_fifo_packet(uint8_t rhport, uint8_t * dst, uint16_t len)
-{
- (void) rhport;
-
- usb_fifo_t rx_fifo = FIFO_BASE(rhport, 0);
-
- // Reading full available 32 bit words from fifo
- uint16_t full_words = len >> 2;
- for(uint16_t i = 0; i < full_words; i++) {
- uint32_t tmp = *rx_fifo;
- dst[0] = tmp & 0x000000FF;
- dst[1] = (tmp & 0x0000FF00) >> 8;
- dst[2] = (tmp & 0x00FF0000) >> 16;
- dst[3] = (tmp & 0xFF000000) >> 24;
- dst += 4;
- }
-
- // Read the remaining 1-3 bytes from fifo
- uint8_t bytes_rem = len & 0x03;
- if(bytes_rem != 0) {
- uint32_t tmp = *rx_fifo;
- dst[0] = tmp & 0x000000FF;
- if(bytes_rem > 1) {
- dst[1] = (tmp & 0x0000FF00) >> 8;
- }
- if(bytes_rem > 2) {
- dst[2] = (tmp & 0x00FF0000) >> 16;
- }
- }
-}
-
-// Write a single data packet to EPIN FIFO
-static void write_fifo_packet(uint8_t rhport, uint8_t fifo_num, uint8_t * src, uint16_t len)
-{
- (void) rhport;
-
- usb_fifo_t tx_fifo = FIFO_BASE(rhport, fifo_num);
-
- // Pushing full available 32 bit words to fifo
- uint16_t full_words = len >> 2;
- for(uint16_t i = 0; i < full_words; i++){
- *tx_fifo = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0];
- src += 4;
- }
-
- // Write the remaining 1-3 bytes into fifo
- uint8_t bytes_rem = len & 0x03;
- if(bytes_rem){
- uint32_t tmp_word = 0;
- tmp_word |= src[0];
- if(bytes_rem > 1){
- tmp_word |= src[1] << 8;
- }
- if(bytes_rem > 2){
- tmp_word |= src[2] << 16;
- }
- *tx_fifo = tmp_word;
- }
-}
-
-static void handle_rxflvl_ints(uint8_t rhport, USB_OTG_OUTEndpointTypeDef * out_ep) {
- USB_OTG_GlobalTypeDef * usb_otg = GLOBAL_BASE(rhport);
- usb_fifo_t rx_fifo = FIFO_BASE(rhport, 0);
-
- // Pop control word off FIFO
- uint32_t ctl_word = usb_otg->GRXSTSP;
- uint8_t pktsts = (ctl_word & USB_OTG_GRXSTSP_PKTSTS_Msk) >> USB_OTG_GRXSTSP_PKTSTS_Pos;
- uint8_t epnum = (ctl_word & USB_OTG_GRXSTSP_EPNUM_Msk) >> USB_OTG_GRXSTSP_EPNUM_Pos;
- uint16_t bcnt = (ctl_word & USB_OTG_GRXSTSP_BCNT_Msk) >> USB_OTG_GRXSTSP_BCNT_Pos;
-
- switch(pktsts) {
- case 0x01: // Global OUT NAK (Interrupt)
- break;
-
- case 0x02: // Out packet recvd
- {
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, TUSB_DIR_OUT);
-
- // Read packet off RxFIFO
- if (xfer->ff)
- {
- // Ring buffer
- tu_fifo_write_n_const_addr_full_words(xfer->ff, (const void *) rx_fifo, bcnt);
- }
- else
- {
- // Linear buffer
- read_fifo_packet(rhport, xfer->buffer, bcnt);
-
- // Increment pointer to xfer data
- xfer->buffer += bcnt;
- }
-
- // Truncate transfer length in case of short packet
- if(bcnt < xfer->max_size) {
- xfer->total_len -= (out_ep[epnum].DOEPTSIZ & USB_OTG_DOEPTSIZ_XFRSIZ_Msk) >> USB_OTG_DOEPTSIZ_XFRSIZ_Pos;
- if(epnum == 0) {
- xfer->total_len -= ep0_pending[TUSB_DIR_OUT];
- ep0_pending[TUSB_DIR_OUT] = 0;
- }
- }
- }
- break;
-
- case 0x03: // Out packet done (Interrupt)
- break;
-
- case 0x04: // Setup packet done (Interrupt)
- out_ep[epnum].DOEPTSIZ |= (3 << USB_OTG_DOEPTSIZ_STUPCNT_Pos);
- break;
-
- case 0x06: // Setup packet recvd
- // We can receive up to three setup packets in succession, but
- // only the last one is valid.
- _setup_packet[0] = (* rx_fifo);
- _setup_packet[1] = (* rx_fifo);
- break;
-
- default: // Invalid
- TU_BREAKPOINT();
- break;
- }
-}
-
-static void handle_epout_ints(uint8_t rhport, USB_OTG_DeviceTypeDef * dev, USB_OTG_OUTEndpointTypeDef * out_ep) {
- // DAINT for a given EP clears when DOEPINTx is cleared.
- // OEPINT will be cleared when DAINT's out bits are cleared.
- for(uint8_t n = 0; n < EP_MAX; n++) {
- xfer_ctl_t * xfer = XFER_CTL_BASE(n, TUSB_DIR_OUT);
-
- if(dev->DAINT & (1 << (USB_OTG_DAINT_OEPINT_Pos + n))) {
- // SETUP packet Setup Phase done.
- if(out_ep[n].DOEPINT & USB_OTG_DOEPINT_STUP) {
- out_ep[n].DOEPINT = USB_OTG_DOEPINT_STUP;
- dcd_event_setup_received(rhport, (uint8_t*) &_setup_packet[0], true);
- }
-
- // OUT XFER complete
- if(out_ep[n].DOEPINT & USB_OTG_DOEPINT_XFRC) {
- out_ep[n].DOEPINT = USB_OTG_DOEPINT_XFRC;
-
- // EP0 can only handle one packet
- if((n == 0) && ep0_pending[TUSB_DIR_OUT]) {
- // Schedule another packet to be received.
- edpt_schedule_packets(rhport, n, TUSB_DIR_OUT, 1, ep0_pending[TUSB_DIR_OUT]);
- } else {
- dcd_event_xfer_complete(rhport, n, xfer->total_len, XFER_RESULT_SUCCESS, true);
- }
- }
- }
- }
-}
-
-static void handle_epin_ints(uint8_t rhport, USB_OTG_DeviceTypeDef * dev, USB_OTG_INEndpointTypeDef * in_ep) {
- // DAINT for a given EP clears when DIEPINTx is cleared.
- // IEPINT will be cleared when DAINT's out bits are cleared.
- for ( uint8_t n = 0; n < EP_MAX; n++ )
- {
- xfer_ctl_t *xfer = XFER_CTL_BASE(n, TUSB_DIR_IN);
-
- if ( dev->DAINT & (1 << (USB_OTG_DAINT_IEPINT_Pos + n)) )
- {
- // IN XFER complete (entire xfer).
- if ( in_ep[n].DIEPINT & USB_OTG_DIEPINT_XFRC )
- {
- in_ep[n].DIEPINT = USB_OTG_DIEPINT_XFRC;
-
- // EP0 can only handle one packet
- if((n == 0) && ep0_pending[TUSB_DIR_IN]) {
- // Schedule another packet to be transmitted.
- edpt_schedule_packets(rhport, n, TUSB_DIR_IN, 1, ep0_pending[TUSB_DIR_IN]);
- } else {
- dcd_event_xfer_complete(rhport, n | TUSB_DIR_IN_MASK, xfer->total_len, XFER_RESULT_SUCCESS, true);
- }
- }
-
- // XFER FIFO empty
- if ( (in_ep[n].DIEPINT & USB_OTG_DIEPINT_TXFE) && (dev->DIEPEMPMSK & (1 << n)) )
- {
- // DIEPINT's TXFE bit is read-only, software cannot clear it.
- // It will only be cleared by hardware when written bytes is more than
- // - 64 bytes or
- // - Half of TX FIFO size (configured by DIEPTXF)
-
- uint16_t remaining_packets = (in_ep[n].DIEPTSIZ & USB_OTG_DIEPTSIZ_PKTCNT_Msk) >> USB_OTG_DIEPTSIZ_PKTCNT_Pos;
-
- // Process every single packet (only whole packets can be written to fifo)
- for(uint16_t i = 0; i < remaining_packets; i++)
- {
- uint16_t const remaining_bytes = (in_ep[n].DIEPTSIZ & USB_OTG_DIEPTSIZ_XFRSIZ_Msk) >> USB_OTG_DIEPTSIZ_XFRSIZ_Pos;
-
- // Packet can not be larger than ep max size
- uint16_t const packet_size = tu_min16(remaining_bytes, xfer->max_size);
-
- // It's only possible to write full packets into FIFO. Therefore DTXFSTS register of current
- // EP has to be checked if the buffer can take another WHOLE packet
- if(packet_size > ((in_ep[n].DTXFSTS & USB_OTG_DTXFSTS_INEPTFSAV_Msk) << 2)) break;
-
- // Push packet to Tx-FIFO
- if (xfer->ff)
- {
- usb_fifo_t tx_fifo = FIFO_BASE(rhport, n);
- tu_fifo_read_n_const_addr_full_words(xfer->ff, (void *) tx_fifo, packet_size);
- }
- else
- {
- write_fifo_packet(rhport, n, xfer->buffer, packet_size);
-
- // Increment pointer to xfer data
- xfer->buffer += packet_size;
- }
- }
-
- // Turn off TXFE if all bytes are written.
- if (((in_ep[n].DIEPTSIZ & USB_OTG_DIEPTSIZ_XFRSIZ_Msk) >> USB_OTG_DIEPTSIZ_XFRSIZ_Pos) == 0)
- {
- dev->DIEPEMPMSK &= ~(1 << n);
- }
- }
- }
- }
-}
-
-void dcd_int_handler(uint8_t rhport)
-{
- USB_OTG_GlobalTypeDef * usb_otg = GLOBAL_BASE(rhport);
- USB_OTG_DeviceTypeDef * dev = DEVICE_BASE(rhport);
- USB_OTG_OUTEndpointTypeDef * out_ep = OUT_EP_BASE(rhport);
- USB_OTG_INEndpointTypeDef * in_ep = IN_EP_BASE(rhport);
-
- uint32_t int_status = usb_otg->GINTSTS;
-
- if(int_status & USB_OTG_GINTSTS_USBRST)
- {
- // USBRST is start of reset.
- usb_otg->GINTSTS = USB_OTG_GINTSTS_USBRST;
- bus_reset(rhport);
- }
-
- if(int_status & USB_OTG_GINTSTS_ENUMDNE)
- {
- // ENUMDNE is the end of reset where speed of the link is detected
-
- usb_otg->GINTSTS = USB_OTG_GINTSTS_ENUMDNE;
-
- tusb_speed_t const speed = get_speed(rhport);
-
- set_turnaround(usb_otg, speed);
- dcd_event_bus_reset(rhport, speed, true);
- }
-
- if(int_status & USB_OTG_GINTSTS_USBSUSP)
- {
- usb_otg->GINTSTS = USB_OTG_GINTSTS_USBSUSP;
- dcd_event_bus_signal(rhport, DCD_EVENT_SUSPEND, true);
- }
-
- if(int_status & USB_OTG_GINTSTS_WKUINT)
- {
- usb_otg->GINTSTS = USB_OTG_GINTSTS_WKUINT;
- dcd_event_bus_signal(rhport, DCD_EVENT_RESUME, true);
- }
-
- if(int_status & USB_OTG_GINTSTS_OTGINT)
- {
- // OTG INT bit is read-only
- uint32_t const otg_int = usb_otg->GOTGINT;
-
- if (otg_int & USB_OTG_GOTGINT_SEDET)
- {
- dcd_event_bus_signal(rhport, DCD_EVENT_UNPLUGGED, true);
- }
-
- usb_otg->GOTGINT = otg_int;
- }
-
-#if USE_SOF
- if(int_status & USB_OTG_GINTSTS_SOF)
- {
- usb_otg->GINTSTS = USB_OTG_GINTSTS_SOF;
- dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true);
- }
-#endif
-
- // RxFIFO non-empty interrupt handling.
- if(int_status & USB_OTG_GINTSTS_RXFLVL)
- {
- // RXFLVL bit is read-only
-
- // Mask out RXFLVL while reading data from FIFO
- usb_otg->GINTMSK &= ~USB_OTG_GINTMSK_RXFLVLM;
-
- // Loop until all available packets were handled
- do
- {
- handle_rxflvl_ints(rhport, out_ep);
- int_status = usb_otg->GINTSTS;
- } while(int_status & USB_OTG_GINTSTS_RXFLVL);
-
- // Manage RX FIFO size
- if (_out_ep_closed)
- {
- update_grxfsiz(rhport);
-
- // Disable flag
- _out_ep_closed = false;
- }
-
- usb_otg->GINTMSK |= USB_OTG_GINTMSK_RXFLVLM;
- }
-
- // OUT endpoint interrupt handling.
- if(int_status & USB_OTG_GINTSTS_OEPINT)
- {
- // OEPINT is read-only
- handle_epout_ints(rhport, dev, out_ep);
- }
-
- // IN endpoint interrupt handling.
- if(int_status & USB_OTG_GINTSTS_IEPINT)
- {
- // IEPINT bit read-only
- handle_epin_ints(rhport, dev, in_ep);
- }
-
- // // Check for Incomplete isochronous IN transfer
- // if(int_status & USB_OTG_GINTSTS_IISOIXFR) {
- // printf(" IISOIXFR!\r\n");
- //// TU_LOG2(" IISOIXFR!\r\n");
- // }
-}
-
-#endif
diff --git a/tinyusb/src/portable/st/synopsys/synopsys_common.h b/tinyusb/src/portable/st/synopsys/synopsys_common.h
deleted file mode 100755
index 6f0602fe..00000000
--- a/tinyusb/src/portable/st/synopsys/synopsys_common.h
+++ /dev/null
@@ -1,1465 +0,0 @@
-/**
- ******************************************************************************
- * @file synopsys_common.h
- * @author MCD Application Team
- * @brief CMSIS Cortex-M3 Device USB OTG peripheral Header File.
- * This file contains the USB OTG peripheral register's definitions, bits
- * definitions and memory mapping for STM32F1xx devices.
- *
- * This file contains:
- * - Data structures and the address mapping for the USB OTG peripheral
- * - The Peripheral's registers declarations and bits definition
- * - Macros to access the peripheral's registers hardware
- *
- ******************************************************************************
- * @attention
- *
- * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
- * All rights reserved.</center></h2>
- *
- * This software component is licensed by ST under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
-
-#include "stdint.h"
-
-#pragma once
-
-#ifdef __cplusplus
- #define __I volatile
-#else
- #define __I volatile const
-#endif
-#define __O volatile
-#define __IO volatile
-#define __IM volatile const
-#define __OM volatile
-#define __IOM volatile
-
-/**
- * @brief __USB_OTG_Core_register
- */
-
-typedef struct
-{
- __IO uint32_t GOTGCTL; /*!< USB_OTG Control and Status Register Address offset: 000h */
- __IO uint32_t GOTGINT; /*!< USB_OTG Interrupt Register Address offset: 004h */
- __IO uint32_t GAHBCFG; /*!< Core AHB Configuration Register Address offset: 008h */
- __IO uint32_t GUSBCFG; /*!< Core USB Configuration Register Address offset: 00Ch */
- __IO uint32_t GRSTCTL; /*!< Core Reset Register Address offset: 010h */
- __IO uint32_t GINTSTS; /*!< Core Interrupt Register Address offset: 014h */
- __IO uint32_t GINTMSK; /*!< Core Interrupt Mask Register Address offset: 018h */
- __IO uint32_t GRXSTSR; /*!< Receive Sts Q Read Register Address offset: 01Ch */
- __IO uint32_t GRXSTSP; /*!< Receive Sts Q Read & POP Register Address offset: 020h */
- __IO uint32_t GRXFSIZ; /*!< Receive FIFO Size Register Address offset: 024h */
- __IO uint32_t DIEPTXF0_HNPTXFSIZ; /*!< EP0 / Non Periodic Tx FIFO Size Register Address offset: 028h */
- __IO uint32_t HNPTXSTS; /*!< Non Periodic Tx FIFO/Queue Sts reg Address offset: 02Ch */
- uint32_t Reserved30[2]; /*!< Reserved 030h*/
- __IO uint32_t GCCFG; /*!< General Purpose IO Register Address offset: 038h */
- __IO uint32_t CID; /*!< User ID Register Address offset: 03Ch */
- uint32_t Reserved40[48]; /*!< Reserved 040h-0FFh */
- __IO uint32_t HPTXFSIZ; /*!< Host Periodic Tx FIFO Size Reg Address offset: 100h */
- __IO uint32_t DIEPTXF[0x0F]; /*!< dev Periodic Transmit FIFO Address offset: 0x104 */
-} USB_OTG_GlobalTypeDef;
-
-/**
- * @brief __device_Registers
- */
-
-typedef struct
-{
- __IO uint32_t DCFG; /*!< dev Configuration Register Address offset: 800h*/
- __IO uint32_t DCTL; /*!< dev Control Register Address offset: 804h*/
- __IO uint32_t DSTS; /*!< dev Status Register (RO) Address offset: 808h*/
- uint32_t Reserved0C; /*!< Reserved 80Ch*/
- __IO uint32_t DIEPMSK; /*!< dev IN Endpoint Mask Address offset: 810h*/
- __IO uint32_t DOEPMSK; /*!< dev OUT Endpoint Mask Address offset: 814h*/
- __IO uint32_t DAINT; /*!< dev All Endpoints Itr Reg Address offset: 818h*/
- __IO uint32_t DAINTMSK; /*!< dev All Endpoints Itr Mask Address offset: 81Ch*/
- uint32_t Reserved20; /*!< Reserved 820h*/
- uint32_t Reserved9; /*!< Reserved 824h*/
- __IO uint32_t DVBUSDIS; /*!< dev VBUS discharge Register Address offset: 828h*/
- __IO uint32_t DVBUSPULSE; /*!< dev VBUS Pulse Register Address offset: 82Ch*/
- __IO uint32_t DTHRCTL; /*!< dev thr Address offset: 830h*/
- __IO uint32_t DIEPEMPMSK; /*!< dev empty msk Address offset: 834h*/
- __IO uint32_t DEACHINT; /*!< dedicated EP interrupt Address offset: 838h*/
- __IO uint32_t DEACHMSK; /*!< dedicated EP msk Address offset: 83Ch*/
- uint32_t Reserved40; /*!< dedicated EP mask Address offset: 840h*/
- __IO uint32_t DINEP1MSK; /*!< dedicated EP mask Address offset: 844h*/
- uint32_t Reserved44[15]; /*!< Reserved 844-87Ch*/
- __IO uint32_t DOUTEP1MSK; /*!< dedicated EP msk Address offset: 884h*/
-} USB_OTG_DeviceTypeDef;
-
-/**
- * @brief __IN_Endpoint-Specific_Register
- */
-
-typedef struct
-{
- __IO uint32_t DIEPCTL; /*!< dev IN Endpoint Control Reg 900h + (ep_num * 20h) + 00h*/
- uint32_t Reserved04; /*!< Reserved 900h + (ep_num * 20h) + 04h*/
- __IO uint32_t DIEPINT; /*!< dev IN Endpoint Itr Reg 900h + (ep_num * 20h) + 08h*/
- uint32_t Reserved0C; /*!< Reserved 900h + (ep_num * 20h) + 0Ch*/
- __IO uint32_t DIEPTSIZ; /*!< IN Endpoint Txfer Size 900h + (ep_num * 20h) + 10h*/
- __IO uint32_t DIEPDMA; /*!< IN Endpoint DMA Address Reg 900h + (ep_num * 20h) + 14h*/
- __IO uint32_t DTXFSTS; /*!< IN Endpoint Tx FIFO Status Reg 900h + (ep_num * 20h) + 18h*/
- uint32_t Reserved18; /*!< Reserved 900h+(ep_num*20h)+1Ch-900h+ (ep_num * 20h) + 1Ch*/
-} USB_OTG_INEndpointTypeDef;
-
-/**
- * @brief __OUT_Endpoint-Specific_Registers
- */
-
-typedef struct
-{
- __IO uint32_t DOEPCTL; /*!< dev OUT Endpoint Control Reg B00h + (ep_num * 20h) + 00h*/
- uint32_t Reserved04; /*!< Reserved B00h + (ep_num * 20h) + 04h*/
- __IO uint32_t DOEPINT; /*!< dev OUT Endpoint Itr Reg B00h + (ep_num * 20h) + 08h*/
- uint32_t Reserved0C; /*!< Reserved B00h + (ep_num * 20h) + 0Ch*/
- __IO uint32_t DOEPTSIZ; /*!< dev OUT Endpoint Txfer Size B00h + (ep_num * 20h) + 10h*/
- __IO uint32_t DOEPDMA; /*!< dev OUT Endpoint DMA Address B00h + (ep_num * 20h) + 14h*/
- uint32_t Reserved18[2]; /*!< Reserved B00h + (ep_num * 20h) + 18h - B00h + (ep_num * 20h) + 1Ch*/
-} USB_OTG_OUTEndpointTypeDef;
-
-/**
- * @brief __Host_Mode_Register_Structures
- */
-
-typedef struct
-{
- __IO uint32_t HCFG; /*!< Host Configuration Register 400h*/
- __IO uint32_t HFIR; /*!< Host Frame Interval Register 404h*/
- __IO uint32_t HFNUM; /*!< Host Frame Nbr/Frame Remaining 408h*/
- uint32_t Reserved40C; /*!< Reserved 40Ch*/
- __IO uint32_t HPTXSTS; /*!< Host Periodic Tx FIFO/ Queue Status 410h*/
- __IO uint32_t HAINT; /*!< Host All Channels Interrupt Register 414h*/
- __IO uint32_t HAINTMSK; /*!< Host All Channels Interrupt Mask 418h*/
-} USB_OTG_HostTypeDef;
-
-/**
- * @brief __Host_Channel_Specific_Registers
- */
-
-typedef struct
-{
- __IO uint32_t HCCHAR;
- __IO uint32_t HCSPLT;
- __IO uint32_t HCINT;
- __IO uint32_t HCINTMSK;
- __IO uint32_t HCTSIZ;
- __IO uint32_t HCDMA;
- uint32_t Reserved[2];
-} USB_OTG_HostChannelTypeDef;
-
-/*!< USB registers base address */
-#define USB_OTG_FS_PERIPH_BASE 0x50000000UL
-
-#define USB_OTG_GLOBAL_BASE 0x00000000UL
-#define USB_OTG_DEVICE_BASE 0x00000800UL
-#define USB_OTG_IN_ENDPOINT_BASE 0x00000900UL
-#define USB_OTG_OUT_ENDPOINT_BASE 0x00000B00UL
-#define USB_OTG_EP_REG_SIZE 0x00000020UL
-#define USB_OTG_HOST_BASE 0x00000400UL
-#define USB_OTG_HOST_PORT_BASE 0x00000440UL
-#define USB_OTG_HOST_CHANNEL_BASE 0x00000500UL
-#define USB_OTG_HOST_CHANNEL_SIZE 0x00000020UL
-#define USB_OTG_PCGCCTL_BASE 0x00000E00UL
-#define USB_OTG_FIFO_BASE 0x00001000UL
-#define USB_OTG_FIFO_SIZE 0x00001000UL
-
-/******************************************************************************/
-/* */
-/* USB_OTG */
-/* */
-/******************************************************************************/
-/******************** Bit definition for USB_OTG_GOTGCTL register ***********/
-#define USB_OTG_GOTGCTL_SRQSCS_Pos (0U)
-#define USB_OTG_GOTGCTL_SRQSCS_Msk (0x1UL << USB_OTG_GOTGCTL_SRQSCS_Pos) /*!< 0x00000001 */
-#define USB_OTG_GOTGCTL_SRQSCS USB_OTG_GOTGCTL_SRQSCS_Msk /*!< Session request success */
-#define USB_OTG_GOTGCTL_SRQ_Pos (1U)
-#define USB_OTG_GOTGCTL_SRQ_Msk (0x1UL << USB_OTG_GOTGCTL_SRQ_Pos) /*!< 0x00000002 */
-#define USB_OTG_GOTGCTL_SRQ USB_OTG_GOTGCTL_SRQ_Msk /*!< Session request */
-#define USB_OTG_GOTGCTL_HNGSCS_Pos (8U)
-#define USB_OTG_GOTGCTL_HNGSCS_Msk (0x1UL << USB_OTG_GOTGCTL_HNGSCS_Pos) /*!< 0x00000100 */
-#define USB_OTG_GOTGCTL_HNGSCS USB_OTG_GOTGCTL_HNGSCS_Msk /*!< Host set HNP enable */
-#define USB_OTG_GOTGCTL_HNPRQ_Pos (9U)
-#define USB_OTG_GOTGCTL_HNPRQ_Msk (0x1UL << USB_OTG_GOTGCTL_HNPRQ_Pos) /*!< 0x00000200 */
-#define USB_OTG_GOTGCTL_HNPRQ USB_OTG_GOTGCTL_HNPRQ_Msk /*!< HNP request */
-#define USB_OTG_GOTGCTL_HSHNPEN_Pos (10U)
-#define USB_OTG_GOTGCTL_HSHNPEN_Msk (0x1UL << USB_OTG_GOTGCTL_HSHNPEN_Pos) /*!< 0x00000400 */
-#define USB_OTG_GOTGCTL_HSHNPEN USB_OTG_GOTGCTL_HSHNPEN_Msk /*!< Host set HNP enable */
-#define USB_OTG_GOTGCTL_DHNPEN_Pos (11U)
-#define USB_OTG_GOTGCTL_DHNPEN_Msk (0x1UL << USB_OTG_GOTGCTL_DHNPEN_Pos) /*!< 0x00000800 */
-#define USB_OTG_GOTGCTL_DHNPEN USB_OTG_GOTGCTL_DHNPEN_Msk /*!< Device HNP enabled */
-#define USB_OTG_GOTGCTL_CIDSTS_Pos (16U)
-#define USB_OTG_GOTGCTL_CIDSTS_Msk (0x1UL << USB_OTG_GOTGCTL_CIDSTS_Pos) /*!< 0x00010000 */
-#define USB_OTG_GOTGCTL_CIDSTS USB_OTG_GOTGCTL_CIDSTS_Msk /*!< Connector ID status */
-#define USB_OTG_GOTGCTL_DBCT_Pos (17U)
-#define USB_OTG_GOTGCTL_DBCT_Msk (0x1UL << USB_OTG_GOTGCTL_DBCT_Pos) /*!< 0x00020000 */
-#define USB_OTG_GOTGCTL_DBCT USB_OTG_GOTGCTL_DBCT_Msk /*!< Long/short debounce time */
-#define USB_OTG_GOTGCTL_ASVLD_Pos (18U)
-#define USB_OTG_GOTGCTL_ASVLD_Msk (0x1UL << USB_OTG_GOTGCTL_ASVLD_Pos) /*!< 0x00040000 */
-#define USB_OTG_GOTGCTL_ASVLD USB_OTG_GOTGCTL_ASVLD_Msk /*!< A-session valid */
-#define USB_OTG_GOTGCTL_BSVLD_Pos (19U)
-#define USB_OTG_GOTGCTL_BSVLD_Msk (0x1UL << USB_OTG_GOTGCTL_BSVLD_Pos) /*!< 0x00080000 */
-#define USB_OTG_GOTGCTL_BSVLD USB_OTG_GOTGCTL_BSVLD_Msk /*!< B-session valid */
-
-/******************** Bit definition for USB_OTG_HCFG register ********************/
-
-#define USB_OTG_HCFG_FSLSPCS_Pos (0U)
-#define USB_OTG_HCFG_FSLSPCS_Msk (0x3UL << USB_OTG_HCFG_FSLSPCS_Pos) /*!< 0x00000003 */
-#define USB_OTG_HCFG_FSLSPCS USB_OTG_HCFG_FSLSPCS_Msk /*!< FS/LS PHY clock select */
-#define USB_OTG_HCFG_FSLSPCS_0 (0x1UL << USB_OTG_HCFG_FSLSPCS_Pos) /*!< 0x00000001 */
-#define USB_OTG_HCFG_FSLSPCS_1 (0x2UL << USB_OTG_HCFG_FSLSPCS_Pos) /*!< 0x00000002 */
-#define USB_OTG_HCFG_FSLSS_Pos (2U)
-#define USB_OTG_HCFG_FSLSS_Msk (0x1UL << USB_OTG_HCFG_FSLSS_Pos) /*!< 0x00000004 */
-#define USB_OTG_HCFG_FSLSS USB_OTG_HCFG_FSLSS_Msk /*!< FS- and LS-only support */
-
-/******************** Bit definition for USB_OTG_DCFG register ********************/
-
-#define USB_OTG_DCFG_DSPD_Pos (0U)
-#define USB_OTG_DCFG_DSPD_Msk (0x3UL << USB_OTG_DCFG_DSPD_Pos) /*!< 0x00000003 */
-#define USB_OTG_DCFG_DSPD USB_OTG_DCFG_DSPD_Msk /*!< Device speed */
-#define USB_OTG_DCFG_DSPD_0 (0x1UL << USB_OTG_DCFG_DSPD_Pos) /*!< 0x00000001 */
-#define USB_OTG_DCFG_DSPD_1 (0x2UL << USB_OTG_DCFG_DSPD_Pos) /*!< 0x00000002 */
-#define USB_OTG_DCFG_NZLSOHSK_Pos (2U)
-#define USB_OTG_DCFG_NZLSOHSK_Msk (0x1UL << USB_OTG_DCFG_NZLSOHSK_Pos) /*!< 0x00000004 */
-#define USB_OTG_DCFG_NZLSOHSK USB_OTG_DCFG_NZLSOHSK_Msk /*!< Nonzero-length status OUT handshake */
-
-#define USB_OTG_DCFG_DAD_Pos (4U)
-#define USB_OTG_DCFG_DAD_Msk (0x7FUL << USB_OTG_DCFG_DAD_Pos) /*!< 0x000007F0 */
-#define USB_OTG_DCFG_DAD USB_OTG_DCFG_DAD_Msk /*!< Device address */
-#define USB_OTG_DCFG_DAD_0 (0x01UL << USB_OTG_DCFG_DAD_Pos) /*!< 0x00000010 */
-#define USB_OTG_DCFG_DAD_1 (0x02UL << USB_OTG_DCFG_DAD_Pos) /*!< 0x00000020 */
-#define USB_OTG_DCFG_DAD_2 (0x04UL << USB_OTG_DCFG_DAD_Pos) /*!< 0x00000040 */
-#define USB_OTG_DCFG_DAD_3 (0x08UL << USB_OTG_DCFG_DAD_Pos) /*!< 0x00000080 */
-#define USB_OTG_DCFG_DAD_4 (0x10UL << USB_OTG_DCFG_DAD_Pos) /*!< 0x00000100 */
-#define USB_OTG_DCFG_DAD_5 (0x20UL << USB_OTG_DCFG_DAD_Pos) /*!< 0x00000200 */
-#define USB_OTG_DCFG_DAD_6 (0x40UL << USB_OTG_DCFG_DAD_Pos) /*!< 0x00000400 */
-
-#define USB_OTG_DCFG_PFIVL_Pos (11U)
-#define USB_OTG_DCFG_PFIVL_Msk (0x3UL << USB_OTG_DCFG_PFIVL_Pos) /*!< 0x00001800 */
-#define USB_OTG_DCFG_PFIVL USB_OTG_DCFG_PFIVL_Msk /*!< Periodic (micro)frame interval */
-#define USB_OTG_DCFG_PFIVL_0 (0x1UL << USB_OTG_DCFG_PFIVL_Pos) /*!< 0x00000800 */
-#define USB_OTG_DCFG_PFIVL_1 (0x2UL << USB_OTG_DCFG_PFIVL_Pos) /*!< 0x00001000 */
-
-#define USB_OTG_DCFG_PERSCHIVL_Pos (24U)
-#define USB_OTG_DCFG_PERSCHIVL_Msk (0x3UL << USB_OTG_DCFG_PERSCHIVL_Pos) /*!< 0x03000000 */
-#define USB_OTG_DCFG_PERSCHIVL USB_OTG_DCFG_PERSCHIVL_Msk /*!< Periodic scheduling interval */
-#define USB_OTG_DCFG_PERSCHIVL_0 (0x1UL << USB_OTG_DCFG_PERSCHIVL_Pos) /*!< 0x01000000 */
-#define USB_OTG_DCFG_PERSCHIVL_1 (0x2UL << USB_OTG_DCFG_PERSCHIVL_Pos) /*!< 0x02000000 */
-
-/******************** Bit definition for USB_OTG_PCGCR register ********************/
-#define USB_OTG_PCGCR_STPPCLK_Pos (0U)
-#define USB_OTG_PCGCR_STPPCLK_Msk (0x1UL << USB_OTG_PCGCR_STPPCLK_Pos) /*!< 0x00000001 */
-#define USB_OTG_PCGCR_STPPCLK USB_OTG_PCGCR_STPPCLK_Msk /*!< Stop PHY clock */
-#define USB_OTG_PCGCR_GATEHCLK_Pos (1U)
-#define USB_OTG_PCGCR_GATEHCLK_Msk (0x1UL << USB_OTG_PCGCR_GATEHCLK_Pos) /*!< 0x00000002 */
-#define USB_OTG_PCGCR_GATEHCLK USB_OTG_PCGCR_GATEHCLK_Msk /*!< Gate HCLK */
-#define USB_OTG_PCGCR_PHYSUSP_Pos (4U)
-#define USB_OTG_PCGCR_PHYSUSP_Msk (0x1UL << USB_OTG_PCGCR_PHYSUSP_Pos) /*!< 0x00000010 */
-#define USB_OTG_PCGCR_PHYSUSP USB_OTG_PCGCR_PHYSUSP_Msk /*!< PHY suspended */
-
-/******************** Bit definition for USB_OTG_GOTGINT register ********************/
-#define USB_OTG_GOTGINT_SEDET_Pos (2U)
-#define USB_OTG_GOTGINT_SEDET_Msk (0x1UL << USB_OTG_GOTGINT_SEDET_Pos) /*!< 0x00000004 */
-#define USB_OTG_GOTGINT_SEDET USB_OTG_GOTGINT_SEDET_Msk /*!< Session end detected */
-#define USB_OTG_GOTGINT_SRSSCHG_Pos (8U)
-#define USB_OTG_GOTGINT_SRSSCHG_Msk (0x1UL << USB_OTG_GOTGINT_SRSSCHG_Pos) /*!< 0x00000100 */
-#define USB_OTG_GOTGINT_SRSSCHG USB_OTG_GOTGINT_SRSSCHG_Msk /*!< Session request success status change */
-#define USB_OTG_GOTGINT_HNSSCHG_Pos (9U)
-#define USB_OTG_GOTGINT_HNSSCHG_Msk (0x1UL << USB_OTG_GOTGINT_HNSSCHG_Pos) /*!< 0x00000200 */
-#define USB_OTG_GOTGINT_HNSSCHG USB_OTG_GOTGINT_HNSSCHG_Msk /*!< Host negotiation success status change */
-#define USB_OTG_GOTGINT_HNGDET_Pos (17U)
-#define USB_OTG_GOTGINT_HNGDET_Msk (0x1UL << USB_OTG_GOTGINT_HNGDET_Pos) /*!< 0x00020000 */
-#define USB_OTG_GOTGINT_HNGDET USB_OTG_GOTGINT_HNGDET_Msk /*!< Host negotiation detected */
-#define USB_OTG_GOTGINT_ADTOCHG_Pos (18U)
-#define USB_OTG_GOTGINT_ADTOCHG_Msk (0x1UL << USB_OTG_GOTGINT_ADTOCHG_Pos) /*!< 0x00040000 */
-#define USB_OTG_GOTGINT_ADTOCHG USB_OTG_GOTGINT_ADTOCHG_Msk /*!< A-device timeout change */
-#define USB_OTG_GOTGINT_DBCDNE_Pos (19U)
-#define USB_OTG_GOTGINT_DBCDNE_Msk (0x1UL << USB_OTG_GOTGINT_DBCDNE_Pos) /*!< 0x00080000 */
-#define USB_OTG_GOTGINT_DBCDNE USB_OTG_GOTGINT_DBCDNE_Msk /*!< Debounce done */
-
-/******************** Bit definition for USB_OTG_DCTL register ********************/
-#define USB_OTG_DCTL_RWUSIG_Pos (0U)
-#define USB_OTG_DCTL_RWUSIG_Msk (0x1UL << USB_OTG_DCTL_RWUSIG_Pos) /*!< 0x00000001 */
-#define USB_OTG_DCTL_RWUSIG USB_OTG_DCTL_RWUSIG_Msk /*!< Remote wakeup signaling */
-#define USB_OTG_DCTL_SDIS_Pos (1U)
-#define USB_OTG_DCTL_SDIS_Msk (0x1UL << USB_OTG_DCTL_SDIS_Pos) /*!< 0x00000002 */
-#define USB_OTG_DCTL_SDIS USB_OTG_DCTL_SDIS_Msk /*!< Soft disconnect */
-#define USB_OTG_DCTL_GINSTS_Pos (2U)
-#define USB_OTG_DCTL_GINSTS_Msk (0x1UL << USB_OTG_DCTL_GINSTS_Pos) /*!< 0x00000004 */
-#define USB_OTG_DCTL_GINSTS USB_OTG_DCTL_GINSTS_Msk /*!< Global IN NAK status */
-#define USB_OTG_DCTL_GONSTS_Pos (3U)
-#define USB_OTG_DCTL_GONSTS_Msk (0x1UL << USB_OTG_DCTL_GONSTS_Pos) /*!< 0x00000008 */
-#define USB_OTG_DCTL_GONSTS USB_OTG_DCTL_GONSTS_Msk /*!< Global OUT NAK status */
-
-#define USB_OTG_DCTL_TCTL_Pos (4U)
-#define USB_OTG_DCTL_TCTL_Msk (0x7UL << USB_OTG_DCTL_TCTL_Pos) /*!< 0x00000070 */
-#define USB_OTG_DCTL_TCTL USB_OTG_DCTL_TCTL_Msk /*!< Test control */
-#define USB_OTG_DCTL_TCTL_0 (0x1UL << USB_OTG_DCTL_TCTL_Pos) /*!< 0x00000010 */
-#define USB_OTG_DCTL_TCTL_1 (0x2UL << USB_OTG_DCTL_TCTL_Pos) /*!< 0x00000020 */
-#define USB_OTG_DCTL_TCTL_2 (0x4UL << USB_OTG_DCTL_TCTL_Pos) /*!< 0x00000040 */
-#define USB_OTG_DCTL_SGINAK_Pos (7U)
-#define USB_OTG_DCTL_SGINAK_Msk (0x1UL << USB_OTG_DCTL_SGINAK_Pos) /*!< 0x00000080 */
-#define USB_OTG_DCTL_SGINAK USB_OTG_DCTL_SGINAK_Msk /*!< Set global IN NAK */
-#define USB_OTG_DCTL_CGINAK_Pos (8U)
-#define USB_OTG_DCTL_CGINAK_Msk (0x1UL << USB_OTG_DCTL_CGINAK_Pos) /*!< 0x00000100 */
-#define USB_OTG_DCTL_CGINAK USB_OTG_DCTL_CGINAK_Msk /*!< Clear global IN NAK */
-#define USB_OTG_DCTL_SGONAK_Pos (9U)
-#define USB_OTG_DCTL_SGONAK_Msk (0x1UL << USB_OTG_DCTL_SGONAK_Pos) /*!< 0x00000200 */
-#define USB_OTG_DCTL_SGONAK USB_OTG_DCTL_SGONAK_Msk /*!< Set global OUT NAK */
-#define USB_OTG_DCTL_CGONAK_Pos (10U)
-#define USB_OTG_DCTL_CGONAK_Msk (0x1UL << USB_OTG_DCTL_CGONAK_Pos) /*!< 0x00000400 */
-#define USB_OTG_DCTL_CGONAK USB_OTG_DCTL_CGONAK_Msk /*!< Clear global OUT NAK */
-#define USB_OTG_DCTL_POPRGDNE_Pos (11U)
-#define USB_OTG_DCTL_POPRGDNE_Msk (0x1UL << USB_OTG_DCTL_POPRGDNE_Pos) /*!< 0x00000800 */
-#define USB_OTG_DCTL_POPRGDNE USB_OTG_DCTL_POPRGDNE_Msk /*!< Power-on programming done */
-
-/******************** Bit definition for USB_OTG_HFIR register ********************/
-#define USB_OTG_HFIR_FRIVL_Pos (0U)
-#define USB_OTG_HFIR_FRIVL_Msk (0xFFFFUL << USB_OTG_HFIR_FRIVL_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_HFIR_FRIVL USB_OTG_HFIR_FRIVL_Msk /*!< Frame interval */
-
-/******************** Bit definition for USB_OTG_HFNUM register ********************/
-#define USB_OTG_HFNUM_FRNUM_Pos (0U)
-#define USB_OTG_HFNUM_FRNUM_Msk (0xFFFFUL << USB_OTG_HFNUM_FRNUM_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_HFNUM_FRNUM USB_OTG_HFNUM_FRNUM_Msk /*!< Frame number */
-#define USB_OTG_HFNUM_FTREM_Pos (16U)
-#define USB_OTG_HFNUM_FTREM_Msk (0xFFFFUL << USB_OTG_HFNUM_FTREM_Pos) /*!< 0xFFFF0000 */
-#define USB_OTG_HFNUM_FTREM USB_OTG_HFNUM_FTREM_Msk /*!< Frame time remaining */
-
-/******************** Bit definition for USB_OTG_DSTS register ********************/
-#define USB_OTG_DSTS_SUSPSTS_Pos (0U)
-#define USB_OTG_DSTS_SUSPSTS_Msk (0x1UL << USB_OTG_DSTS_SUSPSTS_Pos) /*!< 0x00000001 */
-#define USB_OTG_DSTS_SUSPSTS USB_OTG_DSTS_SUSPSTS_Msk /*!< Suspend status */
-
-#define USB_OTG_DSTS_ENUMSPD_Pos (1U)
-#define USB_OTG_DSTS_ENUMSPD_Msk (0x3UL << USB_OTG_DSTS_ENUMSPD_Pos) /*!< 0x00000006 */
-#define USB_OTG_DSTS_ENUMSPD USB_OTG_DSTS_ENUMSPD_Msk /*!< Enumerated speed */
-#define USB_OTG_DSTS_ENUMSPD_0 (0x1UL << USB_OTG_DSTS_ENUMSPD_Pos) /*!< 0x00000002 */
-#define USB_OTG_DSTS_ENUMSPD_1 (0x2UL << USB_OTG_DSTS_ENUMSPD_Pos) /*!< 0x00000004 */
-#define USB_OTG_DSTS_EERR_Pos (3U)
-#define USB_OTG_DSTS_EERR_Msk (0x1UL << USB_OTG_DSTS_EERR_Pos) /*!< 0x00000008 */
-#define USB_OTG_DSTS_EERR USB_OTG_DSTS_EERR_Msk /*!< Erratic error */
-#define USB_OTG_DSTS_FNSOF_Pos (8U)
-#define USB_OTG_DSTS_FNSOF_Msk (0x3FFFUL << USB_OTG_DSTS_FNSOF_Pos) /*!< 0x003FFF00 */
-#define USB_OTG_DSTS_FNSOF USB_OTG_DSTS_FNSOF_Msk /*!< Frame number of the received SOF */
-
-/******************** Bit definition for USB_OTG_GAHBCFG register ********************/
-#define USB_OTG_GAHBCFG_GINT_Pos (0U)
-#define USB_OTG_GAHBCFG_GINT_Msk (0x1UL << USB_OTG_GAHBCFG_GINT_Pos) /*!< 0x00000001 */
-#define USB_OTG_GAHBCFG_GINT USB_OTG_GAHBCFG_GINT_Msk /*!< Global interrupt mask */
-#define USB_OTG_GAHBCFG_HBSTLEN_Pos (1U)
-#define USB_OTG_GAHBCFG_HBSTLEN_Msk (0xFUL << USB_OTG_GAHBCFG_HBSTLEN_Pos) /*!< 0x0000001E */
-#define USB_OTG_GAHBCFG_HBSTLEN USB_OTG_GAHBCFG_HBSTLEN_Msk /*!< Burst length/type */
-#define USB_OTG_GAHBCFG_HBSTLEN_0 (0x0UL << USB_OTG_GAHBCFG_HBSTLEN_Pos) /*!< Single */
-#define USB_OTG_GAHBCFG_HBSTLEN_1 (0x1UL << USB_OTG_GAHBCFG_HBSTLEN_Pos) /*!< INCR */
-#define USB_OTG_GAHBCFG_HBSTLEN_2 (0x3UL << USB_OTG_GAHBCFG_HBSTLEN_Pos) /*!< INCR4 */
-#define USB_OTG_GAHBCFG_HBSTLEN_3 (0x5UL << USB_OTG_GAHBCFG_HBSTLEN_Pos) /*!< INCR8 */
-#define USB_OTG_GAHBCFG_HBSTLEN_4 (0x7UL << USB_OTG_GAHBCFG_HBSTLEN_Pos) /*!< INCR16 */
-#define USB_OTG_GAHBCFG_DMAEN_Pos (5U)
-#define USB_OTG_GAHBCFG_DMAEN_Msk (0x1UL << USB_OTG_GAHBCFG_DMAEN_Pos) /*!< 0x00000020 */
-#define USB_OTG_GAHBCFG_DMAEN USB_OTG_GAHBCFG_DMAEN_Msk /*!< DMA enable */
-#define USB_OTG_GAHBCFG_TXFELVL_Pos (7U)
-#define USB_OTG_GAHBCFG_TXFELVL_Msk (0x1UL << USB_OTG_GAHBCFG_TXFELVL_Pos) /*!< 0x00000080 */
-#define USB_OTG_GAHBCFG_TXFELVL USB_OTG_GAHBCFG_TXFELVL_Msk /*!< TxFIFO empty level */
-#define USB_OTG_GAHBCFG_PTXFELVL_Pos (8U)
-#define USB_OTG_GAHBCFG_PTXFELVL_Msk (0x1UL << USB_OTG_GAHBCFG_PTXFELVL_Pos) /*!< 0x00000100 */
-#define USB_OTG_GAHBCFG_PTXFELVL USB_OTG_GAHBCFG_PTXFELVL_Msk /*!< Periodic TxFIFO empty level */
-
-/******************** Bit definition for USB_OTG_GUSBCFG register ********************/
-
-#define USB_OTG_GUSBCFG_TOCAL_Pos (0U)
-#define USB_OTG_GUSBCFG_TOCAL_Msk (0x7UL << USB_OTG_GUSBCFG_TOCAL_Pos) /*!< 0x00000007 */
-#define USB_OTG_GUSBCFG_TOCAL USB_OTG_GUSBCFG_TOCAL_Msk /*!< FS timeout calibration */
-#define USB_OTG_GUSBCFG_TOCAL_0 (0x1UL << USB_OTG_GUSBCFG_TOCAL_Pos) /*!< 0x00000001 */
-#define USB_OTG_GUSBCFG_TOCAL_1 (0x2UL << USB_OTG_GUSBCFG_TOCAL_Pos) /*!< 0x00000002 */
-#define USB_OTG_GUSBCFG_TOCAL_2 (0x4UL << USB_OTG_GUSBCFG_TOCAL_Pos) /*!< 0x00000004 */
-#define USB_OTG_GUSBCFG_PHYSEL_Pos (6U)
-#define USB_OTG_GUSBCFG_PHYSEL_Msk (0x1UL << USB_OTG_GUSBCFG_PHYSEL_Pos) /*!< 0x00000040 */
-#define USB_OTG_GUSBCFG_PHYSEL USB_OTG_GUSBCFG_PHYSEL_Msk /*!< USB 2.0 high-speed ULPI PHY or USB 1.1 full-speed serial transceiver select */
-#define USB_OTG_GUSBCFG_SRPCAP_Pos (8U)
-#define USB_OTG_GUSBCFG_SRPCAP_Msk (0x1UL << USB_OTG_GUSBCFG_SRPCAP_Pos) /*!< 0x00000100 */
-#define USB_OTG_GUSBCFG_SRPCAP USB_OTG_GUSBCFG_SRPCAP_Msk /*!< SRP-capable */
-#define USB_OTG_GUSBCFG_HNPCAP_Pos (9U)
-#define USB_OTG_GUSBCFG_HNPCAP_Msk (0x1UL << USB_OTG_GUSBCFG_HNPCAP_Pos) /*!< 0x00000200 */
-#define USB_OTG_GUSBCFG_HNPCAP USB_OTG_GUSBCFG_HNPCAP_Msk /*!< HNP-capable */
-#define USB_OTG_GUSBCFG_TRDT_Pos (10U)
-#define USB_OTG_GUSBCFG_TRDT_Msk (0xFUL << USB_OTG_GUSBCFG_TRDT_Pos) /*!< 0x00003C00 */
-#define USB_OTG_GUSBCFG_TRDT USB_OTG_GUSBCFG_TRDT_Msk /*!< USB turnaround time */
-#define USB_OTG_GUSBCFG_TRDT_0 (0x1UL << USB_OTG_GUSBCFG_TRDT_Pos) /*!< 0x00000400 */
-#define USB_OTG_GUSBCFG_TRDT_1 (0x2UL << USB_OTG_GUSBCFG_TRDT_Pos) /*!< 0x00000800 */
-#define USB_OTG_GUSBCFG_TRDT_2 (0x4UL << USB_OTG_GUSBCFG_TRDT_Pos) /*!< 0x00001000 */
-#define USB_OTG_GUSBCFG_TRDT_3 (0x8UL << USB_OTG_GUSBCFG_TRDT_Pos) /*!< 0x00002000 */
-#define USB_OTG_GUSBCFG_PHYLPCS_Pos (15U)
-#define USB_OTG_GUSBCFG_PHYLPCS_Msk (0x1UL << USB_OTG_GUSBCFG_PHYLPCS_Pos) /*!< 0x00008000 */
-#define USB_OTG_GUSBCFG_PHYLPCS USB_OTG_GUSBCFG_PHYLPCS_Msk /*!< PHY Low-power clock select */
-#define USB_OTG_GUSBCFG_ULPIFSLS_Pos (17U)
-#define USB_OTG_GUSBCFG_ULPIFSLS_Msk (0x1UL << USB_OTG_GUSBCFG_ULPIFSLS_Pos) /*!< 0x00020000 */
-#define USB_OTG_GUSBCFG_ULPIFSLS USB_OTG_GUSBCFG_ULPIFSLS_Msk /*!< ULPI FS/LS select */
-#define USB_OTG_GUSBCFG_ULPIAR_Pos (18U)
-#define USB_OTG_GUSBCFG_ULPIAR_Msk (0x1UL << USB_OTG_GUSBCFG_ULPIAR_Pos) /*!< 0x00040000 */
-#define USB_OTG_GUSBCFG_ULPIAR USB_OTG_GUSBCFG_ULPIAR_Msk /*!< ULPI Auto-resume */
-#define USB_OTG_GUSBCFG_ULPICSM_Pos (19U)
-#define USB_OTG_GUSBCFG_ULPICSM_Msk (0x1UL << USB_OTG_GUSBCFG_ULPICSM_Pos) /*!< 0x00080000 */
-#define USB_OTG_GUSBCFG_ULPICSM USB_OTG_GUSBCFG_ULPICSM_Msk /*!< ULPI Clock SuspendM */
-#define USB_OTG_GUSBCFG_ULPIEVBUSD_Pos (20U)
-#define USB_OTG_GUSBCFG_ULPIEVBUSD_Msk (0x1UL << USB_OTG_GUSBCFG_ULPIEVBUSD_Pos) /*!< 0x00100000 */
-#define USB_OTG_GUSBCFG_ULPIEVBUSD USB_OTG_GUSBCFG_ULPIEVBUSD_Msk /*!< ULPI External VBUS Drive */
-#define USB_OTG_GUSBCFG_ULPIEVBUSI_Pos (21U)
-#define USB_OTG_GUSBCFG_ULPIEVBUSI_Msk (0x1UL << USB_OTG_GUSBCFG_ULPIEVBUSI_Pos) /*!< 0x00200000 */
-#define USB_OTG_GUSBCFG_ULPIEVBUSI USB_OTG_GUSBCFG_ULPIEVBUSI_Msk /*!< ULPI external VBUS indicator */
-#define USB_OTG_GUSBCFG_TSDPS_Pos (22U)
-#define USB_OTG_GUSBCFG_TSDPS_Msk (0x1UL << USB_OTG_GUSBCFG_TSDPS_Pos) /*!< 0x00400000 */
-#define USB_OTG_GUSBCFG_TSDPS USB_OTG_GUSBCFG_TSDPS_Msk /*!< TermSel DLine pulsing selection */
-#define USB_OTG_GUSBCFG_PCCI_Pos (23U)
-#define USB_OTG_GUSBCFG_PCCI_Msk (0x1UL << USB_OTG_GUSBCFG_PCCI_Pos) /*!< 0x00800000 */
-#define USB_OTG_GUSBCFG_PCCI USB_OTG_GUSBCFG_PCCI_Msk /*!< Indicator complement */
-#define USB_OTG_GUSBCFG_PTCI_Pos (24U)
-#define USB_OTG_GUSBCFG_PTCI_Msk (0x1UL << USB_OTG_GUSBCFG_PTCI_Pos) /*!< 0x01000000 */
-#define USB_OTG_GUSBCFG_PTCI USB_OTG_GUSBCFG_PTCI_Msk /*!< Indicator pass through */
-#define USB_OTG_GUSBCFG_ULPIIPD_Pos (25U)
-#define USB_OTG_GUSBCFG_ULPIIPD_Msk (0x1UL << USB_OTG_GUSBCFG_ULPIIPD_Pos) /*!< 0x02000000 */
-#define USB_OTG_GUSBCFG_ULPIIPD USB_OTG_GUSBCFG_ULPIIPD_Msk /*!< ULPI interface protect disable */
-#define USB_OTG_GUSBCFG_FHMOD_Pos (29U)
-#define USB_OTG_GUSBCFG_FHMOD_Msk (0x1UL << USB_OTG_GUSBCFG_FHMOD_Pos) /*!< 0x20000000 */
-#define USB_OTG_GUSBCFG_FHMOD USB_OTG_GUSBCFG_FHMOD_Msk /*!< Forced host mode */
-#define USB_OTG_GUSBCFG_FDMOD_Pos (30U)
-#define USB_OTG_GUSBCFG_FDMOD_Msk (0x1UL << USB_OTG_GUSBCFG_FDMOD_Pos) /*!< 0x40000000 */
-#define USB_OTG_GUSBCFG_FDMOD USB_OTG_GUSBCFG_FDMOD_Msk /*!< Forced peripheral mode */
-#define USB_OTG_GUSBCFG_CTXPKT_Pos (31U)
-#define USB_OTG_GUSBCFG_CTXPKT_Msk (0x1UL << USB_OTG_GUSBCFG_CTXPKT_Pos) /*!< 0x80000000 */
-#define USB_OTG_GUSBCFG_CTXPKT USB_OTG_GUSBCFG_CTXPKT_Msk /*!< Corrupt Tx packet */
-
-/******************** Bit definition for USB_OTG_GRSTCTL register ********************/
-#define USB_OTG_GRSTCTL_CSRST_Pos (0U)
-#define USB_OTG_GRSTCTL_CSRST_Msk (0x1UL << USB_OTG_GRSTCTL_CSRST_Pos) /*!< 0x00000001 */
-#define USB_OTG_GRSTCTL_CSRST USB_OTG_GRSTCTL_CSRST_Msk /*!< Core soft reset */
-#define USB_OTG_GRSTCTL_HSRST_Pos (1U)
-#define USB_OTG_GRSTCTL_HSRST_Msk (0x1UL << USB_OTG_GRSTCTL_HSRST_Pos) /*!< 0x00000002 */
-#define USB_OTG_GRSTCTL_HSRST USB_OTG_GRSTCTL_HSRST_Msk /*!< HCLK soft reset */
-#define USB_OTG_GRSTCTL_FCRST_Pos (2U)
-#define USB_OTG_GRSTCTL_FCRST_Msk (0x1UL << USB_OTG_GRSTCTL_FCRST_Pos) /*!< 0x00000004 */
-#define USB_OTG_GRSTCTL_FCRST USB_OTG_GRSTCTL_FCRST_Msk /*!< Host frame counter reset */
-#define USB_OTG_GRSTCTL_RXFFLSH_Pos (4U)
-#define USB_OTG_GRSTCTL_RXFFLSH_Msk (0x1UL << USB_OTG_GRSTCTL_RXFFLSH_Pos) /*!< 0x00000010 */
-#define USB_OTG_GRSTCTL_RXFFLSH USB_OTG_GRSTCTL_RXFFLSH_Msk /*!< RxFIFO flush */
-#define USB_OTG_GRSTCTL_TXFFLSH_Pos (5U)
-#define USB_OTG_GRSTCTL_TXFFLSH_Msk (0x1UL << USB_OTG_GRSTCTL_TXFFLSH_Pos) /*!< 0x00000020 */
-#define USB_OTG_GRSTCTL_TXFFLSH USB_OTG_GRSTCTL_TXFFLSH_Msk /*!< TxFIFO flush */
-
-
-#define USB_OTG_GRSTCTL_TXFNUM_Pos (6U)
-#define USB_OTG_GRSTCTL_TXFNUM_Msk (0x1FUL << USB_OTG_GRSTCTL_TXFNUM_Pos) /*!< 0x000007C0 */
-#define USB_OTG_GRSTCTL_TXFNUM USB_OTG_GRSTCTL_TXFNUM_Msk /*!< TxFIFO number */
-#define USB_OTG_GRSTCTL_TXFNUM_0 (0x01UL << USB_OTG_GRSTCTL_TXFNUM_Pos) /*!< 0x00000040 */
-#define USB_OTG_GRSTCTL_TXFNUM_1 (0x02UL << USB_OTG_GRSTCTL_TXFNUM_Pos) /*!< 0x00000080 */
-#define USB_OTG_GRSTCTL_TXFNUM_2 (0x04UL << USB_OTG_GRSTCTL_TXFNUM_Pos) /*!< 0x00000100 */
-#define USB_OTG_GRSTCTL_TXFNUM_3 (0x08UL << USB_OTG_GRSTCTL_TXFNUM_Pos) /*!< 0x00000200 */
-#define USB_OTG_GRSTCTL_TXFNUM_4 (0x10UL << USB_OTG_GRSTCTL_TXFNUM_Pos) /*!< 0x00000400 */
-#define USB_OTG_GRSTCTL_DMAREQ_Pos (30U)
-#define USB_OTG_GRSTCTL_DMAREQ_Msk (0x1UL << USB_OTG_GRSTCTL_DMAREQ_Pos) /*!< 0x40000000 */
-#define USB_OTG_GRSTCTL_DMAREQ USB_OTG_GRSTCTL_DMAREQ_Msk /*!< DMA request signal */
-#define USB_OTG_GRSTCTL_AHBIDL_Pos (31U)
-#define USB_OTG_GRSTCTL_AHBIDL_Msk (0x1UL << USB_OTG_GRSTCTL_AHBIDL_Pos) /*!< 0x80000000 */
-#define USB_OTG_GRSTCTL_AHBIDL USB_OTG_GRSTCTL_AHBIDL_Msk /*!< AHB master idle */
-
-/******************** Bit definition for USB_OTG_DIEPMSK register ********************/
-#define USB_OTG_DIEPMSK_XFRCM_Pos (0U)
-#define USB_OTG_DIEPMSK_XFRCM_Msk (0x1UL << USB_OTG_DIEPMSK_XFRCM_Pos) /*!< 0x00000001 */
-#define USB_OTG_DIEPMSK_XFRCM USB_OTG_DIEPMSK_XFRCM_Msk /*!< Transfer completed interrupt mask */
-#define USB_OTG_DIEPMSK_EPDM_Pos (1U)
-#define USB_OTG_DIEPMSK_EPDM_Msk (0x1UL << USB_OTG_DIEPMSK_EPDM_Pos) /*!< 0x00000002 */
-#define USB_OTG_DIEPMSK_EPDM USB_OTG_DIEPMSK_EPDM_Msk /*!< Endpoint disabled interrupt mask */
-#define USB_OTG_DIEPMSK_TOM_Pos (3U)
-#define USB_OTG_DIEPMSK_TOM_Msk (0x1UL << USB_OTG_DIEPMSK_TOM_Pos) /*!< 0x00000008 */
-#define USB_OTG_DIEPMSK_TOM USB_OTG_DIEPMSK_TOM_Msk /*!< Timeout condition mask (nonisochronous endpoints) */
-#define USB_OTG_DIEPMSK_ITTXFEMSK_Pos (4U)
-#define USB_OTG_DIEPMSK_ITTXFEMSK_Msk (0x1UL << USB_OTG_DIEPMSK_ITTXFEMSK_Pos) /*!< 0x00000010 */
-#define USB_OTG_DIEPMSK_ITTXFEMSK USB_OTG_DIEPMSK_ITTXFEMSK_Msk /*!< IN token received when TxFIFO empty mask */
-#define USB_OTG_DIEPMSK_INEPNMM_Pos (5U)
-#define USB_OTG_DIEPMSK_INEPNMM_Msk (0x1UL << USB_OTG_DIEPMSK_INEPNMM_Pos) /*!< 0x00000020 */
-#define USB_OTG_DIEPMSK_INEPNMM USB_OTG_DIEPMSK_INEPNMM_Msk /*!< IN token received with EP mismatch mask */
-#define USB_OTG_DIEPMSK_INEPNEM_Pos (6U)
-#define USB_OTG_DIEPMSK_INEPNEM_Msk (0x1UL << USB_OTG_DIEPMSK_INEPNEM_Pos) /*!< 0x00000040 */
-#define USB_OTG_DIEPMSK_INEPNEM USB_OTG_DIEPMSK_INEPNEM_Msk /*!< IN endpoint NAK effective mask */
-#define USB_OTG_DIEPMSK_TXFURM_Pos (8U)
-#define USB_OTG_DIEPMSK_TXFURM_Msk (0x1UL << USB_OTG_DIEPMSK_TXFURM_Pos) /*!< 0x00000100 */
-#define USB_OTG_DIEPMSK_TXFURM USB_OTG_DIEPMSK_TXFURM_Msk /*!< FIFO underrun mask */
-#define USB_OTG_DIEPMSK_BIM_Pos (9U)
-#define USB_OTG_DIEPMSK_BIM_Msk (0x1UL << USB_OTG_DIEPMSK_BIM_Pos) /*!< 0x00000200 */
-#define USB_OTG_DIEPMSK_BIM USB_OTG_DIEPMSK_BIM_Msk /*!< BNA interrupt mask */
-
-/******************** Bit definition for USB_OTG_HPTXSTS register ********************/
-#define USB_OTG_HPTXSTS_PTXFSAVL_Pos (0U)
-#define USB_OTG_HPTXSTS_PTXFSAVL_Msk (0xFFFFUL << USB_OTG_HPTXSTS_PTXFSAVL_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_HPTXSTS_PTXFSAVL USB_OTG_HPTXSTS_PTXFSAVL_Msk /*!< Periodic transmit data FIFO space available */
-#define USB_OTG_HPTXSTS_PTXQSAV_Pos (16U)
-#define USB_OTG_HPTXSTS_PTXQSAV_Msk (0xFFUL << USB_OTG_HPTXSTS_PTXQSAV_Pos) /*!< 0x00FF0000 */
-#define USB_OTG_HPTXSTS_PTXQSAV USB_OTG_HPTXSTS_PTXQSAV_Msk /*!< Periodic transmit request queue space available */
-#define USB_OTG_HPTXSTS_PTXQSAV_0 (0x01UL << USB_OTG_HPTXSTS_PTXQSAV_Pos) /*!< 0x00010000 */
-#define USB_OTG_HPTXSTS_PTXQSAV_1 (0x02UL << USB_OTG_HPTXSTS_PTXQSAV_Pos) /*!< 0x00020000 */
-#define USB_OTG_HPTXSTS_PTXQSAV_2 (0x04UL << USB_OTG_HPTXSTS_PTXQSAV_Pos) /*!< 0x00040000 */
-#define USB_OTG_HPTXSTS_PTXQSAV_3 (0x08UL << USB_OTG_HPTXSTS_PTXQSAV_Pos) /*!< 0x00080000 */
-#define USB_OTG_HPTXSTS_PTXQSAV_4 (0x10UL << USB_OTG_HPTXSTS_PTXQSAV_Pos) /*!< 0x00100000 */
-#define USB_OTG_HPTXSTS_PTXQSAV_5 (0x20UL << USB_OTG_HPTXSTS_PTXQSAV_Pos) /*!< 0x00200000 */
-#define USB_OTG_HPTXSTS_PTXQSAV_6 (0x40UL << USB_OTG_HPTXSTS_PTXQSAV_Pos) /*!< 0x00400000 */
-#define USB_OTG_HPTXSTS_PTXQSAV_7 (0x80UL << USB_OTG_HPTXSTS_PTXQSAV_Pos) /*!< 0x00800000 */
-
-#define USB_OTG_HPTXSTS_PTXQTOP_Pos (24U)
-#define USB_OTG_HPTXSTS_PTXQTOP_Msk (0xFFUL << USB_OTG_HPTXSTS_PTXQTOP_Pos) /*!< 0xFF000000 */
-#define USB_OTG_HPTXSTS_PTXQTOP USB_OTG_HPTXSTS_PTXQTOP_Msk /*!< Top of the periodic transmit request queue */
-#define USB_OTG_HPTXSTS_PTXQTOP_0 (0x01UL << USB_OTG_HPTXSTS_PTXQTOP_Pos) /*!< 0x01000000 */
-#define USB_OTG_HPTXSTS_PTXQTOP_1 (0x02UL << USB_OTG_HPTXSTS_PTXQTOP_Pos) /*!< 0x02000000 */
-#define USB_OTG_HPTXSTS_PTXQTOP_2 (0x04UL << USB_OTG_HPTXSTS_PTXQTOP_Pos) /*!< 0x04000000 */
-#define USB_OTG_HPTXSTS_PTXQTOP_3 (0x08UL << USB_OTG_HPTXSTS_PTXQTOP_Pos) /*!< 0x08000000 */
-#define USB_OTG_HPTXSTS_PTXQTOP_4 (0x10UL << USB_OTG_HPTXSTS_PTXQTOP_Pos) /*!< 0x10000000 */
-#define USB_OTG_HPTXSTS_PTXQTOP_5 (0x20UL << USB_OTG_HPTXSTS_PTXQTOP_Pos) /*!< 0x20000000 */
-#define USB_OTG_HPTXSTS_PTXQTOP_6 (0x40UL << USB_OTG_HPTXSTS_PTXQTOP_Pos) /*!< 0x40000000 */
-#define USB_OTG_HPTXSTS_PTXQTOP_7 (0x80UL << USB_OTG_HPTXSTS_PTXQTOP_Pos) /*!< 0x80000000 */
-
-/******************** Bit definition for USB_OTG_HAINT register ********************/
-#define USB_OTG_HAINT_HAINT_Pos (0U)
-#define USB_OTG_HAINT_HAINT_Msk (0xFFFFUL << USB_OTG_HAINT_HAINT_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_HAINT_HAINT USB_OTG_HAINT_HAINT_Msk /*!< Channel interrupts */
-
-/******************** Bit definition for USB_OTG_DOEPMSK register ********************/
-#define USB_OTG_DOEPMSK_XFRCM_Pos (0U)
-#define USB_OTG_DOEPMSK_XFRCM_Msk (0x1UL << USB_OTG_DOEPMSK_XFRCM_Pos) /*!< 0x00000001 */
-#define USB_OTG_DOEPMSK_XFRCM USB_OTG_DOEPMSK_XFRCM_Msk /*!< Transfer completed interrupt mask */
-#define USB_OTG_DOEPMSK_EPDM_Pos (1U)
-#define USB_OTG_DOEPMSK_EPDM_Msk (0x1UL << USB_OTG_DOEPMSK_EPDM_Pos) /*!< 0x00000002 */
-#define USB_OTG_DOEPMSK_EPDM USB_OTG_DOEPMSK_EPDM_Msk /*!< Endpoint disabled interrupt mask */
-#define USB_OTG_DOEPMSK_AHBERRM_Pos (2U)
-#define USB_OTG_DOEPMSK_AHBERRM_Msk (0x1UL << USB_OTG_DOEPMSK_AHBERRM_Pos) /*!< 0x00000004 */
-#define USB_OTG_DOEPMSK_AHBERRM USB_OTG_DOEPMSK_AHBERRM_Msk /*!< OUT transaction AHB Error interrupt mask */
-#define USB_OTG_DOEPMSK_STUPM_Pos (3U)
-#define USB_OTG_DOEPMSK_STUPM_Msk (0x1UL << USB_OTG_DOEPMSK_STUPM_Pos) /*!< 0x00000008 */
-#define USB_OTG_DOEPMSK_STUPM USB_OTG_DOEPMSK_STUPM_Msk /*!< SETUP phase done mask */
-#define USB_OTG_DOEPMSK_OTEPDM_Pos (4U)
-#define USB_OTG_DOEPMSK_OTEPDM_Msk (0x1UL << USB_OTG_DOEPMSK_OTEPDM_Pos) /*!< 0x00000010 */
-#define USB_OTG_DOEPMSK_OTEPDM USB_OTG_DOEPMSK_OTEPDM_Msk /*!< OUT token received when endpoint disabled mask */
-#define USB_OTG_DOEPMSK_OTEPSPRM_Pos (5U)
-#define USB_OTG_DOEPMSK_OTEPSPRM_Msk (0x1UL << USB_OTG_DOEPMSK_OTEPSPRM_Pos) /*!< 0x00000020 */
-#define USB_OTG_DOEPMSK_OTEPSPRM USB_OTG_DOEPMSK_OTEPSPRM_Msk /*!< Status Phase Received mask */
-#define USB_OTG_DOEPMSK_B2BSTUP_Pos (6U)
-#define USB_OTG_DOEPMSK_B2BSTUP_Msk (0x1UL << USB_OTG_DOEPMSK_B2BSTUP_Pos) /*!< 0x00000040 */
-#define USB_OTG_DOEPMSK_B2BSTUP USB_OTG_DOEPMSK_B2BSTUP_Msk /*!< Back-to-back SETUP packets received mask */
-#define USB_OTG_DOEPMSK_OPEM_Pos (8U)
-#define USB_OTG_DOEPMSK_OPEM_Msk (0x1UL << USB_OTG_DOEPMSK_OPEM_Pos) /*!< 0x00000100 */
-#define USB_OTG_DOEPMSK_OPEM USB_OTG_DOEPMSK_OPEM_Msk /*!< OUT packet error mask */
-#define USB_OTG_DOEPMSK_BOIM_Pos (9U)
-#define USB_OTG_DOEPMSK_BOIM_Msk (0x1UL << USB_OTG_DOEPMSK_BOIM_Pos) /*!< 0x00000200 */
-#define USB_OTG_DOEPMSK_BOIM USB_OTG_DOEPMSK_BOIM_Msk /*!< BNA interrupt mask */
-#define USB_OTG_DOEPMSK_BERRM_Pos (12U)
-#define USB_OTG_DOEPMSK_BERRM_Msk (0x1UL << USB_OTG_DOEPMSK_BERRM_Pos) /*!< 0x00001000 */
-#define USB_OTG_DOEPMSK_BERRM USB_OTG_DOEPMSK_BERRM_Msk /*!< Babble error interrupt mask */
-#define USB_OTG_DOEPMSK_NAKM_Pos (13U)
-#define USB_OTG_DOEPMSK_NAKM_Msk (0x1UL << USB_OTG_DOEPMSK_NAKM_Pos) /*!< 0x00002000 */
-#define USB_OTG_DOEPMSK_NAKM USB_OTG_DOEPMSK_NAKM_Msk /*!< OUT Packet NAK interrupt mask */
-#define USB_OTG_DOEPMSK_NYETM_Pos (14U)
-#define USB_OTG_DOEPMSK_NYETM_Msk (0x1UL << USB_OTG_DOEPMSK_NYETM_Pos) /*!< 0x00004000 */
-#define USB_OTG_DOEPMSK_NYETM USB_OTG_DOEPMSK_NYETM_Msk /*!< NYET interrupt mask */
-/******************** Bit definition for USB_OTG_GINTSTS register ********************/
-#define USB_OTG_GINTSTS_CMOD_Pos (0U)
-#define USB_OTG_GINTSTS_CMOD_Msk (0x1UL << USB_OTG_GINTSTS_CMOD_Pos) /*!< 0x00000001 */
-#define USB_OTG_GINTSTS_CMOD USB_OTG_GINTSTS_CMOD_Msk /*!< Current mode of operation */
-#define USB_OTG_GINTSTS_MMIS_Pos (1U)
-#define USB_OTG_GINTSTS_MMIS_Msk (0x1UL << USB_OTG_GINTSTS_MMIS_Pos) /*!< 0x00000002 */
-#define USB_OTG_GINTSTS_MMIS USB_OTG_GINTSTS_MMIS_Msk /*!< Mode mismatch interrupt */
-#define USB_OTG_GINTSTS_OTGINT_Pos (2U)
-#define USB_OTG_GINTSTS_OTGINT_Msk (0x1UL << USB_OTG_GINTSTS_OTGINT_Pos) /*!< 0x00000004 */
-#define USB_OTG_GINTSTS_OTGINT USB_OTG_GINTSTS_OTGINT_Msk /*!< OTG interrupt */
-#define USB_OTG_GINTSTS_SOF_Pos (3U)
-#define USB_OTG_GINTSTS_SOF_Msk (0x1UL << USB_OTG_GINTSTS_SOF_Pos) /*!< 0x00000008 */
-#define USB_OTG_GINTSTS_SOF USB_OTG_GINTSTS_SOF_Msk /*!< Start of frame */
-#define USB_OTG_GINTSTS_RXFLVL_Pos (4U)
-#define USB_OTG_GINTSTS_RXFLVL_Msk (0x1UL << USB_OTG_GINTSTS_RXFLVL_Pos) /*!< 0x00000010 */
-#define USB_OTG_GINTSTS_RXFLVL USB_OTG_GINTSTS_RXFLVL_Msk /*!< RxFIFO nonempty */
-#define USB_OTG_GINTSTS_NPTXFE_Pos (5U)
-#define USB_OTG_GINTSTS_NPTXFE_Msk (0x1UL << USB_OTG_GINTSTS_NPTXFE_Pos) /*!< 0x00000020 */
-#define USB_OTG_GINTSTS_NPTXFE USB_OTG_GINTSTS_NPTXFE_Msk /*!< Nonperiodic TxFIFO empty */
-#define USB_OTG_GINTSTS_GINAKEFF_Pos (6U)
-#define USB_OTG_GINTSTS_GINAKEFF_Msk (0x1UL << USB_OTG_GINTSTS_GINAKEFF_Pos) /*!< 0x00000040 */
-#define USB_OTG_GINTSTS_GINAKEFF USB_OTG_GINTSTS_GINAKEFF_Msk /*!< Global IN nonperiodic NAK effective */
-#define USB_OTG_GINTSTS_BOUTNAKEFF_Pos (7U)
-#define USB_OTG_GINTSTS_BOUTNAKEFF_Msk (0x1UL << USB_OTG_GINTSTS_BOUTNAKEFF_Pos) /*!< 0x00000080 */
-#define USB_OTG_GINTSTS_BOUTNAKEFF USB_OTG_GINTSTS_BOUTNAKEFF_Msk /*!< Global OUT NAK effective */
-#define USB_OTG_GINTSTS_ESUSP_Pos (10U)
-#define USB_OTG_GINTSTS_ESUSP_Msk (0x1UL << USB_OTG_GINTSTS_ESUSP_Pos) /*!< 0x00000400 */
-#define USB_OTG_GINTSTS_ESUSP USB_OTG_GINTSTS_ESUSP_Msk /*!< Early suspend */
-#define USB_OTG_GINTSTS_USBSUSP_Pos (11U)
-#define USB_OTG_GINTSTS_USBSUSP_Msk (0x1UL << USB_OTG_GINTSTS_USBSUSP_Pos) /*!< 0x00000800 */
-#define USB_OTG_GINTSTS_USBSUSP USB_OTG_GINTSTS_USBSUSP_Msk /*!< USB suspend */
-#define USB_OTG_GINTSTS_USBRST_Pos (12U)
-#define USB_OTG_GINTSTS_USBRST_Msk (0x1UL << USB_OTG_GINTSTS_USBRST_Pos) /*!< 0x00001000 */
-#define USB_OTG_GINTSTS_USBRST USB_OTG_GINTSTS_USBRST_Msk /*!< USB reset */
-#define USB_OTG_GINTSTS_ENUMDNE_Pos (13U)
-#define USB_OTG_GINTSTS_ENUMDNE_Msk (0x1UL << USB_OTG_GINTSTS_ENUMDNE_Pos) /*!< 0x00002000 */
-#define USB_OTG_GINTSTS_ENUMDNE USB_OTG_GINTSTS_ENUMDNE_Msk /*!< Enumeration done */
-#define USB_OTG_GINTSTS_ISOODRP_Pos (14U)
-#define USB_OTG_GINTSTS_ISOODRP_Msk (0x1UL << USB_OTG_GINTSTS_ISOODRP_Pos) /*!< 0x00004000 */
-#define USB_OTG_GINTSTS_ISOODRP USB_OTG_GINTSTS_ISOODRP_Msk /*!< Isochronous OUT packet dropped interrupt */
-#define USB_OTG_GINTSTS_EOPF_Pos (15U)
-#define USB_OTG_GINTSTS_EOPF_Msk (0x1UL << USB_OTG_GINTSTS_EOPF_Pos) /*!< 0x00008000 */
-#define USB_OTG_GINTSTS_EOPF USB_OTG_GINTSTS_EOPF_Msk /*!< End of periodic frame interrupt */
-#define USB_OTG_GINTSTS_IEPINT_Pos (18U)
-#define USB_OTG_GINTSTS_IEPINT_Msk (0x1UL << USB_OTG_GINTSTS_IEPINT_Pos) /*!< 0x00040000 */
-#define USB_OTG_GINTSTS_IEPINT USB_OTG_GINTSTS_IEPINT_Msk /*!< IN endpoint interrupt */
-#define USB_OTG_GINTSTS_OEPINT_Pos (19U)
-#define USB_OTG_GINTSTS_OEPINT_Msk (0x1UL << USB_OTG_GINTSTS_OEPINT_Pos) /*!< 0x00080000 */
-#define USB_OTG_GINTSTS_OEPINT USB_OTG_GINTSTS_OEPINT_Msk /*!< OUT endpoint interrupt */
-#define USB_OTG_GINTSTS_IISOIXFR_Pos (20U)
-#define USB_OTG_GINTSTS_IISOIXFR_Msk (0x1UL << USB_OTG_GINTSTS_IISOIXFR_Pos) /*!< 0x00100000 */
-#define USB_OTG_GINTSTS_IISOIXFR USB_OTG_GINTSTS_IISOIXFR_Msk /*!< Incomplete isochronous IN transfer */
-#define USB_OTG_GINTSTS_PXFR_INCOMPISOOUT_Pos (21U)
-#define USB_OTG_GINTSTS_PXFR_INCOMPISOOUT_Msk (0x1UL << USB_OTG_GINTSTS_PXFR_INCOMPISOOUT_Pos) /*!< 0x00200000 */
-#define USB_OTG_GINTSTS_PXFR_INCOMPISOOUT USB_OTG_GINTSTS_PXFR_INCOMPISOOUT_Msk /*!< Incomplete periodic transfer */
-#define USB_OTG_GINTSTS_DATAFSUSP_Pos (22U)
-#define USB_OTG_GINTSTS_DATAFSUSP_Msk (0x1UL << USB_OTG_GINTSTS_DATAFSUSP_Pos) /*!< 0x00400000 */
-#define USB_OTG_GINTSTS_DATAFSUSP USB_OTG_GINTSTS_DATAFSUSP_Msk /*!< Data fetch suspended */
-#define USB_OTG_GINTSTS_HPRTINT_Pos (24U)
-#define USB_OTG_GINTSTS_HPRTINT_Msk (0x1UL << USB_OTG_GINTSTS_HPRTINT_Pos) /*!< 0x01000000 */
-#define USB_OTG_GINTSTS_HPRTINT USB_OTG_GINTSTS_HPRTINT_Msk /*!< Host port interrupt */
-#define USB_OTG_GINTSTS_HCINT_Pos (25U)
-#define USB_OTG_GINTSTS_HCINT_Msk (0x1UL << USB_OTG_GINTSTS_HCINT_Pos) /*!< 0x02000000 */
-#define USB_OTG_GINTSTS_HCINT USB_OTG_GINTSTS_HCINT_Msk /*!< Host channels interrupt */
-#define USB_OTG_GINTSTS_PTXFE_Pos (26U)
-#define USB_OTG_GINTSTS_PTXFE_Msk (0x1UL << USB_OTG_GINTSTS_PTXFE_Pos) /*!< 0x04000000 */
-#define USB_OTG_GINTSTS_PTXFE USB_OTG_GINTSTS_PTXFE_Msk /*!< Periodic TxFIFO empty */
-#define USB_OTG_GINTSTS_CIDSCHG_Pos (28U)
-#define USB_OTG_GINTSTS_CIDSCHG_Msk (0x1UL << USB_OTG_GINTSTS_CIDSCHG_Pos) /*!< 0x10000000 */
-#define USB_OTG_GINTSTS_CIDSCHG USB_OTG_GINTSTS_CIDSCHG_Msk /*!< Connector ID status change */
-#define USB_OTG_GINTSTS_DISCINT_Pos (29U)
-#define USB_OTG_GINTSTS_DISCINT_Msk (0x1UL << USB_OTG_GINTSTS_DISCINT_Pos) /*!< 0x20000000 */
-#define USB_OTG_GINTSTS_DISCINT USB_OTG_GINTSTS_DISCINT_Msk /*!< Disconnect detected interrupt */
-#define USB_OTG_GINTSTS_SRQINT_Pos (30U)
-#define USB_OTG_GINTSTS_SRQINT_Msk (0x1UL << USB_OTG_GINTSTS_SRQINT_Pos) /*!< 0x40000000 */
-#define USB_OTG_GINTSTS_SRQINT USB_OTG_GINTSTS_SRQINT_Msk /*!< Session request/new session detected interrupt */
-#define USB_OTG_GINTSTS_WKUINT_Pos (31U)
-#define USB_OTG_GINTSTS_WKUINT_Msk (0x1UL << USB_OTG_GINTSTS_WKUINT_Pos) /*!< 0x80000000 */
-#define USB_OTG_GINTSTS_WKUINT USB_OTG_GINTSTS_WKUINT_Msk /*!< Resume/remote wakeup detected interrupt */
-
-/******************** Bit definition for USB_OTG_GINTMSK register ********************/
-#define USB_OTG_GINTMSK_MMISM_Pos (1U)
-#define USB_OTG_GINTMSK_MMISM_Msk (0x1UL << USB_OTG_GINTMSK_MMISM_Pos) /*!< 0x00000002 */
-#define USB_OTG_GINTMSK_MMISM USB_OTG_GINTMSK_MMISM_Msk /*!< Mode mismatch interrupt mask */
-#define USB_OTG_GINTMSK_OTGINT_Pos (2U)
-#define USB_OTG_GINTMSK_OTGINT_Msk (0x1UL << USB_OTG_GINTMSK_OTGINT_Pos) /*!< 0x00000004 */
-#define USB_OTG_GINTMSK_OTGINT USB_OTG_GINTMSK_OTGINT_Msk /*!< OTG interrupt mask */
-#define USB_OTG_GINTMSK_SOFM_Pos (3U)
-#define USB_OTG_GINTMSK_SOFM_Msk (0x1UL << USB_OTG_GINTMSK_SOFM_Pos) /*!< 0x00000008 */
-#define USB_OTG_GINTMSK_SOFM USB_OTG_GINTMSK_SOFM_Msk /*!< Start of frame mask */
-#define USB_OTG_GINTMSK_RXFLVLM_Pos (4U)
-#define USB_OTG_GINTMSK_RXFLVLM_Msk (0x1UL << USB_OTG_GINTMSK_RXFLVLM_Pos) /*!< 0x00000010 */
-#define USB_OTG_GINTMSK_RXFLVLM USB_OTG_GINTMSK_RXFLVLM_Msk /*!< Receive FIFO nonempty mask */
-#define USB_OTG_GINTMSK_NPTXFEM_Pos (5U)
-#define USB_OTG_GINTMSK_NPTXFEM_Msk (0x1UL << USB_OTG_GINTMSK_NPTXFEM_Pos) /*!< 0x00000020 */
-#define USB_OTG_GINTMSK_NPTXFEM USB_OTG_GINTMSK_NPTXFEM_Msk /*!< Nonperiodic TxFIFO empty mask */
-#define USB_OTG_GINTMSK_GINAKEFFM_Pos (6U)
-#define USB_OTG_GINTMSK_GINAKEFFM_Msk (0x1UL << USB_OTG_GINTMSK_GINAKEFFM_Pos) /*!< 0x00000040 */
-#define USB_OTG_GINTMSK_GINAKEFFM USB_OTG_GINTMSK_GINAKEFFM_Msk /*!< Global nonperiodic IN NAK effective mask */
-#define USB_OTG_GINTMSK_GONAKEFFM_Pos (7U)
-#define USB_OTG_GINTMSK_GONAKEFFM_Msk (0x1UL << USB_OTG_GINTMSK_GONAKEFFM_Pos) /*!< 0x00000080 */
-#define USB_OTG_GINTMSK_GONAKEFFM USB_OTG_GINTMSK_GONAKEFFM_Msk /*!< Global OUT NAK effective mask */
-#define USB_OTG_GINTMSK_ESUSPM_Pos (10U)
-#define USB_OTG_GINTMSK_ESUSPM_Msk (0x1UL << USB_OTG_GINTMSK_ESUSPM_Pos) /*!< 0x00000400 */
-#define USB_OTG_GINTMSK_ESUSPM USB_OTG_GINTMSK_ESUSPM_Msk /*!< Early suspend mask */
-#define USB_OTG_GINTMSK_USBSUSPM_Pos (11U)
-#define USB_OTG_GINTMSK_USBSUSPM_Msk (0x1UL << USB_OTG_GINTMSK_USBSUSPM_Pos) /*!< 0x00000800 */
-#define USB_OTG_GINTMSK_USBSUSPM USB_OTG_GINTMSK_USBSUSPM_Msk /*!< USB suspend mask */
-#define USB_OTG_GINTMSK_USBRST_Pos (12U)
-#define USB_OTG_GINTMSK_USBRST_Msk (0x1UL << USB_OTG_GINTMSK_USBRST_Pos) /*!< 0x00001000 */
-#define USB_OTG_GINTMSK_USBRST USB_OTG_GINTMSK_USBRST_Msk /*!< USB reset mask */
-#define USB_OTG_GINTMSK_ENUMDNEM_Pos (13U)
-#define USB_OTG_GINTMSK_ENUMDNEM_Msk (0x1UL << USB_OTG_GINTMSK_ENUMDNEM_Pos) /*!< 0x00002000 */
-#define USB_OTG_GINTMSK_ENUMDNEM USB_OTG_GINTMSK_ENUMDNEM_Msk /*!< Enumeration done mask */
-#define USB_OTG_GINTMSK_ISOODRPM_Pos (14U)
-#define USB_OTG_GINTMSK_ISOODRPM_Msk (0x1UL << USB_OTG_GINTMSK_ISOODRPM_Pos) /*!< 0x00004000 */
-#define USB_OTG_GINTMSK_ISOODRPM USB_OTG_GINTMSK_ISOODRPM_Msk /*!< Isochronous OUT packet dropped interrupt mask */
-#define USB_OTG_GINTMSK_EOPFM_Pos (15U)
-#define USB_OTG_GINTMSK_EOPFM_Msk (0x1UL << USB_OTG_GINTMSK_EOPFM_Pos) /*!< 0x00008000 */
-#define USB_OTG_GINTMSK_EOPFM USB_OTG_GINTMSK_EOPFM_Msk /*!< End of periodic frame interrupt mask */
-#define USB_OTG_GINTMSK_EPMISM_Pos (17U)
-#define USB_OTG_GINTMSK_EPMISM_Msk (0x1UL << USB_OTG_GINTMSK_EPMISM_Pos) /*!< 0x00020000 */
-#define USB_OTG_GINTMSK_EPMISM USB_OTG_GINTMSK_EPMISM_Msk /*!< Endpoint mismatch interrupt mask */
-#define USB_OTG_GINTMSK_IEPINT_Pos (18U)
-#define USB_OTG_GINTMSK_IEPINT_Msk (0x1UL << USB_OTG_GINTMSK_IEPINT_Pos) /*!< 0x00040000 */
-#define USB_OTG_GINTMSK_IEPINT USB_OTG_GINTMSK_IEPINT_Msk /*!< IN endpoints interrupt mask */
-#define USB_OTG_GINTMSK_OEPINT_Pos (19U)
-#define USB_OTG_GINTMSK_OEPINT_Msk (0x1UL << USB_OTG_GINTMSK_OEPINT_Pos) /*!< 0x00080000 */
-#define USB_OTG_GINTMSK_OEPINT USB_OTG_GINTMSK_OEPINT_Msk /*!< OUT endpoints interrupt mask */
-#define USB_OTG_GINTMSK_IISOIXFRM_Pos (20U)
-#define USB_OTG_GINTMSK_IISOIXFRM_Msk (0x1UL << USB_OTG_GINTMSK_IISOIXFRM_Pos) /*!< 0x00100000 */
-#define USB_OTG_GINTMSK_IISOIXFRM USB_OTG_GINTMSK_IISOIXFRM_Msk /*!< Incomplete isochronous IN transfer mask */
-#define USB_OTG_GINTMSK_PXFRM_IISOOXFRM_Pos (21U)
-#define USB_OTG_GINTMSK_PXFRM_IISOOXFRM_Msk (0x1UL << USB_OTG_GINTMSK_PXFRM_IISOOXFRM_Pos) /*!< 0x00200000 */
-#define USB_OTG_GINTMSK_PXFRM_IISOOXFRM USB_OTG_GINTMSK_PXFRM_IISOOXFRM_Msk /*!< Incomplete periodic transfer mask */
-#define USB_OTG_GINTMSK_FSUSPM_Pos (22U)
-#define USB_OTG_GINTMSK_FSUSPM_Msk (0x1UL << USB_OTG_GINTMSK_FSUSPM_Pos) /*!< 0x00400000 */
-#define USB_OTG_GINTMSK_FSUSPM USB_OTG_GINTMSK_FSUSPM_Msk /*!< Data fetch suspended mask */
-#define USB_OTG_GINTMSK_PRTIM_Pos (24U)
-#define USB_OTG_GINTMSK_PRTIM_Msk (0x1UL << USB_OTG_GINTMSK_PRTIM_Pos) /*!< 0x01000000 */
-#define USB_OTG_GINTMSK_PRTIM USB_OTG_GINTMSK_PRTIM_Msk /*!< Host port interrupt mask */
-#define USB_OTG_GINTMSK_HCIM_Pos (25U)
-#define USB_OTG_GINTMSK_HCIM_Msk (0x1UL << USB_OTG_GINTMSK_HCIM_Pos) /*!< 0x02000000 */
-#define USB_OTG_GINTMSK_HCIM USB_OTG_GINTMSK_HCIM_Msk /*!< Host channels interrupt mask */
-#define USB_OTG_GINTMSK_PTXFEM_Pos (26U)
-#define USB_OTG_GINTMSK_PTXFEM_Msk (0x1UL << USB_OTG_GINTMSK_PTXFEM_Pos) /*!< 0x04000000 */
-#define USB_OTG_GINTMSK_PTXFEM USB_OTG_GINTMSK_PTXFEM_Msk /*!< Periodic TxFIFO empty mask */
-#define USB_OTG_GINTMSK_CIDSCHGM_Pos (28U)
-#define USB_OTG_GINTMSK_CIDSCHGM_Msk (0x1UL << USB_OTG_GINTMSK_CIDSCHGM_Pos) /*!< 0x10000000 */
-#define USB_OTG_GINTMSK_CIDSCHGM USB_OTG_GINTMSK_CIDSCHGM_Msk /*!< Connector ID status change mask */
-#define USB_OTG_GINTMSK_DISCINT_Pos (29U)
-#define USB_OTG_GINTMSK_DISCINT_Msk (0x1UL << USB_OTG_GINTMSK_DISCINT_Pos) /*!< 0x20000000 */
-#define USB_OTG_GINTMSK_DISCINT USB_OTG_GINTMSK_DISCINT_Msk /*!< Disconnect detected interrupt mask */
-#define USB_OTG_GINTMSK_SRQIM_Pos (30U)
-#define USB_OTG_GINTMSK_SRQIM_Msk (0x1UL << USB_OTG_GINTMSK_SRQIM_Pos) /*!< 0x40000000 */
-#define USB_OTG_GINTMSK_SRQIM USB_OTG_GINTMSK_SRQIM_Msk /*!< Session request/new session detected interrupt mask */
-#define USB_OTG_GINTMSK_WUIM_Pos (31U)
-#define USB_OTG_GINTMSK_WUIM_Msk (0x1UL << USB_OTG_GINTMSK_WUIM_Pos) /*!< 0x80000000 */
-#define USB_OTG_GINTMSK_WUIM USB_OTG_GINTMSK_WUIM_Msk /*!< Resume/remote wakeup detected interrupt mask */
-
-/******************** Bit definition for USB_OTG_DAINT register ********************/
-#define USB_OTG_DAINT_IEPINT_Pos (0U)
-#define USB_OTG_DAINT_IEPINT_Msk (0xFFFFUL << USB_OTG_DAINT_IEPINT_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_DAINT_IEPINT USB_OTG_DAINT_IEPINT_Msk /*!< IN endpoint interrupt bits */
-#define USB_OTG_DAINT_OEPINT_Pos (16U)
-#define USB_OTG_DAINT_OEPINT_Msk (0xFFFFUL << USB_OTG_DAINT_OEPINT_Pos) /*!< 0xFFFF0000 */
-#define USB_OTG_DAINT_OEPINT USB_OTG_DAINT_OEPINT_Msk /*!< OUT endpoint interrupt bits */
-
-/******************** Bit definition for USB_OTG_HAINTMSK register ********************/
-#define USB_OTG_HAINTMSK_HAINTM_Pos (0U)
-#define USB_OTG_HAINTMSK_HAINTM_Msk (0xFFFFUL << USB_OTG_HAINTMSK_HAINTM_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_HAINTMSK_HAINTM USB_OTG_HAINTMSK_HAINTM_Msk /*!< Channel interrupt mask */
-
-/******************** Bit definition for USB_OTG_GRXSTSP register ********************/
-#define USB_OTG_GRXSTSP_EPNUM_Pos (0U)
-#define USB_OTG_GRXSTSP_EPNUM_Msk (0xFUL << USB_OTG_GRXSTSP_EPNUM_Pos) /*!< 0x0000000F */
-#define USB_OTG_GRXSTSP_EPNUM USB_OTG_GRXSTSP_EPNUM_Msk /*!< IN EP interrupt mask bits */
-#define USB_OTG_GRXSTSP_BCNT_Pos (4U)
-#define USB_OTG_GRXSTSP_BCNT_Msk (0x7FFUL << USB_OTG_GRXSTSP_BCNT_Pos) /*!< 0x00007FF0 */
-#define USB_OTG_GRXSTSP_BCNT USB_OTG_GRXSTSP_BCNT_Msk /*!< OUT EP interrupt mask bits */
-#define USB_OTG_GRXSTSP_DPID_Pos (15U)
-#define USB_OTG_GRXSTSP_DPID_Msk (0x3UL << USB_OTG_GRXSTSP_DPID_Pos) /*!< 0x00018000 */
-#define USB_OTG_GRXSTSP_DPID USB_OTG_GRXSTSP_DPID_Msk /*!< OUT EP interrupt mask bits */
-#define USB_OTG_GRXSTSP_PKTSTS_Pos (17U)
-#define USB_OTG_GRXSTSP_PKTSTS_Msk (0xFUL << USB_OTG_GRXSTSP_PKTSTS_Pos) /*!< 0x001E0000 */
-#define USB_OTG_GRXSTSP_PKTSTS USB_OTG_GRXSTSP_PKTSTS_Msk /*!< OUT EP interrupt mask bits */
-
-/******************** Bit definition for USB_OTG_DAINTMSK register ********************/
-#define USB_OTG_DAINTMSK_IEPM_Pos (0U)
-#define USB_OTG_DAINTMSK_IEPM_Msk (0xFFFFUL << USB_OTG_DAINTMSK_IEPM_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_DAINTMSK_IEPM USB_OTG_DAINTMSK_IEPM_Msk /*!< IN EP interrupt mask bits */
-#define USB_OTG_DAINTMSK_OEPM_Pos (16U)
-#define USB_OTG_DAINTMSK_OEPM_Msk (0xFFFFUL << USB_OTG_DAINTMSK_OEPM_Pos) /*!< 0xFFFF0000 */
-#define USB_OTG_DAINTMSK_OEPM USB_OTG_DAINTMSK_OEPM_Msk /*!< OUT EP interrupt mask bits */
-
-/******************** Bit definition for USB_OTG_GRXFSIZ register ********************/
-#define USB_OTG_GRXFSIZ_RXFD_Pos (0U)
-#define USB_OTG_GRXFSIZ_RXFD_Msk (0xFFFFUL << USB_OTG_GRXFSIZ_RXFD_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_GRXFSIZ_RXFD USB_OTG_GRXFSIZ_RXFD_Msk /*!< RxFIFO depth */
-
-/******************** Bit definition for USB_OTG_DVBUSDIS register ********************/
-#define USB_OTG_DVBUSDIS_VBUSDT_Pos (0U)
-#define USB_OTG_DVBUSDIS_VBUSDT_Msk (0xFFFFUL << USB_OTG_DVBUSDIS_VBUSDT_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_DVBUSDIS_VBUSDT USB_OTG_DVBUSDIS_VBUSDT_Msk /*!< Device VBUS discharge time */
-
-/******************** Bit definition for OTG register ********************/
-#define USB_OTG_NPTXFSA_Pos (0U)
-#define USB_OTG_NPTXFSA_Msk (0xFFFFUL << USB_OTG_NPTXFSA_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_NPTXFSA USB_OTG_NPTXFSA_Msk /*!< Nonperiodic transmit RAM start address */
-#define USB_OTG_NPTXFD_Pos (16U)
-#define USB_OTG_NPTXFD_Msk (0xFFFFUL << USB_OTG_NPTXFD_Pos) /*!< 0xFFFF0000 */
-#define USB_OTG_NPTXFD USB_OTG_NPTXFD_Msk /*!< Nonperiodic TxFIFO depth */
-#define USB_OTG_TX0FSA_Pos (0U)
-#define USB_OTG_TX0FSA_Msk (0xFFFFUL << USB_OTG_TX0FSA_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_TX0FSA USB_OTG_TX0FSA_Msk /*!< Endpoint 0 transmit RAM start address */
-#define USB_OTG_TX0FD_Pos (16U)
-#define USB_OTG_TX0FD_Msk (0xFFFFUL << USB_OTG_TX0FD_Pos) /*!< 0xFFFF0000 */
-#define USB_OTG_TX0FD USB_OTG_TX0FD_Msk /*!< Endpoint 0 TxFIFO depth */
-
-/******************** Bit definition for USB_OTG_DVBUSPULSE register ********************/
-#define USB_OTG_DVBUSPULSE_DVBUSP_Pos (0U)
-#define USB_OTG_DVBUSPULSE_DVBUSP_Msk (0xFFFUL << USB_OTG_DVBUSPULSE_DVBUSP_Pos) /*!< 0x00000FFF */
-#define USB_OTG_DVBUSPULSE_DVBUSP USB_OTG_DVBUSPULSE_DVBUSP_Msk /*!< Device VBUS pulsing time */
-
-/******************** Bit definition for USB_OTG_GNPTXSTS register ********************/
-#define USB_OTG_GNPTXSTS_NPTXFSAV_Pos (0U)
-#define USB_OTG_GNPTXSTS_NPTXFSAV_Msk (0xFFFFUL << USB_OTG_GNPTXSTS_NPTXFSAV_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_GNPTXSTS_NPTXFSAV USB_OTG_GNPTXSTS_NPTXFSAV_Msk /*!< Nonperiodic TxFIFO space available */
-
-#define USB_OTG_GNPTXSTS_NPTQXSAV_Pos (16U)
-#define USB_OTG_GNPTXSTS_NPTQXSAV_Msk (0xFFUL << USB_OTG_GNPTXSTS_NPTQXSAV_Pos) /*!< 0x00FF0000 */
-#define USB_OTG_GNPTXSTS_NPTQXSAV USB_OTG_GNPTXSTS_NPTQXSAV_Msk /*!< Nonperiodic transmit request queue space available */
-#define USB_OTG_GNPTXSTS_NPTQXSAV_0 (0x01UL << USB_OTG_GNPTXSTS_NPTQXSAV_Pos) /*!< 0x00010000 */
-#define USB_OTG_GNPTXSTS_NPTQXSAV_1 (0x02UL << USB_OTG_GNPTXSTS_NPTQXSAV_Pos) /*!< 0x00020000 */
-#define USB_OTG_GNPTXSTS_NPTQXSAV_2 (0x04UL << USB_OTG_GNPTXSTS_NPTQXSAV_Pos) /*!< 0x00040000 */
-#define USB_OTG_GNPTXSTS_NPTQXSAV_3 (0x08UL << USB_OTG_GNPTXSTS_NPTQXSAV_Pos) /*!< 0x00080000 */
-#define USB_OTG_GNPTXSTS_NPTQXSAV_4 (0x10UL << USB_OTG_GNPTXSTS_NPTQXSAV_Pos) /*!< 0x00100000 */
-#define USB_OTG_GNPTXSTS_NPTQXSAV_5 (0x20UL << USB_OTG_GNPTXSTS_NPTQXSAV_Pos) /*!< 0x00200000 */
-#define USB_OTG_GNPTXSTS_NPTQXSAV_6 (0x40UL << USB_OTG_GNPTXSTS_NPTQXSAV_Pos) /*!< 0x00400000 */
-#define USB_OTG_GNPTXSTS_NPTQXSAV_7 (0x80UL << USB_OTG_GNPTXSTS_NPTQXSAV_Pos) /*!< 0x00800000 */
-
-#define USB_OTG_GNPTXSTS_NPTXQTOP_Pos (24U)
-#define USB_OTG_GNPTXSTS_NPTXQTOP_Msk (0x7FUL << USB_OTG_GNPTXSTS_NPTXQTOP_Pos) /*!< 0x7F000000 */
-#define USB_OTG_GNPTXSTS_NPTXQTOP USB_OTG_GNPTXSTS_NPTXQTOP_Msk /*!< Top of the nonperiodic transmit request queue */
-#define USB_OTG_GNPTXSTS_NPTXQTOP_0 (0x01UL << USB_OTG_GNPTXSTS_NPTXQTOP_Pos) /*!< 0x01000000 */
-#define USB_OTG_GNPTXSTS_NPTXQTOP_1 (0x02UL << USB_OTG_GNPTXSTS_NPTXQTOP_Pos) /*!< 0x02000000 */
-#define USB_OTG_GNPTXSTS_NPTXQTOP_2 (0x04UL << USB_OTG_GNPTXSTS_NPTXQTOP_Pos) /*!< 0x04000000 */
-#define USB_OTG_GNPTXSTS_NPTXQTOP_3 (0x08UL << USB_OTG_GNPTXSTS_NPTXQTOP_Pos) /*!< 0x08000000 */
-#define USB_OTG_GNPTXSTS_NPTXQTOP_4 (0x10UL << USB_OTG_GNPTXSTS_NPTXQTOP_Pos) /*!< 0x10000000 */
-#define USB_OTG_GNPTXSTS_NPTXQTOP_5 (0x20UL << USB_OTG_GNPTXSTS_NPTXQTOP_Pos) /*!< 0x20000000 */
-#define USB_OTG_GNPTXSTS_NPTXQTOP_6 (0x40UL << USB_OTG_GNPTXSTS_NPTXQTOP_Pos) /*!< 0x40000000 */
-
-/******************** Bit definition for USB_OTG_DTHRCTL register ********************/
-#define USB_OTG_DTHRCTL_NONISOTHREN_Pos (0U)
-#define USB_OTG_DTHRCTL_NONISOTHREN_Msk (0x1UL << USB_OTG_DTHRCTL_NONISOTHREN_Pos) /*!< 0x00000001 */
-#define USB_OTG_DTHRCTL_NONISOTHREN USB_OTG_DTHRCTL_NONISOTHREN_Msk /*!< Nonisochronous IN endpoints threshold enable */
-#define USB_OTG_DTHRCTL_ISOTHREN_Pos (1U)
-#define USB_OTG_DTHRCTL_ISOTHREN_Msk (0x1UL << USB_OTG_DTHRCTL_ISOTHREN_Pos) /*!< 0x00000002 */
-#define USB_OTG_DTHRCTL_ISOTHREN USB_OTG_DTHRCTL_ISOTHREN_Msk /*!< ISO IN endpoint threshold enable */
-
-#define USB_OTG_DTHRCTL_TXTHRLEN_Pos (2U)
-#define USB_OTG_DTHRCTL_TXTHRLEN_Msk (0x1FFUL << USB_OTG_DTHRCTL_TXTHRLEN_Pos) /*!< 0x000007FC */
-#define USB_OTG_DTHRCTL_TXTHRLEN USB_OTG_DTHRCTL_TXTHRLEN_Msk /*!< Transmit threshold length */
-#define USB_OTG_DTHRCTL_TXTHRLEN_0 (0x001UL << USB_OTG_DTHRCTL_TXTHRLEN_Pos) /*!< 0x00000004 */
-#define USB_OTG_DTHRCTL_TXTHRLEN_1 (0x002UL << USB_OTG_DTHRCTL_TXTHRLEN_Pos) /*!< 0x00000008 */
-#define USB_OTG_DTHRCTL_TXTHRLEN_2 (0x004UL << USB_OTG_DTHRCTL_TXTHRLEN_Pos) /*!< 0x00000010 */
-#define USB_OTG_DTHRCTL_TXTHRLEN_3 (0x008UL << USB_OTG_DTHRCTL_TXTHRLEN_Pos) /*!< 0x00000020 */
-#define USB_OTG_DTHRCTL_TXTHRLEN_4 (0x010UL << USB_OTG_DTHRCTL_TXTHRLEN_Pos) /*!< 0x00000040 */
-#define USB_OTG_DTHRCTL_TXTHRLEN_5 (0x020UL << USB_OTG_DTHRCTL_TXTHRLEN_Pos) /*!< 0x00000080 */
-#define USB_OTG_DTHRCTL_TXTHRLEN_6 (0x040UL << USB_OTG_DTHRCTL_TXTHRLEN_Pos) /*!< 0x00000100 */
-#define USB_OTG_DTHRCTL_TXTHRLEN_7 (0x080UL << USB_OTG_DTHRCTL_TXTHRLEN_Pos) /*!< 0x00000200 */
-#define USB_OTG_DTHRCTL_TXTHRLEN_8 (0x100UL << USB_OTG_DTHRCTL_TXTHRLEN_Pos) /*!< 0x00000400 */
-#define USB_OTG_DTHRCTL_RXTHREN_Pos (16U)
-#define USB_OTG_DTHRCTL_RXTHREN_Msk (0x1UL << USB_OTG_DTHRCTL_RXTHREN_Pos) /*!< 0x00010000 */
-#define USB_OTG_DTHRCTL_RXTHREN USB_OTG_DTHRCTL_RXTHREN_Msk /*!< Receive threshold enable */
-
-#define USB_OTG_DTHRCTL_RXTHRLEN_Pos (17U)
-#define USB_OTG_DTHRCTL_RXTHRLEN_Msk (0x1FFUL << USB_OTG_DTHRCTL_RXTHRLEN_Pos) /*!< 0x03FE0000 */
-#define USB_OTG_DTHRCTL_RXTHRLEN USB_OTG_DTHRCTL_RXTHRLEN_Msk /*!< Receive threshold length */
-#define USB_OTG_DTHRCTL_RXTHRLEN_0 (0x001UL << USB_OTG_DTHRCTL_RXTHRLEN_Pos) /*!< 0x00020000 */
-#define USB_OTG_DTHRCTL_RXTHRLEN_1 (0x002UL << USB_OTG_DTHRCTL_RXTHRLEN_Pos) /*!< 0x00040000 */
-#define USB_OTG_DTHRCTL_RXTHRLEN_2 (0x004UL << USB_OTG_DTHRCTL_RXTHRLEN_Pos) /*!< 0x00080000 */
-#define USB_OTG_DTHRCTL_RXTHRLEN_3 (0x008UL << USB_OTG_DTHRCTL_RXTHRLEN_Pos) /*!< 0x00100000 */
-#define USB_OTG_DTHRCTL_RXTHRLEN_4 (0x010UL << USB_OTG_DTHRCTL_RXTHRLEN_Pos) /*!< 0x00200000 */
-#define USB_OTG_DTHRCTL_RXTHRLEN_5 (0x020UL << USB_OTG_DTHRCTL_RXTHRLEN_Pos) /*!< 0x00400000 */
-#define USB_OTG_DTHRCTL_RXTHRLEN_6 (0x040UL << USB_OTG_DTHRCTL_RXTHRLEN_Pos) /*!< 0x00800000 */
-#define USB_OTG_DTHRCTL_RXTHRLEN_7 (0x080UL << USB_OTG_DTHRCTL_RXTHRLEN_Pos) /*!< 0x01000000 */
-#define USB_OTG_DTHRCTL_RXTHRLEN_8 (0x100UL << USB_OTG_DTHRCTL_RXTHRLEN_Pos) /*!< 0x02000000 */
-#define USB_OTG_DTHRCTL_ARPEN_Pos (27U)
-#define USB_OTG_DTHRCTL_ARPEN_Msk (0x1UL << USB_OTG_DTHRCTL_ARPEN_Pos) /*!< 0x08000000 */
-#define USB_OTG_DTHRCTL_ARPEN USB_OTG_DTHRCTL_ARPEN_Msk /*!< Arbiter parking enable */
-
-/******************** Bit definition for USB_OTG_DIEPEMPMSK register ********************/
-#define USB_OTG_DIEPEMPMSK_INEPTXFEM_Pos (0U)
-#define USB_OTG_DIEPEMPMSK_INEPTXFEM_Msk (0xFFFFUL << USB_OTG_DIEPEMPMSK_INEPTXFEM_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_DIEPEMPMSK_INEPTXFEM USB_OTG_DIEPEMPMSK_INEPTXFEM_Msk /*!< IN EP Tx FIFO empty interrupt mask bits */
-
-/******************** Bit definition for USB_OTG_DEACHINT register ********************/
-#define USB_OTG_DEACHINT_IEP1INT_Pos (1U)
-#define USB_OTG_DEACHINT_IEP1INT_Msk (0x1UL << USB_OTG_DEACHINT_IEP1INT_Pos) /*!< 0x00000002 */
-#define USB_OTG_DEACHINT_IEP1INT USB_OTG_DEACHINT_IEP1INT_Msk /*!< IN endpoint 1interrupt bit */
-#define USB_OTG_DEACHINT_OEP1INT_Pos (17U)
-#define USB_OTG_DEACHINT_OEP1INT_Msk (0x1UL << USB_OTG_DEACHINT_OEP1INT_Pos) /*!< 0x00020000 */
-#define USB_OTG_DEACHINT_OEP1INT USB_OTG_DEACHINT_OEP1INT_Msk /*!< OUT endpoint 1 interrupt bit */
-
-/******************** Bit definition for USB_OTG_GCCFG register ********************/
-#define USB_OTG_GCCFG_PWRDWN_Pos (16U)
-#define USB_OTG_GCCFG_PWRDWN_Msk (0x1UL << USB_OTG_GCCFG_PWRDWN_Pos) /*!< 0x00010000 */
-#define USB_OTG_GCCFG_PWRDWN USB_OTG_GCCFG_PWRDWN_Msk /*!< Power down */
-#define USB_OTG_GCCFG_VBUSASEN_Pos (18U)
-#define USB_OTG_GCCFG_VBUSASEN_Msk (0x1UL << USB_OTG_GCCFG_VBUSASEN_Pos) /*!< 0x00040000 */
-#define USB_OTG_GCCFG_VBUSASEN USB_OTG_GCCFG_VBUSASEN_Msk /*!< Enable the VBUS sensing device */
-#define USB_OTG_GCCFG_VBUSBSEN_Pos (19U)
-#define USB_OTG_GCCFG_VBUSBSEN_Msk (0x1UL << USB_OTG_GCCFG_VBUSBSEN_Pos) /*!< 0x00080000 */
-#define USB_OTG_GCCFG_VBUSBSEN USB_OTG_GCCFG_VBUSBSEN_Msk /*!< Enable the VBUS sensing device */
-#define USB_OTG_GCCFG_SOFOUTEN_Pos (20U)
-#define USB_OTG_GCCFG_SOFOUTEN_Msk (0x1UL << USB_OTG_GCCFG_SOFOUTEN_Pos) /*!< 0x00100000 */
-#define USB_OTG_GCCFG_SOFOUTEN USB_OTG_GCCFG_SOFOUTEN_Msk /*!< SOF output enable */
-
-/******************** Bit definition for USB_OTG_DEACHINTMSK register ********************/
-#define USB_OTG_DEACHINTMSK_IEP1INTM_Pos (1U)
-#define USB_OTG_DEACHINTMSK_IEP1INTM_Msk (0x1UL << USB_OTG_DEACHINTMSK_IEP1INTM_Pos) /*!< 0x00000002 */
-#define USB_OTG_DEACHINTMSK_IEP1INTM USB_OTG_DEACHINTMSK_IEP1INTM_Msk /*!< IN Endpoint 1 interrupt mask bit */
-#define USB_OTG_DEACHINTMSK_OEP1INTM_Pos (17U)
-#define USB_OTG_DEACHINTMSK_OEP1INTM_Msk (0x1UL << USB_OTG_DEACHINTMSK_OEP1INTM_Pos) /*!< 0x00020000 */
-#define USB_OTG_DEACHINTMSK_OEP1INTM USB_OTG_DEACHINTMSK_OEP1INTM_Msk /*!< OUT Endpoint 1 interrupt mask bit */
-
-/******************** Bit definition for USB_OTG_CID register ********************/
-#define USB_OTG_CID_PRODUCT_ID_Pos (0U)
-#define USB_OTG_CID_PRODUCT_ID_Msk (0xFFFFFFFFUL << USB_OTG_CID_PRODUCT_ID_Pos) /*!< 0xFFFFFFFF */
-#define USB_OTG_CID_PRODUCT_ID USB_OTG_CID_PRODUCT_ID_Msk /*!< Product ID field */
-
-/******************** Bit definition for USB_OTG_DIEPEACHMSK1 register ********************/
-#define USB_OTG_DIEPEACHMSK1_XFRCM_Pos (0U)
-#define USB_OTG_DIEPEACHMSK1_XFRCM_Msk (0x1UL << USB_OTG_DIEPEACHMSK1_XFRCM_Pos) /*!< 0x00000001 */
-#define USB_OTG_DIEPEACHMSK1_XFRCM USB_OTG_DIEPEACHMSK1_XFRCM_Msk /*!< Transfer completed interrupt mask */
-#define USB_OTG_DIEPEACHMSK1_EPDM_Pos (1U)
-#define USB_OTG_DIEPEACHMSK1_EPDM_Msk (0x1UL << USB_OTG_DIEPEACHMSK1_EPDM_Pos) /*!< 0x00000002 */
-#define USB_OTG_DIEPEACHMSK1_EPDM USB_OTG_DIEPEACHMSK1_EPDM_Msk /*!< Endpoint disabled interrupt mask */
-#define USB_OTG_DIEPEACHMSK1_TOM_Pos (3U)
-#define USB_OTG_DIEPEACHMSK1_TOM_Msk (0x1UL << USB_OTG_DIEPEACHMSK1_TOM_Pos) /*!< 0x00000008 */
-#define USB_OTG_DIEPEACHMSK1_TOM USB_OTG_DIEPEACHMSK1_TOM_Msk /*!< Timeout condition mask (nonisochronous endpoints) */
-#define USB_OTG_DIEPEACHMSK1_ITTXFEMSK_Pos (4U)
-#define USB_OTG_DIEPEACHMSK1_ITTXFEMSK_Msk (0x1UL << USB_OTG_DIEPEACHMSK1_ITTXFEMSK_Pos) /*!< 0x00000010 */
-#define USB_OTG_DIEPEACHMSK1_ITTXFEMSK USB_OTG_DIEPEACHMSK1_ITTXFEMSK_Msk /*!< IN token received when TxFIFO empty mask */
-#define USB_OTG_DIEPEACHMSK1_INEPNMM_Pos (5U)
-#define USB_OTG_DIEPEACHMSK1_INEPNMM_Msk (0x1UL << USB_OTG_DIEPEACHMSK1_INEPNMM_Pos) /*!< 0x00000020 */
-#define USB_OTG_DIEPEACHMSK1_INEPNMM USB_OTG_DIEPEACHMSK1_INEPNMM_Msk /*!< IN token received with EP mismatch mask */
-#define USB_OTG_DIEPEACHMSK1_INEPNEM_Pos (6U)
-#define USB_OTG_DIEPEACHMSK1_INEPNEM_Msk (0x1UL << USB_OTG_DIEPEACHMSK1_INEPNEM_Pos) /*!< 0x00000040 */
-#define USB_OTG_DIEPEACHMSK1_INEPNEM USB_OTG_DIEPEACHMSK1_INEPNEM_Msk /*!< IN endpoint NAK effective mask */
-#define USB_OTG_DIEPEACHMSK1_TXFURM_Pos (8U)
-#define USB_OTG_DIEPEACHMSK1_TXFURM_Msk (0x1UL << USB_OTG_DIEPEACHMSK1_TXFURM_Pos) /*!< 0x00000100 */
-#define USB_OTG_DIEPEACHMSK1_TXFURM USB_OTG_DIEPEACHMSK1_TXFURM_Msk /*!< FIFO underrun mask */
-#define USB_OTG_DIEPEACHMSK1_BIM_Pos (9U)
-#define USB_OTG_DIEPEACHMSK1_BIM_Msk (0x1UL << USB_OTG_DIEPEACHMSK1_BIM_Pos) /*!< 0x00000200 */
-#define USB_OTG_DIEPEACHMSK1_BIM USB_OTG_DIEPEACHMSK1_BIM_Msk /*!< BNA interrupt mask */
-#define USB_OTG_DIEPEACHMSK1_NAKM_Pos (13U)
-#define USB_OTG_DIEPEACHMSK1_NAKM_Msk (0x1UL << USB_OTG_DIEPEACHMSK1_NAKM_Pos) /*!< 0x00002000 */
-#define USB_OTG_DIEPEACHMSK1_NAKM USB_OTG_DIEPEACHMSK1_NAKM_Msk /*!< NAK interrupt mask */
-
-/******************** Bit definition for USB_OTG_HPRT register ********************/
-#define USB_OTG_HPRT_PCSTS_Pos (0U)
-#define USB_OTG_HPRT_PCSTS_Msk (0x1UL << USB_OTG_HPRT_PCSTS_Pos) /*!< 0x00000001 */
-#define USB_OTG_HPRT_PCSTS USB_OTG_HPRT_PCSTS_Msk /*!< Port connect status */
-#define USB_OTG_HPRT_PCDET_Pos (1U)
-#define USB_OTG_HPRT_PCDET_Msk (0x1UL << USB_OTG_HPRT_PCDET_Pos) /*!< 0x00000002 */
-#define USB_OTG_HPRT_PCDET USB_OTG_HPRT_PCDET_Msk /*!< Port connect detected */
-#define USB_OTG_HPRT_PENA_Pos (2U)
-#define USB_OTG_HPRT_PENA_Msk (0x1UL << USB_OTG_HPRT_PENA_Pos) /*!< 0x00000004 */
-#define USB_OTG_HPRT_PENA USB_OTG_HPRT_PENA_Msk /*!< Port enable */
-#define USB_OTG_HPRT_PENCHNG_Pos (3U)
-#define USB_OTG_HPRT_PENCHNG_Msk (0x1UL << USB_OTG_HPRT_PENCHNG_Pos) /*!< 0x00000008 */
-#define USB_OTG_HPRT_PENCHNG USB_OTG_HPRT_PENCHNG_Msk /*!< Port enable/disable change */
-#define USB_OTG_HPRT_POCA_Pos (4U)
-#define USB_OTG_HPRT_POCA_Msk (0x1UL << USB_OTG_HPRT_POCA_Pos) /*!< 0x00000010 */
-#define USB_OTG_HPRT_POCA USB_OTG_HPRT_POCA_Msk /*!< Port overcurrent active */
-#define USB_OTG_HPRT_POCCHNG_Pos (5U)
-#define USB_OTG_HPRT_POCCHNG_Msk (0x1UL << USB_OTG_HPRT_POCCHNG_Pos) /*!< 0x00000020 */
-#define USB_OTG_HPRT_POCCHNG USB_OTG_HPRT_POCCHNG_Msk /*!< Port overcurrent change */
-#define USB_OTG_HPRT_PRES_Pos (6U)
-#define USB_OTG_HPRT_PRES_Msk (0x1UL << USB_OTG_HPRT_PRES_Pos) /*!< 0x00000040 */
-#define USB_OTG_HPRT_PRES USB_OTG_HPRT_PRES_Msk /*!< Port resume */
-#define USB_OTG_HPRT_PSUSP_Pos (7U)
-#define USB_OTG_HPRT_PSUSP_Msk (0x1UL << USB_OTG_HPRT_PSUSP_Pos) /*!< 0x00000080 */
-#define USB_OTG_HPRT_PSUSP USB_OTG_HPRT_PSUSP_Msk /*!< Port suspend */
-#define USB_OTG_HPRT_PRST_Pos (8U)
-#define USB_OTG_HPRT_PRST_Msk (0x1UL << USB_OTG_HPRT_PRST_Pos) /*!< 0x00000100 */
-#define USB_OTG_HPRT_PRST USB_OTG_HPRT_PRST_Msk /*!< Port reset */
-
-#define USB_OTG_HPRT_PLSTS_Pos (10U)
-#define USB_OTG_HPRT_PLSTS_Msk (0x3UL << USB_OTG_HPRT_PLSTS_Pos) /*!< 0x00000C00 */
-#define USB_OTG_HPRT_PLSTS USB_OTG_HPRT_PLSTS_Msk /*!< Port line status */
-#define USB_OTG_HPRT_PLSTS_0 (0x1UL << USB_OTG_HPRT_PLSTS_Pos) /*!< 0x00000400 */
-#define USB_OTG_HPRT_PLSTS_1 (0x2UL << USB_OTG_HPRT_PLSTS_Pos) /*!< 0x00000800 */
-#define USB_OTG_HPRT_PPWR_Pos (12U)
-#define USB_OTG_HPRT_PPWR_Msk (0x1UL << USB_OTG_HPRT_PPWR_Pos) /*!< 0x00001000 */
-#define USB_OTG_HPRT_PPWR USB_OTG_HPRT_PPWR_Msk /*!< Port power */
-
-#define USB_OTG_HPRT_PTCTL_Pos (13U)
-#define USB_OTG_HPRT_PTCTL_Msk (0xFUL << USB_OTG_HPRT_PTCTL_Pos) /*!< 0x0001E000 */
-#define USB_OTG_HPRT_PTCTL USB_OTG_HPRT_PTCTL_Msk /*!< Port test control */
-#define USB_OTG_HPRT_PTCTL_0 (0x1UL << USB_OTG_HPRT_PTCTL_Pos) /*!< 0x00002000 */
-#define USB_OTG_HPRT_PTCTL_1 (0x2UL << USB_OTG_HPRT_PTCTL_Pos) /*!< 0x00004000 */
-#define USB_OTG_HPRT_PTCTL_2 (0x4UL << USB_OTG_HPRT_PTCTL_Pos) /*!< 0x00008000 */
-#define USB_OTG_HPRT_PTCTL_3 (0x8UL << USB_OTG_HPRT_PTCTL_Pos) /*!< 0x00010000 */
-
-#define USB_OTG_HPRT_PSPD_Pos (17U)
-#define USB_OTG_HPRT_PSPD_Msk (0x3UL << USB_OTG_HPRT_PSPD_Pos) /*!< 0x00060000 */
-#define USB_OTG_HPRT_PSPD USB_OTG_HPRT_PSPD_Msk /*!< Port speed */
-#define USB_OTG_HPRT_PSPD_0 (0x1UL << USB_OTG_HPRT_PSPD_Pos) /*!< 0x00020000 */
-#define USB_OTG_HPRT_PSPD_1 (0x2UL << USB_OTG_HPRT_PSPD_Pos) /*!< 0x00040000 */
-
-/******************** Bit definition for USB_OTG_DOEPEACHMSK1 register ********************/
-#define USB_OTG_DOEPEACHMSK1_XFRCM_Pos (0U)
-#define USB_OTG_DOEPEACHMSK1_XFRCM_Msk (0x1UL << USB_OTG_DOEPEACHMSK1_XFRCM_Pos) /*!< 0x00000001 */
-#define USB_OTG_DOEPEACHMSK1_XFRCM USB_OTG_DOEPEACHMSK1_XFRCM_Msk /*!< Transfer completed interrupt mask */
-#define USB_OTG_DOEPEACHMSK1_EPDM_Pos (1U)
-#define USB_OTG_DOEPEACHMSK1_EPDM_Msk (0x1UL << USB_OTG_DOEPEACHMSK1_EPDM_Pos) /*!< 0x00000002 */
-#define USB_OTG_DOEPEACHMSK1_EPDM USB_OTG_DOEPEACHMSK1_EPDM_Msk /*!< Endpoint disabled interrupt mask */
-#define USB_OTG_DOEPEACHMSK1_TOM_Pos (3U)
-#define USB_OTG_DOEPEACHMSK1_TOM_Msk (0x1UL << USB_OTG_DOEPEACHMSK1_TOM_Pos) /*!< 0x00000008 */
-#define USB_OTG_DOEPEACHMSK1_TOM USB_OTG_DOEPEACHMSK1_TOM_Msk /*!< Timeout condition mask */
-#define USB_OTG_DOEPEACHMSK1_ITTXFEMSK_Pos (4U)
-#define USB_OTG_DOEPEACHMSK1_ITTXFEMSK_Msk (0x1UL << USB_OTG_DOEPEACHMSK1_ITTXFEMSK_Pos) /*!< 0x00000010 */
-#define USB_OTG_DOEPEACHMSK1_ITTXFEMSK USB_OTG_DOEPEACHMSK1_ITTXFEMSK_Msk /*!< IN token received when TxFIFO empty mask */
-#define USB_OTG_DOEPEACHMSK1_INEPNMM_Pos (5U)
-#define USB_OTG_DOEPEACHMSK1_INEPNMM_Msk (0x1UL << USB_OTG_DOEPEACHMSK1_INEPNMM_Pos) /*!< 0x00000020 */
-#define USB_OTG_DOEPEACHMSK1_INEPNMM USB_OTG_DOEPEACHMSK1_INEPNMM_Msk /*!< IN token received with EP mismatch mask */
-#define USB_OTG_DOEPEACHMSK1_INEPNEM_Pos (6U)
-#define USB_OTG_DOEPEACHMSK1_INEPNEM_Msk (0x1UL << USB_OTG_DOEPEACHMSK1_INEPNEM_Pos) /*!< 0x00000040 */
-#define USB_OTG_DOEPEACHMSK1_INEPNEM USB_OTG_DOEPEACHMSK1_INEPNEM_Msk /*!< IN endpoint NAK effective mask */
-#define USB_OTG_DOEPEACHMSK1_TXFURM_Pos (8U)
-#define USB_OTG_DOEPEACHMSK1_TXFURM_Msk (0x1UL << USB_OTG_DOEPEACHMSK1_TXFURM_Pos) /*!< 0x00000100 */
-#define USB_OTG_DOEPEACHMSK1_TXFURM USB_OTG_DOEPEACHMSK1_TXFURM_Msk /*!< OUT packet error mask */
-#define USB_OTG_DOEPEACHMSK1_BIM_Pos (9U)
-#define USB_OTG_DOEPEACHMSK1_BIM_Msk (0x1UL << USB_OTG_DOEPEACHMSK1_BIM_Pos) /*!< 0x00000200 */
-#define USB_OTG_DOEPEACHMSK1_BIM USB_OTG_DOEPEACHMSK1_BIM_Msk /*!< BNA interrupt mask */
-#define USB_OTG_DOEPEACHMSK1_BERRM_Pos (12U)
-#define USB_OTG_DOEPEACHMSK1_BERRM_Msk (0x1UL << USB_OTG_DOEPEACHMSK1_BERRM_Pos) /*!< 0x00001000 */
-#define USB_OTG_DOEPEACHMSK1_BERRM USB_OTG_DOEPEACHMSK1_BERRM_Msk /*!< Bubble error interrupt mask */
-#define USB_OTG_DOEPEACHMSK1_NAKM_Pos (13U)
-#define USB_OTG_DOEPEACHMSK1_NAKM_Msk (0x1UL << USB_OTG_DOEPEACHMSK1_NAKM_Pos) /*!< 0x00002000 */
-#define USB_OTG_DOEPEACHMSK1_NAKM USB_OTG_DOEPEACHMSK1_NAKM_Msk /*!< NAK interrupt mask */
-#define USB_OTG_DOEPEACHMSK1_NYETM_Pos (14U)
-#define USB_OTG_DOEPEACHMSK1_NYETM_Msk (0x1UL << USB_OTG_DOEPEACHMSK1_NYETM_Pos) /*!< 0x00004000 */
-#define USB_OTG_DOEPEACHMSK1_NYETM USB_OTG_DOEPEACHMSK1_NYETM_Msk /*!< NYET interrupt mask */
-
-/******************** Bit definition for USB_OTG_HPTXFSIZ register ********************/
-#define USB_OTG_HPTXFSIZ_PTXSA_Pos (0U)
-#define USB_OTG_HPTXFSIZ_PTXSA_Msk (0xFFFFUL << USB_OTG_HPTXFSIZ_PTXSA_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_HPTXFSIZ_PTXSA USB_OTG_HPTXFSIZ_PTXSA_Msk /*!< Host periodic TxFIFO start address */
-#define USB_OTG_HPTXFSIZ_PTXFD_Pos (16U)
-#define USB_OTG_HPTXFSIZ_PTXFD_Msk (0xFFFFUL << USB_OTG_HPTXFSIZ_PTXFD_Pos) /*!< 0xFFFF0000 */
-#define USB_OTG_HPTXFSIZ_PTXFD USB_OTG_HPTXFSIZ_PTXFD_Msk /*!< Host periodic TxFIFO depth */
-
-/******************** Bit definition for USB_OTG_DIEPCTL register ********************/
-#define USB_OTG_DIEPCTL_MPSIZ_Pos (0U)
-#define USB_OTG_DIEPCTL_MPSIZ_Msk (0x7FFUL << USB_OTG_DIEPCTL_MPSIZ_Pos) /*!< 0x000007FF */
-#define USB_OTG_DIEPCTL_MPSIZ USB_OTG_DIEPCTL_MPSIZ_Msk /*!< Maximum packet size */
-#define USB_OTG_DIEPCTL_USBAEP_Pos (15U)
-#define USB_OTG_DIEPCTL_USBAEP_Msk (0x1UL << USB_OTG_DIEPCTL_USBAEP_Pos) /*!< 0x00008000 */
-#define USB_OTG_DIEPCTL_USBAEP USB_OTG_DIEPCTL_USBAEP_Msk /*!< USB active endpoint */
-#define USB_OTG_DIEPCTL_EONUM_DPID_Pos (16U)
-#define USB_OTG_DIEPCTL_EONUM_DPID_Msk (0x1UL << USB_OTG_DIEPCTL_EONUM_DPID_Pos) /*!< 0x00010000 */
-#define USB_OTG_DIEPCTL_EONUM_DPID USB_OTG_DIEPCTL_EONUM_DPID_Msk /*!< Even/odd frame */
-#define USB_OTG_DIEPCTL_NAKSTS_Pos (17U)
-#define USB_OTG_DIEPCTL_NAKSTS_Msk (0x1UL << USB_OTG_DIEPCTL_NAKSTS_Pos) /*!< 0x00020000 */
-#define USB_OTG_DIEPCTL_NAKSTS USB_OTG_DIEPCTL_NAKSTS_Msk /*!< NAK status */
-
-#define USB_OTG_DIEPCTL_EPTYP_Pos (18U)
-#define USB_OTG_DIEPCTL_EPTYP_Msk (0x3UL << USB_OTG_DIEPCTL_EPTYP_Pos) /*!< 0x000C0000 */
-#define USB_OTG_DIEPCTL_EPTYP USB_OTG_DIEPCTL_EPTYP_Msk /*!< Endpoint type */
-#define USB_OTG_DIEPCTL_EPTYP_0 (0x1UL << USB_OTG_DIEPCTL_EPTYP_Pos) /*!< 0x00040000 */
-#define USB_OTG_DIEPCTL_EPTYP_1 (0x2UL << USB_OTG_DIEPCTL_EPTYP_Pos) /*!< 0x00080000 */
-#define USB_OTG_DIEPCTL_STALL_Pos (21U)
-#define USB_OTG_DIEPCTL_STALL_Msk (0x1UL << USB_OTG_DIEPCTL_STALL_Pos) /*!< 0x00200000 */
-#define USB_OTG_DIEPCTL_STALL USB_OTG_DIEPCTL_STALL_Msk /*!< STALL handshake */
-
-#define USB_OTG_DIEPCTL_TXFNUM_Pos (22U)
-#define USB_OTG_DIEPCTL_TXFNUM_Msk (0xFUL << USB_OTG_DIEPCTL_TXFNUM_Pos) /*!< 0x03C00000 */
-#define USB_OTG_DIEPCTL_TXFNUM USB_OTG_DIEPCTL_TXFNUM_Msk /*!< TxFIFO number */
-#define USB_OTG_DIEPCTL_TXFNUM_0 (0x1UL << USB_OTG_DIEPCTL_TXFNUM_Pos) /*!< 0x00400000 */
-#define USB_OTG_DIEPCTL_TXFNUM_1 (0x2UL << USB_OTG_DIEPCTL_TXFNUM_Pos) /*!< 0x00800000 */
-#define USB_OTG_DIEPCTL_TXFNUM_2 (0x4UL << USB_OTG_DIEPCTL_TXFNUM_Pos) /*!< 0x01000000 */
-#define USB_OTG_DIEPCTL_TXFNUM_3 (0x8UL << USB_OTG_DIEPCTL_TXFNUM_Pos) /*!< 0x02000000 */
-#define USB_OTG_DIEPCTL_CNAK_Pos (26U)
-#define USB_OTG_DIEPCTL_CNAK_Msk (0x1UL << USB_OTG_DIEPCTL_CNAK_Pos) /*!< 0x04000000 */
-#define USB_OTG_DIEPCTL_CNAK USB_OTG_DIEPCTL_CNAK_Msk /*!< Clear NAK */
-#define USB_OTG_DIEPCTL_SNAK_Pos (27U)
-#define USB_OTG_DIEPCTL_SNAK_Msk (0x1UL << USB_OTG_DIEPCTL_SNAK_Pos) /*!< 0x08000000 */
-#define USB_OTG_DIEPCTL_SNAK USB_OTG_DIEPCTL_SNAK_Msk /*!< Set NAK */
-#define USB_OTG_DIEPCTL_SD0PID_SEVNFRM_Pos (28U)
-#define USB_OTG_DIEPCTL_SD0PID_SEVNFRM_Msk (0x1UL << USB_OTG_DIEPCTL_SD0PID_SEVNFRM_Pos) /*!< 0x10000000 */
-#define USB_OTG_DIEPCTL_SD0PID_SEVNFRM USB_OTG_DIEPCTL_SD0PID_SEVNFRM_Msk /*!< Set DATA0 PID */
-#define USB_OTG_DIEPCTL_SODDFRM_Pos (29U)
-#define USB_OTG_DIEPCTL_SODDFRM_Msk (0x1UL << USB_OTG_DIEPCTL_SODDFRM_Pos) /*!< 0x20000000 */
-#define USB_OTG_DIEPCTL_SODDFRM USB_OTG_DIEPCTL_SODDFRM_Msk /*!< Set odd frame */
-#define USB_OTG_DIEPCTL_EPDIS_Pos (30U)
-#define USB_OTG_DIEPCTL_EPDIS_Msk (0x1UL << USB_OTG_DIEPCTL_EPDIS_Pos) /*!< 0x40000000 */
-#define USB_OTG_DIEPCTL_EPDIS USB_OTG_DIEPCTL_EPDIS_Msk /*!< Endpoint disable */
-#define USB_OTG_DIEPCTL_EPENA_Pos (31U)
-#define USB_OTG_DIEPCTL_EPENA_Msk (0x1UL << USB_OTG_DIEPCTL_EPENA_Pos) /*!< 0x80000000 */
-#define USB_OTG_DIEPCTL_EPENA USB_OTG_DIEPCTL_EPENA_Msk /*!< Endpoint enable */
-
-/******************** Bit definition for USB_OTG_HCCHAR register ********************/
-#define USB_OTG_HCCHAR_MPSIZ_Pos (0U)
-#define USB_OTG_HCCHAR_MPSIZ_Msk (0x7FFUL << USB_OTG_HCCHAR_MPSIZ_Pos) /*!< 0x000007FF */
-#define USB_OTG_HCCHAR_MPSIZ USB_OTG_HCCHAR_MPSIZ_Msk /*!< Maximum packet size */
-
-#define USB_OTG_HCCHAR_EPNUM_Pos (11U)
-#define USB_OTG_HCCHAR_EPNUM_Msk (0xFUL << USB_OTG_HCCHAR_EPNUM_Pos) /*!< 0x00007800 */
-#define USB_OTG_HCCHAR_EPNUM USB_OTG_HCCHAR_EPNUM_Msk /*!< Endpoint number */
-#define USB_OTG_HCCHAR_EPNUM_0 (0x1UL << USB_OTG_HCCHAR_EPNUM_Pos) /*!< 0x00000800 */
-#define USB_OTG_HCCHAR_EPNUM_1 (0x2UL << USB_OTG_HCCHAR_EPNUM_Pos) /*!< 0x00001000 */
-#define USB_OTG_HCCHAR_EPNUM_2 (0x4UL << USB_OTG_HCCHAR_EPNUM_Pos) /*!< 0x00002000 */
-#define USB_OTG_HCCHAR_EPNUM_3 (0x8UL << USB_OTG_HCCHAR_EPNUM_Pos) /*!< 0x00004000 */
-#define USB_OTG_HCCHAR_EPDIR_Pos (15U)
-#define USB_OTG_HCCHAR_EPDIR_Msk (0x1UL << USB_OTG_HCCHAR_EPDIR_Pos) /*!< 0x00008000 */
-#define USB_OTG_HCCHAR_EPDIR USB_OTG_HCCHAR_EPDIR_Msk /*!< Endpoint direction */
-#define USB_OTG_HCCHAR_LSDEV_Pos (17U)
-#define USB_OTG_HCCHAR_LSDEV_Msk (0x1UL << USB_OTG_HCCHAR_LSDEV_Pos) /*!< 0x00020000 */
-#define USB_OTG_HCCHAR_LSDEV USB_OTG_HCCHAR_LSDEV_Msk /*!< Low-speed device */
-
-#define USB_OTG_HCCHAR_EPTYP_Pos (18U)
-#define USB_OTG_HCCHAR_EPTYP_Msk (0x3UL << USB_OTG_HCCHAR_EPTYP_Pos) /*!< 0x000C0000 */
-#define USB_OTG_HCCHAR_EPTYP USB_OTG_HCCHAR_EPTYP_Msk /*!< Endpoint type */
-#define USB_OTG_HCCHAR_EPTYP_0 (0x1UL << USB_OTG_HCCHAR_EPTYP_Pos) /*!< 0x00040000 */
-#define USB_OTG_HCCHAR_EPTYP_1 (0x2UL << USB_OTG_HCCHAR_EPTYP_Pos) /*!< 0x00080000 */
-
-#define USB_OTG_HCCHAR_MC_Pos (20U)
-#define USB_OTG_HCCHAR_MC_Msk (0x3UL << USB_OTG_HCCHAR_MC_Pos) /*!< 0x00300000 */
-#define USB_OTG_HCCHAR_MC USB_OTG_HCCHAR_MC_Msk /*!< Multi Count (MC) / Error Count (EC) */
-#define USB_OTG_HCCHAR_MC_0 (0x1UL << USB_OTG_HCCHAR_MC_Pos) /*!< 0x00100000 */
-#define USB_OTG_HCCHAR_MC_1 (0x2UL << USB_OTG_HCCHAR_MC_Pos) /*!< 0x00200000 */
-
-#define USB_OTG_HCCHAR_DAD_Pos (22U)
-#define USB_OTG_HCCHAR_DAD_Msk (0x7FUL << USB_OTG_HCCHAR_DAD_Pos) /*!< 0x1FC00000 */
-#define USB_OTG_HCCHAR_DAD USB_OTG_HCCHAR_DAD_Msk /*!< Device address */
-#define USB_OTG_HCCHAR_DAD_0 (0x01UL << USB_OTG_HCCHAR_DAD_Pos) /*!< 0x00400000 */
-#define USB_OTG_HCCHAR_DAD_1 (0x02UL << USB_OTG_HCCHAR_DAD_Pos) /*!< 0x00800000 */
-#define USB_OTG_HCCHAR_DAD_2 (0x04UL << USB_OTG_HCCHAR_DAD_Pos) /*!< 0x01000000 */
-#define USB_OTG_HCCHAR_DAD_3 (0x08UL << USB_OTG_HCCHAR_DAD_Pos) /*!< 0x02000000 */
-#define USB_OTG_HCCHAR_DAD_4 (0x10UL << USB_OTG_HCCHAR_DAD_Pos) /*!< 0x04000000 */
-#define USB_OTG_HCCHAR_DAD_5 (0x20UL << USB_OTG_HCCHAR_DAD_Pos) /*!< 0x08000000 */
-#define USB_OTG_HCCHAR_DAD_6 (0x40UL << USB_OTG_HCCHAR_DAD_Pos) /*!< 0x10000000 */
-#define USB_OTG_HCCHAR_ODDFRM_Pos (29U)
-#define USB_OTG_HCCHAR_ODDFRM_Msk (0x1UL << USB_OTG_HCCHAR_ODDFRM_Pos) /*!< 0x20000000 */
-#define USB_OTG_HCCHAR_ODDFRM USB_OTG_HCCHAR_ODDFRM_Msk /*!< Odd frame */
-#define USB_OTG_HCCHAR_CHDIS_Pos (30U)
-#define USB_OTG_HCCHAR_CHDIS_Msk (0x1UL << USB_OTG_HCCHAR_CHDIS_Pos) /*!< 0x40000000 */
-#define USB_OTG_HCCHAR_CHDIS USB_OTG_HCCHAR_CHDIS_Msk /*!< Channel disable */
-#define USB_OTG_HCCHAR_CHENA_Pos (31U)
-#define USB_OTG_HCCHAR_CHENA_Msk (0x1UL << USB_OTG_HCCHAR_CHENA_Pos) /*!< 0x80000000 */
-#define USB_OTG_HCCHAR_CHENA USB_OTG_HCCHAR_CHENA_Msk /*!< Channel enable */
-
-/******************** Bit definition for USB_OTG_HCSPLT register ********************/
-
-#define USB_OTG_HCSPLT_PRTADDR_Pos (0U)
-#define USB_OTG_HCSPLT_PRTADDR_Msk (0x7FUL << USB_OTG_HCSPLT_PRTADDR_Pos) /*!< 0x0000007F */
-#define USB_OTG_HCSPLT_PRTADDR USB_OTG_HCSPLT_PRTADDR_Msk /*!< Port address */
-#define USB_OTG_HCSPLT_PRTADDR_0 (0x01UL << USB_OTG_HCSPLT_PRTADDR_Pos) /*!< 0x00000001 */
-#define USB_OTG_HCSPLT_PRTADDR_1 (0x02UL << USB_OTG_HCSPLT_PRTADDR_Pos) /*!< 0x00000002 */
-#define USB_OTG_HCSPLT_PRTADDR_2 (0x04UL << USB_OTG_HCSPLT_PRTADDR_Pos) /*!< 0x00000004 */
-#define USB_OTG_HCSPLT_PRTADDR_3 (0x08UL << USB_OTG_HCSPLT_PRTADDR_Pos) /*!< 0x00000008 */
-#define USB_OTG_HCSPLT_PRTADDR_4 (0x10UL << USB_OTG_HCSPLT_PRTADDR_Pos) /*!< 0x00000010 */
-#define USB_OTG_HCSPLT_PRTADDR_5 (0x20UL << USB_OTG_HCSPLT_PRTADDR_Pos) /*!< 0x00000020 */
-#define USB_OTG_HCSPLT_PRTADDR_6 (0x40UL << USB_OTG_HCSPLT_PRTADDR_Pos) /*!< 0x00000040 */
-
-#define USB_OTG_HCSPLT_HUBADDR_Pos (7U)
-#define USB_OTG_HCSPLT_HUBADDR_Msk (0x7FUL << USB_OTG_HCSPLT_HUBADDR_Pos) /*!< 0x00003F80 */
-#define USB_OTG_HCSPLT_HUBADDR USB_OTG_HCSPLT_HUBADDR_Msk /*!< Hub address */
-#define USB_OTG_HCSPLT_HUBADDR_0 (0x01UL << USB_OTG_HCSPLT_HUBADDR_Pos) /*!< 0x00000080 */
-#define USB_OTG_HCSPLT_HUBADDR_1 (0x02UL << USB_OTG_HCSPLT_HUBADDR_Pos) /*!< 0x00000100 */
-#define USB_OTG_HCSPLT_HUBADDR_2 (0x04UL << USB_OTG_HCSPLT_HUBADDR_Pos) /*!< 0x00000200 */
-#define USB_OTG_HCSPLT_HUBADDR_3 (0x08UL << USB_OTG_HCSPLT_HUBADDR_Pos) /*!< 0x00000400 */
-#define USB_OTG_HCSPLT_HUBADDR_4 (0x10UL << USB_OTG_HCSPLT_HUBADDR_Pos) /*!< 0x00000800 */
-#define USB_OTG_HCSPLT_HUBADDR_5 (0x20UL << USB_OTG_HCSPLT_HUBADDR_Pos) /*!< 0x00001000 */
-#define USB_OTG_HCSPLT_HUBADDR_6 (0x40UL << USB_OTG_HCSPLT_HUBADDR_Pos) /*!< 0x00002000 */
-
-#define USB_OTG_HCSPLT_XACTPOS_Pos (14U)
-#define USB_OTG_HCSPLT_XACTPOS_Msk (0x3UL << USB_OTG_HCSPLT_XACTPOS_Pos) /*!< 0x0000C000 */
-#define USB_OTG_HCSPLT_XACTPOS USB_OTG_HCSPLT_XACTPOS_Msk /*!< XACTPOS */
-#define USB_OTG_HCSPLT_XACTPOS_0 (0x1UL << USB_OTG_HCSPLT_XACTPOS_Pos) /*!< 0x00004000 */
-#define USB_OTG_HCSPLT_XACTPOS_1 (0x2UL << USB_OTG_HCSPLT_XACTPOS_Pos) /*!< 0x00008000 */
-#define USB_OTG_HCSPLT_COMPLSPLT_Pos (16U)
-#define USB_OTG_HCSPLT_COMPLSPLT_Msk (0x1UL << USB_OTG_HCSPLT_COMPLSPLT_Pos) /*!< 0x00010000 */
-#define USB_OTG_HCSPLT_COMPLSPLT USB_OTG_HCSPLT_COMPLSPLT_Msk /*!< Do complete split */
-#define USB_OTG_HCSPLT_SPLITEN_Pos (31U)
-#define USB_OTG_HCSPLT_SPLITEN_Msk (0x1UL << USB_OTG_HCSPLT_SPLITEN_Pos) /*!< 0x80000000 */
-#define USB_OTG_HCSPLT_SPLITEN USB_OTG_HCSPLT_SPLITEN_Msk /*!< Split enable */
-
-/******************** Bit definition for USB_OTG_HCINT register ********************/
-#define USB_OTG_HCINT_XFRC_Pos (0U)
-#define USB_OTG_HCINT_XFRC_Msk (0x1UL << USB_OTG_HCINT_XFRC_Pos) /*!< 0x00000001 */
-#define USB_OTG_HCINT_XFRC USB_OTG_HCINT_XFRC_Msk /*!< Transfer completed */
-#define USB_OTG_HCINT_CHH_Pos (1U)
-#define USB_OTG_HCINT_CHH_Msk (0x1UL << USB_OTG_HCINT_CHH_Pos) /*!< 0x00000002 */
-#define USB_OTG_HCINT_CHH USB_OTG_HCINT_CHH_Msk /*!< Channel halted */
-#define USB_OTG_HCINT_AHBERR_Pos (2U)
-#define USB_OTG_HCINT_AHBERR_Msk (0x1UL << USB_OTG_HCINT_AHBERR_Pos) /*!< 0x00000004 */
-#define USB_OTG_HCINT_AHBERR USB_OTG_HCINT_AHBERR_Msk /*!< AHB error */
-#define USB_OTG_HCINT_STALL_Pos (3U)
-#define USB_OTG_HCINT_STALL_Msk (0x1UL << USB_OTG_HCINT_STALL_Pos) /*!< 0x00000008 */
-#define USB_OTG_HCINT_STALL USB_OTG_HCINT_STALL_Msk /*!< STALL response received interrupt */
-#define USB_OTG_HCINT_NAK_Pos (4U)
-#define USB_OTG_HCINT_NAK_Msk (0x1UL << USB_OTG_HCINT_NAK_Pos) /*!< 0x00000010 */
-#define USB_OTG_HCINT_NAK USB_OTG_HCINT_NAK_Msk /*!< NAK response received interrupt */
-#define USB_OTG_HCINT_ACK_Pos (5U)
-#define USB_OTG_HCINT_ACK_Msk (0x1UL << USB_OTG_HCINT_ACK_Pos) /*!< 0x00000020 */
-#define USB_OTG_HCINT_ACK USB_OTG_HCINT_ACK_Msk /*!< ACK response received/transmitted interrupt */
-#define USB_OTG_HCINT_NYET_Pos (6U)
-#define USB_OTG_HCINT_NYET_Msk (0x1UL << USB_OTG_HCINT_NYET_Pos) /*!< 0x00000040 */
-#define USB_OTG_HCINT_NYET USB_OTG_HCINT_NYET_Msk /*!< Response received interrupt */
-#define USB_OTG_HCINT_TXERR_Pos (7U)
-#define USB_OTG_HCINT_TXERR_Msk (0x1UL << USB_OTG_HCINT_TXERR_Pos) /*!< 0x00000080 */
-#define USB_OTG_HCINT_TXERR USB_OTG_HCINT_TXERR_Msk /*!< Transaction error */
-#define USB_OTG_HCINT_BBERR_Pos (8U)
-#define USB_OTG_HCINT_BBERR_Msk (0x1UL << USB_OTG_HCINT_BBERR_Pos) /*!< 0x00000100 */
-#define USB_OTG_HCINT_BBERR USB_OTG_HCINT_BBERR_Msk /*!< Babble error */
-#define USB_OTG_HCINT_FRMOR_Pos (9U)
-#define USB_OTG_HCINT_FRMOR_Msk (0x1UL << USB_OTG_HCINT_FRMOR_Pos) /*!< 0x00000200 */
-#define USB_OTG_HCINT_FRMOR USB_OTG_HCINT_FRMOR_Msk /*!< Frame overrun */
-#define USB_OTG_HCINT_DTERR_Pos (10U)
-#define USB_OTG_HCINT_DTERR_Msk (0x1UL << USB_OTG_HCINT_DTERR_Pos) /*!< 0x00000400 */
-#define USB_OTG_HCINT_DTERR USB_OTG_HCINT_DTERR_Msk /*!< Data toggle error */
-
-/******************** Bit definition for USB_OTG_DIEPINT register ********************/
-#define USB_OTG_DIEPINT_XFRC_Pos (0U)
-#define USB_OTG_DIEPINT_XFRC_Msk (0x1UL << USB_OTG_DIEPINT_XFRC_Pos) /*!< 0x00000001 */
-#define USB_OTG_DIEPINT_XFRC USB_OTG_DIEPINT_XFRC_Msk /*!< Transfer completed interrupt */
-#define USB_OTG_DIEPINT_EPDISD_Pos (1U)
-#define USB_OTG_DIEPINT_EPDISD_Msk (0x1UL << USB_OTG_DIEPINT_EPDISD_Pos) /*!< 0x00000002 */
-#define USB_OTG_DIEPINT_EPDISD USB_OTG_DIEPINT_EPDISD_Msk /*!< Endpoint disabled interrupt */
-#define USB_OTG_DIEPINT_AHBERR_Pos (2U)
-#define USB_OTG_DIEPINT_AHBERR_Msk (0x1UL << USB_OTG_DIEPINT_AHBERR_Pos) /*!< 0x00000004 */
-#define USB_OTG_DIEPINT_AHBERR USB_OTG_DIEPINT_AHBERR_Msk /*!< AHB Error (AHBErr) during an IN transaction */
-#define USB_OTG_DIEPINT_TOC_Pos (3U)
-#define USB_OTG_DIEPINT_TOC_Msk (0x1UL << USB_OTG_DIEPINT_TOC_Pos) /*!< 0x00000008 */
-#define USB_OTG_DIEPINT_TOC USB_OTG_DIEPINT_TOC_Msk /*!< Timeout condition */
-#define USB_OTG_DIEPINT_ITTXFE_Pos (4U)
-#define USB_OTG_DIEPINT_ITTXFE_Msk (0x1UL << USB_OTG_DIEPINT_ITTXFE_Pos) /*!< 0x00000010 */
-#define USB_OTG_DIEPINT_ITTXFE USB_OTG_DIEPINT_ITTXFE_Msk /*!< IN token received when TxFIFO is empty */
-#define USB_OTG_DIEPINT_INEPNM_Pos (5U)
-#define USB_OTG_DIEPINT_INEPNM_Msk (0x1UL << USB_OTG_DIEPINT_INEPNM_Pos) /*!< 0x00000004 */
-#define USB_OTG_DIEPINT_INEPNM USB_OTG_DIEPINT_INEPNM_Msk /*!< IN token received with EP mismatch */
-#define USB_OTG_DIEPINT_INEPNE_Pos (6U)
-#define USB_OTG_DIEPINT_INEPNE_Msk (0x1UL << USB_OTG_DIEPINT_INEPNE_Pos) /*!< 0x00000040 */
-#define USB_OTG_DIEPINT_INEPNE USB_OTG_DIEPINT_INEPNE_Msk /*!< IN endpoint NAK effective */
-#define USB_OTG_DIEPINT_TXFE_Pos (7U)
-#define USB_OTG_DIEPINT_TXFE_Msk (0x1UL << USB_OTG_DIEPINT_TXFE_Pos) /*!< 0x00000080 */
-#define USB_OTG_DIEPINT_TXFE USB_OTG_DIEPINT_TXFE_Msk /*!< Transmit FIFO empty */
-#define USB_OTG_DIEPINT_TXFIFOUDRN_Pos (8U)
-#define USB_OTG_DIEPINT_TXFIFOUDRN_Msk (0x1UL << USB_OTG_DIEPINT_TXFIFOUDRN_Pos) /*!< 0x00000100 */
-#define USB_OTG_DIEPINT_TXFIFOUDRN USB_OTG_DIEPINT_TXFIFOUDRN_Msk /*!< Transmit Fifo Underrun */
-#define USB_OTG_DIEPINT_BNA_Pos (9U)
-#define USB_OTG_DIEPINT_BNA_Msk (0x1UL << USB_OTG_DIEPINT_BNA_Pos) /*!< 0x00000200 */
-#define USB_OTG_DIEPINT_BNA USB_OTG_DIEPINT_BNA_Msk /*!< Buffer not available interrupt */
-#define USB_OTG_DIEPINT_PKTDRPSTS_Pos (11U)
-#define USB_OTG_DIEPINT_PKTDRPSTS_Msk (0x1UL << USB_OTG_DIEPINT_PKTDRPSTS_Pos) /*!< 0x00000800 */
-#define USB_OTG_DIEPINT_PKTDRPSTS USB_OTG_DIEPINT_PKTDRPSTS_Msk /*!< Packet dropped status */
-#define USB_OTG_DIEPINT_BERR_Pos (12U)
-#define USB_OTG_DIEPINT_BERR_Msk (0x1UL << USB_OTG_DIEPINT_BERR_Pos) /*!< 0x00001000 */
-#define USB_OTG_DIEPINT_BERR USB_OTG_DIEPINT_BERR_Msk /*!< Babble error interrupt */
-#define USB_OTG_DIEPINT_NAK_Pos (13U)
-#define USB_OTG_DIEPINT_NAK_Msk (0x1UL << USB_OTG_DIEPINT_NAK_Pos) /*!< 0x00002000 */
-#define USB_OTG_DIEPINT_NAK USB_OTG_DIEPINT_NAK_Msk /*!< NAK interrupt */
-
-/******************** Bit definition for USB_OTG_HCINTMSK register ********************/
-#define USB_OTG_HCINTMSK_XFRCM_Pos (0U)
-#define USB_OTG_HCINTMSK_XFRCM_Msk (0x1UL << USB_OTG_HCINTMSK_XFRCM_Pos) /*!< 0x00000001 */
-#define USB_OTG_HCINTMSK_XFRCM USB_OTG_HCINTMSK_XFRCM_Msk /*!< Transfer completed mask */
-#define USB_OTG_HCINTMSK_CHHM_Pos (1U)
-#define USB_OTG_HCINTMSK_CHHM_Msk (0x1UL << USB_OTG_HCINTMSK_CHHM_Pos) /*!< 0x00000002 */
-#define USB_OTG_HCINTMSK_CHHM USB_OTG_HCINTMSK_CHHM_Msk /*!< Channel halted mask */
-#define USB_OTG_HCINTMSK_AHBERR_Pos (2U)
-#define USB_OTG_HCINTMSK_AHBERR_Msk (0x1UL << USB_OTG_HCINTMSK_AHBERR_Pos) /*!< 0x00000004 */
-#define USB_OTG_HCINTMSK_AHBERR USB_OTG_HCINTMSK_AHBERR_Msk /*!< AHB error */
-#define USB_OTG_HCINTMSK_STALLM_Pos (3U)
-#define USB_OTG_HCINTMSK_STALLM_Msk (0x1UL << USB_OTG_HCINTMSK_STALLM_Pos) /*!< 0x00000008 */
-#define USB_OTG_HCINTMSK_STALLM USB_OTG_HCINTMSK_STALLM_Msk /*!< STALL response received interrupt mask */
-#define USB_OTG_HCINTMSK_NAKM_Pos (4U)
-#define USB_OTG_HCINTMSK_NAKM_Msk (0x1UL << USB_OTG_HCINTMSK_NAKM_Pos) /*!< 0x00000010 */
-#define USB_OTG_HCINTMSK_NAKM USB_OTG_HCINTMSK_NAKM_Msk /*!< NAK response received interrupt mask */
-#define USB_OTG_HCINTMSK_ACKM_Pos (5U)
-#define USB_OTG_HCINTMSK_ACKM_Msk (0x1UL << USB_OTG_HCINTMSK_ACKM_Pos) /*!< 0x00000020 */
-#define USB_OTG_HCINTMSK_ACKM USB_OTG_HCINTMSK_ACKM_Msk /*!< ACK response received/transmitted interrupt mask */
-#define USB_OTG_HCINTMSK_NYET_Pos (6U)
-#define USB_OTG_HCINTMSK_NYET_Msk (0x1UL << USB_OTG_HCINTMSK_NYET_Pos) /*!< 0x00000040 */
-#define USB_OTG_HCINTMSK_NYET USB_OTG_HCINTMSK_NYET_Msk /*!< response received interrupt mask */
-#define USB_OTG_HCINTMSK_TXERRM_Pos (7U)
-#define USB_OTG_HCINTMSK_TXERRM_Msk (0x1UL << USB_OTG_HCINTMSK_TXERRM_Pos) /*!< 0x00000080 */
-#define USB_OTG_HCINTMSK_TXERRM USB_OTG_HCINTMSK_TXERRM_Msk /*!< Transaction error mask */
-#define USB_OTG_HCINTMSK_BBERRM_Pos (8U)
-#define USB_OTG_HCINTMSK_BBERRM_Msk (0x1UL << USB_OTG_HCINTMSK_BBERRM_Pos) /*!< 0x00000100 */
-#define USB_OTG_HCINTMSK_BBERRM USB_OTG_HCINTMSK_BBERRM_Msk /*!< Babble error mask */
-#define USB_OTG_HCINTMSK_FRMORM_Pos (9U)
-#define USB_OTG_HCINTMSK_FRMORM_Msk (0x1UL << USB_OTG_HCINTMSK_FRMORM_Pos) /*!< 0x00000200 */
-#define USB_OTG_HCINTMSK_FRMORM USB_OTG_HCINTMSK_FRMORM_Msk /*!< Frame overrun mask */
-#define USB_OTG_HCINTMSK_DTERRM_Pos (10U)
-#define USB_OTG_HCINTMSK_DTERRM_Msk (0x1UL << USB_OTG_HCINTMSK_DTERRM_Pos) /*!< 0x00000400 */
-#define USB_OTG_HCINTMSK_DTERRM USB_OTG_HCINTMSK_DTERRM_Msk /*!< Data toggle error mask */
-
-/******************** Bit definition for USB_OTG_DIEPTSIZ register ********************/
-
-#define USB_OTG_DIEPTSIZ_XFRSIZ_Pos (0U)
-#define USB_OTG_DIEPTSIZ_XFRSIZ_Msk (0x7FFFFUL << USB_OTG_DIEPTSIZ_XFRSIZ_Pos) /*!< 0x0007FFFF */
-#define USB_OTG_DIEPTSIZ_XFRSIZ USB_OTG_DIEPTSIZ_XFRSIZ_Msk /*!< Transfer size */
-#define USB_OTG_DIEPTSIZ_PKTCNT_Pos (19U)
-#define USB_OTG_DIEPTSIZ_PKTCNT_Msk (0x3FFUL << USB_OTG_DIEPTSIZ_PKTCNT_Pos) /*!< 0x1FF80000 */
-#define USB_OTG_DIEPTSIZ_PKTCNT USB_OTG_DIEPTSIZ_PKTCNT_Msk /*!< Packet count */
-#define USB_OTG_DIEPTSIZ_MULCNT_Pos (29U)
-#define USB_OTG_DIEPTSIZ_MULCNT_Msk (0x3UL << USB_OTG_DIEPTSIZ_MULCNT_Pos) /*!< 0x60000000 */
-#define USB_OTG_DIEPTSIZ_MULCNT USB_OTG_DIEPTSIZ_MULCNT_Msk /*!< Packet count */
-/******************** Bit definition for USB_OTG_HCTSIZ register ********************/
-#define USB_OTG_HCTSIZ_XFRSIZ_Pos (0U)
-#define USB_OTG_HCTSIZ_XFRSIZ_Msk (0x7FFFFUL << USB_OTG_HCTSIZ_XFRSIZ_Pos) /*!< 0x0007FFFF */
-#define USB_OTG_HCTSIZ_XFRSIZ USB_OTG_HCTSIZ_XFRSIZ_Msk /*!< Transfer size */
-#define USB_OTG_HCTSIZ_PKTCNT_Pos (19U)
-#define USB_OTG_HCTSIZ_PKTCNT_Msk (0x3FFUL << USB_OTG_HCTSIZ_PKTCNT_Pos) /*!< 0x1FF80000 */
-#define USB_OTG_HCTSIZ_PKTCNT USB_OTG_HCTSIZ_PKTCNT_Msk /*!< Packet count */
-#define USB_OTG_HCTSIZ_DOPING_Pos (31U)
-#define USB_OTG_HCTSIZ_DOPING_Msk (0x1UL << USB_OTG_HCTSIZ_DOPING_Pos) /*!< 0x80000000 */
-#define USB_OTG_HCTSIZ_DOPING USB_OTG_HCTSIZ_DOPING_Msk /*!< Do PING */
-#define USB_OTG_HCTSIZ_DPID_Pos (29U)
-#define USB_OTG_HCTSIZ_DPID_Msk (0x3UL << USB_OTG_HCTSIZ_DPID_Pos) /*!< 0x60000000 */
-#define USB_OTG_HCTSIZ_DPID USB_OTG_HCTSIZ_DPID_Msk /*!< Data PID */
-#define USB_OTG_HCTSIZ_DPID_0 (0x1UL << USB_OTG_HCTSIZ_DPID_Pos) /*!< 0x20000000 */
-#define USB_OTG_HCTSIZ_DPID_1 (0x2UL << USB_OTG_HCTSIZ_DPID_Pos) /*!< 0x40000000 */
-
-/******************** Bit definition for USB_OTG_DIEPDMA register ********************/
-#define USB_OTG_DIEPDMA_DMAADDR_Pos (0U)
-#define USB_OTG_DIEPDMA_DMAADDR_Msk (0xFFFFFFFFUL << USB_OTG_DIEPDMA_DMAADDR_Pos) /*!< 0xFFFFFFFF */
-#define USB_OTG_DIEPDMA_DMAADDR USB_OTG_DIEPDMA_DMAADDR_Msk /*!< DMA address */
-
-/******************** Bit definition for USB_OTG_HCDMA register ********************/
-#define USB_OTG_HCDMA_DMAADDR_Pos (0U)
-#define USB_OTG_HCDMA_DMAADDR_Msk (0xFFFFFFFFUL << USB_OTG_HCDMA_DMAADDR_Pos) /*!< 0xFFFFFFFF */
-#define USB_OTG_HCDMA_DMAADDR USB_OTG_HCDMA_DMAADDR_Msk /*!< DMA address */
-
-/******************** Bit definition for USB_OTG_DTXFSTS register ********************/
-#define USB_OTG_DTXFSTS_INEPTFSAV_Pos (0U)
-#define USB_OTG_DTXFSTS_INEPTFSAV_Msk (0xFFFFUL << USB_OTG_DTXFSTS_INEPTFSAV_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_DTXFSTS_INEPTFSAV USB_OTG_DTXFSTS_INEPTFSAV_Msk /*!< IN endpoint TxFIFO space available */
-
-/******************** Bit definition for USB_OTG_DIEPTXF register ********************/
-#define USB_OTG_DIEPTXF_INEPTXSA_Pos (0U)
-#define USB_OTG_DIEPTXF_INEPTXSA_Msk (0xFFFFUL << USB_OTG_DIEPTXF_INEPTXSA_Pos) /*!< 0x0000FFFF */
-#define USB_OTG_DIEPTXF_INEPTXSA USB_OTG_DIEPTXF_INEPTXSA_Msk /*!< IN endpoint FIFOx transmit RAM start address */
-#define USB_OTG_DIEPTXF_INEPTXFD_Pos (16U)
-#define USB_OTG_DIEPTXF_INEPTXFD_Msk (0xFFFFUL << USB_OTG_DIEPTXF_INEPTXFD_Pos) /*!< 0xFFFF0000 */
-#define USB_OTG_DIEPTXF_INEPTXFD USB_OTG_DIEPTXF_INEPTXFD_Msk /*!< IN endpoint TxFIFO depth */
-
-/******************** Bit definition for USB_OTG_DOEPCTL register ********************/
-
-#define USB_OTG_DOEPCTL_MPSIZ_Pos (0U)
-#define USB_OTG_DOEPCTL_MPSIZ_Msk (0x7FFUL << USB_OTG_DOEPCTL_MPSIZ_Pos) /*!< 0x000007FF */
-#define USB_OTG_DOEPCTL_MPSIZ USB_OTG_DOEPCTL_MPSIZ_Msk /*!< Maximum packet size */ /*!<Bit 1 */
-#define USB_OTG_DOEPCTL_USBAEP_Pos (15U)
-#define USB_OTG_DOEPCTL_USBAEP_Msk (0x1UL << USB_OTG_DOEPCTL_USBAEP_Pos) /*!< 0x00008000 */
-#define USB_OTG_DOEPCTL_USBAEP USB_OTG_DOEPCTL_USBAEP_Msk /*!< USB active endpoint */
-#define USB_OTG_DOEPCTL_NAKSTS_Pos (17U)
-#define USB_OTG_DOEPCTL_NAKSTS_Msk (0x1UL << USB_OTG_DOEPCTL_NAKSTS_Pos) /*!< 0x00020000 */
-#define USB_OTG_DOEPCTL_NAKSTS USB_OTG_DOEPCTL_NAKSTS_Msk /*!< NAK status */
-#define USB_OTG_DOEPCTL_SD0PID_SEVNFRM_Pos (28U)
-#define USB_OTG_DOEPCTL_SD0PID_SEVNFRM_Msk (0x1UL << USB_OTG_DOEPCTL_SD0PID_SEVNFRM_Pos) /*!< 0x10000000 */
-#define USB_OTG_DOEPCTL_SD0PID_SEVNFRM USB_OTG_DOEPCTL_SD0PID_SEVNFRM_Msk /*!< Set DATA0 PID */
-#define USB_OTG_DOEPCTL_SODDFRM_Pos (29U)
-#define USB_OTG_DOEPCTL_SODDFRM_Msk (0x1UL << USB_OTG_DOEPCTL_SODDFRM_Pos) /*!< 0x20000000 */
-#define USB_OTG_DOEPCTL_SODDFRM USB_OTG_DOEPCTL_SODDFRM_Msk /*!< Set odd frame */
-#define USB_OTG_DOEPCTL_EPTYP_Pos (18U)
-#define USB_OTG_DOEPCTL_EPTYP_Msk (0x3UL << USB_OTG_DOEPCTL_EPTYP_Pos) /*!< 0x000C0000 */
-#define USB_OTG_DOEPCTL_EPTYP USB_OTG_DOEPCTL_EPTYP_Msk /*!< Endpoint type */
-#define USB_OTG_DOEPCTL_EPTYP_0 (0x1UL << USB_OTG_DOEPCTL_EPTYP_Pos) /*!< 0x00040000 */
-#define USB_OTG_DOEPCTL_EPTYP_1 (0x2UL << USB_OTG_DOEPCTL_EPTYP_Pos) /*!< 0x00080000 */
-#define USB_OTG_DOEPCTL_SNPM_Pos (20U)
-#define USB_OTG_DOEPCTL_SNPM_Msk (0x1UL << USB_OTG_DOEPCTL_SNPM_Pos) /*!< 0x00100000 */
-#define USB_OTG_DOEPCTL_SNPM USB_OTG_DOEPCTL_SNPM_Msk /*!< Snoop mode */
-#define USB_OTG_DOEPCTL_STALL_Pos (21U)
-#define USB_OTG_DOEPCTL_STALL_Msk (0x1UL << USB_OTG_DOEPCTL_STALL_Pos) /*!< 0x00200000 */
-#define USB_OTG_DOEPCTL_STALL USB_OTG_DOEPCTL_STALL_Msk /*!< STALL handshake */
-#define USB_OTG_DOEPCTL_CNAK_Pos (26U)
-#define USB_OTG_DOEPCTL_CNAK_Msk (0x1UL << USB_OTG_DOEPCTL_CNAK_Pos) /*!< 0x04000000 */
-#define USB_OTG_DOEPCTL_CNAK USB_OTG_DOEPCTL_CNAK_Msk /*!< Clear NAK */
-#define USB_OTG_DOEPCTL_SNAK_Pos (27U)
-#define USB_OTG_DOEPCTL_SNAK_Msk (0x1UL << USB_OTG_DOEPCTL_SNAK_Pos) /*!< 0x08000000 */
-#define USB_OTG_DOEPCTL_SNAK USB_OTG_DOEPCTL_SNAK_Msk /*!< Set NAK */
-#define USB_OTG_DOEPCTL_EPDIS_Pos (30U)
-#define USB_OTG_DOEPCTL_EPDIS_Msk (0x1UL << USB_OTG_DOEPCTL_EPDIS_Pos) /*!< 0x40000000 */
-#define USB_OTG_DOEPCTL_EPDIS USB_OTG_DOEPCTL_EPDIS_Msk /*!< Endpoint disable */
-#define USB_OTG_DOEPCTL_EPENA_Pos (31U)
-#define USB_OTG_DOEPCTL_EPENA_Msk (0x1UL << USB_OTG_DOEPCTL_EPENA_Pos) /*!< 0x80000000 */
-#define USB_OTG_DOEPCTL_EPENA USB_OTG_DOEPCTL_EPENA_Msk /*!< Endpoint enable */
-
-/******************** Bit definition for USB_OTG_DOEPINT register ********************/
-#define USB_OTG_DOEPINT_XFRC_Pos (0U)
-#define USB_OTG_DOEPINT_XFRC_Msk (0x1UL << USB_OTG_DOEPINT_XFRC_Pos) /*!< 0x00000001 */
-#define USB_OTG_DOEPINT_XFRC USB_OTG_DOEPINT_XFRC_Msk /*!< Transfer completed interrupt */
-#define USB_OTG_DOEPINT_EPDISD_Pos (1U)
-#define USB_OTG_DOEPINT_EPDISD_Msk (0x1UL << USB_OTG_DOEPINT_EPDISD_Pos) /*!< 0x00000002 */
-#define USB_OTG_DOEPINT_EPDISD USB_OTG_DOEPINT_EPDISD_Msk /*!< Endpoint disabled interrupt */
-#define USB_OTG_DOEPINT_AHBERR_Pos (2U)
-#define USB_OTG_DOEPINT_AHBERR_Msk (0x1UL << USB_OTG_DOEPINT_AHBERR_Pos) /*!< 0x00000004 */
-#define USB_OTG_DOEPINT_AHBERR USB_OTG_DOEPINT_AHBERR_Msk /*!< AHB Error (AHBErr) during an OUT transaction */
-#define USB_OTG_DOEPINT_STUP_Pos (3U)
-#define USB_OTG_DOEPINT_STUP_Msk (0x1UL << USB_OTG_DOEPINT_STUP_Pos) /*!< 0x00000008 */
-#define USB_OTG_DOEPINT_STUP USB_OTG_DOEPINT_STUP_Msk /*!< SETUP phase done */
-#define USB_OTG_DOEPINT_OTEPDIS_Pos (4U)
-#define USB_OTG_DOEPINT_OTEPDIS_Msk (0x1UL << USB_OTG_DOEPINT_OTEPDIS_Pos) /*!< 0x00000010 */
-#define USB_OTG_DOEPINT_OTEPDIS USB_OTG_DOEPINT_OTEPDIS_Msk /*!< OUT token received when endpoint disabled */
-#define USB_OTG_DOEPINT_OTEPSPR_Pos (5U)
-#define USB_OTG_DOEPINT_OTEPSPR_Msk (0x1UL << USB_OTG_DOEPINT_OTEPSPR_Pos) /*!< 0x00000020 */
-#define USB_OTG_DOEPINT_OTEPSPR USB_OTG_DOEPINT_OTEPSPR_Msk /*!< Status Phase Received For Control Write */
-#define USB_OTG_DOEPINT_B2BSTUP_Pos (6U)
-#define USB_OTG_DOEPINT_B2BSTUP_Msk (0x1UL << USB_OTG_DOEPINT_B2BSTUP_Pos) /*!< 0x00000040 */
-#define USB_OTG_DOEPINT_B2BSTUP USB_OTG_DOEPINT_B2BSTUP_Msk /*!< Back-to-back SETUP packets received */
-#define USB_OTG_DOEPINT_OUTPKTERR_Pos (8U)
-#define USB_OTG_DOEPINT_OUTPKTERR_Msk (0x1UL << USB_OTG_DOEPINT_OUTPKTERR_Pos) /*!< 0x00000100 */
-#define USB_OTG_DOEPINT_OUTPKTERR USB_OTG_DOEPINT_OUTPKTERR_Msk /*!< OUT packet error */
-#define USB_OTG_DOEPINT_NAK_Pos (13U)
-#define USB_OTG_DOEPINT_NAK_Msk (0x1UL << USB_OTG_DOEPINT_NAK_Pos) /*!< 0x00002000 */
-#define USB_OTG_DOEPINT_NAK USB_OTG_DOEPINT_NAK_Msk /*!< NAK Packet is transmitted by the device */
-#define USB_OTG_DOEPINT_NYET_Pos (14U)
-#define USB_OTG_DOEPINT_NYET_Msk (0x1UL << USB_OTG_DOEPINT_NYET_Pos) /*!< 0x00004000 */
-#define USB_OTG_DOEPINT_NYET USB_OTG_DOEPINT_NYET_Msk /*!< NYET interrupt */
-#define USB_OTG_DOEPINT_STPKTRX_Pos (15U)
-#define USB_OTG_DOEPINT_STPKTRX_Msk (0x1UL << USB_OTG_DOEPINT_STPKTRX_Pos) /*!< 0x00008000 */
-#define USB_OTG_DOEPINT_STPKTRX USB_OTG_DOEPINT_STPKTRX_Msk /*!< Setup Packet Received */
-/******************** Bit definition for USB_OTG_DOEPTSIZ register ********************/
-
-#define USB_OTG_DOEPTSIZ_XFRSIZ_Pos (0U)
-#define USB_OTG_DOEPTSIZ_XFRSIZ_Msk (0x7FFFFUL << USB_OTG_DOEPTSIZ_XFRSIZ_Pos) /*!< 0x0007FFFF */
-#define USB_OTG_DOEPTSIZ_XFRSIZ USB_OTG_DOEPTSIZ_XFRSIZ_Msk /*!< Transfer size */
-#define USB_OTG_DOEPTSIZ_PKTCNT_Pos (19U)
-#define USB_OTG_DOEPTSIZ_PKTCNT_Msk (0x3FFUL << USB_OTG_DOEPTSIZ_PKTCNT_Pos) /*!< 0x1FF80000 */
-#define USB_OTG_DOEPTSIZ_PKTCNT USB_OTG_DOEPTSIZ_PKTCNT_Msk /*!< Packet count */
-
-#define USB_OTG_DOEPTSIZ_STUPCNT_Pos (29U)
-#define USB_OTG_DOEPTSIZ_STUPCNT_Msk (0x3UL << USB_OTG_DOEPTSIZ_STUPCNT_Pos) /*!< 0x60000000 */
-#define USB_OTG_DOEPTSIZ_STUPCNT USB_OTG_DOEPTSIZ_STUPCNT_Msk /*!< SETUP packet count */
-#define USB_OTG_DOEPTSIZ_STUPCNT_0 (0x1UL << USB_OTG_DOEPTSIZ_STUPCNT_Pos) /*!< 0x20000000 */
-#define USB_OTG_DOEPTSIZ_STUPCNT_1 (0x2UL << USB_OTG_DOEPTSIZ_STUPCNT_Pos) /*!< 0x40000000 */
-
-/******************** Bit definition for PCGCCTL register ********************/
-#define USB_OTG_PCGCCTL_STOPCLK_Pos (0U)
-#define USB_OTG_PCGCCTL_STOPCLK_Msk (0x1UL << USB_OTG_PCGCCTL_STOPCLK_Pos) /*!< 0x00000001 */
-#define USB_OTG_PCGCCTL_STOPCLK USB_OTG_PCGCCTL_STOPCLK_Msk /*!< SETUP packet count */
-#define USB_OTG_PCGCCTL_GATECLK_Pos (1U)
-#define USB_OTG_PCGCCTL_GATECLK_Msk (0x1UL << USB_OTG_PCGCCTL_GATECLK_Pos) /*!< 0x00000002 */
-#define USB_OTG_PCGCCTL_GATECLK USB_OTG_PCGCCTL_GATECLK_Msk /*!<Bit 0 */
-#define USB_OTG_PCGCCTL_PHYSUSP_Pos (4U)
-#define USB_OTG_PCGCCTL_PHYSUSP_Msk (0x1UL << USB_OTG_PCGCCTL_PHYSUSP_Pos) /*!< 0x00000010 */
-#define USB_OTG_PCGCCTL_PHYSUSP USB_OTG_PCGCCTL_PHYSUSP_Msk /*!<Bit 1 */
-
-/* Legacy define */
-/******************** Bit definition for OTG register ********************/
-#define USB_OTG_CHNUM_Pos (0U)
-#define USB_OTG_CHNUM_Msk (0xFUL << USB_OTG_CHNUM_Pos) /*!< 0x0000000F */
-#define USB_OTG_CHNUM USB_OTG_CHNUM_Msk /*!< Channel number */
-#define USB_OTG_CHNUM_0 (0x1UL << USB_OTG_CHNUM_Pos) /*!< 0x00000001 */
-#define USB_OTG_CHNUM_1 (0x2UL << USB_OTG_CHNUM_Pos) /*!< 0x00000002 */
-#define USB_OTG_CHNUM_2 (0x4UL << USB_OTG_CHNUM_Pos) /*!< 0x00000004 */
-#define USB_OTG_CHNUM_3 (0x8UL << USB_OTG_CHNUM_Pos) /*!< 0x00000008 */
-#define USB_OTG_BCNT_Pos (4U)
-#define USB_OTG_BCNT_Msk (0x7FFUL << USB_OTG_BCNT_Pos) /*!< 0x00007FF0 */
-#define USB_OTG_BCNT USB_OTG_BCNT_Msk /*!< Byte count */
-
-#define USB_OTG_DPID_Pos (15U)
-#define USB_OTG_DPID_Msk (0x3UL << USB_OTG_DPID_Pos) /*!< 0x00018000 */
-#define USB_OTG_DPID USB_OTG_DPID_Msk /*!< Data PID */
-#define USB_OTG_DPID_0 (0x1UL << USB_OTG_DPID_Pos) /*!< 0x00008000 */
-#define USB_OTG_DPID_1 (0x2UL << USB_OTG_DPID_Pos) /*!< 0x00010000 */
-
-#define USB_OTG_PKTSTS_Pos (17U)
-#define USB_OTG_PKTSTS_Msk (0xFUL << USB_OTG_PKTSTS_Pos) /*!< 0x001E0000 */
-#define USB_OTG_PKTSTS USB_OTG_PKTSTS_Msk /*!< Packet status */
-#define USB_OTG_PKTSTS_0 (0x1UL << USB_OTG_PKTSTS_Pos) /*!< 0x00020000 */
-#define USB_OTG_PKTSTS_1 (0x2UL << USB_OTG_PKTSTS_Pos) /*!< 0x00040000 */
-#define USB_OTG_PKTSTS_2 (0x4UL << USB_OTG_PKTSTS_Pos) /*!< 0x00080000 */
-#define USB_OTG_PKTSTS_3 (0x8UL << USB_OTG_PKTSTS_Pos) /*!< 0x00100000 */
-
-#define USB_OTG_EPNUM_Pos (0U)
-#define USB_OTG_EPNUM_Msk (0xFUL << USB_OTG_EPNUM_Pos) /*!< 0x0000000F */
-#define USB_OTG_EPNUM USB_OTG_EPNUM_Msk /*!< Endpoint number */
-#define USB_OTG_EPNUM_0 (0x1UL << USB_OTG_EPNUM_Pos) /*!< 0x00000001 */
-#define USB_OTG_EPNUM_1 (0x2UL << USB_OTG_EPNUM_Pos) /*!< 0x00000002 */
-#define USB_OTG_EPNUM_2 (0x4UL << USB_OTG_EPNUM_Pos) /*!< 0x00000004 */
-#define USB_OTG_EPNUM_3 (0x8UL << USB_OTG_EPNUM_Pos) /*!< 0x00000008 */
-
-#define USB_OTG_FRMNUM_Pos (21U)
-#define USB_OTG_FRMNUM_Msk (0xFUL << USB_OTG_FRMNUM_Pos) /*!< 0x01E00000 */
-#define USB_OTG_FRMNUM USB_OTG_FRMNUM_Msk /*!< Frame number */
-#define USB_OTG_FRMNUM_0 (0x1UL << USB_OTG_FRMNUM_Pos) /*!< 0x00200000 */
-#define USB_OTG_FRMNUM_1 (0x2UL << USB_OTG_FRMNUM_Pos) /*!< 0x00400000 */
-#define USB_OTG_FRMNUM_2 (0x4UL << USB_OTG_FRMNUM_Pos) /*!< 0x00800000 */
-#define USB_OTG_FRMNUM_3 (0x8UL << USB_OTG_FRMNUM_Pos) /*!< 0x01000000 */
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/tinyusb/src/portable/template/dcd_template.c b/tinyusb/src/portable/template/dcd_template.c
deleted file mode 100755
index 12b9144b..00000000
--- a/tinyusb/src/portable/template/dcd_template.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018, hathach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if CFG_TUSB_MCU == OPT_MCU_NONE
-
-#include "device/dcd.h"
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-
-/*------------------------------------------------------------------*/
-/* Device API
- *------------------------------------------------------------------*/
-
-// Initialize controller to device mode
-void dcd_init (uint8_t rhport)
-{
- (void) rhport;
-}
-
-// Enable device interrupt
-void dcd_int_enable (uint8_t rhport)
-{
- (void) rhport;
-}
-
-// Disable device interrupt
-void dcd_int_disable (uint8_t rhport)
-{
- (void) rhport;
-}
-
-// Receive Set Address request, mcu port must also include status IN response
-void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
- (void) dev_addr;
-}
-
-// Wake up host
-void dcd_remote_wakeup (uint8_t rhport)
-{
- (void) rhport;
-}
-
-// Connect by enabling internal pull-up resistor on D+/D-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
-}
-
-// Disconnect by disabling internal pull-up resistor on D+/D-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
-}
-
-//--------------------------------------------------------------------+
-// Endpoint API
-//--------------------------------------------------------------------+
-
-// Configure endpoint's registers according to descriptor
-bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * ep_desc)
-{
- (void) rhport;
- (void) ep_desc;
- return false;
-}
-
-// Submit a transfer, When complete dcd_event_xfer_complete() is invoked to notify the stack
-bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- (void) rhport;
- (void) ep_addr;
- (void) buffer;
- (void) total_bytes;
- return false;
-}
-
-// Submit a transfer where is managed by FIFO, When complete dcd_event_xfer_complete() is invoked to notify the stack - optional, however, must be listed in usbd.c
-bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
-{
- (void) rhport;
- (void) ep_addr;
- (void) ff;
- (void) total_bytes;
- return false;
-}
-
-// Stall endpoint
-void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- (void) ep_addr;
-}
-
-// clear stall, data toggle is also reset to DATA0
-void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- (void) ep_addr;
-}
-
-#endif
diff --git a/tinyusb/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c b/tinyusb/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c
deleted file mode 100755
index 027ed26c..00000000
--- a/tinyusb/src/portable/ti/msp430x5xx/dcd_msp430x5xx.c
+++ /dev/null
@@ -1,694 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019-2020 William D. Jones
- * Copyright (c) 2019-2020 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_MSP430x5xx )
-
-#include "msp430.h"
-#include "device/dcd.h"
-
-/*------------------------------------------------------------------*/
-/* MACRO TYPEDEF CONSTANT ENUM
- *------------------------------------------------------------------*/
-// usbpllir_mirror and usbmaintl_mirror can be added later if needed.
-static volatile uint16_t usbiepie_mirror = 0;
-static volatile uint16_t usboepie_mirror = 0;
-static volatile uint8_t usbie_mirror = 0;
-static volatile uint16_t usbpwrctl_mirror = 0;
-static bool in_isr = false;
-
-uint8_t _setup_packet[8];
-
-// Xfer control
-typedef struct
-{
- uint8_t * buffer;
- // tu_fifo_t * ff; // TODO support dcd_edpt_xfer_fifo API
- uint16_t total_len;
- uint16_t queued_len;
- uint16_t max_size;
- bool short_packet;
-} xfer_ctl_t;
-
-xfer_ctl_t xfer_status[8][2];
-#define XFER_CTL_BASE(_ep, _dir) &xfer_status[_ep][_dir]
-
-// Accessing endpoint regs
-typedef volatile uint8_t * ep_regs_t;
-
-typedef enum
-{
- CNF = 0,
- BBAX = 1,
- BCTX = 2,
- BBAY = 5,
- BCTY = 6,
- SIZXY = 7
-} ep_regs_index_t;
-
-#define EP_REGS(epnum, dir) ((ep_regs_t) ((uintptr_t)&USBOEPCNF_1 + 64*dir + 8*(epnum - 1)))
-
-static void bus_reset(void)
-{
- // Hardcoded into the USB core.
- xfer_status[0][TUSB_DIR_OUT].max_size = 8;
- xfer_status[0][TUSB_DIR_IN].max_size = 8;
-
- USBKEYPID = USBKEY;
-
- // Enable the control EP 0. Also enable Indication Enable- a guard flag
- // separate from the Interrupt Enable mask.
- USBOEPCNF_0 |= (UBME | USBIIE);
- USBIEPCNF_0 |= (UBME | USBIIE);
-
- // Enable interrupts for this endpoint.
- USBOEPIE |= BIT0;
- USBIEPIE |= BIT0;
-
- // Clear NAK until a setup packet is received.
- USBOEPCNT_0 &= ~NAK;
- USBIEPCNT_0 &= ~NAK;
-
- USBCTL |= FEN; // Enable responding to packets.
-
- // Dedicated buffers in hardware for SETUP and EP0, no setup needed.
- // Now safe to respond to SETUP packets.
- USBIE |= SETUPIE;
-
- USBKEYPID = 0;
-}
-
-
-/*------------------------------------------------------------------*/
-/* Controller API
- *------------------------------------------------------------------*/
-void dcd_init (uint8_t rhport)
-{
- (void) rhport;
-
- USBKEYPID = USBKEY;
-
- // Enable the module (required to write config regs)!
- USBCNF |= USB_EN;
-
- // Reset used interrupts
- USBOEPIE = 0;
- USBIEPIE = 0;
- USBIE = 0;
- USBOEPIFG = 0;
- USBIEPIFG = 0;
- USBIFG = 0;
- USBPWRCTL &= ~(VUOVLIE | VBONIE | VBOFFIE | VUOVLIFG | VBONIFG | VBOFFIFG);
- usboepie_mirror = 0;
- usbiepie_mirror = 0;
- usbie_mirror = 0;
- usbpwrctl_mirror = 0;
-
- USBVECINT = 0;
-
- // Enable reset and wait for it before continuing.
- USBIE |= RSTRIE;
-
- // Enable pullup.
- USBCNF |= PUR_EN;
-
- USBKEYPID = 0;
-}
-
-// There is no "USB peripheral interrupt disable" bit on MSP430, so we have
-// to save the relevant registers individually.
-// WARNING: Unlike the ARM/NVIC routines, these functions are _not_ idempotent
-// if you modified the registers saved in between calls so they don't match
-// the mirrors; mirrors will be updated to reflect most recent register
-// contents.
-void dcd_int_enable (uint8_t rhport)
-{
- (void) rhport;
-
- __bic_SR_register(GIE); // Unlikely to be called in ISR, but let's be safe.
- // Also, this cleanly disables all USB interrupts
- // atomically from application's POV.
-
- // This guard is required because tinyusb can enable interrupts without
- // having disabled them first.
- if(in_isr)
- {
- USBOEPIE = usboepie_mirror;
- USBIEPIE = usbiepie_mirror;
- USBIE = usbie_mirror;
- USBPWRCTL |= usbpwrctl_mirror;
- }
-
- in_isr = false;
- __bis_SR_register(GIE);
-}
-
-void dcd_int_disable (uint8_t rhport)
-{
- (void) rhport;
-
- __bic_SR_register(GIE);
- usboepie_mirror = USBOEPIE;
- usbiepie_mirror = USBIEPIE;
- usbie_mirror = USBIE;
- usbpwrctl_mirror = (USBPWRCTL & (VUOVLIE | VBONIE | VBOFFIE));
- USBOEPIE = 0;
- USBIEPIE = 0;
- USBIE = 0;
- USBPWRCTL &= ~(VUOVLIE | VBONIE | VBOFFIE);
- in_isr = true;
- __bis_SR_register(GIE);
-}
-
-void dcd_set_address (uint8_t rhport, uint8_t dev_addr)
-{
- (void) rhport;
-
- USBFUNADR = dev_addr;
-
- // Response with status after changing device address
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-}
-
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
-}
-
-void dcd_connect(uint8_t rhport)
-{
- dcd_int_disable(rhport);
-
- USBKEYPID = USBKEY;
- USBCNF |= PUR_EN; // Enable pullup.
- USBKEYPID = 0;
-
- dcd_int_enable(rhport);
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- dcd_int_disable(rhport);
-
- USBKEYPID = USBKEY;
- USBCNF &= ~PUR_EN; // Disable pullup.
- USBKEYPID = 0;
-
- dcd_int_enable(rhport);
-}
-
-/*------------------------------------------------------------------*/
-/* DCD Endpoint port
- *------------------------------------------------------------------*/
-
-bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(desc_edpt->bEndpointAddress);
- uint8_t const dir = tu_edpt_dir(desc_edpt->bEndpointAddress);
-
- // Unsupported endpoint numbers or type (Iso not supported. Control
- // not supported on nonzero endpoints).
- if( (epnum > 7) || \
- (desc_edpt->bmAttributes.xfer == 0) || \
- (desc_edpt->bmAttributes.xfer == 1)) {
- return false;
- }
-
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
- xfer->max_size = desc_edpt->wMaxPacketSize.size;
-
- // Buffer allocation scheme:
- // For simplicity, only single buffer for now, since tinyusb currently waits
- // for an xfer to complete before scheduling another one. This means only
- // the X buffer is used.
- //
- // 1904 bytes are available, the max endpoint size supported on msp430 is
- // 64 bytes. This is enough RAM for all 14 endpoints enabled _with_ double
- // bufferring (64*14*2 = 1792 bytes). Extra RAM exists for triple and higher
- // order bufferring, which must be maintained in software.
- //
- // For simplicity, each endpoint gets a hardcoded 64 byte chunk (regardless
- // of actual wMaxPacketSize) whose start address is the following:
- // addr = 128 * (epnum - 1) + 64 * dir.
- //
- // Double buffering equation:
- // x_addr = 256 * (epnum - 1) + 128 * dir
- // y_addr = x_addr + 64
- // Address is right-shifted by 3 to fit into 8 bits.
-
- uint8_t buf_base = (128 * (epnum - 1) + 64 * dir) >> 3;
-
- // IN and OUT EP registers have the same structure.
- ep_regs_t ep_regs = EP_REGS(epnum, dir);
-
- // FIXME: I was able to get into a situation where OUT EP 3 would stall
- // while debugging, despite stall code never being called. It appears
- // these registers don't get cleared on reset, being part of RAM.
- // Investigate and see if I can duplicate.
- // Also, DBUF got set on OUT EP 2 while debugging. Only OUT EPs seem to be
- // affected at this time. USB RAM directly precedes main RAM; perhaps I'm
- // overwriting registers via buffer overflow w/ my debugging code?
- ep_regs[SIZXY] = desc_edpt->wMaxPacketSize.size;
- ep_regs[BCTX] |= NAK;
- ep_regs[BBAX] = buf_base;
- ep_regs[CNF] &= ~(TOGGLE | STALL | DBUF); // ISO xfers not supported on
- // MSP430, so no need to gate DATA0/1 and frame
- // behavior. Clear stall and double buffer bit as
- // well- see above comment.
- ep_regs[CNF] |= (UBME | USBIIE);
-
- USBKEYPID = USBKEY;
- if(dir == TUSB_DIR_OUT)
- {
- USBOEPIE |= (1 << epnum);
- }
- else
- {
- USBIEPIE |= (1 << epnum);
- }
- USBKEYPID = 0;
-
- return true;
-}
-
-bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
- xfer->buffer = buffer;
- // xfer->ff = NULL; // TODO support dcd_edpt_xfer_fifo API
- xfer->total_len = total_bytes;
- xfer->queued_len = 0;
- xfer->short_packet = false;
-
- if(epnum == 0)
- {
- if(dir == TUSB_DIR_OUT)
- {
- // Interrupt will notify us when data was received.
- USBCTL &= ~DIR;
- USBOEPCNT_0 &= ~NAK;
- }
- else
- {
- // Kickstart the IN packet handler by queuing initial data and calling
- // the ISR to transmit the first packet.
- // Interrupt only fires on completed xfer.
- USBCTL |= DIR;
- USBIEPIFG |= BIT0;
- }
- }
- else
- {
- ep_regs_t ep_regs = EP_REGS(epnum, dir);
-
- if(dir == TUSB_DIR_OUT)
- {
- ep_regs[BCTX] &= ~NAK;
- }
- else
- {
- USBIEPIFG |= (1 << epnum);
- }
- }
-
- return true;
-}
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
-bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- xfer_ctl_t * xfer = XFER_CTL_BASE(epnum, dir);
- xfer->buffer = NULL;
- xfer->ff = ff;
- xfer->total_len = total_bytes;
- xfer->queued_len = 0;
- xfer->short_packet = false;
-
- ep_regs_t ep_regs = EP_REGS(epnum, dir);
-
- if(dir == TUSB_DIR_OUT)
- {
- ep_regs[BCTX] &= ~NAK;
- }
- else
- {
- USBIEPIFG |= (1 << epnum);
- }
-
- return true;
-}
-#endif
-
-void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- if(epnum == 0)
- {
- if(dir == TUSB_DIR_OUT)
- {
- USBOEPCNT_0 |= NAK;
- USBOEPCNF_0 |= STALL;
- }
- else
- {
- USBIEPCNT_0 |= NAK;
- USBIEPCNF_0 |= STALL;
- }
- }
- else
- {
- ep_regs_t ep_regs = EP_REGS(epnum, dir);
- ep_regs[CNF] |= STALL;
- }
-}
-
-void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- uint8_t const epnum = tu_edpt_number(ep_addr);
- uint8_t const dir = tu_edpt_dir(ep_addr);
-
- if(epnum == 0)
- {
- if(dir == TUSB_DIR_OUT)
- {
- USBOEPCNF_0 &= ~STALL;
- }
- else
- {
- USBIEPCNF_0 &= ~STALL;
- }
- }
- else
- {
- ep_regs_t ep_regs = EP_REGS(epnum, dir);
- // Required by USB spec to reset DATA toggle bit to DATA0 on interrupt
- // and bulk endpoints.
- ep_regs[CNF] &= ~(STALL + TOGGLE);
- }
-}
-
-void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * request)
-{
- (void) rhport;
- (void) request;
-
- // FIXME: Per manual, we should be clearing the NAK bits of EP0 after the
- // Status Phase of a control xfer is done, in preparation of another possible
- // SETUP packet. However, from my own testing, SETUP packets _are_ correctly
- // handled by the USB core without clearing the NAKs.
- //
- // Right now, clearing NAKs in this callbacks causes a direction mismatch
- // between host and device on EP0. Figure out why and come back to this.
- // USBOEPCNT_0 &= ~NAK;
- // USBIEPCNT_0 &= ~NAK;
-}
-
-/*------------------------------------------------------------------*/
-
-static void receive_packet(uint8_t ep_num)
-{
- xfer_ctl_t * xfer = XFER_CTL_BASE(ep_num, TUSB_DIR_OUT);
- ep_regs_t ep_regs = EP_REGS(ep_num, TUSB_DIR_OUT);
- uint8_t xfer_size;
-
- if(ep_num == 0)
- {
- xfer_size = USBOEPCNT_0 & 0x0F;
- }
- else
- {
- xfer_size = ep_regs[BCTX] & 0x7F;
- }
-
- uint16_t remaining = xfer->total_len - xfer->queued_len;
- uint16_t to_recv_size;
-
- if(remaining <= xfer->max_size) {
- // Avoid buffer overflow.
- to_recv_size = (xfer_size > remaining) ? remaining : xfer_size;
- } else {
- // Room for full packet, choose recv_size based on what the microcontroller
- // claims.
- to_recv_size = (xfer_size > xfer->max_size) ? xfer->max_size : xfer_size;
- }
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- volatile uint8_t * ep_buf = (ep_num == 0) ? &USBOEP0BUF : (&USBSTABUFF + (ep_regs[BBAX] << 3));
- tu_fifo_write_n(xfer->ff, (const void *) ep_buf, to_recv_size);
- }
- else
-#endif
- {
- uint8_t * base = (xfer->buffer + xfer->queued_len);
-
- if(ep_num == 0)
- {
- volatile uint8_t * ep0out_buf = &USBOEP0BUF;
- for(uint16_t i = 0; i < to_recv_size; i++)
- {
- base[i] = ep0out_buf[i];
- }
- }
- else
- {
- volatile uint8_t * ep_buf = &USBSTABUFF + (ep_regs[BBAX] << 3);
- for(uint16_t i = 0; i < to_recv_size ; i++)
- {
- base[i] = ep_buf[i];
- }
- }
- }
-
- xfer->queued_len += xfer_size;
-
- xfer->short_packet = (xfer_size < xfer->max_size);
- if((xfer->total_len == xfer->queued_len) || xfer->short_packet)
- {
- dcd_event_xfer_complete(0, ep_num, xfer->queued_len, XFER_RESULT_SUCCESS, true);
- }
- else
- {
- // Schedule to receive another packet.
- if(ep_num == 0)
- {
- USBOEPCNT_0 &= ~NAK;
- }
- else
- {
- ep_regs[BCTX] &= ~NAK;
- }
- }
-}
-
-static void transmit_packet(uint8_t ep_num)
-{
- xfer_ctl_t * xfer = XFER_CTL_BASE(ep_num, TUSB_DIR_IN);
-
- // First, determine whether we should even send a packet or finish
- // up the xfer.
- bool zlp = (xfer->total_len == 0); // By necessity, xfer->total_len will
- // equal xfer->queued_len for ZLPs.
- // Of course a ZLP is a short packet.
- if((!zlp && (xfer->total_len == xfer->queued_len)) || xfer->short_packet)
- {
- dcd_event_xfer_complete(0, ep_num | TUSB_DIR_IN_MASK, xfer->queued_len, XFER_RESULT_SUCCESS, true);
- return;
- }
-
- // Then actually commit to transmit a packet.
- uint16_t remaining = xfer->total_len - xfer->queued_len;
- uint8_t xfer_size = (xfer->max_size < xfer->total_len) ? xfer->max_size : remaining;
-
- xfer->queued_len += xfer_size;
- if(xfer_size < xfer->max_size)
- {
- // Next "xfer complete interrupt", the transfer will end.
- xfer->short_packet = true;
- }
-
- if(ep_num == 0)
- {
- volatile uint8_t * ep0in_buf = &USBIEP0BUF;
- uint8_t * base = (xfer->buffer + xfer->queued_len);
- for(uint16_t i = 0; i < xfer_size; i++)
- {
- ep0in_buf[i] = base[i];
- }
-
- USBIEPCNT_0 = (USBIEPCNT_0 & 0xF0) + xfer_size;
- USBIEPCNT_0 &= ~NAK;
- }
- else
- {
- ep_regs_t ep_regs = EP_REGS(ep_num, TUSB_DIR_IN);
- volatile uint8_t * ep_buf = &USBSTABUFF + (ep_regs[BBAX] << 3);
-
-#if 0 // TODO support dcd_edpt_xfer_fifo API
- if (xfer->ff)
- {
- tu_fifo_read_n(xfer->ff, (void *) ep_buf, xfer_size);
- }
- else
-#endif
- {
- uint8_t * base = (xfer->buffer + xfer->queued_len);
- for(int i = 0; i < xfer_size; i++)
- {
- ep_buf[i] = base[i];
- }
- }
-
- ep_regs[BCTX] = (ep_regs[BCTX] & 0x80) + (xfer_size & 0x7F);
- ep_regs[BCTX] &= ~NAK;
- }
-}
-
-static void handle_setup_packet(void)
-{
- volatile uint8_t * setup_buf = &USBSUBLK;
-
- for(int i = 0; i < 8; i++)
- {
- _setup_packet[i] = setup_buf[i];
- }
-
- // Clearing SETUPIFG by reading USBVECINT does not set NAK, so now that we
- // have a SETUP packet, force NAKs until tinyusb can handle the SETUP
- // packet and prepare for a new xfer.
- USBIEPCNT_0 |= NAK;
- USBOEPCNT_0 |= NAK;
- dcd_event_setup_received(0, (uint8_t*) &_setup_packet[0], true);
-}
-
-void dcd_int_handler(uint8_t rhport)
-{
- (void) rhport;
-
- // Setup is special- reading USBVECINT to handle setup packets is done to
- // stop hardware-generated NAKs on EP0.
- uint8_t setup_status = USBIFG & SETUPIFG;
-
- if(setup_status)
- {
- handle_setup_packet();
- }
-
- uint16_t curr_vector = USBVECINT;
-
- switch(curr_vector)
- {
- case USBVECINT_RSTR:
- bus_reset();
- dcd_event_bus_reset(0, TUSB_SPEED_FULL, true);
- break;
-
- // Clear the (hardware-enforced) NAK on EP 0 after a SETUP packet
- // is received. At this point, even though the hardware is no longer
- // forcing NAKs, the EP0 NAK bits should still be set to avoid
- // sending/receiving data before tinyusb is ready.
- //
- // Furthermore, it's possible for the hardware to STALL in the middle of
- // a control xfer if the EP0 NAK bits aren't set properly.
- // See: https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/845259
- // From my testing, if all of the following hold:
- // * OUT EP0 NAK is cleared.
- // * IN EP0 NAK is set.
- // * DIR bit in USBCTL is clear.
- // and an IN packet is received on EP0, the USB core will STALL. Setting
- // both EP0 NAKs manually when a SETUP packet is received, as is done
- // in handle_setup_packet(), avoids meeting STALL conditions.
- //
- // TODO: Figure out/explain why the STALL condition can be reached in the
- // first place. When I first noticed the STALL, the only two places I
- // touched the NAK bits were in dcd_edpt_xfer() and to _set_ (sic) them in
- // bus_reset(). SETUP packet handling should've been unaffected.
- case USBVECINT_SETUP_PACKET_RECEIVED:
- break;
-
- case USBVECINT_INPUT_ENDPOINT0:
- transmit_packet(0);
- break;
-
- case USBVECINT_OUTPUT_ENDPOINT0:
- receive_packet(0);
- break;
-
- case USBVECINT_INPUT_ENDPOINT1:
- case USBVECINT_INPUT_ENDPOINT2:
- case USBVECINT_INPUT_ENDPOINT3:
- case USBVECINT_INPUT_ENDPOINT4:
- case USBVECINT_INPUT_ENDPOINT5:
- case USBVECINT_INPUT_ENDPOINT6:
- case USBVECINT_INPUT_ENDPOINT7:
- {
- uint8_t ep = ((curr_vector - USBVECINT_INPUT_ENDPOINT1) >> 1) + 1;
- transmit_packet(ep);
- }
- break;
-
- case USBVECINT_OUTPUT_ENDPOINT1:
- case USBVECINT_OUTPUT_ENDPOINT2:
- case USBVECINT_OUTPUT_ENDPOINT3:
- case USBVECINT_OUTPUT_ENDPOINT4:
- case USBVECINT_OUTPUT_ENDPOINT5:
- case USBVECINT_OUTPUT_ENDPOINT6:
- case USBVECINT_OUTPUT_ENDPOINT7:
- {
- uint8_t ep = ((curr_vector - USBVECINT_OUTPUT_ENDPOINT1) >> 1) + 1;
- receive_packet(ep);
- }
- break;
-
- default:
- while(true);
- break;
- }
-
-}
-
-#endif
diff --git a/tinyusb/src/portable/valentyusb/eptri/dcd_eptri.c b/tinyusb/src/portable/valentyusb/eptri/dcd_eptri.c
deleted file mode 100755
index b68f04fa..00000000
--- a/tinyusb/src/portable/valentyusb/eptri/dcd_eptri.c
+++ /dev/null
@@ -1,643 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef DEBUG
-#define DEBUG 0
-#endif
-
-#ifndef LOG_USB
-#define LOG_USB 0
-#endif
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_DEVICE_ENABLED && (CFG_TUSB_MCU == OPT_MCU_VALENTYUSB_EPTRI)
-
-#include "device/dcd.h"
-#include "dcd_eptri.h"
-#include "csr.h"
-#include "irq.h"
-void fomu_error(uint32_t line);
-
-#if LOG_USB
-struct usb_log {
- uint8_t ep_num;
- uint8_t size;
- uint8_t data[66];
-};
-__attribute__((used))
-struct usb_log usb_log[128];
-__attribute__((used))
-uint8_t usb_log_offset;
-
-struct xfer_log {
- uint8_t ep_num;
- uint16_t size;
-};
-__attribute__((used))
-struct xfer_log xfer_log[64];
-__attribute__((used))
-uint8_t xfer_log_offset;
-
-__attribute__((used))
-struct xfer_log queue_log[64];
-__attribute__((used))
-uint8_t queue_log_offset;
-#endif
-
-//--------------------------------------------------------------------+
-// SIE Command
-//--------------------------------------------------------------------+
-
-#define EP_SIZE 64
-
-uint16_t volatile rx_buffer_offset[16];
-uint8_t* volatile rx_buffer[16];
-uint16_t volatile rx_buffer_max[16];
-
-volatile uint8_t tx_ep;
-volatile bool tx_active;
-volatile uint16_t tx_buffer_offset[16];
-uint8_t* volatile tx_buffer[16];
-volatile uint16_t tx_buffer_max[16];
-volatile uint8_t reset_count;
-
-#if DEBUG
-__attribute__((used)) uint8_t volatile * last_tx_buffer;
-__attribute__((used)) volatile uint8_t last_tx_ep;
-uint8_t setup_packet_bfr[10];
-#endif
-
-//--------------------------------------------------------------------+
-// PIPE HELPER
-//--------------------------------------------------------------------+
-
-static bool advance_tx_ep(void) {
- // Move on to the next transmit buffer in a round-robin manner
- uint8_t prev_tx_ep = tx_ep;
- for (tx_ep = (tx_ep + 1) & 0xf; tx_ep != prev_tx_ep; tx_ep = ((tx_ep + 1) & 0xf)) {
- if (tx_buffer[tx_ep])
- return true;
- }
- if (!tx_buffer[tx_ep])
- return false;
- return true;
-}
-
-#if LOG_USB
-void xfer_log_append(uint8_t ep_num, uint16_t sz) {
- xfer_log[xfer_log_offset].ep_num = ep_num;
- xfer_log[xfer_log_offset].size = sz;
- xfer_log_offset++;
- if (xfer_log_offset >= sizeof(xfer_log)/sizeof(*xfer_log))
- xfer_log_offset = 0;
-}
-
-void queue_log_append(uint8_t ep_num, uint16_t sz) {
- queue_log[queue_log_offset].ep_num = ep_num;
- queue_log[queue_log_offset].size = sz;
- queue_log_offset++;
- if (queue_log_offset >= sizeof(queue_log)/sizeof(*queue_log))
- queue_log_offset = 0;
-}
-#endif
-
-static void tx_more_data(void) {
- // Send more data
- uint8_t added_bytes;
- for (added_bytes = 0; (added_bytes < EP_SIZE) && (tx_buffer_offset[tx_ep] < tx_buffer_max[tx_ep]); added_bytes++) {
-#if LOG_USB
- usb_log[usb_log_offset].data[added_bytes] = tx_buffer[tx_ep][tx_buffer_offset[tx_ep]];
-#endif
- usb_in_data_write(tx_buffer[tx_ep][tx_buffer_offset[tx_ep]++]);
- }
-
-#if LOG_USB
- usb_log[usb_log_offset].ep_num = tu_edpt_addr(tx_ep, TUSB_DIR_IN);
- usb_log[usb_log_offset].size = added_bytes;
- usb_log_offset++;
- if (usb_log_offset >= sizeof(usb_log)/sizeof(*usb_log))
- usb_log_offset = 0;
-#endif
-
- // Updating the epno queues the data
- usb_in_ctrl_write(tx_ep & 0xf);
-}
-
-static void process_tx(void) {
-#if DEBUG
- // If the system isn't idle, then something is very wrong.
- uint8_t in_status = usb_in_status_read();
- if (!(in_status & (1 << CSR_USB_IN_STATUS_IDLE_OFFSET)))
- fomu_error(__LINE__);
-#endif
-
- // If the buffer is now empty, search for the next buffer to fill.
- if (!tx_buffer[tx_ep]) {
- if (advance_tx_ep())
- tx_more_data();
- else
- tx_active = false;
- return;
- }
-
- if (tx_buffer_offset[tx_ep] >= tx_buffer_max[tx_ep]) {
-#if DEBUG
- last_tx_buffer = tx_buffer[tx_ep];
- last_tx_ep = tx_ep;
-#endif
- tx_buffer[tx_ep] = NULL;
- uint16_t xferred_bytes = tx_buffer_max[tx_ep];
- uint8_t xferred_ep = tx_ep;
-
- if (!advance_tx_ep())
- tx_active = false;
-#if LOG_USB
- xfer_log_append(tu_edpt_addr(xferred_ep, TUSB_DIR_IN), xferred_bytes);
-#endif
- dcd_event_xfer_complete(0, tu_edpt_addr(xferred_ep, TUSB_DIR_IN), xferred_bytes, XFER_RESULT_SUCCESS, true);
- if (!tx_active)
- return;
- }
-
- tx_more_data();
- return;
-}
-
-static void process_rx(void) {
- uint8_t out_status = usb_out_status_read();
-#if DEBUG
- // If the OUT handler is still waiting to send, don't do anything.
- if (!(out_status & (1 << CSR_USB_OUT_STATUS_HAVE_OFFSET)))
- fomu_error(__LINE__);
- // return;
-#endif
- uint8_t rx_ep = (out_status >> CSR_USB_OUT_STATUS_EPNO_OFFSET) & 0xf;
-
- // If the destination buffer doesn't exist, don't drain the hardware
- // fifo. Note that this can cause deadlocks if the host is waiting
- // on some other endpoint's data!
-#if DEBUG
- if (rx_buffer[rx_ep] == NULL) {
- fomu_error(__LINE__);
- return;
- }
-#endif
-
- // Drain the FIFO into the destination buffer
- uint32_t total_read = 0;
- uint32_t current_offset = rx_buffer_offset[rx_ep];
-#if DEBUG
- uint8_t test_buffer[256];
- memset(test_buffer, 0, sizeof(test_buffer));
- if (current_offset > rx_buffer_max[rx_ep])
- fomu_error(__LINE__);
-#endif
-#if LOG_USB
- usb_log[usb_log_offset].ep_num = tu_edpt_addr(rx_ep, TUSB_DIR_OUT);
- usb_log[usb_log_offset].size = 0;
-#endif
- while (usb_out_status_read() & (1 << CSR_USB_OUT_STATUS_HAVE_OFFSET)) {
- uint8_t c = usb_out_data_read();
-#if DEBUG
- test_buffer[total_read] = c;
-#endif
- total_read++;
- if (current_offset < rx_buffer_max[rx_ep]) {
-#if LOG_USB
- usb_log[usb_log_offset].data[usb_log[usb_log_offset].size++] = c;
-#endif
- if (rx_buffer[rx_ep] != (volatile uint8_t *)0xffffffff)
- rx_buffer[rx_ep][current_offset++] = c;
- }
- }
-#if LOG_USB
- usb_log_offset++;
- if (usb_log_offset >= sizeof(usb_log)/sizeof(*usb_log))
- usb_log_offset = 0;
-#endif
-#if DEBUG
- if (total_read > 66)
- fomu_error(__LINE__);
- if (total_read < 2)
- total_read = 2;
- // fomu_error(__LINE__);
-#endif
-
- // Strip off the CRC16
- rx_buffer_offset[rx_ep] += (total_read - 2);
- if (rx_buffer_offset[rx_ep] > rx_buffer_max[rx_ep])
- rx_buffer_offset[rx_ep] = rx_buffer_max[rx_ep];
-
- // If there's no more data, complete the transfer to tinyusb
- if ((rx_buffer_max[rx_ep] == rx_buffer_offset[rx_ep])
- // ZLP with less than the total amount of data
- || ((total_read == 2) && ((rx_buffer_offset[rx_ep] & 63) == 0))
- // Short read, but not a full packet
- || (((rx_buffer_offset[rx_ep] & 63) != 0) && (total_read < 66))) {
-#if DEBUG
- if (rx_buffer[rx_ep] == NULL)
- fomu_error(__LINE__);
-#endif
-
- // Free up this buffer.
- rx_buffer[rx_ep] = NULL;
- uint16_t len = rx_buffer_offset[rx_ep];
-
-#if DEBUG
- // Validate that all enabled endpoints have buffers,
- // and no disabled endpoints have buffers.
- uint16_t ep_en_mask = usb_out_enable_status_read();
- int i;
- for (i = 0; i < 16; i++) {
- if ((!!(ep_en_mask & (1 << i))) ^ (!!(rx_buffer[i]))) {
- uint8_t new_status = usb_out_status_read();
- // Another IRQ came in while we were processing, so ignore this endpoint.
- if ((new_status & 0x20) && ((new_status & 0xf) == i))
- continue;
- fomu_error(__LINE__);
- }
- }
-#endif
-#if LOG_USB
- xfer_log_append(tu_edpt_addr(rx_ep, TUSB_DIR_OUT), len);
-#endif
- dcd_event_xfer_complete(0, tu_edpt_addr(rx_ep, TUSB_DIR_OUT), len, XFER_RESULT_SUCCESS, true);
- }
- else {
- // If there's more data, re-enable data reception on this endpoint
- usb_out_ctrl_write((1 << CSR_USB_OUT_CTRL_ENABLE_OFFSET) | rx_ep);
- }
-
- // Now that the buffer is drained, clear the pending IRQ.
- usb_out_ev_pending_write(usb_out_ev_pending_read());
-}
-
-//--------------------------------------------------------------------+
-// CONTROLLER API
-//--------------------------------------------------------------------+
-
-static void dcd_reset(void)
-{
- reset_count++;
- usb_setup_ev_enable_write(0);
- usb_in_ev_enable_write(0);
- usb_out_ev_enable_write(0);
-
- usb_address_write(0);
-
- // Reset all three FIFO handlers
- usb_setup_ctrl_write(1 << CSR_USB_SETUP_CTRL_RESET_OFFSET);
- usb_in_ctrl_write(1 << CSR_USB_IN_CTRL_RESET_OFFSET);
- usb_out_ctrl_write(1 << CSR_USB_OUT_CTRL_RESET_OFFSET);
-
- memset((void *)rx_buffer, 0, sizeof(rx_buffer));
- memset((void *)rx_buffer_max, 0, sizeof(rx_buffer_max));
- memset((void *)rx_buffer_offset, 0, sizeof(rx_buffer_offset));
-
- memset((void *)tx_buffer, 0, sizeof(tx_buffer));
- memset((void *)tx_buffer_max, 0, sizeof(tx_buffer_max));
- memset((void *)tx_buffer_offset, 0, sizeof(tx_buffer_offset));
- tx_ep = 0;
- tx_active = false;
-
- // Enable all event handlers and clear their contents
- usb_setup_ev_pending_write(0xff);
- usb_in_ev_pending_write(0xff);
- usb_out_ev_pending_write(0xff);
- usb_in_ev_enable_write(1);
- usb_out_ev_enable_write(1);
- usb_setup_ev_enable_write(3);
-
- dcd_event_bus_reset(0, TUSB_SPEED_FULL, true);
-}
-
-// Initializes the USB peripheral for device mode and enables it.
-void dcd_init(uint8_t rhport)
-{
- (void) rhport;
-
- usb_pullup_out_write(0);
-
- // Enable all event handlers and clear their contents
- usb_setup_ev_pending_write(usb_setup_ev_pending_read());
- usb_in_ev_pending_write(usb_in_ev_pending_read());
- usb_out_ev_pending_write(usb_out_ev_pending_read());
- usb_in_ev_enable_write(1);
- usb_out_ev_enable_write(1);
- usb_setup_ev_enable_write(3);
-
- // Turn on the external pullup
- usb_pullup_out_write(1);
-}
-
-// Enables or disables the USB device interrupt(s). May be used to
-// prevent concurrency issues when mutating data structures shared
-// between main code and the interrupt handler.
-void dcd_int_enable(uint8_t rhport)
-{
- (void) rhport;
- irq_setmask(irq_getmask() | (1 << USB_INTERRUPT));
-}
-
-void dcd_int_disable(uint8_t rhport)
-{
- (void) rhport;
- irq_setmask(irq_getmask() & ~(1 << USB_INTERRUPT));
-}
-
-// Called when the device is given a new bus address.
-void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
-{
- // Respond with ACK status first before changing device address
- dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
-
- // Wait for the response packet to get sent
- while (tx_active)
- ;
-
- // Activate the new address
- usb_address_write(dev_addr);
-}
-
-// Called to remote wake up host when suspended (e.g hid keyboard)
-void dcd_remote_wakeup(uint8_t rhport)
-{
- (void) rhport;
-}
-
-void dcd_connect(uint8_t rhport)
-{
- (void) rhport;
- usb_pullup_out_write(1);
-}
-
-void dcd_disconnect(uint8_t rhport)
-{
- (void) rhport;
- usb_pullup_out_write(0);
-}
-
-
-//--------------------------------------------------------------------+
-// DCD Endpoint Port
-//--------------------------------------------------------------------+
-bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
-{
- (void) rhport;
- uint8_t ep_num = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
- uint8_t ep_dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress);
-
- if (p_endpoint_desc->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS)
- return false; // Not supported
-
- if (ep_dir == TUSB_DIR_OUT) {
- rx_buffer_offset[ep_num] = 0;
- rx_buffer_max[ep_num] = 0;
- rx_buffer[ep_num] = NULL;
- }
-
- else if (ep_dir == TUSB_DIR_IN) {
- tx_buffer_offset[ep_num] = 0;
- tx_buffer_max[ep_num] = 0;
- tx_buffer[ep_num] = NULL;
- }
-
- return true;
-}
-
-void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
-
- if (tu_edpt_dir(ep_addr) == TUSB_DIR_OUT) {
- uint8_t enable = 0;
- if (rx_buffer[ep_addr])
- enable = 1;
- usb_out_ctrl_write((1 << CSR_USB_OUT_CTRL_STALL_OFFSET) | (enable << CSR_USB_OUT_CTRL_ENABLE_OFFSET) | tu_edpt_number(ep_addr));
- }
- else
- usb_in_ctrl_write((1 << CSR_USB_IN_CTRL_STALL_OFFSET) | tu_edpt_number(ep_addr));
-}
-
-void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
-{
- (void) rhport;
- if (tu_edpt_dir(ep_addr) == TUSB_DIR_OUT) {
- uint8_t enable = 0;
- if (rx_buffer[ep_addr])
- enable = 1;
- usb_out_ctrl_write((0 << CSR_USB_OUT_CTRL_STALL_OFFSET) | (enable << CSR_USB_OUT_CTRL_ENABLE_OFFSET) | tu_edpt_number(ep_addr));
- }
- // IN endpoints will get unstalled when more data is written.
-}
-
-bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t* buffer, uint16_t total_bytes)
-{
- (void)rhport;
- uint8_t ep_num = tu_edpt_number(ep_addr);
- uint8_t ep_dir = tu_edpt_dir(ep_addr);
- TU_ASSERT(ep_num < 16);
-
- // Give a nonzero buffer when we transmit 0 bytes, so that the
- // system doesn't think the endpoint is idle.
- if ((buffer == NULL) && (total_bytes == 0)) {
- buffer = (uint8_t *)0xffffffff;
- }
-
- TU_ASSERT(buffer != NULL);
-
- if (ep_dir == TUSB_DIR_IN) {
- // Wait for the tx pipe to free up
- uint8_t previous_reset_count = reset_count;
- // Continue until the buffer is empty, the system is idle, and the fifo is empty.
- while (tx_buffer[ep_num] != NULL)
- ;
-
- dcd_int_disable(0);
-#if LOG_USB
- queue_log_append(ep_addr, total_bytes);
-#endif
- // If a reset happens while we're waiting, abort the transfer
- if (previous_reset_count != reset_count)
- return true;
-
- TU_ASSERT(tx_buffer[ep_num] == NULL);
- tx_buffer_offset[ep_num] = 0;
- tx_buffer_max[ep_num] = total_bytes;
- tx_buffer[ep_num] = buffer;
-
- // If the current buffer is NULL, then that means the tx logic is idle.
- // Update the tx_ep to point to our endpoint number and queue the data.
- // Otherwise, let it be and it'll get picked up after the next transfer
- // finishes.
- if (!tx_active) {
- tx_ep = ep_num;
- tx_active = true;
- tx_more_data();
- }
- dcd_int_enable(0);
- }
-
- else if (ep_dir == TUSB_DIR_OUT) {
- while (rx_buffer[ep_num] != NULL)
- ;
-
- TU_ASSERT(rx_buffer[ep_num] == NULL);
- dcd_int_disable(0);
-#if LOG_USB
- queue_log_append(ep_addr, total_bytes);
-#endif
- rx_buffer[ep_num] = buffer;
- rx_buffer_offset[ep_num] = 0;
- rx_buffer_max[ep_num] = total_bytes;
-
- // Enable receiving on this particular endpoint
- usb_out_ctrl_write((1 << CSR_USB_OUT_CTRL_ENABLE_OFFSET) | ep_num);
-#if DEBUG
- uint16_t ep_en_mask = usb_out_enable_status_read();
- int i;
- for (i = 0; i < 16; i++) {
- if ((!!(ep_en_mask & (1 << i))) ^ (!!(rx_buffer[i]))) {
- if (rx_buffer[i] && usb_out_ev_pending_read() && (usb_out_status_read() & 0xf) == i)
- continue;
- fomu_error(__LINE__);
- }
- }
-#endif
- dcd_int_enable(0);
- }
- return true;
-}
-
-//--------------------------------------------------------------------+
-// ISR
-//--------------------------------------------------------------------+
-
-static void handle_out(void)
-{
- // An "OUT" transaction just completed so we have new data.
- // (But only if we can accept the data)
-#if DEBUG
- if (!usb_out_ev_pending_read())
- fomu_error(__LINE__);
- if (!usb_out_ev_enable_read())
- fomu_error(__LINE__);
-#endif
- process_rx();
-}
-
-static void handle_in(void)
-{
-#if DEBUG
- if (!usb_in_ev_pending_read())
- fomu_error(__LINE__);
- if (!usb_in_ev_enable_read())
- fomu_error(__LINE__);
-#endif
- usb_in_ev_pending_write(usb_in_ev_pending_read());
- process_tx();
-}
-
-static void handle_reset(void)
-{
-#if DEBUG
- uint8_t setup_pending = usb_setup_ev_pending_read() & usb_setup_ev_enable_read();
- if (!(setup_pending & 2))
- fomu_error(__LINE__);
-#endif
- usb_setup_ev_pending_write(2);
-
- // This event means a bus reset occurred. Reset everything, and
- // abandon any further processing.
- dcd_reset();
-}
-
-static void handle_setup(void)
-{
-#if !DEBUG
- uint8_t setup_packet_bfr[10];
-#endif
-
-#if DEBUG
- uint8_t setup_pending = usb_setup_ev_pending_read() & usb_setup_ev_enable_read();
- if (!(setup_pending & 1))
- fomu_error(__LINE__);
-#endif
-
- // We got a SETUP packet. Copy it to the setup buffer and clear
- // the "pending" bit.
- // Setup packets are always 8 bytes, plus two bytes of crc16.
- uint32_t setup_length = 0;
-
-#if DEBUG
- if (!(usb_setup_status_read() & (1 << CSR_USB_SETUP_STATUS_HAVE_OFFSET)))
- fomu_error(__LINE__);
-#endif
-
- while (usb_setup_status_read() & (1 << CSR_USB_SETUP_STATUS_HAVE_OFFSET)) {
- uint8_t c = usb_setup_data_read();
- if (setup_length < sizeof(setup_packet_bfr))
- setup_packet_bfr[setup_length] = c;
- setup_length++;
- }
-
- // If we have 10 bytes, that's a full SETUP packet plus CRC16.
- // Otherwise, it was an RX error.
- if (setup_length == 10) {
- dcd_event_setup_received(0, setup_packet_bfr, true);
- }
-#if DEBUG
- else {
- fomu_error(__LINE__);
- }
-#endif
-
- usb_setup_ev_pending_write(1);
-}
-void dcd_int_handler(uint8_t rhport)
-{
- (void)rhport;
- uint8_t next_ev;
- while ((next_ev = usb_next_ev_read())) {
- switch (next_ev) {
- case 1 << CSR_USB_NEXT_EV_IN_OFFSET:
- handle_in();
- break;
- case 1 << CSR_USB_NEXT_EV_OUT_OFFSET:
- handle_out();
- break;
- case 1 << CSR_USB_NEXT_EV_SETUP_OFFSET:
- handle_setup();
- break;
- case 1 << CSR_USB_NEXT_EV_RESET_OFFSET:
- handle_reset();
- break;
- }
- }
-}
-
-#endif
diff --git a/tinyusb/src/portable/valentyusb/eptri/dcd_eptri.h b/tinyusb/src/portable/valentyusb/eptri/dcd_eptri.h
deleted file mode 100755
index 0fa6ecc6..00000000
--- a/tinyusb/src/portable/valentyusb/eptri/dcd_eptri.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_DCD_VALENTYUSB_EPTRI_H_
-#define _TUSB_DCD_VALENTYUSB_EPTRI_H_
-
-#include "common/tusb_common.h"
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_DCD_VALENTYUSB_EPTRI_H_ */
diff --git a/tinyusb/src/tusb.c b/tinyusb/src/tusb.c
deleted file mode 100755
index 6494287d..00000000
--- a/tinyusb/src/tusb.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-
-#if TUSB_OPT_HOST_ENABLED || TUSB_OPT_DEVICE_ENABLED
-
-#include "tusb.h"
-
-// TODO clean up
-#if TUSB_OPT_DEVICE_ENABLED
-#include "device/usbd_pvt.h"
-#endif
-
-bool tusb_init(void)
-{
-#if TUSB_OPT_DEVICE_ENABLED
- TU_ASSERT ( tud_init(TUD_OPT_RHPORT) ); // init device stack
-#endif
-
-#if TUSB_OPT_HOST_ENABLED
- TU_ASSERT( tuh_init(TUH_OPT_RHPORT) ); // init host stack
-#endif
-
- return true;
-}
-
-bool tusb_inited(void)
-{
- bool ret = false;
-
-#if TUSB_OPT_DEVICE_ENABLED
- ret = ret || tud_inited();
-#endif
-
-#if TUSB_OPT_HOST_ENABLED
- ret = ret || tuh_inited();
-#endif
-
- return ret;
-}
-
-//--------------------------------------------------------------------+
-// Internal Helper for both Host and Device stack
-//--------------------------------------------------------------------+
-
-bool tu_edpt_validate(tusb_desc_endpoint_t const * desc_ep, tusb_speed_t speed)
-{
- uint16_t const max_packet_size = tu_le16toh(desc_ep->wMaxPacketSize.size);
- TU_LOG2(" Open EP %02X with Size = %u\r\n", desc_ep->bEndpointAddress, max_packet_size);
-
- switch (desc_ep->bmAttributes.xfer)
- {
- case TUSB_XFER_ISOCHRONOUS:
- {
- uint16_t const spec_size = (speed == TUSB_SPEED_HIGH ? 1024 : 1023);
- TU_ASSERT(max_packet_size <= spec_size);
- }
- break;
-
- case TUSB_XFER_BULK:
- if (speed == TUSB_SPEED_HIGH)
- {
- // Bulk highspeed must be EXACTLY 512
- TU_ASSERT(max_packet_size == 512);
- }else
- {
- // TODO Bulk fullspeed can only be 8, 16, 32, 64
- TU_ASSERT(max_packet_size <= 64);
- }
- break;
-
- case TUSB_XFER_INTERRUPT:
- {
- uint16_t const spec_size = (speed == TUSB_SPEED_HIGH ? 1024 : 64);
- TU_ASSERT(max_packet_size <= spec_size);
- }
- break;
-
- default: return false;
- }
-
- return true;
-}
-
-void tu_edpt_bind_driver(uint8_t ep2drv[][2], tusb_desc_interface_t const* desc_itf, uint16_t desc_len, uint8_t driver_id)
-{
- uint8_t const* p_desc = (uint8_t const*) desc_itf;
- uint16_t len = 0;
-
- while( len < desc_len )
- {
- if ( TUSB_DESC_ENDPOINT == tu_desc_type(p_desc) )
- {
- uint8_t const ep_addr = ((tusb_desc_endpoint_t const*) p_desc)->bEndpointAddress;
-
- TU_LOG(2, " Bind EP %02x to driver id %u\r\n", ep_addr, driver_id);
- ep2drv[tu_edpt_number(ep_addr)][tu_edpt_dir(ep_addr)] = driver_id;
- }
-
- len = (uint16_t)(len + tu_desc_len(p_desc));
- p_desc = tu_desc_next(p_desc);
- }
-}
-
-uint16_t tu_desc_get_interface_total_len(tusb_desc_interface_t const* desc_itf, uint8_t itf_count, uint16_t max_len)
-{
- uint8_t const* p_desc = (uint8_t const*) desc_itf;
- uint16_t len = 0;
-
- while (itf_count--)
- {
- // Next on interface desc
- len += tu_desc_len(desc_itf);
- p_desc = tu_desc_next(p_desc);
-
- while (len < max_len)
- {
- // return on IAD regardless of itf count
- if ( tu_desc_type(p_desc) == TUSB_DESC_INTERFACE_ASSOCIATION ) return len;
-
- if ( (tu_desc_type(p_desc) == TUSB_DESC_INTERFACE) &&
- ((tusb_desc_interface_t const*) p_desc)->bAlternateSetting == 0 )
- {
- break;
- }
-
- len += tu_desc_len(p_desc);
- p_desc = tu_desc_next(p_desc);
- }
- }
-
- return len;
-}
-
-/*------------------------------------------------------------------*/
-/* Debug
- *------------------------------------------------------------------*/
-#if CFG_TUSB_DEBUG
-#include <ctype.h>
-
-char const* const tusb_strerr[TUSB_ERROR_COUNT] = { ERROR_TABLE(ERROR_STRING) };
-
-static void dump_str_line(uint8_t const* buf, uint16_t count)
-{
- tu_printf(" |");
-
- // each line is 16 bytes
- for(uint16_t i=0; i<count; i++)
- {
- const char ch = buf[i];
- tu_printf("%c", isprint(ch) ? ch : '.');
- }
-
- tu_printf("|\r\n");
-}
-
-/* Print out memory contents
- * - buf : buffer
- * - count : number of item
- * - indent: prefix spaces on every line
- */
-void tu_print_mem(void const *buf, uint32_t count, uint8_t indent)
-{
- uint8_t const size = 1; // fixed 1 byte for now
-
- if ( !buf || !count )
- {
- tu_printf("NULL\r\n");
- return;
- }
-
- uint8_t const *buf8 = (uint8_t const *) buf;
-
- char format[] = "%00X";
- format[2] += 2*size;
-
- const uint8_t item_per_line = 16 / size;
-
- for(unsigned int i=0; i<count; i++)
- {
- unsigned int value=0;
-
- if ( i%item_per_line == 0 )
- {
- // Print Ascii
- if ( i != 0 )
- {
- dump_str_line(buf8-16, 16);
- }
-
- for(uint8_t s=0; s < indent; s++) tu_printf(" ");
-
- // print offset or absolute address
- tu_printf("%04X: ", 16*i/item_per_line);
- }
-
- memcpy(&value, buf8, size);
- buf8 += size;
-
- tu_printf(" ");
- tu_printf(format, value);
- }
-
- // fill up last row to 16 for printing ascii
- const uint32_t remain = count%16;
- uint8_t nback = (remain ? remain : 16);
-
- if ( remain )
- {
- for(uint32_t i=0; i< 16-remain; i++)
- {
- tu_printf(" ");
- for(int j=0; j<2*size; j++) tu_printf(" ");
- }
- }
-
- dump_str_line(buf8-nback, nback);
-}
-
-#endif
-
-#endif // host or device enabled
diff --git a/tinyusb/src/tusb.h b/tinyusb/src/tusb.h
deleted file mode 100755
index b52f8839..00000000
--- a/tinyusb/src/tusb.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_H_
-#define _TUSB_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// INCLUDE
-//--------------------------------------------------------------------+
-#include "common/tusb_common.h"
-#include "osal/osal.h"
-#include "common/tusb_fifo.h"
-
-//------------- HOST -------------//
-#if TUSB_OPT_HOST_ENABLED
- #include "host/usbh.h"
-
- #if CFG_TUH_HID
- #include "class/hid/hid_host.h"
- #endif
-
- #if CFG_TUH_MSC
- #include "class/msc/msc_host.h"
- #endif
-
- #if CFG_TUH_CDC
- #include "class/cdc/cdc_host.h"
- #endif
-
- #if CFG_TUH_VENDOR
- #include "class/vendor/vendor_host.h"
- #endif
-
-#endif
-
-//------------- DEVICE -------------//
-#if TUSB_OPT_DEVICE_ENABLED
- #include "device/usbd.h"
-
- #if CFG_TUD_HID
- #include "class/hid/hid_device.h"
- #endif
-
- #if CFG_TUD_CDC
- #include "class/cdc/cdc_device.h"
- #endif
-
- #if CFG_TUD_MSC
- #include "class/msc/msc_device.h"
- #endif
-
-#if CFG_TUD_AUDIO
- #include "class/audio/audio_device.h"
-#endif
-
- #if CFG_TUD_MIDI
- #include "class/midi/midi_device.h"
- #endif
-
- #if CFG_TUD_VENDOR
- #include "class/vendor/vendor_device.h"
- #endif
-
- #if CFG_TUD_USBTMC
- #include "class/usbtmc/usbtmc_device.h"
- #endif
-
- #if CFG_TUD_DFU_RUNTIME
- #include "class/dfu/dfu_rt_device.h"
- #endif
-
- #if CFG_TUD_DFU
- #include "class/dfu/dfu_device.h"
- #endif
-
- #if CFG_TUD_NET
- #include "class/net/net_device.h"
- #endif
-
- #if CFG_TUD_BTH
- #include "class/bth/bth_device.h"
- #endif
-#endif
-
-
-//--------------------------------------------------------------------+
-// APPLICATION API
-//--------------------------------------------------------------------+
-/** \ingroup group_application_api
- * @{ */
-
-// Initialize device/host stack
-// Note: when using with RTOS, this should be called after scheduler/kernel is started.
-// Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API.
-bool tusb_init(void);
-
-// Check if stack is initialized
-bool tusb_inited(void);
-
-// TODO
-// bool tusb_teardown(void);
-
-/** @} */
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_H_ */
diff --git a/tinyusb/src/tusb_option.h b/tinyusb/src/tusb_option.h
deleted file mode 100755
index da1a39f1..00000000
--- a/tinyusb/src/tusb_option.h
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_OPTION_H_
-#define _TUSB_OPTION_H_
-
-#define TUSB_VERSION_MAJOR 0
-#define TUSB_VERSION_MINOR 10
-#define TUSB_VERSION_REVISION 1
-#define TUSB_VERSION_STRING TU_STRING(TUSB_VERSION_MAJOR) "." TU_STRING(TUSB_VERSION_MINOR) "." TU_STRING(TUSB_VERSION_REVISION)
-
-//--------------------------------------------------------------------+
-// Supported MCUs
-// CFG_TUSB_MCU must be defined to one of following value
-//--------------------------------------------------------------------+
-#define TU_CHECK_MCU(_m) (CFG_TUSB_MCU == OPT_MCU_##_m)
-
-#define OPT_MCU_NONE 0
-
-// LPC
-#define OPT_MCU_LPC11UXX 1 ///< NXP LPC11Uxx
-#define OPT_MCU_LPC13XX 2 ///< NXP LPC13xx
-#define OPT_MCU_LPC15XX 3 ///< NXP LPC15xx
-#define OPT_MCU_LPC175X_6X 4 ///< NXP LPC175x, LPC176x
-#define OPT_MCU_LPC177X_8X 5 ///< NXP LPC177x, LPC178x
-#define OPT_MCU_LPC18XX 6 ///< NXP LPC18xx
-#define OPT_MCU_LPC40XX 7 ///< NXP LPC40xx
-#define OPT_MCU_LPC43XX 8 ///< NXP LPC43xx
-#define OPT_MCU_LPC51UXX 9 ///< NXP LPC51U6x
-#define OPT_MCU_LPC54XXX 10 ///< NXP LPC54xxx
-#define OPT_MCU_LPC55XX 11 ///< NXP LPC55xx
-
-// NRF
-#define OPT_MCU_NRF5X 100 ///< Nordic nRF5x series
-
-// SAM
-#define OPT_MCU_SAMD21 200 ///< MicroChip SAMD21
-#define OPT_MCU_SAMD51 201 ///< MicroChip SAMD51
-#define OPT_MCU_SAMG 202 ///< MicroChip SAMDG series
-#define OPT_MCU_SAME5X 203 ///< MicroChip SAM E5x
-#define OPT_MCU_SAMD11 204 ///< MicroChip SAMD11
-#define OPT_MCU_SAML22 205 ///< MicroChip SAML22
-#define OPT_MCU_SAML21 206 ///< MicroChip SAML21
-#define OPT_MCU_SAMX7X 207 ///< MicroChip SAME70, S70, V70, V71 family
-
-// STM32
-#define OPT_MCU_STM32F0 300 ///< ST STM32F0
-#define OPT_MCU_STM32F1 301 ///< ST STM32F1
-#define OPT_MCU_STM32F2 302 ///< ST STM32F2
-#define OPT_MCU_STM32F3 303 ///< ST STM32F3
-#define OPT_MCU_STM32F4 304 ///< ST STM32F4
-#define OPT_MCU_STM32F7 305 ///< ST STM32F7
-#define OPT_MCU_STM32H7 306 ///< ST STM32H7
-#define OPT_MCU_STM32L0 307 ///< ST STM32L0
-#define OPT_MCU_STM32L1 308 ///< ST STM32L1
-#define OPT_MCU_STM32L4 309 ///< ST STM32L4
-
-// Sony
-#define OPT_MCU_CXD56 400 ///< SONY CXD56
-
-// TI MSP430
-#define OPT_MCU_MSP430x5xx 500 ///< TI MSP430x5xx
-
-// ValentyUSB eptri
-#define OPT_MCU_VALENTYUSB_EPTRI 600 ///< Fomu eptri config
-
-// NXP iMX RT
-#define OPT_MCU_MIMXRT10XX 700 ///< NXP iMX RT10xx
-
-// Nuvoton
-#define OPT_MCU_NUC121 800
-#define OPT_MCU_NUC126 801
-#define OPT_MCU_NUC120 802
-#define OPT_MCU_NUC505 803
-
-// Espressif
-#define OPT_MCU_ESP32S2 900 ///< Espressif ESP32-S2
-#define OPT_MCU_ESP32S3 901 ///< Espressif ESP32-S3
-
-// Dialog
-#define OPT_MCU_DA1469X 1000 ///< Dialog Semiconductor DA1469x
-
-// Raspberry Pi
-#define OPT_MCU_RP2040 1100 ///< Raspberry Pi RP2040
-
-// NXP Kinetis
-#define OPT_MCU_MKL25ZXX 1200 ///< NXP MKL25Zxx
-#define OPT_MCU_K32L2BXX 1201 ///< NXP K32L2Bxx
-
-// Silabs
-#define OPT_MCU_EFM32GG 1300 ///< Silabs EFM32GG
-#define OPT_MCU_EFM32GG11 1301 ///< Silabs EFM32GG11
-#define OPT_MCU_EFM32GG12 1302 ///< Silabs EFM32GG12
-
-// Renesas RX
-#define OPT_MCU_RX63X 1400 ///< Renesas RX63N/631
-#define OPT_MCU_RX65X 1401 ///< Renesas RX65N/RX651
-#define OPT_MCU_RX72N 1402 ///< Renesas RX72N
-
-// Mind Motion
-#define OPT_MCU_MM32F327X 1500 ///< Mind Motion MM32F327
-
-// GigaDevice
-#define OPT_MCU_GD32VF103 1600 ///< GigaDevice GD32VF103
-
-//--------------------------------------------------------------------+
-// Supported OS
-//--------------------------------------------------------------------+
-
-#define OPT_OS_NONE 1 ///< No RTOS
-#define OPT_OS_FREERTOS 2 ///< FreeRTOS
-#define OPT_OS_MYNEWT 3 ///< Mynewt OS
-#define OPT_OS_CUSTOM 4 ///< Custom OS is implemented by application
-#define OPT_OS_PICO 5 ///< Raspberry Pi Pico SDK
-#define OPT_OS_RTTHREAD 6 ///< RT-Thread
-
-// Allow to use command line to change the config name/location
-#ifdef CFG_TUSB_CONFIG_FILE
- #include CFG_TUSB_CONFIG_FILE
-#else
- #include "tusb_config.h"
-#endif
-
-//--------------------------------------------------------------------
-// RootHub Mode Configuration
-// CFG_TUSB_RHPORTx_MODE contains operation mode and speed for that port
-//--------------------------------------------------------------------
-
-// Lower 4-bit is operational mode
-#define OPT_MODE_NONE 0x00 ///< Disabled
-#define OPT_MODE_DEVICE 0x01 ///< Device Mode
-#define OPT_MODE_HOST 0x02 ///< Host Mode
-
-// Higher 4-bit is max operational speed (corresponding to tusb_speed_t)
-#define OPT_MODE_FULL_SPEED 0x00 ///< Max Full Speed
-#define OPT_MODE_LOW_SPEED 0x10 ///< Max Low Speed
-#define OPT_MODE_HIGH_SPEED 0x20 ///< Max High Speed
-
-
-#ifndef CFG_TUSB_RHPORT0_MODE
- #define CFG_TUSB_RHPORT0_MODE OPT_MODE_NONE
-#endif
-
-
-#ifndef CFG_TUSB_RHPORT1_MODE
- #define CFG_TUSB_RHPORT1_MODE OPT_MODE_NONE
-#endif
-
-#if (((CFG_TUSB_RHPORT0_MODE) & OPT_MODE_HOST ) && ((CFG_TUSB_RHPORT1_MODE) & OPT_MODE_HOST )) || \
- (((CFG_TUSB_RHPORT0_MODE) & OPT_MODE_DEVICE) && ((CFG_TUSB_RHPORT1_MODE) & OPT_MODE_DEVICE))
- #error "TinyUSB currently does not support same modes on more than 1 roothub port"
-#endif
-
-// Which roothub port is configured as host
-#define TUH_OPT_RHPORT ( ((CFG_TUSB_RHPORT0_MODE) & OPT_MODE_HOST) ? 0 : (((CFG_TUSB_RHPORT1_MODE) & OPT_MODE_HOST) ? 1 : -1) )
-#define TUSB_OPT_HOST_ENABLED ( TUH_OPT_RHPORT >= 0 )
-
-// Which roothub port is configured as device
-#define TUD_OPT_RHPORT ( ((CFG_TUSB_RHPORT0_MODE) & OPT_MODE_DEVICE) ? 0 : (((CFG_TUSB_RHPORT1_MODE) & OPT_MODE_DEVICE) ? 1 : -1) )
-
-#if TUD_OPT_RHPORT == 0
-#define TUD_OPT_HIGH_SPEED ( (CFG_TUSB_RHPORT0_MODE) & OPT_MODE_HIGH_SPEED )
-#else
-#define TUD_OPT_HIGH_SPEED ( (CFG_TUSB_RHPORT1_MODE) & OPT_MODE_HIGH_SPEED )
-#endif
-
-#define TUSB_OPT_DEVICE_ENABLED ( TUD_OPT_RHPORT >= 0 )
-
-//--------------------------------------------------------------------+
-// COMMON OPTIONS
-//--------------------------------------------------------------------+
-
-// Debug enable to print out error message
-#ifndef CFG_TUSB_DEBUG
- #define CFG_TUSB_DEBUG 0
-#endif
-
-// place data in accessible RAM for usb controller
-#ifndef CFG_TUSB_MEM_SECTION
- #define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
- #define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4)
-#endif
-
-#ifndef CFG_TUSB_OS
- #define CFG_TUSB_OS OPT_OS_NONE
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE OPTIONS
-//--------------------------------------------------------------------
-
-#ifndef CFG_TUD_ENDPOINT0_SIZE
- #define CFG_TUD_ENDPOINT0_SIZE 64
-#endif
-
-#ifndef CFG_TUD_CDC
- #define CFG_TUD_CDC 0
-#endif
-
-#ifndef CFG_TUD_MSC
- #define CFG_TUD_MSC 0
-#endif
-
-#ifndef CFG_TUD_HID
- #define CFG_TUD_HID 0
-#endif
-
-#ifndef CFG_TUD_AUDIO
- #define CFG_TUD_AUDIO 0
-#endif
-
-#ifndef CFG_TUD_MIDI
- #define CFG_TUD_MIDI 0
-#endif
-
-#ifndef CFG_TUD_VENDOR
- #define CFG_TUD_VENDOR 0
-#endif
-
-#ifndef CFG_TUD_USBTMC
- #define CFG_TUD_USBTMC 0
-#endif
-
-#ifndef CFG_TUD_DFU_RUNTIME
- #define CFG_TUD_DFU_RUNTIME 0
-#endif
-
-#ifndef CFG_TUD_DFU
- #define CFG_TUD_DFU 0
-#endif
-
-#ifndef CFG_TUD_NET
- #define CFG_TUD_NET 0
-#endif
-
-#ifndef CFG_TUD_BTH
- #define CFG_TUD_BTH 0
-#endif
-
-//--------------------------------------------------------------------
-// HOST OPTIONS
-//--------------------------------------------------------------------
-#if TUSB_OPT_HOST_ENABLED
- #ifndef CFG_TUH_DEVICE_MAX
- #define CFG_TUH_DEVICE_MAX 1
- #endif
-
- #ifndef CFG_TUH_ENUMERATION_BUFSIZE
- #define CFG_TUH_ENUMERATION_BUFSIZE 256
- #endif
-
- //------------- CLASS -------------//
-#endif // TUSB_OPT_HOST_ENABLED
-
-//--------------------------------------------------------------------+
-// Port Specific
-// TUP stand for TinyUSB Port (can be renamed)
-//--------------------------------------------------------------------+
-
-//------------- Unaligned Memory -------------//
-
-// ARMv7+ (M3-M7, M23-M33) can access unaligned memory
-#if (defined(__ARM_ARCH) && (__ARM_ARCH >= 7))
- #define TUP_ARCH_STRICT_ALIGN 0
-#else
- #define TUP_ARCH_STRICT_ALIGN 1
-#endif
-
-// TUP_MCU_STRICT_ALIGN will overwrite TUP_ARCH_STRICT_ALIGN.
-// In case TUP_MCU_STRICT_ALIGN = 1 and TUP_ARCH_STRICT_ALIGN =0, we will not reply on compiler
-// to generate unaligned access code.
-// LPC_IP3511 Highspeed cannot access unaligned memory on USB_RAM
-#if TUD_OPT_HIGH_SPEED && (CFG_TUSB_MCU == OPT_MCU_LPC54XXX || CFG_TUSB_MCU == OPT_MCU_LPC55XX)
- #define TUP_MCU_STRICT_ALIGN 1
-#else
- #define TUP_MCU_STRICT_ALIGN 0
-#endif
-
-
-//------------------------------------------------------------------
-// Configuration Validation
-//------------------------------------------------------------------
-#if CFG_TUD_ENDPOINT0_SIZE > 64
- #error Control Endpoint Max Packet Size cannot be larger than 64
-#endif
-
-#endif /* _TUSB_OPTION_H_ */
-
-/** @} */
diff --git a/tinyusb/test/ceedling b/tinyusb/test/ceedling
deleted file mode 100755
index 53930857..00000000
--- a/tinyusb/test/ceedling
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-ruby vendor/ceedling/bin/ceedling $*
diff --git a/tinyusb/test/project.yml b/tinyusb/test/project.yml
deleted file mode 100755
index dc4a9cb2..00000000
--- a/tinyusb/test/project.yml
+++ /dev/null
@@ -1,106 +0,0 @@
----
-
-# Notes:
-# Sample project C code is not presently written to produce a release artifact.
-# As such, release build options are disabled.
-# This sample, therefore, only demonstrates running a collection of unit tests.
-
-:project:
- :use_exceptions: TRUE
- :use_mocks: TRUE
- :use_test_preprocessor: TRUE
- :use_auxiliary_dependencies: TRUE
- :use_deep_dependencies: TRUE
- :build_root: _build
-# :release_build: TRUE
- :test_file_prefix: test_
- :which_ceedling: vendor/ceedling
- :default_tasks:
- - test:all
-
-#:test_build:
-# :use_assembly: TRUE
-
-#:release_build:
-# :output: MyApp.out
-# :use_assembly: FALSE
-
-:environment:
-
-:extension:
- :executable: .out
-
-:paths:
- :test:
- - +:test/**
- - -:test/support
- :source:
- - ../src/**
- :support:
- - test/support
-
-:defines:
- # in order to add common defines:
- # 1) remove the trailing [] from the :common: section
- # 2) add entries to the :common: section (e.g. :test: has TEST defined)
- :common: &common_defines
- - _UNITY_TEST_
- :test:
- - *common_defines
- :test_preprocess:
- - *common_defines
-
-:cmock:
- :mock_prefix: mock_
- :when_no_prototypes: :warn
- :enforce_strict_ordering: TRUE
- :plugins:
- - :ignore
- - :ignore_arg
- - :return_thru_ptr
- - :callback
- - :array
- :treat_as:
- uint8: HEX8
- uint16: HEX16
- uint32: UINT32
- int8: INT8
- bool: UINT8
-
-# Add -gcov to the plugins list to make sure of the gcov plugin
-# You will need to have gcov and gcovr both installed to make it work.
-# For more information on these options, see docs in plugins/gcov
-:gcov:
- :html_report: TRUE
- :html_report_type: detailed
- :html_medium_threshold: 75
- :html_high_threshold: 90
- :xml_report: FALSE
-
-#:tools:
-# Ceedling defaults to using gcc for compiling, linking, etc.
-# As [:tools] is blank, gcc will be used (so long as it's in your system path)
-# See documentation to configure a given toolchain for use
-
-# LIBRARIES
-# These libraries are automatically injected into the build process. Those specified as
-# common will be used in all types of builds. Otherwise, libraries can be injected in just
-# tests or releases. These options are MERGED with the options in supplemental yaml files.
-:libraries:
- :placement: :end
- :flag: "${1}" # or "-L ${1}" for example
- :common: &common_libraries []
- :test:
- - *common_libraries
- :release:
- - *common_libraries
-
-:plugins:
- :load_paths:
- - vendor/ceedling/plugins
- :enabled:
- - stdout_pretty_tests_report
- - module_generator
- - raw_output_report
- - colour_report
-...
diff --git a/tinyusb/test/test/device/msc/test_msc_device.c b/tinyusb/test/test/device/msc/test_msc_device.c
deleted file mode 100755
index 00bb86cc..00000000
--- a/tinyusb/test/test/device/msc/test_msc_device.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, hathach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-
-#include "unity.h"
-
-// Files to test
-#include "tusb_fifo.h"
-#include "tusb.h"
-#include "usbd.h"
-TEST_FILE("usbd_control.c")
-TEST_FILE("msc_device.c")
-
-// Mock File
-#include "mock_dcd.h"
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-enum
-{
- EDPT_CTRL_OUT = 0x00,
- EDPT_CTRL_IN = 0x80,
-
- EDPT_MSC_OUT = 0x01,
- EDPT_MSC_IN = 0x81,
-};
-
-uint8_t const rhport = 0;
-
-enum
-{
- ITF_NUM_MSC,
- ITF_NUM_TOTAL
-};
-
-#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_MSC_DESC_LEN)
-
-uint8_t const data_desc_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-
- // Interface number, string index, EP Out & EP In address, EP size
- TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 0, EDPT_MSC_OUT, EDPT_MSC_IN, TUD_OPT_HIGH_SPEED ? 512 : 64),
-};
-
-tusb_control_request_t const request_set_configuration =
-{
- .bmRequestType = 0x00,
- .bRequest = TUSB_REQ_SET_CONFIGURATION,
- .wValue = 1,
- .wIndex = 0,
- .wLength = 0
-};
-
-uint8_t const* desc_configuration;
-
-
-enum
-{
- DISK_BLOCK_NUM = 16, // 8KB is the smallest size that windows allow to mount
- DISK_BLOCK_SIZE = 512
-};
-
-uint8_t msc_disk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE];
-
-// Invoked when received SCSI_CMD_INQUIRY
-// Application fill vendor id, product id and revision with string up to 8, 16, 4 characters respectively
-void tud_msc_inquiry_cb(uint8_t lun, uint8_t vendor_id[8], uint8_t product_id[16], uint8_t product_rev[4])
-{
- (void) lun;
-
- const char vid[] = "TinyUSB";
- const char pid[] = "Mass Storage";
- const char rev[] = "1.0";
-
- memcpy(vendor_id , vid, strlen(vid));
- memcpy(product_id , pid, strlen(pid));
- memcpy(product_rev, rev, strlen(rev));
-}
-
-// Invoked when received Test Unit Ready command.
-// return true allowing host to read/write this LUN e.g SD card inserted
-bool tud_msc_test_unit_ready_cb(uint8_t lun)
-{
- (void) lun;
-
- return true; // RAM disk is always ready
-}
-
-// Invoked when received SCSI_CMD_READ_CAPACITY_10 and SCSI_CMD_READ_FORMAT_CAPACITY to determine the disk size
-// Application update block count and block size
-void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_size)
-{
- (void) lun;
-
- *block_count = DISK_BLOCK_NUM;
- *block_size = DISK_BLOCK_SIZE;
-}
-
-// Invoked when received Start Stop Unit command
-// - Start = 0 : stopped power mode, if load_eject = 1 : unload disk storage
-// - Start = 1 : active mode, if load_eject = 1 : load disk storage
-bool tud_msc_start_stop_cb(uint8_t lun, uint8_t power_condition, bool start, bool load_eject)
-{
- (void) lun;
- (void) power_condition;
-
- return true;
-}
-
-// Callback invoked when received READ10 command.
-// Copy disk's data to buffer (up to bufsize) and return number of copied bytes.
-int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize)
-{
- (void) lun;
-
- uint8_t const* addr = msc_disk[lba] + offset;
- memcpy(buffer, addr, bufsize);
-
- return bufsize;
-}
-
-// Callback invoked when received WRITE10 command.
-// Process data in buffer to disk's storage and return number of written bytes
-int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize)
-{
- (void) lun;
-
- uint8_t* addr = msc_disk[lba] + offset;
- memcpy(addr, buffer, bufsize);
-
- return bufsize;
-}
-
-// Callback invoked when received an SCSI command not in built-in list below
-// - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, MODE_SENSE6, REQUEST_SENSE
-// - READ10 and WRITE10 has their own callbacks
-int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize)
-{
- // read10 & write10 has their own callback and MUST not be handled here
-
- void const* response = NULL;
- uint16_t resplen = 0;
-
- return resplen;
-}
-
-//--------------------------------------------------------------------+
-//
-//--------------------------------------------------------------------+
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return NULL;
-}
-
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- return desc_configuration;
-}
-
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- return NULL;
-}
-
-void setUp(void)
-{
- dcd_int_disable_Ignore();
- dcd_int_enable_Ignore();
-
- if ( !tusb_inited() )
- {
- dcd_init_Expect(rhport);
- tusb_init();
- }
-
- dcd_event_bus_reset(rhport, TUSB_SPEED_HIGH, false);
- tud_task();
-}
-
-void tearDown(void)
-{
-}
-
-//--------------------------------------------------------------------+
-//
-//--------------------------------------------------------------------+
-void test_msc(void)
-{
- // Read 1 LBA = 0, Block count = 1
- msc_cbw_t cbw_read10 =
- {
- .signature = MSC_CBW_SIGNATURE,
- .tag = 0xCAFECAFE,
- .total_bytes = 512,
- .lun = 0,
- .dir = TUSB_DIR_IN_MASK,
- .cmd_len = sizeof(scsi_read10_t)
- };
-
- scsi_read10_t cmd_read10 =
- {
- .cmd_code = SCSI_CMD_READ_10,
- .lba = tu_htonl(0),
- .block_count = tu_htons(1)
- };
-
- memcpy(cbw_read10.command, &cmd_read10, cbw_read10.cmd_len);
-
- desc_configuration = data_desc_configuration;
- uint8_t const* desc_ep = tu_desc_next(tu_desc_next(desc_configuration));
-
- dcd_event_setup_received(rhport, (uint8_t*) &request_set_configuration, false);
-
- // open endpoints
- dcd_edpt_open_ExpectAndReturn(rhport, (tusb_desc_endpoint_t const *) desc_ep, true);
- dcd_edpt_open_ExpectAndReturn(rhport, (tusb_desc_endpoint_t const *) tu_desc_next(desc_ep), true);
-
- // Prepare SCSI command
- dcd_edpt_xfer_ExpectAndReturn(rhport, EDPT_MSC_OUT, NULL, sizeof(msc_cbw_t), true);
- dcd_edpt_xfer_IgnoreArg_buffer();
- dcd_edpt_xfer_ReturnMemThruPtr_buffer( (uint8_t*) &cbw_read10, sizeof(msc_cbw_t));
-
- // command received
- dcd_event_xfer_complete(rhport, EDPT_MSC_OUT, sizeof(msc_cbw_t), 0, true);
-
- // control status
- dcd_edpt_xfer_ExpectAndReturn(rhport, EDPT_CTRL_IN, NULL, 0, true);
-
- // SCSI Data transfer
- dcd_edpt_xfer_ExpectAndReturn(rhport, EDPT_MSC_IN, NULL, 512, true);
- dcd_edpt_xfer_IgnoreArg_buffer();
- dcd_event_xfer_complete(rhport, EDPT_MSC_IN, 512, 0, true); // complete
-
- // SCSI Status
- dcd_edpt_xfer_ExpectAndReturn(rhport, EDPT_MSC_IN, NULL, 13, true);
- dcd_edpt_xfer_IgnoreArg_buffer();
- dcd_event_xfer_complete(rhport, EDPT_MSC_IN, 13, 0, true);
-
- // Prepare for next command
- dcd_edpt_xfer_ExpectAndReturn(rhport, EDPT_MSC_OUT, NULL, sizeof(msc_cbw_t), true);
- dcd_edpt_xfer_IgnoreArg_buffer();
-
- tud_task();
-}
diff --git a/tinyusb/test/test/device/usbd/test_usbd.c b/tinyusb/test/test/device/usbd/test_usbd.c
deleted file mode 100755
index c90383b5..00000000
--- a/tinyusb/test/test/device/usbd/test_usbd.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019, Ha Thach (tinyusb.org)
- *
- * 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.
- */
-
-#include "unity.h"
-
-// Files to test
-#include "tusb_fifo.h"
-#include "tusb.h"
-#include "usbd.h"
-TEST_FILE("usbd_control.c")
-
-// Mock File
-#include "mock_dcd.h"
-#include "mock_msc_device.h"
-
-//--------------------------------------------------------------------+
-// MACRO TYPEDEF CONSTANT ENUM DECLARATION
-//--------------------------------------------------------------------+
-
-enum
-{
- EDPT_CTRL_OUT = 0x00,
- EDPT_CTRL_IN = 0x80
-};
-
-uint8_t const rhport = 0;
-
-tusb_desc_device_t const data_desc_device =
-{
- .bLength = sizeof(tusb_desc_device_t),
- .bDescriptorType = TUSB_DESC_DEVICE,
- .bcdUSB = 0x0200,
-
- // Use Interface Association Descriptor (IAD) for CDC
- // As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
- .bDeviceClass = TUSB_CLASS_MISC,
- .bDeviceSubClass = MISC_SUBCLASS_COMMON,
- .bDeviceProtocol = MISC_PROTOCOL_IAD,
-
- .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
-
- .idVendor = 0xCafe,
- .idProduct = 0xCafe,
- .bcdDevice = 0x0100,
-
- .iManufacturer = 0x01,
- .iProduct = 0x02,
- .iSerialNumber = 0x03,
-
- .bNumConfigurations = 0x01
-};
-
-uint8_t const data_desc_configuration[] =
-{
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, 0, 0, TUD_CONFIG_DESC_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
-};
-
-tusb_control_request_t const req_get_desc_device =
-{
- .bmRequestType = 0x80,
- .bRequest = TUSB_REQ_GET_DESCRIPTOR,
- .wValue = (TUSB_DESC_DEVICE << 8),
- .wIndex = 0x0000,
- .wLength = 64
-};
-
-tusb_control_request_t const req_get_desc_configuration =
-{
- .bmRequestType = 0x80,
- .bRequest = TUSB_REQ_GET_DESCRIPTOR,
- .wValue = (TUSB_DESC_CONFIGURATION << 8),
- .wIndex = 0x0000,
- .wLength = 256
-};
-
-uint8_t const* desc_device;
-uint8_t const* desc_configuration;
-
-//--------------------------------------------------------------------+
-//
-//--------------------------------------------------------------------+
-uint8_t const * tud_descriptor_device_cb(void)
-{
- return desc_device;
-}
-
-uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
-{
- return desc_configuration;
-}
-
-uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
-{
- (void) langid;
-
- return NULL;
-}
-
-void setUp(void)
-{
- dcd_int_disable_Ignore();
- dcd_int_enable_Ignore();
-
- if ( !tusb_inited() )
- {
- mscd_init_Expect();
- dcd_init_Expect(rhport);
- tusb_init();
- }
-}
-
-void tearDown(void)
-{
-}
-
-//--------------------------------------------------------------------+
-// Get Descriptor
-//--------------------------------------------------------------------+
-
-//------------- Device -------------//
-void test_usbd_get_device_descriptor(void)
-{
- desc_device = (uint8_t const *) &data_desc_device;
- dcd_event_setup_received(rhport, (uint8_t*) &req_get_desc_device, false);
-
- // data
- dcd_edpt_xfer_ExpectWithArrayAndReturn(rhport, 0x80, (uint8_t*)&data_desc_device, sizeof(tusb_desc_device_t), sizeof(tusb_desc_device_t), true);
- dcd_event_xfer_complete(rhport, EDPT_CTRL_IN, sizeof(tusb_desc_device_t), 0, false);
-
- // status
- dcd_edpt_xfer_ExpectAndReturn(rhport, EDPT_CTRL_OUT, NULL, 0, true);
- dcd_event_xfer_complete(rhport, EDPT_CTRL_OUT, 0, 0, false);
- dcd_edpt0_status_complete_ExpectWithArray(rhport, &req_get_desc_device, 1);
-
- tud_task();
-}
-
-void test_usbd_get_device_descriptor_null(void)
-{
- desc_device = NULL;
-
- dcd_event_setup_received(rhport, (uint8_t*) &req_get_desc_device, false);
-
- dcd_edpt_stall_Expect(rhport, EDPT_CTRL_OUT);
- dcd_edpt_stall_Expect(rhport, EDPT_CTRL_IN);
-
- tud_task();
-}
-
-//------------- Configuration -------------//
-
-void test_usbd_get_configuration_descriptor(void)
-{
- desc_configuration = data_desc_configuration;
- uint16_t total_len = ((tusb_desc_configuration_t const*) data_desc_configuration)->wTotalLength;
-
- dcd_event_setup_received(rhport, (uint8_t*) &req_get_desc_configuration, false);
-
- // data
- dcd_edpt_xfer_ExpectWithArrayAndReturn(rhport, 0x80, (uint8_t*) data_desc_configuration, total_len, total_len, true);
- dcd_event_xfer_complete(rhport, EDPT_CTRL_IN, total_len, 0, false);
-
- // status
- dcd_edpt_xfer_ExpectAndReturn(rhport, EDPT_CTRL_OUT, NULL, 0, true);
- dcd_event_xfer_complete(rhport, EDPT_CTRL_OUT, 0, 0, false);
- dcd_edpt0_status_complete_ExpectWithArray(rhport, &req_get_desc_configuration, 1);
-
- tud_task();
-}
-
-void test_usbd_get_configuration_descriptor_null(void)
-{
- desc_configuration = NULL;
- dcd_event_setup_received(rhport, (uint8_t*) &req_get_desc_configuration, false);
-
- dcd_edpt_stall_Expect(rhport, EDPT_CTRL_OUT);
- dcd_edpt_stall_Expect(rhport, EDPT_CTRL_IN);
-
- tud_task();
-}
-
-//--------------------------------------------------------------------+
-// Control ZLP
-//--------------------------------------------------------------------+
-
-void test_usbd_control_in_zlp(void)
-{
- // 128 byte total len, with EP0 size = 64, and request length = 256
- // ZLP must be return
- uint8_t zlp_desc_configuration[CFG_TUD_ENDPOINT0_SIZE*2] =
- {
- // Config number, interface count, string index, total length, attribute, power in mA
- TUD_CONFIG_DESCRIPTOR(1, 0, 0, CFG_TUD_ENDPOINT0_SIZE*2, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
- };
-
- desc_configuration = zlp_desc_configuration;
-
- // request, then 1st, 2nd xact + ZLP + status
- dcd_event_setup_received(rhport, (uint8_t*) &req_get_desc_configuration, false);
-
- // 1st transaction
- dcd_edpt_xfer_ExpectWithArrayAndReturn(rhport, EDPT_CTRL_IN,
- zlp_desc_configuration, CFG_TUD_ENDPOINT0_SIZE, CFG_TUD_ENDPOINT0_SIZE, true);
- dcd_event_xfer_complete(rhport, EDPT_CTRL_IN, CFG_TUD_ENDPOINT0_SIZE, 0, false);
-
- // 2nd transaction
- dcd_edpt_xfer_ExpectWithArrayAndReturn(rhport, EDPT_CTRL_IN,
- zlp_desc_configuration + CFG_TUD_ENDPOINT0_SIZE, CFG_TUD_ENDPOINT0_SIZE, CFG_TUD_ENDPOINT0_SIZE, true);
- dcd_event_xfer_complete(rhport, EDPT_CTRL_IN, CFG_TUD_ENDPOINT0_SIZE, 0, false);
-
- // Expect Zero length Packet
- dcd_edpt_xfer_ExpectAndReturn(rhport, EDPT_CTRL_IN, NULL, 0, true);
- dcd_event_xfer_complete(rhport, EDPT_CTRL_IN, 0, 0, false);
-
- // Status
- dcd_edpt_xfer_ExpectAndReturn(rhport, EDPT_CTRL_OUT, NULL, 0, true);
- dcd_event_xfer_complete(rhport, EDPT_CTRL_OUT, 0, 0, false);
- dcd_edpt0_status_complete_ExpectWithArray(rhport, &req_get_desc_configuration, 1);
-
- tud_task();
-}
diff --git a/tinyusb/test/test/support/tusb_config.h b/tinyusb/test/test/support/tusb_config.h
deleted file mode 100755
index 0455f933..00000000
--- a/tinyusb/test/test/support/tusb_config.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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.
- *
- */
-
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
-
-// testing framework
-#include "unity.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-//--------------------------------------------------------------------
-// COMMON CONFIGURATION
-//--------------------------------------------------------------------
-
-// defined by compiler flags for flexibility
-#ifndef CFG_TUSB_MCU
- //#error CFG_TUSB_MCU must be defined
- #define CFG_TUSB_MCU OPT_MCU_NRF5X
-#endif
-
-#ifndef CFG_TUSB_RHPORT0_MODE
-#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED)
-#endif
-
-#define CFG_TUSB_OS OPT_OS_NONE
-
-// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
-#ifndef CFG_TUSB_DEBUG
-#define CFG_TUSB_DEBUG 0
-#endif
-
-/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
- * Tinyusb use follows macros to declare transferring memory so that they can be put
- * into those specific section.
- * e.g
- * - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
- * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
- */
-#ifndef CFG_TUSB_MEM_SECTION
-#define CFG_TUSB_MEM_SECTION
-#endif
-
-#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
-#endif
-
-//--------------------------------------------------------------------
-// DEVICE CONFIGURATION
-//--------------------------------------------------------------------
-
-#define CFG_TUD_TASK_QUEUE_SZ 100
-#define CFG_TUD_ENDPOINT0_SIZE 64
-
-//------------- CLASS -------------//
-//#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 1
-//#define CFG_TUD_HID 0
-//#define CFG_TUD_MIDI 0
-//#define CFG_TUD_VENDOR 0
-
-//------------- CDC -------------//
-
-// FIFO size of CDC TX and RX
-#define CFG_TUD_CDC_RX_BUFSIZE 512
-#define CFG_TUD_CDC_TX_BUFSIZE 512
-
-//------------- MSC -------------//
-
-// Buffer size of Device Mass storage
-#define CFG_TUD_MSC_BUFSIZE 512
-
-//------------- HID -------------//
-
-// Should be sufficient to hold ID (if any) + Data
-#define CFG_TUD_HID_EP_BUFSIZE 64
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_CONFIG_H_ */
diff --git a/tinyusb/test/test/test_fifo.c b/tinyusb/test/test/test_fifo.c
deleted file mode 100755
index 0a5f4d3b..00000000
--- a/tinyusb/test/test/test_fifo.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2019 Ha Thach (tinyusb.org)
- *
- * 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 file is part of the TinyUSB stack.
- */
-
-#include <string.h>
-#include "unity.h"
-#include "tusb_fifo.h"
-
-#define FIFO_SIZE 10
-TU_FIFO_DEF(tu_ff, FIFO_SIZE, uint8_t, false);
-tu_fifo_t* ff = &tu_ff;
-tu_fifo_buffer_info_t info;
-
-void setUp(void)
-{
- tu_fifo_clear(ff);
- memset(&info, 0, sizeof(tu_fifo_buffer_info_t));
-}
-
-void tearDown(void)
-{
-}
-
-//--------------------------------------------------------------------+
-// Tests
-//--------------------------------------------------------------------+
-void test_normal(void)
-{
- for(uint8_t i=0; i < FIFO_SIZE; i++) tu_fifo_write(ff, &i);
-
- for(uint8_t i=0; i < FIFO_SIZE; i++)
- {
- uint8_t c;
- tu_fifo_read(ff, &c);
- TEST_ASSERT_EQUAL(i, c);
- }
-}
-
-void test_item_size(void)
-{
- TU_FIFO_DEF(ff4, FIFO_SIZE, uint32_t, false);
- tu_fifo_clear(&ff4);
-
- uint32_t data[20];
- for(uint32_t i=0; i<sizeof(data)/4; i++) data[i] = i;
-
- tu_fifo_write_n(&ff4, data, 10);
-
- uint32_t rd[10];
- uint16_t rd_count;
-
- // read 0 -> 4
- rd_count = tu_fifo_read_n(&ff4, rd, 5);
- TEST_ASSERT_EQUAL( 5, rd_count );
- TEST_ASSERT_EQUAL_UINT32_ARRAY( data, rd, rd_count ); // 0 -> 4
-
- tu_fifo_write_n(&ff4, data+10, 5);
-
- // read 5 -> 14
- rd_count = tu_fifo_read_n(&ff4, rd, 10);
- TEST_ASSERT_EQUAL( 10, rd_count );
- TEST_ASSERT_EQUAL_UINT32_ARRAY( data+5, rd, rd_count ); // 5 -> 14
-}
-
-void test_read_n(void)
-{
- // prepare data
- uint8_t data[20];
- for(int i=0; i<sizeof(data); i++) data[i] = i;
-
- for(uint8_t i=0; i < FIFO_SIZE; i++) tu_fifo_write(ff, data+i);
-
- uint8_t rd[10];
- uint16_t rd_count;
-
- // case 1: Read index + count < depth
- // read 0 -> 4
- rd_count = tu_fifo_read_n(ff, rd, 5);
- TEST_ASSERT_EQUAL( 5, rd_count );
- TEST_ASSERT_EQUAL_MEMORY( data, rd, rd_count ); // 0 -> 4
-
- // case 2: Read index + count > depth
- // write 10, 11, 12
- tu_fifo_write(ff, data+10);
- tu_fifo_write(ff, data+11);
- tu_fifo_write(ff, data+12);
-
- rd_count = tu_fifo_read_n(ff, rd, 7);
- TEST_ASSERT_EQUAL( 7, rd_count );
-
- TEST_ASSERT_EQUAL_MEMORY( data+5, rd, rd_count ); // 5 -> 11
-
- // Should only read until empty
- TEST_ASSERT_EQUAL( 1, tu_fifo_read_n(ff, rd, 100) );
-}
-
-void test_write_n(void)
-{
- // prepare data
- uint8_t data[20];
- for(int i=0; i<sizeof(data); i++) data[i] = i;
-
- // case 1: wr + count < depth
- tu_fifo_write_n(ff, data, 8); // wr = 8, count = 8
-
- uint8_t rd[10];
- uint16_t rd_count;
-
- rd_count = tu_fifo_read_n(ff, rd, 5); // wr = 8, count = 3
- TEST_ASSERT_EQUAL( 5, rd_count );
- TEST_ASSERT_EQUAL_MEMORY( data, rd, rd_count ); // 0 -> 4
-
- // case 2: wr + count > depth
- tu_fifo_write_n(ff, data+8, 6); // wr = 3, count = 9
-
- for(rd_count=0; rd_count<7; rd_count++) tu_fifo_read(ff, rd+rd_count); // wr = 3, count = 2
-
- TEST_ASSERT_EQUAL_MEMORY( data+5, rd, rd_count); // 5 -> 11
-
- TEST_ASSERT_EQUAL(2, tu_fifo_count(ff));
-}
-
-void test_peek(void)
-{
- uint8_t temp;
-
- temp = 10; tu_fifo_write(ff, &temp);
- temp = 20; tu_fifo_write(ff, &temp);
- temp = 30; tu_fifo_write(ff, &temp);
-
- temp = 0;
-
- tu_fifo_peek(ff, &temp);
- TEST_ASSERT_EQUAL(10, temp);
-
- tu_fifo_read(ff, &temp);
- tu_fifo_read(ff, &temp);
-
- tu_fifo_peek(ff, &temp);
- TEST_ASSERT_EQUAL(30, temp);
-}
-
-void test_get_read_info_when_no_wrap()
-{
- uint8_t ch = 1;
-
- // write 6 items
- for(uint8_t i=0; i < 6; i++) tu_fifo_write(ff, &ch);
-
- // read 2 items
- tu_fifo_read(ff, &ch);
- tu_fifo_read(ff, &ch);
-
- tu_fifo_get_read_info(ff, &info);
-
- TEST_ASSERT_EQUAL(4, info.len_lin);
- TEST_ASSERT_EQUAL(0, info.len_wrap);
-
- TEST_ASSERT_EQUAL_PTR(ff->buffer+2, info.ptr_lin);
- TEST_ASSERT_NULL(info.ptr_wrap);
-}
-
-void test_get_read_info_when_wrapped()
-{
- uint8_t ch = 1;
-
- // make fifo full
- for(uint8_t i=0; i < FIFO_SIZE; i++) tu_fifo_write(ff, &ch);
-
- // read 6 items
- for(uint8_t i=0; i < 6; i++) tu_fifo_read(ff, &ch);
-
- // write 2 items
- tu_fifo_write(ff, &ch);
- tu_fifo_write(ff, &ch);
-
- tu_fifo_get_read_info(ff, &info);
-
- TEST_ASSERT_EQUAL(FIFO_SIZE-6, info.len_lin);
- TEST_ASSERT_EQUAL(2, info.len_wrap);
-
- TEST_ASSERT_EQUAL_PTR(ff->buffer+6, info.ptr_lin);
- TEST_ASSERT_EQUAL_PTR(ff->buffer, info.ptr_wrap);
-}
-
-void test_get_write_info_when_no_wrap()
-{
- uint8_t ch = 1;
-
- // write 2 items
- tu_fifo_write(ff, &ch);
- tu_fifo_write(ff, &ch);
-
- tu_fifo_get_write_info(ff, &info);
-
- TEST_ASSERT_EQUAL(FIFO_SIZE-2, info.len_lin);
- TEST_ASSERT_EQUAL(0, info.len_wrap);
-
- TEST_ASSERT_EQUAL_PTR(ff->buffer+2, info .ptr_lin);
- // application should check len instead of ptr.
- // TEST_ASSERT_NULL(info.ptr_wrap);
-}
-
-void test_get_write_info_when_wrapped()
-{
- uint8_t ch = 1;
-
- // write 6 items
- for(uint8_t i=0; i < 6; i++) tu_fifo_write(ff, &ch);
-
- // read 2 items
- tu_fifo_read(ff, &ch);
- tu_fifo_read(ff, &ch);
-
- tu_fifo_get_write_info(ff, &info);
-
- TEST_ASSERT_EQUAL(FIFO_SIZE-6, info.len_lin);
- TEST_ASSERT_EQUAL(2, info.len_wrap);
-
- TEST_ASSERT_EQUAL_PTR(ff->buffer+6, info .ptr_lin);
- TEST_ASSERT_EQUAL_PTR(ff->buffer, info.ptr_wrap);
-}
-
-void test_empty(void)
-{
- uint8_t temp;
- TEST_ASSERT_TRUE(tu_fifo_empty(ff));
-
- // read info
- tu_fifo_get_read_info(ff, &info);
-
- TEST_ASSERT_EQUAL(0, info.len_lin);
- TEST_ASSERT_EQUAL(0, info.len_wrap);
-
- TEST_ASSERT_NULL(info.ptr_lin);
- TEST_ASSERT_NULL(info.ptr_wrap);
-
- // write info
- tu_fifo_get_write_info(ff, &info);
-
- TEST_ASSERT_EQUAL(FIFO_SIZE, info.len_lin);
- TEST_ASSERT_EQUAL(0, info.len_wrap);
-
- TEST_ASSERT_EQUAL_PTR(ff->buffer, info .ptr_lin);
- // application should check len instead of ptr.
- // TEST_ASSERT_NULL(info.ptr_wrap);
-
- // write 1 then re-check empty
- tu_fifo_write(ff, &temp);
- TEST_ASSERT_FALSE(tu_fifo_empty(ff));
-}
-
-void test_full(void)
-{
- TEST_ASSERT_FALSE(tu_fifo_full(ff));
-
- for(uint8_t i=0; i < FIFO_SIZE; i++) tu_fifo_write(ff, &i);
-
- TEST_ASSERT_TRUE(tu_fifo_full(ff));
-
- // read info
- tu_fifo_get_read_info(ff, &info);
-
- TEST_ASSERT_EQUAL(FIFO_SIZE, info.len_lin);
- TEST_ASSERT_EQUAL(0, info.len_wrap);
-
- TEST_ASSERT_EQUAL_PTR(ff->buffer, info.ptr_lin);
- // skip this, application must check len instead of buffer
- // TEST_ASSERT_NULL(info.ptr_wrap);
-
- // write info
-}
-
-void test_rd_idx_wrap()
-{
- tu_fifo_t ff10;
- uint8_t buf[10];
- uint8_t dst[10];
-
- tu_fifo_config(&ff10, buf, 10, 1, 1);
-
- uint16_t n;
-
- ff10.wr_idx = 6;
- ff10.rd_idx = 15;
-
- n = tu_fifo_read_n(&ff10, dst, 4);
- TEST_ASSERT_EQUAL(n, 4);
- TEST_ASSERT_EQUAL(ff10.rd_idx, 0);
- n = tu_fifo_read_n(&ff10, dst, 4);
- TEST_ASSERT_EQUAL(n, 4);
- TEST_ASSERT_EQUAL(ff10.rd_idx, 4);
- n = tu_fifo_read_n(&ff10, dst, 4);
- TEST_ASSERT_EQUAL(n, 2);
- TEST_ASSERT_EQUAL(ff10.rd_idx, 6);
-} \ No newline at end of file
diff --git a/tinyusb/test/vendor/ceedling/bin/ceedling b/tinyusb/test/vendor/ceedling/bin/ceedling
deleted file mode 100755
index fa099590..00000000
--- a/tinyusb/test/vendor/ceedling/bin/ceedling
+++ /dev/null
@@ -1,337 +0,0 @@
-#!/usr/bin/env ruby
-
-#these are always used
-require 'rubygems'
-require 'fileutils'
-
-# Check for the main project file (either the one defined in the ENV or the default)
-main_filepath = ENV['CEEDLING_MAIN_PROJECT_FILE']
-project_found = (!main_filepath.nil? && File.exists?(main_filepath))
-if (!project_found)
- main_filepath = "project.yml"
- project_found = File.exists?(main_filepath)
-end
-
-def is_windows?
- return ((RbConfig::CONFIG['host_os'] =~ /mswin|mingw/) ? true : false) if defined?(RbConfig)
- return ((Config::CONFIG['host_os'] =~ /mswin|mingw/) ? true : false)
-end
-
-unless (project_found)
-#===================================== We Do Not Have A Project ================================================
-
- puts "Welcome to Ceedling!"
- require 'thor'
-
- def here
- File.dirname(__FILE__) + "/.."
- end
-
- class CeedlingTasks < Thor
- include Thor::Actions
-
- desc "new PROJECT_NAME", "create a new ceedling project"
- method_option :docs, :type => :boolean, :default => false, :desc => "Add docs in project vendor directory"
- method_option :local, :type => :boolean, :default => false, :desc => "Create a copy of Ceedling in the project vendor directory"
- method_option :gitignore, :type => :boolean, :default => false, :desc => "Create a gitignore file for ignoring ceedling generated files"
- method_option :no_configs, :type => :boolean, :default => false, :desc => "Don't install starter configuration files"
- method_option :noconfigs, :type => :boolean, :default => false
-
- #deprecated:
- method_option :no_docs, :type => :boolean, :default => false
- method_option :nodocs, :type => :boolean, :default => false
- method_option :as_gem, :type => :boolean, :default => false
- method_option :asgem, :type => :boolean, :default => false
- method_option :with_ignore, :type => :boolean, :default => false
- method_option :withignore, :type => :boolean, :default => false
- def new(name, silent = false)
- copy_assets_and_create_structure(name, silent, false, options)
- end
-
- desc "upgrade PROJECT_NAME", "upgrade ceedling for a project (not req'd if gem used)"
- method_option :docs, :type => :boolean, :default => false, :desc => "Add docs in project vendor directory"
- method_option :local, :type => :boolean, :default => false, :desc => "Create a copy of Ceedling in the project vendor directory"
- method_option :no_configs, :type => :boolean, :default => false, :desc => "Don't install starter configuration files"
- method_option :noconfigs, :type => :boolean, :default => false
-
- #deprecated:
- method_option :no_docs, :type => :boolean, :default => false
- method_option :nodocs, :type => :boolean, :default => false
- def upgrade(name, silent = false)
- copy_assets_and_create_structure(name, silent, true, options || {:upgrade => true})
- end
-
- no_commands do
- def copy_assets_and_create_structure(name, silent=false, force=false, options = {})
-
- puts "WARNING: --no_docs deprecated. It is now the default. Specify -docs if you want docs installed." if (options[:no_docs] || options[:nodocs])
- puts "WARNING: --as_gem deprecated. It is now the default. Specify -local if you want ceedling installed to this project." if (options[:as_gem] || options[:asgem])
- puts "WARNING: --with_ignore deprecated. It is now called -gitignore" if (options[:with_ignore] || options[:with_ignore])
-
- use_docs = options[:docs] || false
- use_configs = !(options[:no_configs] || options[:noconfigs] || false)
- use_gem = !(options[:local])
- use_ignore = options[:gitignore] || false
- is_upgrade = options[:upgrade] || false
-
- ceedling_path = File.join(name, 'vendor', 'ceedling')
- source_path = File.join(name, 'src')
- test_path = File.join(name, 'test')
- test_support_path = File.join(name, 'test/support')
-
- # If it's not an upgrade, make sure we have the paths we expect
- if (!is_upgrade)
- [source_path, test_path, test_support_path].each do |d|
- FileUtils.mkdir_p d
- end
- end
-
- # Genarate gitkeep in test support path
- FileUtils.touch(File.join(test_support_path, '.gitkeep'))
-
- # If documentation requested, create a place to dump them and do so
- if use_docs
- doc_path = File.join(ceedling_path, 'docs')
- FileUtils.mkdir_p doc_path
-
- in_doc_path = lambda {|f| File.join(doc_path, f)}
-
- doc_files = [
- 'docs/CeedlingPacket.md',
- 'vendor/c_exception/docs/CException.md',
- 'vendor/cmock/docs/CMock_Summary.md',
- 'vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf',
- 'vendor/unity/docs/UnityAssertionsReference.md',
- 'vendor/unity/docs/UnityConfigurationGuide.md',
- 'vendor/unity/docs/UnityGettingStartedGuide.md',
- 'vendor/unity/docs/UnityHelperScriptsGuide.md',
- 'vendor/unity/docs/ThrowTheSwitchCodingStandard.md',
- ]
-
- doc_files.each do |f|
- copy_file(f, in_doc_path.call(File.basename(f)), :force => force)
- end
- end
-
- # If installed locally to project, copy ceedling, unity, cmock, & supports to vendor
- unless use_gem
- FileUtils.mkdir_p ceedling_path
-
- #copy full folders from ceedling gem into project
- %w{plugins lib bin}.map do |f|
- {:src => f, :dst => File.join(ceedling_path, f)}
- end.each do |f|
- directory(f[:src], f[:dst], :force => force)
- end
-
- # mark ceedling as an executable
- File.chmod(0755, File.join(ceedling_path, 'bin', 'ceedling')) unless is_windows?
-
- #copy necessary subcomponents from ceedling gem into project
- sub_components = [
- {:src => 'vendor/c_exception/lib/', :dst => 'vendor/c_exception/lib'},
- {:src => 'vendor/cmock/config/', :dst => 'vendor/cmock/config'},
- {:src => 'vendor/cmock/lib/', :dst => 'vendor/cmock/lib'},
- {:src => 'vendor/cmock/src/', :dst => 'vendor/cmock/src'},
- {:src => 'vendor/deep_merge/lib/', :dst => 'vendor/deep_merge/lib'},
- {:src => 'vendor/diy/lib', :dst => 'vendor/diy/lib'},
- {:src => 'vendor/unity/auto/', :dst => 'vendor/unity/auto'},
- {:src => 'vendor/unity/src/', :dst => 'vendor/unity/src'},
- ]
-
- sub_components.each do |c|
- directory(c[:src], File.join(ceedling_path, c[:dst]), :force => force)
- end
- end
-
- # We're copying in a configuration file if we haven't said not to
- if (use_configs)
- if use_gem
- copy_file(File.join('assets', 'project_as_gem.yml'), File.join(name, 'project.yml'), :force => force)
- else
- copy_file(File.join('assets', 'project_with_guts.yml'), File.join(name, 'project.yml'), :force => force)
- if is_windows?
- copy_file(File.join('assets', 'ceedling.cmd'), File.join(name, 'ceedling.cmd'), :force => force)
- else
- copy_file(File.join('assets', 'ceedling'), File.join(name, 'ceedling'), :force => force)
- File.chmod(0755, File.join(name, 'ceedling'))
- end
- end
- end
-
- # Copy the gitignore file if requested
- if (use_ignore)
- copy_file(File.join('assets', 'default_gitignore'), File.join(name, '.gitignore'), :force => force)
- end
-
- unless silent
- puts "\n"
- puts "Project '#{name}' #{force ? "upgraded" : "created"}!"
- puts " - Tool documentation is located in vendor/ceedling/docs" if use_docs
- puts " - Execute 'ceedling help' to view available test & build tasks"
- puts ''
- end
- end
- end
-
- desc "examples", "list available example projects"
- def examples()
- puts "Available sample projects:"
- FileUtils.cd(File.join(here, "examples")) do
- Dir["*"].each {|proj| puts " #{proj}"}
- end
- end
-
- desc "example PROJ_NAME [DEST]", "new specified example project (in DEST, if specified)"
- def example(proj_name, dest=nil)
- if dest.nil? then dest = proj_name end
-
- copy_assets_and_create_structure(dest, true, false, {:local=>true, :docs=>true})
-
- dest_src = File.join(dest,'src')
- dest_test = File.join(dest,'test')
- dest_project = File.join(dest,'project.yml')
-
- directory "examples/#{proj_name}/src", dest_src
- directory "examples/#{proj_name}/test", dest_test
- remove_file dest_project
- copy_file "examples/#{proj_name}/project.yml", dest_project
-
- puts "\n"
- puts "Example project '#{proj_name}' created!"
- puts " - Tool documentation is located in vendor/ceedling/docs"
- puts " - Execute 'ceedling help' to view available test & build tasks"
- puts ''
- end
-
- desc "version", "return the version of the tools installed"
- def version()
- require 'ceedling/version.rb'
- puts " Ceedling:: #{Ceedling::Version::CEEDLING}"
- puts " CMock:: #{Ceedling::Version::CMOCK}"
- puts " Unity:: #{Ceedling::Version::UNITY}"
- puts " CException:: #{Ceedling::Version::CEXCEPTION}"
- end
- end
-
- if (ARGV[0] =~ /^\-T$/)
- puts "\n(No Project Detected, Therefore Showing Options to Create Projects)"
- CeedlingTasks.tasks.each_pair do |k,v|
- puts v.usage.ljust(25,' ') + v.description
- end
- puts "\n"
- else
- CeedlingTasks.source_root here
- CeedlingTasks.start
- end
-
-#===================================== We Have A Project Already ================================================
-else
- require 'yaml'
- require 'rbconfig'
-
- #determine platform
- platform = begin
- case(RbConfig::CONFIG['host_os'])
- when /mswin|mingw|cygwin/i
- :mswin
- when /darwin/
- :osx
- else
- :linux
- end
- rescue
- :linux
- end
-
- #create our default meta-runner option set
- options = {
- :pretest => nil,
- :args => [],
- :add_path => [],
- :path_connector => (platform == :mswin) ? ";" : ":",
- :graceful_fail => false,
- :which_ceedling => (Dir.exists?("vendor/ceedling") ? "vendor/ceedling" : 'gem'),
- :default_tasks => [ 'test:all' ],
- :list_tasks => false
- }
-
- #guess that we need a special script file first if it exists
- if (platform == :mswin)
- options[:pretest] = File.exists?("#{ platform.to_s }_setup.bat") ? "#{ platform.to_s }_setup.bat" : nil
- else
- options[:pretest] = File.exists?("#{ platform.to_s }_setup.sh") ? "source #{ platform.to_s }_setup.sh" : nil
- end
-
- #merge in project settings if they can be found here
- yaml_options = YAML.load_file(main_filepath)
- if (yaml_options[:paths])
- options[:add_path] = yaml_options[:paths][:tools] || []
- else
- options[:add_path] = []
- end
- options[:graceful_fail] = yaml_options[:graceful_fail] if yaml_options[:graceful_fail]
- options[:which_ceedling] = yaml_options[:project][:which_ceedling] if (yaml_options[:project] && yaml_options[:project][:which_ceedling])
- options[:default_tasks] = yaml_options[:default_tasks] if yaml_options[:default_tasks]
-
- #sort through command line options
- ARGV.each do |v|
- case(v)
- when /^(?:new|examples?|templates?)$/
- puts "\nOops. You called ceedling with argument '#{v}'.\n" +
- " This is an operation that will create a new project... \n" +
- " but it looks like you're already in a project. If you really \n" +
- " want to do this, try moving to an empty folder.\n\n"
- abort
- when /^help$/
- options[:list_tasks] = true
- when /^-T$/
- options[:list_tasks] = true
- when /^project:(\w+)/
- ENV['CEEDLING_USER_PROJECT_FILE'] = "#{$1}.yml"
- else
- options[:args].push(v)
- end
- end
-
- #add to the path
- if (options[:add_path] && !options[:add_path].empty?)
- path = ENV["PATH"]
- options[:add_path].each do |p|
- f = File.expand_path(File.dirname(__FILE__),p)
- path = (f + options[:path_connector] + path) unless path.include? f
- end
- ENV["PATH"] = path
- end
-
- # Load Ceedling (either through the rakefile OR directly)
- if (File.exists?("rakefile.rb"))
- load 'rakefile.rb'
- else
- if (options[:which_ceedling] == 'gem')
- require 'ceedling'
- else
- load "#{options[:which_ceedling]}/lib/ceedling.rb"
- end
- Ceedling.load_project
- end
-
- Rake.application.standard_exception_handling do
- if options[:list_tasks]
- # Display helpful task list when requested. This required us to dig into Rake internals a bit
- Rake.application.define_singleton_method(:name=) {|n| @name = n}
- Rake.application.name = 'ceedling'
- Rake.application.options.show_tasks = :tasks
- Rake.application.options.show_task_pattern = /^(?!.*build).*$/
- Rake.application.display_tasks_and_comments()
- else
- task :default => options[:default_tasks]
-
- # Run our Tasks!
- Rake.application.collect_command_line_tasks(options[:args])
- Rake.application.top_level
- end
- end
- true
-#===================================================================================================================
-end
diff --git a/tinyusb/test/vendor/ceedling/docs/CException.md b/tinyusb/test/vendor/ceedling/docs/CException.md
deleted file mode 100755
index c3718191..00000000
--- a/tinyusb/test/vendor/ceedling/docs/CException.md
+++ /dev/null
@@ -1,292 +0,0 @@
-
-CException
-==========
-
-CException is a basic exception framework for C, suitable for use in
-embedded applications. It provides an exception framework similar in
-use to C++, but with much less overhead.
-
-
-CException uses C standard library functions `setjmp` and `longjmp` to
-operate. As long as the target system has these two functions defined,
-this library should be useable with very little configuration. It
-even supports environments where multiple program flows are in use,
-such as real-time operating systems.
-
-
-There are about a gabillion exception frameworks using a similar
-setjmp/longjmp method out there... and there will probably be more
-in the future. Unfortunately, when we started our last embedded
-project, all those that existed either (a) did not support multiple
-tasks (therefore multiple stacks) or (b) were way more complex than
-we really wanted. CException was born.
-
-
-*Why use CException?*
-
-
-0. It's ANSI C, and it beats passing error codes around.
-1. You want something simple... CException throws a single id. You can
- define those ID's to be whatever you like. You might even choose which
- type that number is for your project. But that's as far as it goes.
- We weren't interested in passing objects or structs or strings...
- just simple error codes.
-2. Performance... CException can be configured for single tasking or
- multitasking. In single tasking, there is very little overhead past
- the setjmp/longjmp calls (which are already fast). In multitasking,
- your only additional overhead is the time it takes you to determine
- a unique task id 0 - num_tasks.
-
-
-For the latest version, go to [ThrowTheSwitch.org](http://throwtheswitch.org)
-
-
-CONTENTS OF THIS DOCUMENT
-=========================
-
-* Usage
-* Limitations
-*API
-* Configuration
-* Testing
-* License
-
-
-Usage
------
-
-Code that is to be protected are wrapped in `Try { } Catch { }` blocks.
-The code directly following the Try call is "protected", meaning that
-if any Throws occur, program control is directly transferred to the
-start of the Catch block.
-
-
-A numerical exception ID is included with Throw, and is made accessible
-from the Catch block.
-
-
-Throws can occur from within function calls (nested as deeply as you
-like) or directly from within the function itself.
-
-
-
-Limitations
------------
-
-
-This library was made to be as fast as possible, and provide basic
-exception handling. It is not a full-blown exception library. Because
-of this, there are a few limitations that should be observed in order
-to successfully utilize this library:
-
-1. Do not directly "return" from within a `Try` block, nor `goto`
- into or out of a `Try` block.
-
- *Why?*
-
- The `Try` macro allocates some local memory and alters a global
- pointer. These are cleaned up at the top of the `Catch` macro.
- Gotos and returns would bypass some of these steps, resulting in
- memory leaks or unpredictable behavior.
-
-
-2. If (a) you change local (stack) variables within your `Try` block,
- AND (b) wish to make use of the updated values after an exception
- is thrown, those variables should be made `volatile`. Note that this
- is ONLY for locals and ONLY when you need access to them after a
- `Throw`.
-
- *Why?*
-
- Compilers optimize. There is no way to guarantee that the actual
- memory location was updated and not just a register unless the
- variable is marked volatile.
-
-
-3. Memory which is `malloc`'d or `new`'d is not automatically released
- when an error is thrown. This will sometimes be desirable, and
- othertimes may not. It will be the responsibility of the `Catch`
- block to perform this kind of cleanup.
-
- *Why?*
-
- There's just no easy way to track `malloc`'d memory, etc., without
- replacing or wrapping malloc calls or something like that. This
- is a light framework, so these options were not desirable.
-
-
-
-API
----
-
-###Try
-
-`Try` is a macro which starts a protected block. It MUST be followed by
-a pair of braces or a single protected line (similar to an 'if'),
-enclosing the data that is to be protected. It **must** be followed by a
-`Catch` block (don't worry, you'll get compiler errors to let you know if
-you mess any of that up).
-
-
-###Catch(e)
-
-`Catch` is a macro which ends the `Try` block and starts the error handling
-block. The `Catch` block is called if and only if an exception was thrown
-while within the `Try` block. This error was thrown by a `Throw` call
-somewhere within `Try` (or within a function called within `Try`, or a function
-called by a function called within `Try`, etc).
-
-The single parameter `e` is filled with the error code which was thrown.
-This can be used for reporting, conditional cleanup, etc. (or you can just
-ignore it if you really want... people ignore return codes all the time,
-right?). `e` should be of type `EXCEPTION_T`
-
-
-###Throw(e)
-
-This is the method of throwing an error. A `Throw` should only occur from within a
-protected (`Try` ... `Catch`) block, though it may easily be nested many function
-calls deep without an impact on performance or functionality. `Throw` takes
-a single argument, which is an exception id which will be passed to `Catch`
-as the reason for the error.
-
-If you wish to rethrow an error, this can be done by calling `Throw(e)` with
-the error code you just caught. It **is** valid to throw from a catch block.
-
-
-###ExitTry()
-
-On rare occasion, you might want to immediately exit your current `Try` block
-but **not** treat this as an error. Don't run the `Catch`. Just start executing
-from after the `Catch` as if nothing had happened... That's what `ExitTry` is
-for.
-
-
-CONFIGURATION
--------------
-
-CException is a mostly portable library. It has one universal
-dependency, and some macros which are required if working in a
-multi-tasking environment.
-
-1. The standard C library setjmp must be available. Since this is part
- of the standard library, chances are good that you'll be fine.
-
-2. If working in a multitasking environment, methods for obtaining an
- index into an array of frames and to get the overall number of
- id's are required. If the OS supports a method to retrieve Task
- ID's, and those Tasks are number 0, 1, 2... you are in an ideal
- situation. Otherwise, a more creative mapping function may be
- required. Note that this function is likely to be called twice
- for each protected block and once during a throw. This is the
- only overhead in the system.
-
-
-Exception.h
------------
-
-By convention, most projects include `Exception.h` which defines any
-further requirements, then calls `CException.h` to do the gruntwork. All
-of these are optional. You could directly include `CException.h` if
-you wanted and just use the defaults provided.
-
-* `EXCEPTION_T`
- * Set this to the type you want your exception id's to be. Defaults to 'unsigned int'.
-
-* `EXCEPTION_NONE`
- * Set this to a number which will never be an exception id in your system. Defaults to `0x5a5a5a5a`.
-
-* `EXCEPTION_GET_ID`
- * If in a multi-tasking environment, this should be
- set to be a call to the function described in #2 above.
- Defaults to just return `0` all the time (good for
- single tasking environments)
-
-* `EXCEPTION_NUM_ID`
- * If in a multi-tasking environment, this should be set
- to the number of ID's required (usually the number of
- tasks in the system). Defaults to `1` (for single
- tasking environments).
-
-* `CEXCEPTION_NO_CATCH_HANDLER(id)`
- * This macro can be optionally specified.
- It allows you to specify code to be called when a Throw
- is made outside of `Try` ... `Catch` protection. Consider
- this the emergency fallback plan for when something has
- gone terribly wrong.
-
-
-You may also want to include any header files which will commonly be
-needed by the rest of your application where it uses exception handling
-here. For example, OS header files or exception codes would be useful.
-
-
-Finally, there are some hook macros which you can implement to inject
-your own target-specific code in particular places. It is a rare instance
-where you will need these, but they are here if you need them:
-
-
-* `CEXCEPTION_HOOK_START_TRY`
- * called immediately before the Try block
-
-* `CEXCEPTION_HOOK_HAPPY_TRY`
- * called immediately after the Try block if no exception was thrown
-
-* `CEXCEPTION_HOOK_AFTER_TRY`
- * called immediately after the Try block OR before an exception is caught
-
-* `CEXCEPTION_HOOK_START_CATCH`
- * called immediately before the catch
-
-
-
-TESTING
--------
-
-
-If you want to validate that CException works with your tools or that
-it works with your custom configuration, you may want to run the test
-suite.
-
-
-The test suite included makes use of the `Unity` Test Framework. It will
-require a native C compiler. The example makefile uses MinGW's gcc.
-Modify the makefile to include the proper paths to tools, then run `make`
-to compile and run the test application.
-
-* `C_COMPILER`
- * The C compiler to use to perform the tests
-
-* `C_LIBS`
- * The path to the C libraries (including setjmp)
-
-* `UNITY_DIR`
- * The path to the Unity framework (required to run tests)
- (get it at [ThrowTheSwitch.org](http://throwtheswitch.org))
-
-
-
-LICENSE
--------
-
-This software is licensed under the MIT License
-
-Copyright (c) 2007-2017 Mark VanderVoord
-
-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.
diff --git a/tinyusb/test/vendor/ceedling/docs/CMock_Summary.md b/tinyusb/test/vendor/ceedling/docs/CMock_Summary.md
deleted file mode 100755
index 87f9c00b..00000000
--- a/tinyusb/test/vendor/ceedling/docs/CMock_Summary.md
+++ /dev/null
@@ -1,603 +0,0 @@
-CMock: A Summary
-================
-
-*[ThrowTheSwitch.org](http://throwtheswitch.org)*
-
-*This documentation is released under a Creative Commons 3.0 Attribution Share-Alike License*
-
-
-What Exactly Are We Talking About Here?
----------------------------------------
-
-CMock is a nice little tool which takes your header files and creates
-a Mock interface for it so that you can more easily unit test modules
-that touch other modules. For each function prototype in your
-header, like this one:
-
- int DoesSomething(int a, int b);
-
-
-...you get an automatically generated DoesSomething function
-that you can link to instead of your real DoesSomething function.
-By using this Mocked version, you can then verify that it receives
-the data you want, and make it return whatever data you desire,
-make it throw errors when you want, and more... Create these for
-everything your latest real module touches, and you're suddenly
-in a position of power: You can control and verify every detail
-of your latest creation.
-
-To make that easier, CMock also gives you a bunch of functions
-like the ones below, so you can tell that generated DoesSomething
-function how to behave for each test:
-
- void DoesSomething_ExpectAndReturn(int a, int b, int toReturn);
- void DoesSomething_ExpectAndThrow(int a, int b, EXCEPTION_T error);
- void DoesSomething_StubWithCallback(CMOCK_DoesSomething_CALLBACK YourCallback);
- void DoesSomething_IgnoreAndReturn(int toReturn);
-
-
-You can pile a bunch of these back to back, and it remembers what
-you wanted to pass when, like so:
-
- test_CallsDoesSomething_ShouldDoJustThat(void)
- {
- DoesSomething_ExpectAndReturn(1,2,3);
- DoesSomething_ExpectAndReturn(4,5,6);
- DoesSomething_ExpectAndThrow(7,8, STATUS_ERROR_OOPS);
-
- CallsDoesSomething( );
- }
-
-
-This test will call CallsDoesSomething, which is the function
-we are testing. We are expecting that function to call DoesSomething
-three times. The first time, we check to make sure it's called
-as DoesSomething(1, 2) and we'll magically return a 3. The second
-time we check for DoesSomething(4, 5) and we'll return a 6. The
-third time we verify DoesSomething(7, 8) and we'll throw an error
-instead of returning anything. If CallsDoesSomething gets
-any of this wrong, it fails the test. It will fail if you didn't
-call DoesSomething enough, or too much, or with the wrong arguments,
-or in the wrong order.
-
-CMock is based on Unity, which it uses for all internal testing.
-It uses Ruby to do all the main work (versions 2.0.0 and above).
-
-
-Installing
-==========
-
-The first thing you need to do to install CMock is to get yourself
-a copy of Ruby. If you're on linux or osx, you probably already
-have it. You can prove it by typing the following:
-
- ruby --version
-
-
-If it replied in a way that implies ignorance, then you're going to
-need to install it. You can go to [ruby-lang](https://ruby-lang.org)
-to get the latest version. You're also going to need to do that if it
-replied with a version that is older than 2.0.0. Go ahead. We'll wait.
-
-Once you have Ruby, you have three options:
-
-* Clone the latest [CMock repo on github](https://github.com/ThrowTheSwitch/CMock/)
-* Download the latest [CMock zip from github](https://github.com/ThrowTheSwitch/CMock/)
-* Install Ceedling (which has it built in!) through your commandline using `gem install ceedling`.
-
-
-Generated Mock Module Summary
-=============================
-
-In addition to the mocks themselves, CMock will generate the
-following functions for use in your tests. The expect functions
-are always generated. The other functions are only generated
-if those plugins are enabled:
-
-
-Expect:
--------
-
-Your basic staple Expects which will be used for most of your day
-to day CMock work. By calling this, you are telling CMock that you
-expect that function to be called during your test. It also specifies
-which arguments you expect it to be called with, and what return
-value you want returned when that happens. You can call this function
-multiple times back to back in order to queue up multiple calls.
-
-* `void func(void)` => `void func_Expect(void)`
-* `void func(params)` => `void func_Expect(expected_params)`
-* `retval func(void)` => `void func_ExpectAndReturn(retval_to_return)`
-* `retval func(params)` => `void func_ExpectAndReturn(expected_params, retval_to_return)`
-
-
-ExpectAnyArgs:
---------------
-
-This behaves just like the Expects calls, except that it doesn't really
-care what the arguments are that the mock gets called with. It still counts
-the number of times the mock is called and it still handles return values
-if there are some.
-
-* `void func(void)` => `void func_ExpectAnyArgs(void)`
-* `void func(params)` => `void func_ExpectAnyArgs(void)`
-* `retval func(void)` => `void func_ExpectAnyArgsAndReturn(retval_to_return)`
-* `retval func(params)` => `void func_ExpectAnyArgsAndReturn(retval_to_return)`
-
-
-Array:
-------
-
-An ExpectWithArray is another variant of Expect. Like expect, it cares about
-the number of times a mock is called, the arguments it is called with, and the
-values it is to return. This variant has another feature, though. For anything
-that resembles a pointer or array, it breaks the argument into TWO arguments.
-The first is the original pointer. The second specify the number of elements
-it is to verify of that array. If you specify 1, it'll check one object. If 2,
-it'll assume your pointer is pointing at the first of two elements in an array.
-If you specify zero elements, it will check just the pointer if
-`:smart` mode is configured or fail if `:compare_data` is set.
-
-* `void func(void)` => (nothing. In fact, an additional function is only generated if the params list contains pointers)
-* `void func(ptr * param, other)` => `void func_ExpectWithArray(ptr* param, int param_depth, other)`
-* `retval func(void)` => (nothing. In fact, an additional function is only generated if the params list contains pointers)
-* `retval func(other, ptr* param)` => `void func_ExpectWithArrayAndReturn(other, ptr* param, int param_depth, retval_to_return)`
-
-
-Ignore:
--------
-
-Maybe you don't care about the number of times a particular function is called or
-the actual arguments it is called with. In that case, you want to use Ignore. Ignore
-only needs to be called once per test. It will then ignore any further calls to that
-particular mock. The IgnoreAndReturn works similarly, except that it has the added
-benefit of knowing what to return when that call happens. If the mock is called more
-times than IgnoreAndReturn was called, it will keep returning the last value without
-complaint. If it's called less times, it will also ignore that. You SAID you didn't
-care how many times it was called, right?
-
-* `void func(void)` => `void func_Ignore(void)`
-* `void func(params)` => `void func_Ignore(void)`
-* `retval func(void)` => `void func_IgnoreAndReturn(retval_to_return)`
-* `retval func(params)` => `void func_IgnoreAndReturn(retval_to_return)`
-
-
-Ignore Arg:
-------------
-
-Maybe you overall want to use Expect and its similar variations, but you don't care
-what is passed to a particular argument. This is particularly useful when that argument
-is a pointer to a value that is supposed to be filled in by the function. You don't want
-to use ExpectAnyArgs, because you still care about the other arguments. Instead, before
-any of your Expect calls are made, you can call this function. It tells CMock to ignore
-a particular argument for the rest of this test, for this mock function.
-
-* `void func(params)` => `void func_IgnoreArg_paramName(void)`
-
-
-ReturnThruPtr:
---------------
-
-Another option which operates on a particular argument of a function is the ReturnThruPtr
-plugin. For every argument that resembles a pointer or reference, CMock generates an
-instance of this function. Just as the AndReturn functions support injecting one or more
-return values into a queue, this function lets you specify one or more return values which
-are queued up and copied into the space being pointed at each time the mock is called.
-
-* `void func(param1)` => `void func_ReturnThruPtr_paramName(val_to_return)`
-* => `void func_ReturnArrayThruPtr_paramName(cal_to_return, len)`
-* => `void func_ReturnMemThruPtr_paramName(val_to_return, size)`
-
-
-Callback:
----------
-
-If all those other options don't work, and you really need to do something custom, you
-still have a choice. As soon as you stub a callback in a test, it will call the callback
-whenever the mock is encountered and return the retval returned from the callback (if any)
-instead of performing the usual expect checks. It can be configured to check the arguments
-first (like expects) or just jump directly to the callback.
-
-* `void func(void)` => `void func_StubWithCallback(CMOCK_func_CALLBACK callback)`
-where `CMOCK_func_CALLBACK` looks like: `void func(int NumCalls)`
-* `void func(params)` => `void func_StubWithCallback(CMOCK_func_CALLBACK callback)`
-where `CMOCK_func_CALLBACK` looks like: `void func(params, int NumCalls)`
-* `retval func(void)` => `void func_StubWithCallback(CMOCK_func_CALLBACK callback)`
-where `CMOCK_func_CALLBACK` looks like: `retval func(int NumCalls)`
-* `retval func(params)` => `void func_StubWithCallback(CMOCK_func_CALLBACK callback)`
-where `CMOCK_func_CALLBACK` looks like: `retval func(params, int NumCalls)`
-
-
-Cexception:
------------
-
-Finally, if you are using Cexception for error handling, you can use this to throw errors
-from inside mocks. Like Expects, it remembers which call was supposed to throw the error,
-and it still checks parameters first.
-
-* `void func(void)` => `void func_ExpectAndThrow(value_to_throw)`
-* `void func(params)` => `void func_ExpectAndThrow(expected_params, value_to_throw)`
-* `retval func(void)` => `void func_ExpectAndThrow(value_to_throw)`
-* `retval func(params)` => `void func_ExpectAndThrow(expected_params, value_to_throw)`
-
-
-
-Running CMock
-=============
-
-CMock is a Ruby script and class. You can therefore use it directly
-from the command line, or include it in your own scripts or rakefiles.
-
-
-Mocking from the Command Line
------------------------------
-
-After unpacking CMock, you will find cmock.rb in the 'lib' directory.
-This is the file that you want to run. It takes a list of header files
-to be mocked, as well as an optional yaml file for a more detailed
-configuration (see config options below).
-
-For example, this will create three mocks using the configuration
-specified in MyConfig.yml:
-
- ruby cmock.rb -oMyConfig.yml super.h duper.h awesome.h
-
-And this will create two mocks using the default configuration:
-
- ruby cmock.rb ../mocking/stuff/is/fun.h ../try/it/yourself.h
-
-
-Mocking From Scripts or Rake
-----------------------------
-
-CMock can be used directly from your own scripts or from a rakefile.
-Start by including cmock.rb, then create an instance of CMock.
-When you create your instance, you may initialize it in one of
-three ways.
-
-You may specify nothing, allowing it to run with default settings:
-
- require 'cmock.rb'
- cmock = CMock.new
-
-You may specify a YAML file containing the configuration options
-you desire:
-
- cmock = CMock.new('../MyConfig.yml')
-
-You may specify the options explicitly:
-
- cmock = Cmock.new(:plugins => [:cexception, :ignore], :mock_path => 'my/mocks/')
-
-
-Config Options:
----------------
-
-The following configuration options can be specified in the
-yaml file or directly when instantiating.
-
-Passed as Ruby, they look like this:
-
- { :attributes => [“__funky”, “__intrinsic”], :when_ptr => :compare }
-
-Defined in the yaml file, they look more like this:
-
- :cmock:
- :attributes:
- - __funky
- - __intrinsic
- :when_ptr: :compare
-
-In all cases, you can just include the things that you want to override
-from the defaults. We've tried to specify what the defaults are below.
-
-* `:attributes`:
- These are attributes that CMock should ignore for you for testing
- purposes. Custom compiler extensions and externs are handy things to
- put here. If your compiler is choking on some extended syntax, this
- is often a good place to look.
-
- * defaults: ['__ramfunc', '__irq', '__fiq', 'register', 'extern']
- * **note:** this option will reinsert these attributes onto the mock's calls.
- If that isn't what you are looking for, check out :strippables.
-
-* `:c_calling_conventions`:
- Similarly, CMock may need to understand which C calling conventions
- might show up in your codebase. If it encounters something it doesn't
- recognize, it's not going to mock it. We have the most common covered,
- but there are many compilers out there, and therefore many other options.
-
- * defaults: ['__stdcall', '__cdecl', '__fastcall']
- * **note:** this option will reinsert these attributes onto the mock's calls.
- If that isn't what you are looking for, check out :strippables.
-
-* `:callback_after_arg_check`:
- Tell `:callback` plugin to do the normal argument checking **before** it
- calls the callback function by setting this to true. When false, the
- callback function is called **instead** of the argument verification.
-
- * default: false
-
-* `:callback_include_count`:
- Tell `:callback` plugin to include an extra parameter to specify the
- number of times the callback has been called. If set to false, the
- callback has the same interface as the mocked function. This can be
- handy when you're wanting to use callback as a stub.
-
- * default: true
-
-* `:cexception_include`:
- Tell `:cexception` plugin where to find CException.h... You only need to
- define this if it's not in your build path already... which it usually
- will be for the purpose of your builds.
-
- * default: *nil*
-
-* `:enforce_strict_ordering`:
- CMock always enforces the order that you call a particular function,
- so if you expect GrabNabber(int size) to be called three times, it
- will verify that the sizes are in the order you specified. You might
- *also* want to make sure that all different functions are called in a
- particular order. If so, set this to true.
-
- * default: false
-
-* `:framework`:
- Currently the only option is `:unity.` Eventually if we support other
- unity test frameworks (or if you write one for us), they'll get added
- here.
-
- : default: :unity
-
-* `:includes`:
- An array of additional include files which should be added to the
- mocks. Useful for global types and definitions used in your project.
- There are more specific versions if you care WHERE in the mock files
- the includes get placed. You can define any or all of these options.
-
- * `:includes`
- * `:includes_h_pre_orig_header`
- * `:includes_h_post_orig_header`
- * `:includes_c_pre_header`
- * `:includes_c_post_header`
- * default: nil #for all 5 options
-
-* `:memcmp_if_unknown`:
- C developers create a lot of types, either through typedef or preprocessor
- macros. CMock isn't going to automatically know what you were thinking all
- the time (though it tries its best). If it comes across a type it doesn't
- recognize, you have a choice on how you want it to handle it. It can either
- perform a raw memory comparison and report any differences, or it can fail
- with a meaningful message. Either way, this feature will only happen after
- all other mechanisms have failed (The thing encountered isn't a standard
- type. It isn't in the :treat_as list. It isn't in a custom unity_helper).
-
- * default: true
-
-* `:mock_path`:
- The directory where you would like the mock files generated to be
- placed.
-
- * default: mocks
-
-* `:mock_prefix`:
- The prefix to prepend to your mock files. For example, if it's “Mock”, a file
- “USART.h” will get a mock called “MockUSART.c”. This CAN be used with a suffix
- at the same time.
-
- * default: Mock
-
-* `:mock_suffix`:
- The suffix to append to your mock files. For example, it it's "_Mock", a file
- "USART.h" will get a mock called "USART_Mock.h". This CAN be used with a prefix
- at the same time.
-
- * default: ""
-
-* `:plugins`:
- An array of which plugins to enable. ':expect' is always active. Also
- available currently:
-
- * `:ignore`
- * `:ignore_arg`
- * `:expect_any_args`
- * `:array`
- * `:cexception`
- * `:callback`
- * `:return_thru_ptr`
-
-* `:strippables`:
- An array containing a list of items to remove from the header
- before deciding what should be mocked. This can be something simple
- like a compiler extension CMock wouldn't recognize, or could be a
- regex to reject certain function name patterns. This is a great way to
- get rid of compiler extensions when your test compiler doesn't support
- them. For example, use `:strippables: ['(?:functionName\s*\(+.*?\)+)']`
- to prevent a function `functionName` from being mocked. By default, it
- is ignoring all gcc attribute extensions.
-
- * default: ['(?:__attribute__\s*\(+.*?\)+)']
-
-* `:subdir`:
- This is a relative subdirectory for your mocks. Set this to e.g. "sys" in
- order to create a mock for `sys/types.h` in `(:mock_path)/sys/`.
-
- * default: ""
-
-* `:treat_as`:
- The `:treat_as` list is a shortcut for when you have created typedefs
- of standard types. Why create a custom unity helper for UINT16 when
- the unity function TEST_ASSERT_EQUAL_HEX16 will work just perfectly?
- Just add 'UINT16' => 'HEX16' to your list (actually, don't. We already
- did that one for you). Maybe you have a type that is a pointer to an
- array of unsigned characters? No problem, just add 'UINT8_T*' =>
- 'HEX8*'
-
- * NOTE: unlike the other options, your specifications MERGE with the
- default list. Therefore, if you want to override something, you must
- reassign it to something else (or to *nil* if you don't want it)
-
- * default:
- * 'int': 'INT'
- * 'char': 'INT8'
- * 'short': 'INT16'
- * 'long': 'INT'
- * 'int8': 'INT8'
- * 'int16': 'INT16'
- * 'int32': 'INT'
- * 'int8_t': 'INT8'
- * 'int16_t': 'INT16'
- * 'int32_t': 'INT'
- * 'INT8_T': 'INT8'
- * 'INT16_T': 'INT16'
- * 'INT32_T': 'INT'
- * 'bool': 'INT'
- * 'bool_t': 'INT'
- * 'BOOL': 'INT'
- * 'BOOL_T': 'INT'
- * 'unsigned int': 'HEX32'
- * 'unsigned long': 'HEX32'
- * 'uint32': 'HEX32'
- * 'uint32_t': 'HEX32'
- * 'UINT32': 'HEX32'
- * 'UINT32_T': 'HEX32'
- * 'void*': 'HEX8_ARRAY'
- * 'unsigned short': 'HEX16'
- * 'uint16': 'HEX16'
- * 'uint16_t': 'HEX16'
- * 'UINT16': 'HEX16'
- * 'UINT16_T': 'HEX16'
- * 'unsigned char': 'HEX8'
- * 'uint8': 'HEX8'
- * 'uint8_t': 'HEX8'
- * 'UINT8': 'HEX8'
- * 'UINT8_T': 'HEX8'
- * 'char*': 'STRING'
- * 'pCHAR': 'STRING'
- * 'cstring': 'STRING'
- * 'CSTRING': 'STRING'
- * 'float': 'FLOAT'
- * 'double': 'FLOAT'
-
-* `:treat_as_void`:
- We've seen "fun" legacy systems typedef 'void' with a custom type,
- like MY_VOID. Add any instances of those to this list to help CMock
- understand how to deal with your code.
-
- * default: []
-
-* `:treat_externs`:
- This specifies how you want CMock to handle functions that have been
- marked as extern in the header file. Should it mock them?
-
- * `:include` will mock externed functions
- * `:exclude` will ignore externed functions (default).
-
-* `:unity_helper_path`:
- If you have created a header with your own extensions to unity to
- handle your own types, you can set this argument to that path. CMock
- will then automagically pull in your helpers and use them. The only
- trick is that you make sure you follow the naming convention:
- `UNITY_TEST_ASSERT_EQUAL_YourType`. If it finds macros of the right
- shape that match that pattern, it'll use them.
-
- * default: []
-
-* `:verbosity`:
- How loud should CMock be?
-
- * 0 for errors only
- * 1 for errors and warnings
- * 2 for normal (default)
- * 3 for verbose
-
-* `:weak`:
- When set this to some value, the generated mocks are defined as weak
- symbols using the configured format. This allows them to be overridden
- in particular tests.
-
- * Set to '__attribute ((weak))' for weak mocks when using GCC.
- * Set to any non-empty string for weak mocks when using IAR.
- * default: ""
-
-* `:when_no_prototypes`:
- When you give CMock a header file and ask it to create a mock out of
- it, it usually contains function prototypes (otherwise what was the
- point?). You can control what happens when this isn't true. You can
- set this to `:warn,` `:ignore,` or `:error`
-
- * default: :warn
-
-* `:when_ptr`:
- You can customize how CMock deals with pointers (c strings result in
- string comparisons... we're talking about **other** pointers here). Your
- options are `:compare_ptr` to just verify the pointers are the same,
- `:compare_data` or `:smart` to verify that the data is the same.
- `:compare_data` and `:smart` behaviors will change slightly based on
- if you have the array plugin enabled. By default, they compare a
- single element of what is being pointed to. So if you have a pointer
- to a struct called ORGAN_T, it will compare one ORGAN_T (whatever that
- is).
-
- * default: :smart
-
-* `:fail_on_unexpected_calls`:
- By default, CMock will fail a test if a mock is called without _Expect and _Ignore
- called first. While this forces test writers to be more explicit in their expectations,
- it can clutter tests with _Expect or _Ignore calls for functions which are not the focus
- of the test. While this is a good indicator that this module should be refactored, some
- users are not fans of the additional noise.
-
- Therefore, :fail_on_unexpected_calls can be set to false to force all mocks to start with
- the assumption that they are operating as _Ignore unless otherwise specified.
-
- * default: true
- * **note:**
- If this option is disabled, the mocked functions will return
- a default value (0) when called (and only if they have to return something of course).
-
-
-Compiled Options:
------------------
-
-A number of #defines also exist for customizing the cmock experience.
-Feel free to pass these into your compiler or whatever is most
-convenient. CMock will otherwise do its best to guess what you want
-based on other settings, particularly Unity's settings.
-
-* `CMOCK_MEM_STATIC` or `CMOCK_MEM_DYNAMIC`
- Define one of these to determine if you want to dynamically add
- memory during tests as required from the heap. If static, you
- can control the total footprint of Cmock. If dynamic, you will
- need to make sure you make some heap space available for Cmock.
-
-* `CMOCK_MEM_SIZE`
- In static mode this is the total amount of memory you are allocating
- to Cmock. In Dynamic mode this is the size of each chunk allocated
- at once (larger numbers grab more memory but require less mallocs).
-
-* `CMOCK_MEM_ALIGN`
- The way to align your data to. Not everything is as flexible as
- a PC, as most embedded designers know. This defaults to 2, meaning
- align to the closest 2^2 -> 4 bytes (32 bits). You can turn off alignment
- by setting 0, force alignment to the closest uint16 with 1 or even
- to the closest uint64 with 3.
-
-* `CMOCK_MEM_PTR_AS_INT`
- This is used internally to hold pointers... it needs to be big
- enough. On most processors a pointer is the same as an unsigned
- long... but maybe that's not true for yours?
-
-* `CMOCK_MEM_INDEX_TYPE`
- This needs to be something big enough to point anywhere in Cmock's
- memory space... usually it's an unsigned int.
-
-Examples
-========
-
-You can look in the [examples directory](/examples/) for a couple of examples on how
-you might tool CMock into your build process. You may also want to consider
-using [Ceedling](https://throwtheswitch.org/ceedling). Please note that
-these examples are meant to show how the build process works. They have
-failing tests ON PURPOSE to show what that would look like. Don't be alarmed. ;)
-
diff --git a/tinyusb/test/vendor/ceedling/docs/CeedlingPacket.md b/tinyusb/test/vendor/ceedling/docs/CeedlingPacket.md
deleted file mode 100755
index 88cd0202..00000000
--- a/tinyusb/test/vendor/ceedling/docs/CeedlingPacket.md
+++ /dev/null
@@ -1,2060 +0,0 @@
-[All code is copyright © 2010-2012 Ceedling Project
-by Mike Karlesky, Mark VanderVoord, and Greg Williams.
-
-This Documentation Is Released Under a
-Creative Commons 3.0 Attribution Share-Alike License]
-
-What the What?
-
-Assembling build environments for C projects - especially with
-automated unit tests - is a pain. Whether it's Make or Rake or Premake
-or what-have-you, set up with an all-purpose build environment
-tool is tedious and requires considerable glue code to pull together
-the necessary tools and libraries. Ceedling allows you to generate
-an entire test and build environment for a C project from a single
-YAML configuration file. Ceedling is written in Ruby and works
-with the Rake build tool plus other goodness like Unity and CMock
-- the unit testing and mocking frameworks for C. Ceedling and
-its complementary tools can support the tiniest of embedded
-processors, the beefiest 64 bit power houses available, and
-everything in between.
-
-For a build project including unit tests and using the default
-toolchain gcc, the configuration file could be as simple as this:
-
-```yaml
-:project:
- :build_root: project/build/
- :release_build: TRUE
-
-:paths:
- :test:
- - tests/**
- :source:
- - source/**
-```
-
-From the command line, to build the release version of your project,
-you would simply run `ceedling release`. To run all your unit tests,
-you would run `ceedling test:all`. That's it!
-
-Of course, many more advanced options allow you to configure
-your project with a variety of features to meet a variety of needs.
-Ceedling can work with practically any command line toolchain
-and directory structure – all by way of the configuration file.
-Further, because Ceedling piggy backs on Rake, you can add your
-own Rake tasks to accomplish project tasks outside of testing
-and release builds. A facility for plugins also allows you to
-extend Ceedling's capabilities for needs such as custom code
-metrics reporting and coverage testing.
-
-What's with this Name?
-
-Glad you asked. Ceedling is tailored for unit tested C projects
-and is built upon / around Rake (Rake is a Make replacement implemented
-in the Ruby scripting language). So, we've got C, our Rake, and
-the fertile soil of a build environment in which to grow and tend
-your project and its unit tests. Ta da - _Ceedling_.
-
-What Do You Mean "tailored for unit tested C projects"?
-
-Well, we like to write unit tests for our C code to make it lean and
-mean (that whole [Test-Driven Development][tdd]
-thing). Along the way, this style of writing C code spawned two
-tools to make the job easier: a unit test framework for C called
-_Unity_ and a mocking library called _CMock_. And, though it's
-not directly related to testing, a C framework for exception
-handling called _CException_ also came along.
-
-[tdd]: http://en.wikipedia.org/wiki/Test-driven_development
-
-These tools and frameworks are great, but they require quite
-a bit of environment support to pull them all together in a convenient,
-usable fashion. We started off with Rakefiles to assemble everything.
-These ended up being quite complicated and had to be hand-edited
-or created anew for each new project. Ceedling replaces all that
-tedium and rework with a configuration file that ties everything
-together.
-
-Though Ceedling is tailored for unit testing, it can also go right ahead
-and build your final binary release artifact for you as well. Or,
-Ceedling and your tests can live alongside your existing release build
-setup. That said, Ceedling is more powerful as a unit test build
-environment than it is a general purpose release build environment;
-complicated projects including separate bootloaders or multiple library
-builds, etc. are not its strong suit.
-
-Hold on. Back up. Ruby? Rake? YAML? Unity? CMock? CException?
-
-Seem overwhelming? It's not bad at all, and for the benefits tests
-bring us, it's all worth it.
-
-[Ruby][] is a handy scripting
-language like Perl or Python. It's a modern, full featured language
-that happens to be quite handy for accomplishing tasks like code
-generation or automating one's workflow while developing in
-a compiled language such as C.
-
-[Ruby]: http://www.ruby-lang.org/en/
-
-[Rake][] is a utility written in Ruby
-for accomplishing dependency tracking and task automation
-common to building software. It's a modern, more flexible replacement
-for [Make][]).
-Rakefiles are Ruby files, but they contain build targets similar
-in nature to that of Makefiles (but you can also run Ruby code in
-your Rakefile).
-
-[Rake]: http://rubyrake.org/
-[Make]: http://en.wikipedia.org/wiki/Make_(software)
-
-[YAML][] is a "human friendly data serialization standard for all
-programming languages." It's kinda like a markup language, but don't
-call it that. With a YAML library, you can [serialize][] data structures
-to and from the file system in a textual, human readable form. Ceedling
-uses a serialized data structure as its configuration input.
-
-[YAML]: http://en.wikipedia.org/wiki/Yaml
-[serialize]: http://en.wikipedia.org/wiki/Serialization
-
-[Unity] is a [unit test framework][test] for C. It provides facilities
-for test assertions, executing tests, and collecting / reporting test
-results. Unity derives its name from its implementation in a single C
-source file (plus two C header files) and from the nature of its
-implementation - Unity will build in any C toolchain and is configurable
-for even the very minimalist of processors.
-
-[Unity]: http://github.com/ThrowTheSwitch/Unity
-[test]: http://en.wikipedia.org/wiki/Unit_testing
-
-[CMock] is a tool written in Ruby able to generate entire
-[mock functions][mock] in C code from a given C header file. Mock
-functions are invaluable in [interaction-based unit testing][ut].
-CMock's generated C code uses Unity.
-
-[CMock]: http://github.com/ThrowTheSwitch/CMock
-[mock]: http://en.wikipedia.org/wiki/Mock_object
-[ut]: http://martinfowler.com/articles/mocksArentStubs.html
-
-[CException] is a C source and header file that provide a simple
-[exception mechanism][exn] for C by way of wrapping up the
-[setjmp / longjmp][setjmp] standard library calls. Exceptions are a much
-cleaner and preferable alternative to managing and passing error codes
-up your return call trace.
-
-[CException]: http://github.com/ThrowTheSwitch/CException
-[exn]: http://en.wikipedia.org/wiki/Exception_handling
-[setjmp]: http://en.wikipedia.org/wiki/Setjmp.h
-
-Notes
------
-
-* YAML support is included with Ruby - requires no special installation
- or configuration.
-
-* Unity, CMock, and CException are bundled with Ceedling, and
- Ceedling is designed to glue them all together for your project
- as seamlessly as possible.
-
-
-Installation & Setup: What Exactly Do I Need to Get Started?
-------------------------------------------------------------
-
-As a [Ruby gem](http://docs.rubygems.org/read/chapter/1):
-
-1. [Download and install Ruby](http://www.ruby-lang.org/en/downloads/)
-
-2. Use Ruby's command line gem package manager to install Ceedling:
- `gem install ceedling`
- (Unity, CMock, and CException come along with Ceedling for free)
-
-3. Execute Ceedling at command line to create example project
- or an empty Ceedling project in your filesystem (executing
- `ceedling help` first is, well, helpful).
-
-Gem install notes:
-
-1. Steps 1-2 are a one time affair for your local environment.
- When steps 1-2 are completed once, only step 3 is needed for
- each new project.
-
-
-
-General notes:
-
-1. Certain advanced features of Ceedling rely on gcc and cpp
- as preprocessing tools. In most *nix systems, these tools
- are already available. For Windows environments, we recommend
- the [mingw project](http://www.mingw.org/) (Minimalist
- GNU for Windows). This represents an optional, additional
- setup / installation step to complement the list above. Upon
- installing mingw ensure your system path is updated or set
- [:environment][:path] in your `project.yml` file (see
- environment section later in this document).
-
-2. To use a project file name other than the default `project.yml`
- or place the project file in a directory other than the one
- in which you'll run Rake, create an environment variable
- `CEEDLING_MAIN_PROJECT_FILE` with your desired project
- file path.
-
-3. To better understand Rake conventions, Rake execution,
- and Rakefiles, consult the [Rake tutorial, examples, and
- user guide](http://rubyrake.org/).
-
-4. When using Ceedling in Windows environments, a test file name may
- not include the sequences “patch” or “setup”. The Windows Installer
- Detection Technology (part of UAC), requires administrator
- privileges to execute file names with these strings.
-
-
-
-Now What? How Do I Make It GO?
-------------------------------
-
-We're getting a little ahead of ourselves here, but it's good
-context on how to drive this bus. Everything is done via the command
-line. We'll cover conventions and how to actually configure
-your project in later sections.
-
-To run tests, build your release artifact, etc., you will be interacting
-with Rake on the command line. Ceedling works with Rake to present
-you with named tasks that coordinate the file generation and
-build steps needed to accomplish something useful. You can also
-add your own independent Rake tasks or create plugins to extend
-Ceedling (more on this later).
-
-
-* `ceedling [no arguments]`:
-
- Run the default Rake task (conveniently recognized by the name default
- by Rake). Neither Rake nor Ceedling provide a default task. Rake will
- abort if run without arguments when no default task is defined. You can
- conveniently define a default task in the Rakefile discussed in the
- preceding setup & installation section of this document.
-
-* `ceedling -T`:
-
- List all available Rake tasks with descriptions (Rake tasks without
- descriptions are not listed). -T is a command line switch for Rake and
- not the same as tasks that follow.
-
-* `ceedling <tasks...> --trace`:
-
- For advanced users troubleshooting a confusing build error, debug
- Ceedling or a plugin, --trace provides a stack trace of dependencies
- walked during task execution and any Ruby failures along the way. Note
- that --trace is a command line switch for Rake and is not the same as
- tasks that follow.
-
-* `ceedling environment`:
-
- List all configured environment variable names and string values. This
- task is helpful in verifying the evaluatio of any Ruby expressions in
- the [:environment] section of your config file.`: Note: Ceedling may
- set some convenience environment variables by default.
-
-* `ceedling paths:*`:
-
- List all paths collected from [:paths] entries in your YAML config
- file where * is the name of any section contained in [:paths]. This
- task is helpful in verifying the expansion of path wildcards / globs
- specified in the [:paths] section of your config file.
-
-* `ceedling files:assembly`
-* `ceedling files:header`
-* `ceedling files:source`
-* `ceedling files:test`
-
- List all files and file counts collected from the relevant search
- paths specified by the [:paths] entries of your YAML config file. The
- files:assembly task will only be available if assembly support is
- enabled in the [:release_build] section of your configuration file.
-
-* `ceedling options:*`:
-
- Load and merge configuration settings into the main project
- configuration. Each task is named after a *.yml file found in the
- configured options directory. See documentation for the configuration
- setting [:project][:options_path] and for options files in advanced
- topics.
-
-* `ceedling test:all`:
-
- Run all unit tests (rebuilding anything that's changed along the way).
-
-* `ceedling test:delta`:
-
- Run only those unit tests for which the source or test files have
- changed (i.e. incremental build). Note: with the
- [:project][:use_test_preprocessor] configuration file option set,
- runner files are always regenerated limiting the total efficiency this
- text execution option can afford.
-
-* `ceedling test:*`:
-
- Execute the named test file or the named source file that has an
- accompanying test. No path. Examples: ceedling test:foo.c or ceed
- test:test_foo.c
-
-* `ceedling test:pattern[*]`:
-
- Execute any tests whose name and/or path match the regular expression
- pattern (case sensitive). Example: ceedling "test:pattern[(I|i)nit]" will
- execute all tests named for initialization testing. Note: quotes may
- be necessary around the ceedling parameter to distinguish regex characters
- from command line operators.
-
-* `ceedling test:path[*]`:
-
- Execute any tests whose path contains the given string (case
- sensitive). Example: ceedling test:path[foo/bar] will execute all tests
- whose path contains foo/bar. Note: both directory separator characters
- / and \ are valid.
-
-* `ceedling release`:
-
- Build all source into a release artifact (if the release build option
- is configured).
-
-* `ceedling release:compile:*`:
-
- Sometimes you just need to compile a single file dagnabit. Example:
- ceedling release:compile:foo.c
-
-* `ceedling release:assemble:*`:
-
- Sometimes you just need to assemble a single file doggonit. Example:
- ceedling release:assemble:foo.s
-
-* `ceedling module:create[Filename]`:
-* `ceedling module:create[<Path:>Filename]`:
-
- It's often helpful to create a file automatically. What's better than
- that? Creating a source file, a header file, and a corresponding test
- file all in one step!
-
- There are also patterns which can be specified to automatically generate
- a bunch of files. Try `ceedling module:create[Poodles,mch]` for example!
-
- The module generator has several options you can configure.
- F.e. Generating the source/header/test file in a subdirectory (by adding <Path> when calling module:create).
- For more info, refer to the [Module Generator](https://github.com/ThrowTheSwitch/Ceedling/blob/master/docs/CeedlingPacket.md#module-generator) section.
-
-* `ceedling logging <tasks...>`:
-
- Enable logging to <build path>/logs. Must come before test and release
- tasks to log their steps and output. Log names are a concatenation of
- project, user, and option files loaded. User and option files are
- documented in the advanced topics section of this document.
-
-* `ceedling verbosity[x] <tasks...>`:
-
- Change the default verbosity level. [x] ranges from 0 (quiet) to 4
- (obnoxious). Level [3] is the default. The verbosity task must precede
- all tasks in the command line list for which output is desired to be
- seen. Verbosity settings are generally most meaningful in conjunction
- with test and release tasks.
-
-* `ceedling summary`:
-
- If plugins are enabled, this task will execute the summary method of
- any plugins supporting it. This task is intended to provide a quick
- roundup of build artifact metrics without re-running any part of the
- build.
-
-* `ceedling clean`:
-
- Deletes all toolchain binary artifacts (object files, executables),
- test results, and any temporary files. Clean produces no output at the
- command line unless verbosity has been set to an appreciable level.
-
-* `ceedling clobber`:
-
- Extends clean task's behavior to also remove generated files: test
- runners, mocks, preprocessor output. Clobber produces no output at the
- command line unless verbosity has been set to an appreciable level.
-
-To better understand Rake conventions, Rake execution, and
-Rakefiles, consult the [Rake tutorial, examples, and user guide][guide].
-
-[guide]: http://rubyrake.org/
-
-At present, none of Ceedling's commands provide persistence.
-That is, they must each be specified at the command line each time
-they are needed. For instance, Ceedling's verbosity command
-only affects output at the time it's run.
-
-Individual test and release file tasks
-are not listed in `-T` output. Because so many files may be present
-it's unwieldy to list them all.
-
-Multiple rake tasks can be executed at the command line (order
-is executed as provided). For example, `ceed
-clobber test:all release` will removed all generated files;
-build and run all tests; and then build all source - in that order.
-If any Rake task fails along the way, execution halts before the
-next task.
-
-The `clobber` task removes certain build directories in the
-course of deleting generated files. In general, it's best not
-to add to source control any Ceedling generated directories
-below the root of your top-level build directory. That is, leave
-anything Ceedling & its accompanying tools generate out of source
-control (but go ahead and add the top-level build directory that
-holds all that stuff). Also, since Ceedling is pretty smart about
-what it rebuilds and regenerates, you needn't clobber often.
-
-Important Conventions
-=====================
-
-Directory Structure, Filenames & Extensions
--------------------------------------------
-
-Much of Ceedling's functionality is driven by collecting files
-matching certain patterns inside the paths it's configured
-to search. See the documentation for the [:extensions] section
-of your configuration file (found later in this document) to
-configure the file extensions Ceedling uses to match and collect
-files. Test file naming is covered later in this section.
-
-Test files and source files must be segregated by directories.
-Any directory structure will do. Tests can be held in subdirectories
-within source directories, or tests and source directories
-can be wholly separated at the top of your project's directory
-tree.
-
-Search Path Order
------------------
-
-When Ceedling searches for files (e.g. looking for header files
-to mock) or when it provides search paths to any of the default
-gcc toolchain executables, it organizes / prioritizes its search
-paths. The order is always: test paths, support paths, source
-paths, and then include paths. This can be useful, for instance,
-in certain testing scenarios where we desire Ceedling or a compiler
-to find a stand-in header file in our support directory before
-the actual source header file of the same name.
-
-This convention only holds when Ceedling is using its default
-tool configurations and / or when tests are involved. If you define
-your own tools in the configuration file (see the [:tools] section
-documented later in this here document), you have complete control
-over what directories are searched and in what order. Further,
-test and support directories are only searched when appropriate.
-That is, when running a release build, test and support directories
-are not used at all.
-
-Source Files & Binary Release Artifacts
----------------------------------------
-
-Your binary release artifact results from the compilation and
-linking of all source files Ceedling finds in the specified source
-directories. At present only source files with a single (configurable)
-extension are recognized. That is, *.c and *.cc files will not
-both be recognized - only one or the other. See the configuration
-options and defaults in the documentation for the [:extensions]
-sections of your configuration file (found later in this document).
-
-Test Files & Executable Test Fixtures
--------------------------------------
-
-Ceedling builds each individual test file with its accompanying
-source file(s) into a single, monolithic test fixture executable.
-Test files are recognized by a naming convention: a (configurable)
-prefix such as "`test_`" in the file name with the same file extension
-as used by your C source files. See the configuration options
-and defaults in the documentation for the [:project] and [:extensions]
-sections of your configuration file (found later in this document).
-Depending on your configuration options, Ceedling can recognize
-a variety of test file naming patterns in your test search paths.
-For example: `test_some_super_functionality.c`, `TestYourSourceFile.cc`,
-or `testing_MyAwesomeCode.C` could each be valid test file
-names. Note, however, that Ceedling can recognize only one test
-file naming convention per project.
-
-Ceedling knows what files to compile and link into each individual
-test executable by way of the #include list contained in each
-test file. Any C source files in the configured search directories
-that correspond to the header files included in a test file will
-be compiled and linked into the resulting test fixture executable.
-From this same #include list, Ceedling knows which files to mock
-and compile and link into the test executable (if you use mocks
-in your tests). That was a lot of clauses and information in a very
-few sentences; the example that follows in a bit will make it clearer.
-
-By naming your test functions according to convention, Ceedling
-will extract and collect into a runner C file calls to all your
-test case functions. This runner file handles all the execution
-minutiae so that your test file can be quite simple and so that
-you never forget to wire up a test function to be executed. In this
-generated runner lives the `main()` entry point for the resulting
-test executable. There are no configuration options for the
-naming convention of your test case functions. A test case function
-signature must have these three elements: void return, void
-parameter list, and the function name prepended with lowercase
-"`test`". In other words, a test function signature should look
-like this: `void test``[any name you like]``(void)`.
-
-A commented sample test file follows on the next page. Also, see
-the sample project contained in the Ceedling documentation
-bundle.
-
-```c
-// test_foo.c -----------------------------------------------
-#include "unity.h" // compile/link in Unity test framework
-#include "types.h" // header file with no *.c file -- no compilation/linking
-#include "foo.h" // source file foo.c under test
-#include "mock_bar.h" // bar.h will be found and mocked as mock_bar.c + compiled/linked in;
- // foo.c includes bar.h and uses functions declared in it
-#include "mock_baz.h" // baz.h will be found and mocked as mock_baz.c + compiled/linked in
- // foo.c includes baz.h and uses functions declared in it
-
-
-void setUp(void) {} // every test file requires this function;
- // setUp() is called by the generated runner before each test case function
-
-void tearDown(void) {} // every test file requires this function;
- // tearDown() is called by the generated runner before each test case function
-
-// a test case function
-void test_Foo_Function1_should_Call_Bar_AndGrill(void)
-{
- Bar_AndGrill_Expect(); // setup function from mock_bar.c that instructs our
- // framework to expect Bar_AndGrill() to be called once
- TEST_ASSERT_EQUAL(0xFF, Foo_Function1()); // assertion provided by Unity
- // Foo_Function1() calls Bar_AndGrill() & returns a byte
-}
-
-// another test case function
-void test_Foo_Function2_should_Call_Baz_Tec(void)
-{
- Baz_Tec_ExpectAnd_Return(1); // setup function provided by mock_baz.c that instructs our
- // framework to expect Baz_Tec() to be called once and return 1
- TEST_ASSERT_TRUE(Foo_Function2()); // assertion provided by Unity
-}
-
-// end of test_foo.c ----------------------------------------
-```
-
-From the test file specified above Ceedling will generate `test_foo_runner.c`;
-this runner file will contain `main()` and call both of the example
-test case functions.
-
-The final test executable will be `test_foo.exe` (for Windows
-machines or `test_foo.out` for *nix systems - depending on default
-or configured file extensions). Based on the #include list above,
-the test executable will be the output of the linker having processed
-`unity.o`, `foo.o`, `mock_bar.o`, `mock_baz.o`, `test_foo.o`,
-and `test_foo_runner.o`. Ceedling finds the files, generates
-mocks, generates a runner, compiles all the files, and links
-everything into the test executable. Ceedling will then run
-the test executable and collect test results from it to be reported
-to the developer at the command line.
-
-For more on the assertions and mocks shown, consult the documentation
-for Unity and CMock.
-
-The Magic of Dependency Tracking
---------------------------------
-
-Ceedling is pretty smart in using Rake to build up your project's
-dependencies. This means that Ceedling automagically rebuilds
-all the appropriate files in your project when necessary: when
-your configuration changes, Ceedling or any of the other tools
-are updated, or your source or test files change. For instance,
-if you modify a header file that is mocked, Ceedling will ensure
-that the mock is regenerated and all tests that use that mock are
-rebuilt and re-run when you initiate a relevant testing task.
-When you see things rebuilding, it's for a good reason. Ceedling
-attempts to regenerate and rebuild only what's needed for a given
-execution of a task. In the case of large projects, assembling
-dependencies and acting upon them can cause some delay in executing
-tasks.
-
-With one exception, the trigger to rebuild or regenerate a file
-is always a disparity in timestamps between a target file and
-its source - if an input file is newer than its target dependency,
-the target is rebuilt or regenerated. For example, if the C source
-file from which an object file is compiled is newer than that object
-file on disk, recompilation will occur (of course, if no object
-file exists on disk, compilation will always occur). The one
-exception to this dependency behavior is specific to your input
-configuration. Only if your logical configuration changes
-will a system-wide rebuild occur. Reorganizing your input configuration
-or otherwise updating its file timestamp without modifying
-the values within the file will not trigger a rebuild. This behavior
-handles the various ways in which your input configuration can
-change (discussed later in this document) without having changed
-your actual project YAML file.
-
-Ceedling needs a bit of help to accomplish its magic with deep
-dependencies. Shallow dependencies are straightforward:
-a mock is dependent on the header file from which it's generated,
-a test file is dependent upon the source files it includes (see
-the preceding conventions section), etc. Ceedling handles
-these "out of the box." Deep dependencies are specifically a
-C-related phenomenon and occur as a consequence of include statements
-within C source files. Say a source file includes a header file
-and that header file in turn includes another header file which
-includes still another header file. A change to the deepest header
-file should trigger a recompilation of the source file, a relinking
-of all the object files comprising a test fixture, and a new execution
-of that test fixture.
-
-Ceedling can handle deep dependencies but only with the help
-of a C preprocessor. Ceedling is quite capable, but a full C preprocessor
-it ain't. Your project can be configured to use a C preprocessor
-or not. Simple projects or large projects constructed so as to
-be quite flat in their include structure generally don't need
-deep dependency preprocessing - and can enjoy the benefits of
-faster execution. Legacy code, on the other hand, will almost
-always want to be tested with deep preprocessing enabled. Set
-up of the C preprocessor is covered in the documentation for the
-[:project] and [:tools] section of the configuration file (later
-in this document). Ceedling contains all the configuration
-necessary to use the gcc preprocessor by default. That is, as
-long as gcc is in your system search path, deep preprocessing
-of deep dependencies is available to you by simply enabling it
-in your project configuration file.
-
-Ceedling's Build Output
------------------------
-
-Ceedling requires a top-level build directory for all the stuff
-that it, the accompanying test tools, and your toolchain generate.
-That build directory's location is configured in the [:project]
-section of your configuration file (discussed later). There
-can be a ton of generated files. By and large, you can live a full
-and meaningful life knowing absolutely nothing at all about
-the files and directories generated below the root build directory.
-
-As noted already, it's good practice to add your top-level build
-directory to source control but nothing generated beneath it.
-You'll spare yourself headache if you let Ceedling delete and
-regenerate files and directories in a non-versioned corner
-of your project's filesystem beneath the top-level build directory.
-
-The `artifacts` directory is the one and only directory you may
-want to know about beneath the top-level build directory. The
-subdirectories beneath `artifacts` will hold your binary release
-target output (if your project is configured for release builds)
-and will serve as the conventional location for plugin output.
-This directory structure was chosen specifically because it
-tends to work nicely with Continuous Integration setups that
-recognize and list build artifacts for retrieval / download.
-
-The Almighty Project Configuration File (in Glorious YAML)
-----------------------------------------------------------
-
-Please consult YAML documentation for the finer points of format
-and to understand details of our YAML-based configuration file.
-We recommend [Wikipedia's entry on YAML](http://en.wikipedia.org/wiki/Yaml)
-for this. A few highlights from that reference page:
-
-* YAML streams are encoded using the set of printable Unicode
- characters, either in UTF-8 or UTF-16
-
-* Whitespace indentation is used to denote structure; however
- tab characters are never allowed as indentation
-
-* Comments begin with the number sign ( # ), can start anywhere
- on a line, and continue until the end of the line unless enclosed
- by quotes
-
-* List members are denoted by a leading hyphen ( - ) with one member
- per line, or enclosed in square brackets ( [ ] ) and separated
- by comma space ( , )
-
-* Hashes are represented using the colon space ( : ) in the form
- key: value, either one per line or enclosed in curly braces
- ( { } ) and separated by comma space ( , )
-
-* Strings (scalars) are ordinarily unquoted, but may be enclosed
- in double-quotes ( " ), or single-quotes ( ' )
-
-* YAML requires that colons and commas used as list separators
- be followed by a space so that scalar values containing embedded
- punctuation can generally be represented without needing
- to be enclosed in quotes
-
-* Repeated nodes are initially denoted by an ampersand ( & ) and
- thereafter referenced with an asterisk ( * )
-
-
-Notes on what follows:
-
-* Each of the following sections represent top-level entries
- in the YAML configuration file.
-
-* Unless explicitly specified in the configuration file, default
- values are used by Ceedling.
-
-* These three settings, at minimum, must be specified:
- * [:project][:build_root]
- * [:paths][:source]
- * [:paths][:test]
-
-* As much as is possible, Ceedling validates your settings in
- properly formed YAML.
-
-* Improperly formed YAML will cause a Ruby error when the YAML
- is parsed. This is usually accompanied by a complaint with
- line and column number pointing into the project file.
-
-* Certain advanced features rely on gcc and cpp as preprocessing
- tools. In most *nix systems, these tools are already available.
- For Windows environments, we recommend the [mingw project](http://www.mingw.org/)
- (Minimalist GNU for Windows).
-
-* Ceedling is primarily meant as a build tool to support automated
- unit testing. All the heavy lifting is involved there. Creating
- a simple binary release build artifact is quite trivial in
- comparison. Consequently, most default options and the construction
- of Ceedling itself is skewed towards supporting testing though
- Ceedling can, of course, build your binary release artifact
- as well. Note that complex binary release artifacts (e.g.
- application + bootloader or multiple libraries) are beyond
- Ceedling's release build ability.
-
-
-Conventions / features of Ceedling-specific YAML:
-
-* Any second tier setting keys anywhere in YAML whose names end
- in `_path` or `_paths` are automagically processed like all
- Ceedling-specific paths in the YAML to have consistent directory
- separators (i.e. "/") and to take advantage of inline Ruby
- string expansion (see [:environment] setting below for further
- explanation of string expansion).
-
-
-**Let's Be Careful Out There:** Ceedling performs validation
-on the values you set in your configuration file (this assumes
-your YAML is correct and will not fail format parsing, of course).
-That said, validation is limited to only those settings Ceedling
-uses and those that can be reasonably validated. Ceedling does
-not limit what can exist within your configuration file. In this
-way, you can take full advantage of YAML as well as add sections
-and values for use in your own custom plugins (documented later).
-The consequence of this is simple but important. A misspelled
-configuration section name or value name is unlikely to cause
-Ceedling any trouble. Ceedling will happily process that section
-or value and simply use the properly spelled default maintained
-internally - thus leading to unexpected behavior without warning.
-
-project: global project settings
-
-
-* `build_root`:
-
- Top level directory into which generated path structure and files are
- placed. Note: this is one of the handful of configuration values that
- must be set. The specified path can be absolute or relative to your
- working directory.
-
- **Default**: (none)
-
-* `use_exceptions`:
-
- Configures the build environment to make use of CException. Note that
- if you do not use exceptions, there's no harm in leaving this as its
- default value.
-
- **Default**: TRUE
-
-* `use_mocks`:
-
- Configures the build environment to make use of CMock. Note that if
- you do not use mocks, there's no harm in leaving this setting as its
- default value.
-
- **Default**: TRUE
-
-* `use_test_preprocessor`:
-
- This option allows Ceedling to work with test files that contain
- conditional compilation statements (e.g. #ifdef) and header files you
- wish to mock that contain conditional preprocessor statements and/or
- macros.
-
- Ceedling and CMock are advanced tools with sophisticated parsers.
- However, they do not include entire C language preprocessors.
- Consequently, with this option enabled, Ceedling will use gcc's
- preprocessing mode and the cpp preprocessor tool to strip down /
- expand test files and headers to their applicable content which can
- then be processed by Ceedling and CMock.
-
- With this option enabled, the gcc & cpp tools must exist in an
- accessible system search path and test runner files are always
- regenerated.
-
- **Default**: FALSE
-
-* `use_deep_dependencies`:
-
- The base rules and tasks that Ceedling creates using Rake capture most
- of the dependencies within a standard project (e.g. when the source
- file accompanying a test file changes, the corresponding test fixture
- executable will be rebuilt when tests are re-run). However, deep
- dependencies cannot be captured this way. If a typedef or macro
- changes in a header file three levels of #include statements deep,
- this option allows the appropriate incremental build actions to occur
- for both test execution and release builds.
-
- This is accomplished by using the dependencies discovery mode of gcc.
- With this option enabled, gcc must exist in an accessible system
- search path.
-
- **Default**: FALSE
-
-* `generate_deep_dependencies`:
-
- When `use_deep_dependencies` is set to TRUE, Ceedling will run a separate
- build step to generate the deep dependencies. If you are using gcc as your
- primary compiler, or another compiler that can generate makefile rules as
- a side effect of compilation, then you can set this to FALSE to avoid the
- extra build step but still use the deep dependencies data when deciding
- which source files to rebuild.
-
- **Default**: TRUE
-
-* `test_file_prefix`:
-
- Ceedling collects test files by convention from within the test file
- search paths. The convention includes a unique name prefix and a file
- extension matching that of source files.
-
- Why not simply recognize all files in test directories as test files?
- By using the given convention, we have greater flexibility in what we
- do with C files in the test directories.
-
- **Default**: "test_"
-
-* `options_paths`:
-
- Just as you may have various build configurations for your source
- codebase, you may need variations of your project configuration.
-
- By specifying options paths, Ceedling will search for other project
- YAML files, make command line tasks available (ceedling options:variation
- for a variation.yml file), and merge the project configuration of
- these option files in with the main project file at runtime. See
- advanced topics.
-
- Note these Rake tasks at the command line - like verbosity or logging
- control - must come before the test or release task they are meant to
- modify.
-
- **Default**: [] (empty)
-
-* `release_build`:
-
- When enabled, a release Rake task is exposed. This configuration
- option requires a corresponding release compiler and linker to be
- defined (gcc is used as the default).
-
- More release configuration options are available in the release_build
- section.
-
- **Default**: FALSE
-
-
-Example `[:project]` YAML blurb
-
-```yaml
-:project:
- :build_root: project_awesome/build
- :use_exceptions: FALSE
- :use_test_preprocessor: TRUE
- :use_deep_dependencies: TRUE
- :options_paths:
- - project/options
- - external/shared/options
- :release_build: TRUE
-```
-
-Ceedling is primarily concerned with facilitating the somewhat
-complicated mechanics of automating unit tests. The same mechanisms
-are easily capable of building a final release binary artifact
-(i.e. non test code; the thing that is your final working software
-that you execute on target hardware).
-
-
-* `output`:
-
- The name of your release build binary artifact to be found in <build
- path>/artifacts/release. Ceedling sets the default artifact file
- extension to that as is explicitly specified in the [:extensions]
- section or as is system specific otherwise.
-
- **Default**: `project.exe` or `project.out`
-
-* `use_assembly`:
-
- If assembly code is present in the source tree, this option causes
- Ceedling to create appropriate build directories and use an assembler
- tool (default is the GNU tool as - override available in the [:tools]
- section.
-
- **Default**: FALSE
-
-* `artifacts`:
-
- By default, Ceedling copies to the <build path>/artifacts/release
- directory the output of the release linker and (optionally) a map
- file. Many toolchains produce other important output files as well.
- Adding a file path to this list will cause Ceedling to copy that file
- to the artifacts directory. The artifacts directory is helpful for
- organizing important build output files and provides a central place
- for tools such as Continuous Integration servers to point to build
- output. Selectively copying files prevents incidental build cruft from
- needlessly appearing in the artifacts directory. Note that inline Ruby
- string replacement is available in the artifacts paths (see discussion
- in the [:environment] section).
-
- **Default**: [] (empty)
-
-Example `[:release_build]` YAML blurb
-
-```yaml
-:release_build:
- :output: top_secret.bin
- :use_assembly: TRUE
- :artifacts:
- - build/release/out/c/top_secret.s19
-```
-
-**paths**: options controlling search paths for source and header
-(and assembly) files
-
-* `test`:
-
- All C files containing unit test code. Note: this is one of the
- handful of configuration values that must be set.
-
- **Default**: [] (empty)
-
-* `source`:
-
- All C files containing release code (code to be tested). Note: this is
- one of the handful of configuration values that must be set.
-
- **Default**: [] (empty)
-
-* `support`:
-
- Any C files you might need to aid your unit testing. For example, on
- occasion, you may need to create a header file containing a subset of
- function signatures matching those elsewhere in your code (e.g. a
- subset of your OS functions, a portion of a library API, etc.). Why?
- To provide finer grained control over mock function substitution or
- limiting the size of the generated mocks.
-
- **Default**: [] (empty)
-
-* `include`:
-
- Any header files not already in the source search path. Note there's
- no practical distinction between this search path and the source
- search path; it's merely to provide options or to support any
- peculiar source tree organization.
-
- **Default**: [] (empty)
-
-* `test_toolchain_include`:
-
- System header files needed by the test toolchain - should your
- compiler be unable to find them, finds the wrong system include search
- path, or you need a creative solution to a tricky technical problem.
- Note that if you configure your own toolchain in the [:tools] section,
- this search path is largely meaningless to you. However, this is a
- convenient way to control the system include path should you rely on
- the default gcc tools.
-
- **Default**: [] (empty)
-
-* `release_toolchain_include`:
-
- Same as preceding albeit related to the release toolchain.
-
- **Default**: [] (empty)
-
-* `<custom>`
-
- Any paths you specify for custom list. List is available to tool
- configurations and/or plugins. Note a distinction. The preceding names
- are recognized internally to Ceedling and the path lists are used to
- build collections of files contained in those paths. A custom list is
- just that - a custom list of paths.
-
-Notes on path grammar within the [:paths] section:
-
-* Order of search paths listed in [:paths] is preserved when used by an
- entry in the [:tools] section
-
-* Wherever multiple path lists are combined for use Ceedling prioritizes
- path groups as follows:
- test paths, support paths, source paths, include paths.
-
- This can be useful, for instance, in certain testing scenarios where
- we desire Ceedling or the compiler to find a stand-in header file before
- the actual source header file of the same name.
-
-* Paths:
-
- 1. can be absolute or relative
-
- 2. can be singly explicit - a single fully specified path
-
- 3. can include a glob operator (more on this below)
-
- 4. can use inline Ruby string replacement (see [:environment]
- section for more)
-
- 5. default as an addition to a specific search list (more on this
- in the examples)
-
- 6. can act to subtract from a glob included in the path list (more
- on this in the examples)
-
-
-[Globs](http://ruby.about.com/od/beginningruby/a/dir2.htm)
-as used by Ceedling are wildcards for specifying directories
-without the need to list each and every required search path.
-Ceedling globs operate just as Ruby globs except that they are
-limited to matching directories and not files. Glob operators
-include the following * ** ? [-] {,} (note: this list is space separated
-and not comma separated as commas are used within the bracket
-operators).
-
-* `*`:
-
- All subdirectories of depth 1 below the parent path and including the
- parent path
-
-* `**`:
-
- All subdirectories recursively discovered below the parent path and
- including the parent path
-
-* `?`:
-
- Single alphanumeric character wildcard
-
-* `[x-y]`:
-
- Single alphanumeric character as found in the specified range
-
-* `{x,y}`:
-
- Single alphanumeric character from the specified list
-
-Example [:paths] YAML blurbs
-
-```yaml
-:paths:
- :source: #together the following comprise all source search paths
- - project/source/* #expansion yields all subdirectories of depth 1 plus parent directory
- - project/lib #single path
- :test: #all test search paths
- - project/**/test? #expansion yields any subdirectory found anywhere in the project that
- #begins with "test" and contains 5 characters
-
-:paths:
- :source: #all source search paths
- - +:project/source/** #all subdirectories recursively discovered plus parent directory
- - -:project/source/os/generated #subtract os/generated directory from expansion of above glob
- #note that '+:' notation is merely aesthetic; default is to add
-
- :test: #all test search paths
- - project/test/bootloader #explicit, single search paths (searched in the order specified)
- - project/test/application
- - project/test/utilities
-
- :custom: #custom path list
- - "#{PROJECT_ROOT}/other" #inline Ruby string expansion
-```
-
-Globs and inline Ruby string expansion can require trial and
-error to arrive at your intended results. Use the `ceedling paths:*`
-command line options (documented in preceding section) to verify
-your settings.
-
-Ceedling relies on file collections automagically assembled
-from paths, globs, and file extensions. File collections greatly
-simplify project set up. However, sometimes you need to remove
-from or add individual files to those collections.
-
-
-* `test`:
-
- Modify the collection of unit test C files.
-
- **Default**: [] (empty)
-
-* `source`:
-
- Modify the collection of all source files used in unit test builds and release builds.
-
- **Default**: [] (empty)
-
-* `assembly`:
-
- Modify the (optional) collection of assembly files used in release builds.
-
- **Default**: [] (empty)
-
-* `include`:
-
- Modify the collection of all source header files used in unit test builds (e.g. for mocking) and release builds.
-
- **Default**: [] (empty)
-
-* `support`:
-
- Modify the collection of supporting C files available to unit tests builds.
-
- **Default**: [] (empty)
-
-
-Note: All path grammar documented in [:paths] section applies
-to [:files] path entries - albeit at the file path level and not
-the directory level.
-
-Example [:files] YAML blurb
-
-```yaml
-:files:
- :source:
- - callbacks/comm.c # entry defaults to file addition
- - +:callbacks/comm*.c # add all comm files matching glob pattern
- - -:source/board/atm134.c # not our board
- :test:
- - -:test/io/test_output_manager.c # remove unit tests from test build
-```
-
-**environment:** inserts environment variables into the shell
-instance executing configured tools
-
-Ceedling creates environment variables from any key / value
-pairs in the environment section. Keys become an environment
-variable name in uppercase. The values are strings assigned
-to those environment variables. These value strings are either
-simple string values in YAML or the concatenation of a YAML array.
-
-Ceedling is able to execute inline Ruby string substitution
-code to set environment variables. This evaluation occurs when
-the project file is first processed for any environment pair's
-value string including the Ruby string substitution pattern
-`#{…}`. Note that environment value strings that _begin_ with
-this pattern should always be enclosed in quotes. YAML defaults
-to processing unquoted text as a string; quoting text is optional.
-If an environment pair's value string begins with the Ruby string
-substitution pattern, YAML will interpret the string as a Ruby
-comment (because of the `#`). Enclosing each environment value
-string in quotes is a safe practice.
-
-[:environment] entries are processed in the configured order
-(later entries can reference earlier entries).
-
-Special case: PATH handling
-
-In the specific case of specifying an environment key named _path_,
-an array of string values will be concatenated with the appropriate
-platform-specific path separation character (e.g. ':' on *nix,
-';' on Windows). All other instances of environment keys assigned
-YAML arrays use simple concatenation.
-
-Example [:environment] YAML blurb
-
-```yaml
-:environment:
- - :license_server: gizmo.intranet #LICENSE_SERVER set with value "gizmo.intranet"
- - :license: "#{`license.exe`}" #LICENSE set to string generated from shelling out to
- #execute license.exe; note use of enclosing quotes
-
- - :path: #concatenated with path separator (see special case above)
- - Tools/gizmo/bin #prepend existing PATH with gizmo path
- - "#{ENV['PATH']}" #pattern #{…} triggers ruby evaluation string substitution
- #note: value string must be quoted because of '#'
-
- - :logfile: system/logs/thingamabob.log #LOGFILE set with path for a log file
-```
-
-**extension**: configure file name extensions used to collect lists of files searched in [:paths]
-
-* `header`:
-
- C header files
-
- **Default**: .h
-
-* `source`:
-
- C code files (whether source or test files)
-
- **Default**: .c
-
-* `assembly`:
-
- Assembly files (contents wholly assembly instructions)
-
- **Default**: .s
-
-* `object`:
-
- Resulting binary output of C code compiler (and assembler)
-
- **Default**: .o
-
-* `executable`:
-
- Binary executable to be loaded and executed upon target hardware
-
- **Default**: .exe or .out (Win or *nix)
-
-* `testpass`:
-
- Test results file (not likely to ever need a new value)
-
- **Default**: .pass
-
-* `testfail`:
-
- Test results file (not likely to ever need a new value)
-
- **Default**: .fail
-
-* `dependencies`:
-
- File containing make-style dependency rules created by gcc preprocessor
-
- **Default**: .d
-
-
-Example [:extension] YAML blurb
-
- :extension:
- :source: .cc
- :executable: .bin
-
-**defines**: command line defines used in test and release compilation by configured tools
-
-* `test`:
-
- Defines needed for testing. Useful for:
-
- 1. test files containing conditional compilation statements (i.e.
- tests active in only certain contexts)
-
- 2. testing legacy source wherein the isolation of source under test
- afforded by Ceedling and its complementary tools leaves certain
- symbols unset when source files are compiled in isolation
-
- **Default**: [] (empty)
-
-* `test_preprocess`:
-
- If [:project][:use_test_preprocessor] or
- [:project][:use_deep_dependencies] is set and code is structured in a
- certain way, the gcc preprocessor may need symbol definitions to
- properly preprocess files to extract function signatures for mocking
- and extract deep dependencies for incremental builds.
-
- **Default**: [] (empty)
-
-* `release`:
-
- Defines needed for the release build binary artifact.
-
- **Default**: [] (empty)
-
-* `release_preprocess`:
-
- If [:project][:use_deep_dependencies] is set and code is structured in
- a certain way, the gcc preprocessor may need symbol definitions to
- properly preprocess files for incremental release builds due to deep
- dependencies.
-
- **Default**: [] (empty)
-
-
-Example [:defines] YAML blurb
-
-```yaml
-:defines:
- :test:
- - UNIT_TESTING #for select cases in source to allow testing with a changed behavior or interface
- - OFF=0
- - ON=1
- - FEATURE_X=ON
- :source:
- - FEATURE_X=ON
-```
-
-
-**libraries**: command line defines used in test and release compilation by configured tools
-
-Ceedling allows you to pull in specific libraries for the purpose of release and test builds.
-It has a few levels of support for this. Start by adding a :libraries main section in your
-configuration. In this section, you can optionally have the following subsections:
-
-* `test`:
-
- Library files that should be injected into your tests when linking occurs.
- These can be specified as either relative or absolute paths. These files MUST
- exist when the test attempts to build.
-
-* `source`:
-
- Library files that should be injected into your release when linking occurs. These
- can be specified as either relative or absolute paths. These files MUST exist when
- the release attempts to build UNLESS you are using the subprojects plugin. In that
- case, it will attempt to build that library for you as a dynamic dependency.
-
-* `system`:
-
- These libraries are assumed to be in the tool path somewhere and shouldn't need to be
- specified. The libraries added here will be injected into releases and tests.
-
-* `flag`:
-
- This is the method of adding an argument for each library. For example, gcc really likes
- it when you specify “-l${1}”
-
-Notes:
-
-* If you've specified your own link step, you are going to want to add ${4} to your argument
-list in the place where library files should be added to the command call. For gcc, this is
-often the very end. Other tools may vary.
-
-
-**flags**: configure per-file compilation and linking flags
-
-Ceedling tools (see later [:tools] section) are used to configure
-compilation and linking of test and source files. These tool
-configurations are a one-size-fits-all approach. Should individual files
-require special compilation or linking flags, the settings in the
-[:flags] section work in conjunction with tool definitions by way of
-argument substitution to achieve this.
-
-* `release`:
-
- [:compile] or [:link] flags for release build
-
-* `test`:
-
- [:compile] or [:link] flags for test build
-
-Notes:
-
-* Ceedling works with the [:release] and [:test] build contexts
- as-is; plugins can add additional contexts
-
-* Only [:compile] and [:link] are recognized operations beneath
- a context
-
-* File specifiers do not include a path or file extension
-
-* File specifiers are case sensitive (must match original file
- name)
-
-* File specifiers do support regular expressions if encased in quotes
-
-* '*' is a special (optional) file specifier to provide flags
- to all files not otherwise specified
-
-
-Example [:flags] YAML blurb
-
-```yaml
-:flags:
- :release:
- :compile:
- :main: # add '-Wall' to compilation of main.c
- - -Wall
- :fan: # add '--O2' to compilation of fan.c
- - --O2
- :'test_.+': # add '-pedantic' to all test-files
- - -pedantic
- :*: # add '-foo' to compilation of all files not main.c or fan.c
- - -foo
- :test:
- :compile:
- :main: # add '--O1' to compilation of main.c as part of test builds including main.c
- - --O1
- :link:
- :test_main: # add '--bar --baz' to linking of test_main.exe
- - --bar
- - --baz
-```
-
-Ceedling sets values for a subset of CMock settings. All CMock
-options are available to be set, but only those options set by
-Ceedling in an automated fashion are documented below. See CMock
-documentation.
-
-**cmock**: configure CMock's code generation options and set symbols used to modify CMock's compiled features
-Ceedling sets values for a subset of CMock settings. All CMock options are available to be set, but only those options set by Ceedling in an automated fashion are documented below. See CMock documentation.
-
-* `enforce_strict_ordering`:
-
- Tests fail if expected call order is not same as source order
-
- **Default**: TRUE
-
-* `mock_path`:
-
- Path for generated mocks
-
- **Default**: <build path>/tests/mocks
-
-* `defines`:
-
- List of conditional compilation symbols used to configure CMock's
- compiled features. See CMock documentation to understand available
- options. No symbols must be set unless defaults are inappropriate for
- your specific environment. All symbols are used only by Ceedling to
- compile CMock C code; contents of [:defines] are ignored by CMock's
- Ruby code when instantiated.
-
- **Default**: [] (empty)
-
-* `verbosity`:
-
- If not set, defaults to Ceedling's verbosity level
-
-* `plugins`:
-
- If [:project][:use_exceptions] is enabled, the internal plugins list is pre-populated with 'cexception'.
-
- Whether or not you have included [:cmock][:plugins] in your
- configuration file, Ceedling automatically adds 'cexception' to the
- plugin list if exceptions are enabled. To add to the list Ceedling
- provides CMock, simply add [:cmock][:plugins] to your configuration
- and specify your desired additional plugins.
-
-* `includes`:
-
- If [:cmock][:unity_helper] set, pre-populated with unity_helper file
- name (no path).
-
- The [:cmock][:includes] list works identically to the plugins list
- above with regard to adding additional files to be inserted within
- mocks as #include statements.
-
-
-The last four settings above are directly tied to other Ceedling
-settings; hence, why they are listed and explained here. The
-first setting above, [:enforce_strict_ordering], defaults
-to FALSE within CMock. It is set to TRUE by default in Ceedling
-as our way of encouraging you to use strict ordering. It's a teeny
-bit more expensive in terms of code generated, test execution
-time, and complication in deciphering test failures. However,
-it's good practice. And, of course, you can always disable it
-by overriding the value in the Ceedling YAML configuration file.
-
-
-**cexception**: configure symbols used to modify CException's compiled features
-
-* `defines`:
-
- List of conditional compilation symbols used to configure CException's
- features in its source and header files. See CException documentation
- to understand available options. No symbols must be set unless the
- defaults are inappropriate for your specific environment.
-
- **Default**: [] (empty)
-
-
-**unity**: configure symbols used to modify Unity's compiled features
-
-* `defines`:
-
- List of conditional compilation symbols used to configure Unity's
- features in its source and header files. See Unity documentation to
- understand available options. No symbols must be set unless the
- defaults are inappropriate for your specific environment. Most Unity
- defines can be easily configured through the YAML file.
-
- **Default**: [] (empty)
-
-Example [:unity] YAML blurbs
-```yaml
-:unity: #itty bitty processor & toolchain with limited test execution options
- :defines:
- - UNITY_INT_WIDTH=16 #16 bit processor without support for 32 bit instructions
- - UNITY_EXCLUDE_FLOAT #no floating point unit
-
-:unity: #great big gorilla processor that grunts and scratches
- :defines:
- - UNITY_SUPPORT_64 #big memory, big counters, big registers
- - UNITY_LINE_TYPE=\"unsigned int\" #apparently we're using really long test files,
- - UNITY_COUNTER_TYPE=\"unsigned int\" #and we've got a ton of test cases in those test files
- - UNITY_FLOAT_TYPE=\"double\" #you betcha
-```
-
-
-Notes on Unity configuration:
-
-* **Verification** - Ceedling does no verification of your configuration
- values. In a properly configured setup, your Unity configuration
- values are processed, collected together with any test define symbols
- you specify elsewhere, and then passed to your toolchain during test
- compilation. Unity's conditional compilation statements, your
- toolchain's preprocessor, and/or your toolchain's compiler will
- complain appropriately if your specified configuration values are
- incorrect, incomplete, or incompatible.
-
-* **Routing $stdout** - Unity defaults to using `putchar()` in C's
- standard library to display test results. For more exotic environments
- than a desktop with a terminal (e.g. running tests directly on a
- non-PC target), you have options. For example, you could create a
- routine that transmits a character via RS232 or USB. Once you have
- that routine, you can replace `putchar()` calls in Unity by overriding
- the function-like macro `UNITY_OUTPUT_CHAR`. Consult your toolchain
- and shell documentation. Eventhough this can also be defined in the YAML file
- most shell environments do not handle parentheses as command line arguments
- very well. To still be able to add this functionality all necessary
- options can be defined in the `unity_config.h`. Unity needs to be told to look for
- the `unity_config.h` in the YAML file, though.
-
-Example [:unity] YAML blurbs
-```yaml
-:unity:
- :defines:
- - UNITY_INCLUDE_CONFIG_H
-```
-
-Example unity_config.h
-```
-#ifndef UNITY_CONFIG_H
-#define UNITY_CONFIG_H
-
-#include "uart_output.h" //Helper library for your custom environment
-
-#define UNITY_INT_WIDTH 16
-#define UNITY_OUTPUT_START() uart_init(F_CPU, BAUD) //Helperfunction to init UART
-#define UNITY_OUTPUT_CHAR(a) uart_putchar(a) //Helperfunction to forward char via UART
-#define UNITY_OUTPUT_COMPLETE() uart_complete() //Helperfunction to inform that test has ended
-
-#endif
-```
-
-
-**tools**: a means for representing command line tools for use under
-Ceedling's automation framework
-
-Ceedling requires a variety of tools to work its magic. By default,
-the GNU toolchain (gcc, cpp, as) are configured and ready for
-use with no additions to the project configuration YAML file.
-However, as most work will require a project-specific toolchain,
-Ceedling provides a generic means for specifying / overriding
-tools.
-
-* `test_compiler`:
-
- Compiler for test & source-under-test code
- ${1}: input source ${2}: output object ${3}: optional output list ${4}: optional output dependencies file
-
- **Default**: gcc
-
-* `test_linker`:
-
- Linker to generate test fixture executables
- ${1}: input objects ${2}: output binary ${3}: optional output map ${4}: optional library list
-
- **Default**: gcc
-
-* `test_fixture`:
-
- Executable test fixture
- ${1}: simulator as executable with ${1} as input binary file argument or native test executable
-
- **Default**: ${1}
-
-* `test_includes_preprocessor`:
-
- Extractor of #include statements
- ${1}: input source file
-
- **Default**: cpp
-
-* `test_file_preprocessor`:
-
- Preprocessor of test files (macros, conditional compilation statements)
- ${1}: input source file ${2}: preprocessed output source file
-
- **Default**: gcc
-
-* `test_dependencies_generator`:
-
- Discovers deep dependencies of source & test (for incremental builds)
- ${1}: input source file ${2}: compiled object filepath ${3}: output dependencies file
-
- **Default**: gcc
-
-* `release_compiler`:
-
- Compiler for release source code
- ${1}: input source ${2}: output object ${3}: optional output list ${4}: optional output dependencies file
-
- **Default**: gcc
-
-* `release_assembler`:
-
- Assembler for release assembly code
- ${1}: input assembly source file ${2}: output object file
-
- **Default**: as
-
-* `release_linker`:
-
- Linker for release source code
- ${1}: input objects ${2}: output binary ${3}: optional output map ${4}: optional library list
-
- **Default**: gcc
-
-* `release_dependencies_generator`:
-
- Discovers deep dependencies of source files (for incremental builds)
- ${1}: input source file ${2}: compiled object filepath ${3}: output dependencies file
-
- **Default**: gcc
-
-
-A Ceedling tool has a handful of configurable elements:
-
-1. [:executable] (required) - Command line executable having
- the form of:
-
-2. [:arguments] (required) - List of command line arguments
- and substitutions
-
-3. [:name] - Simple name (e.g. "nickname") of tool beyond its
- executable name (if not explicitly set then Ceedling will
- form a name from the tool's YAML entry name)
-
-4. [:stderr_redirect] - Control of capturing $stderr messages
- {:none, :auto, :win, :unix, :tcsh}.
- Defaults to :none if unspecified; create a custom entry by
- specifying a simple string instead of any of the available
- symbols.
-
-5. [:background_exec] - Control execution as background process
- {:none, :auto, :win, :unix}.
- Defaults to :none if unspecified.
-
-
-Tool Element Runtime Substitution
----------------------------------
-
-To accomplish useful work on multiple files, a configured tool will most
-often require that some number of its arguments or even the executable
-itself change for each run. Consequently, every tool's argument list and
-executable field possess two means for substitution at runtime. Ceedling
-provides two kinds of inline Ruby execution and a notation for
-populating elements with dynamically gathered values within the build
-environment.
-
-Tool Element Runtime Substitution: Inline Ruby Execution
---------------------------------------------------------
-
-In-line Ruby execution works similarly to that demonstrated for the
-[:environment] section except that substitution occurs as the tool is
-executed and not at the time the configuration file is first scanned.
-
-* `#{...}`:
-
- Ruby string substitution pattern wherein the containing string is
- expanded to include the string generated by Ruby code between the
- braces. Multiple instances of this expansion can occur within a single
- tool element entry string. Note that if this string substitution
- pattern occurs at the very beginning of a string in the YAML
- configuration the entire string should be enclosed in quotes (see the
- [:environment] section for further explanation on this point).
-
-* `{...} `:
-
- If an entire tool element string is enclosed with braces, it signifies
- that Ceedling should execute the Ruby code contained within those
- braces. Say you have a collection of paths on disk and some of those
- paths include spaces. Further suppose that a single tool that must use
- those paths requires those spaces to be escaped, but all other uses of
- those paths requires the paths to remain unchanged. You could use this
- Ceedling feature to insert Ruby code that iterates those paths and
- escapes those spaces in the array as used by the tool of this example.
-
-Tool Element Runtime Substitution: Notational Substitution
-----------------------------------------------------------
-
-A Ceedling tool's other form of dynamic substitution relies on a '$'
-notation. These '$' operators can exist anywhere in a string and can be
-decorated in any way needed. To use a literal '$', escape it as '\\$'.
-
-* `$`:
-
- Simple substitution for value(s) globally available within the runtime
- (most often a string or an array).
-
-* `${#}`:
-
- When a Ceedling tool's command line is expanded from its configured
- representation and used within Ceedling Ruby code, certain calls to
- that tool will be made with a parameter list of substitution values.
- Each numbered substitution corresponds to a position in a parameter
- list. Ceedling Ruby code expects that configured compiler and linker
- tools will contain ${1} and ${2} replacement arguments. In the case of
- a compiler ${1} will be a C code file path, and ${2} will be the file
- path of the resulting object file. For a linker ${1} will be an array
- of object files to link, and ${2} will be the resulting binary
- executable. For an executable test fixture ${1} is either the binary
- executable itself (when using a local toolchain such as gcc) or a
- binary input file given to a simulator in its arguments.
-
-
-Example [:tools] YAML blurbs
-
-```yaml
-:tools:
- :test_compiler:
- :executable: compiler #exists in system search path
- :name: 'acme test compiler'
- :arguments:
- - -I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE #expands to -I search paths
- - -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR #expands to -I search paths
- - -D$: COLLECTION_DEFINES_TEST_AND_VENDOR #expands to all -D defined symbols
- - --network-license #simple command line argument
- - -optimize-level 4 #simple command line argument
- - "#{`args.exe -m acme.prj`}" #in-line ruby sub to shell out & build string of arguments
- - -c ${1} #source code input file (Ruby method call param list sub)
- - -o ${2} #object file output (Ruby method call param list sub)
- :test_linker:
- :executable: /programs/acme/bin/linker.exe #absolute file path
- :name: 'acme test linker'
- :arguments:
- - ${1} #list of object files to link (Ruby method call param list sub)
- - -l$-lib: #inline yaml array substitution to link in foo-lib and bar-lib
- - foo
- - bar
- - -o ${2} #executable file output (Ruby method call param list sub)
- :test_fixture:
- :executable: tools/bin/acme_simulator.exe #relative file path to command line simulator
- :name: 'acme test fixture'
- :stderr_redirect: :win #inform Ceedling what model of $stderr capture to use
- :arguments:
- - -mem large #simple command line argument
- - -f "${1}" #binary executable input file to simulator (Ruby method call param list sub)
-```
-
-Resulting command line constructions from preceding example [:tools] YAML blurbs
-
- > compiler -I"/usr/include” -I”project/tests”
- -I"project/tests/support” -I”project/source” -I”project/include”
- -DTEST -DLONG_NAMES -network-license -optimize-level 4 arg-foo
- arg-bar arg-baz -c project/source/source.c -o
- build/tests/out/source.o
-
-[notes: (1.) "arg-foo arg-bar arg-baz" is a fabricated example
-string collected from $stdout as a result of shell execution
-of args.exe
-(2.) the -c and -o arguments are
-fabricated examples simulating a single compilation step for
-a test; ${1} & ${2} are single files]
-
- > \programs\acme\bin\linker.exe thing.o unity.o
- test_thing_runner.o test_thing.o mock_foo.o mock_bar.o -lfoo-lib
- -lbar-lib -o build\tests\out\test_thing.exe
-
-[note: in this scenario ${1} is an array of all the object files
-needed to link a test fixture executable]
-
- > tools\bin\acme_simulator.exe -mem large -f "build\tests\out\test_thing.bin 2>&1”
-
-[note: (1.) :executable could have simply been ${1} - if we were compiling
-and running native executables instead of cross compiling (2.) we're using
-$stderr redirection to allow us to capture simulator error messages to
-$stdout for display at the run's conclusion]
-
-
-Notes:
-
-* The upper case names are Ruby global constants that Ceedling
- builds
-
-* "COLLECTION_" indicates that Ceedling did some work to assemble
- the list. For instance, expanding path globs, combining multiple
- path globs into a convenient summation, etc.
-
-* At present, $stderr redirection is primarily used to capture
- errors from test fixtures so that they can be displayed at the
- conclusion of a test run. For instance, if a simulator detects
- a memory access violation or a divide by zero error, this notice
- might go unseen in all the output scrolling past in a terminal.
-
-* The preprocessing tools can each be overridden with non-gcc
- equivalents. However, this is an advanced feature not yet
- documented and requires that the replacement toolchain conform
- to the same conventions used by gcc.
-
-**Ceedling Collection Used in Compilation**:
-
-* `COLLECTION_PATHS_TEST`:
-
- All test paths
-
-* `COLLECTION_PATHS_SOURCE`:
-
- All source paths
-
-* `COLLECTION_PATHS_INCLUDE`:
-
- All include paths
-
-* `COLLECTION_PATHS_SUPPORT`:
-
- All test support paths
-
-* `COLLECTION_PATHS_SOURCE_AND_INCLUDE`:
-
- All source and include paths
-
-* `COLLECTION_PATHS_SOURCE_INCLUDE_VENDOR`:
-
- All source and include paths + applicable vendor paths (e.g.
- CException's source path if exceptions enabled)
-
-* `COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE`:
-
- All test toolchain include paths
-
-* `COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE`:
-
- All test, source, and include paths
-
-* `COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR`:
-
- All test, source, include, and applicable vendor paths (e.g. Unity's
- source path plus CMock and CException's source paths if mocks and
- exceptions are enabled)
-
-* `COLLECTION_PATHS_RELEASE_TOOLCHAIN_INCLUDE`:
-
- All release toolchain include paths
-
-* `COLLECTION_DEFINES_TEST_AND_VENDOR`:
-
- All symbols specified in [:defines][:test] + symbols defined for
- enabled vendor tools - e.g. [:unity][:defines], [:cmock][:defines],
- and [:cexception][:defines]
-
-* `COLLECTION_DEFINES_RELEASE_AND_VENDOR`:
-
- All symbols specified in [:defines][:release] plus symbols defined by
-[:cexception][:defines] if exceptions are ena bled
-
-
-Notes:
-
-* Other collections exist within Ceedling. However, they are
- only useful for advanced features not yet documented.
-
-* Wherever multiple path lists are combined for use Ceedling prioritizes
- path groups as follows: test paths, support paths, source paths, include
- paths.
- This can be useful, for instance, in certain testing scenarios
- where we desire Ceedling or the compiler to find a stand-in header file
- before the actual source header file of the same name.
-
-
-**plugins**: Ceedling extensions
-
-* `load_paths`:
-
- Base paths to search for plugin subdirectories or extra ruby functionalit
-
- **Default**: [] (empty)
-
-* `enabled`:
-
- List of plugins to be used - a plugin's name is identical to the
- subdirectory that contains it (and the name of certain files within
- that subdirectory)
-
- **Default**: [] (empty)
-
-
-Plugins can provide a variety of added functionality to Ceedling. In
-general use, it's assumed that at least one reporting plugin will be
-used to format test results. However, if no reporting plugins are
-specified, Ceedling will print to `$stdout` the (quite readable) raw
-test results from all test fixtures executed.
-
-Example [:plugins] YAML blurb
-
-```yaml
-:plugins:
- :load_paths:
- - project/tools/ceedling/plugins #home to your collection of plugin directories
- - project/support #maybe home to some ruby code your custom plugins share
- :enabled:
- - stdout_pretty_tests_report #nice test results at your command line
- - our_custom_code_metrics_report #maybe you needed line count and complexity metrics, so you
- #created a plugin to scan all your code and collect that info
-```
-
-* `stdout_pretty_tests_report`:
-
- Prints to $stdout a well-formatted list of ignored and failed tests,
- final test counts, and any extraneous output (e.g. printf statements
- or simulator memory errors) collected from executing the test
- fixtures. Meant to be used with runs at the command line.
-
-* `stdout_ide_tests_report`:
-
- Prints to $stdout simple test results formatted such that an IDE
- executing test-related Rake tasks can recognize file paths and line
- numbers in test failures, etc. Thus, you can click a test result in
- your IDE's execution window and jump to the failure (or ignored test)
- in your test file (obviously meant to be used with an [IDE like
- Eclipse][ide], etc).
-
- [ide]: http://throwtheswitch.org/white-papers/using-with-ides.html
-
-* `xml_tests_report`:
-
- Creates an XML file of test results in the xUnit format (handy for
- Continuous Integration build servers or as input to other reporting
- tools). Produces a file report.xml in <build root>/artifacts/tests.
-
-* `bullseye`:
-
- Adds additional Rake tasks to execute tests with the commercial code
- coverage tool provided by [Bullseye][]. See readme.txt inside the bullseye
- plugin directory for configuration and use instructions. Note:
- Bullseye only works with certain compilers and linkers (healthy list
- of supported toolchains though).
-
- [bullseye]: http://www.bullseye.com
-
-* `gcov`:
-
- Adds additional Rake tasks to execute tests with the GNU code coverage
- tool [gcov][]. See readme.txt inside the gcov directory for configuration
- and use instructions. Only works with GNU compiler and linker.
-
- [gcov]: http://gcc.gnu.org/onlinedocs/gcc/Gcov.html
-
-* `warnings_report`:
-
- Scans compiler and linker `$stdout / $stderr` output for the word
- 'warning' (case insensitive). All code warnings (or tool warnings) are
- logged to a file warnings.log in the appropriate `<build
- root>/artifacts` directory (e.g. test/ for test tasks, `release/` for a
- release build, or even `bullseye/` for bullseye runs).
-
-Module Generator
-========================
-Ceedling includes a plugin called module_generator that will create a source, header and test file for you.
-There are several possibilities to configure this plugin through your project.yml to suit your project's needs.
-
-Directory Structure
--------------------------------------------
-
-The default configuration for directory/project structure is:
-```yaml
-:module_generator:
- :project_root: ./
- :source_root: src/
- :test_root: test/
-```
-You can change these variables in your project.yml file to comply with your project's directory structure.
-
-If you call `ceedling module:create`, it will create three files:
-1. A source file in the source_root
-2. A header file in the source_root
-3. A test file in the test_root
-
-If you want your header file to be in another location,
-you can specify the ':inc_root:" in your project.yml file:
-```yaml
-:module_generator:
- :inc_root: inc/
-```
-The module_generator will then create the header file in your defined ':inc_root:'.
-By default, ':inc_root:' is not defined so the module_generator will use the source_root.
-
-Sometimes, your project can't be divided into a single src, inc, and test folder. You have several directories
-with sources/..., something like this for example:
-<project_root>
- - myDriver
- - src
- - inc
- - test
- - myOtherDriver
- - src
- - inc
- - test
- - ...
-
-Don't worry, you don't have to manually create the source/header/test files.
-The module_generator can accept a path to create a source_root/inc_root/test_root folder with your files:
-`ceedling module:create[<module_root_path>:<module_name>]`
-
-F.e., applied to the above project structure:
-`ceedling module:create[myOtherDriver:driver]`
-This will make the module_generator run in the subdirectory 'myOtherDriver' and generate the module files
-for you in that directory. So, this command will generate the following files:
-1. A source file 'driver.c' in <project_root>/myOtherDriver/<source_root>
-2. A header file 'driver.h' in <project_root>/myOtherDriver/<source_root> (or <inc_root> if specified)
-3. A test file 'test_driver.c' in <project_root>/myOtherDriver/<test_root>
-
-Naming
--------------------------------------------
-By default, the module_generator will generate your files in lowercase.
-`ceedling module:create[mydriver]` and `ceedling module:create[myDriver]`(note the uppercase) will generate the same files:
-1. mydriver.c
-2. mydriver.h
-3. test_mydriver.c
-
-You can configure the module_generator to use a differect naming mechanism through the project.yml:
-```yaml
-:module_generator:
- :naming: "camel"
-```
-There are other possibilities as well (bumpy, camel, snake, caps).
-Refer to the unity module generator for more info (the unity module generator is used under the hood by module_generator).
-
-Advanced Topics (Coming)
-========================
-
-Modifying Your Configuration without Modifying Your Project File: Option Files & User Files
--------------------------------------------------------------------------------------------
-
-Modifying your project file without modifying your project file
-
-Debugging and/or printf()
--------------------------
-
-When you gotta get your hands dirty...
-
-Ceedling Plays Nice with Others - Using Ceedling for Tests Alongside Another Release Build Setup
-------------------------------------------------------------------------------------------------
-
-You've got options.
-
-Adding Handy Rake Tasks for Your Project (without Fancy Pants Custom Plugins)
------------------------------------------------------------------------------
-
-Simple as snot.
-
-Working with Non-Desktop Testing Environments
----------------------------------------------
-
-For those crazy platforms lacking command line simulators and for which
-cross-compiling on the desktop just ain't gonna get it done.
-
-Creating Custom Plugins
------------------------
-
-Oh boy. This is going to take some explaining.
diff --git a/tinyusb/test/vendor/ceedling/docs/ThrowTheSwitchCodingStandard.md b/tinyusb/test/vendor/ceedling/docs/ThrowTheSwitchCodingStandard.md
deleted file mode 100755
index bf4c099b..00000000
--- a/tinyusb/test/vendor/ceedling/docs/ThrowTheSwitchCodingStandard.md
+++ /dev/null
@@ -1,206 +0,0 @@
-# ThrowTheSwitch.org Coding Standard
-
-Hi. Welcome to the coding standard for ThrowTheSwitch.org. For the most part,
-we try to follow these standards to unify our contributors' code into a cohesive
-unit (puns intended). You might find places where these standards aren't
-followed. We're not perfect. Please be polite where you notice these discrepancies
-and we'll try to be polite when we notice yours.
-
-;)
-
-
-## Why Have A Coding Standard?
-
-Being consistent makes code easier to understand. We've tried to keep
-our standard simple because we also believe that we can only expect someone to
-follow something that is understandable. Please do your best.
-
-
-## Our Philosophy
-
-Before we get into details on syntax, let's take a moment to talk about our
-vision for these tools. We're C developers and embedded software developers.
-These tools are great to test any C code, but catering to embedded software has
-made us more tolerant of compiler quirks. There are a LOT of quirky compilers
-out there. By quirky I mean "doesn't follow standards because they feel like
-they have a license to do as they wish."
-
-Our philosophy is "support every compiler we can". Most often, this means that
-we aim for writing C code that is standards compliant (often C89... that seems
-to be a sweet spot that is almost always compatible). But it also means these
-tools are tolerant of things that aren't common. Some that aren't even
-compliant. There are configuration options to override the size of standard
-types. There are configuration options to force Unity to not use certain
-standard library functions. A lot of Unity is configurable and we have worked
-hard to make it not TOO ugly in the process.
-
-Similarly, our tools that parse C do their best. They aren't full C parsers
-(yet) and, even if they were, they would still have to accept non-standard
-additions like gcc extensions or specifying `@0x1000` to force a variable to
-compile to a particular location. It's just what we do, because we like
-everything to Just Work™.
-
-Speaking of having things Just Work™, that's our second philosophy. By that, we
-mean that we do our best to have EVERY configuration option have a logical
-default. We believe that if you're working with a simple compiler and target,
-you shouldn't need to configure very much... we try to make the tools guess as
-much as they can, but give the user the power to override it when it's wrong.
-
-
-## Naming Things
-
-Let's talk about naming things. Programming is all about naming things. We name
-files, functions, variables, and so much more. While we're not always going to
-find the best name for something, we actually put a bit of effort into
-finding *What Something WANTS to be Called*™.
-
-When naming things, we follow this hierarchy, the first being the
-most important to us (but we do all four when possible):
-1. Readable
-2. Descriptive
-3. Consistent
-4. Memorable
-
-
-#### Readable
-
-We want to read our code. This means we like names and flow that are more
-naturally read. We try to avoid double negatives. We try to avoid cryptic
-abbreviations (sticking to ones we feel are common).
-
-
-#### Descriptive
-
-We like descriptive names for things, especially functions and variables.
-Finding the right name for something is an important endeavor. You might notice
-from poking around our code that this often results in names that are a little
-longer than the average. Guilty. We're okay with a bit more typing if it
-means our code is easier to understand.
-
-There are two exceptions to this rule that we also stick to as religiously as
-possible:
-
-First, while we realize hungarian notation (and similar systems for encoding
-type information into variable names) is providing a more descriptive name, we
-feel that (for the average developer) it takes away from readability and is to be avoided.
-
-Second, loop counters and other local throw-away variables often have a purpose
-which is obvious. There's no need, therefore, to get carried away with complex
-naming. We find i, j, and k are better loop counters than loopCounterVar or
-whatnot. We only break this rule when we see that more description could improve
-understanding of an algorithm.
-
-
-#### Consistent
-
-We like consistency, but we're not really obsessed with it. We try to name our
-configuration macros in a consistent fashion... you'll notice a repeated use of
-UNITY_EXCLUDE_BLAH or UNITY_USES_BLAH macros. This helps users avoid having to
-remember each macro's details.
-
-
-#### Memorable
-
-Where ever it doesn't violate the above principles, we try to apply memorable
-names. Sometimes this means using something that is simply descriptive, but
-often we strive for descriptive AND unique... we like quirky names that stand
-out in our memory and are easier to search for. Take a look through the file
-names in Ceedling and you'll get a good idea of what we are talking about here.
-Why use preprocess when you can use preprocessinator? Or what better describes a
-module in charge of invoking tasks during releases than release_invoker? Don't
-get carried away. The names are still descriptive and fulfill the above
-requirements, but they don't feel stale.
-
-
-## C and C++ Details
-
-We don't really want to add to the style battles out there. Tabs or spaces?
-How many spaces? Where do the braces go? These are age-old questions that will
-never be answered... or at least not answered in a way that will make everyone
-happy.
-
-We've decided on our own style preferences. If you'd like to contribute to these
-projects (and we hope that you do), then we ask if you do your best to follow
-the same. It will only hurt a little. We promise.
-
-
-#### Whitespace
-
-Our C-style is to use spaces and to use 4 of them per indent level. It's a nice
-power-of-2 number that looks decent on a wide-screen. We have no more reason
-than that. We break that rule when we have lines that wrap (macros or function
-arguments or whatnot). When that happens, we like to indent further to line
-things up in nice tidy columns.
-
-```C
- if (stuff_happened)
- {
- do_something();
- }
-```
-
-
-#### Case
-
-- Files - all lower case with underscores.
-- Variables - all lower case with underscores
-- Macros - all caps with underscores.
-- Typedefs - all caps with underscores. (also ends with _T).
-- Functions - camel cased. Usually named ModuleName_FuncName
-- Constants and Globals - camel cased.
-
-
-#### Braces
-
-The left brace is on the next line after the declaration. The right brace is
-directly below that. Everything in between in indented one level. If you're
-catching an error and you have a one-line, go ahead and to it on the same line.
-
-```C
- while (blah)
- {
- //Like so. Even if only one line, we use braces.
- }
-```
-
-
-#### Comments
-
-Do you know what we hate? Old-school C block comments. BUT, we're using them
-anyway. As we mentioned, our goal is to support every compiler we can,
-especially embedded compilers. There are STILL C compilers out there that only
-support old-school block comments. So that is what we're using. We apologize. We
-think they are ugly too.
-
-
-## Ruby Details
-
-Is there really such thing as a Ruby coding standard? Ruby is such a free form
-language, it seems almost sacrilegious to suggest that people should comply to
-one method! We'll keep it really brief!
-
-
-#### Whitespace
-
-Our Ruby style is to use spaces and to use 2 of them per indent level. It's a
-nice power-of-2 number that really grooves with Ruby's compact style. We have no
-more reason than that. We break that rule when we have lines that wrap. When
-that happens, we like to indent further to line things up in nice tidy columns.
-
-
-#### Case
-
-- Files - all lower case with underscores.
-- Variables - all lower case with underscores
-- Classes, Modules, etc - Camel cased.
-- Functions - all lower case with underscores
-- Constants - all upper case with underscores
-
-
-## Documentation
-
-Egad. Really? We use mark down and we like pdf files because they can be made to
-look nice while still being portable. Good enough?
-
-
-*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)*
diff --git a/tinyusb/test/vendor/ceedling/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf b/tinyusb/test/vendor/ceedling/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf
deleted file mode 100755
index 28f0c321..00000000
--- a/tinyusb/test/vendor/ceedling/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf
+++ /dev/null
Binary files differ
diff --git a/tinyusb/test/vendor/ceedling/docs/UnityAssertionsReference.md b/tinyusb/test/vendor/ceedling/docs/UnityAssertionsReference.md
deleted file mode 100755
index eb855f3c..00000000
--- a/tinyusb/test/vendor/ceedling/docs/UnityAssertionsReference.md
+++ /dev/null
@@ -1,779 +0,0 @@
-# Unity Assertions Reference
-
-## Background and Overview
-
-### Super Condensed Version
-
-- An assertion establishes truth (i.e. boolean True) for a single condition.
-Upon boolean False, an assertion stops execution and reports the failure.
-- Unity is mainly a rich collection of assertions and the support to gather up
-and easily execute those assertions.
-- The structure of Unity allows you to easily separate test assertions from
-source code in, well, test code.
-- Unity's assertions:
-- Come in many, many flavors to handle different C types and assertion cases.
-- Use context to provide detailed and helpful failure messages.
-- Document types, expected values, and basic behavior in your source code for
-free.
-
-
-### Unity Is Several Things But Mainly It's Assertions
-
-One way to think of Unity is simply as a rich collection of assertions you can
-use to establish whether your source code behaves the way you think it does.
-Unity provides a framework to easily organize and execute those assertions in
-test code separate from your source code.
-
-
-### What's an Assertion?
-
-At their core, assertions are an establishment of truth - boolean truth. Was this
-thing equal to that thing? Does that code doohickey have such-and-such property
-or not? You get the idea. Assertions are executable code (to appreciate the big
-picture on this read up on the difference between
-[link:Dynamic Verification and Static Analysis]). A failing assertion stops
-execution and reports an error through some appropriate I/O channel (e.g.
-stdout, GUI, file, blinky light).
-
-Fundamentally, for dynamic verification all you need is a single assertion
-mechanism. In fact, that's what the [assert() macro in C's standard library](http://en.wikipedia.org/en/wiki/Assert.h)
-is for. So why not just use it? Well, we can do far better in the reporting
-department. C's `assert()` is pretty dumb as-is and is particularly poor for
-handling common data types like arrays, structs, etc. And, without some other
-support, it's far too tempting to litter source code with C's `assert()`'s. It's
-generally much cleaner, manageable, and more useful to separate test and source
-code in the way Unity facilitates.
-
-
-### Unity's Assertions: Helpful Messages _and_ Free Source Code Documentation
-
-Asserting a simple truth condition is valuable, but using the context of the
-assertion is even more valuable. For instance, if you know you're comparing bit
-flags and not just integers, then why not use that context to give explicit,
-readable, bit-level feedback when an assertion fails?
-
-That's what Unity's collection of assertions do - capture context to give you
-helpful, meaningful assertion failure messages. In fact, the assertions
-themselves also serve as executable documentation about types and values in your
-source code. So long as your tests remain current with your source and all those
-tests pass, you have a detailed, up-to-date view of the intent and mechanisms in
-your source code. And due to a wondrous mystery, well-tested code usually tends
-to be well designed code.
-
-
-## Assertion Conventions and Configurations
-
-### Naming and Parameter Conventions
-
-The convention of assertion parameters generally follows this order:
-
- TEST_ASSERT_X( {modifiers}, {expected}, actual, {size/count} )
-
-The very simplest assertion possible uses only a single "actual" parameter (e.g.
-a simple null check).
-
-"Actual" is the value being tested and unlike the other parameters in an
-assertion construction is the only parameter present in all assertion variants.
-"Modifiers" are masks, ranges, bit flag specifiers, floating point deltas.
-"Expected" is your expected value (duh) to compare to an "actual" value; it's
-marked as an optional parameter because some assertions only need a single
-"actual" parameter (e.g. null check).
-"Size/count" refers to string lengths, number of array elements, etc.
-
-Many of Unity's assertions are clear duplications in that the same data type
-is handled by several assertions. The differences among these are in how failure
-messages are presented. For instance, a `_HEX` variant of an assertion prints
-the expected and actual values of that assertion formatted as hexadecimal.
-
-
-#### TEST_ASSERT_X_MESSAGE Variants
-
-_All_ assertions are complemented with a variant that includes a simple string
-message as a final parameter. The string you specify is appended to an assertion
-failure message in Unity output.
-
-For brevity, the assertion variants with a message parameter are not listed
-below. Just tack on `_MESSAGE` as the final component to any assertion name in
-the reference list below and add a string as the final parameter.
-
-_Example:_
-
- TEST_ASSERT_X( {modifiers}, {expected}, actual, {size/count} )
-
-becomes messageified like thus...
-
- TEST_ASSERT_X_MESSAGE( {modifiers}, {expected}, actual, {size/count}, message )
-
-Notes:
-- The `_MESSAGE` variants intentionally do not support `printf` style formatting
- since many embedded projects don't support or avoid `printf` for various reasons.
- It is possible to use `sprintf` before the assertion to assemble a complex fail
- message, if necessary.
-- If you want to output a counter value within an assertion fail message (e.g. from
- a loop) , building up an array of results and then using one of the `_ARRAY`
- assertions (see below) might be a handy alternative to `sprintf`.
-
-
-#### TEST_ASSERT_X_ARRAY Variants
-
-Unity provides a collection of assertions for arrays containing a variety of
-types. These are documented in the Array section below. These are almost on par
-with the `_MESSAGE`variants of Unity's Asserts in that for pretty much any Unity
-type assertion you can tack on `_ARRAY` and run assertions on an entire block of
-memory.
-
- TEST_ASSERT_EQUAL_TYPEX_ARRAY( expected, actual, {size/count} )
-
-"Expected" is an array itself.
-"Size/count" is one or two parameters necessary to establish the number of array
-elements and perhaps the length of elements within the array.
-
-Notes:
-- The `_MESSAGE` variant convention still applies here to array assertions. The
-`_MESSAGE` variants of the `_ARRAY` assertions have names ending with
-`_ARRAY_MESSAGE`.
-- Assertions for handling arrays of floating point values are grouped with float
-and double assertions (see immediately following section).
-
-
-### TEST_ASSERT_EACH_EQUAL_X Variants
-
-Unity provides a collection of assertions for arrays containing a variety of
-types which can be compared to a single value as well. These are documented in
-the Each Equal section below. these are almost on par with the `_MESSAGE`
-variants of Unity's Asserts in that for pretty much any Unity type assertion you
-can inject _EACH_EQUAL and run assertions on an entire block of memory.
-
- TEST_ASSERT_EACH_EQUAL_TYPEX( expected, actual, {size/count} )
-
-"Expected" is a single value to compare to.
-"Actual" is an array where each element will be compared to the expected value.
-"Size/count" is one of two parameters necessary to establish the number of array
-elements and perhaps the length of elements within the array.
-
-Notes:
-- The `_MESSAGE` variant convention still applies here to Each Equal assertions.
-- Assertions for handling Each Equal of floating point values are grouped with
-float and double assertions (see immediately following section).
-
-
-### Configuration
-
-#### Floating Point Support Is Optional
-
-Support for floating point types is configurable. That is, by defining the
-appropriate preprocessor symbols, floats and doubles can be individually enabled
-or disabled in Unity code. This is useful for embedded targets with no floating
-point math support (i.e. Unity compiles free of errors for fixed point only
-platforms). See Unity documentation for specifics.
-
-
-#### Maximum Data Type Width Is Configurable
-
-Not all targets support 64 bit wide types or even 32 bit wide types. Define the
-appropriate preprocessor symbols and Unity will omit all operations from
-compilation that exceed the maximum width of your target. See Unity
-documentation for specifics.
-
-
-## The Assertions in All Their Blessed Glory
-
-### Basic Fail and Ignore
-
-##### `TEST_FAIL()`
-
-This fella is most often used in special conditions where your test code is
-performing logic beyond a simple assertion. That is, in practice, `TEST_FAIL()`
-will always be found inside a conditional code block.
-
-_Examples:_
-- Executing a state machine multiple times that increments a counter your test
-code then verifies as a final step.
-- Triggering an exception and verifying it (as in Try / Catch / Throw - see the
-[CException](https://github.com/ThrowTheSwitch/CException) project).
-
-##### `TEST_IGNORE()`
-
-Marks a test case (i.e. function meant to contain test assertions) as ignored.
-Usually this is employed as a breadcrumb to come back and implement a test case.
-An ignored test case has effects if other assertions are in the enclosing test
-case (see Unity documentation for more).
-
-### Boolean
-
-##### `TEST_ASSERT (condition)`
-
-##### `TEST_ASSERT_TRUE (condition)`
-
-##### `TEST_ASSERT_FALSE (condition)`
-
-##### `TEST_ASSERT_UNLESS (condition)`
-
-A simple wording variation on `TEST_ASSERT_FALSE`.The semantics of
-`TEST_ASSERT_UNLESS` aid readability in certain test constructions or
-conditional statements.
-
-##### `TEST_ASSERT_NULL (pointer)`
-
-##### `TEST_ASSERT_NOT_NULL (pointer)`
-
-
-### Signed and Unsigned Integers (of all sizes)
-
-Large integer sizes can be disabled for build targets that do not support them.
-For example, if your target only supports up to 16 bit types, by defining the
-appropriate symbols Unity can be configured to omit 32 and 64 bit operations
-that would break compilation (see Unity documentation for more). Refer to
-Advanced Asserting later in this document for advice on dealing with other word
-sizes.
-
-##### `TEST_ASSERT_EQUAL_INT (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_INT8 (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_INT16 (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_INT32 (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_INT64 (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL (expected, actual)`
-
-##### `TEST_ASSERT_NOT_EQUAL (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_UINT (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_UINT8 (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_UINT16 (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_UINT32 (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_UINT64 (expected, actual)`
-
-
-### Unsigned Integers (of all sizes) in Hexadecimal
-
-All `_HEX` assertions are identical in function to unsigned integer assertions
-but produce failure messages with the `expected` and `actual` values formatted
-in hexadecimal. Unity output is big endian.
-
-##### `TEST_ASSERT_EQUAL_HEX (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_HEX8 (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_HEX16 (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_HEX32 (expected, actual)`
-
-##### `TEST_ASSERT_EQUAL_HEX64 (expected, actual)`
-
-
-### Masked and Bit-level Assertions
-
-Masked and bit-level assertions produce output formatted in hexadecimal. Unity
-output is big endian.
-
-
-##### `TEST_ASSERT_BITS (mask, expected, actual)`
-
-Only compares the masked (i.e. high) bits of `expected` and `actual` parameters.
-
-
-##### `TEST_ASSERT_BITS_HIGH (mask, actual)`
-
-Asserts the masked bits of the `actual` parameter are high.
-
-
-##### `TEST_ASSERT_BITS_LOW (mask, actual)`
-
-Asserts the masked bits of the `actual` parameter are low.
-
-
-##### `TEST_ASSERT_BIT_HIGH (bit, actual)`
-
-Asserts the specified bit of the `actual` parameter is high.
-
-
-##### `TEST_ASSERT_BIT_LOW (bit, actual)`
-
-Asserts the specified bit of the `actual` parameter is low.
-
-### Integer Less Than / Greater Than
-
-These assertions verify that the `actual` parameter is less than or greater
-than `threshold` (exclusive). For example, if the threshold value is 0 for the
-greater than assertion will fail if it is 0 or less.
-
-##### `TEST_ASSERT_GREATER_THAN (threshold, actual)`
-
-##### `TEST_ASSERT_GREATER_THAN_INT (threshold, actual)`
-
-##### `TEST_ASSERT_GREATER_THAN_INT8 (threshold, actual)`
-
-##### `TEST_ASSERT_GREATER_THAN_INT16 (threshold, actual)`
-
-##### `TEST_ASSERT_GREATER_THAN_INT32 (threshold, actual)`
-
-##### `TEST_ASSERT_GREATER_THAN_UINT (threshold, actual)`
-
-##### `TEST_ASSERT_GREATER_THAN_UINT8 (threshold, actual)`
-
-##### `TEST_ASSERT_GREATER_THAN_UINT16 (threshold, actual)`
-
-##### `TEST_ASSERT_GREATER_THAN_UINT32 (threshold, actual)`
-
-##### `TEST_ASSERT_GREATER_THAN_HEX8 (threshold, actual)`
-
-##### `TEST_ASSERT_GREATER_THAN_HEX16 (threshold, actual)`
-
-##### `TEST_ASSERT_GREATER_THAN_HEX32 (threshold, actual)`
-
-##### `TEST_ASSERT_LESS_THAN (threshold, actual)`
-
-##### `TEST_ASSERT_LESS_THAN_INT (threshold, actual)`
-
-##### `TEST_ASSERT_LESS_THAN_INT8 (threshold, actual)`
-
-##### `TEST_ASSERT_LESS_THAN_INT16 (threshold, actual)`
-
-##### `TEST_ASSERT_LESS_THAN_INT32 (threshold, actual)`
-
-##### `TEST_ASSERT_LESS_THAN_UINT (threshold, actual)`
-
-##### `TEST_ASSERT_LESS_THAN_UINT8 (threshold, actual)`
-
-##### `TEST_ASSERT_LESS_THAN_UINT16 (threshold, actual)`
-
-##### `TEST_ASSERT_LESS_THAN_UINT32 (threshold, actual)`
-
-##### `TEST_ASSERT_LESS_THAN_HEX8 (threshold, actual)`
-
-##### `TEST_ASSERT_LESS_THAN_HEX16 (threshold, actual)`
-
-##### `TEST_ASSERT_LESS_THAN_HEX32 (threshold, actual)`
-
-
-### Integer Ranges (of all sizes)
-
-These assertions verify that the `expected` parameter is within +/- `delta`
-(inclusive) of the `actual` parameter. For example, if the expected value is 10
-and the delta is 3 then the assertion will fail for any value outside the range
-of 7 - 13.
-
-##### `TEST_ASSERT_INT_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_INT8_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_INT16_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_INT32_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_INT64_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_UINT_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_UINT8_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_UINT16_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_UINT32_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_UINT64_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_HEX_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_HEX8_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_HEX16_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_HEX32_WITHIN (delta, expected, actual)`
-
-##### `TEST_ASSERT_HEX64_WITHIN (delta, expected, actual)`
-
-
-### Structs and Strings
-
-##### `TEST_ASSERT_EQUAL_PTR (expected, actual)`
-
-Asserts that the pointers point to the same memory location.
-
-
-##### `TEST_ASSERT_EQUAL_STRING (expected, actual)`
-
-Asserts that the null terminated (`'\0'`)strings are identical. If strings are
-of different lengths or any portion of the strings before their terminators
-differ, the assertion fails. Two NULL strings (i.e. zero length) are considered
-equivalent.
-
-
-##### `TEST_ASSERT_EQUAL_MEMORY (expected, actual, len)`
-
-Asserts that the contents of the memory specified by the `expected` and `actual`
-pointers is identical. The size of the memory blocks in bytes is specified by
-the `len` parameter.
-
-
-### Arrays
-
-`expected` and `actual` parameters are both arrays. `num_elements` specifies the
-number of elements in the arrays to compare.
-
-`_HEX` assertions produce failure messages with expected and actual array
-contents formatted in hexadecimal.
-
-For array of strings comparison behavior, see comments for
-`TEST_ASSERT_EQUAL_STRING` in the preceding section.
-
-Assertions fail upon the first element in the compared arrays found not to
-match. Failure messages specify the array index of the failed comparison.
-
-##### `TEST_ASSERT_EQUAL_INT_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_INT8_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_INT16_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_INT32_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_INT64_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_UINT_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_UINT8_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_UINT16_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_UINT32_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_UINT64_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_HEX_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_HEX8_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_HEX16_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_HEX32_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_HEX64_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_PTR_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_STRING_ARRAY (expected, actual, num_elements)`
-
-##### `TEST_ASSERT_EQUAL_MEMORY_ARRAY (expected, actual, len, num_elements)`
-
-`len` is the memory in bytes to be compared at each array element.
-
-
-### Each Equal (Arrays to Single Value)
-
-`expected` are single values and `actual` are arrays. `num_elements` specifies
-the number of elements in the arrays to compare.
-
-`_HEX` assertions produce failure messages with expected and actual array
-contents formatted in hexadecimal.
-
-Assertions fail upon the first element in the compared arrays found not to
-match. Failure messages specify the array index of the failed comparison.
-
-#### `TEST_ASSERT_EACH_EQUAL_INT (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_INT8 (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_INT16 (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_INT32 (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_INT64 (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_UINT (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_UINT8 (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_UINT16 (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_UINT32 (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_UINT64 (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_HEX (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_HEX8 (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_HEX16 (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_HEX32 (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_HEX64 (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_PTR (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_STRING (expected, actual, num_elements)`
-
-#### `TEST_ASSERT_EACH_EQUAL_MEMORY (expected, actual, len, num_elements)`
-
-`len` is the memory in bytes to be compared at each array element.
-
-
-### Floating Point (If enabled)
-
-##### `TEST_ASSERT_FLOAT_WITHIN (delta, expected, actual)`
-
-Asserts that the `actual` value is within +/- `delta` of the `expected` value.
-The nature of floating point representation is such that exact evaluations of
-equality are not guaranteed.
-
-
-##### `TEST_ASSERT_EQUAL_FLOAT (expected, actual)`
-
-Asserts that the ?actual?value is "close enough to be considered equal" to the
-`expected` value. If you are curious about the details, refer to the Advanced
-Asserting section for more details on this. Omitting a user-specified delta in a
-floating point assertion is both a shorthand convenience and a requirement of
-code generation conventions for CMock.
-
-
-##### `TEST_ASSERT_EQUAL_FLOAT_ARRAY (expected, actual, num_elements)`
-
-See Array assertion section for details. Note that individual array element
-float comparisons are executed using T?EST_ASSERT_EQUAL_FLOAT?.That is, user
-specified delta comparison values requires a custom-implemented floating point
-array assertion.
-
-
-##### `TEST_ASSERT_FLOAT_IS_INF (actual)`
-
-Asserts that `actual` parameter is equivalent to positive infinity floating
-point representation.
-
-
-##### `TEST_ASSERT_FLOAT_IS_NEG_INF (actual)`
-
-Asserts that `actual` parameter is equivalent to negative infinity floating
-point representation.
-
-
-##### `TEST_ASSERT_FLOAT_IS_NAN (actual)`
-
-Asserts that `actual` parameter is a Not A Number floating point representation.
-
-
-##### `TEST_ASSERT_FLOAT_IS_DETERMINATE (actual)`
-
-Asserts that ?actual?parameter is a floating point representation usable for
-mathematical operations. That is, the `actual` parameter is neither positive
-infinity nor negative infinity nor Not A Number floating point representations.
-
-
-##### `TEST_ASSERT_FLOAT_IS_NOT_INF (actual)`
-
-Asserts that `actual` parameter is a value other than positive infinity floating
-point representation.
-
-
-##### `TEST_ASSERT_FLOAT_IS_NOT_NEG_INF (actual)`
-
-Asserts that `actual` parameter is a value other than negative infinity floating
-point representation.
-
-
-##### `TEST_ASSERT_FLOAT_IS_NOT_NAN (actual)`
-
-Asserts that `actual` parameter is a value other than Not A Number floating
-point representation.
-
-
-##### `TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE (actual)`
-
-Asserts that `actual` parameter is not usable for mathematical operations. That
-is, the `actual` parameter is either positive infinity or negative infinity or
-Not A Number floating point representations.
-
-
-### Double (If enabled)
-
-##### `TEST_ASSERT_DOUBLE_WITHIN (delta, expected, actual)`
-
-Asserts that the `actual` value is within +/- `delta` of the `expected` value.
-The nature of floating point representation is such that exact evaluations of
-equality are not guaranteed.
-
-
-##### `TEST_ASSERT_EQUAL_DOUBLE (expected, actual)`
-
-Asserts that the `actual` value is "close enough to be considered equal" to the
-`expected` value. If you are curious about the details, refer to the Advanced
-Asserting section for more details. Omitting a user-specified delta in a
-floating point assertion is both a shorthand convenience and a requirement of
-code generation conventions for CMock.
-
-
-##### `TEST_ASSERT_EQUAL_DOUBLE_ARRAY (expected, actual, num_elements)`
-
-See Array assertion section for details. Note that individual array element
-double comparisons are executed using `TEST_ASSERT_EQUAL_DOUBLE`.That is, user
-specified delta comparison values requires a custom implemented double array
-assertion.
-
-
-##### `TEST_ASSERT_DOUBLE_IS_INF (actual)`
-
-Asserts that `actual` parameter is equivalent to positive infinity floating
-point representation.
-
-
-##### `TEST_ASSERT_DOUBLE_IS_NEG_INF (actual)`
-
-Asserts that `actual` parameter is equivalent to negative infinity floating point
-representation.
-
-
-##### `TEST_ASSERT_DOUBLE_IS_NAN (actual)`
-
-Asserts that `actual` parameter is a Not A Number floating point representation.
-
-
-##### `TEST_ASSERT_DOUBLE_IS_DETERMINATE (actual)`
-
-Asserts that `actual` parameter is a floating point representation usable for
-mathematical operations. That is, the ?actual?parameter is neither positive
-infinity nor negative infinity nor Not A Number floating point representations.
-
-
-##### `TEST_ASSERT_DOUBLE_IS_NOT_INF (actual)`
-
-Asserts that `actual` parameter is a value other than positive infinity floating
-point representation.
-
-
-##### `TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF (actual)`
-
-Asserts that `actual` parameter is a value other than negative infinity floating
-point representation.
-
-
-##### `TEST_ASSERT_DOUBLE_IS_NOT_NAN (actual)`
-
-Asserts that `actual` parameter is a value other than Not A Number floating
-point representation.
-
-
-##### `TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE (actual)`
-
-Asserts that `actual` parameter is not usable for mathematical operations. That
-is, the `actual` parameter is either positive infinity or negative infinity or
-Not A Number floating point representations.
-
-
-## Advanced Asserting: Details On Tricky Assertions
-
-This section helps you understand how to deal with some of the trickier
-assertion situations you may run into. It will give you a glimpse into some of
-the under-the-hood details of Unity's assertion mechanisms. If you're one of
-those people who likes to know what is going on in the background, read on. If
-not, feel free to ignore the rest of this document until you need it.
-
-
-### How do the EQUAL assertions work for FLOAT and DOUBLE?
-
-As you may know, directly checking for equality between a pair of floats or a
-pair of doubles is sloppy at best and an outright no-no at worst. Floating point
-values can often be represented in multiple ways, particularly after a series of
-operations on a value. Initializing a variable to the value of 2.0 is likely to
-result in a floating point representation of 2 x 20,but a series of
-mathematical operations might result in a representation of 8 x 2-2
-that also evaluates to a value of 2. At some point repeated operations cause
-equality checks to fail.
-
-So Unity doesn't do direct floating point comparisons for equality. Instead, it
-checks if two floating point values are "really close." If you leave Unity
-running with defaults, "really close" means "within a significant bit or two."
-Under the hood, `TEST_ASSERT_EQUAL_FLOAT` is really `TEST_ASSERT_FLOAT_WITHIN`
-with the `delta` parameter calculated on the fly. For single precision, delta is
-the expected value multiplied by 0.00001, producing a very small proportional
-range around the expected value.
-
-If you are expecting a value of 20,000.0 the delta is calculated to be 0.2. So
-any value between 19,999.8 and 20,000.2 will satisfy the equality check. This
-works out to be roughly a single bit of range for a single-precision number, and
-that's just about as tight a tolerance as you can reasonably get from a floating
-point value.
-
-So what happens when it's zero? Zero - even more than other floating point
-values - can be represented many different ways. It doesn't matter if you have
-0 x 20 or 0 x 263.It's still zero, right? Luckily, if you
-subtract these values from each other, they will always produce a difference of
-zero, which will still fall between 0 plus or minus a delta of 0. So it still
-works!
-
-Double precision floating point numbers use a much smaller multiplier, again
-approximating a single bit of error.
-
-If you don't like these ranges and you want to make your floating point equality
-assertions less strict, you can change these multipliers to whatever you like by
-defining UNITY_FLOAT_PRECISION and UNITY_DOUBLE_PRECISION. See Unity
-documentation for more.
-
-
-### How do we deal with targets with non-standard int sizes?
-
-It's "fun" that C is a standard where something as fundamental as an integer
-varies by target. According to the C standard, an `int` is to be the target's
-natural register size, and it should be at least 16-bits and a multiple of a
-byte. It also guarantees an order of sizes:
-
-```C
-char <= short <= int <= long <= long long
-```
-
-Most often, `int` is 32-bits. In many cases in the embedded world, `int` is
-16-bits. There are rare microcontrollers out there that have 24-bit integers,
-and this remains perfectly standard C.
-
-To make things even more interesting, there are compilers and targets out there
-that have a hard choice to make. What if their natural register size is 10-bits
-or 12-bits? Clearly they can't fulfill _both_ the requirement to be at least
-16-bits AND the requirement to match the natural register size. In these
-situations, they often choose the natural register size, leaving us with
-something like this:
-
-```C
-char (8 bit) <= short (12 bit) <= int (12 bit) <= long (16 bit)
-```
-
-Um... yikes. It's obviously breaking a rule or two... but they had to break SOME
-rules, so they made a choice.
-
-When the C99 standard rolled around, it introduced alternate standard-size types.
-It also introduced macros for pulling in MIN/MAX values for your integer types.
-It's glorious! Unfortunately, many embedded compilers can't be relied upon to
-use the C99 types (Sometimes because they have weird register sizes as described
-above. Sometimes because they don't feel like it?).
-
-A goal of Unity from the beginning was to support every combination of
-microcontroller or microprocessor and C compiler. Over time, we've gotten really
-close to this. There are a few tricks that you should be aware of, though, if
-you're going to do this effectively on some of these more idiosyncratic targets.
-
-First, when setting up Unity for a new target, you're going to want to pay
-special attention to the macros for automatically detecting types
-(where available) or manually configuring them yourself. You can get information
-on both of these in Unity's documentation.
-
-What about the times where you suddenly need to deal with something odd, like a
-24-bit `int`? The simplest solution is to use the next size up. If you have a
-24-bit `int`, configure Unity to use 32-bit integers. If you have a 12-bit
-`int`, configure Unity to use 16 bits. There are two ways this is going to
-affect you:
-
-1. When Unity displays errors for you, it's going to pad the upper unused bits
-with zeros.
-2. You're going to have to be careful of assertions that perform signed
-operations, particularly `TEST_ASSERT_INT_WITHIN`.Such assertions might wrap
-your `int` in the wrong place, and you could experience false failures. You can
-always back down to a simple `TEST_ASSERT` and do the operations yourself.
-
-
-*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)*
diff --git a/tinyusb/test/vendor/ceedling/docs/UnityConfigurationGuide.md b/tinyusb/test/vendor/ceedling/docs/UnityConfigurationGuide.md
deleted file mode 100755
index dace20c5..00000000
--- a/tinyusb/test/vendor/ceedling/docs/UnityConfigurationGuide.md
+++ /dev/null
@@ -1,433 +0,0 @@
-# Unity Configuration Guide
-
-## C Standards, Compilers and Microcontrollers
-
-The embedded software world contains its challenges. Compilers support different
-revisions of the C Standard. They ignore requirements in places, sometimes to
-make the language more usable in some special regard. Sometimes it's to simplify
-their support. Sometimes it's due to specific quirks of the microcontroller they
-are targeting. Simulators add another dimension to this menagerie.
-
-Unity is designed to run on almost anything that is targeted by a C compiler. It
-would be awesome if this could be done with zero configuration. While there are
-some targets that come close to this dream, it is sadly not universal. It is
-likely that you are going to need at least a couple of the configuration options
-described in this document.
-
-All of Unity's configuration options are `#defines`. Most of these are simple
-definitions. A couple are macros with arguments. They live inside the
-unity_internals.h header file. We don't necessarily recommend opening that file
-unless you really need to. That file is proof that a cross-platform library is
-challenging to build. From a more positive perspective, it is also proof that a
-great deal of complexity can be centralized primarily to one place to
-provide a more consistent and simple experience elsewhere.
-
-
-### Using These Options
-
-It doesn't matter if you're using a target-specific compiler and a simulator or
-a native compiler. In either case, you've got a couple choices for configuring
-these options:
-
-1. Because these options are specified via C defines, you can pass most of these
-options to your compiler through command line compiler flags. Even if you're
-using an embedded target that forces you to use their overbearing IDE for all
-configuration, there will be a place somewhere in your project to configure
-defines for your compiler.
-2. You can create a custom `unity_config.h` configuration file (present in your
-toolchain's search paths). In this file, you will list definitions and macros
-specific to your target. All you must do is define `UNITY_INCLUDE_CONFIG_H` and
-Unity will rely on `unity_config.h` for any further definitions it may need.
-
-
-## The Options
-
-### Integer Types
-
-If you've been a C developer for long, you probably already know that C's
-concept of an integer varies from target to target. The C Standard has rules
-about the `int` matching the register size of the target microprocessor. It has
-rules about the `int` and how its size relates to other integer types. An `int`
-on one target might be 16 bits while on another target it might be 64. There are
-more specific types in compilers compliant with C99 or later, but that's
-certainly not every compiler you are likely to encounter. Therefore, Unity has a
-number of features for helping to adjust itself to match your required integer
-sizes. It starts off by trying to do it automatically.
-
-
-##### `UNITY_EXCLUDE_STDINT_H`
-
-The first thing that Unity does to guess your types is check `stdint.h`.
-This file includes defines like `UINT_MAX` that Unity can use to
-learn a lot about your system. It's possible you don't want it to do this
-(um. why not?) or (more likely) it's possible that your system doesn't
-support `stdint.h`. If that's the case, you're going to want to define this.
-That way, Unity will know to skip the inclusion of this file and you won't
-be left with a compiler error.
-
-_Example:_
- #define UNITY_EXCLUDE_STDINT_H
-
-
-##### `UNITY_EXCLUDE_LIMITS_H`
-
-The second attempt to guess your types is to check `limits.h`. Some compilers
-that don't support `stdint.h` could include `limits.h` instead. If you don't
-want Unity to check this file either, define this to make it skip the inclusion.
-
-_Example:_
- #define UNITY_EXCLUDE_LIMITS_H
-
-
-If you've disabled both of the automatic options above, you're going to have to
-do the configuration yourself. Don't worry. Even this isn't too bad... there are
-just a handful of defines that you are going to specify if you don't like the
-defaults.
-
-
-##### `UNITY_INT_WIDTH`
-
-Define this to be the number of bits an `int` takes up on your system. The
-default, if not autodetected, is 32 bits.
-
-_Example:_
- #define UNITY_INT_WIDTH 16
-
-
-##### `UNITY_LONG_WIDTH`
-
-Define this to be the number of bits a `long` takes up on your system. The
-default, if not autodetected, is 32 bits. This is used to figure out what kind
-of 64-bit support your system can handle. Does it need to specify a `long` or a
-`long long` to get a 64-bit value. On 16-bit systems, this option is going to be
-ignored.
-
-_Example:_
- #define UNITY_LONG_WIDTH 16
-
-
-##### `UNITY_POINTER_WIDTH`
-
-Define this to be the number of bits a pointer takes up on your system. The
-default, if not autodetected, is 32-bits. If you're getting ugly compiler
-warnings about casting from pointers, this is the one to look at.
-
-_Example:_
- #define UNITY_POINTER_WIDTH 64
-
-
-##### `UNITY_SUPPORT_64`
-
-Unity will automatically include 64-bit support if it auto-detects it, or if
-your `int`, `long`, or pointer widths are greater than 32-bits. Define this to
-enable 64-bit support if none of the other options already did it for you. There
-can be a significant size and speed impact to enabling 64-bit support on small
-targets, so don't define it if you don't need it.
-
-_Example:_
- #define UNITY_SUPPORT_64
-
-
-### Floating Point Types
-
-In the embedded world, it's not uncommon for targets to have no support for
-floating point operations at all or to have support that is limited to only
-single precision. We are able to guess integer sizes on the fly because integers
-are always available in at least one size. Floating point, on the other hand, is
-sometimes not available at all. Trying to include `float.h` on these platforms
-would result in an error. This leaves manual configuration as the only option.
-
-
-##### `UNITY_INCLUDE_FLOAT`
-
-##### `UNITY_EXCLUDE_FLOAT`
-
-##### `UNITY_INCLUDE_DOUBLE`
-
-##### `UNITY_EXCLUDE_DOUBLE`
-
-By default, Unity guesses that you will want single precision floating point
-support, but not double precision. It's easy to change either of these using the
-include and exclude options here. You may include neither, either, or both, as
-suits your needs. For features that are enabled, the following floating point
-options also become available.
-
-_Example:_
-
- //what manner of strange processor is this?
- #define UNITY_EXCLUDE_FLOAT
- #define UNITY_INCLUDE_DOUBLE
-
-
-##### `UNITY_EXCLUDE_FLOAT_PRINT`
-
-Unity aims for as small of a footprint as possible and avoids most standard
-library calls (some embedded platforms don’t have a standard library!). Because
-of this, its routines for printing integer values are minimalist and hand-coded.
-Therefore, the display of floating point values during a failure are optional.
-By default, Unity will print the actual results of floating point assertion
-failure (e.g. ”Expected 4.56 Was 4.68”). To not include this extra support, you
-can use this define to instead respond to a failed assertion with a message like
-”Values Not Within Delta”. If you would like verbose failure messages for floating
-point assertions, use these options to give more explicit failure messages.
-
-_Example:_
- #define UNITY_EXCLUDE_FLOAT_PRINT
-
-
-##### `UNITY_FLOAT_TYPE`
-
-If enabled, Unity assumes you want your `FLOAT` asserts to compare standard C
-floats. If your compiler supports a specialty floating point type, you can
-always override this behavior by using this definition.
-
-_Example:_
- #define UNITY_FLOAT_TYPE float16_t
-
-
-##### `UNITY_DOUBLE_TYPE`
-
-If enabled, Unity assumes you want your `DOUBLE` asserts to compare standard C
-doubles. If you would like to change this, you can specify something else by
-using this option. For example, defining `UNITY_DOUBLE_TYPE` to `long double`
-could enable gargantuan floating point types on your 64-bit processor instead of
-the standard `double`.
-
-_Example:_
- #define UNITY_DOUBLE_TYPE long double
-
-
-##### `UNITY_FLOAT_PRECISION`
-
-##### `UNITY_DOUBLE_PRECISION`
-
-If you look up `UNITY_ASSERT_EQUAL_FLOAT` and `UNITY_ASSERT_EQUAL_DOUBLE` as
-documented in the big daddy Unity Assertion Guide, you will learn that they are
-not really asserting that two values are equal but rather that two values are
-"close enough" to equal. "Close enough" is controlled by these precision
-configuration options. If you are working with 32-bit floats and/or 64-bit
-doubles (the normal on most processors), you should have no need to change these
-options. They are both set to give you approximately 1 significant bit in either
-direction. The float precision is 0.00001 while the double is 10-12.
-For further details on how this works, see the appendix of the Unity Assertion
-Guide.
-
-_Example:_
- #define UNITY_FLOAT_PRECISION 0.001f
-
-
-### Toolset Customization
-
-In addition to the options listed above, there are a number of other options
-which will come in handy to customize Unity's behavior for your specific
-toolchain. It is possible that you may not need to touch any of these... but
-certain platforms, particularly those running in simulators, may need to jump
-through extra hoops to run properly. These macros will help in those
-situations.
-
-
-##### `UNITY_OUTPUT_CHAR(a)`
-
-##### `UNITY_OUTPUT_FLUSH()`
-
-##### `UNITY_OUTPUT_START()`
-
-##### `UNITY_OUTPUT_COMPLETE()`
-
-By default, Unity prints its results to `stdout` as it runs. This works
-perfectly fine in most situations where you are using a native compiler for
-testing. It works on some simulators as well so long as they have `stdout`
-routed back to the command line. There are times, however, where the simulator
-will lack support for dumping results or you will want to route results
-elsewhere for other reasons. In these cases, you should define the
-`UNITY_OUTPUT_CHAR` macro. This macro accepts a single character at a time (as
-an `int`, since this is the parameter type of the standard C `putchar` function
-most commonly used). You may replace this with whatever function call you like.
-
-_Example:_
-Say you are forced to run your test suite on an embedded processor with no
-`stdout` option. You decide to route your test result output to a custom serial
-`RS232_putc()` function you wrote like thus:
- #include "RS232_header.h"
- ...
- #define UNITY_OUTPUT_CHAR(a) RS232_putc(a)
- #define UNITY_OUTPUT_START() RS232_config(115200,1,8,0)
- #define UNITY_OUTPUT_FLUSH() RS232_flush()
- #define UNITY_OUTPUT_COMPLETE() RS232_close()
-
-_Note:_
-`UNITY_OUTPUT_FLUSH()` can be set to the standard out flush function simply by
-specifying `UNITY_USE_FLUSH_STDOUT`. No other defines are required.
-
-
-##### `UNITY_WEAK_ATTRIBUTE`
-
-##### `UNITY_WEAK_PRAGMA`
-
-##### `UNITY_NO_WEAK`
-
-For some targets, Unity can make the otherwise required setUp() and tearDown()
-functions optional. This is a nice convenience for test writers since setUp and
-tearDown don’t often actually do anything. If you’re using gcc or clang, this
-option is automatically defined for you. Other compilers can also support this
-behavior, if they support a C feature called weak functions. A weak function is
-a function that is compiled into your executable unless a non-weak version of
-the same function is defined elsewhere. If a non-weak version is found, the weak
-version is ignored as if it never existed. If your compiler supports this feature,
-you can let Unity know by defining UNITY_WEAK_ATTRIBUTE or UNITY_WEAK_PRAGMA as
-the function attributes that would need to be applied to identify a function as
-weak. If your compiler lacks support for weak functions, you will always need to
-define setUp and tearDown functions (though they can be and often will be just
-empty). You can also force Unity to NOT use weak functions by defining
-UNITY_NO_WEAK. The most common options for this feature are:
-
-_Example:_
- #define UNITY_WEAK_ATTRIBUTE weak
- #define UNITY_WEAK_ATTRIBUTE __attribute__((weak))
- #define UNITY_WEAK_PRAGMA
- #define UNITY_NO_WEAK
-
-
-##### `UNITY_PTR_ATTRIBUTE`
-
-Some compilers require a custom attribute to be assigned to pointers, like
-`near` or `far`. In these cases, you can give Unity a safe default for these by
-defining this option with the attribute you would like.
-
-_Example:_
- #define UNITY_PTR_ATTRIBUTE __attribute__((far))
- #define UNITY_PTR_ATTRIBUTE near
-
-
-##### `UNITY_PRINT_EOL`
-
-By default, Unity outputs \n at the end of each line of output. This is easy
-to parse by the scripts, by Ceedling, etc, but it might not be ideal for YOUR
-system. Feel free to override this and to make it whatever you wish.
-
-_Example:_
- #define UNITY_PRINT_EOL { UNITY_OUTPUT_CHAR('\r'); UNITY_OUTPUT_CHAR('\n') }
-
-
-
-##### `UNITY_EXCLUDE_DETAILS`
-
-This is an option for if you absolutely must squeeze every byte of memory out of
-your system. Unity stores a set of internal scratchpads which are used to pass
-extra detail information around. It's used by systems like CMock in order to
-report which function or argument flagged an error. If you're not using CMock and
-you're not using these details for other things, then you can exclude them.
-
-_Example:_
- #define UNITY_EXCLUDE_DETAILS
-
-
-
-##### `UNITY_EXCLUDE_SETJMP`
-
-If your embedded system doesn't support the standard library setjmp, you can
-exclude Unity's reliance on this by using this define. This dropped dependence
-comes at a price, though. You will be unable to use custom helper functions for
-your tests, and you will be unable to use tools like CMock. Very likely, if your
-compiler doesn't support setjmp, you wouldn't have had the memory space for those
-things anyway, though... so this option exists for those situations.
-
-_Example:_
- #define UNITY_EXCLUDE_SETJMP
-
-##### `UNITY_OUTPUT_COLOR`
-
-If you want to add color using ANSI escape codes you can use this define.
-t
-_Example:_
- #define UNITY_OUTPUT_COLOR
-
-
-
-## Getting Into The Guts
-
-There will be cases where the options above aren't quite going to get everything
-perfect. They are likely sufficient for any situation where you are compiling
-and executing your tests with a native toolchain (e.g. clang on Mac). These
-options may even get you through the majority of cases encountered in working
-with a target simulator run from your local command line. But especially if you
-must run your test suite on your target hardware, your Unity configuration will
-require special help. This special help will usually reside in one of two
-places: the `main()` function or the `RUN_TEST` macro. Let's look at how these
-work.
-
-
-##### `main()`
-
-Each test module is compiled and run on its own, separate from the other test
-files in your project. Each test file, therefore, has a `main` function. This
-`main` function will need to contain whatever code is necessary to initialize
-your system to a workable state. This is particularly true for situations where
-you must set up a memory map or initialize a communication channel for the
-output of your test results.
-
-A simple main function looks something like this:
-
- int main(void) {
- UNITY_BEGIN();
- RUN_TEST(test_TheFirst);
- RUN_TEST(test_TheSecond);
- RUN_TEST(test_TheThird);
- return UNITY_END();
- }
-
-You can see that our main function doesn't bother taking any arguments. For our
-most barebones case, we'll never have arguments because we just run all the
-tests each time. Instead, we start by calling `UNITY_BEGIN`. We run each test
-(in whatever order we wish). Finally, we call `UNITY_END`, returning its return
-value (which is the total number of failures).
-
-It should be easy to see that you can add code before any test cases are run or
-after all the test cases have completed. This allows you to do any needed
-system-wide setup or teardown that might be required for your special
-circumstances.
-
-
-##### `RUN_TEST`
-
-The `RUN_TEST` macro is called with each test case function. Its job is to
-perform whatever setup and teardown is necessary for executing a single test
-case function. This includes catching failures, calling the test module's
-`setUp()` and `tearDown()` functions, and calling `UnityConcludeTest()`. If
-using CMock or test coverage, there will be additional stubs in use here. A
-simple minimalist RUN_TEST macro looks something like this:
-
- #define RUN_TEST(testfunc) \
- UNITY_NEW_TEST(#testfunc) \
- if (TEST_PROTECT()) { \
- setUp(); \
- testfunc(); \
- } \
- if (TEST_PROTECT() && (!TEST_IS_IGNORED)) \
- tearDown(); \
- UnityConcludeTest();
-
-So that's quite a macro, huh? It gives you a glimpse of what kind of stuff Unity
-has to deal with for every single test case. For each test case, we declare that
-it is a new test. Then we run `setUp` and our test function. These are run
-within a `TEST_PROTECT` block, the function of which is to handle failures that
-occur during the test. Then, assuming our test is still running and hasn't been
-ignored, we run `tearDown`. No matter what, our last step is to conclude this
-test before moving on to the next.
-
-Let's say you need to add a call to `fsync` to force all of your output data to
-flush to a file after each test. You could easily insert this after your
-`UnityConcludeTest` call. Maybe you want to write an xml tag before and after
-each result set. Again, you could do this by adding lines to this macro. Updates
-to this macro are for the occasions when you need an action before or after
-every single test case throughout your entire suite of tests.
-
-
-## Happy Porting
-
-The defines and macros in this guide should help you port Unity to just about
-any C target we can imagine. If you run into a snag or two, don't be afraid of
-asking for help on the forums. We love a good challenge!
-
-
-*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)*
diff --git a/tinyusb/test/vendor/ceedling/docs/UnityGettingStartedGuide.md b/tinyusb/test/vendor/ceedling/docs/UnityGettingStartedGuide.md
deleted file mode 100755
index 5e4427ce..00000000
--- a/tinyusb/test/vendor/ceedling/docs/UnityGettingStartedGuide.md
+++ /dev/null
@@ -1,192 +0,0 @@
-# Unity - Getting Started
-
-## Welcome
-
-Congratulations. You're now the proud owner of your very own pile of bits! What
-are you going to do with all these ones and zeros? This document should be able
-to help you decide just that.
-
-Unity is a unit test framework. The goal has been to keep it small and
-functional. The core Unity test framework is three files: a single C file and a
-couple header files. These team up to provide functions and macros to make
-testing easier.
-
-Unity was designed to be cross-platform. It works hard to stick with C standards
-while still providing support for the many embedded C compilers that bend the
-rules. Unity has been used with many compilers, including GCC, IAR, Clang,
-Green Hills, Microchip, and MS Visual Studio. It's not much work to get it to
-work with a new target.
-
-
-### Overview of the Documents
-
-#### Unity Assertions reference
-
-This document will guide you through all the assertion options provided by
-Unity. This is going to be your unit testing bread and butter. You'll spend more
-time with assertions than any other part of Unity.
-
-
-#### Unity Assertions Cheat Sheet
-
-This document contains an abridged summary of the assertions described in the
-previous document. It's perfect for printing and referencing while you
-familiarize yourself with Unity's options.
-
-
-#### Unity Configuration Guide
-
-This document is the one to reference when you are going to use Unity with a new
-target or compiler. It'll guide you through the configuration options and will
-help you customize your testing experience to meet your needs.
-
-
-#### Unity Helper Scripts
-
-This document describes the helper scripts that are available for simplifying
-your testing workflow. It describes the collection of optional Ruby scripts
-included in the auto directory of your Unity installation. Neither Ruby nor
-these scripts are necessary for using Unity. They are provided as a convenience
-for those who wish to use them.
-
-
-#### Unity License
-
-What's an open source project without a license file? This brief document
-describes the terms you're agreeing to when you use this software. Basically, we
-want it to be useful to you in whatever context you want to use it, but please
-don't blame us if you run into problems.
-
-
-### Overview of the Folders
-
-If you have obtained Unity through Github or something similar, you might be
-surprised by just how much stuff you suddenly have staring you in the face.
-Don't worry, Unity itself is very small. The rest of it is just there to make
-your life easier. You can ignore it or use it at your convenience. Here's an
-overview of everything in the project.
-
-- `src` - This is the code you care about! This folder contains a C file and two
-header files. These three files _are_ Unity.
-- `docs` - You're reading this document, so it's possible you have found your way
-into this folder already. This is where all the handy documentation can be
-found.
-- `examples` - This contains a few examples of using Unity.
-- `extras` - These are optional add ons to Unity that are not part of the core
-project. If you've reached us through James Grenning's book, you're going to
-want to look here.
-- `test` - This is how Unity and its scripts are all tested. If you're just using
-Unity, you'll likely never need to go in here. If you are the lucky team member
-who gets to port Unity to a new toolchain, this is a good place to verify
-everything is configured properly.
-- `auto` - Here you will find helpful Ruby scripts for simplifying your test
-workflow. They are purely optional and are not required to make use of Unity.
-
-
-## How to Create A Test File
-
-Test files are C files. Most often you will create a single test file for each C
-module that you want to test. The test file should include unity.h and the
-header for your C module to be tested.
-
-Next, a test file will include a `setUp()` and `tearDown()` function. The setUp
-function can contain anything you would like to run before each test. The
-tearDown function can contain anything you would like to run after each test.
-Both functions accept no arguments and return nothing. You may leave either or
-both of these blank if you have no need for them. If you're using a compiler
-that is configured to make these functions optional, you may leave them off
-completely. Not sure? Give it a try. If you compiler complains that it can't
-find setUp or tearDown when it links, you'll know you need to at least include
-an empty function for these.
-
-The majority of the file will be a series of test functions. Test functions
-follow the convention of starting with the word "test_" or "spec_". You don't HAVE
-to name them this way, but it makes it clear what functions are tests for other
-developers. Also, the automated scripts that come with Unity or Ceedling will default
-to looking for test functions to be prefixed this way. Test functions take no arguments
-and return nothing. All test accounting is handled internally in Unity.
-
-Finally, at the bottom of your test file, you will write a `main()` function.
-This function will call `UNITY_BEGIN()`, then `RUN_TEST` for each test, and
-finally `UNITY_END()`.This is what will actually trigger each of those test
-functions to run, so it is important that each function gets its own `RUN_TEST`
-call.
-
-Remembering to add each test to the main function can get to be tedious. If you
-enjoy using helper scripts in your build process, you might consider making use
-of our handy generate_test_runner.rb script. This will create the main function
-and all the calls for you, assuming that you have followed the suggested naming
-conventions. In this case, there is no need for you to include the main function
-in your test file at all.
-
-When you're done, your test file will look something like this:
-
-```C
-#include "unity.h"
-#include "file_to_test.h"
-
-void setUp(void) {
- // set stuff up here
-}
-
-void tearDown(void) {
- // clean stuff up here
-}
-
-void test_function_should_doBlahAndBlah(void) {
- //test stuff
-}
-
-void test_function_should_doAlsoDoBlah(void) {
- //more test stuff
-}
-
-int main(void) {
- UNITY_BEGIN();
- RUN_TEST(test_function_should_doBlahAndBlah);
- RUN_TEST(test_function_should_doAlsoDoBlah);
- return UNITY_END();
-}
-```
-
-It's possible that you will need more customization than this, eventually.
-For that sort of thing, you're going to want to look at the configuration guide.
-This should be enough to get you going, though.
-
-
-## How to Build and Run A Test File
-
-This is the single biggest challenge to picking up a new unit testing framework,
-at least in a language like C or C++. These languages are REALLY good at getting
-you "close to the metal" (why is the phrase metal? Wouldn't it be more accurate
-to say "close to the silicon"?). While this feature is usually a good thing, it
-can make testing more challenging.
-
-You have two really good options for toolchains. Depending on where you're
-coming from, it might surprise you that neither of these options is running the
-unit tests on your hardware.
-There are many reasons for this, but here's a short version:
-- On hardware, you have too many constraints (processing power, memory, etc),
-- On hardware, you don't have complete control over all registers,
-- On hardware, unit testing is more challenging,
-- Unit testing isn't System testing. Keep them separate.
-
-Instead of running your tests on your actual hardware, most developers choose to
-develop them as native applications (using gcc or MSVC for example) or as
-applications running on a simulator. Either is a good option. Native apps have
-the advantages of being faster and easier to set up. Simulator apps have the
-advantage of working with the same compiler as your target application. The
-options for configuring these are discussed in the configuration guide.
-
-To get either to work, you might need to make a few changes to the file
-containing your register set (discussed later).
-
-In either case, a test is built by linking unity, the test file, and the C
-file(s) being tested. These files create an executable which can be run as the
-test set for that module. Then, this process is repeated for the next test file.
-This flexibility of separating tests into individual executables allows us to
-much more thoroughly unit test our system and it keeps all the test code out of
-our final release!
-
-
-*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)*
diff --git a/tinyusb/test/vendor/ceedling/docs/UnityHelperScriptsGuide.md b/tinyusb/test/vendor/ceedling/docs/UnityHelperScriptsGuide.md
deleted file mode 100755
index 12d68d30..00000000
--- a/tinyusb/test/vendor/ceedling/docs/UnityHelperScriptsGuide.md
+++ /dev/null
@@ -1,260 +0,0 @@
-# Unity Helper Scripts
-
-## With a Little Help From Our Friends
-
-Sometimes what it takes to be a really efficient C programmer is a little non-C.
-The Unity project includes a couple of Ruby scripts for making your life just a tad
-easier. They are completely optional. If you choose to use them, you'll need a
-copy of Ruby, of course. Just install whatever the latest version is, and it is
-likely to work. You can find Ruby at [ruby-lang.org](https://ruby-labg.org/).
-
-
-### `generate_test_runner.rb`
-
-Are you tired of creating your own `main` function in your test file? Do you
-keep forgetting to add a `RUN_TEST` call when you add a new test case to your
-suite? Do you want to use CMock or other fancy add-ons but don't want to figure
-out how to create your own `RUN_TEST` macro?
-
-Well then we have the perfect script for you!
-
-The `generate_test_runner` script processes a given test file and automatically
-creates a separate test runner file that includes ?main?to execute the test
-cases within the scanned test file. All you do then is add the generated runner
-to your list of files to be compiled and linked, and presto you're done!
-
-This script searches your test file for void function signatures having a
-function name beginning with "test" or "spec". It treats each of these
-functions as a test case and builds up a test suite of them. For example, the
-following includes three test cases:
-
-```C
-void testVerifyThatUnityIsAwesomeAndWillMakeYourLifeEasier(void)
-{
- ASSERT_TRUE(1);
-}
-void test_FunctionName_should_WorkProperlyAndReturn8(void) {
- ASSERT_EQUAL_INT(8, FunctionName());
-}
-void spec_Function_should_DoWhatItIsSupposedToDo(void) {
- ASSERT_NOT_NULL(Function(5));
-}
-```
-
-You can run this script a couple of ways. The first is from the command line:
-
-```Shell
-ruby generate_test_runner.rb TestFile.c NameOfRunner.c
-```
-
-Alternatively, if you include only the test file parameter, the script will copy
-the name of the test file and automatically append "_Runner" to the name of the
-generated file. The example immediately below will create TestFile_Runner.c.
-
-```Shell
-ruby generate_test_runner.rb TestFile.c
-```
-
-You can also add a [YAML](http://www.yaml.org/) file to configure extra options.
-Conveniently, this YAML file is of the same format as that used by Unity and
-CMock. So if you are using YAML files already, you can simply pass the very same
-file into the generator script.
-
-```Shell
-ruby generate_test_runner.rb TestFile.c my_config.yml
-```
-
-The contents of the YAML file `my_config.yml` could look something like the
-example below. If you're wondering what some of these options do, you're going
-to love the next section of this document.
-
-```YAML
-:unity:
- :includes:
- - stdio.h
- - microdefs.h
- :cexception: 1
- :suit_setup: "blah = malloc(1024);"
- :suite_teardown: "free(blah);"
-```
-
-If you would like to force your generated test runner to include one or more
-header files, you can just include those at the command line too. Just make sure
-these are _after_ the YAML file, if you are using one:
-
-```Shell
-ruby generate_test_runner.rb TestFile.c my_config.yml extras.h
-```
-
-Another option, particularly if you are already using Ruby to orchestrate your
-builds - or more likely the Ruby-based build tool Rake - is requiring this
-script directly. Anything that you would have specified in a YAML file can be
-passed to the script as part of a hash. Let's push the exact same requirement
-set as we did above but this time through Ruby code directly:
-
-```Ruby
-require "generate_test_runner.rb"
-options = {
- :includes => ["stdio.h", "microdefs.h"],
- :cexception => 1,
- :suite_setup => "blah = malloc(1024);",
- :suite_teardown => "free(blah);"
-}
-UnityTestRunnerGenerator.new.run(testfile, runner_name, options)
-```
-
-If you have multiple files to generate in a build script (such as a Rakefile),
-you might want to instantiate a generator object with your options and call it
-to generate each runner afterwards. Like thus:
-
-```Ruby
-gen = UnityTestRunnerGenerator.new(options)
-test_files.each do |f|
- gen.run(f, File.basename(f,'.c')+"Runner.c"
-end
-```
-
-#### Options accepted by generate_test_runner.rb:
-
-The following options are available when executing `generate_test_runner`. You
-may pass these as a Ruby hash directly or specify them in a YAML file, both of
-which are described above. In the `examples` directory, Example 3's Rakefile
-demonstrates using a Ruby hash.
-
-
-##### `:includes`
-
-This option specifies an array of file names to be `#include`'d at the top of
-your runner C file. You might use it to reference custom types or anything else
-universally needed in your generated runners.
-
-
-##### `:suite_setup`
-
-Define this option with C code to be executed _before any_ test cases are run.
-
-Alternatively, if your C compiler supports weak symbols, you can leave this
-option unset and instead provide a `void suiteSetUp(void)` function in your test
-suite. The linker will look for this symbol and fall back to a Unity-provided
-stub if it is not found.
-
-
-##### `:suite_teardown`
-
-Define this option with C code to be executed _after all_ test cases have
-finished. An integer variable `num_failures` is available for diagnostics.
-The code should end with a `return` statement; the value returned will become
-the exit code of `main`. You can normally just return `num_failures`.
-
-Alternatively, if your C compiler supports weak symbols, you can leave this
-option unset and instead provide a `int suiteTearDown(int num_failures)`
-function in your test suite. The linker will look for this symbol and fall
-back to a Unity-provided stub if it is not found.
-
-
-##### `:enforce_strict_ordering`
-
-This option should be defined if you have the strict order feature enabled in
-CMock (see CMock documentation). This generates extra variables required for
-everything to run smoothly. If you provide the same YAML to the generator as
-used in CMock's configuration, you've already configured the generator properly.
-
-##### `:mock_prefix` and `:mock_suffix`
-
-Unity automatically generates calls to Init, Verify and Destroy for every file
-included in the main test file that starts with the given mock prefix and ends
-with the given mock suffix, file extension not included. By default, Unity
-assumes a `Mock` prefix and no suffix.
-
-##### `:plugins`
-
-This option specifies an array of plugins to be used (of course, the array can
-contain only a single plugin). This is your opportunity to enable support for
-CException support, which will add a check for unhandled exceptions in each
-test, reporting a failure if one is detected. To enable this feature using Ruby:
-
-```Ruby
-:plugins => [ :cexception ]
-```
-
-Or as a yaml file:
-
-```YAML
-:plugins:
- -:cexception
-```
-
-If you are using CMock, it is very likely that you are already passing an array
-of plugins to CMock. You can just use the same array here. This script will just
-ignore the plugins that don't require additional support.
-
-
-### `unity_test_summary.rb`
-
-A Unity test file contains one or more test case functions. Each test case can
-pass, fail, or be ignored. Each test file is run individually producing results
-for its collection of test cases. A given project will almost certainly be
-composed of multiple test files. Therefore, the suite of tests is comprised of
-one or more test cases spread across one or more test files. This script
-aggregates individual test file results to generate a summary of all executed
-test cases. The output includes how many tests were run, how many were ignored,
-and how many failed. In addition, the output includes a listing of which
-specific tests were ignored and failed. A good example of the breadth and
-details of these results can be found in the `examples` directory. Intentionally
-ignored and failing tests in this project generate corresponding entries in the
-summary report.
-
-If you're interested in other (prettier?) output formats, check into the
-Ceedling build tool project (ceedling.sourceforge.net) that works with Unity and
-CMock and supports xunit-style xml as well as other goodies.
-
-This script assumes the existence of files ending with the extensions
-`.testpass` and `.testfail`.The contents of these files includes the test
-results summary corresponding to each test file executed with the extension set
-according to the presence or absence of failures for that test file. The script
-searches a specified path for these files, opens each one it finds, parses the
-results, and aggregates and prints a summary. Calling it from the command line
-looks like this:
-
-```Shell
-ruby unity_test_summary.rb build/test/
-```
-
-You can optionally specify a root path as well. This is really helpful when you
-are using relative paths in your tools' setup, but you want to pull the summary
-into an IDE like Eclipse for clickable shortcuts.
-
-```Shell
-ruby unity_test_summary.rb build/test/ ~/projects/myproject/
-```
-
-Or, if you're more of a Windows sort of person:
-
-```Shell
-ruby unity_test_summary.rb build\teat\ C:\projects\myproject\
-```
-
-When configured correctly, you'll see a final summary, like so:
-
-```Shell
---------------------------
-UNITY IGNORED TEST SUMMARY
---------------------------
-blah.c:22:test_sandwiches_should_HaveBreadOnTwoSides:IGNORE
-
--------------------------
-UNITY FAILED TEST SUMMARY
--------------------------
-blah.c:87:test_sandwiches_should_HaveCondiments:FAIL:Expected 1 was 0
-meh.c:38:test_soda_should_BeCalledPop:FAIL:Expected "pop" was "coke"
-
---------------------------
-OVERALL UNITY TEST SUMMARY
---------------------------
-45 TOTAL TESTS 2 TOTAL FAILURES 1 IGNORED
-```
-
-How convenient is that?
-
-
-*Find The Latest of This And More at [ThrowTheSwitch.org](https://throwtheswitch.org)*
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling.rb b/tinyusb/test/vendor/ceedling/lib/ceedling.rb
deleted file mode 100755
index 7f340023..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-##
-# This module defines the interface for interacting with and loading a project
-# with Ceedling.
-module Ceedling
- ##
- # Returns the location where the gem is installed.
- # === Return
- # _String_ - The location where the gem lives.
- def self.location
- File.join( File.dirname(__FILE__), '..')
- end
-
- ##
- # Return the path to the "built-in" plugins.
- # === Return
- # _String_ - The path where the default plugins live.
- def self.load_path
- File.join( self.location, 'plugins')
- end
-
- ##
- # Return the path to the Ceedling Rakefile
- # === Return
- # _String_
- def self.rakefile
- File.join( self.location, 'lib', 'ceedling', 'rakefile.rb' )
- end
-
- ##
- # This method selects the project file that Ceedling will use by setting the
- # CEEDLING_MAIN_PROJECT_FILE environment variable before loading the ceedling
- # rakefile. A path supplied as an argument to this method will override the
- # current value of the environment variable. If no path is supplied as an
- # argument then the existing value of the environment variable is used. If
- # the environment variable has not been set and no argument has been supplied
- # then a default path of './project.yml' will be used.
- #
- # === Arguments
- # +options+ _Hash_::
- # A hash containing the options for ceedling. Currently the following
- # options are supported:
- # * +config+ - The path to the project YAML configuration file.
- # * +root+ - The root of the project directory.
- # * +prefix+ - A prefix to prepend to plugin names in order to determine the
- # corresponding gem name.
- # * +plugins+ - The list of ceedling plugins to load
- def self.load_project(options = {})
- # Make sure our path to the yaml file is setup
- if options.has_key? :config
- ENV['CEEDLING_MAIN_PROJECT_FILE'] = options[:config]
- elsif ENV['CEEDLING_MAIN_PROJECT_FILE'].nil?
- ENV['CEEDLING_MAIN_PROJECT_FILE'] = './project.yml'
- end
-
- # Register the plugins
- if options.has_key? :plugins
- options[:plugins].each do |plugin|
- register_plugin( plugin, options[:prefix] )
- end
- end
-
- # Define the root of the project if specified
- Object.const_set('PROJECT_ROOT', options[:root]) if options.has_key? :root
-
- # Load ceedling
- load "#{self.rakefile}"
- end
-
- ##
- # Register a plugin for ceedling to use when a project is loaded. This method
- # *must* be called prior to calling the _load_project_ method.
- #
- # This method is intended to be used for loading plugins distributed via the
- # RubyGems mechanism. As such, the following gem structure is assumed for
- # plugins.
- #
- # * The gem name must be prefixed with 'ceedling-' followed by the plugin
- # name (ex. 'ceedling-bullseye')
- #
- # * The contents of the plugin must be isntalled into a subdirectory of
- # the gem with the same name as the plugin (ex. 'bullseye/')
- #
- # === Arguments
- # +name+ _String_:: The name of the plugin to load.
- # +prefix+ _String_::
- # (optional, default = nil) The prefix to use for the full gem name.
- def self.register_plugin(name, prefix=nil)
- # Figure out the full name of the gem and location
- prefix ||= 'ceedling-'
- gem_name = prefix + name
- gem_dir = Gem::Specification.find_by_name(gem_name).gem_dir()
-
- # Register the plugin with Ceedling
- require 'ceedling/defaults'
- DEFAULT_CEEDLING_CONFIG[:plugins][:enabled] << name
- DEFAULT_CEEDLING_CONFIG[:plugins][:load_paths] << gem_dir
- end
-end
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/build_invoker_utils.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/build_invoker_utils.rb
deleted file mode 100755
index b7d57f8f..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/build_invoker_utils.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require 'ceedling/constants'
-
-##
-# Utilities for raiser and reporting errors during building.
-class BuildInvokerUtils
-
- constructor :configurator, :streaminator
-
- ##
- # Processes exceptions and tries to display a useful message for the user.
- #
- # ==== Attriboops...utes
- #
- # * _exception_: The exception given by a rescue statement.
- # * _context_: A symbol representing where in the build the exception
- # occurs.
- # * _test_build_: A bool to signify if the exception occurred while building
- # from test or source.
- #
- def process_exception(exception, context, test_build=true)
- if (exception.message =~ /Don't know how to build task '(.+)'/i)
- error_header = "ERROR: Rake could not find file referenced in source"
- error_header += " or test" if (test_build)
- error_header += ": '#{$1}'. Possible stale dependency."
-
- @streaminator.stderr_puts( error_header )
-
- if (@configurator.project_use_deep_dependencies)
- help_message = "Try fixing #include statements or adding missing file. Then run '#{REFRESH_TASK_ROOT}#{context.to_s}' task and try again."
- @streaminator.stderr_puts( help_message )
- end
-
- raise ''
- else
- raise exception
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/cacheinator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/cacheinator.rb
deleted file mode 100755
index 519a4aab..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/cacheinator.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-
-class Cacheinator
-
- constructor :cacheinator_helper, :file_path_utils, :file_wrapper, :yaml_wrapper
-
- def cache_test_config(hash)
- @yaml_wrapper.dump( @file_path_utils.form_test_build_cache_path( INPUT_CONFIGURATION_CACHE_FILE), hash )
- end
-
- def cache_release_config(hash)
- @yaml_wrapper.dump( @file_path_utils.form_release_build_cache_path( INPUT_CONFIGURATION_CACHE_FILE ), hash )
- end
-
-
- def diff_cached_test_file( filepath )
- cached_filepath = @file_path_utils.form_test_build_cache_path( filepath )
-
- if (@file_wrapper.exist?( cached_filepath ) and (!@file_wrapper.compare( filepath, cached_filepath )))
- @file_wrapper.cp(filepath, cached_filepath, {:preserve => false})
- return filepath
- elsif (!@file_wrapper.exist?( cached_filepath ))
- @file_wrapper.cp(filepath, cached_filepath, {:preserve => false})
- return filepath
- end
-
- return cached_filepath
- end
-
- def diff_cached_test_config?(hash)
- cached_filepath = @file_path_utils.form_test_build_cache_path(INPUT_CONFIGURATION_CACHE_FILE)
-
- return @cacheinator_helper.diff_cached_config?( cached_filepath, hash )
- end
-
- def diff_cached_test_defines?(files)
- cached_filepath = @file_path_utils.form_test_build_cache_path(DEFINES_DEPENDENCY_CACHE_FILE)
-
- return @cacheinator_helper.diff_cached_defines?( cached_filepath, files )
- end
-
- def diff_cached_release_config?(hash)
- cached_filepath = @file_path_utils.form_release_build_cache_path(INPUT_CONFIGURATION_CACHE_FILE)
-
- return @cacheinator_helper.diff_cached_config?( cached_filepath, hash )
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/cacheinator_helper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/cacheinator_helper.rb
deleted file mode 100755
index 2a161854..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/cacheinator_helper.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-
-class CacheinatorHelper
-
- constructor :file_wrapper, :yaml_wrapper
-
- def diff_cached_config?(cached_filepath, hash)
- return true if ( not @file_wrapper.exist?(cached_filepath) )
- return true if ( (@file_wrapper.exist?(cached_filepath)) and (!(@yaml_wrapper.load(cached_filepath) == hash)) )
- return false
- end
-
- def diff_cached_defines?(cached_filepath, files)
- current_defines = COLLECTION_DEFINES_TEST_AND_VENDOR.reject(&:empty?)
-
- current_dependency = Hash[files.collect { |source| [source, current_defines.dup] }]
- if not @file_wrapper.exist?(cached_filepath)
- @yaml_wrapper.dump(cached_filepath, current_dependency)
- return false
- end
-
- dependencies = @yaml_wrapper.load(cached_filepath)
- if dependencies.values_at(*current_dependency.keys) != current_dependency.values
- dependencies.merge!(current_dependency)
- @yaml_wrapper.dump(cached_filepath, dependencies)
- return true
- end
-
- return false
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/cmock_builder.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/cmock_builder.rb
deleted file mode 100755
index 4a74aa84..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/cmock_builder.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'cmock'
-
-class CmockBuilder
-
- attr_accessor :cmock
-
- def setup
- @cmock = nil
- end
-
- def manufacture(cmock_config)
- @cmock = CMock.new(cmock_config)
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/configurator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/configurator.rb
deleted file mode 100755
index b5ad8982..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/configurator.rb
+++ /dev/null
@@ -1,363 +0,0 @@
-require 'ceedling/defaults'
-require 'ceedling/constants'
-require 'ceedling/file_path_utils'
-require 'deep_merge'
-
-
-
-class Configurator
-
- attr_reader :project_config_hash, :script_plugins, :rake_plugins
- attr_accessor :project_logging, :project_debug, :project_verbosity, :sanity_checks
-
- constructor(:configurator_setup, :configurator_builder, :configurator_plugins, :cmock_builder, :yaml_wrapper, :system_wrapper) do
- @project_logging = false
- @project_debug = false
- @project_verbosity = Verbosity::NORMAL
- @sanity_checks = TestResultsSanityChecks::NORMAL
- end
-
- def setup
- # special copy of cmock config to provide to cmock for construction
- @cmock_config_hash = {}
-
- # note: project_config_hash is an instance variable so constants and accessors created
- # in eval() statements in build() have something of proper scope and persistence to reference
- @project_config_hash = {}
- @project_config_hash_backup = {}
-
- @script_plugins = []
- @rake_plugins = []
- end
-
-
- def replace_flattened_config(config)
- @project_config_hash.merge!(config)
- @configurator_setup.build_constants_and_accessors(@project_config_hash, binding())
- end
-
-
- def store_config
- @project_config_hash_backup = @project_config_hash.clone
- end
-
-
- def restore_config
- @project_config_hash = @project_config_hash_backup
- @configurator_setup.build_constants_and_accessors(@project_config_hash, binding())
- end
-
-
- def reset_defaults(config)
- [:test_compiler,
- :test_linker,
- :test_fixture,
- :test_includes_preprocessor,
- :test_file_preprocessor,
- :test_dependencies_generator,
- :release_compiler,
- :release_assembler,
- :release_linker,
- :release_dependencies_generator].each do |tool|
- config[:tools].delete(tool) if (not (config[:tools][tool].nil?))
- end
- end
-
-
- # The default values defined in defaults.rb (eg. DEFAULT_TOOLS_TEST) are populated
- # into @param config
- def populate_defaults(config)
- new_config = DEFAULT_CEEDLING_CONFIG.deep_clone
- new_config.deep_merge!(config)
- config.replace(new_config)
-
- @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST )
- @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST_PREPROCESSORS ) if (config[:project][:use_test_preprocessor])
- @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST_DEPENDENCIES ) if (config[:project][:use_deep_dependencies])
-
- @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE ) if (config[:project][:release_build])
- @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE_ASSEMBLER ) if (config[:project][:release_build] and config[:release_build][:use_assembly])
- @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE_DEPENDENCIES ) if (config[:project][:release_build] and config[:project][:use_deep_dependencies])
- end
-
-
- def populate_unity_defaults(config)
- unity = config[:unity] || {}
- @runner_config = unity.merge(@runner_config || config[:test_runner] || {})
- end
-
- def populate_cmock_defaults(config)
- # cmock has its own internal defaults handling, but we need to set these specific values
- # so they're present for the build environment to access;
- # note: these need to end up in the hash given to initialize cmock for this to be successful
- cmock = config[:cmock] || {}
-
- # yes, we're duplicating the default mock_prefix in cmock, but it's because we need CMOCK_MOCK_PREFIX always available in Ceedling's environment
- cmock[:mock_prefix] = 'Mock' if (cmock[:mock_prefix].nil?)
-
- # just because strict ordering is the way to go
- cmock[:enforce_strict_ordering] = true if (cmock[:enforce_strict_ordering].nil?)
-
- cmock[:mock_path] = File.join(config[:project][:build_root], TESTS_BASE_PATH, 'mocks') if (cmock[:mock_path].nil?)
- cmock[:verbosity] = @project_verbosity if (cmock[:verbosity].nil?)
-
- cmock[:plugins] = [] if (cmock[:plugins].nil?)
- cmock[:plugins].map! { |plugin| plugin.to_sym }
- cmock[:plugins] << (:cexception) if (!cmock[:plugins].include?(:cexception) and (config[:project][:use_exceptions]))
- cmock[:plugins].uniq!
-
- cmock[:unity_helper] = false if (cmock[:unity_helper].nil?)
-
- if (cmock[:unity_helper])
- cmock[:unity_helper] = [cmock[:unity_helper]] if cmock[:unity_helper].is_a? String
- cmock[:includes] += cmock[:unity_helper].map{|helper| File.basename(helper) }
- cmock[:includes].uniq!
- end
-
- @runner_config = cmock.merge(@runner_config || config[:test_runner] || {})
-
- @cmock_builder.manufacture(cmock)
- end
-
-
- def get_runner_config
- @runner_config
- end
-
-
- # grab tool names from yaml and insert into tool structures so available for error messages
- # set up default values
- def tools_setup(config)
- config[:tools].each_key do |name|
- tool = config[:tools][name]
-
- # populate name if not given
- tool[:name] = name.to_s if (tool[:name].nil?)
-
- # handle inline ruby string substitution in executable
- if (tool[:executable] =~ RUBY_STRING_REPLACEMENT_PATTERN)
- tool[:executable].replace(@system_wrapper.module_eval(tool[:executable]))
- end
-
- # populate stderr redirect option
- tool[:stderr_redirect] = StdErrRedirect::NONE if (tool[:stderr_redirect].nil?)
-
- # populate background execution option
- tool[:background_exec] = BackgroundExec::NONE if (tool[:background_exec].nil?)
-
- # populate optional option to control verification of executable in search paths
- tool[:optional] = false if (tool[:optional].nil?)
- end
- end
-
-
- def tools_supplement_arguments(config)
- tools_name_prefix = 'tools_'
- config[:tools].each_key do |name|
- tool = @project_config_hash[(tools_name_prefix + name.to_s).to_sym]
-
- # smoosh in extra arguments if specified at top-level of config (useful for plugins & default gcc tools)
- # arguments are squirted in at _end_ of list
- top_level_tool = (tools_name_prefix + name.to_s).to_sym
- if (not config[top_level_tool].nil?)
- # adding and flattening is not a good idea: might over-flatten if there's array nesting in tool args
- tool[:arguments].concat config[top_level_tool][:arguments]
- end
- end
- end
-
-
- def find_and_merge_plugins(config)
- # plugins must be loaded before generic path evaluation & magic that happen later;
- # perform path magic here as discrete step
- config[:plugins][:load_paths].each do |path|
- path.replace(@system_wrapper.module_eval(path)) if (path =~ RUBY_STRING_REPLACEMENT_PATTERN)
- FilePathUtils::standardize(path)
- end
-
- config[:plugins][:load_paths] << FilePathUtils::standardize(Ceedling.load_path)
- config[:plugins][:load_paths].uniq!
-
- paths_hash = @configurator_plugins.add_load_paths(config)
-
- @rake_plugins = @configurator_plugins.find_rake_plugins(config, paths_hash)
- @script_plugins = @configurator_plugins.find_script_plugins(config, paths_hash)
- config_plugins = @configurator_plugins.find_config_plugins(config, paths_hash)
- plugin_defaults = @configurator_plugins.find_plugin_defaults(config, paths_hash)
-
- config_plugins.each do |plugin|
- plugin_config = @yaml_wrapper.load(plugin)
- config.deep_merge(plugin_config)
- end
-
- plugin_defaults.each do |defaults|
- @configurator_builder.populate_defaults( config, @yaml_wrapper.load(defaults) )
- end
-
- # special plugin setting for results printing
- config[:plugins][:display_raw_test_results] = true if (config[:plugins][:display_raw_test_results].nil?)
-
- paths_hash.each_pair { |name, path| config[:plugins][name] = path }
- end
-
-
- def merge_imports(config)
- if config[:import]
- until config[:import].empty?
- path = config[:import].shift
- path = @system_wrapper.module_eval(path) if (path =~ RUBY_STRING_REPLACEMENT_PATTERN)
- config.deep_merge!(@yaml_wrapper.load(path))
- end
- end
- config.delete(:import)
- end
-
-
- def eval_environment_variables(config)
- config[:environment].each do |hash|
- key = hash.keys[0]
- value = hash[key]
- items = []
-
- interstitial = ((key == :path) ? File::PATH_SEPARATOR : '')
- items = ((value.class == Array) ? hash[key] : [value])
-
- items.each { |item| item.replace( @system_wrapper.module_eval( item ) ) if (item =~ RUBY_STRING_REPLACEMENT_PATTERN) }
- hash[key] = items.join( interstitial )
-
- @system_wrapper.env_set( key.to_s.upcase, hash[key] )
- end
- end
-
-
- def eval_paths(config)
- # [:plugins]:[load_paths] already handled
-
- paths = [ # individual paths that don't follow convention processed below
- config[:project][:build_root],
- config[:release_build][:artifacts]]
-
- eval_path_list( paths )
-
- config[:paths].each_pair { |collection, paths| eval_path_list( paths ) }
-
- config[:files].each_pair { |collection, files| eval_path_list( files ) }
-
- # all other paths at secondary hash key level processed by convention:
- # ex. [:toplevel][:foo_path] & [:toplevel][:bar_paths] are evaluated
- config.each_pair { |parent, child| eval_path_list( collect_path_list( child ) ) }
- end
-
-
- def standardize_paths(config)
- # [:plugins]:[load_paths] already handled
-
- paths = [ # individual paths that don't follow convention processed below
- config[:project][:build_root],
- config[:release_build][:artifacts]] # cmock path in case it was explicitly set in config
-
- paths.flatten.each { |path| FilePathUtils::standardize( path ) }
-
- config[:paths].each_pair do |collection, paths|
- # ensure that list is an array (i.e. handle case of list being a single string,
- # or a multidimensional array)
- config[:paths][collection] = [paths].flatten.map{|path| FilePathUtils::standardize( path )}
- end
-
- config[:files].each_pair { |collection, files| files.each{ |path| FilePathUtils::standardize( path ) } }
-
- config[:tools].each_pair { |tool, config| FilePathUtils::standardize( config[:executable] ) if (config.include? :executable) }
-
- # all other paths at secondary hash key level processed by convention:
- # ex. [:toplevel][:foo_path] & [:toplevel][:bar_paths] are standardized
- config.each_pair do |parent, child|
- collect_path_list( child ).each { |path| FilePathUtils::standardize( path ) }
- end
- end
-
-
- def validate(config)
- # collect felonies and go straight to jail
- raise if (not @configurator_setup.validate_required_sections( config ))
-
- # collect all misdemeanors, everybody on probation
- blotter = []
- blotter << @configurator_setup.validate_required_section_values( config )
- blotter << @configurator_setup.validate_paths( config )
- blotter << @configurator_setup.validate_tools( config )
- blotter << @configurator_setup.validate_plugins( config )
-
- raise if (blotter.include?( false ))
- end
-
-
- # create constants and accessors (attached to this object) from given hash
- def build(config, *keys)
- # create flattened & expanded configuration hash
- built_config = @configurator_setup.build_project_config( config, @configurator_builder.flattenify( config ) )
-
- @project_config_hash = built_config.clone
- store_config()
-
- @configurator_setup.build_constants_and_accessors(built_config, binding())
-
- # top-level keys disappear when we flatten, so create global constants & accessors to any specified keys
- keys.each do |key|
- hash = { key => config[key] }
- @configurator_setup.build_constants_and_accessors(hash, binding())
- end
- end
-
-
- # add to constants and accessors as post build step
- def build_supplement(config_base, config_more)
- # merge in our post-build additions to base configuration hash
- config_base.deep_merge!( config_more )
-
- # flatten our addition hash
- config_more_flattened = @configurator_builder.flattenify( config_more )
-
- # merge our flattened hash with built hash from previous build
- @project_config_hash.deep_merge!( config_more_flattened )
- store_config()
-
- # create more constants and accessors
- @configurator_setup.build_constants_and_accessors(config_more_flattened, binding())
-
- # recreate constants & update accessors with new merged, base values
- config_more.keys.each do |key|
- hash = { key => config_base[key] }
- @configurator_setup.build_constants_and_accessors(hash, binding())
- end
- end
-
-
- def insert_rake_plugins(plugins)
- plugins.each do |plugin|
- @project_config_hash[:project_rakefile_component_files] << plugin
- end
- end
-
- ### private ###
-
- private
-
- def collect_path_list( container )
- paths = []
- container.each_key { |key| paths << container[key] if (key.to_s =~ /_path(s)?$/) } if (container.class == Hash)
- return paths.flatten
- end
-
- def eval_path_list( paths )
- if paths.kind_of?(Array)
- paths = Array.new(paths)
- end
-
- paths.flatten.each do |path|
- path.replace( @system_wrapper.module_eval( path ) ) if (path =~ RUBY_STRING_REPLACEMENT_PATTERN)
- end
- end
-
-
-end
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/configurator_builder.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/configurator_builder.rb
deleted file mode 100755
index da8a816f..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/configurator_builder.rb
+++ /dev/null
@@ -1,458 +0,0 @@
-require 'rubygems'
-require 'rake' # for ext() method
-require 'ceedling/file_path_utils' # for class methods
-require 'ceedling/defaults'
-require 'ceedling/constants' # for Verbosity constants class & base file paths
-
-
-
-class ConfiguratorBuilder
-
- constructor :file_system_utils, :file_wrapper, :system_wrapper
-
-
- def build_global_constants(config)
- config.each_pair do |key, value|
- formatted_key = key.to_s.upcase
- # undefine global constant if it already exists
- Object.send(:remove_const, formatted_key.to_sym) if @system_wrapper.constants_include?(formatted_key)
- # create global constant
- Object.module_eval("#{formatted_key} = value")
- end
- end
-
-
- def build_accessor_methods(config, context)
- config.each_pair do |key, value|
- # fill configurator object with accessor methods
- eval("def #{key.to_s.downcase}() return @project_config_hash[:#{key.to_s}] end", context)
- end
- end
-
-
- # create a flattened hash from the original configuration structure
- def flattenify(config)
- new_hash = {}
-
- config.each_key do | parent |
-
- # gracefully handle empty top-level entries
- next if (config[parent].nil?)
-
- case config[parent]
- when Array
- config[parent].each do |hash|
- key = "#{parent.to_s.downcase}_#{hash.keys[0].to_s.downcase}".to_sym
- new_hash[key] = hash[hash.keys[0]]
- end
- when Hash
- config[parent].each_pair do | child, value |
- key = "#{parent.to_s.downcase}_#{child.to_s.downcase}".to_sym
- new_hash[key] = value
- end
- # handle entries with no children, only values
- else
- new_hash["#{parent.to_s.downcase}".to_sym] = config[parent]
- end
-
- end
-
- return new_hash
- end
-
-
- def populate_defaults(config, defaults)
- defaults.keys.sort.each do |section|
- defaults[section].keys.sort.each do |entry|
- config[section] = {} if config[section].nil?
- config[section][entry] = defaults[section][entry].deep_clone if (config[section][entry].nil?)
- end
- end
- end
-
-
- def clean(in_hash)
- # ensure that include files inserted into test runners have file extensions & proper ones at that
- in_hash[:test_runner_includes].map!{|include| include.ext(in_hash[:extension_header])}
- end
-
-
- def set_build_paths(in_hash)
- out_hash = {}
-
- project_build_artifacts_root = File.join(in_hash[:project_build_root], 'artifacts')
- project_build_tests_root = File.join(in_hash[:project_build_root], TESTS_BASE_PATH)
- project_build_release_root = File.join(in_hash[:project_build_root], RELEASE_BASE_PATH)
-
- paths = [
- [:project_build_artifacts_root, project_build_artifacts_root, true ],
- [:project_build_tests_root, project_build_tests_root, true ],
- [:project_build_release_root, project_build_release_root, in_hash[:project_release_build] ],
-
- [:project_test_artifacts_path, File.join(project_build_artifacts_root, TESTS_BASE_PATH), true ],
- [:project_test_runners_path, File.join(project_build_tests_root, 'runners'), true ],
- [:project_test_results_path, File.join(project_build_tests_root, 'results'), true ],
- [:project_test_build_output_path, File.join(project_build_tests_root, 'out'), true ],
- [:project_test_build_output_asm_path, File.join(project_build_tests_root, 'out', 'asm'), true ],
- [:project_test_build_output_c_path, File.join(project_build_tests_root, 'out', 'c'), true ],
- [:project_test_build_cache_path, File.join(project_build_tests_root, 'cache'), true ],
- [:project_test_dependencies_path, File.join(project_build_tests_root, 'dependencies'), true ],
-
- [:project_release_artifacts_path, File.join(project_build_artifacts_root, RELEASE_BASE_PATH), in_hash[:project_release_build] ],
- [:project_release_build_cache_path, File.join(project_build_release_root, 'cache'), in_hash[:project_release_build] ],
- [:project_release_build_output_path, File.join(project_build_release_root, 'out'), in_hash[:project_release_build] ],
- [:project_release_build_output_asm_path, File.join(project_build_release_root, 'out', 'asm'), in_hash[:project_release_build] ],
- [:project_release_build_output_c_path, File.join(project_build_release_root, 'out', 'c'), in_hash[:project_release_build] ],
- [:project_release_dependencies_path, File.join(project_build_release_root, 'dependencies'), in_hash[:project_release_build] ],
-
- [:project_log_path, File.join(in_hash[:project_build_root], 'logs'), true ],
- [:project_temp_path, File.join(in_hash[:project_build_root], 'temp'), true ],
-
- [:project_test_preprocess_includes_path, File.join(project_build_tests_root, 'preprocess/includes'), in_hash[:project_use_test_preprocessor] ],
- [:project_test_preprocess_files_path, File.join(project_build_tests_root, 'preprocess/files'), in_hash[:project_use_test_preprocessor] ],
- ]
-
- out_hash[:project_build_paths] = []
-
- # fetch already set mock path
- out_hash[:project_build_paths] << in_hash[:cmock_mock_path] if (in_hash[:project_use_mocks])
-
- paths.each do |path|
- build_path_name = path[0]
- build_path = path[1]
- build_path_add_condition = path[2]
-
- # insert path into build paths if associated with true condition
- out_hash[:project_build_paths] << build_path if build_path_add_condition
- # set path symbol name and path for each entry in paths array
- out_hash[build_path_name] = build_path
- end
-
- return out_hash
- end
-
-
- def set_force_build_filepaths(in_hash)
- out_hash = {}
-
- out_hash[:project_test_force_rebuild_filepath] = File.join( in_hash[:project_test_dependencies_path], 'force_build' )
- out_hash[:project_release_force_rebuild_filepath] = File.join( in_hash[:project_release_dependencies_path], 'force_build' ) if (in_hash[:project_release_build])
-
- return out_hash
- end
-
-
- def set_rakefile_components(in_hash)
- out_hash = {
- :project_rakefile_component_files =>
- [File.join(CEEDLING_LIB, 'ceedling', 'tasks_base.rake'),
- File.join(CEEDLING_LIB, 'ceedling', 'tasks_filesystem.rake'),
- File.join(CEEDLING_LIB, 'ceedling', 'tasks_tests.rake'),
- File.join(CEEDLING_LIB, 'ceedling', 'tasks_vendor.rake'),
- File.join(CEEDLING_LIB, 'ceedling', 'rules_tests.rake')]}
-
- out_hash[:project_rakefile_component_files] << File.join(CEEDLING_LIB, 'ceedling', 'rules_cmock.rake') if (in_hash[:project_use_mocks])
- out_hash[:project_rakefile_component_files] << File.join(CEEDLING_LIB, 'ceedling', 'rules_preprocess.rake') if (in_hash[:project_use_test_preprocessor])
- out_hash[:project_rakefile_component_files] << File.join(CEEDLING_LIB, 'ceedling', 'rules_tests_deep_dependencies.rake') if (in_hash[:project_use_deep_dependencies])
- out_hash[:project_rakefile_component_files] << File.join(CEEDLING_LIB, 'ceedling', 'tasks_tests_deep_dependencies.rake') if (in_hash[:project_use_deep_dependencies])
-
- out_hash[:project_rakefile_component_files] << File.join(CEEDLING_LIB, 'ceedling', 'rules_release_deep_dependencies.rake') if (in_hash[:project_release_build] and in_hash[:project_use_deep_dependencies])
- out_hash[:project_rakefile_component_files] << File.join(CEEDLING_LIB, 'ceedling', 'rules_release.rake') if (in_hash[:project_release_build])
- out_hash[:project_rakefile_component_files] << File.join(CEEDLING_LIB, 'ceedling', 'tasks_release_deep_dependencies.rake') if (in_hash[:project_release_build] and in_hash[:project_use_deep_dependencies])
- out_hash[:project_rakefile_component_files] << File.join(CEEDLING_LIB, 'ceedling', 'tasks_release.rake') if (in_hash[:project_release_build])
-
- return out_hash
- end
-
-
- def set_release_target(in_hash)
- return {} if (not in_hash[:project_release_build])
-
- release_target_file = ((in_hash[:release_build_output].nil?) ? (DEFAULT_RELEASE_TARGET_NAME.ext(in_hash[:extension_executable])) : in_hash[:release_build_output])
- release_map_file = ((in_hash[:release_build_output].nil?) ? (DEFAULT_RELEASE_TARGET_NAME.ext(in_hash[:extension_map])) : in_hash[:release_build_output].ext(in_hash[:extension_map]))
-
- return {
- # tempted to make a helper method in file_path_utils? stop right there, pal. you'll introduce a cyclical dependency
- :project_release_build_target => File.join(in_hash[:project_build_release_root], release_target_file),
- :project_release_build_map => File.join(in_hash[:project_build_release_root], release_map_file)
- }
- end
-
-
- def collect_project_options(in_hash)
- options = []
-
- in_hash[:project_options_paths].each do |path|
- options << @file_wrapper.directory_listing( File.join(path, '*.yml') )
- end
-
- return {
- :collection_project_options => options.flatten
- }
- end
-
-
- def expand_all_path_globs(in_hash)
- out_hash = {}
- path_keys = []
-
- in_hash.each_key do |key|
- next if (not key.to_s[0..4] == 'paths')
- path_keys << key
- end
-
- # sorted to provide assured order of traversal in test calls on mocks
- path_keys.sort.each do |key|
- out_hash["collection_#{key.to_s}".to_sym] = @file_system_utils.collect_paths( in_hash[key] )
- end
-
- return out_hash
- end
-
-
- def collect_source_and_include_paths(in_hash)
- return {
- :collection_paths_source_and_include =>
- ( in_hash[:collection_paths_source] +
- in_hash[:collection_paths_include] ).select {|x| File.directory?(x)}
- }
- end
-
-
- def collect_source_include_vendor_paths(in_hash)
- extra_paths = []
- extra_paths << File.join(in_hash[:cexception_vendor_path], CEXCEPTION_LIB_PATH) if (in_hash[:project_use_exceptions])
-
- return {
- :collection_paths_source_include_vendor =>
- in_hash[:collection_paths_source_and_include] +
- extra_paths
- }
- end
-
-
- def collect_test_support_source_include_paths(in_hash)
- return {
- :collection_paths_test_support_source_include =>
- (in_hash[:collection_paths_test] +
- in_hash[:collection_paths_support] +
- in_hash[:collection_paths_source] +
- in_hash[:collection_paths_include] ).select {|x| File.directory?(x)}
- }
- end
-
-
- def collect_vendor_paths(in_hash)
- return {:collection_paths_vendor => get_vendor_paths(in_hash)}
- end
-
-
- def collect_test_support_source_include_vendor_paths(in_hash)
- return {
- :collection_paths_test_support_source_include_vendor =>
- in_hash[:collection_paths_test_support_source_include] +
- get_vendor_paths(in_hash)
- }
- end
-
-
- def collect_tests(in_hash)
- all_tests = @file_wrapper.instantiate_file_list
-
- in_hash[:collection_paths_test].each do |path|
- all_tests.include( File.join(path, "#{in_hash[:project_test_file_prefix]}*#{in_hash[:extension_source]}") )
- end
-
- @file_system_utils.revise_file_list( all_tests, in_hash[:files_test] )
-
- return {:collection_all_tests => all_tests}
- end
-
-
- def collect_assembly(in_hash)
- all_assembly = @file_wrapper.instantiate_file_list
-
- return {:collection_all_assembly => all_assembly} if ((not in_hash[:release_build_use_assembly]) && (not in_hash[:test_build_use_assembly]))
-
- # Sprinkle in all assembly files we can find in the source folders
- in_hash[:collection_paths_source].each do |path|
- all_assembly.include( File.join(path, "*#{in_hash[:extension_assembly]}") )
- end
-
- # Also add all assembly files we can find in the support folders
- in_hash[:collection_paths_support].each do |path|
- all_assembly.include( File.join(path, "*#{in_hash[:extension_assembly]}") )
- end
-
- # Also add files that we are explicitly adding via :files:assembly: section
- @file_system_utils.revise_file_list( all_assembly, in_hash[:files_assembly] )
-
- return {:collection_all_assembly => all_assembly}
- end
-
-
- def collect_source(in_hash)
- all_source = @file_wrapper.instantiate_file_list
- in_hash[:collection_paths_source].each do |path|
- if File.exists?(path) and not File.directory?(path)
- all_source.include( path )
- else
- all_source.include( File.join(path, "*#{in_hash[:extension_source]}") )
- end
- end
- @file_system_utils.revise_file_list( all_source, in_hash[:files_source] )
-
- return {:collection_all_source => all_source}
- end
-
-
- def collect_headers(in_hash)
- all_headers = @file_wrapper.instantiate_file_list
-
- paths =
- in_hash[:collection_paths_test] +
- in_hash[:collection_paths_support] +
- in_hash[:collection_paths_source] +
- in_hash[:collection_paths_include]
-
- paths.each do |path|
- all_headers.include( File.join(path, "*#{in_hash[:extension_header]}") )
- end
-
- @file_system_utils.revise_file_list( all_headers, in_hash[:files_include] )
-
- return {:collection_all_headers => all_headers}
- end
-
-
- def collect_release_existing_compilation_input(in_hash)
- release_input = @file_wrapper.instantiate_file_list
-
- paths =
- in_hash[:collection_paths_source] +
- in_hash[:collection_paths_include]
-
- paths << File.join(in_hash[:cexception_vendor_path], CEXCEPTION_LIB_PATH) if (in_hash[:project_use_exceptions])
-
- paths.each do |path|
- release_input.include( File.join(path, "*#{in_hash[:extension_header]}") )
- if File.exists?(path) and not File.directory?(path)
- release_input.include( path )
- else
- release_input.include( File.join(path, "*#{in_hash[:extension_source]}") )
- end
- end
-
- @file_system_utils.revise_file_list( release_input, in_hash[:files_source] )
- @file_system_utils.revise_file_list( release_input, in_hash[:files_include] )
- # finding assembly files handled explicitly through other means
-
- return {:collection_release_existing_compilation_input => release_input}
- end
-
-
- def collect_all_existing_compilation_input(in_hash)
- all_input = @file_wrapper.instantiate_file_list
-
- paths =
- in_hash[:collection_paths_test] +
- in_hash[:collection_paths_support] +
- in_hash[:collection_paths_source] +
- in_hash[:collection_paths_include] +
- [File.join(in_hash[:unity_vendor_path], UNITY_LIB_PATH)]
-
- paths << File.join(in_hash[:cexception_vendor_path], CEXCEPTION_LIB_PATH) if (in_hash[:project_use_exceptions])
- paths << File.join(in_hash[:cmock_vendor_path], CMOCK_LIB_PATH) if (in_hash[:project_use_mocks])
-
- paths.each do |path|
- all_input.include( File.join(path, "*#{in_hash[:extension_header]}") )
- if File.exists?(path) and not File.directory?(path)
- all_input.include( path )
- else
- all_input.include( File.join(path, "*#{in_hash[:extension_source]}") )
- all_input.include( File.join(path, "*#{in_hash[:extension_assembly]}") ) if (defined?(TEST_BUILD_USE_ASSEMBLY) && TEST_BUILD_USE_ASSEMBLY)
- end
- end
-
- @file_system_utils.revise_file_list( all_input, in_hash[:files_test] )
- @file_system_utils.revise_file_list( all_input, in_hash[:files_support] )
- @file_system_utils.revise_file_list( all_input, in_hash[:files_source] )
- @file_system_utils.revise_file_list( all_input, in_hash[:files_include] )
- # finding assembly files handled explicitly through other means
-
- return {:collection_all_existing_compilation_input => all_input}
- end
-
-
- def collect_test_and_vendor_defines(in_hash)
- test_defines = in_hash[:defines_test].clone
-
- test_defines.concat(in_hash[:unity_defines])
- test_defines.concat(in_hash[:cmock_defines]) if (in_hash[:project_use_mocks])
- test_defines.concat(in_hash[:cexception_defines]) if (in_hash[:project_use_exceptions])
-
- return {:collection_defines_test_and_vendor => test_defines}
- end
-
-
- def collect_release_and_vendor_defines(in_hash)
- release_defines = in_hash[:defines_release].clone
-
- release_defines.concat(in_hash[:cexception_defines]) if (in_hash[:project_use_exceptions])
-
- return {:collection_defines_release_and_vendor => release_defines}
- end
-
-
- def collect_release_artifact_extra_link_objects(in_hash)
- objects = []
-
- # no build paths here so plugins can remap if necessary (i.e. path mapping happens at runtime)
- objects << CEXCEPTION_C_FILE.ext( in_hash[:extension_object] ) if (in_hash[:project_use_exceptions])
-
- return {:collection_release_artifact_extra_link_objects => objects}
- end
-
-
- def collect_test_fixture_extra_link_objects(in_hash)
- # Note: Symbols passed to compiler at command line can change Unity and CException behavior / configuration;
- # we also handle those dependencies elsewhere in compilation dependencies
-
- objects = [UNITY_C_FILE]
-
- in_hash[:files_support].each { |file| objects << File.basename(file) }
-
- # we don't include paths here because use of plugins or mixing different compilers may require different build paths
- objects << CEXCEPTION_C_FILE if (in_hash[:project_use_exceptions])
- objects << CMOCK_C_FILE if (in_hash[:project_use_mocks])
-
- # if we're using mocks & a unity helper is defined & that unity helper includes a source file component (not only a header of macros),
- # then link in the unity_helper object file too
- if ( in_hash[:project_use_mocks] and in_hash[:cmock_unity_helper] )
- in_hash[:cmock_unity_helper].each do |helper|
- if @file_wrapper.exist?(helper.ext(in_hash[:extension_source]))
- objects << File.basename(helper)
- end
- end
- end
-
- # no build paths here so plugins can remap if necessary (i.e. path mapping happens at runtime)
- objects.map! { |object| object.ext(in_hash[:extension_object]) }
-
- return { :collection_test_fixture_extra_link_objects => objects }
- end
-
-
- private
-
- def get_vendor_paths(in_hash)
- vendor_paths = []
- vendor_paths << File.join(in_hash[:unity_vendor_path], UNITY_LIB_PATH)
- vendor_paths << File.join(in_hash[:cexception_vendor_path], CEXCEPTION_LIB_PATH) if (in_hash[:project_use_exceptions])
- vendor_paths << File.join(in_hash[:cmock_vendor_path], CMOCK_LIB_PATH) if (in_hash[:project_use_mocks])
- vendor_paths << in_hash[:cmock_mock_path] if (in_hash[:project_use_mocks])
-
- return vendor_paths
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/configurator_plugins.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/configurator_plugins.rb
deleted file mode 100755
index 70ca884a..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/configurator_plugins.rb
+++ /dev/null
@@ -1,111 +0,0 @@
-require 'ceedling/constants'
-
-class ConfiguratorPlugins
-
- constructor :stream_wrapper, :file_wrapper, :system_wrapper
- attr_reader :rake_plugins, :script_plugins
-
- def setup
- @rake_plugins = []
- @script_plugins = []
- end
-
-
- def add_load_paths(config)
- plugin_paths = {}
-
- config[:plugins][:enabled].each do |plugin|
- config[:plugins][:load_paths].each do |root|
- path = File.join(root, plugin)
-
- is_script_plugin = ( not @file_wrapper.directory_listing( File.join( path, 'lib', '*.rb' ) ).empty? )
- is_rake_plugin = ( not @file_wrapper.directory_listing( File.join( path, '*.rake' ) ).empty? )
-
- if is_script_plugin or is_rake_plugin
- plugin_paths[(plugin + '_path').to_sym] = path
-
- if is_script_plugin
- @system_wrapper.add_load_path( File.join( path, 'lib') )
- end
- break
- end
- end
- end
-
- return plugin_paths
- end
-
-
- # gather up and return .rake filepaths that exist on-disk
- def find_rake_plugins(config, plugin_paths)
- @rake_plugins = []
- plugins_with_path = []
-
- config[:plugins][:enabled].each do |plugin|
- if path = plugin_paths[(plugin + '_path').to_sym]
- rake_plugin_path = File.join(path, "#{plugin}.rake")
- if (@file_wrapper.exist?(rake_plugin_path))
- plugins_with_path << rake_plugin_path
- @rake_plugins << plugin
- end
- end
- end
-
- return plugins_with_path
- end
-
-
- # gather up and return just names of .rb classes that exist on-disk
- def find_script_plugins(config, plugin_paths)
- @script_plugins = []
-
- config[:plugins][:enabled].each do |plugin|
- if path = plugin_paths[(plugin + '_path').to_sym]
- script_plugin_path = File.join(path, "lib", "#{plugin}.rb")
-
- if @file_wrapper.exist?(script_plugin_path)
- @script_plugins << plugin
- end
- end
- end
-
- return @script_plugins
- end
-
-
- # gather up and return configuration .yml filepaths that exist on-disk
- def find_config_plugins(config, plugin_paths)
- plugins_with_path = []
-
- config[:plugins][:enabled].each do |plugin|
- if path = plugin_paths[(plugin + '_path').to_sym]
- config_plugin_path = File.join(path, "config", "#{plugin}.yml")
-
- if @file_wrapper.exist?(config_plugin_path)
- plugins_with_path << config_plugin_path
- end
- end
- end
-
- return plugins_with_path
- end
-
-
- # gather up and return default .yml filepaths that exist on-disk
- def find_plugin_defaults(config, plugin_paths)
- defaults_with_path = []
-
- config[:plugins][:enabled].each do |plugin|
- if path = plugin_paths[(plugin + '_path').to_sym]
- default_path = File.join(path, 'config', 'defaults.yml')
-
- if @file_wrapper.exist?(default_path)
- defaults_with_path << default_path
- end
- end
- end
-
- return defaults_with_path
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/configurator_setup.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/configurator_setup.rb
deleted file mode 100755
index 1d029b06..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/configurator_setup.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-
-# add sort-ability to symbol so we can order keys array in hash for test-ability
-class Symbol
- include Comparable
-
- def <=>(other)
- self.to_s <=> other.to_s
- end
-end
-
-
-class ConfiguratorSetup
-
- constructor :configurator_builder, :configurator_validator, :configurator_plugins, :stream_wrapper
-
-
- def build_project_config(config, flattened_config)
- ### flesh out config
- @configurator_builder.clean(flattened_config)
-
- ### add to hash values we build up from configuration & file system contents
- flattened_config.merge!(@configurator_builder.set_build_paths(flattened_config))
- flattened_config.merge!(@configurator_builder.set_force_build_filepaths(flattened_config))
- flattened_config.merge!(@configurator_builder.set_rakefile_components(flattened_config))
- flattened_config.merge!(@configurator_builder.set_release_target(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_project_options(flattened_config))
-
- ### iterate through all entries in paths section and expand any & all globs to actual paths
- flattened_config.merge!(@configurator_builder.expand_all_path_globs(flattened_config))
-
- flattened_config.merge!(@configurator_builder.collect_vendor_paths(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_source_and_include_paths(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_source_include_vendor_paths(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_test_support_source_include_paths(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_test_support_source_include_vendor_paths(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_tests(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_assembly(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_source(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_headers(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_release_existing_compilation_input(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_all_existing_compilation_input(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_test_and_vendor_defines(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_release_and_vendor_defines(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_release_artifact_extra_link_objects(flattened_config))
- flattened_config.merge!(@configurator_builder.collect_test_fixture_extra_link_objects(flattened_config))
-
- return flattened_config
- end
-
-
- def build_constants_and_accessors(config, context)
- @configurator_builder.build_global_constants(config)
- @configurator_builder.build_accessor_methods(config, context)
- end
-
-
- def validate_required_sections(config)
- validation = []
- validation << @configurator_validator.exists?(config, :project)
- validation << @configurator_validator.exists?(config, :paths)
-
- return false if (validation.include?(false))
- return true
- end
-
- def validate_required_section_values(config)
- validation = []
- validation << @configurator_validator.exists?(config, :project, :build_root)
- validation << @configurator_validator.exists?(config, :paths, :test)
- validation << @configurator_validator.exists?(config, :paths, :source)
-
- return false if (validation.include?(false))
- return true
- end
-
- def validate_paths(config)
- validation = []
-
- if config[:cmock][:unity_helper]
- config[:cmock][:unity_helper].each do |path|
- validation << @configurator_validator.validate_filepath_simple( path, :cmock, :unity_helper )
- end
- end
-
- config[:project][:options_paths].each do |path|
- validation << @configurator_validator.validate_filepath_simple( path, :project, :options_paths )
- end
-
- config[:plugins][:load_paths].each do |path|
- validation << @configurator_validator.validate_filepath_simple( path, :plugins, :load_paths )
- end
-
- config[:paths].keys.sort.each do |key|
- validation << @configurator_validator.validate_path_list(config, :paths, key)
- end
-
- return false if (validation.include?(false))
- return true
- end
-
- def validate_tools(config)
- validation = []
-
- config[:tools].keys.sort.each do |key|
- validation << @configurator_validator.exists?(config, :tools, key, :executable)
- validation << @configurator_validator.validate_executable_filepath(config, :tools, key, :executable) if (not config[:tools][key][:optional])
- validation << @configurator_validator.validate_tool_stderr_redirect(config, :tools, key)
- end
-
- return false if (validation.include?(false))
- return true
- end
-
- def validate_plugins(config)
- missing_plugins =
- Set.new( config[:plugins][:enabled] ) -
- Set.new( @configurator_plugins.rake_plugins ) -
- Set.new( @configurator_plugins.script_plugins )
-
- missing_plugins.each do |plugin|
- @stream_wrapper.stderr_puts("ERROR: Ceedling plugin '#{plugin}' contains no rake or ruby class entry point. (Misspelled or missing files?)")
- end
-
- return ( (missing_plugins.size > 0) ? false : true )
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/configurator_validator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/configurator_validator.rb
deleted file mode 100755
index fc021012..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/configurator_validator.rb
+++ /dev/null
@@ -1,193 +0,0 @@
-require 'rubygems'
-require 'rake' # for ext()
-require 'ceedling/constants'
-require 'ceedling/tool_executor' # for argument replacement pattern
-require 'ceedling/file_path_utils' # for glob handling class methods
-
-
-class ConfiguratorValidator
-
- constructor :file_wrapper, :stream_wrapper, :system_wrapper
-
- # walk into config hash verify existence of data at key depth
- def exists?(config, *keys)
- hash = retrieve_value(config, keys)
- exist = !hash[:value].nil?
-
- if (not exist)
- # no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
- @stream_wrapper.stderr_puts("ERROR: Required config file entry #{format_key_sequence(keys, hash[:depth])} does not exist.")
- end
-
- return exist
- end
-
-
- # walk into config hash. verify directory path(s) at given key depth
- def validate_path_list(config, *keys)
- hash = retrieve_value(config, keys)
- list = hash[:value]
-
- # return early if we couldn't walk into hash and find a value
- return false if (list.nil?)
-
- path_list = []
- exist = true
-
- case list
- when String then path_list << list
- when Array then path_list = list
- end
-
- path_list.each do |path|
- base_path = FilePathUtils::extract_path(path) # lop off add/subtract notation & glob specifiers
-
- if (not @file_wrapper.exist?(base_path))
- # no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
- @stream_wrapper.stderr_puts("ERROR: Config path #{format_key_sequence(keys, hash[:depth])}['#{base_path}'] does not exist on disk.")
- exist = false
- end
- end
-
- return exist
- end
-
-
- # simple path verification
- def validate_filepath_simple(path, *keys)
- validate_path = path
-
- if (not @file_wrapper.exist?(validate_path))
- # no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
- @stream_wrapper.stderr_puts("ERROR: Config path '#{validate_path}' associated with #{format_key_sequence(keys, keys.size)} does not exist on disk.")
- return false
- end
-
- return true
- end
-
- # walk into config hash. verify specified file exists.
- def validate_filepath(config, *keys)
- hash = retrieve_value(config, keys)
- filepath = hash[:value]
-
- # return early if we couldn't walk into hash and find a value
- return false if (filepath.nil?)
-
- # skip everything if we've got an argument replacement pattern
- return true if (filepath =~ TOOL_EXECUTOR_ARGUMENT_REPLACEMENT_PATTERN)
-
- if (not @file_wrapper.exist?(filepath))
-
- # See if we can deal with it internally.
- if GENERATED_DIR_PATH.include?(filepath)
- # we already made this directory before let's make it again.
- FileUtils.mkdir_p File.join(File.dirname(__FILE__), filepath)
- @stream_wrapper.stderr_puts("WARNING: Generated filepath #{format_key_sequence(keys, hash[:depth])}['#{filepath}'] does not exist on disk. Recreating")
-
- else
- # no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
- @stream_wrapper.stderr_puts("ERROR: Config filepath #{format_key_sequence(keys, hash[:depth])}['#{filepath}'] does not exist on disk.")
- return false
- end
- end
-
- return true
- end
-
- # walk into config hash. verify specified file exists.
- def validate_executable_filepath(config, *keys)
- exe_extension = config[:extension][:executable]
- hash = retrieve_value(config, keys)
- filepath = hash[:value]
-
- # return early if we couldn't walk into hash and find a value
- return false if (filepath.nil?)
-
- # skip everything if we've got an argument replacement pattern
- return true if (filepath =~ TOOL_EXECUTOR_ARGUMENT_REPLACEMENT_PATTERN)
-
- # if there's no path included, verify file exists somewhere in system search paths
- if (not filepath.include?('/'))
- exists = false
-
- @system_wrapper.search_paths.each do |path|
- if (@file_wrapper.exist?( File.join(path, filepath)) )
- exists = true
- break
- end
-
- if (@file_wrapper.exist?( (File.join(path, filepath)).ext( exe_extension ) ))
- exists = true
- break
- elsif (@system_wrapper.windows? and @file_wrapper.exist?( (File.join(path, filepath)).ext( EXTENSION_WIN_EXE ) ))
- exists = true
- break
- end
- end
-
- if (not exists)
- # no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
- @stream_wrapper.stderr_puts("ERROR: Config filepath #{format_key_sequence(keys, hash[:depth])}['#{filepath}'] does not exist in system search paths.")
- return false
- end
-
- # if there is a path included, check that explicit filepath exists
- else
- if (not @file_wrapper.exist?(filepath))
- # no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
- @stream_wrapper.stderr_puts("ERROR: Config filepath #{format_key_sequence(keys, hash[:depth])}['#{filepath}'] does not exist on disk.")
- return false
- end
- end
-
- return true
- end
-
- def validate_tool_stderr_redirect(config, tools, tool)
- redirect = config[tools][tool][:stderr_redirect]
- if (redirect.class == Symbol)
- # map constants and force to array of strings for runtime universality across ruby versions
- if (not StdErrRedirect.constants.map{|constant| constant.to_s}.include?(redirect.to_s.upcase))
- error = "ERROR: [:#{tools}][:#{tool}][:stderr_redirect][:#{redirect}] is not a recognized option " +
- "{#{StdErrRedirect.constants.map{|constant| ':' + constant.to_s.downcase}.join(', ')}}."
- @stream_wrapper.stderr_puts(error)
- return false
- end
- end
-
- return true
- end
-
- private #########################################
-
-
- def retrieve_value(config, keys)
- value = nil
- hash = config
- depth = 0
-
- # walk into hash & extract value at requested key sequence
- keys.each do |symbol|
- depth += 1
- if (not hash[symbol].nil?)
- hash = hash[symbol]
- value = hash
- else
- value = nil
- break
- end
- end
-
- return {:value => value, :depth => depth}
- end
-
-
- def format_key_sequence(keys, depth)
- walked_keys = keys.slice(0, depth)
- formatted_keys = walked_keys.map{|key| "[:#{key.to_s}]"}
-
- return formatted_keys.join
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/constants.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/constants.rb
deleted file mode 100755
index 993ce8db..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/constants.rb
+++ /dev/null
@@ -1,97 +0,0 @@
-
-class Verbosity
- SILENT = 0 # as silent as possible (though there are some messages that must be spit out)
- ERRORS = 1 # only errors
- COMPLAIN = 2 # spit out errors and warnings/notices
- NORMAL = 3 # errors, warnings/notices, standard status messages
- OBNOXIOUS = 4 # all messages including extra verbose output (used for lite debugging / verification)
- DEBUG = 5 # special extra verbose output for hardcore debugging
-end
-
-
-class TestResultsSanityChecks
- NONE = 0 # no sanity checking of test results
- NORMAL = 1 # perform non-problematic checks
- THOROUGH = 2 # perform checks that require inside knowledge of system workings
-end
-
-
-class StdErrRedirect
- NONE = :none
- AUTO = :auto
- WIN = :win
- UNIX = :unix
- TCSH = :tcsh
-end
-
-
-class BackgroundExec
- NONE = :none
- AUTO = :auto
- WIN = :win
- UNIX = :unix
-end
-
-unless defined?(PROJECT_ROOT)
- PROJECT_ROOT = Dir.pwd()
-end
-
-GENERATED_DIR_PATH = [['vendor', 'ceedling'], 'src', "test", ['test', 'support'], 'build'].each{|p| File.join(*p)}
-
-EXTENSION_WIN_EXE = '.exe'
-EXTENSION_NONWIN_EXE = '.out'
-
-
-CEXCEPTION_ROOT_PATH = 'c_exception'
-CEXCEPTION_LIB_PATH = "#{CEXCEPTION_ROOT_PATH}/lib"
-CEXCEPTION_C_FILE = 'CException.c'
-CEXCEPTION_H_FILE = 'CException.h'
-
-UNITY_ROOT_PATH = 'unity'
-UNITY_LIB_PATH = "#{UNITY_ROOT_PATH}/src"
-UNITY_C_FILE = 'unity.c'
-UNITY_H_FILE = 'unity.h'
-UNITY_INTERNALS_H_FILE = 'unity_internals.h'
-
-CMOCK_ROOT_PATH = 'cmock'
-CMOCK_LIB_PATH = "#{CMOCK_ROOT_PATH}/src"
-CMOCK_C_FILE = 'cmock.c'
-CMOCK_H_FILE = 'cmock.h'
-
-
-DEFAULT_CEEDLING_MAIN_PROJECT_FILE = 'project.yml' unless defined?(DEFAULT_CEEDLING_MAIN_PROJECT_FILE) # main project file
-DEFAULT_CEEDLING_USER_PROJECT_FILE = 'user.yml' unless defined?(DEFAULT_CEEDLING_USER_PROJECT_FILE) # supplemental user config file
-
-INPUT_CONFIGURATION_CACHE_FILE = 'input.yml' unless defined?(INPUT_CONFIGURATION_CACHE_FILE) # input configuration file dump
-DEFINES_DEPENDENCY_CACHE_FILE = 'defines_dependency.yml' unless defined?(DEFINES_DEPENDENCY_CACHE_FILE) # preprocessor definitions for files
-
-TEST_ROOT_NAME = 'test' unless defined?(TEST_ROOT_NAME)
-TEST_TASK_ROOT = TEST_ROOT_NAME + ':' unless defined?(TEST_TASK_ROOT)
-TEST_SYM = TEST_ROOT_NAME.to_sym unless defined?(TEST_SYM)
-
-RELEASE_ROOT_NAME = 'release' unless defined?(RELEASE_ROOT_NAME)
-RELEASE_TASK_ROOT = RELEASE_ROOT_NAME + ':' unless defined?(RELEASE_TASK_ROOT)
-RELEASE_SYM = RELEASE_ROOT_NAME.to_sym unless defined?(RELEASE_SYM)
-
-REFRESH_ROOT_NAME = 'refresh' unless defined?(REFRESH_ROOT_NAME)
-REFRESH_TASK_ROOT = REFRESH_ROOT_NAME + ':' unless defined?(REFRESH_TASK_ROOT)
-REFRESH_SYM = REFRESH_ROOT_NAME.to_sym unless defined?(REFRESH_SYM)
-
-UTILS_ROOT_NAME = 'utils' unless defined?(UTILS_ROOT_NAME)
-UTILS_TASK_ROOT = UTILS_ROOT_NAME + ':' unless defined?(UTILS_TASK_ROOT)
-UTILS_SYM = UTILS_ROOT_NAME.to_sym unless defined?(UTILS_SYM)
-
-OPERATION_COMPILE_SYM = :compile unless defined?(OPERATION_COMPILE_SYM)
-OPERATION_ASSEMBLE_SYM = :assemble unless defined?(OPERATION_ASSEMBLE_SYM)
-OPERATION_LINK_SYM = :link unless defined?(OPERATION_LINK_SYM)
-
-
-RUBY_STRING_REPLACEMENT_PATTERN = /#\{.+\}/
-RUBY_EVAL_REPLACEMENT_PATTERN = /^\{(.+)\}$/
-TOOL_EXECUTOR_ARGUMENT_REPLACEMENT_PATTERN = /(\$\{(\d+)\})/
-TEST_STDOUT_STATISTICS_PATTERN = /\n-+\s*(\d+)\s+Tests\s+(\d+)\s+Failures\s+(\d+)\s+Ignored\s+(OK|FAIL)\s*/i
-
-NULL_FILE_PATH = '/dev/null'
-
-TESTS_BASE_PATH = TEST_ROOT_NAME
-RELEASE_BASE_PATH = RELEASE_ROOT_NAME
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/defaults.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/defaults.rb
deleted file mode 100755
index 9e391fa0..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/defaults.rb
+++ /dev/null
@@ -1,418 +0,0 @@
-require 'ceedling/constants'
-require 'ceedling/system_wrapper'
-require 'ceedling/file_path_utils'
-
-#this should be defined already, but not always during system specs
-CEEDLING_VENDOR = File.expand_path(File.dirname(__FILE__) + '/../../vendor') unless defined? CEEDLING_VENDOR
-CEEDLING_PLUGINS = [] unless defined? CEEDLING_PLUGINS
-
-DEFAULT_TEST_COMPILER_TOOL = {
- :executable => FilePathUtils.os_executable_ext('gcc').freeze,
- :name => 'default_test_compiler'.freeze,
- :stderr_redirect => StdErrRedirect::NONE.freeze,
- :background_exec => BackgroundExec::NONE.freeze,
- :optional => false.freeze,
- :arguments => [
- {"-I\"$\"" => 'COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR'}.freeze,
- {"-I\"$\"" => 'COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE'}.freeze,
- {"-D$" => 'COLLECTION_DEFINES_TEST_AND_VENDOR'}.freeze,
- "-DGNU_COMPILER".freeze,
- "-g".freeze,
- "-c \"${1}\"".freeze,
- "-o \"${2}\"".freeze,
- # gcc's list file output options are complex; no use of ${3} parameter in default config
- "-MMD".freeze,
- "-MF \"${4}\"".freeze,
- ].freeze
- }
-
-DEFAULT_TEST_LINKER_TOOL = {
- :executable => FilePathUtils.os_executable_ext('gcc').freeze,
- :name => 'default_test_linker'.freeze,
- :stderr_redirect => StdErrRedirect::NONE.freeze,
- :background_exec => BackgroundExec::NONE.freeze,
- :optional => false.freeze,
- :arguments => [
- "\"${1}\"".freeze,
- "-o \"${2}\"".freeze,
- "".freeze,
- "${4}".freeze
- ].freeze
- }
-
-DEFAULT_TEST_FIXTURE_TOOL = {
- :executable => '${1}'.freeze,
- :name => 'default_test_fixture'.freeze,
- :stderr_redirect => StdErrRedirect::AUTO.freeze,
- :background_exec => BackgroundExec::NONE.freeze,
- :optional => false.freeze,
- :arguments => [].freeze
- }
-
-DEFAULT_TEST_INCLUDES_PREPROCESSOR_TOOL = {
- :executable => FilePathUtils.os_executable_ext('gcc').freeze,
- :name => 'default_test_includes_preprocessor'.freeze,
- :stderr_redirect => StdErrRedirect::NONE.freeze,
- :background_exec => BackgroundExec::NONE.freeze,
- :optional => false.freeze,
- :arguments => [
- '-E'.freeze, # OSX clang
- '-MM'.freeze,
- '-MG'.freeze,
- # avoid some possibility of deep system lib header file complications by omitting vendor paths
- # if cpp is run on *nix system, escape spaces in paths; if cpp on windows just use the paths collection as is
- # {"-I\"$\"" => "{SystemWrapper.windows? ? COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE : COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE.map{|path| path.gsub(\/ \/, \'\\\\ \') }}"}.freeze,
- {"-I\"$\"" => 'COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR'}.freeze,
- {"-I\"$\"" => 'COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE'}.freeze,
- {"-D$" => 'COLLECTION_DEFINES_TEST_AND_VENDOR'}.freeze,
- {"-D$" => 'DEFINES_TEST_PREPROCESS'}.freeze,
- "-DGNU_COMPILER".freeze, # OSX clang
- '-w'.freeze,
- # '-nostdinc'.freeze, # disabled temporarily due to stdio access violations on OSX
- "\"${1}\"".freeze
- ].freeze
- }
-
-DEFAULT_TEST_FILE_PREPROCESSOR_TOOL = {
- :executable => FilePathUtils.os_executable_ext('gcc').freeze,
- :name => 'default_test_file_preprocessor'.freeze,
- :stderr_redirect => StdErrRedirect::NONE.freeze,
- :background_exec => BackgroundExec::NONE.freeze,
- :optional => false.freeze,
- :arguments => [
- '-E'.freeze,
- {"-I\"$\"" => 'COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR'}.freeze,
- {"-I\"$\"" => 'COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE'}.freeze,
- {"-D$" => 'COLLECTION_DEFINES_TEST_AND_VENDOR'}.freeze,
- {"-D$" => 'DEFINES_TEST_PREPROCESS'}.freeze,
- "-DGNU_COMPILER".freeze,
- # '-nostdinc'.freeze, # disabled temporarily due to stdio access violations on OSX
- "\"${1}\"".freeze,
- "-o \"${2}\"".freeze
- ].freeze
- }
-
-# Disable the -MD flag for OSX LLVM Clang, since unsupported
-if RUBY_PLATFORM =~ /darwin/ && `gcc --version 2> /dev/null` =~ /Apple LLVM version .* \(clang/m # OSX w/LLVM Clang
- MD_FLAG = '' # Clang doesn't support the -MD flag
-else
- MD_FLAG = '-MD'
-end
-
-DEFAULT_TEST_DEPENDENCIES_GENERATOR_TOOL = {
- :executable => FilePathUtils.os_executable_ext('gcc').freeze,
- :name => 'default_test_dependencies_generator'.freeze,
- :stderr_redirect => StdErrRedirect::NONE.freeze,
- :background_exec => BackgroundExec::NONE.freeze,
- :optional => false.freeze,
- :arguments => [
- '-E'.freeze,
- {"-I\"$\"" => 'COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR'}.freeze,
- {"-I\"$\"" => 'COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE'}.freeze,
- {"-D$" => 'COLLECTION_DEFINES_TEST_AND_VENDOR'}.freeze,
- {"-D$" => 'DEFINES_TEST_PREPROCESS'}.freeze,
- "-DGNU_COMPILER".freeze,
- "-MT \"${3}\"".freeze,
- '-MM'.freeze,
- MD_FLAG.freeze,
- '-MG'.freeze,
- "-MF \"${2}\"".freeze,
- "-c \"${1}\"".freeze,
- # '-nostdinc'.freeze,
- ].freeze
- }
-
-DEFAULT_RELEASE_DEPENDENCIES_GENERATOR_TOOL = {
- :executable => FilePathUtils.os_executable_ext('gcc').freeze,
- :name => 'default_release_dependencies_generator'.freeze,
- :stderr_redirect => StdErrRedirect::NONE.freeze,
- :background_exec => BackgroundExec::NONE.freeze,
- :optional => false.freeze,
- :arguments => [
- '-E'.freeze,
- {"-I\"$\"" => 'COLLECTION_PATHS_SOURCE_INCLUDE_VENDOR'}.freeze,
- {"-I\"$\"" => 'COLLECTION_PATHS_RELEASE_TOOLCHAIN_INCLUDE'}.freeze,
- {"-D$" => 'COLLECTION_DEFINES_RELEASE_AND_VENDOR'}.freeze,
- {"-D$" => 'DEFINES_RELEASE_PREPROCESS'}.freeze,
- "-DGNU_COMPILER".freeze,
- "-MT \"${3}\"".freeze,
- '-MM'.freeze,
- MD_FLAG.freeze,
- '-MG'.freeze,
- "-MF \"${2}\"".freeze,
- "-c \"${1}\"".freeze,
- # '-nostdinc'.freeze,
- ].freeze
- }
-
-
-DEFAULT_RELEASE_COMPILER_TOOL = {
- :executable => FilePathUtils.os_executable_ext('gcc').freeze,
- :name => 'default_release_compiler'.freeze,
- :stderr_redirect => StdErrRedirect::NONE.freeze,
- :background_exec => BackgroundExec::NONE.freeze,
- :optional => false.freeze,
- :arguments => [
- {"-I\"$\"" => 'COLLECTION_PATHS_SOURCE_INCLUDE_VENDOR'}.freeze,
- {"-I\"$\"" => 'COLLECTION_PATHS_RELEASE_TOOLCHAIN_INCLUDE'}.freeze,
- {"-D$" => 'COLLECTION_DEFINES_RELEASE_AND_VENDOR'}.freeze,
- "-DGNU_COMPILER".freeze,
- "-c \"${1}\"".freeze,
- "-o \"${2}\"".freeze,
- # gcc's list file output options are complex; no use of ${3} parameter in default config
- "-MMD".freeze,
- "-MF \"${4}\"".freeze,
- ].freeze
- }
-
-DEFAULT_RELEASE_ASSEMBLER_TOOL = {
- :executable => FilePathUtils.os_executable_ext('as').freeze,
- :name => 'default_release_assembler'.freeze,
- :stderr_redirect => StdErrRedirect::NONE.freeze,
- :background_exec => BackgroundExec::NONE.freeze,
- :optional => false.freeze,
- :arguments => [
- {"-I\"$\"" => 'COLLECTION_PATHS_SOURCE_AND_INCLUDE'}.freeze,
- "\"${1}\"".freeze,
- "-o \"${2}\"".freeze,
- ].freeze
- }
-
-DEFAULT_RELEASE_LINKER_TOOL = {
- :executable => FilePathUtils.os_executable_ext('gcc').freeze,
- :name => 'default_release_linker'.freeze,
- :stderr_redirect => StdErrRedirect::NONE.freeze,
- :background_exec => BackgroundExec::NONE.freeze,
- :optional => false.freeze,
- :arguments => [
- "\"${1}\"".freeze,
- "-o \"${2}\"".freeze,
- "".freeze,
- "${4}".freeze
- ].freeze
- }
-
-
-DEFAULT_TOOLS_TEST = {
- :tools => {
- :test_compiler => DEFAULT_TEST_COMPILER_TOOL,
- :test_linker => DEFAULT_TEST_LINKER_TOOL,
- :test_fixture => DEFAULT_TEST_FIXTURE_TOOL,
- }
- }
-
-DEFAULT_TOOLS_TEST_PREPROCESSORS = {
- :tools => {
- :test_includes_preprocessor => DEFAULT_TEST_INCLUDES_PREPROCESSOR_TOOL,
- :test_file_preprocessor => DEFAULT_TEST_FILE_PREPROCESSOR_TOOL,
- }
- }
-
-DEFAULT_TOOLS_TEST_DEPENDENCIES = {
- :tools => {
- :test_dependencies_generator => DEFAULT_TEST_DEPENDENCIES_GENERATOR_TOOL,
- }
- }
-
-
-DEFAULT_TOOLS_RELEASE = {
- :tools => {
- :release_compiler => DEFAULT_RELEASE_COMPILER_TOOL,
- :release_linker => DEFAULT_RELEASE_LINKER_TOOL,
- }
- }
-
-DEFAULT_TOOLS_RELEASE_ASSEMBLER = {
- :tools => {
- :release_assembler => DEFAULT_RELEASE_ASSEMBLER_TOOL,
- }
- }
-
-DEFAULT_TOOLS_RELEASE_DEPENDENCIES = {
- :tools => {
- :release_dependencies_generator => DEFAULT_RELEASE_DEPENDENCIES_GENERATOR_TOOL,
- }
- }
-
-
-DEFAULT_RELEASE_TARGET_NAME = 'project'
-
-DEFAULT_CEEDLING_CONFIG = {
- :project => {
- # :build_root must be set by user
- :use_exceptions => true,
- :use_mocks => true,
- :compile_threads => 1,
- :test_threads => 1,
- :use_test_preprocessor => false,
- :use_deep_dependencies => false,
- :generate_deep_dependencies => true, # only applicable if use_deep_dependencies is true
- :test_file_prefix => 'test_',
- :options_paths => [],
- :release_build => false,
- },
-
- :release_build => {
- # :output is set while building configuration -- allows smart default system-dependent file extension handling
- :use_assembly => false,
- :artifacts => [],
- },
-
- :paths => {
- :test => [], # must be populated by user
- :source => [], # must be populated by user
- :support => [],
- :include => [],
- :test_toolchain_include => [],
- :release_toolchain_include => [],
- },
-
- :files => {
- :test => [],
- :source => [],
- :assembly => [],
- :support => [],
- :include => [],
- },
-
- # unlike other top-level entries, environment's value is an array to preserve order
- :environment => [
- # when evaluated, this provides wider text field for rake task comments
- {:rake_columns => '120'},
- ],
-
- :defines => {
- :test => [],
- :test_preprocess => [],
- :release => [],
- :release_preprocess => [],
- :use_test_definition => false,
- },
-
- :libraries => {
- :test => [],
- :test_preprocess => [],
- :release => [],
- :release_preprocess => [],
- },
-
- :flags => {},
-
- :extension => {
- :header => '.h',
- :source => '.c',
- :assembly => '.s',
- :object => '.o',
- :executable => ( SystemWrapper.windows? ? EXTENSION_WIN_EXE : EXTENSION_NONWIN_EXE ),
- :map => '.map',
- :list => '.lst',
- :testpass => '.pass',
- :testfail => '.fail',
- :dependencies => '.d',
- },
-
- :unity => {
- :vendor_path => CEEDLING_VENDOR,
- :defines => []
- },
-
- :cmock => {
- :vendor_path => CEEDLING_VENDOR,
- :defines => [],
- :includes => []
- },
-
- :cexception => {
- :vendor_path => CEEDLING_VENDOR,
- :defines => []
- },
-
- :test_runner => {
- :includes => [],
- :file_suffix => '_runner',
- },
-
- # all tools populated while building up config structure
- :tools => {},
-
- # empty argument lists for default tools
- # (these can be overridden in project file to add arguments to tools without totally redefining tools)
- :test_compiler => { :arguments => [] },
- :test_linker => { :arguments => [] },
- :test_fixture => {
- :arguments => [],
- :link_objects => [], # compiled object files to always be linked in (e.g. cmock.o if using mocks)
- },
- :test_includes_preprocessor => { :arguments => [] },
- :test_file_preprocessor => { :arguments => [] },
- :test_dependencies_generator => { :arguments => [] },
- :release_compiler => { :arguments => [] },
- :release_linker => { :arguments => [] },
- :release_assembler => { :arguments => [] },
- :release_dependencies_generator => { :arguments => [] },
-
- :plugins => {
- :load_paths => CEEDLING_PLUGINS,
- :enabled => [],
- }
- }.freeze
-
-
-DEFAULT_TESTS_RESULTS_REPORT_TEMPLATE = %q{
-% ignored = hash[:results][:counts][:ignored]
-% failed = hash[:results][:counts][:failed]
-% stdout_count = hash[:results][:counts][:stdout]
-% header_prepend = ((hash[:header].length > 0) ? "#{hash[:header]}: " : '')
-% banner_width = 25 + header_prepend.length # widest message
-
-% if (stdout_count > 0)
-<%=@ceedling[:plugin_reportinator].generate_banner(header_prepend + 'TEST OUTPUT')%>
-% hash[:results][:stdout].each do |string|
-% string[:collection].each do |item|
-<%=string[:source][:path]%><%=File::SEPARATOR%><%=string[:source][:file]%>: "<%=item%>"
-% end
-% end
-
-% end
-% if (ignored > 0)
-<%=@ceedling[:plugin_reportinator].generate_banner(header_prepend + 'IGNORED TEST SUMMARY')%>
-% hash[:results][:ignores].each do |ignore|
-% ignore[:collection].each do |item|
-<%=ignore[:source][:path]%><%=File::SEPARATOR%><%=ignore[:source][:file]%>:<%=item[:line]%>:<%=item[:test]%>
-% if (item[:message].length > 0)
-: "<%=item[:message]%>"
-% else
-<%="\n"%>
-% end
-% end
-% end
-
-% end
-% if (failed > 0)
-<%=@ceedling[:plugin_reportinator].generate_banner(header_prepend + 'FAILED TEST SUMMARY')%>
-% hash[:results][:failures].each do |failure|
-% failure[:collection].each do |item|
-<%=failure[:source][:path]%><%=File::SEPARATOR%><%=failure[:source][:file]%>:<%=item[:line]%>:<%=item[:test]%>
-% if (item[:message].length > 0)
-: "<%=item[:message]%>"
-% else
-<%="\n"%>
-% end
-% end
-% end
-
-% end
-% total_string = hash[:results][:counts][:total].to_s
-% format_string = "%#{total_string.length}i"
-<%=@ceedling[:plugin_reportinator].generate_banner(header_prepend + 'OVERALL TEST SUMMARY')%>
-% if (hash[:results][:counts][:total] > 0)
-TESTED: <%=hash[:results][:counts][:total].to_s%>
-PASSED: <%=sprintf(format_string, hash[:results][:counts][:passed])%>
-FAILED: <%=sprintf(format_string, failed)%>
-IGNORED: <%=sprintf(format_string, ignored)%>
-% else
-
-No tests executed.
-% end
-
-}
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/dependinator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/dependinator.rb
deleted file mode 100755
index ebd12377..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/dependinator.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-
-class Dependinator
-
- constructor :configurator, :project_config_manager, :test_includes_extractor, :file_path_utils, :rake_wrapper, :file_wrapper
-
- def touch_force_rebuild_files
- @file_wrapper.touch( @configurator.project_test_force_rebuild_filepath )
- @file_wrapper.touch( @configurator.project_release_force_rebuild_filepath ) if (@configurator.project_release_build)
- end
-
-
-
- def load_release_object_deep_dependencies(dependencies_list)
- dependencies_list.each do |dependencies_file|
- if File.exists?(dependencies_file)
- @rake_wrapper.load_dependencies( dependencies_file )
- end
- end
- end
-
-
- def enhance_release_file_dependencies(files)
- files.each do |filepath|
- @rake_wrapper[filepath].enhance( [@configurator.project_release_force_rebuild_filepath] ) if (@project_config_manager.release_config_changed)
- end
- end
-
-
-
- def load_test_object_deep_dependencies(files_list)
- dependencies_list = @file_path_utils.form_test_dependencies_filelist(files_list)
- dependencies_list.each do |dependencies_file|
- if File.exists?(dependencies_file)
- @rake_wrapper.load_dependencies(dependencies_file)
- end
- end
- end
-
-
- def enhance_runner_dependencies(runner_filepath)
- @rake_wrapper[runner_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed ||
- @project_config_manager.test_defines_changed)
- end
-
-
- def enhance_shallow_include_lists_dependencies(include_lists)
- include_lists.each do |include_list_filepath|
- @rake_wrapper[include_list_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed ||
- @project_config_manager.test_defines_changed)
- end
- end
-
-
- def enhance_preprocesed_file_dependencies(files)
- files.each do |filepath|
- @rake_wrapper[filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed ||
- @project_config_manager.test_defines_changed)
- end
- end
-
-
- def enhance_mock_dependencies(mocks_list)
- # if input configuration or ceedling changes, make sure these guys get rebuilt
- mocks_list.each do |mock_filepath|
- @rake_wrapper[mock_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed ||
- @project_config_manager.test_defines_changed)
- @rake_wrapper[mock_filepath].enhance( @configurator.cmock_unity_helper ) if (@configurator.cmock_unity_helper)
- end
- end
-
-
- def enhance_dependencies_dependencies(dependencies)
- dependencies.each do |dependencies_filepath|
- @rake_wrapper[dependencies_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed ||
- @project_config_manager.test_defines_changed)
- end
- end
-
-
- def enhance_test_build_object_dependencies(objects)
- objects.each do |object_filepath|
- @rake_wrapper[object_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed ||
- @project_config_manager.test_defines_changed)
- end
- end
-
-
- def enhance_results_dependencies(result_filepath)
- @rake_wrapper[result_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed ||
- @project_config_manager.test_defines_changed)
- end
-
-
- def setup_test_executable_dependencies(test, objects)
- @rake_wrapper.create_file_task( @file_path_utils.form_test_executable_filepath(test), objects )
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/erb_wrapper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/erb_wrapper.rb
deleted file mode 100755
index 8d70b6d2..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/erb_wrapper.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'erb'
-
-class ErbWrapper
- def generate_file(template, data, output_file)
- File.open(output_file, "w") do |f|
- f << ERB.new(template, 0, "<>").result(binding)
- end
- end
-end \ No newline at end of file
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/file_finder.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/file_finder.rb
deleted file mode 100755
index 53775b7b..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/file_finder.rb
+++ /dev/null
@@ -1,149 +0,0 @@
-require 'rubygems'
-require 'rake' # for adding ext() method to string
-require 'thread'
-
-
-class FileFinder
- SEMAPHORE = Mutex.new
-
- constructor :configurator, :file_finder_helper, :cacheinator, :file_path_utils, :file_wrapper, :yaml_wrapper
-
- def prepare_search_sources
- @all_test_source_and_header_file_collection =
- @configurator.collection_all_tests +
- @configurator.collection_all_source +
- @configurator.collection_all_headers
- end
-
-
- def find_header_file(mock_file)
- header = File.basename(mock_file).sub(/#{@configurator.cmock_mock_prefix}/, '').ext(@configurator.extension_header)
-
- found_path = @file_finder_helper.find_file_in_collection(header, @configurator.collection_all_headers, :error)
-
- return found_path
- end
-
-
- def find_header_input_for_mock_file(mock_file)
- found_path = find_header_file(mock_file)
- mock_input = found_path
-
- if (@configurator.project_use_test_preprocessor)
- mock_input = @cacheinator.diff_cached_test_file( @file_path_utils.form_preprocessed_file_filepath( found_path ) )
- end
-
- return mock_input
- end
-
-
- def find_source_from_test(test, complain)
- test_prefix = @configurator.project_test_file_prefix
- source_paths = @configurator.collection_all_source
-
- source = File.basename(test).sub(/#{test_prefix}/, '')
-
- # we don't blow up if a test file has no corresponding source file
- return @file_finder_helper.find_file_in_collection(source, source_paths, complain)
- end
-
-
- def find_test_from_runner_path(runner_path)
- extension_source = @configurator.extension_source
-
- test_file = File.basename(runner_path).sub(/#{@configurator.test_runner_file_suffix}#{'\\'+extension_source}/, extension_source)
-
- found_path = @file_finder_helper.find_file_in_collection(test_file, @configurator.collection_all_tests, :error)
-
- return found_path
- end
-
-
- def find_test_input_for_runner_file(runner_path)
- found_path = find_test_from_runner_path(runner_path)
- runner_input = found_path
-
- if (@configurator.project_use_test_preprocessor)
- runner_input = @cacheinator.diff_cached_test_file( @file_path_utils.form_preprocessed_file_filepath( found_path ) )
- end
-
- return runner_input
- end
-
-
- def find_test_from_file_path(file_path)
- test_file = File.basename(file_path).ext(@configurator.extension_source)
-
- found_path = @file_finder_helper.find_file_in_collection(test_file, @configurator.collection_all_tests, :error)
-
- return found_path
- end
-
-
- def find_test_or_source_or_header_file(file_path)
- file = File.basename(file_path)
- return @file_finder_helper.find_file_in_collection(file, @all_test_source_and_header_file_collection, :error)
- end
-
-
- def find_compilation_input_file(file_path, complain=:error, release=false)
- found_file = nil
-
- source_file = File.basename(file_path).ext(@configurator.extension_source)
-
- # We only collect files that already exist when we start up.
- # FileLists can produce undesired results for dynamically generated files depending on when they're accessed.
- # So collect mocks and runners separately and right now.
-
- SEMAPHORE.synchronize {
-
- if (source_file =~ /#{@configurator.test_runner_file_suffix}/)
- found_file =
- @file_finder_helper.find_file_in_collection(
- source_file,
- @file_wrapper.directory_listing( File.join(@configurator.project_test_runners_path, '*') ),
- complain)
-
- elsif (@configurator.project_use_mocks and (source_file =~ /#{@configurator.cmock_mock_prefix}/))
- found_file =
- @file_finder_helper.find_file_in_collection(
- source_file,
- @file_wrapper.directory_listing( File.join(@configurator.cmock_mock_path, '*') ),
- complain)
-
- elsif release
- found_file =
- @file_finder_helper.find_file_in_collection(
- source_file,
- @configurator.collection_release_existing_compilation_input,
- complain)
- else
- temp_complain = (defined?(TEST_BUILD_USE_ASSEMBLY) && TEST_BUILD_USE_ASSEMBLY) ? :ignore : complain
- found_file =
- @file_finder_helper.find_file_in_collection(
- source_file,
- @configurator.collection_all_existing_compilation_input,
- temp_complain)
- found_file ||= find_assembly_file(file_path, false) if (defined?(TEST_BUILD_USE_ASSEMBLY) && TEST_BUILD_USE_ASSEMBLY)
- end
- }
- return found_file
- end
-
-
- def find_source_file(file_path, complain)
- source_file = File.basename(file_path).ext(@configurator.extension_source)
- return @file_finder_helper.find_file_in_collection(source_file, @configurator.collection_all_source, complain)
- end
-
-
- def find_assembly_file(file_path, complain = :error)
- assembly_file = File.basename(file_path).ext(@configurator.extension_assembly)
- return @file_finder_helper.find_file_in_collection(assembly_file, @configurator.collection_all_assembly, complain)
- end
-
- def find_file_from_list(file_path, file_list, complain)
- return @file_finder_helper.find_file_in_collection(file_path, file_list, complain)
- end
-end
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/file_finder_helper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/file_finder_helper.rb
deleted file mode 100755
index 0a31b44b..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/file_finder_helper.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'fileutils'
-require 'ceedling/constants' # for Verbosity enumeration
-
-class FileFinderHelper
-
- constructor :streaminator
-
-
- def find_file_in_collection(file_name, file_list, complain, extra_message="")
- file_to_find = nil
-
- file_list.each do |item|
- base_file = File.basename(item)
-
- # case insensitive comparison
- if (base_file.casecmp(file_name) == 0)
- # case sensitive check
- if (base_file == file_name)
- file_to_find = item
- break
- else
- blow_up(file_name, "However, a filename having different capitalization was found: '#{item}'.")
- end
- end
-
- end
-
- case (complain)
- when :error then blow_up(file_name, extra_message) if (file_to_find.nil?)
- when :warn then gripe(file_name, extra_message) if (file_to_find.nil?)
- #when :ignore then
- end
-
- return file_to_find
- end
-
- private
-
- def blow_up(file_name, extra_message="")
- error = "ERROR: Found no file '#{file_name}' in search paths."
- error += ' ' if (extra_message.length > 0)
- @streaminator.stderr_puts(error + extra_message, Verbosity::ERRORS)
- raise
- end
-
- def gripe(file_name, extra_message="")
- warning = "WARNING: Found no file '#{file_name}' in search paths."
- warning += ' ' if (extra_message.length > 0)
- @streaminator.stderr_puts(warning + extra_message, Verbosity::COMPLAIN)
- end
-
-end
-
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/file_path_utils.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/file_path_utils.rb
deleted file mode 100755
index 607039fd..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/file_path_utils.rb
+++ /dev/null
@@ -1,200 +0,0 @@
-require 'rubygems'
-require 'rake' # for ext()
-require 'fileutils'
-require 'ceedling/system_wrapper'
-
-# global utility methods (for plugins, project files, etc.)
-def ceedling_form_filepath(destination_path, original_filepath, new_extension=nil)
- filename = File.basename(original_filepath)
- filename.replace(filename.ext(new_extension)) if (!new_extension.nil?)
- return File.join( destination_path.gsub(/\\/, '/'), filename )
-end
-
-class FilePathUtils
-
- GLOB_MATCHER = /[\*\?\{\}\[\]]/
-
- constructor :configurator, :file_wrapper
-
-
- ######### class methods ##########
-
- # standardize path to use '/' path separator & have no trailing path separator
- def self.standardize(path)
- path.strip!
- path.gsub!(/\\/, '/')
- path.chomp!('/')
- return path
- end
-
- def self.os_executable_ext(executable)
- return executable.ext('.exe') if SystemWrapper.windows?
- return executable
- end
-
- # extract directory path from between optional add/subtract aggregation modifiers and up to glob specifiers
- # note: slightly different than File.dirname in that /files/foo remains /files/foo and does not become /files
- def self.extract_path(path)
- path = path.sub(/^(\+|-):/, '')
-
- # find first occurrence of path separator followed by directory glob specifier: *, ?, {, }, [, ]
- find_index = (path =~ GLOB_MATCHER)
-
- # no changes needed (lop off final path separator)
- return path.chomp('/') if (find_index.nil?)
-
- # extract up to first glob specifier
- path = path[0..(find_index-1)]
-
- # lop off everything up to and including final path separator
- find_index = path.rindex('/')
- return path[0..(find_index-1)] if (not find_index.nil?)
-
- # return string up to first glob specifier if no path separator found
- return path
- end
-
- # return whether the given path is to be aggregated (no aggregation modifier defaults to same as +:)
- def self.add_path?(path)
- return (path =~ /^-:/).nil?
- end
-
- # get path (and glob) lopping off optional +: / -: prefixed aggregation modifiers
- def self.extract_path_no_aggregation_operators(path)
- return path.sub(/^(\+|-):/, '')
- end
-
- # all the globs that may be in a path string work fine with one exception;
- # to recurse through all subdirectories, the glob is dir/**/** but our paths use
- # convention of only dir/**
- def self.reform_glob(path)
- return path if (path =~ /\/\*\*$/).nil?
- return path + '/**'
- end
-
- ######### instance methods ##########
-
- def form_temp_path(filepath, prefix='')
- return File.join( @configurator.project_temp_path, prefix + File.basename(filepath) )
- end
-
- ### release ###
- def form_release_build_cache_path(filepath)
- return File.join( @configurator.project_release_build_cache_path, File.basename(filepath) )
- end
-
- def form_release_dependencies_filepath(filepath)
- return File.join( @configurator.project_release_dependencies_path, File.basename(filepath).ext(@configurator.extension_dependencies) )
- end
-
- def form_release_build_c_object_filepath(filepath)
- return File.join( @configurator.project_release_build_output_c_path, File.basename(filepath).ext(@configurator.extension_object) )
- end
-
- def form_release_build_asm_object_filepath(filepath)
- return File.join( @configurator.project_release_build_output_asm_path, File.basename(filepath).ext(@configurator.extension_object) )
- end
-
- def form_release_build_c_objects_filelist(files)
- return (@file_wrapper.instantiate_file_list(files)).pathmap("#{@configurator.project_release_build_output_c_path}/%n#{@configurator.extension_object}")
- end
-
- def form_release_build_asm_objects_filelist(files)
- return (@file_wrapper.instantiate_file_list(files)).pathmap("#{@configurator.project_release_build_output_asm_path}/%n#{@configurator.extension_object}")
- end
-
- def form_release_build_c_list_filepath(filepath)
- return File.join( @configurator.project_release_build_output_c_path, File.basename(filepath).ext(@configurator.extension_list) )
- end
-
- def form_release_dependencies_filelist(files)
- return (@file_wrapper.instantiate_file_list(files)).pathmap("#{@configurator.project_release_dependencies_path}/%n#{@configurator.extension_dependencies}")
- end
-
- ### tests ###
- def form_test_build_cache_path(filepath)
- return File.join( @configurator.project_test_build_cache_path, File.basename(filepath) )
- end
-
- def form_test_dependencies_filepath(filepath)
- return File.join( @configurator.project_test_dependencies_path, File.basename(filepath).ext(@configurator.extension_dependencies) )
- end
-
- def form_pass_results_filepath(filepath)
- return File.join( @configurator.project_test_results_path, File.basename(filepath).ext(@configurator.extension_testpass) )
- end
-
- def form_fail_results_filepath(filepath)
- return File.join( @configurator.project_test_results_path, File.basename(filepath).ext(@configurator.extension_testfail) )
- end
-
- def form_runner_filepath_from_test(filepath)
- return File.join( @configurator.project_test_runners_path, File.basename(filepath, @configurator.extension_source)) + @configurator.test_runner_file_suffix + @configurator.extension_source
- end
-
- def form_test_filepath_from_runner(filepath)
- return filepath.sub(/#{TEST_RUNNER_FILE_SUFFIX}/, '')
- end
-
- def form_runner_object_filepath_from_test(filepath)
- return (form_test_build_c_object_filepath(filepath)).sub(/(#{@configurator.extension_object})$/, "#{@configurator.test_runner_file_suffix}\\1")
- end
-
- def form_test_build_c_object_filepath(filepath)
- return File.join( @configurator.project_test_build_output_c_path, File.basename(filepath).ext(@configurator.extension_object) )
- end
-
- def form_test_build_asm_object_filepath(filepath)
- return File.join( @configurator.project_test_build_output_asm_path, File.basename(filepath).ext(@configurator.extension_object) )
- end
-
- def form_test_executable_filepath(filepath)
- return File.join( @configurator.project_test_build_output_path, File.basename(filepath).ext(@configurator.extension_executable) )
- end
-
- def form_test_build_map_filepath(filepath)
- return File.join( @configurator.project_test_build_output_path, File.basename(filepath).ext(@configurator.extension_map) )
- end
-
- def form_test_build_list_filepath(filepath)
- return File.join( @configurator.project_test_build_output_path, File.basename(filepath).ext(@configurator.extension_list) )
- end
-
- def form_preprocessed_file_filepath(filepath)
- return File.join( @configurator.project_test_preprocess_files_path, File.basename(filepath) )
- end
-
- def form_preprocessed_includes_list_filepath(filepath)
- return File.join( @configurator.project_test_preprocess_includes_path, File.basename(filepath) )
- end
-
- def form_test_build_objects_filelist(sources)
- return (@file_wrapper.instantiate_file_list(sources)).pathmap("#{@configurator.project_test_build_output_c_path}/%n#{@configurator.extension_object}")
- end
-
- def form_preprocessed_mockable_headers_filelist(mocks)
- list = @file_wrapper.instantiate_file_list(mocks)
- headers = list.map do |file|
- module_name = File.basename(file).sub(/^#{@configurator.cmock_mock_prefix}/, '').sub(/\.[a-zA-Z]+$/,'')
- "#{@configurator.project_test_preprocess_files_path}/#{module_name}#{@configurator.extension_header}"
- end
- return headers
- end
-
- def form_mocks_source_filelist(mocks)
- list = (@file_wrapper.instantiate_file_list(mocks))
- sources = list.map{|file| "#{@configurator.cmock_mock_path}/#{file}#{@configurator.extension_source}"}
- return sources
- end
-
- def form_test_dependencies_filelist(files)
- list = @file_wrapper.instantiate_file_list(files)
- return list.pathmap("#{@configurator.project_test_dependencies_path}/%n#{@configurator.extension_dependencies}")
- end
-
- def form_pass_results_filelist(path, files)
- list = @file_wrapper.instantiate_file_list(files)
- return list.pathmap("#{path}/%n#{@configurator.extension_testpass}")
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/file_system_utils.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/file_system_utils.rb
deleted file mode 100755
index 97e5856f..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/file_system_utils.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-require 'rubygems'
-require 'rake'
-require 'set'
-require 'fileutils'
-require 'ceedling/file_path_utils'
-
-
-class FileSystemUtils
-
- constructor :file_wrapper
-
- # build up path list from input of one or more strings or arrays of (+/-) paths & globs
- def collect_paths(*paths)
- raw = [] # all paths and globs
- plus = Set.new # all paths to expand and add
- minus = Set.new # all paths to remove from plus set
-
- # assemble all globs and simple paths, reforming our glob notation to ruby globs
- paths.each do |paths_container|
- case (paths_container)
- when String then raw << (FilePathUtils::reform_glob(paths_container))
- when Array then paths_container.each {|path| raw << (FilePathUtils::reform_glob(path))}
- else raise "Don't know how to handle #{paths_container.class}"
- end
- end
-
- # iterate through each path and glob
- raw.each do |path|
-
- dirs = [] # container for only (expanded) paths
-
- # if a glob, expand it and slurp up all non-file paths
- if path.include?('*')
- # grab base directory only if globs are snug up to final path separator
- if (path =~ /\/\*+$/)
- dirs << FilePathUtils.extract_path(path)
- end
-
- # grab expanded sub-directory globs
- expanded = @file_wrapper.directory_listing( FilePathUtils.extract_path_no_aggregation_operators(path) )
- expanded.each do |entry|
- dirs << entry if @file_wrapper.directory?(entry)
- end
-
- # else just grab simple path
- # note: we could just run this through glob expansion but such an
- # approach doesn't handle a path not yet on disk)
- else
- dirs << FilePathUtils.extract_path_no_aggregation_operators(path)
- end
-
- # add dirs to the appropriate set based on path aggregation modifier if present
- FilePathUtils.add_path?(path) ? plus.merge(dirs) : minus.merge(dirs)
- end
-
- return (plus - minus).to_a.uniq
- end
-
-
- # given a file list, add to it or remove from it
- def revise_file_list(list, revisions)
- revisions.each do |revision|
- # include or exclude file or glob to file list
- file = FilePathUtils.extract_path_no_aggregation_operators( revision )
- FilePathUtils.add_path?(revision) ? list.include(file) : list.exclude(file)
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/file_system_wrapper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/file_system_wrapper.rb
deleted file mode 100755
index 807cbd23..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/file_system_wrapper.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-
-class FileSystemWrapper
-
- def cd(path)
- FileUtils.cd path do
- yield
- end
- end
-
-end \ No newline at end of file
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/file_wrapper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/file_wrapper.rb
deleted file mode 100755
index 1680ca52..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/file_wrapper.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-require 'rubygems'
-require 'rake' # for FileList
-require 'fileutils'
-require 'ceedling/constants'
-
-
-class FileWrapper
-
- def get_expanded_path(path)
- return File.expand_path(path)
- end
-
- def basename(path, extension=nil)
- return File.basename(path, extension) if extension
- return File.basename(path)
- end
-
- def exist?(filepath)
- return true if (filepath == NULL_FILE_PATH)
- return File.exist?(filepath)
- end
-
- def directory?(path)
- return File.directory?(path)
- end
-
- def dirname(path)
- return File.dirname(path)
- end
-
- def directory_listing(glob)
- return Dir.glob(glob, File::FNM_PATHNAME)
- end
-
- def rm_f(filepath, options={})
- FileUtils.rm_f(filepath, options)
- end
-
- def rm_r(filepath, options={})
- FileUtils.rm_r(filepath, options={})
- end
-
- def cp(source, destination, options={})
- FileUtils.cp(source, destination, options)
- end
-
- def compare(from, to)
- return FileUtils.compare_file(from, to)
- end
-
- def open(filepath, flags)
- File.open(filepath, flags) do |file|
- yield(file)
- end
- end
-
- def read(filepath)
- return File.read(filepath)
- end
-
- def touch(filepath, options={})
- FileUtils.touch(filepath, options)
- end
-
- def write(filepath, contents, flags='w')
- File.open(filepath, flags) do |file|
- file.write(contents)
- end
- end
-
- def readlines(filepath)
- return File.readlines(filepath)
- end
-
- def instantiate_file_list(files=[])
- return FileList.new(files)
- end
-
- def mkdir(folder)
- return FileUtils.mkdir_p(folder)
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/flaginator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/flaginator.rb
deleted file mode 100755
index 31d62c46..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/flaginator.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-require 'rubygems'
-require 'rake' # for ext()
-require 'fileutils'
-require 'ceedling/constants'
-
-
-# :flags:
-# :release:
-# :compile:
-# :'test_.+'
-# - -pedantic # add '-pedantic' to every test file
-# :*: # add '-foo' to compilation of all files not main.c
-# - -foo
-# :main: # add '-Wall' to compilation of main.c
-# - -Wall
-# :test:
-# :link:
-# :test_main: # add '--bar --baz' to linking of test_main.exe
-# - --bar
-# - --baz
-
-def partition(hash, &predicate)
- hash.partition(&predicate).map(&:to_h)
-end
-
-class Flaginator
-
- constructor :configurator
-
- def get_flag(hash, file_name)
- file_key = file_name.to_sym
-
- # 1. try literals
- literals, magic = partition(hash) { |k, v| k.to_s =~ /^\w+$/ }
- return literals[file_key] if literals.include?(file_key)
-
- any, regex = partition(magic) { |k, v| (k == :'*') || (k == :'.*') } # glob or regex wild card
-
- # 2. try regexes
- find_res = regex.find { |k, v| file_name =~ /^#{k.to_s}$/ }
- return find_res[1] if find_res
-
- # 3. try anything
- find_res = any.find { |k, v| file_name =~ /.*/ }
- return find_res[1] if find_res
-
- # 4. well, we've tried
- return []
- end
-
- def flag_down( operation, context, file )
- # create configurator accessor method
- accessor = ('flags_' + context.to_s).to_sym
-
- # create simple filename key from whatever filename provided
- file_name = File.basename( file ).ext('')
- file_key = File.basename( file ).ext('').to_sym
-
- # if no entry in configuration for flags for this context, bail out
- return [] if not @configurator.respond_to?( accessor )
-
- # get flags sub hash associated with this context
- flags = @configurator.send( accessor )
-
- # if operation not represented in flags hash, bail out
- return [] if not flags.include?( operation )
-
- # redefine flags to sub hash associated with the operation
- flags = flags[operation]
-
- return get_flag(flags, file_name)
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/generator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/generator.rb
deleted file mode 100755
index 828a0c02..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/generator.rb
+++ /dev/null
@@ -1,183 +0,0 @@
-require 'ceedling/constants'
-
-class Generator
-
- constructor :configurator,
- :generator_helper,
- :preprocessinator,
- :cmock_builder,
- :generator_test_runner,
- :generator_test_results,
- :flaginator,
- :test_includes_extractor,
- :tool_executor,
- :file_finder,
- :file_path_utils,
- :streaminator,
- :plugin_manager,
- :file_wrapper
-
-
- def generate_shallow_includes_list(context, file)
- @streaminator.stdout_puts("Generating include list for #{File.basename(file)}...", Verbosity::NORMAL)
- @preprocessinator.preprocess_shallow_includes(file)
- end
-
- def generate_preprocessed_file(context, file)
- @streaminator.stdout_puts("Preprocessing #{File.basename(file)}...", Verbosity::NORMAL)
- @preprocessinator.preprocess_file(file)
- end
-
- def generate_dependencies_file(tool, context, source, object, dependencies)
- @streaminator.stdout_puts("Generating dependencies for #{File.basename(source)}...", Verbosity::NORMAL)
-
- command =
- @tool_executor.build_command_line(
- tool,
- [], # extra per-file command line parameters
- source,
- dependencies,
- object)
-
- @tool_executor.exec( command[:line], command[:options] )
- end
-
- def generate_mock(context, header_filepath)
- arg_hash = {:header_file => header_filepath, :context => context}
- @plugin_manager.pre_mock_generate( arg_hash )
-
- begin
- @cmock_builder.cmock.setup_mocks( arg_hash[:header_file] )
- rescue
- raise
- ensure
- @plugin_manager.post_mock_generate( arg_hash )
- end
- end
-
- # test_filepath may be either preprocessed test file or original test file
- def generate_test_runner(context, test_filepath, runner_filepath)
- arg_hash = {:context => context, :test_file => test_filepath, :runner_file => runner_filepath}
- @plugin_manager.pre_runner_generate(arg_hash)
-
- # collect info we need
- module_name = File.basename(arg_hash[:test_file])
- test_cases = @generator_test_runner.find_test_cases( @file_finder.find_test_from_runner_path(runner_filepath) )
- mock_list = @test_includes_extractor.lookup_raw_mock_list(arg_hash[:test_file])
-
- @streaminator.stdout_puts("Generating runner for #{module_name}...", Verbosity::NORMAL)
-
- test_file_includes = [] # Empty list for now, since apparently unused
-
- # build runner file
- begin
- @generator_test_runner.generate(module_name, runner_filepath, test_cases, mock_list, test_file_includes)
- rescue
- raise
- ensure
- @plugin_manager.post_runner_generate(arg_hash)
- end
- end
-
- def generate_object_file(tool, operation, context, source, object, list='', dependencies='')
- shell_result = {}
- arg_hash = {:tool => tool, :operation => operation, :context => context, :source => source, :object => object, :list => list, :dependencies => dependencies}
- @plugin_manager.pre_compile_execute(arg_hash)
-
- @streaminator.stdout_puts("Compiling #{File.basename(arg_hash[:source])}...", Verbosity::NORMAL)
- command =
- @tool_executor.build_command_line( arg_hash[:tool],
- @flaginator.flag_down( operation, context, source ),
- arg_hash[:source],
- arg_hash[:object],
- arg_hash[:list],
- arg_hash[:dependencies])
-
- @streaminator.stdout_puts("Command: #{command}", Verbosity::DEBUG)
-
- begin
- shell_result = @tool_executor.exec( command[:line], command[:options] )
- rescue ShellExecutionException => ex
- shell_result = ex.shell_result
- raise ex
- ensure
- arg_hash[:shell_result] = shell_result
- @plugin_manager.post_compile_execute(arg_hash)
- end
- end
-
- def generate_executable_file(tool, context, objects, executable, map='', libraries=[])
- shell_result = {}
- arg_hash = { :tool => tool,
- :context => context,
- :objects => objects,
- :executable => executable,
- :map => map,
- :libraries => libraries
- }
-
- @plugin_manager.pre_link_execute(arg_hash)
-
- @streaminator.stdout_puts("Linking #{File.basename(arg_hash[:executable])}...", Verbosity::NORMAL)
- command =
- @tool_executor.build_command_line( arg_hash[:tool],
- @flaginator.flag_down( OPERATION_LINK_SYM, context, executable ),
- arg_hash[:objects],
- arg_hash[:executable],
- arg_hash[:map],
- arg_hash[:libraries]
- )
- @streaminator.stdout_puts("Command: #{command}", Verbosity::DEBUG)
-
- begin
- shell_result = @tool_executor.exec( command[:line], command[:options] )
- rescue ShellExecutionException => ex
- notice = "\n" +
- "NOTICE: If the linker reports missing symbols, the following may be to blame:\n" +
- " 1. Test lacks #include statements corresponding to needed source files.\n" +
- " 2. Project search paths do not contain source files corresponding to #include statements in the test.\n"
-
- if (@configurator.project_use_mocks)
- notice += " 3. Test does not #include needed mocks.\n\n"
- else
- notice += "\n"
- end
-
- @streaminator.stderr_puts(notice, Verbosity::COMPLAIN)
- shell_result = ex.shell_result
- raise ''
- ensure
- arg_hash[:shell_result] = shell_result
- @plugin_manager.post_link_execute(arg_hash)
- end
- end
-
- def generate_test_results(tool, context, executable, result)
- arg_hash = {:tool => tool, :context => context, :executable => executable, :result_file => result}
- @plugin_manager.pre_test_fixture_execute(arg_hash)
-
- @streaminator.stdout_puts("Running #{File.basename(arg_hash[:executable])}...", Verbosity::NORMAL)
-
- # Unity's exit code is equivalent to the number of failed tests, so we tell @tool_executor not to fail out if there are failures
- # so that we can run all tests and collect all results
- command = @tool_executor.build_command_line(arg_hash[:tool], [], arg_hash[:executable])
- @streaminator.stdout_puts("Command: #{command}", Verbosity::DEBUG)
- command[:options][:boom] = false
- shell_result = @tool_executor.exec( command[:line], command[:options] )
-
- #Don't Let The Failure Count Make Us Believe Things Aren't Working
- shell_result[:exit_code] = 0
- @generator_helper.test_results_error_handler(executable, shell_result)
-
- processed = @generator_test_results.process_and_write_results( shell_result,
- arg_hash[:result_file],
- @file_finder.find_test_from_file_path(arg_hash[:executable]) )
-
- arg_hash[:result_file] = processed[:result_file]
- arg_hash[:results] = processed[:results]
- arg_hash[:shell_result] = shell_result # for raw output display if no plugins for formatted display
-
- @plugin_manager.post_test_fixture_execute(arg_hash)
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/generator_helper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/generator_helper.rb
deleted file mode 100755
index 34315609..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/generator_helper.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'ceedling/constants'
-
-
-class GeneratorHelper
-
- constructor :streaminator
-
-
- def test_results_error_handler(executable, shell_result)
- notice = ''
- error = false
-
- if (shell_result[:output].nil? or shell_result[:output].strip.empty?)
- error = true
- # mirror style of generic tool_executor failure output
- notice = "\n" +
- "ERROR: Test executable \"#{File.basename(executable)}\" failed.\n" +
- "> Produced no output to $stdout.\n"
- elsif ((shell_result[:output] =~ TEST_STDOUT_STATISTICS_PATTERN).nil?)
- error = true
- # mirror style of generic tool_executor failure output
- notice = "\n" +
- "ERROR: Test executable \"#{File.basename(executable)}\" failed.\n" +
- "> Produced no final test result counts in $stdout:\n" +
- "#{shell_result[:output].strip}\n"
- end
-
- if (error)
- # since we told the tool executor to ignore the exit code, handle it explicitly here
- notice += "> And exited with status: [#{shell_result[:exit_code]}] (count of failed tests).\n" if (shell_result[:exit_code] != nil)
- notice += "> And then likely crashed.\n" if (shell_result[:exit_code] == nil)
-
- notice += "> This is often a symptom of a bad memory access in source or test code.\n\n"
-
- @streaminator.stderr_puts(notice, Verbosity::COMPLAIN)
- raise
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/generator_test_results.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/generator_test_results.rb
deleted file mode 100755
index 1d0c5201..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/generator_test_results.rb
+++ /dev/null
@@ -1,89 +0,0 @@
-require 'rubygems'
-require 'rake' # for .ext()
-require 'ceedling/constants'
-
-class GeneratorTestResults
-
- constructor :configurator, :generator_test_results_sanity_checker, :yaml_wrapper
-
- def process_and_write_results(unity_shell_result, results_file, test_file)
- output_file = results_file
-
- results = get_results_structure
-
- results[:source][:path] = File.dirname(test_file)
- results[:source][:file] = File.basename(test_file)
- results[:time] = unity_shell_result[:time] unless unity_shell_result[:time].nil?
-
- # process test statistics
- if (unity_shell_result[:output] =~ TEST_STDOUT_STATISTICS_PATTERN)
- results[:counts][:total] = $1.to_i
- results[:counts][:failed] = $2.to_i
- results[:counts][:ignored] = $3.to_i
- results[:counts][:passed] = (results[:counts][:total] - results[:counts][:failed] - results[:counts][:ignored])
- end
-
- # remove test statistics lines
- output_string = unity_shell_result[:output].sub(TEST_STDOUT_STATISTICS_PATTERN, '')
-
- output_string.lines do |line|
- # process unity output
- case line
- when /(:IGNORE)/
- elements = extract_line_elements(line, results[:source][:file])
- results[:ignores] << elements[0]
- results[:stdout] << elements[1] if (!elements[1].nil?)
- when /(:PASS$)/
- elements = extract_line_elements(line, results[:source][:file])
- results[:successes] << elements[0]
- results[:stdout] << elements[1] if (!elements[1].nil?)
- when /(:FAIL)/
- elements = extract_line_elements(line, results[:source][:file])
- results[:failures] << elements[0]
- results[:stdout] << elements[1] if (!elements[1].nil?)
- else # collect up all other
- results[:stdout] << line.chomp
- end
- end
-
- @generator_test_results_sanity_checker.verify(results, unity_shell_result[:exit_code])
-
- output_file = results_file.ext(@configurator.extension_testfail) if (results[:counts][:failed] > 0)
-
- @yaml_wrapper.dump(output_file, results)
-
- return { :result_file => output_file, :result => results }
- end
-
- private
-
- def get_results_structure
- return {
- :source => {:path => '', :file => ''},
- :successes => [],
- :failures => [],
- :ignores => [],
- :counts => {:total => 0, :passed => 0, :failed => 0, :ignored => 0},
- :stdout => [],
- :time => 0.0
- }
- end
-
- def extract_line_elements(line, filename)
- # handle anything preceding filename in line as extra output to be collected
- stdout = nil
- stdout_regex = /(.+)#{Regexp.escape(filename)}.+/i
-
- if (line =~ stdout_regex)
- stdout = $1.clone
- line.sub!(/#{Regexp.escape(stdout)}/, '')
- end
-
- # collect up test results minus and extra output
- elements = (line.strip.split(':'))[1..-1]
-
- return {:test => elements[1], :line => elements[0].to_i, :message => (elements[3..-1].join(':')).strip}, stdout if elements.size >= 3
- return {:test => '???', :line => -1, :message => nil} #fallback safe option. TODO better handling
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/generator_test_results_sanity_checker.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/generator_test_results_sanity_checker.rb
deleted file mode 100755
index 0b518325..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/generator_test_results_sanity_checker.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require 'rubygems'
-require 'rake' # for ext() method
-require 'ceedling/constants'
-
-
-class GeneratorTestResultsSanityChecker
-
- constructor :configurator, :streaminator
-
- def verify(results, unity_exit_code)
-
- # do no sanity checking if it's disabled
- return if (@configurator.sanity_checks == TestResultsSanityChecks::NONE)
- raise "results nil or empty" if results.nil? || results.empty?
-
- ceedling_ignores_count = results[:ignores].size
- ceedling_failures_count = results[:failures].size
- ceedling_tests_summation = (ceedling_ignores_count + ceedling_failures_count + results[:successes].size)
-
- # Exit code handling is not a sanity check that can always be performed because
- # command line simulators may or may not pass through Unity's exit code
- if (@configurator.sanity_checks >= TestResultsSanityChecks::THOROUGH)
- # many platforms limit exit codes to a maximum of 255
- if ((ceedling_failures_count != unity_exit_code) and (unity_exit_code < 255))
- sanity_check_warning(results[:source][:file], "Unity's exit code (#{unity_exit_code}) does not match Ceedling's summation of failed test cases (#{ceedling_failures_count}).")
- end
-
- if ((ceedling_failures_count < 255) and (unity_exit_code == 255))
- sanity_check_warning(results[:source][:file], "Ceedling's summation of failed test cases (#{ceedling_failures_count}) is less than Unity's exit code (255 or more).")
- end
- end
-
- if (ceedling_ignores_count != results[:counts][:ignored])
- sanity_check_warning(results[:source][:file], "Unity's final ignore count (#{results[:counts][:ignored]}) does not match Ceedling's summation of ignored test cases (#{ceedling_ignores_count}).")
- end
-
- if (ceedling_failures_count != results[:counts][:failed])
- sanity_check_warning(results[:source][:file], "Unity's final fail count (#{results[:counts][:failed]}) does not match Ceedling's summation of failed test cases (#{ceedling_failures_count}).")
- end
-
- if (ceedling_tests_summation != results[:counts][:total])
- sanity_check_warning(results[:source][:file], "Unity's final test count (#{results[:counts][:total]}) does not match Ceedling's summation of all test cases (#{ceedling_tests_summation}).")
- end
-
- end
-
- private
-
- def sanity_check_warning(file, message)
- unless defined?(CEEDLING_IGNORE_SANITY_CHECK)
- notice = "\n" +
- "ERROR: Internal sanity check for test fixture '#{file.ext(@configurator.extension_executable)}' finds that #{message}\n" +
- " Possible causes:\n" +
- " 1. Your test + source dereferenced a null pointer.\n" +
- " 2. Your test + source indexed past the end of a buffer.\n" +
- " 3. Your test + source committed a memory access violation.\n" +
- " 4. Your test fixture produced an exit code of 0 despite execution ending prematurely.\n" +
- " Sanity check failures of test results are usually a symptom of interrupted test execution.\n\n"
-
- @streaminator.stderr_puts( notice )
- raise
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/generator_test_runner.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/generator_test_runner.rb
deleted file mode 100755
index 6999faf9..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/generator_test_runner.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-
-class GeneratorTestRunner
-
- constructor :configurator, :file_path_utils, :file_wrapper
-
- def find_test_cases(test_file)
-
- #Pull in Unity's Test Runner Generator
- require 'generate_test_runner.rb'
- @test_runner_generator ||= UnityTestRunnerGenerator.new( @configurator.get_runner_config )
-
- if (@configurator.project_use_test_preprocessor)
-
- #redirect to use the preprocessor file if we're doing that sort of thing
- pre_test_file = @file_path_utils.form_preprocessed_file_filepath(test_file)
-
- #actually look for the tests using Unity's test runner generator
- contents = @file_wrapper.read(pre_test_file)
- tests_and_line_numbers = @test_runner_generator.find_tests(contents)
- @test_runner_generator.find_setup_and_teardown(contents)
-
- #look up the line numbers in the original file
- source_lines = @file_wrapper.read(test_file).split("\n")
- source_index = 0;
- tests_and_line_numbers.size.times do |i|
- source_lines[source_index..-1].each_with_index do |line, index|
- if (line =~ /#{tests_and_line_numbers[i][:test]}/)
- source_index += index
- tests_and_line_numbers[i][:line_number] = source_index + 1
- break
- end
- end
- end
- else
- #Just look for the tests using Unity's test runner generator
- contents = @file_wrapper.read(test_file)
- tests_and_line_numbers = @test_runner_generator.find_tests(contents)
- @test_runner_generator.find_setup_and_teardown(contents)
- end
-
- return tests_and_line_numbers
- end
-
- def generate(module_name, runner_filepath, test_cases, mock_list, test_file_includes=[])
- require 'generate_test_runner.rb'
-
- #actually build the test runner using Unity's test runner generator
- #(there is no need to use preprocessor here because we've already looked up test cases and are passing them in here)
- @test_runner_generator ||= UnityTestRunnerGenerator.new( @configurator.get_runner_config )
- @test_runner_generator.generate( module_name,
- runner_filepath,
- test_cases,
- mock_list,
- test_file_includes)
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/loginator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/loginator.rb
deleted file mode 100755
index 92276e1d..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/loginator.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-
-class Loginator
-
- constructor :configurator, :project_file_loader, :project_config_manager, :file_wrapper, :system_wrapper
-
-
- def setup_log_filepath
- config_files = []
- config_files << @project_file_loader.main_file
- config_files << @project_file_loader.user_file
- config_files.concat( @project_config_manager.options_files )
- config_files.compact!
- config_files.map! { |file| file.ext('') }
-
- log_name = config_files.join( '_' )
-
- @project_log_filepath = File.join( @configurator.project_log_path, log_name.ext('.log') )
- end
-
-
- def log(string, heading=nil)
- return if (not @configurator.project_logging)
-
- output = "\n[#{@system_wrapper.time_now}]"
- output += " :: #{heading}" if (not heading.nil?)
- output += "\n#{string.strip}\n"
-
- @file_wrapper.write(@project_log_filepath, output, 'a')
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/makefile.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/makefile.rb
deleted file mode 100755
index c3d7496d..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/makefile.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-
-# modified version of Rake's provided make-style dependency loader
-# customizations:
-# (1) handles windows drives in paths -- colons don't confuse task demarcation
-# (2) handles spaces in directory paths
-
-module Rake
-
- # Makefile loader to be used with the import file loader.
- class MakefileLoader
-
- # Load the makefile dependencies in +fn+.
- def load(fn)
- open(fn) do |mf|
- lines = mf.read
- lines.gsub!(/#[^\n]*\n/m, "") # remove comments
- lines.gsub!(/\\\n/, ' ') # string together line continuations into single line
- lines.split("\n").each do |line|
- process_line(line)
- end
- end
- end
-
- private
-
- # Process one logical line of makefile data.
- def process_line(line)
- # split on presence of task demaractor followed by space (i.e don't get confused by a colon in a win path)
- file_tasks, args = line.split(/:\s/)
-
- return if args.nil?
-
- # split at non-escaped space boundary between files (i.e. escaped spaces in paths are left alone)
- dependents = args.split(/\b\s+/)
- # replace escaped spaces and clean up any extra whitespace
- dependents.map! { |path| path.gsub(/\\ /, ' ').strip }
-
- file_tasks.strip.split.each do |file_task|
- file file_task => dependents
- end
- end
- end
-
- # Install the handler
- Rake.application.add_loader('mf', MakefileLoader.new)
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/objects.yml b/tinyusb/test/vendor/ceedling/lib/ceedling/objects.yml
deleted file mode 100755
index 2e2e9b9d..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/objects.yml
+++ /dev/null
@@ -1,310 +0,0 @@
-
-file_wrapper:
-
-file_system_wrapper:
-
-stream_wrapper:
-
-rake_wrapper:
-
-yaml_wrapper:
-
-system_wrapper:
-
-cmock_builder:
-
-reportinator:
-
-rake_utils:
- compose:
- - rake_wrapper
-
-system_utils:
- compose:
- - system_wrapper
-
-file_path_utils:
- compose:
- - configurator
- - file_wrapper
-
-file_system_utils:
- compose: file_wrapper
-
-project_file_loader:
- compose:
- - yaml_wrapper
- - stream_wrapper
- - system_wrapper
- - file_wrapper
-
-project_config_manager:
- compose:
- - cacheinator
- - configurator
- - yaml_wrapper
- - file_wrapper
-
-cacheinator:
- compose:
- - cacheinator_helper
- - file_path_utils
- - file_wrapper
- - yaml_wrapper
-
-cacheinator_helper:
- compose:
- - file_wrapper
- - yaml_wrapper
-
-tool_executor:
- compose:
- - configurator
- - tool_executor_helper
- - streaminator
- - system_wrapper
-
-tool_executor_helper:
- compose:
- - streaminator
- - system_utils
- - system_wrapper
-
-configurator:
- compose:
- - configurator_setup
- - configurator_plugins
- - configurator_builder
- - cmock_builder
- - yaml_wrapper
- - system_wrapper
-
-configurator_setup:
- compose:
- - configurator_builder
- - configurator_validator
- - configurator_plugins
- - stream_wrapper
-
-configurator_plugins:
- compose:
- - stream_wrapper
- - file_wrapper
- - system_wrapper
-
-configurator_validator:
- compose:
- - file_wrapper
- - stream_wrapper
- - system_wrapper
-
-configurator_builder:
- compose:
- - file_system_utils
- - file_wrapper
- - system_wrapper
-
-loginator:
- compose:
- - configurator
- - project_file_loader
- - project_config_manager
- - file_wrapper
- - system_wrapper
-
-streaminator:
- compose:
- - streaminator_helper
- - verbosinator
- - loginator
- - stream_wrapper
-
-streaminator_helper:
-
-setupinator:
-
-plugin_builder:
-
-plugin_manager:
- compose:
- - configurator
- - plugin_manager_helper
- - streaminator
- - reportinator
- - system_wrapper
-
-plugin_manager_helper:
-
-plugin_reportinator:
- compose:
- - plugin_reportinator_helper
- - plugin_manager
- - reportinator
-
-plugin_reportinator_helper:
- compose:
- - configurator
- - streaminator
- - yaml_wrapper
- - file_wrapper
-
-verbosinator:
- compose: configurator
-
-file_finder:
- compose:
- - configurator
- - file_finder_helper
- - cacheinator
- - file_path_utils
- - file_wrapper
- - yaml_wrapper
-
-file_finder_helper:
- compose: streaminator
-
-test_includes_extractor:
- compose:
- - configurator
- - yaml_wrapper
- - file_wrapper
-
-task_invoker:
- compose:
- - dependinator
- - rake_utils
- - rake_wrapper
- - project_config_manager
-
-flaginator:
- compose:
- - configurator
-
-generator:
- compose:
- - configurator
- - generator_helper
- - preprocessinator
- - cmock_builder
- - generator_test_runner
- - generator_test_results
- - flaginator
- - test_includes_extractor
- - tool_executor
- - file_finder
- - file_path_utils
- - streaminator
- - plugin_manager
- - file_wrapper
-
-generator_helper:
- compose:
- - streaminator
-
-generator_test_results:
- compose:
- - configurator
- - generator_test_results_sanity_checker
- - yaml_wrapper
-
-generator_test_results_sanity_checker:
- compose:
- - configurator
- - streaminator
-
-generator_test_runner:
- compose:
- - configurator
- - file_path_utils
- - file_wrapper
-
-dependinator:
- compose:
- - configurator
- - project_config_manager
- - test_includes_extractor
- - file_path_utils
- - rake_wrapper
- - file_wrapper
-
-preprocessinator:
- compose:
- - preprocessinator_helper
- - preprocessinator_includes_handler
- - preprocessinator_file_handler
- - task_invoker
- - file_path_utils
- - yaml_wrapper
-
-preprocessinator_helper:
- compose:
- - configurator
- - test_includes_extractor
- - task_invoker
- - file_finder
- - file_path_utils
-
-preprocessinator_includes_handler:
- compose:
- - configurator
- - tool_executor
- - task_invoker
- - file_path_utils
- - yaml_wrapper
- - file_wrapper
-
-preprocessinator_file_handler:
- compose:
- - preprocessinator_extractor
- - configurator
- - tool_executor
- - file_path_utils
- - file_wrapper
-
-preprocessinator_extractor:
-
-test_invoker:
- compose:
- - configurator
- - test_invoker_helper
- - plugin_manager
- - streaminator
- - preprocessinator
- - task_invoker
- - dependinator
- - project_config_manager
- - build_invoker_utils
- - file_path_utils
- - file_wrapper
-
-test_invoker_helper:
- compose:
- - configurator
- - task_invoker
- - test_includes_extractor
- - file_finder
- - file_path_utils
- - file_wrapper
-
-release_invoker:
- compose:
- - configurator
- - release_invoker_helper
- - build_invoker_utils
- - dependinator
- - task_invoker
- - file_path_utils
- - file_wrapper
-
-release_invoker_helper:
- compose:
- - configurator
- - dependinator
- - task_invoker
-
-build_invoker_utils:
- compose:
- - configurator
- - streaminator
-
-erb_wrapper:
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/par_map.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/par_map.rb
deleted file mode 100755
index 98198a2c..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/par_map.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-def par_map(n, things, &block)
- queue = Queue.new
- things.each { |thing| queue << thing }
- threads = (1..n).collect do
- Thread.new do
- begin
- while true
- yield queue.pop(true)
- end
- rescue ThreadError
-
- end
- end
- end
- threads.each { |t| t.join }
-end
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/plugin.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/plugin.rb
deleted file mode 100755
index f20b3a3b..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/plugin.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-
-class String
- # reformat a multiline string to have given number of whitespace columns;
- # helpful for formatting heredocs
- def left_margin(margin=0)
- non_whitespace_column = 0
- new_lines = []
-
- # find first line with non-whitespace and count left columns of whitespace
- self.each_line do |line|
- if (line =~ /^\s*\S/)
- non_whitespace_column = $&.length - 1
- break
- end
- end
-
- # iterate through each line, chopping off leftmost whitespace columns and add back the desired whitespace margin
- self.each_line do |line|
- columns = []
- margin.times{columns << ' '}
- # handle special case of line being narrower than width to be lopped off
- if (non_whitespace_column < line.length)
- new_lines << "#{columns.join}#{line[non_whitespace_column..-1]}"
- else
- new_lines << "\n"
- end
- end
-
- return new_lines.join
- end
-end
-
-class Plugin
- attr_reader :name, :environment
- attr_accessor :plugin_objects
-
- def initialize(system_objects, name)
- @environment = []
- @ceedling = system_objects
- @name = name
- self.setup
- end
-
- def setup; end
-
- # mock generation
- def pre_mock_generate(arg_hash); end
- def post_mock_generate(arg_hash); end
-
- # test runner generation
- def pre_runner_generate(arg_hash); end
- def post_runner_generate(arg_hash); end
-
- # compilation (test or source)
- def pre_compile_execute(arg_hash); end
- def post_compile_execute(arg_hash); end
-
- # linking (test or source)
- def pre_link_execute(arg_hash); end
- def post_link_execute(arg_hash); end
-
- # test fixture execution
- def pre_test_fixture_execute(arg_hash); end
- def post_test_fixture_execute(arg_hash); end
-
- # test task
- def pre_test(test); end
- def post_test(test); end
-
- # release task
- def pre_release; end
- def post_release; end
-
- # whole shebang (any use of Ceedling)
- def pre_build; end
- def post_build; end
-
- def summary; end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_builder.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_builder.rb
deleted file mode 100755
index 1269141f..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_builder.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-require 'ceedling/plugin'
-
-class PluginBuilder
-
- attr_accessor :plugin_objects
-
- def construct_plugin(plugin_name, object_map_yaml, system_objects)
- # @streaminator.stdout_puts("Constructing plugin #{plugin_name}...", Verbosity::OBNOXIOUS)
- object_map = {}
- @plugin_objects = {}
- @system_objects = system_objects
-
- if object_map_yaml
- @object_map = YAML.load(object_map_yaml)
- @object_map.each_key do |obj|
- construct_object(obj)
- end
- else
- raise "Invalid object map for plugin #{plugin_name}!"
- end
-
- return @plugin_objects
- end
-
- private
-
- def camelize(underscored_name)
- return underscored_name.gsub(/(_|^)([a-z0-9])/) {$2.upcase}
- end
-
- def construct_object(obj)
- if @plugin_objects[obj].nil?
- if @object_map[obj] && @object_map[obj]['compose']
- @object_map[obj]['compose'].each do |dep|
- construct_object(dep)
- end
- end
- build_object(obj)
- end
- end
-
- def build_object(new_object)
- if @plugin_objects[new_object.to_sym].nil?
- # @streaminator.stdout_puts("Building plugin object #{new_object}", Verbosity::OBNOXIOUS)
- require new_object
- class_name = camelize(new_object)
- new_instance = eval("#{class_name}.new(@system_objects, class_name.to_s)")
- new_instance.plugin_objects = @plugin_objects
- @plugin_objects[new_object.to_sym] = new_instance
- end
- end
-
-end \ No newline at end of file
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_manager.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_manager.rb
deleted file mode 100755
index 0468f2fc..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_manager.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-require 'ceedling/constants'
-
-class PluginManager
-
- constructor :configurator, :plugin_manager_helper, :streaminator, :reportinator, :system_wrapper
-
- def setup
- @build_fail_registry = []
- @plugin_objects = [] # so we can preserve order
- end
-
- def load_plugin_scripts(script_plugins, system_objects)
- environment = []
-
- script_plugins.each do |plugin|
- # protect against instantiating object multiple times due to processing config multiple times (option files, etc)
- next if (@plugin_manager_helper.include?(@plugin_objects, plugin))
- begin
- @system_wrapper.require_file( "#{plugin}.rb" )
- object = @plugin_manager_helper.instantiate_plugin_script( camelize(plugin), system_objects, plugin )
- @plugin_objects << object
- environment += object.environment
-
- # add plugins to hash of all system objects
- system_objects[plugin.downcase.to_sym] = object
- rescue
- puts "Exception raised while trying to load plugin: #{plugin}"
- raise
- end
- end
-
- yield( { :environment => environment } ) if (environment.size > 0)
- end
-
- def plugins_failed?
- return (@build_fail_registry.size > 0)
- end
-
- def print_plugin_failures
- if (@build_fail_registry.size > 0)
- report = @reportinator.generate_banner('BUILD FAILURE SUMMARY')
-
- @build_fail_registry.each do |failure|
- report += "#{' - ' if (@build_fail_registry.size > 1)}#{failure}\n"
- end
-
- report += "\n"
-
- @streaminator.stderr_puts(report, Verbosity::ERRORS)
- end
- end
-
- def register_build_failure(message)
- @build_fail_registry << message if (message and not message.empty?)
- end
-
- #### execute all plugin methods ####
-
- def pre_mock_generate(arg_hash); execute_plugins(:pre_mock_generate, arg_hash); end
- def post_mock_generate(arg_hash); execute_plugins(:post_mock_generate, arg_hash); end
-
- def pre_runner_generate(arg_hash); execute_plugins(:pre_runner_generate, arg_hash); end
- def post_runner_generate(arg_hash); execute_plugins(:post_runner_generate, arg_hash); end
-
- def pre_compile_execute(arg_hash); execute_plugins(:pre_compile_execute, arg_hash); end
- def post_compile_execute(arg_hash); execute_plugins(:post_compile_execute, arg_hash); end
-
- def pre_link_execute(arg_hash); execute_plugins(:pre_link_execute, arg_hash); end
- def post_link_execute(arg_hash); execute_plugins(:post_link_execute, arg_hash); end
-
- def pre_test_fixture_execute(arg_hash); execute_plugins(:pre_test_fixture_execute, arg_hash); end
- def post_test_fixture_execute(arg_hash)
- # special arbitration: raw test results are printed or taken over by plugins handling the job
- @streaminator.stdout_puts(arg_hash[:shell_result][:output]) if (@configurator.plugins_display_raw_test_results)
- execute_plugins(:post_test_fixture_execute, arg_hash)
- end
-
- def pre_test(test); execute_plugins(:pre_test, test); end
- def post_test(test); execute_plugins(:post_test, test); end
-
- def pre_release; execute_plugins(:pre_release); end
- def post_release; execute_plugins(:post_release); end
-
- def pre_build; execute_plugins(:pre_build); end
- def post_build; execute_plugins(:post_build); end
- def post_error; execute_plugins(:post_error); end
-
- def summary; execute_plugins(:summary); end
-
- private ####################################
-
- def camelize(underscored_name)
- return underscored_name.gsub(/(_|^)([a-z0-9])/) {$2.upcase}
- end
-
- def execute_plugins(method, *args)
- @plugin_objects.each do |plugin|
- begin
- plugin.send(method, *args) if plugin.respond_to?(method)
- rescue
- puts "Exception raised in plugin: #{plugin.name}, in method #{method}"
- raise
- end
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_manager_helper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_manager_helper.rb
deleted file mode 100755
index b18248a6..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_manager_helper.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-
-class PluginManagerHelper
-
- def include?(plugins, name)
- include = false
- plugins.each do |plugin|
- if (plugin.name == name)
- include = true
- break
- end
- end
- return include
- end
-
- def instantiate_plugin_script(plugin, system_objects, name)
- return eval("#{plugin}.new(system_objects, name)")
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_reportinator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_reportinator.rb
deleted file mode 100755
index 8d83727b..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_reportinator.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-require 'ceedling/constants'
-require 'ceedling/defaults'
-
-class PluginReportinator
-
- constructor :plugin_reportinator_helper, :plugin_manager, :reportinator
-
- def setup
- @test_results_template = nil
- end
-
-
- def set_system_objects(system_objects)
- @plugin_reportinator_helper.ceedling = system_objects
- end
-
-
- def fetch_results(results_path, test, options={:boom => false})
- return @plugin_reportinator_helper.fetch_results( File.join(results_path, test), options )
- end
-
-
- def generate_banner(message)
- return @reportinator.generate_banner(message)
- end
-
-
- def assemble_test_results(results_list, options={:boom => false})
- aggregated_results = get_results_structure
-
- results_list.each do |result_path|
- results = @plugin_reportinator_helper.fetch_results( result_path, options )
- @plugin_reportinator_helper.process_results(aggregated_results, results)
- end
-
- return aggregated_results
- end
-
-
- def register_test_results_template(template)
- @test_results_template = template if (@test_results_template.nil?)
- end
-
-
- def run_test_results_report(hash, verbosity=Verbosity::NORMAL, &block)
- run_report( $stdout,
- ((@test_results_template.nil?) ? DEFAULT_TESTS_RESULTS_REPORT_TEMPLATE : @test_results_template),
- hash,
- verbosity,
- &block )
- end
-
-
- def run_report(stream, template, hash=nil, verbosity=Verbosity::NORMAL)
- failure = nil
- failure = yield() if block_given?
-
- @plugin_manager.register_build_failure( failure )
-
- @plugin_reportinator_helper.run_report( stream, template, hash, verbosity )
- end
-
- private ###############################
-
- def get_results_structure
- return {
- :successes => [],
- :failures => [],
- :ignores => [],
- :stdout => [],
- :counts => {:total => 0, :passed => 0, :failed => 0, :ignored => 0, :stdout => 0},
- :time => 0.0
- }
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_reportinator_helper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_reportinator_helper.rb
deleted file mode 100755
index 322a530b..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/plugin_reportinator_helper.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'erb'
-require 'rubygems'
-require 'rake' # for ext()
-require 'ceedling/constants'
-
-class PluginReportinatorHelper
-
- attr_writer :ceedling
-
- constructor :configurator, :streaminator, :yaml_wrapper, :file_wrapper
-
- def fetch_results(results_path, options)
- pass_path = File.join(results_path.ext( @configurator.extension_testpass ))
- fail_path = File.join(results_path.ext( @configurator.extension_testfail ))
-
- if (@file_wrapper.exist?(fail_path))
- return @yaml_wrapper.load(fail_path)
- elsif (@file_wrapper.exist?(pass_path))
- return @yaml_wrapper.load(pass_path)
- else
- if (options[:boom])
- @streaminator.stderr_puts("Could find no test results for '#{File.basename(results_path).ext(@configurator.extension_source)}'", Verbosity::ERRORS)
- raise
- end
- end
-
- return {}
- end
-
-
- def process_results(aggregate_results, results)
- return if (results.empty?)
- aggregate_results[:successes] << { :source => results[:source].clone, :collection => results[:successes].clone } if (results[:successes].size > 0)
- aggregate_results[:failures] << { :source => results[:source].clone, :collection => results[:failures].clone } if (results[:failures].size > 0)
- aggregate_results[:ignores] << { :source => results[:source].clone, :collection => results[:ignores].clone } if (results[:ignores].size > 0)
- aggregate_results[:stdout] << { :source => results[:source].clone, :collection => results[:stdout].clone } if (results[:stdout].size > 0)
- aggregate_results[:counts][:total] += results[:counts][:total]
- aggregate_results[:counts][:passed] += results[:counts][:passed]
- aggregate_results[:counts][:failed] += results[:counts][:failed]
- aggregate_results[:counts][:ignored] += results[:counts][:ignored]
- aggregate_results[:counts][:stdout] += results[:stdout].size
- aggregate_results[:time] += results[:time]
- end
-
-
- def run_report(stream, template, hash, verbosity)
- output = ERB.new(template, 0, "%<>")
- @streaminator.stream_puts(stream, output.result(binding()), verbosity)
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator.rb
deleted file mode 100755
index f07750dd..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-
-class Preprocessinator
-
- attr_reader :preprocess_file_proc
-
- constructor :preprocessinator_helper, :preprocessinator_includes_handler, :preprocessinator_file_handler, :task_invoker, :file_path_utils, :yaml_wrapper
-
-
- def setup
- # fashion ourselves callbacks @preprocessinator_helper can use
- @preprocess_includes_proc = Proc.new { |filepath| self.preprocess_shallow_includes(filepath) }
- @preprocess_file_proc = Proc.new { |filepath| self.preprocess_file(filepath) }
- end
-
-
- def preprocess_test_and_invoke_test_mocks(test)
- @preprocessinator_helper.preprocess_includes(test, @preprocess_includes_proc)
-
- mocks_list = @preprocessinator_helper.assemble_mocks_list(test)
-
- @preprocessinator_helper.preprocess_mockable_headers(mocks_list, @preprocess_file_proc)
-
- @task_invoker.invoke_test_mocks(mocks_list)
-
- @preprocessinator_helper.preprocess_test_file(test, @preprocess_file_proc)
-
- return mocks_list
- end
-
- def preprocess_shallow_includes(filepath)
- includes = @preprocessinator_includes_handler.extract_includes(filepath)
-
- @preprocessinator_includes_handler.write_shallow_includes_list(
- @file_path_utils.form_preprocessed_includes_list_filepath(filepath), includes)
- end
-
- def preprocess_file(filepath)
- @preprocessinator_includes_handler.invoke_shallow_includes_list(filepath)
- @preprocessinator_file_handler.preprocess_file( filepath, @yaml_wrapper.load(@file_path_utils.form_preprocessed_includes_list_filepath(filepath)) )
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_extractor.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_extractor.rb
deleted file mode 100755
index 49509a8b..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_extractor.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-class PreprocessinatorExtractor
- def extract_base_file_from_preprocessed_expansion(filepath)
- # preprocessing by way of toolchain preprocessor expands macros, eliminates
- # comments, strips out #ifdef code, etc. however, it also expands in place
- # each #include'd file. so, we must extract only the lines of the file
- # that belong to the file originally preprocessed
-
- # iterate through all lines and alternate between extract and ignore modes
- # all lines between a '#'line containing file name of our filepath and the
- # next '#'line should be extracted
-
- base_name = File.basename(filepath)
- not_pragma = /^#(?!pragma\b)/ # preprocessor directive that's not a #pragma
- pattern = /^#.*(\s|\/|\\|\")#{Regexp.escape(base_name)}/
- found_file = false # have we found the file we care about?
-
- lines = []
- File.readlines(filepath).each do |line|
- if found_file and not line =~ not_pragma
- lines << line
- else
- found_file = false
- end
-
- found_file = true if line =~ pattern
- end
-
- return lines
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_file_handler.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_file_handler.rb
deleted file mode 100755
index b6b5efbc..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_file_handler.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-class PreprocessinatorFileHandler
-
- constructor :preprocessinator_extractor, :configurator, :tool_executor, :file_path_utils, :file_wrapper
-
-
- def preprocess_file(filepath, includes)
- preprocessed_filepath = @file_path_utils.form_preprocessed_file_filepath(filepath)
-
- command = @tool_executor.build_command_line(@configurator.tools_test_file_preprocessor, [], filepath, preprocessed_filepath)
- @tool_executor.exec(command[:line], command[:options])
-
- contents = @preprocessinator_extractor.extract_base_file_from_preprocessed_expansion(preprocessed_filepath)
-
- includes.each{|include| contents.unshift("#include \"#{include}\"")}
-
- @file_wrapper.write(preprocessed_filepath, contents.join("\n"))
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_helper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_helper.rb
deleted file mode 100755
index 1419a561..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_helper.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-class PreprocessinatorHelper
-
- constructor :configurator, :test_includes_extractor, :task_invoker, :file_finder, :file_path_utils
-
-
- def preprocess_includes(test, preprocess_includes_proc)
- if (@configurator.project_use_test_preprocessor)
- preprocessed_includes_list = @file_path_utils.form_preprocessed_includes_list_filepath(test)
- preprocess_includes_proc.call( @file_finder.find_test_from_file_path(preprocessed_includes_list) )
- @test_includes_extractor.parse_includes_list(preprocessed_includes_list)
- else
- @test_includes_extractor.parse_test_file(test)
- end
- end
-
- def assemble_mocks_list(test)
- return @file_path_utils.form_mocks_source_filelist( @test_includes_extractor.lookup_raw_mock_list(test) )
- end
-
- def preprocess_mockable_headers(mock_list, preprocess_file_proc)
- if (@configurator.project_use_test_preprocessor)
- preprocess_files_smartly(
- @file_path_utils.form_preprocessed_mockable_headers_filelist(mock_list),
- preprocess_file_proc ) { |file| @file_finder.find_header_file(file) }
- end
- end
-
- def preprocess_test_file(test, preprocess_file_proc)
- return if (!@configurator.project_use_test_preprocessor)
-
- preprocess_file_proc.call(test)
- end
-
- private ############################
-
- def preprocess_files_smartly(file_list, preprocess_file_proc)
- if (@configurator.project_use_deep_dependencies)
- @task_invoker.invoke_test_preprocessed_files(file_list)
- else
- file_list.each { |file| preprocess_file_proc.call( yield(file) ) }
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_includes_handler.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_includes_handler.rb
deleted file mode 100755
index 703c84f3..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/preprocessinator_includes_handler.rb
+++ /dev/null
@@ -1,181 +0,0 @@
-
-
-class PreprocessinatorIncludesHandler
-
- constructor :configurator, :tool_executor, :task_invoker, :file_path_utils, :yaml_wrapper, :file_wrapper
- @@makefile_cache = {}
-
- # shallow includes: only those headers a source file explicitly includes
-
- def invoke_shallow_includes_list(filepath)
- @task_invoker.invoke_test_shallow_include_lists( [@file_path_utils.form_preprocessed_includes_list_filepath(filepath)] )
- end
-
- ##
- # Ask the preprocessor for a make-style dependency rule of only the headers
- # the source file immediately includes.
- #
- # === Arguments
- # +filepath+ _String_:: Path to the test file to process.
- #
- # === Return
- # _String_:: The text of the dependency rule generated by the preprocessor.
- def form_shallow_dependencies_rule(filepath)
- if @@makefile_cache.has_key?(filepath)
- return @@makefile_cache[filepath]
- end
- # change filename (prefix of '_') to prevent preprocessor from finding
- # include files in temp directory containing file it's scanning
- temp_filepath = @file_path_utils.form_temp_path(filepath, '_')
-
- # read the file and replace all include statements with a decorated version
- # (decorating the names creates file names that don't exist, thus preventing
- # the preprocessor from snaking out and discovering the entire include path
- # that winds through the code). The decorated filenames indicate files that
- # are included directly by the test file.
- contents = @file_wrapper.read(filepath)
-
- if !contents.valid_encoding?
- contents = contents.encode("UTF-16be", :invalid=>:replace, :replace=>"?").encode('UTF-8')
- end
-
- contents.gsub!( /^\s*#include\s+[\"<]\s*(\S+)\s*[\">]/, "#include \"\\1\"\n#include \"@@@@\\1\"" )
- contents.gsub!( /^\s*TEST_FILE\(\s*\"\s*(\S+)\s*\"\s*\)/, "#include \"\\1\"\n#include \"@@@@\\1\"")
- @file_wrapper.write( temp_filepath, contents )
-
- # extract the make-style dependency rule telling the preprocessor to
- # ignore the fact that it can't find the included files
- command = @tool_executor.build_command_line(@configurator.tools_test_includes_preprocessor, [], temp_filepath)
- shell_result = @tool_executor.exec(command[:line], command[:options])
-
- @@makefile_cache[filepath] = shell_result[:output]
- return shell_result[:output]
- end
-
- ##
- # Extract the headers that are directly included by a source file using the
- # provided, annotated Make dependency rule.
- #
- # === Arguments
- # +filepath+ _String_:: C source or header file to extract includes for.
- #
- # === Return
- # _Array_ of _String_:: Array of the direct dependencies for the source file.
- def extract_includes(filepath)
- to_process = [filepath]
- ignore_list = []
- list = []
-
- include_paths = @configurator.project_config_hash[:collection_paths_include]
- include_paths = [] if include_paths.nil?
- include_paths.map! {|path| File.expand_path(path)}
-
- while to_process.length > 0
- target = to_process.shift()
- ignore_list << target
- # puts "[HELL] Processing: \t\t#{target}"
- new_deps, new_to_process = extract_includes_helper(target, include_paths, ignore_list)
- list += new_deps
- to_process += new_to_process
- if (!@configurator.project_config_hash.has_key?(:project_auto_link_deep_dependencies) or
- !@configurator.project_config_hash[:project_auto_link_deep_dependencies])
- break
- else
- list = list.uniq()
- to_process = to_process.uniq()
- end
- end
-
- return list
- end
-
- def extract_includes_helper(filepath, include_paths, ignore_list)
- # Extract the dependencies from the make rule
- hdr_ext = @configurator.extension_header
- make_rule = self.form_shallow_dependencies_rule(filepath)
- dependencies = make_rule.split.find_all {|path| path.end_with?(hdr_ext) }.uniq
- dependencies.map! {|hdr| hdr.gsub('\\','/') }
-
- # Separate the real files form the annotated ones and remove the '@@@@'
- annotated_headers, real_headers = dependencies.partition {|hdr| hdr =~ /^@@@@/ }
- annotated_headers.map! {|hdr| hdr.gsub('@@@@','') }
- # Matching annotated_headers values against real_headers to ensure that
- # annotated_headers contain full path entries (as returned by make rule)
- annotated_headers.map! {|hdr| real_headers.find {|real_hdr| !real_hdr.match(/(.*\/)?#{Regexp.escape(hdr)}/).nil? } }
- annotated_headers = annotated_headers.compact
-
- # Find which of our annotated headers are "real" dependencies. This is
- # intended to weed out dependencies that have been removed due to build
- # options defined in the project yaml and/or in the headers themselves.
- list = annotated_headers.find_all do |annotated_header|
- # find the index of the "real" include that matches the annotated one.
- idx = real_headers.find_index do |real_header|
- real_header =~ /^(.*\/)?#{Regexp.escape(annotated_header)}$/
- end
- # If we found a real include, delete it from the array and return it,
- # otherwise return nil. Since nil is falsy this has the effect of making
- # find_all return only the annotated headers for which a real include was
- # found/deleted
- idx ? real_headers.delete_at(idx) : nil
- end.compact
-
- # Extract direct dependencies that were also added
- src_ext = @configurator.extension_source
- sdependencies = make_rule.split.find_all {|path| path.end_with?(src_ext) }.uniq
- sdependencies.map! {|hdr| hdr.gsub('\\','/') }
- list += sdependencies
-
- to_process = []
-
- if @configurator.project_config_hash.has_key?(:project_auto_link_deep_dependencies) && @configurator.project_config_hash[:project_auto_link_deep_dependencies]
- # Creating list of mocks
- mocks = annotated_headers.find_all do |annotated_header|
- File.basename(annotated_header) =~ /^#{@configurator.project_config_hash[:cmock_mock_prefix]}.*$/
- end.compact
-
- # Creating list of headers that should be recursively pre-processed
- # Skipping mocks and unity.h
- headers_to_deep_link = annotated_headers.select do |annotated_header|
- !(mocks.include? annotated_header) and (annotated_header.match(/^(.*\/)?unity\.h$/).nil?)
- end
- headers_to_deep_link.map! {|hdr| File.expand_path(hdr)}
-
- mocks.each do |mock|
- dirname = File.dirname(mock)
- #basename = File.basename(mock).delete_prefix(@configurator.project_config_hash[:cmock_mock_prefix])
- basename = File.basename(mock).sub(@configurator.project_config_hash[:cmock_mock_prefix], '')
- if dirname != "."
- ignore_list << File.join(dirname, basename)
- else
- ignore_list << basename
- end
- end.compact
-
- # Filtering list of final includes to only include mocks and anything that is NOT in the ignore_list
- list = list.select do |item|
- mocks.include? item or !(ignore_list.any? { |ignore_item| !item.match(/^(.*\/)?#{Regexp.escape(ignore_item)}$/).nil? })
- end
-
- headers_to_deep_link.each do |hdr|
- if (ignore_list.none? {|ignore_header| hdr.match(/^(.*\/)?#{Regexp.escape(ignore_header)}$/)} and
- include_paths.none? {|include_path| hdr =~ /^#{include_path}\.*/})
- if File.exist?(hdr)
- to_process << hdr
- #source_file = hdr.delete_suffix(hdr_ext) + src_ext
- source_file = hdr.chomp(hdr_ext) + src_ext
- if source_file != hdr and File.exist?(source_file)
- to_process << source_file
- end
- end
- end
- end
- end
-
- return list, to_process
-
- end
-
- def write_shallow_includes_list(filepath, list)
- @yaml_wrapper.dump(filepath, list)
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/project_config_manager.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/project_config_manager.rb
deleted file mode 100755
index 31f7e3a6..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/project_config_manager.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require 'ceedling/constants'
-
-
-class ProjectConfigManager
-
- attr_reader :options_files, :release_config_changed, :test_config_changed, :test_defines_changed
- attr_accessor :config_hash
-
- constructor :cacheinator, :configurator, :yaml_wrapper, :file_wrapper
-
-
- def setup
- @options_files = []
- @release_config_changed = false
- @test_config_changed = false
- @test_defines_changed = false
- end
-
-
- def merge_options(config_hash, option_filepath)
- @options_files << File.basename( option_filepath )
- config_hash.deep_merge!( @yaml_wrapper.load( option_filepath ) )
- end
-
-
-
- def process_release_config_change
- # has project configuration changed since last release build
- @release_config_changed = @cacheinator.diff_cached_release_config?( @config_hash )
- end
-
-
- def process_test_config_change
- # has project configuration changed since last test build
- @test_config_changed = @cacheinator.diff_cached_test_config?( @config_hash )
- end
-
- def process_test_defines_change(files)
- # has definitions changed since last test build
- @test_defines_changed = @cacheinator.diff_cached_test_defines?( files )
- if @test_defines_changed
- # update timestamp for rake task prerequisites
- @file_wrapper.touch( @configurator.project_test_force_rebuild_filepath )
- end
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/project_file_loader.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/project_file_loader.rb
deleted file mode 100755
index bf5dcd41..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/project_file_loader.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-require 'ceedling/constants'
-
-
-class ProjectFileLoader
-
- attr_reader :main_file, :user_file
-
- constructor :yaml_wrapper, :stream_wrapper, :system_wrapper, :file_wrapper
-
- def setup
- @main_file = nil
- @mixin_files = []
- @user_file = nil
-
- @main_project_filepath = ''
- @mixin_project_filepaths = []
- @user_project_filepath = ''
- end
-
-
- def find_project_files
- # first go hunting for optional user project file by looking for environment variable and then default location on disk
- user_filepath = @system_wrapper.env_get('CEEDLING_USER_PROJECT_FILE')
-
- if ( not user_filepath.nil? and @file_wrapper.exist?(user_filepath) )
- @user_project_filepath = user_filepath
- elsif (@file_wrapper.exist?(DEFAULT_CEEDLING_USER_PROJECT_FILE))
- @user_project_filepath = DEFAULT_CEEDLING_USER_PROJECT_FILE
- end
-
- # next check for mixin project files by looking for environment variable
- mixin_filepaths = @system_wrapper.env_get('CEEDLING_MIXIN_PROJECT_FILES')
- if ( not mixin_filepaths.nil? )
- mixin_filepaths.split(File::PATH_SEPARATOR).each do |filepath|
- if ( @file_wrapper.exist?(filepath) )
- @mixin_project_filepaths.push(filepath)
- end
- end
- end
-
- # next check for main project file by looking for environment variable and then default location on disk;
- # blow up if we don't find this guy -- like, he's so totally important
- main_filepath = @system_wrapper.env_get('CEEDLING_MAIN_PROJECT_FILE')
-
- if ( not main_filepath.nil? and @file_wrapper.exist?(main_filepath) )
- @main_project_filepath = main_filepath
- elsif (@file_wrapper.exist?(DEFAULT_CEEDLING_MAIN_PROJECT_FILE))
- @main_project_filepath = DEFAULT_CEEDLING_MAIN_PROJECT_FILE
- else
- # no verbosity checking since this is lowest level reporting anyhow &
- # verbosity checking depends on configurator which in turns needs this class (circular dependency)
- @stream_wrapper.stderr_puts('Found no Ceedling project file (*.yml)')
- raise
- end
-
- @main_file = File.basename( @main_project_filepath )
- @mixin_project_filepaths.each do |filepath|
- @mixin_files.push(File.basename( filepath ))
- end
- @user_file = File.basename( @user_project_filepath ) if ( not @user_project_filepath.empty? )
- end
-
- def yaml_merger(y1, y2)
- o1 = y1
- y2.each_pair do |k,v|
- if o1[k].nil?
- o1[k] = v
- else
- if (o1[k].instance_of? Hash)
- o1[k] = yaml_merger(o1[k], v)
- elsif (o1[k].instance_of? Array)
- o1[k] += v
- else
- o1[k] = v
- end
- end
- end
- return o1
- end
-
- def load_project_config
- config_hash = @yaml_wrapper.load(@main_project_filepath)
-
- # if there are mixin project files, then use them
- @mixin_project_filepaths.each do |filepath|
- mixin = @yaml_wrapper.load(filepath)
- config_hash = yaml_merger( config_hash, mixin )
- end
-
- # if there's a user project file, then use it
- if ( not @user_project_filepath.empty? )
- user_hash = @yaml_wrapper.load(@user_project_filepath)
- config_hash = yaml_merger( config_hash, user_hash )
- end
-
- return config_hash
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/rake_utils.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/rake_utils.rb
deleted file mode 100755
index 3f667c85..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/rake_utils.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-
-class RakeUtils
-
- constructor :rake_wrapper
-
- def task_invoked?(task_regex)
- task_invoked = false
- @rake_wrapper.task_list.each do |task|
- if ((task.already_invoked) and (task.to_s =~ task_regex))
- task_invoked = true
- break
- end
- end
- return task_invoked
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/rake_wrapper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/rake_wrapper.rb
deleted file mode 100755
index 15e47961..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/rake_wrapper.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require 'rubygems'
-require 'rake'
-require 'ceedling/makefile' # our replacement for rake's make-style dependency loader
-
-include Rake::DSL if defined?(Rake::DSL)
-
-class Rake::Task
- attr_reader :already_invoked
-end
-
-class RakeWrapper
-
- def initialize
- @makefile_loader = Rake::MakefileLoader.new # use our custom replacement noted above
- end
-
- def [](task)
- return Rake::Task[task]
- end
-
- def task_list
- return Rake::Task.tasks
- end
-
- def create_file_task(file_task, dependencies)
- file(file_task => dependencies)
- end
-
- def load_dependencies(dependencies_path)
- @makefile_loader.load(dependencies_path)
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/rakefile.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/rakefile.rb
deleted file mode 100755
index 37001bac..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/rakefile.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-require 'fileutils'
-
-# get directory containing this here file, back up one directory, and expand to full path
-CEEDLING_ROOT = File.expand_path(File.dirname(__FILE__) + '/../..')
-CEEDLING_LIB = File.join(CEEDLING_ROOT, 'lib')
-CEEDLING_VENDOR = File.join(CEEDLING_ROOT, 'vendor')
-CEEDLING_RELEASE = File.join(CEEDLING_ROOT, 'release')
-
-$LOAD_PATH.unshift( CEEDLING_LIB )
-$LOAD_PATH.unshift( File.join(CEEDLING_VENDOR, 'unity/auto') )
-$LOAD_PATH.unshift( File.join(CEEDLING_VENDOR, 'diy/lib') )
-$LOAD_PATH.unshift( File.join(CEEDLING_VENDOR, 'cmock/lib') )
-$LOAD_PATH.unshift( File.join(CEEDLING_VENDOR, 'deep_merge/lib') )
-
-require 'rake'
-
-#Let's make sure we remember the task descriptions in case we need them
-Rake::TaskManager.record_task_metadata = true
-
-require 'diy'
-require 'constructor'
-
-require 'ceedling/constants'
-require 'ceedling/target_loader'
-
-
-# construct all our objects
-# ensure load path contains all libraries needed first
-lib_ceedling_load_path_temp = File.join(CEEDLING_LIB, 'ceedling')
-$LOAD_PATH.unshift( lib_ceedling_load_path_temp )
-@ceedling = DIY::Context.from_yaml( File.read( File.join(lib_ceedling_load_path_temp, 'objects.yml') ) )
-@ceedling.build_everything
-# now that all objects are built, delete 'lib/ceedling' from load path
-$LOAD_PATH.delete(lib_ceedling_load_path_temp)
-# one-stop shopping for all our setup and such after construction
-@ceedling[:setupinator].ceedling = @ceedling
-
-project_config =
- begin
- cfg = @ceedling[:setupinator].load_project_files
- TargetLoader.inspect(cfg, ENV['TARGET'])
- rescue TargetLoader::NoTargets
- cfg
- rescue TargetLoader::RequestReload
- @ceedling[:setupinator].load_project_files
- end
-
-@ceedling[:setupinator].do_setup( project_config )
-
-
-# tell all our plugins we're about to do something
-@ceedling[:plugin_manager].pre_build
-
-# load rakefile component files (*.rake)
-PROJECT_RAKEFILE_COMPONENT_FILES.each { |component| load(component) }
-
-# tell rake to shut up by default (overridden in verbosity / debug tasks as appropriate)
-verbose(false)
-
-
-# end block always executed following rake run
-END {
- $stdout.flush unless $stdout.nil?
- $stderr.flush unless $stderr.nil?
-
- # cache our input configurations to use in comparison upon next execution
- @ceedling[:cacheinator].cache_test_config( @ceedling[:setupinator].config_hash ) if (@ceedling[:task_invoker].test_invoked?)
- @ceedling[:cacheinator].cache_release_config( @ceedling[:setupinator].config_hash ) if (@ceedling[:task_invoker].release_invoked?)
-
- # delete all temp files unless we're in debug mode
- if (not @ceedling[:configurator].project_debug)
- @ceedling[:file_wrapper].rm_f( @ceedling[:file_wrapper].directory_listing( File.join(@ceedling[:configurator].project_temp_path, '*') ))
- end
-
- # only perform these final steps if we got here without runtime exceptions or errors
- if (@ceedling[:system_wrapper].ruby_success)
-
- # tell all our plugins the build is done and process results
- @ceedling[:plugin_manager].post_build
- @ceedling[:plugin_manager].print_plugin_failures
- exit(1) if (@ceedling[:plugin_manager].plugins_failed? && !@ceedling[:setupinator].config_hash[:graceful_fail])
- else
- puts "ERROR: Ceedling Failed"
- @ceedling[:plugin_manager].post_error
- end
-}
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/release_invoker.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/release_invoker.rb
deleted file mode 100755
index 5bfb6cd7..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/release_invoker.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-require 'ceedling/constants'
-
-
-class ReleaseInvoker
-
- constructor :configurator, :release_invoker_helper, :build_invoker_utils, :dependinator, :task_invoker, :file_path_utils, :file_wrapper
-
-
- def setup_and_invoke_c_objects( c_files )
- objects = @file_path_utils.form_release_build_c_objects_filelist( c_files )
-
- begin
- @release_invoker_helper.process_deep_dependencies( @file_path_utils.form_release_dependencies_filelist( c_files ) )
-
- @dependinator.enhance_release_file_dependencies( objects )
- @task_invoker.invoke_release_objects( objects )
- rescue => e
- @build_invoker_utils.process_exception( e, RELEASE_SYM, false )
- end
-
- return objects
- end
-
-
- def setup_and_invoke_asm_objects( asm_files )
- objects = @file_path_utils.form_release_build_asm_objects_filelist( asm_files )
-
- begin
- @dependinator.enhance_release_file_dependencies( objects )
- @task_invoker.invoke_release_objects( objects )
- rescue => e
- @build_invoker_utils.process_exception( e, RELEASE_SYM, false )
- end
-
- return objects
- end
-
-
- def refresh_c_deep_dependencies
- return if (not @configurator.project_use_deep_dependencies)
-
- @file_wrapper.rm_f(
- @file_wrapper.directory_listing(
- File.join( @configurator.project_release_dependencies_path, '*' + @configurator.extension_dependencies ) ) )
-
- @release_invoker_helper.process_deep_dependencies(
- @file_path_utils.form_release_dependencies_filelist(
- @configurator.collection_all_source ) )
- end
-
-
- def artifactinate( *files )
- files.flatten.each do |file|
- @file_wrapper.cp( file, @configurator.project_release_artifacts_path ) if @file_wrapper.exist?( file )
- end
- end
-
- def convert_libraries_to_arguments(libraries)
- args = (libraries || []) + ((defined? LIBRARIES_SYSTEM) ? LIBRARIES_SYSTEM : [])
- if (defined? LIBRARIES_FLAG)
- args.map! {|v| LIBRARIES_FLAG.gsub(/\$\{1\}/, v) }
- end
- return args
- end
-
- def sort_objects_and_libraries(both)
- extension = "\\" + ((defined? EXTENSION_SUBPROJECTS) ? EXTENSION_SUBPROJECTS : ".LIBRARY")
- sorted_objects = both.group_by {|v| v.match(/.+#{extension}$/) ? :libraries : :objects }
- libraries = sorted_objects[:libraries] || []
- objects = sorted_objects[:objects] || []
- return objects, libraries
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/release_invoker_helper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/release_invoker_helper.rb
deleted file mode 100755
index f83a2a53..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/release_invoker_helper.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-class ReleaseInvokerHelper
-
- constructor :configurator, :dependinator, :task_invoker
-
-
- def process_deep_dependencies(dependencies_list)
- return if (not @configurator.project_use_deep_dependencies)
-
- if @configurator.project_generate_deep_dependencies
- @dependinator.enhance_release_file_dependencies( dependencies_list )
- @task_invoker.invoke_release_dependencies_files( dependencies_list )
- end
-
- @dependinator.load_release_object_deep_dependencies( dependencies_list )
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/reportinator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/reportinator.rb
deleted file mode 100755
index 0f583d06..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/reportinator.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-##
-# Pretifies reports
-class Reportinator
-
- ##
- # Generates a banner for a message based on the length of the message or a
- # given width.
- # ==== Attributes
- #
- # * _message_: The message to put.
- # * _width_: The width of the message. If nil the size of the banner is
- # determined by the length of the message.
- #
- # ==== Examples
- #
- # rp = Reportinator.new
- # rp.generate_banner("Hello world!") => "------------\nHello world!\n------------\n"
- # rp.generate_banner("Hello world!", 3) => "---\nHello world!\n---\n"
- #
- #
- def generate_banner(message, width=nil)
- dash_count = ((width.nil?) ? message.strip.length : width)
- return "#{'-' * dash_count}\n#{message}\n#{'-' * dash_count}\n"
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/rules_cmock.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/rules_cmock.rake
deleted file mode 100755
index 70ddcbc2..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/rules_cmock.rake
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-rule(/#{CMOCK_MOCK_PREFIX}[^\/\\]+#{'\\'+EXTENSION_SOURCE}$/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_header_input_for_mock_file(task_name)
- end
- ]) do |mock|
- @ceedling[:generator].generate_mock(TEST_SYM, mock.source)
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/rules_preprocess.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/rules_preprocess.rake
deleted file mode 100755
index c2911127..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/rules_preprocess.rake
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-# invocations against this rule should only happen when enhanced dependencies are enabled;
-# otherwise, dependency tracking will be too shallow and preprocessed files could intermittently
-# fail to be updated when they actually need to be.
-rule(/#{PROJECT_TEST_PREPROCESS_FILES_PATH}\/.+/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_test_or_source_or_header_file(task_name)
- end
- ]) do |file|
- if (not @ceedling[:configurator].project_use_deep_dependencies)
- raise 'ERROR: Ceedling preprocessing rule invoked though neccessary auxiliary dependency support not enabled.'
- end
- @ceedling[:generator].generate_preprocessed_file(TEST_SYM, file.source)
-end
-
-
-# invocations against this rule can always happen as there are no deeper dependencies to consider
-rule(/#{PROJECT_TEST_PREPROCESS_INCLUDES_PATH}\/.+/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_test_or_source_or_header_file(task_name)
- end
- ]) do |file|
- @ceedling[:generator].generate_shallow_includes_list(TEST_SYM, file.source)
-end
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/rules_release.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/rules_release.rake
deleted file mode 100755
index ae39a76e..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/rules_release.rake
+++ /dev/null
@@ -1,86 +0,0 @@
-
-RELEASE_COMPILE_TASK_ROOT = RELEASE_TASK_ROOT + 'compile:' unless defined?(RELEASE_COMPILE_TASK_ROOT)
-RELEASE_ASSEMBLE_TASK_ROOT = RELEASE_TASK_ROOT + 'assemble:' unless defined?(RELEASE_ASSEMBLE_TASK_ROOT)
-
-
-if (RELEASE_BUILD_USE_ASSEMBLY)
-rule(/#{PROJECT_RELEASE_BUILD_OUTPUT_ASM_PATH}\/#{'.+\\'+EXTENSION_OBJECT}$/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_assembly_file(task_name)
- end
- ]) do |object|
- @ceedling[:generator].generate_object_file(
- TOOLS_RELEASE_ASSEMBLER,
- OPERATION_ASSEMBLE_SYM,
- RELEASE_SYM,
- object.source,
- object.name )
-end
-end
-
-
-rule(/#{PROJECT_RELEASE_BUILD_OUTPUT_C_PATH}\/#{'.+\\'+EXTENSION_OBJECT}$/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_compilation_input_file(task_name, :error, true)
- end
- ]) do |object|
- @ceedling[:generator].generate_object_file(
- TOOLS_RELEASE_COMPILER,
- OPERATION_COMPILE_SYM,
- RELEASE_SYM,
- object.source,
- object.name,
- @ceedling[:file_path_utils].form_release_build_c_list_filepath( object.name ),
- @ceedling[:file_path_utils].form_release_dependencies_filepath( object.name ) )
-end
-
-
-rule(/#{PROJECT_RELEASE_BUILD_TARGET}/) do |bin_file|
- objects, libraries = @ceedling[:release_invoker].sort_objects_and_libraries(bin_file.prerequisites)
- tool = TOOLS_RELEASE_LINKER.clone
- lib_args = @ceedling[:release_invoker].convert_libraries_to_arguments(libraries)
- map_file = @ceedling[:configurator].project_release_build_map
- @ceedling[:generator].generate_executable_file(
- tool,
- RELEASE_SYM,
- objects,
- bin_file.name,
- map_file,
- lib_args )
- @ceedling[:release_invoker].artifactinate( bin_file.name, map_file, @ceedling[:configurator].release_build_artifacts )
-end
-
-
-namespace RELEASE_SYM do
- # use rules to increase efficiency for large projects (instead of iterating through all sources and creating defined tasks)
-
- namespace :compile do
- rule(/^#{RELEASE_COMPILE_TASK_ROOT}\S+#{'\\'+EXTENSION_SOURCE}$/ => [ # compile task names by regex
- proc do |task_name|
- source = task_name.sub(/#{RELEASE_COMPILE_TASK_ROOT}/, '')
- @ceedling[:file_finder].find_source_file(source, :error)
- end
- ]) do |compile|
- @ceedling[:rake_wrapper][:directories].invoke
- @ceedling[:project_config_manager].process_release_config_change
- @ceedling[:release_invoker].setup_and_invoke_c_objects( [compile.source] )
- end
- end
-
- if (RELEASE_BUILD_USE_ASSEMBLY)
- namespace :assemble do
- rule(/^#{RELEASE_ASSEMBLE_TASK_ROOT}\S+#{'\\'+EXTENSION_ASSEMBLY}$/ => [ # assemble task names by regex
- proc do |task_name|
- source = task_name.sub(/#{RELEASE_ASSEMBLE_TASK_ROOT}/, '')
- @ceedling[:file_finder].find_assembly_file(source)
- end
- ]) do |assemble|
- @ceedling[:rake_wrapper][:directories].invoke
- @ceedling[:project_config_manager].process_release_config_change
- @ceedling[:release_invoker].setup_and_invoke_asm_objects( [assemble.source] )
- end
- end
- end
-
-end
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/rules_release_deep_dependencies.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/rules_release_deep_dependencies.rake
deleted file mode 100755
index 9550783c..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/rules_release_deep_dependencies.rake
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-rule(/#{PROJECT_RELEASE_DEPENDENCIES_PATH}\/#{'.+\\'+EXTENSION_DEPENDENCIES}$/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_compilation_input_file(task_name, :error, true)
- end
- ]) do |dep|
- @ceedling[:generator].generate_dependencies_file(
- TOOLS_RELEASE_DEPENDENCIES_GENERATOR,
- RELEASE_SYM,
- dep.source,
- @ceedling[:file_path_utils].form_release_build_c_object_filepath(dep.source),
- dep.name)
-end
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/rules_tests.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/rules_tests.rake
deleted file mode 100755
index 2b8f7af5..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/rules_tests.rake
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-rule(/#{PROJECT_TEST_FILE_PREFIX}#{'.+'+TEST_RUNNER_FILE_SUFFIX}#{'\\'+EXTENSION_SOURCE}$/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_test_input_for_runner_file(task_name)
- end
- ]) do |runner|
- @ceedling[:generator].generate_test_runner(TEST_SYM, runner.source, runner.name)
-end
-
-rule(/#{PROJECT_TEST_BUILD_OUTPUT_C_PATH}\/#{'.+\\'+EXTENSION_OBJECT}$/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_compilation_input_file(task_name)
- end
- ]) do |object|
- if (File.basename(object.source) =~ /#{EXTENSION_SOURCE}$/)
- @ceedling[:generator].generate_object_file(
- TOOLS_TEST_COMPILER,
- OPERATION_COMPILE_SYM,
- TEST_SYM,
- object.source,
- object.name,
- @ceedling[:file_path_utils].form_test_build_list_filepath( object.name ),
- @ceedling[:file_path_utils].form_test_dependencies_filepath( object.name ))
- elsif (defined?(TEST_BUILD_USE_ASSEMBLY) && TEST_BUILD_USE_ASSEMBLY)
- @ceedling[:generator].generate_object_file(
- TOOLS_TEST_ASSEMBLER,
- OPERATION_ASSEMBLE_SYM,
- TEST_SYM,
- object.source,
- object.name )
- end
-end
-
-
-rule(/#{PROJECT_TEST_BUILD_OUTPUT_PATH}\/#{'.+\\'+EXTENSION_EXECUTABLE}$/) do |bin_file|
-
- lib_args = @ceedling[:test_invoker].convert_libraries_to_arguments()
-
- @ceedling[:generator].generate_executable_file(
- TOOLS_TEST_LINKER,
- TEST_SYM,
- bin_file.prerequisites,
- bin_file.name,
- @ceedling[:file_path_utils].form_test_build_map_filepath( bin_file.name ),
- lib_args )
-end
-
-
-rule(/#{PROJECT_TEST_RESULTS_PATH}\/#{'.+\\'+EXTENSION_TESTPASS}$/ => [
- proc do |task_name|
- @ceedling[:file_path_utils].form_test_executable_filepath(task_name)
- end
- ]) do |test_result|
- @ceedling[:generator].generate_test_results(TOOLS_TEST_FIXTURE, TEST_SYM, test_result.source, test_result.name)
-end
-
-
-namespace TEST_SYM do
- # use rules to increase efficiency for large projects (instead of iterating through all sources and creating defined tasks)
-
- rule(/^#{TEST_TASK_ROOT}\S+$/ => [ # test task names by regex
- proc do |task_name|
- test = task_name.sub(/#{TEST_TASK_ROOT}/, '')
- test = "#{PROJECT_TEST_FILE_PREFIX}#{test}" if not (test.start_with?(PROJECT_TEST_FILE_PREFIX))
- @ceedling[:file_finder].find_test_from_file_path(test)
- end
- ]) do |test|
- @ceedling[:rake_wrapper][:directories].reenable if @ceedling[:task_invoker].first_run == false && @ceedling[:project_config_manager].test_defines_changed
- @ceedling[:rake_wrapper][:directories].invoke
- @ceedling[:test_invoker].setup_and_invoke([test.source])
- end
-end
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/rules_tests_deep_dependencies.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/rules_tests_deep_dependencies.rake
deleted file mode 100755
index 7175ee3f..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/rules_tests_deep_dependencies.rake
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-rule(/#{PROJECT_TEST_DEPENDENCIES_PATH}\/#{'.+\\'+EXTENSION_DEPENDENCIES}$/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_compilation_input_file(task_name)
- end
- ]) do |dep|
- @ceedling[:generator].generate_dependencies_file(
- TOOLS_TEST_DEPENDENCIES_GENERATOR,
- TEST_SYM,
- dep.source,
- @ceedling[:file_path_utils].form_test_build_c_object_filepath(dep.source),
- dep.name)
-end
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/setupinator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/setupinator.rb
deleted file mode 100755
index 8347b42a..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/setupinator.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-
-class Setupinator
-
- attr_reader :config_hash
- attr_writer :ceedling
-
- def setup
- @ceedling = {}
- @config_hash = {}
- end
-
- def load_project_files
- @ceedling[:project_file_loader].find_project_files
- return @ceedling[:project_file_loader].load_project_config
- end
-
- def do_setup(config_hash)
- @config_hash = config_hash
-
- # load up all the constants and accessors our rake files, objects, & external scripts will need;
- # note: configurator modifies the cmock section of the hash with a couple defaults to tie
- # project together - the modified hash is used to build cmock object
- @ceedling[:configurator].populate_defaults( config_hash )
- @ceedling[:configurator].populate_unity_defaults( config_hash )
- @ceedling[:configurator].populate_cmock_defaults( config_hash )
- @ceedling[:configurator].find_and_merge_plugins( config_hash )
- @ceedling[:configurator].merge_imports( config_hash )
- @ceedling[:configurator].tools_setup( config_hash )
- @ceedling[:configurator].eval_environment_variables( config_hash )
- @ceedling[:configurator].eval_paths( config_hash )
- @ceedling[:configurator].standardize_paths( config_hash )
- @ceedling[:configurator].validate( config_hash )
- @ceedling[:configurator].build( config_hash, :environment )
-
- @ceedling[:configurator].insert_rake_plugins( @ceedling[:configurator].rake_plugins )
- @ceedling[:configurator].tools_supplement_arguments( config_hash )
-
- # merge in any environment variables plugins specify, after the main build
- @ceedling[:plugin_manager].load_plugin_scripts( @ceedling[:configurator].script_plugins, @ceedling ) do |env|
- @ceedling[:configurator].eval_environment_variables( env )
- @ceedling[:configurator].build_supplement( config_hash, env )
- end
-
- @ceedling[:plugin_reportinator].set_system_objects( @ceedling )
- @ceedling[:file_finder].prepare_search_sources
- @ceedling[:loginator].setup_log_filepath
- @ceedling[:project_config_manager].config_hash = config_hash
- end
-
- def reset_defaults(config_hash)
- @ceedling[:configurator].reset_defaults( config_hash )
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/stream_wrapper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/stream_wrapper.rb
deleted file mode 100755
index 7e160527..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/stream_wrapper.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-
-class StreamWrapper
-
- def stdout_override(&fnc)
- @stdout_overide_fnc = fnc
- end
-
- def stdout_puts(string)
- if @stdout_overide_fnc
- @stdout_overide_fnc.call(string)
- else
- $stdout.puts(string)
- end
- end
-
- def stdout_flush
- $stdout.flush
- end
-
- def stderr_puts(string)
- $stderr.puts(string)
- end
-
- def stderr_flush
- $stderr.flush
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/streaminator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/streaminator.rb
deleted file mode 100755
index b8dcd070..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/streaminator.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'ceedling/constants'
-
-class Streaminator
-
- constructor :streaminator_helper, :verbosinator, :loginator, :stream_wrapper
-
- # for those objects for whom the configurator has already been instantiated,
- # Streaminator is a convenience object for handling verbosity and writing to the std streams
-
- def stdout_puts(string, verbosity=Verbosity::NORMAL)
- if (@verbosinator.should_output?(verbosity))
- @stream_wrapper.stdout_puts(string)
- @stream_wrapper.stdout_flush
- end
-
- # write to log as though Verbosity::OBNOXIOUS
- @loginator.log( string, @streaminator_helper.extract_name($stdout) )
- end
-
- def stderr_puts(string, verbosity=Verbosity::NORMAL)
- if (@verbosinator.should_output?(verbosity))
- @stream_wrapper.stderr_puts(string)
- @stream_wrapper.stderr_flush
- end
-
- # write to log as though Verbosity::OBNOXIOUS
- @loginator.log( string, @streaminator_helper.extract_name($stderr) )
- end
-
- def stream_puts(stream, string, verbosity=Verbosity::NORMAL)
- if (@verbosinator.should_output?(verbosity))
- stream.puts(string)
- stream.flush
- end
-
- # write to log as though Verbosity::OBNOXIOUS
- @loginator.log( string, @streaminator_helper.extract_name(stream) )
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/streaminator_helper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/streaminator_helper.rb
deleted file mode 100755
index 9fb5cc0b..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/streaminator_helper.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-
-class StreaminatorHelper
-
- def extract_name(stream)
- name = case (stream.fileno)
- when 0 then '#<IO:$stdin>'
- when 1 then '#<IO:$stdout>'
- when 2 then '#<IO:$stderr>'
- else stream.inspect
- end
-
- return name
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/system_utils.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/system_utils.rb
deleted file mode 100755
index 477aba4f..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/system_utils.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-
-class Object
- def deep_clone
- Marshal::load(Marshal.dump(self))
- end
-end
-
-
-##
-# Class containing system utility funcions.
-class SystemUtils
-
- constructor :system_wrapper
-
- ##
- # Sets up the class.
- def setup
- @tcsh_shell = nil
- end
-
- ##
- # Checks the system shell to see if it a tcsh shell.
- def tcsh_shell?
- # once run a single time, return state determined at that execution
- return @tcsh_shell if not @tcsh_shell.nil?
-
- result = @system_wrapper.shell_backticks('echo $version')
-
- if ((result[:exit_code] == 0) and (result[:output].strip =~ /^tcsh/))
- @tcsh_shell = true
- else
- @tcsh_shell = false
- end
-
- return @tcsh_shell
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/system_wrapper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/system_wrapper.rb
deleted file mode 100755
index 2b0f1edd..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/system_wrapper.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-require 'rbconfig'
-
-class SystemWrapper
-
- # static method for use in defaults
- def self.windows?
- return ((RbConfig::CONFIG['host_os'] =~ /mswin|mingw/) ? true : false) if defined?(RbConfig)
- return ((Config::CONFIG['host_os'] =~ /mswin|mingw/) ? true : false)
- end
-
- # class method so as to be mockable for tests
- def windows?
- return SystemWrapper.windows?
- end
-
- def module_eval(string)
- return Object.module_eval("\"" + string + "\"")
- end
-
- def eval(string)
- return eval(string)
- end
-
- def search_paths
- return ENV['PATH'].split(File::PATH_SEPARATOR)
- end
-
- def cmdline_args
- return ARGV
- end
-
- def env_set(name, value)
- ENV[name] = value
- end
-
- def env_get(name)
- return ENV[name]
- end
-
- def time_now
- return Time.now.asctime
- end
-
- def shell_backticks(command, boom = true)
- retval = `#{command}`.freeze
- $exit_code = ($?.exitstatus).freeze if boom
- return {
- :output => retval.freeze,
- :exit_code => ($?.exitstatus).freeze
- }
- end
-
- def shell_system(command, boom = true)
- system( command )
- $exit_code = ($?.exitstatus).freeze if boom
- return {
- :output => "".freeze,
- :exit_code => ($?.exitstatus).freeze
- }
- end
-
- def add_load_path(path)
- $LOAD_PATH.unshift(path)
- end
-
- def require_file(path)
- require(path)
- end
-
- def ruby_success
- # We are successful if we've never had an exit code that went boom (either because it's empty or it was 0)
- return ($exit_code.nil? || ($exit_code == 0)) && ($!.nil? || $!.is_a?(SystemExit) && $!.success?)
- end
-
- def constants_include?(item)
- # forcing to strings provides consistency across Ruby versions
- return Object.constants.map{|constant| constant.to_s}.include?(item.to_s)
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/target_loader.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/target_loader.rb
deleted file mode 100755
index 7fbc0959..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/target_loader.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-module TargetLoader
- class NoTargets < Exception; end
- class NoDirectory < Exception; end
- class NoDefault < Exception; end
- class NoSuchTarget < Exception; end
-
- class RequestReload < Exception; end
-
- def self.inspect(config, target_name=nil)
- unless config[:targets]
- raise NoTargets
- end
-
- targets = config[:targets]
- unless targets[:targets_directory]
- raise NoDirectory.new("No targets directory specified.")
- end
- unless targets[:default_target]
- raise NoDefault.new("No default target specified.")
- end
-
- target_path = lambda {|name| File.join(targets[:targets_directory], name + ".yml")}
-
- target = if target_name
- target_path.call(target_name)
- else
- target_path.call(targets[:default_target])
- end
-
- unless File.exists? target
- raise NoSuchTarget.new("No such target: #{target}")
- end
-
- ENV['CEEDLING_MAIN_PROJECT_FILE'] = target
-
- raise RequestReload
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/task_invoker.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/task_invoker.rb
deleted file mode 100755
index 642695c4..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/task_invoker.rb
+++ /dev/null
@@ -1,117 +0,0 @@
-require 'ceedling/par_map'
-
-class TaskInvoker
-
- attr_accessor :first_run
-
- constructor :dependinator, :rake_utils, :rake_wrapper, :project_config_manager
-
- def setup
- @test_regexs = [/^#{TEST_ROOT_NAME}:/]
- @release_regexs = [/^#{RELEASE_ROOT_NAME}(:|$)/]
- @first_run = true
- end
-
- def add_test_task_regex(regex)
- @test_regexs << regex
- end
-
- def add_release_task_regex(regex)
- @release_regexs << regex
- end
-
- def test_invoked?
- invoked = false
-
- @test_regexs.each do |regex|
- invoked = true if (@rake_utils.task_invoked?(regex))
- break if invoked
- end
-
- return invoked
- end
-
- def release_invoked?
- invoked = false
-
- @release_regexs.each do |regex|
- invoked = true if (@rake_utils.task_invoked?(regex))
- break if invoked
- end
-
- return invoked
- end
-
- def invoked?(regex)
- return @rake_utils.task_invoked?(regex)
- end
-
-
- def invoke_test_mocks(mocks)
- @dependinator.enhance_mock_dependencies( mocks )
- mocks.each { |mock|
- @rake_wrapper[mock].reenable if @first_run == false && @project_config_manager.test_defines_changed
- @rake_wrapper[mock].invoke
- }
- end
-
- def invoke_test_runner(runner)
- @dependinator.enhance_runner_dependencies( runner )
- @rake_wrapper[runner].reenable if @first_run == false && @project_config_manager.test_defines_changed
- @rake_wrapper[runner].invoke
- end
-
- def invoke_test_shallow_include_lists(files)
- @dependinator.enhance_shallow_include_lists_dependencies( files )
- par_map(PROJECT_COMPILE_THREADS, files) do |file|
- @rake_wrapper[file].reenable if @first_run == false && @project_config_manager.test_defines_changed
- @rake_wrapper[file].invoke
- end
- end
-
- def invoke_test_preprocessed_files(files)
- @dependinator.enhance_preprocesed_file_dependencies( files )
- par_map(PROJECT_COMPILE_THREADS, files) do |file|
- @rake_wrapper[file].reenable if @first_run == false && @project_config_manager.test_defines_changed
- @rake_wrapper[file].invoke
- end
- end
-
- def invoke_test_dependencies_files(files)
- @dependinator.enhance_dependencies_dependencies( files )
- par_map(PROJECT_COMPILE_THREADS, files) do |file|
- @rake_wrapper[file].reenable if @first_run == false && @project_config_manager.test_defines_changed
- @rake_wrapper[file].invoke
- end
- end
-
- def invoke_test_objects(objects)
- par_map(PROJECT_COMPILE_THREADS, objects) do |object|
- @rake_wrapper[object].reenable if @first_run == false && @project_config_manager.test_defines_changed
- @rake_wrapper[object].invoke
- end
- end
-
- def invoke_test_executable(file)
- @rake_wrapper[file].invoke
- end
-
- def invoke_test_results(result)
- @dependinator.enhance_results_dependencies( result )
- @rake_wrapper[result].reenable if @first_run == false && @project_config_manager.test_defines_changed
- @rake_wrapper[result].invoke
- end
-
- def invoke_release_dependencies_files(files)
- par_map(PROJECT_COMPILE_THREADS, files) do |file|
- @rake_wrapper[file].invoke
- end
- end
-
- def invoke_release_objects(objects)
- par_map(PROJECT_COMPILE_THREADS, objects) do |object|
- @rake_wrapper[object].invoke
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_base.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_base.rake
deleted file mode 100755
index 8c825309..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_base.rake
+++ /dev/null
@@ -1,111 +0,0 @@
-require 'ceedling/constants'
-require 'ceedling/file_path_utils'
-require 'ceedling/version'
-
-desc "Display build environment version info."
-task :version do
- puts " Ceedling:: #{Ceedling::Version::CEEDLING}"
-
- [
- ['CException', File.join( CEEDLING_VENDOR, CEXCEPTION_ROOT_PATH)],
- [' CMock', File.join( CEEDLING_VENDOR, CMOCK_ROOT_PATH)],
- [' Unity', File.join( CEEDLING_VENDOR, UNITY_ROOT_PATH)],
- ].each do |tool|
- name = tool[0]
- base_path = tool[1]
-
- version_string = begin
- @ceedling[:file_wrapper].read( File.join(base_path, 'release', 'version.info') ).strip
- rescue
- "UNKNOWN"
- end
- build_string = begin
- @ceedling[:file_wrapper].read( File.join(base_path, 'release', 'build.info') ).strip
- rescue
- "UNKNOWN"
- end
- puts "#{name}:: #{version_string.empty? ? '#.#.' : (version_string + '.')}#{build_string.empty? ? '?' : build_string}"
- end
-end
-
-desc "Set verbose output (silent:[#{Verbosity::SILENT}] - obnoxious:[#{Verbosity::OBNOXIOUS}])."
-task :verbosity, :level do |t, args|
- verbosity_level = args.level.to_i
-
- if (PROJECT_USE_MOCKS)
- # don't store verbosity level in setupinator's config hash, use a copy;
- # otherwise, the input configuration will change and trigger entire project rebuilds
- hash = @ceedling[:setupinator].config_hash[:cmock].clone
- hash[:verbosity] = verbosity_level
-
- @ceedling[:cmock_builder].manufacture( hash )
- end
-
- @ceedling[:configurator].project_verbosity = verbosity_level
-
- # control rake's verbosity with new setting
- verbose( ((verbosity_level >= Verbosity::OBNOXIOUS) ? true : false) )
-end
-
-desc "Enable logging"
-task :logging do
- @ceedling[:configurator].project_logging = true
-end
-
-# non advertised debug task
-task :debug do
- Rake::Task[:verbosity].invoke(Verbosity::DEBUG)
- Rake.application.options.trace = true
- @ceedling[:configurator].project_debug = true
-end
-
-# non advertised sanity checking task
-task :sanity_checks, :level do |t, args|
- check_level = args.level.to_i
- @ceedling[:configurator].sanity_checks = check_level
-end
-
-# list expanded environment variables
-if (not ENVIRONMENT.empty?)
-desc "List all configured environment variables."
-task :environment do
- env_list = []
- ENVIRONMENT.each do |env|
- env.each_key do |key|
- name = key.to_s.upcase
- env_list.push(" - #{name}: \"#{env[key]}\"")
- end
- end
- env_list.sort.each do |env_line|
- puts env_line
- end
-end
-end
-
-namespace :options do
-
- COLLECTION_PROJECT_OPTIONS.each do |option_path|
- option = File.basename(option_path, '.yml')
-
- desc "Merge #{option} project options."
- task option.downcase.to_sym do
- hash = @ceedling[:project_config_manager].merge_options( @ceedling[:setupinator].config_hash, option_path )
- @ceedling[:setupinator].do_setup( hash )
- if @ceedling[:configurator].project_release_build
- load(File.join(CEEDLING_LIB, 'ceedling', 'rules_release.rake'))
- end
- end
- end
-
-end
-
-
-# do not present task if there's no plugins
-if (not PLUGINS_ENABLED.empty?)
-desc "Execute plugin result summaries (no build triggering)."
-task :summary do
- @ceedling[:plugin_manager].summary
- puts "\nNOTE: Summaries may be out of date with project sources.\n\n"
-end
-end
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_filesystem.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_filesystem.rake
deleted file mode 100755
index 58fa6511..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_filesystem.rake
+++ /dev/null
@@ -1,103 +0,0 @@
-
-# rather than require 'rake/clean' & try to override, we replicate for finer control
-CLEAN = Rake::FileList["**/*~", "**/*.bak"]
-CLOBBER = Rake::FileList.new
-
-CLEAN.clear_exclude.exclude { |fn| fn.pathmap("%f") == 'core' && File.directory?(fn) }
-
-CLEAN.include(File.join(PROJECT_TEST_BUILD_OUTPUT_PATH, '*'))
-CLEAN.include(File.join(PROJECT_TEST_RESULTS_PATH, '*'))
-CLEAN.include(File.join(PROJECT_TEST_DEPENDENCIES_PATH, '*'))
-CLEAN.include(File.join(PROJECT_BUILD_RELEASE_ROOT, '*.*'))
-CLEAN.include(File.join(PROJECT_RELEASE_BUILD_OUTPUT_PATH, '*'))
-CLEAN.include(File.join(PROJECT_RELEASE_DEPENDENCIES_PATH, '*'))
-
-CLOBBER.include(File.join(PROJECT_BUILD_ARTIFACTS_ROOT, '**/*'))
-CLOBBER.include(File.join(PROJECT_BUILD_TESTS_ROOT, '**/*'))
-CLOBBER.include(File.join(PROJECT_BUILD_RELEASE_ROOT, '**/*'))
-CLOBBER.include(File.join(PROJECT_LOG_PATH, '**/*'))
-CLOBBER.include(File.join(PROJECT_TEMP_PATH, '**/*'))
-
-# just in case they're using git, let's make sure we allow them to preserved the build directory if desired.
-CLOBBER.exclude(File.join(TESTS_BASE_PATH), '**/.gitkeep')
-
-# because of cmock config, mock path can optionally exist apart from standard test build paths
-CLOBBER.include(File.join(CMOCK_MOCK_PATH, '*'))
-
-REMOVE_FILE_PROC = Proc.new { |fn| rm_r fn rescue nil }
-
-# redefine clean so we can override how it advertises itself
-desc "Delete all build artifacts and temporary products."
-task(:clean) do
- # because :clean is a prerequisite for :clobber, intelligently display the progress message
- if (not @ceedling[:task_invoker].invoked?(/^clobber$/))
- @ceedling[:streaminator].stdout_puts("\nCleaning build artifacts...\n(For large projects, this task may take a long time to complete)\n\n")
- end
- begin
- CLEAN.each { |fn| REMOVE_FILE_PROC.call(fn) }
- rescue
- end
-end
-
-# redefine clobber so we can override how it advertises itself
-desc "Delete all generated files (and build artifacts)."
-task(:clobber => [:clean]) do
- @ceedling[:streaminator].stdout_puts("\nClobbering all generated files...\n(For large projects, this task may take a long time to complete)\n\n")
- begin
- CLOBBER.each { |fn| REMOVE_FILE_PROC.call(fn) }
- rescue
- end
-end
-
-
-PROJECT_BUILD_PATHS.each { |path| directory(path) }
-
-# create directories that hold build output and generated files & touching rebuild dependency sources
-task(:directories => PROJECT_BUILD_PATHS) { @ceedling[:dependinator].touch_force_rebuild_files }
-
-
-# list paths discovered at load time
-namespace :paths do
-
- paths = @ceedling[:setupinator].config_hash[:paths]
- paths.each_key do |section|
- name = section.to_s.downcase
- path_list = Object.const_get("COLLECTION_PATHS_#{name.upcase}")
-
- if (path_list.size != 0)
- desc "List all collected #{name} paths."
- task(name.to_sym) { puts "#{name} paths:"; path_list.sort.each {|path| puts " - #{path}" } }
- end
- end
-
-end
-
-
-# list files & file counts discovered at load time
-namespace :files do
-
- categories = [
- ['test', COLLECTION_ALL_TESTS],
- ['source', COLLECTION_ALL_SOURCE],
- ['header', COLLECTION_ALL_HEADERS]
- ]
-
- using_assembly = (defined?(TEST_BUILD_USE_ASSEMBLY) && TEST_BUILD_USE_ASSEMBLY) ||
- (defined?(RELEASE_BUILD_USE_ASSEMBLY) && RELEASE_BUILD_USE_ASSEMBLY)
- categories << ['assembly', COLLECTION_ALL_ASSEMBLY] if using_assembly
-
- categories.each do |category|
- name = category[0]
- collection = category[1]
-
- desc "List all collected #{name} files."
- task(name.to_sym) do
- puts "#{name} files:"
- collection.sort.each { |filepath| puts " - #{filepath}" }
- puts "file count: #{collection.size}"
- end
- end
-
-end
-
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_release.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_release.rake
deleted file mode 100755
index b313b2f5..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_release.rake
+++ /dev/null
@@ -1,30 +0,0 @@
-require 'ceedling/constants'
-require 'ceedling/file_path_utils'
-
-
-desc "Build release target."
-task RELEASE_SYM => [:directories] do
- header = "Release build '#{File.basename(PROJECT_RELEASE_BUILD_TARGET)}'"
- @ceedling[:streaminator].stdout_puts("\n\n#{header}\n#{'-' * header.length}")
-
- begin
- @ceedling[:plugin_manager].pre_release
-
- core_objects = []
- extra_objects = @ceedling[:file_path_utils].form_release_build_c_objects_filelist( COLLECTION_RELEASE_ARTIFACT_EXTRA_LINK_OBJECTS )
-
- @ceedling[:project_config_manager].process_release_config_change
- core_objects.concat( @ceedling[:release_invoker].setup_and_invoke_c_objects( COLLECTION_ALL_SOURCE ) )
-
- # if assembler use isn't enabled, COLLECTION_ALL_ASSEMBLY is empty array & nothing happens
- core_objects.concat( @ceedling[:release_invoker].setup_and_invoke_asm_objects( COLLECTION_ALL_ASSEMBLY ) )
-
- # if we're using libraries, we need to add those to our collection as well
- library_objects = (defined? LIBRARIES_RELEASE && !LIBRARIES_RELEASE.empty?) ? LIBRARIES_RELEASE.flatten.compact : []
- file( PROJECT_RELEASE_BUILD_TARGET => (core_objects + extra_objects + library_objects) )
- Rake::Task[PROJECT_RELEASE_BUILD_TARGET].invoke
- ensure
- @ceedling[:plugin_manager].post_release
- end
-end
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_release_deep_dependencies.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_release_deep_dependencies.rake
deleted file mode 100755
index db2be5f3..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_release_deep_dependencies.rake
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'ceedling/constants'
-
-namespace REFRESH_SYM do
-
- task RELEASE_SYM do
- @ceedling[:release_invoker].refresh_c_deep_dependencies
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests.rake
deleted file mode 100755
index 5d09c1af..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests.rake
+++ /dev/null
@@ -1,60 +0,0 @@
-require 'ceedling/constants'
-
-task :test => [:directories] do
- Rake.application['test:all'].invoke
-end
-
-namespace TEST_SYM do
-
- desc "Run all unit tests (also just 'test' works)."
- task :all => [:directories] do
- @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS)
- end
-
- desc "Run single test ([*] real test or source file name, no path)."
- task :* do
- message = "\nOops! '#{TEST_ROOT_NAME}:*' isn't a real task. " +
- "Use a real test or source file name (no path) in place of the wildcard.\n" +
- "Example: rake #{TEST_ROOT_NAME}:foo.c\n\n"
-
- @ceedling[:streaminator].stdout_puts( message )
- end
-
- desc "Run tests for changed files."
- task :delta => [:directories] do
- @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, TEST_SYM, {:force_run => false})
- end
-
- desc "Just build tests without running."
- task :build_only => [:directories] do
- @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, TEST_SYM, {:build_only => true})
- end
-
- desc "Run tests by matching regular expression pattern."
- task :pattern, [:regex] => [:directories] do |t, args|
- matches = []
-
- COLLECTION_ALL_TESTS.each { |test| matches << test if (test =~ /#{args.regex}/) }
-
- if (matches.size > 0)
- @ceedling[:test_invoker].setup_and_invoke(matches, TEST_SYM, {:force_run => false})
- else
- @ceedling[:streaminator].stdout_puts("\nFound no tests matching pattern /#{args.regex}/.")
- end
- end
-
- desc "Run tests whose test path contains [dir] or [dir] substring."
- task :path, [:dir] => [:directories] do |t, args|
- matches = []
-
- COLLECTION_ALL_TESTS.each { |test| matches << test if File.dirname(test).include?(args.dir.gsub(/\\/, '/')) }
-
- if (matches.size > 0)
- @ceedling[:test_invoker].setup_and_invoke(matches, TEST_SYM, {:force_run => false})
- else
- @ceedling[:streaminator].stdout_puts("\nFound no tests including the given path or path component.")
- end
- end
-
-end
-
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests_deep_dependencies.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests_deep_dependencies.rake
deleted file mode 100755
index f8994071..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_tests_deep_dependencies.rake
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'ceedling/constants'
-
-namespace REFRESH_SYM do
-
- task TEST_SYM do
- @ceedling[:test_invoker].refresh_deep_dependencies
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_vendor.rake b/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_vendor.rake
deleted file mode 100755
index 63c2ca55..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/tasks_vendor.rake
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'ceedling/constants'
-require 'ceedling/file_path_utils'
-
-# create file dependencies to ensure C-based components of vendor tools are recompiled when they are updated with new versions
-# forming these explicitly rather than depend on auxiliary dependencies so all scenarios are explicitly covered
-
-file( @ceedling[:file_path_utils].form_test_build_c_object_filepath( UNITY_C_FILE ) => [
- File.join( UNITY_VENDOR_PATH, UNITY_LIB_PATH, UNITY_C_FILE ),
- File.join( UNITY_VENDOR_PATH, UNITY_LIB_PATH, UNITY_H_FILE ),
- File.join( UNITY_VENDOR_PATH, UNITY_LIB_PATH, UNITY_INTERNALS_H_FILE ) ]
- )
-
-
-if (PROJECT_USE_MOCKS)
-file( @ceedling[:file_path_utils].form_test_build_c_object_filepath( CMOCK_C_FILE ) => [
- File.join( CMOCK_VENDOR_PATH, CMOCK_LIB_PATH, CMOCK_C_FILE ),
- File.join( CMOCK_VENDOR_PATH, CMOCK_LIB_PATH, CMOCK_H_FILE ) ]
- )
-end
-
-
-if (PROJECT_USE_EXCEPTIONS)
-file( @ceedling[:file_path_utils].form_test_build_c_object_filepath( CEXCEPTION_C_FILE ) => [
- File.join( CEXCEPTION_VENDOR_PATH, CEXCEPTION_LIB_PATH, CEXCEPTION_C_FILE ),
- File.join( CEXCEPTION_VENDOR_PATH, CEXCEPTION_LIB_PATH, CEXCEPTION_H_FILE ) ]
- )
-end
-
-
-if (PROJECT_USE_EXCEPTIONS and PROJECT_RELEASE_BUILD)
-file( @ceedling[:file_path_utils].form_release_build_c_object_filepath( CEXCEPTION_C_FILE ) => [
- File.join( CEXCEPTION_VENDOR_PATH, CEXCEPTION_LIB_PATH, CEXCEPTION_C_FILE ),
- File.join( CEXCEPTION_VENDOR_PATH, CEXCEPTION_LIB_PATH, CEXCEPTION_H_FILE ) ]
- )
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/test_includes_extractor.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/test_includes_extractor.rb
deleted file mode 100755
index 50cc7c04..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/test_includes_extractor.rb
+++ /dev/null
@@ -1,85 +0,0 @@
-
-class TestIncludesExtractor
-
- constructor :configurator, :yaml_wrapper, :file_wrapper
-
- def setup
- @includes = {}
- @mocks = {}
- end
-
-
- # for includes_list file, slurp up array from yaml file and sort & store includes
- def parse_includes_list(includes_list)
- gather_and_store_includes( includes_list, @yaml_wrapper.load(includes_list) )
- end
-
- # open, scan for, and sort & store includes of test file
- def parse_test_file(test)
- gather_and_store_includes( test, extract_from_file(test) )
- end
-
- # mocks with no file extension
- def lookup_raw_mock_list(test)
- file_key = form_file_key(test)
- return [] if @mocks[file_key].nil?
- return @mocks[file_key]
- end
-
- # includes with file extension
- def lookup_includes_list(file)
- file_key = form_file_key(file)
- return [] if (@includes[file_key]).nil?
- return @includes[file_key]
- end
-
- private #################################
-
- def form_file_key(filepath)
- return File.basename(filepath).to_sym
- end
-
- def extract_from_file(file)
- includes = []
- header_extension = @configurator.extension_header
-
- contents = @file_wrapper.read(file)
-
- # remove line comments
- contents = contents.gsub(/\/\/.*$/, '')
- # remove block comments
- contents = contents.gsub(/\/\*.*?\*\//m, '')
-
- contents.split("\n").each do |line|
- # look for include statement
- scan_results = line.scan(/#include\s+\"\s*(.+#{'\\'+header_extension})\s*\"/)
-
- includes << scan_results[0][0] if (scan_results.size > 0)
-
- # look for TEST_FILE statement
- scan_results = line.scan(/TEST_FILE\(\s*\"\s*(.+\.\w+)\s*\"\s*\)/)
-
- includes << scan_results[0][0] if (scan_results.size > 0)
- end
-
- return includes.uniq
- end
-
- def gather_and_store_includes(file, includes)
- mock_prefix = @configurator.cmock_mock_prefix
- header_extension = @configurator.extension_header
- file_key = form_file_key(file)
- @mocks[file_key] = []
-
- # add includes to lookup hash
- @includes[file_key] = includes
-
- includes.each do |include_file|
- # check if include is a mock
- scan_results = include_file.scan(/(#{mock_prefix}.+)#{'\\'+header_extension}/)
- # add mock to lookup hash
- @mocks[file_key] << scan_results[0][0] if (scan_results.size > 0)
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/test_invoker.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/test_invoker.rb
deleted file mode 100755
index 652cb318..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/test_invoker.rb
+++ /dev/null
@@ -1,188 +0,0 @@
-require 'ceedling/constants'
-
-
-class TestInvoker
-
- attr_reader :sources, :tests, :mocks
-
- constructor :configurator,
- :test_invoker_helper,
- :plugin_manager,
- :streaminator,
- :preprocessinator,
- :task_invoker,
- :dependinator,
- :project_config_manager,
- :build_invoker_utils,
- :file_path_utils,
- :file_wrapper
-
- def setup
- @sources = []
- @tests = []
- @mocks = []
- end
-
- def get_test_definition_str(test)
- return "-D" + File.basename(test, File.extname(test)).upcase.sub(/@.*$/, "")
- end
-
- def get_tools_compilers
- tools_compilers = Hash.new
- tools_compilers["for unit test"] = TOOLS_TEST_COMPILER if defined? TOOLS_TEST_COMPILER
- tools_compilers["for gcov"] = TOOLS_GCOV_COMPILER if defined? TOOLS_GCOV_COMPILER
- return tools_compilers
- end
-
- def add_test_definition(test)
- test_definition_str = get_test_definition_str(test)
- get_tools_compilers.each do |tools_compiler_key, tools_compiler_value|
- tools_compiler_value[:arguments].push("-D#{File.basename(test, ".*").strip.upcase.sub(/@.*$/, "")}")
- @streaminator.stdout_puts("Add the definition value in the build option #{tools_compiler_value[:arguments][-1]} #{tools_compiler_key}", Verbosity::OBNOXIOUS)
- end
- end
-
- def delete_test_definition(test)
- test_definition_str = get_test_definition_str(test)
- get_tools_compilers.each do |tools_compiler_key, tools_compiler_value|
- num_options = tools_compiler_value[:arguments].size
- @streaminator.stdout_puts("Delete the definition value in the build option #{tools_compiler_value[:arguments][-1]} #{tools_compiler_key}", Verbosity::OBNOXIOUS)
- tools_compiler_value[:arguments].delete_if{|i| i == test_definition_str}
- if num_options > tools_compiler_value[:arguments].size + 1
- @streaminator.stderr_puts("WARNING: duplicated test definition.")
- end
- end
- end
-
- # Convert libraries configuration form YAML configuration
- # into a string that can be given to the compiler.
- def convert_libraries_to_arguments()
- if @configurator.project_config_hash.has_key?(:libraries_test)
- lib_args = @configurator.project_config_hash[:libraries_test]
- lib_args.flatten!
- lib_flag = @configurator.project_config_hash[:libraries_flag]
- lib_args.map! {|v| lib_flag.gsub(/\$\{1\}/, v) } if (defined? lib_flag)
- return lib_args
- end
- end
-
-
- def setup_and_invoke(tests, context=TEST_SYM, options={:force_run => true, :build_only => false})
-
- @tests = tests
-
- @project_config_manager.process_test_config_change
-
- @tests.each do |test|
- # announce beginning of test run
- header = "Test '#{File.basename(test)}'"
- @streaminator.stdout_puts("\n\n#{header}\n#{'-' * header.length}")
-
- begin
- @plugin_manager.pre_test( test )
- test_name ="#{File.basename(test)}".chomp('.c')
- def_test_key="defines_#{test_name.downcase}"
-
- # Re-define the project out path and pre-processor defines.
- if @configurator.project_config_hash.has_key?(def_test_key.to_sym)
- @project_config_manager.test_config_changed
- defs_bkp = Array.new(COLLECTION_DEFINES_TEST_AND_VENDOR)
- printf " ************** Specific test definitions for #{test_name} !!! \n"
- tst_defs_cfg = @configurator.project_config_hash[def_test_key.to_sym]
-
- orig_path = @configurator.project_test_build_output_path
- @configurator.project_config_hash[:project_test_build_output_path] = File.join(@configurator.project_test_build_output_path, test_name)
- @file_wrapper.mkdir(@configurator.project_test_build_output_path)
- COLLECTION_DEFINES_TEST_AND_VENDOR.replace(tst_defs_cfg)
- # printf " * new defines = #{COLLECTION_DEFINES_TEST_AND_VENDOR}\n"
- end
-
- # collect up test fixture pieces & parts
- runner = @file_path_utils.form_runner_filepath_from_test( test )
- mock_list = @preprocessinator.preprocess_test_and_invoke_test_mocks( test )
- sources = @test_invoker_helper.extract_sources( test )
- extras = @configurator.collection_test_fixture_extra_link_objects
- core = [test] + mock_list + sources
- objects = @file_path_utils.form_test_build_objects_filelist( [runner] + core + extras )
- results_pass = @file_path_utils.form_pass_results_filepath( test )
- results_fail = @file_path_utils.form_fail_results_filepath( test )
-
- @project_config_manager.process_test_defines_change(sources)
-
- # add the definition value in the build option for the unit test
- if @configurator.defines_use_test_definition
- add_test_definition(test)
- end
-
- # clean results files so we have a missing file with which to kick off rake's dependency rules
- @test_invoker_helper.clean_results( {:pass => results_pass, :fail => results_fail}, options )
-
- # load up auxiliary dependencies so deep changes cause rebuilding appropriately
- @test_invoker_helper.process_deep_dependencies( core ) do |dependencies_list|
- @dependinator.load_test_object_deep_dependencies( dependencies_list )
- end
-
- # tell rake to create test runner if needed
- @task_invoker.invoke_test_runner( runner )
-
- # enhance object file dependencies to capture externalities influencing regeneration
- @dependinator.enhance_test_build_object_dependencies( objects )
-
- # associate object files with executable
- @dependinator.setup_test_executable_dependencies( test, objects )
-
- # build test objects
- @task_invoker.invoke_test_objects( objects )
-
- # if the option build_only has been specified, build only the executable
- # but don't run the test
- if (options[:build_only])
- executable = @file_path_utils.form_test_executable_filepath( test )
- @task_invoker.invoke_test_executable( executable )
- else
- # 3, 2, 1... launch
- @task_invoker.invoke_test_results( results_pass )
- end
- rescue => e
- @build_invoker_utils.process_exception( e, context )
- ensure
- # delete the definition value in the build option for the unit test
- if @configurator.defines_use_test_definition
- delete_test_definition(test)
- end
- @plugin_manager.post_test( test )
- # restore the project test defines
- if @configurator.project_config_hash.has_key?(def_test_key.to_sym)
- # @configurator.project_config_hash[:defines_test] =
- COLLECTION_DEFINES_TEST_AND_VENDOR.replace(defs_bkp)
- # printf " ---- Restored defines at #{defs_bkp}"
- @configurator.project_config_hash[:project_test_build_output_path] = orig_path
- printf " ************** Restored defines and build path\n"
- end
- end
-
- # store away what's been processed
- @mocks.concat( mock_list )
- @sources.concat( sources )
-
- @task_invoker.first_run = false
- end
-
- # post-process collected mock list
- @mocks.uniq!
-
- # post-process collected sources list
- @sources.uniq!
- end
-
-
- def refresh_deep_dependencies
- @file_wrapper.rm_f(
- @file_wrapper.directory_listing(
- File.join( @configurator.project_test_dependencies_path, '*' + @configurator.extension_dependencies ) ) )
-
- @test_invoker_helper.process_deep_dependencies(
- @configurator.collection_all_tests + @configurator.collection_all_source )
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/test_invoker_helper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/test_invoker_helper.rb
deleted file mode 100755
index b0a223f5..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/test_invoker_helper.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-
-class TestInvokerHelper
-
- constructor :configurator, :task_invoker, :test_includes_extractor, :file_finder, :file_path_utils, :file_wrapper
-
- def clean_results(results, options)
- @file_wrapper.rm_f( results[:fail] )
- @file_wrapper.rm_f( results[:pass] ) if (options[:force_run])
- end
-
- def process_deep_dependencies(files)
- return if (not @configurator.project_use_deep_dependencies)
-
- dependencies_list = @file_path_utils.form_test_dependencies_filelist( files )
-
- if @configurator.project_generate_deep_dependencies
- @task_invoker.invoke_test_dependencies_files( dependencies_list )
- end
-
- yield( dependencies_list ) if block_given?
- end
-
- def extract_sources(test)
- sources = []
- includes = @test_includes_extractor.lookup_includes_list(test)
-
- includes.each { |include| sources << @file_finder.find_compilation_input_file(include, :ignore) }
-
- return sources.compact
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/tool_executor.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/tool_executor.rb
deleted file mode 100755
index 0ab5ddca..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/tool_executor.rb
+++ /dev/null
@@ -1,229 +0,0 @@
-require 'ceedling/constants'
-require 'benchmark'
-
-class ShellExecutionException < RuntimeError
- attr_reader :shell_result
- def initialize(shell_result)
- @shell_result = shell_result
- end
-end
-
-class ToolExecutor
-
- constructor :configurator, :tool_executor_helper, :streaminator, :system_wrapper
-
- def setup
- @tool_name = ''
- @executable = ''
- end
-
- # build up a command line from yaml provided config
-
- # @param extra_params is an array of parameters to append to executable
- def build_command_line(tool_config, extra_params, *args)
- @tool_name = tool_config[:name]
- @executable = tool_config[:executable]
-
- command = {}
-
- # basic premise is to iterate top to bottom through arguments using '$' as
- # a string replacement indicator to expand globals or inline yaml arrays
- # into command line arguments via substitution strings
- # executable must be quoted if it includes spaces (common on windows)
- executable = @tool_executor_helper.osify_path_separators( expandify_element(@executable, *args) )
- executable = "\"#{executable}\"" if executable.include?(' ')
- command[:line] = [
- executable,
- extra_params.join(' ').strip,
- build_arguments(tool_config[:arguments], *args),
- ].reject{|s| s.nil? || s.empty?}.join(' ').strip
-
- command[:options] = {
- :stderr_redirect => @tool_executor_helper.stderr_redirection(tool_config, @configurator.project_logging),
- :background_exec => tool_config[:background_exec]
- }
-
- return command
- end
-
-
- # shell out, execute command, and return response
- def exec(command, options={}, args=[])
- options[:boom] = true if (options[:boom].nil?)
- options[:stderr_redirect] = StdErrRedirect::NONE if (options[:stderr_redirect].nil?)
- options[:background_exec] = BackgroundExec::NONE if (options[:background_exec].nil?)
- # build command line
- command_line = [
- @tool_executor_helper.background_exec_cmdline_prepend( options ),
- command.strip,
- args,
- @tool_executor_helper.stderr_redirect_cmdline_append( options ),
- @tool_executor_helper.background_exec_cmdline_append( options ),
- ].flatten.compact.join(' ')
-
- @streaminator.stderr_puts("Verbose: #{__method__.to_s}(): #{command_line}", Verbosity::DEBUG)
-
- shell_result = {}
-
- # depending on background exec option, we shell out differently
- time = Benchmark.realtime do
- if (options[:background_exec] != BackgroundExec::NONE)
- shell_result = @system_wrapper.shell_system( command_line, options[:boom] )
- else
- shell_result = @system_wrapper.shell_backticks( command_line, options[:boom] )
- end
- end
- shell_result[:time] = time
-
- #scrub the string for illegal output
- unless shell_result[:output].nil?
- shell_result[:output] = shell_result[:output].scrub if "".respond_to?(:scrub)
- shell_result[:output].gsub!(/\033\[\d\dm/,'')
- end
-
- @tool_executor_helper.print_happy_results( command_line, shell_result, options[:boom] )
- @tool_executor_helper.print_error_results( command_line, shell_result, options[:boom] )
-
- # go boom if exit code isn't 0 (but in some cases we don't want a non-0 exit code to raise)
- raise ShellExecutionException.new(shell_result) if ((shell_result[:exit_code] != 0) and options[:boom])
-
- return shell_result
- end
-
-
- private #############################
-
-
- def build_arguments(config, *args)
- build_string = ''
-
- return nil if (config.nil?)
-
- # iterate through each argument
-
- # the yaml blob array needs to be flattened so that yaml substitution
- # is handled correctly, since it creates a nested array when an anchor is
- # dereferenced
- config.flatten.each do |element|
- argument = ''
-
- case(element)
- # if we find a simple string then look for string replacement operators
- # and expand with the parameters in this method's argument list
- when String then argument = expandify_element(element, *args)
- # if we find a hash, then we grab the key as a substitution string and expand the
- # hash's value(s) within that substitution string
- when Hash then argument = dehashify_argument_elements(element)
- end
-
- build_string.concat("#{argument} ") if (argument.length > 0)
- end
-
- build_string.strip!
- return build_string if (build_string.length > 0)
- return nil
- end
-
-
- # handle simple text string argument & argument array string replacement operators
- def expandify_element(element, *args)
- match = //
- to_process = nil
- args_index = 0
-
- # handle ${#} input replacement
- if (element =~ TOOL_EXECUTOR_ARGUMENT_REPLACEMENT_PATTERN)
- args_index = ($2.to_i - 1)
-
- if (args.nil? or args[args_index].nil?)
- @streaminator.stderr_puts("ERROR: Tool '#{@tool_name}' expected valid argument data to accompany replacement operator #{$1}.", Verbosity::ERRORS)
- raise
- end
-
- match = /#{Regexp.escape($1)}/
- to_process = args[args_index]
- end
-
- # simple string argument: replace escaped '\$' and strip
- element.sub!(/\\\$/, '$')
- element.strip!
-
- # handle inline ruby execution
- if (element =~ RUBY_EVAL_REPLACEMENT_PATTERN)
- element.replace(eval($1))
- end
-
- build_string = ''
-
- # handle array or anything else passed into method to be expanded in place of replacement operators
- case (to_process)
- when Array then to_process.each {|value| build_string.concat( "#{element.sub(match, value.to_s)} " ) } if (to_process.size > 0)
- else build_string.concat( element.sub(match, to_process.to_s) )
- end
-
- # handle inline ruby string substitution
- if (build_string =~ RUBY_STRING_REPLACEMENT_PATTERN)
- build_string.replace(@system_wrapper.module_eval(build_string))
- end
-
- return build_string.strip
- end
-
-
- # handle argument hash: keys are substitution strings, values are data to be expanded within substitution strings
- def dehashify_argument_elements(hash)
- build_string = ''
- elements = []
-
- # grab the substitution string (hash key)
- substitution = hash.keys[0].to_s
- # grab the string(s) to squirt into the substitution string (hash value)
- expand = hash[hash.keys[0]]
-
- if (expand.nil?)
- @streaminator.stderr_puts("ERROR: Tool '#{@tool_name}' could not expand nil elements for substitution string '#{substitution}'.", Verbosity::ERRORS)
- raise
- end
-
- # array-ify expansion input if only a single string
- expansion = ((expand.class == String) ? [expand] : expand)
-
- expansion.each do |item|
- # code eval substitution
- if (item =~ RUBY_EVAL_REPLACEMENT_PATTERN)
- elements << eval($1)
- # string eval substitution
- elsif (item =~ RUBY_STRING_REPLACEMENT_PATTERN)
- elements << @system_wrapper.module_eval(item)
- # global constants
- elsif (@system_wrapper.constants_include?(item))
- const = Object.const_get(item)
- if (const.nil?)
- @streaminator.stderr_puts("ERROR: Tool '#{@tool_name}' found constant '#{item}' to be nil.", Verbosity::ERRORS)
- raise
- else
- elements << const
- end
- elsif (item.class == Array)
- elements << item
- elsif (item.class == String)
- @streaminator.stderr_puts("ERROR: Tool '#{@tool_name}' cannot expand nonexistent value '#{item}' for substitution string '#{substitution}'.", Verbosity::ERRORS)
- raise
- else
- @streaminator.stderr_puts("ERROR: Tool '#{@tool_name}' cannot expand value having type '#{item.class}' for substitution string '#{substitution}'.", Verbosity::ERRORS)
- raise
- end
- end
-
- # expand elements (whether string or array) into substitution string & replace escaped '\$'
- elements.flatten!
- elements.each do |element|
- build_string.concat( substitution.sub(/([^\\]*)\$/, "\\1#{element}") ) # don't replace escaped '\$' but allow us to replace just a lonesome '$'
- build_string.gsub!(/\\\$/, '$')
- build_string.concat(' ')
- end
-
- return build_string.strip
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/tool_executor_helper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/tool_executor_helper.rb
deleted file mode 100755
index de4cafe4..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/tool_executor_helper.rb
+++ /dev/null
@@ -1,164 +0,0 @@
-require 'ceedling/constants' # for Verbosity enumeration & $stderr redirect enumeration
-
-##
-# Helper functions for the tool executor
-class ToolExecutorHelper
-
- constructor :streaminator, :system_utils, :system_wrapper
-
- ##
- # Returns the stderr redirection based on the config and logging.
- # ==== Attributes
- #
- # * _tool_config_: A hash containing config information.
- # * _logging_: A boolean representing if logging is enabled or not.
- #
- def stderr_redirection(tool_config, logging)
- # if there's no logging enabled, return :stderr_redirect unmodified
- return tool_config[:stderr_redirect] if (not logging)
-
- # if there is logging enabled but the redirect is a custom value (not enum), return the custom string
- return tool_config[:stderr_redirect] if (tool_config[:stderr_redirect].class == String)
-
- # if logging is enabled but there's no custom string, return the AUTO enumeration so $stderr goes into the log
- return StdErrRedirect::AUTO
- end
-
-
- ##
- # Returns the background execution prepend based on the config.
- # ==== Attributes
- #
- # * _tool_config_: A hash containing config information.
- #
- def background_exec_cmdline_prepend(tool_config)
- return nil if (tool_config.nil? || tool_config[:background_exec].nil?)
-
- config_exec = tool_config[:background_exec]
-
- if ((config_exec == BackgroundExec::AUTO) and (@system_wrapper.windows?))
- return 'start'
- end
-
- if (config_exec == BackgroundExec::WIN)
- return 'start'
- end
-
- return nil
- end
-
-
- ##
- # Modifies an executables path based on platform.
- # ==== Attributes
- #
- # * _executable_: The executable's path.
- #
- def osify_path_separators(executable)
- return executable.gsub(/\//, '\\') if (@system_wrapper.windows?)
- return executable
- end
-
- ##
- # Returns the stderr redirect append based on the config.
- # ==== Attributes
- #
- # * _tool_config_: A hash containing config information.
- #
- def stderr_redirect_cmdline_append(tool_config)
- return nil if (tool_config.nil? || tool_config[:stderr_redirect].nil?)
-
- config_redirect = tool_config[:stderr_redirect]
- redirect = StdErrRedirect::NONE
-
- if (config_redirect == StdErrRedirect::AUTO)
- if (@system_wrapper.windows?)
- redirect = StdErrRedirect::WIN
- elsif (@system_utils.tcsh_shell?)
- redirect = StdErrRedirect::TCSH
- else
- redirect = StdErrRedirect::UNIX
- end
- end
-
- case redirect
- # we may need more complicated processing after some learning with various environments
- when StdErrRedirect::NONE then nil
- when StdErrRedirect::WIN then '2>&1'
- when StdErrRedirect::UNIX then '2>&1'
- when StdErrRedirect::TCSH then '|&'
- else redirect.to_s
- end
- end
-
- ##
- # Returns the background execution append based on the config.
- # ==== Attributes
- #
- # * _tool_config_: A hash containing config information.
- #
- def background_exec_cmdline_append(tool_config)
- return nil if (tool_config.nil? || tool_config[:background_exec].nil?)
-
- config_exec = tool_config[:background_exec]
-
- # if :auto & windows, then we already prepended 'start' and should append nothing
- return nil if ((config_exec == BackgroundExec::AUTO) and (@system_wrapper.windows?))
-
- # if :auto & not windows, then we append standard '&'
- return '&' if ((config_exec == BackgroundExec::AUTO) and (not @system_wrapper.windows?))
-
- # if explicitly Unix, then append '&'
- return '&' if (config_exec == BackgroundExec::UNIX)
-
- # * _command_str_: A hash containing config information.
- # all other cases, including :none, :win, & anything unrecognized, append nothing
- return nil
- end
-
- ##
- # Outputs success results if command succeeded and we have verbosity cranked up.
- # ==== Attributes
- #
- # * _command_str_: The command ran.
- # * _shell_results_: The outputs of the command including exit code and
- # output.
- # * _boom_: A boolean representing if a non zero result is erroneous.
- #
- def print_happy_results(command_str, shell_result, boom=true)
- if ((shell_result[:exit_code] == 0) or ((shell_result[:exit_code] != 0) and not boom))
- output = "> Shell executed command:\n"
- output += "'#{command_str}'\n"
- output += "> Produced output:\n" if (not shell_result[:output].empty?)
- output += "#{shell_result[:output].strip}\n" if (not shell_result[:output].empty?)
- output += "> And exited with status: [#{shell_result[:exit_code]}].\n" if (shell_result[:exit_code] != 0)
- output += "\n"
-
- @streaminator.stdout_puts(output, Verbosity::OBNOXIOUS)
- end
- end
-
- ##
- # Outputs failures results if command failed and we have verbosity set to minimum error level.
- # ==== Attributes
- #
- # * _command_str_: The command ran.
- # * _shell_results_: The outputs of the command including exit code and
- # output.
- # * _boom_: A boolean representing if a non zero result is erroneous.
- #
- def print_error_results(command_str, shell_result, boom=true)
- if ((shell_result[:exit_code] != 0) and boom)
- output = "ERROR: Shell command failed.\n"
- output += "> Shell executed command:\n"
- output += "'#{command_str}'\n"
- output += "> Produced output:\n" if (not shell_result[:output].empty?)
- output += "#{shell_result[:output].strip}\n" if (not shell_result[:output].empty?)
- output += "> And exited with status: [#{shell_result[:exit_code]}].\n" if (shell_result[:exit_code] != nil)
- output += "> And then likely crashed.\n" if (shell_result[:exit_code] == nil)
- output += "\n"
-
- @streaminator.stderr_puts(output, Verbosity::ERRORS)
- end
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/verbosinator.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/verbosinator.rb
deleted file mode 100755
index e8ed38d7..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/verbosinator.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-
-class Verbosinator
-
- constructor :configurator
-
- def should_output?(level)
- return (level <= @configurator.project_verbosity)
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/version.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/version.rb
deleted file mode 100755
index ba917df5..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/version.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-
-# @private
-module Ceedling
- module Version
- # Check for local or global version of vendor directory in order to look up versions
- {
- "CEXCEPTION" => File.join("vendor","c_exception","lib","CException.h"),
- "CMOCK" => File.join("vendor","cmock","src","cmock.h"),
- "UNITY" => File.join("vendor","unity","src","unity.h"),
- }.each_pair do |name, path|
- filename = if (File.exist?(File.join("..","..",path)))
- File.join("..","..",path)
- elsif (File.exist?(File.join(File.dirname(__FILE__),"..","..",path)))
- File.join(File.dirname(__FILE__),"..","..",path)
- else
- eval "#{name} = 'unknown'"
- continue
- end
-
- # Actually look up the versions
- a = [0,0,0]
- File.readlines(filename) do |line|
- ["VERSION_MAJOR", "VERSION_MINOR", "VERSION_BUILD"].each_with_index do |field, i|
- m = line.match(/#{name}_#{field}\s+(\d+)/)
- a[i] = m[1] unless (m.nil?)
- end
- end
-
- # Make a constant from each, so that we can use it elsewhere
- eval "#{name} = '#{a.join(".")}'"
- end
-
- GEM = "0.29.0"
- CEEDLING = GEM
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/version.rb.erb b/tinyusb/test/vendor/ceedling/lib/ceedling/version.rb.erb
deleted file mode 100755
index a31e3abb..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/version.rb.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-# @private
-module Ceedling
- module Version
- # @private
- GEM = "0.27.0"
- # @private
- CEEDLING = "<%= versions["CEEDLING"] %>"
- # @private
- CEXCEPTION = "<%= versions["CEXCEPTION"] %>"
- # @private
- CMOCK = "<%= versions["CMOCK"] %>"
- # @private
- UNITY = "<%= versions["UNITY"] %>"
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/lib/ceedling/yaml_wrapper.rb b/tinyusb/test/vendor/ceedling/lib/ceedling/yaml_wrapper.rb
deleted file mode 100755
index 00ece514..00000000
--- a/tinyusb/test/vendor/ceedling/lib/ceedling/yaml_wrapper.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'yaml'
-require 'erb'
-
-
-class YamlWrapper
-
- def load(filepath)
- return YAML.load(ERB.new(File.read(filepath)).result)
- end
-
- def dump(filepath, structure)
- File.open(filepath, 'w') do |output|
- YAML.dump(structure, output)
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/beep/README.md b/tinyusb/test/vendor/ceedling/plugins/beep/README.md
deleted file mode 100755
index e59d881b..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/beep/README.md
+++ /dev/null
@@ -1,22 +0,0 @@
-ceedling-beep
-=============
-
-This is a simple plugin that just beeps at the end of a build and/or test sequence. Are you getting too distracted surfing
-the internet, chatting with coworkers, or swordfighting while it's building or testing? The friendly beep will let you know
-it's time to pay attention again.
-
-This plugin has very few configuration options. At this time it can beep on completion of a task and/or on an error condition.
-For each of these, you can configure the method that it should beep.
-
-```
-:tools:
- :beep_on_done: :bell
- :beep_on_error: :bell
-```
-
-Each of these have the following options:
-
- - :bell - this option uses the ASCII bell character out stdout
- - :speaker_test - this uses the linux speaker-test command if installed
-
-Very likely, we'll be adding to this list if people find this to be useful.
diff --git a/tinyusb/test/vendor/ceedling/plugins/beep/lib/beep.rb b/tinyusb/test/vendor/ceedling/plugins/beep/lib/beep.rb
deleted file mode 100755
index 6a6d01ab..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/beep/lib/beep.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/constants'
-
-class Beep < Plugin
-
- attr_reader :config
-
- def setup
- @config = {
- :on_done => ((defined? TOOLS_BEEP_ON_DONE) ? TOOLS_BEEP_ON_DONE : :bell ),
- :on_error => ((defined? TOOLS_BEEP_ON_ERROR) ? TOOLS_BEEP_ON_ERROR : :bell ),
- }
- end
-
- def post_build
- beep @config[:on_done]
- end
-
- def post_error
- beep @config[:on_error]
- end
-
- private
-
- def beep(method = :none)
- case method
- when :bell
- if (SystemWrapper.windows?)
- puts "echo '\007'"
- else
- puts "echo -ne '\007'"
- end
- when :speaker_test
- `speaker-test -t sine -f 1000 -l 1`
- else
- #do nothing with illegal or :none
- end
- end
-end
-
diff --git a/tinyusb/test/vendor/ceedling/plugins/bullseye/assets/template.erb b/tinyusb/test/vendor/ceedling/plugins/bullseye/assets/template.erb
deleted file mode 100755
index 504f8558..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/bullseye/assets/template.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-% function_string = hash[:coverage][:functions].to_s
-% branch_string = hash[:coverage][:branches].to_s
-% format_string = "%#{[function_string.length, branch_string.length].max}i"
-<%=@ceedling[:plugin_reportinator].generate_banner("#{hash[:header]}: CODE COVERAGE SUMMARY")%>
-% if (!hash[:coverage][:functions].nil?)
-FUNCTIONS: <%=sprintf(format_string, hash[:coverage][:functions])%>%
-% else
-FUNCTIONS: none
-% end
-% if (!hash[:coverage][:branches].nil?)
-BRANCHES: <%=sprintf(format_string, hash[:coverage][:branches])%>%
-% else
-BRANCHES: none
-% end
-
diff --git a/tinyusb/test/vendor/ceedling/plugins/bullseye/bullseye.rake b/tinyusb/test/vendor/ceedling/plugins/bullseye/bullseye.rake
deleted file mode 100755
index a7bbebe3..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/bullseye/bullseye.rake
+++ /dev/null
@@ -1,169 +0,0 @@
-directory(BULLSEYE_BUILD_OUTPUT_PATH)
-directory(BULLSEYE_RESULTS_PATH)
-directory(BULLSEYE_ARTIFACTS_PATH)
-directory(BULLSEYE_DEPENDENCIES_PATH)
-
-CLEAN.include(File.join(BULLSEYE_BUILD_OUTPUT_PATH, '*'))
-CLEAN.include(File.join(BULLSEYE_RESULTS_PATH, '*'))
-CLEAN.include(File.join(BULLSEYE_DEPENDENCIES_PATH, '*'))
-
-CLOBBER.include(File.join(BULLSEYE_BUILD_PATH, '**/*'))
-PLUGINS_BULLSEYE_LIB_PATH = 'C:\\tools\\BullseyeCoverage\\lib' if not defined?(PLUGINS_BULLSEYE_LIB_PATH)
-
-rule(/#{BULLSEYE_BUILD_OUTPUT_PATH}\/#{'.+\\'+EXTENSION_OBJECT}$/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_compilation_input_file(task_name)
- end
- ]) do |object|
-
- if File.basename(object.source) =~ /^(#{PROJECT_TEST_FILE_PREFIX}|#{CMOCK_MOCK_PREFIX}|#{BULLSEYE_IGNORE_SOURCES.join('|')})/i
- @ceedling[:generator].generate_object_file(
- TOOLS_BULLSEYE_COMPILER,
- OPERATION_COMPILE_SYM,
- BULLSEYE_SYM,
- object.source,
- object.name,
- @ceedling[:file_path_utils].form_test_build_list_filepath(object.name)
- )
- else
- @ceedling[BULLSEYE_SYM].generate_coverage_object_file(object.source, object.name)
- end
-
-end
-
-rule(/#{BULLSEYE_BUILD_OUTPUT_PATH}\/#{'.+\\'+EXTENSION_EXECUTABLE}$/) do |bin_file|
- @ceedling[:generator].generate_executable_file(
- TOOLS_BULLSEYE_LINKER,
- BULLSEYE_SYM,
- bin_file.prerequisites,
- bin_file.name,
- @ceedling[:file_path_utils].form_test_build_map_filepath(bin_file.name)
- )
-end
-
-rule(/#{BULLSEYE_RESULTS_PATH}\/#{'.+\\'+EXTENSION_TESTPASS}$/ => [
- proc do |task_name|
- @ceedling[:file_path_utils].form_test_executable_filepath(task_name)
- end
- ]) do |test_result|
- @ceedling[:generator].generate_test_results(TOOLS_BULLSEYE_FIXTURE, BULLSEYE_SYM, test_result.source, test_result.name)
-end
-
-rule(/#{BULLSEYE_DEPENDENCIES_PATH}\/#{'.+\\'+EXTENSION_DEPENDENCIES}$/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_compilation_input_file(task_name)
- end
- ]) do |dep|
- @ceedling[:generator].generate_dependencies_file(
- TOOLS_TEST_DEPENDENCIES_GENERATOR,
- BULLSEYE_SYM,
- dep.source,
- File.join(BULLSEYE_BUILD_OUTPUT_PATH, File.basename(dep.source).ext(EXTENSION_OBJECT) ),
- dep.name
- )
-end
-
-task :directories => [BULLSEYE_BUILD_OUTPUT_PATH, BULLSEYE_RESULTS_PATH, BULLSEYE_DEPENDENCIES_PATH, BULLSEYE_ARTIFACTS_PATH]
-
-namespace BULLSEYE_SYM do
- task source_coverage: COLLECTION_ALL_SOURCE.pathmap("#{BULLSEYE_BUILD_OUTPUT_PATH}/%n#{@ceedling[:configurator].extension_object}")
-
- desc 'Run code coverage for all tests'
- task all: [:directories] do
- @ceedling[:configurator].replace_flattened_config(@ceedling[BULLSEYE_SYM].config)
- @ceedling[BULLSEYE_SYM].enableBullseye(true)
- @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, BULLSEYE_SYM)
- @ceedling[:configurator].restore_config
- end
-
- desc "Run single test w/ coverage ([*] real test or source file name, no path)."
- task :* do
- message = "\nOops! '#{BULLSEYE_ROOT_NAME}:*' isn't a real task. " +
- "Use a real test or source file name (no path) in place of the wildcard.\n" +
- "Example: rake #{BULLSEYE_ROOT_NAME}:foo.c\n\n"
-
- @ceedling[:streaminator].stdout_puts( message )
- end
-
- desc 'Run tests by matching regular expression pattern.'
- task :pattern, [:regex] => [:directories] do |_t, args|
- matches = []
-
- COLLECTION_ALL_TESTS.each do |test|
- matches << test if test =~ /#{args.regex}/
- end
-
- if !matches.empty?
- @ceedling[:configurator].replace_flattened_config(@ceedling[BULLSEYE_SYM].config)
- @ceedling[BULLSEYE_SYM].enableBullseye(true)
- @ceedling[:test_invoker].setup_and_invoke(matches, BULLSEYE_SYM, force_run: false)
- @ceedling[:configurator].restore_config
- else
- @ceedling[:streaminator].stdout_puts("\nFound no tests matching pattern /#{args.regex}/.")
- end
- end
-
- desc 'Run tests whose test path contains [dir] or [dir] substring.'
- task :path, [:dir] => [:directories] do |_t, args|
- matches = []
-
- COLLECTION_ALL_TESTS.each do |test|
- matches << test if File.dirname(test).include?(args.dir.tr('\\', '/'))
- end
-
- if !matches.empty?
- @ceedling[:configurator].replace_flattened_config(@ceedling[BULLSEYE_SYM].config)
- @ceedling[BULLSEYE_SYM].enableBullseye(true)
- @ceedling[:test_invoker].setup_and_invoke(matches, BULLSEYE_SYM, force_run: false)
- @ceedling[:configurator].restore_config
- else
- @ceedling[:streaminator].stdout_puts("\nFound no tests including the given path or path component.")
- end
- end
-
- desc 'Run code coverage for changed files'
- task delta: [:directories] do
- @ceedling[:configurator].replace_flattened_config(@ceedling[BULLSEYE_SYM].config)
- @ceedling[BULLSEYE_SYM].enableBullseye(true)
- @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, BULLSEYE_SYM, {:force_run => false})
- @ceedling[:configurator].restore_config
- end
-
- # use a rule to increase efficiency for large projects
- # bullseye test tasks by regex
- rule(/^#{BULLSEYE_TASK_ROOT}\S+$/ => [
- proc do |task_name|
- test = task_name.sub(/#{BULLSEYE_TASK_ROOT}/, '')
- test = "#{PROJECT_TEST_FILE_PREFIX}#{test}" unless test.start_with?(PROJECT_TEST_FILE_PREFIX)
- @ceedling[:file_finder].find_test_from_file_path(test)
- end
- ]) do |test|
- @ceedling[:rake_wrapper][:directories].invoke
- @ceedling[:configurator].replace_flattened_config(@ceedling[BULLSEYE_SYM].config)
- @ceedling[BULLSEYE_SYM].enableBullseye(true)
- @ceedling[:test_invoker].setup_and_invoke([test.source], BULLSEYE_SYM)
- @ceedling[:configurator].restore_config
- end
-
-end
-
-if PROJECT_USE_DEEP_DEPENDENCIES
-namespace REFRESH_SYM do
- task BULLSEYE_SYM do
- @ceedling[:configurator].replace_flattened_config(@ceedling[BULLSEYE_SYM].config)
- @ceedling[BULLSEYE_SYM].enableBullseye(true)
- @ceedling[:test_invoker].refresh_deep_dependencies
- @ceedling[:configurator].restore_config
- end
-end
-end
-
-namespace UTILS_SYM do
-
- desc "Open Bullseye code coverage browser"
- task BULLSEYE_SYM do
- command = @ceedling[:tool_executor].build_command_line(TOOLS_BULLSEYE_BROWSER, [])
- @ceedling[:tool_executor].exec(command[:line], command[:options])
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/bullseye/config/defaults.yml b/tinyusb/test/vendor/ceedling/plugins/bullseye/config/defaults.yml
deleted file mode 100755
index ed261d8e..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/bullseye/config/defaults.yml
+++ /dev/null
@@ -1,57 +0,0 @@
----
-
-:bullseye:
- :auto_license: TRUE
-:plugins:
- :bullseye_lib_path: []
-:paths:
- :bullseye_toolchain_include: []
-
-:tools:
- :bullseye_instrumentation:
- :executable: covc
- :arguments:
- - '--file $': ENVIRONMENT_COVFILE
- - -q
- - ${1}
- :bullseye_compiler:
- :executable: gcc
- :arguments:
- - -g
- - -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- - -I"$": COLLECTION_PATHS_BULLSEYE_TOOLCHAIN_INCLUDE
- - -D$: COLLECTION_DEFINES_TEST_AND_VENDOR
- - -DBULLSEYE_COMPILER
- - -c "${1}"
- - -o "${2}"
- :bullseye_linker:
- :executable: gcc
- :arguments:
- - ${1}
- - -o ${2}
- - -L$: PLUGINS_BULLSEYE_LIB_PATH
- - -lcov
- :bullseye_fixture:
- :executable: ${1}
- :bullseye_report_covsrc:
- :executable: covsrc
- :arguments:
- - '--file $': ENVIRONMENT_COVFILE
- - -q
- - -w140
- :bullseye_report_covfn:
- :executable: covfn
- :stderr_redirect: :auto
- :arguments:
- - '--file $': ENVIRONMENT_COVFILE
- - --width 120
- - --no-source
- - '"${1}"'
- :bullseye_browser:
- :executable: CoverageBrowser
- :background_exec: :auto
- :optional: TRUE
- :arguments:
- - '"$"': ENVIRONMENT_COVFILE
-
-...
diff --git a/tinyusb/test/vendor/ceedling/plugins/bullseye/lib/bullseye.rb b/tinyusb/test/vendor/ceedling/plugins/bullseye/lib/bullseye.rb
deleted file mode 100755
index ffa444ac..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/bullseye/lib/bullseye.rb
+++ /dev/null
@@ -1,194 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/constants'
-
-BULLSEYE_ROOT_NAME = 'bullseye'
-BULLSEYE_TASK_ROOT = BULLSEYE_ROOT_NAME + ':'
-BULLSEYE_SYM = BULLSEYE_ROOT_NAME.to_sym
-
-BULLSEYE_BUILD_PATH = "#{PROJECT_BUILD_ROOT}/#{BULLSEYE_ROOT_NAME}"
-BULLSEYE_BUILD_OUTPUT_PATH = "#{BULLSEYE_BUILD_PATH}/out"
-BULLSEYE_RESULTS_PATH = "#{BULLSEYE_BUILD_PATH}/results"
-BULLSEYE_DEPENDENCIES_PATH = "#{BULLSEYE_BUILD_PATH}/dependencies"
-BULLSEYE_ARTIFACTS_PATH = "#{PROJECT_BUILD_ARTIFACTS_ROOT}/#{BULLSEYE_ROOT_NAME}"
-
-BULLSEYE_IGNORE_SOURCES = ['unity', 'cmock', 'cexception']
-
-
-class Bullseye < Plugin
-
- def setup
- @result_list = []
- @environment = [ {:covfile => File.join( BULLSEYE_ARTIFACTS_PATH, 'test.cov' )} ]
- @plugin_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
- @coverage_template_all = @ceedling[:file_wrapper].read(File.join(@plugin_root, 'assets/template.erb'))
- end
-
- def config
- {
- :project_test_build_output_path => BULLSEYE_BUILD_OUTPUT_PATH,
- :project_test_results_path => BULLSEYE_RESULTS_PATH,
- :project_test_dependencies_path => BULLSEYE_DEPENDENCIES_PATH,
- :defines_test => DEFINES_TEST + ['CODE_COVERAGE'],
- :collection_defines_test_and_vendor => COLLECTION_DEFINES_TEST_AND_VENDOR + ['CODE_COVERAGE']
- }
- end
-
- def generate_coverage_object_file(source, object)
- arg_hash = {:tool => TOOLS_BULLSEYE_INSTRUMENTATION, :context => BULLSEYE_SYM, :source => source, :object => object}
- @ceedling[:plugin_manager].pre_compile_execute(arg_hash)
-
- @ceedling[:streaminator].stdout_puts("Compiling #{File.basename(source)} with coverage...")
- compile_command =
- @ceedling[:tool_executor].build_command_line(
- TOOLS_BULLSEYE_COMPILER,
- @ceedling[:flaginator].flag_down( OPERATION_COMPILE_SYM, BULLSEYE_SYM, source ),
- source,
- object,
- @ceedling[:file_path_utils].form_test_build_list_filepath( object ) )
- coverage_command = @ceedling[:tool_executor].build_command_line(TOOLS_BULLSEYE_INSTRUMENTATION, [], compile_command[:line] )
-
- shell_result = @ceedling[:tool_executor].exec( coverage_command[:line], coverage_command[:options] )
-
- arg_hash[:shell_result] = shell_result
- @ceedling[:plugin_manager].post_compile_execute(arg_hash)
- end
-
- def post_test_fixture_execute(arg_hash)
- result_file = arg_hash[:result_file]
-
- if ((result_file =~ /#{BULLSEYE_RESULTS_PATH}/) and (not @result_list.include?(result_file)))
- @result_list << arg_hash[:result_file]
- end
- end
-
- def post_build
- return if (not @ceedling[:task_invoker].invoked?(/^#{BULLSEYE_TASK_ROOT}/))
-
- # test results
- results = @ceedling[:plugin_reportinator].assemble_test_results(@result_list)
- hash = {
- :header => BULLSEYE_ROOT_NAME.upcase,
- :results => results
- }
-
- @ceedling[:plugin_reportinator].run_test_results_report(hash) do
- message = ''
- message = 'Unit test failures.' if (results[:counts][:failed] > 0)
- message
- end
-
- # coverage results
- return if (verify_coverage_file() == false)
- if (@ceedling[:task_invoker].invoked?(/^#{BULLSEYE_TASK_ROOT}(all|delta)/))
- command = @ceedling[:tool_executor].build_command_line(TOOLS_BULLSEYE_REPORT_COVSRC, [])
- shell_result = @ceedling[:tool_executor].exec(command[:line], command[:options])
- report_coverage_results_all(shell_result[:output])
- else
- report_per_function_coverage_results(@ceedling[:test_invoker].sources)
- end
- end
-
- def summary
- return if (verify_coverage_file() == false)
- result_list = @ceedling[:file_path_utils].form_pass_results_filelist( BULLSEYE_RESULTS_PATH, COLLECTION_ALL_TESTS )
-
- # test results
- # get test results for only those tests in our configuration and of those only tests with results on disk
- hash = {
- :header => BULLSEYE_ROOT_NAME.upcase,
- :results => @ceedling[:plugin_reportinator].assemble_test_results(result_list, {:boom => false})
- }
-
- @ceedling[:plugin_reportinator].run_test_results_report(hash)
-
- # coverage results
- command = @ceedling[:tool_executor].build_command_line(TOOLS_BULLSEYE_REPORT_COVSRC)
- shell_result = @ceedling[:tool_executor].exec(command[:line], command[:options])
- report_coverage_results_all(shell_result[:output])
- end
-
- def enableBullseye(enable)
- if BULLSEYE_AUTO_LICENSE
- if (enable)
- args = ['push', 'on']
- @ceedling[:streaminator].stdout_puts("Enabling Bullseye")
- else
- args = ['pop']
- @ceedling[:streaminator].stdout_puts("Reverting Bullseye to previous state")
- end
-
- args.each do |arg|
- command = @ceedling[:tool_executor].build_command_line(TOOLS_BULLSEYE_BUILD_ENABLE_DISABLE, [], arg)
- shell_result = @ceedling[:tool_executor].exec(command[:line], command[:options])
- end
-
- end
- end
-
- private ###################################
-
- def report_coverage_results_all(coverage)
- results = {
- :header => BULLSEYE_ROOT_NAME.upcase,
- :coverage => {
- :functions => nil,
- :branches => nil
- }
- }
-
- if (coverage =~ /^Total.*?=\s+([0-9]+)\%/)
- results[:coverage][:functions] = $1.to_i
- end
-
- if (coverage =~ /^Total.*=\s+([0-9]+)\%\s*$/)
- results[:coverage][:branches] = $1.to_i
- end
-
- @ceedling[:plugin_reportinator].run_report($stdout, @coverage_template_all, results)
- end
-
- def report_per_function_coverage_results(sources)
- banner = @ceedling[:plugin_reportinator].generate_banner( "#{BULLSEYE_ROOT_NAME.upcase}: CODE COVERAGE SUMMARY" )
- @ceedling[:streaminator].stdout_puts "\n" + banner
-
- coverage_sources = sources.clone
- coverage_sources.delete_if {|item| item =~ /#{CMOCK_MOCK_PREFIX}.+#{EXTENSION_SOURCE}$/}
- coverage_sources.delete_if {|item| item =~ /#{BULLSEYE_IGNORE_SOURCES.join('|')}#{EXTENSION_SOURCE}$/}
-
- coverage_sources.each do |source|
- command = @ceedling[:tool_executor].build_command_line(TOOLS_BULLSEYE_REPORT_COVFN, [], source)
- shell_results = @ceedling[:tool_executor].exec(command[:line], command[:options])
- coverage_results = shell_results[:output].deep_clone
- coverage_results.sub!(/.*\n.*\n/,'') # Remove the Bullseye tool banner
- if (coverage_results =~ /warning cov814: report is empty/)
- coverage_results = "WARNING: #{source} contains no coverage data!\n\n"
- @ceedling[:streaminator].stdout_puts(coverage_results, Verbosity::COMPLAIN)
- else
- coverage_results += "\n"
- @ceedling[:streaminator].stdout_puts(coverage_results)
- end
- end
- end
-
- def verify_coverage_file
- exist = @ceedling[:file_wrapper].exist?( ENVIRONMENT_COVFILE )
-
- if (!exist)
- banner = @ceedling[:plugin_reportinator].generate_banner( "#{BULLSEYE_ROOT_NAME.upcase}: CODE COVERAGE SUMMARY" )
- @ceedling[:streaminator].stdout_puts "\n" + banner + "\nNo coverage file.\n\n"
- end
-
- return exist
- end
-
-end
-
-
-# end blocks always executed following rake run
-END {
- # cache our input configurations to use in comparison upon next execution
- if (@ceedling[:task_invoker].invoked?(/^#{BULLSEYE_TASK_ROOT}/))
- @ceedling[:cacheinator].cache_test_config( @ceedling[:setupinator].config_hash )
- @ceedling[BULLSEYE_SYM].enableBullseye(false)
- end
-}
diff --git a/tinyusb/test/vendor/ceedling/plugins/bullseye/readme.txt b/tinyusb/test/vendor/ceedling/plugins/bullseye/readme.txt
deleted file mode 100755
index e69de29b..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/bullseye/readme.txt
+++ /dev/null
diff --git a/tinyusb/test/vendor/ceedling/plugins/colour_report/lib/colour_report.rb b/tinyusb/test/vendor/ceedling/plugins/colour_report/lib/colour_report.rb
deleted file mode 100755
index 1211eab4..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/colour_report/lib/colour_report.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/streaminator'
-require 'ceedling/constants'
-
-class ColourReport < Plugin
-
- def setup
- @ceedling[:stream_wrapper].stdout_override(&ColourReport.method(:colour_stdout))
- end
-
- def self.colour_stdout(string)
- require 'colour_reporter.rb'
- report string
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/command_hooks/README.md b/tinyusb/test/vendor/ceedling/plugins/command_hooks/README.md
deleted file mode 100755
index 8ac64afc..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/command_hooks/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-ceedling-command-hooks
-======================
-
-Plugin for easily calling command line tools at various points in the build process
-
-Define any of these sections in :tools: to provide additional hooks to be called on demand:
-
-```
- :pre_mock_generate
- :post_mock_generate
- :pre_runner_generate
- :post_runner_generate
- :pre_compile_execute
- :post_compile_execute
- :pre_link_execute
- :post_link_execute
- :pre_test_fixture_execute
- :pre_test
- :post_test
- :pre_release
- :post_release
- :pre_build
- :post_build
-```
-
-Each of these tools can support an :executable string and an :arguments list, like so:
-
-```
-:tools:
- :post_link_execute:
- :executable: objcopy.exe
- :arguments:
- - ${1} #This is replaced with the executable name
- - output.srec
- - --strip-all
-```
-
-You may also specify an array of executables to be called in a particular place, like so:
-
-```
-:tools:
- :post_test:
- - :executable: echo
- :arguments: "${1} was glorious!"
- - :executable: echo
- :arguments:
- - it kinda made me cry a little.
- - you?
-```
-
-Please note that it varies which arguments are being parsed down to the
-hooks. For now see `command_hooks.rb` to figure out which suits you best.
-Happy Tweaking!
diff --git a/tinyusb/test/vendor/ceedling/plugins/command_hooks/lib/command_hooks.rb b/tinyusb/test/vendor/ceedling/plugins/command_hooks/lib/command_hooks.rb
deleted file mode 100755
index 4bf8b531..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/command_hooks/lib/command_hooks.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/constants'
-class CommandHooks < Plugin
-
- attr_reader :config
-
- def setup
- @config = {
- :pre_mock_generate => ((defined? TOOLS_PRE_MOCK_GENERATE) ? TOOLS_PRE_MOCK_GENERATE : nil ),
- :post_mock_generate => ((defined? TOOLS_POST_MOCK_GENERATE) ? TOOLS_POST_MOCK_GENERATE : nil ),
- :pre_runner_generate => ((defined? TOOLS_PRE_RUNNER_GENERATE) ? TOOLS_PRE_RUNNER_GENERATE : nil ),
- :post_runner_generate => ((defined? TOOLS_POST_RUNNER_GENERATE) ? TOOLS_POST_RUNNER_GENERATE : nil ),
- :pre_compile_execute => ((defined? TOOLS_PRE_COMPILE_EXECUTE) ? TOOLS_PRE_COMPILE_EXECUTE : nil ),
- :post_compile_execute => ((defined? TOOLS_POST_COMPILE_EXECUTE) ? TOOLS_POST_COMPILE_EXECUTE : nil ),
- :pre_link_execute => ((defined? TOOLS_PRE_LINK_EXECUTE) ? TOOLS_PRE_LINK_EXECUTE : nil ),
- :post_link_execute => ((defined? TOOLS_POST_LINK_EXECUTE) ? TOOLS_POST_LINK_EXECUTE : nil ),
- :pre_test_fixture_execute => ((defined? TOOLS_PRE_TEST_FIXTURE_EXECUTE) ? TOOLS_PRE_TEST_FIXTURE_EXECUTE : nil ),
- :post_test_fixture_execute => ((defined? TOOLS_POST_TEST_FIXTURE_EXECUTE) ? TOOLS_POST_TEST_FIXTURE_EXECUTE : nil ),
- :pre_test => ((defined? TOOLS_PRE_TEST) ? TOOLS_PRE_TEST : nil ),
- :post_test => ((defined? TOOLS_POST_TEST) ? TOOLS_POST_TEST : nil ),
- :pre_release => ((defined? TOOLS_PRE_RELEASE) ? TOOLS_PRE_RELEASE : nil ),
- :post_release => ((defined? TOOLS_POST_RELEASE) ? TOOLS_POST_RELEASE : nil ),
- :pre_build => ((defined? TOOLS_PRE_BUILD) ? TOOLS_PRE_BUILD : nil ),
- :post_build => ((defined? TOOLS_POST_BUILD) ? TOOLS_POST_BUILD : nil ),
- :post_error => ((defined? TOOLS_POST_ERROR) ? TOOLS_POST_ERROR : nil ),
- }
- @plugin_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
- end
-
- def pre_mock_generate(arg_hash); run_hook(:pre_mock_generate, arg_hash[:header_file] ); end
- def post_mock_generate(arg_hash); run_hook(:post_mock_generate, arg_hash[:header_file] ); end
- def pre_runner_generate(arg_hash); run_hook(:pre_runner_generate, arg_hash[:source ] ); end
- def post_runner_generate(arg_hash); run_hook(:post_runner_generate, arg_hash[:runner_file] ); end
- def pre_compile_execute(arg_hash); run_hook(:pre_compile_execute, arg_hash[:source_file] ); end
- def post_compile_execute(arg_hash); run_hook(:post_compile_execute, arg_hash[:object_file] ); end
- def pre_link_execute(arg_hash); run_hook(:pre_link_execute, arg_hash[:executable] ); end
- def post_link_execute(arg_hash); run_hook(:post_link_execute, arg_hash[:executable] ); end
- def pre_test_fixture_execute(arg_hash); run_hook(:pre_test_fixture_execute, arg_hash[:executable] ); end
- def post_test_fixture_execute(arg_hash); run_hook(:post_test_fixture_execute, arg_hash[:executable] ); end
- def pre_test(test); run_hook(:pre_test, test ); end
- def post_test(test); run_hook(:post_test, test ); end
- def pre_release; run_hook(:pre_release ); end
- def post_release; run_hook(:post_release ); end
- def pre_build; run_hook(:pre_build ); end
- def post_build; run_hook(:post_build ); end
- def post_error; run_hook(:post_error ); end
-
- private
-
- ##
- # Run a hook if its available.
- #
- # :args:
- # - hook: Name of the hook to run
- # - name: Name of file (default: "")
- #
- # :return:
- # shell_result.
- #
- def run_hook_step(hook, name="")
- if (hook[:executable])
- # Handle argument replacemant ({$1}), and get commandline
- cmd = @ceedling[:tool_executor].build_command_line( hook, [], name )
- shell_result = @ceedling[:tool_executor].exec(cmd[:line], cmd[:options])
- end
- end
-
- ##
- # Run a hook if its available.
- #
- # If __which_hook__ is an array, run each of them sequentially.
- #
- # :args:
- # - which_hook: Name of the hook to run
- # - name: Name of file
- #
- def run_hook(which_hook, name="")
- if (@config[which_hook])
- @ceedling[:streaminator].stdout_puts("Running Hook #{which_hook}...", Verbosity::NORMAL)
- if (@config[which_hook].is_a? Array)
- @config[which_hook].each do |hook|
- run_hook_step(hook, name)
- end
- elsif (@config[which_hook].is_a? Hash)
- run_hook_step( @config[which_hook], name )
- else
- @ceedling[:streaminator].stdout_puts("Hook #{which_hook} was poorly formed", Verbosity::COMPLAINT)
- end
- end
- end
-end
-
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/README.md b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/README.md
deleted file mode 100755
index 8042775e..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/README.md
+++ /dev/null
@@ -1,250 +0,0 @@
-# A Fake Function Framework Plug-in for Ceedling
-
-This is a plug-in for [Ceedling](https://github.com/ThrowTheSwitch/Ceedling) to use the [Fake Function Framework](https://github.com/meekrosoft/fff) for mocking instead of CMock.
-
-Using fff provides less strict mocking than CMock, and allows for more loosely-coupled tests.
-And, when tests fail -- since you get the actual line number of the failure -- it's a lot easier to figure out what went wrong.
-
-## Installing the plug-in
-
-To use the plugin you need to 1) get the contents of this repo and 2) configure your project to use it.
-
-### Get the source
-
-The easiest way to get the source is to just clone this repo into the Ceedling plugin folder for your existing Ceedling project.
-(Don't have a Ceedling project already? [Here are instructions to create one.](http://www.electronvector.com/blog/try-embedded-test-driven-development-right-now-with-ceedling))
-From within `<your-project>/vendor/ceedling/plugins`, run:
-
-`git clone https://github.com/ElectronVector/fake_function_framework.git`
-
-This will create a new folder named `fake_function_framework` in the plugins folder.
-
-### Enable the plug-in.
-
-The plug-in is enabled from within your project.yml file.
-
-In the `:plugins` configuration, add `fake_function_framework` to the list of enabled plugins:
-
-```yaml
-:plugins:
- :load_paths:
- - vendor/ceedling/plugins
- :enabled:
- - stdout_pretty_tests_report
- - module_generator
- - fake_function_framework
-```
-*Note that you could put the plugin source in some other loaction.
-In that case you'd need to add a new path the `:load_paths`.*
-
-## How to use it
-
-You use fff with Ceedling the same way you used to use CMock.
-Modules can still be generated with the default module generator: `rake module:create[my_module]`.
-If you want to "mock" `some_module.h` in your tests, just `#include "mock_some_module.h"`.
-This creates a fake function for each of the functions defined in `some_module.h`.
-
-The name of each fake is the original function name with an appended `_fake`.
-For example, if we're generating fakes for a stack module with `push` and `pop` functions, we would have the fakes `push_fake` and `pop_fake`.
-These fakes are linked into our test executable so that any time our unit under test calls `push` or `pop` our fakes are called instead.
-
-Each of these fakes is actually a structure containing information about how the function was called, and what it might return.
-We can use Unity to inspect these fakes in our tests, and verify the interactions of our units.
-There is also a global structure named `fff` which we can use to check the sequence of calls.
-
-The fakes can also be configured to return particular values, so you can exercise the unit under test however you want.
-
-The examples below explain how to use fff to test a variety of module interactions.
-Each example uses fakes for a "display" module, created from a display.h file with `#include "mock_display.h"`. The `display.h` file must exist and must contain the prototypes for the functions to be faked.
-
-### Test that a function was called once
-
-```c
-void
-test_whenTheDeviceIsReset_thenTheStatusLedIsTurnedOff()
-{
- // When
- event_deviceReset();
-
- // Then
- TEST_ASSERT_EQUAL(1, display_turnOffStatusLed_fake.call_count);
-}
-```
-
-### Test that a function was NOT called
-
-```c
-void
-test_whenThePowerReadingIsLessThan5_thenTheStatusLedIsNotTurnedOn(void)
-{
- // When
- event_powerReadingUpdate(4);
-
- // Then
- TEST_ASSERT_EQUAL(0, display_turnOnStatusLed_fake.call_count);
-}
-```
-
-## Test that a single function was called with the correct argument
-
-```c
-void
-test_whenTheVolumeKnobIsMaxed_thenVolumeDisplayIsSetTo11(void)
-{
- // When
- event_volumeKnobMaxed();
-
- // Then
- TEST_ASSERT_EQUAL(1, display_setVolume_fake.call_count);
- TEST_ASSERT_EQUAL(11, display_setVolume_fake.arg0_val);
-}
-```
-
-## Test that calls are made in a particular sequence
-
-```c
-void
-test_whenTheModeSelectButtonIsPressed_thenTheDisplayModeIsCycled(void)
-{
- // When
- event_modeSelectButtonPressed();
- event_modeSelectButtonPressed();
- event_modeSelectButtonPressed();
-
- // Then
- TEST_ASSERT_EQUAL_PTR((void*)display_setModeToMinimum, fff.call_history[0]);
- TEST_ASSERT_EQUAL_PTR((void*)display_setModeToMaximum, fff.call_history[1]);
- TEST_ASSERT_EQUAL_PTR((void*)display_setModeToAverage, fff.call_history[2]);
-}
-```
-
-## Fake a return value from a function
-
-```c
-void
-test_givenTheDisplayHasAnError_whenTheDeviceIsPoweredOn_thenTheDisplayIsPoweredDown(void)
-{
- // Given
- display_isError_fake.return_val = true;
-
- // When
- event_devicePoweredOn();
-
- // Then
- TEST_ASSERT_EQUAL(1, display_powerDown_fake.call_count);
-}
-```
-
-## Fake a function with a value returned by reference
-
-```c
-void
-test_givenTheUserHasTypedSleep_whenItIsTimeToCheckTheKeyboard_theDisplayIsPoweredDown(void)
-{
- // Given
- char mockedEntry[] = "sleep";
- void return_mock_value(char * entry, int length)
- {
- if (length > strlen(mockedEntry))
- {
- strncpy(entry, mockedEntry, length);
- }
- }
- display_getKeyboardEntry_fake.custom_fake = return_mock_value;
-
- // When
- event_keyboardCheckTimerExpired();
-
- // Then
- TEST_ASSERT_EQUAL(1, display_powerDown_fake.call_count);
-}
-```
-
-## Fake a function with a function pointer parameter
-
-```
-void
-test_givenNewDataIsAvailable_whenTheDisplayHasUpdated_thenTheEventIsComplete(void)
-{
- // A mock function for capturing the callback handler function pointer.
- void(*registeredCallback)(void) = 0;
- void mock_display_updateData(int data, void(*callback)(void))
- {
- //Save the callback function.
- registeredCallback = callback;
- }
- display_updateData_fake.custom_fake = mock_display_updateData;
-
- // Given
- event_newDataAvailable(10);
-
- // When
- if (registeredCallback != 0)
- {
- registeredCallback();
- }
-
- // Then
- TEST_ASSERT_EQUAL(true, eventProcessor_isLastEventComplete());
-}
-```
-
-## Helper macros
-
-For convenience, there are also some helper macros that create new Unity-style asserts:
-
-- `TEST_ASSERT_CALLED(function)`: Asserts that a function was called once.
-- `TEST_ASSERT_NOT_CALLED(function)`: Asserts that a function was never called.
-- `TEST_ASSERT_CALLED_TIMES(times, function)`: Asserts that a function was called a particular number of times.
-- `TEST_ASSERT_CALLED_IN_ORDER(order, function)`: Asserts that a function was called in a particular order.
-
-Here's how you might use one of these instead of simply checking the call_count value:
-
-```c
-void
-test_whenTheDeviceIsReset_thenTheStatusLedIsTurnedOff()
-{
- // When
- event_deviceReset();
-
- // Then
- // This how to directly use fff...
- TEST_ASSERT_EQUAL(1, display_turnOffStatusLed_fake.call_count);
- // ...and this is how to use the helper macro.
- TEST_ASSERT_CALLED(display_turnOffStatusLed);
-}
-```
-
-## Test setup
-
-All of the fake functions, and any fff global state are all reset automatically between each test.
-
-## CMock configuration
-
-Use still use some of the CMock configuration options for setting things like the mock prefix, and for including additional header files in the mock files.
-
-```yaml
-:cmock:
- :mock_prefix: mock_
- :includes:
- -
- :includes_h_pre_orig_header:
- -
- :includes_h_post_orig_header:
- -
- :includes_c_pre_header:
- -
- :includes_c_post_header:
-```
-
-## Running the tests
-
-There are unit and integration tests for the plug-in itself.
-These are run with the default `rake` task.
-The integration test runs the tests for the example project in examples/fff_example.
-For the integration tests to succeed, this repository must be placed in a Ceedling tree in the plugins folder.
-
-## More examples
-
-There is an example project in examples/fff_example.
-It shows how to use the plug-in with some full-size examples.
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/Rakefile b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/Rakefile
deleted file mode 100755
index bc559411..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/Rakefile
+++ /dev/null
@@ -1,19 +0,0 @@
-require 'rake'
-require 'rspec/core/rake_task'
-
-desc "Run all rspecs"
-RSpec::Core::RakeTask.new(:spec) do |t|
- t.pattern = Dir.glob('spec/**/*_spec.rb')
- t.rspec_opts = '--format documentation'
- # t.rspec_opts << ' more options'
-end
-
-desc "Run integration test on example"
-task :integration_test do
- chdir("./examples/fff_example") do
- sh "rake clobber"
- sh "rake test:all"
- end
-end
-
-task :default => [:spec, :integration_test] \ No newline at end of file
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/project.yml b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/project.yml
deleted file mode 100755
index 6bda2229..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/project.yml
+++ /dev/null
@@ -1,71 +0,0 @@
----
-
-# Notes:
-# Sample project C code is not presently written to produce a release artifact.
-# As such, release build options are disabled.
-# This sample, therefore, only demonstrates running a collection of unit tests.
-
-:project:
- :use_exceptions: FALSE
- :use_test_preprocessor: TRUE
- :use_auxiliary_dependencies: TRUE
- :build_root: build
-# :release_build: TRUE
- :test_file_prefix: test_
-
-#:release_build:
-# :output: MyApp.out
-# :use_assembly: FALSE
-
-:environment:
-
-:extension:
- :executable: .out
-
-:paths:
- :test:
- - +:test/**
- :source:
- - src/**
- :support:
-
-:defines:
- # in order to add common defines:
- # 1) remove the trailing [] from the :common: section
- # 2) add entries to the :common: section (e.g. :test: has TEST defined)
- :commmon: &common_defines []
- :test:
- - *common_defines
- - TEST
- :test_preprocess:
- - *common_defines
- - TEST
-
-:cmock:
- :mock_prefix: mock_
- :when_no_prototypes: :warn
- :enforce_strict_ordering: TRUE
- :plugins:
- - :ignore
- - :callback
- :treat_as:
- uint8: HEX8
- uint16: HEX16
- uint32: UINT32
- int8: INT8
- bool: UINT8
-
-#:tools:
-# Ceedling defaults to using gcc for compiling, linking, etc.
-# As [:tools] is blank, gcc will be used (so long as it's in your system path)
-# See documentation to configure a given toolchain for use
-
-:plugins:
- :load_paths:
- # This change from the default is for running Ceedling out of another folder.
- - ../../../../plugins
- :enabled:
- - stdout_pretty_tests_report
- - module_generator
- - fake_function_framework
-...
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/rakefile.rb b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/rakefile.rb
deleted file mode 100755
index e484d5fb..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/rakefile.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# This change from the default is for running Ceedling out of another folder.
-PROJECT_CEEDLING_ROOT = "../../../.."
-load "#{PROJECT_CEEDLING_ROOT}/lib/ceedling.rb"
-
-Ceedling.load_project
-
-task :default => %w[ test:all release ]
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/bar.c b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/bar.c
deleted file mode 100755
index 6a403234..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/bar.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "bar.h"
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/bar.h b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/bar.h
deleted file mode 100755
index febc5865..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/bar.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef bar_H
-#define bar_H
-
-#include "custom_types.h"
-
-void bar_turn_on(void);
-void bar_print_message(const char * message);
-void bar_print_message_formatted(const char * format, ...);
-void bar_numbers(int one, int two, char three);
-void bar_const_test(const char * a, char * const b, const int c);
-custom_t bar_needs_custom_type(void);
-const char * bar_return_const_ptr(int one);
-
-#endif // bar_H
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/custom_types.h b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/custom_types.h
deleted file mode 100755
index b426b32c..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/custom_types.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef custom_types_H
-#define custom_types_H
-
-typedef int custom_t;
-
-#endif
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/display.c b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/display.c
deleted file mode 100755
index 2f03449b..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/display.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-#include "display.h"
-
-void display_turnOffStatusLed(void)
-{
- printf("Display: Status LED off");
-} \ No newline at end of file
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/display.h b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/display.h
deleted file mode 100755
index def29960..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/display.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdbool.h>
-
-void display_turnOffStatusLed(void);
-void display_turnOnStatusLed(void);
-void display_setVolume(int level);
-void display_setModeToMinimum(void);
-void display_setModeToMaximum(void);
-void display_setModeToAverage(void);
-bool display_isError(void);
-void display_powerDown(void);
-void display_updateData(int data, void(*updateCompleteCallback)(void));
-
-/*
- The entry is returned (up to `length` bytes) in the provided `entry` buffer.
-*/
-void display_getKeyboardEntry(char * entry, int length);
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/event_processor.c b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/event_processor.c
deleted file mode 100755
index 916a9236..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/event_processor.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- This module implements some business logic to test.
-
- Signal events by calling the functions on the module.
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include "event_processor.h"
-#include "display.h"
-
-void event_deviceReset(void)
-{
- //printf ("Device reset\n");
- display_turnOffStatusLed();
-}
-
-void event_volumeKnobMaxed(void)
-{
- display_setVolume(11);
-}
-
-void event_powerReadingUpdate(int powerReading)
-{
- if (powerReading >= 5)
- {
- display_turnOnStatusLed();
- }
-}
-
-void event_modeSelectButtonPressed(void)
-{
- static int mode = 0;
-
- if (mode == 0)
- {
- display_setModeToMinimum();
- mode++;
- }
- else if (mode == 1)
- {
- display_setModeToMaximum();
- mode++;
- }
- else if (mode == 2)
- {
- display_setModeToAverage();
- mode++;
- }
- else
- {
- mode = 0;
- }
-}
-
-void event_devicePoweredOn(void)
-{
- if (display_isError())
- {
- display_powerDown();
- }
-}
-
-void event_keyboardCheckTimerExpired(void)
-{
- char userEntry[100];
-
- display_getKeyboardEntry(userEntry, 100);
-
- if (strcmp(userEntry, "sleep") == 0)
- {
- display_powerDown();
- }
-}
-
-static bool event_lastComplete = false;
-
-/* Function called when the display update is complete. */
-static void displayUpdateComplete(void)
-{
- event_lastComplete = true;
-}
-
-void event_newDataAvailable(int data)
-{
- event_lastComplete = false;
- display_updateData(data, displayUpdateComplete);
-}
-
-bool eventProcessor_isLastEventComplete(void)
-{
- return event_lastComplete;
-}
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/event_processor.h b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/event_processor.h
deleted file mode 100755
index a79e68c5..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/event_processor.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdbool.h>
-
-void event_deviceReset(void);
-void event_volumeKnobMaxed(void);
-void event_powerReadingUpdate(int powerReading);
-void event_modeSelectButtonPressed(void);
-void event_devicePoweredOn(void);
-void event_keyboardCheckTimerExpired(void);
-void event_newDataAvailable(int data);
-
-bool eventProcessor_isLastEventComplete(void);
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/foo.c b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/foo.c
deleted file mode 100755
index c05b1154..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/foo.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "foo.h"
-#include "bar.h"
-#include "subfolder/zzz.h"
-
-void foo_turn_on(void) {
- bar_turn_on();
- zzz_sleep(1, "sleepy");
-}
-
-void foo_print_message(const char * message) {
- bar_print_message(message);
-}
-
-void foo_print_special_message(void) {
- bar_print_message_formatted("The numbers are %d, %d and %d", 1, 2, 3);
-}
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/foo.h b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/foo.h
deleted file mode 100755
index 3fea6994..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/foo.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef foo_H
-#define foo_H
-
-void foo_turn_on(void);
-void foo_print_message(const char * message);
-void foo_print_special_message(void);
-
-#endif // foo_H
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/subfolder/zzz.c b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/subfolder/zzz.c
deleted file mode 100755
index 85f370e1..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/subfolder/zzz.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "zzz.h"
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/subfolder/zzz.h b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/subfolder/zzz.h
deleted file mode 100755
index 32c52940..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/src/subfolder/zzz.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef zzz_H
-#define zzz_H
-
-int zzz_sleep(int time, char * name);
-
-#endif // zzz_H
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/test/test_event_processor.c b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/test/test_event_processor.c
deleted file mode 100755
index 9f999443..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/test/test_event_processor.c
+++ /dev/null
@@ -1,155 +0,0 @@
-#include "unity.h"
-#include "event_processor.h"
-#include "mock_display.h"
-#include <string.h>
-
-void setUp (void)
-{
-}
-
-void tearDown (void)
-{
-}
-/*
- Test that a single function was called.
-*/
-void
-test_whenTheDeviceIsReset_thenTheStatusLedIsTurnedOff()
-{
- // When
- event_deviceReset();
-
- // Then
- TEST_ASSERT_EQUAL(1, display_turnOffStatusLed_fake.call_count);
- // or use the helper macro...
- TEST_ASSERT_CALLED(display_turnOffStatusLed);
-}
-
-/*
- Test that a single function is NOT called.
-*/
-void
-test_whenThePowerReadingIsLessThan5_thenTheStatusLedIsNotTurnedOn(void)
-{
- // When
- event_powerReadingUpdate(4);
-
- // Then
- TEST_ASSERT_EQUAL(0, display_turnOnStatusLed_fake.call_count);
- // or use the helper macro...
- TEST_ASSERT_NOT_CALLED(display_turnOffStatusLed);
-}
-
-/*
- Test that a single function was called with the correct arugment.
-*/
-void
-test_whenTheVolumeKnobIsMaxed_thenVolumeDisplayIsSetTo11(void)
-{
- // When
- event_volumeKnobMaxed();
-
- // Then
- TEST_ASSERT_EQUAL(1, display_setVolume_fake.call_count);
- // or use the helper macro...
- TEST_ASSERT_CALLED(display_setVolume);
- TEST_ASSERT_EQUAL(11, display_setVolume_fake.arg0_val);
-}
-
-/*
- Test a sequence of calls.
-*/
-
-void
-test_whenTheModeSelectButtonIsPressed_thenTheDisplayModeIsCycled(void)
-{
- // When
- event_modeSelectButtonPressed();
- event_modeSelectButtonPressed();
- event_modeSelectButtonPressed();
-
- // Then
- TEST_ASSERT_EQUAL_PTR((void *)display_setModeToMinimum, fff.call_history[0]);
- TEST_ASSERT_EQUAL_PTR((void *)display_setModeToMaximum, fff.call_history[1]);
- TEST_ASSERT_EQUAL_PTR((void *)display_setModeToAverage, fff.call_history[2]);
- // or use the helper macros...
- TEST_ASSERT_CALLED_IN_ORDER(0, display_setModeToMinimum);
- TEST_ASSERT_CALLED_IN_ORDER(1, display_setModeToMaximum);
- TEST_ASSERT_CALLED_IN_ORDER(2, display_setModeToAverage);
-}
-
-/*
- Mock a return value from a function.
-*/
-void
-test_givenTheDisplayHasAnError_whenTheDeviceIsPoweredOn_thenTheDisplayIsPoweredDown(void)
-{
- // Given
- display_isError_fake.return_val = true;
-
- // When
- event_devicePoweredOn();
-
- // Then
- TEST_ASSERT_EQUAL(1, display_powerDown_fake.call_count);
- // or use the helper macro...
- TEST_ASSERT_CALLED(display_powerDown);
-}
-
-/*
- Mock a sequence of calls with return values.
-*/
-
-/*
- Mocking a function with a value returned by reference.
-*/
-void
-test_givenTheUserHasTypedSleep_whenItIsTimeToCheckTheKeyboard_theDisplayIsPoweredDown(void)
-{
- // Given
- char mockedEntry[] = "sleep";
- void return_mock_value(char * entry, int length)
- {
- if (length > strlen(mockedEntry))
- {
- strncpy(entry, mockedEntry, length);
- }
- }
- display_getKeyboardEntry_fake.custom_fake = return_mock_value;
-
- // When
- event_keyboardCheckTimerExpired();
-
- // Then
- TEST_ASSERT_EQUAL(1, display_powerDown_fake.call_count);
- // or use the helper macro...
- TEST_ASSERT_CALLED(display_powerDown);
-}
-
-/*
- Mock a function with a function pointer parameter.
-*/
-void
-test_givenNewDataIsAvailable_whenTheDisplayHasUpdated_thenTheEventIsComplete(void)
-{
- // A mock function for capturing the callback handler function pointer.
- void(*registeredCallback)(void) = 0;
- void mock_display_updateData(int data, void(*callback)(void))
- {
- //Save the callback function.
- registeredCallback = callback;
- }
- display_updateData_fake.custom_fake = mock_display_updateData;
-
- // Given
- event_newDataAvailable(10);
-
- // When
- if (registeredCallback != 0)
- {
- registeredCallback();
- }
-
- // Then
- TEST_ASSERT_EQUAL(true, eventProcessor_isLastEventComplete());
-}
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/test/test_foo.c b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/test/test_foo.c
deleted file mode 100755
index 12dd61a1..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/examples/fff_example/test/test_foo.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "unity.h"
-#include "foo.h"
-#include "mock_bar.h"
-#include "mock_zzz.h"
-
-void setUp(void)
-{
-}
-
-void tearDown(void)
-{
-}
-
-void test_foo(void)
-{
- //When
- foo_turn_on();
-
- //Then
- TEST_ASSERT_EQUAL(1, bar_turn_on_fake.call_count);
- TEST_ASSERT_EQUAL(1, zzz_sleep_fake.call_count);
- TEST_ASSERT_EQUAL_STRING("sleepy", zzz_sleep_fake.arg1_val);
-}
-
-void test_foo_again(void)
-{
- //When
- foo_turn_on();
-
- //Then
- TEST_ASSERT_EQUAL(1, bar_turn_on_fake.call_count);
-}
-
-void test_foo_mock_with_const(void)
-{
- foo_print_message("123");
-
- TEST_ASSERT_EQUAL(1, bar_print_message_fake.call_count);
- TEST_ASSERT_EQUAL_STRING("123", bar_print_message_fake.arg0_val);
-}
-
-void test_foo_mock_with_variable_args(void)
-{
- foo_print_special_message();
- TEST_ASSERT_EQUAL(1, bar_print_message_formatted_fake.call_count);
- TEST_ASSERT_EQUAL_STRING("The numbers are %d, %d and %d", bar_print_message_formatted_fake.arg0_val);
-}
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/lib/fake_function_framework.rb b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/lib/fake_function_framework.rb
deleted file mode 100755
index 51a90b3a..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/lib/fake_function_framework.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require 'ceedling/plugin'
-require 'fff_mock_generator'
-
-class FakeFunctionFramework < Plugin
-
- # Set up Ceedling to use this plugin.
- def setup
- # Get the location of this plugin.
- @plugin_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
- puts "Using fake function framework (fff)..."
-
- # Switch out the cmock_builder with our own.
- @ceedling[:cmock_builder].cmock = FffMockGeneratorForCMock.new(@ceedling[:setupinator].config_hash[:cmock])
-
- # Add the path to fff.h to the include paths.
- COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR << "#{@plugin_root}/vendor/fff"
- COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR << "#{@plugin_root}/src"
- end
-
- def post_runner_generate(arg_hash)
- # After the test runner file has been created, append the FFF globals
- # definition to the end of the test runner. These globals will be shared by
- # all mocks linked into the test.
- File.open(arg_hash[:runner_file], 'a') do |f|
- f.puts
- f.puts "//=======Defintions of FFF variables====="
- f.puts %{#include "fff.h"}
- f.puts "DEFINE_FFF_GLOBALS;"
- end
- end
-
-end # class FakeFunctionFramework
-
-class FffMockGeneratorForCMock
-
- def initialize(options=nil)
- @cm_config = CMockConfig.new(options)
- @cm_parser = CMockHeaderParser.new(@cm_config)
- @silent = (@cm_config.verbosity < 2)
-
- # These are the additional files to include in the mock files.
- @includes_h_pre_orig_header = (@cm_config.includes || @cm_config.includes_h_pre_orig_header || []).map{|h| h =~ /</ ? h : "\"#{h}\""}
- @includes_h_post_orig_header = (@cm_config.includes_h_post_orig_header || []).map{|h| h =~ /</ ? h : "\"#{h}\""}
- @includes_c_pre_header = (@cm_config.includes_c_pre_header || []).map{|h| h =~ /</ ? h : "\"#{h}\""}
- @includes_c_post_header = (@cm_config.includes_c_post_header || []).map{|h| h =~ /</ ? h : "\"#{h}\""}
- end
-
- def setup_mocks(files)
- [files].flatten.each do |src|
- generate_mock (src)
- end
- end
-
- def generate_mock (header_file_to_mock)
- module_name = File.basename(header_file_to_mock, '.h')
- puts "Creating mock for #{module_name}..." unless @silent
- mock_name = @cm_config.mock_prefix + module_name + @cm_config.mock_suffix
- mock_path = @cm_config.mock_path
- if @cm_config.subdir
- # If a subdirectory has been configured, append it to the mock path.
- mock_path = "#{mock_path}/#{@cm_config.subdir}"
- end
- full_path_for_mock = "#{mock_path}/#{mock_name}"
-
- # Parse the header file so we know what to mock.
- parsed_header = @cm_parser.parse(module_name, File.read(header_file_to_mock))
-
- # Create the directory if it doesn't exist.
- mkdir_p full_path_for_mock.pathmap("%d")
-
- # Generate the mock header file.
- puts "Creating mock: #{full_path_for_mock}.h"
-
- # Create the mock header.
- File.open("#{full_path_for_mock}.h", 'w') do |f|
- f.write(FffMockGenerator.create_mock_header(module_name, mock_name, parsed_header,
- @includes_h_pre_orig_header, @includes_h_post_orig_header))
- end
-
- # Create the mock source file.
- File.open("#{full_path_for_mock}.c", 'w') do |f|
- f.write(FffMockGenerator.create_mock_source(mock_name, parsed_header,
- @includes_c_pre_orig_header, @includes_c_post_orig_header))
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/lib/fff_mock_generator.rb b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/lib/fff_mock_generator.rb
deleted file mode 100755
index 9dc03a65..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/lib/fff_mock_generator.rb
+++ /dev/null
@@ -1,163 +0,0 @@
-# Creates mock files from parsed header files that can be linked into applications.
-# The mocks created are compatible with CMock for use with Ceedling.
-
-class FffMockGenerator
-
- def self.create_mock_header(module_name, mock_name, parsed_header, pre_includes=nil,
- post_includes=nil)
- output = StringIO.new
- write_opening_include_guard(mock_name, output)
- output.puts
- write_extra_includes(pre_includes, output)
- write_header_includes(module_name, output)
- write_extra_includes(post_includes, output)
- output.puts
- write_typedefs(parsed_header, output)
- output.puts
- write_function_declarations(parsed_header, output)
- output.puts
- write_control_function_prototypes(mock_name, output)
- output.puts
- write_closing_include_guard(mock_name, output)
- output.string
- end
-
- def self.create_mock_source (mock_name, parsed_header, pre_includes=nil,
- post_includes=nil)
- output = StringIO.new
- write_extra_includes(pre_includes, output)
- write_source_includes(mock_name, output)
- write_extra_includes(post_includes, output)
- output.puts
- write_function_definitions(parsed_header, output)
- output.puts
- write_control_function_definitions(mock_name, parsed_header, output)
- output.string
- end
-
- private
-
-# Header file generation functions.
-
- def self.write_opening_include_guard(mock_name, output)
- output.puts "#ifndef #{mock_name}_H"
- output.puts "#define #{mock_name}_H"
- end
-
- def self.write_header_includes(module_name, output)
- output.puts %{#include "fff.h"}
- output.puts %{#include "fff_unity_helper.h"}
- output.puts %{#include "#{module_name}.h"}
- end
-
- def self.write_typedefs(parsed_header, output)
- return unless parsed_header.key?(:typedefs)
- parsed_header[:typedefs].each do |typedef|
- output.puts typedef
- end
- end
-
- def self.write_function_declarations(parsed_header, output)
- write_function_macros("DECLARE", parsed_header, output)
- end
-
-
- def self.write_control_function_prototypes(mock_name, output)
- output.puts "void #{mock_name}_Init(void);"
- output.puts "void #{mock_name}_Verify(void);"
- output.puts "void #{mock_name}_Destroy(void);"
- end
-
- def self.write_closing_include_guard(mock_name, output)
- output.puts "#endif // #{mock_name}_H"
- end
-
-# Source file generation functions.
-
- def self.write_source_includes (mock_name, output)
- output.puts "#include <string.h>"
- output.puts %{#include "fff.h"}
- output.puts %{#include "#{mock_name}.h"}
- end
-
- def self.write_function_definitions(parsed_header, output)
- write_function_macros("DEFINE", parsed_header, output)
- end
-
- def self.write_control_function_definitions(mock_name, parsed_header, output)
- output.puts "void #{mock_name}_Init(void)"
- output.puts "{"
- # In the init function, reset the FFF globals. These are used for things
- # like the call history.
- output.puts " FFF_RESET_HISTORY();"
-
- # Also, reset all of the fakes.
- if parsed_header[:functions]
- parsed_header[:functions].each do |function|
- output.puts " RESET_FAKE(#{function[:name]})"
- end
- end
- output.puts "}"
- output.puts "void #{mock_name}_Verify(void)"
- output.puts "{"
- output.puts "}"
- output.puts "void #{mock_name}_Destroy(void)"
- output.puts "{"
- output.puts "}"
- end
-
-# Shared functions.
-
- def self.write_extra_includes(includes, output)
- if includes
- includes.each {|inc| output.puts "#include #{inc}\n"}
- end
- end
-
- def self.write_function_macros(macro_type, parsed_header, output)
- return unless parsed_header.key?(:functions)
- parsed_header[:functions].each do |function|
- name = function[:name]
- return_type = function[:return][:type]
- if function.has_key? :modifier
- # Prepend any modifier. If there isn't one, trim any leading whitespace.
- return_type = "#{function[:modifier]} #{return_type}".lstrip
- end
- arg_count = function[:args].size
-
- # Check for variable arguments.
- var_arg_suffix = ""
- if function[:var_arg]
- # If there are are variable arguments, then we need to add this argument
- # to the count, update the suffix that will get added to the macro.
- arg_count += 1
- var_arg_suffix = "_VARARG"
- end
-
- # Generate the correct macro.
- if return_type == 'void'
- output.print "#{macro_type}_FAKE_VOID_FUNC#{arg_count}#{var_arg_suffix}(#{name}"
- else
- output.print "#{macro_type}_FAKE_VALUE_FUNC#{arg_count}#{var_arg_suffix}(#{return_type}, #{name}"
- end
-
- # Append each argument type.
- function[:args].each do |arg|
- output.print ", "
- if arg[:const?]
- output.print "const "
- end
- output.print "#{arg[:type]}"
- end
-
- # If this argument list ends with a variable argument, add it here at the end.
- if function[:var_arg]
- output.print ", ..."
- end
-
- # Close the declaration.
- output.puts ");"
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/fff_mock_header_generator_spec.rb b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/fff_mock_header_generator_spec.rb
deleted file mode 100755
index e6ac11dd..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/fff_mock_header_generator_spec.rb
+++ /dev/null
@@ -1,304 +0,0 @@
-require 'stringio'
-require 'fff_mock_generator.rb'
-require 'header_generator.rb'
-
-# Test the contents of the .h file created for the mock.
-describe "FffMockGenerator.create_mock_header" do
-
- context "when there is nothing to mock," do
- let(:mock_header) {
- parsed_header = {}
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated header file starts with an opening include guard" do
- expect(mock_header).to start_with(
- "#ifndef mock_display_H\n" +
- "#define mock_display_H")
- end
- it "then the generated file ends with a closing include guard" do
- expect(mock_header).to end_with(
- "#endif // mock_display_H\n")
- end
- it "then the generated file includes the fff header" do
- expect(mock_header).to include(
- %{#include "fff.h"\n})
- end
- it "then the generated file has a prototype for the init function" do
- expect(mock_header).to include(
- "void mock_display_Init(void);")
- end
- it "then the generated file has a prototype for the verify function" do
- expect(mock_header).to include(
- "void mock_display_Verify(void);")
- end
- it "then the generated file has a prototype for the destroy function" do
- expect(mock_header).to include(
- "void mock_display_Destroy(void);")
- end
- end
-
- context "when there is a function with no args and a void return," do
- let(:mock_header) {
- parsed_header = create_cmock_style_parsed_header(
- [{:name => 'display_turnOffStatusLed', :return_type => 'void'}])
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated header file starts with an opening include guard" do
- expect(mock_header).to start_with(
- "#ifndef mock_display_H\n" +
- "#define mock_display_H")
- end
- it "then the generated header file contains a fake function declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VOID_FUNC0(display_turnOffStatusLed);"
- )
- end
- it "then the generated file ends with a closing include guard" do
- expect(mock_header).to end_with(
- "#endif // mock_display_H\n")
- end
- end
-
- context "when there is a function with no args and a bool return," do
- let(:mock_header) {
- parsed_header = create_cmock_style_parsed_header(
- [{:name => 'display_isError', :return_type => 'bool'}])
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the fake function declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VALUE_FUNC0(bool, display_isError);"
- )
- end
- end
-
- context "when there is a function with no args and an int return," do
- let(:mock_header) {
- parsed_header = create_cmock_style_parsed_header(
- [{:name => 'display_isError', :return_type => 'int'}])
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the fake function declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VALUE_FUNC0(int, display_isError);"
- )
- end
- end
-
- context "when there is a function with args and a void return," do
- let(:mock_header) {
- parsed_header = create_cmock_style_parsed_header(
- [{:name => 'display_setVolume', :return_type => 'void', :args => ['int']}])
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the fake function declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VOID_FUNC1(display_setVolume, int);"
- )
- end
- end
-
- context "when there is a function with args and a value return," do
- let(:mock_header) {
- parsed_header = create_cmock_style_parsed_header(
- [{:name => 'a_function', :return_type => 'int', :args => ['char *']}])
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the fake function declaration" do
- expect(mock_header).to include(
- "FAKE_VALUE_FUNC1(int, a_function, char *);"
- )
- end
- end
-
- context "when there is a function with many args and a void return," do
- let(:mock_header) {
- parsed_header = create_cmock_style_parsed_header(
- [{:name => 'a_function', :return_type => 'void',
- :args => ['int', 'char *', 'int', 'int', 'bool', 'applesauce']}])
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the fake function declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VOID_FUNC6(a_function, int, char *, int, int, bool, applesauce);"
- )
- end
- end
-
- context "when there are multiple functions," do
- let(:mock_header) {
- parsed_header = create_cmock_style_parsed_header(
- [ {:name => 'a_function', :return_type => 'int', :args => ['char *']},
- {:name => 'another_function', :return_type => 'void'},
- {:name => 'three', :return_type => 'bool', :args => ['float', 'int']}
- ])
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the first fake function declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VALUE_FUNC1(int, a_function, char *);"
- )
- end
- it "then the generated file contains the second fake function declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VOID_FUNC0(another_function);"
- )
- end
- it "then the generated file contains the third fake function declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VALUE_FUNC2(bool, three, float, int);"
- )
- end
- end
-
- context "when there is a typedef," do
- let(:mock_header) {
- parsed_header = create_cmock_style_parsed_header(
- nil, ["typedef void (*displayCompleteCallback) (void);"])
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the typedef" do
- expect(mock_header).to include(
- "typedef void (*displayCompleteCallback) (void);"
- )
- end
- end
-
- context "when there is a void function with variable arguments" do
- let(:mock_header){
- parsed_header = {}
- parsed_header[:functions] = [{
- :name => "function_with_var_args",
- :return => {:type => "void"},
- :var_arg => "...",
- :args => [{:type => 'char *'}]
- }]
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the vararg declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VOID_FUNC2_VARARG(function_with_var_args, char *, ...)"
- )
- end
- end
-
- context "when there is a function with a return value and variable arguments" do
- let(:mock_header){
- parsed_header = {}
- parsed_header[:functions] = [{
- :name => "function_with_var_args",
- :return => {:type => "int"},
- :var_arg => "...",
- :args => [{:type => 'char *'}]
- }]
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the vararg declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VALUE_FUNC2_VARARG(int, function_with_var_args, char *, ...)"
- )
- end
- end
-
- context "when there is a void function with variable arguments and " +
- "additional arguments" do
- let(:mock_header){
- parsed_header = {}
- parsed_header[:functions] = [{
- :name => "function_with_var_args",
- :return => {:type => "void"},
- :var_arg => "...",
- :args => [{:type => 'char *'}, {:type => 'int'}]
- }]
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the vararg declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VOID_FUNC3_VARARG(function_with_var_args, char *, int, ...)"
- )
- end
- end
-
- context "when there is a function with a pointer to a const value" do
- let(:mock_header){
- parsed_header = {}
- parsed_header[:functions] = [{
- :name => "const_test_function",
- :return => {:type => "void"},
- :args => [{:type => "char *", :name => "a", :ptr? => false, :const? => true},
- {:type => "char *", :name => "b", :ptr? => false, :const? => false}]
- }]
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the correct const argument in the declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VOID_FUNC2(const_test_function, const char *, char *)"
- )
- end
- end
-
- context "when there is a function that returns a const pointer" do
- let(:mock_header){
- parsed_header = {}
- parsed_header[:functions] = [{
- :name => "return_const_pointer_test_function",
- :modifier => "const",
- :return => {:type => "char *" },
- :args => [{:type => "int", :name => "a"}]
- }]
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the correct const return value in the declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VALUE_FUNC1(const char *, return_const_pointer_test_function, int)"
- )
- end
- end
-
- context "when there is a function that returns a const int" do
- let(:mock_header){
- parsed_header = {}
- parsed_header[:functions] = [{
- :name => "return_const_int_test_function",
- :modifier => "const",
- :return => {:type => "int" },
- :args => []
- }]
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
- }
- it "then the generated file contains the correct const return value in the declaration" do
- expect(mock_header).to include(
- "DECLARE_FAKE_VALUE_FUNC0(const int, return_const_int_test_function)"
- )
- end
- end
-
- context "when there are pre-includes" do
- let(:mock_header) {
- parsed_header = {}
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header,
- [%{"another_header.h"}])
- }
- it "then they are included before the other files" do
- expect(mock_header).to include(
- %{#include "another_header.h"\n} +
- %{#include "fff.h"}
- )
- end
- end
-
- context "when there are post-includes" do
- let(:mock_header) {
- parsed_header = {}
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header,
- nil, [%{"another_header.h"}])
- }
- it "then they are included after the other files" do
- expect(mock_header).to include(
- %{#include "display.h"\n} +
- %{#include "another_header.h"\n}
- )
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/fff_mock_source_generator_spec.rb b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/fff_mock_source_generator_spec.rb
deleted file mode 100755
index 364f8521..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/fff_mock_source_generator_spec.rb
+++ /dev/null
@@ -1,149 +0,0 @@
-require 'stringio'
-require 'fff_mock_generator.rb'
-
-# Test the contents of the .c file created for the mock.
-describe "FffMockGenerator.create_mock_source" do
-
- context "when there is nothing to mock," do
- let(:mock_source) {
- parsed_header = {}
- FffMockGenerator.create_mock_source("mock_my_module", parsed_header)
- }
- it "then the generated file includes the fff header" do
- expect(mock_source).to include(
- # fff.h also requires including string.h
- %{#include <string.h>\n} +
- %{#include "fff.h"}
- )
- end
- it "then the generated file includes the mock header" do
- expect(mock_source).to include(
- %{#include "mock_my_module.h"\n}
- )
- end
- it "then the generated file defines the init function" do
- expect(mock_source).to include(
- "void mock_my_module_Init(void)\n" +
- "{\n" +
- " FFF_RESET_HISTORY();\n" +
- "}"
- )
- end
- it "then the generated file defines the verify function" do
- expect(mock_source).to include(
- "void mock_my_module_Verify(void)\n" +
- "{\n" +
- "}"
- )
- end
- it "then the generated file defines the destroy function" do
- expect(mock_source).to include(
- "void mock_my_module_Destroy(void)\n" +
- "{\n" +
- "}"
- )
- end
- end
-
- context "when there are multiple functions," do
- let(:mock_source) {
- parsed_header = create_cmock_style_parsed_header(
- [ {:name => 'a_function', :return_type => 'int', :args => ['char *']},
- {:name => 'another_function', :return_type => 'void'},
- {:name => 'three', :return_type => 'bool', :args => ['float', 'int']}
- ])
- FffMockGenerator.create_mock_source("mock_display", parsed_header)
- }
- it "then the generated file contains the first fake function definition" do
- expect(mock_source).to include(
- "DEFINE_FAKE_VALUE_FUNC1(int, a_function, char *);"
- )
- end
- it "then the generated file contains the second fake function definition" do
- expect(mock_source).to include(
- "DEFINE_FAKE_VOID_FUNC0(another_function);"
- )
- end
- it "then the generated file contains the third fake function definition" do
- expect(mock_source).to include(
- "DEFINE_FAKE_VALUE_FUNC2(bool, three, float, int);"
- )
- end
- it "then the init function resets all of the fakes" do
- expect(mock_source).to include(
- "void mock_display_Init(void)\n" +
- "{\n" +
- " FFF_RESET_HISTORY();\n" +
- " RESET_FAKE(a_function)\n" +
- " RESET_FAKE(another_function)\n" +
- " RESET_FAKE(three)\n" +
- "}"
- )
- end
- end
-
- context "when there is a void function with variable arguments and " +
- "additional arguments" do
- let(:mock_source){
- parsed_header = {}
- parsed_header[:functions] = [{
- :name => "function_with_var_args",
- :return => {:type => "void"},
- :var_arg => "...",
- :args => [{:type => 'char *'}, {:type => 'int'}]
- }]
- FffMockGenerator.create_mock_source("mock_display", parsed_header)
- }
- it "then the generated file contains the vararg definition" do
- expect(mock_source).to include(
- "DEFINE_FAKE_VOID_FUNC3_VARARG(function_with_var_args, char *, int, ...)"
- )
- end
- end
-
- context "when there is a function with a pointer to a const value" do
- let(:mock_source){
- parsed_header = {}
- parsed_header[:functions] = [{
- :name => "const_test_function",
- :return => {:type => "void"},
- :args => [{:type => "char *", :name => "a", :ptr? => false, :const? => true},
- {:type => "char *", :name => "b", :ptr? => false, :const? => false}]
- }]
- FffMockGenerator.create_mock_source("mock_display", parsed_header)
- }
- it "then the generated file contains the correct const argument in the declaration" do
- expect(mock_source).to include(
- "DEFINE_FAKE_VOID_FUNC2(const_test_function, const char *, char *)"
- )
- end
- end
-
- context "when there are pre-includes" do
- let(:mock_source) {
- parsed_source = {}
- FffMockGenerator.create_mock_source("mock_display", parsed_source,
- [%{"another_header.h"}])
- }
- it "then they are included before the other files" do
- expect(mock_source).to include(
- %{#include "another_header.h"\n} +
- %{#include <string.h>}
- )
- end
- end
-
- context "when there are post-includes" do
- let(:mock_source) {
- parsed_source = {}
- FffMockGenerator.create_mock_source("mock_display", parsed_source,
- nil, [%{"another_header.h"}])
- }
- it "then they are included before the other files" do
- expect(mock_source).to include(
- %{#include "mock_display.h"\n} +
- %{#include "another_header.h"\n}
- )
- end
- end
-end \ No newline at end of file
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/header_generator.rb b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/header_generator.rb
deleted file mode 100755
index cda27844..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/header_generator.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# Create a CMock-style parsed header hash. This the type of hash created by
-# CMock when parsing header files for automock generation. It contains all of
-# includes, typedefs and functions (with return types and arguments) parsed from
-# the header file.
-def create_cmock_style_parsed_header(functions, typedefs = nil)
- parsed_header = {
- :includes => nil,
- :functions => [],
- :typedefs => []
- }
-
- # Add the typedefs.
- if typedefs
- typedefs.each do |typedef|
- parsed_header[:typedefs] << typedef
- end
- end
-
- # Add the functions.
- if functions
- functions.each do |function|
- # Build the array of arguments.
- args = []
- if function.key?(:args)
- function[:args].each do |arg|
- args << {
- :type => arg
- }
- end
- end
- parsed_header[:functions] << {
- :name => function[:name],
- :modifier => "",
- :return => {
- :type => function[:return_type],
- :name => "cmock_to_return",
- :ptr? => false,
- :const? => false,
- :str => "void cmock_to_return",
- :void? => true
- },
- :var_arg => nil,
- :args_string => "void",
- :args => args,
- :args_call => "",
- :contains_ptr? => false
- }
- end
- end
- parsed_header
-end \ No newline at end of file
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/spec_helper.rb b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/spec_helper.rb
deleted file mode 100755
index 25dc80ac..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/spec/spec_helper.rb
+++ /dev/null
@@ -1,96 +0,0 @@
-# This file was generated by the `rspec --init` command. Conventionally, all
-# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
-# The generated `.rspec` file contains `--require spec_helper` which will cause
-# this file to always be loaded, without a need to explicitly require it in any
-# files.
-#
-# Given that it is always loaded, you are encouraged to keep this file as
-# light-weight as possible. Requiring heavyweight dependencies from this file
-# will add to the boot time of your test suite on EVERY test run, even for an
-# individual file that may not need all of that loaded. Instead, consider making
-# a separate helper file that requires the additional dependencies and performs
-# the additional setup, and require it from the spec files that actually need
-# it.
-#
-# The `.rspec` file also contains a few flags that are not defaults but that
-# users commonly want.
-#
-# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
-RSpec.configure do |config|
- # rspec-expectations config goes here. You can use an alternate
- # assertion/expectation library such as wrong or the stdlib/minitest
- # assertions if you prefer.
- config.expect_with :rspec do |expectations|
- # This option will default to `true` in RSpec 4. It makes the `description`
- # and `failure_message` of custom matchers include text for helper methods
- # defined using `chain`, e.g.:
- # be_bigger_than(2).and_smaller_than(4).description
- # # => "be bigger than 2 and smaller than 4"
- # ...rather than:
- # # => "be bigger than 2"
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
- end
-
- # rspec-mocks config goes here. You can use an alternate test double
- # library (such as bogus or mocha) by changing the `mock_with` option here.
- config.mock_with :rspec do |mocks|
- # Prevents you from mocking or stubbing a method that does not exist on
- # a real object. This is generally recommended, and will default to
- # `true` in RSpec 4.
- mocks.verify_partial_doubles = true
- end
-
-# The settings below are suggested to provide a good initial experience
-# with RSpec, but feel free to customize to your heart's content.
-=begin
- # These two settings work together to allow you to limit a spec run
- # to individual examples or groups you care about by tagging them with
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
- # get run.
- config.filter_run :focus
- config.run_all_when_everything_filtered = true
-
- # Allows RSpec to persist some state between runs in order to support
- # the `--only-failures` and `--next-failure` CLI options. We recommend
- # you configure your source control system to ignore this file.
- config.example_status_persistence_file_path = "spec/examples.txt"
-
- # Limits the available syntax to the non-monkey patched syntax that is
- # recommended. For more details, see:
- # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
- # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
- # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
- config.disable_monkey_patching!
-
- # This setting enables warnings. It's recommended, but in some cases may
- # be too noisy due to issues in dependencies.
- config.warnings = true
-
- # Many RSpec users commonly either run the entire suite or an individual
- # file, and it's useful to allow more verbose output when running an
- # individual spec file.
- if config.files_to_run.one?
- # Use the documentation formatter for detailed output,
- # unless a formatter has already been configured
- # (e.g. via a command-line flag).
- config.default_formatter = 'doc'
- end
-
- # Print the 10 slowest examples and example groups at the
- # end of the spec run, to help surface which specs are running
- # particularly slow.
- config.profile_examples = 10
-
- # Run specs in random order to surface order dependencies. If you find an
- # order dependency and want to debug it, you can fix the order by providing
- # the seed, which is printed after each run.
- # --seed 1234
- config.order = :random
-
- # Seed global randomization in this process using the `--seed` CLI option.
- # Setting this allows you to use `--seed` to deterministically reproduce
- # test failures related to randomization by passing the same `--seed` value
- # as the one that triggered the failure.
- Kernel.srand config.seed
-=end
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/src/fff_unity_helper.h b/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/src/fff_unity_helper.h
deleted file mode 100755
index de3db44a..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/fake_function_framework/src/fff_unity_helper.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef fff_unity_helper_H
-#define fff_unity_helper_H
-
-/*
- FFF helper macros for Unity.
-*/
-
-/*
- Fail if the function was not called the expected number of times.
-*/
-#define TEST_ASSERT_CALLED_TIMES(times_, function_) \
- TEST_ASSERT_EQUAL_MESSAGE(times_, \
- function_ ## _fake.call_count, \
- "Function " #function_ " called the incorrect number of times.")
-/*
- Fail if the function was not called exactly once.
-*/
-#define TEST_ASSERT_CALLED(function_) TEST_ASSERT_CALLED_TIMES(1, function_)
-
-/*
- Fail if the function was called 1 or more times.
-*/
-#define TEST_ASSERT_NOT_CALLED(function_) TEST_ASSERT_CALLED_TIMES(0, function_)
-
-/*
- Fail if the function was not called in this particular order.
-*/
-#define TEST_ASSERT_CALLED_IN_ORDER(order_, function_) \
- TEST_ASSERT_EQUAL_PTR_MESSAGE((void *) function_, \
- fff.call_history[order_], \
- "Function " #function_ " not called in order " #order_ )
-
-#endif \ No newline at end of file
diff --git a/tinyusb/test/vendor/ceedling/plugins/gcov/README.md b/tinyusb/test/vendor/ceedling/plugins/gcov/README.md
deleted file mode 100755
index 096ffa10..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/gcov/README.md
+++ /dev/null
@@ -1,101 +0,0 @@
-ceedling-gcov
-=============
-
-# Plugin Overview
-
-Plugin for integrating GNU GCov code coverage tool into Ceedling projects.
-Currently only designed for the gcov command (like LCOV for example). In the
-future we could configure this to work with other code coverage tools.
-
-This plugin currently uses `gcovr` to generate HTML and/or XML reports as a
-utility. The normal gcov plugin _must_ be run first for this report to generate.
-
-## Installation
-
-Gcovr can be installed via pip like so:
-
-```
-pip install gcovr
-```
-
-## Configuration
-
-The gcov plugin supports configuration options via your `project.yml` provided
-by Ceedling.
-
-Generation of HTML reports may be enabled or disabled with the following
-config. Set to `true` to enable or set to `false` to disable.
-
-```
-:gcov:
- :html_report: true
-```
-
-Generation of XML reports may be enabled or disabled with the following
-config. Set to `true` to enable or set to `false` to disable.
-
-```
-:gcov:
- :xml_report: true
-```
-
-There are two types of gcovr HTML reports that can be configured in your
-`project.yml`. To create a basic HTML report, with only the overall file
-information, use the following config.
-
-```
-:gcov:
- :html_report_type: basic
-```
-
-To create a detailed HTML report, with line by line breakdown of the
-coverage, use the following config.
-
-```
-:gcov:
- :html_report_type: detailed
-```
-
-There are a number of options to control which files are considered part of
-the coverage report. Most often, we only care about coverage on our source code, and not
-on tests or automatically generated mocks, runners, etc. However, there are times
-where this isn't true... or there are times where we've moved ceedling's directory
-structure so that the project file isn't at the root of the project anymore. In these
-cases, you may need to tweak the following:
-
-```
-:gcov:
- :report_root: "."
- :report_exclude: "^build|^vendor|^test|^support"
- :report_include: "^src"
-```
-
-One important note about html_report_root: gcovr will only take a single root folder, unlike
-Ceedling's ability to take as many as you like. So you will need to choose a folder which is
-a superset of ALL the folders you want, and then use the include or exclude options to set up
-patterns of files to pay attention to or ignore. It's not ideal, but it works.
-
-Finally, there are a number of settings which can be specified in order to adjust the
-default behaviors of gcov:
-
-```
-:gcov:
- :html_medium_threshold: 75
- :html_high_threshold: 90
- :fail_under_line: 30
- :fail_under_branch: 30
-```
-
-These HTML and XML reports will be found in `build/artifacts/gcov`.
-
-## Example Usage
-
-```
-ceedling gcov:all utils:gcov
-```
-
-## To-Do list
-
-- Generate overall report (combined statistics from all files with coverage)
-- Generate coverage output files
-- Easier option override for better customisation
diff --git a/tinyusb/test/vendor/ceedling/plugins/gcov/assets/template.erb b/tinyusb/test/vendor/ceedling/plugins/gcov/assets/template.erb
deleted file mode 100755
index 5e5a1742..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/gcov/assets/template.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-% function_string = hash[:coverage][:functions].to_s
-% branch_string = hash[:coverage][:branches].to_s
-% format_string = "%#{[function_string.length, branch_string.length].max}i"
-<%=@ceedling[:plugin_reportinator].generate_banner("#{GCOV_ROOT_NAME.upcase}: CODE COVERAGE SUMMARY")%>
-% if (!hash[:coverage][:functions].nil?)
-FUNCTIONS: <%=sprintf(format_string, hash[:coverage][:functions])%>%
-% else
-FUNCTIONS: none
-% end
-% if (!hash[:coverage][:branches].nil?)
-BRANCHES: <%=sprintf(format_string, hash[:coverage][:branches])%>%
-% else
-BRANCHES: none
-% end
-
diff --git a/tinyusb/test/vendor/ceedling/plugins/gcov/config/defaults.yml b/tinyusb/test/vendor/ceedling/plugins/gcov/config/defaults.yml
deleted file mode 100755
index 13bac556..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/gcov/config/defaults.yml
+++ /dev/null
@@ -1,73 +0,0 @@
----
-
-:tools:
- :gcov_compiler:
- :executable: gcc
- :arguments:
- - -g
- - -fprofile-arcs
- - -ftest-coverage
- - -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- - -I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE
- - -D$: COLLECTION_DEFINES_TEST_AND_VENDOR
- - -DGCOV_COMPILER
- - -DCODE_COVERAGE
- - -c "${1}"
- - -o "${2}"
- :gcov_linker:
- :executable: gcc
- :arguments:
- - -fprofile-arcs
- - -ftest-coverage
- - ${1}
- - -o ${2}
- - ${3}
- :gcov_fixture:
- :executable: ${1}
- :gcov_report:
- :executable: gcov
- :arguments:
- - -n
- - -p
- - -b
- - -o "$": GCOV_BUILD_OUTPUT_PATH
- - "\"${1}\""
- :gcov_post_report:
- :executable: gcovr
- :optional: TRUE
- :arguments:
- - -p
- - -b
- - ${1}
- - --html
- - -o GcovCoverageResults.html
- :gcov_post_report_basic:
- :executable: gcovr
- :optional: TRUE
- :arguments:
- - -p
- - -b
- - ${1}
- - --html
- - -o "$": GCOV_ARTIFACTS_FILE
- :gcov_post_report_advanced:
- :executable: gcovr
- :optional: TRUE
- :arguments:
- - -p
- - -b
- - ${1}
- - --html
- - --html-details
- - -o "$": GCOV_ARTIFACTS_FILE
- :gcov_post_report_xml:
- :executable: gcovr
- :optional: TRUE
- :arguments:
- - -p
- - -b
- - ${1}
- - --xml
- - -o "$": GCOV_ARTIFACTS_FILE_XML
-
-...
diff --git a/tinyusb/test/vendor/ceedling/plugins/gcov/gcov.rake b/tinyusb/test/vendor/ceedling/plugins/gcov/gcov.rake
deleted file mode 100755
index 3acab856..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/gcov/gcov.rake
+++ /dev/null
@@ -1,220 +0,0 @@
-directory(GCOV_BUILD_OUTPUT_PATH)
-directory(GCOV_RESULTS_PATH)
-directory(GCOV_ARTIFACTS_PATH)
-directory(GCOV_DEPENDENCIES_PATH)
-
-CLEAN.include(File.join(GCOV_BUILD_OUTPUT_PATH, '*'))
-CLEAN.include(File.join(GCOV_RESULTS_PATH, '*'))
-CLEAN.include(File.join(GCOV_ARTIFACTS_PATH, '*'))
-CLEAN.include(File.join(GCOV_DEPENDENCIES_PATH, '*'))
-
-CLOBBER.include(File.join(GCOV_BUILD_PATH, '**/*'))
-
-rule(/#{GCOV_BUILD_OUTPUT_PATH}\/#{'.+\\' + EXTENSION_OBJECT}$/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_compilation_input_file(task_name)
- end
- ]) do |object|
-
- if File.basename(object.source) =~ /^(#{PROJECT_TEST_FILE_PREFIX}|#{CMOCK_MOCK_PREFIX}|#{GCOV_IGNORE_SOURCES.join('|')})/i
- @ceedling[:generator].generate_object_file(
- TOOLS_GCOV_COMPILER,
- OPERATION_COMPILE_SYM,
- GCOV_SYM,
- object.source,
- object.name,
- @ceedling[:file_path_utils].form_test_build_list_filepath(object.name)
- )
- else
- @ceedling[GCOV_SYM].generate_coverage_object_file(object.source, object.name)
- end
-end
-
-rule(/#{GCOV_BUILD_OUTPUT_PATH}\/#{'.+\\' + EXTENSION_EXECUTABLE}$/) do |bin_file|
- lib_args = @ceedling[:test_invoker].convert_libraries_to_arguments()
-
- @ceedling[:generator].generate_executable_file(
- TOOLS_GCOV_LINKER,
- GCOV_SYM,
- bin_file.prerequisites,
- bin_file.name,
- lib_args,
- @ceedling[:file_path_utils].form_test_build_map_filepath(bin_file.name)
- )
-end
-
-rule(/#{GCOV_RESULTS_PATH}\/#{'.+\\' + EXTENSION_TESTPASS}$/ => [
- proc do |task_name|
- @ceedling[:file_path_utils].form_test_executable_filepath(task_name)
- end
- ]) do |test_result|
- @ceedling[:generator].generate_test_results(TOOLS_GCOV_FIXTURE, GCOV_SYM, test_result.source, test_result.name)
-end
-
-rule(/#{GCOV_DEPENDENCIES_PATH}\/#{'.+\\' + EXTENSION_DEPENDENCIES}$/ => [
- proc do |task_name|
- @ceedling[:file_finder].find_compilation_input_file(task_name)
- end
- ]) do |dep|
- @ceedling[:generator].generate_dependencies_file(
- TOOLS_TEST_DEPENDENCIES_GENERATOR,
- GCOV_SYM,
- dep.source,
- File.join(GCOV_BUILD_OUTPUT_PATH, File.basename(dep.source).ext(EXTENSION_OBJECT)),
- dep.name
- )
-end
-
-task directories: [GCOV_BUILD_OUTPUT_PATH, GCOV_RESULTS_PATH, GCOV_DEPENDENCIES_PATH, GCOV_ARTIFACTS_PATH]
-
-namespace GCOV_SYM do
- task source_coverage: COLLECTION_ALL_SOURCE.pathmap("#{GCOV_BUILD_OUTPUT_PATH}/%n#{@ceedling[:configurator].extension_object}")
-
- desc 'Run code coverage for all tests'
- task all: [:directories] do
- @ceedling[:configurator].replace_flattened_config(@ceedling[GCOV_SYM].config)
- @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, GCOV_SYM)
- @ceedling[:configurator].restore_config
- end
-
- desc 'Run single test w/ coverage ([*] real test or source file name, no path).'
- task :* do
- message = "\nOops! '#{GCOV_ROOT_NAME}:*' isn't a real task. " \
- "Use a real test or source file name (no path) in place of the wildcard.\n" \
- "Example: rake #{GCOV_ROOT_NAME}:foo.c\n\n"
-
- @ceedling[:streaminator].stdout_puts(message)
- end
-
- desc 'Run tests by matching regular expression pattern.'
- task :pattern, [:regex] => [:directories] do |_t, args|
- matches = []
-
- COLLECTION_ALL_TESTS.each do |test|
- matches << test if test =~ /#{args.regex}/
- end
-
- if !matches.empty?
- @ceedling[:configurator].replace_flattened_config(@ceedling[GCOV_SYM].config)
- @ceedling[:test_invoker].setup_and_invoke(matches, GCOV_SYM, force_run: false)
- @ceedling[:configurator].restore_config
- else
- @ceedling[:streaminator].stdout_puts("\nFound no tests matching pattern /#{args.regex}/.")
- end
- end
-
- desc 'Run tests whose test path contains [dir] or [dir] substring.'
- task :path, [:dir] => [:directories] do |_t, args|
- matches = []
-
- COLLECTION_ALL_TESTS.each do |test|
- matches << test if File.dirname(test).include?(args.dir.tr('\\', '/'))
- end
-
- if !matches.empty?
- @ceedling[:configurator].replace_flattened_config(@ceedling[GCOV_SYM].config)
- @ceedling[:test_invoker].setup_and_invoke(matches, GCOV_SYM, force_run: false)
- @ceedling[:configurator].restore_config
- else
- @ceedling[:streaminator].stdout_puts("\nFound no tests including the given path or path component.")
- end
- end
-
- desc 'Run code coverage for changed files'
- task delta: [:directories] do
- @ceedling[:configurator].replace_flattened_config(@ceedling[GCOV_SYM].config)
- @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, GCOV_SYM, force_run: false)
- @ceedling[:configurator].restore_config
- end
-
- # use a rule to increase efficiency for large projects
- # gcov test tasks by regex
- rule(/^#{GCOV_TASK_ROOT}\S+$/ => [
- proc do |task_name|
- test = task_name.sub(/#{GCOV_TASK_ROOT}/, '')
- test = "#{PROJECT_TEST_FILE_PREFIX}#{test}" unless test.start_with?(PROJECT_TEST_FILE_PREFIX)
- @ceedling[:file_finder].find_test_from_file_path(test)
- end
- ]) do |test|
- @ceedling[:rake_wrapper][:directories].invoke
- @ceedling[:configurator].replace_flattened_config(@ceedling[GCOV_SYM].config)
- @ceedling[:test_invoker].setup_and_invoke([test.source], GCOV_SYM)
- @ceedling[:configurator].restore_config
- end
-end
-
-if PROJECT_USE_DEEP_DEPENDENCIES
- namespace REFRESH_SYM do
- task GCOV_SYM do
- @ceedling[:configurator].replace_flattened_config(@ceedling[GCOV_SYM].config)
- @ceedling[:test_invoker].refresh_deep_dependencies
- @ceedling[:configurator].restore_config
- end
- end
-end
-
-namespace UTILS_SYM do
- def gcov_args_builder(opts)
- args = ""
- args += "-r \"#{opts[:gcov_report_root] || '.'}\" "
- args += "-f \"#{opts[:gcov_report_include]}\" " unless opts[:gcov_report_include].nil?
- args += "-e \"#{opts[:gcov_report_exclude] || GCOV_FILTER_EXCLUDE}\" "
- [ :gcov_fail_under_line, :gcov_fail_under_branch, :gcov_html_medium_threshold, :gcov_html_high_threshold].each do |opt|
- args += "--#{opt.to_s.gsub('_','-').sub(/:?gcov-/,'')} #{opts[opt]} " unless opts[opt].nil?
- end
- return args
- end
-
- desc 'Create gcov code coverage html report (must run ceedling gcov first)'
- task GCOV_SYM do
-
- if !File.directory? GCOV_ARTIFACTS_PATH
- FileUtils.mkdir_p GCOV_ARTIFACTS_PATH
- end
-
- args = gcov_args_builder(@ceedling[:configurator].project_config_hash)
-
- if @ceedling[:configurator].project_config_hash[:gcov_html_report].nil?
- puts "In your project.yml, define: \n\n:gcov:\n :html_report:\n\n to true or false to refine this feature."
- puts "For now, assumimg you want an html report generated."
- html_enabled = true
- else
- html_enabled = @ceedling[:configurator].project_config_hash[:gcov_html_report]
- end
-
- if @ceedling[:configurator].project_config_hash[:gcov_xml_report].nil?
- puts "In your project.yml, define: \n\n:gcov:\n :xml_report:\n\n to true or false to refine this feature."
- puts "For now, assumimg you do not want an xml report generated."
- xml_enabled = false
- else
- xml_enabled = @ceedling[:configurator].project_config_hash[:gcov_xml_report]
- end
-
- if html_enabled
- if @ceedling[:configurator].project_config_hash[:gcov_html_report_type] == 'basic'
- puts "Creating a basic html report of gcov results in #{GCOV_ARTIFACTS_FILE}..."
- command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_BASIC, [], args)
- @ceedling[:tool_executor].exec(command[:line], command[:options])
- elsif @ceedling[:configurator].project_config_hash[:gcov_html_report_type] == 'detailed'
- puts "Creating a detailed html report of gcov results in #{GCOV_ARTIFACTS_FILE}..."
- command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_ADVANCED, [], args)
- @ceedling[:tool_executor].exec(command[:line], command[:options])
-
- else
- puts "In your project.yml, define: \n\n:gcov:\n :html_report_type:\n\n to basic or detailed to refine this feature."
- puts "For now, just creating basic."
- puts "Creating a basic html report of gcov results in #{GCOV_ARTIFACTS_FILE}..."
- command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_BASIC, [], args)
- @ceedling[:tool_executor].exec(command[:line], command[:options])
- end
- end
-
- if xml_enabled
- puts "Creating an xml report of gcov results in #{GCOV_ARTIFACTS_FILE_XML}..."
- command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_XML, [], filter)
- @ceedling[:tool_executor].exec(command[:line], command[:options])
- end
-
- puts "Done."
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/gcov/lib/gcov.rb b/tinyusb/test/vendor/ceedling/plugins/gcov/lib/gcov.rb
deleted file mode 100755
index 15a1b4cf..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/gcov/lib/gcov.rb
+++ /dev/null
@@ -1,113 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/constants'
-require 'gcov_constants'
-
-class Gcov < Plugin
- attr_reader :config
-
- def setup
- @result_list = []
-
- @config = {
- project_test_build_output_path: GCOV_BUILD_OUTPUT_PATH,
- project_test_build_output_c_path: GCOV_BUILD_OUTPUT_PATH,
- project_test_results_path: GCOV_RESULTS_PATH,
- project_test_dependencies_path: GCOV_DEPENDENCIES_PATH,
- defines_test: DEFINES_TEST + ['CODE_COVERAGE'],
- gcov_html_report_filter: GCOV_FILTER_EXCLUDE
- }
-
- @plugin_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
- @coverage_template_all = @ceedling[:file_wrapper].read(File.join(@plugin_root, 'assets/template.erb'))
- end
-
- def generate_coverage_object_file(source, object)
- lib_args = @ceedling[:test_invoker].convert_libraries_to_arguments()
- compile_command =
- @ceedling[:tool_executor].build_command_line(
- TOOLS_GCOV_COMPILER,
- @ceedling[:flaginator].flag_down(OPERATION_COMPILE_SYM, GCOV_SYM, source),
- source,
- object,
- @ceedling[:file_path_utils].form_test_build_list_filepath(object),
- lib_args
- )
- @ceedling[:streaminator].stdout_puts("Compiling #{File.basename(source)} with coverage...")
- @ceedling[:tool_executor].exec(compile_command[:line], compile_command[:options])
- end
-
- def post_test_fixture_execute(arg_hash)
- result_file = arg_hash[:result_file]
-
- if (result_file =~ /#{GCOV_RESULTS_PATH}/) && !@result_list.include?(result_file)
- @result_list << arg_hash[:result_file]
- end
- end
-
- def post_build
- return unless @ceedling[:task_invoker].invoked?(/^#{GCOV_TASK_ROOT}/)
-
- # test results
- results = @ceedling[:plugin_reportinator].assemble_test_results(@result_list)
- hash = {
- header: GCOV_ROOT_NAME.upcase,
- results: results
- }
-
- @ceedling[:plugin_reportinator].run_test_results_report(hash) do
- message = ''
- message = 'Unit test failures.' if results[:counts][:failed] > 0
- message
- end
-
- report_per_file_coverage_results(@ceedling[:test_invoker].sources)
- end
-
- def summary
- result_list = @ceedling[:file_path_utils].form_pass_results_filelist(GCOV_RESULTS_PATH, COLLECTION_ALL_TESTS)
-
- # test results
- # get test results for only those tests in our configuration and of those only tests with results on disk
- hash = {
- header: GCOV_ROOT_NAME.upcase,
- results: @ceedling[:plugin_reportinator].assemble_test_results(result_list, boom: false)
- }
-
- @ceedling[:plugin_reportinator].run_test_results_report(hash)
- end
-
- private ###################################
-
- def report_per_file_coverage_results(sources)
- banner = @ceedling[:plugin_reportinator].generate_banner "#{GCOV_ROOT_NAME.upcase}: CODE COVERAGE SUMMARY"
- @ceedling[:streaminator].stdout_puts "\n" + banner
-
- coverage_sources = sources.clone
- coverage_sources.delete_if { |item| item =~ /#{CMOCK_MOCK_PREFIX}.+#{EXTENSION_SOURCE}$/ }
- coverage_sources.delete_if { |item| item =~ /#{GCOV_IGNORE_SOURCES.join('|')}#{EXTENSION_SOURCE}$/ }
-
- coverage_sources.each do |source|
- basename = File.basename(source)
- command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_REPORT, [], [basename])
- shell_results = @ceedling[:tool_executor].exec(command[:line], command[:options])
- coverage_results = shell_results[:output]
-
- if coverage_results.strip =~ /(File\s+'#{Regexp.escape(source)}'.+$)/m
- report = Regexp.last_match(1).lines.to_a[1..-1].map { |line| basename + ' ' + line }.join('')
- @ceedling[:streaminator].stdout_puts(report + "\n\n")
- end
- end
-
- COLLECTION_ALL_SOURCE.each do |source|
- unless coverage_sources.include?(source)
- @ceedling[:streaminator].stdout_puts("Could not find coverage results for " + source + "\n")
- end
- end
- end
-end
-
-# end blocks always executed following rake run
-END {
- # cache our input configurations to use in comparison upon next execution
- @ceedling[:cacheinator].cache_test_config(@ceedling[:setupinator].config_hash) if @ceedling[:task_invoker].invoked?(/^#{GCOV_TASK_ROOT}/)
-}
diff --git a/tinyusb/test/vendor/ceedling/plugins/gcov/lib/gcov_constants.rb b/tinyusb/test/vendor/ceedling/plugins/gcov/lib/gcov_constants.rb
deleted file mode 100755
index 539d46f7..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/gcov/lib/gcov_constants.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-
-GCOV_ROOT_NAME = 'gcov'.freeze
-GCOV_TASK_ROOT = GCOV_ROOT_NAME + ':'
-GCOV_SYM = GCOV_ROOT_NAME.to_sym
-
-GCOV_BUILD_PATH = File.join(PROJECT_BUILD_ROOT, GCOV_ROOT_NAME)
-GCOV_BUILD_OUTPUT_PATH = File.join(GCOV_BUILD_PATH, "out")
-GCOV_RESULTS_PATH = File.join(GCOV_BUILD_PATH, "results")
-GCOV_DEPENDENCIES_PATH = File.join(GCOV_BUILD_PATH, "dependencies")
-GCOV_ARTIFACTS_PATH = File.join(PROJECT_BUILD_ARTIFACTS_ROOT, GCOV_ROOT_NAME)
-
-GCOV_ARTIFACTS_FILE = File.join(GCOV_ARTIFACTS_PATH, "GcovCoverageResults.html")
-GCOV_ARTIFACTS_FILE_XML = File.join(GCOV_ARTIFACTS_PATH, "GcovCoverageResults.xml")
-
-GCOV_IGNORE_SOURCES = %w(unity cmock cexception).freeze
-
-GCOV_FILTER_EXCLUDE = '^vendor.*|^build.*|^test.*|^lib.*'
-
-
diff --git a/tinyusb/test/vendor/ceedling/plugins/junit_tests_report/README.md b/tinyusb/test/vendor/ceedling/plugins/junit_tests_report/README.md
deleted file mode 100755
index 1259fd66..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/junit_tests_report/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-junit_tests_report
-====================
-
-## Overview
-
-The junit_tests_report plugin creates an XML file of test results in JUnit
-format, which is handy for Continuous Integration build servers or as input
-into other reporting tools. The XML file is output to the appropriate
-`<build_root>/artifacts/` directory (e.g. `artifacts/test/` for test tasks,
-`artifacts/gcov/` for gcov, or `artifacts/bullseye/` for bullseye runs).
-
-## Setup
-
-Enable the plugin in your project.yml by adding `junit_tests_report`
-to the list of enabled plugins.
-
-``` YAML
-:plugins:
- :enabled:
- - junit_tests_report
-```
-
-## Configuration
-
-Optionally configure the output / artifact filename in your project.yml with
-the `artifact_filename` configuration option. The default filename is
-`report.xml`.
-
-You can also configure the path that this artifact is stored. This can be done
-by setting `path`. The default is that it will be placed in a subfolder under
-the `build` directory.
-
-``` YAML
-:junit_tests_report:
- :artifact_filename: report_junit.xml
-```
diff --git a/tinyusb/test/vendor/ceedling/plugins/junit_tests_report/lib/junit_tests_report.rb b/tinyusb/test/vendor/ceedling/plugins/junit_tests_report/lib/junit_tests_report.rb
deleted file mode 100755
index a777d07d..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/junit_tests_report/lib/junit_tests_report.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/constants'
-
-class JunitTestsReport < Plugin
-
- def setup
- @results_list = {}
- @test_counter = 0
- @time_result = []
- end
-
- def post_test_fixture_execute(arg_hash)
- context = arg_hash[:context]
-
- @results_list[context] = [] if (@results_list[context].nil?)
-
- @results_list[context] << arg_hash[:result_file]
- @time_result << arg_hash[:shell_result][:time]
-
- end
-
- def post_build
- @results_list.each_key do |context|
- results = @ceedling[:plugin_reportinator].assemble_test_results(@results_list[context])
-
- artifact_filename = @ceedling[:configurator].project_config_hash[:junit_tests_report_artifact_filename] || 'report.xml'
- artifact_fullpath = @ceedling[:configurator].project_config_hash[:junit_tests_report_path] || File.join(PROJECT_BUILD_ARTIFACTS_ROOT, context.to_s)
- file_path = File.join(artifact_fullpath, artifact_filename)
-
- @ceedling[:file_wrapper].open( file_path, 'w' ) do |f|
- @testsuite_counter = 0
- @testcase_counter = 0
- suites = reorganise_results( results )
-
- write_header( results, f )
- suites.each{|suite| write_suite( suite, f ) }
- write_footer( f )
- end
- end
- end
-
- private
-
- def write_header( results, stream )
- results[:counts][:time] = @time_result.reduce(0, :+)
- stream.puts '<?xml version="1.0" encoding="utf-8" ?>'
- stream.puts('<testsuites tests="%<total>d" failures="%<failed>d" skipped="%<ignored>d" time="%<time>f">' % results[:counts])
- end
-
- def write_footer( stream )
- stream.puts '</testsuites>'
- end
-
- def reorganise_results( results )
- # Reorganise the output by test suite instead of by result
- suites = Hash.new{ |h,k| h[k] = {collection: [], total: 0, success: 0, failed: 0, ignored: 0, stdout: []} }
- results[:successes].each do |result|
- source = result[:source]
- name = source[:file].sub(/\..{1,4}$/, "")
- suites[name][:collection] += result[:collection].map{|test| test.merge(result: :success)}
- suites[name][:total] += result[:collection].length
- suites[name][:success] += result[:collection].length
- end
- results[:failures].each do |result|
- source = result[:source]
- name = source[:file].sub(/\..{1,4}$/, "")
- suites[name][:collection] += result[:collection].map{|test| test.merge(result: :failed)}
- suites[name][:total] += result[:collection].length
- suites[name][:failed] += result[:collection].length
- end
- results[:ignores].each do |result|
- source = result[:source]
- name = source[:file].sub(/\..{1,4}$/, "")
- suites[name][:collection] += result[:collection].map{|test| test.merge(result: :ignored)}
- suites[name][:total] += result[:collection].length
- suites[name][:ignored] += result[:collection].length
- end
- results[:stdout].each do |result|
- source = result[:source]
- name = source[:file].sub(/\..{1,4}$/, "")
- suites[name][:stdout] += result[:collection]
- end
- suites.map{|name, data| data.merge(name: name) }
- end
-
- def write_suite( suite, stream )
- suite[:time] = @time_result.shift
- stream.puts(' <testsuite name="%<name>s" tests="%<total>d" failures="%<failed>d" skipped="%<ignored>d" time="%<time>f">' % suite)
-
- suite[:collection].each do |test|
- write_test( test, stream )
- end
-
- unless suite[:stdout].empty?
- stream.puts(' <system-out>')
- suite[:stdout].each do |line|
- line.gsub!(/&/, '&amp;')
- line.gsub!(/</, '&lt;')
- line.gsub!(/>/, '&gt;')
- line.gsub!(/"/, '&quot;')
- line.gsub!(/'/, '&apos;')
- stream.puts(line)
- end
- stream.puts(' </system-out>')
- end
-
- stream.puts(' </testsuite>')
- end
-
- def write_test( test, stream )
- test[:test].gsub!('"', '&quot;')
- case test[:result]
- when :success
- stream.puts(' <testcase name="%<test>s" />' % test)
- when :failed
- stream.puts(' <testcase name="%<test>s">' % test)
- if test[:message].empty?
- stream.puts(' <failure />')
- else
- stream.puts(' <failure message="%s" />' % test[:message])
- end
- stream.puts(' </testcase>')
- when :ignored
- stream.puts(' <testcase name="%<test>s">' % test)
- stream.puts(' <skipped />')
- stream.puts(' </testcase>')
- end
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/module_generator/config/module_generator.yml b/tinyusb/test/vendor/ceedling/plugins/module_generator/config/module_generator.yml
deleted file mode 100755
index cdb2da2e..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/module_generator/config/module_generator.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-:module_generator:
- :project_root: ./
- :source_root: src/
- :test_root: test/ \ No newline at end of file
diff --git a/tinyusb/test/vendor/ceedling/plugins/module_generator/lib/module_generator.rb b/tinyusb/test/vendor/ceedling/plugins/module_generator/lib/module_generator.rb
deleted file mode 100755
index b2fac006..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/module_generator/lib/module_generator.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/constants'
-require 'erb'
-require 'fileutils'
-
-class ModuleGenerator < Plugin
-
- attr_reader :config
-
- def create(module_name, optz={})
-
- require "generate_module.rb" #From Unity Scripts
-
- if ((!optz.nil?) && (optz[:destroy]))
- UnityModuleGenerator.new( divine_options(optz) ).destroy(module_name)
- else
- UnityModuleGenerator.new( divine_options(optz) ).generate(module_name)
- end
- end
-
- private
-
- def divine_options(optz={})
- unity_generator_options =
- {
- :path_src => ((defined? MODULE_GENERATOR_SOURCE_ROOT ) ? MODULE_GENERATOR_SOURCE_ROOT.gsub('\\', '/').sub(/^\//, '').sub(/\/$/, '') : "src" ),
- :path_inc => ((defined? MODULE_GENERATOR_INC_ROOT ) ?
- MODULE_GENERATOR_INC_ROOT.gsub('\\', '/').sub(/^\//, '').sub(/\/$/, '')
- : (defined? MODULE_GENERATOR_SOURCE_ROOT ) ?
- MODULE_GENERATOR_SOURCE_ROOT.gsub('\\', '/').sub(/^\//, '').sub(/\/$/, '')
- : "src" ),
- :path_tst => ((defined? MODULE_GENERATOR_TEST_ROOT ) ? MODULE_GENERATOR_TEST_ROOT.gsub( '\\', '/').sub(/^\//, '').sub(/\/$/, '') : "test" ),
- :pattern => optz[:pattern],
- :test_prefix => ((defined? PROJECT_TEST_FILE_PREFIX ) ? PROJECT_TEST_FILE_PREFIX : "Test" ),
- :mock_prefix => ((defined? CMOCK_MOCK_PREFIX ) ? CMOCK_MOCK_PREFIX : "Mock" ),
- :includes => ((defined? MODULE_GENERATOR_INCLUDES ) ? MODULE_GENERATOR_INCLUDES : {} ),
- :boilerplates => ((defined? MODULE_GENERATOR_BOILERPLATES) ? MODULE_GENERATOR_BOILERPLATES : {} ),
- :naming => ((defined? MODULE_GENERATOR_NAMING ) ? MODULE_GENERATOR_NAMING : nil ),
- :update_svn => ((defined? MODULE_GENERATOR_UPDATE_SVN ) ? MODULE_GENERATOR_UPDATE_SVN : false ),
- }
-
- # Read Boilerplate template file.
- if (defined? MODULE_GENERATOR_BOILERPLATE_FILES)
-
- bf = MODULE_GENERATOR_BOILERPLATE_FILES
-
- if !bf[:src].nil? && File.exists?(bf[:src])
- unity_generator_options[:boilerplates][:src] = File.read(bf[:src])
- end
-
- if !bf[:inc].nil? && File.exists?(bf[:inc])
- unity_generator_options[:boilerplates][:inc] = File.read(bf[:inc])
- end
-
- if !bf[:tst].nil? && File.exists?(bf[:tst])
- unity_generator_options[:boilerplates][:tst] = File.read(bf[:tst])
- end
- end
-
- # If using "create[<module_root>:<module_name>]" option from command line.
- unless optz[:module_root_path].to_s.empty?
- unity_generator_options[:path_src] = File.join(optz[:module_root_path], unity_generator_options[:path_src])
- unity_generator_options[:path_inc] = File.join(optz[:module_root_path], unity_generator_options[:path_inc])
- unity_generator_options[:path_tst] = File.join(optz[:module_root_path], unity_generator_options[:path_tst])
- end
-
- return unity_generator_options
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/module_generator/module_generator.rake b/tinyusb/test/vendor/ceedling/plugins/module_generator/module_generator.rake
deleted file mode 100755
index e88e346a..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/module_generator/module_generator.rake
+++ /dev/null
@@ -1,47 +0,0 @@
-
-namespace :module do
- module_root_separator = ":"
-
- desc "Generate module (source, header and test files)"
- task :create, :module_path do |t, args|
- files = [args[:module_path]] + (args.extras || [])
- optz = { :module_root_path => "" }
- ["dh", "dih", "mch", "mvp", "src", "test"].each do |pat|
- p = files.delete(pat)
- optz[:pattern] = p unless p.nil?
- end
- files.each do |v|
- module_root_path, module_name = v.split(module_root_separator, 2)
- if module_name
- optz[:module_root_path] = module_root_path
- v = module_name
- end
- if (v =~ /^test_?/i)
- # If the name of the file starts with test, automatically treat it as one
- @ceedling[:module_generator].create(v.sub(/^test_?/i,''), optz.merge({:pattern => 'test'}))
- else
- # Otherwise, go through the normal procedure
- @ceedling[:module_generator].create(v, optz)
- end
- end
- end
-
- desc "Destroy module (source, header and test files)"
- task :destroy, :module_path do |t, args|
- files = [args[:module_path]] + (args.extras || [])
- optz = { :destroy => true, :module_root_path => "" }
- ["dh", "dih", "mch", "mvp", "src", "test"].each do |pat|
- p = files.delete(pat)
- optz[:pattern] = p unless p.nil?
- end
- files.each do |v|
- module_root_path, module_name = v.split(module_root_separator, 2)
- if module_name
- optz[:module_root_path] = module_root_path
- v = module_name
- end
- @ceedling[:module_generator].create(v, optz)
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/raw_output_report/lib/raw_output_report.rb b/tinyusb/test/vendor/ceedling/plugins/raw_output_report/lib/raw_output_report.rb
deleted file mode 100755
index 014e6771..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/raw_output_report/lib/raw_output_report.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/constants'
-
-class RawOutputReport < Plugin
- def setup
- @log_paths = {}
- end
-
- def post_test_fixture_execute(arg_hash)
- output = strip_output(arg_hash[:shell_result][:output])
- write_raw_output_log(arg_hash, output)
- end
-
- private
-
- def strip_output(raw_output)
- output = ""
- raw_output.each_line do |line|
- next if line =~ /^\n$/
- next if line =~ /^.*:\d+:.*:(IGNORE|PASS|FAIL)/
- return output if line =~/^-----------------------\n$/
- output << line
- end
- end
- def write_raw_output_log(arg_hash, output)
- logging = generate_log_path(arg_hash)
- @ceedling[:file_wrapper].write(logging[:path], output , logging[:flags]) unless logging.nil?
- end
-
- def generate_log_path(arg_hash)
- f_name = File.basename(arg_hash[:result_file], '.pass')
- base_path = File.join(PROJECT_BUILD_ARTIFACTS_ROOT, arg_hash[:context].to_s)
- file_path = File.join(base_path, f_name + '.log')
-
- if @ceedling[:file_wrapper].exist?(base_path)
- return { path: file_path, flags: 'w' }
- end
-
- nil
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/assets/template.erb b/tinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/assets/template.erb
deleted file mode 100755
index fb8e3b13..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/assets/template.erb
+++ /dev/null
@@ -1,84 +0,0 @@
-% ignored = hash[:results][:counts][:ignored]
-% failed = hash[:results][:counts][:failed]
-% stdout_count = hash[:results][:counts][:stdout]
-% header_prepend = ((hash[:header].length > 0) ? "#{hash[:header]}: " : '')
-% banner_width = 25 + header_prepend.length # widest message
-% results = {}
-% hash[:results][:successes].each do |testresult|
-% results[ testresult[:source][:file] ] = testresult[:collection]
-% results[ testresult[:source][:file] ].length.times do |i|
-% results[ testresult[:source][:file] ][i][:pass] = true
-% end
-% end
-% hash[:results][:ignores].each do |testresult|
-% if (results[ testresult[:source][:file] ].nil?)
-% results[ testresult[:source][:file] ] = testresult[:collection]
-% else
-% results[ testresult[:source][:file] ] += testresult[:collection]
-% end
-% results[ testresult[:source][:file] ].length.times do |i|
-% results[ testresult[:source][:file] ][i][:pass] = true
-% end
-% end
-% hash[:results][:failures].each do |testresult|
-% if (results[ testresult[:source][:file] ].nil?)
-% results[ testresult[:source][:file] ] = testresult[:collection]
-% else
-% results[ testresult[:source][:file] ] += testresult[:collection]
-% end
-% end
-
-
-[==========] Running <%=hash[:results][:counts][:total].to_s%> tests from <%=results.length.to_s%> test cases.
-[----------] Global test environment set-up.
-% results.each_pair do |modulename, moduledetails|
-[----------] <%=moduledetails.length.to_s%> tests from <%=modulename%>
-% moduledetails.each do |item|
-[ RUN ] <%=modulename%>.<%=item[:test]%>
-% if (not item[:pass])
-% if (not item[:message].empty?)
-<%=modulename%>(<%=item[:line]%>): error: <%=item[:message]%>
-
-% m = item[:message].match(/Expected\s+(.*)\s+Was\s+([^\.]*)\./)
-% if m.nil?
- Actual: FALSE
- Expected: TRUE
-% else
- Actual: <%=m[2]%>
- Expected: <%=m[1]%>
-% end
-% else
-<%=modulename%>(<%=item[:line]%>): fail: <%=item[:message]%>
- Actual: FALSE
- Expected: TRUE
-% end
-[ FAILED ] <%=modulename%>.<%=item[:test]%> (0 ms)
-% else
-[ OK ] <%=modulename%>.<%=item[:test]%> (0 ms)
-% end
-% end
-[----------] <%=moduledetails.length.to_s%> tests from <%=modulename%> (0 ms total)
-% end
-
-% if (hash[:results][:counts][:total] > 0)
-[----------] Global test environment tear-down.
-[==========] <%=hash[:results][:counts][:total].to_s%> tests from <%=hash[:results][:stdout].length.to_s%> test cases ran.
-[ PASSED ] <%=hash[:results][:counts][:passed].to_s%> tests.
-% if (failed == 0)
-[ FAILED ] 0 tests.
-
- 0 FAILED TESTS
-% else
-[ FAILED ] <%=failed.to_s%> tests, listed below:
-% hash[:results][:failures].each do |failure|
-% failure[:collection].each do |item|
-[ FAILED ] <%=failure[:source][:file]%>.<%=item[:test]%>
-% end
-% end
-% end
-
- <%=failed.to_s%> FAILED TESTS
-% else
-
-No tests executed.
-% end
diff --git a/tinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/assets/template.erb copy b/tinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/assets/template.erb copy
deleted file mode 100755
index a90f495e..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/assets/template.erb copy
+++ /dev/null
@@ -1,59 +0,0 @@
-% ignored = hash[:results][:counts][:ignored]
-% failed = hash[:results][:counts][:failed]
-% stdout_count = hash[:results][:counts][:stdout]
-% header_prepend = ((hash[:header].length > 0) ? "#{hash[:header]}: " : '')
-% banner_width = 25 + header_prepend.length # widest message
-
-
-% if (stdout_count > 0)
-[==========] Running <%=hash[:results][:counts][:total].to_s%> tests from <%=hash[:results][:stdout].length.to_s%> test cases.
-[----------] Global test environment set-up.
-% end
-% if (failed > 0)
-% hash[:results][:failures].each do |failure|
-[----------] <%=failure[:collection].length.to_s%> tests from <%=failure[:source][:file]%>
-% failure[:collection].each do |item|
-[ RUN ] <%=failure[:source][:file]%>.<%=item[:test]%>
-% if (not item[:message].empty?)
-<%=failure[:source][:file]%>(<%=item[:line]%>): error: <%=item[:message]%>
-
-% m = item[:message].match(/Expected\s+(.*)\s+Was\s+([^\.]*)\./)
-% if m.nil?
- Actual: FALSE
- Expected: TRUE
-% else
- Actual: <%=m[2]%>
- Expected: <%=m[1]%>
-% end
-% else
-<%=failure[:source][:file]%>(<%=item[:line]%>): fail: <%=item[:message]%>
- Actual: FALSE
- Expected: TRUE
-% end
-[ FAILED ] <%=failure[:source][:file]%>.<%=item[:test]%> (0 ms)
-% end
-[----------] <%=failure[:collection].length.to_s%> tests from <%=failure[:source][:file]%> (0 ms total)
-% end
-% end
-% if (hash[:results][:counts][:total] > 0)
-[----------] Global test environment tear-down.
-[==========] <%=hash[:results][:counts][:total].to_s%> tests from <%=hash[:results][:stdout].length.to_s%> test cases ran.
-[ PASSED ] <%=hash[:results][:counts][:passed].to_s%> tests.
-% if (failed == 0)
-[ FAILED ] 0 tests.
-
- 0 FAILED TESTS
-% else
-[ FAILED ] <%=failed.to_s%> tests, listed below:
-% hash[:results][:failures].each do |failure|
-% failure[:collection].each do |item|
-[ FAILED ] <%=failure[:source][:file]%>.<%=item[:test]%>
-% end
-% end
-
- <%=failed.to_s%> FAILED TESTS
-% end
-% else
-
-No tests executed.
-% end
diff --git a/tinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/config/stdout_gtestlike_tests_report.yml b/tinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/config/stdout_gtestlike_tests_report.yml
deleted file mode 100755
index c25acf51..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/config/stdout_gtestlike_tests_report.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-:plugins:
- # tell Ceedling we got results display taken care of
- :display_raw_test_results: FALSE
diff --git a/tinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/lib/stdout_gtestlike_tests_report.rb b/tinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/lib/stdout_gtestlike_tests_report.rb
deleted file mode 100755
index a51438a3..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/stdout_gtestlike_tests_report/lib/stdout_gtestlike_tests_report.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/defaults'
-
-class StdoutGtestlikeTestsReport < Plugin
-
- def setup
- @result_list = []
- @plugin_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
- template = @ceedling[:file_wrapper].read(File.join(@plugin_root, 'assets/template.erb'))
- @ceedling[:plugin_reportinator].register_test_results_template( template )
- end
-
- def post_test_fixture_execute(arg_hash)
- return if not (arg_hash[:context] == TEST_SYM)
-
- @result_list << arg_hash[:result_file]
- end
-
- def post_build
- return if not (@ceedling[:task_invoker].test_invoked?)
-
- results = @ceedling[:plugin_reportinator].assemble_test_results(@result_list)
- hash = {
- :header => '',
- :results => results
- }
-
- @ceedling[:plugin_reportinator].run_test_results_report(hash)
- end
-
- def summary
- result_list = @ceedling[:file_path_utils].form_pass_results_filelist( PROJECT_TEST_RESULTS_PATH, COLLECTION_ALL_TESTS )
-
- # get test results for only those tests in our configuration and of those only tests with results on disk
- hash = {
- :header => '',
- :results => @ceedling[:plugin_reportinator].assemble_test_results(result_list, {:boom => false})
- }
-
- @ceedling[:plugin_reportinator].run_test_results_report(hash)
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/stdout_ide_tests_report/config/stdout_ide_tests_report.yml b/tinyusb/test/vendor/ceedling/plugins/stdout_ide_tests_report/config/stdout_ide_tests_report.yml
deleted file mode 100755
index c25acf51..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/stdout_ide_tests_report/config/stdout_ide_tests_report.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-:plugins:
- # tell Ceedling we got results display taken care of
- :display_raw_test_results: FALSE
diff --git a/tinyusb/test/vendor/ceedling/plugins/stdout_ide_tests_report/lib/stdout_ide_tests_report.rb b/tinyusb/test/vendor/ceedling/plugins/stdout_ide_tests_report/lib/stdout_ide_tests_report.rb
deleted file mode 100755
index 48b3e819..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/stdout_ide_tests_report/lib/stdout_ide_tests_report.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/defaults'
-
-class StdoutIdeTestsReport < Plugin
-
- def setup
- @result_list = []
- end
-
- def post_test_fixture_execute(arg_hash)
- return if not (arg_hash[:context] == TEST_SYM)
-
- @result_list << arg_hash[:result_file]
- end
-
- def post_build
- return if (not @ceedling[:task_invoker].test_invoked?)
-
- results = @ceedling[:plugin_reportinator].assemble_test_results(@result_list)
- hash = {
- :header => '',
- :results => results
- }
-
- @ceedling[:plugin_reportinator].run_test_results_report(hash) do
- message = ''
- message = 'Unit test failures.' if (hash[:results][:counts][:failed] > 0)
- message
- end
- end
-
- def summary
- result_list = @ceedling[:file_path_utils].form_pass_results_filelist( PROJECT_TEST_RESULTS_PATH, COLLECTION_ALL_TESTS )
-
- # get test results for only those tests in our configuration and of those only tests with results on disk
- hash = {
- :header => '',
- :results => @ceedling[:plugin_reportinator].assemble_test_results(result_list, {:boom => false})
- }
-
- @ceedling[:plugin_reportinator].run_test_results_report(hash)
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/stdout_pretty_tests_report/assets/template.erb b/tinyusb/test/vendor/ceedling/plugins/stdout_pretty_tests_report/assets/template.erb
deleted file mode 100755
index 52b29f7f..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/stdout_pretty_tests_report/assets/template.erb
+++ /dev/null
@@ -1,59 +0,0 @@
-% ignored = hash[:results][:counts][:ignored]
-% failed = hash[:results][:counts][:failed]
-% stdout_count = hash[:results][:counts][:stdout]
-% header_prepend = ((hash[:header].length > 0) ? "#{hash[:header]}: " : '')
-% banner_width = 25 + header_prepend.length # widest message
-
-% if (stdout_count > 0)
-<%=@ceedling[:plugin_reportinator].generate_banner(header_prepend + 'TEST OUTPUT')%>
-% hash[:results][:stdout].each do |string|
-[<%=string[:source][:file]%>]
-% string[:collection].each do |item|
- - "<%=item%>"
-% end
-
-% end
-% end
-% if (ignored > 0)
-<%=@ceedling[:plugin_reportinator].generate_banner(header_prepend + 'IGNORED TEST SUMMARY')%>
-% hash[:results][:ignores].each do |ignore|
-[<%=ignore[:source][:file]%>]
-% ignore[:collection].each do |item|
- Test: <%=item[:test]%>
-% if (not item[:message].empty?)
- At line (<%=item[:line]%>): "<%=item[:message]%>"
-% else
- At line (<%=item[:line]%>)
-% end
-
-% end
-% end
-% end
-% if (failed > 0)
-<%=@ceedling[:plugin_reportinator].generate_banner(header_prepend + 'FAILED TEST SUMMARY')%>
-% hash[:results][:failures].each do |failure|
-[<%=failure[:source][:file]%>]
-% failure[:collection].each do |item|
- Test: <%=item[:test]%>
-% if (not item[:message].empty?)
- At line (<%=item[:line]%>): "<%=item[:message]%>"
-% else
- At line (<%=item[:line]%>)
-% end
-
-% end
-% end
-% end
-% total_string = hash[:results][:counts][:total].to_s
-% format_string = "%#{total_string.length}i"
-<%=@ceedling[:plugin_reportinator].generate_banner(header_prepend + 'OVERALL TEST SUMMARY')%>
-% if (hash[:results][:counts][:total] > 0)
-TESTED: <%=hash[:results][:counts][:total].to_s%>
-PASSED: <%=sprintf(format_string, hash[:results][:counts][:passed])%>
-FAILED: <%=sprintf(format_string, failed)%>
-IGNORED: <%=sprintf(format_string, ignored)%>
-% else
-
-No tests executed.
-% end
-
diff --git a/tinyusb/test/vendor/ceedling/plugins/stdout_pretty_tests_report/config/stdout_pretty_tests_report.yml b/tinyusb/test/vendor/ceedling/plugins/stdout_pretty_tests_report/config/stdout_pretty_tests_report.yml
deleted file mode 100755
index c25acf51..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/stdout_pretty_tests_report/config/stdout_pretty_tests_report.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-:plugins:
- # tell Ceedling we got results display taken care of
- :display_raw_test_results: FALSE
diff --git a/tinyusb/test/vendor/ceedling/plugins/stdout_pretty_tests_report/lib/stdout_pretty_tests_report.rb b/tinyusb/test/vendor/ceedling/plugins/stdout_pretty_tests_report/lib/stdout_pretty_tests_report.rb
deleted file mode 100755
index 018388fc..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/stdout_pretty_tests_report/lib/stdout_pretty_tests_report.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/defaults'
-
-class StdoutPrettyTestsReport < Plugin
-
- def setup
- @result_list = []
- @plugin_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
- template = @ceedling[:file_wrapper].read(File.join(@plugin_root, 'assets/template.erb'))
- @ceedling[:plugin_reportinator].register_test_results_template( template )
- end
-
- def post_test_fixture_execute(arg_hash)
- return if not (arg_hash[:context] == TEST_SYM)
-
- @result_list << arg_hash[:result_file]
- end
-
- def post_build
- return if not (@ceedling[:task_invoker].test_invoked?)
-
- results = @ceedling[:plugin_reportinator].assemble_test_results(@result_list)
- hash = {
- :header => '',
- :results => results
- }
-
- @ceedling[:plugin_reportinator].run_test_results_report(hash) do
- message = ''
- message = 'Unit test failures.' if (results[:counts][:failed] > 0)
- message
- end
- end
-
- def summary
- result_list = @ceedling[:file_path_utils].form_pass_results_filelist( PROJECT_TEST_RESULTS_PATH, COLLECTION_ALL_TESTS )
-
- # get test results for only those tests in our configuration and of those only tests with results on disk
- hash = {
- :header => '',
- :results => @ceedling[:plugin_reportinator].assemble_test_results(result_list, {:boom => false})
- }
-
- @ceedling[:plugin_reportinator].run_test_results_report(hash)
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/subprojects/README.md b/tinyusb/test/vendor/ceedling/plugins/subprojects/README.md
deleted file mode 100755
index e51a4e60..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/subprojects/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-ceedling-subprojects
-====================
-
-Plugin for supporting subprojects that are built as static libraries. It continues to support
-dependency tracking, without getting confused between your main project files and your
-subproject files. It accepts different compiler flags and linker flags, allowing you to
-optimize for your situation.
-
-First, you're going to want to add the extension to your list of known extensions:
-
-```
-:extension:
- :subprojects: '.a'
-```
-
-Define a new section called :subprojects. There, you can list as many subprojects
-as you may need under the :paths key. For each, you specify a unique place to build
-and a unique name.
-
-```
-:subprojects:
- :paths:
- - :name: libprojectA
- :source:
- - ./subprojectA/first/dir
- - ./subprojectA/second/dir
- :include:
- - ./subprojectA/include/dir
- :build_root: ./subprojectA/build/dir
- :defines:
- - DEFINE_JUST_FOR_THIS_FILE
- - AND_ANOTHER
- - :name: libprojectB
- :source:
- - ./subprojectB/only/dir
- :include:
- - ./subprojectB/first/include/dir
- - ./subprojectB/second/include/dir
- :build_root: ./subprojectB/build/dir
- :defines: [] #none for this one
-```
-
-You can specify the compiler and linker, just as you would a release build:
-
-```
-:tools:
- :subprojects_compiler:
- :executable: gcc
- :arguments:
- - -g
- - -I"$": COLLECTION_PATHS_SUBPROJECTS
- - -D$: COLLECTION_DEFINES_SUBPROJECTS
- - -c "${1}"
- - -o "${2}"
- :subprojects_linker:
- :executable: ar
- :arguments:
- - rcs
- - ${2}
- - ${1}
-```
-
-That's all there is to it! Happy Hacking!
diff --git a/tinyusb/test/vendor/ceedling/plugins/subprojects/config/defaults.yml b/tinyusb/test/vendor/ceedling/plugins/subprojects/config/defaults.yml
deleted file mode 100755
index 1045a595..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/subprojects/config/defaults.yml
+++ /dev/null
@@ -1,33 +0,0 @@
----
-#:extension:
-# :subprojects: '.a'
-
-:subprojects:
- :paths: []
-# - :name: subprojectA
-# :source:
-# - ./first/subproject/dir
-# - ./second/subproject/dir
-# :include:
-# - ./first/include/dir
-# :build_root: ./subproject/build/dir
-# :defines:
-# - FIRST_DEFINE
-
-:tools:
- :subprojects_compiler:
- :executable: gcc
- :arguments:
- - -g
- - -I"$": COLLECTION_PATHS_SUBPROJECTS
- - -D$: COLLECTION_DEFINES_SUBPROJECTS
- - -c "${1}"
- - -o "${2}"
- :subprojects_linker:
- :executable: ar
- :arguments:
- - rcs
- - ${2}
- - ${1}
-
-...
diff --git a/tinyusb/test/vendor/ceedling/plugins/subprojects/lib/subprojects.rb b/tinyusb/test/vendor/ceedling/plugins/subprojects/lib/subprojects.rb
deleted file mode 100755
index 1f5d4c2f..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/subprojects/lib/subprojects.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/constants'
-
-SUBPROJECTS_ROOT_NAME = 'subprojects'
-SUBPROJECTS_TASK_ROOT = SUBPROJECTS_ROOT_NAME + ':'
-SUBPROJECTS_SYM = SUBPROJECTS_ROOT_NAME.to_sym
-
-class Subprojects < Plugin
-
- def setup
- @plugin_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
-
- # Add to the test paths
- SUBPROJECTS_PATHS.each do |subproj|
- subproj[:source].each do |path|
- COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR << path
- end
- subproj[:include].each do |path|
- COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR << path
- end
- end
-
- #gather information about the subprojects
- @subprojects = {}
- @subproject_lookup_by_path = {}
- SUBPROJECTS_PATHS.each do |subproj|
- @subprojects[ subproj[:name] ] = subproj.clone
- @subprojects[ subproj[:name] ][:c] = []
- @subprojects[ subproj[:name] ][:asm] = []
- subproj[:source].each do |path|
- search_path = "#{path[-1].match(/\\|\//) ? path : "#{path}/"}*#{EXTENSION_SOURCE}"
- @subprojects[ subproj[:name] ][:c] += Dir[search_path]
- if (EXTENSION_ASSEMBLY && !EXTENSION_ASSEMBLY.empty?)
- search_path = "#{path[-1].match(/\\|\//) ? path : "#{path}/"}*#{EXTENSION_ASSEMBLY}"
- @subprojects[ subproj[:name] ][:asm] += Dir[search_path]
- end
- end
- @subproject_lookup_by_path[ subproj[:build_root] ] = subproj[:name]
- end
- end
-
- def find_my_project( c_file, file_type = :c )
- @subprojects.each_pair do |subprojname, subproj|
- return subprojname if (subproj[file_type].include?(c_file))
- end
- end
-
- def find_my_paths( c_file, file_type = :c )
- @subprojects.each_pair do |subprojname, subproj|
- return (subproj[:source] + (subproj[:include] || [])) if (subproj[file_type].include?(c_file))
- end
- return []
- end
-
- def find_my_defines( c_file, file_type = :c )
- @subprojects.each_pair do |subprojname, subproj|
- return (subproj[:defines] || []) if (subproj[file_type].include?(c_file))
- end
- return []
- end
-
- def list_all_object_files_for_subproject( lib_name )
- subproj = File.basename(lib_name, EXTENSION_SUBPROJECTS)
- objpath = "#{@subprojects[subproj][:build_root]}/out/c"
- bbb = @subprojects[subproj][:c].map{|f| "#{objpath}/#{File.basename(f,EXTENSION_SOURCE)}#{EXTENSION_OBJECT}" }
- bbb
- end
-
- def find_library_source_file_for_object( obj_name )
- cname = "#{File.basename(obj_name, EXTENSION_OBJECT)}#{EXTENSION_SOURCE}"
- dname = File.dirname(obj_name)[0..-7]
- pname = @subproject_lookup_by_path[dname]
- return @ceedling[:file_finder].find_file_from_list(cname, @subprojects[pname][:c], :error)
- end
-
- def find_library_assembly_file_for_object( obj_name )
- cname = "#{File.basename(obj_name, EXTENSION_OBJECT)}#{EXTENSION_ASEMBLY}"
- dname = File.dirname(obj_name)[0..-7]
- pname = @subproject_lookup_by_path[dname]
- return @ceedling[:file_finder].find_file_from_list(cname, @subprojects[pname][:asm], :error)
- end
-
- def replace_constant(constant, new_value)
- Object.send(:remove_const, constant.to_sym) if (Object.const_defined? constant)
- Object.const_set(constant, new_value)
- end
-
-end
-
-# end blocks always executed following rake run
-END {
-}
diff --git a/tinyusb/test/vendor/ceedling/plugins/subprojects/subprojects.rake b/tinyusb/test/vendor/ceedling/plugins/subprojects/subprojects.rake
deleted file mode 100755
index 0025c3ec..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/subprojects/subprojects.rake
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-SUBPROJECTS_PATHS.each do |subproj|
-
- subproj_source = subproj[:source]
- subproj_include = subproj[:include]
- subproj_name = subproj[:name]
- subproj_build_root = subproj[:build_root]
- subproj_build_out = "#{subproj[:build_root]}/out"
- subproj_build_c = "#{subproj[:build_root]}/out/c"
- subproj_build_asm = "#{subproj[:build_root]}/out/asm"
- subproj_directories = [ subproj_build_root, subproj_build_out, subproj_build_c, subproj_build_asm ]
-
- subproj_directories.each do |subdir|
- directory(subdir)
- end
-
- CLEAN.include(File.join(subproj_build_root, '*'))
- CLEAN.include(File.join(subproj_build_out, '*'))
-
- CLOBBER.include(File.join(subproj_build_root, '**/*'))
-
- # Add a rule for building the actual static library from our object files
- rule(/#{subproj_build_root}#{'.+\\'+EXTENSION_SUBPROJECTS}$/ => [
- proc do |task_name|
- @ceedling[SUBPROJECTS_SYM].list_all_object_files_for_subproject(task_name)
- end
- ]) do |bin_file|
- @ceedling[:generator].generate_executable_file(
- TOOLS_SUBPROJECTS_LINKER,
- SUBPROJECTS_SYM,
- bin_file.prerequisites,
- bin_file.name,
- @ceedling[:file_path_utils].form_test_build_map_filepath(bin_file.name))
- end
-
- # Add a rule for building object files from assembly files to link into a library
- if (RELEASE_BUILD_USE_ASSEMBLY)
- rule(/#{subproj_build_asm}#{'.+\\'+EXTENSION_OBJECT}$/ => [
- proc do |task_name|
- @ceedling[SUBPROJECTS_SYM].find_library_assembly_file_for_object(task_name)
- end
- ]) do |object|
- @ceedling[SUBPROJECTS_SYM].replace_constant(:COLLECTION_PATHS_SUBPROJECTS, @ceedling[SUBPROJECTS_SYM].find_my_paths(object.source, :asm))
- @ceedling[SUBPROJECTS_SYM].replace_constant(:COLLECTION_DEFINES_SUBPROJECTS, @ceedling[SUBPROJECTS_SYM].find_my_defines(object.source, :asm))
- @ceedling[:generator].generate_object_file(
- TOOLS_SUBPROJECTS_ASSEMBLER,
- OPERATION_ASSEMBLE_SYM,
- SUBPROJECTS_SYM,
- object.source,
- object.name )
- end
- end
-
- # Add a rule for building object files from C files to link into a library
- rule(/#{subproj_build_c}#{'.+\\'+EXTENSION_OBJECT}$/ => [
- proc do |task_name|
- @ceedling[SUBPROJECTS_SYM].find_library_source_file_for_object(task_name)
- end
- ]) do |object|
- @ceedling[SUBPROJECTS_SYM].replace_constant(:COLLECTION_PATHS_SUBPROJECTS, @ceedling[SUBPROJECTS_SYM].find_my_paths(object.source, :c))
- @ceedling[SUBPROJECTS_SYM].replace_constant(:COLLECTION_DEFINES_SUBPROJECTS, @ceedling[SUBPROJECTS_SYM].find_my_defines(object.source, :c))
- @ceedling[:generator].generate_object_file(
- TOOLS_SUBPROJECTS_COMPILER,
- OPERATION_COMPILE_SYM,
- SUBPROJECTS_SYM,
- object.source,
- object.name,
- @ceedling[:file_path_utils].form_release_build_c_list_filepath( object.name ) )
- end
-
- # Add the subdirectories involved to our list of those that should be autogenerated
- task :directories => subproj_directories.clone
-
- # Finally, add the static library to our RELEASE build dependency list
- task RELEASE_SYM => ["#{subproj_build_root}/#{subproj_name}#{EXTENSION_SUBPROJECTS}"]
-end
-
diff --git a/tinyusb/test/vendor/ceedling/plugins/teamcity_tests_report/config/teamcity_tests_report.yml b/tinyusb/test/vendor/ceedling/plugins/teamcity_tests_report/config/teamcity_tests_report.yml
deleted file mode 100755
index c25acf51..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/teamcity_tests_report/config/teamcity_tests_report.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-:plugins:
- # tell Ceedling we got results display taken care of
- :display_raw_test_results: FALSE
diff --git a/tinyusb/test/vendor/ceedling/plugins/teamcity_tests_report/lib/teamcity_tests_report.rb b/tinyusb/test/vendor/ceedling/plugins/teamcity_tests_report/lib/teamcity_tests_report.rb
deleted file mode 100755
index 33d8548f..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/teamcity_tests_report/lib/teamcity_tests_report.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/defaults'
-
-class TeamcityTestsReport < Plugin
-
- def setup
- @suite_started = nil
- @output_enabled = !defined?(TEAMCITY_BUILD) || TEAMCITY_BUILD
- end
-
- def escape(string)
- string.gsub(/['|\[\]]/, '|\0').gsub('\r', '|r').gsub('\n', '|n')
- end
-
- def pre_test(test)
- teamcity_message "testSuiteStarted name='#{File.basename(test, '.c')}'"
- @suite_started = Time.now
- end
-
- def post_test(test)
- teamcity_message "testSuiteFinished name='#{File.basename(test, '.c')}'"
- end
-
- def post_test_fixture_execute(arg_hash)
- duration = (Time.now - @suite_started) * 1000
- results = @ceedling[:plugin_reportinator].assemble_test_results([arg_hash[:result_file]])
- avg_duration = (duration / [1, results[:counts][:passed] + results[:counts][:failed]].max).round
-
- results[:successes].each do |success|
- success[:collection].each do |test|
- teamcity_message "testStarted name='#{test[:test]}'"
- teamcity_message "testFinished name='#{test[:test]}' duration='#{avg_duration}'"
- end
- end
-
- results[:failures].each do |failure|
- failure[:collection].each do |test|
- teamcity_message "testStarted name='#{test[:test]}'"
- teamcity_message "testFailed name='#{test[:test]}' message='#{escape(test[:message])}' details='File: #{failure[:source][:path]}/#{failure[:source][:file]} Line: #{test[:line]}'"
- teamcity_message "testFinished name='#{test[:test]}' duration='#{avg_duration}'"
- end
- end
-
- results[:ignores].each do |failure|
- failure[:collection].each do |test|
- teamcity_message "testIgnored name='#{test[:test]}' message='#{escape(test[:message])}'"
- end
- end
-
- # We ignore stdout
- end
-
- def teamcity_message(content)
- puts "##teamcity[#{content}]" unless !@output_enabled
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/warnings_report/lib/warnings_report.rb b/tinyusb/test/vendor/ceedling/plugins/warnings_report/lib/warnings_report.rb
deleted file mode 100755
index d4f43fb5..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/warnings_report/lib/warnings_report.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/constants'
-
-class WarningsReport < Plugin
- def setup
- @stderr_redirect = nil
- @log_paths = {}
- end
-
- def pre_compile_execute(arg_hash)
- # at beginning of compile, override tool's stderr_redirect so we can parse $stderr + $stdout
- set_stderr_redirect(arg_hash)
- end
-
- def post_compile_execute(arg_hash)
- # after compilation, grab output for parsing/logging, restore stderr_redirect, log warning if it exists
- output = arg_hash[:shell_result][:output]
- restore_stderr_redirect(arg_hash)
- write_warning_log(arg_hash[:context], output)
- end
-
- def pre_link_execute(arg_hash)
- # at beginning of link, override tool's stderr_redirect so we can parse $stderr + $stdout
- set_stderr_redirect(arg_hash)
- end
-
- def post_link_execute(arg_hash)
- # after linking, grab output for parsing/logging, restore stderr_redirect, log warning if it exists
- output = arg_hash[:shell_result][:output]
- restore_stderr_redirect(arg_hash)
- write_warning_log(arg_hash[:context], output)
- end
-
- private
-
- def set_stderr_redirect(hash)
- @stderr_redirect = hash[:tool][:stderr_redirect]
- hash[:tool][:stderr_redirect] = StdErrRedirect::AUTO
- end
-
- def restore_stderr_redirect(hash)
- hash[:tool][:stderr_redirect] = @stderr_redirect
- end
-
- def write_warning_log(context, output)
- # if $stderr/$stdout contain "warning", log it
- if output =~ /warning/i
- # generate a log path & file io write flags
- logging = generate_log_path(context)
- @ceedling[:file_wrapper].write(logging[:path], output + "\n", logging[:flags]) unless logging.nil?
- end
- end
-
- def generate_log_path(context)
- # if path has already been generated, return it & 'append' file io flags (append to log)
- return { path: @log_paths[context], flags: 'a' } unless @log_paths[context].nil?
-
- # first time through, generate path & 'write' file io flags (create new log)
- base_path = File.join(PROJECT_BUILD_ARTIFACTS_ROOT, context.to_s)
- file_path = File.join(base_path, 'warnings.log')
-
- if @ceedling[:file_wrapper].exist?(base_path)
- @log_paths[context] = file_path
- return { path: file_path, flags: 'w' }
- end
-
- nil
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/plugins/xml_tests_report/README.md b/tinyusb/test/vendor/ceedling/plugins/xml_tests_report/README.md
deleted file mode 100755
index ce81eadf..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/xml_tests_report/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-xml_tests_report
-====================
-
-## Overview
-
-The xml_tests_report plugin creates an XML file of test results in xUnit
-format, which is handy for Continuous Integration build servers or as input
-into other reporting tools. The XML file is output to the appropriate
-`<build_root>/artifacts/` directory (e.g. `artifacts/test/` for test tasks,
-`artifacts/gcov/` for gcov, or `artifacts/bullseye/` for bullseye runs).
-
-## Setup
-
-Enable the plugin in your project.yml by adding `xml_tests_report` to the list
-of enabled plugins.
-
-``` YAML
-:plugins:
- :enabled:
- - xml_tests_report
-```
-
-## Configuration
-
-Optionally configure the output / artifact filename in your project.yml with
-the `artifact_filename` configuration option. The default filename is
-`report.xml`.
-
-You can also configure the path that this artifact is stored. This can be done
-by setting `path`. The default is that it will be placed in a subfolder under
-the `build` directory.
-
-``` YAML
-:xml_tests_report:
- :artifact_filename: report_xunit.xml
-```
diff --git a/tinyusb/test/vendor/ceedling/plugins/xml_tests_report/lib/xml_tests_report.rb b/tinyusb/test/vendor/ceedling/plugins/xml_tests_report/lib/xml_tests_report.rb
deleted file mode 100755
index ed4e9960..00000000
--- a/tinyusb/test/vendor/ceedling/plugins/xml_tests_report/lib/xml_tests_report.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-require 'ceedling/plugin'
-require 'ceedling/constants'
-
-class XmlTestsReport < Plugin
- def setup
- @results_list = {}
- @test_counter = 0
- end
-
- def post_test_fixture_execute(arg_hash)
- context = arg_hash[:context]
-
- @results_list[context] = [] if @results_list[context].nil?
-
- @results_list[context] << arg_hash[:result_file]
- end
-
- def post_build
- @results_list.each_key do |context|
- results = @ceedling[:plugin_reportinator].assemble_test_results(@results_list[context])
-
- artifact_filename = @ceedling[:configurator].project_config_hash[:xml_tests_report_artifact_filename] || 'report.xml'
- artifact_fullpath = @ceedling[:configurator].project_config_hash[:xml_tests_report_path] || File.join(PROJECT_BUILD_ARTIFACTS_ROOT, context.to_s)
- file_path = File.join(artifact_fullpath, artifact_filename)
-
- @ceedling[:file_wrapper].open(file_path, 'w') do |f|
- @test_counter = 1
- write_results(results, f)
- end
- end
- end
-
- private
-
- def write_results(results, stream)
- write_header(stream)
- write_failures(results[:failures], stream)
- write_tests(results[:successes], stream, 'SuccessfulTests')
- write_tests(results[:ignores], stream, 'IgnoredTests')
- write_statistics(results[:counts], stream)
- write_footer(stream)
- end
-
- def write_header(stream)
- stream.puts "<?xml version='1.0' encoding='utf-8' ?>"
- stream.puts '<TestRun>'
- end
-
- def write_failures(results, stream)
- if results.size.zero?
- stream.puts "\t<FailedTests/>"
- return
- end
-
- stream.puts "\t<FailedTests>"
-
- results.each do |result|
- result[:collection].each do |item|
- filename = File.join(result[:source][:path], result[:source][:file])
-
- stream.puts "\t\t<Test id=\"#{@test_counter}\">"
- stream.puts "\t\t\t<Name>#{filename}::#{item[:test]}</Name>"
- stream.puts "\t\t\t<FailureType>Assertion</FailureType>"
- stream.puts "\t\t\t<Location>"
- stream.puts "\t\t\t\t<File>#{filename}</File>"
- stream.puts "\t\t\t\t<Line>#{item[:line]}</Line>"
- stream.puts "\t\t\t</Location>"
- stream.puts "\t\t\t<Message>#{item[:message]}</Message>"
- stream.puts "\t\t</Test>"
- @test_counter += 1
- end
- end
-
- stream.puts "\t</FailedTests>"
- end
-
- def write_tests(results, stream, tag)
- if results.size.zero?
- stream.puts "\t<#{tag}/>"
- return
- end
-
- stream.puts "\t<#{tag}>"
-
- results.each do |result|
- result[:collection].each do |item|
- stream.puts "\t\t<Test id=\"#{@test_counter}\">"
- stream.puts "\t\t\t<Name>#{File.join(result[:source][:path], result[:source][:file])}::#{item[:test]}</Name>"
- stream.puts "\t\t</Test>"
- @test_counter += 1
- end
- end
-
- stream.puts "\t</#{tag}>"
- end
-
- def write_statistics(counts, stream)
- stream.puts "\t<Statistics>"
- stream.puts "\t\t<Tests>#{counts[:total]}</Tests>"
- stream.puts "\t\t<Ignores>#{counts[:ignored]}</Ignores>"
- stream.puts "\t\t<FailuresTotal>#{counts[:failed]}</FailuresTotal>"
- stream.puts "\t\t<Errors>0</Errors>"
- stream.puts "\t\t<Failures>#{counts[:failed]}</Failures>"
- stream.puts "\t</Statistics>"
- end
-
- def write_footer(stream)
- stream.puts '</TestRun>'
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/c_exception/lib/CException.c b/tinyusb/test/vendor/ceedling/vendor/c_exception/lib/CException.c
deleted file mode 100755
index fdff8f47..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/c_exception/lib/CException.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "CException.h"
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
-volatile CEXCEPTION_FRAME_T CExceptionFrames[CEXCEPTION_NUM_ID] = {{ 0 }};
-#pragma GCC diagnostic pop
-
-//------------------------------------------------------------------------------------------
-// Throw
-//------------------------------------------------------------------------------------------
-void Throw(CEXCEPTION_T ExceptionID)
-{
- unsigned int MY_ID = CEXCEPTION_GET_ID;
- CExceptionFrames[MY_ID].Exception = ExceptionID;
- if (CExceptionFrames[MY_ID].pFrame)
- {
- longjmp(*CExceptionFrames[MY_ID].pFrame, 1);
- }
- CEXCEPTION_NO_CATCH_HANDLER(ExceptionID);
-}
-
-//------------------------------------------------------------------------------------------
-// Explanation of what it's all for:
-//------------------------------------------------------------------------------------------
-/*
-#define Try
- { <- give us some local scope. most compilers are happy with this
- jmp_buf *PrevFrame, NewFrame; <- prev frame points to the last try block's frame. new frame gets created on stack for this Try block
- unsigned int MY_ID = CEXCEPTION_GET_ID; <- look up this task's id for use in frame array. always 0 if single-tasking
- PrevFrame = CExceptionFrames[CEXCEPTION_GET_ID].pFrame; <- set pointer to point at old frame (which array is currently pointing at)
- CExceptionFrames[MY_ID].pFrame = &NewFrame; <- set array to point at my new frame instead, now
- CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; <- initialize my exception id to be NONE
- if (setjmp(NewFrame) == 0) { <- do setjmp. it returns 1 if longjump called, otherwise 0
- if (&PrevFrame) <- this is here to force proper scoping. it requires braces or a single line to be but after Try, otherwise won't compile. This is always true at this point.
-
-#define Catch(e)
- else { } <- this also forces proper scoping. Without this they could stick their own 'else' in and it would get ugly
- CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; <- no errors happened, so just set the exception id to NONE (in case it was corrupted)
- }
- else <- an exception occurred
- { e = CExceptionFrames[MY_ID].Exception; e=e;} <- assign the caught exception id to the variable passed in.
- CExceptionFrames[MY_ID].pFrame = PrevFrame; <- make the pointer in the array point at the previous frame again, as if NewFrame never existed.
- } <- finish off that local scope we created to have our own variables
- if (CExceptionFrames[CEXCEPTION_GET_ID].Exception != CEXCEPTION_NONE) <- start the actual 'catch' processing if we have an exception id saved away
- */
-
diff --git a/tinyusb/test/vendor/ceedling/vendor/c_exception/lib/CException.h b/tinyusb/test/vendor/ceedling/vendor/c_exception/lib/CException.h
deleted file mode 100755
index 78f2f940..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/c_exception/lib/CException.h
+++ /dev/null
@@ -1,115 +0,0 @@
-#ifndef _CEXCEPTION_H
-#define _CEXCEPTION_H
-
-#include <setjmp.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-#define CEXCEPTION_VERSION_MAJOR 1
-#define CEXCEPTION_VERSION_MINOR 3
-#define CEXCEPTION_VERSION_BUILD 2
-#define CEXCEPTION_VERSION ((CEXCEPTION_VERSION_MAJOR << 16) | (CEXCEPTION_VERSION_MINOR << 8) | CEXCEPTION_VERSION_BUILD)
-
-//To Use CException, you have a number of options:
-//1. Just include it and run with the defaults
-//2. Define any of the following symbols at the command line to override them
-//3. Include a header file before CException.h everywhere which defines any of these
-//4. Create an Exception.h in your path, and just define EXCEPTION_USE_CONFIG_FILE first
-
-#ifdef CEXCEPTION_USE_CONFIG_FILE
-#include "CExceptionConfig.h"
-#endif
-
-//This is the value to assign when there isn't an exception
-#ifndef CEXCEPTION_NONE
-#define CEXCEPTION_NONE (0x5A5A5A5A)
-#endif
-
-//This is number of exception stacks to keep track of (one per task)
-#ifndef CEXCEPTION_NUM_ID
-#define CEXCEPTION_NUM_ID (1) //there is only the one stack by default
-#endif
-
-//This is the method of getting the current exception stack index (0 if only one stack)
-#ifndef CEXCEPTION_GET_ID
-#define CEXCEPTION_GET_ID (0) //use the first index always because there is only one anyway
-#endif
-
-//The type to use to store the exception values.
-#ifndef CEXCEPTION_T
-#define CEXCEPTION_T unsigned int
-#endif
-
-//This is an optional special handler for when there is no global Catch
-#ifndef CEXCEPTION_NO_CATCH_HANDLER
-#define CEXCEPTION_NO_CATCH_HANDLER(id)
-#endif
-
-//These hooks allow you to inject custom code into places, particularly useful for saving and restoring additional state
-#ifndef CEXCEPTION_HOOK_START_TRY
-#define CEXCEPTION_HOOK_START_TRY
-#endif
-#ifndef CEXCEPTION_HOOK_HAPPY_TRY
-#define CEXCEPTION_HOOK_HAPPY_TRY
-#endif
-#ifndef CEXCEPTION_HOOK_AFTER_TRY
-#define CEXCEPTION_HOOK_AFTER_TRY
-#endif
-#ifndef CEXCEPTION_HOOK_START_CATCH
-#define CEXCEPTION_HOOK_START_CATCH
-#endif
-
-//exception frame structures
-typedef struct {
- jmp_buf* pFrame;
- CEXCEPTION_T volatile Exception;
-} CEXCEPTION_FRAME_T;
-
-//actual root frame storage (only one if single-tasking)
-extern volatile CEXCEPTION_FRAME_T CExceptionFrames[];
-
-//Try (see C file for explanation)
-#define Try \
- { \
- jmp_buf *PrevFrame, NewFrame; \
- unsigned int MY_ID = CEXCEPTION_GET_ID; \
- PrevFrame = CExceptionFrames[MY_ID].pFrame; \
- CExceptionFrames[MY_ID].pFrame = (jmp_buf*)(&NewFrame); \
- CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; \
- CEXCEPTION_HOOK_START_TRY; \
- if (setjmp(NewFrame) == 0) { \
- if (1)
-
-//Catch (see C file for explanation)
-#define Catch(e) \
- else { } \
- CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; \
- CEXCEPTION_HOOK_HAPPY_TRY; \
- } \
- else \
- { \
- e = CExceptionFrames[MY_ID].Exception; \
- (void)e; \
- CEXCEPTION_HOOK_START_CATCH; \
- } \
- CExceptionFrames[MY_ID].pFrame = PrevFrame; \
- CEXCEPTION_HOOK_AFTER_TRY; \
- } \
- if (CExceptionFrames[CEXCEPTION_GET_ID].Exception != CEXCEPTION_NONE)
-
-//Throw an Error
-void Throw(CEXCEPTION_T ExceptionID);
-
-//Just exit the Try block and skip the Catch.
-#define ExitTry() Throw(CEXCEPTION_NONE)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-
-#endif // _CEXCEPTION_H
diff --git a/tinyusb/test/vendor/ceedling/vendor/c_exception/release/build.info b/tinyusb/test/vendor/ceedling/vendor/c_exception/release/build.info
deleted file mode 100755
index 0cd525d8..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/c_exception/release/build.info
+++ /dev/null
@@ -1,2 +0,0 @@
-18
-
diff --git a/tinyusb/test/vendor/ceedling/vendor/c_exception/release/version.info b/tinyusb/test/vendor/ceedling/vendor/c_exception/release/version.info
deleted file mode 100755
index 1527a8de..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/c_exception/release/version.info
+++ /dev/null
@@ -1,2 +0,0 @@
-1.3.1
-
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/config/production_environment.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/config/production_environment.rb
deleted file mode 100755
index 915582b7..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/config/production_environment.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-# Setup our load path:
-[
- 'lib',
-].each do |dir|
- $LOAD_PATH.unshift( File.join( File.expand_path(File.dirname(__FILE__)) + '/../', dir) )
-end
-
-
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/config/test_environment.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/config/test_environment.rb
deleted file mode 100755
index fe1ed817..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/config/test_environment.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-# Setup our load path:
-[
- './lib',
- './vendor/behaviors/lib',
- './vendor/hardmock/lib',
- './vendor/unity/auto/',
- './test/system/'
-].each do |dir|
- $LOAD_PATH.unshift( File.join( File.expand_path(File.dirname(__FILE__) + "/../"), dir) )
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock.rb
deleted file mode 100755
index 8243ce58..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-[ "../config/production_environment",
- "cmock_header_parser",
- "cmock_generator",
- "cmock_file_writer",
- "cmock_config",
- "cmock_plugin_manager",
- "cmock_generator_utils",
- "cmock_unityhelper_parser"].each {|req| require "#{File.expand_path(File.dirname(__FILE__))}/#{req}"}
-
-class CMock
-
- def initialize(options=nil)
- cm_config = CMockConfig.new(options)
- cm_unityhelper = CMockUnityHelperParser.new(cm_config)
- cm_writer = CMockFileWriter.new(cm_config)
- cm_gen_utils = CMockGeneratorUtils.new(cm_config, {:unity_helper => cm_unityhelper})
- cm_gen_plugins = CMockPluginManager.new(cm_config, cm_gen_utils)
- @cm_parser = CMockHeaderParser.new(cm_config)
- @cm_generator = CMockGenerator.new(cm_config, cm_writer, cm_gen_utils, cm_gen_plugins)
- @silent = (cm_config.verbosity < 2)
- end
-
- def setup_mocks(files)
- [files].flatten.each do |src|
- generate_mock src
- end
- end
-
- private ###############################
-
- def generate_mock(src)
- name = File.basename(src, '.h')
- puts "Creating mock for #{name}..." unless @silent
- @cm_generator.create_mock(name, @cm_parser.parse(name, File.read(src)))
- end
-end
-
-def option_maker(options, key, val)
- options = options || {}
- options[key.to_sym] =
- if val.chr == ":"
- val[1..-1].to_sym
- elsif val.include? ";"
- val.split(';')
- elsif val == 'true'
- true
- elsif val == 'false'
- false
- elsif val =~ /^\d+$/
- val.to_i
- else
- val
- end
- options
-end
-
- # Command Line Support ###############################
-
-if ($0 == __FILE__)
- usage = "usage: ruby #{__FILE__} (-oOptionsFile) File(s)ToMock"
-
- if (!ARGV[0])
- puts usage
- exit 1
- end
-
- options = {}
- filelist = []
- ARGV.each do |arg|
- if (arg =~ /^-o\"?([a-zA-Z0-9._\\\/:\s]+)\"?/)
- options.merge! CMockConfig.load_config_file_from_yaml( arg.gsub(/^-o/,'') )
- elsif (arg =~ /^--([a-zA-Z0-9._\\\/:\s]+)=\"?([a-zA-Z0-9._\-\\\/:\s\;]+)\"?/)
- options = option_maker(options, $1, $2)
- else
- filelist << arg
- end
- end
-
- CMock.new(options).setup_mocks(filelist)
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_config.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_config.rb
deleted file mode 100755
index b21b61ed..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_config.rb
+++ /dev/null
@@ -1,153 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class CMockConfig
-
- CMockDefaultOptions =
- {
- :framework => :unity,
- :mock_path => 'mocks',
- :mock_prefix => 'Mock',
- :mock_suffix => '',
- :weak => '',
- :subdir => nil,
- :plugins => [],
- :strippables => ['(?:__attribute__\s*\(+.*?\)+)'],
- :attributes => ['__ramfunc', '__irq', '__fiq', 'register', 'extern'],
- :c_calling_conventions => ['__stdcall', '__cdecl', '__fastcall'],
- :enforce_strict_ordering => false,
- :fail_on_unexpected_calls => true,
- :unity_helper_path => false,
- :treat_as => {},
- :treat_as_array => {},
- :treat_as_void => [],
- :memcmp_if_unknown => true,
- :when_no_prototypes => :warn, #the options being :ignore, :warn, or :error
- :when_ptr => :compare_data, #the options being :compare_ptr, :compare_data, or :smart
- :verbosity => 2, #the options being 0 errors only, 1 warnings and errors, 2 normal info, 3 verbose
- :treat_externs => :exclude, #the options being :include or :exclude
- :callback_include_count => true,
- :callback_after_arg_check => false,
- :includes => nil,
- :includes_h_pre_orig_header => nil,
- :includes_h_post_orig_header => nil,
- :includes_c_pre_header => nil,
- :includes_c_post_header => nil,
- :orig_header_include_fmt => "#include \"%s\"",
- :array_size_type => [],
- :array_size_name => 'size|len',
- }
-
- def initialize(options=nil)
- case(options)
- when NilClass then options = CMockDefaultOptions.clone
- when String then options = CMockDefaultOptions.clone.merge(load_config_file_from_yaml(options))
- when Hash then options = CMockDefaultOptions.clone.merge(options)
- else raise "If you specify arguments, it should be a filename or a hash of options"
- end
-
- #do some quick type verification
- [:plugins, :attributes, :treat_as_void].each do |opt|
- unless (options[opt].class == Array)
- options[opt] = []
- puts "WARNING: :#{opt.to_s} should be an array." unless (options[:verbosity] < 1)
- end
- end
- [:includes, :includes_h_pre_orig_header, :includes_h_post_orig_header, :includes_c_pre_header, :includes_c_post_header].each do |opt|
- unless (options[opt].nil? or (options[opt].class == Array))
- options[opt] = []
- puts "WARNING: :#{opt.to_s} should be an array." unless (options[:verbosity] < 1)
- end
- end
- options[:unity_helper_path] ||= options[:unity_helper]
- options[:unity_helper_path] = [options[:unity_helper_path]] if options[:unity_helper_path].is_a? String
- options[:includes_c_post_header] = ((options[:includes_c_post_header] || []) + (options[:unity_helper_path] || [])).uniq
- options[:plugins].compact!
- options[:plugins].map! {|p| p.to_sym}
- @options = options
-
- treat_as_map = standard_treat_as_map()#.clone
- treat_as_map.merge!(@options[:treat_as])
- @options[:treat_as] = treat_as_map
-
- @options.each_key do |key|
- unless methods.include?(key)
- eval("def #{key.to_s}() return @options[:#{key.to_s}] end")
- end
- end
- end
-
- def load_config_file_from_yaml yaml_filename
- self.class.load_config_file_from_yaml yaml_filename
- end
-
- def self.load_config_file_from_yaml yaml_filename
- require 'yaml'
- require 'fileutils'
- YAML.load_file(yaml_filename)[:cmock]
- end
-
- def set_path(path)
- @src_path = path
- end
-
- def load_unity_helper
- return nil unless (@options[:unity_helper_path])
-
- return @options[:unity_helper_path].inject("") do |unity_helper, filename|
- unity_helper + "\n" + File.new(filename).read
- end
- end
-
- def standard_treat_as_map
- {
- 'int' => 'INT',
- 'char' => 'INT8',
- 'short' => 'INT16',
- 'long' => 'INT',
- 'int8' => 'INT8',
- 'int16' => 'INT16',
- 'int32' => 'INT',
- 'int8_t' => 'INT8',
- 'int16_t' => 'INT16',
- 'int32_t' => 'INT',
- 'INT8_T' => 'INT8',
- 'INT16_T' => 'INT16',
- 'INT32_T' => 'INT',
- 'bool' => 'INT',
- 'bool_t' => 'INT',
- 'BOOL' => 'INT',
- 'BOOL_T' => 'INT',
- 'unsigned int' => 'HEX32',
- 'unsigned long' => 'HEX32',
- 'uint32' => 'HEX32',
- 'uint32_t' => 'HEX32',
- 'UINT32' => 'HEX32',
- 'UINT32_T' => 'HEX32',
- 'void*' => 'HEX8_ARRAY',
- 'void const*' => 'HEX8_ARRAY',
- 'const void*' => 'HEX8_ARRAY',
- 'unsigned short' => 'HEX16',
- 'uint16' => 'HEX16',
- 'uint16_t' => 'HEX16',
- 'UINT16' => 'HEX16',
- 'UINT16_T' => 'HEX16',
- 'unsigned char' => 'HEX8',
- 'uint8' => 'HEX8',
- 'uint8_t' => 'HEX8',
- 'UINT8' => 'HEX8',
- 'UINT8_T' => 'HEX8',
- 'char*' => 'STRING',
- 'char const*' => 'STRING',
- 'const char*' => 'STRING',
- 'pCHAR' => 'STRING',
- 'cstring' => 'STRING',
- 'CSTRING' => 'STRING',
- 'float' => 'FLOAT',
- 'double' => 'FLOAT'
- }
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_file_writer.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_file_writer.rb
deleted file mode 100755
index d2d954cb..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_file_writer.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class CMockFileWriter
-
- attr_reader :config
-
- def initialize(config)
- @config = config
- end
-
- def create_subdir(subdir)
- if !Dir.exists?("#{@config.mock_path}/")
- require 'fileutils'
- FileUtils.mkdir_p "#{@config.mock_path}/"
- end
- if subdir && !Dir.exists?("#{@config.mock_path}/#{subdir+'/' if subdir}")
- require 'fileutils'
- FileUtils.mkdir_p "#{@config.mock_path}/#{subdir+'/' if subdir}"
- end
- end
-
- def create_file(filename, subdir)
- raise "Where's the block of data to create?" unless block_given?
- full_file_name_temp = "#{@config.mock_path}/#{subdir+'/' if subdir}#{filename}.new"
- full_file_name_done = "#{@config.mock_path}/#{subdir+'/' if subdir}#{filename}"
- File.open(full_file_name_temp, 'w') do |file|
- yield(file, filename)
- end
- update_file(full_file_name_done, full_file_name_temp)
- end
-
- private ###################################
-
- def update_file(dest, src)
- require 'fileutils'
- FileUtils.rm(dest) if (File.exist?(dest))
- FileUtils.cp(src, dest)
- FileUtils.rm(src)
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator.rb
deleted file mode 100755
index 42725a60..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator.rb
+++ /dev/null
@@ -1,268 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class CMockGenerator
-
- attr_accessor :config, :file_writer, :module_name, :clean_mock_name, :mock_name, :utils, :plugins, :weak, :ordered
-
- def initialize(config, file_writer, utils, plugins)
- @file_writer = file_writer
- @utils = utils
- @plugins = plugins
- @config = config
- @prefix = @config.mock_prefix
- @suffix = @config.mock_suffix
- @weak = @config.weak
- @ordered = @config.enforce_strict_ordering
- @framework = @config.framework.to_s
- @fail_on_unexpected_calls = @config.fail_on_unexpected_calls
-
- @subdir = @config.subdir
-
- @includes_h_pre_orig_header = (@config.includes || @config.includes_h_pre_orig_header || []).map{|h| h =~ /</ ? h : "\"#{h}\""}
- @includes_h_post_orig_header = (@config.includes_h_post_orig_header || []).map{|h| h =~ /</ ? h : "\"#{h}\""}
- @includes_c_pre_header = (@config.includes_c_pre_header || []).map{|h| h =~ /</ ? h : "\"#{h}\""}
- @includes_c_post_header = (@config.includes_c_post_header || []).map{|h| h =~ /</ ? h : "\"#{h}\""}
-
- here = File.dirname __FILE__
- unity_path_in_ceedling = "#{here}/../../unity" # path to Unity from within Ceedling
- unity_path_in_cmock = "#{here}/../vendor/unity" # path to Unity from within CMock
- # path to Unity as specified by env var
- unity_path_in_env = ENV.has_key?("UNITY_DIR") ? File.expand_path(ENV.fetch("UNITY_DIR")) : nil
-
- if unity_path_in_env and File.exist? unity_path_in_env
- require "#{unity_path_in_env}/auto/type_sanitizer"
- elsif File.exist? unity_path_in_ceedling
- require "#{unity_path_in_ceedling}/auto/type_sanitizer"
- elsif File.exist? unity_path_in_cmock
- require "#{unity_path_in_cmock}/auto/type_sanitizer"
- else
- raise "Failed to find an instance of Unity to pull in type_sanitizer module!"
- end
-
- end
-
- def create_mock(module_name, parsed_stuff)
- @module_name = module_name
- @mock_name = @prefix + @module_name + @suffix
- @clean_mock_name = TypeSanitizer.sanitize_c_identifier(@mock_name)
- create_mock_subdir()
- create_mock_header_file(parsed_stuff)
- create_mock_source_file(parsed_stuff)
- end
-
- private if $ThisIsOnlyATest.nil? ##############################
-
- def create_mock_subdir()
- @file_writer.create_subdir(@subdir)
- end
-
- def create_mock_header_file(parsed_stuff)
- @file_writer.create_file(@mock_name + ".h", @subdir) do |file, filename|
- create_mock_header_header(file, filename)
- create_mock_header_service_call_declarations(file)
- create_typedefs(file, parsed_stuff[:typedefs])
- parsed_stuff[:functions].each do |function|
- file << @plugins.run(:mock_function_declarations, function)
- end
- create_mock_header_footer(file)
- end
- end
-
- def create_mock_source_file(parsed_stuff)
- @file_writer.create_file(@mock_name + ".c", @subdir) do |file, filename|
- create_source_header_section(file, filename, parsed_stuff[:functions])
- create_instance_structure(file, parsed_stuff[:functions])
- create_extern_declarations(file)
- create_mock_verify_function(file, parsed_stuff[:functions])
- create_mock_init_function(file)
- create_mock_destroy_function(file, parsed_stuff[:functions])
- parsed_stuff[:functions].each do |function|
- create_mock_implementation(file, function)
- create_mock_interfaces(file, function)
- end
- end
- end
-
- def create_mock_header_header(file, filename)
- define_name = @clean_mock_name.upcase
- orig_filename = (@subdir ? @subdir + "/" : "") + @module_name + ".h"
- file << "/* AUTOGENERATED FILE. DO NOT EDIT. */\n"
- file << "#ifndef _#{define_name}_H\n"
- file << "#define _#{define_name}_H\n\n"
- file << "#include \"#{@framework}.h\"\n"
- @includes_h_pre_orig_header.each {|inc| file << "#include #{inc}\n"}
- file << @config.orig_header_include_fmt.gsub(/%s/, "#{orig_filename}") + "\n"
- @includes_h_post_orig_header.each {|inc| file << "#include #{inc}\n"}
- plugin_includes = @plugins.run(:include_files)
- file << plugin_includes if (!plugin_includes.empty?)
- file << "\n"
- file << "/* Ignore the following warnings, since we are copying code */\n"
- file << "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n"
- file << "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n"
- file << "#pragma GCC diagnostic push\n"
- file << "#endif\n"
- file << "#if !defined(__clang__)\n"
- file << "#pragma GCC diagnostic ignored \"-Wpragmas\"\n"
- file << "#endif\n"
- file << "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n"
- file << "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n"
- file << "#endif\n"
- file << "\n"
- end
-
- def create_typedefs(file, typedefs)
- file << "\n"
- typedefs.each {|typedef| file << "#{typedef}\n" }
- file << "\n\n"
- end
-
- def create_mock_header_service_call_declarations(file)
- file << "void #{@clean_mock_name}_Init(void);\n"
- file << "void #{@clean_mock_name}_Destroy(void);\n"
- file << "void #{@clean_mock_name}_Verify(void);\n\n"
- end
-
- def create_mock_header_footer(header)
- header << "\n"
- header << "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n"
- header << "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n"
- header << "#pragma GCC diagnostic pop\n"
- header << "#endif\n"
- header << "#endif\n"
- header << "\n"
- header << "#endif\n"
- end
-
- def create_source_header_section(file, filename, functions)
- header_file = (@subdir ? @subdir + '/' : '') + filename.gsub(".c",".h")
- file << "/* AUTOGENERATED FILE. DO NOT EDIT. */\n"
- file << "#include <string.h>\n"
- file << "#include <stdlib.h>\n"
- file << "#include <setjmp.h>\n"
- file << "#include \"cmock.h\"\n"
- @includes_c_pre_header.each {|inc| file << "#include #{inc}\n"}
- file << "#include \"#{header_file}\"\n"
- @includes_c_post_header.each {|inc| file << "#include #{inc}\n"}
- file << "\n"
- strs = []
- functions.each do |func|
- strs << func[:name]
- func[:args].each {|arg| strs << arg[:name] }
- end
- strs.uniq.sort.each do |str|
- file << "static const char* CMockString_#{str} = \"#{str}\";\n"
- end
- file << "\n"
- end
-
- def create_instance_structure(file, functions)
- functions.each do |function|
- file << "typedef struct _CMOCK_#{function[:name]}_CALL_INSTANCE\n{\n"
- file << " UNITY_LINE_TYPE LineNumber;\n"
- file << @plugins.run(:instance_typedefs, function)
- file << "\n} CMOCK_#{function[:name]}_CALL_INSTANCE;\n\n"
- end
- file << "static struct #{@clean_mock_name}Instance\n{\n"
- if (functions.size == 0)
- file << " unsigned char placeHolder;\n"
- end
- functions.each do |function|
- file << @plugins.run(:instance_structure, function)
- file << " CMOCK_MEM_INDEX_TYPE #{function[:name]}_CallInstance;\n"
- end
- file << "} Mock;\n\n"
- end
-
- def create_extern_declarations(file)
- file << "extern jmp_buf AbortFrame;\n"
- if (@ordered)
- file << "extern int GlobalExpectCount;\n"
- file << "extern int GlobalVerifyOrder;\n"
- end
- file << "\n"
- end
-
- def create_mock_verify_function(file, functions)
- file << "void #{@clean_mock_name}_Verify(void)\n{\n"
- verifications = functions.collect do |function|
- v = @plugins.run(:mock_verify, function)
- v.empty? ? v : [" call_instance = Mock.#{function[:name]}_CallInstance;\n", v]
- end.join
- unless verifications.empty?
- file << " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n"
- file << " CMOCK_MEM_INDEX_TYPE call_instance;\n"
- file << verifications
- end
- file << "}\n\n"
- end
-
- def create_mock_init_function(file)
- file << "void #{@clean_mock_name}_Init(void)\n{\n"
- file << " #{@clean_mock_name}_Destroy();\n"
- file << "}\n\n"
- end
-
- def create_mock_destroy_function(file, functions)
- file << "void #{@clean_mock_name}_Destroy(void)\n{\n"
- file << " CMock_Guts_MemFreeAll();\n"
- file << " memset(&Mock, 0, sizeof(Mock));\n"
- file << functions.collect {|function| @plugins.run(:mock_destroy, function)}.join
-
- unless (@fail_on_unexpected_calls)
- file << functions.collect {|function| @plugins.run(:mock_ignore, function)}.join
- end
-
- if (@ordered)
- file << " GlobalExpectCount = 0;\n"
- file << " GlobalVerifyOrder = 0;\n"
- end
- file << "}\n\n"
- end
-
- def create_mock_implementation(file, function)
- # prepare return value and arguments
- function_mod_and_rettype = (function[:modifier].empty? ? '' : "#{function[:modifier]} ") +
- (function[:return][:type]) +
- (function[:c_calling_convention] ? " #{function[:c_calling_convention]}" : '')
- args_string = function[:args_string]
- args_string += (", " + function[:var_arg]) unless (function[:var_arg].nil?)
-
- # Create mock function
- if (not @weak.empty?)
- file << "#if defined (__IAR_SYSTEMS_ICC__)\n"
- file << "#pragma weak #{function[:name]}\n"
- file << "#else\n"
- file << "#{function_mod_and_rettype} #{function[:name]}(#{args_string}) #{weak};\n"
- file << "#endif\n\n"
- end
- file << "#{function_mod_and_rettype} #{function[:name]}(#{args_string})\n"
- file << "{\n"
- file << " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n"
- file << " CMOCK_#{function[:name]}_CALL_INSTANCE* cmock_call_instance;\n"
- file << " UNITY_SET_DETAIL(CMockString_#{function[:name]});\n"
- file << " cmock_call_instance = (CMOCK_#{function[:name]}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.#{function[:name]}_CallInstance);\n"
- file << " Mock.#{function[:name]}_CallInstance = CMock_Guts_MemNext(Mock.#{function[:name]}_CallInstance);\n"
- file << @plugins.run(:mock_implementation_precheck, function)
- file << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);\n"
- file << " cmock_line = cmock_call_instance->LineNumber;\n"
- if (@ordered)
- file << " if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)\n"
- file << " UNITY_TEST_FAIL(cmock_line, CMockStringCalledEarly);\n"
- file << " if (cmock_call_instance->CallOrder < GlobalVerifyOrder)\n"
- file << " UNITY_TEST_FAIL(cmock_line, CMockStringCalledLate);\n"
- end
- file << @plugins.run(:mock_implementation, function)
- file << " UNITY_CLR_DETAILS();\n"
- file << " return cmock_call_instance->ReturnVal;\n" unless (function[:return][:void?])
- file << "}\n\n"
- end
-
- def create_mock_interfaces(file, function)
- file << @utils.code_add_argument_loader(function)
- file << @plugins.run(:mock_interfaces, function)
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_array.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_array.rb
deleted file mode 100755
index 3b73708e..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_array.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class CMockGeneratorPluginArray
-
- attr_reader :priority
- attr_accessor :config, :utils, :unity_helper, :ordered
- def initialize(config, utils)
- @config = config
- @ptr_handling = @config.when_ptr
- @ordered = @config.enforce_strict_ordering
- @utils = utils
- @unity_helper = @utils.helpers[:unity_helper]
- @priority = 8
- end
-
- def instance_typedefs(function)
- function[:args].inject("") do |all, arg|
- (arg[:ptr?]) ? all + " int Expected_#{arg[:name]}_Depth;\n" : all
- end
- end
-
- def mock_function_declarations(function)
- return nil unless function[:contains_ptr?]
- args_call = function[:args].map{|m| m[:ptr?] ? "#{m[:name]}, #{m[:name]}_Depth" : "#{m[:name]}"}.join(', ')
- args_string = function[:args].map do |m|
- type = @utils.arg_type_with_const(m)
- m[:ptr?] ? "#{type} #{m[:name]}, int #{m[:name]}_Depth" : "#{type} #{m[:name]}"
- end.join(', ')
- if (function[:return][:void?])
- return "#define #{function[:name]}_ExpectWithArray(#{args_call}) #{function[:name]}_CMockExpectWithArray(__LINE__, #{args_call})\n" +
- "void #{function[:name]}_CMockExpectWithArray(UNITY_LINE_TYPE cmock_line, #{args_string});\n"
- else
- return "#define #{function[:name]}_ExpectWithArrayAndReturn(#{args_call}, cmock_retval) #{function[:name]}_CMockExpectWithArrayAndReturn(__LINE__, #{args_call}, cmock_retval)\n" +
- "void #{function[:name]}_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, #{args_string}, #{function[:return][:str]});\n"
- end
- end
-
- def mock_interfaces(function)
- return nil unless function[:contains_ptr?]
- lines = []
- func_name = function[:name]
- args_string = function[:args].map do |m|
- type = @utils.arg_type_with_const(m)
- m[:ptr?] ? "#{type} #{m[:name]}, int #{m[:name]}_Depth" : "#{type} #{m[:name]}"
- end.join(', ')
- call_string = function[:args].map{|m| m[:ptr?] ? "#{m[:name]}, #{m[:name]}_Depth" : m[:name]}.join(', ')
- if (function[:return][:void?])
- lines << "void #{func_name}_CMockExpectWithArray(UNITY_LINE_TYPE cmock_line, #{args_string})\n"
- else
- lines << "void #{func_name}_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, #{args_string}, #{function[:return][:str]})\n"
- end
- lines << "{\n"
- lines << @utils.code_add_base_expectation(func_name)
- lines << " CMockExpectParameters_#{func_name}(cmock_call_instance, #{call_string});\n"
- lines << " cmock_call_instance->ReturnVal = cmock_to_return;\n" unless (function[:return][:void?])
- lines << "}\n\n"
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_callback.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_callback.rb
deleted file mode 100755
index 564e0ac2..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_callback.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class CMockGeneratorPluginCallback
-
- attr_accessor :include_count
- attr_reader :priority
- attr_reader :config, :utils
-
- def initialize(config, utils)
- @config = config
- @utils = utils
- @priority = 6
-
- @include_count = @config.callback_include_count
- end
-
- def instance_structure(function)
- func_name = function[:name]
- " int #{func_name}_CallbackBool;\n" \
- " CMOCK_#{func_name}_CALLBACK #{func_name}_CallbackFunctionPointer;\n" \
- " int #{func_name}_CallbackCalls;\n"
- end
-
- def mock_function_declarations(function)
- func_name = function[:name]
- return_type = function[:return][:type]
- action = @config.callback_after_arg_check ? 'AddCallback' : 'Stub'
- style = (@include_count ? 1 : 0) | (function[:args].empty? ? 0 : 2)
- styles = [ "void", "int cmock_num_calls", function[:args_string], "#{function[:args_string]}, int cmock_num_calls" ]
- "typedef #{return_type} (* CMOCK_#{func_name}_CALLBACK)(#{styles[style]});\n" \
- "void #{func_name}_AddCallback(CMOCK_#{func_name}_CALLBACK Callback);\n" \
- "void #{func_name}_Stub(CMOCK_#{func_name}_CALLBACK Callback);\n" \
- "#define #{func_name}_StubWithCallback #{func_name}_#{action}\n"
- end
-
- def generate_call(function)
- args = function[:args].map { |m| m[:name] }
- args << "Mock.#{function[:name]}_CallbackCalls++" if @include_count
- "Mock.#{function[:name]}_CallbackFunctionPointer(#{args.join(', ')})"
- end
-
- def mock_implementation(function)
- " if (Mock.#{function[:name]}_CallbackFunctionPointer != NULL)\n {\n" +
- if function[:return][:void?]
- " #{generate_call(function)};\n }\n"
- else
- " cmock_call_instance->ReturnVal = #{generate_call(function)};\n }\n"
- end
- end
-
- def mock_implementation_precheck(function)
- " if (!Mock.#{function[:name]}_CallbackBool &&\n" \
- " Mock.#{function[:name]}_CallbackFunctionPointer != NULL)\n {\n" +
- if function[:return][:void?]
- " #{generate_call(function)};\n" \
- " UNITY_CLR_DETAILS();\n" \
- " return;\n }\n"
- else
- " #{function[:return][:type]} ret = #{generate_call(function)};\n" \
- " UNITY_CLR_DETAILS();\n" \
- " return ret;\n }\n"
- end
- end
-
- def mock_interfaces(function)
- func_name = function[:name]
- has_ignore = @config.plugins.include? :ignore
- lines = ""
- lines << "void #{func_name}_AddCallback(CMOCK_#{func_name}_CALLBACK Callback)\n{\n"
- lines << " Mock.#{func_name}_IgnoreBool = (int)0;\n" if has_ignore
- lines << " Mock.#{func_name}_CallbackBool = (int)1;\n"
- lines << " Mock.#{func_name}_CallbackFunctionPointer = Callback;\n}\n\n"
- lines << "void #{func_name}_Stub(CMOCK_#{func_name}_CALLBACK Callback)\n{\n"
- lines << " Mock.#{func_name}_IgnoreBool = (int)0;\n" if has_ignore
- lines << " Mock.#{func_name}_CallbackBool = (int)0;\n"
- lines << " Mock.#{func_name}_CallbackFunctionPointer = Callback;\n}\n\n"
- end
-
- def mock_verify(function)
- func_name = function[:name]
- " if (Mock.#{func_name}_CallbackFunctionPointer != NULL)\n call_instance = CMOCK_GUTS_NONE;\n"
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_cexception.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_cexception.rb
deleted file mode 100755
index 39d36d64..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_cexception.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class CMockGeneratorPluginCexception
-
- attr_reader :priority
- attr_reader :config, :utils
-
- def initialize(config, utils)
- @config = config
- @utils = utils
- @priority = 7
- end
-
- def include_files
- return "#include \"CException.h\"\n"
- end
-
- def instance_typedefs(function)
- " CEXCEPTION_T ExceptionToThrow;\n"
- end
-
- def mock_function_declarations(function)
- if (function[:args_string] == "void")
- return "#define #{function[:name]}_ExpectAndThrow(cmock_to_throw) #{function[:name]}_CMockExpectAndThrow(__LINE__, cmock_to_throw)\n" +
- "void #{function[:name]}_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, CEXCEPTION_T cmock_to_throw);\n"
- else
- return "#define #{function[:name]}_ExpectAndThrow(#{function[:args_call]}, cmock_to_throw) #{function[:name]}_CMockExpectAndThrow(__LINE__, #{function[:args_call]}, cmock_to_throw)\n" +
- "void #{function[:name]}_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, #{function[:args_string]}, CEXCEPTION_T cmock_to_throw);\n"
- end
- end
-
- def mock_implementation(function)
- " if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)\n {\n" +
- " UNITY_CLR_DETAILS();\n" +
- " Throw(cmock_call_instance->ExceptionToThrow);\n }\n"
- end
-
- def mock_interfaces(function)
- arg_insert = (function[:args_string] == "void") ? "" : "#{function[:args_string]}, "
- [ "void #{function[:name]}_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, #{arg_insert}CEXCEPTION_T cmock_to_throw)\n{\n",
- @utils.code_add_base_expectation(function[:name]),
- @utils.code_call_argument_loader(function),
- " cmock_call_instance->ExceptionToThrow = cmock_to_throw;\n",
- "}\n\n" ].join
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_expect.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_expect.rb
deleted file mode 100755
index dcf96f2e..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_expect.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class CMockGeneratorPluginExpect
-
- attr_reader :priority
- attr_accessor :config, :utils, :unity_helper, :ordered
-
- def initialize(config, utils)
- @config = config
- @ptr_handling = @config.when_ptr
- @ordered = @config.enforce_strict_ordering
- @utils = utils
- @unity_helper = @utils.helpers[:unity_helper]
- @priority = 5
-
- if (@config.plugins.include? :expect_any_args)
- alias :mock_implementation :mock_implementation_might_check_args
- else
- alias :mock_implementation :mock_implementation_always_check_args
- end
- end
-
- def instance_typedefs(function)
- lines = ""
- lines << " #{function[:return][:type]} ReturnVal;\n" unless (function[:return][:void?])
- lines << " int CallOrder;\n" if (@ordered)
- function[:args].each do |arg|
- lines << " #{arg[:type]} Expected_#{arg[:name]};\n"
- end
- lines
- end
-
- def mock_function_declarations(function)
- if (function[:args].empty?)
- if (function[:return][:void?])
- return "#define #{function[:name]}_Expect() #{function[:name]}_CMockExpect(__LINE__)\n" +
- "void #{function[:name]}_CMockExpect(UNITY_LINE_TYPE cmock_line);\n"
- else
- return "#define #{function[:name]}_ExpectAndReturn(cmock_retval) #{function[:name]}_CMockExpectAndReturn(__LINE__, cmock_retval)\n" +
- "void #{function[:name]}_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]});\n"
- end
- else
- if (function[:return][:void?])
- return "#define #{function[:name]}_Expect(#{function[:args_call]}) #{function[:name]}_CMockExpect(__LINE__, #{function[:args_call]})\n" +
- "void #{function[:name]}_CMockExpect(UNITY_LINE_TYPE cmock_line, #{function[:args_string]});\n"
- else
- return "#define #{function[:name]}_ExpectAndReturn(#{function[:args_call]}, cmock_retval) #{function[:name]}_CMockExpectAndReturn(__LINE__, #{function[:args_call]}, cmock_retval)\n" +
- "void #{function[:name]}_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:args_string]}, #{function[:return][:str]});\n"
- end
- end
- end
-
- def mock_implementation_always_check_args(function)
- lines = ""
- function[:args].each do |arg|
- lines << @utils.code_verify_an_arg_expectation(function, arg)
- end
- lines
- end
-
- def mock_implementation_might_check_args(function)
- return "" if (function[:args].empty?)
- lines = " if (!cmock_call_instance->ExpectAnyArgsBool)\n {\n"
- function[:args].each do |arg|
- lines << @utils.code_verify_an_arg_expectation(function, arg)
- end
- lines << " }\n"
- lines
- end
-
- def mock_interfaces(function)
- lines = ""
- func_name = function[:name]
- if (function[:return][:void?])
- if (function[:args_string] == "void")
- lines << "void #{func_name}_CMockExpect(UNITY_LINE_TYPE cmock_line)\n{\n"
- else
- lines << "void #{func_name}_CMockExpect(UNITY_LINE_TYPE cmock_line, #{function[:args_string]})\n{\n"
- end
- else
- if (function[:args_string] == "void")
- lines << "void #{func_name}_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]})\n{\n"
- else
- lines << "void #{func_name}_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:args_string]}, #{function[:return][:str]})\n{\n"
- end
- end
- lines << @utils.code_add_base_expectation(func_name)
- lines << @utils.code_call_argument_loader(function)
- lines << @utils.code_assign_argument_quickly("cmock_call_instance->ReturnVal", function[:return]) unless (function[:return][:void?])
- lines << "}\n\n"
- end
-
- def mock_verify(function)
- " UNITY_SET_DETAIL(CMockString_#{function[:name]});\n" +
- " UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == call_instance, cmock_line, CMockStringCalledLess);\n" +
- " UNITY_CLR_DETAILS();\n"
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_expect_any_args.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_expect_any_args.rb
deleted file mode 100755
index 0c1c74e9..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_expect_any_args.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class CMockGeneratorPluginExpectAnyArgs
-
- attr_reader :priority
- attr_reader :config, :utils
-
- def initialize(config, utils)
- @config = config
- @utils = utils
- @priority = 3
- end
-
- def instance_typedefs(function)
- " int ExpectAnyArgsBool;\n"
- end
-
- def mock_function_declarations(function)
- unless (function[:args].empty?)
- if (function[:return][:void?])
- return "#define #{function[:name]}_ExpectAnyArgs() #{function[:name]}_CMockExpectAnyArgs(__LINE__)\n" +
- "void #{function[:name]}_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line);\n"
- else
- return "#define #{function[:name]}_ExpectAnyArgsAndReturn(cmock_retval) #{function[:name]}_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval)\n" +
- "void #{function[:name]}_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]});\n"
- end
- else
- ""
- end
- end
-
- def mock_interfaces(function)
- lines = ""
- unless (function[:args].empty?)
- if (function[:return][:void?])
- lines << "void #{function[:name]}_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line)\n{\n"
- else
- lines << "void #{function[:name]}_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]})\n{\n"
- end
- lines << @utils.code_add_base_expectation(function[:name], true)
- unless (function[:return][:void?])
- lines << " cmock_call_instance->ReturnVal = cmock_to_return;\n"
- end
- lines << " cmock_call_instance->ExpectAnyArgsBool = (int)1;\n"
- lines << "}\n\n"
- end
- return lines
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_ignore.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_ignore.rb
deleted file mode 100755
index 8f31967a..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_ignore.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class CMockGeneratorPluginIgnore
-
- attr_reader :priority
- attr_reader :config, :utils
-
- def initialize(config, utils)
- @config = config
- @utils = utils
- @priority = 2
- end
-
- def instance_structure(function)
- if (function[:return][:void?])
- " int #{function[:name]}_IgnoreBool;\n"
- else
- " int #{function[:name]}_IgnoreBool;\n #{function[:return][:type]} #{function[:name]}_FinalReturn;\n"
- end
- end
-
- def mock_function_declarations(function)
- if (function[:return][:void?])
- return "#define #{function[:name]}_Ignore() #{function[:name]}_CMockIgnore()\n" +
- "void #{function[:name]}_CMockIgnore(void);\n"
- else
- return "#define #{function[:name]}_IgnoreAndReturn(cmock_retval) #{function[:name]}_CMockIgnoreAndReturn(__LINE__, cmock_retval)\n" +
- "void #{function[:name]}_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]});\n"
- end
- end
-
- def mock_implementation_precheck(function)
- lines = " if (Mock.#{function[:name]}_IgnoreBool)\n {\n"
- lines << " UNITY_CLR_DETAILS();\n"
- if (function[:return][:void?])
- lines << " return;\n }\n"
- else
- retval = function[:return].merge( { :name => "cmock_call_instance->ReturnVal"} )
- lines << " if (cmock_call_instance == NULL)\n return Mock.#{function[:name]}_FinalReturn;\n"
- lines << " " + @utils.code_assign_argument_quickly("Mock.#{function[:name]}_FinalReturn", retval) unless (retval[:void?])
- lines << " return cmock_call_instance->ReturnVal;\n }\n"
- end
- lines
- end
-
- def mock_interfaces(function)
- lines = ""
- if (function[:return][:void?])
- lines << "void #{function[:name]}_CMockIgnore(void)\n{\n"
- else
- lines << "void #{function[:name]}_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, #{function[:return][:str]})\n{\n"
- end
- if (!function[:return][:void?])
- lines << @utils.code_add_base_expectation(function[:name], false)
- end
- unless (function[:return][:void?])
- lines << " cmock_call_instance->ReturnVal = cmock_to_return;\n"
- end
- lines << " Mock.#{function[:name]}_IgnoreBool = (int)1;\n"
- lines << "}\n\n"
- end
-
- def mock_ignore(function)
- " Mock.#{function[:name]}_IgnoreBool = (int) 1;\n"
- end
-
- def mock_verify(function)
- func_name = function[:name]
- " if (Mock.#{func_name}_IgnoreBool)\n call_instance = CMOCK_GUTS_NONE;\n"
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_ignore_arg.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_ignore_arg.rb
deleted file mode 100755
index ef40e503..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_ignore_arg.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-class CMockGeneratorPluginIgnoreArg
- attr_reader :priority
- attr_accessor :utils
-
- def initialize(config, utils)
- @utils = utils
- @priority = 10
- end
-
- def instance_typedefs(function)
- lines = ""
- function[:args].each do |arg|
- lines << " int IgnoreArg_#{arg[:name]};\n"
- end
- lines
- end
-
- def mock_function_declarations(function)
- lines = ""
- function[:args].each do |arg|
- lines << "#define #{function[:name]}_IgnoreArg_#{arg[:name]}()"
- lines << " #{function[:name]}_CMockIgnoreArg_#{arg[:name]}(__LINE__)\n"
- lines << "void #{function[:name]}_CMockIgnoreArg_#{arg[:name]}(UNITY_LINE_TYPE cmock_line);\n"
- end
- lines
- end
-
- def mock_interfaces(function)
- lines = []
- func_name = function[:name]
- function[:args].each do |arg|
- lines << "void #{func_name}_CMockIgnoreArg_#{arg[:name]}(UNITY_LINE_TYPE cmock_line)\n"
- lines << "{\n"
- lines << " CMOCK_#{func_name}_CALL_INSTANCE* cmock_call_instance = " +
- "(CMOCK_#{func_name}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.#{func_name}_CallInstance));\n"
- lines << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp);\n"
- lines << " cmock_call_instance->IgnoreArg_#{arg[:name]} = 1;\n"
- lines << "}\n\n"
- end
- lines
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb
deleted file mode 100755
index 1c1af061..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-class CMockGeneratorPluginReturnThruPtr
- attr_reader :priority
- attr_accessor :utils
-
- def initialize(config, utils)
- @utils = utils
- @priority = 9
- end
-
- def instance_typedefs(function)
- lines = ""
- function[:args].each do |arg|
- if (@utils.ptr_or_str?(arg[:type]) and not arg[:const?])
- lines << " int ReturnThruPtr_#{arg[:name]}_Used;\n"
- lines << " #{arg[:type]} ReturnThruPtr_#{arg[:name]}_Val;\n"
- lines << " int ReturnThruPtr_#{arg[:name]}_Size;\n"
- end
- end
- lines
- end
-
- def mock_function_declarations(function)
- lines = ""
- function[:args].each do |arg|
- if (@utils.ptr_or_str?(arg[:type]) and not arg[:const?])
- lines << "#define #{function[:name]}_ReturnThruPtr_#{arg[:name]}(#{arg[:name]})"
- # If the pointer type actually contains an asterisk, we can do sizeof the type (super safe), otherwise
- # we need to do a sizeof the dereferenced pointer (which could be a problem if give the wrong size
- if (arg[:type][-1] == '*')
- lines << " #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(__LINE__, #{arg[:name]}, sizeof(#{arg[:type][0..-2]}))\n"
- else
- lines << " #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(__LINE__, #{arg[:name]}, sizeof(*#{arg[:name]}))\n"
- end
- lines << "#define #{function[:name]}_ReturnArrayThruPtr_#{arg[:name]}(#{arg[:name]}, cmock_len)"
- lines << " #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(__LINE__, #{arg[:name]}, (int)(cmock_len * (int)sizeof(*#{arg[:name]})))\n"
- lines << "#define #{function[:name]}_ReturnMemThruPtr_#{arg[:name]}(#{arg[:name]}, cmock_size)"
- lines << " #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(__LINE__, #{arg[:name]}, cmock_size)\n"
- lines << "void #{function[:name]}_CMockReturnMemThruPtr_#{arg[:name]}(UNITY_LINE_TYPE cmock_line, #{arg[:type]} #{arg[:name]}, int cmock_size);\n"
- end
- end
- lines
- end
-
- def mock_interfaces(function)
- lines = []
- func_name = function[:name]
- function[:args].each do |arg|
- arg_name = arg[:name]
- if (@utils.ptr_or_str?(arg[:type]) and not arg[:const?])
- lines << "void #{func_name}_CMockReturnMemThruPtr_#{arg_name}(UNITY_LINE_TYPE cmock_line, #{arg[:type]} #{arg_name}, int cmock_size)\n"
- lines << "{\n"
- lines << " CMOCK_#{func_name}_CALL_INSTANCE* cmock_call_instance = " +
- "(CMOCK_#{func_name}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.#{func_name}_CallInstance));\n"
- lines << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp);\n"
- lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Used = 1;\n"
- lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Val = #{arg_name};\n"
- lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Size = cmock_size;\n"
- lines << "}\n\n"
- end
- end
- lines
- end
-
- def mock_implementation(function)
- lines = []
- function[:args].each do |arg|
- arg_name = arg[:name]
- if (@utils.ptr_or_str?(arg[:type]) and not arg[:const?])
- lines << " if (cmock_call_instance->ReturnThruPtr_#{arg_name}_Used)\n"
- lines << " {\n"
- lines << " UNITY_TEST_ASSERT_NOT_NULL(#{arg_name}, cmock_line, CMockStringPtrIsNULL);\n"
- lines << " memcpy((void*)#{arg_name}, (void*)cmock_call_instance->ReturnThruPtr_#{arg_name}_Val,\n"
- lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Size);\n"
- lines << " }\n"
- end
- end
- lines
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_utils.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_utils.rb
deleted file mode 100755
index 994e85c5..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_generator_utils.rb
+++ /dev/null
@@ -1,253 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class CMockGeneratorUtils
-
- attr_accessor :config, :helpers, :ordered, :ptr_handling, :arrays, :cexception
-
- def initialize(config, helpers={})
- @config = config
- @ptr_handling = @config.when_ptr
- @ordered = @config.enforce_strict_ordering
- @arrays = @config.plugins.include? :array
- @cexception = @config.plugins.include? :cexception
- @expect_any = @config.plugins.include? :expect_any_args
- @return_thru_ptr = @config.plugins.include? :return_thru_ptr
- @ignore_arg = @config.plugins.include? :ignore_arg
- @ignore = @config.plugins.include? :ignore
- @treat_as = @config.treat_as
- @helpers = helpers
- end
-
- def self.arg_type_with_const(arg)
- # Restore any "const" that was removed in header parsing
- if arg[:type].include?('*')
- arg[:const_ptr?] ? "#{arg[:type]} const" : arg[:type]
- else
- arg[:const?] ? "const #{arg[:type]}" : arg[:type]
- end
- end
-
- def arg_type_with_const(arg)
- self.class.arg_type_with_const(arg)
- end
-
- def code_verify_an_arg_expectation(function, arg)
- if (@arrays)
- case(@ptr_handling)
- when :smart then code_verify_an_arg_expectation_with_smart_arrays(function, arg)
- when :compare_data then code_verify_an_arg_expectation_with_normal_arrays(function, arg)
- when :compare_ptr then raise "ERROR: the array plugin doesn't enjoy working with :compare_ptr only. Disable one option."
- end
- else
- code_verify_an_arg_expectation_with_no_arrays(function, arg)
- end
- end
-
- def code_add_base_expectation(func_name, global_ordering_supported=true)
- lines = " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_#{func_name}_CALL_INSTANCE));\n"
- lines << " CMOCK_#{func_name}_CALL_INSTANCE* cmock_call_instance = (CMOCK_#{func_name}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);\n"
- lines << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory);\n"
- lines << " memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));\n"
- lines << " Mock.#{func_name}_CallInstance = CMock_Guts_MemChain(Mock.#{func_name}_CallInstance, cmock_guts_index);\n"
- lines << " Mock.#{func_name}_IgnoreBool = (int)0;\n" if (@ignore)
- lines << " cmock_call_instance->LineNumber = cmock_line;\n"
- lines << " cmock_call_instance->CallOrder = ++GlobalExpectCount;\n" if (@ordered and global_ordering_supported)
- lines << " cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;\n" if (@cexception)
- lines << " cmock_call_instance->ExpectAnyArgsBool = (int)0;\n" if (@expect_any)
- lines
- end
-
- def code_add_an_arg_expectation(arg, depth=1)
- lines = code_assign_argument_quickly("cmock_call_instance->Expected_#{arg[:name]}", arg)
- lines << " cmock_call_instance->Expected_#{arg[:name]}_Depth = #{arg[:name]}_Depth;\n" if (@arrays and (depth.class == String))
- lines << " cmock_call_instance->IgnoreArg_#{arg[:name]} = 0;\n" if (@ignore_arg)
- lines << " cmock_call_instance->ReturnThruPtr_#{arg[:name]}_Used = 0;\n" if (@return_thru_ptr and ptr_or_str?(arg[:type]) and not arg[:const?])
- lines
- end
-
- def code_assign_argument_quickly(dest, arg)
- if (arg[:ptr?] or @treat_as.include?(arg[:type]))
- " #{dest} = #{arg[:name]};\n"
- else
- assert_expr = "sizeof(#{arg[:name]}) == sizeof(#{arg[:type]}) ? 1 : -1"
- comment = "/* add #{arg[:type]} to :treat_as_array if this causes an error */"
- " memcpy((void*)(&#{dest}), (void*)(&#{arg[:name]}),\n" +
- " sizeof(#{arg[:type]}[#{assert_expr}])); #{comment}\n"
- end
- end
-
- def code_add_argument_loader(function)
- if (function[:args_string] != "void")
- if (@arrays)
- args_string = function[:args].map do |m|
- type = arg_type_with_const(m)
- m[:ptr?] ? "#{type} #{m[:name]}, int #{m[:name]}_Depth" : "#{type} #{m[:name]}"
- end.join(', ')
- "void CMockExpectParameters_#{function[:name]}(CMOCK_#{function[:name]}_CALL_INSTANCE* cmock_call_instance, #{args_string});\n" +
- "void CMockExpectParameters_#{function[:name]}(CMOCK_#{function[:name]}_CALL_INSTANCE* cmock_call_instance, #{args_string})\n{\n" +
- function[:args].inject("") { |all, arg| all + code_add_an_arg_expectation(arg, (arg[:ptr?] ? "#{arg[:name]}_Depth" : 1) ) } +
- "}\n\n"
- else
- "void CMockExpectParameters_#{function[:name]}(CMOCK_#{function[:name]}_CALL_INSTANCE* cmock_call_instance, #{function[:args_string]});\n" +
- "void CMockExpectParameters_#{function[:name]}(CMOCK_#{function[:name]}_CALL_INSTANCE* cmock_call_instance, #{function[:args_string]})\n{\n" +
- function[:args].inject("") { |all, arg| all + code_add_an_arg_expectation(arg) } +
- "}\n\n"
- end
- else
- ""
- end
- end
-
- def code_call_argument_loader(function)
- if (function[:args_string] != "void")
- args = function[:args].map do |m|
- if (@arrays and m[:ptr?] and not m[:array_data?])
- "#{m[:name]}, 1"
- elsif (@arrays and m[:array_size?])
- "#{m[:name]}, #{m[:name]}"
- else
- m[:name]
- end
- end
- " CMockExpectParameters_#{function[:name]}(cmock_call_instance, #{args.join(', ')});\n"
- else
- ""
- end
- end
-
- def ptr_or_str?(arg_type)
- return (arg_type.include? '*' or
- @treat_as.fetch(arg_type, "").include? '*')
- end
-
- #private ######################
-
- def lookup_expect_type(function, arg)
- c_type = arg[:type]
- arg_name = arg[:name]
- expected = "cmock_call_instance->Expected_#{arg_name}"
- ignore = "cmock_call_instance->IgnoreArg_#{arg_name}"
- unity_func = if ((arg[:ptr?]) and ((c_type =~ /\*\*/) or (@ptr_handling == :compare_ptr)))
- ['UNITY_TEST_ASSERT_EQUAL_PTR', '']
- else
- (@helpers.nil? or @helpers[:unity_helper].nil?) ? ["UNITY_TEST_ASSERT_EQUAL",''] : @helpers[:unity_helper].get_helper(c_type)
- end
- return c_type, arg_name, expected, ignore, unity_func[0], unity_func[1]
- end
-
- def code_verify_an_arg_expectation_with_no_arrays(function, arg)
- c_type, arg_name, expected, ignore, unity_func, pre = lookup_expect_type(function, arg)
- lines = ""
- lines << " if (!#{ignore})\n" if @ignore_arg
- lines << " {\n"
- lines << " UNITY_SET_DETAILS(CMockString_#{function[:name]},CMockString_#{arg_name});\n"
- case(unity_func)
- when "UNITY_TEST_ASSERT_EQUAL_MEMORY"
- c_type_local = c_type.gsub(/\*$/,'')
- lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type_local}), cmock_line, CMockStringMismatch);\n"
- when "UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY"
- if (pre == '&')
- lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*','')}), cmock_line, CMockStringMismatch);\n"
- else
- lines << " if (#{pre}#{expected} == NULL)\n"
- lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n"
- lines << " else\n"
- lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*','')}), cmock_line, CMockStringMismatch); }\n"
- end
- when /_ARRAY/
- if (pre == '&')
- lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, 1, cmock_line, CMockStringMismatch);\n"
- else
- lines << " if (#{pre}#{expected} == NULL)\n"
- lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n"
- lines << " else\n"
- lines << " { #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, 1, cmock_line, CMockStringMismatch); }\n"
- end
- else
- lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch);\n"
- end
- lines << " }\n"
- lines
- end
-
- def code_verify_an_arg_expectation_with_normal_arrays(function, arg)
- c_type, arg_name, expected, ignore, unity_func, pre = lookup_expect_type(function, arg)
- depth_name = (arg[:ptr?]) ? "cmock_call_instance->Expected_#{arg_name}_Depth" : 1
- lines = ""
- lines << " if (!#{ignore})\n" if @ignore_arg
- lines << " {\n"
- lines << " UNITY_SET_DETAILS(CMockString_#{function[:name]},CMockString_#{arg_name});\n"
- lines << " if (#{pre}#{expected} != #{pre}#{arg_name}) {\n"
- case(unity_func)
- when "UNITY_TEST_ASSERT_EQUAL_MEMORY"
- c_type_local = c_type.gsub(/\*$/,'')
- lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type_local}), cmock_line, CMockStringMismatch);\n"
- when "UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY"
- if (pre == '&')
- lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*','')}), cmock_line, CMockStringMismatch);\n"
- else
- lines << " if (#{pre}#{expected} == NULL)\n"
- lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n"
- lines << " else\n"
- lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*','')}), #{depth_name}, cmock_line, CMockStringMismatch); }\n"
- end
- when /_ARRAY/
- if (pre == '&')
- lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, #{depth_name}, cmock_line, CMockStringMismatch);\n"
- else
- lines << " if (#{pre}#{expected} == NULL)\n"
- lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n"
- lines << " else\n"
- lines << " { #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, #{depth_name}, cmock_line, CMockStringMismatch); }\n"
- end
- else
- lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch);\n"
- end
- lines << " }\n }\n"
- lines
- end
-
- def code_verify_an_arg_expectation_with_smart_arrays(function, arg)
- c_type, arg_name, expected, ignore, unity_func, pre = lookup_expect_type(function, arg)
- depth_name = (arg[:ptr?]) ? "cmock_call_instance->Expected_#{arg_name}_Depth" : 1
- lines = ""
- lines << " if (!#{ignore})\n" if @ignore_arg
- lines << " {\n"
- lines << " UNITY_SET_DETAILS(CMockString_#{function[:name]},CMockString_#{arg_name});\n"
- lines << " if (#{pre}#{expected} != #{pre}#{arg_name}) {\n"
- case(unity_func)
- when "UNITY_TEST_ASSERT_EQUAL_MEMORY"
- c_type_local = c_type.gsub(/\*$/,'')
- lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type_local}), cmock_line, CMockStringMismatch);\n"
- when "UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY"
- if (pre == '&')
- lines << " UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*','')}), #{depth_name}, cmock_line, CMockStringMismatch);\n"
- else
- lines << " if (#{pre}#{expected} == NULL)\n"
- lines << " { UNITY_TEST_ASSERT_NULL(#{arg_name}, cmock_line, CMockStringExpNULL); }\n"
- lines << ((depth_name != 1) ? " else if (#{depth_name} == 0)\n { UNITY_TEST_ASSERT_EQUAL_PTR(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch); }\n" : "")
- lines << " else\n"
- lines << " { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(#{pre}#{expected}), (void*)(#{pre}#{arg_name}), sizeof(#{c_type.sub('*','')}), #{depth_name}, cmock_line, CMockStringMismatch); }\n"
- end
- when /_ARRAY/
- if (pre == '&')
- lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, #{depth_name}, cmock_line, CMockStringMismatch);\n"
- else
- lines << " if (#{pre}#{expected} == NULL)\n"
- lines << " { UNITY_TEST_ASSERT_NULL(#{pre}#{arg_name}, cmock_line, CMockStringExpNULL); }\n"
- lines << ((depth_name != 1) ? " else if (#{depth_name} == 0)\n { UNITY_TEST_ASSERT_EQUAL_PTR(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch); }\n" : "")
- lines << " else\n"
- lines << " { #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, #{depth_name}, cmock_line, CMockStringMismatch); }\n"
- end
- else
- lines << " #{unity_func}(#{pre}#{expected}, #{pre}#{arg_name}, cmock_line, CMockStringMismatch);\n"
- end
- lines << " }\n }\n"
- lines
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_header_parser.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_header_parser.rb
deleted file mode 100755
index 0cf19478..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_header_parser.rb
+++ /dev/null
@@ -1,364 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class CMockHeaderParser
-
- attr_accessor :funcs, :c_attr_noconst, :c_attributes, :treat_as_void, :treat_externs
-
- def initialize(cfg)
- @funcs = []
- @c_strippables = cfg.strippables
- @c_attr_noconst = cfg.attributes.uniq - ['const']
- @c_attributes = ['const'] + c_attr_noconst
- @c_calling_conventions = cfg.c_calling_conventions.uniq
- @treat_as_array = cfg.treat_as_array
- @treat_as_void = (['void'] + cfg.treat_as_void).uniq
- @declaration_parse_matcher = /([\w\s\*\(\),\[\]]+??)\(([\w\s\*\(\),\.\[\]+-]*)\)$/m
- @standards = (['int','short','char','long','unsigned','signed'] + cfg.treat_as.keys).uniq
- @array_size_name = cfg.array_size_name
- @array_size_type = (['int', 'size_t'] + cfg.array_size_type).uniq
- @when_no_prototypes = cfg.when_no_prototypes
- @local_as_void = @treat_as_void
- @verbosity = cfg.verbosity
- @treat_externs = cfg.treat_externs
- @c_strippables += ['extern'] if (@treat_externs == :include) #we'll need to remove the attribute if we're allowing externs
- end
-
- def parse(name, source)
- @module_name = name.gsub(/\W/,'')
- @typedefs = []
- @funcs = []
- function_names = []
-
- parse_functions( import_source(source) ).map do |decl|
- func = parse_declaration(decl)
- unless (function_names.include? func[:name])
- @funcs << func
- function_names << func[:name]
- end
- end
-
- { :includes => nil,
- :functions => @funcs,
- :typedefs => @typedefs
- }
- end
-
- private if $ThisIsOnlyATest.nil? ################
-
- def import_source(source)
-
- # let's clean up the encoding in case they've done anything weird with the characters we might find
- source = source.force_encoding("ISO-8859-1").encode("utf-8", :replace => nil)
-
- # void must be void for cmock _ExpectAndReturn calls to process properly, not some weird typedef which equates to void
- # to a certain extent, this action assumes we're chewing on pre-processed header files, otherwise we'll most likely just get stuff from @treat_as_void
- @local_as_void = @treat_as_void
- void_types = source.scan(/typedef\s+(?:\(\s*)?void(?:\s*\))?\s+([\w]+)\s*;/)
- if void_types
- @local_as_void += void_types.flatten.uniq.compact
- end
-
- # smush multiline macros into single line (checking for continuation character at end of line '\')
- source.gsub!(/\s*\\\s*/m, ' ')
-
- #remove comments (block and line, in three steps to ensure correct precedence)
- source.gsub!(/(?<!\*)\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks
- source.gsub!(/\/\*.*?\*\//m, '') # remove block comments
- source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain)
-
- # remove assembler pragma sections
- source.gsub!(/^\s*#\s*pragma\s+asm\s+.*?#\s*pragma\s+endasm/m, '')
-
- # remove gcc's __attribute__ tags
- source.gsub!(/__attribute(?:__)?\s*\(\(+.*\)\)+/, '')
-
- # remove preprocessor statements and extern "C"
- source.gsub!(/^\s*#.*/, '')
- source.gsub!(/extern\s+\"C\"\s*\{/, '')
-
- # enums, unions, structs, and typedefs can all contain things (e.g. function pointers) that parse like function prototypes, so yank them
- # forward declared structs are removed before struct definitions so they don't mess up real thing later. we leave structs keywords in function prototypes
- source.gsub!(/^[\w\s]*struct[^;\{\}\(\)]+;/m, '') # remove forward declared structs
- source.gsub!(/^[\w\s]*(enum|union|struct|typedef)[\w\s]*\{[^\}]+\}[\w\s\*\,]*;/m, '') # remove struct, union, and enum definitions and typedefs with braces
- source.gsub!(/(\W)(?:register|auto|static|restrict)(\W)/, '\1\2') # remove problem keywords
- source.gsub!(/\s*=\s*['"a-zA-Z0-9_\.]+\s*/, '') # remove default value statements from argument lists
- source.gsub!(/^(?:[\w\s]*\W)?typedef\W[^;]*/m, '') # remove typedef statements
- source.gsub!(/\)(\w)/, ') \1') # add space between parenthese and alphanumeric
- source.gsub!(/(^|\W+)(?:#{@c_strippables.join('|')})(?=$|\W+)/,'\1') unless @c_strippables.empty? # remove known attributes slated to be stripped
-
- #scan standalone function pointers and remove them, because they can just be ignored
- source.gsub!(/\w+\s*\(\s*\*\s*\w+\s*\)\s*\([^)]*\)\s*;/,';')
-
- #scan for functions which return function pointers, because they are a pain
- source.gsub!(/([\w\s\*]+)\(*\(\s*\*([\w\s\*]+)\s*\(([\w\s\*,]*)\)\)\s*\(([\w\s\*,]*)\)\)*/) do |m|
- functype = "cmock_#{@module_name}_func_ptr#{@typedefs.size + 1}"
- @typedefs << "typedef #{$1.strip}(*#{functype})(#{$4});"
- "#{functype} #{$2.strip}(#{$3});"
- end
-
- # remove nested pairs of braces because no function declarations will be inside of them (leave outer pair for function definition detection)
- if (RUBY_VERSION.split('.')[0].to_i > 1)
- #we assign a string first because (no joke) if Ruby 1.9.3 sees this line as a regex, it will crash.
- r = "\\{([^\\{\\}]*|\\g<0>)*\\}"
- source.gsub!(/#{r}/m, '{ }')
- else
- while source.gsub!(/\{[^\{\}]*\{[^\{\}]*\}[^\{\}]*\}/m, '{ }')
- end
- end
-
- # remove function definitions by stripping off the arguments right now
- source.gsub!(/\([^\)]*\)\s*\{[^\}]*\}/m, ";")
-
- #drop extra white space to make the rest go faster
- source.gsub!(/^\s+/, '') # remove extra white space from beginning of line
- source.gsub!(/\s+$/, '') # remove extra white space from end of line
- source.gsub!(/\s*\(\s*/, '(') # remove extra white space from before left parens
- source.gsub!(/\s*\)\s*/, ')') # remove extra white space from before right parens
- source.gsub!(/\s+/, ' ') # remove remaining extra white space
-
- #split lines on semicolons and remove things that are obviously not what we are looking for
- src_lines = source.split(/\s*;\s*/).uniq
- src_lines.delete_if {|line| line.strip.length == 0} # remove blank lines
- src_lines.delete_if {|line| !(line =~ /[\w\s\*]+\(+\s*\*[\*\s]*[\w\s]+(?:\[[\w\s]*\]\s*)+\)+\s*\((?:[\w\s\*]*,?)*\s*\)/).nil?} #remove function pointer arrays
- if (@treat_externs == :include)
- src_lines.delete_if {|line| !(line =~ /(?:^|\s+)(?:inline)\s+/).nil?} # remove inline functions
- else
- src_lines.delete_if {|line| !(line =~ /(?:^|\s+)(?:extern|inline)\s+/).nil?} # remove inline and extern functions
- end
- src_lines.delete_if {|line| line.empty? } #drop empty lines
- end
-
- def parse_functions(source)
- funcs = []
- source.each {|line| funcs << line.strip.gsub(/\s+/, ' ') if (line =~ @declaration_parse_matcher)}
- if funcs.empty?
- case @when_no_prototypes
- when :error
- raise "ERROR: No function prototypes found!"
- when :warn
- puts "WARNING: No function prototypes found!" unless (@verbosity < 1)
- end
- end
- return funcs
- end
-
- def parse_type_and_name(arg)
- # Split up words and remove known attributes. For pointer types, make sure
- # to remove 'const' only when it applies to the pointer itself, not when it
- # applies to the type pointed to. For non-pointer types, remove any
- # occurrence of 'const'.
- arg.gsub!(/(\w)\*/,'\1 *') # pull asterisks away from preceding word
- arg.gsub!(/\*(\w)/,'* \1') # pull asterisks away from following word
- arg_array = arg.split
- arg_info = divine_ptr_and_const(arg)
- arg_info[:name] = arg_array[-1]
-
- attributes = arg.include?('*') ? @c_attr_noconst : @c_attributes
- attr_array = []
- type_array = []
-
- arg_array[0..-2].each do |word|
- if attributes.include?(word)
- attr_array << word
- elsif @c_calling_conventions.include?(word)
- arg_info[:c_calling_convention] = word
- else
- type_array << word
- end
- end
-
- if arg_info[:const_ptr?]
- attr_array << 'const'
- type_array.delete_at(type_array.rindex('const'))
- end
-
- arg_info[:modifier] = attr_array.join(' ')
- arg_info[:type] = type_array.join(' ').gsub(/\s+\*/,'*') # remove space before asterisks
- return arg_info
- end
-
- def parse_args(arg_list)
- args = []
- arg_list.split(',').each do |arg|
- arg.strip!
- return args if (arg =~ /^\s*((\.\.\.)|(void))\s*$/) # we're done if we reach void by itself or ...
-
- arg_info = parse_type_and_name(arg)
- arg_info.delete(:modifier) # don't care about this
- arg_info.delete(:c_calling_convention) # don't care about this
-
- # in C, array arguments implicitly degrade to pointers
- # make the translation explicit here to simplify later logic
- if @treat_as_array[arg_info[:type]] and not arg_info[:ptr?] then
- arg_info[:type] = "#{@treat_as_array[arg_info[:type]]}*"
- arg_info[:type] = "const #{arg_info[:type]}" if arg_info[:const?]
- arg_info[:ptr?] = true
- end
-
- args << arg_info
- end
-
- # Try to find array pair in parameters following this pattern : <type> * <name>, <@array_size_type> <@array_size_name>
- args.each_with_index {|val, index|
- next_index = index + 1
- if (args.length > next_index)
- if (val[:ptr?] == true and args[next_index][:name].match(@array_size_name) and @array_size_type.include?(args[next_index][:type]))
- val[:array_data?] = true
- args[next_index][:array_size?] = true
- end
- end
- }
-
- return args
- end
-
- def divine_ptr(arg)
- return false unless arg.include? '*'
- # treat "const char *" and similar as a string, not a pointer
- return false if /(^|\s)(const\s+)?char(\s+const)?\s*\*(?!.*\*)/ =~ arg
- return true
- end
-
- def divine_const(arg)
- # a non-pointer arg containing "const" is a constant
- # an arg containing "const" before the last * is a pointer to a constant
- return ( arg.include?('*') ? (/(^|\s|\*)const(\s(\w|\s)*)?\*(?!.*\*)/ =~ arg)
- : (/(^|\s)const(\s|$)/ =~ arg) ) ? true : false
- end
-
- def divine_ptr_and_const(arg)
- divination = {}
-
- divination[:ptr?] = divine_ptr(arg)
- divination[:const?] = divine_const(arg)
-
- # an arg containing "const" after the last * is a constant pointer
- divination[:const_ptr?] = (/\*(?!.*\*)\s*const(\s|$)/ =~ arg) ? true : false
-
- return divination
- end
-
- def clean_args(arg_list)
- if ((@local_as_void.include?(arg_list.strip)) or (arg_list.empty?))
- return 'void'
- else
- c=0
- arg_list.gsub!(/(\w+)(?:\s*\[\s*\(*[\s\w+-]*\)*\s*\])+/,'*\1') # magically turn brackets into asterisks, also match for parentheses that come from macros
- arg_list.gsub!(/\s+\*/,'*') # remove space to place asterisks with type (where they belong)
- arg_list.gsub!(/\*(\w)/,'* \1') # pull asterisks away from arg to place asterisks with type (where they belong)
-
- #scan argument list for function pointers and replace them with custom types
- arg_list.gsub!(/([\w\s\*]+)\(+\s*\*[\*\s]*([\w\s]*)\s*\)+\s*\(((?:[\w\s\*]*,?)*)\s*\)*/) do |m|
-
- functype = "cmock_#{@module_name}_func_ptr#{@typedefs.size + 1}"
- funcret = $1.strip
- funcname = $2.strip
- funcargs = $3.strip
- funconst = ''
- if (funcname.include? 'const')
- funcname.gsub!('const','').strip!
- funconst = 'const '
- end
- @typedefs << "typedef #{funcret}(*#{functype})(#{funcargs});"
- funcname = "cmock_arg#{c+=1}" if (funcname.empty?)
- "#{functype} #{funconst}#{funcname}"
- end
-
- #automatically name unnamed arguments (those that only had a type)
- arg_list.split(/\s*,\s*/).map { |arg|
- parts = (arg.split - ['struct', 'union', 'enum', 'const', 'const*'])
- if ((parts.size < 2) or (parts[-1][-1].chr == '*') or (@standards.include?(parts[-1])))
- "#{arg} cmock_arg#{c+=1}"
- else
- arg
- end
- }.join(', ')
- end
- end
-
- def parse_declaration(declaration)
- decl = {}
-
- regex_match = @declaration_parse_matcher.match(declaration)
- raise "Failed parsing function declaration: '#{declaration}'" if regex_match.nil?
-
- #grab argument list
- args = regex_match[2].strip
-
- #process function attributes, return type, and name
- parsed = parse_type_and_name(regex_match[1])
-
- decl[:name] = parsed[:name]
- decl[:modifier] = parsed[:modifier]
- unless parsed[:c_calling_convention].nil?
- decl[:c_calling_convention] = parsed[:c_calling_convention]
- end
-
- rettype = parsed[:type]
- rettype = 'void' if (@local_as_void.include?(rettype.strip))
- decl[:return] = { :type => rettype,
- :name => 'cmock_to_return',
- :str => "#{rettype} cmock_to_return",
- :void? => (rettype == 'void'),
- :ptr? => parsed[:ptr?],
- :const? => parsed[:const?],
- :const_ptr? => parsed[:const_ptr?]
- }
-
- #remove default argument statements from mock definitions
- args.gsub!(/=\s*[a-zA-Z0-9_\.]+\s*/, ' ')
-
- #check for var args
- if (args =~ /\.\.\./)
- decl[:var_arg] = args.match( /[\w\s]*\.\.\./ ).to_s.strip
- if (args =~ /\,[\w\s]*\.\.\./)
- args = args.gsub!(/\,[\w\s]*\.\.\./,'')
- else
- args = 'void'
- end
- else
- decl[:var_arg] = nil
- end
- args = clean_args(args)
- decl[:args_string] = args
- decl[:args] = parse_args(args)
- decl[:args_call] = decl[:args].map{|a| a[:name]}.join(', ')
- decl[:contains_ptr?] = decl[:args].inject(false) {|ptr, arg| arg[:ptr?] ? true : ptr }
-
- if (decl[:return][:type].nil? or decl[:name].nil? or decl[:args].nil? or
- decl[:return][:type].empty? or decl[:name].empty?)
- raise "Failed Parsing Declaration Prototype!\n" +
- " declaration: '#{declaration}'\n" +
- " modifier: '#{decl[:modifier]}'\n" +
- " return: #{prototype_inspect_hash(decl[:return])}\n" +
- " function: '#{decl[:name]}'\n" +
- " args: #{prototype_inspect_array_of_hashes(decl[:args])}\n"
- end
-
- return decl
- end
-
- def prototype_inspect_hash(hash)
- pairs = []
- hash.each_pair { |name, value| pairs << ":#{name} => #{"'" if (value.class == String)}#{value}#{"'" if (value.class == String)}" }
- return "{#{pairs.join(', ')}}"
- end
-
- def prototype_inspect_array_of_hashes(array)
- hashes = []
- array.each { |hash| hashes << prototype_inspect_hash(hash) }
- case (array.size)
- when 0
- return "[]"
- when 1
- return "[#{hashes[0]}]"
- else
- return "[\n #{hashes.join("\n ")}\n ]\n"
- end
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_plugin_manager.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_plugin_manager.rb
deleted file mode 100755
index cc5ced2a..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_plugin_manager.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-require 'thread'
-
-class CMockPluginManager
-
- attr_accessor :plugins
-
- def initialize(config, utils)
- @plugins = []
- plugins_to_load = [:expect, config.plugins].flatten.uniq.compact
- plugins_to_load.each do |plugin|
- plugin_name = plugin.to_s
- object_name = "CMockGeneratorPlugin" + camelize(plugin_name)
- self.class.plugin_require_mutex.synchronize { load_plugin(plugin_name, object_name, config, utils) }
- end
- @plugins.sort! {|a,b| a.priority <=> b.priority }
- end
-
- def run(method, args=nil)
- if args.nil?
- return @plugins.collect{ |plugin| plugin.send(method) if plugin.respond_to?(method) }.flatten.join
- else
- return @plugins.collect{ |plugin| plugin.send(method, args) if plugin.respond_to?(method) }.flatten.join
- end
- end
-
- def camelize(lower_case_and_underscored_word)
- lower_case_and_underscored_word.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
- end
-
- private
-
- def self.plugin_require_mutex
- @mutex ||= Mutex.new
- end
-
- def load_plugin(plugin_name, object_name, config, utils)
- begin
- unless (Object.const_defined? object_name)
- file_name = "#{File.expand_path(File.dirname(__FILE__))}/cmock_generator_plugin_#{plugin_name.downcase}.rb"
- require file_name
- end
- class_name = Object.const_get(object_name)
- @plugins << class_name.new(config, utils)
- rescue
- file_name = "#{File.expand_path(File.dirname(__FILE__))}/cmock_generator_plugin_#{plugin_name.downcase}.rb"
- raise "ERROR: CMock unable to load plugin '#{plugin_name}' '#{object_name}' #{file_name}"
- end
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_unityhelper_parser.rb b/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_unityhelper_parser.rb
deleted file mode 100755
index c22db7aa..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/lib/cmock_unityhelper_parser.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-# ==========================================
-# CMock Project - Automatic Mock Generation for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class CMockUnityHelperParser
-
- attr_accessor :c_types
-
- def initialize(config)
- @config = config
- @fallback = @config.plugins.include?(:array) ? 'UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY' : 'UNITY_TEST_ASSERT_EQUAL_MEMORY'
- @c_types = map_C_types.merge(import_source)
- end
-
- def get_helper(ctype)
- lookup = ctype.gsub(/(?:^|(\S?)(\s*)|(\W))const(?:$|(\s*)(\S)|(\W))/,'\1\3\5\6').strip.gsub(/\s+/,'_')
- return [@c_types[lookup], ''] if (@c_types[lookup])
- if (lookup =~ /\*$/)
- lookup = lookup.gsub(/\*$/,'')
- return [@c_types[lookup], '*'] if (@c_types[lookup])
- else
- lookup = lookup + '*'
- return [@c_types[lookup], '&'] if (@c_types[lookup])
- end
- return ['UNITY_TEST_ASSERT_EQUAL_PTR', ''] if (ctype =~ /cmock_\w+_ptr\d+/)
- raise("Don't know how to test #{ctype} and memory tests are disabled!") unless @config.memcmp_if_unknown
- return (lookup =~ /\*$/) ? [@fallback, '&'] : [@fallback, '']
- end
-
- private ###########################
-
- def map_C_types
- c_types = {}
- @config.treat_as.each_pair do |ctype, expecttype|
- c_type = ctype.gsub(/\s+/,'_')
- if (expecttype =~ /\*/)
- c_types[c_type] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype.gsub(/\*/,'')}_ARRAY"
- else
- c_types[c_type] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype}"
- c_types[c_type+'*'] ||= "UNITY_TEST_ASSERT_EQUAL_#{expecttype}_ARRAY"
- end
- end
- c_types
- end
-
- def import_source
- source = @config.load_unity_helper
- return {} if source.nil?
- c_types = {}
- source = source.gsub(/\/\/.*$/, '') #remove line comments
- source = source.gsub(/\/\*.*?\*\//m, '') #remove block comments
-
- #scan for comparison helpers
- match_regex = Regexp.new('^\s*#define\s+(UNITY_TEST_ASSERT_EQUAL_(\w+))\s*\(' + Array.new(4,'\s*\w+\s*').join(',') + '\)')
- pairs = source.scan(match_regex).flatten.compact
- (pairs.size/2).times do |i|
- expect = pairs[i*2]
- ctype = pairs[(i*2)+1]
- c_types[ctype] = expect unless expect.include?("_ARRAY")
- end
-
- #scan for array variants of those helpers
- match_regex = Regexp.new('^\s*#define\s+(UNITY_TEST_ASSERT_EQUAL_(\w+_ARRAY))\s*\(' + Array.new(5,'\s*\w+\s*').join(',') + '\)')
- pairs = source.scan(match_regex).flatten.compact
- (pairs.size/2).times do |i|
- expect = pairs[i*2]
- ctype = pairs[(i*2)+1]
- c_types[ctype.gsub('_ARRAY','*')] = expect
- end
-
- c_types
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/release/build.info b/tinyusb/test/vendor/ceedling/vendor/cmock/release/build.info
deleted file mode 100755
index a62fe117..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/release/build.info
+++ /dev/null
@@ -1,2 +0,0 @@
-217
-
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/release/version.info b/tinyusb/test/vendor/ceedling/vendor/cmock/release/version.info
deleted file mode 100755
index 1b6799f8..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/release/version.info
+++ /dev/null
@@ -1,2 +0,0 @@
-2.4.6
-
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/src/cmock.c b/tinyusb/test/vendor/ceedling/vendor/cmock/src/cmock.c
deleted file mode 100755
index 5e5cb6c7..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/src/cmock.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/* ==========================================
- CMock Project - Automatic Mock Generation for C
- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
- [Released under MIT License. Please refer to license.txt for details]
-========================================== */
-
-#include "cmock.h"
-
-//public constants to be used by mocks
-const char* CMockStringOutOfMemory = "CMock has run out of memory. Please allocate more.";
-const char* CMockStringCalledMore = "Called more times than expected.";
-const char* CMockStringCalledLess = "Called fewer times than expected.";
-const char* CMockStringCalledEarly = "Called earlier than expected.";
-const char* CMockStringCalledLate = "Called later than expected.";
-const char* CMockStringCallOrder = "Called out of order.";
-const char* CMockStringIgnPreExp = "IgnoreArg called before Expect.";
-const char* CMockStringPtrPreExp = "ReturnThruPtr called before Expect.";
-const char* CMockStringPtrIsNULL = "Pointer is NULL.";
-const char* CMockStringExpNULL = "Expected NULL.";
-const char* CMockStringMismatch = "Function called with unexpected argument value.";
-
-//private variables
-#ifdef CMOCK_MEM_DYNAMIC
-static unsigned char* CMock_Guts_Buffer = NULL;
-static CMOCK_MEM_INDEX_TYPE CMock_Guts_BufferSize = CMOCK_MEM_ALIGN_SIZE;
-static CMOCK_MEM_INDEX_TYPE CMock_Guts_FreePtr = CMOCK_MEM_ALIGN_SIZE;
-#else
-static unsigned char CMock_Guts_Buffer[CMOCK_MEM_SIZE + CMOCK_MEM_ALIGN_SIZE];
-static CMOCK_MEM_INDEX_TYPE CMock_Guts_BufferSize = CMOCK_MEM_SIZE + CMOCK_MEM_ALIGN_SIZE;
-static CMOCK_MEM_INDEX_TYPE CMock_Guts_FreePtr = CMOCK_MEM_ALIGN_SIZE;
-#endif
-
-//-------------------------------------------------------
-// CMock_Guts_MemNew
-//-------------------------------------------------------
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNew(CMOCK_MEM_INDEX_TYPE size)
-{
- CMOCK_MEM_INDEX_TYPE index;
-
- //verify arguments valid (we must be allocating space for at least 1 byte, and the existing chain must be in memory somewhere)
- if (size < 1)
- return CMOCK_GUTS_NONE;
-
- //verify we have enough room
- size = size + CMOCK_MEM_INDEX_SIZE;
- if (size & CMOCK_MEM_ALIGN_MASK)
- size = (size + CMOCK_MEM_ALIGN_MASK) & ~CMOCK_MEM_ALIGN_MASK;
- if ((CMock_Guts_BufferSize - CMock_Guts_FreePtr) < size)
- {
-#ifndef CMOCK_MEM_DYNAMIC
- return CMOCK_GUTS_NONE; // nothing we can do; our static buffer is out of memory
-#else
- // our dynamic buffer does not have enough room; request more via realloc()
- CMOCK_MEM_INDEX_TYPE new_buffersize = CMock_Guts_BufferSize + CMOCK_MEM_SIZE + size;
- unsigned char* new_buffer = realloc(CMock_Guts_Buffer, (size_t)new_buffersize);
- if (new_buffer == NULL)
- return CMOCK_GUTS_NONE; // realloc() failed; out of memory
- CMock_Guts_Buffer = new_buffer;
- CMock_Guts_BufferSize = new_buffersize;
-#endif
- }
-
- //determine where we're putting this new block, and init its pointer to be the end of the line
- index = CMock_Guts_FreePtr + CMOCK_MEM_INDEX_SIZE;
- *(CMOCK_MEM_INDEX_TYPE*)(&CMock_Guts_Buffer[CMock_Guts_FreePtr]) = CMOCK_GUTS_NONE;
- CMock_Guts_FreePtr += size;
-
- return index;
-}
-
-//-------------------------------------------------------
-// CMock_Guts_MemChain
-//-------------------------------------------------------
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemChain(CMOCK_MEM_INDEX_TYPE root_index, CMOCK_MEM_INDEX_TYPE obj_index)
-{
- CMOCK_MEM_INDEX_TYPE index;
- void* root;
- void* obj;
- void* next;
-
- if (root_index == CMOCK_GUTS_NONE)
- {
- //if there is no root currently, we return this object as the root of the chain
- return obj_index;
- }
- else
- {
- //reject illegal nodes
- if ((root_index < CMOCK_MEM_ALIGN_SIZE) || (root_index >= CMock_Guts_FreePtr))
- {
- return CMOCK_GUTS_NONE;
- }
- if ((obj_index < CMOCK_MEM_ALIGN_SIZE) || (obj_index >= CMock_Guts_FreePtr))
- {
- return CMOCK_GUTS_NONE;
- }
-
- root = (void*)(&CMock_Guts_Buffer[root_index]);
- obj = (void*)(&CMock_Guts_Buffer[obj_index]);
-
- //find the end of the existing chain and add us
- next = root;
- do {
- index = *(CMOCK_MEM_INDEX_TYPE*)((CMOCK_MEM_PTR_AS_INT)next - CMOCK_MEM_INDEX_SIZE);
- if (index >= CMock_Guts_FreePtr)
- return CMOCK_GUTS_NONE;
- if (index > 0)
- next = (void*)(&CMock_Guts_Buffer[index]);
- } while (index > 0);
- *(CMOCK_MEM_INDEX_TYPE*)((CMOCK_MEM_PTR_AS_INT)next - CMOCK_MEM_INDEX_SIZE) = (CMOCK_MEM_INDEX_TYPE)((CMOCK_MEM_PTR_AS_INT)obj - (CMOCK_MEM_PTR_AS_INT)CMock_Guts_Buffer);
- return root_index;
- }
-}
-
-//-------------------------------------------------------
-// CMock_Guts_MemNext
-//-------------------------------------------------------
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNext(CMOCK_MEM_INDEX_TYPE previous_item_index)
-{
- CMOCK_MEM_INDEX_TYPE index;
- void* previous_item;
-
- //There is nothing "next" if the pointer isn't from our buffer
- if ((previous_item_index < CMOCK_MEM_ALIGN_SIZE) || (previous_item_index >= CMock_Guts_FreePtr))
- return CMOCK_GUTS_NONE;
- previous_item = (void*)(&CMock_Guts_Buffer[previous_item_index]);
-
- //if the pointer is good, then use it to look up the next index
- //(we know the first element always goes in zero, so NEXT must always be > 1)
- index = *(CMOCK_MEM_INDEX_TYPE*)((CMOCK_MEM_PTR_AS_INT)previous_item - CMOCK_MEM_INDEX_SIZE);
- if ((index > 1) && (index < CMock_Guts_FreePtr))
- return index;
- else
- return CMOCK_GUTS_NONE;
-}
-
-//-------------------------------------------------------
-// CMock_Guts_MemEndOfChain
-//-------------------------------------------------------
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemEndOfChain(CMOCK_MEM_INDEX_TYPE root_index)
-{
- CMOCK_MEM_INDEX_TYPE index = root_index;
- CMOCK_MEM_INDEX_TYPE next_index;
-
- for (next_index = root_index;
- next_index != CMOCK_GUTS_NONE;
- next_index = CMock_Guts_MemNext(index))
- {
- index = next_index;
- }
-
- return index;
-}
-
-//-------------------------------------------------------
-// CMock_GetAddressFor
-//-------------------------------------------------------
-void* CMock_Guts_GetAddressFor(CMOCK_MEM_INDEX_TYPE index)
-{
- if ((index >= CMOCK_MEM_ALIGN_SIZE) && (index < CMock_Guts_FreePtr))
- {
- return (void*)(&CMock_Guts_Buffer[index]);
- }
- else
- {
- return NULL;
- }
-}
-
-//-------------------------------------------------------
-// CMock_Guts_MemBytesCapacity
-//-------------------------------------------------------
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesCapacity(void)
-{
- return (sizeof(CMock_Guts_Buffer) - CMOCK_MEM_ALIGN_SIZE);
-}
-
-//-------------------------------------------------------
-// CMock_Guts_MemBytesFree
-//-------------------------------------------------------
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesFree(void)
-{
- return CMock_Guts_BufferSize - CMock_Guts_FreePtr;
-}
-
-//-------------------------------------------------------
-// CMock_Guts_MemBytesUsed
-//-------------------------------------------------------
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesUsed(void)
-{
- return CMock_Guts_FreePtr - CMOCK_MEM_ALIGN_SIZE;
-}
-
-//-------------------------------------------------------
-// CMock_Guts_MemFreeAll
-//-------------------------------------------------------
-void CMock_Guts_MemFreeAll(void)
-{
- CMock_Guts_FreePtr = CMOCK_MEM_ALIGN_SIZE; //skip the very beginning
-}
-
-//-------------------------------------------------------
-// CMock_Guts_MemFreeFinal
-//-------------------------------------------------------
-void CMock_Guts_MemFreeFinal(void)
-{
- CMock_Guts_FreePtr = CMOCK_MEM_ALIGN_SIZE;
-#ifdef CMOCK_MEM_DYNAMIC
- if (CMock_Guts_Buffer)
- {
- free(CMock_Guts_Buffer);
- CMock_Guts_Buffer = NULL;
- }
-#endif
-}
-
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/src/cmock.h b/tinyusb/test/vendor/ceedling/vendor/cmock/src/cmock.h
deleted file mode 100755
index e96546da..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/src/cmock.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ==========================================
- CMock Project - Automatic Mock Generation for C
- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
- [Released under MIT License. Please refer to license.txt for details]
-========================================== */
-
-#ifndef CMOCK_FRAMEWORK_H
-#define CMOCK_FRAMEWORK_H
-
-#include "cmock_internals.h"
-
-#define CMOCK_VERSION_MAJOR 2
-#define CMOCK_VERSION_MINOR 5
-#define CMOCK_VERSION_BUILD 0
-#define CMOCK_VERSION ((CMOCK_VERSION_MAJOR << 16) | (CMOCK_VERSION_MINOR << 8) | CMOCK_VERSION_BUILD)
-
-//should be big enough to index full range of CMOCK_MEM_MAX
-#ifndef CMOCK_MEM_INDEX_TYPE
-#define CMOCK_MEM_INDEX_TYPE unsigned int
-#endif
-
-#define CMOCK_GUTS_NONE (0)
-
-//-------------------------------------------------------
-// Memory API
-//-------------------------------------------------------
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNew(CMOCK_MEM_INDEX_TYPE size);
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemChain(CMOCK_MEM_INDEX_TYPE root_index, CMOCK_MEM_INDEX_TYPE obj_index);
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemNext(CMOCK_MEM_INDEX_TYPE previous_item_index);
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemEndOfChain(CMOCK_MEM_INDEX_TYPE root_index);
-
-void* CMock_Guts_GetAddressFor(CMOCK_MEM_INDEX_TYPE index);
-
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesCapacity(void);
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesFree(void);
-CMOCK_MEM_INDEX_TYPE CMock_Guts_MemBytesUsed(void);
-void CMock_Guts_MemFreeAll(void);
-void CMock_Guts_MemFreeFinal(void);
-
-#endif //CMOCK_FRAMEWORK
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/src/cmock_internals.h b/tinyusb/test/vendor/ceedling/vendor/cmock/src/cmock_internals.h
deleted file mode 100755
index ae2e4962..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/src/cmock_internals.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* ==========================================
- CMock Project - Automatic Mock Generation for C
- Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
- [Released under MIT License. Please refer to license.txt for details]
-========================================== */
-
-#ifndef CMOCK_FRAMEWORK_INTERNALS_H
-#define CMOCK_FRAMEWORK_INTERNALS_H
-
-#include "unity.h"
-
-//These are constants that the generated mocks have access to
-extern const char* CMockStringOutOfMemory;
-extern const char* CMockStringCalledMore;
-extern const char* CMockStringCalledLess;
-extern const char* CMockStringCalledEarly;
-extern const char* CMockStringCalledLate;
-extern const char* CMockStringCallOrder;
-extern const char* CMockStringIgnPreExp;
-extern const char* CMockStringPtrPreExp;
-extern const char* CMockStringPtrIsNULL;
-extern const char* CMockStringExpNULL;
-extern const char* CMockStringMismatch;
-
-//define CMOCK_MEM_DYNAMIC to grab memory as needed with malloc
-//when you do that, CMOCK_MEM_SIZE is used for incremental size instead of total
-#ifdef CMOCK_MEM_STATIC
-#undef CMOCK_MEM_DYNAMIC
-#endif
-
-#ifdef CMOCK_MEM_DYNAMIC
-#include <stdlib.h>
-#endif
-
-//this is used internally during pointer arithmetic. make sure this type is the same size as the target's pointer type
-#ifndef CMOCK_MEM_PTR_AS_INT
-#ifdef UNITY_POINTER_WIDTH
-#ifdef UNITY_INT_WIDTH
-#if UNITY_POINTER_WIDTH == UNITY_INT_WIDTH
-#define CMOCK_MEM_PTR_AS_INT unsigned int
-#endif
-#endif
-#endif
-#endif
-
-#ifndef CMOCK_MEM_PTR_AS_INT
-#ifdef UNITY_POINTER_WIDTH
-#ifdef UNITY_LONG_WIDTH
-#if UNITY_POINTER_WIDTH == UNITY_LONG_WIDTH
-#define CMOCK_MEM_PTR_AS_INT unsigned long
-#endif
-#if UNITY_POINTER_WIDTH > UNITY_LONG_WIDTH
-#define CMOCK_MEM_PTR_AS_INT unsigned long long
-#endif
-#endif
-#endif
-#endif
-
-#ifndef CMOCK_MEM_PTR_AS_INT
-#define CMOCK_MEM_PTR_AS_INT unsigned long
-#endif
-
-//0 for no alignment, 1 for 16-bit, 2 for 32-bit, 3 for 64-bit
-#ifndef CMOCK_MEM_ALIGN
- #ifdef UNITY_LONG_WIDTH
- #if (UNITY_LONG_WIDTH == 16)
- #define CMOCK_MEM_ALIGN (1)
- #elif (UNITY_LONG_WIDTH == 32)
- #define CMOCK_MEM_ALIGN (2)
- #elif (UNITY_LONG_WIDTH == 64)
- #define CMOCK_MEM_ALIGN (3)
- #else
- #define CMOCK_MEM_ALIGN (2)
- #endif
- #else
- #define CMOCK_MEM_ALIGN (2)
- #endif
-#endif
-
-//amount of memory to allow cmock to use in its internal heap
-#ifndef CMOCK_MEM_SIZE
-#define CMOCK_MEM_SIZE (32768)
-#endif
-
-//automatically calculated defs for easier reading
-#define CMOCK_MEM_ALIGN_SIZE (CMOCK_MEM_INDEX_TYPE)(1u << CMOCK_MEM_ALIGN)
-#define CMOCK_MEM_ALIGN_MASK (CMOCK_MEM_INDEX_TYPE)(CMOCK_MEM_ALIGN_SIZE - 1)
-#define CMOCK_MEM_INDEX_SIZE (CMOCK_MEM_INDEX_TYPE)(CMOCK_MEM_PTR_AS_INT)((sizeof(CMOCK_MEM_INDEX_TYPE) > CMOCK_MEM_ALIGN_SIZE) ? sizeof(CMOCK_MEM_INDEX_TYPE) : CMOCK_MEM_ALIGN_SIZE)
-
-
-#endif //CMOCK_FRAMEWORK_INTERNALS
diff --git a/tinyusb/test/vendor/ceedling/vendor/cmock/src/meson.build b/tinyusb/test/vendor/ceedling/vendor/cmock/src/meson.build
deleted file mode 100755
index e375e81a..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/cmock/src/meson.build
+++ /dev/null
@@ -1,17 +0,0 @@
-###################################################################################
-# #
-# NAME: meson.build #
-# #
-# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
-# WRITTEN BY: Michael Brockus. #
-# #
-# License: MIT #
-# #
-###################################################################################
-
-cmock_dir = include_directories('.')
-
-cmock_lib = static_library(meson.project_name(),
- sources: ['cmock.c'],
- dependencies: [unity_dep],
- include_directories: cmock_dir)
diff --git a/tinyusb/test/vendor/ceedling/vendor/deep_merge/lib/deep_merge.rb b/tinyusb/test/vendor/ceedling/vendor/deep_merge/lib/deep_merge.rb
deleted file mode 100755
index 4c4b7610..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/deep_merge/lib/deep_merge.rb
+++ /dev/null
@@ -1,211 +0,0 @@
-module DeepMerge
-
- MAJOR_VERSION = 0
- MINOR_VERSION = 1
- FIX_VERSION = 0
- VERSION = "#{MAJOR_VERSION}.#{MINOR_VERSION}.#{FIX_VERSION}"
-
- class InvalidParameter < StandardError; end
-
- DEFAULT_FIELD_KNOCKOUT_PREFIX = '--'
-
- module DeepMergeHash
- # ko_hash_merge! will merge and knockout elements prefixed with DEFAULT_FIELD_KNOCKOUT_PREFIX
- def ko_deep_merge!(source, options = {})
- default_opts = {:knockout_prefix => "--", :preserve_unmergeables => false}
- DeepMerge::deep_merge!(source, self, default_opts.merge(options))
- end
-
- # deep_merge! will merge and overwrite any unmergeables in destination hash
- def deep_merge!(source, options = {})
- default_opts = {:preserve_unmergeables => false}
- DeepMerge::deep_merge!(source, self, default_opts.merge(options))
- end
-
- # deep_merge will merge and skip any unmergeables in destination hash
- def deep_merge(source, options = {})
- default_opts = {:preserve_unmergeables => true}
- DeepMerge::deep_merge!(source, self, default_opts.merge(options))
- end
-
- end # DeepMergeHashExt
-
- # Deep Merge core documentation.
- # deep_merge! method permits merging of arbitrary child elements. The two top level
- # elements must be hashes. These hashes can contain unlimited (to stack limit) levels
- # of child elements. These child elements to not have to be of the same types.
- # Where child elements are of the same type, deep_merge will attempt to merge them together.
- # Where child elements are not of the same type, deep_merge will skip or optionally overwrite
- # the destination element with the contents of the source element at that level.
- # So if you have two hashes like this:
- # source = {:x => [1,2,3], :y => 2}
- # dest = {:x => [4,5,'6'], :y => [7,8,9]}
- # dest.deep_merge!(source)
- # Results: {:x => [1,2,3,4,5,'6'], :y => 2}
- # By default, "deep_merge!" will overwrite any unmergeables and merge everything else.
- # To avoid this, use "deep_merge" (no bang/exclamation mark)
- #
- # Options:
- # Options are specified in the last parameter passed, which should be in hash format:
- # hash.deep_merge!({:x => [1,2]}, {:knockout_prefix => '--'})
- # :preserve_unmergeables DEFAULT: false
- # Set to true to skip any unmergeable elements from source
- # :knockout_prefix DEFAULT: nil
- # Set to string value to signify prefix which deletes elements from existing element
- # :sort_merged_arrays DEFAULT: false
- # Set to true to sort all arrays that are merged together
- # :unpack_arrays DEFAULT: nil
- # Set to string value to run "Array::join" then "String::split" against all arrays
- # :merge_debug DEFAULT: false
- # Set to true to get console output of merge process for debugging
- #
- # Selected Options Details:
- # :knockout_prefix => The purpose of this is to provide a way to remove elements
- # from existing Hash by specifying them in a special way in incoming hash
- # source = {:x => ['--1', '2']}
- # dest = {:x => ['1', '3']}
- # dest.ko_deep_merge!(source)
- # Results: {:x => ['2','3']}
- # Additionally, if the knockout_prefix is passed alone as a string, it will cause
- # the entire element to be removed:
- # source = {:x => '--'}
- # dest = {:x => [1,2,3]}
- # dest.ko_deep_merge!(source)
- # Results: {:x => ""}
- # :unpack_arrays => The purpose of this is to permit compound elements to be passed
- # in as strings and to be converted into discrete array elements
- # irsource = {:x => ['1,2,3', '4']}
- # dest = {:x => ['5','6','7,8']}
- # dest.deep_merge!(source, {:unpack_arrays => ','})
- # Results: {:x => ['1','2','3','4','5','6','7','8'}
- # Why: If receiving data from an HTML form, this makes it easy for a checkbox
- # to pass multiple values from within a single HTML element
- #
- # There are many tests for this library - and you can learn more about the features
- # and usages of deep_merge! by just browsing the test examples
- def DeepMerge.deep_merge!(source, dest, options = {})
- # turn on this line for stdout debugging text
- merge_debug = options[:merge_debug] || false
- overwrite_unmergeable = !options[:preserve_unmergeables]
- knockout_prefix = options[:knockout_prefix] || nil
- if knockout_prefix == "" then raise InvalidParameter, "knockout_prefix cannot be an empty string in deep_merge!"; end
- if knockout_prefix && !overwrite_unmergeable then raise InvalidParameter, "overwrite_unmergeable must be true if knockout_prefix is specified in deep_merge!"; end
- # if present: we will split and join arrays on this char before merging
- array_split_char = options[:unpack_arrays] || false
- # request that we sort together any arrays when they are merged
- sort_merged_arrays = options[:sort_merged_arrays] || false
- di = options[:debug_indent] || ''
- # do nothing if source is nil
- if source.nil? || (source.respond_to?(:blank?) && source.blank?) then return dest; end
- # if dest doesn't exist, then simply copy source to it
- if dest.nil? && overwrite_unmergeable then dest = source; return dest; end
-
- puts "#{di}Source class: #{source.class.inspect} :: Dest class: #{dest.class.inspect}" if merge_debug
- if source.kind_of?(Hash)
- puts "#{di}Hashes: #{source.inspect} :: #{dest.inspect}" if merge_debug
- source.each do |src_key, src_value|
- if dest.kind_of?(Hash)
- puts "#{di} looping: #{src_key.inspect} => #{src_value.inspect} :: #{dest.inspect}" if merge_debug
- if not dest[src_key].nil?
- puts "#{di} ==>merging: #{src_key.inspect} => #{src_value.inspect} :: #{dest[src_key].inspect}" if merge_debug
- dest[src_key] = deep_merge!(src_value, dest[src_key], options.merge(:debug_indent => di + ' '))
- else # dest[src_key] doesn't exist so we want to create and overwrite it (but we do this via deep_merge!)
- puts "#{di} ==>merging over: #{src_key.inspect} => #{src_value.inspect}" if merge_debug
- # note: we rescue here b/c some classes respond to "dup" but don't implement it (Numeric, TrueClass, FalseClass, NilClass among maybe others)
- begin
- src_dup = src_value.dup # we dup src_value if possible because we're going to merge into it (since dest is empty)
- rescue TypeError
- src_dup = src_value
- end
- dest[src_key] = deep_merge!(src_value, src_dup, options.merge(:debug_indent => di + ' '))
- end
- else # dest isn't a hash, so we overwrite it completely (if permitted)
- if overwrite_unmergeable
- puts "#{di} overwriting dest: #{src_key.inspect} => #{src_value.inspect} -over-> #{dest.inspect}" if merge_debug
- dest = overwrite_unmergeables(source, dest, options)
- end
- end
- end
- elsif source.kind_of?(Array)
- puts "#{di}Arrays: #{source.inspect} :: #{dest.inspect}" if merge_debug
- # if we are instructed, join/split any source arrays before processing
- if array_split_char
- puts "#{di} split/join on source: #{source.inspect}" if merge_debug
- source = source.join(array_split_char).split(array_split_char)
- if dest.kind_of?(Array) then dest = dest.join(array_split_char).split(array_split_char); end
- end
- # if there's a naked knockout_prefix in source, that means we are to truncate dest
- if source.index(knockout_prefix) then dest = clear_or_nil(dest); source.delete(knockout_prefix); end
- if dest.kind_of?(Array)
- if knockout_prefix
- print "#{di} knocking out: " if merge_debug
- # remove knockout prefix items from both source and dest
- source.delete_if do |ko_item|
- retval = false
- item = ko_item.respond_to?(:gsub) ? ko_item.gsub(%r{^#{knockout_prefix}}, "") : ko_item
- if item != ko_item
- print "#{ko_item} - " if merge_debug
- dest.delete(item)
- dest.delete(ko_item)
- retval = true
- end
- retval
- end
- puts if merge_debug
- end
- puts "#{di} merging arrays: #{source.inspect} :: #{dest.inspect}" if merge_debug
- dest = dest | source
- if sort_merged_arrays then dest.sort!; end
- elsif overwrite_unmergeable
- puts "#{di} overwriting dest: #{source.inspect} -over-> #{dest.inspect}" if merge_debug
- dest = overwrite_unmergeables(source, dest, options)
- end
- else # src_hash is not an array or hash, so we'll have to overwrite dest
- puts "#{di}Others: #{source.inspect} :: #{dest.inspect}" if merge_debug
- dest = overwrite_unmergeables(source, dest, options)
- end
- puts "#{di}Returning #{dest.inspect}" if merge_debug
- dest
- end # deep_merge!
-
- # allows deep_merge! to uniformly handle overwriting of unmergeable entities
- def DeepMerge::overwrite_unmergeables(source, dest, options)
- merge_debug = options[:merge_debug] || false
- overwrite_unmergeable = !options[:preserve_unmergeables]
- knockout_prefix = options[:knockout_prefix] || false
- di = options[:debug_indent] || ''
- if knockout_prefix && overwrite_unmergeable
- if source.kind_of?(String) # remove knockout string from source before overwriting dest
- src_tmp = source.gsub(%r{^#{knockout_prefix}},"")
- elsif source.kind_of?(Array) # remove all knockout elements before overwriting dest
- src_tmp = source.delete_if {|ko_item| ko_item.kind_of?(String) && ko_item.match(%r{^#{knockout_prefix}}) }
- else
- src_tmp = source
- end
- if src_tmp == source # if we didn't find a knockout_prefix then we just overwrite dest
- puts "#{di}#{src_tmp.inspect} -over-> #{dest.inspect}" if merge_debug
- dest = src_tmp
- else # if we do find a knockout_prefix, then we just delete dest
- puts "#{di}\"\" -over-> #{dest.inspect}" if merge_debug
- dest = ""
- end
- elsif overwrite_unmergeable
- dest = source
- end
- dest
- end
-
- def DeepMerge::clear_or_nil(obj)
- if obj.respond_to?(:clear)
- obj.clear
- else
- obj = nil
- end
- obj
- end
-
-end # module DeepMerge
-
-class Hash
- include DeepMerge::DeepMergeHash
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/diy/lib/diy.rb b/tinyusb/test/vendor/ceedling/vendor/diy/lib/diy.rb
deleted file mode 100755
index 581afc7e..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/diy/lib/diy.rb
+++ /dev/null
@@ -1,403 +0,0 @@
-require 'diy/factory.rb'
-require 'yaml'
-require 'set'
-
-module DIY #:nodoc:#
- VERSION = '1.1.2'
- class Context
-
- class << self
- # Enable / disable automatic requiring of libraries. Default: true
- attr_accessor :auto_require
- end
- @auto_require = true
-
- # Accepts a Hash defining the object context (usually loaded from objects.yml), and an additional
- # Hash containing objects to inject into the context.
- def initialize(context_hash, extra_inputs={})
- raise "Nil context hash" unless context_hash
- raise "Need a hash" unless context_hash.kind_of?(Hash)
- [ "[]", "keys" ].each do |mname|
- unless extra_inputs.respond_to?(mname)
- raise "Extra inputs must respond to hash-like [] operator and methods #keys and #each"
- end
- end
-
- # store extra inputs
- if extra_inputs.kind_of?(Hash)
- @extra_inputs= {}
- extra_inputs.each { |k,v| @extra_inputs[k.to_s] = v } # smooth out the names
- else
- @extra_inputs = extra_inputs
- end
-
- collect_object_and_subcontext_defs context_hash
-
- # init the cache
- @cache = {}
- @cache['this_context'] = self
- end
-
-
- # Convenience: create a new DIY::Context by loading from a String (or open file handle.)
- def self.from_yaml(io_or_string, extra_inputs={})
- raise "nil input to YAML" unless io_or_string
- Context.new(YAML.load(io_or_string), extra_inputs)
- end
-
- # Convenience: create a new DIY::Context by loading from the named file.
- def self.from_file(fname, extra_inputs={})
- raise "nil file name" unless fname
- self.from_yaml(File.read(fname), extra_inputs)
- end
-
- # Return a reference to the object named. If necessary, the object will
- # be instantiated on first use. If the object is non-singleton, a new
- # object will be produced each time.
- def get_object(obj_name)
- key = obj_name.to_s
- obj = @cache[key]
- unless obj
- if extra_inputs_has(key)
- obj = @extra_inputs[key]
- else
- case @defs[key]
- when MethodDef
- obj = construct_method(key)
- when FactoryDef
- obj = construct_factory(key)
- @cache[key] = obj
- else
- obj = construct_object(key)
- @cache[key] = obj if @defs[key].singleton?
- end
- end
- end
- obj
- end
- alias :[] :get_object
-
- # Inject a named object into the Context. This must be done before the Context has instantiated the
- # object in question.
- def set_object(obj_name,obj)
- key = obj_name.to_s
- raise "object '#{key}' already exists in context" if @cache.keys.include?(key)
- @cache[key] = obj
- end
- alias :[]= :set_object
-
- # Provide a listing of object names
- def keys
- (@defs.keys.to_set + @extra_inputs.keys.to_set).to_a
- end
-
- # Instantiate and yield the named subcontext
- def within(sub_context_name)
- # Find the subcontext definitaion:
- context_def = @sub_context_defs[sub_context_name.to_s]
- raise "No sub-context named #{sub_context_name}" unless context_def
- # Instantiate a new context using self as parent:
- context = Context.new( context_def, self )
-
- yield context
- end
-
- # Returns true if the context contains an object with the given name
- def contains_object(obj_name)
- key = obj_name.to_s
- @defs.keys.member?(key) or extra_inputs_has(key)
- end
-
- # Every top level object in the Context is instantiated. This is especially useful for
- # systems that have "floating observers"... objects that are never directly accessed, who
- # would thus never be instantiated by coincedence. This does not build any subcontexts
- # that may exist.
- def build_everything
- @defs.keys.each { |k| self[k] }
- end
- alias :build_all :build_everything
- alias :preinstantiate_singletons :build_everything
-
- private
-
- def collect_object_and_subcontext_defs(context_hash)
- @defs = {}
- @sub_context_defs = {}
- get_defs_from context_hash
- end
-
- def get_defs_from(hash, namespace=nil)
- hash.each do |name,info|
- # we modify the info hash below so it's important to have a new
- # instance to play with
- info = info.dup if info
-
- # see if we are building a factory
- if info and info.has_key?('builds')
- unless info.has_key?('auto_require')
- info['auto_require'] = self.class.auto_require
- end
-
- if namespace
- info['builds'] = namespace.build_classname(info['builds'])
- end
- @defs[name] = FactoryDef.new({:name => name,
- :target => info['builds'],
- :library => info['library'],
- :auto_require => info['auto_require']})
- next
- end
-
- name = name.to_s
- case name
- when /^\+/
- # subcontext
- @sub_context_defs[name.gsub(/^\+/,'')] = info
-
- when /^using_namespace/
- # namespace: use a module(s) prefix for the classname of contained object defs
- # NOTE: namespacing is NOT scope... it's just a convenient way to setup class names for a group of objects.
- get_defs_from info, parse_namespace(name)
- when /^method\s/
- key_name = name.gsub(/^method\s/, "")
- @defs[key_name] = MethodDef.new(:name => key_name,
- :object => info['object'],
- :method => info['method'],
- :attach => info['attach'])
- else
- # Normal object def
- info ||= {}
- if extra_inputs_has(name)
- raise ConstructionError.new(name, "Object definition conflicts with parent context")
- end
- unless info.has_key?('auto_require')
- info['auto_require'] = self.class.auto_require
- end
- if namespace
- if info['class']
- info['class'] = namespace.build_classname(info['class'])
- else
- info['class'] = namespace.build_classname(name)
- end
- end
-
- @defs[name] = ObjectDef.new(:name => name, :info => info)
-
- end
- end
- end
-
- def construct_method(key)
- method_definition = @defs[key]
- object = get_object(method_definition.object)
- method = object.method(method_definition.method)
-
- unless method_definition.attach.nil?
- instance_var_name = "@__diy_#{method_definition.object}"
-
- method_definition.attach.each do |object_key|
- get_object(object_key).instance_eval do
- instance_variable_set(instance_var_name, object)
- eval %|def #{key}(*args)
- #{instance_var_name}.#{method_definition.method}(*args)
- end|
- end
- end
- end
-
- return method
- rescue Exception => oops
- build_and_raise_construction_error(key, oops)
- end
-
- def construct_object(key)
- # Find the object definition
- obj_def = @defs[key]
- raise "No object definition for '#{key}'" unless obj_def
- # If object def mentions a library, load it
- require obj_def.library if obj_def.library
-
- # Resolve all components for the object
- arg_hash = {}
- obj_def.components.each do |name,value|
- case value
- when Lookup
- arg_hash[name.to_sym] = get_object(value.name)
- when StringValue
- arg_hash[name.to_sym] = value.literal_value
- else
- raise "Cannot cope with component definition '#{value.inspect}'"
- end
- end
- # Get a reference to the class for the object
- big_c = get_class_for_name_with_module_delimeters(obj_def.class_name)
- # Make and return the instance
- if obj_def.use_class_directly?
- return big_c
- elsif arg_hash.keys.size > 0
- return big_c.new(arg_hash)
- else
- return big_c.new
- end
- rescue Exception => oops
- build_and_raise_construction_error(key, oops)
- end
-
- def build_and_raise_construction_error(key, oops)
- cerr = ConstructionError.new(key,oops)
- cerr.set_backtrace(oops.backtrace)
- raise cerr
- end
-
- def get_class_for_name_with_module_delimeters(class_name)
- class_name.split(/::/).inject(Object) do |mod,const_name| mod.const_get(const_name) end
- end
-
- def extra_inputs_has(key)
- if key.nil? or key.strip == ''
- raise ArgumentError.new("Cannot lookup objects with nil keys")
- end
- @extra_inputs.keys.member?(key) or @extra_inputs.keys.member?(key.to_sym)
- end
-
- def parse_namespace(str)
- Namespace.new(str)
- end
- end
-
- class Namespace #:nodoc:#
- def initialize(str)
- # 'using_namespace Animal Reptile'
- parts = str.split(/\s+/)
- raise "Namespace definitions must begin with 'using_namespace'" unless parts[0] == 'using_namespace'
- parts.shift
-
- if parts.length > 0 and parts[0] =~ /::/
- parts = parts[0].split(/::/)
- end
-
- raise NamespaceError, "Namespace needs to indicate a module" if parts.empty?
-
- @module_nest = parts
- end
-
- def build_classname(name)
- [ @module_nest, Infl.camelize(name) ].flatten.join("::")
- end
- end
-
- class Lookup #:nodoc:
- attr_reader :name
- def initialize(obj_name)
- @name = obj_name
- end
- end
-
- class MethodDef #:nodoc:
- attr_accessor :name, :object, :method, :attach
-
- def initialize(opts)
- @name, @object, @method, @attach = opts[:name], opts[:object], opts[:method], opts[:attach]
- end
- end
-
- class ObjectDef #:nodoc:
- attr_accessor :name, :class_name, :library, :components
- def initialize(opts)
- name = opts[:name]
- raise "Can't make an ObjectDef without a name" if name.nil?
-
- info = opts[:info] || {}
- info = info.clone
-
- @components = {}
-
- # Object name
- @name = name
-
- # Class name
- @class_name = info.delete 'class'
- @class_name ||= info.delete 'type'
- @class_name ||= Infl.camelize(@name)
-
- # Auto Require
- @auto_require = info.delete 'auto_require'
-
- # Library
- @library = info.delete 'library'
- @library ||= info.delete 'lib'
- @library ||= Infl.underscore(@class_name) if @auto_require
-
- # Use Class Directly
- @use_class_directly = info.delete 'use_class_directly'
-
- # Auto-compose
- compose = info.delete 'compose'
- if compose
- case compose
- when Array
- auto_names = compose.map { |x| x.to_s }
- when String
- auto_names = compose.split(',').map { |x| x.to_s.strip }
- when Symbol
- auto_names = [ compose.to_s ]
- else
- raise "Cannot auto compose object #{@name}, bad 'compose' format: #{compose.inspect}"
- end
- end
- auto_names ||= []
- auto_names.each do |cname|
- @components[cname] = Lookup.new(cname)
- end
-
- # Singleton status
- if info['singleton'].nil?
- @singleton = true
- else
- @singleton = info['singleton']
- end
- info.delete 'singleton'
-
- # Remaining keys
- info.each do |key,val|
- @components[key.to_s] = Lookup.new(val.to_s)
- end
-
- end
-
- def singleton?
- @singleton
- end
-
- def use_class_directly?
- @use_class_directly == true
- end
-
- end
-
- class ConstructionError < RuntimeError #:nodoc:#
- def initialize(object_name, cause=nil)
- object_name = object_name
- cause = cause
- m = "Failed to construct '#{object_name}'"
- if cause
- m << "\n ...caused by:\n >>> #{cause}"
- end
- super m
- end
- end
-
- class NamespaceError < RuntimeError #:nodoc:#
- end
-
- module Infl #:nodoc:#
- # Ganked this from Inflector:
- def self.camelize(lower_case_and_underscored_word)
- lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
- end
- # Ganked this from Inflector:
- def self.underscore(camel_cased_word)
- camel_cased_word.to_s.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z])/,'\1_\2').gsub(/([a-z\d])([A-Z])/,'\1_\2').downcase
- end
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/diy/lib/diy/factory.rb b/tinyusb/test/vendor/ceedling/vendor/diy/lib/diy/factory.rb
deleted file mode 100755
index d2566c5d..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/diy/lib/diy/factory.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-module DIY #:nodoc:#
- class FactoryDef #:nodoc:
- attr_accessor :name, :target, :class_name, :library
-
- def initialize(opts)
- @name, @target, @library, @auto_require =
- opts[:name], opts[:target], opts[:library], opts[:auto_require]
-
- @class_name = Infl.camelize(@target)
- @library ||= Infl.underscore(@class_name) if @auto_require
- end
- end
-
- class Context
- def construct_factory(key)
- factory_def = @defs[key]
-# puts "requiring #{factory_def.library}"
- require factory_def.library if factory_def.library
-
- big_c = get_class_for_name_with_module_delimeters(factory_def.class_name)
-
- FactoryFactory.new(big_c)
- end
- end
-
- class FactoryFactory
- def initialize(clazz)
- @class_to_create = clazz
- end
-
- def create(*args)
- @class_to_create.new(*args)
- end
- end
-end
-
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/colour_prompt.rb b/tinyusb/test/vendor/ceedling/vendor/unity/auto/colour_prompt.rb
deleted file mode 100755
index 85cbfd80..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/colour_prompt.rb
+++ /dev/null
@@ -1,119 +0,0 @@
-# ==========================================
-# Unity Project - A Test Framework for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-if RUBY_PLATFORM =~ /(win|w)32$/
- begin
- require 'Win32API'
- rescue LoadError
- puts 'ERROR! "Win32API" library not found'
- puts '"Win32API" is required for colour on a windows machine'
- puts ' try => "gem install Win32API" on the command line'
- puts
- end
- # puts
- # puts 'Windows Environment Detected...'
- # puts 'Win32API Library Found.'
- # puts
-end
-
-class ColourCommandLine
- def initialize
- return unless RUBY_PLATFORM =~ /(win|w)32$/
-
- get_std_handle = Win32API.new('kernel32', 'GetStdHandle', ['L'], 'L')
- @set_console_txt_attrb =
- Win32API.new('kernel32', 'SetConsoleTextAttribute', %w[L N], 'I')
- @hout = get_std_handle.call(-11)
- end
-
- def change_to(new_colour)
- if RUBY_PLATFORM =~ /(win|w)32$/
- @set_console_txt_attrb.call(@hout, win32_colour(new_colour))
- else
- "\033[30;#{posix_colour(new_colour)};22m"
- end
- end
-
- def win32_colour(colour)
- case colour
- when :black then 0
- when :dark_blue then 1
- when :dark_green then 2
- when :dark_cyan then 3
- when :dark_red then 4
- when :dark_purple then 5
- when :dark_yellow, :narrative then 6
- when :default_white, :default, :dark_white then 7
- when :silver then 8
- when :blue then 9
- when :green, :success then 10
- when :cyan, :output then 11
- when :red, :failure then 12
- when :purple then 13
- when :yellow then 14
- when :white then 15
- else
- 0
- end
- end
-
- def posix_colour(colour)
- # ANSI Escape Codes - Foreground colors
- # | Code | Color |
- # | 39 | Default foreground color |
- # | 30 | Black |
- # | 31 | Red |
- # | 32 | Green |
- # | 33 | Yellow |
- # | 34 | Blue |
- # | 35 | Magenta |
- # | 36 | Cyan |
- # | 37 | Light gray |
- # | 90 | Dark gray |
- # | 91 | Light red |
- # | 92 | Light green |
- # | 93 | Light yellow |
- # | 94 | Light blue |
- # | 95 | Light magenta |
- # | 96 | Light cyan |
- # | 97 | White |
-
- case colour
- when :black then 30
- when :red, :failure then 31
- when :green, :success then 32
- when :yellow then 33
- when :blue, :narrative then 34
- when :purple, :magenta then 35
- when :cyan, :output then 36
- when :white, :default_white then 37
- when :default then 39
- else
- 39
- end
- end
-
- def out_c(mode, colour, str)
- case RUBY_PLATFORM
- when /(win|w)32$/
- change_to(colour)
- $stdout.puts str if mode == :puts
- $stdout.print str if mode == :print
- change_to(:default_white)
- else
- $stdout.puts("#{change_to(colour)}#{str}\033[0m") if mode == :puts
- $stdout.print("#{change_to(colour)}#{str}\033[0m") if mode == :print
- end
- end
-end
-
-def colour_puts(role, str)
- ColourCommandLine.new.out_c(:puts, role, str)
-end
-
-def colour_print(role, str)
- ColourCommandLine.new.out_c(:print, role, str)
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/colour_reporter.rb b/tinyusb/test/vendor/ceedling/vendor/unity/auto/colour_reporter.rb
deleted file mode 100755
index 1c3bc216..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/colour_reporter.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-# ==========================================
-# Unity Project - A Test Framework for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-require_relative 'colour_prompt'
-
-$colour_output = true
-
-def report(message)
- if !$colour_output
- $stdout.puts(message)
- else
- message = message.join('\n') if message.class == Array
- message.each_line do |line|
- line.chomp!
- colour = case line
- when /(?:total\s+)?tests:?\s+(\d+)\s+(?:total\s+)?failures:?\s+\d+\s+Ignored:?/i
- Regexp.last_match(1).to_i.zero? ? :green : :red
- when /PASS/
- :green
- when /^OK$/
- :green
- when /(?:FAIL|ERROR)/
- :red
- when /IGNORE/
- :yellow
- when /^(?:Creating|Compiling|Linking)/
- :white
- else
- :silver
- end
- colour_puts(colour, line)
- end
- end
- $stdout.flush
- $stderr.flush
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/generate_config.yml b/tinyusb/test/vendor/ceedling/vendor/unity/auto/generate_config.yml
deleted file mode 100755
index 4a5e4742..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/generate_config.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-#this is a sample configuration file for generate_module
-#you would use it by calling generate_module with the -ygenerate_config.yml option
-#files like this are useful for customizing generate_module to your environment
-:generate_module:
- :defaults:
- #these defaults are used in place of any missing options at the command line
- :path_src: ../src/
- :path_inc: ../src/
- :path_tst: ../test/
- :update_svn: true
- :includes:
- #use [] for no additional includes, otherwise list the includes on separate lines
- :src:
- - Defs.h
- - Board.h
- :inc: []
- :tst:
- - Defs.h
- - Board.h
- - Exception.h
- :boilerplates:
- #these are inserted at the top of generated files.
- #just comment out or remove if not desired.
- #use %1$s where you would like the file name to appear (path/extension not included)
- :src: |
- //-------------------------------------------
- // %1$s.c
- //-------------------------------------------
- :inc: |
- //-------------------------------------------
- // %1$s.h
- //-------------------------------------------
- :tst: |
- //-------------------------------------------
- // Test%1$s.c : Units tests for %1$s.c
- //-------------------------------------------
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/generate_module.rb b/tinyusb/test/vendor/ceedling/vendor/unity/auto/generate_module.rb
deleted file mode 100755
index eb2cebd4..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/generate_module.rb
+++ /dev/null
@@ -1,309 +0,0 @@
-# ==========================================
-# Unity Project - A Test Framework for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-# This script creates all the files with start code necessary for a new module.
-# A simple module only requires a source file, header file, and test file.
-# Triad modules require a source, header, and test file for each triad type (like model, conductor, and hardware).
-
-require 'rubygems'
-require 'fileutils'
-require 'pathname'
-
-# TEMPLATE_TST
-TEMPLATE_TST ||= '#include "unity.h"
-
-%2$s#include "%1$s.h"
-
-void setUp(void)
-{
-}
-
-void tearDown(void)
-{
-}
-
-void test_%1$s_NeedToImplement(void)
-{
- TEST_IGNORE_MESSAGE("Need to Implement %1$s");
-}
-'.freeze
-
-# TEMPLATE_SRC
-TEMPLATE_SRC ||= '%2$s#include "%1$s.h"
-'.freeze
-
-# TEMPLATE_INC
-TEMPLATE_INC ||= '#ifndef %3$s_H
-#define %3$s_H
-%2$s
-
-#endif // %3$s_H
-'.freeze
-
-class UnityModuleGenerator
- ############################
- def initialize(options = nil)
- @options = UnityModuleGenerator.default_options
- case options
- when NilClass then @options
- when String then @options.merge!(UnityModuleGenerator.grab_config(options))
- when Hash then @options.merge!(options)
- else raise 'If you specify arguments, it should be a filename or a hash of options'
- end
-
- # Create default file paths if none were provided
- @options[:path_src] = "#{__dir__}/../src/" if @options[:path_src].nil?
- @options[:path_inc] = @options[:path_src] if @options[:path_inc].nil?
- @options[:path_tst] = "#{__dir__}/../test/" if @options[:path_tst].nil?
- @options[:path_src] += '/' unless @options[:path_src][-1] == 47
- @options[:path_inc] += '/' unless @options[:path_inc][-1] == 47
- @options[:path_tst] += '/' unless @options[:path_tst][-1] == 47
-
- # Built in patterns
- @patterns = {
- 'src' => {
- '' => { inc: [] }
- },
- 'test' => {
- '' => { inc: [] }
- },
- 'dh' => {
- 'Driver' => { inc: [create_filename('%1$s', 'Hardware.h')] },
- 'Hardware' => { inc: [] }
- },
- 'dih' => {
- 'Driver' => { inc: [create_filename('%1$s', 'Hardware.h'), create_filename('%1$s', 'Interrupt.h')] },
- 'Interrupt' => { inc: [create_filename('%1$s', 'Hardware.h')] },
- 'Hardware' => { inc: [] }
- },
- 'mch' => {
- 'Model' => { inc: [] },
- 'Conductor' => { inc: [create_filename('%1$s', 'Model.h'), create_filename('%1$s', 'Hardware.h')] },
- 'Hardware' => { inc: [] }
- },
- 'mvp' => {
- 'Model' => { inc: [] },
- 'Presenter' => { inc: [create_filename('%1$s', 'Model.h'), create_filename('%1$s', 'View.h')] },
- 'View' => { inc: [] }
- }
- }
- end
-
- ############################
- def self.default_options
- {
- pattern: 'src',
- includes: {
- src: [],
- inc: [],
- tst: []
- },
- update_svn: false,
- boilerplates: {},
- test_prefix: 'Test',
- mock_prefix: 'Mock'
- }
- end
-
- ############################
- def self.grab_config(config_file)
- options = default_options
- unless config_file.nil? || config_file.empty?
- require 'yaml'
- yaml_guts = YAML.load_file(config_file)
- options.merge!(yaml_guts[:unity] || yaml_guts[:cmock])
- raise "No :unity or :cmock section found in #{config_file}" unless options
- end
- options
- end
-
- ############################
- def files_to_operate_on(module_name, pattern = nil)
- # strip any leading path information from the module name and save for later
- subfolder = File.dirname(module_name)
- module_name = File.basename(module_name)
-
- # create triad definition
- prefix = @options[:test_prefix] || 'Test'
- triad = [{ ext: '.c', path: @options[:path_src], prefix: '', template: TEMPLATE_SRC, inc: :src, boilerplate: @options[:boilerplates][:src] },
- { ext: '.h', path: @options[:path_inc], prefix: '', template: TEMPLATE_INC, inc: :inc, boilerplate: @options[:boilerplates][:inc] },
- { ext: '.c', path: @options[:path_tst], prefix: prefix, template: TEMPLATE_TST, inc: :tst, boilerplate: @options[:boilerplates][:tst] }]
-
- # prepare the pattern for use
- pattern = (pattern || @options[:pattern] || 'src').downcase
- patterns = @patterns[pattern]
- raise "ERROR: The design pattern '#{pattern}' specified isn't one that I recognize!" if patterns.nil?
-
- # single file patterns (currently just 'test') can reject the other parts of the triad
- triad.select! { |v| v[:inc] == :tst } if pattern == 'test'
-
- # Assemble the path/names of the files we need to work with.
- files = []
- triad.each do |cfg|
- patterns.each_pair do |pattern_file, pattern_traits|
- submodule_name = create_filename(module_name, pattern_file)
- filename = cfg[:prefix] + submodule_name + cfg[:ext]
- files << {
- path: (Pathname.new("#{cfg[:path]}#{subfolder}") + filename).cleanpath,
- name: submodule_name,
- template: cfg[:template],
- boilerplate: cfg[:boilerplate],
- includes: case (cfg[:inc])
- when :src then (@options[:includes][:src] || []) | (pattern_traits[:inc].map { |f| format(f, module_name) })
- when :inc then (@options[:includes][:inc] || [])
- when :tst then (@options[:includes][:tst] || []) | (pattern_traits[:inc].map { |f| format("#{@options[:mock_prefix]}#{f}", module_name) })
- end
- }
- end
- end
-
- files
- end
-
- ############################
- def create_filename(part1, part2 = '')
- if part2.empty?
- case (@options[:naming])
- when 'bumpy' then part1
- when 'camel' then part1
- when 'snake' then part1.downcase
- when 'caps' then part1.upcase
- else part1
- end
- else
- case (@options[:naming])
- when 'bumpy' then part1 + part2
- when 'camel' then part1 + part2
- when 'snake' then part1.downcase + '_' + part2.downcase
- when 'caps' then part1.upcase + '_' + part2.upcase
- else part1 + '_' + part2
- end
- end
- end
-
- ############################
- def generate(module_name, pattern = nil)
- files = files_to_operate_on(module_name, pattern)
-
- # Abort if all of the module files already exist
- all_files_exist = true
- files.each do |file|
- all_files_exist = false unless File.exist?(file[:path])
- end
- raise "ERROR: File #{files[0][:name]} already exists. Exiting." if all_files_exist
-
- # Create Source Modules
- files.each_with_index do |file, _i|
- # If this file already exists, don't overwrite it.
- if File.exist?(file[:path])
- puts "File #{file[:path]} already exists!"
- next
- end
- # Create the path first if necessary.
- FileUtils.mkdir_p(File.dirname(file[:path]), verbose: false)
- File.open(file[:path], 'w') do |f|
- f.write("#{file[:boilerplate]}\n" % [file[:name]]) unless file[:boilerplate].nil?
- f.write(file[:template] % [file[:name],
- file[:includes].map { |ff| "#include \"#{ff}\"\n" }.join,
- file[:name].upcase])
- end
- if @options[:update_svn]
- `svn add \"#{file[:path]}\"`
- if $!.exitstatus.zero?
- puts "File #{file[:path]} created and added to source control"
- else
- puts "File #{file[:path]} created but FAILED adding to source control!"
- end
- else
- puts "File #{file[:path]} created"
- end
- end
- puts 'Generate Complete'
- end
-
- ############################
- def destroy(module_name, pattern = nil)
- files_to_operate_on(module_name, pattern).each do |filespec|
- file = filespec[:path]
- if File.exist?(file)
- if @options[:update_svn]
- `svn delete \"#{file}\" --force`
- puts "File #{file} deleted and removed from source control"
- else
- FileUtils.remove(file)
- puts "File #{file} deleted"
- end
- else
- puts "File #{file} does not exist so cannot be removed."
- end
- end
- puts 'Destroy Complete'
- end
-end
-
-############################
-# Handle As Command Line If Called That Way
-if $0 == __FILE__
- destroy = false
- options = {}
- module_name = nil
-
- # Parse the command line parameters.
- ARGV.each do |arg|
- case arg
- when /^-d/ then destroy = true
- when /^-u/ then options[:update_svn] = true
- when /^-p\"?(\w+)\"?/ then options[:pattern] = Regexp.last_match(1)
- when /^-s\"?(.+)\"?/ then options[:path_src] = Regexp.last_match(1)
- when /^-i\"?(.+)\"?/ then options[:path_inc] = Regexp.last_match(1)
- when /^-t\"?(.+)\"?/ then options[:path_tst] = Regexp.last_match(1)
- when /^-n\"?(.+)\"?/ then options[:naming] = Regexp.last_match(1)
- when /^-y\"?(.+)\"?/ then options = UnityModuleGenerator.grab_config(Regexp.last_match(1))
- when /^(\w+)/
- raise "ERROR: You can't have more than one Module name specified!" unless module_name.nil?
-
- module_name = arg
- when /^-(h|-help)/
- ARGV = [].freeze
- else
- raise "ERROR: Unknown option specified '#{arg}'"
- end
- end
-
- unless ARGV[0]
- puts ["\nGENERATE MODULE\n-------- ------",
- "\nUsage: ruby generate_module [options] module_name",
- " -i\"include\" sets the path to output headers to 'include' (DEFAULT ../src)",
- " -s\"../src\" sets the path to output source to '../src' (DEFAULT ../src)",
- " -t\"C:/test\" sets the path to output source to 'C:/test' (DEFAULT ../test)",
- ' -p"MCH" sets the output pattern to MCH.',
- ' dh - driver hardware.',
- ' dih - driver interrupt hardware.',
- ' mch - model conductor hardware.',
- ' mvp - model view presenter.',
- ' src - just a source module, header and test. (DEFAULT)',
- ' test - just a test file.',
- ' -d destroy module instead of creating it.',
- ' -n"camel" sets the file naming convention.',
- ' bumpy - BumpyCaseFilenames.',
- ' camel - camelCaseFilenames.',
- ' snake - snake_case_filenames.',
- ' caps - CAPS_CASE_FILENAMES.',
- ' -u update subversion too (requires subversion command line)',
- ' -y"my.yml" selects a different yaml config file for module generation',
- ''].join("\n")
- exit
- end
-
- raise 'ERROR: You must have a Module name specified! (use option -h for help)' if module_name.nil?
-
- if destroy
- UnityModuleGenerator.new(options).destroy(module_name)
- else
- UnityModuleGenerator.new(options).generate(module_name)
- end
-
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/generate_test_runner.rb b/tinyusb/test/vendor/ceedling/vendor/unity/auto/generate_test_runner.rb
deleted file mode 100755
index 5053210d..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/generate_test_runner.rb
+++ /dev/null
@@ -1,495 +0,0 @@
-# ==========================================
-# Unity Project - A Test Framework for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-class UnityTestRunnerGenerator
- def initialize(options = nil)
- @options = UnityTestRunnerGenerator.default_options
- case options
- when NilClass
- @options
- when String
- @options.merge!(UnityTestRunnerGenerator.grab_config(options))
- when Hash
- # Check if some of these have been specified
- @options[:has_setup] = !options[:setup_name].nil?
- @options[:has_teardown] = !options[:teardown_name].nil?
- @options[:has_suite_setup] = !options[:suite_setup].nil?
- @options[:has_suite_teardown] = !options[:suite_teardown].nil?
- @options.merge!(options)
- else
- raise 'If you specify arguments, it should be a filename or a hash of options'
- end
- require_relative 'type_sanitizer'
- end
-
- def self.default_options
- {
- includes: [],
- defines: [],
- plugins: [],
- framework: :unity,
- test_prefix: 'test|spec|should',
- mock_prefix: 'Mock',
- mock_suffix: '',
- setup_name: 'setUp',
- teardown_name: 'tearDown',
- test_reset_name: 'resetTest',
- test_verify_name: 'verifyTest',
- main_name: 'main', # set to :auto to automatically generate each time
- main_export_decl: '',
- cmdline_args: false,
- omit_begin_end: false,
- use_param_tests: false
- }
- end
-
- def self.grab_config(config_file)
- options = default_options
- unless config_file.nil? || config_file.empty?
- require 'yaml'
- yaml_guts = YAML.load_file(config_file)
- options.merge!(yaml_guts[:unity] || yaml_guts[:cmock])
- raise "No :unity or :cmock section found in #{config_file}" unless options
- end
- options
- end
-
- def run(input_file, output_file, options = nil)
- @options.merge!(options) unless options.nil?
-
- # pull required data from source file
- source = File.read(input_file)
- source = source.force_encoding('ISO-8859-1').encode('utf-8', replace: nil)
- tests = find_tests(source)
- headers = find_includes(source)
- testfile_includes = (headers[:local] + headers[:system])
- used_mocks = find_mocks(testfile_includes)
- testfile_includes = (testfile_includes - used_mocks)
- testfile_includes.delete_if { |inc| inc =~ /(unity|cmock)/ }
- find_setup_and_teardown(source)
-
- # build runner file
- generate(input_file, output_file, tests, used_mocks, testfile_includes)
-
- # determine which files were used to return them
- all_files_used = [input_file, output_file]
- all_files_used += testfile_includes.map { |filename| filename + '.c' } unless testfile_includes.empty?
- all_files_used += @options[:includes] unless @options[:includes].empty?
- all_files_used += headers[:linkonly] unless headers[:linkonly].empty?
- all_files_used.uniq
- end
-
- def generate(input_file, output_file, tests, used_mocks, testfile_includes)
- File.open(output_file, 'w') do |output|
- create_header(output, used_mocks, testfile_includes)
- create_externs(output, tests, used_mocks)
- create_mock_management(output, used_mocks)
- create_setup(output)
- create_teardown(output)
- create_suite_setup(output)
- create_suite_teardown(output)
- create_reset(output)
- create_run_test(output)
- create_args_wrappers(output, tests)
- create_main(output, input_file, tests, used_mocks)
- end
-
- return unless @options[:header_file] && !@options[:header_file].empty?
-
- File.open(@options[:header_file], 'w') do |output|
- create_h_file(output, @options[:header_file], tests, testfile_includes, used_mocks)
- end
- end
-
- def find_tests(source)
- tests_and_line_numbers = []
-
- # contains characters which will be substituted from within strings, doing
- # this prevents these characters from interferring with scrubbers
- # @ is not a valid C character, so there should be no clashes with files genuinely containing these markers
- substring_subs = { '{' => '@co@', '}' => '@cc@', ';' => '@ss@', '/' => '@fs@' }
- substring_re = Regexp.union(substring_subs.keys)
- substring_unsubs = substring_subs.invert # the inverse map will be used to fix the strings afterwords
- substring_unsubs['@quote@'] = '\\"'
- substring_unsubs['@apos@'] = '\\\''
- substring_unre = Regexp.union(substring_unsubs.keys)
- source_scrubbed = source.clone
- source_scrubbed = source_scrubbed.gsub(/\\"/, '@quote@') # hide escaped quotes to allow capture of the full string/char
- source_scrubbed = source_scrubbed.gsub(/\\'/, '@apos@') # hide escaped apostrophes to allow capture of the full string/char
- source_scrubbed = source_scrubbed.gsub(/("[^"\n]*")|('[^'\n]*')/) { |s| s.gsub(substring_re, substring_subs) } # temporarily hide problematic characters within strings
- source_scrubbed = source_scrubbed.gsub(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks
- source_scrubbed = source_scrubbed.gsub(/\/\*.*?\*\//m, '') # remove block comments
- source_scrubbed = source_scrubbed.gsub(/\/\/.*$/, '') # remove line comments (all that remain)
- lines = source_scrubbed.split(/(^\s*\#.*$) | (;|\{|\}) /x) # Treat preprocessor directives as a logical line. Match ;, {, and } as end of lines
- .map { |line| line.gsub(substring_unre, substring_unsubs) } # unhide the problematic characters previously removed
-
- lines.each_with_index do |line, _index|
- # find tests
- next unless line =~ /^((?:\s*TEST_CASE\s*\(.*?\)\s*)*)\s*void\s+((?:#{@options[:test_prefix]}).*)\s*\(\s*(.*)\s*\)/m
-
- arguments = Regexp.last_match(1)
- name = Regexp.last_match(2)
- call = Regexp.last_match(3)
- params = Regexp.last_match(4)
- args = nil
-
- if @options[:use_param_tests] && !arguments.empty?
- args = []
- arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) { |a| args << a[0] }
- end
-
- tests_and_line_numbers << { test: name, args: args, call: call, params: params, line_number: 0 }
- end
-
- tests_and_line_numbers.uniq! { |v| v[:test] }
-
- # determine line numbers and create tests to run
- source_lines = source.split("\n")
- source_index = 0
- tests_and_line_numbers.size.times do |i|
- source_lines[source_index..-1].each_with_index do |line, index|
- next unless line =~ /\s+#{tests_and_line_numbers[i][:test]}(?:\s|\()/
-
- source_index += index
- tests_and_line_numbers[i][:line_number] = source_index + 1
- break
- end
- end
-
- tests_and_line_numbers
- end
-
- def find_includes(source)
- # remove comments (block and line, in three steps to ensure correct precedence)
- source.gsub!(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks
- source.gsub!(/\/\*.*?\*\//m, '') # remove block comments
- source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain)
-
- # parse out includes
- includes = {
- local: source.scan(/^\s*#include\s+\"\s*(.+)\.[hH]\s*\"/).flatten,
- system: source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" },
- linkonly: source.scan(/^TEST_FILE\(\s*\"\s*(.+)\.[cC]\w*\s*\"/).flatten
- }
- includes
- end
-
- def find_mocks(includes)
- mock_headers = []
- includes.each do |include_path|
- include_file = File.basename(include_path)
- mock_headers << include_path if include_file =~ /^#{@options[:mock_prefix]}.*#{@options[:mock_suffix]}$/i
- end
- mock_headers
- end
-
- def find_setup_and_teardown(source)
- @options[:has_setup] = source =~ /void\s+#{@options[:setup_name]}\s*\(/
- @options[:has_teardown] = source =~ /void\s+#{@options[:teardown_name]}\s*\(/
- @options[:has_suite_setup] ||= (source =~ /void\s+suiteSetUp\s*\(/)
- @options[:has_suite_teardown] ||= (source =~ /void\s+suiteTearDown\s*\(/)
- end
-
- def create_header(output, mocks, testfile_includes = [])
- output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */')
- output.puts("\n/*=======Automagically Detected Files To Include=====*/")
- output.puts("#include \"#{@options[:framework]}.h\"")
- output.puts('#include "cmock.h"') unless mocks.empty?
- if @options[:defines] && !@options[:defines].empty?
- @options[:defines].each { |d| output.puts("#ifndef #{d}\n#define #{d}\n#endif /* #{d} */") }
- end
- if @options[:header_file] && !@options[:header_file].empty?
- output.puts("#include \"#{File.basename(@options[:header_file])}\"")
- else
- @options[:includes].flatten.uniq.compact.each do |inc|
- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h', '')}.h\""}")
- end
- testfile_includes.each do |inc|
- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h', '')}.h\""}")
- end
- end
- mocks.each do |mock|
- output.puts("#include \"#{mock.gsub('.h', '')}.h\"")
- end
- output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception)
-
- return unless @options[:enforce_strict_ordering]
-
- output.puts('')
- output.puts('int GlobalExpectCount;')
- output.puts('int GlobalVerifyOrder;')
- output.puts('char* GlobalOrderError;')
- end
-
- def create_externs(output, tests, _mocks)
- output.puts("\n/*=======External Functions This Runner Calls=====*/")
- output.puts("extern void #{@options[:setup_name]}(void);")
- output.puts("extern void #{@options[:teardown_name]}(void);")
- output.puts("\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif") if @options[:externc]
- tests.each do |test|
- output.puts("extern void #{test[:test]}(#{test[:call] || 'void'});")
- end
- output.puts("#ifdef __cplusplus\n}\n#endif") if @options[:externc]
- output.puts('')
- end
-
- def create_mock_management(output, mock_headers)
- output.puts("\n/*=======Mock Management=====*/")
- output.puts('static void CMock_Init(void)')
- output.puts('{')
-
- if @options[:enforce_strict_ordering]
- output.puts(' GlobalExpectCount = 0;')
- output.puts(' GlobalVerifyOrder = 0;')
- output.puts(' GlobalOrderError = NULL;')
- end
-
- mocks = mock_headers.map { |mock| File.basename(mock) }
- mocks.each do |mock|
- mock_clean = TypeSanitizer.sanitize_c_identifier(mock)
- output.puts(" #{mock_clean}_Init();")
- end
- output.puts("}\n")
-
- output.puts('static void CMock_Verify(void)')
- output.puts('{')
- mocks.each do |mock|
- mock_clean = TypeSanitizer.sanitize_c_identifier(mock)
- output.puts(" #{mock_clean}_Verify();")
- end
- output.puts("}\n")
-
- output.puts('static void CMock_Destroy(void)')
- output.puts('{')
- mocks.each do |mock|
- mock_clean = TypeSanitizer.sanitize_c_identifier(mock)
- output.puts(" #{mock_clean}_Destroy();")
- end
- output.puts("}\n")
- end
-
- def create_setup(output)
- return if @options[:has_setup]
-
- output.puts("\n/*=======Setup (stub)=====*/")
- output.puts("void #{@options[:setup_name]}(void) {}")
- end
-
- def create_teardown(output)
- return if @options[:has_teardown]
-
- output.puts("\n/*=======Teardown (stub)=====*/")
- output.puts("void #{@options[:teardown_name]}(void) {}")
- end
-
- def create_suite_setup(output)
- return if @options[:suite_setup].nil?
-
- output.puts("\n/*=======Suite Setup=====*/")
- output.puts('void suiteSetUp(void)')
- output.puts('{')
- output.puts(@options[:suite_setup])
- output.puts('}')
- end
-
- def create_suite_teardown(output)
- return if @options[:suite_teardown].nil?
-
- output.puts("\n/*=======Suite Teardown=====*/")
- output.puts('int suiteTearDown(int num_failures)')
- output.puts('{')
- output.puts(@options[:suite_teardown])
- output.puts('}')
- end
-
- def create_reset(output)
- output.puts("\n/*=======Test Reset Options=====*/")
- output.puts("void #{@options[:test_reset_name]}(void);")
- output.puts("void #{@options[:test_reset_name]}(void)")
- output.puts('{')
- output.puts(" #{@options[:teardown_name]}();")
- output.puts(' CMock_Verify();')
- output.puts(' CMock_Destroy();')
- output.puts(' CMock_Init();')
- output.puts(" #{@options[:setup_name]}();")
- output.puts('}')
- output.puts("void #{@options[:test_verify_name]}(void);")
- output.puts("void #{@options[:test_verify_name]}(void)")
- output.puts('{')
- output.puts(' CMock_Verify();')
- output.puts('}')
- end
-
- def create_run_test(output)
- require 'erb'
- template = ERB.new(File.read(File.join(__dir__, 'run_test.erb')))
- output.puts(template.result(binding))
- end
-
- def create_args_wrappers(output, tests)
- return unless @options[:use_param_tests]
-
- output.puts("\n/*=======Parameterized Test Wrappers=====*/")
- tests.each do |test|
- next if test[:args].nil? || test[:args].empty?
-
- test[:args].each.with_index(1) do |args, idx|
- output.puts("static void runner_args#{idx}_#{test[:test]}(void)")
- output.puts('{')
- output.puts(" #{test[:test]}(#{args});")
- output.puts("}\n")
- end
- end
- end
-
- def create_main(output, filename, tests, used_mocks)
- output.puts("\n\n/*=======MAIN=====*/")
- main_name = @options[:main_name].to_sym == :auto ? "main_#{filename.gsub('.c', '')}" : (@options[:main_name]).to_s
- if @options[:cmdline_args]
- if main_name != 'main'
- output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv);")
- end
- output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv)")
- output.puts('{')
- output.puts(' int parse_status = UnityParseOptions(argc, argv);')
- output.puts(' if (parse_status != 0)')
- output.puts(' {')
- output.puts(' if (parse_status < 0)')
- output.puts(' {')
- output.puts(" UnityPrint(\"#{filename.gsub('.c', '')}.\");")
- output.puts(' UNITY_PRINT_EOL();')
- tests.each do |test|
- if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty?
- output.puts(" UnityPrint(\" #{test[:test]}\");")
- output.puts(' UNITY_PRINT_EOL();')
- else
- test[:args].each do |args|
- output.puts(" UnityPrint(\" #{test[:test]}(#{args})\");")
- output.puts(' UNITY_PRINT_EOL();')
- end
- end
- end
- output.puts(' return 0;')
- output.puts(' }')
- output.puts(' return parse_status;')
- output.puts(' }')
- else
- main_return = @options[:omit_begin_end] ? 'void' : 'int'
- if main_name != 'main'
- output.puts("#{@options[:main_export_decl]} #{main_return} #{main_name}(void);")
- end
- output.puts("#{main_return} #{main_name}(void)")
- output.puts('{')
- end
- output.puts(' suiteSetUp();') if @options[:has_suite_setup]
- if @options[:omit_begin_end]
- output.puts(" UnitySetTestFile(\"#{filename.gsub(/\\/, '\\\\\\')}\");")
- else
- output.puts(" UnityBegin(\"#{filename.gsub(/\\/, '\\\\\\')}\");")
- end
- tests.each do |test|
- if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty?
- output.puts(" run_test(#{test[:test]}, \"#{test[:test]}\", #{test[:line_number]});")
- else
- test[:args].each.with_index(1) do |args, idx|
- wrapper = "runner_args#{idx}_#{test[:test]}"
- testname = "#{test[:test]}(#{args})".dump
- output.puts(" run_test(#{wrapper}, #{testname}, #{test[:line_number]});")
- end
- end
- end
- output.puts
- output.puts(' CMock_Guts_MemFreeFinal();') unless used_mocks.empty?
- if @options[:has_suite_teardown]
- if @options[:omit_begin_end]
- output.puts(' (void) suite_teardown(0);')
- else
- output.puts(' return suiteTearDown(UnityEnd());')
- end
- else
- output.puts(' return UnityEnd();') if not @options[:omit_begin_end]
- end
- output.puts('}')
- end
-
- def create_h_file(output, filename, tests, testfile_includes, used_mocks)
- filename = File.basename(filename).gsub(/[-\/\\\.\,\s]/, '_').upcase
- output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */')
- output.puts("#ifndef _#{filename}")
- output.puts("#define _#{filename}\n\n")
- output.puts("#include \"#{@options[:framework]}.h\"")
- output.puts('#include "cmock.h"') unless used_mocks.empty?
- @options[:includes].flatten.uniq.compact.each do |inc|
- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h', '')}.h\""}")
- end
- testfile_includes.each do |inc|
- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h', '')}.h\""}")
- end
- output.puts "\n"
- tests.each do |test|
- if test[:params].nil? || test[:params].empty?
- output.puts("void #{test[:test]}(void);")
- else
- output.puts("void #{test[:test]}(#{test[:params]});")
- end
- end
- output.puts("#endif\n\n")
- end
-end
-
-if $0 == __FILE__
- options = { includes: [] }
-
- # parse out all the options first (these will all be removed as we go)
- ARGV.reject! do |arg|
- case arg
- when '-cexception'
- options[:plugins] = [:cexception]
- true
- when /\.*\.ya?ml/
- options = UnityTestRunnerGenerator.grab_config(arg)
- true
- when /--(\w+)=\"?(.*)\"?/
- options[Regexp.last_match(1).to_sym] = Regexp.last_match(2)
- true
- when /\.*\.h/
- options[:includes] << arg
- true
- else false
- end
- end
-
- # make sure there is at least one parameter left (the input file)
- unless ARGV[0]
- puts ["\nusage: ruby #{__FILE__} (files) (options) input_test_file (output)",
- "\n input_test_file - this is the C file you want to create a runner for",
- ' output - this is the name of the runner file to generate',
- ' defaults to (input_test_file)_Runner',
- ' files:',
- ' *.yml / *.yaml - loads configuration from here in :unity or :cmock',
- ' *.h - header files are added as #includes in runner',
- ' options:',
- ' -cexception - include cexception support',
- ' -externc - add extern "C" for cpp support',
- ' --setup_name="" - redefine setUp func name to something else',
- ' --teardown_name="" - redefine tearDown func name to something else',
- ' --main_name="" - redefine main func name to something else',
- ' --test_prefix="" - redefine test prefix from default test|spec|should',
- ' --test_reset_name="" - redefine resetTest func name to something else',
- ' --test_verify_name="" - redefine verifyTest func name to something else',
- ' --suite_setup="" - code to execute for setup of entire suite',
- ' --suite_teardown="" - code to execute for teardown of entire suite',
- ' --use_param_tests=1 - enable parameterized tests (disabled by default)',
- ' --omit_begin_end=1 - omit calls to UnityBegin and UnityEnd (disabled by default)',
- ' --header_file="" - path/name of test header file to generate too'].join("\n")
- exit 1
- end
-
- # create the default test runner name if not specified
- ARGV[1] = ARGV[0].gsub('.c', '_Runner.c') unless ARGV[1]
-
- UnityTestRunnerGenerator.new(options).run(ARGV[0], ARGV[1])
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/parse_output.rb b/tinyusb/test/vendor/ceedling/vendor/unity/auto/parse_output.rb
deleted file mode 100755
index d72c6e8b..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/parse_output.rb
+++ /dev/null
@@ -1,322 +0,0 @@
-#============================================================
-# Author: John Theofanopoulos
-# A simple parser. Takes the output files generated during the
-# build process and extracts information relating to the tests.
-#
-# Notes:
-# To capture an output file under VS builds use the following:
-# devenv [build instructions] > Output.txt & type Output.txt
-#
-# To capture an output file under Linux builds use the following:
-# make | tee Output.txt
-#
-# This script can handle the following output formats:
-# - normal output (raw unity)
-# - fixture output (unity_fixture.h/.c)
-# - fixture output with verbose flag set ("-v")
-#
-# To use this parser use the following command
-# ruby parseOutput.rb [options] [file]
-# options: -xml : produce a JUnit compatible XML file
-# file: file to scan for results
-#============================================================
-
-# Parser class for handling the input file
-class ParseOutput
- def initialize
- # internal data
- @class_name_idx = 0
- @path_delim = nil
-
- # xml output related
- @xml_out = false
- @array_list = false
-
- # current suite name and statistics
- @test_suite = nil
- @total_tests = 0
- @test_passed = 0
- @test_failed = 0
- @test_ignored = 0
- end
-
- # Set the flag to indicate if there will be an XML output file or not
- def set_xml_output
- @xml_out = true
- end
-
- # If write our output to XML
- def write_xml_output
- output = File.open('report.xml', 'w')
- output << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- @array_list.each do |item|
- output << item << "\n"
- end
- end
-
- # Pushes the suite info as xml to the array list, which will be written later
- def push_xml_output_suite_info
- # Insert opening tag at front
- heading = '<testsuite name="Unity" tests="' + @total_tests.to_s + '" failures="' + @test_failed.to_s + '"' + ' skips="' + @test_ignored.to_s + '">'
- @array_list.insert(0, heading)
- # Push back the closing tag
- @array_list.push '</testsuite>'
- end
-
- # Pushes xml output data to the array list, which will be written later
- def push_xml_output_passed(test_name)
- @array_list.push ' <testcase classname="' + @test_suite + '" name="' + test_name + '"/>'
- end
-
- # Pushes xml output data to the array list, which will be written later
- def push_xml_output_failed(test_name, reason)
- @array_list.push ' <testcase classname="' + @test_suite + '" name="' + test_name + '">'
- @array_list.push ' <failure type="ASSERT FAILED">' + reason + '</failure>'
- @array_list.push ' </testcase>'
- end
-
- # Pushes xml output data to the array list, which will be written later
- def push_xml_output_ignored(test_name, reason)
- @array_list.push ' <testcase classname="' + @test_suite + '" name="' + test_name + '">'
- @array_list.push ' <skipped type="TEST IGNORED">' + reason + '</skipped>'
- @array_list.push ' </testcase>'
- end
-
- # This function will try and determine when the suite is changed. This is
- # is the name that gets added to the classname parameter.
- def test_suite_verify(test_suite_name)
- # Split the path name
- test_name = test_suite_name.split(@path_delim)
-
- # Remove the extension and extract the base_name
- base_name = test_name[test_name.size - 1].split('.')[0]
-
- # Return if the test suite hasn't changed
- return unless base_name.to_s != @test_suite.to_s
-
- @test_suite = base_name
- printf "New Test: %s\n", @test_suite
- end
-
- # Prepares the line for verbose fixture output ("-v")
- def prepare_fixture_line(line)
- line = line.sub('IGNORE_TEST(', '')
- line = line.sub('TEST(', '')
- line = line.sub(')', ',')
- line = line.chomp
- array = line.split(',')
- array.map { |x| x.to_s.lstrip.chomp }
- end
-
- # Test was flagged as having passed so format the output.
- # This is using the Unity fixture output and not the original Unity output.
- def test_passed_unity_fixture(array)
- class_name = array[0]
- test_name = array[1]
- test_suite_verify(class_name)
- printf "%-40s PASS\n", test_name
-
- push_xml_output_passed(test_name) if @xml_out
- end
-
- # Test was flagged as having failed so format the output.
- # This is using the Unity fixture output and not the original Unity output.
- def test_failed_unity_fixture(array)
- class_name = array[0]
- test_name = array[1]
- test_suite_verify(class_name)
- reason_array = array[2].split(':')
- reason = reason_array[-1].lstrip.chomp + ' at line: ' + reason_array[-4]
-
- printf "%-40s FAILED\n", test_name
-
- push_xml_output_failed(test_name, reason) if @xml_out
- end
-
- # Test was flagged as being ignored so format the output.
- # This is using the Unity fixture output and not the original Unity output.
- def test_ignored_unity_fixture(array)
- class_name = array[0]
- test_name = array[1]
- reason = 'No reason given'
- if array.size > 2
- reason_array = array[2].split(':')
- tmp_reason = reason_array[-1].lstrip.chomp
- reason = tmp_reason == 'IGNORE' ? 'No reason given' : tmp_reason
- end
- test_suite_verify(class_name)
- printf "%-40s IGNORED\n", test_name
-
- push_xml_output_ignored(test_name, reason) if @xml_out
- end
-
- # Test was flagged as having passed so format the output
- def test_passed(array)
- last_item = array.length - 1
- test_name = array[last_item - 1]
- test_suite_verify(array[@class_name_idx])
- printf "%-40s PASS\n", test_name
-
- return unless @xml_out
-
- push_xml_output_passed(test_name) if @xml_out
- end
-
- # Test was flagged as having failed so format the line
- def test_failed(array)
- last_item = array.length - 1
- test_name = array[last_item - 2]
- reason = array[last_item].chomp.lstrip + ' at line: ' + array[last_item - 3]
- class_name = array[@class_name_idx]
-
- if test_name.start_with? 'TEST('
- array2 = test_name.split(' ')
-
- test_suite = array2[0].sub('TEST(', '')
- test_suite = test_suite.sub(',', '')
- class_name = test_suite
-
- test_name = array2[1].sub(')', '')
- end
-
- test_suite_verify(class_name)
- printf "%-40s FAILED\n", test_name
-
- push_xml_output_failed(test_name, reason) if @xml_out
- end
-
- # Test was flagged as being ignored so format the output
- def test_ignored(array)
- last_item = array.length - 1
- test_name = array[last_item - 2]
- reason = array[last_item].chomp.lstrip
- class_name = array[@class_name_idx]
-
- if test_name.start_with? 'TEST('
- array2 = test_name.split(' ')
-
- test_suite = array2[0].sub('TEST(', '')
- test_suite = test_suite.sub(',', '')
- class_name = test_suite
-
- test_name = array2[1].sub(')', '')
- end
-
- test_suite_verify(class_name)
- printf "%-40s IGNORED\n", test_name
-
- push_xml_output_ignored(test_name, reason) if @xml_out
- end
-
- # Adjusts the os specific members according to the current path style
- # (Windows or Unix based)
- def detect_os_specifics(line)
- if line.include? '\\'
- # Windows X:\Y\Z
- @class_name_idx = 1
- @path_delim = '\\'
- else
- # Unix Based /X/Y/Z
- @class_name_idx = 0
- @path_delim = '/'
- end
- end
-
- # Main function used to parse the file that was captured.
- def process(file_name)
- @array_list = []
-
- puts 'Parsing file: ' + file_name
-
- @test_passed = 0
- @test_failed = 0
- @test_ignored = 0
- puts ''
- puts '=================== RESULTS ====================='
- puts ''
- File.open(file_name).each do |line|
- # Typical test lines look like these:
- # ----------------------------------------------------
- # 1. normal output:
- # <path>/<test_file>.c:36:test_tc1000_opsys:FAIL: Expected 1 Was 0
- # <path>/<test_file>.c:112:test_tc5004_initCanChannel:IGNORE: Not Yet Implemented
- # <path>/<test_file>.c:115:test_tc5100_initCanVoidPtrs:PASS
- #
- # 2. fixture output
- # <path>/<test_file>.c:63:TEST(<test_group>, <test_function>):FAIL: Expected 0x00001234 Was 0x00005A5A
- # <path>/<test_file>.c:36:TEST(<test_group>, <test_function>):IGNORE
- # Note: "PASS" information won't be generated in this mode
- #
- # 3. fixture output with verbose information ("-v")
- # TEST(<test_group, <test_file>)<path>/<test_file>:168::FAIL: Expected 0x8D Was 0x8C
- # TEST(<test_group>, <test_file>)<path>/<test_file>:22::IGNORE: This Test Was Ignored On Purpose
- # IGNORE_TEST(<test_group, <test_file>)
- # TEST(<test_group, <test_file>) PASS
- #
- # Note: Where path is different on Unix vs Windows devices (Windows leads with a drive letter)!
- detect_os_specifics(line)
- line_array = line.split(':')
-
- # If we were able to split the line then we can look to see if any of our target words
- # were found. Case is important.
- next unless (line_array.size >= 4) || (line.start_with? 'TEST(') || (line.start_with? 'IGNORE_TEST(')
-
- # check if the output is fixture output (with verbose flag "-v")
- if (line.start_with? 'TEST(') || (line.start_with? 'IGNORE_TEST(')
- line_array = prepare_fixture_line(line)
- if line.include? ' PASS'
- test_passed_unity_fixture(line_array)
- @test_passed += 1
- elsif line.include? 'FAIL'
- test_failed_unity_fixture(line_array)
- @test_failed += 1
- elsif line.include? 'IGNORE'
- test_ignored_unity_fixture(line_array)
- @test_ignored += 1
- end
- # normal output / fixture output (without verbose "-v")
- elsif line.include? ':PASS'
- test_passed(line_array)
- @test_passed += 1
- elsif line.include? ':FAIL'
- test_failed(line_array)
- @test_failed += 1
- elsif line.include? ':IGNORE:'
- test_ignored(line_array)
- @test_ignored += 1
- elsif line.include? ':IGNORE'
- line_array.push('No reason given')
- test_ignored(line_array)
- @test_ignored += 1
- end
- @total_tests = @test_passed + @test_failed + @test_ignored
- end
- puts ''
- puts '=================== SUMMARY ====================='
- puts ''
- puts 'Tests Passed : ' + @test_passed.to_s
- puts 'Tests Failed : ' + @test_failed.to_s
- puts 'Tests Ignored : ' + @test_ignored.to_s
-
- return unless @xml_out
-
- # push information about the suite
- push_xml_output_suite_info
- # write xml output file
- write_xml_output
- end
-end
-
-# If the command line has no values in, used a default value of Output.txt
-parse_my_file = ParseOutput.new
-
-if ARGV.size >= 1
- ARGV.each do |arg|
- if arg == '-xml'
- parse_my_file.set_xml_output
- else
- parse_my_file.process(arg)
- break
- end
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/run_test.erb b/tinyusb/test/vendor/ceedling/vendor/unity/auto/run_test.erb
deleted file mode 100755
index 3d3b6d1e..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/run_test.erb
+++ /dev/null
@@ -1,36 +0,0 @@
-/*=======Test Runner Used To Run Each Test=====*/
-static void run_test(UnityTestFunction func, const char* name, int line_num)
-{
- Unity.CurrentTestName = name;
- Unity.CurrentTestLineNumber = line_num;
-#ifdef UNITY_USE_COMMAND_LINE_ARGS
- if (!UnityTestMatches())
- return;
-#endif
- Unity.NumberOfTests++;
- UNITY_CLR_DETAILS();
- UNITY_EXEC_TIME_START();
- CMock_Init();
- if (TEST_PROTECT())
- {
-<% if @options[:plugins].include?(:cexception) %>
- CEXCEPTION_T e;
- Try {
-<% end %>
- <%= @options[:setup_name] %>();
- func();
-<% if @options[:plugins].include?(:cexception) %>
- } Catch(e) {
- TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!");
- }
-<% end %>
- }
- if (TEST_PROTECT())
- {
- <%= @options[:teardown_name] %>();
- CMock_Verify();
- }
- CMock_Destroy();
- UNITY_EXEC_TIME_STOP();
- UnityConcludeTest();
-}
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/stylize_as_junit.rb b/tinyusb/test/vendor/ceedling/vendor/unity/auto/stylize_as_junit.rb
deleted file mode 100755
index e01f7912..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/stylize_as_junit.rb
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/usr/bin/ruby
-#
-# unity_to_junit.rb
-#
-require 'fileutils'
-require 'optparse'
-require 'ostruct'
-require 'set'
-
-require 'pp'
-
-VERSION = 1.0
-
-class ArgvParser
- #
- # Return a structure describing the options.
- #
- def self.parse(args)
- # The options specified on the command line will be collected in *options*.
- # We set default values here.
- options = OpenStruct.new
- options.results_dir = '.'
- options.root_path = '.'
- options.out_file = 'results.xml'
-
- opts = OptionParser.new do |o|
- o.banner = 'Usage: unity_to_junit.rb [options]'
-
- o.separator ''
- o.separator 'Specific options:'
-
- o.on('-r', '--results <dir>', 'Look for Unity Results files here.') do |results|
- # puts "results #{results}"
- options.results_dir = results
- end
-
- o.on('-p', '--root_path <path>', 'Prepend this path to files in results.') do |root_path|
- options.root_path = root_path
- end
-
- o.on('-o', '--output <filename>', 'XML file to generate.') do |out_file|
- # puts "out_file: #{out_file}"
- options.out_file = out_file
- end
-
- o.separator ''
- o.separator 'Common options:'
-
- # No argument, shows at tail. This will print an options summary.
- o.on_tail('-h', '--help', 'Show this message') do
- puts o
- exit
- end
-
- # Another typical switch to print the version.
- o.on_tail('--version', 'Show version') do
- puts "unity_to_junit.rb version #{VERSION}"
- exit
- end
- end
-
- opts.parse!(args)
- options
- end
-end
-
-class UnityToJUnit
- include FileUtils::Verbose
- attr_reader :report, :total_tests, :failures, :ignored
- attr_writer :targets, :root, :out_file
-
- def initialize
- @report = ''
- @unit_name = ''
- end
-
- def run
- # Clean up result file names
- results = @targets.map { |target| target.tr('\\', '/') }
- # puts "Output File: #{@out_file}"
- f = File.new(@out_file, 'w')
- write_xml_header(f)
- write_suites_header(f)
- results.each do |result_file|
- lines = File.readlines(result_file).map(&:chomp)
-
- raise "Empty test result file: #{result_file}" if lines.empty?
-
- result_output = get_details(result_file, lines)
- tests, failures, ignored = parse_test_summary(lines)
- result_output[:counts][:total] = tests
- result_output[:counts][:failed] = failures
- result_output[:counts][:ignored] = ignored
- result_output[:counts][:passed] = (result_output[:counts][:total] - result_output[:counts][:failed] - result_output[:counts][:ignored])
-
- # use line[0] from the test output to get the test_file path and name
- test_file_str = lines[0].tr('\\', '/')
- test_file_str = test_file_str.split(':')
- test_file = if test_file_str.length < 2
- result_file
- else
- test_file_str[0] + ':' + test_file_str[1]
- end
- result_output[:source][:path] = File.dirname(test_file)
- result_output[:source][:file] = File.basename(test_file)
-
- # save result_output
- @unit_name = File.basename(test_file, '.*')
-
- write_suite_header(result_output[:counts], f)
- write_failures(result_output, f)
- write_tests(result_output, f)
- write_ignored(result_output, f)
- write_suite_footer(f)
- end
- write_suites_footer(f)
- f.close
- end
-
- def usage(err_msg = nil)
- puts "\nERROR: "
- puts err_msg if err_msg
- puts 'Usage: unity_to_junit.rb [options]'
- puts ''
- puts 'Specific options:'
- puts ' -r, --results <dir> Look for Unity Results files here.'
- puts ' -p, --root_path <path> Prepend this path to files in results.'
- puts ' -o, --output <filename> XML file to generate.'
- puts ''
- puts 'Common options:'
- puts ' -h, --help Show this message'
- puts ' --version Show version'
-
- exit 1
- end
-
- protected
-
- def get_details(_result_file, lines)
- results = results_structure
- lines.each do |line|
- line = line.tr('\\', '/')
- _src_file, src_line, test_name, status, msg = line.split(/:/)
- case status
- when 'IGNORE' then results[:ignores] << { test: test_name, line: src_line, message: msg }
- when 'FAIL' then results[:failures] << { test: test_name, line: src_line, message: msg }
- when 'PASS' then results[:successes] << { test: test_name, line: src_line, message: msg }
- end
- end
- results
- end
-
- def parse_test_summary(summary)
- raise "Couldn't parse test results: #{summary}" unless summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ }
-
- [Regexp.last_match(1).to_i, Regexp.last_match(2).to_i, Regexp.last_match(3).to_i]
- end
-
- private
-
- def results_structure
- {
- source: { path: '', file: '' },
- successes: [],
- failures: [],
- ignores: [],
- counts: { total: 0, passed: 0, failed: 0, ignored: 0 },
- stdout: []
- }
- end
-
- def write_xml_header(stream)
- stream.puts "<?xml version='1.0' encoding='utf-8' ?>"
- end
-
- def write_suites_header(stream)
- stream.puts '<testsuites>'
- end
-
- def write_suite_header(counts, stream)
- stream.puts "\t<testsuite errors=\"0\" skipped=\"#{counts[:ignored]}\" failures=\"#{counts[:failed]}\" tests=\"#{counts[:total]}\" name=\"unity\">"
- end
-
- def write_failures(results, stream)
- result = results[:failures]
- result.each do |item|
- filename = File.join(results[:source][:path], File.basename(results[:source][:file], '.*'))
- stream.puts "\t\t<testcase classname=\"#{@unit_name}\" name=\"#{item[:test]}\" time=\"0\">"
- stream.puts "\t\t\t<failure message=\"#{item[:message]}\" type=\"Assertion\"/>"
- stream.puts "\t\t\t<system-err>&#xD;[File] #{filename}&#xD;[Line] #{item[:line]}&#xD;</system-err>"
- stream.puts "\t\t</testcase>"
- end
- end
-
- def write_tests(results, stream)
- result = results[:successes]
- result.each do |item|
- stream.puts "\t\t<testcase classname=\"#{@unit_name}\" name=\"#{item[:test]}\" time=\"0\" />"
- end
- end
-
- def write_ignored(results, stream)
- result = results[:ignores]
- result.each do |item|
- filename = File.join(results[:source][:path], File.basename(results[:source][:file], '.*'))
- puts "Writing ignored tests for test harness: #{filename}"
- stream.puts "\t\t<testcase classname=\"#{@unit_name}\" name=\"#{item[:test]}\" time=\"0\">"
- stream.puts "\t\t\t<skipped message=\"#{item[:message]}\" type=\"Assertion\"/>"
- stream.puts "\t\t\t<system-err>&#xD;[File] #{filename}&#xD;[Line] #{item[:line]}&#xD;</system-err>"
- stream.puts "\t\t</testcase>"
- end
- end
-
- def write_suite_footer(stream)
- stream.puts "\t</testsuite>"
- end
-
- def write_suites_footer(stream)
- stream.puts '</testsuites>'
- end
-end
-
-if $0 == __FILE__
- # parse out the command options
- options = ArgvParser.parse(ARGV)
-
- # create an instance to work with
- utj = UnityToJUnit.new
- begin
- # look in the specified or current directory for result files
- targets = "#{options.results_dir.tr('\\', '/')}**/*.test*"
-
- results = Dir[targets]
-
- raise "No *.testpass, *.testfail, or *.testresults files found in '#{targets}'" if results.empty?
-
- utj.targets = results
-
- # set the root path
- utj.root = options.root_path
-
- # set the output XML file name
- # puts "Output File from options: #{options.out_file}"
- utj.out_file = options.out_file
-
- # run the summarizer
- puts utj.run
- rescue StandardError => e
- utj.usage e.message
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/test_file_filter.rb b/tinyusb/test/vendor/ceedling/vendor/unity/auto/test_file_filter.rb
deleted file mode 100755
index 5c3a79fc..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/test_file_filter.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# ==========================================
-# Unity Project - A Test Framework for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-require'yaml'
-
-module RakefileHelpers
- class TestFileFilter
- def initialize(all_files = false)
- @all_files = all_files
-
- return unless @all_files
- return unless File.exist?('test_file_filter.yml')
-
- filters = YAML.load_file('test_file_filter.yml')
- @all_files = filters[:all_files]
- @only_files = filters[:only_files]
- @exclude_files = filters[:exclude_files]
- end
-
- attr_accessor :all_files, :only_files, :exclude_files
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/type_sanitizer.rb b/tinyusb/test/vendor/ceedling/vendor/unity/auto/type_sanitizer.rb
deleted file mode 100755
index dafb8826..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/type_sanitizer.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module TypeSanitizer
- def self.sanitize_c_identifier(unsanitized)
- # convert filename to valid C identifier by replacing invalid chars with '_'
- unsanitized.gsub(/[-\/\\\.\,\s]/, '_')
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/unity_test_summary.py b/tinyusb/test/vendor/ceedling/vendor/unity/auto/unity_test_summary.py
deleted file mode 100755
index 00c0da8c..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/unity_test_summary.py
+++ /dev/null
@@ -1,139 +0,0 @@
-#! python3
-# ==========================================
-# Unity Project - A Test Framework for C
-# Copyright (c) 2015 Alexander Mueller / XelaRellum@web.de
-# [Released under MIT License. Please refer to license.txt for details]
-# Based on the ruby script by Mike Karlesky, Mark VanderVoord, Greg Williams
-# ==========================================
-import sys
-import os
-import re
-from glob import glob
-
-class UnityTestSummary:
- def __init__(self):
- self.report = ''
- self.total_tests = 0
- self.failures = 0
- self.ignored = 0
-
- def run(self):
- # Clean up result file names
- results = []
- for target in self.targets:
- results.append(target.replace('\\', '/'))
-
- # Dig through each result file, looking for details on pass/fail:
- failure_output = []
- ignore_output = []
-
- for result_file in results:
- lines = list(map(lambda line: line.rstrip(), open(result_file, "r").read().split('\n')))
- if len(lines) == 0:
- raise Exception("Empty test result file: %s" % result_file)
-
- details = self.get_details(result_file, lines)
- failures = details['failures']
- ignores = details['ignores']
- if len(failures) > 0: failure_output.append('\n'.join(failures))
- if len(ignores) > 0: ignore_output.append('n'.join(ignores))
- tests,failures,ignored = self.parse_test_summary('\n'.join(lines))
- self.total_tests += tests
- self.failures += failures
- self.ignored += ignored
-
- if self.ignored > 0:
- self.report += "\n"
- self.report += "--------------------------\n"
- self.report += "UNITY IGNORED TEST SUMMARY\n"
- self.report += "--------------------------\n"
- self.report += "\n".join(ignore_output)
-
- if self.failures > 0:
- self.report += "\n"
- self.report += "--------------------------\n"
- self.report += "UNITY FAILED TEST SUMMARY\n"
- self.report += "--------------------------\n"
- self.report += '\n'.join(failure_output)
-
- self.report += "\n"
- self.report += "--------------------------\n"
- self.report += "OVERALL UNITY TEST SUMMARY\n"
- self.report += "--------------------------\n"
- self.report += "{total_tests} TOTAL TESTS {failures} TOTAL FAILURES {ignored} IGNORED\n".format(total_tests = self.total_tests, failures=self.failures, ignored=self.ignored)
- self.report += "\n"
-
- return self.report
-
- def set_targets(self, target_array):
- self.targets = target_array
-
- def set_root_path(self, path):
- self.root = path
-
- def usage(self, err_msg=None):
- print("\nERROR: ")
- if err_msg:
- print(err_msg)
- print("\nUsage: unity_test_summary.py result_file_directory/ root_path/")
- print(" result_file_directory - The location of your results files.")
- print(" Defaults to current directory if not specified.")
- print(" Should end in / if specified.")
- print(" root_path - Helpful for producing more verbose output if using relative paths.")
- sys.exit(1)
-
- def get_details(self, result_file, lines):
- results = { 'failures': [], 'ignores': [], 'successes': [] }
- for line in lines:
- parts = line.split(':')
- if len(parts) == 5:
- src_file,src_line,test_name,status,msg = parts
- elif len(parts) == 4:
- src_file,src_line,test_name,status = parts
- msg = ''
- else:
- continue
- if len(self.root) > 0:
- line_out = "%s%s" % (self.root, line)
- else:
- line_out = line
- if status == 'IGNORE':
- results['ignores'].append(line_out)
- elif status == 'FAIL':
- results['failures'].append(line_out)
- elif status == 'PASS':
- results['successes'].append(line_out)
- return results
-
- def parse_test_summary(self, summary):
- m = re.search(r"([0-9]+) Tests ([0-9]+) Failures ([0-9]+) Ignored", summary)
- if not m:
- raise Exception("Couldn't parse test results: %s" % summary)
-
- return int(m.group(1)), int(m.group(2)), int(m.group(3))
-
-
-if __name__ == '__main__':
- uts = UnityTestSummary()
- try:
- #look in the specified or current directory for result files
- if len(sys.argv) > 1:
- targets_dir = sys.argv[1]
- else:
- targets_dir = './'
- targets = list(map(lambda x: x.replace('\\', '/'), glob(targets_dir + '**/*.test*', recursive=True)))
- if len(targets) == 0:
- raise Exception("No *.testpass or *.testfail files found in '%s'" % targets_dir)
- uts.set_targets(targets)
-
- #set the root path
- if len(sys.argv) > 2:
- root_path = sys.argv[2]
- else:
- root_path = os.path.split(__file__)[0]
- uts.set_root_path(root_path)
-
- #run the summarizer
- print(uts.run())
- except Exception as e:
- uts.usage(e)
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/unity_test_summary.rb b/tinyusb/test/vendor/ceedling/vendor/unity/auto/unity_test_summary.rb
deleted file mode 100755
index b3fe8a69..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/unity_test_summary.rb
+++ /dev/null
@@ -1,135 +0,0 @@
-# ==========================================
-# Unity Project - A Test Framework for C
-# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
-# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
-
-# !/usr/bin/ruby
-#
-# unity_test_summary.rb
-#
-require 'fileutils'
-require 'set'
-
-class UnityTestSummary
- include FileUtils::Verbose
-
- attr_reader :report, :total_tests, :failures, :ignored
- attr_writer :targets, :root
-
- def initialize(_opts = {})
- @report = ''
- @total_tests = 0
- @failures = 0
- @ignored = 0
- end
-
- def run
- # Clean up result file names
- results = @targets.map { |target| target.tr('\\', '/') }
-
- # Dig through each result file, looking for details on pass/fail:
- failure_output = []
- ignore_output = []
-
- results.each do |result_file|
- lines = File.readlines(result_file).map(&:chomp)
-
- raise "Empty test result file: #{result_file}" if lines.empty?
-
- output = get_details(result_file, lines)
- failure_output << output[:failures] unless output[:failures].empty?
- ignore_output << output[:ignores] unless output[:ignores].empty?
- tests, failures, ignored = parse_test_summary(lines)
- @total_tests += tests
- @failures += failures
- @ignored += ignored
- end
-
- if @ignored > 0
- @report += "\n"
- @report += "--------------------------\n"
- @report += "UNITY IGNORED TEST SUMMARY\n"
- @report += "--------------------------\n"
- @report += ignore_output.flatten.join("\n")
- end
-
- if @failures > 0
- @report += "\n"
- @report += "--------------------------\n"
- @report += "UNITY FAILED TEST SUMMARY\n"
- @report += "--------------------------\n"
- @report += failure_output.flatten.join("\n")
- end
-
- @report += "\n"
- @report += "--------------------------\n"
- @report += "OVERALL UNITY TEST SUMMARY\n"
- @report += "--------------------------\n"
- @report += "#{@total_tests} TOTAL TESTS #{@failures} TOTAL FAILURES #{@ignored} IGNORED\n"
- @report += "\n"
- end
-
- def usage(err_msg = nil)
- puts "\nERROR: "
- puts err_msg if err_msg
- puts "\nUsage: unity_test_summary.rb result_file_directory/ root_path/"
- puts ' result_file_directory - The location of your results files.'
- puts ' Defaults to current directory if not specified.'
- puts ' Should end in / if specified.'
- puts ' root_path - Helpful for producing more verbose output if using relative paths.'
- exit 1
- end
-
- protected
-
- def get_details(_result_file, lines)
- results = { failures: [], ignores: [], successes: [] }
- lines.each do |line|
- _src_file, _src_line, _test_name, status, _msg = line.split(/:/)
- line_out = (@root && (@root != 0) ? "#{@root}#{line}" : line).gsub(/\//, '\\')
- case status
- when 'IGNORE' then results[:ignores] << line_out
- when 'FAIL' then results[:failures] << line_out
- when 'PASS' then results[:successes] << line_out
- end
- end
- results
- end
-
- def parse_test_summary(summary)
- raise "Couldn't parse test results: #{summary}" unless summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ }
-
- [Regexp.last_match(1).to_i, Regexp.last_match(2).to_i, Regexp.last_match(3).to_i]
- end
-end
-
-if $0 == __FILE__
-
- # parse out the command options
- opts, args = ARGV.partition { |v| v =~ /^--\w+/ }
- opts.map! { |v| v[2..-1].to_sym }
-
- # create an instance to work with
- uts = UnityTestSummary.new(opts)
-
- begin
- # look in the specified or current directory for result files
- args[0] ||= './'
- targets = "#{ARGV[0].tr('\\', '/')}**/*.test*"
- results = Dir[targets]
-
- raise "No *.testpass, *.testfail, or *.testresults files found in '#{targets}'" if results.empty?
-
- uts.targets = results
-
- # set the root path
- args[1] ||= Dir.pwd + '/'
- uts.root = ARGV[1]
-
- # run the summarizer
- puts uts.run
- rescue StandardError => e
- uts.usage e.message
- end
-end
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/auto/unity_to_junit.py b/tinyusb/test/vendor/ceedling/vendor/unity/auto/unity_to_junit.py
deleted file mode 100755
index 71dd5688..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/auto/unity_to_junit.py
+++ /dev/null
@@ -1,146 +0,0 @@
-import sys
-import os
-from glob import glob
-
-from pyparsing import *
-from junit_xml import TestSuite, TestCase
-
-
-class UnityTestSummary:
- def __init__(self):
- self.report = ''
- self.total_tests = 0
- self.failures = 0
- self.ignored = 0
- self.targets = 0
- self.root = None
- self.test_suites = dict()
-
- def run(self):
- # Clean up result file names
- results = []
- for target in self.targets:
- results.append(target.replace('\\', '/'))
-
- # Dig through each result file, looking for details on pass/fail:
- for result_file in results:
- lines = list(map(lambda line: line.rstrip(), open(result_file, "r").read().split('\n')))
- if len(lines) == 0:
- raise Exception("Empty test result file: %s" % result_file)
-
- # define an expression for your file reference
- entry_one = Combine(
- oneOf(list(alphas)) + ':/' +
- Word(alphanums + '_-./'))
-
- entry_two = Word(printables + ' ', excludeChars=':')
- entry = entry_one | entry_two
-
- delimiter = Literal(':').suppress()
- tc_result_line = Group(entry.setResultsName('tc_file_name') + delimiter + entry.setResultsName(
- 'tc_line_nr') + delimiter + entry.setResultsName('tc_name') + delimiter + entry.setResultsName(
- 'tc_status') + Optional(
- delimiter + entry.setResultsName('tc_msg'))).setResultsName("tc_line")
-
- eol = LineEnd().suppress()
- sol = LineStart().suppress()
- blank_line = sol + eol
-
- tc_summary_line = Group(Word(nums).setResultsName("num_of_tests") + "Tests" + Word(nums).setResultsName(
- "num_of_fail") + "Failures" + Word(nums).setResultsName("num_of_ignore") + "Ignored").setResultsName(
- "tc_summary")
- tc_end_line = Or(Literal("FAIL"), Literal('Ok')).setResultsName("tc_result")
-
- # run it and see...
- pp1 = tc_result_line | Optional(tc_summary_line | tc_end_line)
- pp1.ignore(blank_line | OneOrMore("-"))
-
- result = list()
- for l in lines:
- result.append((pp1.parseString(l)).asDict())
- # delete empty results
- result = filter(None, result)
-
- tc_list = list()
- for r in result:
- if 'tc_line' in r:
- tmp_tc_line = r['tc_line']
-
- # get only the file name which will be used as the classname
- file_name = tmp_tc_line['tc_file_name'].split('\\').pop().split('/').pop().rsplit('.', 1)[0]
- tmp_tc = TestCase(name=tmp_tc_line['tc_name'], classname=file_name)
- if 'tc_status' in tmp_tc_line:
- if str(tmp_tc_line['tc_status']) == 'IGNORE':
- if 'tc_msg' in tmp_tc_line:
- tmp_tc.add_skipped_info(message=tmp_tc_line['tc_msg'],
- output=r'[File]={0}, [Line]={1}'.format(
- tmp_tc_line['tc_file_name'], tmp_tc_line['tc_line_nr']))
- else:
- tmp_tc.add_skipped_info(message=" ")
- elif str(tmp_tc_line['tc_status']) == 'FAIL':
- if 'tc_msg' in tmp_tc_line:
- tmp_tc.add_failure_info(message=tmp_tc_line['tc_msg'],
- output=r'[File]={0}, [Line]={1}'.format(
- tmp_tc_line['tc_file_name'], tmp_tc_line['tc_line_nr']))
- else:
- tmp_tc.add_failure_info(message=" ")
-
- tc_list.append((str(result_file), tmp_tc))
-
- for k, v in tc_list:
- try:
- self.test_suites[k].append(v)
- except KeyError:
- self.test_suites[k] = [v]
- ts = []
- for suite_name in self.test_suites:
- ts.append(TestSuite(suite_name, self.test_suites[suite_name]))
-
- with open('result.xml', 'w') as f:
- TestSuite.to_file(f, ts, prettyprint='True', encoding='utf-8')
-
- return self.report
-
- def set_targets(self, target_array):
- self.targets = target_array
-
- def set_root_path(self, path):
- self.root = path
-
- @staticmethod
- def usage(err_msg=None):
- print("\nERROR: ")
- if err_msg:
- print(err_msg)
- print("\nUsage: unity_test_summary.py result_file_directory/ root_path/")
- print(" result_file_directory - The location of your results files.")
- print(" Defaults to current directory if not specified.")
- print(" Should end in / if specified.")
- print(" root_path - Helpful for producing more verbose output if using relative paths.")
- sys.exit(1)
-
-
-if __name__ == '__main__':
- uts = UnityTestSummary()
- try:
- # look in the specified or current directory for result files
- if len(sys.argv) > 1:
- targets_dir = sys.argv[1]
- else:
- targets_dir = './'
- targets = list(map(lambda x: x.replace('\\', '/'), glob(targets_dir + '*.test*')))
- if len(targets) == 0:
- raise Exception("No *.testpass or *.testfail files found in '%s'" % targets_dir)
- uts.set_targets(targets)
-
- # set the root path
- if len(sys.argv) > 2:
- root_path = sys.argv[2]
- else:
- root_path = os.path.split(__file__)[0]
- uts.set_root_path(root_path)
-
- # run the summarizer
- print(uts.run())
- except Exception as e:
- UnityTestSummary.usage(e)
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/release/build.info b/tinyusb/test/vendor/ceedling/vendor/unity/release/build.info
deleted file mode 100755
index 56d59128..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/release/build.info
+++ /dev/null
@@ -1,2 +0,0 @@
-122
-
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/release/version.info b/tinyusb/test/vendor/ceedling/vendor/unity/release/version.info
deleted file mode 100755
index cf12b30d..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/release/version.info
+++ /dev/null
@@ -1,2 +0,0 @@
-2.4.3
-
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/src/CMakeLists.txt b/tinyusb/test/vendor/ceedling/vendor/unity/src/CMakeLists.txt
deleted file mode 100755
index c747cb0a..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/src/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-###################################################################################
-# #
-# NAME: CMakeLists.txt #
-# #
-# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
-# WRITTEN BY: Michael Brockus. #
-# #
-# License: MIT #
-# #
-###################################################################################
-cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
-
-
-add_library(unity STATIC "unity.c")
-
-install(TARGETS unity EXPORT unityConfig
- ARCHIVE DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_INSTALL_LIBDIR}"
- LIBRARY DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_INSTALL_LIBDIR}"
- RUNTIME DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_INSTALL_BINDIR}"
- INCLUDES DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-
-
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/src/meson.build b/tinyusb/test/vendor/ceedling/vendor/unity/src/meson.build
deleted file mode 100755
index f5e01465..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/src/meson.build
+++ /dev/null
@@ -1,16 +0,0 @@
-###################################################################################
-# #
-# NAME: meson.build #
-# #
-# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
-# WRITTEN BY: Michael Brockus. #
-# #
-# License: MIT #
-# #
-###################################################################################
-
-unity_dir = include_directories('.')
-
-unity_lib = static_library(meson.project_name(),
- sources: ['unity.c'],
- include_directories: unity_dir)
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/src/unity.c b/tinyusb/test/vendor/ceedling/vendor/unity/src/unity.c
deleted file mode 100755
index c7be02cc..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/src/unity.c
+++ /dev/null
@@ -1,2085 +0,0 @@
-/* =========================================================================
- Unity Project - A Test Framework for C
- Copyright (c) 2007-19 Mike Karlesky, Mark VanderVoord, Greg Williams
- [Released under MIT License. Please refer to license.txt for details]
-============================================================================ */
-
-#include "unity.h"
-#include <stddef.h>
-
-#ifdef AVR
-#include <avr/pgmspace.h>
-#else
-#define PROGMEM
-#endif
-
-/* If omitted from header, declare overrideable prototypes here so they're ready for use */
-#ifdef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION
-void UNITY_OUTPUT_CHAR(int);
-#endif
-
-/* Helpful macros for us to use here in Assert functions */
-#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; UNITY_OUTPUT_FLUSH(); TEST_ABORT(); }
-#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; UNITY_OUTPUT_FLUSH(); TEST_ABORT(); }
-#define RETURN_IF_FAIL_OR_IGNORE if (Unity.CurrentTestFailed || Unity.CurrentTestIgnored) return
-
-struct UNITY_STORAGE_T Unity;
-
-#ifdef UNITY_OUTPUT_COLOR
-const char PROGMEM UnityStrOk[] = "\033[42mOK\033[00m";
-const char PROGMEM UnityStrPass[] = "\033[42mPASS\033[00m";
-const char PROGMEM UnityStrFail[] = "\033[41mFAIL\033[00m";
-const char PROGMEM UnityStrIgnore[] = "\033[43mIGNORE\033[00m";
-#else
-const char PROGMEM UnityStrOk[] = "OK";
-const char PROGMEM UnityStrPass[] = "PASS";
-const char PROGMEM UnityStrFail[] = "FAIL";
-const char PROGMEM UnityStrIgnore[] = "IGNORE";
-#endif
-static const char PROGMEM UnityStrNull[] = "NULL";
-static const char PROGMEM UnityStrSpacer[] = ". ";
-static const char PROGMEM UnityStrExpected[] = " Expected ";
-static const char PROGMEM UnityStrWas[] = " Was ";
-static const char PROGMEM UnityStrGt[] = " to be greater than ";
-static const char PROGMEM UnityStrLt[] = " to be less than ";
-static const char PROGMEM UnityStrOrEqual[] = "or equal to ";
-static const char PROGMEM UnityStrElement[] = " Element ";
-static const char PROGMEM UnityStrByte[] = " Byte ";
-static const char PROGMEM UnityStrMemory[] = " Memory Mismatch.";
-static const char PROGMEM UnityStrDelta[] = " Values Not Within Delta ";
-static const char PROGMEM UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless.";
-static const char PROGMEM UnityStrNullPointerForExpected[] = " Expected pointer to be NULL";
-static const char PROGMEM UnityStrNullPointerForActual[] = " Actual pointer was NULL";
-#ifndef UNITY_EXCLUDE_FLOAT
-static const char PROGMEM UnityStrNot[] = "Not ";
-static const char PROGMEM UnityStrInf[] = "Infinity";
-static const char PROGMEM UnityStrNegInf[] = "Negative Infinity";
-static const char PROGMEM UnityStrNaN[] = "NaN";
-static const char PROGMEM UnityStrDet[] = "Determinate";
-static const char PROGMEM UnityStrInvalidFloatTrait[] = "Invalid Float Trait";
-#endif
-const char PROGMEM UnityStrErrShorthand[] = "Unity Shorthand Support Disabled";
-const char PROGMEM UnityStrErrFloat[] = "Unity Floating Point Disabled";
-const char PROGMEM UnityStrErrDouble[] = "Unity Double Precision Disabled";
-const char PROGMEM UnityStrErr64[] = "Unity 64-bit Support Disabled";
-static const char PROGMEM UnityStrBreaker[] = "-----------------------";
-static const char PROGMEM UnityStrResultsTests[] = " Tests ";
-static const char PROGMEM UnityStrResultsFailures[] = " Failures ";
-static const char PROGMEM UnityStrResultsIgnored[] = " Ignored ";
-static const char PROGMEM UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " ";
-static const char PROGMEM UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " ";
-
-/*-----------------------------------------------
- * Pretty Printers & Test Result Output Handlers
- *-----------------------------------------------*/
-
-/*-----------------------------------------------*/
-/* Local helper function to print characters. */
-static void UnityPrintChar(const char* pch)
-{
- /* printable characters plus CR & LF are printed */
- if ((*pch <= 126) && (*pch >= 32))
- {
- UNITY_OUTPUT_CHAR(*pch);
- }
- /* write escaped carriage returns */
- else if (*pch == 13)
- {
- UNITY_OUTPUT_CHAR('\\');
- UNITY_OUTPUT_CHAR('r');
- }
- /* write escaped line feeds */
- else if (*pch == 10)
- {
- UNITY_OUTPUT_CHAR('\\');
- UNITY_OUTPUT_CHAR('n');
- }
- /* unprintable characters are shown as codes */
- else
- {
- UNITY_OUTPUT_CHAR('\\');
- UNITY_OUTPUT_CHAR('x');
- UnityPrintNumberHex((UNITY_UINT)*pch, 2);
- }
-}
-
-/*-----------------------------------------------*/
-/* Local helper function to print ANSI escape strings e.g. "\033[42m". */
-#ifdef UNITY_OUTPUT_COLOR
-static UNITY_UINT UnityPrintAnsiEscapeString(const char* string)
-{
- const char* pch = string;
- UNITY_UINT count = 0;
-
- while (*pch && (*pch != 'm'))
- {
- UNITY_OUTPUT_CHAR(*pch);
- pch++;
- count++;
- }
- UNITY_OUTPUT_CHAR('m');
- count++;
-
- return count;
-}
-#endif
-
-/*-----------------------------------------------*/
-void UnityPrint(const char* string)
-{
- const char* pch = string;
-
- if (pch != NULL)
- {
- while (*pch)
- {
-#ifdef UNITY_OUTPUT_COLOR
- /* print ANSI escape code */
- if ((*pch == 27) && (*(pch + 1) == '['))
- {
- pch += UnityPrintAnsiEscapeString(pch);
- continue;
- }
-#endif
- UnityPrintChar(pch);
- pch++;
- }
- }
-}
-
-/*-----------------------------------------------*/
-#ifdef UNITY_INCLUDE_PRINT_FORMATTED
-void UnityPrintFormatted(const char* format, ...)
-{
- const char* pch = format;
- va_list va;
- va_start(va, format);
-
- if (pch != NULL)
- {
- while (*pch)
- {
- /* format identification character */
- if (*pch == '%')
- {
- pch++;
-
- if (pch != NULL)
- {
- switch (*pch)
- {
- case 'd':
- case 'i':
- {
- const int number = va_arg(va, int);
- UnityPrintNumber((UNITY_INT)number);
- break;
- }
-#ifndef UNITY_EXCLUDE_FLOAT_PRINT
- case 'f':
- case 'g':
- {
- const double number = va_arg(va, double);
- UnityPrintFloat((UNITY_DOUBLE)number);
- break;
- }
-#endif
- case 'u':
- {
- const unsigned int number = va_arg(va, unsigned int);
- UnityPrintNumberUnsigned((UNITY_UINT)number);
- break;
- }
- case 'b':
- {
- const unsigned int number = va_arg(va, unsigned int);
- const UNITY_UINT mask = (UNITY_UINT)0 - (UNITY_UINT)1;
- UNITY_OUTPUT_CHAR('0');
- UNITY_OUTPUT_CHAR('b');
- UnityPrintMask(mask, (UNITY_UINT)number);
- break;
- }
- case 'x':
- case 'X':
- case 'p':
- {
- const unsigned int number = va_arg(va, unsigned int);
- UNITY_OUTPUT_CHAR('0');
- UNITY_OUTPUT_CHAR('x');
- UnityPrintNumberHex((UNITY_UINT)number, 8);
- break;
- }
- case 'c':
- {
- const int ch = va_arg(va, int);
- UnityPrintChar((const char *)&ch);
- break;
- }
- case 's':
- {
- const char * string = va_arg(va, const char *);
- UnityPrint(string);
- break;
- }
- case '%':
- {
- UnityPrintChar(pch);
- break;
- }
- default:
- {
- /* print the unknown format character */
- UNITY_OUTPUT_CHAR('%');
- UnityPrintChar(pch);
- break;
- }
- }
- }
- }
-#ifdef UNITY_OUTPUT_COLOR
- /* print ANSI escape code */
- else if ((*pch == 27) && (*(pch + 1) == '['))
- {
- pch += UnityPrintAnsiEscapeString(pch);
- continue;
- }
-#endif
- else if (*pch == '\n')
- {
- UNITY_PRINT_EOL();
- }
- else
- {
- UnityPrintChar(pch);
- }
-
- pch++;
- }
- }
-
- va_end(va);
-}
-#endif /* ! UNITY_INCLUDE_PRINT_FORMATTED */
-
-/*-----------------------------------------------*/
-void UnityPrintLen(const char* string, const UNITY_UINT32 length)
-{
- const char* pch = string;
-
- if (pch != NULL)
- {
- while (*pch && ((UNITY_UINT32)(pch - string) < length))
- {
- /* printable characters plus CR & LF are printed */
- if ((*pch <= 126) && (*pch >= 32))
- {
- UNITY_OUTPUT_CHAR(*pch);
- }
- /* write escaped carriage returns */
- else if (*pch == 13)
- {
- UNITY_OUTPUT_CHAR('\\');
- UNITY_OUTPUT_CHAR('r');
- }
- /* write escaped line feeds */
- else if (*pch == 10)
- {
- UNITY_OUTPUT_CHAR('\\');
- UNITY_OUTPUT_CHAR('n');
- }
- /* unprintable characters are shown as codes */
- else
- {
- UNITY_OUTPUT_CHAR('\\');
- UNITY_OUTPUT_CHAR('x');
- UnityPrintNumberHex((UNITY_UINT)*pch, 2);
- }
- pch++;
- }
- }
-}
-
-/*-----------------------------------------------*/
-void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style)
-{
- if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)
- {
- if (style == UNITY_DISPLAY_STYLE_CHAR)
- {
- /* printable characters plus CR & LF are printed */
- UNITY_OUTPUT_CHAR('\'');
- if ((number <= 126) && (number >= 32))
- {
- UNITY_OUTPUT_CHAR((int)number);
- }
- /* write escaped carriage returns */
- else if (number == 13)
- {
- UNITY_OUTPUT_CHAR('\\');
- UNITY_OUTPUT_CHAR('r');
- }
- /* write escaped line feeds */
- else if (number == 10)
- {
- UNITY_OUTPUT_CHAR('\\');
- UNITY_OUTPUT_CHAR('n');
- }
- /* unprintable characters are shown as codes */
- else
- {
- UNITY_OUTPUT_CHAR('\\');
- UNITY_OUTPUT_CHAR('x');
- UnityPrintNumberHex((UNITY_UINT)number, 2);
- }
- UNITY_OUTPUT_CHAR('\'');
- }
- else
- {
- UnityPrintNumber(number);
- }
- }
- else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT)
- {
- UnityPrintNumberUnsigned((UNITY_UINT)number);
- }
- else
- {
- UNITY_OUTPUT_CHAR('0');
- UNITY_OUTPUT_CHAR('x');
- UnityPrintNumberHex((UNITY_UINT)number, (char)((style & 0xF) * 2));
- }
-}
-
-/*-----------------------------------------------*/
-void UnityPrintNumber(const UNITY_INT number_to_print)
-{
- UNITY_UINT number = (UNITY_UINT)number_to_print;
-
- if (number_to_print < 0)
- {
- /* A negative number, including MIN negative */
- UNITY_OUTPUT_CHAR('-');
- number = (~number) + 1;
- }
- UnityPrintNumberUnsigned(number);
-}
-
-/*-----------------------------------------------
- * basically do an itoa using as little ram as possible */
-void UnityPrintNumberUnsigned(const UNITY_UINT number)
-{
- UNITY_UINT divisor = 1;
-
- /* figure out initial divisor */
- while (number / divisor > 9)
- {
- divisor *= 10;
- }
-
- /* now mod and print, then divide divisor */
- do
- {
- UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10)));
- divisor /= 10;
- } while (divisor > 0);
-}
-
-/*-----------------------------------------------*/
-void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print)
-{
- int nibble;
- char nibbles = nibbles_to_print;
-
- if ((unsigned)nibbles > UNITY_MAX_NIBBLES)
- {
- nibbles = UNITY_MAX_NIBBLES;
- }
-
- while (nibbles > 0)
- {
- nibbles--;
- nibble = (int)(number >> (nibbles * 4)) & 0x0F;
- if (nibble <= 9)
- {
- UNITY_OUTPUT_CHAR((char)('0' + nibble));
- }
- else
- {
- UNITY_OUTPUT_CHAR((char)('A' - 10 + nibble));
- }
- }
-}
-
-/*-----------------------------------------------*/
-void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number)
-{
- UNITY_UINT current_bit = (UNITY_UINT)1 << (UNITY_INT_WIDTH - 1);
- UNITY_INT32 i;
-
- for (i = 0; i < UNITY_INT_WIDTH; i++)
- {
- if (current_bit & mask)
- {
- if (current_bit & number)
- {
- UNITY_OUTPUT_CHAR('1');
- }
- else
- {
- UNITY_OUTPUT_CHAR('0');
- }
- }
- else
- {
- UNITY_OUTPUT_CHAR('X');
- }
- current_bit = current_bit >> 1;
- }
-}
-
-/*-----------------------------------------------*/
-#ifndef UNITY_EXCLUDE_FLOAT_PRINT
-/*
- * This function prints a floating-point value in a format similar to
- * printf("%.7g") on a single-precision machine or printf("%.9g") on a
- * double-precision machine. The 7th digit won't always be totally correct
- * in single-precision operation (for that level of accuracy, a more
- * complicated algorithm would be needed).
- */
-void UnityPrintFloat(const UNITY_DOUBLE input_number)
-{
-#ifdef UNITY_INCLUDE_DOUBLE
- static const int sig_digits = 9;
- static const UNITY_INT32 min_scaled = 100000000;
- static const UNITY_INT32 max_scaled = 1000000000;
-#else
- static const int sig_digits = 7;
- static const UNITY_INT32 min_scaled = 1000000;
- static const UNITY_INT32 max_scaled = 10000000;
-#endif
-
- UNITY_DOUBLE number = input_number;
-
- /* print minus sign (does not handle negative zero) */
- if (number < 0.0f)
- {
- UNITY_OUTPUT_CHAR('-');
- number = -number;
- }
-
- /* handle zero, NaN, and +/- infinity */
- if (number == 0.0f)
- {
- UnityPrint("0");
- }
- else if (isnan(number))
- {
- UnityPrint("nan");
- }
- else if (isinf(number))
- {
- UnityPrint("inf");
- }
- else
- {
- UNITY_INT32 n_int = 0, n;
- int exponent = 0;
- int decimals, digits;
- char buf[16] = {0};
-
- /*
- * Scale up or down by powers of 10. To minimize rounding error,
- * start with a factor/divisor of 10^10, which is the largest
- * power of 10 that can be represented exactly. Finally, compute
- * (exactly) the remaining power of 10 and perform one more
- * multiplication or division.
- */
- if (number < 1.0f)
- {
- UNITY_DOUBLE factor = 1.0f;
-
- while (number < (UNITY_DOUBLE)max_scaled / 1e10f) { number *= 1e10f; exponent -= 10; }
- while (number * factor < (UNITY_DOUBLE)min_scaled) { factor *= 10.0f; exponent--; }
-
- number *= factor;
- }
- else if (number > (UNITY_DOUBLE)max_scaled)
- {
- UNITY_DOUBLE divisor = 1.0f;
-
- while (number > (UNITY_DOUBLE)min_scaled * 1e10f) { number /= 1e10f; exponent += 10; }
- while (number / divisor > (UNITY_DOUBLE)max_scaled) { divisor *= 10.0f; exponent++; }
-
- number /= divisor;
- }
- else
- {
- /*
- * In this range, we can split off the integer part before
- * doing any multiplications. This reduces rounding error by
- * freeing up significant bits in the fractional part.
- */
- UNITY_DOUBLE factor = 1.0f;
- n_int = (UNITY_INT32)number;
- number -= (UNITY_DOUBLE)n_int;
-
- while (n_int < min_scaled) { n_int *= 10; factor *= 10.0f; exponent--; }
-
- number *= factor;
- }
-
- /* round to nearest integer */
- n = ((UNITY_INT32)(number + number) + 1) / 2;
-
-#ifndef UNITY_ROUND_TIES_AWAY_FROM_ZERO
- /* round to even if exactly between two integers */
- if ((n & 1) && (((UNITY_DOUBLE)n - number) == 0.5f))
- n--;
-#endif
-
- n += n_int;
-
- if (n >= max_scaled)
- {
- n = min_scaled;
- exponent++;
- }
-
- /* determine where to place decimal point */
- decimals = ((exponent <= 0) && (exponent >= -(sig_digits + 3))) ? (-exponent) : (sig_digits - 1);
- exponent += decimals;
-
- /* truncate trailing zeroes after decimal point */
- while ((decimals > 0) && ((n % 10) == 0))
- {
- n /= 10;
- decimals--;
- }
-
- /* build up buffer in reverse order */
- digits = 0;
- while ((n != 0) || (digits < (decimals + 1)))
- {
- buf[digits++] = (char)('0' + n % 10);
- n /= 10;
- }
- while (digits > 0)
- {
- if (digits == decimals) { UNITY_OUTPUT_CHAR('.'); }
- UNITY_OUTPUT_CHAR(buf[--digits]);
- }
-
- /* print exponent if needed */
- if (exponent != 0)
- {
- UNITY_OUTPUT_CHAR('e');
-
- if (exponent < 0)
- {
- UNITY_OUTPUT_CHAR('-');
- exponent = -exponent;
- }
- else
- {
- UNITY_OUTPUT_CHAR('+');
- }
-
- digits = 0;
- while ((exponent != 0) || (digits < 2))
- {
- buf[digits++] = (char)('0' + exponent % 10);
- exponent /= 10;
- }
- while (digits > 0)
- {
- UNITY_OUTPUT_CHAR(buf[--digits]);
- }
- }
- }
-}
-#endif /* ! UNITY_EXCLUDE_FLOAT_PRINT */
-
-/*-----------------------------------------------*/
-static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
-{
-#ifdef UNITY_OUTPUT_FOR_ECLIPSE
- UNITY_OUTPUT_CHAR('(');
- UnityPrint(file);
- UNITY_OUTPUT_CHAR(':');
- UnityPrintNumber((UNITY_INT)line);
- UNITY_OUTPUT_CHAR(')');
- UNITY_OUTPUT_CHAR(' ');
- UnityPrint(Unity.CurrentTestName);
- UNITY_OUTPUT_CHAR(':');
-#else
-#ifdef UNITY_OUTPUT_FOR_IAR_WORKBENCH
- UnityPrint("<SRCREF line=");
- UnityPrintNumber((UNITY_INT)line);
- UnityPrint(" file=\"");
- UnityPrint(file);
- UNITY_OUTPUT_CHAR('"');
- UNITY_OUTPUT_CHAR('>');
- UnityPrint(Unity.CurrentTestName);
- UnityPrint("</SRCREF> ");
-#else
-#ifdef UNITY_OUTPUT_FOR_QT_CREATOR
- UnityPrint("file://");
- UnityPrint(file);
- UNITY_OUTPUT_CHAR(':');
- UnityPrintNumber((UNITY_INT)line);
- UNITY_OUTPUT_CHAR(' ');
- UnityPrint(Unity.CurrentTestName);
- UNITY_OUTPUT_CHAR(':');
-#else
- UnityPrint(file);
- UNITY_OUTPUT_CHAR(':');
- UnityPrintNumber((UNITY_INT)line);
- UNITY_OUTPUT_CHAR(':');
- UnityPrint(Unity.CurrentTestName);
- UNITY_OUTPUT_CHAR(':');
-#endif
-#endif
-#endif
-}
-
-/*-----------------------------------------------*/
-static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line)
-{
- UnityTestResultsBegin(Unity.TestFile, line);
- UnityPrint(UnityStrFail);
- UNITY_OUTPUT_CHAR(':');
-}
-
-/*-----------------------------------------------*/
-void UnityConcludeTest(void)
-{
- if (Unity.CurrentTestIgnored)
- {
- Unity.TestIgnores++;
- }
- else if (!Unity.CurrentTestFailed)
- {
- UnityTestResultsBegin(Unity.TestFile, Unity.CurrentTestLineNumber);
- UnityPrint(UnityStrPass);
- }
- else
- {
- Unity.TestFailures++;
- }
-
- Unity.CurrentTestFailed = 0;
- Unity.CurrentTestIgnored = 0;
- UNITY_PRINT_EXEC_TIME();
- UNITY_PRINT_EOL();
- UNITY_FLUSH_CALL();
-}
-
-/*-----------------------------------------------*/
-static void UnityAddMsgIfSpecified(const char* msg)
-{
- if (msg)
- {
- UnityPrint(UnityStrSpacer);
-#ifndef UNITY_EXCLUDE_DETAILS
- if (Unity.CurrentDetail1)
- {
- UnityPrint(UnityStrDetail1Name);
- UnityPrint(Unity.CurrentDetail1);
- if (Unity.CurrentDetail2)
- {
- UnityPrint(UnityStrDetail2Name);
- UnityPrint(Unity.CurrentDetail2);
- }
- UnityPrint(UnityStrSpacer);
- }
-#endif
- UnityPrint(msg);
- }
-}
-
-/*-----------------------------------------------*/
-static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual)
-{
- UnityPrint(UnityStrExpected);
- if (expected != NULL)
- {
- UNITY_OUTPUT_CHAR('\'');
- UnityPrint(expected);
- UNITY_OUTPUT_CHAR('\'');
- }
- else
- {
- UnityPrint(UnityStrNull);
- }
- UnityPrint(UnityStrWas);
- if (actual != NULL)
- {
- UNITY_OUTPUT_CHAR('\'');
- UnityPrint(actual);
- UNITY_OUTPUT_CHAR('\'');
- }
- else
- {
- UnityPrint(UnityStrNull);
- }
-}
-
-/*-----------------------------------------------*/
-static void UnityPrintExpectedAndActualStringsLen(const char* expected,
- const char* actual,
- const UNITY_UINT32 length)
-{
- UnityPrint(UnityStrExpected);
- if (expected != NULL)
- {
- UNITY_OUTPUT_CHAR('\'');
- UnityPrintLen(expected, length);
- UNITY_OUTPUT_CHAR('\'');
- }
- else
- {
- UnityPrint(UnityStrNull);
- }
- UnityPrint(UnityStrWas);
- if (actual != NULL)
- {
- UNITY_OUTPUT_CHAR('\'');
- UnityPrintLen(actual, length);
- UNITY_OUTPUT_CHAR('\'');
- }
- else
- {
- UnityPrint(UnityStrNull);
- }
-}
-
-/*-----------------------------------------------
- * Assertion & Control Helpers
- *-----------------------------------------------*/
-
-/*-----------------------------------------------*/
-static int UnityIsOneArrayNull(UNITY_INTERNAL_PTR expected,
- UNITY_INTERNAL_PTR actual,
- const UNITY_LINE_TYPE lineNumber,
- const char* msg)
-{
- /* Both are NULL or same pointer */
- if (expected == actual) { return 0; }
-
- /* print and return true if just expected is NULL */
- if (expected == NULL)
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrNullPointerForExpected);
- UnityAddMsgIfSpecified(msg);
- return 1;
- }
-
- /* print and return true if just actual is NULL */
- if (actual == NULL)
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrNullPointerForActual);
- UnityAddMsgIfSpecified(msg);
- return 1;
- }
-
- return 0; /* return false if neither is NULL */
-}
-
-/*-----------------------------------------------
- * Assertion Functions
- *-----------------------------------------------*/
-
-/*-----------------------------------------------*/
-void UnityAssertBits(const UNITY_INT mask,
- const UNITY_INT expected,
- const UNITY_INT actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber)
-{
- RETURN_IF_FAIL_OR_IGNORE;
-
- if ((mask & expected) != (mask & actual))
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrExpected);
- UnityPrintMask((UNITY_UINT)mask, (UNITY_UINT)expected);
- UnityPrint(UnityStrWas);
- UnityPrintMask((UNITY_UINT)mask, (UNITY_UINT)actual);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
-}
-
-/*-----------------------------------------------*/
-void UnityAssertEqualNumber(const UNITY_INT expected,
- const UNITY_INT actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_DISPLAY_STYLE_T style)
-{
- RETURN_IF_FAIL_OR_IGNORE;
-
- if (expected != actual)
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrExpected);
- UnityPrintNumberByStyle(expected, style);
- UnityPrint(UnityStrWas);
- UnityPrintNumberByStyle(actual, style);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
-}
-
-/*-----------------------------------------------*/
-void UnityAssertGreaterOrLessOrEqualNumber(const UNITY_INT threshold,
- const UNITY_INT actual,
- const UNITY_COMPARISON_T compare,
- const char *msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_DISPLAY_STYLE_T style)
-{
- int failed = 0;
- RETURN_IF_FAIL_OR_IGNORE;
-
- if ((threshold == actual) && (compare & UNITY_EQUAL_TO)) { return; }
- if ((threshold == actual)) { failed = 1; }
-
- if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)
- {
- if ((actual > threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; }
- if ((actual < threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; }
- }
- else /* UINT or HEX */
- {
- if (((UNITY_UINT)actual > (UNITY_UINT)threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; }
- if (((UNITY_UINT)actual < (UNITY_UINT)threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; }
- }
-
- if (failed)
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrExpected);
- UnityPrintNumberByStyle(actual, style);
- if (compare & UNITY_GREATER_THAN) { UnityPrint(UnityStrGt); }
- if (compare & UNITY_SMALLER_THAN) { UnityPrint(UnityStrLt); }
- if (compare & UNITY_EQUAL_TO) { UnityPrint(UnityStrOrEqual); }
- UnityPrintNumberByStyle(threshold, style);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
-}
-
-#define UnityPrintPointlessAndBail() \
-{ \
- UnityTestResultsFailBegin(lineNumber); \
- UnityPrint(UnityStrPointless); \
- UnityAddMsgIfSpecified(msg); \
- UNITY_FAIL_AND_BAIL; }
-
-/*-----------------------------------------------*/
-void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
- UNITY_INTERNAL_PTR actual,
- const UNITY_UINT32 num_elements,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_DISPLAY_STYLE_T style,
- const UNITY_FLAGS_T flags)
-{
- UNITY_UINT32 elements = num_elements;
- unsigned int length = style & 0xF;
- unsigned int increment = 0;
-
- RETURN_IF_FAIL_OR_IGNORE;
-
- if (num_elements == 0)
- {
- UnityPrintPointlessAndBail();
- }
-
- if (expected == actual)
- {
- return; /* Both are NULL or same pointer */
- }
-
- if (UnityIsOneArrayNull(expected, actual, lineNumber, msg))
- {
- UNITY_FAIL_AND_BAIL;
- }
-
- while ((elements > 0) && (elements--))
- {
- UNITY_INT expect_val;
- UNITY_INT actual_val;
-
- switch (length)
- {
- case 1:
- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)expected;
- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)actual;
- increment = sizeof(UNITY_INT8);
- break;
-
- case 2:
- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)expected;
- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)actual;
- increment = sizeof(UNITY_INT16);
- break;
-
-#ifdef UNITY_SUPPORT_64
- case 8:
- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)expected;
- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)actual;
- increment = sizeof(UNITY_INT64);
- break;
-#endif
-
- default: /* default is length 4 bytes */
- case 4:
- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)expected;
- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)actual;
- increment = sizeof(UNITY_INT32);
- length = 4;
- break;
- }
-
- if (expect_val != actual_val)
- {
- if ((style & UNITY_DISPLAY_RANGE_UINT) && (length < (UNITY_INT_WIDTH / 8)))
- { /* For UINT, remove sign extension (padding 1's) from signed type casts above */
- UNITY_INT mask = 1;
- mask = (mask << 8 * length) - 1;
- expect_val &= mask;
- actual_val &= mask;
- }
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrElement);
- UnityPrintNumberUnsigned(num_elements - elements - 1);
- UnityPrint(UnityStrExpected);
- UnityPrintNumberByStyle(expect_val, style);
- UnityPrint(UnityStrWas);
- UnityPrintNumberByStyle(actual_val, style);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
- /* Walk through array by incrementing the pointers */
- if (flags == UNITY_ARRAY_TO_ARRAY)
- {
- expected = (UNITY_INTERNAL_PTR)((const char*)expected + increment);
- }
- actual = (UNITY_INTERNAL_PTR)((const char*)actual + increment);
- }
-}
-
-/*-----------------------------------------------*/
-#ifndef UNITY_EXCLUDE_FLOAT
-/* Wrap this define in a function with variable types as float or double */
-#define UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff) \
- if (isinf(expected) && isinf(actual) && (((expected) < 0) == ((actual) < 0))) return 1; \
- if (UNITY_NAN_CHECK) return 1; \
- (diff) = (actual) - (expected); \
- if ((diff) < 0) (diff) = -(diff); \
- if ((delta) < 0) (delta) = -(delta); \
- return !(isnan(diff) || isinf(diff) || ((diff) > (delta)))
- /* This first part of this condition will catch any NaN or Infinite values */
-#ifndef UNITY_NAN_NOT_EQUAL_NAN
- #define UNITY_NAN_CHECK isnan(expected) && isnan(actual)
-#else
- #define UNITY_NAN_CHECK 0
-#endif
-
-#ifndef UNITY_EXCLUDE_FLOAT_PRINT
- #define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \
- { \
- UnityPrint(UnityStrExpected); \
- UnityPrintFloat(expected); \
- UnityPrint(UnityStrWas); \
- UnityPrintFloat(actual); }
-#else
- #define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \
- UnityPrint(UnityStrDelta)
-#endif /* UNITY_EXCLUDE_FLOAT_PRINT */
-
-/*-----------------------------------------------*/
-static int UnityFloatsWithin(UNITY_FLOAT delta, UNITY_FLOAT expected, UNITY_FLOAT actual)
-{
- UNITY_FLOAT diff;
- UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff);
-}
-
-/*-----------------------------------------------*/
-void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* expected,
- UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* actual,
- const UNITY_UINT32 num_elements,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_FLAGS_T flags)
-{
- UNITY_UINT32 elements = num_elements;
- UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* ptr_expected = expected;
- UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* ptr_actual = actual;
-
- RETURN_IF_FAIL_OR_IGNORE;
-
- if (elements == 0)
- {
- UnityPrintPointlessAndBail();
- }
-
- if (expected == actual)
- {
- return; /* Both are NULL or same pointer */
- }
-
- if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg))
- {
- UNITY_FAIL_AND_BAIL;
- }
-
- while (elements--)
- {
- if (!UnityFloatsWithin(*ptr_expected * UNITY_FLOAT_PRECISION, *ptr_expected, *ptr_actual))
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrElement);
- UnityPrintNumberUnsigned(num_elements - elements - 1);
- UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT((UNITY_DOUBLE)*ptr_expected, (UNITY_DOUBLE)*ptr_actual);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
- if (flags == UNITY_ARRAY_TO_ARRAY)
- {
- ptr_expected++;
- }
- ptr_actual++;
- }
-}
-
-/*-----------------------------------------------*/
-void UnityAssertFloatsWithin(const UNITY_FLOAT delta,
- const UNITY_FLOAT expected,
- const UNITY_FLOAT actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber)
-{
- RETURN_IF_FAIL_OR_IGNORE;
-
-
- if (!UnityFloatsWithin(delta, expected, actual))
- {
- UnityTestResultsFailBegin(lineNumber);
- UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT((UNITY_DOUBLE)expected, (UNITY_DOUBLE)actual);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
-}
-
-/*-----------------------------------------------*/
-void UnityAssertFloatSpecial(const UNITY_FLOAT actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_FLOAT_TRAIT_T style)
-{
- const char* trait_names[] = {UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet};
- UNITY_INT should_be_trait = ((UNITY_INT)style & 1);
- UNITY_INT is_trait = !should_be_trait;
- UNITY_INT trait_index = (UNITY_INT)(style >> 1);
-
- RETURN_IF_FAIL_OR_IGNORE;
-
- switch (style)
- {
- case UNITY_FLOAT_IS_INF:
- case UNITY_FLOAT_IS_NOT_INF:
- is_trait = isinf(actual) && (actual > 0);
- break;
- case UNITY_FLOAT_IS_NEG_INF:
- case UNITY_FLOAT_IS_NOT_NEG_INF:
- is_trait = isinf(actual) && (actual < 0);
- break;
-
- case UNITY_FLOAT_IS_NAN:
- case UNITY_FLOAT_IS_NOT_NAN:
- is_trait = isnan(actual) ? 1 : 0;
- break;
-
- case UNITY_FLOAT_IS_DET: /* A determinate number is non infinite and not NaN. */
- case UNITY_FLOAT_IS_NOT_DET:
- is_trait = !isinf(actual) && !isnan(actual);
- break;
-
- default:
- trait_index = 0;
- trait_names[0] = UnityStrInvalidFloatTrait;
- break;
- }
-
- if (is_trait != should_be_trait)
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrExpected);
- if (!should_be_trait)
- {
- UnityPrint(UnityStrNot);
- }
- UnityPrint(trait_names[trait_index]);
- UnityPrint(UnityStrWas);
-#ifndef UNITY_EXCLUDE_FLOAT_PRINT
- UnityPrintFloat((UNITY_DOUBLE)actual);
-#else
- if (should_be_trait)
- {
- UnityPrint(UnityStrNot);
- }
- UnityPrint(trait_names[trait_index]);
-#endif
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
-}
-
-#endif /* not UNITY_EXCLUDE_FLOAT */
-
-/*-----------------------------------------------*/
-#ifndef UNITY_EXCLUDE_DOUBLE
-static int UnityDoublesWithin(UNITY_DOUBLE delta, UNITY_DOUBLE expected, UNITY_DOUBLE actual)
-{
- UNITY_DOUBLE diff;
- UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff);
-}
-
-/*-----------------------------------------------*/
-void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* expected,
- UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* actual,
- const UNITY_UINT32 num_elements,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_FLAGS_T flags)
-{
- UNITY_UINT32 elements = num_elements;
- UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_expected = expected;
- UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_actual = actual;
-
- RETURN_IF_FAIL_OR_IGNORE;
-
- if (elements == 0)
- {
- UnityPrintPointlessAndBail();
- }
-
- if (expected == actual)
- {
- return; /* Both are NULL or same pointer */
- }
-
- if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg))
- {
- UNITY_FAIL_AND_BAIL;
- }
-
- while (elements--)
- {
- if (!UnityDoublesWithin(*ptr_expected * UNITY_DOUBLE_PRECISION, *ptr_expected, *ptr_actual))
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrElement);
- UnityPrintNumberUnsigned(num_elements - elements - 1);
- UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(*ptr_expected, *ptr_actual);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
- if (flags == UNITY_ARRAY_TO_ARRAY)
- {
- ptr_expected++;
- }
- ptr_actual++;
- }
-}
-
-/*-----------------------------------------------*/
-void UnityAssertDoublesWithin(const UNITY_DOUBLE delta,
- const UNITY_DOUBLE expected,
- const UNITY_DOUBLE actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber)
-{
- RETURN_IF_FAIL_OR_IGNORE;
-
- if (!UnityDoublesWithin(delta, expected, actual))
- {
- UnityTestResultsFailBegin(lineNumber);
- UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
-}
-
-/*-----------------------------------------------*/
-void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_FLOAT_TRAIT_T style)
-{
- const char* trait_names[] = {UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet};
- UNITY_INT should_be_trait = ((UNITY_INT)style & 1);
- UNITY_INT is_trait = !should_be_trait;
- UNITY_INT trait_index = (UNITY_INT)(style >> 1);
-
- RETURN_IF_FAIL_OR_IGNORE;
-
- switch (style)
- {
- case UNITY_FLOAT_IS_INF:
- case UNITY_FLOAT_IS_NOT_INF:
- is_trait = isinf(actual) && (actual > 0);
- break;
- case UNITY_FLOAT_IS_NEG_INF:
- case UNITY_FLOAT_IS_NOT_NEG_INF:
- is_trait = isinf(actual) && (actual < 0);
- break;
-
- case UNITY_FLOAT_IS_NAN:
- case UNITY_FLOAT_IS_NOT_NAN:
- is_trait = isnan(actual) ? 1 : 0;
- break;
-
- case UNITY_FLOAT_IS_DET: /* A determinate number is non infinite and not NaN. */
- case UNITY_FLOAT_IS_NOT_DET:
- is_trait = !isinf(actual) && !isnan(actual);
- break;
-
- default:
- trait_index = 0;
- trait_names[0] = UnityStrInvalidFloatTrait;
- break;
- }
-
- if (is_trait != should_be_trait)
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrExpected);
- if (!should_be_trait)
- {
- UnityPrint(UnityStrNot);
- }
- UnityPrint(trait_names[trait_index]);
- UnityPrint(UnityStrWas);
-#ifndef UNITY_EXCLUDE_FLOAT_PRINT
- UnityPrintFloat(actual);
-#else
- if (should_be_trait)
- {
- UnityPrint(UnityStrNot);
- }
- UnityPrint(trait_names[trait_index]);
-#endif
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
-}
-
-#endif /* not UNITY_EXCLUDE_DOUBLE */
-
-/*-----------------------------------------------*/
-void UnityAssertNumbersWithin(const UNITY_UINT delta,
- const UNITY_INT expected,
- const UNITY_INT actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_DISPLAY_STYLE_T style)
-{
- RETURN_IF_FAIL_OR_IGNORE;
-
- if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)
- {
- if (actual > expected)
- {
- Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta);
- }
- else
- {
- Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta);
- }
- }
- else
- {
- if ((UNITY_UINT)actual > (UNITY_UINT)expected)
- {
- Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta);
- }
- else
- {
- Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta);
- }
- }
-
- if (Unity.CurrentTestFailed)
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrDelta);
- UnityPrintNumberByStyle((UNITY_INT)delta, style);
- UnityPrint(UnityStrExpected);
- UnityPrintNumberByStyle(expected, style);
- UnityPrint(UnityStrWas);
- UnityPrintNumberByStyle(actual, style);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
-}
-
-/*-----------------------------------------------*/
-void UnityAssertNumbersArrayWithin(const UNITY_UINT delta,
- UNITY_INTERNAL_PTR expected,
- UNITY_INTERNAL_PTR actual,
- const UNITY_UINT32 num_elements,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_DISPLAY_STYLE_T style,
- const UNITY_FLAGS_T flags)
-{
- UNITY_UINT32 elements = num_elements;
- unsigned int length = style & 0xF;
- unsigned int increment = 0;
-
- RETURN_IF_FAIL_OR_IGNORE;
-
- if (num_elements == 0)
- {
- UnityPrintPointlessAndBail();
- }
-
- if (expected == actual)
- {
- return; /* Both are NULL or same pointer */
- }
-
- if (UnityIsOneArrayNull(expected, actual, lineNumber, msg))
- {
- UNITY_FAIL_AND_BAIL;
- }
-
- while ((elements > 0) && (elements--))
- {
- UNITY_INT expect_val;
- UNITY_INT actual_val;
-
- switch (length)
- {
- case 1:
- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)expected;
- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)actual;
- increment = sizeof(UNITY_INT8);
- break;
-
- case 2:
- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)expected;
- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)actual;
- increment = sizeof(UNITY_INT16);
- break;
-
-#ifdef UNITY_SUPPORT_64
- case 8:
- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)expected;
- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)actual;
- increment = sizeof(UNITY_INT64);
- break;
-#endif
-
- default: /* default is length 4 bytes */
- case 4:
- expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)expected;
- actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)actual;
- increment = sizeof(UNITY_INT32);
- length = 4;
- break;
- }
-
- if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)
- {
- if (actual_val > expect_val)
- {
- Unity.CurrentTestFailed = (((UNITY_UINT)actual_val - (UNITY_UINT)expect_val) > delta);
- }
- else
- {
- Unity.CurrentTestFailed = (((UNITY_UINT)expect_val - (UNITY_UINT)actual_val) > delta);
- }
- }
- else
- {
- if ((UNITY_UINT)actual_val > (UNITY_UINT)expect_val)
- {
- Unity.CurrentTestFailed = (((UNITY_UINT)actual_val - (UNITY_UINT)expect_val) > delta);
- }
- else
- {
- Unity.CurrentTestFailed = (((UNITY_UINT)expect_val - (UNITY_UINT)actual_val) > delta);
- }
- }
-
- if (Unity.CurrentTestFailed)
- {
- if ((style & UNITY_DISPLAY_RANGE_UINT) && (length < (UNITY_INT_WIDTH / 8)))
- { /* For UINT, remove sign extension (padding 1's) from signed type casts above */
- UNITY_INT mask = 1;
- mask = (mask << 8 * length) - 1;
- expect_val &= mask;
- actual_val &= mask;
- }
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrDelta);
- UnityPrintNumberByStyle((UNITY_INT)delta, style);
- UnityPrint(UnityStrElement);
- UnityPrintNumberUnsigned(num_elements - elements - 1);
- UnityPrint(UnityStrExpected);
- UnityPrintNumberByStyle(expect_val, style);
- UnityPrint(UnityStrWas);
- UnityPrintNumberByStyle(actual_val, style);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
- /* Walk through array by incrementing the pointers */
- if (flags == UNITY_ARRAY_TO_ARRAY)
- {
- expected = (UNITY_INTERNAL_PTR)((const char*)expected + increment);
- }
- actual = (UNITY_INTERNAL_PTR)((const char*)actual + increment);
- }
-}
-
-/*-----------------------------------------------*/
-void UnityAssertEqualString(const char* expected,
- const char* actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber)
-{
- UNITY_UINT32 i;
-
- RETURN_IF_FAIL_OR_IGNORE;
-
- /* if both pointers not null compare the strings */
- if (expected && actual)
- {
- for (i = 0; expected[i] || actual[i]; i++)
- {
- if (expected[i] != actual[i])
- {
- Unity.CurrentTestFailed = 1;
- break;
- }
- }
- }
- else
- { /* handle case of one pointers being null (if both null, test should pass) */
- if (expected != actual)
- {
- Unity.CurrentTestFailed = 1;
- }
- }
-
- if (Unity.CurrentTestFailed)
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrintExpectedAndActualStrings(expected, actual);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
-}
-
-/*-----------------------------------------------*/
-void UnityAssertEqualStringLen(const char* expected,
- const char* actual,
- const UNITY_UINT32 length,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber)
-{
- UNITY_UINT32 i;
-
- RETURN_IF_FAIL_OR_IGNORE;
-
- /* if both pointers not null compare the strings */
- if (expected && actual)
- {
- for (i = 0; (i < length) && (expected[i] || actual[i]); i++)
- {
- if (expected[i] != actual[i])
- {
- Unity.CurrentTestFailed = 1;
- break;
- }
- }
- }
- else
- { /* handle case of one pointers being null (if both null, test should pass) */
- if (expected != actual)
- {
- Unity.CurrentTestFailed = 1;
- }
- }
-
- if (Unity.CurrentTestFailed)
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrintExpectedAndActualStringsLen(expected, actual, length);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
-}
-
-/*-----------------------------------------------*/
-void UnityAssertEqualStringArray(UNITY_INTERNAL_PTR expected,
- const char** actual,
- const UNITY_UINT32 num_elements,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_FLAGS_T flags)
-{
- UNITY_UINT32 i = 0;
- UNITY_UINT32 j = 0;
- const char* expd = NULL;
- const char* act = NULL;
-
- RETURN_IF_FAIL_OR_IGNORE;
-
- /* if no elements, it's an error */
- if (num_elements == 0)
- {
- UnityPrintPointlessAndBail();
- }
-
- if ((const void*)expected == (const void*)actual)
- {
- return; /* Both are NULL or same pointer */
- }
-
- if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg))
- {
- UNITY_FAIL_AND_BAIL;
- }
-
- if (flags != UNITY_ARRAY_TO_ARRAY)
- {
- expd = (const char*)expected;
- }
-
- do
- {
- act = actual[j];
- if (flags == UNITY_ARRAY_TO_ARRAY)
- {
- expd = ((const char* const*)expected)[j];
- }
-
- /* if both pointers not null compare the strings */
- if (expd && act)
- {
- for (i = 0; expd[i] || act[i]; i++)
- {
- if (expd[i] != act[i])
- {
- Unity.CurrentTestFailed = 1;
- break;
- }
- }
- }
- else
- { /* handle case of one pointers being null (if both null, test should pass) */
- if (expd != act)
- {
- Unity.CurrentTestFailed = 1;
- }
- }
-
- if (Unity.CurrentTestFailed)
- {
- UnityTestResultsFailBegin(lineNumber);
- if (num_elements > 1)
- {
- UnityPrint(UnityStrElement);
- UnityPrintNumberUnsigned(j);
- }
- UnityPrintExpectedAndActualStrings(expd, act);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
- } while (++j < num_elements);
-}
-
-/*-----------------------------------------------*/
-void UnityAssertEqualMemory(UNITY_INTERNAL_PTR expected,
- UNITY_INTERNAL_PTR actual,
- const UNITY_UINT32 length,
- const UNITY_UINT32 num_elements,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_FLAGS_T flags)
-{
- UNITY_PTR_ATTRIBUTE const unsigned char* ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected;
- UNITY_PTR_ATTRIBUTE const unsigned char* ptr_act = (UNITY_PTR_ATTRIBUTE const unsigned char*)actual;
- UNITY_UINT32 elements = num_elements;
- UNITY_UINT32 bytes;
-
- RETURN_IF_FAIL_OR_IGNORE;
-
- if ((elements == 0) || (length == 0))
- {
- UnityPrintPointlessAndBail();
- }
-
- if (expected == actual)
- {
- return; /* Both are NULL or same pointer */
- }
-
- if (UnityIsOneArrayNull(expected, actual, lineNumber, msg))
- {
- UNITY_FAIL_AND_BAIL;
- }
-
- while (elements--)
- {
- bytes = length;
- while (bytes--)
- {
- if (*ptr_exp != *ptr_act)
- {
- UnityTestResultsFailBegin(lineNumber);
- UnityPrint(UnityStrMemory);
- if (num_elements > 1)
- {
- UnityPrint(UnityStrElement);
- UnityPrintNumberUnsigned(num_elements - elements - 1);
- }
- UnityPrint(UnityStrByte);
- UnityPrintNumberUnsigned(length - bytes - 1);
- UnityPrint(UnityStrExpected);
- UnityPrintNumberByStyle(*ptr_exp, UNITY_DISPLAY_STYLE_HEX8);
- UnityPrint(UnityStrWas);
- UnityPrintNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8);
- UnityAddMsgIfSpecified(msg);
- UNITY_FAIL_AND_BAIL;
- }
- ptr_exp++;
- ptr_act++;
- }
- if (flags == UNITY_ARRAY_TO_VAL)
- {
- ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected;
- }
- }
-}
-
-/*-----------------------------------------------*/
-
-static union
-{
- UNITY_INT8 i8;
- UNITY_INT16 i16;
- UNITY_INT32 i32;
-#ifdef UNITY_SUPPORT_64
- UNITY_INT64 i64;
-#endif
-#ifndef UNITY_EXCLUDE_FLOAT
- float f;
-#endif
-#ifndef UNITY_EXCLUDE_DOUBLE
- double d;
-#endif
-} UnityQuickCompare;
-
-UNITY_INTERNAL_PTR UnityNumToPtr(const UNITY_INT num, const UNITY_UINT8 size)
-{
- switch(size)
- {
- case 1:
- UnityQuickCompare.i8 = (UNITY_INT8)num;
- return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i8);
-
- case 2:
- UnityQuickCompare.i16 = (UNITY_INT16)num;
- return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i16);
-
-#ifdef UNITY_SUPPORT_64
- case 8:
- UnityQuickCompare.i64 = (UNITY_INT64)num;
- return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i64);
-#endif
-
- default: /* 4 bytes */
- UnityQuickCompare.i32 = (UNITY_INT32)num;
- return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i32);
- }
-}
-
-#ifndef UNITY_EXCLUDE_FLOAT
-/*-----------------------------------------------*/
-UNITY_INTERNAL_PTR UnityFloatToPtr(const float num)
-{
- UnityQuickCompare.f = num;
- return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.f);
-}
-#endif
-
-#ifndef UNITY_EXCLUDE_DOUBLE
-/*-----------------------------------------------*/
-UNITY_INTERNAL_PTR UnityDoubleToPtr(const double num)
-{
- UnityQuickCompare.d = num;
- return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.d);
-}
-#endif
-
-/*-----------------------------------------------
- * Control Functions
- *-----------------------------------------------*/
-
-/*-----------------------------------------------*/
-void UnityFail(const char* msg, const UNITY_LINE_TYPE line)
-{
- RETURN_IF_FAIL_OR_IGNORE;
-
- UnityTestResultsBegin(Unity.TestFile, line);
- UnityPrint(UnityStrFail);
- if (msg != NULL)
- {
- UNITY_OUTPUT_CHAR(':');
-
-#ifndef UNITY_EXCLUDE_DETAILS
- if (Unity.CurrentDetail1)
- {
- UnityPrint(UnityStrDetail1Name);
- UnityPrint(Unity.CurrentDetail1);
- if (Unity.CurrentDetail2)
- {
- UnityPrint(UnityStrDetail2Name);
- UnityPrint(Unity.CurrentDetail2);
- }
- UnityPrint(UnityStrSpacer);
- }
-#endif
- if (msg[0] != ' ')
- {
- UNITY_OUTPUT_CHAR(' ');
- }
- UnityPrint(msg);
- }
-
- UNITY_FAIL_AND_BAIL;
-}
-
-/*-----------------------------------------------*/
-void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
-{
- RETURN_IF_FAIL_OR_IGNORE;
-
- UnityTestResultsBegin(Unity.TestFile, line);
- UnityPrint(UnityStrIgnore);
- if (msg != NULL)
- {
- UNITY_OUTPUT_CHAR(':');
- UNITY_OUTPUT_CHAR(' ');
- UnityPrint(msg);
- }
- UNITY_IGNORE_AND_BAIL;
-}
-
-/*-----------------------------------------------*/
-void UnityMessage(const char* msg, const UNITY_LINE_TYPE line)
-{
- UnityTestResultsBegin(Unity.TestFile, line);
- UnityPrint("INFO");
- if (msg != NULL)
- {
- UNITY_OUTPUT_CHAR(':');
- UNITY_OUTPUT_CHAR(' ');
- UnityPrint(msg);
- }
- UNITY_PRINT_EOL();
-}
-
-/*-----------------------------------------------*/
-void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum)
-{
- Unity.CurrentTestName = FuncName;
- Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)FuncLineNum;
- Unity.NumberOfTests++;
- UNITY_CLR_DETAILS();
- UNITY_EXEC_TIME_START();
- if (TEST_PROTECT())
- {
- setUp();
- Func();
- }
- if (TEST_PROTECT())
- {
- tearDown();
- }
- UNITY_EXEC_TIME_STOP();
- UnityConcludeTest();
-}
-
-/*-----------------------------------------------*/
-void UnitySetTestFile(const char* filename)
-{
- Unity.TestFile = filename;
-}
-
-/*-----------------------------------------------*/
-void UnityBegin(const char* filename)
-{
- Unity.TestFile = filename;
- Unity.CurrentTestName = NULL;
- Unity.CurrentTestLineNumber = 0;
- Unity.NumberOfTests = 0;
- Unity.TestFailures = 0;
- Unity.TestIgnores = 0;
- Unity.CurrentTestFailed = 0;
- Unity.CurrentTestIgnored = 0;
-
- UNITY_CLR_DETAILS();
- UNITY_OUTPUT_START();
-}
-
-/*-----------------------------------------------*/
-int UnityEnd(void)
-{
- UNITY_PRINT_EOL();
- UnityPrint(UnityStrBreaker);
- UNITY_PRINT_EOL();
- UnityPrintNumber((UNITY_INT)(Unity.NumberOfTests));
- UnityPrint(UnityStrResultsTests);
- UnityPrintNumber((UNITY_INT)(Unity.TestFailures));
- UnityPrint(UnityStrResultsFailures);
- UnityPrintNumber((UNITY_INT)(Unity.TestIgnores));
- UnityPrint(UnityStrResultsIgnored);
- UNITY_PRINT_EOL();
- if (Unity.TestFailures == 0U)
- {
- UnityPrint(UnityStrOk);
- }
- else
- {
- UnityPrint(UnityStrFail);
-#ifdef UNITY_DIFFERENTIATE_FINAL_FAIL
- UNITY_OUTPUT_CHAR('E'); UNITY_OUTPUT_CHAR('D');
-#endif
- }
- UNITY_PRINT_EOL();
- UNITY_FLUSH_CALL();
- UNITY_OUTPUT_COMPLETE();
- return (int)(Unity.TestFailures);
-}
-
-/*-----------------------------------------------
- * Command Line Argument Support
- *-----------------------------------------------*/
-#ifdef UNITY_USE_COMMAND_LINE_ARGS
-
-char* UnityOptionIncludeNamed = NULL;
-char* UnityOptionExcludeNamed = NULL;
-int UnityVerbosity = 1;
-
-/*-----------------------------------------------*/
-int UnityParseOptions(int argc, char** argv)
-{
- int i;
- UnityOptionIncludeNamed = NULL;
- UnityOptionExcludeNamed = NULL;
-
- for (i = 1; i < argc; i++)
- {
- if (argv[i][0] == '-')
- {
- switch (argv[i][1])
- {
- case 'l': /* list tests */
- return -1;
- case 'n': /* include tests with name including this string */
- case 'f': /* an alias for -n */
- if (argv[i][2] == '=')
- {
- UnityOptionIncludeNamed = &argv[i][3];
- }
- else if (++i < argc)
- {
- UnityOptionIncludeNamed = argv[i];
- }
- else
- {
- UnityPrint("ERROR: No Test String to Include Matches For");
- UNITY_PRINT_EOL();
- return 1;
- }
- break;
- case 'q': /* quiet */
- UnityVerbosity = 0;
- break;
- case 'v': /* verbose */
- UnityVerbosity = 2;
- break;
- case 'x': /* exclude tests with name including this string */
- if (argv[i][2] == '=')
- {
- UnityOptionExcludeNamed = &argv[i][3];
- }
- else if (++i < argc)
- {
- UnityOptionExcludeNamed = argv[i];
- }
- else
- {
- UnityPrint("ERROR: No Test String to Exclude Matches For");
- UNITY_PRINT_EOL();
- return 1;
- }
- break;
- default:
- UnityPrint("ERROR: Unknown Option ");
- UNITY_OUTPUT_CHAR(argv[i][1]);
- UNITY_PRINT_EOL();
- return 1;
- }
- }
- }
-
- return 0;
-}
-
-/*-----------------------------------------------*/
-int IsStringInBiggerString(const char* longstring, const char* shortstring)
-{
- const char* lptr = longstring;
- const char* sptr = shortstring;
- const char* lnext = lptr;
-
- if (*sptr == '*')
- {
- return 1;
- }
-
- while (*lptr)
- {
- lnext = lptr + 1;
-
- /* If they current bytes match, go on to the next bytes */
- while (*lptr && *sptr && (*lptr == *sptr))
- {
- lptr++;
- sptr++;
-
- /* We're done if we match the entire string or up to a wildcard */
- if (*sptr == '*')
- return 1;
- if (*sptr == ',')
- return 1;
- if (*sptr == '"')
- return 1;
- if (*sptr == '\'')
- return 1;
- if (*sptr == ':')
- return 2;
- if (*sptr == 0)
- return 1;
- }
-
- /* Otherwise we start in the long pointer 1 character further and try again */
- lptr = lnext;
- sptr = shortstring;
- }
-
- return 0;
-}
-
-/*-----------------------------------------------*/
-int UnityStringArgumentMatches(const char* str)
-{
- int retval;
- const char* ptr1;
- const char* ptr2;
- const char* ptrf;
-
- /* Go through the options and get the substrings for matching one at a time */
- ptr1 = str;
- while (ptr1[0] != 0)
- {
- if ((ptr1[0] == '"') || (ptr1[0] == '\''))
- {
- ptr1++;
- }
-
- /* look for the start of the next partial */
- ptr2 = ptr1;
- ptrf = 0;
- do
- {
- ptr2++;
- if ((ptr2[0] == ':') && (ptr2[1] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ','))
- {
- ptrf = &ptr2[1];
- }
- } while ((ptr2[0] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ','));
-
- while ((ptr2[0] != 0) && ((ptr2[0] == ':') || (ptr2[0] == '\'') || (ptr2[0] == '"') || (ptr2[0] == ',')))
- {
- ptr2++;
- }
-
- /* done if complete filename match */
- retval = IsStringInBiggerString(Unity.TestFile, ptr1);
- if (retval == 1)
- {
- return retval;
- }
-
- /* done if testname match after filename partial match */
- if ((retval == 2) && (ptrf != 0))
- {
- if (IsStringInBiggerString(Unity.CurrentTestName, ptrf))
- {
- return 1;
- }
- }
-
- /* done if complete testname match */
- if (IsStringInBiggerString(Unity.CurrentTestName, ptr1) == 1)
- {
- return 1;
- }
-
- ptr1 = ptr2;
- }
-
- /* we couldn't find a match for any substrings */
- return 0;
-}
-
-/*-----------------------------------------------*/
-int UnityTestMatches(void)
-{
- /* Check if this test name matches the included test pattern */
- int retval;
- if (UnityOptionIncludeNamed)
- {
- retval = UnityStringArgumentMatches(UnityOptionIncludeNamed);
- }
- else
- {
- retval = 1;
- }
-
- /* Check if this test name matches the excluded test pattern */
- if (UnityOptionExcludeNamed)
- {
- if (UnityStringArgumentMatches(UnityOptionExcludeNamed))
- {
- retval = 0;
- }
- }
-
- return retval;
-}
-
-#endif /* UNITY_USE_COMMAND_LINE_ARGS */
-/*-----------------------------------------------*/
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/src/unity.h b/tinyusb/test/vendor/ceedling/vendor/unity/src/unity.h
deleted file mode 100755
index 34d7f93a..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/src/unity.h
+++ /dev/null
@@ -1,617 +0,0 @@
-/* ==========================================
- Unity Project - A Test Framework for C
- Copyright (c) 2007-19 Mike Karlesky, Mark VanderVoord, Greg Williams
- [Released under MIT License. Please refer to license.txt for details]
-========================================== */
-
-#ifndef UNITY_FRAMEWORK_H
-#define UNITY_FRAMEWORK_H
-#define UNITY
-
-#define UNITY_VERSION_MAJOR 2
-#define UNITY_VERSION_MINOR 5
-#define UNITY_VERSION_BUILD 0
-#define UNITY_VERSION ((UNITY_VERSION_MAJOR << 16) | (UNITY_VERSION_MINOR << 8) | UNITY_VERSION_BUILD)
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#include "unity_internals.h"
-
-/*-------------------------------------------------------
- * Test Setup / Teardown
- *-------------------------------------------------------*/
-
-/* These functions are intended to be called before and after each test.
- * If using unity directly, these will need to be provided for each test
- * executable built. If you are using the test runner generator and/or
- * Ceedling, these are optional. */
-void setUp(void);
-void tearDown(void);
-
-/* These functions are intended to be called at the beginning and end of an
- * entire test suite. suiteTearDown() is passed the number of tests that
- * failed, and its return value becomes the exit code of main(). If using
- * Unity directly, you're in charge of calling these if they are desired.
- * If using Ceedling or the test runner generator, these will be called
- * automatically if they exist. */
-void suiteSetUp(void);
-int suiteTearDown(int num_failures);
-
-/*-------------------------------------------------------
- * Test Reset and Verify
- *-------------------------------------------------------*/
-
-/* These functions are intended to be called before during tests in order
- * to support complex test loops, etc. Both are NOT built into Unity. Instead
- * the test runner generator will create them. resetTest will run teardown and
- * setup again, verifying any end-of-test needs between. verifyTest will only
- * run the verification. */
-void resetTest(void);
-void verifyTest(void);
-
-/*-------------------------------------------------------
- * Configuration Options
- *-------------------------------------------------------
- * All options described below should be passed as a compiler flag to all files using Unity. If you must add #defines, place them BEFORE the #include above.
-
- * Integers/longs/pointers
- * - Unity attempts to automatically discover your integer sizes
- * - define UNITY_EXCLUDE_STDINT_H to stop attempting to look in <stdint.h>
- * - define UNITY_EXCLUDE_LIMITS_H to stop attempting to look in <limits.h>
- * - If you cannot use the automatic methods above, you can force Unity by using these options:
- * - define UNITY_SUPPORT_64
- * - set UNITY_INT_WIDTH
- * - set UNITY_LONG_WIDTH
- * - set UNITY_POINTER_WIDTH
-
- * Floats
- * - define UNITY_EXCLUDE_FLOAT to disallow floating point comparisons
- * - define UNITY_FLOAT_PRECISION to specify the precision to use when doing TEST_ASSERT_EQUAL_FLOAT
- * - define UNITY_FLOAT_TYPE to specify doubles instead of single precision floats
- * - define UNITY_INCLUDE_DOUBLE to allow double floating point comparisons
- * - define UNITY_EXCLUDE_DOUBLE to disallow double floating point comparisons (default)
- * - define UNITY_DOUBLE_PRECISION to specify the precision to use when doing TEST_ASSERT_EQUAL_DOUBLE
- * - define UNITY_DOUBLE_TYPE to specify something other than double
- * - define UNITY_EXCLUDE_FLOAT_PRINT to trim binary size, won't print floating point values in errors
-
- * Output
- * - by default, Unity prints to standard out with putchar. define UNITY_OUTPUT_CHAR(a) with a different function if desired
- * - define UNITY_DIFFERENTIATE_FINAL_FAIL to print FAILED (vs. FAIL) at test end summary - for automated search for failure
-
- * Optimization
- * - by default, line numbers are stored in unsigned shorts. Define UNITY_LINE_TYPE with a different type if your files are huge
- * - by default, test and failure counters are unsigned shorts. Define UNITY_COUNTER_TYPE with a different type if you want to save space or have more than 65535 Tests.
-
- * Test Cases
- * - define UNITY_SUPPORT_TEST_CASES to include the TEST_CASE macro, though really it's mostly about the runner generator script
-
- * Parameterized Tests
- * - you'll want to create a define of TEST_CASE(...) which basically evaluates to nothing
-
- * Tests with Arguments
- * - you'll want to define UNITY_USE_COMMAND_LINE_ARGS if you have the test runner passing arguments to Unity
-
- *-------------------------------------------------------
- * Basic Fail and Ignore
- *-------------------------------------------------------*/
-
-#define TEST_FAIL_MESSAGE(message) UNITY_TEST_FAIL(__LINE__, (message))
-#define TEST_FAIL() UNITY_TEST_FAIL(__LINE__, NULL)
-#define TEST_IGNORE_MESSAGE(message) UNITY_TEST_IGNORE(__LINE__, (message))
-#define TEST_IGNORE() UNITY_TEST_IGNORE(__LINE__, NULL)
-#define TEST_MESSAGE(message) UnityMessage((message), __LINE__)
-#define TEST_ONLY()
-
-/* It is not necessary for you to call PASS. A PASS condition is assumed if nothing fails.
- * This method allows you to abort a test immediately with a PASS state, ignoring the remainder of the test. */
-#define TEST_PASS() TEST_ABORT()
-#define TEST_PASS_MESSAGE(message) do { UnityMessage((message), __LINE__); TEST_ABORT(); } while(0)
-
-/* This macro does nothing, but it is useful for build tools (like Ceedling) to make use of this to figure out
- * which files should be linked to in order to perform a test. Use it like TEST_FILE("sandwiches.c") */
-#define TEST_FILE(a)
-
-/*-------------------------------------------------------
- * Test Asserts (simple)
- *-------------------------------------------------------*/
-
-/* Boolean */
-#define TEST_ASSERT(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expression Evaluated To FALSE")
-#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
-#define TEST_ASSERT_UNLESS(condition) UNITY_TEST_ASSERT( !(condition), __LINE__, " Expression Evaluated To TRUE")
-#define TEST_ASSERT_FALSE(condition) UNITY_TEST_ASSERT( !(condition), __LINE__, " Expected FALSE Was TRUE")
-#define TEST_ASSERT_NULL(pointer) UNITY_TEST_ASSERT_NULL( (pointer), __LINE__, " Expected NULL")
-#define TEST_ASSERT_NOT_NULL(pointer) UNITY_TEST_ASSERT_NOT_NULL((pointer), __LINE__, " Expected Non-NULL")
-
-/* Integers (of all sizes) */
-#define TEST_ASSERT_EQUAL_INT(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_INT8(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT8((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_INT16(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT16((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_INT32(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT32((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_INT64(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT64((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_UINT(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT( (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_UINT8(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT8( (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_UINT16(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT16( (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_UINT32(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT32( (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_UINT64(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT64( (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_size_t(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_HEX(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_HEX8(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX8( (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_HEX16(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX16((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_HEX32(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_HEX64(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX64((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_CHAR(expected, actual) UNITY_TEST_ASSERT_EQUAL_CHAR((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_BITS(mask, expected, actual) UNITY_TEST_ASSERT_BITS((mask), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_BITS_HIGH(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(-1), (actual), __LINE__, NULL)
-#define TEST_ASSERT_BITS_LOW(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(0), (actual), __LINE__, NULL)
-#define TEST_ASSERT_BIT_HIGH(bit, actual) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(-1), (actual), __LINE__, NULL)
-#define TEST_ASSERT_BIT_LOW(bit, actual) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(0), (actual), __LINE__, NULL)
-
-/* Integer Greater Than/ Less Than (of all sizes) */
-#define TEST_ASSERT_GREATER_THAN(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_INT(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_INT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT8((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_INT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT16((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_INT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT32((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_INT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT64((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_UINT(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_UINT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT8((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_UINT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT16((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_UINT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT32((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT64((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_size_t(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_HEX8(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX8((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX16((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX32((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX64((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_THAN_CHAR(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_CHAR((threshold), (actual), __LINE__, NULL)
-
-#define TEST_ASSERT_LESS_THAN(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_INT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_INT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT8((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_INT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT16((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_INT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT32((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_INT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT64((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_UINT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_UINT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT8((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_UINT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT16((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_UINT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT32((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_UINT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT64((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_size_t(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_HEX8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX8((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_HEX16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX16((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_HEX32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX32((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_HEX64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX64((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_THAN_CHAR(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_CHAR((threshold), (actual), __LINE__, NULL)
-
-#define TEST_ASSERT_GREATER_OR_EQUAL(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_INT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_INT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_INT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_UINT(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_UINT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_UINT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_UINT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_size_t(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_HEX8(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_GREATER_OR_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR((threshold), (actual), __LINE__, NULL)
-
-#define TEST_ASSERT_LESS_OR_EQUAL(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_INT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_INT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_INT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_INT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_UINT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_UINT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_UINT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_UINT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_UINT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_size_t(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_HEX8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, NULL)
-#define TEST_ASSERT_LESS_OR_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR((threshold), (actual), __LINE__, NULL)
-
-/* Integer Ranges (of all sizes) */
-#define TEST_ASSERT_INT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_INT8_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT8_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_INT16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT16_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_INT32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT32_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_INT64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT64_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_UINT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_UINT8_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT8_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_UINT16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT16_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_UINT32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT32_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_UINT64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT64_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_size_t_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_HEX_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_HEX8_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX8_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_HEX16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX16_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_HEX32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_HEX64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX64_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_CHAR_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_CHAR_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-
-/* Integer Array Ranges (of all sizes) */
-#define TEST_ASSERT_INT_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_INT8_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_INT16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_INT32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_UINT_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_UINT8_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_UINT16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_UINT32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_size_t_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_HEX_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_HEX8_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_HEX16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_HEX32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-#define TEST_ASSERT_CHAR_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL)
-
-
-/* Structs and Strings */
-#define TEST_ASSERT_EQUAL_PTR(expected, actual) UNITY_TEST_ASSERT_EQUAL_PTR((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_STRING(expected, actual) UNITY_TEST_ASSERT_EQUAL_STRING((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len) UNITY_TEST_ASSERT_EQUAL_STRING_LEN((expected), (actual), (len), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_MEMORY(expected, actual, len) UNITY_TEST_ASSERT_EQUAL_MEMORY((expected), (actual), (len), __LINE__, NULL)
-
-/* Arrays */
-#define TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_size_t_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_HEX_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements) UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((expected), (actual), (len), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_CHAR_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-
-/* Arrays Compared To Single Value */
-#define TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_INT8(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT8((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_INT16(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT16((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT32((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_INT64(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT64((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_UINT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_UINT8(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT8((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_UINT16(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT16((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_UINT32(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT32((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_UINT64(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT64((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_size_t(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_HEX(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_HEX8(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX8((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_HEX16(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX16((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_HEX32(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_HEX64(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX64((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_PTR(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_PTR((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_STRING(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_STRING((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_MEMORY(expected, actual, len, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY((expected), (actual), (len), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_CHAR(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_CHAR((expected), (actual), (num_elements), __LINE__, NULL)
-
-/* Floating Point (If Enabled) */
-#define TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_FLOAT_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_FLOAT(expected, actual) UNITY_TEST_ASSERT_EQUAL_FLOAT((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_FLOAT_IS_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_INF((actual), __LINE__, NULL)
-#define TEST_ASSERT_FLOAT_IS_NEG_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF((actual), __LINE__, NULL)
-#define TEST_ASSERT_FLOAT_IS_NAN(actual) UNITY_TEST_ASSERT_FLOAT_IS_NAN((actual), __LINE__, NULL)
-#define TEST_ASSERT_FLOAT_IS_DETERMINATE(actual) UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE((actual), __LINE__, NULL)
-#define TEST_ASSERT_FLOAT_IS_NOT_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF((actual), __LINE__, NULL)
-#define TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF((actual), __LINE__, NULL)
-#define TEST_ASSERT_FLOAT_IS_NOT_NAN(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN((actual), __LINE__, NULL)
-#define TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE((actual), __LINE__, NULL)
-
-/* Double (If Enabled) */
-#define TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_DOUBLE_WITHIN((delta), (expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_DOUBLE(expected, actual) UNITY_TEST_ASSERT_EQUAL_DOUBLE((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE((expected), (actual), (num_elements), __LINE__, NULL)
-#define TEST_ASSERT_DOUBLE_IS_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_INF((actual), __LINE__, NULL)
-#define TEST_ASSERT_DOUBLE_IS_NEG_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF((actual), __LINE__, NULL)
-#define TEST_ASSERT_DOUBLE_IS_NAN(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NAN((actual), __LINE__, NULL)
-#define TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual) UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE((actual), __LINE__, NULL)
-#define TEST_ASSERT_DOUBLE_IS_NOT_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF((actual), __LINE__, NULL)
-#define TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF((actual), __LINE__, NULL)
-#define TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN((actual), __LINE__, NULL)
-#define TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE((actual), __LINE__, NULL)
-
-/* Shorthand */
-#ifdef UNITY_SHORTHAND_AS_OLD
-#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, " Expected Not-Equal")
-#endif
-#ifdef UNITY_SHORTHAND_AS_INT
-#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, NULL)
-#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand)
-#endif
-#ifdef UNITY_SHORTHAND_AS_MEM
-#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT_EQUAL_MEMORY((&expected), (&actual), sizeof(expected), __LINE__, NULL)
-#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand)
-#endif
-#ifdef UNITY_SHORTHAND_AS_RAW
-#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT(((expected) == (actual)), __LINE__, " Expected Equal")
-#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, " Expected Not-Equal")
-#endif
-#ifdef UNITY_SHORTHAND_AS_NONE
-#define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand)
-#define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand)
-#endif
-
-/*-------------------------------------------------------
- * Test Asserts (with additional messages)
- *-------------------------------------------------------*/
-
-/* Boolean */
-#define TEST_ASSERT_MESSAGE(condition, message) UNITY_TEST_ASSERT( (condition), __LINE__, (message))
-#define TEST_ASSERT_TRUE_MESSAGE(condition, message) UNITY_TEST_ASSERT( (condition), __LINE__, (message))
-#define TEST_ASSERT_UNLESS_MESSAGE(condition, message) UNITY_TEST_ASSERT( !(condition), __LINE__, (message))
-#define TEST_ASSERT_FALSE_MESSAGE(condition, message) UNITY_TEST_ASSERT( !(condition), __LINE__, (message))
-#define TEST_ASSERT_NULL_MESSAGE(pointer, message) UNITY_TEST_ASSERT_NULL( (pointer), __LINE__, (message))
-#define TEST_ASSERT_NOT_NULL_MESSAGE(pointer, message) UNITY_TEST_ASSERT_NOT_NULL((pointer), __LINE__, (message))
-
-/* Integers (of all sizes) */
-#define TEST_ASSERT_EQUAL_INT_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_INT8_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT8((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_INT16_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT16((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_INT32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT32((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_INT64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT64((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_UINT_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT( (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_UINT8_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT8( (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_UINT16_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT16( (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_UINT32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT32( (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_UINT64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT64( (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_size_t_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT( (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_HEX_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_HEX8_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX8( (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_HEX16_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX16((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_HEX32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_HEX64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX64((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_BITS_MESSAGE(mask, expected, actual, message) UNITY_TEST_ASSERT_BITS((mask), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_BITS_HIGH_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(-1), (actual), __LINE__, (message))
-#define TEST_ASSERT_BITS_LOW_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(0), (actual), __LINE__, (message))
-#define TEST_ASSERT_BIT_HIGH_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(-1), (actual), __LINE__, (message))
-#define TEST_ASSERT_BIT_LOW_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(0), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_CHAR_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_CHAR((expected), (actual), __LINE__, (message))
-
-/* Integer Greater Than/ Less Than (of all sizes) */
-#define TEST_ASSERT_GREATER_THAN_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT8((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT16((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT32((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT64((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT8((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT16((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT32((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT64((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX8((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX16((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX32((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX64((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_THAN_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_CHAR((threshold), (actual), __LINE__, (message))
-
-#define TEST_ASSERT_LESS_THAN_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT8((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT16((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT32((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT64((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT8((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT16((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT32((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT64((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX8((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX16((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX32((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX64((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_THAN_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_CHAR((threshold), (actual), __LINE__, (message))
-
-#define TEST_ASSERT_GREATER_OR_EQUAL_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_GREATER_OR_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR((threshold), (actual), __LINE__, (message))
-
-#define TEST_ASSERT_LESS_OR_EQUAL_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_size_t_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, (message))
-#define TEST_ASSERT_LESS_OR_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR((threshold), (actual), __LINE__, (message))
-
-/* Integer Ranges (of all sizes) */
-#define TEST_ASSERT_INT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_INT8_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT8_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_INT16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT16_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_INT32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT32_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_INT64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT64_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_UINT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_UINT8_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT8_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_UINT16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT16_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_UINT32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT32_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_UINT64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT64_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_size_t_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_HEX_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_HEX8_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX8_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_HEX16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX16_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_HEX32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_HEX64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX64_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_CHAR_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_CHAR_WITHIN((delta), (expected), (actual), __LINE__, (message))
-
-/* Integer Array Ranges (of all sizes) */
-#define TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_INT32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_UINT32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_size_t_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_HEX_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-#define TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message))
-
-
-/* Structs and Strings */
-#define TEST_ASSERT_EQUAL_PTR_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_PTR((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_STRING((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_STRING_LEN_MESSAGE(expected, actual, len, message) UNITY_TEST_ASSERT_EQUAL_STRING_LEN((expected), (actual), (len), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_MEMORY_MESSAGE(expected, actual, len, message) UNITY_TEST_ASSERT_EQUAL_MEMORY((expected), (actual), (len), __LINE__, (message))
-
-/* Arrays */
-#define TEST_ASSERT_EQUAL_INT_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_INT8_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_INT16_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_INT32_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_INT64_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_UINT_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_UINT16_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_UINT32_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_UINT64_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_size_t_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_HEX_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_HEX8_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_HEX16_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_HEX32_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_HEX64_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_PTR_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_STRING_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_MEMORY_ARRAY_MESSAGE(expected, actual, len, num_elements, message) UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((expected), (actual), (len), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_CHAR_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-
-/* Arrays Compared To Single Value*/
-#define TEST_ASSERT_EACH_EQUAL_INT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_INT8_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT8((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_INT16_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT16((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_INT32_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT32((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_INT64_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT64((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_UINT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_UINT8_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT8((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_UINT16_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT16((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_UINT32_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT32((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_UINT64_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT64((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_size_t_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_HEX_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_HEX8_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX8((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_HEX16_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX16((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_HEX32_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_HEX64_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX64((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_PTR_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_PTR((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_STRING_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_STRING((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_MEMORY_MESSAGE(expected, actual, len, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY((expected), (actual), (len), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_CHAR_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_CHAR((expected), (actual), (num_elements), __LINE__, (message))
-
-/* Floating Point (If Enabled) */
-#define TEST_ASSERT_FLOAT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_FLOAT_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_FLOAT_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_FLOAT((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_FLOAT_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_FLOAT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_FLOAT_IS_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_INF((actual), __LINE__, (message))
-#define TEST_ASSERT_FLOAT_IS_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF((actual), __LINE__, (message))
-#define TEST_ASSERT_FLOAT_IS_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NAN((actual), __LINE__, (message))
-#define TEST_ASSERT_FLOAT_IS_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE((actual), __LINE__, (message))
-#define TEST_ASSERT_FLOAT_IS_NOT_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF((actual), __LINE__, (message))
-#define TEST_ASSERT_FLOAT_IS_NOT_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF((actual), __LINE__, (message))
-#define TEST_ASSERT_FLOAT_IS_NOT_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN((actual), __LINE__, (message))
-#define TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE((actual), __LINE__, (message))
-
-/* Double (If Enabled) */
-#define TEST_ASSERT_DOUBLE_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_DOUBLE_WITHIN((delta), (expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_DOUBLE_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_DOUBLE((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_EQUAL_DOUBLE_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_EACH_EQUAL_DOUBLE_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE((expected), (actual), (num_elements), __LINE__, (message))
-#define TEST_ASSERT_DOUBLE_IS_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_INF((actual), __LINE__, (message))
-#define TEST_ASSERT_DOUBLE_IS_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF((actual), __LINE__, (message))
-#define TEST_ASSERT_DOUBLE_IS_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NAN((actual), __LINE__, (message))
-#define TEST_ASSERT_DOUBLE_IS_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE((actual), __LINE__, (message))
-#define TEST_ASSERT_DOUBLE_IS_NOT_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF((actual), __LINE__, (message))
-#define TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF((actual), __LINE__, (message))
-#define TEST_ASSERT_DOUBLE_IS_NOT_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN((actual), __LINE__, (message))
-#define TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE((actual), __LINE__, (message))
-
-/* Shorthand */
-#ifdef UNITY_SHORTHAND_AS_OLD
-#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, (message))
-#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, (message))
-#endif
-#ifdef UNITY_SHORTHAND_AS_INT
-#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, message)
-#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand)
-#endif
-#ifdef UNITY_SHORTHAND_AS_MEM
-#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_MEMORY((&expected), (&actual), sizeof(expected), __LINE__, message)
-#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand)
-#endif
-#ifdef UNITY_SHORTHAND_AS_RAW
-#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT(((expected) == (actual)), __LINE__, message)
-#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, message)
-#endif
-#ifdef UNITY_SHORTHAND_AS_NONE
-#define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand)
-#define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_FAIL(__LINE__, UnityStrErrShorthand)
-#endif
-
-/* end of UNITY_FRAMEWORK_H */
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/tinyusb/test/vendor/ceedling/vendor/unity/src/unity_internals.h b/tinyusb/test/vendor/ceedling/vendor/unity/src/unity_internals.h
deleted file mode 100755
index a9a7ea23..00000000
--- a/tinyusb/test/vendor/ceedling/vendor/unity/src/unity_internals.h
+++ /dev/null
@@ -1,1002 +0,0 @@
-/* ==========================================
- Unity Project - A Test Framework for C
- Copyright (c) 2007-19 Mike Karlesky, Mark VanderVoord, Greg Williams
- [Released under MIT License. Please refer to license.txt for details]
-========================================== */
-
-#ifndef UNITY_INTERNALS_H
-#define UNITY_INTERNALS_H
-
-#ifdef UNITY_INCLUDE_CONFIG_H
-#include "unity_config.h"
-#endif
-
-#ifndef UNITY_EXCLUDE_SETJMP_H
-#include <setjmp.h>
-#endif
-
-#ifndef UNITY_EXCLUDE_MATH_H
-#include <math.h>
-#endif
-
-#ifndef UNITY_EXCLUDE_STDDEF_H
-#include <stddef.h>
-#endif
-
-#ifdef UNITY_INCLUDE_PRINT_FORMATTED
-#include <stdarg.h>
-#endif
-
-/* Unity Attempts to Auto-Detect Integer Types
- * Attempt 1: UINT_MAX, ULONG_MAX in <limits.h>, or default to 32 bits
- * Attempt 2: UINTPTR_MAX in <stdint.h>, or default to same size as long
- * The user may override any of these derived constants:
- * UNITY_INT_WIDTH, UNITY_LONG_WIDTH, UNITY_POINTER_WIDTH */
-#ifndef UNITY_EXCLUDE_STDINT_H
-#include <stdint.h>
-#endif
-
-#ifndef UNITY_EXCLUDE_LIMITS_H
-#include <limits.h>
-#endif
-
-/*-------------------------------------------------------
- * Guess Widths If Not Specified
- *-------------------------------------------------------*/
-
-/* Determine the size of an int, if not already specified.
- * We cannot use sizeof(int), because it is not yet defined
- * at this stage in the translation of the C program.
- * Also sizeof(int) does return the size in addressable units on all platforms,
- * which may not necessarily be the size in bytes.
- * Therefore, infer it from UINT_MAX if possible. */
-#ifndef UNITY_INT_WIDTH
- #ifdef UINT_MAX
- #if (UINT_MAX == 0xFFFF)
- #define UNITY_INT_WIDTH (16)
- #elif (UINT_MAX == 0xFFFFFFFF)
- #define UNITY_INT_WIDTH (32)
- #elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF)
- #define UNITY_INT_WIDTH (64)
- #endif
- #else /* Set to default */
- #define UNITY_INT_WIDTH (32)
- #endif /* UINT_MAX */
-#endif
-
-/* Determine the size of a long, if not already specified. */
-#ifndef UNITY_LONG_WIDTH
- #ifdef ULONG_MAX
- #if (ULONG_MAX == 0xFFFF)
- #define UNITY_LONG_WIDTH (16)
- #elif (ULONG_MAX == 0xFFFFFFFF)
- #define UNITY_LONG_WIDTH (32)
- #elif (ULONG_MAX == 0xFFFFFFFFFFFFFFFF)
- #define UNITY_LONG_WIDTH (64)
- #endif
- #else /* Set to default */
- #define UNITY_LONG_WIDTH (32)
- #endif /* ULONG_MAX */
-#endif
-
-/* Determine the size of a pointer, if not already specified. */
-#ifndef UNITY_POINTER_WIDTH
- #ifdef UINTPTR_MAX
- #if (UINTPTR_MAX <= 0xFFFF)
- #define UNITY_POINTER_WIDTH (16)
- #elif (UINTPTR_MAX <= 0xFFFFFFFF)
- #define UNITY_POINTER_WIDTH (32)
- #elif (UINTPTR_MAX <= 0xFFFFFFFFFFFFFFFF)
- #define UNITY_POINTER_WIDTH (64)
- #endif
- #else /* Set to default */
- #define UNITY_POINTER_WIDTH UNITY_LONG_WIDTH
- #endif /* UINTPTR_MAX */
-#endif
-
-/*-------------------------------------------------------
- * Int Support (Define types based on detected sizes)
- *-------------------------------------------------------*/
-
-#if (UNITY_INT_WIDTH == 32)
- typedef unsigned char UNITY_UINT8;
- typedef unsigned short UNITY_UINT16;
- typedef unsigned int UNITY_UINT32;
- typedef signed char UNITY_INT8;
- typedef signed short UNITY_INT16;
- typedef signed int UNITY_INT32;
-#elif (UNITY_INT_WIDTH == 16)
- typedef unsigned char UNITY_UINT8;
- typedef unsigned int UNITY_UINT16;
- typedef unsigned long UNITY_UINT32;
- typedef signed char UNITY_INT8;
- typedef signed int UNITY_INT16;
- typedef signed long UNITY_INT32;
-#else
- #error Invalid UNITY_INT_WIDTH specified! (16 or 32 are supported)
-#endif
-
-/*-------------------------------------------------------
- * 64-bit Support
- *-------------------------------------------------------*/
-
-/* Auto-detect 64 Bit Support */
-#ifndef UNITY_SUPPORT_64
- #if UNITY_LONG_WIDTH == 64 || UNITY_POINTER_WIDTH == 64
- #define UNITY_SUPPORT_64
- #endif
-#endif
-
-/* 64-Bit Support Dependent Configuration */
-#ifndef UNITY_SUPPORT_64
- /* No 64-bit Support */
- typedef UNITY_UINT32 UNITY_UINT;
- typedef UNITY_INT32 UNITY_INT;
- #define UNITY_MAX_NIBBLES (8) /* Maximum number of nibbles in a UNITY_(U)INT */
-#else
- /* 64-bit Support */
- #if (UNITY_LONG_WIDTH == 32)
- typedef unsigned long long UNITY_UINT64;
- typedef signed long long UNITY_INT64;
- #elif (UNITY_LONG_WIDTH == 64)
- typedef unsigned long UNITY_UINT64;
- typedef signed long UNITY_INT64;
- #else
- #error Invalid UNITY_LONG_WIDTH specified! (32 or 64 are supported)
- #endif
- typedef UNITY_UINT64 UNITY_UINT;
- typedef UNITY_INT64 UNITY_INT;
- #define UNITY_MAX_NIBBLES (16) /* Maximum number of nibbles in a UNITY_(U)INT */
-#endif
-
-/*-------------------------------------------------------
- * Pointer Support
- *-------------------------------------------------------*/
-
-#if (UNITY_POINTER_WIDTH == 32)
- #define UNITY_PTR_TO_INT UNITY_INT32
- #define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX32
-#elif (UNITY_POINTER_WIDTH == 64)
- #define UNITY_PTR_TO_INT UNITY_INT64
- #define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX64
-#elif (UNITY_POINTER_WIDTH == 16)
- #define UNITY_PTR_TO_INT UNITY_INT16
- #define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX16
-#else
- #error Invalid UNITY_POINTER_WIDTH specified! (16, 32 or 64 are supported)
-#endif
-
-#ifndef UNITY_PTR_ATTRIBUTE
- #define UNITY_PTR_ATTRIBUTE
-#endif
-
-#ifndef UNITY_INTERNAL_PTR
- #define UNITY_INTERNAL_PTR UNITY_PTR_ATTRIBUTE const void*
-#endif
-
-/*-------------------------------------------------------
- * Float Support
- *-------------------------------------------------------*/
-
-#ifdef UNITY_EXCLUDE_FLOAT
-
-/* No Floating Point Support */
-#ifndef UNITY_EXCLUDE_DOUBLE
-#define UNITY_EXCLUDE_DOUBLE /* Remove double when excluding float support */
-#endif
-#ifndef UNITY_EXCLUDE_FLOAT_PRINT
-#define UNITY_EXCLUDE_FLOAT_PRINT
-#endif
-
-#else
-
-/* Floating Point Support */
-#ifndef UNITY_FLOAT_PRECISION
-#define UNITY_FLOAT_PRECISION (0.00001f)
-#endif
-#ifndef UNITY_FLOAT_TYPE
-#define UNITY_FLOAT_TYPE float
-#endif
-typedef UNITY_FLOAT_TYPE UNITY_FLOAT;
-
-/* isinf & isnan macros should be provided by math.h */
-#ifndef isinf
-/* The value of Inf - Inf is NaN */
-#define isinf(n) (isnan((n) - (n)) && !isnan(n))
-#endif
-
-#ifndef isnan
-/* NaN is the only floating point value that does NOT equal itself.
- * Therefore if n != n, then it is NaN. */
-#define isnan(n) ((n != n) ? 1 : 0)
-#endif
-
-#endif
-
-/*-------------------------------------------------------
- * Double Float Support
- *-------------------------------------------------------*/
-
-/* unlike float, we DON'T include by default */
-#if defined(UNITY_EXCLUDE_DOUBLE) || !defined(UNITY_INCLUDE_DOUBLE)
-
- /* No Floating Point Support */
- #ifndef UNITY_EXCLUDE_DOUBLE
- #define UNITY_EXCLUDE_DOUBLE
- #else
- #undef UNITY_INCLUDE_DOUBLE
- #endif
-
- #ifndef UNITY_EXCLUDE_FLOAT
- #ifndef UNITY_DOUBLE_TYPE
- #define UNITY_DOUBLE_TYPE double
- #endif
- typedef UNITY_FLOAT UNITY_DOUBLE;
- /* For parameter in UnityPrintFloat(UNITY_DOUBLE), which aliases to double or float */
- #endif
-
-#else
-
- /* Double Floating Point Support */
- #ifndef UNITY_DOUBLE_PRECISION
- #define UNITY_DOUBLE_PRECISION (1e-12)
- #endif
-
- #ifndef UNITY_DOUBLE_TYPE
- #define UNITY_DOUBLE_TYPE double
- #endif
- typedef UNITY_DOUBLE_TYPE UNITY_DOUBLE;
-
-#endif
-
-/*-------------------------------------------------------
- * Output Method: stdout (DEFAULT)
- *-------------------------------------------------------*/
-#ifndef UNITY_OUTPUT_CHAR
- /* Default to using putchar, which is defined in stdio.h */
- #include <stdio.h>
- #define UNITY_OUTPUT_CHAR(a) (void)putchar(a)
-#else
- /* If defined as something else, make sure we declare it here so it's ready for use */
- #ifdef UNITY_OUTPUT_CHAR_HEADER_DECLARATION
- extern void UNITY_OUTPUT_CHAR_HEADER_DECLARATION;
- #endif
-#endif
-
-#ifndef UNITY_OUTPUT_FLUSH
- #ifdef UNITY_USE_FLUSH_STDOUT
- /* We want to use the stdout flush utility */
- #include <stdio.h>
- #define UNITY_OUTPUT_FLUSH() (void)fflush(stdout)
- #else
- /* We've specified nothing, therefore flush should just be ignored */
- #define UNITY_OUTPUT_FLUSH()
- #endif
-#else
- /* If defined as something else, make sure we declare it here so it's ready for use */
- #ifdef UNITY_OUTPUT_FLUSH_HEADER_DECLARATION
- extern void UNITY_OUTPUT_FLUSH_HEADER_DECLARATION;
- #endif
-#endif
-
-#ifndef UNITY_OUTPUT_FLUSH
-#define UNITY_FLUSH_CALL()
-#else
-#define UNITY_FLUSH_CALL() UNITY_OUTPUT_FLUSH()
-#endif
-
-#ifndef UNITY_PRINT_EOL
-#define UNITY_PRINT_EOL() UNITY_OUTPUT_CHAR('\n')
-#endif
-
-#ifndef UNITY_OUTPUT_START
-#define UNITY_OUTPUT_START()
-#endif
-
-#ifndef UNITY_OUTPUT_COMPLETE
-#define UNITY_OUTPUT_COMPLETE()
-#endif
-
-#ifdef UNITY_INCLUDE_EXEC_TIME
- #if !defined(UNITY_EXEC_TIME_START) && \
- !defined(UNITY_EXEC_TIME_STOP) && \
- !defined(UNITY_PRINT_EXEC_TIME) && \
- !defined(UNITY_TIME_TYPE)
- /* If none any of these macros are defined then try to provide a default implementation */
-
- #if defined(UNITY_CLOCK_MS)
- /* This is a simple way to get a default implementation on platforms that support getting a millisecond counter */
- #define UNITY_TIME_TYPE UNITY_UINT
- #define UNITY_EXEC_TIME_START() Unity.CurrentTestStartTime = UNITY_CLOCK_MS()
- #define UNITY_EXEC_TIME_STOP() Unity.CurrentTestStopTime = UNITY_CLOCK_MS()
- #define UNITY_PRINT_EXEC_TIME() { \
- UNITY_UINT execTimeMs = (Unity.CurrentTestStopTime - Unity.CurrentTestStartTime); \
- UnityPrint(" ("); \
- UnityPrintNumberUnsigned(execTimeMs); \
- UnityPrint(" ms)"); \
- }
- #elif defined(_WIN32)
- #include <time.h>
- #define UNITY_TIME_TYPE clock_t
- #define UNITY_GET_TIME(t) t = (clock_t)((clock() * 1000) / CLOCKS_PER_SEC)
- #define UNITY_EXEC_TIME_START() UNITY_GET_TIME(Unity.CurrentTestStartTime)
- #define UNITY_EXEC_TIME_STOP() UNITY_GET_TIME(Unity.CurrentTestStopTime)
- #define UNITY_PRINT_EXEC_TIME() { \
- UNITY_UINT execTimeMs = (Unity.CurrentTestStopTime - Unity.CurrentTestStartTime); \
- UnityPrint(" ("); \
- UnityPrintNumberUnsigned(execTimeMs); \
- UnityPrint(" ms)"); \
- }
- #elif defined(__unix__)
- #include <time.h>
- #define UNITY_TIME_TYPE struct timespec
- #define UNITY_GET_TIME(t) clock_gettime(CLOCK_MONOTONIC, &t)
- #define UNITY_EXEC_TIME_START() UNITY_GET_TIME(Unity.CurrentTestStartTime)
- #define UNITY_EXEC_TIME_STOP() UNITY_GET_TIME(Unity.CurrentTestStopTime)
- #define UNITY_PRINT_EXEC_TIME() { \
- UNITY_UINT execTimeMs = ((Unity.CurrentTestStopTime.tv_sec - Unity.CurrentTestStartTime.tv_sec) * 1000L); \
- execTimeMs += ((Unity.CurrentTestStopTime.tv_nsec - Unity.CurrentTestStartTime.tv_nsec) / 1000000L); \
- UnityPrint(" ("); \
- UnityPrintNumberUnsigned(execTimeMs); \
- UnityPrint(" ms)"); \
- }
- #endif
- #endif
-#endif
-
-#ifndef UNITY_EXEC_TIME_START
-#define UNITY_EXEC_TIME_START() do{}while(0)
-#endif
-
-#ifndef UNITY_EXEC_TIME_STOP
-#define UNITY_EXEC_TIME_STOP() do{}while(0)
-#endif
-
-#ifndef UNITY_TIME_TYPE
-#define UNITY_TIME_TYPE UNITY_UINT
-#endif
-
-#ifndef UNITY_PRINT_EXEC_TIME
-#define UNITY_PRINT_EXEC_TIME() do{}while(0)
-#endif
-
-/*-------------------------------------------------------
- * Footprint
- *-------------------------------------------------------*/
-
-#ifndef UNITY_LINE_TYPE
-#define UNITY_LINE_TYPE UNITY_UINT
-#endif
-
-#ifndef UNITY_COUNTER_TYPE
-#define UNITY_COUNTER_TYPE UNITY_UINT
-#endif
-
-/*-------------------------------------------------------
- * Internal Structs Needed
- *-------------------------------------------------------*/
-
-typedef void (*UnityTestFunction)(void);
-
-#define UNITY_DISPLAY_RANGE_INT (0x10)
-#define UNITY_DISPLAY_RANGE_UINT (0x20)
-#define UNITY_DISPLAY_RANGE_HEX (0x40)
-#define UNITY_DISPLAY_RANGE_CHAR (0x80)
-
-typedef enum
-{
- UNITY_DISPLAY_STYLE_INT = (UNITY_INT_WIDTH / 8) + UNITY_DISPLAY_RANGE_INT,
- UNITY_DISPLAY_STYLE_INT8 = 1 + UNITY_DISPLAY_RANGE_INT,
- UNITY_DISPLAY_STYLE_INT16 = 2 + UNITY_DISPLAY_RANGE_INT,
- UNITY_DISPLAY_STYLE_INT32 = 4 + UNITY_DISPLAY_RANGE_INT,
-#ifdef UNITY_SUPPORT_64
- UNITY_DISPLAY_STYLE_INT64 = 8 + UNITY_DISPLAY_RANGE_INT,
-#endif
-
- UNITY_DISPLAY_STYLE_UINT = (UNITY_INT_WIDTH / 8) + UNITY_DISPLAY_RANGE_UINT,
- UNITY_DISPLAY_STYLE_UINT8 = 1 + UNITY_DISPLAY_RANGE_UINT,
- UNITY_DISPLAY_STYLE_UINT16 = 2 + UNITY_DISPLAY_RANGE_UINT,
- UNITY_DISPLAY_STYLE_UINT32 = 4 + UNITY_DISPLAY_RANGE_UINT,
-#ifdef UNITY_SUPPORT_64
- UNITY_DISPLAY_STYLE_UINT64 = 8 + UNITY_DISPLAY_RANGE_UINT,
-#endif
-
- UNITY_DISPLAY_STYLE_HEX8 = 1 + UNITY_DISPLAY_RANGE_HEX,
- UNITY_DISPLAY_STYLE_HEX16 = 2 + UNITY_DISPLAY_RANGE_HEX,
- UNITY_DISPLAY_STYLE_HEX32 = 4 + UNITY_DISPLAY_RANGE_HEX,
-#ifdef UNITY_SUPPORT_64
- UNITY_DISPLAY_STYLE_HEX64 = 8 + UNITY_DISPLAY_RANGE_HEX,
-#endif
-
- UNITY_DISPLAY_STYLE_CHAR = 1 + UNITY_DISPLAY_RANGE_CHAR + UNITY_DISPLAY_RANGE_INT,
-
- UNITY_DISPLAY_STYLE_UNKNOWN
-} UNITY_DISPLAY_STYLE_T;
-
-typedef enum
-{
- UNITY_WITHIN = 0x0,
- UNITY_EQUAL_TO = 0x1,
- UNITY_GREATER_THAN = 0x2,
- UNITY_GREATER_OR_EQUAL = 0x2 + UNITY_EQUAL_TO,
- UNITY_SMALLER_THAN = 0x4,
- UNITY_SMALLER_OR_EQUAL = 0x4 + UNITY_EQUAL_TO,
- UNITY_UNKNOWN
-} UNITY_COMPARISON_T;
-
-#ifndef UNITY_EXCLUDE_FLOAT
-typedef enum UNITY_FLOAT_TRAIT
-{
- UNITY_FLOAT_IS_NOT_INF = 0,
- UNITY_FLOAT_IS_INF,
- UNITY_FLOAT_IS_NOT_NEG_INF,
- UNITY_FLOAT_IS_NEG_INF,
- UNITY_FLOAT_IS_NOT_NAN,
- UNITY_FLOAT_IS_NAN,
- UNITY_FLOAT_IS_NOT_DET,
- UNITY_FLOAT_IS_DET,
- UNITY_FLOAT_INVALID_TRAIT
-} UNITY_FLOAT_TRAIT_T;
-#endif
-
-typedef enum
-{
- UNITY_ARRAY_TO_VAL = 0,
- UNITY_ARRAY_TO_ARRAY,
- UNITY_ARRAY_UNKNOWN
-} UNITY_FLAGS_T;
-
-struct UNITY_STORAGE_T
-{
- const char* TestFile;
- const char* CurrentTestName;
-#ifndef UNITY_EXCLUDE_DETAILS
- const char* CurrentDetail1;
- const char* CurrentDetail2;
-#endif
- UNITY_LINE_TYPE CurrentTestLineNumber;
- UNITY_COUNTER_TYPE NumberOfTests;
- UNITY_COUNTER_TYPE TestFailures;
- UNITY_COUNTER_TYPE TestIgnores;
- UNITY_COUNTER_TYPE CurrentTestFailed;
- UNITY_COUNTER_TYPE CurrentTestIgnored;
-#ifdef UNITY_INCLUDE_EXEC_TIME
- UNITY_TIME_TYPE CurrentTestStartTime;
- UNITY_TIME_TYPE CurrentTestStopTime;
-#endif
-#ifndef UNITY_EXCLUDE_SETJMP_H
- jmp_buf AbortFrame;
-#endif
-};
-
-extern struct UNITY_STORAGE_T Unity;
-
-/*-------------------------------------------------------
- * Test Suite Management
- *-------------------------------------------------------*/
-
-void UnityBegin(const char* filename);
-int UnityEnd(void);
-void UnitySetTestFile(const char* filename);
-void UnityConcludeTest(void);
-void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum);
-
-/*-------------------------------------------------------
- * Details Support
- *-------------------------------------------------------*/
-
-#ifdef UNITY_EXCLUDE_DETAILS
-#define UNITY_CLR_DETAILS()
-#define UNITY_SET_DETAIL(d1)
-#define UNITY_SET_DETAILS(d1,d2)
-#else
-#define UNITY_CLR_DETAILS() { Unity.CurrentDetail1 = 0; Unity.CurrentDetail2 = 0; }
-#define UNITY_SET_DETAIL(d1) { Unity.CurrentDetail1 = (d1); Unity.CurrentDetail2 = 0; }
-#define UNITY_SET_DETAILS(d1,d2) { Unity.CurrentDetail1 = (d1); Unity.CurrentDetail2 = (d2); }
-
-#ifndef UNITY_DETAIL1_NAME
-#define UNITY_DETAIL1_NAME "Function"
-#endif
-
-#ifndef UNITY_DETAIL2_NAME
-#define UNITY_DETAIL2_NAME "Argument"
-#endif
-#endif
-
-/*-------------------------------------------------------
- * Test Output
- *-------------------------------------------------------*/
-
-void UnityPrint(const char* string);
-
-#ifdef UNITY_INCLUDE_PRINT_FORMATTED
-void UnityPrintFormatted(const char* format, ...);
-#endif
-
-void UnityPrintLen(const char* string, const UNITY_UINT32 length);
-void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number);
-void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style);
-void UnityPrintNumber(const UNITY_INT number_to_print);
-void UnityPrintNumberUnsigned(const UNITY_UINT number);
-void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print);
-
-#ifndef UNITY_EXCLUDE_FLOAT_PRINT
-void UnityPrintFloat(const UNITY_DOUBLE input_number);
-#endif
-
-/*-------------------------------------------------------
- * Test Assertion Functions
- *-------------------------------------------------------
- * Use the macros below this section instead of calling
- * these directly. The macros have a consistent naming
- * convention and will pull in file and line information
- * for you. */
-
-void UnityAssertEqualNumber(const UNITY_INT expected,
- const UNITY_INT actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_DISPLAY_STYLE_T style);
-
-void UnityAssertGreaterOrLessOrEqualNumber(const UNITY_INT threshold,
- const UNITY_INT actual,
- const UNITY_COMPARISON_T compare,
- const char *msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_DISPLAY_STYLE_T style);
-
-void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
- UNITY_INTERNAL_PTR actual,
- const UNITY_UINT32 num_elements,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_DISPLAY_STYLE_T style,
- const UNITY_FLAGS_T flags);
-
-void UnityAssertBits(const UNITY_INT mask,
- const UNITY_INT expected,
- const UNITY_INT actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber);
-
-void UnityAssertEqualString(const char* expected,
- const char* actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber);
-
-void UnityAssertEqualStringLen(const char* expected,
- const char* actual,
- const UNITY_UINT32 length,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber);
-
-void UnityAssertEqualStringArray( UNITY_INTERNAL_PTR expected,
- const char** actual,
- const UNITY_UINT32 num_elements,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_FLAGS_T flags);
-
-void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected,
- UNITY_INTERNAL_PTR actual,
- const UNITY_UINT32 length,
- const UNITY_UINT32 num_elements,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_FLAGS_T flags);
-
-void UnityAssertNumbersWithin(const UNITY_UINT delta,
- const UNITY_INT expected,
- const UNITY_INT actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_DISPLAY_STYLE_T style);
-
-void UnityAssertNumbersArrayWithin(const UNITY_UINT delta,
- UNITY_INTERNAL_PTR expected,
- UNITY_INTERNAL_PTR actual,
- const UNITY_UINT32 num_elements,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_DISPLAY_STYLE_T style,
- const UNITY_FLAGS_T flags);
-
-void UnityFail(const char* message, const UNITY_LINE_TYPE line);
-void UnityIgnore(const char* message, const UNITY_LINE_TYPE line);
-void UnityMessage(const char* message, const UNITY_LINE_TYPE line);
-
-#ifndef UNITY_EXCLUDE_FLOAT
-void UnityAssertFloatsWithin(const UNITY_FLOAT delta,
- const UNITY_FLOAT expected,
- const UNITY_FLOAT actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber);
-
-void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* expected,
- UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* actual,
- const UNITY_UINT32 num_elements,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_FLAGS_T flags);
-
-void UnityAssertFloatSpecial(const UNITY_FLOAT actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_FLOAT_TRAIT_T style);
-#endif
-
-#ifndef UNITY_EXCLUDE_DOUBLE
-void UnityAssertDoublesWithin(const UNITY_DOUBLE delta,
- const UNITY_DOUBLE expected,
- const UNITY_DOUBLE actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber);
-
-void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* expected,
- UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* actual,
- const UNITY_UINT32 num_elements,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_FLAGS_T flags);
-
-void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual,
- const char* msg,
- const UNITY_LINE_TYPE lineNumber,
- const UNITY_FLOAT_TRAIT_T style);
-#endif
-
-/*-------------------------------------------------------
- * Helpers
- *-------------------------------------------------------*/
-
-UNITY_INTERNAL_PTR UnityNumToPtr(const UNITY_INT num, const UNITY_UINT8 size);
-#ifndef UNITY_EXCLUDE_FLOAT
-UNITY_INTERNAL_PTR UnityFloatToPtr(const float num);
-#endif
-#ifndef UNITY_EXCLUDE_DOUBLE
-UNITY_INTERNAL_PTR UnityDoubleToPtr(const double num);
-#endif
-
-/*-------------------------------------------------------
- * Error Strings We Might Need
- *-------------------------------------------------------*/
-
-extern const char UnityStrOk[];
-extern const char UnityStrPass[];
-extern const char UnityStrFail[];
-extern const char UnityStrIgnore[];
-
-extern const char UnityStrErrFloat[];
-extern const char UnityStrErrDouble[];
-extern const char UnityStrErr64[];
-extern const char UnityStrErrShorthand[];
-
-/*-------------------------------------------------------
- * Test Running Macros
- *-------------------------------------------------------*/
-
-#ifndef UNITY_EXCLUDE_SETJMP_H
-#define TEST_PROTECT() (setjmp(Unity.AbortFrame) == 0)
-#define TEST_ABORT() longjmp(Unity.AbortFrame, 1)
-#else
-#define TEST_PROTECT() 1
-#define TEST_ABORT() return
-#endif
-
-/* This tricky series of macros gives us an optional line argument to treat it as RUN_TEST(func, num=__LINE__) */
-#ifndef RUN_TEST
-#ifdef __STDC_VERSION__
-#if __STDC_VERSION__ >= 199901L
-#define UNITY_SUPPORT_VARIADIC_MACROS
-#endif
-#endif
-#ifdef UNITY_SUPPORT_VARIADIC_MACROS
-#define RUN_TEST(...) UnityDefaultTestRun(RUN_TEST_FIRST(__VA_ARGS__), RUN_TEST_SECOND(__VA_ARGS__))
-#define RUN_TEST_FIRST(...) RUN_TEST_FIRST_HELPER(__VA_ARGS__, throwaway)
-#define RUN_TEST_FIRST_HELPER(first, ...) (first), #first
-#define RUN_TEST_SECOND(...) RUN_TEST_SECOND_HELPER(__VA_ARGS__, __LINE__, throwaway)
-#define RUN_TEST_SECOND_HELPER(first, second, ...) (second)
-#endif
-#endif
-
-/* If we can't do the tricky version, we'll just have to require them to always include the line number */
-#ifndef RUN_TEST
-#ifdef CMOCK
-#define RUN_TEST(func, num) UnityDefaultTestRun(func, #func, num)
-#else
-#define RUN_TEST(func) UnityDefaultTestRun(func, #func, __LINE__)
-#endif
-#endif
-
-#define TEST_LINE_NUM (Unity.CurrentTestLineNumber)
-#define TEST_IS_IGNORED (Unity.CurrentTestIgnored)
-#define UNITY_NEW_TEST(a) \
- Unity.CurrentTestName = (a); \
- Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)(__LINE__); \
- Unity.NumberOfTests++;
-
-#ifndef UNITY_BEGIN
-#define UNITY_BEGIN() UnityBegin(__FILE__)
-#endif
-
-#ifndef UNITY_END
-#define UNITY_END() UnityEnd()
-#endif
-
-#ifndef UNITY_SHORTHAND_AS_INT
-#ifndef UNITY_SHORTHAND_AS_MEM
-#ifndef UNITY_SHORTHAND_AS_NONE
-#ifndef UNITY_SHORTHAND_AS_RAW
-#define UNITY_SHORTHAND_AS_OLD
-#endif
-#endif
-#endif
-#endif
-
-/*-----------------------------------------------
- * Command Line Argument Support
- *-----------------------------------------------*/
-
-#ifdef UNITY_USE_COMMAND_LINE_ARGS
-int UnityParseOptions(int argc, char** argv);
-int UnityTestMatches(void);
-#endif
-
-/*-------------------------------------------------------
- * Basic Fail and Ignore
- *-------------------------------------------------------*/
-
-#define UNITY_TEST_FAIL(line, message) UnityFail( (message), (UNITY_LINE_TYPE)(line))
-#define UNITY_TEST_IGNORE(line, message) UnityIgnore( (message), (UNITY_LINE_TYPE)(line))
-
-/*-------------------------------------------------------
- * Test Asserts
- *-------------------------------------------------------*/
-
-#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), (message));}
-#define UNITY_TEST_ASSERT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) == NULL), (UNITY_LINE_TYPE)(line), (message))
-#define UNITY_TEST_ASSERT_NOT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) != NULL), (UNITY_LINE_TYPE)(line), (message))
-
-#define UNITY_TEST_ASSERT_EQUAL_INT(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
-#define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
-#define UNITY_TEST_ASSERT_EQUAL_INT16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16)
-#define UNITY_TEST_ASSERT_EQUAL_INT32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32)
-#define UNITY_TEST_ASSERT_EQUAL_UINT(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
-#define UNITY_TEST_ASSERT_EQUAL_UINT8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8)
-#define UNITY_TEST_ASSERT_EQUAL_UINT16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16)
-#define UNITY_TEST_ASSERT_EQUAL_UINT32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32)
-#define UNITY_TEST_ASSERT_EQUAL_HEX8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8)
-#define UNITY_TEST_ASSERT_EQUAL_HEX16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16)
-#define UNITY_TEST_ASSERT_EQUAL_HEX32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32)
-#define UNITY_TEST_ASSERT_EQUAL_CHAR(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR)
-#define UNITY_TEST_ASSERT_BITS(mask, expected, actual, line, message) UnityAssertBits((UNITY_INT)(mask), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line))
-
-#define UNITY_TEST_ASSERT_GREATER_THAN_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
-#define UNITY_TEST_ASSERT_GREATER_THAN_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
-#define UNITY_TEST_ASSERT_GREATER_THAN_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16)
-#define UNITY_TEST_ASSERT_GREATER_THAN_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32)
-#define UNITY_TEST_ASSERT_GREATER_THAN_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
-#define UNITY_TEST_ASSERT_GREATER_THAN_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8)
-#define UNITY_TEST_ASSERT_GREATER_THAN_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16)
-#define UNITY_TEST_ASSERT_GREATER_THAN_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32)
-#define UNITY_TEST_ASSERT_GREATER_THAN_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8)
-#define UNITY_TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16)
-#define UNITY_TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32)
-#define UNITY_TEST_ASSERT_GREATER_THAN_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR)
-
-#define UNITY_TEST_ASSERT_SMALLER_THAN_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR)
-
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 ) (threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16) (threshold), (UNITY_INT)(UNITY_INT16) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32) (threshold), (UNITY_INT)(UNITY_INT32) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 ) (threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR)
-
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR)
-
-#define UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin( (delta), (UNITY_INT) (expected), (UNITY_INT) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
-#define UNITY_TEST_ASSERT_INT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_INT8 ) (expected), (UNITY_INT)(UNITY_INT8 ) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
-#define UNITY_TEST_ASSERT_INT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_INT16) (expected), (UNITY_INT)(UNITY_INT16) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16)
-#define UNITY_TEST_ASSERT_INT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_INT32) (expected), (UNITY_INT)(UNITY_INT32) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32)
-#define UNITY_TEST_ASSERT_UINT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin( (delta), (UNITY_INT) (expected), (UNITY_INT) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
-#define UNITY_TEST_ASSERT_UINT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8)
-#define UNITY_TEST_ASSERT_UINT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16)
-#define UNITY_TEST_ASSERT_UINT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32)
-#define UNITY_TEST_ASSERT_HEX8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8)
-#define UNITY_TEST_ASSERT_HEX16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16)
-#define UNITY_TEST_ASSERT_HEX32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32)
-#define UNITY_TEST_ASSERT_CHAR_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_INT8 ) (expected), (UNITY_INT)(UNITY_INT8 ) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR)
-
-#define UNITY_TEST_ASSERT_INT_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_INT16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_INT32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_UINT16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_UINT32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_ARRAY)
-
-
-#define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualNumber((UNITY_PTR_TO_INT)(expected), (UNITY_PTR_TO_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER)
-#define UNITY_TEST_ASSERT_EQUAL_STRING(expected, actual, line, message) UnityAssertEqualString((const char*)(expected), (const char*)(actual), (message), (UNITY_LINE_TYPE)(line))
-#define UNITY_TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len, line, message) UnityAssertEqualStringLen((const char*)(expected), (const char*)(actual), (UNITY_UINT32)(len), (message), (UNITY_LINE_TYPE)(line))
-#define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), 1, (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY)
-
-#define UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((UNITY_INTERNAL_PTR)(expected), (const char**)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_ARRAY)
-
-#define UNITY_TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT) (expected), (UNITY_INT_WIDTH / 8)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_INT8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )(expected), 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_INT16(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT16 )(expected), 2), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT32 )(expected), 4), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT) (expected), (UNITY_INT_WIDTH / 8)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT8 )(expected), 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT16(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT16)(expected), 2), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT32(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT32)(expected), 4), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )(expected), 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX16(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT16 )(expected), 2), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX32(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT32 )(expected), 4), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_PTR(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_PTR_TO_INT) (expected), (UNITY_POINTER_WIDTH / 8)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_STRING(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((UNITY_INTERNAL_PTR)(expected), (const char**)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_CHAR(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )(expected), 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_VAL)
-
-#ifdef UNITY_SUPPORT_64
-#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
-#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
-#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
-#define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_INT64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT64)(expected), 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT64)(expected), 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT64)(expected), 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
-#define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
-#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
-#define UNITY_TEST_ASSERT_GREATER_THAN_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
-#define UNITY_TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
-#define UNITY_TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
-#define UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT64)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_ARRAY)
-#else
-#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_GREATER_THAN_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#define UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
-#endif
-
-#ifdef UNITY_EXCLUDE_FLOAT
-#define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
-#define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
-#define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
-#define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
-#define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
-#define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
-#define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
-#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
-#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
-#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
-#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
-#else
-#define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message) UnityAssertFloatsWithin((UNITY_FLOAT)(delta), (UNITY_FLOAT)(expected), (UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line))
-#define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) UNITY_TEST_ASSERT_FLOAT_WITHIN((UNITY_FLOAT)(expected) * (UNITY_FLOAT)UNITY_FLOAT_PRECISION, (UNITY_FLOAT)(expected), (UNITY_FLOAT)(actual), (UNITY_LINE_TYPE)(line), (message))
-#define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualFloatArray((UNITY_FLOAT*)(expected), (UNITY_FLOAT*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements, line, message) UnityAssertEqualFloatArray(UnityFloatToPtr(expected), (UNITY_FLOAT*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_INF)
-#define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NEG_INF)
-#define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NAN)
-#define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_DET)
-#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_INF)
-#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NEG_INF)
-#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NAN)
-#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET)
-#endif
-
-#ifdef UNITY_EXCLUDE_DOUBLE
-#define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
-#define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
-#define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
-#else
-#define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, message) UnityAssertDoublesWithin((UNITY_DOUBLE)(delta), (UNITY_DOUBLE)(expected), (UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line))
-#define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) UNITY_TEST_ASSERT_DOUBLE_WITHIN((UNITY_DOUBLE)(expected) * (UNITY_DOUBLE)UNITY_DOUBLE_PRECISION, (UNITY_DOUBLE)(expected), (UNITY_DOUBLE)(actual), (UNITY_LINE_TYPE)(line), (message))
-#define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualDoubleArray((UNITY_DOUBLE*)(expected), (UNITY_DOUBLE*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY)
-#define UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements, line, message) UnityAssertEqualDoubleArray(UnityDoubleToPtr(expected), (UNITY_DOUBLE*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_INF)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NEG_INF)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NAN)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_DET)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_INF)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NEG_INF)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NAN)
-#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET)
-#endif
-
-/* End of UNITY_INTERNALS_H */
-#endif
diff --git a/tinyusb/tools/build_board.py b/tinyusb/tools/build_board.py
deleted file mode 100755
index 9397c754..00000000
--- a/tinyusb/tools/build_board.py
+++ /dev/null
@@ -1,125 +0,0 @@
-import os
-import glob
-import sys
-import subprocess
-import time
-
-SUCCEEDED = "\033[32msucceeded\033[0m"
-FAILED = "\033[31mfailed\033[0m"
-SKIPPED = "\033[33mskipped\033[0m"
-
-success_count = 0
-fail_count = 0
-skip_count = 0
-exit_status = 0
-
-total_time = time.monotonic()
-
-build_format = '| {:29} | {:30} | {:18} | {:7} | {:6} | {:6} |'
-build_separator = '-' * 106
-
-def filter_with_input(mylist):
- if len(sys.argv) > 1:
- input_args = list(set(mylist).intersection(sys.argv))
- if len(input_args) > 0:
- mylist[:] = input_args
-
-# If examples are not specified in arguments, build all
-all_examples = []
-for entry in os.scandir("examples/device"):
- if entry.is_dir():
- all_examples.append("device/" + entry.name)
-for entry in os.scandir("examples/host"):
- if entry.is_dir():
- all_examples.append("host/" + entry.name)
-filter_with_input(all_examples)
-all_examples.sort()
-
-# If boards are not specified in arguments, build all
-all_boards = []
-for entry in os.scandir("hw/bsp"):
- if entry.is_dir() and os.path.exists(entry.path + "/board.mk"):
- all_boards.append(entry.name)
-filter_with_input(all_boards)
-all_boards.sort()
-
-def build_board(example, board):
- global success_count, fail_count, skip_count, exit_status
- start_time = time.monotonic()
- flash_size = "-"
- sram_size = "-"
-
- # Check if board is skipped
- if skip_example(example, board):
- success = SKIPPED
- skip_count += 1
- print(build_format.format(example, board, success, '-', flash_size, sram_size))
- else:
- subprocess.run("make -C examples/{} BOARD={} clean".format(example, board), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- build_result = subprocess.run("make -j -C examples/{} BOARD={} all".format(example, board), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
- if build_result.returncode == 0:
- success = SUCCEEDED
- success_count += 1
- (flash_size, sram_size) = build_size(example, board)
- else:
- exit_status = build_result.returncode
- success = FAILED
- fail_count += 1
-
- build_duration = time.monotonic() - start_time
- print(build_format.format(example, board, success, "{:.2f}s".format(build_duration), flash_size, sram_size))
-
- if build_result.returncode != 0:
- print(build_result.stdout.decode("utf-8"))
-
-def build_size(example, board):
- #elf_file = 'examples/device/{}/_build/{}/{}-firmware.elf'.format(example, board, board)
- elf_file = 'examples/{}/_build/{}/*.elf'.format(example, board)
- size_output = subprocess.run('size {}'.format(elf_file), shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8")
- size_list = size_output.split('\n')[1].split('\t')
- flash_size = int(size_list[0])
- sram_size = int(size_list[1]) + int(size_list[2])
- return (flash_size, sram_size)
-
-def skip_example(example, board):
- ex_dir = 'examples/' + example
- board_mk = 'hw/bsp/{}/board.mk'.format(board)
- with open(board_mk) as mk:
- mk_contents = mk.read()
-
- # Skip all OPT_MCU_NONE these are WIP port
- if '-DCFG_TUSB_MCU=OPT_MCU_NONE' in mk_contents:
- return 1
-
- # Skip if CFG_TUSB_MCU in board.mk to match skip file
- for skip_file in glob.iglob(ex_dir + '/.skip.MCU_*'):
- mcu_cflag = '-DCFG_TUSB_MCU=OPT_' + os.path.basename(skip_file).split('.')[2]
- if mcu_cflag in mk_contents:
- return 1
-
- # Build only list, if exists only these MCU are built
- only_list = list(glob.iglob(ex_dir + '/.only.MCU_*'))
- if len(only_list) > 0:
- for only_file in only_list:
- mcu_cflag = '-DCFG_TUSB_MCU=OPT_' + os.path.basename(only_file).split('.')[2]
- if mcu_cflag in mk_contents:
- return 0
- return 1
-
- return 0
-
-print(build_separator)
-print(build_format.format('Example', 'Board', '\033[39mResult\033[0m', 'Time', 'Flash', 'SRAM'))
-
-for example in all_examples:
- print(build_separator)
- for board in all_boards:
- build_board(example, board)
-
-total_time = time.monotonic() - total_time
-print(build_separator)
-print("Build Summary: {} {}, {} {}, {} {} and took {:.2f}s".format(success_count, SUCCEEDED, fail_count, FAILED, skip_count, SKIPPED, total_time))
-print(build_separator)
-
-sys.exit(exit_status)
diff --git a/tinyusb/tools/build_esp32sx.py b/tinyusb/tools/build_esp32sx.py
deleted file mode 100755
index 91953f08..00000000
--- a/tinyusb/tools/build_esp32sx.py
+++ /dev/null
@@ -1,102 +0,0 @@
-import os
-import glob
-import sys
-import subprocess
-import time
-
-SUCCEEDED = "\033[32msucceeded\033[0m"
-FAILED = "\033[31mfailed\033[0m"
-SKIPPED = "\033[33mskipped\033[0m"
-
-success_count = 0
-fail_count = 0
-skip_count = 0
-exit_status = 0
-
-total_time = time.monotonic()
-
-build_format = '| {:23} | {:30} | {:18} | {:7} | {:6} | {:6} |'
-build_separator = '-' * 100
-
-def filter_with_input(mylist):
- if len(sys.argv) > 1:
- input_args = list(set(mylist).intersection(sys.argv))
- if len(input_args) > 0:
- mylist[:] = input_args
-
-# Build all examples if not specified
-all_examples = []
-for entry in os.scandir("examples/device"):
- # Only includes example with CMakeLists.txt for esp32s, and skip board_test to speed up ci
- if entry.is_dir() and os.path.exists(entry.path + "/sdkconfig.defaults") and entry.name != 'board_test':
- all_examples.append(entry.name)
-filter_with_input(all_examples)
-all_examples.sort()
-
-# Build all boards if not specified
-all_boards = []
-for entry in os.scandir("hw/bsp/esp32s2/boards"):
- if entry.is_dir():
- all_boards.append(entry.name)
-for entry in os.scandir("hw/bsp/esp32s3/boards"):
- if entry.is_dir():
- all_boards.append(entry.name)
-filter_with_input(all_boards)
-all_boards.sort()
-
-def build_board(example, board):
- global success_count, fail_count, skip_count, exit_status
- start_time = time.monotonic()
- flash_size = "-"
- sram_size = "-"
-
- # Check if board is skipped
- if skip_example(example, board):
- success = SKIPPED
- skip_count += 1
- print(build_format.format(example, board, success, '-', flash_size, sram_size))
- else:
- subprocess.run("make -C examples/device/{} BOARD={} clean".format(example, board), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- build_result = subprocess.run("make -j -C examples/device/{} BOARD={} all".format(example, board), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
- if build_result.returncode == 0:
- success = SUCCEEDED
- success_count += 1
- (flash_size, sram_size) = build_size(example, board)
- else:
- exit_status = build_result.returncode
- success = FAILED
- fail_count += 1
-
- build_duration = time.monotonic() - start_time
- print(build_format.format(example, board, success, "{:.2f}s".format(build_duration), flash_size, sram_size))
-
- if build_result.returncode != 0:
- print(build_result.stdout.decode("utf-8"))
-
-def build_size(example, board):
- #elf_file = 'examples/device/{}/_build/{}/{}-firmware.elf'.format(example, board, board)
- elf_file = 'examples/device/{}/_build/{}/*.elf'.format(example, board)
- size_output = subprocess.run('size {}'.format(elf_file), shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8")
- size_list = size_output.split('\n')[1].split('\t')
- flash_size = int(size_list[0])
- sram_size = int(size_list[1]) + int(size_list[2])
- return (flash_size, sram_size)
-
-def skip_example(example, board):
- return 0
-
-print(build_separator)
-print(build_format.format('Example', 'Board', '\033[39mResult\033[0m', 'Time', 'Flash', 'SRAM'))
-print(build_separator)
-
-for example in all_examples:
- for board in all_boards:
- build_board(example, board)
-
-total_time = time.monotonic() - total_time
-print(build_separator)
-print("Build Summary: {} {}, {} {}, {} {} and took {:.2f}s".format(success_count, SUCCEEDED, fail_count, FAILED, skip_count, SKIPPED, total_time))
-print(build_separator)
-
-sys.exit(exit_status)
diff --git a/tinyusb/tools/build_family.py b/tinyusb/tools/build_family.py
deleted file mode 100755
index c4678190..00000000
--- a/tinyusb/tools/build_family.py
+++ /dev/null
@@ -1,144 +0,0 @@
-import os
-import glob
-import sys
-import subprocess
-import time
-
-SUCCEEDED = "\033[32msucceeded\033[0m"
-FAILED = "\033[31mfailed\033[0m"
-SKIPPED = "\033[33mskipped\033[0m"
-
-success_count = 0
-fail_count = 0
-skip_count = 0
-exit_status = 0
-
-total_time = time.monotonic()
-
-build_format = '| {:29} | {:30} | {:18} | {:7} | {:6} | {:6} |'
-build_separator = '-' * 106
-
-def filter_with_input(mylist):
- if len(sys.argv) > 1:
- input_args = list(set(mylist).intersection(sys.argv))
- if len(input_args) > 0:
- mylist[:] = input_args
-
-# If examples are not specified in arguments, build all
-all_examples = []
-for entry in os.scandir("examples/device"):
- if entry.is_dir():
- all_examples.append("device/" + entry.name)
-for entry in os.scandir("examples/host"):
- if entry.is_dir():
- all_examples.append("host/" + entry.name)
-filter_with_input(all_examples)
-all_examples.sort()
-
-# If family are not specified in arguments, build all
-all_families = []
-for entry in os.scandir("hw/bsp"):
- if entry.is_dir() and os.path.isdir(entry.path + "/boards") and entry.name != "esp32s2" and entry.name != "esp32s3":
- all_families.append(entry.name)
-
-filter_with_input(all_families)
-all_families.sort()
-
-def build_family(example, family):
- all_boards = []
- for entry in os.scandir("hw/bsp/{}/boards".format(family)):
- if entry.is_dir():
- all_boards.append(entry.name)
- filter_with_input(all_boards)
- all_boards.sort()
-
- for board in all_boards:
- build_board(example, board)
-
-def build_board(example, board):
- global success_count, fail_count, skip_count, exit_status
- start_time = time.monotonic()
- flash_size = "-"
- sram_size = "-"
-
- # Check if board is skipped
- if skip_example(example, board):
- success = SKIPPED
- skip_count += 1
- print(build_format.format(example, board, success, '-', flash_size, sram_size))
- else:
- #subprocess.run("make -C examples/{} BOARD={} clean".format(example, board), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- build_result = subprocess.run("make -j -C examples/{} BOARD={} all".format(example, board), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
- if build_result.returncode == 0:
- success = SUCCEEDED
- success_count += 1
- (flash_size, sram_size) = build_size(example, board)
- subprocess.run("make -j -C examples/{} BOARD={} copy-artifact".format(example, board), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- else:
- exit_status = build_result.returncode
- success = FAILED
- fail_count += 1
-
- build_duration = time.monotonic() - start_time
- print(build_format.format(example, board, success, "{:.2f}s".format(build_duration), flash_size, sram_size))
-
- if build_result.returncode != 0:
- print(build_result.stdout.decode("utf-8"))
-
-def build_size(example, board):
- #elf_file = 'examples/device/{}/_build/{}/{}-firmware.elf'.format(example, board, board)
- elf_file = 'examples/{}/_build/{}/*.elf'.format(example, board)
- size_output = subprocess.run('size {}'.format(elf_file), shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8")
- size_list = size_output.split('\n')[1].split('\t')
- flash_size = int(size_list[0])
- sram_size = int(size_list[1]) + int(size_list[2])
- return (flash_size, sram_size)
-
-def skip_example(example, board):
- ex_dir = 'examples/' + example
-
- # family CMake
- board_mk = 'hw/bsp/{}/family.cmake'.format(family)
-
- # family.mk
- if not os.path.exists(board_mk):
- board_mk = 'hw/bsp/{}/family.mk'.format(family)
-
- with open(board_mk) as mk:
- mk_contents = mk.read()
-
- # Skip all OPT_MCU_NONE these are WIP port
- if 'CFG_TUSB_MCU=OPT_MCU_NONE' in mk_contents:
- return 1
-
- # Skip if CFG_TUSB_MCU in board.mk to match skip file
- for skip_file in glob.iglob(ex_dir + '/.skip.MCU_*'):
- mcu_cflag = 'CFG_TUSB_MCU=OPT_' + os.path.basename(skip_file).split('.')[2]
- if mcu_cflag in mk_contents:
- return 1
-
- # Build only list, if exists only these MCU are built
- only_list = list(glob.iglob(ex_dir + '/.only.MCU_*'))
- if len(only_list) > 0:
- for only_file in only_list:
- mcu_cflag = 'CFG_TUSB_MCU=OPT_' + os.path.basename(only_file).split('.')[2]
- if mcu_cflag in mk_contents:
- return 0
- return 1
- return 0
-
-print(build_separator)
-print(build_format.format('Example', 'Board', '\033[39mResult\033[0m', 'Time', 'Flash', 'SRAM'))
-
-for example in all_examples:
- print(build_separator)
- for family in all_families:
- build_family(example, family)
-
-total_time = time.monotonic() - total_time
-print(build_separator)
-print("Build Summary: {} {}, {} {}, {} {} and took {:.2f}s".format(success_count, SUCCEEDED, fail_count, FAILED, skip_count, SKIPPED, total_time))
-print(build_separator)
-
-sys.exit(exit_status)
diff --git a/tinyusb/tools/top.mk b/tinyusb/tools/top.mk
deleted file mode 100755
index 84523a55..00000000
--- a/tinyusb/tools/top.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-ifneq ($(lastword a b),b)
-$(error This Makefile require make 3.81 or newer)
-endif
-
-# Detect whether shell style is windows or not
-# https://stackoverflow.com/questions/714100/os-detecting-makefile/52062069#52062069
-ifeq '$(findstring ;,$(PATH))' ';'
-CMDEXE := 1
-endif
-
-# Set TOP to be the path to get from the current directory (where make was
-# invoked) to the top of the tree. $(lastword $(MAKEFILE_LIST)) returns
-# the name of this makefile relative to where make was invoked.
-
-THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
-TOP := $(patsubst %/tools/top.mk,%,$(THIS_MAKEFILE))
-
-ifeq ($(CMDEXE),1)
-TOP := $(subst \,/,$(shell for %%i in ( $(TOP) ) do echo %%~fi))
-else
-TOP := $(shell realpath $(TOP))
-endif
-#$(info Top directory is $(TOP))
-
-ifeq ($(CMDEXE),1)
-CURRENT_PATH := $(subst $(TOP)/,,$(subst \,/,$(shell echo %CD%)))
-else
-CURRENT_PATH := $(shell realpath --relative-to=$(TOP) `pwd`)
-endif
-#$(info Path from top is $(CURRENT_PATH))
diff --git a/tinyusb/tools/usb_drivers/tinyusb_win_usbser.inf b/tinyusb/tools/usb_drivers/tinyusb_win_usbser.inf
deleted file mode 100755
index e7f7a9b2..00000000
--- a/tinyusb/tools/usb_drivers/tinyusb_win_usbser.inf
+++ /dev/null
@@ -1,108 +0,0 @@
-;************************************************************
-; Windows USB CDC ACM Setup File
-; Copyright (c) 2000 Microsoft Corporation
-
-
-[Version]
-Signature="$Windows NT$"
-Class=Ports
-ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
-Provider=%MFGNAME%
-LayoutFile=layout.inf
-CatalogFile=%MFGFILENAME%.cat
-DriverVer=11/15/2007,5.1.2600.0
-DriverPackageDisplayName=%DESCRIPTION%
-
-[Manufacturer]
-%MFGNAME%=DeviceList, NTamd64
-
-[DestinationDirs]
-DefaultDestDir=12
-
-
-;------------------------------------------------------------------------------
-; Windows 2000/XP/Vista-32bit Sections
-;------------------------------------------------------------------------------
-
-[DriverInstall.nt]
-include=mdmcpq.inf
-CopyFiles=DriverCopyFiles.nt
-AddReg=DriverInstall.nt.AddReg
-
-[DriverCopyFiles.nt]
-usbser.sys,,,0x20
-
-[DriverInstall.nt.AddReg]
-HKR,,DevLoader,,*ntkern
-HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
-HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
-
-[DriverInstall.nt.Services]
-AddService=usbser, 0x00000002, DriverService.nt
-
-[DriverService.nt]
-DisplayName=%SERVICE%
-ServiceType=1
-StartType=3
-ErrorControl=1
-ServiceBinary=%12%\%DRIVERFILENAME%.sys
-
-;------------------------------------------------------------------------------
-; Vista-64bit Sections
-;------------------------------------------------------------------------------
-
-[DriverInstall.NTamd64]
-include=mdmcpq.inf
-CopyFiles=DriverCopyFiles.NTamd64
-AddReg=DriverInstall.NTamd64.AddReg
-
-[DriverCopyFiles.NTamd64]
-%DRIVERFILENAME%.sys,,,0x20
-
-[DriverInstall.NTamd64.AddReg]
-HKR,,DevLoader,,*ntkern
-HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
-HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
-
-[DriverInstall.NTamd64.Services]
-AddService=usbser, 0x00000002, DriverService.NTamd64
-
-[DriverService.NTamd64]
-DisplayName=%SERVICE%
-ServiceType=1
-StartType=3
-ErrorControl=1
-ServiceBinary=%12%\%DRIVERFILENAME%.sys
-
-
-;------------------------------------------------------------------------------
-; Vendor and Product ID Definitions
-;------------------------------------------------------------------------------
-; When developing your USB device, the VID and PID used in the PC side
-; application program and the firmware on the microcontroller must match.
-; Modify the below line to use your VID and PID. Use the format as shown below.
-; Note: One INF file can be used for multiple devices with different VID and PIDs.
-; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line.
-;------------------------------------------------------------------------------
-[SourceDisksFiles]
-[SourceDisksNames]
-[DeviceList]
-
-%DESCRIPTION%=DriverInstall, USB\VID_CAFE&PID_4001&MI_00, USB\VID_CAFE&PID_4003&MI_00, USB\VID_CAFE&PID_4005&MI_00, USB\VID_CAFE&PID_4007&MI_00, USB\VID_CAFE&PID_4009&MI_00, USB\VID_CAFE&PID_400b&MI_00, USB\VID_CAFE&PID_400d&MI_00, USB\VID_CAFE&PID_400f&MI_00, USB\VID_CAFE&PID_4011&MI_00, USB\VID_CAFE&PID_4013&MI_00, USB\VID_CAFE&PID_4015&MI_00, USB\VID_CAFE&PID_4017&MI_00, USB\VID_CAFE&PID_4019&MI_00, USB\VID_CAFE&PID_401b&MI_00, USB\VID_CAFE&PID_401d&MI_00, USB\VID_CAFE&PID_401f&MI_00, USB\VID_CAFE&PID_4021&MI_00, USB\VID_CAFE&PID_4023&MI_00, USB\VID_CAFE&PID_4025&MI_00, USB\VID_CAFE&PID_4027&MI_00, USB\VID_CAFE&PID_4029&MI_00, USB\VID_CAFE&PID_402b&MI_00, USB\VID_CAFE&PID_402d&MI_00, USB\VID_CAFE&PID_402f&MI_00, USB\VID_CAFE&PID_4031&MI_00, USB\VID_CAFE&PID_4033&MI_00, USB\VID_CAFE&PID_4035&MI_00, USB\VID_CAFE&PID_4037&MI_00, USB\VID_CAFE&PID_4039&MI_00, USB\VID_CAFE&PID_403b&MI_00, USB\VID_CAFE&PID_403d&MI_00, USB\VID_CAFE&PID_403f&MI_00
-
-
-[DeviceList.NTamd64]
-%DESCRIPTION%=DriverInstall, USB\VID_CAFE&PID_4001&MI_00, USB\VID_CAFE&PID_4003&MI_00, USB\VID_CAFE&PID_4005&MI_00, USB\VID_CAFE&PID_4007&MI_00, USB\VID_CAFE&PID_4009&MI_00, USB\VID_CAFE&PID_400b&MI_00, USB\VID_CAFE&PID_400d&MI_00, USB\VID_CAFE&PID_400f&MI_00, USB\VID_CAFE&PID_4011&MI_00, USB\VID_CAFE&PID_4013&MI_00, USB\VID_CAFE&PID_4015&MI_00, USB\VID_CAFE&PID_4017&MI_00, USB\VID_CAFE&PID_4019&MI_00, USB\VID_CAFE&PID_401b&MI_00, USB\VID_CAFE&PID_401d&MI_00, USB\VID_CAFE&PID_401f&MI_00, USB\VID_CAFE&PID_4021&MI_00, USB\VID_CAFE&PID_4023&MI_00, USB\VID_CAFE&PID_4025&MI_00, USB\VID_CAFE&PID_4027&MI_00, USB\VID_CAFE&PID_4029&MI_00, USB\VID_CAFE&PID_402b&MI_00, USB\VID_CAFE&PID_402d&MI_00, USB\VID_CAFE&PID_402f&MI_00, USB\VID_CAFE&PID_4031&MI_00, USB\VID_CAFE&PID_4033&MI_00, USB\VID_CAFE&PID_4035&MI_00, USB\VID_CAFE&PID_4037&MI_00, USB\VID_CAFE&PID_4039&MI_00, USB\VID_CAFE&PID_403b&MI_00, USB\VID_CAFE&PID_403d&MI_00, USB\VID_CAFE&PID_403f&MI_00
-
-;------------------------------------------------------------------------------
-; String Definitions
-;------------------------------------------------------------------------------
-;Modify these strings to customize your device
-;------------------------------------------------------------------------------
-[Strings]
-MFGFILENAME="tinyusb_usbser"
-DRIVERFILENAME ="usbser"
-MFGNAME="tinyusb.org"
-INSTDISK="tinyusb CDC Driver"
-DESCRIPTION="tinyusb Serial"
-SERVICE="USB RS-232 Emulation Driver" \ No newline at end of file
diff --git a/tinyusb/version.yml b/tinyusb/version.yml
deleted file mode 100755
index db103d80..00000000
--- a/tinyusb/version.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-# Newt uses this file to determine the version of a checked out repo.
-# This should always be 0.0.0 in the master branch.
-repo.version: 0.0.0