From 5096c07c58d05923ae1b1a429fed44c805610ddf Mon Sep 17 00:00:00 2001 From: Ismail Kose Date: Tue, 8 Aug 2017 12:37:48 -0700 Subject: [PATCH] max32630-fthr-mbed: developing bstack mbed support Adding initial mbed support Add mbed libraries Split btstack Makefile and mbed build makefile --- port/max32630-fthr-mbed/.gitignore | 17 + port/max32630-fthr-mbed/Makefile | 520 +++++++++++++ port/max32630-fthr-mbed/Makefile.old | 11 + port/max32630-fthr-mbed/README.md | 75 ++ port/max32630-fthr-mbed/USBDevice.lib | 1 + port/max32630-fthr-mbed/main.cpp | 88 +++ port/max32630-fthr-mbed/max32630fthr-mbed.mk | 68 ++ port/max32630-fthr-mbed/max32630fthr.lib | 1 + port/max32630-fthr-mbed/mbed-os.lib | 1 + port/max32630-fthr-mbed/mbed_config.h | 18 + .../scripts/create_examples.py | 101 +++ .../scripts/delete_examples.py | 31 + .../scripts/flash_Max32630_hdk.sh | 3 + port/max32630-fthr-mbed/scripts/max32630.gdb | 33 + .../scripts/max3263x_hdk.cfg | 25 + port/max32630-fthr-mbed/src/btstack_config.h | 51 ++ port/max32630-fthr-mbed/src/btstack_port.cpp | 360 +++++++++ port/max32630-fthr-mbed/src/btstack_port.h | 50 ++ port/max32630-fthr-mbed/src/hal_tick.cpp | 60 ++ port/max32630-fthr-mbed/src/hal_tick.h | 51 ++ .../initscripts-TIInit_6.7.16_bt_spec_4.1.c | 702 ++++++++++++++++++ port/max32630-fthr-mbed/src/spp_counter.c | 267 +++++++ 22 files changed, 2534 insertions(+) create mode 100644 port/max32630-fthr-mbed/.gitignore create mode 100644 port/max32630-fthr-mbed/Makefile create mode 100644 port/max32630-fthr-mbed/Makefile.old create mode 100644 port/max32630-fthr-mbed/README.md create mode 100644 port/max32630-fthr-mbed/USBDevice.lib create mode 100644 port/max32630-fthr-mbed/main.cpp create mode 100644 port/max32630-fthr-mbed/max32630fthr-mbed.mk create mode 100644 port/max32630-fthr-mbed/max32630fthr.lib create mode 100644 port/max32630-fthr-mbed/mbed-os.lib create mode 100644 port/max32630-fthr-mbed/mbed_config.h create mode 100755 port/max32630-fthr-mbed/scripts/create_examples.py create mode 100755 port/max32630-fthr-mbed/scripts/delete_examples.py create mode 100755 port/max32630-fthr-mbed/scripts/flash_Max32630_hdk.sh create mode 100644 port/max32630-fthr-mbed/scripts/max32630.gdb create mode 100755 port/max32630-fthr-mbed/scripts/max3263x_hdk.cfg create mode 100644 port/max32630-fthr-mbed/src/btstack_config.h create mode 100644 port/max32630-fthr-mbed/src/btstack_port.cpp create mode 100644 port/max32630-fthr-mbed/src/btstack_port.h create mode 100644 port/max32630-fthr-mbed/src/hal_tick.cpp create mode 100644 port/max32630-fthr-mbed/src/hal_tick.h create mode 100644 port/max32630-fthr-mbed/src/initscripts-TIInit_6.7.16_bt_spec_4.1.c create mode 100644 port/max32630-fthr-mbed/src/spp_counter.c diff --git a/port/max32630-fthr-mbed/.gitignore b/port/max32630-fthr-mbed/.gitignore new file mode 100644 index 0000000000..cc3ffef5a0 --- /dev/null +++ b/port/max32630-fthr-mbed/.gitignore @@ -0,0 +1,17 @@ +.swp +.*.sw[op] +*~ +*.o +*.a +*.xml +*.d +*.map +*.elf +build/ +GPATH +GRTAGS +GTAGS +tags +*.txt +*.log +core diff --git a/port/max32630-fthr-mbed/Makefile b/port/max32630-fthr-mbed/Makefile new file mode 100644 index 0000000000..20f82ff372 --- /dev/null +++ b/port/max32630-fthr-mbed/Makefile @@ -0,0 +1,520 @@ +# mbed compile -m MAX32630FTHR -t GCC_ARM +#if 0 +# mbed deploy + +# This file was automagically generated by mbed.org. For more information, +# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded + +############################################################################### +# Boiler-plate + +# cross-platform directory manipulation +ifeq ($(shell echo $$OS),$$OS) + MAKEDIR = if not exist "$(1)" mkdir "$(1)" + RM = rmdir /S /Q "$(1)" +else + MAKEDIR = '$(SHELL)' -c "mkdir -p \"$(1)\"" + RM = '$(SHELL)' -c "rm -rf \"$(1)\"" +endif + +OBJDIR := build + +# Move to the build directory +ifeq (,$(filter $(OBJDIR),$(notdir $(CURDIR)))) +.SUFFIXES: +mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) +MAKETARGET = '$(MAKE)' --no-print-directory -C $(OBJDIR) -f '$(mkfile_path)' \ + 'SRCDIR=$(CURDIR)' $(MAKECMDGOALS) + +$(warning MAKETARGET: $(MAKETARGET)) +.PHONY: $(OBJDIR) clean +all: + +@$(call MAKEDIR,$(OBJDIR)) + +@$(MAKETARGET) +$(OBJDIR): all +Makefile : ; +% :: $(OBJDIR) ; : +clean : + $(call RM,$(OBJDIR)) + +else + +# trick rules into thinking we are in the root, when we are in the bulid dir +VPATH = .. + +# Boiler-plate +############################################################################### +# Project settings + +PROJECT := max32630-fthr-mbed + + +# Project settings +############################################################################### +# Objects and Paths + +OBJECTS += ./main.o +OBJECTS += ./USBDevice/USBAudio/USBAudio.o +OBJECTS += ./USBDevice/USBDevice/USBDevice.o +OBJECTS += ./USBDevice/USBDevice/USBHAL_EFM32.o +OBJECTS += ./USBDevice/USBDevice/USBHAL_KL25Z.o +OBJECTS += ./USBDevice/USBDevice/USBHAL_LPC11U.o +OBJECTS += ./USBDevice/USBDevice/USBHAL_LPC17.o +OBJECTS += ./USBDevice/USBDevice/USBHAL_LPC40.o +OBJECTS += ./USBDevice/USBDevice/USBHAL_Maxim.o +OBJECTS += ./USBDevice/USBDevice/USBHAL_RZ_A1H.o +OBJECTS += ./USBDevice/USBDevice/USBHAL_STM32F4.o +OBJECTS += ./USBDevice/USBHID/USBHID.o +OBJECTS += ./USBDevice/USBHID/USBKeyboard.o +OBJECTS += ./USBDevice/USBHID/USBMouse.o +OBJECTS += ./USBDevice/USBHID/USBMouseKeyboard.o +OBJECTS += ./USBDevice/USBMIDI/USBMIDI.o +OBJECTS += ./USBDevice/USBMSD/USBMSD.o +OBJECTS += ./USBDevice/USBSerial/USBCDC.o +OBJECTS += ./USBDevice/USBSerial/USBSerial.o +OBJECTS += ./max32630fthr/MAX14690/MAX14690.o +OBJECTS += ./max32630fthr/max32630fthr.o +OBJECTS += ./mbed-os/drivers/AnalogIn.o +OBJECTS += ./mbed-os/drivers/BusIn.o +OBJECTS += ./mbed-os/drivers/BusInOut.o +OBJECTS += ./mbed-os/drivers/BusOut.o +OBJECTS += ./mbed-os/drivers/CAN.o +OBJECTS += ./mbed-os/drivers/Ethernet.o +OBJECTS += ./mbed-os/drivers/FileBase.o +OBJECTS += ./mbed-os/drivers/FileLike.o +OBJECTS += ./mbed-os/drivers/FilePath.o +OBJECTS += ./mbed-os/drivers/FileSystemLike.o +OBJECTS += ./mbed-os/drivers/I2C.o +OBJECTS += ./mbed-os/drivers/I2CSlave.o +OBJECTS += ./mbed-os/drivers/InterruptIn.o +OBJECTS += ./mbed-os/drivers/InterruptManager.o +OBJECTS += ./mbed-os/drivers/LocalFileSystem.o +OBJECTS += ./mbed-os/drivers/RawSerial.o +OBJECTS += ./mbed-os/drivers/SPI.o +OBJECTS += ./mbed-os/drivers/SPISlave.o +OBJECTS += ./mbed-os/drivers/Serial.o +OBJECTS += ./mbed-os/drivers/SerialBase.o +OBJECTS += ./mbed-os/drivers/Stream.o +OBJECTS += ./mbed-os/drivers/Ticker.o +OBJECTS += ./mbed-os/drivers/Timeout.o +OBJECTS += ./mbed-os/drivers/Timer.o +OBJECTS += ./mbed-os/drivers/TimerEvent.o +OBJECTS += ./mbed-os/events/EventQueue.o +OBJECTS += ./mbed-os/events/equeue/equeue.o +OBJECTS += ./mbed-os/events/equeue/equeue_mbed.o +OBJECTS += ./mbed-os/events/equeue/equeue_posix.o +OBJECTS += ./mbed-os/features/frameworks/greentea-client/source/greentea_metrics.o +OBJECTS += ./mbed-os/features/frameworks/greentea-client/source/greentea_serial.o +OBJECTS += ./mbed-os/features/frameworks/greentea-client/source/greentea_test_env.o +OBJECTS += ./mbed-os/features/frameworks/unity/source/unity.o +OBJECTS += ./mbed-os/features/frameworks/utest/mbed-utest-shim.o +OBJECTS += ./mbed-os/features/frameworks/utest/source/unity_handler.o +OBJECTS += ./mbed-os/features/frameworks/utest/source/utest_case.o +OBJECTS += ./mbed-os/features/frameworks/utest/source/utest_default_handlers.o +OBJECTS += ./mbed-os/features/frameworks/utest/source/utest_greentea_handlers.o +OBJECTS += ./mbed-os/features/frameworks/utest/source/utest_harness.o +OBJECTS += ./mbed-os/features/frameworks/utest/source/utest_shim.o +OBJECTS += ./mbed-os/features/frameworks/utest/source/utest_stack_trace.o +OBJECTS += ./mbed-os/features/frameworks/utest/source/utest_types.o +OBJECTS += ./mbed-os/features/mbedtls/platform/src/mbed_trng.o +OBJECTS += ./mbed-os/features/mbedtls/src/aes.o +OBJECTS += ./mbed-os/features/mbedtls/src/aesni.o +OBJECTS += ./mbed-os/features/mbedtls/src/arc4.o +OBJECTS += ./mbed-os/features/mbedtls/src/asn1parse.o +OBJECTS += ./mbed-os/features/mbedtls/src/asn1write.o +OBJECTS += ./mbed-os/features/mbedtls/src/base64.o +OBJECTS += ./mbed-os/features/mbedtls/src/bignum.o +OBJECTS += ./mbed-os/features/mbedtls/src/blowfish.o +OBJECTS += ./mbed-os/features/mbedtls/src/camellia.o +OBJECTS += ./mbed-os/features/mbedtls/src/ccm.o +OBJECTS += ./mbed-os/features/mbedtls/src/certs.o +OBJECTS += ./mbed-os/features/mbedtls/src/cipher.o +OBJECTS += ./mbed-os/features/mbedtls/src/cipher_wrap.o +OBJECTS += ./mbed-os/features/mbedtls/src/cmac.o +OBJECTS += ./mbed-os/features/mbedtls/src/ctr_drbg.o +OBJECTS += ./mbed-os/features/mbedtls/src/debug.o +OBJECTS += ./mbed-os/features/mbedtls/src/des.o +OBJECTS += ./mbed-os/features/mbedtls/src/dhm.o +OBJECTS += ./mbed-os/features/mbedtls/src/ecdh.o +OBJECTS += ./mbed-os/features/mbedtls/src/ecdsa.o +OBJECTS += ./mbed-os/features/mbedtls/src/ecjpake.o +OBJECTS += ./mbed-os/features/mbedtls/src/ecp.o +OBJECTS += ./mbed-os/features/mbedtls/src/ecp_curves.o +OBJECTS += ./mbed-os/features/mbedtls/src/entropy.o +OBJECTS += ./mbed-os/features/mbedtls/src/entropy_poll.o +OBJECTS += ./mbed-os/features/mbedtls/src/error.o +OBJECTS += ./mbed-os/features/mbedtls/src/gcm.o +OBJECTS += ./mbed-os/features/mbedtls/src/havege.o +OBJECTS += ./mbed-os/features/mbedtls/src/hmac_drbg.o +OBJECTS += ./mbed-os/features/mbedtls/src/md.o +OBJECTS += ./mbed-os/features/mbedtls/src/md2.o +OBJECTS += ./mbed-os/features/mbedtls/src/md4.o +OBJECTS += ./mbed-os/features/mbedtls/src/md5.o +OBJECTS += ./mbed-os/features/mbedtls/src/md_wrap.o +OBJECTS += ./mbed-os/features/mbedtls/src/memory_buffer_alloc.o +OBJECTS += ./mbed-os/features/mbedtls/src/net_sockets.o +OBJECTS += ./mbed-os/features/mbedtls/src/oid.o +OBJECTS += ./mbed-os/features/mbedtls/src/padlock.o +OBJECTS += ./mbed-os/features/mbedtls/src/pem.o +OBJECTS += ./mbed-os/features/mbedtls/src/pk.o +OBJECTS += ./mbed-os/features/mbedtls/src/pk_wrap.o +OBJECTS += ./mbed-os/features/mbedtls/src/pkcs11.o +OBJECTS += ./mbed-os/features/mbedtls/src/pkcs12.o +OBJECTS += ./mbed-os/features/mbedtls/src/pkcs5.o +OBJECTS += ./mbed-os/features/mbedtls/src/pkparse.o +OBJECTS += ./mbed-os/features/mbedtls/src/pkwrite.o +OBJECTS += ./mbed-os/features/mbedtls/src/platform.o +OBJECTS += ./mbed-os/features/mbedtls/src/ripemd160.o +OBJECTS += ./mbed-os/features/mbedtls/src/rsa.o +OBJECTS += ./mbed-os/features/mbedtls/src/sha1.o +OBJECTS += ./mbed-os/features/mbedtls/src/sha256.o +OBJECTS += ./mbed-os/features/mbedtls/src/sha512.o +OBJECTS += ./mbed-os/features/mbedtls/src/ssl_cache.o +OBJECTS += ./mbed-os/features/mbedtls/src/ssl_ciphersuites.o +OBJECTS += ./mbed-os/features/mbedtls/src/ssl_cli.o +OBJECTS += ./mbed-os/features/mbedtls/src/ssl_cookie.o +OBJECTS += ./mbed-os/features/mbedtls/src/ssl_srv.o +OBJECTS += ./mbed-os/features/mbedtls/src/ssl_ticket.o +OBJECTS += ./mbed-os/features/mbedtls/src/ssl_tls.o +OBJECTS += ./mbed-os/features/mbedtls/src/threading.o +OBJECTS += ./mbed-os/features/mbedtls/src/timing.o +OBJECTS += ./mbed-os/features/mbedtls/src/version.o +OBJECTS += ./mbed-os/features/mbedtls/src/version_features.o +OBJECTS += ./mbed-os/features/mbedtls/src/x509.o +OBJECTS += ./mbed-os/features/mbedtls/src/x509_create.o +OBJECTS += ./mbed-os/features/mbedtls/src/x509_crl.o +OBJECTS += ./mbed-os/features/mbedtls/src/x509_crt.o +OBJECTS += ./mbed-os/features/mbedtls/src/x509_csr.o +OBJECTS += ./mbed-os/features/mbedtls/src/x509write_crt.o +OBJECTS += ./mbed-os/features/mbedtls/src/x509write_csr.o +OBJECTS += ./mbed-os/features/mbedtls/src/xtea.o +OBJECTS += ./mbed-os/features/netsocket/NetworkInterface.o +OBJECTS += ./mbed-os/features/netsocket/NetworkStack.o +OBJECTS += ./mbed-os/features/netsocket/Socket.o +OBJECTS += ./mbed-os/features/netsocket/SocketAddress.o +OBJECTS += ./mbed-os/features/netsocket/TCPServer.o +OBJECTS += ./mbed-os/features/netsocket/TCPSocket.o +OBJECTS += ./mbed-os/features/netsocket/UDPSocket.o +OBJECTS += ./mbed-os/features/netsocket/WiFiAccessPoint.o +OBJECTS += ./mbed-os/features/netsocket/nsapi_dns.o +OBJECTS += ./mbed-os/hal/mbed_gpio.o +OBJECTS += ./mbed-os/hal/mbed_lp_ticker_api.o +OBJECTS += ./mbed-os/hal/mbed_pinmap_common.o +OBJECTS += ./mbed-os/hal/mbed_ticker_api.o +OBJECTS += ./mbed-os/hal/mbed_us_ticker_api.o +OBJECTS += ./mbed-os/platform/CallChain.o +OBJECTS += ./mbed-os/platform/mbed_alloc_wrappers.o +OBJECTS += ./mbed-os/platform/mbed_assert.o +OBJECTS += ./mbed-os/platform/mbed_board.o +OBJECTS += ./mbed-os/platform/mbed_critical.o +OBJECTS += ./mbed-os/platform/mbed_error.o +OBJECTS += ./mbed-os/platform/mbed_interface.o +OBJECTS += ./mbed-os/platform/mbed_mem_trace.o +OBJECTS += ./mbed-os/platform/mbed_rtc_time.o +OBJECTS += ./mbed-os/platform/mbed_semihost_api.o +OBJECTS += ./mbed-os/platform/mbed_stats.o +OBJECTS += ./mbed-os/platform/mbed_wait_api_no_rtos.o +OBJECTS += ./mbed-os/platform/mbed_wait_api_rtos.o +OBJECTS += ./mbed-os/platform/retarget.o +OBJECTS += ./mbed-os/rtos/Mutex.o +OBJECTS += ./mbed-os/rtos/RtosTimer.o +OBJECTS += ./mbed-os/rtos/Semaphore.o +OBJECTS += ./mbed-os/rtos/Thread.o +OBJECTS += ./mbed-os/rtos/rtos_idle.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/HAL_CM.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_GCC/HAL_CM4.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_GCC/SVC_Table.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_CMSIS.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_Event.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_List.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_Mailbox.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_MemBox.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_Memory.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_Mutex.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_OsEventObserver.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_Robin.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_Semaphore.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_System.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_Task.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_Time.o +OBJECTS += ./mbed-os/rtos/rtx/TARGET_CORTEX_M/rt_Timer.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/PeripheralPins.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/TARGET_MAX32630FTHR/low_level_init.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/analogin_api.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_GCC_ARM/startup_max3263x.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/device/system_max3263x.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/gpio_api.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/gpio_irq_api.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/i2c_api.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/adc.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/aes.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/clkman.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/crc.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/flc.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/gpio.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/i2cm.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/i2cs.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/icc.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/ioman.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/lp.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/maa.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/mxc_assert.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/mxc_sys.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/nvic_table.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/owm.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/pmu.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/prng.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/pt.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/rtc.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/spim.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/spix.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/tmr.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/tmr_utils.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/uart.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/wdt.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc/wdt2.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/pinmap.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/port_api.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/pwmout_api.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/rtc_api.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/serial_api.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/sleep.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/spi_api.o +OBJECTS += ./mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/us_ticker.o + +INCLUDE_PATHS += -I../ +INCLUDE_PATHS += -I../. +INCLUDE_PATHS += -I.././USBDevice +INCLUDE_PATHS += -I.././USBDevice/USBAudio +INCLUDE_PATHS += -I.././USBDevice/USBDevice +INCLUDE_PATHS += -I.././USBDevice/USBHID +INCLUDE_PATHS += -I.././USBDevice/USBMIDI +INCLUDE_PATHS += -I.././USBDevice/USBMSD +INCLUDE_PATHS += -I.././USBDevice/USBSerial +INCLUDE_PATHS += -I.././max32630fthr +INCLUDE_PATHS += -I.././max32630fthr/MAX14690 +INCLUDE_PATHS += -I.././mbed-os +INCLUDE_PATHS += -I.././mbed-os/cmsis +INCLUDE_PATHS += -I.././mbed-os/cmsis/TOOLCHAIN_GCC +INCLUDE_PATHS += -I.././mbed-os/docs +INCLUDE_PATHS += -I.././mbed-os/drivers +INCLUDE_PATHS += -I.././mbed-os/events +INCLUDE_PATHS += -I.././mbed-os/events/equeue +INCLUDE_PATHS += -I.././mbed-os/features +INCLUDE_PATHS += -I.././mbed-os/features/frameworks +INCLUDE_PATHS += -I.././mbed-os/features/frameworks/greentea-client +INCLUDE_PATHS += -I.././mbed-os/features/frameworks/greentea-client/greentea-client +INCLUDE_PATHS += -I.././mbed-os/features/frameworks/greentea-client/source +INCLUDE_PATHS += -I.././mbed-os/features/frameworks/unity +INCLUDE_PATHS += -I.././mbed-os/features/frameworks/unity/source +INCLUDE_PATHS += -I.././mbed-os/features/frameworks/unity/unity +INCLUDE_PATHS += -I.././mbed-os/features/frameworks/utest +INCLUDE_PATHS += -I.././mbed-os/features/frameworks/utest/source +INCLUDE_PATHS += -I.././mbed-os/features/frameworks/utest/utest +INCLUDE_PATHS += -I.././mbed-os/features/mbedtls +INCLUDE_PATHS += -I.././mbed-os/features/mbedtls/importer +INCLUDE_PATHS += -I.././mbed-os/features/mbedtls/inc +INCLUDE_PATHS += -I.././mbed-os/features/mbedtls/inc/mbedtls +INCLUDE_PATHS += -I.././mbed-os/features/mbedtls/platform +INCLUDE_PATHS += -I.././mbed-os/features/mbedtls/platform/inc +INCLUDE_PATHS += -I.././mbed-os/features/mbedtls/platform/src +INCLUDE_PATHS += -I.././mbed-os/features/mbedtls/src +INCLUDE_PATHS += -I.././mbed-os/features/nanostack +INCLUDE_PATHS += -I.././mbed-os/features/netsocket +INCLUDE_PATHS += -I.././mbed-os/features/storage +INCLUDE_PATHS += -I.././mbed-os/hal +INCLUDE_PATHS += -I.././mbed-os/hal/storage_abstraction +INCLUDE_PATHS += -I.././mbed-os/platform +INCLUDE_PATHS += -I.././mbed-os/rtos +INCLUDE_PATHS += -I.././mbed-os/rtos/rtx +INCLUDE_PATHS += -I.././mbed-os/rtos/rtx/TARGET_CORTEX_M +INCLUDE_PATHS += -I.././mbed-os/rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7 +INCLUDE_PATHS += -I.././mbed-os/rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_GCC +INCLUDE_PATHS += -I.././mbed-os/targets +INCLUDE_PATHS += -I.././mbed-os/targets/TARGET_Maxim +INCLUDE_PATHS += -I.././mbed-os/targets/TARGET_Maxim/TARGET_MAX32630 +INCLUDE_PATHS += -I.././mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/TARGET_MAX32630FTHR +INCLUDE_PATHS += -I.././mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/device +INCLUDE_PATHS += -I.././mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_GCC_ARM +INCLUDE_PATHS += -I.././mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/mxc + + +LIBRARY_PATHS := +LIBRARIES := +LINKER_SCRIPT ?= .././mbed-os/targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_GCC_ARM/max3263x.ld + +# Objects and Paths +############################################################################### +# Tools and Flags + +AS = 'arm-none-eabi-gcc' '-x' 'assembler-with-cpp' '-c' '-Wall' '-Wextra' '-Wno-unused-parameter' '-Wno-missing-field-initializers' '-fmessage-length=0' '-fno-exceptions' '-fno-builtin' '-ffunction-sections' '-fdata-sections' '-funsigned-char' '-MMD' '-fno-delete-null-pointer-checks' '-fomit-frame-pointer' '-O0' '-g3' '-mcpu=cortex-m4' '-mthumb' '-mfpu=fpv4-sp-d16' '-mfloat-abi=softfp' +CC = 'arm-none-eabi-gcc' '-std=gnu99' '-c' '-Wall' '-Wextra' '-Wno-unused-parameter' '-Wno-missing-field-initializers' '-fmessage-length=0' '-fno-exceptions' '-fno-builtin' '-ffunction-sections' '-fdata-sections' '-funsigned-char' '-MMD' '-fno-delete-null-pointer-checks' '-fomit-frame-pointer' '-O0' '-g3' '-mcpu=cortex-m4' '-mthumb' '-mfpu=fpv4-sp-d16' '-mfloat-abi=softfp' +CPP = 'arm-none-eabi-g++' '-std=gnu++98' '-fno-rtti' '-Wvla' '-c' '-Wall' '-Wextra' '-Wno-unused-parameter' '-Wno-missing-field-initializers' '-fmessage-length=0' '-fno-exceptions' '-fno-builtin' '-ffunction-sections' '-fdata-sections' '-funsigned-char' '-MMD' '-fno-delete-null-pointer-checks' '-fomit-frame-pointer' '-O0' '-g3' '-mcpu=cortex-m4' '-mthumb' '-mfpu=fpv4-sp-d16' '-mfloat-abi=softfp' +LD = 'arm-none-eabi-gcc' '-Wl,--gc-sections' '-Wl,--wrap,main' '-Wl,--wrap,_malloc_r' '-Wl,--wrap,_free_r' '-Wl,--wrap,_realloc_r' '-Wl,--wrap,_calloc_r' '-Wl,--wrap,exit' '-Wl,--wrap,atexit' '-mcpu=cortex-m4' '-mthumb' '-mfpu=fpv4-sp-d16' '-mfloat-abi=softfp' +ELF2BIN = 'arm-none-eabi-objcopy' + + +C_FLAGS += -std=gnu99 +C_FLAGS += -D__MBED__=1 +C_FLAGS += -DTARGET_LIKE_MBED +C_FLAGS += -DDEVICE_PORTINOUT=1 +C_FLAGS += -DTARGET_RTOS_M4_M7 +C_FLAGS += -DTARGET_MAX32630 +C_FLAGS += -DDEVICE_LOWPOWERTIMER=1 +C_FLAGS += -DDEVICE_RTC=1 +C_FLAGS += -DTOOLCHAIN_object +C_FLAGS += -D__CMSIS_RTOS +C_FLAGS += -DTARGET_MAX32630FTHR +C_FLAGS += -DMBED_BUILD_TIMESTAMP=1502162337.63 +C_FLAGS += -DTOOLCHAIN_GCC +C_FLAGS += -DTARGET_REV=0x4132 +C_FLAGS += -DTARGET_CORTEX_M +C_FLAGS += -DTARGET_DEBUG +C_FLAGS += -DTARGET_LIKE_CORTEX_M4 +C_FLAGS += -DTARGET_M4 +C_FLAGS += -DTARGET_UVISOR_UNSUPPORTED +C_FLAGS += -DDEVICE_ANALOGIN=1 +C_FLAGS += -DTARGET_Maxim +C_FLAGS += -DDEVICE_SERIAL=1 +C_FLAGS += -DDEVICE_INTERRUPTIN=1 +C_FLAGS += -DDEVICE_I2C=1 +C_FLAGS += -DDEVICE_PORTOUT=1 +C_FLAGS += -D__CORTEX_M4 +C_FLAGS += -DDEVICE_STDIO_MESSAGES=1 +C_FLAGS += -D__FPU_PRESENT=1 +C_FLAGS += -DDEVICE_PORTIN=1 +C_FLAGS += -D__SYSTEM_HFX=96000000 +C_FLAGS += -DDEVICE_SERIAL_FC=1 +C_FLAGS += -D__MBED_CMSIS_RTOS_CM +C_FLAGS += -DDEVICE_SLEEP=1 +C_FLAGS += -DTOOLCHAIN_GCC_ARM +C_FLAGS += -DDEVICE_SPI=1 +C_FLAGS += -DDEVICE_ERROR_RED=1 +C_FLAGS += -DTARGET=MAX32630 +C_FLAGS += -DDEVICE_PWMOUT=1 +C_FLAGS += -DARM_MATH_CM4 +C_FLAGS += -include +C_FLAGS += mbed_config.h + +CXX_FLAGS += -std=gnu++98 +CXX_FLAGS += -fno-rtti +CXX_FLAGS += -Wvla +CXX_FLAGS += -D__MBED__=1 +CXX_FLAGS += -DTARGET_LIKE_MBED +CXX_FLAGS += -DDEVICE_PORTINOUT=1 +CXX_FLAGS += -DTARGET_RTOS_M4_M7 +CXX_FLAGS += -DTARGET_MAX32630 +CXX_FLAGS += -DDEVICE_LOWPOWERTIMER=1 +CXX_FLAGS += -DDEVICE_RTC=1 +CXX_FLAGS += -DTOOLCHAIN_object +CXX_FLAGS += -D__CMSIS_RTOS +CXX_FLAGS += -DTARGET_MAX32630FTHR +CXX_FLAGS += -DMBED_BUILD_TIMESTAMP=1502162337.63 +CXX_FLAGS += -DTOOLCHAIN_GCC +CXX_FLAGS += -DTARGET_REV=0x4132 +CXX_FLAGS += -DTARGET_CORTEX_M +CXX_FLAGS += -DTARGET_DEBUG +CXX_FLAGS += -DTARGET_LIKE_CORTEX_M4 +CXX_FLAGS += -DTARGET_M4 +CXX_FLAGS += -DTARGET_UVISOR_UNSUPPORTED +CXX_FLAGS += -DDEVICE_ANALOGIN=1 +CXX_FLAGS += -DTARGET_Maxim +CXX_FLAGS += -DDEVICE_SERIAL=1 +CXX_FLAGS += -DDEVICE_INTERRUPTIN=1 +CXX_FLAGS += -DDEVICE_I2C=1 +CXX_FLAGS += -DDEVICE_PORTOUT=1 +CXX_FLAGS += -D__CORTEX_M4 +CXX_FLAGS += -DDEVICE_STDIO_MESSAGES=1 +CXX_FLAGS += -D__FPU_PRESENT=1 +CXX_FLAGS += -DDEVICE_PORTIN=1 +CXX_FLAGS += -D__SYSTEM_HFX=96000000 +CXX_FLAGS += -DDEVICE_SERIAL_FC=1 +CXX_FLAGS += -D__MBED_CMSIS_RTOS_CM +CXX_FLAGS += -DDEVICE_SLEEP=1 +CXX_FLAGS += -DTOOLCHAIN_GCC_ARM +CXX_FLAGS += -DDEVICE_SPI=1 +CXX_FLAGS += -DDEVICE_ERROR_RED=1 +CXX_FLAGS += -DTARGET=MAX32630 +CXX_FLAGS += -DDEVICE_PWMOUT=1 +CXX_FLAGS += -DARM_MATH_CM4 +CXX_FLAGS += -include +CXX_FLAGS += mbed_config.h + +ASM_FLAGS += -x +ASM_FLAGS += assembler-with-cpp +ASM_FLAGS += -D__SYSTEM_HFX=96000000 +ASM_FLAGS += -D__CORTEX_M4 +ASM_FLAGS += -DTARGET_REV=0x4132 +ASM_FLAGS += -DARM_MATH_CM4 +ASM_FLAGS += -D__FPU_PRESENT=1 +ASM_FLAGS += -D__MBED_CMSIS_RTOS_CM +ASM_FLAGS += -DTARGET=MAX32630 +ASM_FLAGS += -D__CMSIS_RTOS + + +LD_FLAGS :=-Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp +LD_SYS_LIBS :=-Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group + +# Tools and Flags +############################################################################### +# Rules + +include ../max32630fthr-mbed.mk + +.PHONY: all lst size + + +all: $(PROJECT).bin $(PROJECT).hex size + + +.asm.o: + +@$(call MAKEDIR,$(dir $@)) + +@echo "Assemble: $(notdir $<)" + @$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $< + +.s.o: + +@$(call MAKEDIR,$(dir $@)) + +@echo "Assemble: $(notdir $<)" + @$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $< + +.S.o: + +@$(call MAKEDIR,$(dir $@)) + +@echo "Assemble: $(notdir $<)" + @$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $< + +.c.o: + +@$(call MAKEDIR,$(dir $@)) + @$(info MAKEDIR - $(dir $@) - VPATH: $(VPATH): $<: ($<)) + +@echo "Compile: $(notdir $<)" + @$(CC) $(C_FLAGS) $(INCLUDE_PATHS) -o $@ $< + +.cpp.o: + +@$(call MAKEDIR,$(dir $@)) + +@echo "Compile: $(notdir $<)" + @$(CPP) $(CXX_FLAGS) $(INCLUDE_PATHS) -o $@ $< + + +$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) $(LINKER_SCRIPT) + +@echo "link: $(notdir $@)" + @$(LD) $(LD_FLAGS) -T $(filter %.ld, $^) $(LIBRARY_PATHS) --output $@ $(filter %.o, $^) $(LIBRARIES) $(LD_SYS_LIBS) + + +$(PROJECT).bin: $(PROJECT).elf + $(ELF2BIN) -O binary $< $@ + +@echo "===== bin file ready to flash: $(OBJDIR)/$@ =====" + +$(PROJECT).hex: $(PROJECT).elf + $(ELF2BIN) -O ihex $< $@ + + +# Rules +############################################################################### +# Dependencies + +DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d) +-include $(DEPS) +endif + +# Dependencies +############################################################################### diff --git a/port/max32630-fthr-mbed/Makefile.old b/port/max32630-fthr-mbed/Makefile.old new file mode 100644 index 0000000000..61a73d8d95 --- /dev/null +++ b/port/max32630-fthr-mbed/Makefile.old @@ -0,0 +1,11 @@ +.phony: examples +all: examples + +examples: + scripts/create_examples.py + +clean: + scripts/delete_examples.py + @rm -rf example/Makefile + @echo "Deleting CC2564B Init Script in src folder" + @rm -rf src/cc256x* bluetooth_init* diff --git a/port/max32630-fthr-mbed/README.md b/port/max32630-fthr-mbed/README.md new file mode 100644 index 0000000000..9331c06f69 --- /dev/null +++ b/port/max32630-fthr-mbed/README.md @@ -0,0 +1,75 @@ +# BTStack Max32630 MBED notes + +Please note that the development is not completed yet. MBED related initializetion fails. + +Makefile is autogenerated and then included max32630fthr-mbed.mk file to in order to do minimal changes in the generated Makefile. + +Download library source code from mbed repository + $ mbed deploy + +Build the source code + $ make + +Build mbed code withing the folder. Please note that the following command does build source code in max32630-fthr-mbed directory only, does not build btstack. + $ mbed compile -m MAX32630FTHR -t GCC_ARM + + +----------------------------------------------------------------------------- + +# BTstack Port for the Maxim MAX32630FTHR ARM Cortex-M4F + +This port uses the [MAX32630FTHR ARM Cortex M4F Board](https://www.maximintegrated.com/en/products/digital/microcontrollers/MAX32630FTHR.html) with the onboard TI CC2564B Bluetooth controller. It usually comes with the [DAPLINK Programming Adapter](https://developer.mbed.org/teams/MaximIntegrated/wiki/MAXREFDES100HDK). +The DAPLINK allows to upload firmware via a virtual mass storage device (like mbed), provides a virtual COM port for a console, and enables debugging via the SWD interface via OpenOCD. + +The port uses non-blocking polling UART communication with hardware flow control for Bluetooth controller. It was tested and achieved up to 1.8 Mbps bandwidth between two Max32630FTHR boards. + +## Software + +The [Maxim ARM Toolchain](https://www.maximintegrated.com/en/products/digital/microcontrollers/MAX32630.html/tb_tab2) is free software that provides peripheral libraries, linker files, initial code and some board files. It also provides Eclipse Neon and Maxim modified OpenOCD to program the microcontroller together with various examples for Maxim Cortex M4F ARM processors. + +For debugging, OpenOCD can be used. The regular OpenOCD does not support Maxim ARM microcontrollers yet, but a modified OpenOCD for use with Maxim devices can be found in the Maxim ARM Toolchain. + +## Toolchain Setup + +In the Maxim Toolchain installation directory, there is a setenv.sh file that sets the MAXIM_PATH. MAXIM_PATH needs to point to the root directory where the tool chain installed. If you're lucky and have a compatible ARM GCC Toolchain in your PATH, it might work without calling setenv.sh script. + +## Usage + +The examples can be compiled using GNU ARM Toolchain. A firmware binary can be flashed either by copying the .bin file to the DAPLINK mass storage drive, or by using OpenOCD on the command line, or from Eclipse CDT. + +## Build + +Checkt that MAXIM_PATH points to the root directory where the tool chain installed. +Then, go to the port/max32630-fthr folder and run "make" command in terminal to generate example projects in the example folder. + +In each example folder, e.g. port/max323630-fthr/example/spp_and_le_streamer, you can run "make" again to build an .elf file in the build folder which is convenient for debugging using Eclipse or GDB. + +For flashing via the virtual USB drive, the "make release" command will generate .bin file in the build folder. + +## Eclipse + +Toolchain and Eclipse guide can be found in README.pdf file where the Maxim Toolchain is installed. Please note that this port was done using Makefiles. + +## Flashing Max32630 ARM Processor + +There are two ways to program the board. The simplest way is drag and drop the generated .bin file to the DAPLINK mass storage drive. Once the file is copied to the mass storage device, the DAPLINK should program and then run the new firmware. + +Alternatively, OpenOCD can be used to flash and debug the device. A suitable programming script can be found in the scripts folder. + +## Debugging + +OpenOCD can also be used for developing and especially for debugging. Eclipse or GDB via OpenOCD could be used for step by step debugging. + +## Debug output + +printf messages are redirected to UART2. UART2 is accessible via the DAPLINK Programming Adapter as a virtual COM port at 115200 baud with no flow control. If this doesn't work for you, you can connect P3_1 (UART TX) of the MAX32630FTHR board to a USB-to-UART adapter. + +Additional debug information can be enabled by uncommenting ENABLE_LOG_INFO in the src/btstack_config.h header file and a clean rebuild. + +## TODOs + - Support for BTSTACK_STDIN + - Add flash-openocd to Makefile template + - Implement BTstack Flash interface to support link key storage in flash memory. + - Add Eclipse CDT projects for max32630fthr + - Implement hal_led.h to control LED on board + diff --git a/port/max32630-fthr-mbed/USBDevice.lib b/port/max32630-fthr-mbed/USBDevice.lib new file mode 100644 index 0000000000..b6e22c8e7c --- /dev/null +++ b/port/max32630-fthr-mbed/USBDevice.lib @@ -0,0 +1 @@ +https://developer.mbed.org/teams/MaximIntegrated/code/USBDevice/#c5e178adb138 diff --git a/port/max32630-fthr-mbed/main.cpp b/port/max32630-fthr-mbed/main.cpp new file mode 100644 index 0000000000..a9ef7e1b5d --- /dev/null +++ b/port/max32630-fthr-mbed/main.cpp @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. + * Author: Ismail H. Kose + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Maxim Integrated + * Products, Inc. shall not be used except as stated in the Maxim Integrated + * Products, Inc. Branding Policy. + * + * The mere transfer of this software does not imply any licenses + * of trade secrets, proprietary technology, copyrights, patents, + * trademarks, maskwork rights, or any other form of intellectual + * property whatsoever. Maxim Integrated Products, Inc. retains all + * ownership rights. + * + ******************************************************************************/ + +/** + * @file main.c + * @brief Max32630 CC2564B btstack Example + */ + +#include "mbed.h" +#include "max32630fthr.h" +#include "USBSerial.h" +#include "btstack_config.h" +#include "btstack_port.h" +#include "btstack.h" + +MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3); + +// Hardware serial port over DAPLink +//Serial daplink(P2_1, P2_0, 115200); + +// Virtual serial port over USB +//USBSerial microUSB; + +DigitalOut rLED(LED1); +DigitalOut gLED(LED2); +DigitalOut bLED(LED3); + +// main() runs in its own thread in the OS +// (note the calls to Thread::wait below for delays) +int main() +{ + int c; + + printf("max32630fthr btstack example\r\n"); +// daplink.printf("max32630fthr btstack - daplink serial port\r\n"); + //microUSB.printf("max32630fthr btstack example on micro USB serial port\r\n"); + rLED = LED_ON; + gLED = LED_ON; + bLED = LED_OFF; + + rLED = LED_OFF; + printf("%s:%d - \r\n", __func__, __LINE__); + bluetooth_main(); + + printf("###### %s:%d - \r\n", __func__, __LINE__); + while(1); + + while(1) { + // c = microUSB.getc(); + // microUSB.putc(c); + //daplink.putc(c); + //bLED = c & 1; + hal_btstack_run_loop_execute_once(); + printf("%s:%d - \r\n", __func__, __LINE__); + } +} + diff --git a/port/max32630-fthr-mbed/max32630fthr-mbed.mk b/port/max32630-fthr-mbed/max32630fthr-mbed.mk new file mode 100644 index 0000000000..3421c2b43c --- /dev/null +++ b/port/max32630-fthr-mbed/max32630fthr-mbed.mk @@ -0,0 +1,68 @@ +BTSTACK_ROOT = ./ + +VPATH += . +VPATH += $(abspath ../../../../btstack) + +BTSTACK_CORE_OBJ = \ + $(BTSTACK_ROOT)/src/ad_parser.o \ + $(BTSTACK_ROOT)/src/btstack_linked_list.o \ + $(BTSTACK_ROOT)/src/btstack_memory.o \ + $(BTSTACK_ROOT)/src/btstack_memory_pool.o \ + $(BTSTACK_ROOT)/src/btstack_run_loop.o \ + $(BTSTACK_ROOT)/src/btstack_util.o \ + $(BTSTACK_ROOT)/src/l2cap.o \ + $(BTSTACK_ROOT)/src/hci_transport_h4.o \ + $(BTSTACK_ROOT)/src/l2cap_signaling.o \ + $(BTSTACK_ROOT)/platform/embedded/btstack_run_loop_embedded.o \ + src/initscripts-TIInit_6.7.16_bt_spec_4.1.o \ + src/btstack_port.o \ + src/hal_tick.o \ + src/spp_counter.o + +BTSTACK_COMMON_OBJ = \ + $(BTSTACK_ROOT)/chipset/cc256x/btstack_chipset_cc256x.o \ + $(BTSTACK_ROOT)/src/hci.o \ + $(BTSTACK_ROOT)/src/hci_cmd.o \ + $(BTSTACK_ROOT)/src/hci_dump.o \ + $(BTSTACK_ROOT)/platform/embedded/btstack_uart_block_embedded.o + +BTSTACK_CLASSIC_OBJ = \ + $(BTSTACK_ROOT)/src/classic/rfcomm.o \ + $(BTSTACK_ROOT)/src/classic/sdp_util.o \ + $(BTSTACK_ROOT)/src/classic/spp_server.o \ + $(BTSTACK_ROOT)/src/classic/sdp_server.o \ + $(BTSTACK_ROOT)/src/classic/sdp_client.o \ + $(BTSTACK_ROOT)/src/classic/sdp_client_rfcomm.o + +BTSTACK_BLE_OBJ = \ + $(BTSTACK_ROOT)/src/ble/att_db.o \ + $(BTSTACK_ROOT)/src/ble/att_server.o \ + $(BTSTACK_ROOT)/src/ble/le_device_db_memory.o \ + $(BTSTACK_ROOT)/src/ble/att_dispatch.o \ + $(BTSTACK_ROOT)/src/ble/sm.o + + +BTSTACK_OBJ = $(BTSTACK_CORE_OBJ) +BTSTACK_OBJ += $(BTSTACK_COMMON_OBJ) +BTSTACK_OBJ += $(BTSTACK_CLASSIC_OBJ) +BTSTACK_OBJ += $(BTSTACK_BLE_OBJ) + +OBJECTS += $(BTSTACK_OBJ) + +BTSTACK_INC_ROOT = ../../.. + +INCLUDE_PATHS += $(BTSTACK_INC) +INCLUDE_PATHS += \ + -I$(BTSTACK_INC_ROOT)/src \ + -I$(BTSTACK_INC_ROOT)/src/ble \ + -I$(BTSTACK_INC_ROOT)/src/classic \ + -I$(BTSTACK_INC_ROOT)/chipset/cc256x \ + -I$(BTSTACK_INC_ROOT)/platform/embedded \ + -I${BTSTACK_INC_ROOT}/src/ble/gatt-service/ \ + -I${BTSTACK_INC_ROOT}/port/max32630-fthr-mbed/ \ + -I${BTSTACK_INC_ROOT}/port/max32630-fthr-mbed/src + +C_FLAGS += -g3 -ggdb -DDEBUG +C_FLAGS += -g3 -ggdb -D__STACK_SIZE=0X30000 +CXX_FLAGS += -g3 -ggdb -DDEBUG + diff --git a/port/max32630-fthr-mbed/max32630fthr.lib b/port/max32630-fthr-mbed/max32630fthr.lib new file mode 100644 index 0000000000..7ccdfaec3d --- /dev/null +++ b/port/max32630-fthr-mbed/max32630fthr.lib @@ -0,0 +1 @@ +http://developer.mbed.org/teams/MaximIntegrated/code/max32630fthr/#60997adf01a2 diff --git a/port/max32630-fthr-mbed/mbed-os.lib b/port/max32630-fthr-mbed/mbed-os.lib new file mode 100644 index 0000000000..71dc0c9456 --- /dev/null +++ b/port/max32630-fthr-mbed/mbed-os.lib @@ -0,0 +1 @@ +https://github.com/ARMmbed/mbed-os/#269f58d75b752a4e67a6a2d8c5c698635ffd6752 diff --git a/port/max32630-fthr-mbed/mbed_config.h b/port/max32630-fthr-mbed/mbed_config.h new file mode 100644 index 0000000000..b4358f120f --- /dev/null +++ b/port/max32630-fthr-mbed/mbed_config.h @@ -0,0 +1,18 @@ +// Automatically generated configuration file. +// DO NOT EDIT, content will be overwritten. + +#ifndef __MBED_CONFIG_DATA__ +#define __MBED_CONFIG_DATA__ + +// Configuration parameters +#define MBED_CONF_EVENTS_PRESENT 1 // set by library:events +#define MBED_CONF_RTOS_PRESENT 1 // set by library:rtos +#define MBED_CONF_PLATFORM_STDIO_BAUD_RATE 115200 // set by library:platform +#define MBED_CONF_NSAPI_PRESENT 1 // set by library:nsapi +#define MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE 115200 // set by library:platform +#define MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT 1 // set by library:platform +#define MBED_CONF_PLATFORM_STDIO_CONVERT_NEWLINES 1 // set by library:platform +// Macros +#define UNITY_INCLUDE_CONFIG_H // defined by library:utest + +#endif diff --git a/port/max32630-fthr-mbed/scripts/create_examples.py b/port/max32630-fthr-mbed/scripts/create_examples.py new file mode 100755 index 0000000000..ec9d9ca5fc --- /dev/null +++ b/port/max32630-fthr-mbed/scripts/create_examples.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python +# +# Create project files for all BTstack embedded examples in WICED/apps/btstack + +import os +import re +import shutil +import subprocess +import sys + +# build all template +build_all = ''' +SUBDIRS = \\ +%s + +all: +\techo Building all examples +\tfor dir in $(SUBDIRS); do \\ +\t$(MAKE) -C $$dir || exit 1; \\ +\tdone + +clean: +\techo Cleaning all ports +\tfor dir in $(SUBDIRS); do \\ +\t$(MAKE) -C $$dir clean; \\ +\tdone +''' + +# get script path +script_path = os.path.abspath(os.path.dirname(sys.argv[0])) + '/../' + +# get btstack root +btstack_root = script_path + '../../' + +## pick correct init script based on your hardware +# - init script for CC2564B +cc256x_init_script = 'bluetooth_init_cc2564B_1.6_BT_Spec_4.1.c' + +subprocess.call("make -f ../Makefile -C src " + cc256x_init_script, shell=True) + +# fetch init script +# print("Creating init script %s" % cc256x_init_script) +# make_template = 'make -f {BTSTACK_ROOT}chipset/cc256x/Makefile.inc -C {SCRIPT_PATH}src/ {INIT_SCRIPT} BTSTACK_ROOT={BTSTACK_ROOT}' +# make_command = make_template.format(BTSTACK_ROOT=btstack_root, SCRIPT_PATH=script_path, INIT_SCRIPT=cc256x_init_script) +# print(make_command) +# subprocess.call(make_command) + +# path to examples +examples_embedded = btstack_root + 'example/' + +# path to generated example projects +projects_path = script_path + "example/" + +# path to template +template_path = script_path + 'example/template/Makefile' + +print("Creating example projects:") + +# iterate over btstack examples +example_files = os.listdir(examples_embedded) + +examples = [] + +for file in example_files: + if not file.endswith(".c"): + continue + if file in ['panu_demo.c', 'sco_demo_util.c']: + continue + example = file[:-2] + examples.append(example) + + # create folder + project_folder = projects_path + example + "/" + if not os.path.exists(project_folder): + os.makedirs(project_folder) + + # check if .gatt file is present + gatt_path = examples_embedded + example + ".gatt" + gatt_h = "" + if os.path.exists(gatt_path): + gatt_h = example+'.h' + + # create makefile + with open(project_folder + 'Makefile', 'wt') as fout: + with open(template_path, 'rt') as fin: + for line in fin: + if 'PROJECT=spp_and_le_streamer' in line: + fout.write('PROJECT=%s\n' % example) + continue + if 'all: spp_and_le_streamer.h' in line: + if len(gatt_h): + fout.write("all: %s\n" % gatt_h) + continue + fout.write(line) + + print("- %s" % example) + +with open(projects_path+'Makefile', 'wt') as fout: + fout.write(build_all % ' \\\n'.join(examples)) + +print("Projects are ready for compile in example folder. See README for details.") diff --git a/port/max32630-fthr-mbed/scripts/delete_examples.py b/port/max32630-fthr-mbed/scripts/delete_examples.py new file mode 100755 index 0000000000..00bcf85db7 --- /dev/null +++ b/port/max32630-fthr-mbed/scripts/delete_examples.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python +# +# Delete project files for all BTstack embedded examples in local port/esp32 folder + +import os +import shutil +import sys +import time +import subprocess + +# get script path +script_path = os.path.abspath(os.path.dirname(sys.argv[0])) + +# path to examples +examples_embedded = script_path + "/../../../example/" + +# path to port/esp32 +apps_btstack = "example/" + +print("Deleting examples in local folder") + +# iterate over btstack examples +for file in os.listdir(examples_embedded): + if not file.endswith(".c"): + continue + example = file[:-2] + apps_folder = apps_btstack + example + "/" + if os.path.exists(apps_folder): + shutil.rmtree(apps_folder) + print("- %s" % example) + diff --git a/port/max32630-fthr-mbed/scripts/flash_Max32630_hdk.sh b/port/max32630-fthr-mbed/scripts/flash_Max32630_hdk.sh new file mode 100755 index 0000000000..d1b3983ac4 --- /dev/null +++ b/port/max32630-fthr-mbed/scripts/flash_Max32630_hdk.sh @@ -0,0 +1,3 @@ +file="./build/max3263x.elf" +openocd -f scripts/max3263x_hdk.cfg -c "program $file verify reset exit" + diff --git a/port/max32630-fthr-mbed/scripts/max32630.gdb b/port/max32630-fthr-mbed/scripts/max32630.gdb new file mode 100644 index 0000000000..bec4edbc69 --- /dev/null +++ b/port/max32630-fthr-mbed/scripts/max32630.gdb @@ -0,0 +1,33 @@ +define connect + set trace-commands on + set remotetimeout 1000000000 + set logging on + target remote localhost:3333 +end + +define reset + monitor reset halt + c +end + +define settings + # set unlimited string size while print + set print elements 0 +end + +define program + monitor reset halt + load build/max32630-fthr-mbed.elf + monitor reset halt +end + +connect +settings +program +b ../mbed-os/platform/retarget.cpp:251 +b _write +b src/btstack_port.cpp:415 +b ../src/spp_counter.c:262 +b mnt/sda1/work/sandbox/mbed_btstack_2/btstack/src/hci.c:2596 +c + diff --git a/port/max32630-fthr-mbed/scripts/max3263x_hdk.cfg b/port/max32630-fthr-mbed/scripts/max3263x_hdk.cfg new file mode 100755 index 0000000000..9b553b22c1 --- /dev/null +++ b/port/max32630-fthr-mbed/scripts/max3263x_hdk.cfg @@ -0,0 +1,25 @@ +# MAX3263x HDK CMSIS-DAP SWD firmware load script + +interface cmsis-dap + +# adapter speed +adapter_khz 2000 + +# reset pin configuration +reset_config srst_only + +# SWD DAP +swd newdap max32630 cpu -irlen 4 -irmask 0xf -ircapture 0x1 -expected-id 0x07f67197 -ignore-version + +# target configuration +target create max32630.cpu cortex_m -chain-position max32630.cpu +max32630.cpu configure -work-area-phys 0x20005000 -work-area-size 0x2000 + +# Config Command: flash bank name driver base size chip_width bus_width target [driver_options] +# flash bank maxim 0 0 +# max32630 flash base address 0x00000000 +# max32630 flash size 0x200000 (2MB) +# max32630 FLC base address 0x40002000 +# max32630 sector (page) size 0x2000 (8kB) +# max32630 clock speed 96 (MHz) +flash bank max32630.flash maxim 0x00000000 0x200000 0 0 max32630.cpu 0x40002000 0x2000 96 diff --git a/port/max32630-fthr-mbed/src/btstack_config.h b/port/max32630-fthr-mbed/src/btstack_config.h new file mode 100644 index 0000000000..c6fd0520c4 --- /dev/null +++ b/port/max32630-fthr-mbed/src/btstack_config.h @@ -0,0 +1,51 @@ +// Maxim Max32630FTHR Port +// +#ifndef __BTSTACK_CONFIG +#define __BTSTACK_CONFIG +#include +// Port related features +#define HAVE_INIT_SCRIPT +#define HAVE_EMBEDDED_TIME_MS +//#define HAVE_POSIX_TIME +//#define HAVE_MALLOC +// BTstack features that can be enabled + +#define ENABLE_BLE +#define ENABLE_CLASSIC + +#define ENABLE_LE_PERIPHERAL +#define ENABLE_LE_CENTRAL +//#define ENABLE_LOG_INTO_HCI_DUMP +#define ENABLE_LOG_DEBUG +#define ENABLE_LOG_ERROR +#define ENABLE_LOG_INFO +//#define ENABLE_SDP_DES_DUMP +//#define ENABLE_SDP_EXTRA_QUERIES +// #define ENABLE_LE_SECURE_CONNECTIONS + +// BTstack configuration. buffers, sizes, ... + +// BTstack configuration. buffers, sizes, ... +//#define HCI_INCOMING_PRE_BUFFER_SIZE 6 +#define HCI_ACL_PAYLOAD_SIZE 1021 + +#define MAX_SPP_CONNECTIONS 1 +#define MAX_NR_HCI_CONNECTIONS MAX_SPP_CONNECTIONS +#define MAX_NR_GATT_CLIENTS 0 +#define MAX_NR_GATT_SUBCLIENTS 0 +#define MAX_NR_HFP_CONNECTIONS 0 +#define MAX_NR_L2CAP_SERVICES 2 +#define MAX_NR_L2CAP_CHANNELS (1+MAX_SPP_CONNECTIONS) +#define MAX_NR_RFCOMM_MULTIPLEXERS MAX_SPP_CONNECTIONS +#define MAX_NR_RFCOMM_SERVICES 1 +#define MAX_NR_RFCOMM_CHANNELS MAX_SPP_CONNECTIONS +#define MAX_NR_BNEP_SERVICES 1 +#define MAX_NR_BNEP_CHANNELS MAX_SPP_CONNECTIONS +#define MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES 2 +#define MAX_NR_WHITELIST_ENTRIES 1 +#define MAX_NR_SM_LOOKUP_ENTRIES 3 +#define MAX_NR_SERVICE_RECORD_ITEMS 1 + +#define MAX_NR_LE_DEVICE_DB_ENTRIES 1 + +#endif diff --git a/port/max32630-fthr-mbed/src/btstack_port.cpp b/port/max32630-fthr-mbed/src/btstack_port.cpp new file mode 100644 index 0000000000..8e96e2cc71 --- /dev/null +++ b/port/max32630-fthr-mbed/src/btstack_port.cpp @@ -0,0 +1,360 @@ +/******************************************************************************* +* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. +* Author: Ismail H. Kose +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES +* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Except as contained in this notice, the name of Maxim Integrated +* Products, Inc. shall not be used except as stated in the Maxim Integrated +* Products, Inc. Branding Policy. +* +* The mere transfer of this software does not imply any licenses +* of trade secrets, proprietary technology, copyrights, patents, +* trademarks, maskwork rights, or any other form of intellectual +* property whatsoever. Maxim Integrated Products, Inc. retains all +* ownership rights. +******************************************************************************* +*/ + +#include +#include +#include "lp.h" +#include "uart.h" +#include "btstack_debug.h" + +#include "btstack.h" +#include "btstack_config.h" +#include "btstack_run_loop_embedded.h" +#include "btstack_chipset_cc256x.h" +#include "hal_tick.h" +#include "btstack_port.h" +#include "hal_uart_dma.h" +#include "hal_time_ms.h" +#include "hal_cpu.h" +#include "hal_led.h" + +#define CC256X_UART_ID 0 +#define UART_RXFIFO_USABLE (MXC_UART_FIFO_DEPTH-3) + +static uint32_t baud_rate; + +// rx state +static int bytes_to_read = 0; +static uint8_t * rx_buffer_ptr = 0; + +// tx state +static int bytes_to_write = 0; +static uint8_t * tx_buffer_ptr = 0; + +const gpio_cfg_t PAN1326_SLOW_CLK = { PORT_1, PIN_7, GPIO_FUNC_GPIO, + GPIO_PAD_NORMAL }; +const gpio_cfg_t PAN1326_nSHUTD = { PORT_1, PIN_6, GPIO_FUNC_GPIO, + GPIO_PAD_NORMAL }; +const gpio_cfg_t PAN1326_HCIRTS = { PORT_0, PIN_3, GPIO_FUNC_GPIO, + GPIO_PAD_NORMAL }; + +static void dummy_handler(void) {}; +static void (*rx_done_handler)(void) = dummy_handler; +static void (*tx_done_handler)(void) = dummy_handler; + +void hal_cpu_disable_irqs(void) +{ + __disable_irq(); +} + +void hal_cpu_enable_irqs(void) +{ + __enable_irq(); +} +void hal_cpu_enable_irqs_and_sleep(void) +{ + +} + +void hal_uart_dma_send_block(const uint8_t *buffer, uint16_t len) +{ + tx_buffer_ptr = (uint8_t *)buffer; + bytes_to_write = len; +} + +void hal_uart_dma_receive_block(uint8_t *buffer, uint16_t len) +{ + rx_buffer_ptr = buffer; + bytes_to_read = len; +} + +void hal_btstack_run_loop_execute_once(void) +{ + int rx_avail; + int num_rx_bytes; + int tx_avail; + int rx_bytes; + int tx_bytes; + int ret; + + while (bytes_to_read) { + rx_avail = UART_NumReadAvail(MXC_UART_GET_UART(CC256X_UART_ID)); + if (!rx_avail) + break; + + if (bytes_to_read > rx_avail) + num_rx_bytes = rx_avail; + else + num_rx_bytes = bytes_to_read; + + ret = UART_Read(MXC_UART_GET_UART(CC256X_UART_ID), rx_buffer_ptr, num_rx_bytes, &rx_bytes); + if (ret < 0) + break; + + rx_buffer_ptr += rx_bytes; + bytes_to_read -= rx_bytes; + + if (bytes_to_read < 0) { + bytes_to_read = 0; + } + + if (bytes_to_read == 0){ + (*rx_done_handler)(); + } + } + + while (bytes_to_write) { + tx_avail = UART_NumWriteAvail(MXC_UART_GET_UART(CC256X_UART_ID)); + if (!tx_avail) + break; + + if (bytes_to_write > tx_avail) + tx_bytes = tx_avail; + else + tx_bytes = bytes_to_write; + + ret = UART_Write(MXC_UART_GET_UART(CC256X_UART_ID), tx_buffer_ptr, tx_bytes); + if (ret < 0) + break; + bytes_to_write -= tx_bytes; + tx_buffer_ptr += tx_bytes; + if (bytes_to_write < 0) { + bytes_to_write = 0; + } + + if (bytes_to_write == 0){ + (*tx_done_handler)(); + } + } + + btstack_run_loop_embedded_execute_once(); +} + + +#include "mbed.h" + +#define MAX32630_UART0_TX P0_1 +#define MAX32630_UART0_RX P0_0 +#define MAX32630_UART0_CTS P0_2 +#define MAX32630_UART0_RTS P0_3 + +#define MAX32630_CC2564B_RESET P1_6 +#define MAX32630_CC2564B_CLK P1_7 + +#define CC2564B_DEFAULT_BAUDRATE 115200 + + +void uart_ioman_init(sys_cfg_uart_t &sys_cfg, + clkman_scale_t clk_scale, + uint8_t uart_num, + uint8_t io_map, + uint8_t cts_map, + uint8_t rts_map, + uint8_t io_req, + uint8_t cts_io_req, + uint8_t rts_io_req) +{ + sys_cfg.clk_scale = clk_scale; + sys_cfg.io_cfg.req_reg = (uint32_t*)((unsigned int)(&MXC_IOMAN->uart0_req) + (uart_num * 2*sizeof(uint32_t))); + sys_cfg.io_cfg.ack_reg = (uint32_t*)((unsigned int)(&MXC_IOMAN->uart0_ack) + (uart_num * 2*sizeof(uint32_t))); + + sys_cfg.io_cfg.req_val.uart.io_map = io_map; + sys_cfg.io_cfg.req_val.uart.cts_map = cts_map; + sys_cfg.io_cfg.req_val.uart.rts_map = rts_map; + sys_cfg.io_cfg.req_val.uart.io_req = io_req; + sys_cfg.io_cfg.req_val.uart.cts_io_req = cts_io_req; + sys_cfg.io_cfg.req_val.uart.rts_io_req = rts_io_req; +} + +void uart_cfg_init(uart_cfg_t &cfg, + uint8_t extra_stop, + uint8_t cts, + uint8_t rts, + uint32_t baud, + uart_data_size_t size, + uart_parity_t parity) +{ + cfg.parity = parity; + cfg.size = size; + cfg.extra_stop = extra_stop; + cfg.cts = cts; + cfg.rts = rts; + + cfg.baud = baud; +} + +void hal_uart_init(void) +{ + int error = 0; + uart_cfg_t cfg; + sys_cfg_uart_t sys_cfg; + + uart_cfg_init(cfg, 0, 1, 1, baud_rate, UART_DATA_SIZE_8_BITS, UART_PARITY_DISABLE); + + uart_ioman_init(sys_cfg, CLKMAN_SCALE_AUTO, + CC256X_UART_ID, // Uart Port + IOMAN_MAP_B, // io_map + IOMAN_MAP_B, // cts_map + IOMAN_MAP_B, // rts_map + 1, // io_en + 1, // cts_en + 1); //rts_en + + //hal_uart_init_mbed(); + printf("%s:%d - \r\n", __func__, __LINE__); + + if ((error = UART_Init(MXC_UART_GET_UART(CC256X_UART_ID), &cfg, &sys_cfg)) != E_NO_ERROR) { + printf("Error initializing UART %d\n", error); + while (1); + } else { + printf("BTSTACK UART Initialized\n"); + } + + //printf("%s:%d - \r\n", __func__, __LINE__); + MXC_UART_GET_UART(CC256X_UART_ID)->ctrl |= MXC_F_UART_CTRL_CTS_POLARITY | MXC_F_UART_CTRL_RTS_POLARITY; + MXC_UART_GET_UART(CC256X_UART_ID)->ctrl &= ~((MXC_UART_FIFO_DEPTH - 4) << (MXC_F_UART_CTRL_RTS_LEVEL_POS)); + MXC_UART_GET_UART(CC256X_UART_ID)->ctrl |= ((UART_RXFIFO_USABLE) << MXC_F_UART_CTRL_RTS_LEVEL_POS); + //printf("%s:%d - \r\n", __func__, __LINE__); +} + +int hal_uart_dma_set_baud(uint32_t baud){ + baud_rate = baud; + printf("BAUD RATE IS = %d \n", baud); + hal_uart_init(); + return baud_rate; +} + +void hal_uart_dma_init(void){ + bytes_to_write = 0; + bytes_to_read = 0; + hal_uart_dma_set_baud(115200); +} + + +void hal_uart_dma_set_block_received( void (*block_handler)(void)){ + rx_done_handler = block_handler; +} + +void hal_uart_dma_set_block_sent( void (*block_handler)(void)){ + + tx_done_handler = block_handler; +} + +void hal_uart_dma_set_csr_irq_handler( void (*csr_irq_handler)(void)){ + +} + +void hal_uart_dma_set_sleep(uint8_t sleep){ + +} + +void init_slow_clock(void) +{ + MXC_PWRSEQ->reg0 &= ~(MXC_F_PWRSEQ_REG0_PWR_RTCEN_RUN | MXC_F_PWRSEQ_REG0_PWR_RTCEN_SLP); + MXC_PWRSEQ->reg4 &= ~MXC_F_PWRSEQ_REG4_PWR_PSEQ_32K_EN; + MXC_PWRSEQ->reg0 |= MXC_F_PWRSEQ_REG0_PWR_RTCEN_RUN | MXC_F_PWRSEQ_REG0_PWR_RTCEN_SLP; // Enable RTC + hal_delay_us(1); + MXC_PWRSEQ->reg4 |= MXC_F_PWRSEQ_REG4_PWR_PSEQ_32K_EN; // Enable the RTC out of P1.7 +} + + +int bt_comm_init(void) { + int error = 0; + int cnt = 0; + + hal_tick_init(); + //hal_uart_init(); + //printf("%s:%d - \r\n", __func__, __LINE__); + hal_delay_us(1); + //printf("%s:%d - \r\n", __func__, __LINE__); + if ((error = GPIO_Config(&PAN1326_HCIRTS)) != E_NO_ERROR) { + printf("Error setting PAN1326_HCIRTS %d\n", error); + } + GPIO_OutSet(&PAN1326_HCIRTS); + init_slow_clock(); + /* + * when enabling the P1.7 RTC output, P1.6 will be hardcoded to an input with 25k pullup enabled. + * There is an internal pullup, so when it is set as an input, it will float high. + * The PAN1326B data sheet says the NSHUTD pin is pulled down, but the input impedance is stated at 1Meg Ohm, + * The so the 25k pullup should be enough to reach the minimum 1.42V to enable the device. + * */ + while (GPIO_InGet(&PAN1326_HCIRTS)) { + cnt++; + } + + printf("%s CC256X init completed. cnt: %d \n", __func__, cnt); + return 0; +} + +static hci_transport_config_uart_t config = { + HCI_TRANSPORT_CONFIG_UART, + 115200, + 4000000, + 1, // flow control + "max32630fthr", + }; + +void hal_led_off(void){ +} +void hal_led_on(void){ +} +void hal_led_toggle(void){ +} + +int bluetooth_main(void) +{ + bt_comm_init(); + /* BT Stack Initialization */ + btstack_memory_init(); + //printf("%s:%d - \r\n", __func__, __LINE__); + btstack_run_loop_init(btstack_run_loop_embedded_get_instance()); + + //log_info("%s:%d - \r\n", __func__, __LINE__); + /* Init HCI */ + const hci_transport_t * transport = hci_transport_h4_instance(btstack_uart_block_embedded_instance()); + const btstack_link_key_db_t *link_key_db = NULL; + + //log_info("%s:%d - \r\n", __func__, __LINE__); + hci_init(transport, &config); + //log_info("%s:%d - \r\n", __func__, __LINE__); + hci_set_link_key_db(link_key_db); + + //log_info("%s:%d - \r\n", __func__, __LINE__); + hci_set_chipset(btstack_chipset_cc256x_instance()); + //log_info("%s:%d - \r\n", __func__, __LINE__); + btstack_main(0, (const char **)NULL); + + //log_info("%s:%d - \r\n", __func__, __LINE__); + return 0; +} diff --git a/port/max32630-fthr-mbed/src/btstack_port.h b/port/max32630-fthr-mbed/src/btstack_port.h new file mode 100644 index 0000000000..2395f46aec --- /dev/null +++ b/port/max32630-fthr-mbed/src/btstack_port.h @@ -0,0 +1,50 @@ +/******************************************************************************* +* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. +* Author: Ismail H. Kose +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES +* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Except as contained in this notice, the name of Maxim Integrated +* Products, Inc. shall not be used except as stated in the Maxim Integrated +* Products, Inc. Branding Policy. +* +* The mere transfer of this software does not imply any licenses +* of trade secrets, proprietary technology, copyrights, patents, +* trademarks, maskwork rights, or any other form of intellectual +* property whatsoever. Maxim Integrated Products, Inc. retains all +* ownership rights. +******************************************************************************* +*/ + +#ifndef BTSTACK_MAX32630FTHR_PORT_H +#define BTSTACK_MAX32630FTHR_PORT_H + +#ifdef __cplusplus +extern "C" { +#endif + +int bluetooth_main(void); +void hal_btstack_run_loop_execute_once(void); +int btstack_main(int argc, const char * argv[]); +int bt_comm_init(void); +#ifdef __cplusplus +} +#endif + +#endif /* BTSTACK_MAX32630FTHR_PORT_H */ diff --git a/port/max32630-fthr-mbed/src/hal_tick.cpp b/port/max32630-fthr-mbed/src/hal_tick.cpp new file mode 100644 index 0000000000..3fe9e23136 --- /dev/null +++ b/port/max32630-fthr-mbed/src/hal_tick.cpp @@ -0,0 +1,60 @@ +/******************************************************************************* +* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. +* Author: Ismail H. Kose +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES +* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Except as contained in this notice, the name of Maxim Integrated +* Products, Inc. shall not be used except as stated in the Maxim Integrated +* Products, Inc. Branding Policy. +* +* The mere transfer of this software does not imply any licenses +* of trade secrets, proprietary technology, copyrights, patents, +* trademarks, maskwork rights, or any other form of intellectual +* property whatsoever. Maxim Integrated Products, Inc. retains all +* ownership rights. +******************************************************************************* +*/ + +#include +#include "mbed.h" +#include "hal_time_ms.h" + +Timer timer; + +int32_t hal_tick_init(void) +{ + timer.start(); + return 0; +} + +void hal_delay_ms(unsigned int ms) +{ + wait_ms(ms); +} + +void hal_delay_us(unsigned int us) +{ + wait_us(us); +} + +uint32_t hal_time_ms(void) +{ + return timer.read_ms(); +} diff --git a/port/max32630-fthr-mbed/src/hal_tick.h b/port/max32630-fthr-mbed/src/hal_tick.h new file mode 100644 index 0000000000..1dd3685196 --- /dev/null +++ b/port/max32630-fthr-mbed/src/hal_tick.h @@ -0,0 +1,51 @@ +/******************************************************************************* +* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. +* Author: Ismail H. Kose +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES +* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Except as contained in this notice, the name of Maxim Integrated +* Products, Inc. shall not be used except as stated in the Maxim Integrated +* Products, Inc. Branding Policy. +* +* The mere transfer of this software does not imply any licenses +* of trade secrets, proprietary technology, copyrights, patents, +* trademarks, maskwork rights, or any other form of intellectual +* property whatsoever. Maxim Integrated Products, Inc. retains all +* ownership rights. +******************************************************************************* +*/ + +#ifndef MAX32630FTHR_HAL_TICK_H_ +#define MAX32630FTHR_HAL_TICK_H_ +#include + +#ifndef __cplusplus +extern "C" { +#endif + +void hal_delay_us(unsigned int us); +void hal_delay_ms(unsigned int ms); +int32_t hal_tick_init(void); + +#ifndef __cplusplus +} +#endif + +#endif /* MAX32630FTHR_HAL_TICK_H_ */ diff --git a/port/max32630-fthr-mbed/src/initscripts-TIInit_6.7.16_bt_spec_4.1.c b/port/max32630-fthr-mbed/src/initscripts-TIInit_6.7.16_bt_spec_4.1.c new file mode 100644 index 0000000000..625784813b --- /dev/null +++ b/port/max32630-fthr-mbed/src/initscripts-TIInit_6.7.16_bt_spec_4.1.c @@ -0,0 +1,702 @@ +// init script created from +// - initscripts-TIInit_6.7.16_bt_spec_4.1.bts +#include + +#if defined(__GNUC__) && defined(__MSP430X__) && (__MSP430X__ > 0) +__attribute__((section (".fartext"))) +#endif +#ifdef __AVR__ +__attribute__((__progmem__)) +#endif +const uint8_t cc256x_init_script[] = { + + // #-------------------------------------------------------------------------------- + // # Description : Orca L PG 2.0 ROM Initialization Script + // # + // # Compatibility: Orca, 7.0.16 ROM + // # + // # Last Updated: 25-May-2016 15:42:50.20 + // # + // # Version : TI_P7_16. + // # + // # + // # + // # + // # Notes : Use this script on Orca L PG 2.0, 7.0.16 ROM device only (FW v7.0.16) + // #-------------------------------------------------------------------------------- + // + // ################################################################# + // ## START of CC256x Add-On + // ################################################################# + // + // ## Change UART baudrate + // + // ################################################################# + // ## END of CC256x Add-On + // ################################################################# + // + 0x01, 0x37, 0xfe, 0x02, 0x07, 0x10, + + // + // + 0x01, 0x05, 0xff, 0xff, 0x40, 0x61, 0x08, 0x00, 0xfa, 0x07, 0x10, 0x47, 0x22, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xb5, 0x00, 0x90, 0x47, 0x68, 0xff, 0x20, 0x26, 0x30, 0xc0, + 0x5d, 0x00, 0x28, 0x26, 0xd0, 0x01, 0x38, 0x1d, 0xd0, 0x01, 0x38, 0x2a, 0xd1, 0xff, 0x24, + 0x95, 0x34, 0xe5, 0x19, 0x29, 0x88, 0x08, 0x20, 0x01, 0x26, 0xb6, 0x46, 0x37, 0x4a, 0xfe, + 0x44, 0x10, 0x47, 0x00, 0x29, 0x01, 0xd1, 0x02, 0x20, 0x07, 0xe0, 0xe5, 0x19, 0x29, 0x88, + 0x08, 0x20, 0xb6, 0x46, 0x31, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x48, 0x1c, 0xe9, 0x88, 0x0c, + 0x1c, 0x44, 0x43, 0x60, 0x2c, 0x0f, 0xd9, 0x0f, 0xe0, 0xff, 0x20, 0x99, 0x30, 0xc0, 0x5b, + 0x5e, 0x28, 0x09, 0xdb, 0xc4, 0x1c, 0x08, 0xe0, 0xff, 0x20, 0xed, 0x30, 0xc4, 0x5b, 0x10, + 0x2c, 0x02, 0xdd, 0x06, 0x20, 0x44, 0x43, 0x00, 0xe0, 0x60, 0x24, 0x41, 0x20, 0x00, 0x21, + 0x01, 0x22, 0x96, 0x46, 0x1c, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x01, 0x90, 0x61, 0x08, 0x40, + 0x18, 0x01, 0x30, 0x80, 0x01, 0x80, 0x09, 0x02, 0x90, 0x18, 0x4d, 0x00, 0x26, 0xa8, 0x7b, + 0x00, 0x28, 0x1f, 0xd0, 0x28, 0x7c, 0x39, 0x78, 0x81, 0x42, 0x1b, 0xd1, 0x15, 0x48, 0x00, + 0x2e, 0x00, 0xd0, 0x14, 0x30, 0x00, 0x68, 0x80, 0x06, 0x80, 0x0e, 0x01, 0x99, 0x08, 0x18, + 0x80, 0x01, 0x80, 0x09, 0x02, 0x99, 0x01, 0x22, 0x96, 0x46, 0x0f, 0x4a, 0xfe, 0x44, 0x10, + 0x47, 0x29, 0x7b, 0x03, 0x91, 0x01, 0x22, 0x96, 0x46, 0x0c, 0x4a, 0xfe, 0x44, 0x10, 0x47, + 0x02, 0x28, 0x01, 0xda, + + 0x01, 0x05, 0xff, 0xff, 0x3a, 0x62, 0x08, 0x00, 0xfa, 0x03, 0x98, 0x04, 0x19, 0x28, 0x35, + 0x01, 0x36, 0x02, 0x2e, 0xd8, 0xd3, 0x00, 0x98, 0x44, 0x60, 0x07, 0x48, 0x33, 0x30, 0x00, + 0x90, 0xff, 0xbd, 0xc0, 0x46, 0x93, 0xe4, 0x04, 0x00, 0x38, 0x1d, 0x08, 0x00, 0x0c, 0x05, + 0x1a, 0x00, 0x39, 0x7a, 0x04, 0x00, 0xad, 0x45, 0x05, 0x00, 0x7b, 0xbf, 0x02, 0x00, 0xad, + 0x45, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xb5, 0x01, + 0x24, 0xa6, 0x46, 0xd6, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x06, 0x1c, 0xd5, 0x4d, 0x28, 0x68, + 0xd5, 0x49, 0x09, 0x88, 0x08, 0x18, 0x80, 0x01, 0x80, 0x09, 0x31, 0x1c, 0xa6, 0x46, 0xe3, + 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x00, 0x28, 0x0c, 0xd4, 0xe2, 0x48, 0x00, 0x78, 0x04, 0x28, + 0x08, 0xd1, 0xe1, 0x48, 0x00, 0x78, 0x03, 0x28, 0x04, 0xd1, 0x2e, 0x60, 0xa6, 0x46, 0xdf, + 0x48, 0xfe, 0x44, 0x00, 0x47, 0xde, 0x4d, 0x28, 0x68, 0x19, 0x21, 0x49, 0x01, 0x08, 0x18, + 0x80, 0x01, 0x80, 0x09, 0x31, 0x1c, 0xa6, 0x46, 0xd6, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x00, + 0x28, 0x4c, 0xd4, 0x2e, 0x60, 0xe2, 0x48, 0x01, 0x78, 0xe2, 0x48, 0x00, 0x88, 0x08, 0x43, + 0x1a, 0xd0, 0x00, 0x29, + + 0x01, 0x05, 0xff, 0xff, 0x34, 0x63, 0x08, 0x00, 0xfa, 0x18, 0xd0, 0x22, 0x21, 0xe5, 0x48, + 0x20, 0x22, 0x12, 0x5c, 0x01, 0x2a, 0x12, 0xd1, 0x09, 0x5c, 0x00, 0x29, 0x0f, 0xd0, 0x41, + 0x7f, 0x08, 0x29, 0x0c, 0xd1, 0x09, 0x21, 0x41, 0x77, 0xe0, 0x48, 0x03, 0x21, 0xa6, 0x46, + 0xdf, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x04, 0x20, 0xa6, 0x46, 0xde, 0x49, 0xfe, 0x44, 0x08, + 0x47, 0x00, 0x25, 0x68, 0x1c, 0x00, 0x04, 0x00, 0x0c, 0xa6, 0x46, 0xdb, 0x49, 0xfe, 0x44, + 0x08, 0x47, 0x00, 0x28, 0x1d, 0xd0, 0x81, 0x7c, 0x0a, 0x02, 0xc1, 0x7c, 0x11, 0x43, 0x0a, + 0x02, 0x01, 0x7d, 0x11, 0x43, 0x0a, 0x02, 0x41, 0x7d, 0x11, 0x43, 0x00, 0x91, 0x69, 0x1c, + 0x00, 0x78, 0xa8, 0x22, 0x42, 0x43, 0xe2, 0x48, 0x80, 0x5c, 0x40, 0x00, 0xdf, 0x4a, 0x12, + 0x5a, 0xe1, 0x48, 0x40, 0x5d, 0xdf, 0x4b, 0x1b, 0x56, 0x7b, 0x20, 0x80, 0x00, 0xa6, 0x46, + 0xdf, 0x4e, 0xfe, 0x44, 0x30, 0x47, 0x01, 0x35, 0x07, 0x2d, 0xd5, 0xdb, 0x78, 0xbd, 0x30, + 0xb5, 0x05, 0x1c, 0xad, 0x4c, 0x7e, 0x34, 0xa0, 0x78, 0x03, 0x28, 0x0f, 0xd1, 0x20, 0x88, + 0x00, 0x28, 0x0c, 0xd1, 0xe8, 0x69, 0x02, 0x28, 0x09, 0xd1, 0x01, 0x20, 0x86, 0x46, 0xd5, + 0x48, 0xfe, 0x44, 0x00, 0x47, 0x02, 0x20, 0xa0, 0x70, 0xd3, 0x48, 0xca, 0x30, 0x28, 0x62, + 0x30, 0xbd, 0xf8, 0xb5, 0x06, 0x1c, 0xb7, 0x69, 0xb0, 0x8a, 0x00, 0x90, 0xd0, 0x49, 0x40, + 0x1a, 0x0a, 0xd0, 0x97, 0x38, 0x51, 0xd0, 0x8c, 0x38, 0x45, 0xd0, 0x01, 0x38, 0x3c, 0xd0, + 0x22, 0x38, 0x2b, 0xd0, 0x01, 0x38, 0x25, 0xd0, 0xf8, 0xbd, 0x21, 0x20, 0xc5, 0x5d, 0x38, + 0x1c, 0x00, 0x21, 0x01, 0x24, 0xa6, 0x46, 0xe0, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x7d, 0x21, + 0xc9, 0x00, 0x41, 0x43, + + 0x01, 0x05, 0xff, 0xff, 0x2e, 0x64, 0x08, 0x00, 0xfa, 0xdc, 0x48, 0x01, 0x60, 0x00, 0x2d, + 0x41, 0xd0, 0xff, 0x2d, 0x3f, 0xd0, 0x38, 0x1c, 0x29, 0x1c, 0xa6, 0x46, 0xd9, 0x4a, 0xfe, + 0x44, 0x10, 0x47, 0xd9, 0x48, 0x02, 0x21, 0xa6, 0x46, 0xd8, 0x4a, 0xfe, 0x44, 0x10, 0x47, + 0x00, 0x28, 0x0e, 0xd1, 0xd2, 0x48, 0xd6, 0x49, 0x09, 0x68, 0x01, 0x60, 0x09, 0xe0, 0x01, + 0x20, 0xd5, 0x49, 0x08, 0x80, 0x05, 0xe0, 0x38, 0x1c, 0x01, 0x21, 0x8e, 0x46, 0xd3, 0x49, + 0xfe, 0x44, 0x08, 0x47, 0x38, 0x1c, 0x00, 0x99, 0x00, 0x22, 0x01, 0x23, 0x9e, 0x46, 0xd0, + 0x4b, 0xfe, 0x44, 0x18, 0x47, 0x0c, 0xe0, 0x38, 0x1c, 0x01, 0x21, 0x8e, 0x46, 0xcd, 0x49, + 0xfe, 0x44, 0x08, 0x47, 0x05, 0xe0, 0x38, 0x1c, 0x01, 0x21, 0x8e, 0x46, 0xcb, 0x49, 0xfe, + 0x44, 0x08, 0x47, 0xca, 0x48, 0x9e, 0x30, 0x30, 0x62, 0xf8, 0xbd, 0x01, 0x24, 0xa6, 0x46, + 0xc8, 0x48, 0xfe, 0x44, 0x00, 0x47, 0xa6, 0x46, 0xc7, 0x48, 0xfe, 0x44, 0x00, 0x47, 0xf8, + 0xbd, 0x70, 0xb5, 0x85, 0x69, 0x00, 0x7d, 0x44, 0x21, 0x40, 0x1a, 0x01, 0x28, 0x26, 0xd9, + 0x0f, 0x38, 0x0c, 0xd0, 0x28, 0x38, 0x2b, 0xd1, 0x28, 0x78, 0x03, 0x28, 0x28, 0xd1, 0x3b, + 0x20, 0xc0, 0x43, 0x05, 0x21, 0x49, 0x57, 0x81, 0x42, 0x22, 0xdd, 0x68, 0x71, 0x70, 0xbd, + 0x28, 0x78, 0x00, 0x28, 0x1d, 0xd1, 0xdd, 0x4e, 0x30, 0x1c, 0x01, 0x24, 0xa6, 0x46, 0xdc, + 0x49, 0xfe, 0x44, 0x08, 0x47, 0xa8, 0x70, 0xe8, 0x1c, 0x31, 0x1c, 0x0a, 0x22, 0xa6, 0x46, + 0xd9, 0x4b, 0xfe, 0x44, 0x18, 0x47, 0x28, 0x1c, 0xa6, 0x46, 0xd7, 0x49, 0xfe, 0x44, 0x08, + 0x47, 0x70, 0xbd, 0x57, 0x48, 0x00, 0x78, 0x04, 0x28, 0x04, 0xd1, 0x01, 0x20, 0x86, 0x46, + 0xab, 0x48, 0xfe, 0x44, + + 0x01, 0x05, 0xff, 0xff, 0x28, 0x65, 0x08, 0x00, 0xfa, 0x00, 0x47, 0x70, 0xbd, 0x70, 0xb5, + 0x04, 0x1c, 0x66, 0x69, 0x20, 0x7f, 0x17, 0x22, 0x80, 0x1a, 0x4f, 0x4d, 0x24, 0xd0, 0x68, + 0x38, 0x34, 0xd1, 0xff, 0x20, 0x7d, 0x30, 0x80, 0x5d, 0x0d, 0x28, 0x2f, 0xd1, 0x20, 0x69, + 0x01, 0x78, 0x30, 0x1c, 0x01, 0x24, 0xa6, 0x46, 0xc7, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x01, + 0x1c, 0x25, 0xd0, 0x08, 0x68, 0xb0, 0x42, 0x22, 0xd1, 0x77, 0x3d, 0x28, 0x78, 0x01, 0x28, + 0x1e, 0xd0, 0x08, 0x79, 0x00, 0x28, 0x1b, 0xd0, 0xc1, 0x4d, 0x2c, 0x70, 0x4d, 0x20, 0xa6, + 0x46, 0xc0, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x00, 0x20, 0x28, 0x70, 0x70, 0xbd, 0x82, 0x3d, + 0x28, 0x78, 0x05, 0x28, 0x0d, 0xdb, 0xff, 0x20, 0x79, 0x30, 0x81, 0x5d, 0x30, 0x1c, 0x24, + 0x23, 0x01, 0x25, 0xae, 0x46, 0xb8, 0x4d, 0xfe, 0x44, 0x28, 0x47, 0xb9, 0x48, 0xb7, 0x49, + 0x08, 0x18, 0x20, 0x62, 0x70, 0xbd, 0x70, 0xb5, 0x05, 0x1c, 0x2c, 0x69, 0xa2, 0x8e, 0x23, + 0x8f, 0x93, 0x42, 0x32, 0xdd, 0xb4, 0x48, 0x01, 0x78, 0x60, 0x8d, 0x01, 0x30, 0x41, 0x43, + 0x08, 0x04, 0x00, 0x0c, 0x82, 0x42, 0x29, 0xda, 0xc6, 0x26, 0x31, 0x5d, 0xc9, 0x09, 0x25, + 0xd1, 0x10, 0x1a, 0xae, 0x49, 0x08, 0x18, 0x83, 0x42, 0x20, 0xdd, 0xc5, 0x20, 0x00, 0x5d, + 0x01, 0x28, 0x01, 0xd0, 0x03, 0x28, 0x1a, 0xd1, 0x30, 0x5d, 0x01, 0x28, 0x05, 0xd1, 0xce, + 0x21, 0x09, 0x5d, 0x10, 0x29, 0x04, 0xd0, 0x11, 0x29, 0x02, 0xd0, 0x02, 0x28, 0x0a, 0xd0, + 0x70, 0xbd, 0xb5, 0x20, 0x00, 0x5d, 0x00, 0x21, 0x01, 0x22, 0x96, 0x46, 0xe2, 0x4a, 0xfe, + 0x44, 0x10, 0x47, 0x02, 0x20, 0x30, 0x55, 0xe1, 0x49, 0x97, 0x20, 0xc0, 0x00, 0x40, 0x18, + 0x28, 0x62, 0x70, 0xbd, + + 0x01, 0x05, 0xff, 0xff, 0x22, 0x66, 0x08, 0x00, 0xfa, 0xc0, 0x46, 0x47, 0x76, 0x04, 0x00, + 0x5c, 0x61, 0x08, 0x00, 0x4a, 0x61, 0x08, 0x00, 0x70, 0xb5, 0x02, 0x69, 0xd4, 0x8e, 0x15, + 0x8f, 0xa5, 0x42, 0x1a, 0xdd, 0xc8, 0x21, 0x8b, 0x5c, 0x40, 0x21, 0x19, 0x40, 0xde, 0x11, + 0xf6, 0x01, 0x31, 0x43, 0x12, 0xd1, 0x2c, 0x1b, 0x59, 0x49, 0x86, 0x31, 0x09, 0x78, 0x09, + 0x02, 0x8c, 0x42, 0x0b, 0xdd, 0x02, 0x2b, 0x09, 0xd1, 0xc7, 0x21, 0x89, 0x5c, 0x01, 0x29, + 0x01, 0xd0, 0x03, 0x29, 0x03, 0xd1, 0xea, 0x49, 0xe8, 0x4a, 0x51, 0x18, 0x01, 0x62, 0x70, + 0xbd, 0x39, 0x7a, 0x04, 0x00, 0x45, 0x10, 0x08, 0x00, 0x2c, 0x24, 0x08, 0x00, 0xb1, 0x6a, + 0x08, 0x00, 0x58, 0x61, 0x08, 0x00, 0x30, 0xb5, 0xe3, 0x49, 0xe3, 0x4a, 0x13, 0x32, 0x1f, + 0x20, 0x00, 0x23, 0x01, 0x24, 0xa6, 0x46, 0xe1, 0x4d, 0xfe, 0x44, 0x28, 0x47, 0xe2, 0x48, + 0x00, 0x88, 0x40, 0x0a, 0x00, 0xd2, 0x00, 0x24, 0xde, 0x48, 0x04, 0x70, 0x30, 0xbd, 0xc0, + 0x46, 0x84, 0x18, 0x08, 0x00, 0x46, 0x61, 0x08, 0x00, 0x10, 0xb5, 0xdc, 0x49, 0xdc, 0x4a, + 0x5d, 0x32, 0x1f, 0x20, 0x00, 0x23, 0x01, 0x24, 0xa6, 0x46, 0xd5, 0x4c, 0xfe, 0x44, 0x20, + 0x47, 0x10, 0xbd, 0x50, 0x17, 0x08, 0x00, 0x00, 0x04, 0x1a, 0x00, 0xb5, 0xf5, 0x04, 0x00, + 0xf9, 0x15, 0x05, 0x00, 0xd9, 0x8f, 0x01, 0x00, 0x10, 0xb5, 0x69, 0x4b, 0x1b, 0x78, 0x40, + 0x8d, 0x01, 0x30, 0x43, 0x43, 0x1c, 0x04, 0x24, 0x0c, 0x66, 0x4b, 0x91, 0x42, 0x07, 0xdb, + 0x88, 0x1a, 0x19, 0x1b, 0x88, 0x42, 0x0c, 0xdd, 0x01, 0x21, 0x09, 0x04, 0x40, 0x1a, 0x10, + 0xbd, 0xa1, 0x42, 0x02, 0xda, 0x18, 0x1b, 0x82, 0x42, 0x01, 0xdc, 0x88, 0x1a, 0x10, 0xbd, + 0x88, 0x1a, 0x18, 0x18, + + 0x01, 0x05, 0xff, 0xff, 0x1c, 0x67, 0x08, 0x00, 0xfa, 0x10, 0xbd, 0xc0, 0x46, 0x20, 0x0c, + 0x1a, 0x00, 0xcd, 0x18, 0x08, 0x00, 0x78, 0x20, 0x08, 0x00, 0x59, 0x15, 0x08, 0x00, 0x85, + 0x87, 0x04, 0x00, 0x3f, 0x83, 0x02, 0x00, 0x11, 0x24, 0x03, 0x00, 0x06, 0xfd, 0x00, 0x00, + 0xf8, 0xb5, 0x0e, 0x1c, 0x04, 0x1c, 0x00, 0x90, 0x01, 0x25, 0xae, 0x46, 0xd4, 0x49, 0xfe, + 0x44, 0x08, 0x47, 0x20, 0x1c, 0x03, 0x21, 0xae, 0x46, 0xd2, 0x4a, 0xfe, 0x44, 0x10, 0x47, + 0x07, 0x1c, 0x12, 0x48, 0x04, 0x1c, 0x04, 0x3c, 0x26, 0x80, 0x00, 0x98, 0x07, 0x21, 0xae, + 0x46, 0x0d, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x00, 0x28, 0x01, 0xd1, 0x70, 0x08, 0x60, 0x80, + 0x0b, 0x48, 0x02, 0x21, 0xae, 0x46, 0x0b, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x00, 0x28, 0x07, + 0xd1, 0x38, 0x1c, 0x70, 0x43, 0x08, 0x49, 0x08, 0x60, 0xae, 0x46, 0xc4, 0x49, 0xfe, 0x44, + 0x08, 0x47, 0xf8, 0xbd, 0xc0, 0x46, 0xb8, 0x62, 0x08, 0x00, 0x51, 0x2a, 0x00, 0x00, 0x41, + 0x67, 0x08, 0x00, 0x04, 0x50, 0x1a, 0x00, 0x6b, 0xf7, 0x04, 0x00, 0x6c, 0x4f, 0x08, 0x00, + 0x62, 0x61, 0x08, 0x00, 0x8d, 0x6a, 0x08, 0x00, 0xa9, 0x25, 0x05, 0x00, 0x45, 0x6f, 0x08, + 0x00, 0xd9, 0x6f, 0x08, 0x00, 0x7d, 0x5e, 0x00, 0x00, 0x8d, 0x6d, 0x08, 0x00, 0xc5, 0x6e, + 0x08, 0x00, 0xf8, 0xb5, 0x00, 0x90, 0x45, 0x69, 0x68, 0x7c, 0x10, 0x28, 0x11, 0xd1, 0x28, + 0x7c, 0xb1, 0x49, 0x06, 0x28, 0x0b, 0xd0, 0x0a, 0x88, 0x01, 0x2a, 0x0a, 0xd1, 0x01, 0x28, + 0x01, 0xd0, 0x00, 0x20, 0x05, 0xe0, 0x00, 0x20, 0x08, 0x80, 0x03, 0x20, 0x28, 0x74, 0x01, + 0xe0, 0x01, 0x20, 0x08, 0x80, 0x68, 0x7c, 0x0d, 0x28, 0x1b, 0xd1, 0x28, 0x7c, 0x00, 0x28, + 0x18, 0xd1, 0xe5, 0x4f, + + 0x01, 0x05, 0xff, 0xff, 0x16, 0x68, 0x08, 0x00, 0xfa, 0x02, 0x26, 0x38, 0x1c, 0x01, 0x24, + 0xa6, 0x46, 0xe4, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x03, 0xe0, 0xa6, 0x46, 0xe2, 0x49, 0xfe, + 0x44, 0x08, 0x47, 0x00, 0x28, 0x06, 0xd0, 0x01, 0x7a, 0x0d, 0x29, 0xf6, 0xd1, 0xdf, 0x49, + 0x4c, 0x31, 0x00, 0x98, 0x01, 0x62, 0x0c, 0x37, 0x01, 0x3e, 0xe8, 0xd1, 0x68, 0x7c, 0x06, + 0x28, 0x0a, 0xd1, 0x28, 0x7c, 0xdb, 0x49, 0x06, 0x28, 0x04, 0xd0, 0x08, 0x88, 0x01, 0x28, + 0x03, 0xd1, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x08, 0x80, 0xf8, 0xbd, 0x60, 0x12, 0x08, + 0x00, 0xed, 0x2f, 0x01, 0x00, 0x09, 0x59, 0x05, 0x00, 0x51, 0xbc, 0x04, 0x00, 0x69, 0x7d, + 0x02, 0x00, 0x64, 0x61, 0x08, 0x00, 0x93, 0xe4, 0x04, 0x00, 0x85, 0xf8, 0x00, 0x00, 0x18, + 0x0f, 0x00, 0x00, 0x1d, 0xe4, 0x00, 0x00, 0x2e, 0x2e, 0x08, 0x00, 0xff, 0xff, 0x00, 0x00, + 0xf8, 0xb5, 0x00, 0x90, 0x82, 0x69, 0x51, 0x78, 0xc7, 0x69, 0x0b, 0x1f, 0x70, 0xd0, 0x21, + 0x3b, 0xc6, 0x48, 0x33, 0xd0, 0x01, 0x3b, 0x73, 0xd1, 0x04, 0x23, 0xbb, 0x80, 0x0c, 0x23, + 0xde, 0x19, 0x49, 0x00, 0x12, 0x78, 0x0a, 0x43, 0x32, 0x70, 0x01, 0x36, 0x00, 0x78, 0x00, + 0x28, 0x02, 0xd1, 0x06, 0x25, 0x28, 0x1c, 0x01, 0xe0, 0x07, 0x20, 0x06, 0x25, 0x30, 0x70, + 0x01, 0x36, 0x30, 0x1c, 0x0d, 0x21, 0x01, 0x24, 0xa6, 0x46, 0xba, 0x4a, 0xfe, 0x44, 0x10, + 0x47, 0x06, 0x1c, 0xa6, 0x46, 0xb9, 0x48, 0xfe, 0x44, 0x00, 0x47, 0xc0, 0x06, 0xc0, 0x0e, + 0x81, 0x02, 0xb5, 0x48, 0x00, 0x78, 0x40, 0x06, 0x40, 0x0e, 0x08, 0x43, 0x07, 0x21, 0xc9, + 0x01, 0x01, 0x43, 0x09, 0x04, 0x09, 0x0c, 0x30, 0x1c, 0xa6, 0x46, 0xae, 0x4a, 0xfe, 0x44, + 0x10, 0x47, 0x30, 0xe0, + + 0x01, 0x05, 0xff, 0xff, 0x10, 0x69, 0x08, 0x00, 0xfa, 0x04, 0x23, 0xbb, 0x80, 0x0c, 0x23, + 0xde, 0x19, 0x49, 0x00, 0x12, 0x78, 0x0a, 0x43, 0x32, 0x70, 0x01, 0x36, 0x00, 0x78, 0x00, + 0x28, 0x02, 0xd1, 0x06, 0x25, 0x28, 0x1c, 0x01, 0xe0, 0x07, 0x20, 0x06, 0x25, 0x30, 0x70, + 0x01, 0x36, 0x30, 0x1c, 0x0d, 0x21, 0x01, 0x24, 0xa6, 0x46, 0xa1, 0x4a, 0xfe, 0x44, 0x10, + 0x47, 0x06, 0x1c, 0xa6, 0x46, 0xa0, 0x48, 0xfe, 0x44, 0x00, 0x47, 0xc0, 0x06, 0xc0, 0x0e, + 0x81, 0x02, 0x9c, 0x48, 0x00, 0x78, 0x40, 0x06, 0x40, 0x0e, 0x08, 0x43, 0x07, 0x21, 0xc9, + 0x01, 0x01, 0x43, 0x09, 0x04, 0x09, 0x0c, 0x30, 0x1c, 0xa6, 0x46, 0x95, 0x4a, 0xfe, 0x44, + 0x10, 0x47, 0x7d, 0x80, 0x03, 0x20, 0x38, 0x80, 0xc7, 0x48, 0xc6, 0x49, 0x09, 0x18, 0x00, + 0x98, 0x01, 0x62, 0xf8, 0xbd, 0x10, 0x79, 0x27, 0x28, 0x04, 0xd1, 0x50, 0x79, 0x1e, 0x28, + 0x01, 0xd1, 0x23, 0x20, 0x50, 0x71, 0xf8, 0xbd, 0xc0, 0x46, 0xcb, 0xa3, 0x00, 0x00, 0xed, + 0x92, 0x00, 0x00, 0x30, 0xb5, 0x05, 0x1c, 0xec, 0x69, 0x21, 0x88, 0x08, 0x04, 0x00, 0x0e, + 0x02, 0x02, 0x25, 0x20, 0x00, 0x02, 0x10, 0x1a, 0x10, 0xd0, 0x2f, 0x22, 0x12, 0x02, 0x80, + 0x1a, 0x27, 0xd1, 0x08, 0x06, 0x00, 0x0e, 0x04, 0x28, 0x23, 0xd1, 0x60, 0x7a, 0x01, 0x21, + 0x8e, 0x46, 0xb3, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x00, 0x28, 0x10, 0xd0, 0x30, 0xbd, 0x21, + 0x78, 0xa8, 0x20, 0x48, 0x43, 0xb0, 0x4a, 0x10, 0x5c, 0x00, 0x28, 0x13, 0xd0, 0x76, 0x48, + 0xc0, 0x38, 0x00, 0x78, 0x00, 0x28, 0x0e, 0xd1, 0xe3, 0x48, 0x40, 0x5c, 0x07, 0x28, 0x0a, + 0xdb, 0x20, 0x1c, 0x01, 0x21, 0x8e, 0x46, 0xe1, 0x49, 0xfe, 0x44, 0x08, 0x47, 0xe0, 0x49, + 0xa3, 0x48, 0x78, 0x30, + + 0x01, 0x05, 0xff, 0xff, 0x0a, 0x6a, 0x08, 0x00, 0xfa, 0x40, 0x18, 0x28, 0x62, 0x30, 0xbd, + 0x82, 0x04, 0x00, 0x00, 0x45, 0x9f, 0x00, 0x00, 0x17, 0x71, 0x08, 0x00, 0xa9, 0x86, 0x00, + 0x00, 0xe9, 0x70, 0x08, 0x00, 0x55, 0x31, 0x19, 0x00, 0x3e, 0xa6, 0x1b, 0x00, 0xd7, 0x71, + 0x08, 0x00, 0xad, 0x99, 0x00, 0x00, 0x30, 0xb5, 0x01, 0x69, 0xdc, 0x4a, 0xc8, 0x68, 0x90, + 0x42, 0x24, 0xd1, 0xdb, 0x48, 0x00, 0x78, 0x80, 0x08, 0x20, 0xd2, 0xdd, 0x48, 0x42, 0x7f, + 0x05, 0x2a, 0x1c, 0xd1, 0x02, 0x22, 0x42, 0x77, 0xd7, 0x48, 0x00, 0x78, 0xc8, 0x70, 0x59, + 0x48, 0xc1, 0x38, 0x00, 0x78, 0xff, 0x28, 0x06, 0xd1, 0xd7, 0x48, 0x03, 0x21, 0x01, 0x22, + 0x96, 0x46, 0xd6, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x01, 0x24, 0xd0, 0x4d, 0x2c, 0x80, 0xa6, + 0x46, 0xd0, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x2c, 0x80, 0xa6, 0x46, 0xcd, 0x48, 0xfe, 0x44, + 0x00, 0x47, 0x30, 0xbd, 0x00, 0xb5, 0x00, 0x21, 0x01, 0x22, 0x96, 0x46, 0xce, 0x4a, 0xfe, + 0x44, 0x10, 0x47, 0xcc, 0x49, 0x08, 0x80, 0x00, 0xbd, 0xb1, 0x2f, 0x00, 0x00, 0x65, 0x2a, + 0x00, 0x00, 0xcd, 0x16, 0x03, 0x00, 0x44, 0x61, 0x08, 0x00, 0xf8, 0xb5, 0xc8, 0x48, 0x00, + 0x88, 0xc0, 0x08, 0xc7, 0x4c, 0x22, 0x88, 0xcb, 0x49, 0x8a, 0x42, 0x39, 0xd0, 0xcb, 0x49, + 0x09, 0x78, 0x03, 0x29, 0x35, 0xd1, 0x61, 0x88, 0x8d, 0x1a, 0xc3, 0x4a, 0x83, 0x1a, 0x88, + 0x42, 0x02, 0xd5, 0x00, 0x22, 0xd7, 0x43, 0x00, 0xe0, 0x01, 0x27, 0x00, 0x2d, 0x02, 0xd5, + 0x00, 0x22, 0xd6, 0x43, 0x00, 0xe0, 0x01, 0x26, 0xbd, 0x4a, 0x12, 0x78, 0x96, 0x46, 0xbc, + 0x4a, 0x12, 0x78, 0x94, 0x46, 0x01, 0x22, 0x00, 0x92, 0xbb, 0x4a, 0xb7, 0x42, 0x11, 0xd1, + 0x76, 0x46, 0x36, 0x06, + + 0x01, 0x05, 0xff, 0xff, 0x04, 0x6b, 0x08, 0x00, 0xfa, 0x36, 0x16, 0x5e, 0x43, 0x67, 0x46, + 0x3e, 0x41, 0x00, 0x2d, 0x04, 0xdc, 0x00, 0x2b, 0x0b, 0xdd, 0x12, 0x78, 0x96, 0x19, 0x08, + 0xe0, 0x00, 0x2b, 0x06, 0xdc, 0x12, 0x78, 0xb6, 0x1a, 0x03, 0xe0, 0x16, 0x78, 0x00, 0x2b, + 0x00, 0xdc, 0x76, 0x42, 0xe0, 0x4a, 0x12, 0x78, 0xde, 0x4b, 0x1a, 0x70, 0x02, 0xe0, 0x61, + 0x88, 0x00, 0x26, 0x00, 0x96, 0xe0, 0x4a, 0x12, 0x68, 0x13, 0x1c, 0x73, 0x43, 0x1b, 0x15, + 0x21, 0x80, 0x60, 0x80, 0xda, 0x48, 0x00, 0x78, 0x31, 0x1c, 0x00, 0xda, 0x49, 0x42, 0x81, + 0x42, 0x04, 0xdd, 0x00, 0x2e, 0x00, 0xd5, 0x40, 0x42, 0x50, 0x43, 0x03, 0x15, 0x17, 0x4d, + 0x41, 0x3d, 0xe8, 0x6f, 0x1e, 0x18, 0xd3, 0x48, 0x00, 0x78, 0x50, 0x43, 0x00, 0x0d, 0xb1, + 0x1a, 0x00, 0xda, 0x49, 0x42, 0x81, 0x42, 0x15, 0xd8, 0x00, 0x98, 0x00, 0x28, 0x12, 0xd0, + 0xce, 0x48, 0x00, 0x78, 0x00, 0x28, 0x0e, 0xd0, 0xe7, 0x48, 0x02, 0x21, 0x01, 0x24, 0xa6, + 0x46, 0xe6, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x00, 0x28, 0x05, 0xd1, 0xee, 0x67, 0x30, 0x1c, + 0xa6, 0x46, 0xe3, 0x49, 0xfe, 0x44, 0x08, 0x47, 0xf8, 0xbd, 0xc0, 0x46, 0x5c, 0x18, 0x08, + 0x00, 0x4f, 0x0c, 0x04, 0x00, 0x5b, 0x0c, 0x04, 0x00, 0x89, 0x3f, 0x04, 0x00, 0x46, 0x61, + 0x08, 0x00, 0x31, 0x4f, 0x08, 0x00, 0xe7, 0x2a, 0x00, 0x00, 0xfb, 0x4f, 0x08, 0x00, 0x89, + 0x91, 0x04, 0x00, 0xf0, 0xb5, 0x05, 0x1c, 0xae, 0x69, 0xef, 0x69, 0x38, 0x88, 0xd6, 0x49, + 0x40, 0x1a, 0x3e, 0xd0, 0xd5, 0x49, 0x40, 0x1a, 0x01, 0x28, 0x2f, 0xd9, 0x25, 0x38, 0x51, + 0xd1, 0xd4, 0x48, 0x00, 0x88, 0x00, 0x28, 0x4d, 0xd0, 0x30, 0x1c, 0x01, 0x24, 0xa6, 0x46, + 0xd0, 0x49, 0xfe, 0x44, + + 0x01, 0x05, 0xff, 0xff, 0xfe, 0x6b, 0x08, 0x00, 0xfa, 0x08, 0x47, 0xff, 0x20, 0x1c, 0x30, + 0x81, 0x5d, 0x00, 0x29, 0x01, 0xd1, 0x02, 0x21, 0x81, 0x55, 0xff, 0x21, 0x1e, 0x31, 0x89, + 0x5d, 0x00, 0x29, 0x04, 0xd1, 0x82, 0x5d, 0x01, 0x2a, 0x01, 0xd0, 0x00, 0x2a, 0x06, 0xd1, + 0x01, 0x29, 0x0a, 0xd1, 0x80, 0x5d, 0x03, 0x28, 0x07, 0xd0, 0x02, 0x28, 0x05, 0xd0, 0x30, + 0x1c, 0xa6, 0x46, 0xe3, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x24, 0xe0, 0x30, 0x1c, 0xa6, 0x46, + 0xe1, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x1e, 0xe0, 0x3a, 0x20, 0x80, 0x5d, 0x00, 0x28, 0x1f, + 0xd0, 0x38, 0x1c, 0x01, 0x21, 0x8e, 0x46, 0x4b, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x13, 0xe0, + 0xd8, 0x48, 0x00, 0x78, 0x05, 0x28, 0x14, 0xdb, 0xff, 0x20, 0x26, 0x30, 0x82, 0x5d, 0x30, + 0x1c, 0x07, 0x21, 0x00, 0x23, 0x01, 0x24, 0xa6, 0x46, 0xd6, 0x4e, 0xfe, 0x44, 0x30, 0x47, + 0x38, 0x1c, 0xa6, 0x46, 0x40, 0x49, 0xfe, 0x44, 0x08, 0x47, 0xd1, 0x49, 0x5f, 0x20, 0x00, + 0x01, 0x40, 0x18, 0x28, 0x62, 0xf0, 0xbd, 0xc0, 0x46, 0xca, 0x04, 0x00, 0x00, 0x61, 0xde, + 0x00, 0x00, 0x0b, 0x34, 0x04, 0x00, 0xc8, 0x18, 0x08, 0x00, 0xf0, 0xb5, 0x85, 0xb0, 0x07, + 0x1c, 0xb8, 0x69, 0x04, 0x90, 0xb9, 0x8a, 0xea, 0x48, 0x08, 0x1a, 0x26, 0xd0, 0xea, 0x49, + 0x40, 0x1a, 0x5e, 0xd1, 0xe9, 0x4d, 0xc5, 0x48, 0x00, 0x78, 0x02, 0x28, 0x59, 0xd1, 0x01, + 0x24, 0xa6, 0x46, 0xe7, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x00, 0x28, 0x52, 0xd1, 0xa6, 0x46, + 0xe5, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x00, 0x28, 0x4c, 0xd1, 0xa6, 0x46, 0xe3, 0x48, 0xfe, + 0x44, 0x00, 0x47, 0x00, 0x28, 0x46, 0xd1, 0x28, 0x78, 0x00, 0x28, 0x43, 0xd1, 0xa8, 0x78, + 0x00, 0x28, 0x40, 0xd1, + + 0x01, 0x05, 0xff, 0xff, 0xf8, 0x6c, 0x08, 0x00, 0xfa, 0xa6, 0x20, 0xa6, 0x46, 0xdd, 0x49, + 0xfe, 0x44, 0x08, 0x47, 0x3a, 0xe0, 0x04, 0x98, 0x00, 0x21, 0x6a, 0x46, 0x01, 0x24, 0xa6, + 0x46, 0xda, 0x4b, 0xfe, 0x44, 0x18, 0x47, 0x02, 0xa8, 0x00, 0x21, 0x06, 0x22, 0xa6, 0x46, + 0xd7, 0x4b, 0xfe, 0x44, 0x18, 0x47, 0x00, 0x25, 0x02, 0xe0, 0x68, 0x1c, 0x05, 0x04, 0x2d, + 0x0c, 0xd4, 0x48, 0x00, 0x78, 0x85, 0x42, 0x22, 0xda, 0x11, 0x20, 0x40, 0x01, 0x68, 0x43, + 0xd2, 0x49, 0x0e, 0x18, 0x10, 0x20, 0x80, 0x19, 0x69, 0x46, 0xa6, 0x46, 0xd0, 0x4a, 0xfe, + 0x44, 0x10, 0x47, 0x00, 0x28, 0xea, 0xd1, 0x68, 0x46, 0x02, 0xa9, 0xa6, 0x46, 0xcc, 0x4a, + 0xfe, 0x44, 0x10, 0x47, 0x00, 0x28, 0xe2, 0xd0, 0xb0, 0x78, 0x01, 0x28, 0xdf, 0xd0, 0x04, + 0x98, 0xbc, 0x49, 0x3a, 0x22, 0xa6, 0x46, 0xc7, 0x4b, 0xfe, 0x44, 0x18, 0x47, 0xc6, 0x48, + 0xe2, 0x30, 0x38, 0x62, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0x50, 0x15, 0x08, 0x00, 0x8d, + 0x08, 0x04, 0x00, 0xd9, 0xa3, 0x02, 0x00, 0x10, 0xb5, 0x17, 0x4c, 0x10, 0x48, 0x04, 0x80, + 0x01, 0x20, 0x86, 0x46, 0xbe, 0x48, 0xfe, 0x44, 0x00, 0x47, 0xbe, 0x49, 0x08, 0x60, 0x0d, + 0x48, 0x04, 0x80, 0x44, 0x80, 0x10, 0xbd, 0xc0, 0x46, 0x7b, 0x86, 0x03, 0x00, 0x11, 0x22, + 0x08, 0x00, 0x4a, 0x56, 0x08, 0x00, 0x82, 0x07, 0x1a, 0x00, 0xf9, 0x8e, 0x03, 0x00, 0x50, + 0x17, 0x08, 0x00, 0x00, 0x04, 0x1a, 0x00, 0xb5, 0xf5, 0x04, 0x00, 0x60, 0x61, 0x08, 0x00, + 0x51, 0x2a, 0x00, 0x00, 0x50, 0x1d, 0x18, 0x00, 0x54, 0x61, 0x08, 0x00, 0x68, 0x10, 0x00, + 0x00, 0x4e, 0x61, 0x08, 0x00, 0x4f, 0x61, 0x08, 0x00, 0x52, 0x61, 0x08, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x2c, 0x24, + + 0x01, 0x05, 0xff, 0xff, 0xf2, 0x6d, 0x08, 0x00, 0xfa, 0x08, 0x00, 0xf0, 0xb5, 0x06, 0x1c, + 0x35, 0x69, 0xd5, 0x27, 0x7f, 0x00, 0xb1, 0x69, 0x00, 0x29, 0x52, 0xd0, 0x8a, 0x88, 0x50, + 0x18, 0x52, 0x18, 0x13, 0x7a, 0x5a, 0x08, 0xf8, 0x2b, 0x01, 0xd3, 0x43, 0x7a, 0x00, 0xe0, + 0x00, 0x23, 0x00, 0x7a, 0xc0, 0x07, 0xc0, 0x0f, 0x84, 0x46, 0x39, 0x20, 0x40, 0x5d, 0xa0, + 0x4c, 0x25, 0x28, 0x01, 0xd1, 0x13, 0x2a, 0x32, 0xd0, 0x0a, 0x28, 0x03, 0xd1, 0x0f, 0x2a, + 0x25, 0xd0, 0x13, 0x2a, 0x23, 0xd0, 0x3a, 0x20, 0x40, 0x5d, 0x20, 0x28, 0x01, 0xd1, 0x19, + 0x2b, 0x13, 0xd0, 0x18, 0x2a, 0x2f, 0xd1, 0x24, 0x28, 0x2d, 0xd1, 0x78, 0x5d, 0x02, 0x28, + 0x05, 0xd1, 0x28, 0x1c, 0x01, 0x21, 0x8e, 0x46, 0x90, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x28, + 0x1c, 0x01, 0x21, 0x8e, 0x46, 0x8e, 0x49, 0xfe, 0x44, 0x08, 0x47, 0xf0, 0xbd, 0xff, 0x20, + 0x6d, 0x30, 0x40, 0x19, 0x01, 0x22, 0x96, 0x46, 0x8a, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0xf6, + 0x34, 0x12, 0xe0, 0x28, 0x1c, 0x61, 0x46, 0x24, 0x23, 0x01, 0x25, 0xae, 0x46, 0x87, 0x4d, + 0xfe, 0x44, 0x28, 0x47, 0x08, 0xe0, 0x28, 0x1c, 0x61, 0x46, 0x13, 0x22, 0x24, 0x23, 0x01, + 0x25, 0xae, 0x46, 0x82, 0x4d, 0xfe, 0x44, 0x28, 0x47, 0xec, 0x34, 0x34, 0x62, 0xf0, 0xbd, + 0x4d, 0x61, 0x08, 0x00, 0x4c, 0x61, 0x08, 0x00, 0x51, 0x61, 0x08, 0x00, 0x53, 0x61, 0x08, + 0x00, 0x50, 0x61, 0x08, 0x00, 0xb8, 0x62, 0x08, 0x00, 0x78, 0xb5, 0x00, 0x26, 0x00, 0x96, + 0x01, 0x24, 0xa6, 0x46, 0x78, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x77, 0x4d, 0xa8, 0x6d, 0x69, + 0x46, 0xa6, 0x46, 0x76, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x17, 0x21, 0x00, 0x98, 0x01, 0x70, + 0xa8, 0x6d, 0x00, 0x99, + + 0x01, 0x05, 0xff, 0xff, 0xec, 0x6e, 0x08, 0x00, 0xfa, 0x32, 0x1c, 0xa6, 0x46, 0x72, 0x4b, + 0xfe, 0x44, 0x18, 0x47, 0x72, 0x4d, 0x0c, 0x20, 0xa8, 0x81, 0x28, 0x69, 0x40, 0x88, 0x0c, + 0x28, 0x0c, 0xd0, 0x01, 0x26, 0xb6, 0x02, 0x00, 0x2e, 0x08, 0xd0, 0xa6, 0x46, 0x6d, 0x48, + 0xfe, 0x44, 0x00, 0x47, 0x01, 0x3e, 0x28, 0x69, 0x40, 0x88, 0x0c, 0x28, 0xf4, 0xd1, 0xa6, + 0x46, 0x69, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x78, 0xbd, 0x04, 0x50, 0x1a, 0x00, 0x6b, 0xf7, + 0x04, 0x00, 0xcd, 0x16, 0x03, 0x00, 0x03, 0x08, 0x00, 0x00, 0xf0, 0xf4, 0x00, 0x00, 0x05, + 0x68, 0x03, 0x00, 0x62, 0x61, 0x08, 0x00, 0xf0, 0xb5, 0x87, 0xb0, 0x06, 0x90, 0x60, 0x48, + 0x07, 0x68, 0x01, 0x24, 0xa6, 0x46, 0x57, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x5d, 0x4e, 0x30, + 0x1c, 0x01, 0x30, 0xc0, 0x5d, 0x6d, 0x46, 0x28, 0x71, 0xf0, 0x5d, 0x68, 0x71, 0xa8, 0x1d, + 0x0b, 0x21, 0xc9, 0x01, 0xc9, 0x59, 0xa6, 0x46, 0x58, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0xaf, + 0x21, 0xc9, 0x00, 0xc9, 0x59, 0xa6, 0x46, 0x54, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x57, 0x21, + 0x09, 0x01, 0xc9, 0x59, 0xa6, 0x46, 0x51, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x22, 0x3e, 0xf1, + 0x59, 0xa6, 0x46, 0x4e, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0xa6, 0x46, 0x49, 0x48, 0xfe, 0x44, + 0x00, 0x47, 0x12, 0x20, 0x28, 0x70, 0x06, 0x98, 0x4a, 0x49, 0x00, 0x22, 0x01, 0xab, 0xa6, + 0x46, 0x49, 0x4c, 0xfe, 0x44, 0x20, 0x47, 0x07, 0xb0, 0xf0, 0xbd, 0xc3, 0x0f, 0x08, 0x00, + 0x17, 0x08, 0x05, 0x00, 0x35, 0xf7, 0x01, 0x00, 0xd9, 0xe5, 0x01, 0x00, 0x1d, 0x42, 0x02, + 0x00, 0x45, 0x10, 0x08, 0x00, 0xf8, 0xb5, 0x00, 0x90, 0x3b, 0x48, 0x07, 0x68, 0x01, 0x25, + 0xae, 0x46, 0x32, 0x48, + + 0x01, 0x05, 0xff, 0xff, 0xe6, 0x6f, 0x08, 0x00, 0xfa, 0xfe, 0x44, 0x00, 0x47, 0x00, 0x24, + 0x38, 0x4e, 0x30, 0x1c, 0x32, 0x38, 0xc4, 0x51, 0x30, 0x1c, 0x2a, 0x38, 0xc4, 0x51, 0x30, + 0x1c, 0x22, 0x38, 0xc4, 0x51, 0xb1, 0x20, 0xc0, 0x00, 0xc4, 0x51, 0x30, 0x1c, 0x1a, 0x38, + 0xc4, 0x51, 0x59, 0x20, 0x00, 0x01, 0xc4, 0x51, 0x30, 0x1c, 0x12, 0x38, 0xc4, 0x51, 0x08, + 0x20, 0xc0, 0x19, 0x04, 0x21, 0xae, 0x46, 0x2f, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0xb3, 0x20, + 0xc0, 0x00, 0xc4, 0x51, 0x57, 0x20, 0x00, 0x01, 0xc4, 0x51, 0xaf, 0x20, 0xc0, 0x00, 0xc4, + 0x51, 0x0b, 0x20, 0xc0, 0x01, 0xc4, 0x51, 0x01, 0x3e, 0xf4, 0x55, 0xae, 0x46, 0x20, 0x48, + 0xfe, 0x44, 0x00, 0x47, 0x00, 0x98, 0x22, 0x49, 0x01, 0x39, 0x22, 0x1c, 0xae, 0x46, 0x23, + 0x4b, 0xfe, 0x44, 0x18, 0x47, 0xf8, 0xbd, 0x05, 0x04, 0x00, 0x00, 0x19, 0x1c, 0x00, 0x00, + 0xc1, 0x0f, 0x08, 0x00, 0x99, 0x51, 0x03, 0x00, 0x9b, 0x33, 0x03, 0x00, 0xcd, 0x33, 0x04, + 0x00, 0x89, 0xe4, 0x04, 0x00, 0x81, 0x2a, 0x00, 0x00, 0x15, 0x5f, 0x05, 0x00, 0x33, 0x4f, + 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x81, 0x94, 0x03, 0x00, 0xd9, 0x3e, 0x02, 0x00, 0x25, + 0x00, 0x00, 0x00, 0x47, 0x76, 0x04, 0x00, 0x5c, 0x61, 0x08, 0x00, 0x91, 0x74, 0x04, 0x00, + 0x91, 0xf7, 0x01, 0x00, 0x8b, 0x09, 0x04, 0x00, 0x8b, 0xf7, 0x00, 0x00, 0x85, 0xf8, 0x00, + 0x00, 0x47, 0x15, 0x05, 0x00, 0x14, 0x54, 0x08, 0x00, 0xbd, 0x59, 0x05, 0x00, 0xe7, 0x59, + 0x05, 0x00, 0x14, 0x24, 0x08, 0x00, 0x21, 0x8f, 0x03, 0x00, 0x85, 0x26, 0x04, 0x00, 0xdc, + 0x50, 0x08, 0x00, 0xa6, 0x05, 0x00, 0x00, 0xd5, 0x2a, 0x00, 0x00, 0x2a, 0xfe, 0x00, 0x00, + 0x1d, 0x26, 0x05, 0x00, + + 0x01, 0x05, 0xff, 0xff, 0xe0, 0x70, 0x08, 0x00, 0xfa, 0x99, 0x94, 0x03, 0x00, 0xa9, 0x25, + 0x05, 0x00, 0x40, 0x1e, 0x80, 0x00, 0xd8, 0x4b, 0x19, 0x50, 0xd6, 0x49, 0x0a, 0x50, 0xf7, + 0x46, 0x00, 0xb5, 0xd6, 0x4a, 0x01, 0x8b, 0x91, 0x42, 0x07, 0xd0, 0x40, 0x69, 0x40, 0x30, + 0x2c, 0x21, 0x01, 0x22, 0x96, 0x46, 0xec, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0xeb, 0x48, 0x2b, + 0x30, 0x00, 0xbd, 0xfc, 0xb5, 0x01, 0x90, 0x45, 0x69, 0x00, 0x24, 0xb8, 0x20, 0x40, 0x5d, + 0x01, 0x28, 0x37, 0xd1, 0xc7, 0x26, 0x70, 0x5d, 0x01, 0x28, 0x0d, 0xd0, 0x03, 0x28, 0x0b, + 0xd0, 0x28, 0x1c, 0x01, 0x21, 0x8e, 0x46, 0xea, 0x49, 0xfe, 0x44, 0x08, 0x47, 0xbf, 0x20, + 0x40, 0x5d, 0x01, 0x28, 0x27, 0xd1, 0x6c, 0x8d, 0x25, 0xe0, 0xc0, 0x20, 0x44, 0x55, 0x77, + 0x5d, 0x74, 0x55, 0x28, 0x1c, 0x01, 0x21, 0x8e, 0x46, 0xe2, 0x49, 0xfe, 0x44, 0x08, 0x47, + 0x77, 0x55, 0xbf, 0x26, 0x70, 0x5d, 0x01, 0x28, 0x16, 0xd1, 0xe9, 0x8e, 0x2a, 0x8f, 0x28, + 0x1c, 0x01, 0x23, 0x9e, 0x46, 0xdd, 0x4b, 0xfe, 0x44, 0x18, 0x47, 0x00, 0x04, 0x00, 0x0c, + 0x04, 0x28, 0x06, 0xdd, 0x6c, 0x8d, 0xc0, 0x1e, 0x84, 0x42, 0x06, 0xdb, 0x04, 0x04, 0x24, + 0x0c, 0x03, 0xe0, 0x03, 0x21, 0xc0, 0x20, 0x41, 0x55, 0x74, 0x55, 0x28, 0x8d, 0x61, 0x1c, + 0x41, 0x43, 0x08, 0x04, 0x00, 0x0c, 0x01, 0x99, 0x88, 0x61, 0xd1, 0x49, 0xfc, 0x39, 0x09, + 0x78, 0xc9, 0x09, 0x10, 0xd3, 0x2e, 0x8d, 0x31, 0x1c, 0x01, 0x24, 0xa6, 0x46, 0xec, 0x4a, + 0xfe, 0x44, 0x10, 0x47, 0x00, 0x96, 0xeb, 0x48, 0x02, 0x78, 0xbb, 0x20, 0x43, 0x5d, 0x3a, + 0x20, 0xa6, 0x46, 0xee, 0x4c, 0xfe, 0x44, 0x20, 0x47, 0xed, 0x48, 0xb5, 0x30, 0xfc, 0xbd, + 0x01, 0x1c, 0x0a, 0x7b, + + 0x01, 0x05, 0xff, 0xff, 0xda, 0x71, 0x08, 0x00, 0xfa, 0xec, 0x48, 0x00, 0x2a, 0x02, 0xd0, + 0xc9, 0x69, 0x02, 0x29, 0x01, 0xd1, 0x63, 0x30, 0xf7, 0x46, 0xe9, 0x49, 0x43, 0x39, 0x08, + 0x18, 0xf7, 0x46, 0x02, 0x8a, 0x01, 0x79, 0x0a, 0x29, 0x00, 0xdb, 0x0a, 0x21, 0xe5, 0x48, + 0x8a, 0x42, 0x01, 0xdd, 0x65, 0x30, 0xf7, 0x46, 0x5b, 0x30, 0xf7, 0x46, 0x01, 0x6a, 0xc8, + 0x7b, 0x00, 0x02, 0x89, 0x7b, 0x01, 0x43, 0xb5, 0x48, 0x52, 0x30, 0x02, 0x88, 0xdf, 0x48, + 0x91, 0x42, 0x01, 0xd1, 0x2d, 0x30, 0xf7, 0x46, 0x29, 0x30, 0xf7, 0x46, 0xf0, 0xb5, 0xdc, + 0x49, 0x00, 0x7f, 0xc0, 0x00, 0x40, 0x18, 0x02, 0x1f, 0x13, 0x88, 0x87, 0x48, 0xda, 0x38, + 0x18, 0x40, 0x10, 0x80, 0x2f, 0x27, 0x3f, 0x02, 0xef, 0x4d, 0x2f, 0x82, 0x0c, 0x04, 0x24, + 0x0c, 0x2c, 0x80, 0x14, 0x26, 0x08, 0xe0, 0x64, 0x20, 0x01, 0x21, 0x8e, 0x46, 0xeb, 0x49, + 0xfe, 0x44, 0x08, 0x47, 0x70, 0x1e, 0x06, 0x06, 0x36, 0x0e, 0xa8, 0x89, 0x80, 0x0b, 0x01, + 0xd2, 0x00, 0x2e, 0xf1, 0xd1, 0xa8, 0x89, 0x40, 0x05, 0x40, 0x0f, 0x17, 0xd0, 0x07, 0x20, + 0x00, 0x02, 0x68, 0x81, 0x2f, 0x82, 0xeb, 0x48, 0x28, 0x81, 0x2c, 0x80, 0x14, 0x24, 0x08, + 0xe0, 0x64, 0x20, 0x01, 0x21, 0x8e, 0x46, 0xdd, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x60, 0x1e, + 0x04, 0x06, 0x24, 0x0e, 0xa8, 0x89, 0x80, 0x0b, 0x01, 0xd2, 0x00, 0x2c, 0xf1, 0xd1, 0xa8, + 0x89, 0x68, 0x88, 0xbc, 0x48, 0xff, 0x30, 0x34, 0x30, 0xf0, 0xbd, 0x10, 0xb5, 0x01, 0x6a, + 0xdf, 0x4a, 0x12, 0x68, 0x92, 0x88, 0x12, 0x13, 0x92, 0x07, 0x93, 0x0f, 0xdd, 0x4a, 0x02, + 0x2b, 0x01, 0xd0, 0x13, 0x88, 0x00, 0xe0, 0x03, 0x8b, 0x44, 0x68, 0x0c, 0x19, 0x44, 0x60, + 0x83, 0x61, 0x48, 0x88, + + 0x01, 0x05, 0xff, 0xff, 0xd4, 0x72, 0x08, 0x00, 0xfa, 0x18, 0x1a, 0x10, 0x80, 0xaf, 0x48, + 0xe7, 0x30, 0x10, 0xbd, 0x70, 0xb5, 0x05, 0x1c, 0x68, 0x68, 0x00, 0x28, 0x1a, 0xd1, 0xd3, + 0x4e, 0x35, 0x20, 0x00, 0x01, 0x84, 0x19, 0x20, 0x68, 0x01, 0x21, 0x8e, 0x46, 0xd1, 0x49, + 0xfe, 0x44, 0x08, 0x47, 0x20, 0x7f, 0x00, 0x28, 0x0d, 0xd0, 0xcf, 0x48, 0x00, 0x78, 0x02, + 0x28, 0x09, 0xd0, 0xe0, 0x7f, 0x50, 0x21, 0x41, 0x43, 0x71, 0x18, 0x48, 0x8e, 0x01, 0x30, + 0x48, 0x86, 0x60, 0x8a, 0x01, 0x38, 0x60, 0x82, 0x00, 0x20, 0xc3, 0x49, 0x08, 0x60, 0x01, + 0x20, 0x86, 0x46, 0xc6, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x68, 0x60, 0xc5, 0x48, 0x65, 0x30, + 0x70, 0xbd, 0xc5, 0x48, 0xd5, 0x30, 0xf7, 0x46, 0x00, 0xb5, 0x40, 0x69, 0x01, 0x21, 0x8e, + 0x46, 0xc2, 0x49, 0xfe, 0x44, 0x08, 0x47, 0xc2, 0x48, 0x35, 0x30, 0x00, 0xbd, 0x41, 0x69, + 0x09, 0x7c, 0x06, 0x29, 0x02, 0xd1, 0x01, 0x21, 0xbf, 0x4a, 0x11, 0x80, 0x0f, 0x21, 0x81, + 0x60, 0xbe, 0x48, 0x53, 0x30, 0xf7, 0x46, 0xc1, 0x68, 0x43, 0x68, 0x0a, 0x78, 0x0c, 0x2a, + 0x07, 0xd1, 0xbb, 0x4a, 0x12, 0x78, 0x00, 0x2a, 0x01, 0xd1, 0x06, 0x22, 0x00, 0xe0, 0x07, + 0x22, 0x4a, 0x70, 0x43, 0x61, 0xb7, 0x48, 0x09, 0x30, 0xf7, 0x46, 0x10, 0xb5, 0x80, 0x69, + 0xb4, 0x49, 0x09, 0x78, 0x00, 0x29, 0x09, 0xd1, 0x06, 0x24, 0x04, 0x70, 0x01, 0x30, 0x00, + 0x21, 0x01, 0x22, 0x96, 0x46, 0xb1, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x08, 0xe0, 0x07, 0x24, + 0x04, 0x70, 0x01, 0x30, 0x00, 0x21, 0x01, 0x22, 0x96, 0x46, 0xac, 0x4a, 0xfe, 0x44, 0x10, + 0x47, 0x04, 0x70, 0x01, 0x30, 0x0d, 0x21, 0x01, 0x24, 0xa6, 0x46, 0xa8, 0x4a, 0xfe, 0x44, + 0x10, 0x47, 0xe9, 0x49, + + 0x01, 0x05, 0xff, 0xff, 0xce, 0x73, 0x08, 0x00, 0xfa, 0xa6, 0x46, 0xa5, 0x4a, 0xfe, 0x44, + 0x10, 0x47, 0xe8, 0x48, 0x5d, 0x30, 0x10, 0xbd, 0x01, 0x1c, 0xe8, 0x48, 0x02, 0x78, 0xe6, + 0x48, 0x00, 0x2a, 0x01, 0xd0, 0x5d, 0x30, 0xf7, 0x46, 0x28, 0x22, 0x8a, 0x60, 0xc0, 0x1c, + 0xf7, 0x46, 0xe3, 0x49, 0x09, 0x78, 0x05, 0x29, 0x02, 0xd1, 0x01, 0x21, 0xe2, 0x4a, 0x11, + 0x70, 0x23, 0x21, 0x81, 0x60, 0xe1, 0x48, 0x27, 0x30, 0xf7, 0x46, 0x10, 0xb5, 0x01, 0x7e, + 0x00, 0x7d, 0x08, 0x43, 0xde, 0x4c, 0x0a, 0xd0, 0x00, 0x20, 0xed, 0x49, 0x08, 0x70, 0x01, + 0x20, 0x86, 0x46, 0xec, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x20, 0x1c, 0x79, 0x30, 0x10, 0xbd, + 0x20, 0x1c, 0x71, 0x30, 0x10, 0xbd, 0x81, 0x69, 0x4a, 0x78, 0xc2, 0x60, 0x49, 0x78, 0x18, + 0x29, 0x01, 0xdb, 0x17, 0x21, 0xc1, 0x60, 0xe4, 0x48, 0x39, 0x30, 0xf7, 0x46, 0xc0, 0x46, + 0x04, 0xf3, 0x1a, 0x00, 0x80, 0x7b, 0x08, 0x00, 0xd9, 0xfc, 0x00, 0x00, 0xf0, 0xb5, 0x45, + 0x68, 0x87, 0x68, 0x01, 0x24, 0xa4, 0x02, 0x05, 0xe0, 0x01, 0x20, 0x86, 0x46, 0xe7, 0x48, + 0xfe, 0x44, 0x00, 0x47, 0x01, 0x3c, 0xa8, 0x78, 0x69, 0x78, 0x09, 0x1a, 0xe5, 0x4e, 0x03, + 0x29, 0x10, 0xd0, 0xc9, 0x1c, 0x0e, 0xd0, 0x00, 0x2c, 0x0e, 0xd0, 0x03, 0x28, 0x02, 0xdb, + 0xc0, 0x1e, 0x00, 0x06, 0x00, 0x0e, 0x34, 0x21, 0x41, 0x43, 0x48, 0x19, 0x03, 0x30, 0x38, + 0x60, 0x30, 0x1c, 0x21, 0x30, 0xf0, 0xbd, 0x00, 0x2c, 0xe0, 0xd1, 0x04, 0x21, 0xeb, 0x48, + 0x0a, 0x1c, 0x23, 0x1c, 0x01, 0x24, 0xa6, 0x46, 0xea, 0x4c, 0xfe, 0x44, 0x20, 0x47, 0x30, + 0x1c, 0x25, 0x30, 0xf0, 0xbd, 0xc0, 0x46, 0x99, 0x94, 0x03, 0x00, 0xf9, 0x8c, 0x00, 0x00, + 0x10, 0xb5, 0xea, 0x4c, + + 0x01, 0x05, 0xff, 0xff, 0xc8, 0x74, 0x08, 0x00, 0xfa, 0xa0, 0x88, 0x01, 0x21, 0x8e, 0x46, + 0xe9, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x00, 0x28, 0x01, 0xd1, 0xe8, 0x48, 0xa0, 0x80, 0xe6, + 0x48, 0xff, 0x30, 0x6e, 0x30, 0x10, 0xbd, 0x15, 0x86, 0x00, 0x00, 0xe5, 0x66, 0x08, 0x00, + 0x62, 0x4f, 0x08, 0x00, 0xf8, 0xb5, 0x04, 0x1c, 0xa0, 0x69, 0x0e, 0x21, 0x0e, 0x18, 0x21, + 0x7f, 0x00, 0x29, 0x2c, 0xd1, 0x30, 0x1c, 0x01, 0x25, 0xae, 0x46, 0xde, 0x49, 0xfe, 0x44, + 0x08, 0x47, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x27, 0x08, 0xe0, 0xae, 0x46, 0xdb, 0x49, 0xfe, + 0x44, 0x08, 0x47, 0x00, 0x78, 0xa8, 0x21, 0x41, 0x43, 0xd9, 0x48, 0x47, 0x5c, 0x38, 0x1c, + 0xae, 0x46, 0xdc, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x80, 0x00, 0x00, 0x90, 0x38, 0x1c, 0xae, + 0x46, 0xd4, 0x49, 0xfe, 0x44, 0x08, 0x47, 0xae, 0x46, 0xd3, 0x49, 0xfe, 0x44, 0x08, 0x47, + 0x02, 0x1c, 0x02, 0x36, 0x30, 0x1c, 0x00, 0x99, 0x51, 0x18, 0xae, 0x46, 0xd0, 0x4a, 0xfe, + 0x44, 0x10, 0x47, 0xa0, 0x69, 0x60, 0x60, 0xce, 0x48, 0x81, 0x30, 0xf8, 0xbd, 0xcf, 0x48, + 0x1b, 0x30, 0xf7, 0x46, 0xad, 0x45, 0x05, 0x00, 0xa5, 0x21, 0x08, 0x00, 0xcc, 0x49, 0x0a, + 0x1c, 0x3a, 0x32, 0x12, 0x78, 0x09, 0x78, 0x89, 0x18, 0x41, 0x60, 0xca, 0x48, 0x83, 0x30, + 0xf7, 0x46, 0xfb, 0x8b, 0x04, 0x00, 0xa9, 0x86, 0x00, 0x00, 0xad, 0x99, 0x00, 0x00, 0xc6, + 0x05, 0x00, 0x00, 0x0f, 0xaa, 0x00, 0x00, 0x55, 0xde, 0x02, 0x00, 0x00, 0xa0, 0x1b, 0x00, + 0xf8, 0xb5, 0x00, 0x25, 0x00, 0x95, 0xb5, 0x49, 0xc5, 0x48, 0x00, 0x88, 0x88, 0x42, 0x01, + 0xd0, 0x01, 0x26, 0x06, 0xe0, 0x28, 0x1c, 0x01, 0x21, 0x8e, 0x46, 0xbc, 0x4a, 0xfe, 0x44, + 0x10, 0x47, 0x2e, 0x1c, + + 0x01, 0x05, 0xff, 0xff, 0xc2, 0x75, 0x08, 0x00, 0xfa, 0xab, 0x4f, 0x01, 0x24, 0x3c, 0x76, + 0xa6, 0x46, 0xb9, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x3d, 0x72, 0xb8, 0x4f, 0xb8, 0x6d, 0x69, + 0x46, 0xa6, 0x46, 0x8c, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x15, 0x21, 0x00, 0x98, 0x01, 0x70, + 0x00, 0x98, 0x46, 0x70, 0xb8, 0x6d, 0x00, 0x99, 0x2a, 0x1c, 0xa6, 0x46, 0xb1, 0x4b, 0xfe, + 0x44, 0x18, 0x47, 0xb0, 0x48, 0x3b, 0x30, 0xf8, 0xbd, 0xc0, 0x46, 0x18, 0x80, 0x1b, 0x00, + 0xc3, 0x8e, 0x03, 0x00, 0x10, 0xb5, 0x04, 0x1c, 0x9b, 0x49, 0xac, 0x48, 0x00, 0x88, 0x88, + 0x42, 0x05, 0xd1, 0x00, 0x20, 0x01, 0x21, 0x8e, 0x46, 0xa3, 0x4a, 0xfe, 0x44, 0x10, 0x47, + 0x01, 0x20, 0xa0, 0x60, 0xa7, 0x48, 0x57, 0x30, 0x10, 0xbd, 0x03, 0x13, 0x00, 0x00, 0xd4, + 0x48, 0x08, 0x00, 0x48, 0x61, 0x08, 0x00, 0x84, 0x45, 0x08, 0x00, 0xa3, 0x56, 0x05, 0x00, + 0xce, 0x0f, 0x08, 0x00, 0x29, 0x19, 0x02, 0x00, 0x0f, 0x1a, 0x02, 0x00, 0x81, 0x26, 0x01, + 0x00, 0xdb, 0xef, 0x04, 0x00, 0xb9, 0x28, 0x05, 0x00, 0x44, 0x61, 0x08, 0x00, 0xdb, 0x22, + 0x03, 0x00, 0x31, 0x4f, 0x08, 0x00, 0x5d, 0x86, 0x02, 0x00, 0xe7, 0x2a, 0x00, 0x00, 0xfe, + 0xb5, 0x00, 0x90, 0x86, 0x69, 0x00, 0x6a, 0x01, 0x90, 0x30, 0x89, 0x00, 0x28, 0x01, 0xd1, + 0x00, 0x24, 0x73, 0xe0, 0x31, 0x68, 0x2d, 0x24, 0x7a, 0x4a, 0x2c, 0x20, 0x80, 0x18, 0x02, + 0x90, 0x3e, 0x23, 0x01, 0x9d, 0x5b, 0x5d, 0x00, 0x78, 0x83, 0x42, 0x06, 0xd0, 0xa0, 0x5c, + 0x83, 0x42, 0x01, 0xd1, 0x01, 0x27, 0x02, 0xe0, 0x02, 0x27, 0x00, 0xe0, 0x00, 0x27, 0x48, + 0x68, 0x00, 0x0f, 0x1d, 0xd2, 0x30, 0x1c, 0x01, 0x25, 0xae, 0x46, 0x85, 0x49, 0xfe, 0x44, + 0x08, 0x47, 0x04, 0x1c, + + 0x01, 0x05, 0xff, 0xff, 0xbc, 0x76, 0x08, 0x00, 0xfa, 0x30, 0x68, 0x00, 0x28, 0x05, 0xd0, + 0x00, 0x1f, 0x31, 0x1c, 0xae, 0x46, 0x81, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x30, 0x89, 0x00, + 0x28, 0x49, 0xd1, 0x4a, 0x21, 0x01, 0x98, 0x08, 0x5c, 0x00, 0x28, 0x44, 0xd1, 0x02, 0x2f, + 0x42, 0xd0, 0xff, 0x21, 0x02, 0x98, 0x39, 0x54, 0x3e, 0xe0, 0x08, 0x25, 0x4c, 0x1b, 0x79, + 0x48, 0x00, 0x2f, 0x11, 0xd1, 0x21, 0x88, 0x00, 0x29, 0x03, 0xd1, 0x00, 0x20, 0x30, 0x60, + 0x70, 0x60, 0x07, 0xe0, 0x21, 0x88, 0x40, 0x18, 0x31, 0x1c, 0x01, 0x22, 0x96, 0x46, 0x70, + 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x00, 0x20, 0x20, 0x80, 0x11, 0xe0, 0x01, 0x2f, 0x0f, 0xd1, + 0xa1, 0x88, 0x00, 0x29, 0x03, 0xd1, 0x00, 0x20, 0x30, 0x60, 0x70, 0x60, 0x06, 0xe0, 0x40, + 0x18, 0x31, 0x1c, 0x01, 0x22, 0x96, 0x46, 0x67, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x00, 0x20, + 0xa0, 0x80, 0x30, 0x89, 0x01, 0x38, 0x30, 0x81, 0xe0, 0x78, 0x40, 0x07, 0x40, 0x0f, 0x05, + 0x43, 0xe5, 0x70, 0x30, 0x89, 0x00, 0x28, 0x09, 0xd1, 0x4a, 0x21, 0x01, 0x98, 0x08, 0x5c, + 0x00, 0x28, 0x04, 0xd1, 0x02, 0x2f, 0x02, 0xd0, 0xff, 0x21, 0x02, 0x98, 0x39, 0x54, 0x08, + 0x34, 0x00, 0x98, 0x44, 0x60, 0x56, 0x48, 0x51, 0x30, 0xfe, 0xbd, 0xc0, 0x46, 0xa2, 0x1b, + 0x00, 0x00, 0x5d, 0x15, 0x00, 0x00, 0xa5, 0xe0, 0x01, 0x00, 0x64, 0x61, 0x08, 0x00, 0x6d, + 0x17, 0x08, 0x00, 0x29, 0x22, 0x08, 0x00, 0x2f, 0x85, 0x03, 0x00, 0xc1, 0xcb, 0x03, 0x00, + 0xf0, 0xb5, 0x05, 0x1c, 0xae, 0x69, 0x00, 0x24, 0x6c, 0x60, 0x10, 0xe0, 0x11, 0x20, 0x40, + 0x01, 0x60, 0x43, 0x4c, 0x49, 0x0f, 0x18, 0x10, 0x20, 0xc0, 0x19, 0x31, 0x1c, 0x01, 0x22, + 0x96, 0x46, 0x49, 0x4a, + + 0x01, 0x05, 0xff, 0xff, 0xb6, 0x77, 0x08, 0x00, 0xfa, 0xfe, 0x44, 0x10, 0x47, 0x00, 0x28, + 0x00, 0xd1, 0x6f, 0x60, 0x01, 0x34, 0x47, 0x48, 0x00, 0x78, 0x84, 0x42, 0xea, 0xdb, 0x46, + 0x48, 0x47, 0x30, 0xf0, 0xbd, 0x1e, 0x17, 0x08, 0x00, 0xf1, 0xca, 0x03, 0x00, 0x91, 0x90, + 0x03, 0x00, 0x30, 0xb5, 0x45, 0x69, 0x68, 0x7a, 0xff, 0x28, 0x0d, 0xd0, 0x01, 0x24, 0xa6, + 0x46, 0x3f, 0x49, 0xfe, 0x44, 0x08, 0x47, 0xc2, 0x21, 0x08, 0x5c, 0x02, 0x28, 0x04, 0xd0, + 0x68, 0x7a, 0xa6, 0x46, 0x3b, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x3b, 0x48, 0xcf, 0x30, 0x30, + 0xbd, 0x17, 0x8f, 0x03, 0x00, 0xbd, 0x59, 0x05, 0x00, 0x70, 0xb5, 0x81, 0x68, 0x81, 0x61, + 0x45, 0x68, 0xb8, 0x20, 0x40, 0x5d, 0x37, 0x4e, 0x02, 0x28, 0x11, 0xd1, 0x01, 0x24, 0xa6, + 0x46, 0x33, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x00, 0x28, 0x0a, 0xd0, 0xa6, 0x46, 0x31, 0x48, + 0xfe, 0x44, 0x00, 0x47, 0x01, 0x28, 0x04, 0xd1, 0xbc, 0x20, 0x44, 0x55, 0x30, 0x1c, 0x8f, + 0x30, 0x70, 0xbd, 0x30, 0x1c, 0xc0, 0x1c, 0x70, 0xbd, 0x2c, 0x48, 0x65, 0x30, 0xf7, 0x46, + 0xc0, 0x46, 0x1f, 0x03, 0x00, 0x00, 0xdf, 0x87, 0x04, 0x00, 0x00, 0xb5, 0x40, 0x68, 0x01, + 0x21, 0x8e, 0x46, 0x28, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x26, 0x48, 0x57, 0x30, 0x00, 0xbd, + 0x14, 0x24, 0x08, 0x00, 0x19, 0x90, 0x01, 0x00, 0x89, 0x8d, 0x01, 0x00, 0xff, 0xff, 0x00, + 0x00, 0xf5, 0x2a, 0x00, 0x00, 0xd9, 0x8f, 0x01, 0x00, 0xcb, 0x18, 0x08, 0x00, 0xe9, 0x76, + 0x04, 0x00, 0xc5, 0x76, 0x04, 0x00, 0xd5, 0x2a, 0x00, 0x00, 0x39, 0x14, 0x02, 0x00, 0xc5, + 0x79, 0x04, 0x00, 0x9d, 0xb1, 0x03, 0x00, 0x87, 0x0f, 0x08, 0x00, 0x79, 0x95, 0x01, 0x00, + 0x29, 0xd9, 0x00, 0x00, + + 0x01, 0x05, 0xff, 0xff, 0xb0, 0x78, 0x08, 0x00, 0xfa, 0x11, 0xde, 0x02, 0x00, 0x14, 0x54, + 0x08, 0x00, 0xe7, 0x59, 0x05, 0x00, 0x59, 0xdd, 0x02, 0x00, 0x60, 0x61, 0x08, 0x00, 0xd5, + 0x44, 0x00, 0x00, 0xed, 0x20, 0x05, 0x00, 0x4d, 0x0b, 0x04, 0x00, 0x13, 0x22, 0x05, 0x00, + 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, 0x81, 0x94, 0x03, 0x00, 0x33, 0x4f, 0x08, + 0x00, 0x8d, 0xd0, 0x03, 0x00, 0x0b, 0x34, 0x04, 0x00, 0x1f, 0x33, 0x04, 0x00, 0x5d, 0x27, + 0x05, 0x00, 0x19, 0xde, 0x01, 0x00, 0xcd, 0x33, 0x04, 0x00, 0xbd, 0xa6, 0x00, 0x00, 0xb1, + 0x82, 0x00, 0x00, 0x73, 0x16, 0x02, 0x00, 0xdb, 0xef, 0x04, 0x00, 0xff, 0xb5, 0x68, 0x46, + 0xfe, 0xf7, 0x4c, 0xfe, 0xff, 0xbd, 0xff, 0xb5, 0x68, 0x46, 0xfe, 0xf7, 0x89, 0xfe, 0xff, + 0xbd, 0xff, 0xb5, 0x68, 0x46, 0xff, 0xf7, 0xbe, 0xf9, 0xff, 0xbd, 0xff, 0xb5, 0x68, 0x46, + 0xfd, 0xf0, 0xdf, 0xfa, 0xff, 0xbd, 0xff, 0xb5, 0x68, 0x46, 0xfe, 0xf7, 0x42, 0xfd, 0xff, + 0xbd, 0xff, 0xb5, 0x68, 0x46, 0xfd, 0xf0, 0xad, 0xfa, 0xff, 0xbd, 0xff, 0xb5, 0x68, 0x46, + 0xfe, 0xf7, 0x9c, 0xfe, 0xff, 0xbd, 0xff, 0xb5, 0x68, 0x46, 0xfe, 0xf7, 0xaf, 0xfe, 0xff, + 0xbd, 0xff, 0xb5, 0x68, 0x46, 0xfe, 0xf7, 0xac, 0xfd, 0xff, 0xbd, 0xff, 0xb5, 0x68, 0x46, + 0xfe, 0xf7, 0x35, 0xff, 0xff, 0xbd, 0xff, 0xb5, 0x68, 0x46, 0xfe, 0xf7, 0xda, 0xfd, 0xff, + 0xbd, 0xff, 0xb5, 0x68, 0x46, 0xfe, 0xf7, 0xa1, 0xfc, 0xff, 0xbd, 0xff, 0xb5, 0x68, 0x46, + 0xfe, 0xf7, 0x32, 0xfd, 0xff, 0xbd, 0xff, 0xb5, 0x68, 0x46, 0xff, 0xf7, 0x2f, 0xfa, 0xff, + 0xbd, 0xff, 0xb5, 0x68, 0x46, 0xff, 0xf7, 0x18, 0xf9, 0xff, 0xbd, 0xff, 0xb5, 0x68, 0x46, + 0xff, 0xf7, 0x45, 0xf8, + + 0x01, 0x05, 0xff, 0x1b, 0xaa, 0x79, 0x08, 0x00, 0x16, 0xff, 0xbd, 0xff, 0xb5, 0x68, 0x46, + 0xfe, 0xf7, 0x70, 0xff, 0xff, 0xbd, 0xff, 0xb5, 0x68, 0x46, 0xfe, 0xf7, 0xf1, 0xff, 0xff, + 0xbd, + + 0x01, 0x05, 0xff, 0x8d, 0x78, 0x7b, 0x08, 0x00, 0x88, 0x00, 0xb5, 0xf8, 0xf0, 0x41, 0xfa, + 0x00, 0xbd, 0xf7, 0x70, 0x08, 0x00, 0x51, 0x73, 0x08, 0x00, 0xaf, 0x72, 0x08, 0x00, 0xdf, + 0x72, 0x08, 0x00, 0x69, 0x73, 0x08, 0x00, 0x3d, 0x73, 0x08, 0x00, 0x8b, 0x73, 0x08, 0x00, + 0xdd, 0x73, 0x08, 0x00, 0xf5, 0x73, 0x08, 0x00, 0x37, 0x73, 0x08, 0x00, 0x69, 0x61, 0x08, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x74, 0x08, 0x00, 0x35, 0x74, 0x08, 0x00, 0xc5, 0x74, + 0x08, 0x00, 0xdd, 0x77, 0x08, 0x00, 0x59, 0x74, 0x08, 0x00, 0x0b, 0x72, 0x08, 0x00, 0x29, + 0x72, 0x08, 0x00, 0xa1, 0x75, 0x08, 0x00, 0x09, 0x76, 0x08, 0x00, 0x11, 0x78, 0x08, 0x00, + 0x4d, 0x78, 0x08, 0x00, 0xf1, 0x74, 0x08, 0x00, 0x63, 0x75, 0x08, 0x00, 0x71, 0x75, 0x08, + 0x00, 0x6d, 0x76, 0x08, 0x00, 0x95, 0x77, 0x08, 0x00, 0x5d, 0x78, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x17, 0x71, 0x08, 0x00, 0xf3, 0x71, 0x08, 0x00, + + 0x01, 0x05, 0xff, 0x85, 0x04, 0xf3, 0x1a, 0x00, 0x80, 0x1e, 0x8d, 0x00, 0x00, 0x2c, 0x23, + 0x03, 0x00, 0x3a, 0xdf, 0x02, 0x00, 0x3a, 0x1a, 0x02, 0x00, 0x64, 0x86, 0x02, 0x00, 0xe8, + 0x28, 0x05, 0x00, 0x7e, 0x15, 0x00, 0x00, 0xa6, 0xe0, 0x01, 0x00, 0x54, 0x85, 0x03, 0x00, + 0x52, 0x27, 0x01, 0x00, 0x7c, 0xbf, 0x02, 0x00, 0xff, 0xff, 0xff, 0xff, 0x2e, 0xcc, 0x03, + 0x00, 0xc8, 0x90, 0x03, 0x00, 0xf0, 0x8e, 0x01, 0x00, 0x22, 0x28, 0x05, 0x00, 0xbe, 0x59, + 0x05, 0x00, 0x72, 0xde, 0x02, 0x00, 0x6e, 0xdf, 0x02, 0x00, 0x64, 0xdd, 0x02, 0x00, 0x22, + 0x45, 0x00, 0x00, 0xbe, 0xa6, 0x00, 0x00, 0x08, 0x83, 0x00, 0x00, 0xb8, 0x14, 0x02, 0x00, + 0xae, 0xb1, 0x03, 0x00, 0xf8, 0x95, 0x01, 0x00, 0xf4, 0x20, 0x05, 0x00, 0xce, 0xd0, 0x03, + 0x00, 0xc6, 0x16, 0x02, 0x00, 0xff, 0xff, 0xff, 0xff, 0xbc, 0x86, 0x00, 0x00, 0x66, 0xaa, + 0x00, 0x00, + + 0x01, 0x05, 0xff, 0xff, 0x00, 0x00, 0x18, 0x00, 0xfa, 0xf0, 0xb5, 0x61, 0x4e, 0x07, 0x22, + 0x32, 0x70, 0x10, 0x23, 0x73, 0x70, 0x47, 0x20, 0xb0, 0x70, 0x22, 0x20, 0xf0, 0x70, 0x03, + 0x25, 0x28, 0x1c, 0x5d, 0x49, 0x01, 0x39, 0x01, 0x24, 0xa6, 0x46, 0x5a, 0x4f, 0xfe, 0x44, + 0x38, 0x47, 0xb2, 0x78, 0xf3, 0x78, 0x28, 0x1c, 0x58, 0x49, 0xa6, 0x46, 0x56, 0x4e, 0xfe, + 0x44, 0x30, 0x47, 0x28, 0x1c, 0x55, 0x49, 0x01, 0x31, 0xa6, 0x46, 0x55, 0x4a, 0xfe, 0x44, + 0x10, 0x47, 0x28, 0x1c, 0xb9, 0x21, 0xc9, 0x00, 0xa6, 0x46, 0x51, 0x4a, 0xfe, 0x44, 0x10, + 0x47, 0xa6, 0x46, 0x50, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x50, 0x4b, 0x00, 0x21, 0x08, 0x1c, + 0x1a, 0x68, 0x00, 0x2a, 0x04, 0xd0, 0x02, 0x07, 0x15, 0x0f, 0x22, 0x1c, 0xaa, 0x40, 0x11, + 0x43, 0x02, 0x07, 0x12, 0x0f, 0x0f, 0x2a, 0x05, 0xd1, 0xc5, 0x08, 0x06, 0x22, 0x2a, 0x40, + 0x48, 0x4d, 0xa9, 0x52, 0x00, 0x21, 0x04, 0x33, 0x01, 0x30, 0x20, 0x28, 0xe9, 0xd3, 0x3f, + 0x20, 0x45, 0x49, 0x08, 0x70, 0xa6, 0x46, 0x45, 0x48, 0xfe, 0x44, 0x00, 0x47, 0x43, 0x49, + 0x08, 0x60, 0xc8, 0x20, 0x43, 0x49, 0x08, 0x80, 0x3c, 0x23, 0x43, 0x48, 0x03, 0x70, 0x02, + 0x20, 0x42, 0x49, 0x08, 0x70, 0xff, 0x22, 0x42, 0x48, 0x02, 0x70, 0x42, 0x48, 0x04, 0x70, + 0x42, 0x48, 0x04, 0x70, 0x42, 0x48, 0x04, 0x70, 0x42, 0x48, 0x03, 0x70, 0x28, 0x23, 0x43, + 0x70, 0x14, 0x23, 0x83, 0x70, 0x08, 0x20, 0x3f, 0x4b, 0x18, 0x70, 0x3f, 0x48, 0x0c, 0x25, + 0x05, 0x73, 0x0b, 0x23, 0x83, 0x73, 0x0d, 0x23, 0x43, 0x73, 0x81, 0x20, 0x00, 0x03, 0x3c, + 0x4b, 0x18, 0x60, 0x3f, 0x48, 0x03, 0x1c, 0x5a, 0x33, 0x1c, 0x60, 0x00, 0x27, 0x39, 0x4b, + 0x1f, 0x70, 0x3a, 0x4b, + + 0x01, 0x05, 0xff, 0xff, 0xfa, 0x00, 0x18, 0x00, 0xfa, 0x39, 0x4e, 0x33, 0x80, 0x02, 0x70, + 0x3a, 0x4a, 0x13, 0x80, 0x4f, 0x30, 0x04, 0x70, 0x09, 0x20, 0x21, 0x21, 0xc9, 0x00, 0x0f, + 0x22, 0x37, 0x4b, 0xa6, 0x46, 0x37, 0x4e, 0xfe, 0x44, 0x30, 0x47, 0x39, 0x4e, 0x30, 0x1c, + 0x36, 0x38, 0x04, 0x21, 0xa6, 0x46, 0x34, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x20, 0x1c, 0x86, + 0x46, 0x33, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x30, 0x1c, 0x29, 0x1c, 0xa6, 0x46, 0x2f, 0x4a, + 0xfe, 0x44, 0x10, 0x47, 0x30, 0x1c, 0x29, 0x1c, 0xa6, 0x46, 0x2f, 0x4a, 0xfe, 0x44, 0x10, + 0x47, 0x2e, 0x4e, 0xa8, 0x19, 0xa6, 0x46, 0x2e, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x30, 0x1c, + 0xa6, 0x46, 0x2b, 0x49, 0xfe, 0x44, 0x08, 0x47, 0xa6, 0x46, 0x2a, 0x48, 0xfe, 0x44, 0x00, + 0x47, 0x38, 0x1c, 0xa6, 0x46, 0x2a, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x27, 0x49, 0x08, 0x60, + 0x28, 0x48, 0x07, 0x60, 0x28, 0x48, 0x07, 0x80, 0x0a, 0x20, 0x28, 0x49, 0x08, 0x70, 0xf0, + 0xbd, 0xf8, 0x4f, 0x08, 0x00, 0x7b, 0x88, 0x04, 0x00, 0xc6, 0x05, 0x00, 0x00, 0x65, 0x88, + 0x04, 0x00, 0x5b, 0x02, 0x18, 0x00, 0x80, 0x7b, 0x08, 0x00, 0x84, 0xf3, 0x1a, 0x00, 0xbf, + 0x11, 0x08, 0x00, 0x58, 0x61, 0x08, 0x00, 0x47, 0x76, 0x04, 0x00, 0x4a, 0x61, 0x08, 0x00, + 0x51, 0x61, 0x08, 0x00, 0x52, 0x61, 0x08, 0x00, 0x53, 0x61, 0x08, 0x00, 0x4e, 0x61, 0x08, + 0x00, 0x4f, 0x61, 0x08, 0x00, 0x50, 0x61, 0x08, 0x00, 0x10, 0x31, 0x19, 0x00, 0x15, 0x13, + 0x08, 0x00, 0xd8, 0x11, 0x08, 0x00, 0xf4, 0x20, 0x08, 0x00, 0x64, 0x61, 0x08, 0x00, 0x60, + 0x61, 0x08, 0x00, 0xff, 0xff, 0x00, 0x00, 0x62, 0x4f, 0x08, 0x00, 0x18, 0x24, 0x08, 0x00, + 0xb0, 0x3e, 0x18, 0x00, + + 0x01, 0x05, 0xff, 0xff, 0xf4, 0x01, 0x18, 0x00, 0xfa, 0x31, 0x06, 0x04, 0x00, 0x9d, 0xf5, + 0x04, 0x00, 0xc3, 0x8e, 0x03, 0x00, 0x36, 0x02, 0x1a, 0x00, 0xb5, 0xf5, 0x04, 0x00, 0xa0, + 0x17, 0x08, 0x00, 0xcb, 0x07, 0x04, 0x00, 0x07, 0x58, 0x02, 0x00, 0xbc, 0x62, 0x08, 0x00, + 0xc5, 0x79, 0x04, 0x00, 0xc0, 0x62, 0x08, 0x00, 0x62, 0x61, 0x08, 0x00, 0x2d, 0x22, 0x08, + 0x00, 0x70, 0xb5, 0x43, 0x4d, 0xae, 0x7f, 0x01, 0x24, 0xa6, 0x46, 0x3f, 0x48, 0xfe, 0x44, + 0x00, 0x47, 0xb0, 0x42, 0xf8, 0xd1, 0x03, 0x20, 0x17, 0x21, 0x89, 0x01, 0xa6, 0x46, 0x3b, + 0x4a, 0xfe, 0x44, 0x10, 0x47, 0xad, 0x7f, 0xa6, 0x46, 0x38, 0x48, 0xfe, 0x44, 0x00, 0x47, + 0xa8, 0x42, 0xf9, 0xd1, 0xfe, 0xe7, 0x70, 0xb5, 0x38, 0x49, 0x08, 0x1f, 0x38, 0x4a, 0x10, + 0x60, 0x04, 0x24, 0x35, 0x48, 0x04, 0x70, 0x44, 0x48, 0x02, 0x1c, 0x70, 0x3a, 0x21, 0x23, + 0x9b, 0x18, 0x01, 0x25, 0x1d, 0x70, 0x33, 0x4d, 0x0d, 0x60, 0x02, 0x25, 0x55, 0x71, 0x32, + 0x4d, 0x4d, 0x60, 0x03, 0x25, 0x15, 0x70, 0x31, 0x4d, 0x8d, 0x60, 0x14, 0x71, 0x31, 0x4c, + 0xcc, 0x60, 0x16, 0x24, 0xa4, 0x18, 0x05, 0x25, 0x25, 0x70, 0x2f, 0x4d, 0x0d, 0x61, 0x06, + 0x25, 0xd5, 0x74, 0x2e, 0x4d, 0x4d, 0x61, 0x07, 0x25, 0x95, 0x71, 0x95, 0x1d, 0x2c, 0x4e, + 0x8e, 0x61, 0x08, 0x26, 0xa6, 0x77, 0x2b, 0x4c, 0xcc, 0x61, 0x09, 0x24, 0x94, 0x70, 0x2a, + 0x4c, 0x0c, 0x62, 0x0a, 0x24, 0xac, 0x77, 0x29, 0x4c, 0x4c, 0x62, 0x0b, 0x24, 0x5c, 0x77, + 0x28, 0x4c, 0x8c, 0x62, 0x0c, 0x24, 0xd4, 0x71, 0x27, 0x4a, 0xca, 0x62, 0x0d, 0x22, 0x5a, + 0x75, 0x26, 0x4a, 0x0a, 0x63, 0x0e, 0x22, 0x02, 0x70, 0x26, 0x4a, 0x4a, 0x63, 0x0f, 0x22, + 0x42, 0x70, 0x25, 0x4a, + + 0x01, 0x05, 0xff, 0xc7, 0xee, 0x02, 0x18, 0x00, 0xc2, 0x8a, 0x63, 0x10, 0x22, 0xc2, 0x73, + 0x24, 0x4a, 0xca, 0x63, 0x01, 0x38, 0x11, 0x22, 0x02, 0x70, 0x23, 0x4a, 0x0a, 0x64, 0x12, + 0x22, 0x02, 0x71, 0x22, 0x48, 0x48, 0x64, 0x00, 0x20, 0x23, 0x49, 0x08, 0x80, 0x23, 0x49, + 0x08, 0x80, 0x19, 0x21, 0x49, 0x01, 0x1e, 0x4a, 0x11, 0x80, 0x4b, 0x21, 0x09, 0x01, 0x20, + 0x4a, 0xd1, 0x83, 0x20, 0x49, 0x21, 0x4a, 0x11, 0x80, 0x1b, 0x49, 0x08, 0x70, 0x70, 0xbd, + 0xc5, 0x83, 0x04, 0x00, 0x65, 0x88, 0x04, 0x00, 0x3c, 0x4e, 0x08, 0x00, 0xf2, 0x4f, 0x08, + 0x00, 0x70, 0x62, 0x08, 0x00, 0x70, 0x52, 0x08, 0x00, 0x71, 0x79, 0x08, 0x00, 0x5d, 0x79, + 0x08, 0x00, 0x7b, 0x79, 0x08, 0x00, 0x85, 0x79, 0x08, 0x00, 0x67, 0x79, 0x08, 0x00, 0xad, + 0x79, 0x08, 0x00, 0xb7, 0x79, 0x08, 0x00, 0xa3, 0x79, 0x08, 0x00, 0x99, 0x79, 0x08, 0x00, + 0x8f, 0x79, 0x08, 0x00, 0x21, 0x79, 0x08, 0x00, 0x2b, 0x79, 0x08, 0x00, 0x3f, 0x79, 0x08, + 0x00, 0xe4, 0x52, 0x08, 0x00, 0x0d, 0x79, 0x08, 0x00, 0x17, 0x79, 0x08, 0x00, 0x49, 0x79, + 0x08, 0x00, 0x53, 0x79, 0x08, 0x00, 0x35, 0x79, 0x08, 0x00, 0x98, 0x23, 0x08, 0x00, 0x54, + 0x1d, 0x18, 0x00, 0x44, 0x61, 0x08, 0x00, 0x46, 0x61, 0x08, 0x00, 0x14, 0x24, 0x08, 0x00, + 0xff, 0xff, 0x00, 0x00, 0x50, 0x1d, 0x18, 0x00, + + 0x01, 0x05, 0xff, 0xf1, 0xa0, 0x4e, 0x18, 0x00, 0xec, 0x70, 0xb5, 0x06, 0x1c, 0x2c, 0x4c, + 0xa0, 0x8a, 0x0f, 0x28, 0x1d, 0xda, 0x20, 0x89, 0x00, 0x28, 0x1a, 0xd0, 0x2a, 0x48, 0x04, + 0x21, 0x01, 0x25, 0xae, 0x46, 0x2c, 0x4a, 0xfe, 0x44, 0x10, 0x47, 0x00, 0x28, 0x11, 0xd1, + 0x20, 0x1c, 0xae, 0x46, 0x25, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x01, 0x1c, 0x08, 0x30, 0x24, + 0x4a, 0x10, 0x80, 0x0c, 0x20, 0x00, 0x19, 0xae, 0x46, 0x24, 0x4a, 0xfe, 0x44, 0x10, 0x47, + 0xa0, 0x8a, 0x0f, 0x28, 0xe1, 0xdb, 0x1f, 0x48, 0x40, 0x30, 0x30, 0x62, 0x70, 0xbd, 0xf8, + 0xb5, 0xff, 0x21, 0x0b, 0x31, 0x80, 0x8a, 0x88, 0x42, 0x2c, 0xd1, 0x00, 0x20, 0x01, 0x25, + 0xae, 0x46, 0x1c, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x01, 0x1c, 0x00, 0x90, 0x1a, 0x4c, 0x20, + 0x68, 0x01, 0x30, 0x20, 0x60, 0x2b, 0x27, 0xff, 0x00, 0x18, 0x4e, 0x19, 0x48, 0x00, 0x8c, + 0x32, 0x68, 0x10, 0x18, 0x80, 0x01, 0x80, 0x09, 0xae, 0x46, 0x17, 0x4a, 0xfe, 0x44, 0x10, + 0x47, 0x00, 0x28, 0x11, 0xdd, 0x00, 0x98, 0x30, 0x60, 0x20, 0x68, 0x03, 0x28, 0x0a, 0xd9, + 0x00, 0x20, 0xae, 0x46, 0x10, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x0e, 0x48, 0x38, 0x5c, 0xae, + 0x46, 0x0d, 0x49, 0xfe, 0x44, 0x08, 0x47, 0x00, 0x20, 0x20, 0x60, 0xf8, 0xbd, 0xa0, 0x17, + 0x08, 0x00, 0x4a, 0x0c, 0x1a, 0x00, 0x4d, 0x0b, 0x04, 0x00, 0x32, 0x02, 0x1a, 0x00, 0xa5, + 0x57, 0x02, 0x00, 0x6b, 0xf7, 0x04, 0x00, 0x8b, 0x09, 0x04, 0x00, 0xc5, 0x79, 0x04, 0x00, + 0xc0, 0x62, 0x08, 0x00, 0xbc, 0x62, 0x08, 0x00, 0x48, 0x10, 0x08, 0x00, 0x49, 0x11, 0x02, + 0x00, 0x39, 0x7a, 0x04, 0x00, + + 0x01, 0x83, 0xff, 0x14, 0x79, 0x7b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + // + // + // + // + 0x01, 0x0c, 0xfd, 0x09, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x64, 0x00, + + 0x01, 0x09, 0xfd, 0x08, 0x58, 0x60, 0x1a, 0x00, 0x00, 0x10, 0x00, 0x10, + + 0x01, 0x09, 0xfd, 0x08, 0x10, 0x60, 0x1a, 0x00, 0x10, 0x00, 0x10, 0x00, + + 0x01, 0x76, 0xfd, 0x31, 0x01, 0x21, 0x54, 0x00, 0x00, 0x61, 0x57, 0x00, 0x00, 0x14, 0x05, + 0x0a, 0x05, 0x00, 0x07, 0x06, 0x0a, 0x04, 0x05, 0x08, 0x09, 0x0b, 0x0c, 0x0d, 0x0e, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + + // BTstack: added HCI_VS_SET_POWER_VECTOR(GFSK) 0xFD82 template + 0x01, 0x82, 0xfd, 0x14, 0x00, 0x9c, 0x18, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xdc, + 0xe6, 0xf0, 0xfa, 0x04, 0x0e, 0x18, 0xff, 0x00, 0x00, + + // BTstack: added HCI_VS_SET_POWER_VECTOR(EDR2) 0xFD82 template + 0x01, 0x82, 0xfd, 0x14, 0x01, 0x9c, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xd8, + 0xe2, 0xec, 0xf6, 0x00, 0x0a, 0x14, 0xff, 0x00, 0x00, + + // BTstack: added HCI_VS_SET_POWER_VECTOR(EDR2) 0xFD82 template + 0x01, 0x82, 0xfd, 0x14, 0x01, 0x9c, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xd8, + 0xe2, 0xec, 0xf6, 0x00, 0x0a, 0x14, 0xff, 0x00, 0x00, + + // BTstack: added HCI_VS_SET_CLASS2_SINGLE_POWER 0xFD87 template + 0x01, 0x87, 0xfd, 0x03, 0x0d, 0x0d, 0x0d, + + 0x01, 0x80, 0xfd, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + + 0x01, 0x80, 0xfd, 0x06, 0x3c, 0xf0, 0x5f, 0x00, 0x00, 0x00, + + 0x01, 0x1c, 0xfd, 0x14, 0xff, 0x88, 0x13, 0x00, 0x00, 0xd0, 0x07, 0x00, 0x00, 0xff, 0xff, + 0x01, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x00, + + // + // + // + 0x01, 0x38, 0xfe, 0x00, + + // + // ################################################################# + // ## START of CC2564 Adds-On + // ################################################################# + // + // ## Enable fast clock XTAL support + 0x01, 0x1c, 0xfd, 0x14, 0x01, 0x88, 0x13, 0x00, 0x00, 0xd0, 0x07, 0x00, 0x00, 0xff, 0xff, + 0x04, 0xff, 0xff, 0xff, 0xfa, 0x00, 0x00, 0x00, 0x00, + + // + // ## Enable eHCILL + 0x01, 0x2b, 0xfd, 0x05, 0x10, 0x00, 0x50, 0x00, 0x96, + + // + 0x01, 0x0c, 0xfd, 0x09, 0x01, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0x64, 0x00, + + // + // ################################################################# + // ## END of CC2564 Adds-On + // ################################################################# + // +}; + +const uint32_t cc256x_init_script_size = 8306; + diff --git a/port/max32630-fthr-mbed/src/spp_counter.c b/port/max32630-fthr-mbed/src/spp_counter.c new file mode 100644 index 0000000000..3df27f8a99 --- /dev/null +++ b/port/max32630-fthr-mbed/src/spp_counter.c @@ -0,0 +1,267 @@ +/* + * Copyright (C) 2014 BlueKitchen GmbH + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 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 holders nor the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * 4. Any redistribution, use, or modification is done solely for + * personal benefit and not for any commercial purpose or for + * monetary gain. + * + * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH 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 MATTHIAS + * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Please inquire about commercial licensing options at + * contact@bluekitchen-gmbh.com + * + */ + +#define __BTSTACK_FILE__ "spp_counter.c" + +// ***************************************************************************** +/* EXAMPLE_START(spp_counter): SPP Server - Heartbeat Counter over RFCOMM + * + * @text The Serial port profile (SPP) is widely used as it provides a serial + * port over Bluetooth. The SPP counter example demonstrates how to setup an SPP + * service, and provide a periodic timer over RFCOMM. + */ +// ***************************************************************************** + +#include +#include +#include +#include +#include + +#include "btstack.h" + +#define RFCOMM_SERVER_CHANNEL 1 +#define HEARTBEAT_PERIOD_MS 1000 + +static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); + +static uint16_t rfcomm_channel_id; +static uint8_t spp_service_buffer[150]; +static btstack_packet_callback_registration_t hci_event_callback_registration; + + +/* @section SPP Service Setup + *s + * @text To provide an SPP service, the L2CAP, RFCOMM, and SDP protocol layers + * are required. After setting up an RFCOMM service with channel nubmer + * RFCOMM_SERVER_CHANNEL, an SDP record is created and registered with the SDP server. + * Example code for SPP service setup is + * provided in Listing SPPSetup. The SDP record created by function + * spp_create_sdp_record consists of a basic SPP definition that uses the provided + * RFCOMM channel ID and service name. For more details, please have a look at it + * in \path{src/sdp_util.c}. + * The SDP record is created on the fly in RAM and is deterministic. + * To preserve valuable RAM, the result could be stored as constant data inside the ROM. + */ + +/* LISTING_START(SPPSetup): SPP service setup */ +static void spp_service_setup(void){ + + // register for HCI events + hci_event_callback_registration.callback = &packet_handler; + hci_add_event_handler(&hci_event_callback_registration); + + l2cap_init(); + + rfcomm_init(); + rfcomm_register_service(packet_handler, RFCOMM_SERVER_CHANNEL, 0xffff); // reserved channel, mtu limited by l2cap + + // init SDP, create record for SPP and register with SDP + sdp_init(); + memset(spp_service_buffer, 0, sizeof(spp_service_buffer)); + spp_create_sdp_record(spp_service_buffer, 0x10001, RFCOMM_SERVER_CHANNEL, "SPP Counter"); + sdp_register_service(spp_service_buffer); + printf("SDP service record size: %u\n", de_get_len(spp_service_buffer)); +} +/* LISTING_END */ + +/* @section Periodic Timer Setup + * + * @text The heartbeat handler increases the real counter every second, + * and sends a text string with the counter value, as shown in Listing PeriodicCounter. + */ + +/* LISTING_START(PeriodicCounter): Periodic Counter */ +static btstack_timer_source_t heartbeat; +static char lineBuffer[30]; +static void heartbeat_handler(struct btstack_timer_source *ts){ + static int counter = 0; + + if (rfcomm_channel_id){ + sprintf(lineBuffer, "BTstack counter %04u\n", ++counter); + printf("%s", lineBuffer); + + rfcomm_request_can_send_now_event(rfcomm_channel_id); + } + + btstack_run_loop_set_timer(ts, HEARTBEAT_PERIOD_MS); + btstack_run_loop_add_timer(ts); +} + +static void one_shot_timer_setup(void){ + // set one-shot timer + heartbeat.process = &heartbeat_handler; + btstack_run_loop_set_timer(&heartbeat, HEARTBEAT_PERIOD_MS); + btstack_run_loop_add_timer(&heartbeat); +} +/* LISTING_END */ + + +/* @section Bluetooth Logic + * @text The Bluetooth logic is implemented within the + * packet handler, see Listing SppServerPacketHandler. In this example, + * the following events are passed sequentially: + * - BTSTACK_EVENT_STATE, + * - HCI_EVENT_PIN_CODE_REQUEST (Standard pairing) or + * - HCI_EVENT_USER_CONFIRMATION_REQUEST (Secure Simple Pairing), + * - RFCOMM_EVENT_INCOMING_CONNECTION, + * - RFCOMM_EVENT_CHANNEL_OPENED, +* - RFCOMM_EVETN_CAN_SEND_NOW, and + * - RFCOMM_EVENT_CHANNEL_CLOSED + */ + +/* @text Upon receiving HCI_EVENT_PIN_CODE_REQUEST event, we need to handle + * authentication. Here, we use a fixed PIN code "0000". + * + * When HCI_EVENT_USER_CONFIRMATION_REQUEST is received, the user will be + * asked to accept the pairing request. If the IO capability is set to + * SSP_IO_CAPABILITY_DISPLAY_YES_NO, the request will be automatically accepted. + * + * The RFCOMM_EVENT_INCOMING_CONNECTION event indicates an incoming connection. + * Here, the connection is accepted. More logic is need, if you want to handle connections + * from multiple clients. The incoming RFCOMM connection event contains the RFCOMM + * channel number used during the SPP setup phase and the newly assigned RFCOMM + * channel ID that is used by all BTstack commands and events. + * + * If RFCOMM_EVENT_CHANNEL_OPENED event returns status greater then 0, + * then the channel establishment has failed (rare case, e.g., client crashes). + * On successful connection, the RFCOMM channel ID and MTU for this + * channel are made available to the heartbeat counter. After opening the RFCOMM channel, + * the communication between client and the application + * takes place. In this example, the timer handler increases the real counter every + * second. + * + * RFCOMM_EVENT_CAN_SEND_NOW indicates that it's possible to send an RFCOMM packet + * on the rfcomm_cid that is include + + */ + +/* LISTING_START(SppServerPacketHandler): SPP Server - Heartbeat Counter over RFCOMM */ +static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ + UNUSED(channel); + +/* LISTING_PAUSE */ + bd_addr_t event_addr; + uint8_t rfcomm_channel_nr; + uint16_t mtu; + int i; + + switch (packet_type) { + case HCI_EVENT_PACKET: + switch (hci_event_packet_get_type(packet)) { +/* LISTING_RESUME */ + case HCI_EVENT_PIN_CODE_REQUEST: + // inform about pin code request + printf("Pin code request - using '0000'\n"); + hci_event_pin_code_request_get_bd_addr(packet, event_addr); + gap_pin_code_response(event_addr, "0000"); + break; + + case HCI_EVENT_USER_CONFIRMATION_REQUEST: + // ssp: inform about user confirmation request + printf("SSP User Confirmation Request with numeric value '%06"PRIu32"'\n", little_endian_read_32(packet, 8)); + printf("SSP User Confirmation Auto accept\n"); + break; + + case RFCOMM_EVENT_INCOMING_CONNECTION: + // data: event (8), len(8), address(48), channel (8), rfcomm_cid (16) + rfcomm_event_incoming_connection_get_bd_addr(packet, event_addr); + rfcomm_channel_nr = rfcomm_event_incoming_connection_get_server_channel(packet); + rfcomm_channel_id = rfcomm_event_incoming_connection_get_rfcomm_cid(packet); + printf("RFCOMM channel %u requested for %s\n", rfcomm_channel_nr, bd_addr_to_str(event_addr)); + rfcomm_accept_connection(rfcomm_channel_id); + break; + + case RFCOMM_EVENT_CHANNEL_OPENED: + // data: event(8), len(8), status (8), address (48), server channel(8), rfcomm_cid(16), max frame size(16) + if (rfcomm_event_channel_opened_get_status(packet)) { + printf("RFCOMM channel open failed, status %u\n", rfcomm_event_channel_opened_get_status(packet)); + } else { + rfcomm_channel_id = rfcomm_event_channel_opened_get_rfcomm_cid(packet); + mtu = rfcomm_event_channel_opened_get_max_frame_size(packet); + printf("RFCOMM channel open succeeded. New RFCOMM Channel ID %u, max frame size %u\n", rfcomm_channel_id, mtu); + } + break; + case RFCOMM_EVENT_CAN_SEND_NOW: + rfcomm_send(rfcomm_channel_id, (uint8_t*) lineBuffer, strlen(lineBuffer)); + break; + +/* LISTING_PAUSE */ + case RFCOMM_EVENT_CHANNEL_CLOSED: + printf("RFCOMM channel closed\n"); + rfcomm_channel_id = 0; + break; + + default: + break; + } + break; + + case RFCOMM_DATA_PACKET: + printf("RCV: '"); + for (i=0;i