diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa3aee4a5d..3dda76db4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: test: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 steps: - name: Dump GitHub context env: @@ -94,15 +94,16 @@ jobs: path: mpy-cross/mpy-cross.static.exe mpy-cross-mac: - runs-on: macos-latest + runs-on: macos-10.15 steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - name: Install deps + - name: Make gettext programs available run: | - brew link --force gettext + brew install gettext + echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH" - name: Versions run: | gcc --version @@ -126,7 +127,7 @@ jobs: path: mpy-cross/mpy-cross build-arm: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 needs: test strategy: fail-fast: false @@ -200,18 +201,22 @@ jobs: - "monster_m4sk" - "ndgarage_ndbit6" - "nfc_copy_cat" + - "nucleo_f746zg" - "nucleo_f767zi" - "nucleo_h743zi_2" - "ohs2020_badge" - "openbook_m4" + - "openmv_h7" - "particle_argon" - "particle_boron" - "particle_xenon" - "pca10056" - "pca10059" + - "pca10100" - "pewpew10" - "pewpew_m4" - "pirkey_m0" + - "pitaya_go" - "pyb_nano_v2" - "pybadge" - "pybadge_airlift" @@ -227,6 +232,7 @@ jobs: - "seeeduino_xiao" - "serpente" - "shirtty" + - "simmel" - "snekboard" - "sparkfun_lumidrive" - "sparkfun_nrf52840_mini" @@ -241,8 +247,10 @@ jobs: - "stm32f411ve_discovery" - "stm32f412zg_discovery" - "stm32f4_discovery" + - "stm32f746g_discovery" - "stringcar_m0_express" - "teensy40" + - "teensy41" - "teknikio_bluebird" - "thunderpack" - "trellis_m4_express" @@ -299,7 +307,7 @@ jobs: if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) build-riscv: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 needs: test strategy: fail-fast: false @@ -323,9 +331,14 @@ jobs: gcc --version riscv64-unknown-elf-gcc --version python3 --version - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: submodules: true + fetch-depth: 0 + - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* + - run: git submodule sync + - run: git submodule foreach git remote -v + - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: mpy-cross run: make -C mpy-cross -j2 - name: build diff --git a/.gitmodules b/.gitmodules index ebff8ecb2a..2884f79a57 100644 --- a/.gitmodules +++ b/.gitmodules @@ -122,3 +122,21 @@ [submodule "lib/protomatter"] path = lib/protomatter url = https://github.com/adafruit/Adafruit_Protomatter +[submodule "frozen/Adafruit_CircuitPython_LSM6DS"] + path = frozen/Adafruit_CircuitPython_LSM6DS + url = https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS +[submodule "frozen/Adafruit_CircuitPython_FocalTouch"] + path = frozen/Adafruit_CircuitPython_FocalTouch + url = https://github.com/adafruit/Adafruit_CircuitPython_FocalTouch +[submodule "frozen/Adafruit_CircuitPython_DS3231"] + path = frozen/Adafruit_CircuitPython_DS3231 + url = https://github.com/adafruit/Adafruit_CircuitPython_DS3231 +[submodule "frozen/Adafruit_CircuitPython_DRV2605"] + path = frozen/Adafruit_CircuitPython_DRV2605 + url = https://github.com/adafruit/Adafruit_CircuitPython_DRV2605 +[submodule "frozen/Adafruit_CircuitPython_BLE"] + path = frozen/Adafruit_CircuitPython_BLE + url = https://github.com/adafruit/Adafruit_CircuitPython_BLE +[submodule "frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center"] + path = frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center + url = https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center diff --git a/docs/porting.rst b/docs/porting.rst index 6bb5144588..d28f56f475 100644 --- a/docs/porting.rst +++ b/docs/porting.rst @@ -1,5 +1,5 @@ We love CircuitPython and would love to see it come to more microcontroller -platforms. With 3.0 we've reworked CircuitPython to make it easier than ever to +platforms. Since 3.0 we've reworked CircuitPython to make it easier than ever to add support. While there are some major differences between ports, this page covers the similarities that make CircuitPython what it is and how that core fits into a variety of microcontrollers. @@ -19,7 +19,7 @@ prepping file systems and automatically running user code on boot. In CircuitPython we've dubbed this component the supervisor because it monitors and facilitates the VMs which run user Python code. Porting involves the supervisor because many of the tasks it does while interfacing with the -hardware. Once its going though, the REPL works and debugging can migrate to a +hardware. Once complete, the REPL works and debugging can migrate to a Python based approach rather than C. The third core piece is the plethora of low level APIs that CircuitPython @@ -42,6 +42,44 @@ to the port's directory (in the top level until the ``ports`` directory is present). This includes the Makefile and any C library resources. Make sure these resources are compatible with the MIT License of the rest of the code! +Circuitpython has a number of modules enabled by default in +``py/circuitpy_mpconfig.mk``. Most of these modules will need to be disabled in +``mpconfigboard.mk`` during the early stages of a port in order for it to +compile. As the port progresses in module support, this list can be pruned down +as a natural "TODO" list. An example minimal build list is shown below: + +.. code-block:: makefile + + # These modules are implemented in ports//common-hal: + CIRCUITPY_MICROCONTROLLER = 0 # Typically the first module to create + CIRCUITPY_DIGITALIO = 0 # Typically the second module to create + CIRCUITPY_ANALOGIO = 0 + CIRCUITPY_BUSIO = 0 + CIRCUITPY_NEOPIXEL_WRITE = 0 + CIRCUITPY_PULSEIO = 0 + CIRCUITPY_OS = 0 + CIRCUITPY_NVM = 0 + CIRCUITPY_AUDIOBUSIO = 0 + CIRCUITPY_AUDIOIO = 0 + CIRCUITPY_ROTARYIO = 0 + CIRCUITPY_RTC = 0 + CIRCUITPY_FREQUENCYIO = 0 + CIRCUITPY_I2CSLAVE = 0 + CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok) + + # These modules are implemented in shared-module/ - they can be included in + # any port once their prerequisites in common-hal are complete. + CIRCUITPY_BITBANGIO = 0 # Requires DigitalIO + CIRCUITPY_GAMEPAD = 0 # Requires DigitalIO + CIRCUITPY_PIXELBUF = 0 # Requires neopixel_write or SPI (dotstar) + CIRCUITPY_RANDOM = 0 # Requires OS + CIRCUITPY_STORAGE = 0 # Requires OS, filesystem + CIRCUITPY_TOUCHIO = 0 # Requires Microcontroller + CIRCUITPY_USB_HID = 0 # Requires USB + CIRCUITPY_USB_MIDI = 0 # Requires USB + CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 # Does nothing without I2C + CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash + Step 2: Init -------------- Once your build is setup, the next step should be to get your clocks going as diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index e327d6ec6a..aa5ef02e28 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -26,7 +26,7 @@ import os import re -SUPPORTED_PORTS = ["atmel-samd", "nrf", "mimxrt10xx"] +SUPPORTED_PORTS = ["atmel-samd", "nrf", "stm", "mimxrt10xx"] def parse_port_config(contents, chip_keyword=None): @@ -98,7 +98,7 @@ def build_module_map(): for module in modules: full_name = module search_name = module.lstrip("_") - re_pattern = "CIRCUITPY_{}\s=\s(.+)".format(search_name.upper()) + re_pattern = "CIRCUITPY_{}\s*\??=\s*(.+)".format(search_name.upper()) find_config = re.findall(re_pattern, configs) if not find_config: continue @@ -139,7 +139,10 @@ def get_excluded_boards(base): re_board_chip = re.compile("CHIP_FAMILY\s=\s(\w+)") chip_keyword = "CHIP_FAMILY" elif port in ["nrf"]: - re_board_chip = re.compile("MCU_VARIANT\s=\s(\w+)") + re_board_chip = re.compile(r"MCU_VARIANT\s=\s(\w+)") + elif port in ["stm"]: + re_board_chip = re.compile(r"MCU_SERIES\s*=\s*(\w+)") + chip_keyword = "MCU_SERIES" port_dir = "ports/{}".format(port) @@ -158,10 +161,10 @@ def get_excluded_boards(base): contents = board.read() board_chip = re_board_chip.search(contents) - #print(entry.name, board_chip.group(1)) if not board_chip: board_chip = "Unknown Chip" else: + #print(entry.name, board_chip.group(1)) board_chip = board_chip.group(1) # add port_config results to contents @@ -172,18 +175,12 @@ def get_excluded_boards(base): check_dependent_modules = dict() for module in modules: board_is_excluded = False - # check if board uses `SMALL_BUILD`. if yes, and current + # check if board turns off `FULL_BUILD`. if yes, and current # module is marked as `FULL_BUILD`, board is excluded - small_build = re.search("CIRCUITPY_SMALL_BUILD = 1", contents) + small_build = re.search("CIRCUITPY_FULL_BUILD = 0", contents) if small_build and base[module]["full_build"] == "1": board_is_excluded = True - # check if board uses `MINIMAL_BUILD`. if yes, and current - # module is marked as `DEFAULT_BUILD`, board is excluded - min_build = re.search("CIRCUITPY_MINIMAL_BUILD = 1", contents) - if min_build and base[module]["default_value"] == "CIRCUITPY_DEFAULT_BUILD": - board_is_excluded = True - # check if module is specifically disabled for this board re_pattern = r"CIRCUITPY_{}\s=\s(\w)".format(module.upper()) find_module = re.search(re_pattern, contents) diff --git a/docs/supported_ports.rst b/docs/supported_ports.rst index bd237fb5da..09571afb67 100644 --- a/docs/supported_ports.rst +++ b/docs/supported_ports.rst @@ -1,14 +1,19 @@ Supported Ports ============================== -Adafruit's CircuitPython currently has limited support with a focus on supporting the Atmel SAMD -and ESP8266. +CircuitPython supports a number of microcontroller families. Support quality for each varies +depending on the active contributors for each port. + +Adafruit sponsored developers are actively contributing to atmel-samd, mimxrt10xx, nrf and stm +ports. They also maintain the other ports in order to ensure the boards build. Additional testing +is limited. .. toctree:: :maxdepth: 2 ../ports/atmel-samd/README + ../ports/cxd56/README + ../ports/litex/README ../ports/mimxrt10xx/README ../ports/nrf/README ../ports/stm/README - ../ports/cxd56/README diff --git a/extmod/modujson.c b/extmod/modujson.c index 6b24bf5781..0f93ccb110 100644 --- a/extmod/modujson.c +++ b/extmod/modujson.c @@ -53,6 +53,10 @@ STATIC mp_obj_t mod_ujson_dumps(mp_obj_t obj) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_ujson_dumps_obj, mod_ujson_dumps); +#define JSON_DEBUG(...) (void)0 +// #define JSON_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + + // The function below implements a simple non-recursive JSON parser. // // The JSON specification is at http://www.ietf.org/rfc/rfc4627.txt @@ -80,6 +84,7 @@ typedef struct _ujson_stream_t { STATIC byte ujson_stream_next(ujson_stream_t *s) { mp_uint_t ret = s->read(s->stream_obj, &s->cur, 1, &s->errcode); + JSON_DEBUG(" usjon_stream_next err:%2d cur: %c \n", s->errcode, s->cur); if (s->errcode != 0) { mp_raise_OSError(s->errcode); } @@ -89,9 +94,10 @@ STATIC byte ujson_stream_next(ujson_stream_t *s) { return s->cur; } -STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { +STATIC mp_obj_t _mod_ujson_load(mp_obj_t stream_obj, bool return_first_json) { const mp_stream_p_t *stream_p = mp_get_stream_raise(stream_obj, MP_STREAM_OP_READ); ujson_stream_t s = {stream_obj, stream_p->read, 0, 0}; + JSON_DEBUG("got JSON stream\n"); vstr_t vstr; vstr_init(&vstr, 8); mp_obj_list_t stack; // we use a list as a simple stack for nested JSON @@ -262,13 +268,18 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { } } success: - // eat trailing whitespace - while (unichar_isspace(S_CUR(s))) { - S_NEXT(s); - } - if (!S_END(s)) { - // unexpected chars - goto fail; + // It is legal for a stream to have contents after JSON. + // E.g., A UART is not closed after receiving an object; in load() we will + // return the first complete JSON object, while in loads() we will retain + // strict adherence to the buffer's complete semantic. + if (!return_first_json) { + while (unichar_isspace(S_CUR(s))) { + S_NEXT(s); + } + if (!S_END(s)) { + // unexpected chars + goto fail; + } } if (stack_top == MP_OBJ_NULL || stack.len != 0) { // not exactly 1 object @@ -280,6 +291,10 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { fail: mp_raise_ValueError(translate("syntax error in JSON")); } + +STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { + return _mod_ujson_load(stream_obj, true); +} STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_ujson_load_obj, mod_ujson_load); STATIC mp_obj_t mod_ujson_loads(mp_obj_t obj) { @@ -287,7 +302,7 @@ STATIC mp_obj_t mod_ujson_loads(mp_obj_t obj) { const char *buf = mp_obj_str_get_data(obj, &len); vstr_t vstr = {len, len, (char*)buf, true}; mp_obj_stringio_t sio = {{&mp_type_stringio}, &vstr, 0, MP_OBJ_NULL}; - return mod_ujson_load(MP_OBJ_FROM_PTR(&sio)); + return _mod_ujson_load(MP_OBJ_FROM_PTR(&sio), false); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_ujson_loads_obj, mod_ujson_loads); diff --git a/extmod/ulab b/extmod/ulab index a746bd8e09..cf61d728e7 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit a746bd8e0953853056ee405e2fa02c8ebca4fb79 +Subproject commit cf61d728e70b9ec57e5711b40540793a89296f5d diff --git a/frozen/Adafruit_CircuitPython_BLE b/frozen/Adafruit_CircuitPython_BLE new file mode 160000 index 0000000000..96774b15da --- /dev/null +++ b/frozen/Adafruit_CircuitPython_BLE @@ -0,0 +1 @@ +Subproject commit 96774b15da61da54662bcfbbf15b5bdc27315a9f diff --git a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center new file mode 160000 index 0000000000..3ffb3f02d2 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center @@ -0,0 +1 @@ +Subproject commit 3ffb3f02d2046910e09d1f5a74721bd1a4cdf8cf diff --git a/frozen/Adafruit_CircuitPython_DRV2605 b/frozen/Adafruit_CircuitPython_DRV2605 new file mode 160000 index 0000000000..7914a63903 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_DRV2605 @@ -0,0 +1 @@ +Subproject commit 7914a6390318687bb8e2e9c4119aa932fea01531 diff --git a/frozen/Adafruit_CircuitPython_DS3231 b/frozen/Adafruit_CircuitPython_DS3231 new file mode 160000 index 0000000000..0d49a1fcd9 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_DS3231 @@ -0,0 +1 @@ +Subproject commit 0d49a1fcd96c13a94e8bdf26f92abe79b8517906 diff --git a/frozen/Adafruit_CircuitPython_FocalTouch b/frozen/Adafruit_CircuitPython_FocalTouch new file mode 160000 index 0000000000..72968d3546 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_FocalTouch @@ -0,0 +1 @@ +Subproject commit 72968d3546f9d6c5af138d4c179343007cb9662c diff --git a/frozen/Adafruit_CircuitPython_LSM6DS b/frozen/Adafruit_CircuitPython_LSM6DS new file mode 160000 index 0000000000..24224cc905 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_LSM6DS @@ -0,0 +1 @@ +Subproject commit 24224cc905fad4646506caeb2451b4a495804ffc diff --git a/lib/protomatter b/lib/protomatter index c411714cbd..9f71088d2c 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit c411714cbdc05725e80398acb18c3c1fb6fa68a4 +Subproject commit 9f71088d2c32206c6f0495704ae0c040426d5764 diff --git a/lib/tinyusb b/lib/tinyusb index 1f95f439e1..a74a823b0a 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 1f95f439e11f519e69d75a4a8b7b9f28eaf5060e +Subproject commit a74a823b0a140667a4e4e80fa2678870faba2bd0 diff --git a/locale/ID.po b/locale/ID.po index fe503d20a5..3a2afdef8f 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -285,11 +285,12 @@ msgstr "Semua timer untuk pin ini sedang digunakan" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Semua timer sedang digunakan" @@ -433,6 +434,10 @@ msgstr "buffers harus mempunyai panjang yang sama" msgid "Bytes must be between 0 and 255." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -670,6 +675,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -681,7 +690,7 @@ msgstr "Channel EXTINT sedang digunakan" msgid "Error in regex" msgstr "Error pada regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -808,6 +817,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "operasi I2C tidak didukung" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -987,6 +1001,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS dari keyword arg harus menjadi sebuah id" @@ -1095,6 +1113,10 @@ msgstr "Tidak ada pin TX" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Tidak ada standar bus %q" @@ -1116,6 +1138,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Tidak ada dukungan hardware untuk pin" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1242,6 +1268,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1293,6 +1323,10 @@ msgstr "sistem file (filesystem) bersifat Read-only" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Channel Kanan tidak didukung" @@ -1357,6 +1391,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Memisahkan dengan menggunakan sub-captures" @@ -1440,6 +1478,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" @@ -2215,6 +2257,10 @@ msgstr "fungsi diharapkan setidaknya %d argumen, hanya mendapatkan %d" msgid "function got multiple values for argument '%q'" msgstr "fungsi mendapatkan nilai ganda untuk argumen '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2704,7 +2750,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 7a7eb5d440..edfef28df4 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -283,11 +283,12 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "" @@ -428,6 +429,10 @@ msgstr "" msgid "Bytes must be between 0 and 255." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -659,6 +664,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -670,7 +679,7 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -797,6 +806,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -976,6 +990,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1084,6 +1102,10 @@ msgstr "" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "" @@ -1105,6 +1127,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1228,6 +1254,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1278,6 +1308,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "" @@ -1341,6 +1375,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" @@ -1424,6 +1462,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" @@ -2191,6 +2233,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2679,7 +2725,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index ac7ff8cad0..578e2d86b2 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,15 +7,17 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" -"PO-Revision-Date: 2018-07-27 11:55-0700\n" -"Last-Translator: Pascal Deneaux\n" -"Language-Team: Sebastian Plamauer, Pascal Deneaux\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"PO-Revision-Date: 2020-04-30 17:01+0000\n" +"Last-Translator: Jeff Epler \n" +"Language-Team: German \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.1.1\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.0.2\n" #: main.c msgid "" @@ -31,12 +33,17 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Bitte melden Sie ein Problem mit dem Inhalt Ihres CIRCUITPY-Laufwerks unter\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Zum Beenden setzen Sie bitte die Karte ohne " #: py/obj.c msgid " File \"%q\"" @@ -142,11 +149,11 @@ msgstr "'%s' Integer 0x%x passt nicht in Maske 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" -msgstr "" +msgstr "Das Objekt '%s' kann das Attribut '%q' nicht zuweisen" #: py/proto.c msgid "'%s' object does not support '%q'" -msgstr "" +msgstr "Das Objekt '%s' unterstützt '%q' nicht" #: py/obj.c #, c-format @@ -196,7 +203,7 @@ msgstr "'align' erfordert genau ein Argument" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "" +msgstr "'async for' oder 'async with' außerhalb der asynchronen Funktion" #: py/compile.c msgid "'await' outside function" @@ -240,7 +247,7 @@ msgstr "" #: py/objcomplex.c msgid "0.0 to a complex power" -msgstr "" +msgstr "0.0 zu einer komplexen Potenz" #: py/modbuiltins.c msgid "3-arg pow() not supported" @@ -285,11 +292,12 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Alle timer werden benutzt" @@ -432,6 +440,10 @@ msgstr "Der Puffer muss 16 Bytes lang sein" msgid "Bytes must be between 0 and 255." msgstr "Ein Bytes kann nur Werte zwischen 0 und 255 annehmen." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "Rufe super().__init__() vor dem Zugriff auf ein natives Objekt auf." @@ -663,6 +675,10 @@ msgstr "Die Rotation der Anzeige muss in 90-Grad-Schritten erfolgen" msgid "Drive mode not used when direction is input." msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -674,7 +690,7 @@ msgstr "EXTINT Kanal ist schon in Benutzung" msgid "Error in regex" msgstr "Fehler in regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -803,6 +819,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "I2C-operation nicht unterstützt" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -984,6 +1005,10 @@ msgstr "Ungültige wave Datei" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS des Schlüsselwortarguments muss eine id sein" @@ -1093,6 +1118,10 @@ msgstr "Kein TX Pin" msgid "No available clocks" msgstr "Keine Taktgeber verfügbar" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Kein Standard %q Bus" @@ -1114,6 +1143,10 @@ msgstr "Keine Hardwareunterstützung am clk Pin" msgid "No hardware support on pin" msgstr "Keine Hardwareunterstützung an diesem Pin" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1245,6 +1278,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1295,6 +1332,10 @@ msgstr "Schreibgeschützte Objekt" msgid "Refresh too soon" msgstr "Zu früh neu geladen" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Rechter Kanal wird nicht unterstützt" @@ -1358,6 +1399,10 @@ msgstr "Slice und Wert (value) haben unterschiedliche Längen." msgid "Slices not supported" msgstr "Slices werden nicht unterstützt" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Splitting mit sub-captures" @@ -1443,6 +1488,10 @@ msgstr "" msgid "Too many displays" msgstr "Zu viele displays" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Zurückverfolgung (jüngste Aufforderung zuletzt):\n" @@ -2220,6 +2269,10 @@ msgstr "Funktion erwartet maximal %d Argumente, aber hat %d erhalten" msgid "function got multiple values for argument '%q'" msgstr "Funktion hat mehrere Werte für Argument '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2715,7 +2768,8 @@ msgstr "nur eine sample_rate=16000 wird unterstützt" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index ab482425e8..6aba6d3262 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -283,11 +283,12 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "" @@ -428,6 +429,10 @@ msgstr "" msgid "Bytes must be between 0 and 255." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -659,6 +664,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -670,7 +679,7 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -797,6 +806,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -976,6 +990,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1084,6 +1102,10 @@ msgstr "" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "" @@ -1105,6 +1127,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1228,6 +1254,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1278,6 +1308,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "" @@ -1341,6 +1375,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" @@ -1424,6 +1462,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" @@ -2191,6 +2233,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2679,7 +2725,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 7deda37182..36583bfd2f 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,15 +7,17 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" -"PO-Revision-Date: 2018-07-27 11:55-0700\n" -"Last-Translator: \n" -"Language-Team: @sommersoft, @MrCertainly\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"PO-Revision-Date: 2020-03-30 22:11+0000\n" +"Last-Translator: Tannewt \n" +"Language-Team: English \n" "Language: en_x_pirate\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.1.1\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.11.3\n" #: main.c msgid "" @@ -31,6 +33,9 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Yar, there is a hole in the keel. Let the cap'n know at\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" @@ -285,11 +290,12 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "" @@ -432,6 +438,10 @@ msgstr "" msgid "Bytes must be between 0 and 255." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -663,6 +673,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -674,7 +688,7 @@ msgstr "Avast! EXTINT channel already in use" msgid "Error in regex" msgstr "" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -801,6 +815,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -980,6 +999,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1088,6 +1111,10 @@ msgstr "" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "" @@ -1109,6 +1136,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1232,6 +1263,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1282,6 +1317,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "" @@ -1345,6 +1384,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" @@ -1428,6 +1471,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" @@ -2195,6 +2242,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2683,7 +2734,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/es.po b/locale/es.po index 388a8b3be9..b20ddff7df 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -287,11 +287,12 @@ msgstr "Todos los timers para este pin están siendo utilizados" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Todos los timers en uso" @@ -434,6 +435,10 @@ msgstr "Byte buffer debe de ser 16 bytes" msgid "Bytes must be between 0 and 255." msgstr "Bytes debe estar entre 0 y 255." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -665,6 +670,10 @@ msgstr "Rotación de display debe ser en incrementos de 90 grados" msgid "Drive mode not used when direction is input." msgstr "Modo Drive no se usa cuando la dirección es input." +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -676,7 +685,7 @@ msgstr "El canal EXTINT ya está siendo utilizado" msgid "Error in regex" msgstr "Error en regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -803,6 +812,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "operación I2C no soportada" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -984,6 +998,10 @@ msgstr "Archivo wave inválido" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS del agumento por palabra clave deberia ser un identificador" @@ -1092,6 +1110,10 @@ msgstr "Sin pin TX" msgid "No available clocks" msgstr "Relojes no disponibles" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Sin bus %q por defecto" @@ -1113,6 +1135,10 @@ msgstr "Sin soporte de hardware en el pin clk" msgid "No hardware support on pin" msgstr "Sin soporte de hardware en pin" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1244,6 +1270,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1295,6 +1325,10 @@ msgstr "Solo-lectura" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Canal derecho no soportado" @@ -1358,6 +1392,10 @@ msgstr "Slice y value tienen diferentes longitudes" msgid "Slices not supported" msgstr "Rebanadas no soportadas" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Dividiendo con sub-capturas" @@ -1441,6 +1479,10 @@ msgstr "Demasiados buses de pantalla" msgid "Too many displays" msgstr "Muchos displays" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (ultima llamada reciente):\n" @@ -2222,6 +2264,10 @@ msgstr "la función esperaba minimo %d argumentos, tiene %d" msgid "function got multiple values for argument '%q'" msgstr "la función tiene múltiples valores para el argumento '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2717,7 +2763,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo se admiten segmentos con step=1 (alias None)" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 90e650374a..1af4bbc3cf 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -287,11 +287,12 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Lahat ng timer ginagamit" @@ -435,6 +436,10 @@ msgstr "buffer ay dapat bytes-like object" msgid "Bytes must be between 0 and 255." msgstr "Sa gitna ng 0 o 255 dapat ang bytes." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -671,6 +676,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input." +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -682,7 +691,7 @@ msgstr "Ginagamit na ang EXTINT channel" msgid "Error in regex" msgstr "May pagkakamali sa REGEX" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -811,6 +820,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "Hindi supportado ang operasyong I2C" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -992,6 +1006,10 @@ msgstr "May hindi tama sa wave file" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS ng keyword arg ay dapat na id" @@ -1100,6 +1118,10 @@ msgstr "Walang TX pin" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Walang default na %q bus" @@ -1121,6 +1143,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Walang support sa hardware ang pin" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1250,6 +1276,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1301,6 +1331,10 @@ msgstr "Basahin-lamang" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Hindi supportado ang kanang channel" @@ -1364,6 +1398,10 @@ msgstr "Slice at value iba't ibang haba." msgid "Slices not supported" msgstr "Hindi suportado ang Slices" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Binibiyak gamit ang sub-captures" @@ -1447,6 +1485,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (pinakahuling huling tawag): \n" @@ -2236,6 +2278,10 @@ msgstr "function na inaasahang %d ang argumento, ngunit %d ang nakuha" msgid "function got multiple values for argument '%q'" msgstr "ang function ay nakakuha ng maraming values para sa argument '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2730,7 +2776,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index ee0a05439b..ede3d2f2da 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,14 +8,17 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" -"PO-Revision-Date: 2019-04-14 20:05+0100\n" -"Last-Translator: Pierrick Couturier \n" -"Language-Team: fr\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"PO-Revision-Date: 2020-05-05 20:24+0000\n" +"Last-Translator: Jeff Epler \n" +"Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.1-dev\n" #: main.c msgid "" @@ -31,12 +34,18 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Veuillez signaler un problème avec le contenu de votre lecteur CIRCUITPY à " +"l'adresse\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Pour repartir, veuillez réinitialiser sans " #: py/obj.c msgid " File \"%q\"" @@ -48,7 +57,7 @@ msgstr " Fichier \"%q\", ligne %d" #: main.c msgid " output:\n" -msgstr " sortie:\n" +msgstr " sortie :\n" #: py/objstr.c #, c-format @@ -75,14 +84,12 @@ msgstr "les indices %q doivent être des entiers, pas %s" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c -#, fuzzy msgid "%q must be >= 1" -msgstr "%d doit être >=1" +msgstr "%q doit être >=1" #: shared-bindings/fontio/BuiltinFont.c -#, fuzzy msgid "%q should be an int" -msgstr "y doit être un entier (int)" +msgstr "%q doit être un entier (int)" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -113,7 +120,7 @@ msgid "'%s' expects an FPU register" msgstr "'%s' attend un registre FPU" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' expects an address of the form [a, b]" msgstr "'%s' attend une adresse de la forme [a, b]" @@ -144,11 +151,11 @@ msgstr "'%s' l'entier 0x%x ne correspond pas au masque 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" -msgstr "" +msgstr "L'objet '%s' ne peut pas assigner l'attribut '%q'" #: py/proto.c msgid "'%s' object does not support '%q'" -msgstr "" +msgstr "L'objet '%s' ne prends pas en charge '%q'" #: py/obj.c #, c-format @@ -198,7 +205,7 @@ msgstr "'align' nécessite 1 argument" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "" +msgstr "'async for' ou 'async with' sans fonction async" #: py/compile.c msgid "'await' outside function" @@ -290,11 +297,12 @@ msgstr "Tous les timers pour cette broche sont utilisés" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Tous les timers sont utilisés" @@ -439,6 +447,10 @@ msgstr "Le tampon d'octets doit être de 16 octets." msgid "Bytes must be between 0 and 255." msgstr "Les octets 'bytes' doivent être entre 0 et 255" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -674,6 +686,10 @@ msgstr "La rotation d'affichage doit se faire par incréments de 90 degrés" msgid "Drive mode not used when direction is input." msgstr "Le mode Drive n'est pas utilisé quand la direction est 'input'." +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -685,7 +701,7 @@ msgstr "Canal EXTINT déjà utilisé" msgid "Error in regex" msgstr "Erreur dans l'expression régulière" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -814,6 +830,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "opération sur I2C non supportée" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -999,6 +1020,10 @@ msgstr "Fichier WAVE invalide" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "La partie gauche de l'argument nommé doit être un identifiant" @@ -1107,6 +1132,10 @@ msgstr "Pas de broche TX" msgid "No available clocks" msgstr "Pas d'horloge disponible" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Pas de bus %q par défaut" @@ -1128,6 +1157,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Pas de support matériel pour cette broche" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1263,6 +1296,10 @@ msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger." msgid "Pull not used when direction is output." msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1314,6 +1351,10 @@ msgstr "Objet en lecture seule" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Canal droit non supporté" @@ -1378,6 +1419,10 @@ msgstr "Tranche et valeur de tailles différentes" msgid "Slices not supported" msgstr "Tranches non supportées" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Fractionnement avec des sous-captures" @@ -1462,6 +1507,10 @@ msgstr "Trop de bus d'affichage" msgid "Too many displays" msgstr "Trop d'affichages" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Trace (appels les plus récents en dernier):\n" @@ -2261,6 +2310,10 @@ msgstr "la fonction attendait au plus %d arguments, reçu %d" msgid "function got multiple values for argument '%q'" msgstr "la fonction a reçu plusieurs valeurs pour l'argument '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2757,7 +2810,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 7085f9a4b4..ad7964feaf 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -286,11 +286,12 @@ msgstr "Tutti i timer per questo pin sono in uso" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Tutti i timer utilizzati" @@ -435,6 +436,10 @@ msgstr "i buffer devono essere della stessa lunghezza" msgid "Bytes must be between 0 and 255." msgstr "I byte devono essere compresi tra 0 e 255" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -671,6 +676,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -682,7 +691,7 @@ msgstr "Canale EXTINT già in uso" msgid "Error in regex" msgstr "Errore nella regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -811,6 +820,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "operazione I2C non supportata" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -995,6 +1009,10 @@ msgstr "File wave non valido" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1104,6 +1122,10 @@ msgstr "Nessun pin TX" msgid "No available clocks" msgstr "Nessun orologio a disposizione" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Nessun bus %q predefinito" @@ -1125,6 +1147,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Nessun supporto hardware sul pin" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1259,6 +1285,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1310,6 +1340,10 @@ msgstr "Sola lettura" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Canale destro non supportato" @@ -1375,6 +1409,10 @@ msgstr "" msgid "Slices not supported" msgstr "Slice non supportate" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Suddivisione con sotto-catture" @@ -1458,6 +1496,10 @@ msgstr "" msgid "Too many displays" msgstr "Troppi schermi" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (chiamata più recente per ultima):\n" @@ -2237,6 +2279,10 @@ msgstr "la funzione prevede al massimo %d argmoneti, ma ne ha ricevuti %d" msgid "function got multiple values for argument '%q'" msgstr "la funzione ha ricevuto valori multipli per l'argomento '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2735,7 +2781,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo slice con step=1 (aka None) sono supportate" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 760010c706..5f28a85992 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -285,11 +285,12 @@ msgstr "핀의 모든 타이머가 사용 중입니다" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "모든 타이머가 사용 중입니다" @@ -432,6 +433,10 @@ msgstr "잘못된 크기의 버퍼. 16 바이트 여야합니다." msgid "Bytes must be between 0 and 255." msgstr "바이트는 0에서 255 사이 여야합니다." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -663,6 +668,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -674,7 +683,7 @@ msgstr "" msgid "Error in regex" msgstr "Regex에 오류가 있습니다." -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -801,6 +810,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -980,6 +994,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1088,6 +1106,10 @@ msgstr "" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "" @@ -1109,6 +1131,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1232,6 +1258,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1282,6 +1312,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "" @@ -1345,6 +1379,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" @@ -1428,6 +1466,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" @@ -2196,6 +2238,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2684,7 +2730,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 12881677b3..6e410cbbbc 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -284,11 +284,12 @@ msgstr "Wszystkie timery tej nóżki w użyciu" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Wszystkie timery w użyciu" @@ -431,6 +432,10 @@ msgstr "Bufor musi mieć 16 bajtów." msgid "Bytes must be between 0 and 255." msgstr "Bytes musi być między 0 a 255." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -662,6 +667,10 @@ msgstr "Wyświetlacz można obracać co 90 stopni" msgid "Drive mode not used when direction is input." msgstr "Tryb sterowania nieużywany w trybie wejścia." +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -673,7 +682,7 @@ msgstr "Kanał EXTINT w użyciu" msgid "Error in regex" msgstr "Błąd w regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -800,6 +809,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "Operacja I2C nieobsługiwana" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -981,6 +995,10 @@ msgstr "Zły plik wave" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "Lewa strona argumentu nazwanego musi być nazwą" @@ -1089,6 +1107,10 @@ msgstr "Brak nóżki TX" msgid "No available clocks" msgstr "Brak wolnych zegarów" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Nie ma domyślnej magistrali %q" @@ -1110,6 +1132,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Brak sprzętowej obsługi na nóżce" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1233,6 +1259,10 @@ msgstr "Dowolny klawisz aby uruchomić konsolę. CTRL-D aby przeładować." msgid "Pull not used when direction is output." msgstr "Podciągnięcie nieużywane w trybie wyjścia." +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1283,6 +1313,10 @@ msgstr "Obiekt tylko do odczytu" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Prawy kanał jest niewspierany" @@ -1346,6 +1380,10 @@ msgstr "Fragment i wartość są różnych długości." msgid "Slices not supported" msgstr "Fragmenty nieobsługiwane" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Podział z podgrupami" @@ -1429,6 +1467,10 @@ msgstr "Zbyt wiele magistrali" msgid "Too many displays" msgstr "Zbyt wiele wyświetlaczy" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Ślad wyjątku (najnowsze wywołanie na końcu):\n" @@ -2200,6 +2242,10 @@ msgstr "funkcja bierze najwyżej %d argumentów, jest %d" msgid "function got multiple values for argument '%q'" msgstr "funkcja dostała wiele wartości dla argumentu '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2688,7 +2734,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "tylko fragmenty ze step=1 (lub None) są wspierane" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index da8276d752..c5ef3b9c19 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -286,11 +286,12 @@ msgstr "Todos os temporizadores para este pino estão em uso" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Todos os temporizadores em uso" @@ -432,6 +433,10 @@ msgstr "buffers devem ser o mesmo tamanho" msgid "Bytes must be between 0 and 255." msgstr "Os bytes devem estar entre 0 e 255." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -666,6 +671,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -677,7 +686,7 @@ msgstr "Canal EXTINT em uso" msgid "Error in regex" msgstr "Erro no regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -806,6 +815,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "I2C operação não suportada" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -988,6 +1002,10 @@ msgstr "Aqruivo de ondas inválido" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1096,6 +1114,10 @@ msgstr "Nenhum pino TX" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Nenhum barramento %q padrão" @@ -1117,6 +1139,10 @@ msgstr "Sem suporte de hardware no pino de clock" msgid "No hardware support on pin" msgstr "Nenhum suporte de hardware no pino" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1244,6 +1270,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1295,6 +1325,10 @@ msgstr "Somente leitura" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Canal direito não suportado" @@ -1358,6 +1392,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" @@ -1441,6 +1479,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" @@ -2213,6 +2255,10 @@ msgstr "função esperada na maioria dos %d argumentos, obteve %d" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2701,7 +2747,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/sv.po b/locale/sv.po new file mode 100644 index 0000000000..7c5f43e19d --- /dev/null +++ b/locale/sv.po @@ -0,0 +1,3182 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: main.c +msgid "" +"\n" +"Code done running. Waiting for reload.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + +#: py/obj.c +msgid " File \"%q\"" +msgstr "" + +#: py/obj.c +msgid " File \"%q\", line %d" +msgstr "" + +#: main.c +msgid " output:\n" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "%%c requires int or char" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q in use" +msgstr "" + +#: py/obj.c +msgid "%q index out of range" +msgstr "" + +#: py/obj.c +msgid "%q indices must be integers, not %s" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/Shape.c +msgid "%q must be >= 1" +msgstr "" + +#: shared-bindings/fontio/BuiltinFont.c +msgid "%q should be an int" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "%q() takes %d positional arguments but %d were given" +msgstr "" + +#: py/argcheck.c +msgid "'%q' argument required" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a label" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects a special register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an FPU register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an address of the form [a, b]" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects an integer" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects at most r%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects {r0, r1, ...}" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "'%s' integer %d is not within range %d..%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' integer 0x%x does not fit in mask 0x%x" +msgstr "" + +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%s' object does not support '%q'" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object does not support item assignment" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%s' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "'%s' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +#, c-format +msgid "'%s' object is not callable" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "'%s' object is not iterable" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object is not subscriptable" +msgstr "" + +#: py/objstr.c +msgid "'=' alignment not allowed in string format specifier" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "'S' and 'O' are not supported format types" +msgstr "" + +#: py/compile.c +msgid "'align' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + +#: py/compile.c +msgid "'await' outside function" +msgstr "" + +#: py/compile.c +msgid "'break' outside loop" +msgstr "" + +#: py/compile.c +msgid "'continue' outside loop" +msgstr "" + +#: py/compile.c +msgid "'data' requires at least 2 arguments" +msgstr "" + +#: py/compile.c +msgid "'data' requires integer arguments" +msgstr "" + +#: py/compile.c +msgid "'label' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'return' outside function" +msgstr "" + +#: py/compile.c +msgid "'yield' outside function" +msgstr "" + +#: py/compile.c +msgid "*x must be assignment target" +msgstr "" + +#: py/obj.c +msgid ", in %q\n" +msgstr "" + +#: py/objcomplex.c +msgid "0.0 to a complex power" +msgstr "" + +#: py/modbuiltins.c +msgid "3-arg pow() not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "A hardware interrupt channel is already in use" +msgstr "" + +#: shared-bindings/_bleio/Address.c +#, c-format +msgid "Address must be %d bytes long" +msgstr "" + +#: shared-bindings/_bleio/Address.c +msgid "Address type out of range" +msgstr "" + +#: ports/nrf/common-hal/busio/I2C.c +msgid "All I2C peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/SPI.c +msgid "All SPI peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "All UART peripherals are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "All event channels in use" +msgstr "" + +#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "All sync event channels in use" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "All timers for this pin are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +msgid "All timers in use" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Already advertising." +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogIn.c +msgid "AnalogIn not supported on given pin" +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/nrf/common-hal/analogio/AnalogOut.c +msgid "AnalogOut functionality not supported" +msgstr "" + +#: shared-bindings/analogio/AnalogOut.c +msgid "AnalogOut is only 16 bits. Value must be less than 65536." +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +msgid "AnalogOut not supported on given pin" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +msgid "Another send is already active" +msgstr "" + +#: shared-bindings/pulseio/PulseOut.c +msgid "Array must contain halfwords (type 'H')" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Array values should be single bytes." +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Attempted heap allocation when MicroPython VM not running." +msgstr "" + +#: main.c +msgid "Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "" +"Auto-reload is on. Simply save files over USB to run them or enter REPL to " +"disable.\n" +msgstr "" + +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c +msgid "Below minimum frame rate" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must share a clock unit" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Bit depth must be multiple of 8." +msgstr "" + +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "Both pins must support hardware interrupts" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "Brightness must be 0-1.0" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Brightness must be between 0 and 255" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Brightness not adjustable" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +#, c-format +msgid "Buffer + offset too small %d %d %d" +msgstr "" + +#: shared-module/usb_hid/Device.c +#, c-format +msgid "Buffer incorrect size. Should be %d bytes." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is not a bytearray." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is too small" +msgstr "" + +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#, c-format +msgid "Buffer length %d too big. It must be less than %d" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c +msgid "Buffer must be at least length 1" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Buffer too large and unable to allocate" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +#, c-format +msgid "Bus pin %d is already in use" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "Byte buffer must be 16 bytes." +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Bytes must be between 0 and 255." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + +#: py/objtype.c +msgid "Call super().__init__() before accessing native object." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "Can't set CCCD on local Characteristic" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +msgid "Cannot delete values" +msgstr "" + +#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +#: ports/nrf/common-hal/digitalio/DigitalInOut.c +msgid "Cannot get pull while in output mode" +msgstr "" + +#: ports/nrf/common-hal/microcontroller/Processor.c +msgid "Cannot get temperature" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Cannot output both channels on the same pin" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot read without MISO pin." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Cannot record to a file" +msgstr "" + +#: shared-module/storage/__init__.c +msgid "Cannot remount '/' when USB is active." +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/__init__.c +#: ports/cxd56/common-hal/microcontroller/__init__.c +#: ports/mimxrt10xx/common-hal/microcontroller/__init__.c +msgid "Cannot reset into bootloader because no bootloader is present." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Cannot set value when direction is input." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Cannot specify RTS or CTS in RS485 mode" +msgstr "" + +#: py/objslice.c +msgid "Cannot subclass slice" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot transfer without MOSI and MISO pins." +msgstr "" + +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot write without MOSI pin." +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "CharacteristicBuffer writing not provided" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Clock pin init failed." +msgstr "" + +#: shared-module/bitbangio/I2C.c +msgid "Clock stretch too long" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Clock unit in use" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Column entry must be digitalio.DigitalInOut" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "Command must be an int between 0 and 255" +msgstr "" + +#: shared-bindings/_bleio/Connection.c +msgid "" +"Connection has been disconnected and can no longer be used. Create a new " +"connection." +msgstr "" + +#: py/persistentcode.c +msgid "Corrupt .mpy file" +msgstr "" + +#: py/emitglue.c +msgid "Corrupt raw code" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +msgid "Could not initialize UART" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate decoder" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate second buffer" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Crash into the HardFault_Handler." +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "DAC already in use" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +msgid "Data 0 pin must be byte aligned" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Data chunk must follow fmt chunk" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Data too large for advertisement packet" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Destination capacity is smaller than destination_length." +msgstr "" + +#: ports/nrf/common-hal/audiobusio/I2SOut.c +msgid "Device in use" +msgstr "" + +#: ports/cxd56/common-hal/digitalio/DigitalInOut.c +msgid "DigitalInOut not supported on given pin" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display must have a 16 bit colorspace." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display rotation must be in 90 degree increments" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Drive mode not used when direction is input." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +msgid "EXTINT channel already in use" +msgstr "" + +#: extmod/modure.c +msgid "Error in regex" +msgstr "" + +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/terminalio/Terminal.c +msgid "Expected a %q" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c +msgid "Expected a Characteristic" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Expected a Service" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +#: shared-bindings/_bleio/Service.c +msgid "Expected a UUID" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Expected an Address" +msgstr "" + +#: shared-module/_pixelbuf/PixelBuf.c +#, c-format +msgid "Expected tuple of length %d, got %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Extended advertisements with scan response not supported." +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to acquire mutex, err 0x%04x" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +msgid "Failed to allocate RX buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +#, c-format +msgid "Failed to allocate RX buffer of %d bytes" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: internal error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: timeout" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Failed to parse MP3 file" +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to release mutex, err 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + +#: py/moduerrno.c +msgid "File exists" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Frequency captured is above capability. Capture Paused." +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c +#: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c +msgid "Function requires lock" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Group already used" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Group full" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + +#: extmod/vfs_posix_file.c py/objstringio.c +msgid "I/O operation on closed file" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "" + +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + +#: py/persistentcode.c +msgid "" +"Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" +"mpy-update for more info." +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Incorrect buffer size" +msgstr "" + +#: py/moduerrno.c +msgid "Input/output error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Invalid %q pin" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Invalid BMP file" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +msgid "Invalid I2C pin selection" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PWMOut.c +#: ports/cxd56/common-hal/pulseio/PWMOut.c +#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +msgid "Invalid PWM frequency" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Invalid SPI pin selection" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Invalid UART pin selection" +msgstr "" + +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid argument" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Invalid bits per value" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Invalid buffer size" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Invalid byteorder string" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Invalid capture period. Valid range: 1 - 500" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid channel count" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Invalid direction." +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid file" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid format chunk size" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Invalid memory access." +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "Invalid number of bits" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid phase" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid pin" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for left channel" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for right channel" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/SPI.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +msgid "Invalid pins" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid polarity" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Invalid properties" +msgstr "" + +#: shared-bindings/microcontroller/__init__.c +msgid "Invalid run mode." +msgstr "" + +#: shared-module/_bleio/Attribute.c +msgid "Invalid security_mode" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice count" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid wave file" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + +#: py/compile.c +msgid "LHS of keyword arg must be an id" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer already in a group." +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer must be a Group or TileGrid subclass." +msgstr "" + +#: py/objslice.c +msgid "Length must be an int" +msgstr "" + +#: py/objslice.c +msgid "Length must be non-negative" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MISO pin init failed." +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MOSI pin init failed." +msgstr "" + +#: shared-module/displayio/Shape.c +#, c-format +msgid "Maximum x value when mirrored is %d" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython fatal error." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Microphone startup delay must be in range 0.0 to 1.0" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + +#: shared-bindings/displayio/Group.c +msgid "Must be a %q subclass." +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + +#: py/parse.c +msgid "Name too long" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Negative step not supported" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "No CCCD for this Characteristic" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "No DAC on chip" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "No DMA channel found" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No RX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No TX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "No available clocks" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + +#: shared-bindings/board/__init__.c +msgid "No default %q bus" +msgstr "" + +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +msgid "No free GCLKs" +msgstr "" + +#: shared-bindings/os/__init__.c +msgid "No hardware random available" +msgstr "" + +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "No hardware support on pin" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + +#: shared-module/touchio/TouchIn.c +msgid "No pulldown on pin; 1Mohm recommended" +msgstr "" + +#: py/moduerrno.c +msgid "No space left on device" +msgstr "" + +#: py/moduerrno.c +msgid "No such file/directory" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "No timer available" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "Not connected" +msgstr "" + +#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c +#: shared-bindings/audiopwmio/PWMAudioOut.c +msgid "Not playing" +msgstr "" + +#: shared-bindings/util.c +msgid "" +"Object has been deinitialized and can no longer be used. Create a new object." +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "Odd parity is not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Only 8 or 16 bit mono with " +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only Windows format, uncompressed BMP supported: given header size is %d" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " +"%d bpp given" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Oversample must be multiple of 8." +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM frequency not writable when variable_frequency is False on construction." +msgstr "" + +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c +msgid "ParallelBus not yet supported" +msgstr "" + +#: py/moduerrno.c +msgid "Permission denied" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogIn.c +#: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +#: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Pin does not have ADC capabilities" +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + +#: py/builtinhelp.c +msgid "Plus any modules on the filesystem\n" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Prefix buffer must be on the heap" +msgstr "" + +#: main.c +msgid "Press any key to enter the REPL. Use CTRL-D to reload." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pull not used when direction is output." +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "RS485 inversion specified when not in RS485 mode" +msgstr "" + +#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/rtc/RTC.c +msgid "RTC calibration is not supported on this board" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "RTC is not supported on this board" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "RTS/CTS/RS485 Not yet supported on this device" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + +#: shared-bindings/pulseio/PulseIn.c +msgid "Read-only" +msgstr "" + +#: extmod/vfs_fat.c py/moduerrno.c +msgid "Read-only filesystem" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Read-only object" +msgstr "" + +#: shared-bindings/displayio/EPaperDisplay.c +msgid "Refresh too soon" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Right channel unsupported" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Row entry must be digitalio.DigitalInOut" +msgstr "" + +#: main.c +msgid "Running in safe mode! Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "Running in safe mode! Not running saved code.\n" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +msgid "SDA or SCL needs a pull up" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Sample rate must be positive" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#, c-format +msgid "Sample rate too high. It must be less than %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Scan already in progess. Stop with stop_scan." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected CTS pin not valid" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected RTS pin not valid" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Serializer in use" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Slice and value different lengths." +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +msgid "Slices not supported" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Stack size must be at least 256" +msgstr "" + +#: shared-bindings/multiterminal/__init__.c +msgid "Stream missing readinto() or write() method." +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The CircuitPython heap was corrupted because the stack was too small.\n" +"Please increase the stack size if you know how, or if not:" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The `microcontroller` module was used to boot into safe mode. Press reset to " +"exit safe mode.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The microcontroller's power dipped. Make sure your power supply provides\n" +"enough power for the whole circuit and press reset (after ejecting " +"CIRCUITPY).\n" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's bits_per_sample does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's channel count does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's sample rate does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's signedness does not match the mixer's" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile height must exactly divide bitmap height" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c +msgid "Tile index out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile value out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile width must exactly divide bitmap width" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample." +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many display busses" +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many displays" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + +#: py/obj.c +msgid "Traceback (most recent call last):\n" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "Tuple or struct_time argument required" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Busy" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Error" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID integer value must be 0-0xffff" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID value is not str, int or byte buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Unable to allocate buffers for signed conversion" +msgstr "" + +#: shared-module/displayio/I2CDisplay.c +#, c-format +msgid "Unable to find I2C Display at %x" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Unable to find free GCLK" +msgstr "" + +#: py/parse.c +msgid "Unable to init parser" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Unable to read color palette data" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Unable to write to nvm." +msgstr "" + +#: ports/nrf/common-hal/_bleio/UUID.c +msgid "Unexpected nrfx uuid type" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown security error: 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown soft device error: %04x" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +#, c-format +msgid "Unmatched number of items on RHS (expected %d, got %d)." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "" +"Unspecified issue. Can be that the pairing prompt on the other device was " +"declined or ignored." +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +msgid "Unsupported baudrate" +msgstr "" + +#: shared-module/displayio/display_core.c +msgid "Unsupported display bus type" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Unsupported format" +msgstr "" + +#: py/moduerrno.c +msgid "Unsupported operation" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Unsupported pull value." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length != required fixed length" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length > max_length" +msgstr "" + +#: py/emitnative.c +msgid "Viper functions don't currently support more than 4 arguments" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + +#: main.c +msgid "WARNING: Your code filename has two extensions\n" +msgstr "" + +#: py/builtinhelp.c +#, c-format +msgid "" +"Welcome to Adafruit CircuitPython %s!\n" +"\n" +"Please visit learn.adafruit.com/category/circuitpython for project guides.\n" +"\n" +"To list built-in modules please do `help(\"modules\")`.\n" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Writes not supported on Characteristic" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You are in safe mode: something unanticipated happened.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You requested starting safe mode by " +msgstr "" + +#: py/objtype.c +msgid "__init__() should return None" +msgstr "" + +#: py/objtype.c +#, c-format +msgid "__init__() should return None, not '%s'" +msgstr "" + +#: py/objobject.c +msgid "__new__ arg must be a user-type" +msgstr "" + +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "address out of bounds" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "addresses is empty" +msgstr "" + +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + +#: py/modbuiltins.c +msgid "arg is an empty sequence" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + +#: py/runtime.c +msgid "argument has wrong type" +msgstr "" + +#: py/argcheck.c shared-bindings/_stage/__init__.c +#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +msgid "argument num/types mismatch" +msgstr "" + +#: py/runtime.c +msgid "argument should be a '%q' not a '%q'" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + +#: py/objarray.c shared-bindings/nvm/ByteArray.c +msgid "array/bytes required on right side" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + +#: py/objstr.c +msgid "attributes not supported yet" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + +#: py/builtinevex.c +msgid "bad compile mode" +msgstr "" + +#: py/objstr.c +msgid "bad conversion specifier" +msgstr "" + +#: py/objstr.c +msgid "bad format string" +msgstr "" + +#: py/binary.c +msgid "bad typecode" +msgstr "" + +#: py/emitnative.c +msgid "binary op %q not implemented" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "bits must be 7, 8 or 9" +msgstr "" + +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "bits_per_sample must be 8 or 16" +msgstr "" + +#: py/emitinlinethumb.c +msgid "branch not in range" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "buffer must be a bytes-like object" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "buffer size must match format" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "buffer slices must be of equal length" +msgstr "" + +#: py/modstruct.c shared-bindings/struct/__init__.c +#: shared-module/struct/__init__.c +msgid "buffer too small" +msgstr "" + +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "buttons must be digitalio.DigitalInOut" +msgstr "" + +#: py/vm.c +msgid "byte code not implemented" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "byteorder is not a string" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +msgid "bytes > 8 bits not supported" +msgstr "" + +#: py/objstr.c +msgid "bytes value out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is read only" +msgstr "" + +#: ports/atmel-samd/common-hal/rtc/RTC.c +msgid "calibration value out of range +/-127" +msgstr "" + +#: py/emitinlinethumb.c +msgid "can only have up to 4 parameters to Thumb assembly" +msgstr "" + +#: py/emitinlinextensa.c +msgid "can only have up to 4 parameters to Xtensa assembly" +msgstr "" + +#: py/persistentcode.c +msgid "can only save bytecode" +msgstr "" + +#: py/objtype.c +msgid "can't add special method to already-subclassed class" +msgstr "" + +#: py/compile.c +msgid "can't assign to expression" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to complex" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to float" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to int" +msgstr "" + +#: py/objstr.c +msgid "can't convert '%q' object to %q implicitly" +msgstr "" + +#: py/objint.c +msgid "can't convert NaN to int" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "can't convert address to int" +msgstr "" + +#: py/objint.c +msgid "can't convert inf to int" +msgstr "" + +#: py/obj.c +msgid "can't convert to complex" +msgstr "" + +#: py/obj.c +msgid "can't convert to float" +msgstr "" + +#: py/obj.c +msgid "can't convert to int" +msgstr "" + +#: py/objstr.c +msgid "can't convert to str implicitly" +msgstr "" + +#: py/compile.c +msgid "can't declare nonlocal in outer code" +msgstr "" + +#: py/compile.c +msgid "can't delete expression" +msgstr "" + +#: py/emitnative.c +msgid "can't do binary op between '%q' and '%q'" +msgstr "" + +#: py/objcomplex.c +msgid "can't do truncated division of a complex number" +msgstr "" + +#: py/compile.c +msgid "can't have multiple **x" +msgstr "" + +#: py/compile.c +msgid "can't have multiple *x" +msgstr "" + +#: py/emitnative.c +msgid "can't implicitly convert '%q' to 'bool'" +msgstr "" + +#: py/emitnative.c +msgid "can't load from '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't load with '%q' index" +msgstr "" + +#: py/objgenerator.c +msgid "can't pend throw to just-started generator" +msgstr "" + +#: py/objgenerator.c +msgid "can't send non-None value to a just-started generator" +msgstr "" + +#: py/objnamedtuple.c +msgid "can't set attribute" +msgstr "" + +#: py/emitnative.c +msgid "can't store '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store to '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store with '%q' index" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from automatic field numbering to manual field specification" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from manual field specification to automatic field numbering" +msgstr "" + +#: py/objtype.c +msgid "cannot create '%q' instances" +msgstr "" + +#: py/objtype.c +msgid "cannot create instance" +msgstr "" + +#: py/runtime.c +msgid "cannot import name %q" +msgstr "" + +#: py/builtinimport.c +msgid "cannot perform relative import" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + +#: py/emitnative.c +msgid "casting" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "chars buffer too small" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(0x110000)" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(256)" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a buffer, tuple, list, or int" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a bytearray or array of type 'b' or 'B'" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color must be between 0x000000 and 0xffffff" +msgstr "" + +#: shared-bindings/displayio/ColorConverter.c +msgid "color should be an int" +msgstr "" + +#: py/objcomplex.c +msgid "complex division by zero" +msgstr "" + +#: py/objfloat.c py/parsenum.c +msgid "complex values not supported" +msgstr "" + +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + +#: py/parse.c +msgid "constant must be an integer" +msgstr "" + +#: py/emitnative.c +msgid "conversion to object" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + +#: py/parsenum.c +msgid "decimal numbers not supported" +msgstr "" + +#: py/compile.c +msgid "default 'except' must be last" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "" +"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination buffer must be an array of type 'H' for bit_depth = 16" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination_length must be an int >= 0" +msgstr "" + +#: py/objdict.c +msgid "dict update sequence has wrong length" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + +#: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c +#: shared-bindings/math/__init__.c +msgid "division by zero" +msgstr "" + +#: py/objdeque.c +msgid "empty" +msgstr "" + +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "" + +#: py/objstr.c +msgid "empty separator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "empty sequence" +msgstr "" + +#: py/objstr.c +msgid "end of format while looking for conversion specifier" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "end_x should be an int" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +#, c-format +msgid "error = 0x%08lX" +msgstr "" + +#: py/runtime.c +msgid "exceptions must derive from BaseException" +msgstr "" + +#: py/objstr.c +msgid "expected ':' after format specifier" +msgstr "" + +#: py/obj.c +msgid "expected tuple/list" +msgstr "" + +#: py/modthread.c +msgid "expecting a dict for keyword args" +msgstr "" + +#: py/compile.c +msgid "expecting an assembler instruction" +msgstr "" + +#: py/compile.c +msgid "expecting just a value for set" +msgstr "" + +#: py/compile.c +msgid "expecting key:value for dict" +msgstr "" + +#: py/argcheck.c +msgid "extra keyword arguments given" +msgstr "" + +#: py/argcheck.c +msgid "extra positional arguments given" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c +#: shared-bindings/displayio/OnDiskBitmap.c +msgid "file must be a file opened in byte mode" +msgstr "" + +#: shared-bindings/storage/__init__.c +msgid "filesystem must provide mount method" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + +#: py/objtype.c +msgid "first argument to super() must be type" +msgstr "" + +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + +#: py/objint.c +msgid "float too big" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "font must be 2048 bytes long" +msgstr "" + +#: py/objstr.c +msgid "format requires a dict" +msgstr "" + +#: py/objdeque.c +msgid "full" +msgstr "" + +#: py/argcheck.c +msgid "function does not take keyword arguments" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function expected at most %d arguments, got %d" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "function got multiple values for argument '%q'" +msgstr "" + +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function missing %d required positional arguments" +msgstr "" + +#: py/bc.c +msgid "function missing keyword-only argument" +msgstr "" + +#: py/bc.c +msgid "function missing required keyword argument '%q'" +msgstr "" + +#: py/bc.c +#, c-format +msgid "function missing required positional argument #%d" +msgstr "" + +#: py/argcheck.c py/bc.c py/objnamedtuple.c +#, c-format +msgid "function takes %d positional arguments but %d were given" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "function takes exactly 9 arguments" +msgstr "" + +#: py/objgenerator.c +msgid "generator already executing" +msgstr "" + +#: py/objgenerator.c +msgid "generator ignored GeneratorExit" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "graphic must be 2048 bytes long" +msgstr "" + +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as global" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as nonlocal" +msgstr "" + +#: py/objstr.c +msgid "incomplete format" +msgstr "" + +#: py/objstr.c +msgid "incomplete format key" +msgstr "" + +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +msgid "index out of range" +msgstr "" + +#: py/obj.c +msgid "indices must be integers" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + +#: py/compile.c +msgid "inline assembler must be a function" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + +#: py/parsenum.c +msgid "int() arg 2 must be >= 2 and <= 36" +msgstr "" + +#: py/objstr.c +msgid "integer required" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" + +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "" + +#: py/objstr.c +msgid "invalid format specifier" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "" + +#: py/compile.c +msgid "invalid micropython decorator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "invalid step" +msgstr "" + +#: py/compile.c py/parse.c +msgid "invalid syntax" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for integer" +msgstr "" + +#: py/parsenum.c +#, c-format +msgid "invalid syntax for integer with base %d" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for number" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 1 must be a class" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 2 must be a class or a tuple of classes" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + +#: py/objstr.c +msgid "join expects a list of str/bytes objects consistent with self object" +msgstr "" + +#: py/argcheck.c +msgid "keyword argument(s) not yet implemented - use normal args instead" +msgstr "" + +#: py/bc.c +msgid "keywords must be strings" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +msgid "label '%q' not defined" +msgstr "" + +#: py/compile.c +msgid "label redefined" +msgstr "" + +#: py/stream.c +msgid "length argument not allowed for this type" +msgstr "" + +#: shared-bindings/audiomixer/MixerVoice.c +msgid "level must be between 0 and 1" +msgstr "" + +#: py/objarray.c +msgid "lhs and rhs should be compatible" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' has type '%q' but source is '%q'" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' used before type known" +msgstr "" + +#: py/vm.c +msgid "local variable referenced before assignment" +msgstr "" + +#: py/objint.c +msgid "long int not supported in this build" +msgstr "" + +#: py/parse.c +msgid "malformed f-string" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "map buffer too small" +msgstr "" + +#: py/modmath.c shared-bindings/math/__init__.c +msgid "math domain error" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +#, c-format +msgid "max_length must be 0-%d when fixed_length is %s" +msgstr "" + +#: py/runtime.c +msgid "maximum recursion depth exceeded" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "memory allocation failed, allocating %u bytes" +msgstr "" + +#: py/runtime.c +msgid "memory allocation failed, heap is locked" +msgstr "" + +#: py/builtinimport.c +msgid "module not found" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + +#: py/compile.c +msgid "multiple *x in assignment" +msgstr "" + +#: py/objtype.c +msgid "multiple bases have instance lay-out conflict" +msgstr "" + +#: py/objtype.c +msgid "multiple inheritance not supported" +msgstr "" + +#: py/emitnative.c +msgid "must raise an object" +msgstr "" + +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "" + +#: py/modbuiltins.c +msgid "must use keyword argument for key function" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + +#: py/runtime.c +msgid "name '%q' is not defined" +msgstr "" + +#: py/runtime.c +msgid "name not defined" +msgstr "" + +#: py/compile.c +msgid "name reused for argument" +msgstr "" + +#: py/emitnative.c +msgid "native yield" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "need more than %d values to unpack" +msgstr "" + +#: py/objint_longlong.c py/objint_mpz.c py/runtime.c +msgid "negative power with no float support" +msgstr "" + +#: py/objint_mpz.c py/runtime.c +msgid "negative shift count" +msgstr "" + +#: py/vm.c +msgid "no active exception to reraise" +msgstr "" + +#: shared-bindings/socket/__init__.c shared-module/network/__init__.c +msgid "no available NIC" +msgstr "" + +#: py/compile.c +msgid "no binding for nonlocal found" +msgstr "" + +#: py/builtinimport.c +msgid "no module named '%q'" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "no reset pin available" +msgstr "" + +#: py/runtime.c +msgid "no such attribute" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Connection.c +msgid "non-UUID found in service_uuids_whitelist" +msgstr "" + +#: py/compile.c +msgid "non-default argument follows default argument" +msgstr "" + +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after */**" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after keyword arg" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "not a 128-bit UUID" +msgstr "" + +#: py/objstr.c +msgid "not all arguments converted during string formatting" +msgstr "" + +#: py/objstr.c +msgid "not enough arguments for format string" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + +#: py/obj.c +#, c-format +msgid "object '%s' is not a tuple or list" +msgstr "" + +#: py/obj.c +msgid "object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "object does not support item deletion" +msgstr "" + +#: py/obj.c +msgid "object has no len" +msgstr "" + +#: py/obj.c +msgid "object is not subscriptable" +msgstr "" + +#: py/runtime.c +msgid "object not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "object not callable" +msgstr "" + +#: py/sequence.c shared-bindings/displayio/Group.c +msgid "object not in sequence" +msgstr "" + +#: py/runtime.c +msgid "object not iterable" +msgstr "" + +#: py/obj.c +#, c-format +msgid "object of type '%s' has no len()" +msgstr "" + +#: py/obj.c +msgid "object with buffer protocol required" +msgstr "" + +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + +#: py/objstr.c py/objstrunicode.c +msgid "offset out of bounds" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only bit_depth=16 is supported" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only sample_rate=16000 is supported" +msgstr "" + +#: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c +#: shared-bindings/nvm/ByteArray.c +msgid "only slices with step=1 (aka None) are supported" +msgstr "" + +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + +#: py/modbuiltins.c +msgid "ord expects a character" +msgstr "" + +#: py/modbuiltins.c +#, c-format +msgid "ord() expected a character, but string of length %d found" +msgstr "" + +#: py/objint_mpz.c +msgid "overflow converting long int to machine word" +msgstr "" + +#: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c +msgid "palette must be 32 bytes long" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "palette_index should be an int" +msgstr "" + +#: py/compile.c +msgid "parameter annotation must be an identifier" +msgstr "" + +#: py/emitinlinextensa.c +msgid "parameters must be registers in sequence a2 to a5" +msgstr "" + +#: py/emitinlinethumb.c +msgid "parameters must be registers in sequence r0 to r3" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel coordinates out of bounds" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel value requires too many bits" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + +#: py/objset.c +msgid "pop from an empty set" +msgstr "" + +#: py/objlist.c +msgid "pop from empty list" +msgstr "" + +#: py/objdict.c +msgid "popitem(): dictionary is empty" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() 3rd argument cannot be 0" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() with 3 arguments requires integers" +msgstr "" + +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + +#: py/builtinimport.c +msgid "relative import" +msgstr "" + +#: py/obj.c +#, c-format +msgid "requested length %d but object has length %d" +msgstr "" + +#: py/compile.c +msgid "return annotation must be an identifier" +msgstr "" + +#: py/emitnative.c +msgid "return expected '%q' but got '%q'" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + +#: py/objstr.c +msgid "rsplit(None,n)" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "" +"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " +"'B'" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "sampling rate out of range" +msgstr "" + +#: py/modmicropython.c +msgid "schedule stack full" +msgstr "" + +#: lib/utils/pyexec.c py/builtinimport.c +msgid "script compilation not supported" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed in string format specifier" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed with integer format specifier 'c'" +msgstr "" + +#: py/objstr.c +msgid "single '}' encountered in format string" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "sleep length must be non-negative" +msgstr "" + +#: py/objslice.c py/sequence.c +msgid "slice step cannot be zero" +msgstr "" + +#: py/objint.c py/sequence.c +msgid "small int overflow" +msgstr "" + +#: main.c +msgid "soft reboot\n" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + +#: py/objstr.c +msgid "start/end indices" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "start_x should be an int" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "step must be non-zero" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "stop must be 1 or 2" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "stop not reachable from start" +msgstr "" + +#: py/stream.c +msgid "stream operation not supported" +msgstr "" + +#: py/objstrunicode.c +msgid "string index out of range" +msgstr "" + +#: py/objstrunicode.c +#, c-format +msgid "string indices must be integers, not %s" +msgstr "" + +#: py/stream.c +msgid "string not supported; use bytes or bytearray" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + +#: py/objstr.c +msgid "substring not found" +msgstr "" + +#: py/compile.c +msgid "super() can't find self" +msgstr "" + +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "" + +#: shared-bindings/touchio/TouchIn.c +msgid "threshold must be in the range 0-65536" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "time.struct_time() takes a 9-sequence" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "timeout must be 0.0-100.0 seconds" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "timeout must be >= 0.0" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "timestamp out of range for platform time_t" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "too many arguments provided with the given format" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "too many values to unpack (expected %d)" +msgstr "" + +#: extmod/ulab/code/linalg.c py/objstr.c +msgid "tuple index out of range" +msgstr "" + +#: py/obj.c +msgid "tuple/list has wrong length" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "tuple/list required on RHS" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c +msgid "tx and rx cannot both be None" +msgstr "" + +#: py/objtype.c +msgid "type '%q' is not an acceptable base type" +msgstr "" + +#: py/objtype.c +msgid "type is not an acceptable base type" +msgstr "" + +#: py/runtime.c +msgid "type object '%q' has no attribute '%q'" +msgstr "" + +#: py/objtype.c +msgid "type takes 1 or 3 arguments" +msgstr "" + +#: py/objint_longlong.c +msgid "ulonglong too large" +msgstr "" + +#: py/emitnative.c +msgid "unary op %q not implemented" +msgstr "" + +#: py/parse.c +msgid "unexpected indent" +msgstr "" + +#: py/bc.c +msgid "unexpected keyword argument" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "unexpected keyword argument '%q'" +msgstr "" + +#: py/lexer.c +msgid "unicode name escapes" +msgstr "" + +#: py/parse.c +msgid "unindent does not match any outer indentation level" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown conversion specifier %c" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown format code '%c' for object of type '%s'" +msgstr "" + +#: py/compile.c +msgid "unknown type" +msgstr "" + +#: py/emitnative.c +msgid "unknown type '%q'" +msgstr "" + +#: py/objstr.c +msgid "unmatched '{' in format" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "unreadable attribute" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "unsupported %q type" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "unsupported Thumb instruction '%s' with %d arguments" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "unsupported Xtensa instruction '%s' with %d arguments" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unsupported format character '%c' (0x%x) at index %d" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for %q: '%s'" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for operator" +msgstr "" + +#: py/runtime.c +msgid "unsupported types for %q: '%s', '%s'" +msgstr "" + +#: py/objint.c +#, c-format +msgid "value must fit in %d byte(s)" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "value_count must be > 0" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "window must be <= interval" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong index type" +msgstr "" + +#: py/objstr.c +msgid "wrong number of arguments" +msgstr "" + +#: py/runtime.c +msgid "wrong number of values to unpack" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "x value out of bounds" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "y should be an int" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "y value out of bounds" +msgstr "" + +#: py/objrange.c +msgid "zero step" +msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 0ca59446f7..51c59e7631 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -290,11 +290,12 @@ msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c -#: shared-module/_pew/PewPew.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Suǒyǒu jìshí qì shǐyòng" @@ -437,6 +438,10 @@ msgstr "Zì jié huǎnchōng qū bìxū shì 16 zì jié." msgid "Bytes must be between 0 and 255." msgstr "Zì jié bìxū jiè yú 0 dào 255 zhī jiān." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "Zài fǎngwèn běn jī wùjiàn zhīqián diàoyòng super().__init__()" @@ -670,6 +675,10 @@ msgstr "Xiǎnshì xuánzhuǎn bìxū 90 dù jiā xīn" msgid "Drive mode not used when direction is input." msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng." +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -681,7 +690,7 @@ msgstr "EXTINT píndào yǐjīng shǐyòng" msgid "Error in regex" msgstr "Zhèngzé biǎodá shì cuòwù" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -808,6 +817,11 @@ msgstr "I2C chūshǐhuà cuòwù" msgid "I2C operation not supported" msgstr "I2C cāozuò bù zhīchí" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -989,6 +1003,10 @@ msgstr "Wúxiào de làng làngcháo wénjiàn" msgid "Invalid word/bit length" msgstr "Wúxiào de zì/wèi chángdù" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "Guānjiàn zì arg de LHS bìxū shì id" @@ -1097,6 +1115,10 @@ msgstr "Wèi zhǎodào TX yǐn jiǎo" msgid "No available clocks" msgstr "Méiyǒu kěyòng de shízhōng" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "wú mòrèn %q zǒngxiàn" @@ -1118,6 +1140,10 @@ msgstr "Shízhōng yǐn jiǎo wú yìngjiàn zhīchí" msgid "No hardware support on pin" msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì." @@ -1247,6 +1273,10 @@ msgstr "Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzà msgid "Pull not used when direction is output." msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -1297,6 +1327,10 @@ msgstr "Zhǐ dú duìxiàng" msgid "Refresh too soon" msgstr "Shuāxīn tài kuàile" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Bù zhīchí yòu tōngdào" @@ -1360,6 +1394,10 @@ msgstr "Qiēpiàn hé zhí bùtóng chángdù." msgid "Slices not supported" msgstr "Qiēpiàn bù shòu zhīchí" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Yǔ zi bǔhuò fēnliè" @@ -1450,6 +1488,10 @@ msgstr "Xiǎnshì zǒngxiàn tài duōle" msgid "Too many displays" msgstr "Xiǎnshì tài duō" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (Zuìjìn yīcì dǎ diànhuà):\n" @@ -2228,6 +2270,10 @@ msgstr "hánshù yùjì zuìduō %d cānshù, huòdé %d" msgid "function got multiple values for argument '%q'" msgstr "hánshù huòdé cānshù '%q' de duōchóng zhí" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2718,7 +2764,8 @@ msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" msgid "only slices with step=1 (aka None) are supported" msgstr "jǐn zhīchí bù zhǎng = 1(jí wú) de qiēpiàn" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/main.c b/main.c index 52870cc8e2..c60cded165 100755 --- a/main.c +++ b/main.c @@ -428,7 +428,7 @@ int __attribute__((used)) main(void) { filesystem_init(safe_mode == NO_SAFE_MODE, false); // displays init after filesystem, since they could share the flash SPI - board_init(); + board_init(); // Reset everything and prep MicroPython to run boot.py. reset_port(); diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index f4886f96ef..8a5c3309f4 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -114,7 +114,7 @@ else # Do a default shrink for small builds. ifndef CFLAGS_INLINE_LIMIT - ifeq ($(CIRCUITPY_SMALL_BUILD),1) + ifeq ($(CIRCUITPY_FULL_BUILD),0) CFLAGS_INLINE_LIMIT = 50 endif endif @@ -125,7 +125,7 @@ else CFLAGS += -flto -flto-partition=none - ifeq ($(CIRCUITPY_SMALL_BUILD),1) + ifeq ($(CIRCUITPY_FULL_BUILD),0) CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20 endif @@ -194,7 +194,6 @@ SRC_ASF := \ hpl/gclk/hpl_gclk.c \ hpl/nvmctrl/hpl_nvmctrl.c \ hpl/pm/hpl_pm.c \ - hpl/rtc/hpl_rtc.c \ hpl/sercom/hpl_sercom.c \ hpl/systick/hpl_systick.c \ hal/utils/src/utils_list.c \ @@ -258,7 +257,6 @@ SRC_C = \ peripherals/samd/timers.c \ reset.c \ supervisor/shared/memory.c \ - tick.c \ timer_handler.c \ @@ -306,7 +304,6 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) # Doing a $(sort ...) removes duplicates as part of sorting. SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)) - SRC_S = supervisor/$(CHIP_FAMILY)_cpu.s OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) diff --git a/ports/atmel-samd/README.rst b/ports/atmel-samd/README.rst index b4d2085777..7211772750 100644 --- a/ports/atmel-samd/README.rst +++ b/ports/atmel-samd/README.rst @@ -1,243 +1,21 @@ -SAMD21x18 -========= +SAMD21 and SAMD51 +================== -This port brings MicroPython to SAMD21x18 based development boards under the name -CircuitPython. Supported boards include: +This port supports many development boards that utilize SAMD21 and SAMD51 chips. See +https://circuitpython.org/downloads for all supported boards. -- Adafruit CircuitPlayground Express -- Adafruit Feather M0 Basic -- Adafruit Feather M0 Express -- Adafruit Metro M0 Express -- Adafruit M0 Bluefruit LE -- Arduino Zero -- Arduino MKR Zero -- Arduino Nano 33 IoT - - -Pinout ------- - -All of the boards share the same core pin functionality but call pins by -different names. The table below matches the pin order in -`the datasheet `_ -and omits the pins only available on the largest package because all supported -boards use smaller version. - -===================== =================== =================== =============== =========================== ====================== ================ ================== ========================= ================ ================================ ====================== ================ -`microcontroller.pin` `board` ---------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -Datasheet arduino_mkrzero arduino_nano_33_iot arduino_zero circuitplayground_express feather_m0_adalogger feather_m0_basic feather_m0_express gemma_m0 metro_m0_express sparkfun_samd21_mini sparkfun_samd21_dev trinket_m0 -===================== =================== =================== =============== =========================== ====================== ================ ================== ========================= ================ ================================ ====================== ================ -PA00 ``ACCELEROMETER_SDA`` ``APA102_MOSI`` ``APA102_MOSI`` -PA01 ``ACCELEROMETER_SCL`` ``APA102_SCK`` ``APA102_SCK`` -PA02 ``A0`` ``A0`` ``A0`` ``A0`` / ``SPEAKER`` ``A0`` ``A0`` ``A0`` ``A0`` / ``D1`` ``A0`` ``A0`` ``A0`` ``D1`` / ``A0`` -PA03 -PB08 ``L`` ``A4`` / ``SDA`` ``A1`` ``A7`` / ``TX`` ``A1`` ``A1`` ``A1`` ``A1`` ``A1`` ``A1`` -PB09 ``BATTERY`` ``A5`` / ``SCL`` ``A2`` ``A6`` / ``RX`` ``A2`` ``A2`` ``A2`` ``A2`` ``A2`` ``A2`` -PA04 ``A3`` ``D6`` ``A3`` ``IR_PROXIMITY`` ``A3`` ``A3`` ``A3`` ``D0`` / ``TX`` / ``SDA`` ``A3`` ``A3`` ``A3`` -PA05 ``A4`` ``D5`` ``A4`` ``A1`` ``A4`` ``A4`` ``A4`` ``D2`` / ``RX`` / ``SCL`` ``A4`` ``A4`` -PA06 ``A5`` ``D7`` ``D8`` ``A2`` ``D8`` / ``GREEN_LED`` ``NEOPIXEL`` ``D8`` ``D8`` ``D8`` ``D4`` / ``TX`` -PA07 ``A6`` ``D4`` ``D9`` ``A3`` ``D9`` ``D9`` ``D9`` ``D9`` ``D9`` ``D9`` ``D3`` / ``RX`` -PA08 ``D11`` / ``SDA`` ``ESP_RESET`` ``D4`` ``MICROPHONE_DO`` ``D4`` / ``SD_CS`` ``D4`` ``D4`` ``D4`` ``D0`` / ``SDA`` -PA09 ``D12`` / ``SCL`` ``A6`` ``D3`` ``TEMPERATURE`` / ``A9`` ``D3`` ``D3`` ``D3`` ``D2`` / ``SCL`` -PA10 ``D2`` ``A3`` ``D1`` / ``TX`` ``MICROPHONE_SCK`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D13`` -PA11 ``D3`` ``A2`` ``D0`` / ``RX`` ``LIGHT`` / ``A8`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` -PB10 ``D4`` ``D2`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` -PB11 ``D5`` ``D3`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` -PA12 ``SD_MOSI`` ``ESP_MOSI`` ``MISO`` ``REMOTEIN`` / ``IR_RX`` ``MISO`` ``MISO`` ``MISO`` ``MISO`` ``MISO`` -PA13 ``SD_SCK`` ``ESP_MISO`` ``ACCELEROMETER_INTERRUPT`` ``FLASH_CS`` ``D38`` -PA14 ``SD_CS`` ``ESP_CS`` ``D2`` ``BUTTON_B`` / ``D5`` ``D2`` ``D2`` ``D2`` -PA15 ``SD_MISO`` ``ESP_SCK`` ``D5`` ``SLIDE_SWITCH`` / ``D7`` ``D5`` ``D5`` ``D5`` ``D5`` ``D5`` ``D5`` -PA16 ``D8`` / ``MOSI`` ``D11`` / ``MOSI`` ``D11`` ``MISO`` ``D11`` ``D11`` ``D11`` ``D11`` ``D11`` / ``MOSI`` ``D11`` -PA17 ``D9`` / ``SCK`` ``D13`` / ``SCK`` ``D13`` ``D13`` ``D13`` / ``RED_LED`` ``D13`` ``D13`` ``D13`` ``D13`` / ``SCK`` / ``BLUE_LED`` ``D13`` / ``BLUE_LED`` -PA18 ``D8`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` -PA19 ``D10`` / ``MISO`` ``D12`` / ``MISO`` ``D12`` ``D12`` ``D12`` ``D12`` ``D12`` ``D12`` / ``MISO`` ``D12`` -PA20 ``D6`` ``D9`` ``D6`` ``MOSI`` ``D6`` ``D6`` ``D6`` ``D6`` ``D6`` ``D6`` -PA21 ``D7`` ``D10`` ``D7`` ``SCK`` ``D7`` / ``SD_CD`` ``D7`` ``D7`` ``D7`` -PA22 ``D0`` ``ESP_TX`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` -PA23 ``D1`` ``ESP_RX`` ``SCL`` ``REMOTEOUT`` / ``IR_TX`` ``SCL`` ``SCL`` ``SCL`` ``L`` / ``D13`` ``SCL`` ``SCL`` ``SCL`` -PA24 -PA25 -PB22 ``D14`` / ``TX`` ``D1`` / ``TX`` ``FLASH_CS`` ``D30`` / ``TX1`` -PB23 ``D13`` / ``RX`` ``D0`` / ``RX`` ``NEOPIXEL`` / ``D8`` ``D31`` / ``RX1`` -PA27 ``SD_CD`` ``ESP_GPIO0`` ``GREEN_LED`` ``GREEN_LED`` -PA28 ``ESP_BUSY`` ``BUTTON_A`` / ``D4`` -PA29 -PA30 ``SPEAKER_ENABLE`` ``NEOPIXEL`` -PA31 -PB02 ``A1`` ``A1`` ``A5`` ``A5`` / ``SDA`` ``A5`` ``A5`` ``A5`` ``A5`` ``A5`` -PB03 ``A2`` ``A7`` ``A4`` / ``SCL`` ``YELLOW_LED`` ``YELLOW_LED`` -===================== =================== =================== =============== =========================== ====================== ================ ================== ========================= ================ ================================ ====================== ================ - -Here is a table about which pins can do what in CircuitPython terms. However, -just because something is listed, doesn't mean it will always work. Existing use -of other pins and functionality will impact your ability to use a pin for your -desired purpose. For example, only certain combinations of SPI pins will work -because they use shared hardware internally. - -===================== ======== ========= ========= ======= ======= ======= ========= ========= ======= ========== ========== ========= ========= ========= ============ ======= ======= ========= -`microcontroller.pin` `analogio` `audioio` `bitbangio` `busio` `digitalio` `pulseio` `touchio` ---------------------- ------------------- --------- ------------------------- -------------------------------------------------------------------------------------- ------------ ---------------- --------- -Datasheet AnalogIn AnalogOut AudioOut I2C OneWire SPI I2C - SDA I2C - SCL OneWire SPI - MISO SPI - MOSI SPI - SCK UART - RX UART - TX DigitalInOut PulseIn PWMOut TouchIn -===================== ======== ========= ========= ======= ======= ======= ========= ========= ======= ========== ========== ========= ========= ========= ============ ======= ======= ========= -PA00 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA01 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA02 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA03 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB08 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB09 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA04 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA05 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA06 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA07 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA08 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA09 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA10 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA11 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB10 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB11 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA12 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA13 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA14 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA15 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA16 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA17 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA18 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA19 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA20 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA21 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA22 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA23 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA24 -PA25 -PB22 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB23 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA27 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA28 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA29 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA30 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA31 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB02 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB03 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -===================== ======== ========= ========= ======= ======= ======= ========= ========= ======= ========== ========== ========= ========= ========= ============ ======= ======= ========= - -Setup ------ - -An ARM compiler is required for the build, along with the associated binary -utilities. They can be installed as follows: - -- Ubuntu - - .. code-block:: shell - - sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa - sudo apt-get install gcc-arm-embedded - -- Arch Linux - - .. code-block:: shell - - sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib - -For other systems, the `GNU Arm Embedded Toolchain `_ -may be available in binary form. - -The latest available package from team-gcc-arm-embedded is used to produce the -binaries shipped by AdaFruit. Other compiler versions, particularly older -ones, may not work properly. In particular, the ``gcc-arm-none-eabi`` package -in Debian Stretch is too old. - -The compiler can be changed using the ``CROSS_COMPILE`` variable when invoking -``make``. Building -------- -Before building the firmware for a given board, there are two additional steps. -These commands should be executed from the root directory of the repository -(``circuitpython/``). - -1. There are various submodules that reside in different repositories. In order - to have these submodules locally, you must pull them into your clone, using: - -.. code-block:: shell - - git submodule update --init --recursive - -2. The MicroPython cross-compiler must be built; it will be used to pre-compile - some of the built-in scripts to bytecode. The cross-compiler is built and - run on the host machine, using: - -.. code-block:: shell - - make -C mpy-cross +For build instructions see this guide: https://learn.adafruit.com/building-circuitpython/ -Build commands are run from the ``circuitpython/ports/atmel-samd`` directory. - -To build for a given board you must specify it by setting ``BOARD``. For example: - -.. code-block:: shell - - make BOARD=feather_m0_basic - -Board names are the directory names in the `boards `_ folder. - -Deploying +Debugging --------- -Arduino Bootloader -^^^^^^^^^^^^^^^^^^ +For debugging instructions see this guide: https://learn.adafruit.com/debugging-the-samd21-with-gdb -If your board has an existing Arduino bootloader on it then you can use bossac -to flash MicroPython. First, activate the bootloader. On Adafruit Feathers you -can double click the reset button and the #13 will fade in and out. Finally, -run bossac: - - tools/bossac_osx -e -w -v -b -R build-feather_m0_basic/firmware.bin - -No Bootloader via GDB -^^^^^^^^^^^^^^^^^^^^^ - -This method works for loading MicroPython onto the Arduino Zero via the -programming port rather than the native USB port. - -Note: These instructions are tested on Mac OSX and will vary for different -platforms. - - openocd -f ~/Library/Arduino15/packages/arduino/hardware/samd/1.6.6/variants/arduino_zero/openocd_scripts/arduino_zero.cfg - -In another terminal from ``micropython/atmel-samd``: - - arm-none-eabi-gdb build-arduino_zero/firmware.elf - (gdb) tar ext :3333 - ... - (gdb) load - ... - (gdb) monitor reset init - ... - (gdb) continue - -Connecting ----------- - -Serial -^^^^^^ - -All boards are currently configured to work over USB rather than UART. To -connect to it from OSX do something like this: - - screen /dev/tty.usbmodem142422 115200 - -You may not see a prompt immediately because it doesn't know you connected. To -get one either hit enter to get `>>>` or do CTRL-B to get the full header. - -Mass storage -^^^^^^^^^^^^ - -All boards will also show up as a mass storage device. Make sure to eject it -before resetting or disconnecting the board. Port Specific modules --------------------- diff --git a/ports/atmel-samd/background.c b/ports/atmel-samd/background.c index ca91a31de6..767c7f3b6b 100644 --- a/ports/atmel-samd/background.c +++ b/ports/atmel-samd/background.c @@ -26,7 +26,6 @@ #include "background.h" #include "audio_dma.h" -#include "tick.h" #include "supervisor/filesystem.h" #include "supervisor/shared/tick.h" #include "supervisor/usb.h" @@ -34,6 +33,7 @@ #include "py/runtime.h" #include "shared-module/network/__init__.h" #include "supervisor/shared/stack.h" +#include "supervisor/port.h" #ifdef CIRCUITPY_DISPLAYIO #include "shared-module/displayio/__init__.h" @@ -92,10 +92,10 @@ void run_background_tasks(void) { running_background_tasks = false; assert_heap_ok(); - last_finished_tick = supervisor_ticks_ms64(); + last_finished_tick = port_get_raw_ticks(NULL); finish_background_task(); } bool background_tasks_ok(void) { - return supervisor_ticks_ms64() - last_finished_tick < 1000; + return port_get_raw_ticks(NULL) - last_finished_tick < 1024; } diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk index 3e865657ac..dcc62fc9bc 100644 --- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -13,7 +13,7 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q128JV_SQ" LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index bd682ade07..d31d1f54a4 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -8,5 +8,5 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index 894b9b0110..7eb83a1230 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk index 8a29b0ace0..fd24edafa2 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index f94ec13b7c..a5722c9ade 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk index c3f0750a9e..055e6b19e2 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk @@ -8,4 +8,4 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index adae4beb27..8724e0d4bb 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -8,4 +8,4 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index 1516c149b9..c5ef958c9b 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -12,10 +12,11 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" # Turn off features and optimizations for Crickit build to make room for additional frozen libs. LONGINT_IMPL = NONE +CIRCUITPY_BITBANGIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 -CIRCUITPY_PIXELBUF = 0 +CIRCUITPY_PIXELBUF = 1 CIRCUITPY_RTC = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk index 4f6c7ab82e..ae05d32f2c 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk index 336a1b832f..6fd05f403b 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk index 7ec2efcf96..d42a7869de 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk index d3ec1b0fdd..d92cbc71b3 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk index dedd49ff71..93f6b1c90f 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index 134abf7236..54c5bff6a0 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index 3643743509..69ebdfc237 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 40a461b279..7556b9517f 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index 736161047a..de79638bd3 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index d649386328..ca3eccbe4f 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index 9a1db9ca97..4717e6ceb9 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -32,8 +32,6 @@ #include "shared-module/displayio/mipi_constants.h" #include "shared-bindings/busio/SPI.h" -#include "tick.h" - displayio_fourwire_obj_t board_display_obj; #define DELAY 0x80 diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index af4a5a2932..875d23f9b7 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -20,7 +20,7 @@ CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 -CFLAGS_INLINE_LIMIT = 60 +CFLAGS_INLINE_LIMIT = 55 SUPEROPT_GC = 0 # Include these Python libraries in firmware. diff --git a/ports/atmel-samd/boards/hallowing_m4_express/board.c b/ports/atmel-samd/boards/hallowing_m4_express/board.c index 3e4a04ae22..7da1d8128c 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/board.c @@ -31,7 +31,6 @@ #include "shared-bindings/displayio/FourWire.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk index 4b452ecbfe..bd0afb60e2 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/monster_m4sk/board.c b/ports/atmel-samd/boards/monster_m4sk/board.c index 55d6f80c91..4dd65f8c90 100644 --- a/ports/atmel-samd/boards/monster_m4sk/board.c +++ b/ports/atmel-samd/boards/monster_m4sk/board.c @@ -31,7 +31,6 @@ #include "shared-bindings/displayio/FourWire.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk index b73f0951ee..5e5f0ff5fd 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk @@ -9,7 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk b/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk index 4f6d1e70d5..1b4a16a08d 100644 --- a/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk +++ b/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk @@ -11,4 +11,4 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "GD25Q16C" LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/openbook_m4/board.c b/ports/atmel-samd/boards/openbook_m4/board.c index 02270e7e57..9c71ee5640 100644 --- a/ports/atmel-samd/boards/openbook_m4/board.c +++ b/ports/atmel-samd/boards/openbook_m4/board.c @@ -32,7 +32,6 @@ #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index b3271d062f..7305abf73a 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -8,7 +8,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_PEW = 1 CIRCUITPY_ANALOGIO = 1 diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index bfec489e70..52a52b4b7d 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -32,7 +32,6 @@ #include "shared-bindings/displayio/FourWire.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 51b4fc993c..f5b6ca3899 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -9,7 +9,7 @@ CHIP_FAMILY = samd51 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 # TODO: Turn off analogio for now for space reasons, but restore it # when frozen module gets smaller. CIRCUITPY_ANALOGIO = 0 diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk index e6c227b135..8b7066ac7a 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk @@ -20,7 +20,7 @@ CIRCUITPY_RTC = 0 CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 1 CIRCUITPY_TOUCHIO = 0 -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 # Make more room. SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index ffddf03977..45298acc27 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -32,7 +32,6 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" #include "supervisor/shared/board.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/pybadge_airlift/board.c b/ports/atmel-samd/boards/pybadge_airlift/board.c index 8274d0ebeb..7495c7d48f 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/board.c +++ b/ports/atmel-samd/boards/pybadge_airlift/board.c @@ -32,7 +32,6 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" #include "supervisor/shared/board.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index c7f2f6e1d8..2e83440ea6 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -32,7 +32,6 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" #include "supervisor/shared/board.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/pygamer_advance/board.c b/ports/atmel-samd/boards/pygamer_advance/board.c index 6053fedb09..330446b6ff 100644 --- a/ports/atmel-samd/boards/pygamer_advance/board.c +++ b/ports/atmel-samd/boards/pygamer_advance/board.c @@ -32,7 +32,6 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" #include "supervisor/shared/board.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/pyportal/board.c b/ports/atmel-samd/boards/pyportal/board.c index ed3006e3cc..d14b6b6a58 100644 --- a/ports/atmel-samd/boards/pyportal/board.c +++ b/ports/atmel-samd/boards/pyportal/board.c @@ -31,8 +31,6 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" - #define DELAY 0x80 uint8_t display_init_sequence[] = { diff --git a/ports/atmel-samd/boards/pyportal_titano/board.c b/ports/atmel-samd/boards/pyportal_titano/board.c index e7763b6e5c..0ee2e68aa2 100644 --- a/ports/atmel-samd/boards/pyportal_titano/board.c +++ b/ports/atmel-samd/boards/pyportal_titano/board.c @@ -34,8 +34,6 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" - #define DELAY 0x80 uint8_t display_init_sequence[] = { diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk index ca7ed4bdc3..b799406732 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -8,7 +8,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk index 2741454ce9..bedec87f45 100644 --- a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk +++ b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk index bc37b59433..295ba4bce4 100644 --- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -8,7 +8,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_I2CSLAVE = 1 CIRCUITPY_TOUCHIO = 0 diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk index 632cd095c2..22e2059a93 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk @@ -9,5 +9,5 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/mpconfigboard.mk index ccf5a41495..dd01c9985b 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/mpconfigboard.mk @@ -11,5 +11,5 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q32FV" LONGINT_IMPL = MPZ -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk index 0c33ef960e..a2bd577cd3 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk index d09785fb8a..9460d0009b 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index 5c942901a8..aab5efd5dc 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -8,7 +8,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 950910e48b..90b5600dcb 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -8,4 +8,4 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index d3a452119c..3bb9eab7de 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -33,8 +33,6 @@ #include "shared-module/displayio/mipi_constants.h" #include "shared-bindings/busio/SPI.h" -#include "tick.h" - displayio_fourwire_obj_t board_display_obj; #define DELAY 0x80 diff --git a/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk index 941d88b459..fdcde4a07e 100644 --- a/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk @@ -9,7 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index 5c418d312c..c1dbf514d7 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -9,7 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index 76e66ab45f..a1e35a1dc0 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -49,7 +49,6 @@ #include "samd/dma.h" #include "audio_dma.h" -#include "tick.h" #define OVERSAMPLING 64 #define SAMPLES_PER_BUFFER 32 diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 1f6b75f972..d6c13eb7e5 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -45,6 +45,9 @@ #include "samd/sercom.h" +#define UART_DEBUG(...) (void)0 +// #define UART_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + // Do-nothing callback needed so that usart_async code will enable rx interrupts. // See comment below re usart_async_register_callback() static void usart_async_rxc_callback(const struct usart_async_descriptor *const descr) { diff --git a/ports/atmel-samd/common-hal/displayio/ParallelBus.c b/ports/atmel-samd/common-hal/displayio/ParallelBus.c index 2479e3b40e..405c08c64a 100644 --- a/ports/atmel-samd/common-hal/displayio/ParallelBus.c +++ b/ports/atmel-samd/common-hal/displayio/ParallelBus.c @@ -33,8 +33,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/__init__.h" -#include "tick.h" - void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index cbb0671045..fcb3c0ce73 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -24,11 +24,12 @@ * THE SOFTWARE. */ +#include "shared-bindings/frequencyio/FrequencyIn.h" + #include #include "hal/include/hal_gpio.h" #include "atmel_start_pins.h" -#include "supervisor/shared/translate.h" #include "mpconfigport.h" #include "py/runtime.h" @@ -41,11 +42,11 @@ #include "samd/pins.h" #include "samd/external_interrupts.h" -#include "shared-bindings/frequencyio/FrequencyIn.h" #include "peripheral_clk_config.h" #include "hpl_gclk_config.h" -#include "tick.h" +#include "shared-bindings/time/__init__.h" +#include "supervisor/shared/translate.h" #ifdef SAMD21 #include "hpl/gclk/hpl_gclk_base.h" @@ -88,9 +89,7 @@ void frequencyin_interrupt_handler(uint8_t index) { if (!ref_tc->COUNT16.INTFLAG.bit.OVF) return; // false trigger - uint32_t current_us; - uint64_t current_ms; - current_tick(¤t_ms, ¤t_us); + uint64_t current_ns = common_hal_time_monotonic_ns(); for (uint8_t i = 0; i <= (TC_INST_NUM - 1); i++) { if (active_frequencyins[i] != NULL) { @@ -101,14 +100,12 @@ void frequencyin_interrupt_handler(uint8_t index) { if ((EIC->INTFLAG.reg & mask) == mask) { // Make sure capture_period has elapsed before we // record a new event count. - if (current_ms - self->last_ms >= self->capture_period) { - float new_factor = self->last_us + (1000 - current_us); + if ((current_ns - self->last_ns) / 1000000 >= self->capture_period) { // ms difference will not need 64 bits. If we use 64 bits, // double-precision float routines are required, and we don't // want to include them because they're very large. - self->factor = (uint32_t) (current_ms - self->last_ms) + (new_factor / 1000); - self->last_ms = current_ms; - self->last_us = current_us; + self->factor = (uint32_t) (current_ns - self->last_ns) / 1000000.0; + self->last_ns = current_ns; #ifdef SAMD51 tc->COUNT16.CTRLBSET.bit.CMD = TC_CTRLBSET_CMD_READSYNC_Val; @@ -278,8 +275,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* self->pin = pin->number; self->channel = pin->extint_channel; self->errored_too_fast = false; - self->last_ms = 0; - self->last_us = 1000; + self->last_ns = 0; self->capture_period = capture_period; #ifdef SAMD21 self->TC_IRQ = TC3_IRQn + timer_index; diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h index abd63cc86d..461fb661f1 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h @@ -38,8 +38,7 @@ typedef struct { uint8_t channel; uint8_t event_channel; uint32_t frequency; - volatile uint64_t last_ms; - volatile uint32_t last_us; + volatile uint64_t last_ns; float factor; uint32_t capture_period; uint8_t TC_IRQ; diff --git a/ports/atmel-samd/common-hal/neopixel_write/__init__.c b/ports/atmel-samd/common-hal/neopixel_write/__init__.c index ba69174af4..1755270253 100644 --- a/ports/atmel-samd/common-hal/neopixel_write/__init__.c +++ b/ports/atmel-samd/common-hal/neopixel_write/__init__.c @@ -29,7 +29,7 @@ #include "shared-bindings/neopixel_write/__init__.h" -#include "tick.h" +#include "supervisor/port.h" #ifdef SAMD51 #include "hri/hri_cmcc_d51.h" @@ -91,8 +91,7 @@ static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMa ""); } -uint64_t next_start_tick_ms = 0; -uint32_t next_start_tick_us = 1000; +uint64_t next_start_raw_ticks = 0; void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { // This is adapted directly from the Adafruit NeoPixel library SAMD21G18A code: @@ -101,9 +100,9 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, uint32_t pinMask; PortGroup* port; - // This must be called while interrupts are on in case we're waiting for a - // future ms tick. - wait_until(next_start_tick_ms, next_start_tick_us); + // Wait to make sure we don't append onto the last transmission. This should only be a tick or + // two. + while (port_get_raw_ticks(NULL) < next_start_raw_ticks) {} // Turn off interrupts of any kind during timing-sensitive code. mp_hal_disable_all_interrupts(); @@ -144,15 +143,8 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, #endif - // ticks_ms may be out of date at this point because we stopped the - // interrupt. We'll risk it anyway. - current_tick(&next_start_tick_ms, &next_start_tick_us); - if (next_start_tick_us < 100) { - next_start_tick_ms += 1; - next_start_tick_us = 100 - next_start_tick_us; - } else { - next_start_tick_us -= 100; - } + // Update the next start. + next_start_raw_ticks = port_get_raw_ticks(NULL) + 4; // Turn on interrupts after timing-sensitive code. mp_hal_enable_all_interrupts(); diff --git a/ports/atmel-samd/common-hal/ps2io/Ps2.c b/ports/atmel-samd/common-hal/ps2io/Ps2.c index 6a06864f21..2579142ad0 100644 --- a/ports/atmel-samd/common-hal/ps2io/Ps2.c +++ b/ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -41,10 +41,9 @@ #include "samd/pins.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/ps2io/Ps2.h" +#include "supervisor/port.h" #include "supervisor/shared/translate.h" -#include "tick.h" - #define STATE_IDLE 0 #define STATE_RECV 1 #define STATE_RECV_PARITY 2 @@ -168,24 +167,21 @@ static void delay_us(uint32_t t) { void ps2_interrupt_handler(uint8_t channel) { // Grab the current time first. - uint32_t current_us; - uint64_t current_ms; - current_tick(¤t_ms, ¤t_us); + uint64_t current_tick = port_get_raw_ticks(NULL); ps2io_ps2_obj_t* self = get_eic_channel_data(channel); int data_bit = gpio_get_pin_level(self->data_pin) ? 1 : 0; // test for timeout if (self->state != STATE_IDLE) { - int64_t diff_ms = current_ms - self->last_int_ms; - if (diff_ms >= 2) { // a.k.a. > 1.001ms + int64_t diff_ms = current_tick - self->last_raw_ticks; + if (diff_ms > 1) { // a.k.a. > 1.001ms self->last_errors |= ERROR_TIMEOUT; self->state = STATE_IDLE; } } - self->last_int_us = current_us; - self->last_int_ms = current_ms; + self->last_raw_ticks = current_tick; if (self->state == STATE_IDLE) { self->bits = 0; diff --git a/ports/atmel-samd/common-hal/ps2io/Ps2.h b/ports/atmel-samd/common-hal/ps2io/Ps2.h index cce6ae4746..588dfdd8be 100644 --- a/ports/atmel-samd/common-hal/ps2io/Ps2.h +++ b/ports/atmel-samd/common-hal/ps2io/Ps2.h @@ -39,8 +39,7 @@ typedef struct { uint8_t data_pin; uint8_t state; - uint64_t last_int_ms; - uint32_t last_int_us; + uint64_t last_raw_ticks; uint16_t bits; bool parity; diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index a2494f102f..508ee8d385 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -34,15 +34,31 @@ #include "background.h" #include "eic_handler.h" #include "mpconfigport.h" +#include "timer_handler.h" #include "py/gc.h" #include "py/runtime.h" #include "samd/external_interrupts.h" #include "samd/pins.h" +#include "samd/timers.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/pulseio/PulseIn.h" #include "supervisor/shared/translate.h" -#include "tick.h" +// This timer is shared amongst all PulseIn objects as a higher resolution clock. +static uint8_t refcount = 0; +static uint8_t pulsein_tc_index = 0xff; + +volatile static uint32_t overflow_count = 0; + +void pulsein_timer_interrupt_handler(uint8_t index) { + if (index != pulsein_tc_index) return; + overflow_count++; + Tc* tc = tc_insts[index]; + if (!tc->COUNT16.INTFLAG.bit.OVF) return; + + // Clear the interrupt bit. + tc->COUNT16.INTFLAG.reg = TC_INTFLAG_OVF; +} static void pulsein_set_config(pulseio_pulsein_obj_t* self, bool first_edge) { uint32_t sense_setting; @@ -61,13 +77,15 @@ static void pulsein_set_config(pulseio_pulsein_obj_t* self, bool first_edge) { void pulsein_interrupt_handler(uint8_t channel) { // Grab the current time first. - uint32_t current_us; - uint64_t current_ms; - current_tick(¤t_ms, ¤t_us); + uint32_t current_overflow = overflow_count; + Tc* tc = tc_insts[pulsein_tc_index]; + #ifdef SAMD51 + tc->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_READSYNC; + while (tc->COUNT16.SYNCBUSY.bit.COUNT == 1 || + tc->COUNT16.CTRLBSET.bit.CMD == TC_CTRLBSET_CMD_READSYNC_Val) {} + #endif + uint32_t current_count = tc->COUNT16.COUNT.reg; - // current_tick gives us the remaining us until the next tick but we want the number since the - // last ms. - current_us = 1000 - current_us; pulseio_pulsein_obj_t* self = get_eic_channel_data(channel); if (!background_tasks_ok() || self->errored_too_fast) { self->errored_too_fast = true; @@ -78,17 +96,17 @@ void pulsein_interrupt_handler(uint8_t channel) { self->first_edge = false; pulsein_set_config(self, false); } else { - uint32_t ms_diff = current_ms - self->last_ms; - uint16_t us_diff = current_us - self->last_us; - uint32_t total_diff = us_diff; - if (self->last_us > current_us) { - total_diff = 1000 + current_us - self->last_us; - if (ms_diff > 1) { - total_diff += (ms_diff - 1) * 1000; - } - } else { - total_diff += ms_diff * 1000; + // Sometimes we beat the overflow interrupt so just fudge overflow in + // that case. + if (current_count < self->last_count && current_overflow == self->last_overflow) { + current_overflow += 1; } + uint32_t total_diff = current_count + 0xffff * (current_overflow - self->last_overflow) - self->last_count; + // The SAMD21 clock is 48MHz. We prescale it to 3MHz so // 3 here. + #ifdef SAMD21 + total_diff /= 3; + #endif + // Cap duration at 16 bits. uint16_t duration = 0xffff; if (total_diff < duration) { duration = total_diff; @@ -102,8 +120,14 @@ void pulsein_interrupt_handler(uint8_t channel) { self->start++; } } - self->last_ms = current_ms; - self->last_us = current_us; + self->last_overflow = current_overflow; + self->last_count = current_count; +} + +void pulsein_reset() { + refcount = 0; + pulsein_tc_index = 0xff; + overflow_count = 0; } void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, @@ -126,10 +150,62 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, self->start = 0; self->len = 0; self->first_edge = true; - self->last_us = 0; - self->last_ms = 0; self->errored_too_fast = false; + if (refcount == 0) { + // Find a spare timer. + Tc *tc = NULL; + int8_t index = TC_INST_NUM - 1; + for (; index >= 0; index--) { + if (tc_insts[index]->COUNT16.CTRLA.bit.ENABLE == 0) { + tc = tc_insts[index]; + break; + } + } + if (tc == NULL) { + mp_raise_RuntimeError(translate("All timers in use")); + } + + pulsein_tc_index = index; + + set_timer_handler(true, index, TC_HANDLER_PULSEIN); + #ifdef SAMD21 + // We use GCLK0 for SAMD21 which is 48MHz. We prescale it to 3MHz. + turn_on_clocks(true, index, 0); + #endif + #ifdef SAMD51 + // We use GCLK5 for SAMD51 because it runs at 2MHz and we can use it for a 1MHz clock, + // 1us per tick. + turn_on_clocks(true, index, 5); + #endif + + + #ifdef SAMD21 + tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | + TC_CTRLA_PRESCALER_DIV16 | + TC_CTRLA_WAVEGEN_NFRQ; + #endif + #ifdef SAMD51 + tc_reset(tc); + tc_set_enable(tc, false); + tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV2; + tc->COUNT16.WAVE.reg = TC_WAVE_WAVEGEN_NFRQ; + #endif + + tc_set_enable(tc, true); + + // Clear our interrupt in case it was set earlier + tc->COUNT16.INTFLAG.reg = TC_INTFLAG_OVF; + tc->COUNT16.INTENSET.reg = TC_INTENSET_OVF; + tc_enable_interrupts(pulsein_tc_index); + tc->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_RETRIGGER; + + overflow_count = 0; + } + refcount++; + self->last_overflow = overflow_count; + self->last_count = 0; + set_eic_channel_data(pin->extint_channel, (void*) self); // Check to see if the EIC is enabled and start it up if its not.' @@ -158,6 +234,12 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { set_eic_handler(self->channel, EIC_HANDLER_NO_INTERRUPT); turn_off_eic_channel(self->channel); reset_pin_number(self->pin); + + refcount--; + if (refcount == 0) { + tc_reset(tc_insts[pulsein_tc_index]); + pulsein_tc_index = 0xff; + } self->pin = NO_PIN; } @@ -185,8 +267,8 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, // Reconfigure the pin and make sure its set to detect the first edge. self->first_edge = true; - self->last_ms = 0; - self->last_us = 0; + self->last_overflow = 0; + self->last_count = 0; gpio_set_pin_function(self->pin, GPIO_PIN_FUNCTION_A); uint32_t mask = 1 << self->channel; // Clear previous interrupt state and re-enable it. diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.h b/ports/atmel-samd/common-hal/pulseio/PulseIn.h index f5326d9e51..89b61a83ac 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.h +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.h @@ -41,13 +41,14 @@ typedef struct { volatile uint16_t start; volatile uint16_t len; volatile bool first_edge; - volatile uint64_t last_ms; - volatile uint16_t last_us; + volatile uint32_t last_overflow; + volatile uint16_t last_count; volatile bool errored_too_fast; } pulseio_pulsein_obj_t; void pulsein_reset(void); void pulsein_interrupt_handler(uint8_t channel); +void pulsein_timer_interrupt_handler(uint8_t index); #endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PULSEIO_PULSEIN_H diff --git a/ports/atmel-samd/common-hal/rtc/RTC.c b/ports/atmel-samd/common-hal/rtc/RTC.c index 4c888418b6..203187b4ff 100644 --- a/ports/atmel-samd/common-hal/rtc/RTC.c +++ b/ports/atmel-samd/common-hal/rtc/RTC.c @@ -30,76 +30,47 @@ #include #include #include -#include #include "py/obj.h" #include "py/runtime.h" #include "lib/timeutils/timeutils.h" #include "shared-bindings/rtc/__init__.h" +#include "supervisor/port.h" #include "supervisor/shared/translate.h" -static struct calendar_descriptor calendar; - -void rtc_init(void) { -#ifdef SAMD21 - _gclk_enable_channel(RTC_GCLK_ID, CONF_GCLK_RTC_SRC); -#endif -#ifdef SAMD51 - hri_mclk_set_APBAMASK_RTC_bit(MCLK); -#endif - calendar_init(&calendar, RTC); - calendar_set_baseyear(&calendar, 2000); - calendar_enable(&calendar); -} +// This is the time in seconds since 2000 that the RTC was started. +// TODO: Change the offset to ticks so that it can be a subsecond adjustment. +static uint32_t rtc_offset = 0; void common_hal_rtc_get_time(timeutils_struct_time_t *tm) { - struct calendar_date_time datetime; - calendar_get_date_time(&calendar, &datetime); - - tm->tm_year = datetime.date.year; - tm->tm_mon = datetime.date.month; - tm->tm_mday = datetime.date.day; - tm->tm_hour = datetime.time.hour; - tm->tm_min = datetime.time.min; - tm->tm_sec = datetime.time.sec; + uint64_t ticks_s = port_get_raw_ticks(NULL) / 1024; + timeutils_seconds_since_2000_to_struct_time(rtc_offset + ticks_s, tm); } void common_hal_rtc_set_time(timeutils_struct_time_t *tm) { - // Reset prescaler to increase initial precision. Otherwise we can be up to 1 second off already. - uint32_t freqcorr = hri_rtcmode0_read_FREQCORR_reg(calendar.device.hw); - calendar_deinit(&calendar); - rtc_init(); - hri_rtcmode0_write_FREQCORR_reg(calendar.device.hw, freqcorr); - - struct calendar_date date = { - .year = tm->tm_year, - .month = tm->tm_mon, - .day = tm->tm_mday, - }; - calendar_set_date(&calendar, &date); - - struct calendar_time time = { - .hour = tm->tm_hour, - .min = tm->tm_min, - .sec = tm->tm_sec, - }; - calendar_set_time(&calendar, &time); + uint64_t ticks_s = port_get_raw_ticks(NULL) / 1024; + uint32_t epoch_s = timeutils_seconds_since_2000( + tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec + ); + rtc_offset = epoch_s - ticks_s; } // A positive value speeds up the clock by removing clock cycles. int common_hal_rtc_get_calibration(void) { - int calibration = hri_rtcmode0_read_FREQCORR_VALUE_bf(calendar.device.hw); + int calibration = hri_rtcmode0_read_FREQCORR_VALUE_bf(RTC); - if (!hri_rtcmode0_get_FREQCORR_SIGN_bit(calendar.device.hw)) + if (!hri_rtcmode0_get_FREQCORR_SIGN_bit(RTC)) { calibration = -calibration; + } return calibration; } void common_hal_rtc_set_calibration(int calibration) { - if (calibration > 127 || calibration < -127) + if (calibration > 127 || calibration < -127) { mp_raise_ValueError(translate("calibration value out of range +/-127")); + } - hri_rtcmode0_write_FREQCORR_SIGN_bit(calendar.device.hw, calibration < 0 ? 0 : 1); - hri_rtcmode0_write_FREQCORR_VALUE_bf(calendar.device.hw, abs(calibration)); + hri_rtcmode0_write_FREQCORR_SIGN_bit(RTC, calibration < 0 ? 0 : 1); + hri_rtcmode0_write_FREQCORR_VALUE_bf(RTC, abs(calibration)); } diff --git a/ports/atmel-samd/common-hal/rtc/RTC.h b/ports/atmel-samd/common-hal/rtc/RTC.h index 1d63b2deac..19cbc0b5c5 100644 --- a/ports/atmel-samd/common-hal/rtc/RTC.h +++ b/ports/atmel-samd/common-hal/rtc/RTC.h @@ -27,6 +27,4 @@ #ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RTC_RTC_H #define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RTC_RTC_H -extern void rtc_init(void); - #endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RTC_RTC_H diff --git a/ports/atmel-samd/common-hal/touchio/TouchIn.c b/ports/atmel-samd/common-hal/touchio/TouchIn.c index 908d8d7228..b2fcc6cdef 100644 --- a/ports/atmel-samd/common-hal/touchio/TouchIn.c +++ b/ports/atmel-samd/common-hal/touchio/TouchIn.c @@ -42,7 +42,6 @@ #include "samd/clocks.h" #include "samd/pins.h" -#include "tick.h" #include "adafruit_ptc.h" bool touch_enabled = false; diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 039263be79..92d47b186a 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -64,22 +64,12 @@ ifndef CIRCUITPY_SAMD CIRCUITPY_SAMD = 1 endif -ifndef CIRCUITPY_ULAB -ifneq ($(CIRCUITPY_SMALL_BUILD),1) -CIRCUITPY_ULAB = 1 -endif -endif - ifndef CIRCUITPY_RGBMATRIX -ifneq ($(CIRCUITPY_SMALL_BUILD),1) -CIRCUITPY_RGBMATRIX = 1 -endif +CIRCUITPY_RGBMATRIX = $(CIRCUITPY_FULL_BUILD) endif ifndef CIRCUITPY_FRAMEBUFFERIO -ifneq ($(CIRCUITPY_SMALL_BUILD),1) -CIRCUITPY_FRAMEBUFFERIO = 1 -endif +CIRCUITPY_FRAMEBUFFERIO = $(CIRCUITPY_FULL_BUILD) endif endif # samd51 diff --git a/ports/atmel-samd/mphalport.c b/ports/atmel-samd/mphalport.c index 96433d729f..23a9b43300 100644 --- a/ports/atmel-samd/mphalport.c +++ b/ports/atmel-samd/mphalport.c @@ -49,21 +49,6 @@ extern uint32_t common_hal_mcu_processor_get_frequency(void); -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - RUN_BACKGROUND_TASKS; - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} - // Use mp_hal_delay_us() for timing of less than 1ms. // Do a simple timing loop to wait for a certain number of microseconds. // Can be used when interrupts are disabled, which makes tick_delay() unreliable. diff --git a/ports/atmel-samd/mphalport.h b/ports/atmel-samd/mphalport.h index 8a762e2584..f119717499 100644 --- a/ports/atmel-samd/mphalport.h +++ b/ports/atmel-samd/mphalport.h @@ -34,9 +34,8 @@ #include "supervisor/shared/tick.h" // Global millisecond tick count (driven by SysTick interrupt). -static inline mp_uint_t mp_hal_ticks_ms(void) { - return supervisor_ticks_ms32(); -} +#define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32()) + // Number of bytes in receive buffer volatile uint8_t usb_rx_count; volatile bool mp_cdc_enabled; diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index f528240c2a..6b531fc923 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit f528240c2a4c2d7a39de786f1aa56895c12227b4 +Subproject commit 6b531fc923d9f02b14bd731a5f584ddf716e8773 diff --git a/ports/atmel-samd/supervisor/internal_flash.c b/ports/atmel-samd/supervisor/internal_flash.c index a8ff5adfa9..9c8ff990ed 100644 --- a/ports/atmel-samd/supervisor/internal_flash.c +++ b/ports/atmel-samd/supervisor/internal_flash.c @@ -41,6 +41,7 @@ #endif #include "hal/include/hal_flash.h" +#include "supervisor/flash.h" #include "supervisor/shared/rgb_led_status.h" static struct flash_descriptor supervisor_flash_desc; @@ -73,7 +74,7 @@ uint32_t supervisor_flash_get_block_count(void) { return INTERNAL_FLASH_PART1_NUM_BLOCKS; } -void supervisor_flash_flush(void) { +void port_internal_flash_flush(void) { } void supervisor_flash_release_cache(void) { diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 01ca797cad..04e2c9191a 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -32,6 +32,7 @@ // ASF 4 #include "atmel_start_pins.h" +#include "peripheral_clk_config.h" #include "hal/include/hal_delay.h" #include "hal/include/hal_flash.h" #include "hal/include/hal_gpio.h" @@ -70,10 +71,10 @@ #include "samd/dma.h" #include "shared-bindings/rtc/__init__.h" #include "reset.h" -#include "tick.h" #include "supervisor/shared/safe_mode.h" #include "supervisor/shared/stack.h" +#include "supervisor/shared/tick.h" #include "tusb.h" @@ -132,6 +133,53 @@ static void save_usb_clock_calibration(void) { } #endif +static void rtc_init(void) { +#ifdef SAMD21 + _gclk_enable_channel(RTC_GCLK_ID, GCLK_CLKCTRL_GEN_GCLK2_Val); + RTC->MODE0.CTRL.bit.SWRST = true; + while (RTC->MODE0.CTRL.bit.SWRST != 0) {} + + RTC->MODE0.CTRL.reg = RTC_MODE0_CTRL_ENABLE | + RTC_MODE0_CTRL_MODE_COUNT32 | + RTC_MODE0_CTRL_PRESCALER_DIV2; +#endif +#ifdef SAMD51 + hri_mclk_set_APBAMASK_RTC_bit(MCLK); + RTC->MODE0.CTRLA.bit.SWRST = true; + while (RTC->MODE0.SYNCBUSY.bit.SWRST != 0) {} + + RTC->MODE0.CTRLA.reg = RTC_MODE0_CTRLA_ENABLE | + RTC_MODE0_CTRLA_MODE_COUNT32 | + RTC_MODE0_CTRLA_PRESCALER_DIV2 | + RTC_MODE0_CTRLA_COUNTSYNC; +#endif + + RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_OVF; + + // Set all peripheral interrupt priorities to the lowest priority by default. + for (uint16_t i = 0; i < PERIPH_COUNT_IRQn; i++) { + NVIC_SetPriority(i, (1UL << __NVIC_PRIO_BITS) - 1UL); + } + // Bump up the rtc interrupt so nothing else interferes with timekeeping. + NVIC_SetPriority(RTC_IRQn, 0); + #ifdef SAMD21 + NVIC_SetPriority(USB_IRQn, 1); + #endif + + #ifdef SAMD51 + NVIC_SetPriority(USB_0_IRQn, 1); + NVIC_SetPriority(USB_1_IRQn, 1); + NVIC_SetPriority(USB_2_IRQn, 1); + NVIC_SetPriority(USB_3_IRQn, 1); + #endif + NVIC_ClearPendingIRQ(RTC_IRQn); + NVIC_EnableIRQ(RTC_IRQn); +#if CIRCUITPY_RTC + rtc_reset(); +#endif + +} + safe_mode_t port_init(void) { #if defined(SAMD21) @@ -220,12 +268,7 @@ safe_mode_t port_init(void) { clock_init(BOARD_HAS_CRYSTAL, DEFAULT_DFLL48M_FINE_CALIBRATION); #endif - // Configure millisecond timer initialization. - tick_init(); - -#if CIRCUITPY_RTC rtc_init(); -#endif init_shared_dma(); @@ -267,6 +310,7 @@ void reset_port(void) { #endif eic_reset(); #if CIRCUITPY_PULSEIO + pulsein_reset(); pulseout_reset(); pwmout_reset(); #endif @@ -275,9 +319,6 @@ void reset_port(void) { analogin_reset(); analogout_reset(); #endif -#if CIRCUITPY_RTC - rtc_reset(); -#endif reset_gclks(); @@ -352,6 +393,108 @@ uint32_t port_get_saved_word(void) { return *safe_word; } +// TODO: Move this to an RTC backup register so we can preserve it when only the BACKUP power domain +// is enabled. +static volatile uint64_t overflowed_ticks = 0; +static volatile bool _ticks_enabled = false; + +void RTC_Handler(void) { + uint32_t intflag = RTC->MODE0.INTFLAG.reg; + if (intflag & RTC_MODE0_INTFLAG_OVF) { + RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_OVF; + // Our RTC is 32 bits and we're clocking it at 16.384khz which is 16 (2 ** 4) subticks per + // tick. + overflowed_ticks += (1L<< (32 - 4)); + #ifdef SAMD51 + } else if (intflag & RTC_MODE0_INTFLAG_PER2) { + RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_PER2; + // Do things common to all ports when the tick occurs + supervisor_tick(); + #endif + } else if (intflag & RTC_MODE0_INTFLAG_CMP0) { + // Clear the interrupt because we may have hit a sleep and _ticks_enabled + RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; + #ifdef SAMD21 + if (_ticks_enabled) { + // Do things common to all ports when the tick occurs. + supervisor_tick(); + // Check _ticks_enabled again because a tick handler may have turned it off. + if (_ticks_enabled) { + port_interrupt_after_ticks(1); + } + } + #endif + #ifdef SAMD51 + RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0; + #endif + } +} + +static uint32_t _get_count(void) { + #ifdef SAMD51 + while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} + #endif + #ifdef SAMD21 + while (RTC->MODE0.STATUS.bit.SYNCBUSY != 0) {} + #endif + + return RTC->MODE0.COUNT.reg; +} + +uint64_t port_get_raw_ticks(uint8_t* subticks) { + uint32_t current_ticks = _get_count(); + if (subticks != NULL) { + *subticks = (current_ticks % 16) * 2; + } + + return overflowed_ticks + current_ticks / 16; +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { + #ifdef SAMD51 + // PER2 will generate an interrupt every 32 ticks of the source 32.768 clock. + RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_PER2; + #endif + #ifdef SAMD21 + _ticks_enabled = true; + port_interrupt_after_ticks(1); + #endif +} + +// Disable 1/1024 second tick. +void port_disable_tick(void) { + #ifdef SAMD51 + RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_PER2; + #endif + #ifdef SAMD21 + _ticks_enabled = false; + RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0; + #endif +} + +void port_interrupt_after_ticks(uint32_t ticks) { + uint32_t current_ticks = _get_count(); + if (ticks > 1 << 28) { + // We'll interrupt sooner with an overflow. + return; + } + RTC->MODE0.COMP[0].reg = current_ticks + (ticks << 4); + RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; + RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_CMP0; +} + +void port_sleep_until_interrupt(void) { + #ifdef SAMD51 + // Clear the FPU interrupt because it can prevent us from sleeping. + if (__get_FPSCR() & ~(0x9f)) { + __set_FPSCR(__get_FPSCR() & ~(0x9f)); + (void) __get_FPSCR(); + } + #endif + __WFI(); +} + /** * \brief Default interrupt handler for unused IRQs. */ diff --git a/ports/atmel-samd/supervisor/usb.c b/ports/atmel-samd/supervisor/usb.c index d13ca0ef13..b8a94790d7 100644 --- a/ports/atmel-samd/supervisor/usb.c +++ b/ports/atmel-samd/supervisor/usb.c @@ -28,6 +28,7 @@ #include "hpl/pm/hpl_pm_base.h" #include "hpl/gclk/hpl_gclk_base.h" #include "hal_gpio.h" +#include "lib/tinyusb/src/device/usbd.h" void init_usb_hardware(void) { #ifdef SAMD21 @@ -57,3 +58,27 @@ void init_usb_hardware(void) { gpio_set_pin_function(PIN_PA25, PINMUX_PA25H_USB_DP); #endif } + +#ifdef SAMD21 +void USB_Handler(void) { + tud_int_handler(0); +} +#endif + +#ifdef SAMD51 +void USB_0_Handler (void) { + tud_int_handler(0); +} + +void USB_1_Handler (void) { + tud_int_handler(0); +} + +void USB_2_Handler (void) { + tud_int_handler(0); +} + +void USB_3_Handler (void) { + tud_int_handler(0); +} +#endif diff --git a/ports/atmel-samd/tick.c b/ports/atmel-samd/tick.c deleted file mode 100644 index f996440ae3..0000000000 --- a/ports/atmel-samd/tick.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "tick.h" - -#include "peripheral_clk_config.h" - -#include "supervisor/shared/tick.h" -#include "shared-bindings/microcontroller/__init__.h" -#include "shared-bindings/microcontroller/Processor.h" - -void SysTick_Handler(void) { - // SysTick interrupt handler called when the SysTick timer reaches zero - // (every millisecond). - common_hal_mcu_disable_interrupts(); - - // Read the control register to reset the COUNTFLAG. - (void) SysTick->CTRL; - common_hal_mcu_enable_interrupts(); - - // Do things common to all ports when the tick occurs - supervisor_tick(); -} - -void tick_init() { - uint32_t ticks_per_ms = common_hal_mcu_processor_get_frequency() / 1000; - SysTick_Config(ticks_per_ms-1); - NVIC_EnableIRQ(SysTick_IRQn); - // Set all peripheral interrupt priorities to the lowest priority by default. - for (uint16_t i = 0; i < PERIPH_COUNT_IRQn; i++) { - NVIC_SetPriority(i, (1UL << __NVIC_PRIO_BITS) - 1UL); - } - // Bump up the systick interrupt so nothing else interferes with timekeeping. - NVIC_SetPriority(SysTick_IRQn, 0); - #ifdef SAMD21 - NVIC_SetPriority(USB_IRQn, 1); - #endif - - #ifdef SAMD51 - NVIC_SetPriority(USB_0_IRQn, 1); - NVIC_SetPriority(USB_1_IRQn, 1); - NVIC_SetPriority(USB_2_IRQn, 1); - NVIC_SetPriority(USB_3_IRQn, 1); - #endif -} - -void tick_delay(uint32_t us) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - uint32_t us_until_next_tick = SysTick->VAL / ticks_per_us; - uint32_t start_tick; - while (us >= us_until_next_tick) { - start_tick = SysTick->VAL; // wait for SysTick->VAL to RESET - while (SysTick->VAL < start_tick) {} - us -= us_until_next_tick; - us_until_next_tick = 1000; - } - while (SysTick->VAL > ((us_until_next_tick - us) * ticks_per_us)) {} -} - -// us counts down! -void current_tick(uint64_t* ms, uint32_t* us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - - // We disable interrupts to prevent ticks_ms from changing while we grab it. - common_hal_mcu_disable_interrupts(); - uint32_t tick_status = SysTick->CTRL; - uint32_t current_us = SysTick->VAL; - uint32_t tick_status2 = SysTick->CTRL; - uint64_t current_ms = supervisor_ticks_ms64(); - // The second clause ensures our value actually rolled over. Its possible it hit zero between - // the VAL read and CTRL read. - if ((tick_status & SysTick_CTRL_COUNTFLAG_Msk) != 0 || - ((tick_status2 & SysTick_CTRL_COUNTFLAG_Msk) != 0 && current_us > ticks_per_us)) { - current_ms++; - } - common_hal_mcu_enable_interrupts(); - *ms = current_ms; - *us_until_ms = current_us / ticks_per_us; -} - -void wait_until(uint64_t ms, uint32_t us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - while (supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} -} diff --git a/ports/atmel-samd/timer_handler.c b/ports/atmel-samd/timer_handler.c index 51c6f0a39f..34d819e162 100644 --- a/ports/atmel-samd/timer_handler.c +++ b/ports/atmel-samd/timer_handler.c @@ -29,6 +29,7 @@ #include "timer_handler.h" +#include "common-hal/pulseio/PulseIn.h" #include "common-hal/pulseio/PulseOut.h" #include "shared-module/_pew/PewPew.h" #include "common-hal/frequencyio/FrequencyIn.h" @@ -49,6 +50,11 @@ void shared_timer_handler(bool is_tc, uint8_t index) { if (is_tc) { uint8_t handler = tc_handler[index]; switch(handler) { + case TC_HANDLER_PULSEIN: + #if CIRCUITPY_PULSEIO + pulsein_timer_interrupt_handler(index); + #endif + break; case TC_HANDLER_PULSEOUT: #if CIRCUITPY_PULSEIO pulseout_interrupt_handler(index); diff --git a/ports/atmel-samd/timer_handler.h b/ports/atmel-samd/timer_handler.h index 8115cd73be..34efda4d9e 100644 --- a/ports/atmel-samd/timer_handler.h +++ b/ports/atmel-samd/timer_handler.h @@ -31,6 +31,7 @@ #define TC_HANDLER_PEW 0x2 #define TC_HANDLER_FREQUENCYIN 0x3 #define TC_HANDLER_RGBMATRIX 0x4 +#define TC_HANDLER_PULSEIN 0x5 void set_timer_handler(bool is_tc, uint8_t index, uint8_t timer_handler); void shared_timer_handler(bool is_tc, uint8_t index); diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index e2fce976d7..507d763312 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -152,7 +152,6 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) SRC_S = supervisor/cpu.s SRC_C = \ - tick.c \ background.c \ fatfs_port.c \ mphalport.c \ @@ -184,7 +183,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) # List of sources for qstr extraction SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) # Sources that only hold QSTRs after pre-processing. -SRC_QSTR_PREPROCESSOR += +SRC_QSTR_PREPROCESSOR += all: $(BUILD)/firmware.spk @@ -197,7 +196,7 @@ $(FIRMWARE): $(ECHO) "run make flash-bootloader again to flash bootloader." exit 1 -$(BUILD)/libmpy.a: $(SPRESENSE_SDK) $(OBJ) +$(BUILD)/libmpy.a: $(SPRESENSE_SDK) $(OBJ) $(ECHO) "AR $@" $(Q)$(AR) rcs $(BUILD)/libmpy.a $(OBJ) diff --git a/ports/cxd56/common-hal/microcontroller/Processor.c b/ports/cxd56/common-hal/microcontroller/Processor.c index 3e6fc3b8aa..1eddbb01de 100644 --- a/ports/cxd56/common-hal/microcontroller/Processor.c +++ b/ports/cxd56/common-hal/microcontroller/Processor.c @@ -24,6 +24,8 @@ * THE SOFTWARE. */ +#include // for cxd56_clock.h +#include #include // For NAN: remove when not needed. @@ -31,7 +33,7 @@ #include "py/mphal.h" uint32_t common_hal_mcu_processor_get_frequency(void) { - return mp_hal_ticks_cpu(); + return cxd56_get_cpu_baseclk(); } float common_hal_mcu_processor_get_temperature(void) { diff --git a/ports/cxd56/common-hal/microcontroller/__init__.c b/ports/cxd56/common-hal/microcontroller/__init__.c index 2be74b0069..7aa3b839d7 100644 --- a/ports/cxd56/common-hal/microcontroller/__init__.c +++ b/ports/cxd56/common-hal/microcontroller/__init__.c @@ -24,6 +24,8 @@ * THE SOFTWARE. */ +#include // for cxd56_clock.h +#include #include #include "py/mphal.h" @@ -42,8 +44,20 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }, }; +#define DELAY_CORRECTION (700) + void common_hal_mcu_delay_us(uint32_t delay) { - mp_hal_delay_us(delay); + if (delay) { + unsigned long long ticks = cxd56_get_cpu_baseclk() / 1000000L * delay; + if (ticks < DELAY_CORRECTION) return; // delay time already used in calculation + + ticks -= DELAY_CORRECTION; + ticks /= 6; + // following loop takes 6 cycles + do { + __asm__ __volatile__("nop"); + } while(--ticks); + } } void common_hal_mcu_disable_interrupts(void) { diff --git a/ports/cxd56/common-hal/pulseio/PulseIn.c b/ports/cxd56/common-hal/pulseio/PulseIn.c index 65ca1d97eb..221fa5b6eb 100644 --- a/ports/cxd56/common-hal/pulseio/PulseIn.c +++ b/ports/cxd56/common-hal/pulseio/PulseIn.c @@ -25,6 +25,7 @@ */ #include +#include #include "py/runtime.h" #include "py/mphal.h" @@ -51,7 +52,9 @@ static int pulsein_set_config(pulseio_pulsein_obj_t *self, bool first_edge) { static int pulsein_interrupt_handler(int irq, FAR void *context, FAR void *arg) { // Grab the current time first. - uint32_t current_us = mp_hal_ticks_us(); + struct timeval tv; + gettimeofday(&tv, NULL); + uint64_t current_us = ((uint64_t) tv.tv_sec) * 1000000 + tv.tv_usec; pulseio_pulsein_obj_t *self = pulsein_objects[irq - CXD56_IRQ_EXDEVICE_0]; diff --git a/ports/cxd56/common-hal/pulseio/PulseIn.h b/ports/cxd56/common-hal/pulseio/PulseIn.h index ff31712abc..70d1413b63 100644 --- a/ports/cxd56/common-hal/pulseio/PulseIn.h +++ b/ports/cxd56/common-hal/pulseio/PulseIn.h @@ -38,7 +38,7 @@ typedef struct { uint16_t maxlen; uint16_t start; uint16_t len; - uint32_t last_us; + uint64_t last_us; bool idle_state; bool first_edge; bool paused; diff --git a/ports/cxd56/mphalport.c b/ports/cxd56/mphalport.c index 1305706caa..5a76b83bdf 100644 --- a/ports/cxd56/mphalport.c +++ b/ports/cxd56/mphalport.c @@ -23,66 +23,3 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#include -#include -#include -#include - -#include "py/mpstate.h" - -#include "supervisor/shared/tick.h" - -#define DELAY_CORRECTION (700) -#define DELAY_INTERVAL (50) - -void mp_hal_init(void) { - boardctl(BOARDIOC_INIT, 0); -} - -mp_uint_t mp_hal_ticks_ms(void) { - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec * 1000 + tv.tv_usec / 1000; -} - -mp_uint_t mp_hal_ticks_us(void) { - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec * 1000000 + tv.tv_usec; -} - -mp_uint_t mp_hal_ticks_cpu(void) { - return cxd56_get_cpu_baseclk(); -} - -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - #ifdef MICROPY_VM_HOOK_LOOP - MICROPY_VM_HOOK_LOOP - #endif - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} - -void mp_hal_delay_us(uint32_t us) { - if (us) { - unsigned long long ticks = mp_hal_ticks_cpu() / 1000000L * us; - if (ticks < DELAY_CORRECTION) return; // delay time already used in calculation - - ticks -= DELAY_CORRECTION; - ticks /= 6; - // following loop takes 6 cycles - do { - __asm__ __volatile__("nop"); - } while(--ticks); - } -} diff --git a/ports/cxd56/mphalport.h b/ports/cxd56/mphalport.h index a2be10b8d0..50e805cf50 100644 --- a/ports/cxd56/mphalport.h +++ b/ports/cxd56/mphalport.h @@ -30,5 +30,8 @@ #include #include "lib/utils/interrupt_char.h" +#include "supervisor/shared/tick.h" + +#define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32()) #endif // MICROPY_INCLUDED_CXD56_MPHALPORT_H diff --git a/ports/cxd56/supervisor/internal_flash.c b/ports/cxd56/supervisor/internal_flash.c index 0c9a61e063..2726fa4a23 100644 --- a/ports/cxd56/supervisor/internal_flash.c +++ b/ports/cxd56/supervisor/internal_flash.c @@ -59,7 +59,7 @@ uint32_t supervisor_flash_get_block_count(void) { return CXD56_SPIFLASHSIZE >> PAGE_SHIFT; } -void supervisor_flash_flush(void) { +void port_internal_flash_flush(void) { if (flash_sector == NO_SECTOR) { return; } diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index 5d2957f350..73d6fb9309 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -25,13 +25,16 @@ */ #include + #include +#include #include "sched/sched.h" #include "boards/board.h" #include "supervisor/port.h" +#include "supervisor/shared/tick.h" #include "common-hal/microcontroller/Pin.h" #include "common-hal/analogio/AnalogIn.h" @@ -103,3 +106,41 @@ void port_set_saved_word(uint32_t value) { uint32_t port_get_saved_word(void) { return _ebss; } + +volatile bool _tick_enabled; +void board_timerhook(void) +{ + // Do things common to all ports when the tick occurs + if (_tick_enabled) { + supervisor_tick(); + } +} + +uint64_t port_get_raw_ticks(uint8_t* subticks) { + struct timeval tv; + gettimeofday(&tv, NULL); + long computed_subticks = tv.tv_usec * 1024 * 32 / 1000000; + if (subticks != NULL) { + *subticks = computed_subticks % 32; + } + + return tv.tv_sec * 1024 + computed_subticks / 32; +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { + _tick_enabled = true; +} + +// Disable 1/1024 second tick. +void port_disable_tick(void) { + _tick_enabled = false; +} + +void port_interrupt_after_ticks(uint32_t ticks) { +} + +void port_sleep_until_interrupt(void) { + // TODO: Implement sleep. +} + diff --git a/ports/litex/.gitignore b/ports/litex/.gitignore new file mode 100644 index 0000000000..414487d53e --- /dev/null +++ b/ports/litex/.gitignore @@ -0,0 +1 @@ +build-*/ diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 51cb186356..596eaf2bb3 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -116,7 +116,6 @@ SRC_C += \ background.c \ fatfs_port.c \ mphalport.c \ - tick.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ lib/libc/string0.c \ diff --git a/ports/litex/README.rst b/ports/litex/README.rst new file mode 100644 index 0000000000..bc1d20e617 --- /dev/null +++ b/ports/litex/README.rst @@ -0,0 +1,25 @@ +LiteX (FPGA) +============ + +`LiteX `_ is a Python-based System on a Chip (SoC) designer +for open source supported Field Programmable Gate Array (FPGA) chips. This means that the CPU +core(s) and peripherals are not defined by the physical chip. Instead, they are loaded as separate +"gateware". Once this gateware is loaded, CircuitPython can be loaded on top of it to work as +expected. + +Installation +------------- + +You'll need ``dfu-util`` to install CircuitPython on the Fomu. + +Make sure the foboot bootloader is updated. Instructions are here: https://github.com/im-tomu/fomu-workshop/blob/master/docs/bootloader.rst + +Once you've updated the bootloader, you should know how to use ``dfu-util``. It's pretty easy! + +To install CircuitPython do: + +.. code-block:: shell + + dfu-util -D adafruit-circuitpython-fomu-en_US-.dfu + +It will install and then restart. CIRCUITPY should appear as it usually does and work the same. diff --git a/ports/litex/boards/fomu/fomu-spi.ld b/ports/litex/boards/fomu/fomu-spi.ld index 486c3cad11..9b6443c673 100644 --- a/ports/litex/boards/fomu/fomu-spi.ld +++ b/ports/litex/boards/fomu/fomu-spi.ld @@ -7,8 +7,9 @@ ENTRY(_start) /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */ - RAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0x00020000 /* 128 KiB */ + FLASH (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */ + RAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0x00020000 /* 128 KiB */ } /* top end of the stack */ @@ -19,7 +20,7 @@ SECTIONS { /* This is the initialized data section The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). + but the loader puts the initial values in the FLASH_FIRMWARE (inidata). It is one task of the startup to copy the initial values from FLASH to RAM. */ .data : AT ( _sidata ) { @@ -73,7 +74,7 @@ SECTIONS _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ } >RAM - /* The program code and other data goes into FLASH */ + /* The program code and other data goes into FLASH_FIRMWARE */ .text : { . = ALIGN(4); @@ -88,7 +89,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ _sidata = _etext; /* This is used by the startup in order to initialize the .data secion */ - } >FLASH + } >FLASH_FIRMWARE /* Uninitialized data section */ .bss : diff --git a/ports/litex/mphalport.c b/ports/litex/mphalport.c index 0b8f012985..84a5467951 100644 --- a/ports/litex/mphalport.c +++ b/ports/litex/mphalport.c @@ -27,6 +27,7 @@ #include +#include "lib/tinyusb/src/device/usbd.h" #include "py/mphal.h" #include "py/mpstate.h" #include "py/gc.h" @@ -36,30 +37,6 @@ #include "irq.h" -#ifdef CFG_TUSB_MCU - void hal_dcd_isr(uint8_t rhport); -#endif - -/*------------------------------------------------------------------*/ -/* delay - *------------------------------------------------------------------*/ -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - #ifdef MICROPY_VM_HOOK_LOOP - MICROPY_VM_HOOK_LOOP - #endif - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} - void mp_hal_delay_us(mp_uint_t delay) { mp_hal_delay_ms(delay / 1000); } @@ -72,7 +49,7 @@ void isr(void) { #ifdef CFG_TUSB_MCU if (irqs & (1 << USB_INTERRUPT)) - hal_dcd_isr(0); + tud_int_handler(0); #endif if (irqs & (1 << TIMER0_INTERRUPT)) SysTick_Handler(); diff --git a/ports/litex/supervisor/internal_flash.c b/ports/litex/supervisor/internal_flash.c index 93aeda8cbd..2dbf46b3a6 100644 --- a/ports/litex/supervisor/internal_flash.c +++ b/ports/litex/supervisor/internal_flash.c @@ -37,6 +37,7 @@ #include "py/runtime.h" #include "lib/oofatfs/ff.h" +#include "supervisor/flash.h" #include "supervisor/usb.h" #include "csr.h" @@ -270,7 +271,7 @@ uint32_t supervisor_flash_get_block_count(void) { } __attribute__((section(".ramtext"))) -void supervisor_flash_flush(void) { +void port_internal_flash_flush(void) { // Skip if data is the same, or if there is no data in the cache if (_flash_page_addr == NO_CACHE) return; diff --git a/ports/litex/supervisor/port.c b/ports/litex/supervisor/port.c index 9688c7baef..2297b15b17 100644 --- a/ports/litex/supervisor/port.c +++ b/ports/litex/supervisor/port.c @@ -27,11 +27,43 @@ #include #include "supervisor/port.h" +#include "supervisor/shared/tick.h" #include "boards/board.h" -#include "tick.h" #include "irq.h" #include "csr.h" +// Global millisecond tick count. 1024 per second because most RTCs are clocked with 32.768khz +// crystals. +volatile uint64_t raw_ticks = 0; +volatile int subsecond = 0; +__attribute__((section(".ramtext"))) +void SysTick_Handler(void) { + timer0_ev_pending_write(1); + raw_ticks += 1; + subsecond += 1; + // We track subsecond ticks so that we can increment raw_ticks one extra every 40 ms. We do this + // every 40 except 0 to make it 24 increments and not 25. + if (subsecond == 1000) { + subsecond = 0; + } else if (subsecond % 40 == 0) { + raw_ticks += 1; + } + supervisor_tick(); +} + +static void tick_init(void) { + int t; + + timer0_en_write(0); + t = CONFIG_CLOCK_FREQUENCY / 1000; // 1000 kHz tick + timer0_reload_write(t); + timer0_load_write(t); + timer0_en_write(1); + timer0_ev_enable_write(1); + timer0_ev_pending_write(1); + irq_setmask(irq_getmask() | (1 << TIMER0_INTERRUPT)); +} + safe_mode_t port_init(void) { irq_setmask(0); irq_setie(1); @@ -83,3 +115,22 @@ void port_set_saved_word(uint32_t value) { uint32_t port_get_saved_word(void) { return _ebss; } + +uint64_t port_get_raw_ticks(uint8_t* subticks) { + return raw_ticks; +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { +} + +// Disable 1/1024 second tick. +void port_disable_tick(void) { +} + +void port_interrupt_after_ticks(uint32_t ticks) { +} + +// TODO: Add sleep support if the SoC supports sleep. +void port_sleep_until_interrupt(void) { +} diff --git a/ports/litex/supervisor/usb.c b/ports/litex/supervisor/usb.c index 182360b713..b626aaf496 100644 --- a/ports/litex/supervisor/usb.c +++ b/ports/litex/supervisor/usb.c @@ -25,8 +25,6 @@ * THE SOFTWARE. */ - -#include "tick.h" #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" diff --git a/ports/litex/tick.c b/ports/litex/tick.c deleted file mode 100644 index 8ba06044ac..0000000000 --- a/ports/litex/tick.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "csr.h" -#include "tick.h" -#include "irq.h" - -#include "supervisor/shared/autoreload.h" -#include "supervisor/filesystem.h" -#include "supervisor/shared/tick.h" -#include "shared-module/gamepad/__init__.h" -#include "shared-bindings/microcontroller/Processor.h" - -// Global millisecond tick count -// volatile uint64_t ticks_ms = 0; - -__attribute__((section(".ramtext"))) -void SysTick_Handler(void) { - timer0_ev_pending_write(1); - supervisor_tick(); -} - -void tick_init() { - int t; - - timer0_en_write(0); - t = CONFIG_CLOCK_FREQUENCY / 1000; // 1000 kHz tick - timer0_reload_write(t); - timer0_load_write(t); - timer0_en_write(1); - timer0_ev_enable_write(1); - timer0_ev_pending_write(1); - irq_setmask(irq_getmask() | (1 << TIMER0_INTERRUPT)); -} - -void tick_delay(uint32_t us) { - // uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - // uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; - // uint64_t start_ms = ticks_ms; - // while (us > 1000) { - // while (ticks_ms == start_ms) {} - // us -= us_between_ticks; - // start_ms = ticks_ms; - // us_between_ticks = 1000; - // } - // while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} -} - -// us counts down! -void current_tick(uint64_t* ms, uint32_t* us_until_ms) { - // uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - // *ms = ticks_ms; - // *us_until_ms = SysTick->VAL / ticks_per_us; -} - -void wait_until(uint64_t ms, uint32_t us_until_ms) { - // uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - // while(ticks_ms <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} -} diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 80d1da1aac..59b833cc52 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -93,6 +93,10 @@ endif CFLAGS += $(INC) -Wall -Wno-cast-align -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +# TODO: add these when -Werror is applied +# Disable some warnings, as do most ports. NXP SDK causes undef, tinyusb causes cast-align +# CFLAGS += -Wno-undef -Wno-cast-align + CFLAGS += \ -mthumb \ -mapcs \ @@ -162,8 +166,8 @@ SRC_C = \ peripherals/mimxrt10xx/$(CHIP_FAMILY)/pins.c \ reset.c \ supervisor/flexspi_nor_flash_ops.c \ - supervisor/shared/memory.c \ - tick.c + supervisor/shared/memory.c + ifeq ($(CIRCUITPY_NETWORK),1) CFLAGS += -DMICROPY_PY_NETWORK=1 diff --git a/ports/mimxrt10xx/background.c b/ports/mimxrt10xx/background.c index 71dd795216..ff53ea44f4 100644 --- a/ports/mimxrt10xx/background.c +++ b/ports/mimxrt10xx/background.c @@ -27,7 +27,6 @@ #include "background.h" //#include "audio_dma.h" -#include "tick.h" #include "supervisor/filesystem.h" #include "supervisor/shared/tick.h" #include "supervisor/usb.h" diff --git a/ports/cxd56/tick.c b/ports/mimxrt10xx/boards/teensy41/board.c similarity index 81% rename from ports/cxd56/tick.c rename to ports/mimxrt10xx/boards/teensy41/board.c index 671b82b744..52dd498b3f 100644 --- a/ports/cxd56/tick.c +++ b/ports/mimxrt10xx/boards/teensy41/board.c @@ -3,7 +3,8 @@ * * The MIT License (MIT) * - * Copyright 2019 Sony Semiconductor Solutions Corporation + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,13 +25,15 @@ * THE SOFTWARE. */ -#include "tick.h" +#include "boards/board.h" +#include "mpconfigboard.h" -#include "supervisor/shared/autoreload.h" -#include "supervisor/shared/tick.h" - -void board_timerhook(void) -{ - // Do things common to all ports when the tick occurs - supervisor_tick(); +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { } diff --git a/ports/mimxrt10xx/boards/teensy41/board.ld b/ports/mimxrt10xx/boards/teensy41/board.ld new file mode 100644 index 0000000000..8f19810a35 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensy41/board.ld @@ -0,0 +1 @@ +_ld_reserved_flash_size = 4K; diff --git a/ports/mimxrt10xx/boards/teensy41/flash_config.c b/ports/mimxrt10xx/boards/teensy41/flash_config.c new file mode 100644 index 0000000000..426deb884d --- /dev/null +++ b/ports/mimxrt10xx/boards/teensy41/flash_config.c @@ -0,0 +1,126 @@ +/* + * Copyright 2017 NXP + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "fsl_flexspi_nor_boot.h" +#include "fsl_flexspi_nor_config.h" + +/* Component ID definition, used by tools. */ +#ifndef FSL_COMPONENT_ID +#define FSL_COMPONENT_ID "platform.drivers.xip_device" +#endif + +__attribute__((section(".boot_hdr.ivt"))) +/************************************* + * IVT Data + *************************************/ +const ivt image_vector_table = { + IVT_HEADER, /* IVT Header */ + IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ + IVT_RSVD, /* Reserved = 0 */ + (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ + (uint32_t)BOOT_DATA_ADDRESS, /* Address where BOOT Data Structure is stored */ + (uint32_t)&image_vector_table, /* Pointer to IVT Self (absolute address */ + (uint32_t)CSF_ADDRESS, /* Address where CSF file is stored */ + IVT_RSVD /* Reserved = 0 */ +}; + +__attribute__((section(".boot_hdr.boot_data"))) +/************************************* + * Boot Data + *************************************/ +const BOOT_DATA_T boot_data = { + FLASH_BASE, /* boot start location */ + FLASH_SIZE, /* size */ + PLUGIN_FLAG, /* Plugin flag*/ + 0xFFFFFFFF /* empty - extra data word */ +}; + +__attribute__((section(".boot_hdr.conf"))) +// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 +const flexspi_nor_config_t qspiflash_config = { + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 1u, + .csSetupTime = 2u, + // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | + // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) + // Read LUTs + FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), + 0, + 0, + + 0x24040405, + 0, + 0, + 0, + + 0, + 0, + 0, + 0, + + 0x00000406, + 0, + 0, + 0, + + 0, + 0, + 0, + 0, + + 0x08180420, + 0, + 0, + 0, + + 0, + 0, + 0, + 0, + + 0, + 0, + 0, + 0, + + 0x081804D8, + 0, + 0, + 0, + + 0x08180402, + 0x00002004, + 0, + 0, + + 0, + 0, + 0, + 0, + + 0x00000460, + }, + }, + .pageSize = 256u, + .sectorSize = 4u * 1024u, + .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, + .blockSize = 0x00010000, + .isUniformBlockSize = false, +}; diff --git a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h new file mode 100644 index 0000000000..15b8c0f34a --- /dev/null +++ b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h @@ -0,0 +1,18 @@ +#define MICROPY_HW_BOARD_NAME "Teensy 4.1" +#define MICROPY_HW_MCU_NAME "IMXRT1062DVJ6A" + +// If you change this, then make sure to update the linker scripts as well to +// make sure you don't overwrite code +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 + +#define BOARD_FLASH_SIZE (8 * 1024 * 1024) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO_AD_B1_00) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO_AD_B1_01) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO_B0_03) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO_B0_02) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO_B0_01) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B0_03) +#define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B0_02) diff --git a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk new file mode 100644 index 0000000000..201e0e660f --- /dev/null +++ b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x239A +USB_PID = 0x80AE +USB_PRODUCT = "Teensy 4.1" +USB_MANUFACTURER = "PJRC" + +CHIP_VARIANT = MIMXRT1062DVJ6A +CHIP_FAMILY = MIMXRT1062 +FLASH = W25Q64JV diff --git a/ports/mimxrt10xx/boards/teensy41/pins.c b/ports/mimxrt10xx/boards/teensy41/pins.c new file mode 100644 index 0000000000..5eb5ab0f55 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensy41/pins.c @@ -0,0 +1,116 @@ +#include "shared-bindings/board/__init__.h" + +#include "boards/board.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + // With USB on left. Bottom edge. + { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01) }, + + // Bottom Edge extended for 4.1 + { MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12) }, + + // Top edge + { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, + + // Top edge extended for Teensy 4.1 + { MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_B1_13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_B1_12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_B1_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_B1_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_AD_B1_12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_AD_B1_13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO_AD_B1_04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO_AD_B1_05) }, + + // SD Card slot + { MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO_SD_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO_SD_B0_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO_SD_B0_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D46), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D47), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, + + // Flash expansion spot and PSRAM expansion spot on a shared QSPI BUS + { MP_OBJ_NEW_QSTR(MP_QSTR_D48), MP_ROM_PTR(&pin_GPIO_EMC_24) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PSRAM_CS), MP_ROM_PTR(&pin_GPIO_EMC_24) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D49), MP_ROM_PTR(&pin_GPIO_EMC_27) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO1), MP_ROM_PTR(&pin_GPIO_EMC_27) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D50), MP_ROM_PTR(&pin_GPIO_EMC_28) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO2), MP_ROM_PTR(&pin_GPIO_EMC_28) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D51), MP_ROM_PTR(&pin_GPIO_EMC_22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_FLASH_CS), MP_ROM_PTR(&pin_GPIO_EMC_22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D52), MP_ROM_PTR(&pin_GPIO_EMC_26) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO0), MP_ROM_PTR(&pin_GPIO_EMC_26) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D53), MP_ROM_PTR(&pin_GPIO_EMC_25) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_CLK), MP_ROM_PTR(&pin_GPIO_EMC_25) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D54), MP_ROM_PTR(&pin_GPIO_EMC_29) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO3), MP_ROM_PTR(&pin_GPIO_EMC_29) }, + + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index 24a6dbff6d..cc19ba354c 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -25,7 +25,6 @@ * THE SOFTWARE. */ -//TODO #include "shared-bindings/busio/SPI.h" #include "py/mperrno.h" #include "py/runtime.h" @@ -35,48 +34,12 @@ #include -//bool never_reset_sercoms[SERCOM_INST_NUM]; -// -//void never_reset_sercom(Sercom* sercom) { -// // Reset all SERCOMs except the ones being used by on-board devices. -// Sercom *sercom_instances[SERCOM_INST_NUM] = SERCOM_INSTS; -// for (int i = 0; i < SERCOM_INST_NUM; i++) { -// if (sercom_instances[i] == sercom) { -// never_reset_sercoms[i] = true; -// break; -// } -// } -//} -// -//void allow_reset_sercom(Sercom* sercom) { -// // Reset all SERCOMs except the ones being used by on-board devices. -// Sercom *sercom_instances[SERCOM_INST_NUM] = SERCOM_INSTS; -// for (int i = 0; i < SERCOM_INST_NUM; i++) { -// if (sercom_instances[i] == sercom) { -// never_reset_sercoms[i] = false; -// break; -// } -// } -//} -// -//void reset_sercoms(void) { -// // Reset all SERCOMs except the ones being used by on-board devices. -// Sercom *sercom_instances[SERCOM_INST_NUM] = SERCOM_INSTS; -// for (int i = 0; i < SERCOM_INST_NUM; i++) { -// if (never_reset_sercoms[i]) { -// continue; -// } -// #ifdef MICROPY_HW_APA102_SERCOM -// if (sercom_instances[i] == MICROPY_HW_APA102_SERCOM) { -// continue; -// } -// #endif -// // SWRST is same for all modes of SERCOMs. -// sercom_instances[i]->SPI.CTRLA.bit.SWRST = 1; -// } -//} +//arrays use 0 based numbering: SPI1 is stored at index 0 +#define MAX_SPI 4 +STATIC bool reserved_spi[MAX_SPI]; +STATIC bool never_reset_spi[MAX_SPI]; -static void config_periph_pin(const mcu_periph_obj_t *periph) { +STATIC void config_periph_pin(const mcu_periph_obj_t *periph) { IOMUXC_SetPinMux( periph->pin->mux_reg, periph->mux_mode, periph->input_reg, periph->input_idx, @@ -97,52 +60,117 @@ static void config_periph_pin(const mcu_periph_obj_t *periph) { #define LPSPI_MASTER_CLK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllPfd0Clk) / (CLOCK_GetDiv(kCLOCK_LpspiDiv))) +void spi_reset(void) { + for (int i = 0; i < MAX_SPI; i++) { + reserved_spi[i] = false; + } +} + void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *clock, const mcu_pin_obj_t *mosi, const mcu_pin_obj_t *miso) { - // TODO: Allow none mosi or miso + const uint32_t sck_count = MP_ARRAY_SIZE(mcu_spi_sck_list); + const uint32_t miso_count = MP_ARRAY_SIZE(mcu_spi_miso_list); + const uint32_t mosi_count = MP_ARRAY_SIZE(mcu_spi_mosi_list); + bool spi_taken = false; - const uint32_t sck_count = sizeof(mcu_spi_sck_list) / sizeof(mcu_periph_obj_t); - const uint32_t miso_count = sizeof(mcu_spi_miso_list) / sizeof(mcu_periph_obj_t); - const uint32_t mosi_count = sizeof(mcu_spi_mosi_list) / sizeof(mcu_periph_obj_t); - - for (uint32_t i = 0; i < sck_count; ++i) { - if (mcu_spi_sck_list[i].pin != clock) + for (uint i = 0; i < sck_count; i++) { + if (mcu_spi_sck_list[i].pin != clock) { continue; - - for (uint32_t j = 0; j < miso_count; ++j) { - if (mcu_spi_miso_list[j].pin != miso) - continue; - - if (mcu_spi_miso_list[j].bank_idx != mcu_spi_sck_list[i].bank_idx) - continue; - - for (uint32_t k = 0; k < mosi_count; ++k) { - if (mcu_spi_mosi_list[k].pin != mosi) + } + //if both MOSI and MISO exist, loop search normally + if ((mosi != NULL) && (miso != NULL)) { + for (uint j = 0; j < mosi_count; j++) { + if ((mcu_spi_mosi_list[i].pin != mosi) + || (mcu_spi_sck_list[i].bank_idx != mcu_spi_mosi_list[j].bank_idx)){ continue; - - if (mcu_spi_mosi_list[k].bank_idx != mcu_spi_miso_list[j].bank_idx) - continue; - - self->clock_pin = &mcu_spi_sck_list[i]; - self->miso_pin = &mcu_spi_miso_list[j]; - self->mosi_pin = &mcu_spi_mosi_list[k]; - + } + for (uint k = 0; k < miso_count; k++) { + if ((mcu_spi_miso_list[k].pin != miso) //everything needs the same index + || (mcu_spi_sck_list[i].bank_idx != mcu_spi_miso_list[k].bank_idx)) { + continue; + } + //keep looking if the SPI is taken, edge case + if (reserved_spi[mcu_spi_sck_list[i].bank_idx - 1]) { + spi_taken = true; + continue; + } + //store pins if not + self->clock = &mcu_spi_sck_list[i]; + self->mosi = &mcu_spi_mosi_list[j]; + self->miso = &mcu_spi_miso_list[k]; + break; + } + if (self->clock != NULL) { + break; // Multi-level break to pick lowest peripheral + } + } + if (self->clock != NULL) { break; } + // if just MISO, reduce search + } else if (miso != NULL) { + for (uint j = 0; j < miso_count; j++) { + if ((mcu_spi_miso_list[j].pin != miso) //only SCK and MISO need the same index + || (mcu_spi_sck_list[i].bank_idx != mcu_spi_miso_list[j].bank_idx)) { + continue; + } + if (reserved_spi[mcu_spi_sck_list[i].bank_idx - 1]) { + spi_taken = true; + continue; + } + self->clock = &mcu_spi_sck_list[i]; + self->mosi = NULL; + self->miso = &mcu_spi_miso_list[j]; + break; + } + if (self->clock != NULL) { + break; + } + // if just MOSI, reduce search + } else if (mosi != NULL) { + for (uint j = 0; j < mosi_count; j++) { + if ((mcu_spi_mosi_list[j].pin != mosi) //only SCK and MOSI need the same index + || (mcu_spi_sck_list[i].bank_idx != mcu_spi_mosi_list[j].bank_idx)) { + continue; + } + if (reserved_spi[mcu_spi_sck_list[i].bank_idx - 1]) { + spi_taken = true; + continue; + } + self->clock = &mcu_spi_sck_list[i]; + self->mosi = &mcu_spi_mosi_list[j]; + self->miso = NULL; + break; + } + if (self->clock != NULL) { + break; + } + } else { + //throw an error immediately + mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); } } - if(self->clock_pin == NULL || self->mosi_pin == NULL || self->miso_pin == NULL) { - mp_raise_RuntimeError(translate("Invalid SPI pin selection")); + if (self->clock != NULL && (self->mosi != NULL || self->miso != NULL)) { + self->spi = mcu_spi_banks[self->clock->bank_idx - 1]; } else { - self->spi = mcu_spi_banks[self->clock_pin->bank_idx - 1]; + if (spi_taken) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } else { + mp_raise_ValueError(translate("Invalid SPI pin selection")); + } } - config_periph_pin(self->mosi_pin); - config_periph_pin(self->miso_pin); - config_periph_pin(self->clock_pin); + config_periph_pin(self->clock); + if (self->mosi != NULL) { + config_periph_pin(self->mosi); + } + if (self->miso != NULL) { + config_periph_pin(self->miso); + } + reserved_spi[self->clock->bank_idx - 1] = true; lpspi_master_config_t config = { 0 }; LPSPI_MasterGetDefaultConfig(&config); @@ -150,47 +178,27 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // Always start at 250khz which is what SD cards need. They are sensitive to // SPI bus noise before they are put into SPI mode. config.baudRate = 250000; - LPSPI_MasterInit(self->spi, &config, LPSPI_MASTER_CLK_FREQ); - LPSPI_Enable(self->spi, false); uint32_t tcrPrescaleValue; self->baudrate = LPSPI_MasterSetBaudRate(self->spi, config.baudRate, LPSPI_MASTER_CLK_FREQ, &tcrPrescaleValue); LPSPI_Enable(self->spi, true); - claim_pin(self->clock_pin->pin); - -// if (mosi_none) { -// self->MOSI_pin = NO_PIN; -// } else { -// gpio_set_pin_direction(mosi->number, GPIO_DIRECTION_OUT); -// gpio_set_pin_pull_mode(mosi->number, GPIO_PULL_OFF); -// gpio_set_pin_function(mosi->number, mosi_pinmux); -// self->MOSI_pin = mosi->number; - claim_pin(self->mosi_pin->pin); -// } - -// if (miso_none) { -// self->MISO_pin = NO_PIN; -// } else { -// gpio_set_pin_direction(miso->number, GPIO_DIRECTION_IN); -// gpio_set_pin_pull_mode(miso->number, GPIO_PULL_OFF); -// gpio_set_pin_function(miso->number, miso_pinmux); -// self->MISO_pin = miso->number; - claim_pin(self->miso_pin->pin); -// } + claim_pin(self->clock->pin); + if (self->mosi != NULL) { + claim_pin(self->mosi->pin); + } + if (self->miso != NULL) { + claim_pin(self->miso->pin); + } } void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { -// never_reset_sercom(self->spi_desc.dev.prvt); - -// never_reset_pin_number(self->clock_pin); -// never_reset_pin_number(self->MOSI_pin); -// never_reset_pin_number(self->MISO_pin); + // TODO } bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { - return self->clock_pin == NULL; + return self->clock == NULL; } void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { @@ -198,14 +206,7 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { return; } -// allow_reset_sercom(self->spi_desc.dev.prvt); - -// spi_m_sync_disable(&self->spi_desc); -// spi_m_sync_deinit(&self->spi_desc); -// reset_pin_number(self->clock_pin); -// reset_pin_number(self->MOSI_pin); -// reset_pin_number(self->MISO_pin); - self->clock_pin = NULL; + self->clock = NULL; } bool common_hal_busio_spi_configure(busio_spi_obj_t *self, @@ -260,6 +261,9 @@ bool common_hal_busio_spi_write(busio_spi_obj_t *self, if (len == 0) { return true; } + if (self->mosi == NULL) { + mp_raise_ValueError(translate("No MOSI Pin")); + } lpspi_transfer_t xfer = { 0 }; xfer.txData = (uint8_t*)data; @@ -278,6 +282,9 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, if (len == 0) { return true; } + if (self->miso == NULL) { + mp_raise_ValueError(translate("No MISO Pin")); + } LPSPI_SetDummyData(self->spi, write_value); @@ -296,6 +303,9 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uin if (len == 0) { return true; } + if (self->miso == NULL || self->mosi == NULL) { + mp_raise_ValueError(translate("Missing MISO or MOSI Pin")); + } LPSPI_SetDummyData(self->spi, 0xFF); diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.h b/ports/mimxrt10xx/common-hal/busio/SPI.h index 0895e1ddbc..f699cd7adf 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.h +++ b/ports/mimxrt10xx/common-hal/busio/SPI.h @@ -38,9 +38,11 @@ typedef struct { LPSPI_Type *spi; bool has_lock; uint32_t baudrate; - const mcu_periph_obj_t *clock_pin; - const mcu_periph_obj_t *mosi_pin; - const mcu_periph_obj_t *miso_pin; + const mcu_periph_obj_t *clock; + const mcu_periph_obj_t *mosi; + const mcu_periph_obj_t *miso; } busio_spi_obj_t; +void spi_reset(void); + #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_BUSIO_SPI_H diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 4633507d8b..e3642daf59 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -198,15 +198,18 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, claim_pin(self->tx_pin->pin); if (self->rx_pin != NULL) { - ringbuf_alloc(&self->rbuf, receiver_buffer_size, true); + // The LPUART ring buffer wastes one byte to distinguish between full and empty. + self->ringbuf = gc_alloc(receiver_buffer_size + 1, false, true /*long-lived*/); - if (!self->rbuf.buf) { + if (!self->ringbuf) { LPUART_Deinit(self->uart); mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); } LPUART_TransferCreateHandle(self->uart, &self->handle, LPUART_UserCallback, self); - LPUART_TransferStartRingBuffer(self->uart, &self->handle, self->rbuf.buf, self->rbuf.size); + // Pass actual allocated size; the LPUART routines are cognizant that + // the capacity is one less than the size. + LPUART_TransferStartRingBuffer(self->uart, &self->handle, self->ringbuf, receiver_buffer_size + 1); claim_pin(self->rx_pin->pin); } @@ -223,9 +226,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { LPUART_Deinit(self->uart); - gc_free(self->rbuf.buf); - self->rbuf.size = 0; - self->rbuf.iput = self->rbuf.iget = 0; + gc_free(self->ringbuf); // reset_pin_number(self->rx_pin); // reset_pin_number(self->tx_pin); diff --git a/ports/mimxrt10xx/common-hal/busio/UART.h b/ports/mimxrt10xx/common-hal/busio/UART.h index 9e768db3c0..3a326eb3a4 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.h +++ b/ports/mimxrt10xx/common-hal/busio/UART.h @@ -40,7 +40,7 @@ typedef struct { mp_obj_base_t base; LPUART_Type *uart; lpuart_handle_t handle; - ringbuf_t rbuf; + uint8_t* ringbuf; bool rx_ongoing; uint32_t baudrate; uint8_t character_bits; diff --git a/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c b/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c index 87fc511af1..87a72d0f33 100644 --- a/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +++ b/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c @@ -33,8 +33,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/__init__.h" -#include "tick.h" - void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { diff --git a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c index 3e1d343ec8..b86077015c 100644 --- a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c +++ b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c @@ -25,16 +25,13 @@ * THE SOFTWARE. */ -#include "py/mphal.h" #include "shared-bindings/neopixel_write/__init__.h" -#include "tick.h" -#include "py/mperrno.h" -#include "py/runtime.h" #include "common-hal/microcontroller/Pin.h" +#include "supervisor/linker.h" +#include "supervisor/port.h" -uint64_t next_start_tick_ms = 0; -uint32_t next_start_tick_us = 1000; +uint64_t next_start_raw_ticks = 0; //sysclock divisors #define MAGIC_800_INT 900000 // ~1.11 us -> 1.2 field @@ -58,9 +55,9 @@ void PLACE_IN_ITCM(common_hal_neopixel_write)(const digitalio_digitalinout_obj_t const uint32_t t0 = (sys_freq / MAGIC_800_T0H); const uint32_t t1 = (sys_freq / MAGIC_800_T1H); - // This must be called while interrupts are on in case we're waiting for a - // future ms tick. - wait_until(next_start_tick_ms, next_start_tick_us); + // Wait to make sure we don't append onto the last transmission. This should only be a tick or + // two. + while (port_get_raw_ticks(NULL) < next_start_raw_ticks) {} GPIO_Type *gpio = digitalinout->pin->gpio; const uint32_t pin = digitalinout->pin->number; @@ -85,17 +82,11 @@ void PLACE_IN_ITCM(common_hal_neopixel_write)(const digitalio_digitalinout_obj_t } } + // Update the next start. + next_start_raw_ticks = port_get_raw_ticks(NULL) + 4; + // Enable interrupts again __enable_irq(); - - // Update the next start. - current_tick(&next_start_tick_ms, &next_start_tick_us); - if (next_start_tick_us < 100) { - next_start_tick_ms += 1; - next_start_tick_us = 100 - next_start_tick_us; - } else { - next_start_tick_us -= 100; - } } #pragma GCC pop_options diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c index 24e9ad85de..d8bf2017ea 100644 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c +++ b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c @@ -38,8 +38,6 @@ #include "shared-bindings/pulseio/PulseIn.h" #include "supervisor/shared/translate.h" -#include "tick.h" - // TODO //static void pulsein_set_config(pulseio_pulsein_obj_t* self, bool first_edge) { // uint32_t sense_setting; diff --git a/ports/mimxrt10xx/common-hal/rtc/RTC.c b/ports/mimxrt10xx/common-hal/rtc/RTC.c index 5d6cae5201..6940a1817d 100644 --- a/ports/mimxrt10xx/common-hal/rtc/RTC.c +++ b/ports/mimxrt10xx/common-hal/rtc/RTC.c @@ -72,5 +72,6 @@ int common_hal_rtc_get_calibration(void) { } void common_hal_rtc_set_calibration(int calibration) { + // SNVS has HPCALB_VAL bits for calibration. mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); } diff --git a/ports/mimxrt10xx/linking/common.ld b/ports/mimxrt10xx/linking/common.ld index 10568bfb86..90fc780933 100644 --- a/ports/mimxrt10xx/linking/common.ld +++ b/ports/mimxrt10xx/linking/common.ld @@ -21,7 +21,7 @@ MEMORY /* This can't move because the bootrom looks at this address. */ FLASH_IVT (rx) : ORIGIN = 0x60001000, LENGTH = 4K /* Place the ISRs 48k in to leave room for the bootloader when it is available. */ - FLASH_TEXT (rx) : ORIGIN = 0x6000C000, LENGTH = code_size - 48K + FLASH_FIRMWARE (rx) : ORIGIN = 0x6000C000, LENGTH = code_size - 48K FLASH_FATFS (r) : ORIGIN = 0x60100000, LENGTH = _ld_flash_size - code_size - _ld_reserved_flash_size /* Teensy uses the last bit of flash for recovery. */ RESERVED_FLASH : ORIGIN = 0x60100000 + _ld_flash_size - _ld_reserved_flash_size, LENGTH = _ld_reserved_flash_size @@ -67,7 +67,7 @@ SECTIONS ) .text*) /* .text* sections (code) */ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ . = ALIGN(4); - } > FLASH_TEXT + } > FLASH_FIRMWARE .ARM.exidx : { @@ -75,7 +75,7 @@ SECTIONS *(.gnu.linkonce.armexidx.*) _etext = .; /* define a global symbol at end of code */ __etext = .; /* define a global symbol at end of code */ - } > FLASH_TEXT + } > FLASH_FIRMWARE _ld_filesystem_start = ORIGIN(FLASH_FATFS); _ld_filesystem_end = _ld_filesystem_start + LENGTH(FLASH_FATFS); @@ -87,7 +87,7 @@ SECTIONS *flexspi_nor_flash_ops.o(.text*) *fsl_flexspi.o(.text*) . = ALIGN(4); - } > OCRAM AT> FLASH_TEXT + } > OCRAM AT> FLASH_FIRMWARE _ld_ocram_data_destination = ADDR(.data); _ld_ocram_data_flash_copy = LOADADDR(.data); _ld_ocram_data_size = SIZEOF(.data); @@ -114,7 +114,7 @@ SECTIONS *(.itcm.*) . = ALIGN(4); - } > ITCM AT> FLASH_TEXT + } > ITCM AT> FLASH_FIRMWARE _ld_itcm_destination = ADDR(.itcm); _ld_itcm_flash_copy = LOADADDR(.itcm); _ld_itcm_size = SIZEOF(.itcm); @@ -126,7 +126,7 @@ SECTIONS *(.dtcm_data.*) . = ALIGN(4); - } > DTCM AT> FLASH_TEXT + } > DTCM AT> FLASH_FIRMWARE _ld_dtcm_data_destination = ADDR(.dtcm_data); _ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data); _ld_dtcm_data_size = SIZEOF(.dtcm_data); diff --git a/ports/mimxrt10xx/mphalport.c b/ports/mimxrt10xx/mphalport.c index 06275cd83c..111e97011e 100644 --- a/ports/mimxrt10xx/mphalport.c +++ b/ports/mimxrt10xx/mphalport.c @@ -33,21 +33,6 @@ #include "fsl_common.h" -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - RUN_BACKGROUND_TASKS; - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} - void mp_hal_delay_us(mp_uint_t delay) { #if defined(MIMXRT1011_SERIES) || defined(MIMXRT1021_SERIES) SDK_DelayAtLeastUs(delay, SystemCoreClock); diff --git a/ports/mimxrt10xx/sdk b/ports/mimxrt10xx/sdk index 4e7438e654..8363ff7bed 160000 --- a/ports/mimxrt10xx/sdk +++ b/ports/mimxrt10xx/sdk @@ -1 +1 @@ -Subproject commit 4e7438e654f4a6b4f386b4bb9e817d74a0fbffc7 +Subproject commit 8363ff7bed7533b9e7e6a6239aace3d6da14f349 diff --git a/ports/mimxrt10xx/supervisor/internal_flash.c b/ports/mimxrt10xx/supervisor/internal_flash.c index 7e9d8fa377..4f52748ed5 100644 --- a/ports/mimxrt10xx/supervisor/internal_flash.c +++ b/ports/mimxrt10xx/supervisor/internal_flash.c @@ -183,7 +183,7 @@ uint32_t supervisor_flash_get_block_count(void) { return CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE; } -void supervisor_flash_flush(void) { +void port_internal_flash_flush(void) { if (_flash_page_addr == NO_CACHE) return; status_t status; diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 7ba7a77011..18cb408cb0 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -41,9 +41,9 @@ #include "common-hal/pulseio/PulseOut.h" #include "common-hal/pulseio/PWMOut.h" #include "common-hal/rtc/RTC.h" +#include "common-hal/busio/SPI.h" #include "reset.h" -#include "tick.h" #include "tusb.h" @@ -54,6 +54,7 @@ #include "shared-module/gamepadshift/__init__.h" #endif #include "shared-module/_pew/PewPew.h" +#include "supervisor/shared/tick.h" #include "clocks.h" @@ -244,15 +245,18 @@ __attribute__((used, naked)) void Reset_Handler(void) { } safe_mode_t port_init(void) { - clocks_init(); + CLOCK_SetMode(kCLOCK_ModeRun); - // Configure millisecond timer initialization. - tick_init(); + clocks_init(); #if CIRCUITPY_RTC rtc_init(); #endif + // Always enable the SNVS interrupt. The GPC won't wake us up unless at least one interrupt is + // enabled. It won't occur very often so it'll be low overhead. + NVIC_EnableIRQ(SNVS_HP_WRAPPER_IRQn); + // Reset everything into a known state before board_init. reset_port(); @@ -264,7 +268,7 @@ safe_mode_t port_init(void) { } void reset_port(void) { - //reset_sercoms(); + spi_reset(); #if CIRCUITPY_AUDIOIO audio_dma_reset(); @@ -332,7 +336,7 @@ uint32_t *port_heap_get_top(void) { return &_ld_heap_end; } -// Place the word to save just after our BSS section that gets blanked. +// Place the word into the low power section of the SNVS. void port_set_saved_word(uint32_t value) { SNVS->LPGPR[1] = value; } @@ -341,6 +345,67 @@ uint32_t port_get_saved_word(void) { return SNVS->LPGPR[1]; } +uint64_t port_get_raw_ticks(uint8_t* subticks) { + uint64_t ticks = 0; + uint64_t next_ticks = 1; + while (ticks != next_ticks) { + ticks = next_ticks; + next_ticks = ((uint64_t) SNVS->HPRTCMR) << 32 | SNVS->HPRTCLR; + } + if (subticks != NULL) { + *subticks = ticks % 32; + } + return ticks / 32; +} + +void SNVS_HP_WRAPPER_IRQHandler(void) { + if ((SNVS->HPSR & SNVS_HPSR_PI_MASK) != 0) { + supervisor_tick(); + SNVS->HPSR = SNVS_HPSR_PI_MASK; + } + if ((SNVS->HPSR & SNVS_HPSR_HPTA_MASK) != 0) { + SNVS->HPSR = SNVS_HPSR_HPTA_MASK; + } +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { + uint32_t hpcr = SNVS->HPCR; + hpcr &= ~SNVS_HPCR_PI_FREQ_MASK; + SNVS->HPCR = hpcr | SNVS_HPCR_PI_FREQ(5) | SNVS_HPCR_PI_EN_MASK; +} + +// Disable 1/1024 second tick. +void port_disable_tick(void) { + SNVS->HPCR &= ~SNVS_HPCR_PI_EN_MASK; +} + +void port_interrupt_after_ticks(uint32_t ticks) { + uint8_t subticks; + uint64_t current_ticks = port_get_raw_ticks(&subticks); + current_ticks += ticks; + SNVS->HPCR &= ~SNVS_HPCR_HPTA_EN_MASK; + // Wait for the alarm to be disabled. + while ((SNVS->HPCR & SNVS_HPCR_HPTA_EN_MASK) != 0) {} + SNVS->HPTAMR = current_ticks >> (32 - 5); + SNVS->HPTALR = current_ticks << 5 | subticks; + SNVS->HPCR |= SNVS_HPCR_HPTA_EN_MASK; +} + +void port_sleep_until_interrupt(void) { + // App note here: https://www.nxp.com/docs/en/application-note/AN12085.pdf + + // Clear the FPU interrupt because it can prevent us from sleeping. + if (__get_FPSCR() & ~(0x9f)) { + __set_FPSCR(__get_FPSCR() & ~(0x9f)); + (void) __get_FPSCR(); + } + NVIC_ClearPendingIRQ(SNVS_HP_WRAPPER_IRQn); + CLOCK_SetMode(kCLOCK_ModeWait); + __WFI(); + CLOCK_SetMode(kCLOCK_ModeRun); +} + /** * \brief Default interrupt handler for unused IRQs. */ @@ -384,4 +449,3 @@ __attribute__((used)) void HardFault_Handler(void) asm("nop;"); } } - diff --git a/ports/mimxrt10xx/supervisor/usb.c b/ports/mimxrt10xx/supervisor/usb.c index 051fcca9de..1bc7ea9b56 100644 --- a/ports/mimxrt10xx/supervisor/usb.c +++ b/ports/mimxrt10xx/supervisor/usb.c @@ -56,5 +56,5 @@ void init_usb_hardware(void) { } void USB_OTG1_IRQHandler(void) { - tud_isr(0); + tud_int_handler(0); } diff --git a/ports/mimxrt10xx/tick.c b/ports/mimxrt10xx/tick.c deleted file mode 100644 index c19ce796ed..0000000000 --- a/ports/mimxrt10xx/tick.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2019 Artur Pacholec - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "tick.h" - -#include "fsl_common.h" - -#include "supervisor/shared/tick.h" -#include "shared-bindings/microcontroller/__init__.h" -#include "shared-bindings/microcontroller/Processor.h" - -void SysTick_Handler(void) { - // SysTick interrupt handler called when the SysTick timer reaches zero - // (every millisecond). - common_hal_mcu_disable_interrupts(); - - // Read the control register to reset the COUNTFLAG. - (void) SysTick->CTRL; - - common_hal_mcu_enable_interrupts(); - - // Do things common to all ports when the tick occurs - supervisor_tick(); -} - -void tick_init() { - uint32_t ticks_per_ms = common_hal_mcu_processor_get_frequency() / 1000; - SysTick_Config(ticks_per_ms-1); -} - -void tick_delay(uint32_t us) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - uint32_t us_until_next_tick = SysTick->VAL / ticks_per_us; - uint32_t start_tick; - while (us >= us_until_next_tick) { - start_tick = SysTick->VAL; // wait for SysTick->VAL to RESET - while (SysTick->VAL < start_tick) {} - us -= us_until_next_tick; - us_until_next_tick = 1000; - } - while (SysTick->VAL > ((us_until_next_tick - us) * ticks_per_us)) {} -} - -// us counts down! -void current_tick(uint64_t* ms, uint32_t* us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - - // We disable interrupts to prevent ticks_ms from changing while we grab it. - common_hal_mcu_disable_interrupts(); - uint32_t tick_status = SysTick->CTRL; - uint32_t current_us = SysTick->VAL; - uint32_t tick_status2 = SysTick->CTRL; - uint64_t current_ms = supervisor_ticks_ms64(); - // The second clause ensures our value actually rolled over. Its possible it hit zero between - // the VAL read and CTRL read. - if ((tick_status & SysTick_CTRL_COUNTFLAG_Msk) != 0 || - ((tick_status2 & SysTick_CTRL_COUNTFLAG_Msk) != 0 && current_us > ticks_per_us)) { - current_ms++; - } - common_hal_mcu_enable_interrupts(); - *ms = current_ms; - *us_until_ms = current_us / ticks_per_us; -} - -void wait_until(uint64_t ms, uint32_t us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - while (supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} -} diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 876628342d..8a7b1104b9 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -88,7 +88,7 @@ INC += -I../../supervisor/shared/usb ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 -Og else - CFLAGS += -Os -DNDEBUG + CFLAGS += -Os -DNDEBUG -ggdb3 CFLAGS += -flto -flto-partition=none endif @@ -148,8 +148,6 @@ endif SRC_C += \ background.c \ fatfs_port.c \ - mphalport.c \ - tick.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ device/$(MCU_VARIANT)/startup_$(MCU_SUB_VARIANT).c \ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/doc/ble_api.dox b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/doc/ble_api.dox new file mode 100644 index 0000000000..6cdfc88709 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/doc/ble_api.dox @@ -0,0 +1,3930 @@ +/** + * @addtogroup BLE_COMMON + * @{ + * @defgroup BLE_COMMON_MSC Message Sequence Charts + * @{ + * + * @defgroup BLE_COMMON_ENABLE BLE Stack Enable + * @{ + * @msc + * hscale = "1.5"; + * APP,SD; + * |||; + * APP=>SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; + * APP<SD [label = "sd_ble_cfg_set(cfg_id, cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_cfg_set(cfg_id, cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; + * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; + * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; + * APP<SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; + * APP<SD [label = "sd_ble_cfg_set(cfg_id, cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_cfg_set(cfg_id, cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; + * APP<SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; + * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GAP, cfg = {conn_cfg_tag = 1, gap_conn_cfg.conn_count = 1, app_ram_base);"]; + * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATT, cfg = {conn_cfg_tag = 1, gatt_conn_cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATTC, cfg = {conn_cfg_tag = 1, gattc_conn_cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATTS, cfg = {conn_cfg_tag = 1, gatts_conn_cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; + * APP<SD [label = "sd_ble_gap_connect(params, conn_cfg_tag = BLE_CONN_CFG_TAG_DEFAULT);"]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params)"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle, conn_cfg_tag = 1);"]; + * APP<SD [label = "sd_ble_gap_connect(params, conn_cfg_tag = 1);"]; + * APP<SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; + * APP<SD [label = "sd_nvic_EnableIRQ(SD_EVT_IRQn)"]; + * APP<APP [label = "SD_EVT_IRQHandler()"]; + * APP=>SD [label = "sd_ble_evt_get(buffer);"]; + * APP<SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; + * APP<SD [label = "sd_app_evt_wait(void);"]; + * APP rbox APP [label="App Thread Mode blocked, CPU in low power mode"]; + * |||; + * ...; + * |||; + * SD rbox SD [label="Event Available for the App"]; + * APP<SD [label = "sd_ble_evt_get(buffer);"]; + * APP<SD [label = "sd_app_evt_wait(void);"]; + * APP rbox APP [label="App Thread Mode blocked, CPU in low power mode"]; + * |||; + * ...; + * |||; + * SD rbox SD [label="Event Available for the App"]; + * APP<SD [label = "sd_ble_evt_get(buffer);"]; + * APP<SD [label = "sd_app_evt_wait(void);"]; + * APP rbox APP [label="App Thread Mode blocked, CPU in low power mode"]; + * |||; + * ...; + * |||; + * @endmsc + * + * @} + * @} + */ + +/** + * @addtogroup BLE_GAP + * @{ + * @defgroup BLE_GAP_MSC Message Sequence Charts + * @{ + * @defgroup BLE_GAP_ADV_MSC Advertising + * @{ + * @defgroup BLE_GAP_ADV_MSC_LEGACY Advertising using legacy advertising PDUs + * @msc + * hscale = "1.5"; + * APP,SD,SCANNERS; + * |||; + * APP=>SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params)"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle, conn_cfg_tag = BLE_CONN_CFG_TAG_DEFAULT)"]; + * APP<SCANNERS [label = "Advertisement (ADV_IND/ADV_DIRECT_IND/ADV_NONCONN_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_IND/ADV_DIRECT_IND/ADV_NONCONN_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_IND/ADV_DIRECT_IND/ADV_NONCONN_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; + * ...; + * SD->SCANNERS [label = "Advertisement (ADV_IND/ADV_DIRECT_IND/ADV_NONCONN_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #1 App Stops Advertisement "]; + * APP=>SD [label = "sd_ble_gap_adv_stop(adv_handle)"]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params : properties : type = BLE_GAP_ADV_TYPE_EXTENDED_*)"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle, conn_cfg_tag = BLE_CONN_CFG_TAG_DEFAULT)"]; + * APP<SCANNERS [label = "Advertisement (ADV_EXT_IND) on 1MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (AUX_*_IND) on 1MBPS/2MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_EXT_IND) on 1MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (AUX_*_IND) on 1MBPS/2MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; + * ...; + * SD->SCANNERS [label = "Advertisement (ADV_EXT_IND) on 1MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (AUX_*_IND) on 1MBPS/2MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #1 App Stops Advertisement "]; + * APP=>SD [label = "sd_ble_gap_adv_stop(adv_handle)"]; + * APP<CENTRAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED"]; + * |||; + * --- [label = " Variant #1 Local Disconnection "]; + * APP=>SD [label = "sd_ble_gap_disconnect(reason)"]; + * APP<CENTRAL [label = "Connection Termination", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {reason}"]; + * |||; + * --- [label = " Variant #2 Remote Disconnection "]; + * SD<:CENTRAL [label = "Connection Termination", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {reason}"]; + * @endmsc + * + * @defgroup BLE_GAP_CPU_MSC Peripheral Connection Parameter Update + * @msc + * hscale = "1.5"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established with conn. params. CP#1"]; + * |||; + * APP=>SD [label = "sd_ble_gap_conn_param_update(CP#2)"]; + * APP<CENTRAL [label = "L2CAP Connection Parameter Update Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #1 Central Accepts "]; + * |||; + * SD<:CENTRAL [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; + * SD<:CENTRAL [label = "LL Connection Update (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#2}"]; + * |||; + * --- [label = " Variant #2 Central Rejects "]; + * |||; + * SD<:CENTRAL [label = "L2CAP Connection Parameter Update Response: Rejected", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#1}"]; + * --- [label = " Variant #3 Central Ignores "]; + * |||; + * ...; + * |||; + * SD box SD [label="Timeout"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#1}"]; + * @endmsc + * + * @defgroup BLE_GAP_RSSI_FILT_MSC RSSI for connections with event filter + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * --- [label = " Variant #1: Trigger event when a new RSSI is available"]; + * |||; + * APP=>SD [label = "sd_ble_gap_rssi_start(conn_handle, 0, 0)"]; + * APP<SD [label = "sd_ble_gap_rssi_stop()"]; + * APP<SD [label = "sd_ble_gap_rssi_start(conn_handle, 0x05, 0x00)"]; + * APP<SD [label = "sd_ble_gap_rssi_stop()"]; + * APP<SD [label = "sd_ble_gap_rssi_start(conn_handle, 0x05, 0x03)"]; + * APP<SD [label = "sd_ble_gap_rssi_stop()"]; + * APP<SD [label = "sd_ble_gap_rssi_get(conn_handle, p_rssi, p_ch_index)"]; + * APP<SD [label = "sd_ble_gap_rssi_start(conn_handle, BLE_GAP_RSSI_THRESHOLD_INVALID, 0x00)"]; + * APP<SD [label = "sd_ble_gap_rssi_get(conn_handle, p_rssi, p_ch_index)"]; + * APP<SD [label = "sd_ble_gap_rssi_get(conn_handle, p_rssi, p_ch_index)"]; + * APP<SD [label = "sd_ble_gap_rssi_stop()"]; + * APP<SD [label = "sd_ble_gap_authenticate(params)"]; + * APP<CENTRAL [label = "SMP Security Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #1 Central initiates Security Establishment "]; + * |||; + * APP rbox CENTRAL [label="Encryption or Pairing/Bonding initiated by Central"]; + * |||; + * --- [label = " Variant #2 Central ignores "]; + * |||; + * ...; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Timeout, error_src: local}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_LEGACY_MSC Peripheral Legacy Pairing + * @{ + * + * @defgroup BLE_GAP_PERIPH_PAIRING_JW_MSC Pairing: Just Works + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: no_bond, no_mitm, no_io_caps}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: no_bond, no_mitm, no_io_caps, p_keyset: NULL)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD abox CENTRAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_BONDING_JW_MSC Bonding: Just Works + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, no_mitm, no_io_caps}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: bond, no_mitm, no_io_caps, p_keyset)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD abox CENTRAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_BONDING_PK_PERIPH_MSC Bonding: Passkey Entry, Peripheral displays + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, keyboard}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: bond, mitm, display, p_keyset)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"]; + * APP rbox APP [label="Passkey displayed to the user"]; + * |||; + * SD abox CENTRAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC Bonding: Passkey Entry, User Inputs on Peripheral or OOB + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, display}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: bond, mitm, keyboard, p_keyset)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_KEY_REQUEST {type}"]; + * APP rbox APP [label="User enters Passkey or data received Out Of Band"]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey or OOB)"]; + * APP<SD [label = "sd_ble_opt_set(opt_id = BLE_GAP_OPT_PASSKEY, p_opt->p_passkey=passkey)"]; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, keyboard}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: bond, mitm, display, p_keyset)"]; + * + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"]; + * APP rbox APP [label="Passkey displayed to the user"]; + * |||; + * SD abox CENTRAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_PAIRING_CONFIRM_FAIL_MSC Pairing failure: Confirm failed + * This occurs if the random value doesn't match, usually because the user entered a wrong pin + * or out of band data was missing. + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: mitm, display}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: mitm, keyboard, p_keyset: NULL)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * SD<:CENTRAL [label = "SMP Pairing Confirm", textcolor="#000080", linecolor="#000080"]; + * SD:>CENTRAL [label = "SMP Pairing Confirm", textcolor="#000080", linecolor="#000080"]; + * SD<:CENTRAL [label = "SMP Pairing Random", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Confirm value, error_src: local}"]; + * SD:>CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @} + * + * @defgroup BLE_GAP_PERIPH_LESC_MSC Peripheral LESC Pairing + * @{ + * + * @defgroup BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC Pairing: Just Works + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, no_bond, no_mitm, no_io_caps}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, no_bond, no_mitm, no_io_caps, p_pk_own)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * SD abox CENTRAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App completes DHKey calculation"]; + * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_LESC_BONDING_NC_MSC Bonding: Numeric Comparison + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, display(kbd/yesno)}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, mitm, display(kbd/yesno), keyset with p_pk_own)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * SD abox CENTRAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=1}"]; + * APP rbox APP [label="Passkey displayed to the user, user compares values"]; + * |||; + * --- [label = " Variant #1 User confirms on both sides "]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(BLE_GAP_AUTH_KEY_TYPE_PASSKEY, NULL)"]; + * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * --- [label = " Variant #2 User does not confirm locally "]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(BLE_GAP_AUTH_KEY_TYPE_NONE, NULL)"]; + * APP<CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #3 User does not confirm remotely "]; + * SD<:CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: num comp failure, error_src: remote}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC Bonding: Passkey Entry, Peripheral Displays + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, keyboard}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, mitm, display, keyset with p_pk_own)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"]; + * APP rbox APP [label="Passkey displayed to the user"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * --- [label = " Optional keypresses from peer "]; + * SD<:CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_KEY_PRESSED {type}"]; + * APP abox APP [label="App displays keypress"]; + * SD<:CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_KEY_PRESSED {type}"]; + * APP abox APP [label="App displays keypress"]; + * |||; + * --- [label = ""]; + * SD abox CENTRAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App completes DHKey calculation"]; + * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC Bonding: Passkey Entry, User Inputs on Peripheral + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, display}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, mitm, keyboard, keyset with p_pk_own)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_KEY_REQUEST {passkey}"]; + * APP rbox APP [label="User enters Passkey"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * --- [label = " Optional keypresses sent to peer "]; + * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"]; + * APP<CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"]; + * APP<CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = ""]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey)"]; + * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC Bonding: Out of Band + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP=>SD [label = "sd_ble_gap_addr_set(addr)"]; + * APP<SD [label = "sd_ble_gap_lesc_oob_data_get(p_pk_own, p_oobd_own)"]; + * APP<SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, oob, keyset with p_pk_own)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk, oobd_req=1}"]; + * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * APP=>SD [label = "sd_ble_gap_lesc_oob_data_set(p_oobd_own, p_oobd_peer)"]; + * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @} + * + * @defgroup BLE_GAP_PERIPH_PAIRING_KS_OUT_OF_RANGE_MSC Pairing failure: Keysize out of supported range + * This occurs if the min key size offered by the peer is above 16, or max key size below 7. + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Invalid params, error_src: local}"]; + * SD:>CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_PAIRING_KS_TOO_SMALL_MSC GAP Failed Pairing: Keysize too small + * This occurs if the max key size offered by the peer is below the min key size specified by + * the app. + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * SD<:CENTRAL [label = "SMP Pairing Confirm", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Enc key size, error_src: local}"]; + * SD:>CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_PAIRING_APP_ERROR_MSC Pairing failure: Pairing aborted by the application + * When the application detects that the pairing should not be performed, for example an + * insufficient IO combination, it can use sd_ble_gap_sec_params_reply() to send + * SMP Pairing failed to the peer. + * + * When the stack handles the response from the application it will also validate + * the passkey (SMP_STC_PASSKEY_ENTRY_FAILED). If any error is detected it will be + * reported when sd_ble_gap_sec_params_reply() is called. + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST"]; + * SD abox APP [label="Stack looks for errors", textbgcolor="#7f7fff"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply()"]; + * APP<CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: , error_src: local}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_PAIRING_REMOTE_PAIRING_FAIL_MSC Pairing failure: Pairing failed from central + * SMP Pairing Failed may be sent from the central at various times. The application should + * prepare for this and gracefully handle the event. + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * SD<:CENTRAL [label = "SMP Pairing Failed", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: , error_src: remote}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_PAIRING_TIMEOUT_MSC Pairing failure: Timeout + * This occurs if the central device doesn't continue the pairing sequence within 30 seconds. + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * --- [ label = "Wait 30 sec" ]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Timeout, error_src: local}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_ENC_MSC Peripheral Encryption Establishment using stored keys + * @msc + * hscale = "1.5"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "LL Encryption Request (LL_ENC_REQ)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_INFO_REQUEST {addr, ediv, rand}"]; + * |||; + * --- [label = " Variant #1 App Replies with Keys "]; + * |||; + * APP rbox APP [label = "Load Peripheral Keys"]; + * APP=>SD [label = "sd_ble_gap_sec_info_reply(ediv, rand, LTK)"]; + * APP<CENTRAL [label = "LL Encryption Response (LL_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP rbox CENTRAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE"]; + * |||; + * --- [label = " Variant #2 App Replies without Keys "]; + * |||; + * APP=>SD [label = "sd_ble_gap_sec_info_reply(NULL)"]; + * APP<CENTRAL [label = "LL Reject Ind (LL_REJECT_IND): Pin or Key Missing", textcolor="#000080", linecolor="#000080"]; + * APP rbox CENTRAL [label = "Link is NOT encrypted"]; + * |||; + * --- [label = " Variant #3 App Replies with Incorrect Keys "]; + * |||; + * APP rbox APP [label = "Load Incorrect Peripheral Keys"]; + * APP=>SD [label = "sd_ble_gap_sec_info_reply(ediv, rand, LTK)"]; + * APP<CENTRAL [label = "LL Encryption Response (LL_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP rbox CENTRAL [label = "Link Terminated due to authentication error"]; + * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {MIC Failure}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_INVALID_SMP_PDU_MSC Unexpected Security Packet Reception + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="No pairing in progress"]; + * |||; + * PEER rbox PEER [label="Peer misbehaving"]; + * |||; + * SD<:PEER [label = "SMP Pairing Failed (or other unexpected SMP PDU)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {PDU_INVALID}"]; + * |||; + * @endmsc + * @} + * + * + * @defgroup BLE_GAP_SCAN_MSC Scanning + * @{ + * @defgroup BLE_GAP_SCAN_MSC_LEGACY Scanning for advertisers performing legacy advertising + * @msc + * hscale = "1.5"; + * APP,SD,ADVERTISERS; + * |||; + * APP=>SD [label = "sd_ble_gap_scan_start(params : extended = 0, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params : {extended = 0, active = 1}, adv_report_buffer)"]; + * APP<ADVERTISERS [label = "Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; + * SD<-ADVERTISERS [label = "Scan Response (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {bdaddr, rssi, data}"]; + * ...; + * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_SCAN}"]; + * |||; + * @endmsc + * @defgroup BLE_GAP_SCAN_MSC_AE Scanning for advertisers performing legacy and extended advertising + * @msc + * hscale = "1.5"; + * APP,SD,ADVERTISERS; + * |||; + * APP=>SD [label = "sd_ble_gap_scan_start(params : {extended = 1, report_incomplete_evts = 0}, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params : {extended = 1, active = 1, report_incomplete_evts = 0}, adv_report_buffer)"]; + * APP<ADVERTISERS [label = "Scan Request (AUX_SCAN_REQ) on secondary_phy", textcolor="#000080", linecolor="#000080"]; + * SD<-ADVERTISERS [label = "Scan Response (AUX_SCAN_RSP) on secondary_phy", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 1, scannable = 1, scan_response = 1}, data}"]; + * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<ADVERTISERS [label = "Legacy Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 0, scannable = 1, scan_response = 0}, adv_data}"]; + * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params : {extended = 1, report_incomplete_evts = 1}, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_connect(scan_params : extended = 0, conn_params)"]; + * APP<PERIPHERAL [label = "LL Connect (CONNECT_IND)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED"]; + * |||; + * --- [label = " Variant #2 Connection Establishment Cancelled "]; + * APP=>SD [label = "sd_ble_gap_connect_cancel()"]; + * APP<SD [label = "sd_ble_gap_connect(scan_params={extended=1,scan_phys=PHY_A and PHY_B}, conn_params)"]; + * APP<PERIPHERAL [label = "LL Connect Request(AUX_CONNECT_REQ) on secondary_phy", textcolor="#000080", linecolor="#000080"]; + * SD<:PERIPHERAL [label = "LL Connect Response(AUX_CONNECT_RSP) on secondary_phy", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED"]; + * |||; + * --- [label = " Variant #2 Connection Establishment Cancelled "]; + * APP=>SD [label = "sd_ble_gap_connect_cancel()"]; + * APP<SD [label = "sd_ble_gap_connect(scan_params={extended=1,scan_phys=PHY_A}, conn_params)"]; + * APP<SD [label = "sd_ble_gap_conn_param_update(CP#2)"]; + * APP<PERIPHERAL [label = "LL Connection Update (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#2}"]; + * |||; + * --- [label = " Peripheral Solicited procedure"]; + * |||; + * SD<:PERIPHERAL [label = "L2CAP Connection Parameter Update Request {CP#3}", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST {CP#3}"]; + * |||; + * --- [label = " Variant #1 App Accepts "]; + * APP=>SD [label = "sd_ble_gap_conn_param_update(CP#3)"]; + * APP<PERIPHERAL [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; + * SD:>PERIPHERAL [label = "LL Connection Update (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#3}"]; + * |||; + * --- [label = " Variant #2 App Rejects "]; + * |||; + * APP=>SD [label = "sd_ble_gap_conn_param_update(NULL)"]; + * APP<PERIPHERAL [label = "L2CAP Connection Parameter Update Response: Rejected", textcolor="#000080", linecolor="#000080"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_SEC_MSC Central Security Procedures + * @{ + * + * @defgroup BLE_GAP_CENTRAL_SEC_REQ_MSC Security Request Reception + * @msc + * hscale = "1.5"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Security Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_REQUEST {bond, mitm}"]; + * |||; + * --- [label = " Variant #1 Central initiates Security Establishment "]; + * |||; + * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; + * APP<SD [label = "sd_ble_gap_authenticate(params)"]; + * APP<SD [label = "sd_ble_gap_authenticate(NULL)"]; + * APP<PERIPHERAL [label = "SMP Pairing Failed: Pairing Not Supported", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Pairing Not Supp, error_src: local}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_LEGACY_MSC Central Legacy Pairing + * @{ + * + * @defgroup BLE_GAP_CENTRAL_PAIRING_JW_MSC Pairing: Just Works + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(no_bond, no_mitm, no_io_caps)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: no_bond, no_mitm, no_io_caps}"]; + * |||; + * --- [label = " Variant #1 Central Accepts Peripheral parameters "]; + * |||; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_keyset: NULL)"]; + * |||; + * SD abox PERIPHERAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * |||; + * --- [label = " Variant #2 Central Rejects Peripheral parameters "]; + * |||; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(BLE_GAP_SEC_STATUS_INVALID_PARAMS, own_params: NULL, p_keyset: NULL)"]; + * |||; + * SD:>PERIPHERAL [label = "SMP Pairing Failed", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {FAILURE}"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_BONDING_JW_MSC Bonding: Just Works + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(bond, no_mitm, no_io_caps)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, no_mitm, no_io_caps}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_keyset)"]; + * |||; + * SD abox PERIPHERAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; + * |||; + * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_BONDING_PK_PERIPH_MSC Bonding: Passkey Entry, Central displays + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(bond, mitm, display)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, keyboard}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_keyset)"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"]; + * APP rbox APP [label="Passkey displayed to the user"]; + * |||; + * SD abox PERIPHERAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_MITM}"]; + * |||; + * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC Bonding: Passkey Entry, User Inputs on Central or OOB + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(bond, mitm, keyboard)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, display}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_keyset)"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_KEY_REQUEST {type}"]; + * APP rbox APP [label="User enters Passkey or data received Out Of Band"]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey or OOB)"]; + * APP<SD [label = "sd_ble_gap_authenticate(lesc, no_bond, no_mitm, no_io_caps)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, no_bond, no_mitm, no_io_caps}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_pk_own)"]; + * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * SD abox PERIPHERAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; + * |||; + * APP abox APP [label="App completes DHKey calculation"]; + * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC Bonding: Numeric Comparison + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(lesc, bond, mitm, display(kbd/yesno))"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, display(kbd/yesno)}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, keyset with p_pk_own)"]; + * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * SD abox PERIPHERAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=1}"]; + * APP rbox APP [label="Passkey displayed to the user, user compares values"]; + * |||; + * --- [label = " Variant #1 User confirms on both sides "]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(BLE_GAP_AUTH_KEY_TYPE_PASSKEY, NULL)"]; + * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * --- [label = " Variant #2 User does not confirm locally "]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(BLE_GAP_AUTH_KEY_TYPE_NONE, NULL)"]; + * APP<PERIPHERAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #3 User does not confirm remotely "]; + * SD<:PERIPHERAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: num comp failure, error_src: remote}"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC Bonding: Passkey Entry: Central Displays + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(lesc, bond, mitm, display)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, keyboard}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, keyset with p_pk_own)"]; + * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * --- [label = " Optional keypresses from peer "]; + * SD<:PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_KEY_PRESSED {type}"]; + * APP abox APP [label="App displays keypress"]; + * SD<:PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_KEY_PRESSED {type}"]; + * APP abox APP [label="App displays keypress"]; + * |||; + * --- [label = ""]; + * SD abox PERIPHERAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; + * |||; + * APP abox APP [label="App completes DHKey calculation"]; + * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC Bonding: Passkey Entry: User Inputs on Central + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(lesc, bond, mitm, keyboard)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, display}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, keyset with p_pk_own)"]; + * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * --- [label = " Optional keypresses sent to peer "]; + * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"]; + * APP<PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"]; + * APP<PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = ""]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey)"]; + * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC Bonding: Out of Band + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP=>SD [label = "sd_ble_gap_addr_set(addr)"]; + * APP<SD [label = "sd_ble_gap_lesc_oob_data_get(p_pk_own, p_oobd_own)"]; + * APP<SD [label = "sd_ble_gap_authenticate(lesc, bond, oob)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, oob}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, keyset with p_pk_own)"]; + * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk, oobd_req=1}"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * APP=>SD [label = "sd_ble_gap_lesc_oob_data_set(p_oobd_own, p_oobd_peer)"]; + * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * @} + * + * @defgroup BLE_GAP_CENTRAL_INVALID_SMP_PDU_MSC Unexpected Security Packet Reception + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="No pairing in progress"]; + * |||; + * PEER rbox PEER [label="Peer misbehaving"]; + * |||; + * SD<:PEER [label = "SMP Pairing Failed (or other unexpected SMP PDU)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {PDU_INVALID}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_ENC_MSC Encryption Establishment using stored keys + * @msc + * hscale = "1.5"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; + * APP<PERIPHERAL [label = "LL Encryption Request (LL_ENC_REQ)", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #1 Peripheral replies with keys "]; + * |||; + * PERIPHERAL rbox PERIPHERAL [label = "Peripheral Loads Keys"]; + * SD<:PERIPHERAL [label = "LL Encryption Response (LL_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE"]; + * |||; + * --- [label = " Variant #2 Peripheral keys missing "]; + * |||; + * PERIPHERAL rbox PERIPHERAL [label = "Peripheral Keys Missing"]; + * SD<:PERIPHERAL [label = "LL Reject Ind (LL_REJECT_IND): Pin or Key Missing", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE"]; + * APP rbox PERIPHERAL [label = "Link is NOT encrypted"]; + * |||; + * --- [label = " Variant #3 Incorrect peripheral keys "]; + * |||; + * PERIPHERAL rbox PERIPHERAL [label = "Peripheral Loads Incorrect Keys"]; + * SD<:PERIPHERAL [label = "LL Encryption Response (LL_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP rbox PERIPHERAL [label = "Link Terminated due to authentication error"]; + * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {MIC Failure}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC Central Encryption and Authentication mutual exclusion + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; + * APP<PEER [label = "Encryption Start (LL_START_ENC_REQ)", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP note SD [label = " Encryption in progress, authentication disallowed"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate()"]; + * APP<SD [label = "sd_ble_gap_conn_param_update()"]; + * APP<PEER [label = "Connection Update Start (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; + * APP<SD [label = "sd_ble_gap_authenticate()"]; + * APP<PEER [label = "Encryption Start (LL_START_ENC_REQ)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "Encryption Complete (LL_START_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE "]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate()"]; + * APP<SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; + * APP<SD [label = "sd_ble_gap_conn_param_update(conn_handle_3, CP#3)"]; + * APP<PERIPHERALS [label = "Connection Update Start on link #3 (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_1, CP#1)"]; + * APP<SD [label = "sd_ble_gap_conn_param_update(conn_handle_2, CP#2)"]; + * APP<PERIPHERALS [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP note PERIPHERALS [label = " Additional procedure on link #2 fails, since another one is pending"]; + * |||; + * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_2, CP#5)"]; + * APP<PERIPHERALS [label = "Connection Update Start on link #1 (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * SD<:PERIPHERALS [label = "Connection Update Complete on link #1", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_1, CP#1}"]; + * |||; + * SD:>PERIPHERALS [label = "Connection Update Start on link #2 (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP note PERIPHERALS [label = " Peripheral solicited procedure on link #4"]; + * |||; + * SD<:PERIPHERALS [label = "L2CAP Connection Parameter Update Request {CP#4}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST {conn_handle_4, CP#4}"]; + * |||; + * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_4, CP#4)"]; + * APP<PERIPHERALS [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERALS [label = "Connection Update Complete on link #2", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_2, CP#2}"]; + * |||; + * SD:>PERIPHERALS [label = "Connection Update Start on link #4 (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * SD<:PERIPHERALS [label = "Connection Update Complete on link #4", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_4, CP#4}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_MULTILINK_CTRL_PROC_MSC Central Control Procedure Serialization on multiple links + * @msc + * hscale = "1.5"; + * APP,SD,PERIPHERALS; + * |||; + * APP rbox PERIPHERALS [label="Connection Established with 4 peers, all with conn. params. CP#0"]; + * |||; + * APP note PERIPHERALS [label = " Peripheral solicited procedure on link #2"]; + * |||; + * SD<:PERIPHERALS [label = "L2CAP Connection Parameter Update Request {CP#2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST {conn_handle_2, CP#3}"]; + * |||; + * APP note PERIPHERALS [label = " Encryption procedure on link #3"]; + * |||; + * APP=>SD [label = "sd_ble_gap_encrypt(conn_handle_3, LTK#3)"]; + * APP<PERIPHERALS [label = "Encryption Start (LL_START_ENC_REQ) on link #3", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP note PERIPHERALS [label = " Connection Update procedure on link #1"]; + * |||; + * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_1, CP#1)"]; + * APP<SD [label = "sd_ble_gap_conn_param_update(conn_handle_2, CP#2)"]; + * APP<PERIPHERALS [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP note PERIPHERALS [label = " Encryption procedure on link #4"]; + * |||; + * APP=>SD [label = "sd_ble_gap_encrypt(conn_handle_4, LTK#4)"]; + * APP<PERIPHERALS [label = "Encryption Start (LL_START_ENC_REQ) on link #4", textcolor="#000080", linecolor="#000080"]; + * SD<:PERIPHERALS [label = "Encryption Complete (LL_START_ENC_RSP) on link #4", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {conn_handle_4}"]; + * |||; + * SD:>PERIPHERALS [label = "Connection Update Start (LL_CONNECTION_UPDATE_IND) on link #1", textcolor="#000080", linecolor="#000080"]; + * SD<:PERIPHERALS [label = "Connection Update Complete on link #1", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_1, CP#1}"]; + * |||; + * SD:>PERIPHERALS [label = "Connection Update Start (LL_CONNECTION_UPDATE_IND on link #2", textcolor="#000080", linecolor="#000080"]; + * SD<:PERIPHERALS [label = "Connection Update Complete on link #2", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_2, CP#2}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_WL_SHARE_MSC Whitelist Sharing + * @msc + * hscale = "1.5"; + * APP,SD; + * |||; + * APP=>SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: { fp = CONNREQ })"]; + * APP<SD [label = "sd_ble_gap_whitelist_set(WL#1)"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<SD [label = "sd_ble_gap_whitelist_set(WL#2)"]; + * APP<SD [label = "sd_ble_gap_scan_start(use_whitelist = 1, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_adv_stop(adv_handle)"]; + * APP<SD [label = "sd_ble_gap_scan_stop()"]; + * APP<SD [label = "sd_ble_gap_whitelist_set(WL#2)"]; + * APP<SD [label = "sd_ble_gap_scan_start(use_whitelist = 1, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_connect(use_whitelist = 1)"]; + * APP<SD [label = "sd_ble_gap_addr_set(addr)"]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = NULL})"]; + * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * ...; + * SD box SD [label="Private address timeout"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #2 Advertise with address resolvable by local IRK in device identity list "]; + * |||; + * APP=>SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: {local_irk1}) "]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1})"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * ...; + * SD box SD [label="Private address timeout"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #3 Advertise with non-resolvable address "]; + * |||; + * APP=>SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: NON_RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = NULL})"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Non-Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Non-Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Non-Resolvable1", textcolor="#000080", linecolor="#000080"]; + * ...; + * SD box SD [label="Private address timeout"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Non-Resolvable2", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GAP_PRIVACY_SCAN_MSC Private Scanning + * @msc + * hscale = "1.5"; + * APP,SD,ADVERTISERS; + * |||; + * APP=>SD [label = "sd_ble_gap_addr_set(addr)"]; + * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; + * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS->SD [label = "Scan Response packet (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #2 Active Scan with address resolvable by local IRKs "]; + * |||; + * APP=>SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, {peer_addr2, peer_irk2}, pp_local_irks: {local_irk1, local_irk2}) "]; + * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND), Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * SD box ADVERTISERS [label = "peer_addr1 is in the device identity list, respond with an address generated from local_irk1"]; + * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS->SD [label = "Scan Response packet (SCAN_RSP), Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * |||; + * ...; + * ADVERTISERS->SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND), Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; + * SD box ADVERTISERS [label = "Resolvable2 resolved to device identity peer_addr2 in the device identity list, respond with an address generated from local_irk2"]; + * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS->SD [label = "Scan Response packet (SCAN_RSP), Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * |||; + * ...; + * ADVERTISERS->SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND), Addr = peer_addr3", textcolor="#000080", linecolor="#000080"]; + * SD box ADVERTISERS [label = "peer_addr3 is not in the device identity list, respond with an address generated from device_irk"]; + * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS->SD [label = "Scan Response packet (SCAN_RSP), Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #3 Active Scan with non-resolvable address "]; + * |||; + * APP=>SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: NON_RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; + * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Non-Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS->SD [label = "Scan Response packet (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_PRIVACY_SCAN_PRIVATE_SCAN_MSC Scan Private Devices + * @msc + * hscale = "1.5"; + * APP,SD,ADVERTISERS; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; + * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD note ADVERTISERS [label="Resolvable1 resolved to device identity peer_addr1"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr1, rssi, data}"]; + * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Addr = peer_addr2", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr2, rssi, data}"]; + * |||; + * --- [label = " Variant #2 Scan and resolve private devices with whitelist "]; + * |||; + * APP=>SD [label = "sd_ble_gap_whitelist_set({peer_addr1, Resolvable2}) "]; + * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD note ADVERTISERS [label="Resolvable1 resolved to device identity peer_addr1 which is in the whitelist"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr1, rssi, data}"]; + * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; + * SD note ADVERTISERS [label="Resolvable2 did not resolve to a device identity but is in the whitelist"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {Resolvable2, rssi, data}"]; + * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Addr = Resolvable3", textcolor="#000080", linecolor="#000080"]; + * SD note ADVERTISERS [label="Resolvable3 is not in the whitelist, no report generated"]; + * |||; + * --- [label = " Variant #3 Scan directed advertisers and resolve initiator address using device IRK"]; + * |||; + * APP=>SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS box SD [label = "Advertiser Address resolved using peer_irk1, Initiator address resolved using device_irk"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr: peer_addr1"]; + * |||; + * --- [label = " Variant #4 Scan directed advertisers and resolve initiator address using local IRK in device identity list"]; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: local_irk1) "]; + * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS box SD [label = "Advertiser Address resolved using peer_irk1, Initiator address resolved using local_irk1"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr: peer_addr1"]; + * |||; + * --- [label = " Variant #5 Scan directed advertisers with unresolved direct address "]; + * |||; + * APP=>SD [label = "sd_ble_gap_scan_start(params: {adv_dir_report = 1}, adv_report)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Advertiser Addr = peer_addr2, Initiator Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS box SD [label = "Resolvable2 could not be resolved, report the unresolved direct address"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr: peer_addr2, direct_addr: Resolvable2}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC Directed Advertising + * @msc + * hscale = "1.5"; + * APP,SD,INITIATOR; + * |||; + * APP=>SD [label = "sd_ble_gap_addr_set(addr)"]; + * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1, properties.type = directed})"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<INITIATOR[label = "Advertisement (ADV_DIRECT_IND) , Advertiser Addr = addr, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = addr, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = addr, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #2 Private directed advertising to private peer using device IRK"]; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; + * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1, properties.type = directed})"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #3 Private directed advertising to private peer using local IRK in device identity list"]; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: {local_irk1}) "]; + * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1, properties.type = directed})"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #4 Private directed advertising to non-private peer using local IRK in device identity list"]; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk=0..0}, pp_local_irks: {local_irk1}) "]; + * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1, properties.type = directed})"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_CONN_PRIV_MSC Peripheral Connection Establishment with Private Peer + * @msc + * hscale = "1.5"; + * APP,SD,CENTRAL; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; + * APP<CENTRAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED, peer_addr = {peer_addr1, addr_id_peer = 1}"]; + * |||; + * --- [label = " Variant #2 Peer used identity address during connection setup "]; + * |||; + * APP rbox CENTRAL [label="Start Connectable Advertising"]; + * |||; + * SD<:>CENTRAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED, peer_addr = {peer_addr1, addr_id_peer = 0}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_CONN_PRIV_MSC Central Connection Establishment with Private Peer + * @msc + * hscale = "1.5"; + * APP,SD,PERIPHERAL; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; + * APP<SD [label = "sd_ble_gap_connect(peer_addr = {peer_addr1, addr_id_peer = 1})"]; + * APP<PERIPHERAL [label = "Scanning", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #1 Peer used resolvable addresses during connection setup "]; + * |||; + * SD<:>PERIPHERAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED, peer_addr = {peer_addr1, addr_id_peer = 1}"]; + * |||; + * --- [label = " Variant #2 Peer used identity address during connection setup "]; + * |||; + * SD<:>PERIPHERAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED, peer_addr = {peer_addr1, addr_id_peer = 0}"]; + * |||; + * @endmsc + * + * @} + * + * @defgroup BLE_GAP_EVT_PHY_MSC PHY Update Procedure + * @{ + * + * @defgroup BLE_GAP_CENTRAL_PHY_UPDATE Central PHY Update + * @msc + * hscale = "1.5"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established. Current TX PHY and RX PHY are both 1Mbit"]; + * |||; + * --- [label = " Variant #1 Initiated by Peripheral - no change in PHY "]; + * SD<=PERIPHERAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=2Mbit}}"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=1Mbit, rx_phys=1Mbit})"]; + * APP<PERIPHERAL [label = "PHY Update (LL_PHY_UPDATE_IND) - No change", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=1Mbit, rx_phy=1Mbit}}"]; + * |||; + * --- [label = " Variant #2 Initiated by Peripheral - change of PHY required"]; + * SD<=PERIPHERAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=2Mbit}}"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=2Mbit, rx_phys=2Mbit})"]; + * APP<PERIPHERAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=2Mbit, rx_phy=2Mbit}}"]; + * |||; + * --- [label = " Variant #3 Initiated by APP, not supported by peer"]; + * |||; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; + * APP<PERIPHERAL [label="PHY Request (LL_PHY_REQ)", textcolor="#000080", linecolor="#000080"]; + * SD<=PERIPHERAL [label="Unknown Response (LL_UNKNOWN_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {Status=Not Supported}"]; + * |||; + * --- [label = " Variant #4 Initiated by APP, change required"]; + * |||; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; + * APP<PERIPHERAL [label = "PHY Request (LL_PHY_REQ) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; + * SD<=PERIPHERAL [label = "PHY Response (LL_PHY_RSP) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; + * SD=>PERIPHERAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=2Mbit, rx_phy=2Mbit}}"]; + * |||; + * --- [label = " Variant #5 Initiated by Peripheral - APP has no preferences for TX direction"]; + * SD<=PERIPHERAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=1Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=1Mbit}}"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=BLE_GAP_PHY_AUTO, rx_phys=2Mbit})"]; + * APP<PERIPHERAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=1Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=1Mbit, rx_phy=2Mbit}}"]; + * |||; + * --- [label = " Variant #6 Initiated by APP, peer responding with invalid parameters"]; + * |||; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; + * APP<PERIPHERAL [label="PHY Request (LL_PHY_REQ) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; + * SD<=PERIPHERAL [label="PHY Response (LL_PHY_RSP) {tx_phys=0x00, rx_phys=0x00}", textcolor="#000080", linecolor="#000080"]; + * SD=>PERIPHERAL [label="Unknown Response (LL_UNKNOWN_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {Status=Invalid LMP Parameters}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_PERIPHERAL_PHY_UPDATE Peripheral PHY Update + * @msc + * hscale = "1.5"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established. Current TX PHY and RX PHY are both 1Mbit"]; + * |||; + * --- [label = " Variant #1 Initiated by Central - no change in PHY "]; + * SD<=CENTRAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=2Mbit}}"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=1Mbit, rx_phys=1Mbit})"]; + * APP<CENTRAL [label = "PHY Response (LL_PHY_RSP) {tx_phys=1Mbit, rx_phys=1Mbit}", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label = "PHY Update (LL_PHY_UPDATE_IND) - No change", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=1Mbit, rx_phy=1Mbit}}"]; + * |||; + * --- [label = " Variant #2 Initiated by Central - change of PHY required"]; + * SD<=CENTRAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=2Mbit}}"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=2Mbit, rx_phys=2Mbit})"]; + * APP<CENTRAL [label = "PHY Response (LL_PHY_RSP) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=2Mbit, rx_phy=2Mbit}}"]; + * |||; + * --- [label = " Variant #3 Initiated by APP, not supported by peer"]; + * |||; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; + * APP<CENTRAL [label="PHY Request (LL_PHY_REQ)", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label="Unknown Response (LL_UNKNOWN_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {Status=Not Supported}"]; + * |||; + * --- [label = " Variant #4 Initiated by APP, change required"]; + * |||; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; + * APP<CENTRAL [label="PHY Request (LL_PHY_REQ) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label="PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=2Mbit, rx_phy=2Mbit}}"]; + * |||; + * --- [label = " Variant #5 Initiated by Central - APP has no preferences for TX direction"]; + * SD<=CENTRAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=1Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=1Mbit}}"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=BLE_GAP_PHY_AUTO, rx_phys=2Mbit})"]; + * APP<CENTRAL [label = "PHY Response (LL_PHY_RSP) {tx_phys=ALL_PHY, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=1Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=1Mbit, rx_phy=2Mbit}}"]; + * |||; + * --- [label = " Variant #6 Collision between self-initiated PHY Update and peer initiated Channel Map Update procedures"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=2Mbit, rx_phys=2Mbit})"]; + * APP<CENTRAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label = "Reject Command (LL_REJECT_EXT_IND) {ErrorCode=Different Transaction Collision}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Different Transaction Collision, {tx_phy=1Mbit, rx_phy=1Mbit}}"]; + * |||; + * --- [label = " Variant #7 Initiated by APP, peer responding with invalid parameters"]; + * |||; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; + * APP<CENTRAL [label="PHY Request (LL_PHY_REQ) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label="PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=(1Mbit|2Mbit), S_TO_M_PHY=(1Mbit|2Mbit)", textcolor="#000080", linecolor="#000080"]; + * SD=>CENTRAL [label="Unknown Response (LL_UNKNOWN_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {Status=Invalid LMP Parameters}"]; + * |||; + * @endmsc + * + * @} + + * @defgroup BLE_GAP_DATA_LENGTH_UPDATE_PROCEDURE_MSC Data Length Update Procedure + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Self initiated, automatic parameters "]; + * |||; + * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; + * |||; + * ...; + * |||; + * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, NULL, NULL)"]; + * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; + * |||; + * ...; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Self initiated, application set parameters "]; + * |||; + * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; + * |||; + * ...; + * |||; + * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, NULL)"]; + * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; + + * |||; + * ...; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Peer initiated, automatic parameters "]; + * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; + * |||; + * ...; + * |||; + + * SD<:PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST {.peer_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; + + * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, NULL, NULL)"]; + * APP<PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; + * |||; + * ...; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Peer initiated, application set parameters"]; + * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; + * |||; + * ...; + * |||; + * SD<:PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST {.peer_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; + * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, NULL)"]; + * APP<PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; + + * |||; + * ...; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Using the limitation out parameter to adjust Link Layer Data Channel PDU size, memory limited "]; + * |||; + * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; + * |||; + * ...; + * |||; + * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, &limitation)"]; + * APP<SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=200, .max_rx_octets=200, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, &limitation)"]; + * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=200, rx=200}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=200, .max_rx_octets=200, .max_tx_time_us=1712, .max_rx_time_us=1712}}"]; + + * |||; + * ...; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Using the limitation out parameter to adjust Link Layer Data Channel PDU size, time limited "]; + * |||; + * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; + * |||; + * ...; + * |||; + * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, &limitation)"]; + * APP<SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251-178=73, .max_rx_octets=251-178=73, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, &limitation)"]; + * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=73, rx=73}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=73, .max_rx_octets=73, .max_tx_time_us=696, .max_rx_time_us=696}}"]; + * @endmsc + * @} + * + * @} + * @} + */ + +/** + * @addtogroup BLE_GATTC + * @{ + * @defgroup BLE_GATTC_MSC Message Sequence Charts + * @{ + * @defgroup BLE_GATTC_PRIM_SRVC_DISC_MSC GATTC Primary Service Discovery + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Variant #1 Discover All Services "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle, NULL)"]; + * APP<PEER [label = "ATT Read By Group Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Group Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {SUCCESS, services}"]; + * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle + N, NULL)"]; + * APP<PEER [label = "ATT Read By Group Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Group Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {SUCCESS, services}"]; + * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle + N + M, NULL)"]; + * APP<PEER [label = "ATT Read By Group Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; + * |||; + * --- [label = " Variant #2 Discover a Specific Service "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle, uuid)"]; + * APP<PEER [label = "ATT Find By Type Value Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Find By Type Value Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {SUCCESS, services}"]; + * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle + N, uuid)"]; + * APP<PEER [label = "ATT Find By Type Value Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Find By Type Value Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {SUCCESS, services}"]; + * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle + N + M, uuid)"]; + * APP<PEER [label = "ATT Find By Type Value Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; + * @endmsc + * + * @defgroup BLE_GATTC_REL_DISC_MSC GATTC Relationship Discovery + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_relationships_discover(handle_range)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_REL_DISC_RSP {SUCCESS, includes}"]; + * APP=>SD [label = "sd_ble_gattc_relationships_discover(handle_range + N)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_REL_DISC_RSP {SUCCESS, includes}"]; + * APP=>SD [label = "sd_ble_gattc_relationships_discover(handle_range + N + M)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_REL_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; + * @endmsc + * + * @defgroup BLE_GATTC_CHAR_DISC_MSC GATTC Characteristic Discovery + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_characteristics_discover(handle_range)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_DISC_RSP {SUCCESS, chars}"]; + * APP=>SD [label = "sd_ble_gattc_characteristics_discover(handle_range + N)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_DISC_RSP {SUCCESS, chars}"]; + * APP=>SD [label = "sd_ble_gattc_characteristics_discover(handle_range + N + M)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; + * @endmsc + * + * @defgroup BLE_GATTC_DESC_DISC_MSC GATTC Descriptor Discovery + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_descriptors_discover(handle_range)"]; + * APP<PEER [label = "ATT Find Information Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Find Information Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_DESC_DISC_RSP {SUCCESS, descs}"]; + * APP=>SD [label = "sd_ble_gattc_descriptors_discover(handle_range + N)"]; + * APP<PEER [label = "ATT Find Information Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Find Information Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_DESC_DISC_RSP {SUCCESS, descs}"]; + * APP=>SD [label = "sd_ble_gattc_descriptors_discover(handle_range + N + M)"]; + * APP<PEER [label = "ATT Find Information Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_DESC_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; + * @endmsc + * + * @defgroup BLE_GATTC_READ_UUID_MSC GATTC Read Characteristic Value by UUID + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_char_value_by_uuid_read(uuid, handle_range)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP {SUCCESS, char_values}"]; + * APP=>SD [label = "sd_ble_gattc_char_value_by_uuid_read(uuid, handle_range + N)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP {SUCCESS, char_values}"]; + * APP=>SD [label = "sd_ble_gattc_char_value_by_uuid_read(uuid, handle_range + N + M)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP {ATTRIBUTE_NOT_FOUND}"]; + * @endmsc + * + * @defgroup BLE_GATTC_VALUE_READ_MSC GATTC Characteristic or Descriptor Value Read + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Variant #1 offset == 0 "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_read(handle, 0)"]; + * APP<PEER [label = "ATT Read Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_READ_RSP {SUCCESS, value}"]; + * |||; + * --- [label = " Variant #2 offset != 0 "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_read(handle, offset)"]; + * APP<PEER [label = "ATT Read Blob Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read Blob Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_READ_RSP {SUCCESS, value}"]; + * APP=>SD [label = "sd_ble_gattc_read(handle, offset + N)"]; + * APP<PEER [label = "ATT Read Blob Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read Blob Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_READ_RSP {SUCCESS, value}"]; + * APP=>SD [label = "sd_ble_gattc_read(handle, offset + N + M + 1)"]; + * APP<PEER [label = "ATT Read Blob Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Invalid Offset", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_READ_RSP {INVALID_OFFSET}"]; + * @endmsc + * + * @defgroup BLE_GATTC_READ_MULT_MSC GATTC Read Multiple Characteristic Values + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Variant #1 Successful request "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_char_values_read(handles)"]; + * APP<PEER [label = "ATT Read Multiple Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read Multiple Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VALS_READ_RSP {SUCCESS, char_values}"]; + * |||; + * --- [label = " Variant #2 Failing request (invalid handle) "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_char_values_read(handles)"]; + * APP<PEER [label = "ATT Read Multiple Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Invalid Handle", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VALS_READ_RSP {INVALID_HANDLE, error_handle=}"]; + * @endmsc + * + * @defgroup BLE_GATTC_VALUE_WRITE_WITHOUT_RESP_MSC GATTC Characteristic Value Write Without Response + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * --- [label = " Variant #1 App does not keep track of the available queue element count for writes without responses "]; + * APP note PEER [label = " This variant makes it possible for APP to transmit writes without responses without keeping track of the available queue element count. However, successful queuing of writes without responses cannot be guaranteed. "]; + * |||; + * APP=>SD [label = "sd_ble_enable()"]; + * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_1)"]; + * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_2)"]; + * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_3)"]; + * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_4)"]; + * APP<PEER [label = "ATT Write Command {value_1}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Write Command {value_2}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Write Command {value_4}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE {SUCCESS, 3}"]; + * |||; + * --- [label = " Variant #2 App keeps track of the available queue element count for writes without responses "]; + * APP note PEER [label = " This variant makes it possible for APP to know when successful queuing of writes without responses is guaranteed. "]; + * |||; + * APP=>SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATTC, gattc_conn_cfg.write_cmd_tx_queue_size = 2)"]; + * APP<SD [label = "sd_ble_enable()"]; + * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_1)"]; + * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_2)"]; + * APP<PEER [label = "ATT Write Command {value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE {SUCCESS, 1}"]; + * APP abox APP [label="available_queue_element_count += 1"]; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_3)"]; + * APP<PEER [label = "ATT Write Command {value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE {SUCCESS, 1}"]; + * APP abox APP [label="available_queue_element_count += 1"]; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_4)"]; + * APP<PEER [label = "ATT Write Command {value_3}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Write Command {value_4}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE {SUCCESS, 2}"]; + * APP abox APP [label="available_queue_element_count += 2"]; + * @endmsc + * + * @defgroup BLE_GATTC_VALUE_WRITE_MSC GATTC Characteristic or Descriptor Value Write + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_REQ, handle, value)"]; + * APP<PEER [label = "ATT Write Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_WRITE_REQ, SUCCESS}"]; + * @endmsc + * + * @defgroup BLE_GATTC_VALUE_LONG_WRITE_MSC GATTC Characteristic or Descriptor Value Long Write + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_PREP_WRITE_REQ, handle, offset_1, value_1)"]; + * APP<PEER [label = "ATT Prepare Write Request {handle, offset_1, value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Response {handle, offset_1, value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_PREP_WRITE_REQ, SUCCESS, value_1}"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_PREP_WRITE_REQ, handle, offset_2, value_2)"]; + * APP<PEER [label = "ATT Prepare Write Request {handle, offset_2, value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Response {handle, offset_2, value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_PREP_WRITE_REQ, SUCCESS, value_2}"]; + * |||; + * ...; + * |||; + * --- [label = " Variant #1 App executes the Long Write procedure "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_EXEC_WRITE_REQ, PREPARED_WRITE)"]; + * APP<PEER [label = "ATT Execute Write Request: flags = 0x01", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_EXEC_WRITE_REQ, SUCCESS}"]; + * |||; + * --- [label = " Variant #2 App cancels the Long Write procedure "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_EXEC_WRITE_REQ, PREPARED_CANCEL)"]; + * APP<PEER [label = "ATT Execute Write Request: flags = 0x00", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_EXEC_WRITE_REQ, SUCCESS}"]; + * @endmsc + * + * @defgroup BLE_GATTC_VALUE_RELIABLE_WRITE_MSC GATTC Characteristic or Descriptor Value Reliable Write + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_PREP_WRITE_REQ, handle_1, offset, value_1)"]; + * APP<PEER [label = "ATT Prepare Write Request {handle_1, offset, value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Response {handle_1, offset, value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_PREP_WRITE_REQ, SUCCESS, value_1}"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_PREP_WRITE_REQ, handle_2, offset, value_2)"]; + * APP<PEER [label = "ATT Prepare Write Request {handle_2, offset, value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Response {handle_2, offset, value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_PREP_WRITE_REQ, SUCCESS, value_2}"]; + * |||; + * ...; + * |||; + * --- [label = " Variant #1 App executes the Reliable Write procedure "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_EXEC_WRITE_REQ, PREPARED_WRITE)"]; + * APP<PEER [label = "ATT Execute Write Request: flags = 0x01", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_EXEC_WRITE_REQ, SUCCESS}"]; + * |||; + * --- [label = " Variant #2 App cancels the Reliable Write procedure "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_EXEC_WRITE_REQ, PREPARED_CANCEL)"]; + * APP<PEER [label = "ATT Execute Write Request: flags = 0x00", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_EXEC_WRITE_REQ, SUCCESS}"]; + * @endmsc + * + * @defgroup BLE_GATTC_HVI_MSC GATTC Handle Value Indication + * GATTC Handle Value Indication MSC + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD<:PEER [label = "ATT Handle Value Indication", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_HVX {INDICATION, data}"]; + * APP=>SD [label = "sd_ble_gattc_hv_confirm(handle)"]; + * APP<PEER [label = "ATT Handle Value Confirmation", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTC_HVN_MSC GATTC Handle Value Notification + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD<:PEER [label = "ATT Handle Value Notification", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_HVX {NOTIFICATION, data}"]; + * @endmsc + * + * @defgroup BLE_GATTC_TIMEOUT_MSC GATTC Timeout + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="GATTC procedure API call"]; + * SD:>PEER [label = "ATT Packet", textcolor="#000080", linecolor="#000080"]; + * APP note PEER [label = "No Response from Peer"]; + * |||; + * ...; + * |||; + * SD box SD [label="Timeout"]; + * APP<<=SD [label = "BLE_GATTC_EVT_TIMEOUT {source}"]; + * APP rbox PEER [label="No additional ATT Traffic Allowed", textbgcolour="#ff7f7f"]; + * APP=>SD [label = "Any GATT procedure API call"]; + * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATT, gatt_conn_cfg.att_mtu=100)"]; + * APP<SD [label = "sd_ble_enable()"]; + * APP<SD [label = "sd_ble_gattc_exchange_mtu_request(conn_handle, client_rx_mtu=80)"]; + * APP<PEER [label = "ATT Exchange MTU Request {client_rx_mtu=80}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Exchange MTU Response {server_rx_mtu=75}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="att_mtu=75"]; + * APP<<=SD [label = "BLE_GATTC_EVT_EXCHANGE_MTU_RSP {SUCCESS, server_rx_mtu=75}"]; + * @endmsc + * + * @} + * @} + */ + +/** + * @addtogroup BLE_GATTS + * @{ + * @defgroup BLE_GATTS_MSC Message Sequence Charts + * @{ + * @defgroup BLE_GATTS_ATT_TABLE_POP_MSC GATTS ATT Table Population + * @msc + * hscale = "1.5"; + * APP,SD; + * |||; + * APP=>SD [label = "sd_ble_gatts_service_add(uuid#1)"]; + * APP<SD [label = "sd_ble_gatts_characteristic_add(handle_srvc#1, char_md, value)"]; + * APP<SD [label = "sd_ble_gatts_descriptor_add(handle_char#1, value)"]; + * APP<SD [label = "sd_ble_gatts_descriptor_add(handle_char#1, value)"]; + * APP<SD [label = "sd_ble_gatts_characteristic_add(handle_srvc#1, char_md, value)"]; + * APP<SD [label = "sd_ble_gatts_descriptor_add(handle_char#2, value)"]; + * APP<SD [label = "sd_ble_gatts_service_add(uuid#2)"]; + * APP<SD [label = "sd_ble_gatts_include_add(handle_srvc#2, handle_srvc#1)"]; + * APP<PEER [label = "ATT Read Response", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_WRITE_REQ_NO_AUTH_MSC GATTS Write Request without Authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * SD<:PEER [label = "ATT Write Request {peer_value}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Write Response", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Value in ATT Table: peer_value"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {WRITE_REQ, auth_required=0, peer_value}"]; + * @endmsc + * + * @defgroup BLE_GATTS_WRITE_CMD_NO_AUTH_MSC GATTS Write Command Without Authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * SD<:PEER [label = "ATT Write Command {peer_value}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Value in ATT Table: peer_value"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {WRITE_CMD, auth_required=0, peer_value}"]; + * @endmsc + * + * @defgroup BLE_GATTS_WRITE_CMD_AUTH_MSC GATTS Write Command With Authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * SD<:PEER [label = "ATT Write Command {peer_value}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {WRITE_CMD, auth_required=1, peer_value}"]; + * --- [label = " Variant #1 App Authorizes "]; + * APP=>SD [label = "sd_ble_gatts_value_set(peer_value)"]; + * APP<SD [label = "sd_ble_gatts_value_set(app_value)"]; + * APP<SD [label = "sd_ble_gatts_rw_authorize_reply(SUCCESS, app_value)"]; + * APP<PEER [label = "ATT Read Response {app_value}", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #2 App Disallows "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(READ_NOT_PERMITTED)"]; + * APP<PEER [label = "ATT Error Response", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_WRITE_REQ_AUTH_MSC GATTS Write Request with Authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * SD<:PEER [label = "ATT Write Request {peer_value}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, peer_value}"]; + * --- [label = " Variant #1 App Authorizes "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(SUCCESS, peer_value)"]; + * APP<PEER [label = "ATT Write Response", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #2 App Authorizes but changes value "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(SUCCESS, app_value)"]; + * APP<PEER [label = "ATT Write Response", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #3 App Disallows "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE_NOT_PERMITTED)"]; + * APP<PEER [label = "ATT Error Response", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_BUF_NOAUTH_MSC GATTS Queued Writes: Stack handled, no attributes require authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; + * APP=>SD [label = "sd_ble_user_mem_reply {user_mem_block}"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #1 Attribute Values validation passed "]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: peer_value_2"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="App parses the memory it provided"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * |||; + * --- [label = " Variant #2 Attribute Values validation failed "]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Error Response {Invalid Value Length / Offset}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC GATTS Queued Writes: Stack handled, one or more attributes require authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; + * APP=>SD [label = "sd_ble_user_mem_reply {user_mem_block}"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; + * |||; + * --- [label = " Variant #1 App Authorizes both Prepare Write and Execute Write"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="App parses the memory it provided"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: peer_value_2"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * |||; + * --- [label = " Variant #2 App Disallows Prepare Write and Authorizes Execute Write "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, INSUF_AUTHORIZATION)"]; + * SD:>PEER [label = "ATT Error Response {Insufficient Authorization}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="App parses the memory it provided"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * |||; + * --- [label = " Variant #3 App Authorizes Prepare Write and Disallows Execute Write "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="App parses the memory it provided"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, APP_ERROR_CODE)"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Error Response {APP_ERROR_CODE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC GATTS Queued Writes: App handled, no attributes require authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; + * APP=>SD [label = "sd_ble_user_mem_reply {NULL}"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_1, offset_1, peer_value_1}"]; + * APP rbox APP [label="App queues {handle_1, offset_1, peer_value_1}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_1, offset_1, peer_value_1)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; + * APP rbox APP [label="App queues {handle_2, offset_2, peer_value_2}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_2, offset_2, peer_value_2)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * |||; + * --- [label = " Variant #1 Attribute values in stack memory (VLOC_STACK), attribute values validation passed "]; + * APP=>SD [label = "sd_ble_gatts_value_set {handle_1, offset_1, peer_value_1}"]; + * APP<SD [label = "sd_ble_gatts_value_set {handle_2, offset_2, peer_value_2}"]; + * APP<SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #2 Attribute values in user memory (VLOC_USER), attribute values validation passed "]; + * APP rbox APP [label="Application traverses its queue and executes the write operations (memcpy)"]; + * APP rbox APP [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: peer_value_2"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #3 Attribute values validation failed "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, INVALID_OFFSET)"]; + * APP rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Error Response {Invalid Offset}", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC GATTS Queued Writes: App handled, one or more attributes require authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox APP [label="Values in ATT Table in user memory (VLOC_USER):\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; + * APP=>SD [label = "sd_ble_user_mem_reply {NULL}"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_1, offset_1, peer_value_1}"]; + * APP rbox APP [label="App queues {handle_1, offset_1, peer_value_1}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_1, offset_1, peer_value_1)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; + * |||; + * --- [label = " Variant #1 App Authorizes both Prepare Write and Execute Write"]; + * APP rbox APP [label="App queues {handle_2, offset_2, peer_value_2}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_2, offset_2, peer_value_2)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="Application traverses its queue and executes the write operations (memcpy)"]; + * APP rbox APP [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: peer_value_2"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #2 App Disallows Prepare Write and Authorizes Execute Write "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, INSUF_AUTHORIZATION)"]; + * SD:>PEER [label = "ATT Error Response {Insufficient Authorization}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="Application traverses its queue and executes the write operations (memcpy)"]; + * APP rbox APP [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: current_value_2"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #3 App Authorizes Prepare Write and Disallows Execute Write "]; + * APP rbox APP [label="App queues {handle_2, offset_2, peer_value_2}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_2, offset_2, peer_value_2)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, APP_ERROR_CODE)"]; + * APP rbox APP [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Error Response {APP_ERROR_CODE}", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC GATTS Queued Writes: Peer cancels operation + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; + * |||; + * --- [label = " Variant #1 Stack handled "]; + * APP=>SD [label = "sd_ble_user_mem_reply {user_mem_block}"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {CANCEL}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * |||; + * --- [label = " Variant #2 App handled "]; + * APP=>SD [label = "sd_ble_user_mem_reply {NULL}"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_1, offset_1, peer_value_1}"]; + * APP rbox APP [label="App queues {handle_1, offset_1, peer_value_1}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_1, offset_1, peer_value_1)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; + * APP rbox APP [label="App queues {handle_2, offset_2, peer_value_2}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_2, offset_2, peer_value_2)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {CANCEL}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_CANCEL}"]; + * APP rbox APP [label="App erases queue"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC GATTS Queued Writes: Prepare Queue Full + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; + * |||; + * --- [label = " Variant #1 Stack handled "]; + * APP=>SD [label = "sd_ble_user_mem_reply {user_mem_block}"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Error Response {Prepare Queue Full}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: current_value_2"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="App parses the memory it provided"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * |||; + * --- [label = " Variant #2 App handled "]; + * APP=>SD [label = "sd_ble_user_mem_reply {NULL}"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_1, offset_1, peer_value_1}"]; + * APP rbox APP [label="App queues {handle_1, offset_1, peer_value_1}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_1, offset_1, peer_value_1)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, PREPARE_QUEUE_FULL)"]; + * SD:>PEER [label = "ATT Error Response {Prepare Queue Full}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP=>SD [label = "sd_ble_gatts_value_set {handle_1, offset_1, peer_value_1}"]; + * APP<SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_EXECUTE_WITHOUT_PREPARE_MSC GATTS Queued Writes: Execute Write without Prepare Write + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * |||; + * SD rbox SD [label="No ATT Prepare Write Request has been received by SD"]; + * |||; + * --- [label = " Variant #1 Write cancelled "]; + * SD<:PEER [label = "ATT Execute Write Request {CANCEL}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {EXEC_WRITE_REQ_CANCEL}"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #2 Write now "]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {EXEC_WRITE_REQ_NOW}"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_MTU_EXCHANGE GATTS ATT_MTU Exchange + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP=>SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATT, gatt_conn_cfg.att_mtu=100)"]; + * APP<SD [label = "sd_ble_enable()"]; + * APP<SD [label = "sd_ble_gatts_exchange_mtu_reply(conn_handle, server_rx_mtu=75)"]; + * APP<PEER [label = "ATT Exchange MTU Response {server_rx_mtu=75}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="att_mtu=75"]; + * @endmsc + * + * @defgroup BLE_GATTS_HVI_MSC GATTS Handle Value Indication + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="Indications Enabled in CCCD"]; + * |||; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * APP=>SD [label = "sd_ble_gatts_hvx(INDICATION, app_value)"]; + * APP<PEER [label = "ATT Handle Value Indication {app_value}", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #1 Peer Confirms "]; + * SD<:PEER [label = "ATT Handle Value Confirmation", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_HVC"]; + * --- [label = " Variant #2 Peer Ignores "]; + * |||; + * ...; + * |||; + * SD box SD [label="Timeout"]; + * APP<<=SD [label = "BLE_GATTS_EVT_TIMEOUT"]; + * @endmsc + * + * @defgroup BLE_GATTS_HVN_MSC GATTS Handle Value Notification + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * --- [label = " Variant #1 App does not keep track of the available queue element count for notifications "]; + * APP note PEER [label = " This variant makes it possible for APP to transmit notifications without keeping track of the available queue element count. However, successful queuing of notifications cannot be guaranteed. "]; + * |||; + * APP=>SD [label = "sd_ble_enable()"]; + * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_1)"]; + * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_2)"]; + * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_3)"]; + * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_4)"]; + * APP<PEER [label = "ATT Handle Value Notification {app_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Handle Value Notification {app_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Handle Value Notification {app_value_4}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_HVN_TX_COMPLETE {3}"]; + * |||; + * --- [label = " Variant #2 App keeps track of the available queue element count for notifications "]; + * APP note PEER [label = " This variant makes it possible for APP to know when successful queuing of notifications is guaranteed. "]; + * |||; + * APP=>SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATTS, gatts_conn_cfg.hvn_tx_queue_size=2)"]; + * APP<SD [label = "sd_ble_enable()"]; + * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_1)"]; + * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_2)"]; + * APP<PEER [label = "ATT Handle Value Notification {app_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_HVN_TX_COMPLETE {1}"]; + * APP abox APP [label="available_queue_element_count += 1"]; + * APP=>SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_3)"]; + * APP<PEER [label = "ATT Handle Value Notification {app_value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_HVN_TX_COMPLETE {1}"]; + * APP abox APP [label="available_queue_element_count += 1"]; + * APP=>SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_4)"]; + * APP<PEER [label = "ATT Handle Value Notification {app_value_3}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Handle Value Notification {app_value_4}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_HVN_TX_COMPLETE {2}"]; + * APP abox APP [label="available_queue_element_count += 2"]; + * @endmsc + * + * @defgroup BLE_GATTS_HVX_DISABLED_MSC GATTS Handle Value Indication or Notification disabled + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="Indications and Notifications Disabled in CCCD"]; + * |||; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * APP=>SD [label = "sd_ble_gatts_hvx(INDICATION or NOTIFICATION, app_value)"]; + * APP<SD [label = "sd_ble_gatts_hvx(INDICATION or NOTIFICATION, app_value)"]; + * APP<SD [label = "sd_ble_gatts_sys_attr_set()"]; + * APP<SD [label = "sd_ble_gatts_service_changed(N, M)"]; + * APP<PEER [label = "ATT Handle Value Indication {N, M}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Handle Value Confirmation", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_SC_CONFIRM"]; + * |||; + * SD rbox PEER [label="Service Discovery"]; + * @endmsc + * + * @defgroup BLE_GATTS_SYS_ATTRS_UNK_PEER_MSC GATTS System Attributes Handling: Unknown Peer + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established with an Unknown Peer"]; + * |||; + * SD<:PEER [label = "ATT Read Request {sys_attr_handle}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_SYS_ATTR_MISSING"]; + * APP=>SD [label = "sd_ble_gatts_sys_attr_set(NULL)"]; + * APP<PEER [label = "ATT Read Response {sys_attr_value}", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC GATTS System Attributes Handling: Bonded Peer + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established with a Bonded Peer"]; + * |||; + * APP rbox PEER [label="ATT Traffic"]; + * |||; + * APP rbox PEER [label="Connection Terminated"]; + * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {reason}"]; + * |||; + * APP=>SD [label = "sd_ble_gatts_sys_attr_get()"]; + * APP<SD [label = "sd_ble_gatts_sys_attr_set(sys_attr_data)"]; + * APP<PEER [label = "ATT Read Response {sys_attr_value}", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_TIMEOUT_MSC GATTS Timeout + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="GATTS procedure API call"]; + * SD:>PEER [label = "ATT Packet", textcolor="#000080", linecolor="#000080"]; + * APP note PEER [label = "No Response from Peer"]; + * |||; + * ...; + * |||; + * SD box SD [label="Timeout"]; + * APP<<=SD [label = "BLE_GATTS_EVT_TIMEOUT {source}"]; + * APP rbox PEER [label="No additional ATT Traffic Allowed", textbgcolour="#ff7f7f"]; + * APP=>SD [label = "Any GATT procedure API call"]; + * APP< + * Queued Write + * + * Parameter + * Size (octets) + * Description + * + * + * Handle + * 2 + * Attribute Handle + * + * + * Offset + * 2 + * Value Offset + * + * + * Length + * 2 + * Value Length + * + * + * Value + * Length + * Attribute Value + * + * + * + * The application can parse the array of Queued Write instances at any time, but it is recommended to do so whenever an Execute Write ATT packet + * has been received over the air. See the GATT Server Queued Writes MSCs for more details. + * The array will be terminated by an Queued Write instance with its handle set to @ref BLE_GATT_HANDLE_INVALID. + * @} + */ + + /** + * @addtogroup BLE_GATTS_SYS_ATTRS_FORMAT User memory layout for System Attributes + * @{ + * The following table shows the memory layout used by the SoftDevice to store a + * system attribute. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
System Attribute
ParameterSize (octets)Description
Handle2Attribute handle
Length2Attribute length
DataLengthAttribute data
+ * + * The application can obtain an array of system attributes by using @c sd_ble_gatts_sys_attr_get(). + * The array is terminated by a CRC-16-CCITT checksum of the data in the array. + * @} + * @} + */ + +/** + * @addtogroup BLE_L2CAP + * @{ + * @defgroup BLE_L2CAP_MSC Message Sequence Charts + * @{ + * @defgroup BLE_L2CAP_CH_SETUP_MSC L2CAP Channel Setup + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Variant #1 Locally initiated, Establishment success "]; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid=INVALID, le_psm, rx_mtu, rx_mps, sdu_buf: [len, p_data1])"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "L2CAP LE Credit Based Connection Response: Connection successful", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP {conn_handle, local_cid, tx_mtu, tx_mps, credits}"]; + * |||; + * APP rbox PEER [label="L2CAP Channel Established"]; + * |||; + * --- [label = " Variant #2 Locally initiated, Establishment failure - PEER refusal "]; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid=INVALID, le_psm, rx_mtu, rx_mps, sdu_buf: [len, p_data1])"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "L2CAP LE Credit Based Connection Response: Connection refused - no resources available", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED {conn_handle, local_cid, sdu_buf: [len, p_data1]}"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REFUSED {conn_handle, local_cid, source: REMOTE, status: NO_RESOURCES}"]; + * |||; + * APP rbox PEER [label="L2CAP Channel NOT Established"]; + * |||; + * --- [label = " Variant #3 Locally initiated, Establishment failure - PEER does not respond "]; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid=INVALID, le_psm, rx_mtu, rx_mps, sdu_buf: p_data=NULL)"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; + * SD abox SD [label="Timeout"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REFUSED {conn_handle, local_cid, source: LOCAL, status: TIMEOUT}"]; + * |||; + * APP rbox PEER [label="L2CAP Channel NOT Established"]; + * |||; + * --- [label = " Variant #4 Remotely initiated, Establishment success "]; + * SD<:PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REQUEST {conn_handle, local_cid, le_psm, tx_mtu, tx_mps, credits}"]; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid, rx_mtu, rx_mps, sdu_buf: [len, p_data1], status: SUCCESS)"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Response: Connection successful", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PEER [label="L2CAP Channel Established"]; + * |||; + * --- [label = " Variant #5 Remotely initiated, Establishment failure - APP refusal "]; + * SD<:PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REQUEST {conn_handle, local_cid, le_psm, tx_mtu, tx_mps, credits}"]; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid, status: LE_PSM_NOT_SUPPORTED)"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Response: Connection refused - LE_PSM not supported", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PEER [label="L2CAP Channel NOT Established"]; + * |||; + * --- [label = " Variant #6 Remotely initiated, Establishment failure - SD refusal "]; + * SD<:PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="The limit of available L2CAP channels has been reached"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REFUSED {conn_handle, local_cid=INVALID, source: LOCAL, status: NO_RESOURCES}"]; + * SD:>PEER [label = "L2CAP LE Credit Based Connection Response: Connection refused - no resources available", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PEER [label="L2CAP Channel NOT Established"]; + * |||; + * @endmsc + * + * @defgroup BLE_L2CAP_CH_RELEASE_MSC L2CAP Channel Release + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="L2CAP Channel Established"]; + * |||; + * --- [label = " Variant #1 Locally initiated, PEER responds "]; + * APP=>SD [label = "sd_ble_l2cap_ch_release(conn_handle, local_cid)"]; + * APP<PEER [label = "L2CAP Disconnection Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "L2CAP Disconnection Response", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="SD currently has three SDU data buffers supplied by APP"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED {conn_handle, local_cid, sdu_buf1}"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED {conn_handle, local_cid, sdu_buf2}"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED {conn_handle, local_cid, sdu_buf3}"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RELEASED {conn_handle, local_cid}"]; + * |||; + * --- [label = " Variant #2 Locally initiated, PEER does not respond "]; + * APP=>SD [label = "sd_ble_l2cap_ch_release(conn_handle, local_cid)"]; + * APP<PEER [label = "L2CAP Disconnection Request", textcolor="#000080", linecolor="#000080"]; + * SD abox SD [label="Timeout"]; + * SD rbox SD [label="SD does not currently have SDU data buffers supplied by APP"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RELEASED {conn_handle, local_cid}"]; + * |||; + * --- [label = " Variant #3 Remotely initiated "]; + * SD<:PEER [label = "L2CAP Disconnection Request", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="SD does not currently have SDU data buffers supplied by APP"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RELEASED {conn_handle, local_cid}"]; + * SD:>PEER [label = "L2CAP Disconnection Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * @endmsc + * + * @defgroup BLE_L2CAP_CH_TX_MSC L2CAP Channel SDU Transmit + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * --- [label = " Variant #1 App ignores transmit credits, SD will transmit data as soon as possible "]; + * APP rbox PEER [label="L2CAP Channel Established, tx_queue_size=2, tx_mps=100, credits=2"]; + * |||; + * APP=>SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=140, p_data1])"]; + * APP<SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=80, p_data2])"]; + * APP<SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=280, p_data3])"]; + * APP<PEER [label = "SDU 1, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=140, p_data1]}"]; + * APP abox APP [label="App releases memory pointed by p_data1"]; + * SD rbox SD [label="All credits consumed"]; + * APP=>SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=280, p_data3])"]; + * APP<PEER [label = "SDU 2, Segment 1", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=80, p_data2]}"]; + * APP abox APP [label="App releases memory pointed by p_data2"]; + * SD:>PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="All credits consumed"]; + * ...; + * SD<:PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_CREDIT {conn_handle, local_cid, credits=2}"]; + * SD:>PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=280, p_data3]}"]; + * APP abox APP [label="App releases memory pointed by p_data3"]; + * |||; + * --- [label = " Variant #2 App keeps track of transmission credits and transmits only if credits are available "]; + * APP rbox PEER [label="L2CAP Channel Established, tx_queue_size=2, tx_mps=100, credits=2"]; + * APP abox APP [label="available_credits = 2"]; + * |||; + * APP=>SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=140, p_data1])"]; + * APP<PEER [label = "SDU 1, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=140, p_data1]}"]; + * APP abox APP [label="App releases memory pointed by p_data1"]; + * ...; + * SD<:PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_CREDIT {conn_handle, local_cid, credits=2}"]; + * APP abox APP [label="available_credits += 2\n// available_credits == 2"]; + * APP=>SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=80, p_data2])"]; + * APP<SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=280, p_data3])"]; + * APP<PEER [label = "SDU 2, Segment 1", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=80, p_data2]}"]; + * APP abox APP [label="App releases memory pointed by p_data2"]; + * SD:>PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; + * ...; + * SD<:PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_CREDIT {conn_handle, local_cid, credits=2}"]; + * APP abox APP [label="available_credits += 2\n// available_credits == 0"]; + * SD:>PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=280, p_data3]}"]; + * APP abox APP [label="App releases memory pointed by p_data3"]; + * |||; + * @endmsc + * + * @defgroup BLE_L2CAP_CH_RX_MSC L2CAP Channel SDU Receive + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(rx_mtu=1000, rx_mps=100, sdu_buf: [len=1000, p_data1])"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Request (Initial Credits=1)", textcolor="#000080", linecolor="#000080"]; + * APP rbox PEER [label="L2CAP Channel Established, rx_queue_size=2, rx_mtu=1000, rx_mps=100"]; + * |||; + * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data2])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 1, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="1 credit left"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=140, sdu_buf: [len=1000, p_data1]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data1"]; + * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data3])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 2, Segment 1", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="1 credit left"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=80, sdu_buf: [len=1000, p_data2]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data2"]; + * SD<:PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="All credits consumed"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=280, sdu_buf: [len=1000, p_data3]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data3"]; + * |||; + * @endmsc + * + * @defgroup BLE_L2CAP_CH_FLOW_CONTROL_MSC L2CAP Channel advanced SDU reception flow control + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(rx_mtu=1000, rx_mps=100, sdu_buf: p_data=NULL)"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Request (Initial Credits=0)", textcolor="#000080", linecolor="#000080"]; + * APP rbox PEER [label="L2CAP Channel Established, rx_queue_size=2, rx_mtu=1000, rx_mps=100"]; + * |||; + * --- [label = " Variant #1 App overwrites number of credits peer should have at the start of a SDU "]; + * APP=>SD [label = "sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, credits=8)"]; + * APP<SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data1])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=8)", textcolor="#000080", linecolor="#000080"]; + * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data2])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="8 credits left"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=140, sdu_buf: [len=1000, p_data1]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data1"]; + * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data3])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="8 credits left"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=80, sdu_buf: [len=1000, p_data2]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data2"]; + * SD<:PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="5 credits left"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=280, sdu_buf: [len=1000, p_data3]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data3"]; + * APP rbox APP [label="Peer has credits remaining so application must provide new reception buffer as soon as possible."]; + * |||; + * --- [label = " Variant #2 App pauses traffic on a L2CAP Channel "]; + * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data1])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data2])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 1, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="1 credit left"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=140, sdu_buf: [len=1000, p_data1]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data1"]; + * APP=>SD [label = "sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, credits=0)"]; + * APP<SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data3])"]; + * APP<SD [label = "sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, credits=0)"]; + * APP<SD [label = "sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, credits=BLE_L2CAP_CREDITS_DEFAULT)"]; + * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="All credits consumed"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=280, sdu_buf: [len=1000, p_data3]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data3"]; + * |||; + * @endmsc + * @} + * @} + */ + diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h new file mode 100644 index 0000000000..39944854c2 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h @@ -0,0 +1,678 @@ +/* + * Copyright (c) 2012 - 2020, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_COMMON BLE SoftDevice Common + @{ + @defgroup ble_api Events, type definitions and API calls + @{ + + @brief Module independent events, type definitions and API calls for the BLE SoftDevice. + + */ + +#ifndef BLE_H__ +#define BLE_H__ + +#include +#include "nrf_svc.h" +#include "nrf_error.h" +#include "ble_err.h" +#include "ble_gap.h" +#include "ble_l2cap.h" +#include "ble_gatt.h" +#include "ble_gattc.h" +#include "ble_gatts.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup BLE_COMMON_ENUMERATIONS Enumerations + * @{ */ + +/** + * @brief Common API SVC numbers. + */ +enum BLE_COMMON_SVCS +{ + SD_BLE_ENABLE = BLE_SVC_BASE, /**< Enable and initialize the BLE stack */ + SD_BLE_EVT_GET, /**< Get an event from the pending events queue. */ + SD_BLE_UUID_VS_ADD, /**< Add a Vendor Specific base UUID. */ + SD_BLE_UUID_DECODE, /**< Decode UUID bytes. */ + SD_BLE_UUID_ENCODE, /**< Encode UUID bytes. */ + SD_BLE_VERSION_GET, /**< Get the local version information (company ID, Link Layer Version, Link Layer Subversion). */ + SD_BLE_USER_MEM_REPLY, /**< User Memory Reply. */ + SD_BLE_OPT_SET, /**< Set a BLE option. */ + SD_BLE_OPT_GET, /**< Get a BLE option. */ + SD_BLE_CFG_SET, /**< Add a configuration to the BLE stack. */ + SD_BLE_UUID_VS_REMOVE, /**< Remove a Vendor Specific base UUID. */ +}; + +/** + * @brief BLE Module Independent Event IDs. + */ +enum BLE_COMMON_EVTS +{ + BLE_EVT_USER_MEM_REQUEST = BLE_EVT_BASE + 0, /**< User Memory request. See @ref ble_evt_user_mem_request_t + \n Reply with @ref sd_ble_user_mem_reply. */ + BLE_EVT_USER_MEM_RELEASE = BLE_EVT_BASE + 1, /**< User Memory release. See @ref ble_evt_user_mem_release_t */ +}; + +/**@brief BLE Connection Configuration IDs. + * + * IDs that uniquely identify a connection configuration. + */ +enum BLE_CONN_CFGS +{ + BLE_CONN_CFG_GAP = BLE_CONN_CFG_BASE + 0, /**< BLE GAP specific connection configuration. */ + BLE_CONN_CFG_GATTC = BLE_CONN_CFG_BASE + 1, /**< BLE GATTC specific connection configuration. */ + BLE_CONN_CFG_GATTS = BLE_CONN_CFG_BASE + 2, /**< BLE GATTS specific connection configuration. */ + BLE_CONN_CFG_GATT = BLE_CONN_CFG_BASE + 3, /**< BLE GATT specific connection configuration. */ + BLE_CONN_CFG_L2CAP = BLE_CONN_CFG_BASE + 4, /**< BLE L2CAP specific connection configuration. */ +}; + +/**@brief BLE Common Configuration IDs. + * + * IDs that uniquely identify a common configuration. + */ +enum BLE_COMMON_CFGS +{ + BLE_COMMON_CFG_VS_UUID = BLE_CFG_BASE, /**< Vendor specific base UUID configuration */ +}; + +/**@brief Common Option IDs. + * IDs that uniquely identify a common option. + */ +enum BLE_COMMON_OPTS +{ + BLE_COMMON_OPT_PA_LNA = BLE_OPT_BASE + 0, /**< PA and LNA options */ + BLE_COMMON_OPT_CONN_EVT_EXT = BLE_OPT_BASE + 1, /**< Extended connection events option */ + BLE_COMMON_OPT_EXTENDED_RC_CAL = BLE_OPT_BASE + 2, /**< Extended RC calibration option */ +}; + +/** @} */ + +/** @addtogroup BLE_COMMON_DEFINES Defines + * @{ */ + +/** @brief Required pointer alignment for BLE Events. +*/ +#define BLE_EVT_PTR_ALIGNMENT 4 + +/** @brief Leaves the maximum of the two arguments. +*/ +#define BLE_MAX(a, b) ((a) < (b) ? (b) : (a)) + +/** @brief Maximum possible length for BLE Events. + * @note The highest value used for @ref ble_gatt_conn_cfg_t::att_mtu in any connection configuration shall be used as a parameter. + * If that value has not been configured for any connections then @ref BLE_GATT_ATT_MTU_DEFAULT must be used instead. +*/ +#define BLE_EVT_LEN_MAX(ATT_MTU) ( \ + offsetof(ble_evt_t, evt.gattc_evt.params.prim_srvc_disc_rsp.services) + ((ATT_MTU) - 1) / 4 * sizeof(ble_gattc_service_t) \ +) + +/** @defgroup BLE_USER_MEM_TYPES User Memory Types + * @{ */ +#define BLE_USER_MEM_TYPE_INVALID 0x00 /**< Invalid User Memory Types. */ +#define BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES 0x01 /**< User Memory for GATTS queued writes. */ +/** @} */ + +/** @defgroup BLE_UUID_VS_COUNTS Vendor Specific base UUID counts + * @{ + */ +#define BLE_UUID_VS_COUNT_DEFAULT 10 /**< Default VS UUID count. */ +#define BLE_UUID_VS_COUNT_MAX 254 /**< Maximum VS UUID count. */ +/** @} */ + +/** @defgroup BLE_COMMON_CFG_DEFAULTS Configuration defaults. + * @{ + */ +#define BLE_CONN_CFG_TAG_DEFAULT 0 /**< Default configuration tag, SoftDevice default connection configuration. */ + +/** @} */ + +/** @} */ + +/** @addtogroup BLE_COMMON_STRUCTURES Structures + * @{ */ + +/**@brief User Memory Block. */ +typedef struct +{ + uint8_t *p_mem; /**< Pointer to the start of the user memory block. */ + uint16_t len; /**< Length in bytes of the user memory block. */ +} ble_user_mem_block_t; + +/**@brief Event structure for @ref BLE_EVT_USER_MEM_REQUEST. */ +typedef struct +{ + uint8_t type; /**< User memory type, see @ref BLE_USER_MEM_TYPES. */ +} ble_evt_user_mem_request_t; + +/**@brief Event structure for @ref BLE_EVT_USER_MEM_RELEASE. */ +typedef struct +{ + uint8_t type; /**< User memory type, see @ref BLE_USER_MEM_TYPES. */ + ble_user_mem_block_t mem_block; /**< User memory block */ +} ble_evt_user_mem_release_t; + +/**@brief Event structure for events not associated with a specific function module. */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle on which this event occurred. */ + union + { + ble_evt_user_mem_request_t user_mem_request; /**< User Memory Request Event Parameters. */ + ble_evt_user_mem_release_t user_mem_release; /**< User Memory Release Event Parameters. */ + } params; /**< Event parameter union. */ +} ble_common_evt_t; + +/**@brief BLE Event header. */ +typedef struct +{ + uint16_t evt_id; /**< Value from a BLE__EVT series. */ + uint16_t evt_len; /**< Length in octets including this header. */ +} ble_evt_hdr_t; + +/**@brief Common BLE Event type, wrapping the module specific event reports. */ +typedef struct +{ + ble_evt_hdr_t header; /**< Event header. */ + union + { + ble_common_evt_t common_evt; /**< Common Event, evt_id in BLE_EVT_* series. */ + ble_gap_evt_t gap_evt; /**< GAP originated event, evt_id in BLE_GAP_EVT_* series. */ + ble_gattc_evt_t gattc_evt; /**< GATT client originated event, evt_id in BLE_GATTC_EVT* series. */ + ble_gatts_evt_t gatts_evt; /**< GATT server originated event, evt_id in BLE_GATTS_EVT* series. */ + ble_l2cap_evt_t l2cap_evt; /**< L2CAP originated event, evt_id in BLE_L2CAP_EVT* series. */ + } evt; /**< Event union. */ +} ble_evt_t; + + +/** + * @brief Version Information. + */ +typedef struct +{ + uint8_t version_number; /**< Link Layer Version number. See https://www.bluetooth.org/en-us/specification/assigned-numbers/link-layer for assigned values. */ + uint16_t company_id; /**< Company ID, Nordic Semiconductor's company ID is 89 (0x0059) (https://www.bluetooth.org/apps/content/Default.aspx?doc_id=49708). */ + uint16_t subversion_number; /**< Link Layer Sub Version number, corresponds to the SoftDevice Config ID or Firmware ID (FWID). */ +} ble_version_t; + +/** + * @brief Configuration parameters for the PA and LNA. + */ +typedef struct +{ + uint8_t enable :1; /**< Enable toggling for this amplifier */ + uint8_t active_high :1; /**< Set the pin to be active high */ + uint8_t gpio_pin :6; /**< The GPIO pin to toggle for this amplifier */ +} ble_pa_lna_cfg_t; + +/** + * @brief PA & LNA GPIO toggle configuration + * + * This option configures the SoftDevice to toggle pins when the radio is active for use with a power amplifier and/or + * a low noise amplifier. + * + * Toggling the pins is achieved by using two PPI channels and a GPIOTE channel. The hardware channel IDs are provided + * by the application and should be regarded as reserved as long as any PA/LNA toggling is enabled. + * + * @note @ref sd_ble_opt_get is not supported for this option. + * @note Setting this option while the radio is in use (i.e. any of the roles are active) may have undefined consequences + * and must be avoided by the application. + */ +typedef struct +{ + ble_pa_lna_cfg_t pa_cfg; /**< Power Amplifier configuration */ + ble_pa_lna_cfg_t lna_cfg; /**< Low Noise Amplifier configuration */ + + uint8_t ppi_ch_id_set; /**< PPI channel used for radio pin setting */ + uint8_t ppi_ch_id_clr; /**< PPI channel used for radio pin clearing */ + uint8_t gpiote_ch_id; /**< GPIOTE channel used for radio pin toggling */ +} ble_common_opt_pa_lna_t; + +/** + * @brief Configuration of extended BLE connection events. + * + * When enabled the SoftDevice will dynamically extend the connection event when possible. + * + * The connection event length is controlled by the connection configuration as set by @ref ble_gap_conn_cfg_t::event_length. + * The connection event can be extended if there is time to send another packet pair before the start of the next connection interval, + * and if there are no conflicts with other BLE roles requesting radio time. + * + * @note @ref sd_ble_opt_get is not supported for this option. + */ +typedef struct +{ + uint8_t enable : 1; /**< Enable extended BLE connection events, disabled by default. */ +} ble_common_opt_conn_evt_ext_t; + +/** + * @brief Enable/disable extended RC calibration. + * + * If extended RC calibration is enabled and the internal RC oscillator (@ref NRF_CLOCK_LF_SRC_RC) is used as the SoftDevice + * LFCLK source, the SoftDevice as a peripheral will by default try to increase the receive window if two consecutive packets + * are not received. If it turns out that the packets were not received due to clock drift, the RC calibration is started. + * This calibration comes in addition to the periodic calibration that is configured by @ref sd_softdevice_enable(). When + * using only peripheral connections, the periodic calibration can therefore be configured with a much longer interval as the + * peripheral will be able to detect and adjust automatically to clock drift, and calibrate on demand. + * + * If extended RC calibration is disabled and the internal RC oscillator is used as the SoftDevice LFCLK source, the + * RC oscillator is calibrated periodically as configured by @ref sd_softdevice_enable(). + * + * @note @ref sd_ble_opt_get is not supported for this option. + */ +typedef struct +{ + uint8_t enable : 1; /**< Enable extended RC calibration, enabled by default. */ +} ble_common_opt_extended_rc_cal_t; + +/**@brief Option structure for common options. */ +typedef union +{ + ble_common_opt_pa_lna_t pa_lna; /**< Parameters for controlling PA and LNA pin toggling. */ + ble_common_opt_conn_evt_ext_t conn_evt_ext; /**< Parameters for enabling extended connection events. */ + ble_common_opt_extended_rc_cal_t extended_rc_cal; /**< Parameters for enabling extended RC calibration. */ +} ble_common_opt_t; + +/**@brief Common BLE Option type, wrapping the module specific options. */ +typedef union +{ + ble_common_opt_t common_opt; /**< COMMON options, opt_id in @ref BLE_COMMON_OPTS series. */ + ble_gap_opt_t gap_opt; /**< GAP option, opt_id in @ref BLE_GAP_OPTS series. */ +} ble_opt_t; + +/**@brief BLE connection configuration type, wrapping the module specific configurations, set with + * @ref sd_ble_cfg_set. + * + * @note Connection configurations don't have to be set. + * In the case that no configurations has been set, or fewer connection configurations has been set than enabled connections, + * the default connection configuration will be automatically added for the remaining connections. + * When creating connections with the default configuration, @ref BLE_CONN_CFG_TAG_DEFAULT should be used in + * place of @ref ble_conn_cfg_t::conn_cfg_tag. + * + * @sa sd_ble_gap_adv_start() + * @sa sd_ble_gap_connect() + * + * @mscs + * @mmsc{@ref BLE_CONN_CFG} + * @endmscs + + */ +typedef struct +{ + uint8_t conn_cfg_tag; /**< The application chosen tag it can use with the + @ref sd_ble_gap_adv_start() and @ref sd_ble_gap_connect() calls + to select this configuration when creating a connection. + Must be different for all connection configurations added and not @ref BLE_CONN_CFG_TAG_DEFAULT. */ + union { + ble_gap_conn_cfg_t gap_conn_cfg; /**< GAP connection configuration, cfg_id is @ref BLE_CONN_CFG_GAP. */ + ble_gattc_conn_cfg_t gattc_conn_cfg; /**< GATTC connection configuration, cfg_id is @ref BLE_CONN_CFG_GATTC. */ + ble_gatts_conn_cfg_t gatts_conn_cfg; /**< GATTS connection configuration, cfg_id is @ref BLE_CONN_CFG_GATTS. */ + ble_gatt_conn_cfg_t gatt_conn_cfg; /**< GATT connection configuration, cfg_id is @ref BLE_CONN_CFG_GATT. */ + ble_l2cap_conn_cfg_t l2cap_conn_cfg; /**< L2CAP connection configuration, cfg_id is @ref BLE_CONN_CFG_L2CAP. */ + } params; /**< Connection configuration union. */ +} ble_conn_cfg_t; + +/** + * @brief Configuration of Vendor Specific base UUIDs, set with @ref sd_ble_cfg_set. + * + * @retval ::NRF_ERROR_INVALID_PARAM Too many UUIDs configured. + */ +typedef struct +{ + uint8_t vs_uuid_count; /**< Number of 128-bit Vendor Specific base UUID bases to allocate memory for. + Default value is @ref BLE_UUID_VS_COUNT_DEFAULT. Maximum value is + @ref BLE_UUID_VS_COUNT_MAX. */ +} ble_common_cfg_vs_uuid_t; + +/**@brief Common BLE Configuration type, wrapping the common configurations. */ +typedef union +{ + ble_common_cfg_vs_uuid_t vs_uuid_cfg; /**< Vendor Specific base UUID configuration, cfg_id is @ref BLE_COMMON_CFG_VS_UUID. */ +} ble_common_cfg_t; + +/**@brief BLE Configuration type, wrapping the module specific configurations. */ +typedef union +{ + ble_conn_cfg_t conn_cfg; /**< Connection specific configurations, cfg_id in @ref BLE_CONN_CFGS series. */ + ble_common_cfg_t common_cfg; /**< Global common configurations, cfg_id in @ref BLE_COMMON_CFGS series. */ + ble_gap_cfg_t gap_cfg; /**< Global GAP configurations, cfg_id in @ref BLE_GAP_CFGS series. */ + ble_gatts_cfg_t gatts_cfg; /**< Global GATTS configuration, cfg_id in @ref BLE_GATTS_CFGS series. */ +} ble_cfg_t; + +/** @} */ + +/** @addtogroup BLE_COMMON_FUNCTIONS Functions + * @{ */ + +/**@brief Enable the BLE stack + * + * @param[in, out] p_app_ram_base Pointer to a variable containing the start address of the + * application RAM region (APP_RAM_BASE). On return, this will + * contain the minimum start address of the application RAM region + * required by the SoftDevice for this configuration. + * @warning After this call, the SoftDevice may generate several events. The list of events provided + * below require the application to initiate a SoftDevice API call. The corresponding API call + * is referenced in the event documentation. + * If the application fails to do so, the BLE connection may timeout, or the SoftDevice may stop + * communicating with the peer device. + * - @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST + * - @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST + * - @ref BLE_GAP_EVT_PHY_UPDATE_REQUEST + * - @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST + * - @ref BLE_GAP_EVT_SEC_INFO_REQUEST + * - @ref BLE_GAP_EVT_SEC_REQUEST + * - @ref BLE_GAP_EVT_AUTH_KEY_REQUEST + * - @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST + * - @ref BLE_EVT_USER_MEM_REQUEST + * - @ref BLE_L2CAP_EVT_CH_SETUP_REQUEST + * + * @note The memory requirement for a specific configuration will not increase between SoftDevices + * with the same major version number. + * + * @note At runtime the IC's RAM is split into 2 regions: The SoftDevice RAM region is located + * between 0x20000000 and APP_RAM_BASE-1 and the application's RAM region is located between + * APP_RAM_BASE and the start of the call stack. + * + * @details This call initializes the BLE stack, no BLE related function other than @ref + * sd_ble_cfg_set can be called before this one. + * + * @mscs + * @mmsc{@ref BLE_COMMON_ENABLE} + * @endmscs + * + * @retval ::NRF_SUCCESS The BLE stack has been initialized successfully. + * @retval ::NRF_ERROR_INVALID_STATE The BLE stack had already been initialized and cannot be reinitialized. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied. + * @retval ::NRF_ERROR_NO_MEM One or more of the following is true: + * - The amount of memory assigned to the SoftDevice by *p_app_ram_base is not + * large enough to fit this configuration's memory requirement. Check *p_app_ram_base + * and set the start address of the application RAM region accordingly. + * - Dynamic part of the SoftDevice RAM region is larger then 64 kB which + * is currently not supported. + * @retval ::NRF_ERROR_RESOURCES The total number of L2CAP Channels configured using @ref sd_ble_cfg_set is too large. + */ +SVCALL(SD_BLE_ENABLE, uint32_t, sd_ble_enable(uint32_t * p_app_ram_base)); + +/**@brief Add configurations for the BLE stack + * + * @param[in] cfg_id Config ID, see @ref BLE_CONN_CFGS, @ref BLE_COMMON_CFGS, @ref + * BLE_GAP_CFGS or @ref BLE_GATTS_CFGS. + * @param[in] p_cfg Pointer to a ble_cfg_t structure containing the configuration value. + * @param[in] app_ram_base The start address of the application RAM region (APP_RAM_BASE). + * See @ref sd_ble_enable for details about APP_RAM_BASE. + * + * @note The memory requirement for a specific configuration will not increase between SoftDevices + * with the same major version number. + * + * @note If a configuration is set more than once, the last one set is the one that takes effect on + * @ref sd_ble_enable. + * + * @note Any part of the BLE stack that is NOT configured with @ref sd_ble_cfg_set will have default + * configuration. + * + * @note @ref sd_ble_cfg_set may be called at any time when the SoftDevice is enabled (see @ref + * sd_softdevice_enable) while the BLE part of the SoftDevice is not enabled (see @ref + * sd_ble_enable). + * + * @note Error codes for the configurations are described in the configuration structs. + * + * @mscs + * @mmsc{@ref BLE_COMMON_ENABLE} + * @endmscs + * + * @retval ::NRF_SUCCESS The configuration has been added successfully. + * @retval ::NRF_ERROR_INVALID_STATE The BLE stack had already been initialized. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid cfg_id supplied. + * @retval ::NRF_ERROR_NO_MEM The amount of memory assigned to the SoftDevice by app_ram_base is not + * large enough to fit this configuration's memory requirement. + */ +SVCALL(SD_BLE_CFG_SET, uint32_t, sd_ble_cfg_set(uint32_t cfg_id, ble_cfg_t const * p_cfg, uint32_t app_ram_base)); + +/**@brief Get an event from the pending events queue. + * + * @param[out] p_dest Pointer to buffer to be filled in with an event, or NULL to retrieve the event length. + * This buffer must be aligned to the extend defined by @ref BLE_EVT_PTR_ALIGNMENT. + * The buffer should be interpreted as a @ref ble_evt_t struct. + * @param[in, out] p_len Pointer the length of the buffer, on return it is filled with the event length. + * + * @details This call allows the application to pull a BLE event from the BLE stack. The application is signaled that + * an event is available from the BLE stack by the triggering of the SD_EVT_IRQn interrupt. + * The application is free to choose whether to call this function from thread mode (main context) or directly from the + * Interrupt Service Routine that maps to SD_EVT_IRQn. In any case however, and because the BLE stack runs at a higher + * priority than the application, this function should be called in a loop (until @ref NRF_ERROR_NOT_FOUND is returned) + * every time SD_EVT_IRQn is raised to ensure that all available events are pulled from the BLE stack. Failure to do so + * could potentially leave events in the internal queue without the application being aware of this fact. + * + * Sizing the p_dest buffer is equally important, since the application needs to provide all the memory necessary for the event to + * be copied into application memory. If the buffer provided is not large enough to fit the entire contents of the event, + * @ref NRF_ERROR_DATA_SIZE will be returned and the application can then call again with a larger buffer size. + * The maximum possible event length is defined by @ref BLE_EVT_LEN_MAX. The application may also "peek" the event length + * by providing p_dest as a NULL pointer and inspecting the value of *p_len upon return: + * + * \code + * uint16_t len; + * errcode = sd_ble_evt_get(NULL, &len); + * \endcode + * + * @mscs + * @mmsc{@ref BLE_COMMON_IRQ_EVT_MSC} + * @mmsc{@ref BLE_COMMON_THREAD_EVT_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS Event pulled and stored into the supplied buffer. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied. + * @retval ::NRF_ERROR_NOT_FOUND No events ready to be pulled. + * @retval ::NRF_ERROR_DATA_SIZE Event ready but could not fit into the supplied buffer. + */ +SVCALL(SD_BLE_EVT_GET, uint32_t, sd_ble_evt_get(uint8_t *p_dest, uint16_t *p_len)); + + +/**@brief Add a Vendor Specific base UUID. + * + * @details This call enables the application to add a Vendor Specific base UUID to the BLE stack's table, for later + * use with all other modules and APIs. This then allows the application to use the shorter, 24-bit @ref ble_uuid_t + * format when dealing with both 16-bit and 128-bit UUIDs without having to check for lengths and having split code + * paths. This is accomplished by extending the grouping mechanism that the Bluetooth SIG standard base UUID uses + * for all other 128-bit UUIDs. The type field in the @ref ble_uuid_t structure is an index (relative to + * @ref BLE_UUID_TYPE_VENDOR_BEGIN) to the table populated by multiple calls to this function, and the UUID field + * in the same structure contains the 2 bytes at indexes 12 and 13. The number of possible 128-bit UUIDs available to + * the application is therefore the number of Vendor Specific UUIDs added with the help of this function times 65536, + * although restricted to modifying bytes 12 and 13 for each of the entries in the supplied array. + * + * @note Bytes 12 and 13 of the provided UUID will not be used internally, since those are always replaced by + * the 16-bit uuid field in @ref ble_uuid_t. + * + * @note If a UUID is already present in the BLE stack's internal table, the corresponding index will be returned in + * p_uuid_type along with an @ref NRF_SUCCESS error code. + * + * @param[in] p_vs_uuid Pointer to a 16-octet (128-bit) little endian Vendor Specific base UUID disregarding + * bytes 12 and 13. + * @param[out] p_uuid_type Pointer to a uint8_t where the type field in @ref ble_uuid_t corresponding to this UUID will be stored. + * + * @retval ::NRF_SUCCESS Successfully added the Vendor Specific base UUID. + * @retval ::NRF_ERROR_INVALID_ADDR If p_vs_uuid or p_uuid_type is NULL or invalid. + * @retval ::NRF_ERROR_NO_MEM If there are no more free slots for VS UUIDs. + */ +SVCALL(SD_BLE_UUID_VS_ADD, uint32_t, sd_ble_uuid_vs_add(ble_uuid128_t const *p_vs_uuid, uint8_t *p_uuid_type)); + + +/**@brief Remove a Vendor Specific base UUID. + * + * @details This call removes a Vendor Specific base UUID that has been added with @ref sd_ble_uuid_vs_add. This function allows + * the application to reuse memory allocated for Vendor Specific base UUIDs. + * + * @note Currently this function can only be called with a p_uuid_type set to @ref BLE_UUID_TYPE_UNKNOWN or the last added UUID type. + * + * @param[inout] p_uuid_type Pointer to a uint8_t where its value matches the UUID type in @ref ble_uuid_t::type to be removed. + * If the type is set to @ref BLE_UUID_TYPE_UNKNOWN, or the pointer is NULL, the last Vendor Specific + * base UUID will be removed. If the function returns successfully, the UUID type that was removed will + * be written back to @p p_uuid_type. If function returns with a failure, it contains the last type that + * is in use by the ATT Server. + * + * @retval ::NRF_SUCCESS Successfully removed the Vendor Specific base UUID. + * @retval ::NRF_ERROR_INVALID_ADDR If p_uuid_type is invalid. + * @retval ::NRF_ERROR_INVALID_PARAM If p_uuid_type points to a non-valid UUID type. + * @retval ::NRF_ERROR_FORBIDDEN If the Vendor Specific base UUID is in use by the ATT Server. + */ +SVCALL(SD_BLE_UUID_VS_REMOVE, uint32_t, sd_ble_uuid_vs_remove(uint8_t *p_uuid_type)); + + +/** @brief Decode little endian raw UUID bytes (16-bit or 128-bit) into a 24 bit @ref ble_uuid_t structure. + * + * @details The raw UUID bytes excluding bytes 12 and 13 (i.e. bytes 0-11 and 14-15) of p_uuid_le are compared + * to the corresponding ones in each entry of the table of Vendor Specific base UUIDs populated with @ref sd_ble_uuid_vs_add + * to look for a match. If there is such a match, bytes 12 and 13 are returned as p_uuid->uuid and the index + * relative to @ref BLE_UUID_TYPE_VENDOR_BEGIN as p_uuid->type. + * + * @note If the UUID length supplied is 2, then the type set by this call will always be @ref BLE_UUID_TYPE_BLE. + * + * @param[in] uuid_le_len Length in bytes of the buffer pointed to by p_uuid_le (must be 2 or 16 bytes). + * @param[in] p_uuid_le Pointer pointing to little endian raw UUID bytes. + * @param[out] p_uuid Pointer to a @ref ble_uuid_t structure to be filled in. + * + * @retval ::NRF_SUCCESS Successfully decoded into the @ref ble_uuid_t structure. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_LENGTH Invalid UUID length. + * @retval ::NRF_ERROR_NOT_FOUND For a 128-bit UUID, no match in the populated table of UUIDs. + */ +SVCALL(SD_BLE_UUID_DECODE, uint32_t, sd_ble_uuid_decode(uint8_t uuid_le_len, uint8_t const *p_uuid_le, ble_uuid_t *p_uuid)); + + +/** @brief Encode a @ref ble_uuid_t structure into little endian raw UUID bytes (16-bit or 128-bit). + * + * @note The pointer to the destination buffer p_uuid_le may be NULL, in which case only the validity and size of p_uuid is computed. + * + * @param[in] p_uuid Pointer to a @ref ble_uuid_t structure that will be encoded into bytes. + * @param[out] p_uuid_le_len Pointer to a uint8_t that will be filled with the encoded length (2 or 16 bytes). + * @param[out] p_uuid_le Pointer to a buffer where the little endian raw UUID bytes (2 or 16) will be stored. + * + * @retval ::NRF_SUCCESS Successfully encoded into the buffer. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid UUID type. + */ +SVCALL(SD_BLE_UUID_ENCODE, uint32_t, sd_ble_uuid_encode(ble_uuid_t const *p_uuid, uint8_t *p_uuid_le_len, uint8_t *p_uuid_le)); + + +/**@brief Get Version Information. + * + * @details This call allows the application to get the BLE stack version information. + * + * @param[out] p_version Pointer to a ble_version_t structure to be filled in. + * + * @retval ::NRF_SUCCESS Version information stored successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY The BLE stack is busy (typically doing a locally-initiated disconnection procedure). + */ +SVCALL(SD_BLE_VERSION_GET, uint32_t, sd_ble_version_get(ble_version_t *p_version)); + + +/**@brief Provide a user memory block. + * + * @note This call can only be used as a response to a @ref BLE_EVT_USER_MEM_REQUEST event issued to the application. + * + * @param[in] conn_handle Connection handle. + * @param[in] p_block Pointer to a user memory block structure or NULL if memory is managed by the application. + * + * @mscs + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_NOAUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS Successfully queued a response to the peer. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_LENGTH Invalid user memory block length supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection state or no user memory request pending. + */ +SVCALL(SD_BLE_USER_MEM_REPLY, uint32_t, sd_ble_user_mem_reply(uint16_t conn_handle, ble_user_mem_block_t const *p_block)); + +/**@brief Set a BLE option. + * + * @details This call allows the application to set the value of an option. + * + * @param[in] opt_id Option ID, see @ref BLE_COMMON_OPTS and @ref BLE_GAP_OPTS. + * @param[in] p_opt Pointer to a ble_opt_t structure containing the option value. + * + * @retval ::NRF_SUCCESS Option set successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints. + * @retval ::NRF_ERROR_INVALID_STATE Unable to set the parameter at this time. + * @retval ::NRF_ERROR_BUSY The BLE stack is busy or the previous procedure has not completed. + */ +SVCALL(SD_BLE_OPT_SET, uint32_t, sd_ble_opt_set(uint32_t opt_id, ble_opt_t const *p_opt)); + + +/**@brief Get a BLE option. + * + * @details This call allows the application to retrieve the value of an option. + * + * @param[in] opt_id Option ID, see @ref BLE_COMMON_OPTS and @ref BLE_GAP_OPTS. + * @param[out] p_opt Pointer to a ble_opt_t structure to be filled in. + * + * @retval ::NRF_SUCCESS Option retrieved successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints. + * @retval ::NRF_ERROR_INVALID_STATE Unable to retrieve the parameter at this time. + * @retval ::NRF_ERROR_BUSY The BLE stack is busy or the previous procedure has not completed. + * @retval ::NRF_ERROR_NOT_SUPPORTED This option is not supported. + * + */ +SVCALL(SD_BLE_OPT_GET, uint32_t, sd_ble_opt_get(uint32_t opt_id, ble_opt_t *p_opt)); + +/** @} */ +#ifdef __cplusplus +} +#endif +#endif /* BLE_H__ */ + +/** + @} + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_err.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_err.h new file mode 100644 index 0000000000..1b4820dc3d --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_err.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2012 - 2018, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_COMMON + @{ + @addtogroup nrf_error + @{ + @ingroup BLE_COMMON + @} + + @defgroup ble_err General error codes + @{ + + @brief General error code definitions for the BLE API. + + @ingroup BLE_COMMON +*/ +#ifndef NRF_BLE_ERR_H__ +#define NRF_BLE_ERR_H__ + +#include "nrf_error.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* @defgroup BLE_ERRORS Error Codes + * @{ */ +#define BLE_ERROR_NOT_ENABLED (NRF_ERROR_STK_BASE_NUM+0x001) /**< @ref sd_ble_enable has not been called. */ +#define BLE_ERROR_INVALID_CONN_HANDLE (NRF_ERROR_STK_BASE_NUM+0x002) /**< Invalid connection handle. */ +#define BLE_ERROR_INVALID_ATTR_HANDLE (NRF_ERROR_STK_BASE_NUM+0x003) /**< Invalid attribute handle. */ +#define BLE_ERROR_INVALID_ADV_HANDLE (NRF_ERROR_STK_BASE_NUM+0x004) /**< Invalid advertising handle. */ +#define BLE_ERROR_INVALID_ROLE (NRF_ERROR_STK_BASE_NUM+0x005) /**< Invalid role. */ +#define BLE_ERROR_BLOCKED_BY_OTHER_LINKS (NRF_ERROR_STK_BASE_NUM+0x006) /**< The attempt to change link settings failed due to the scheduling of other links. */ +/** @} */ + + +/** @defgroup BLE_ERROR_SUBRANGES Module specific error code subranges + * @brief Assignment of subranges for module specific error codes. + * @note For specific error codes, see ble_.h or ble_error_.h. + * @{ */ +#define NRF_L2CAP_ERR_BASE (NRF_ERROR_STK_BASE_NUM+0x100) /**< L2CAP specific errors. */ +#define NRF_GAP_ERR_BASE (NRF_ERROR_STK_BASE_NUM+0x200) /**< GAP specific errors. */ +#define NRF_GATTC_ERR_BASE (NRF_ERROR_STK_BASE_NUM+0x300) /**< GATT client specific errors. */ +#define NRF_GATTS_ERR_BASE (NRF_ERROR_STK_BASE_NUM+0x400) /**< GATT server specific errors. */ +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif + + +/** + @} + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gap.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gap.h new file mode 100644 index 0000000000..d657fd6c11 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gap.h @@ -0,0 +1,2851 @@ +/* + * Copyright (c) 2011 - 2020, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_GAP Generic Access Profile (GAP) + @{ + @brief Definitions and prototypes for the GAP interface. + */ + +#ifndef BLE_GAP_H__ +#define BLE_GAP_H__ + +#include +#include "nrf_svc.h" +#include "nrf_error.h" +#include "ble_hci.h" +#include "ble_ranges.h" +#include "ble_types.h" +#include "ble_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/**@addtogroup BLE_GAP_ENUMERATIONS Enumerations + * @{ */ + +/**@brief GAP API SVC numbers. + */ +enum BLE_GAP_SVCS +{ + SD_BLE_GAP_ADDR_SET = BLE_GAP_SVC_BASE, /**< Set own Bluetooth Address. */ + SD_BLE_GAP_ADDR_GET = BLE_GAP_SVC_BASE + 1, /**< Get own Bluetooth Address. */ + SD_BLE_GAP_WHITELIST_SET = BLE_GAP_SVC_BASE + 2, /**< Set active whitelist. */ + SD_BLE_GAP_DEVICE_IDENTITIES_SET = BLE_GAP_SVC_BASE + 3, /**< Set device identity list. */ + SD_BLE_GAP_PRIVACY_SET = BLE_GAP_SVC_BASE + 4, /**< Set Privacy settings*/ + SD_BLE_GAP_PRIVACY_GET = BLE_GAP_SVC_BASE + 5, /**< Get Privacy settings*/ + SD_BLE_GAP_ADV_SET_CONFIGURE = BLE_GAP_SVC_BASE + 6, /**< Configure an advertising set. */ + SD_BLE_GAP_ADV_START = BLE_GAP_SVC_BASE + 7, /**< Start Advertising. */ + SD_BLE_GAP_ADV_STOP = BLE_GAP_SVC_BASE + 8, /**< Stop Advertising. */ + SD_BLE_GAP_CONN_PARAM_UPDATE = BLE_GAP_SVC_BASE + 9, /**< Connection Parameter Update. */ + SD_BLE_GAP_DISCONNECT = BLE_GAP_SVC_BASE + 10, /**< Disconnect. */ + SD_BLE_GAP_TX_POWER_SET = BLE_GAP_SVC_BASE + 11, /**< Set TX Power. */ + SD_BLE_GAP_APPEARANCE_SET = BLE_GAP_SVC_BASE + 12, /**< Set Appearance. */ + SD_BLE_GAP_APPEARANCE_GET = BLE_GAP_SVC_BASE + 13, /**< Get Appearance. */ + SD_BLE_GAP_PPCP_SET = BLE_GAP_SVC_BASE + 14, /**< Set PPCP. */ + SD_BLE_GAP_PPCP_GET = BLE_GAP_SVC_BASE + 15, /**< Get PPCP. */ + SD_BLE_GAP_DEVICE_NAME_SET = BLE_GAP_SVC_BASE + 16, /**< Set Device Name. */ + SD_BLE_GAP_DEVICE_NAME_GET = BLE_GAP_SVC_BASE + 17, /**< Get Device Name. */ + SD_BLE_GAP_AUTHENTICATE = BLE_GAP_SVC_BASE + 18, /**< Initiate Pairing/Bonding. */ + SD_BLE_GAP_SEC_PARAMS_REPLY = BLE_GAP_SVC_BASE + 19, /**< Reply with Security Parameters. */ + SD_BLE_GAP_AUTH_KEY_REPLY = BLE_GAP_SVC_BASE + 20, /**< Reply with an authentication key. */ + SD_BLE_GAP_LESC_DHKEY_REPLY = BLE_GAP_SVC_BASE + 21, /**< Reply with an LE Secure Connections DHKey. */ + SD_BLE_GAP_KEYPRESS_NOTIFY = BLE_GAP_SVC_BASE + 22, /**< Notify of a keypress during an authentication procedure. */ + SD_BLE_GAP_LESC_OOB_DATA_GET = BLE_GAP_SVC_BASE + 23, /**< Get the local LE Secure Connections OOB data. */ + SD_BLE_GAP_LESC_OOB_DATA_SET = BLE_GAP_SVC_BASE + 24, /**< Set the remote LE Secure Connections OOB data. */ + SD_BLE_GAP_ENCRYPT = BLE_GAP_SVC_BASE + 25, /**< Initiate encryption procedure. */ + SD_BLE_GAP_SEC_INFO_REPLY = BLE_GAP_SVC_BASE + 26, /**< Reply with Security Information. */ + SD_BLE_GAP_CONN_SEC_GET = BLE_GAP_SVC_BASE + 27, /**< Obtain connection security level. */ + SD_BLE_GAP_RSSI_START = BLE_GAP_SVC_BASE + 28, /**< Start reporting of changes in RSSI. */ + SD_BLE_GAP_RSSI_STOP = BLE_GAP_SVC_BASE + 29, /**< Stop reporting of changes in RSSI. */ + SD_BLE_GAP_SCAN_START = BLE_GAP_SVC_BASE + 30, /**< Start Scanning. */ + SD_BLE_GAP_SCAN_STOP = BLE_GAP_SVC_BASE + 31, /**< Stop Scanning. */ + SD_BLE_GAP_CONNECT = BLE_GAP_SVC_BASE + 32, /**< Connect. */ + SD_BLE_GAP_CONNECT_CANCEL = BLE_GAP_SVC_BASE + 33, /**< Cancel ongoing connection procedure. */ + SD_BLE_GAP_RSSI_GET = BLE_GAP_SVC_BASE + 34, /**< Get the last RSSI sample. */ + SD_BLE_GAP_PHY_UPDATE = BLE_GAP_SVC_BASE + 35, /**< Initiate or respond to a PHY Update Procedure. */ + SD_BLE_GAP_DATA_LENGTH_UPDATE = BLE_GAP_SVC_BASE + 36, /**< Initiate or respond to a Data Length Update Procedure. */ + SD_BLE_GAP_QOS_CHANNEL_SURVEY_START = BLE_GAP_SVC_BASE + 37, /**< Start Quality of Service (QoS) channel survey module. */ + SD_BLE_GAP_QOS_CHANNEL_SURVEY_STOP = BLE_GAP_SVC_BASE + 38, /**< Stop Quality of Service (QoS) channel survey module. */ + SD_BLE_GAP_ADV_ADDR_GET = BLE_GAP_SVC_BASE + 39, /**< Get the Address used on air while Advertising. */ + SD_BLE_GAP_NEXT_CONN_EVT_COUNTER_GET = BLE_GAP_SVC_BASE + 40, /**< Get the next connection event counter. */ + SD_BLE_GAP_CONN_EVT_TRIGGER_START = BLE_GAP_SVC_BASE + 41, /** Start triggering a given task on connection event start. */ + SD_BLE_GAP_CONN_EVT_TRIGGER_STOP = BLE_GAP_SVC_BASE + 42, /** Stop triggering the task configured using @ref sd_ble_gap_conn_evt_trigger_start. */ +}; + +/**@brief GAP Event IDs. + * IDs that uniquely identify an event coming from the stack to the application. + */ +enum BLE_GAP_EVTS +{ + BLE_GAP_EVT_CONNECTED = BLE_GAP_EVT_BASE, /**< Connected to peer. \n See @ref ble_gap_evt_connected_t */ + BLE_GAP_EVT_DISCONNECTED = BLE_GAP_EVT_BASE + 1, /**< Disconnected from peer. \n See @ref ble_gap_evt_disconnected_t. */ + BLE_GAP_EVT_CONN_PARAM_UPDATE = BLE_GAP_EVT_BASE + 2, /**< Connection Parameters updated. \n See @ref ble_gap_evt_conn_param_update_t. */ + BLE_GAP_EVT_SEC_PARAMS_REQUEST = BLE_GAP_EVT_BASE + 3, /**< Request to provide security parameters. \n Reply with @ref sd_ble_gap_sec_params_reply. \n See @ref ble_gap_evt_sec_params_request_t. */ + BLE_GAP_EVT_SEC_INFO_REQUEST = BLE_GAP_EVT_BASE + 4, /**< Request to provide security information. \n Reply with @ref sd_ble_gap_sec_info_reply. \n See @ref ble_gap_evt_sec_info_request_t. */ + BLE_GAP_EVT_PASSKEY_DISPLAY = BLE_GAP_EVT_BASE + 5, /**< Request to display a passkey to the user. \n In LESC Numeric Comparison, reply with @ref sd_ble_gap_auth_key_reply. \n See @ref ble_gap_evt_passkey_display_t. */ + BLE_GAP_EVT_KEY_PRESSED = BLE_GAP_EVT_BASE + 6, /**< Notification of a keypress on the remote device.\n See @ref ble_gap_evt_key_pressed_t */ + BLE_GAP_EVT_AUTH_KEY_REQUEST = BLE_GAP_EVT_BASE + 7, /**< Request to provide an authentication key. \n Reply with @ref sd_ble_gap_auth_key_reply. \n See @ref ble_gap_evt_auth_key_request_t. */ + BLE_GAP_EVT_LESC_DHKEY_REQUEST = BLE_GAP_EVT_BASE + 8, /**< Request to calculate an LE Secure Connections DHKey. \n Reply with @ref sd_ble_gap_lesc_dhkey_reply. \n See @ref ble_gap_evt_lesc_dhkey_request_t */ + BLE_GAP_EVT_AUTH_STATUS = BLE_GAP_EVT_BASE + 9, /**< Authentication procedure completed with status. \n See @ref ble_gap_evt_auth_status_t. */ + BLE_GAP_EVT_CONN_SEC_UPDATE = BLE_GAP_EVT_BASE + 10, /**< Connection security updated. \n See @ref ble_gap_evt_conn_sec_update_t. */ + BLE_GAP_EVT_TIMEOUT = BLE_GAP_EVT_BASE + 11, /**< Timeout expired. \n See @ref ble_gap_evt_timeout_t. */ + BLE_GAP_EVT_RSSI_CHANGED = BLE_GAP_EVT_BASE + 12, /**< RSSI report. \n See @ref ble_gap_evt_rssi_changed_t. */ + BLE_GAP_EVT_ADV_REPORT = BLE_GAP_EVT_BASE + 13, /**< Advertising report. \n See @ref ble_gap_evt_adv_report_t. */ + BLE_GAP_EVT_SEC_REQUEST = BLE_GAP_EVT_BASE + 14, /**< Security Request. \n Reply with @ref sd_ble_gap_authenticate + \n or with @ref sd_ble_gap_encrypt if required security information is available +. \n See @ref ble_gap_evt_sec_request_t. */ + BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST = BLE_GAP_EVT_BASE + 15, /**< Connection Parameter Update Request. \n Reply with @ref sd_ble_gap_conn_param_update. \n See @ref ble_gap_evt_conn_param_update_request_t. */ + BLE_GAP_EVT_SCAN_REQ_REPORT = BLE_GAP_EVT_BASE + 16, /**< Scan request report. \n See @ref ble_gap_evt_scan_req_report_t. */ + BLE_GAP_EVT_PHY_UPDATE_REQUEST = BLE_GAP_EVT_BASE + 17, /**< PHY Update Request. \n Reply with @ref sd_ble_gap_phy_update. \n See @ref ble_gap_evt_phy_update_request_t. */ + BLE_GAP_EVT_PHY_UPDATE = BLE_GAP_EVT_BASE + 18, /**< PHY Update Procedure is complete. \n See @ref ble_gap_evt_phy_update_t. */ + BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST = BLE_GAP_EVT_BASE + 19, /**< Data Length Update Request. \n Reply with @ref sd_ble_gap_data_length_update. \n See @ref ble_gap_evt_data_length_update_request_t. */ + BLE_GAP_EVT_DATA_LENGTH_UPDATE = BLE_GAP_EVT_BASE + 20, /**< LL Data Channel PDU payload length updated. \n See @ref ble_gap_evt_data_length_update_t. */ + BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT = BLE_GAP_EVT_BASE + 21, /**< Channel survey report. \n See @ref ble_gap_evt_qos_channel_survey_report_t. */ + BLE_GAP_EVT_ADV_SET_TERMINATED = BLE_GAP_EVT_BASE + 22, /**< Advertising set terminated. \n See @ref ble_gap_evt_adv_set_terminated_t. */ +}; + +/**@brief GAP Option IDs. + * IDs that uniquely identify a GAP option. + */ +enum BLE_GAP_OPTS +{ + BLE_GAP_OPT_CH_MAP = BLE_GAP_OPT_BASE, /**< Channel Map. @ref ble_gap_opt_ch_map_t */ + BLE_GAP_OPT_LOCAL_CONN_LATENCY = BLE_GAP_OPT_BASE + 1, /**< Local connection latency. @ref ble_gap_opt_local_conn_latency_t */ + BLE_GAP_OPT_PASSKEY = BLE_GAP_OPT_BASE + 2, /**< Set passkey. @ref ble_gap_opt_passkey_t */ + BLE_GAP_OPT_COMPAT_MODE_1 = BLE_GAP_OPT_BASE + 3, /**< Compatibility mode. @ref ble_gap_opt_compat_mode_1_t */ + BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT = BLE_GAP_OPT_BASE + 4, /**< Set Authenticated payload timeout. @ref ble_gap_opt_auth_payload_timeout_t */ + BLE_GAP_OPT_SLAVE_LATENCY_DISABLE = BLE_GAP_OPT_BASE + 5, /**< Disable slave latency. @ref ble_gap_opt_slave_latency_disable_t */ +}; + +/**@brief GAP Configuration IDs. + * + * IDs that uniquely identify a GAP configuration. + */ +enum BLE_GAP_CFGS +{ + BLE_GAP_CFG_ROLE_COUNT = BLE_GAP_CFG_BASE, /**< Role count configuration. */ + BLE_GAP_CFG_DEVICE_NAME = BLE_GAP_CFG_BASE + 1, /**< Device name configuration. */ + BLE_GAP_CFG_PPCP_INCL_CONFIG = BLE_GAP_CFG_BASE + 2, /**< Peripheral Preferred Connection Parameters characteristic + inclusion configuration. */ + BLE_GAP_CFG_CAR_INCL_CONFIG = BLE_GAP_CFG_BASE + 3, /**< Central Address Resolution characteristic + inclusion configuration. */ +}; + +/**@brief GAP TX Power roles. + */ +enum BLE_GAP_TX_POWER_ROLES +{ + BLE_GAP_TX_POWER_ROLE_ADV = 1, /**< Advertiser role. */ + BLE_GAP_TX_POWER_ROLE_SCAN_INIT = 2, /**< Scanner and initiator role. */ + BLE_GAP_TX_POWER_ROLE_CONN = 3, /**< Connection role. */ +}; + +/** @} */ + +/**@addtogroup BLE_GAP_DEFINES Defines + * @{ */ + +/**@defgroup BLE_ERRORS_GAP SVC return values specific to GAP + * @{ */ +#define BLE_ERROR_GAP_UUID_LIST_MISMATCH (NRF_GAP_ERR_BASE + 0x000) /**< UUID list does not contain an integral number of UUIDs. */ +#define BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST (NRF_GAP_ERR_BASE + 0x001) /**< Use of Whitelist not permitted with discoverable advertising. */ +#define BLE_ERROR_GAP_INVALID_BLE_ADDR (NRF_GAP_ERR_BASE + 0x002) /**< The upper two bits of the address do not correspond to the specified address type. */ +#define BLE_ERROR_GAP_WHITELIST_IN_USE (NRF_GAP_ERR_BASE + 0x003) /**< Attempt to modify the whitelist while already in use by another operation. */ +#define BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE (NRF_GAP_ERR_BASE + 0x004) /**< Attempt to modify the device identity list while already in use by another operation. */ +#define BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE (NRF_GAP_ERR_BASE + 0x005) /**< The device identity list contains entries with duplicate identity addresses. */ +/**@} */ + + +/**@defgroup BLE_GAP_ROLES GAP Roles + * @{ */ +#define BLE_GAP_ROLE_INVALID 0x0 /**< Invalid Role. */ +#define BLE_GAP_ROLE_PERIPH 0x1 /**< Peripheral Role. */ +#define BLE_GAP_ROLE_CENTRAL 0x2 /**< Central Role. */ +/**@} */ + + +/**@defgroup BLE_GAP_TIMEOUT_SOURCES GAP Timeout sources + * @{ */ +#define BLE_GAP_TIMEOUT_SRC_SCAN 0x01 /**< Scanning timeout. */ +#define BLE_GAP_TIMEOUT_SRC_CONN 0x02 /**< Connection timeout. */ +#define BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD 0x03 /**< Authenticated payload timeout. */ +/**@} */ + + +/**@defgroup BLE_GAP_ADDR_TYPES GAP Address types + * @{ */ +#define BLE_GAP_ADDR_TYPE_PUBLIC 0x00 /**< Public (identity) address.*/ +#define BLE_GAP_ADDR_TYPE_RANDOM_STATIC 0x01 /**< Random static (identity) address. */ +#define BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE 0x02 /**< Random private resolvable address. */ +#define BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE 0x03 /**< Random private non-resolvable address. */ +#define BLE_GAP_ADDR_TYPE_ANONYMOUS 0x7F /**< An advertiser may advertise without its address. + This type of advertising is called anonymous. */ +/**@} */ + + +/**@brief The default interval in seconds at which a private address is refreshed. */ +#define BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S (900) /* 15 minutes. */ +/**@brief The maximum interval in seconds at which a private address can be refreshed. */ +#define BLE_GAP_MAX_PRIVATE_ADDR_CYCLE_INTERVAL_S (41400) /* 11 hours 30 minutes. */ + + +/** @brief BLE address length. */ +#define BLE_GAP_ADDR_LEN (6) + +/**@defgroup BLE_GAP_PRIVACY_MODES Privacy modes + * @{ */ +#define BLE_GAP_PRIVACY_MODE_OFF 0x00 /**< Device will send and accept its identity address for its own address. */ +#define BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY 0x01 /**< Device will send and accept only private addresses for its own address. */ +#define BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY 0x02 /**< Device will send and accept only private addresses for its own address, + and will not accept a peer using identity address as sender address when + the peer IRK is exchanged, non-zero and added to the identity list. */ +/**@} */ + +/** @brief Invalid power level. */ +#define BLE_GAP_POWER_LEVEL_INVALID 127 + +/** @brief Advertising set handle not set. */ +#define BLE_GAP_ADV_SET_HANDLE_NOT_SET (0xFF) + +/** @brief The default number of advertising sets. */ +#define BLE_GAP_ADV_SET_COUNT_DEFAULT (1) + +/** @brief The maximum number of advertising sets supported by this SoftDevice. */ +#define BLE_GAP_ADV_SET_COUNT_MAX (1) + +/**@defgroup BLE_GAP_ADV_SET_DATA_SIZES Advertising data sizes. + * @{ */ +#define BLE_GAP_ADV_SET_DATA_SIZE_MAX (31) /**< Maximum data length for an advertising set. + If more advertising data is required, use extended advertising instead. */ +#define BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED (255) /**< Maximum supported data length for an extended advertising set. */ + +#define BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED (238) /**< Maximum supported data length for an extended connectable advertising set. */ +/**@}. */ + +/** @brief Set ID not available in advertising report. */ +#define BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE 0xFF + +/**@defgroup BLE_GAP_EVT_ADV_SET_TERMINATED_REASON GAP Advertising Set Terminated reasons + * @{ */ +#define BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_TIMEOUT 0x01 /**< Timeout value reached. */ +#define BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_LIMIT_REACHED 0x02 /**< @ref ble_gap_adv_params_t::max_adv_evts was reached. */ +/**@} */ + +/**@defgroup BLE_GAP_AD_TYPE_DEFINITIONS GAP Advertising and Scan Response Data format + * @note Found at https://www.bluetooth.org/Technical/AssignedNumbers/generic_access_profile.htm + * @{ */ +#define BLE_GAP_AD_TYPE_FLAGS 0x01 /**< Flags for discoverability. */ +#define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE 0x02 /**< Partial list of 16 bit service UUIDs. */ +#define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE 0x03 /**< Complete list of 16 bit service UUIDs. */ +#define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE 0x04 /**< Partial list of 32 bit service UUIDs. */ +#define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE 0x05 /**< Complete list of 32 bit service UUIDs. */ +#define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE 0x06 /**< Partial list of 128 bit service UUIDs. */ +#define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE 0x07 /**< Complete list of 128 bit service UUIDs. */ +#define BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME 0x08 /**< Short local device name. */ +#define BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME 0x09 /**< Complete local device name. */ +#define BLE_GAP_AD_TYPE_TX_POWER_LEVEL 0x0A /**< Transmit power level. */ +#define BLE_GAP_AD_TYPE_CLASS_OF_DEVICE 0x0D /**< Class of device. */ +#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C 0x0E /**< Simple Pairing Hash C. */ +#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R 0x0F /**< Simple Pairing Randomizer R. */ +#define BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE 0x10 /**< Security Manager TK Value. */ +#define BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS 0x11 /**< Security Manager Out Of Band Flags. */ +#define BLE_GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE 0x12 /**< Slave Connection Interval Range. */ +#define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT 0x14 /**< List of 16-bit Service Solicitation UUIDs. */ +#define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT 0x15 /**< List of 128-bit Service Solicitation UUIDs. */ +#define BLE_GAP_AD_TYPE_SERVICE_DATA 0x16 /**< Service Data - 16-bit UUID. */ +#define BLE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS 0x17 /**< Public Target Address. */ +#define BLE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS 0x18 /**< Random Target Address. */ +#define BLE_GAP_AD_TYPE_APPEARANCE 0x19 /**< Appearance. */ +#define BLE_GAP_AD_TYPE_ADVERTISING_INTERVAL 0x1A /**< Advertising Interval. */ +#define BLE_GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS 0x1B /**< LE Bluetooth Device Address. */ +#define BLE_GAP_AD_TYPE_LE_ROLE 0x1C /**< LE Role. */ +#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256 0x1D /**< Simple Pairing Hash C-256. */ +#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256 0x1E /**< Simple Pairing Randomizer R-256. */ +#define BLE_GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID 0x20 /**< Service Data - 32-bit UUID. */ +#define BLE_GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID 0x21 /**< Service Data - 128-bit UUID. */ +#define BLE_GAP_AD_TYPE_LESC_CONFIRMATION_VALUE 0x22 /**< LE Secure Connections Confirmation Value */ +#define BLE_GAP_AD_TYPE_LESC_RANDOM_VALUE 0x23 /**< LE Secure Connections Random Value */ +#define BLE_GAP_AD_TYPE_URI 0x24 /**< URI */ +#define BLE_GAP_AD_TYPE_3D_INFORMATION_DATA 0x3D /**< 3D Information Data. */ +#define BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA 0xFF /**< Manufacturer Specific Data. */ +/**@} */ + + +/**@defgroup BLE_GAP_ADV_FLAGS GAP Advertisement Flags + * @{ */ +#define BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE (0x01) /**< LE Limited Discoverable Mode. */ +#define BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE (0x02) /**< LE General Discoverable Mode. */ +#define BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED (0x04) /**< BR/EDR not supported. */ +#define BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER (0x08) /**< Simultaneous LE and BR/EDR, Controller. */ +#define BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST (0x10) /**< Simultaneous LE and BR/EDR, Host. */ +#define BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE (BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED) /**< LE Limited Discoverable Mode, BR/EDR not supported. */ +#define BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE (BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED) /**< LE General Discoverable Mode, BR/EDR not supported. */ +/**@} */ + + +/**@defgroup BLE_GAP_ADV_INTERVALS GAP Advertising interval max and min + * @{ */ +#define BLE_GAP_ADV_INTERVAL_MIN 0x000020 /**< Minimum Advertising interval in 625 us units, i.e. 20 ms. */ +#define BLE_GAP_ADV_INTERVAL_MAX 0x004000 /**< Maximum Advertising interval in 625 us units, i.e. 10.24 s. */ + /**@} */ + + +/**@defgroup BLE_GAP_SCAN_INTERVALS GAP Scan interval max and min + * @{ */ +#define BLE_GAP_SCAN_INTERVAL_MIN 0x0004 /**< Minimum Scan interval in 625 us units, i.e. 2.5 ms. */ +#define BLE_GAP_SCAN_INTERVAL_MAX 0xFFFF /**< Maximum Scan interval in 625 us units, i.e. 40,959.375 s. */ + /** @} */ + + +/**@defgroup BLE_GAP_SCAN_WINDOW GAP Scan window max and min + * @{ */ +#define BLE_GAP_SCAN_WINDOW_MIN 0x0004 /**< Minimum Scan window in 625 us units, i.e. 2.5 ms. */ +#define BLE_GAP_SCAN_WINDOW_MAX 0xFFFF /**< Maximum Scan window in 625 us units, i.e. 40,959.375 s. */ + /** @} */ + + +/**@defgroup BLE_GAP_SCAN_TIMEOUT GAP Scan timeout max and min + * @{ */ +#define BLE_GAP_SCAN_TIMEOUT_MIN 0x0001 /**< Minimum Scan timeout in 10 ms units, i.e 10 ms. */ +#define BLE_GAP_SCAN_TIMEOUT_UNLIMITED 0x0000 /**< Continue to scan forever. */ + /** @} */ + +/**@defgroup BLE_GAP_SCAN_BUFFER_SIZE GAP Minimum scanner buffer size + * + * Scan buffers are used for storing advertising data received from an advertiser. + * If ble_gap_scan_params_t::extended is set to 0, @ref BLE_GAP_SCAN_BUFFER_MIN is the minimum scan buffer length. + * else the minimum scan buffer size is @ref BLE_GAP_SCAN_BUFFER_EXTENDED_MIN. + * @{ */ +#define BLE_GAP_SCAN_BUFFER_MIN (31) /**< Minimum data length for an + advertising set. */ +#define BLE_GAP_SCAN_BUFFER_MAX (31) /**< Maximum data length for an + advertising set. */ +#define BLE_GAP_SCAN_BUFFER_EXTENDED_MIN (255) /**< Minimum data length for an + extended advertising set. */ +#define BLE_GAP_SCAN_BUFFER_EXTENDED_MAX (1650) /**< Maximum data length for an + extended advertising set. */ +#define BLE_GAP_SCAN_BUFFER_EXTENDED_MAX_SUPPORTED (255) /**< Maximum supported data length for + an extended advertising set. */ +/** @} */ + +/**@defgroup BLE_GAP_ADV_TYPES GAP Advertising types + * + * Advertising types defined in Bluetooth Core Specification v5.0, Vol 6, Part B, Section 4.4.2. + * + * The maximum advertising data length is defined by @ref BLE_GAP_ADV_SET_DATA_SIZE_MAX. + * The maximum supported data length for an extended advertiser is defined by + * @ref BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED + * Note that some of the advertising types do not support advertising data. Non-scannable types do not support + * scan response data. + * + * @{ */ +#define BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED 0x01 /**< Connectable and scannable undirected + advertising events. */ +#define BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE 0x02 /**< Connectable non-scannable directed advertising + events. Advertising interval is less that 3.75 ms. + Use this type for fast reconnections. + @note Advertising data is not supported. */ +#define BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED 0x03 /**< Connectable non-scannable directed advertising + events. + @note Advertising data is not supported. */ +#define BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED 0x04 /**< Non-connectable scannable undirected + advertising events. */ +#define BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED 0x05 /**< Non-connectable non-scannable undirected + advertising events. */ +#define BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED 0x06 /**< Connectable non-scannable undirected advertising + events using extended advertising PDUs. */ +#define BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_DIRECTED 0x07 /**< Connectable non-scannable directed advertising + events using extended advertising PDUs. */ +#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED 0x08 /**< Non-connectable scannable undirected advertising + events using extended advertising PDUs. + @note Only scan response data is supported. */ +#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_DIRECTED 0x09 /**< Non-connectable scannable directed advertising + events using extended advertising PDUs. + @note Only scan response data is supported. */ +#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED 0x0A /**< Non-connectable non-scannable undirected advertising + events using extended advertising PDUs. */ +#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_DIRECTED 0x0B /**< Non-connectable non-scannable directed advertising + events using extended advertising PDUs. */ +/**@} */ + +/**@defgroup BLE_GAP_ADV_FILTER_POLICIES GAP Advertising filter policies + * @{ */ +#define BLE_GAP_ADV_FP_ANY 0x00 /**< Allow scan requests and connect requests from any device. */ +#define BLE_GAP_ADV_FP_FILTER_SCANREQ 0x01 /**< Filter scan requests with whitelist. */ +#define BLE_GAP_ADV_FP_FILTER_CONNREQ 0x02 /**< Filter connect requests with whitelist. */ +#define BLE_GAP_ADV_FP_FILTER_BOTH 0x03 /**< Filter both scan and connect requests with whitelist. */ +/**@} */ + +/**@defgroup BLE_GAP_ADV_DATA_STATUS GAP Advertising data status + * @{ */ +#define BLE_GAP_ADV_DATA_STATUS_COMPLETE 0x00 /**< All data in the advertising event have been received. */ +#define BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA 0x01 /**< More data to be received. + @note This value will only be used if + @ref ble_gap_scan_params_t::report_incomplete_evts and + @ref ble_gap_adv_report_type_t::extended_pdu are set to true. */ +#define BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_TRUNCATED 0x02 /**< Incomplete data. Buffer size insufficient to receive more. + @note This value will only be used if + @ref ble_gap_adv_report_type_t::extended_pdu is set to true. */ +#define BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MISSED 0x03 /**< Failed to receive the remaining data. + @note This value will only be used if + @ref ble_gap_adv_report_type_t::extended_pdu is set to true. */ +/**@} */ + +/**@defgroup BLE_GAP_SCAN_FILTER_POLICIES GAP Scanner filter policies + * @{ */ +#define BLE_GAP_SCAN_FP_ACCEPT_ALL 0x00 /**< Accept all advertising packets except directed advertising packets + not addressed to this device. */ +#define BLE_GAP_SCAN_FP_WHITELIST 0x01 /**< Accept advertising packets from devices in the whitelist except directed + packets not addressed to this device. */ +#define BLE_GAP_SCAN_FP_ALL_NOT_RESOLVED_DIRECTED 0x02 /**< Accept all advertising packets specified in @ref BLE_GAP_SCAN_FP_ACCEPT_ALL. + In addition, accept directed advertising packets, where the advertiser's + address is a resolvable private address that cannot be resolved. */ +#define BLE_GAP_SCAN_FP_WHITELIST_NOT_RESOLVED_DIRECTED 0x03 /**< Accept all advertising packets specified in @ref BLE_GAP_SCAN_FP_WHITELIST. + In addition, accept directed advertising packets, where the advertiser's + address is a resolvable private address that cannot be resolved. */ +/**@} */ + +/**@defgroup BLE_GAP_ADV_TIMEOUT_VALUES GAP Advertising timeout values in 10 ms units + * @{ */ +#define BLE_GAP_ADV_TIMEOUT_HIGH_DUTY_MAX (128) /**< Maximum high duty advertising time in 10 ms units. Corresponds to 1.28 s. */ +#define BLE_GAP_ADV_TIMEOUT_LIMITED_MAX (18000) /**< Maximum advertising time in 10 ms units corresponding to TGAP(lim_adv_timeout) = 180 s in limited discoverable mode. */ +#define BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED (0) /**< Unlimited advertising in general discoverable mode. + For high duty cycle advertising, this corresponds to @ref BLE_GAP_ADV_TIMEOUT_HIGH_DUTY_MAX. */ +/**@} */ + + +/**@defgroup BLE_GAP_DISC_MODES GAP Discovery modes + * @{ */ +#define BLE_GAP_DISC_MODE_NOT_DISCOVERABLE 0x00 /**< Not discoverable discovery Mode. */ +#define BLE_GAP_DISC_MODE_LIMITED 0x01 /**< Limited Discovery Mode. */ +#define BLE_GAP_DISC_MODE_GENERAL 0x02 /**< General Discovery Mode. */ +/**@} */ + + +/**@defgroup BLE_GAP_IO_CAPS GAP IO Capabilities + * @{ */ +#define BLE_GAP_IO_CAPS_DISPLAY_ONLY 0x00 /**< Display Only. */ +#define BLE_GAP_IO_CAPS_DISPLAY_YESNO 0x01 /**< Display and Yes/No entry. */ +#define BLE_GAP_IO_CAPS_KEYBOARD_ONLY 0x02 /**< Keyboard Only. */ +#define BLE_GAP_IO_CAPS_NONE 0x03 /**< No I/O capabilities. */ +#define BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY 0x04 /**< Keyboard and Display. */ +/**@} */ + + +/**@defgroup BLE_GAP_AUTH_KEY_TYPES GAP Authentication Key Types + * @{ */ +#define BLE_GAP_AUTH_KEY_TYPE_NONE 0x00 /**< No key (may be used to reject). */ +#define BLE_GAP_AUTH_KEY_TYPE_PASSKEY 0x01 /**< 6-digit Passkey. */ +#define BLE_GAP_AUTH_KEY_TYPE_OOB 0x02 /**< Out Of Band data. */ +/**@} */ + + +/**@defgroup BLE_GAP_KP_NOT_TYPES GAP Keypress Notification Types + * @{ */ +#define BLE_GAP_KP_NOT_TYPE_PASSKEY_START 0x00 /**< Passkey entry started. */ +#define BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_IN 0x01 /**< Passkey digit entered. */ +#define BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_OUT 0x02 /**< Passkey digit erased. */ +#define BLE_GAP_KP_NOT_TYPE_PASSKEY_CLEAR 0x03 /**< Passkey cleared. */ +#define BLE_GAP_KP_NOT_TYPE_PASSKEY_END 0x04 /**< Passkey entry completed. */ +/**@} */ + + +/**@defgroup BLE_GAP_SEC_STATUS GAP Security status + * @{ */ +#define BLE_GAP_SEC_STATUS_SUCCESS 0x00 /**< Procedure completed with success. */ +#define BLE_GAP_SEC_STATUS_TIMEOUT 0x01 /**< Procedure timed out. */ +#define BLE_GAP_SEC_STATUS_PDU_INVALID 0x02 /**< Invalid PDU received. */ +#define BLE_GAP_SEC_STATUS_RFU_RANGE1_BEGIN 0x03 /**< Reserved for Future Use range #1 begin. */ +#define BLE_GAP_SEC_STATUS_RFU_RANGE1_END 0x80 /**< Reserved for Future Use range #1 end. */ +#define BLE_GAP_SEC_STATUS_PASSKEY_ENTRY_FAILED 0x81 /**< Passkey entry failed (user canceled or other). */ +#define BLE_GAP_SEC_STATUS_OOB_NOT_AVAILABLE 0x82 /**< Out of Band Key not available. */ +#define BLE_GAP_SEC_STATUS_AUTH_REQ 0x83 /**< Authentication requirements not met. */ +#define BLE_GAP_SEC_STATUS_CONFIRM_VALUE 0x84 /**< Confirm value failed. */ +#define BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP 0x85 /**< Pairing not supported. */ +#define BLE_GAP_SEC_STATUS_ENC_KEY_SIZE 0x86 /**< Encryption key size. */ +#define BLE_GAP_SEC_STATUS_SMP_CMD_UNSUPPORTED 0x87 /**< Unsupported SMP command. */ +#define BLE_GAP_SEC_STATUS_UNSPECIFIED 0x88 /**< Unspecified reason. */ +#define BLE_GAP_SEC_STATUS_REPEATED_ATTEMPTS 0x89 /**< Too little time elapsed since last attempt. */ +#define BLE_GAP_SEC_STATUS_INVALID_PARAMS 0x8A /**< Invalid parameters. */ +#define BLE_GAP_SEC_STATUS_DHKEY_FAILURE 0x8B /**< DHKey check failure. */ +#define BLE_GAP_SEC_STATUS_NUM_COMP_FAILURE 0x8C /**< Numeric Comparison failure. */ +#define BLE_GAP_SEC_STATUS_BR_EDR_IN_PROG 0x8D /**< BR/EDR pairing in progress. */ +#define BLE_GAP_SEC_STATUS_X_TRANS_KEY_DISALLOWED 0x8E /**< BR/EDR Link Key cannot be used for LE keys. */ +#define BLE_GAP_SEC_STATUS_RFU_RANGE2_BEGIN 0x8F /**< Reserved for Future Use range #2 begin. */ +#define BLE_GAP_SEC_STATUS_RFU_RANGE2_END 0xFF /**< Reserved for Future Use range #2 end. */ +/**@} */ + + +/**@defgroup BLE_GAP_SEC_STATUS_SOURCES GAP Security status sources + * @{ */ +#define BLE_GAP_SEC_STATUS_SOURCE_LOCAL 0x00 /**< Local failure. */ +#define BLE_GAP_SEC_STATUS_SOURCE_REMOTE 0x01 /**< Remote failure. */ +/**@} */ + + +/**@defgroup BLE_GAP_CP_LIMITS GAP Connection Parameters Limits + * @{ */ +#define BLE_GAP_CP_MIN_CONN_INTVL_NONE 0xFFFF /**< No new minimum connection interval specified in connect parameters. */ +#define BLE_GAP_CP_MIN_CONN_INTVL_MIN 0x0006 /**< Lowest minimum connection interval permitted, in units of 1.25 ms, i.e. 7.5 ms. */ +#define BLE_GAP_CP_MIN_CONN_INTVL_MAX 0x0C80 /**< Highest minimum connection interval permitted, in units of 1.25 ms, i.e. 4 s. */ +#define BLE_GAP_CP_MAX_CONN_INTVL_NONE 0xFFFF /**< No new maximum connection interval specified in connect parameters. */ +#define BLE_GAP_CP_MAX_CONN_INTVL_MIN 0x0006 /**< Lowest maximum connection interval permitted, in units of 1.25 ms, i.e. 7.5 ms. */ +#define BLE_GAP_CP_MAX_CONN_INTVL_MAX 0x0C80 /**< Highest maximum connection interval permitted, in units of 1.25 ms, i.e. 4 s. */ +#define BLE_GAP_CP_SLAVE_LATENCY_MAX 0x01F3 /**< Highest slave latency permitted, in connection events. */ +#define BLE_GAP_CP_CONN_SUP_TIMEOUT_NONE 0xFFFF /**< No new supervision timeout specified in connect parameters. */ +#define BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN 0x000A /**< Lowest supervision timeout permitted, in units of 10 ms, i.e. 100 ms. */ +#define BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX 0x0C80 /**< Highest supervision timeout permitted, in units of 10 ms, i.e. 32 s. */ +/**@} */ + + +/**@defgroup BLE_GAP_DEVNAME GAP device name defines. + * @{ */ +#define BLE_GAP_DEVNAME_DEFAULT "nRF5x" /**< Default device name value. */ +#define BLE_GAP_DEVNAME_DEFAULT_LEN 31 /**< Default number of octets in device name. */ +#define BLE_GAP_DEVNAME_MAX_LEN 248 /**< Maximum number of octets in device name. */ +/**@} */ + + +/**@brief Disable RSSI events for connections */ +#define BLE_GAP_RSSI_THRESHOLD_INVALID 0xFF + +/**@defgroup BLE_GAP_PHYS GAP PHYs + * @{ */ +#define BLE_GAP_PHY_AUTO 0x00 /**< Automatic PHY selection. Refer @ref sd_ble_gap_phy_update for more information.*/ +#define BLE_GAP_PHY_1MBPS 0x01 /**< 1 Mbps PHY. */ +#define BLE_GAP_PHY_2MBPS 0x02 /**< 2 Mbps PHY. */ +#define BLE_GAP_PHY_CODED 0x04 /**< Coded PHY. */ +#define BLE_GAP_PHY_NOT_SET 0xFF /**< PHY is not configured. */ + +/**@brief Supported PHYs in connections, for scanning, and for advertising. */ +#define BLE_GAP_PHYS_SUPPORTED (BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS | BLE_GAP_PHY_CODED) /**< All PHYs are supported. */ + +/**@} */ + +/**@defgroup BLE_GAP_CONN_SEC_MODE_SET_MACROS GAP attribute security requirement setters + * + * See @ref ble_gap_conn_sec_mode_t. + * @{ */ +/**@brief Set sec_mode pointed to by ptr to have no access rights.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(ptr) do {(ptr)->sm = 0; (ptr)->lv = 0;} while(0) +/**@brief Set sec_mode pointed to by ptr to require no protection, open link.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_OPEN(ptr) do {(ptr)->sm = 1; (ptr)->lv = 1;} while(0) +/**@brief Set sec_mode pointed to by ptr to require encryption, but no MITM protection.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 2;} while(0) +/**@brief Set sec_mode pointed to by ptr to require encryption and MITM protection.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 3;} while(0) +/**@brief Set sec_mode pointed to by ptr to require LESC encryption and MITM protection.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 4;} while(0) +/**@brief Set sec_mode pointed to by ptr to require signing or encryption, no MITM protection needed.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_SIGNED_NO_MITM(ptr) do {(ptr)->sm = 2; (ptr)->lv = 1;} while(0) +/**@brief Set sec_mode pointed to by ptr to require signing or encryption with MITM protection.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_SIGNED_WITH_MITM(ptr) do {(ptr)->sm = 2; (ptr)->lv = 2;} while(0) +/**@} */ + + +/**@brief GAP Security Random Number Length. */ +#define BLE_GAP_SEC_RAND_LEN 8 + + +/**@brief GAP Security Key Length. */ +#define BLE_GAP_SEC_KEY_LEN 16 + + +/**@brief GAP LE Secure Connections Elliptic Curve Diffie-Hellman P-256 Public Key Length. */ +#define BLE_GAP_LESC_P256_PK_LEN 64 + + +/**@brief GAP LE Secure Connections Elliptic Curve Diffie-Hellman DHKey Length. */ +#define BLE_GAP_LESC_DHKEY_LEN 32 + + +/**@brief GAP Passkey Length. */ +#define BLE_GAP_PASSKEY_LEN 6 + + +/**@brief Maximum amount of addresses in the whitelist. */ +#define BLE_GAP_WHITELIST_ADDR_MAX_COUNT (8) + + +/**@brief Maximum amount of identities in the device identities list. */ +#define BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT (8) + + +/**@brief Default connection count for a configuration. */ +#define BLE_GAP_CONN_COUNT_DEFAULT (1) + + +/**@defgroup BLE_GAP_EVENT_LENGTH GAP event length defines. + * @{ */ +#define BLE_GAP_EVENT_LENGTH_MIN (2) /**< Minimum event length, in 1.25 ms units. */ +#define BLE_GAP_EVENT_LENGTH_CODED_PHY_MIN (6) /**< The shortest event length in 1.25 ms units supporting LE Coded PHY. */ +#define BLE_GAP_EVENT_LENGTH_DEFAULT (3) /**< Default event length, in 1.25 ms units. */ +/**@} */ + + +/**@defgroup BLE_GAP_ROLE_COUNT GAP concurrent connection count defines. + * @{ */ +#define BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT (1) /**< Default maximum number of connections concurrently acting as peripherals. */ +#define BLE_GAP_ROLE_COUNT_CENTRAL_DEFAULT (3) /**< Default maximum number of connections concurrently acting as centrals. */ +#define BLE_GAP_ROLE_COUNT_CENTRAL_SEC_DEFAULT (1) /**< Default number of SMP instances shared between all connections acting as centrals. */ +#define BLE_GAP_ROLE_COUNT_COMBINED_MAX (20) /**< Maximum supported number of concurrent connections in the peripheral and central roles combined. */ + +/**@} */ + +/**@brief Automatic data length parameter. */ +#define BLE_GAP_DATA_LENGTH_AUTO 0 + +/**@defgroup BLE_GAP_AUTH_PAYLOAD_TIMEOUT Authenticated payload timeout defines. + * @{ */ +#define BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX (48000) /**< Maximum authenticated payload timeout in 10 ms units, i.e. 8 minutes. */ +#define BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MIN (1) /**< Minimum authenticated payload timeout in 10 ms units, i.e. 10 ms. */ +/**@} */ + +/**@defgroup GAP_SEC_MODES GAP Security Modes + * @{ */ +#define BLE_GAP_SEC_MODE 0x00 /**< No key (may be used to reject). */ +/**@} */ + +/**@brief The total number of channels in Bluetooth Low Energy. */ +#define BLE_GAP_CHANNEL_COUNT (40) + +/**@defgroup BLE_GAP_QOS_CHANNEL_SURVEY_INTERVALS Quality of Service (QoS) Channel survey interval defines + * @{ */ +#define BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_CONTINUOUS (0) /**< Continuous channel survey. */ +#define BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_MIN_US (7500) /**< Minimum channel survey interval in microseconds (7.5 ms). */ +#define BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_MAX_US (4000000) /**< Maximum channel survey interval in microseconds (4 s). */ + /**@} */ + +/** @} */ + +/** @defgroup BLE_GAP_CHAR_INCL_CONFIG GAP Characteristic inclusion configurations + * @{ + */ +#define BLE_GAP_CHAR_INCL_CONFIG_INCLUDE (0) /**< Include the characteristic in the Attribute Table */ +#define BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITH_SPACE (1) /**< Do not include the characteristic in the Attribute table. + The SoftDevice will reserve the attribute handles + which are otherwise used for this characteristic. + By reserving the attribute handles it will be possible + to upgrade the SoftDevice without changing handle of the + Service Changed characteristic. */ +#define BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITHOUT_SPACE (2) /**< Do not include the characteristic in the Attribute table. + The SoftDevice will not reserve the attribute handles + which are otherwise used for this characteristic. */ +/**@} */ + + +/** @defgroup BLE_GAP_CHAR_INCL_CONFIG_DEFAULTS Characteristic inclusion default values + * @{ */ +#define BLE_GAP_PPCP_INCL_CONFIG_DEFAULT (BLE_GAP_CHAR_INCL_CONFIG_INCLUDE) /**< Included by default. */ +#define BLE_GAP_CAR_INCL_CONFIG_DEFAULT (BLE_GAP_CHAR_INCL_CONFIG_INCLUDE) /**< Included by default. */ +/**@} */ + +/**@addtogroup BLE_GAP_STRUCTURES Structures + * @{ */ + +/**@brief Advertising event properties. */ +typedef struct +{ + uint8_t type; /**< Advertising type. See @ref BLE_GAP_ADV_TYPES. */ + uint8_t anonymous : 1; /**< Omit advertiser's address from all PDUs. + @note Anonymous advertising is only available for + @ref BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED and + @ref BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_DIRECTED. */ + uint8_t include_tx_power : 1; /**< This feature is not supported on this SoftDevice. */ +} ble_gap_adv_properties_t; + + +/**@brief Advertising report type. */ +typedef struct +{ + uint16_t connectable : 1; /**< Connectable advertising event type. */ + uint16_t scannable : 1; /**< Scannable advertising event type. */ + uint16_t directed : 1; /**< Directed advertising event type. */ + uint16_t scan_response : 1; /**< Received a scan response. */ + uint16_t extended_pdu : 1; /**< Received an extended advertising set. */ + uint16_t status : 2; /**< Data status. See @ref BLE_GAP_ADV_DATA_STATUS. */ + uint16_t reserved : 9; /**< Reserved for future use. */ +} ble_gap_adv_report_type_t; + +/**@brief Advertising Auxiliary Pointer. */ +typedef struct +{ + uint16_t aux_offset; /**< Time offset from the beginning of advertising packet to the auxiliary packet in 100 us units. */ + uint8_t aux_phy; /**< Indicates the PHY on which the auxiliary advertising packet is sent. See @ref BLE_GAP_PHYS. */ +} ble_gap_aux_pointer_t; + +/**@brief Bluetooth Low Energy address. */ +typedef struct +{ + uint8_t addr_id_peer : 1; /**< Only valid for peer addresses. + This bit is set by the SoftDevice to indicate whether the address has been resolved from + a Resolvable Private Address (when the peer is using privacy). + If set to 1, @ref addr and @ref addr_type refer to the identity address of the resolved address. + + This bit is ignored when a variable of type @ref ble_gap_addr_t is used as input to API functions. */ + uint8_t addr_type : 7; /**< See @ref BLE_GAP_ADDR_TYPES. */ + uint8_t addr[BLE_GAP_ADDR_LEN]; /**< 48-bit address, LSB format. + @ref addr is not used if @ref addr_type is @ref BLE_GAP_ADDR_TYPE_ANONYMOUS. */ +} ble_gap_addr_t; + + +/**@brief GAP connection parameters. + * + * @note When ble_conn_params_t is received in an event, both min_conn_interval and + * max_conn_interval will be equal to the connection interval set by the central. + * + * @note If both conn_sup_timeout and max_conn_interval are specified, then the following constraint applies: + * conn_sup_timeout * 4 > (1 + slave_latency) * max_conn_interval + * that corresponds to the following Bluetooth Spec requirement: + * The Supervision_Timeout in milliseconds shall be larger than + * (1 + Conn_Latency) * Conn_Interval_Max * 2, where Conn_Interval_Max is given in milliseconds. + */ +typedef struct +{ + uint16_t min_conn_interval; /**< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/ + uint16_t max_conn_interval; /**< Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/ + uint16_t slave_latency; /**< Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS.*/ + uint16_t conn_sup_timeout; /**< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS.*/ +} ble_gap_conn_params_t; + + +/**@brief GAP connection security modes. + * + * Security Mode 0 Level 0: No access permissions at all (this level is not defined by the Bluetooth Core specification).\n + * Security Mode 1 Level 1: No security is needed (aka open link).\n + * Security Mode 1 Level 2: Encrypted link required, MITM protection not necessary.\n + * Security Mode 1 Level 3: MITM protected encrypted link required.\n + * Security Mode 1 Level 4: LESC MITM protected encrypted link using a 128-bit strength encryption key required.\n + * Security Mode 2 Level 1: Signing or encryption required, MITM protection not necessary.\n + * Security Mode 2 Level 2: MITM protected signing required, unless link is MITM protected encrypted.\n + */ +typedef struct +{ + uint8_t sm : 4; /**< Security Mode (1 or 2), 0 for no permissions at all. */ + uint8_t lv : 4; /**< Level (1, 2, 3 or 4), 0 for no permissions at all. */ + +} ble_gap_conn_sec_mode_t; + + +/**@brief GAP connection security status.*/ +typedef struct +{ + ble_gap_conn_sec_mode_t sec_mode; /**< Currently active security mode for this connection.*/ + uint8_t encr_key_size; /**< Length of currently active encryption key, 7 to 16 octets (only applicable for bonding procedures). */ +} ble_gap_conn_sec_t; + +/**@brief Identity Resolving Key. */ +typedef struct +{ + uint8_t irk[BLE_GAP_SEC_KEY_LEN]; /**< Array containing IRK. */ +} ble_gap_irk_t; + + +/**@brief Channel mask (40 bits). + * Every channel is represented with a bit positioned as per channel index defined in Bluetooth Core Specification v5.0, + * Vol 6, Part B, Section 1.4.1. The LSB contained in array element 0 represents channel index 0, and bit 39 represents + * channel index 39. If a bit is set to 1, the channel is not used. + */ +typedef uint8_t ble_gap_ch_mask_t[5]; + + +/**@brief GAP advertising parameters. */ +typedef struct +{ + ble_gap_adv_properties_t properties; /**< The properties of the advertising events. */ + ble_gap_addr_t const *p_peer_addr; /**< Address of a known peer. + @note ble_gap_addr_t::addr_type cannot be + @ref BLE_GAP_ADDR_TYPE_ANONYMOUS. + - When privacy is enabled and the local device uses + @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE addresses, + the device identity list is searched for a matching entry. If + the local IRK for that device identity is set, the local IRK + for that device will be used to generate the advertiser address + field in the advertising packet. + - If @ref ble_gap_adv_properties_t::type is directed, this must be + set to the targeted scanner or initiator. If the peer address is + in the device identity list, the peer IRK for that device will be + used to generate @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE + target addresses used in the advertising event PDUs. */ + uint32_t interval; /**< Advertising interval in 625 us units. @sa BLE_GAP_ADV_INTERVALS. + @note If @ref ble_gap_adv_properties_t::type is set to + @ref BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE + advertising, this parameter is ignored. */ + uint16_t duration; /**< Advertising duration in 10 ms units. When timeout is reached, + an event of type @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised. + @sa BLE_GAP_ADV_TIMEOUT_VALUES. + @note The SoftDevice will always complete at least one advertising + event even if the duration is set too low. */ + uint8_t max_adv_evts; /**< Maximum advertising events that shall be sent prior to disabling + advertising. Setting the value to 0 disables the limitation. When + the count of advertising events specified by this parameter + (if not 0) is reached, advertising will be automatically stopped + and an event of type @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised + @note If @ref ble_gap_adv_properties_t::type is set to + @ref BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE, + this parameter is ignored. */ + ble_gap_ch_mask_t channel_mask; /**< Channel mask for primary and secondary advertising channels. + At least one of the primary channels, that is channel index 37-39, must be used. + Masking away secondary advertising channels is not supported. */ + uint8_t filter_policy; /**< Filter Policy. @sa BLE_GAP_ADV_FILTER_POLICIES. */ + uint8_t primary_phy; /**< Indicates the PHY on which the primary advertising channel packets + are transmitted. If set to @ref BLE_GAP_PHY_AUTO, @ref BLE_GAP_PHY_1MBPS + will be used. + Valid values are @ref BLE_GAP_PHY_1MBPS and @ref BLE_GAP_PHY_CODED. + @note The primary_phy shall indicate @ref BLE_GAP_PHY_1MBPS if + @ref ble_gap_adv_properties_t::type is not an extended advertising type. */ + uint8_t secondary_phy; /**< Indicates the PHY on which the secondary advertising channel packets + are transmitted. + If set to @ref BLE_GAP_PHY_AUTO, @ref BLE_GAP_PHY_1MBPS will be used. + Valid values are + @ref BLE_GAP_PHY_1MBPS, @ref BLE_GAP_PHY_2MBPS, and @ref BLE_GAP_PHY_CODED. + If @ref ble_gap_adv_properties_t::type is an extended advertising type + and connectable, this is the PHY that will be used to establish a + connection and send AUX_ADV_IND packets on. + @note This parameter will be ignored when + @ref ble_gap_adv_properties_t::type is not an extended advertising type. */ + uint8_t set_id:4; /**< The advertising set identifier distinguishes this advertising set from other + advertising sets transmitted by this and other devices. + @note This parameter will be ignored when + @ref ble_gap_adv_properties_t::type is not an extended advertising type. */ + uint8_t scan_req_notification:1; /**< Enable scan request notifications for this advertising set. When a + scan request is received and the scanner address is allowed + by the filter policy, @ref BLE_GAP_EVT_SCAN_REQ_REPORT is raised. + @note This parameter will be ignored when + @ref ble_gap_adv_properties_t::type is a non-scannable + advertising type. */ +} ble_gap_adv_params_t; + + +/**@brief GAP advertising data buffers. + * + * The application must provide the buffers for advertisement. The memory shall reside in application RAM, and + * shall never be modified while advertising. The data shall be kept alive until either: + * - @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised. + * - @ref BLE_GAP_EVT_CONNECTED is raised with @ref ble_gap_evt_connected_t::adv_handle set to the corresponding + * advertising handle. + * - Advertising is stopped. + * - Advertising data is changed. + * To update advertising data while advertising, provide new buffers to @ref sd_ble_gap_adv_set_configure. */ +typedef struct +{ + ble_data_t adv_data; /**< Advertising data. + @note + Advertising data can only be specified for a @ref ble_gap_adv_properties_t::type + that is allowed to contain advertising data. */ + ble_data_t scan_rsp_data; /**< Scan response data. + @note + Scan response data can only be specified for a @ref ble_gap_adv_properties_t::type + that is scannable. */ +} ble_gap_adv_data_t; + + +/**@brief GAP scanning parameters. */ +typedef struct +{ + uint8_t extended : 1; /**< If 1, the scanner will accept extended advertising packets. + If set to 0, the scanner will not receive advertising packets + on secondary advertising channels, and will not be able + to receive long advertising PDUs. */ + uint8_t report_incomplete_evts : 1; /**< If 1, events of type @ref ble_gap_evt_adv_report_t may have + @ref ble_gap_adv_report_type_t::status set to + @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA. + This parameter is ignored when used with @ref sd_ble_gap_connect + @note This may be used to abort receiving more packets from an extended + advertising event, and is only available for extended + scanning, see @ref sd_ble_gap_scan_start. + @note This feature is not supported by this SoftDevice. */ + uint8_t active : 1; /**< If 1, perform active scanning by sending scan requests. + This parameter is ignored when used with @ref sd_ble_gap_connect. */ + uint8_t filter_policy : 2; /**< Scanning filter policy. @sa BLE_GAP_SCAN_FILTER_POLICIES. + @note Only @ref BLE_GAP_SCAN_FP_ACCEPT_ALL and + @ref BLE_GAP_SCAN_FP_WHITELIST are valid when used with + @ref sd_ble_gap_connect */ + uint8_t scan_phys; /**< Bitfield of PHYs to scan on. If set to @ref BLE_GAP_PHY_AUTO, + scan_phys will default to @ref BLE_GAP_PHY_1MBPS. + - If @ref ble_gap_scan_params_t::extended is set to 0, the only + supported PHY is @ref BLE_GAP_PHY_1MBPS. + - When used with @ref sd_ble_gap_scan_start, + the bitfield indicates the PHYs the scanner will use for scanning + on primary advertising channels. The scanner will accept + @ref BLE_GAP_PHYS_SUPPORTED as secondary advertising channel PHYs. + - When used with @ref sd_ble_gap_connect, the bitfield indicates + the PHYs the initiator will use for scanning on primary advertising + channels. The initiator will accept connections initiated on either + of the @ref BLE_GAP_PHYS_SUPPORTED PHYs. + If scan_phys contains @ref BLE_GAP_PHY_1MBPS and/or @ref BLE_GAP_PHY_2MBPS, + the primary scan PHY is @ref BLE_GAP_PHY_1MBPS. + If scan_phys also contains @ref BLE_GAP_PHY_CODED, the primary scan + PHY will also contain @ref BLE_GAP_PHY_CODED. If the only scan PHY is + @ref BLE_GAP_PHY_CODED, the primary scan PHY is + @ref BLE_GAP_PHY_CODED only. */ + uint16_t interval; /**< Scan interval in 625 us units. @sa BLE_GAP_SCAN_INTERVALS. */ + uint16_t window; /**< Scan window in 625 us units. @sa BLE_GAP_SCAN_WINDOW. + If scan_phys contains both @ref BLE_GAP_PHY_1MBPS and + @ref BLE_GAP_PHY_CODED interval shall be larger than or + equal to twice the scan window. */ + uint16_t timeout; /**< Scan timeout in 10 ms units. @sa BLE_GAP_SCAN_TIMEOUT. */ + ble_gap_ch_mask_t channel_mask; /**< Channel mask for primary and secondary advertising channels. + At least one of the primary channels, that is channel index 37-39, must be + set to 0. + Masking away secondary channels is not supported. */ +} ble_gap_scan_params_t; + + +/**@brief Privacy. + * + * The privacy feature provides a way for the device to avoid being tracked over a period of time. + * The privacy feature, when enabled, hides the local device identity and replaces it with a private address + * that is automatically refreshed at a specified interval. + * + * If a device still wants to be recognized by other peers, it needs to share it's Identity Resolving Key (IRK). + * With this key, a device can generate a random private address that can only be recognized by peers in possession of that key, + * and devices can establish connections without revealing their real identities. + * + * Both network privacy (@ref BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY) and device privacy (@ref BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY) + * are supported. + * + * @note If the device IRK is updated, the new IRK becomes the one to be distributed in all + * bonding procedures performed after @ref sd_ble_gap_privacy_set returns. + * The IRK distributed during bonding procedure is the device IRK that is active when @ref sd_ble_gap_sec_params_reply is called. + */ +typedef struct +{ + uint8_t privacy_mode; /**< Privacy mode, see @ref BLE_GAP_PRIVACY_MODES. Default is @ref BLE_GAP_PRIVACY_MODE_OFF. */ + uint8_t private_addr_type; /**< The private address type must be either @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE or @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE. */ + uint16_t private_addr_cycle_s; /**< Private address cycle interval in seconds. Providing an address cycle value of 0 will use the default value defined by @ref BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S. */ + ble_gap_irk_t *p_device_irk; /**< When used as input, pointer to IRK structure that will be used as the default IRK. If NULL, the device default IRK will be used. + When used as output, pointer to IRK structure where the current default IRK will be written to. If NULL, this argument is ignored. + By default, the default IRK is used to generate random private resolvable addresses for the local device unless instructed otherwise. */ +} ble_gap_privacy_params_t; + + +/**@brief PHY preferences for TX and RX + * @note tx_phys and rx_phys are bit fields. Multiple bits can be set in them to indicate multiple preferred PHYs for each direction. + * @code + * p_gap_phys->tx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS; + * p_gap_phys->rx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS; + * @endcode + * + */ +typedef struct +{ + uint8_t tx_phys; /**< Preferred transmit PHYs, see @ref BLE_GAP_PHYS. */ + uint8_t rx_phys; /**< Preferred receive PHYs, see @ref BLE_GAP_PHYS. */ +} ble_gap_phys_t; + +/** @brief Keys that can be exchanged during a bonding procedure. */ +typedef struct +{ + uint8_t enc : 1; /**< Long Term Key and Master Identification. */ + uint8_t id : 1; /**< Identity Resolving Key and Identity Address Information. */ + uint8_t sign : 1; /**< Connection Signature Resolving Key. */ + uint8_t link : 1; /**< Derive the Link Key from the LTK. */ +} ble_gap_sec_kdist_t; + + +/**@brief GAP security parameters. */ +typedef struct +{ + uint8_t bond : 1; /**< Perform bonding. */ + uint8_t mitm : 1; /**< Enable Man In The Middle protection. */ + uint8_t lesc : 1; /**< Enable LE Secure Connection pairing. */ + uint8_t keypress : 1; /**< Enable generation of keypress notifications. */ + uint8_t io_caps : 3; /**< IO capabilities, see @ref BLE_GAP_IO_CAPS. */ + uint8_t oob : 1; /**< The OOB data flag. + - In LE legacy pairing, this flag is set if a device has out of band authentication data. + The OOB method is used if both of the devices have out of band authentication data. + - In LE Secure Connections pairing, this flag is set if a device has the peer device's out of band authentication data. + The OOB method is used if at least one device has the peer device's OOB data available. */ + uint8_t min_key_size; /**< Minimum encryption key size in octets between 7 and 16. If 0 then not applicable in this instance. */ + uint8_t max_key_size; /**< Maximum encryption key size in octets between min_key_size and 16. */ + ble_gap_sec_kdist_t kdist_own; /**< Key distribution bitmap: keys that the local device will distribute. */ + ble_gap_sec_kdist_t kdist_peer; /**< Key distribution bitmap: keys that the remote device will distribute. */ +} ble_gap_sec_params_t; + + +/**@brief GAP Encryption Information. */ +typedef struct +{ + uint8_t ltk[BLE_GAP_SEC_KEY_LEN]; /**< Long Term Key. */ + uint8_t lesc : 1; /**< Key generated using LE Secure Connections. */ + uint8_t auth : 1; /**< Authenticated Key. */ + uint8_t ltk_len : 6; /**< LTK length in octets. */ +} ble_gap_enc_info_t; + + +/**@brief GAP Master Identification. */ +typedef struct +{ + uint16_t ediv; /**< Encrypted Diversifier. */ + uint8_t rand[BLE_GAP_SEC_RAND_LEN]; /**< Random Number. */ +} ble_gap_master_id_t; + + +/**@brief GAP Signing Information. */ +typedef struct +{ + uint8_t csrk[BLE_GAP_SEC_KEY_LEN]; /**< Connection Signature Resolving Key. */ +} ble_gap_sign_info_t; + + +/**@brief GAP LE Secure Connections P-256 Public Key. */ +typedef struct +{ + uint8_t pk[BLE_GAP_LESC_P256_PK_LEN]; /**< LE Secure Connections Elliptic Curve Diffie-Hellman P-256 Public Key. Stored in the standard SMP protocol format: {X,Y} both in little-endian. */ +} ble_gap_lesc_p256_pk_t; + + +/**@brief GAP LE Secure Connections DHKey. */ +typedef struct +{ + uint8_t key[BLE_GAP_LESC_DHKEY_LEN]; /**< LE Secure Connections Elliptic Curve Diffie-Hellman Key. Stored in little-endian. */ +} ble_gap_lesc_dhkey_t; + + +/**@brief GAP LE Secure Connections OOB data. */ +typedef struct +{ + ble_gap_addr_t addr; /**< Bluetooth address of the device. */ + uint8_t r[BLE_GAP_SEC_KEY_LEN]; /**< Random Number. */ + uint8_t c[BLE_GAP_SEC_KEY_LEN]; /**< Confirm Value. */ +} ble_gap_lesc_oob_data_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_CONNECTED. */ +typedef struct +{ + ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1 + and the address is the device's identity address. */ + uint8_t role; /**< BLE role for this connection, see @ref BLE_GAP_ROLES */ + ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */ + uint8_t adv_handle; /**< Advertising handle in which advertising has ended. + This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH. */ + ble_gap_adv_data_t adv_data; /**< Advertising buffers corresponding to the terminated + advertising set. The advertising buffers provided in + @ref sd_ble_gap_adv_set_configure are now released. + This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH. */ +} ble_gap_evt_connected_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_DISCONNECTED. */ +typedef struct +{ + uint8_t reason; /**< HCI error code, see @ref BLE_HCI_STATUS_CODES. */ +} ble_gap_evt_disconnected_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_CONN_PARAM_UPDATE. */ +typedef struct +{ + ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */ +} ble_gap_evt_conn_param_update_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_PHY_UPDATE_REQUEST. */ +typedef struct +{ + ble_gap_phys_t peer_preferred_phys; /**< The PHYs the peer prefers to use. */ +} ble_gap_evt_phy_update_request_t; + +/**@brief Event Structure for @ref BLE_GAP_EVT_PHY_UPDATE. */ +typedef struct +{ + uint8_t status; /**< Status of the procedure, see @ref BLE_HCI_STATUS_CODES.*/ + uint8_t tx_phy; /**< TX PHY for this connection, see @ref BLE_GAP_PHYS. */ + uint8_t rx_phy; /**< RX PHY for this connection, see @ref BLE_GAP_PHYS. */ +} ble_gap_evt_phy_update_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST. */ +typedef struct +{ + ble_gap_sec_params_t peer_params; /**< Initiator Security Parameters. */ +} ble_gap_evt_sec_params_request_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_SEC_INFO_REQUEST. */ +typedef struct +{ + ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. */ + ble_gap_master_id_t master_id; /**< Master Identification for LTK lookup. */ + uint8_t enc_info : 1; /**< If 1, Encryption Information required. */ + uint8_t id_info : 1; /**< If 1, Identity Information required. */ + uint8_t sign_info : 1; /**< If 1, Signing Information required. */ +} ble_gap_evt_sec_info_request_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_PASSKEY_DISPLAY. */ +typedef struct +{ + uint8_t passkey[BLE_GAP_PASSKEY_LEN]; /**< 6-digit passkey in ASCII ('0'-'9' digits only). */ + uint8_t match_request : 1; /**< If 1 requires the application to report the match using @ref sd_ble_gap_auth_key_reply + with either @ref BLE_GAP_AUTH_KEY_TYPE_NONE if there is no match or + @ref BLE_GAP_AUTH_KEY_TYPE_PASSKEY if there is a match. */ +} ble_gap_evt_passkey_display_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_KEY_PRESSED. */ +typedef struct +{ + uint8_t kp_not; /**< Keypress notification type, see @ref BLE_GAP_KP_NOT_TYPES. */ +} ble_gap_evt_key_pressed_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_AUTH_KEY_REQUEST. */ +typedef struct +{ + uint8_t key_type; /**< See @ref BLE_GAP_AUTH_KEY_TYPES. */ +} ble_gap_evt_auth_key_request_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST. */ +typedef struct +{ + ble_gap_lesc_p256_pk_t *p_pk_peer; /**< LE Secure Connections remote P-256 Public Key. This will point to the application-supplied memory + inside the keyset during the call to @ref sd_ble_gap_sec_params_reply. */ + uint8_t oobd_req :1; /**< LESC OOB data required. A call to @ref sd_ble_gap_lesc_oob_data_set is required to complete the procedure. */ +} ble_gap_evt_lesc_dhkey_request_t; + + +/**@brief Security levels supported. + * @note See Bluetooth Specification Version 4.2 Volume 3, Part C, Chapter 10, Section 10.2.1. +*/ +typedef struct +{ + uint8_t lv1 : 1; /**< If 1: Level 1 is supported. */ + uint8_t lv2 : 1; /**< If 1: Level 2 is supported. */ + uint8_t lv3 : 1; /**< If 1: Level 3 is supported. */ + uint8_t lv4 : 1; /**< If 1: Level 4 is supported. */ +} ble_gap_sec_levels_t; + + +/**@brief Encryption Key. */ +typedef struct +{ + ble_gap_enc_info_t enc_info; /**< Encryption Information. */ + ble_gap_master_id_t master_id; /**< Master Identification. */ +} ble_gap_enc_key_t; + + +/**@brief Identity Key. */ +typedef struct +{ + ble_gap_irk_t id_info; /**< Identity Resolving Key. */ + ble_gap_addr_t id_addr_info; /**< Identity Address. */ +} ble_gap_id_key_t; + + +/**@brief Security Keys. */ +typedef struct +{ + ble_gap_enc_key_t *p_enc_key; /**< Encryption Key, or NULL. */ + ble_gap_id_key_t *p_id_key; /**< Identity Key, or NULL. */ + ble_gap_sign_info_t *p_sign_key; /**< Signing Key, or NULL. */ + ble_gap_lesc_p256_pk_t *p_pk; /**< LE Secure Connections P-256 Public Key. When in debug mode the application must use the value defined + in the Core Bluetooth Specification v4.2 Vol.3, Part H, Section 2.3.5.6.1 */ +} ble_gap_sec_keys_t; + + +/**@brief Security key set for both local and peer keys. */ +typedef struct +{ + ble_gap_sec_keys_t keys_own; /**< Keys distributed by the local device. For LE Secure Connections the encryption key will be generated locally and will always be stored if bonding. */ + ble_gap_sec_keys_t keys_peer; /**< Keys distributed by the remote device. For LE Secure Connections, p_enc_key must always be NULL. */ +} ble_gap_sec_keyset_t; + + +/**@brief Data Length Update Procedure parameters. */ +typedef struct +{ + uint16_t max_tx_octets; /**< Maximum number of payload octets that a Controller supports for transmission of a single Link Layer Data Channel PDU. */ + uint16_t max_rx_octets; /**< Maximum number of payload octets that a Controller supports for reception of a single Link Layer Data Channel PDU. */ + uint16_t max_tx_time_us; /**< Maximum time, in microseconds, that a Controller supports for transmission of a single Link Layer Data Channel PDU. */ + uint16_t max_rx_time_us; /**< Maximum time, in microseconds, that a Controller supports for reception of a single Link Layer Data Channel PDU. */ +} ble_gap_data_length_params_t; + + +/**@brief Data Length Update Procedure local limitation. */ +typedef struct +{ + uint16_t tx_payload_limited_octets; /**< If > 0, the requested TX packet length is too long by this many octets. */ + uint16_t rx_payload_limited_octets; /**< If > 0, the requested RX packet length is too long by this many octets. */ + uint16_t tx_rx_time_limited_us; /**< If > 0, the requested combination of TX and RX packet lengths is too long by this many microseconds. */ +} ble_gap_data_length_limitation_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_AUTH_STATUS. */ +typedef struct +{ + uint8_t auth_status; /**< Authentication status, see @ref BLE_GAP_SEC_STATUS. */ + uint8_t error_src : 2; /**< On error, source that caused the failure, see @ref BLE_GAP_SEC_STATUS_SOURCES. */ + uint8_t bonded : 1; /**< Procedure resulted in a bond. */ + uint8_t lesc : 1; /**< Procedure resulted in a LE Secure Connection. */ + ble_gap_sec_levels_t sm1_levels; /**< Levels supported in Security Mode 1. */ + ble_gap_sec_levels_t sm2_levels; /**< Levels supported in Security Mode 2. */ + ble_gap_sec_kdist_t kdist_own; /**< Bitmap stating which keys were exchanged (distributed) by the local device. If bonding with LE Secure Connections, the enc bit will be always set. */ + ble_gap_sec_kdist_t kdist_peer; /**< Bitmap stating which keys were exchanged (distributed) by the remote device. If bonding with LE Secure Connections, the enc bit will never be set. */ +} ble_gap_evt_auth_status_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_CONN_SEC_UPDATE. */ +typedef struct +{ + ble_gap_conn_sec_t conn_sec; /**< Connection security level. */ +} ble_gap_evt_conn_sec_update_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_TIMEOUT. */ +typedef struct +{ + uint8_t src; /**< Source of timeout event, see @ref BLE_GAP_TIMEOUT_SOURCES. */ + union + { + ble_data_t adv_report_buffer; /**< If source is set to @ref BLE_GAP_TIMEOUT_SRC_SCAN, the released + scan buffer is contained in this field. */ + } params; /**< Event Parameters. */ +} ble_gap_evt_timeout_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_RSSI_CHANGED. */ +typedef struct +{ + int8_t rssi; /**< Received Signal Strength Indication in dBm. + @note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement. */ + uint8_t ch_index; /**< Data Channel Index on which the Signal Strength is measured (0-36). */ +} ble_gap_evt_rssi_changed_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_ADV_SET_TERMINATED */ +typedef struct +{ + uint8_t reason; /**< Reason for why the advertising set terminated. See + @ref BLE_GAP_EVT_ADV_SET_TERMINATED_REASON. */ + uint8_t adv_handle; /**< Advertising handle in which advertising has ended. */ + uint8_t num_completed_adv_events; /**< If @ref ble_gap_adv_params_t::max_adv_evts was not set to 0, + this field indicates the number of completed advertising events. */ + ble_gap_adv_data_t adv_data; /**< Advertising buffers corresponding to the terminated + advertising set. The advertising buffers provided in + @ref sd_ble_gap_adv_set_configure are now released. */ +} ble_gap_evt_adv_set_terminated_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_ADV_REPORT. + * + * @note If @ref ble_gap_adv_report_type_t::status is set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, + * not all fields in the advertising report may be available. + * + * @note When ble_gap_adv_report_type_t::status is not set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, + * scanning will be paused. To continue scanning, call @ref sd_ble_gap_scan_start. + */ +typedef struct +{ + ble_gap_adv_report_type_t type; /**< Advertising report type. See @ref ble_gap_adv_report_type_t. */ + ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. If the peer_addr is resolved: + @ref ble_gap_addr_t::addr_id_peer is set to 1 and the address is the + peer's identity address. */ + ble_gap_addr_t direct_addr; /**< Contains the target address of the advertising event if + @ref ble_gap_adv_report_type_t::directed is set to 1. If the + SoftDevice was able to resolve the address, + @ref ble_gap_addr_t::addr_id_peer is set to 1 and the direct_addr + contains the local identity address. If the target address of the + advertising event is @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE, + and the SoftDevice was unable to resolve it, the application may try + to resolve this address to find out if the advertising event was + directed to us. */ + uint8_t primary_phy; /**< Indicates the PHY on which the primary advertising packet was received. + See @ref BLE_GAP_PHYS. */ + uint8_t secondary_phy; /**< Indicates the PHY on which the secondary advertising packet was received. + See @ref BLE_GAP_PHYS. This field is set to @ref BLE_GAP_PHY_NOT_SET if no packets + were received on a secondary advertising channel. */ + int8_t tx_power; /**< TX Power reported by the advertiser in the last packet header received. + This field is set to @ref BLE_GAP_POWER_LEVEL_INVALID if the + last received packet did not contain the Tx Power field. + @note TX Power is only included in extended advertising packets. */ + int8_t rssi; /**< Received Signal Strength Indication in dBm of the last packet received. + @note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement. */ + uint8_t ch_index; /**< Channel Index on which the last advertising packet is received (0-39). */ + uint8_t set_id; /**< Set ID of the received advertising data. Set ID is not present + if set to @ref BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE. */ + uint16_t data_id:12; /**< The advertising data ID of the received advertising data. Data ID + is not present if @ref ble_gap_evt_adv_report_t::set_id is set to + @ref BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE. */ + ble_data_t data; /**< Received advertising or scan response data. If + @ref ble_gap_adv_report_type_t::status is not set to + @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, the data buffer provided + in @ref sd_ble_gap_scan_start is now released. */ + ble_gap_aux_pointer_t aux_pointer; /**< The offset and PHY of the next advertising packet in this extended advertising + event. @note This field is only set if @ref ble_gap_adv_report_type_t::status + is set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA. */ +} ble_gap_evt_adv_report_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_SEC_REQUEST. */ +typedef struct +{ + uint8_t bond : 1; /**< Perform bonding. */ + uint8_t mitm : 1; /**< Man In The Middle protection requested. */ + uint8_t lesc : 1; /**< LE Secure Connections requested. */ + uint8_t keypress : 1; /**< Generation of keypress notifications requested. */ +} ble_gap_evt_sec_request_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST. */ +typedef struct +{ + ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */ +} ble_gap_evt_conn_param_update_request_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_SCAN_REQ_REPORT. */ +typedef struct +{ + uint8_t adv_handle; /**< Advertising handle for the advertising set which received the Scan Request */ + int8_t rssi; /**< Received Signal Strength Indication in dBm. + @note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement. */ + ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1 + and the address is the device's identity address. */ +} ble_gap_evt_scan_req_report_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST. */ +typedef struct +{ + ble_gap_data_length_params_t peer_params; /**< Peer data length parameters. */ +} ble_gap_evt_data_length_update_request_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE. + * + * @note This event may also be raised after a PHY Update procedure. + */ +typedef struct +{ + ble_gap_data_length_params_t effective_params; /**< The effective data length parameters. */ +} ble_gap_evt_data_length_update_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT. */ +typedef struct +{ + int8_t channel_energy[BLE_GAP_CHANNEL_COUNT]; /**< The measured energy on the Bluetooth Low Energy + channels, in dBm, indexed by Channel Index. + If no measurement is available for the given channel, channel_energy is set to + @ref BLE_GAP_POWER_LEVEL_INVALID. */ +} ble_gap_evt_qos_channel_survey_report_t; + +/**@brief GAP event structure. */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle on which event occurred. */ + union /**< union alternative identified by evt_id in enclosing struct. */ + { + ble_gap_evt_connected_t connected; /**< Connected Event Parameters. */ + ble_gap_evt_disconnected_t disconnected; /**< Disconnected Event Parameters. */ + ble_gap_evt_conn_param_update_t conn_param_update; /**< Connection Parameter Update Parameters. */ + ble_gap_evt_sec_params_request_t sec_params_request; /**< Security Parameters Request Event Parameters. */ + ble_gap_evt_sec_info_request_t sec_info_request; /**< Security Information Request Event Parameters. */ + ble_gap_evt_passkey_display_t passkey_display; /**< Passkey Display Event Parameters. */ + ble_gap_evt_key_pressed_t key_pressed; /**< Key Pressed Event Parameters. */ + ble_gap_evt_auth_key_request_t auth_key_request; /**< Authentication Key Request Event Parameters. */ + ble_gap_evt_lesc_dhkey_request_t lesc_dhkey_request; /**< LE Secure Connections DHKey calculation request. */ + ble_gap_evt_auth_status_t auth_status; /**< Authentication Status Event Parameters. */ + ble_gap_evt_conn_sec_update_t conn_sec_update; /**< Connection Security Update Event Parameters. */ + ble_gap_evt_timeout_t timeout; /**< Timeout Event Parameters. */ + ble_gap_evt_rssi_changed_t rssi_changed; /**< RSSI Event Parameters. */ + ble_gap_evt_adv_report_t adv_report; /**< Advertising Report Event Parameters. */ + ble_gap_evt_adv_set_terminated_t adv_set_terminated; /**< Advertising Set Terminated Event Parameters. */ + ble_gap_evt_sec_request_t sec_request; /**< Security Request Event Parameters. */ + ble_gap_evt_conn_param_update_request_t conn_param_update_request; /**< Connection Parameter Update Parameters. */ + ble_gap_evt_scan_req_report_t scan_req_report; /**< Scan Request Report Parameters. */ + ble_gap_evt_phy_update_request_t phy_update_request; /**< PHY Update Request Event Parameters. */ + ble_gap_evt_phy_update_t phy_update; /**< PHY Update Parameters. */ + ble_gap_evt_data_length_update_request_t data_length_update_request; /**< Data Length Update Request Event Parameters. */ + ble_gap_evt_data_length_update_t data_length_update; /**< Data Length Update Event Parameters. */ + ble_gap_evt_qos_channel_survey_report_t qos_channel_survey_report; /**< Quality of Service (QoS) Channel Survey Report Parameters. */ + } params; /**< Event Parameters. */ +} ble_gap_evt_t; + + +/** + * @brief BLE GAP connection configuration parameters, set with @ref sd_ble_cfg_set. + * + * @retval ::NRF_ERROR_CONN_COUNT The connection count for the connection configurations is zero. + * @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true: + * - The sum of conn_count for all connection configurations combined exceeds UINT8_MAX. + * - The event length is smaller than @ref BLE_GAP_EVENT_LENGTH_MIN. + */ +typedef struct +{ + uint8_t conn_count; /**< The number of concurrent connections the application can create with this configuration. + The default and minimum value is @ref BLE_GAP_CONN_COUNT_DEFAULT. */ + uint16_t event_length; /**< The time set aside for this connection on every connection interval in 1.25 ms units. + The default value is @ref BLE_GAP_EVENT_LENGTH_DEFAULT, the minimum value is @ref BLE_GAP_EVENT_LENGTH_MIN. + The event length and the connection interval are the primary parameters + for setting the throughput of a connection. + See the SoftDevice Specification for details on throughput. */ +} ble_gap_conn_cfg_t; + + +/** + * @brief Configuration of maximum concurrent connections in the different connected roles, set with + * @ref sd_ble_cfg_set. + * + * @retval ::NRF_ERROR_CONN_COUNT The sum of periph_role_count and central_role_count is too + * large. The maximum supported sum of concurrent connections is + * @ref BLE_GAP_ROLE_COUNT_COMBINED_MAX. + * @retval ::NRF_ERROR_INVALID_PARAM central_sec_count is larger than central_role_count. + * @retval ::NRF_ERROR_RESOURCES The adv_set_count is too large. The maximum + * supported advertising handles is + * @ref BLE_GAP_ADV_SET_COUNT_MAX. + */ +typedef struct +{ + uint8_t adv_set_count; /**< Maximum number of advertising sets. Default value is @ref BLE_GAP_ADV_SET_COUNT_DEFAULT. */ + uint8_t periph_role_count; /**< Maximum number of connections concurrently acting as a peripheral. Default value is @ref BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT. */ + uint8_t central_role_count; /**< Maximum number of connections concurrently acting as a central. Default value is @ref BLE_GAP_ROLE_COUNT_CENTRAL_DEFAULT. */ + uint8_t central_sec_count; /**< Number of SMP instances shared between all connections acting as a central. Default value is @ref BLE_GAP_ROLE_COUNT_CENTRAL_SEC_DEFAULT. */ + uint8_t qos_channel_survey_role_available:1; /**< If set, the Quality of Service (QoS) channel survey module is available to the + application using @ref sd_ble_gap_qos_channel_survey_start. */ +} ble_gap_cfg_role_count_t; + + +/** + * @brief Device name and its properties, set with @ref sd_ble_cfg_set. + * + * @note If the device name is not configured, the default device name will be + * @ref BLE_GAP_DEVNAME_DEFAULT, the maximum device name length will be + * @ref BLE_GAP_DEVNAME_DEFAULT_LEN, vloc will be set to @ref BLE_GATTS_VLOC_STACK and the device name + * will have no write access. + * + * @note If @ref max_len is more than @ref BLE_GAP_DEVNAME_DEFAULT_LEN and vloc is set to @ref BLE_GATTS_VLOC_STACK, + * the attribute table size must be increased to have room for the longer device name (see + * @ref sd_ble_cfg_set and @ref ble_gatts_cfg_attr_tab_size_t). + * + * @note If vloc is @ref BLE_GATTS_VLOC_STACK : + * - p_value must point to non-volatile memory (flash) or be NULL. + * - If p_value is NULL, the device name will initially be empty. + * + * @note If vloc is @ref BLE_GATTS_VLOC_USER : + * - p_value cannot be NULL. + * - If the device name is writable, p_value must point to volatile memory (RAM). + * + * @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true: + * - Invalid device name location (vloc). + * - Invalid device name security mode. + * @retval ::NRF_ERROR_INVALID_LENGTH One or more of the following is true: + * - The device name length is invalid (must be between 0 and @ref BLE_GAP_DEVNAME_MAX_LEN). + * - The device name length is too long for the given Attribute Table. + * @retval ::NRF_ERROR_NOT_SUPPORTED Device name security mode is not supported. + */ +typedef struct +{ + ble_gap_conn_sec_mode_t write_perm; /**< Write permissions. */ + uint8_t vloc:2; /**< Value location, see @ref BLE_GATTS_VLOCS.*/ + uint8_t *p_value; /**< Pointer to where the value (device name) is stored or will be stored. */ + uint16_t current_len; /**< Current length in bytes of the memory pointed to by p_value.*/ + uint16_t max_len; /**< Maximum length in bytes of the memory pointed to by p_value.*/ +} ble_gap_cfg_device_name_t; + + +/**@brief Peripheral Preferred Connection Parameters include configuration parameters, set with @ref sd_ble_cfg_set. */ +typedef struct +{ + uint8_t include_cfg; /**< Inclusion configuration of the Peripheral Preferred Connection Parameters characteristic. + See @ref BLE_GAP_CHAR_INCL_CONFIG. Default is @ref BLE_GAP_PPCP_INCL_CONFIG_DEFAULT. */ +} ble_gap_cfg_ppcp_incl_cfg_t; + + +/**@brief Central Address Resolution include configuration parameters, set with @ref sd_ble_cfg_set. */ +typedef struct +{ + uint8_t include_cfg; /**< Inclusion configuration of the Central Address Resolution characteristic. + See @ref BLE_GAP_CHAR_INCL_CONFIG. Default is @ref BLE_GAP_CAR_INCL_CONFIG_DEFAULT. */ +} ble_gap_cfg_car_incl_cfg_t; + + +/**@brief Configuration structure for GAP configurations. */ +typedef union +{ + ble_gap_cfg_role_count_t role_count_cfg; /**< Role count configuration, cfg_id is @ref BLE_GAP_CFG_ROLE_COUNT. */ + ble_gap_cfg_device_name_t device_name_cfg; /**< Device name configuration, cfg_id is @ref BLE_GAP_CFG_DEVICE_NAME. */ + ble_gap_cfg_ppcp_incl_cfg_t ppcp_include_cfg; /**< Peripheral Preferred Connection Parameters characteristic include + configuration, cfg_id is @ref BLE_GAP_CFG_PPCP_INCL_CONFIG. */ + ble_gap_cfg_car_incl_cfg_t car_include_cfg; /**< Central Address Resolution characteristic include configuration, + cfg_id is @ref BLE_GAP_CFG_CAR_INCL_CONFIG. */ +} ble_gap_cfg_t; + + +/**@brief Channel Map option. + * + * @details Used with @ref sd_ble_opt_get to get the current channel map + * or @ref sd_ble_opt_set to set a new channel map. When setting the + * channel map, it applies to all current and future connections. When getting the + * current channel map, it applies to a single connection and the connection handle + * must be supplied. + * + * @note Setting the channel map may take some time, depending on connection parameters. + * The time taken may be different for each connection and the get operation will + * return the previous channel map until the new one has taken effect. + * + * @note After setting the channel map, by spec it can not be set again until at least 1 s has passed. + * See Bluetooth Specification Version 4.1 Volume 2, Part E, Section 7.3.46. + * + * @retval ::NRF_SUCCESS Get or set successful. + * @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true: + * - Less then two bits in @ref ch_map are set. + * - Bits for primary advertising channels (37-39) are set. + * @retval ::NRF_ERROR_BUSY Channel map was set again before enough time had passed. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied for get. + * + */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle (only applicable for get) */ + uint8_t ch_map[5]; /**< Channel Map (37-bit). */ +} ble_gap_opt_ch_map_t; + + +/**@brief Local connection latency option. + * + * @details Local connection latency is a feature which enables the slave to improve + * current consumption by ignoring the slave latency set by the peer. The + * local connection latency can only be set to a multiple of the slave latency, + * and cannot be longer than half of the supervision timeout. + * + * @details Used with @ref sd_ble_opt_set to set the local connection latency. The + * @ref sd_ble_opt_get is not supported for this option, but the actual + * local connection latency (unless set to NULL) is set as a return parameter + * when setting the option. + * + * @note The latency set will be truncated down to the closest slave latency event + * multiple, or the nearest multiple before half of the supervision timeout. + * + * @note The local connection latency is disabled by default, and needs to be enabled for new + * connections and whenever the connection is updated. + * + * @retval ::NRF_SUCCESS Set successfully. + * @retval ::NRF_ERROR_NOT_SUPPORTED Get is not supported. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter. + */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle */ + uint16_t requested_latency; /**< Requested local connection latency. */ + uint16_t * p_actual_latency; /**< Pointer to storage for the actual local connection latency (can be set to NULL to skip return value). */ +} ble_gap_opt_local_conn_latency_t; + +/**@brief Disable slave latency + * + * @details Used with @ref sd_ble_opt_set to temporarily disable slave latency of a peripheral connection + * (see @ref ble_gap_conn_params_t::slave_latency). And to re-enable it again. When disabled, the + * peripheral will ignore the slave_latency set by the central. + * + * @note Shall only be called on peripheral links. + * + * @retval ::NRF_SUCCESS Set successfully. + * @retval ::NRF_ERROR_NOT_SUPPORTED Get is not supported. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter. + */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle */ + uint8_t disable : 1; /**< Set to 1 to disable slave latency. Set to 0 enable it again.*/ +} ble_gap_opt_slave_latency_disable_t; + +/**@brief Passkey Option. + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_BONDING_STATIC_PK_MSC} + * @endmscs + * + * @details Structure containing the passkey to be used during pairing. This can be used with @ref + * sd_ble_opt_set to make the SoftDevice use a preprogrammed passkey for authentication + * instead of generating a random one. + * + * @note Repeated pairing attempts using the same preprogrammed passkey makes pairing vulnerable to MITM attacks. + * + * @note @ref sd_ble_opt_get is not supported for this option. + * + */ +typedef struct +{ + uint8_t const * p_passkey; /**< Pointer to 6-digit ASCII string (digit 0..9 only, no NULL termination) passkey to be used during pairing. If this is NULL, the SoftDevice will generate a random passkey if required.*/ +} ble_gap_opt_passkey_t; + + +/**@brief Compatibility mode 1 option. + * + * @details This can be used with @ref sd_ble_opt_set to enable and disable + * compatibility mode 1. Compatibility mode 1 is disabled by default. + * + * @note Compatibility mode 1 enables interoperability with devices that do not support a value of + * 0 for the WinOffset parameter in the Link Layer CONNECT_IND packet. This applies to a + * limited set of legacy peripheral devices from another vendor. Enabling this compatibility + * mode will only have an effect if the local device will act as a central device and + * initiate a connection to a peripheral device. In that case it may lead to the connection + * creation taking up to one connection interval longer to complete for all connections. + * + * @retval ::NRF_SUCCESS Set successfully. + * @retval ::NRF_ERROR_INVALID_STATE When connection creation is ongoing while mode 1 is set. + */ +typedef struct +{ + uint8_t enable : 1; /**< Enable compatibility mode 1.*/ +} ble_gap_opt_compat_mode_1_t; + + +/**@brief Authenticated payload timeout option. + * + * @details This can be used with @ref sd_ble_opt_set to change the Authenticated payload timeout to a value other + * than the default of @ref BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX. + * + * @note The authenticated payload timeout event ::BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD will be generated + * if auth_payload_timeout time has elapsed without receiving a packet with a valid MIC on an encrypted + * link. + * + * @note The LE ping procedure will be initiated before the timer expires to give the peer a chance + * to reset the timer. In addition the stack will try to prioritize running of LE ping over other + * activities to increase chances of finishing LE ping before timer expires. To avoid side-effects + * on other activities, it is recommended to use high timeout values. + * Recommended timeout > 2*(connInterval * (6 + connSlaveLatency)). + * + * @retval ::NRF_SUCCESS Set successfully. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. auth_payload_timeout was outside of allowed range. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter. + */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle */ + uint16_t auth_payload_timeout; /**< Requested timeout in 10 ms unit, see @ref BLE_GAP_AUTH_PAYLOAD_TIMEOUT. */ +} ble_gap_opt_auth_payload_timeout_t; + +/**@brief Option structure for GAP options. */ +typedef union +{ + ble_gap_opt_ch_map_t ch_map; /**< Parameters for the Channel Map option. */ + ble_gap_opt_local_conn_latency_t local_conn_latency; /**< Parameters for the Local connection latency option */ + ble_gap_opt_passkey_t passkey; /**< Parameters for the Passkey option.*/ + ble_gap_opt_compat_mode_1_t compat_mode_1; /**< Parameters for the compatibility mode 1 option.*/ + ble_gap_opt_auth_payload_timeout_t auth_payload_timeout; /**< Parameters for the authenticated payload timeout option.*/ + ble_gap_opt_slave_latency_disable_t slave_latency_disable; /**< Parameters for the Disable slave latency option */ +} ble_gap_opt_t; + +/**@brief Connection event triggering parameters. */ +typedef struct +{ + uint8_t ppi_ch_id; /**< PPI channel to use. This channel should be regarded as reserved until + connection event PPI task triggering is stopped. + The PPI channel ID can not be one of the PPI channels reserved by + the SoftDevice. See @ref NRF_SOC_SD_PPI_CHANNELS_SD_ENABLED_MSK. */ + uint32_t task_endpoint; /**< Task Endpoint to trigger. */ + uint16_t conn_evt_counter_start; /**< The connection event on which the task triggering should start. */ + uint16_t period_in_events; /**< Trigger period. Valid range is [1, 32767]. + If the device is in slave role and slave latency is enabled, + this parameter should be set to a multiple of (slave latency + 1) + to ensure low power operation. */ +} ble_gap_conn_event_trigger_t; +/**@} */ + +/**@addtogroup BLE_GAP_FUNCTIONS Functions + * @{ */ + +/**@brief Set the local Bluetooth identity address. + * + * The local Bluetooth identity address is the address that identifies this device to other peers. + * The address type must be either @ref BLE_GAP_ADDR_TYPE_PUBLIC or @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC. + * + * @note The identity address cannot be changed while advertising, scanning or creating a connection. + * + * @note This address will be distributed to the peer during bonding. + * If the address changes, the address stored in the peer device will not be valid and the ability to + * reconnect using the old address will be lost. + * + * @note By default the SoftDevice will set an address of type @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC upon being + * enabled. The address is a random number populated during the IC manufacturing process and remains unchanged + * for the lifetime of each IC. + * + * @mscs + * @mmsc{@ref BLE_GAP_ADV_MSC} + * @endmscs + * + * @param[in] p_addr Pointer to address structure. + * + * @retval ::NRF_SUCCESS Address successfully set. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address. + * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. + * @retval ::NRF_ERROR_INVALID_STATE The identity address cannot be changed while advertising, + * scanning or creating a connection. + */ +SVCALL(SD_BLE_GAP_ADDR_SET, uint32_t, sd_ble_gap_addr_set(ble_gap_addr_t const *p_addr)); + + +/**@brief Get local Bluetooth identity address. + * + * @note This will always return the identity address irrespective of the privacy settings, + * i.e. the address type will always be either @ref BLE_GAP_ADDR_TYPE_PUBLIC or @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC. + * + * @param[out] p_addr Pointer to address structure to be filled in. + * + * @retval ::NRF_SUCCESS Address successfully retrieved. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied. + */ +SVCALL(SD_BLE_GAP_ADDR_GET, uint32_t, sd_ble_gap_addr_get(ble_gap_addr_t *p_addr)); + + +/**@brief Get the Bluetooth device address used by the advertiser. + * + * @note This function will return the local Bluetooth address used in advertising PDUs. When + * using privacy, the SoftDevice will generate a new private address every + * @ref ble_gap_privacy_params_t::private_addr_cycle_s configured using + * @ref sd_ble_gap_privacy_set. Hence depending on when the application calls this API, the + * address returned may not be the latest address that is used in the advertising PDUs. + * + * @param[in] adv_handle The advertising handle to get the address from. + * @param[out] p_addr Pointer to address structure to be filled in. + * + * @retval ::NRF_SUCCESS Address successfully retrieved. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied. + * @retval ::BLE_ERROR_INVALID_ADV_HANDLE The provided advertising handle was not found. + * @retval ::NRF_ERROR_INVALID_STATE The advertising set is currently not advertising. + */ +SVCALL(SD_BLE_GAP_ADV_ADDR_GET, uint32_t, sd_ble_gap_adv_addr_get(uint8_t adv_handle, ble_gap_addr_t *p_addr)); + + +/**@brief Set the active whitelist in the SoftDevice. + * + * @note Only one whitelist can be used at a time and the whitelist is shared between the BLE roles. + * The whitelist cannot be set if a BLE role is using the whitelist. + * + * @note If an address is resolved using the information in the device identity list, then the whitelist + * filter policy applies to the peer identity address and not the resolvable address sent on air. + * + * @mscs + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_SCAN_PRIVATE_SCAN_MSC} + * @endmscs + * + * @param[in] pp_wl_addrs Pointer to a whitelist of peer addresses, if NULL the whitelist will be cleared. + * @param[in] len Length of the whitelist, maximum @ref BLE_GAP_WHITELIST_ADDR_MAX_COUNT. + * + * @retval ::NRF_SUCCESS The whitelist is successfully set/cleared. + * @retval ::NRF_ERROR_INVALID_ADDR The whitelist (or one of its entries) provided is invalid. + * @retval ::BLE_ERROR_GAP_WHITELIST_IN_USE The whitelist is in use by a BLE role and cannot be set or cleared. + * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied. + * @retval ::NRF_ERROR_DATA_SIZE The given whitelist size is invalid (zero or too large); this can only return when + * pp_wl_addrs is not NULL. + */ +SVCALL(SD_BLE_GAP_WHITELIST_SET, uint32_t, sd_ble_gap_whitelist_set(ble_gap_addr_t const * const * pp_wl_addrs, uint8_t len)); + + +/**@brief Set device identity list. + * + * @note Only one device identity list can be used at a time and the list is shared between the BLE roles. + * The device identity list cannot be set if a BLE role is using the list. + * + * @param[in] pp_id_keys Pointer to an array of peer identity addresses and peer IRKs, if NULL the device identity list will be cleared. + * @param[in] pp_local_irks Pointer to an array of local IRKs. Each entry in the array maps to the entry in pp_id_keys at the same index. + * To fill in the list with the currently set device IRK for all peers, set to NULL. + * @param[in] len Length of the device identity list, maximum @ref BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT. + * + * @mscs + * @mmsc{@ref BLE_GAP_PRIVACY_ADV_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_SCAN_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_SCAN_PRIVATE_SCAN_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_CONN_PRIV_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_CONN_PRIV_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS The device identity list successfully set/cleared. + * @retval ::NRF_ERROR_INVALID_ADDR The device identity list (or one of its entries) provided is invalid. + * This code may be returned if the local IRK list also has an invalid entry. + * @retval ::BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE The device identity list is in use and cannot be set or cleared. + * @retval ::BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE The device identity list contains multiple entries with the same identity address. + * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied. + * @retval ::NRF_ERROR_DATA_SIZE The given device identity list size invalid (zero or too large); this can + * only return when pp_id_keys is not NULL. + */ +SVCALL(SD_BLE_GAP_DEVICE_IDENTITIES_SET, uint32_t, sd_ble_gap_device_identities_set(ble_gap_id_key_t const * const * pp_id_keys, ble_gap_irk_t const * const * pp_local_irks, uint8_t len)); + + +/**@brief Set privacy settings. + * + * @note Privacy settings cannot be changed while advertising, scanning or creating a connection. + * + * @param[in] p_privacy_params Privacy settings. + * + * @mscs + * @mmsc{@ref BLE_GAP_PRIVACY_ADV_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_SCAN_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS Set successfully. + * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. + * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied. + * @retval ::NRF_ERROR_INVALID_ADDR The pointer to privacy settings is NULL or invalid. + * Otherwise, the p_device_irk pointer in privacy parameter is an invalid pointer. + * @retval ::NRF_ERROR_INVALID_PARAM Out of range parameters are provided. + * @retval ::NRF_ERROR_NOT_SUPPORTED The SoftDevice does not support privacy if the Central Address Resolution + characteristic is not configured to be included and the SoftDevice is configured + to support central roles. + See @ref ble_gap_cfg_car_incl_cfg_t and @ref ble_gap_cfg_role_count_t. + * @retval ::NRF_ERROR_INVALID_STATE Privacy settings cannot be changed while advertising, scanning + * or creating a connection. + */ +SVCALL(SD_BLE_GAP_PRIVACY_SET, uint32_t, sd_ble_gap_privacy_set(ble_gap_privacy_params_t const *p_privacy_params)); + + +/**@brief Get privacy settings. + * + * @note ::ble_gap_privacy_params_t::p_device_irk must be initialized to NULL or a valid address before this function is called. + * If it is initialized to a valid address, the address pointed to will contain the current device IRK on return. + * + * @param[in,out] p_privacy_params Privacy settings. + * + * @retval ::NRF_SUCCESS Privacy settings read. + * @retval ::NRF_ERROR_INVALID_ADDR The pointer given for returning the privacy settings may be NULL or invalid. + * Otherwise, the p_device_irk pointer in privacy parameter is an invalid pointer. + */ +SVCALL(SD_BLE_GAP_PRIVACY_GET, uint32_t, sd_ble_gap_privacy_get(ble_gap_privacy_params_t *p_privacy_params)); + + +/**@brief Configure an advertising set. Set, clear or update advertising and scan response data. + * + * @note The format of the advertising data will be checked by this call to ensure interoperability. + * Limitations imposed by this API call to the data provided include having a flags data type in the scan response data and + * duplicating the local name in the advertising data and scan response data. + * + * @note In order to update advertising data while advertising, new advertising buffers must be provided. + * + * @mscs + * @mmsc{@ref BLE_GAP_ADV_MSC} + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @endmscs + * + * @param[in,out] p_adv_handle Provide a pointer to a handle containing @ref BLE_GAP_ADV_SET_HANDLE_NOT_SET to configure + * a new advertising set. On success, a new handle is then returned through the pointer. + * Provide a pointer to an existing advertising handle to configure an existing advertising set. + * @param[in] p_adv_data Advertising data. If set to NULL, no advertising data will be used. See @ref ble_gap_adv_data_t. + * @param[in] p_adv_params Advertising parameters. When this function is used to update advertising data while advertising, + * this parameter must be NULL. See @ref ble_gap_adv_params_t. + * + * @retval ::NRF_SUCCESS Advertising set successfully configured. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied: + * - Invalid advertising data configuration specified. See @ref ble_gap_adv_data_t. + * - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t. + * - Use of whitelist requested but whitelist has not been set, + * see @ref sd_ble_gap_whitelist_set. + * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR ble_gap_adv_params_t::p_peer_addr is invalid. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - It is invalid to provide non-NULL advertising set parameters while advertising. + * - It is invalid to provide the same data buffers while advertising. To update + * advertising data, provide new advertising buffers. + * @retval ::BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST Discoverable mode and whitelist incompatible. + * @retval ::BLE_ERROR_INVALID_ADV_HANDLE The provided advertising handle was not found. Use @ref BLE_GAP_ADV_SET_HANDLE_NOT_SET to + * configure a new advertising handle. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_FLAGS Invalid combination of advertising flags supplied. + * @retval ::NRF_ERROR_INVALID_DATA Invalid data type(s) supplied. Check the advertising data format specification + * given in Bluetooth Specification Version 5.0, Volume 3, Part C, Chapter 11. + * @retval ::NRF_ERROR_INVALID_LENGTH Invalid data length(s) supplied. + * @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported data length or advertising parameter configuration. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to configure a new advertising handle. Update an + * existing advertising handle instead. + * @retval ::BLE_ERROR_GAP_UUID_LIST_MISMATCH Invalid UUID list supplied. + */ +SVCALL(SD_BLE_GAP_ADV_SET_CONFIGURE, uint32_t, sd_ble_gap_adv_set_configure(uint8_t *p_adv_handle, ble_gap_adv_data_t const *p_adv_data, ble_gap_adv_params_t const *p_adv_params)); + + +/**@brief Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). + * + * @note Only one advertiser may be active at any time. + * + * @note If privacy is enabled, the advertiser's private address will be refreshed when this function is called. + * See @ref sd_ble_gap_privacy_set(). + * + * @events + * @event{@ref BLE_GAP_EVT_CONNECTED, Generated after connection has been established through connectable advertising.} + * @event{@ref BLE_GAP_EVT_ADV_SET_TERMINATED, Advertising set has terminated.} + * @event{@ref BLE_GAP_EVT_SCAN_REQ_REPORT, A scan request was received.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_ADV_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_CONN_PRIV_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC} + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @endmscs + * + * @param[in] adv_handle Advertising handle to advertise on, received from @ref sd_ble_gap_adv_set_configure. + * @param[in] conn_cfg_tag Tag identifying a configuration set by @ref sd_ble_cfg_set or + * @ref BLE_CONN_CFG_TAG_DEFAULT to use the default connection configuration. For non-connectable + * advertising, this is ignored. + * + * @retval ::NRF_SUCCESS The BLE stack has started advertising. + * @retval ::NRF_ERROR_INVALID_STATE adv_handle is not configured or already advertising. + * @retval ::NRF_ERROR_CONN_COUNT The limit of available connections for this connection configuration + * tag has been reached; connectable advertiser cannot be started. + * To increase the number of available connections, + * use @ref sd_ble_cfg_set with @ref BLE_GAP_CFG_ROLE_COUNT or @ref BLE_CONN_CFG_GAP. + * @retval ::BLE_ERROR_INVALID_ADV_HANDLE Advertising handle not found. Configure a new adveriting handle with @ref sd_ble_gap_adv_set_configure. + * @retval ::NRF_ERROR_NOT_FOUND conn_cfg_tag not found. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied: + * - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t. + * - Use of whitelist requested but whitelist has not been set, see @ref sd_ble_gap_whitelist_set. + * @retval ::NRF_ERROR_RESOURCES Either: + * - adv_handle is configured with connectable advertising, but the event_length parameter + * associated with conn_cfg_tag is too small to be able to establish a connection on + * the selected advertising phys. Use @ref sd_ble_cfg_set to increase the event length. + * - Not enough BLE role slots available. + Stop one or more currently active roles (Central, Peripheral, Broadcaster or Observer) and try again. + * - p_adv_params is configured with connectable advertising, but the event_length parameter + * associated with conn_cfg_tag is too small to be able to establish a connection on + * the selected advertising phys. Use @ref sd_ble_cfg_set to increase the event length. + */ +SVCALL(SD_BLE_GAP_ADV_START, uint32_t, sd_ble_gap_adv_start(uint8_t adv_handle, uint8_t conn_cfg_tag)); + + +/**@brief Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). + * + * @mscs + * @mmsc{@ref BLE_GAP_ADV_MSC} + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @endmscs + * + * @param[in] adv_handle The advertising handle that should stop advertising. + * + * @retval ::NRF_SUCCESS The BLE stack has stopped advertising. + * @retval ::BLE_ERROR_INVALID_ADV_HANDLE Invalid advertising handle. + * @retval ::NRF_ERROR_INVALID_STATE The advertising handle is not advertising. + */ +SVCALL(SD_BLE_GAP_ADV_STOP, uint32_t, sd_ble_gap_adv_stop(uint8_t adv_handle)); + + + +/**@brief Update connection parameters. + * + * @details In the central role this will initiate a Link Layer connection parameter update procedure, + * otherwise in the peripheral role, this will send the corresponding L2CAP request and wait for + * the central to perform the procedure. In both cases, and regardless of success or failure, the application + * will be informed of the result with a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE event. + * + * @details This function can be used as a central both to reply to a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST or to start the procedure unrequested. + * + * @events + * @event{@ref BLE_GAP_EVT_CONN_PARAM_UPDATE, Result of the connection parameter update procedure.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_CPU_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC} + * @mmsc{@ref BLE_GAP_MULTILINK_CPU_MSC} + * @mmsc{@ref BLE_GAP_MULTILINK_CTRL_PROC_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_CPU_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_conn_params Pointer to desired connection parameters. If NULL is provided on a peripheral role, + * the parameters in the PPCP characteristic of the GAP service will be used instead. + * If NULL is provided on a central role and in response to a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST, the peripheral request will be rejected + * + * @retval ::NRF_SUCCESS The Connection Update procedure has been started successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints. + * @retval ::NRF_ERROR_INVALID_STATE Disconnection in progress or link has not been established. + * @retval ::NRF_ERROR_BUSY Procedure already in progress, wait for pending procedures to complete and retry. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. + */ +SVCALL(SD_BLE_GAP_CONN_PARAM_UPDATE, uint32_t, sd_ble_gap_conn_param_update(uint16_t conn_handle, ble_gap_conn_params_t const *p_conn_params)); + + +/**@brief Disconnect (GAP Link Termination). + * + * @details This call initiates the disconnection procedure, and its completion will be communicated to the application + * with a @ref BLE_GAP_EVT_DISCONNECTED event. + * + * @events + * @event{@ref BLE_GAP_EVT_DISCONNECTED, Generated when disconnection procedure is complete.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_CONN_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] hci_status_code HCI status code, see @ref BLE_HCI_STATUS_CODES (accepted values are @ref BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION and @ref BLE_HCI_CONN_INTERVAL_UNACCEPTABLE). + * + * @retval ::NRF_SUCCESS The disconnection procedure has been started successfully. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_INVALID_STATE Disconnection in progress or link has not been established. + */ +SVCALL(SD_BLE_GAP_DISCONNECT, uint32_t, sd_ble_gap_disconnect(uint16_t conn_handle, uint8_t hci_status_code)); + + +/**@brief Set the radio's transmit power. + * + * @param[in] role The role to set the transmit power for, see @ref BLE_GAP_TX_POWER_ROLES for + * possible roles. + * @param[in] handle The handle parameter is interpreted depending on role: + * - If role is @ref BLE_GAP_TX_POWER_ROLE_CONN, this value is the specific connection handle. + * - If role is @ref BLE_GAP_TX_POWER_ROLE_ADV, the advertising set identified with the advertising handle, + * will use the specified transmit power, and include it in the advertising packet headers if + * @ref ble_gap_adv_properties_t::include_tx_power set. + * - For all other roles handle is ignored. + * @param[in] tx_power Radio transmit power in dBm (see note for accepted values). + * + * @note Supported tx_power values: -40dBm, -20dBm, -16dBm, -12dBm, -8dBm, -4dBm, 0dBm, +2dBm, +3dBm, +4dBm, +5dBm, +6dBm, +7dBm and +8dBm. + * @note The initiator will have the same transmit power as the scanner. + * @note When a connection is created it will inherit the transmit power from the initiator or + * advertiser leading to the connection. + * + * @retval ::NRF_SUCCESS Successfully changed the transmit power. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::BLE_ERROR_INVALID_ADV_HANDLE Advertising handle not found. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_TX_POWER_SET, uint32_t, sd_ble_gap_tx_power_set(uint8_t role, uint16_t handle, int8_t tx_power)); + + +/**@brief Set GAP Appearance value. + * + * @param[in] appearance Appearance (16-bit), see @ref BLE_APPEARANCES. + * + * @retval ::NRF_SUCCESS Appearance value set successfully. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + */ +SVCALL(SD_BLE_GAP_APPEARANCE_SET, uint32_t, sd_ble_gap_appearance_set(uint16_t appearance)); + + +/**@brief Get GAP Appearance value. + * + * @param[out] p_appearance Pointer to appearance (16-bit) to be filled in, see @ref BLE_APPEARANCES. + * + * @retval ::NRF_SUCCESS Appearance value retrieved successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + */ +SVCALL(SD_BLE_GAP_APPEARANCE_GET, uint32_t, sd_ble_gap_appearance_get(uint16_t *p_appearance)); + + +/**@brief Set GAP Peripheral Preferred Connection Parameters. + * + * @param[in] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure with the desired parameters. + * + * @retval ::NRF_SUCCESS Peripheral Preferred Connection Parameters set successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_NOT_SUPPORTED The characteristic is not included in the Attribute Table, + see @ref ble_gap_cfg_ppcp_incl_cfg_t. + */ +SVCALL(SD_BLE_GAP_PPCP_SET, uint32_t, sd_ble_gap_ppcp_set(ble_gap_conn_params_t const *p_conn_params)); + + +/**@brief Get GAP Peripheral Preferred Connection Parameters. + * + * @param[out] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure where the parameters will be stored. + * + * @retval ::NRF_SUCCESS Peripheral Preferred Connection Parameters retrieved successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_NOT_SUPPORTED The characteristic is not included in the Attribute Table, + see @ref ble_gap_cfg_ppcp_incl_cfg_t. + */ +SVCALL(SD_BLE_GAP_PPCP_GET, uint32_t, sd_ble_gap_ppcp_get(ble_gap_conn_params_t *p_conn_params)); + + +/**@brief Set GAP device name. + * + * @note If the device name is located in application flash memory (see @ref ble_gap_cfg_device_name_t), + * it cannot be changed. Then @ref NRF_ERROR_FORBIDDEN will be returned. + * + * @param[in] p_write_perm Write permissions for the Device Name characteristic, see @ref ble_gap_conn_sec_mode_t. + * @param[in] p_dev_name Pointer to a UTF-8 encoded, non NULL-terminated string. + * @param[in] len Length of the UTF-8, non NULL-terminated string pointed to by p_dev_name in octets (must be smaller or equal than @ref BLE_GAP_DEVNAME_MAX_LEN). + * + * @retval ::NRF_SUCCESS GAP device name and permissions set successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. + * @retval ::NRF_ERROR_FORBIDDEN Device name is not writable. + */ +SVCALL(SD_BLE_GAP_DEVICE_NAME_SET, uint32_t, sd_ble_gap_device_name_set(ble_gap_conn_sec_mode_t const *p_write_perm, uint8_t const *p_dev_name, uint16_t len)); + + +/**@brief Get GAP device name. + * + * @note If the device name is longer than the size of the supplied buffer, + * p_len will return the complete device name length, + * and not the number of bytes actually returned in p_dev_name. + * The application may use this information to allocate a suitable buffer size. + * + * @param[out] p_dev_name Pointer to an empty buffer where the UTF-8 non NULL-terminated string will be placed. Set to NULL to obtain the complete device name length. + * @param[in,out] p_len Length of the buffer pointed by p_dev_name, complete device name length on output. + * + * @retval ::NRF_SUCCESS GAP device name retrieved successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. + */ +SVCALL(SD_BLE_GAP_DEVICE_NAME_GET, uint32_t, sd_ble_gap_device_name_get(uint8_t *p_dev_name, uint16_t *p_len)); + + +/**@brief Initiate the GAP Authentication procedure. + * + * @details In the central role, this function will send an SMP Pairing Request (or an SMP Pairing Failed if rejected), + * otherwise in the peripheral role, an SMP Security Request will be sent. + * + * @events + * @event{Depending on the security parameters set and the packet exchanges with the peer\, the following events may be generated:} + * @event{@ref BLE_GAP_EVT_SEC_PARAMS_REQUEST} + * @event{@ref BLE_GAP_EVT_SEC_INFO_REQUEST} + * @event{@ref BLE_GAP_EVT_PASSKEY_DISPLAY} + * @event{@ref BLE_GAP_EVT_KEY_PRESSED} + * @event{@ref BLE_GAP_EVT_AUTH_KEY_REQUEST} + * @event{@ref BLE_GAP_EVT_LESC_DHKEY_REQUEST} + * @event{@ref BLE_GAP_EVT_CONN_SEC_UPDATE} + * @event{@ref BLE_GAP_EVT_AUTH_STATUS} + * @event{@ref BLE_GAP_EVT_TIMEOUT} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_SEC_REQ_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_SEC_REQ_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_sec_params Pointer to the @ref ble_gap_sec_params_t structure with the security parameters to be used during the pairing or bonding procedure. + * In the peripheral role, only the bond, mitm, lesc and keypress fields of this structure are used. + * In the central role, this pointer may be NULL to reject a Security Request. + * + * @retval ::NRF_SUCCESS Successfully initiated authentication procedure. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - No link has been established. + * - An encryption is already executing or queued. + * @retval ::NRF_ERROR_NO_MEM The maximum number of authentication procedures that can run in parallel for the given role is reached. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_NOT_SUPPORTED Setting of sign or link fields in @ref ble_gap_sec_kdist_t not supported. + * Distribution of own Identity Information is only supported if the Central + * Address Resolution characteristic is configured to be included or + * the Softdevice is configured to support peripheral roles only. + * See @ref ble_gap_cfg_car_incl_cfg_t and @ref ble_gap_cfg_role_count_t. + * @retval ::NRF_ERROR_TIMEOUT A SMP timeout has occurred, and further SMP operations on this link is prohibited. + */ +SVCALL(SD_BLE_GAP_AUTHENTICATE, uint32_t, sd_ble_gap_authenticate(uint16_t conn_handle, ble_gap_sec_params_t const *p_sec_params)); + + +/**@brief Reply with GAP security parameters. + * + * @details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE. + * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters. + * + * @events + * @event{This function is used during authentication procedures, see the list of events in the documentation of @ref sd_ble_gap_authenticate.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_BONDING_JW_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_PERIPH_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_BONDING_STATIC_PK_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_CONFIRM_FAIL_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_KS_TOO_SMALL_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_APP_ERROR_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_REMOTE_PAIRING_FAIL_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_TIMEOUT_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] sec_status Security status, see @ref BLE_GAP_SEC_STATUS. + * @param[in] p_sec_params Pointer to a @ref ble_gap_sec_params_t security parameters structure. In the central role this must be set to NULL, as the parameters have + * already been provided during a previous call to @ref sd_ble_gap_authenticate. + * @param[in,out] p_sec_keyset Pointer to a @ref ble_gap_sec_keyset_t security keyset structure. Any keys generated and/or distributed as a result of the ongoing security procedure + * will be stored into the memory referenced by the pointers inside this structure. The keys will be stored and available to the application + * upon reception of a @ref BLE_GAP_EVT_AUTH_STATUS event. + * Note that the SoftDevice expects the application to provide memory for storing the + * peer's keys. So it must be ensured that the relevant pointers inside this structure are not NULL. The pointers to the local key + * can, however, be NULL, in which case, the local key data will not be available to the application upon reception of the + * @ref BLE_GAP_EVT_AUTH_STATUS event. + * + * @retval ::NRF_SUCCESS Successfully accepted security parameter from the application. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE Security parameters has not been requested. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_NOT_SUPPORTED Setting of sign or link fields in @ref ble_gap_sec_kdist_t not supported. + * Distribution of own Identity Information is only supported if the Central + * Address Resolution characteristic is configured to be included or + * the Softdevice is configured to support peripheral roles only. + * See @ref ble_gap_cfg_car_incl_cfg_t and @ref ble_gap_cfg_role_count_t. + */ +SVCALL(SD_BLE_GAP_SEC_PARAMS_REPLY, uint32_t, sd_ble_gap_sec_params_reply(uint16_t conn_handle, uint8_t sec_status, ble_gap_sec_params_t const *p_sec_params, ble_gap_sec_keyset_t const *p_sec_keyset)); + + +/**@brief Reply with an authentication key. + * + * @details This function is only used to reply to a @ref BLE_GAP_EVT_AUTH_KEY_REQUEST or a @ref BLE_GAP_EVT_PASSKEY_DISPLAY, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE. + * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters. + * + * @events + * @event{This function is used during authentication procedures\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] key_type See @ref BLE_GAP_AUTH_KEY_TYPES. + * @param[in] p_key If key type is @ref BLE_GAP_AUTH_KEY_TYPE_NONE, then NULL. + * If key type is @ref BLE_GAP_AUTH_KEY_TYPE_PASSKEY, then a 6-byte ASCII string (digit 0..9 only, no NULL termination) + * or NULL when confirming LE Secure Connections Numeric Comparison. + * If key type is @ref BLE_GAP_AUTH_KEY_TYPE_OOB, then a 16-byte OOB key value in little-endian format. + * + * @retval ::NRF_SUCCESS Authentication key successfully set. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE Authentication key has not been requested. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_AUTH_KEY_REPLY, uint32_t, sd_ble_gap_auth_key_reply(uint16_t conn_handle, uint8_t key_type, uint8_t const *p_key)); + + +/**@brief Reply with an LE Secure connections DHKey. + * + * @details This function is only used to reply to a @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE. + * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters. + * + * @events + * @event{This function is used during authentication procedures\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_dhkey LE Secure Connections DHKey. + * + * @retval ::NRF_SUCCESS DHKey successfully set. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - The peer is not authenticated. + * - The application has not pulled a @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST event. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_LESC_DHKEY_REPLY, uint32_t, sd_ble_gap_lesc_dhkey_reply(uint16_t conn_handle, ble_gap_lesc_dhkey_t const *p_dhkey)); + + +/**@brief Notify the peer of a local keypress. + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] kp_not See @ref BLE_GAP_KP_NOT_TYPES. + * + * @retval ::NRF_SUCCESS Keypress notification successfully queued for transmission. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - Authentication key not requested. + * - Passkey has not been entered. + * - Keypresses have not been enabled by both peers. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_BUSY The BLE stack is busy. Retry at later time. + */ +SVCALL(SD_BLE_GAP_KEYPRESS_NOTIFY, uint32_t, sd_ble_gap_keypress_notify(uint16_t conn_handle, uint8_t kp_not)); + + +/**@brief Generate a set of OOB data to send to a peer out of band. + * + * @note The @ref ble_gap_addr_t included in the OOB data returned will be the currently active one (or, if a connection has already been established, + * the one used during connection setup). The application may manually overwrite it with an updated value. + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. Can be @ref BLE_CONN_HANDLE_INVALID if a BLE connection has not been established yet. + * @param[in] p_pk_own LE Secure Connections local P-256 Public Key. + * @param[out] p_oobd_own The OOB data to be sent out of band to a peer. + * + * @retval ::NRF_SUCCESS OOB data successfully generated. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_LESC_OOB_DATA_GET, uint32_t, sd_ble_gap_lesc_oob_data_get(uint16_t conn_handle, ble_gap_lesc_p256_pk_t const *p_pk_own, ble_gap_lesc_oob_data_t *p_oobd_own)); + +/**@brief Provide the OOB data sent/received out of band. + * + * @note An authentication procedure with OOB selected as an algorithm must be in progress when calling this function. + * @note A @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST event with the oobd_req set to 1 must have been received prior to calling this function. + * + * @events + * @event{This function is used during authentication procedures\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_oobd_own The OOB data sent out of band to a peer or NULL if the peer has not received OOB data. + * Must correspond to @ref ble_gap_sec_params_t::oob flag in @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST. + * @param[in] p_oobd_peer The OOB data received out of band from a peer or NULL if none received. + * Must correspond to @ref ble_gap_sec_params_t::oob flag + * in @ref sd_ble_gap_authenticate in the central role or + * in @ref sd_ble_gap_sec_params_reply in the peripheral role. + * + * @retval ::NRF_SUCCESS OOB data accepted. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - Authentication key not requested + * - Not expecting LESC OOB data + * - Have not actually exchanged passkeys. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_LESC_OOB_DATA_SET, uint32_t, sd_ble_gap_lesc_oob_data_set(uint16_t conn_handle, ble_gap_lesc_oob_data_t const *p_oobd_own, ble_gap_lesc_oob_data_t const *p_oobd_peer)); + + +/**@brief Initiate GAP Encryption procedure. + * + * @details In the central role, this function will initiate the encryption procedure using the encryption information provided. + * + * @events + * @event{@ref BLE_GAP_EVT_CONN_SEC_UPDATE, The connection security has been updated.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_ENC_MSC} + * @mmsc{@ref BLE_GAP_MULTILINK_CTRL_PROC_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_SEC_REQ_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_master_id Pointer to a @ref ble_gap_master_id_t master identification structure. + * @param[in] p_enc_info Pointer to a @ref ble_gap_enc_info_t encryption information structure. + * + * @retval ::NRF_SUCCESS Successfully initiated authentication procedure. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_STATE No link has been established. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::BLE_ERROR_INVALID_ROLE Operation is not supported in the Peripheral role. + * @retval ::NRF_ERROR_BUSY Procedure already in progress or not allowed at this time, wait for pending procedures to complete and retry. + */ +SVCALL(SD_BLE_GAP_ENCRYPT, uint32_t, sd_ble_gap_encrypt(uint16_t conn_handle, ble_gap_master_id_t const *p_master_id, ble_gap_enc_info_t const *p_enc_info)); + + +/**@brief Reply with GAP security information. + * + * @details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_INFO_REQUEST, calling it at other times will result in @ref NRF_ERROR_INVALID_STATE. + * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters. + * @note Data signing is not yet supported, and p_sign_info must therefore be NULL. + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_ENC_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_enc_info Pointer to a @ref ble_gap_enc_info_t encryption information structure. May be NULL to signal none is available. + * @param[in] p_id_info Pointer to a @ref ble_gap_irk_t identity information structure. May be NULL to signal none is available. + * @param[in] p_sign_info Pointer to a @ref ble_gap_sign_info_t signing information structure. May be NULL to signal none is available. + * + * @retval ::NRF_SUCCESS Successfully accepted security information. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - No link has been established. + * - No @ref BLE_GAP_EVT_SEC_INFO_REQUEST pending. + * - Encryption information provided by the app without being requested. See @ref ble_gap_evt_sec_info_request_t::enc_info. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_SEC_INFO_REPLY, uint32_t, sd_ble_gap_sec_info_reply(uint16_t conn_handle, ble_gap_enc_info_t const *p_enc_info, ble_gap_irk_t const *p_id_info, ble_gap_sign_info_t const *p_sign_info)); + + +/**@brief Get the current connection security. + * + * @param[in] conn_handle Connection handle. + * @param[out] p_conn_sec Pointer to a @ref ble_gap_conn_sec_t structure to be filled in. + * + * @retval ::NRF_SUCCESS Current connection security successfully retrieved. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_CONN_SEC_GET, uint32_t, sd_ble_gap_conn_sec_get(uint16_t conn_handle, ble_gap_conn_sec_t *p_conn_sec)); + + +/**@brief Start reporting the received signal strength to the application. + * + * A new event is reported whenever the RSSI value changes, until @ref sd_ble_gap_rssi_stop is called. + * + * @events + * @event{@ref BLE_GAP_EVT_RSSI_CHANGED, New RSSI data available. How often the event is generated is + * dependent on the settings of the threshold_dbm + * and skip_count input parameters.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC} + * @mmsc{@ref BLE_GAP_RSSI_FILT_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] threshold_dbm Minimum change in dBm before triggering the @ref BLE_GAP_EVT_RSSI_CHANGED event. Events are disabled if threshold_dbm equals @ref BLE_GAP_RSSI_THRESHOLD_INVALID. + * @param[in] skip_count Number of RSSI samples with a change of threshold_dbm or more before sending a new @ref BLE_GAP_EVT_RSSI_CHANGED event. + * + * @retval ::NRF_SUCCESS Successfully activated RSSI reporting. + * @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is already ongoing. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_RSSI_START, uint32_t, sd_ble_gap_rssi_start(uint16_t conn_handle, uint8_t threshold_dbm, uint8_t skip_count)); + + +/**@brief Stop reporting the received signal strength. + * + * @note An RSSI change detected before the call but not yet received by the application + * may be reported after @ref sd_ble_gap_rssi_stop has been called. + * + * @mscs + * @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC} + * @mmsc{@ref BLE_GAP_RSSI_FILT_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * + * @retval ::NRF_SUCCESS Successfully deactivated RSSI reporting. + * @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is not ongoing. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_RSSI_STOP, uint32_t, sd_ble_gap_rssi_stop(uint16_t conn_handle)); + + +/**@brief Get the received signal strength for the last connection event. + * + * @ref sd_ble_gap_rssi_start must be called to start reporting RSSI before using this function. @ref NRF_ERROR_NOT_FOUND + * will be returned until RSSI was sampled for the first time after calling @ref sd_ble_gap_rssi_start. + * @note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement. + * @mscs + * @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[out] p_rssi Pointer to the location where the RSSI measurement shall be stored. + * @param[out] p_ch_index Pointer to the location where Channel Index for the RSSI measurement shall be stored. + * + * @retval ::NRF_SUCCESS Successfully read the RSSI. + * @retval ::NRF_ERROR_NOT_FOUND No sample is available. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is not ongoing. + */ +SVCALL(SD_BLE_GAP_RSSI_GET, uint32_t, sd_ble_gap_rssi_get(uint16_t conn_handle, int8_t *p_rssi, uint8_t *p_ch_index)); + + +/**@brief Start or continue scanning (GAP Discovery procedure, Observer Procedure). + * + * @note A call to this function will require the application to keep the memory pointed by + * p_adv_report_buffer alive until the buffer is released. The buffer is released when the scanner is stopped + * or when this function is called with another buffer. + * + * @note The scanner will automatically stop in the following cases: + * - @ref sd_ble_gap_scan_stop is called. + * - @ref sd_ble_gap_connect is called. + * - A @ref BLE_GAP_EVT_TIMEOUT with source set to @ref BLE_GAP_TIMEOUT_SRC_SCAN is received. + * - When a @ref BLE_GAP_EVT_ADV_REPORT event is received and @ref ble_gap_adv_report_type_t::status is not set to + * @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA. In this case scanning is only paused to let the application + * access received data. The application must call this function to continue scanning, or call @ref sd_ble_gap_scan_stop + * to stop scanning. + * + * @note If a @ref BLE_GAP_EVT_ADV_REPORT event is received with @ref ble_gap_adv_report_type_t::status set to + * @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, the scanner will continue scanning, and the application will + * receive more reports from this advertising event. The following reports will include the old and new received data. + * + * @events + * @event{@ref BLE_GAP_EVT_ADV_REPORT, An advertising or scan response packet has been received.} + * @event{@ref BLE_GAP_EVT_TIMEOUT, Scanner has timed out.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_SCAN_MSC} + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @endmscs + * + * @param[in] p_scan_params Pointer to scan parameters structure. When this function is used to continue + * scanning, this parameter must be NULL. + * @param[in] p_adv_report_buffer Pointer to buffer used to store incoming advertising data. + * The memory pointed to should be kept alive until the scanning is stopped. + * See @ref BLE_GAP_SCAN_BUFFER_SIZE for minimum and maximum buffer size. + * If the scanner receives advertising data larger than can be stored in the buffer, + * a @ref BLE_GAP_EVT_ADV_REPORT will be raised with @ref ble_gap_adv_report_type_t::status + * set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_TRUNCATED. + * + * @retval ::NRF_SUCCESS Successfully initiated scanning procedure. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - Scanning is already ongoing and p_scan_params was not NULL + * - Scanning is not running and p_scan_params was NULL. + * - The scanner has timed out when this function is called to continue scanning. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. See @ref ble_gap_scan_params_t. + * @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported parameters supplied. See @ref ble_gap_scan_params_t. + * @retval ::NRF_ERROR_INVALID_LENGTH The provided buffer length is invalid. See @ref BLE_GAP_SCAN_BUFFER_MIN. + * @retval ::NRF_ERROR_RESOURCES Not enough BLE role slots available. + * Stop one or more currently active roles (Central, Peripheral or Broadcaster) and try again + */ +SVCALL(SD_BLE_GAP_SCAN_START, uint32_t, sd_ble_gap_scan_start(ble_gap_scan_params_t const *p_scan_params, ble_data_t const * p_adv_report_buffer)); + + +/**@brief Stop scanning (GAP Discovery procedure, Observer Procedure). + * + * @note The buffer provided in @ref sd_ble_gap_scan_start is released. + * + * @mscs + * @mmsc{@ref BLE_GAP_SCAN_MSC} + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS Successfully stopped scanning procedure. + * @retval ::NRF_ERROR_INVALID_STATE Not in the scanning state. + */ +SVCALL(SD_BLE_GAP_SCAN_STOP, uint32_t, sd_ble_gap_scan_stop(void)); + + +/**@brief Create a connection (GAP Link Establishment). + * + * @note If a scanning procedure is currently in progress it will be automatically stopped when calling this function. + * The scanning procedure will be stopped even if the function returns an error. + * + * @events + * @event{@ref BLE_GAP_EVT_CONNECTED, A connection was established.} + * @event{@ref BLE_GAP_EVT_TIMEOUT, Failed to establish a connection.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_CONN_PRIV_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_CONN_MSC} + * @endmscs + * + * @param[in] p_peer_addr Pointer to peer identity address. If @ref ble_gap_scan_params_t::filter_policy is set to use + * whitelist, then p_peer_addr is ignored. + * @param[in] p_scan_params Pointer to scan parameters structure. + * @param[in] p_conn_params Pointer to desired connection parameters. + * @param[in] conn_cfg_tag Tag identifying a configuration set by @ref sd_ble_cfg_set or + * @ref BLE_CONN_CFG_TAG_DEFAULT to use the default connection configuration. + * + * @retval ::NRF_SUCCESS Successfully initiated connection procedure. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid parameter(s) pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * - Invalid parameter(s) in p_scan_params or p_conn_params. + * - Use of whitelist requested but whitelist has not been set, see @ref sd_ble_gap_whitelist_set. + * - Peer address was not present in the device identity list, see @ref sd_ble_gap_device_identities_set. + * @retval ::NRF_ERROR_NOT_FOUND conn_cfg_tag not found. + * @retval ::NRF_ERROR_INVALID_STATE The SoftDevice is in an invalid state to perform this operation. This may be due to an + * existing locally initiated connect procedure, which must complete before initiating again. + * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid Peer address. + * @retval ::NRF_ERROR_CONN_COUNT The limit of available connections for this connection configuration tag has been reached. + * To increase the number of available connections, + * use @ref sd_ble_cfg_set with @ref BLE_GAP_CFG_ROLE_COUNT or @ref BLE_CONN_CFG_GAP. + * @retval ::NRF_ERROR_RESOURCES Either: + * - Not enough BLE role slots available. + * Stop one or more currently active roles (Central, Peripheral or Observer) and try again. + * - The event_length parameter associated with conn_cfg_tag is too small to be able to + * establish a connection on the selected @ref ble_gap_scan_params_t::scan_phys. + * Use @ref sd_ble_cfg_set to increase the event length. + */ +SVCALL(SD_BLE_GAP_CONNECT, uint32_t, sd_ble_gap_connect(ble_gap_addr_t const *p_peer_addr, ble_gap_scan_params_t const *p_scan_params, ble_gap_conn_params_t const *p_conn_params, uint8_t conn_cfg_tag)); + + +/**@brief Cancel a connection establishment. + * + * @mscs + * @mmsc{@ref BLE_GAP_CENTRAL_CONN_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS Successfully canceled an ongoing connection procedure. + * @retval ::NRF_ERROR_INVALID_STATE No locally initiated connect procedure started or connection + * completed occurred. + */ +SVCALL(SD_BLE_GAP_CONNECT_CANCEL, uint32_t, sd_ble_gap_connect_cancel(void)); + + +/**@brief Initiate or respond to a PHY Update Procedure + * + * @details This function is used to initiate or respond to a PHY Update Procedure. It will always + * generate a @ref BLE_GAP_EVT_PHY_UPDATE event if successfully executed. + * If this function is used to initiate a PHY Update procedure and the only option + * provided in @ref ble_gap_phys_t::tx_phys and @ref ble_gap_phys_t::rx_phys is the + * currently active PHYs in the respective directions, the SoftDevice will generate a + * @ref BLE_GAP_EVT_PHY_UPDATE with the current PHYs set and will not initiate the + * procedure in the Link Layer. + * + * If @ref ble_gap_phys_t::tx_phys or @ref ble_gap_phys_t::rx_phys is @ref BLE_GAP_PHY_AUTO, + * then the stack will select PHYs based on the peer's PHY preferences and the local link + * configuration. The PHY Update procedure will for this case result in a PHY combination + * that respects the time constraints configured with @ref sd_ble_cfg_set and the current + * link layer data length. + * + * When acting as a central, the SoftDevice will select the fastest common PHY in each direction. + * + * If the peer does not support the PHY Update Procedure, then the resulting + * @ref BLE_GAP_EVT_PHY_UPDATE event will have a status set to + * @ref BLE_HCI_UNSUPPORTED_REMOTE_FEATURE. + * + * If the PHY Update procedure was rejected by the peer due to a procedure collision, the status + * will be @ref BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION or + * @ref BLE_HCI_DIFFERENT_TRANSACTION_COLLISION. + * If the peer responds to the PHY Update procedure with invalid parameters, the status + * will be @ref BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS. + * If the PHY Update procedure was rejected by the peer for a different reason, the status will + * contain the reason as specified by the peer. + * + * @events + * @event{@ref BLE_GAP_EVT_PHY_UPDATE, Result of the PHY Update Procedure.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_CENTRAL_PHY_UPDATE} + * @mmsc{@ref BLE_GAP_PERIPHERAL_PHY_UPDATE} + * @endmscs + * + * @param[in] conn_handle Connection handle to indicate the connection for which the PHY Update is requested. + * @param[in] p_gap_phys Pointer to PHY structure. + * + * @retval ::NRF_SUCCESS Successfully requested a PHY Update. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE No link has been established. + * @retval ::NRF_ERROR_RESOURCES The connection event length configured for this link is not sufficient for the combination of + * @ref ble_gap_phys_t::tx_phys, @ref ble_gap_phys_t::rx_phys, and @ref ble_gap_data_length_params_t. + * The connection event length is configured with @ref BLE_CONN_CFG_GAP using @ref sd_ble_cfg_set. + * @retval ::NRF_ERROR_BUSY Procedure is already in progress or not allowed at this time. Process pending events and wait for the pending procedure to complete and retry. + * + */ +SVCALL(SD_BLE_GAP_PHY_UPDATE, uint32_t, sd_ble_gap_phy_update(uint16_t conn_handle, ble_gap_phys_t const *p_gap_phys)); + + +/**@brief Initiate or respond to a Data Length Update Procedure. + * + * @note If the application uses @ref BLE_GAP_DATA_LENGTH_AUTO for one or more members of + * p_dl_params, the SoftDevice will choose the highest value supported in current + * configuration and connection parameters. + * @note If the link PHY is Coded, the SoftDevice will ensure that the MaxTxTime and/or MaxRxTime + * used in the Data Length Update procedure is at least 2704 us. Otherwise, MaxTxTime and + * MaxRxTime will be limited to maximum 2120 us. + * + * @param[in] conn_handle Connection handle. + * @param[in] p_dl_params Pointer to local parameters to be used in Data Length Update + * Procedure. Set any member to @ref BLE_GAP_DATA_LENGTH_AUTO to let + * the SoftDevice automatically decide the value for that member. + * Set to NULL to use automatic values for all members. + * @param[out] p_dl_limitation Pointer to limitation to be written when local device does not + * have enough resources or does not support the requested Data Length + * Update parameters. Ignored if NULL. + * + * @mscs + * @mmsc{@ref BLE_GAP_DATA_LENGTH_UPDATE_PROCEDURE_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS Successfully set Data Length Extension initiation/response parameters. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter supplied. + * @retval ::NRF_ERROR_INVALID_STATE No link has been established. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameters supplied. + * @retval ::NRF_ERROR_NOT_SUPPORTED The requested parameters are not supported by the SoftDevice. Inspect + * p_dl_limitation to see which parameter is not supported. + * @retval ::NRF_ERROR_RESOURCES The connection event length configured for this link is not sufficient for the requested parameters. + * Use @ref sd_ble_cfg_set with @ref BLE_CONN_CFG_GAP to increase the connection event length. + * Inspect p_dl_limitation to see where the limitation is. + * @retval ::NRF_ERROR_BUSY Peer has already initiated a Data Length Update Procedure. Process the + * pending @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST event to respond. + */ +SVCALL(SD_BLE_GAP_DATA_LENGTH_UPDATE, uint32_t, sd_ble_gap_data_length_update(uint16_t conn_handle, ble_gap_data_length_params_t const *p_dl_params, ble_gap_data_length_limitation_t *p_dl_limitation)); + +/**@brief Start the Quality of Service (QoS) channel survey module. + * + * @details The channel survey module provides measurements of the energy levels on + * the Bluetooth Low Energy channels. When the module is enabled, @ref BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT + * events will periodically report the measured energy levels for each channel. + * + * @note The measurements are scheduled with lower priority than other Bluetooth Low Energy roles, + * Radio Timeslot API events and Flash API events. + * + * @note The channel survey module will attempt to do measurements so that the average interval + * between measurements will be interval_us. However due to the channel survey module + * having the lowest priority of all roles and modules, this may not be possible. In that + * case fewer than expected channel survey reports may be given. + * + * @note In order to use the channel survey module, @ref ble_gap_cfg_role_count_t::qos_channel_survey_role_available + * must be set. This is done using @ref sd_ble_cfg_set. + * + * @param[in] interval_us Requested average interval for the measurements and reports. See + * @ref BLE_GAP_QOS_CHANNEL_SURVEY_INTERVALS for valid ranges. If set + * to @ref BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_CONTINUOUS, the channel + * survey role will be scheduled at every available opportunity. + * + * @retval ::NRF_SUCCESS The module is successfully started. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter supplied. interval_us is out of the + * allowed range. + * @retval ::NRF_ERROR_INVALID_STATE Trying to start the module when already running. + * @retval ::NRF_ERROR_RESOURCES The channel survey module is not available to the application. + * Set @ref ble_gap_cfg_role_count_t::qos_channel_survey_role_available using + * @ref sd_ble_cfg_set. + */ +SVCALL(SD_BLE_GAP_QOS_CHANNEL_SURVEY_START, uint32_t, sd_ble_gap_qos_channel_survey_start(uint32_t interval_us)); + +/**@brief Stop the Quality of Service (QoS) channel survey module. + * + * @note The SoftDevice may generate one @ref BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT event after this + * function is called. + * + * @retval ::NRF_SUCCESS The module is successfully stopped. + * @retval ::NRF_ERROR_INVALID_STATE Trying to stop the module when it is not running. + */ +SVCALL(SD_BLE_GAP_QOS_CHANNEL_SURVEY_STOP, uint32_t, sd_ble_gap_qos_channel_survey_stop(void)); + + +/**@brief Obtain the next connection event counter value. + * + * @details The connection event counter is initialized to zero on the first connection event. The value is incremented + * by one for each connection event. For more information see Bluetooth Core Specification v5.0, Vol 6, Part B, + * Section 4.5.1. + * + * @note The connection event counter obtained through this API will be outdated if this API is called + * at the same time as the connection event counter is incremented. + * + * @note This API will always return the last connection event counter + 1. + * The actual connection event may be multiple connection events later if: + * - Slave latency is enabled and there is no data to transmit or receive. + * - Another role is scheduled with a higher priority at the same time as the next connection event. + * + * @param[in] conn_handle Connection handle. + * @param[out] p_counter Pointer to the variable where the next connection event counter will be written. + * + * @retval ::NRF_SUCCESS The connection event counter was successfully retrieved. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter supplied. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + */ +SVCALL(SD_BLE_GAP_NEXT_CONN_EVT_COUNTER_GET, uint32_t, sd_ble_gap_next_conn_evt_counter_get(uint16_t conn_handle, uint16_t * p_counter)); + + +/**@brief Start triggering a given task on connection event start. + * + * @details When enabled, this feature will trigger a PPI task at the start of connection events. + * The application can configure the SoftDevice to trigger every N connection events starting from + * a given connection event counter. See also @ref ble_gap_conn_event_trigger_t. + * + * @param[in] conn_handle Connection handle. + * @param[in] p_params Connection event trigger parameters. + * + * @retval ::NRF_SUCCESS Success. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter supplied. See @ref ble_gap_conn_event_trigger_t. + * @retval ::NRF_ERROR_INVALID_STATE Either: + * - Trying to start connection event triggering when it is already ongoing. + * - @ref ble_gap_conn_event_trigger_t::conn_evt_counter_start is in the past. + * Use @ref sd_ble_gap_next_conn_evt_counter_get to find a new value + to be used as ble_gap_conn_event_trigger_t::conn_evt_counter_start. + */ +SVCALL(SD_BLE_GAP_CONN_EVT_TRIGGER_START, uint32_t, sd_ble_gap_conn_evt_trigger_start(uint16_t conn_handle, ble_gap_conn_event_trigger_t const * p_params)); + + +/**@brief Stop triggering the task configured using @ref sd_ble_gap_conn_evt_trigger_start. + * + * @param[in] conn_handle Connection handle. + * + * @retval ::NRF_SUCCESS Success. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_INVALID_STATE Trying to stop connection event triggering when it is not enabled. + */ +SVCALL(SD_BLE_GAP_CONN_EVT_TRIGGER_STOP, uint32_t, sd_ble_gap_conn_evt_trigger_stop(uint16_t conn_handle)); + + +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif // BLE_GAP_H__ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatt.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatt.h new file mode 100644 index 0000000000..c392884418 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatt.h @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2013 - 2018, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_GATT Generic Attribute Profile (GATT) Common + @{ + @brief Common definitions and prototypes for the GATT interfaces. + */ + +#ifndef BLE_GATT_H__ +#define BLE_GATT_H__ + +#include +#include "nrf_svc.h" +#include "nrf_error.h" +#include "ble_hci.h" +#include "ble_ranges.h" +#include "ble_types.h" +#include "ble_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup BLE_GATT_DEFINES Defines + * @{ */ + +/** @brief Default ATT MTU, in bytes. */ +#define BLE_GATT_ATT_MTU_DEFAULT 23 + +/**@brief Invalid Attribute Handle. */ +#define BLE_GATT_HANDLE_INVALID 0x0000 + +/**@brief First Attribute Handle. */ +#define BLE_GATT_HANDLE_START 0x0001 + +/**@brief Last Attribute Handle. */ +#define BLE_GATT_HANDLE_END 0xFFFF + +/** @defgroup BLE_GATT_TIMEOUT_SOURCES GATT Timeout sources + * @{ */ +#define BLE_GATT_TIMEOUT_SRC_PROTOCOL 0x00 /**< ATT Protocol timeout. */ +/** @} */ + +/** @defgroup BLE_GATT_WRITE_OPS GATT Write operations + * @{ */ +#define BLE_GATT_OP_INVALID 0x00 /**< Invalid Operation. */ +#define BLE_GATT_OP_WRITE_REQ 0x01 /**< Write Request. */ +#define BLE_GATT_OP_WRITE_CMD 0x02 /**< Write Command. */ +#define BLE_GATT_OP_SIGN_WRITE_CMD 0x03 /**< Signed Write Command. */ +#define BLE_GATT_OP_PREP_WRITE_REQ 0x04 /**< Prepare Write Request. */ +#define BLE_GATT_OP_EXEC_WRITE_REQ 0x05 /**< Execute Write Request. */ +/** @} */ + +/** @defgroup BLE_GATT_EXEC_WRITE_FLAGS GATT Execute Write flags + * @{ */ +#define BLE_GATT_EXEC_WRITE_FLAG_PREPARED_CANCEL 0x00 /**< Cancel prepared write. */ +#define BLE_GATT_EXEC_WRITE_FLAG_PREPARED_WRITE 0x01 /**< Execute prepared write. */ +/** @} */ + +/** @defgroup BLE_GATT_HVX_TYPES GATT Handle Value operations + * @{ */ +#define BLE_GATT_HVX_INVALID 0x00 /**< Invalid Operation. */ +#define BLE_GATT_HVX_NOTIFICATION 0x01 /**< Handle Value Notification. */ +#define BLE_GATT_HVX_INDICATION 0x02 /**< Handle Value Indication. */ +/** @} */ + +/** @defgroup BLE_GATT_STATUS_CODES GATT Status Codes + * @{ */ +#define BLE_GATT_STATUS_SUCCESS 0x0000 /**< Success. */ +#define BLE_GATT_STATUS_UNKNOWN 0x0001 /**< Unknown or not applicable status. */ +#define BLE_GATT_STATUS_ATTERR_INVALID 0x0100 /**< ATT Error: Invalid Error Code. */ +#define BLE_GATT_STATUS_ATTERR_INVALID_HANDLE 0x0101 /**< ATT Error: Invalid Attribute Handle. */ +#define BLE_GATT_STATUS_ATTERR_READ_NOT_PERMITTED 0x0102 /**< ATT Error: Read not permitted. */ +#define BLE_GATT_STATUS_ATTERR_WRITE_NOT_PERMITTED 0x0103 /**< ATT Error: Write not permitted. */ +#define BLE_GATT_STATUS_ATTERR_INVALID_PDU 0x0104 /**< ATT Error: Used in ATT as Invalid PDU. */ +#define BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION 0x0105 /**< ATT Error: Authenticated link required. */ +#define BLE_GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED 0x0106 /**< ATT Error: Used in ATT as Request Not Supported. */ +#define BLE_GATT_STATUS_ATTERR_INVALID_OFFSET 0x0107 /**< ATT Error: Offset specified was past the end of the attribute. */ +#define BLE_GATT_STATUS_ATTERR_INSUF_AUTHORIZATION 0x0108 /**< ATT Error: Used in ATT as Insufficient Authorization. */ +#define BLE_GATT_STATUS_ATTERR_PREPARE_QUEUE_FULL 0x0109 /**< ATT Error: Used in ATT as Prepare Queue Full. */ +#define BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND 0x010A /**< ATT Error: Used in ATT as Attribute not found. */ +#define BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_LONG 0x010B /**< ATT Error: Attribute cannot be read or written using read/write blob requests. */ +#define BLE_GATT_STATUS_ATTERR_INSUF_ENC_KEY_SIZE 0x010C /**< ATT Error: Encryption key size used is insufficient. */ +#define BLE_GATT_STATUS_ATTERR_INVALID_ATT_VAL_LENGTH 0x010D /**< ATT Error: Invalid value size. */ +#define BLE_GATT_STATUS_ATTERR_UNLIKELY_ERROR 0x010E /**< ATT Error: Very unlikely error. */ +#define BLE_GATT_STATUS_ATTERR_INSUF_ENCRYPTION 0x010F /**< ATT Error: Encrypted link required. */ +#define BLE_GATT_STATUS_ATTERR_UNSUPPORTED_GROUP_TYPE 0x0110 /**< ATT Error: Attribute type is not a supported grouping attribute. */ +#define BLE_GATT_STATUS_ATTERR_INSUF_RESOURCES 0x0111 /**< ATT Error: Insufficient resources. */ +#define BLE_GATT_STATUS_ATTERR_RFU_RANGE1_BEGIN 0x0112 /**< ATT Error: Reserved for Future Use range #1 begin. */ +#define BLE_GATT_STATUS_ATTERR_RFU_RANGE1_END 0x017F /**< ATT Error: Reserved for Future Use range #1 end. */ +#define BLE_GATT_STATUS_ATTERR_APP_BEGIN 0x0180 /**< ATT Error: Application range begin. */ +#define BLE_GATT_STATUS_ATTERR_APP_END 0x019F /**< ATT Error: Application range end. */ +#define BLE_GATT_STATUS_ATTERR_RFU_RANGE2_BEGIN 0x01A0 /**< ATT Error: Reserved for Future Use range #2 begin. */ +#define BLE_GATT_STATUS_ATTERR_RFU_RANGE2_END 0x01DF /**< ATT Error: Reserved for Future Use range #2 end. */ +#define BLE_GATT_STATUS_ATTERR_RFU_RANGE3_BEGIN 0x01E0 /**< ATT Error: Reserved for Future Use range #3 begin. */ +#define BLE_GATT_STATUS_ATTERR_RFU_RANGE3_END 0x01FC /**< ATT Error: Reserved for Future Use range #3 end. */ +#define BLE_GATT_STATUS_ATTERR_CPS_WRITE_REQ_REJECTED 0x01FC /**< ATT Common Profile and Service Error: Write request rejected. */ +#define BLE_GATT_STATUS_ATTERR_CPS_CCCD_CONFIG_ERROR 0x01FD /**< ATT Common Profile and Service Error: Client Characteristic Configuration Descriptor improperly configured. */ +#define BLE_GATT_STATUS_ATTERR_CPS_PROC_ALR_IN_PROG 0x01FE /**< ATT Common Profile and Service Error: Procedure Already in Progress. */ +#define BLE_GATT_STATUS_ATTERR_CPS_OUT_OF_RANGE 0x01FF /**< ATT Common Profile and Service Error: Out Of Range. */ +/** @} */ + + +/** @defgroup BLE_GATT_CPF_FORMATS Characteristic Presentation Formats + * @note Found at http://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml + * @{ */ +#define BLE_GATT_CPF_FORMAT_RFU 0x00 /**< Reserved For Future Use. */ +#define BLE_GATT_CPF_FORMAT_BOOLEAN 0x01 /**< Boolean. */ +#define BLE_GATT_CPF_FORMAT_2BIT 0x02 /**< Unsigned 2-bit integer. */ +#define BLE_GATT_CPF_FORMAT_NIBBLE 0x03 /**< Unsigned 4-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT8 0x04 /**< Unsigned 8-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT12 0x05 /**< Unsigned 12-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT16 0x06 /**< Unsigned 16-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT24 0x07 /**< Unsigned 24-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT32 0x08 /**< Unsigned 32-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT48 0x09 /**< Unsigned 48-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT64 0x0A /**< Unsigned 64-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT128 0x0B /**< Unsigned 128-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT8 0x0C /**< Signed 2-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT12 0x0D /**< Signed 12-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT16 0x0E /**< Signed 16-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT24 0x0F /**< Signed 24-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT32 0x10 /**< Signed 32-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT48 0x11 /**< Signed 48-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT64 0x12 /**< Signed 64-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT128 0x13 /**< Signed 128-bit integer. */ +#define BLE_GATT_CPF_FORMAT_FLOAT32 0x14 /**< IEEE-754 32-bit floating point. */ +#define BLE_GATT_CPF_FORMAT_FLOAT64 0x15 /**< IEEE-754 64-bit floating point. */ +#define BLE_GATT_CPF_FORMAT_SFLOAT 0x16 /**< IEEE-11073 16-bit SFLOAT. */ +#define BLE_GATT_CPF_FORMAT_FLOAT 0x17 /**< IEEE-11073 32-bit FLOAT. */ +#define BLE_GATT_CPF_FORMAT_DUINT16 0x18 /**< IEEE-20601 format. */ +#define BLE_GATT_CPF_FORMAT_UTF8S 0x19 /**< UTF-8 string. */ +#define BLE_GATT_CPF_FORMAT_UTF16S 0x1A /**< UTF-16 string. */ +#define BLE_GATT_CPF_FORMAT_STRUCT 0x1B /**< Opaque Structure. */ +/** @} */ + +/** @defgroup BLE_GATT_CPF_NAMESPACES GATT Bluetooth Namespaces + * @{ + */ +#define BLE_GATT_CPF_NAMESPACE_BTSIG 0x01 /**< Bluetooth SIG defined Namespace. */ +#define BLE_GATT_CPF_NAMESPACE_DESCRIPTION_UNKNOWN 0x0000 /**< Namespace Description Unknown. */ +/** @} */ + +/** @} */ + +/** @addtogroup BLE_GATT_STRUCTURES Structures + * @{ */ + +/** + * @brief BLE GATT connection configuration parameters, set with @ref sd_ble_cfg_set. + * + * @retval ::NRF_ERROR_INVALID_PARAM att_mtu is smaller than @ref BLE_GATT_ATT_MTU_DEFAULT. + */ +typedef struct +{ + uint16_t att_mtu; /**< Maximum size of ATT packet the SoftDevice can send or receive. + The default and minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT. + @mscs + @mmsc{@ref BLE_GATTC_MTU_EXCHANGE} + @mmsc{@ref BLE_GATTS_MTU_EXCHANGE} + @endmscs + */ +} ble_gatt_conn_cfg_t; + +/**@brief GATT Characteristic Properties. */ +typedef struct +{ + /* Standard properties */ + uint8_t broadcast :1; /**< Broadcasting of the value permitted. */ + uint8_t read :1; /**< Reading the value permitted. */ + uint8_t write_wo_resp :1; /**< Writing the value with Write Command permitted. */ + uint8_t write :1; /**< Writing the value with Write Request permitted. */ + uint8_t notify :1; /**< Notification of the value permitted. */ + uint8_t indicate :1; /**< Indications of the value permitted. */ + uint8_t auth_signed_wr :1; /**< Writing the value with Signed Write Command permitted. */ +} ble_gatt_char_props_t; + +/**@brief GATT Characteristic Extended Properties. */ +typedef struct +{ + /* Extended properties */ + uint8_t reliable_wr :1; /**< Writing the value with Queued Write operations permitted. */ + uint8_t wr_aux :1; /**< Writing the Characteristic User Description descriptor permitted. */ +} ble_gatt_char_ext_props_t; + +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif // BLE_GATT_H__ + +/** @} */ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gattc.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gattc.h new file mode 100644 index 0000000000..7fb3920244 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gattc.h @@ -0,0 +1,715 @@ +/* + * Copyright (c) 2011 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_GATTC Generic Attribute Profile (GATT) Client + @{ + @brief Definitions and prototypes for the GATT Client interface. + */ + +#ifndef BLE_GATTC_H__ +#define BLE_GATTC_H__ + +#include +#include "nrf.h" +#include "nrf_svc.h" +#include "nrf_error.h" +#include "ble_ranges.h" +#include "ble_types.h" +#include "ble_err.h" +#include "ble_gatt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup BLE_GATTC_ENUMERATIONS Enumerations + * @{ */ + +/**@brief GATTC API SVC numbers. */ +enum BLE_GATTC_SVCS +{ + SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER = BLE_GATTC_SVC_BASE, /**< Primary Service Discovery. */ + SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, /**< Relationship Discovery. */ + SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, /**< Characteristic Discovery. */ + SD_BLE_GATTC_DESCRIPTORS_DISCOVER, /**< Characteristic Descriptor Discovery. */ + SD_BLE_GATTC_ATTR_INFO_DISCOVER, /**< Attribute Information Discovery. */ + SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, /**< Read Characteristic Value by UUID. */ + SD_BLE_GATTC_READ, /**< Generic read. */ + SD_BLE_GATTC_CHAR_VALUES_READ, /**< Read multiple Characteristic Values. */ + SD_BLE_GATTC_WRITE, /**< Generic write. */ + SD_BLE_GATTC_HV_CONFIRM, /**< Handle Value Confirmation. */ + SD_BLE_GATTC_EXCHANGE_MTU_REQUEST, /**< Exchange MTU Request. */ +}; + +/** + * @brief GATT Client Event IDs. + */ +enum BLE_GATTC_EVTS +{ + BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP = BLE_GATTC_EVT_BASE, /**< Primary Service Discovery Response event. \n See @ref ble_gattc_evt_prim_srvc_disc_rsp_t. */ + BLE_GATTC_EVT_REL_DISC_RSP, /**< Relationship Discovery Response event. \n See @ref ble_gattc_evt_rel_disc_rsp_t. */ + BLE_GATTC_EVT_CHAR_DISC_RSP, /**< Characteristic Discovery Response event. \n See @ref ble_gattc_evt_char_disc_rsp_t. */ + BLE_GATTC_EVT_DESC_DISC_RSP, /**< Descriptor Discovery Response event. \n See @ref ble_gattc_evt_desc_disc_rsp_t. */ + BLE_GATTC_EVT_ATTR_INFO_DISC_RSP, /**< Attribute Information Response event. \n See @ref ble_gattc_evt_attr_info_disc_rsp_t. */ + BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP, /**< Read By UUID Response event. \n See @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t. */ + BLE_GATTC_EVT_READ_RSP, /**< Read Response event. \n See @ref ble_gattc_evt_read_rsp_t. */ + BLE_GATTC_EVT_CHAR_VALS_READ_RSP, /**< Read multiple Response event. \n See @ref ble_gattc_evt_char_vals_read_rsp_t. */ + BLE_GATTC_EVT_WRITE_RSP, /**< Write Response event. \n See @ref ble_gattc_evt_write_rsp_t. */ + BLE_GATTC_EVT_HVX, /**< Handle Value Notification or Indication event. \n Confirm indication with @ref sd_ble_gattc_hv_confirm. \n See @ref ble_gattc_evt_hvx_t. */ + BLE_GATTC_EVT_EXCHANGE_MTU_RSP, /**< Exchange MTU Response event. \n See @ref ble_gattc_evt_exchange_mtu_rsp_t. */ + BLE_GATTC_EVT_TIMEOUT, /**< Timeout event. \n See @ref ble_gattc_evt_timeout_t. */ + BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE /**< Write without Response transmission complete. \n See @ref ble_gattc_evt_write_cmd_tx_complete_t. */ +}; + +/** @} */ + +/** @addtogroup BLE_GATTC_DEFINES Defines + * @{ */ + +/** @defgroup BLE_ERRORS_GATTC SVC return values specific to GATTC + * @{ */ +#define BLE_ERROR_GATTC_PROC_NOT_PERMITTED (NRF_GATTC_ERR_BASE + 0x000) /**< Procedure not Permitted. */ +/** @} */ + +/** @defgroup BLE_GATTC_ATTR_INFO_FORMAT Attribute Information Formats + * @{ */ +#define BLE_GATTC_ATTR_INFO_FORMAT_16BIT 1 /**< 16-bit Attribute Information Format. */ +#define BLE_GATTC_ATTR_INFO_FORMAT_128BIT 2 /**< 128-bit Attribute Information Format. */ +/** @} */ + +/** @defgroup BLE_GATTC_DEFAULTS GATT Client defaults + * @{ */ +#define BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT 1 /**< Default number of Write without Response that can be queued for transmission. */ +/** @} */ + +/** @} */ + +/** @addtogroup BLE_GATTC_STRUCTURES Structures + * @{ */ + +/** + * @brief BLE GATTC connection configuration parameters, set with @ref sd_ble_cfg_set. + */ +typedef struct +{ + uint8_t write_cmd_tx_queue_size; /**< The guaranteed minimum number of Write without Response that can be queued for transmission. + The default value is @ref BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT */ +} ble_gattc_conn_cfg_t; + +/**@brief Operation Handle Range. */ +typedef struct +{ + uint16_t start_handle; /**< Start Handle. */ + uint16_t end_handle; /**< End Handle. */ +} ble_gattc_handle_range_t; + + +/**@brief GATT service. */ +typedef struct +{ + ble_uuid_t uuid; /**< Service UUID. */ + ble_gattc_handle_range_t handle_range; /**< Service Handle Range. */ +} ble_gattc_service_t; + + +/**@brief GATT include. */ +typedef struct +{ + uint16_t handle; /**< Include Handle. */ + ble_gattc_service_t included_srvc; /**< Handle of the included service. */ +} ble_gattc_include_t; + + +/**@brief GATT characteristic. */ +typedef struct +{ + ble_uuid_t uuid; /**< Characteristic UUID. */ + ble_gatt_char_props_t char_props; /**< Characteristic Properties. */ + uint8_t char_ext_props : 1; /**< Extended properties present. */ + uint16_t handle_decl; /**< Handle of the Characteristic Declaration. */ + uint16_t handle_value; /**< Handle of the Characteristic Value. */ +} ble_gattc_char_t; + + +/**@brief GATT descriptor. */ +typedef struct +{ + uint16_t handle; /**< Descriptor Handle. */ + ble_uuid_t uuid; /**< Descriptor UUID. */ +} ble_gattc_desc_t; + + +/**@brief Write Parameters. */ +typedef struct +{ + uint8_t write_op; /**< Write Operation to be performed, see @ref BLE_GATT_WRITE_OPS. */ + uint8_t flags; /**< Flags, see @ref BLE_GATT_EXEC_WRITE_FLAGS. */ + uint16_t handle; /**< Handle to the attribute to be written. */ + uint16_t offset; /**< Offset in bytes. @note For WRITE_CMD and WRITE_REQ, offset must be 0. */ + uint16_t len; /**< Length of data in bytes. */ + uint8_t const *p_value; /**< Pointer to the value data. */ +} ble_gattc_write_params_t; + +/**@brief Attribute Information for 16-bit Attribute UUID. */ +typedef struct +{ + uint16_t handle; /**< Attribute handle. */ + ble_uuid_t uuid; /**< 16-bit Attribute UUID. */ +} ble_gattc_attr_info16_t; + +/**@brief Attribute Information for 128-bit Attribute UUID. */ +typedef struct +{ + uint16_t handle; /**< Attribute handle. */ + ble_uuid128_t uuid; /**< 128-bit Attribute UUID. */ +} ble_gattc_attr_info128_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP. */ +typedef struct +{ + uint16_t count; /**< Service count. */ + ble_gattc_service_t services[1]; /**< Service data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_prim_srvc_disc_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_REL_DISC_RSP. */ +typedef struct +{ + uint16_t count; /**< Include count. */ + ble_gattc_include_t includes[1]; /**< Include data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_rel_disc_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_DISC_RSP. */ +typedef struct +{ + uint16_t count; /**< Characteristic count. */ + ble_gattc_char_t chars[1]; /**< Characteristic data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_char_disc_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_DESC_DISC_RSP. */ +typedef struct +{ + uint16_t count; /**< Descriptor count. */ + ble_gattc_desc_t descs[1]; /**< Descriptor data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_desc_disc_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP. */ +typedef struct +{ + uint16_t count; /**< Attribute count. */ + uint8_t format; /**< Attribute information format, see @ref BLE_GATTC_ATTR_INFO_FORMAT. */ + union { + ble_gattc_attr_info16_t attr_info16[1]; /**< Attribute information for 16-bit Attribute UUID. + @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ + ble_gattc_attr_info128_t attr_info128[1]; /**< Attribute information for 128-bit Attribute UUID. + @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ + } info; /**< Attribute information union. */ +} ble_gattc_evt_attr_info_disc_rsp_t; + +/**@brief GATT read by UUID handle value pair. */ +typedef struct +{ + uint16_t handle; /**< Attribute Handle. */ + uint8_t *p_value; /**< Pointer to the Attribute Value, length is available in @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t::value_len. */ +} ble_gattc_handle_value_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP. */ +typedef struct +{ + uint16_t count; /**< Handle-Value Pair Count. */ + uint16_t value_len; /**< Length of the value in Handle-Value(s) list. */ + uint8_t handle_value[1]; /**< Handle-Value(s) list. To iterate through the list use @ref sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter. + @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_char_val_by_uuid_read_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_READ_RSP. */ +typedef struct +{ + uint16_t handle; /**< Attribute Handle. */ + uint16_t offset; /**< Offset of the attribute data. */ + uint16_t len; /**< Attribute data length. */ + uint8_t data[1]; /**< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_read_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP. */ +typedef struct +{ + uint16_t len; /**< Concatenated Attribute values length. */ + uint8_t values[1]; /**< Attribute values. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_char_vals_read_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_WRITE_RSP. */ +typedef struct +{ + uint16_t handle; /**< Attribute Handle. */ + uint8_t write_op; /**< Type of write operation, see @ref BLE_GATT_WRITE_OPS. */ + uint16_t offset; /**< Data offset. */ + uint16_t len; /**< Data length. */ + uint8_t data[1]; /**< Data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_write_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_HVX. */ +typedef struct +{ + uint16_t handle; /**< Handle to which the HVx operation applies. */ + uint8_t type; /**< Indication or Notification, see @ref BLE_GATT_HVX_TYPES. */ + uint16_t len; /**< Attribute data length. */ + uint8_t data[1]; /**< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_hvx_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP. */ +typedef struct +{ + uint16_t server_rx_mtu; /**< Server RX MTU size. */ +} ble_gattc_evt_exchange_mtu_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_TIMEOUT. */ +typedef struct +{ + uint8_t src; /**< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES. */ +} ble_gattc_evt_timeout_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE. */ +typedef struct +{ + uint8_t count; /**< Number of write without response transmissions completed. */ +} ble_gattc_evt_write_cmd_tx_complete_t; + +/**@brief GATTC event structure. */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle on which event occurred. */ + uint16_t gatt_status; /**< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES. */ + uint16_t error_handle; /**< In case of error: The handle causing the error. In all other cases @ref BLE_GATT_HANDLE_INVALID. */ + union + { + ble_gattc_evt_prim_srvc_disc_rsp_t prim_srvc_disc_rsp; /**< Primary Service Discovery Response Event Parameters. */ + ble_gattc_evt_rel_disc_rsp_t rel_disc_rsp; /**< Relationship Discovery Response Event Parameters. */ + ble_gattc_evt_char_disc_rsp_t char_disc_rsp; /**< Characteristic Discovery Response Event Parameters. */ + ble_gattc_evt_desc_disc_rsp_t desc_disc_rsp; /**< Descriptor Discovery Response Event Parameters. */ + ble_gattc_evt_char_val_by_uuid_read_rsp_t char_val_by_uuid_read_rsp; /**< Characteristic Value Read by UUID Response Event Parameters. */ + ble_gattc_evt_read_rsp_t read_rsp; /**< Read Response Event Parameters. */ + ble_gattc_evt_char_vals_read_rsp_t char_vals_read_rsp; /**< Characteristic Values Read Response Event Parameters. */ + ble_gattc_evt_write_rsp_t write_rsp; /**< Write Response Event Parameters. */ + ble_gattc_evt_hvx_t hvx; /**< Handle Value Notification/Indication Event Parameters. */ + ble_gattc_evt_exchange_mtu_rsp_t exchange_mtu_rsp; /**< Exchange MTU Response Event Parameters. */ + ble_gattc_evt_timeout_t timeout; /**< Timeout Event Parameters. */ + ble_gattc_evt_attr_info_disc_rsp_t attr_info_disc_rsp; /**< Attribute Information Discovery Event Parameters. */ + ble_gattc_evt_write_cmd_tx_complete_t write_cmd_tx_complete; /**< Write without Response transmission complete Event Parameters. */ + } params; /**< Event Parameters. @note Only valid if @ref gatt_status == @ref BLE_GATT_STATUS_SUCCESS. */ +} ble_gattc_evt_t; +/** @} */ + +/** @addtogroup BLE_GATTC_FUNCTIONS Functions + * @{ */ + +/**@brief Initiate or continue a GATT Primary Service Discovery procedure. + * + * @details This function initiates or resumes a Primary Service discovery procedure, starting from the supplied handle. + * If the last service has not been reached, this function must be called again with an updated start handle value to continue the search. + * + * @note If any of the discovered services have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with + * type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event. + * + * @events + * @event{@ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_PRIM_SRVC_DISC_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] start_handle Handle to start searching from. + * @param[in] p_srvc_uuid Pointer to the service UUID to be found. If it is NULL, all primary services will be returned. + * + * @retval ::NRF_SUCCESS Successfully started or resumed the Primary Service Discovery procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER, uint32_t, sd_ble_gattc_primary_services_discover(uint16_t conn_handle, uint16_t start_handle, ble_uuid_t const *p_srvc_uuid)); + + +/**@brief Initiate or continue a GATT Relationship Discovery procedure. + * + * @details This function initiates or resumes the Find Included Services sub-procedure. If the last included service has not been reached, + * this must be called again with an updated handle range to continue the search. + * + * @events + * @event{@ref BLE_GATTC_EVT_REL_DISC_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_REL_DISC_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on. + * + * @retval ::NRF_SUCCESS Successfully started or resumed the Relationship Discovery procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, uint32_t, sd_ble_gattc_relationships_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range)); + + +/**@brief Initiate or continue a GATT Characteristic Discovery procedure. + * + * @details This function initiates or resumes a Characteristic discovery procedure. If the last Characteristic has not been reached, + * this must be called again with an updated handle range to continue the discovery. + * + * @note If any of the discovered characteristics have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with + * type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event. + * + * @events + * @event{@ref BLE_GATTC_EVT_CHAR_DISC_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_CHAR_DISC_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on. + * + * @retval ::NRF_SUCCESS Successfully started or resumed the Characteristic Discovery procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, uint32_t, sd_ble_gattc_characteristics_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range)); + + +/**@brief Initiate or continue a GATT Characteristic Descriptor Discovery procedure. + * + * @details This function initiates or resumes a Characteristic Descriptor discovery procedure. If the last Descriptor has not been reached, + * this must be called again with an updated handle range to continue the discovery. + * + * @events + * @event{@ref BLE_GATTC_EVT_DESC_DISC_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_DESC_DISC_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_handle_range A pointer to the range of handles of the Characteristic to perform this procedure on. + * + * @retval ::NRF_SUCCESS Successfully started or resumed the Descriptor Discovery procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_DESCRIPTORS_DISCOVER, uint32_t, sd_ble_gattc_descriptors_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range)); + + +/**@brief Initiate or continue a GATT Read using Characteristic UUID procedure. + * + * @details This function initiates or resumes a Read using Characteristic UUID procedure. If the last Characteristic has not been reached, + * this must be called again with an updated handle range to continue the discovery. + * + * @events + * @event{@ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_READ_UUID_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_uuid Pointer to a Characteristic value UUID to read. + * @param[in] p_handle_range A pointer to the range of handles to perform this procedure on. + * + * @retval ::NRF_SUCCESS Successfully started or resumed the Read using Characteristic UUID procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, uint32_t, sd_ble_gattc_char_value_by_uuid_read(uint16_t conn_handle, ble_uuid_t const *p_uuid, ble_gattc_handle_range_t const *p_handle_range)); + + +/**@brief Initiate or continue a GATT Read (Long) Characteristic or Descriptor procedure. + * + * @details This function initiates or resumes a GATT Read (Long) Characteristic or Descriptor procedure. If the Characteristic or Descriptor + * to be read is longer than ATT_MTU - 1, this function must be called multiple times with appropriate offset to read the + * complete value. + * + * @events + * @event{@ref BLE_GATTC_EVT_READ_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_VALUE_READ_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] handle The handle of the attribute to be read. + * @param[in] offset Offset into the attribute value to be read. + * + * @retval ::NRF_SUCCESS Successfully started or resumed the Read (Long) procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_READ, uint32_t, sd_ble_gattc_read(uint16_t conn_handle, uint16_t handle, uint16_t offset)); + + +/**@brief Initiate a GATT Read Multiple Characteristic Values procedure. + * + * @details This function initiates a GATT Read Multiple Characteristic Values procedure. + * + * @events + * @event{@ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_READ_MULT_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_handles A pointer to the handle(s) of the attribute(s) to be read. + * @param[in] handle_count The number of handles in p_handles. + * + * @retval ::NRF_SUCCESS Successfully started the Read Multiple Characteristic Values procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_CHAR_VALUES_READ, uint32_t, sd_ble_gattc_char_values_read(uint16_t conn_handle, uint16_t const *p_handles, uint16_t handle_count)); + + +/**@brief Perform a Write (Characteristic Value or Descriptor, with or without response, signed or not, long or reliable) procedure. + * + * @details This function can perform all write procedures described in GATT. + * + * @note Only one write with response procedure can be ongoing per connection at a time. + * If the application tries to write with response while another write with response procedure is ongoing, + * the function call will return @ref NRF_ERROR_BUSY. + * A @ref BLE_GATTC_EVT_WRITE_RSP event will be issued as soon as the write response arrives from the peer. + * + * @note The number of Write without Response that can be queued is configured by @ref ble_gattc_conn_cfg_t::write_cmd_tx_queue_size + * When the queue is full, the function call will return @ref NRF_ERROR_RESOURCES. + * A @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event will be issued as soon as the transmission of the write without response is complete. + * + * @note The application can keep track of the available queue element count for writes without responses by following the procedure below: + * - Store initial queue element count in a variable. + * - Decrement the variable, which stores the currently available queue element count, by one when a call to this function returns @ref NRF_SUCCESS. + * - Increment the variable, which stores the current available queue element count, by the count variable in @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event. + * + * @events + * @event{@ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE, Write without response transmission complete.} + * @event{@ref BLE_GATTC_EVT_WRITE_RSP, Write response received from the peer.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_VALUE_WRITE_WITHOUT_RESP_MSC} + * @mmsc{@ref BLE_GATTC_VALUE_WRITE_MSC} + * @mmsc{@ref BLE_GATTC_VALUE_LONG_WRITE_MSC} + * @mmsc{@ref BLE_GATTC_VALUE_RELIABLE_WRITE_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_write_params A pointer to a write parameters structure. + * + * @retval ::NRF_SUCCESS Successfully started the Write procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. + * @retval ::NRF_ERROR_BUSY For write with response, procedure already in progress. Wait for a @ref BLE_GATTC_EVT_WRITE_RSP event and retry. + * @retval ::NRF_ERROR_RESOURCES Too many writes without responses queued. + * Wait for a @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event and retry. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_WRITE, uint32_t, sd_ble_gattc_write(uint16_t conn_handle, ble_gattc_write_params_t const *p_write_params)); + + +/**@brief Send a Handle Value Confirmation to the GATT Server. + * + * @mscs + * @mmsc{@ref BLE_GATTC_HVI_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] handle The handle of the attribute in the indication. + * + * @retval ::NRF_SUCCESS Successfully queued the Handle Value Confirmation for transmission. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no Indication pending to be confirmed. + * @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_HV_CONFIRM, uint32_t, sd_ble_gattc_hv_confirm(uint16_t conn_handle, uint16_t handle)); + +/**@brief Discovers information about a range of attributes on a GATT server. + * + * @events + * @event{@ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP, Generated when information about a range of attributes has been received.} + * @endevents + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_handle_range The range of handles to request information about. + * + * @retval ::NRF_SUCCESS Successfully started an attribute information discovery procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid connection state + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_ATTR_INFO_DISCOVER, uint32_t, sd_ble_gattc_attr_info_discover(uint16_t conn_handle, ble_gattc_handle_range_t const * p_handle_range)); + +/**@brief Start an ATT_MTU exchange by sending an Exchange MTU Request to the server. + * + * @details The SoftDevice sets ATT_MTU to the minimum of: + * - The Client RX MTU value, and + * - The Server RX MTU value from @ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP. + * + * However, the SoftDevice never sets ATT_MTU lower than @ref BLE_GATT_ATT_MTU_DEFAULT. + * + * @events + * @event{@ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_MTU_EXCHANGE} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] client_rx_mtu Client RX MTU size. + * - The minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT. + * - The maximum value is @ref ble_gatt_conn_cfg_t::att_mtu in the connection configuration + used for this connection. + * - The value must be equal to Server RX MTU size given in @ref sd_ble_gatts_exchange_mtu_reply + * if an ATT_MTU exchange has already been performed in the other direction. + * + * @retval ::NRF_SUCCESS Successfully sent request to the server. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid connection state or an ATT_MTU exchange was already requested once. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid Client RX MTU size supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_EXCHANGE_MTU_REQUEST, uint32_t, sd_ble_gattc_exchange_mtu_request(uint16_t conn_handle, uint16_t client_rx_mtu)); + +/**@brief Iterate through Handle-Value(s) list in @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP event. + * + * @param[in] p_gattc_evt Pointer to event buffer containing @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP event. + * @note If the buffer contains different event, behavior is undefined. + * @param[in,out] p_iter Iterator, points to @ref ble_gattc_handle_value_t structure that will be filled in with + * the next Handle-Value pair in each iteration. If the function returns other than + * @ref NRF_SUCCESS, it will not be changed. + * - To start iteration, initialize the structure to zero. + * - To continue, pass the value from previous iteration. + * + * \code + * ble_gattc_handle_value_t iter; + * memset(&iter, 0, sizeof(ble_gattc_handle_value_t)); + * while (sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter(&ble_evt.evt.gattc_evt, &iter) == NRF_SUCCESS) + * { + * app_handle = iter.handle; + * memcpy(app_value, iter.p_value, ble_evt.evt.gattc_evt.params.char_val_by_uuid_read_rsp.value_len); + * } + * \endcode + * + * @retval ::NRF_SUCCESS Successfully retrieved the next Handle-Value pair. + * @retval ::NRF_ERROR_NOT_FOUND No more Handle-Value pairs available in the list. + */ +__STATIC_INLINE uint32_t sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter(ble_gattc_evt_t *p_gattc_evt, ble_gattc_handle_value_t *p_iter); + +/** @} */ + +#ifndef SUPPRESS_INLINE_IMPLEMENTATION + +__STATIC_INLINE uint32_t sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter(ble_gattc_evt_t *p_gattc_evt, ble_gattc_handle_value_t *p_iter) +{ + uint32_t value_len = p_gattc_evt->params.char_val_by_uuid_read_rsp.value_len; + uint8_t *p_first = p_gattc_evt->params.char_val_by_uuid_read_rsp.handle_value; + uint8_t *p_next = p_iter->p_value ? p_iter->p_value + value_len : p_first; + + if ((p_next - p_first) / (sizeof(uint16_t) + value_len) < p_gattc_evt->params.char_val_by_uuid_read_rsp.count) + { + p_iter->handle = (uint16_t)p_next[1] << 8 | p_next[0]; + p_iter->p_value = p_next + sizeof(uint16_t); + return NRF_SUCCESS; + } + else + { + return NRF_ERROR_NOT_FOUND; + } +} + +#endif /* SUPPRESS_INLINE_IMPLEMENTATION */ + +#ifdef __cplusplus +} +#endif +#endif /* BLE_GATTC_H__ */ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatts.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatts.h new file mode 100644 index 0000000000..394d8d1897 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatts.h @@ -0,0 +1,845 @@ +/* + * Copyright (c) 2011 - 2018, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_GATTS Generic Attribute Profile (GATT) Server + @{ + @brief Definitions and prototypes for the GATTS interface. + */ + +#ifndef BLE_GATTS_H__ +#define BLE_GATTS_H__ + +#include +#include "nrf_svc.h" +#include "nrf_error.h" +#include "ble_hci.h" +#include "ble_ranges.h" +#include "ble_types.h" +#include "ble_err.h" +#include "ble_gatt.h" +#include "ble_gap.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup BLE_GATTS_ENUMERATIONS Enumerations + * @{ */ + +/** + * @brief GATTS API SVC numbers. + */ +enum BLE_GATTS_SVCS +{ + SD_BLE_GATTS_SERVICE_ADD = BLE_GATTS_SVC_BASE, /**< Add a service. */ + SD_BLE_GATTS_INCLUDE_ADD, /**< Add an included service. */ + SD_BLE_GATTS_CHARACTERISTIC_ADD, /**< Add a characteristic. */ + SD_BLE_GATTS_DESCRIPTOR_ADD, /**< Add a generic attribute. */ + SD_BLE_GATTS_VALUE_SET, /**< Set an attribute value. */ + SD_BLE_GATTS_VALUE_GET, /**< Get an attribute value. */ + SD_BLE_GATTS_HVX, /**< Handle Value Notification or Indication. */ + SD_BLE_GATTS_SERVICE_CHANGED, /**< Perform a Service Changed Indication to one or more peers. */ + SD_BLE_GATTS_RW_AUTHORIZE_REPLY, /**< Reply to an authorization request for a read or write operation on one or more attributes. */ + SD_BLE_GATTS_SYS_ATTR_SET, /**< Set the persistent system attributes for a connection. */ + SD_BLE_GATTS_SYS_ATTR_GET, /**< Retrieve the persistent system attributes. */ + SD_BLE_GATTS_INITIAL_USER_HANDLE_GET, /**< Retrieve the first valid user handle. */ + SD_BLE_GATTS_ATTR_GET, /**< Retrieve the UUID and/or metadata of an attribute. */ + SD_BLE_GATTS_EXCHANGE_MTU_REPLY /**< Reply to Exchange MTU Request. */ +}; + +/** + * @brief GATT Server Event IDs. + */ +enum BLE_GATTS_EVTS +{ + BLE_GATTS_EVT_WRITE = BLE_GATTS_EVT_BASE, /**< Write operation performed. \n See @ref ble_gatts_evt_write_t. */ + BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST, /**< Read/Write Authorization request. \n Reply with @ref sd_ble_gatts_rw_authorize_reply. \n See @ref ble_gatts_evt_rw_authorize_request_t. */ + BLE_GATTS_EVT_SYS_ATTR_MISSING, /**< A persistent system attribute access is pending. \n Respond with @ref sd_ble_gatts_sys_attr_set. \n See @ref ble_gatts_evt_sys_attr_missing_t. */ + BLE_GATTS_EVT_HVC, /**< Handle Value Confirmation. \n See @ref ble_gatts_evt_hvc_t. */ + BLE_GATTS_EVT_SC_CONFIRM, /**< Service Changed Confirmation. \n No additional event structure applies. */ + BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST, /**< Exchange MTU Request. \n Reply with @ref sd_ble_gatts_exchange_mtu_reply. \n See @ref ble_gatts_evt_exchange_mtu_request_t. */ + BLE_GATTS_EVT_TIMEOUT, /**< Peer failed to respond to an ATT request in time. \n See @ref ble_gatts_evt_timeout_t. */ + BLE_GATTS_EVT_HVN_TX_COMPLETE /**< Handle Value Notification transmission complete. \n See @ref ble_gatts_evt_hvn_tx_complete_t. */ +}; + +/**@brief GATTS Configuration IDs. + * + * IDs that uniquely identify a GATTS configuration. + */ +enum BLE_GATTS_CFGS +{ + BLE_GATTS_CFG_SERVICE_CHANGED = BLE_GATTS_CFG_BASE, /**< Service changed configuration. */ + BLE_GATTS_CFG_ATTR_TAB_SIZE, /**< Attribute table size configuration. */ +}; + +/** @} */ + +/** @addtogroup BLE_GATTS_DEFINES Defines + * @{ */ + +/** @defgroup BLE_ERRORS_GATTS SVC return values specific to GATTS + * @{ */ +#define BLE_ERROR_GATTS_INVALID_ATTR_TYPE (NRF_GATTS_ERR_BASE + 0x000) /**< Invalid attribute type. */ +#define BLE_ERROR_GATTS_SYS_ATTR_MISSING (NRF_GATTS_ERR_BASE + 0x001) /**< System Attributes missing. */ +/** @} */ + +/** @defgroup BLE_GATTS_ATTR_LENS_MAX Maximum attribute lengths + * @{ */ +#define BLE_GATTS_FIX_ATTR_LEN_MAX (510) /**< Maximum length for fixed length Attribute Values. */ +#define BLE_GATTS_VAR_ATTR_LEN_MAX (512) /**< Maximum length for variable length Attribute Values. */ +/** @} */ + +/** @defgroup BLE_GATTS_SRVC_TYPES GATT Server Service Types + * @{ */ +#define BLE_GATTS_SRVC_TYPE_INVALID 0x00 /**< Invalid Service Type. */ +#define BLE_GATTS_SRVC_TYPE_PRIMARY 0x01 /**< Primary Service. */ +#define BLE_GATTS_SRVC_TYPE_SECONDARY 0x02 /**< Secondary Type. */ +/** @} */ + + +/** @defgroup BLE_GATTS_ATTR_TYPES GATT Server Attribute Types + * @{ */ +#define BLE_GATTS_ATTR_TYPE_INVALID 0x00 /**< Invalid Attribute Type. */ +#define BLE_GATTS_ATTR_TYPE_PRIM_SRVC_DECL 0x01 /**< Primary Service Declaration. */ +#define BLE_GATTS_ATTR_TYPE_SEC_SRVC_DECL 0x02 /**< Secondary Service Declaration. */ +#define BLE_GATTS_ATTR_TYPE_INC_DECL 0x03 /**< Include Declaration. */ +#define BLE_GATTS_ATTR_TYPE_CHAR_DECL 0x04 /**< Characteristic Declaration. */ +#define BLE_GATTS_ATTR_TYPE_CHAR_VAL 0x05 /**< Characteristic Value. */ +#define BLE_GATTS_ATTR_TYPE_DESC 0x06 /**< Descriptor. */ +#define BLE_GATTS_ATTR_TYPE_OTHER 0x07 /**< Other, non-GATT specific type. */ +/** @} */ + + +/** @defgroup BLE_GATTS_OPS GATT Server Operations + * @{ */ +#define BLE_GATTS_OP_INVALID 0x00 /**< Invalid Operation. */ +#define BLE_GATTS_OP_WRITE_REQ 0x01 /**< Write Request. */ +#define BLE_GATTS_OP_WRITE_CMD 0x02 /**< Write Command. */ +#define BLE_GATTS_OP_SIGN_WRITE_CMD 0x03 /**< Signed Write Command. */ +#define BLE_GATTS_OP_PREP_WRITE_REQ 0x04 /**< Prepare Write Request. */ +#define BLE_GATTS_OP_EXEC_WRITE_REQ_CANCEL 0x05 /**< Execute Write Request: Cancel all prepared writes. */ +#define BLE_GATTS_OP_EXEC_WRITE_REQ_NOW 0x06 /**< Execute Write Request: Immediately execute all prepared writes. */ +/** @} */ + +/** @defgroup BLE_GATTS_VLOCS GATT Value Locations + * @{ */ +#define BLE_GATTS_VLOC_INVALID 0x00 /**< Invalid Location. */ +#define BLE_GATTS_VLOC_STACK 0x01 /**< Attribute Value is located in stack memory, no user memory is required. */ +#define BLE_GATTS_VLOC_USER 0x02 /**< Attribute Value is located in user memory. This requires the user to maintain a valid buffer through the lifetime of the attribute, since the stack + will read and write directly to the memory using the pointer provided in the APIs. There are no alignment requirements for the buffer. */ +/** @} */ + +/** @defgroup BLE_GATTS_AUTHORIZE_TYPES GATT Server Authorization Types + * @{ */ +#define BLE_GATTS_AUTHORIZE_TYPE_INVALID 0x00 /**< Invalid Type. */ +#define BLE_GATTS_AUTHORIZE_TYPE_READ 0x01 /**< Authorize a Read Operation. */ +#define BLE_GATTS_AUTHORIZE_TYPE_WRITE 0x02 /**< Authorize a Write Request Operation. */ +/** @} */ + +/** @defgroup BLE_GATTS_SYS_ATTR_FLAGS System Attribute Flags + * @{ */ +#define BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS (1 << 0) /**< Restrict system attributes to system services only. */ +#define BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS (1 << 1) /**< Restrict system attributes to user services only. */ +/** @} */ + +/** @defgroup BLE_GATTS_SERVICE_CHANGED Service Changed Inclusion Values + * @{ + */ +#define BLE_GATTS_SERVICE_CHANGED_DEFAULT (1) /**< Default is to include the Service Changed characteristic in the Attribute Table. */ +/** @} */ + +/** @defgroup BLE_GATTS_ATTR_TAB_SIZE Attribute Table size + * @{ + */ +#define BLE_GATTS_ATTR_TAB_SIZE_MIN (248) /**< Minimum Attribute Table size */ +#define BLE_GATTS_ATTR_TAB_SIZE_DEFAULT (1408) /**< Default Attribute Table size. */ +/** @} */ + +/** @defgroup BLE_GATTS_DEFAULTS GATT Server defaults + * @{ + */ +#define BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT 1 /**< Default number of Handle Value Notifications that can be queued for transmission. */ +/** @} */ + +/** @} */ + +/** @addtogroup BLE_GATTS_STRUCTURES Structures + * @{ */ + +/** + * @brief BLE GATTS connection configuration parameters, set with @ref sd_ble_cfg_set. + */ +typedef struct +{ + uint8_t hvn_tx_queue_size; /**< Minimum guaranteed number of Handle Value Notifications that can be queued for transmission. + The default value is @ref BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT */ +} ble_gatts_conn_cfg_t; + +/**@brief Attribute metadata. */ +typedef struct +{ + ble_gap_conn_sec_mode_t read_perm; /**< Read permissions. */ + ble_gap_conn_sec_mode_t write_perm; /**< Write permissions. */ + uint8_t vlen :1; /**< Variable length attribute. */ + uint8_t vloc :2; /**< Value location, see @ref BLE_GATTS_VLOCS.*/ + uint8_t rd_auth :1; /**< Read authorization and value will be requested from the application on every read operation. */ + uint8_t wr_auth :1; /**< Write authorization will be requested from the application on every Write Request operation (but not Write Command). */ +} ble_gatts_attr_md_t; + + +/**@brief GATT Attribute. */ +typedef struct +{ + ble_uuid_t const *p_uuid; /**< Pointer to the attribute UUID. */ + ble_gatts_attr_md_t const *p_attr_md; /**< Pointer to the attribute metadata structure. */ + uint16_t init_len; /**< Initial attribute value length in bytes. */ + uint16_t init_offs; /**< Initial attribute value offset in bytes. If different from zero, the first init_offs bytes of the attribute value will be left uninitialized. */ + uint16_t max_len; /**< Maximum attribute value length in bytes, see @ref BLE_GATTS_ATTR_LENS_MAX for maximum values. */ + uint8_t *p_value; /**< Pointer to the attribute data. Please note that if the @ref BLE_GATTS_VLOC_USER value location is selected in the attribute metadata, this will have to point to a buffer + that remains valid through the lifetime of the attribute. This excludes usage of automatic variables that may go out of scope or any other temporary location. + The stack may access that memory directly without the application's knowledge. For writable characteristics, this value must not be a location in flash memory.*/ +} ble_gatts_attr_t; + +/**@brief GATT Attribute Value. */ +typedef struct +{ + uint16_t len; /**< Length in bytes to be written or read. Length in bytes written or read after successful return.*/ + uint16_t offset; /**< Attribute value offset. */ + uint8_t *p_value; /**< Pointer to where value is stored or will be stored. + If value is stored in user memory, only the attribute length is updated when p_value == NULL. + Set to NULL when reading to obtain the complete length of the attribute value */ +} ble_gatts_value_t; + + +/**@brief GATT Characteristic Presentation Format. */ +typedef struct +{ + uint8_t format; /**< Format of the value, see @ref BLE_GATT_CPF_FORMATS. */ + int8_t exponent; /**< Exponent for integer data types. */ + uint16_t unit; /**< Unit from Bluetooth Assigned Numbers. */ + uint8_t name_space; /**< Namespace from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES. */ + uint16_t desc; /**< Namespace description from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES. */ +} ble_gatts_char_pf_t; + + +/**@brief GATT Characteristic metadata. */ +typedef struct +{ + ble_gatt_char_props_t char_props; /**< Characteristic Properties. */ + ble_gatt_char_ext_props_t char_ext_props; /**< Characteristic Extended Properties. */ + uint8_t const *p_char_user_desc; /**< Pointer to a UTF-8 encoded string (non-NULL terminated), NULL if the descriptor is not required. */ + uint16_t char_user_desc_max_size; /**< The maximum size in bytes of the user description descriptor. */ + uint16_t char_user_desc_size; /**< The size of the user description, must be smaller or equal to char_user_desc_max_size. */ + ble_gatts_char_pf_t const *p_char_pf; /**< Pointer to a presentation format structure or NULL if the CPF descriptor is not required. */ + ble_gatts_attr_md_t const *p_user_desc_md; /**< Attribute metadata for the User Description descriptor, or NULL for default values. */ + ble_gatts_attr_md_t const *p_cccd_md; /**< Attribute metadata for the Client Characteristic Configuration Descriptor, or NULL for default values. */ + ble_gatts_attr_md_t const *p_sccd_md; /**< Attribute metadata for the Server Characteristic Configuration Descriptor, or NULL for default values. */ +} ble_gatts_char_md_t; + + +/**@brief GATT Characteristic Definition Handles. */ +typedef struct +{ + uint16_t value_handle; /**< Handle to the characteristic value. */ + uint16_t user_desc_handle; /**< Handle to the User Description descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present. */ + uint16_t cccd_handle; /**< Handle to the Client Characteristic Configuration Descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present. */ + uint16_t sccd_handle; /**< Handle to the Server Characteristic Configuration Descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present. */ +} ble_gatts_char_handles_t; + + +/**@brief GATT HVx parameters. */ +typedef struct +{ + uint16_t handle; /**< Characteristic Value Handle. */ + uint8_t type; /**< Indication or Notification, see @ref BLE_GATT_HVX_TYPES. */ + uint16_t offset; /**< Offset within the attribute value. */ + uint16_t *p_len; /**< Length in bytes to be written, length in bytes written after return. */ + uint8_t const *p_data; /**< Actual data content, use NULL to use the current attribute value. */ +} ble_gatts_hvx_params_t; + +/**@brief GATT Authorization parameters. */ +typedef struct +{ + uint16_t gatt_status; /**< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES. */ + uint8_t update : 1; /**< If set, data supplied in p_data will be used to update the attribute value. + Please note that for @ref BLE_GATTS_AUTHORIZE_TYPE_WRITE operations this bit must always be set, + as the data to be written needs to be stored and later provided by the application. */ + uint16_t offset; /**< Offset of the attribute value being updated. */ + uint16_t len; /**< Length in bytes of the value in p_data pointer, see @ref BLE_GATTS_ATTR_LENS_MAX. */ + uint8_t const *p_data; /**< Pointer to new value used to update the attribute value. */ +} ble_gatts_authorize_params_t; + +/**@brief GATT Read or Write Authorize Reply parameters. */ +typedef struct +{ + uint8_t type; /**< Type of authorize operation, see @ref BLE_GATTS_AUTHORIZE_TYPES. */ + union { + ble_gatts_authorize_params_t read; /**< Read authorization parameters. */ + ble_gatts_authorize_params_t write; /**< Write authorization parameters. */ + } params; /**< Reply Parameters. */ +} ble_gatts_rw_authorize_reply_params_t; + +/**@brief Service Changed Inclusion configuration parameters, set with @ref sd_ble_cfg_set. */ +typedef struct +{ + uint8_t service_changed : 1; /**< If 1, include the Service Changed characteristic in the Attribute Table. Default is @ref BLE_GATTS_SERVICE_CHANGED_DEFAULT. */ +} ble_gatts_cfg_service_changed_t; + +/**@brief Attribute table size configuration parameters, set with @ref sd_ble_cfg_set. + * + * @retval ::NRF_ERROR_INVALID_LENGTH One or more of the following is true: + * - The specified Attribute Table size is too small. + * The minimum acceptable size is defined by @ref BLE_GATTS_ATTR_TAB_SIZE_MIN. + * - The specified Attribute Table size is not a multiple of 4. + */ +typedef struct +{ + uint32_t attr_tab_size; /**< Attribute table size. Default is @ref BLE_GATTS_ATTR_TAB_SIZE_DEFAULT, minimum is @ref BLE_GATTS_ATTR_TAB_SIZE_MIN. */ +} ble_gatts_cfg_attr_tab_size_t; + +/**@brief Config structure for GATTS configurations. */ +typedef union +{ + ble_gatts_cfg_service_changed_t service_changed; /**< Include service changed characteristic, cfg_id is @ref BLE_GATTS_CFG_SERVICE_CHANGED. */ + ble_gatts_cfg_attr_tab_size_t attr_tab_size; /**< Attribute table size, cfg_id is @ref BLE_GATTS_CFG_ATTR_TAB_SIZE. */ +} ble_gatts_cfg_t; + + +/**@brief Event structure for @ref BLE_GATTS_EVT_WRITE. */ +typedef struct +{ + uint16_t handle; /**< Attribute Handle. */ + ble_uuid_t uuid; /**< Attribute UUID. */ + uint8_t op; /**< Type of write operation, see @ref BLE_GATTS_OPS. */ + uint8_t auth_required; /**< Writing operation deferred due to authorization requirement. Application may use @ref sd_ble_gatts_value_set to finalize the writing operation. */ + uint16_t offset; /**< Offset for the write operation. */ + uint16_t len; /**< Length of the received data. */ + uint8_t data[1]; /**< Received data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gatts_evt_write_t; + +/**@brief Event substructure for authorized read requests, see @ref ble_gatts_evt_rw_authorize_request_t. */ +typedef struct +{ + uint16_t handle; /**< Attribute Handle. */ + ble_uuid_t uuid; /**< Attribute UUID. */ + uint16_t offset; /**< Offset for the read operation. */ +} ble_gatts_evt_read_t; + +/**@brief Event structure for @ref BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST. */ +typedef struct +{ + uint8_t type; /**< Type of authorize operation, see @ref BLE_GATTS_AUTHORIZE_TYPES. */ + union { + ble_gatts_evt_read_t read; /**< Attribute Read Parameters. */ + ble_gatts_evt_write_t write; /**< Attribute Write Parameters. */ + } request; /**< Request Parameters. */ +} ble_gatts_evt_rw_authorize_request_t; + +/**@brief Event structure for @ref BLE_GATTS_EVT_SYS_ATTR_MISSING. */ +typedef struct +{ + uint8_t hint; /**< Hint (currently unused). */ +} ble_gatts_evt_sys_attr_missing_t; + + +/**@brief Event structure for @ref BLE_GATTS_EVT_HVC. */ +typedef struct +{ + uint16_t handle; /**< Attribute Handle. */ +} ble_gatts_evt_hvc_t; + +/**@brief Event structure for @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST. */ +typedef struct +{ + uint16_t client_rx_mtu; /**< Client RX MTU size. */ +} ble_gatts_evt_exchange_mtu_request_t; + +/**@brief Event structure for @ref BLE_GATTS_EVT_TIMEOUT. */ +typedef struct +{ + uint8_t src; /**< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES. */ +} ble_gatts_evt_timeout_t; + +/**@brief Event structure for @ref BLE_GATTS_EVT_HVN_TX_COMPLETE. */ +typedef struct +{ + uint8_t count; /**< Number of notification transmissions completed. */ +} ble_gatts_evt_hvn_tx_complete_t; + +/**@brief GATTS event structure. */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle on which the event occurred. */ + union + { + ble_gatts_evt_write_t write; /**< Write Event Parameters. */ + ble_gatts_evt_rw_authorize_request_t authorize_request; /**< Read or Write Authorize Request Parameters. */ + ble_gatts_evt_sys_attr_missing_t sys_attr_missing; /**< System attributes missing. */ + ble_gatts_evt_hvc_t hvc; /**< Handle Value Confirmation Event Parameters. */ + ble_gatts_evt_exchange_mtu_request_t exchange_mtu_request; /**< Exchange MTU Request Event Parameters. */ + ble_gatts_evt_timeout_t timeout; /**< Timeout Event. */ + ble_gatts_evt_hvn_tx_complete_t hvn_tx_complete; /**< Handle Value Notification transmission complete Event Parameters. */ + } params; /**< Event Parameters. */ +} ble_gatts_evt_t; + +/** @} */ + +/** @addtogroup BLE_GATTS_FUNCTIONS Functions + * @{ */ + +/**@brief Add a service declaration to the Attribute Table. + * + * @note Secondary Services are only relevant in the context of the entity that references them, it is therefore forbidden to + * add a secondary service declaration that is not referenced by another service later in the Attribute Table. + * + * @mscs + * @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC} + * @endmscs + * + * @param[in] type Toggles between primary and secondary services, see @ref BLE_GATTS_SRVC_TYPES. + * @param[in] p_uuid Pointer to service UUID. + * @param[out] p_handle Pointer to a 16-bit word where the assigned handle will be stored. + * + * @retval ::NRF_SUCCESS Successfully added a service declaration. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, Vendor Specific UUIDs need to be present in the table. + * @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. + */ +SVCALL(SD_BLE_GATTS_SERVICE_ADD, uint32_t, sd_ble_gatts_service_add(uint8_t type, ble_uuid_t const *p_uuid, uint16_t *p_handle)); + + +/**@brief Add an include declaration to the Attribute Table. + * + * @note It is currently only possible to add an include declaration to the last added service (i.e. only sequential population is supported at this time). + * + * @note The included service must already be present in the Attribute Table prior to this call. + * + * @mscs + * @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC} + * @endmscs + * + * @param[in] service_handle Handle of the service where the included service is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. + * @param[in] inc_srvc_handle Handle of the included service. + * @param[out] p_include_handle Pointer to a 16-bit word where the assigned handle will be stored. + * + * @retval ::NRF_SUCCESS Successfully added an include declaration. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, handle values need to match previously added services. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a service context is required. + * @retval ::NRF_ERROR_NOT_SUPPORTED Feature is not supported, service_handle must be that of the last added service. + * @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, self inclusions are not allowed. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. + * @retval ::NRF_ERROR_NOT_FOUND Attribute not found. + */ +SVCALL(SD_BLE_GATTS_INCLUDE_ADD, uint32_t, sd_ble_gatts_include_add(uint16_t service_handle, uint16_t inc_srvc_handle, uint16_t *p_include_handle)); + + +/**@brief Add a characteristic declaration, a characteristic value declaration and optional characteristic descriptor declarations to the Attribute Table. + * + * @note It is currently only possible to add a characteristic to the last added service (i.e. only sequential population is supported at this time). + * + * @note Several restrictions apply to the parameters, such as matching permissions between the user description descriptor and the writable auxiliaries bits, + * readable (no security) and writable (selectable) CCCDs and SCCDs and valid presentation format values. + * + * @note If no metadata is provided for the optional descriptors, their permissions will be derived from the characteristic permissions. + * + * @mscs + * @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC} + * @endmscs + * + * @param[in] service_handle Handle of the service where the characteristic is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. + * @param[in] p_char_md Characteristic metadata. + * @param[in] p_attr_char_value Pointer to the attribute structure corresponding to the characteristic value. + * @param[out] p_handles Pointer to the structure where the assigned handles will be stored. + * + * @retval ::NRF_SUCCESS Successfully added a characteristic. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, service handle, Vendor Specific UUIDs, lengths, and permissions need to adhere to the constraints. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a service context is required. + * @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX. + */ +SVCALL(SD_BLE_GATTS_CHARACTERISTIC_ADD, uint32_t, sd_ble_gatts_characteristic_add(uint16_t service_handle, ble_gatts_char_md_t const *p_char_md, ble_gatts_attr_t const *p_attr_char_value, ble_gatts_char_handles_t *p_handles)); + + +/**@brief Add a descriptor to the Attribute Table. + * + * @note It is currently only possible to add a descriptor to the last added characteristic (i.e. only sequential population is supported at this time). + * + * @mscs + * @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC} + * @endmscs + * + * @param[in] char_handle Handle of the characteristic where the descriptor is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. + * @param[in] p_attr Pointer to the attribute structure. + * @param[out] p_handle Pointer to a 16-bit word where the assigned handle will be stored. + * + * @retval ::NRF_SUCCESS Successfully added a descriptor. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, characteristic handle, Vendor Specific UUIDs, lengths, and permissions need to adhere to the constraints. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a characteristic context is required. + * @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX. + */ +SVCALL(SD_BLE_GATTS_DESCRIPTOR_ADD, uint32_t, sd_ble_gatts_descriptor_add(uint16_t char_handle, ble_gatts_attr_t const *p_attr, uint16_t *p_handle)); + +/**@brief Set the value of a given attribute. + * + * @note Values other than system attributes can be set at any time, regardless of whether any active connections exist. + * + * @mscs + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. Ignored if the value does not belong to a system attribute. + * @param[in] handle Attribute handle. + * @param[in,out] p_value Attribute value information. + * + * @retval ::NRF_SUCCESS Successfully set the value of the attribute. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_NOT_FOUND Attribute not found. + * @retval ::NRF_ERROR_FORBIDDEN Forbidden handle supplied, certain attributes are not modifiable by the application. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied on a system attribute. + */ +SVCALL(SD_BLE_GATTS_VALUE_SET, uint32_t, sd_ble_gatts_value_set(uint16_t conn_handle, uint16_t handle, ble_gatts_value_t *p_value)); + +/**@brief Get the value of a given attribute. + * + * @note If the attribute value is longer than the size of the supplied buffer, + * @ref ble_gatts_value_t::len will return the total attribute value length (excluding offset), + * and not the number of bytes actually returned in @ref ble_gatts_value_t::p_value. + * The application may use this information to allocate a suitable buffer size. + * + * @note When retrieving system attribute values with this function, the connection handle + * may refer to an already disconnected connection. Refer to the documentation of + * @ref sd_ble_gatts_sys_attr_get for further information. + * + * @param[in] conn_handle Connection handle. Ignored if the value does not belong to a system attribute. + * @param[in] handle Attribute handle. + * @param[in,out] p_value Attribute value information. + * + * @retval ::NRF_SUCCESS Successfully retrieved the value of the attribute. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_NOT_FOUND Attribute not found. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid attribute offset supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied on a system attribute. + * @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value. + */ +SVCALL(SD_BLE_GATTS_VALUE_GET, uint32_t, sd_ble_gatts_value_get(uint16_t conn_handle, uint16_t handle, ble_gatts_value_t *p_value)); + +/**@brief Notify or Indicate an attribute value. + * + * @details This function checks for the relevant Client Characteristic Configuration descriptor value to verify that the relevant operation + * (notification or indication) has been enabled by the client. It is also able to update the attribute value before issuing the PDU, so that + * the application can atomically perform a value update and a server initiated transaction with a single API call. + * + * @note The local attribute value may be updated even if an outgoing packet is not sent to the peer due to an error during execution. + * The Attribute Table has been updated if one of the following error codes is returned: @ref NRF_ERROR_INVALID_STATE, @ref NRF_ERROR_BUSY, + * @ref NRF_ERROR_FORBIDDEN, @ref BLE_ERROR_GATTS_SYS_ATTR_MISSING and @ref NRF_ERROR_RESOURCES. + * The caller can check whether the value has been updated by looking at the contents of *(@ref ble_gatts_hvx_params_t::p_len). + * + * @note Only one indication procedure can be ongoing per connection at a time. + * If the application tries to indicate an attribute value while another indication procedure is ongoing, + * the function call will return @ref NRF_ERROR_BUSY. + * A @ref BLE_GATTS_EVT_HVC event will be issued as soon as the confirmation arrives from the peer. + * + * @note The number of Handle Value Notifications that can be queued is configured by @ref ble_gatts_conn_cfg_t::hvn_tx_queue_size + * When the queue is full, the function call will return @ref NRF_ERROR_RESOURCES. + * A @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event will be issued as soon as the transmission of the notification is complete. + * + * @note The application can keep track of the available queue element count for notifications by following the procedure below: + * - Store initial queue element count in a variable. + * - Decrement the variable, which stores the currently available queue element count, by one when a call to this function returns @ref NRF_SUCCESS. + * - Increment the variable, which stores the current available queue element count, by the count variable in @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event. + * + * @events + * @event{@ref BLE_GATTS_EVT_HVN_TX_COMPLETE, Notification transmission complete.} + * @event{@ref BLE_GATTS_EVT_HVC, Confirmation received from the peer.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTS_HVX_SYS_ATTRS_MISSING_MSC} + * @mmsc{@ref BLE_GATTS_HVN_MSC} + * @mmsc{@ref BLE_GATTS_HVI_MSC} + * @mmsc{@ref BLE_GATTS_HVX_DISABLED_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in,out] p_hvx_params Pointer to an HVx parameters structure. If @ref ble_gatts_hvx_params_t::p_data + * contains a non-NULL pointer the attribute value will be updated with the contents + * pointed by it before sending the notification or indication. If the attribute value + * is updated, @ref ble_gatts_hvx_params_t::p_len is updated by the SoftDevice to + * contain the number of actual bytes written, else it will be set to 0. + * + * @retval ::NRF_SUCCESS Successfully queued a notification or indication for transmission, and optionally updated the attribute value. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE One or more of the following is true: + * - Invalid Connection State + * - Notifications and/or indications not enabled in the CCCD + * - An ATT_MTU exchange is ongoing + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle(s) supplied. Only attributes added directly by the application are available to notify and indicate. + * @retval ::BLE_ERROR_GATTS_INVALID_ATTR_TYPE Invalid attribute type(s) supplied, only characteristic values may be notified and indicated. + * @retval ::NRF_ERROR_NOT_FOUND Attribute not found. + * @retval ::NRF_ERROR_FORBIDDEN The connection's current security level is lower than the one required by the write permissions of the CCCD associated with this characteristic. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. + * @retval ::NRF_ERROR_BUSY For @ref BLE_GATT_HVX_INDICATION Procedure already in progress. Wait for a @ref BLE_GATTS_EVT_HVC event and retry. + * @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value. + * @retval ::NRF_ERROR_RESOURCES Too many notifications queued. + * Wait for a @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event and retry. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTS_HVX, uint32_t, sd_ble_gatts_hvx(uint16_t conn_handle, ble_gatts_hvx_params_t const *p_hvx_params)); + +/**@brief Indicate the Service Changed attribute value. + * + * @details This call will send a Handle Value Indication to one or more peers connected to inform them that the Attribute + * Table layout has changed. As soon as the peer has confirmed the indication, a @ref BLE_GATTS_EVT_SC_CONFIRM event will + * be issued. + * + * @note Some of the restrictions and limitations that apply to @ref sd_ble_gatts_hvx also apply here. + * + * @events + * @event{@ref BLE_GATTS_EVT_SC_CONFIRM, Confirmation of attribute table change received from peer.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTS_SC_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] start_handle Start of affected attribute handle range. + * @param[in] end_handle End of affected attribute handle range. + * + * @retval ::NRF_SUCCESS Successfully queued the Service Changed indication for transmission. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_NOT_SUPPORTED Service Changed not enabled at initialization. See @ref + * sd_ble_cfg_set and @ref ble_gatts_cfg_service_changed_t. + * @retval ::NRF_ERROR_INVALID_STATE One or more of the following is true: + * - Invalid Connection State + * - Notifications and/or indications not enabled in the CCCD + * - An ATT_MTU exchange is ongoing + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle(s) supplied, handles must be in the range populated by the application. + * @retval ::NRF_ERROR_BUSY Procedure already in progress. + * @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTS_SERVICE_CHANGED, uint32_t, sd_ble_gatts_service_changed(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle)); + +/**@brief Respond to a Read/Write authorization request. + * + * @note This call should only be used as a response to a @ref BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event issued to the application. + * + * @mscs + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC} + * @mmsc{@ref BLE_GATTS_READ_REQ_AUTH_MSC} + * @mmsc{@ref BLE_GATTS_WRITE_REQ_AUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_rw_authorize_reply_params Pointer to a structure with the attribute provided by the application. + * + * @note @ref ble_gatts_authorize_params_t::p_data is ignored when this function is used to respond + * to a @ref BLE_GATTS_AUTHORIZE_TYPE_READ event if @ref ble_gatts_authorize_params_t::update + * is set to 0. + * + * @retval ::NRF_SUCCESS Successfully queued a response to the peer, and in the case of a write operation, Attribute Table updated. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no authorization request pending. + * @retval ::NRF_ERROR_INVALID_PARAM Authorization op invalid, + * handle supplied does not match requested handle, + * or invalid data to be written provided by the application. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTS_RW_AUTHORIZE_REPLY, uint32_t, sd_ble_gatts_rw_authorize_reply(uint16_t conn_handle, ble_gatts_rw_authorize_reply_params_t const *p_rw_authorize_reply_params)); + + +/**@brief Update persistent system attribute information. + * + * @details Supply information about persistent system attributes to the stack, + * previously obtained using @ref sd_ble_gatts_sys_attr_get. + * This call is only allowed for active connections, and is usually + * made immediately after a connection is established with an known bonded device, + * often as a response to a @ref BLE_GATTS_EVT_SYS_ATTR_MISSING. + * + * p_sysattrs may point directly to the application's stored copy of the system attributes + * obtained using @ref sd_ble_gatts_sys_attr_get. + * If the pointer is NULL, the system attribute info is initialized, assuming that + * the application does not have any previously saved system attribute data for this device. + * + * @note The state of persistent system attributes is reset upon connection establishment and then remembered for its duration. + * + * @note If this call returns with an error code different from @ref NRF_SUCCESS, the storage of persistent system attributes may have been completed only partially. + * This means that the state of the attribute table is undefined, and the application should either provide a new set of attributes using this same call or + * reset the SoftDevice to return to a known state. + * + * @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be modified. + * @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be modified. + * + * @mscs + * @mmsc{@ref BLE_GATTS_HVX_SYS_ATTRS_MISSING_MSC} + * @mmsc{@ref BLE_GATTS_SYS_ATTRS_UNK_PEER_MSC} + * @mmsc{@ref BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_sys_attr_data Pointer to a saved copy of system attributes supplied to the stack, or NULL. + * @param[in] len Size of data pointed by p_sys_attr_data, in octets. + * @param[in] flags Optional additional flags, see @ref BLE_GATTS_SYS_ATTR_FLAGS + * + * @retval ::NRF_SUCCESS Successfully set the system attribute information. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid flags supplied. + * @retval ::NRF_ERROR_INVALID_DATA Invalid data supplied, the data should be exactly the same as retrieved with @ref sd_ble_gatts_sys_attr_get. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. + */ +SVCALL(SD_BLE_GATTS_SYS_ATTR_SET, uint32_t, sd_ble_gatts_sys_attr_set(uint16_t conn_handle, uint8_t const *p_sys_attr_data, uint16_t len, uint32_t flags)); + + +/**@brief Retrieve persistent system attribute information from the stack. + * + * @details This call is used to retrieve information about values to be stored persistently by the application + * during the lifetime of a connection or after it has been terminated. When a new connection is established with the same bonded device, + * the system attribute information retrieved with this function should be restored using using @ref sd_ble_gatts_sys_attr_set. + * If retrieved after disconnection, the data should be read before a new connection established. The connection handle for + * the previous, now disconnected, connection will remain valid until a new one is created to allow this API call to refer to it. + * Connection handles belonging to active connections can be used as well, but care should be taken since the system attributes + * may be written to at any time by the peer during a connection's lifetime. + * + * @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be returned. + * @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be returned. + * + * @mscs + * @mmsc{@ref BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle of the recently terminated connection. + * @param[out] p_sys_attr_data Pointer to a buffer where updated information about system attributes will be filled in. The format of the data is described + * in @ref BLE_GATTS_SYS_ATTRS_FORMAT. NULL can be provided to obtain the length of the data. + * @param[in,out] p_len Size of application buffer if p_sys_attr_data is not NULL. Unconditionally updated to actual length of system attribute data. + * @param[in] flags Optional additional flags, see @ref BLE_GATTS_SYS_ATTR_FLAGS + * + * @retval ::NRF_SUCCESS Successfully retrieved the system attribute information. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid flags supplied. + * @retval ::NRF_ERROR_DATA_SIZE The system attribute information did not fit into the provided buffer. + * @retval ::NRF_ERROR_NOT_FOUND No system attributes found. + */ +SVCALL(SD_BLE_GATTS_SYS_ATTR_GET, uint32_t, sd_ble_gatts_sys_attr_get(uint16_t conn_handle, uint8_t *p_sys_attr_data, uint16_t *p_len, uint32_t flags)); + + +/**@brief Retrieve the first valid user attribute handle. + * + * @param[out] p_handle Pointer to an integer where the handle will be stored. + * + * @retval ::NRF_SUCCESS Successfully retrieved the handle. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + */ +SVCALL(SD_BLE_GATTS_INITIAL_USER_HANDLE_GET, uint32_t, sd_ble_gatts_initial_user_handle_get(uint16_t *p_handle)); + +/**@brief Retrieve the attribute UUID and/or metadata. + * + * @param[in] handle Attribute handle + * @param[out] p_uuid UUID of the attribute. Use NULL to omit this field. + * @param[out] p_md Metadata of the attribute. Use NULL to omit this field. + * + * @retval ::NRF_SUCCESS Successfully retrieved the attribute metadata, + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameters supplied. Returned when both @c p_uuid and @c p_md are NULL. + * @retval ::NRF_ERROR_NOT_FOUND Attribute was not found. + */ +SVCALL(SD_BLE_GATTS_ATTR_GET, uint32_t, sd_ble_gatts_attr_get(uint16_t handle, ble_uuid_t * p_uuid, ble_gatts_attr_md_t * p_md)); + +/**@brief Reply to an ATT_MTU exchange request by sending an Exchange MTU Response to the client. + * + * @details This function is only used to reply to a @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST event. + * + * @details The SoftDevice sets ATT_MTU to the minimum of: + * - The Client RX MTU value from @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST, and + * - The Server RX MTU value. + * + * However, the SoftDevice never sets ATT_MTU lower than @ref BLE_GATT_ATT_MTU_DEFAULT. + * + * @mscs + * @mmsc{@ref BLE_GATTS_MTU_EXCHANGE} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] server_rx_mtu Server RX MTU size. + * - The minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT. + * - The maximum value is @ref ble_gatt_conn_cfg_t::att_mtu in the connection configuration + * used for this connection. + * - The value must be equal to Client RX MTU size given in @ref sd_ble_gattc_exchange_mtu_request + * if an ATT_MTU exchange has already been performed in the other direction. + * + * @retval ::NRF_SUCCESS Successfully sent response to the client. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no ATT_MTU exchange request pending. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid Server RX MTU size supplied. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTS_EXCHANGE_MTU_REPLY, uint32_t, sd_ble_gatts_exchange_mtu_reply(uint16_t conn_handle, uint16_t server_rx_mtu)); +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif // BLE_GATTS_H__ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_hci.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_hci.h new file mode 100644 index 0000000000..f0dde9a03a --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_hci.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_COMMON + @{ +*/ + + +#ifndef BLE_HCI_H__ +#define BLE_HCI_H__ +#ifdef __cplusplus +extern "C" { +#endif + +/** @defgroup BLE_HCI_STATUS_CODES Bluetooth status codes + * @{ */ + +#define BLE_HCI_STATUS_CODE_SUCCESS 0x00 /**< Success. */ +#define BLE_HCI_STATUS_CODE_UNKNOWN_BTLE_COMMAND 0x01 /**< Unknown BLE Command. */ +#define BLE_HCI_STATUS_CODE_UNKNOWN_CONNECTION_IDENTIFIER 0x02 /**< Unknown Connection Identifier. */ +/*0x03 Hardware Failure +0x04 Page Timeout +*/ +#define BLE_HCI_AUTHENTICATION_FAILURE 0x05 /**< Authentication Failure. */ +#define BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING 0x06 /**< Pin or Key missing. */ +#define BLE_HCI_MEMORY_CAPACITY_EXCEEDED 0x07 /**< Memory Capacity Exceeded. */ +#define BLE_HCI_CONNECTION_TIMEOUT 0x08 /**< Connection Timeout. */ +/*0x09 Connection Limit Exceeded +0x0A Synchronous Connection Limit To A Device Exceeded +0x0B ACL Connection Already Exists*/ +#define BLE_HCI_STATUS_CODE_COMMAND_DISALLOWED 0x0C /**< Command Disallowed. */ +/*0x0D Connection Rejected due to Limited Resources +0x0E Connection Rejected Due To Security Reasons +0x0F Connection Rejected due to Unacceptable BD_ADDR +0x10 Connection Accept Timeout Exceeded +0x11 Unsupported Feature or Parameter Value*/ +#define BLE_HCI_STATUS_CODE_INVALID_BTLE_COMMAND_PARAMETERS 0x12 /**< Invalid BLE Command Parameters. */ +#define BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION 0x13 /**< Remote User Terminated Connection. */ +#define BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES 0x14 /**< Remote Device Terminated Connection due to low resources.*/ +#define BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF 0x15 /**< Remote Device Terminated Connection due to power off. */ +#define BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION 0x16 /**< Local Host Terminated Connection. */ +/* +0x17 Repeated Attempts +0x18 Pairing Not Allowed +0x19 Unknown LMP PDU +*/ +#define BLE_HCI_UNSUPPORTED_REMOTE_FEATURE 0x1A /**< Unsupported Remote Feature. */ +/* +0x1B SCO Offset Rejected +0x1C SCO Interval Rejected +0x1D SCO Air Mode Rejected*/ +#define BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS 0x1E /**< Invalid LMP Parameters. */ +#define BLE_HCI_STATUS_CODE_UNSPECIFIED_ERROR 0x1F /**< Unspecified Error. */ +/*0x20 Unsupported LMP Parameter Value +0x21 Role Change Not Allowed +*/ +#define BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT 0x22 /**< LMP Response Timeout. */ +#define BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION 0x23 /**< LMP Error Transaction Collision/LL Procedure Collision. */ +#define BLE_HCI_STATUS_CODE_LMP_PDU_NOT_ALLOWED 0x24 /**< LMP PDU Not Allowed. */ +/*0x25 Encryption Mode Not Acceptable +0x26 Link Key Can Not be Changed +0x27 Requested QoS Not Supported +*/ +#define BLE_HCI_INSTANT_PASSED 0x28 /**< Instant Passed. */ +#define BLE_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED 0x29 /**< Pairing with Unit Key Unsupported. */ +#define BLE_HCI_DIFFERENT_TRANSACTION_COLLISION 0x2A /**< Different Transaction Collision. */ +/* +0x2B Reserved +0x2C QoS Unacceptable Parameter +0x2D QoS Rejected +0x2E Channel Classification Not Supported +0x2F Insufficient Security +*/ +#define BLE_HCI_PARAMETER_OUT_OF_MANDATORY_RANGE 0x30 /**< Parameter Out Of Mandatory Range. */ +/* +0x31 Reserved +0x32 Role Switch Pending +0x33 Reserved +0x34 Reserved Slot Violation +0x35 Role Switch Failed +0x36 Extended Inquiry Response Too Large +0x37 Secure Simple Pairing Not Supported By Host. +0x38 Host Busy - Pairing +0x39 Connection Rejected due to No Suitable Channel Found*/ +#define BLE_HCI_CONTROLLER_BUSY 0x3A /**< Controller Busy. */ +#define BLE_HCI_CONN_INTERVAL_UNACCEPTABLE 0x3B /**< Connection Interval Unacceptable. */ +#define BLE_HCI_DIRECTED_ADVERTISER_TIMEOUT 0x3C /**< Directed Advertisement Timeout. */ +#define BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE 0x3D /**< Connection Terminated due to MIC Failure. */ +#define BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED 0x3E /**< Connection Failed to be Established. */ + +/** @} */ + + +#ifdef __cplusplus +} +#endif +#endif // BLE_HCI_H__ + +/** @} */ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h new file mode 100644 index 0000000000..7587350cf9 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h @@ -0,0 +1,507 @@ +/* + * Copyright (c) 2011 - 2020, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_L2CAP Logical Link Control and Adaptation Protocol (L2CAP) + @{ + @brief Definitions and prototypes for the L2CAP interface. + */ + +#ifndef BLE_L2CAP_H__ +#define BLE_L2CAP_H__ + +#include +#include "nrf_svc.h" +#include "nrf_error.h" +#include "ble_ranges.h" +#include "ble_types.h" +#include "ble_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/**@addtogroup BLE_L2CAP_TERMINOLOGY Terminology + * @{ + * @details + * + * L2CAP SDU + * - A data unit that the application can send/receive to/from a peer. + * + * L2CAP PDU + * - A data unit that is exchanged between local and remote L2CAP entities. + * It consists of L2CAP protocol control information and payload fields. + * The payload field can contain an L2CAP SDU or a part of an L2CAP SDU. + * + * L2CAP MTU + * - The maximum length of an L2CAP SDU. + * + * L2CAP MPS + * - The maximum length of an L2CAP PDU payload field. + * + * Credits + * - A value indicating the number of L2CAP PDUs that the receiver of the credit can send to the peer. + * @} */ + +/**@addtogroup BLE_L2CAP_ENUMERATIONS Enumerations + * @{ */ + +/**@brief L2CAP API SVC numbers. */ +enum BLE_L2CAP_SVCS +{ + SD_BLE_L2CAP_CH_SETUP = BLE_L2CAP_SVC_BASE + 0, /**< Set up an L2CAP channel. */ + SD_BLE_L2CAP_CH_RELEASE = BLE_L2CAP_SVC_BASE + 1, /**< Release an L2CAP channel. */ + SD_BLE_L2CAP_CH_RX = BLE_L2CAP_SVC_BASE + 2, /**< Receive an SDU on an L2CAP channel. */ + SD_BLE_L2CAP_CH_TX = BLE_L2CAP_SVC_BASE + 3, /**< Transmit an SDU on an L2CAP channel. */ + SD_BLE_L2CAP_CH_FLOW_CONTROL = BLE_L2CAP_SVC_BASE + 4, /**< Advanced SDU reception flow control. */ +}; + +/**@brief L2CAP Event IDs. */ +enum BLE_L2CAP_EVTS +{ + BLE_L2CAP_EVT_CH_SETUP_REQUEST = BLE_L2CAP_EVT_BASE + 0, /**< L2CAP Channel Setup Request event. + \n Reply with @ref sd_ble_l2cap_ch_setup. + \n See @ref ble_l2cap_evt_ch_setup_request_t. */ + BLE_L2CAP_EVT_CH_SETUP_REFUSED = BLE_L2CAP_EVT_BASE + 1, /**< L2CAP Channel Setup Refused event. + \n See @ref ble_l2cap_evt_ch_setup_refused_t. */ + BLE_L2CAP_EVT_CH_SETUP = BLE_L2CAP_EVT_BASE + 2, /**< L2CAP Channel Setup Completed event. + \n See @ref ble_l2cap_evt_ch_setup_t. */ + BLE_L2CAP_EVT_CH_RELEASED = BLE_L2CAP_EVT_BASE + 3, /**< L2CAP Channel Released event. + \n No additional event structure applies. */ + BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED = BLE_L2CAP_EVT_BASE + 4, /**< L2CAP Channel SDU data buffer released event. + \n See @ref ble_l2cap_evt_ch_sdu_buf_released_t. */ + BLE_L2CAP_EVT_CH_CREDIT = BLE_L2CAP_EVT_BASE + 5, /**< L2CAP Channel Credit received. + \n See @ref ble_l2cap_evt_ch_credit_t. */ + BLE_L2CAP_EVT_CH_RX = BLE_L2CAP_EVT_BASE + 6, /**< L2CAP Channel SDU received. + \n See @ref ble_l2cap_evt_ch_rx_t. */ + BLE_L2CAP_EVT_CH_TX = BLE_L2CAP_EVT_BASE + 7, /**< L2CAP Channel SDU transmitted. + \n See @ref ble_l2cap_evt_ch_tx_t. */ +}; + +/** @} */ + +/**@addtogroup BLE_L2CAP_DEFINES Defines + * @{ */ + +/**@brief Maximum number of L2CAP channels per connection. */ +#define BLE_L2CAP_CH_COUNT_MAX (64) + +/**@brief Minimum L2CAP MTU, in bytes. */ +#define BLE_L2CAP_MTU_MIN (23) + +/**@brief Minimum L2CAP MPS, in bytes. */ +#define BLE_L2CAP_MPS_MIN (23) + +/**@brief Invalid CID. */ +#define BLE_L2CAP_CID_INVALID (0x0000) + +/**@brief Default number of credits for @ref sd_ble_l2cap_ch_flow_control. */ +#define BLE_L2CAP_CREDITS_DEFAULT (1) + +/**@defgroup BLE_L2CAP_CH_SETUP_REFUSED_SRCS L2CAP channel setup refused sources + * @{ */ +#define BLE_L2CAP_CH_SETUP_REFUSED_SRC_LOCAL (0x01) /**< Local. */ +#define BLE_L2CAP_CH_SETUP_REFUSED_SRC_REMOTE (0x02) /**< Remote. */ + /** @} */ + + /** @defgroup BLE_L2CAP_CH_STATUS_CODES L2CAP channel status codes + * @{ */ +#define BLE_L2CAP_CH_STATUS_CODE_SUCCESS (0x0000) /**< Success. */ +#define BLE_L2CAP_CH_STATUS_CODE_LE_PSM_NOT_SUPPORTED (0x0002) /**< LE_PSM not supported. */ +#define BLE_L2CAP_CH_STATUS_CODE_NO_RESOURCES (0x0004) /**< No resources available. */ +#define BLE_L2CAP_CH_STATUS_CODE_INSUFF_AUTHENTICATION (0x0005) /**< Insufficient authentication. */ +#define BLE_L2CAP_CH_STATUS_CODE_INSUFF_AUTHORIZATION (0x0006) /**< Insufficient authorization. */ +#define BLE_L2CAP_CH_STATUS_CODE_INSUFF_ENC_KEY_SIZE (0x0007) /**< Insufficient encryption key size. */ +#define BLE_L2CAP_CH_STATUS_CODE_INSUFF_ENC (0x0008) /**< Insufficient encryption. */ +#define BLE_L2CAP_CH_STATUS_CODE_INVALID_SCID (0x0009) /**< Invalid Source CID. */ +#define BLE_L2CAP_CH_STATUS_CODE_SCID_ALLOCATED (0x000A) /**< Source CID already allocated. */ +#define BLE_L2CAP_CH_STATUS_CODE_UNACCEPTABLE_PARAMS (0x000B) /**< Unacceptable parameters. */ +#define BLE_L2CAP_CH_STATUS_CODE_NOT_UNDERSTOOD (0x8000) /**< Command Reject received instead of LE Credit Based Connection Response. */ +#define BLE_L2CAP_CH_STATUS_CODE_TIMEOUT (0xC000) /**< Operation timed out. */ +/** @} */ + +/** @} */ + +/**@addtogroup BLE_L2CAP_STRUCTURES Structures + * @{ */ + +/** + * @brief BLE L2CAP connection configuration parameters, set with @ref sd_ble_cfg_set. + * + * @note These parameters are set per connection, so all L2CAP channels created on this connection + * will have the same parameters. + * + * @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true: + * - rx_mps is smaller than @ref BLE_L2CAP_MPS_MIN. + * - tx_mps is smaller than @ref BLE_L2CAP_MPS_MIN. + * - ch_count is greater than @ref BLE_L2CAP_CH_COUNT_MAX. + * @retval ::NRF_ERROR_NO_MEM rx_mps or tx_mps is set too high. + */ +typedef struct +{ + uint16_t rx_mps; /**< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall + be able to receive on L2CAP channels on connections with this + configuration. The minimum value is @ref BLE_L2CAP_MPS_MIN. */ + uint16_t tx_mps; /**< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall + be able to transmit on L2CAP channels on connections with this + configuration. The minimum value is @ref BLE_L2CAP_MPS_MIN. */ + uint8_t rx_queue_size; /**< Number of SDU data buffers that can be queued for reception per + L2CAP channel. The minimum value is one. */ + uint8_t tx_queue_size; /**< Number of SDU data buffers that can be queued for transmission + per L2CAP channel. The minimum value is one. */ + uint8_t ch_count; /**< Number of L2CAP channels the application can create per connection + with this configuration. The default value is zero, the maximum + value is @ref BLE_L2CAP_CH_COUNT_MAX. + @note if this parameter is set to zero, all other parameters in + @ref ble_l2cap_conn_cfg_t are ignored. */ +} ble_l2cap_conn_cfg_t; + +/**@brief L2CAP channel RX parameters. */ +typedef struct +{ + uint16_t rx_mtu; /**< The maximum L2CAP SDU size, in bytes, that L2CAP shall be able to + receive on this L2CAP channel. + - Must be equal to or greater than @ref BLE_L2CAP_MTU_MIN. */ + uint16_t rx_mps; /**< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall be + able to receive on this L2CAP channel. + - Must be equal to or greater than @ref BLE_L2CAP_MPS_MIN. + - Must be equal to or less than @ref ble_l2cap_conn_cfg_t::rx_mps. */ + ble_data_t sdu_buf; /**< SDU data buffer for reception. + - If @ref ble_data_t::p_data is non-NULL, initial credits are + issued to the peer. + - If @ref ble_data_t::p_data is NULL, no initial credits are + issued to the peer. */ +} ble_l2cap_ch_rx_params_t; + +/**@brief L2CAP channel setup parameters. */ +typedef struct +{ + ble_l2cap_ch_rx_params_t rx_params; /**< L2CAP channel RX parameters. */ + uint16_t le_psm; /**< LE Protocol/Service Multiplexer. Used when requesting + setup of an L2CAP channel, ignored otherwise. */ + uint16_t status; /**< Status code, see @ref BLE_L2CAP_CH_STATUS_CODES. + Used when replying to a setup request of an L2CAP + channel, ignored otherwise. */ +} ble_l2cap_ch_setup_params_t; + +/**@brief L2CAP channel TX parameters. */ +typedef struct +{ + uint16_t tx_mtu; /**< The maximum L2CAP SDU size, in bytes, that L2CAP is able to + transmit on this L2CAP channel. */ + uint16_t peer_mps; /**< The maximum L2CAP PDU payload size, in bytes, that the peer is + able to receive on this L2CAP channel. */ + uint16_t tx_mps; /**< The maximum L2CAP PDU payload size, in bytes, that L2CAP is able + to transmit on this L2CAP channel. This is effective tx_mps, + selected by the SoftDevice as + MIN( @ref ble_l2cap_ch_tx_params_t::peer_mps, @ref ble_l2cap_conn_cfg_t::tx_mps ) */ + uint16_t credits; /**< Initial credits given by the peer. */ +} ble_l2cap_ch_tx_params_t; + +/**@brief L2CAP Channel Setup Request event. */ +typedef struct +{ + ble_l2cap_ch_tx_params_t tx_params; /**< L2CAP channel TX parameters. */ + uint16_t le_psm; /**< LE Protocol/Service Multiplexer. */ +} ble_l2cap_evt_ch_setup_request_t; + +/**@brief L2CAP Channel Setup Refused event. */ +typedef struct +{ + uint8_t source; /**< Source, see @ref BLE_L2CAP_CH_SETUP_REFUSED_SRCS */ + uint16_t status; /**< Status code, see @ref BLE_L2CAP_CH_STATUS_CODES */ +} ble_l2cap_evt_ch_setup_refused_t; + +/**@brief L2CAP Channel Setup Completed event. */ +typedef struct +{ + ble_l2cap_ch_tx_params_t tx_params; /**< L2CAP channel TX parameters. */ +} ble_l2cap_evt_ch_setup_t; + +/**@brief L2CAP Channel SDU Data Buffer Released event. */ +typedef struct +{ + ble_data_t sdu_buf; /**< Returned reception or transmission SDU data buffer. The SoftDevice + returns SDU data buffers supplied by the application, which have + not yet been returned previously via a @ref BLE_L2CAP_EVT_CH_RX or + @ref BLE_L2CAP_EVT_CH_TX event. */ +} ble_l2cap_evt_ch_sdu_buf_released_t; + +/**@brief L2CAP Channel Credit received event. */ +typedef struct +{ + uint16_t credits; /**< Additional credits given by the peer. */ +} ble_l2cap_evt_ch_credit_t; + +/**@brief L2CAP Channel received SDU event. */ +typedef struct +{ + uint16_t sdu_len; /**< Total SDU length, in bytes. */ + ble_data_t sdu_buf; /**< SDU data buffer. + @note If there is not enough space in the buffer + (sdu_buf.len < sdu_len) then the rest of the SDU will be + silently discarded by the SoftDevice. */ +} ble_l2cap_evt_ch_rx_t; + +/**@brief L2CAP Channel transmitted SDU event. */ +typedef struct +{ + ble_data_t sdu_buf; /**< SDU data buffer. */ +} ble_l2cap_evt_ch_tx_t; + +/**@brief L2CAP event structure. */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle on which the event occured. */ + uint16_t local_cid; /**< Local Channel ID of the L2CAP channel, or + @ref BLE_L2CAP_CID_INVALID if not present. */ + union + { + ble_l2cap_evt_ch_setup_request_t ch_setup_request; /**< L2CAP Channel Setup Request Event Parameters. */ + ble_l2cap_evt_ch_setup_refused_t ch_setup_refused; /**< L2CAP Channel Setup Refused Event Parameters. */ + ble_l2cap_evt_ch_setup_t ch_setup; /**< L2CAP Channel Setup Completed Event Parameters. */ + ble_l2cap_evt_ch_sdu_buf_released_t ch_sdu_buf_released;/**< L2CAP Channel SDU Data Buffer Released Event Parameters. */ + ble_l2cap_evt_ch_credit_t credit; /**< L2CAP Channel Credit Received Event Parameters. */ + ble_l2cap_evt_ch_rx_t rx; /**< L2CAP Channel SDU Received Event Parameters. */ + ble_l2cap_evt_ch_tx_t tx; /**< L2CAP Channel SDU Transmitted Event Parameters. */ + } params; /**< Event Parameters. */ +} ble_l2cap_evt_t; + +/** @} */ + +/**@addtogroup BLE_L2CAP_FUNCTIONS Functions + * @{ */ + +/**@brief Set up an L2CAP channel. + * + * @details This function is used to: + * - Request setup of an L2CAP channel: sends an LE Credit Based Connection Request packet to a peer. + * - Reply to a setup request of an L2CAP channel (if called in response to a + * @ref BLE_L2CAP_EVT_CH_SETUP_REQUEST event): sends an LE Credit Based Connection + * Response packet to a peer. + * + * @note A call to this function will require the application to keep the SDU data buffer alive + * until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_RX or + * @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event. + * + * @events + * @event{@ref BLE_L2CAP_EVT_CH_SETUP, Setup successful.} + * @event{@ref BLE_L2CAP_EVT_CH_SETUP_REFUSED, Setup failed.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_L2CAP_CH_SETUP_MSC} + * @endmscs + * + * @param[in] conn_handle Connection Handle. + * @param[in,out] p_local_cid Pointer to a uint16_t containing Local Channel ID of the L2CAP channel: + * - As input: @ref BLE_L2CAP_CID_INVALID when requesting setup of an L2CAP + * channel or local_cid provided in the @ref BLE_L2CAP_EVT_CH_SETUP_REQUEST + * event when replying to a setup request of an L2CAP channel. + * - As output: local_cid for this channel. + * @param[in] p_params L2CAP channel parameters. + * + * @retval ::NRF_SUCCESS Successfully queued request or response for transmission. + * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_LENGTH Supplied higher rx_mps than has been configured on this link. + * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (L2CAP channel already set up). + * @retval ::NRF_ERROR_NOT_FOUND CID not found. + * @retval ::NRF_ERROR_RESOURCES The limit has been reached for available L2CAP channels, + * see @ref ble_l2cap_conn_cfg_t::ch_count. + */ +SVCALL(SD_BLE_L2CAP_CH_SETUP, uint32_t, sd_ble_l2cap_ch_setup(uint16_t conn_handle, uint16_t *p_local_cid, ble_l2cap_ch_setup_params_t const *p_params)); + +/**@brief Release an L2CAP channel. + * + * @details This sends a Disconnection Request packet to a peer. + * + * @events + * @event{@ref BLE_L2CAP_EVT_CH_RELEASED, Release complete.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_L2CAP_CH_RELEASE_MSC} + * @endmscs + * + * @param[in] conn_handle Connection Handle. + * @param[in] local_cid Local Channel ID of the L2CAP channel. + * + * @retval ::NRF_SUCCESS Successfully queued request for transmission. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is + * in progress for the L2CAP channel). + * @retval ::NRF_ERROR_NOT_FOUND CID not found. + */ +SVCALL(SD_BLE_L2CAP_CH_RELEASE, uint32_t, sd_ble_l2cap_ch_release(uint16_t conn_handle, uint16_t local_cid)); + +/**@brief Receive an SDU on an L2CAP channel. + * + * @details This may issue additional credits to the peer using an LE Flow Control Credit packet. + * + * @note A call to this function will require the application to keep the memory pointed by + * @ref ble_data_t::p_data alive until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_RX + * or @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event. + * + * @note The SoftDevice can queue up to @ref ble_l2cap_conn_cfg_t::rx_queue_size SDU data buffers + * for reception per L2CAP channel. + * + * @events + * @event{@ref BLE_L2CAP_EVT_CH_RX, The SDU is received.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_L2CAP_CH_RX_MSC} + * @endmscs + * + * @param[in] conn_handle Connection Handle. + * @param[in] local_cid Local Channel ID of the L2CAP channel. + * @param[in] p_sdu_buf Pointer to the SDU data buffer. + * + * @retval ::NRF_SUCCESS Buffer accepted. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is + * in progress for an L2CAP channel). + * @retval ::NRF_ERROR_NOT_FOUND CID not found. + * @retval ::NRF_ERROR_RESOURCES Too many SDU data buffers supplied. Wait for a + * @ref BLE_L2CAP_EVT_CH_RX event and retry. + */ +SVCALL(SD_BLE_L2CAP_CH_RX, uint32_t, sd_ble_l2cap_ch_rx(uint16_t conn_handle, uint16_t local_cid, ble_data_t const *p_sdu_buf)); + +/**@brief Transmit an SDU on an L2CAP channel. + * + * @note A call to this function will require the application to keep the memory pointed by + * @ref ble_data_t::p_data alive until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_TX + * or @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event. + * + * @note The SoftDevice can queue up to @ref ble_l2cap_conn_cfg_t::tx_queue_size SDUs for + * transmission per L2CAP channel. + * + * @note The application can keep track of the available credits for transmission by following + * the procedure below: + * - Store initial credits given by the peer in a variable. + * (Initial credits are provided in a @ref BLE_L2CAP_EVT_CH_SETUP event.) + * - Decrement the variable, which stores the currently available credits, by + * ceiling((@ref ble_data_t::len + 2) / tx_mps) when a call to this function returns + * @ref NRF_SUCCESS. (tx_mps is provided in a @ref BLE_L2CAP_EVT_CH_SETUP event.) + * - Increment the variable, which stores the currently available credits, by additional + * credits given by the peer in a @ref BLE_L2CAP_EVT_CH_CREDIT event. + * + * @events + * @event{@ref BLE_L2CAP_EVT_CH_TX, The SDU is transmitted.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_L2CAP_CH_TX_MSC} + * @endmscs + * + * @param[in] conn_handle Connection Handle. + * @param[in] local_cid Local Channel ID of the L2CAP channel. + * @param[in] p_sdu_buf Pointer to the SDU data buffer. + * + * @retval ::NRF_SUCCESS Successfully queued L2CAP SDU for transmission. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is + * in progress for the L2CAP channel). + * @retval ::NRF_ERROR_NOT_FOUND CID not found. + * @retval ::NRF_ERROR_DATA_SIZE Invalid SDU length supplied, must not be more than + * @ref ble_l2cap_ch_tx_params_t::tx_mtu provided in + * @ref BLE_L2CAP_EVT_CH_SETUP event. + * @retval ::NRF_ERROR_RESOURCES Too many SDUs queued for transmission. Wait for a + * @ref BLE_L2CAP_EVT_CH_TX event and retry. + */ +SVCALL(SD_BLE_L2CAP_CH_TX, uint32_t, sd_ble_l2cap_ch_tx(uint16_t conn_handle, uint16_t local_cid, ble_data_t const *p_sdu_buf)); + +/**@brief Advanced SDU reception flow control. + * + * @details Adjust the way the SoftDevice issues credits to the peer. + * This may issue additional credits to the peer using an LE Flow Control Credit packet. + * + * @mscs + * @mmsc{@ref BLE_L2CAP_CH_FLOW_CONTROL_MSC} + * @endmscs + * + * @param[in] conn_handle Connection Handle. + * @param[in] local_cid Local Channel ID of the L2CAP channel or @ref BLE_L2CAP_CID_INVALID to set + * the value that will be used for newly created channels. + * @param[in] credits Number of credits that the SoftDevice will make sure the peer has every + * time it starts using a new reception buffer. + * - @ref BLE_L2CAP_CREDITS_DEFAULT is the default value the SoftDevice will + * use if this function is not called. + * - If set to zero, the SoftDevice will stop issuing credits for new reception + * buffers the application provides or has provided. SDU reception that is + * currently ongoing will be allowed to complete. + * @param[out] p_credits NULL or pointer to a uint16_t. If a valid pointer is provided, it will be + * written by the SoftDevice with the number of credits that is or will be + * available to the peer. If the value written by the SoftDevice is 0 when + * credits parameter was set to 0, the peer will not be able to send more + * data until more credits are provided by calling this function again with + * credits > 0. This parameter is ignored when local_cid is set to + * @ref BLE_L2CAP_CID_INVALID. + * + * @note Application should take care when setting number of credits higher than default value. In + * this case the application must make sure that the SoftDevice always has reception buffers + * available (see @ref sd_ble_l2cap_ch_rx) for that channel. If the SoftDevice does not have + * such buffers available, packets may be NACKed on the Link Layer and all Bluetooth traffic + * on the connection handle may be stalled until the SoftDevice again has an available + * reception buffer. This applies even if the application has used this call to set the + * credits back to default, or zero. + * + * @retval ::NRF_SUCCESS Flow control parameters accepted. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is + * in progress for an L2CAP channel). + * @retval ::NRF_ERROR_NOT_FOUND CID not found. + */ +SVCALL(SD_BLE_L2CAP_CH_FLOW_CONTROL, uint32_t, sd_ble_l2cap_ch_flow_control(uint16_t conn_handle, uint16_t local_cid, uint16_t credits, uint16_t *p_credits)); + +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif // BLE_L2CAP_H__ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_ranges.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_ranges.h new file mode 100644 index 0000000000..0935bca071 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_ranges.h @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2012 - 2018, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_COMMON + @{ + @defgroup ble_ranges Module specific SVC, event and option number subranges + @{ + + @brief Definition of SVC, event and option number subranges for each API module. + + @note + SVCs, event and option numbers are split into subranges for each API module. + Each module receives its entire allocated range of SVC calls, whether implemented or not, + but return BLE_ERROR_NOT_SUPPORTED for unimplemented or undefined calls in its range. + + Note that the symbols BLE__SVC_LAST is the end of the allocated SVC range, + rather than the last SVC function call actually defined and implemented. + + Specific SVC, event and option values are defined in each module's ble_.h file, + which defines names of each individual SVC code based on the range start value. +*/ + +#ifndef BLE_RANGES_H__ +#define BLE_RANGES_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define BLE_SVC_BASE 0x60 /**< Common BLE SVC base. */ +#define BLE_SVC_LAST 0x6B /**< Common BLE SVC last. */ + +#define BLE_GAP_SVC_BASE 0x6C /**< GAP BLE SVC base. */ +#define BLE_GAP_SVC_LAST 0x9A /**< GAP BLE SVC last. */ + +#define BLE_GATTC_SVC_BASE 0x9B /**< GATTC BLE SVC base. */ +#define BLE_GATTC_SVC_LAST 0xA7 /**< GATTC BLE SVC last. */ + +#define BLE_GATTS_SVC_BASE 0xA8 /**< GATTS BLE SVC base. */ +#define BLE_GATTS_SVC_LAST 0xB7 /**< GATTS BLE SVC last. */ + +#define BLE_L2CAP_SVC_BASE 0xB8 /**< L2CAP BLE SVC base. */ +#define BLE_L2CAP_SVC_LAST 0xBF /**< L2CAP BLE SVC last. */ + + +#define BLE_EVT_INVALID 0x00 /**< Invalid BLE Event. */ + +#define BLE_EVT_BASE 0x01 /**< Common BLE Event base. */ +#define BLE_EVT_LAST 0x0F /**< Common BLE Event last. */ + +#define BLE_GAP_EVT_BASE 0x10 /**< GAP BLE Event base. */ +#define BLE_GAP_EVT_LAST 0x2F /**< GAP BLE Event last. */ + +#define BLE_GATTC_EVT_BASE 0x30 /**< GATTC BLE Event base. */ +#define BLE_GATTC_EVT_LAST 0x4F /**< GATTC BLE Event last. */ + +#define BLE_GATTS_EVT_BASE 0x50 /**< GATTS BLE Event base. */ +#define BLE_GATTS_EVT_LAST 0x6F /**< GATTS BLE Event last. */ + +#define BLE_L2CAP_EVT_BASE 0x70 /**< L2CAP BLE Event base. */ +#define BLE_L2CAP_EVT_LAST 0x8F /**< L2CAP BLE Event last. */ + + +#define BLE_OPT_INVALID 0x00 /**< Invalid BLE Option. */ + +#define BLE_OPT_BASE 0x01 /**< Common BLE Option base. */ +#define BLE_OPT_LAST 0x1F /**< Common BLE Option last. */ + +#define BLE_GAP_OPT_BASE 0x20 /**< GAP BLE Option base. */ +#define BLE_GAP_OPT_LAST 0x3F /**< GAP BLE Option last. */ + +#define BLE_GATT_OPT_BASE 0x40 /**< GATT BLE Option base. */ +#define BLE_GATT_OPT_LAST 0x5F /**< GATT BLE Option last. */ + +#define BLE_GATTC_OPT_BASE 0x60 /**< GATTC BLE Option base. */ +#define BLE_GATTC_OPT_LAST 0x7F /**< GATTC BLE Option last. */ + +#define BLE_GATTS_OPT_BASE 0x80 /**< GATTS BLE Option base. */ +#define BLE_GATTS_OPT_LAST 0x9F /**< GATTS BLE Option last. */ + +#define BLE_L2CAP_OPT_BASE 0xA0 /**< L2CAP BLE Option base. */ +#define BLE_L2CAP_OPT_LAST 0xBF /**< L2CAP BLE Option last. */ + + +#define BLE_CFG_INVALID 0x00 /**< Invalid BLE configuration. */ + +#define BLE_CFG_BASE 0x01 /**< Common BLE configuration base. */ +#define BLE_CFG_LAST 0x1F /**< Common BLE configuration last. */ + +#define BLE_CONN_CFG_BASE 0x20 /**< BLE connection configuration base. */ +#define BLE_CONN_CFG_LAST 0x3F /**< BLE connection configuration last. */ + +#define BLE_GAP_CFG_BASE 0x40 /**< GAP BLE configuration base. */ +#define BLE_GAP_CFG_LAST 0x5F /**< GAP BLE configuration last. */ + +#define BLE_GATT_CFG_BASE 0x60 /**< GATT BLE configuration base. */ +#define BLE_GATT_CFG_LAST 0x7F /**< GATT BLE configuration last. */ + +#define BLE_GATTC_CFG_BASE 0x80 /**< GATTC BLE configuration base. */ +#define BLE_GATTC_CFG_LAST 0x9F /**< GATTC BLE configuration last. */ + +#define BLE_GATTS_CFG_BASE 0xA0 /**< GATTS BLE configuration base. */ +#define BLE_GATTS_CFG_LAST 0xBF /**< GATTS BLE configuration last. */ + +#define BLE_L2CAP_CFG_BASE 0xC0 /**< L2CAP BLE configuration base. */ +#define BLE_L2CAP_CFG_LAST 0xDF /**< L2CAP BLE configuration last. */ + + + + + +#ifdef __cplusplus +} +#endif +#endif /* BLE_RANGES_H__ */ + +/** + @} + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_types.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_types.h new file mode 100644 index 0000000000..88c93180c8 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_types.h @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_COMMON + @{ + @defgroup ble_types Common types and macro definitions + @{ + + @brief Common types and macro definitions for the BLE SoftDevice. + */ + +#ifndef BLE_TYPES_H__ +#define BLE_TYPES_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup BLE_TYPES_DEFINES Defines + * @{ */ + +/** @defgroup BLE_CONN_HANDLES BLE Connection Handles + * @{ */ +#define BLE_CONN_HANDLE_INVALID 0xFFFF /**< Invalid Connection Handle. */ +#define BLE_CONN_HANDLE_ALL 0xFFFE /**< Applies to all Connection Handles. */ +/** @} */ + + +/** @defgroup BLE_UUID_VALUES Assigned Values for BLE UUIDs + * @{ */ +/* Generic UUIDs, applicable to all services */ +#define BLE_UUID_UNKNOWN 0x0000 /**< Reserved UUID. */ +#define BLE_UUID_SERVICE_PRIMARY 0x2800 /**< Primary Service. */ +#define BLE_UUID_SERVICE_SECONDARY 0x2801 /**< Secondary Service. */ +#define BLE_UUID_SERVICE_INCLUDE 0x2802 /**< Include. */ +#define BLE_UUID_CHARACTERISTIC 0x2803 /**< Characteristic. */ +#define BLE_UUID_DESCRIPTOR_CHAR_EXT_PROP 0x2900 /**< Characteristic Extended Properties Descriptor. */ +#define BLE_UUID_DESCRIPTOR_CHAR_USER_DESC 0x2901 /**< Characteristic User Description Descriptor. */ +#define BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG 0x2902 /**< Client Characteristic Configuration Descriptor. */ +#define BLE_UUID_DESCRIPTOR_SERVER_CHAR_CONFIG 0x2903 /**< Server Characteristic Configuration Descriptor. */ +#define BLE_UUID_DESCRIPTOR_CHAR_PRESENTATION_FORMAT 0x2904 /**< Characteristic Presentation Format Descriptor. */ +#define BLE_UUID_DESCRIPTOR_CHAR_AGGREGATE_FORMAT 0x2905 /**< Characteristic Aggregate Format Descriptor. */ +/* GATT specific UUIDs */ +#define BLE_UUID_GATT 0x1801 /**< Generic Attribute Profile. */ +#define BLE_UUID_GATT_CHARACTERISTIC_SERVICE_CHANGED 0x2A05 /**< Service Changed Characteristic. */ +/* GAP specific UUIDs */ +#define BLE_UUID_GAP 0x1800 /**< Generic Access Profile. */ +#define BLE_UUID_GAP_CHARACTERISTIC_DEVICE_NAME 0x2A00 /**< Device Name Characteristic. */ +#define BLE_UUID_GAP_CHARACTERISTIC_APPEARANCE 0x2A01 /**< Appearance Characteristic. */ +#define BLE_UUID_GAP_CHARACTERISTIC_RECONN_ADDR 0x2A03 /**< Reconnection Address Characteristic. */ +#define BLE_UUID_GAP_CHARACTERISTIC_PPCP 0x2A04 /**< Peripheral Preferred Connection Parameters Characteristic. */ +#define BLE_UUID_GAP_CHARACTERISTIC_CAR 0x2AA6 /**< Central Address Resolution Characteristic. */ +#define BLE_UUID_GAP_CHARACTERISTIC_RPA_ONLY 0x2AC9 /**< Resolvable Private Address Only Characteristic. */ +/** @} */ + + +/** @defgroup BLE_UUID_TYPES Types of UUID + * @{ */ +#define BLE_UUID_TYPE_UNKNOWN 0x00 /**< Invalid UUID type. */ +#define BLE_UUID_TYPE_BLE 0x01 /**< Bluetooth SIG UUID (16-bit). */ +#define BLE_UUID_TYPE_VENDOR_BEGIN 0x02 /**< Vendor UUID types start at this index (128-bit). */ +/** @} */ + + +/** @defgroup BLE_APPEARANCES Bluetooth Appearance values + * @note Retrieved from http://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml + * @{ */ +#define BLE_APPEARANCE_UNKNOWN 0 /**< Unknown. */ +#define BLE_APPEARANCE_GENERIC_PHONE 64 /**< Generic Phone. */ +#define BLE_APPEARANCE_GENERIC_COMPUTER 128 /**< Generic Computer. */ +#define BLE_APPEARANCE_GENERIC_WATCH 192 /**< Generic Watch. */ +#define BLE_APPEARANCE_WATCH_SPORTS_WATCH 193 /**< Watch: Sports Watch. */ +#define BLE_APPEARANCE_GENERIC_CLOCK 256 /**< Generic Clock. */ +#define BLE_APPEARANCE_GENERIC_DISPLAY 320 /**< Generic Display. */ +#define BLE_APPEARANCE_GENERIC_REMOTE_CONTROL 384 /**< Generic Remote Control. */ +#define BLE_APPEARANCE_GENERIC_EYE_GLASSES 448 /**< Generic Eye-glasses. */ +#define BLE_APPEARANCE_GENERIC_TAG 512 /**< Generic Tag. */ +#define BLE_APPEARANCE_GENERIC_KEYRING 576 /**< Generic Keyring. */ +#define BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 640 /**< Generic Media Player. */ +#define BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 704 /**< Generic Barcode Scanner. */ +#define BLE_APPEARANCE_GENERIC_THERMOMETER 768 /**< Generic Thermometer. */ +#define BLE_APPEARANCE_THERMOMETER_EAR 769 /**< Thermometer: Ear. */ +#define BLE_APPEARANCE_GENERIC_HEART_RATE_SENSOR 832 /**< Generic Heart rate Sensor. */ +#define BLE_APPEARANCE_HEART_RATE_SENSOR_HEART_RATE_BELT 833 /**< Heart Rate Sensor: Heart Rate Belt. */ +#define BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 896 /**< Generic Blood Pressure. */ +#define BLE_APPEARANCE_BLOOD_PRESSURE_ARM 897 /**< Blood Pressure: Arm. */ +#define BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 898 /**< Blood Pressure: Wrist. */ +#define BLE_APPEARANCE_GENERIC_HID 960 /**< Human Interface Device (HID). */ +#define BLE_APPEARANCE_HID_KEYBOARD 961 /**< Keyboard (HID Subtype). */ +#define BLE_APPEARANCE_HID_MOUSE 962 /**< Mouse (HID Subtype). */ +#define BLE_APPEARANCE_HID_JOYSTICK 963 /**< Joystick (HID Subtype). */ +#define BLE_APPEARANCE_HID_GAMEPAD 964 /**< Gamepad (HID Subtype). */ +#define BLE_APPEARANCE_HID_DIGITIZERSUBTYPE 965 /**< Digitizer Tablet (HID Subtype). */ +#define BLE_APPEARANCE_HID_CARD_READER 966 /**< Card Reader (HID Subtype). */ +#define BLE_APPEARANCE_HID_DIGITAL_PEN 967 /**< Digital Pen (HID Subtype). */ +#define BLE_APPEARANCE_HID_BARCODE 968 /**< Barcode Scanner (HID Subtype). */ +#define BLE_APPEARANCE_GENERIC_GLUCOSE_METER 1024 /**< Generic Glucose Meter. */ +#define BLE_APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR 1088 /**< Generic Running Walking Sensor. */ +#define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE 1089 /**< Running Walking Sensor: In-Shoe. */ +#define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE 1090 /**< Running Walking Sensor: On-Shoe. */ +#define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP 1091 /**< Running Walking Sensor: On-Hip. */ +#define BLE_APPEARANCE_GENERIC_CYCLING 1152 /**< Generic Cycling. */ +#define BLE_APPEARANCE_CYCLING_CYCLING_COMPUTER 1153 /**< Cycling: Cycling Computer. */ +#define BLE_APPEARANCE_CYCLING_SPEED_SENSOR 1154 /**< Cycling: Speed Sensor. */ +#define BLE_APPEARANCE_CYCLING_CADENCE_SENSOR 1155 /**< Cycling: Cadence Sensor. */ +#define BLE_APPEARANCE_CYCLING_POWER_SENSOR 1156 /**< Cycling: Power Sensor. */ +#define BLE_APPEARANCE_CYCLING_SPEED_CADENCE_SENSOR 1157 /**< Cycling: Speed and Cadence Sensor. */ +#define BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 3136 /**< Generic Pulse Oximeter. */ +#define BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 3137 /**< Fingertip (Pulse Oximeter subtype). */ +#define BLE_APPEARANCE_PULSE_OXIMETER_WRIST_WORN 3138 /**< Wrist Worn(Pulse Oximeter subtype). */ +#define BLE_APPEARANCE_GENERIC_WEIGHT_SCALE 3200 /**< Generic Weight Scale. */ +#define BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS_ACT 5184 /**< Generic Outdoor Sports Activity. */ +#define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_DISP 5185 /**< Location Display Device (Outdoor Sports Activity subtype). */ +#define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_DISP 5186 /**< Location and Navigation Display Device (Outdoor Sports Activity subtype). */ +#define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_POD 5187 /**< Location Pod (Outdoor Sports Activity subtype). */ +#define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_POD 5188 /**< Location and Navigation Pod (Outdoor Sports Activity subtype). */ +/** @} */ + +/** @brief Set .type and .uuid fields of ble_uuid_struct to specified UUID value. */ +#define BLE_UUID_BLE_ASSIGN(instance, value) do {\ + instance.type = BLE_UUID_TYPE_BLE; \ + instance.uuid = value;} while(0) + +/** @brief Copy type and uuid members from src to dst ble_uuid_t pointer. Both pointers must be valid/non-null. */ +#define BLE_UUID_COPY_PTR(dst, src) do {\ + (dst)->type = (src)->type; \ + (dst)->uuid = (src)->uuid;} while(0) + +/** @brief Copy type and uuid members from src to dst ble_uuid_t struct. */ +#define BLE_UUID_COPY_INST(dst, src) do {\ + (dst).type = (src).type; \ + (dst).uuid = (src).uuid;} while(0) + +/** @brief Compare for equality both type and uuid members of two (valid, non-null) ble_uuid_t pointers. */ +#define BLE_UUID_EQ(p_uuid1, p_uuid2) \ + (((p_uuid1)->type == (p_uuid2)->type) && ((p_uuid1)->uuid == (p_uuid2)->uuid)) + +/** @brief Compare for difference both type and uuid members of two (valid, non-null) ble_uuid_t pointers. */ +#define BLE_UUID_NEQ(p_uuid1, p_uuid2) \ + (((p_uuid1)->type != (p_uuid2)->type) || ((p_uuid1)->uuid != (p_uuid2)->uuid)) + +/** @} */ + +/** @addtogroup BLE_TYPES_STRUCTURES Structures + * @{ */ + +/** @brief 128 bit UUID values. */ +typedef struct +{ + uint8_t uuid128[16]; /**< Little-Endian UUID bytes. */ +} ble_uuid128_t; + +/** @brief Bluetooth Low Energy UUID type, encapsulates both 16-bit and 128-bit UUIDs. */ +typedef struct +{ + uint16_t uuid; /**< 16-bit UUID value or octets 12-13 of 128-bit UUID. */ + uint8_t type; /**< UUID type, see @ref BLE_UUID_TYPES. If type is @ref BLE_UUID_TYPE_UNKNOWN, the value of uuid is undefined. */ +} ble_uuid_t; + +/**@brief Data structure. */ +typedef struct +{ + uint8_t *p_data; /**< Pointer to the data buffer provided to/from the application. */ + uint16_t len; /**< Length of the data buffer, in bytes. */ +} ble_data_t; + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* BLE_TYPES_H__ */ + +/** + @} + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf52/nrf_mbr.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf52/nrf_mbr.h new file mode 100644 index 0000000000..42e09fc87c --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf52/nrf_mbr.h @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2014 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @defgroup nrf_mbr_api Master Boot Record API + @{ + + @brief APIs for updating SoftDevice and BootLoader + +*/ + +#ifndef NRF_MBR_H__ +#define NRF_MBR_H__ + +#include "nrf_svc.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup NRF_MBR_DEFINES Defines + * @{ */ + +/**@brief MBR SVC Base number. */ +#define MBR_SVC_BASE (0x18) + +/**@brief Page size in words. */ +#define MBR_PAGE_SIZE_IN_WORDS (1024) + +/** @brief The size that must be reserved for the MBR when a SoftDevice is written to flash. +This is the offset where the first byte of the SoftDevice hex file is written. */ +#define MBR_SIZE (0x1000) + +/** @brief Location (in the flash memory) of the bootloader address. */ +#define MBR_BOOTLOADER_ADDR (0xFF8) + +/** @brief Location (in UICR) of the bootloader address. */ +#define MBR_UICR_BOOTLOADER_ADDR (&(NRF_UICR->NRFFW[0])) + +/** @brief Location (in the flash memory) of the address of the MBR parameter page. */ +#define MBR_PARAM_PAGE_ADDR (0xFFC) + +/** @brief Location (in UICR) of the address of the MBR parameter page. */ +#define MBR_UICR_PARAM_PAGE_ADDR (&(NRF_UICR->NRFFW[1])) + + +/** @} */ + +/** @addtogroup NRF_MBR_ENUMS Enumerations + * @{ */ + +/**@brief nRF Master Boot Record API SVC numbers. */ +enum NRF_MBR_SVCS +{ + SD_MBR_COMMAND = MBR_SVC_BASE, /**< ::sd_mbr_command */ +}; + +/**@brief Possible values for ::sd_mbr_command_t.command */ +enum NRF_MBR_COMMANDS +{ + SD_MBR_COMMAND_COPY_BL, /**< Copy a new BootLoader. @see ::sd_mbr_command_copy_bl_t*/ + SD_MBR_COMMAND_COPY_SD, /**< Copy a new SoftDevice. @see ::sd_mbr_command_copy_sd_t*/ + SD_MBR_COMMAND_INIT_SD, /**< Initialize forwarding interrupts to SD, and run reset function in SD. Does not require any parameters in ::sd_mbr_command_t params.*/ + SD_MBR_COMMAND_COMPARE, /**< This command works like memcmp. @see ::sd_mbr_command_compare_t*/ + SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET, /**< Change the address the MBR starts after a reset. @see ::sd_mbr_command_vector_table_base_set_t*/ + SD_MBR_COMMAND_RESERVED, + SD_MBR_COMMAND_IRQ_FORWARD_ADDRESS_SET, /**< Start forwarding all interrupts to this address. @see ::sd_mbr_command_irq_forward_address_set_t*/ +}; + +/** @} */ + +/** @addtogroup NRF_MBR_TYPES Types + * @{ */ + +/**@brief This command copies part of a new SoftDevice + * + * The destination area is erased before copying. + * If dst is in the middle of a flash page, that whole flash page will be erased. + * If (dst+len) is in the middle of a flash page, that whole flash page will be erased. + * + * The user of this function is responsible for setting the BPROT registers. + * + * @retval ::NRF_SUCCESS indicates that the contents of the memory blocks where copied correctly. + * @retval ::NRF_ERROR_INTERNAL indicates that the contents of the memory blocks where not verified correctly after copying. + */ +typedef struct +{ + uint32_t *src; /**< Pointer to the source of data to be copied.*/ + uint32_t *dst; /**< Pointer to the destination where the content is to be copied.*/ + uint32_t len; /**< Number of 32 bit words to copy. Must be a multiple of @ref MBR_PAGE_SIZE_IN_WORDS words.*/ +} sd_mbr_command_copy_sd_t; + + +/**@brief This command works like memcmp, but takes the length in words. + * + * @retval ::NRF_SUCCESS indicates that the contents of both memory blocks are equal. + * @retval ::NRF_ERROR_NULL indicates that the contents of the memory blocks are not equal. + */ +typedef struct +{ + uint32_t *ptr1; /**< Pointer to block of memory. */ + uint32_t *ptr2; /**< Pointer to block of memory. */ + uint32_t len; /**< Number of 32 bit words to compare.*/ +} sd_mbr_command_compare_t; + + +/**@brief This command copies a new BootLoader. + * + * The MBR assumes that either @ref MBR_BOOTLOADER_ADDR or @ref MBR_UICR_BOOTLOADER_ADDR is set to + * the address where the bootloader will be copied. If both addresses are set, the MBR will prioritize + * @ref MBR_BOOTLOADER_ADDR. + * + * The bootloader destination is erased by this function. + * If (destination+bl_len) is in the middle of a flash page, that whole flash page will be erased. + * + * This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set, + * see @ref sd_mbr_command. + * + * This command will use the flash protect peripheral (BPROT or ACL) to protect the flash that is + * not intended to be written. + * + * On success, this function will not return. It will start the new bootloader from reset-vector as normal. + * + * @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen. + * @retval ::NRF_ERROR_FORBIDDEN if the bootloader address is not set. + * @retval ::NRF_ERROR_INVALID_LENGTH if parameters attempts to read or write outside flash area. + * @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command. + */ +typedef struct +{ + uint32_t *bl_src; /**< Pointer to the source of the bootloader to be be copied.*/ + uint32_t bl_len; /**< Number of 32 bit words to copy for BootLoader. */ +} sd_mbr_command_copy_bl_t; + +/**@brief Change the address the MBR starts after a reset + * + * Once this function has been called, this address is where the MBR will start to forward + * interrupts to after a reset. + * + * To restore default forwarding, this function should be called with @ref address set to 0. If a + * bootloader is present, interrupts will be forwarded to the bootloader. If not, interrupts will + * be forwarded to the SoftDevice. + * + * The location of a bootloader can be specified in @ref MBR_BOOTLOADER_ADDR or + * @ref MBR_UICR_BOOTLOADER_ADDR. If both addresses are set, the MBR will prioritize + * @ref MBR_BOOTLOADER_ADDR. + * + * This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set, + * see @ref sd_mbr_command. + * + * On success, this function will not return. It will reset the device. + * + * @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen. + * @retval ::NRF_ERROR_INVALID_ADDR if parameter address is outside of the flash size. + * @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command. + */ +typedef struct +{ + uint32_t address; /**< The base address of the interrupt vector table for forwarded interrupts.*/ +} sd_mbr_command_vector_table_base_set_t; + +/**@brief Sets the base address of the interrupt vector table for interrupts forwarded from the MBR + * + * Unlike sd_mbr_command_vector_table_base_set_t, this function does not reset, and it does not + * change where the MBR starts after reset. + * + * @retval ::NRF_SUCCESS + */ +typedef struct +{ + uint32_t address; /**< The base address of the interrupt vector table for forwarded interrupts.*/ +} sd_mbr_command_irq_forward_address_set_t; + +/**@brief Input structure containing data used when calling ::sd_mbr_command + * + * Depending on what command value that is set, the corresponding params value type must also be + * set. See @ref NRF_MBR_COMMANDS for command types and corresponding params value type. If command + * @ref SD_MBR_COMMAND_INIT_SD is set, it is not necessary to set any values under params. + */ +typedef struct +{ + uint32_t command; /**< Type of command to be issued. See @ref NRF_MBR_COMMANDS. */ + union + { + sd_mbr_command_copy_sd_t copy_sd; /**< Parameters for copy SoftDevice.*/ + sd_mbr_command_compare_t compare; /**< Parameters for verify.*/ + sd_mbr_command_copy_bl_t copy_bl; /**< Parameters for copy BootLoader. Requires parameter page. */ + sd_mbr_command_vector_table_base_set_t base_set; /**< Parameters for vector table base set. Requires parameter page.*/ + sd_mbr_command_irq_forward_address_set_t irq_forward_address_set; /**< Parameters for irq forward address set*/ + } params; /**< Command parameters. */ +} sd_mbr_command_t; + +/** @} */ + +/** @addtogroup NRF_MBR_FUNCTIONS Functions + * @{ */ + +/**@brief Issue Master Boot Record commands + * + * Commands used when updating a SoftDevice and bootloader. + * + * The @ref SD_MBR_COMMAND_COPY_BL and @ref SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET requires + * parameters to be retained by the MBR when resetting the IC. This is done in a separate flash + * page. The location of the flash page should be provided by the application in either + * @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR. If both addresses are set, the MBR + * will prioritize @ref MBR_PARAM_PAGE_ADDR. This page will be cleared by the MBR and is used to + * store the command before reset. When an address is specified, the page it refers to must not be + * used by the application. If no address is provided by the application, i.e. both + * @ref MBR_PARAM_PAGE_ADDR and @ref MBR_UICR_PARAM_PAGE_ADDR is 0xFFFFFFFF, MBR commands which use + * flash will be unavailable and return @ref NRF_ERROR_NO_MEM. + * + * @param[in] param Pointer to a struct describing the command. + * + * @note For a complete set of return values, see ::sd_mbr_command_copy_sd_t, + * ::sd_mbr_command_copy_bl_t, ::sd_mbr_command_compare_t, + * ::sd_mbr_command_vector_table_base_set_t, ::sd_mbr_command_irq_forward_address_set_t + * + * @retval ::NRF_ERROR_NO_MEM No MBR parameter page provided + * @retval ::NRF_ERROR_INVALID_PARAM if an invalid command is given. +*/ +SVCALL(SD_MBR_COMMAND, uint32_t, sd_mbr_command(sd_mbr_command_t* param)); + +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif // NRF_MBR_H__ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error.h new file mode 100644 index 0000000000..6badee98e5 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2014 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + /** + @defgroup nrf_error SoftDevice Global Error Codes + @{ + + @brief Global Error definitions +*/ + +/* Header guard */ +#ifndef NRF_ERROR_H__ +#define NRF_ERROR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @defgroup NRF_ERRORS_BASE Error Codes Base number definitions + * @{ */ +#define NRF_ERROR_BASE_NUM (0x0) ///< Global error base +#define NRF_ERROR_SDM_BASE_NUM (0x1000) ///< SDM error base +#define NRF_ERROR_SOC_BASE_NUM (0x2000) ///< SoC error base +#define NRF_ERROR_STK_BASE_NUM (0x3000) ///< STK error base +/** @} */ + +#define NRF_SUCCESS (NRF_ERROR_BASE_NUM + 0) ///< Successful command +#define NRF_ERROR_SVC_HANDLER_MISSING (NRF_ERROR_BASE_NUM + 1) ///< SVC handler is missing +#define NRF_ERROR_SOFTDEVICE_NOT_ENABLED (NRF_ERROR_BASE_NUM + 2) ///< SoftDevice has not been enabled +#define NRF_ERROR_INTERNAL (NRF_ERROR_BASE_NUM + 3) ///< Internal Error +#define NRF_ERROR_NO_MEM (NRF_ERROR_BASE_NUM + 4) ///< No Memory for operation +#define NRF_ERROR_NOT_FOUND (NRF_ERROR_BASE_NUM + 5) ///< Not found +#define NRF_ERROR_NOT_SUPPORTED (NRF_ERROR_BASE_NUM + 6) ///< Not supported +#define NRF_ERROR_INVALID_PARAM (NRF_ERROR_BASE_NUM + 7) ///< Invalid Parameter +#define NRF_ERROR_INVALID_STATE (NRF_ERROR_BASE_NUM + 8) ///< Invalid state, operation disallowed in this state +#define NRF_ERROR_INVALID_LENGTH (NRF_ERROR_BASE_NUM + 9) ///< Invalid Length +#define NRF_ERROR_INVALID_FLAGS (NRF_ERROR_BASE_NUM + 10) ///< Invalid Flags +#define NRF_ERROR_INVALID_DATA (NRF_ERROR_BASE_NUM + 11) ///< Invalid Data +#define NRF_ERROR_DATA_SIZE (NRF_ERROR_BASE_NUM + 12) ///< Invalid Data size +#define NRF_ERROR_TIMEOUT (NRF_ERROR_BASE_NUM + 13) ///< Operation timed out +#define NRF_ERROR_NULL (NRF_ERROR_BASE_NUM + 14) ///< Null Pointer +#define NRF_ERROR_FORBIDDEN (NRF_ERROR_BASE_NUM + 15) ///< Forbidden Operation +#define NRF_ERROR_INVALID_ADDR (NRF_ERROR_BASE_NUM + 16) ///< Bad Memory Address +#define NRF_ERROR_BUSY (NRF_ERROR_BASE_NUM + 17) ///< Busy +#define NRF_ERROR_CONN_COUNT (NRF_ERROR_BASE_NUM + 18) ///< Maximum connection count exceeded. +#define NRF_ERROR_RESOURCES (NRF_ERROR_BASE_NUM + 19) ///< Not enough resources for operation + +#ifdef __cplusplus +} +#endif +#endif // NRF_ERROR_H__ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_sdm.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_sdm.h new file mode 100644 index 0000000000..530959b9d6 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_sdm.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + /** + @addtogroup nrf_sdm_api + @{ + @defgroup nrf_sdm_error SoftDevice Manager Error Codes + @{ + + @brief Error definitions for the SDM API +*/ + +/* Header guard */ +#ifndef NRF_ERROR_SDM_H__ +#define NRF_ERROR_SDM_H__ + +#include "nrf_error.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN (NRF_ERROR_SDM_BASE_NUM + 0) ///< Unknown LFCLK source. +#define NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION (NRF_ERROR_SDM_BASE_NUM + 1) ///< Incorrect interrupt configuration (can be caused by using illegal priority levels, or having enabled SoftDevice interrupts). +#define NRF_ERROR_SDM_INCORRECT_CLENR0 (NRF_ERROR_SDM_BASE_NUM + 2) ///< Incorrect CLENR0 (can be caused by erroneous SoftDevice flashing). + +#ifdef __cplusplus +} +#endif +#endif // NRF_ERROR_SDM_H__ + +/** + @} + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_soc.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_soc.h new file mode 100644 index 0000000000..1e784b8db3 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_soc.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup nrf_soc_api + @{ + @defgroup nrf_soc_error SoC Library Error Codes + @{ + + @brief Error definitions for the SoC library + +*/ + +/* Header guard */ +#ifndef NRF_ERROR_SOC_H__ +#define NRF_ERROR_SOC_H__ + +#include "nrf_error.h" +#ifdef __cplusplus +extern "C" { +#endif + +/* Mutex Errors */ +#define NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN (NRF_ERROR_SOC_BASE_NUM + 0) ///< Mutex already taken + +/* NVIC errors */ +#define NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE (NRF_ERROR_SOC_BASE_NUM + 1) ///< NVIC interrupt not available +#define NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED (NRF_ERROR_SOC_BASE_NUM + 2) ///< NVIC interrupt priority not allowed +#define NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN (NRF_ERROR_SOC_BASE_NUM + 3) ///< NVIC should not return + +/* Power errors */ +#define NRF_ERROR_SOC_POWER_MODE_UNKNOWN (NRF_ERROR_SOC_BASE_NUM + 4) ///< Power mode unknown +#define NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN (NRF_ERROR_SOC_BASE_NUM + 5) ///< Power POF threshold unknown +#define NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN (NRF_ERROR_SOC_BASE_NUM + 6) ///< Power off should not return + +/* Rand errors */ +#define NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES (NRF_ERROR_SOC_BASE_NUM + 7) ///< RAND not enough values + +/* PPI errors */ +#define NRF_ERROR_SOC_PPI_INVALID_CHANNEL (NRF_ERROR_SOC_BASE_NUM + 8) ///< Invalid PPI Channel +#define NRF_ERROR_SOC_PPI_INVALID_GROUP (NRF_ERROR_SOC_BASE_NUM + 9) ///< Invalid PPI Group + +#ifdef __cplusplus +} +#endif +#endif // NRF_ERROR_SOC_H__ +/** + @} + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_nvic.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_nvic.h new file mode 100644 index 0000000000..1f79cc3c8c --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_nvic.h @@ -0,0 +1,491 @@ +/* + * Copyright (c) 2016 - 2018, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @defgroup nrf_nvic_api SoftDevice NVIC API + * @{ + * + * @note In order to use this module, the following code has to be added to a .c file: + * \code + * nrf_nvic_state_t nrf_nvic_state = {0}; + * \endcode + * + * @note Definitions and declarations starting with __ (double underscore) in this header file are + * not intended for direct use by the application. + * + * @brief APIs for the accessing NVIC when using a SoftDevice. + * + */ + +#ifndef NRF_NVIC_H__ +#define NRF_NVIC_H__ + +#include +#include "nrf.h" +#include "nrf_svc.h" +#include "nrf_error.h" +#include "nrf_error_soc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/**@addtogroup NRF_NVIC_DEFINES Defines + * @{ */ + +/**@defgroup NRF_NVIC_ISER_DEFINES SoftDevice NVIC internal definitions + * @{ */ + +#define __NRF_NVIC_NVMC_IRQn (30) /**< The peripheral ID of the NVMC. IRQ numbers are used to identify peripherals, but the NVMC doesn't have an IRQ number in the MDK. */ + +#define __NRF_NVIC_ISER_COUNT (2) /**< The number of ISER/ICER registers in the NVIC that are used. */ + +/**@brief Interrupt priority levels used by the SoftDevice. */ +#define __NRF_NVIC_SD_IRQ_PRIOS ((uint8_t)( \ + (1U << 0) /**< Priority level high .*/ \ + | (1U << 1) /**< Priority level medium. */ \ + | (1U << 4) /**< Priority level low. */ \ + )) + +/**@brief Interrupt priority levels available to the application. */ +#define __NRF_NVIC_APP_IRQ_PRIOS ((uint8_t)~__NRF_NVIC_SD_IRQ_PRIOS) + +/**@brief Interrupts used by the SoftDevice, with IRQn in the range 0-31. */ +#define __NRF_NVIC_SD_IRQS_0 ((uint32_t)( \ + (1U << POWER_CLOCK_IRQn) \ + | (1U << RADIO_IRQn) \ + | (1U << RTC0_IRQn) \ + | (1U << TIMER0_IRQn) \ + | (1U << RNG_IRQn) \ + | (1U << ECB_IRQn) \ + | (1U << CCM_AAR_IRQn) \ + | (1U << TEMP_IRQn) \ + | (1U << __NRF_NVIC_NVMC_IRQn) \ + | (1U << (uint32_t)SWI5_IRQn) \ + )) + +/**@brief Interrupts used by the SoftDevice, with IRQn in the range 32-63. */ +#define __NRF_NVIC_SD_IRQS_1 ((uint32_t)0) + +/**@brief Interrupts available for to application, with IRQn in the range 0-31. */ +#define __NRF_NVIC_APP_IRQS_0 (~__NRF_NVIC_SD_IRQS_0) + +/**@brief Interrupts available for to application, with IRQn in the range 32-63. */ +#define __NRF_NVIC_APP_IRQS_1 (~__NRF_NVIC_SD_IRQS_1) + +/**@} */ + +/**@} */ + +/**@addtogroup NRF_NVIC_VARIABLES Variables + * @{ */ + +/**@brief Type representing the state struct for the SoftDevice NVIC module. */ +typedef struct +{ + uint32_t volatile __irq_masks[__NRF_NVIC_ISER_COUNT]; /**< IRQs enabled by the application in the NVIC. */ + uint32_t volatile __cr_flag; /**< Non-zero if already in a critical region */ +} nrf_nvic_state_t; + +/**@brief Variable keeping the state for the SoftDevice NVIC module. This must be declared in an + * application source file. */ +extern nrf_nvic_state_t nrf_nvic_state; + +/**@} */ + +/**@addtogroup NRF_NVIC_INTERNAL_FUNCTIONS SoftDevice NVIC internal functions + * @{ */ + +/**@brief Disables IRQ interrupts globally, including the SoftDevice's interrupts. + * + * @retval The value of PRIMASK prior to disabling the interrupts. + */ +__STATIC_INLINE int __sd_nvic_irq_disable(void); + +/**@brief Enables IRQ interrupts globally, including the SoftDevice's interrupts. + */ +__STATIC_INLINE void __sd_nvic_irq_enable(void); + +/**@brief Checks if IRQn is available to application + * @param[in] IRQn IRQ to check + * + * @retval 1 (true) if the IRQ to check is available to the application + */ +__STATIC_INLINE uint32_t __sd_nvic_app_accessible_irq(IRQn_Type IRQn); + +/**@brief Checks if priority is available to application + * @param[in] priority priority to check + * + * @retval 1 (true) if the priority to check is available to the application + */ +__STATIC_INLINE uint32_t __sd_nvic_is_app_accessible_priority(uint32_t priority); + +/**@} */ + +/**@addtogroup NRF_NVIC_FUNCTIONS SoftDevice NVIC public functions + * @{ */ + +/**@brief Enable External Interrupt. + * @note Corresponds to NVIC_EnableIRQ in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_EnableIRQ documentation in CMSIS. + * + * @retval ::NRF_SUCCESS The interrupt was enabled. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE The interrupt is not available for the application. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED The interrupt has a priority not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_EnableIRQ(IRQn_Type IRQn); + +/**@brief Disable External Interrupt. + * @note Corresponds to NVIC_DisableIRQ in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_DisableIRQ documentation in CMSIS. + * + * @retval ::NRF_SUCCESS The interrupt was disabled. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE The interrupt is not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_DisableIRQ(IRQn_Type IRQn); + +/**@brief Get Pending Interrupt. + * @note Corresponds to NVIC_GetPendingIRQ in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_GetPendingIRQ documentation in CMSIS. + * @param[out] p_pending_irq Return value from NVIC_GetPendingIRQ. + * + * @retval ::NRF_SUCCESS The interrupt is available for the application. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_GetPendingIRQ(IRQn_Type IRQn, uint32_t * p_pending_irq); + +/**@brief Set Pending Interrupt. + * @note Corresponds to NVIC_SetPendingIRQ in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_SetPendingIRQ documentation in CMSIS. + * + * @retval ::NRF_SUCCESS The interrupt is set pending. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_SetPendingIRQ(IRQn_Type IRQn); + +/**@brief Clear Pending Interrupt. + * @note Corresponds to NVIC_ClearPendingIRQ in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_ClearPendingIRQ documentation in CMSIS. + * + * @retval ::NRF_SUCCESS The interrupt pending flag is cleared. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_ClearPendingIRQ(IRQn_Type IRQn); + +/**@brief Set Interrupt Priority. + * @note Corresponds to NVIC_SetPriority in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * @pre Priority is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_SetPriority documentation in CMSIS. + * @param[in] priority A valid IRQ priority for use by the application. + * + * @retval ::NRF_SUCCESS The interrupt and priority level is available for the application. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED The interrupt priority is not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_SetPriority(IRQn_Type IRQn, uint32_t priority); + +/**@brief Get Interrupt Priority. + * @note Corresponds to NVIC_GetPriority in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_GetPriority documentation in CMSIS. + * @param[out] p_priority Return value from NVIC_GetPriority. + * + * @retval ::NRF_SUCCESS The interrupt priority is returned in p_priority. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE - IRQn is not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_GetPriority(IRQn_Type IRQn, uint32_t * p_priority); + +/**@brief System Reset. + * @note Corresponds to NVIC_SystemReset in CMSIS. + * + * @retval ::NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN + */ +__STATIC_INLINE uint32_t sd_nvic_SystemReset(void); + +/**@brief Enter critical region. + * + * @post Application interrupts will be disabled. + * @note sd_nvic_critical_region_enter() and ::sd_nvic_critical_region_exit() must be called in matching pairs inside each + * execution context + * @sa sd_nvic_critical_region_exit + * + * @param[out] p_is_nested_critical_region If 1, the application is now in a nested critical region. + * + * @retval ::NRF_SUCCESS + */ +__STATIC_INLINE uint32_t sd_nvic_critical_region_enter(uint8_t * p_is_nested_critical_region); + +/**@brief Exit critical region. + * + * @pre Application has entered a critical region using ::sd_nvic_critical_region_enter. + * @post If not in a nested critical region, the application interrupts will restored to the state before ::sd_nvic_critical_region_enter was called. + * + * @param[in] is_nested_critical_region If this is set to 1, the critical region won't be exited. @sa sd_nvic_critical_region_enter. + * + * @retval ::NRF_SUCCESS + */ +__STATIC_INLINE uint32_t sd_nvic_critical_region_exit(uint8_t is_nested_critical_region); + +/**@} */ + +#ifndef SUPPRESS_INLINE_IMPLEMENTATION + +__STATIC_INLINE int __sd_nvic_irq_disable(void) +{ + int pm = __get_PRIMASK(); + __disable_irq(); + return pm; +} + +__STATIC_INLINE void __sd_nvic_irq_enable(void) +{ + __enable_irq(); +} + +__STATIC_INLINE uint32_t __sd_nvic_app_accessible_irq(IRQn_Type IRQn) +{ + if (IRQn < 32) + { + return ((1UL<= (1 << __NVIC_PRIO_BITS)) + || (((1 << priority) & __NRF_NVIC_APP_IRQ_PRIOS) == 0) + ) + { + return 0; + } + return 1; +} + + +__STATIC_INLINE uint32_t sd_nvic_EnableIRQ(IRQn_Type IRQn) +{ + if (!__sd_nvic_app_accessible_irq(IRQn)) + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } + if (!__sd_nvic_is_app_accessible_priority(NVIC_GetPriority(IRQn))) + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED; + } + + if (nrf_nvic_state.__cr_flag) + { + nrf_nvic_state.__irq_masks[(uint32_t)((int32_t)IRQn) >> 5] |= (uint32_t)(1 << ((uint32_t)((int32_t)IRQn) & (uint32_t)0x1F)); + } + else + { + NVIC_EnableIRQ(IRQn); + } + return NRF_SUCCESS; +} + +__STATIC_INLINE uint32_t sd_nvic_DisableIRQ(IRQn_Type IRQn) +{ + if (!__sd_nvic_app_accessible_irq(IRQn)) + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } + + if (nrf_nvic_state.__cr_flag) + { + nrf_nvic_state.__irq_masks[(uint32_t)((int32_t)IRQn) >> 5] &= ~(1UL << ((uint32_t)(IRQn) & 0x1F)); + } + else + { + NVIC_DisableIRQ(IRQn); + } + + return NRF_SUCCESS; +} + +__STATIC_INLINE uint32_t sd_nvic_GetPendingIRQ(IRQn_Type IRQn, uint32_t * p_pending_irq) +{ + if (__sd_nvic_app_accessible_irq(IRQn)) + { + *p_pending_irq = NVIC_GetPendingIRQ(IRQn); + return NRF_SUCCESS; + } + else + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } +} + +__STATIC_INLINE uint32_t sd_nvic_SetPendingIRQ(IRQn_Type IRQn) +{ + if (__sd_nvic_app_accessible_irq(IRQn)) + { + NVIC_SetPendingIRQ(IRQn); + return NRF_SUCCESS; + } + else + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } +} + +__STATIC_INLINE uint32_t sd_nvic_ClearPendingIRQ(IRQn_Type IRQn) +{ + if (__sd_nvic_app_accessible_irq(IRQn)) + { + NVIC_ClearPendingIRQ(IRQn); + return NRF_SUCCESS; + } + else + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } +} + +__STATIC_INLINE uint32_t sd_nvic_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if (!__sd_nvic_app_accessible_irq(IRQn)) + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } + + if (!__sd_nvic_is_app_accessible_priority(priority)) + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED; + } + + NVIC_SetPriority(IRQn, (uint32_t)priority); + return NRF_SUCCESS; +} + +__STATIC_INLINE uint32_t sd_nvic_GetPriority(IRQn_Type IRQn, uint32_t * p_priority) +{ + if (__sd_nvic_app_accessible_irq(IRQn)) + { + *p_priority = (NVIC_GetPriority(IRQn) & 0xFF); + return NRF_SUCCESS; + } + else + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } +} + +__STATIC_INLINE uint32_t sd_nvic_SystemReset(void) +{ + NVIC_SystemReset(); + return NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN; +} + +__STATIC_INLINE uint32_t sd_nvic_critical_region_enter(uint8_t * p_is_nested_critical_region) +{ + int was_masked = __sd_nvic_irq_disable(); + if (!nrf_nvic_state.__cr_flag) + { + nrf_nvic_state.__cr_flag = 1; + nrf_nvic_state.__irq_masks[0] = ( NVIC->ICER[0] & __NRF_NVIC_APP_IRQS_0 ); + NVIC->ICER[0] = __NRF_NVIC_APP_IRQS_0; + nrf_nvic_state.__irq_masks[1] = ( NVIC->ICER[1] & __NRF_NVIC_APP_IRQS_1 ); + NVIC->ICER[1] = __NRF_NVIC_APP_IRQS_1; + *p_is_nested_critical_region = 0; + } + else + { + *p_is_nested_critical_region = 1; + } + if (!was_masked) + { + __sd_nvic_irq_enable(); + } + return NRF_SUCCESS; +} + +__STATIC_INLINE uint32_t sd_nvic_critical_region_exit(uint8_t is_nested_critical_region) +{ + if (nrf_nvic_state.__cr_flag && (is_nested_critical_region == 0)) + { + int was_masked = __sd_nvic_irq_disable(); + NVIC->ISER[0] = nrf_nvic_state.__irq_masks[0]; + NVIC->ISER[1] = nrf_nvic_state.__irq_masks[1]; + nrf_nvic_state.__cr_flag = 0; + if (!was_masked) + { + __sd_nvic_irq_enable(); + } + } + + return NRF_SUCCESS; +} + +#endif /* SUPPRESS_INLINE_IMPLEMENTATION */ + +#ifdef __cplusplus +} +#endif + +#endif // NRF_NVIC_H__ + +/**@} */ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h new file mode 100644 index 0000000000..6834599e87 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h @@ -0,0 +1,371 @@ +/* + * Copyright (c) 2015 - 2018, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @defgroup nrf_sdm_api SoftDevice Manager API + @{ + + @brief APIs for SoftDevice management. + +*/ + +#ifndef NRF_SDM_H__ +#define NRF_SDM_H__ + +#include +#include "nrf.h" +#include "nrf_svc.h" +#include "nrf_error.h" +#include "nrf_error_sdm.h" +#include "nrf_soc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup NRF_SDM_DEFINES Defines + * @{ */ +#ifdef NRFSOC_DOXYGEN +/// Declared in nrf_mbr.h +#define MBR_SIZE 0 +#warning test +#endif + +/** @brief The major version for the SoftDevice binary distributed with this header file. */ +#define SD_MAJOR_VERSION (7) + +/** @brief The minor version for the SoftDevice binary distributed with this header file. */ +#define SD_MINOR_VERSION (0) + +/** @brief The bugfix version for the SoftDevice binary distributed with this header file. */ +#define SD_BUGFIX_VERSION (1) + +/** @brief The SoftDevice variant of this firmware. */ +#define SD_VARIANT_ID 140 + +/** @brief The full version number for the SoftDevice binary this header file was distributed + * with, as a decimal number in the form Mmmmbbb, where: + * - M is major version (one or more digits) + * - mmm is minor version (three digits) + * - bbb is bugfix version (three digits). */ +#define SD_VERSION (SD_MAJOR_VERSION * 1000000 + SD_MINOR_VERSION * 1000 + SD_BUGFIX_VERSION) + +/** @brief SoftDevice Manager SVC Base number. */ +#define SDM_SVC_BASE 0x10 + +/** @brief SoftDevice unique string size in bytes. */ +#define SD_UNIQUE_STR_SIZE 20 + +/** @brief Invalid info field. Returned when an info field does not exist. */ +#define SDM_INFO_FIELD_INVALID (0) + +/** @brief Defines the SoftDevice Information Structure location (address) as an offset from +the start of the SoftDevice (without MBR)*/ +#define SOFTDEVICE_INFO_STRUCT_OFFSET (0x2000) + +/** @brief Defines the absolute SoftDevice Information Structure location (address) when the + * SoftDevice is installed just above the MBR (the usual case). */ +#define SOFTDEVICE_INFO_STRUCT_ADDRESS (SOFTDEVICE_INFO_STRUCT_OFFSET + MBR_SIZE) + +/** @brief Defines the offset for the SoftDevice Information Structure size value relative to the + * SoftDevice base address. The size value is of type uint8_t. */ +#define SD_INFO_STRUCT_SIZE_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET) + +/** @brief Defines the offset for the SoftDevice size value relative to the SoftDevice base address. + * The size value is of type uint32_t. */ +#define SD_SIZE_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x08) + +/** @brief Defines the offset for FWID value relative to the SoftDevice base address. The FWID value + * is of type uint16_t. */ +#define SD_FWID_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x0C) + +/** @brief Defines the offset for the SoftDevice ID relative to the SoftDevice base address. The ID + * is of type uint32_t. */ +#define SD_ID_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x10) + +/** @brief Defines the offset for the SoftDevice version relative to the SoftDevice base address in + * the same format as @ref SD_VERSION, stored as an uint32_t. */ +#define SD_VERSION_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x14) + +/** @brief Defines the offset for the SoftDevice unique string relative to the SoftDevice base address. + * The SD_UNIQUE_STR is stored as an array of uint8_t. The size of array is @ref SD_UNIQUE_STR_SIZE. + */ +#define SD_UNIQUE_STR_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x18) + +/** @brief Defines a macro for retrieving the actual SoftDevice Information Structure size value + * from a given base address. Use @ref MBR_SIZE as the argument when the SoftDevice is + * installed just above the MBR (the usual case). */ +#define SD_INFO_STRUCT_SIZE_GET(baseaddr) (*((uint8_t *) ((baseaddr) + SD_INFO_STRUCT_SIZE_OFFSET))) + +/** @brief Defines a macro for retrieving the actual SoftDevice size value from a given base + * address. Use @ref MBR_SIZE as the argument when the SoftDevice is installed just above + * the MBR (the usual case). */ +#define SD_SIZE_GET(baseaddr) (*((uint32_t *) ((baseaddr) + SD_SIZE_OFFSET))) + +/** @brief Defines the amount of flash that is used by the SoftDevice. + * Add @ref MBR_SIZE to find the first available flash address when the SoftDevice is installed + * just above the MBR (the usual case). + */ +#define SD_FLASH_SIZE 0x26000 + +/** @brief Defines a macro for retrieving the actual FWID value from a given base address. Use + * @ref MBR_SIZE as the argument when the SoftDevice is installed just above the MBR (the usual + * case). */ +#define SD_FWID_GET(baseaddr) (*((uint16_t *) ((baseaddr) + SD_FWID_OFFSET))) + +/** @brief Defines a macro for retrieving the actual SoftDevice ID from a given base address. Use + * @ref MBR_SIZE as the argument when the SoftDevice is installed just above the MBR (the + * usual case). */ +#define SD_ID_GET(baseaddr) ((SD_INFO_STRUCT_SIZE_GET(baseaddr) > (SD_ID_OFFSET - SOFTDEVICE_INFO_STRUCT_OFFSET)) \ + ? (*((uint32_t *) ((baseaddr) + SD_ID_OFFSET))) : SDM_INFO_FIELD_INVALID) + +/** @brief Defines a macro for retrieving the actual SoftDevice version from a given base address. + * Use @ref MBR_SIZE as the argument when the SoftDevice is installed just above the MBR + * (the usual case). */ +#define SD_VERSION_GET(baseaddr) ((SD_INFO_STRUCT_SIZE_GET(baseaddr) > (SD_VERSION_OFFSET - SOFTDEVICE_INFO_STRUCT_OFFSET)) \ + ? (*((uint32_t *) ((baseaddr) + SD_VERSION_OFFSET))) : SDM_INFO_FIELD_INVALID) + +/** @brief Defines a macro for retrieving the address of SoftDevice unique str based on a given base address. + * Use @ref MBR_SIZE as the argument when the SoftDevice is installed just above the MBR + * (the usual case). */ +#define SD_UNIQUE_STR_ADDR_GET(baseaddr) ((SD_INFO_STRUCT_SIZE_GET(baseaddr) > (SD_UNIQUE_STR_OFFSET - SOFTDEVICE_INFO_STRUCT_OFFSET)) \ + ? (((uint8_t *) ((baseaddr) + SD_UNIQUE_STR_OFFSET))) : SDM_INFO_FIELD_INVALID) + +/**@defgroup NRF_FAULT_ID_RANGES Fault ID ranges + * @{ */ +#define NRF_FAULT_ID_SD_RANGE_START 0x00000000 /**< SoftDevice ID range start. */ +#define NRF_FAULT_ID_APP_RANGE_START 0x00001000 /**< Application ID range start. */ +/**@} */ + +/**@defgroup NRF_FAULT_IDS Fault ID types + * @{ */ +#define NRF_FAULT_ID_SD_ASSERT (NRF_FAULT_ID_SD_RANGE_START + 1) /**< SoftDevice assertion. The info parameter is reserved for future used. */ +#define NRF_FAULT_ID_APP_MEMACC (NRF_FAULT_ID_APP_RANGE_START + 1) /**< Application invalid memory access. The info parameter will contain 0x00000000, + in case of SoftDevice RAM access violation. In case of SoftDevice peripheral + register violation the info parameter will contain the sub-region number of + PREGION[0], on whose address range the disallowed write access caused the + memory access fault. */ +/**@} */ + +/** @} */ + +/** @addtogroup NRF_SDM_ENUMS Enumerations + * @{ */ + +/**@brief nRF SoftDevice Manager API SVC numbers. */ +enum NRF_SD_SVCS +{ + SD_SOFTDEVICE_ENABLE = SDM_SVC_BASE, /**< ::sd_softdevice_enable */ + SD_SOFTDEVICE_DISABLE, /**< ::sd_softdevice_disable */ + SD_SOFTDEVICE_IS_ENABLED, /**< ::sd_softdevice_is_enabled */ + SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET, /**< ::sd_softdevice_vector_table_base_set */ + SVC_SDM_LAST /**< Placeholder for last SDM SVC */ +}; + +/** @} */ + +/** @addtogroup NRF_SDM_DEFINES Defines + * @{ */ + +/**@defgroup NRF_CLOCK_LF_ACCURACY Clock accuracy + * @{ */ + +#define NRF_CLOCK_LF_ACCURACY_250_PPM (0) /**< Default: 250 ppm */ +#define NRF_CLOCK_LF_ACCURACY_500_PPM (1) /**< 500 ppm */ +#define NRF_CLOCK_LF_ACCURACY_150_PPM (2) /**< 150 ppm */ +#define NRF_CLOCK_LF_ACCURACY_100_PPM (3) /**< 100 ppm */ +#define NRF_CLOCK_LF_ACCURACY_75_PPM (4) /**< 75 ppm */ +#define NRF_CLOCK_LF_ACCURACY_50_PPM (5) /**< 50 ppm */ +#define NRF_CLOCK_LF_ACCURACY_30_PPM (6) /**< 30 ppm */ +#define NRF_CLOCK_LF_ACCURACY_20_PPM (7) /**< 20 ppm */ +#define NRF_CLOCK_LF_ACCURACY_10_PPM (8) /**< 10 ppm */ +#define NRF_CLOCK_LF_ACCURACY_5_PPM (9) /**< 5 ppm */ +#define NRF_CLOCK_LF_ACCURACY_2_PPM (10) /**< 2 ppm */ +#define NRF_CLOCK_LF_ACCURACY_1_PPM (11) /**< 1 ppm */ + +/** @} */ + +/**@defgroup NRF_CLOCK_LF_SRC Possible LFCLK oscillator sources + * @{ */ + +#define NRF_CLOCK_LF_SRC_RC (0) /**< LFCLK RC oscillator. */ +#define NRF_CLOCK_LF_SRC_XTAL (1) /**< LFCLK crystal oscillator. */ +#define NRF_CLOCK_LF_SRC_SYNTH (2) /**< LFCLK Synthesized from HFCLK. */ + +/** @} */ + +/** @} */ + +/** @addtogroup NRF_SDM_TYPES Types + * @{ */ + +/**@brief Type representing LFCLK oscillator source. */ +typedef struct +{ + uint8_t source; /**< LF oscillator clock source, see @ref NRF_CLOCK_LF_SRC. */ + uint8_t rc_ctiv; /**< Only for ::NRF_CLOCK_LF_SRC_RC: Calibration timer interval in 1/4 second + units (nRF52: 1-32). + @note To avoid excessive clock drift, 0.5 degrees Celsius is the + maximum temperature change allowed in one calibration timer + interval. The interval should be selected to ensure this. + + @note Must be 0 if source is not ::NRF_CLOCK_LF_SRC_RC. */ + uint8_t rc_temp_ctiv; /**< Only for ::NRF_CLOCK_LF_SRC_RC: How often (in number of calibration + intervals) the RC oscillator shall be calibrated if the temperature + hasn't changed. + 0: Always calibrate even if the temperature hasn't changed. + 1: Only calibrate if the temperature has changed (legacy - nRF51 only). + 2-33: Check the temperature and only calibrate if it has changed, + however calibration will take place every rc_temp_ctiv + intervals in any case. + + @note Must be 0 if source is not ::NRF_CLOCK_LF_SRC_RC. + + @note For nRF52, the application must ensure calibration at least once + every 8 seconds to ensure +/-500 ppm clock stability. The + recommended configuration for ::NRF_CLOCK_LF_SRC_RC on nRF52 is + rc_ctiv=16 and rc_temp_ctiv=2. This will ensure calibration at + least once every 8 seconds and for temperature changes of 0.5 + degrees Celsius every 4 seconds. See the Product Specification + for the nRF52 device being used for more information.*/ + uint8_t accuracy; /**< External clock accuracy used in the LL to compute timing + windows, see @ref NRF_CLOCK_LF_ACCURACY.*/ +} nrf_clock_lf_cfg_t; + +/**@brief Fault Handler type. + * + * When certain unrecoverable errors occur within the application or SoftDevice the fault handler will be called back. + * The protocol stack will be in an undefined state when this happens and the only way to recover will be to + * perform a reset, using e.g. CMSIS NVIC_SystemReset(). + * If the application returns from the fault handler the SoftDevice will call NVIC_SystemReset(). + * + * @note It is recommended to either perform a reset in the fault handler or to let the SoftDevice reset the device. + * Otherwise SoC peripherals may behave in an undefined way. For example, the RADIO peripherial may + * continously transmit packets. + * + * @note This callback is executed in HardFault context, thus SVC functions cannot be called from the fault callback. + * + * @param[in] id Fault identifier. See @ref NRF_FAULT_IDS. + * @param[in] pc The program counter of the instruction that triggered the fault. + * @param[in] info Optional additional information regarding the fault. Refer to each Fault identifier for details. + * + * @note When id is set to @ref NRF_FAULT_ID_APP_MEMACC, pc will contain the address of the instruction being executed at the time when + * the fault is detected by the CPU. The CPU program counter may have advanced up to 2 instructions (no branching) after the one that triggered the fault. + */ +typedef void (*nrf_fault_handler_t)(uint32_t id, uint32_t pc, uint32_t info); + +/** @} */ + +/** @addtogroup NRF_SDM_FUNCTIONS Functions + * @{ */ + +/**@brief Enables the SoftDevice and by extension the protocol stack. + * + * @note Some care must be taken if a low frequency clock source is already running when calling this function: + * If the LF clock has a different source then the one currently running, it will be stopped. Then, the new + * clock source will be started. + * + * @note This function has no effect when returning with an error. + * + * @post If return code is ::NRF_SUCCESS + * - SoC library and protocol stack APIs are made available. + * - A portion of RAM will be unavailable (see relevant SDS documentation). + * - Some peripherals will be unavailable or available only through the SoC API (see relevant SDS documentation). + * - Interrupts will not arrive from protected peripherals or interrupts. + * - nrf_nvic_ functions must be used instead of CMSIS NVIC_ functions for reliable usage of the SoftDevice. + * - Interrupt latency may be affected by the SoftDevice (see relevant SDS documentation). + * - Chosen low frequency clock source will be running. + * + * @param p_clock_lf_cfg Low frequency clock source and accuracy. + If NULL the clock will be configured as an RC source with rc_ctiv = 16 and .rc_temp_ctiv = 2 + In the case of XTAL source, the PPM accuracy of the chosen clock source must be greater than or equal to the actual characteristics of your XTAL clock. + * @param fault_handler Callback to be invoked in case of fault, cannot be NULL. + * + * @retval ::NRF_SUCCESS + * @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied. + * @retval ::NRF_ERROR_INVALID_STATE SoftDevice is already enabled, and the clock source and fault handler cannot be updated. + * @retval ::NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION SoftDevice interrupt is already enabled, or an enabled interrupt has an illegal priority level. + * @retval ::NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN Unknown low frequency clock source selected. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid clock source configuration supplied in p_clock_lf_cfg. + */ +SVCALL(SD_SOFTDEVICE_ENABLE, uint32_t, sd_softdevice_enable(nrf_clock_lf_cfg_t const * p_clock_lf_cfg, nrf_fault_handler_t fault_handler)); + + +/**@brief Disables the SoftDevice and by extension the protocol stack. + * + * Idempotent function to disable the SoftDevice. + * + * @post SoC library and protocol stack APIs are made unavailable. + * @post All interrupts that was protected by the SoftDevice will be disabled and initialized to priority 0 (highest). + * @post All peripherals used by the SoftDevice will be reset to default values. + * @post All of RAM become available. + * @post All interrupts are forwarded to the application. + * @post LFCLK source chosen in ::sd_softdevice_enable will be left running. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_SOFTDEVICE_DISABLE, uint32_t, sd_softdevice_disable(void)); + +/**@brief Check if the SoftDevice is enabled. + * + * @param[out] p_softdevice_enabled If the SoftDevice is enabled: 1 else 0. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_SOFTDEVICE_IS_ENABLED, uint32_t, sd_softdevice_is_enabled(uint8_t * p_softdevice_enabled)); + +/**@brief Sets the base address of the interrupt vector table for interrupts forwarded from the SoftDevice + * + * This function is only intended to be called when a bootloader is enabled. + * + * @param[in] address The base address of the interrupt vector table for forwarded interrupts. + + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET, uint32_t, sd_softdevice_vector_table_base_set(uint32_t address)); + +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif // NRF_SDM_H__ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_soc.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_soc.h new file mode 100644 index 0000000000..3751d133f5 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_soc.h @@ -0,0 +1,1080 @@ +/* + * Copyright (c) 2015 - 2019, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @defgroup nrf_soc_api SoC Library API + * @{ + * + * @brief APIs for the SoC library. + * + */ + +#ifndef NRF_SOC_H__ +#define NRF_SOC_H__ + +#include +#include "nrf.h" +#include "nrf_svc.h" +#include "nrf_error.h" +#include "nrf_error_soc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/**@addtogroup NRF_SOC_DEFINES Defines + * @{ */ + +/**@brief The number of the lowest SVC number reserved for the SoC library. */ +#define SOC_SVC_BASE (0x20) /**< Base value for SVCs that are available when the SoftDevice is disabled. */ +#define SOC_SVC_BASE_NOT_AVAILABLE (0x2C) /**< Base value for SVCs that are not available when the SoftDevice is disabled. */ + +/**@brief Guaranteed time for application to process radio inactive notification. */ +#define NRF_RADIO_NOTIFICATION_INACTIVE_GUARANTEED_TIME_US (62) + +/**@brief The minimum allowed timeslot extension time. */ +#define NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US (200) + +/**@brief The maximum processing time to handle a timeslot extension. */ +#define NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US (20) + +/**@brief The latest time before the end of a timeslot the timeslot can be extended. */ +#define NRF_RADIO_MIN_EXTENSION_MARGIN_US (82) + +#define SOC_ECB_KEY_LENGTH (16) /**< ECB key length. */ +#define SOC_ECB_CLEARTEXT_LENGTH (16) /**< ECB cleartext length. */ +#define SOC_ECB_CIPHERTEXT_LENGTH (SOC_ECB_CLEARTEXT_LENGTH) /**< ECB ciphertext length. */ + +#define SD_EVT_IRQn (SWI2_IRQn) /**< SoftDevice Event IRQ number. Used for both protocol events and SoC events. */ +#define SD_EVT_IRQHandler (SWI2_IRQHandler) /**< SoftDevice Event IRQ handler. Used for both protocol events and SoC events. + The default interrupt priority for this handler is set to 6 */ +#define RADIO_NOTIFICATION_IRQn (SWI1_IRQn) /**< The radio notification IRQ number. */ +#define RADIO_NOTIFICATION_IRQHandler (SWI1_IRQHandler) /**< The radio notification IRQ handler. + The default interrupt priority for this handler is set to 6 */ +#define NRF_RADIO_LENGTH_MIN_US (100) /**< The shortest allowed radio timeslot, in microseconds. */ +#define NRF_RADIO_LENGTH_MAX_US (100000) /**< The longest allowed radio timeslot, in microseconds. */ + +#define NRF_RADIO_DISTANCE_MAX_US (128000000UL - 1UL) /**< The longest timeslot distance, in microseconds, allowed for the distance parameter (see @ref nrf_radio_request_normal_t) in the request. */ + +#define NRF_RADIO_EARLIEST_TIMEOUT_MAX_US (128000000UL - 1UL) /**< The longest timeout, in microseconds, allowed when requesting the earliest possible timeslot. */ + +#define NRF_RADIO_START_JITTER_US (2) /**< The maximum jitter in @ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START relative to the requested start time. */ + +/**@brief Mask of PPI channels reserved by the SoftDevice when the SoftDevice is disabled. */ +#define NRF_SOC_SD_PPI_CHANNELS_SD_DISABLED_MSK ((uint32_t)(0)) + +/**@brief Mask of PPI channels reserved by the SoftDevice when the SoftDevice is enabled. */ +#define NRF_SOC_SD_PPI_CHANNELS_SD_ENABLED_MSK ((uint32_t)( \ + (1U << 17) \ + | (1U << 18) \ + | (1U << 19) \ + | (1U << 20) \ + | (1U << 21) \ + | (1U << 22) \ + | (1U << 23) \ + | (1U << 24) \ + | (1U << 25) \ + | (1U << 26) \ + | (1U << 27) \ + | (1U << 28) \ + | (1U << 29) \ + | (1U << 30) \ + | (1U << 31) \ + )) + +/**@brief Mask of PPI groups reserved by the SoftDevice when the SoftDevice is disabled. */ +#define NRF_SOC_SD_PPI_GROUPS_SD_DISABLED_MSK ((uint32_t)(0)) + +/**@brief Mask of PPI groups reserved by the SoftDevice when the SoftDevice is enabled. */ +#define NRF_SOC_SD_PPI_GROUPS_SD_ENABLED_MSK ((uint32_t)( \ + (1U << 4) \ + | (1U << 5) \ + )) + +/**@} */ + +/**@addtogroup NRF_SOC_ENUMS Enumerations + * @{ */ + +/**@brief The SVC numbers used by the SVC functions in the SoC library. */ +enum NRF_SOC_SVCS +{ + SD_PPI_CHANNEL_ENABLE_GET = SOC_SVC_BASE, + SD_PPI_CHANNEL_ENABLE_SET = SOC_SVC_BASE + 1, + SD_PPI_CHANNEL_ENABLE_CLR = SOC_SVC_BASE + 2, + SD_PPI_CHANNEL_ASSIGN = SOC_SVC_BASE + 3, + SD_PPI_GROUP_TASK_ENABLE = SOC_SVC_BASE + 4, + SD_PPI_GROUP_TASK_DISABLE = SOC_SVC_BASE + 5, + SD_PPI_GROUP_ASSIGN = SOC_SVC_BASE + 6, + SD_PPI_GROUP_GET = SOC_SVC_BASE + 7, + SD_FLASH_PAGE_ERASE = SOC_SVC_BASE + 8, + SD_FLASH_WRITE = SOC_SVC_BASE + 9, + SD_PROTECTED_REGISTER_WRITE = SOC_SVC_BASE + 11, + SD_MUTEX_NEW = SOC_SVC_BASE_NOT_AVAILABLE, + SD_MUTEX_ACQUIRE = SOC_SVC_BASE_NOT_AVAILABLE + 1, + SD_MUTEX_RELEASE = SOC_SVC_BASE_NOT_AVAILABLE + 2, + SD_RAND_APPLICATION_POOL_CAPACITY_GET = SOC_SVC_BASE_NOT_AVAILABLE + 3, + SD_RAND_APPLICATION_BYTES_AVAILABLE_GET = SOC_SVC_BASE_NOT_AVAILABLE + 4, + SD_RAND_APPLICATION_VECTOR_GET = SOC_SVC_BASE_NOT_AVAILABLE + 5, + SD_POWER_MODE_SET = SOC_SVC_BASE_NOT_AVAILABLE + 6, + SD_POWER_SYSTEM_OFF = SOC_SVC_BASE_NOT_AVAILABLE + 7, + SD_POWER_RESET_REASON_GET = SOC_SVC_BASE_NOT_AVAILABLE + 8, + SD_POWER_RESET_REASON_CLR = SOC_SVC_BASE_NOT_AVAILABLE + 9, + SD_POWER_POF_ENABLE = SOC_SVC_BASE_NOT_AVAILABLE + 10, + SD_POWER_POF_THRESHOLD_SET = SOC_SVC_BASE_NOT_AVAILABLE + 11, + SD_POWER_POF_THRESHOLDVDDH_SET = SOC_SVC_BASE_NOT_AVAILABLE + 12, + SD_POWER_RAM_POWER_SET = SOC_SVC_BASE_NOT_AVAILABLE + 13, + SD_POWER_RAM_POWER_CLR = SOC_SVC_BASE_NOT_AVAILABLE + 14, + SD_POWER_RAM_POWER_GET = SOC_SVC_BASE_NOT_AVAILABLE + 15, + SD_POWER_GPREGRET_SET = SOC_SVC_BASE_NOT_AVAILABLE + 16, + SD_POWER_GPREGRET_CLR = SOC_SVC_BASE_NOT_AVAILABLE + 17, + SD_POWER_GPREGRET_GET = SOC_SVC_BASE_NOT_AVAILABLE + 18, + SD_POWER_DCDC_MODE_SET = SOC_SVC_BASE_NOT_AVAILABLE + 19, + SD_POWER_DCDC0_MODE_SET = SOC_SVC_BASE_NOT_AVAILABLE + 20, + SD_APP_EVT_WAIT = SOC_SVC_BASE_NOT_AVAILABLE + 21, + SD_CLOCK_HFCLK_REQUEST = SOC_SVC_BASE_NOT_AVAILABLE + 22, + SD_CLOCK_HFCLK_RELEASE = SOC_SVC_BASE_NOT_AVAILABLE + 23, + SD_CLOCK_HFCLK_IS_RUNNING = SOC_SVC_BASE_NOT_AVAILABLE + 24, + SD_RADIO_NOTIFICATION_CFG_SET = SOC_SVC_BASE_NOT_AVAILABLE + 25, + SD_ECB_BLOCK_ENCRYPT = SOC_SVC_BASE_NOT_AVAILABLE + 26, + SD_ECB_BLOCKS_ENCRYPT = SOC_SVC_BASE_NOT_AVAILABLE + 27, + SD_RADIO_SESSION_OPEN = SOC_SVC_BASE_NOT_AVAILABLE + 28, + SD_RADIO_SESSION_CLOSE = SOC_SVC_BASE_NOT_AVAILABLE + 29, + SD_RADIO_REQUEST = SOC_SVC_BASE_NOT_AVAILABLE + 30, + SD_EVT_GET = SOC_SVC_BASE_NOT_AVAILABLE + 31, + SD_TEMP_GET = SOC_SVC_BASE_NOT_AVAILABLE + 32, + SD_POWER_USBPWRRDY_ENABLE = SOC_SVC_BASE_NOT_AVAILABLE + 33, + SD_POWER_USBDETECTED_ENABLE = SOC_SVC_BASE_NOT_AVAILABLE + 34, + SD_POWER_USBREMOVED_ENABLE = SOC_SVC_BASE_NOT_AVAILABLE + 35, + SD_POWER_USBREGSTATUS_GET = SOC_SVC_BASE_NOT_AVAILABLE + 36, + SVC_SOC_LAST = SOC_SVC_BASE_NOT_AVAILABLE + 37 +}; + +/**@brief Possible values of a ::nrf_mutex_t. */ +enum NRF_MUTEX_VALUES +{ + NRF_MUTEX_FREE, + NRF_MUTEX_TAKEN +}; + +/**@brief Power modes. */ +enum NRF_POWER_MODES +{ + NRF_POWER_MODE_CONSTLAT, /**< Constant latency mode. See power management in the reference manual. */ + NRF_POWER_MODE_LOWPWR /**< Low power mode. See power management in the reference manual. */ +}; + + +/**@brief Power failure thresholds */ +enum NRF_POWER_THRESHOLDS +{ + NRF_POWER_THRESHOLD_V17 = 4UL, /**< 1.7 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V18, /**< 1.8 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V19, /**< 1.9 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V20, /**< 2.0 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V21, /**< 2.1 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V22, /**< 2.2 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V23, /**< 2.3 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V24, /**< 2.4 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V25, /**< 2.5 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V26, /**< 2.6 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V27, /**< 2.7 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V28 /**< 2.8 Volts power failure threshold. */ +}; + +/**@brief Power failure thresholds for high voltage */ +enum NRF_POWER_THRESHOLDVDDHS +{ + NRF_POWER_THRESHOLDVDDH_V27, /**< 2.7 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V28, /**< 2.8 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V29, /**< 2.9 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V30, /**< 3.0 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V31, /**< 3.1 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V32, /**< 3.2 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V33, /**< 3.3 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V34, /**< 3.4 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V35, /**< 3.5 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V36, /**< 3.6 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V37, /**< 3.7 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V38, /**< 3.8 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V39, /**< 3.9 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V40, /**< 4.0 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V41, /**< 4.1 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V42 /**< 4.2 Volts power failure threshold. */ +}; + + +/**@brief DC/DC converter modes. */ +enum NRF_POWER_DCDC_MODES +{ + NRF_POWER_DCDC_DISABLE, /**< The DCDC is disabled. */ + NRF_POWER_DCDC_ENABLE /**< The DCDC is enabled. */ +}; + +/**@brief Radio notification distances. */ +enum NRF_RADIO_NOTIFICATION_DISTANCES +{ + NRF_RADIO_NOTIFICATION_DISTANCE_NONE = 0, /**< The event does not have a notification. */ + NRF_RADIO_NOTIFICATION_DISTANCE_800US, /**< The distance from the active notification to start of radio activity. */ + NRF_RADIO_NOTIFICATION_DISTANCE_1740US, /**< The distance from the active notification to start of radio activity. */ + NRF_RADIO_NOTIFICATION_DISTANCE_2680US, /**< The distance from the active notification to start of radio activity. */ + NRF_RADIO_NOTIFICATION_DISTANCE_3620US, /**< The distance from the active notification to start of radio activity. */ + NRF_RADIO_NOTIFICATION_DISTANCE_4560US, /**< The distance from the active notification to start of radio activity. */ + NRF_RADIO_NOTIFICATION_DISTANCE_5500US /**< The distance from the active notification to start of radio activity. */ +}; + + +/**@brief Radio notification types. */ +enum NRF_RADIO_NOTIFICATION_TYPES +{ + NRF_RADIO_NOTIFICATION_TYPE_NONE = 0, /**< The event does not have a radio notification signal. */ + NRF_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE, /**< Using interrupt for notification when the radio will be enabled. */ + NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE, /**< Using interrupt for notification when the radio has been disabled. */ + NRF_RADIO_NOTIFICATION_TYPE_INT_ON_BOTH, /**< Using interrupt for notification both when the radio will be enabled and disabled. */ +}; + +/**@brief The Radio signal callback types. */ +enum NRF_RADIO_CALLBACK_SIGNAL_TYPE +{ + NRF_RADIO_CALLBACK_SIGNAL_TYPE_START, /**< This signal indicates the start of the radio timeslot. */ + NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0, /**< This signal indicates the NRF_TIMER0 interrupt. */ + NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO, /**< This signal indicates the NRF_RADIO interrupt. */ + NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_FAILED, /**< This signal indicates extend action failed. */ + NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED /**< This signal indicates extend action succeeded. */ +}; + +/**@brief The actions requested by the signal callback. + * + * This code gives the SOC instructions about what action to take when the signal callback has + * returned. + */ +enum NRF_RADIO_SIGNAL_CALLBACK_ACTION +{ + NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE, /**< Return without action. */ + NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND, /**< Request an extension of the current + timeslot. Maximum execution time for this action: + @ref NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US. + This action must be started at least + @ref NRF_RADIO_MIN_EXTENSION_MARGIN_US before + the end of the timeslot. */ + NRF_RADIO_SIGNAL_CALLBACK_ACTION_END, /**< End the current radio timeslot. */ + NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END /**< Request a new radio timeslot and end the current timeslot. */ +}; + +/**@brief Radio timeslot high frequency clock source configuration. */ +enum NRF_RADIO_HFCLK_CFG +{ + NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED, /**< The SoftDevice will guarantee that the high frequency clock source is the + external crystal for the whole duration of the timeslot. This should be the + preferred option for events that use the radio or require high timing accuracy. + @note The SoftDevice will automatically turn on and off the external crystal, + at the beginning and end of the timeslot, respectively. The crystal may also + intentionally be left running after the timeslot, in cases where it is needed + by the SoftDevice shortly after the end of the timeslot. */ + NRF_RADIO_HFCLK_CFG_NO_GUARANTEE /**< This configuration allows for earlier and tighter scheduling of timeslots. + The RC oscillator may be the clock source in part or for the whole duration of the timeslot. + The RC oscillator's accuracy must therefore be taken into consideration. + @note If the application will use the radio peripheral in timeslots with this configuration, + it must make sure that the crystal is running and stable before starting the radio. */ +}; + +/**@brief Radio timeslot priorities. */ +enum NRF_RADIO_PRIORITY +{ + NRF_RADIO_PRIORITY_HIGH, /**< High (equal priority as the normal connection priority of the SoftDevice stack(s)). */ + NRF_RADIO_PRIORITY_NORMAL, /**< Normal (equal priority as the priority of secondary activities of the SoftDevice stack(s)). */ +}; + +/**@brief Radio timeslot request type. */ +enum NRF_RADIO_REQUEST_TYPE +{ + NRF_RADIO_REQ_TYPE_EARLIEST, /**< Request radio timeslot as early as possible. This should always be used for the first request in a session. */ + NRF_RADIO_REQ_TYPE_NORMAL /**< Normal radio timeslot request. */ +}; + +/**@brief SoC Events. */ +enum NRF_SOC_EVTS +{ + NRF_EVT_HFCLKSTARTED, /**< Event indicating that the HFCLK has started. */ + NRF_EVT_POWER_FAILURE_WARNING, /**< Event indicating that a power failure warning has occurred. */ + NRF_EVT_FLASH_OPERATION_SUCCESS, /**< Event indicating that the ongoing flash operation has completed successfully. */ + NRF_EVT_FLASH_OPERATION_ERROR, /**< Event indicating that the ongoing flash operation has timed out with an error. */ + NRF_EVT_RADIO_BLOCKED, /**< Event indicating that a radio timeslot was blocked. */ + NRF_EVT_RADIO_CANCELED, /**< Event indicating that a radio timeslot was canceled by SoftDevice. */ + NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN, /**< Event indicating that a radio timeslot signal callback handler return was invalid. */ + NRF_EVT_RADIO_SESSION_IDLE, /**< Event indicating that a radio timeslot session is idle. */ + NRF_EVT_RADIO_SESSION_CLOSED, /**< Event indicating that a radio timeslot session is closed. */ + NRF_EVT_POWER_USB_POWER_READY, /**< Event indicating that a USB 3.3 V supply is ready. */ + NRF_EVT_POWER_USB_DETECTED, /**< Event indicating that voltage supply is detected on VBUS. */ + NRF_EVT_POWER_USB_REMOVED, /**< Event indicating that voltage supply is removed from VBUS. */ + NRF_EVT_NUMBER_OF_EVTS +}; + +/**@} */ + + +/**@addtogroup NRF_SOC_STRUCTURES Structures + * @{ */ + +/**@brief Represents a mutex for use with the nrf_mutex functions. + * @note Accessing the value directly is not safe, use the mutex functions! + */ +typedef volatile uint8_t nrf_mutex_t; + +/**@brief Parameters for a request for a timeslot as early as possible. */ +typedef struct +{ + uint8_t hfclk; /**< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG. */ + uint8_t priority; /**< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY. */ + uint32_t length_us; /**< The radio timeslot length (in the range 100 to 100,000] microseconds). */ + uint32_t timeout_us; /**< Longest acceptable delay until the start of the requested timeslot (up to @ref NRF_RADIO_EARLIEST_TIMEOUT_MAX_US microseconds). */ +} nrf_radio_request_earliest_t; + +/**@brief Parameters for a normal radio timeslot request. */ +typedef struct +{ + uint8_t hfclk; /**< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG. */ + uint8_t priority; /**< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY. */ + uint32_t distance_us; /**< Distance from the start of the previous radio timeslot (up to @ref NRF_RADIO_DISTANCE_MAX_US microseconds). */ + uint32_t length_us; /**< The radio timeslot length (in the range [100..100,000] microseconds). */ +} nrf_radio_request_normal_t; + +/**@brief Radio timeslot request parameters. */ +typedef struct +{ + uint8_t request_type; /**< Type of request, see @ref NRF_RADIO_REQUEST_TYPE. */ + union + { + nrf_radio_request_earliest_t earliest; /**< Parameters for requesting a radio timeslot as early as possible. */ + nrf_radio_request_normal_t normal; /**< Parameters for requesting a normal radio timeslot. */ + } params; /**< Parameter union. */ +} nrf_radio_request_t; + +/**@brief Return parameters of the radio timeslot signal callback. */ +typedef struct +{ + uint8_t callback_action; /**< The action requested by the application when returning from the signal callback, see @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION. */ + union + { + struct + { + nrf_radio_request_t * p_next; /**< The request parameters for the next radio timeslot. */ + } request; /**< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END. */ + struct + { + uint32_t length_us; /**< Requested extension of the radio timeslot duration (microseconds) (for minimum time see @ref NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US). */ + } extend; /**< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND. */ + } params; /**< Parameter union. */ +} nrf_radio_signal_callback_return_param_t; + +/**@brief The radio timeslot signal callback type. + * + * @note In case of invalid return parameters, the radio timeslot will automatically end + * immediately after returning from the signal callback and the + * @ref NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN event will be sent. + * @note The returned struct pointer must remain valid after the signal callback + * function returns. For instance, this means that it must not point to a stack variable. + * + * @param[in] signal_type Type of signal, see @ref NRF_RADIO_CALLBACK_SIGNAL_TYPE. + * + * @return Pointer to structure containing action requested by the application. + */ +typedef nrf_radio_signal_callback_return_param_t * (*nrf_radio_signal_callback_t) (uint8_t signal_type); + +/**@brief AES ECB parameter typedefs */ +typedef uint8_t soc_ecb_key_t[SOC_ECB_KEY_LENGTH]; /**< Encryption key type. */ +typedef uint8_t soc_ecb_cleartext_t[SOC_ECB_CLEARTEXT_LENGTH]; /**< Cleartext data type. */ +typedef uint8_t soc_ecb_ciphertext_t[SOC_ECB_CIPHERTEXT_LENGTH]; /**< Ciphertext data type. */ + +/**@brief AES ECB data structure */ +typedef struct +{ + soc_ecb_key_t key; /**< Encryption key. */ + soc_ecb_cleartext_t cleartext; /**< Cleartext data. */ + soc_ecb_ciphertext_t ciphertext; /**< Ciphertext data. */ +} nrf_ecb_hal_data_t; + +/**@brief AES ECB block. Used to provide multiple blocks in a single call + to @ref sd_ecb_blocks_encrypt.*/ +typedef struct +{ + soc_ecb_key_t const * p_key; /**< Pointer to the Encryption key. */ + soc_ecb_cleartext_t const * p_cleartext; /**< Pointer to the Cleartext data. */ + soc_ecb_ciphertext_t * p_ciphertext; /**< Pointer to the Ciphertext data. */ +} nrf_ecb_hal_data_block_t; + +/**@} */ + +/**@addtogroup NRF_SOC_FUNCTIONS Functions + * @{ */ + +/**@brief Initialize a mutex. + * + * @param[in] p_mutex Pointer to the mutex to initialize. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_MUTEX_NEW, uint32_t, sd_mutex_new(nrf_mutex_t * p_mutex)); + +/**@brief Attempt to acquire a mutex. + * + * @param[in] p_mutex Pointer to the mutex to acquire. + * + * @retval ::NRF_SUCCESS The mutex was successfully acquired. + * @retval ::NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN The mutex could not be acquired. + */ +SVCALL(SD_MUTEX_ACQUIRE, uint32_t, sd_mutex_acquire(nrf_mutex_t * p_mutex)); + +/**@brief Release a mutex. + * + * @param[in] p_mutex Pointer to the mutex to release. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_MUTEX_RELEASE, uint32_t, sd_mutex_release(nrf_mutex_t * p_mutex)); + +/**@brief Query the capacity of the application random pool. + * + * @param[out] p_pool_capacity The capacity of the pool. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_RAND_APPLICATION_POOL_CAPACITY_GET, uint32_t, sd_rand_application_pool_capacity_get(uint8_t * p_pool_capacity)); + +/**@brief Get number of random bytes available to the application. + * + * @param[out] p_bytes_available The number of bytes currently available in the pool. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_RAND_APPLICATION_BYTES_AVAILABLE_GET, uint32_t, sd_rand_application_bytes_available_get(uint8_t * p_bytes_available)); + +/**@brief Get random bytes from the application pool. + * + * @param[out] p_buff Pointer to unit8_t buffer for storing the bytes. + * @param[in] length Number of bytes to take from pool and place in p_buff. + * + * @retval ::NRF_SUCCESS The requested bytes were written to p_buff. + * @retval ::NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES No bytes were written to the buffer, because there were not enough bytes available. +*/ +SVCALL(SD_RAND_APPLICATION_VECTOR_GET, uint32_t, sd_rand_application_vector_get(uint8_t * p_buff, uint8_t length)); + +/**@brief Gets the reset reason register. + * + * @param[out] p_reset_reason Contents of the NRF_POWER->RESETREAS register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_RESET_REASON_GET, uint32_t, sd_power_reset_reason_get(uint32_t * p_reset_reason)); + +/**@brief Clears the bits of the reset reason register. + * + * @param[in] reset_reason_clr_msk Contains the bits to clear from the reset reason register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_RESET_REASON_CLR, uint32_t, sd_power_reset_reason_clr(uint32_t reset_reason_clr_msk)); + +/**@brief Sets the power mode when in CPU sleep. + * + * @param[in] power_mode The power mode to use when in CPU sleep, see @ref NRF_POWER_MODES. @sa sd_app_evt_wait + * + * @retval ::NRF_SUCCESS The power mode was set. + * @retval ::NRF_ERROR_SOC_POWER_MODE_UNKNOWN The power mode was unknown. + */ +SVCALL(SD_POWER_MODE_SET, uint32_t, sd_power_mode_set(uint8_t power_mode)); + +/**@brief Puts the chip in System OFF mode. + * + * @retval ::NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN + */ +SVCALL(SD_POWER_SYSTEM_OFF, uint32_t, sd_power_system_off(void)); + +/**@brief Enables or disables the power-fail comparator. + * + * Enabling this will give a SoftDevice event (NRF_EVT_POWER_FAILURE_WARNING) when the power failure warning occurs. + * The event can be retrieved with sd_evt_get(); + * + * @param[in] pof_enable True if the power-fail comparator should be enabled, false if it should be disabled. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_POF_ENABLE, uint32_t, sd_power_pof_enable(uint8_t pof_enable)); + +/**@brief Enables or disables the USB power ready event. + * + * Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_POWER_READY) when a USB 3.3 V supply is ready. + * The event can be retrieved with sd_evt_get(); + * + * @param[in] usbpwrrdy_enable True if the power ready event should be enabled, false if it should be disabled. + * + * @note Calling this function on a chip without USBD peripheral will result in undefined behaviour. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_USBPWRRDY_ENABLE, uint32_t, sd_power_usbpwrrdy_enable(uint8_t usbpwrrdy_enable)); + +/**@brief Enables or disables the power USB-detected event. + * + * Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_DETECTED) when a voltage supply is detected on VBUS. + * The event can be retrieved with sd_evt_get(); + * + * @param[in] usbdetected_enable True if the power ready event should be enabled, false if it should be disabled. + * + * @note Calling this function on a chip without USBD peripheral will result in undefined behaviour. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_USBDETECTED_ENABLE, uint32_t, sd_power_usbdetected_enable(uint8_t usbdetected_enable)); + +/**@brief Enables or disables the power USB-removed event. + * + * Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_REMOVED) when a voltage supply is removed from VBUS. + * The event can be retrieved with sd_evt_get(); + * + * @param[in] usbremoved_enable True if the power ready event should be enabled, false if it should be disabled. + * + * @note Calling this function on a chip without USBD peripheral will result in undefined behaviour. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_USBREMOVED_ENABLE, uint32_t, sd_power_usbremoved_enable(uint8_t usbremoved_enable)); + +/**@brief Get USB supply status register content. + * + * @param[out] usbregstatus The content of USBREGSTATUS register. + * + * @note Calling this function on a chip without USBD peripheral will result in undefined behaviour. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_USBREGSTATUS_GET, uint32_t, sd_power_usbregstatus_get(uint32_t * usbregstatus)); + +/**@brief Sets the power failure comparator threshold value. + * + * @note: Power failure comparator threshold setting. This setting applies both for normal voltage + * mode (supply connected to both VDD and VDDH) and high voltage mode (supply connected to + * VDDH only). + * + * @param[in] threshold The power-fail threshold value to use, see @ref NRF_POWER_THRESHOLDS. + * + * @retval ::NRF_SUCCESS The power failure threshold was set. + * @retval ::NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN The power failure threshold is unknown. + */ +SVCALL(SD_POWER_POF_THRESHOLD_SET, uint32_t, sd_power_pof_threshold_set(uint8_t threshold)); + +/**@brief Sets the power failure comparator threshold value for high voltage. + * + * @note: Power failure comparator threshold setting for high voltage mode (supply connected to + * VDDH only). This setting does not apply for normal voltage mode (supply connected to both + * VDD and VDDH). + * + * @param[in] threshold The power-fail threshold value to use, see @ref NRF_POWER_THRESHOLDVDDHS. + * + * @retval ::NRF_SUCCESS The power failure threshold was set. + * @retval ::NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN The power failure threshold is unknown. + */ +SVCALL(SD_POWER_POF_THRESHOLDVDDH_SET, uint32_t, sd_power_pof_thresholdvddh_set(uint8_t threshold)); + +/**@brief Writes the NRF_POWER->RAM[index].POWERSET register. + * + * @param[in] index Contains the index in the NRF_POWER->RAM[index].POWERSET register to write to. + * @param[in] ram_powerset Contains the word to write to the NRF_POWER->RAM[index].POWERSET register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_RAM_POWER_SET, uint32_t, sd_power_ram_power_set(uint8_t index, uint32_t ram_powerset)); + +/**@brief Writes the NRF_POWER->RAM[index].POWERCLR register. + * + * @param[in] index Contains the index in the NRF_POWER->RAM[index].POWERCLR register to write to. + * @param[in] ram_powerclr Contains the word to write to the NRF_POWER->RAM[index].POWERCLR register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_RAM_POWER_CLR, uint32_t, sd_power_ram_power_clr(uint8_t index, uint32_t ram_powerclr)); + +/**@brief Get contents of NRF_POWER->RAM[index].POWER register, indicates power status of RAM[index] blocks. + * + * @param[in] index Contains the index in the NRF_POWER->RAM[index].POWER register to read from. + * @param[out] p_ram_power Content of NRF_POWER->RAM[index].POWER register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_RAM_POWER_GET, uint32_t, sd_power_ram_power_get(uint8_t index, uint32_t * p_ram_power)); + +/**@brief Set bits in the general purpose retention registers (NRF_POWER->GPREGRET*). + * + * @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2. + * @param[in] gpregret_msk Bits to be set in the GPREGRET register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_GPREGRET_SET, uint32_t, sd_power_gpregret_set(uint32_t gpregret_id, uint32_t gpregret_msk)); + +/**@brief Clear bits in the general purpose retention registers (NRF_POWER->GPREGRET*). + * + * @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2. + * @param[in] gpregret_msk Bits to be clear in the GPREGRET register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_GPREGRET_CLR, uint32_t, sd_power_gpregret_clr(uint32_t gpregret_id, uint32_t gpregret_msk)); + +/**@brief Get contents of the general purpose retention registers (NRF_POWER->GPREGRET*). + * + * @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2. + * @param[out] p_gpregret Contents of the GPREGRET register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_GPREGRET_GET, uint32_t, sd_power_gpregret_get(uint32_t gpregret_id, uint32_t *p_gpregret)); + +/**@brief Enable or disable the DC/DC regulator for the regulator stage 1 (REG1). + * + * @param[in] dcdc_mode The mode of the DCDC, see @ref NRF_POWER_DCDC_MODES. + * + * @retval ::NRF_SUCCESS + * @retval ::NRF_ERROR_INVALID_PARAM The DCDC mode is invalid. + */ +SVCALL(SD_POWER_DCDC_MODE_SET, uint32_t, sd_power_dcdc_mode_set(uint8_t dcdc_mode)); + +/**@brief Enable or disable the DC/DC regulator for the regulator stage 0 (REG0). + * + * For more details on the REG0 stage, please see product specification. + * + * @param[in] dcdc_mode The mode of the DCDC0, see @ref NRF_POWER_DCDC_MODES. + * + * @retval ::NRF_SUCCESS + * @retval ::NRF_ERROR_INVALID_PARAM The dcdc_mode is invalid. + */ +SVCALL(SD_POWER_DCDC0_MODE_SET, uint32_t, sd_power_dcdc0_mode_set(uint8_t dcdc_mode)); + +/**@brief Request the high frequency crystal oscillator. + * + * Will start the high frequency crystal oscillator, the startup time of the crystal varies + * and the ::sd_clock_hfclk_is_running function can be polled to check if it has started. + * + * @see sd_clock_hfclk_is_running + * @see sd_clock_hfclk_release + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_CLOCK_HFCLK_REQUEST, uint32_t, sd_clock_hfclk_request(void)); + +/**@brief Releases the high frequency crystal oscillator. + * + * Will stop the high frequency crystal oscillator, this happens immediately. + * + * @see sd_clock_hfclk_is_running + * @see sd_clock_hfclk_request + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_CLOCK_HFCLK_RELEASE, uint32_t, sd_clock_hfclk_release(void)); + +/**@brief Checks if the high frequency crystal oscillator is running. + * + * @see sd_clock_hfclk_request + * @see sd_clock_hfclk_release + * + * @param[out] p_is_running 1 if the external crystal oscillator is running, 0 if not. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_CLOCK_HFCLK_IS_RUNNING, uint32_t, sd_clock_hfclk_is_running(uint32_t * p_is_running)); + +/**@brief Waits for an application event. + * + * An application event is either an application interrupt or a pended interrupt when the interrupt + * is disabled. + * + * When the application waits for an application event by calling this function, an interrupt that + * is enabled will be taken immediately on pending since this function will wait in thread mode, + * then the execution will return in the application's main thread. + * + * In order to wake up from disabled interrupts, the SEVONPEND flag has to be set in the Cortex-M + * MCU's System Control Register (SCR), CMSIS_SCB. In that case, when a disabled interrupt gets + * pended, this function will return to the application's main thread. + * + * @note The application must ensure that the pended flag is cleared using ::sd_nvic_ClearPendingIRQ + * in order to sleep using this function. This is only necessary for disabled interrupts, as + * the interrupt handler will clear the pending flag automatically for enabled interrupts. + * + * @note If an application interrupt has happened since the last time sd_app_evt_wait was + * called this function will return immediately and not go to sleep. This is to avoid race + * conditions that can occur when a flag is updated in the interrupt handler and processed + * in the main loop. + * + * @post An application interrupt has happened or a interrupt pending flag is set. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_APP_EVT_WAIT, uint32_t, sd_app_evt_wait(void)); + +/**@brief Get PPI channel enable register contents. + * + * @param[out] p_channel_enable The contents of the PPI CHEN register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_CHANNEL_ENABLE_GET, uint32_t, sd_ppi_channel_enable_get(uint32_t * p_channel_enable)); + +/**@brief Set PPI channel enable register. + * + * @param[in] channel_enable_set_msk Mask containing the bits to set in the PPI CHEN register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_CHANNEL_ENABLE_SET, uint32_t, sd_ppi_channel_enable_set(uint32_t channel_enable_set_msk)); + +/**@brief Clear PPI channel enable register. + * + * @param[in] channel_enable_clr_msk Mask containing the bits to clear in the PPI CHEN register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_CHANNEL_ENABLE_CLR, uint32_t, sd_ppi_channel_enable_clr(uint32_t channel_enable_clr_msk)); + +/**@brief Assign endpoints to a PPI channel. + * + * @param[in] channel_num Number of the PPI channel to assign. + * @param[in] evt_endpoint Event endpoint of the PPI channel. + * @param[in] task_endpoint Task endpoint of the PPI channel. + * + * @retval ::NRF_ERROR_SOC_PPI_INVALID_CHANNEL The channel number is invalid. + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_CHANNEL_ASSIGN, uint32_t, sd_ppi_channel_assign(uint8_t channel_num, const volatile void * evt_endpoint, const volatile void * task_endpoint)); + +/**@brief Task to enable a channel group. + * + * @param[in] group_num Number of the channel group. + * + * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_GROUP_TASK_ENABLE, uint32_t, sd_ppi_group_task_enable(uint8_t group_num)); + +/**@brief Task to disable a channel group. + * + * @param[in] group_num Number of the PPI group. + * + * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid. + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_GROUP_TASK_DISABLE, uint32_t, sd_ppi_group_task_disable(uint8_t group_num)); + +/**@brief Assign PPI channels to a channel group. + * + * @param[in] group_num Number of the channel group. + * @param[in] channel_msk Mask of the channels to assign to the group. + * + * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid. + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_GROUP_ASSIGN, uint32_t, sd_ppi_group_assign(uint8_t group_num, uint32_t channel_msk)); + +/**@brief Gets the PPI channels of a channel group. + * + * @param[in] group_num Number of the channel group. + * @param[out] p_channel_msk Mask of the channels assigned to the group. + * + * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid. + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_GROUP_GET, uint32_t, sd_ppi_group_get(uint8_t group_num, uint32_t * p_channel_msk)); + +/**@brief Configures the Radio Notification signal. + * + * @note + * - The notification signal latency depends on the interrupt priority settings of SWI used + * for notification signal. + * - To ensure that the radio notification signal behaves in a consistent way, the radio + * notifications must be configured when there is no protocol stack or other SoftDevice + * activity in progress. It is recommended that the radio notification signal is + * configured directly after the SoftDevice has been enabled. + * - In the period between the ACTIVE signal and the start of the Radio Event, the SoftDevice + * will interrupt the application to do Radio Event preparation. + * - Using the Radio Notification feature may limit the bandwidth, as the SoftDevice may have + * to shorten the connection events to have time for the Radio Notification signals. + * + * @param[in] type Type of notification signal, see @ref NRF_RADIO_NOTIFICATION_TYPES. + * @ref NRF_RADIO_NOTIFICATION_TYPE_NONE shall be used to turn off radio + * notification. Using @ref NRF_RADIO_NOTIFICATION_DISTANCE_NONE is + * recommended (but not required) to be used with + * @ref NRF_RADIO_NOTIFICATION_TYPE_NONE. + * + * @param[in] distance Distance between the notification signal and start of radio activity, see @ref NRF_RADIO_NOTIFICATION_DISTANCES. + * This parameter is ignored when @ref NRF_RADIO_NOTIFICATION_TYPE_NONE or + * @ref NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE is used. + * + * @retval ::NRF_ERROR_INVALID_PARAM The group number is invalid. + * @retval ::NRF_ERROR_INVALID_STATE A protocol stack or other SoftDevice is running. Stop all + * running activities and retry. + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_RADIO_NOTIFICATION_CFG_SET, uint32_t, sd_radio_notification_cfg_set(uint8_t type, uint8_t distance)); + +/**@brief Encrypts a block according to the specified parameters. + * + * 128-bit AES encryption. + * + * @note: + * - The application may set the SEVONPEND bit in the SCR to 1 to make the SoftDevice sleep while + * the ECB is running. The SEVONPEND bit should only be cleared (set to 0) from application + * main or low interrupt level. + * + * @param[in, out] p_ecb_data Pointer to the ECB parameters' struct (two input + * parameters and one output parameter). + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_ECB_BLOCK_ENCRYPT, uint32_t, sd_ecb_block_encrypt(nrf_ecb_hal_data_t * p_ecb_data)); + +/**@brief Encrypts multiple data blocks provided as an array of data block structures. + * + * @details: Performs 128-bit AES encryption on multiple data blocks + * + * @note: + * - The application may set the SEVONPEND bit in the SCR to 1 to make the SoftDevice sleep while + * the ECB is running. The SEVONPEND bit should only be cleared (set to 0) from application + * main or low interrupt level. + * + * @param[in] block_count Count of blocks in the p_data_blocks array. + * @param[in,out] p_data_blocks Pointer to the first entry in a contiguous array of + * @ref nrf_ecb_hal_data_block_t structures. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_ECB_BLOCKS_ENCRYPT, uint32_t, sd_ecb_blocks_encrypt(uint8_t block_count, nrf_ecb_hal_data_block_t * p_data_blocks)); + +/**@brief Gets any pending events generated by the SoC API. + * + * The application should keep calling this function to get events, until ::NRF_ERROR_NOT_FOUND is returned. + * + * @param[out] p_evt_id Set to one of the values in @ref NRF_SOC_EVTS, if any events are pending. + * + * @retval ::NRF_SUCCESS An event was pending. The event id is written in the p_evt_id parameter. + * @retval ::NRF_ERROR_NOT_FOUND No pending events. + */ +SVCALL(SD_EVT_GET, uint32_t, sd_evt_get(uint32_t * p_evt_id)); + +/**@brief Get the temperature measured on the chip + * + * This function will block until the temperature measurement is done. + * It takes around 50 us from call to return. + * + * @param[out] p_temp Result of temperature measurement. Die temperature in 0.25 degrees Celsius. + * + * @retval ::NRF_SUCCESS A temperature measurement was done, and the temperature was written to temp + */ +SVCALL(SD_TEMP_GET, uint32_t, sd_temp_get(int32_t * p_temp)); + +/**@brief Flash Write +* +* Commands to write a buffer to flash +* +* If the SoftDevice is enabled: +* This call initiates the flash access command, and its completion will be communicated to the +* application with exactly one of the following events: +* - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed. +* - @ref NRF_EVT_FLASH_OPERATION_ERROR - The command could not be started. +* +* If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the + * write has been completed +* +* @note +* - This call takes control over the radio and the CPU during flash erase and write to make sure that +* they will not interfere with the flash access. This means that all interrupts will be blocked +* for a predictable time (depending on the NVMC specification in the device's Product Specification +* and the command parameters). +* - The data in the p_src buffer should not be modified before the @ref NRF_EVT_FLASH_OPERATION_SUCCESS +* or the @ref NRF_EVT_FLASH_OPERATION_ERROR have been received if the SoftDevice is enabled. +* - This call will make the SoftDevice trigger a hardfault when the page is written, if it is +* protected. +* +* +* @param[in] p_dst Pointer to start of flash location to be written. +* @param[in] p_src Pointer to buffer with data to be written. +* @param[in] size Number of 32-bit words to write. Maximum size is the number of words in one +* flash page. See the device's Product Specification for details. +* +* @retval ::NRF_ERROR_INVALID_ADDR Tried to write to a non existing flash address, or p_dst or p_src was unaligned. +* @retval ::NRF_ERROR_BUSY The previous command has not yet completed. +* @retval ::NRF_ERROR_INVALID_LENGTH Size was 0, or higher than the maximum allowed size. +* @retval ::NRF_ERROR_FORBIDDEN Tried to write to an address outside the application flash area. +* @retval ::NRF_SUCCESS The command was accepted. +*/ +SVCALL(SD_FLASH_WRITE, uint32_t, sd_flash_write(uint32_t * p_dst, uint32_t const * p_src, uint32_t size)); + + +/**@brief Flash Erase page +* +* Commands to erase a flash page +* If the SoftDevice is enabled: +* This call initiates the flash access command, and its completion will be communicated to the +* application with exactly one of the following events: +* - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed. +* - @ref NRF_EVT_FLASH_OPERATION_ERROR - The command could not be started. +* +* If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the +* erase has been completed +* +* @note +* - This call takes control over the radio and the CPU during flash erase and write to make sure that +* they will not interfere with the flash access. This means that all interrupts will be blocked +* for a predictable time (depending on the NVMC specification in the device's Product Specification +* and the command parameters). +* - This call will make the SoftDevice trigger a hardfault when the page is erased, if it is +* protected. +* +* +* @param[in] page_number Page number of the page to erase +* +* @retval ::NRF_ERROR_INTERNAL If a new session could not be opened due to an internal error. +* @retval ::NRF_ERROR_INVALID_ADDR Tried to erase to a non existing flash page. +* @retval ::NRF_ERROR_BUSY The previous command has not yet completed. +* @retval ::NRF_ERROR_FORBIDDEN Tried to erase a page outside the application flash area. +* @retval ::NRF_SUCCESS The command was accepted. +*/ +SVCALL(SD_FLASH_PAGE_ERASE, uint32_t, sd_flash_page_erase(uint32_t page_number)); + + + +/**@brief Opens a session for radio timeslot requests. + * + * @note Only one session can be open at a time. + * @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) will be called when the radio timeslot + * starts. From this point the NRF_RADIO and NRF_TIMER0 peripherals can be freely accessed + * by the application. + * @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0) is called whenever the NRF_TIMER0 + * interrupt occurs. + * @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO) is called whenever the NRF_RADIO + * interrupt occurs. + * @note p_radio_signal_callback() will be called at ARM interrupt priority level 0. This + * implies that none of the sd_* API calls can be used from p_radio_signal_callback(). + * + * @param[in] p_radio_signal_callback The signal callback. + * + * @retval ::NRF_ERROR_INVALID_ADDR p_radio_signal_callback is an invalid function pointer. + * @retval ::NRF_ERROR_BUSY If session cannot be opened. + * @retval ::NRF_ERROR_INTERNAL If a new session could not be opened due to an internal error. + * @retval ::NRF_SUCCESS Otherwise. + */ + SVCALL(SD_RADIO_SESSION_OPEN, uint32_t, sd_radio_session_open(nrf_radio_signal_callback_t p_radio_signal_callback)); + +/**@brief Closes a session for radio timeslot requests. + * + * @note Any current radio timeslot will be finished before the session is closed. + * @note If a radio timeslot is scheduled when the session is closed, it will be canceled. + * @note The application cannot consider the session closed until the @ref NRF_EVT_RADIO_SESSION_CLOSED + * event is received. + * + * @retval ::NRF_ERROR_FORBIDDEN If session not opened. + * @retval ::NRF_ERROR_BUSY If session is currently being closed. + * @retval ::NRF_SUCCESS Otherwise. + */ + SVCALL(SD_RADIO_SESSION_CLOSE, uint32_t, sd_radio_session_close(void)); + +/**@brief Requests a radio timeslot. + * + * @note The request type is determined by p_request->request_type, and can be one of @ref NRF_RADIO_REQ_TYPE_EARLIEST + * and @ref NRF_RADIO_REQ_TYPE_NORMAL. The first request in a session must always be of type @ref NRF_RADIO_REQ_TYPE_EARLIEST. + * @note For a normal request (@ref NRF_RADIO_REQ_TYPE_NORMAL), the start time of a radio timeslot is specified by + * p_request->distance_us and is given relative to the start of the previous timeslot. + * @note A too small p_request->distance_us will lead to a @ref NRF_EVT_RADIO_BLOCKED event. + * @note Timeslots scheduled too close will lead to a @ref NRF_EVT_RADIO_BLOCKED event. + * @note See the SoftDevice Specification for more on radio timeslot scheduling, distances and lengths. + * @note If an opportunity for the first radio timeslot is not found before 100 ms after the call to this + * function, it is not scheduled, and instead a @ref NRF_EVT_RADIO_BLOCKED event is sent. + * The application may then try to schedule the first radio timeslot again. + * @note Successful requests will result in nrf_radio_signal_callback_t(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START). + * Unsuccessful requests will result in a @ref NRF_EVT_RADIO_BLOCKED event, see @ref NRF_SOC_EVTS. + * @note The jitter in the start time of the radio timeslots is +/- @ref NRF_RADIO_START_JITTER_US us. + * @note The nrf_radio_signal_callback_t(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) call has a latency relative to the + * specified radio timeslot start, but this does not affect the actual start time of the timeslot. + * @note NRF_TIMER0 is reset at the start of the radio timeslot, and is clocked at 1MHz from the high frequency + * (16 MHz) clock source. If p_request->hfclk_force_xtal is true, the high frequency clock is + * guaranteed to be clocked from the external crystal. + * @note The SoftDevice will neither access the NRF_RADIO peripheral nor the NRF_TIMER0 peripheral + * during the radio timeslot. + * + * @param[in] p_request Pointer to the request parameters. + * + * @retval ::NRF_ERROR_FORBIDDEN Either: + * - The session is not open. + * - The session is not IDLE. + * - This is the first request and its type is not @ref NRF_RADIO_REQ_TYPE_EARLIEST. + * - The request type was set to @ref NRF_RADIO_REQ_TYPE_NORMAL after a + * @ref NRF_RADIO_REQ_TYPE_EARLIEST request was blocked. + * @retval ::NRF_ERROR_INVALID_ADDR If the p_request pointer is invalid. + * @retval ::NRF_ERROR_INVALID_PARAM If the parameters of p_request are not valid. + * @retval ::NRF_SUCCESS Otherwise. + */ + SVCALL(SD_RADIO_REQUEST, uint32_t, sd_radio_request(nrf_radio_request_t const * p_request)); + +/**@brief Write register protected by the SoftDevice + * + * This function writes to a register that is write-protected by the SoftDevice. Please refer to your + * SoftDevice Specification for more details about which registers that are protected by SoftDevice. + * This function can write to the following protected peripheral: + * - ACL + * + * @note Protected registers may be read directly. + * @note Register that are write-once will return @ref NRF_SUCCESS on second set, even the value in + * the register has not changed. See the Product Specification for more details about register + * properties. + * + * @param[in] p_register Pointer to register to be written. + * @param[in] value Value to be written to the register. + * + * @retval ::NRF_ERROR_INVALID_ADDR This function can not write to the reguested register. + * @retval ::NRF_SUCCESS Value successfully written to register. + * + */ +SVCALL(SD_PROTECTED_REGISTER_WRITE, uint32_t, sd_protected_register_write(volatile uint32_t * p_register, uint32_t value)); + +/**@} */ + +#ifdef __cplusplus +} +#endif +#endif // NRF_SOC_H__ + +/**@} */ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h new file mode 100644 index 0000000000..231a54f941 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2012 - 2019, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef NRF_SVC__ +#define NRF_SVC__ + +#include "stdint.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @brief Supervisor call declaration. + * + * A call to a function marked with @ref SVCALL, will trigger a Supervisor Call (SVC) Exception. + * The SVCs with SVC numbers 0x00-0x0F are forwared to the application. All other SVCs are handled by the SoftDevice. + * + * @param[in] number The SVC number to be used. + * @param[in] return_type The return type of the SVC function. + * @param[in] signature Function signature. The function can have at most four arguments. + */ + +#ifdef SVCALL_AS_NORMAL_FUNCTION +#define SVCALL(number, return_type, signature) return_type signature +#else + +#ifndef SVCALL +#if defined (__CC_ARM) +#define SVCALL(number, return_type, signature) return_type __svc(number) signature +#elif defined (__GNUC__) +#ifdef __cplusplus +#define GCC_CAST_CPP (uint16_t) +#else +#define GCC_CAST_CPP +#endif +#define SVCALL(number, return_type, signature) \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \ + __attribute__((naked)) \ + __attribute__((unused)) \ + static return_type signature \ + { \ + __asm( \ + "svc %0\n" \ + "bx r14" : : "I" (GCC_CAST_CPP number) : "r0" \ + ); \ + } \ + _Pragma("GCC diagnostic pop") + +#elif defined (__ICCARM__) +#define PRAGMA(x) _Pragma(#x) +#define SVCALL(number, return_type, signature) \ +PRAGMA(swi_number = (number)) \ + __swi return_type signature; +#else +#define SVCALL(number, return_type, signature) return_type signature +#endif +#endif // SVCALL + +#endif // SVCALL_AS_NORMAL_FUNCTION + +#ifdef __cplusplus +} +#endif +#endif // NRF_SVC__ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_license-agreement.txt b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_license-agreement.txt new file mode 100644 index 0000000000..9225328db0 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_license-agreement.txt @@ -0,0 +1,35 @@ +Copyright (c) 2007 - 2019, Nordic Semiconductor ASA +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form, except as embedded into a Nordic + Semiconductor ASA integrated circuit in a product or a software update for + such product, must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other + materials provided with the distribution. + +3. Neither the name of Nordic Semiconductor ASA nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +4. This software, with or without modification, must only be used with a + Nordic Semiconductor ASA integrated circuit. + +5. Any software provided in binary form under this license must not be reverse + engineered, decompiled, modified and/or disassembled. + +THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_migration-document.pdf b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_migration-document.pdf new file mode 100644 index 0000000000..350288c771 Binary files /dev/null and b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_migration-document.pdf differ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_release-notes-update-2.pdf b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_release-notes-update-2.pdf new file mode 100644 index 0000000000..37bb1b8b08 Binary files /dev/null and b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_release-notes-update-2.pdf differ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_softdevice.hex b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_softdevice.hex new file mode 100644 index 0000000000..3c5fc95be1 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_softdevice.hex @@ -0,0 +1,9742 @@ +:020000040000FA +:1000000000040020810A000015070000610A0000BA +:100010001F07000029070000330700000000000050 +:10002000000000000000000000000000A50A000021 +:100030003D070000000000004707000051070000D6 +:100040005B070000650700006F07000079070000EC +:10005000830700008D07000097070000A10700003C +:10006000AB070000B5070000BF070000C90700008C +:10007000D3070000DD070000E7070000F1070000DC +:10008000FB070000050800000F0800001908000029 +:10009000230800002D080000370800004108000078 +:1000A0004B080000550800005F08000069080000C8 +:1000B000730800007D080000870800009108000018 +:1000C0009B080000A5080000AF080000B908000068 +:1000D000C3080000CD080000D7080000E1080000B8 +:1000E000EB080000F5080000FF0800000909000007 +:1000F000130900001D090000270900003109000054 +:100100003B0900001FB500F003F88DE80F001FBD8C +:1001100000F0ACBC40F6FC7108684FF01022401CA7 +:1001200008D00868401C09D00868401C04D0086842 +:1001300000F037BA9069F5E79069F9E7704770B554 +:100140000B46010B184400F6FF70040B4FF0805073 +:100150000022090303692403406943431D1B104621 +:1001600000F048FA29462046BDE8704000F042BA47 +:10017000F0B54FF6FF734FF4B4751A466E1E11E0DA +:10018000A94201D3344600E00C46091B30F8027B3B +:10019000641E3B441A44F9D19CB204EB134394B25D +:1001A00004EB12420029EBD198B200EB134002EBB2 +:1001B000124140EA0140F0BDF34992B00446D1E952 +:1001C0000001CDE91001FF224021684600F0F4FB58 +:1001D00094E80F008DE80F00684610A902E004C8FB +:1001E00041F8042D8842FAD110216846FFF7C0FF7C +:1001F0001090AA208DF8440000F099F9FFF78AFFCB +:1002000040F6FC7420684FF01025401C0FD0206889 +:1002100010226946803000F078F92068401C08D030 +:100220002068082210A900F070F900F061F9A869AF +:10023000EEE7A869F5E74FF080500369406940F6A2 +:10024000FC71434308684FF01022401C06D0086838 +:1002500000F58050834203D2092070479069F7E788 +:100260000868401C04D00868401C03D00020704778 +:100270009069F9E70420704770B504460068C34DE3 +:10028000072876D2DFE800F033041929631E250021 +:10029000D4E9026564682946304600F062F92A46CE +:1002A0002146304600F031F9AA002146304600F0E0 +:1002B00057FB002800D0032070BD00F009FC4FF46C +:1002C000805007E0201D00F040F90028F4D100F034 +:1002D000FFFB60682860002070BD241D94E80700C3 +:1002E000920000F03DFB0028F6D00E2070BDFFF715 +:1002F000A2FF0028FAD1D4E901034FF0805100EBAE +:10030000830208694D69684382420ED840F6F8704E +:1003100005684FF010226D1C09D0056805EB8305B8 +:100320000B6949694B439D4203D9092070BD55694A +:10033000F4E70168491C03D00068401C02D003E0C8 +:100340005069FAE70F2070BD2046FFF735FFFFF731 +:1003500072FF0028F7D1201D00F0F7F80028F2D135 +:1003600060680028F0D100F0E2F8FFF7D3FE00F05B +:10037000BFF8072070BD10B50C46182802D0012028 +:10038000086010BD2068FFF777FF206010BD41684E +:10039000054609B1012700E0002740F6F8742068FF +:1003A0004FF01026401C2BD02068AA68920000F065 +:1003B000D7FA38B3A86881002068401C27D020688D +:1003C000FFF7BDFED7B12068401C22D026684FF051 +:1003D0008050AC686D68016942695143A9420DD9EA +:1003E000016940694143A14208D92146304600F0E5 +:1003F000B8F822462946304600F087F800F078F831 +:100400007069D2E700F093F8FFF784FEF6E77069B1 +:10041000D6E77669DBE740F6FC7420684FF01026DB +:10042000401C23D02068401C0CD02068401C1FD0EA +:100430002568206805F18005401C1BD027683879A5 +:10044000AA2819D040F6F8700168491C42D001680A +:10045000491C45D00168491C3ED001680968491C07 +:100460003ED00168491C39D000683EE0B069DAE747 +:10047000B569DEE7B769E2E710212846FFF778FEA5 +:100480003968814222D12068401C05D0D4F8001080 +:1004900001F18002C03107E0B169F9E730B108CA63 +:1004A00051F8040D984201D1012000E000208A4259 +:1004B000F4D158B1286810B1042803D0FEE72846CB +:1004C000FFF765FF3149686808600EE0FFF722FE1C +:1004D00000F00EF87169BBE77169BFE7706904E06D +:1004E0004FF480500168491C01D000F0CBFAFEE7C0 +:1004F000BFF34F8F26480168264A01F4E06111439B +:100500000160BFF34F8F00BFFDE72DE9F0411746B3 +:100510000D460646002406E03046296800F054F8EF +:10052000641C2D1D361DBC42F6D3BDE8F08140F69B +:10053000FC700168491C04D0D0F800004FF48051D1 +:10054000FDE54FF010208069F8E74FF080510A690F +:10055000496900684A43824201D810207047002050 +:10056000704770B50C4605464FF4806608E0284693 +:1005700000F017F8B44205D3A4F5806405F5805562 +:10058000002CF4D170BD0000F40A0000000000202F +:100590000CED00E00400FA05144801680029FCD0C5 +:1005A0007047134A0221116010490B68002BFCD0E0 +:1005B0000F4B1B1D186008680028FCD0002010603D +:1005C00008680028FCD07047094B10B501221A605A +:1005D000064A1468002CFCD0016010680028FCD08A +:1005E0000020186010680028FCD010BD00E4014015 +:1005F00004E5014070B50C46054600F073F810B9EB +:1006000000F07EF828B121462846BDE8704000F091 +:1006100007B821462846BDE8704000F037B8000012 +:100620007FB5002200920192029203920A0B000B06 +:100630006946012302440AE0440900F01F0651F80C +:10064000245003FA06F6354341F82450401C8242F8 +:10065000F2D80D490868009A10430860081D016827 +:10066000019A1143016000F03DF800280AD00649C4 +:1006700010310868029A10430860091D0868039A3F +:10068000104308607FBD00000006004030B50F4CED +:10069000002200BF04EB0213D3F800582DB9D3F8A1 +:1006A000045815B9D3F808581DB1521C082AF1D3C3 +:1006B00030BD082AFCD204EB0212C2F80008C3F8CD +:1006C00004180220C3F8080830BD000000E0014013 +:1006D0004FF08050D0F83001082801D0002070473A +:1006E000012070474FF08050D0F83011062905D016 +:1006F000D0F83001401C01D0002070470120704725 +:100700004FF08050D0F830010A2801D00020704707 +:100710000120704708208F490968095808471020B0 +:100720008C4909680958084714208A4909680958FA +:100730000847182087490968095808473020854923 +:100740000968095808473820824909680958084744 +:100750003C20804909680958084740207D490968BC +:100760000958084744207B49096809580847482028 +:1007700078490968095808474C207649096809589A +:10078000084750207349096809580847542071499F +:1007900009680958084758206E49096809580847E8 +:1007A0005C206C4909680958084760206949096854 +:1007B00009580847642067490968095808476820AC +:1007C00064490968095808476C2062490968095852 +:1007D000084770205F4909680958084774205D4937 +:1007E00009680958084778205A490968095808478C +:1007F0007C205849096809580847802055490968EC +:10080000095808478420534909680958084788202F +:1008100050490968095808478C204E490968095809 +:10082000084790204B4909680958084794204949CE +:10083000096809580847982046490968095808472F +:100840009C204449096809580847A0204149096883 +:1008500009580847A4203F49096809580847A820B3 +:100860003C49096809580847AC203A4909680958C1 +:100870000847B0203749096809580847B420354966 +:10088000096809580847B8203249096809580847D3 +:10089000BC203049096809580847C0202D4909681B +:1008A00009580847C4202B49096809580847C82037 +:1008B0002849096809580847CC2026490968095879 +:1008C0000847D0202349096809580847D4202149FE +:1008D000096809580847D8201E4909680958084777 +:1008E000DC201C49096809580847E02019490968B3 +:1008F00009580847E4201749096809580847E820BB +:100900001449096809580847EC2012490968095830 +:100910000847F0200F49096809580847F4200D4995 +:10092000096809580847F8200A490968095808471A +:10093000FC2008490968095808475FF48070054998 +:10094000096809580847000003480449024A034B54 +:100950007047000000000020000B0000000B0000AA +:1009600040EA010310B59B070FD1042A0DD310C82C +:1009700008C9121F9C42F8D020BA19BA884201D97E +:10098000012010BD4FF0FF3010BD1AB1D30703D0C6 +:10099000521C07E0002010BD10F8013B11F8014B7C +:1009A0001B1B07D110F8013B11F8014B1B1B01D198 +:1009B000921EF1D1184610BD02F0FF0343EA032254 +:1009C00042EA024200F005B87047704770474FF0A6 +:1009D00000020429C0F0128010F0030C00F01B800C +:1009E000CCF1040CBCF1020F18BF00F8012BA8BF1A +:1009F00020F8022BA1EB0C0100F00DB85FEAC17CDE +:100A000024BF00F8012B00F8012B48BF00F8012B90 +:100A100070474FF0000200B51346944696462039C1 +:100A200022BFA0E80C50A0E80C50B1F12001BFF4A7 +:100A3000F7AF090728BFA0E80C5048BF0CC05DF80D +:100A400004EB890028BF40F8042B08BF704748BF5B +:100A500020F8022B11F0804F18BF00F8012B7047CF +:100A6000014B1B68DB6818470000002009480A4951 +:100A70007047FFF7FBFFFFF745FB00BD20BFFDE719 +:100A8000064B1847064A1060016881F308884068E1 +:100A900000470000000B0000000B000017040000DE +:100AA000000000201EF0040F0CBFEFF30881EFF3ED +:100AB0000981886902380078182803D100E0000015 +:100AC000074A1047074A12682C3212681047000084 +:100AD00000B5054B1B68054A9B58984700BD0000B0 +:100AE0007703000000000020F00A0000040000006E +:100AF000001000000000000000FFFFFF0090D00386 +:10100000C8130020415F020075C10000A75E020006 +:1010100075C1000075C1000075C10000000000002E +:10102000000000000000000000000000CD5F020092 +:1010300075C100000000000075C1000075C100000E +:10104000356002003B60020075C1000075C1000000 +:1010500075C1000075C1000075C1000075C10000B8 +:101060004160020075C1000075C1000047600200C8 +:1010700075C100004D60020053600200596002001B +:1010800075C1000075C1000075C1000075C1000088 +:1010900075C1000075C1000075C1000075C1000078 +:1010A00075C100005F60020075C1000075C10000DD +:1010B00075C1000075C1000075C1000075C1000058 +:1010C0006560020075C1000075C1000075C10000B7 +:1010D00075C1000075C1000075C1000075C1000038 +:1010E00075C1000075C1000075C1000075C1000028 +:1010F00075C1000075C1000075C1000075C1000018 +:1011000075C1000075C1000000F002F824F007FF6F +:101110000AA090E8000C82448344AAF10107DA4552 +:1011200001D124F0FCFEAFF2090EBAE80F0013F073 +:10113000010F18BFFB1A43F00103184708540200BF +:10114000285402000A444FF0000C10F8013B13F041 +:10115000070408BF10F8014B1D1108BF10F8015B10 +:10116000641E05D010F8016B641E01F8016BF9D103 +:1011700013F0080F1EBF10F8014BAD1C0C1B09D15A +:101180006D1E58BF01F801CBFAD505E014F8016BCC +:1011900001F8016B6D1EF9D59142D6D3704700005E +:1011A0000023002400250026103A28BF78C1FBD870 +:1011B000520728BF30C148BF0B6070471FB500F011 +:1011C00003F88DE80F001FBD24F0A6BE70B51A4CC1 +:1011D00005460A202070A01C00F0D5F85920A080F8 +:1011E00029462046BDE8704008F09AB908F0A3B936 +:1011F00070B50C461149097829B1A0F160015E294A +:1012000008D3012013E0602804D0692802D043F2FB +:1012100001000CE020CC0A4E94E80E0006EB8000A2 +:10122000A0F58050241FD0F8806E2846B04720607B +:1012300070BD012070470000080000201800002049 +:10124000B06002003249884201D20120704700207C +:10125000704770B50446A0F500002E4EB0F1786FCF +:1012600002D23444A4F500042948844201D2012565 +:1012700000E0002500F043F848B125B9B44204D39A +:101280002548006808E0012070BD002070BD002DD9 +:10129000F9D1B442F9D321488442F6D2F3E710B52C +:1012A0000446A0F50000B0F1786F03D21948044459 +:1012B000A4F5000400F023F84FF0804130B1164847 +:1012C000006804E08C4204D2012003E01348844209 +:1012D000F8D2002080F0010010BD10B520B1FFF75A +:1012E000DEFF08B1012010BD002010BD10B520B1F7 +:1012F000FFF7AFFF08B1012010BD002010BD084866 +:1013000008490068884201D10120704700207047D9 +:1013100000700200000000201C00002008000020D7 +:1013200058000020BEBAFECA10B5044600210120B4 +:1013300000F041F800210B2000F03DF800210820CA +:1013400000F039F80421192000F035F804210D20AF +:1013500000F031F804210E2000F02DF804210F20B8 +:1013600000F029F80421C84300F025F806211620D2 +:1013700000F021F80621152000F01DF82046FFF7A7 +:1013800025FF002010BDCA2101807047FFF72EBF46 +:101390001148704710487047104A10B514680F4B39 +:1013A0000F4A08331A60FFF723FF0C48001D046042 +:1013B00010BD704770474907090E002804DB00F193 +:1013C000E02080F80014704700F00F0000F1E020EA +:1013D00080F8141D7047000003F900421005024018 +:1013E00001000001FD48002101604160018170475A +:1013F0002DE9FF4F93B09B46209F160004460DD069 +:101400001046FFF726FF18B1102017B0BDE8F08F87 +:101410003146012001F0D3FE0028F6D101258DF8D8 +:1014200042504FF4C050ADF84000002210A92846A9 +:1014300006F0D8FC0028E8D18DF84250A8464FF4B9 +:1014400028500025ADF840001C2229466846079523 +:101450000DF015F89DF81C000DF11C0A20F00F008E +:10146000401C20F0F00010308DF81C0020788DF822 +:101470001D0061789DF81E000DF1400961F34200E6 +:1014800040F001008DF81E009DF8000008AA40F011 +:1014900002008DF800002089ADF83000ADF8325020 +:1014A0006089ADF83400CDF82CA060680E900AA9D0 +:1014B000CDF82890684606F08AFA0028A5D1606821 +:1014C000FFF70BFF40B16068FFF710FF20B96078AD +:1014D00000F00300022801D0012000E00020BF4CF2 +:1014E00008AA0AA92072BDF8200020808DF8428049 +:1014F00042F60120ADF840009DF81E0020F00600E5 +:10150000801C20F001008DF81E000220ADF8300094 +:10151000ADF8340014A80E90684606F058FA00287A +:1015200089D1BDF82000608036B1211D304600F021 +:101530005FF90028C2D109E0BBF1000F05D00CF023 +:1015400019FDE8BB0CF016FDD0BBA58017B1012F2B +:1015500043D04AE08DF8428042F6A620ADF8400024 +:1015600046461C220021684607950CF088FF9DF82E +:101570001C00ADF8346020F00F00401C20F0F0009B +:1015800010308DF81C009DF81D0020F0FF008DF834 +:101590001D009DF81E0020F0060040F00100801C98 +:1015A0008DF81E009DF800008DF8446040F00200A8 +:1015B0008DF80000CDE90A9AADF8306011A800E07E +:1015C00011E00E9008AA0AA9684606F000FA002861 +:1015D000A6D1BDF82000E08008E00CF0CBFC10B9EB +:1015E0000CF0C8FC08B103200FE7E58000200CE7F1 +:1015F0003EB50446794D0820ADF80000A88828B112 +:101600002046FFF726FE18B110203EBD06203EBD45 +:101610002146012001F0D3FD0028F8D12088ADF843 +:1016200004006088ADF80600A088ADF80800E088E6 +:10163000ADF80A00A88801AB6A46002106F0CEFD8D +:10164000BDF800100829E2D003203EBD7FB5634DF0 +:101650000446A88868B1002002900820ADF8080070 +:10166000CDF80CD02046FFF7F4FD20B1102004B0D7 +:1016700070BD0620FBE7A98802AA4FF6FF7006F0AE +:10168000EFFF0028F3D1BDF80810082901D003208E +:10169000EDE7BDF800102180BDF802106180BDF8B3 +:1016A0000410A180BDF80610E180E0E701B582B02A +:1016B0000220ADF80000494802AB6A46408800218C +:1016C00006F08CFDBDF80010022900D003200EBDED +:1016D0001CB5002100910221ADF800100190FFF728 +:1016E000DEFD08B110201CBD3C486A4641884FF61B +:1016F000FF7006F0B5FFBDF800100229F3D00320FB +:101700001CBDFEB5354C06461546207A0F46C0076F +:1017100005D00846FFF79DFD18B11020FEBD0F2033 +:10172000FEBDF82D01D90C20FEBD3046FFF791FD1E +:1017300018BB208801A905F04CFE0028F4D13078B0 +:101740008DF80500208801A906F026FD0028EBD1C0 +:1017500000909DF800009DF8051040F002008DF803 +:101760000000090703D040F008008DF80000208831 +:10177000694606F0AEFC0028D6D1ADF808502088A6 +:101780003B4602AA002106F029FDBDF80810A94237 +:10179000CAD00320FEBD7CB5054600200090019014 +:1017A0000888ADF800000C4628460195FFF795FD26 +:1017B00018B92046FFF773FD08B110207CBD15B1A4 +:1017C000BDF8000060B105486A4601884FF6FF7019 +:1017D00006F046FFBDF8001021807CBD28020020E5 +:1017E0000C20FAE72F48C088002800D0012070475D +:1017F00030B5044693B000200D46014600901422F7 +:1018000001A80CF03CFE1C22002108A80CF037FEB9 +:101810009DF80000CDF808D020F00F00401C20F00B +:10182000F00010308DF800009DF8010006AA20F0AD +:10183000FF008DF801009DF8200001A940F0020092 +:101840008DF8200001208DF8460042F60420ADF806 +:10185000440011A801902088ADF83C006088ADF8E4 +:101860003E00A088ADF84000E088ADF842009DF849 +:10187000020020F00600801C20F001008DF802001C +:101880000820ADF80C00ADF810000FA8059008A8CE +:1018900006F09DF8002803D1BDF81800288000202C +:1018A00013B030BD28020020F0B5007B059F1E4616 +:1018B00014460D46012800D0FFDF0C2030803A206E +:1018C0003880002C08D0287A032806D0287B0128ED +:1018D00000D0FFDF17206081F0BDA889FBE72DE96C +:1018E000F04786B0144691F80C900E9A0D46B9F167 +:1018F000010F0BD01021007B2E8A8846052807D0C7 +:10190000062833D0FFDF06B0BDE8F0870221F2E7FA +:10191000E8890C2100EB400001EB400018803320E7 +:101920001080002CEFD0E889608100271AE0009633 +:10193000688808F1020301AA696900F086FF06EBD6 +:101940000800801C07EB470186B204EB4102BDF89A +:10195000040090810DF1060140460E3213F096F816 +:101960007F1CBFB26089B842E1D8CCE73420108038 +:10197000E889B9F1010F11D0122148430E301880C7 +:10198000002CC0D0E88960814846B9F1010F00D031 +:101990000220207300270DF1040A1FE00621ECE766 +:1019A0000096688808F1020301AA696900F04DFFFA +:1019B00006EB0800801C86B2B9F1010F12D007EBCC +:1019C000C70004EB4000BDF80410C18110220AF1E9 +:1019D000020110300CF029FD7F1CBFB26089B842B3 +:1019E000DED890E707EB470104EB4102BDF80400A5 +:1019F000D0810AF102014046103213F047F8EBE7BC +:101A00002DE9F0470E4688B090F80CC096F80C808F +:101A1000378AF5890C20109902F10C044FF0000A66 +:101A2000BCF1030F08D0BCF1040F3FD0BCF1070F8D +:101A30007ED0FFDF08B067E705EB850C00EB4C00BC +:101A4000188031200880002AF4D0A8F1060000F0A8 +:101A5000FF09558126E01622002101A80CF00FFD98 +:101A600000977088434601AA716900F0EEFEBDF848 +:101A700004002080BDF80600E080BDF80800208149 +:101A8000A21C0DF10A01484613F000F8B9F1000F4D +:101A900000D018B184F804A0A4F802A007EB080055 +:101AA00087B20A346D1EADB2D5D2C3E705EB850C03 +:101AB00000EB4C00188032200880002ABAD0A8F130 +:101AC000050000F0FF09558137E000977088434614 +:101AD00001AA716900F0B9FE9DF80600BDF8041076 +:101AE000E1802179420860F3000162F3410182083C +:101AF00062F38201C20862F3C301020962F30411B6 +:101B0000420962F34511820962F386112171C0090D +:101B10006071BDF80700208122460DF10901484699 +:101B200012F0B4FF18B184F802A0A4F800A000E0FD +:101B300007E007EB080087B20A346D1EADB2C4D2CD +:101B400078E7A8F1020084B205FB08F000F10E0C62 +:101B5000A3F800C035230B80002AA6D055819481BC +:101B6000009783B270880E32716900F06EFE61E7F3 +:101B70002DE9F84F1E460A9D0C4681462AB1607A2F +:101B800000F58070D080E089108199F80C000C2756 +:101B90004FF000084FF00E0A0D2872D2DFE800F077 +:101BA0009D070E1B272F374554697272720021461C +:101BB00048460095FFF778FEBDE8F88F207B9146F8 +:101BC000082802D0032800D0FFDF3780302009E04A +:101BD000A9F80A80F0E7207B9146042800D0FFDFB7 +:101BE000378031202880B9F1000FF1D1E4E7207B64 +:101BF0009146042800D0FFDF37803220F2E7207BB7 +:101C00009146022800D0FFDF37803320EAE7207BAF +:101C10001746022800D0FFDF3420A6F800A0288055 +:101C2000002FC9D0A7F80A80C6E7207B17460428F2 +:101C300000D0FFDF3520A6F800A02880002FBBD001 +:101C40004046A7F80A8012E0207B1746052802D0FC +:101C5000062800D0FFDF1020308036202880002F9B +:101C6000AAD0E0897881A7F80E80B9F80E00B88173 +:101C7000A2E7207B9146072800D0FFDF378037207E +:101C8000B0E72AE04FF0120018804FF0380017003C +:101C9000288091D0E0897881A7F80E80A7F810807D +:101CA00099F80C000A2805D00B2809D00C280DD073 +:101CB000FFDF81E7207B0A2800D0FFDF01200AE058 +:101CC000207B0B2800D0FFDF042004E0207B0C28C1 +:101CD00000D0FFDF052038736EE7FFDF6CE770B5DB +:101CE0000C46054601F0AFFB20B10078222804D253 +:101CF000082070BD43F2020070BD0521284611F096 +:101D00002DF9206008B1002070BD032070BD30B4F3 +:101D10004880087820F00F00C01C20F0F0009030C0 +:101D200001F8080B1DCA81E81D0030BC07F079BC22 +:101D30002DE9FF4784B00027824602970798904616 +:101D4000894612300AF067FA401D20F00306079812 +:101D500028B907A95046FFF7C2FF002854D1B9F1AE +:101D6000000F05D00798017B19BB052504681BE00F +:101D700098F80000092803D00D2812D0FFDF46E0B4 +:101D8000079903254868B0B3497B42887143914263 +:101D900039D98AB2B3B2011D10F053FF044607804F +:101DA00002E0079C042508340CB1208810B1032DF3 +:101DB00029D02CE00798012112300AF05EFAADF824 +:101DC0000C00024602AB2946504608F0B6FA07005E +:101DD00001D1A01C029007983A461230C8F80400BE +:101DE000A8F802A003A94046029B0AF053FAD8B112 +:101DF0000A2817D200E006E0DFE800F00709141413 +:101E0000100B0D141412132014E6002012E61120FA +:101E100010E608200EE643F203000BE6072009E671 +:101E20000D2007E6032005E6BDF80C002346CDE9AA +:101E300000702A465046079900F017FD57B9032D48 +:101E400008D10798B3B2417B406871438AB2011D43 +:101E500010F00BFFB9F1000FD7D0079981F80C9063 +:101E6000D3E72DE9FE4F91461A881C468A468046E4 +:101E7000FAB102AB494608F060FA050019D04046B5 +:101E8000A61C278811F0AFF93246072629463B46A3 +:101E9000009610F0BCFD20882346CDE900504A464C +:101EA0005146404600F0E1FC002020800120BDE8C2 +:101EB000FE8F0020FBE710B586B01C46AAB10423B4 +:101EC0008DF800301388ADF808305288ADF80A203C +:101ED0008A788DF80E200988ADF80C1000236A4628 +:101EE0002146FFF725FF06B010BD1020FBE770B5B7 +:101EF0000D46052111F032F8040000D1FFDF29461C +:101F000004F11200BDE870400AF0A0B92DE9F843D1 +:101F10000D468046002607F081FB044628781028ED +:101F200078D2DFE800F0773B345331311231313170 +:101F30000831313131312879001FC0B2022801D077 +:101F4000102810D114BBFFDF35E004B9FFDF0521F5 +:101F5000404611F003F8007B032806D004280BD07C +:101F6000072828D0FFDF072655E02879801FC0B258 +:101F7000022820D050B1F6E72879401FC0B20228CD +:101F800019D0102817D0EEE704B9FFDF13E004B929 +:101F9000FFDF287901280ED1172137E005214046BF +:101FA00010F0DCFF070000D1FFDF07F1120140460F +:101FB0000AF029F92CB12A4621464046FFF7A7FE30 +:101FC00029E01321404602F025FD24E004B9FFDF9B +:101FD0000521404610F0C2FF060000D1FFDF694630 +:101FE00006F112000AF019F9060000D0FFDFA988F7 +:101FF000172901D2172200E00A46BDF800008242EC +:1020000002D9014602E005E01729C5D3404600F099 +:102010003CFCD0E7FFDF3046BDE8F883401D20F0F0 +:10202000030219B102FB01F0001D00E00020104482 +:10203000704713B5009848B10024684610F0ABFD16 +:10204000002C02D1F74A009911601CBD0124002028 +:10205000F4E72DE9F0470C461546242200212046DE +:102060000CF00DFA05B9FFDFA87860732888DFF857 +:10207000B4A3401D20F00301AF788946DAF80000D0 +:1020800010F0A7FD060000D1FFDF4FF0000826602A +:10209000A6F8008077B109FB07F1091D0AD0DAF82C +:1020A000000010F096FD060000D1FFDF6660C6F864 +:1020B000008001E0C4F80480298804F11200BDE822 +:1020C000F0470AF091B82DE9F047804601F112007F +:1020D0000D4681460AF09FF8401DD24F20F00302C2 +:1020E0006E7B14462968386810F09EFD3EB104FBF3 +:1020F00006F2121D03D06968386810F095FD0520BE +:1021000010F0D4FE0446052010F0D8FE201A012855 +:1021100002D1386810F052FD49464046BDE8F0470C +:102120000AF078B870B50546052110F017FF0400D5 +:1021300000D1FFDF04F112012846BDE870400AF02B +:1021400062B82DE9F04F91B04FF0000BADF834B00C +:10215000ADF804B047880C4605469246052138463E +:1021600010F0FCFE060000D1FFDF24B1A780A4F828 +:1021700006B0A4F808B0297809220B20B2EB111F91 +:102180007ED12A7A04F1100138274FF00C084FF065 +:1021900001090391102A74D2DFE802F073F3F2F11F +:1021A0008008D3898EA03DDCF4EFB7B7307B0228DE +:1021B00000D0FFDFA88908EBC001ADF80410302182 +:1021C000ADF83410002C25D06081B5F80E900027B2 +:1021D0001DE004EBC708317C88F80E10F189A8F8DF +:1021E0000C10CDF800906888042304AA296900F037 +:1021F0002CFBBDF81010A8F8101009F10400BDF870 +:1022000012107F1C1FFA80F9A8F81210BFB2608963 +:10221000B842DED80EE1307B022800D0FFDFE9892A +:1022200008EBC100ADF804003020ADF83400287B85 +:102230000A90001FC0B20F90002CEBD06181B5F85E +:102240001090002726E000BFCDF8009068886969EB +:1022500003AA0A9B00F0F9FA0A9804EBC70848445D +:102260001FFA80F908F10C0204A90F9812F00EFC75 +:1022700018B188F80EB0A8F80CB0BDF80C1001E049 +:10228000D4E0D1E0A8F81010BDF80E107F1CA8F81B +:102290001210BFB26089B842D6D8CBE00DA800902A +:1022A00001AB224629463046FFF719FBC2E0307BDE +:1022B000082805D0FFDF03E0307B082800D0FFDFCF +:1022C000E8891030ADF804003620ADF83400002C59 +:1022D0003FD0A9896181F189A18127E0307B09285C +:1022E00000D0FFDFA88900F10C01ADF80410372100 +:1022F000ADF83410002C2CD06081E8890090AB89B7 +:10230000688804F10C02296956E0E8893921103007 +:1023100080B2ADF80400ADF83410002C74D0A98957 +:102320006181287A0E280AD002212173E989E1818E +:10233000288A0090EB8968886969039A3CE001214A +:10234000F3E70DA8009001AB224629463046FFF77F +:1023500057FB6FE0307B0A2800D0FFDF1220ADF87A +:102360000400ADF834704CB3A9896181A4F810B0B1 +:10237000A4F80EB084F80C905CE020E002E031E0BC +:1023800039E042E0307B0B2800D0FFDF288AADF82F +:1023900034701230ADF8040084B104212173A9898E +:1023A0006181E989E181298A2182688A00902B8AEA +:1023B000688804F11202696900F047FA3AE0307B5C +:1023C0000C2800D0FFDF1220ADF80400ADF8347007 +:1023D0003CB305212173A4F80AB0A4F80EB0A4F808 +:1023E00010B027E00DA8009001AB224629463046E8 +:1023F000FFF75AFA1EE00DA8009001AB22462946CD +:102400003046FFF7B5FB15E034E03B21ADF80400A2 +:10241000ADF8341074B3A4F80690A4F808B084F8AA +:102420000AB007E010000020FFDF03E0297A01294D +:1024300017D0FFDFBDF80400AAF800006CB1BDF8AA +:1024400034002080BDF804006080BDF834003928D5 +:1024500003D03C2801D086F80CB011B00020BDE8B4 +:10246000F08F3C21ADF80400ADF8341014B1697A56 +:10247000A172DFE7AAF80000EFE72DE9F8435688DC +:102480000F46804615460521304610F067FD0400D2 +:1024900000D1FFDF123400943B46414630466A6863 +:1024A0000AF02CF8B8E570B50D46052110F056FD80 +:1024B000040000D1FFDF294604F11200BDE870409E +:1024C00009F0B6BE70B50D46052110F047FD0400B9 +:1024D00000D1FFDF294604F11200BDE8704009F089 +:1024E000D4BE70B50546052110F038FD040000D1BA +:1024F000FFDF04F1080321462846BDE870400422AE +:10250000AFE470B50546052110F028FD040000D1A8 +:10251000FFDF214628462368BDE870400522A0E47D +:1025200070B50646052110F019FD040000D1FFDF4B +:1025300004F1120009F06FFE401D20F0030511E0C8 +:10254000011D00880322431821463046FFF789FC0D +:1025500000280BD0607BABB2684382B26068011D7B +:1025600010F0B9FB606841880029E9D170BD70B5F1 +:102570000E46054607F052F8040000D1FFDF0120A7 +:10258000207266726580207820F00F00C01C20F059 +:10259000F00030302070BDE8704007F042B82DE9FF +:1025A000F0438BB00D461446814606A9FFF797FB12 +:1025B000002814D14FF6FF7601274FF420588CB134 +:1025C00003208DF800001020ADF8100007A805903A +:1025D00007AA204604A912F078FA78B107200BB0B8 +:1025E000BDE8F0830820ADF808508DF80E708DF826 +:1025F0000000ADF80A60ADF80C800CE00698A178F8 +:1026000001742188C1818DF80E70ADF80850ADF8C5 +:102610000C80ADF80A606A4602214846069BFFF727 +:1026200087FBDCE708B501228DF8022042F60202A2 +:10263000ADF800200A4603236946FFF73CFC08BDBD +:1026400008B501228DF8022042F60302ADF8002001 +:102650000A4604236946FFF72EFC08BD00B587B083 +:1026600079B102228DF800200A88ADF80820498847 +:10267000ADF80A1000236A460521FFF759FB07B0A1 +:1026800000BD1020FBE709B1072314E407207047C1 +:1026900070B588B00D461446064606A9FFF71FFB25 +:1026A00000280ED17CB10620ADF808508DF800004E +:1026B000ADF80A40069B6A460821DC813046FFF7E8 +:1026C00037FB08B070BD05208DF80000ADF808504C +:1026D000F0E700B587B059B107238DF80030ADF8A9 +:1026E0000820039100236A460921FFF721FBC6E772 +:1026F0001020C4E770B588B00C460646002506A930 +:10270000FFF7EDFA0028DCD106980121123009F01C +:10271000B4FD9CB12178062921D2DFE801F0200523 +:1027200005160318801E80B2C01EE28880B20AB16E +:10273000A3681BB1824203D90C20C2E71020C0E776 +:10274000042904D0A08850B901E00620B9E7012986 +:1027500013D0022905D004291CD005292AD007202E +:10276000AFE709208DF800006088ADF80800E08828 +:10277000ADF80A00A068039023E00A208DF800005D +:102780006088ADF80800E088ADF80A00A0680A2566 +:10279000039016E00B208DF800006088ADF808006B +:1027A000A088ADF80A00E088ADF80C00A0680B2501 +:1027B000049006E00C208DF8000060788DF8080089 +:1027C0000C256A4629463046069BFFF7B1FA78E7A2 +:1027D00000B587B00D228DF80020ADF80810002359 +:1027E0006A461946FFF7A4FA49E700B587B071B108 +:1027F00002228DF800200A88ADF808204988ADF83B +:102800000A1000236A460621FFF792FA37E71020E4 +:1028100035E770B586B0064601200D46ADF80810C4 +:102820008DF80000014600236A463046FFF780FA23 +:10283000040008D12946304605F0EAFC0021304664 +:1028400005F004FD204606B070BDF8B51C461546DF +:102850000E46069F10F0B5FC2346FF1DBCB2314664 +:102860002A46009410F09FF8F8BD30B41146DDE917 +:1028700002423CB1032903D0002330BC08F03BBE28 +:102880000123FAE71A8030BC704770B50C46054644 +:10289000FFF72DFB2146284605F0C9FC2846BDE878 +:1028A0007040012105F0D2BC4FF0E0224FF400400F +:1028B0000021C2F88001BFF34F8FBFF36F8F17481D +:1028C000016001601649900208607047134900B525 +:1028D00000220A600A60124B4FF060721A600028F2 +:1028E00008BF00BD0F4A104BDFF840C001280CD0D4 +:1028F00002281CBFFFDF00BD032008601A604FF4F0 +:10290000000000BFCCF8000000BD022008601A6083 +:102910004FF04070F6E700B5FFDF00BD00F5004066 +:1029200008F50140A802002014F5004004F501401C +:1029300070B50B2000F0BDF9082000F0BAF90021B5 +:102940000B2000F0D4F90021082000F0D0F9F44C5D +:1029500001256560A5600020C4F84001C4F8440169 +:10296000C4F848010B2000F0B5F9082000F0B2F9D6 +:102970000B2000F091F9256070BD10B50B2000F020 +:1029800098F9082000F095F9E5480121416081603F +:10299000E4490A68002AFCD10021C0F84011C0F8BF +:1029A0004411C0F848110B2000F094F9BDE8104024 +:1029B000082000F08FB910B50B2000F08BF9BDE8AE +:1029C0001040082000F086B900B530B1012806D0CB +:1029D000022806D0FFDF002000BDD34800BDD34849 +:1029E00000BDD248001D00BD70B5D1494FF0004078 +:1029F0000860D04DC00BC5F80803CF480024046020 +:102A0000C5F840410820C43500F053F9C5F83C41F1 +:102A1000CA48047070BD08B5C14A002128B1012818 +:102A200011D002281CD0FFDF08BD4FF48030C2F85F +:102A30000803C2F84803BB483C300160C2F84011AB +:102A4000BDE80840D0E74FF40030C2F80803C2F8F0 +:102A50004803B44840300160C2F84411B3480CE068 +:102A60004FF48020C2F80803C2F84803AD48443050 +:102A70000160C2F84811AD48001D0068009008BD13 +:102A800070B516460D460446022800D9FFDF002225 +:102A9000A348012304F110018B4000EB8401C1F82D +:102AA000405526B1C1F84021C0F8043303E0C0F816 +:102AB0000833C1F84021C0F8443370BD2DE9F0411E +:102AC0001D46144630B1012833D0022838D0FFDF2C +:102AD000BDE8F081891E002221F07F411046FFF7FA +:102AE000CFFF012D23D00020944D924F0126687016 +:102AF0003E61914900203C3908600220091D0860B0 +:102B00008D490420303908608B483D34046008202A +:102B10006C6000F0DFF83004C7F80403082000F010 +:102B2000BBF88349F007091F08602E70D0E7012029 +:102B3000DAE7012B02D00022012005E00122FBE7A9 +:102B4000012B04D000220220BDE8F04198E70122C9 +:102B5000F9E774480068704770B500F0D8F8704C19 +:102B60000546D4F840010026012809D1D4F808030D +:102B7000C00305D54FF48030C4F80803C4F84061A1 +:102B8000D4F8440101280CD1D4F80803800308D5F7 +:102B90004FF40030C4F80803C4F84461012012F077 +:102BA0005BFFD4F8480101280CD1D4F80803400396 +:102BB00008D54FF48020C4F80803C4F84861022007 +:102BC00012F04AFF5E48056070BD70B500F09FF8D6 +:102BD0005A4D0446287850B1FFF706FF687818B1BF +:102BE0000020687012F038FF5548046070BD032063 +:102BF000F8E74FF0E0214FF40010C1F800027047F1 +:102C0000152000F067B84B4901200861082000F04A +:102C100061B848494FF47C10C1F80803002002460F +:102C200001EB8003C3F84025C3F84021401CC0B22B +:102C30000628F5D37047410A43F609525143C0F3C1 +:102C4000080010FB02F000F5807001EB5020704787 +:102C500010B5430B48F2376463431B0C5C020C60F5 +:102C6000384C03FB0400384B4CF2F72443435B0D14 +:102C700013FB04F404EB402000F580704012107048 +:102C800008681844086010BD2C48406870472949FE +:102C90000120C1F800027047002809DB00F01F0284 +:102CA000012191404009800000F1E020C0F80011AE +:102CB000704700280DDB00F01F0201219140400900 +:102CC000800000F1E020C0F88011BFF34F8FBFF308 +:102CD0006F8F7047002809DB00F01F02012191402F +:102CE0004009800000F1E020C0F8801270474907D9 +:102CF000090E002804DB00F1E02080F80014704782 +:102D000000F00F0000F1E02080F8141D70470C481F +:102D1000001F00680A4A0D49121D1160704700002B +:102D200000B0004004B500404081004044B1004084 +:102D300008F5014000800040408500403800002038 +:102D400014050240F7C2FFFF6F0C010001000001F3 +:102D50000A4810B50468094909480831086012F0AA +:102D60000FFF0648001D046010BD064900200860E2 +:102D70004FF0E0210220C1F88002704710050240A8 +:102D800001000001FC1F0040374901200860704726 +:102D900070B50D2000F049F8344C0020C4F8000153 +:102DA0000125C4F804530D2000F050F825604FF0C1 +:102DB000E0216014C1F8000170BD10B50D2000F0D5 +:102DC00034F82A48012141600021C0F80011BDE813 +:102DD00010400D2000F03AB8254810B50468244989 +:102DE0002448083108602149D1F80001012804D0A5 +:102DF000FFDF1F48001D046010BD1B48001D006858 +:102E00000022C0B2C1F8002113F0E1FBF1E710B5D8 +:102E1000164800BFD0F800110029FBD0FFF7DCFFF7 +:102E2000BDE810400D2000F011B800280DDB00F0C7 +:102E30001F02012191404009800000F1E020C0F80C +:102E40008011BFF34F8FBFF36F8F7047002809DBEE +:102E500000F01F02012191404009800000F1E020B4 +:102E6000C0F880127047000004D5004000D0004038 +:102E700010050240010000014FF0E0214FF000700A +:102E8000C1F8800101F5C071BFF34F8FBFF36F8FA1 +:102E9000C1F80001394B802283F8002441F8800CEE +:102EA000704700B502460420354903E001EBC0033A +:102EB0001B792BB1401EC0B2F8D2FFDFFF2000BD4E +:102EC00041F8302001EBC00100224A718A710122D1 +:102ED0000A7100BD2A4A002102EBC000017170474F +:102EE00010B50446042800D3FFDF254800EBC404D6 +:102EF0002079012800D0FFDF6079A179401CC0B2A1 +:102F0000814200D060714FF0E0214FF00070C1F8B5 +:102F1000000210BD70B50425194E1A4C16E0217838 +:102F200006EBC1000279012A08D1427983799A42DD +:102F300004D04279827156F8310080472078401CD5 +:102F4000C0B22070042801D3002020706D1EEDB2A5 +:102F5000E5D270BD0C4810B504680B490B48083128 +:102F60000860064890F800044009042800D0FFDFFC +:102F7000FFF7D0FF0448001D046010BD19E000E019 +:102F8000E00500205400002010050240010000016F +:102F90000548064A0168914201D1002101600449B7 +:102FA000012008607047000058000020BEBAFECA29 +:102FB00040E5014070B50C46054609F03BFC214652 +:102FC0002846BDE870400AF01CBD70477047704746 +:102FD0001EF0040F0CBFEFF30880EFF30980014AE5 +:102FE000104700009B6C01000FF20C0000F1000084 +:102FF000694641F8080C20BF704700000004050630 +:103000002CFFFFFFDBE5B15100700200CA00FFFF9B +:103010008C000000C1CF6A00FEA0D9111C1006C3AD +:1030200089CCFC7A7B3B49141906A8C030B5F84D11 +:103030000446062CA9780ED2DFE804F0030E0E0E2B +:103040000509FFDF08E0022906D0FFDF04E00329BD +:1030500002D0FFDF00E0FFDFAC7030BD30B50446CA +:103060001038EB4D07280CD2DFE800F0040C060CFA +:103070000C0C0C00FFDF05E0287E112802D0FFDFDA +:1030800000E0FFDF2C7630BD2DE9F04111F088FE25 +:10309000044613F0BBF8201AC5B206200FF006FF55 +:1030A000044606200FF00AFF211AD94C207E122870 +:1030B00018D000200F1807200FF0F8FE0646072052 +:1030C0000FF0FCFE301A3918207E13280CD0002097 +:1030D0000144A078042809D000200844281AC0B26E +:1030E000BDE8F0810120E5E70120F1E70120F4E7E8 +:1030F000C74810B590F825004108C54800F12600E2 +:1031000005D00DF05BFFBDE8104006F0A9B80DF04A +:1031100036FFF8E730B50446A1F120000D460A2835 +:103120004AD2DFE800F005070C1C2328353A3F445B +:10313000FFDF42E0207820283FD1FFDF3DE0B448A8 +:103140008178052939D0007E122836D020782428AD +:1031500033D0252831D023282FD0FFDF2DE0207851 +:1031600022282AD0232828D8FFDF26E0207822280A +:1031700023D0FFDF21E0207822281ED024281CD075 +:1031800026281AD0272818D0292816D0FFDF14E0C7 +:103190002078252811D0FFDF0FE0207825280CD0DB +:1031A000FFDF0AE02078252807D0FFDF05E0207840 +:1031B000282802D0FFDF00E0FFDF257030BD1FB5FB +:1031C00004466A46002001F0A5FEB4B1BDF8022015 +:1031D0004FF6FF700621824201D1ADF80210BDF812 +:1031E0000420824201D1ADF80410BDF808108142DC +:1031F00003D14FF44860ADF8080068460EF048FB74 +:1032000006F02EF804B010BD70B514460D46064603 +:10321000FEF71FF858B90DB1A54201D90C2070BDB9 +:10322000002408E056F82400FEF713F808B1102037 +:1032300070BD641CE4B2AC42F4D3002070BD2DE933 +:10324000F04105461F4690460E4600240068FEF7F2 +:103250004DF830B9A98828680844401EFEF746F8A2 +:1032600008B110203CE728680028A88802D0B8429E +:1032700002D850E00028F5D0092031E72968085D20 +:10328000B8B1671CCA5D152A2ED03CDC152A3AD28B +:10329000DFE802F03912222228282A2A313139396E +:1032A00039393939393939392200085D30BB641C64 +:1032B000A4B2A242F9D833E00228DDD1A01C085CF8 +:1032C00088F80000072801D2400701D40A2007E748 +:1032D000307840F0010015E0C143C90707E001283C +:1032E00007D010E00620FBE60107A1F1805100297C +:1032F000F5D01846F4E63078810701D50B20EFE6CB +:1033000040F0020030702868005D384484B2A8881C +:10331000A04202D2B0E74FF4485382B2A242ADD8E5 +:103320000020DDE610B5027843F2022354080122A2 +:10333000022C12D003DC3CB1012C16D106E0032C88 +:1033400010D07F2C11D112E0002011E080790324ED +:10335000B4EB901F09D10A700BE08079B2EB901F9B +:1033600003D1F8E780798009F5D0184610BDFF2019 +:103370000870002010BD08B500208DF8000024481A +:1033800090F82E1049B190F82F0002280ED0032893 +:103390000ED0FFDF9DF8000008BD1D4869462530AE +:1033A00001F007FE0028F5D0FFDFF3E7032000E07F +:1033B00001208DF80000EDE738B50C46054669465A +:1033C00001F0F7FD00280DD19DF80010207861F381 +:1033D0004700207055F8010FC4F80100A888A4F830 +:1033E0000500002038BD38B51378A8B1022813D0E5 +:1033F000FF281AD007A46D46246800944C7905EB89 +:103400009414247864F347031370032809D00FE061 +:10341000F40100200302FF0123F0FE0313700228D1 +:10342000F3D1D8B240F0010005E043F0FE00107087 +:10343000107820F0010010700868C2F80100888838 +:10344000A2F8050038BD02210FF088BD38B50C4642 +:103450000978222901D2082038BDADF800008DF886 +:10346000022068460DF0ECFD05F0FAFE050003D1E0 +:1034700021212046FFF74EFE284638BD1CB500200E +:103480008DF80000CDF80100ADF80500FB4890F87C +:103490002E00022801D0012000E000208DF8070056 +:1034A00068460DF055FE002800D0FFDF1CBD00224D +:1034B0000A80437892B263F3451222F040020A80F8 +:1034C00000780C282BD2DFE800F02A06090E11162E +:1034D000191C1F220C2742F0110009E042F01D00C8 +:1034E00008800020704742F0110012E042F0100006 +:1034F00040F00200F4E742F01000F1E742F0010072 +:10350000EEE742F0010004E042F00200E8E742F09A +:10351000020040F00400E3E742F00400E0E7072087 +:1035200070472DE9FF478AB00025BDF82C60824620 +:103530001C4691468DF81C50700703D56068FDF756 +:1035400088FE68B9CD4F4FF0010897F82E0058B1AA +:1035500097F82F00022807D16068FDF7C7FE18B161 +:1035600010200EB0BDE8F087300702D5A089802872 +:103570003ED8700705D4B9F1000F02D097F82400A7 +:10358000A0B3E07DC0F300108DF81B00627D072022 +:10359000032162B3012A2DD0022AE2D0042AE0D10D +:1035A0008DF81710F00628D4A27D07202AB3012A2F +:1035B00023D0022A24D0042AD3D18DF8191000BFB9 +:1035C0008DF81590606810B307A9FFF7ABFE0028CF +:1035D000C7D19DF81C00FF2816D0606850F8011F65 +:1035E000CDF80F108088ADF8130014E000E001E082 +:1035F0000720B6E78DF81780D4E78DF81980DFE74C +:1036000002208DF81900DBE743F20220A9E7CDF88C +:103610000F50ADF81350E07B40B9207C30B9607C8E +:1036200020B9A07C10B9E07CC00601D0062098E744 +:103630008DF800A0BDF82C00ADF80200A068019044 +:10364000A068029004F10F0001F0A7FC8DF80C00B7 +:10365000FFF791FE8DF80D009DF81C008DF80E000F +:103660008DF816508DF81850E07D08A900F00F0075 +:103670008DF81A0068460EF047FA05F0F1FD70E784 +:10368000F0B58FB000258DF830508DF814508DF8BE +:10369000345006468DF828500195029503950495FF +:1036A00019B10FC901AC84E80F00744CA07805284B +:1036B00001D004280CD101986168884200D120B95A +:1036C0000398E168884203D110B108200FB0F0BD23 +:1036D000207DC00601D51F2700E0FF273B460DAA2D +:1036E00005A903A8FFF7ABFD0028EFD1A08AC10709 +:1036F00002D0C00600D4EE273B460AAA0CA901A8B6 +:10370000FFF79DFD0028E1D19DF81400C00701D00E +:103710000A20DBE7A08A410708D4A17D31B19DF8DA +:103720002810890702D043F20120CFE79DF8281026 +:10373000C90709D0400707D4208818B144F2506166 +:10374000884201D90720C1E78DF818508DF819601B +:10375000BDF80800ADF81A000198079006A80EF011 +:10376000DFF905F07DFD0028B0D18DF820508DF8EF +:103770002160BDF81000ADF822000398099008A858 +:103780000EF0F0F905F06CFD00289FD101AD241D6D +:1037900095E80F0084E80F00002097E770B586B029 +:1037A0000D46040005D0FDF7A1FD20B1102006B0A4 +:1037B00070BD0820FBE72078C107A98802D0FF2947 +:1037C00002D303E01F2901D20920F0E7800763D468 +:1037D000FFF75AFC38B12178C1F3C100012804D0A9 +:1037E000032802D005E01320E1E7244890F82400E4 +:1037F000C8B1C8074FF001064FF0000502D08DF8A0 +:103800000F6001E08DF80F50FFF7B5FD8DF8000057 +:1038100020786946C0F3C1008DF8010060788DF80A +:103820000250C20801D00720C1E730B3C20701D05F +:103830008DF80260820705D59DF8022042F0020251 +:103840008DF80220400705D59DF8020040F00400E5 +:103850008DF80200002022780B18C2F38002DA7083 +:1038600001EB40026388D380401CA388C0B253811F +:103870000228F0D3207A78B905E001E0F4010020B5 +:103880008DF80260E6E7607A30B9A07A20B9E07A74 +:1038900010B9207BC00601D0062088E704F108009B +:1038A00001F07BFB8DF80E0068460DF05AFD05F027 +:1038B000D7FC002889D18DF810608DF81150E08870 +:1038C000ADF81200ADF8145004A80DF09DFD05F000 +:1038D000C7FC002888D12078C00701D0152000E05F +:1038E0001320FFF7BBFB002061E72DE9FF47022013 +:1038F000FD4E8DF804000027708EADF80600B84626 +:1039000043F202094CE001A80FF08FFA050006D03F +:10391000708EA8B3A6F83280ADF806803EE0039C16 +:10392000A07F01072DD504F124000090A28EBDF8E0 +:103930000800214604F1360301F0CAFC050005D059 +:103940004D452AD0112D3CD0FFDF3AE0A07F20F07A +:103950000801E07F420862F3C711A177810861F393 +:103960000000E07794F8210000F01F0084F82000A8 +:103970002078282826D129212046FFF7CBFB21E0FB +:1039800014E040070AD5BDF8080004F10E0101F06B +:103990001AFB05000DD04D4510D100257F1CFFB24C +:1039A00002200FF083FA401CB842ACD8052D11D08C +:1039B00008E0A07F20F00400A07703E0112D00D0E4 +:1039C000FFDF0025BDF806007086052D04D02846CF +:1039D00004B0C7E5A6F832800020F9E770B50646C6 +:1039E000FFF731FD054605F019FE040000D1FFDFA9 +:1039F0006680207820F00F00801C20F0F00020303E +:103A000020700320207295F83E006072BDE870407F +:103A100005F007BE2DE9F04786B0040000D1FFDFB6 +:103A20002078B14D20F00F00801C20F0F0007030A5 +:103A3000207060680178491F1B2933D2DFE801F04C +:103A4000FE32323255FD320EFDFD42FC323232780A +:103A5000FCFCFBFA32FCFCF9F8FCFC00C6883046A2 +:103A6000FFF7F1FC0546304607F03BFCE0B160682B +:103A7000007A85F83E0021212846FFF74BFB3046AF +:103A8000FEF750FB304603F0E7FE3146012013F00D +:103A900063F8A87F20F01000A877FFF726FF002822 +:103AA00000D0FFDF06B05DE5207820F0F000203088 +:103AB00020700320207266806068007A607205F0D2 +:103AC000B0FDD8E7C5882846FFF7BDFC00B9FFDF89 +:103AD00060680079012800D0FFDF6068017A06B0D5 +:103AE0002846BDE8F04707F0E1BDC6883046FFF73D +:103AF000AAFC050000D1FFDF05F093FD60683146A8 +:103B00000089288160684089688160688089A8810F +:103B1000012013F021F80020A875A87F00F0030011 +:103B20000228BFD1FFF7E1FE0028BBD0FFDFB9E7D5 +:103B3000007928B10228B5D03C28B3D0FFDFB1E727 +:103B400005F06FFD6668B6F806A0307A361D0128CC +:103B500006D0687E814605F0EFFA070003D101E048 +:103B6000E878F7E7FFDF0022022150460FF0EDF979 +:103B7000040000D1FFDF22212046FFF7CBFA307985 +:103B8000012800D00220A17F804668F30101A177BF +:103B9000308B2081708B6081B08BA08184F8229063 +:103BA0008DF80880B8680090F86801906A46032193 +:103BB00050460FF0CAF900B9FFDFB888ADF8100021 +:103BC000B8788DF8120004AA052150460FF0BDF90F +:103BD00000B9FFDFB888ADF80C00F8788DF80E005A +:103BE00003AA042150460FF0B0F900B9FFDF062107 +:103BF00006F1120001F005FA40B37079800700D594 +:103C0000FFDF7179E07D61F34700E075D6F80600CB +:103C1000A0617089A083062106F10C0001F0F1F982 +:103C2000F0B195F825004108607861F3470006E09F +:103C300041E039E071E059E04EE02FE043E0607090 +:103C4000D5F82600C4F80200688D12E0E07D20F06F +:103C5000FE00801CE075D6F81200A061F08AD9E75A +:103C6000607820F0FE00801C6070F068C4F80200EC +:103C7000308AE080B8F1010F04D0B8F1020F05D00E +:103C8000FFDF0FE70320FFF7D1F90BE7287E1228AB +:103C900000D0FFDF1120FFF7E1F903E706B020466F +:103CA000BDE8F04701F0A0BD05F0BBFC15F8300FF2 +:103CB00040F0020005E005F0B4FC15F8300F40F0CC +:103CC00004002870EEE6287E13280AD01528D8D1E3 +:103CD0005FF01600FFF7C2F906B0BDE8F04705F047 +:103CE000A0BC1420F6E70000F4010020A978052903 +:103CF00009D00429C5D105F094FC022006B0BDE826 +:103D0000F047FFF793B900790028BAD0E87801F0BE +:103D10002BF905F086FC0320F0E7287E122802D15B +:103D2000687E01F021F91120D4E72DE9F05F054606 +:103D300000784FF000080009DFF8B4A891460C465F +:103D4000464601286ED002286DD007280BD00A28DD +:103D50006AD0FFDFA9F8006014B1A4F80080668083 +:103D60000020BDE8F09F6968012704F108000B7886 +:103D70004FF0020B5B1F4FF6FF721B2B7ED2DFE86A +:103D800003F0647D7D7D0E7D7D7D7D7D7D217D7D4E +:103D90007D2BFDFCFBFA7D14D2F9E7F8F700C8880B +:103DA0004FF01208102621469AE14FF01C080A260F +:103DB000BCB38888A0806868807920726868C07900 +:103DC0006072C7E74FF01B08142654B3032020721B +:103DD00068688088A080BDE70A793C2ABAD00D1DAA +:103DE0004FF010082C26E4B16988A180298B6182EC +:103DF000298B2182698BA182A98BE1826B79024692 +:103E0000A91D1846FFF7EFFA2979002001290CD0E7 +:103E100084F80FB0FF212176E06120626062A06229 +:103E200098E70FE03BE15EE199E1E77320760AF164 +:103E3000040090E80E00DAF81000C4E90930C4E983 +:103E4000071287E7A9F800608AE72C264FF01D08C3 +:103E5000002CF7D0A28005460F1D897B008861F3F6 +:103E600000002880B97A490861F341002880B97AB6 +:103E7000890861F382002880B97A00E00CE1C90862 +:103E800061F3C3002880B97AAA1C0911491C61F3A7 +:103E9000041000F07F0028807878B91CFFF7A3FA9F +:103EA000387D05F1090207F11501FFF79CFA387B0F +:103EB00001F0B6F82874787B01F0B2F86874F87EE7 +:103EC000A874787AE874387F2875B87B6875388A62 +:103ED000E882DAF81C10A961B97A504697F808A070 +:103EE000C1F34111012904D0008C504503D2824610 +:103EF00009E0FFDF10E0022903D0288820F06000ED +:103F000009E0504504D1288820F06000403002E0EC +:103F1000288840F060002880A4F824A0524607F1C9 +:103F20001D01A8699BE011264FF02008002C89D0C4 +:103F3000A280686804F10A02007920726868007B38 +:103F4000607269688B1D48791946FFF74CFA01E7E2 +:103F50000A264FF02108002CE9D08888A0806868E4 +:103F6000807920726868C07960729AF8301006E033 +:103F700078E06BE052E07FE019E003E03AE021F006 +:103F80000401A6E00B264FF02208002CCFD0C888F1 +:103F9000A0806868007920726868007A01F040F8B3 +:103FA00060726868407A01F03BF8A072D2E61C2685 +:103FB0004FF02608002CBAD0A28068684079607261 +:103FC0006868007AA0720AF1040090E80E00DAF83E +:103FD0001000C4E90530C4E90312686800793C2880 +:103FE00003D0432803D0FFDFB4E62772B2E684F89B +:103FF00008B0AFE610264FF02408002C97D0888830 +:10400000A0806868807920816868807A60816868AB +:104010000089A08168688089E0819BE610264FF0C6 +:104020002308002C98D08888A0806868C0882081E8 +:1040300068680089608168684089A08168688089B3 +:10404000E0819AF8301021F0020142E030264FF072 +:104050002508002C9AD0A2806968282249680AF0B5 +:10406000E4F977E62A264FF02F08002C8ED0A280A4 +:1040700069682222091DF2E714264FF01B08002C64 +:1040800084D0A280686800790128B0D02772DAE96C +:104090000710C4E903105DE64A46214660E0287A2D +:1040A000012803D0022817D0FFDF53E610264FF077 +:1040B0001F08002CA2D06888A080A8892081E889E8 +:1040C0006081288AA081688AE0819AF8301021F006 +:1040D00001018AF830103DE64FF01208102668887A +:1040E00000F07CFF36E6287AC8B3012838D00228D1 +:1040F00036D0032801D0FFDF2CE609264FF0110847 +:10410000002C8FD06F883846FFF79DF990F822A0D9 +:10411000A780687A2072042138460EF031FF05210D +:1041200038460EF02DFF002138460EF029FF012100 +:1041300038460EF025FF032138460EF021FF0221FC +:1041400038460EF01DFF062138460EF019FF0721F4 +:1041500038460EF015FF504600F006FFFAE5FFE77F +:104160002846BDE8F05F01F0C9BC70B5012803D056 +:10417000052800D0FFDF70BD8DB22846FFF763F938 +:10418000040000D1FFDF20782128F4D005F046FAA2 +:1041900080B1017821F00F01891C21F0F00110316C +:1041A00001700221017245800020A075BDE87040B9 +:1041B00005F037BA21462846BDE870401322FFF7C4 +:1041C00045B92DE9F04116460C00804600D1FFDFCD +:1041D000307820F00F00801C20F0F000103030709C +:1041E0002078012804D0022818D0FFDFBDE8F08134 +:1041F0004046FFF728F9050000D1FFDF0320A8752E +:1042000005F00FFA94E80F00083686E80F00F8482A +:1042100010F8301F41F001010170E7E74046FFF759 +:1042200012F9050000D1FFDFA1884FF6FF700027CB +:10423000814202D1E288824203D0814201D1E088EA +:1042400040B105F0EEF994E80F00083686E80F005B +:10425000AF75CBE7A87D0128C8D17823002241465D +:1042600012F0D0FB0220A875C0E738B505460C4611 +:104270000846FCF7EEFF70BB232D4AD006DC202D4C +:104280000DD0212D23D0222D06D13DE0242D46D066 +:10429000252D32D03F2D47D00725284638BD002197 +:1042A000052012F02FFC08B1112038BDA01C0DF024 +:1042B00042FB04F0D5FF0500EFD100220823114690 +:1042C000052012F09FFB0528E7D0FFDFE5E76068D7 +:1042D000FDF703F808B1102038BD618820886A46D0 +:1042E0000DF0D2FD04F0BCFF0500D6D160680028B7 +:1042F000D3D0BDF800100180CFE7A07800F0010115 +:1043000020880DF0F2FD17E0206801F0A3FE0546BD +:10431000C3E7207800F001000CF024FE0CE0618877 +:1043200020880DF02CFD07E0207800F001008DF8CA +:10433000000068460DF04AF904F092FFE7E770B517 +:1043400005460C460846FCF7AAFF08B1102070BDD0 +:10435000202D07D0212D0DD0222D0BD0252D09D0B9 +:10436000072070BD2088A11C0CF0D0FEBDE8704075 +:1043700004F076BF062070BD9D482530704708B513 +:10438000342200219A480AF07AF80120FEF74EFE06 +:104390001120FEF763FE96496846263105F0D4F8F1 +:1043A00093489DF8002010F8251F62F3470121F083 +:1043B00001010170002141724FF46171A0F80710F2 +:1043C00002218172FEF794FE00B1FFDFFDF70AF8CB +:1043D00001F0D3F908BD10B50C464022002120465B +:1043E0000AF04DF8A07F20F00300A0772020207075 +:1043F0000020A07584F8230010BD70472DE9FC4112 +:104400000746FCF726FF10B11020BDE8FC81784E6E +:1044100006F12501D6F825000090B6F82950ADF830 +:10442000045096F82B408DF806403846FEF7C4FF3E +:104430000028EAD1FEF75CFE0028E6D0009946F895 +:10444000251FB580B471E0E710B50446FCF727FFDF +:1044500008B1102010BD66486549224690F8250035 +:1044600026314008FEF7BFFF002010BD3EB50446D0 +:104470000D460846FCF713FF08B110203EBD14B1ED +:1044800043F204003EBD5A488078052803D0042832 +:1044900001D008203EBD694602A80AF019FC2A4650 +:1044A00069469DF80800FEF79EFF00203EBDFEB560 +:1044B0000D4604004FF0000711D00822FEF7A4FEBD +:1044C000002811D1002608E054F826006946FEF7BE +:1044D00029FF002808D1761CF6B2AE42F4D30CF0C6 +:1044E00088FC10B143F20320FEBD414E86F82470D3 +:1044F0000CB300271BE000BF54F8270002A9FEF709 +:1045000011FF00B1FFDF9DF808008DF8000054F89E +:10451000270050F8011FCDF801108088ADF8050084 +:1045200068460CF08BFC00B1FFDF7F1CFFB2AF428E +:10453000E2D386F824500020FEBD2DE9F0478AB072 +:104540001546894604001FD00F4608222946FEF76B +:104550005BFE002811D1002614E000BF54F82600AD +:104560006946103000F025FD002806D147B157F804 +:104570002600FCF76EFE18B110200AB0BDE8F087E7 +:10458000761CF6B2AE42E9D30026A5F101081BE085 +:1045900006F1010A0AF0FF0712E000BF54F82600F6 +:1045A000017C4A0854F827100B7CB2EB530F05D15D +:1045B00006221130113109F00BFF58B17F1CFFB2F8 +:1045C000AF42EBD30AF0FF064645E1DB4E4624B18D +:1045D000012003E043F20520CFE700200CF053FC5C +:1045E00010B90CF05CFC28B143F20420C5E70000D0 +:1045F000F401002064B300270DF1170826E000BF86 +:1046000054F827006946103000F0D3FC00B1FFDFFA +:1046100054F82700102250F8111FCDF8011080889F +:10462000ADF8050054F827100DF1070009F0FDFE64 +:1046300096B156F827101022404609F0F6FE68465B +:104640000CF0E1FB00B1FFDF7F1CFFB2AF42D7D31C +:10465000FEF714FF002090E7404601F0EFFCEEE784 +:1046600030B585B00446FDF7BDF830B906200EF030 +:104670001DFC10B1062005B030BD2046FCF7E9FD59 +:1046800018B96068FCF732FE08B11020F3E76088C3 +:104690004AF2B811884206D82078F94D28B101288D +:1046A00006D0022804D00720E5E7FEF721FD18E038 +:1046B0006078022804D0032802D043F20220DAE70F +:1046C00085F82F00C1B200200090ADF80400022947 +:1046D0002CD0032927D0FFDF68460CF06FFC04F0D4 +:1046E000BFFD0028C7D1606801F09BFC207858B15D +:1046F00001208DF800000DF1010001F09FFC6846DB +:104700000DF059FC00B1FFDF207885F82E00FEF790 +:10471000B5FE608860B1A88580B20CF0ACFB00B13A +:10472000FFDF0020A7E78DF80500D5E74020FAE776 +:104730004FF46170EFE710B50446FCF7B0FD20B907 +:10474000606838B1FCF7C9FD08B1102010BD606881 +:1047500001F074FCCA4830F82C1F6180C178617088 +:1047600080782070002010BD2DE9F843144689465A +:104770000646FCF794FDA0B94846FCF7B7FD80B9A2 +:104780002046FCF7B3FD60B9BD4DA878012800D1E3 +:104790003CB13178FF2906D049B143F20400BDE8AD +:1047A000F8831020FBE7012801D00420F7E7CCB301 +:1047B000052811D004280FD069462046FEF777FE61 +:1047C0000028ECD1217D49B1012909D0022909D065 +:1047D000032909D00720E2E70820E0E7024604E0C9 +:1047E000012202E0022200E003228046234617460F +:1047F00000200099FEF795FE0028D0D1A0892880DE +:10480000A07BE875BDF80000A882AF75BDF8001068 +:10481000090701D5A18931B1A1892980C00704D038 +:10482000032003E006E08021F7E70220FEF7FEFB0D +:1048300086F800804946BDE8F8430020FEF720BF17 +:104840007CB58F4C05460E46A078022803D003287D +:1048500001D008207CBD15B143F204007CBD0720C7 +:104860000EF02CFB10B9A078032806D0FEF70CFC44 +:1048700028B1A078032804D009E012207CBD1320C1 +:104880007CBD304600F053FB0028F9D1E670FEF7FE +:1048900072FD0AF05AF901208DF800008DF8010030 +:1048A0008DF802502088ADF80400E07D8DF80600F8 +:1048B00068460DF027FA04F0D3FC0028E0D1A07878 +:1048C000032805D05FF00400FEF7B0FB00207CBD9C +:1048D000E07800F03CFB0520F6E71CB510B143F290 +:1048E00004001CBD664CA078042803D0052801D024 +:1048F00008201CBD00208DF8000001218DF801105A +:104900008DF8020068460DF0FDF904F0A9FC0028BE +:10491000EFD1A078052805D05FF00200FEF786FBF6 +:1049200000201CBDE07800F01FFB0320F6E72DE916 +:10493000FC4180460E4603250846FCF7D7FC0028BC +:1049400066D14046FEF77FFD040004D0207822287F +:1049500004D2082059E543F2020056E5A07F00F09A +:1049600003073EB1012F0CD000203146FEF727FC93 +:104970000500EFD1012F06D0022F1AD0FFDF284605 +:1049800043E50120F1E7A07D3146022801D011B1B5 +:1049900007E0112039E56846FCF758FE0028D9D118 +:1049A0006946404606F045FE0500E8D10120A075A5 +:1049B000E5E7A07D032804D1314890F83000C00716 +:1049C00001D02EB30EE026B1A07F40071ED40021F7 +:1049D00000E00121404606F04CFE0500CFD1A07555 +:1049E000002ECCD03146404600F0EDFA05461128A5 +:1049F000C5D1A07F4107C2D4316844F80E1F716849 +:104A0000616040F0040020740025B8E71125B6E786 +:104A10001020FAE470B50C460546FEF714FD0100BF +:104A200005D022462846BDE87040FEF70FBD43F290 +:104A3000020070BD10B5012807D1114B9B78012BE6 +:104A400000D011B143F2040010BD0CF046FABDE8ED +:104A5000104004F005BC012300F090BA00231A4670 +:104A6000194600F08BBA70B506460C460846FCF7AE +:104A7000F0FB18B92068FCF712FC18B1102070BDCB +:104A8000F4010020F84D2A7E112A04D0132A00D305 +:104A90003EB10820F3E721463046FEF77FFE60B1C5 +:104AA000EDE70920132A0DD0142A0BD0A188FF2985 +:104AB000E5D31520FEF7D2FA0020D4E90012C5E9AB +:104AC0000712DCE7A1881F29D9D31320F2E71CB510 +:104AD000E548007E132801D208201CBD00208DF877 +:104AE000000068460CF090FC04F0BAFB0028F4D1FA +:104AF0001120FEF7B3FA00201CBD2DE9F04FDFF8BE +:104B000068A3814691B09AF818009B4615460C465A +:104B1000132803D3FFF7DBFF00281FD12046FCF743 +:104B200098FBE8BB2846FCF794FBC8BB20784FF005 +:104B30000107C0074FF0000102D08DF83A7001E084 +:104B40008DF83A1020788846C0F3C1008DF8000037 +:104B500060788DF80910C10803D0072011B0BDE8B6 +:104B6000F08FB0B3C10701D08DF80970810705D56A +:104B70009DF8091041F002018DF80910400705D594 +:104B80009DF8090040F004008DF809009DF8090027 +:104B9000810703D540F001008DF80900002000E0F6 +:104BA00015E06E4606EB400162884A81401CA288EF +:104BB000C0B20A820328F5D32078C0F3C1000128CF +:104BC00025D0032823D04846FCF743FB28B110200A +:104BD000C4E7FFE78DF80970D8E799F800004008AE +:104BE00008D0012809D0022807D0032805D043F2B5 +:104BF0000220B3E78DF8028001E08DF8027048468C +:104C000050F8011FCDF803108088ADF80700FEF7BB +:104C1000B2FB8DF801000021424606EB41002B88D3 +:104C2000C3826B888383AB884384EB880385491CEC +:104C3000C285C9B282860329EFD3E088ADF83C0073 +:104C400068460CF0B9FC002887D19AF81800554640 +:104C5000112801D0082081E706200EF02FF938B185 +:104C60002078C0F3C100012804D0032802D006E058 +:104C7000122073E795F8240000283FF46EAFFEF78A +:104C800003FA022801D2132068E7584600F04FF9D2 +:104C900000289DD185F819B068460CF0D3FD04F0CA +:104CA000DFFA040094D1687E00F051F91220FEF77B +:104CB000D5F9204652E770B56B4D287E122801D0F9 +:104CC0000820DCE60CF0C1FD04F0CAFA040005D1AE +:104CD000687E00F049F91120FEF7C0F92046CEE6C3 +:104CE00070B5064615460C460846FCF7D8FA18B9C2 +:104CF0002846FCF7D4FA08B11020C0E62A4621461F +:104D000030460DF0A1F804F0ABFA0028F5D1217877 +:104D10007F29F2D10520B2E67CB505460C4608464F +:104D2000FCF797FA08B110207CBD2846FEF78BFBF4 +:104D300020B10078222804D208207CBD43F2020072 +:104D40007CBD494890F83000400701D511207CBD5A +:104D50002078C00802D16078C00801D007207CBD4F +:104D6000ADF8005020788DF8020060788DF80300CF +:104D70000220ADF8040068460BF0A1FE04F070FAC2 +:104D80007CBD70B586B014460D460646FEF75BFB4B +:104D900028B10078222805D2082006B06FE643F239 +:104DA0000200FAE72846FCF7A1FA20B944B12046F0 +:104DB000FCF793FA08B11020EFE700202060A080F4 +:104DC000294890F83000800701D51120E5E703A9B4 +:104DD00030460BF0C4FE10B104F042FADDE7ADF846 +:104DE0000060BDF81400ADF80200BDF81600ADF883 +:104DF0000400BDF81000BDF81210ADF80600ADF8C3 +:104E000008107DB1298809B1ADF80610698809B18B +:104E1000ADF80210A98809B1ADF80810E98809B108 +:104E2000ADF80410DCB1BDF80610814201D9081AB2 +:104E30002080BDF80210BDF81400814201D9081A83 +:104E40006080BDF80800BDF80410BDF816200144CC +:104E5000BDF812001044814201D9081AA0806846AA +:104E60000BF03BFFB8E70000F40100201CB57449CB +:104E70000968CDE9001068460CF0A0FB04F0F0F9D9 +:104E80001CBD1CB500200090019068460CF096FBFC +:104E900004F0E6F91CBD70B505460C460846FCF763 +:104EA000FEF908B11020EAE5214628460CF078F911 +:104EB000BDE8704004F0D4B93EB505460C4608463E +:104EC000FCF7EDF908B110203EBD002000900190E4 +:104ED0000290ADF800502089ADF8080020788DF8D8 +:104EE0000200606801902089ADF808006089ADF883 +:104EF0000A0068460CF066F904F0B2F93EBD0EB542 +:104F0000ADF800000020019068460CF05BF904F059 +:104F1000A7F90EBD10800888508048889080C88806 +:104F200010818888D080002050819081704710B512 +:104F3000044604F001F930B1407830B1204604F065 +:104F400014FC002010BD052010BD122010BD10B5AE +:104F500004F0F2F8040000D1FFDF607800B9FFDF51 +:104F60006078401E607010BD10B504F0E5F80400D4 +:104F700000D1FFDF6078401C607010BD1CB5ADF83B +:104F800000008DF802308DF803108DF8042068467B +:104F90000CF01DFF04F064F91CBD0CB529A2D2E988 +:104FA0000012CDE900120079694601EB501000783B +:104FB0000CBD0278520804D0012A02D043F202202C +:104FC0007047FEF7AFB91FB56A46FFF7A3FF684603 +:104FD0000CF06EFC04F044F904B010BD70B50C0088 +:104FE00006460DD0FEF72FFA050000D1FFDFA680A0 +:104FF00028892081288960816889A081A889E08129 +:105000003DE510B500231A4603E0845C2343521C9F +:10501000D2B28A42F9D30BB1002010BD012010BDDD +:1050200000B540B1012805D0022803D0032804D0E0 +:10503000FFDF002000BDFF2000BD042000BD0000F8 +:1050400024620200070605040302010010B50446AD +:10505000FCF7FFF808B1102010BD2078C0F3021053 +:10506000042807D86078072804D3A178102901D82C +:10507000814201D2072010BDE078410706D4217992 +:105080004A0703D4000701D4080701D5062010BD44 +:10509000002010BD10B513785C08837F64F3C7133C +:1050A000837713789C08C37F64F30003C377107879 +:1050B000C309487863F34100487013781C090B78E2 +:1050C00064F347130B701378DB0863F30000487038 +:1050D0005078487110BD10B5C4780B7864F30003A4 +:1050E0000B70C478640864F341030B70C478A4089F +:1050F00064F382030B70C478E40864F3C3030B7099 +:105100000379117863F30001117003795B0863F38D +:105110004101117003799B0863F3820111700079DA +:10512000C00860F3C301117010BD70B514460D4680 +:10513000064604F073FA80B10178182221F00F01BD +:10514000891C21F0F001A03100F8081B214609F06C +:105150006CF9BDE8704004F064BA29463046BDE8F9 +:1051600070401322FEF772B92DE9F047064608A8F1 +:10517000904690E8300489461F46142200212846B4 +:1051800009F07DF90021CAF80010B8F1000F03D032 +:10519000B9F1000F03D114E03878C00711D02068AE +:1051A000FCF77DF8C0BBB8F1000F07D120681230C2 +:1051B00028602068143068602068A8602168CAF8F8 +:1051C00000103878800724D56068FCF786F818BB93 +:1051D000B9F1000F21D0FFF7CFF80168C6F86811C8 +:1051E0008188A6F86C11807986F86E0101F015FDB2 +:1051F000F94FEF60626862B196F8680106F26911D2 +:1052000040081032FEF7EFF810223946606809F0C6 +:105210000CF90020BDE8F08706E0606820B1E86086 +:105220006068C6F86401F4E71020F3E730B505467E +:1052300008780C4620F00F00401C20F0F0011031DF +:1052400021700020607095F8230030B104280FD041 +:10525000052811D0062814D0FFDF20780121B1EBFA +:10526000101F04D295F8200000F01F00607030BDC0 +:1052700021F0F000203002E021F0F000303020700A +:10528000EBE721F0F0004030F9E7F0B591B00227EC +:1052900015460C4606463A46ADF80870092103ABA0 +:1052A00005F04BF80490002810D004208DF804007D +:1052B0008DF80170E034099605948DF818500AA90C +:1052C00068460FF046FB00B1FFDF012011B0F0BDD2 +:1052D00010B588B00C460A99ADF80000CBB118683B +:1052E000CDF80200D3F80400CDF80600ADF80A208E +:1052F000102203A809F099F868460CF049FB03F066 +:10530000AFFF002803D1A17F41F01001A17708B0C1 +:1053100010BD0020CDF80200E6E72DE9F84F064663 +:10532000808A0D4680B28246FEF78DF804463078BA +:10533000DFF8A48200274FF00209A8F120080F2807 +:1053400070D2DFE800F06FF23708387D8CC8F1F0DA +:10535000EFF35FF3F300A07F00F00300022809D011 +:105360005FF0000080F0010150460DF0F7FD0500F0 +:1053700003D101E00120F5E7FFDF98F85C10C907D1 +:1053800002D0D8F860000BE0032105F11D0011F0F8 +:10539000FCF8D5F81D009149B0FBF1F201FB1200B9 +:1053A000C5F81D0070686867B068A8672078252870 +:1053B00000D0FFDFCAE0A07F00F00300022809D080 +:1053C0005FF0000080F0010150460DF0C7FD0600BF +:1053D00003D101E00120F5E7FFDF3078810702D536 +:1053E0002178252904D040F001003070BDE8F88F05 +:1053F00085F80090307F287106F11D002D36C5E933 +:105400000206F3E7A07F00F00300022808D0002086 +:1054100080F0010150460DF0A1FD040004D102E02E +:105420000120F5E7A7E1FFDF2078C10604D50720BA +:1054300028703D346C60D9E740F008002070D5E753 +:10544000E07F000700D5FFDF307CB28800F0010369 +:1054500001B05046BDE8F04F092106F04CB804B940 +:10546000FFDF716821B1102204F1240008F0DDFF94 +:1054700028212046FDF74EFEA07F00F00300022801 +:105480000ED104F12400002300901A462146504614 +:10549000FFF71EFF112807D029212046FDF73AFE0D +:1054A000307A84F82000A1E7A07F000700D5FFDF55 +:1054B00014F81E0F40F008002070E782A761E76132 +:1054C000C109607861F34100014660F382016170B7 +:1054D000307AE0708AE7A07F00F00300022809D04C +:1054E0005FF0000080F0010150460DF037FD040030 +:1054F00003D101E00120F5E7FFDF022104F185007F +:1055000011F043F80420287004F5B4706860B4F812 +:1055100085002882304810387C346C61C5E90280EF +:1055200064E703E024E15BE02DE015E0A07F00F0FC +:105530000300022807D0002080F0010150460DF042 +:105540000DFD18B901E00120F6E7FFDF32462146E4 +:105550005046BDE8F84FE8E504B9FFDF2078212880 +:10556000A1D93079012803D1E07F40F00800E0772D +:10557000324621465046FFF7D8FD2046BDE8F84F99 +:105580002321FDF7C7BD3279AA8005F1080309215F +:10559000504604F0D2FEE86010B10520287025E7DF +:1055A000A07F00F00300022808D0002080F0010155 +:1055B00050460DF0D3FC040003D101E00120F5E7D3 +:1055C000FFDF04F1620102231022081F0DF04DFBE2 +:1055D00007703179417009E75402002040420F0002 +:1055E000A07F00F00300022808D0002080F0010115 +:1055F00050460DF0B3FC050003D101E00120F5E7B2 +:10560000FFDF95F8840000F0030001287AD1A07F25 +:1056100000F00307E07F10F0010602D0022F04D152 +:1056200033E095F8A000C0072BD0D5F8601121B366 +:1056300095F88320087C62F387000874A17FCA096B +:10564000D5F8601162F341000874D5F8601166F373 +:1056500000000874AEB1D5F86001102204F12401F5 +:10566000883508F0E2FE287E40F001002876287890 +:1056700020F0010005F8880900E016B1022F04D0DF +:105680002DE095F88800C00727D0D5F85C1121B32C +:1056900095F88320087C62F387000874A17FCA090B +:1056A000D5F85C1162F341000874D5F85C1166F31B +:1056B000000008748EB1D5F85C01102204F12401B9 +:1056C000883508F0B2FE287840F0010005F8180B84 +:1056D000287820F0010005F8A009022F44D000200E +:1056E00000EB400005EBC00090F88800800709D56A +:1056F00095F87C00D5F86421400805F17D01103251 +:10570000FDF771FE8DF8009095F884006A4600F070 +:1057100003008DF8010095F888108DF8021095F8B7 +:10572000A0008DF803002146504601F05FFA207872 +:10573000252805D0212807D0FFDF2078222803D98B +:1057400022212046FDF7E6FCA07F00F0030002289E +:105750000CD0002080F0010150460DF011FC002813 +:105760003FF44FAEFFDF41E60120B9E70120F1E74A +:10577000706847703AE6FFDF38E670B5FE4C0025EA +:1057800084F85C5025660FF0B0F804F11001204653 +:1057900003F000FF84F8305070BD70B50D46FDF782 +:1057A00052FE040000D1FFDF4FF4B87200212846FA +:1057B00008F065FE04F124002861A07F00F00300DA +:1057C000022809D05FF0010105F1E0000FF08EF82A +:1057D000002800D0FFDF70BD0221F5E70A46014630 +:1057E00002F1E0000FF0A3B870B50546406886B03E +:1057F00001780A2906D00D2933D00E292FD0FFDFDA +:1058000006B070BD86883046FDF71DFE040000D14D +:10581000FFDF20782128F3D028281BD168680221D7 +:105820000E3001F0D8F9A8B168680821801D01F098 +:10583000D2F978B104F1240130460CF065FA03F096 +:105840000FFD00B1FFDF06B02046BDE87040292102 +:10585000FDF760BC06B0BDE8704003F0E2BE012178 +:1058600001726868C6883046FDF7EDFD040000D17E +:10587000FFDFA07F00F00301022902D120F0100019 +:10588000A077207821280AD06868017A09B10079C8 +:1058900080B1A07F00F00300022862D0FFDFA07F6C +:1058A00000F003000228ABD1FEF71FF80028A7D0B4 +:1058B000FFDFA5E703F0B5FEA17F08062BD5E07F4B +:1058C000C00705D094F8200000F01F00102820D059 +:1058D0005FF0050084F82300207829281DD02428B3 +:1058E000DDD13146042011F037F922212046FDF7A1 +:1058F00011FCA07F00F00300022830D05FF0000010 +:1059000080F0010130460DF03BFB0028C7D0FFDFDF +:10591000C5E70620DEE70420DCE701F003000228EB +:1059200008D0002080F0010130460DF017FB050083 +:1059300003D101E00120F5E7FFDF25212046FDF737 +:10594000E9FB03208DF80000694605F1E0000EF048 +:10595000E5FF0228A3D00028A1D0FFDF9FE70120A8 +:10596000CEE703F05EFE9AE72DE9F04387B0994653 +:10597000164688460746FDF766FD04004BD02078A2 +:10598000222848D3232846D0E07F000743D4A07FB5 +:1059900000F00300022809D05FF0000080F0010150 +:1059A00038460DF0DBFA050002D00CE00120F5E7E7 +:1059B000A07F00F00300022805D001210022384614 +:1059C0000DF0C3FA05466946284601F036F90098FD +:1059D00000B9FFDF45B10098E03505612078222845 +:1059E00006D0242804D007E000990020086103E0D5 +:1059F00025212046FDF78EFB00980121417047626A +:105A0000868001A9C0E902890EF0A3FF022802D016 +:105A1000002800D0FFDF07B0BDE8F08370B586B086 +:105A20000546FDF710FD017822291ED9807F00F080 +:105A30000300022808D0002080F0010128460DF064 +:105A40008DFA04002FD101E00120F5E7FFDF2AE005 +:105A5000B4F85E0004F1620630440178427829B15E +:105A600021462846FFF711FCB0B9C9E6ADF804207D +:105A70000921284602AB04F060FC03900028F4D012 +:105A800005208DF80000694604F1E0000EF046FFA5 +:105A9000022801D000B1FFDF02231022314604F1B9 +:105AA0005E000DF018F9B4F860000028D0D1A7E628 +:105AB00010B586B00446FDF7C6FC017822291BD933 +:105AC000807F00F00300022808D0002080F0010150 +:105AD00020460DF043FA040003D101E00120F5E770 +:105AE000FFDF06208DF80000694604F1E0000EF0AB +:105AF00015FF002800D0FFDF06B010BD2DE9F05FD4 +:105B000005460C4600270078904601093E4604F100 +:105B1000080BBA4602297DD0072902D00A2909D1EB +:105B200046E0686801780A2905D00D2930D00E2991 +:105B30002ED0FFDFBBE114271C26002C6BD0808801 +:105B4000A080FDF780FC5FEA000900D1FFDF99F833 +:105B500017005A46400809F11801FDF744FC68682F +:105B6000C0892082696851F8060FC4F8120048689D +:105B7000C4F81600A07E01E03402002020F00600E8 +:105B800040F00100A07699F81E0040F020014DE0A1 +:105B90001A270A26002CD1D0C088A080FDF753FC1C +:105BA000050000D1FFDF59462846FFF73FFB7EE1A5 +:105BB0000CB1A88BA080287A0B287DD006DC0128A8 +:105BC0007BD0022808D0032804D135E00D2875D0F9 +:105BD0000E2874D0FFDF6AE11E270926002CADD005 +:105BE000A088FDF730FC5FEA000900D1FFDF287BC9 +:105BF00000F003000128207A1BD020F00100207261 +:105C0000297B890861F341002072297BC90861F36F +:105C1000820001E041E1F2E02072297B090961F391 +:105C2000C300207299F81E0040F0400189F81E1050 +:105C30003DE140F00100E2E713270D26002CAAD039 +:105C4000A088FDF700FC8146807F00F00300022859 +:105C500008D0002080F00101A0880DF07FF9050038 +:105C600003D101E00120F5E7FFDF99F81E0000F005 +:105C70000302022A50D0686F817801F003010129E4 +:105C8000217A4BD021F00101217283789B0863F3C4 +:105C9000410121728378DB0863F3820121728378EA +:105CA0001B0963F3C3012172037863F306112172A8 +:105CB000437863F3C71103E061E0A9E090E0A1E05D +:105CC000217284F809A0C178A172022A29D0027930 +:105CD000E17A62F30001E1720279520862F3410154 +:105CE000E1720279920862F38201E1720279D208CC +:105CF00062F3C301E1724279217B62F300012173F7 +:105D00004279520862F3410121734279920862F3A9 +:105D100082012173407928E0A86FADE741F00101CD +:105D2000B2E74279E17A62F30001E1724279520806 +:105D300062F34101E1724279920862F38201E172F9 +:105D40004279D20862F3C301E1720279217B62F3E6 +:105D5000000121730279520862F341012173027933 +:105D6000920862F3820121730079C00860F3C301D5 +:105D7000217399F80000232831D9262140E0182703 +:105D80001026E4B3A088FDF75EFB8346807F00F019 +:105D90000300022809D0002080F00101A0880DF046 +:105DA000DDF85FEA000903D101E00120F4E7FFDF3D +:105DB000E868A06099F8000040F0040189F800103C +:105DC00099F80100800708D5012020739BF8000096 +:105DD00023286CD92721584651E084F80CA066E0AE +:105DE00015270F265CB1A088FDF72DFB8146062202 +:105DF0005946E86808F0AFFB0120A073A0E041E03D +:105E000048463CE016270926E4B3287B20724EE082 +:105E1000287B19270E26ACB3C4F808A0A4F80CA060 +:105E2000012807D0022805D0032805D0042803D074 +:105E3000FFDF0DE0207207E0697B042801F00F010D +:105E400041F0800121721ED0607A20F00300607260 +:105E5000A088FDF7F8FA05460078212827D02328E6 +:105E600000D0FFDFA87F00F00300022813D000203D +:105E700080F00101A0880DF083F822212846FDF76B +:105E800049F914E004E0607A20F00300401CDEE7EA +:105E9000A8F8006010E00120EAE70CB16888A08053 +:105EA000287A68B301280AD002284FD0FFDFA8F86B +:105EB00000600CB1278066800020BDE8F09F1527A8 +:105EC0000F26002CE4D0A088FDF7BDFA807F00F0FB +:105ED0000300022808D0002080F00101A0880DF006 +:105EE0003DF8050003D101E00120F5E7FFDFD5F81B +:105EF0001D000622594608F02EFB84F80EA0D6E7B6 +:105F000017270926002CC3D0A088FDF79CFA8146EC +:105F1000807F00F00300022808D0002080F00101FB +:105F2000A0880DF01BF8050003D101E00120F5E782 +:105F3000FFDF6878800701D5022000E00120207291 +:105F400099F800002328B2D9272159E719270E26EE +:105F5000002C9DD0A088FDF776FA5FEA000900D1F9 +:105F6000FFDFC4F808A0A4F80CA084F808A0A07A69 +:105F700040F00300A07299F81E10C90961F3820075 +:105F8000A07299F81F2099F81E1012EAD11F05D0AF +:105F900099F8201001F01F0110292BD020F00800E3 +:105FA000A07299F81F10607A61F3C3006072697A79 +:105FB00001F003010129A2D140F00400607299F8B8 +:105FC0001E0000F003000228E87A16D0217B60F35F +:105FD00000012173AA7A607B62F300006073EA7AA1 +:105FE000520862F341012173A97A490861F3410023 +:105FF00060735CE740F00800D2E7617B60F300016A +:106000006173AA7A207B62F300002073EA7A520857 +:1060100062F341016173A97A490861F34100207379 +:1060200045E710B5F74C30B10146102204F12000CD +:1060300008F0FBF9012084F8300010BD10B50446CB +:1060400000F0EBFDEF4920461022BDE81040203162 +:1060500008F0EBB970B5EB4D06004FF0000413D01B +:10606000FBF7F7F808B110240CE00621304608F0E1 +:1060700059FA411C05D028665FF0010085F85C00E4 +:1060800000E00724204670BD0020F7E7007810F0FC +:106090000F0204D0012A05D0022A0CD110E0000919 +:1060A00009D10AE00009012807D0022805D00328F9 +:1060B00003D0042801D007207047087000207047E3 +:1060C0000620704705282AD2DFE800F003070F17E3 +:1060D0001F00087820F0FF001EE0087820F00F0075 +:1060E000401C20F0F000103016E0087820F00F007F +:1060F000401C20F0F00020300EE0087820F00F0067 +:10610000401C20F0F000303006E0087820F00F004E +:10611000401C20F0F000403008700020704707203D +:1061200070472DE9F041804688B00D4600270846AB +:10613000FBF7DCF8A8B94046FDF785F9040003D069 +:106140002078222815D104E043F2020008B0BDE80F +:10615000F08145B9A07F410603D500F00300022875 +:1061600001D01020F2E7A07FC10601D4010702D5BB +:106170000DB10820EAE7E17F090701D50D20E5E729 +:1061800000F0030002280DD165B12846FEF75EFF3E +:106190000700DBD1FBF726FB20B9E878800701D5A3 +:1061A0000620D3E7A07F00F00300022808D00020DB +:1061B00080F0010140460CF0D1FE060002D00FE055 +:1061C0000120F5E7A07F00F0030002280ED0002098 +:1061D00080F00101002240460CF0B7FE060007D017 +:1061E000A07F00F00300022804D009E00120EFE7BF +:1061F0000420ABE725B12A4631462046FEF74AFF88 +:106200006946304600F019FD009800B9FFDF00999B +:10621000022006F1E0024870C1F824804A610022A1 +:106220000A81A27F02F00302022A1CD00120087119 +:10623000287800F00102087E62F3010008762A78CF +:10624000520862F3820008762A78920862F3C3004B +:1062500008762A78D20862F30410087624212046B2 +:10626000FCF758FF33E035B30871301D8861307892 +:10627000400908777078C0F340004877287800F02C +:106280000102887F62F301008877A27FD20962F35E +:1062900082008877E27F62F3C3008877727862F3C6 +:1062A00004108877A878C87701F1210228462031A8 +:1062B000FEF711FF03E00320087105200876252171 +:1062C0002046FCF727FFA07F20F04000A07701A91F +:1062D00000980EF03EFB022801D000B1FFDF3846E7 +:1062E00034E72DE9FF4F9346474A0D4699B09A4649 +:1062F00007CA0AAB002783E807001998FDF7A3F83F +:10630000060006D03078262806D008201DB0BDE84B +:10631000F08F43F20200F9E7B07F00F00309B9F112 +:10632000020F11D04DB95846FEF790FE0028EDD16E +:10633000B07F00F00300022806D0BBF1000F11D09F +:10634000FBF750FA20B10DE0BBF1000F4FD109E08F +:1063500006200CF0ABFD28B19BF80300800701D5A7 +:106360000620D3E7B07F00F00300022808D0002009 +:1063700080F0010119980CF0F1FD040003D101E057 +:106380000120F5E7FFDF852D27D007DCEDB1812D5A +:106390001DD0822D1DD0832D08D11CE0862D1ED04E +:1063A000882D1ED0892D1ED08A2D1ED00F20207141 +:1063B0000F281CD003F032F9D8B101208DF83C0031 +:1063C000201D10902079B0B156E10020EFE70120A8 +:1063D000EDE70220EBE70320E9E70520E7E70620E9 +:1063E000E5E70820E3E70920E1E70A20DFE70720E7 +:1063F0008CE711208AE7B9F1020F07D0A56F07D10A +:10640000A06F06E0340200202C620200656FF6E700 +:10641000606F80462DD04FF0010001904FF00200D8 +:1064200000905A4621463046FEF734FE9BF80000A5 +:1064300000F00101A87861F30100A870B17FC909DB +:1064400061F38200A870F17F61F3C300A8706178E6 +:1064500061F30410A8702078400928706078C0F3B8 +:10646000400068709BF80200E87000206871287195 +:1064700003E00220019001200090A87898F8021013 +:10648000C0F3C000C1F3C001084003902CD05046B7 +:10649000FAF7DFFEC0BBDAF80C00FAF7DAFE98BBB9 +:1064A000DAF81C00FAF7D5FE70BBDAF80C00A06031 +:1064B000DAF81C00E060607898F8012042EA5001A8 +:1064C00061F34100607098F80210C0B200EA111147 +:1064D00061F30000607000202077009906F117003A +:1064E000022907D0012106E0607898F8012002EA2D +:1064F0005001E5E7002104EB810148610199701C1E +:10650000022902D0012101E028E0002104EB8101F1 +:106510004861A87800F00300012857D198F80200DC +:1065200000F00300012851D1B9F1020F04D02A1D57 +:10653000691D5846FEF7CFFD287998F804100840E9 +:106540008DF83400697998F8052011408DF83810DD +:1065500008433BD05046FAF77CFE08B11020D5E640 +:106560000AF110018B46B9F1020F17D0084600213D +:1065700004F18C03CDE9000304F5AE7202920DAB79 +:106580002046039AFEF7F0FD0028E8D1B9F1020F8A +:1065900008D0504608D14FF0010107E050464FF0B7 +:1065A0000101E5E75846F5E74FF0000104F1A403C7 +:1065B000CDE9000304F5B072029281F001010EAB47 +:1065C0002046039AFEF7D0FD0028C8D160788007E6 +:1065D00033D4A87898F80210C0F38000C1F380018A +:1065E00008432AD0297898F800000AAAB9F1020FC6 +:1065F00006D032F811204300DA4002F003070AE027 +:1066000032F810204B00DA4012F0030705D0012FBA +:106610000AD0022F0AD0032F06D0039A6AB10129AB +:1066200006D0042904D008E00227F6E70127F4E7A2 +:10663000012801D0042800D10427B07F40F0800059 +:10664000B077F17F039860F30001F17760788007FD +:1066500005D50320A071039870B9002029E002201D +:10666000022F18D0012F18D0042F2AD00020A0719B +:10667000B07F20F08000B07725213046FCF74AFD3E +:106680000FA904F1E0000EF049F910B1022800D082 +:10669000FFDF00203AE6A071DFE7A0710D220021A4 +:1066A00004F1200007F0EBFE207840F0020020709B +:1066B00001208DF85C0017AA3146199800F096FA6F +:1066C000DAE70120A071D7E72DE9F04387B09046C3 +:1066D000894604460025FCF7B6FE060006D0307851 +:1066E000272806D0082007B0BDE8F08343F2020057 +:1066F000F9E7B07F00F00300022809D05FF0000046 +:1067000080F0010120460CF029FC040003D101E0D7 +:106710000120F5E7FFDFA7795FEA090005D001282E +:1067200021D0B9F1020F26D110E0B8F1000F22D12B +:10673000012F05D0022F05D0032F05D0FFDF2EE05B +:106740000C252CE001252AE0022528E04046FAF736 +:1067500080FDB0B9032F0ED11022414604F11D0077 +:1067600007F063FE1BE0012F02D0022F03D104E0EB +:10677000B8F1000F13D00720B5E74046FAF769FDDE +:1067800008B11020AFE71022002104F11D0007F02E +:1067900076FE0621404607F0C5FEC4F81D002078AD +:1067A000252140F0020020703046FCF7B3FC207831 +:1067B000C10713D020F00100207002208DF80000E6 +:1067C00004F11D0002908DF804506946C3300EF0AC +:1067D000A5F8022803D010B1FFDF00E025770020E4 +:1067E00081E730B587B00D460446FCF72CFE98B122 +:1067F000807F00F00300022811D0002080F001010A +:1068000020460CF0ABFB04000ED02846FAF721FD21 +:1068100038B1102007B030BD43F20200FAE7012082 +:10682000ECE72078400701D40820F3E7294604F17B +:106830003D002022054607F0F8FD207840F01000CA +:10684000207001070FD520F00800207007208DF878 +:106850000000694604F1E00001950EF05FF802289F +:1068600001D000B1FFDF0020D4E770B50D46064629 +:10687000FCF7E9FD18B10178272921D102E043F2A4 +:10688000020070BD807F00F00300022808D00020C5 +:1068900080F0010130460CF061FB040003D101E0FF +:1068A0000120F5E7FFDFA079022809D16078C00751 +:1068B00006D02A4621463046FEF7E7FC10B10FE02D +:1068C000082070BDB4F860000E280BD204F16201FC +:1068D00002231022081F0CF0C8F901210170457035 +:1068E000002070BD112070BD70B5064614460D46DF +:1068F0000846FAF7AEFC18B92046FAF7D0FC08B102 +:10690000102070BDA6F57F40FF380ED03046FCF752 +:106910009AFD38B1417822464B08811C1846FCF795 +:1069200062FD07E043F2020070BD2046FDF78CFDDA +:106930000028F9D11021E01D0FF027FEE21D2946A5 +:1069400004F1170000F089F9002070BD2DE9F04135 +:1069500004468AB01546884600270846FAF7C6FC62 +:1069600018B92846FAF7C2FC18B110200AB0BDE8E1 +:10697000F0812046FCF767FD060003D03078272819 +:106980001BD102E043F20200F0E7B07F00F0030009 +:10699000022809D05FF0000080F0010120460CF0D1 +:1069A000DDFA040003D101E00120F5E7FFDF2078E4 +:1069B000400702D56078800701D40820D6E7B07F71 +:1069C00000F00300022803D0A06F03D1A16F02E002 +:1069D000606FFAE7616F407800B19DB1487810B1FF +:1069E000B8F1000F0ED0ADB1EA1D06A8E16800F0C5 +:1069F00034F9102206A905F1170007F0E9FC18B1D7 +:106A0000042707E00720B1E71022E91D04F12D005B +:106A100007F00BFDB8F1000F06D0102208F10701B6 +:106A200004F11D0007F001FD2078252140F002004F +:106A300020703046FCF76EFB2078C10715D020F09F +:106A40000100207002208DF8000004F11D0002906A +:106A5000103003908DF804706946B3300DF05EFF7E +:106A6000022803D010B1FFDF00E0277700207DE788 +:106A7000F8B515460E460746FCF7E5FC040004D0C1 +:106A80002078222804D00820F8BD43F20200F8BD87 +:106A9000A07F00F00300022802D043F20500F8BDF9 +:106AA0003046FAF7D6FB18B92846FAF7D2FB08B1F8 +:106AB0001020F8BD00953288B31C21463846FEF7F9 +:106AC00007FC112815D00028F3D1297C4A08A17FA2 +:106AD00062F3C711A177297CE27F61F30002E277BC +:106AE000297C890884F82010A17F21F04001A1773A +:106AF000F8BDA17F0907FBD4D6F80200C4F8360020 +:106B0000D6F80600C4F83A003088A086102229463C +:106B100004F1240007F089FC287C4108E07F61F340 +:106B20004100E077297C61F38200E077287C8008CF +:106B300084F82100A07F40F00800A0770020D3E770 +:106B400070B50D4606460BB1072070BDFCF77BFC07 +:106B5000040007D02078222802D3A07F800604D426 +:106B6000082070BD43F2020070BDADB12946304629 +:106B70000BF0CAF802F074FB297C4A08A17F62F38B +:106B8000C711A177297CE27F61F30002E277297CBB +:106B9000890884F8201004E030460BF0D8F802F0A1 +:106BA0005FFBA17F21F02001A17770BD70B50D467C +:106BB000FCF749FC040005D02846FAF770FB20B129 +:106BC000102070BD43F2020070BD29462046FEF73A +:106BD0002DFB002070BD04E010F8012B0AB100204D +:106BE0007047491E89B2F7D20120704770B515462B +:106BF000064602F013FD040000D1FFDF207820F0EC +:106C00000F00801C20F0F000203020706680286883 +:106C1000A060BDE8704002F004BD10B5134C94F8BC +:106C20003000002808D104F12001A1F110000DF07E +:106C3000B7FE012084F8300010BD10B190F8B920E3 +:106C40002AB10A4890F8350018B1002003E0B830A6 +:106C500001E0064834300860704708B5002300930F +:106C600013460A460CF079FB08BD000034020020F0 +:106C700018B18178012938D101E0102070470188CE +:106C800042F60112881A914231D018DC42F6010214 +:106C9000A1EB020091422AD00CDC41B3B1F5C05FF8 +:106CA00025D06FF4C050081821D0A0F57060FF38CF +:106CB0001BD11CE001281AD002280AD117E0B0F538 +:106CC000807F14D008DC012811D002280FD00328BF +:106CD0000DD0FF2809D10AE0B0F5817F07D0A0F5DB +:106CE0008070033803D0012801D0002070470F20A6 +:106CF00070470A281FD008DC0A2818D2DFE800F005 +:106D0000191B1F1F171F231D1F21102815D008DC5A +:106D10000B2812D00C2810D00D2816D00F2806D121 +:106D20000DE011280BD084280BD087280FD003202A +:106D300070470020704705207047072070470F20DC +:106D4000704704207047062070470C20704743F2BC +:106D50000200704738B50C46050041D06946FFF780 +:106D600095F9002819D19DF80010607861F30200B0 +:106D700060706946681CFFF789F900280DD19DF8FD +:106D80000010607861F3C5006070A978C1F341011B +:106D9000012903D0022905D0072038BD217821F030 +:106DA000200102E0217841F020012170410704D048 +:106DB000A978C90861F386106070607810F0380F08 +:106DC00007D0A978090961F3C710607010F0380F77 +:106DD00002D16078400603D5207840F04000207052 +:106DE000002038BD70B50446002008801546606854 +:106DF000FFF7B0FF002816D12089A189884211D859 +:106E000060688078C0070AD0B1F5007F0AD840F2E8 +:106E10000120B1FBF0F200FB1210288007E0B1F571 +:106E2000FF7F01D90C2070BD01F2012129800020D3 +:106E300070BD10B50478137864F300031370047800 +:106E4000640864F3410313700478A40864F38203B4 +:106E500013700478E40864F3C303137004782409FE +:106E600064F3041313700478640964F34513137016 +:106E70000078800960F38613137031B10878C10778 +:106E800001D1800701D5012000E0002060F3C71385 +:106E9000137010BD4278530702D002F0070306E0DA +:106EA00012F0380F02D0C2F3C20300E001234A7887 +:106EB00063F302024A70407810F0380F02D0C0F33A +:106EC000C20005E0430702D000F0070000E0012007 +:106ED00060F3C5024A7070472DE9F04F95B00D0080 +:106EE000824613D012220021284607F0C8FA4FF636 +:106EF000FF7B05AA0121584607F089F800242646A1 +:106F000037464FF420586FF4205972E0102015B026 +:106F1000BDE8F08F9DF81E0001280AD1BDF81C10B5 +:106F200041450BD011EB09000AD001280CD00228F2 +:106F30000CD0042C0ED0052C0FD10DE0012400E064 +:106F40000224BDF81A6008E0032406E00424BDF81A +:106F50001A7002E0052400E00624BDF81A1051451D +:106F600047D12C74BEB34FF0000810AA4FF0070AA7 +:106F7000CDE90282CDE900A80DF13C091023CDF83E +:106F8000109042463146584607F011F908BBBDF84B +:106F90003C002A46C0B210A90DF078FDC8B9AE81F8 +:106FA000CFB1CDE900A80DF1080C0AAE40468CE83F +:106FB0004102132300223946584607F0F8F840B939 +:106FC000BDF83C00F11CC01EC0B22A1D0DF05EFDD4 +:106FD00010B103209BE70AE0BDF82900E881062CE8 +:106FE00005D19DF81E00A872BDF81C002881002064 +:106FF0008DE705A807F017F800288BD0FFF779FE7A +:1070000085E72DE9F0471C46DDE90978DDF8209099 +:1070100015460E00824600D1FFDF0CB1208818B162 +:10702000D5B11120BDE8F087022D01D0012100E08B +:10703000002106F1140005F0B3FEA8F80000024696 +:107040003B462946504603F078F9C9F8000008B9D4 +:10705000A41C3C600020E5E71320E3E7F0B41446ED +:10706000DDE904528DB1002314B1022C09D101E0F5 +:10707000012306E00D7CEE0703D025F00105012376 +:107080000D742146F0BC04F036BA1A80F0BC70478B +:107090002DE9FE4F91461A881C468A468046FAB171 +:1070A00002AB494603F049F9050019D04046A61C39 +:1070B00027880CF098F83246072629463B4600966A +:1070C0000BF0A5FC20882346CDE900504A465146E6 +:1070D0004046FFF7C3FF002020800120BDE8FE8F5F +:1070E0000020FBE72DE9F04786B082460EA89046C7 +:1070F00090E8B000894604AA05A903A88DE8070016 +:107100001E462A4621465046FFF77BFF039901B1F0 +:1071100001213970002818D1FA4904F1140204AB96 +:107120000860039805998DE8070042464946504695 +:1071300006F0E9F9A8B1092811D2DFE800F0050846 +:107140000510100A0C0C0E00002006B06AE7112092 +:10715000FBE70720F9E70820F7E70D20F5E7032014 +:10716000F3E7BDF810100398CDE9000133462A4635 +:1071700021465046FFF772FFE6E72DE9F04389B05C +:107180001646DDE910870D4681461C461422002173 +:1071900003A807F074F9012002218DF810108DF872 +:1071A0000C008DF81170ADF8146064B1A278D207AC +:1071B00009D08DF81600E088ADF81A00A088ADF867 +:1071C0001800A068079008A80095CDE90110424674 +:1071D00003A948466B68FFF785FF09B0BDE8F08357 +:1071E000F0B58BB000240646069407940727089450 +:1071F00005A80994019400970294CDE903400D4637 +:1072000010232246304606F0D2FF78B90AA806A914 +:10721000019400970294CDE90310BDF814300022C8 +:107220002946304606F061FD002801D0FFF761FDD8 +:107230000BB0F0BD06F0F2BB2DE9FC410C468046D8 +:10724000002602F0EBF9054620780D287ED2DFE813 +:1072500000F0BC0713B325BD49496383AF959B007C +:10726000A848006820B1417841F010014170ADE0BC +:10727000404602F003FAA9E0042140460BF06EFEFE +:10728000070000D1FFDF07F11401404605F01DFDA6 +:10729000A5BB13214046FDF7BDFB97E00421404606 +:1072A0000BF05CFE070000D1FFDFE088ADF80000C6 +:1072B0000020B8819DF80000010704D5C00602D562 +:1072C000A088B88105E09DF8010040067ED5A08821 +:1072D000F88105B9FFDF22462946404601F0C0FC8F +:1072E000022673E0E188ADF800109DF80110090650 +:1072F0000FD5072803D006280AD00AE024E004218D +:1073000040460BF02BFE060000D1FFDFA088F08185 +:107310000226CDB9FFDF17E0042140460BF01EFE28 +:10732000070000D1FFDF07F1140006F0AEFB90F07C +:10733000010F02D1E079000648D5387C022640F0E2 +:107340000200387405B9FFDF224600E03DE029461F +:10735000404601F085FC39E0042140460BF0FEFD7B +:10736000017C002D01F00206C1F340016171017C36 +:1073700021F002010174E7D1FFDFE5E702260121D8 +:10738000404602F0ADF921E0042140460BF0E6FD55 +:107390000546606800902089ADF804000122694626 +:1073A000404602F0BEF9287C20F0020028740DE06F +:1073B000002DC9D1FFDFC7E7022600214046FBF7B9 +:1073C00081F8002DC0D1FFDFBEE7FFDF3046BDE80A +:1073D000FC813EB50C0009D001466B4601AA002095 +:1073E00006F06AFF20B1FFF784FC3EBD10203EBDD1 +:1073F00000202080A0709DF8050002A900F0070081 +:10740000FEF760FE50B99DF8080020709DF8050059 +:1074100002A9C0F3C200FEF755FE08B103203EBD2D +:107420009DF8080060709DF80500C109A07861F31F +:107430000410A0709DF80510890961F3C300A070C5 +:107440009DF80410890601D5022100E0012161F3B5 +:1074500042009DF8001061F30000A07000203EBDC6 +:1074600070B5144606460D4651EA040005D075B1C4 +:107470000846F9F732FF78B901E0072070BD2946C8 +:10748000304606F080FF10B1BDE8704031E454B1E1 +:107490002046F9F722FF08B1102070BD2146304682 +:1074A000BDE8704095E7002070BD2DE9FC5F0C46FB +:1074B00090460546002701780822007A3E46B2EB46 +:1074C000111F7DD104F10A0100910A31821E4FF093 +:1074D000020A04F1080B0191092A72D2DFE802F0D6 +:1074E000EDE005F528287BAACE00688804210BF082 +:1074F00035FD060000D1FFDFB08928B152270726ED +:10750000C3E000009802002051271026002C7DD0F7 +:107510006888A0800120A071A88900220099FFF747 +:107520009FFF002873D1A8892081288AE081D1E0BB +:10753000B5F81290072824D1E87B000621D5512701 +:1075400009F1140086B2002CE1D0A889002200992C +:10755000FFF786FF00285AD16888A08084F806A02B +:10756000A88920810120A073288A2082A4F8129083 +:10757000A88A009068884B46A969019A01F04CFBE3 +:10758000A8E0502709F1120086B2002C3ED0A8894D +:1075900000225946FFF764FF002838D16888A08090 +:1075A000A889E080287A072813D002202073288A2F +:1075B000E081E87BC0096073A4F81090A88A01E01C +:1075C00085E082E0009068884B4604F11202A969C8 +:1075D000D4E70120EAE7B5F81290512709F1140029 +:1075E00086B2002C66D0688804210BF0B7FC834675 +:1075F0006888A080A88900220099FFF731FF002841 +:107600006ED184F806A0A889208101E052E067E0ED +:107610000420A073288A2082A4F81290A88A0090DF +:1076200068884B46A969019A01F0F6FAA989ABF876 +:107630000E104FE06888FBF706FF074668880421B4 +:107640000BF08CFC064607B9FFDF06B9FFDF687B4D +:10765000C00702D05127142601E0502712264CB350 +:107660006888A080502F06D084F806A0287B594651 +:1076700001F0E2FA2EE0287BA11DF9E7FE49A88976 +:107680004989814205D1542706269CB16888A0808B +:1076900020E053270BE06888A080A889E08019E0EB +:1076A000688804210BF05AFC00B9FFDF5527082633 +:1076B000002CF0D1A8F8006011E056270726002C16 +:1076C000F8D06888A080002013E0FFDF02E00128E6 +:1076D00008D0FFDFA8F800600CB12780668000208A +:1076E000BDE8FC9F57270726002CE3D06888A080C0 +:1076F000687AA071EEE7401D20F0030009B1414314 +:10770000091D01EB4000704713B5DB4A00201071E2 +:10771000009848B1002468460BF03DFA002C02D1D5 +:10772000D64A009911601CBD01240020F4E770B511 +:107730000D461446064686B05C220021284606F017 +:107740009EFE04B9FFDFA0786874A27821882846DD +:1077500001F09DFA0020A881E881228805F114013A +:10776000304605F096FA6A460121304606F04FFC95 +:107770001AE000BF9DF80300000715D5BDF80610FC +:107780003046FFF72DFD9DF80300BDF8061040F0D0 +:1077900010008DF80300BDF80300ADF81400FF23BE +:1077A0003046059A06F0B7FD684606F03CFC002816 +:1077B000E0D006B070BD10B50C4601F1140005F024 +:1077C000A0FA0146627C2046BDE8104001F094BA60 +:1077D00030B50446A84891B04FF6FF75C18905AA97 +:1077E000284606F014FC30E09DF81E00A0422AD086 +:1077F00001282AD1BDF81C00B0F5205F03D042F665 +:107800000101884221D1002002AB0AAA0CA90190F3 +:1078100083E8070007200090BDF81A10102300220B +:10782000284606F0C4FC38B9BDF828000BAAC0B23F +:107830000CA90DF02BF910B1032011B030BD9DF84B +:107840002E00A04201D10020F7E705A806F0EBFBCF +:107850000028C9D00520F0E770B5054604210BF0DB +:107860007DFB040000D1FFDF04F114010C46284623 +:1078700005F02BFA21462846BDE8704005F02CBAE9 +:1078800070B58AB00C460646FBF7DDFD050014D046 +:107890002878222827D30CB1A08890B101208DF838 +:1078A0000C0003208DF8100000208DF8110054B159 +:1078B000A088ADF81800206807E043F202000AB083 +:1078C00070BD0920FBE7ADF8180005900421304693 +:1078D0000BF044FB040000D1FFDF04F1140005F0BD +:1078E00026FA000701D40820E9E701F097FE60B10D +:1078F00008A802210094CDE9011095F8232003A9DE +:1079000030466368FFF7EEFBD9E71120D7E72DE992 +:10791000F04FB2F802A0834689B01546894650461A +:10792000FBF791FD0746042150460BF017FB00269C +:10793000044605964FF002080696ADF81C6007B99C +:10794000FFDF04B9FFDF4146504603F03BFF50B96B +:1079500007AA06A905A88DE8070042462146504619 +:107960006368FFF74EFB444807AB0660DDE905128C +:1079700004F11400CDF80090CDE90320CDE90131E8 +:1079800097F82320594650466B6805F019FA06000F +:107990000AD0022E04D0032E14D0042E00D0FFDF14 +:1079A00009B03046BDE8F08FBDF81C000028F7D0C4 +:1079B0000599CDE900104246214650466368FFF71D +:1079C0004DFBEDE7687840F008006870E8E72DE9C6 +:1079D000F04F99B004464FF000082748ADF81C80DE +:1079E000ADF82080ADF82480A0F80880ADF81480B0 +:1079F000ADF81880ADF82C80ADF8288000791646D7 +:107A00000D464746012808D0022806D0032804D096 +:107A1000042802D0082019B0C4E72046F9F719FC61 +:107A200070BB2846F9F715FC50BB6068F9F75EFC9F +:107A300030BB606848B160892189884202D8B1F5BD +:107A4000007F01D90C20E6E780460EAA06A9284649 +:107A5000FFF7C8F90028DED168688078C0F34100DC +:107A6000022808D19DF8190010F0380F03D02869BA +:107A7000F9F733FC20B904E098020020140000203C +:107A800022E005A92069FFF765F90028C3D1206924 +:107A900048B1607880079DF8150000F0380001D5E6 +:107AA000F0B300E0E0BB9DF8140080060ED59DF811 +:107AB000150010F0380F03D06068F9F70EFC18B904 +:107AC0006068F9F713FC08B11020A4E70AA96069FF +:107AD000FFF740F900289ED1606940B19DF8290068 +:107AE00000F0070101293CD110F0380F39D00BA963 +:107AF000A069FFF72FF900288DD19DF82800800696 +:107B00002FD49DF82C0080062BD4A06950B19DF88D +:107B10002D0000F00701012923D110F0380F00E0FB +:107B20001FE01ED0E06818B10078D0B11C2818D230 +:107B30000FAA611C2046FFF77CF90121384661F34A +:107B40000F2082468DF85210B94642F603000F46C8 +:107B5000ADF850000DF13F0218A928680CF0B5FFF0 +:107B600008B1072057E79DF8600015A9CDF80090EF +:107B7000C01CCDE9019100F0FF0B00230BF20122A4 +:107B8000514614A806F06EF9F0BBBDF854000C90F5 +:107B9000FE482A8929690092CDE901106B89BDF858 +:107BA00038202868069906F05DF901007ED120781A +:107BB0004FF0020AC10601D480062BD5CDF80C90F7 +:107BC000606950B90AA906A8FFF764F99DF8290071 +:107BD00020F00700401C8DF829009DF8280008A916 +:107BE00040F0C8008DF828008DF8527042F602105F +:107BF000ADF8500003AACDF800A0CDE90121002383 +:107C000040F2032214A800E01EE00A9906F02AF9C7 +:107C100001004BD1DD484D4608385B460089ADF880 +:107C20003D000FA8CDE90290CDF80490CDF810905A +:107C30004FF007090022CDF80090BDF854104FF620 +:107C4000FF7006F052F810B1FFF753F8E3E69DF825 +:107C50003C00000624D52946012060F30F218DF851 +:107C600052704FF424500395ADF8500062789DF89F +:107C70000C00002362F300008DF80C006278CDF850 +:107C800000A0520862F341008DF80C0003AACDE970 +:107C9000012540F2032214A806F0E4F8010005D102 +:107CA000606888B32069A8B905A900E084E006A847 +:107CB000FFF7F0F86078800706D49DF8150020F0F3 +:107CC00038008DF8150005E09DF8140040F04000E4 +:107CD0008DF814008DF8527042F60110ADF8500086 +:107CE000208940F20121B0FBF1F201FB1202606831 +:107CF00009ABCDF80080CDE90103002314A8059954 +:107D000006F0B0F8010057D12078C00728D00395BD +:107D1000A06950B90BA906A8FFF7BCF89DF82D0083 +:107D200020F00700401C8DF82D009DF82C008DF8E8 +:107D3000527040F040008DF82C0042F60310ADF870 +:107D4000500007A903AACDF800A0CDE90121002326 +:107D500040F2032214A80B9906F084F801002BD1FD +:107D6000E06868B32946012060F30F218DF8527056 +:107D700042F60410ADF85000E068002302788DF858 +:107D8000582040788DF85900E06816AA4088ADF870 +:107D90005A00E06800798DF85C00E068C088ADF8B2 +:107DA0005D00CDF80090CDE901254FF4027214A8D2 +:107DB00006F058F8010003D00C9800F0C9FF2AE63D +:107DC000724803210838017156B100893080BDF82E +:107DD00024007080BDF82000B080BDF81C00F08049 +:107DE000002018E670B501258AB016460B4601281A +:107DF00002D0022816D104E08DF80E504FF4205026 +:107E000003E08DF80E5042F60100ADF80C005BB1B6 +:107E10000024601C60F30F2404AA08A918460CF083 +:107E200054FE18B107204AE5102048E504A99DF842 +:107E300020205648CDE90021801E029000232146D3 +:107E400003A802F2012206F00DF810B1FEF751FF6F +:107E500035E54E4808380EB1C188318005710020E3 +:107E60002DE5F0B593B0074601268DF83E6041F64A +:107E70000100ADF83C0012AA0FA93046FFF7B2FF8F +:107E8000002849D1414C0025083CEFB31C220021B9 +:107E900002A806F0F4FA9DF808008DF83E6040F064 +:107EA00020008DF8080042F60520ADF83C000E9544 +:107EB0009DF83A00119520F00600801C8DF83A00DC +:107EC0009DF838006A4620F0FF008DF838009DF8D4 +:107ED000390009A920F0FF008DF839000420ADF821 +:107EE0002C00ADF830000EA80A9011A80D900FA834 +:107EF0000990ADF82E5002A8FFF769FD00280BD1BC +:107F0000BDF80000608100E008E0BDF80400A08139 +:107F1000401CE0812571002013B0F0BD6581A58172 +:107F2000BDF84800F4E72DE9F74F1849A0B0002448 +:107F3000083917940A79A146012A04D0022A02D0EE +:107F4000082023B02EE5CA88824201D00620F8E737 +:107F500021988A46824201D10720F2E7012021467A +:107F600060F30F21ADF848004FF6FF780691ADF8A9 +:107F70004A808DF86E0042F6020B8DF872401CA903 +:107F8000ADF86CB0ADF87040139101E0A002002094 +:107F9000ADF8508012A806F075F800252E462F4641 +:107FA0000DAB072212A9404606F06FF878B10A28F7 +:107FB0005DD195B38EB3ADF86450ADF866609DF8B1 +:107FC0005E008DF8144019AC012864D06BE09DF878 +:107FD0003A001FB3012859D1BDF8381059451FD1B7 +:107FE00018A809A901940294CDE903100720009074 +:107FF000BDF8361010230022404606F0D8F8B0BB7A +:10800000BDF86000042801D006284AD1BDF824102C +:10801000219881423AD10F2093E73AE0012835D1E7 +:10802000BDF83800B0F5205F03D042F60101884268 +:108030002CD1BAF80600BDF83610884201D10127CC +:1080400000E0002705B19EB1219881421ED118A8F9 +:1080500009AA01940294CDE90320072000900D465F +:1080600010230022404606F0A2F800B902E02DE0FD +:108070004E460BE0BDF86000022801D0102810D158 +:10808000C0B217AA09A90CF001FD50B9BDF836908D +:1080900086E7052055E705A917A8221D0CF015FD58 +:1080A00008B103204DE79DF814000023001DC2B263 +:1080B0008DF8142022980092CDE901401BA8069962 +:1080C00005F0D0FE10B902228AF80420FEF711FE56 +:1080D00037E710B50B46401E88B084B205AA0021D0 +:1080E0001846FEF7A6FE00200DF1080C06AA05A909 +:1080F00001908CE807000720009001230022214610 +:108100004FF6FF7005F0F1FD0446BDF81800012898 +:1081100000D0FFDF2046FEF7ECFD08B010BDF0B543 +:10812000F74F044687B038790E46032804D0042858 +:1081300002D0082007B0F0BD04AA03A92046FEF72C +:1081400051FE0500F6D160688078C0F34100022836 +:108150000AD19DF80D0010F0380F05D02069F9F70D +:10816000BCF808B11020E5E7208905AA21698DE84F +:1081700007006389BDF810202068039905F072FE9E +:1081800010B1FEF7B6FDD5E716B1BDF8140030808A +:10819000042038712846CDE7F8B50C0006460CD00F +:1081A00001464FF6FF7500236A46284606F084F81C +:1081B00028B100BFFEF79DFDF8BD1020F8BD69464F +:1081C0002046FEF7C7FD0028F8D1A078314600F020 +:1081D00001032846009A06F09EF8EBE730B587B019 +:1081E000144600220DF1080C05AD01928CE82C001C +:1081F000072200920A46014623884FF6FF7005F0D9 +:1082000074FDBDF814102180FEF773FD07B030BD7A +:1082100070B50D4604210AF0A1FE040000D1FFDF75 +:10822000294604F11400BDE8704004F079BD70B532 +:108230000D4604210AF092FE040000D1FFDF29461A +:1082400004F11400BDE8704004F08DBD70B50D461A +:1082500004210AF083FE040000D1FFDF294604F167 +:108260001400BDE8704004F0A5BD70B505460421BA +:108270000AF074FE040000D1FFDF2146284623687F +:10828000BDE870400122FEF703BF70B50646042129 +:108290000AF064FE040000D1FFDF04F1140004F0D2 +:1082A00030FD401D20F0030511E0011D0088002273 +:1082B000431821463046FEF7EBFE00280BD0607CC9 +:1082C000ABB2684382B2A068011D0AF004FDA06849 +:1082D00041880029E9D170BD70B5054604210AF036 +:1082E0003DFE040000D1FFDF214628466368BDE85B +:1082F00070400222FEF7CCBE70B50E46054601F076 +:108300008DF9040000D1FFDF0120207266726580C4 +:10831000207820F00F00001D20F0F0004030207089 +:10832000BDE8704001F07DB910B50446012900D0C8 +:10833000FFDF2046BDE810400121FAF7C3B82DE960 +:10834000F04F97B04FF0000A0C008346ADF814A030 +:10835000D04619D0E06830B1A068A8B10188ADF866 +:108360001410A0F800A05846FBF76DF8070043F280 +:10837000020961D0387822285CD3042158460AF0DB +:10838000EDFD050005D103E0102017B0BDE8F08F2A +:10839000FFDF05F1140004F0B4FC401D20F00306DB +:1083A000A078012803D0022801D00720EDE721881A +:1083B00007AA584605F02BFE30BB07A805F033FE90 +:1083C00010BB07A805F02FFE48B99DF8260001282C +:1083D00005D1BDF82400A0F52451023902D04FF494 +:1083E0005050D2E7E068B0B1CDE902A0072000907C +:1083F00005AACDF804A00492A2882188BDF8143003 +:10840000584605F072FC10B1FEF773FCBDE7A16899 +:10841000BDF8140008809DF81F00C00602D543F285 +:108420000140B2E70B9838B1A1780078012905D056 +:1084300080071AD40820A8E74846A6E7C007F9D065 +:1084400002208DF83C00A8684FF00009A0B1697CBB +:108450004288714391420FD98AB2B3B2011D0AF02A +:10846000F0FB8046A0F800A006E003208DF83C0059 +:10847000D5F800804FF001099DF8200010F0380F6A +:1084800000D1FFDF9DF820001E49C0F3C200084460 +:1084900097F8231010F8010C884201D90F2074E7D7 +:1084A0002088ADF8400014A90095CDE9019143461C +:1084B00007220FA95846FEF715FE002891D19DF816 +:1084C000500050B9A078012807D1687CB3B270433E +:1084D00082B2A868011D0AF0C8FB002055E770B5FC +:1084E000064615460C460846FEF7C2FB002805D195 +:1084F0002A4621463046BDE8704073E470BD12E55F +:1085000098020020FC2F000070B51E4614460D0096 +:1085100009D044B1616831B138B1FC49C9888142A0 +:1085200003D0072070BD102070BD2068FEF7A0FBAF +:108530000028F9D1324621462846BDE87040FFF7B1 +:1085400046BA70B515460C0006D038B1EF49098916 +:10855000814203D0072070BD102070BD2068FEF757 +:1085600087FB0028F9D129462046BDE87040D6E5B2 +:1085700070B5064686B00D4614461046F8F78FFED5 +:10858000D0BB6068F8F7B2FEB0BBA6F57F40FF38FD +:1085900003D03046FAF757FF80B128466946FEF708 +:1085A0009BFC00280CD19DF810100F2008293DD20B +:1085B000DFE801F008060606060A0A0843F2020090 +:1085C00006B070BD0320FBE79DF80210012908D119 +:1085D000BDF80010B1F5C05FF2D06FF4C052D142C7 +:1085E000EED09DF8061001290DD1BDF80410A1F5BB +:1085F0002851062907D200E029E0DFE801F0030353 +:1086000004030303DCE79DF80A1001290FD1BDF82C +:108610000810B1F5245FD3D0A1F60211B1F50051D5 +:10862000CED00129CCD0022901D1C9E7FFDF606893 +:1086300078B9002305AA2946304605F03DFE10B161 +:10864000FEF757FBBCE79DF81400800601D410200C +:10865000B6E76188224628466368FFF7BFFDAFE7AB +:108660002DE9F043814687B0884614461046F8F756 +:1086700016FE18B1102007B0BDE8F083002306AA4B +:108680004146484605F018FE18B100BFFEF731FB21 +:10869000F1E79DF81800C00602D543F20140EAE771 +:1086A0000025072705A8019500970295CDE90350FD +:1086B00062884FF6FF734146484605F078FD060094 +:1086C00013D16068F8F7EBFD60B960680195CDE9FA +:1086D000025000970495238862884146484605F079 +:1086E00066FD0646BDF8140020803046CEE739B15D +:1086F000864B0A889B899A4202D843F2030070474E +:108700001DE610B586B0814C0423ADF814306389A2 +:1087100043B1A4898C4201D2914205D943F20300AE +:1087200006B010BD0620FBE7ADF810100021009147 +:108730000191ADF8003002218DF8021005A90291D7 +:1087400004A90391ADF812206946FFF7F8FDE7E7A9 +:108750002DE9FC4781460D460846F8F77AFD88BBAF +:108760004846FAF770FE5FEA00080AD098F8000061 +:10877000222829D3042148460AF0F0FB070005D13E +:1087800003E043F20200BDE8FC87FFDF07F11400BD +:1087900004F0CDFA06462878012803D0022804D038 +:1087A0000720F0E7B0070FD502E016F01C0F0BD042 +:1087B000A8792C1DC00709D0E08838B1A068F8F767 +:1087C00048FD18B11020DEE70820DCE721882A7870 +:1087D0000720B1F5847F35D01EDC40F20315A1F2ED +:1087E0000313A94226D00EDCB1F5807FCBD003DC89 +:1087F000F9B1012926D1C6E7A1F58073013BC2D0AA +:10880000012B1FD113E0012BBDD0022B1AD0032B5B +:10881000B9D0042B16D112E0A1F20912082A11D204 +:10882000DFE802F00B04041010101004ABE7022A7A +:10883000A9D007E0012AA6D004E0320700E0F20642 +:10884000002AA0DACDB200F0E9FE50B198F823007A +:10885000CDE90005FA89234639464846FEF78DFCE6 +:1088600091E711208FE72DE9F04F8BB01F46154699 +:108870000C4683460026FAF7E6FD28B10078222848 +:1088800005D208200BB081E543F20200FAE7B808F0 +:1088900001D00720F6E7032F00D100274FF6FF791C +:1088A000CCB1022D73D32046F8F720FD30B904EB8C +:1088B0000508A8F10100F8F719FD08B11020E1E75B +:1088C000AD1E38F8028CAAB22146484605F055FE86 +:1088D00040455CD1ADB20D49B80702D58889401C2E +:1088E00000E001201FFA80F8F80701D08F8900E02E +:1088F0004F4605AA4146584605F089FB4FF0070A46 +:108900004FF00009DCB320460BE000009802002085 +:10891000408810283BD8361D304486B2AE4236D24D +:10892000A01902884245F3D351E000BF9DF817001B +:1089300002074CD594B304EB0608361DB8F8023094 +:10894000B6B2102B23D89A19AA4220D8B8F8002022 +:1089500091421CD1C0061CD5CDE900A90DF1080C2F +:108960000AAAA11948468CE80700B8F800100022AE +:10897000584605F0BAF920B1FEF7BBF982E726E0C8 +:1089800005E0B8F80200BDF82810884201D00B209D +:1089900078E7B8F80200304486B207E0FFE7C00687 +:1089A00004D55846FEF71CFC002888D19DF8170016 +:1089B000BDF81A1020F010008DF81700BDF8170050 +:1089C000ADF80000FF235846009A05F0A4FC05A866 +:1089D00005F029FB18B9BDF81A10B942A6D904212F +:1089E00058460AF0BBFA040000D1FFDFA2895AB151 +:1089F000CDE900A94D46002321465846FEF7BDFBB0 +:108A00000028BBD1A5813DE700203BE72DE9FF4FC2 +:108A10008BB01E4617000D464FF0000412D0B00870 +:108A200002D007200FB0B1E4032E00D100265DB1C3 +:108A30000846F8F752FC28B93888691E0844F8F748 +:108A40004CFC08B11020EDE7C74AB00701D5D18929 +:108A500000E00121F0074FF6FF7802D0D089401ED8 +:108A600000E0404686B206AA0B9805F0D0FA4FF017 +:108A700000094FF0070B0DF1140A38E09DF81B00B8 +:108A8000000734D5CDF80490CDF800B0CDF80890AB +:108A9000CDE9039A434600220B9805F088FB60BBA2 +:108AA00005B3BDF814103A8821442819091D8A42DB +:108AB00030D3BDF81E2020F8022BBDF8142020F87A +:108AC000022BCDE900B9CDE90290CDF810A0BDF898 +:108AD0001E10BDF8143000220B9805F068FB08B199 +:108AE00003209FE7BDF814002044001D84B206A8AF +:108AF00005F099FA20B10A2806D0FEF7FAF891E7B6 +:108B0000BDF81E10B142B9D934B17DB13888A11C6D +:108B1000884203D20C2085E7052083E722462946B8 +:108B2000404605F02AFD014628190180A41C3C801E +:108B3000002077E710B50446F8F7B1FB08B1102024 +:108B400010BD8948C0892080002010BDF0B58BB0D1 +:108B50000D4606461422002103A805F090FC0120D2 +:108B60008DF80C008DF8100000208DF81100ADF884 +:108B700014503046FAF767FC48B10078222812D327 +:108B8000042130460AF0EAF9040005D103E043F27B +:108B900002000BB0F0BDFFDF04F11400074604F043 +:108BA000C6F8800601D40820F3E7207C022140F0BB +:108BB0000100207409A80094CDE90110072203A93F +:108BC00030466368FEF78EFA20B1217C21F0010166 +:108BD0002174DEE729463046F9F765FC08A93846D6 +:108BE00004F094F800B1FFDFBDF82040172C01D24B +:108BF000172000E02046A84201D92C4602E0172C9D +:108C000000D2172421463046FFF711FB214630469B +:108C1000F9F76DF90020BCE7F8B51C4615460E467D +:108C2000069F0AF0CEFA2346FF1DBCB231462A4603 +:108C3000009409F0B8FEF8BD70B50C4605460E224A +:108C40000021204605F01BFC002020802DB1012DC5 +:108C500001D0FFDF70BD062000E00520A07170BDCF +:108C600010B548800878134620F00F00001D20F052 +:108C7000F00080300C4608701422194604F10800F8 +:108C800005F0D3FB00F0CDFC3748046010BD2DE9A2 +:108C9000F047DFF8D890491D064621F0030117463A +:108CA0000C46D9F8000009F094FF050000D1FFDF61 +:108CB0004FF000083560A5F800802146D9F8000083 +:108CC00009F087FF050000D1FFDF7560A5F800807F +:108CD0007FB104FB07F1091D0BD0D9F8000009F0A2 +:108CE00078FF040000D1FFDFB460C4F80080BDE865 +:108CF000F087C6F80880FAE72DE9F0411746491DCC +:108D000021F00302194D064601681446286809F04F +:108D10008BFF22467168286809F086FF3FB104FB8B +:108D200007F2121D03D0B168286809F07DFF042006 +:108D30000AF0BCF8044604200AF0C0F8201A012802 +:108D400004D12868BDE8F04109F038BFBDE8F081E2 +:108D500010B50C4605F02AF900B1FFDF2046BDE84A +:108D60001040FDF7C6BF000098020020140000204C +:108D700038B50C468288817B19B14189914200D96E +:108D80000A462280C188121D90B26A4609F0E8F8AE +:108D9000BDF80000032800D30320C1B2208801F0F1 +:108DA00027F838BD38B50C468288817B19B1018916 +:108DB000914200D90A462280C188121D90B26A46AB +:108DC00009F0CEF8BDF80000022800D30220C1B29D +:108DD000208801F00DF8401CC0B238BD2DE9FF5FBE +:108DE00082468B46FB4814460BF10302D0E9011082 +:108DF000CDE9021022F0030201A84FF49071019214 +:108E000009F0C9FEF44E002C02D1F449019A8A609F +:108E1000019901440191B57F05F1010504D1E8B242 +:108E20000BF0CCFD00B1FFDF019800EB0510C01C7A +:108E300020F0030101915CB9707AB27A1044C2B299 +:108E400000200870308C80B204F00FFF00B1FFDF0B +:108E50000198316A08440190214601A800F08BFF77 +:108E600080460198C01C20F003000190B37AF27A8A +:108E7000717A04B1002009F084FF0199084401903F +:108E8000214601A800F0BFFFD34800273D4690F8D7 +:108E900001900CE0284600F051FF0646817880885A +:108EA000F9F7BCF871786D1C00FB0177EDB24D4508 +:108EB000F0D10198C01C20F00300019004B1002003 +:108EC0003946F9F7B6F80199002708440190C248DD +:108ED0003D4690F801900CE0284600F02FFF064632 +:108EE000C1788088FEF707FC71786D1C00FB017764 +:108EF000EDB24D45F0D10198C01C20F00300019067 +:108F000004B100203946FEF7FFFB01994FF000093C +:108F100008440190B0484D4647780EE0284600F0DE +:108F20000DFF0646807B30B106F1080002F06EF9B5 +:108F3000727800FB02996D1CEDB2BD42EED1019832 +:108F4000C01C20F00300019004B10020A3494A781E +:108F5000494602F05FF9019908440190214601A8B1 +:108F600000F0BCFE0198C01D20F007000190DAF867 +:108F70000010814204D3A0EB0B01B1F5803F04DB6C +:108F80004FF00408CAF8000004E0CAF80000B8F185 +:108F9000000F03D0404604B0BDE8F09F74BB904979 +:108FA0000020019A0DF06CFEFBF7E9F98A4C207F56 +:108FB0000090607F012823D0002318B30022864848 +:108FC00000211030F8F714FA00B1FFDFE07FFEF760 +:108FD00048FF00B1FFDF80484FF4F67200214030B7 +:108FE00005F04DFA7C480421403080F8E91180F802 +:108FF000EA11062180F8EB11032101710020CAE774 +:109000000123DAE702AADAE770B5734C064640346A +:10901000207804EB4015E078083598B9A01990F84D +:10902000E80100280FD0A0780F2800D3FFDF20220E +:109030000021284605F023FA687866F3020068707C +:109040000120E070284670BD2DE9F04105460C4630 +:1090500000270078052190463E46B1EB101F00D056 +:10906000FFDF287A50B101280ED0FFDFA8F800609A +:109070000CB1278066800020BDE8F0810127092619 +:1090800074B16888A08008E00227142644B168887B +:10909000A0802869E060A88A2082287B2072E5E70A +:1090A000A8F80060E7E730B54B4C012000212070A4 +:1090B0006170207260720322A272E0726177217780 +:1090C00021732174052121831F216183607445A1CF +:1090D00061610A21A177E077404D4FF4B0602062D2 +:1090E0006868C11C21F00301814200D0FFDF68687D +:1090F000606030BD30B5394C1568636810339D42EF +:1091000002D20420136030BD334B5D785A6802EB05 +:109110000512107051700320D0801720908001201C +:10912000D0709070002090735878401C5870606820 +:1091300010306060002030BD70B50646264800241F +:10914000457807E0204600F0F9FD0178B14204D0EF +:10915000641CE4B2AC42F5D1002070BDF7B50746FF +:1091600008780C4610B3FFF7E7FF0546A7F1200685 +:10917000202F06D0052E19D2DFE806F00F3838155B +:109180001A0000F0E6FD0DB1697800E00021401AF8 +:10919000A17880B20844FF2808D8A07830B1A08810 +:1091A000022831D202E0608817282DD20720FEBDA8 +:1091B000207A48B361881729F8D3A1881729F5D3F5 +:1091C000A1790029F2D0E1790029EFD0402811D906 +:1091D000ECE7000038620200B40300201800002011 +:1091E000000000206E52463578000000242F0BD17D +:1091F000207A48B161884FF6FB70814202D8A1887D +:10920000814201D90420FEBD65B9207802AA01215E +:10921000FFF770FF0028F6D12078FFF78DFF0500DB +:1092200000D1FFDF052E18D2DFE806F0030B0E0891 +:109230001100A0786870A088E8800FE06088A8809E +:109240000CE0A078A87009E0A078E87006E054F877 +:10925000020FA8606068E86000E0FFDF0020FEBD4C +:109260001A2835D00DDC132832D2DFE800F01B318C +:10927000203131272723252D313129313131312F2B +:109280000F00302802D003DC1E2821D107207047B0 +:109290003A3809281CD2DFE800F0151B0F1B1B1BF6 +:1092A0001B1B07000020704743F20400704743F285 +:1092B00002007047042070470D2070470F20704750 +:1092C0000820704711207047132070470620704710 +:1092D0000320704710B5007800F0010008F032FE5E +:1092E000BDE81040BCE710B5007800F0010008F0C0 +:1092F00032FEBDE81040B3E70EB5017801F0010180 +:109300008DF80010417801F001018DF8011001780D +:10931000C1F340018DF802104178C1F340018DF88E +:109320000310017889088DF80410417889088DF8B8 +:10933000051081788DF80610C1788DF80710007936 +:109340008DF80800684607F046FEFFF789FF0EBD5E +:109350002DE9F84FDFF8F883FE4C00264FF49077A4 +:109360001FE0012000F092FD0120FFF74DFE0546B1 +:109370003946D8F8080009F02CFC686000B9FFDF16 +:10938000686807F0F3FCB0B12846FAF743FB2846BB +:1093900000F082FD28B93A466968D8F8080009F05B +:1093A00043FC94F9E9010428DBDA022009F07EFD90 +:1093B00007460025A5E03A466968D8F8080009F094 +:1093C00033FCF2E7B8F802104046491C89B2A8F80D +:1093D0000210B94201D3002141800221B8F80200F5 +:1093E00009F0BCFD002864D0B8F80200694608F016 +:1093F00018FDFFF735FF00B1FFDF9DF8000078B1E1 +:10940000B8F8020009F0EFFE5FEA000900D1FFDFC3 +:10941000484609F05CF918B1B8F8020002F0C0F94A +:10942000B8F8020009F0CDFE5FEA000900D1FFDFC5 +:10943000484609F044F9E0BB0321B8F8020009F0FE +:109440008DFD5FEA000B47D1FFDF45E0DBF8100040 +:1094500010B10078FF2849D0022000F017FD02204B +:10946000FFF7D2FD8246484609F035FACAF80400F3 +:1094700000B9FFDFDAF8040009F0FDFA00210090DE +:109480000170B8F802105046AAF8021002F08EF8E7 +:10949000484609F0F2FA00B9FFDF504600F0FCFC44 +:1094A00018B99AF80100000704D50098CBF810000D +:1094B00012E024E0DBF8100038B10178491C11F00B +:1094C000FF01017008D1FFDF06E000221146484687 +:1094D00000F002FC00B9FFDF94F9EA01022805DB85 +:1094E000B8F8020002F029F80028AFD194F9E90198 +:1094F000042804DB484609F024FB00B101266D1C5A +:10950000EDB2BD4204D294F9EA010228BFF65AAF87 +:10951000002E7FF422AFBDE8F84F032000F0B6BC68 +:1095200010B58B4CE06008682061AFF2DB10F9F7F2 +:10953000B8FC607010BD8748002140380170844835 +:10954000017085494160704770B505464FF0805005 +:109550000C46D0F8A410491C05D1D0F8A810C94376 +:109560000904090C0BD050F8A01F01F0010129706B +:10957000416821608068A080287830B970BD0621DC +:1095800020460DF002F801202870607940F0C000FC +:10959000607170BD70B54FF080540D46D4F88010E6 +:1095A000491C0BD1D4F88410491C07D1D4F8881079 +:1095B000491C03D1D4F88C10491C0CD0D4F880106D +:1095C0000160D4F884104160D4F888108160D4F828 +:1095D0008C10C16002E010210CF0D7FFD4F890008D +:1095E000401C0BD1D4F89400401C07D1D4F898004B +:1095F000401C03D1D4F89C00401C09D054F8900FB3 +:10960000286060686860A068A860E068E86070BD75 +:109610002846BDE8704010210CF0B7BF4D480079D6 +:10962000F2E470B54B4CE07830B3207804EB401096 +:10963000407A00F00700204490F9E801002800DC9F +:10964000FFDF2078002504EB4010407A00F007008F +:10965000011991F8E801401E81F8E8012078401CCA +:10966000C0B220700F2800D12570A078401CA070D7 +:109670000CF014FEE57070BDFFDF70BD3EB5054611 +:10968000032109F06BFC0446284609F09AFD0546C3 +:1096900004B9FFDF206918B10078FF2800D1FFDF8F +:1096A00001AA6946284600F017FB60B9FFDF0AE00F +:1096B000002202A9284600F00FFB00B9FFDF9DF849 +:1096C000080000B1FFDF9DF80000411E8DF800107A +:1096D000EED220690199884201D1002020613EBD6F +:1096E00070B50546A0F57F400C46FF3800D1FFDF7E +:1096F000012C01D0FFDF70BDFFF790FF040000D107 +:10970000FFDF207820F00F00401D20F0F0005030E7 +:10971000207065800020207201202073BDE8704019 +:109720007FE72DE9F04116460D460746FFF776FF25 +:10973000040000D1FFDF207820F00F00401D20F052 +:10974000F00050302070678001202072286805E00A +:1097500018000020F4030020481400202061A8888D +:10976000A0822673BDE8F0415BE77FB5FFF7E4FC1C +:10977000040000D1FFDF02A92046FFF7F9FA0546F1 +:1097800003A92046FFF70EFB8DF800508DF801006D +:10979000BDF80800001DADF80200BDF80C00001D6A +:1097A000ADF80400E088ADF80600684608F0B4FBA8 +:1097B000002800D0FFDF7FBD2DE9F05FF84E814625 +:1097C000307810B10820BDE8F09F4846F7F767FDF4 +:1097D00008B11020F7E7F34C207808B9FFF763FCD5 +:1097E000A17A607A4D460844C4B200F0B2FAA042B1 +:1097F00007D2201AC1B22A460020FFF77BFC0028BE +:10980000E1D17168E748C91C002721F003017160AC +:10981000B3463E463D46BA463C4690F801800AE0D3 +:10982000204600F08BFA4178807B0E4410FB0155F6 +:10983000641CE4B27F1C4445F2D10AEB870000EBC4 +:10984000C600D84E00EB85005C46F17A012200EBA1 +:109850008100DBF80410451829464846FFF7BEFA98 +:10986000070012D00020FFF767FC05000BD005F1C0 +:109870001300616820F00300884200D0FFDF707899 +:10988000401E7070656038469DE7002229464846B4 +:10989000FFF7A4FA00B1FFDFD9F8000060604FF6CF +:1098A000FF7060800120207000208CE72DE9F041DE +:1098B0000446BB4817460E46007810B10820BDE8A4 +:1098C000F0810846F7F7C5FC08B11020F7E7B54D61 +:1098D000287808B9FFF7E7FB601E1E2807D8012C7F +:1098E00022D13078FE281FD8A8770020E7E7A4F11E +:1098F00020001F2805D8E0B23A463146BDE8F041C5 +:109900002CE4A4F140001F2805D831462046BDE8CC +:10991000F04100F0E9BAA4F1A0001F2804D800200B +:10992000A02C03D0A12C06D00720C8E7317801F085 +:109930000101E977C3E731680922F82901D38B07D0 +:1099400001D01046BBE76B7C03F00303012B04D16D +:109950006B8BD7339CB28C42F3D82962AFE72DE9E9 +:10996000F04781460E460846F7F799FC48B9484645 +:10997000F7F7B3FC28B909F1030020F003014945CA +:1099800002D01020BDE8F08786484FF0000A403032 +:10999000817869B14178804600EB411408343788FA +:1099A00032460021204600F085FA050004D027E069 +:1099B000A6F800A00520E5E7B9F1000F24D0308813 +:1099C000B84201D90C251FE0607800F00705284651 +:1099D00000F05CFA08EB0507324697F8E8014946C3 +:1099E000401C87F8E801204607F5F47700F062FA9A +:1099F00005463878401E3870032000F047FA2DB134 +:109A00000C2D01D0A6F800A02846BBE76078644E74 +:109A100000F00701012923D002290CD0032934D0FA +:109A2000FFDF98F801104046491CC9B288F80110C0 +:109A30000F2935D036E0616821B1000702D4608873 +:109A4000FFF71CFE98F8EA014746012802D170781A +:109A5000F9F746FA97F9EA010428E2DBFFDFE0E7CD +:109A6000616821B14FF49072B06809F0DDF898F8A0 +:109A7000E9014746032802D17078F9F731FA97F9DE +:109A8000E9010428CDDBFFDFCBE7C00602D5608803 +:109A9000FFF7F4FD98F9EB010628C2DBFFDFC0E712 +:109AA00080F801A08178491E8170617801F007017A +:109AB00001EB080090F8E811491C80F8E811A3E7D1 +:109AC00070B50D460446F7F7C4FB18B92846F7F7FA +:109AD000E6FB08B1102070BD29462046BDE8704065 +:109AE0000AF0A4BF70B505460AF0C3FFC4B2284609 +:109AF000F7F7F3FB08B1102070BD35B128782C7052 +:109B000018B1A04201D0072070BD2046FDF760FECD +:109B1000052805D10AF0B1FF012801D0002070BD51 +:109B20000F2070BD70B5044615460E460846F7F77F +:109B300090FB18B92846F7F7B2FB08B1102070BDAA +:109B4000022C03D0102C01D0092070BD2A463146CA +:109B500020460AF09BFF0028F7D0052070BD70B5A5 +:109B600014460D460646F7F774FB38B92846F7F752 +:109B700096FB18B92046F7F7B0FB08B1102070BD6E +:109B80002246294630460AF0A0FF0028F7D00720D9 +:109B900070BD3EB50446F7F782FB28B110203EBDEC +:109BA00018000020B4030020684607F085F9FFF78D +:109BB00057FB0028F3D19DF806002070BDF808007F +:109BC0006080BDF80A00A0800020E8E770B5054677 +:109BD0000C460846F7F781FB20B93CB12068F7F73F +:109BE0005EFB08B1102070BDA08828B12146284630 +:109BF000BDE87040FDF744BE092070BD70B5054654 +:109C00000C460846F7F725FB30B9681E1E2814D805 +:109C10002046F7F71EFB08B1102070BD032D01D9B7 +:109C2000072070BD05B9FFDFF94800EB850050F84B +:109C3000041C2046BDE870400847A5F120001F28FD +:109C400005D821462846BDE87040FAF70EBBF02D36 +:109C50000CD0F12D13D0BF2DE2D1A078218800F0D7 +:109C6000010001F059FB88B1002070BDA068F7F732 +:109C7000F0FA0028D0D1204608F0B3F902E02078AD +:109C800008F0D2F9BDE87040FFF7EABA082070BDCD +:109C900070B504460D460846F7F701FB30B9601E63 +:109CA0001E280FD82846F7F7D4FA08B1102070BD47 +:109CB000012C03D0022C01D0032C01D1062070BD51 +:109CC000072070BDA4F120001F28F9D8294620469E +:109CD000BDE87040FAF733BB08F0C0BC7CB5044661 +:109CE000CC48007B00F0010511BB04F0EBFB0DB18B +:109CF000226800E00022C8484178C06806F0A9FD4B +:109D0000C5481030C0788DF8000010B1012802D08D +:109D100004E0012000E000208DF80000684607F014 +:109D20003BF9BB4824380068019001A807F0EEFE1B +:109D3000002D02D02068283020607CBD30B5B54DA4 +:109D400004466878A04200D8FFDF686800EB041082 +:109D500030BD70B5AF4800252C46467807E0204658 +:109D6000FFF7ECFF4078641C2844C5B2E4B2B4426B +:109D7000F5D1284670BD2DE9F0410C4607464FF05D +:109D8000000800F0EDF80646FF2801D94FF013084F +:109D90003868C01C20F003023A6054EA080421D15C +:109DA0009C48F3B2072124300CF0FCFD09E0072C9D +:109DB00010D2DFE804F0060408080A0406009748F9 +:109DC00004E0974802E0974800E097480CF00AFE4C +:109DD000054600E0FFDFA54200D0FFDF641CE4B2CF +:109DE000072CE4D3386800EB06103860404666E57F +:109DF000021D5143452900D245210844C01CB0FB37 +:109E0000F2F0C0B270472DE9FC5F064681484FF082 +:109E100000088B464746444690F8019022E02046D1 +:109E2000FFF78CFF050000D1FFDF687869463844F2 +:109E3000C7B22846FEF79CFF824601A92846FEF7D6 +:109E4000B1FF0346BDF804005246001D81B2BDF8C3 +:109E50000000001D80B209F0FFF86A78641C00FB66 +:109E60000288E4B24C45DAD13068C01C20F003000F +:109E70003060BBF1000F00D000204246394609F0A7 +:109E8000F9F8316808443060BDE8FC9F6149403111 +:109E900008710020C87070475E494031CA782AB105 +:109EA0000A7801EB42110831814201D0012070474C +:109EB000002070472DE9F04106460078154600F075 +:109EC0000F0400201080601E0F46052800D3FFDF1E +:109ED0004F482A46183800EB8400394650F8043CB5 +:109EE0003046BDE8F04118472DE9F041494E0C4697 +:109EF000402806D0412823D042282BD0432806D121 +:109F000023E0A07861780D18E178814201D907201B +:109F1000D5E42078012801D91320D0E4FF2D08D8FA +:109F20000AF03EFF07460CF071F9381A801EA8426D +:109F300001DA1220C3E42068B060207930730DE0AC +:109F4000BDE8F041084600F036B808780228DED8AF +:109F5000307703E008780228D9D870770020AEE483 +:109F60002DE9F047DFF8AC900026344699F8090057 +:109F700099F80A2099F801700244D5B299F80B209B +:109F8000104400F0FF0808E02046FFF7D7FE817B71 +:109F9000407811FB0066641CE4B2BC42F4D199F82D +:109FA000091099F80A0029442944414400B10120CC +:109FB00008443044E6E438B50446407800F0030035 +:109FC000012803D002280BD0072038BD606858B1A3 +:109FD000F7F78CF9D0B96068F7F77FF920B915E089 +:109FE0006068F7F736F988B969462046FCF74EF8FD +:109FF0000028EAD1607800F00300022816D19DF80D +:10A00000000098B16068F7F768F978B1102038BDA2 +:10A010005C620200B4030020180000206B410000C5 +:10A0200035B30000B52F0000AF4701006189F82962 +:10A030000DD8208988420AD8607800F003020A48C7 +:10A04000012A06D1D731026A89B28A4201D2092097 +:10A05000DDE794E80E0000F1100585E80E000AB96E +:10A06000002101830020D2E7B40300202DE9F04154 +:10A07000074614468846084601F08AFD064608EB66 +:10A0800088001C22796802EBC0000D18688C58B15A +:10A090004146384601F08BFD014678680078C200E1 +:10A0A000082305F120000CE0E88CA8B141463846B1 +:10A0B00001F084FD0146786808234078C20005F16C +:10A0C000240008F008FE38B1062121726681D0E92B +:10A0D0000010C4E9031009E0287809280BD00520F6 +:10A0E000207266816868E060002028702046BDE824 +:10A0F000F04101F02EBD072020726681F4E72DE9C2 +:10A10000F04116460D460746406801EB85011C22CA +:10A1100002EBC1014418204601F072FD40B100215C +:10A12000708865F30F2160F31F4106200CF014FDC9 +:10A1300009202070324629463846BDE8F04195E7AF +:10A140002DE9F0410E46074600241C21F07816E068 +:10A1500004EB8403726801EBC303D25C6AB1FFF7BE +:10A160005DFA050000D1FFDF6F802A4621463046A8 +:10A17000FFF7C5FF0120BDE8F081641CE4B2A042F6 +:10A18000E6D80020F7E770B5064600241C21C07809 +:10A190000AE000BF04EB8403726801EBC303D51827 +:10A1A0002A782AB1641CE4B2A042F3D8402070BDE2 +:10A1B00028220021284604F062F9706880892881ED +:10A1C000204670BD70B5034600201C25DC780CE0ED +:10A1D00000EB80065A6805EBC6063244167816B1C5 +:10A1E000128A8A4204D0401CC0B28442F0D8402077 +:10A1F00070BDF0B5044600201C26E5780EE000BFD7 +:10A2000000EB8007636806EBC7073B441F788F426B +:10A2100002D15B78934204D0401CC0B28542EFD893 +:10A220004020F0BD0078032801D0002070470120B5 +:10A2300070470078022801D0002070470120704745 +:10A240000078072801D000207047012070472DE9D1 +:10A25000F041064688461078F1781546884200D3CA +:10A26000FFDF2C781C27641CF078E4B2A04201D8F0 +:10A27000201AC4B204EB8401706807EBC1010844E2 +:10A28000017821B14146884708B12C7073E72878DE +:10A29000A042E8D1402028706DE770B514460B88C5 +:10A2A0000122A240134207D113430B8001230A224B +:10A2B000011D08F0DAFC047070BD2DE9FF4F81B07C +:10A2C0000878DDE90E7B9A4691460E4640072CD46D +:10A2D000019808F088FF040000D1FFDF07F10408AF +:10A2E00020461FFA88F108F0C5F8050000D1FFDF0D +:10A2F000204629466A4608F010FB0098A0F8037033 +:10A30000A0F805A0284608F0B6FB017869F306011D +:10A310006BF3C711017020461FFA88F108F0EDF8C1 +:10A3200000B9FFDF019806F002FA06EB0900017F91 +:10A33000491C017705B0BDE8F08F2DE9F84F0E46B6 +:10A340009A4691460746032108F008FE0446008D10 +:10A35000DFF8B885002518B198F80000B0421ED18A +:10A36000384608F040FF070000D1FFDF09F1040183 +:10A37000384689B208F07EF8050010D038462946E4 +:10A380006A4608F0CAFA009800210A4601808170E6 +:10A3900006F08AFA0098C01DCAF8000021E098F87B +:10A3A0000000B04216D104F1260734F8341F012012 +:10A3B00000FA06F911EA090F00D0FFDF2088012317 +:10A3C00040EA090020800A22391D384608F068FC5E +:10A3D000067006E0324604F1340104F12600FFF76E +:10A3E0005CFF0A2188F800102846BDE8F88FFEB50A +:10A3F00015460C46064602AB0C220621FFF79DFFD0 +:10A40000002827D00299607812220A70801C4870B8 +:10A4100008224A80A07002982988052381806988D3 +:10A42000C180A9880181E988418100250C20CDE9FE +:10A430000005062221463046FFF73FFF294600224D +:10A4400066F31F41F02310460CF0DCFA6078801CA4 +:10A4500060700120FEBDFEB514460D46062206467C +:10A4600002AB1146FFF769FF002812D0029B1320B0 +:10A4700000211870A8785870022058809C8006200F +:10A48000CDE900010246052329463046FFF715FFB6 +:10A490000120FEBD2DE9FE430C46804644E002ABA0 +:10A4A0000E2207214046FFF748FF002841D0606890 +:10A4B0001C2267788678BF1C06EB860102EBC1017F +:10A4C000451802981421017047700A214180698A59 +:10A4D0000181E98A4181A9888180A98981813046E9 +:10A4E00001F056FB029905230722C8806F700420F3 +:10A4F000287000250E20CDE9000521464046FFF7D3 +:10A50000DCFE294666F30F2168F31F41F023002289 +:10A5100006200CF077FA6078FD49801C6070626854 +:10A520002046921CFFF793FE606880784028B6D1E1 +:10A530000120BDE8FE83FEB50D46064638E002ABBD +:10A540000E2207213046FFF7F8FE002835D0686854 +:10A550001C23C17801EB810203EBC202841802982C +:10A5600015220270627842700A224280A2894281DA +:10A57000A2888281084601F00BFB01460298818087 +:10A58000618AC180E18A0181A088B8B10020207071 +:10A5900000210E20CDE9000105230722294630467F +:10A5A000FFF78BFE6A68DB492846D21CFFF74FFE97 +:10A5B0006868C0784028C2D10120FEBD0620E6E7C9 +:10A5C0002DE9FE430C46814644E0204601F002FBA3 +:10A5D000D0B302AB082207214846FFF7AEFE0028A1 +:10A5E000A7D060681C2265780679AD1C06EB860151 +:10A5F00002EBC10147180298B7F8108006210170DC +:10A60000457004214180304601F0C2FA01460298AB +:10A6100005230722C180A0F804807D7008203870CF +:10A620000025CDE9000521464846FFF746FE2946AC +:10A6300066F30F2169F31F41F023002206200CF07E +:10A64000E1F96078801C60706268B3492046121D91 +:10A65000FFF7FDFD606801794029B6D1012068E768 +:10A660002DE9F34F83B00D4691E0284601F0B2FA90 +:10A6700000287DD068681C2290F806A00AEB8A01A9 +:10A6800002EBC10144185146284601F097FAA1781F +:10A69000CB0069684978CA00014604F1240008F03B +:10A6A00036FB07468188E08B4FF00009091A8EB20D +:10A6B00008B1C84607E04FF00108504601F053FAD0 +:10A6C00008B9B61CB6B2208BB04200D80646B346D5 +:10A6D00002AB324607210398FFF72FFE060007D092 +:10A6E000B8F1000F0BD0504601F03DFA10B106E072 +:10A6F00000201FE60299B8884FF0020908800196F1 +:10A70000E28B3968ABEB09001FFA80F80A44039822 +:10A710004E46009208F067FDDDE90021F61D434634 +:10A72000009608F074F9E08B404480B2E083B98869 +:10A73000884201D1012600E00026CDE900B6238A37 +:10A74000072229460398FFF7B8FD504601F00BFA9F +:10A7500010B9E089401EE08156B1A078401CA0707D +:10A760006868E978427811FB02F1CAB2012300E07F +:10A7700007E081690E3008F078FA80F800A0002028 +:10A78000E0836A6865492846921DFFF760FD6868A6 +:10A79000817940297FF469AF0120CBE570B5064689 +:10A7A00048680D4614468179402910D104EB840194 +:10A7B0001C2202EBC101084401F043FA002806D034 +:10A7C0006868294684713046BDE8704048E770BD2E +:10A7D000FEB50C460746002645E0204601F0FAF992 +:10A7E000D8B360681C22417901EB810102EBC10101 +:10A7F0004518688900B9FFDF02AB082207213846F7 +:10A80000FFF79BFD002833D00299607816220A706A +:10A81000801C4870042048806068407901F0B8F9D5 +:10A82000014602980523072281806989C18008209A +:10A83000CDE9000621463846FFF73FFD6078801CD1 +:10A840006070A88969890844B0F5803F00D3FFDFB4 +:10A85000A88969890844A8816E81626830492046C8 +:10A86000521DFFF7F4FC606841794029B5D1012001 +:10A87000FEBD30B5438C458BC3F3C704002345B1FF +:10A88000838B641EED1AC38A6D1E1D4495FBF3F382 +:10A89000E4B22CB1008918B1A04200D8204603448C +:10A8A0004FF6FF70834200D3034613800C7030BD17 +:10A8B0002DE9FC41074616460D46486802EB860125 +:10A8C0001C2202EBC10144186A4601A92046FFF789 +:10A8D000D0FFA089618901448AB2BDF8001091427D +:10A8E00012D0081A00D5002060816868407940289D +:10A8F0000AD1204601F09BF9002805D06868294656 +:10A9000046713846FFF764FFBDE8FC812C0000204B +:10A9100025A2000033A2000041A2000043BC0000B9 +:10A920002FBC00002DE9FE4F0F468146154650888A +:10A93000032108F013FB0190B9F8020001F01BF9A4 +:10A9400082460146019801F045F9002824D001987B +:10A950001C2241680AEB8A0002EBC0000C1820465A +:10A9600001F04EF9002817D1B9F80000E18A8842B9 +:10A970000ED8A18961B1B8420ED100265146019886 +:10A9800001F015F9218C01EB0008608B30B114E067 +:10A99000504601F0E8F8A0B3BDE8FE8F504601F044 +:10A9A000E2F808B1678308E0022FF5D3B9F8040094 +:10A9B0006083618A884224D80226B81B87B2B8F81F +:10A9C0000400A28B801A002814DD874200DA384682 +:10A9D0001FFA80FB688869680291D8F800100A4461 +:10A9E000009208F0EEFBF61D009A5B460299009675 +:10A9F00007F0D9FFA08B384480B2A083618B8842D6 +:10AA000007D96888019903B05246BDE8F04F01F0BC +:10AA100035B91FD14FF009002872B9F802006881DA +:10AA2000D8E90010C5E90410608BA881284601F020 +:10AA300090F85146019801F0BAF8014601980823B0 +:10AA400040680078C20004F1200008F044F90020BA +:10AA5000A0836083504601F086F810B9A089401E9B +:10AA6000A0816888019903B00AF0FF02BDE8F04FA9 +:10AA70001EE72DE9F041064615460F461C461846CE +:10AA8000F6F7E7FB18B92068F6F709FC10B11020BB +:10AA9000BDE8F0817168688C0978B0EBC10F01D313 +:10AAA0001320F5E73946304601F081F80146706819 +:10AAB00008230078C20005F1200008F0D6F8D4E998 +:10AAC0000012C0E900120020E2E710B5044603219D +:10AAD00008F044FA0146007800F00300022805D08F +:10AAE0002046BDE8104001F1140280E48A8A204625 +:10AAF000BDE81040AFE470B50446032108F02EFA1B +:10AB0000054601462046FFF75BFD002816D0294682 +:10AB10002046FFF75DFE002810D029462046FFF7AB +:10AB20000AFD00280AD029462046FFF7B3FC00287A +:10AB300004D029462046BDE8704091E570BD2DE95E +:10AB4000F0410C4680461EE0E178427811FB02F1AC +:10AB5000CAB2816901230E3008F0BDF80778606839 +:10AB60001C22C179491EC17107EB8701606802EBA5 +:10AB7000C10146183946204601F02CF818B130467C +:10AB800001F037F820B16068C1790029DCD17FE796 +:10AB9000FEF744FD050000D1FFDF0A202872384689 +:10ABA00000F0F6FF68813946204601F007F80146BB +:10ABB000606808234078C20006F1240008F08BF892 +:10ABC000D0E90010C5E90310A5F80280284600F07E +:10ABD000C0FFB07800B9FFDFB078401EB07057E713 +:10ABE00070B50C460546032108F0B8F901464068E7 +:10ABF000C2792244C2712846BDE870409FE72DE922 +:10AC0000FE4F8246507814460F464FF00008002849 +:10AC10004FD0012807D0022822D0FFDF2068B8607B +:10AC20006068F860B8E602AB0E2208215046FFF7D4 +:10AC300084FB0028F2D002981521052301702178A9 +:10AC400041700A214180C0F80480C0F80880A0F853 +:10AC50000C80628882810E20CDE90008082221E064 +:10AC6000A678304600F094FF054606EB86012C22BC +:10AC7000786802EBC1010822465A02AB11465046E1 +:10AC8000FFF75BFB0028C9D00298072101702178EB +:10AC900041700421418008218580C680CDE90018DB +:10ACA00005230A4639465046FFF707FB87F8088018 +:10ACB00072E6A678022516B1022E13D0FFDF2A1DF8 +:10ACC000914602AB08215046FFF737FB0028A5D07C +:10ACD00002980121022E0170217841704580868002 +:10ACE00002D005E00625EAE7A188C180E18801815C +:10ACF000CDE900980523082239465046D4E710B51F +:10AD00000446032108F02AF9014600F10802204612 +:10AD1000BDE8104073E72DE9F04F0F4605468DB0B2 +:10AD200014465088032108F019F94FF000088DF8F7 +:10AD300014800646ADF81680042F7BD36A78002A6B +:10AD400078D028784FF6FF794FF01C0A132834D0BA +:10AD500008DC012871D006284AD007286ED01228B6 +:10AD60000ED106E014286AD0152869D0162807D11C +:10AD7000AAE10C2F04D1307800F00301022907D09A +:10AD8000CDF80880CDF80C8068788DF808004CE08C +:10AD900040F0080030706878B07001208DF8140021 +:10ADA000A888ADF81800E888ADF81A002889ADF831 +:10ADB0001C006889ADF81E0011E1B078904239D1CD +:10ADC0003078010736D5062F34D120F008003070D6 +:10ADD0006088414660F31F4100200BF0BDFE022059 +:10ADE0008DF81400ADF81890A888ADF81A00F6E0B8 +:10ADF000082F1FD1A888EF88814600F0BCFE80464E +:10AE00000146304600F0E6FE18B1404600F0ABFEC9 +:10AE1000B8B1FC48D0E90010CDE902106878ADF86F +:10AE20000C908DF80800ADF80E70608802AA3146CB +:10AE3000FFF7E5FE0DB0BDE8F08FB6E01EE041E0A3 +:10AE4000ECE0716808EB88002C2202EBC000085A85 +:10AE5000B842EFD1EB4802AAD0E90210CDE90210C6 +:10AE600068788DF8080008F0FF058DF80A506088B2 +:10AE70003146FFF7C4FE224629461FE0082FD9D1EC +:10AE8000B5F80480E88800F076FE074601463046B3 +:10AE900000F0A0FE0028CDD007EB870271680AEB16 +:10AEA000C2000844028A4245C4D101780829C1D1B0 +:10AEB000407869788842BDD1F9B222463046FFF722 +:10AEC0001EF9B7E70E2F7FF45BAFE9886F898B46D9 +:10AED000B5F808903046FFF775F9ABF1400140290D +:10AEE00001D309204AE0B9F1170F01D3172F01D27E +:10AEF0000B2043E040280ED000EB800271680AEB83 +:10AF0000C20008440178012903D140786978884259 +:10AF100090D00A2032E03046FFF735F9014640284C +:10AF20002BD001EB810372680AEBC30002EB00082F +:10AF3000012288F800206A7888F801207068AA88C1 +:10AF40004089B84200D93846AD8903232372A282D2 +:10AF5000E7812082A4F80C906582084600F018FE74 +:10AF60006081A8F81490A8F81870A8F80E50A8F8F6 +:10AF700010B0204600F0EDFD5CE7042005212172B1 +:10AF8000A4F80A80E081012121739E49D1E90421BE +:10AF9000CDE9022169788DF80810ADF80A006088C3 +:10AFA00002AA3146FFF72BFEE3E7062F89D3B078DC +:10AFB00090421AD13078010717D520F00800307080 +:10AFC0006088414660F31F4100200BF0C5FD022060 +:10AFD0008DF81400A888ADF81800ADF81A906088B4 +:10AFE000224605A9F9F7EDF824E704213046FFF7DA +:10AFF00000F905464028BFD0022083030090224676 +:10B000002946304600F003FE4146608865F30F2173 +:10B0100060F31F4106200BF09FFD0BE70E2FABD115 +:10B0200004213046FFF7E5F881464028A4D0414688 +:10B03000608869F30F2160F31F4106200BF08CFD3F +:10B04000A8890B906889099070682F894089B84257 +:10B0500000D938468346B5F80680A8880A90484645 +:10B0600000F096FD60810B9818B1022000900B9BB8 +:10B0700024E0B8F1170F1ED3172F1CD30420207221 +:10B0800009986082E781A4F810B0A4F80C8009EB5D +:10B09000890271680AEBC2000D18DDE90913A5F8F1 +:10B0A0001480A5F818B0E9812B82204600F051FDEC +:10B0B00006202870BEE601200B2300902246494658 +:10B0C000304600F0A4FDB5E6082F8DD1A9883046A2 +:10B0D000FFF778F80746402886D000F044FD0028A6 +:10B0E0009BD107EB870271680AEBC20008448046D7 +:10B0F00000F086FD002890D1ED88B8F80E002844B5 +:10B10000B0F5803F05D360883A46314600F0B6FD81 +:10B1100090E6002DCED0A8F80E0060883A46314661 +:10B12000FFF73CFB08202072384600F031FD6081BB +:10B13000A5811EE72DE9F05F0C4601281FD0957907 +:10B1400092F8048092F8056005EB85011F2202EB5E +:10B15000C10121F0030B08EB060111FB05F14FF6CD +:10B16000FF7202EAC10909F1030115FB0611264F1E +:10B1700021F0031ABB6840B101283ED125E0616887 +:10B18000E57891F800804E78DEE75946184607F0DA +:10B1900020FD606000B9FFDF5A460021606803F0BF +:10B1A0006EF9E5705146B86807F013FD61684861B3 +:10B1B00000B9FFDF6068426902EB090181616068E4 +:10B1C00080F800806068467017E060685246416908 +:10B1D000184607F029FD5A466168B86807F024FD53 +:10B1E000032007F063FE0446032007F067FE201AE1 +:10B1F000012802D1B86807F0E1FC0BEB0A00BDE8BA +:10B20000F09F0000686202002C000020024600212E +:10B2100002208FE7F7B5FF4C0A20164620700098F1 +:10B2200060B100254FEA0D0007F0B5FC0021A170C8 +:10B230006670002D01D10099A160FEBD012500209E +:10B24000F2E770B50C46154638220021204603F07F +:10B2500016F9012666700A22002104F11C0003F091 +:10B260000EF905B9FFDF297A207861F3010020701B +:10B27000A87900282DD02A4621460020FFF75AFF42 +:10B2800061684020E34A88706168C870616808712D +:10B29000616848716168887161682888088161689F +:10B2A00068884881606886819078002811D061683C +:10B2B0000620087761682888C885616828884886DC +:10B2C00060680685606869889288018681864685FF +:10B2D000828570BDC878002802D00022012029E7AD +:10B2E000704770B50546002165F31F4100200BF043 +:10B2F00033FC0321284607F031FE040000D1FFDFB4 +:10B3000021462846FEF71CFF002804D0207840F094 +:10B3100010002070012070BD70B505460C4603205A +:10B3200007F0B6FD08B1002070BDBA488570848072 +:10B33000012070BD2DE9FF4180460E460F0CFEF73F +:10B340006DF9050007D06F800321384607F006FE2F +:10B35000040008D106E004B03846BDE8F0411321EE +:10B36000F9F758BBFFDF5FEA080005D0B8F1060F18 +:10B3700018D0FFDFBDE8FF8120782A4620F00800C2 +:10B3800020700020ADF8020002208DF800004FF67A +:10B39000FF70ADF80400ADF8060069463846F8F7CE +:10B3A00010FFE7E7C6F3072101EB81021C23606869 +:10B3B00003EBC202805C042803D008280AD0FFDF18 +:10B3C000D8E7012000904FF440432A46204600F081 +:10B3D0001EFCCFE704B02A462046BDE8F041FEF748 +:10B3E0008EBE2DE9F05F05464089002790460C4649 +:10B3F0003E46824600F0BFFB8146287AC01E0828E0 +:10B400006BD2DFE800F00D04192058363C47722754 +:10B410001026002C6CD0D5E90301C4E902015CE0E0 +:10B4200070271226002C63D00A2205F10C0104F1CA +:10B43000080002F0FAFF50E071270C26002C57D0CC +:10B44000E868A06049E0742710269CB3D5E90301A1 +:10B45000C4E902016888032107F080FD8346FEF7F6 +:10B46000DDF802466888508049465846FEF7FEFDE2 +:10B4700033E075270A26ECB1A88920812DE07627D4 +:10B480001426BCB105F10C0004F1080307C883E8D9 +:10B49000070022E07727102664B1D5E90301C4E94B +:10B4A00002016888032107F059FD01466888FFF70B +:10B4B00046FB12E01CE073270826CCB16888032104 +:10B4C00007F04CFD01460078C00606D56888FEF7F7 +:10B4D00037FE10B96888F8F781FAA8F800602CB137 +:10B4E0002780A4F806A066806888A080002086E6F1 +:10B4F000A8F80060FAE72DE9FC410C461E46174605 +:10B500008046032107F02AFD05460A2C0AD2DFE80F +:10B5100004F005050505050509090907042303E0ED +:10B52000062301E0FFDF0023CDE90076224629460D +:10B530004046FEF7C2FEBDE8FC81F8B50546A0F521 +:10B540007F40FF382BD0284607F03BFE040000D197 +:10B55000FFDF204607F0BFF9002821D001466A46E8 +:10B56000204607F0DAF900980321B0F80560284674 +:10B5700007F0F4FC0446052E13D0304600F0FBFA29 +:10B5800005460146204600F025FB40B1606805EB0A +:10B5900085013E2202EBC101405A002800D0012063 +:10B5A000F8BD007A0028FAD00020F8BDF8B50446AE +:10B5B000408807F006FE050000D1FFDF6A462846F6 +:10B5C000616800F0C4FA01460098091F8BB230F898 +:10B5D000032F0280428842800188994205D1042AC3 +:10B5E00008D0052A20D0062A16D022461946FFF791 +:10B5F00099F9F8BD001D0E46054601462246304623 +:10B60000F6F73BFF0828F4D1224629463046FCF7DE +:10B610007EF9F8BD2C000020636864880A46011D8D +:10B620002046FAF7A1F9F4E72246001DFFF773FB65 +:10B63000EFE770B50D460646032107F08FFC0400C6 +:10B6400004D02078000704D5112070BD43F2020019 +:10B6500070BD2A4621463046FEF7C9FE18B9286853 +:10B6600060616868A061207840F0080020700020C8 +:10B6700070BD70B50D460646032107F06FFC04004F +:10B6800004D02078000704D4082070BD43F20200E3 +:10B6900070BD2A4621463046FEF7DDFE00B9A58280 +:10B6A000207820F008002070002070BD2DE9F04FB8 +:10B6B0000E4691B08046032107F050FC04464046F8 +:10B6C00007F091FD07460020079008900990ADF81B +:10B6D00030000A9002900390049004B9FFDF0DF14E +:10B6E0000809FFB9FFDF1DE038460BA9002206F06C +:10B6F000B5FF9DF82C0000F07F050A2D00D3FFDF79 +:10B700006019017F491E01779DF82C00000609D5BC +:10B710002A460CA907A8FEF7C0FD19F80510491C18 +:10B7200009F80510761EF6B2DED204F13400F84DA9 +:10B7300004F1260BDFF8DCA304F12A07069010E0E1 +:10B740005846069900F08CFA064628700A2800D35D +:10B75000FFDF5AF8261040468847E08CC05DB042B3 +:10B7600002D0208D0028EBD10A202870E94D4E46EA +:10B7700028350EE00CA907A800F072FA0446375DE0 +:10B7800055F8240000B9FFDF55F82420394640461B +:10B790009047BDF81E000028ECD111B0BDE8F08F35 +:10B7A00010B5032107F0DAFB040000D1FFDF0A2205 +:10B7B000002104F11C0002F062FE207840F0040039 +:10B7C000207010BD10B50C46032107F0C7FB2044C4 +:10B7D000007F002800D0012010BD2DE9F84F8946D8 +:10B7E00015468246032107F0B9FB070004D028461E +:10B7F000F5F72FFD40B903E043F20200BDE8F88FF2 +:10B800004846F5F74CFD08B11020F7E7786828B1F5 +:10B8100069880089814201D90920EFE7B9F8000061 +:10B820001C2488B100F0A7F980460146384600F094 +:10B83000D1F988B108EB8800796804EBC000085C96 +:10B8400001280BD00820D9E73846FEF79CFC80463B +:10B85000402807D11320D1E70520CFE7FDF7DEFE12 +:10B8600006000BD008EB8800796804EBC0000C18C8 +:10B87000B9F8000020B1E88910B113E01120BDE74C +:10B880002888172802D36888172801D20720B5E72F +:10B89000686838B12B1D224641463846FFF7E9F863 +:10B8A0000028ABD104F10C0269462046FEF7E1FF07 +:10B8B000288860826888E082B9F8000030B10220F0 +:10B8C0002070E889A080E889A0B12BE003202070D7 +:10B8D000A889A08078688178402905D180F8028005 +:10B8E00039465046FEF7D6FD404600F051F9A9F81A +:10B8F000000021E07868218B4089884200D9084601 +:10B900002083A6F802A004203072B9F800007081EC +:10B91000E0897082F181208B3082A08AB08130462C +:10B9200000F017F97868C178402905D180F80380C4 +:10B9300039465046FEF7FFFD00205FE770B50D4623 +:10B940000646032107F00AFB04000ED0284600F04B +:10B9500012F905460146204600F03CF918B1284688 +:10B9600000F001F920B1052070BD43F2020070BD66 +:10B9700005EB85011C22606802EBC101084400F060 +:10B980003FF908B1082070BD2A462146304600F034 +:10B9900075F9002070BD2DE9F0410C461746804630 +:10B9A000032107F0DBFA0546204600F0E4F80446E0 +:10B9B00095B10146284600F00DF980B104EB8401F1 +:10B9C0001C22686802EBC1014618304600F018F9E5 +:10B9D00038B10820BDE8F08143F20200FAE7052003 +:10B9E000F8E73B46324621462846FFF742F8002852 +:10B9F000F0D1E2B229464046FEF75AFF708C083873 +:10BA0000082803D242484078F7F76AFA0020E1E7B5 +:10BA10002DE9F0410D4617468046032107F09EFAB6 +:10BA20000446284600F0A7F8064624B13846F5F744 +:10BA300010FC38B902E043F20200CBE73868F5F7B2 +:10BA400008FC08B11020C5E73146204600F0C2F8D6 +:10BA500060B106EB86011C22606802EBC10145184B +:10BA6000284600F0CDF818B10820B3E70520B1E76B +:10BA7000B888A98A884201D90C20ABE76168E88CB4 +:10BA80004978B0EBC10F01D31320A3E7314620461C +:10BA900000F094F80146606808234078C20005F180 +:10BAA000240007F0E2F8D7E90012C0E90012F2B270 +:10BAB00021464046FEF772FE00208BE72DE9F04755 +:10BAC0000D461F4690468146032107F047FA04467B +:10BAD000284600F050F806463CB14DB13846F5F71F +:10BAE000FCFB50B11020BDE8F08743F20200FAE7FA +:10BAF000606858B1A0F80C8027E03146204600F07D +:10BB000069F818B1304600F02EF828B10520EAE7B0 +:10BB10002C0000208062020006EB86011C22606877 +:10BB200002EBC1014518284600F06AF808B1082068 +:10BB3000D9E7A5F80880F2B221464846FEF7B8FEDC +:10BB40001FB1A8896989084438800020CBE706F036 +:10BB5000E4BE017821F00F01491C21F0F001103101 +:10BB60000170FDF75EBD20B94E48807808B1012014 +:10BB70007047002070474B498988884201D10020D6 +:10BB80007047402801D2402000E0403880B2704722 +:10BB900010B50446402800D9FFDF2046FFF7E3FF39 +:10BBA00010B14048808810BD4034A0B210BD40683C +:10BBB00042690078484302EBC0007047C278406891 +:10BBC000037812FB03F24378406901FB032100EB89 +:10BBD000C1007047C2788A4209D9406801EB8101EF +:10BBE0001C2202EBC101405C08B10120704700201B +:10BBF00070470078062801D901207047002070475F +:10BC00000078062801D00120704700207047F0B46A +:10BC100001EB81061C27446807EBC6063444049DEB +:10BC200005262670E3802571F0BCFEF71FBA10B51B +:10BC3000418911B1FFF7DDFF08B1002010BD0120DF +:10BC400010BD10B5C18C8278B1EBC20F04D9C18987 +:10BC500011B1FFF7CEFF08B1002010BD012010BDCB +:10BC600010B50C4601230A22011D07F034F80078B4 +:10BC70002188012282409143218010BDF0B402EB63 +:10BC800082051C264C6806EBC505072363554B68E7 +:10BC90001C79402C03D11A71F0BCFEF791BCF0BCAA +:10BCA000704700002C00002010B5EFF3108000F06A +:10BCB000010472B6FC484178491C41704078012863 +:10BCC00001D10AF013FB002C00D162B610BD70B593 +:10BCD000F54CA07848B90125A570FFF7E5FF0AF0FB +:10BCE00016FB20B100200AF0E0FA002070BD4FF0F2 +:10BCF0008040E570C0F80453F7E770B5EFF31080AB +:10BD000000F0010572B6E84C607800B9FFDF60789A +:10BD1000401E6070607808B90AF0ECFA002D00D17E +:10BD200062B670BDE04810B5817821B10021C170C4 +:10BD30008170FFF7E2FF002010BD10B504460AF045 +:10BD4000E6FAD9498978084000D001202060002017 +:10BD500010BD10B5FFF7A8FF0AF0D9FA022201239F +:10BD6000D149540728B1D1480260236103200872E9 +:10BD700002E00A72C4F804330020887110BD2DE976 +:10BD8000F84FDFF824934278817889F80420002660 +:10BD900089F80510074689F806600078DFF810B3C7 +:10BDA000354620B1012811D0022811D0FFDF0AF05A +:10BDB000C0FA4FF0804498B10AF0C2FAB0420FD1F5 +:10BDC00030460AF0C1FA0028FAD042E00126EEE738 +:10BDD000FFF76AFF58460168C907FCD00226E6E76C +:10BDE0000120E060C4F80451B2490E600107D1F8A7 +:10BDF0004412B04AC1F3423124321160AD493431AA +:10BE000008604FF0020AC4F804A3A060AA480168C1 +:10BE1000C94341F3001101F10108016841F010012B +:10BE2000016001E0F7F7E0F8D4F804010028F9D048 +:10BE300030460AF089FA0028FAD0B8F1000F04D190 +:10BE40009D48016821F010010160C4F808A3C4F8FE +:10BE5000045199F805004E4680B1387870B90AF05F +:10BE600056FA80460AF05CFC6FF00042B8F1000F11 +:10BE700002D0C6E9032001E0C6E90302DBF80000B6 +:10BE8000C00701D00AF03FFA387810B13572BDE82A +:10BE9000F88F4FF01808C4F808830127A7614FF402 +:10BEA0002070ADF8000000BFBDF80000411EADF8E5 +:10BEB0000010F9D2C4F80C51C4F810517A48C01DD2 +:10BEC0000AF0C2FA3570FFF744FF676179493079AB +:10BED00020310860C4F80483D9E770B5050000D1AB +:10BEE000FFDF4FF080424FF0FF30C2F8080300211F +:10BEF000C2F80011C2F80411C2F80C11C2F81011F6 +:10BF0000694C61700AF00FFA10B10120A0706070E6 +:10BF100067480068C00701D00AF0F5F92846BDE877 +:10BF200070402CE76048007A002800D0012070475C +:10BF30002DE9F04F61484FF0000A85B0D0F800B00D +:10BF4000D14657465D4A5E49083211608406D4F8EE +:10BF5000080110B14FF0010801E04FF000080AF0AD +:10BF600046FA78B1D4F8240100B101208246D4F811 +:10BF70001C0100B101208146D4F8200108B101273D +:10BF800000E00027D4F8000100B101200490D4F8AB +:10BF9000040100B101200390D4F80C0100B101208C +:10BFA0000290D4F8100100B101203F4D0190287893 +:10BFB00000260090B8F1000F04D0C4F808610120F9 +:10BFC0000AF073F9BAF1000F04D0C4F82461092013 +:10BFD0000AF06BF9B9F1000F04D0C4F81C610A2013 +:10BFE0000AF063F927B1C4F820610B200AF05DF96B +:10BFF0002D48C01D0AF030FA00B1FFDFDFF8AC8039 +:10C000000498012780B1C4F80873E87818B1EE707D +:10C0100000200AF04AF9287A022805D10320287264 +:10C020000221C8F800102761039808B1C4F8046120 +:10C03000029850B1C4F80C61287A032800D0FFDFC1 +:10C04000C8F800602F72FFF758FE019838B1C4F8A5 +:10C050001061287A012801D100F05CF8676100982E +:10C0600038B12E70287A012801D1FFF772FEFFF750 +:10C0700044FE0D48C01D0AF005FA1049091DC1F81B +:10C0800000B005B0BDE8F08F074810B5C01D0AF03C +:10C09000E3F90549B0B1012008704FF0E021C1F883 +:10C0A0000002BDE81040FFE540000020340C0040D5 +:10C0B0000C0400401805004010ED00E0100502409F +:10C0C00001000001087A012801D1FFF742FEBDE816 +:10C0D000104024480AF0D6B970B5224CE41FA0786D +:10C0E00008B90AF007F901208507A861207A00261F +:10C0F000032809D1D5F80C0120B900200AF024F951 +:10C100000028F7D1C5F80C6126724FF0FF30C5F852 +:10C11000080370BD70B5134CE41F6079F0B10128BD +:10C1200003D0A179401E814218DA0AF0F0F80546E2 +:10C130000AF0F6FA6179012902D9A179491CA171A5 +:10C140000DB1216900E0E168411A022902DA11F11A +:10C15000020F06DC0DB1206100E0E060BDE8704038 +:10C16000F7E570BD470000200F4A12680D498A426A +:10C170000CD118470C4A12680A4B9A4206D101B5F5 +:10C180000AF0A0FA0AF073FDBDE80140074909680A +:10C190000958084706480749054A064B70470000FA +:10C1A00000000000BEBAFECA5800002004000020B3 +:10C1B000C8130020C8130020F8B51D46DDE9064766 +:10C1C0000E000AD007F00FF82346FF1DBCB231461F +:10C1D0002A46009406F01BFCF8BDD01922461946E9 +:10C1E00002F023F92046F8BD70B50D460446102232 +:10C1F000002102F044F9258117206081A07B40F0E6 +:10C200000A00A07370BD4FF6FF720A80014602203B +:10C210000AF0A2BC704700897047827BD30701D126 +:10C22000920703D48089088000207047052070475A +:10C23000827B920700D581817047014600200988E2 +:10C2400041F6FE52114200D00120704700B503466E +:10C25000807BC00701D0052000BD59811846FFF73B +:10C26000ECFFC00703D0987B40F004009873987BE4 +:10C2700040F001009873002000BD827B520700D57A +:10C2800009B14089704717207047827B61F3C30270 +:10C29000827370472DE9FC5F0E460446017896468E +:10C2A000012000FA01F14DF6FF5201EA020962682D +:10C2B0004FF6FF7B1188594502D10920BDE8FC9F4C +:10C2C000B9F1000F05D041F6FE55294201D00120F9 +:10C2D000F4E741EA090111801D0014D000232B70FE +:10C2E00094F800C0052103221F464FF0020ABCF15A +:10C2F0000E0F76D2DFE80CF0F909252F47646B7733 +:10C30000479193B4D1D80420D8E7616820898B7B0A +:10C310009B0767D517284AD30B89834247D389895E +:10C32000172901D3814242D185F800A0A5F8010068 +:10C330003280616888816068817B21F002018173AD +:10C34000C6E0042028702089A5F801006089A5F8BE +:10C3500003003180BCE0208A3188C01D1FFA80F8BC +:10C36000414524D3062028702089A5F80100608962 +:10C37000A5F80300A089A5F805000721208ACDE9CA +:10C380000001636941E00CF0FF00082810D008208C +:10C3900028702089A5F801006089A5F80300318084 +:10C3A0006A1D694604F10C0008F08FFB10B15EE0D5 +:10C3B0001020EDE730889DF800100844308087E0B9 +:10C3C0000A2028702089A5F80100328044E00C2062 +:10C3D00028702089A5F801006089A5F80300318044 +:10C3E0003AE082E064E02189338800EB41021FFAE1 +:10C3F00082F843453BD3B8F1050F38D30E222A709B +:10C400000BEA4101CDE90010E36860882A467146D5 +:10C41000FFF7D2FEA6F800805AE04020287060891D +:10C420003188C01C1FFA80F8414520D32878714616 +:10C4300020F03F00123028702089A5F801006089A3 +:10C44000CDE9000260882A46E368FFF7B5FEA6F84A +:10C450000080287840063BD461682089888037E0D6 +:10C46000A0893288401D1FFA80F8424501D2042776 +:10C470003DE0162028702089A5F801006089A5F804 +:10C480000300A089CDE9000160882A46714623692E +:10C49000FFF792FEA6F80080DEE718202870207AC9 +:10C4A0006870A6F800A013E061680A88920401D4BD +:10C4B00005271CE0C9882289914201D0062716E091 +:10C4C0001E21297030806068018821F400510180AC +:10C4D000B9F1000F0BD061887823002202200AF006 +:10C4E00091FA61682078887006E0338003276068DD +:10C4F000018821EA090101803846DFE62DE9FF4F76 +:10C5000085B01746129C0D001E461CD03078C1071E +:10C5100003D000F03F00192801D9012100E00021DB +:10C520002046FFF7AAFEA8420DD32088A0F57F4140 +:10C53000FF3908D03078410601D4000605D508201F +:10C5400009B0BDE8F08F0720FAE700208DF8000061 +:10C550008DF8010030786B1E00F03F0C0121A81E01 +:10C560004FF0050A4FF002094FF0030B9AB2BCF1ED +:10C57000200F75D2DFE80CF08B10745E7468748C39 +:10C58000749C74B574BA74C874D474E1747474F11E +:10C5900074EF74EE74ED748B052D78D18DF80090E6 +:10C5A000A0788DF804007088ADF8060030798DF819 +:10C5B0000100707800F03F000C2829D00ADCA0F1BF +:10C5C0000200092863D2DFE800F0126215621A62E5 +:10C5D0001D622000122824D004DC0E281BD0102855 +:10C5E000DBD11BE016281FD01828D6D11FE02078F9 +:10C5F000800701E020784007002848DAEEE0207844 +:10C600000007F9E72078C006F6E720788006F3E710 +:10C6100020784006F0E720780006EDE72088C00586 +:10C62000EAE720884005E7E720880005E4E720885E +:10C63000C004E1E72078800729D5032D27D18DF8A4 +:10C6400000B0B6F8010081E0217849071FD5062D1A +:10C650001DD381B27078012803D0022817D102E0DF +:10C66000C9E0022000E0102004228DF8002072783A +:10C670008DF80420801CB1FBF0F2ADF8062092B2D8 +:10C6800042438A4203D10397ADF80890A6E079E0CF +:10C690002078000776D598B282088DF800A0ADF812 +:10C6A0000420B0EB820F6DD10297ADF8061095E033 +:10C6B0002178C90666D5022D64D381B206208DF893 +:10C6C0000000707802285DD3B1FBF0F28DF8040011 +:10C6D000ADF8062092B242438A4253D1ADF8089099 +:10C6E0007BE0207880064DD5072003E020784006C7 +:10C6F0007FD508208DF80000A088ADF80400ADF8C3 +:10C700000620ADF8081068E02078000671D50920F1 +:10C71000ADF804208DF80000ADF8061002975DE03A +:10C720002188C90565D5022D63D381B20A208DF811 +:10C730000000707804285CD3C6E72088400558D5EF +:10C74000012D56D10B208DF80000A088ADF8040013 +:10C7500044E021E026E016E0FFE72088000548D508 +:10C76000052D46D30C208DF80000A088ADF80400FC +:10C77000B6F803006D1FADF80850ADF80600ADF82F +:10C780000AA02AE035E02088C00432D5012D30D13E +:10C790000D208DF8000021E02088800429D4B6F80F +:10C7A0000100E080A07B000723D5032D21D3307842 +:10C7B00000F03F001B2818D00F208DF800002088C3 +:10C7C00040F40050A4F80000B6F80100ADF80400F1 +:10C7D000ED1EADF80650ADF808B003976946059810 +:10C7E000F5F794FB050008D016E00E208DF8000048 +:10C7F000EAE7072510E008250EE0307800F03F005A +:10C800001B2809D01D2807D0022005990AF0A4F999 +:10C81000208800F400502080A07B400708D52046E7 +:10C82000FFF70BFDC00703D1A07B20F00400A0732D +:10C83000284685E61FB5022806D101208DF80000A4 +:10C8400088B26946F5F762FB1FBD0000F8B51D46CA +:10C85000DDE906470E000AD006F0C5FC2346FF1DA1 +:10C86000BCB231462A46009406F0D1F8F8BDD01982 +:10C870002246194601F0D9FD2046F8BD2DE9FF4FAB +:10C880008DB09B46DDE91B57DDF87CA00C46082BDC +:10C8900005D0E06901F0FEF850B11020D2E0288800 +:10C8A000092140F0100028808AF80010022617E0C5 +:10C8B000E16901208871E2694FF420519180E169BA +:10C8C0008872E06942F601010181E069002181730B +:10C8D0002888112140F0200028808AF800100426C2 +:10C8E00038780A900A2038704FF0020904F11800D5 +:10C8F0004D460C9001F0C6FBB04681E0BBF1100F35 +:10C900000ED1022D0CD0A9EB0800801C80B20221B0 +:10C91000CDE9001005AB52461E990D98FFF796FF22 +:10C92000BDF816101A98814203D9F74800790F9084 +:10C9300004E003D10A9808B138702FE04FF00201EB +:10C94000CDE900190DF1160352461E990D98FFF717 +:10C950007DFF1D980088401B801B83B2C6F1FF003D +:10C96000984200D203461E990BA8D9B15FF000028D +:10C97000DDF878C0CDE9032009EB060189B2CDE9E5 +:10C9800001C10F980090BDF8161000220D9801F01B +:10C990000EFC387070B1C0B2832807D0BDF8160005 +:10C9A00020833AE00AEB09018A19E1E7022011B07D +:10C9B000BDE8F08FBDF82C00811901F0FF08022DB1 +:10C9C0000DD09AF80120424506D1BDF820108142D1 +:10C9D00007D0B8F1FF0F04D09AF801801FE08AF861 +:10C9E0000180C94800680178052902D1BDF81610F8 +:10C9F000818009EB08001FFA80F905EB080085B279 +:10CA0000DDE90C1005AB0F9A01F03FFB28B91D982A +:10CA10000088411B4145BFF671AF022D13D0BBF119 +:10CA2000100F0CD1A9EB0800801C81B20220CDE9C7 +:10CA3000000105AB52461E990D98FFF707FF1D98A0 +:10CA40000580002038700020B1E72DE9F8439C46AE +:10CA5000089E13460027B26B9AB3491F8CB2F18F20 +:10CA6000A1F57F45FF3D05D05518AD882944891DA6 +:10CA70008DB200E000252919B6F83C800831414507 +:10CA800020D82A44BCF8011022F8021BBCF803107D +:10CA900022F8021B984622F8024B914606F091FBC1 +:10CAA0004FF00C0C41464A462346CDF800C005F035 +:10CAB0007AFFF587B16B00202944A41D214408802A +:10CAC00003E001E0092700E083273846BDE8F8834A +:10CAD00010B50B88848F9C420CD9846BE0180488B5 +:10CAE00044B1848824F40044A41D23440B801060C6 +:10CAF000002010BD0A2010BD2DE9F0478AB00025A6 +:10CB0000904689468246ADF8185007274BE00598B5 +:10CB100006888088000446D4A8F8006007A801951C +:10CB200000970295CDE903504FF40073002231467F +:10CB3000504601F03CFB04003CD1BDF81800ADF8B4 +:10CB40002000059804888188B44216D10A0414D4C0 +:10CB500001950295039521F400410097049541F455 +:10CB6000804342882146504601F0BFF804000BD1B3 +:10CB70000598818841F40041818005AA08A94846AA +:10CB8000FFF7A6FF0400DCD00097059802950195F9 +:10CB9000039504950188BDF81C300022504601F031 +:10CBA000A4F80A2C06D105AA06A94846FFF790FF6B +:10CBB0000400ACD0ADF8185004E00598818821F449 +:10CBC0000041818005AA06A94846FFF781FF002899 +:10CBD000F3D00A2C03D020460AB0BDE8F08700202D +:10CBE000FAE710B50C46896B86B051B10C218DF86F +:10CBF0000010A18FADF80810A16B01916946FAF7FA +:10CC00001BFB00204FF6FF71A063E187A08706B0F1 +:10CC100010BD2DE9F0410D460746896B0020069EA8 +:10CC20001446002911D0012B0FD13246294638462F +:10CC3000FFF762FF002808D1002C06D032462946B3 +:10CC40003846BDE8F04100F034BFBDE8F0812DE981 +:10CC5000FC411446DDE9087C0E46DDE90A15521D4B +:10CC6000BCF800E092B2964502D20720BDE8FC81F4 +:10CC7000ACF8002017222A70A5F80160A5F803304F +:10CC80000522CDE900423B462A46FFF7DFFD0020A2 +:10CC9000ECE770B50C46154648220021204601F00D +:10CCA000EEFB04F1080044F81C0F00204FF6FF7162 +:10CCB000E06161842084A5841720E08494F82A0030 +:10CCC00040F00A0084F82A0070BD4FF6FF720A8017 +:10CCD0000146032009F040BF30B585B00C4605463B +:10CCE000FFF77FFFA18E284629B101218DF80010A2 +:10CCF0006946FAF7A1FA0020E0622063606305B09C +:10CD000030BDB0F8400070475C00002090F846202D +:10CD1000920703D4408808800020F4E70620F2E759 +:10CD200090F846209207EED5A0F84410EBE70146B4 +:10CD3000002009880A0700D5012011F0F00F01D06A +:10CD400040F00200CA0501D540F004008A0501D573 +:10CD500040F008004A0501D540F010000905D2D581 +:10CD600040F02000CFE700B5034690F84600C0072A +:10CD700001D0062000BDA3F842101846FFF7D7FFE8 +:10CD800010F03E0F05D093F8460040F0040083F801 +:10CD9000460013F8460F40F001001870002000BD57 +:10CDA00090F84620520700D511B1B0F84200AAE72A +:10CDB0001720A8E710F8462F61F3C3020270A2E71C +:10CDC0002DE9FF4F9BB00E00DDE92B34DDE929781A +:10CDD000289D24D02878C10703D000F03F001928EF +:10CDE00001D9012100E000212046FFF7D9FFB04220 +:10CDF00015D32878410600F03F010CD41E290CD031 +:10CE0000218811F47F6F0AD13A8842B1A1F57F429F +:10CE1000FF3A04D001E0122901D1000602D5042016 +:10CE20001FB0C5E5FA491D984FF0000A08718DF84A +:10CE300018A08DF83CA00FAA0A60ADF81CA0ADF8B0 +:10CE400050A02978994601F03F02701F5B1C04F145 +:10CE5000180C4FF0060E4FF0040BCDF858C01F2AE7 +:10CE60007ED2DFE802F07D7D107D267DAC7DF47DF5 +:10CE7000F37DF27DF17DF47DF07D7D7DEF7DEE7DB6 +:10CE80007D7D7D7DED0094F84610B5F801008907A1 +:10CE900001D5032E02D08DF818B01EE34FF40061C7 +:10CEA000ADF85010608003218DF83C10ADF84000C3 +:10CEB000D4E2052EEFD1B5F801002083ADF81C00B7 +:10CEC000B5F80310618308B1884201D9012079E1E6 +:10CED0000020A07220814FF6FF702084169801F088 +:10CEE000D1F8052089F800000220029083460AABA1 +:10CEF0001D9A16991B9801F0C8F890BB9DF82E005A +:10CF0000012804D0022089F80100102003E001204C +:10CF100089F8010002200590002203A90BA807F060 +:10CF2000D4FDE8BB9DF80C00059981423DD13988BC +:10CF3000801CA1EB0B01814237DB02990220CDE975 +:10CF400000010DF12A034A4641461B98FFF77EFC7B +:10CF500002980BF1020B801C81B217AA029101E02A +:10CF60009CE228E003A90BA807F0AFFD02999DF809 +:10CF70000C00CDE9000117AB4A4641461B98FFF76C +:10CF800065FC9DF80C000AAB0BEB00011FFA81FB5E +:10CF900002991D9A084480B2029016991B9800E0ED +:10CFA00003E001F072F80028B6D0BBF1020F02D006 +:10CFB000A7F800B04FE20A208DF818004BE20021DC +:10CFC0000391072EFFF467AFB5F801002083ADF899 +:10CFD0001C00B5F80320628300283FF477AF90422D +:10CFE0003FF674AF0120A072B5F805002081002043 +:10CFF000A073E06900F04EFD78B9E1690120887105 +:10D00000E2694FF420519180E1698872E16942F64A +:10D0100001000881E06900218173F01F20841E98BF +:10D02000606207206084169801F02CF8072089F8C8 +:10D0300000000120049002900020ADF82A0028E0B2 +:10D0400019E29FE135E1E5E012E2A8E080E043E08B +:10D050000298012814D0E0698079012803D1BDF835 +:10D060002800ADF80E00049803ABCDE900B04A46A5 +:10D0700041461B98FFF7EAFB0498001D80B204901C +:10D08000BDF82A00ADF80C00ADF80E00059880B28E +:10D0900002900AAB1D9A16991B9800F0F6FF28B96A +:10D0A00002983988001D05908142D1D2029801284A +:10D0B00081D0E0698079012803D1BDF82800ADF85E +:10D0C0000E00049803ABCDE900B04A4641461B98D8 +:10D0D000FFF7BCFB0298BDE1072E02D0152E7FF4AE +:10D0E000DAAEB5F801102183ADF81C10B5F80320B5 +:10D0F000628300293FF4EAAE91423FF6E7AE012198 +:10D10000A1724FF0000BA4F808B084F80EB0052E01 +:10D1100007D0C0B2691DE26907F0B8FC00287FF4AF +:10D120004AAF4FF6FF70208401A906AA14A8CDF8D3 +:10D1300000B081E885032878214600F03F031D9A5E +:10D140001B98FFF79BFB8246208BADF81C0082E109 +:10D150000120032EC3D14021ADF85010B5F80110C5 +:10D160002183ADF81C100AAAB8F1000F00D00023EB +:10D17000CDE9020304921D98CDF804800090388810 +:10D180000022401E83B21B9801F011F88DF81800A0 +:10D1900090BB0B2089F80000BDF8280035E04FF067 +:10D1A000010C052E9BD18020ADF85000B5F8011080 +:10D1B0002183B5F803002084ADF81C10B0F5007F82 +:10D1C00003D907208DF8180087E140F47C422284BF +:10D1D0000CA8B8F1000F00D00023CDE90330CDE951 +:10D1E000018C1D9800903888401E83B21B9800F077 +:10D1F000DEFF8DF8180018B18328A8D10220BFE007 +:10D200000D2189F80010BDF83000401C22E100001B +:10D210005C000020032E04D248067FF53CAE0020BF +:10D2200018E1B5F80110ADF81C102878400602D5B9 +:10D230008DF83CE002E007208DF83C004FF000083C +:10D240000320CDE902081E9BCDF810801D980193A4 +:10D25000A6F1030B00901FFA8BF342461B9800F0D7 +:10D2600044FD8DF818008DF83C80297849060DD5CD +:10D270002088C00506D5208BBDF81C10884201D13E +:10D28000C4F8248040468DF81880E3E0832801D15B +:10D290004FF0020A4FF48070ADF85000BDF81C004A +:10D2A0002083A4F820B01E986062032060841321BC +:10D2B000CDE0052EFFF4EFADB5F80110ADF81C1070 +:10D2C000A28F6AB3A2F57F43FE3B29D008228DF8D6 +:10D2D0003C2000BF4FF0000B0523CDE9023BDDF8F9 +:10D2E00078C0CDF810B01D9A80B2CDF804C040F4DB +:10D2F00000430092B5F803201B9800F0F6FC8DF86F +:10D300003CB04FF400718DF81800ADF85010832830 +:10D3100010D0F8B1A18FA1F57F40FE3807D0DCE036 +:10D320000B228DF83C204FF6FE72A287D2E7A4F8BC +:10D330003CB0D2E000942B4631461E9A1B98FFF772 +:10D3400084FB8DF8180008B183284BD1BDF81C0070 +:10D35000208353E700942B4631461E9A1B98FFF713 +:10D3600074FB8DF81800E8BBE18FA06B0844831DA7 +:10D370008DE888034388828801881B98FFF767FC43 +:10D38000824668E095F80180022E70D15FEA0800BD +:10D3900002D0B8F1010F6AD109208DF83C0007A82E +:10D3A00000908DF840804346002221461B98FFF7ED +:10D3B00030FC8DF842004FF0000B8DF843B050B9AF +:10D3C000B8F1010F12D0B8F1000F04D1A18FA1F56F +:10D3D0007F40FF380AD0A08F40B18DF83CB04FF4A9 +:10D3E000806000E037E0ADF850000DE00FA91B9819 +:10D3F000F9F722FF82468DF83CB04FF48060ADF81B +:10D400005000BAF1020F06D0FC480068C07928B17C +:10D410008DF8180027E0A4F8188044E0BAF1000F56 +:10D4200003D081208DF818003DE007A80090434606 +:10D43000012221461B98FFF7ECFB8DF818002146CE +:10D440001B98FFF7CEFB9DF8180020B9192189F829 +:10D450000010012038809DF83C0020B10FA91B98D6 +:10D46000F9F7EAFE8246BAF1000F33D01BE018E06C +:10D470008DF818E031E02078000712D5012E10D188 +:10D480000A208DF83C00E088ADF8400003201B998D +:10D4900009F062FB0820ADF85000C0E648067FF5B1 +:10D4A000FAAC4FF0040A2088BDF8501008432080E1 +:10D4B000BDF8500080050BD5A18FA1F57F40FE3847 +:10D4C00006D11E98E06228982063A6864FF0030AD2 +:10D4D0005046A5E49DF8180078B1012089F80000B5 +:10D4E000297889F80110BDF81C10A9F802109DF8E0 +:10D4F000181089F80410052038802088BDF85010D5 +:10D5000088432080E4E72DE9FF4F8846087895B0EE +:10D51000012181404FF20900249C0140ADF8201008 +:10D520002088DDF88890A0F57F424FF0000AFF3A8E +:10D5300006D039B1000705D5012019B0BDE8F08F3C +:10D540000820FAE7239E4FF0000B0EA886F800B0E3 +:10D5500018995D460988ADF83410A8498DF81CB0BB +:10D56000179A0A718DF838B0086098F80000012801 +:10D570003BD0022809D003286FD1307820F03F003B +:10D580001D303070B8F80400E08098F800100320D7 +:10D59000022904D1317821F03F011B31317094F818 +:10D5A0004610090759D505ABB9F1000F13D000217A +:10D5B00002AA82E80B000720CDE90009BDF834007B +:10D5C000B8F80410C01E83B20022159800F0EFFDD9 +:10D5D0000028D1D101E0F11CEAE7B8F80400A6F870 +:10D5E0000100BDF81400C01C04E198F805108DF886 +:10D5F0001C1098F80400012806D04FF4007A022885 +:10D600002CD00328B8D16CE12188B8F8080011F4B7 +:10D610000061ADF8201020D017281CD3B4F84010BA +:10D62000814218D3B4F84410172901D3814212D192 +:10D63000317821F03F01C91C3170A6F801000321A7 +:10D64000ADF83410A4F8440094F8460020F002002D +:10D6500084F8460065E105257EE177E1208808F140 +:10D66000080700F4FE60ADF8200010F0F00F1BD0AA +:10D6700010F0C00F03D03888228B9042EBD199B9BB +:10D68000B878C00710D0B9680720CDE902B1CDF84D +:10D6900004B00090CDF810B0FB88BA88398815988E +:10D6A00000F023FB0028D6D12398BDF82010401CA1 +:10D6B00080294ED006DC10290DD020290BD040291E +:10D6C00087D124E0B1F5807F6ED051457ED0B1F591 +:10D6D000806F97D1DEE0C80601D5082000E0102059 +:10D6E00082460DA907AA0520CDE902218DF8380050 +:10D6F000ADF83CB0CDE9049608A93888CDE9000121 +:10D700005346072221461598FFF7B8F8A8E09DF880 +:10D710001C2001214FF00A0A002A9BD105ABB9F168 +:10D72000000F00D00020CDE902100720CDE900094C +:10D73000BDF834000493401E83B2218B002215985B +:10D7400000F035FD8DF81C000B203070BDF8140082 +:10D7500020E09DF81C2001214FF00C0A002A22D164 +:10D7600013ABB9F1000F00D00020CDE90210072063 +:10D77000CDE900090493BDF83400228C401E83B229 +:10D78000218B159800F013FD8DF81C000D203070D2 +:10D79000BDF84C00401CADF8340005208DF8380071 +:10D7A000208BADF83C00BCE03888218B88427FF4A8 +:10D7B00052AF9DF81C004FF0120A00281CD1606A7D +:10D7C000A8B1B878C0073FF446AF00E018E0BA68E7 +:10D7D0000720CDE902B2CDF804B00090CDF810B02A +:10D7E000FB88BA88159800F080FA8DF81C00132089 +:10D7F00030700120ADF8340093E000005C000020A0 +:10D800003988208B8142D2D19DF81C004FF0160A36 +:10D810000028A06B08D0E0B34FF6FF7000215F46F0 +:10D82000ADF808B0019027E068B1B978C907BED15A +:10D83000E18F0DAB0844821D03968DE80C024388EE +:10D840008288018809E0B878C007BCD0BA680DABFF +:10D8500003968DE80C02BB88FA881598FFF7F7F954 +:10D8600005005ED0072D72D076E0019005AA02A9CE +:10D870002046FFF72DF90146E28FBDF808008242ED +:10D8800001D00029F1D0E08FA16B084407800198F6 +:10D89000E08746E09DF81C004FF0180A40B1208B4D +:10D8A000C8B13888208321461598FFF79AF938E0E7 +:10D8B00004F118000090237E012221461598FFF7FD +:10D8C000A8F98DF81C000028EDD119203070012036 +:10D8D000ADF83400E7E7052521461598FFF781F9F3 +:10D8E0003AE0208800F40070ADF8200050452DD1BA +:10D8F000A08FA0F57F41FE3901D006252CE0D8F895 +:10D9000008004FF0160A48B1A063B8F80C10A187C0 +:10D910004FF6FF71E187A0F800B002E04FF6FF700C +:10D92000A087BDF8200030F47F611AD07823002250 +:10D930000320159909F066F898F8000020712088F6 +:10D94000BDF82010084320800EE000E00725208865 +:10D95000BDF8201088432080208810F47F6F1CD0F1 +:10D960003AE02188814321809DF8380020B10EA93A +:10D970001598F9F761FC05469DF81C000028EBD0CE +:10D9800086F801A001203070208B70809DF81C006B +:10D9900030710520ADF83400DEE7A18EE1B11898B2 +:10D9A0000DAB0088ADF834002398CDE90304CDE930 +:10D9B0000139206B0090E36A179A1598FFF700FA77 +:10D9C000054601208DF838000EA91598F9F734FCAA +:10D9D00000B10546A4F834B094F8460040070AD5D3 +:10D9E0002046FFF7A4F910F03E0F04D114F8460FBB +:10D9F00020F0040020701898BDF8341001802846EB +:10DA00009BE500B585B0032806D102208DF8000003 +:10DA100088B26946F9F710FC05B000BD10B5384C66 +:10DA20000B782268012B02D0022B2AD111E0137847 +:10DA30000BB1052B01D10423137023688A889A80C7 +:10DA40002268CB88D38022680B8913814989518150 +:10DA50000DE08B8893802268CB88D38022680B8965 +:10DA600013814B8953818B899381096911612168E5 +:10DA7000F9F7E2FB226800210228117003D0002888 +:10DA800000D0812010BD832010BD806B002800D005 +:10DA9000012070478178012909D10088B0F5205F05 +:10DAA00003D042F60101884201D1002070470720CF +:10DAB0007047F0B587B0002415460E460746ADF80E +:10DAC000184011E005980088288005980194811D70 +:10DAD000CDE902410721049400918388428801889E +:10DAE000384600F002F930B905AA06A93046FEF71B +:10DAF000EFFF0028E6D00A2800D1002007B0F0BDD3 +:10DB00005C00002010B58B7883B102789A4205D171 +:10DB10000B885BB102E08B79091D4BB18B789A427F +:10DB2000F9D1B0F801300C88A342F4D1002010BD27 +:10DB3000812010BD072826D012B1012A27D103E089 +:10DB4000497801F0070102E04978C1F3C2010529D3 +:10DB50001DD2DFE801F00318080C12000AB10320FF +:10DB600070470220704704280DD250B10DE00528FF +:10DB700009D2801E022808D303E0062803D0032818 +:10DB800003D005207047002070470F207047812088 +:10DB90007047C0B282060BD4000607D5FA48807AD7 +:10DBA0004143C01D01EBD00080B27047084670476A +:10DBB0000020704770B513880B800B781C0625D5A4 +:10DBC000F14CA47A844204D843F01000087000207D +:10DBD00070BD956800F0070605EBD0052D78F5407F +:10DBE00065F304130B701378D17803F0030341EA53 +:10DBF000032140F20123B1FBF3F503FB15119268F9 +:10DC0000E41D00FB012000EBD40070BD906870BDE6 +:10DC100037B51446BDF804101180117841F00401A5 +:10DC200011709DF804100A061ED5D74AA368C1F3E7 +:10DC30000011927A824208D8FE2811D1D21DD20852 +:10DC40004942184600F01BFC0AE003EBD00200F04A +:10DC50000703012510789D40A843994008431070A0 +:10DC6000207820F0100020703EBD2DE9F0410746DD +:10DC7000C81C0E4620F00300B04202D08620BDE84A +:10DC8000F081C14D002034462E60AF802881AA72F9 +:10DC9000E8801AE0E988491CE980810614D4E1781B +:10DCA00000F0030041EA002040F20121B0FBF1F254 +:10DCB00001FB12012068FFF76CFF2989084480B23C +:10DCC0002881381A3044A0600C3420784107E1D410 +:10DCD0000020D4E7AC4801220189C08800EB400055 +:10DCE00002EB8000084480B270472DE9FF4F89B0F5 +:10DCF0001646DDE9168A0F46994623F44045084644 +:10DD000000F054FB040002D02078400703D4012027 +:10DD10000DB0BDE8F08F099805F0E6F80290207884 +:10DD2000000606D59848817A0298814201D887205A +:10DD3000EEE7224601A90298FFF73CFF8346002048 +:10DD40008DF80C004046B8F1070F1AD00122214689 +:10DD5000FFF7F0FE0028DBD12078400611D5022025 +:10DD60008DF80C00ADF81070BDF80400ADF812008D +:10DD7000ADF814601898ADF81650CDF81CA0ADF8A9 +:10DD800018005FEA094004D500252E46A846012761 +:10DD90000CE02178E07801F0030140EA012040F234 +:10DDA0000121B0FBF1F2804601FB12875FEA494096 +:10DDB00009D5B84507D1A178207901F0030140EADF +:10DDC0000120B04201D3BE4201D90720A0E7A81923 +:10DDD0001FFA80F9B94501D90D2099E79DF80C008B +:10DDE00028B103A90998F9F725FA002890D1B84578 +:10DDF00007D1A0784FEA192161F30100A07084F8DF +:10DE000004901A9800B10580199850EA0A0027D0AA +:10DE1000199830B10BEB06002A46199900F005FB62 +:10DE20000EE00BEB06085746189E099805F0C9F955 +:10DE30002B46F61DB5B239464246009504F0B3FDB7 +:10DE4000224601A90298FFF7B5FE9DF8040022467C +:10DE500020F010008DF80400DDE90110FFF7D8FE76 +:10DE6000002055E72DE9FF4FDFF81C91824685B071 +:10DE7000B9F80610D9F8000001EB410100EB81046C +:10DE800040F20120B2FBF0F1174600FB1175DDE90D +:10DE9000138B4E4629460698FFF77BFE0346FFF795 +:10DEA00019FF1844B1880C30884202D9842009B087 +:10DEB0002FE70698C6B2300603D5B00601D5062076 +:10DEC000F5E7B9F80620521C92B2A9F80620BBF17A +:10DED000000F01D0ABF80020B00602D5C4F80880CE +:10DEE0000AE0B9F808201A4492B2A9F80820D9F833 +:10DEF0000000891A0844A0602246FE200699FFF718 +:10DF000087FEE77025712078390A61F301002A0A3B +:10DF1000A17840F0040062F30101A17020709AF82A +:10DF200002006071BAF80000E08000252573300619 +:10DF300002D599F80A7000E00127B00601D54FF02C +:10DF400000084E4600244FF007090FE0CDE90258C3 +:10DF50000195CDF800900495F1882046129B089A0F +:10DF6000FFF7C3FE0028A2D1641CE4B2BC42EDD38B +:10DF700000209CE700B5FFF7ADFE03490C308A880E +:10DF8000904203D9842000BD00060020CA8808689A +:10DF900002EB420300EB8300521C037823F00403DE +:10DFA0000370CA80002101730846ECE72DE9F047B1 +:10DFB000804600F0FBF9070005D000264446F74DE7 +:10DFC00040F2012916E00120BDE8F087204600F06C +:10DFD000EDF90278C17802F0030241EA0222B2FBB5 +:10DFE000F9F309FB13210068FFF7D3FD3044641CEB +:10DFF00086B2A4B2E988601E8142E7DCA8F1010084 +:10E00000E8802889801B288100203870DCE710B563 +:10E01000144631B1491E218004F066FFA070002033 +:10E0200010BD012010BD70B50446DC48C1880368EE +:10E0300001E0401C20802088884207D200EB40028B +:10E0400013EB820202D015786D07F2D580B28842B8 +:10E0500016D2AAB15079A072D08820819178107917 +:10E0600001F0030140EA0120A081A078E11CFFF744 +:10E07000A1FD20612088401C2080E080002070BD30 +:10E080000A2070BD0121018270472DE9FF4F85B044 +:10E090004FF6FF798246A3F8009048681E460D4669 +:10E0A00080788DF8060048680088ADF804000020EC +:10E0B0008DF80A00088A0C88A04200D304462C82FE +:10E0C00051E03878400708D4641C288AA4B2401C68 +:10E0D000288208F10100C0B246E0288A401C28824C +:10E0E000781D6968FFF70EFDD8BB3188494501D11D +:10E0F000601E30803188A1EB080030806888A04223 +:10E1000038D3B878397900F0030041EA002801A932 +:10E11000781DFFF7F7FC20BB298949452ED0002246 +:10E1200039460798FFF706FDD8B92989414518D126 +:10E13000E9680391B5F80AC0D7F808B05046CDF8A1 +:10E1400000C005F03EF8DDF800C05A460CF1070C9F +:10E150001FFA8CFC43460399CDF800C004F0EDFB98 +:10E1600060B1641CA4B200208046204600F01EF975 +:10E170000700A6D1641E2C820A2098E67480787964 +:10E18000B071F888B0803978F87801F0030140EA7E +:10E1900001207081A6F80C80504604F0A5FE3A4696 +:10E1A00006F10801FFF706FD306100207FE62DE94A +:10E1B000FF4F87B081461C469246DDF860B0DDF81F +:10E1C0005480089800F0F2F8050002D02878400743 +:10E1D00002D401200BB09CE5484604F085FE297866 +:10E1E000090605D56D49897A814201D88720F1E772 +:10E1F000CAF309062A4601A9FFF7DCFC0746149872 +:10E2000007281CD000222946FFF794FC0028E1D102 +:10E210002878400613D501208DF808000898ADF83D +:10E220000C00BDF80400ADF80E00ADF81060ADF8BC +:10E23000124002A94846F8F7FDFF0028CAD1297804 +:10E24000E87801F0030140EA0121AA78287902F078 +:10E25000030240EA0220564507D0B1F5007F04D9F9 +:10E26000611E814201DD0B20B4E7864201D90720FF +:10E27000B0E7801B85B2A54200D92546BBF1000F4F +:10E2800001D0ABF80050179818B1B9192A4600F020 +:10E29000CCF8B8F1000F0DD03E4448464446169FD6 +:10E2A00004F0A1FF2146FF1DBCB232462B4600946C +:10E2B00004F0ADFB00208DE72DE9F04107461D4637 +:10E2C0001646084600F072F8040002D02078400795 +:10E2D00001D40120D3E4384604F006FE2178090673 +:10E2E00005D52E49897A814201D88720C7E4224684 +:10E2F0003146FFF75FFC65B12178E07801F003015A +:10E3000040EA0120B0F5007F01D8012000E00020A4 +:10E3100028700020B3E42DE9F04107461D4616465B +:10E32000084600F043F8040002D02078400701D4EA +:10E330000120A4E4384604F0D7FD2178090605D56C +:10E340001649897A814201D8872098E422463146CD +:10E35000FFF75EFCFF2D14D02178E07801F0030276 +:10E3600040EA022040F20122B0FBF2F302FB13006C +:10E3700015B900F2012080B2E070000A60F30101DB +:10E38000217000207BE410B50C4600F00FF810B1AE +:10E390000178490704D4012010BD000000060020C8 +:10E3A000C18821804079A0700020F5E70749CA881C +:10E3B000824209D340B1096800EB40006FF00B02C4 +:10E3C00002EB8000084470470020704700060020E0 +:10E3D00070B504460D4621462B460AB9002070BD93 +:10E3E00001E0491C5B1C501E021E03D008781E78F9 +:10E3F000B042F6D008781E78801BF0E730B50C46A6 +:10E4000001462346051B954206D202E0521E9D5C42 +:10E410008D54002AFAD107E004E01D780D70491CE4 +:10E420005B1C521E002AF8D130BDF0B50E460146E5 +:10E43000334680EA030404F00304B4B906E002B9E9 +:10E44000F0BD13F8017B01F8017B521E01F00307B8 +:10E45000002FF4D10C461D4602E080CD80C4121F6F +:10E46000042AFAD221462B4600BF04E013F8014BE0 +:10E4700001F8014B521E002AF8D100BFE0E7F0B5C9 +:10E480000C460146E6B204E002B9F0BD01F8016BAA +:10E49000521E01F00307002FF6D10B46E5B245EA04 +:10E4A000052545EA054501E020C3121F042AFBD2D9 +:10E4B000194602E001F8016B521E002AFAD100BF92 +:10E4C000E3E7000010B508F0F6FDF4F7EDF908F009 +:10E4D0003DFCBDE8104008F005BD302834BF0120E8 +:10E4E00000207047202834BF4FF0A0420C4A01237F +:10E4F00000F01F0003FA00F0002914BFC2F80C0559 +:10E50000C2F808057047202834BF4FF0A0410449E5 +:10E5100000F01F00012202FA00F0C1F81805704750 +:10E520000003005070B50346002002466FF02F052F +:10E530000EE09C5CA4F130060A2E02D34FF0FF30AF +:10E5400070BD00EB800005EB4000521C2044D2B2AD +:10E550008A42EED370BD30B50A230BE0B0FBF3F472 +:10E5600003FB1404B0FBF3F08D183034521E05F891 +:10E57000014CD2B2002AF1D130BD30B500234FF6A4 +:10E58000FF7510E0040A44EA002084B2C85C6040D1 +:10E59000C0F30314604005EA00344440E0B25B1C61 +:10E5A00084EA40109BB29342ECD330BD2DE9F04198 +:10E5B000FE4B0026012793F864501C7893F868C03E +:10E5C000B8B183F89140A3F8921083F8902083F8B3 +:10E5D0008E70BCF1000F0CBF83F8946083F89450E8 +:10E5E000F3488068008804F0ECFDBDE8F04104F0D9 +:10E5F00081BA4FF6FF7083F89140A3F8920083F838 +:10E60000902083F88E70BCF1000F14BF83F89450F3 +:10E6100083F89460BDE8F0812DE9F041E44D29686C +:10E6200091F89C200024012A23D091F89620012AF9 +:10E6300030D091F86C301422DC4E0127012B32D0FF +:10E6400091F88E30012B4FD091F8A620012A1CBFE3 +:10E650000020BDE8F08144701F2200F8042B222224 +:10E66000A731FFF7E2FE286880F8A6400120BDE848 +:10E67000F08144701B220270D1F89D204260D1F8D5 +:10E68000A120826091F8A520027381F89C400120AE +:10E69000BDE8F081447007220270D1F898204260F2 +:10E6A00081F89640E2E78046447000F8042B20226F +:10E6B0006E31FFF7BAFE88F80870286880F86C4061 +:10E6C00090F86E000028D1D1B6F87000A6F8980036 +:10E6D000A868417B86F89A1086F89670008804F046 +:10E6E00070FD04F016FAC1E791F86C30012B0BD0E5 +:10E6F000447017220270D1F890204260B1F8942043 +:10E70000028181F88E40B1E78046447000F8042B06 +:10E7100020226E31FFF789FE88F80870286880F89B +:10E720006C4090F86E000028A0D1CDE7A0480068AA +:10E7300090F86C10002914BFB0F870004FF6FF700D +:10E74000704770B59A4C06462068002808BFFFDF66 +:10E750000025206845706660002808BFFFDF20683C +:10E76000417800291CBFFFDF70BDCC220021FFF7DC +:10E7700086FE2068FF2101707F2180F83810132168 +:10E780004184282180F86910012180F85C1080F80C +:10E79000615009F0F7F9BDE8704008F004BB844906 +:10E7A0000968097881420CBF012000207047804829 +:10E7B000006890F82200C0F3400070477C48006871 +:10E7C00090F8220000F0010070477948006890F846 +:10E7D0002200C0F3001070472DE9F043744803682D +:10E7E00093F82400B3F822C0C0F38001C0F34002C4 +:10E7F000114400F001000A18CCF30010002460B3AB +:10E80000BCF1130F21D00BDCBCF1100F02BF694823 +:10E8100030F81200BDE8F083BCF1120F15D008E00B +:10E82000BCF1150F09D0BCF11D0F04BF6248BDE853 +:10E83000F083FFDF2046BDE8F0836049002031F817 +:10E84000121012FB0010BDE8F0835D49002031F882 +:10E85000121012FB0010BDE8F08393F85E1093F8DD +:10E860005F002E264FF47A774FF014084FF04009DE +:10E87000022904BF4AF2D745B5FBF7F510D00129AC +:10E8800004BF4AF22F75B5FBF7F510D04AF62315F1 +:10E89000B5FBF7F5082908BF4E4613D0042918D058 +:10E8A000264608290ED0042913D0022949D004F1A4 +:10E8B000280604290FD008291CBF4FF01908082189 +:10E8C00004D00AE04FF0140806F5A8764FF0400196 +:10E8D00003E006F5A8764FF0100118FB016111FB6B +:10E8E0000251C2EB0212374D02EB820205EB8202AB +:10E8F00011441CF0010F4FF4C8724FF4BF7504BFF0 +:10E90000CCF34006002E7DD0CCF3400601F5A57176 +:10E91000EEB1082804BF164640270CD0042804BFD7 +:10E920002E46102707D0022807BF04F11806042737 +:10E9300004F12806082707EB870808EB87173E44F1 +:10E940001BE004F118064FF019080421C5E7082858 +:10E9500004BF174640260CD0042804BF2F461026BB +:10E9600007D0022807BF04F11807042604F128077E +:10E97000082606EB861607EB8606314401F19C0655 +:10E9800093F8691000F00C07002F08BF00213144F4 +:10E9900018BF01F5416127D1082804BF164640275A +:10E9A0001BD0042804BF2E4610270DE00C060020C3 +:10E9B00064000020E46202008F891300EC62020010 +:10E9C000DC620200D4FEFFFF07D0022807BF04F17B +:10E9D0001806042704F128060827C7EBC70707EB2A +:10E9E000470706EB4706314498311CF0010F19D058 +:10E9F000082808BF40200ED0042804BF2A46102053 +:10EA000009D000E04EE0022807BF04F118020420FC +:10EA100004F12802082000EB400303EB001010442F +:10EA200001443BE0082804BF944640260CD004284B +:10EA300004BFAC46102607D0022807BF04F1180C0B +:10EA4000042604F1280C082606EB8616B3F840309D +:10EA50000CEB860C6144EB2B20D944F2552C0B3384 +:10EA600003FB0CF39B0D082807D0042802D00228D2 +:10EA700005D008E02A46102008E0402006E004F116 +:10EA80001802042002E004F12802082000EB8010A4 +:10EA900002EB800000F5A57003FB001101F5B370D7 +:10EAA000BDE8F08301F5A571082804BF944640260F +:10EAB0000CD0042804BFAC46102607D0022807BF9C +:10EAC00004F1180C042604F1280C082606EB86161F +:10EAD000B3F848300CEB860C6144EB2BDED944F2E2 +:10EAE000552C0B3303FB0CF39B0D0828C5D00428D1 +:10EAF000C0D00228C7D1C2E7FE4840F271210068A9 +:10EB0000806A48437047FB48006890F83700002847 +:10EB100018BF0120704710B5F74C207B022818BFA2 +:10EB2000032808D1207D04F115010DF0A2FF08286B +:10EB30001CBF012010BD207B002816BF022800202A +:10EB40000120BDE8104009F037BDEB49087370475C +:10EB5000E849096881F8300070472DE9F047E54C35 +:10EB60002168087B002816BF022800200120487376 +:10EB700001F10E0109F00AFD2168087B022816BF89 +:10EB800003280122002281F82F204FF0080081F88D +:10EB90002D00487B01F10E034FF001064FF00007F6 +:10EBA000012804BF5B7913F0C00F0AD001F10E03F6 +:10EBB000012804D1587900F0C000402801D000207D +:10EBC00000E0012081F82E00002A04BF91F8220005 +:10EBD00010F0040F07D0087D01F115010DF049FF79 +:10EBE000216881F82D002068476006F01FFB21682E +:10EBF000C14D4FF00009886095F82D000DF055FFCC +:10EC0000804695F82F00002818BFB8F1000F04D0F7 +:10EC100095F82D000DF00EFD68B195F83000002834 +:10EC20001CBF95F82E0000281DD0697B05F10E0051 +:10EC300001290ED012E06E734A4605F10E014046DE +:10EC400009F0FAFC95F82D1005F10E000EF024F8ED +:10EC500009E0407900F0C000402831D0394605F184 +:10EC60000E0009F021FD2068C77690F8220010F010 +:10EC7000040F08BFBDE8F087002795F82D000DF0C0 +:10EC80008FFD050008BFBDE8F08710210EF03BFDA9 +:10EC9000002818BFBDE8F08720683A4600F11C0143 +:10ECA000C676284609F0C8FC206800F11C0160689F +:10ECB0000FF0E2F86068BDE8F04701210FF0F7B807 +:10ECC0000EF027F84A4605F10E0109F0B5FCCAE737 +:10ECD000884A1268137B0370D2F80E000860508ACD +:10ECE0008880704778B584490446824E407B08731B +:10ECF0003268207810706088ADF8000080B200F0B3 +:10ED00000101C0F3400341EA4301C0F3800341EA3B +:10ED10008301C0F3C00341EAC301C0F3001341EA19 +:10ED20000311C0F3401341EA4311C0F3801041EADC +:10ED300080105084E07D012808BF012507D00228FB +:10ED400008BF022503D0032814BFFFDF0825306861 +:10ED500080F85E50607E012808BF012507D0022898 +:10ED600008BF022503D0032814BFFFDF0825316840 +:10ED700081F85F5091F83500012829D0207B81F877 +:10ED80002400488C1D280CBF002060688862607DCC +:10ED900081F83700A07B002816BF02280020012040 +:10EDA0000875D4F80F00C1F81500B4F81300A1F8E5 +:10EDB0001900A07E91F86B2060F3071281F86B2098 +:10EDC000E07E012818BF002081F83400002078BDC3 +:10EDD00091F85E200420082A08BF81F85E00082D03 +:10EDE00008BF81F85F00C9E742480068408CC0F363 +:10EDF000001131B1C0F38000002804BF1F2070470C +:10EE000002E0C0F3400109B10020704710F0010F8B +:10EE100014BFEE20FF20704736480068408CC0F3D6 +:10EE2000001119B1C0F3800028B102E0C0F3400026 +:10EE300008B100207047012070472E490022096860 +:10EE40004A664B8C1D2B0CBF81F8682081F8680046 +:10EE500070470023274A126882F85D30D164A2F817 +:10EE60005000012082F85D007047224A002312689A +:10EE700082F85C30A2F858000120516582F85C00ED +:10EE800070471C49096881F83600704719490968BC +:10EE900081F8610070471748006890F96100704779 +:10EEA0001448006890F82200C0F3401070471148E1 +:10EEB000006890F82200C0F3C0007047012070473E +:10EEC0000C48006890F85F00704770B508F044FE89 +:10EED00008F023FE08F0EAFC08F098FD054C2068D5 +:10EEE000416E491C416690F83300002558B108F086 +:10EEF00049FE03E0640000200C06002007F053FFE9 +:10EF0000206880F833502068457090F8391021B19E +:10EF1000BDE87040042009F0EEBF90F86810D9B148 +:10EF2000406E814218D8042009F0E5FF206890F86F +:10EF3000220010F0010F07D0A06843220188BDE82D +:10EF400070400120FFF732BBBDE8704043224FF60E +:10EF5000FF710020FFF72ABBBDE87040002009F0D8 +:10EF6000CABF2DE9F04782B00F468146FE4E4FF0F2 +:10EF700000083068458C15F0030F10D015F0010F14 +:10EF800005F0020005D0002808BF4FF0010806D0A8 +:10EF900004E0002818BF4FF0020800D1FFDF4FF057 +:10EFA000000A544615F0010F05F002000DD080B99B +:10EFB00015F0040F0DD04AF00800002F1CBF40F0E0 +:10EFC000010040F002044DD09EE010B115F0040F96 +:10EFD0000DD015F0070F10D015F0010F05F002004D +:10EFE00043D0002808BF15F0040F34D04AE0002FAA +:10EFF00018BF4AF0090444D141E037B14AF0080093 +:10F00000044615F0200F1BD07EE0316805F0200289 +:10F01000B1F84800104308BF4AF0010474D04AF028 +:10F020001800044615F0200F6ED191F85E1011F013 +:10F030000C0118BF0121C94361F30000044663E0DD +:10F04000316891F85E1011F00C0118BF012161F3D5 +:10F050000000044658E04AF00800002F18BF40F0B6 +:10F06000010451D140F010044EE0002818BF15F003 +:10F07000040F07D0002F18BF4AF00B0444D14AF008 +:10F08000180441E015F0030F3DD115F0040F3AD0FC +:10F0900077B130684AF0080490F85E0010F00C0177 +:10F0A00018BF012161F3410415F0200F24D02BE09B +:10F0B000306805F02002B0F84810114308BF4AF04C +:10F0C000030421D04AF0180415F0200F0AD000BF25 +:10F0D00090F85E0010F00C0018BF0120C04360F3F0 +:10F0E000410411E090F85E1011F00C0118BF0121ED +:10F0F000C94361F30004EBE710F00C0018BF0120D6 +:10F1000060F3000400E0FFDF15F0400F1CD0CFB922 +:10F110003168B1F84800002804BF488C10F0010F96 +:10F120000BD110F0020F08BF10F0200F05D115F021 +:10F13000010F08BF15F0020F04D091F85E0010F027 +:10F140000C0F01D144F040047068A0F800A00178D1 +:10F1500021F0200101704FF007010EF059FE4146E9 +:10F1600070680FF04CF8214670680FF054F814F0F6 +:10F17000010F0CD04FF006034FF000027B4970687E +:10F180000FF023F83068417B70680EF083FE14F0B6 +:10F19000020F18D0D6E90010B9F1000F4FF00603A6 +:10F1A0004FF0010207D01C310FF00FF801217068F9 +:10F1B0000EF07DFE07E015310FF007F83068017D95 +:10F1C00070680EF074FE14F0040F18BFFFDF14F027 +:10F1D000080F19D0CDF800A03068BDF80020022338 +:10F1E000B0F86A1061F30B02ADF8002090F86B00E4 +:10F1F000032201099DF8010061F307108DF8010059 +:10F20000694670680EF0E1FF012F62D13068B0F8F6 +:10F210004810E1B390F82200C0F34000B8BB70681A +:10F220000EF0E9FF401CC7B23068C7F1FF05B0F827 +:10F230004820B0F85A10511AA942B8BF0D46AA4248 +:10F240003BD990F8220010F0010F36D144F01004A1 +:10F25000214670680EF0DFFFF81CC0B2ED1E284496 +:10F2600082B23068B0F86A10436EC1F30B0151FAF4 +:10F2700083F190F860303E4F1944BC460023E1FB17 +:10F2800007C31B096FF0240C03FB0C1100E020E006 +:10F2900080F8601090F85F00012101F01EF90090E5 +:10F2A000BDF800009DF80210032340EA01400190E0 +:10F2B000042201A970680EF088FF3068AAB2416C80 +:10F2C00070680EF0D6FF3068B0F85A102944A0F8E4 +:10F2D0005A1014F0400F06D0D6E900100123062280 +:10F2E00061310EF072FF14F0200F18BFFFDF002015 +:10F2F000002818BFFFDF02B0BDE8F0872DE9F0431A +:10F30000194C89B02068002808BFFFDF20684178C9 +:10F31000002944D10178FF2941D0002680F83160CE +:10F32000A0F85A60867080F83960304608F08EFB8D +:10F33000104802AD00F1240191E80E1085E80E108E +:10F34000D0E90D10CDE9061002A808F06DFB08F019 +:10F3500005F8206890F9610008F0D0F8064808F038 +:10F36000D3F806480CE00000640000201A060020D4 +:10F3700053E4B36ED0620200D8620200D56202008C +:10F3800008F03EFB606808F064FB206890F82400F9 +:10F3900010F0010F07D0252008F0BEF80AE009B0F0 +:10F3A0000C20BDE8F08310F0020F18BF262069D0B2 +:10F3B00008F0B2F8206890F85E10252007F08CFF66 +:10F3C000206880F82C6008F03BFB206890F85E1005 +:10F3D000002008F068F90F21052008F03AF82068AD +:10F3E00090F82E10002901BF90F82F10002990F8F6 +:10F3F000220010F0040F74D005F018FF05462068B5 +:10F400002946806806F001FCDFF82884074690FB57 +:10F41000F8F008FB10704142284605F0EEFB216829 +:10F42000886097FBF8F04A68104448600DF01EFBB6 +:10F4300001462068426891426ED8C0E90165FE4DE0 +:10F440004FF0010895F82D000DF02FFB814695F83F +:10F450002F000127002818BFB9F1000F04D095F83C +:10F460002D000DF0E7F8A0B195F8300000281CBF82 +:10F4700095F82E00002824D0687B05F10E010128A4 +:10F4800015D019E010F0040F14BF2720FFDF8FD133 +:10F4900090E73A466F7305F10E01484609F0CCF843 +:10F4A00095F82D1005F10E000DF0F6FB09E04879F6 +:10F4B00000F0C000402815D0414605F10E0009F0CB +:10F4C000F3F8206890F8220010F0040F24D095F88B +:10F4D0002D000DF065F905001ED010210EF013F976 +:10F4E00040B119E00DF015FC3A4605F10E0109F0A6 +:10F4F000A3F8E6E720683A4600F11C01C7762846E3 +:10F5000009F09AF8206800F11C0160680EF0B4FC64 +:10F51000012160680EF0CBFC2068417B0E3007F0C3 +:10F520007AFF206890F85C1061B3B0F85810A0F82A +:10F530004810416D416490F82210C1F30011F1B9F7 +:10F54000B0F86A000221C0F30B05ADF80050684620 +:10F5500006F0FCFF28B1BDF80000C0F30B00A84284 +:10F5600004D1BDF80000401CADF800002168BDF8D2 +:10F570000000B1F86A2060F30B02A1F86A2020684D +:10F5800080F85C60206890F85D1039B1B0F85010D8 +:10F59000A0F84010C16CC16380F85D60B0F86A10DB +:10F5A000426EC1F30B0151FA82F190F86020DFF84E +:10F5B0008CC2114463460022E1FB0C3212096FF049 +:10F5C000240302FB031180F860100DF0D2FA03212E +:10F5D00060680DF051FB216881F8330009B000200C +:10F5E000BDE8F0839649886070472DE9F043944C5C +:10F5F00083B0226892F831303BB1508C1D2808BF8F +:10F60000FFDF03B0BDE8F0435FE401260027F1B15E +:10F61000054692F8600007F07FFF206890F85F10C1 +:10F62000FF2007F059FE20684FF4A57190F85F2085 +:10F63000002008F0FEF8206890F8221011F0030F67 +:10F6400000F02C81002D00F0238100F027B992F802 +:10F6500022108046D07EC1F30011002956D0054605 +:10F6600060680780017821F020010170518C132916 +:10F6700037D01FDC102908BF022144D0122908BF4F +:10F68000062140D0FFDF6C4D606805F10E010EF0E1 +:10F69000E5FB697B60680EF0FDFB2068418C1D294D +:10F6A00018BF152963D0B0F84820416C60680EF08F +:10F6B0000AFC5CE0152918BF1D29E3D14FF00101B8 +:10F6C0000EF0A6FB6068017841F02001017021680E +:10F6D00085B11C310EF0D0FB012160680EF0E7FB14 +:10F6E000D1E700210EF094FB6068017841F0200121 +:10F6F0000170C8E715310EF0BFFB2068017D60681E +:10F700000EF0D5FBBFE70EF083FBBCE70021FFF74F +:10F7100028FC6068C17811F03F0F28D0017911F002 +:10F72000100F24D00EF072FB2368024693F82410C9 +:10F73000C1F38000C1F3400C604401F001010844B2 +:10F7400093F82C10C1F3800CC1F34005AC4401F0D8 +:10F7500001016144401AC1B293F85E0000F0BDFEA1 +:10F76000009003230422694660680EF02EFD206895 +:10F77000002590F8241090F82C0021EA000212F0E5 +:10F78000010F18BF01250ED111F0020F04D010F0A7 +:10F79000020F08BF022506D011F0040F03D010F0AD +:10F7A000040F08BF0425B8F1000F2BD0012D1BD08A +:10F7B000022D08BF26201BD0042D14BFFFDF2720F9 +:10F7C00016D0206890F85E10252007F085FD20688F +:10F7D00090F82210C1F3001169B101224FF4967123 +:10F7E000002008F026F80DE0252007F095FEE8E758 +:10F7F00007F092FEE5E790F85E204FF49671002046 +:10F8000008F017F8206890F82C10294380F82C1085 +:10F8100090F8242032EA01011CD04670418C132953 +:10F820002BD026DC102904BF03B0BDE8F0831229D9 +:10F8300023D007E040420F000C06002053E4B36ED3 +:10F8400064000020C1F30010002818BFFFDF03B0E0 +:10F85000BDE8F083418C1D2908BF80F82C70DCD0F6 +:10F86000C1F30011002914BF80F8316080F83170B5 +:10F87000D3E7152918BF1D29DBD190F85E2003B00E +:10F880004FF00101BDE8F043084608F0C0B900BFE1 +:10F8900090F85F200121084608F0B9F92168002D91 +:10F8A000C87E7CD04A8C3D46C2F34000002808BF89 +:10F8B00047F0080512F0400F18BF45F0400500283A +:10F8C00019BFD1F83C90B1F84080D1F84490B1F81C +:10F8D00048806068072107800EF09AFA002160686E +:10F8E0000EF08DFC294660680EF095FC15F0080FAF +:10F8F00017D02068BDF800100223B0F86A2062F328 +:10F900000B01ADF8001090F86B00032201099DF87F +:10F91000010061F307108DF80100694660680EF080 +:10F9200054FC60680EF030FB2168C0F1FE00B1F8B5 +:10F930005A20A8EB02018142A8BF0146CFB2D019DC +:10F94000404544D245F0100160680EF064FC6068E8 +:10F950000EF01AFB2168C0F1FE00B1F85A10A8EBB6 +:10F9600001018142A8BF0146CFB260680EF043FC9E +:10F970003844421C2068B0F86A10436EC1F30B0192 +:10F9800051FA83F190F86030FE4D1944AC460023E3 +:10F99000E1FB05C34FEA131C6FF0240300E03CE0D9 +:10F9A0000CFB031180F8601090F85F00012100F05B +:10F9B00094FD0090BDF800009DF80210032340EA7A +:10F9C00001400190042201A960680EF0FEFB21684D +:10F9D00091F8220010F0400F05D00123062261317A +:10F9E00060680EF0F2FB20683A46B0F85A0000EB6F +:10F9F000090160680EF03DFC2068B0F85A103944E7 +:10FA0000A0F85A1008F0D5FC002818BFFFDF2068C6 +:10FA10004670867003B0BDE8F0830121FFF7A1FABC +:10FA2000F0E7D94810B50068417841B90078FF285F +:10FA300005D000210846FFF7D8FD002010BD08F0D2 +:10FA40008BF808F06AF807F031FF07F0DFFF0C20B1 +:10FA500010BD2DE9F041CC4D0446174628680E46EE +:10FA600090F86C00002818BFFFDF2868002F80F88E +:10FA70006E7018BFBDE8F0812188A0F87010618811 +:10FA8000A0F88610A188A0F88810E188A0F88A1054 +:10FA900094F88C1180F88C1090F82F10002749B141 +:10FAA000427B00F10E01012A04D1497901F0C00125 +:10FAB000402935D090F8301041B1427B00F10E0161 +:10FAC000012A04BF497911F0C00F29D000F17A0052 +:10FAD00016F0E0FA6868FF2E0178C1F380116176B4 +:10FAE000D0F80310C4F81A10B0F80700E0832868B3 +:10FAF0001ED0C0F88010E18BA0F8841000F17402D1 +:10FB0000511E30460CF0DAFF002808BFFFDF2868DE +:10FB100090F8731041F0020180F87310BDE8F08195 +:10FB2000D0F80E10C0F87A10418AA0F87E10D1E704 +:10FB3000C0F88070A0F88470617E80F87310D4F8EB +:10FB40001A104167E18BA0F87810BDE8F08170B51C +:10FB50008D4C0125206890F82200C0F3C00038B118 +:10FB60003C22FF21A068FFF774FF206880F86C50EA +:10FB7000206890F8220010F0010F1CBFA0680188D7 +:10FB80004FF03C0212BF01204FF6FF710020FEF73C +:10FB90000DFD206880F8395070BD7B49096881F8F7 +:10FBA000320070472DE9F041002509F070F9002876 +:10FBB00000F00A81744C2068417801270026012951 +:10FBC00006D0022901D003297ED0FFDFBDE8F081F5 +:10FBD000817802260029418C46D0C1F34002002AD8 +:10FBE00008BF11F0010F70D090F85F204FF00101B5 +:10FBF0004FF0000008F00BF8216891F82200C0F3E4 +:10FC00004000002814BF0C20222091F85F1007F05C +:10FC100063FB2068467090F8330058B107F0AFF8E6 +:10FC2000206890F85F0010F00C0F0CBF40204520BA +:10FC300007F09EFF206890F83400002818BF07F0F6 +:10FC4000B6FF216891F85F0091F8691010F00C0F71 +:10FC500008BF0021962007F01DFF08F0A1FB002837 +:10FC600018BFFFDFBDE8F081C1F3001282B1102997 +:10FC70003FD090F8330020B107F081F8402007F022 +:10FC800077FF206890F8221011F0040F36D043E07F +:10FC900090F8242090F82C309A422AD1B0F84800ED +:10FCA000002808BF11F0010F05D111F0020F08BFA5 +:10FCB00011F0200F65D04FF001014FF00000FFF769 +:10FCC00094FC2068418C01E040E034E011F0010F29 +:10FCD00004BFC1F34001002907D1B0F85A10B0F8B1 +:10FCE0004820914218BFBDE8F08180F83170BDE82E +:10FCF000F081BDE8F0410021012076E490F8371052 +:10FD0000012914BF0329102545F00E0190F85E204B +:10FD10004FF0000007F07BFF206890F834000028C7 +:10FD200018BF07F044FF0021962007F0B3FE2068BB +:10FD30004670BDE8F081B0F85A10B0F84800814232 +:10FD400042D0BDE8F041012108464EE4817809B374 +:10FD5000418C11F0010F22D080F86C7090F86E2069 +:10FD6000B0F870100120FEF721FC2068467007F003 +:10FD7000F3FE07F0D2FE07F099FD07F047FE0320DF +:10FD800004E021E053E4B36E64000020BDE8F041DC +:10FD900009F0B1B88178BDE8F041012025E411F007 +:10FDA000020F04BFFFDFBDE8F081B0F85A10B0F8D1 +:10FDB0004000814208D001210846FFF716FC216867 +:10FDC00003204870BDE8F081BDE8F041FFF77DB841 +:10FDD000FFF77BB810B5FE4C206890F8341049B19D +:10FDE000383007F0F3FE18B921687F2081F8380019 +:10FDF00007F0D3FE206890F8330018B107F0C2FE78 +:10FE000006F0D1FF09F043F8A8B1206890F822105D +:10FE1000C1F3001179B14078022818BFFFDF00213B +:10FE20000120FFF7E2FB2068417800291EBF4078DF +:10FE30000128FFDF10BDBDE81040FFF746B82DE9EF +:10FE4000F047E34C0F4680462168B8F1030F488C19 +:10FE500008BFC0F3400508D000F0010591F832005A +:10FE6000002818BF4FF0010901D14FF0000907F039 +:10FE700047FB0646B8F1030F0CBF4FF002084FF0E6 +:10FE8000010835EA090008BFBDE8F087206890F84E +:10FE9000330068B10CF050FE38700146FF2807D0DF +:10FEA0006068C01C0CF021FE38780CF052FE06434E +:10FEB00060680178C1F3801221680B7D9A4208D1F5 +:10FEC0000622C01C1531FEF783FA002808BF012066 +:10FED00000D000203978FF2906D0C8B9206890F8F2 +:10FEE0002D00884216D113E0A0B1616811F8030B10 +:10FEF000C0F380100CF0BDFD05460CF01DFF38B1BD +:10FF000028460CF04DFC18B110210DF0FCFB08B197 +:10FF1000012000E00020216891F8221011F0040F68 +:10FF200001D0F0B11AE0CEB9AA4890F83700002805 +:10FF300018BF404515D1616811F8030BC0F380105C +:10FF40000CF097FD04460CF0F7FE38B120460CF09B +:10FF500027FC18B110210DF0D6FB10B10120BDE82F +:10FF6000F0870020BDE8F0872DE9F04F984D04465A +:10FF700083B0286800264078022818BFFFDF286871 +:10FF80004FF07F0B90F8341049B1383007F01EFE67 +:10FF9000002804BF286880F838B007F0FEFD6868C4 +:10FFA0000DF058FF8046002C00F0458207F04DFA16 +:10FFB000002800F04082012400274FF0FF09B8F12B +:10FFC000050F1ED1686890F8240000F01F0010286B +:10FFD00017D9286890F8360098B18DF800906946D6 +:10FFE0000520FFF72CFF002800F02582286880F804 +:10FFF000A64069682222A730C91CFEF716FA00F055 +:020000040001F9 +:100000001ABA68680EF0B1F8002800F01482404671 +:10001000DFF8C0814FF0030A062880F01E82DFE877 +:1000200000F0FCFCFC03FCFB8DF80090694603200B +:10003000FFF705FF002800F0F180296891F83400EF +:1000400010B191F89C00D8B12868817801294DD071 +:100050006868042107800DF0DBFE08F10E01686876 +:100060000DF0FCFE98F80D1068680DF013FF28687D +:10007000B0F84020C16B68680DF049FF00F063B92B +:100080009DF8000081F89C400A7881F89D20FF28A7 +:100090000FD001F19F029E310CF010FD002808BF27 +:1000A000FFDF286890F89E1041F0020180F89E1052 +:1000B0000DE068680278C2F3801281F89E20D0F8C3 +:1000C0000320C1F89F20B0F80700A1F8A30028681A +:1000D00000F1A50490F838007F2808BFFFDF2868EA +:1000E00090F83810217080F838B0ADE790F8220011 +:1000F0000721C0F3801938480479686869F38614C9 +:1001000007800DF085FE002168680EF078F8214622 +:1001100068680EF080F80623002208F10E01686876 +:100120000EF053F82868417B68680DF0B3FE6868EC +:100130000DF02AFF2968B1F84020C0F1FE018A4283 +:10014000B8BF1146CFB2BA423CD9F81EC7B244F08C +:10015000100B594668680EF05EF868680EF04BF8B0 +:10016000384400F101082868B0F86A10426EC1F303 +:100170000B0151FA82F190F86020184C0A44A44611 +:100180000023E2FB04C319096FF0240301FB0321E0 +:1001900080F8601090F85F004246012100F09DF960 +:1001A0000190BDF804009DF80610032340EA0140C9 +:1001B0000290042202A968680EF007F859466868A0 +:1001C0000EF029F8B9F1000F0FD0D5E9001007E0C3 +:1001D000640000200C060020D062020053E4B36EDD +:1001E0000123062261310DF0F0FF28683A46C16B09 +:1001F00068680EF03EF82868A0F85A70B0F8401011 +:100200008F420CBF0121002180F8311008F0D1F895 +:10021000002818BFFFDF96E007E01EE1286880781D +:10022000002840F00A8100F006B98DF80090686857 +:100230000178C1F38019D0F803100191B0F80700DC +:10024000ADF8080069460520FFF7F9FD0028286889 +:100250007DD0817800297CD090F85FB0D5E9010489 +:10026000D0F80F10C4F80E10B0F813106182417D61 +:100270002175817D6175B0F81710E182B0F8191011 +:100280006180B0F81B10A180B0F81D10E18000F172 +:100290001F0104F1080015F006FF686890F82410AB +:1002A00001F01F01217690F82400400984F88C01A8 +:1002B00084F864B084F865B01BF00C0F0CBF00210B +:1002C000012104F130000EF004FA2868002290F8B1 +:1002D000691084F8661090F8610084F867009DF852 +:1002E0000010A868FFF7B5FB022008F004FEB04834 +:1002F0000DF1040B08210468686807800DF088FD83 +:10030000002168680DF07BFF214668680DF083FFCF +:100310000623002208F10E0168680DF056FF2868D8 +:10032000417B68680DF0B6FD494668680DF0BFFD79 +:1003300006230122594668680DF047FF08F039F896 +:10034000002818BFFFDF286880F801A077E06DE083 +:10035000FFE76868D5F808804FF00109027898F83F +:100360000D10C2F34012114088F80D10D0F80F1094 +:10037000C8F80E10B0F81310A8F81210417D88F8D4 +:100380001410817D88F81510B0F81710A8F8161011 +:10039000B0F81910A8F80210B0F81B10A8F8041053 +:1003A000B0F81D10A8F8061000F11F0108F10800B0 +:1003B00015F079FE686890F8241001F01F0188F8A4 +:1003C000181090F824000021400988F88C0188F862 +:1003D000649088F8659008F130000EF07AF928688A +:1003E000002290F8691088F8661090F8610088F88B +:1003F00067009DF80010A868FFF72BFB286880F8BD +:100400006C4090F86E20B0F870100120FEF7CEF826 +:100410002868477007F0A0FB07F07FFB07F046FA5B +:1004200007F0F4FA012008F066FD08E090F82200D9 +:10043000C0F3001008B1012601E0FEF746FD286870 +:1004400090F8330018B107F09DFB06F0ACFC66B1E4 +:1004500000210120FFF7C9F810E0286890F8220079 +:10046000C0F300100028E8D0E5E72868817801296A +:1004700004D190F85F10FF2006F02EFF2868417825 +:10048000002919BF4178012903B0BDE8F08F4078F9 +:10049000032818BFFFDF03B0BDE8F08F70B5454CEF +:1004A00006460D462068807858B106F03CFE21686B +:1004B0000346304691F85F202946BDE8704009F0B8 +:1004C000D1BA06F030FE21680346304691F85E202E +:1004D0002946BDE8704009F0C5BA78B50C46002140 +:1004E0000091082804BF4FF4C87040210DD00428A3 +:1004F00004BF4FF4BF70102107D0022807BF01F1DD +:100500001800042101F128000821521D02FB0106F8 +:1005100028489DF80010006890F8602062F30501FB +:1005200041F040058DF8005090F85F0001282AD076 +:1005300002282FD004281CBF0828FFDF30D000BFBE +:1005400025F080008DF80000C4EB041000EB800063 +:100550004FF01E0101EB800006FB040416488442A4 +:1005600028BFFFDF1548A0FB0410BDF801100009EB +:1005700060F30C01ADF80110BDF800009DF8021009 +:1005800040EA014078BD9DF8020020F0E0008DF8BF +:100590000200D5E79DF8020020F0E000203004E0E2 +:1005A0009DF8020020F0E00040308DF80200C7E71F +:1005B000D062020064000020C4BF030089888888DC +:1005C0000178406829B190F82C1190F88C0038B966 +:1005D00001E001F0ADBD19B1042901D0012070473F +:1005E0000020704770B50C460546062102F0B6FCA7 +:1005F000606008B1002006E00721284602F0AEFC4A +:10060000606018B101202070002070BD022070BD14 +:100610002DE9FC470C4606466946FFF7E3FF002834 +:100620007DD19DF8000050B1FEF780F8B0427CD03B +:10063000214630460AF0C8FB002873D12DE00EF0A9 +:1006400091F9B04271D02146304613F0B0FA00283B +:1006500068D1019D95F8F00022E0012000E0002023 +:10066000804695F839004FF0010A4FF00009F0B1CB +:1006700095F83A0080071AD584F8019084F800A014 +:1006800084F80490E68095F83B102172A98F61816F +:10069000E98FA18185F8399044E0019D95F82C01FE +:1006A00070350028DBD1287F0028D8D0D5E7304628 +:1006B00002F099FD070000D1FFDF384601F0A7FFE7 +:1006C00040B184F801900F212170E680208184F8E8 +:1006D00004A027E0304602F074FD070000D1FFDFE0 +:1006E000B8F1000F21D0384601F0E9FFB8B19DF80C +:1006F000000038B90198D0F818014188B14201D101 +:1007000080F80090304607F0BFFE84F801900C217D +:10071000217084F80490E680697F217200E004E093 +:1007200085F81C900120BDE8FC870020FBE71CB584 +:100730006946FFF757FF00B1FFDF684601F004FD8F +:10074000FE4900208968A1F8F2001CBD2DE9FC419A +:1007500004460E46062002F0A9FB0546072002F0DB +:10076000A5FB2844C7B20025A8463E4417E02088D0 +:10077000401C80B22080B04202D34046A4F80080E2 +:1007800080B2B84204D3B04202D20020BDE8FC815E +:100790006946FFF727FF0028F8D06D1CEDB2AE4286 +:1007A000E5D84FF6FF7020801220EFE738B54FF6FE +:1007B000FF70ADF800000DE00621BDF8000002F06A +:1007C000DFFB04460721BDF8000002F0D9FB0CB1A5 +:1007D00000B1FFDF00216846FFF7B8FF0028EBD02B +:1007E00038BD70B507F0BEFE0BF02DFFD44C4FF6B0 +:1007F000FF76002526836683D2A0257001680079E4 +:10080000A4F14002657042F8421FA11C1071601CE7 +:1008100013F0E9FA1B2020814FF4A4716181A081BB +:10082000E181072121776177032121740422627419 +:100830006082A082A4F13E00E18205704680BF483C +:100840000C300570A4F110000570468084F820502B +:1008500070BD70B5B94C16460D466060217007F04A +:10086000F9FDFFF7A3FFFFF7BCFF207810F0B5FFFD +:10087000B6480EF0CAF92178606813F059FA20786A +:100880000BF00AF9284608F0B9FEB048FDF759FF09 +:10089000217860680AF072FB3146207813F01EFD63 +:1008A000BDE870400BF0CFBE10B501240AB10020A6 +:1008B00010BD21B1012903D00024204610BD022122 +:1008C0000DF014FDF9E710B503780446002B4068DD +:1008D00013460A46014609D05FF001000DF0B3F857 +:1008E0006168496A884203D9012010BD0020F5E7FC +:1008F000002010BD2DE9F04117468A781E4680463B +:1009000042B11546C87838B10446690706D52AB100 +:10091000012104E00725F5E70724F6E70021620737 +:1009200002D508B1012000E00020014206D00122DA +:1009300011464046FFF7C7FF98B93DE051B100228C +:1009400001214046FFF7BFFF58B9600734D50122A7 +:10095000114620E060B1012200214046FFF7B3FFBD +:1009600010B10920BDE8F081680725D5012206E015 +:1009700068074FEA44700AD5002814DB00220121E1 +:100980004046FFF7A0FFB8B125F0040514E00028A9 +:1009900012DA012200214046FFF795FF60B100BF47 +:1009A00024F0040408E0012211464046FFF78BFFC3 +:1009B00010B125F00405F3E73D7034700020D1E755 +:1009C00070B58AB0044600886946FFF70BFE002820 +:1009D00006D1A08830B1012804D0022802D012200C +:1009E0000AB070BD04AB03AA21466846FFF782FF38 +:1009F0000500F5D19DF8001001200026002901997D +:100A000006D081F8C501019991F81012B1BB2DE013 +:100A100081F82F01019991F8561139B9019991F88E +:100A20002E1119B9019991F8971009B13A2519E0D9 +:100A30000199059681F82E01019A9DF80C0082F823 +:100A40003001019B9DF8102083F83121A388019C7F +:100A5000A4F832318DF814008DF8152005AA002075 +:100A60000DF033F8019880F82F6126E0019991F894 +:100A7000C41119B9019991F8971009B13A2519E0F3 +:100A80000199059681F8C40101989DF80C2080F821 +:100A9000C621019B9DF8100083F8C701A388019C23 +:100AA000A4F8C8318DF814208DF8150005AA01208E +:100AB0000DF00BF8019880F8C561284690E710B555 +:100AC00004460020A17801B90120E2780AB940F07B +:100AD000020001F048FB002803D12046BDE8104089 +:100AE0006EE710BD70B5044691F8650091F8663068 +:100AF0000D4610F00C0F00D100232189A0880CF0C6 +:100B000099FF696A814229D2401A401CA188400895 +:100B1000091A8AB2A2802189081A2081668895F86C +:100B2000641010460CF064FF864200D230466080AC +:100B3000E68895F8651020890AE000007000002022 +:100B400018080020FFFFFFFF1F000000D80600204C +:100B50000CF04EFF864200D23046E08070BDF0B50A +:100B600085B00D46064603A9FFF73CFD00282DD1B0 +:100B70009DF80C0060B300220499FB20B1F84E30C0 +:100B8000FB2B00D30346B1F85040FB20FB2C00D3D5 +:100B90000446DFF85CC59CE8811000900197CDF811 +:100BA00008C0ADF80230ADF806406846FFF79AFF7E +:100BB0006E80BDF80400E880BDF808006881BDF8CB +:100BC0000200A880BDF806002881002005B0F0BD15 +:100BD0000122D1E72DE9F04186B00446008869463C +:100BE000FFF700FD002876D12189E08801F0D4FAD2 +:100BF000002870D1A188608801F0CEFA00286AD15F +:100C00002189E08801F0BFFA002864D1A1886088BA +:100C100001F0B9FA07005ED1208802A9FFF79FFF13 +:100C200000B1FFDFBDF8101062880920914252D355 +:100C3000BDF80C10E28891424DD3BDF81210BDF8FA +:100C40000E2023891144A2881A44914243D39DF86F +:100C50000010019D4FF00008012640F6480041B108 +:100C600085F8BB61019991F8FC1105F5DD7541B975 +:100C70001AE085F82561019991F84A1105F59275F8 +:100C800009B13A2724E0E18869806188E9802189F7 +:100C9000814200D30146A980A188814200D2084642 +:100CA0002881012201990FE0E18869806188E9804B +:100CB0002189814200D30146A980A188814200D2C6 +:100CC00008462881019900222846FFF70BFF2E7065 +:100CD00085F80180384606B044E67BE770B50446E7 +:100CE0000DF0F6FDB0B12078182811D12079012837 +:100CF0000ED1E088062102F031F9040008D02088E6 +:100D000007F0C2FB2088062102F03AF900B1FFDFAC +:100D1000012070BDF74D28780028FAD000266670B3 +:100D20001420207020223146201DFDF7A8FB022050 +:100D300020712E70ECE710B50446FDF76DFC00281D +:100D400013D0207817280FD1207968B1E0880721C7 +:100D500002F004F940B1008807F096FBE088072113 +:100D600002F00EF900B1FFDF012010BD2DE9F047C0 +:100D70005FEA000800D1FFDFDE4802211A30814619 +:100D8000FFF7E4FC00B1FFDFDA4C0620678B02F0CE +:100D90008DF80546072002F089F82844C5B2681C82 +:100DA000C6B2608BB04203D14046FFF7C4FF58B9CA +:100DB000608BA84203D14046FFF790FF20B9608BBB +:100DC0004146FFF725FC38B1404601F0F3F9002811 +:100DD000E7D10120BDE8F08702214846FFF7B6FCC5 +:100DE00010B9608BB842DCD14046BDE8F04713F043 +:100DF000BABA10B501F043F908B10C2010BD0BF0E0 +:100E000076FC002010BD10B50446007818B101280A +:100E100001D0122010BD01F043F920B10BF018FEF3 +:100E200008B10C2010BD207801F003F9E21D04F197 +:100E30001703611CBDE810400BF0FFBC10B5044661 +:100E400001F01DF908B10C2010BD207828B101284F +:100E500003D0FF280BD0122010BD01F0EAF8611C6E +:100E60000BF005FC08B1002010BD072010BD0120CB +:100E70000BF037FCF7E710B50BF0EDFD08B10020E3 +:100E800010BD302010BD10B5044601F009F908B1BD +:100E90000C2010BD20460BF0D8FD002010BD10B571 +:100EA00001F0FEF820B10BF0D3FD08B10C2010BD0D +:100EB0000BF028FD002010BDFF2181704FF6FF715F +:100EC00081808D4949680A7882718A8802814988BF +:100ED000418101214170002070477CB50025022A24 +:100EE00019D015DC12F10C0F15D009DC12F1280F06 +:100EF00011D012F1140F0ED012F1100F11D10AE01F +:100F000012F1080F07D012F1040F04D04AB902E021 +:100F1000D31E052B05D8012806D0022808D00328A7 +:100F20000AD0122528467CBD1046FDF7AFFFF9E731 +:100F300010460DF065FEF5E7084614466946FFF7D2 +:100F400051FB08B10225EDE79DF80000019800254E +:100F500080F86740E6E710B5134601220CF010FC5C +:100F6000002010BD10B5044611F029FA052804D060 +:100F7000204610F021FC002010BD0C2010BD10B543 +:100F8000044601F08DF808B10C2010BD2146002068 +:100F900007F0E9FA002010BD10B5044610F09BFCE4 +:100FA00050B108F08DFD38B1207808F033FB20787F +:100FB0000EF047F9002010BD0C2010BD10B50446FE +:100FC00001F06EF808B10C2010BD2146012007F099 +:100FD000CAFA002010BD38B504464FF6FF70ADF8D0 +:100FE0000000A079E179884216D02079FDF775FAE2 +:100FF00090B16079FDF771FA70B10022A0791146C5 +:1010000013F098FD40B90022E079114613F092FDEB +:1010100010B9207A072801D9122038BD08F05DFDEB +:1010200060B911F0CCF948B900216846FFF78EFB92 +:1010300020B1204606F029F9002038BD0C2038BD2B +:101040002DE9FC41817805461A2925D00EDC1629A8 +:101050002ED2DFE801F02D2D2D2D2D212D2D2D2D22 +:101060002D2D2D2D2D2D2D2D2D2121212A291FD046 +:101070000BDCA1F11E010C291AD2DFE801F01919CD +:101080001919191919191919190D3A3904290FD2F1 +:10109000DFE801F00E020E022888B0F5706F07D26B +:1010A00001276946FFF79EFA20B10220BDE8FC81C6 +:1010B0001220FBE79DF8000000F0C2FF019C10B178 +:1010C00004F58A7401E004F5C8749DF8000000F08E +:1010D000B7FF019E10B106F2151601E006F2911657 +:1010E0006846FFF76DFA08B1207838B10C20DDE7CB +:1010F0000C63020018080020700000202770A878F8 +:101100003070684601F020F80020CFE77CB50D462E +:101110006946FFF767FA002618B12E602E7102208B +:101120007CBD9DF8000000F08BFF019C9DF8000045 +:10113000703400F085FF019884F84260816829606E +:10114000017B297194F842100029F5D100207CBD63 +:1011500010B5044600F0A4FF20B10BF079FC08B1F3 +:101160000C2010BD207800F064FFE279611C0BF0C8 +:10117000F0FD08B1002010BD022010BD10B5886E32 +:1011800060B1002241F8682F0120CA718979884036 +:1011900013F0C4FC002800D01F2010BD0C2010BD8F +:1011A0001CB50C466946FFF71DFA002809D19DF8C9 +:1011B000000000280198B0F8700000D0401C20808A +:1011C00000201CBD1CB5044600886946FFF70AFADA +:1011D00008B102201CBD606828B1DDE9000122468B +:1011E00001F03CF81CBDDDE90001FFF7C7FF1CBDA5 +:1011F00070B51C460D4618B1012801D0122070BDF3 +:101200001946104601F068F830B12146284601F031 +:101210006DF808B1002070BD302070BD70B5044677 +:1012200000780E46012804D018B1022801D0032806 +:1012300040D1607828B1012803D0022801D00328CA +:1012400038D1E07B10B9A078012833D1A07830F0F4 +:1012500005012FD110F0050F2CD06289E188E078CC +:101260003346FFF7C5FF002825D1A07805281DD1FA +:101270006589A289218920793346FFF7B9FF0028C3 +:1012800019D1012004EB40014A8915442218D37872 +:10129000927893420ED1CA8889888A420AD1401C2A +:1012A000C0B20228EED3E088A84203D3A07B08B1E5 +:1012B000072801D9122070BD002070BD10B586B07E +:1012C000044600F0D1FE10B10C2006B010BD022182 +:1012D00004F10A0001F020F8A0788DF80800A07849 +:1012E0008DF8000060788DF8040020788DF80300F8 +:1012F000A07B8DF80500E07B00B101208DF8060091 +:10130000A078C10717D0E07800F0FAFF8DF801004F +:10131000E088ADF80A006089ADF80C00A0784007BD +:1013200016D5207900F0ECFF8DF802002089ADF889 +:101330000E00A0890AE040070AD5E07800F0E0FF3F +:101340008DF80200E088ADF80E006089ADF810005D +:1013500002A810F0CCFA0028B7D168460DF076FF4D +:10136000B3E710B504460121FFF758FF002803D169 +:101370002046BDE81040A1E710BD0278012A01D047 +:10138000BAB118E042783AB1012A05D0022A12D146 +:1013900089B1818879B100E059B1418849B180882B +:1013A00038B101EB8101490000EB8000B1EB002F67 +:1013B00001D2002070471220704770B504460078B3 +:1013C0000D46012809D010F0FAFF052803D010F0CF +:1013D0009EF9002800D00C2070BD0DF004FE88B1ED +:1013E0000DF016FE0DF012FF0028F5D125B1607842 +:1013F0000DF0A6FE0028EFD1A1886088BDE87040FE +:1014000010F09BBA122070BD10B504460121FFF701 +:10141000B4FF002804D12046BDE810400121CCE7EC +:1014200010BDF0B5871FDDE9056540F67B44A74296 +:1014300013D28F1FA74210D288420ED8B2F5FA7F7E +:101440000BD2A3F10A00241FA04206D2521C4A4329 +:10145000B2EB830F01DAAE4201D90020F0BD0120CA +:10146000F0BD2DE9FC47477A8946044617F0050F81 +:101470007ED0F8087CD194F83A0008B9012F77D1D2 +:101480000025A8462E46F90789F0010A19D0208ABE +:10149000514600F021FFE8B36089514600F026FF75 +:1014A000C0B3208A6189884262D8A18EE08DCDE9DF +:1014B0000001238D628CA18BE08AFFF7B2FF48B355 +:1014C0000125B8070ED504EB4500828EC18DCDE90C +:1014D0000012038D428C818BC08AFFF7A2FFC8B136 +:1014E000A8466D1C78071ED504EB45065146308A88 +:1014F00000F0F2FE70B17089514600F0F7FE48B17D +:10150000308A7189884253D8B18EF08DCDE90001BF +:10151000338D00E00BE0728CB18BF08AFFF781FF16 +:1015200028B12E466D1CB9F1000F03D030E03020F9 +:10153000BDE8FC87F80707D0780705D504EB46011E +:1015400060894989884233D1228A01211BE04145C3 +:1015500003D004EB4100008A024404EB4100C38A3B +:10156000868AB34224D1838B468BB34220D100E0DC +:101570001EE0438C068CB3421AD1038DC08C83428B +:1015800016D1491CC9B2A942E1D3608990420FD358 +:10159000207810B101280BD102E0A0780028F9D101 +:1015A000607838B1012805D0022803D0032801D083 +:1015B0001220BDE70020BBE7002152E70178C907F0 +:1015C00002D0406812F0A3BE12F070BE10B50078D1 +:1015D000012800D00020FDF754FC002010BD2DE9AB +:1015E000F0478EB00D46AFF6A422D2E90092014634 +:1015F00090462846FFF735FF06000CD100F034FD79 +:1016000040B9FE4F387828B90DF0ACF9A0F57F410C +:10161000FF3903D00C200EB0BDE8F087032105F19F +:10162000100000F079FEF54809AA3E380990F44808 +:101630000A90F248062110380B900CA801F05CFCCF +:10164000040037D000210BF005FE04F130017B8A45 +:10165000BA8ACB830A84797C0091BA463B7CBA8AE9 +:10166000798A208801F036FD00B1FFDF208806F07E +:101670000AFF218804F10E0000F01CFDE1A004F136 +:10168000120700680590032105A804F055FF00200B +:1016900005A90A5C3A54401CC0B20328F9D3A88BB0 +:1016A0006080688CA080288DE080687A410703D52F +:1016B00008270AE00920AEE7C10701D0012704E0AE +:1016C000800701D5022700E000273A46BAF8160045 +:1016D000114610F0C7F90146A062204610F0D0F97B +:1016E0003A46214600200CF0D3F900B90926C34A36 +:1016F00021461C3200200CF0E8F9002784F87670AF +:1017000084F87770A87800F094FC6076D5F8030030 +:10171000C4F81A00B5F80700E083C4F8089084F80C +:101720000C80012084F8200101468DF80070684685 +:1017300004F002FF9DF8000000F00701C0F3C102B1 +:101740001144C0F3401008448DF80000401D20767D +:10175000092801D208302076012120460BF07AFDBD +:1017600068780DF04BFCEEBBA9782878EA1C0DF0E8 +:1017700018FC48B10DF04CFCA9782878EA1C0DF053 +:10178000B9FC060002D052E0122650E0687A00F060 +:1017900005010020CA0700D001208A0701D540F0CA +:1017A0000200490701D540F008000DF0E3FB0600F8 +:1017B0003DD1214603200DF0C7FC060037D10DF0C6 +:1017C000CCFC060033D1697A01F005018DF80810D0 +:1017D000697AC90708D06889ADF80A00288AADF887 +:1017E0000C0000E023E00120697A8A0700D5401C44 +:1017F000490707D505EB40004189ADF80E10008A76 +:10180000ADF8100002A810F072F8064695F83A00FC +:1018100000B101200DF0C0FB4EB90DF0F7FC060041 +:1018200005D1A98F204610F003F8060008D02088C3 +:1018300006F02AFE2088062101F0A2FB00B1FFDF9E +:101840003046E8E601460020C9E638B56B48007826 +:1018500078B910F0B4FD052805D00DF083F8A0F597 +:101860007F41FF3905D0684610F0ABF8040002D084 +:101870000CE00C2038BD0098008806F005FE0098AA +:101880000621008801F07CFB00B1FFDF204638BD57 +:101890001CB582894189CDE900120389C2888188FB +:1018A0004088FFF7BEFD08B100201CBD30201CBDE4 +:1018B00070B50546FFF7ECFF00280ED128880621F9 +:1018C00001F04CFB040007D000F032FC20B1D4F84A +:1018D0001801017831B901E0022070BDD4F864111B +:1018E000097809B13A2070BD05218171D4F8181129 +:1018F00000200881D4F81811A8884881D4F818115C +:10190000E8888881D4F818112889C881D4F818018A +:10191000028941898A4204D88279082A01D88A42F8 +:1019200001D3122070BD29884180D4F818110220FB +:101930000870002070BD3EB504460BF0B3FEB0B198 +:101940002E480125A0F140024570236842F8423F2D +:1019500023790021137141706946062001F087FA4E +:1019600000B1FFDF684601F060FA10B10EE012200E +:101970003EBDBDF80440029880F82051684601F051 +:1019800054FA18B9BDF80400A042F4D100203EBDBD +:1019900070B505460088062101F0E0FA040007D082 +:1019A00000F0C6FB20B1D4F81811087830B901E076 +:1019B000022070BDD4F86401007808B13A2070BDEF +:1019C000B020005D10F0010F22D0D5F80200486071 +:1019D000D5F806008860D4F8180169891022818141 +:1019E000D4F8180105F10C010E3004F58C74FCF7E5 +:1019F0001CFD216803200870288805E018080020D5 +:101A00007C0000201122330021684880002070BD36 +:101A10000C2070BD38B504460078EF284DD860889A +:101A2000ADF80000009800F089FC88B361880807D1 +:101A300008D4D4E9012082423FD8202A3DD3B0F512 +:101A4000804F3AD8207B18B3072836D8607B28B15E +:101A5000012803D0022801D003282ED14A0703D43D +:101A6000022801D0032805D1A07B08B1012824D188 +:101A7000480707D4607D28B1012803D0022801D08F +:101A800003281AD1C806E07D03D5012815D110E03E +:101A900013E0012801D003280FD1C80609D4607EC5 +:101AA000012803D0022801D0032806D1A07E0F28E8 +:101AB00003D8E07E18B1012801D0122038BD0020E3 +:101AC00038BDF8B514460D46064608F006F808B1CC +:101AD0000C20F8BD3046FFF79DFF0028F9D1FDF737 +:101AE000DAF92870B07554B9FF208DF80000694606 +:101AF0000020FDF7BAF969460020FDF7AAF9304643 +:101B0000BDE8F840FDF7EEB80022DAE70078C1083A +:101B100001D012207047FD4981F820000020704755 +:101B200010B504460078C00704D1608810B1FDF7F5 +:101B300073F980B12078618800F00102607800F0CC +:101B400021FC002806D1FDF74FF901466088884244 +:101B500003D9072010BD122010BD6168FDF785F97B +:101B6000002010BD10B504460078C00704D160887D +:101B700010B1FCF71CFE70B12078618800F0010202 +:101B8000607800F0FFFB002804D160886168FDF7F1 +:101B900060F9002010BD122010BD7CB504464078CD +:101BA0004225012808D8A078FCF7F9FD20B120785B +:101BB0001225012802D090B128467CBDFDF777F9A7 +:101BC00020B1A0880028F7D08028F5D8FDF776F955 +:101BD00060B160780028EFD02078012808D006F0A6 +:101BE00075FD044607F067FC00287FD00C207CBD03 +:101BF000FCF791FF10B9FDF753F990B307F06DFFB3 +:101C00000028F3D1FCF792FDA0F57F41FF39EDD11B +:101C1000FCF7A3FFA68842F210704643A079FDF7B7 +:101C20000CF9FCF7CBFDF8B10022072101A801F067 +:101C300063F9040058D0B6480021846020460BF0B8 +:101C400016FA2046FDF7CEFCB04D04F130006A8A4A +:101C5000A98AC2830184FCF7B8FD60B1E88A01213A +:101C60000DE0FFE712207CBD3146002007F0D5FCD7 +:101C700088B3FFDF44E0FDF723F90146E88A07F067 +:101C800077FD0146A0620022204606F022FDFCF707 +:101C90009CFD38B9FDF714F90246214601200BF0EE +:101CA000F7FED0B1994A21461C3201200BF00DFFFE +:101CB000687C00902B7CAA8A698A208801F00AFA45 +:101CC00000B1FFDF208806F0DEFB3146204607F03A +:101CD000A4FC00B1FFDF13E008E00721BDF8040019 +:101CE00001F04EF900B1FFDF09207CBD44B120882E +:101CF00006F0CAFB2088072101F042F900B1FFDF9E +:101D000000207CBD002148E770B50D46072101F099 +:101D100025F9040003D094F8930110B10AE00220E1 +:101D200070BD94F87D00142801D0152802D194F8D4 +:101D3000E00108B10C2070BD1022294604F5CA70DC +:101D4000FCF773FB012084F89301002070BD10B5EF +:101D5000072101F003F918B190F8931111B107E0D0 +:101D6000022010BD90F87D10142903D0152901D050 +:101D70000C2010BD022180F89311002010BD2DE928 +:101D8000FC410C464BF68032122194421DD8E4B13E +:101D90006946FEF727FC002815D19DF8000000F0E9 +:101DA0004FF9019E9DF80000703600F049F9019D41 +:101DB000AD1C2F882246394630460BF04EF9288854 +:101DC000B842F6D10020BDE8FC810846FBE77CB5AF +:101DD000044600886946FEF705FC002810D19DF8EE +:101DE000000000F02DF9019D9DF80000703500F015 +:101DF00027F90198A27890F82C10914201D10C207B +:101E00007CBD7F212972A9720021E972E17880F8F6 +:101E10002D10217980F82E10A17880F82C10002048 +:101E20007CBD1CB50C466946FEF7DCFB00280AD1D8 +:101E30009DF8000000F004F9019890F88C0000B1C2 +:101E40000120207000201CBD7CB50D46144669465B +:101E5000FEF7C8FB002809D19DF8000000F0F0F85B +:101E6000019890F82C00012801D00C207CBD9DF831 +:101E7000000000F0E5F8019890F87810297090F8CB +:101E80007900207000207CBD70B50D4616460721F4 +:101E900001F064F818B381880124C388428804EBF8 +:101EA0004104AC4217D842F210746343A410624359 +:101EB000B3FBF2F2521E94B24FF4FA72944200D97C +:101EC0001446A54200D22C46491C641CB4FBF1F216 +:101ED0004A43521E91B290F8CC211AB901E0022077 +:101EE00070BD01843180002070BD10B50C46072103 +:101EF00001F034F870B180F8FF4024B190F8FD1083 +:101F000009B107F04BFC002010BD000018080020AC +:101F1000700000200220F7E7017889B1417879B19B +:101F200041881B290CD381881B2909D3C188022928 +:101F300006D3F74902680A65406848650020704783 +:101F40001220704710B504460FF088FD204607F0B8 +:101F5000DEFB0020D8E710B507F0DCFB0020D3E75C +:101F60002DE9F04115460F46064601221146384636 +:101F70000FF078FD04460121384607F0F9FB844252 +:101F800000D204460121304600F05FF806460121E8 +:101F9000002000F05AF83118012096318C4206D901 +:101FA00001F19600611AB1FBF0F0401C80B228806C +:101FB0000020BDE8F08110B5044600F071F808B1CA +:101FC0000C20A1E7601C0AF09FFE207800F00100C1 +:101FD000FCF7BEFD207800F001000DF014F80020A1 +:101FE00092E710B50446072000F052FF08B10C201C +:101FF0008AE72078C00711D000226078114612F0DD +:1020000099FD08B112207FE7A06809F028FB6078ED +:10201000D4F8041009F02CFB002075E7002009F02B +:102020001EFB00210846F5E710B505F008FE00206C +:102030006AE718B1022801D00120704700207047DC +:1020400008B1002070470120704710B5012904D065 +:10205000022905D0FFDF204656E7C000503001E0DE +:1020600080002C3084B2F6E710B510F0A8F90428EF +:1020700003D0052801D0002046E7012044E710B531 +:10208000FFF7F2FF10B10DF085F828B907F025FD34 +:1020900020B1FCF738FD08B1012035E7002033E717 +:1020A00010B5FFF7E1FF18B907F017FD002800D0C1 +:1020B000012029E72DE9FE4300250F4680460A2628 +:1020C0000421404604F061FA40460BF08CFA0620E9 +:1020D00000F0ECFE044616E06946062000F0C7FE5C +:1020E0000BE000BFBDF80400B84206D002980422FD +:1020F00041460E30FCF76CF950B1684600F095FE91 +:102100000500EFD0641E002C06DD002DE4D005E0B4 +:1021100040460BF071FAF5E705B9FFDFD8F800008B +:102120000BF085FA761E01D00028C9D0BDE8FE83E9 +:1021300090F8F01090F88C0020B919B1042901D062 +:102140000120704700207047017800290AD04168BB +:1021500091F8FD20002A05D0002281F8FD2040687A +:1021600007F01CBB704770B514460546012200F00D +:102170001DF9002806D121462846BDE870400022FE +:1021800000F014B970BDFB2802D8B1F5296F01D950 +:1021900011207047002070471B38E12806D2B1F5A6 +:1021A000A47F03D344F29020814201D912207047CA +:1021B000002070471FB55649403191F82010CA07DA +:1021C00002D102781D2A0AD08A0702D402781C2A7A +:1021D00028D049073DD40178152937D039E08088C7 +:1021E000ADF8000002A9FEF7FDF900B1FFDF9DF890 +:1021F0000800FFF725FF039810F8601F8DF8021004 +:1022000040788DF803000020ADF8040001B9FFDF2D +:102210009DF8030000B9FFDF6846FEF750FCD8B117 +:10222000FFDF19E08088ADF800004FF42961FB2042 +:10223000ADF80410ADF80200ADF80600ADF80810D6 +:102240006846FEF74AFD38B1FFDF05E0807BC00736 +:1022500002D0002004B057E60120FBE7F8B507469E +:10226000508915460C4640B1B0F5004F05D200220A +:10227000A878114612F05EFC08B11220F8BDA06EDD +:1022800004F1700630B1A97894F86E00814201D053 +:102290000C20F8BD012184F86F10A97884F86E1025 +:1022A0006968A1666989A4F86C102889B084002146 +:1022B00084F86F1028886946FEF772FFB08CBDF86D +:1022C0000010081A00B2002804DD21463846FEF747 +:1022D00055FFDDE70020F8BD042803D321B9B0F590 +:1022E000804F01D90020704701207047042803D394 +:1022F00021B9B0F5804F01D9002070470120704707 +:10230000012802D030B10020704702207047000041 +:10231000D80700200120F9E710B500224FF4C84487 +:1023200009E000BF30F81230A34200D9234620F85C +:102330001230521CD2B28A42F4D3E5E580B2C10613 +:102340000BD401071CD481064FEAC07101D5B9B97D +:1023500000E099B1800713D410E0410610D4810643 +:102360000ED4C1074FEA807104D0002902DB400778 +:1023700004D405E0010703D4400701D40120C5E7D8 +:102380000020C3E770B50C460546FF2904D8FCF7CA +:102390001CFA18B11F2C01D9122070BD2846FCF779 +:1023A000FEF908B1002070BD422070BD0AB10122C3 +:1023B00000E00222024202D1C80802D109B1002085 +:1023C000A4E71120A2E7000030B5058825F40044F9 +:1023D00021448CB24FF4004194420AD2121B92B2B3 +:1023E0001B339A4201D2A94307E005F4004121437F +:1023F00003E0A21A92B2A9431143018030BD084400 +:10240000083050434A31084480B2704770B51D46C9 +:1024100016460B46044629463046049AFFF7EFFF5E +:102420000646B34200D2FFDF282200212046FCF7F7 +:1024300026F84FF6FF70A082283EB0B26577608024 +:10244000B0F5004F00D9FFDF618805F13C00814203 +:1024500000D2FFDF60880835401B343880B220800E +:102460001B2800D21B2020800020A07770BD816136 +:10247000886170472DE9F05F0D46C188044600F180 +:102480002809008921F4004620F4004800F063FB8D +:1024900010B10020BDE8F09F4FF0000A4FF0010B93 +:1024A000B0450CD9617FA8EB0600401A0838854278 +:1024B00019DC09EB06000021058041801AE06088E4 +:1024C000617F801B471A083F0DD41B2F00DAFFDF06 +:1024D000BD4201DC294600E0B9B2681A0204120CC0 +:1024E00004D0424502DD84F817A0D2E709EB0600CC +:1024F0000180428084F817B0CCE770B5044600F143 +:102500002802C088E37D20F400402BB110440288EB +:10251000438813448B4201D2002070BD00258A42BB +:1025200002D30180458008E0891A0904090C418022 +:1025300003D0A01D00F01FFB08E0637F0088083374 +:10254000184481B26288A01DFFF73EFFE5750120A7 +:1025500070BD70B5034600F12804C588808820F45A +:1025600000462644A84202D10020188270BD9889F6 +:102570003588A84206D3401B75882D1A2044ADB279 +:10258000C01E05E02C1AA5B25C7F20443044401DDB +:102590000C88AC4200D90D809C8924B100241470B1 +:1025A0000988198270BD0124F9E770B5044600F16D +:1025B0002801808820F400404518208A002825D072 +:1025C000A189084480B2A08129886A881144814287 +:1025D00000D2FFDF2888698800260844A189884244 +:1025E00012D1A069807F2871698819B1201D00F07F +:1025F000C2FA08E0637F28880833184481B26288F1 +:10260000201DFFF7E1FEA6812682012070BD2DE985 +:10261000F041418987880026044600F12805B94227 +:1026200019D004F10A0800BF21F400402844418871 +:1026300019B1404600F09FFA08E0637F0088083334 +:10264000184481B262884046FFF7BEFE761C61895D +:10265000B6B2B942E8D13046BDE8F0812DE9F0418B +:1026600004460B4627892830A68827F40041B4F891 +:102670000A8001440D46B74201D10020ECE70AB1BF +:10268000481D106023B1627F691D1846FBF7CDFE1F +:102690002E88698804F1080021B18A1996B200F0E9 +:1026A0006AFA06E0637F62880833991989B2FFF7F6 +:1026B0008BFE474501D1208960813046CCE7818877 +:1026C000C088814201D101207047002070470189F4 +:1026D0008088814201D1012070470020704770B589 +:1026E0008588C38800F1280425F4004223F40041C2 +:1026F00014449D421AD08389058A5E19258863880F +:10270000EC18A64214D313B18B4211D30EE0437FD1 +:1027100008325C192244408892B2801A80B2233376 +:10272000984201D211B103E08A4201D1002070BD6C +:10273000012070BD2DE9F0478846C1880446008914 +:1027400021F4004604F1280720F4004507EB0609B0 +:1027500000F001FA002178BBB54204D9627FA81BC2 +:10276000801A002503E06088627F801B801A083889 +:1027700023D4E28962B1B9F80020B9F802303BB144 +:10278000E81A2177404518DBE0893844801A09E0CF +:10279000801A217740450ADB607FE18908303044A8 +:1027A00039440844C01EA4F81280BDE8F0874545AE +:1027B00003DB01202077E7E7FFE761820020F4E7F1 +:1027C0002DE9F74F044600F12805C088884620F41B +:1027D000004A608A05EB0A0608B1404502D2002093 +:1027E000BDE8FE8FE08978B13788B6F8029007EB34 +:1027F0000901884200D0FFDF207F4FF0000B50EA34 +:10280000090106D088B33BE00027A07FB9463071AC +:10281000F2E7E18959B1607F294408305044084407 +:10282000B4F81F1020F8031D94F821108170E2897C +:1028300007EB080002EB0801E1813080A6F802B046 +:1028400002985F4650B1637F30880833184481B2E4 +:102850006288A01DFFF7B8FDE78121E0607FE18974 +:1028600008305044294408442DE0FFE7E089B4F8DB +:102870001F102844C01B20F8031D94F821108170FC +:1028800009EB0800E28981B202EB0800E0813780A1 +:1028900071800298A0B1A01D00F06DF9A4F80EB0EF +:1028A000A07F401CA077A07D08B1E088A08284F8BA +:1028B00016B000BFA4F812B084F817B001208FE75B +:1028C000E0892844C01B30F8031DA4F81F1080784D +:1028D00084F82100EEE710B5818800F1280321F487 +:1028E00000442344848AC288A14212D0914210D06D +:1028F000818971B9826972B11046FFF7E8FE50B95B +:102900001089283220F40040104419790079884257 +:1029100001D1002010BD184610BD00F12803407FF2 +:1029200008300844C01E1060088808B9DB1E136018 +:1029300008884988084480B270472DE9F04100F1C9 +:102940002806407F1C4608309046431808884D886A +:10295000069ADB1EA0B1C01C80B2904214D9801A26 +:10296000A04200DB204687B298183A464146FBF762 +:102970002FFD002816D1E01B84B2B844002005E0EA +:10298000ED1CADB2F61EE8E7101A80B20119A9429B +:1029900006D8304422464146BDE8F041FBF718BD59 +:1029A0004FF0FF3058E62DE9F04100F12804407F58 +:1029B0001E46083090464318002508884F88069A1E +:1029C000DB1E90B1C01C80B2904212D9801AB04276 +:1029D00000DB304685B299182A464046FBF725FDB4 +:1029E000701B86B2A844002005E0FF1CBFB2E41EA5 +:1029F000EAE7101A80B28119B94206D82118324686 +:102A00004046FBF712FDA81985B2284624E62DE9B9 +:102A1000F04100F12804407F1E46083090464318DC +:102A2000002508884F88069ADB1E90B1C01C80B232 +:102A3000904212D9801AB04200DB304685B2981815 +:102A40002A464146FBF7F1FC701B86B2A8440020E1 +:102A500005E0FF1CBFB2E41EEAE7101A80B281193C +:102A6000B94206D8204432464146FBF7DEFCA8199D +:102A700085B22846F0E5401D704710B5044600F1C8 +:102A80002801C288808820F400431944904206D06F +:102A9000A28922B9228A12B9A28A904201D10020C9 +:102AA00010BD0888498831B1201D00F064F800206D +:102AB0002082012010BD637F62880833184481B2F0 +:102AC000201DFFF781FCF2E70021C18101774182DF +:102AD000C1758175704703881380C28942B1C2886D +:102AE00022F4004300F128021A440A60C0897047AA +:102AF0000020704710B50446808AA0F57F41FF3959 +:102B000000D0FFDFE088A082E08900B10120A0753D +:102B100010BD4FF6FF71818200218175704710B59D +:102B20000446808AA0F57F41FF3900D1FFDFA07DF8 +:102B300028B9A088A18A884201D1002010BD0120B7 +:102B400010BD8188828A914201D1807D08B1002028 +:102B500070470120704720F4004221F400439A425C +:102B600007D100F4004001F40041884201D0012067 +:102B700070470020704730B5044600880D4620F4A9 +:102B80000040A84200D2FFDF21884FF40040884374 +:102B90002843208030BD70B50C00054609D0082CB4 +:102BA00000D2FFDF1DB1A1B2286800F044F8201D5B +:102BB00070BD0DB100202860002070BD00210268AA +:102BC00003E093881268194489B2002AF9D100F011 +:102BD00032B870B500260D460446082900D2FFDF42 +:102BE000206808B91EE0044620688188A94202D006 +:102BF00001680029F7D181880646A94201D1006801 +:102C00000DE005F1080293B20022994209D328444D +:102C1000491B026081802168096821600160206091 +:102C200000E00026304670BD00230B608A800268F9 +:102C30000A600160704700234360021D0181026049 +:102C40007047F0B50F460188408815460C181E469F +:102C5000AC4200D3641B3044A84200D9FFDFA01966 +:102C6000A84200D9FFDF3819F0BD2DE9F0418846B0 +:102C700006460188408815460C181F46AC4200D312 +:102C8000641B3844A84200D9FFDFE019A84200D9EC +:102C9000FFDF70883844708008EB0400BDE8F081E5 +:102CA0002DE9F041054600881E461746841B8846DC +:102CB000BC4200D33C442C8068883044B84200D9E0 +:102CC000FFDFA019B84200D9FFDF68883044688070 +:102CD00008EB0400E2E72DE9F04106881D460446B2 +:102CE000701980B2174688462080B84201D3C01BB5 +:102CF00020806088A84200D2FFDF7019B84200D956 +:102D0000FFDF6088401B608008EB0600C6E730B537 +:102D10000D460188CC18944200D3A41A40889842EA +:102D200000D8FFDF281930BD2DE9F041C84D044619 +:102D30009046A8780E46A04200D8FFDF05EB860734 +:102D4000B86A50F8240000B1FFDFB868002816D038 +:102D5000304600F044F90146B868FFF73AFF050035 +:102D60000CD0B86A082E40F8245000D3FFDFB948D1 +:102D70004246294650F82630204698472846BDE866 +:102D8000F0812DE9F8431E468C1991460F46054601 +:102D9000FF2C00D9FFDFB14500D9FFDFE4B2009579 +:102DA0004DB300208046E81C20F00300A84200D06C +:102DB000FFDF4946DFF89892684689F8001089F8E5 +:102DC000017089F8024089F8034089F8044089F8C5 +:102DD000054089F8066089F80770414600F008F957 +:102DE000002142460F464B460098C01C20F00300CD +:102DF000009012B10EE00120D4E703EB8106B0622F +:102E0000002005E0D6F828C04CF82070401CC0B265 +:102E1000A042F7D30098491C00EB8400C9B200908F +:102E20000829E1D3401BBDE8F88310B50446EEF74E +:102E300036FA08B1102010BD2078854A618802EB6F +:102E4000800092780EE0836A53F8213043B14A1C27 +:102E50006280A180806A50F82100A060002010BD2F +:102E6000491C89B28A42EED86180052010BD70B538 +:102E700005460C460846EEF712FA08B1102070BD60 +:102E8000082D01D3072070BD25700020608070BD23 +:102E90000EB56946FFF7EBFF00B1FFDF6846FFF7AD +:102EA000C4FF08B100200EBD01200EBD10B50446C0 +:102EB000082800D3FFDF6648005D10BD3EB505461B +:102EC00000246946FFF7D3FF18B1FFDF01E0641C5F +:102ED000E4B26846FFF7A9FF0028F8D02846FFF7BC +:102EE000E5FF001BC0B23EBD59498978814201D936 +:102EF000C0B27047FF2070472DE9F041544B0629BE +:102F000003D007291CD19D7900E0002500244FF64D +:102F1000FF7603EB810713F801C00AE06319D7F8C5 +:102F200028E09BB25EF823E0BEF1000F04D0641CE1 +:102F3000A4B2A445F2D8334603801846B34201D167 +:102F400000201CE7BDE8F041EEE6A0F57F43FF3B23 +:102F500001D0082901D300207047E5E6A0F57F42A3 +:102F6000FF3A0BD0082909D2394A9378834205D910 +:102F700002EB8101896A51F82000704700207047F8 +:102F80002DE9F04104460D46A4F57F4143F20200CD +:102F9000FF3902D0082D01D30720F0E62C494FF06D +:102FA00000088A78A242F8D901EB8506B26A52F885 +:102FB0002470002FF1D027483946203050F82520C2 +:102FC00020469047B16A284641F8248000F007F86F +:102FD00002463946B068FFF727FE0020CFE61D49BC +:102FE000403131F810004FF6FC71C01C08407047AA +:102FF0002DE9F843164E8846054600242868C01C73 +:1030000020F0030028602046FFF7E9FF315D4843C8 +:10301000B8F1000F01D0002200E02A6801460092BA +:1030200032B100274FEA0D00FFF7B5FD1FB106E0F2 +:1030300001270020F8E706EB8401009A8A602968DE +:10304000641C0844E4B22860082CD7D3EBE60000E7 +:103050003C0800201863020070B50E461D4611465C +:1030600000F0D5F804462946304600F0D9F820444F +:10307000001D70BD2DE9F04190460D4604004FF053 +:10308000000610D00027E01C20F00300A04200D072 +:10309000FFDFE5B141460020FFF77DFD0C3000EB7E +:1030A000850617B113E00127EDE7624F04F10C002C +:1030B000AA003C602572606000EB85002060002162 +:1030C0006068FBF7DCF941463868FFF764FD30467D +:1030D000BDE8F0812DE9FF4F564C804681B0206855 +:1030E0009A46934600B9FFDF2068027A424503D929 +:1030F000416851F8280020B143F2020005B0BDE854 +:10310000F08F5146029800F082F886B258460E9928 +:1031100000F086F885B27019001D87B22068A146BC +:1031200039460068FFF755FD04001FD067802580F1 +:103130002946201D0E9D07465A4601230095FFF79C +:1031400065F92088314638440123029ACDF800A061 +:10315000FFF75CF92088C1193846FFF788F9D9F8DC +:1031600000004168002041F82840C7E70420C5E777 +:1031700070B5304C0546206800B9FFDF2068017A41 +:10318000A9420ED9426852F8251051B1002342F8E5 +:1031900025304A880068FFF747FD216800200A7A39 +:1031A00008E043F2020070BD4B6853F8203033B999 +:1031B000401CC0B28242F7D80868FFF7FFFC00202D +:1031C00070BD70B51B4E05460024306800B9FFDFA6 +:1031D0003068017AA94204D9406850F8250000B14E +:1031E000041D204670BD70B5124E0546002430689F +:1031F00000B9FFDF3068017AA94206D9406850F86B +:10320000251011B131F8040B4418204670BD10B5DB +:103210000A460121FFF7F3F8C01C20F0030010BD9F +:1032200010B50A460121FFF7EAF8C01C20F00300A0 +:1032300010BD00008400002070B50446C2F11005E6 +:103240002819FBF7F2F815F0FF0109D0491ECAB2A0 +:103250008020A0542046BDE870400021FBF70FB944 +:1032600070BD30B505E05B1EDBB2CC5CD55C6C405C +:10327000C454002BF7D130BD10B5002409E00B7801 +:10328000521E44EA430300F8013B11F8013BD2B25D +:10329000DC09002AF3D110BD2DE9F04389B01E46A8 +:1032A000DDE9107990460D00044622D0024608461A +:1032B000F949FDF750FE102221463846FFF7DCFFA2 +:1032C000E07B000606D5F44A394610231032084642 +:1032D000FFF7C7FF102239464846FFF7CDFFF87BBE +:1032E000000606D5EC4A4946102310320846FFF77F +:1032F000B8FF102200212046FBF7C1F80DE0103E78 +:10330000B6B208EB0601102322466846FFF7A9FF74 +:10331000224628466946FDF71EFE102EEFD818D02B +:10332000F2B241466846FFF787FF10234A466946D6 +:1033300004A8FFF796FF1023224604A96846FFF76A +:1033400090FF224628466946FDF705FE09B0BDE814 +:10335000F08310233A464146EAE770B59CB01E461A +:103360000546134620980C468DF808002022194681 +:103370000DF10900FBF759F8202221460DF1290033 +:10338000FBF753F817A913A8CDE90001412302AABE +:1033900031462846FFF780FF1CB070BD2DE9FF4F76 +:1033A0009FB014AEDDE92D5410AFBB49CDE90076D6 +:1033B000202320311AA8FFF76FFF4FF000088DF887 +:1033C00008804FF001098DF8099054F8010FCDF8ED +:1033D0000A00A088ADF80E0014F8010C1022C0F30A +:1033E00040008DF8100055F8010FCDF81100A888A5 +:1033F000ADF8150015F8010C2C99C0F340008DF8BC +:10340000170006A88246FBF710F80AA88346102288 +:103410002299FBF70AF8A0483523083802AA406829 +:103420008DF83C80CDE900760E901AA91F98FFF721 +:1034300033FF8DF808808DF809902068CDF80A00D8 +:10344000A088ADF80E0014F8010C1022C0F3400063 +:103450008DF810002868CDF81100A888ADF8150087 +:1034600015F8010C2C99C0F340008DF81700504658 +:10347000FAF7DBFF584610222299FAF7D6FF864862 +:103480003523083802AA40688DF83C90CDE90076D3 +:103490000E901AA92098FFF7FFFE23B0BDE8F08F29 +:1034A000F0B59BB00C460546DDE922101E461746D6 +:1034B000DDE92032D0F801C0CDF808C0B0F805C071 +:1034C000ADF80CC00078C0F340008DF80E00D1F8C4 +:1034D0000100CDF80F00B1F80500ADF81300087831 +:1034E0001946C0F340008DF815001088ADF816009D +:1034F00090788DF818000DF119001022FAF795FF59 +:103500000DF1290010223146FAF78FFF0DF1390035 +:1035100010223946FAF789FF17A913A8CDE900014F +:10352000412302AA21462846FFF7B6FE1BB0F0BD94 +:10353000F0B5A3B017460D4604461E46102202A859 +:103540002899FAF772FF06A820223946FAF76DFF8C +:103550000EA820222946FAF768FF1EA91AA8CDE96D +:103560000001502302AA314616A8FFF795FE1698CF +:10357000206023B0F0BDF0B589B00446DDE90E0748 +:103580000D463978109EC1F340018DF80010317856 +:103590009446C1F340018DF801101968CDF802106E +:1035A0009988ADF8061099798DF808100168CDF862 +:1035B00009108188ADF80D1080798DF80F00102367 +:1035C0006A46614604A8FFF74CFE2246284604A935 +:1035D000FDF7C1FCD6F801000090B6F80500ADF883 +:1035E0000400D7F80100CDF80600B7F80500ADF8E3 +:1035F0000A000020039010236A46214604A8FFF722 +:1036000030FE2246284604A9FDF7A5FC09B0F0BD0E +:103610001FB51C6800945B6801931368029352689D +:103620000392024608466946FDF795FC1FBD10B59A +:1036300088B00446106804905068059000200690F9 +:10364000079008466A4604A9FDF785FCBDF800000E +:10365000208008B010BD1FB51288ADF800201A8870 +:10366000ADF802200022019202920392024608461F +:103670006946FDF770FC1FBD7FB5074B1446054634 +:10368000083B9A1C6846FFF7E6FF22466946284633 +:10369000FFF7CDFF7FBD00007063020070B50446E8 +:1036A00000780E46012813D0052802D0092813D12E +:1036B0000EE0A06861690578042003F04DFA052D3D +:1036C0000AD0782300220420616903F09BF903E00B +:1036D0000420616903F040FA31462046BDE870409D +:1036E00001F08AB810B500F12D03C2799C78411D14 +:1036F000144064F30102C271D2070DD04A795C799B +:1037000022404A710A791B791A400A718278C97875 +:103710008A4200D9817010BD00224A71F5E74178D4 +:10372000012900D00C21017070472DE9F04F93B0B2 +:103730004FF0000B0C690D468DF820B0097801267A +:103740000C2017464FF00D084FF0110A4FF00809F2 +:103750001B2975D2DFE811F01B00C40207031F0309 +:103760005E037103A303B803F9031A04620495040A +:10377000A204EF042D05370555056005F30536064F +:10378000390668068406FE062207EB06F00614B129 +:1037900020781D282AD0D5F808805FEA08004FD08D +:1037A00001208DF82000686A02220D908DF82420F7 +:1037B0000A208DF82500A8690A90A8880028EED074 +:1037C00098F8001091B10F2910D27DD2DFE801F0F6 +:1037D0007C1349DEFCFBFAF9F8F738089CF6F50093 +:1037E00002282DD124B120780C2801D00026F0E346 +:1037F0008DF82020CBE10420696A03F0ADF9A88898 +:103800000728EED1204600F0F2FF022809D020461A +:1038100000F0EDFF032807D9204600F0E8FF072855 +:1038200002D20120207004E0002CB8D020780128BA +:10383000D7D198F80400C11F0A2902D30A2061E0F9 +:10384000C4E1A070D8F80010E162B8F80410218635 +:1038500098F8060084F832000120287003202070B8 +:1038600044E00728BDD1002C99D020780D28B8D18C +:1038700098F8031094F82F20C1F3C000C2F3C002DF +:10388000104201D0062000E00720890707D198F8F0 +:1038900005100142D2D198F806100142CED194F819 +:1038A000312098F8051020EA02021142C6D194F89E +:1038B000322098F8061090430142BFD198F80400D6 +:1038C000C11F0A29BAD200E008E2617D81427CD89A +:1038D000D8F800106160B8F80410218198F806004B +:1038E000A072012028700E20207003208DF8200087 +:1038F000686A0D9004F12D000990601D0A900F3048 +:103900000B9022E12875FCE3412891D1204600F07C +:103910006EFF042802D1E078C00704D1204600F0F1 +:1039200066FF0F2884D1A88CD5F80C8080B24FF0A8 +:10393000400BE669FFF745FC324641465B464E4682 +:10394000CDF80090FFF72FF80B208DF82000686A63 +:103950000D90E0690990002108A8FFF79FFE2078EC +:10396000042806D0A07D58B1012809D003280AD028 +:103970004AE305202070032028708DF82060CEE1F6 +:1039800084F800A032E712202070EAE11128BCD1AF +:10399000204600F02CFF042802D1E078C00719D09F +:1039A000204600F024FF062805D1E078C00711D199 +:1039B000A07D02280ED0204608E0CCE084E072E131 +:1039C00051E124E103E1E9E019E0B0E100F00FFF8B +:1039D00011289AD1102208F1010104F13C00FAF7F4 +:1039E00024FD607801286ED012202070E078C00796 +:1039F00060D0A07D0028C8D00128C6D05AE0112888 +:103A000090D1204600F0F3FE082804D0204600F0B4 +:103A1000EEFE132886D104F16C00102208F101019A +:103A20000646FAF702FD207808280DD014202070F1 +:103A3000E178C8070DD0A07D02280AD06278022A5A +:103A400004D00328A1D035E00920F0E708B101280F +:103A500037D1C80713D0A07D02281DD000200090C8 +:103A6000D4E9062133460EA8FFF777FC10220EA9F1 +:103A700004F13C00FAF7ACFCC8B1042042E7D4E9F9 +:103A80000912201D8DE8070004F12C0332460EA810 +:103A9000616BFFF770FDE9E7606BC1F34401491EFC +:103AA0000068C84000F0010040F08000D7E72078AF +:103AB000092806D185F800908DF8209036E328700B +:103AC000EFE30920FBE79EE1112899D1204600F0A1 +:103AD0008EFE0A2802D1E078C00704D1204600F00B +:103AE00086FE15288CD104F13C00102208F101015A +:103AF0000646FAF79AFC20780A2816D0162020707D +:103B0000D4E90932606B611D8DE80F0004F15C039C +:103B100004F16C0247310EA8FFF7C2FC10220EA977 +:103B20003046FAF755FC18B1F9E20B20207073E229 +:103B30002046FFF7D7FDA078216AC0F110020B18CC +:103B400000211846FAF79BFC26E3394608A8FFF740 +:103B5000A5FD06463CE20228B7D1204600F047FE0C +:103B6000042804D3204600F042FE082809D320464A +:103B700000F03DFE0E2829D3204600F038FE122822 +:103B800024D2A07D0228A0D10E208DF82000686AE2 +:103B90000D9098F801008DF82400F5E3022894D1E7 +:103BA000204600F024FE002810D0204600F01FFE22 +:103BB0000128F9D0204600F01AFE0C28F4D0042089 +:103BC0008DF8240098F801008DF8250060E2112896 +:103BD000FCD1002CFAD020781728F7D16178606AE0 +:103BE000022912D05FF0000101EB4101182606EB1B +:103BF000C1011022405808F10101FAF716FC042017 +:103C0000696A00F0E7FD2670F0E50121ECE70B287A +:103C1000DCD1002CDAD020781828D7D16078616AFE +:103C200002281CD05FF0000000EB4002102000EBE7 +:103C3000C2000958B8F8010008806078616A02285B +:103C40000FD0002000EB4002142000EBC200095806 +:103C5000404650F8032F0A604068486039E0012070 +:103C6000E2E70120EEE71128B0D1002CAED0207899 +:103C70001928ABD16178606A022912D05FF0000187 +:103C800001EB41011C2202EBC1011022405808F156 +:103C90000101FAF7CAFB0420696A00F09BFD1A20B3 +:103CA000B6E00121ECE7082890D1002C8ED02078D6 +:103CB0001A288BD1606A98F80120017862F34701D5 +:103CC0000170616AD8F8022041F8012FB8F80600A7 +:103CD00088800420696A00F07DFD90E2072011E6EB +:103CE0003878012894D1182204F114007968FAF781 +:103CF0009CFBE079C10894F82F0001EAD001E0783C +:103D000061F30000E070217D002974D1217803293E +:103D100009D0C00725D0032028708DF82090686A4C +:103D20000D90412008E3607DA178884201D90620EA +:103D3000E8E502262671E179204621F0E001E171F3 +:103D4000617A21F0F0016172A17A21F0F001A17293 +:103D5000FFF7C8FC2E708DF82090686A0D90072040 +:103D6000EAE20420ABE6387805289DD18DF82000E2 +:103D7000686A0D90B8680A900720ADF824000A9888 +:103D80008DF830B06168016021898180A17A8171EC +:103D900004202070F8E23978052985D18DF82010AB +:103DA000696A0D91391D09AE0EC986E80E004121E0 +:103DB000ADF824108DF830B01070A88CD7F80C80B6 +:103DC00080B24026A769FFF70EFA41463A463346CD +:103DD000C846CDF80090FEF71AFE002108A8FFF7AC +:103DE0005DFCE07820F03E00801CE0702078052823 +:103DF00002D00F200CE04AE1A07D20B1012802D0C2 +:103E0000032802D002E10720BEE584F80080EDE43B +:103E10002070EBE4102104F15C0002F0B6FB606B53 +:103E2000B0BBA07D18B1012801D00520FDE006201F +:103E30002870F8486063A063C2E23878022894D101 +:103E4000387908B12875B7E3A07D022802D003288D +:103E500005D022E0B8680028F5D060631CE06078E7 +:103E6000012806D0A07994F82E10012805D0E94841 +:103E700006E0A17994F82E00F7E7B8680028E2D0B0 +:103E80006063E078C00701D0012902D0E14803E077 +:103E900003E0F8680028D6D0A06306200FE68DF86E +:103EA0002090696A0D91E1784846C90709D0617888 +:103EB000022903D1A17D29B1012903D0A17D0329C4 +:103EC00000D00720287033E138780528BBD120784E +:103ED00007281ED084F800A005208DF82000686A0D +:103EE0000D90B8680A90ADF824A08DF830B0032189 +:103EF0000170E178CA070FD0A27D022A1AD00021F2 +:103F00000091D4E9061204F15C03401CFFF725FA86 +:103F10006BE384F80090DFE7D4E90923211D8DE8E5 +:103F20000E0004F12C0304F15C02401C616BFFF7EE +:103F300022FB5AE3626BC1F34401491E1268CA4076 +:103F400002F0010141F08001DAE738780528BDD19F +:103F50008DF82000686A0D90B8680A90ADF824A02A +:103F60008DF830B0042100F8011B102204F15C012F +:103F7000FAF75BFA002108A8FFF790FB20780928E0 +:103F800001D0132044E70A2020709AE5E078C107A9 +:103F900042D0A17D012902D0022927D038E06178E2 +:103FA00008A8012916D004F16C010091D4E9061289 +:103FB00004F15C03001DFFF7BBFA0A2028700326FA +:103FC0008DF82080686A0D90002108A8FFF766FB35 +:103FD000E1E2C7E204F15C010091D4E9062104F1B9 +:103FE0006C03001DFFF7A4FA0026E9E7C0F34401C3 +:103FF00014290DD24FF0006101EBB0104FEAB06010 +:10400000E0706078012801D01020BDE40620FFE6B2 +:10401000607801283FF4B6AC0A2050E5E178C90782 +:1040200008D0A17D012903D10B202870042030E0A5 +:1040300028702EE00E2028706078616B012818D05F +:1040400004F15C0304F16C020EA8FFF7E1FA2046CC +:10405000FFF748FBA0780EAEC0F1100230440021FB +:10406000FAF70DFA06208DF82000686A09960D907F +:104070009BE004F16C0304F15C020EA8FFF7C8FAA0 +:10408000E8E73978022903D139790029D0D0297598 +:1040900092E28DF82000686A0D9056E5387807287E +:1040A000F6D1D4E909216078012808D004F16C0028 +:1040B000CDE90002029105D104F16C0304E004F1A2 +:1040C0005C00F5E704F15C0304F14C007A680646F5 +:1040D000216AFFF763F96078012822D1A078216A6C +:1040E000C0F110020B1800211846FAF7C8F9D4E9FC +:1040F0000923606B04F12D018DE80F0004F15C03CE +:1041000000E05BE204F16C0231460EA8FFF7C8F94B +:1041100010220EA904F13C00FAF75AF908B10B205D +:10412000ACE485F8008000BF8DF82090686A0D909F +:104130008DF824A009E538780528A9D18DF820004C +:10414000686A0D90B8680A90ADF824A08DF830B078 +:1041500080F80080617801291AD0D4E9092104F19E +:104160002D03A66B03910096CDE9013204F16C0397 +:1041700004F15C0204F14C01401CFFF791F90021AD +:1041800008A8FFF78BFA6078012805D015203FE6D4 +:10419000D4E90912631DE4E70E20287006208DF88B +:1041A0002000686ACDF824B00D90A0788DF8280022 +:1041B000CBE438780328C0D1E079C00770D00F2055 +:1041C0002870072065E7387804286BD11422391D40 +:1041D00004F11400FAF729F9616A208CA1F80900AA +:1041E000616AA078C871E179626A01F00301117215 +:1041F000616A627A0A73616AA07A81F824001620E3 +:104200005DE485F800A08DF82090696A50460D9114 +:1042100092E00000706302003878052842D1B86847 +:10422000A8616178606A022901D0012100E00021C3 +:1042300001EB4101142606EBC1014058082102F0B0 +:10424000A4F96178606A022901D0012100E000210F +:1042500001EB410106EBC101425802A8E169FFF7F9 +:104260000BFA6078626A022801D0012000E0002089 +:1042700000EB4001102000EBC1000223105802A9FE +:104280000932FEF7EEFF626AFD4B0EA80932A16902 +:10429000FFF7E1F96178606A022904D0012103E0A7 +:1042A00044E18DE0BFE0002101EB4101182606EB5F +:1042B000C101A27840580EA9FAF7B7F86178606A90 +:1042C000022901D0012100E0002101EB410106EBB0 +:1042D000C1014158A0780B18C0F110020021184606 +:1042E000FAF7CDF805208DF82000686A0D90A869CE +:1042F0000A90ADF824A08DF830B0062101706278E4 +:10430000616A022A01D0012200E0002202EB42028F +:1043100006EBC202401C89581022FAF786F80021E9 +:1043200008A8FFF7BBF91220C5F818B028708DF85F +:104330002090686A0D900B208DF8240005E43878F1 +:10434000052870D18DF82000686A0D90B8680A9031 +:104350000B20ADF824000A98072101706178626A89 +:10436000022901D0012100E0002101EB41031021CD +:1043700001EBC30151580988A0F801106178626A05 +:10438000022902D0012101E02FE1002101EB4103CC +:10439000142101EBC30151580A6840F8032F496802 +:1043A000416059E01920287001208DF8300074E632 +:1043B000162028708DF830B0002108A8FFF76EF99C +:1043C000032617E114202870AEE6387805282AD194 +:1043D0008DF82000686A0D90B8680A90ADF824A0A6 +:1043E0008DF830B080F800906278616A4E46022AFB +:1043F00001D0012200E0002202EB42021C2303EB69 +:10440000C202401C89581022FAF70FF8002108A8B0 +:10441000FFF744F9152028708DF82060686A0D9028 +:104420008DF8246039E680E0387805287DD18DF854 +:104430002000686A0D90B8680A90ADF824900921B0 +:1044400001706169097849084170616951F8012F6B +:10445000C0F802208988C18020781C28A8D1A1E753 +:10446000E078C00702D04FF0060C01E04FF0070CD7 +:10447000607802280AD000BF4FF0000000EB040172 +:1044800001F1090105D04FF0010004E04FF00100F7 +:10449000F4E74FF000000B78204413EA0C030B7094 +:1044A00010F8092F02EA0C02027004D14FF01B0C25 +:1044B00084F800C0D2B394F801C0BCF1010F00D061 +:1044C0009BB990F800C0E0465FEACC7C04D028F0AD +:1044D00001060670102606E05FEA887C05D528F004 +:1044E0000206067013262E70032694F801C0BCF154 +:1044F000020F00D092B991F800C05FEACC7804D0E6 +:104500002CF001060E70172106E05FEA8C7805D5C5 +:104510002CF002060E701921217000260078D0BB05 +:10452000CAB3C3BB1C20207035E012E002E038782B +:10453000062841D11A2015E4207801283CD00C2807 +:104540003AD02046FFF7EBF809208DF82000686A82 +:104550000D9031E03878052805D006203870032604 +:104560001820287046E005208DF82000696A0D911A +:10457000B9680A910221ADF8241001218DF830109C +:104580000A990870287D4870394608A8FFF786F810 +:10459000064618202870012E0ED02BE001208DF841 +:1045A0002000686A0D9003208DF82400287D8DF886 +:1045B000250085F814B012E0287D80B11D20207000 +:1045C000172028708DF82090686A0D9002208DF8D1 +:1045D0002400394608A8FFF761F806460AE00CB146 +:1045E000FE2020709DF8200020B1002108A8FFF7D0 +:1045F00055F80CE413B03046BDE8F08F2DE9F043D8 +:1046000087B00C464E6900218DF8041001202578F2 +:10461000034602274FF007094FF0050C85B1012D25 +:1046200053D0022D39D1FE2030708DF80030606AF1 +:10463000059003208DF80400207E8DF8050063E0CE +:104640002179012925D002292DD0032928D0042938 +:1046500023D1B17D022920D131780D1F042D04D33F +:104660000A3D032D01D31D2917D12189022914D315 +:104670008DF80470237020899DF80410884201E0B1 +:104680006863020018D208208DF80000606A059067 +:1046900057E070780128EBD0052007B0BDE8F08323 +:1046A0001D203070E4E771780229F5D131780C29AA +:1046B000F3D18DF80490DDE7083402F804CB94E8D8 +:1046C0000B0082E80B000320E7E71578052DE4D105 +:1046D0008DF800C0656A0595956802958DF81010F3 +:1046E00094F80480B8F1010F13D0B8F1020F2DD067 +:1046F000B8F1030F1CD0B8F1040FCED1ADF804709F +:104700000E202870207E687000216846FEF7C6FFE4 +:104710000CE0ADF804700B202870207E002100F022 +:104720001F0068706846FEF7B9FF37700020B4E7D5 +:10473000ADF804708DF8103085F800C0207E6870E8 +:10474000277011466846FEF7A9FFA6E7ADF804906A +:104750002B70207F6870607F00F00100A870A07F40 +:1047600000F01F00E870E27F2A71C0071CD094F8A7 +:10477000200000F00700687194F8210000F00700A5 +:10478000A87100216846FEF789FF2868F062A888B2 +:104790003086A87986F83200A0694078707528794B +:1047A000B0700D203070C1E7A9716971E9E700B5FB +:1047B00087B004280CD101208DF800008DF804008A +:1047C000002005918DF8050001466846FEF766FF5A +:1047D00007B000BD70B50C46054602F0BDF9214694 +:1047E0002846BDE870407823002202F00BB908B1DA +:1047F000007870470C20704770B50C0005784FF0BA +:1048000000010CD021702146F0F787FD694821781E +:10481000405D884201D1032070BD022070BDF0F7D9 +:104820007CFD002070BD0279012A05D000220A70AB +:104830004B78012B02D003E0042070470A758A618F +:1048400002799300521C0271C15003207047F0B5E9 +:1048500087B00F4605460124287905EB800050F803 +:10486000046C7078411E02290AD252493A4608392E +:1048700001EB8000314650F8043C28469847044636 +:104880000CB1012C11D12879401E10F0FF002871C5 +:1048900001D00324E0E70A208DF80000706A05903B +:1048A000002101966846FFF7A7FF032CD4D007B07C +:1048B0002046F0BD70B515460A4604462946104606 +:1048C000FFF7C5FF064674B12078FE280BD1207C87 +:1048D00030B100202870294604F10C00FFF7B7FF23 +:1048E0002046FEF71CFF304670BD704770B50E467F +:1048F00004467C220021F9F7C2FD0225012E03D0D7 +:10490000022E04D0052070BD0120607000E06570AB +:104910002046FEF704FFA575002070BD28B1027C7B +:104920001AB10A4600F10C01C4E70120704710B526 +:10493000044686B0042002F00FF92078FE2806D045 +:1049400000208DF8000069462046FFF7E7FF06B01B +:1049500010BD7CB50E4600218DF804104178012968 +:1049600003D0022903D0002405E0046900E0446973 +:104970000CB1217C89B16D4601462846FFF753FFF3 +:10498000032809D1324629462046FFF793FF9DF8B8 +:104990000410002900D004207CBD04F10C05EBE7D5 +:1049A00030B40C460146034A204630BC024B0C3A58 +:1049B000FEF751BEAC6302006863020070B50D469D +:1049C000040012D08DB1220100212846F9F757FDCD +:1049D000102255492846F9F728FD53480121083887 +:1049E000018044804560002070BD012070BD70B51D +:1049F0004D4E00240546083E10E07068AA7B00EB8F +:104A00000410817B914208D1C17BEA7B914204D1A1 +:104A10000C222946F9F7DCFC30B1641C3088844252 +:104A2000EBDB4FF0FF3070BD204670BD70B50D461A +:104A3000060006D02DB1FFF7DAFF002803DB401C8B +:104A400014E0102070BD384C083C20886288411C5E +:104A5000914201D9042070BD6168102201EB001061 +:104A60003146F9F7E2FC2088401C208028700020A5 +:104A700070BD2D480838008870472B4908390888D0 +:104A8000012802D0401E08800020704770B51446EF +:104A90000D0018D0BCB10021A170022802D010284E +:104AA00011D105E0288870B10121A170108008E0C3 +:104AB0002846FFF79CFF002805DB401CA070A88952 +:104AC0002080002070BD012070BD70B505461446E1 +:104AD0000E000BD000203070A878012808D005D92E +:104AE0001149A1F108010A8890420AD9012070BD3C +:104AF00024B1287820702888000A5070022008709D +:104B00000FE064B14968102201EB00112046103912 +:104B1000F9F78BFC287820732888000A607310202E +:104B20003070002070BD0000900000202DE9F041A1 +:104B300090460C4607460025FE48072F00EB8816D6 +:104B400007D2DFE807F00707070704040400012580 +:104B500000E0FFDF06F81470002D13D0F548803018 +:104B600000EB880191F82700202803D006EB4000D5 +:104B7000447001E081F8264006EB4402202050708A +:104B800081F82740BDE8F081F0B51F4614460E4677 +:104B90000546202A00D1FFDFE649E648803100EBD8 +:104BA000871C0CEB440001EB8702202E07D00CEB96 +:104BB000460140784B784870184620210AE092F868 +:104BC0002530407882F82500F6E701460CEB4100DD +:104BD00005704078A142F8D192F82740202C03D0EC +:104BE0000CEB4404637001E082F826300CEB4104C6 +:104BF0002023637082F82710F0BD30B50D46CE4BF0 +:104C000044190022181A72EB020100D2FFDFCB48D0 +:104C1000854200DDFFDFC9484042854200DAFFDF00 +:104C2000C548401C844207DA002C01DB204630BD19 +:104C3000C148401C201830BDBF48C043FAE710B53A +:104C400004460168407ABE4A52F82020114450B10F +:104C50000220084420F07F40EDF7EDFF94F90810A2 +:104C6000BDE81040C9E70420F3E72DE9F047B14E55 +:104C7000803696F82D50DFF8BC9206EB850090F850 +:104C8000264034E009EB85174FF0070817F81400A9 +:104C9000012806D004282ED005282ED0062800D0C2 +:104CA000FFDF01F01BF9014607EB4400427806EBF9 +:104CB000850080F8262090F82720A24202D12022E9 +:104CC00080F82720084601F014F92A4621460120E1 +:104CD000FFF72CFF9B48414600EB0410026820467A +:104CE000904796F82D5006EB850090F82640202C32 +:104CF000C8D1BDE8F087022000E003208046D0E75D +:104D000010B58C4C2021803484F8251084F82610AE +:104D100084F82710002084F8280084F82D0084F8F7 +:104D20002E10411EA16044F8100B20746074207393 +:104D30006073A0738449E077207508704870002183 +:104D40007C4A103C02F81100491CC9B22029F9D351 +:104D50000120EDF760FE0020EDF75DFE012084F8F4 +:104D60002200EEF789F87948EEF79BF8764CA41EFE +:104D700020707748EEF795F86070BDE81040EDF7C9 +:104D8000D7BD10B5EDF7F9FD6F4CA41E2078EEF7F6 +:104D9000A1F86078EEF79EF8BDE8104001F0D6B8B3 +:104DA000202070470020EDF70FBE70B505460124A6 +:104DB0000E46AC405AB1FFF7F5FF0146654800EBDF +:104DC000C500C0F81015C0F81465634801E06248DA +:104DD000001D046070BD2DE9F34F564C0025803452 +:104DE00004EB810A89B09AF82500202821D0691E99 +:104DF00002915449009501EB0017391D03AB07C917 +:104E000083E80700A18BADF81C10A07F8DF81E0071 +:104E10009DF81500A046C8B10226494951F8204026 +:104E20000399A219114421F07F41019184B102211B +:104E30000FE00120EDF7EFFD0020EDF7ECFDEDF7C1 +:104E4000BAFD01F083F884F82F50A9E00426E4E7C6 +:104E500000218DF81810022801D0012820D10398D4 +:104E600001190998081A801C9DF81C1020F07F4039 +:104E700001B10221353181420BD203208DF815009A +:104E80000398C4F13201401A20F07F40322403908D +:104E90000CE098F8240018B901F039FA002863D022 +:104EA000322C03D214B101F045F801E001F04EF8C4 +:104EB000254A107818B393465278039B121B0021A1 +:104EC0009DF81840994601281AD0032818D00020D0 +:104ED0008DF81E00002A04DD981A039001208DF839 +:104EE00018009DF81C0000B1022103981B4A20F015 +:104EF0007F40039003AB099801F034F810B110E043 +:104F00000120E5E79DF81D0018B99BF80000032873 +:104F100029D08DF81C50CDF80C908DF818408DF8E4 +:104F20001E509DF8180010B3039801238119002228 +:104F3000184615E0840A0020FF7F841E0020A10788 +:104F4000BC63020084080020A2000020B3680100B6 +:104F50006B4C010000F0014004F50140FFFF3F00F1 +:104F6000EDF7ACFD06E000200BB0BDE8F08F0120AE +:104F7000EDF751FD97F90C20012300200199EDF781 +:104F80009DFDF87BC00701D0EDF781FE012188F877 +:104F90002F108AF8285020226946FE48F9F745FA72 +:104FA0000120E1E72DE9F05FDFF8E883064608EB32 +:104FB000860090F82550202D1FD0A8F180002C46A7 +:104FC00000EB8617A0F50079DFF8CCB305E0A24628 +:104FD00007EB4A004478202C0AD0EDF7BAFD09EB24 +:104FE00004135A4601211B1D00F0BCFF0028EED01F +:104FF000AC4202D0334652461EE0E84808B1AFF357 +:105000000080EDF7A6FD98F82F206AB1D8F80C20A3 +:10501000411C891A0902CA1701EB12610912002901 +:1050200002DD0020BDE8F09F3146FFF7D4FE08B155 +:105030000120F7E733462A4620210420FFF7A4FD8C +:10504000EFE72DE9F041D34C2569EDF782FD401BD8 +:105050000002C11700EB1160001200D4FFDF94F8CA +:10506000220000B1FFDF012784F8227094F82E009F +:10507000202800D1FFDF94F82E60202084F82E0035 +:10508000002584F82F5084F8205084F82150C4481B +:1050900025600078022833D0032831D00020207703 +:1050A000A068401C05D04FF0FF30A0600120EDF754 +:1050B000B2FC0020EDF7AFFCEDF7ABFDEDF7A3FD83 +:1050C000EDF779FC0FF0D2FDB648056005604FF0B2 +:1050D000E0214FF40040B846C1F88002EDF745FEEC +:1050E00094F82D703846FFF75DFF0028FAD0A948E4 +:1050F000803800EB871010F81600022802D006E076 +:105100000120CCE73A4631460620FFF70FFD84F830 +:10511000238004EB870090F82600202804D0A048C4 +:10512000801E4078EDF7DCFE207F002803D0EDF7ED +:1051300060FD2577657725E5964910B591F82D2016 +:105140000024803901EB821111F814302BB1641C5A +:10515000E4B2202CF8D3202010BD934901EB0411B8 +:1051600008600020C87321460120FFF7DFFC2046BD +:1051700010BD10B5012801D0032800D171B3854AB4 +:1051800092F82D30834C0022803C04EB831300BF47 +:1051900013F812400CB1082010BD521CD2B2202AC4 +:1051A000F6D37F4A48B1022807D0072916D2DFE894 +:1051B00001F01506080A0C0E100000210AE01B2160 +:1051C00008E03A2106E0582104E0772102E0962128 +:1051D00000E0B52151701070002010BD072010BDF7 +:1051E0006F4810B54078EDF726FD80B210BD10B5C0 +:1051F000202811D2674991F82D30A1F1800202EBED +:10520000831414F810303BB191F82D3002EB831267 +:1052100012F81020012A01D0002010BD91F82D2095 +:1052200001460020FFF782FC012010BD10B5EDF70C +:1052300090FCBDE81040EDF7FEBC2DE9F0410E46B4 +:10524000544F01782025803F0C4607EB831303E081 +:10525000254603EB45046478944202D0202CF7D114 +:1052600008E0202C06D0A14206D103EB4101497889 +:10527000017007E0002085E403EB440003EB4501E7 +:1052800040784870494F7EB127B1002140F22D404F +:10529000AFF300803078A04206D127B100214FF44F +:1052A0008660AFF30080357027B1002140F23540B1 +:1052B000AFF30080012065E410B542680B689A1ACC +:1052C0001202D41702EB1462121216D4497A91B169 +:1052D000427A82B9364A006852F82110126819449D +:1052E0001044001D891C081A0002C11700EB116050 +:1052F0000012322801DB012010BD002010BD2DE975 +:10530000F047294E814606F500709846144600EB9A +:10531000811712E006EB0415291D4846FFF7CCFF64 +:1053200068B988F80040A97B99F80A00814201D841 +:105330000020DEE407EB44004478202CEAD1012071 +:10534000D7E42DE9F047824612480E4600EB86006E +:10535000DFF8548090F825402020107008F5007088 +:105360009946154600EB86170BE000BF08EB0410CA +:105370005146001DFFF7A0FF28B107EB44002C7039 +:105380004478202CF2D1297889F800104B46224627 +:1053900031460FE0040B0020FFFF3F00000000003B +:1053A000A200002000F5004084080020000000005A +:1053B000BC6302005046BDE8F047A0E72DE9FC4180 +:1053C0000E4607460024FE4D09E000BF9DF8000090 +:1053D00005EB00108168384600F0D8FD01246B46CB +:1053E00001AA31463846FFF7ACFF0028EED0204630 +:1053F000BDE8FC8170B50446F2480125A54300EBE9 +:10540000841100EB85104022F9F70FF8EE4E26B11B +:1054100000214FF49360AFF30080EA48803000EB46 +:10542000850100EB8400D0F82500C1F8250026B1E5 +:10543000002140F29C40AFF30080284670BD8A42B4 +:1054400003D003460520FFF79FBB202906D0DD4A85 +:1054500002EB801000EB410040787047D949803161 +:1054600001EB800090F825007047D54901EB001052 +:10547000001DFFF7E4BB7CB51D46134604460E46EF +:1054800000F1080221461846EDF7E2FB94F9080006 +:105490000F2804DD1F3820722068401C206096B160 +:1054A0000220CA4951F82610461820686946801B18 +:1054B00020F07F40206094F908002844C01C1F2879 +:1054C00003DA012009E00420EBE701AAEDF7C0FBB5 +:1054D0009DF8040010B10098401C009000992068CD +:1054E00031440844C01C20F07F4060607CBDFEB5A4 +:1054F0000C46064609786079907220791F46154659 +:10550000507279B1217900222846A368FFF7B3FFD2 +:10551000AC492846803191F82E20202A0AD009690A +:10552000491D0DE0D4E90223217903B02846BDE8E6 +:10553000F040A0E7A6494978052900D20521314469 +:1055400021F07F4100F022FD39462846FFF736FF63 +:10555000D4E9023221796846FFF78DFF2B460021FE +:105560003046019A00F0FEFC002806D103B0314617 +:105570002846BDE8F04000F009BDFEBD2DE9FE4F14 +:10558000814600F0BFFC38B15FF0000799F80000D9 +:1055900020B10020BDE8FE8F0127F7E7894D8A4C36 +:1055A0004FF0000A803524B1002140F2FF40AFF3F4 +:1055B000008095F82D8085F823A0002624B10021D5 +:1055C00040F20450AFF300801FB94046FFF712FFCE +:1055D000804624B1002140F20C50AFF30080EDF77B +:1055E000B8FA43466A464946FFF781FF24B10021D5 +:1055F00040F21250AFF3008095F82E0020280CD016 +:1056000029690098401A0002C21700EB12600012CC +:1056100003D5684600F0BAFC012624B1002140F20F +:105620001C50AFF3008095F823000028BBD124B1B3 +:10563000002140F22250AFF30080EDF78AFA6B466A +:10564000644A002100F08EFC0028A3D027B941460F +:105650006846FFF7B3FE064326B16846FFF7EFFA48 +:10566000C9F8080024B1002140F23550AFF30080A2 +:1056700001208FE72DE9F04F89B08B46824600F07C +:1056800041FC504C803428B39BF80000002710B137 +:10569000012800D0FFDF4C4D25B1002140F2F7502A +:1056A000AFF300804649012001EB0A18A946079094 +:1056B0005FEA090604D0002140F2FF50AFF30080FA +:1056C000079800F016FC94F82D50002084F8230071 +:1056D00067B119E094F82E000127202800D1FFDFE0 +:1056E0009BF800000028D6D0FFDFD4E72846FFF75C +:1056F00081FE054626B1002140F20960AFF300802B +:1057000094F823000028D3D126B1002140F2136081 +:10571000AFF30080EDF71DFA2B4602AA5946079019 +:10572000FFF7E5FE98F80F005FEA060900F00100B8 +:105730008DF8130004D0002140F21D60AFF300800B +:105740003B462A4602A9CDF800A0079800F029FCA4 +:10575000064604EB850090F828000090B9F1000F90 +:1057600004D0002140F22460AFF3008000F0B6FBCB +:105770000790B9F1000F04D0002140F22A60AFF386 +:10578000008094F82300002892D1B9F1000F04D0D2 +:10579000002140F23260AFF300800DF1080C9CE86C +:1057A0000E00C8E90112C8F80C30B6B35FEA09066A +:1057B00004D0002140F23F60AFF3008000980BE07E +:1057C00084080020840A002000000000BC6302005E +:1057D000A2000020FFFF3F00B84312D094F82E0033 +:1057E00020280ED126B1002140F24460AFF30080A2 +:1057F0002846FFF7D7FB20B99BF80000D8B3012853 +:1058000049D0B9F1000F04D0002140F26160AFF33C +:105810000080284600F05BFB01265FEA090504D002 +:10582000002140F26A60AFF30080079800F061FB4E +:1058300025B1002140F26E60AFF300808EB194F884 +:105840002D0004EB800090F82600202809D025B117 +:10585000002140F27560AFF30080F8484078EDF722 +:105860003FFB25B1002140F27A60AFF3008009B020 +:105870003046BDE8F08FFFE7B9F1000F04D00021FA +:1058800040F24C60AFF3008094F82D205146042084 +:10589000FFF74CF9C0E7002E3FF40AAF002140F2B9 +:1058A0005760AFF3008003E72DE9F84FE44D8146E0 +:1058B00095F82D004FF00008E24C4FF0010B4746E1 +:1058C00024B100214FF4D160AFF30080584600F0BE +:1058D00010FB85F8237024B1002140F28D60AFF3F6 +:1058E000008095F82D00FFF785FD064695F823000A +:1058F00028B1002CE4D0002140F293604BE024B1A9 +:10590000002140F29760AFF30080CD48803800EB73 +:10591000861111F81900032856D1334605EB830A86 +:105920004A469AF82500904201D1012000E000206B +:1059300000900AF125000021FFF77FFC0146009846 +:10594000014203D001228AF82820AF77E1B324B1C5 +:10595000002140F29C60AFF30080324649460120AE +:10596000FFF7E4F89AF828A024B1002140F2A760DC +:10597000AFF3008000F0B2FA834624B1002140F278 +:10598000AC60AFF3008095F8230038B1002C97D0BD +:1059900000214FF4D660AFF3008091E7BAF1000F19 +:1059A00007D095F82E00202803D13046FFF7FAFAE9 +:1059B000E0B124B1002140F2C460AFF30080304672 +:1059C00000F085FA4FF0010824B1002140F2CD60CB +:1059D000AFF30080584600F08CFA24B1002140F269 +:1059E000D160AFF300804046BDE8F88F002CF1D0C5 +:1059F000002140F2BF60AFF30080E6E70120ECF742 +:105A0000E3BF8E48007870472DE9F0418C4C94F844 +:105A10002E0020281FD194F82D6004EB860797F8FC +:105A20002550202D00D1FFDF8549803901EB8610FC +:105A300000EB4500407807F8250F0120F87084F846 +:105A40002300294684F82E50324602202234FFF7E4 +:105A50006DF8002020700EE42DE9F0417A4E784C6C +:105A6000012538B1012821D0022879D003287DD022 +:105A7000FFDF20E400F05EFAFFF7C6FF207E00B1F2 +:105A8000FFDF84F821500020ECF7C5FFA168481C17 +:105A900004D0012300221846EDF710F814F82E0F59 +:105AA000217806EB01110A68012154E0FFF7ACFFF1 +:105AB0000120ECF7B0FF94F8210050B1A068401C21 +:105AC00007D014F82E0F217806EB01110A68062181 +:105AD00041E0207EDFF86481002708F102080128F8 +:105AE00003D002281ED0FFDFB5E7A777EDF781F8D6 +:105AF00098F80000032801D165772577607D534928 +:105B000051F8200094F8201051B948B16168012380 +:105B1000091A00221846ECF7D1FF022020769AE7F6 +:105B2000277698E784F8205000F004FAA07F50B15F +:105B300098F8010061680123091A00221846ECF761 +:105B4000BDFF257600E0277614F82E0F217806EBAE +:105B500001110A680021BDE8F041104700E005E0AE +:105B600036480078BDE8F041EDF7BAB9FFF74CFFD1 +:105B700014F82E0F217806EB01110A680521EAE7D7 +:105B800010B52F4C94F82E00202800D1FFDF14F818 +:105B90002E0F21782C4A02EB01110A68BDE8104053 +:105BA000042110477CB5264C054694F82E00202889 +:105BB00000D1FFDFA068401C00D0FFDF94F82E006A +:105BC000214901AA01EB0010694690F90C00284414 +:105BD000EDF73EF89DF904000F2801DD012000E0FB +:105BE0000020009908446168084420F07F41A160CA +:105BF00094F82100002807D002B00123BDE87040CE +:105C000000221846ECF75ABF7CBD30B5104A0B1A7B +:105C1000541CB3EB940F1FD3451AB5EB940F1BD351 +:105C2000934203D9101A43185B1C15E0954211D911 +:105C3000511A0844401C43420EE00000A00000201E +:105C4000040B00200000000084080020BC63020058 +:105C5000FF7F841EFFDF0023184630BD0123002292 +:105C600001460220ECF72ABF0220ECF7D4BEECF785 +:105C700070BF2DE9FE4FED4C05468A4694F82E0084 +:105C8000202800D1FFDFE94E94F82E10A0462046D0 +:105C9000A6F5207202EB011420218DF8001090F877 +:105CA0002D10376900EB8101D8F8000091F825909C +:105CB000284402AA01A90C36ECF7CAFF9DF9080096 +:105CC000002802DD0198401C0190A0680199642D14 +:105CD000084451D3D64B00225B1B72EB02014BD31D +:105CE0006168411A21F07F41B1F5800F44D220F064 +:105CF0007F40706086F80AA098F82D1044466B46E5 +:105D00004A463046FFF7FBFAA8B3A068401C10D003 +:105D1000ECF71FFFA168081A0002C11700EB116021 +:105D2000001202282ADD0120ECF775FE4FF0FF304B +:105D3000A06094F82D009DF8002020210F34FFF77B +:105D40007EFBA17FB94A803A02EB8111E27F01EB31 +:105D50004201487054F80F0C284444F80F0C0120FD +:105D600020759DF80000202803D0B2484078EDF758 +:105D7000B7F801200EE401E000200BE47760FBE7B8 +:105D80002DE9F047A94C074694F82D00A4F18006B0 +:105D900006EB801010F8170000B9FFDF94F82D50C3 +:105DA000A046A54C24B1002140F6E800AFF30080E6 +:105DB00040F6F40940F6FD0A06EB851616F81700C2 +:105DC000012819D0042811D005280FD006280DD09D +:105DD0001CB100214846AFF30080EDF705F9002C17 +:105DE000ECD000215046AFF30080E7E72A46394661 +:105DF0000120FEF79BFEF2E74FF0010A4FF0000989 +:105E0000454624B1002140F60410AFF3008050460F +:105E100000F06FF885F8239024B1002140F60910B6 +:105E2000AFF3008095F82D00FFF7E4FA064695F8E9 +:105E3000230028B1002CE4D0002140F60F101FE011 +:105E400024B1002140F61310AFF3008005EB86006B +:105E500000F1270133463A462630FFF7EEF924B128 +:105E6000002140F61710AFF3008000F037F88246AB +:105E700095F8230038B1002CC3D0002140F61D1046 +:105E8000AFF30080BDE785F82D60012085F8230081 +:105E9000504600F02EF8002C04D0002140F62A10C5 +:105EA000AFF30080BDE8F08730B504465F480D468B +:105EB00090F82D005D49803901EB801010F8140036 +:105EC00000B9FFDF5D4800EB0410C57330BD5749D2 +:105ED00081F82D00012081F82300704710B5584843 +:105EE00008B1AFF30080EFF3108000F0010072B64C +:105EF00010BD10B5002804D1524808B1AFF300809E +:105F000062B610BD50480068C005C00D10D01038F2 +:105F100040B2002804DB00F1E02090F8000405E026 +:105F200000F00F0000F1E02090F8140D40097047D8 +:105F30000820704710B53D4C94F82400002804D187 +:105F4000F5F7B2FE012084F8240010BD10B5374CDF +:105F500094F82400002804D0F5F7CFFE002084F840 +:105F6000240010BD10B51C685B68241A181A24F0B0 +:105F70007F4420F07F40A14206D8B4F5800F03D2C1 +:105F8000904201D8012010BD002010BDD0E90032A0 +:105F9000D21A21F07F43114421F07F41C0E9003142 +:105FA00070472DE9FC418446204815468038089CFE +:105FB00000EB85160F4616F81400012804D00228BD +:105FC00002D00020BDE8FC810B46204A012160463A +:105FD000FFF7C8FFF0B101AB6A4629463846FFF724 +:105FE000B0F9B8B19DF804209DF800102846FFF7DD +:105FF00026FA06EB440148709DF8000020280DD0D9 +:1060000006EB400044702A4621460320FEF78EFD31 +:106010000120D7E72A4621460420F7E7034801215B +:1060200000EB850000F8254FC170ECE7040B002061 +:10603000FF1FA107A000002000000000840800202E +:10604000000000000000000004ED00E0FFFF3F0042 +:106050002DE9F041044680074FF000054FF001069E +:106060000CD56B480560066000F0DEF920B1694888 +:10607000016841F48061016024F00204E0044FF003 +:10608000FF3705D564484660C0F8087324F480548F +:10609000600003D56148056024F08044E0050FD519 +:1060A0005F48C0F80052C0F808735E490D60091DD2 +:1060B0000D605C4A04210C321160066124F4807486 +:1060C000A00409D558484660C0F80052C0F80873CB +:1060D0005648056024F40054C4F38030C4F3C03142 +:1060E000884200D0FFDF14F4404F14D0504846607F +:1060F000C0F808734F488660C0F80052C0F80873B3 +:106100004D490D600A1D16608660C0F808730D6069 +:10611000166024F4404420050AD54848466086604D +:10612000C0F80873C0F848734548056024F400645B +:106130000EF076FD4348044200D0FFDFBDE8F08159 +:10614000F0B50022202501234FEA020420FA02F1D3 +:10615000C9072DD051B2002910DB00BF4FEA5117FB +:106160004FEA870701F01F0607F1E02703FA06F65A +:10617000C7F88061BFF34F8FBFF36F8F0CDB00BF99 +:106180004FEA51174FEA870701F01F0607F1E02792 +:1061900003FA06F6C7F8806204DB01F1E02181F81A +:1061A000004405E001F00F0101F1E02181F8144DF8 +:1061B00002F10102AA42C9D3F0BD10B5224C206001 +:1061C0000846F5F78AFE2068FFF742FF2068FFF7D0 +:1061D000B7FF0EF04BF900F088F90EF021FD0EF03C +:1061E0005EFCECF749FEBDE810400EF0F3B910B5C7 +:1061F000154C2068FFF72CFF2068FFF7A1FF0EF079 +:106200000FFDF5F769FF0020206010BD0A207047E0 +:10621000FC1F00403C17004000C0004004E5014066 +:10622000008000400485004000D0004004D50040BC +:1062300000E0004000F0004000F5004000B00040E9 +:1062400008B50040FEFF0FFDA400002070B52649F0 +:106250000A680AB30022154601244B685B1C4B6098 +:106260000C2B00D34D600E7904FA06F30E681E4223 +:106270000FD0EFF3108212F0010272B600D00122AB +:106280000C689C430C6002B962B64968016000204A +:1062900070BD521C0C2AE0D3052070BD4FF0E021E8 +:1062A0004FF48000C1F800027047EFF3108111F045 +:1062B000010F72B64FF0010202FA00F20A480368B9 +:1062C00042EA0302026000D162B6E7E70648002115 +:1062D0000160416070470121814003480068084027 +:1062E00000D0012070470000A80000200120810795 +:1062F000086070470121880741600021C0F8001143 +:1063000018480170704717490120087070474FF016 +:106310008040D0F80001012803D0124800780028FE +:1063200000D00120704710480068C00700D001204D +:1063300070470D480C300068C00700D0012070473E +:106340000948143000687047074910310A68D203C1 +:1063500006D5096801F00301814201D1012070478F +:1063600000207047B0000020080400404FF080502B +:10637000D0F830010A2801D0002070470120704772 +:1063800000B5FFF7F3FF20B14FF08050D0F8340193 +:1063900008B1002000BD012000BD4FF08050D0F8B2 +:1063A0003001062803D0401C01D000207047012096 +:1063B00070474FF08050D0F830010D2801D00020F8 +:1063C0007047012070474FF08050D0F83001082806 +:1063D00001D000207047012070474FF08050D0F866 +:1063E0003001102801D0002070470120704700B50F +:1063F000FFF7F3FF30B9FFF7DCFF18B9FFF7E3FF52 +:10640000002800D0012000BD00B5FFF7C6FF38B15D +:106410004FF08050D0F83401062803D3401C01D03F +:10642000002000BD012000BD00B5FFF7B6FF48B158 +:106430004FF08050D0F83401062803D3401C01D01F +:10644000012000BD002000BD0021017008467047FA +:106450000146002008707047EFF3108101F0010140 +:1064600072B60278012A01D0012200E00022012345 +:10647000037001B962B60AB1002070474FF40050B2 +:106480007047E9E7EFF3108111F0010F72B64FF09A +:106490000002027000D162B600207047F2E70000EF +:1064A0002DE9F04115460E460446002700F0EBF8B2 +:1064B000A84215D3002341200FE000BF94F84220EA +:1064C000A25CF25494F84210491CB1FBF0F200FBBC +:1064D00012115B1C84F84210DBB2AB42EED30127F1 +:1064E00000F0DDF83846BDE8F081724910B5802033 +:1064F00081F800047049002081F8420081F84100D1 +:10650000433181F8420081F84100433181F8420073 +:1065100081F841006948FFF797FF6848401CFFF782 +:1065200093FFECF731FCBDE8104000F0B8B8402014 +:106530007047614800F0A7B80A4601465E48AFE7D9 +:10654000402070475C48433000F09DB80A46014641 +:1065500059484330A4E7402101700020704710B52E +:1065600004465548863000F08EF82070002010BD9B +:106570000A460146504810B58630FFF791FF08B132 +:10658000002010BD42F2070010BD70B50C46064653 +:10659000412900D9FFDF4A480068103840B200F0B6 +:1065A00054F8C5B20D2000F050F8C0B2854201D3B6 +:1065B000012504E0002502E00DB1ECF728FC22469D +:1065C00031463D48FFF76CFF0028F5D070BD2DE93E +:1065D000F0413A4F0025064617F1040757F82540C9 +:1065E000204600F041F810B36D1CEDB2032DF5D339 +:1065F0003148433000F038F8002825D02E4800F00C +:1066000033F8002820D02C48863000F02DF80028E0 +:106610001AD0ECF7D2FB2948FFF71EFFB0F5005F58 +:1066200000D0FFDFBDE8F0412448FFF72BBF94F80E +:1066300041004121265414F8410F401CB0FBF1F2F7 +:1066400001FB12002070D3E74DE7002804DB00F1C6 +:10665000E02090F8000405E000F00F0000F1E020D9 +:1066600090F8140D4009704710F8411F4122491C51 +:10667000B1FBF2F302FB13114078814201D10120FA +:1066800070470020704710F8411F4078814201D3C5 +:10669000081A02E0C0F141000844C0B2704710B5CA +:1066A0000648FFF7D9FE002803D1BDE81040ECF7FB +:1066B0006FBB10BD0DE000E0340B0020B4000020E3 +:1066C00004ED00E070B5154D2878401CC4B2687820 +:1066D000844202D000F0DBFA2C7070BD2DE9F0414D +:1066E0000E4C4FF0E02600BF00F0C6FAECF77CFC41 +:1066F00040BF20BF677820786070D6F80052EAF774 +:1067000049FE854305D1D6F8040210B92078B84275 +:10671000EAD000F0ACFA0020BDE8F081C40000200F +:106720002DE9F04101264FF0E02231034FF000083F +:106730004046C2F88011BFF34F8FBFF36F8F204CDC +:10674000C4F800010C2000F02EF81E4D2868C0434C +:1067500040F30017286840F010002860C4F8046374 +:1067600026607F1C02E000BFECF73EFCD4F800017D +:106770000028F9D01FB9286820F0100028601248BE +:1067800005686660C4F80863C4F800810C2000F056 +:106790000AF82846BDE8F08110B50446FFF7C0FFAF +:1067A0002060002010BD002809DB00F01F0201213D +:1067B00091404009800000F1E020C0F8801270474D +:1067C00000C0004010ED00E008C500402DE9F04792 +:1067D000FF4C0646FF21A06800EB061211702178DD +:1067E000FF2910D04FF0080909EB011109EB06173A +:1067F0004158C05900F0F4F9002807DDA16820785D +:1068000001EB061108702670BDE8F08794F800804F +:1068100045460DE0A06809EB05114158C05900F04C +:10682000DFF9002806DCA068A84600EB0810057810 +:10683000FF2DEFD1A06800EB061100EB08100D70E2 +:106840000670E1E7F0B5E24B0446002001259A68A6 +:106850000C269B780CE000BF05EB0017D75DA74224 +:1068600004D106EB0017D7598F4204D0401CC0B2A8 +:106870008342F1D8FF20F0BD70B5FFF7F8F9D44C92 +:1068800008252278A16805EB0212895800F0A8F9C2 +:10689000012808DD2178A06805EB01114058BDE80A +:1068A0007040FFF7DBB9FFF7ACF8BDE87040ECF7DC +:1068B00017BB2DE9F041C64C2578FFF7D8F9FF2D1D +:1068C0006ED04FF00808A26808EB0516915900F049 +:1068D00087F90228A06801DD80595DE000EB051111 +:1068E00009782170022101EB0511425C5AB1521E58 +:1068F0004254815901F5800121F07F4181512846A0 +:10690000FFF764FF34E00423012203EB051302EBDD +:10691000051250F803C0875CBCF1000F10D0BCF525 +:10692000007F10D9CCF3080250F806C00CEB423CB3 +:106930002CF07F4C40F806C0C3589A1A520A09E05E +:10694000FF2181540AE0825902EB4C3222F07F424F +:106950008251002242542846FFF738FF0C21A068DC +:1069600001EB05114158E06850F827203846904760 +:106970002078FF2814D0FFF77AF92278A16808EB75 +:1069800002124546895800F02BF9012893DD217841 +:10699000A06805EB01114058BDE8F041FFF75EB972 +:1069A000BDE8F081F0B51D4614460E460746FF2BA4 +:1069B00000D3FFDFA00700D0FFDF8548FF210022C2 +:1069C000C0E90247C57006710170427082701046BE +:1069D000012204E002EB0013401CE154C0B2A842C3 +:1069E000F8D3F0BD70B57A4C0646657820798542BB +:1069F00000D3FFDFE06840F825606078401C6070DD +:106A0000284670BD2DE9FF5F1D468B460746FF24D3 +:106A1000FFF72DF9DFF8B891064699F80100B84262 +:106A200000D8FFDF00214FF001084FF00C0A99F861 +:106A30000220D9F808000EE008EB0113C35CFF2B1D +:106A40000ED0BB4205D10AEB011350F803C0DC4560 +:106A50000CD0491CC9B28A42EED8FF2C02D00DE0FE +:106A60000C46F6E799F803108A4203D1FF2004B0E0 +:106A7000BDE8F09F1446521C89F8022008EB04116F +:106A80000AEB0412475440F802B00421029B002292 +:106A9000012B01EB04110CD040F801204FF40078D9 +:106AA00008234FF0020C454513D9E905C90D02D062 +:106AB00002E04550F2E7414606EB413203EB041396 +:106AC00022F07F42C250691A0CEB0412490A815429 +:106AD0000BE005B9012506EB453103EB041321F06A +:106AE0007F41C1500CEB0411425499F800502046EC +:106AF000FFF76CFE99F80000A84201D0FFF7BCFE3A +:106B00003846B4E770B50C460546FFF7B0F80646C0 +:106B100021462846FFF796FE0446FF281AD02C4D42 +:106B2000082101EB0411A8684158304600F058F8DC +:106B300000F58050C11700EBD14040130221AA6834 +:106B400001EB0411515C09B100EB4120002800DC8D +:106B5000012070BD002070BD2DE9F04788468146B8 +:106B6000FFF770FE0746FF281BD0194D2E78A86846 +:106B70003146344605E0BC4206D0264600EB0612FC +:106B80001478FF2CF7D10CE0FF2C0AD0A6420CD1D0 +:106B900000EB011000782870FF2804D0FFF76CFE8E +:106BA00003E0002030E6FFF75FF841464846FFF774 +:106BB000A9FF0123A968024603EB0413FF20C85470 +:106BC000A878401EB84200D1A87001EB041001E083 +:106BD000000C002001EB061100780870104613E647 +:106BE000081A0002C11700EB116000127047000084 +:106BF00010B5202000F07FF8202000F08DF84D49DE +:106C0000202081F80004EAF7C3FB4B4908604B4899 +:106C1000D0F8041341F00101C0F80413D0F80413B4 +:106C200041F08071C0F80413424901201C39C1F8B9 +:106C3000000110BD10B5202000F05DF83E48002195 +:106C4000C8380160001D01603D4A481E10603B4A83 +:106C5000C2F80803384B1960C2F80001C2F860019D +:106C600038490860BDE81040202000F055B834498C +:106C70003548091F0860704731493348086070473C +:106C80002D48C8380160001D521E026070472C4913 +:106C900001200860BFF34F8F70472DE9F04128496C +:106CA000D0F8188028480860244CD4F8000100254A +:106CB000244E6F1E28B14046EAF7C4FA40B90021BD +:106CC00011E0D4F8600198B14046EAF7BBFA48B148 +:106CD000C4F80051C4F860513760BDE8F04120208D +:106CE00000F01AB831684046BDE8F0410FF0DAB85C +:106CF000FFDFBDE8F08100280DDB00F01F0201215D +:106D000091404009800000F1E020C0F88011BFF3FD +:106D10004F8FBFF36F8F7047002809DB00F01F0211 +:106D2000012191404009800000F1E020C0F880126C +:106D30007047000020E000E0C8060240000002406A +:106D40001805024000040240010000015E480021D5 +:106D50000170417010218170704770B5054616466C +:106D60000C460220EBF7B2FD574901200870574945 +:106D7000F01E086056480560001F046070BD10B525 +:106D80000220EBF7A3FD5049012008705148002173 +:106D9000C0F80011C0F80411C0F808114E494FF4B2 +:106DA0000000086010BD48480178D9B14B4A4FF443 +:106DB000000111604749D1F800310022002B1CBFAF +:106DC000D1F80431002B02D0D1F8081119B142706A +:106DD0004FF0100104E04FF0010141704049096893 +:106DE000817002704FF00000EBF770BD10B502200B +:106DF000EBF76CFD34480122002102703548C0F8E1 +:106E00000011C0F80411C0F80811026010BD2E482E +:106E10000178002904BF407870472E48D0F800114F +:106E2000002904BF02207047D0F8001100291CBFC0 +:106E3000D0F80411002905D0D0F80801002804BFBB +:106E400001207047002070471F4800B50278214B91 +:106E50004078C821491EC9B282B1D3F800C1BCF143 +:106E6000000F10D0D3F8000100281CBFD3F8040194 +:106E700000280BD0D3F8080150B107E0022802D057 +:106E8000012805D002E00029E4D1FFDF002000BD89 +:106E9000012000BD0C480178002904BF80787047AC +:106EA0000C48D0F8001100291CBFD0F804110029AB +:106EB00002D0D0F8080110B14FF010007047084818 +:106EC0000068C0B270470000C600002010F5004006 +:106ED00008F5004000F0004004F5014008F50140CD +:106EE00000F400405748002101704170704770B5B0 +:106EF000064614460D460120EBF7E8FC52480660B2 +:106F0000001D0460001D056050490020C1F85001BB +:106F10004F490320086050494E480860091D4F48FA +:106F2000086070BD2DE9F041054646480C46012633 +:106F300006704B4945EA024040F080700860FFF758 +:106F40002CFA002804BF474804600027464CC4F8C8 +:106F50000471474945480860002D02BFC4F800622B +:106F60002660BDE8F081012D18BFFFDFC4F8007274 +:106F7000266041493F480860BDE8F081314801780A +:106F800071B13B4A394911603749D1F804210021D8 +:106F9000002A08BF417002D0384A1268427001705E +:106FA0000020EBF793BC27480178002904BF407804 +:106FB00070472D48D0F80401002808BF70472F48BB +:106FC0000068C0B27047002808BF70472DE9F0473D +:106FD0001C480078002808BFFFDF234CD4F80401C8 +:106FE000002818BFBDE8F0874FF00209C4F80493E9 +:106FF000234F3868C0F30018386840F0100038603C +:10700000D4F80401002804BF4FF400454FF0E026F7 +:1070100008D100BFC6F88052EBF7E6FFD4F80401B0 +:107020000028F7D0B8F1000F03D1386820F0100025 +:107030003860C4F80893BDE8F0870B4901208860E8 +:1070400070470000C900002008F500400010004013 +:107050001CF500405011004098F501400CF0004034 +:1070600004F5004018F5004000F000400000020365 +:1070700008F501400000020204F5014000F4004060 +:1070800010ED00E0012804BF41F6A470704702280B +:1070900004BF41F288307047042804BF46F218004C +:1070A0007047082804BF47F2A030704700B5FFDFE3 +:1070B00041F6A47000BD10B5FC48002401214470C5 +:1070C000047044728472C17280F82540C462846383 +:1070D00080F83C4080F83D40FF2180F83E105F2161 +:1070E00080F83F1018300EF0D9FFF149601E08609B +:1070F000091D0860091D0C60091D0860091D0C6050 +:10710000091D0860091D0860091D0860091D086047 +:10711000091D0860091D0860091D0860091D086037 +:10712000091D086010BDE348016801F00F01032943 +:1071300004BF01207047016801F00F01042904BF5A +:1071400002207047016801F00F01052904D0006892 +:1071500000F00F00062807D1D748006810F0060F8E +:107160000CBF08200420704700B5FFDF012000BDE0 +:10717000012812BF022800207047042812BF0828E7 +:107180004FF4C870704700B5FFDF002000BD012834 +:1071900004BF28207047022804BF18207047042825 +:1071A00012BF08284FF4A870704700B5FFDF2820F1 +:1071B00000BD70B5BF48016801F00F01032908BF89 +:1071C000012414D0016801F00F01042904BF022436 +:1071D00018210DD0016801F00F0105294BD000687E +:1071E00000F00F0006281CBFFFDF012443D0282138 +:1071F000AE48C26A806A101A0E18082C04BF4EF6F8 +:10720000981547F2A0302DD02046042C08BF4EF62A +:1072100028350BD0012808BF41F6A47506D0022CF2 +:107220001ABFFFDF41F6A47541F28835012C08BF73 +:1072300041F6A47016D0022C08BF002005D0042C03 +:107240001ABFFFDF00204FF4C8702D1A022C08BFB0 +:1072500041F2883006D0042C1ABFFFDF41F6A4703B +:1072600046F21800281A4FF47A7100F2E730B0FBAA +:10727000F1F0304470BD9048006810F0060F0CBF6C +:10728000082404244FF4A871B2E710B58B490268B2 +:1072900001F118040A6342684A63007A81F83800F1 +:1072A000207E48B1207FF7F72EF9A07E011C18BF81 +:1072B0000121207FF7F716F9607E002808BF10BD76 +:1072C000607FF7F720F9E07E011C18BF0121607F85 +:1072D000BDE81040F7F706B930B50024054601298E +:1072E0000AD0022908BF4FF0807405D0042916BFC8 +:1072F00008294FF0C744FFDF44F4847040F4801045 +:107300006F49086045F4403001F1040140F000701D +:10731000086030BD30B50024054601290AD0022995 +:1073200008BF4FF0807405D0042916BF08294FF01C +:10733000C744FFDF44F4847040F480106049086063 +:1073400045F4403001F1040140F0007008605D48F0 +:10735000D0F80001002818BFFFDF30BD2DE9F04153 +:1073600002274FF0E02801250024C8F88071BFF300 +:107370004F8FBFF36F8F544804600560FFF754F8D8 +:10738000524E18B1306840F480603060FFF705F865 +:1073900038B1306820F0770040F0880040F00040BD +:1073A00030604C494A4808604FF01020806CB0F1C2 +:1073B000FF3F04D048490A6860F317420A60474912 +:1073C00040F25B600860091F40F203100860081F6C +:1073D000056038490320086041480560424A414938 +:1073E0001160434A41491160121F4249116001680E +:1073F00021F440710160016841F480710160C8F8B6 +:10740000807230491020C1F80403284880F83140C8 +:10741000C462BDE8F081294A0368C2F81A30808846 +:10742000D08302F1180001727047204B10B51A7A10 +:107430008A4208D101460622981CF6F7C9FF0028A7 +:1074400004BF012010BD002010BD184890F8250091 +:107450007047164A517010707047F0B505468000AD +:1074600000F1804000F580508B88C0F820360B7802 +:10747000D1F8011043EA0121C0F8001605F1080017 +:10748000012707FA00F61C4C002A04BF2068B0430D +:1074900004D0012A18BFFFDF206830432060206835 +:1074A00007FA05F108432060F0BD0000280C002019 +:1074B000000E00401015004014140040100C002075 +:1074C0001415004000100040FC1F00403C17004015 +:1074D0002C000089781700408C15004038150040BA +:1074E0005016004000000E0408F5014040800040A6 +:1074F000A4F5014010110040401600400DF0E0BC22 +:10750000F94890F832007047F84AC1781160006875 +:10751000F749000208607047252808BF02210ED0F5 +:10752000262808BF1A210AD0272808BF502106D0D4 +:107530000A2894BF0422062202EB4001C9B2ED4A98 +:107540001160ED49086070472DE9F047E64CA17ADB +:10755000012956D0022918BFBDE8F087627E002AB3 +:1075600008BFBDE8F087012950D0E17E667F0D1C81 +:1075700018BF01255FF02401DFF880934FF0010868 +:10758000C9F84C80DFF878A34718DAF80000B84251 +:1075900028BFFFDF0020C9F84C01CAF80070300294 +:1075A00085F0010140EA015040F0031194F82000F9 +:1075B000820002F1804202F5C042C2F81015D149A2 +:1075C00001EB8001A07FC20002F1804202F5F83297 +:1075D000C2F81415CC4BC2F81035E27FD30003F18A +:1075E000804303F5F833C3F81415C849C3F81015E0 +:1075F00008FA00F008FA02F10843C5490860BDE83E +:10760000F087227E002AAED1BDE8F087A17E267FDA +:10761000002914BF012500251121ADE72DE9F04116 +:10762000BC4E804603200D46C6F80002B849BA4851 +:10763000086028460DF083FCAB4F0124B8F1000F21 +:1076400004BFBC72346026D0B8F1010F23D1B34817 +:10765000006860B915F00C0F09D0C6F8044301208A +:1076600000F0B0FEF463346487F83C4002E0002090 +:1076700000F0A8FE28460DF04AFD0220B872FEF781 +:10768000C3FE38B9FEF7D0FE20B9A548016841F421 +:10769000C021016074609948C46499480068294613 +:1076A000BDE8F04150E72DE9F0479A4E81460320AE +:1076B0000D46C6F80002DFF858829748C8F8000067 +:1076C00008460DF03CFC28460DF021FD0124864FB4 +:1076D000B9F1000F03D0B9F1010F0AD026E0BC7256 +:1076E000B86B40F48010B8634FF48010C8F8000005 +:1076F0001CE00220B872B86B40F40010B8634FF47D +:107700000010C8F800008548006860B915F00C0F3B +:1077100009D0C6F80443012000F054FEF463346439 +:1077200087F83C4002E0002000F04CFEEBF7ACFA9A +:107730002946BDE8F04707E72DE9F84F754C82462A +:10774000032088461746C4F80002DFF8C491724847 +:10775000C9F8000010460DF0F2FBDFF8C8B1624E28 +:107760000125BAF1000F04BFCBF80040B57204D078 +:10777000BAF1010F18BFFFDF2FD06B48C0F80080AF +:107780006B496A480860B06B40F40020B063D4F8DD +:1077900000321021C4F808130020C4F80002DFF8FA +:1077A00094C18A03CCF80020C4F80001C4F80C018D +:1077B000C4F81001C4F80401C4F81401C4F8180195 +:1077C0005D4800680090C4F80032C9F80020C4F891 +:1077D0000413BAF1010F09D01BE038460DF097FCF5 +:1077E0005648CBF800000220B072C6E74B4800684C +:1077F00060B917F00C0F09D0C4F80453012000F051 +:10780000E1FDE563256486F83C5002E0002000F0CD +:10781000D9FD4FF40020C9F800003848C564384845 +:107820000068404528BFFFDF39464046BDE8F84FB5 +:107830008AE62DE9F0412C4C0646002594F83100EB +:1078400017468846002808BFFFDF16B1012E16D064 +:1078500021E094F83100012808D094F8302039460E +:1078600040460DF081FBE16A451814E094F83010B1 +:107870003A4640460DF0B6FBE16A45180BE094F835 +:10788000310094F8301001283A46404609D00DF0F6 +:10789000D1FBE16A45183A4629463046BDE8F04139 +:1078A0004AE70DF081FBE16A4518F4E72DE9F84F4E +:1078B000184CD4F8000220F00309D4F804034FF068 +:1078C000100AC0F30018C4F808A30026C4F8006228 +:1078D00018481B490160044D0127A97A012931D0BC +:1078E000022932D044E00000280C0020241500407A +:1078F0001C15004008150040541500400080004051 +:107900004C850040006000404C8100401011004058 +:1079100004F50140001000400000040488170040F6 +:1079200068150040ACF501404885004048810040A2 +:10793000A8F5014008F5014018110040041000406E +:1079400000000E04297E11B912E0697E81B1A97F81 +:10795000EA7F07FA01F107FA02F21143016095F894 +:107960002000800000F1804000F5C040C0F81065A4 +:10797000FF208DF80000C4F81061276105E000BF0A +:107980009DF80000401E8DF800009DF8000018B121 +:10799000D4F810010028F3D09DF80000002808BF9B +:1079A000FFDFC4F81061002000F00CFD6E72AE72B3 +:1079B000EF72C4F80092B8F1000F18BFC4F804A326 +:1079C000BDE8F88FFF2008B58DF80000FE480021C3 +:1079D000C0F810110121016105E000BF9DF8001001 +:1079E000491E8DF800109DF8001019B1D0F8101143 +:1079F0000029F3D09DF80000002808BFFFDF08BD74 +:107A00000068F24920F07F40086070474FF0E020A6 +:107A10000221C0F8801100F5C070BFF34F8FBFF393 +:107A20006F8FC0F80011704710B490E81C10E8493F +:107A300081E81C10D0E90420C1E9042010BC704783 +:107A40004FF0E0210220C1F800017047E1490870C1 +:107A50007047E1490860704770B50546EBF714F9C7 +:107A6000DE4C2844E16A884298BFFFDF0120207481 +:107A7000EBF70AF9DA4A284400216061C2F84411A0 +:107A8000D8490860A06BD84940F48000A063D001B9 +:107A9000086070BD70B5D14C0546D44A02202074F0 +:107AA00010680E4600F00F00032808BF012213D013 +:107AB000106800F00F00042808BF02220CD01068E4 +:107AC00000F00F0005281BD0106800F00F000628FA +:107AD0001CBFFFDF012213D094F8310094F830105E +:107AE000012815D028460DF0ECFABD496061002050 +:107AF000C1F844016169E06A0844BA49086070BD90 +:107B0000BB48006810F0060F0CBF08220422E3E710 +:107B1000334628460DF0A3FAE7E7B6494FF4800054 +:107B20000860AE48816B21F48001816300210174FB +:107B30007047C20002F1804202F5F832AE4BC2F843 +:107B40001035C2F8141501218140A7480160A348EF +:107B5000826B114381637047A14801214160C1607C +:107B60000021C0F844119F4801609C48C1627047E1 +:107B7000A24908609448D0F8001241F04001C0F8D2 +:107B8000001270479048D0F8001221F04001C0F870 +:107B900000129A490020086070478B48D0F8001204 +:107BA00021F01001C0F800120121816170478B495A +:107BB000FF2081F83E0084480021C0F81C11D0F855 +:107BC000001241F01001C0F8001270477E4981B0E8 +:107BD000D1F81C21012A0DD0804991F83E10FF29CF +:107BE0000DBF00204942017001B008BF704701205D +:107BF00001B07047824A126802F07F02524202705E +:107C00000020C1F81C017F4800680090EFE7F0B544 +:107C100017460C00064608BFFFDF704D14F0010F39 +:107C20002F731CBF012CFFDF002E0CBF0120022090 +:107C30006872EC7201281CBF0228FFDFF0BD6749A3 +:107C400081F83F0070472DE9F84F6248007804281A +:107C500028BFFFDF614CDFF89C815B4D94F83C004E +:107C600000260127E0B1D5F8040110F1000918BF82 +:107C70004FF00109D5F81001002818BF012050EA83 +:107C800009014FF4002B17D08021C5F80813C8F85C +:107C900000B084F83C6090F0010F18BFBDE8F88F89 +:107CA000DFF83C91D9F84C0100287DD0A07A01285A +:107CB0007BD002287AD0D8E0D5F80001DFF840A1C7 +:107CC00030B3C5F800616F61FF20009002E0401EF4 +:107CD000009005D0D5F81C0100280098F7D000B915 +:107CE000FFDFDAF8000000F07F0A94F83F0050450B +:107CF0003CBF002000F066FB84F83EA0C5F81C6184 +:107D0000C5F808733F48006800902F64AF6302E035 +:107D1000B9F1000F03D0B9F1000F2BD087E0DAF8EA +:107D2000000000F07F0184F83E10C5F81C6194F853 +:107D30003D0048B194F83F00884218D2002000F07E +:107D400041FB2F64AF6312E02F48006894F83F3086 +:107D500082B2000C994203D30F2A06D9022804D21A +:107D6000012000F02FFB2F6401E02F64AF63254852 +:107D7000006800908022C5F80423194887642349CD +:107D80000B68A1F1040CDCF800C043F698273B44D3 +:107D9000634543D20A6842F210731A440A60C0F87D +:107DA00048611B481B4902E05FE047E049E008608A +:107DB000091F194808600C48C0F800B0A06B40F4D7 +:107DC0000020A063BDE8F88F001000403C15004083 +:107DD000100C0020CB00002004150040280C0020CF +:107DE000008000404485004004F50140101500402B +:107DF0001414004008F501400411004060150040D3 +:107E0000481500401C110040741500404885004092 +:107E100014100040ACF50140488100400E60C0F8ED +:107E20004861C5F80823C8F800B0C0F84861802050 +:107E3000C5F80803C8F800B0BDE8F88F207E10B977 +:107E400013E0607E88B1A07FE17F07FA00F007FAB7 +:107E500001F10843C8F8000094F82000800000F108 +:107E6000804000F5C040C0F81065F748A16B016084 +:107E7000A663217C002019B1D9F84411012900D052 +:107E80000021A27A012A6DD0022A73D0D5F81011F0 +:107E900001290CBF1021002141EA0008EB480168CC +:107EA00011F0FF0F03D0D5F81411012900D00021E3 +:107EB00084F83210006810F0FF0F03D0D5F81801D5 +:107EC000012800D0002084F83300E148006884F8DD +:107ED0003400FEF79CFF012818BF002084F835000D +:107EE000C5F80061C5F80C61C5F81061C5F80461FA +:107EF000C5F81461C5F81861D64800680090D648E6 +:107F0000C0F84461D5480068DFF854930090D9F870 +:107F10000000A062A9F104000068E062D148016895 +:107F200001F00F01032908BF012013D0016801F0FF +:107F30000F01042908BF02200CD0016801F00F01D5 +:107F4000052926D0006800F00F0006281CBFFFDFBF +:107F500001201ED084F83000A07A84F83100022875 +:107F60002CD11EE0D5F80C01012814BF00200820F8 +:107F70008CE7FFE7D5F80C01012814BF0020022090 +:107F8000B94A1268012A14BF042200221043084390 +:107F90007CE7B648006810F0060F0CBF08200420EC +:107FA000D8E7607850B1B24909680978084021786B +:107FB00031EA000008BF84F8247001D084F82460FE +:107FC000DFF8B0A218F0020F06D0EAF75DFEA16A52 +:107FD000081ADAF81010884718F0010F18BF4FF090 +:107FE000000B0DD0EAF750FEE16ADAF81420081A07 +:107FF00059469047A048007810F0010F2FD10CE0AF +:1080000018F0020F18BF4FF0010BEBD118F0080F5A +:1080100018BF4FF0020BE5D1ECE7DFF854B2DBF804 +:108020000000007800F00F00072828BF84F82560C2 +:1080300015D2DBF80000062200F10901A01CF6F7BA +:10804000C7F940B9207ADBF800100978B0EBD11FEE +:1080500008BF012001D04FF0000084F82500E17A2C +:108060004FF0000011F0020F1CBF18F0020F18F0C3 +:10807000040F19D111F0100F1CBF94F83320002AFF +:1080800002D094F835207AB111F0080F1CBF94F893 +:108090002420002A08D111F0040F02D094F82510F2 +:1080A00011B118F0010F01D04FF00100617A19B140 +:1080B00068B1FFF7FBFB10E0634870490160D5F839 +:1080C000000220F00300C5F80002E77205E0012974 +:1080D0000AD0022918BFFFDF0DD018F0010F14D00D +:1080E000DAF80000804745E06672E772A7729621D1 +:1080F000227B002006E06672E7720220A072227BDB +:1081000096210120FFF795FBE7E718F0020F2AD030 +:1081100018F0040F21D1FEF777F9F0B9FEF784F9D2 +:10812000D8B957480168001F0068C0F3006CC0F35D +:10813000425500F00F03C0F30312C0F30320BCF15B +:10814000000F0AD0002B1CBF002A002805D10029EF +:1081500018BF032D38BF48F0040827EA9800DAF862 +:108160000410884706E018F0080F18BFDAF8080076 +:1081700024D08047A07A022818BFBDE8F88F207C61 +:10818000002808BFBDE8F88F3349C1F844610228D0 +:108190001CD0012818BFFFDFE16A6069884298BFE0 +:1081A000FFDF6069C9F80000A06B4FF4800140F464 +:1081B0008000A06333480160BDE8F88F18F0100F0D +:1081C00014BFDAF80C00FFDFD3D1D3E76169E06AAE +:1081D0000844E7E738B52C4904460220887201219B +:1081E0002046FFF7B1F91E4A04F13D0010601A4B1A +:1081F0000020C3F844012549C1F80001C1F80C0171 +:10820000C1F81001C1F80401C1F81401C1F8180146 +:1082100010480068009001209864101D00681168E3 +:10822000884228BFFFDF38BD2DE9F843164A88464B +:108230000024917A0125044F012902D0022927D078 +:1082400039E0117E31BB36E008F5014040160040B0 +:10825000101400401811004000800040448100408C +:1082600044850040101500400014004014140040E4 +:1082700004150040100C0020CB0000200000040476 +:108280005414004004F50140280C00200010004068 +:10829000517E81B1917FD37F05FA01F105FA03F395 +:1082A0001943396092F82010890001F1804101F5ED +:1082B000C041C1F8104506460220907201213046A7 +:1082C000FFF742F9504906F13D0008604F4AC2F8F5 +:1082D00044414F48C0F80041C0F80C41C0F810417B +:1082E000C0F80441C0F81441C0F81841494800687A +:1082F00000909564081D00680968884228BFFFDF68 +:10830000B8F1000F1CBF4FF400303860BDE8F883AF +:10831000022810B50DD0012804BF42F6CE3010BDA2 +:10832000042817BF082843F6A440FFDF41F66A007F +:1083300010BDFEF725F830B9FEF72FF8002808BF6A +:1083400041F6583001D041F2643041F29A010844BC +:1083500010BD2F4910B50020C1F800022F492E484A +:10836000086030492E480860091D2F480860091D23 +:108370002E480860091D2E480860091D2D48086018 +:10838000091D2D48086001200CF0D9FD2B494FF440 +:108390003810086010BD21494FF43810086070474C +:1083A0002748016803291BBF00680228012000201C +:1083B0007047234801680B291BBF00680A28012069 +:1083C000002070471F490968C9B91F4A1F4913682F +:1083D00070B123F0820343F07D0343F00043136048 +:1083E0000A6822F0100242F0600242F0004205E00A +:1083F00023F0004313600A6822F000420A60144927 +:1084000081F83D0070470000448500400080004036 +:1084100000100040181100400000040408F501405D +:108420001011004098F501400410004044810040C4 +:10843000141000401C1100401010004004F50140D1 +:1084400050150040881700403C1700407C17004042 +:10845000280C002010B5404822220021F6F70FF822 +:108460003D480024017821F010010170012105F040 +:108470003DFF3A494FF6FF7081F822408884384921 +:108480000880488010BD704734498A8C824218BFEA +:108490007047002081F822004FF6FF7088847047F3 +:1084A0002D49016070472E49088070472B498A8CFE +:1084B000A2F57F43FF3B03D00021016008467047CF +:1084C00091F822202549012A1ABF016001200020CD +:1084D0007047224901F1220091F82220012A04BFAD +:1084E00000207047012202701D48008888841046D1 +:1084F00070471B49488070471849194B8A8C5B8824 +:108500009A4206D191F82220002A1EBF0160012064 +:108510007047002070471148114A818C528891425F +:1085200009D14FF6FF71818410F8221F19B1002183 +:10853000017001207047002070470848084A818C6C +:108540005288914205D190F8220000281CBF0020DB +:1085500070470120704700008E0C0020680C00203E +:10856000CC0000207047584A012340B1012818BFB1 +:1085700070471370086890608888908170475370C6 +:108580000868C2F802008888D08070474E4A10B14F +:10859000012807D00EE0507860B1D2F802000860E0 +:1085A000D08804E0107828B19068086090898880AD +:1085B0000120704700207047434910B1012803D0C3 +:1085C00006E0487810B903E0087808B10120704748 +:1085D0000020704730B58DB00C4605460D220021B5 +:1085E00004A8F5F74CFFE0788DF81F0020798DF88E +:1085F0001E0060798DF81D00286800906868019061 +:10860000A8680290E868039068460BF0CDFF2078D8 +:108610009DF82F1088420CD160789DF82E1088426A +:1086200007D1A0789DF82D10884202BF01200DB01F +:1086300030BD00200DB030BD30B50C4605468DB0C4 +:108640004FF0030104F1030012B1FDF77FFF01E0D9 +:10865000FDF79BFF60790D2220F0C00040F0400044 +:108660006071002104A8F5F70AFFE0788DF81F007B +:1086700020798DF81E0060798DF81D002868009023 +:1086800068680190A8680290E868039068460BF05B +:108690008BFF9DF82F0020709DF82E0060709DF8D4 +:1086A0002D00A0700DB030BD10B5002904464FF06C +:1086B000060102D0FDF74AFF01E0FDF766FF607991 +:1086C00020F0C000607110BDD0000020FE4840685E +:1086D00070472DE9F0410F46064601461446012039 +:1086E00006F0B7F8054696F86500FEF7CBFC4AF2AF +:1086F000B12108444FF47A71B0FBF1F0718840F277 +:1087000071225143C0EB4100001BA0F2663402F01D +:10871000A9FF002818BF1E3CAF4234BF2846384688 +:10872000A04203D2AF422CBF3C462C467462BDE847 +:10873000F0812DE9FF4F93B0044690F8650088461C +:108740000F90DDE9151008431190E04800270578E7 +:108750000C2D28BFFFDFDE4E36F8159094F88C51B3 +:108760000C2D28BFFFDFDA4830F81500484480B2EE +:10877000009094F87D000D280CBF012000200A9085 +:108780001598002804BF94F82C0103282BD10A98CF +:1087900048B3B4F8AE01404525D1D4F83401C4F84B +:1087A0002001608840F2E2414843C4F82401B4F853 +:1087B0007A01B4F806110844C4F82801204602F0F2 +:1087C0005BFFB4F8B201E08294F8B0016075B4F8D0 +:1087D000B4016080B4F8B601A080B4F8B801E080BC +:1087E000022084F82C01D4F884010E90D4F8800182 +:1087F0000D90B4F80661B4F87801D4F874110591BD +:10880000159921B194F8401151B100F0D6B804F592 +:108810008071069174310B9104F5B075091D07E064 +:1088200004F5AA710691091D0B9104F5A275091DA5 +:108830000C91B4F87010A8EB0000A8EB01010FFA3E +:1088400080F90FFA81FBB9F1000F05DAD4F8700155 +:1088500005900120D94611909C484FF0000A0079FC +:10886000A8B3F3F75FFB90B3B4F8180102282ED336 +:1088700094F82C0102282AD094F8430138BB94F8CC +:108880008C0100900C2828BFFFDF9148009930F838 +:10889000110000F5C86080B2009094F82C01012806 +:1088A0007ED0608840F2E2414843009901F01BF914 +:1088B000D4F8342180B206EB0B01A1EB0901821A36 +:1088C00001FB02AAC4F83401012084F8430194F8A2 +:1088D0002C01002865D0012800F00B82022800F04E +:1088E0006A81032818BFFFDF00F03D82A7EB0A0171 +:1088F0000598FCF782F90B99012640F27122086075 +:108900000C98A0F80080002028702E710B98006849 +:10891000A8606188D4F834015143C0EB41006B4931 +:10892000A0F23630C8618969814287BF0699086024 +:10893000069801600698616A0068084400F5D370E3 +:10894000E86002F08FFE10B1E8681E30E8606E71DA +:10895000B4F8F000A0EB080000B20028C4BF032068 +:1089600068710A980028169800F05F82E0B100BF95 +:10897000B4F8181100290CBF0020B4F81A01A4F8AB +:108980001A0194F81C21401C504388420CD268798B +:10899000401E002808DD6E71B4F81A01401C01E089 +:1089A0000FE05AE0A4F81A011598002800F0608240 +:1089B00094F84001002800F0578217B00220BDE86B +:1089C000F08F94F8800003283DD03F4894F865105C +:1089D00090F8300005F001FAE28A40F2712151432B +:1089E00000EB4100CDF81000D4F82401009901F00B +:1089F0007AF8D4F82021D4F82811821A01FB02AAAF +:108A0000C4F820010099049801F06DF8D4F83011F1 +:108A1000C4F83001411A8A44608840F2E241484378 +:108A2000009901F060F806EB0B01D4F82821A1EBC6 +:108A30000901891AD4F83421C4F83401821A491E74 +:108A400001FB02AA40E7E18A40F27122D4F8240136 +:108A5000514300EB41000490C6E70D98002808BF81 +:108A6000FFDF94F86510184890F8300005F0B5F96C +:108A70000890E08A40F271214143089800EB4100E0 +:108A8000009901F030F8C4F83001608840F2E2410A +:108A90004843009901F027F8C4F8340186B2214612 +:108AA0000120D4F8289005F0D4FE074694F865001C +:108AB000FEF7E8FA4AF2B12108444FF47A7BB0FBA2 +:108AC000FBF0618806E00000B00C0020E000002010 +:108AD000D463020040F271225143C0EB4100801B7D +:108AE000A0F2663602F0BEFD002818BF1E3EB94552 +:108AF00034BF38464846B04203D2B9452CBF4E4633 +:108B00003E46666294F86500FEF732FB00F2E140F3 +:108B1000B0FBFBF10D980F1894F86500FEF728FBE9 +:108B2000064694F86500FEF7ADFA30444AF2AB31E0 +:108B30000844B0FBFBF1E08A40F2712242430898FE +:108B4000D4F8306100EB4200401A801B3844A0F199 +:108B50002007607D40F2E24110FB01F994F86500C6 +:108B6000009010F00C0F0ABF00984EF62830FEF768 +:108B700089FA4AF2B1210844B0FBFBF000EB460051 +:108B800000EB09060098FEF702FB304400F1620199 +:108B9000FB48816194F86500FEF7EAFA00F2E140D3 +:108BA000B0FBFBF10D980844381A40F2F6218842D8 +:108BB00038BFFFDF9AE6E18A40F27122D4F824013F +:108BC000514300EB4100009900F08DFFC4F83001E3 +:108BD000618840F2E2404843009900F084FFC4F805 +:108BE000340187B221460120D4F828B005F031FEC7 +:108BF000814694F86500FEF745FA4AF2B121014436 +:108C00004FF47A70B1FBF0F0618840F27122514369 +:108C1000C0EB4100C01BA0F2663702F023FD002824 +:108C200018BF1E3FCB4534BF48465846B84203D212 +:108C3000CB452CBF5F464F46676216BB169800B304 +:108C400094F865603046FEF71DFA4AF2B1210144FE +:108C50004FF47A70B1FBF0F0D4F8301140F2712388 +:108C60000844E18AD4F82421594302EB41010F1A48 +:108C70003046FEF78CFA0E99081A3844A0F1200706 +:108C80000AE0E18A40F27122D4F82401514300EB5A +:108C90004100D4F83011471AD4F82821D4F8201113 +:108CA000D4F8300101FB020B607D40F2E24110FB81 +:108CB00001F994F8656016F00C0F0ABF30464EF6C5 +:108CC0002830FEF7DFF94AF2B12101444FF47A70FF +:108CD000B1FBF0F000EB4B0081443046FEF757FA51 +:108CE000484400F16001A6488161012084F82C010C +:108CF000FCE5608840F271225043D4F83411D4F876 +:108D00002821C1EB400000FB09F706EB0B00801A9D +:108D1000D4F820C1D4F83031401E0CFB023200FBE5 +:108D2000012B607D40F2E24110FB01F994F865608F +:108D300016F00C0F0ABF30464EF62830FEF7A2F9A7 +:108D40004AF2B12101444FF47A70B1FBF0F000EB2C +:108D50004B0081443046FEF71AFA484400F16001A6 +:108D600087488161C2E5618840F27122D4F83401FC +:108D70005143C0EB410000FB09F794F87C00242824 +:108D80001CBF94F87D0024280BD1B4F8AE01A8EBE9 +:108D9000000000B2002804DB94F8B101002818BFDD +:108DA0000F90119800B3FEB90E9800281ABF0D98C5 +:108DB0000028FFDF94F8650010F00C0F14BF4EF68A +:108DC0002830FEF75FF94AF2B12101444FF47A707E +:108DD000B1FBF0F03F1A94F86500FEF7D8F90E9950 +:108DE000081A3844A0F12007D4F8341106EB0B0020 +:108DF00000FB01F60F9810F00C0F0ABF0F984EF60B +:108E00002830FEF73FF94AF2B12101444FF47A705D +:108E1000B1FBF0F000EB46060F98FEF7B8F93044CE +:108E200000F160015648816160E500287FF4A0AD43 +:108E300094F82C0100283FF4B7AD618840F271220C +:108E4000D4F834015143C0EB4101284604F088FDB9 +:108E50000004000C3FF4A8AD2099002918BF088039 +:108E6000012017B0BDE8F08F94F87C01FCF71CFDE1 +:108E700094F87C012946FCF7FDFB20B1159880F0A1 +:108E8000010084F8410117B00020BDE8F08F70B5F3 +:108E90003C4C607A00281CBF002070BD94F8340060 +:108EA00038B1A16B606A884203D9F6F750FE002002 +:108EB00070BDA06AE8B1F5F71FFE0546F5F78CFC1A +:108EC000284442F210714618FCF7B0F905462946CD +:108ED000E06AFCF79AFEE562A16A8219914224BF1A +:108EE000081AA06205D20120A062F6F730FE002029 +:108EF00070BD012070BDF8B5224C0246204F002500 +:108F00006168606A052A4FD2DFE802F00331363E1D +:108F10004500A07A002660B101216846FDF716FBE6 +:108F20009DF8000042F210710002B0FBF1F201FB6B +:108F30001206F5F7E1FD8119A069FBF75EFEA0615D +:108F400025740320607501202075607A38B9207B74 +:108F500004F11001FCF78EFB002808BFFFDF258419 +:108F6000FCF76FF87879BDE8F840E9F7B9BFBDE8DC +:108F7000F840002100F0D4BDC1F88001F8BD000028 +:108F8000E0000020B00C0020D1F88001BDE8F840DE +:108F9000012100F0C5BD84F83450FCF752F878790F +:108FA000BDE8F840E9F79CBFFFDFE7E72DE9F04FA8 +:108FB000DFF80494044683B099F800008B4601273B +:108FC0000025FE4E4FF00208032804BF99F80C005C +:108FD000A0427DD1D9F80400706199F800000328FF +:108FE00018BFFFDF0324BBF1080F72D2DFE80BF0DC +:108FF000040F32322DD2D2C9C9F82450F6F77EF9C7 +:10900000002818BFFFDFB47003B0BDE8F08FF5F79C +:10901000E3FB0446D9F81C00A04228BFC9F81C4055 +:1090200006D2201A0421FCF724FEC9F81C4038B1EE +:10903000F6F7F7FC002818BFFFDF03B0BDE8F08F9C +:1090400003B00020BDE8F04F55E703B0BDE8F04F96 +:10905000FEF7F9BD89F8147089F8105099F83400BA +:109060004FF0010A42F2107B68B14FF47A71D9F8DF +:109070001800FBF7C2FDC9F81800002109F1100023 +:1090800004F06EFC1BE001216846FDF755FA9DF8DF +:1090900000000002B0FBFBF10BFB110AF5F72CFD01 +:1090A00082445146D9F81800FBF7A7FDC9F818000B +:1090B000514609F1100004F053FC00F1010AB9F81F +:1090C0002000411C0A293CBF5044A9F8200001E0BF +:1090D00064E05FE0D9F8040038B1B9F82000401C22 +:1090E0000A2828BF89F8158001D289F8154099F817 +:1090F000090070BB99F8340040B1D9F83810D9F89C +:109100002400884202D9F6F722FD22E0D9F828008F +:1091100058B3F5F7F1FC0446F5F75EFB204400EB8D +:109120000B08FCF783F804462146D9F82C00FCF71D +:109130006CFDC9F82C40D9F8281000EB08029142C8 +:1091400024BF081AC9F828000FD2C9F82870F6F70A +:10915000FEFC99F80C00FCF74AF889F80050707989 +:1091600003B0BDE8F04FE9F7BBBE99F80C0009F178 +:109170001001FCF77FFA002808BFFFDF03B0BDE84D +:10918000F08F99F80C00FCF732F889F8005003B022 +:10919000BDE8F08FFFDF03B0BDE8F08F202C28BFC3 +:1091A000FFDFDFF81C92072139F81400F9F7D6FE2B +:1091B0005FEA000A08BFFFDF202C28BFFFDF39F875 +:1091C0001400BAF80010884218BFFFDF5446C6F8F2 +:1091D00014A04FF0200ABBF1080F80F06881DFE88F +:1091E0000BF00498A2A29BF3F2F1C4F88051F58031 +:1091F000C4F8845194F8410138B9FCF717F8D4F851 +:109200004C11FCF702FD00281DDCB4F83E01B4F857 +:109210007010884208D1B4F8F400401AA4F8F6009F +:109220002046B4F8F41005E0401AA4F8F600B4F8AB +:109230003E112046A4F87010D4F86811C4F84C11FF +:10924000C0F870111DE0B4F83C11B4F87000081AB1 +:10925000A4F8F600B4F83C112046A4F87010D4F835 +:109260004C11C4F86811C4F87011D4F85411C4F842 +:109270000011D4F85811C4F87411B4F85C11A4F8B2 +:10928000781102F0D4F8FBF7ABFF814694F8650043 +:10929000FDF7F8FE4AF2B12108444FF47A71B0FBB1 +:1092A000F1F0D4F8341140F271220844618851433E +:1092B000C0EB4100A0F1300AB9F1B70F98BF4FF0F1 +:1092C000B7092146012005F0C4FA4844AAEB000082 +:1092D000A0F21B39A2462146012005F0BAFADAF8BD +:1092E00024109C30814288BF0D1AC6F80C904D4561 +:1092F00028BF4D46B560D4F86C01A0F5D37030613D +:10930000FCF750FC84F8407186F8028003B0BDE899 +:10931000F08F02F0A2F901E0FEF795FC84F84071AD +:1093200003B0BDE8F08FFBF781FFD4F87021014650 +:109330001046FCF76AFC48B1628840F27123D4F809 +:1093400034115A43C1EB4201B0FBF1F094F87D10A7 +:109350000D290FD0B4F87010B4F83E210B189A42C2 +:10936000AEBF501C401C0844A4F83E0194F84201D2 +:1093700078B905E0B4F83E01401CA4F83E0108E0CD +:10938000B4F83E01B4F8F410884204BF401CA4F8BD +:109390003E01B4F87A010DF1040B401CA4F87A01E7 +:1093A000B4F89A00B4F89810401AB4F87010401E3F +:1093B00008441FFA80F814E0B00C0020E000002000 +:1093C000EC0C002065E059E071E000231A462046CD +:1093D000CDF800B0FFF7ADF948B3012818BFFFDFA3 +:1093E00044D0B4F83E11A8EB010000B20028ECDA3A +:1093F000082084F88D0084F88C70204601F0C8FDA8 +:1094000084F82C5194F87C514FF6FF77202D00D32F +:10941000FFDF29F8157094F87C01FBF7E8FE84F86B +:109420007CA1707903B0BDE8F04FE9F759BDA06E9B +:10943000002804BF03B0BDE8F08FB4F83E01B4F8D3 +:109440009420801A01B20029DCBF03B0BDE8F08F80 +:10945000B4F86C000144491E91FBF0F189B201FBA4 +:109460000020A4F8940003B0BDE8F08FB4F83E01EA +:10947000BDF804100844A4F83E01B2E7FEF7A2FAD2 +:10948000FEF7E1FB4FF0E020C0F8808203B0BDE8BA +:10949000F08F94F82C01042818BFFFDF84F82C51BA +:1094A00094F87C514FF6FF77202DB2D3B0E7FFDF61 +:1094B00003B0BDE8F08F10B5FC4C207850B101200E +:1094C0006072F6F76AFB2078032805D0207A00281E +:1094D00008BF10BD0C2010BD207BFCF7E5F9207BF8 +:1094E000FCF74EFC207BFBF782FE002808BFFFDF65 +:1094F0000020207010BD2DE9F04FEC4F83B038787C +:1095000001244FF0000840B17C720120F6F745FBC2 +:109510003878032818BF387A0DD0DFF8949389F88B +:10952000034069460720F9F7A2FC002818BFFFDFB7 +:109530004FF6FF7440E0387BFCF7B6F9387BFCF758 +:109540001FFC387BFBF753FE002808BFFFDF87F8BE +:109550000080E2E7029800281CBF90F82C11002937 +:109560002AD00088A0421CBFDFF848A34FF0200B90 +:109570003AD00721F9F7F2FC040008BFFFDF94F8A6 +:109580007C01FCF7FDFB84F82C8194F87C514FF6AC +:10959000FF76202D28BFFFDF2AF8156094F87C01A4 +:1095A000FBF725FE84F87CB169460720F9F75FFCDC +:1095B000002818BFFFDF12E06846F9F736FC0028E4 +:1095C000C8D011E0029800281CBF90F82C11002987 +:1095D00005D00088A0F57F41FF39CAD104E0684674 +:1095E000F9F723FC0028EDD089F8038087F8348050 +:1095F00087F80B8003B00020BDE8F08FAC494871BC +:109600000020887001220A7048700A71C870A7494A +:10961000087070E7A649087070472DE9F84FA34C11 +:10962000064688462078002860D1A348FBF784FDD1 +:10963000207320285AD003276660277000256572A2 +:109640002572AEB1012106F58E70FCF79EFF062053 +:10965000F9F72CFC81460720F9F728FC96F81C1135 +:109660004844B1FBF0F200FB1210401C86F81C01CC +:10967000FBF7B6FD40F2F651884238BF40F2F65093 +:1096800000F23F101FFA80F9F5F7A6F8E061F5F750 +:1096900033FA012668B3A672FBF7C8FD82460121A2 +:1096A0006846FCF749FF9DF8000042F21071000285 +:1096B000B0FBF1F201FB120000EB09015046FBF791 +:1096C0009CFAA061C4E90A8A267567752574207B17 +:1096D00004F11001FBF7CEFF002808BFFFDF25844F +:1096E0000020F6F75AFA0020BDE8F88F0C20BDE8FC +:1096F000F88FFBF79BFD4946FBF77FFAA061A57247 +:1097000084F83460A8F28B50A562A063DCE7684956 +:10971000487070476649087170472DE9F041644C04 +:109720000646E088401CE080D4E902516078D6F813 +:10973000807120B13A46284604F03DF90546A068FC +:10974000854205D02169281A08442061FCF72AFACD +:10975000A560AF4209D896F82C01012805D0E07821 +:10976000002804BF0120BDE8F0810020BDE8F081A1 +:1097700010B504460846FDF785FC4AF2B1210844BD +:109780004FF47A71B0FBF1F040F2E241614300F234 +:10979000363081428CBF081A002010BD70B50446D7 +:1097A00082B0002084F8400194F8FE00002807BF32 +:1097B00094F82C01032802B070BDFBF737FDD4F8F4 +:1097C000702101461046FCF720FA0028DCBF02B0E9 +:1097D00070BD628840F27123D4F834115A43C1EB52 +:1097E0004201B0FBF1F0B4F87010401C0844A4F83A +:1097F0003C01B4F8F400B4F83C21801A00B200280F +:10980000DCBF02B070BD012084F84201B4F89A00B8 +:10981000B4F8982001AE801A401E084485B212E0C8 +:109820000096B4F83C11002301222046FEF781FF88 +:10983000002804BF02B070BD01280DD0022812BF5D +:10984000FFDF02B070BDB4F83C01281A00B2002856 +:10985000BCBF02B070BDE3E7B4F83C01BDF8041032 +:109860000844A4F83C01EEE7F8B5042200250629D7 +:1098700064D2DFE801F0072F03191933044680F89A +:109880002C2107E004460A48C078002818BF84F855 +:109890002C2113D0FBF7D5FBA4F87A51B4F8700053 +:1098A000A4F83E0184F84251F8BD0000B00C00203D +:1098B000E0000020EC0C0020AD8F01000095B4F812 +:1098C000F410012300222046FEF733FF002818BFC2 +:1098D000FFDFDFE7032180F82C11E5E70646876A02 +:1098E000B0F83401314685B2012004F0B2FF0446DD +:1098F00096F86500FDF7C6FB4AF2B12108444FF423 +:109900007A71B0FBF1F0718840F271225143C0EBE3 +:109910004100401BA0F2663501F0A4FE002818BFEC +:109920001E3DA74234BF20463846A84228BF2C46D9 +:1099300002D2A74228BF3C467462B5E7FFDFB3E717 +:109940002DE9F05F9E4EB178022906BFF18800290B +:10995000BDE8F09F7469C4F8840194F86500FDF7D0 +:1099600016FCD4F88411081AB1680144B160F1689A +:109970000844F060746994F84301002808BFBDE80A +:10998000F09F94F82C01032818BFBDE8F09F94F8CD +:10999000655037780C2F28BFFFDF8A4E36F81780C6 +:1099A00094F88C710C2F28BFFFDF36F81700404465 +:1099B00094F88C8187B2B8F10C0F28BFFFDF36F81E +:1099C000180000F5C8601FFA80F82846FDF7DFFB95 +:1099D000D4F884114FF0000A0E1A15F00C0F0ABFCC +:1099E00028464EF62830FDF74DFB4FF47A7900F209 +:1099F000E730B0FBF9F0361A2846FDF7C8FBD4F87B +:109A0000001115F00C0FA1EB000B0ABF28464EF613 +:109A10002830FDF737FB4AF2B1210844B0FBF9F0DA +:109A2000ABEB0000A0F160017943B1FBF8F1292212 +:109A300002EB50006031A0EB510200EB5100B2424A +:109A400001D8B04201D8F2F71FFB608840F2E24132 +:109A50004843394600F047F8C4F8340184F843A17C +:109A6000BDE8F09F70B50546554890F802C0BCF1BE +:109A7000020F07BF406900F5C074534800F1240489 +:109A8000002904BF256070BD4FF47A7601290DD0FE +:109A900002291CBFFFDF70BD1046FEF739FC00F243 +:109AA000E140B0FBF6F0281A206070BD1846FDF7C3 +:109AB0005FFB00F2E140B0FBF6F0281A206070BDB9 +:109AC0004148007800281CBF0020704710B50720CF +:109AD000F9F7DEF980F0010010BD3B48007800285E +:109AE00018BF0120704730B502460020002908BF8A +:109AF00030BDA2FB0110490A41EAC051400A4C1C8A +:109B000040F100000022D4F1FF3140F2A17572EB68 +:109B1000000038BFFFDF04F5F460B0FBF5F030BDA6 +:109B20002DE9F843284C0025814684F83450D4F8B8 +:109B3000188084F83010E5722570012727723946A5 +:109B4000606803F094FA6168C1F87081267B81F83F +:109B50007C61C1F88091C1F87481B1F80080202E39 +:109B600028BFFFDF194820F81680646884F82C515C +:109B70000023A4F878511A46194620460095FEF7AE +:109B8000D8FD002818BFFFDFC4F82851C4F82051C1 +:109B900084F82C71A4F83E51A4F83C5184F8425149 +:109BA000B4F87000401EA4F87000A4F87A51FBF7D6 +:109BB00048FA03484079BDE8F843E9F791B9000055 +:109BC000E0000020D4630200B00C0020EC0C002068 +:109BD000012804D0022805D0032808D105E0012976 +:109BE00007D004E0022904D001E0042901D00020BC +:109BF0007047012070472DE9F0410E46044604F0FD +:109C000092FC0546204604F092FC044603F0ADFFAA +:109C1000FB4F010015D0386990F864208A4210D0BB +:109C200090F8C4311BB190F8C63123421FD02EB931 +:109C300090F85D30234201D18A4218D890F8C401CF +:109C4000A8B1284603F091FF70B1396991F86520F9 +:109C5000824209D091F8C40118B191F8C701284295 +:109C600005D091F8C40110B10120BDE8F0810020B9 +:109C7000FBE730B5E24C85B0E06900285FD01422E4 +:109C800000216846F4F7FBFB206990F86500FDF7BA +:109C9000F9F94FF47A7100F5FA70B0FBF1F520692B +:109CA00090F86500FDF773FA2844ADF806002069C6 +:109CB0000188ADF80010B0F87010ADF804104188BC +:109CC000ADF8021090F8A60130B1A069C11C039153 +:109CD00004F00AFB8DF81000206990F8A5018DF8BA +:109CE0000800E169684688472069002180F8A611CC +:109CF00080F8A5110399002921D090F8A41100291A +:109D00001DD190F87C10272919D09DF81010039AC6 +:109D1000002914D013780124FF2B12D0072B0ED169 +:109D200002290CD15178FF2909D100BF80F8A44144 +:109D30000399C0F8A8119DF8101080F8A71105B07C +:109D400030BD1B29F2D9FAE770B5AD4C206990F807 +:109D50007D001B2800D0FFDF2069002580F8A75078 +:109D600090F8D80100B1FFDF206990F8A81041B148 +:109D700080F8A8500188A0F8DC1180F8DA510E2193 +:109D800008E00188A0F8DC1180F8DA51012180F8A0 +:109D9000DE110D2180F8D8110088F9F712FAF8F7D2 +:109DA000A9FE2079E9F79CF8206980F87D5070BD04 +:109DB00070B5934CA07980072CD5A078002829D1C4 +:109DC00062692046D37801690D2B01F170005FD0E4 +:109DD0000DDCA3F102034FF001050B2B19D2DFE8D4 +:109DE00003F01A1844506127182C183A6400152BF8 +:109DF0006FD008DC112B4BD0122B5AD0132B62D012 +:109E0000142B06D166E0162B71D0172B70D0FF2BC8 +:109E10006FD0FFDF70BD91F87F200123194603F05A +:109E200035FD0028F6D12169082081F87F0070BD3A +:109E30001079BDE8704001F0B2BC91F87E00C00717 +:109E400000D1FFDF01F06AFC206910F87E1F21F0CD +:109E50000101017070BD91F87D00102800D0FFDF76 +:109E60002069112180F8A75008E091F87D0014289E +:109E700000D0FFDF2069152180F8A75080F87D1001 +:109E800070BD91F87D00152800D0FFDF172005E098 +:109E900091F87D00152800D0FFDF1920216981F895 +:109EA0007D0070BDBDE870404EE7BDE8704001F038 +:109EB0004ABC91F87C200123002103F0E7FC00B9A3 +:109EC000FFDF0E200FE011F87E0F20F00400087075 +:109ED0001DE00FE091F87C200123002103F0D6FC67 +:109EE00000B9FFDF1C20216981F87C0070BD12E001 +:109EF0001BE022E091F87E00C0F30110012800D0A1 +:109F0000FFDF206910F87E1F21F010010170BDE80D +:109F1000704001F003BC91F87C200123002103F084 +:109F2000B5FC00B9FFDF1F20DDE791F87D00212897 +:109F300001D000B1FFDF2220B0E7BDE8704001F0A2 +:109F4000F9BB2F48016991F87E20130702D5012142 +:109F50008170704742F0080281F87E208069C078E5 +:109F600081F8E10001F0D1BB10B5254C21690A88C8 +:109F7000A1F81A2281F8180291F8640001F0B3FBED +:109F8000216981F81C0291F8650001F0ACFB2169A0 +:109F900081F81D02012081F81602002081F8C40119 +:109FA0002079BDE81040E8F79BBF10B5144C05219F +:109FB0002069FFF759FC206990F85A10012908D050 +:109FC00000F5F77104F013FC2079BDE81040E8F7C4 +:109FD00087BF022180F85A1010BD10B5084C01232C +:109FE0000921206990F87C20703003F04FFC48B1C3 +:109FF0002169002001F8960F087301F81A0C10BDB2 +:10A00000000100200120A070F9E770B5FE4D01238A +:10A0100029462869896990F87C2009790E2A01D19E +:10A02000122903D000241C2A03D004E0BDE87040AC +:10A03000D3E7142902D0202A07D008E080F87C401A +:10A0400080F8A240BDE87040AFE7162906D0262A66 +:10A0500001D1162902D0172909D00CE000F87C4F55 +:10A0600080F82640407821280CD01A2017E090F87C +:10A070007D20222A07D0EA69002A03D0FF2901D1D6 +:10A0800080F8A63132E780F87D4001F047FB28696F +:10A0900080F8974090F8C4010028F3D00020BDE874 +:10A0A000704061E72DE9F843D74C206990F87C10A7 +:10A0B000202909D05FF0000790F87D10222905D0F3 +:10A0C0007FB300F17C0503E00127F5E700F17D0592 +:10A0D00010F8B01F41F004010170A06904F02FFADC +:10A0E0004FF00108002608B33946A069FFF783FD49 +:10A0F000E0B16A46A169206903F046FD90B3A0690A +:10A1000004F01BFA2169A1F8AE01B1F8701001F05A +:10A11000DEFA40B32069282180F88D1080F88C8009 +:10A1200058E0FFE70220A070BDE8F883206990F8AE +:10A13000C40110B11E20FFF717FFAFB1A06921695C +:10A14000C07881F8E20008FA00F1C1F3006000B9BC +:10A15000FFDF20690A2180F87C1090F8A20040B946 +:10A16000FFDF06E009E02AE02E7001F0D7FAFFF7E2 +:10A17000E8FE206980F89760D6E7226992F8C4016A +:10A1800070B1B2F8703092F86410B2F8C80102F5FC +:10A19000D77203F0EBFD68B12169252081F87C00BE +:10A1A000206900F17D0180F897608D4212D180F81E +:10A1B0007D600FE00020FFF7D7FE2E70F0E72069EA +:10A1C0009DF8001080F8B0119DF8011080F8B111D1 +:10A1D00024202870206900F17D018D4203D1BDE863 +:10A1E000F84301F09BBA80F8A2609DE770B5864CF9 +:10A1F00001230B21206990F87D20703003F046FB8D +:10A20000202650BB20690123002190F87D2070306A +:10A2100003F03CFB0125F0B1206990F87C00242874 +:10A220001BD0A06904F069F9C8B1206990F8B0109A +:10A2300041F0040180F8B010A1694A7902F00702E8 +:10A2400080F85D20097901F0070180F85C1090F832 +:10A25000C5311BBB06E0A57048E6A67046E6BDE822 +:10A2600070406EE690F8C431C3B900F164035E78C3 +:10A270008E4205D11978914202D180F897500DE0B5 +:10A2800000F504710D7002884A8090F85C200A7114 +:10A2900090F85D0048712079E8F722FE21692120BD +:10A2A00081F87D00BDE8704001F02FBAF8B5564C3A +:10A2B000206990F87E0010F0300F04D0A07840F0B4 +:10A2C0000100A070F8BDA06904F0FCF850B3A069CB +:10A2D00004F0F2F80746A06904F0F2F80646A06917 +:10A2E00004F0E8F80546A06904F0E8F80146009794 +:10A2F000206933462A46303004F0E3F9A07980071C +:10A3000003D56069C07814280FD0216991F87C00CA +:10A310001C280AD091F85A0001280ED091F8BB01F0 +:10A3200058B907E0BDE8F8400BE62169012081F843 +:10A330005A0002E091F8BA0130B1206910F87E1F8E +:10A3400041F0100101700EE091F87E0001F5FE72FF +:10A3500040F0200081F87E0031F8300B04F03BFA29 +:10A360002079E8F7BDFDBDE8F84001F0CEB970B541 +:10A37000254C206990F87E10890707D590F87C203D +:10A3800001230821703003F081FAE8B1206990F8C8 +:10A39000AA00800712D4A06904F070F8216981F83E +:10A3A000AB00A06930F8052FA1F8AC204088A1F8D7 +:10A3B000AE0011F8AA0F40F002000870206990F872 +:10A3C000AA10C90703D00FE00120A0708EE590F815 +:10A3D0007E00800700D5FFDF206910F87E1F41F066 +:10A3E0000201017001F091F92069002590F87C10BC +:10A3F000062906D180F87C5080F8A2502079E8F731 +:10A400006FFD206902E000000001002090F8AC110F +:10A410000429DBD180F8AC512079E8F761FD20698F +:10A4200090F87C100029D1D180F8A2505EE570B57B +:10A43000FE4C01230021206990F87D20703003F04C +:10A4400025FA012578B9206990F87D20122A0AD0D2 +:10A4500001230521703003F019FA10B10820A07013 +:10A4600044E5A57042E5206990F8A80008B901F01C +:10A470004CF92169A06901F5847103F0E0FF2169BD +:10A48000A069D83103F0E6FF206990F8E00100B13F +:10A49000FFDF21690888A1F8E20101F5F271A069E6 +:10A4A00003F0BBFF2169A06901F5F67103F0BDFF60 +:10A4B000206980F8E051142180F87D102079BDE8F2 +:10A4C0007040E8F70DBD70B5D84C0123002120691C +:10A4D00090F87D20703003F0D9F90125A8B1A0696A +:10A4E00003F067FF98B1A0692169B0F80D00A1F8E9 +:10A4F000AE01B1F8701001F0EAF858B120692821D6 +:10A5000080F88D1080F88C50F0E4A570EEE4BDE882 +:10A51000704016E5A0692169027981F8B021B0F890 +:10A520000520A1F8B22103F037FF2169A1F8B40199 +:10A53000A06903F034FF2169A1F8B601A06903F016 +:10A5400035FF2169A1F8B8010D2081F87D00CDE427 +:10A550007CB5B64CA079C00738D0A069012305218D +:10A56000C578206990F87D20703003F08FF968B1CC +:10A57000AD1E0A2D06D2DFE805F009090505090917 +:10A5800005050909A07840F00800A070A07800280F +:10A590001CD1A06903F0D6FE00286ED0A069022667 +:10A5A000C5781DB1012D01D0162D18D1206990F864 +:10A5B0007C0003F053F990B1206990F87C101F29BA +:10A5C0000DD0202903D0162D16D0A6707CBD2621D3 +:10A5D00080F87C10162D02D02A20FFF7C5FC0C2D28 +:10A5E00058D00CDC0C2D48D2DFE805F033301D4488 +:10A5F000A8A8489F57A836392020A0707CBD01200C +:10A60000152D6ED008DC112D6CD0122D6CD0132DB1 +:10A6100064D0142D31D179E0162D7DD0182D7ED047 +:10A62000FF2D2AD184E020690123194690F87F206C +:10A63000703003F02BF9F8B9A06903F0E7FE216947 +:10A6400081F89201072081F87F0079E001F043F959 +:10A6500076E0FFF738FF73E001F01DF970E0206944 +:10A6600090F87D10112901D0A67069E0122180F8C0 +:10A670007D1065E0FFF7DBFE62E05FE0206990F8A7 +:10A680007D001728F0D101F049F821691B2081F8DD +:10A690007D0055E0FFF76BFE52E0206990F87E00E8 +:10A6A000C00703D0A07840F0010022E06946A0690D +:10A6B00003F0EBFE9DF8000000F02501206900F892 +:10A6C000B01F9DF8011001F04901417001F01DF823 +:10A6D000206910F87E1F41F0010113E0FFF77DFCB7 +:10A6E0002EE016E01EE0FFE7216991F87E10490791 +:10A6F00001D5A07024E001F008F8206910F87E1F51 +:10A7000041F0040101701BE006E008E0FFF7CEFD18 +:10A7100016E001F088F813E0FFF768FD10E0FFF79E +:10A72000C1FC0DE001F05EF80AE0FFF76EFC07E007 +:10A73000E16919B1216981F8A60101E0FFF701FC87 +:10A740002069F0E93012491C42F10002C0E9001210 +:10A750007CBD70B5354CA07900074AD5A07800289B +:10A7600047D1206990F8E400FE2800D1FFDF20697E +:10A77000FE21002580F8E41090F87D10192906D1FB +:10A7800080F8A75000F0CAFF206980F87D5020694A +:10A7900090F87C101F2902D0272921D119E090F8C8 +:10A7A0007D0003F05BF878B120692621012380F851 +:10A7B0007C1090F87D200B21703003F067F878B999 +:10A7C0002A20FFF7D1FB0BE02169202081F87C00D3 +:10A7D00006E0012180F8A51180F87C5080F8A25095 +:10A7E000206990F87F10082903D10221217080F898 +:10A7F000E41047E410B50D4C216991F8B0210AB975 +:10A8000091F8642081F8642091F8B1210AB991F897 +:10A81000652081F8652010B10020FFF7A5FB2069B5 +:10A8200003F07BFF002809D0206901E0000100202F +:10A83000BDE8104000F5F77103F0D9BF10BD70B549 +:10A84000F84C06460D46206990F8E400FE2800D03A +:10A85000FFDF2269002082F8E46015B1A2F8A400AD +:10A8600010E422F89E0F012010710BE470B5ED4C3E +:10A8700001230021206990F87C20703003F006F855 +:10A8800000287AD0206990F8BA1111B190F8BB1164 +:10A8900039B190F8C41100296ED090F8C51111B3E8 +:10A8A0006AE090F87D1024291BD090F87C102429B0 +:10A8B00017D0002300F5D87200F5DD7103F0CEFE4D +:10A8C0002169002081F8BA0101461420FFF7B7FF83 +:10A8D000216901F13000C28A21F8E62F408B4880BF +:10A8E00050E00123E6E790F87D2001230B21703032 +:10A8F00002F0CCFF68BB206990F8640000F0F3FE22 +:10A900000646206990F8650000F0EDFE05462069D6 +:10A9100090F8C6113046FFF75BF9D8B1206990F87E +:10A92000C7112846FFF754F9A0B12269B2F8703078 +:10A9300092F86410B2F8C80102F5D77203F016FA63 +:10A9400020B12169252081F87C001BE00020FFF761 +:10A950000BFB11E020690123032190F87D2070306A +:10A9600002F094FF40B920690123022190F87D2074 +:10A97000703002F08BFF08B100206DE4002116203A +:10A98000FFF75DFF012067E410B5E8BBA54C206927 +:10A9900090F87E10CA0702D00121092052E08A07F0 +:10A9A0000AD501210C20FFF74AFF206910F8AA1FE1 +:10A9B00041F00101017047E04A0702D5012113204F +:10A9C00040E00A0705D510F8E11F41710121072079 +:10A9D00038E011F0300F3BD090F8BB11A1B990F8DE +:10A9E000BA11E1B190F87D1024292FD090F87C1095 +:10A9F00024292BD05FF0000300F5D87200F5DD713B +:10AA000003F02CFE216900E022E011F87E0F20F017 +:10AA1000200040F010000870002081F83C012069FF +:10AA200090F87E10C90613D503F077FEFFF7BDFA44 +:10AA3000216901F13000C28A21F8E62F408B48805D +:10AA400001211520FFF7FBFE012010BD0123D3E7F4 +:10AA5000002010BD70B5734C206990F8E410FE29F9 +:10AA600078D1A178002975D190F87F20012319466B +:10AA7000703002F00BFF00286CD1206990F8901123 +:10AA800049B10021A0F89C1090F8911180F8E610CF +:10AA9000002102205BE090F87D200123042170302A +:10AAA00002F0F4FE0546FFF76FFF002852D128465A +:10AAB00000F075FF00284DD120690123002190F896 +:10AAC0007C20703002F0E2FE78B12069012304217D +:10AAD00090F87D20703002F0D9FE30B9206990F8EE +:10AAE000960010B10021122031E0206990F87C20FE +:10AAF0000A2A0DD0002D2DD101230021703002F043 +:10AB0000C5FE78B1206990F8AC1104290AD105E09E +:10AB100010F8E21F01710021072018E090F8AA0048 +:10AB2000800718D0FFF7A2FE002813D12069012367 +:10AB3000002190F87C20703002F0A8FE002809D097 +:10AB4000206990F8A401002804D00021FF20BDE86E +:10AB5000704074E609E000210C20FFF770FE2069C8 +:10AB600010F8AA1F41F0010101702FE43EB505461F +:10AB70006846FDF79BFC00B9FFDF22220021009808 +:10AB8000F3F77DFC0321009803F0C4FB00980178E3 +:10AB900021F010010170294603F0E1FB214C0D2D3D +:10ABA00042D00BDCA5F102050B2D19D2DFE805F030 +:10ABB0001F184919191F185518192400152D5DD093 +:10ABC00008DC112D25D0122D0BD0132D09D0142DFA +:10ABD00006D153E0162D2BD0172D68D0FF2D72D043 +:10ABE000FFDFFDF776FC002800D1FFDF3EBD2169C5 +:10ABF000009891F8E61019E0E26800981178017168 +:10AC000091884171090A81715188C171090A0172E3 +:10AC1000E7E70321009803F0ACFC0621009803F05D +:10AC2000ACFCDEE700010020009806210171D8E7A6 +:10AC30000098216991F8C621027191F8C7114171FC +:10AC4000CFE72169009801F5887103F007FC2169BD +:10AC50000098DC3103F00CFCC3E7FA49D1E90001AC +:10AC6000CDE90101206901A990F8B00000F02500AC +:10AC70008DF80400009803F036FCB2E72069B0F8C4 +:10AC80004810009803F006FC2069B0F8E81000981E +:10AC900003F004FC2069B0F84410009803F002FCB3 +:10ACA0002069B0F8E610009803F000FC99E72169EC +:10ACB00091F8C40100280098BCD111F8642F0271EA +:10ACC0004978BCE7FFE7206990F8A721D0F8A811E0 +:10ACD000009803F052FB84E7DB4810B5006990F858 +:10ACE000821041B990F87D2001230621703002F0D6 +:10ACF000CDFD002800D0012010BD70B5D24D2869CF +:10AD000090F8801039B1012905D0022906D0032915 +:10AD100004D0FFDF1BE4B0F8F41037E090F87F10A8 +:10AD2000082936D0B0F89810B0F89A2000248B1C6F +:10AD30009A4206D3511A891E0C04240C01D0641EB9 +:10AD4000A4B290F8961039B190F87C200123092123 +:10AD5000703002F09BFD40B3FFF7BEFF78B1296968 +:10AD60000020B1F89020B1F88E108B1C9A4203D3CA +:10AD7000501A801E00D0401EA04200D284B20CB1F6 +:10AD8000641EA4B22869B0F8F4102144A0F8F010B1 +:10AD90002FE5B0F898100329BDD330F8701F428D0D +:10ADA0001144491CA0F8801023E50024EAE770B59F +:10ADB0000C4605464FF4087200212046F3F75FFB6E +:10ADC000258016E5F8F7D4B92DE9F0410D46074680 +:10ADD0000721F8F7C3F8041E3CD094F8CC010026F4 +:10ADE000A8B16E70092028700BE0268484F8CC612D +:10ADF000D4F8CE016860D4F8D201A860B4F8D601C6 +:10AE0000A88194F8CC010028EFD12E71AEE094F81F +:10AE1000D80190B394F8D8010D2813D00E2801D092 +:10AE2000FFDFA3E02088F8F7CCF90746F7F777FEB5 +:10AE300078B96E700E20287094F8DA012871208895 +:10AE4000E88014E02088F8F7BCF90746F7F767FEBA +:10AE500010B10020BDE8F0816E700D20287094F8CC +:10AE6000DA0128712088E88094F8DE01287284F8DD +:10AE7000D8613846F7F74DFE78E0FFE794F80E0208 +:10AE800030B16E701020287084F80E62AF806DE0D3 +:10AE900094F8E00190B16E700A2028702088A88094 +:10AEA000D4F8E411C5F80610D4F8E811C5F80A1072 +:10AEB000B4F8EC01E88184F8E06157E094F8080206 +:10AEC00070B16E701A20287005E000BF84F8086227 +:10AED000D4F80A02686094F808020028F6D145E028 +:10AEE00094F8EE0188B16E701520287008E000BF5C +:10AEF00084F8EE6104F5F8702B1D07C883E807009D +:10AF000094F8EE010028F3D130E094F8FC0170B120 +:10AF10006E701C20287084F8FC61D4F8FE01686013 +:10AF2000D4F80202A860B4F80602A8811EE094F8E2 +:10AF3000100238B11D20287084F81062D4F8120273 +:10AF4000686013E094F81602002883D06E70162013 +:10AF5000287007E084F81662D4F818026860B4F824 +:10AF60001C02288194F816020028F3D1012071E711 +:10AF700035480021C16101620846704730B5324D45 +:10AF80000C46E860FFF7F4FF00B1FFDF2C7130BD25 +:10AF9000002180F87C1080F87D1080F8801090F8F7 +:10AFA000FE1009B1022100E00321FEF75DBC2DE98E +:10AFB000F041254C0546206909B1002104E0B0F8B4 +:10AFC0000611B0F8F6201144A0F8061190F890117F +:10AFD00039B990F87F2001231946703002F056FCF1 +:10AFE00030B1206930F89C1FB0F85A20114401801C +:10AFF000206990F8A23033B1B0F89E10B0F8F62076 +:10B000001144A0F89E1090F9A670002F06DDB0F84C +:10B01000A410B0F8F6201144A0F8A41001213D2698 +:10B0200015B180F88D6017E02278022A0ED0012A2F +:10B0300015D0A2784AB380F88C1012F0140F11D0FA +:10B040001E2117E0EC6302000001002090F8E620CA +:10B05000062A3CD016223AE080F88C1044E090F8A2 +:10B06000922134E0110702D580F88D603CE0910612 +:10B0700003D5232180F88D1036E0900700D1FFDF43 +:10B0800021692A2081F88D002AE02BB1B0F89E209A +:10B09000B0F8A0309A4210D2002F05DDB0F8A420FD +:10B0A000B0F8A0309A4208D2B0F89C30B0F89A209C +:10B0B000934204D390F890310BB1222207E090F82C +:10B0C00080303BB1B0F89830934209D3082280F821 +:10B0D0008D20C1E7B0F89820062A01D33E22F6E77A +:10B0E000206990F88C1019B12069BDE8F0414FE754 +:10B0F000BDE8F0410021FEF7B7BB2DE9F047FF4C5A +:10B1000081460D4620690088F8F76DF8060000D1E9 +:10B11000FFDFA0782843A070A0794FF000058006DB +:10B12000206904D5A0F8985080F8045103E030F865 +:10B13000981F491C0180FFF7CFFD012740B3E0882D +:10B14000000506D5206990F8821011B1A0F88E5044 +:10B150001EE02069B0F88E10491C89B2A0F88E104C +:10B16000B0F890208A4201D3531A00E00023B4F8CB +:10B1700008C00CF1050C634501D880F89670914227 +:10B1800006D3A0F88E5080F80E722079E7F7A8FE5B +:10B19000A0794FF0020810F0600F0ED0206990F8EF +:10B1A000801011B1032908D102E080F8807001E01D +:10B1B00080F880800121FEF757FB206990F880100D +:10B1C000012904D1E188C90501D580F88080B9F151 +:10B1D000000F71D1E188890502D5A0F8185104E06B +:10B1E000B0F81811491CA0F8181100F09FFBFEF7E9 +:10B1F00040FDFFF72FFC00F073FF0028206902D00C +:10B20000A0F8F85003E030F8F81F491C018000F066 +:10B210006AFF38B1206990F80411022907D8491C47 +:10B2200080F80411206990F80401022804D92069EB +:10B2300020F8F85F4580057320690123002190F80C +:10B240007D20703002F022FB20B9206990F87D004B +:10B250000C286AD120690123002190F87C207030ED +:10B2600002F014FB48B320690123002190F87F20ED +:10B27000703002F00BFB00B3206990F880100229B7 +:10B2800053D190F80401C0B93046F7F718FAA0B1CD +:10B29000216991F8E400FE2847D1B1F8F2000128B5 +:10B2A00043D981F8FD70B1F89A20B1F89800931E47 +:10B2B000984203DB012004E043E036E0101A401E10 +:10B2C00080B2B1F8F82023899A4201D3012202E02A +:10B2D0009A1A521C92B2904200D91046012801D10C +:10B2E00081F8FD5091F86F206AB98A6E5AB1B1F8B1 +:10B2F0009420B1F87030D21A12B2002A03DD9042C5 +:10B3000000DB104680B291F8882192B1B1F8FA20A2 +:10B31000B1F88A118A4201D3012102E0891A491C3D +:10B3200089B2884205D9084603E02169012081F8E5 +:10B33000FD502169B1F870201044A1F8F400FFF726 +:10B34000DCFCE088C0F340214846FFF730FE20696E +:10B3500080F8FE50BDE8F047FDF7DDB867490246CA +:10B360008878CB78184312D10846006942B18979B0 +:10B37000090703D590F87F00082808D001207047FE +:10B38000B0F84C10028E914201D8FEF7C6B90020E9 +:10B39000704770B5594C05460E46E0882843E0805A +:10B3A000A80703D5E80700D0FFDF6661EA074FF082 +:10B3B00000014FF001001AD0A661F278062A02D0EF +:10B3C0000B2A14D10AE0226992F87D30172B0ED196 +:10B3D0000023E2E92E3302F8370C08E0226992F8E4 +:10B3E0007D30112B03D182F8811082F8A800AA07C2 +:10B3F00018D56269D278052A02D00B2A12D10AE048 +:10B40000216991F87D20152A0CD10022E1E9302232 +:10B4100001F83E0C06E0206990F87D20102A01D149 +:10B4200080F88210280601D50820E07072E42DE92A +:10B43000F84F324C00254FF00108E580A570E5700B +:10B440004146257061F3070220619246814680F8EB +:10B45000FE800088F7F7C7FE070000D1FFDF2069F4 +:10B460000088FDF720F820690088FDF742F8206980 +:10B47000B0F8F21071B190F8E410FE290FD190F8F5 +:10B48000901189B190F87F2001231946703002F0A5 +:10B49000FDF978B1206990F8E400FE2804D0206915 +:10B4A00090F8E400FFF762FB206990F8FF1089B183 +:10B4B000258118E02069A0F89C5090F8911180F83F +:10B4C000E61000210220FFF7BAF9206980F8FD504C +:10B4D0000220E7E790F8CC1119B9018C82889142DB +:10B4E00000D881882181B0F8F610491E8EB2B0F8DC +:10B4F000F8103144A0F8F81002E00000000100202C +:10B5000090F8FC1021B1A0F8FA5080F8FC5004E04B +:10B51000B0F8FA103144A0F8FA1030F8981F31440E +:10B520000180FFF7D9FB20B1206930F88E1F31442C +:10B5300001802069B0F8F210012902D8491CA0F856 +:10B54000F2100EB180F8045190F8FD10A1B1B0F8DE +:10B55000F800218988420FD23846F7F7B0F858B181 +:10B56000206990F8881139B1B0F8FA10B0F88A0162 +:10B57000814201D300F0BAFD206980F8FD5090F8B7 +:10B580007D100B2901D00C2916D1B0F87020B0F82D +:10B59000AE31D21A12B2002A0EDBD0F8B01181609F +:10B5A00090F8B4110173032101F061FD206980F866 +:10B5B0007D5080F8B28026E0242910D1B0F87010B8 +:10B5C000B0F8AE21891A09B2002908DB90F8C4014D +:10B5D000FFF710F9206900F87D5F857613E090F899 +:10B5E0007C10242901D025290DD1B0F87010B0F8B5 +:10B5F000AE01081A00B2002805DB0120FFF7FAF8B7 +:10B60000206980F87C5020690146B0F8F62070303F +:10B6100001F0F5FE206990F8881109B1A0F8FA5000 +:10B62000F7480090F74BF84A4946504600F096FC20 +:10B63000216A11B16078FCF77CFA206901230521A9 +:10B6400090F87D20703002F021F9002803D0BDE889 +:10B65000F84F00F02ABABDE8F88F00F027BDEB499B +:10B66000C8617047E948C069002800D001207047D0 +:10B67000E64A50701162704710B50446B0F8B42124 +:10B680004388B0F8B611B0F8B8019A4205D1A38842 +:10B69000994202D1E38898420FD02388A4F8D03190 +:10B6A000A4F8D221A4F8D411A4F8D601012084F87A +:10B6B000CC01D6480079E7F713FC0221204601F0BF +:10B6C000D6FC002004F87D0F0320E07010BD401A66 +:10B6D00000B247F6FE71884201DC002801DC01203F +:10B6E00070470020704710B5012808D0022808D004 +:10B6F000042808D0082806D0FFDF204610BD01240A +:10B70000FBE70224F9E70324F7E7C04800210069BA +:10B7100020F8A41F8178491C81707047BB4800B590 +:10B72000016911F8A60F401E40B20870002800DA27 +:10B73000FFDF00BDB5482721006980F87C1000219B +:10B7400080F8A411704710B5B04C206990F8AC1186 +:10B75000042916D190F87C2001230021703002F0DA +:10B7600095F800B9FFDF206990F8AA10890703D483 +:10B77000062180F87C1004E0002180F8A21080F8F7 +:10B78000AC11206990F87E00800707D5FFF7C6FF4F +:10B79000206910F87E1F21F00201017010BD9B4945 +:10B7A00010B5096991F87C200A2A09D191F8E220A4 +:10B7B000824205D1002081F87C0081F8A20010BDF2 +:10B7C00091F87E20130706D522F0080081F87E004C +:10B7D000BDE81040A2E7FF2801D0FFDF10BDBDE8A3 +:10B7E0001040A7E710B5894C206910F8B01F41F050 +:10B7F00004010170A06902F0BEFE162806D120697E +:10B8000090F87C00202802D0262805D010BDA06921 +:10B8100002F0B5FEFEF7A8FB2169002081F87C004C +:10B8200081F8A20010BDF8B5784C01230A212069E7 +:10B8300090F87C20703002F029F838B3A06902F04B +:10B8400041FEC8B1A06902F037FE0746A06902F0C8 +:10B8500037FE0646A06902F02DFE0546A06902F0FB +:10B860002DFE01460097206933462A46303002F00B +:10B8700028FF206902F051FF2169002081F8A20011 +:10B8800081F87C00BDE8F840FEF78FBBA07840F05F +:10B890000100A070F8BD10B55C4C012300212069A7 +:10B8A00090F87D20703001F0F1FF30B1FFF72DFFEF +:10B8B0002169102081F87D0010BD20690123052138 +:10B8C00090F87D20703001F0E1FF08B1082000E021 +:10B8D0000120A07010BD70B54C4C012300212069DF +:10B8E00090F87D20703001F0D1FF012588B1A0696A +:10B8F00002F089FD2169A1F8AE01B1F87010FFF7DF +:10B90000E6FE40B12069282180F88D1080F88C5027 +:10B910008CE5A5708AE52169A06901F5D87102F06E +:10B920006DFD21690B2081F87D007FE510B5FEF7E4 +:10B9300010FFFEF70DFE354CA079400708D5A07822 +:10B9400030B9206990F87F00072801D101202070CC +:10B95000FEF72EFAA079C00609D5A07838B920697B +:10B9600090F87D100B2902D10C2180F87D10E07831 +:10B9700000070ED520690123052190F87D20703045 +:10B9800001F084FF30B10820A0702169002081F807 +:10B99000D80110BDBDE81040002000F0ABBB10B5D1 +:10B9A0001A4C216991F87D2048B3102A06D0142A38 +:10B9B00007D0152A1AD01B2A35D11AE001210B20F5 +:10B9C00019E0FAF7BFFD0C2817D32069082100F50C +:10B9D0008870FAF7BBFD28B120690421DC30FAF742 +:10B9E000B5FD00B9FFDF0121042004E000F020F8DC +:10B9F00003E001210620FEF722FF012010BD07E031 +:10BA0000FBB001005DB3010093B301000001002011 +:10BA1000212A08D191F8970038B991F8C40110B1E2 +:10BA200091F8C50108B10020E8E701211720E2E7FD +:10BA300070B5184C0025206990F8931101290AD09F +:10BA4000022925D190F8A810A9B1062180F8E610A6 +:10BA50000121022017E090F8D811002918D100F137 +:10BA6000C80300F58471002200F5CA7001F088FE59 +:10BA70000121052007E090F8B000400701D5112012 +:10BA800000E00D200121FEF7DAFE206980F89351D5 +:10BA9000CCE400000001002030B5F94C05462078C8 +:10BAA000002818BFFFDF257230BDF5490120C8719D +:10BAB00070472DE9F14FF34E3046446804F17009A8 +:10BAC00094F86510608F258F082967D001F090FFEA +:10BAD000854238BF284600F0FF08DFF8A4A3EA48F3 +:10BAE000CAF82400776897F8651097F882B03D8F00 +:10BAF000788F082956D001F07BFF854238BF284651 +:10BB0000BBF1000F1CBF001D80B2C0B297F86510DA +:10BB1000FBF700FC99F81200002847D009F1580102 +:10BB2000D94891E80E1000F5027585E80E10D9F895 +:10BB30006810C0F82112D9F86C10C0F8251200F571 +:10BB40008170FBF786FF307800280CBF01200020B1 +:10BB500080F00101CD480176D9E91412C0E9041240 +:10BB6000A0F58372DAF82410FBF7C1F994F86500A8 +:10BB7000012808BF00220CD0022808BF012208D0EB +:10BB8000042808BF032204D008281ABFFFDF0022C0 +:10BB9000022241460120FBF7C5F90DE0042101F026 +:10BBA00027FF95E7042101F023FFA6E7DAF8240038 +:10BBB000FBF74FFFFBF7E2F9009850B994F86500E6 +:10BBC00094F8661010F00C0F08BF00219620FBF7C8 +:10BBD00061FF94F8642001210020FCF718F894F824 +:10BBE0002C00012808BFFBF7E2FF02208AF80000C2 +:10BBF000FCF7D6FB002818BFFFDFBDE8F88F2DE962 +:10BC0000F04FDFF880A28BB050469AF800204068D1 +:10BC1000AAF11401059190F8751000F17005044621 +:10BC20004FF008080127AAF13406A1B3012900F05A +:10BC30000581022900F00681032918BFFFDF00F00B +:10BC40000F81306A0423017821F008010170AA797C +:10BC500008EAC202114321F004010170EA7903EA03 +:10BC60008202114321F01001017095F80590F06AED +:10BC7000F6F735FD8046FCF760FCB9F1020F00F0E5 +:10BC8000F780B9F1010F00F0F780B9F1030F00F070 +:10BC9000FF8000F002B9FFE795F80CC04FF00209F1 +:10BCA0004FF0000BBCF1240F1CBF6B7B242B08D082 +:10BCB000BCF11F0F18BFBCF1200F29D0222B4CD094 +:10BCC00076E094F8641092B190F8B001002873D037 +:10BCD000082918BF042968D0082818BF042864D090 +:10BCE000012918BF012852D04FF0020164E090F8FA +:10BCF0001201002860D0082918BF042955D008284F +:10BD000018BF042851D0012918BF01283FD0EBE704 +:10BD1000222B22D0002A4BD090F8C60194F8641050 +:10BD200010F0040F18BF40460CD0082918BF042992 +:10BD30003BD0082818BF042837D0012918BF012894 +:10BD400025D0D1E710F0010F18BF3846EDD110F023 +:10BD5000020F18BF4846E8D12EE04AB390F8C6213A +:10BD600090F85D0094F8641002EA000010F0040FEF +:10BD700018BF40460ED0082918BF042915D008283E +:10BD800018BF042811D0012918BF0128ACD14FF0E9 +:10BD9000010111E010F0010F18BF3846EBD110F08F +:10BDA000020F18BF4846E6D106E04FF0080103E055 +:10BDB00094F864100429F8D0A08E11F00C0F18BF6D +:10BDC0004FF4296001F014FE218E814238BF0846ED +:10BDD000ADF80400A4F84C000598FCF78DFB60B1A9 +:10BDE000B289316A42F48062B28172694FF4806034 +:10BDF000904703206871EF7023E709AA01A9F06A50 +:10BE0000F6F7A7FB306210B195F8371021B105980D +:10BE1000FCF746FB6F7114E79DF8241031B9A0F8C8 +:10BE200000B080F802B0012102F074FABDF80410ED +:10BE3000306A02F0A6FB85F8059002E70598FCF74A +:10BE40002FFBFEE6B4F84C00ADF8040009AA01A9E6 +:10BE5000F06AF6F77EFB3062002808BFFFDFF0E6ED +:10BE60000598FCF749FB002808BFFFDFE9E600BFA3 +:10BE700030EA080011D10EE030EA08000DD10AE0E6 +:10BE80002401002058010020300D0020380F002030 +:10BE9000B8F1000F01D0012100E00021306A0278E2 +:10BEA00042EA01110170697C00291CBF69790129EE +:10BEB0003BD005F15801FD4891E80E1000F50278DD +:10BEC00088E80E10A96EC0F82112E96EC0F825129C +:10BED00000F58170FBF7BDFD9AF8000000280CBF4B +:10BEE00001210021F2480176D5E91212C0E90412BD +:10BEF000A0F58371326AFAF7FAFF94F8640001281A +:10BF000008BF00220CD0022808BF012208D0042854 +:10BF100008BF032204D008281ABFFFDF0022022234 +:10BF2000FB210020FAF7FEFF03E0FBF792FDFBF791 +:10BF300025F8012194F865200846FBF768FE377163 +:10BF4000306A018831828078B0743770FCF731FA3A +:10BF5000002818BFFFDF0BB0BDE8F08F2DE9F043DC +:10BF6000D44D87B081462878DDF838801E461746C4 +:10BF70000C4628B9002F1CBF002EB8F1000F00D1CD +:10BF8000FFDFC5F81C80C5E90D94C5E905764FF0C3 +:10BF90000000E871A871E870A87028716871C64E39 +:10BFA000A881E881307804F170072088F7F71BF941 +:10BFB000E8622088F7F705F92863FBF7CFF994F9D1 +:10BFC0006700FBF79BFA04F11200FBF719FD04F17F +:10BFD0000E00FBF799FA307800280CBF03200120EF +:10BFE000FBF734FDB54890E80E108DE80E10D0E94F +:10BFF0000410CDE90410307800280CBFB048B148D7 +:10C0000004906846FBF710FDF87EFBF785FAFBF716 +:10C0100017FD94F86F0078B9A06E68B1B88C3988B4 +:10C02000884209D1B4F86C1001220844B88494F80D +:10C030006E00A16EF8F7B9FE3078002804BFFF202B +:10C0400094F8644012D094F86510BF7C258F608FFF +:10C0500008291FD001F0CCFC854238BF2846002FAC +:10C060001CBF001D80B2C0B294F865402146FBF7AA +:10C0700051F93078214688B10120FBF714FB706834 +:10C08000D0F80001FBF7E8FC0120FFF712FD07B034 +:10C09000BDE8F083042101F0ABFCDDE70020FBF7F5 +:10C0A00002FBFFF7ACFD07B0BDE8F083824800B5A6 +:10C0B00001783438007819B1022818BFFFDF00BDBD +:10C0C000012818BFFFDF00BD7A4810B500780228AC +:10C0D00018BFFFDFBDE8104000F03ABA00F038BAF0 +:10C0E0007448007970477348C078704771490120DF +:10C0F000487170472DE9F04706006F486D4D406864 +:10C1000000F17004686A90F8019018BF012E03D105 +:10C11000296B09F013F86870687800274FF0010860 +:10C12000A0B101283CD0022860D003281CBFFFDF4B +:10C13000BDE8F087012E08BFBDE8F087286BF6F751 +:10C14000C3FC287ABDE8F047E6F7CABE012E14D03A +:10C15000A86A002808BFFFDF6889C21CD5E909105A +:10C16000F2F763F9A86A686201224946286BF6F77C +:10C1700027FB022E08BFBDE8F087D4E91401401C5C +:10C1800041F10001C4E91401E079012801D1E7710E +:10C1900001E084F80780287ABDE8F047E6F7A0BE02 +:10C1A000012E14D0A86A002808BFFFDF6889C21CCE +:10C1B000D5E90910F2F739F9A86A68620022494600 +:10C1C000286BF6F7FDFA022E08BFBDE8F087D4E928 +:10C1D0001410491C40F10000C4E91410E079012852 +:10C1E0000CBFE77184F80780BDE8F087012E06D008 +:10C1F000286BF6F769FC022E08BFBDE8F087D4E98A +:10C200001410491C40F10000C4E91410E079012821 +:10C21000BFD1BCE770B5284E3046A6F13404406863 +:10C2200000F170052078012818BFFFDFA87868B1F9 +:10C230000021A970A289042042F00402A28162694F +:10C240009047307800281CBF01202871216A032202 +:10C25000087832EA000009D1A28912F4806F05D073 +:10C2600042F00202A281626902209047012100206F +:10C2700000F098F918B1BDE8704000F069B9BDE868 +:10C280007040002015E42DE9F14F0B4E0027304699 +:10C29000A6F134054068317800F1700A2878B84674 +:10C2A000022818BFFFDFE8890EE00000300D0020F3 +:10C2B000380F00202401002058010020F463020000 +:10C2C0007B2302004199010040F40070E88171680D +:10C2D0003078FF2091F86410FBF71CF800980028D4 +:10C2E0009AF8120000F0FC80FAF76DFEFAF75BFE98 +:10C2F0004FF0010990B99AF8120078B1686A417854 +:10C3000061B100789AF80710C0F3C000884205D1E7 +:10C3100085F80290BDE8F84F00F01AB9686A4178D4 +:10C320006981002908BFAF6203D0286BF6F702FAD3 +:10C33000A862E88940F02000E881EF7030787068EA +:10C3400000F17004834690F82C0001281AD1FBF705 +:10C3500024FC2146584601F054FA98B13078002860 +:10C3600070680CBF00F59A7000F50270BBF8001001 +:10C370004180217A0171617A417180F80090287AB8 +:10C38000E6F7AEFD686A9AF806100078C0F3800000 +:10C3900088423BD03078706800F1700490F87500E6 +:10C3A00000282FD002284BD06771307800281CBF9E +:10C3B0002079002809D02771AA89394642F0100255 +:10C3C000AA816A694FF010009047E078A0B1E77049 +:10C3D000FCF7A1F8002808BFFFDF0820AA89002188 +:10C3E00042F00802AA816A699047D4E91202411C0E +:10C3F00042F10000C4E91210A07901280CBFA77116 +:10C4000084F80690E88940F48070E881696A9AF8B7 +:10C4100007300878C0F3C0029A424ED13278726871 +:10C4200000F0030002F17004012818BF02282DD08B +:10C4300003281CBFA87940F0040012D0A8713CE08A +:10C44000E86AF6F7B2F8002808BFFFDFD4E9120265 +:10C45000411C42F10000C4E91210287AE6F740FDC1 +:10C46000A2E784F80290EA89484642F40062EA8131 +:10C47000AA8942F00102AA816A699047E0790128FD +:10C4800001D1E77119E084F8079016E0487818B3F5 +:10C49000E98941F40061E981A96A71B1FB2884BF8F +:10C4A000A87940F01000C9D8E879002808BFC8462C +:10C4B00003D080206A69002190470120009900F094 +:10C4C00071F8B0B1B8F1000F1CBF0020FFF712FEE9 +:10C4D000BDE8F84F00F03CB8E0790128D3D1D0E7AF +:10C4E000002818BFFAF7A9FDE88940F04000E8816C +:10C4F000E3E7B8F1000F1CBF0120FFF7FBFDFFF7DA +:10C500007EFBB8F1000F08BFBDE8F88F0220BDE840 +:10C51000F84FEFE570B50D460646424841490078B0 +:10C520004C6850B1FAF7FFFD034694F864202946A1 +:10C530003046BDE87040FDF795BAFAF7F4FD0346C2 +:10C5400094F8642029463046BDE8704005F019BFD4 +:10C55000344910B54C68FBF7FFFAFBF7DEFAFBF73E +:10C56000A5F9FBF753FAFAF709FD94F82C00012816 +:10C5700008BFFBF712FB94F86F0038B9A06E28B122 +:10C58000002294F86E001146F8F70FFC264C0021AB +:10C590006269E0899047E269A179A078904700201C +:10C5A000207010BD70B5204C0546002908BF012D34 +:10C5B00006D1E07800F10100C0B2E07001282ED869 +:10C5C000A16928468847002829D06179174839B1E0 +:10C5D000012D01BF41780029017811F0100F1ED004 +:10C5E000A179E1B90F490978002908BF012D01D0CF +:10C5F00091B18DB90E49097811F0100F04BF007880 +:10C6000010F0100F0BD0A08948B9A06A20B960893A +:10C6100010B111F0100F02D04FF0000070BD4FF0BC +:10C62000010070BD5801002024010020300D0020C1 +:10C6300034010020FE498A78824286BF084490F87F +:10C6400043010020704710B540F2D3120021F84892 +:10C65000F1F715FF0822FF21F648F1F710FFF64821 +:10C660000021417081704FF46171818010BD2DE90E +:10C67000F0410E46054600F0AEFBED4C102816D0FA +:10C6800004EBC00191F85A0110F0010F1CBF01200A +:10C69000BDE8F081607808283CBF012081F85A018C +:10C6A0001CD26078401C60700120BDE8F081607889 +:10C6B000082813D222780127501C207004EBC208EE +:10C6C0003068C8F85401B088A8F85801102A28BF6B +:10C6D000FFDF88F8535188F85A71E2E70020BDE87F +:10C6E000F081D54988707047D3488078704770B41E +:10C6F000CF4800250178491E4BB2002B47DB00BF15 +:10C7000000EBC30191F85A1111F0010F3BD04278B0 +:10C71000D9B2521E427000EBC10282F85A5190F811 +:10C7200002C00022BCF1000F0BD9841894F80361F9 +:10C730008E4202D1102A26D103E0521CD2B2944577 +:10C74000F3D80278521ED2B202708A421BD000EB9C +:10C75000C20200EBC10CD2F85341CCF85341D2F8DD +:10C760005721CCF85721847890F800C00022002C83 +:10C7700009D9861896F8036166450CD1102A1CBFAA +:10C78000024482F80311591E4BB2002BB8DAAA48B2 +:10C79000857070BC7047521CD2B29442E9D8F2E75F +:10C7A000A3498A78824286BF01EB0010C01C00209A +:10C7B00070472DE9F04101261F469046344600257A +:10C7C00000F009FB10282AD099494FF0000C01EB2A +:10C7D000C00292F85A2102F001058A78002A1ED977 +:10C7E00001EB0C0393F8033183421FD1BCF1100F0E +:10C7F00015D0002F18BF87F800C0887860450ED983 +:10C8000001EB0C1010F1030F09D001EB0C0090F8B4 +:10C810004B4190F83B0101280CBF0126002648EA55 +:10C82000050046EA04010840BDE8F0810CF101036F +:10C8300003F0FF0C6245D3D8F1E72DE9F05F1F4606 +:10C8400090460E46814600F0C6FA794D04461028FF +:10C850003CD00146AB780020002B0ED92A1892F864 +:10C8600003218A4205D110281CBF1220BDE8F09F89 +:10C8700003E0401CC0B28342F0D8082B3FD2102CFA +:10C8800027D0AE781022701CA87005EB061909F1AC +:10C890000300414600F05AFF09F183001022394697 +:10C8A00000F054FF1021384600F02DFF35441021D0 +:10C8B00085F84301404600F026FF85F84B0185F8D6 +:10C8C0000341002085F83B01BDE8F09FAB78082BC1 +:10C8D00015D22C78CA46601C287005EBC409306854 +:10C8E000C9F85401B0884FF0000BA9F85801102C7A +:10C8F00028BFFFDF89F853A189F85AB1C1E70720A3 +:10C90000BDE8F09F70B44A488178491E4BB2002BB5 +:10C91000BCBF70BC704700BF817803F0FF0C491E9C +:10C92000CAB2827050FA83F191F8031194453ED057 +:10C9300000EB021500EB0C14D5F80360C4F803609B +:10C94000D5F80760C4F80760D5F80B60C4F80B6031 +:10C95000D5F80F60C4F80F60D5F88360C4F8836021 +:10C96000D5F88760C4F88760D5F88B60C4F88B6011 +:10C97000D5F88F50C4F88F50851800EB0C0402EBEB +:10C98000420295F803610CEB4C0C00EB420284F878 +:10C99000036100EB4C0CD2F80B61CCF80B61B2F8E0 +:10C9A0000F21ACF80F2195F83B2184F83B2100EBD7 +:10C9B000C10292F85A2112F0010F33D190F802C04F +:10C9C0000022BCF1000F0BD9841894F803518D425A +:10C9D00002D1102A26D103E0521CD2B29445F3D8DA +:10C9E0000278521ED2B202708A421BD000EBC20201 +:10C9F00000EBC10CD2F85341CCF85341D2F8572187 +:10CA0000CCF85721847890F800C00022002C09D976 +:10CA1000851895F80351654512D1102A1CBF0244B0 +:10CA200082F80311591E4BB2002BBFF675AF05E01B +:10CA3000600F00206C0100206001002070BC704776 +:10CA4000521CD2B29442E3D8ECE7FE4948707047DA +:10CA5000FC484078704738B14AF2B811884203D890 +:10CA6000F84988800120704700207047F548808889 +:10CA7000704710B500F0AFF9102814D0F24A014603 +:10CA8000002092F802C0BCF1000F0CD9131893F8E3 +:10CA900003318B4203D1102818BF10BD03E0401CA6 +:10CAA000C0B28445F2D8082010BDE7498A78824296 +:10CAB00086BF01EB0010833000207047E24B93F8F3 +:10CAC00002C084459CBF00207047184490F80301C1 +:10CAD00003EBC00090F853310B70D0F85411116083 +:10CAE000B0F85801908001207047D74A114491F85E +:10CAF0000321D4490A700268C1F806208088488161 +:10CB0000704770B516460C460546FBF73BF8FAF73A +:10CB10004AF9CC48407868B1CB48817851B12A199C +:10CB2000002E0CBF8330C01CFAF717F9FAF75EF934 +:10CB3000012070BD002070BD10B5FAF785F90028FE +:10CB400004BFFF2010BDBDE81040FAF7A3B9FAF703 +:10CB50007BB9BD498A7882429CBF00207047084457 +:10CB600090F8030101EBC00090F85A0100F00100B9 +:10CB700070472DE9F047B44E00273D463078002835 +:10CB80008CBFDFF8C882BDE8F0870024B0780028A9 +:10CB900008D9311991F80321AA4204D0611CCCB202 +:10CBA000A042F6D81024A04286BF06EB0410C01C99 +:10CBB000002006EBC50999F85A1111F0010F16D0A3 +:10CBC00050B1102C04D0311991F83B11012903D038 +:10CBD000102100F098FD50B108F8074038467B1C42 +:10CBE00099F8532109F5AA71DFB2FAF736FC681CEF +:10CBF000C5B23078A842C8D8BDE8F0872DE9F04129 +:10CC0000914C00263546A07800288CBF8F4FBDE898 +:10CC1000F0816119C0B291F80381A84286BF04EB8C +:10CC20000510C01C002091F83B11012903D01021F0 +:10CC300000F069FD58B104EBC800BD5590F85321D0 +:10CC400000F5AA713046731CDEB2FAF706FC681CC8 +:10CC5000C5B2A078A842DCD8BDE8F08101447A488A +:10CC600010B500EB02100A4601218330FAF775F87F +:10CC7000BDE81040FAF7BAB80A46724910B54978CB +:10CC800041B1714B997829B10244D81CFAF765F883 +:10CC9000012010BD002010BD6B4A01EB410102EBE9 +:10CCA00041010268C1F80B218088A1F80F0170478B +:10CCB0002DE9F041644D07460024A878002898BF6C +:10CCC000BDE8F081C0B2A04217D905EB041010F105 +:10CCD000830612D01021304600F015FD68B904EB30 +:10CCE000440005EB400808F20B113A463046FBF7CA +:10CCF000A3FCB8F80F01A8F80F01601CC4B2A87813 +:10CD0000A042DFD8BDE8F08101461022504800F073 +:10CD10001DBD4F4870474C498A78824203D90A1892 +:10CD200092F843210AB10020704700EB400001EB6C +:10CD3000400000F20B10704743498A78824206D9BE +:10CD4000084490F83B01002804BF012070470020F0 +:10CD500070472DE9F0410E4607461546062130463C +:10CD600000F0D1FC384C98B1A17871B104F59D70F8 +:10CD700011F0010F18BF00F8015FA178490804D035 +:10CD8000457000F8025F491EFAD10120BDE8F0812C +:10CD90003846314600F01FF8102819D0A37800213A +:10CDA000002B15D9621892F8032182420BD1102969 +:10CDB00018BF08290CD004EB010080F83B514FF05C +:10CDC0000100BDE8F08101F10101C9B28B42E9D84F +:10CDD0000020BDE8F0812DE9F0411B4D06460024FE +:10CDE00028780F46002811D905EBC40090F853119C +:10CDF000B14206D10622394600F5AA70F1F7E8FAE9 +:10CE000038B1601CC4B22878A042EDD81020BDE82B +:10CE1000F0812046BDE8F0810B4910B44A7801EB5F +:10CE2000C003521E4A70002283F85A2191F802C0B2 +:10CE3000BCF1000F16D98B1893F8034184420DD131 +:10CE4000102A07E060010020600F00206C01002024 +:10CE5000331100201CBF10BC704703E0521CD2B23B +:10CE60009445E8D80A78521ED2B20A7082421BD08A +:10CE700001EBC20201EBC003D2F853C1C3F853C1A6 +:10CE8000D2F85721C3F857218C7891F800C00022BE +:10CE9000002C09D98B1893F80331634506D1102A69 +:10CEA0001CBF114481F8030110BC7047521CD2B260 +:10CEB0009442EFD810BC704770B449490D188A7875 +:10CEC000521ED3B28B7095F8032198423DD001EBEE +:10CED000001401EB031C00EB4000DCF80360C4F815 +:10CEE0000360DCF80760C4F80760DCF80B60C4F886 +:10CEF0000B60DCF80F60C4F80F60DCF88360C4F8E6 +:10CF00008360DCF88760C4F88760DCF88B60C4F865 +:10CF10008B60DCF88FC0C4F88FC001EB030C03EB0F +:10CF200043039CF8034101EB430385F8034101EB04 +:10CF30004000D3F80B41C0F80B41B3F80F31A0F813 +:10CF40000F319CF83B0185F83B0101EBC20090F8E2 +:10CF50005A0110F0010F1CBF70BC704700208C7884 +:10CF6000002C0DD90B1893F803C1944504D1102857 +:10CF70001CBF70BC704703E0401CC0B28442F1D8B3 +:10CF80000878401EC0B20870904204BF70BC704761 +:10CF900001EBC20301EBC000D0F853C1C3F853C189 +:10CFA000D0F85701C3F857018C780B780020002C7B +:10CFB0009CBF70BC704700BF01EB000C9CF803C124 +:10CFC0009C4506D110281CBF084480F8032170BC82 +:10CFD0007047401CC0B28442EED870BC704700005D +:10CFE000600F002010B50A7B02F01F020A730022B6 +:10CFF00042768B1893F808C00CF001034FEA5C0CE2 +:10D000000CF0010423444FEA5C0C0CF001042344AF +:10D010004FEA5C0C0CF001041C444FEA5C0303F083 +:10D02000010CA4445B0803F00104A4445B0803F072 +:10D030000104A4440CEB530300EB020C521C8CF8CB +:10D04000143090F819C0D2B263444376052AD0D385 +:10D05000D8B2252888BFFFDF10BD0023C3834284D8 +:10D0600001EBC202521EB2FBF1F10184704770B5B0 +:10D070000446002569B14FF4FA42012978D002290B +:10D0800075D0032918BF70BD0146BDE870407030EF +:10D09000A8E704F17006802200213046F1F7EFF98D +:10D0A000B571F57135737573F57335747571B57642 +:10D0B000F576212086F84000492086F84100FE20C0 +:10D0C00086F874002688702200212046F1F7D7F9EF +:10D0D0002680012684F8646084F86560282084F83E +:10D0E0006600002104F1300001F0F3FA1B22A4F8DD +:10D0F0004E20A4F85020A4F85220A4F854204FF455 +:10D10000A470A4F85600A4F8580066734FF4486061 +:10D110006080A4F8F050A4F8F250A4F8F450A4F8F9 +:10D12000F650A4F8F850A4F8FA5084F8FD5084F8AA +:10D13000FF50A4F8065184F80451A4F81851A4F83B +:10D140001A5184F8BA5184F8BB5184F8C45184F858 +:10D15000C55184F8885184F8905184F8935184F82B +:10D16000AC51C4F8A451C4F8A85170BD00E041E02E +:10D17000A4F8065184F8FE506088FE490144B1FBD2 +:10D18000F0F1A4F890104BF68031A4F89210E388E7 +:10D19000A4F89850B4F89CC0DB000CFB00FCB3FB77 +:10D1A000F0F39CFBF0FC5B1CA4F89CC09BB203FB5F +:10D1B00000FC04F17001A4F89A30BCF5C84FC4BF5C +:10D1C0005B1E4B85B2FBF0F2521C0A8600F58022F2 +:10D1D00002F5EE32531EB3FBF0F20A84CB8B03FB55 +:10D1E00000F2B2FBF0F0C883214604F17000BDE804 +:10D1F0007040F7E6B4F8B411B4F8B831B4F802C02E +:10D2000004F17000A4F89850B4F89C40DB0004FBD3 +:10D210000CF4B3FBF1F394FBF1F45B1C84859BB23B +:10D2200003FB01F44385B4F5C84FC4BF5B1E4385BF +:10D23000B2FBF1F2521C0286428C01EBC202521E7A +:10D24000B2FBF1F20284C28B02FB0CF2B2FBF1F1F1 +:10D25000C18370BD70B50446002569B14FF4FA4230 +:10D2600001295CD002297CD0032918BF70BD01467A +:10D27000BDE870407030B5E604F1700680220021F0 +:10D280003046F1F7FCF8B571F57135737573F573C8 +:10D2900035747571B576F576212086F84000492001 +:10D2A00086F84100FE2086F874002688702200214E +:10D2B0002046F1F7E4F82680012684F8646084F8BB +:10D2C0006560282084F86600002104F1300001F038 +:10D2D00000FA1B22A4F84E20A4F85020A4F85220F3 +:10D2E000A4F854204FF4A470A4F85600A4F85800F1 +:10D2F0006673A4F8F850202084F8FA0084F8F050FF +:10D30000C4F8F45084F8245184F8255184F82E513F +:10D3100084F82F5184F8145184F8205170BD60882E +:10D3200094490144B1FBF0F1A4F890104BF6803120 +:10D33000A4F89210E388A4F89850B4F89CC0DB00DD +:10D340000CFB00FCB3FBF0F39CFBF0FC5B1CA4F8B3 +:10D350009CC09BB204F17001A4F89A3003FB00FC5E +:10D3600000E01CE0BCF5C84FC4BF5B1E4B85B2FBA0 +:10D37000F0F2521C0A8600F5802202F5EE32531EAE +:10D38000B3FBF0F20A84CB8B03FB00F2B2FBF0F0AC +:10D39000C883214604F17000BDE8704022E6D4F84D +:10D3A0001831B4F802C004F170005989DB89A4F87F +:10D3B0009850B4F89C40DB0004FB0CF4B3FBF1F391 +:10D3C00094FBF1F45B1C84859BB203FB01F4438561 +:10D3D000B4F5C84FC4BF5B1E4385B2FBF1F2521CCB +:10D3E0000286428C01EBC202521EB2FBF1F20284B1 +:10D3F000C28B02FB0CF2B2FBF1F1C18370BD2DE9CF +:10D40000F003447E0CB1252C03D9BDE8F0031220B3 +:10D410007047002A02BF0020BDE8F003704791F872 +:10D420000DC01F260123544D4FF00008BCF1000F22 +:10D4300074D0BCF1010F1EBF1F20BDE8F003704780 +:10D44000B0F800C00A7C8F7B91F80F907A404F7C37 +:10D4500087EA090742EA072282EA0C0C5FF000071C +:10D460000CF0FF094FEA1C2C99FAA9F99CFAACFCC4 +:10D470004FEA19694FEA1C6C49EA0C2C0CEB0C1CA6 +:10D480007F1C9444FFB21FFA8CFC032FE8D38CEA74 +:10D49000020C394F0022ECFB057212096FF02405D3 +:10D4A00002FB05C2D2B201EBD207827602F0070579 +:10D4B0003F7A03FA05F52F4218BFC2767ED104FBEE +:10D4C0000CF2120C521CD2B25FF0000400EB040C00 +:10D4D0009CF814C094453CBFA2EB0C02D2B212D30C +:10D4E0000D194FF0000C2D7A03FA0CF73D421CBFCA +:10D4F000521ED2B2002A6FD00CF1010C0CF0FF0CBE +:10D50000BCF1080FF0D304F1010C0CF0FF04052C62 +:10D51000DCD33046BDE8F0037047FFE790F81AC04F +:10D520000C7E474604FB02C2134C4FF0000CE2FB9A +:10D53000054C4FEA1C1C6FF024040CFB0422D2B2F1 +:10D5400001EBD204827602F0070C247A03FA0CFC79 +:10D5500014EA0C0F1FBFC2764046BDE8F0037047C7 +:10D5600090F819C0B2FBFCF40CFB1422521CD2B28E +:10D57000002403E0FFDB050053E4B36E00EB040C72 +:10D580009CF814C094453CBFA2EB0C02D2B212D35B +:10D590000D194FF0000C2D7A03FA0CF815EA080F5C +:10D5A0001CBF521ED2B27AB10CF1010C0CF0FF0C70 +:10D5B000BCF1080FF0D304F1010C00E00FE00CF017 +:10D5C000FF04052CD5D3A4E70CEBC401C176384683 +:10D5D000BDE8F0037047FFE70CEBC401C17640469D +:10D5E000BDE8F0037047FE4A016812681140FD4A29 +:10D5F000126811430160704730B4FB49F84B0024B6 +:10D600004FF0010C0A78521CD2B20A70202A08BFCF +:10D610000C700D781A680CFA05F52A42F2D00978D8 +:10D6200002680CFA01F15140016030BC704770B4DF +:10D630006FF01F02010C02EA90251F23A1F5AA40FA +:10D6400054381CBFA1F5AA40B0F1550009D0A1F58E +:10D650002850AA381EBFA1F52A40B0F1AA00012027 +:10D6600000D100204FF0000C624664468CEA0106AF +:10D67000F6431643B6F1FF3F11D005F001064FEA1D +:10D680005C0C4CEAC63C03F0010652086D085B08CE +:10D69000641C42EAC632162CE8D370BC704770BCDA +:10D6A00000207047017931F01F0113BF00200022D4 +:10D6B0001146704710B4435C491C03F0010C5B0831 +:10D6C00003F00104A4445B0803F00104A4445B08D4 +:10D6D00003F00104A4445B0803F00104A4445B08C4 +:10D6E00003F001045B08A44403F00104A4440CEB20 +:10D6F00053031A44D2B20529DDDB012A8CBF012075 +:10D70000002010BC704730B40022A1F1010CBCF124 +:10D71000000F11DD431E11F0010F08BF13F8012F98 +:10D720005C785FEA6C0C07D013F8025F22435C78E8 +:10D730002A43BCF1010CF7D1491E5CBF405C024397 +:10D74000002A0CBF0120002030BC7047002A08BF0F +:10D7500070471144401E12F0010F03D011F8013D33 +:10D7600000F8013F520808BF704700BF11F8013CA4 +:10D77000437011F8023D00F8023F521EF6D1704787 +:10D7800070B58CB000F110041D4616460DF1FF3C3B +:10D790005FF0080014F8012C8CF8012014F8022D19 +:10D7A0000CF8022F401EF5D101F1100C6C460DF162 +:10D7B0000F0108201CF8012C4A701CF8022D01F8FA +:10D7C000022F401EF6D1204606F0EEFE7EB16A1E04 +:10D7D00004F130005FF0080110F8013C537010F8BC +:10D7E000023D02F8023F491EF6D10CB070BD089808 +:10D7F0002860099868600A98A8600B98E8600CB0E7 +:10D8000070BD38B505460C466846FAF7DFF90028C2 +:10D8100008BF38BD9DF900202272E07E607294F945 +:10D820000A100020511A48BF494295F82D308B420A +:10D83000C8BF38BDFF2B08BF38BDE17A491CC9B24B +:10D84000E17295F82E30994203D8A17A7F2918BF4A +:10D8500038BDA2720020E072012038BD0C2818BF2C +:10D860000B2810D00D2818BF1F280CD0202818BF57 +:10D87000212808D0222818BF232804D024281EBF1E +:10D880002628002070474FF0010070470C2963D212 +:10D89000DFE801F006090E13161B323C415C484ECE +:10D8A000002A5BD058E0072A18BF082A56D053E058 +:10D8B0000C2A18BF0B2A51D04EE00D2A4ED04BE057 +:10D8C000A2F10F000C2849D946E023B1A2F11000C3 +:10D8D0000B2843D940E0122A18BF112A3ED090F8F5 +:10D8E000380020B1122A37D31A2A37D934E0162A41 +:10D8F00032D31A2A32D92FE0A2F10F0103292DD9F0 +:10D9000090F8380008B31B2A28D925E0002B08BF5F +:10D91000042A21D122E013B1062A1FD01CE0012ADB +:10D920001AD11BE01C2A1CBF1D2A1E2A16D013E088 +:10D930001F2A18BF202A11D0212A18BF222A0DD051 +:10D94000232A1CBF242A262A08D005E013B10E2A58 +:10D9500004D001E0052A01D0002070470120704763 +:10D960002DE9F0410D4604468668F7F707FE58B9E1 +:10D97000F7F75CFC40F23571F7F73FF9A0602046FD +:10D98000F7F7FCFD0028F3D095B13046A168F8F711 +:10D990003CF900280CDD2844401EB0FBF5F707FBDE +:10D9A00005F13046F7F729F9A0603846BDE8F08167 +:10D9B0000020BDE8F08170B50446904228BF70BDDC +:10D9C000101B642812D325188D4206D80421F8F7BD +:10D9D00050F900281CBF284670BD204670BD0000CD +:10D9E0000C64020010640200740100206420EAE765 +:10D9F00011F00C0F13D001F0040100290DBF4022DB +:10DA0000102296214FF4167101F5BC71A0EB0103B1 +:10DA100088428CBF93FBF2F0002080B2704702294D +:10DA200019BF6FF00D0101EBD0006FF00E0101EB9B +:10DA30009000F2E7084418449830002A14BF0421EB +:10DA400000210844704710B4002A14BF4FF4296223 +:10DA50004FF4A472002B19BF4FF429634FF0080C48 +:10DA60004FF4A4734FF0010C00280CBF01240024D4 +:10DA700091F866001CF00C0F08BF0020D118084474 +:10DA80009830002C14BF04210021084410BC7047BA +:10DA900000280CBF0123002391F86600002BA0F69C +:10DAA000482000F5005018BF04231844496A8142F9 +:10DAB0002CBF0120002012F00C0118BF012131EA17 +:10DAC000000014BF00200120704710B413680B66DB +:10DAD000137813F00C0318BF0123527812F00C02D4 +:10DAE00018BF012253EA020C04BF10BC7047002B80 +:10DAF0000CBF4FF4A4734FF42963002A19BF4FF4ED +:10DB000029624FF0080C4FF4A4724FF0010C00286A +:10DB10000CBF0124002491F866001CF00C0F08BF14 +:10DB200000201A4410449830002C14BF0422002214 +:10DB300010444A6A824224BF10BC704791F86000CA +:10DB40004FF0030230F00C0381F8603091F861006F +:10DB500020F00C0081F8610008BF81F860200028E7 +:10DB600008BF81F8612010BC704710F0010F1CBF86 +:10DB70000120704710F0020F1CBF0220704710F008 +:10DB8000040018BF082070472DE9F04704461746E7 +:10DB900089464FF00108084600F0C5FC0546484696 +:10DBA00000F0C5FC10F0010F18BF012625D000BF02 +:10DBB00015F0010F18BF01232AD000BF56EA030158 +:10DBC00008BF4FF0000810F0070F08BF002615F03F +:10DBD000070F08BF002394F86400B0420CBF002078 +:10DBE0003046387094F86510994208BF00237B7066 +:10DBF000002808BF002B25D115E010F0020F18BF38 +:10DC00000226D5D110F0040F14BF08260026CFE756 +:10DC100015F0020F18BF0223D0D115F0040F14BF66 +:10DC200008230023CAE7484600F087FCB4F87010C8 +:10DC3000401A00B247F6FE71884201DC002801DC80 +:10DC40004FF0000816B1082E0CD018E094F86400CC +:10DC5000012818BF022812D004281EBF0828FFDFA1 +:10DC6000032D0CD194F8C40148B1B4F8C8010128BF +:10DC700094F8640006D0082801D008203870404687 +:10DC8000BDE8F087042818BF0420F7D1F5E7012884 +:10DC900014BF0228704710F00C0018BF0420704712 +:10DCA00038B4CBB2C1F3072CC1B2C0F30724012BA7 +:10DCB00007D0022B09D0042B08BFBCF1040F2DD0D4 +:10DCC00006E0BCF1010F03D128E0BCF1020F25D022 +:10DCD000012906D0022907D0042908BF042C1DD031 +:10DCE00004E0012C02D119E0022C17D001EA0C014A +:10DCF00061F3070204EA030161F30F22D1B211F0CC +:10DD0000020F18BF022310D0C2F307218DF8003094 +:10DD100011F0020F18BF02211BD111E0214003EACC +:10DD20000C03194061F30702E6E711F0010F18BF79 +:10DD30000123E9D111F0040F14BF08230023E3E706 +:10DD400011F0010F18BF012103D111F0040118BF18 +:10DD500008218DF80110082B01BF000C01280420B8 +:10DD60008DF80000BDF8000038BC70474FF0000C83 +:10DD7000082902D0042909D011E001280FD104207C +:10DD8000907082F803C0138001207047012806D0EC +:10DD90000820907082F803C0138001207047002093 +:10DDA0007047162A10D12A220C2818BF0D280FD030 +:10DDB0004FF0230C1F280DD031B10878012818BF6F +:10DDC000002805D0162805D0002070470120704794 +:10DDD0001A70FBE783F800C0F8E7012908D0022990 +:10DDE0000BD0042912BF082940F6A660704707E04F +:10DDF000002804BF40F2E240704740F6C41070476C +:10DE000000B5FFDF40F2E24000BD000040787047FF +:10DE100030B50546007801F00F0220F00F001043E6 +:10DE20002870092912D2DFE801F005070507050966 +:10DE3000050B0F0006240BE00C2409E0222407E068 +:10DE400001240020E87003E00E2401E00024FFDF3D +:10DE50006C7030BD007800F00F0070470A68C0F8A1 +:10DE600003208988A0F807107047D0F803200A60C3 +:10DE7000B0F80700888070470A68C0F809208988D0 +:10DE8000A0F80D107047D0F809200A60B0F80D0016 +:10DE9000888070470278402322F0400203EA811113 +:10DEA0001143017070470078C0F38010704702780A +:10DEB000802322F0800203EAC111114301707047F0 +:10DEC0000078C009704770B514460E4605461F2AF3 +:10DED00088BFFFDF2246314605F10900F0F7A5FAB9 +:10DEE000A01D687070BD70B544780E460546062CBE +:10DEF00038BFFFDFA01F84B21F2C88BF1F2422461B +:10DF000005F109013046F0F790FA204670BD70B572 +:10DF100014460E4605461F2A88BFFFDF22463146BB +:10DF200005F10900F0F781FAA01D687070BD09685D +:10DF3000C0F80F1070470A88A0F81320897841753F +:10DF4000704790F8242001F01F0122F01F021143B6 +:10DF500080F824107047072988BF072190F82420F3 +:10DF6000E02322F0E00203EA4111114380F824107B +:10DF700070471F3008F097B810B5044600F009FB51 +:10DF8000002818BF204410BDC17811F03F0F1BBFFF +:10DF9000027912F0010F0022012211F03F0F1BBF86 +:10DFA000037913F0020F002301231A4402EB42020B +:10DFB000530011F03F0F1BBF027912F0080F00222F +:10DFC000012203EB420311F03F0F1BBF027912F055 +:10DFD000040F00220122134411F03F0F1BBF0279EE +:10DFE00012F0200F0022012202EBC20203EB4203D7 +:10DFF00011F03F0F1BBF027912F0100F0022012217 +:10E0000002EB42021A4411F03F0F1BBF007910F0DF +:10E01000400F00200120104410F0FF0014BF012128 +:10E0200000210844C0B2704770B50278417802F010 +:10E030000F02082A4DD2DFE802F004080B4C4C4CCA +:10E040000F14881F1F280AD943E00C2907D040E08D +:10E05000881F1F2803D93CE0881F1F2839D80120BA +:10E0600070BD4A1EFE2A34D88446C0780025820935 +:10E07000032A09D000F03F04601C884204D860469F +:10E08000FFF782FFA04201D9284670BD9CF803002B +:10E090004FF0010610F03F0F1EBF1CF10400007886 +:10E0A00010F0100F13D064460421604600F071FA9E +:10E0B000002818BF14EB0000E6D0017801F03F0102 +:10E0C0002529E1D280780221B1EB501FDCD3304604 +:10E0D00070BD002070BD70B50178012501F00F0101 +:10E0E000002404290AD007290DD008291CBF0020CC +:10E0F00070BD40780E2836D0204670BD4078801F15 +:10E100001F2830D9F8E7844640789CF803108A0924 +:10E11000032AF1D001F03F06711C8142ECD8604621 +:10E12000FFF732FFB042E7D89CF8030010F03F0F32 +:10E130001EBF1CF10400007810F0100F13D06646CB +:10E140000421604600F025FA002818BF16EB0000F5 +:10E15000D2D0017801F03F012529CDD2807802216B +:10E16000B1EB501FC8D3284670BD10B4017801F040 +:10E170000F01032920D0052921D14478B0F81910C6 +:10E18000B0F81BC0B0F81730827D222C17D10629B9 +:10E1900015D3B1F5486F98BFBCF5FA7F0FD272B1B5 +:10E1A000082A98BF8A420AD28B429CBFB0F81D0051 +:10E1B000B0F5486F03D805E040780C2802D010BCB9 +:10E1C0000020704710BC012070472DE9F0411F4628 +:10E1D00014460D00064608BFFFDF2146304600F01A +:10E1E000D8F9040008BFFFDF30193A462946BDE8D8 +:10E1F000F041F0F71AB9C07800F03F007047C02234 +:10E2000002EA8111C27802F03F021143C1707047E7 +:10E21000C07880097047C9B201F00102C1F3400320 +:10E220001A4402EB4202C1F3800303EB4202C1F342 +:10E23000C00302EB4302C1F3001303EB43031A4490 +:10E24000C1F3401303EBC30302EB4302C1F380139A +:10E250001A4412F0FF0202D0521CD2B20171C378EC +:10E2600002F03F0103F0C0031943C170511C41701B +:10E2700070472DE9F0410546C078164600F03F048E +:10E280001019401C0F46FF2888BFFFDF28193246AF +:10E290003946001DF0F7C9F8A019401C6870BDE8A8 +:10E2A000F081C178407801F03F01401A401E80B2F1 +:10E2B000704710B590F803C00B460CF03F0144784E +:10E2C0000CF03F0CA4EB0C0CACF1010C1FFA8CF41D +:10E2D000944288BF14462BB10844011D22461846BB +:10E2E000F0F7A3F8204610BD4078704700B50278DB +:10E2F00001F0030322F003021A430270012914BF44 +:10E300000229002104D0032916BFFFDF012100BD2F +:10E31000417000BD00B5027801F0030322F0030252 +:10E320001A430270012914BF0229002104D00329D5 +:10E3300016BFFFDF012100BD417000BD007800F075 +:10E3400003007047417841B1C078192803D2C04A10 +:10E35000105C884201D1012070470020704730B521 +:10E3600001240546C17019293CBFB948445C02D359 +:10E37000FF2918BFFFDF6C7030BD70B515460E4623 +:10E3800004461B2A88BFFFDF65702A463146E01C21 +:10E39000BDE87040F0F749B8B0F807007047B0F832 +:10E3A00009007047C172090A01737047B0F80B0089 +:10E3B000704730B4B0F80720B0F809C0B0F80530A5 +:10E3C0000179941F40F67A45AC4298BFBCF5FA7FBC +:10E3D0000ED269B1082998BF914209D293429FBFDA +:10E3E000B0F80B00B0F5486F012030BC98BF704703 +:10E3F000002030BC7047001D07F055BE021D0846C6 +:10E40000114607F050BEB0F8090070470079704718 +:10E410000A68426049688160704742680A608068A3 +:10E4200048607047098881817047808908807047FB +:10E430000A68C0F80E204968C0F812107047D0F87A +:10E440000E200A60D0F81200486070470968C0F8D2 +:10E4500016107047D0F81600086070470A684260CE +:10E4600049688160704742680A6080684860704708 +:10E470000968C1607047C0680860704700797047DC +:10E480000A68426049688160704742680A60806833 +:10E49000486070470171090A417170478171090A2A +:10E4A000C17170470172090A417270478172090A8D +:10E4B000C172704780887047C08870470089704774 +:10E4C0004089704701891B2924BF4189B1F5A47F88 +:10E4D00007D381881B2921BFC088B0F5A47F012004 +:10E4E0007047002070470A68426049688160704741 +:10E4F00042680A60806848607047017911F0070F30 +:10E500001BBF407910F0070F0020012070470179F0 +:10E5100011F0070F1BBF407910F0070F00200120FA +:10E5200070470171704700797047417170474079B9 +:10E5300070478171090AC1717047C088704745A250 +:10E5400082B0D2E90012CDE900120179407901F0E0 +:10E55000070269461DF80220012A07D800F00700CB +:10E56000085C01289EBF012002B07047002002B065 +:10E570007047017170470079704741717047407969 +:10E58000704730B50C460546FB2988BFFFDF6C702D +:10E5900030BDC378024613F03F0008BF7047052026 +:10E5A000127903F03F0312F0010F36D0002914BF97 +:10E5B0000B20704712F0020F32D0012914BF801DCA +:10E5C000704700BF12F0040F2DD0022914BF401C69 +:10E5D000704700BF12F0080F28D0032914BF801C19 +:10E5E000704700BF12F0100F23D0042914BFC01CC5 +:10E5F000704700BF12F0200F1ED005291ABF12303D +:10E60000C0B2704712F0400F19D006291ABF401C43 +:10E61000C0B27047072918D114E00029CAD114E00C +:10E620000129CFD111E00229D4D10EE00329D9D19B +:10E630000BE00429DED108E00529E3D105E0062935 +:10E64000E8D102E0834288BF704700207047000095 +:10E6500014640200000101020102020330B490F8C8 +:10E6600064508C88B1F808C015F00C0F1BD000BFA7 +:10E67000B4F5296F98BF4FF4296490F8655015F0F0 +:10E680000C0F17D0BCF5296F98BF4FF4296C4A883E +:10E69000C988A0F84420A0F84810A0F84640A0F887 +:10E6A0004AC030BC7047002B1CBF157815F00C0F0A +:10E6B000DED1E2E7002B1CBF527812F00C0FE1D143 +:10E6C000E5E7DDF800C08181C2810382A0F812C0B5 +:10E6D00070471B2202838282C28182814280028132 +:10E6E000028042848284828359B14FF4296141833C +:10E6F000C18241820182C18041818180C1840185C2 +:10E7000070474FF4A4714183C18241820182C1806C +:10E7100041818180C18401857047F0B4B0F8482000 +:10E72000818F468EC58E8A4228BF0A4690F86510B2 +:10E730004FF0000311F00C0F18BF4FF4296106D100 +:10E74000B0F84AC0B0F840108C4538BF61464286E8 +:10E75000C186048FB0F83AC0944238BF14468C4545 +:10E7600038BF8C460487A0F83AC0B2420ABFA9421B +:10E770004FF0010C4FF0000C058EB0F84410C28F22 +:10E78000848E914228BF114690F8642012F00C0F3D +:10E7900018BF4FF4296206D1B0F84660B0F84220A5 +:10E7A000964238BF324690F85A60022E0AD001864F +:10E7B0008286A9420ABFA2420120002040EA0C0042 +:10E7C000F0BC70478D4238BF2946944238BF22467C +:10E7D00080F85A30EBE7508088899080C889D080D3 +:10E7E000088A1081488A508101201070704730B427 +:10E7F00002884A80B0F830C0A1F804C0838ECB8074 +:10E80000428E0A81C48E4C81B0F85650A54204BF96 +:10E81000B0F85240944208D1B0F858409C4202BF30 +:10E82000B0F854306345002301D04FF001030B735F +:10E8300000F13003A0F852201A464B89D3848B880C +:10E840009384CA88A0F858204FF00100087030BCAB +:10E85000704730B404460A46088E91F864104FF4AD +:10E86000747311F00C0F1CBF03EB801080B21ED02C +:10E87000918E814238BF0846118F92F865C01CF016 +:10E880000C0F1CBF03EB811189B218D0538F8B4240 +:10E8900038BF194692F866301CF00C0F08BF0023F1 +:10E8A000002C0CBF0122002230BCFFF7C3B80229A4 +:10E8B00007BF80003C30C000703080B2D8E7BCF1A8 +:10E8C000020F07BF89003C31C900703189B2DDE712 +:10E8D0002DE9F041044606F0D3FCC8B9FE4F786834 +:10E8E00090F8221001260025012914D00178012971 +:10E8F0001BD090F8281001291CBF0020BDE8F08132 +:10E90000657018212170D0F82A10616080F82850B5 +:10E910000120BDE8F081657007212170416A6160C6 +:10E9200080F822500120BDE8F0816570142121702B +:10E93000811C2022201DEFF778FD257279680D706B +:10E9400081F82850E54882888284C26B527B80F827 +:10E95000262080F82260C86B0088F4F732FCF4F7B8 +:10E96000D8F8D5E7DC4840680178002914BF8088D2 +:10E970004FF6FF70704730B5D74C83B00D46207806 +:10E980007F2808BFFFDF94F900307F202070D4F883 +:10E9900004C09CF85000062808BF002205D09CF84F +:10E9A000500008280CBF022201229CF85400CDE937 +:10E9B000000302929CF873309CF880200CF1320125 +:10E9C000284606F0C9FC03B0BDE8304006F059BE49 +:10E9D0002DE9F04106F099FC002818BF06F01EFC56 +:10E9E000BD4C606800F1840290F87610895C80F874 +:10E9F0008010002003F07CF828B3F9F721F8606854 +:10EA0000B74990F855000D5C2846F8F785FD606819 +:10EA10004FF0000680F8735090F8801011F00C0F42 +:10EA20000CBF25200F20F8F757FC606890F8801085 +:10EA30000120F8F7F3FD606890F84010032918BF33 +:10EA400002290FD103E0BDE8F04101F02FB990F8A1 +:10EA500076108430085C012804D101221146002080 +:10EA6000F9F7D5F8F9F7A3F8606890F88050012D10 +:10EA700007BF0127032100270521A068FEF7FCF846 +:10EA8000616881F8520040B1002F18BF402521D0A5 +:10EA9000F8F775F92846F9F76BF86068806DF8F7B4 +:10EAA000DBFF606890F85410FF291CBF6D30FEF743 +:10EAB0001CF8FF21606880F8531080F8541080F82B +:10EAC000626080F8616080F87D60062180F85010F7 +:10EAD000BDE8F08115F00C0F14BF55255025D7E780 +:10EAE00070B57D4C0646606800F150052046806890 +:10EAF00041B1D0F80510C5F81D10B0F80900A5F80F +:10EB0000210003E005F11D01FFF7AFF9A068FFF751 +:10EB1000CAF985F82400A0680021032E018002D0E4 +:10EB2000052E04D03DE00321FFF772F939E00521FD +:10EB3000FFF76EF96068C06B00F10E01A068FFF787 +:10EB4000F6F96068C06B00F11201A068FFF7F3F9F5 +:10EB5000D4E90110CA6B527D8275CA6BD28AC27524 +:10EB6000120A0276CA6B52884276120A8276CA6B01 +:10EB70009288C276120A0277CA6BD2884277120A4A +:10EB80008277C96B0831FFF7F4F96068C06B017ECA +:10EB9000A068FFF7D6F9606890F88610A068FFF7C4 +:10EBA000DAF905F11D01A068FFF766F995F8241060 +:10EBB000A068FFF77CF9606800F1320590F83160D9 +:10EBC00090F8511091B190F84010032906D190F8B7 +:10EBD0003910002918BF90F8560001D190F8530061 +:10EBE000FEF799F800281CBF012605462946A068B3 +:10EBF000FFF734F93146A068BDE87040FFF74AB925 +:10EC00003549496881F84B00704770B5324D002492 +:10EC10000126A8606968A1F8814081F8834081F8E5 +:10EC2000506091F85020022A1FBF91F8501001291E +:10EC3000FFDF70BD06F007FB6868047080F82240B3 +:10EC400080F8284090F8520030B1F8F79BFFF8F7B1 +:10EC5000AAF8686880F852406868072180F84A403E +:10EC600080F8396080F8404080F8554080F84B408B +:10EC700080F87D4080F8381070BD2DE9F041164CC9 +:10EC8000054686B0606890F85000012818BF022839 +:10EC900005D003281EBF0C2006B0BDE8F081687ABD +:10ECA000022839D0F8F75AFB0220F8F7CFFE0D49B9 +:10ECB00001F10C0090E80D108DE80D10D1E907016D +:10ECC000CDE904016846F8F7AFFE606890F94B00A3 +:10ECD000F8F714FCA06807E0780100204411002038 +:10ECE0003364020030640200F8F7B3FEFC48F8F722 +:10ECF00087FEFC48F8F708FC606890F83110323065 +:10ED0000F8F789FB0F210720F8F7A3FB606890F85C +:10ED10003900E0B1FDF772FF6168287A01F18402E1 +:10ED200081F87600287A805C81F8800068688865C0 +:10ED30002A68CA65687A68B1012824D005250228A6 +:10ED400008BF81F850506FD0032878D080E0FDF7DD +:10ED500010FFE1E7E44B91F83850002291F855009C +:10ED6000401CA3FB006C4FEA5C0CACEB8C0C6044C9 +:10ED700081F8550025FA00F010F0010F03D1501C66 +:10ED8000C2B2032AEAD3002681F87D6091F84900D7 +:10ED9000002804BF91F85100002841D0F6F746FA48 +:10EDA000074660683946406CF6F72FFFDFF83C8372 +:10EDB000054690FBF8F008FB105041423846F5F745 +:10EDC0001CFF6168486495FBF8F08A6F10448867FF +:10EDD000FDF74CFE01466068826F914220D847647F +:10EDE000866790F8510000281CBF0120FDF760FFE6 +:10EDF0000121606890F84A20002A1CBF90F8492041 +:10EE0000002A0DD090F8313000F13202012B04D1EC +:10EE1000527902F0C002402A08D03230F9F744FC9F +:10EE20006168042081F8500012E008E00125FDF738 +:10EE300070FF61682A463231F9F7FEFBF0E7002ADD +:10EE400018BFFFDF012000F089FF606880F8505094 +:10EE500006B00020BDE8F08170B5A54D686890F857 +:10EE6000501004292ED005291CBF0C2070BD90F82D +:10EE70007D100026002990F883104FEA511124D00C +:10EE8000002908BF012407D0012908BF022403D0AC +:10EE9000022914BF00240824C06D00281CBF0020D4 +:10EEA00000F05CFF6868806DF8F7D6FD686890F840 +:10EEB0004010022943D0032904BF90F86C100129A7 +:10EEC00041D04DE0FFF784FD52E0002908BF012446 +:10EED00007D0012908BF022403D0022914BF00244F +:10EEE0000824C06D00281CBF002000F037FF6868B0 +:10EEF000806DF8F7B1FD686890F84010022906D0DF +:10EF0000032904BF90F86C10012904D010E090F898 +:10EF10006C1002290CD1224614F00C0F04D090F88A +:10EF20004C00012808BF042201210020F8F76FFEE1 +:10EF30006868072180F8804080F8616016E090F8EA +:10EF40006C1002290CD1224614F00C0F04D090F85A +:10EF50004C00012808BF042201210020F8F757FEC9 +:10EF60006868082180F8804080F8616080F850105F +:10EF7000002070BD5E49002210F0010F496802D0E8 +:10EF8000012281F8842010F0080F03D011440820DA +:10EF900081F88400002070475549496881F848008D +:10EFA000704710B5524C636893F83030022B14BF91 +:10EFB000032B00280BD100291ABF022901200020B1 +:10EFC0001146FDF756FD08281CBF012010BD6068E2 +:10EFD00090F83000002816BF022800200120BDE86C +:10EFE0001040F9F7E9BA4248406890F8300000282C +:10EFF00016BF022800200120F9F7DEBA3C49496813 +:10F0000081F8300070473A49496881F84A007047F2 +:10F0100070B5374C616891F83000002816BF02289F +:10F020000020012081F8310001F13201F9F7AEFA38 +:10F03000606890F83010022916BF032901210021D1 +:10F0400080F8511090F8312000F132034FF00005A4 +:10F05000012A04BF5B7913F0C00F0AD000F132031C +:10F06000012A04D15A7902F0C002402A01D00022BC +:10F0700000E0012280F84920002A04BF002970BD69 +:10F080008567F6F7D3F86168486491F85100002865 +:10F090001CBF0020FDF70CFE0026606890F84A10A7 +:10F0A00000291ABF90F84910002970BD90F831204E +:10F0B00000F13201012A04D1497901F0C00140294F +:10F0C00005D02946BDE870403230F9F7EDBAFDF7BA +:10F0D00020FE61683246BDE870403231F9F7ACBAC3 +:10F0E0003064020036640200ABAAAAAA40420F00B4 +:10F0F0007801002070B5FF4D0C4600280CBF01239D +:10F100000023696881F8393081F842004FF0080027 +:10F1100081F856000CD1002C1ABF022C01200020CF +:10F120001146FDF7A6FC6968082881F8560001D051 +:10F13000002070BD022C14BF032C1220F8D170BD2A +:10F14000002818BF112070470328EA4A526808BFF8 +:10F15000D16382F840000020704710B5E54C60682C +:10F1600090F8401003291CBF002180F8601001D0E6 +:10F17000002010BD0123C16B1A460020FEF763FC7E +:10F180006168CA6B526A904294BF0120002081F8E6 +:10F190006000EDE7D748416891F84000032804D0AB +:10F1A000012818BF022807D004E091F84200012886 +:10F1B00008BF70470020704791F84100012814BF34 +:10F1C00003280120F6D1704770B5F8F7C5FCF8F7B1 +:10F1D000A4FCF8F76BFBF8F719FCC64C0025606837 +:10F1E00090F8520030B1F8F7CDFCF7F7DCFD60681D +:10F1F00080F8525060680121A0F8815080F8835057 +:10F2000080F8501080F82850002070BDB94810B523 +:10F210004068643006F0EBFB002010BDB5480121CA +:10F22000406890F84020032A03BF80F82A10C26B80 +:10F230001288002218BF80F82A20828580F82810C2 +:10F240007047AC49496881F886007047017800230F +:10F2500011F0010FA749496809D04278032A08BF75 +:10F26000CB6381F84020012281F884201346027884 +:10F2700012F0040F0CD082784FF0000C032A08BF64 +:10F28000C1F83CC081F840200B44082283F8842058 +:10F29000C27881F830200279002A16BF022A0123A1 +:10F2A000002381F8393081F84120427981F83820F3 +:10F2B000807981F848004FF0000070478D48406821 +:10F2C0008030704770B58B4C06460D46606890F8EC +:10F2D0005000032818BFFFDF022E1EBF032EFFDFE2 +:10F2E00070BD002D18BF06F0DBF900216068A0F8A2 +:10F2F000811080F88310012180F8501070BD00F05B +:10F30000D5BC2DE9F0477B4C0646894660684FF036 +:10F310000108072E90F8397038BF032540D3082E16 +:10F3200084BF0020BDE8F08790F85010062908BF80 +:10F33000002105D090F8501008290CBF02210121AE +:10F3400090F8800005F0E8FF002873D1A068C1782C +:10F3500011F03F0F12D0027912F0010F0ED0616848 +:10F360004FF0050591F85220002A18BFB9F1000F9F +:10F3700016D091F88010012909D011E011F03F0F4B +:10F380001ABF007910F0100F002F53D14CE04FF04E +:10F3900001024FF00501FDF7B4FB616881F85200EE +:10F3A000A16808782944C0F3801030B1487900F092 +:10F3B000C000402808BF012000D00020616891F8FB +:10F3C0005210002918BF002807D0FDF7B5FB0146F1 +:10F3D000606880F8531080F86180606890F853107E +:10F3E000FF292AD080F854100846FDF7B2FB40EA06 +:10F3F0000705606890F85320FF2A18BF002D10D031 +:10F40000072E0ED3A068C17811F03F0F09D0017903 +:10F4100011F0020F05D00B21FDF720FC606880F889 +:10F4200062802846BDE8F087FDF75EF9002808BF36 +:10F43000BDE8F0870120BDE8F087A36890F8392087 +:10F4400059191B78C3F3801C00F153036046FDF784 +:10F45000B0F90546CDE72DE9F043264C87B0A0680A +:10F46000FEF7D6FE7F264FF00108002558B102278F +:10F4700001287DD0022800F0EF80F8F717FA07B0D6 +:10F480000620BDE8F083F8F711FA616891F84000B2 +:10F49000032800F01581A068C27812F03F0F05D054 +:10F4A000037913F0100F18BF012700D10027002F98 +:10F4B00014BF0823012312F03F0F00F001810079EF +:10F4C00033EA000240F0FC8010F0020F08D091F8FF +:10F4D0008000002105F09EFE002808BF012000D01A +:10F4E00000208DF80C508DF810508DF814504FF00E +:10F4F000FF0801E078010020D0B105AA03A904A803 +:10F5000000F07AFC606890F831809DF80C000028CB +:10F5100018BF48F002080BD1A068FEF7D1FC814665 +:10F520000121A068FEF728FD4946F7F77EFF28B3C2 +:10F53000FFB1012000F0DDFB002852D020787F28A9 +:10F5400008BFFFDF94F900102670606890F854201F +:10F55000CDE90021029590F8733090F8802000F1F9 +:10F560003201404605F0F8FE606880F86C50A3E078 +:10F5700038E041460020FFF7FEF9A1E0606890F80E +:10F580004100032818BF02282BD19DF81000002845 +:10F5900027D09DF80C00002823D1F7B1012000F0FE +:10F5A000A8FB00281DD020787F2808BFFFDF94F932 +:10F5B00000102670606890F85420CDE90021029573 +:10F5C00090F8733090F8802000F13201FE2005F0B1 +:10F5D000C3FE606880F86C506EE0FE210020FFF7EB +:10F5E000CAF96DE0F8F762F9A0681821C27812F044 +:10F5F0003F0F65D00279914362D10421FEF7BCFC34 +:10F60000616891F84020032A01BF8078B7EB501F52 +:10F6100091F86000002853D04FF0010000F069FB22 +:10F62000E8B320787F2808BFFFDF94F90010267028 +:10F63000606890F85420CDE90021029590F873306D +:10F6400090F8802000F13201FF2005F085FE60680F +:10F6500080F86C8030E000BFF8F728F9606890F817 +:10F66000400003282CD0A0681821C27812F03F0F68 +:10F6700026D0007931EA000022D1012000F039FBC8 +:10F6800068B120787F2808BFFFDF94F9001026704A +:10F69000606890F85420CDE90021029500E00FE069 +:10F6A00090F8733090F8802000F13201FF2005F0CF +:10F6B00053FE606880F86C7007B00320BDE8F083EB +:10F6C00007B00620BDE8F083F0B5FE4C074683B0D6 +:10F6D00060686D460078002818BFFFDF002661686B +:10F6E0008E70C86B02888A8042884A8382888A83A7 +:10F6F000C088C88381F8206047B10121A068FEF767 +:10F700003BFC0546A0680078C10907E06946A0688F +:10F71000FEF7ABFBA0680078C0F38011606801279A +:10F7200090F85120002A18BF002904D06A7902F00D +:10F73000C002402A26D090F84A20002A18BF00298B +:10F7400003D0697911F0C00F1CD000F10E0006F053 +:10F75000A1FC616891F85400FF2819D001F108025A +:10F76000C91DFDF7ABF9002808BFFFDF6068C1794C +:10F7700041F00201C171D0F86D104161B0F8711013 +:10F7800001830FE02968C0F80E10A9884182E0E7E4 +:10F79000C86B427ECA71D0F81A208A60C08B8881FB +:10F7A0004E610E8360680770C26B90F84B1082F850 +:10F7B0006710C06B0088F3F704FDF3F79BF903B003 +:10F7C000F0BD2DE9F041BF4C0546002760684FF0C1 +:10F7D00001083E4690F84000012818BF022802D0D8 +:10F7E000032818BFFFDF5DB1A068FEF71DFC18B944 +:10F7F000A068FEF770FC18B100F08FFB074645E0EB +:10F80000606890F850007F25801F06283ED2DFE810 +:10F8100000F003191924352FAA48F8F7D7F9002862 +:10F8200008BF2570F8F7B9F9606890F8520030B158 +:10F83000F8F7A8F9F7F7B7FA606880F85260F8F7B8 +:10F8400035F830E09F48F8F7C1F9002808BF257067 +:10F85000F8F7A3F905F024FFC3E09A48F8F7B6F9E2 +:10F86000002808BF2570F8F798F9F8F71FF81AE094 +:10F870009448F8F7ABF930B9257004E09148F8F7EF +:10F88000A5F90028F8D0F8F788F9AAE0102F80F041 +:10F890003881DFE807F01E9DA6AAF1F108B3F2F166 +:10F8A000F1F10C832051BDE8F041FFF791B803203E +:10F8B00002F01EF9002870D000210320FFF710F994 +:10F8C000012211461046F8F7A2F961680C2081F870 +:10F8D0005000BDE8F081606800F15005042002F09E +:10F8E00007F900287DD00E202870012002F0FDFCD1 +:10F8F000A06861680078C0F3401081F875000021AD +:10F900000520FFF7EDF87048A1684FF0200CC26B9E +:10F910000B78527B23F020030CEA42121A430A7040 +:10F92000C16B95F825304A7B1A404A73C06B282179 +:10F9300080F86610BDE8F081062002F0D9F80028B2 +:10F940004FD0614D0F2085F85000022002F0CDFC11 +:10F950006068012190F880200846F8F758F9A068FF +:10F9600061680078C0F3401081F87500012105201E +:10F97000FFF7B6F8E86B80F80D80A068017821F0F9 +:10F9800020010170F8F715FD002818BFFFDF2820BF +:10F99000E96B81F86600BDE8F08122E0052002F005 +:10F9A000A7F8F0B101210320FFF79AF8F8F701FD5D +:10F9B000002818BFFFDF6068012190F8802008460A +:10F9C000F8F725F961680D2081F85000BDE8F08155 +:10F9D0006068A0F8816080F8836080F85080BDE89E +:10F9E000F081BDE8F04100F061B96168032081F861 +:10F9F0005000BDE8F041082002F077BC606890F844 +:10FA00008310490908BF012507D0012908BF022535 +:10FA100003D0022914BF00250825C06D00281CBF93 +:10FA2000002000F09BF96068806DF8F715F86068B9 +:10FA300090F84010022906D0032904BF90F86C10FA +:10FA4000012904D010E090F86C1002290CD12A464C +:10FA500015F00C0F04D090F84C00012808BF0422C8 +:10FA600001210020F8F7D3F86068072180F8805062 +:10FA700080F8616041E000E043E0606890F8831046 +:10FA8000490908BF012507D0012908BF022503D075 +:10FA9000022914BF00250825C06D00281CBF0020C6 +:10FAA00000F05CF96068806DF7F7D6FF606890F849 +:10FAB000401002290AD0032904BF90F86C100129D4 +:10FAC00008D014E0780100204411002090F86C1058 +:10FAD00002290CD12A4615F00C0F04D090F84C00E6 +:10FAE000012808BF042201210020F8F790F860687F +:10FAF000082180F8805080F8616080F85010BDE8DF +:10FB0000F081FFDFBDE8F08170B5FE4C606890F8D1 +:10FB1000503000210C2B38D001220D2B40D00E2B61 +:10FB200055D00F2B1CBFFFDF70BD042002F0DDFBA2 +:10FB3000606890F880100E20F7F7CEFB606890F8B0 +:10FB4000800010F00C0F14BF282100219620F7F739 +:10FB5000A1FFF8F72CF86068052190F88050A068A4 +:10FB6000FDF78AF8616881F8520048B115F00C0F72 +:10FB70000CBF50255525F7F702F92846F7F7F8FF8F +:10FB800061680B2081F8500070BDF8F710F8002173 +:10FB90009620F7F77FFF6168092081F8500070BD5B +:10FBA00090F88010FF20F7F797FB606890F88000CE +:10FBB00010F00C0F14BF282100219620F7F76AFFE0 +:10FBC000F7F7F5FF61680A2081F8500070BDA0F8D2 +:10FBD000811080F8831080F850200020FFF774FD1A +:10FBE000BDE87040032002F080BB70B5C54C606872 +:10FBF00090F850007F25801F062828BF70BDDFE8E1 +:10FC000000F0171F1D032A11BE48F7F7DFFF002879 +:10FC100008BF2570F7F7C1FFF7F748FEBDE8704051 +:10FC2000FEF7D6BEB748F7F7D1FFC8B9257017E081 +:10FC3000B448F7F7CBFF40B9257006E005F030FD7A +:10FC4000B048F7F7C3FF0028F6D0F7F7A6FFBDE8E6 +:10FC5000704000F02BB8AB48F7F7B8FF0028E5D0AC +:10FC6000F7F79BFF60680021643005F071FEBDE886 +:10FC7000704000F01BB870B5A24C06460D46012935 +:10FC800008D0606890F880203046BDE87040134688 +:10FC900002F077BBF7F747FA61680346304691F800 +:10FCA00080202946BDE8704002F06BBB70B5F7F7C5 +:10FCB00053FFF7F732FFF7F7F9FDF7F7A7FE914C7F +:10FCC0000025606890F8520030B1F7F75BFFF7F756 +:10FCD0006AF8606880F852506068022180F850101D +:10FCE000A0F8815080F88350BDE87040002002F0F9 +:10FCF000FCBA70B5834D06460421A868FEF73CF9AE +:10FD0000044605F002FB002808BF70BD207800F013 +:10FD10003F00252814D2F7F74CFA217811F0800F14 +:10FD20000CBF1E214FF49671B4F80120C2F30C02EF +:10FD300012FB01F10A1AB2F5877F28BF814201D276 +:10FD4000002070BD68682188A0F88110A17880F833 +:10FD500083103046BDE8704001F0CABE2DE9F04185 +:10FD6000684C0746606800F1810690F883004009FE +:10FD700008BF012507D0012808BF022503D00228AB +:10FD800014BF00250825F7F75BFE307800F03F062A +:10FD90003046F7F7C1FB606880F8736090F86C003C +:10FDA00002280CBF4020FF202946F7F795FA27B11B +:10FDB00029460120F7F777FC05E060682A46C16D07 +:10FDC0000120F7F7B9FCF7F7F2FE0521A068FCF770 +:10FDD00053FF6168002881F8520008BFBDE8F08138 +:10FDE00015F00C0F0CBF50245524F6F7C8FF204621 +:10FDF000BDE8F041F7F7BCBE2DE9F74F414C0025B7 +:10FE0000914660688A4690F8510000280CBF4FF078 +:10FE100001084FF00008A0680178CE090121FEF723 +:10FE2000ABF836B1407900F0C000402808BF012689 +:10FE300000D00026606890F85210002961D090F838 +:10FE400040104FF0000B032906D190F8391000291B +:10FE500018BF90F856700ED1A068C17811F03F0F0E +:10FE60001CBF007910F0010F02D105F09BF940B3DF +:10FE7000606890F85370FF2F18BF082F21D03846C4 +:10FE8000FCF7D8FB002818BF4FF00108002E38D02F +:10FE9000606890F8620030B1FCF759FE0546606872 +:10FEA00080F862B02DE03846FCF7FFFD05460121E1 +:10FEB000A068FEF761F801462846F8F78BFB054677 +:10FEC0001FE0F6B1606890F86100D0B9A068C17811 +:10FED00011F03F0F05D0017911F0010F18BF0B2170 +:10FEE00000D105210022FCF70CFE616881F8520068 +:10FEF00038B1FCF721FEFF2803D06168012581F8A5 +:10FF0000530001E0780100208AF800500098067044 +:10FF100089F8008003B0BDE8F08F2DE9F04FFF4C69 +:10FF200087B00025606890F850002E46801F4FF083 +:10FF30007F08062880F0D581DFE800F00308088BF1 +:10FF4000FDDB00F0F8FB054600F0CCB9F348F7F70D +:10FF50003DFE002808BF84F80080F7F71EFEA06869 +:10FF6000FDF778FF0546072861D1A068FEF750F934 +:10FF70000146606890F86C208A4258D190F8501081 +:10FF8000062908BF002005D090F8500008280CBFB3 +:10FF90000220012005F0C4F970B90321A068FDF723 +:10FFA000EBFF002843D001884078C1F30B01000922 +:10FFB00005F0B5FC00283AD000212846FFF7A1F94A +:10FFC000A0B38DF80C608DF808608DF8046062684D +:10FFD000FF2592F8500008280CBF02210121A068DB +:10FFE000C37813F03F0F1CBF007910F0020F12D03E +:10FFF00092F8800005F00EF968B901AA03A902A8D9 +:020000040002F8 +:10000000FFF7FAFE606890F831509DF80C00002868 +:1000100018BF45F002052B469DF804209DF80810F6 +:100020009DF80C0000F0D5F9054603E0FFE705F068 +:1000300037FB0225606890F85200002800F05281DA +:10004000F7F7A0FDF6F7AFFE606880F8526000F0A9 +:1000500049B9A068FDF7FEFE0646A1686068CA7847 +:1000600090F86D309A4221D10A7990F86E309A4218 +:100070001CD14A7990F86F309A4217D18A7990F85A +:1000800070309A4212D1CA7990F871309A420DD1EB +:100090000A7A90F872309A4208D1097890F8740080 +:1000A000C1F38011814208BF012500D00025F7F778 +:1000B000FDFB9A48F7F78AFD002808BF84F8008006 +:1000C000F7F76BFD042E11D185B120787F2808BF8A +:1000D000FFDF94F9003084F80080606890F87320A6 +:1000E00090F87D1090F8540005F0A8FB062500F06C +:1000F000F9B802278948F7F769FD002808BF84F896 +:100100000080F7F74AFDA068FDF7A4FE0546A06849 +:10011000FEF77EF8082D08BF00287CD1A0684FF0BC +:100120000301C27812F03F0F75D0007931EA000068 +:1001300071D1606800E095E000F1500890F8390056 +:10014000002814BF98F8066098F803604FF0000983 +:1001500098F8020078B1FCF7EFFC0546FF280AD0BA +:100160000146A068401DFCF7C0FCB5420CBF4FF033 +:1001700001094FF000090021A068FDF7FDFE0622ED +:1001800008F11D01EEF724F940B9A068FDF78BFED8 +:1001900098F82410884208BF012000D0002059EAB6 +:1001A00000095DD0606800F1320590F831A098F840 +:1001B000010038B13046FCF7AEFD00281CBF0546F3 +:1001C0004FF0010A4FF00008A06801784FEAD11BF8 +:1001D0000121FDF7D1FEBBF1000F07D0407900F0FF +:1001E000C000402808BF4FF0010B01D04FF0000BBA +:1001F0000121A068FDF7C0FE06222946EEF7E8F8C7 +:1002000030B9A068FDF75CFE504508BF012501D05C +:100210004FF0000500E023E03BEA050018BFFF2E89 +:100220000DD03046FCF741FC060008D00121A06843 +:10023000FDF7A2FE01463046F8F7CCF9804645EAC4 +:10024000080019EA000F0BD060680121643005F046 +:100250007FFB01273846FFF737FA052002F045F803 +:100260003D463FE002252D48F7F7B0FC002808BFC7 +:1002700084F80080F7F791FCA068FDF7EBFD0646D7 +:10028000A068FDF7C5FF072E08BF00282AD1A06887 +:100290004FF00101C27812F03F0F23D00279914351 +:1002A00020D1616801F150060021FDF765FE0622AC +:1002B00006F11D01EEF78CF8A0B9A068FDF7F3FD7B +:1002C00096F8241088420DD160680121643005F051 +:1002D0003FFBFF21022000F009F8002818BF03258A +:1002E00000E0FFDF07B02846BDE8F08F2DE9F043BE +:1002F0000A4C0F4601466068002683B090F87D20C6 +:10030000002A35D090F8500008280CBF022501259E +:10031000A168C87810F03F0F02E0000078010020CB +:10032000FD484FF000084FF07F0990F900001CBF16 +:10033000097911F0100F22D07F2808BFFFDF94F950 +:10034000001084F80090606890F85420CDE90021F6 +:10035000029590F8733090F8802000F13201384611 +:1003600004F0FAFF05F0E4FA10B305F08AF92CE086 +:10037000002914BF0221012180F87D10C2E77F28E7 +:1003800008BFFFDF94F9001084F80090606890F8CF +:100390005420CDE90021029590F8733090F8802028 +:1003A00000F13201384604F0D7FF05F06AF90CE09D +:1003B0000220FFF79EFC30B16068012680F86C8057 +:1003C000F7F774FA01E005F06BF903B03046BDE8C9 +:1003D000F0832DE9F047D04C054684B09A46174685 +:1003E0000E46A068FDF714FF4FF00109002800F049 +:1003F000CF804FF00208012808D0022800F00E81BB +:1004000005F04EF904B04046BDE8F087A068092128 +:10041000C27812F03F0F00F059810279914340F009 +:100420005581616891F84010032906D012F0020F3F +:1004300008BFFF2118D05DB115E00021FDF79CFD3C +:1004400061680622C96B1A31EDF7C2FF48BB1EE096 +:10045000FDF736FD05460121A068FDF78DFD294613 +:10046000F6F7E3FF18B15146012000F051B960687A +:1004700090F84100032818BF022840F02781002E81 +:100480001CBFFE21012040F0438100F01FB9A0688D +:10049000FDF709FD6168C96B497E884208BF0126E6 +:1004A00000D00026A068C17811F03F0F05D0017977 +:1004B00011F0020F01D06DB338E0616891F842206D +:1004C000012A01D096B11BE0D6B90021FDF754FDF9 +:1004D00061680268C96BC1F81A208088C883A06867 +:1004E000FDF7E1FC6168C96B487609E091F85300BB +:1004F00091F85610884203D004B04046BDE8F0871A +:100500006068643005F068FA002840D004B00F201D +:10051000BDE8F08767B1FDF7D3FC05460121A0686F +:10052000FDF72AFD2946F6F780FF08B1012200E019 +:100530000022616891F84200012807D040B92EB925 +:1005400091F8533091F856108B4201D1012100E00F +:1005500000210A421BD0012808BF002E11D14FF004 +:100560000001A068FDF708FD61680268C96BC1F869 +:100570001A208088C883A068FDF795FC6168C96B64 +:1005800048766068643005F027FA0028BED19DE007 +:1005900060682F46554690F840104FF00208032936 +:1005A000AAD0A168CA7812F03F0F1BBF097911F0D9 +:1005B000020F002201224FF0FF0A90F85010082984 +:1005C0000CBF0221012192B190F8800004F022FEBC +:1005D00068B95FB9A068FDF773FC07460121A06800 +:1005E000FDF7CAFC3946F6F720FF48B1AA46514646 +:1005F0000020FFF77BFE002818BF4FF003087BE7C1 +:10060000606890F84100032818BF02287FF474AF97 +:10061000002E18BF4FF0FE0AE9D16DE7616891F82E +:100620004030032B52D0A0684FF0090CC27812F072 +:100630003F0F4BD002793CEA020C47D1022B06D087 +:1006400012F0020F08BFFF2161D0E5B35EE012F0A7 +:10065000020F4FF07F0801D04DB114E001F16400AA +:1006600005F0BAF980B320787F2842D013E067B351 +:10067000FDF726FC05460121A068FDF77DFC294613 +:10068000F6F7D3FE08B36068643005F0A5F9D8B179 +:1006900020787F282DD094F9001084F800806068BD +:1006A00090F85420CDE90021CDF8089090F87330EF +:1006B00090F8802000F13201504604F04DFE0D20EC +:1006C00004B0BDE8F08716E000E001E00220F7E7A3 +:1006D000606890F84100032818BF0228F6D1002E68 +:1006E000F4D04FF0FE014FF00200FEF744F9022073 +:1006F000E6E7FFDFCFE7FDF7E3FB05460121A06852 +:10070000FDF73AFC2946F6F790FE38B15146022033 +:10071000FEF731F9DAE7000078010020606890F810 +:100720004100032818BF0228D0D1002E1CBFFE2193 +:100730000220EDD1CAE72DE9F84F4FF00008F74845 +:10074000F7F744FA7F27F54C002808BF2770F7F722 +:1007500024FAA068FDF77EFB81460121FEF7D1FD5A +:10076000616891F88020012A14D0042A1CBF082A4D +:10077000FFDF00F0D781606890F8520038B1F7F7DA +:1007800001FAF6F710FB6168002081F8520040463C +:10079000BDE8F88F0125E24EB9F1080F3AD2DFE843 +:1007A00009F03EC00439393914FC0546F7F77EF8E4 +:1007B000002D72D0606890F84000012818BF022810 +:1007C0006BD120787F2869D122E018B391F84000DE +:1007D000022802D0012818D01CE020787F2808BF0A +:1007E000FFDF94F90000277000906068FF2190F807 +:1007F000733090F85420323004F069FF61680020B3 +:100800004FF00C0881F87D00B5E720787F2860D193 +:10081000FFDF5EE0F7F74AF84FF00608ABE74FF06E +:100820000008002800F0508191F84000022836D0DE +:1008300001284BD003289ED1A068CA6BC37892F8D8 +:100840001AC0634521D1037992F81BC063451CD1BE +:10085000437992F81CC0634517D1837992F81DC083 +:10086000634512D1C37992F81EC063450DD1037A56 +:1008700092F81FC0634508D1037892F819C0C3F3FA +:100880008013634508BF012300D0002391F8421074 +:1008900001292CD0C3B300F013B93FE019E0207850 +:1008A0007F2808BFFFDF94F9000027700090606880 +:1008B000FF2190F8733090F85420323004F007FF95 +:1008C00060684FF00C0880F87D5054E720787F284E +:1008D0009ED094F90000277000906068FF2190F886 +:1008E000733090F85420323004F0F1FE16E0002B03 +:1008F0007ED102F11A01FDF7B8FAA068FDF7D3FA2C +:100900006168C96B4876DBE0FFE796F85600082877 +:1009100070D096F8531081426AD0D5E04FF00608A7 +:1009200029E7054691F8510000280CBF4FF0010B54 +:100930004FF0000B4FF00008A06810F8092BD20907 +:1009400007D0407900F0C000402808BF4FF0010AEE +:1009500001D04FF0000A91F84000032806D191F829 +:100960003900002818BF91F8569001D191F85390A2 +:100970004846FCF79AF80090D8B34846FBF75AFE71 +:10098000002818BF4FF0010BBAF1000F37D0A06854 +:10099000A14600F10901009800E0B6E0F7F71AFE61 +:1009A0005FEA0008D9F8040090F8319018BF49F0C8 +:1009B0000209606890F84010032924D0F6F776FF0A +:1009C000002DABD0F6F741FD002808BFB8F1000FAD +:1009D0007DD020787F2808BFFFDF94F900002770C2 +:1009E00000906068494690F8733090F8542002E017 +:1009F00066E004E068E0323004F069FE8EE760688B +:100A000090F83190D5E7A168C06BCA78837E9A428E +:100A10001BD10A79C37E9A4217D14A79037F9A4241 +:100A200013D18A79437F9A420FD1CA79837F9A4240 +:100A30000BD10A7AC37F9A4207D10978407EC1F36D +:100A40008011814208BF012700D0002796F853008B +:100A5000082806D096F85610884208BF4FF00109C2 +:100A600001D04FF00009B8F1000F05D1BBF1000F24 +:100A700004D0F6F7EAFC08B1012000E000204DB1F7 +:100A800096F84210012903D021B957EA090101D093 +:100A9000012100E00021084216D0606890F8421061 +:100AA000012908BF002F0BD1C06B00F11A01A0680B +:100AB000FDF7DBF9A068FDF7F6F96168C96B4876C8 +:100AC0004FF00E0857E602E0F6F7F0FE26E7606802 +:100AD00090F84100032818BF02287FF41FAFBAF135 +:100AE000000F3FF41BAF20787F2808BFFFDF94F989 +:100AF0000000277000906068FE2190F8733090F835 +:100B00005420323004F0E3FD08E791F84810002942 +:100B100018BF00283FF47EAE0BE0000078010020F3 +:100B200044110020B9F1070F7FF474AE00283FF4A0 +:100B300071AEFEF790FC80461DE60000D0F8001173 +:100B400049B1D0E941231A448B691A448A61D0E93A +:100B50003F12D16003E0FE4AD0F8FC101162D0E9E8 +:100B60003F1009B1086170470028FCD00021816165 +:100B700070472DE9FF4F06460C46488883B040F287 +:100B8000E24148430190E08A002500FB01FA94F815 +:100B90007C0090460D2822D00C2820D024281ED07E +:100BA00094F87D0024281AD000208346069818B1B6 +:100BB0000121204603F0C0F894F8641094F8650011 +:100BC000009094F8F0200F464FF47A794AB1012A48 +:100BD00061D0022A44D0032A5DD0FFDFB5E00120B6 +:100BE000E3E7B8F1000F00D1FFDFD94814F8641F24 +:100BF000243090F83400FDF7F0F801902078F7F7F2 +:100C000087FB4D4600F2E730B0FBF5F1DFF840938B +:100C1000D9F80C0001EB00082078F7F779FB0146C2 +:100C200014F86409022816D0012816D040F63400C2 +:100C300008444AF2EF010844B0FBF5F10198D9F8F5 +:100C40001C20411A514402EB08000D18012084F8C1 +:100C5000F0002D1D78E02846EAE74FF4C860E7E78A +:100C6000DFF8EC92A8F10100D9F80810014300D197 +:100C7000FFDFB848B8F1000F016801EB0A0506D0A4 +:100C8000D9F8080000F54970A84200D9FFDF032019 +:100C900084F8F00058E094F87C20019D242A05D0C7 +:100CA00094F87D30242B01D0252A3AD1B4F8702055 +:100CB000B4F81031D21A521C12B2002A31DB94F867 +:100CC000122172B3174694F8132102B11046009016 +:100CD000022916D0012916D040F6340049F60852F0 +:100CE0008118022F12D0012F12D040F63400104488 +:100CF000814210D9081A00F5FA70B0FBF9F00544EA +:100D00000FE04846EAE74FF4C860E7E74846EEE7F9 +:100D10004FF4C860EBE7401A00F5FA70B0FBF9F049 +:100D20002D1AB8F1000F0FD0DFF82482D8F8080090 +:100D300018B9B8F8020000B1FFDFD8F8080000F5D4 +:100D40004970A84200D9FFDF05B9FFDF2946D4F872 +:100D5000F400F3F752FFC4F8F400B06000203070E4 +:100D60004FF0010886F80480204603F040F8ABF10C +:100D70000101084202D186F8058005E094F8F000F0 +:100D8000012844D003207071606A3946009A01F04E +:100D900042FBF060069830EA0B0035D02946304619 +:100DA000FCF7DEFD87B2204603F021F8B8420FD8E9 +:100DB000074686F8058005FB07F1D4F8F400F3F741 +:100DC0001CFFB06029463046FCF7CAFD384487B2A4 +:100DD0003946204602F0B0FFB068C4F8F400A06EB7 +:100DE000002811D0B4F87000B4F89420801A01B231 +:100DF000002909DD34F86C0F0144491E91FBF0F124 +:100E000089B201FB0020208507B0BDE8F08F0220E9 +:100E1000B9E72DE9F04106460C46012001F0DBFA66 +:100E2000C5B20B2001F0D7FAC0B2854200D0FFDF77 +:100E30000025082C7ED2DFE804F00461696965C6EC +:100E40008293304601F0DDFA0621F2F787F80400BC +:100E500000D1FFDF304601F0D4FA2188884200D06B +:100E6000FFDF94F8F00000B9FFDF204602F00FFE2C +:100E7000374E21460020B5607580F561FDF7E9FC2D +:100E800000F19807606AB84217D994F86500F6F740 +:100E9000F9F8014694F864004FF47A72022828D0D9 +:100EA000012828D040F6340008444AF2473108446B +:100EB000B0FBF2F1606A0844C51B21460020356191 +:100EC000FDF7C7FC618840F2E24251439830081AAE +:100ED000A0F54970706194F8652094F86410606A18 +:100EE00001F099FAA0F5CA70B061BDE8F041F4F7DD +:100EF00059BE1046D8E74FF4C860D5E7BDE8F041C9 +:100F000002F02FBEBDE8F041F6F79DBE304601F07D +:100F100078FA0621F2F722F8040000D1FFDF30460C +:100F200001F06FFA2188884200D0FFDF0122002102 +:100F3000204600E047E0BDE8F04101F089BAF6F74D +:100F400041FDF6F780FE02204FF0E02104E00000B2 +:100F5000CC11002088010020C1F88002BDE8F0819A +:100F6000304601F04EFA0621F1F7F8FF040000D1F7 +:100F7000FFDF304601F045FA2188884200D0FFDFCC +:100F800094F8F000042800D0FFDF84F8F05094F8C3 +:100F9000FA504FF6FF76202D00D3FFDFF94820F8F6 +:100FA000156094F8FA00F4F722F900B9FFDF202069 +:100FB00084F8FA002046FFF7C1FDF3480078BDE849 +:100FC000F041E1F78DBFFFDFC8E770B5ED4C0025BC +:100FD000443C84F82850E07868B1E570FEF71EF9CB +:100FE0002078042803D0606AFFF7A8FD6562E64810 +:100FF0000078E1F775FFBDE8704001F03ABA70B5CE +:10100000E04C0146443CE069F4F7FFFD6568A278D6 +:1010100090FBF5F172B140F27122B5FBF2F292B29F +:10102000A36B01FB02F6B34202D901FB123200E0CE +:101030000022A2634D43002800DAFFDF2946E06961 +:10104000F3F7DBFDE06170BD2DE9F05FFEF736F9E7 +:101050008246CC48683800F1240881684646D8F8B2 +:101060001800F3F7CAFD0146F069F4F7CEFD4FF022 +:101070000009074686F835903C4640F28D254E46DD +:101080001DE000BF0AEB06000079F5F7FBFF4AF20E +:10109000B12101444FF47A70B1FBF0F108EB860204 +:1010A0004046926811448C4207D3641A90F8351078 +:1010B000A4F28D24491C88F83510761CF6B298F8F5 +:1010C0003600B042DED8002C0FDD98F835104046CF +:1010D00008EB81018968A14207D24168C91BA94276 +:1010E00000D90D466C4288F8359098F83560C346B3 +:1010F0000AEB060898F80400F5F7C4FF01464AF227 +:10110000B12001444FF47A7AB1FBFAF298F8041056 +:10111000082909D0042909D00020131804290AD06D +:10112000082908D0252207E0082000E0022000EB73 +:1011300040002830F1E70F22521D4FF4A870082913 +:1011400013D0042914D0022915D04FF0080C282000 +:1011500012FB0C00184462190BEB860302449868DA +:10116000D84682420BD8791925E04FF0400CEFE7C2 +:101170004FF0100CECE74FF0040C1820E8E798F85B +:10118000352098F836604046B24210D2521C88F89A +:1011900035203C1B9868621984180846F5F772FFE1 +:1011A0004AF2B1210144B1FBFAF0011903E080F8E1 +:1011B0003590D8F80410D8F81C00BDE8F05FF3F7BC +:1011C0001CBD2DE9FE4F14460546FEF777F8DFF803 +:1011D000B4A10290AAF1440A50469AF835604FF043 +:1011E000000B0AEB86018968CAF83C10F4B3044688 +:1011F00000780027042825D005283ED0FFDFA04630 +:1012000039466069F3F7F9FC0746F4F70FF88146B1 +:101210003946D8F80440F4F7F8FC401E90FBF4F08F +:10122000C14361433846F3F7E8FC0146C8F81C00A7 +:101230004846F4F7EAFC002800DDFFDF012188F8CA +:1012400013108DE0D4F81490D4F8048001F07CF9E8 +:10125000070010D0387800B9FFDF796978684A460E +:101260000844414601F05CF9074600E00BE04045C8 +:10127000C5D9FFDFC3E75F46C1E7606A01F006F941 +:1012800040F6B837BBE7C1690AEB46000191408DD3 +:1012900010B35446DAF81400FFF7B1FE6168E06954 +:1012A000F3F7ABFC074684F835B0019CD0462046E6 +:1012B000DAF81410F4F7A9FC814639462046F4F711 +:1012C000A4FCD8F804200146B9FBF2F0B1FBF2F11E +:1012D000884242D0012041E0F3F7A8FFFFF78FFEDC +:1012E000FFF7B2FE9AF83510DAF804900AEB8101A4 +:1012F0000746896800913946DAF81C00F4F785FC46 +:1013000000248046484504DB98FBF9F404FB09F40B +:101310001AE0002052469AF8351007E002EB8003ED +:1013200004F28D249B68401C1C44C0B28142F5D855 +:1013300051B10120F5F7A6FE4AF2B12101444FF464 +:101340007A70B1FBF0F004440099A8EB04000C1A89 +:1013500000D5FFDFCAF83C40A7E7002088F813005B +:101360009AF802005446B8B13946E069F4F74DFCEA +:101370000146A26B40F2712042438A4206D2C4F871 +:101380003CB009E03412002084010020E06B511AC7 +:10139000884200D30846E063AF6085F800B00120C2 +:1013A0002871029F94F835003F1DC05DF5F76AFE75 +:1013B0004AF23B5101444FF47A70B1FBF0F0E16B1B +:1013C000FC300844E8602078042808D194F83500FF +:1013D00004EB4000408D0A2801D2032000E00220E7 +:1013E000687104EB4600408DC0B128466168FCF787 +:1013F000B7FA82B20020761C0CE000BF04EB40017B +:10140000B0424B8D13449BB24B8501D35B1C4B8583 +:10141000401CC0B294F836108142EFD2A8686061D7 +:10142000A06194F8350004EB4001488D401C4885CC +:1014300094F83500C05D082803D0042803D00021AB +:101440000BE0082100E0022101EB410128314FF4BB +:10145000A872082804D0042802D0022807D0282225 +:101460000A44042805D0082803D0252102E01822C8 +:10147000F6E70F21491D08280CD004280CD00228BB +:101480000CD0082011FB0020E16B884208D201201B +:10149000BDE8FE8F4020F5E71020F3E70420F1E7D8 +:1014A0000020F5E770B5FE4C061D14F8352F905D51 +:1014B000F5F7E8FD4FF47A7100F2E730B0FBF1F098 +:1014C000D4F8071045182078805DF5F760FE217884 +:1014D000895D082903D0042903D000220BE00822EB +:1014E00000E0022202EB420228324FF4A8730829DE +:1014F00004D0042902D0022907D028231344042948 +:1015000005D0082903D0252202E01823F6E70F2290 +:10151000521D08290AD004290AD002290AD008211C +:1015200012FB0131081A281A293070BD4021F7E753 +:101530001021F5E70421F3E72DE9FF4107460C46AA +:10154000012000F048FFC5B20B2000F044FFC0B2FC +:10155000854200D0FFDF204601260025D04C082818 +:1015600069D2DFE800F00430464642686865667478 +:1015700026746078002819D1FDF7A0FE009594F834 +:1015800035108DF808104188C90411D0206C0190E5 +:1015900003208DF80900C24824388560C561257490 +:1015A0006846FDF76AFB002800D0FFDFBDE8FF8139 +:1015B000FFF778FF0190E07C10B18DF80950EAE761 +:1015C0008DF80960E7E7607840B1207C08B9FDF745 +:1015D000FBFD6574BDE8FF41F3F733BDA674FDF76D +:1015E0003BFC0028E2D0FFDFE0E7BDE8FF41F6F773 +:1015F0002ABBFDF763FE4088C00407D00121032009 +:10160000FDF760FEA7480078E1F76AFC0022394642 +:101610006846FFF7D6FD38B16946384600F0EFFE60 +:101620000028C3D1FFDFC1E7E670FFF7CEFCBDE7BE +:10163000BDE8FF41C9E4FFDFB8E7994950B1012295 +:101640008A704A6840F27123B2FBF3F202EB001099 +:10165000886370470020887070472DE9F05F8946E5 +:1016600040F271218E4E484300250446706090463A +:101670002F46D0074AF2B12A4FF47A7B0FD0B9F83F +:1016800000004843B0600120F5F7FCFC00EB0A01C4 +:10169000B1FBFBF0241AB7680125A4F28D245FEAA0 +:1016A000087016D539F8151040F27120414306EB49 +:1016B00085080820C8F80810F5F7E4FC00EB0A01DB +:1016C000B1FBFBF0241AD8F80800A4F28D240744DB +:1016D0006D1CA74219D9002D17D0391BB1FBF5F0AD +:1016E000B268101AB1FBF5F205FB1212801AB06055 +:1016F000012008E0B1FBF5F306EB80029468E31AE1 +:10170000401CC0B29360A842F4D3BDE8F09F2DE91D +:10171000F041634C00262078042804D02078052866 +:1017200001D00C201AE401206070607C002538B1E3 +:10173000EFF3108010F0010F72B610D001270FE008 +:10174000FDF7BCFD074694F82000F4F7ADF8788863 +:10175000C00411D000210320FDF7B4FD0CE00027E8 +:10176000607C38B1A07C28B1FDF72EFD6574A574AE +:10177000F3F767FC07B962B694F82000F4F700FBB2 +:1017800094F8280030B184F828502078052800D03B +:10179000FFDF0C26657000F06CFE304614E4404814 +:1017A00010B5007808B1FFF7B2FF00F0D6FE3C4953 +:1017B00000202439086210BD10B53A4C58B10128F8 +:1017C00007D0FFDFA06841F66A01884200D3FFDF3F +:1017D00010BD40F6C410A060F4E7324908B50870A7 +:1017E0002F4900200870487081F82800C8700874DC +:1017F000487488742022486281F820202439487077 +:101800004FF6FF7211F1680121F81020401CC0B2A0 +:101810002028F9D30020FFF7CFFFFFF7C0FF1020EB +:10182000ADF80000012269460420FFF716FF08BD4D +:101830007FB51B4C05460E46207810B10C2004B035 +:1018400070BD95F8652095F86410686A00F0C7FED1 +:10185000C5F80401656295F8F00000B1FFDF10499A +:1018600000202439C86105212170607084F82800A7 +:10187000014604E004EB4102491C5085C9B294F8CA +:1018800036208A42F6D284F835003046FFF7D5FE7E +:101890000548F3F751FC84F82000202807D105E023 +:1018A000F01100208401002039150200FFDFF3F75A +:1018B000BDFC606194F8201001226846FFF781FCAE +:1018C00000B9FFDF94F82000694600F098FD00B9E8 +:1018D000FFDF0020B3E7F94810B5007808B1002019 +:1018E00010BD0620F1F7D4FA80F0010010BDF8B564 +:1018F000F24D0446287800B1FFDF002000902378E5 +:101900000246DE0701466B4605D06088A188ADF827 +:101910000010012211462678760706D5E088248932 +:1019200023F8114042F00802491C491E85F8361080 +:101930001946FFF792FE0020F8BD1FB511B1112026 +:1019400004B010BDDD4C217809B10C20F8E700226D +:10195000627004212170114605E000BF04EB4103D1 +:10196000491C5A85C9B294F836308B42F6D284F8B5 +:101970003520FFF762FED248F3F7DEFB84F8200043 +:10198000202800D1FFDF00F0DFFD10B1F3F74EFC9F +:1019900005E0F3F74BFC40F6B831F3F72EF9606140 +:1019A00094F8201001226846FFF70BFC00B9FFDF16 +:1019B00094F82000694600F022FD00B9FFDF002006 +:1019C000BEE770B5BD4C616A0160FFF7A0FE05007F +:1019D00002D1606AFFF7B2F800206062284670BD4D +:1019E0007FB5B64C2178052901D00C2027E7B349F3 +:1019F0002439C860606A00B9FFDF606A90F8F000BF +:101A000000B1FFDF606A90F8FA00202800D0FFDF05 +:101A1000AC48F3F791FB616A0546202881F8FA008B +:101A20000E8800D3FFDFA548443020F81560606AB7 +:101A300090F8FA00202800D1FFDF00230122684639 +:101A4000616AFFF796F8606A694690F8FA0000F05C +:101A5000D6FC00B9FFDF00206062F0E69749243928 +:101A60004870704710B540F2E24300FB03F40020D9 +:101A700000F0B5FD844201D9201A10BD002010BD30 +:101A800070B50D46064601460020FCF7E2FE04460E +:101A900096F86500F5F7F6FA014696F864004FF4FB +:101AA0007A72022815D0012815D040F63400084477 +:101AB0004AF247310844B0FBF2F1708840F27122DB +:101AC0005043C1EB4000A0F54970A54206D2214623 +:101AD00005E01046EBE74FF4C860E8E7294681428D +:101AE00004D2A54201D2204600E02846706270BDB3 +:101AF00070B50546FDF7E2FB7049007824398C6823 +:101B00009834072D30D2DFE805F0043434252C3426 +:101B1000340014214FF4A873042810D00822082898 +:101B200009D02A2102280FD011FB024000222823CD +:101B3000D118441819E0402211FB0240F8E71022A6 +:101B400011FB02402E22F3E7042211FB0240002287 +:101B50001823EDE7282100F04DFC044404F531740E +:101B600003E004F5B07400E0FFDF5448C06BA0420E +:101B700001D9012070BD002070BD70B54F4C243CD0 +:101B8000607870B1D4E904512846A268FBF713FFCE +:101B90002061A84205D0A169401B0844A061F4F768 +:101BA00001F82169A068884201D8207808B1002096 +:101BB00070BD012070BD2DE9F04F054685B0164679 +:101BC0000F461C461846F5F7E2FA05EB47014718A1 +:101BD000204600F0F7FB4AF2C5714FF47A790844C9 +:101BE0004D46B0FBF5F0384400F160083348761CF0 +:101BF00024388068304404902046F5F7C8FAA8EBF2 +:101C00000007204600F0DEFB06462046F5F73AFACC +:101C1000301AB0FBF5F03A1A182528204FF4C87690 +:101C20004FF4BF774FF0020B082C30D0042C2BD090 +:101C30000021022C2ED0082311F1280103EB830C84 +:101C40000CEB831319440A444FF0000A082C29D0E6 +:101C5000042C22D00021022C29D00546082001F5B1 +:101C6000B07100BF00EB00102844814232D2082C32 +:101C70002AD0042C1ED00020022C28D00821283085 +:101C800001EB0111084434E039461023D6E7314610 +:101C90004023D3E704231831D0E73D4640F2EE312C +:101CA0001020DFE735464FF435614020DAE70420A5 +:101CB000B431D7E738461021E2E70000F0110020E8 +:101CC00039150200130E020030464021D8E70421E6 +:101CD0001830D5E7082C4FD0042C4AD00021022C14 +:101CE0004DD0082311F12801C3EBC30000EB4310D2 +:101CF000084415182821204600F07CFB05EB400124 +:101D0000082C42D0042C3DD00026022C3FD00820C5 +:101D100016F1280600EB801006EB80000E1801205B +:101D2000FB4D8DF804008DF800A08DF805B0A86972 +:101D300006F50A760499F2F760FFCDE9020620461F +:101D4000F5F7A0F94AF23B510144B1FBF9F0301A22 +:101D5000FC38E8630298C5F84080A86195F8200037 +:101D6000694600F04CFB002800D1FFDF05B0BDE85C +:101D7000F08F39461023B7E731464023B4E70423F8 +:101D80001831B1E73E461020C4E74020C2E70420E6 +:101D90001836BFE72DE9FE4F06461C461746884613 +:101DA0004FF0010A1846F5F7F2F9D94D243DA9681C +:101DB0008A1907EB480111444718204600F002FB3E +:101DC0004FF47A7BD84600F6FB00B0FBF8F03844BD +:101DD00000F120092046F5F7DAF9A9680246A9EBD7 +:101DE0000100801B871A204600F0ECFA05462046C9 +:101DF000F5F748F9281AB0FBF8F03A1A1825282008 +:101E00004FF4C8774FF4BF78082C2DD0042C28D07D +:101E10000021022C2BD0082311F1280103EB830CA5 +:101E20000CEB831319440A44082C28D0042C21D02D +:101E30000021022C28D00546082001F5B07100BF12 +:101E400000EB0010284481422AD2082C22D0042C16 +:101E50001DD00020022C20D00821283001EB0111D8 +:101E60002CE041461023D9E739464023D6E7042326 +:101E70001831D3E7454640F2EE311020E0E73D4609 +:101E80004FF435614020DBE70420B431D8E7404609 +:101E90001021E3E738464021E0E704211830DDE770 +:101EA000082C48D0042C43D00020022C46D0082116 +:101EB00010F12800C1EBC10303EB411108441518D0 +:101EC0002821204600F096FA05EB4001082C3BD073 +:101ED000042C36D00027022C38D0082017F1280710 +:101EE00000EB801007EB80000C1804F596740C983A +:101EF000F5F7C8F84AF23B510144B1FBFBF0844DC1 +:101F0000FC30A5F12407E96B06F1FC020844B9682E +:101F10000B191A44824224D9321911440C1AFC3488 +:101F20002044B0F1807F37D2642C12D2642011E0BB +:101F300040461021BEE738464021BBE70421183057 +:101F4000B8E747461020CBE74020C9E70420183700 +:101F5000C6E720460421F3F78CFEE8B1E86B204485 +:101F6000E863E0F791FEB968293831440844CDE9C7 +:101F7000000995F835008DF8080002208DF8090059 +:101F80006846FCF77AFE00B1FFDFFCF765FF00B1A1 +:101F9000FFDF5046BDE8FE8F4FF0000AF9E71FB59E +:101FA00000F023FB5A4C607880B994F8201000228E +:101FB0006846FFF706F938B194F82000694600F04A +:101FC0001EFA18B9FFDF01E00120E070F3F739F8DD +:101FD00000206074A0741FBD2DE9F84FFDF76EF965 +:101FE0000646441CC07840090CD001280CD00228B9 +:101FF0000CD000202178824608064FF4967507D44D +:102000001E2006E00120F5E70220F3E70820F1E7B3 +:102010002846B4F80120C2F30C0212FB00F7C809ED +:1020200001D010B103E01E2501E0FFDF0025F5F728 +:10203000C0F8A7EB00092078B77909EB0508C0F3D1 +:10204000801010B120B1322404E04FF4FA7401E0A2 +:10205000FFDF00240C2F00D3FFDF2E482E4A30F87C +:102060001700211801FB0821501CB1FBF0F4F5F713 +:102070005AF8F5F707F84FF47A7100F27160B0FB87 +:10208000F1F1A9EB0100071BA7F1590040F28D21E6 +:10209000103F884211D91E4E717829B90246534625 +:1020A00021462846FFF787FD00F09FFAF2F7C9FFA7 +:1020B00000207074B074BDE8F88F307800905346FB +:1020C0002A4621463846FFF765FE0028F3D1012154 +:1020D0000220FDF7F7F8BDE8F84F60E710B50446B9 +:1020E000012903D10A482438007830B1042084F84B +:1020F000F000BDE81040F2F7A4BF00220121204605 +:1021000000F0A6F934F8700F401C2080F1E70000C1 +:10211000F0110020546402003F420F002DE9F0410D +:102120000746FDF7CBF8050000D1FFDF287810F057 +:102130000C0F01D0012100E00021F74C606A303023 +:10214000FCF7C7FA29783846FBF747FEA4F12406C6 +:102150000146A069B26802446FB32878082803D00A +:10216000042803D000230BE0082300E0022303EB44 +:10217000430328334FF4A877082804D0042802D05A +:10218000022810D028273B4408280ED004280ED05F +:1021900002280ED05FF00800C0EBC00707EB40102C +:1021A0001844983009E01827EDE74020F4E71020A4 +:1021B000F2E70420F0E74FF4FC7010444718287849 +:1021C0003F1DF4F75FFF014628784FF47A7202282A +:1021D0001DD001281DD040F6340008444AF2EF011A +:1021E0000844B0FBF2F03A1A606A40F2E241B046AD +:1021F0004788F0304F43316A81420DD03946206B19 +:1022000000F08EF90646B84207D9FFDF05E0104618 +:10221000E3E74FF4C860E0E70026C04880688642E4 +:1022200007D2616A40F271224888424306EB4206B7 +:1022300004E040F2E240B6FBF0F0616AC882606AF6 +:10224000297880F86410297880F865100521417597 +:10225000C08A6FF41C71484306EB400040F63541DC +:10226000C8F81C00B0EB410F00D3FFDFBDE8F081E0 +:1022700010B5052937D2DFE801F00509030D31005B +:10228000002100E00121BDE8104027E7032180F88C +:10229000F01010BD0446408840F2E24148439F4997 +:1022A000091D0860D4F818010089E082D4F81801EB +:1022B00080796075D4F8180140896080D4F81801DD +:1022C0008089A080D4F81801C089E0802046A16AE6 +:1022D000FFF7D6FB022084F8F00010BD816ABDE84C +:1022E0001040FFF7CDBBFFDF10BD70B58A4C243C1A +:1022F0000928A1683FD2DFE800F0050B0B15131584 +:1023000038380800BDE8704049E6BDE8704063E633 +:10231000022803D00020BDE87040FFE60120FAE764 +:10232000E16070BD032802D005281CD000E0E16008 +:102330005FF0000600F059F9774D012085F828007C +:1023400085F83460686AA9690026C0F8F41080F83E +:10235000F060E068FFF744FB00B1FFDFF2F771FEC9 +:102360006E74AE7470BD0126E4E76C480078BDE879 +:102370007040E0F7B5BDFFDF70BD674924394860A4 +:10238000704770B5644D0446243DB1B14FF47A7680 +:10239000012903D0022905D0FFDF70BD1846F4F7EC +:1023A000E7FE05E06888401C68801046F5F7B0FF3E +:1023B00000F2E730B0FBF6F0201AA86070BD564876 +:1023C00000787047082803D0042801D0F4F75ABEDB +:1023D0004EF628307047002804DB00F1E02090F82A +:1023E000000405E000F00F0000F1E02090F8140D6B +:1023F0004009704710F00C0000D008467047F3F712 +:1024000039B910B50446202800D3FFDF42484430D4 +:1024100030F8140010BD70B505460C461046F4F7B0 +:1024200031FE4FF47A71022C0DD0012C0DD040F604 +:10243000340210444AF247321044B0FBF1F0284411 +:1024400000F5CA7070BD0A46F3E74FF4C862F0E7C2 +:102450001FB513460A46044601466846FEF789FB47 +:1024600094F8FA006946FFF7CAFF002800D1FFDFA1 +:102470001FBD70B5284C0025257094F82000F2F798 +:10248000B6FE00B9FFDF84F8205070BD2DE9F041A1 +:10249000050000D1FFDF204A0024243AD5F804616A +:1024A0002046631E116A08E08869B04203D398424F +:1024B00001D203460C460846C9680029F4D104B984 +:1024C00004460021C5F80041F035C4B1E068E5607C +:1024D000E86000B105612E698846A96156B1B0690E +:1024E00030B16F69B84200D2FFDFB069C01BA8618C +:1024F000C6F81880084D5CB1207820B902E0E96088 +:102500001562E8E7FFDF6169606808442863ADE6AB +:10251000C5F83080AAE60000F011002084010020F8 +:1025200010B50C4601461046F3F76FFB002806DA9B +:10253000211A491EB1FBF4F101FB040010BD90FB10 +:10254000F4F101FB140010BD2E48016A002001E0E7 +:102550000846C9680029FBD170472DE9FE43294D83 +:102560000120287000264FF6FF7420E00621F0F7C6 +:10257000F5FC070000D1FFDF97F8FA00F037F3F71A +:10258000FFFB07F80A6BA14617F8FA89B8F1200F8C +:1025900000D3FFDF1B4A683222F8189097F8FA0040 +:1025A000F2F725FE00B9FFDF202087F8FA00694620 +:1025B0000620F0F75CFC50B1FFDF08E0029830B174 +:1025C00090F8F01019B10088A042CFD104E068461D +:1025D000F0F72BFC0028F1D02E70BDE8FE8310B57B +:1025E000FFF719FF00F5C87010BD06480021243020 +:1025F00090F8352000EB4200418503480078E0F771 +:102600006FBC0000CC11002084010020012804D000 +:10261000022805D0032808D105E0012907D004E0ED +:10262000022904D001E0042901D0002070470120D4 +:102630007047F748806890F8A21029B1B0F89E1052 +:10264000B0F8A020914215D290F8A61029B1B0F8A8 +:10265000A410B0F8A02091420CD2B0F89C20B0F8A1 +:102660009A108A4206D290F88020B0F898001AB1E9 +:10267000884203D3012070470628FBD20020704710 +:102680002DE9F041E24D0746A86800F1700490F88A +:10269000140130B9E27B002301212046FBF7F6F854 +:1026A00010B1A08D401CA08501263D21AFB928782E +:1026B000022808D001280AD06878C8B110F0140F99 +:1026C00009D01E2039E0162037E026773EE0A868C2 +:1026D00090F8160131E0020701D56177F5E781072F +:1026E00001D02A2029E0800600D4FFDF232024E047 +:1026F00094F8320028B1E08D411CE185218E88429A +:1027000013D294F8360028B1A08E411CA186218EE8 +:1027100088420AD2A18D608D814203D3AA6892F8C3 +:10272000142112B9228E914201D3222005E0217C8E +:1027300029B1218D814207D308206077C5E7208D1C +:10274000062801D33E20F8E7207FB0B10020207397 +:10275000607320740221A868FFF78AFDA86890F8CA +:10276000E410012904D1D0F81C110878401E08702B +:10277000E878BDE8F041E0F7B3BBA868BDE8F041F8 +:102780000021FFF775BDA2490C28896881F8E40093 +:1027900014D0132812D0182810D0002211280ED0DF +:1027A00007280BD015280AD0012807D0002805D00B +:1027B000022803D021F89E2F012008717047A1F84C +:1027C000A420704710B5924CA1680A88A1F8602136 +:1027D00081F85E0191F8640001F046FBA16881F880 +:1027E000620191F8650001F03FFBA16881F8630187 +:1027F000012081F85C01002081F82E01E078BDE81D +:102800001040E0F76DBB70B5814C00231946A068FD +:1028100090F87C207030FBF739F800283DD0A06894 +:1028200090F820110025C9B3A1690978B1BB90F8CF +:102830007D00FBF713F888BBA168B1F870000A2887 +:102840002DD905220831E069EBF7C2FD10B3A0686D +:10285000D0F81C11087858B10522491CE069EBF743 +:10286000B7FD002819D1A068D0F81C01007840B944 +:10287000A068E169D0F81C010A68C0F80120097954 +:102880004171A068D0F81C110878401C0870012024 +:10289000FFF779FFA06880F8205170BDFFE7A068BE +:1028A00090F8241111B190F82511C1B390F82E11B0 +:1028B0000029F2D090F82F110029EED190F87D0078 +:1028C000FAF7CCFF0028E8D1A06890F8640001F086 +:1028D000CBFA0646A06890F8650001F0C5FA0546F7 +:1028E000A06890F830113046FFF790FEA0B3A068C2 +:1028F00090F831112846FFF789FE68B3A268B2F854 +:10290000703092F86410B2F8320102F58872FBF769 +:102910002DFA20B3A168252081F87C00BDE7FFE7F0 +:1029200090F87D10242918D090F87C10242914D018 +:102930005FF0000300F5897200F59271FBF78EFEDF +:10294000A16881F8245101F13000C28A21F8E62FF4 +:10295000408B4880142007E005E00123EAE7BDE84A +:10296000704000202EE71620BDE870400BE710B540 +:10297000F3F7E8FD0C2813D3254C0821A068D0F804 +:1029800018011E30F3F7E2FD28B1A0680421D83009 +:10299000F3F7DCFD00B9FFDFBDE810400320F2E6ED +:1029A00010BD10B51A4CA068D0F818110A78002A8A +:1029B0001FD04988028891421BD190F87C200023C7 +:1029C00019467030FAF762FF002812D0A068D0F8DC +:1029D00018110978022907D003290BD0042919D02E +:1029E000052906D108200DE090F87D00FAF736FFA2 +:1029F00040B110BD90F8811039B190F8820000B953 +:102A0000FFDF0A20BDE81040BDE6BDE81040AEE79C +:102A10009001002090F8AA008007EAD10C20FFF76F +:102A2000B2FEA068002120F89E1F01210171017BE8 +:102A300041F00101017310BD70B5F74CA268556EED +:102A4000FBF72EF9EBB2C1B200228B4203D0A36890 +:102A500083F8121102E0A16881F81221C5F3072161 +:102A6000C0F30720814203D0A16881F8130114E765 +:102A7000A06880F8132110E710B5E74C0421A06886 +:102A8000FFF7F6FBA06890F85A10012908D000F56E +:102A90009E71FBF7ACFEE078BDE81040E0F720BA8D +:102AA000022180F85A1010BD70B5DB4CA06890F878 +:102AB000E410FE2955D16178002952D190F87F2089 +:102AC000002301217030FAF7E1FE002849D1A06807 +:102AD00090F8141109B1022037E090F87C2000230F +:102AE00019467030FAF7D2FE28B1A06890F8960027 +:102AF00008B1122029E0A068002590F87C20122A55 +:102B00001DD004DC032A23D0112A04D119E0182A8D +:102B10001AD0232A26D0002304217030FAF7B6FEFB +:102B200000281ED1A06890F87D10192971D020DCF2 +:102B300001292AD0022935D0032932D120E00B20E7 +:102B400003E0BDE8704012E70620BDE870401AE6D9 +:102B500010F8E21F01710720FFF715FEA06880F84A +:102B60007C509AE61820FFF70EFEA068A0F89E5051 +:102B700093E61D2918D01E2916D0212966D149E0D7 +:102B800010F8E11F4171072070E00C20FFF7FBFDFA +:102B9000A06820F8A45F817941F00101817100F8FB +:102BA000275C53E013202CE090F8252182BB90F89D +:102BB0002421B2B1242912D090F87C1024290ED0FF +:102BC0005FF0000300F5897200F59271FBF746FD96 +:102BD000A0681E2180F87D1080F8245103E00123B5 +:102BE000F0E71E2932D1A068FBF797FDFFF744FFFD +:102BF000A16801F13000C28A21F8E62F408B48809D +:102C00001520FFF7C0FDA068A0F8A45080F87D5003 +:102C10001CE02AE090F8971051B180F8125180F82A +:102C200013511820FFF7AFFDA068A0F8A4500DE0E5 +:102C300090F82F1151B990F82E1139B1C16DD0F81B +:102C40003001FFF7F9FE1820FFF79DFDA06890F80E +:102C5000E400FE2885D1FFF7A4FEA06890F8E40008 +:102C6000FE2885D1BDE87040CDE51120FFF78BFD32 +:102C7000A068CBE7684A0129926819D0002302298D +:102C80000FD003291ED010B301282BD0032807D161 +:102C900092F87C00132803D0162801D0182804D1FC +:102CA000704792F8E4000028FAD0D2F8180117E033 +:102CB00092F8E4000128F3D0D2F81C110878401EE5 +:102CC0000870704792F8E4000328EED17047D2F8FC +:102CD0001801B2F870108288891A09B20029F5DB50 +:102CE00003707047B2F87000B2F82211401A00B2B7 +:102CF0000028F6DBD2F81C010178491E01707047EC +:102D000070B5044690F87C0000250C2810D00D28E2 +:102D10002ED1D4F81811B4F870008988401C88426C +:102D200026D1D4F864013C4E017811B3FFDF42E0B4 +:102D3000B4F87000B4F82211401C884218D1D4F8BD +:102D40001C01D0F80110A1604079207303212046B6 +:102D5000FAF780FAD4F81C01007800B9FFDF0121EE +:102D6000FE20FFF787FF84F87C50012084F8B20032 +:102D700093E52188C180D4F81801D4F86411408902 +:102D80000881D4F81801D4F8641180894881D4F8F6 +:102D90001801D4F86411C0898881D4F864010571E0 +:102DA000D4F8641109200870D4F864112088488090 +:102DB000F078E0F795F802212046FAF74BFA032164 +:102DC0002046FFF755FAB068D0F8180100780228BD +:102DD00000D0FFDF0221FE20FFF74CFF84F87C507B +:102DE0005BE52DE9F0410C4C00260327D4F808C020 +:102DF000012598B12069C0788CF8E20005FA00F04E +:102E0000C0F3C05000B9FFDFA06800F87C7F4684A3 +:102E100080F82650BDE8F0819001002000239CF846 +:102E20007D2019460CF17000FAF730FD70B1607822 +:102E30000028EFD12069C178A06880F8E11080F8FF +:102E40007D70A0F8A46080F8A650E3E76570E1E724 +:102E5000F0B5F74C002385B0A068194690F87D20A6 +:102E60007030FAF713FD012580B1A06890F87C005E +:102E700023280ED024280CD06846F5F73DFB68B116 +:102E8000009801A9C0788DF8040008E0657005B0CD +:102E9000F0BD607840F020006070F8E70021A06885 +:102EA00003AB162290F87C00FAF77BFF002648B1AE +:102EB000A0689DF80C20162180F80C2180F80D11D7 +:102EC000192136E02069FBF718FB78B121690879F0 +:102ED00000F00702A06880F85C20497901F0070142 +:102EE00080F85D1090F82F310BBB03E00020FFF756 +:102EF00078FFCCE790F82E31CBB900F164035F780E +:102F0000974205D11A788A4202D180F897500EE094 +:102F100000F5AC71028821F8022990F85C200A7152 +:102F200090F85D0048710D70E078DFF7D9FFA06878 +:102F3000212180F87D1080F8A650A0F8A460A6E7B3 +:102F4000F8B5BB4C00231946A06890F87D2070307E +:102F5000FAF79CFC40B32069FBF7B4FA48B3206948 +:102F6000FBF7AAFA07462069FBF7AAFA064620698A +:102F7000FBF7A0FA05462069FBF7A0FA0146009787 +:102F8000A06833462A463030FBF79BFBA168012539 +:102F900091F87C001C2810D091F85A00012812D01A +:102FA00091F8250178B90BE0607840F0010060707D +:102FB000F8BDBDE8F840002013E781F85A5002E060 +:102FC00091F8240118B11E2081F87D000BE01D202E +:102FD00081F87D0001F5A57231F8300BFBF7FBFBA2 +:102FE000E078DFF77DFFA068002120F8A41F85703E +:102FF000F8BD10B58E4C00230921A06890F87C2004 +:103000007030FAF743FC48B16078002805D1A16818 +:1030100001F8960F087301F81A0C10BD01206070BA +:1030200010BD7CB5824C00230721A06890F87C205D +:103030007030FAF72BFC38B36078002826D1694647 +:103040002069FBF755FA9DF80000002500F02501E6 +:10305000A06880F8B0109DF8011001F0490180F8D7 +:10306000B11080F8A250D0F8181100884988814228 +:1030700000D0FFDFA068D0F818110D70D0F86411EF +:103080000A7822B1FFDF16E0012060707CBD30F8C5 +:10309000E82BCA80C16F0D71C16F009A8A60019AD6 +:1030A000CA60C26F0821117030F8E81CC06F4180FF +:1030B000E078DFF715FFA06880F87C507CBD70B524 +:1030C0005B4C00231946A06890F87D207030FAF719 +:1030D000DDFB012540B9A0680023082190F87C2081 +:1030E0007030FAF7D3FB10B36078002820D1A068C5 +:1030F00090F8AA00800712D42069FBF7BFF9A168F5 +:1031000081F8AB00206930F8052FA1F8AC20408889 +:10311000A1F8AE0011F8AA0F40F002000870A068F4 +:103120004FF0000690F8AA10C90702D011E06570B0 +:103130009DE490F87D20002319467030FAF7A6FB35 +:1031400000B9FFDFA06880F87D5080F8A650A0F895 +:10315000A460A06890F87C10012906D180F87C60FA +:1031600080F8A260E078DFF7BBFEA168D1F8180113 +:10317000098842888A42DBD101780429D8D10670B7 +:10318000E078DFF7ADFEA06890F87C100029CFD181 +:1031900080F8A2606BE470B5254DA86890F87C10AB +:1031A0001A2902D00220687061E469780029FBD1F5 +:1031B000002480F8A74080F8A240D0F818110088B9 +:1031C0004988814200D0FFDFA868D0F818110C7040 +:1031D000D0F864110A780AB1FFDF25E090F8A82042 +:1031E00072B180F8A8400288CA80D0F864110C71CE +:1031F000D0F864210E2111700188D0F864010DE02F +:1032000030F8E82BCA80C16F0C71C26F01211172B6 +:10321000C26F0D21117030F8E81CC06F418000F0C2 +:10322000A1FEE878DFF75CFEA86880F87C401EE429 +:103230009001002070B5FA4CA16891F87C20162A04 +:1032400001D0132A02D191F8A82012B10220607097 +:103250000DE46278002AFBD181F8E000002581F8B6 +:10326000A75081F8A250D1F81801098840888842F7 +:1032700000D0FFDFA068D0F818010078032800D044 +:10328000FFDF0321FE20FFF7F5FCA068D0F86411F2 +:103290000A780AB1FFDF14E030F8E02BCA8010F89A +:1032A000081BC26F1171C16F0D72C26F0D211170B9 +:1032B00030F8E81CC06F418000F054FEE078DFF782 +:1032C0000FFEA06880F87C504BE470B5D44C092107 +:1032D0000023A06890F87C207030FAF7D7FA002518 +:1032E00018B12069007912281ED0A0680A21002395 +:1032F00090F87C207030FAF7C9FA18B1206900798B +:10330000142814D02069007916281AD1A06890F8E2 +:103310007C101F2915D180F87C5080F8A250BDE8A0 +:1033200070401A20FFF74EBABDE8704061E6A06811 +:1033300000F87C5F458480F82650BDE87040FFF7B8 +:103340009BBB0EE470B5B64C2079C00773D02069E2 +:1033500000230521C578A06890F87C207030FAF72A +:1033600095FA98B1062D11D006DC022D0ED0042D51 +:103370000CD0052D06D109E00B2D07D00D2D05D061 +:10338000112D03D0607840F008006070607800284C +:1033900051D12069FAF7D6FF00287ED02069002598 +:1033A0000226C178891E162977D2DFE801F00B7654 +:1033B00034374722764D76254A457676763A53500D +:1033C0006A6D7073A0680023012190F87F2070302F +:1033D000FAF75CFA08BB2069FBF718F8A16881F8D6 +:1033E0001601072081F87F0081F8A65081F8A250CD +:1033F00056E0FFF76AFF53E0A06890F87C100F29B1 +:1034000001D066704CE0617839B980F881501221A2 +:1034100080F87C1044E000F0D0FD41E000F0ACFD0D +:103420003EE0FBF7A8F803283AD12069FBF7A7F89C +:10343000FFF700FF34E03BE00079F9E7FFF7ABFE70 +:103440002EE0FFF73CFE2BE0FFF7EBFD28E0FFF757 +:10345000D0FD25E0A0680023194690F87D2070304B +:10346000FAF714FA012110B16078C8B901E061706F +:1034700016E0A06820F8A45F817000F8276C0FE0C8 +:103480000BE0FFF75DFD0BE000F034FD08E0FFF717 +:10349000DFFC05E000F0FAFC02E00020FFF7A1FCF1 +:1034A000A268F2E93001401C41F10001C2E90001CB +:1034B0005EE42DE9F0415A4C2079800741D56078CF +:1034C00000283ED1E06801270026C178204619294E +:1034D000856805F170006FD2DFE801F04B3E0D6F9B +:1034E000C1C1801C34C1556287C1C1C1C1BE8B95A9 +:1034F00098A4B0C1BA0095F87F2000230121FAF703 +:10350000C5F900281DD1A068082180F87F1080F837 +:10351000A26090E0002395F87D201946FAF7B6F9ED +:1035200010B1A06880F8A660A0680023194690F842 +:103530007C207030FAF7AAF9002802D0A06880F841 +:10354000A26067E4002395F87C201946FAF79EF9FB +:1035500000B9FFDF042008E0002395F87C2019461D +:10356000FAF794F900B9FFDF0C20A16881F87C001C +:1035700050E4002395F87C201946FAF787F900B942 +:10358000FFDF0D20F1E7002395F87C201946FAF7BC +:103590007DF900B9FFDFA0680F2180F8A77008E06F +:1035A00095F87C00122800D0FFDFA068112180F878 +:1035B000A87080F87C102DE451E0002395F87C2061 +:1035C0001946FAF763F920B9A06890F8A80000B985 +:1035D000FFDFA068132180F8A770EAE795F87C0068 +:1035E000182800D0FFDF1A20BFE7BDE8F04100F047 +:1035F00063BD002395F87C201946FAF747F900B916 +:10360000FFDF0520B1E785F8A66003E4002395F805 +:103610007C201946FAF73AF900B9FFDF1C20A4E72D +:1036200090010020002395F87D201946FAF72EF925 +:1036300000B9FFDFA06880F8A66006E4002395F8D3 +:103640007C201946FAF722F900B9FFDF1F208CE72A +:10365000BDE8F04100F0F8BC85F87D60D3E7FFDFFE +:103660006FE710B5F74C6078002837D12079400714 +:103670000FD5A06890F87C00032800D1FFDFA06878 +:1036800090F87F10072904D101212170002180F8D2 +:103690007F10FFF70EFF00F0B5FCFFF753FEA07898 +:1036A000000716D5A0680023052190F87C20703013 +:1036B000FAF7ECF850B108206070A068D0F86411F7 +:1036C00008780D2800D10020087002E00020F8F7EB +:1036D00011FDA068BDE81040FFF712BB10BD2DE939 +:1036E000F041D84C07464FF0000560780843607001 +:1036F000207981062046806802D5A0F8985004E021 +:10370000B0F89810491CA0F8981000F018FD012698 +:10371000F8B1A088000506D5A06890F8821011B114 +:10372000A0F88E5015E0A068B0F88E10491CA0F8E3 +:103730008E1000F0F3FCA068B0F88E10B0F8902066 +:10374000914206D3A0F88E5080F83A61E078DFF716 +:10375000C7FB207910F0600F08D0A06890F88010A7 +:1037600021B980F880600121FEF782FD1FB9FFF7C3 +:1037700078FFFFF799F93846FEF782FFBDE8F04180 +:10378000F4F7C9BEAF4A51789378194313D1114663 +:103790000128896808D01079400703D591F87F0087 +:1037A000072808D001207047B1F84C00098E8842E4 +:1037B00001D8FEF7E2B900207047A249C2788968B3 +:1037C000012A06D05AB1182A08D1B1F81011FAF717 +:1037D000B0BEB1F822114172090A81727047D1F866 +:1037E000181189884173090A8173704770B5954C27 +:1037F00005460E46A0882843A080A80703D5E80701 +:1038000000D0FFDFE660E80700D02661A80719D5E1 +:10381000F078062802D00B2814D10BE0A06890F8AD +:103820007C1018290ED10021E0E93011012100F8A7 +:103830003E1C07E0A06890F87C10122902D10021FC +:1038400080F88210280601D50820A07068050AD5E6 +:10385000A0688288B0F87010304600F07FFC3046D7 +:10386000BDE87040A9E763E43EB505466846F4F755 +:103870001DFE00B9FFDF222200210098EAF7FFFDBC +:1038800003210098FAF746FD0098017821F0100115 +:1038900001702946FAF763FD6A4C192D71D2DFE8F1 +:1038A00005F020180D3EC8C8C91266C8C9C959C854 +:1038B000C8C8C8BBC9C971718AC89300A1680098FB +:1038C00091F8151103E0A168009891F8E6100171D4 +:1038D000B0E0A068D0F81C110098491CFAF78BFDE5 +:1038E000A8E0A1680098D1F8182192790271D1F866 +:1038F000182112894271120A8271D1F81821528955 +:10390000C271120A0272D1F8182192894272120A07 +:103910008272D1F81811C989FAF744FD8AE0A068CB +:10392000D0F818110098091DFAF772FDA068D0F8B8 +:10393000181100980C31FAF775FDA068D0F818112D +:1039400000981E31FAF774FDA1680098D831FAF793 +:103950007DFD6FE062690098117801719188417175 +:10396000090A81715188C171090A017262E0364900 +:10397000D1E90001CDE9010101A90098FAF780FD24 +:1039800058E056E0A068B0F844100098FAF78AFDB5 +:10399000A068B0F8E6100098FAF788FDA068B0F8C3 +:1039A00048100098FAF776FDA068B0F8E810009883 +:1039B000FAF774FD3EE0A168009891F83021027199 +:1039C00091F83111417135E0A06890F81301FAF7D0 +:1039D0005EF901460098FAF7A8FDA06890F8120178 +:1039E00000F03DFA70B1A06890F8640000F037FA7A +:1039F00040B1A06890F8121190F86400814201D0A3 +:103A0000002002E0A06890F81201FAF740F90146A0 +:103A10000098FAF786FD0DE0A06890F80D11009867 +:103A2000FAF7A7FDA06890F80C110098FAF7A5FD29 +:103A300000E0FFDFF4F74DFD00B9FFDF0098FFF76E +:103A4000BCFE3EBD900100206C64020010B5F94C34 +:103A5000A06890F8121109B990F8641080F8641009 +:103A600090F8131109B990F8651080F865100020DE +:103A7000FEF7A8FEA068FAF750FE002806D0A0685E +:103A8000BDE8104000F59E71FAF7B1BE10BDF8B563 +:103A9000E84E00250446B060B5807570B57035708D +:103AA0000088F4F700FDB0680088F4F722FDB4F850 +:103AB000F800B168401C82B201F17000F9F79FFC78 +:103AC00000B1FFDF94F87D00242809D1B4F870100C +:103AD000B4F81001081A00B2002801DB707830B188 +:103AE00094F87C0024280AD0252808D015E0FFF798 +:103AF000ADFF84F87D50B16881F897500DE0B4F8BF +:103B00007010B4F81001081A00B2002805DB7078B4 +:103B100018B9FFF79BFF84F87C50A4F8F850FEF723 +:103B200088FD00281CD1B06890F8E400FE2801D080 +:103B3000FFF79AFEC0480090C04BC14A2146284674 +:103B4000F8F70CFAB0680023052190F87C2070305B +:103B5000F9F79CFE002803D0BDE8F840F7F7A5BFB1 +:103B6000F8BD10B5FEF765FD20B10020BDE810409E +:103B70000146B4E5BDE81040F8F798BA70B50C46B8 +:103B8000154606464FF4B47200212046EAF777FC4A +:103B9000268005B9FFDF2868C4F818016868C4F8F2 +:103BA0001C01A868C4F8640182E4EFF7E1BA2DE9CA +:103BB000F0410D4607460621EFF7D0F9041E3DD02F +:103BC000D4F864110026087858B14A8821888A42BE +:103BD00007D109280FD00E2819D00D2826D0082883 +:103BE0003ED094F83A01D0B36E701020287084F85B +:103BF0003A61AF809AE06E7009202870D4F86401B1 +:103C0000416869608168A9608089A88133E00846BD +:103C1000EFF7D7FA0746EEF782FF70B96E700E2005 +:103C20002870D4F864014068686011E00846EFF736 +:103C3000C8FA0746EEF773FF08B1002081E46E7002 +:103C40000D202870D4F864014168696000892881DA +:103C5000D4F8640106703846EEF75BFF66E00EE0CC +:103C60006E7008202870D4F864014168696081682A +:103C7000A960C068E860D4F86401067056E094F862 +:103C80003C0198B16E70152028700AE084F83C6100 +:103C9000D4F83E016860D4F84201A860D4F8460127 +:103CA000E86094F83C010028F0D13FE094F84A0124 +:103CB00058B16E701C20287084F84A610A2204F5FD +:103CC000A671281DEAF7B1FB30E094F8560140B127 +:103CD0006E701D20287084F85661D4F85801686011 +:103CE00024E094F8340168B16E701A20287004E062 +:103CF00084F83461D4F83601686094F834010028FF +:103D0000F6D113E094F85C01002897D06E7016206D +:103D1000287007E084F85C61D4F85E016860B4F84C +:103D20006201288194F85C010028F3D1012008E4A5 +:103D3000404A5061D170704770B50D4604464EE060 +:103D4000B4F8F800401CA4F8F800B4F89800401C3F +:103D5000A4F89800204600F0F2F9B8B1B4F88E004B +:103D6000401CA4F88E00204600F0D8F9B4F88E006C +:103D7000B4F89010884209D30020A4F88E000120E6 +:103D800084F83A012B48C078DFF7AAF894F8A2002B +:103D900020B1B4F89E00401CA4F89E0094F8A60040 +:103DA00020B1B4F8A400401CA4F8A40094F81401B5 +:103DB00040B994F87F200023012104F17000F9F745 +:103DC00065FD20B1B4F89C00401CA4F89C0020467E +:103DD000FEF796FFB4F87000401CA4F870006D1E4A +:103DE000ADB2ADD23FE5134AC2E90601704770B5E6 +:103DF0000446B0F8980094F88010D1B1B4F89A1045 +:103E00000D1A2D1F94F8960040B194F87C200023E1 +:103E1000092104F17000F9F739FDB8B1B4F88E60EA +:103E2000204600F08CF980B1B4F89000801B001F90 +:103E30000CE007E090010020DF3602008537020029 +:103E4000ED370200C0F10205DCE72846A84200DA9F +:103E50000546002D01DC002005E5A8B203E510F0C1 +:103E60000C0000D00120704710B5012808D00228AE +:103E700008D0042808D0082806D0FFDF204610BD4F +:103E80000124FBE70224F9E70324F7E770B5CC4CE3 +:103E9000A06890F87C001F2804D0607840F00100F2 +:103EA0006070E0E42069FAF732FBD8B120690122A2 +:103EB0000179407901F0070161F30705294600F017 +:103EC000070060F30F21A06880F8A2200022A0F86C +:103ED0009E20232200F87C2FD0F8B400BDE870406B +:103EE000FEF7AABD0120FEF77CFFBDE870401E2052 +:103EF000FEF768BCF8B5B24C00230A21A06890F820 +:103F00007C207030F9F7C2FC38B32069FAF7DAFA8E +:103F1000C8B12069FAF7D0FA07462069FAF7D0FA53 +:103F200006462069FAF7C6FA05462069FAF7C6FA86 +:103F300001460097A06833462A463030FAF7C1FBA5 +:103F4000A068FAF7EAFBA168002081F8A20081F8D6 +:103F50007C00BDE8F840FEF78FBD607840F00100BE +:103F60006070F8BD964810B580680088EFF729F9B1 +:103F7000BDE81040EEF7BEBD10B5914CA36893F8B4 +:103F80007C00162802D00220607010BD60780028E6 +:103F9000FBD1D3F81801002200F11E010E30C83306 +:103FA000F9F7EEFBA0680021C0E92E11012180F88D +:103FB0008110182180F87C1010BD10B5804CA068CD +:103FC00090F87C10132902D00220607010BD617837 +:103FD0000029FBD1D0F8181100884988814200D00F +:103FE000FFDFA068D0F8181120692631FAF73BFAF4 +:103FF000A1682069DC31FAF73EFAA168162081F841 +:104000007C0010BD10B56E4C207900071BD5607880 +:10401000002818D1A068002190F8E400FEF72AFEDD +:10402000A06890F8E400FE2800D1FFDFA068FE2120 +:1040300080F8E41090F87F10082904D10221217043 +:10404000002180F87F1010BD70B55D4D2421002443 +:10405000A86890F87D20212A05D090F87C20232A9A +:1040600018D0FFDFA0E590F8122112B990F81321C3 +:104070002AB180F87D10A86880F8A64094E500F881 +:104080007D4F847690F8B1000028F4D00020FEF730 +:1040900099FBF0E790F8122112B990F813212AB198 +:1040A00080F87C10A86880F8A2407DE580F87C400C +:1040B0000020FEF787FBF5E770B5414C0025A068AE +:1040C000D0F8181103884A889A4219D1097804292E +:1040D00016D190F87C20002319467030F9F7D6FBF2 +:1040E00000B9FFDFA06890F8AA10890703D4012166 +:1040F00080F87C1004E080F8A250D0F81801057018 +:10410000A0680023194690F87D207030F9F7BEFBB7 +:10411000002802D0A06880F8A65045E5B0F89020AD +:10412000B0F88E108A4201D3511A00E00021828833 +:10413000521D8A4202D3012180F89610704710B5B3 +:1041400090F8821041B990F87C200023062170304D +:10415000F9F79CFB002800D0012010BD70B5114478 +:10416000174D891D8CB2C078A968012806D040B1CE +:10417000182805D191F8120138B109E0A1F82241BF +:1041800012E5D1F8180184800EE591F8131191B170 +:10419000FFF765FE80B1A86890F86400FFF75FFE46 +:1041A00050B1A86890F8121190F86420914203D0A1 +:1041B00090F8130100B90024A868A0F81041F3E4B6 +:1041C0009001002070B58E4C0829207A6CD2DFE86F +:1041D00001F004176464276B6B6458B1F3F7BEF801 +:1041E000F4F7B7F80020A072F3F796F9BDE8704035 +:1041F000F3F726BCF4F7CFF8BDE87040F0F721BF25 +:10420000DEF742FDF3F7E6FFD4E90001F0F7F5FC35 +:104210002060A07A401CC0B2A072282824D370BDB0 +:10422000A07A0025401EC6B2E0683044F3F7CEFC09 +:1042300010B9E1687F208855A07A272828BF01257A +:10424000DEF722FDA17A01EB4102C2EB81110844A5 +:104250002946F3F7E9FFA07A282809D2401CC0B20A +:10426000A072282828BF70BDBDE87040F3F754B98C +:10427000207A002818BF00F085F8F3F717FBF3F752 +:10428000C5FBF4F788F80120E0725E480078DEF79D +:1042900027FEBDE87040F0F7D4BE002808BF70BD0F +:1042A000BDE8704000F06EB8FFDF70BD10B5544C33 +:1042B000207A002804BF0C2010BD00202072E0727C +:1042C000607AF1F7F1FA607AF1F75AFD607AF0F767 +:1042D0008EFF00280CBF1F20002010BD002270B5EB +:1042E000474C06460D46207A68B12272E272607A27 +:1042F000F1F7DAFA607AF1F743FD607AF0F777FFC9 +:10430000002808BFFFDF3F48E560067070BD70B54C +:10431000050007D0A5F5E8503B494C3881429CBFC9 +:10432000122070BD364CE068002804BF092070BD23 +:10433000207A00281CBF0C2070BD3448F0F7FCFE2A +:104340006072202804BF1F2070BDF0F76FFF20604F +:10435000002D1CBF2844206001206560207200F001 +:1043600011F8002070BD2649CA7A002A04BF002037 +:1043700070471E22027000224270CB684360CA72EE +:1043800001207047F0B585B0F0F750FF1C4D07468F +:10439000394668682C6800EB800046002046F1F73B +:1043A00034FCB04206DB6868811B3846F0F725FC18 +:1043B0000446286040F2357621463846F1F725FC60 +:1043C000B04204DA31463846F0F717FC04460020C4 +:1043D0008DF8000040F6E110039004208DF80500F0 +:1043E00001208DF8040068460294F1F7C7F8687A56 +:1043F0006946F1F73FF9002808BFFFDF05B0F0BDBF +:1044000074120020B0010020B5EB3C00C541020051 +:104410002DE9F0410C4612490D68114A1149083244 +:104420001160A0F12001312901D301200CE04128C5 +:1044300010D040CC0C4F94E80E0007EB8000241FF6 +:1044400050F8807C3046B84720600548001D056064 +:10445000BDE8F081204601F01BFDF5E7062070471E +:1044600010050240010000017464020010B55548B7 +:10447000F1F7EAFF00B1FFDF5248401CF1F7E4FF1B +:10448000002800D0FFDF10BD2DE9F14F4E4E82B065 +:10449000D6F800B001274B48F1F7DEFFDFF82481A2 +:1044A00020B9002708F10100F1F7ECFF474C002587 +:1044B0004FF0030901206060C4F80051C4F80451B2 +:1044C000029931602060DFF808A11BE0DAF80000F3 +:1044D000C00617D50E2000F068F8EFF3108010F03A +:1044E000010072B600D001200090C4F80493D4F803 +:1044F000000120B9D4F8040108B9DEF775FD009871 +:1045000000B962B6D4F8000118B9D4F80401002843 +:10451000DCD0D4F804010028CCD137B1C6F800B003 +:1045200008F10100F1F798FF11E008F10100F1F73F +:1045300093FF0028B6D1C4F80893C4F80451C4F816 +:1045400000510E2000F031F81E48F1F79BFF0020CB +:10455000BDE8FE8F2DE9F0438DB00D4606460024E0 +:104560000DF110090DF1200818E000BF04EB44071D +:10457000102255F827106846E9F757FF05EB870723 +:10458000102248467968E9F750FF6846FFF77CFF3C +:1045900010224146B868E9F748FF641CB442E5DBE5 +:1045A0000DB00020BDE8F0836EE7002809DB00F0C5 +:1045B0001F02012191404009800000F1E020C0F875 +:1045C00080127047B101002004E5004000E0004087 +:1045D00010ED00E0B54900200870704770B5B44D8B +:1045E00001232B60B34B1C68002CFCD0002407E097 +:1045F0000E6806601E68002EFCD0001D091D641C9C +:104600009442F5D30020286018680028FCD070BDC3 +:1046100070B5A64E0446A84D3078022800D0FFDFC2 +:10462000AC4200D3FFDF7169A448012903D847F2E7 +:104630003052944201DD03224271491C7161291BF1 +:10464000C1609E49707800F02EF9002800D1FFDF8C +:1046500070BD70B5954C0D466178884200D0FFDF83 +:10466000954E082D4BD2DFE805F04A041E2D4A4A2C +:104670004A382078022800D0FFDF03202070A0787D +:10468000012801D020B108E0A06801F0C1F904E0E0 +:1046900004F1080007C8FFF7A1FF05202070BDE85E +:1046A0007040F0F7CEBCF0F7C1FD01466068F1F74D +:1046B000ACFAB04202D2616902290BD30320F1F7B0 +:1046C000F4FD12E0F0F7B2FD01466068F1F79DFAE3 +:1046D000B042F3D2BDE870409AE7207802280AD0B1 +:1046E000052806D0FFDF04202070BDE8704000F0F0 +:1046F000D0B8022000E00320F1F7D7FDF3E7FFDF99 +:1047000070BD70B50546F0F791FD684C606020788B +:10471000012800D0FFDF69490120087000200871DE +:1047200004208D6048716448C86002202070607861 +:1047300000F0B9F8002800D1FFDF70BD10B55B4C68 +:10474000207838B90220F1F7C6FD18B90320F1F737 +:10475000C2FD08B1112010BD5948F0F7EDFC6070A2 +:10476000202804D0012020700020606110BD0320AB +:1047700010BD2DE9F0471446054600EB84000E46B7 +:10478000A0F1040801F057F907464FF08050016985 +:104790004F4306EB8401091FB14201D2012100E021 +:1047A000002189461CB10069B4EB900F02D90920A1 +:1047B000BDE8F0872846DCF745FD90B9A84510D341 +:1047C000BD4205D2B84503D245EA0600800701D0B4 +:1047D0001020EDE73046DCF735FD10B9B9F1000FD8 +:1047E00001D00F20E4E7374837490068884205D0F8 +:1047F000224631462846FFF7F1FE1AE0FFF79EFFFA +:104800000028D5D1294800218560C0E90364817062 +:10481000F1F7C3FD08B12D4801E04AF2F87060439A +:104820004FF47A7100F2E730B0FBF1F01830FFF787 +:1048300068FF0020BCE770B505464FF08050046962 +:104840006C432046DCF7FEFC08B10F2070BD01F080 +:10485000F2F8A84201D8102070BD1A481A49006821 +:10486000884203D0204601F0D3F810E0FFF766FF3E +:104870000028F1D10D48012184608170F1F78DFD90 +:1048800008B1134800E013481830FFF73AFF002042 +:1048900070BD10B5054C6078F0F7A9FC00B9FFDFDA +:1048A0000020207010BDF0F7E5BE0000B40100202C +:1048B00004E5014000E40140105C0C00841200207B +:1048C0005346020058000020BEBAFECA5028050018 +:1048D000645E0100A85B01007E4909680160002058 +:1048E00070477C4908600020704701218A0720B189 +:1048F000012804D042F204007047916700E0D167BC +:104900000020704774490120086042F20600704799 +:1049100008B50423704A1907103230B1C1F80433C6 +:10492000106840F0010010600BE0106820F00100FA +:104930001060C1F808330020C1F80801674800681A +:104940000090002008BD011F0B2909D862491031D1 +:104950000A6822F01E0242EA400008600020704708 +:1049600042F2050070470F2809D85B4910310A68E8 +:1049700022F4706242EA002008600020704742F290 +:1049800005007047000100F18040C0F804190020C4 +:104990007047000100F18040C0F8081900207047FE +:1049A000000100F18040D0F8000908600020704745 +:1049B000012801D907207047494A52F820000268AF +:1049C0000A43026000207047012801D90720704780 +:1049D000434A52F8200002688A4302600020704770 +:1049E000012801D9072070473D4A52F8200000688D +:1049F00008600020704702003A494FF0000003D0E1 +:104A0000012A01D0072070470A607047020036492A +:104A10004FF0000003D0012A01D0072070470A6040 +:104A2000704708B54FF40072510510B1C1F8042366 +:104A300008E0C1F808230020C1F8240127481C30F1 +:104A400000680090002008BD08B58022D10510B193 +:104A5000C1F8042308E0C1F808230020C1F81C01B4 +:104A60001E48143000680090002008BD08B54FF4BF +:104A70008072910510B1C1F8042308E0C1F8082341 +:104A80000020C1F82001154818300068009000206F +:104A900008BD10493831096801600020704770B5C1 +:104AA0004FF080450024C5F80841F1F782FC10B9A9 +:104AB000F1F789FC28B1C5F82441C5F81C41C5F8B7 +:104AC00020414FF0E020802180F800140121C0F83F +:104AD000001170BD000400400005004008010040C6 +:104AE0003865020078050040800500406249634B4C +:104AF0000A6863499A42096801D1C1F31001016053 +:104B0000002070475C495D4B0A685D49091D9A4267 +:104B100001D1C0F310000860002070475649574B80 +:104B20000A68574908319A4201D1C0F31000086061 +:104B30000020704730B5504B504D1C6842F20803BE +:104B4000AC4202D0142802D203E0112801D3184647 +:104B500030BDC3004B481844C0F81015C0F81425E8 +:104B6000002030BD4449454B0A6842F209019A428F +:104B700002D0062802D203E0042801D30846704779 +:104B8000404A012142F83010002070473A493B4B1F +:104B90000A6842F209019A4202D0062802D203E0D2 +:104BA000042801D308467047364A012102EBC000B1 +:104BB00041600020704770B52F4A304E314C156867 +:104BC00042F2090304EB8002B54204D0062804D265 +:104BD000C2F8001807E0042801D3184670BDC1F3DD +:104BE0001000C2F80008002070BD70B5224A234EA4 +:104BF000244C156842F2090304EB8002B54204D04C +:104C0000062804D2D2F8000807E0042801D3184689 +:104C100070BDD2F80008C0F310000860002070BD1D +:104C2000174910B50831184808601120154A0021AD +:104C300002EBC003C3F81015C3F81415401C142868 +:104C4000F6D3002006E0042804D302EB8003C3F867 +:104C5000001807E002EB8003D3F80048C4F3100407 +:104C6000C3F80048401C0628EDD310BD044906488F +:104C7000083108607047000058000020BEBAFECA24 +:104C800000F5014000F001400000FEFF814B1B6871 +:104C900003B19847BFF34F8F7F4801687F4A01F403 +:104CA000E06111430160BFF34F8F00BFFDE710B516 +:104CB000EFF3108010F0010F72B601D0012400E074 +:104CC000002400F0DDF850B1DCF760FBF0F759F894 +:104CD000F1F78DFAF1F7AEFF71490020086004B9D1 +:104CE00062B6002010BD2DE9F0410C460546EFF3F9 +:104CF000108010F0010F72B601D0012600E00026EE +:104D000000F0BEF820B106B962B60820BDE8F08117 +:104D100001F044F9DCF73EFB02460020012347097D +:104D2000BF0007F1E02700F01F01D7F80071CF4066 +:104D3000F9071BD0202803D222FA00F1C90727D196 +:104D400041B2002904DB01F1E02191F8001405E0F3 +:104D500001F00F0101F1E02191F8141D4909082922 +:104D600016D203FA01F717F0EC0F11D0401C64289B +:104D7000D5D3F1F73DFF4B4A4B490020F1F780FFB7 +:104D800047494A4808602046DCF763FA60B904E006 +:104D900006B962B641F20100B8E73E4804602DB1A1 +:104DA0002846DCF7A3FA18B1102428E0404D19E09A +:104DB0002878022802D94FF4805420E007240028E4 +:104DC000687801D0D8B908E0C8B1202817D8A878E9 +:104DD000212814D8012812D001E0A87878B9E87801 +:104DE0000B280CD8DCF7D6FA2946F1F7E6F9EFF7ED +:104DF00087FF00F053FE2846DCF796FA044606B912 +:104E000062B61CB1FFF753FF20467FE700207DE725 +:104E100010B5044600F034F800B1012020700020E5 +:104E200010BD244908600020704770B50C46224927 +:104E30000D682149214E08310E60102807D0112835 +:104E40000CD012280FD0132811D0012013E0D4E980 +:104E50000001FFF748FF354620600DE0FFF727FF10 +:104E60000025206008E02068FFF7D2FF03E0114929 +:104E700020680860002020600F48001D056070BD9C +:104E800007480A490068884201D101207047002084 +:104E900070470000CC0100200CED00E00400FA0592 +:104EA000580000204814002000000020BEBAFECAAE +:104EB00040650200040000201005024001000001CE +:104EC00000B59B4902282ED021DC10F10C0F08BF41 +:104ED000F42028D00FDC10F1280F08BFD82022D0F2 +:104EE00010F1140F08BFEC201DD010F1100F08BFF7 +:104EF000F02018D021E010F1080F08BFF82012D0E0 +:104F000010F1040F0CBFFC2000280CD015E0A0F11C +:104F10000300062811D2DFE800F00E0C0A08050392 +:104F2000082000E00720086000BD0620FBE7052000 +:104F3000F9E70420F7E70320F5E7FFDF00BD00B540 +:104F40007C49012808BF03200CD0022808BF042098 +:104F500008D0042808BF062004D0082816BFFFDFA9 +:104F6000052000BD086000BD70B505460C4616461C +:104F70001046F2F787F8022C08BF4FF47A7105D07B +:104F8000012C0CBF4FF4C86140F634014418304680 +:104F9000F2F7EEF8204449F6797108444FF47A713B +:104FA000B0FBF1F0281A70BD70B505460C460846F6 +:104FB000F3F7AEF9022C08BF40F24C4105D0012CAA +:104FC0000CBF40F634014FF4AF5149F6CA62511A92 +:104FD00008444FF47A7100F2E140B0FBF1F0281A76 +:104FE000801E70BD70B5064615460C460846F3F7A0 +:104FF0008FF9022D08BF4FF47A7105D0012D0CBF37 +:105000004FF4C86140F63401022C08BF40F24C4214 +:1050100005D0012C0CBF40F634024FF4AF52891A70 +:10502000084449F6FC6108444FF47A71B0FBF1F092 +:10503000301A70BD70B504460E460846F2F722F8E5 +:1050400005463046F2F794F828444AF2AB3108445A +:105050004FF47A71B0FBF1F0201A801E70BD2DE97B +:10506000F04107461E460D4614461046082A16BF54 +:1050700004284EF62830F2F705F807EB4701C1EB9C +:10508000C71100EBC100022D08BF40F24C4105D012 +:10509000012D0CBF40F634014FF4AF51471828469C +:1050A000F3F736F9381A4FF47A7100F6B730B0FBDF +:1050B000F1F52046F2F76BF828443044401DBDE876 +:1050C000F08170B5054614460E460846F1F7DAFF42 +:1050D00005EB4502C2EBC512C0EBC2053046F2F744 +:1050E00047F82D1A2046082C16BF04284EF6283003 +:1050F000F1F7C8FF28444FF47A7100F6B730B0FBDF +:10510000F1F52046F2F743F82844401D70BD0A49E6 +:10511000082818BF0428086803BF20F46C5040F426 +:10512000444040F0004020F000400860704700001C +:105130000C1500401015004040170040F0B585B038 +:105140000C460546F9F7FAF807466E78204603A99B +:105150006A46EDF7C0FC81198EB258B1012F02D01A +:10516000032005B0F0BD204604AA0399EDF7D5FB56 +:10517000049D01E0022F0FD1ED1C042E0FD32888CF +:10518000BDF80010001D80B2884201D8864202D1CD +:105190004FF00000E5E702D34FF00200E1E74FF0E7 +:1051A0000100DEE7FA48C078FF2814BF0120002084 +:1051B00070472DE9F041F74C0746160060680D4630 +:1051C00003D0F9F725F8A0B121E0F9F721F8D8B913 +:1051D0006068F9F71DF8D0B915F00C0F17D06068AA +:1051E000C17811F03F0F1CBF007910F0100F0ED0E6 +:1051F0000AE0022E08D0E6481FB1807DFF2806D0C5 +:1052000002E0C078FF2802D00120BDE8F081002034 +:10521000BDE8F0810A4601460120CAE710B5DC4C22 +:105220001D220021A01CE9F72AF97F206077FF20CA +:105230002074E070A075A08920F060002030A0816B +:105240000020207010BD70B5D24948600120087060 +:10525000D248D149002541600570CD4C1D22294618 +:10526000A01CE9F70CF97F206077FF202074E07024 +:10527000A075A08920F060002030A081257070BD4D +:105280002DE9F047C24C06462078C24F4FF0010985 +:1052900007F10808002520B13878D0B998F8000047 +:1052A000B8B198F8000068B387F80090D8F80410F7 +:1052B0003C2239B37570301DE9F7B7F8052030701E +:1052C00086F804903878002818BF88F8005005D078 +:1052D00015E03D70A11C4FF48E72EAE71D220021FB +:1052E000A01CE9F7CCF87F206077FF202074E070E5 +:1052F000A075A08920F060002030A08125700120D9 +:10530000BDE8F0870020BDE8F087A14800780028BC +:105310000CBF0120002070470A460146002048E7E4 +:1053200010B510B1022810D014E09A4C6068F8F75C +:105330006FFF78B96068C17811F03F0F1CBF00792A +:1053400010F0100F06D1012010BD9148007B10F025 +:10535000080FF8D1002010BD2DE9FF4F81B08C4D12 +:105360008346DDE90F042978DDF838A09846164613 +:1053700000291CBF05B0BDE8F08F884909780029D5 +:105380001CBF05B0BDE8F08FE872B4B1012E08BFB4 +:10539000012708D0022E08BF022704D0042E16BF12 +:1053A000082E0327FFDFEF7385F81E804FF00008FB +:1053B000784F8CB1022C1DD020E0012E08BF0127B0 +:1053C00008D0022E08BF022704D0042E16BF082ED4 +:1053D0000327FFDFAF73E7E77868F8F719FF68B9CD +:1053E0007868C17811F03F0F1CBF007910F0100FE2 +:1053F00004D110E0287B10F0080F0CD14FF003010E +:105400007868F8F7B9FD30B1417809092974008846 +:10541000C0F30B006882CDF800807868F8F7F8FEDA +:1054200001460128BDF8000005F102090CBF40F05B +:10543000010020F00100ADF8000099F80A2012F0F8 +:10544000020F4ED1022918BF20F0020049D000BF40 +:10545000ADF8000010F0020F04D0002908BF40F0A2 +:10546000080801D020F00808ADF800807868C178FD +:1054700011F03F0F1CBF007910F0020F0CD0314625 +:1054800022464FF00100FFF794FE002804BF48F0C9 +:105490000400ADF8000006D099F80A00800860F317 +:1054A0008208ADF8008099F80A004109BDF80000B3 +:1054B00061F34610ADF8000080B20090BDF8000026 +:1054C000A88104217868F8F757FD002804BFA8894F +:1054D00020F060000CD0B0F80100C004C00C03D074 +:1054E00007E040F00200B3E7A88920F060004030F8 +:1054F000A8815CB916F00C0F08D07868C17811F05B +:105500003F0F1CBF007910F0100F0DD17868C178E3 +:1055100011F03F0F08D0017911F0400F04D006219F +:10552000F8F72AFD00786877314622460020FFF719 +:1055300040FE60BB7968C87810F03F0F3FD0087913 +:1055400010F0010F3BD0504605F1040905F10308A6 +:10555000BAF1FF0F0DD04A464146F7F7AFFA0028DF +:1055600008BFFFDF98F8000040F0020088F8000054 +:1055700025E00846F8F797FC88F800007868F8F707 +:1055800069FC07280CD249467868F8F76EFC16E0EB +:1055900094120020D0010020D2120020D801002057 +:1055A0007868F8F757FC072809D100217868F8F7E0 +:1055B000E3FC0168C9F800108088A9F804003146AE +:1055C00022460120FFF7F5FD80BB7868C17811F015 +:1055D0003F0F2BD0017911F0020F27D005F11706EC +:1055E00005F11608BBF1020F18BFBBF1030F08D07D +:1055F000F8F730FC07280AD231467868F8F743FC00 +:1056000012E00298016831608088B0800CE0786810 +:10561000F8F720FC072807D101217868F8F7ACFCDF +:10562000016831608088B08088F800B0002C04BF29 +:1056300005B0BDE8F08F7868F8F7EAFD022804BFEE +:1056400005B0BDE8F08F05F11F047868F8F729FE72 +:10565000AB7AC3F1FF01884228BF084605D9A98962 +:1056600021F0600101F14001A981C2B203EB040104 +:105670007868F8F71EFEA97A0844A87205B0BDE85C +:10568000F08FB0480178002918BF704701220270DE +:10569000007B10F0080F14BF07200620FCF725BE82 +:1056A000A848C17B002908BF70470122818921F0E9 +:1056B0006001403181810378002B18BF7047027070 +:1056C00011F0080F14BF07200620FCF70EBE2DE9CD +:1056D000FF5F9C4FDDF838B0914638780E460028C1 +:1056E0001CBF04B0BDE8F09FBC1C1D220021204659 +:1056F000E8F7C5FE944D4FF0010A84F800A06868F1 +:10570000F8F7A8FB18B3012826D0022829D00628CC +:1057100018BFFFDF2AD000BF04F11D016868F8F749 +:10572000E2FB2072484604F1020904F10108FF2857 +:1057300021D04A464146F7F7C1F9002808BFFFDFEC +:1057400098F8000040F0020088F8000031E060891D +:1057500040F013006081DFE7608940F01500608150 +:10576000E0E7608940F010006081D5E7608940F093 +:1057700012006081D0E76868F8F795FB88F80000B0 +:105780006868F8F767FB072804D249466868F8F7A5 +:105790006CFB0EE06868F8F75DFB072809D1002173 +:1057A0006868F8F7E9FB0168C9F800108088A9F873 +:1057B000040084F809B084F80CA000206073FF2076 +:1057C000A073A17A11F0040F08BF20752AD004F14C +:1057D000150804F11409022E18BF032E09D06868B9 +:1057E000F8F738FB07280CD241466868F8F74BFBFE +:1057F00016E000980168C8F800108088A8F8040036 +:105800000EE06868F8F726FB072809D101216868CF +:10581000F8F7B2FB0168C8F800108088A8F8040007 +:1058200089F800607F20E0760398207787F800A051 +:1058300004B00620BDE8F05FFCF757BD2DE9FF5F1F +:10584000424F81469A4638788B4600281CBF04B0E8 +:10585000BDE8F09F3B48017831B1007B10F0100F9C +:1058600004BF04B0BDE8F09F1D227C6800212046E3 +:10587000E8F705FE48464FF00108661C324D84F8F3 +:10588000008004F10209FF280BD04A463146F7F7A1 +:1058900015F9002808BFFFDF307840F002003070B3 +:1058A0001CE06868F8F7FFFA30706868F8F7D2FA19 +:1058B000072804D249466868F8F7D7FA0EE0686806 +:1058C000F8F7C8FA072809D100216868F8F754FBEF +:1058D0000168C9F800108088A9F8040004F11D01CE +:1058E0006868F8F700FB207284F809A060896BF300 +:1058F000000040F01A00608184F80C800020607382 +:10590000FF20A07320757F20E0760298207787F82B +:10591000008004B00720BDE8F05FFCF7E6BC094A50 +:10592000137C834205BF508A8842002001207047C3 +:105930000448007BC0F3411002280CBF0120002066 +:105940007047000094120020D0010020D8010020F0 +:10595000C2790D2341B342BB8188012904D949088A +:10596000818004BF012282800168012918BF0029BB +:1059700030D001686FEA0101C1EBC10202EB0112F4 +:1059800081796FEA010101EB8103C3EB81111144BD +:105990004FEA914201608188B2FBF1F301FB1321D0 +:1059A00081714FF0010102E01AB14FF00001C171A5 +:1059B00070478188FF2908D24FF6FF7202EA410141 +:1059C0008180FF2984BFFF2282800168012918BFDE +:1059D0000029CED10360CCE7817931B1491E11F0A5 +:1059E000FF0181711CBF002070470120704710B576 +:1059F0000121C1718171818004460421F0F7A6FD67 +:105A0000002818BF10BD2068401C206010BD000099 +:105A10000B4A022111600B490B68002BFCD0084B8C +:105A20001B1D186008680028FCD000201060086862 +:105A30000028FCD070474FF080504069704700004C +:105A400004E5014000E4014002000B464FF0000075 +:105A5000014620D0012A04D0022A04D0032A0DD105 +:105A600003E0012002E0022015E00320072B05D20D +:105A7000DFE803F00406080A0C0E10000720704748 +:105A8000012108E0022106E0032104E0042102E0F4 +:105A9000052100E00621EFF76CBB0000E24805217C +:105AA00081700021017041707047E0490A78012A35 +:105AB00005D0CA681044C8604038F0F773B88A68E7 +:105AC00010448860F8E7002819D00378D849D94AEB +:105AD00013B1012B0ED011E00379012B00D06BB96B +:105AE00043790BB1012B09D18368643B8B4205D20A +:105AF000C0680EE00379012B02D00BB10020704783 +:105B000043790BB1012BF9D1C368643B8B42F5D2C9 +:105B100080689042F2D801207047C44901220A707F +:105B2000027972B100220A71427962B104224A718B +:105B3000826852328A60C068C860BB49022088709F +:105B400070470322EFE70322F1E770B5B74D044633 +:105B500000202870207988B100202871607978B100 +:105B60000420B14E6871A168F068EFF746F8A860AC +:105B7000E0685230E8600320B07070BD0120ECE7AF +:105B80000320EEE72DE9F04105460226EFF736FF48 +:105B9000006800B1FFDFA44C01273DB12878B8B1FF +:105BA000012805D0022811D0032814D027710DE058 +:105BB0006868C82808D30421F0F75BF820B168684A +:105BC000FFF773FF012603E0002601E000F014F95F +:105BD0003046BDE8F08120780028F7D16868FFF7EB +:105BE00072FF0028E2D06868017879B1A0780428B3 +:105BF00000D0FFDF01216868FFF7A7FF8B49E0783D +:105C000000F003F90028E1D1FFDFDFE7FFF785FFB0 +:105C10006770DBE72DE9F041834C0F46E17888425D +:105C200000D0FFDF00250126082F7DD2DFE807F036 +:105C3000040B28283D434F57A0780328C9D00228D9 +:105C4000C7D0FFDFC5E7A078032802D0022800D024 +:105C5000FFDF0420A07025712078B8BB0020FFF77B +:105C600024FF72480178012906D08068E06000F0C6 +:105C7000EDF82061002023E0E078EFF7F6FBF5E790 +:105C8000A078032802D0022800D0FFDF207880BB54 +:105C9000022F08D05FF00500F0F707FBA07803287B +:105CA00040D0A57095E70420F6E7A078042800D03E +:105CB000FFDF022004E0A078042800D0FFDF0120ED +:105CC000A1688847FFF75EFF054633E003E0A07850 +:105CD000042800D0FFDFBDE8F04100F08DB8A078C7 +:105CE000042804D0617809B1022800D0FFDF2078B1 +:105CF00018B1BDE8F04100F08AB8207920B1062043 +:105D0000F0F7D3FA25710DE0607840B14749E078AB +:105D100000F07BF800B9FFDF65705AE704E0072068 +:105D2000F0F7C3FAA67054E7FFDF52E73DB1012D4B +:105D300003D0FFDF022DF9D14BE70420C0E7032099 +:105D4000BEE770B5050004D0374CA078052806D111 +:105D500001E0102070BD0820F0F7BDFA08B1112055 +:105D600070BD3548EFF7E8F9E070202806D0012132 +:105D7000F0F79AF80020A560A07070BD032070BDF8 +:105D8000294810B5017809B1112010BD8178052985 +:105D900006D0012906D029B101210170002010BDD3 +:105DA0000F2010BD00F033F8F8E770B51E4C054623 +:105DB000A07808B1012809D155B12846FFF783FE24 +:105DC00040B1287840B1A078012809D00F2070BDDB +:105DD000102070BD072070BD2846FFF79EFE03E02F +:105DE00000212846FFF7B1FE1049E07800F00DF8D9 +:105DF00000B9FFDF002070BD0B4810B5006900F04E +:105E00001DF8BDE81040EFF71CB9EFF733BC0648AA +:105E100010B5C078EFF7EBF900B9FFDF0820F0F715 +:105E200044FABDE8104039E6E0010020B413002038 +:105E30003D860100FF1FA107155C02000C490A689E +:105E400048F202139A4302430A607047084A1168F5 +:105E500048F2021301EA03009943116070470246B9 +:105E6000044B10201344FC2B01D811600020704714 +:105E7000C80602400018FEBF01B41EB400B5F0F71A +:105E80002DFC01B40198864601BC01B01EBD000086 +:105E90008269034981614FF001001044704700009E +:105EA000795E0200FEDF18490978F9B904207146CD +:105EB00008421BD10699154A914217DC069902291E +:105EC00014DB02394878DF2810D10878FE2807D083 +:105ED000FF280BD14FF001004FF000020C4B184788 +:105EE00041F201000099019A094B1847094B002B18 +:105EF00002D01B68DB6818474FF0FF3071464FF047 +:105F00000002034B1847000028ED00E0007002007B +:105F10008D4C020004000020174818497047FFF715 +:105F2000FBFFDBF74BF900BD1548164909688842AD +:105F300003D1154A13605B68184700BD20BFFDE719 +:105F40000F4810490968884210D1104B18684FF06B +:105F5000FF318842F2D080F308884FF02021884238 +:105F600004DD0B48026803210A43026009488047A8 +:105F700009488047FFDF0000C8130020C813002035 +:105F8000001000000000002004000020007002004B +:105F900014090040912F0000295F0200F0B4404630 +:105FA000494652465B460FB402A0013001B506488F +:105FB000004700BF01BC86460FBC8046894692461A +:105FC0009B46F0BC70470000091100000420714698 +:105FD000084202D0EFF3098101E0EFF308818869FC +:105FE00002380078102813DB20280FDB2C280BDB6D +:105FF0000A4A12680A4B9A4203D1602804DB094A14 +:106000001047022008607047074A1047074A1047A8 +:10601000074A12682C32126810470000580000200E +:10602000BEBAFECA99130000114402002B4E0200B2 +:10603000040000200D4B0E4908470E4B0C49084741 +:106040000D4B0B4908470D4B094908470C4B0849B4 +:1060500008470C4B064908470B4B054908470B4BB3 +:10606000034908470A4B02490847000031BF0000B6 +:1060700069C10000512D0000CB2B0000592B0000FE +:10608000D92D0000B513000017290000552F00007E +:10609000D12F000000210160818070470021016044 +:1060A0004160017270470A6802600B7903717047A2 +:1060B000B99700005F990000C19A0000259B00007D +:1060C0005F9B0000939B0000CD9B0000FD9B0000A8 +:1060D000919C0000AD980000E59A0000331200008A +:1060E000FD43000049440000AF4400003B45000070 +:1060F0006146000037470000694700004148000042 +:10610000DB4800002F490000154A0000354A000016 +:10611000AD160000D1160000F11500004D1600006C +:10612000031700009717000023610000E3620000DE +:10613000C9660000E36700006B680000E9680000C2 +:106140004D690000716A0000416B0000AD6B0000FA +:10615000574A00005D4A0000674A0000CF4A00002D +:10616000FB4A0000B74C0000E14C0000194D000054 +:10617000834D00006D4E0000834E00006D44000012 +:10618000974E0000B94E0000FF4E00003312000091 +:106190003312000033120000331200009F2500006C +:1061A00025260000412600005D260000EB270000A8 +:1061B0008726000091260000D3260000F526000067 +:1061C000D127000013280000331200003312000012 +:1061D000DF840000FF840000098500004385000083 +:1061E0007185000061860000EF86000003870000D3 +:1061F00051870000678800000D8A0000358B000081 +:10620000617400004D8B0000331200003312000057 +:10621000DBB700003DB9000097B9000011BA0000DB +:10622000BDBA0000010000000000000010011001D4 +:106230003A0200001A02000007000000FFFFFFFF03 +:106240000000FFFFE3B300002B3D000043210000EE +:10625000AB7400004990000000000000F9920000BB +:10626000D5920000E792000000000200000000004C +:10627000000200000000000000010000000000001B +:106280008B8200006B820000D98200002125000073 +:10629000E324000003250000CBAA0000F7AA0000B9 +:1062A000FFAC00001D5A0000F98200000000000051 +:1062B000298300006F25000000000000000000009E +:1062C00000000000E1AB000000000000B15A000037 +:1062D0000300000001555555D6BE898E00006406A6 +:1062E000640C641200000803AC055008000054045C +:1062F0004408340CD5FD000069FF0000A5FB000038 +:10630000D1FD0000419901009D0401000000000042 +:10631000900A0000900A00009B5700009B57000065 +:10632000D743000043B200002F7700005320000045 +:106330007D3B0200AFAD0100DD570000DD570000DE +:10634000FB430000D5B20000B7770000C720000073 +:10635000AB3B0200C5AD0100700170014000380088 +:106360005C0024006801200200000300656C746278 +:10637000000000000000000000000000000000001D +:106380008700000000000000000000000000000086 +:10639000BE83605ADB0B376038A5F5AA9183886C01 +:1063A000010000002B370100FD4501000000000145 +:1063B00002060304050000000700000000000000C2 +:1063C000060000000A000000320000007300000018 +:1063D000B4000000F401FA00960064004B003200A3 +:1063E0001E0014000A000500020001000049000020 +:1063F00000000000C9C0010087C2010015C20100F1 +:10640000DDC001000000000015C50100AAAED7AB39 +:10641000154120100C0802170D01010209090101A4 +:106420000602091818030101090903030500000009 +:10643000555555252627D6BE898E0000EBFB010059 +:10644000C3F7010009FB0100FFF201007B230200FA +:1064500077FC0100F401FA00960064004B00320062 +:106460001E0014000A00050002000100254900007A +:1064700000000000ED4A0200054B02001D4B020027 +:10648000354B0200654B02008D4B0200B74B0200FA +:10649000EB4B020037480200734702005D440200E4 +:1064A0005F5E0200496401005964010085640100D7 +:1064B000576501005F65010071650100EB4802004E +:1064C00005490200D9480200E348020011490200D0 +:1064D00047490200674902008549020093490200CA +:1064E000A1490200B1490200C9490200E149020084 +:1064F000F74902000D4A020000000000CFBC000076 +:1065000025BD00003BBD0000495A0200894402003D +:1065100055450200435D0200815D0200AB5D020053 +:106520004D62010099670100234A0200494A0200B6 +:106530006D4A0200934A02001C05004020050040FD +:10654000001002006465020008000020EC01000059 +:106550004411000098650200F4010020D4110000ED +:10656000A011000001141348140244200B200C0653 +:10657000481A010222902720FB349B5F8012800280 +:106580001E1013770B1B2034041ABA04019C091641 +:08659000C7327F0B744411BCFB +:00000001FF diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk index c75c6dd394..08915a19b9 100644 --- a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk @@ -1,6 +1,5 @@ USB_VID = 0x239A USB_PID = 0x802A - USB_PRODUCT = "TG-Watch02A" USB_MANUFACTURER = "TG-Tech" @@ -9,3 +8,12 @@ MCU_CHIP = nrf52840 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q128JV_SQ" + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LSM6DS +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_FocalTouch +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DS3231 +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DRV2605 +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BLE +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk index f63554e5e8..38c9933340 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk @@ -11,7 +11,6 @@ EXTERNAL_FLASH_DEVICES = "GD25Q16C" # Allocate two, not just one I2C peripheral for CPB, so that we have both # on-board and off-board I2C available. -# When SPIM3 becomes available we'll be able to have two I2C and two SPI peripherals. # We use a CFLAGS define here because there are include order issues # if we try to include "mpconfigport.h" into nrfx_config.h . CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2 diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index 2370a0aa1b..45452a35ea 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -31,7 +31,6 @@ #include "shared-bindings/displayio/FourWire.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index bbb20cc6e5..9fcf9d2bff 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -31,7 +31,6 @@ #include "shared-bindings/displayio/FourWire.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/cxd56/tick.h b/ports/nrf/boards/pca10100/board.c similarity index 85% rename from ports/cxd56/tick.h rename to ports/nrf/boards/pca10100/board.c index d641d9cd4f..f891f54a13 100644 --- a/ports/cxd56/tick.h +++ b/ports/nrf/boards/pca10100/board.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright 2019 Sony Semiconductor Solutions Corporation + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,9 +24,15 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_CXD56_TICK_H -#define MICROPY_INCLUDED_CXD56_TICK_H +#include "boards/board.h" -#include "py/mpconfig.h" +void board_init(void) { +} -#endif // MICROPY_INCLUDED_CXD56_TICK_H +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/cxd56/common-hal/time/__init__.c b/ports/nrf/boards/pca10100/mpconfigboard.h similarity index 59% rename from ports/cxd56/common-hal/time/__init__.c rename to ports/nrf/boards/pca10100/mpconfigboard.h index 31c63cbb29..c645b778be 100644 --- a/ports/cxd56/common-hal/time/__init__.c +++ b/ports/nrf/boards/pca10100/mpconfigboard.h @@ -3,7 +3,8 @@ * * The MIT License (MIT) * - * Copyright 2019 Sony Semiconductor Solutions Corporation + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,22 +25,24 @@ * THE SOFTWARE. */ -#include +#include "nrfx/hal/nrf_gpio.h" -#include "py/mphal.h" +#define MICROPY_HW_BOARD_NAME "PCA10100 nRF52833 Dongle" +#define MICROPY_HW_MCU_NAME "nRF52833" -#include "supervisor/shared/tick.h" +#define MICROPY_HW_LED_STATUS (&pin_P0_13) +#define MICROPY_HW_LED_TX (&pin_P0_14) +#define MICROPY_HW_LED_RX (&pin_P0_15) -uint64_t common_hal_time_monotonic(void) { - return supervisor_ticks_ms64(); -} +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (60*1024) -uint64_t common_hal_time_monotonic_ns(void) { - struct timeval tv; - gettimeofday(&tv, NULL); - return 1000 * ((uint64_t) tv.tv_sec * 1000000 + (uint64_t) tv.tv_usec); -} +#define CIRCUITPY_BLE_CONFIG_SIZE (12*1024) -void common_hal_time_delay_ms(uint32_t delay) { - mp_hal_delay_ms(delay); -} +// Reduce nRF SoftRadio memory usage +#define BLEIO_VS_UUID_COUNT 10 +#define BLEIO_HVN_TX_QUEUE_SIZE 2 +#define BLEIO_CENTRAL_ROLE_COUNT 2 +#define BLEIO_PERIPH_ROLE_COUNT 2 +#define BLEIO_TOTAL_CONNECTION_COUNT 2 +#define BLEIO_ATTR_TAB_SIZE (BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 2) diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk new file mode 100644 index 0000000000..1206c8fe59 --- /dev/null +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -0,0 +1,25 @@ +USB_VID = 0x239A +USB_PID = 0x802A +USB_PRODUCT = "PCA10100" +USB_MANUFACTURER = "Nordic Semiconductor" + +MCU_CHIP = nrf52833 + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_BUSIO = 1 +CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_PIXELBUF = 0 +CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 1 +CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_ULAB = 0 + +# These defines must be overridden before mpconfigboard.h is included, which is +# why they are passed on the command line. +CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' diff --git a/ports/nrf/boards/pca10100/pins.c b/ports/nrf/boards/pca10100/pins.c new file mode 100644 index 0000000000..dd030bae9a --- /dev/null +++ b/ports/nrf/boards/pca10100/pins.c @@ -0,0 +1,54 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P1_03) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P1_05) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_21) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P0_23) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_P0_00) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_P0_01) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_P0_18) }, + { MP_ROM_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_P1_09) }, + + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_P0_16) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON1_DEFAULT), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON1_OPTIONAL), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON2_DEFAULT), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON2_OPTIONAL), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON3), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON4), MP_ROM_PTR(&pin_P0_25) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/nrf/boards/pitaya_go/README.md b/ports/nrf/boards/pitaya_go/README.md new file mode 100644 index 0000000000..a58b752892 --- /dev/null +++ b/ports/nrf/boards/pitaya_go/README.md @@ -0,0 +1,40 @@ +# Makerdiary Pitaya Go + +>Pitaya Go is a compact and versatile development platform for IoT solutions, +combining the Nordic's high-end multiprotocol SoC nRF52840 and the Microchip's +extreme low power Wi-Fi® network controller ATWINC1500B. It offers a complete +solution for wireless connectivity with IEEE 802.11 b/g/n, Bluetooth 5, Thread +and Zigbee, that is specifically designed for the IoT. +Pitaya Go features a Battery Charger with power path management, 64Mbit ultra +low power QSPI Flash memory, additional NFC-A Tag PCB Antenna, user +programmable RGB LED and Buttons, reversible USB-C Connector and easily +expandable Header Sockets. All these features above make this board an ideal +choice for the next IoT project. + +from [Makerdiary](https://store.makerdiary.com/products/pitaya-go) + + +## Installing CircuitPython submodules + +Before you can build, you will need to run the following commands once, which +will install the submodules that are part of the CircuitPython ecosystem, and +build the `mpy-cross` tool: + +``` +$ cd circuitpython +$ git submodule update --init +$ make -C mpy-cross +``` + + +## Building +```sh +$ cd ports/nrf +$ make BOARD=pitaya_go SD=s140 -V=1 -j4 +``` + +# Flashing CircuitPython + +The Pitaya Go has a pre-programmed bootloader which can be used to program the +Pitaya Go. Follow [the guide - How to Program Pitaya Go](https://wiki.makerdiary.com/pitaya-go/programming/) +to flash the CircuitPython firmware. diff --git a/ports/atmel-samd/tick.h b/ports/nrf/boards/pitaya_go/board.c similarity index 73% rename from ports/atmel-samd/tick.h rename to ports/nrf/boards/pitaya_go/board.c index 334352df26..4421970eef 100644 --- a/ports/atmel-samd/tick.h +++ b/ports/nrf/boards/pitaya_go/board.c @@ -23,20 +23,16 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_TICK_H -#define MICROPY_INCLUDED_ATMEL_SAMD_TICK_H -#include "py/mpconfig.h" +#include "boards/board.h" -extern struct timer_descriptor ms_timer; +void board_init(void) { +} -void tick_init(void); +bool board_requests_safe_mode(void) { + return false; +} -void tick_delay(uint32_t us); +void reset_board(void) { -void current_tick(uint64_t* ms, uint32_t* us_until_ms); -// Do not call this with interrupts disabled because it may be waiting for -// ticks_ms to increment. -void wait_until(uint64_t ms, uint32_t us_until_ms); - -#endif // MICROPY_INCLUDED_ATMEL_SAMD_TICK_H +} diff --git a/ports/litex/tick.h b/ports/nrf/boards/pitaya_go/mpconfigboard.h similarity index 63% rename from ports/litex/tick.h rename to ports/nrf/boards/pitaya_go/mpconfigboard.h index b4d27b8416..7f9eff7164 100644 --- a/ports/litex/tick.h +++ b/ports/nrf/boards/pitaya_go/mpconfigboard.h @@ -3,7 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * Copyright (c) 2020 Yihui Xiong * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,24 +25,19 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_LITEX_TICK_H -#define MICROPY_INCLUDED_LITEX_TICK_H -#include "py/mpconfig.h" +#include "nrfx/hal/nrf_gpio.h" -#include +#define MAKERDIARYPITAYAGO -extern volatile uint64_t ticks_ms; +#define MICROPY_HW_BOARD_NAME "Makerdiary Pitaya Go" +#define MICROPY_HW_MCU_NAME "nRF52840" -extern struct timer_descriptor ms_timer; +#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 6) +#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(1, 1) +#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(1, 5) +#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(1, 2) +#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 4) +#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 3) -void tick_init(void); - -void tick_delay(uint32_t us); - -void current_tick(uint64_t* ms, uint32_t* us_until_ms); -// Do not call this with interrupts disabled because it may be waiting for -// ticks_ms to increment. -void wait_until(uint64_t ms, uint32_t us_until_ms); - -#endif // MICROPY_INCLUDED_LITEX_TICK_H +#define BOARD_HAS_CRYSTAL 1 diff --git a/ports/nrf/boards/pitaya_go/mpconfigboard.mk b/ports/nrf/boards/pitaya_go/mpconfigboard.mk new file mode 100644 index 0000000000..247ddd8ac5 --- /dev/null +++ b/ports/nrf/boards/pitaya_go/mpconfigboard.mk @@ -0,0 +1,11 @@ +# Using Nordic's VID - https://devzone.nordicsemi.com/f/nordic-q-a/50638/usb-pid-for-nrf52840 +USB_VID = 0x1915 +USB_PID = 0xb001 +USB_PRODUCT = "Pitaya Go" +USB_MANUFACTURER = "Makerdiary" + +MCU_CHIP = nrf52840 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "MX25R6435F" diff --git a/ports/nrf/boards/pitaya_go/pins.c b/ports/nrf/boards/pitaya_go/pins.c new file mode 100644 index 0000000000..92411581bc --- /dev/null +++ b/ports/nrf/boards/pitaya_go/pins.c @@ -0,0 +1,64 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_AIN0), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_AIN1), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_AIN2), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_AIN3), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_AIN4), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_AIN5), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_AIN6), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_AIN7), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_AREF), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_VDIV), MP_ROM_PTR(&pin_P0_05) }, + + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_P10), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_P11), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_P12), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_P13), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_P14), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_P15), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_P16), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_P17), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_P18), MP_ROM_PTR(&pin_P0_18) }, + { MP_ROM_QSTR(MP_QSTR_P19), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_P20), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_P21), MP_ROM_PTR(&pin_P0_21) }, + { MP_ROM_QSTR(MP_QSTR_P22), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_P23), MP_ROM_PTR(&pin_P0_23) }, + { MP_ROM_QSTR(MP_QSTR_P24), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_P25), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_P26), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_P27), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_P28), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_P29), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_P30), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_P31), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_CSN), MP_ROM_PTR(&pin_P1_03) }, + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_P1_05) }, + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_P1_02) }, + + { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_P0_12) }, + + { MP_ROM_QSTR(MP_QSTR_USR_BTN), MP_ROM_PTR(&pin_P1_00) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/common-hal/time/__init__.c b/ports/nrf/boards/simmel/board.c similarity index 72% rename from ports/stm/common-hal/time/__init__.c rename to ports/nrf/boards/simmel/board.c index c85077868a..f891f54a13 100644 --- a/ports/stm/common-hal/time/__init__.c +++ b/ports/nrf/boards/simmel/board.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,22 +24,15 @@ * THE SOFTWARE. */ -#include "py/mphal.h" +#include "boards/board.h" -#include "tick.h" - -uint64_t common_hal_time_monotonic(void) { - return supervisor_ticks_ms64(); +void board_init(void) { } -uint64_t common_hal_time_monotonic_ns(void) { - uint64_t ms; - uint32_t us_until_ms; - current_tick(&ms, &us_until_ms); - // us counts down. - return 1000 * (ms * 1000 + (1000 - us_until_ms)); +bool board_requests_safe_mode(void) { + return false; } -void common_hal_time_delay_ms(uint32_t delay) { - mp_hal_delay_ms(delay); +void reset_board(void) { + } diff --git a/ports/nrf/boards/simmel/mpconfigboard.h b/ports/nrf/boards/simmel/mpconfigboard.h new file mode 100644 index 0000000000..4c73e86eb2 --- /dev/null +++ b/ports/nrf/boards/simmel/mpconfigboard.h @@ -0,0 +1,54 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "Simmel" +#define MICROPY_HW_MCU_NAME "nRF52833" + +#define MICROPY_HW_LED_STATUS (&pin_P0_06) + +#if SPI_FLASH_FILESYSTEM +#define SPI_FLASH_MOSI_PIN &pin_P0_09 +#define SPI_FLASH_MISO_PIN &pin_P1_04 +#define SPI_FLASH_SCK_PIN &pin_P0_10 +#define SPI_FLASH_CS_PIN &pin_P1_06 +#endif + +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (84*1024) + +#define BOOTLOADER_SIZE (0x4000) // 12 kiB +#define CIRCUITPY_BLE_CONFIG_SIZE (12*1024) + +// Reduce nRF SoftRadio memory usage +#define BLEIO_VS_UUID_COUNT 10 +#define BLEIO_HVN_TX_QUEUE_SIZE 2 +#define BLEIO_CENTRAL_ROLE_COUNT 2 +#define BLEIO_PERIPH_ROLE_COUNT 2 +#define BLEIO_TOTAL_CONNECTION_COUNT 2 +#define BLEIO_ATTR_TAB_SIZE (BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 2) diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk new file mode 100644 index 0000000000..e71ada1de6 --- /dev/null +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -0,0 +1,32 @@ +USB_VID = 0x1209 +USB_PID = 0xc051 +USB_PRODUCT = "Simmel" +USB_MANUFACTURER = "Betrusted" + +MCU_CHIP = nrf52833 + +# SPI_FLASH_FILESYSTEM = 1 +# EXTERNAL_FLASH_DEVICE_COUNT = 1 +# EXTERNAL_FLASH_DEVICES = "MX25R1635F" + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_BUSIO = 1 +CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_PIXELBUF = 0 +CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 1 +CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_ULAB = 0 + +# Enable micropython.native +#CIRCUITPY_ENABLE_MPY_NATIVE = 1 + +# These defines must be overridden before mpconfigboard.h is included, which is +# why they are passed on the command line. +CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' diff --git a/ports/nrf/boards/simmel/pins.c b/ports/nrf/boards/simmel/pins.c new file mode 100644 index 0000000000..c946493d47 --- /dev/null +++ b/ports/nrf/boards/simmel/pins.c @@ -0,0 +1,27 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_SPI_CSN), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_SPI_MISO), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_SPI_MOSI), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_SPI_SCK), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_I2S_LRCK), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SDIN), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SCK), MP_ROM_PTR(&pin_P0_12) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_CHG), MP_ROM_PTR(&pin_P0_04) }, + + { MP_ROM_QSTR(MP_QSTR_PWM), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_PWM_N), MP_ROM_PTR(&pin_P0_19) }, + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h index 76e772ca9b..c130cd8c06 100644 --- a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h @@ -33,7 +33,7 @@ #define MICROPY_HW_BOARD_NAME "Teknikio Bluebird" #define MICROPY_HW_MCU_NAME "nRF52840" -#define MICROPY_HW_NEOPIXEL (&pin_P0_26) +#define MICROPY_HW_NEOPIXEL (&pin_P1_15) #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) #define DEFAULT_I2C_BUS_SDA (&pin_P0_26) diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk index e178a82051..2339a950fe 100644 --- a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk @@ -6,3 +6,9 @@ USB_MANUFACTURER = "Teknikio" MCU_CHIP = nrf52840 INTERNAL_FLASH_FILESYSTEM = 1 +CIRCUITPY_ANALOGIO = 1 +CIRCUITPY_AUDIOCORE = 1 +CIRCUITPY_AUDIOPWMIO = 1 +CIRCUITPY_DIGITALIO = 1 +CIRCUITPY_NEOPIXEL_WRITE = 1 +CIRCUITPY_TIME = 1 diff --git a/ports/nrf/boards/teknikio_bluebird/pins.c b/ports/nrf/boards/teknikio_bluebird/pins.c index a90dc7daa2..1ff1198a15 100644 --- a/ports/nrf/boards/teknikio_bluebird/pins.c +++ b/ports/nrf/boards/teknikio_bluebird/pins.c @@ -47,16 +47,16 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_03) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_03) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P1_15) }, { MP_ROM_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_P0_28) }, { MP_ROM_QSTR(MP_QSTR_LIGHT_ENABLE), MP_ROM_PTR(&pin_P0_30) }, - { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_P1_14) }, { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_P1_10) }, { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_SDA), MP_ROM_PTR(&pin_P1_12) }, { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_SCL), MP_ROM_PTR(&pin_P1_11) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index cb526a6a85..36c79e88ec 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -36,7 +36,6 @@ #include "nrfx_power.h" #include "nrf_nvic.h" #include "nrf_sdm.h" -#include "tick.h" #include "py/gc.h" #include "py/objstr.h" #include "py/runtime.h" diff --git a/ports/nrf/common-hal/_bleio/Characteristic.c b/ports/nrf/common-hal/_bleio/Characteristic.c index e311aceb97..d507cecca4 100644 --- a/ports/nrf/common-hal/_bleio/Characteristic.c +++ b/ports/nrf/common-hal/_bleio/Characteristic.c @@ -127,6 +127,7 @@ size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *sel // self->value is set by evt handler. return common_hal_bleio_gattc_read(self->handle, conn_handle, buf, len); } else { + // conn_handle is ignored for non-system attributes. return common_hal_bleio_gatts_read(self->handle, conn_handle, buf, len); } } @@ -152,6 +153,7 @@ void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, (self->props & CHAR_PROP_WRITE_NO_RESPONSE)); } else { // Always write the value locally even if no connections are active. + // conn_handle is ignored for non-system attributes, so we use BLE_CONN_HANDLE_INVALID. common_hal_bleio_gatts_write(self->handle, BLE_CONN_HANDLE_INVALID, bufinfo); // Check to see if we need to notify or indicate any active connections. for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { diff --git a/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c b/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c index 9f9b453de4..132e392dd7 100644 --- a/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c +++ b/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c @@ -35,20 +35,16 @@ #include "py/runtime.h" #include "py/stream.h" -#include "tick.h" - #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Connection.h" #include "supervisor/shared/tick.h" #include "common-hal/_bleio/CharacteristicBuffer.h" +// Push all the data onto the ring buffer. When the buffer is full, new bytes will be dropped. STATIC void write_to_ringbuf(bleio_characteristic_buffer_obj_t *self, uint8_t *data, uint16_t len) { - // Push all the data onto the ring buffer. uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); - for (size_t i = 0; i < len; i++) { - ringbuf_put(&self->ringbuf, data[i]); - } + ringbuf_put_n(&self->ringbuf, data, len); sd_nvic_critical_region_exit(is_nested_critical_region); } @@ -100,11 +96,11 @@ void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffe } -int common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode) { +uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode) { uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for all bytes received or timeout - while ( (ringbuf_count(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { + while ( (ringbuf_num_filled(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; // Allow user to break out of a timeout with a KeyboardInterrupt. if ( mp_hal_is_interrupted() ) { @@ -116,21 +112,18 @@ int common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_ uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); - size_t rx_bytes = MIN(ringbuf_count(&self->ringbuf), len); - for ( size_t i = 0; i < rx_bytes; i++ ) { - data[i] = ringbuf_get(&self->ringbuf); - } + uint32_t num_bytes_read = ringbuf_get_n(&self->ringbuf, data, len); // Writes now OK. sd_nvic_critical_region_exit(is_nested_critical_region); - return rx_bytes; + return num_bytes_read; } uint32_t common_hal_bleio_characteristic_buffer_rx_characters_available(bleio_characteristic_buffer_obj_t *self) { uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); - uint16_t count = ringbuf_count(&self->ringbuf); + uint16_t count = ringbuf_num_filled(&self->ringbuf); sd_nvic_critical_region_exit(is_nested_critical_region); return count; } diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index d4c7308fd1..00c1acd4d4 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -371,6 +371,11 @@ mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_ return 1.25f * self->conn_params.min_conn_interval; } +// Return the current negotiated MTU length, minus overhead. +mp_int_t common_hal_bleio_connection_get_max_packet_length(bleio_connection_internal_t *self) { + return (self->mtu == 0 ? BLE_GATT_ATT_MTU_DEFAULT : self->mtu) - 3; +} + void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval) { self->conn_params_updating = true; uint16_t interval = new_interval / 1.25f; @@ -752,3 +757,16 @@ mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t* interna return MP_OBJ_FROM_PTR(connection); } + +// Find the connection that uses the given conn_handle. Return NULL if not found. +bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle) { + bleio_connection_internal_t *connection; + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + connection = &bleio_connections[i]; + if (connection->conn_handle == conn_handle) { + return connection; + } + } + + return NULL; +} diff --git a/ports/nrf/common-hal/_bleio/Connection.h b/ports/nrf/common-hal/_bleio/Connection.h index 282e0c4b5d..b051e5c511 100644 --- a/ports/nrf/common-hal/_bleio/Connection.h +++ b/ports/nrf/common-hal/_bleio/Connection.h @@ -87,5 +87,6 @@ bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in); uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self); mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t* connection); +bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle); #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_CONNECTION_H diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index 6ed6d14514..a8773f961f 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -35,15 +35,13 @@ #include "py/runtime.h" #include "py/stream.h" -#include "tick.h" - #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Connection.h" #include "shared-bindings/_bleio/PacketBuffer.h" #include "supervisor/shared/tick.h" STATIC void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uint16_t len) { - if (len + sizeof(uint16_t) > self->ringbuf.size) { + if (len + sizeof(uint16_t) > ringbuf_capacity(&self->ringbuf)) { // This shouldn't happen. return; } @@ -51,7 +49,7 @@ STATIC void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uin uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); // Make room for the new value by dropping the oldest packets first. - while (self->ringbuf.size - ringbuf_count(&self->ringbuf) < (int) (len + sizeof(uint16_t))) { + while (ringbuf_capacity(&self->ringbuf) - ringbuf_num_filled(&self->ringbuf) < len + sizeof(uint16_t)) { uint16_t packet_length; ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); for (uint16_t i = 0; i < packet_length; i++) { @@ -107,12 +105,18 @@ STATIC uint32_t queue_next_write(bleio_packet_buffer_obj_t *self) { } STATIC bool packet_buffer_on_ble_client_evt(ble_evt_t *ble_evt, void *param) { - bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; + const uint16_t evt_id = ble_evt->header.evt_id; + // Check if this is a GATTC event so we can make sure the conn_handle is valid. + if (evt_id < BLE_GATTC_EVT_BASE || evt_id > BLE_GATTC_EVT_LAST) { + return false; + } + uint16_t conn_handle = ble_evt->evt.gattc_evt.conn_handle; + bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; if (conn_handle != self->conn_handle) { return false; } - switch (ble_evt->header.evt_id) { + switch (evt_id) { case BLE_GATTC_EVT_HVX: { // A remote service wrote to this characteristic. ble_gattc_evt_hvx_t* evt_hvx = &ble_evt->evt.gattc_evt.params.hvx; @@ -142,9 +146,9 @@ STATIC bool packet_buffer_on_ble_client_evt(ble_evt_t *ble_evt, void *param) { STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; - uint16_t conn_handle = ble_evt->evt.gatts_evt.conn_handle; switch (ble_evt->header.evt_id) { case BLE_GATTS_EVT_WRITE: { + uint16_t conn_handle = ble_evt->evt.gatts_evt.conn_handle; // A client wrote to this server characteristic. ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; @@ -168,7 +172,7 @@ STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { break; } case BLE_GAP_EVT_DISCONNECTED: { - if (self->conn_handle == conn_handle) { + if (self->conn_handle == ble_evt->evt.gap_evt.conn_handle) { self->conn_handle = BLE_CONN_HANDLE_INVALID; } } @@ -202,10 +206,7 @@ void common_hal_bleio_packet_buffer_construct( } if (incoming) { - // This is a macro. - ringbuf_alloc(&self->ringbuf, buffer_size * (sizeof(uint16_t) + characteristic->max_length), false); - - if (self->ringbuf.buf == NULL) { + if (!ringbuf_alloc(&self->ringbuf, buffer_size * (sizeof(uint16_t) + characteristic->max_length), false)) { mp_raise_ValueError(translate("Buffer too large and unable to allocate")); } } @@ -249,45 +250,66 @@ void common_hal_bleio_packet_buffer_construct( } } -int common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len) { - if (ringbuf_count(&self->ringbuf) < 2) { +mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len) { + if (ringbuf_num_filled(&self->ringbuf) < 2) { return 0; } - uint16_t packet_length; - ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); - // Copy received data. Lock out write interrupt handler while copying. uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); - if (packet_length > len) { - return len - packet_length; - } + // Get packet length, which is in first two bytes of packet. + uint16_t packet_length; + ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); - ringbuf_get_n(&self->ringbuf, data, packet_length); + mp_int_t ret; + if (packet_length > len) { + // Packet is longer than requested. Return negative of overrun value. + ret = len - packet_length; + // Discard the packet if it's too large. Don't fill data. + while (packet_length--) { + (void) ringbuf_get(&self->ringbuf); + } + } else { + // Read as much as possible, but might be shorter than len. + ringbuf_get_n(&self->ringbuf, data, packet_length); + ret = packet_length; + } // Writes now OK. sd_nvic_critical_region_exit(is_nested_critical_region); - return packet_length; + return ret; } -void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len, uint8_t* header, size_t header_len) { +mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len, uint8_t* header, size_t header_len) { if (self->outgoing[0] == NULL) { mp_raise_bleio_BluetoothError(translate("Writes not supported on Characteristic")); } if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { - return; + return -1; } - uint16_t packet_size = common_hal_bleio_packet_buffer_get_packet_size(self); - uint16_t max_size = packet_size - len; - while (max_size < self->pending_size && self->conn_handle != BLE_CONN_HANDLE_INVALID) { - RUN_BACKGROUND_TASKS; + uint16_t outgoing_packet_length = common_hal_bleio_packet_buffer_get_outgoing_packet_length(self); + + if (len + header_len > outgoing_packet_length) { + // Supplied data will not fit in a single BLE packet. + mp_raise_ValueError(translate("Total data to write is larger than outgoing_packet_length")); + } + + if (len + self->pending_size > outgoing_packet_length) { + // No room to append len bytes to packet. Wait until we get a free buffer, + // and keep checking that we haven't been disconnected. + while (self->pending_size != 0 && self->conn_handle != BLE_CONN_HANDLE_INVALID) { + RUN_BACKGROUND_TASKS; + } } if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { - return; + return -1; } + + size_t num_bytes_written = 0; + uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); @@ -296,9 +318,11 @@ void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8 if (self->pending_size == 0) { memcpy(pending, header, header_len); self->pending_size += header_len; + num_bytes_written += header_len; } memcpy(pending + self->pending_size, data, len); self->pending_size += len; + num_bytes_written += len; sd_nvic_critical_region_exit(is_nested_critical_region); @@ -306,28 +330,69 @@ void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8 if (!self->packet_queued) { queue_next_write(self); } + return num_bytes_written; } -uint16_t common_hal_bleio_packet_buffer_get_packet_size(bleio_packet_buffer_obj_t *self) { - uint16_t mtu; - if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { - return 0; +mp_int_t common_hal_bleio_packet_buffer_get_incoming_packet_length(bleio_packet_buffer_obj_t *self) { + // If this PacketBuffer is coming from a remote service via NOTIFY or INDICATE + // the maximum size is what can be sent in one + // BLE packet. But we must be connected to know that value. + // + // Otherwise it can be as long as the characteristic + // will permit, whether or not we're connected. + + if (self->characteristic == NULL) { + return -1; } - bleio_connection_internal_t *connection; - for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - connection = &bleio_connections[i]; - if (connection->conn_handle == self->conn_handle) { - break; + + if (self->characteristic->service != NULL && + self->characteristic->service->is_remote && + (common_hal_bleio_characteristic_get_properties(self->characteristic) & + (CHAR_PROP_INDICATE | CHAR_PROP_NOTIFY))) { + // We are talking to a remote service, and data is arriving via NOTIFY or INDICATE. + if (self->conn_handle != BLE_CONN_HANDLE_INVALID) { + bleio_connection_internal_t *connection = bleio_conn_handle_to_connection(self->conn_handle); + if (connection) { + return MIN(common_hal_bleio_connection_get_max_packet_length(connection), + self->characteristic->max_length); + } } + // There's no current connection, so we don't know the MTU, and + // we can't tell what the largest incoming packet length would be. + return -1; } - if (connection->mtu == 0) { - mtu = BLE_GATT_ATT_MTU_DEFAULT; + return self->characteristic->max_length; +} + +mp_int_t common_hal_bleio_packet_buffer_get_outgoing_packet_length(bleio_packet_buffer_obj_t *self) { + // If we are sending data via NOTIFY or INDICATE, the maximum size + // is what can be sent in one BLE packet. But we must be connected + // to know that value. + // + // Otherwise it can be as long as the characteristic + // will permit, whether or not we're connected. + + if (self->characteristic == NULL) { + return -1; } - if (self->characteristic->max_length > mtu) { - mtu = self->characteristic->max_length; + + if (self->characteristic->service != NULL && + !self->characteristic->service->is_remote && + (common_hal_bleio_characteristic_get_properties(self->characteristic) & + (CHAR_PROP_INDICATE | CHAR_PROP_NOTIFY))) { + // We are sending to a client, via NOTIFY or INDICATE. + if (self->conn_handle != BLE_CONN_HANDLE_INVALID) { + bleio_connection_internal_t *connection = bleio_conn_handle_to_connection(self->conn_handle); + if (connection) { + return MIN(common_hal_bleio_connection_get_max_packet_length(connection), + self->characteristic->max_length); + } + } + // There's no current connection, so we don't know the MTU, and + // we can't tell what the largest outgoing packet length would be. + return -1; } - uint16_t att_overhead = 3; - return mtu - att_overhead; + return self->characteristic->max_length; } bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self) { diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.h b/ports/nrf/common-hal/_bleio/PacketBuffer.h index cfccc852ed..699291749f 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.h +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.h @@ -40,8 +40,10 @@ typedef struct { // Two outgoing buffers to alternate between. One will be queued for transmission by the SD and // the other is waiting to be queued and can be extended. uint8_t* outgoing[2]; - uint16_t pending_size; - uint16_t conn_handle; + volatile uint16_t pending_size; + // We remember the conn_handle so we can do a NOTIFY/INDICATE to a client. + // We can find out the conn_handle on a Characteristic write or a CCCD write (but not a read). + volatile uint16_t conn_handle; uint8_t pending_index; uint8_t write_type; bool client; diff --git a/ports/nrf/common-hal/_bleio/Service.h b/ports/nrf/common-hal/_bleio/Service.h index f101bc825b..6ee9fe63de 100644 --- a/ports/nrf/common-hal/_bleio/Service.h +++ b/ports/nrf/common-hal/_bleio/Service.h @@ -39,6 +39,8 @@ typedef struct bleio_service_obj { bool is_remote; bool is_secondary; bleio_uuid_obj_t *uuid; + // The connection object is set only when this is a remote service. + // A local service doesn't know the connection. mp_obj_t connection; mp_obj_list_t *characteristic_list; // Range of attribute handles of this remote service. diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index 62a3a9299c..e84bba6626 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -118,8 +118,8 @@ void common_hal_bleio_check_connected(uint16_t conn_handle) { // GATTS read of a Characteristic or Descriptor. size_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle, uint8_t* buf, size_t len) { - // conn_handle might be BLE_CONN_HANDLE_INVALID if we're not connected, but that's OK, because - // we can still read and write the local value. + // conn_handle is ignored unless this is a system attribute. + // If we're not connected, that's OK, because we can still read and write the local value. ble_gatts_value_t gatts_value = { .p_value = buf, @@ -132,8 +132,8 @@ size_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle, uint8_ } void common_hal_bleio_gatts_write(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo) { - // conn_handle might be BLE_CONN_HANDLE_INVALID if we're not connected, but that's OK, because - // we can still read and write the local value. + // conn_handle is ignored unless this is a system attribute. + // If we're not connected, that's OK, because we can still read and write the local value. ble_gatts_value_t gatts_value = { .p_value = bufinfo->buf, diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index ead92b0000..2fa28afac0 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -283,6 +283,9 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, i2s_buffer_fill(self); NRF_I2S->RXTXD.MAXCNT = self->buffer_length / 4; + // Turn on the interrupt to the NVIC but not within the NVIC itself. This will wake the CPU and + // keep it awake until it is serviced without triggering an interrupt handler. + NRF_I2S->INTENSET = I2S_INTENSET_TXPTRUPD_Msk; NRF_I2S->ENABLE = I2S_ENABLE_ENABLE_Enabled; NRF_I2S->TASKS_START = 1; @@ -305,6 +308,7 @@ bool common_hal_audiobusio_i2sout_get_paused(audiobusio_i2sout_obj_t* self) { void common_hal_audiobusio_i2sout_stop(audiobusio_i2sout_obj_t* self) { NRF_I2S->TASKS_STOP = 1; self->stopping = true; + NRF_I2S->INTENCLR = I2S_INTENSET_TXPTRUPD_Msk; } bool common_hal_audiobusio_i2sout_get_playing(audiobusio_i2sout_obj_t* self) { @@ -316,8 +320,9 @@ bool common_hal_audiobusio_i2sout_get_playing(audiobusio_i2sout_obj_t* self) { } void i2s_background(void) { - if (NRF_I2S->EVENTS_TXPTRUPD) { + if (NVIC_GetPendingIRQ(I2S_IRQn) && NRF_I2S->EVENTS_TXPTRUPD) { NRF_I2S->EVENTS_TXPTRUPD = 0; + NVIC_ClearPendingIRQ(I2S_IRQn); if (instance) { i2s_buffer_fill(instance); } else { @@ -328,6 +333,7 @@ void i2s_background(void) { void i2s_reset(void) { NRF_I2S->TASKS_STOP = 1; + NRF_I2S->INTENCLR = I2S_INTENSET_TXPTRUPD_Msk; NRF_I2S->ENABLE = I2S_ENABLE_ENABLE_Disabled; NRF_I2S->PSEL.MCK = 0xFFFFFFFF; NRF_I2S->PSEL.SCK = 0xFFFFFFFF; diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index 7b99901d5c..89966b7da9 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -72,6 +72,8 @@ STATIC void activate_audiopwmout_obj(audiopwmio_pwmaudioout_obj_t *self) { } } STATIC void deactivate_audiopwmout_obj(audiopwmio_pwmaudioout_obj_t *self) { + // Turn off the interrupts to the CPU. + self->pwm->INTENCLR = PWM_INTENSET_SEQSTARTED0_Msk | PWM_INTENSET_SEQSTARTED1_Msk; for (size_t i=0; i < MP_ARRAY_SIZE(active_audio); i++) { if (active_audio[i] == self) { active_audio[i] = NULL; @@ -86,7 +88,6 @@ void audiopwmout_reset() { } STATIC void fill_buffers(audiopwmio_pwmaudioout_obj_t *self, int buf) { - self->pwm->EVENTS_SEQSTARTED[1-buf] = 0; uint16_t *dev_buffer = self->buffers[buf]; uint8_t *buffer; uint32_t buffer_length; @@ -143,12 +144,27 @@ STATIC void audiopwmout_background_obj(audiopwmio_pwmaudioout_obj_t *self) { if (stopped) self->pwm->TASKS_STOP = 1; } else if (!self->paused && !self->single_buffer) { - if (self->pwm->EVENTS_SEQSTARTED[0]) fill_buffers(self, 1); - if (self->pwm->EVENTS_SEQSTARTED[1]) fill_buffers(self, 0); + if (self->pwm->EVENTS_SEQSTARTED[0]) { + fill_buffers(self, 1); + self->pwm->EVENTS_SEQSTARTED[0] = 0; + } + if (self->pwm->EVENTS_SEQSTARTED[1]) { + fill_buffers(self, 0); + self->pwm->EVENTS_SEQSTARTED[1] = 0; + } + NVIC_ClearPendingIRQ(self->pwm_irq); } } void audiopwmout_background() { + // Check the NVIC first because it is part of the CPU and fast to read. + if (!NVIC_GetPendingIRQ(PWM0_IRQn) && + !NVIC_GetPendingIRQ(PWM1_IRQn) && + !NVIC_GetPendingIRQ(PWM2_IRQn) && + !NVIC_GetPendingIRQ(PWM3_IRQn)) { + return; + } + // Check our objects because the PWM could be active for some other reason. for (size_t i=0; i < MP_ARRAY_SIZE(active_audio); i++) { if (!active_audio[i]) continue; audiopwmout_background_obj(active_audio[i]); @@ -158,7 +174,8 @@ void audiopwmout_background() { // Caller validates that pins are free. void common_hal_audiopwmio_pwmaudioout_construct(audiopwmio_pwmaudioout_obj_t* self, const mcu_pin_obj_t* left_channel, const mcu_pin_obj_t* right_channel, uint16_t quiescent_value) { - self->pwm = pwmout_allocate(256, PWM_PRESCALER_PRESCALER_DIV_1, true, NULL, NULL); + self->pwm = pwmout_allocate(256, PWM_PRESCALER_PRESCALER_DIV_1, true, NULL, NULL, + &self->pwm_irq); if (!self->pwm) { mp_raise_RuntimeError(translate("All timers in use")); } @@ -260,6 +277,9 @@ void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t* self, self->pwm->EVENTS_SEQEND[0] = 0; self->pwm->EVENTS_SEQEND[1] = 0; self->pwm->EVENTS_STOPPED = 0; + // Enable the SEQSTARTED interrupts so that they wake the CPU and keep it awake until serviced. + // We don't enable them in the NVIC because we don't actually want an interrupt routine to run. + self->pwm->INTENSET = PWM_INTENSET_SEQSTARTED0_Msk | PWM_INTENSET_SEQSTARTED1_Msk; self->pwm->TASKS_SEQSTART[0] = 1; self->playing = true; self->paused = false; diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.h b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.h index ed00324c41..fdd6289a43 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.h +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.h @@ -44,6 +44,8 @@ typedef struct { uint8_t sample_channel_count; uint8_t bytes_per_sample; + IRQn_Type pwm_irq; + bool playing; bool stopping; bool paused; diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 4a3e74c49d..dbf40ea516 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -35,7 +35,6 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" -#include "tick.h" #include "nrfx_uarte.h" #include @@ -99,7 +98,7 @@ static void uart_callback_irq (const nrfx_uarte_event_t * event, void * context) switch ( event->type ) { case NRFX_UARTE_EVT_RX_DONE: - ringbuf_put_n(&self->rbuf, event->data.rxtx.p_data, event->data.rxtx.bytes); + ringbuf_put_n(&self->ringbuf, event->data.rxtx.p_data, event->data.rxtx.bytes); // keep receiving (void) nrfx_uarte_rx(self->uarte, &self->rx_char, 1); @@ -113,7 +112,7 @@ static void uart_callback_irq (const nrfx_uarte_event_t * event, void * context) // Possible Error source is Overrun, Parity, Framing, Break // uint32_t errsrc = event->data.error.error_mask; - ringbuf_put_n(&self->rbuf, event->data.error.rxtx.p_data, event->data.error.rxtx.bytes); + ringbuf_put_n(&self->ringbuf, event->data.error.rxtx.p_data, event->data.error.rxtx.bytes); // Keep receiving (void) nrfx_uarte_rx(self->uarte, &self->rx_char, 1); @@ -191,9 +190,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // pointers like this are NOT moved, allocating the buffer // in the long-lived pool is not strictly necessary) // (This is a macro.) - ringbuf_alloc(&self->rbuf, receiver_buffer_size, true); - - if ( !self->rbuf.buf ) { + if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { nrfx_uarte_uninit(self->uarte); mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); } @@ -227,10 +224,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { reset_pin_number(self->rx_pin_number); self->tx_pin_number = NO_PIN; self->rx_pin_number = NO_PIN; - - gc_free(self->rbuf.buf); - self->rbuf.size = 0; - self->rbuf.iput = self->rbuf.iget = 0; + ringbuf_free(&self->ringbuf); } } @@ -240,11 +234,10 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t mp_raise_ValueError(translate("No RX pin")); } - size_t rx_bytes = 0; uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for all bytes received or timeout - while ( (ringbuf_count(&self->rbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { + while ( (ringbuf_num_filled(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; // Allow user to break out of a timeout with a KeyboardInterrupt. if ( mp_hal_is_interrupted() ) { @@ -255,12 +248,8 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t // prevent conflict with uart irq NVIC_DisableIRQ(nrfx_get_irq_number(self->uarte->p_reg)); - // copy received data - rx_bytes = ringbuf_count(&self->rbuf); - rx_bytes = MIN(rx_bytes, len); - for ( uint16_t i = 0; i < rx_bytes; i++ ) { - data[i] = ringbuf_get(&self->rbuf); - } + // Copy as much received data as available, up to len bytes. + size_t rx_bytes = ringbuf_get_n(&self->ringbuf, data, len); NVIC_EnableIRQ(nrfx_get_irq_number(self->uarte->p_reg)); @@ -317,13 +306,13 @@ void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeou } uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - return ringbuf_count(&self->rbuf); + return ringbuf_num_filled(&self->ringbuf); } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { // prevent conflict with uart irq NVIC_DisableIRQ(nrfx_get_irq_number(self->uarte->p_reg)); - ringbuf_clear(&self->rbuf); + ringbuf_clear(&self->ringbuf); NVIC_EnableIRQ(nrfx_get_irq_number(self->uarte->p_reg)); } diff --git a/ports/nrf/common-hal/busio/UART.h b/ports/nrf/common-hal/busio/UART.h index 58432001cd..a251162910 100644 --- a/ports/nrf/common-hal/busio/UART.h +++ b/ports/nrf/common-hal/busio/UART.h @@ -41,7 +41,7 @@ typedef struct { uint32_t baudrate; uint32_t timeout_ms; - ringbuf_t rbuf; + ringbuf_t ringbuf; uint8_t rx_char; // EasyDMA buf uint8_t tx_pin_number; diff --git a/ports/nrf/common-hal/displayio/ParallelBus.c b/ports/nrf/common-hal/displayio/ParallelBus.c index be4b28a6e6..f13e03163f 100644 --- a/ports/nrf/common-hal/displayio/ParallelBus.c +++ b/ports/nrf/common-hal/displayio/ParallelBus.c @@ -33,8 +33,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/__init__.h" -#include "tick.h" - void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { diff --git a/ports/nrf/common-hal/neopixel_write/__init__.c b/ports/nrf/common-hal/neopixel_write/__init__.c index 0a4036aae3..8062937f4b 100644 --- a/ports/nrf/common-hal/neopixel_write/__init__.c +++ b/ports/nrf/common-hal/neopixel_write/__init__.c @@ -27,10 +27,9 @@ #include "py/mphal.h" #include "py/mpstate.h" #include "shared-bindings/neopixel_write/__init__.h" +#include "supervisor/port.h" #include "nrf_pwm.h" -#include "tick.h" - // https://github.com/adafruit/Adafruit_NeoPixel/blob/master/Adafruit_NeoPixel.cpp // [[[Begin of the Neopixel NRF52 EasyDMA implementation // by the Hackerspace San Salvador]]] @@ -105,8 +104,7 @@ void neopixel_write_reset(void) { pixels_pattern_heap_size = 0; } -uint64_t next_start_tick_ms = 0; -uint32_t next_start_tick_us = 1000; +uint64_t next_start_raw_ticks = 0; void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { // To support both the SoftDevice + Neopixels we use the EasyDMA @@ -175,8 +173,9 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout } } - // Wait to make sure we don't append onto the last transmission. - wait_until(next_start_tick_ms, next_start_tick_us); + // Wait to make sure we don't append onto the last transmission. This should only be a tick or + // two. + while (port_get_raw_ticks(NULL) < next_start_raw_ticks) {} // Use the identified device to choose the implementation // If a PWM device is available and we have a buffer, use DMA. @@ -323,11 +322,5 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout } // Update the next start. - current_tick(&next_start_tick_ms, &next_start_tick_us); - if (next_start_tick_us < 100) { - next_start_tick_ms += 1; - next_start_tick_us = 100 - next_start_tick_us; - } else { - next_start_tick_us -= 100; - } + next_start_raw_ticks = port_get_raw_ticks(NULL) + 4; } diff --git a/ports/nrf/common-hal/pulseio/PWMOut.c b/ports/nrf/common-hal/pulseio/PWMOut.c index 6921091f8a..9d42ccca0f 100644 --- a/ports/nrf/common-hal/pulseio/PWMOut.c +++ b/ports/nrf/common-hal/pulseio/PWMOut.c @@ -139,11 +139,15 @@ bool convert_frequency(uint32_t frequency, uint16_t *countertop, nrf_pwm_clk_t * return false; } +// We store these in an array because we cannot compute them. +static IRQn_Type pwm_irqs[4] = {PWM0_IRQn, PWM1_IRQn, PWM2_IRQn, PWM3_IRQn}; + NRF_PWM_Type *pwmout_allocate(uint16_t countertop, nrf_pwm_clk_t base_clock, - bool variable_frequency, int8_t *channel_out, bool *pwm_already_in_use_out) { + bool variable_frequency, int8_t *channel_out, bool *pwm_already_in_use_out, + IRQn_Type* irq) { for (size_t pwm_index = 0; pwm_index < MP_ARRAY_SIZE(pwms); pwm_index++) { NRF_PWM_Type *pwm = pwms[pwm_index]; - bool pwm_already_in_use = pwm->ENABLE & SPIM_ENABLE_ENABLE_Msk; + bool pwm_already_in_use = pwm->ENABLE & PWM_ENABLE_ENABLE_Msk; if (pwm_already_in_use) { if (variable_frequency) { // Variable frequency requires exclusive use of a PWM, so try the next one. @@ -156,20 +160,30 @@ NRF_PWM_Type *pwmout_allocate(uint16_t countertop, nrf_pwm_clk_t base_clock, for (size_t chan = 0; chan < CHANNELS_PER_PWM; chan++) { if (pwm->PSEL.OUT[chan] == 0xFFFFFFFF) { // Channel is free. - if(channel_out) + if (channel_out) { *channel_out = chan; - if(pwm_already_in_use_out) + } + if (pwm_already_in_use_out) { *pwm_already_in_use_out = pwm_already_in_use; + } + if (irq) { + *irq = pwm_irqs[pwm_index]; + } return pwm; } } } } else { // PWM not yet in use, so we can start to use it. Use channel 0. - if(channel_out) + if (channel_out) { *channel_out = 0; - if(pwm_already_in_use_out) + } + if (pwm_already_in_use_out) { *pwm_already_in_use_out = pwm_already_in_use; + } + if (irq) { + *irq = pwm_irqs[pwm_index]; + } return pwm; } } @@ -208,7 +222,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, int8_t channel; bool pwm_already_in_use; self->pwm = pwmout_allocate(countertop, base_clock, variable_frequency, - &channel, &pwm_already_in_use); + &channel, &pwm_already_in_use, NULL); if (self->pwm == NULL) { return PWMOUT_ALL_TIMERS_IN_USE; diff --git a/ports/nrf/common-hal/pulseio/PWMOut.h b/ports/nrf/common-hal/pulseio/PWMOut.h index b6798cb685..a0c2d87471 100644 --- a/ports/nrf/common-hal/pulseio/PWMOut.h +++ b/ports/nrf/common-hal/pulseio/PWMOut.h @@ -42,7 +42,8 @@ typedef struct { void pwmout_reset(void); NRF_PWM_Type *pwmout_allocate(uint16_t countertop, nrf_pwm_clk_t base_clock, - bool variable_frequency, int8_t *channel_out, bool *pwm_already_in_use_out); + bool variable_frequency, int8_t *channel_out, bool *pwm_already_in_use_out, + IRQn_Type *irq); void pwmout_free_channel(NRF_PWM_Type *pwm, int8_t channel); #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_PULSEIO_PWMOUT_H diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c index b47cc6273b..be2903e444 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.c +++ b/ports/nrf/common-hal/pulseio/PulseIn.c @@ -29,6 +29,7 @@ #include #include +#include "nrf/timers.h" #include "py/mpconfig.h" #include "py/gc.h" #include "py/runtime.h" @@ -36,12 +37,25 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/pulseio/PulseIn.h" -#include "tick.h" #include "nrfx_gpiote.h" // obj array to map pin -> self since nrfx hide the mapping static pulseio_pulsein_obj_t* _objs[GPIOTE_CH_NUM]; +// A single timer is shared amongst all PulseIn objects as a common high speed clock reference. +static uint8_t refcount = 0; +static nrfx_timer_t *timer = NULL; + +static uint32_t overflow_count = 0; + +static void timer_overflow_event_handler(nrf_timer_event_t event_type, void *p_context) { + if (event_type != NRF_TIMER_EVENT_COMPARE0) { + // Other event. + return; + } + overflow_count++; +} + // return index of the object in array static int _find_pulsein_obj(pulseio_pulsein_obj_t* obj) { for(size_t i = 0; i < NRFX_ARRAY_SIZE(_objs); i++ ) { @@ -55,12 +69,8 @@ static int _find_pulsein_obj(pulseio_pulsein_obj_t* obj) { static void _pulsein_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action) { // Grab the current time first. - uint32_t current_us; - uint64_t current_ms; - current_tick(¤t_ms, ¤t_us); - - // current_tick gives us the remaining us until the next tick but we want the number since the last ms. - current_us = 1000 - current_us; + uint32_t current_overflow = overflow_count; + uint32_t current_count = nrfx_timer_capture(timer, 1); pulseio_pulsein_obj_t* self = NULL; for(size_t i = 0; i < NRFX_ARRAY_SIZE(_objs); i++ ) { @@ -78,18 +88,9 @@ static void _pulsein_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action self->first_edge = false; } }else { - uint32_t ms_diff = current_ms - self->last_ms; - uint16_t us_diff = current_us - self->last_us; - uint32_t total_diff = us_diff; + uint32_t total_diff = current_count + 0xffff * (current_overflow - self->last_overflow) - self->last_count; - if (self->last_us > current_us) { - total_diff = 1000 + current_us - self->last_us; - if (ms_diff > 1) { - total_diff += (ms_diff - 1) * 1000; - } - } else { - total_diff += ms_diff * 1000; - } + // Cap duration at 16 bits. uint16_t duration = 0xffff; if (total_diff < duration) { duration = total_diff; @@ -104,8 +105,8 @@ static void _pulsein_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action } } - self->last_ms = current_ms; - self->last_us = current_us; + self->last_overflow = current_overflow; + self->last_count = current_count; } void pulsein_reset(void) { @@ -114,6 +115,11 @@ void pulsein_reset(void) { } nrfx_gpiote_init(NRFX_GPIOTE_CONFIG_IRQ_PRIORITY); + if (timer != NULL) { + nrf_peripherals_free_timer(timer); + } + refcount = 0; + memset(_objs, 0, sizeof(_objs)); } @@ -129,6 +135,28 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), maxlen * sizeof(uint16_t)); } + if (refcount == 0) { + timer = nrf_peripherals_allocate_timer(); + if (timer == NULL) { + mp_raise_RuntimeError(translate("All timers in use")); + } + overflow_count = 0; + + nrfx_timer_config_t timer_config = { + // PulseIn durations are in microseconds, so this is convenient. + .frequency = NRF_TIMER_FREQ_1MHz, + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_32, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + }; + + nrfx_timer_init(timer, &timer_config, &timer_overflow_event_handler); + // Interrupt on overflow so we can track when it rolls over. + nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, 0, true); + nrfx_timer_resume(timer); + } + refcount++; + self->pin = pin->number; self->maxlen = maxlen; self->idle_state = idle_state; @@ -136,8 +164,8 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu self->len = 0; self->first_edge = true; self->paused = false; - self->last_us = 0; - self->last_ms = 0; + self->last_overflow = 0; + self->last_count = 0; claim_pin(pin); @@ -173,6 +201,11 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { reset_pin_number(self->pin); self->pin = NO_PIN; + + refcount--; + if (refcount == 0) { + nrf_peripherals_free_timer(timer); + } } void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t* self) { @@ -207,8 +240,8 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, uint16_t tri self->first_edge = true; self->paused = false; - self->last_ms = 0; - self->last_us = 0; + self->last_overflow = 0; + self->last_count = 0; nrfx_gpiote_in_event_enable(self->pin, true); } diff --git a/ports/nrf/common-hal/pulseio/PulseIn.h b/ports/nrf/common-hal/pulseio/PulseIn.h index 4b2c6eee3f..da5263ac9c 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.h +++ b/ports/nrf/common-hal/pulseio/PulseIn.h @@ -44,8 +44,8 @@ typedef struct { volatile uint16_t start; volatile uint16_t len; - volatile uint16_t last_us; - volatile uint64_t last_ms; + volatile size_t last_overflow; + volatile size_t last_count; } pulseio_pulsein_obj_t; void pulsein_reset(void); diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index a8ea366887..9f56f2f0df 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -30,54 +30,23 @@ #include "py/runtime.h" #include "lib/timeutils/timeutils.h" #include "shared-bindings/rtc/__init__.h" +#include "supervisor/port.h" #include "supervisor/shared/translate.h" -#include "nrfx_rtc.h" -#include "nrf_clock.h" - -// We clock the RTC very slowly (8Hz) so that it won't overflow often. -// But the counter is only 24 bits, so overflow is about every 24 days ... -// For testing, set this to 32768 and it'll overflow every few minutes - -#define RTC_CLOCK_HZ (8) - -volatile static uint32_t rtc_offset = 0; - -const nrfx_rtc_t rtc_instance = NRFX_RTC_INSTANCE(2); - -const nrfx_rtc_config_t rtc_config = { - .prescaler = RTC_FREQ_TO_PRESCALER(RTC_CLOCK_HZ), - .reliable = 0, - .tick_latency = 0, - .interrupt_priority = 6 -}; - -void rtc_handler(nrfx_rtc_int_type_t int_type) { - if (int_type == NRFX_RTC_INT_OVERFLOW) { - rtc_offset += (1L<<24) / RTC_CLOCK_HZ; - } -} - -void rtc_init(void) { - if (!nrf_clock_lf_is_running(NRF_CLOCK)) { - nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_LFCLKSTART); - } - nrfx_rtc_counter_clear(&rtc_instance); - nrfx_rtc_init(&rtc_instance, &rtc_config, rtc_handler); - nrfx_rtc_enable(&rtc_instance); - nrfx_rtc_overflow_enable(&rtc_instance, 1); -} +// This is the time in seconds since 2000 that the RTC was started. +static uint32_t rtc_offset = 0; void common_hal_rtc_get_time(timeutils_struct_time_t *tm) { - uint32_t t = rtc_offset + (nrfx_rtc_counter_get(&rtc_instance) / RTC_CLOCK_HZ ); - timeutils_seconds_since_2000_to_struct_time(t, tm); + uint64_t ticks_s = port_get_raw_ticks(NULL) / 1024; + timeutils_seconds_since_2000_to_struct_time(rtc_offset + ticks_s, tm); } void common_hal_rtc_set_time(timeutils_struct_time_t *tm) { - rtc_offset = timeutils_seconds_since_2000( + uint64_t ticks_s = port_get_raw_ticks(NULL) / 1024; + uint32_t epoch_s = timeutils_seconds_since_2000( tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec ); - nrfx_rtc_counter_clear(&rtc_instance); + rtc_offset = epoch_s - ticks_s; } int common_hal_rtc_get_calibration(void) { diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index e483d455e7..58ab442823 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -14,39 +14,21 @@ USB_SERIAL_NUMBER_LENGTH = 16 # All nRF ports have longints. LONGINT_IMPL = MPZ +# The ?='s allow overriding in mpconfigboard.mk. + # Audio via PWM -ifndef CIRCUITPY_AUDIOCORE -CIRCUITPY_AUDIOCORE = 1 -endif - CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_AUDIOBUSIO ?= 1 +CIRCUITPY_AUDIOCORE ?= 1 +CIRCUITPY_AUDIOMIXER ?= 1 +CIRCUITPY_AUDIOPWMIO ?= 1 - -# The ifndef's allow overriding in mpconfigboard.mk. - -ifndef -CIRCUITPY_BLEIO = 1 -endif - -ifndef CIRCUITPY_AUDIOMIXER -CIRCUITPY_AUDIOMIXER = 1 -endif - -ifndef CIRCUITPY_AUDIOPWMIO -CIRCUITPY_AUDIOPWMIO = 1 -endif - -ifndef CIRCUITPY_AUDIOBUSIO -CIRCUITPY_AUDIOBUSIO = 1 -endif +CIRCUITPY_BLEIO ?= 1 # No I2CSlave implementation CIRCUITPY_I2CSLAVE = 0 -# enable RTC -ifndef CIRCUITPY_RTC -CIRCUITPY_RTC = 1 -endif +CIRCUITPY_RTC ?= 1 # frequencyio not yet implemented CIRCUITPY_FREQUENCYIO = 0 @@ -72,8 +54,6 @@ NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 # Defined here because system_nrf52840.c doesn't #include any of our own include files. CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS -CIRCUITPY_ULAB = 1 - else ifeq ($(MCU_CHIP),nrf52833) MCU_SERIES = m4 @@ -81,7 +61,7 @@ MCU_VARIANT = nrf52 MCU_SUB_VARIANT = nrf52833 SD ?= s140 -SOFTDEV_VERSION ?= 6.1.0 +SOFTDEV_VERSION ?= 7.0.1 BOOT_SETTING_ADDR = 0x7F000 NRF_DEFINES += -DNRF52833_XXAA -DNRF52833 diff --git a/ports/nrf/mphalport.c b/ports/nrf/mphalport.c deleted file mode 100644 index 3885d5a826..0000000000 --- a/ports/nrf/mphalport.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Dan Halbert for Adafruit Industries - * Copyright (c) 2018 Artur Pacholec - * Copyright (c) 2015 Glenn Ruben Bakke - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "py/mphal.h" -#include "py/mpstate.h" -#include "py/gc.h" -#include "supervisor/shared/tick.h" - -/*------------------------------------------------------------------*/ -/* delay - *------------------------------------------------------------------*/ -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - RUN_BACKGROUND_TASKS; - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index a44f047ff6..737bab2036 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -67,7 +67,7 @@ uint32_t supervisor_flash_get_block_count(void) { return CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE ; } -void supervisor_flash_flush(void) { +void port_internal_flash_flush(void) { if (_flash_page_addr == NO_CACHE) return; // Skip if data is the same diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 3f16e090f6..539a9cf90b 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -28,8 +28,10 @@ #include "supervisor/port.h" #include "boards/board.h" +#include "nrfx/hal/nrf_clock.h" #include "nrfx/hal/nrf_power.h" #include "nrfx/drivers/include/nrfx_power.h" +#include "nrfx/drivers/include/nrfx_rtc.h" #include "nrf/cache.h" #include "nrf/clocks.h" @@ -48,7 +50,6 @@ #include "common-hal/pulseio/PulseIn.h" #include "common-hal/rtc/RTC.h" #include "common-hal/neopixel_write/__init__.h" -#include "tick.h" #include "shared-bindings/rtc/__init__.h" @@ -64,6 +65,40 @@ static void power_warning_handler(void) { reset_into_safe_mode(BROWNOUT); } +const nrfx_rtc_t rtc_instance = NRFX_RTC_INSTANCE(2); + +const nrfx_rtc_config_t rtc_config = { + .prescaler = RTC_FREQ_TO_PRESCALER(0x8000), + .reliable = 0, + .tick_latency = 0, + .interrupt_priority = 6 +}; + +static volatile uint64_t overflowed_ticks = 0; + +void rtc_handler(nrfx_rtc_int_type_t int_type) { + if (int_type == NRFX_RTC_INT_OVERFLOW) { + // Our RTC is 24 bits and we're clocking it at 32.768khz which is 32 (2 ** 5) subticks per + // tick. + overflowed_ticks += (1L<< (24 - 5)); + } else if (int_type == NRFX_RTC_INT_TICK && nrfx_rtc_counter_get(&rtc_instance) % 32 == 0) { + // Do things common to all ports when the tick occurs + supervisor_tick(); + } else if (int_type == NRFX_RTC_INT_COMPARE0) { + nrfx_rtc_cc_set(&rtc_instance, 0, 0, false); + } +} + +void tick_init(void) { + if (!nrf_clock_lf_is_running(NRF_CLOCK)) { + nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_LFCLKSTART); + } + nrfx_rtc_counter_clear(&rtc_instance); + nrfx_rtc_init(&rtc_instance, &rtc_config, rtc_handler); + nrfx_rtc_enable(&rtc_instance); + nrfx_rtc_overflow_enable(&rtc_instance, true); +} + safe_mode_t port_init(void) { nrf_peripherals_clocks_init(); @@ -89,10 +124,6 @@ safe_mode_t port_init(void) { analogin_init(); #endif - #if CIRCUITPY_RTC - rtc_init(); - #endif - return NO_SAFE_MODE; } @@ -128,10 +159,6 @@ void reset_port(void) { timers_reset(); -#if CIRCUITPY_RTC - rtc_reset(); -#endif - #if CIRCUITPY_BLEIO bleio_reset(); #endif @@ -176,6 +203,55 @@ uint32_t port_get_saved_word(void) { return _ebss; } +uint64_t port_get_raw_ticks(uint8_t* subticks) { + uint32_t rtc = nrfx_rtc_counter_get(&rtc_instance); + if (subticks != NULL) { + *subticks = (rtc % 32); + } + return overflowed_ticks + rtc / 32; +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { + nrfx_rtc_tick_enable(&rtc_instance, true); +} + +// Disable 1/1024 second tick. +void port_disable_tick(void) { + nrfx_rtc_tick_disable(&rtc_instance); +} + +void port_interrupt_after_ticks(uint32_t ticks) { + uint32_t current_ticks = nrfx_rtc_counter_get(&rtc_instance); + uint32_t diff = 3; + if (ticks > diff) { + diff = ticks * 32; + } + if (diff > 0xffffff) { + diff = 0xffffff; + } + nrfx_rtc_cc_set(&rtc_instance, 0, current_ticks + diff, true); +} + +void port_sleep_until_interrupt(void) { + // Clear the FPU interrupt because it can prevent us from sleeping. + if (NVIC_GetPendingIRQ(FPU_IRQn)) { + __set_FPSCR(__get_FPSCR() & ~(0x9f)); + (void) __get_FPSCR(); + NVIC_ClearPendingIRQ(FPU_IRQn); + } + uint8_t sd_enabled; + + sd_softdevice_is_enabled(&sd_enabled); + if (sd_enabled) { + sd_app_evt_wait(); + } else { + // Call wait for interrupt ourselves if the SD isn't enabled. + __WFI(); + } +} + + void HardFault_Handler(void) { reset_into_safe_mode(HARD_CRASH); while (true) { diff --git a/ports/nrf/supervisor/usb.c b/ports/nrf/supervisor/usb.c index bb9d78101c..3d2527faaa 100644 --- a/ports/nrf/supervisor/usb.c +++ b/ports/nrf/supervisor/usb.c @@ -26,10 +26,10 @@ #include "nrfx.h" #include "nrfx_power.h" -#include "tick.h" #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" +#include "lib/tinyusb/src/device/usbd.h" #ifdef SOFTDEVICE_PRESENT #include "nrf_sdm.h" @@ -87,3 +87,7 @@ void init_usb_hardware(void) { } } } + +void USBD_IRQHandler(void) { + tud_int_handler(0); +} diff --git a/ports/nrf/tick.c b/ports/nrf/tick.c deleted file mode 100644 index ac825a7f1f..0000000000 --- a/ports/nrf/tick.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "tick.h" - -#include "supervisor/shared/tick.h" -#include "shared-module/gamepad/__init__.h" -#include "shared-bindings/microcontroller/Processor.h" -#include "nrf.h" - -void SysTick_Handler(void) { - // Do things common to all ports when the tick occurs - supervisor_tick(); -} - -void tick_init() { - uint32_t ticks_per_ms = common_hal_mcu_processor_get_frequency() / 1000; - SysTick_Config(ticks_per_ms); // interrupt is enabled -} - -void tick_delay(uint32_t us) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; - uint64_t start_ms = supervisor_ticks_ms64(); - while (us > 1000) { - while (supervisor_ticks_ms64() == start_ms) {} - us -= us_between_ticks; - start_ms = supervisor_ticks_ms64(); - us_between_ticks = 1000; - } - while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} -} - -// us counts down! -void current_tick(uint64_t* ms, uint32_t* us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - *ms = supervisor_ticks_ms64(); - *us_until_ms = SysTick->VAL / ticks_per_us; -} - -void wait_until(uint64_t ms, uint32_t us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - while(supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} -} diff --git a/ports/stm/Makefile b/ports/stm/Makefile index c152b76f1a..b667990bda 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -72,6 +72,7 @@ INC += -I./st_driver/CMSIS/Device/ST/STM32$(MCU_SERIES)xx/Include INC += -I./st_driver/CMSIS/Include INC += -I./boards INC += -I./boards/$(BOARD) +INC += -I./hal_conf INC += -I./peripherals INC += -I./packages INC += -I../../lib/mp-readline @@ -110,6 +111,8 @@ CFLAGS += $(MCU_FLAGS_$(MCU_SERIES)) # Select HAL file for distribution via mpconfigport CFLAGS += -DSTM32_HAL_H='' +CFLAGS += -DSTM32_SERIES_LOWER='"stm32$(MCU_SERIES_LOWER)"' + # Floating point settings ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F765xx STM32F767xx STM32F769xx STM32H743xx)) CFLAGS += -mfpu=fpv5-d16 -mfloat-abi=hard @@ -202,7 +205,6 @@ SRC_C += \ background.c \ fatfs_port.c \ mphalport.c \ - tick.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/pins.c \ @@ -289,6 +291,10 @@ $(BUILD)/firmware.uf2: $(BUILD)/firmware.hex $(ECHO) "Create $@" $(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0x57755a57 -b $(BOOTLOADER_OFFSET) -c -o "$(BUILD)/firmware.uf2" $^ +flash: $(BUILD)/firmware.bin + $(ECHO) "Writing $< to the board" + dfu-util -a 0 --dfuse-address 0x08000000 -D $(BUILD)/firmware.bin + include $(TOP)/py/mkrules.mk # Print out the value of a make variable. diff --git a/ports/stm/README.md b/ports/stm/README.md index f2e3e9b67b..95e9bd13fd 100644 --- a/ports/stm/README.md +++ b/ports/stm/README.md @@ -1,3 +1,71 @@ -# CircuitPython Port To The ST Microelectronics STM32 Series +# Circuitpython on STM32 # -This is a port of CircuitPython to the STM32 series of chips. +This port brings the ST Microelectronics STM32 series of MCUs to Circuitpython. STM32 chips have a wide range of capability, from <$1 low power STM32F0s to dual-core STM32H7s running at 400+ MHz. Currently, only the F4, F7, and H7 families are supported, powered by the ARM Cortex M4 and M7 processors. + +Refer to the ST Microelectronics website for more information on features sorted by family and individual chip lines: [st.com/en/microcontrollers-microprocessors/stm32-high-performance-mcus.html](https://www.st.com/en/microcontrollers-microprocessors/stm32-high-performance-mcus.html) + +STM32 SoCs vary product-by-product in clock speed, peripheral capability, pin assignments, and their support within this port. Refer to **mpconfigport.mk** for a full list of enabled modules sorted by family. + +## How this port is organized: ## + +- **boards/** contains the configuration files for each development board and breakout available on the port, as well as system files and both shared and SoC-specific linker files. Board configuration includes a pin mapping of the board, oscillator information, board-specific build flags, and setup for OLED or TFT screens where applicable. +- **common-hal/** contains the port-specific module implementations, used by shared-module and shared-bindings. +- **packages/** contains package-specific pin bindings (LQFP100, BGA216, etc) +- **peripherals/** contains peripheral setup files and peripheral mapping information, sorted by family and sub-variant. Most files in this directory can be generated with the python scripts in **tools/**. +- **st-driver/** submodule for ST HAL and LL files generated via CubeMX. Shared with TinyUSB. +- **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup. +- **tools/** python scripts for generating peripheral and pin mapping files in **peripherals/** and **board/**. + +At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled modules. + +## Build instructions ## + +Ensure your clone of Circuitpython is ready to build by following the [guide on the Adafruit Website](https://learn.adafruit.com/building-circuitpython/introduction). This includes installing the toolchain, synchronizing submodules, and running `mpy-cross`. + +Once the one-time build tasks are complete, you can build at any time by navigating to the port directory: + + $ cd ports/stm + +To build for a specific circuitpython board, run: + + $ make BOARD=feather_stm32f405_express + +You may also build with certain flags available in the makefile, depending on your board and development goals. The following flags would enable debug information and correct flash locations for a pre-flashed UF2 bootloader: + + $ make BOARD=feather_stm32f405_express DEBUG=1 UF2_BOOTLOADER=1 + +## USB connection ## + +Connect your development board of choice to the host PC via the USB cable. Note that for most ST development boards such as the Nucleo and Discovery series, you must use a secondary OTG USB connector to access circuitpython, as the primary USB connector will be connected to a built-in ST-Link debugger rather than the chip itself. + +In many cases, this ST-Link USB connector will **still need to be connected to power** for the chip to turn on - refer to your specific product manual for details. + +## Flash the bootloader ## + +Most ST development boards come with a built-in STLink programming and debugging probe accessible via USB. This programmer may show up as an `MBED` drive on the host PC, enabling simple drag and drop programming with a .bin file, or they may require a tool like [OpenOCD](http://openocd.org/) or [StLink-org/stlink](https://github.com/stlink-org/stlink) to run flashing and debugging commands. + +Many hobbyist and 3rd party development boards also expose SWD pins. These can be used with a cheap [stlink](https://www.adafruit.com/product/2548) debugger or other common programmers. + +For non-ST products or users without a debugger, all STM32 boards in the high performance families (F4, F7 and H7) include a built-in DFU bootloader stored in ROM. This bootloader is accessed by ensuring the BOOT0 pin is held to a logic 1 and the BOOT1 pin is held to a logic 0 when the chip is reset ([ST Appnote AN2606](https://www.st.com/resource/en/application_note/cd00167594-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf)). Most chips hold BOOT low by default, so this can usually be achieved by running a jumper wire from 3.3V power to the BOOT0 pin, if it is exposed, or by flipping the appropriate switch or button as the chip is reset. Once the chip is started in DFU mode, BOOT0 no longer needs to be held high and can be released. An example is available in the [Feather STM32F405 guide](https://learn.adafruit.com/adafruit-stm32f405-feather-express/dfu-bootloader-details). + +Windows users will need to install [stm32cubeprog](https://www.st.com/en/development-tools/stm32cubeprog.html), while Mac and Linux users will need to install `dfu-util` with `brew install dfu-util` or `sudo apt-get install dfu-util`. More details are available in the [Feather F405 guide](https://learn.adafruit.com/adafruit-stm32f405-feather-express/dfu-bootloader-details). + +## Flashing the circuitpython image with DFU-Util ## + +Ensure the board is in dfu mode by following the steps in the previous section. Then run: + + $ make BOARD=feather_stm32F405_express flash + +Alternatively, you can navigate to the build directory and run the raw `dfu-util` command: + +`dfu-util -a 0 --dfuse-address 0x08000000 -D firmware.bin` + +## Accessing the board ## + +Connecting the board to the PC via the USB cable will allow code to be uploaded to the `CIRCUITPY` volume. + +Circuitpython exposes a CDC virtual serial connection for REPL access and debugging. Connecting to it from OSX will look something like this: + + screen /dev/tty.usbmodem14111201 115200 + +You may also use a program like [mu](https://codewith.mu/) to assist with REPL access. diff --git a/ports/stm/boards/STM32F401xd_fs.ld b/ports/stm/boards/STM32F401xd_fs.ld index 826e1d4043..69bae46cb6 100644 --- a/ports/stm/boards/STM32F401xd_fs.ld +++ b/ports/stm/boards/STM32F401xd_fs.ld @@ -5,15 +5,15 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 384K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 320K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 384K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 320K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F401xe_boot.ld b/ports/stm/boards/STM32F401xe_boot.ld index 17dac2f1a6..37827c3301 100644 --- a/ports/stm/boards/STM32F401xe_boot.ld +++ b/ports/stm/boards/STM32F401xe_boot.ld @@ -5,14 +5,14 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 512K - 64K /* entire flash, sans bootloader region */ - FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4 */ - FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000194, LENGTH = 96K - 0x194 + FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 512K - 64K /* entire flash, sans bootloader region */ + FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4 */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000194, LENGTH = 96K - 0x194 } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F401xe_fs.ld b/ports/stm/boards/STM32F401xe_fs.ld index f0136943ad..20247930c2 100644 --- a/ports/stm/boards/STM32F401xe_fs.ld +++ b/ports/stm/boards/STM32F401xe_fs.ld @@ -5,15 +5,15 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F405_boot.ld b/ports/stm/boards/STM32F405_boot.ld index 7e611be9d8..5768d1a01e 100644 --- a/ports/stm/boards/STM32F405_boot.ld +++ b/ports/stm/boards/STM32F405_boot.ld @@ -5,15 +5,15 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 1024K - 64K /* entire flash, sans bootloader region */ - FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 0 */ - FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 1024K - 64K - 64K /* sectors 5+ */ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 1024K - 64K /* entire flash, sans bootloader region */ + FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 0 */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 1024K - 64K - 64K /* sectors 5+ */ + CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define the top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F405_default.ld b/ports/stm/boards/STM32F405_default.ld index 6b497356dd..4c11fd7cf3 100644 --- a/ports/stm/boards/STM32F405_default.ld +++ b/ports/stm/boards/STM32F405_default.ld @@ -5,15 +5,15 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_TEXT (rx) : ORIGIN = 0x08004000, LENGTH = 1008K /* sectors 0-7*/ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08004000, LENGTH = 1008K /* sectors 0-7*/ + CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F405_fs.ld b/ports/stm/boards/STM32F405_fs.ld index 72ee49633c..e6c66127fb 100644 --- a/ports/stm/boards/STM32F405_fs.ld +++ b/ports/stm/boards/STM32F405_fs.ld @@ -5,16 +5,16 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F407_fs.ld b/ports/stm/boards/STM32F407_fs.ld index d08cb8972c..f06c19d992 100644 --- a/ports/stm/boards/STM32F407_fs.ld +++ b/ports/stm/boards/STM32F407_fs.ld @@ -5,16 +5,16 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F411_fs.ld b/ports/stm/boards/STM32F411_fs.ld index 28667214e0..1b45f235fa 100644 --- a/ports/stm/boards/STM32F411_fs.ld +++ b/ports/stm/boards/STM32F411_fs.ld @@ -5,15 +5,15 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F411_nvm.ld b/ports/stm/boards/STM32F411_nvm.ld index bb37c081b3..5ac3e52a6e 100644 --- a/ports/stm/boards/STM32F411_nvm.ld +++ b/ports/stm/boards/STM32F411_nvm.ld @@ -5,16 +5,16 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */ - FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */ + FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define the top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F412_fs.ld b/ports/stm/boards/STM32F412_fs.ld index 5985b209e4..8837bd87d6 100644 --- a/ports/stm/boards/STM32F412_fs.ld +++ b/ports/stm/boards/STM32F412_fs.ld @@ -5,15 +5,15 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F746xG_fs.ld b/ports/stm/boards/STM32F746xG_fs.ld new file mode 100644 index 0000000000..be10a14294 --- /dev/null +++ b/ports/stm/boards/STM32F746xG_fs.ld @@ -0,0 +1,52 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * GNU linker script for STM32F746 with filesystem + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Mark Olsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 896K /* sector 4 is 128K, sectors 5,6,7 are 256K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K + ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 16K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 24K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + diff --git a/ports/stm/boards/STM32F767_fs.ld b/ports/stm/boards/STM32F767_fs.ld index 4acca4d660..25322b0b6f 100644 --- a/ports/stm/boards/STM32F767_fs.ld +++ b/ports/stm/boards/STM32F767_fs.ld @@ -5,15 +5,15 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ - FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 1920K /* sector 4 is 128K, sectors 5,6,7 are 256K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 1920K /* sector 4 is 128K, sectors 5,6,7 are 256K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32H743_fs.ld b/ports/stm/boards/STM32H743_fs.ld index 28cc12b4aa..b6c3d5b62d 100644 --- a/ports/stm/boards/STM32H743_fs.ld +++ b/ports/stm/boards/STM32H743_fs.ld @@ -10,19 +10,19 @@ _ld_default_stack_size = 24K; /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 128K /* sector 0, 128K */ - FLASH_FS (r) : ORIGIN = 0x08020000, LENGTH = 128K /* sector 1, 128K */ - FLASH_TEXT (rx) : ORIGIN = 0x08040000, LENGTH = 1792K /* sectors 6*128 + 8*128 */ - DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K - RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 512K /* AXI SRAM */ - SRAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K /* AHB1 SRAM */ - SRAM_D3 (xrw) : ORIGIN = 0x30040000, LENGTH = 64K /* AHB2 SRAM */ - ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 128K /* sector 0, 128K */ + FLASH_FS (r) : ORIGIN = 0x08020000, LENGTH = 384K /* sector 1-3, 128K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08080000, LENGTH = 1536K /* sectors 4*128 + 8*128 */ + DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 512K /* AXI SRAM */ + SRAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K /* AHB1 SRAM */ + SRAM_D3 (xrw) : ORIGIN = 0x30040000, LENGTH = 64K /* AHB2 SRAM */ + ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; /*TODO: this can probably be bigger, but how big?*/ _minimum_heap_size = 16K; /* brainless copy paste for stack code. Results in ambiguous hard crash */ diff --git a/ports/stm/boards/common_default.ld b/ports/stm/boards/common_default.ld index 41fe4dfb67..ade3571a59 100644 --- a/ports/stm/boards/common_default.ld +++ b/ports/stm/boards/common_default.ld @@ -1,14 +1,14 @@ /* Memory layout for default case. - FLASH_ISR .isr_vector - FLASH_TEXT .text - FLASH_TEXT .data - FLASH_FS // ignored for fs use + FLASH_ISR .isr_vector + FLASH_FIRMWARE .text + FLASH_FIRMWARE .data + FLASH_FS // ignored for fs use - RAM .data - RAM .bss - RAM .heap - RAM .stack + RAM .data + RAM .bss + RAM .heap + RAM .stack */ ENTRY(Reset_Handler) @@ -42,7 +42,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT + } >FLASH_FIRMWARE /* used by the startup to initialize data */ _sidata = LOADADDR(.data); @@ -59,7 +59,7 @@ SECTIONS . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT + } >RAM AT> FLASH_FIRMWARE /* Uninitialized data section */ .bss : diff --git a/ports/stm/boards/common_nvm.ld b/ports/stm/boards/common_nvm.ld index cee71d1944..f948b94e10 100644 --- a/ports/stm/boards/common_nvm.ld +++ b/ports/stm/boards/common_nvm.ld @@ -1,16 +1,16 @@ /* Memory layout for case with dedicated nvm sector (inefficient) TODO: rewrite nvm module, remove this file entirely - FLASH_ISR .isr_vector - FLASH_TEXT .text - FLASH_TEXT .data - FLASH_NVM .nvm_data - FLASH_FS // ignored for fs use + FLASH_ISR .isr_vector + FLASH_FIRMWARE .text + FLASH_FIRMWARE .data + FLASH_NVM .nvm_data + FLASH_FS // ignored for fs use - RAM .data - RAM .bss - RAM .heap - RAM .stack + RAM .data + RAM .bss + RAM .heap + RAM .stack */ ENTRY(Reset_Handler) @@ -52,7 +52,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT + } >FLASH_FIRMWARE /* used by the startup to initialize data */ _sidata = LOADADDR(.data); @@ -69,7 +69,7 @@ SECTIONS . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT + } >RAM AT> FLASH_FIRMWARE /* Uninitialized data section */ .bss : diff --git a/ports/stm/boards/common_tcm.ld b/ports/stm/boards/common_tcm.ld index 0aab4c7f9e..1a41853fe6 100644 --- a/ports/stm/boards/common_tcm.ld +++ b/ports/stm/boards/common_tcm.ld @@ -1,18 +1,18 @@ /* Memory layout for cases with itcm and dtcm - FLASH_ISR .isr_vector - FLASH_TEXT .text - FLASH_TEXT .data - FLASH_FS // ignored for fs use + FLASH_ISR .isr_vector + FLASH_FIRMWARE .text + FLASH_FIRMWARE .data + FLASH_FS // ignored for fs use - RAM .data - RAM .bss - RAM .heap + RAM .data + RAM .bss + RAM .heap - ITCM .itcm - DTCM .dtcm_data - DTCM .dtcm_bss - DTCM .stack + ITCM .itcm + DTCM .dtcm_data + DTCM .dtcm_bss + DTCM .stack */ ENTRY(Reset_Handler) @@ -44,7 +44,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT + } >FLASH_FIRMWARE /* used by the startup to initialize data */ _sidata = LOADADDR(.data); @@ -61,7 +61,7 @@ SECTIONS . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT + } >RAM AT> FLASH_FIRMWARE _ld_d1_ram_data_destination = ADDR(.data); _ld_d1_ram_data_flash_copy = LOADADDR(.data); _ld_d1_ram_data_size = SIZEOF(.data); @@ -98,7 +98,7 @@ SECTIONS *(.itcm.*) . = ALIGN(4); - } > ITCM AT> FLASH_TEXT + } > ITCM AT> FLASH_FIRMWARE _ld_itcm_destination = ADDR(.itcm); _ld_itcm_flash_copy = LOADADDR(.itcm); _ld_itcm_size = SIZEOF(.itcm); @@ -110,7 +110,7 @@ SECTIONS *(.dtcm_data.*) . = ALIGN(4); - } > DTCM AT> FLASH_TEXT + } > DTCM AT> FLASH_FIRMWARE _ld_dtcm_data_destination = ADDR(.dtcm_data); _ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data); _ld_dtcm_data_size = SIZEOF(.dtcm_data); diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.h b/ports/stm/boards/espruino_pico/mpconfigboard.h index d4430380c6..890b1b88e7 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.h +++ b/ports/stm/boards/espruino_pico/mpconfigboard.h @@ -36,4 +36,5 @@ #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) #define BOARD_OSC_DIV (8) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index b7937dd04c..054937c33e 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -13,3 +13,8 @@ MCU_PACKAGE = UFQFPN48 LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F401xd_fs.ld # use for internal flash +# Disable ulab as we're nearly out of space on this board due to +# INTERNAL_FLASH_FILESYSTEM. It can probably be reenabled if we enable +# lto for this port, and if other stuff hasn't been added in the +# meantime +CIRCUITPY_ULAB = 0 diff --git a/ports/stm/boards/espruino_pico/stm32f4xx_hal_conf.h b/ports/stm/boards/espruino_pico/stm32f4xx_hal_conf.h deleted file mode 100644 index ab04df3182..0000000000 --- a/ports/stm/boards/espruino_pico/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.h b/ports/stm/boards/espruino_wifi/mpconfigboard.h index abdc9e8fac..80aae3ad42 100644 --- a/ports/stm/boards/espruino_wifi/mpconfigboard.h +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.h @@ -33,4 +33,5 @@ #define FLASH_PAGE_SIZE (0x4000) //16K #define BOARD_OSC_DIV (8) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) #define BOARD_OVERWRITE_SWD (1) diff --git a/ports/stm/boards/espruino_wifi/stm32f4xx_hal_conf.h b/ports/stm/boards/espruino_wifi/stm32f4xx_hal_conf.h deleted file mode 100644 index 18d9d60ebe..0000000000 --- a/ports/stm/boards/espruino_wifi/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,439 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h index 6600fcf671..8f8e245665 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h @@ -35,6 +35,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_PC00) #define BOARD_OSC_DIV (12) +#define HSE_VALUE ((uint32_t)12000000U) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) // On-board flash #define SPI_FLASH_MOSI_PIN (&pin_PB05) diff --git a/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h b/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h deleted file mode 100644 index 8031403a91..0000000000 --- a/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index 68eed29269..812a8c208c 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -35,8 +35,6 @@ #include "supervisor/spi_flash_api.h" -#include "tick.h" - displayio_fourwire_obj_t board_display_obj; #define DELAY 0x80 diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.h b/ports/stm/boards/meowbit_v121/mpconfigboard.h index babf54a3a9..268a660159 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.h +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.h @@ -36,6 +36,10 @@ #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) #define BOARD_OSC_DIV (12) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +#define HSE_VALUE ((uint32_t)12000000U) +#define LSE_VALUE ((uint32_t)32000U) + #define BOARD_NO_VBUS_SENSE (1) #define BOARD_VTOR_DEFER (1) //Leave VTOR relocation to bootloader #define BOARD_USE_INTERNAL_SPI diff --git a/ports/stm/boards/meowbit_v121/stm32f4xx_hal_conf.h b/ports/stm/boards/meowbit_v121/stm32f4xx_hal_conf.h deleted file mode 100644 index 68a49b4ba8..0000000000 --- a/ports/stm/boards/meowbit_v121/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/nrf/tick.h b/ports/stm/boards/nucleo_f746zg/board.c similarity index 73% rename from ports/nrf/tick.h rename to ports/stm/boards/nucleo_f746zg/board.c index d638ad0251..4421970eef 100644 --- a/ports/nrf/tick.h +++ b/ports/stm/boards/nucleo_f746zg/board.c @@ -23,22 +23,16 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_NRF_TICK_H -#define MICROPY_INCLUDED_NRF_TICK_H -#include "py/mpconfig.h" +#include "boards/board.h" -#include +void board_init(void) { +} -extern struct timer_descriptor ms_timer; +bool board_requests_safe_mode(void) { + return false; +} -void tick_init(void); +void reset_board(void) { -void tick_delay(uint32_t us); - -void current_tick(uint64_t* ms, uint32_t* us_until_ms); -// Do not call this with interrupts disabled because it may be waiting for -// ticks_ms to increment. -void wait_until(uint64_t ms, uint32_t us_until_ms); - -#endif // MICROPY_INCLUDED_NRF_TICK_H +} diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h new file mode 100644 index 0000000000..1d86149193 --- /dev/null +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "NUCLEO STM32F746" +#define MICROPY_HW_MCU_NAME "STM32F746" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (8) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk new file mode 100644 index 0000000000..8a793d5709 --- /dev/null +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -0,0 +1,14 @@ +USB_VID = 0x239A +USB_PID = 0x809E +USB_PRODUCT = "Nucleo F746zg - CPy" +USB_MANUFACTURER = "STMicroelectronics" +USB_DEVICES = "CDC,MSC" + +INTERNAL_FLASH_FILESYSTEM = 1 + +MCU_SERIES = F7 +MCU_VARIANT = STM32F746xx +MCU_PACKAGE = LQFP144 + +LD_COMMON = boards/common_default.ld +LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/nucleo_f746zg/pins.c b/ports/stm/boards/nucleo_f746zg/pins.c new file mode 100644 index 0000000000..56b6a745f9 --- /dev/null +++ b/ports/stm/boards/nucleo_f746zg/pins.c @@ -0,0 +1,73 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { +{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, +{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PC00) }, +{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, +{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PF03) }, +{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PF05) }, +{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PF10) }, +{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PG09) }, +{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PG14) }, +{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PF15) }, +{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PE13) }, +{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PF14) }, +{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PE11) }, +{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PE09) }, +{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PF13) }, +{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PF12) }, +{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PD15) }, +{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PD14) }, +{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, +{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, +{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, +{ MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, +{ MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB08) }, +{ MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PC06) }, +{ MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PB15) }, +{ MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PB13) }, +{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PB12) }, +{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_PA15) }, +{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_PC07) }, +{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_PB05) }, +{ MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_PB03) }, +{ MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_PA04) }, +{ MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_PB04) }, +{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB00) }, +{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PB07) }, +{ MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PB14) }, +{ MP_ROM_QSTR(MP_QSTR_SW), MP_ROM_PTR(&pin_PC13) }, +{ MP_ROM_QSTR(MP_QSTR_TP1), MP_ROM_PTR(&pin_PH02) }, +{ MP_ROM_QSTR(MP_QSTR_TP2), MP_ROM_PTR(&pin_PI08) }, +{ MP_ROM_QSTR(MP_QSTR_TP3), MP_ROM_PTR(&pin_PH15) }, +{ MP_ROM_QSTR(MP_QSTR_AUDIO_INT), MP_ROM_PTR(&pin_PD06) }, +{ MP_ROM_QSTR(MP_QSTR_AUDIO_SDA), MP_ROM_PTR(&pin_PH08) }, +{ MP_ROM_QSTR(MP_QSTR_AUDIO_SCL), MP_ROM_PTR(&pin_PH07) }, +{ MP_ROM_QSTR(MP_QSTR_EXT_SDA), MP_ROM_PTR(&pin_PB09) }, +{ MP_ROM_QSTR(MP_QSTR_EXT_SCL), MP_ROM_PTR(&pin_PB08) }, +{ MP_ROM_QSTR(MP_QSTR_EXT_RST), MP_ROM_PTR(&pin_PG03) }, +{ MP_ROM_QSTR(MP_QSTR_SD_SW), MP_ROM_PTR(&pin_PC13) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_BL_CTRL), MP_ROM_PTR(&pin_PK03) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_INT), MP_ROM_PTR(&pin_PI13) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_SDA), MP_ROM_PTR(&pin_PH08) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_SCL), MP_ROM_PTR(&pin_PH07) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_FS_POWER), MP_ROM_PTR(&pin_PD05) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_FS_OVER_CURRENT), MP_ROM_PTR(&pin_PD04) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_HS_OVER_CURRENT), MP_ROM_PTR(&pin_PE03) }, +{ MP_ROM_QSTR(MP_QSTR_USB_VBUS), MP_ROM_PTR(&pin_PA09) }, +{ MP_ROM_QSTR(MP_QSTR_USB_ID), MP_ROM_PTR(&pin_PA10) }, +{ MP_ROM_QSTR(MP_QSTR_USB_DM), MP_ROM_PTR(&pin_PA11) }, +{ MP_ROM_QSTR(MP_QSTR_USB_DP), MP_ROM_PTR(&pin_PA12) }, +{ MP_ROM_QSTR(MP_QSTR_VCP_TX), MP_ROM_PTR(&pin_PD08) }, +{ MP_ROM_QSTR(MP_QSTR_VCP_RX), MP_ROM_PTR(&pin_PD09) }, +{ MP_ROM_QSTR(MP_QSTR_UART2_TX), MP_ROM_PTR(&pin_PD05) }, +{ MP_ROM_QSTR(MP_QSTR_UART2_RX), MP_ROM_PTR(&pin_PD06) }, +{ MP_ROM_QSTR(MP_QSTR_UART2_RTS), MP_ROM_PTR(&pin_PD04) }, +{ MP_ROM_QSTR(MP_QSTR_UART2_CTS), MP_ROM_PTR(&pin_PD03) }, +{ MP_ROM_QSTR(MP_QSTR_UART6_TX), MP_ROM_PTR(&pin_PG14) }, +{ MP_ROM_QSTR(MP_QSTR_UART6_RX), MP_ROM_PTR(&pin_PG09) }, +{ MP_ROM_QSTR(MP_QSTR_SPI_B_NSS), MP_ROM_PTR(&pin_PA04) }, +{ MP_ROM_QSTR(MP_QSTR_SPI_B_SCK), MP_ROM_PTR(&pin_PB03) }, +{ MP_ROM_QSTR(MP_QSTR_SPI_B_MOSI), MP_ROM_PTR(&pin_PB05) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index b481a2835b..314c96cb5a 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -33,3 +33,4 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 3678d8a39e..8909cc5be1 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -32,3 +32,4 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/openmv_h7/board.c b/ports/stm/boards/openmv_h7/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/stm/boards/openmv_h7/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h new file mode 100644 index 0000000000..9a049ed2cf --- /dev/null +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "OPENMV-H7 R1" +#define MICROPY_HW_MCU_NAME "STM32H743" + +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (12) +#define HSE_VALUE ((uint32_t)12000000) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) + diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.mk b/ports/stm/boards/openmv_h7/mpconfigboard.mk new file mode 100644 index 0000000000..242dac52cd --- /dev/null +++ b/ports/stm/boards/openmv_h7/mpconfigboard.mk @@ -0,0 +1,15 @@ +USB_VID = 0x239A +USB_PID = 0x80A4 +USB_PRODUCT = "OpenMV-H7 R1" +USB_MANUFACTURER = "OpenMV, LLC" +USB_DEVICES = "CDC,MSC" + +INTERNAL_FLASH_FILESYSTEM = 1 + +MCU_SERIES = H7 +MCU_VARIANT = STM32H743xx +MCU_PACKAGE = LQFP100_x7 + +LD_COMMON = boards/common_tcm.ld +LD_FILE = boards/STM32H743_fs.ld + diff --git a/ports/stm/boards/openmv_h7/openmv.csv b/ports/stm/boards/openmv_h7/openmv.csv new file mode 100644 index 0000000000..9045e1ea2d --- /dev/null +++ b/ports/stm/boards/openmv_h7/openmv.csv @@ -0,0 +1,26 @@ +P0,PB15 +P1,PB14 +P2,PB13 +P3,PB12 +P4,PB10 +P5,PB11 +P6,PA05 +P7,PD12 +P8,PD13 +P9,PD14 +LED1,PC00 +LED2,PC01 +LED3,PC02 +LED4,PE02 +UART1_TX,PB14 +UART1_RX,PB15 +UART3_TX,PB10 +UART3_RX,PB11 +I2C2_SCL,PB10 +I2C2_SDA,PB11 +I2C4_SCL,PD12 +I2C4_SDA,PD13 +SPI2_NSS,PB12 +SPI2_SCK,PB13 +SPI2_MISO,PB14 +SPI2_MOSI,PB15 \ No newline at end of file diff --git a/ports/stm/boards/openmv_h7/pins.c b/ports/stm/boards/openmv_h7/pins.c new file mode 100644 index 0000000000..2f7fa93c1d --- /dev/null +++ b/ports/stm/boards/openmv_h7/pins.c @@ -0,0 +1,35 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_P0), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_LED_IR), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_UART1_TX), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_UART1_RX), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_UART3_TX), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_UART3_RX), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_I2C2_SCL), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_I2C2_SDA), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_I2C4_SCL), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_I2C4_SDA), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_SPI2_NSS), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_SPI2_SCK), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_SPI2_MISO), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_SPI2_MOSI), MP_ROM_PTR(&pin_PB15) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h index 965e7d5ff4..721a91defc 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h @@ -33,6 +33,7 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) // On-board flash #define SPI_FLASH_MOSI_PIN (&pin_PB15) diff --git a/ports/stm/boards/pyb_nano_v2/stm32f4xx_hal_conf.h b/ports/stm/boards/pyb_nano_v2/stm32f4xx_hal_conf.h deleted file mode 100644 index ab04df3182..0000000000 --- a/ports/stm/boards/pyb_nano_v2/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.h b/ports/stm/boards/pyboard_v11/mpconfigboard.h index 398731d30c..77fab2c69e 100644 --- a/ports/stm/boards/pyboard_v11/mpconfigboard.h +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.h @@ -33,6 +33,9 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (12) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +#define HSE_VALUE ((uint32_t)12000000U) +#define LSE_VALUE ((uint32_t)32000U) #define DEFAULT_I2C_BUS_SCL (&pin_PB06) #define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm/boards/pyboard_v11/stm32f4xx_hal_conf.h b/ports/stm/boards/pyboard_v11/stm32f4xx_hal_conf.h deleted file mode 100644 index 4dc18cb7f4..0000000000 --- a/ports/stm/boards/pyboard_v11/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h index 2ae1a29268..a21060a848 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -35,6 +35,9 @@ #define BOARD_OSC_DIV (25) #define BOARD_NO_VBUS_SENSE (1) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) +#define HSE_VALUE ((uint32_t)25000000U) + // On-board flash // #define SPI_FLASH_MOSI_PIN (&pin_PA07) // #define SPI_FLASH_MISO_PIN (&pin_PA06) diff --git a/ports/stm/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h b/ports/stm/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h deleted file mode 100644 index 81d29f2420..0000000000 --- a/ports/stm/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h index 49ef80cdd7..3956a365cf 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h @@ -33,3 +33,9 @@ #define FLASH_PAGE_SIZE (0x4000) //16K #define BOARD_OSC_DIV (8) + +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) + +// The schematic has a 32k crystal that isn't fitted. Uncommented the line below if you add it. +// #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +// #define LSE_VALUE ((uint32_t)32000U) diff --git a/ports/stm/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h b/ports/stm/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h deleted file mode 100644 index 18d9d60ebe..0000000000 --- a/ports/stm/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,439 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h index f34b830fb2..112d2a83c6 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h @@ -34,5 +34,7 @@ #define BOARD_OSC_DIV (8) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) + #define DEFAULT_I2C_BUS_SCL (&pin_PB10) #define DEFAULT_I2C_BUS_SDA (&pin_PB09) diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h index fcd7aa09cd..28a370afda 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h @@ -33,3 +33,5 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) + +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h b/ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h deleted file mode 100644 index ee5832d49c..0000000000 --- a/ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,439 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/tick.h b/ports/stm/boards/stm32f746g_discovery/board.c similarity index 61% rename from ports/stm/tick.h rename to ports/stm/boards/stm32f746g_discovery/board.c index 17e96362dd..aafc69cf02 100644 --- a/ports/stm/tick.h +++ b/ports/stm/boards/stm32f746g_discovery/board.c @@ -4,6 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2020 Mark Olsson * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,22 +24,34 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32_TICK_H -#define MICROPY_INCLUDED_STM32_TICK_H -#include "py/mpconfig.h" +#include "boards/board.h" +#include "stm32f7xx_hal.h" +#include "common-hal/microcontroller/Pin.h" -#include +void board_init(void) { + GPIO_InitTypeDef GPIO_InitStructure; -extern struct timer_descriptor ms_timer; + __HAL_RCC_GPIOK_CLK_ENABLE(); -void tick_init(void); + /* + * Turn off the backlight as it is distracting during development. + * LCD_BL_CTRL = PK3 + */ + GPIO_InitStructure.Pin = GPIO_PIN_3; + GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStructure.Pull = GPIO_PULLUP; + GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + HAL_GPIO_Init(GPIOK, &GPIO_InitStructure); + HAL_GPIO_WritePin(GPIOK, GPIO_PIN_3, GPIO_PIN_RESET); -void tick_delay(uint32_t us); + never_reset_pin_number(10, 3); +} -void current_tick(uint64_t* ms, uint32_t* us_until_ms); -// Do not call this with interrupts disabled because it may be waiting for -// ticks_ms to increment. -void wait_until(uint64_t ms, uint32_t us_until_ms); +bool board_requests_safe_mode(void) { + return false; +} -#endif // MICROPY_INCLUDED_STM32_TICK_H +void reset_board(void) { + +} diff --git a/ports/atmel-samd/common-hal/time/__init__.c b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h similarity index 67% rename from ports/atmel-samd/common-hal/time/__init__.c rename to ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 652e455fc4..28784f6ab9 100644 --- a/ports/atmel-samd/common-hal/time/__init__.c +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -3,7 +3,8 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,25 +25,19 @@ * THE SOFTWARE. */ -#include "py/mphal.h" +//Micropython setup -#include "shared-bindings/time/__init__.h" +#define MICROPY_HW_BOARD_NAME "ST STM32F746G Discovery" +#define MICROPY_HW_MCU_NAME "STM32F746" +#define STM32F746G_DISCO -#include "supervisor/shared/tick.h" -#include "tick.h" +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) -inline uint64_t common_hal_time_monotonic(void) { - return supervisor_ticks_ms64(); -} +#define BOARD_OSC_DIV (25) +#define HSE_VALUE ((uint32_t)25000000) +#define BOARD_OSC_PLLN (400) +#define BOARD_OSC_PLLQ (9) -uint64_t common_hal_time_monotonic_ns(void) { - uint64_t ms; - uint32_t us_until_ms; - current_tick(&ms, &us_until_ms); - // us counts down. - return 1000 * (ms * 1000 + (1000 - us_until_ms)); -} - -void common_hal_time_delay_ms(uint32_t delay) { - mp_hal_delay_ms(delay); -} +#define BOARD_FLASH_LATENCY FLASH_LATENCY_6 +#define BOARD_NO_VBUS_SENSE 1 diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk new file mode 100644 index 0000000000..0b4ccc7604 --- /dev/null +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk @@ -0,0 +1,14 @@ +USB_VID = 0x239A +USB_PID = 0x809C +USB_PRODUCT = "ST STM32F746G Discovery - CPy" +USB_MANUFACTURER = "STMicroelectronics" +USB_DEVICES = "CDC,MSC" + +INTERNAL_FLASH_FILESYSTEM = 1 + +MCU_SERIES = F7 +MCU_VARIANT = STM32F746xx +MCU_PACKAGE = TFBGA216 + +LD_COMMON = boards/common_default.ld +LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/stm32f746g_discovery/pins.c b/ports/stm/boards/stm32f746g_discovery/pins.c new file mode 100644 index 0000000000..a859c8d190 --- /dev/null +++ b/ports/stm/boards/stm32f746g_discovery/pins.c @@ -0,0 +1,110 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { +{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, +{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PF10) }, +{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PF09) }, +{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PF08) }, +{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PF07) }, +{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PF06) }, +{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PC07) }, +{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PC06) }, +{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PG06) }, +{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB04) }, +{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PG07) }, +{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA08) }, +{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PH06) }, +{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PI03) }, +{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PI02) }, +{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA15) }, +{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PI00) }, +{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PB15) }, +{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PB14) }, +{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PI01) }, +{ MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, +{ MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB08) }, +{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PI01) }, +{ MP_ROM_QSTR(MP_QSTR_SW), MP_ROM_PTR(&pin_PI11) }, +{ MP_ROM_QSTR(MP_QSTR_TP1), MP_ROM_PTR(&pin_PH02) }, +{ MP_ROM_QSTR(MP_QSTR_TP2), MP_ROM_PTR(&pin_PI08) }, +{ MP_ROM_QSTR(MP_QSTR_TP3), MP_ROM_PTR(&pin_PH15) }, +{ MP_ROM_QSTR(MP_QSTR_AUDIO_INT), MP_ROM_PTR(&pin_PD06) }, +{ MP_ROM_QSTR(MP_QSTR_AUDIO_SDA), MP_ROM_PTR(&pin_PH08) }, +{ MP_ROM_QSTR(MP_QSTR_AUDIO_SCL), MP_ROM_PTR(&pin_PH07) }, +{ MP_ROM_QSTR(MP_QSTR_EXT_SDA), MP_ROM_PTR(&pin_PB09) }, +{ MP_ROM_QSTR(MP_QSTR_EXT_SCL), MP_ROM_PTR(&pin_PB08) }, +{ MP_ROM_QSTR(MP_QSTR_EXT_RST), MP_ROM_PTR(&pin_PG03) }, +{ MP_ROM_QSTR(MP_QSTR_SD_D0), MP_ROM_PTR(&pin_PC08) }, +{ MP_ROM_QSTR(MP_QSTR_SD_D1), MP_ROM_PTR(&pin_PC09) }, +{ MP_ROM_QSTR(MP_QSTR_SD_D2), MP_ROM_PTR(&pin_PC10) }, +{ MP_ROM_QSTR(MP_QSTR_SD_D3), MP_ROM_PTR(&pin_PC11) }, +{ MP_ROM_QSTR(MP_QSTR_SD_CK), MP_ROM_PTR(&pin_PC12) }, +{ MP_ROM_QSTR(MP_QSTR_SD_CMD), MP_ROM_PTR(&pin_PD02) }, +{ MP_ROM_QSTR(MP_QSTR_SD_SW), MP_ROM_PTR(&pin_PC13) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_BL_CTRL), MP_ROM_PTR(&pin_PK03) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_INT), MP_ROM_PTR(&pin_PI13) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_SDA), MP_ROM_PTR(&pin_PH08) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_SCL), MP_ROM_PTR(&pin_PH07) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_FS_POWER), MP_ROM_PTR(&pin_PD05) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_FS_OVER_CURRENT), MP_ROM_PTR(&pin_PD04) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_HS_OVER_CURRENT), MP_ROM_PTR(&pin_PE03) }, +{ MP_ROM_QSTR(MP_QSTR_USB_VBUS), MP_ROM_PTR(&pin_PJ12) }, +{ MP_ROM_QSTR(MP_QSTR_USB_ID), MP_ROM_PTR(&pin_PA10) }, +{ MP_ROM_QSTR(MP_QSTR_USB_DM), MP_ROM_PTR(&pin_PA11) }, +{ MP_ROM_QSTR(MP_QSTR_USB_DP), MP_ROM_PTR(&pin_PA12) }, +{ MP_ROM_QSTR(MP_QSTR_VCP_TX), MP_ROM_PTR(&pin_PA09) }, +{ MP_ROM_QSTR(MP_QSTR_VCP_RX), MP_ROM_PTR(&pin_PB07) }, +{ MP_ROM_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB13) }, +{ MP_ROM_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB12) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_MDC), MP_ROM_PTR(&pin_PC01) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_MDIO), MP_ROM_PTR(&pin_PA02) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_REF_CLK), MP_ROM_PTR(&pin_PA01) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_CRS_DV), MP_ROM_PTR(&pin_PA07) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_RXD0), MP_ROM_PTR(&pin_PC04) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_RXD1), MP_ROM_PTR(&pin_PC05) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_RXER), MP_ROM_PTR(&pin_PG02) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_TX_EN), MP_ROM_PTR(&pin_PG11) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_TXD0), MP_ROM_PTR(&pin_PG13) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_TXD1), MP_ROM_PTR(&pin_PG14) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_SDCKE0), MP_ROM_PTR(&pin_PC03) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_SDNE0), MP_ROM_PTR(&pin_PH03) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_SDCLK), MP_ROM_PTR(&pin_PG08) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_SDNCAS), MP_ROM_PTR(&pin_PG15) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_SDNRAS), MP_ROM_PTR(&pin_PF11) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_SDNWE), MP_ROM_PTR(&pin_PH05) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_BA0), MP_ROM_PTR(&pin_PG04) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_BA1), MP_ROM_PTR(&pin_PG05) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_NBL0), MP_ROM_PTR(&pin_PE00) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_NBL1), MP_ROM_PTR(&pin_PE01) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A0), MP_ROM_PTR(&pin_PF00) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A1), MP_ROM_PTR(&pin_PF01) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A2), MP_ROM_PTR(&pin_PF02) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A3), MP_ROM_PTR(&pin_PF03) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A4), MP_ROM_PTR(&pin_PF04) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A5), MP_ROM_PTR(&pin_PF05) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A6), MP_ROM_PTR(&pin_PF12) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A7), MP_ROM_PTR(&pin_PF13) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A8), MP_ROM_PTR(&pin_PF14) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A9), MP_ROM_PTR(&pin_PF15) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A10), MP_ROM_PTR(&pin_PG00) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A11), MP_ROM_PTR(&pin_PG01) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D0), MP_ROM_PTR(&pin_PD14) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D1), MP_ROM_PTR(&pin_PD15) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D2), MP_ROM_PTR(&pin_PD00) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D3), MP_ROM_PTR(&pin_PD01) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D4), MP_ROM_PTR(&pin_PE07) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D5), MP_ROM_PTR(&pin_PE08) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D6), MP_ROM_PTR(&pin_PE09) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D7), MP_ROM_PTR(&pin_PE10) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D8), MP_ROM_PTR(&pin_PE11) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D9), MP_ROM_PTR(&pin_PE12) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D10), MP_ROM_PTR(&pin_PE13) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D11), MP_ROM_PTR(&pin_PE14) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D12), MP_ROM_PTR(&pin_PE15) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D13), MP_ROM_PTR(&pin_PD08) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D14), MP_ROM_PTR(&pin_PD09) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D15), MP_ROM_PTR(&pin_PD10) }, +{ MP_ROM_QSTR(MP_QSTR_I2C3_SDA), MP_ROM_PTR(&pin_PH08) }, +{ MP_ROM_QSTR(MP_QSTR_I2C3_SCL), MP_ROM_PTR(&pin_PH07) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index 0b3c55819a..7102b12429 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -44,6 +44,9 @@ #define BOARD_OVERWRITE_SWD (1) #define BOARD_NO_VBUS_SENSE (1) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) +#define HSE_VALUE ((uint32_t)24000000U) + // Status LEDs #define MICROPY_HW_LED_STATUS (&pin_PA02) diff --git a/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h b/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h deleted file mode 100644 index 5cb5634223..0000000000 --- a/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)24000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index 2572c7f26a..d3310efe06 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -196,9 +196,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } //handle typedef selection, errors - if ( (self->sck != NULL && self->mosi != NULL && self->miso != NULL) || - (self->sck != NULL && self->mosi != NULL && miso == NULL) || - (self->sck != NULL && self->miso != NULL && mosi == NULL)) { + if (self->sck != NULL && (self->mosi != NULL || self->miso != NULL)) { SPIx = mcu_spi_banks[self->sck->periph_index - 1]; } else { if (spi_taken) { diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index cb5460c68e..54ac68d738 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -35,8 +35,6 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" -#include "tick.h" - #define ALL_UARTS 0xFFFF //arrays use 0 based numbering: UART1 is stored at index 0 @@ -211,8 +209,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // Init buffer for rx and claim pins if (self->rx != NULL) { - ringbuf_alloc(&self->rbuf, receiver_buffer_size, true); - if (!self->rbuf.buf) { + if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { mp_raise_ValueError(translate("UART Buffer allocation error")); } claim_pin(rx); @@ -248,9 +245,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { reset_pin_number(self->rx->pin->port,self->rx->pin->number); self->tx = NULL; self->rx = NULL; - gc_free(self->rbuf.buf); - self->rbuf.size = 0; - self->rbuf.iput = self->rbuf.iget = 0; + ringbuf_free(&self->ringbuf); } size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { @@ -258,11 +253,10 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t mp_raise_ValueError(translate("No RX pin")); } - size_t rx_bytes = 0; uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for all bytes received or timeout, same as nrf - while ( (ringbuf_count(&self->rbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { + while ( (ringbuf_num_filled(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; //restart if it failed in the callback if (errflag != HAL_OK) { @@ -276,12 +270,8 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t // Halt reception HAL_NVIC_DisableIRQ(self->irq); - // copy received data - rx_bytes = ringbuf_count(&self->rbuf); - rx_bytes = MIN(rx_bytes, len); - for (uint16_t i = 0; i < rx_bytes; i++) { - data[i] = ringbuf_get(&self->rbuf); - } + // Copy as much received data as available, up to len bytes. + size_t rx_bytes = ringbuf_get_n(&self->ringbuf, data, len); HAL_NVIC_EnableIRQ(self->irq); if (rx_bytes == 0) { @@ -321,7 +311,7 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) if ((HAL_UART_GetState(handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { return; } - ringbuf_put_n(&context->rbuf, &context->rx_char, 1); + ringbuf_put_n(&context->ringbuf, &context->rx_char, 1); errflag = HAL_UART_Receive_IT(handle, &context->rx_char, 1); return; @@ -380,13 +370,13 @@ void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeou } uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - return ringbuf_count(&self->rbuf); + return ringbuf_num_filled(&self->ringbuf); } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { // Halt reception HAL_NVIC_DisableIRQ(self->irq); - ringbuf_clear(&self->rbuf); + ringbuf_clear(&self->ringbuf); HAL_NVIC_EnableIRQ(self->irq); } diff --git a/ports/stm/common-hal/busio/UART.h b/ports/stm/common-hal/busio/UART.h index 5ac1d352ca..d1971ce27a 100644 --- a/ports/stm/common-hal/busio/UART.h +++ b/ports/stm/common-hal/busio/UART.h @@ -47,7 +47,7 @@ typedef struct { const mcu_periph_obj_t *tx; const mcu_periph_obj_t *rx; - ringbuf_t rbuf; + ringbuf_t ringbuf; uint8_t rx_char; uint32_t baudrate; diff --git a/ports/stm/common-hal/displayio/ParallelBus.c b/ports/stm/common-hal/displayio/ParallelBus.c index 1b808ec025..314b72ff73 100644 --- a/ports/stm/common-hal/displayio/ParallelBus.c +++ b/ports/stm/common-hal/displayio/ParallelBus.c @@ -33,8 +33,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/__init__.h" -#include "tick.h" - void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 2c513f4aad..6102134978 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -36,7 +36,10 @@ bool neopixel_in_use; #endif -#if defined(LQFP144) +#if defined(TFBGA216) + #define GPIO_PORT_COUNT 11 + GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, GPIOI, GPIOJ, GPIOK}; +#elif defined(LQFP144) #define GPIO_PORT_COUNT 7 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG}; #elif defined(LQFP100_f4) || (LQFP100_x7) @@ -131,3 +134,15 @@ GPIO_TypeDef * pin_port(uint8_t pin_port) { uint16_t pin_mask(uint8_t pin_number) { return 1<port * 16 + pin->number; +} + +void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { + claim_pin(pin); +} + +void common_hal_mcu_pin_reset_number(uint8_t pin_no) { + reset_pin_number(pin_no / 16, pin_no % 16); +} diff --git a/ports/stm/common-hal/microcontroller/Processor.c b/ports/stm/common-hal/microcontroller/Processor.c index c8b07db3f0..8dc968b36a 100644 --- a/ports/stm/common-hal/microcontroller/Processor.c +++ b/ports/stm/common-hal/microcontroller/Processor.c @@ -28,8 +28,9 @@ #include "common-hal/microcontroller/Processor.h" #include "py/runtime.h" #include "supervisor/shared/translate.h" +#include STM32_HAL_H -#if defined(STM32F4) +#if CPY_STM32F4 #define STM32_UUID ((uint32_t *)0x1FFF7A10) @@ -61,7 +62,7 @@ STATIC void set_adc_params(ADC_HandleTypeDef *AdcHandle) { #endif float common_hal_mcu_processor_get_temperature(void) { - #if defined(STM32F4) + #if CPY_STM32F4 __HAL_RCC_ADC1_CLK_ENABLE(); //HAL Implementation @@ -71,7 +72,7 @@ float common_hal_mcu_processor_get_temperature(void) { HAL_ADC_Init(&AdcHandle); ADC->CCR |= ADC_CCR_TSVREFE; - ADC->CCR &= ~ADC_CCR_VBATE; // If this somehow got turned on, it'll return bad values. + ADC->CCR &= ~ADC_CCR_VBATE; // If this somehow got turned on, it'll return bad values. sConfig.Channel = ADC_CHANNEL_TEMPSENSOR; //either 16 or 18, depending on chip sConfig.Rank = 1; @@ -94,7 +95,7 @@ float common_hal_mcu_processor_get_temperature(void) { } float common_hal_mcu_processor_get_voltage(void) { - #if defined(STM32F4) + #if CPY_STM32F4 __HAL_RCC_ADC1_CLK_ENABLE(); //HAL Implementation @@ -117,7 +118,7 @@ float common_hal_mcu_processor_get_voltage(void) { uint32_t value = (uint32_t)HAL_ADC_GetValue(&AdcHandle); HAL_ADC_Stop(&AdcHandle); - //This value could be used to actively correct ADC values. + //This value could be used to actively correct ADC values. adc_refcor = ((float)(*VREFIN_CAL)) / ((float)value); return adc_refcor * 3.3f; @@ -131,7 +132,7 @@ uint32_t common_hal_mcu_processor_get_frequency(void) { } void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { - #if defined(STM32F4) + #if CPY_STM32F4 for (int i=0; i<3; i++) { ((uint32_t*) raw_id)[i] = STM32_UUID[i]; } diff --git a/ports/stm/common-hal/microcontroller/__init__.c b/ports/stm/common-hal/microcontroller/__init__.c index 020c3ee79c..a827399ccb 100644 --- a/ports/stm/common-hal/microcontroller/__init__.c +++ b/ports/stm/common-hal/microcontroller/__init__.c @@ -40,32 +40,13 @@ #include "supervisor/filesystem.h" #include "supervisor/shared/safe_mode.h" -//tested divisor value for busy loop in us delay -#define LOOP_TICKS 12 - -STATIC uint32_t get_us(void) { - uint32_t ticks_per_us = HAL_RCC_GetSysClockFreq()/1000000; - uint32_t micros, sys_cycles; - do { - micros = supervisor_ticks_ms32(); - sys_cycles = SysTick->VAL; //counts backwards - } while (micros != supervisor_ticks_ms32()); //try again if ticks_ms rolled over - return (micros * 1000) + (ticks_per_us * 1000 - sys_cycles) / ticks_per_us; -} - void common_hal_mcu_delay_us(uint32_t delay) { - if (__get_PRIMASK() == 0x00000000) { - //by default use ticks_ms - uint32_t start = get_us(); - while (get_us()-start < delay) { - __asm__ __volatile__("nop"); - } - } else { - //when SysTick is disabled, approximate with busy loop - const uint32_t ucount = HAL_RCC_GetSysClockFreq() / 1000000 * delay / LOOP_TICKS; - for (uint32_t count = 0; ++count <= ucount;) { - } - } + uint32_t ticks_per_us = HAL_RCC_GetSysClockFreq()/1000000; + delay *= ticks_per_us; + SysTick->LOAD = delay; + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; + while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0) {} + SysTick->CTRL = 0; } volatile uint32_t nesting_count = 0; @@ -118,4 +99,3 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { .start_address = (uint8_t*) (CIRCUITPY_INTERNAL_NVM_START_ADDR) }; #endif - diff --git a/ports/stm/common-hal/neopixel_write/__init__.c b/ports/stm/common-hal/neopixel_write/__init__.c index 6740a0d348..c8852403b2 100644 --- a/ports/stm/common-hal/neopixel_write/__init__.c +++ b/ports/stm/common-hal/neopixel_write/__init__.c @@ -24,18 +24,17 @@ * THE SOFTWARE. */ -#include "py/mphal.h" #include "shared-bindings/neopixel_write/__init__.h" -#include "tick.h" #include "py/mperrno.h" +#include "py/mphal.h" #include "py/runtime.h" #include "common-hal/microcontroller/Pin.h" #include "stm32f4xx_hal.h" #include "stm32f4xx_ll_gpio.h" +#include "supervisor/port.h" -uint64_t next_start_tick_ms = 0; -uint32_t next_start_tick_us = 1000; +uint64_t next_start_raw_ticks = 0; //sysclock divisors #define MAGIC_800_INT 900000 // ~1.11 us -> 1.2 field @@ -45,7 +44,7 @@ uint32_t next_start_tick_us = 1000; #pragma GCC push_options #pragma GCC optimize ("Os") -void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, +void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { uint8_t *p = pixels, *end = p + numBytes, pix = *p++, mask = 0x80; uint32_t start = 0; @@ -59,9 +58,9 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout uint32_t t0 = (sys_freq/MAGIC_800_T0H); uint32_t t1 = (sys_freq/MAGIC_800_T1H); - // This must be called while interrupts are on in case we're waiting for a - // future ms tick. - wait_until(next_start_tick_ms, next_start_tick_us); + // Wait to make sure we don't append onto the last transmission. This should only be a tick or + // two. + while (port_get_raw_ticks(NULL) < next_start_raw_ticks) {} GPIO_TypeDef * p_port = pin_port(digitalinout->pin->port); uint32_t p_mask = pin_mask(digitalinout->pin->number); @@ -90,13 +89,7 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout __enable_irq(); // Update the next start. - current_tick(&next_start_tick_ms, &next_start_tick_us); - if (next_start_tick_us < 100) { - next_start_tick_ms += 1; - next_start_tick_us = 100 - next_start_tick_us; - } else { - next_start_tick_us -= 100; - } + next_start_raw_ticks = port_get_raw_ticks(NULL) + 4; } -#pragma GCC pop_options \ No newline at end of file +#pragma GCC pop_options diff --git a/ports/stm/common-hal/os/__init__.c b/ports/stm/common-hal/os/__init__.c index 1a1efef9ff..eef58bfe22 100644 --- a/ports/stm/common-hal/os/__init__.c +++ b/ports/stm/common-hal/os/__init__.c @@ -32,15 +32,15 @@ #include "py/mperrno.h" #include "py/runtime.h" -#include "stm32f4xx_hal.h" +#include STM32_HAL_H #include "peripherals/periph.h" STATIC const qstr os_uname_info_fields[] = { MP_QSTR_sysname, MP_QSTR_nodename, MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine }; -STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "stm32f4"); -STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "stm32f4"); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, STM32_SERIES_LOWER); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, STM32_SERIES_LOWER); STATIC const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING); STATIC const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE); diff --git a/ports/stm/common-hal/pulseio/PWMOut.c b/ports/stm/common-hal/pulseio/PWMOut.c index d62ee2a380..304a1539c0 100644 --- a/ports/stm/common-hal/pulseio/PWMOut.c +++ b/ports/stm/common-hal/pulseio/PWMOut.c @@ -32,7 +32,7 @@ #include "supervisor/shared/translate.h" #include "shared-bindings/microcontroller/__init__.h" -#include "stm32f4xx_hal.h" +#include STM32_HAL_H #include "common-hal/microcontroller/Pin.h" #define ALL_CLOCKS 0xFFFF diff --git a/ports/stm/common-hal/pulseio/PWMOut.h b/ports/stm/common-hal/pulseio/PWMOut.h index 8519735c62..57ab143b9a 100644 --- a/ports/stm/common-hal/pulseio/PWMOut.h +++ b/ports/stm/common-hal/pulseio/PWMOut.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "stm32f4xx_hal.h" +#include STM32_HAL_H #include "peripherals/periph.h" #include "py/obj.h" diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 8428a22789..9d82a18a01 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -32,28 +32,43 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/pulseio/PulseIn.h" -#include "tick.h" -#include "stm32f4xx_hal.h" +#include STM32_HAL_H #define STM32_GPIO_PORT_SIZE 16 static pulseio_pulsein_obj_t* _objs[STM32_GPIO_PORT_SIZE]; +STATIC TIM_HandleTypeDef t6_handle; +static uint32_t overflow_count = 0; +STATIC uint8_t refcount = 0; + static void assign_EXTI_Interrupt(pulseio_pulsein_obj_t* self, uint8_t num); +void TIM6_IRQHandler(void) +{ + // Detect TIM Update event + if (__HAL_TIM_GET_FLAG(&t6_handle, TIM_FLAG_UPDATE) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(&t6_handle, TIM_IT_UPDATE) != RESET) + { + __HAL_TIM_CLEAR_IT(&t6_handle, TIM_IT_UPDATE); + overflow_count++; + } + } +} + static void pulsein_handler(uint8_t num) { + // Grab the current time first. + uint32_t current_overflow = overflow_count; + uint32_t current_count = 0; + #if HAS_BASIC_TIM + current_count = TIM6->CNT; + #endif + // Interrupt register must be cleared manually EXTI->PR = 1 << num; - // Grab the current time first. - uint32_t current_us; - uint64_t current_ms; - current_tick(¤t_ms, ¤t_us); - - // current_tick gives us the remaining us until the next tick but we want the number since the last ms. - current_us = 1000 - current_us; - pulseio_pulsein_obj_t* self = _objs[num]; if ( !self ) return; @@ -64,22 +79,9 @@ static void pulsein_handler(uint8_t num) { self->first_edge = false; } } else { - uint32_t ms_diff = current_ms - self->last_ms; - uint16_t us_diff = current_us - self->last_us; - uint32_t total_diff = us_diff; - - if (self->last_us > current_us) { - total_diff = 1000 + current_us - self->last_us; - if (ms_diff > 1) { - total_diff += (ms_diff - 1) * 1000; - } - } else { - total_diff += ms_diff * 1000; - } - uint16_t duration = 0xffff; - if (total_diff < duration) { - duration = total_diff; - } + uint32_t total_diff = current_count + 0x10000 * (current_overflow - self->last_overflow) - self->last_count; + // Cap duration at 16 bits. + uint16_t duration = MIN(0xffff, total_diff); uint16_t i = (self->start + self->len) % self->maxlen; self->buffer[i] = duration; @@ -90,8 +92,8 @@ static void pulsein_handler(uint8_t num) { } } - self->last_ms = current_ms; - self->last_us = current_us; + self->last_count = current_count; + self->last_overflow = current_overflow; } void pulsein_reset(void) { @@ -102,10 +104,18 @@ void pulsein_reset(void) { } } memset(_objs, 0, sizeof(_objs)); + + #if HAS_BASIC_TIM + __HAL_RCC_TIM6_CLK_DISABLE(); + refcount = 0; + #endif } void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin, uint16_t maxlen, bool idle_state) { +#if !(HAS_BASIC_TIM) + mp_raise_NotImplementedError(translate("PulseIn not supported on this chip")); +#else // STM32 has one shared EXTI for each pin number, 0-15 uint8_t p_num = pin->number; if(_objs[p_num]) { @@ -116,10 +126,10 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu // Allocate pulse buffer self->buffer = (uint16_t *) m_malloc(maxlen * sizeof(uint16_t), false); if (self->buffer == NULL) { - mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), + mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), maxlen * sizeof(uint16_t)); } - + // Set internal variables self->pin = pin; self->maxlen = maxlen; @@ -128,8 +138,27 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu self->len = 0; self->first_edge = true; self->paused = false; - self->last_us = 0; - self->last_ms = 0; + self->last_count = 0; + self->last_overflow = 0; + + if (HAL_TIM_Base_GetState(&t6_handle) == HAL_TIM_STATE_RESET) { + // Set the new period + t6_handle.Instance = TIM6; + t6_handle.Init.Prescaler = 168; // HCLK is 168 mhz so divide down to 1mhz + t6_handle.Init.Period = 0xffff; + HAL_TIM_Base_Init(&t6_handle); + + // TIM6 has limited HAL support, set registers manually + t6_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt + t6_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer + t6_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts + __HAL_TIM_ENABLE_IT(&t6_handle, TIM_IT_UPDATE); + + overflow_count = 0; + } + // Add to active PulseIns + refcount++; +#endif // EXTI pins can also be read as an input GPIO_InitTypeDef GPIO_InitStruct = {0}; @@ -157,6 +186,13 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { _objs[self->pin->number] = NULL; reset_pin_number(self->pin->port, self->pin->number); self->pin = NULL; + + refcount--; + if (refcount == 0) { + #if HAS_BASIC_TIM + __HAL_RCC_TIM6_CLK_DISABLE(); + #endif + } } void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t* self) { @@ -191,8 +227,8 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, uint16_t tri self->first_edge = true; self->paused = false; - self->last_ms = 0; - self->last_us = 0; + self->last_count = 0; + self->last_overflow = 0; HAL_NVIC_EnableIRQ(self->irq); } diff --git a/ports/stm/common-hal/pulseio/PulseIn.h b/ports/stm/common-hal/pulseio/PulseIn.h index 5456613c6a..34d0cc731a 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.h +++ b/ports/stm/common-hal/pulseio/PulseIn.h @@ -45,8 +45,8 @@ typedef struct { volatile uint16_t start; volatile uint16_t len; - volatile uint16_t last_us; - volatile uint64_t last_ms; + volatile uint32_t last_overflow; + volatile uint16_t last_count; } pulseio_pulsein_obj_t; void pulsein_reset(void); diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index d82525ea16..c7c879c883 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -35,9 +35,8 @@ #include "shared-bindings/pulseio/PWMOut.h" #include "supervisor/shared/translate.h" -#include "stm32f4xx_hal.h" +#include STM32_HAL_H #include "common-hal/microcontroller/Pin.h" -#include "tick.h" // A single timer is shared amongst all PulseOut objects under the assumption that // the code is single threaded. @@ -60,7 +59,7 @@ STATIC void turn_off(pulseio_pulseout_obj_t *pulseout) { // Turn off PWM HAL_TIM_PWM_Stop(&(pulseout->pwmout->handle), pulseout->pwmout->channel); // Make sure pin is low. - HAL_GPIO_WritePin(pin_port(pulseout->pwmout->tim->pin->port), + HAL_GPIO_WritePin(pin_port(pulseout->pwmout->tim->pin->port), pin_mask(pulseout->pwmout->tim->pin->number), 0); } @@ -196,7 +195,7 @@ void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pu // mp_raise_RuntimeError(translate("Error: Send Timeout")); // } } - //turn off timer counter. + //turn off timer counter. t7_handle.Instance->CR1 &= ~TIM_CR1_CEN; } diff --git a/ports/stm/common-hal/rgbmatrix/RGBMatrix.c b/ports/stm/common-hal/rgbmatrix/RGBMatrix.c new file mode 100644 index 0000000000..9e60cc3e6f --- /dev/null +++ b/ports/stm/common-hal/rgbmatrix/RGBMatrix.c @@ -0,0 +1,54 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "common-hal/rgbmatrix/RGBMatrix.h" + +#include STM32_HAL_H + +extern void _PM_IRQ_HANDLER(void); + +void *common_hal_rgbmatrix_timer_allocate() { + // TODO(jepler) properly handle resource allocation including never-reset + return TIM6; +} + + +void common_hal_rgbmatrix_timer_enable(void* ptr) { + HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn); +} + +void common_hal_rgbmatrix_timer_disable(void* ptr) { + TIM_TypeDef *tim = (TIM_TypeDef*)ptr; + tim->DIER &= ~TIM_DIER_UIE; + HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn); +} + +void common_hal_rgbmatrix_timer_free(void* ptr) { + common_hal_rgbmatrix_timer_disable(ptr); + // TODO(jepler) properly handle resource allocation including never-reset +} diff --git a/ports/stm/common-hal/rgbmatrix/RGBMatrix.h b/ports/stm/common-hal/rgbmatrix/RGBMatrix.h new file mode 100644 index 0000000000..48de4dcb21 --- /dev/null +++ b/ports/stm/common-hal/rgbmatrix/RGBMatrix.h @@ -0,0 +1,35 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RGBMATRIX_RGBMATRIX_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RGBMATRIX_RGBMATRIX_H + +void *common_hal_rgbmatrix_timer_allocate(void); +void common_hal_rgbmatrix_timer_enable(void*); +void common_hal_rgbmatrix_timer_disable(void*); +void common_hal_rgbmatrix_timer_free(void*); + +#endif diff --git a/ports/stm/common-hal/rgbmatrix/__init__.c b/ports/stm/common-hal/rgbmatrix/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/stm/common-hal/rgbmatrix/__init__.h b/ports/stm/common-hal/rgbmatrix/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/stm/hal_conf/sort_defines.py b/ports/stm/hal_conf/sort_defines.py new file mode 100644 index 0000000000..09e79dade5 --- /dev/null +++ b/ports/stm/hal_conf/sort_defines.py @@ -0,0 +1,21 @@ +f = open("stm32_hal_conf.h") + +defines = {} + +for line in f: + if "define HAL_" in line: + parts = line.split() + index = len(parts) + for i, part in enumerate(parts): + if part.startswith("HAL_"): + index = i + define = parts[index] + if define not in defines: + defines[define] = index == 1 + +keys = sorted(defines.keys()) +for k in keys: + if not defines[k]: + print("// ", end="") + + print("#define", k) diff --git a/ports/stm/hal_conf/stm32_hal_conf.h b/ports/stm/hal_conf/stm32_hal_conf.h new file mode 100644 index 0000000000..b78afc64b3 --- /dev/null +++ b/ports/stm/hal_conf/stm32_hal_conf.h @@ -0,0 +1,76 @@ + +#include "mpconfigboard.h" + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32_HAL_CONF_H +#define __STM32_HAL_CONF_H + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +// #define HAL_CAN_MODULE_ENABLED +// #define HAL_CEC_MODULE_ENABLED +// #define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +// #define HAL_CRC_MODULE_ENABLED +// #define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +// #define HAL_DCMI_MODULE_ENABLED +// #define HAL_DFSDM_MODULE_ENABLED +// #define HAL_DMA2D_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +// #define HAL_DSI_MODULE_ENABLED +// #define HAL_DTS_MODULE_ENABLED +// #define HAL_ETH_MODULE_ENABLED +// #define HAL_EXTI_MODULE_ENABLED +// #define HAL_FDCAN_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +// #define HAL_FMPI2C_MODULE_ENABLED +// #define HAL_GFXMMU_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +// #define HAL_HASH_MODULE_ENABLED +// #define HAL_HCD_MODULE_ENABLED +// #define HAL_HRTIM_MODULE_ENABLED +// #define HAL_HSEM_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +// #define HAL_IRDA_MODULE_ENABLED +// #define HAL_IWDG_MODULE_ENABLED +// #define HAL_JPEG_MODULE_ENABLED +// #define HAL_LPTIM_MODULE_ENABLED +// #define HAL_LTDC_MODULE_ENABLED +// #define HAL_MDIOS_MODULE_ENABLED +#define HAL_MDMA_MODULE_ENABLED +// #define HAL_MMC_MODULE_ENABLED +#define HAL_MODULE_ENABLED +// #define HAL_NAND_MODULE_ENABLED +// #define HAL_NOR_MODULE_ENABLED +// #define HAL_OPAMP_MODULE_ENABLED +// #define HAL_OSPI_MODULE_ENABLED +// #define HAL_OTFDEC_MODULE_ENABLED +// #define HAL_PCCARD_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +// #define HAL_PSSI_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +// #define HAL_SAI_MODULE_ENABLED +// #define HAL_SDRAM_MODULE_ENABLED +// #define HAL_SD_MODULE_ENABLED +// #define HAL_SMARTCARD_MODULE_ENABLED +// #define HAL_SMBUS_MODULE_ENABLED +// #define HAL_SPDIFRX_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +// #define HAL_SRAM_MODULE_ENABLED +// #define HAL_SWPMI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +// #define HAL_WWDG_MODULE_ENABLED + +#endif // __STM32_HAL_CONF_H diff --git a/ports/stm/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h b/ports/stm/hal_conf/stm32f4xx_hal_conf.h similarity index 82% rename from ports/stm/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h rename to ports/stm/hal_conf/stm32f4xx_hal_conf.h index f1b4013485..ad8939052e 100644 --- a/ports/stm/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h +++ b/ports/stm/hal_conf/stm32f4xx_hal_conf.h @@ -2,7 +2,7 @@ ****************************************************************************** * @file stm32f4xx_hal_conf_template.h * @author MCD Application Team - * @brief HAL configuration template file. + * @brief HAL configuration template file. * This file should be copied to the application folder and renamed * to stm32f4xx_hal_conf.h. ****************************************************************************** @@ -17,7 +17,9 @@ * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** - */ + */ + +#include "stm32_hal_conf.h" /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_HAL_CONF_H @@ -30,68 +32,13 @@ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -#define HAL_SRAM_MODULE_ENABLED -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -#define HAL_SD_MODULE_ENABLED -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -#define HAL_QSPI_MODULE_ENABLED -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - /* ########################## HSE/HSI Values adaptation ##################### */ /** * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). + * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ @@ -102,7 +49,7 @@ /** * @brief Internal High Speed oscillator (HSI) value. * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). + * (when HSI is used as system clock source, directly or through the PLL). */ #if !defined (HSI_VALUE) #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ @@ -111,7 +58,7 @@ /** * @brief Internal Low Speed oscillator (LSI) value. */ -#if !defined (LSI_VALUE) +#if !defined (LSI_VALUE) #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz The real value may vary depending on the variations @@ -120,17 +67,18 @@ * @brief External Low Speed oscillator (LSE) value. */ #if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ + #define LSE_VALUE 32768 /*!< Value of the External Low Speed oscillator in Hz */ #endif /* LSE_VALUE */ #if !defined (LSE_STARTUP_TIMEOUT) #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ #endif /* LSE_STARTUP_TIMEOUT */ + /** * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. */ #if !defined (EXTERNAL_CLOCK_VALUE) #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ @@ -143,16 +91,16 @@ /** * @brief This is the HAL system configuration section */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U #define PREFETCH_ENABLE 1U #define INSTRUCTION_CACHE_ENABLE 1U #define DATA_CACHE_ENABLE 1U /* ########################## Assert Selection ############################## */ /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the + * @brief Uncomment the line below to expanse the "assert_param" macro in the * HAL drivers code */ /* #define USE_FULL_ASSERT 1U */ @@ -169,7 +117,7 @@ #define MAC_ADDR4 0U #define MAC_ADDR5 0U -/* Definition of the Ethernet driver buffers size and count */ +/* Definition of the Ethernet driver buffers size and count */ #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ #define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ @@ -177,9 +125,9 @@ /* Section 2: PHY configuration section */ -/* DP83848_PHY_ADDRESS Address*/ +/* DP83848_PHY_ADDRESS Address*/ #define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ #define PHY_RESET_DELAY ((uint32_t)0x000000FFU) /* PHY Configuration delay */ #define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) @@ -191,7 +139,7 @@ #define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ #define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - + #define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ #define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ #define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ @@ -206,7 +154,7 @@ #define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ #define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ #define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - + /* Section 4: Extended PHY Registers */ #define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ @@ -224,7 +172,7 @@ /* Includes ------------------------------------------------------------------*/ /** - * @brief Include module's header file + * @brief Include module's header file */ #ifdef HAL_RCC_MODULE_ENABLED @@ -242,7 +190,7 @@ #ifdef HAL_DMA_MODULE_ENABLED #include "stm32f4xx_hal_dma.h" #endif /* HAL_DMA_MODULE_ENABLED */ - + #ifdef HAL_CORTEX_MODULE_ENABLED #include "stm32f4xx_hal_cortex.h" #endif /* HAL_CORTEX_MODULE_ENABLED */ @@ -260,7 +208,7 @@ #endif /* HAL_CRC_MODULE_ENABLED */ #ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" + #include "stm32f4xx_hal_cryp.h" #endif /* HAL_CRYP_MODULE_ENABLED */ #ifdef HAL_DMA2D_MODULE_ENABLED @@ -282,7 +230,7 @@ #ifdef HAL_FLASH_MODULE_ENABLED #include "stm32f4xx_hal_flash.h" #endif /* HAL_FLASH_MODULE_ENABLED */ - + #ifdef HAL_SRAM_MODULE_ENABLED #include "stm32f4xx_hal_sram.h" #endif /* HAL_SRAM_MODULE_ENABLED */ @@ -297,11 +245,11 @@ #ifdef HAL_PCCARD_MODULE_ENABLED #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - +#endif /* HAL_PCCARD_MODULE_ENABLED */ + #ifdef HAL_SDRAM_MODULE_ENABLED #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ +#endif /* HAL_SDRAM_MODULE_ENABLED */ #ifdef HAL_HASH_MODULE_ENABLED #include "stm32f4xx_hal_hash.h" @@ -382,7 +330,7 @@ #ifdef HAL_HCD_MODULE_ENABLED #include "stm32f4xx_hal_hcd.h" #endif /* HAL_HCD_MODULE_ENABLED */ - + #ifdef HAL_DSI_MODULE_ENABLED #include "stm32f4xx_hal_dsi.h" #endif /* HAL_DSI_MODULE_ENABLED */ @@ -410,14 +358,14 @@ #ifdef HAL_LPTIM_MODULE_ENABLED #include "stm32f4xx_hal_lptim.h" #endif /* HAL_LPTIM_MODULE_ENABLED */ - + /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. * @param expr: If expr is false, it calls assert_failed function * which reports the name of the source file and the source - * line number of the call that failed. + * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ @@ -426,13 +374,20 @@ void assert_failed(uint8_t* file, uint32_t line); #else #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ +#endif /* USE_FULL_ASSERT */ #ifdef __cplusplus } #endif +// CircuitPython specific conditionals. Using a value is better than checking +// defined because undefined variable happen when a file isn't included when it +// should have been. +#define CPY_STM32F4 1 +#define CPY_STM32F7 0 +#define CPY_STM32H7 0 + #endif /* __STM32F4xx_HAL_CONF_H */ - + /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/nucleo_f767zi/stm32f7xx_hal_conf.h b/ports/stm/hal_conf/stm32f7xx_hal_conf.h similarity index 83% rename from ports/stm/boards/nucleo_f767zi/stm32f7xx_hal_conf.h rename to ports/stm/hal_conf/stm32f7xx_hal_conf.h index 84699bd784..3dd368e853 100644 --- a/ports/stm/boards/nucleo_f767zi/stm32f7xx_hal_conf.h +++ b/ports/stm/hal_conf/stm32f7xx_hal_conf.h @@ -2,7 +2,7 @@ ****************************************************************************** * @file stm32f7xx_hal_conf_template.h * @author MCD Application Team - * @brief HAL configuration template file. + * @brief HAL configuration template file. * This file should be copied to the application folder and renamed * to stm32f7xx_hal_conf.h. ****************************************************************************** @@ -17,7 +17,9 @@ * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** - */ + */ + +#include "stm32_hal_conf.h" /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F7xx_HAL_CONF_H @@ -30,69 +32,13 @@ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - - #define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -#define HAL_ETH_MODULE_ENABLED -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_JPEG_MODULE_ENABLED */ -/* #define HAL_MDIOS_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_I2C_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - /* ########################## HSE/HSI Values adaptation ##################### */ /** * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). + * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ @@ -103,7 +49,7 @@ /** * @brief Internal High Speed oscillator (HSI) value. * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). + * (when HSI is used as system clock source, directly or through the PLL). */ #if !defined (HSI_VALUE) #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ @@ -112,7 +58,7 @@ /** * @brief Internal Low Speed oscillator (LSI) value. */ -#if !defined (LSI_VALUE) +#if !defined (LSI_VALUE) #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz The real value may vary depending on the variations @@ -130,8 +76,8 @@ /** * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. */ #if !defined (EXTERNAL_CLOCK_VALUE) #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/ @@ -143,7 +89,7 @@ /* ########################### System Configuration ######################### */ /** * @brief This is the HAL system configuration section - */ + */ #define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ #define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ #define USE_RTOS 0U @@ -152,7 +98,7 @@ /* ########################## Assert Selection ############################## */ /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the + * @brief Uncomment the line below to expanse the "assert_param" macro in the * HAL drivers code */ /* #define USE_FULL_ASSERT 1U */ @@ -169,7 +115,7 @@ #define MAC_ADDR4 0U #define MAC_ADDR5 0U -/* Definition of the Ethernet driver buffers size and count */ +/* Definition of the Ethernet driver buffers size and count */ #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ #define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ @@ -177,9 +123,9 @@ /* Section 2: PHY configuration section */ -/* LAN8742A_PHY_ADDRESS Address*/ +/* LAN8742A_PHY_ADDRESS Address*/ #define LAN8742A_PHY_ADDRESS 0 -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ #define PHY_RESET_DELAY ((uint32_t)0x000000FFU) /* PHY Configuration delay */ #define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) @@ -191,7 +137,7 @@ #define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */ #define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */ - + #define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ #define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ #define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ @@ -206,7 +152,7 @@ #define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ #define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ #define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - + /* Section 4: Extended PHY Registers */ #define PHY_SR ((uint16_t)0x1FU) /*!< PHY status register Offset */ @@ -214,7 +160,7 @@ #define PHY_DUPLEX_STATUS ((uint16_t)0x0010U) /*!< PHY Duplex mask */ #define PHY_ISFR ((uint16_t)0x001DU) /*!< PHY Interrupt Source Flag register Offset */ -#define PHY_ISFR_INT4 ((uint16_t)0x000BU) /*!< PHY Link down inturrupt */ +#define PHY_ISFR_INT4 ((uint16_t)0x000BU) /*!< PHY Link down inturrupt */ /* ################## SPI peripheral configuration ########################## */ @@ -227,7 +173,7 @@ /* Includes ------------------------------------------------------------------*/ /** - * @brief Include module's header file + * @brief Include module's header file */ #ifdef HAL_RCC_MODULE_ENABLED @@ -245,7 +191,7 @@ #ifdef HAL_DMA_MODULE_ENABLED #include "stm32f7xx_hal_dma.h" #endif /* HAL_DMA_MODULE_ENABLED */ - + #ifdef HAL_CORTEX_MODULE_ENABLED #include "stm32f7xx_hal_cortex.h" #endif /* HAL_CORTEX_MODULE_ENABLED */ @@ -267,7 +213,7 @@ #endif /* HAL_CRC_MODULE_ENABLED */ #ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f7xx_hal_cryp.h" + #include "stm32f7xx_hal_cryp.h" #endif /* HAL_CRYP_MODULE_ENABLED */ #ifdef HAL_DMA2D_MODULE_ENABLED @@ -289,7 +235,7 @@ #ifdef HAL_FLASH_MODULE_ENABLED #include "stm32f7xx_hal_flash.h" #endif /* HAL_FLASH_MODULE_ENABLED */ - + #ifdef HAL_SRAM_MODULE_ENABLED #include "stm32f7xx_hal_sram.h" #endif /* HAL_SRAM_MODULE_ENABLED */ @@ -304,7 +250,7 @@ #ifdef HAL_SDRAM_MODULE_ENABLED #include "stm32f7xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ +#endif /* HAL_SDRAM_MODULE_ENABLED */ #ifdef HAL_HASH_MODULE_ENABLED #include "stm32f7xx_hal_hash.h" @@ -412,7 +358,7 @@ #ifdef HAL_MDIOS_MODULE_ENABLED #include "stm32f7xx_hal_mdios.h" -#endif /* HAL_MDIOS_MODULE_ENABLED */ +#endif /* HAL_MDIOS_MODULE_ENABLED */ #ifdef HAL_SMBUS_MODULE_ENABLED #include "stm32f7xx_hal_smbus.h" @@ -424,7 +370,7 @@ * @brief The assert_param macro is used for function's parameters check. * @param expr: If expr is false, it calls assert_failed function * which reports the name of the source file and the source - * line number of the call that failed. + * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ @@ -439,7 +385,14 @@ } #endif +// CircuitPython specific conditionals. Using a value is better than checking +// defined because undefined variable happen when a file isn't included when it +// should have been. +#define CPY_STM32F4 0 +#define CPY_STM32F7 1 +#define CPY_STM32H7 0 + #endif /* __STM32F7xx_HAL_CONF_H */ - + /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/nucleo_h743zi_2/stm32h7xx_hal_conf.h b/ports/stm/hal_conf/stm32h7xx_hal_conf.h similarity index 84% rename from ports/stm/boards/nucleo_h743zi_2/stm32h7xx_hal_conf.h rename to ports/stm/hal_conf/stm32h7xx_hal_conf.h index e6a2dd5f80..a0328610cf 100644 --- a/ports/stm/boards/nucleo_h743zi_2/stm32h7xx_hal_conf.h +++ b/ports/stm/hal_conf/stm32h7xx_hal_conf.h @@ -15,7 +15,9 @@ * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** - */ + */ + +#include "stm32_hal_conf.h" /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32H7xx_HAL_CONF_H @@ -28,81 +30,13 @@ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - - #define HAL_ADC_MODULE_ENABLED -/* #define HAL_FDCAN_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_COMP_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -#define HAL_ETH_MODULE_ENABLED -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_OTFDEC_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -/* #define HAL_HRTIM_MODULE_ENABLED */ -/* #define HAL_HSEM_MODULE_ENABLED */ -/* #define HAL_GFXMMU_MODULE_ENABLED */ -/* #define HAL_JPEG_MODULE_ENABLED */ -/* #define HAL_OPAMP_MODULE_ENABLED */ -/* #define HAL_OSPI_MODULE_ENABLED */ -/* #define HAL_OSPI_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -/* #define HAL_SWPMI_MODULE_ENABLED */ -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_JPEG_MODULE_ENABLED */ -/* #define HAL_MDIOS_MODULE_ENABLED */ -/* #define HAL_PSSI_MODULE_ENABLED */ -/* #define HAL_DTS_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_MDMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_I2C_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_HSEM_MODULE_ENABLED - /* ########################## Oscillator Values adaptation ####################*/ /** * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). + * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz : FPGA case fixed to 60MHZ */ #endif /* HSE_VALUE */ @@ -117,16 +51,25 @@ #if !defined (CSI_VALUE) #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ #endif /* CSI_VALUE */ - + /** * @brief Internal High Speed oscillator (HSI) value. * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). + * (when HSI is used as system clock source, directly or through the PLL). */ #if !defined (HSI_VALUE) #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/ #endif /* HSI_VALUE */ +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ + /** * @brief External Low Speed oscillator (LSE) value. * This value is used by the UART, RTC HAL module to compute the system frequency @@ -141,8 +84,8 @@ /** * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. */ #if !defined (EXTERNAL_CLOCK_VALUE) #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/ @@ -154,7 +97,7 @@ /* ########################### System Configuration ######################### */ /** * @brief This is the HAL system configuration section - */ + */ #define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ #define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ #define USE_RTOS 0U @@ -220,14 +163,14 @@ /* ########################## Assert Selection ############################## */ /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the + * @brief Uncomment the line below to expanse the "assert_param" macro in the * HAL drivers code */ -/* #define USE_FULL_ASSERT 1U */ +/* #define USE_FULL_ASSERT 1U */ /* Includes ------------------------------------------------------------------*/ /** - * @brief Include module's header file + * @brief Include module's header file */ #ifdef HAL_RCC_MODULE_ENABLED @@ -373,7 +316,7 @@ #ifdef HAL_OSPI_MODULE_ENABLED #include "stm32h7xx_hal_ospi.h" #endif /* HAL_OSPI_MODULE_ENABLED */ - + #ifdef HAL_OTFDEC_MODULE_ENABLED #include "stm32h7xx_hal_otfdec.h" #endif /* HAL_OTFDEC_MODULE_ENABLED */ @@ -472,7 +415,7 @@ * @brief The assert_param macro is used for function's parameters check. * @param expr: If expr is false, it calls assert_failed function * which reports the name of the source file and the source - * line number of the call that failed. + * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ @@ -487,7 +430,14 @@ } #endif +// CircuitPython specific conditionals. Using a value is better than checking +// defined because undefined variable happen when a file isn't included when it +// should have been. +#define CPY_STM32F4 0 +#define CPY_STM32F7 0 +#define CPY_STM32H7 1 + #endif /* __STM32H7xx_HAL_CONF_H */ - + /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/mpconfigport.h b/ports/stm/mpconfigport.h index f570d32e5f..e054ffbb58 100644 --- a/ports/stm/mpconfigport.h +++ b/ports/stm/mpconfigport.h @@ -44,27 +44,6 @@ extern uint8_t _ld_default_stack_size; #include "py/circuitpy_mpconfig.h" -// The STM32 HAL file is included virtually everywhere: -#include STM32_HAL_H - -// These prevent you from accidentally omitting a python file that links mpconfigport -// and having a file accept a lack of chip family as an option. -#if defined(STM32F4) -#define CPY_STM32F4 1 -#define CPY_STM32F7 0 -#define CPY_STM32H7 0 -#elif defined(STM32F7) -#define CPY_STM32F4 0 -#define CPY_STM32F7 1 -#define CPY_STM32H7 0 -#elif defined(STM32H7) -#define CPY_STM32F4 0 -#define CPY_STM32F7 0 -#define CPY_STM32H7 1 -#else -#error undefined processor -#endif - // Board flags: #ifndef BOARD_OVERWRITE_SWD #define BOARD_OVERWRITE_SWD (0) diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 323fd76466..06dace8439 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -1,106 +1,50 @@ -# Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk -# $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers. -# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h. MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz - -# Internal math library is substantially smaller than toolchain one +LONGINT_IMPL = MPZ INTERNAL_LIBM = 1 - -# Chip supplied serial number, in bytes USB_SERIAL_NUMBER_LENGTH = 24 -# Longints can be implemented as mpz, as longlong, or not -LONGINT_IMPL = MPZ - -# Reduced feature set for early port -CIRCUITPY_MINIMAL_BUILD = 1 - -# The ifndef's allow overriding in mpconfigboard.mk. - -ifndef CIRCUITPY_BOARD -CIRCUITPY_BOARD = 1 +ifeq ($(MCU_VARIANT),STM32F405xx) + CIRCUITPY_FRAMEBUFFERIO = 1 + CIRCUITPY_RGBMATRIX = 1 endif -ifndef CIRCUITPY_DIGITALIO -CIRCUITPY_DIGITALIO = 1 +ifeq ($(MCU_SERIES),F4) + # Not yet implemented common-hal modules: + CIRCUITPY_AUDIOBUSIO = 0 + CIRCUITPY_AUDIOIO = 0 + CIRCUITPY_ROTARYIO = 0 + CIRCUITPY_RTC = 0 + CIRCUITPY_FREQUENCYIO = 0 + CIRCUITPY_I2CSLAVE = 0 + # Can be overridden on board level + ifndef CIRCUITPY_NVM + CIRCUITPY_NVM = 0 + endif endif -ifndef CIRCUITPY_ANALOGIO -CIRCUITPY_ANALOGIO = 1 -endif - -ifndef CIRCUITPY_MICROCONTROLLER -CIRCUITPY_MICROCONTROLLER = 1 -endif - -ifndef CIRCUITPY_BUSIO -CIRCUITPY_BUSIO = 1 -endif - -ifndef CIRCUITPY_PULSEIO -CIRCUITPY_PULSEIO = 1 -endif - -ifndef CIRCUITPY_OS -CIRCUITPY_OS = 1 -endif - -ifndef CIRCUITPY_STORAGE -CIRCUITPY_STORAGE = 1 -endif - -ifndef CIRCUITPY_RANDOM -CIRCUITPY_RANDOM = 1 -endif - -ifndef CRICUITPY_USB_HID -CIRCUITPY_USB_HID = 1 -endif - -ifndef CIRCUITPY_USB_MIDI -CIRCUITPY_USB_MIDI = 1 -endif - -ifndef CIRCUITPY_NEOPIXEL_WRITE -CIRCUITPY_NEOPIXEL_WRITE = 1 -endif - -ifndef CIRCUITPY_DISPLAYIO -CIRCUITPY_DISPLAYIO = 1 -endif - -CFLAGS += -DMICROPY_CPYTHON_COMPAT=1 - -CIRCUITPY_ULAB = 1 - -ifeq ($(MCU_SERIES), H7) - CIRCUITPY_BOARD = 1 - CIRCUITPY_DIGITALIO = 1 +ifeq ($(MCU_SERIES),H7) + # Not yet implemented common-hal modules: CIRCUITPY_ANALOGIO = 0 - CIRCUITPY_MICROCONTROLLER = 1 - CIRCUITPY_BUSIO = 1 - CIRCUITPY_PULSEIO = 0 - CIRCUITPY_OS = 0 - CIRCUITPY_STORAGE = 0 - CIRCUITPY_RANDOM = 0 - CIRCUITPY_USB_HID = 0 - CIRCUITPY_USB_MIDI = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_DISPLAYIO = 0 + CIRCUITPY_PULSEIO = 0 + CIRCUITPY_NVM = 0 + CIRCUITPY_AUDIOBUSIO = 0 + CIRCUITPY_AUDIOIO = 0 + CIRCUITPY_ROTARYIO = 0 + CIRCUITPY_RTC = 0 + CIRCUITPY_FREQUENCYIO = 0 + CIRCUITPY_I2CSLAVE = 0 endif -ifeq ($(MCU_SERIES), F7) - CIRCUITPY_BOARD = 1 - CIRCUITPY_DIGITALIO = 1 +ifeq ($(MCU_SERIES),F7) + # Not yet implemented common-hal modules: CIRCUITPY_ANALOGIO = 0 - CIRCUITPY_MICROCONTROLLER = 1 - CIRCUITPY_BUSIO = 1 - CIRCUITPY_PULSEIO = 0 - CIRCUITPY_OS = 0 - CIRCUITPY_STORAGE = 0 - CIRCUITPY_RANDOM = 0 - CIRCUITPY_USB_HID = 0 - CIRCUITPY_USB_MIDI = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_DISPLAYIO = 0 + CIRCUITPY_NVM = 0 + CIRCUITPY_AUDIOBUSIO = 0 + CIRCUITPY_AUDIOIO = 0 + CIRCUITPY_ROTARYIO = 0 + CIRCUITPY_RTC = 0 + CIRCUITPY_FREQUENCYIO = 0 + CIRCUITPY_I2CSLAVE = 0 endif diff --git a/ports/stm/mphalport.c b/ports/stm/mphalport.c index 3ee56e22a9..bb62b07987 100644 --- a/ports/stm/mphalport.c +++ b/ports/stm/mphalport.c @@ -34,21 +34,6 @@ #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/tick.h" -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - RUN_BACKGROUND_TASKS; - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} - void mp_hal_delay_us(mp_uint_t delay) { common_hal_mcu_delay_us(delay); } diff --git a/ports/stm/packages/TFBGA216.c b/ports/stm/packages/TFBGA216.c new file mode 100644 index 0000000000..af91e70ae4 --- /dev/null +++ b/ports/stm/packages/TFBGA216.c @@ -0,0 +1,231 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Mark Olsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/microcontroller/__init__.h" +#include "common-hal/microcontroller/Pin.h" +#include "py/obj.h" + +STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { +// Row A + { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, + { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_PG14), MP_ROM_PTR(&pin_PG14) }, + { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, + { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, + { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) }, + { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + +// Row B + { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, + { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, + { MP_ROM_QSTR(MP_QSTR_PG13), MP_ROM_PTR(&pin_PG13) }, + { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PG15), MP_ROM_PTR(&pin_PG15) }, + { MP_ROM_QSTR(MP_QSTR_PG11), MP_ROM_PTR(&pin_PG11) }, + { MP_ROM_QSTR(MP_QSTR_PJ13), MP_ROM_PTR(&pin_PJ13) }, + { MP_ROM_QSTR(MP_QSTR_PJ12), MP_ROM_PTR(&pin_PJ12) }, + { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, + { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_PA12) }, + +// Row C + { MP_ROM_QSTR(MP_QSTR_PI08), MP_ROM_PTR(&pin_PI08) }, + { MP_ROM_QSTR(MP_QSTR_PI04), MP_ROM_PTR(&pin_PI04) }, + { MP_ROM_QSTR(MP_QSTR_PK07), MP_ROM_PTR(&pin_PK07) }, + { MP_ROM_QSTR(MP_QSTR_PK06), MP_ROM_PTR(&pin_PK06) }, + { MP_ROM_QSTR(MP_QSTR_PK05), MP_ROM_PTR(&pin_PK05) }, + { MP_ROM_QSTR(MP_QSTR_PG12), MP_ROM_PTR(&pin_PG12) }, + { MP_ROM_QSTR(MP_QSTR_PG10), MP_ROM_PTR(&pin_PG10) }, + { MP_ROM_QSTR(MP_QSTR_PJ14), MP_ROM_PTR(&pin_PJ14) }, + { MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) }, + { MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) }, + { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, + { MP_ROM_QSTR(MP_QSTR_PI03), MP_ROM_PTR(&pin_PI03) }, + { MP_ROM_QSTR(MP_QSTR_PI02), MP_ROM_PTR(&pin_PI02) }, + { MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_PA11) }, + +// Row D + { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_PF00), MP_ROM_PTR(&pin_PF00) }, + { MP_ROM_QSTR(MP_QSTR_PI05), MP_ROM_PTR(&pin_PI05) }, + { MP_ROM_QSTR(MP_QSTR_PI07), MP_ROM_PTR(&pin_PI07) }, + { MP_ROM_QSTR(MP_QSTR_PI10), MP_ROM_PTR(&pin_PI10) }, + { MP_ROM_QSTR(MP_QSTR_PI06), MP_ROM_PTR(&pin_PI06) }, + { MP_ROM_QSTR(MP_QSTR_PK04), MP_ROM_PTR(&pin_PK04) }, + { MP_ROM_QSTR(MP_QSTR_PK03), MP_ROM_PTR(&pin_PK03) }, + { MP_ROM_QSTR(MP_QSTR_PG09), MP_ROM_PTR(&pin_PG09) }, + { MP_ROM_QSTR(MP_QSTR_PJ15), MP_ROM_PTR(&pin_PJ15) }, + { MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) }, + { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_PH15), MP_ROM_PTR(&pin_PH15) }, + { MP_ROM_QSTR(MP_QSTR_PI01), MP_ROM_PTR(&pin_PI01) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + +// Row E + // { MP_ROM_QSTR(MP_QSTR_PC14), MP_ROM_PTR(&pin_PC14) }, // OSC32_IN + { MP_ROM_QSTR(MP_QSTR_PF01), MP_ROM_PTR(&pin_PF01) }, + { MP_ROM_QSTR(MP_QSTR_PI12), MP_ROM_PTR(&pin_PI12) }, + { MP_ROM_QSTR(MP_QSTR_PI09), MP_ROM_PTR(&pin_PI09) }, + { MP_ROM_QSTR(MP_QSTR_PH13), MP_ROM_PTR(&pin_PH13) }, + { MP_ROM_QSTR(MP_QSTR_PH14), MP_ROM_PTR(&pin_PH14) }, + { MP_ROM_QSTR(MP_QSTR_PI00), MP_ROM_PTR(&pin_PI00) }, + { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, + +// Row F + // { MP_ROM_QSTR(MP_QSTR_PC15), MP_ROM_PTR(&pin_PC15) }, // OSC32_OUT + { MP_ROM_QSTR(MP_QSTR_PK01), MP_ROM_PTR(&pin_PK01) }, + { MP_ROM_QSTR(MP_QSTR_PK02), MP_ROM_PTR(&pin_PK02) }, + { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, + +// Row G + // { MP_ROM_QSTR(MP_QSTR_PH00), MP_ROM_PTR(&pin_PH00) }, // OSC_IN + { MP_ROM_QSTR(MP_QSTR_PF02), MP_ROM_PTR(&pin_PF02) }, + { MP_ROM_QSTR(MP_QSTR_PI13), MP_ROM_PTR(&pin_PI13) }, + { MP_ROM_QSTR(MP_QSTR_PI15), MP_ROM_PTR(&pin_PI15) }, + { MP_ROM_QSTR(MP_QSTR_PJ11), MP_ROM_PTR(&pin_PJ11) }, + { MP_ROM_QSTR(MP_QSTR_PK00), MP_ROM_PTR(&pin_PK00) }, + { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, + { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + +// Row H + // { MP_ROM_QSTR(MP_QSTR_PH01), MP_ROM_PTR(&pin_PH01) }, // OSC_OUT + { MP_ROM_QSTR(MP_QSTR_PF03), MP_ROM_PTR(&pin_PF03) }, + { MP_ROM_QSTR(MP_QSTR_PI14), MP_ROM_PTR(&pin_PI14) }, + { MP_ROM_QSTR(MP_QSTR_PH04), MP_ROM_PTR(&pin_PH04) }, + { MP_ROM_QSTR(MP_QSTR_PJ08), MP_ROM_PTR(&pin_PJ08) }, + { MP_ROM_QSTR(MP_QSTR_PJ10), MP_ROM_PTR(&pin_PJ10) }, + { MP_ROM_QSTR(MP_QSTR_PG08), MP_ROM_PTR(&pin_PG08) }, + { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + +// Row J + { MP_ROM_QSTR(MP_QSTR_PF04), MP_ROM_PTR(&pin_PF04) }, + { MP_ROM_QSTR(MP_QSTR_PH05), MP_ROM_PTR(&pin_PH05) }, + { MP_ROM_QSTR(MP_QSTR_PH03), MP_ROM_PTR(&pin_PH03) }, + { MP_ROM_QSTR(MP_QSTR_PJ07), MP_ROM_PTR(&pin_PJ07) }, + { MP_ROM_QSTR(MP_QSTR_PJ09), MP_ROM_PTR(&pin_PJ09) }, + { MP_ROM_QSTR(MP_QSTR_PG07), MP_ROM_PTR(&pin_PG07) }, + { MP_ROM_QSTR(MP_QSTR_PG06), MP_ROM_PTR(&pin_PG06) }, + +// Row K + { MP_ROM_QSTR(MP_QSTR_PF07), MP_ROM_PTR(&pin_PF07) }, + { MP_ROM_QSTR(MP_QSTR_PF06), MP_ROM_PTR(&pin_PF06) }, + { MP_ROM_QSTR(MP_QSTR_PF05), MP_ROM_PTR(&pin_PF05) }, + { MP_ROM_QSTR(MP_QSTR_PH02), MP_ROM_PTR(&pin_PH02) }, + { MP_ROM_QSTR(MP_QSTR_PJ06), MP_ROM_PTR(&pin_PJ06) }, + { MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) }, + { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, + +// Row L + { MP_ROM_QSTR(MP_QSTR_PF10), MP_ROM_PTR(&pin_PF10) }, + { MP_ROM_QSTR(MP_QSTR_PF09), MP_ROM_PTR(&pin_PF09) }, + { MP_ROM_QSTR(MP_QSTR_PF08), MP_ROM_PTR(&pin_PF08) }, + { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, + { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, + +// Row M + { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_PF12), MP_ROM_PTR(&pin_PF12) }, + { MP_ROM_QSTR(MP_QSTR_PG01), MP_ROM_PTR(&pin_PG01) }, + { MP_ROM_QSTR(MP_QSTR_PF15), MP_ROM_PTR(&pin_PF15) }, + { MP_ROM_QSTR(MP_QSTR_PJ04), MP_ROM_PTR(&pin_PJ04) }, + { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_PG03), MP_ROM_PTR(&pin_PG03) }, + { MP_ROM_QSTR(MP_QSTR_PG02), MP_ROM_PTR(&pin_PG02) }, + { MP_ROM_QSTR(MP_QSTR_PJ05), MP_ROM_PTR(&pin_PJ05) }, + { MP_ROM_QSTR(MP_QSTR_PH12), MP_ROM_PTR(&pin_PH12) }, + +// Row N + { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_PF13), MP_ROM_PTR(&pin_PF13) }, + { MP_ROM_QSTR(MP_QSTR_PG00), MP_ROM_PTR(&pin_PG00) }, + { MP_ROM_QSTR(MP_QSTR_PJ03), MP_ROM_PTR(&pin_PJ03) }, + { MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) }, + { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, + { MP_ROM_QSTR(MP_QSTR_PG05), MP_ROM_PTR(&pin_PG05) }, + { MP_ROM_QSTR(MP_QSTR_PG04), MP_ROM_PTR(&pin_PG04) }, + { MP_ROM_QSTR(MP_QSTR_PH07), MP_ROM_PTR(&pin_PH07) }, + { MP_ROM_QSTR(MP_QSTR_PH09), MP_ROM_PTR(&pin_PH09) }, + { MP_ROM_QSTR(MP_QSTR_PH11), MP_ROM_PTR(&pin_PH11) }, + +// Row P + { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_PF14), MP_ROM_PTR(&pin_PF14) }, + { MP_ROM_QSTR(MP_QSTR_PJ02), MP_ROM_PTR(&pin_PJ02) }, + { MP_ROM_QSTR(MP_QSTR_PF11), MP_ROM_PTR(&pin_PF11) }, + { MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) }, + { MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) }, + { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, + { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_PH06), MP_ROM_PTR(&pin_PH06) }, + { MP_ROM_QSTR(MP_QSTR_PH08), MP_ROM_PTR(&pin_PH08) }, + { MP_ROM_QSTR(MP_QSTR_PH10), MP_ROM_PTR(&pin_PH10) }, + +// Row R + { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_PJ00), MP_ROM_PTR(&pin_PJ00) }, + { MP_ROM_QSTR(MP_QSTR_PJ01), MP_ROM_PTR(&pin_PJ01) }, + { MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) }, + { MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) }, + { MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) }, + { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, + { MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) }, + { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + +}; +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/peripherals/periph.h b/ports/stm/peripherals/periph.h index 209d35ee95..316dbbec5c 100644 --- a/ports/stm/peripherals/periph.h +++ b/ports/stm/peripherals/periph.h @@ -107,6 +107,13 @@ typedef struct { // F7 Series +#ifdef STM32F746xx +#define HAS_DAC 0 +#define HAS_TRNG 0 +#define HAS_BASIC_TIM 0 +#include "stm32f7/stm32f746xx/periph.h" +#endif + #ifdef STM32F767xx #define HAS_DAC 0 #define HAS_TRNG 0 diff --git a/ports/stm/peripherals/pins.h b/ports/stm/peripherals/pins.h index 628e09695a..8f06d012ec 100644 --- a/ports/stm/peripherals/pins.h +++ b/ports/stm/peripherals/pins.h @@ -93,6 +93,9 @@ extern const mp_obj_type_t mcu_pin_type; #endif // F7 Series +#ifdef STM32F746xx +#include "stm32f7/stm32f746xx/pins.h" +#endif #ifdef STM32F767xx #include "stm32f7/stm32f767xx/pins.h" #endif diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c index d048d60e85..194992e819 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c @@ -25,7 +25,7 @@ * THE SOFTWARE. */ -#include "py/mpconfig.h" +#include "stm32f4xx_hal.h" void stm32_peripherals_clocks_init(void) { //System clock init diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c index 5f4fd2783d..f4c5830686 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c @@ -25,7 +25,7 @@ * THE SOFTWARE. */ -#include "py/mpconfig.h" +#include "stm32f4xx_hal.h" void stm32_peripherals_clocks_init(void) { //System clock init @@ -56,7 +56,9 @@ void stm32_peripherals_clocks_init(void) { RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + // APB1 must always be on so that we can talk to the RTC for timing. RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + // TODO: Only turn on APB2 when it is needed to save power. RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); } diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c index 5f4fd2783d..a545aaec56 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c @@ -25,7 +25,7 @@ * THE SOFTWARE. */ -#include "py/mpconfig.h" +#include "stm32f4xx_hal.h" void stm32_peripherals_clocks_init(void) { //System clock init diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c index d048d60e85..194992e819 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c @@ -25,7 +25,7 @@ * THE SOFTWARE. */ -#include "py/mpconfig.h" +#include "stm32f4xx_hal.h" void stm32_peripherals_clocks_init(void) { //System clock init diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c b/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c index 201a90e347..9aabffa9f6 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c @@ -25,7 +25,7 @@ */ #include "peripherals/gpio.h" -#include "py/mpconfig.h" +#include "stm32f4xx_hal.h" #include "common-hal/microcontroller/Pin.h" void stm32_peripherals_gpio_init(void) { @@ -38,16 +38,18 @@ void stm32_peripherals_gpio_init(void) { __HAL_RCC_GPIOD_CLK_ENABLE(); //Never reset pins + // TODO: Move this out of peripherals. These helpers shouldn't reference anything CircuitPython + // specific. never_reset_pin_number(2,14); //PC14 OSC32_IN never_reset_pin_number(2,15); //PC15 OSC32_OUT - #if !(BOARD_OVERWRITE_SWD) + #if !(BOARD_OVERWRITE_SWD) never_reset_pin_number(0,13); //PA13 SWDIO never_reset_pin_number(0,14); //PA14 SWCLK #endif // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,0); //PH0 JTDO // never_reset_pin_number(5,1); //PH1 JTRST } diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c index ad45abed22..6c4cb5b322 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c @@ -25,7 +25,7 @@ * THE SOFTWARE. */ -#include "py/mpconfig.h" +#include "stm32f4xx_hal.h" void stm32_peripherals_clocks_init(void) { //System clock init @@ -65,7 +65,7 @@ void stm32_peripherals_clocks_init(void) { /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 * clocks dividers */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | - RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c new file mode 100644 index 0000000000..2afa2e377a --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c @@ -0,0 +1,96 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include STM32_HAL_H + +#ifndef BOARD_OSC_DIV +#define BOARD_OSC_DIV (8) +#endif +#ifndef BOARD_OSC_PLLN +#define BOARD_OSC_PLLN (432) +#endif +#ifndef BOARD_OSC_PLLQ +#define BOARD_OSC_PLLQ (9) +#endif +#ifndef BOARD_FLASH_LATENCY +#define BOARD_FLASH_LATENCY FLASH_LATENCY_7 +#endif +#ifndef BOARD_OSC_HSESTATE +#define BOARD_OSC_HSESTATE RCC_HSE_BYPASS +#endif + +void stm32_peripherals_clocks_init(void) { + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + + /* Enable Power Control clock */ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = BOARD_OSC_HSESTATE; + RCC_OscInitStruct.HSIState = RCC_HSI_OFF; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; + RCC_OscInitStruct.PLL.PLLN = BOARD_OSC_PLLN; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = BOARD_OSC_PLLQ; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + /* Activate the OverDrive to reach the 216 MHz Frequency */ + HAL_PWREx_EnableOverDrive(); + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; + + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, BOARD_FLASH_LATENCY); + + #ifdef STM32F746G_DISCO + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; + + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48; + PeriphClkInitStruct.PLLSAI.PLLSAIN = 192; + PeriphClkInitStruct.PLLSAI.PLLSAIR = 2; + PeriphClkInitStruct.PLLSAI.PLLSAIQ = 2; + PeriphClkInitStruct.PLLSAI.PLLSAIP = RCC_PLLSAIP_DIV4; + PeriphClkInitStruct.PLLSAIDivQ = 1; + PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2; + PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48SOURCE_PLLSAIP; + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + #endif +} diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c b/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c new file mode 100644 index 0000000000..cee4b4f457 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c @@ -0,0 +1,53 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "gpio.h" +#include "common-hal/microcontroller/Pin.h" + +void stm32_peripherals_gpio_init(void) { + //Enable all GPIO for now + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); + __HAL_RCC_GPIOG_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOI_CLK_ENABLE(); + __HAL_RCC_GPIOJ_CLK_ENABLE(); + __HAL_RCC_GPIOK_CLK_ENABLE(); + + //Never reset pins + never_reset_pin_number(2,14); //PC14 OSC32_IN + never_reset_pin_number(2,15); //PC15 OSC32_OUT + never_reset_pin_number(0,13); //PA13 SWDIO + never_reset_pin_number(0,14); //PA14 SWCLK + never_reset_pin_number(7,0); //PH0 OSC_IN + never_reset_pin_number(7,1); //PH1 OSC_OUT +} + diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/periph.c b/ports/stm/peripherals/stm32f7/stm32f746xx/periph.c new file mode 100644 index 0000000000..0c33912398 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/periph.c @@ -0,0 +1,215 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "peripherals/pins.h" +#include "peripherals/periph.h" + +// I2C + +I2C_TypeDef * mcu_i2c_banks[4] = {I2C1, I2C2, I2C3, I2C4}; + +const mcu_periph_obj_t mcu_i2c_sda_list[10] = { + PERIPH(1, 4, &pin_PB07), + PERIPH(1, 4, &pin_PB09), + PERIPH(2, 4, &pin_PB11), + PERIPH(3, 4, &pin_PC09), + PERIPH(4, 4, &pin_PD13), + PERIPH(2, 4, &pin_PF00), + PERIPH(4, 4, &pin_PF15), + PERIPH(2, 4, &pin_PH05), + PERIPH(3, 4, &pin_PH08), + PERIPH(4, 4, &pin_PH12), +}; +const mcu_periph_obj_t mcu_i2c_scl_list[10] = { + PERIPH(3, 4, &pin_PA08), + PERIPH(1, 4, &pin_PB06), + PERIPH(1, 4, &pin_PB08), + PERIPH(2, 4, &pin_PB10), + PERIPH(4, 4, &pin_PD12), + PERIPH(2, 4, &pin_PF01), + PERIPH(4, 4, &pin_PF14), + PERIPH(2, 4, &pin_PH04), + PERIPH(3, 4, &pin_PH07), + PERIPH(4, 4, &pin_PH11), +}; + +//SPI + +SPI_TypeDef * mcu_spi_banks[6] = {SPI1, SPI2, SPI3, SPI4, SPI5, SPI6}; + +const mcu_periph_obj_t mcu_spi_sck_list[14] = { + PERIPH(1, 5, &pin_PA05), + PERIPH(2, 5, &pin_PA09), + PERIPH(1, 5, &pin_PB03), + PERIPH(3, 6, &pin_PB03), + PERIPH(2, 5, &pin_PB10), + PERIPH(2, 5, &pin_PB13), + PERIPH(3, 6, &pin_PC10), + PERIPH(2, 5, &pin_PD03), + PERIPH(4, 5, &pin_PE02), + PERIPH(4, 5, &pin_PE12), + PERIPH(5, 5, &pin_PF07), + PERIPH(6, 5, &pin_PG13), + PERIPH(5, 5, &pin_PH06), + PERIPH(2, 5, &pin_PI01), +}; +const mcu_periph_obj_t mcu_spi_mosi_list[15] = { + PERIPH(1, 5, &pin_PA07), + PERIPH(3, 7, &pin_PB02), + PERIPH(1, 5, &pin_PB05), + PERIPH(3, 6, &pin_PB05), + PERIPH(2, 5, &pin_PB15), + PERIPH(2, 5, &pin_PC01), + PERIPH(2, 5, &pin_PC03), + PERIPH(3, 6, &pin_PC12), + PERIPH(3, 5, &pin_PD06), + PERIPH(4, 5, &pin_PE06), + PERIPH(4, 5, &pin_PE14), + PERIPH(5, 5, &pin_PF09), + PERIPH(5, 5, &pin_PF11), + PERIPH(6, 5, &pin_PG14), + PERIPH(2, 5, &pin_PI03), +}; +const mcu_periph_obj_t mcu_spi_miso_list[12] = { + PERIPH(1, 5, &pin_PA06), + PERIPH(1, 5, &pin_PB04), + PERIPH(3, 6, &pin_PB04), + PERIPH(2, 5, &pin_PB14), + PERIPH(2, 5, &pin_PC02), + PERIPH(3, 6, &pin_PC11), + PERIPH(4, 5, &pin_PE05), + PERIPH(4, 5, &pin_PE13), + PERIPH(5, 5, &pin_PF08), + PERIPH(6, 5, &pin_PG12), + PERIPH(5, 5, &pin_PH07), + PERIPH(2, 5, &pin_PI02), +}; + +//UART + +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6, UART7, UART8}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, true, true, true, true, true, true}; + +const mcu_periph_obj_t mcu_uart_tx_list[15] = { + PERIPH(4, 8, &pin_PA00), + PERIPH(2, 7, &pin_PA02), + PERIPH(1, 7, &pin_PA09), + PERIPH(1, 7, &pin_PB06), + PERIPH(3, 7, &pin_PB10), + PERIPH(6, 8, &pin_PC06), + PERIPH(3, 7, &pin_PC10), + PERIPH(4, 8, &pin_PC10), + PERIPH(5, 8, &pin_PC12), + PERIPH(2, 7, &pin_PD05), + PERIPH(3, 7, &pin_PD08), + PERIPH(8, 8, &pin_PE01), + PERIPH(7, 8, &pin_PE08), + PERIPH(7, 8, &pin_PF07), + PERIPH(6, 8, &pin_PG14), +}; +const mcu_periph_obj_t mcu_uart_rx_list[15] = { + PERIPH(4, 8, &pin_PA01), + PERIPH(2, 7, &pin_PA03), + PERIPH(1, 7, &pin_PA10), + PERIPH(1, 7, &pin_PB07), + PERIPH(3, 7, &pin_PB11), + PERIPH(6, 8, &pin_PC07), + PERIPH(3, 7, &pin_PC11), + PERIPH(4, 8, &pin_PC11), + PERIPH(5, 8, &pin_PD02), + PERIPH(2, 7, &pin_PD06), + PERIPH(3, 7, &pin_PD09), + PERIPH(8, 8, &pin_PE00), + PERIPH(7, 8, &pin_PE07), + PERIPH(7, 8, &pin_PF06), + PERIPH(6, 8, &pin_PG09), +}; + +//Timers +//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins +TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10, + TIM11, TIM12, TIM13, TIM14}; + +const mcu_tim_pin_obj_t mcu_tim_pin_list[55] = { + TIM(2, 1, 1, &pin_PA00), + TIM(5, 2, 1, &pin_PA00), + TIM(2, 1, 2, &pin_PA01), + TIM(5, 2, 2, &pin_PA01), + TIM(2, 1, 3, &pin_PA02), + TIM(5, 2, 3, &pin_PA02), + TIM(9, 3, 1, &pin_PA02), + TIM(2, 1, 4, &pin_PA03), + TIM(5, 2, 4, &pin_PA03), + TIM(9, 3, 2, &pin_PA03), + TIM(2, 1, 1, &pin_PA05), + TIM(3, 2, 1, &pin_PA06), + TIM(3, 2, 2, &pin_PA07), + TIM(1, 1, 1, &pin_PA08), + TIM(1, 1, 2, &pin_PA09), + TIM(1, 1, 3, &pin_PA10), + TIM(1, 1, 4, &pin_PA11), + TIM(2, 1, 1, &pin_PA15), + TIM(3, 2, 3, &pin_PB00), + TIM(3, 2, 4, &pin_PB01), + TIM(2, 1, 2, &pin_PB03), + TIM(3, 2, 1, &pin_PB04), + TIM(3, 2, 2, &pin_PB05), + TIM(4, 2, 1, &pin_PB06), + TIM(4, 2, 2, &pin_PB07), + TIM(4, 2, 3, &pin_PB08), + TIM(4, 2, 4, &pin_PB09), + TIM(2, 1, 3, &pin_PB10), + TIM(2, 1, 4, &pin_PB11), + TIM(3, 2, 1, &pin_PC06), + TIM(8, 3, 1, &pin_PC06), + TIM(3, 2, 2, &pin_PC07), + TIM(8, 3, 2, &pin_PC07), + TIM(3, 2, 3, &pin_PC08), + TIM(8, 3, 3, &pin_PC08), + TIM(3, 2, 4, &pin_PC09), + TIM(8, 3, 4, &pin_PC09), + TIM(4, 2, 1, &pin_PD12), + TIM(4, 2, 2, &pin_PD13), + TIM(4, 2, 3, &pin_PD14), + TIM(4, 2, 4, &pin_PD15), + TIM(9, 3, 1, &pin_PE05), + TIM(9, 3, 2, &pin_PE06), + TIM(1, 1, 1, &pin_PE09), + TIM(1, 1, 2, &pin_PE11), + TIM(1, 1, 3, &pin_PE13), + TIM(1, 1, 4, &pin_PE14), + TIM(5, 2, 1, &pin_PH10), + TIM(5, 2, 2, &pin_PH11), + TIM(5, 2, 3, &pin_PH12), + TIM(5, 2, 4, &pin_PI00), + TIM(8, 3, 4, &pin_PI02), + TIM(8, 3, 1, &pin_PI05), + TIM(8, 3, 2, &pin_PI06), + TIM(8, 3, 3, &pin_PI07), +}; diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/periph.h b/ports/stm/peripherals/stm32f7/stm32f746xx/periph.h new file mode 100644 index 0000000000..26f4ad2b54 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/periph.h @@ -0,0 +1,58 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PERIPH_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PERIPH_H + +//I2C +extern I2C_TypeDef * mcu_i2c_banks[4]; + +const mcu_periph_obj_t mcu_i2c_sda_list[10]; +const mcu_periph_obj_t mcu_i2c_scl_list[10]; + +//SPI +extern SPI_TypeDef * mcu_spi_banks[6]; + +const mcu_periph_obj_t mcu_spi_sck_list[14]; +const mcu_periph_obj_t mcu_spi_mosi_list[15]; +const mcu_periph_obj_t mcu_spi_miso_list[12]; + +//UART +extern USART_TypeDef * mcu_uart_banks[MAX_UART]; +extern bool mcu_uart_has_usart[MAX_UART]; + +const mcu_periph_obj_t mcu_uart_tx_list[15]; +const mcu_periph_obj_t mcu_uart_rx_list[15]; + +//Timers +#define TIM_BANK_ARRAY_LEN 14 +#define TIM_PIN_ARRAY_LEN 55 +extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; + +const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; + +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c b/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c new file mode 100644 index 0000000000..895ad5ec0d --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c @@ -0,0 +1,208 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "peripherals/pins.h" + +// Todo: some pins do have ADCs, but the module isn't set up yet. + +const mcu_pin_obj_t pin_PA00 = PIN(0, 0, NO_ADC); +const mcu_pin_obj_t pin_PA01 = PIN(0, 1, NO_ADC); +const mcu_pin_obj_t pin_PA02 = PIN(0, 2, NO_ADC); +const mcu_pin_obj_t pin_PA03 = PIN(0, 3, NO_ADC); +const mcu_pin_obj_t pin_PA04 = PIN(0, 4, NO_ADC); +const mcu_pin_obj_t pin_PA05 = PIN(0, 5, NO_ADC); +const mcu_pin_obj_t pin_PA06 = PIN(0, 6, NO_ADC); +const mcu_pin_obj_t pin_PA07 = PIN(0, 7, NO_ADC); +const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); +const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); +const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); +const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); +const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); +const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); +const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); +const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); +const mcu_pin_obj_t pin_PB00 = PIN(1, 0, NO_ADC); +const mcu_pin_obj_t pin_PB01 = PIN(1, 1, NO_ADC); +const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); +const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); +const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); +const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); +const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); +const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); +const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); +const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); +const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); +const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); +const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); +const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); +const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); +const mcu_pin_obj_t pin_PC00 = PIN(2, 0, NO_ADC); +const mcu_pin_obj_t pin_PC01 = PIN(2, 1, NO_ADC); +const mcu_pin_obj_t pin_PC02 = PIN(2, 2, NO_ADC); +const mcu_pin_obj_t pin_PC03 = PIN(2, 3, NO_ADC); +const mcu_pin_obj_t pin_PC04 = PIN(2, 4, NO_ADC); +const mcu_pin_obj_t pin_PC05 = PIN(2, 5, NO_ADC); +const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); +const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); +const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); +const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); +const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); +const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); +const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); +const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); +const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); +const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); +const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); +const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); +const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); +const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); +const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); +const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); +const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); +const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); +const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); +const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); +const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); +const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); +const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); +const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); +const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); +const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); +const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); +const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); +const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); +const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); +const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); +const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); +const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); +const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); +const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); +const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); +const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); +const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); +const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); +const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); +const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); +const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); +const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); +const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); +const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); +const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); +const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); +const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); +const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); +const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); +const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); +const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); +const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); +const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); +const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); +const mcu_pin_obj_t pin_PH00 = PIN(7, 0, NO_ADC); +const mcu_pin_obj_t pin_PH01 = PIN(7, 1, NO_ADC); +const mcu_pin_obj_t pin_PH02 = PIN(7, 2, NO_ADC); +const mcu_pin_obj_t pin_PH03 = PIN(7, 3, NO_ADC); +const mcu_pin_obj_t pin_PH04 = PIN(7, 4, NO_ADC); +const mcu_pin_obj_t pin_PH05 = PIN(7, 5, NO_ADC); +const mcu_pin_obj_t pin_PH06 = PIN(7, 6, NO_ADC); +const mcu_pin_obj_t pin_PH07 = PIN(7, 7, NO_ADC); +const mcu_pin_obj_t pin_PH08 = PIN(7, 8, NO_ADC); +const mcu_pin_obj_t pin_PH09 = PIN(7, 9, NO_ADC); +const mcu_pin_obj_t pin_PH10 = PIN(7, 10, NO_ADC); +const mcu_pin_obj_t pin_PH11 = PIN(7, 11, NO_ADC); +const mcu_pin_obj_t pin_PH12 = PIN(7, 12, NO_ADC); +const mcu_pin_obj_t pin_PH13 = PIN(7, 13, NO_ADC); +const mcu_pin_obj_t pin_PH14 = PIN(7, 14, NO_ADC); +const mcu_pin_obj_t pin_PH15 = PIN(7, 15, NO_ADC); +const mcu_pin_obj_t pin_PI00 = PIN(8, 0, NO_ADC); +const mcu_pin_obj_t pin_PI01 = PIN(8, 1, NO_ADC); +const mcu_pin_obj_t pin_PI02 = PIN(8, 2, NO_ADC); +const mcu_pin_obj_t pin_PI03 = PIN(8, 3, NO_ADC); +const mcu_pin_obj_t pin_PI04 = PIN(8, 4, NO_ADC); +const mcu_pin_obj_t pin_PI05 = PIN(8, 5, NO_ADC); +const mcu_pin_obj_t pin_PI06 = PIN(8, 6, NO_ADC); +const mcu_pin_obj_t pin_PI07 = PIN(8, 7, NO_ADC); +const mcu_pin_obj_t pin_PI08 = PIN(8, 8, NO_ADC); +const mcu_pin_obj_t pin_PI09 = PIN(8, 9, NO_ADC); +const mcu_pin_obj_t pin_PI10 = PIN(8, 10, NO_ADC); +const mcu_pin_obj_t pin_PI11 = PIN(8, 11, NO_ADC); +const mcu_pin_obj_t pin_PI12 = PIN(8, 12, NO_ADC); +const mcu_pin_obj_t pin_PI13 = PIN(8, 13, NO_ADC); +const mcu_pin_obj_t pin_PI14 = PIN(8, 14, NO_ADC); +const mcu_pin_obj_t pin_PI15 = PIN(8, 15, NO_ADC); +const mcu_pin_obj_t pin_PJ00 = PIN(9, 0, NO_ADC); +const mcu_pin_obj_t pin_PJ01 = PIN(9, 1, NO_ADC); +const mcu_pin_obj_t pin_PJ02 = PIN(9, 2, NO_ADC); +const mcu_pin_obj_t pin_PJ03 = PIN(9, 3, NO_ADC); +const mcu_pin_obj_t pin_PJ04 = PIN(9, 4, NO_ADC); +const mcu_pin_obj_t pin_PJ05 = PIN(9, 5, NO_ADC); +const mcu_pin_obj_t pin_PJ06 = PIN(9, 6, NO_ADC); +const mcu_pin_obj_t pin_PJ07 = PIN(9, 7, NO_ADC); +const mcu_pin_obj_t pin_PJ08 = PIN(9, 8, NO_ADC); +const mcu_pin_obj_t pin_PJ09 = PIN(9, 9, NO_ADC); +const mcu_pin_obj_t pin_PJ10 = PIN(9, 10, NO_ADC); +const mcu_pin_obj_t pin_PJ11 = PIN(9, 11, NO_ADC); +const mcu_pin_obj_t pin_PJ12 = PIN(9, 12, NO_ADC); +const mcu_pin_obj_t pin_PJ13 = PIN(9, 13, NO_ADC); +const mcu_pin_obj_t pin_PJ14 = PIN(9, 14, NO_ADC); +const mcu_pin_obj_t pin_PJ15 = PIN(9, 15, NO_ADC); +const mcu_pin_obj_t pin_PK00 = PIN(10, 0, NO_ADC); +const mcu_pin_obj_t pin_PK01 = PIN(10, 1, NO_ADC); +const mcu_pin_obj_t pin_PK02 = PIN(10, 2, NO_ADC); +const mcu_pin_obj_t pin_PK03 = PIN(10, 3, NO_ADC); +const mcu_pin_obj_t pin_PK04 = PIN(10, 4, NO_ADC); +const mcu_pin_obj_t pin_PK05 = PIN(10, 5, NO_ADC); +const mcu_pin_obj_t pin_PK06 = PIN(10, 6, NO_ADC); +const mcu_pin_obj_t pin_PK07 = PIN(10, 7, NO_ADC); +const mcu_pin_obj_t pin_PK08 = PIN(10, 8, NO_ADC); +const mcu_pin_obj_t pin_PK09 = PIN(10, 9, NO_ADC); +const mcu_pin_obj_t pin_PK10 = PIN(10, 10, NO_ADC); +const mcu_pin_obj_t pin_PK11 = PIN(10, 11, NO_ADC); +const mcu_pin_obj_t pin_PK12 = PIN(10, 12, NO_ADC); +const mcu_pin_obj_t pin_PK13 = PIN(10, 13, NO_ADC); +const mcu_pin_obj_t pin_PK14 = PIN(10, 14, NO_ADC); +const mcu_pin_obj_t pin_PK15 = PIN(10, 15, NO_ADC); diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/pins.h b/ports/stm/peripherals/stm32f7/stm32f746xx/pins.h new file mode 100644 index 0000000000..3b6f9a15a4 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/pins.h @@ -0,0 +1,207 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PINS_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PINS_H + +extern const mcu_pin_obj_t pin_PA00; +extern const mcu_pin_obj_t pin_PA01; +extern const mcu_pin_obj_t pin_PA02; +extern const mcu_pin_obj_t pin_PA03; +extern const mcu_pin_obj_t pin_PA04; +extern const mcu_pin_obj_t pin_PA05; +extern const mcu_pin_obj_t pin_PA06; +extern const mcu_pin_obj_t pin_PA07; +extern const mcu_pin_obj_t pin_PA08; +extern const mcu_pin_obj_t pin_PA09; +extern const mcu_pin_obj_t pin_PA10; +extern const mcu_pin_obj_t pin_PA11; +extern const mcu_pin_obj_t pin_PA12; +extern const mcu_pin_obj_t pin_PA13; +extern const mcu_pin_obj_t pin_PA14; +extern const mcu_pin_obj_t pin_PA15; +extern const mcu_pin_obj_t pin_PB00; +extern const mcu_pin_obj_t pin_PB01; +extern const mcu_pin_obj_t pin_PB02; +extern const mcu_pin_obj_t pin_PB03; +extern const mcu_pin_obj_t pin_PB04; +extern const mcu_pin_obj_t pin_PB05; +extern const mcu_pin_obj_t pin_PB06; +extern const mcu_pin_obj_t pin_PB07; +extern const mcu_pin_obj_t pin_PB08; +extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PB10; +extern const mcu_pin_obj_t pin_PB11; +extern const mcu_pin_obj_t pin_PB12; +extern const mcu_pin_obj_t pin_PB13; +extern const mcu_pin_obj_t pin_PB14; +extern const mcu_pin_obj_t pin_PB15; +extern const mcu_pin_obj_t pin_PC00; +extern const mcu_pin_obj_t pin_PC01; +extern const mcu_pin_obj_t pin_PC02; +extern const mcu_pin_obj_t pin_PC03; +extern const mcu_pin_obj_t pin_PC04; +extern const mcu_pin_obj_t pin_PC05; +extern const mcu_pin_obj_t pin_PC06; +extern const mcu_pin_obj_t pin_PC07; +extern const mcu_pin_obj_t pin_PC08; +extern const mcu_pin_obj_t pin_PC09; +extern const mcu_pin_obj_t pin_PC10; +extern const mcu_pin_obj_t pin_PC11; +extern const mcu_pin_obj_t pin_PC12; +extern const mcu_pin_obj_t pin_PC13; +extern const mcu_pin_obj_t pin_PC14; +extern const mcu_pin_obj_t pin_PC15; +extern const mcu_pin_obj_t pin_PD00; +extern const mcu_pin_obj_t pin_PD01; +extern const mcu_pin_obj_t pin_PD02; +extern const mcu_pin_obj_t pin_PD03; +extern const mcu_pin_obj_t pin_PD04; +extern const mcu_pin_obj_t pin_PD05; +extern const mcu_pin_obj_t pin_PD06; +extern const mcu_pin_obj_t pin_PD07; +extern const mcu_pin_obj_t pin_PD08; +extern const mcu_pin_obj_t pin_PD09; +extern const mcu_pin_obj_t pin_PD10; +extern const mcu_pin_obj_t pin_PD11; +extern const mcu_pin_obj_t pin_PD12; +extern const mcu_pin_obj_t pin_PD13; +extern const mcu_pin_obj_t pin_PD14; +extern const mcu_pin_obj_t pin_PD15; +extern const mcu_pin_obj_t pin_PE00; +extern const mcu_pin_obj_t pin_PE01; +extern const mcu_pin_obj_t pin_PE02; +extern const mcu_pin_obj_t pin_PE03; +extern const mcu_pin_obj_t pin_PE04; +extern const mcu_pin_obj_t pin_PE05; +extern const mcu_pin_obj_t pin_PE06; +extern const mcu_pin_obj_t pin_PE07; +extern const mcu_pin_obj_t pin_PE08; +extern const mcu_pin_obj_t pin_PE09; +extern const mcu_pin_obj_t pin_PE10; +extern const mcu_pin_obj_t pin_PE11; +extern const mcu_pin_obj_t pin_PE12; +extern const mcu_pin_obj_t pin_PE13; +extern const mcu_pin_obj_t pin_PE14; +extern const mcu_pin_obj_t pin_PE15; +extern const mcu_pin_obj_t pin_PF00; +extern const mcu_pin_obj_t pin_PF01; +extern const mcu_pin_obj_t pin_PF02; +extern const mcu_pin_obj_t pin_PF03; +extern const mcu_pin_obj_t pin_PF04; +extern const mcu_pin_obj_t pin_PF05; +extern const mcu_pin_obj_t pin_PF06; +extern const mcu_pin_obj_t pin_PF07; +extern const mcu_pin_obj_t pin_PF08; +extern const mcu_pin_obj_t pin_PF09; +extern const mcu_pin_obj_t pin_PF10; +extern const mcu_pin_obj_t pin_PF11; +extern const mcu_pin_obj_t pin_PF12; +extern const mcu_pin_obj_t pin_PF13; +extern const mcu_pin_obj_t pin_PF14; +extern const mcu_pin_obj_t pin_PF15; +extern const mcu_pin_obj_t pin_PG00; +extern const mcu_pin_obj_t pin_PG01; +extern const mcu_pin_obj_t pin_PG02; +extern const mcu_pin_obj_t pin_PG03; +extern const mcu_pin_obj_t pin_PG04; +extern const mcu_pin_obj_t pin_PG05; +extern const mcu_pin_obj_t pin_PG06; +extern const mcu_pin_obj_t pin_PG07; +extern const mcu_pin_obj_t pin_PG08; +extern const mcu_pin_obj_t pin_PG09; +extern const mcu_pin_obj_t pin_PG10; +extern const mcu_pin_obj_t pin_PG11; +extern const mcu_pin_obj_t pin_PG12; +extern const mcu_pin_obj_t pin_PG13; +extern const mcu_pin_obj_t pin_PG14; +extern const mcu_pin_obj_t pin_PG15; +extern const mcu_pin_obj_t pin_PH00; +extern const mcu_pin_obj_t pin_PH01; +extern const mcu_pin_obj_t pin_PH02; +extern const mcu_pin_obj_t pin_PH03; +extern const mcu_pin_obj_t pin_PH04; +extern const mcu_pin_obj_t pin_PH05; +extern const mcu_pin_obj_t pin_PH06; +extern const mcu_pin_obj_t pin_PH07; +extern const mcu_pin_obj_t pin_PH08; +extern const mcu_pin_obj_t pin_PH09; +extern const mcu_pin_obj_t pin_PH10; +extern const mcu_pin_obj_t pin_PH11; +extern const mcu_pin_obj_t pin_PH12; +extern const mcu_pin_obj_t pin_PH13; +extern const mcu_pin_obj_t pin_PH14; +extern const mcu_pin_obj_t pin_PH15; +extern const mcu_pin_obj_t pin_PI00; +extern const mcu_pin_obj_t pin_PI01; +extern const mcu_pin_obj_t pin_PI02; +extern const mcu_pin_obj_t pin_PI03; +extern const mcu_pin_obj_t pin_PI04; +extern const mcu_pin_obj_t pin_PI05; +extern const mcu_pin_obj_t pin_PI06; +extern const mcu_pin_obj_t pin_PI07; +extern const mcu_pin_obj_t pin_PI08; +extern const mcu_pin_obj_t pin_PI09; +extern const mcu_pin_obj_t pin_PI10; +extern const mcu_pin_obj_t pin_PI11; +extern const mcu_pin_obj_t pin_PI12; +extern const mcu_pin_obj_t pin_PI13; +extern const mcu_pin_obj_t pin_PI14; +extern const mcu_pin_obj_t pin_PI15; +extern const mcu_pin_obj_t pin_PJ00; +extern const mcu_pin_obj_t pin_PJ01; +extern const mcu_pin_obj_t pin_PJ02; +extern const mcu_pin_obj_t pin_PJ03; +extern const mcu_pin_obj_t pin_PJ04; +extern const mcu_pin_obj_t pin_PJ05; +extern const mcu_pin_obj_t pin_PJ06; +extern const mcu_pin_obj_t pin_PJ07; +extern const mcu_pin_obj_t pin_PJ08; +extern const mcu_pin_obj_t pin_PJ09; +extern const mcu_pin_obj_t pin_PJ10; +extern const mcu_pin_obj_t pin_PJ11; +extern const mcu_pin_obj_t pin_PJ12; +extern const mcu_pin_obj_t pin_PJ13; +extern const mcu_pin_obj_t pin_PJ14; +extern const mcu_pin_obj_t pin_PJ15; +extern const mcu_pin_obj_t pin_PK00; +extern const mcu_pin_obj_t pin_PK01; +extern const mcu_pin_obj_t pin_PK02; +extern const mcu_pin_obj_t pin_PK03; +extern const mcu_pin_obj_t pin_PK04; +extern const mcu_pin_obj_t pin_PK05; +extern const mcu_pin_obj_t pin_PK06; +extern const mcu_pin_obj_t pin_PK07; +extern const mcu_pin_obj_t pin_PK08; +extern const mcu_pin_obj_t pin_PK09; +extern const mcu_pin_obj_t pin_PK10; +extern const mcu_pin_obj_t pin_PK11; +extern const mcu_pin_obj_t pin_PK12; +extern const mcu_pin_obj_t pin_PK13; +extern const mcu_pin_obj_t pin_PK14; +extern const mcu_pin_obj_t pin_PK15; + +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PINS_H diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c index a0d58f4fcf..18b202df56 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c @@ -25,7 +25,7 @@ * THE SOFTWARE. */ -#include "py/mpconfig.h" +#include "stm32f7xx_hal.h" void stm32_peripherals_clocks_init(void) { RCC_ClkInitTypeDef RCC_ClkInitStruct; diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h index f1878ee2e6..98aa5782a8 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h @@ -52,4 +52,6 @@ const mcu_periph_obj_t mcu_uart_rx_list[25]; #define TIM_PIN_ARRAY_LEN 55 TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; +const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; + #endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c index d231f25d0b..8ede6080e8 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c @@ -25,7 +25,7 @@ * THE SOFTWARE. */ -#include "py/mpconfig.h" +#include "stm32h7xx_hal.h" void stm32_peripherals_clocks_init(void) { RCC_ClkInitTypeDef RCC_ClkInitStruct; diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 8c04112c01..060eadecb3 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -35,8 +35,11 @@ #include "py/obj.h" #include "py/runtime.h" #include "lib/oofatfs/ff.h" +#include "supervisor/flash.h" #include "supervisor/shared/safe_mode.h" +#include STM32_HAL_H + typedef struct { uint32_t base_address; uint32_t sector_size; @@ -122,7 +125,7 @@ STATIC uint32_t get_bank(uint32_t addr) { } #endif -//Return the sector of a given flash address. +//Return the sector of a given flash address. uint32_t flash_get_sector_info(uint32_t addr, uint32_t *start_addr, uint32_t *size) { if (addr >= flash_layout[0].base_address) { uint32_t sector_index = 0; @@ -158,7 +161,7 @@ uint32_t supervisor_flash_get_block_count(void) { return INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS; } -void supervisor_flash_flush(void) { +void port_internal_flash_flush(void) { if (_cache_flash_addr == NO_CACHE) return; #if defined(STM32H7) @@ -202,7 +205,7 @@ void supervisor_flash_flush(void) { #if defined(STM32H7) for (uint32_t i = 0; i < (sector_size / 32); i++) { // Note that the STM32H7 HAL interface differs by taking an address, not 64 bit data - if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, sector_start_addr, + if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, sector_start_addr, (uint32_t)cache_addr) != HAL_OK) { // error occurred during flash write HAL_FLASH_Lock(); // lock the flash @@ -216,7 +219,7 @@ void supervisor_flash_flush(void) { #else // STM32F4 // program the flash word by word for (uint32_t i = 0; i < sector_size / 4; i++) { - if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, sector_start_addr, + if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, sector_start_addr, (uint64_t)*cache_addr) != HAL_OK) { // error occurred during flash write HAL_FLASH_Lock(); // lock the flash @@ -260,7 +263,7 @@ mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t n if (count < num_blocks && _cache_flash_addr == sector_start_addr) { // Read is contained in the cache, so just read cache memcpy(dest, (_flash_cache + (src-sector_start_addr)), FILESYSTEM_BLOCK_SIZE*num_blocks); - } else { + } else { // The read spans multiple sectors or is in another sector // Must write out anything in cache before trying to read. supervisor_flash_flush(); diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 53388d3544..b4d07ff482 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -5,6 +5,7 @@ * * Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -67,6 +68,13 @@ #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 #endif +/* Note this applies to STM32F769xG only, STM32F746xE has 512KB */ +#ifdef STM32F746xx +#define STM32_FLASH_SIZE 0x100000 //1MB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x18000 //96KiB +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08008000 +#endif + #ifdef STM32F767xx #define STM32_FLASH_SIZE 0x200000 //2MB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0x18000 //96KiB @@ -75,7 +83,7 @@ #ifdef STM32H743xx #define STM32_FLASH_SIZE 0x200000 //2MB -#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x20000 //128KiB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x60000 //384KiB #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08020000 #endif diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 21ff0b5751..23ba7d8745 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -28,7 +28,7 @@ #include #include "supervisor/port.h" #include "boards/board.h" -#include "tick.h" +#include "lib/timeutils/timeutils.h" #include "common-hal/microcontroller/Pin.h" @@ -46,8 +46,10 @@ #include "clocks.h" #include "gpio.h" +#include STM32_HAL_H + //only enable the Reset Handler overwrite for the H7 for now -#if defined(STM32H7) +#if (CPY_STM32H7) // Device memories must be accessed in order. #define DEVICE 2 @@ -101,7 +103,7 @@ __attribute__((used, naked)) void Reset_Handler(void) { // The first number in RBAR is the region number. When searching for a policy, the region with // the highest number wins. If none match, then the default policy set at enable applies. - // Mark all the flash the same until instructed otherwise. + // Mark all the flash the same until instructed otherwise. MPU->RBAR = ARM_MPU_RBAR(11, 0x08000000U); MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_2MB); @@ -148,22 +150,105 @@ __attribute__((used, naked)) void Reset_Handler(void) { #endif //end H7 specific code +static RTC_HandleTypeDef _hrtc; + +#if BOARD_HAS_LOW_SPEED_CRYSTAL +static uint32_t rtc_clock_frequency = LSE_VALUE; +#else +static uint32_t rtc_clock_frequency = LSI_VALUE; +#endif + safe_mode_t port_init(void) { HAL_Init(); __HAL_RCC_SYSCFG_CLK_ENABLE(); - - #if defined(STM32F4) + + #if (CPY_STM32F4) __HAL_RCC_PWR_CLK_ENABLE(); #endif stm32_peripherals_clocks_init(); stm32_peripherals_gpio_init(); - tick_init(); + HAL_PWR_EnableBkUpAccess(); + + // TODO: move all of this to clocks.c + #if BOARD_HAS_LOW_SPEED_CRYSTAL + uint32_t tickstart = HAL_GetTick(); + + // H7/F7 untested with LSE, so autofail them until above move is done + #if (CPY_STM32F4) + bool lse_setupsuccess = true; + #else + bool lse_setupsuccess = false; + #endif + + // Update LSE configuration in Backup Domain control register + // Requires to enable write access to Backup Domain of necessary + // TODO: should be using the HAL OSC initializer, otherwise we'll need + // preprocessor defines for every register to account for F7/H7 + #if (CPY_STM32F4) + if(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) + { + // Enable write access to Backup domain + SET_BIT(PWR->CR, PWR_CR_DBP); + // Wait for Backup domain Write protection disable + tickstart = HAL_GetTick(); + while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) + { + if((HAL_GetTick() - tickstart) > RCC_DBP_TIMEOUT_VALUE) + { + lse_setupsuccess = false; + } + } + } + #endif + + __HAL_RCC_LSE_CONFIG(RCC_LSE_ON); + tickstart = HAL_GetTick(); + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) { + if((HAL_GetTick() - tickstart ) > LSE_STARTUP_TIMEOUT) + { + lse_setupsuccess = false; + __HAL_RCC_LSE_CONFIG(RCC_LSE_OFF); + __HAL_RCC_LSI_ENABLE(); + rtc_clock_frequency = LSI_VALUE; + break; + } + } + + if (lse_setupsuccess) { + __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); + } else { + __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI); + } + + #else + __HAL_RCC_LSI_ENABLE(); + __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI); + #endif + + __HAL_RCC_RTC_ENABLE(); + _hrtc.Instance = RTC; + _hrtc.Init.HourFormat = RTC_HOURFORMAT_24; + // Divide async as little as possible so that we have rtc_clock_frequency count in subseconds. + // This ensures our timing > 1 second is correct. + _hrtc.Init.AsynchPrediv = 0x0; + _hrtc.Init.SynchPrediv = rtc_clock_frequency - 1; + _hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; + + HAL_RTC_Init(&_hrtc); + + HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn); return NO_SAFE_MODE; } +void SysTick_Handler(void) { + // Read the CTRL register to clear the SysTick interrupt. + SysTick->CTRL; + HAL_IncTick(); +} + void reset_port(void) { reset_all_pins(); #if CIRCUITPY_BUSIO @@ -174,7 +259,7 @@ void reset_port(void) { #if CIRCUITPY_PULSEIO pwmout_reset(); pulseout_reset(); - pulsein_reset(); + pulsein_reset(); #endif } @@ -197,7 +282,7 @@ uint32_t *port_heap_get_top(void) { } uint32_t *port_stack_get_limit(void) { - return &_ld_stack_bottom; + return &_ld_stack_bottom; } uint32_t *port_stack_get_top(void) { @@ -247,6 +332,117 @@ __attribute__((used)) void HardFault_Handler(void) } } +// This function is called often for timing so we cache the seconds elapsed computation based on the +// register value. The STM HAL always does shifts and conversion if we use it directly. +volatile uint32_t seconds_to_date = 0; +volatile uint32_t cached_date = 0; +volatile uint32_t seconds_to_minute = 0; +volatile uint32_t cached_hours_minutes = 0; +uint64_t port_get_raw_ticks(uint8_t* subticks) { + uint32_t subseconds = rtc_clock_frequency - (uint32_t)(RTC->SSR); + uint32_t time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); + uint32_t date = (uint32_t)(RTC->DR & RTC_DR_RESERVED_MASK); + if (date != cached_date) { + uint32_t year = (uint8_t)((date & (RTC_DR_YT | RTC_DR_YU)) >> 16U); + uint8_t month = (uint8_t)((date & (RTC_DR_MT | RTC_DR_MU)) >> 8U); + uint8_t day = (uint8_t)(date & (RTC_DR_DT | RTC_DR_DU)); + // Add 2000 since the year is only the last two digits. + year = 2000 + (uint32_t)RTC_Bcd2ToByte(year); + month = (uint8_t)RTC_Bcd2ToByte(month); + day = (uint8_t)RTC_Bcd2ToByte(day); + seconds_to_date = timeutils_seconds_since_2000(year, month, day, 0, 0, 0); + cached_date = date; + } + uint32_t hours_minutes = time & (RTC_TR_HT | RTC_TR_HU | RTC_TR_MNT | RTC_TR_MNU); + if (hours_minutes != cached_hours_minutes) { + uint8_t hours = (uint8_t)((time & (RTC_TR_HT | RTC_TR_HU)) >> 16U); + uint8_t minutes = (uint8_t)((time & (RTC_TR_MNT | RTC_TR_MNU)) >> 8U); + hours = (uint8_t)RTC_Bcd2ToByte(hours); + minutes = (uint8_t)RTC_Bcd2ToByte(minutes); + seconds_to_minute = 60 * (60 * hours + minutes); + } + uint8_t seconds = (uint8_t)(time & (RTC_TR_ST | RTC_TR_SU)); + seconds = (uint8_t)RTC_Bcd2ToByte(seconds); + if (subticks != NULL) { + *subticks = subseconds % 32; + } + + uint64_t raw_ticks = ((uint64_t) 1024) * (seconds_to_date + seconds_to_minute + seconds) + subseconds / 32; + return raw_ticks; +} + +void RTC_WKUP_IRQHandler(void) { + supervisor_tick(); + __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&_hrtc, RTC_FLAG_WUTF); + __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); +} + +volatile bool alarmed_already = false; +void RTC_Alarm_IRQHandler(void) { + HAL_RTC_DeactivateAlarm(&_hrtc, RTC_ALARM_A); + __HAL_RTC_ALARM_EXTI_CLEAR_FLAG(); + __HAL_RTC_ALARM_CLEAR_FLAG(&_hrtc, RTC_FLAG_ALRAF); + alarmed_already = true; +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { + HAL_RTCEx_SetWakeUpTimer_IT(&_hrtc, rtc_clock_frequency / 1024 / 2, RTC_WAKEUPCLOCK_RTCCLK_DIV2); + HAL_NVIC_SetPriority(RTC_WKUP_IRQn, 1, 0U); + HAL_NVIC_EnableIRQ(RTC_WKUP_IRQn); +} +extern volatile uint32_t autoreload_delay_ms; + +// Disable 1/1024 second tick. +void port_disable_tick(void) { + HAL_NVIC_DisableIRQ(RTC_WKUP_IRQn); + HAL_RTCEx_DeactivateWakeUpTimer(&_hrtc); +} + +void port_interrupt_after_ticks(uint32_t ticks) { + uint64_t raw_ticks = port_get_raw_ticks(NULL) + ticks; + + RTC_AlarmTypeDef alarm; + if (ticks > 1024) { + timeutils_struct_time_t tm; + timeutils_seconds_since_2000_to_struct_time(raw_ticks / 1024, &tm); + alarm.AlarmTime.Hours = tm.tm_hour; + alarm.AlarmTime.Minutes = tm.tm_min; + alarm.AlarmTime.Seconds = tm.tm_sec; + alarm.AlarmDateWeekDay = tm.tm_mday; + // Masking here means that the value is ignored so we set none. + alarm.AlarmMask = RTC_ALARMMASK_NONE; + } else { + // Masking here means that the value is ignored so we set them all. Only the subseconds + // value matters. + alarm.AlarmMask = RTC_ALARMMASK_ALL; + } + + alarm.AlarmTime.SubSeconds = rtc_clock_frequency - + ((raw_ticks % 1024) * 32); + alarm.AlarmTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; + alarm.AlarmTime.StoreOperation = RTC_STOREOPERATION_SET; + // Masking here means that the bits are ignored so we set none of them. + alarm.AlarmSubSecondMask = RTC_ALARMSUBSECONDMASK_NONE; + alarm.AlarmDateWeekDaySel = RTC_ALARMDATEWEEKDAYSEL_DATE; + alarm.Alarm = RTC_ALARM_A; + + HAL_RTC_SetAlarm_IT(&_hrtc, &alarm, RTC_FORMAT_BIN); + alarmed_already = false; +} + +void port_sleep_until_interrupt(void) { + // Clear the FPU interrupt because it can prevent us from sleeping. + if (__get_FPSCR() & ~(0x9f)) { + __set_FPSCR(__get_FPSCR() & ~(0x9f)); + (void) __get_FPSCR(); + } + if (alarmed_already) { + return; + } + __WFI(); +} + // Required by __libc_init_array in startup code if we are compiling using // -nostdlib/-nostartfiles. void _init(void) diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index b66107b7ba..3dd0acafd0 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -26,10 +26,10 @@ */ -#include "tick.h" #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" +#include "lib/tinyusb/src/device/usbd.h" #include "py/mpconfig.h" @@ -63,13 +63,13 @@ STATIC void init_usb_vbus_sense(void) { } void init_usb_hardware(void) { - //TODO: if future chips overload this with options, move to peripherals management. + //TODO: if future chips overload this with options, move to peripherals management. GPIO_InitTypeDef GPIO_InitStruct = {0}; /**USB_OTG_FS GPIO Configuration PA10 ------> USB_OTG_FS_ID PA11 ------> USB_OTG_FS_DM - PA12 ------> USB_OTG_FS_DP + PA12 ------> USB_OTG_FS_DP */ __HAL_RCC_GPIOA_CLK_ENABLE(); @@ -118,7 +118,6 @@ void init_usb_hardware(void) { never_reset_pin_number(0, 8); #endif - #if CPY_STM32H7 HAL_PWREx_EnableUSBVoltageDetector(); __HAL_RCC_USB2_OTG_FS_CLK_ENABLE(); @@ -129,3 +128,7 @@ void init_usb_hardware(void) { init_usb_vbus_sense(); } + +void OTG_FS_IRQHandler(void) { + tud_int_handler(0); +} diff --git a/ports/stm/tick.c b/ports/stm/tick.c deleted file mode 100644 index 67adc84e30..0000000000 --- a/ports/stm/tick.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "tick.h" - -#include "supervisor/filesystem.h" -#include "supervisor/shared/tick.h" -#include "shared-bindings/microcontroller/Processor.h" - -void SysTick_Handler(void) { - // SysTick interrupt handler called when the SysTick timer reaches zero - // (every millisecond). - - // Do things common to all ports when the tick occurs - supervisor_tick(); -} - -uint32_t HAL_GetTick(void) //override ST HAL -{ - return (uint32_t)supervisor_ticks_ms32(); -} - -void tick_init() { - uint32_t ticks_per_ms = SystemCoreClock/ 1000; - SysTick_Config(ticks_per_ms); // interrupt is enabled - - NVIC_EnableIRQ(SysTick_IRQn); - // Bump up the systick interrupt so nothing else interferes with timekeeping. - NVIC_SetPriority(SysTick_IRQn, 0); - NVIC_SetPriority(OTG_FS_IRQn, 1); -} - -void tick_delay(uint32_t us) { - uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; - uint64_t start_ms = supervisor_ticks_ms64(); - while (us > 1000) { - while (supervisor_ticks_ms64() == start_ms) {} - us -= us_between_ticks; - start_ms = supervisor_ticks_ms64(); - us_between_ticks = 1000; - } - while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} -} - -// us counts down! -void current_tick(uint64_t* ms, uint32_t* us_until_ms) { - uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - *ms = supervisor_ticks_ms32(); - *us_until_ms = SysTick->VAL / ticks_per_us; -} - -void wait_until(uint64_t ms, uint32_t us_until_ms) { - uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - while(supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} -} diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 78ab41e129..e3892d98e4 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -99,6 +99,9 @@ endif ### # Select which builtin modules to compile and include. +ifeq ($(CIRCUITPY_AESIO),1) +SRC_PATTERNS += aesio/% +endif ifeq ($(CIRCUITPY_ANALOGIO),1) SRC_PATTERNS += analogio/% endif @@ -290,8 +293,7 @@ SRC_COMMON_HAL_ALL = \ rtc/RTC.c \ rtc/__init__.c \ supervisor/Runtime.c \ - supervisor/__init__.c \ - time/__init__.c + supervisor/__init__.c SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) @@ -309,7 +311,7 @@ $(filter $(SRC_PATTERNS), \ fontio/Glyph.c \ microcontroller/RunMode.c \ math/__init__.c \ - _eve/__init__.c \ + _eve/__init__.c \ ) SRC_BINDINGS_ENUMS += \ @@ -342,6 +344,8 @@ SRC_SHARED_MODULE_ALL = \ bitbangio/__init__.c \ board/__init__.c \ busio/OneWire.c \ + aesio/__init__.c \ + aesio/aes.c \ displayio/Bitmap.c \ displayio/ColorConverter.c \ displayio/Display.c \ @@ -370,13 +374,14 @@ SRC_SHARED_MODULE_ALL = \ rgbmatrix/__init__.c \ storage/__init__.c \ struct/__init__.c \ + time/__init__.c \ terminalio/Terminal.c \ terminalio/__init__.c \ uheap/__init__.c \ ustack/__init__.c \ _pew/__init__.c \ _pew/PewPew.c \ - _eve/__init__.c + _eve/__init__.c # All possible sources are listed here, and are filtered by SRC_PATTERNS. SRC_SHARED_MODULE = $(filter $(SRC_PATTERNS), $(SRC_SHARED_MODULE_ALL)) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 497fd95235..6b7fc192f9 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -179,17 +179,10 @@ typedef long mp_off_t; // board-specific definitions, which control and may override definitions below. #include "mpconfigboard.h" -// CIRCUITPY_FULL_BUILD is defined in a *.mk file. - -// Remove some lesser-used functionality to make small builds fit. +// Turning off FULL_BUILD removes some functionality to reduce flash size on tiny SAMD21s #define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (CIRCUITPY_FULL_BUILD) -//TODO: replace this with a rework of the FULL_BUILD system -#if !defined(MICROPY_CPYTHON_COMPAT) - #define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) -#endif -#if !defined(MICROPY_COMP_FSTRING_LITERAL) +#define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) #define MICROPY_COMP_FSTRING_LITERAL (MICROPY_CPYTHON_COMPAT) -#endif #define MICROPY_MODULE_WEAK_LINKS (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_ALL_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_BUILTINS_COMPLEX (CIRCUITPY_FULL_BUILD) @@ -223,13 +216,20 @@ typedef long mp_off_t; #define MP_SSIZE_MAX (0x7fffffff) #endif -#if INTERNAL_FLASH_FILESYSTEM == 0 && QSPI_FLASH_FILESYSTEM == 0 && SPI_FLASH_FILESYSTEM == 0 && !CIRCUITPY_MINIMAL_BUILD +#if INTERNAL_FLASH_FILESYSTEM == 0 && QSPI_FLASH_FILESYSTEM == 0 && SPI_FLASH_FILESYSTEM == 0 && !DISABLE_FILESYSTEM #error No *_FLASH_FILESYSTEM set! #endif // These CIRCUITPY_xxx values should all be defined in the *.mk files as being on or off. // So if any are not defined in *.mk, they'll throw an error here. +#if CIRCUITPY_AESIO +extern const struct _mp_obj_module_t aesio_module; +#define AESIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_aesio), (mp_obj_t)&aesio_module }, +#else +#define AESIO_MODULE +#endif + #if CIRCUITPY_ANALOGIO #define ANALOGIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_analogio), (mp_obj_t)&analogio_module }, extern const struct _mp_obj_module_t analogio_module; @@ -626,6 +626,7 @@ extern const struct _mp_obj_module_t ustack_module; // Some of these definitions will be blank depending on what is turned on and off. // Some are omitted because they're in MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS above. #define MICROPY_PORT_BUILTIN_MODULES_STRONG_LINKS \ + AESIO_MODULE \ ANALOGIO_MODULE \ AUDIOBUSIO_MODULE \ AUDIOCORE_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 601f1c4e43..105253aec4 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -23,76 +23,32 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# mpconfigboard.mk files can specify: -# CIRCUITPY_FULL_BUILD = 1 (which is the default) -# or -# CIRCUITPY_SMALL_BUILD = 1 -# which is the same as: -# CIRCUITPY_FULL_BUILD = 0 +# Boards default to all modules enabled (with exceptions) +# Manually disable by overriding in #mpconfigboard.mk -ifndef CIRCUITPY_FULL_BUILD - ifeq ($(CIRCUITPY_SMALL_BUILD),1) - CIRCUITPY_FULL_BUILD = 0 - else - CIRCUITPY_FULL_BUILD = 1 - endif -endif +# Smaller builds can be forced for resource constrained chips (typically SAMD21s +# without external flash) by setting CIRCUITPY_FULL_BUILD=0. Avoid using this +# for merely incomplete ports, as it changes settings in other files. +CIRCUITPY_FULL_BUILD ?= 1 CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD) -# Setting CIRCUITPY_MINIMAL_BUILD = 1 will disable all features -# Use for for early stage or highly restricted ports -ifndef CIRCUITPY_MINIMAL_BUILD -CIRCUITPY_MINIMAL_BUILD = 0 -endif -CFLAGS += -DCIRCUITPY_MINIMAL_BUILD=$(CIRCUITPY_MINIMAL_BUILD) -ifndef CIRCUITPY_DEFAULT_BUILD - ifeq ($(CIRCUITPY_MINIMAL_BUILD),1) - CIRCUITPY_FULL_BUILD = 0 - CIRCUITPY_DEFAULT_BUILD = 0 - else - CIRCUITPY_DEFAULT_BUILD = 1 - endif -endif -CFLAGS += -DCIRCUITPY_DEFAULT_BUILD=$(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_AESIO ?= 0 +CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO) -# Some features have no unique HAL component, and thus there's never -# a reason to not include them. -ifndef CIRCUITPY_ALWAYS_BUILD - CIRCUITPY_ALWAYS_BUILD = 1 -endif -CFLAGS += -DCIRCUITPY_ALWAYS_BUILD=$(CIRCUITPY_ALWAYS_BUILD) - - -# All builtin modules are listed below, with default values (0 for off, 1 for on) -# Some are always on, some are always off, and some depend on CIRCUITPY_FULL_BUILD. -# -# *** You can override any of the defaults by defining them in your mpconfigboard.mk. - -ifndef CIRCUITPY_ANALOGIO -CIRCUITPY_ANALOGIO = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_ANALOGIO ?= 1 CFLAGS += -DCIRCUITPY_ANALOGIO=$(CIRCUITPY_ANALOGIO) -ifndef CIRCUITPY_AUDIOBUSIO -CIRCUITPY_AUDIOBUSIO = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_AUDIOBUSIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AUDIOBUSIO=$(CIRCUITPY_AUDIOBUSIO) -ifndef CIRCUITPY_AUDIOIO -CIRCUITPY_AUDIOIO = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_AUDIOIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AUDIOIO=$(CIRCUITPY_AUDIOIO) -ifndef CIRCUITPY_AUDIOIO_COMPAT -CIRCUITPY_AUDIOIO_COMPAT = $(CIRCUITPY_AUDIOIO) -endif +CIRCUITPY_AUDIOIO_COMPAT ?= $(CIRCUITPY_AUDIOIO) CFLAGS += -DCIRCUITPY_AUDIOIO_COMPAT=$(CIRCUITPY_AUDIOIO_COMPAT) - -ifndef CIRCUITPY_AUDIOPWMIO -CIRCUITPY_AUDIOPWMIO = 0 -endif +CIRCUITPY_AUDIOPWMIO ?= 0 CFLAGS += -DCIRCUITPY_AUDIOPWMIO=$(CIRCUITPY_AUDIOPWMIO) ifndef CIRCUITPY_AUDIOCORE @@ -104,9 +60,7 @@ endif endif CFLAGS += -DCIRCUITPY_AUDIOCORE=$(CIRCUITPY_AUDIOCORE) -ifndef CIRCUITPY_AUDIOMIXER -CIRCUITPY_AUDIOMIXER = $(CIRCUITPY_AUDIOIO) -endif +CIRCUITPY_AUDIOMIXER ?= $(CIRCUITPY_AUDIOIO) CFLAGS += -DCIRCUITPY_AUDIOMIXER=$(CIRCUITPY_AUDIOMIXER) ifndef CIRCUITPY_AUDIOMP3 @@ -118,245 +72,156 @@ endif endif CFLAGS += -DCIRCUITPY_AUDIOMP3=$(CIRCUITPY_AUDIOMP3) -ifndef CIRCUITPY_BITBANGIO -CIRCUITPY_BITBANGIO = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_BITBANGIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO) # Explicitly enabled for boards that support _bleio. -ifndef CIRCUITPY_BLEIO -CIRCUITPY_BLEIO = 0 -endif +CIRCUITPY_BLEIO ?= 0 CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO) -ifndef CIRCUITPY_BOARD -CIRCUITPY_BOARD = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_BOARD ?= 1 CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD) -ifndef CIRCUITPY_BUSIO -CIRCUITPY_BUSIO = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_BUSIO ?= 1 CFLAGS += -DCIRCUITPY_BUSIO=$(CIRCUITPY_BUSIO) -ifndef CIRCUITPY_DIGITALIO -CIRCUITPY_DIGITALIO = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_DIGITALIO ?= 1 CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO) -ifndef CIRCUITPY_DISPLAYIO -CIRCUITPY_DISPLAYIO = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_DISPLAYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO) -ifndef CIRCUITPY_FRAMEBUFFERIO -CIRCUITPY_FRAMEBUFFERIO = 0 -endif +CIRCUITPY_FRAMEBUFFERIO ?= 0 CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO) -ifndef CIRCUITPY_FREQUENCYIO -CIRCUITPY_FREQUENCYIO = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_FREQUENCYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_FREQUENCYIO=$(CIRCUITPY_FREQUENCYIO) -ifndef CIRCUITPY_GAMEPAD -CIRCUITPY_GAMEPAD = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_GAMEPAD ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_GAMEPAD=$(CIRCUITPY_GAMEPAD) -ifndef CIRCUITPY_GAMEPADSHIFT -CIRCUITPY_GAMEPADSHIFT = 0 -endif +CIRCUITPY_GAMEPADSHIFT ?= 0 CFLAGS += -DCIRCUITPY_GAMEPADSHIFT=$(CIRCUITPY_GAMEPADSHIFT) -ifndef CIRCUITPY_I2CSLAVE -CIRCUITPY_I2CSLAVE = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_I2CSLAVE ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_I2CSLAVE=$(CIRCUITPY_I2CSLAVE) -ifndef CIRCUITPY_MATH -CIRCUITPY_MATH = $(CIRCUITPY_ALWAYS_BUILD) -endif +CIRCUITPY_MATH ?= 1 CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH) -ifndef CIRCUITPY__EVE -CIRCUITPY__EVE = 0 -endif +CIRCUITPY__EVE ?= 0 CFLAGS += -DCIRCUITPY__EVE=$(CIRCUITPY__EVE) -ifndef CIRCUITPY_MICROCONTROLLER -CIRCUITPY_MICROCONTROLLER = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_MICROCONTROLLER ?= 1 CFLAGS += -DCIRCUITPY_MICROCONTROLLER=$(CIRCUITPY_MICROCONTROLLER) -ifndef CIRCUITPY_NEOPIXEL_WRITE -CIRCUITPY_NEOPIXEL_WRITE = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_NEOPIXEL_WRITE ?= 1 CFLAGS += -DCIRCUITPY_NEOPIXEL_WRITE=$(CIRCUITPY_NEOPIXEL_WRITE) # Enabled on SAMD51. Won't fit on SAMD21 builds. Not tested on nRF or STM32F4 builds. -ifndef CIRCUITPY_NETWORK -CIRCUITPY_NETWORK = 0 -endif +CIRCUITPY_NETWORK ?= 0 CFLAGS += -DCIRCUITPY_NETWORK=$(CIRCUITPY_NETWORK) -ifndef CIRCUITPY_NVM -CIRCUITPY_NVM = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_NVM ?= 1 CFLAGS += -DCIRCUITPY_NVM=$(CIRCUITPY_NVM) -ifndef CIRCUITPY_OS -CIRCUITPY_OS = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_OS ?= 1 CFLAGS += -DCIRCUITPY_OS=$(CIRCUITPY_OS) -ifndef CIRCUITPY_PIXELBUF -CIRCUITPY_PIXELBUF = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_PIXELBUF ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_PIXELBUF=$(CIRCUITPY_PIXELBUF) # Only for SAMD boards for the moment -ifndef CIRCUITPY_RGBMATRIX -CIRCUITPY_RGBMATRIX = 0 -endif +CIRCUITPY_RGBMATRIX ?= 0 CFLAGS += -DCIRCUITPY_RGBMATRIX=$(CIRCUITPY_RGBMATRIX) -ifndef CIRCUITPY_PULSEIO -CIRCUITPY_PULSEIO = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_PULSEIO ?= 1 CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO) # Only for SAMD boards for the moment -ifndef CIRCUITPY_PS2IO -CIRCUITPY_PS2IO = 0 -endif +CIRCUITPY_PS2IO ?= 0 CFLAGS += -DCIRCUITPY_PS2IO=$(CIRCUITPY_PS2IO) -ifndef CIRCUITPY_RANDOM -CIRCUITPY_RANDOM = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_RANDOM ?= 1 CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM) -ifndef CIRCUITPY_ROTARYIO -CIRCUITPY_ROTARYIO = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_ROTARYIO ?= 1 CFLAGS += -DCIRCUITPY_ROTARYIO=$(CIRCUITPY_ROTARYIO) -ifndef CIRCUITPY_RTC -CIRCUITPY_RTC = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_RTC ?= 1 CFLAGS += -DCIRCUITPY_RTC=$(CIRCUITPY_RTC) # CIRCUITPY_SAMD is handled in the atmel-samd tree. # Only for SAMD chips. # Assume not a SAMD build. -ifndef CIRCUITPY_SAMD -CIRCUITPY_SAMD = 0 -endif +CIRCUITPY_SAMD ?= 0 CFLAGS += -DCIRCUITPY_SAMD=$(CIRCUITPY_SAMD) # Currently always off. -ifndef CIRCUITPY_STAGE -CIRCUITPY_STAGE = 0 -endif +CIRCUITPY_STAGE ?= 0 CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE) -ifndef CIRCUITPY_STORAGE -CIRCUITPY_STORAGE = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_STORAGE ?= 1 CFLAGS += -DCIRCUITPY_STORAGE=$(CIRCUITPY_STORAGE) -ifndef CIRCUITPY_STRUCT -CIRCUITPY_STRUCT = $(CIRCUITPY_ALWAYS_BUILD) -endif +CIRCUITPY_STRUCT ?= 1 CFLAGS += -DCIRCUITPY_STRUCT=$(CIRCUITPY_STRUCT) -ifndef CIRCUITPY_SUPERVISOR -CIRCUITPY_SUPERVISOR = $(CIRCUITPY_ALWAYS_BUILD) -endif +CIRCUITPY_SUPERVISOR ?= 1 CFLAGS += -DCIRCUITPY_SUPERVISOR=$(CIRCUITPY_SUPERVISOR) -ifndef CIRCUITPY_TIME -CIRCUITPY_TIME = $(CIRCUITPY_ALWAYS_BUILD) -endif +CIRCUITPY_TIME ?= 1 CFLAGS += -DCIRCUITPY_TIME=$(CIRCUITPY_TIME) # touchio might be native or generic. See circuitpy_defns.mk. -ifndef CIRCUITPY_TOUCHIO_USE_NATIVE -CIRCUITPY_TOUCHIO_USE_NATIVE = 0 -endif +CIRCUITPY_TOUCHIO_USE_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_TOUCHIO_USE_NATIVE=$(CIRCUITPY_TOUCHIO_USE_NATIVE) -ifndef CIRCUITPY_TOUCHIO -CIRCUITPY_TOUCHIO = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_TOUCHIO ?= 1 CFLAGS += -DCIRCUITPY_TOUCHIO=$(CIRCUITPY_TOUCHIO) # For debugging. -ifndef CIRCUITPY_UHEAP -CIRCUITPY_UHEAP = 0 -endif +CIRCUITPY_UHEAP ?= 0 CFLAGS += -DCIRCUITPY_UHEAP=$(CIRCUITPY_UHEAP) -ifndef CIRCUITPY_USB_HID -CIRCUITPY_USB_HID = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_USB_HID ?= 1 CFLAGS += -DCIRCUITPY_USB_HID=$(CIRCUITPY_USB_HID) -ifndef CIRCUITPY_USB_MIDI -CIRCUITPY_USB_MIDI = $(CIRCUITPY_DEFAULT_BUILD) -endif +CIRCUITPY_USB_MIDI ?= 1 CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI) -ifndef CIRCUITPY_PEW -CIRCUITPY_PEW = 0 -endif +CIRCUITPY_PEW ?= 0 CFLAGS += -DCIRCUITPY_PEW=$(CIRCUITPY_PEW) # For debugging. -ifndef CIRCUITPY_USTACK -CIRCUITPY_USTACK = 0 -endif +CIRCUITPY_USTACK ?= 0 CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK) # Non-module conditionals -ifndef CIRCUITPY_BITBANG_APA102 -CIRCUITPY_BITBANG_APA102 = 0 -endif +CIRCUITPY_BITBANG_APA102 ?= 0 CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102) # Should busio.I2C() check for pullups? # Some boards in combination with certain peripherals may not want this. -ifndef CIRCUITPY_REQUIRE_I2C_PULLUPS -CIRCUITPY_REQUIRE_I2C_PULLUPS = 1 -endif +CIRCUITPY_REQUIRE_I2C_PULLUPS ?= 1 CFLAGS += -DCIRCUITPY_REQUIRE_I2C_PULLUPS=$(CIRCUITPY_REQUIRE_I2C_PULLUPS) # REPL over BLE -ifndef CIRCUITPY_SERIAL_BLE -CIRCUITPY_SERIAL_BLE = 0 -endif +CIRCUITPY_SERIAL_BLE ?= 0 CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE) -ifndef CIRCUITPY_BLE_FILE_SERVICE -CIRCUITPY_BLE_FILE_SERVICE = 0 -endif +CIRCUITPY_BLE_FILE_SERVICE ?= 0 CFLAGS += -DCIRCUITPY_BLE_FILE_SERVICE=$(CIRCUITPY_BLE_FILE_SERVICE) # REPL over UART -ifndef CIRCUITPY_SERIAL_UART -CIRCUITPY_SERIAL_UART = 0 -endif +CIRCUITPY_SERIAL_UART ?= 0 CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART) # ulab numerics library -ifndef CIRCUITPY_ULAB -CIRCUITPY_ULAB = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB) # Enabled micropython.native decorator (experimental) -ifndef CIRCUITPY_ENABLE_MPY_NATIVE -CIRCUITPY_ENABLE_MPY_NATIVE = 0 -endif +CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) diff --git a/py/py.mk b/py/py.mk index bca6ac14c3..a5c8a7dc65 100644 --- a/py/py.mk +++ b/py/py.mk @@ -107,6 +107,7 @@ endif ifeq ($(CIRCUITPY_ULAB),1) SRC_MOD += $(addprefix extmod/ulab/code/, \ +compare.c \ create.c \ extras.c \ fft.c \ @@ -257,6 +258,7 @@ PY_CORE_O_BASENAME = $(addprefix py/,\ repl.o \ smallint.o \ frozenmod.o \ + ringbuf.o \ ) PY_EXTMOD_O_BASENAME = \ diff --git a/py/ringbuf.c b/py/ringbuf.c new file mode 100644 index 0000000000..c19f1d44bc --- /dev/null +++ b/py/ringbuf.c @@ -0,0 +1,115 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Paul Sokolovsky + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "ringbuf.h" + +// Dynamic initialization. This should be accessible from a root pointer. +// capacity is the number of bytes the ring buffer can hold. The actual +// size of the buffer is one greater than that, due to how the buffer +// handles empty and full statuses. +bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived) { + r->buf = gc_alloc(capacity + 1, false, long_lived); + r->size = capacity + 1; + r->iget = r->iput = 0; + return r->buf != NULL; +} + +void ringbuf_free(ringbuf_t *r) { + gc_free(r->buf); + r->size = 0; + ringbuf_clear(r); +} + +size_t ringbuf_capacity(ringbuf_t *r) { + return r->size - 1; +} + +// Returns -1 if buffer is empty, else returns byte fetched. +int ringbuf_get(ringbuf_t *r) { + if (r->iget == r->iput) { + return -1; + } + uint8_t v = r->buf[r->iget++]; + if (r->iget >= r->size) { + r->iget = 0; + } + return v; +} + +// Returns -1 if no room in buffer, else returns 0. +int ringbuf_put(ringbuf_t *r, uint8_t v) { + uint32_t iput_new = r->iput + 1; + if (iput_new >= r->size) { + iput_new = 0; + } + if (iput_new == r->iget) { + return -1; + } + r->buf[r->iput] = v; + r->iput = iput_new; + return 0; +} + +void ringbuf_clear(ringbuf_t *r) { + r->iput = r->iget = 0; +} + +// Number of free slots that can be written. +size_t ringbuf_num_empty(ringbuf_t *r) { + return (r->size + r->iget - r->iput - 1) % r->size; +} + +// Number of bytes available to read. +size_t ringbuf_num_filled(ringbuf_t *r) { + return (r->size + r->iput - r->iget) % r->size; +} + +// If the ring buffer fills up, not all bytes will be written. +// Returns how many bytes were successfully written. +size_t ringbuf_put_n(ringbuf_t* r, uint8_t* buf, size_t bufsize) +{ + for(size_t i=0; i < bufsize; i++) { + if ( ringbuf_put(r, buf[i]) < 0 ) { + // If ringbuf is full, give up and return how many bytes + // we wrote so far. + return i; + } + } + return bufsize; +} + +// Returns how many bytes were fetched. +size_t ringbuf_get_n(ringbuf_t* r, uint8_t* buf, size_t bufsize) +{ + for(size_t i=0; i < bufsize; i++) { + int b = ringbuf_get(r); + if (b < 0) { + return i; + } + buf[i] = b; + } + return bufsize; +} diff --git a/py/ringbuf.h b/py/ringbuf.h index 7fc35d2661..476bd428f9 100644 --- a/py/ringbuf.h +++ b/py/ringbuf.h @@ -32,78 +32,27 @@ typedef struct _ringbuf_t { uint8_t *buf; - uint16_t size; - uint16_t iget; - uint16_t iput; + // Allocated size; capacity is one less. Don't reference this directly. + uint32_t size; + uint32_t iget; + uint32_t iput; } ringbuf_t; +// Note that the capacity of the buffer is N-1! + // Static initialization: // byte buf_array[N]; // ringbuf_t buf = {buf_array, sizeof(buf_array)}; -// Dynamic initialization. This creates root pointer! -#define ringbuf_alloc(r, sz, long_lived) \ -{ \ - (r)->buf = gc_alloc(sz, false, long_lived); \ - (r)->size = sz; \ - (r)->iget = (r)->iput = 0; \ -} +bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived); +void ringbuf_free(ringbuf_t *r); +size_t ringbuf_capacity(ringbuf_t *r); +int ringbuf_get(ringbuf_t *r); +int ringbuf_put(ringbuf_t *r, uint8_t v); +void ringbuf_clear(ringbuf_t *r); +size_t ringbuf_num_empty(ringbuf_t *r); +size_t ringbuf_num_filled(ringbuf_t *r); +size_t ringbuf_put_n(ringbuf_t* r, uint8_t* buf, size_t bufsize); +size_t ringbuf_get_n(ringbuf_t* r, uint8_t* buf, size_t bufsize); -static inline int ringbuf_get(ringbuf_t *r) { - if (r->iget == r->iput) { - return -1; - } - uint8_t v = r->buf[r->iget++]; - if (r->iget >= r->size) { - r->iget = 0; - } - return v; -} - -static inline int ringbuf_put(ringbuf_t *r, uint8_t v) { - uint32_t iput_new = r->iput + 1; - if (iput_new >= r->size) { - iput_new = 0; - } - if (iput_new == r->iget) { - return -1; - } - r->buf[r->iput] = v; - r->iput = iput_new; - return 0; -} - -static inline uint16_t ringbuf_count(ringbuf_t *r) -{ - volatile int count = r->iput - r->iget; - if ( count < 0 ) { - count += r->size; - } - - return (uint16_t) count; -} - -static inline void ringbuf_clear(ringbuf_t *r) -{ - r->iput = r->iget = 0; -} - -// will overwrite old data -static inline void ringbuf_put_n(ringbuf_t* r, uint8_t* buf, uint8_t bufsize) -{ - for(uint8_t i=0; i < bufsize; i++) { - if ( ringbuf_put(r, buf[i]) < 0 ) { - // if full overwrite old data - (void) ringbuf_get(r); - ringbuf_put(r, buf[i]); - } - } -} - -static inline void ringbuf_get_n(ringbuf_t* r, uint8_t* buf, uint8_t bufsize) -{ - for(uint8_t i=0; i < bufsize; i++) { - buf[i] = ringbuf_get(r); - } -} #endif // MICROPY_INCLUDED_PY_RINGBUF_H diff --git a/shared-bindings/_bleio/CharacteristicBuffer.h b/shared-bindings/_bleio/CharacteristicBuffer.h index 83e6fef02f..e82e96ca96 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.h +++ b/shared-bindings/_bleio/CharacteristicBuffer.h @@ -32,7 +32,7 @@ extern const mp_obj_type_t bleio_characteristic_buffer_type; extern void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffer_obj_t *self, bleio_characteristic_obj_t *characteristic, mp_float_t timeout, size_t buffer_size); -int common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode); +uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode); uint32_t common_hal_bleio_characteristic_buffer_rx_characters_available(bleio_characteristic_buffer_obj_t *self); void common_hal_bleio_characteristic_buffer_clear_rx_buffer(bleio_characteristic_buffer_obj_t *self); bool common_hal_bleio_characteristic_buffer_deinited(bleio_characteristic_buffer_obj_t *self); diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index 2165f12b8e..93600e76d9 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -211,6 +211,25 @@ STATIC mp_obj_t bleio_connection_get_connection_interval(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_connection_interval_obj, bleio_connection_get_connection_interval); +//| .. attribute:: max_packet_length +//| +//| The maximum number of data bytes that can be sent in a single transmission, +//| not including overhead bytes. +//| +//| This is the maximum number of bytes that can be sent in a notification, +//| which must be sent in a single packet. +//| But for a regular characteristic read or write, may be sent in multiple packets, +//| so this limit does not apply. +//| +STATIC mp_obj_t bleio_connection_get_max_packet_length(mp_obj_t self_in) { + bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); + + bleio_connection_ensure_connected(self); + return mp_obj_new_int(common_hal_bleio_connection_get_max_packet_length(self->connection)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_max_packet_length_obj, bleio_connection_get_max_packet_length); + + STATIC mp_obj_t bleio_connection_set_connection_interval(mp_obj_t self_in, mp_obj_t interval_in) { bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -230,6 +249,13 @@ const mp_obj_property_t bleio_connection_connection_interval_obj = { (mp_obj_t)&mp_const_none_obj }, }; +const mp_obj_property_t bleio_connection_max_packet_length_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&bleio_connection_get_max_packet_length_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + STATIC const mp_rom_map_elem_t bleio_connection_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_pair), MP_ROM_PTR(&bleio_connection_pair_obj) }, @@ -240,7 +266,7 @@ STATIC const mp_rom_map_elem_t bleio_connection_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_connected), MP_ROM_PTR(&bleio_connection_connected_obj) }, { MP_ROM_QSTR(MP_QSTR_paired), MP_ROM_PTR(&bleio_connection_paired_obj) }, { MP_ROM_QSTR(MP_QSTR_connection_interval), MP_ROM_PTR(&bleio_connection_connection_interval_obj) }, - + { MP_ROM_QSTR(MP_QSTR_max_packet_length), MP_ROM_PTR(&bleio_connection_max_packet_length_obj) }, }; STATIC MP_DEFINE_CONST_DICT(bleio_connection_locals_dict, bleio_connection_locals_dict_table); diff --git a/shared-bindings/_bleio/Connection.h b/shared-bindings/_bleio/Connection.h index c6f2601608..a5313a9375 100644 --- a/shared-bindings/_bleio/Connection.h +++ b/shared-bindings/_bleio/Connection.h @@ -34,11 +34,12 @@ extern const mp_obj_type_t bleio_connection_type; -extern void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond); -extern void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self); -extern bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *self); -extern bool common_hal_bleio_connection_get_paired(bleio_connection_obj_t *self); -extern mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist); +void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond); +void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self); +bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *self); +mp_int_t common_hal_bleio_connection_get_max_packet_length(bleio_connection_internal_t *self); +bool common_hal_bleio_connection_get_paired(bleio_connection_obj_t *self); +mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist); mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_internal_t *self); void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval); diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 14efa022b3..80beadb158 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -43,8 +43,8 @@ //| //| Accumulates a Characteristic's incoming packets in a FIFO buffer and facilitates packet aware //| outgoing writes. A packet's size is either the characteristic length or the maximum transmission -//| unit (MTU), whichever is smaller. The MTU can change so check `packet_size` before creating a -//| buffer to store data. +//| unit (MTU) minus overhead, whichever is smaller. The MTU can change so check `incoming_packet_length` +//| and `outgoing_packet_length` before creating a buffer to store data. //| //| When we're the server, we ignore all connections besides the first to subscribe to //| notifications.""" @@ -53,11 +53,14 @@ //| """Monitor the given Characteristic. Each time a new value is written to the Characteristic //| add the newly-written bytes to a FIFO buffer. //| +//| Monitor the given Characteristic. Each time a new value is written to the Characteristic +//| add the newly-written packet of bytes to a FIFO buffer. +//| //| :param Characteristic characteristic: The Characteristic to monitor. //| It may be a local Characteristic provided by a Peripheral Service, or a remote Characteristic //| in a remote Service that a Central has connected to. //| :param int buffer_size: Size of ring buffer (in packets of the Characteristic's maximum -//| length) that stores incoming packets coming from the peer.""" +//| length) that stores incoming packets coming from the peer. //| ... //| STATIC mp_obj_t bleio_packet_buffer_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -72,7 +75,7 @@ STATIC mp_obj_t bleio_packet_buffer_make_new(const mp_obj_type_t *type, size_t n const mp_obj_t characteristic = args[ARG_characteristic].u_obj; - const int buffer_size = args[ARG_buffer_size].u_int; + const mp_int_t buffer_size = args[ARG_buffer_size].u_int; if (buffer_size < 1) { mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_buffer_size); } @@ -110,7 +113,7 @@ STATIC mp_obj_t bleio_packet_buffer_readinto(mp_obj_t self_in, mp_obj_t buffer_o mp_buffer_info_t bufinfo; mp_get_buffer_raise(buffer_obj, &bufinfo, MP_BUFFER_WRITE); - int size = common_hal_bleio_packet_buffer_readinto(self, bufinfo.buf, bufinfo.len); + mp_int_t size = common_hal_bleio_packet_buffer_readinto(self, bufinfo.buf, bufinfo.len); if (size < 0) { mp_raise_ValueError_varg(translate("Buffer too short by %d bytes"), size * -1); } @@ -126,6 +129,9 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_packet_buffer_readinto_obj, bleio_packet_ //| This does not block until the data is sent. It only blocks until the data is pending.""" //| ... //| +//| :return: number of bytes written. May include header bytes when packet is empty. +//| :rtype: int +//| // TODO: Add a kwarg `merge=False` to dictate whether subsequent writes are merged into a pending // one. STATIC mp_obj_t bleio_packet_buffer_write(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -150,9 +156,21 @@ STATIC mp_obj_t bleio_packet_buffer_write(mp_uint_t n_args, const mp_obj_t *pos_ mp_get_buffer_raise(args[ARG_header].u_obj, &header_bufinfo, MP_BUFFER_READ); } - common_hal_bleio_packet_buffer_write(self, data_bufinfo.buf, data_bufinfo.len, - header_bufinfo.buf, header_bufinfo.len); - return mp_const_none; + mp_int_t num_bytes_written = common_hal_bleio_packet_buffer_write( + self, data_bufinfo.buf, data_bufinfo.len, header_bufinfo.buf, header_bufinfo.len); + if (num_bytes_written < 0) { + // TODO: Raise an error if not connected. Right now the not-connected error + // is unreliable, because common_hal_bleio_packet_buffer_write() + // checks for conn_handle being set, but setting that + // can be delayed because conn_handle is discovered by spying on + // gatts write events, which may not have been sent yet. + // + // IDEAL: + // mp_raise_bleio_ConnectionError(translate("Not connected")); + // TEMPORARY: + num_bytes_written = 0; + } + return MP_OBJ_NEW_SMALL_INT(num_bytes_written); } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_packet_buffer_write_obj, 1, bleio_packet_buffer_write); @@ -167,31 +185,65 @@ STATIC mp_obj_t bleio_packet_buffer_deinit(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_deinit_obj, bleio_packet_buffer_deinit); //| packet_size: Any = ... -//| """Maximum size of each packet in bytes. This is the minimum of the Characteristic length and -//| the negotiated Maximum Transfer Unit (MTU).""" +//| """`packet_size` is the same as `incoming_packet_length`. +//| The name `packet_size` is deprecated and +//| will be removed in CircuitPython 6.0.0.""" //| -STATIC mp_obj_t bleio_packet_buffer_get_packet_size(mp_obj_t self_in) { +//| incoming_packet_length: Any = ... +//| """Maximum length in bytes of a packet we are reading.""" +//| +STATIC mp_obj_t bleio_packet_buffer_get_incoming_packet_length(mp_obj_t self_in) { bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); - return MP_OBJ_NEW_SMALL_INT(common_hal_bleio_packet_buffer_get_packet_size(self)); + mp_int_t size = common_hal_bleio_packet_buffer_get_incoming_packet_length(self); + if (size < 0) { + mp_raise_ValueError(translate("No connection: length cannot be determined")); + } + return MP_OBJ_NEW_SMALL_INT(size); } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_packet_size_obj, bleio_packet_buffer_get_packet_size); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_incoming_packet_length_obj, bleio_packet_buffer_get_incoming_packet_length); -const mp_obj_property_t bleio_packet_buffer_packet_size_obj = { +const mp_obj_property_t bleio_packet_buffer_incoming_packet_length_obj = { .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_packet_buffer_get_packet_size_obj, + .proxy = { (mp_obj_t)&bleio_packet_buffer_get_incoming_packet_length_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + +//| .. attribute:: outgoing_packet_length +//| +//| Maximum length in bytes of a packet we are writing. +//| +STATIC mp_obj_t bleio_packet_buffer_get_outgoing_packet_length(mp_obj_t self_in) { + bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); + + mp_int_t size = common_hal_bleio_packet_buffer_get_outgoing_packet_length(self); + if (size < 0) { + mp_raise_ValueError(translate("No connection: length cannot be determined")); + } + return MP_OBJ_NEW_SMALL_INT(size); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_outgoing_packet_length_obj, bleio_packet_buffer_get_outgoing_packet_length); + +const mp_obj_property_t bleio_packet_buffer_outgoing_packet_length_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&bleio_packet_buffer_get_outgoing_packet_length_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj }, }; STATIC const mp_rom_map_elem_t bleio_packet_buffer_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&bleio_packet_buffer_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&bleio_packet_buffer_deinit_obj) }, // Standard stream methods. - { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&bleio_packet_buffer_readinto_obj) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&bleio_packet_buffer_write_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&bleio_packet_buffer_readinto_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&bleio_packet_buffer_write_obj) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_packet_size), MP_ROM_PTR(&bleio_packet_buffer_packet_size_obj) }, + // .packet_size is now an alias for .incoming_packet_length + // TODO: Remove in 6.0.0. + { MP_OBJ_NEW_QSTR(MP_QSTR_packet_size), MP_ROM_PTR(&bleio_packet_buffer_incoming_packet_length_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_incoming_packet_length), MP_ROM_PTR(&bleio_packet_buffer_incoming_packet_length_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_outgoing_packet_length), MP_ROM_PTR(&bleio_packet_buffer_outgoing_packet_length_obj) }, }; STATIC MP_DEFINE_CONST_DICT(bleio_packet_buffer_locals_dict, bleio_packet_buffer_locals_dict_table); diff --git a/shared-bindings/_bleio/PacketBuffer.h b/shared-bindings/_bleio/PacketBuffer.h index 990a2f8bb0..769e0a0c78 100644 --- a/shared-bindings/_bleio/PacketBuffer.h +++ b/shared-bindings/_bleio/PacketBuffer.h @@ -34,9 +34,10 @@ extern const mp_obj_type_t bleio_packet_buffer_type; extern void common_hal_bleio_packet_buffer_construct( bleio_packet_buffer_obj_t *self, bleio_characteristic_obj_t *characteristic, size_t buffer_size); -void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len, uint8_t* header, size_t header_len); -int common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len); -uint16_t common_hal_bleio_packet_buffer_get_packet_size(bleio_packet_buffer_obj_t *self); +mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len, uint8_t* header, size_t header_len); +mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len); +mp_int_t common_hal_bleio_packet_buffer_get_incoming_packet_length(bleio_packet_buffer_obj_t *self); +mp_int_t common_hal_bleio_packet_buffer_get_outgoing_packet_length(bleio_packet_buffer_obj_t *self); bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self); void common_hal_bleio_packet_buffer_deinit(bleio_packet_buffer_obj_t *self); diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 1c0888802d..2d1f4fff2f 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -45,7 +45,7 @@ extern const int32_t colorwheel(float pos); static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t* parsed); //| class PixelBuf: -//| """.. currentmodule:: pixelbuf +//| """.. currentmodule:: _pixelbuf //| //| :class:`PixelBuf` -- A fast RGB[W] pixel buffer for LED and similar devices //| =========================================================================== @@ -63,7 +63,12 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t //| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte in the //| output buffer (``buf``). //| -//| :param ~int size: Number of pixelsx +//| When ``P`` (pwm duration) is present as the first character of the byteorder +//| string, the 4th value in the tuple/list for a pixel is the individual pixel +//| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte in the +//| output buffer (``buf``). +//| +//| :param ~int size: Number of pixels //| :param ~str byteorder: Byte order string (such as "BGR" or "PBGR") //| :param ~float brightness: Brightness (0 to 1.0, default 1.0) //| :param ~bool auto_write: Whether to automatically write pixels (Default False) diff --git a/shared-bindings/_pixelbuf/__init__.c b/shared-bindings/_pixelbuf/__init__.c index 3c04d436ad..30656f1c78 100644 --- a/shared-bindings/_pixelbuf/__init__.c +++ b/shared-bindings/_pixelbuf/__init__.c @@ -51,6 +51,8 @@ //| :maxdepth: 3 //| //| PixelBuf""" + +//| def colorwheel(n: Any) -> Any: ... //| //| def wheel(n: Any) -> Any: @@ -58,31 +60,34 @@ //| Returns the colorwheel RGB value as an integer value for n (usable in :py:class:`PixelBuf`, neopixel, and dotstar).""" //| ... //| +//| .. function:: wheel(n) +//| Use of wheel() is deprecated. Please use colorwheel(). -STATIC mp_obj_t pixelbuf_wheel(mp_obj_t n) { +STATIC mp_obj_t pixelbuf_colorwheel(mp_obj_t n) { return MP_OBJ_NEW_SMALL_INT(colorwheel(MP_OBJ_IS_SMALL_INT(n) ? MP_OBJ_SMALL_INT_VALUE(n) : mp_obj_float_get(n))); } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_wheel_obj, pixelbuf_wheel); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_colorwheel_obj, pixelbuf_colorwheel); const int32_t colorwheel(float pos) { if (pos > 255) { pos = pos - ((uint32_t)(pos / 256) * 256); } if (pos < 85) - return (uint8_t)(pos * 3) << 16 | (uint8_t)(255 - (pos * 3)) << 8; + return (uint8_t)(255 - (pos * 3)) << 16 | (uint8_t)(pos * 3) << 8; else if (pos < 170) { pos -= 85; - return (uint8_t)(255 - (pos * 3)) << 16 | (uint8_t)(pos * 3); + return (uint8_t)(255 - (pos * 3)) << 8 | (uint8_t)(pos * 3); } else { pos -= 170; - return (uint8_t)(pos * 3) << 8 | (uint8_t)(255 - pos * 3); + return (uint8_t)(pos * 3) << 16 | (uint8_t)(255 - (pos * 3)); } } STATIC const mp_rom_map_elem_t pixelbuf_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__pixelbuf) }, { MP_ROM_QSTR(MP_QSTR_PixelBuf), MP_ROM_PTR(&pixelbuf_pixelbuf_type) }, - { MP_ROM_QSTR(MP_QSTR_wheel), MP_ROM_PTR(&pixelbuf_wheel_obj) }, + { MP_ROM_QSTR(MP_QSTR_wheel), MP_ROM_PTR(&pixelbuf_colorwheel_obj) }, + { MP_ROM_QSTR(MP_QSTR_colorwheel), MP_ROM_PTR(&pixelbuf_colorwheel_obj) }, }; STATIC MP_DEFINE_CONST_DICT(pixelbuf_module_globals, pixelbuf_module_globals_table); diff --git a/shared-bindings/aesio/__init__.c b/shared-bindings/aesio/__init__.c new file mode 100644 index 0000000000..43dc73e8b1 --- /dev/null +++ b/shared-bindings/aesio/__init__.c @@ -0,0 +1,79 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/obj.h" +#include "py/runtime.h" + +#include "__init__.h" + +//| :mod:`aesio` --- AES encryption routines +//| ======================================== +//| +//| .. module:: aesio +//| :synopsis: Embedded implementation of AES +//| +//| The `AES` module contains classes used to implement encryption +//| and decryption. It aims to be low overhead in terms of memory. +//| +//| + +//| Libraries +//| +//| .. toctree:: +//| :maxdepth: 3 +//| +//| aes + + +STATIC const mp_obj_tuple_t mp_aes_key_size_obj = { + {&mp_type_tuple}, + 3, + { + MP_OBJ_NEW_SMALL_INT(16), + MP_OBJ_NEW_SMALL_INT(24), + MP_OBJ_NEW_SMALL_INT(32), + } +}; + +STATIC const mp_rom_map_elem_t aesio_module_globals_table[] = { + {MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_aesio)}, + {MP_ROM_QSTR(MP_QSTR_AES), MP_ROM_PTR(&aesio_aes_type) }, + {MP_ROM_QSTR(MP_QSTR_MODE_ECB), MP_ROM_INT(AES_MODE_ECB)}, + {MP_ROM_QSTR(MP_QSTR_MODE_CBC), MP_ROM_INT(AES_MODE_CBC)}, + {MP_ROM_QSTR(MP_QSTR_MODE_CTR), MP_ROM_INT(AES_MODE_CTR)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(AES_BLOCKLEN)}, + {MP_ROM_QSTR(MP_QSTR_key_size), (mp_obj_t)&mp_aes_key_size_obj}, +}; + +STATIC MP_DEFINE_CONST_DICT(aesio_module_globals, aesio_module_globals_table); + +const mp_obj_module_t aesio_module = { + .base = {&mp_type_module}, + .globals = (mp_obj_dict_t *)&aesio_module_globals, +}; + diff --git a/ports/mimxrt10xx/tick.h b/shared-bindings/aesio/__init__.h similarity index 50% rename from ports/mimxrt10xx/tick.h rename to shared-bindings/aesio/__init__.h index 6660d5b4ae..634fed2e54 100644 --- a/ports/mimxrt10xx/tick.h +++ b/shared-bindings/aesio/__init__.h @@ -1,10 +1,9 @@ /* - * This file is part of the MicroPython project, http://micropython.org/ + * This file is part of the Micro Python project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2019 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,20 +23,31 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_MIMXRT10XX_TICK_H -#define MICROPY_INCLUDED_MIMXRT10XX_TICK_H -#include "py/mpconfig.h" +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_AESIO_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_AESIO_H -extern struct timer_descriptor ms_timer; +#include "shared-module/aesio/__init__.h" -void tick_init(void); +extern const mp_obj_type_t aesio_aes_type; -void tick_delay(uint32_t us); +void common_hal_aesio_aes_construct(aesio_aes_obj_t* self, + const uint8_t* key, + uint32_t key_length, + const uint8_t* iv, + int mode, + int counter); +void common_hal_aesio_aes_rekey(aesio_aes_obj_t* self, + const uint8_t* key, + uint32_t key_length, + const uint8_t* iv); +void common_hal_aesio_aes_set_mode(aesio_aes_obj_t* self, + int mode); +void common_hal_aesio_aes_encrypt(aesio_aes_obj_t* self, + uint8_t* buffer, + size_t len); +void common_hal_aesio_aes_decrypt(aesio_aes_obj_t* self, + uint8_t* buffer, + size_t len); -void current_tick(uint64_t* ms, uint32_t* us_until_ms); -// Do not call this with interrupts disabled because it may be waiting for -// ticks_ms to increment. -void wait_until(uint64_t ms, uint32_t us_until_ms); - -#endif // MICROPY_INCLUDED_MIMXRT10XX_TICK_H +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_AESIO_H diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c new file mode 100644 index 0000000000..4ddcfa898b --- /dev/null +++ b/shared-bindings/aesio/aes.c @@ -0,0 +1,271 @@ +#include +#include + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" + +#include "shared-bindings/aesio/__init__.h" + +// Defined at the end of this file + +//| .. currentmodule:: aesio +//| +//| :class:`aesio` -- Encrypt and decrypt AES streams +//| ===================================================== +//| +//| An object that represents an AES stream, including the current state. +//| +//| .. class:: AES(key, mode=0, iv=None, segment_size=8) +//| +//| Create a new AES state with the given key. +//| +//| :param bytearray key: A 16-, 24-, or 32-byte key +//| :param int mode: AES mode to use. One of: AES.MODE_ECB, AES.MODE_CBC, or +//| AES.MODE_CTR +//| :param bytearray iv: Initialization vector to use for CBC or CTR mode +//| +//| Additional arguments are supported for legacy reasons. +//| +//| Encrypting a string:: +//| +//| import aesio +//| from binascii import hexlify +//| +//| key = b'Sixteen byte key' +//| inp = b'Circuit Python!!' # Note: 16-bytes long +//| outp = bytearray(len(inp)) +//| cipher = aesio.AES(key, aesio.mode.MODE_ECB) +//| cipher.encrypt_into(inp, outp) +//| hexlify(outp) +//| + +STATIC mp_obj_t aesio_aes_make_new(const mp_obj_type_t *type, size_t n_args, + const mp_obj_t *pos_args, + mp_map_t *kw_args) { + (void)type; + enum { ARG_key, ARG_mode, ARG_IV, ARG_counter, ARG_segment_size }; + static const mp_arg_t allowed_args[] = { + {MP_QSTR_key, MP_ARG_OBJ | MP_ARG_REQUIRED}, + {MP_QSTR_mode, MP_ARG_INT, {.u_int = AES_MODE_ECB}}, + {MP_QSTR_IV, MP_ARG_OBJ}, + {MP_QSTR_counter, MP_ARG_OBJ}, + {MP_QSTR_segment_size, MP_ARG_INT, {.u_int = 8}}, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), + allowed_args, args); + + aesio_aes_obj_t *self = m_new_obj(aesio_aes_obj_t); + self->base.type = &aesio_aes_type; + + mp_buffer_info_t bufinfo; + + const uint8_t *key = NULL; + uint32_t key_length = 0; + if (mp_get_buffer(args[ARG_key].u_obj, &bufinfo, MP_BUFFER_READ)) { + if ((bufinfo.len != 16) && (bufinfo.len != 24) && (bufinfo.len != 32)) { + mp_raise_TypeError(translate("Key must be 16, 24, or 32 bytes long")); + } + key = bufinfo.buf; + key_length = bufinfo.len; + } else { + mp_raise_TypeError(translate("No key was specified")); + } + + int mode = args[ARG_mode].u_int; + switch (args[ARG_mode].u_int) { + case AES_MODE_CBC: + case AES_MODE_ECB: + case AES_MODE_CTR: + break; + default: + mp_raise_TypeError(translate("Requested AES mode is unsupported")); + } + + // IV is required for CBC mode and is ignored for other modes. + const uint8_t *iv = NULL; + if (args[ARG_IV].u_obj != NULL && + mp_get_buffer(args[ARG_IV].u_obj, &bufinfo, MP_BUFFER_READ)) { + if (bufinfo.len != AES_BLOCKLEN) { + mp_raise_TypeError_varg(translate("IV must be %d bytes long"), + AES_BLOCKLEN); + } + iv = bufinfo.buf; + } + + common_hal_aesio_aes_construct(self, key, key_length, iv, mode, + args[ARG_counter].u_int); + return MP_OBJ_FROM_PTR(self); +} + +STATIC mp_obj_t aesio_aes_rekey(size_t n_args, const mp_obj_t *pos_args) { + aesio_aes_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + + size_t key_length = 0; + const uint8_t *key = + (const uint8_t *)mp_obj_str_get_data(pos_args[1], &key_length); + if (key == NULL) { + mp_raise_ValueError(translate("No key was specified")); + } + if ((key_length != 16) && (key_length != 24) && (key_length != 32)) { + mp_raise_TypeError(translate("Key must be 16, 24, or 32 bytes long")); + } + + const uint8_t *iv = NULL; + if (n_args > 2) { + size_t iv_length = 0; + iv = (const uint8_t *)mp_obj_str_get_data(pos_args[2], &iv_length); + if (iv_length != AES_BLOCKLEN) { + mp_raise_TypeError_varg(translate("IV must be %d bytes long"), + AES_BLOCKLEN); + } + } + + common_hal_aesio_aes_rekey(self, key, key_length, iv); + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_VAR(aesio_aes_rekey_obj, 2, aesio_aes_rekey); + +STATIC void validate_length(aesio_aes_obj_t *self, size_t src_length, + size_t dest_length) { + if (src_length != dest_length) { + mp_raise_ValueError( + translate("Source and destination buffers must be the same length")); + } + + switch (self->mode) { + case AES_MODE_ECB: + if (src_length != 16) { + mp_raise_msg(&mp_type_ValueError, + translate("ECB only operates on 16 bytes at a time")); + } + break; + case AES_MODE_CBC: + if ((src_length & 15) != 0) { + mp_raise_msg(&mp_type_ValueError, + translate("CBC blocks must be multiples of 16 bytes")); + } + break; + case AES_MODE_CTR: + break; + } +} + +//| .. method:: encrypt_into(src, dest) +//| +//| Encrypt the buffer from ``src`` into ``dest``. +//| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the +//| buffers must be a multiple of 16 bytes, and must be equal length. For +//| CTX mode, there are no restrictions. +//| +STATIC mp_obj_t aesio_aes_encrypt_into(mp_obj_t aesio_obj, mp_obj_t src, + mp_obj_t dest) { + if (!MP_OBJ_IS_TYPE(aesio_obj, &aesio_aes_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), aesio_aes_type.name); + } + // Convert parameters into expected types. + aesio_aes_obj_t *aes = MP_OBJ_TO_PTR(aesio_obj); + + mp_buffer_info_t srcbufinfo, destbufinfo; + mp_get_buffer_raise(src, &srcbufinfo, MP_BUFFER_READ); + mp_get_buffer_raise(dest, &destbufinfo, MP_BUFFER_READ); + validate_length(aes, srcbufinfo.len, destbufinfo.len); + + memcpy(destbufinfo.buf, srcbufinfo.buf, srcbufinfo.len); + + common_hal_aesio_aes_encrypt(aes, (uint8_t *)destbufinfo.buf, + destbufinfo.len); + return mp_const_none; +} + +STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_encrypt_into_obj, + aesio_aes_encrypt_into); + +//| .. method:: decrypt_into(src, dest) +//| +//| Decrypt the buffer from ``src`` into ``dest``. +//| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the +//| buffers must be a multiple of 16 bytes, and must be equal length. For +//| CTX mode, there are no restrictions. +//| +STATIC mp_obj_t aesio_aes_decrypt_into(mp_obj_t aesio_obj, mp_obj_t src, + mp_obj_t dest) { + if (!MP_OBJ_IS_TYPE(aesio_obj, &aesio_aes_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), aesio_aes_type.name); + } + // Convert parameters into expected types. + aesio_aes_obj_t *aes = MP_OBJ_TO_PTR(aesio_obj); + + mp_buffer_info_t srcbufinfo, destbufinfo; + mp_get_buffer_raise(src, &srcbufinfo, MP_BUFFER_READ); + mp_get_buffer_raise(dest, &destbufinfo, MP_BUFFER_READ); + validate_length(aes, srcbufinfo.len, destbufinfo.len); + + memcpy(destbufinfo.buf, srcbufinfo.buf, srcbufinfo.len); + + common_hal_aesio_aes_decrypt(aes, (uint8_t *)destbufinfo.buf, + destbufinfo.len); + return mp_const_none; +} + +STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_decrypt_into_obj, + aesio_aes_decrypt_into); + +STATIC mp_obj_t aesio_aes_get_mode(mp_obj_t aesio_obj) { + if (!MP_OBJ_IS_TYPE(aesio_obj, &aesio_aes_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), aesio_aes_type.name); + } + aesio_aes_obj_t *self = MP_OBJ_TO_PTR(aesio_obj); + return MP_OBJ_NEW_SMALL_INT(self->mode); +} +MP_DEFINE_CONST_FUN_OBJ_1(aesio_aes_get_mode_obj, aesio_aes_get_mode); + +STATIC mp_obj_t aesio_aes_set_mode(mp_obj_t aesio_obj, mp_obj_t mode_obj) { + if (!MP_OBJ_IS_TYPE(aesio_obj, &aesio_aes_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), aesio_aes_type.name); + } + aesio_aes_obj_t *self = MP_OBJ_TO_PTR(aesio_obj); + + int mode = mp_obj_get_int(mode_obj); + switch (mode) { + case AES_MODE_CBC: + case AES_MODE_ECB: + case AES_MODE_CTR: + break; + default: + mp_raise_TypeError(translate("Requested AES mode is unsupported")); + } + + common_hal_aesio_aes_set_mode(self, mode); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(aesio_aes_set_mode_obj, aesio_aes_set_mode); + +const mp_obj_property_t aesio_aes_mode_obj = { + .base.type = &mp_type_property, + .proxy = { + (mp_obj_t)&aesio_aes_get_mode_obj, + (mp_obj_t)&aesio_aes_set_mode_obj, + (mp_obj_t)&mp_const_none_obj + }, +}; + +STATIC const mp_rom_map_elem_t aesio_locals_dict_table[] = { + // Methods + {MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_AES)}, + {MP_ROM_QSTR(MP_QSTR_encrypt_into), (mp_obj_t)&aesio_aes_encrypt_into_obj}, + {MP_ROM_QSTR(MP_QSTR_decrypt_into), (mp_obj_t)&aesio_aes_decrypt_into_obj}, + {MP_ROM_QSTR(MP_QSTR_rekey), (mp_obj_t)&aesio_aes_rekey_obj}, + {MP_ROM_QSTR(MP_QSTR_mode), (mp_obj_t)&aesio_aes_mode_obj}, +}; +STATIC MP_DEFINE_CONST_DICT(aesio_locals_dict, aesio_locals_dict_table); + +const mp_obj_type_t aesio_aes_type = { + {&mp_type_type}, + .name = MP_QSTR_AES, + .make_new = aesio_aes_make_new, + .locals_dict = (mp_obj_dict_t *)&aesio_locals_dict, +}; diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 501879be80..77675e0937 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -112,7 +112,7 @@ mp_obj_t board_uart(void) { } #else mp_obj_t board_uart(void) { - mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_SPI); + mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_UART); return NULL; } #endif diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 6a3d542e1c..5984194a9a 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -39,6 +39,9 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" +#define STREAM_DEBUG(...) (void)0 +// #define STREAM_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + //| class UART: //| """.. currentmodule:: busio //| @@ -220,6 +223,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ // These three methods are used by the shared stream methods. STATIC mp_uint_t busio_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, int *errcode) { + STREAM_DEBUG("busio_uart_read stream %d\n", size); busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); byte *buf = buf_in; diff --git a/shared-bindings/neopixel_write/__init__.h b/shared-bindings/neopixel_write/__init__.h index 39b565ee2f..9799e3413d 100644 --- a/shared-bindings/neopixel_write/__init__.h +++ b/shared-bindings/neopixel_write/__init__.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef SAMD_NEOPIXEL_WRITE_H -#define SAMD_NEOPIXEL_WRITE_H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_NEOPIXEL_WRITE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_NEOPIXEL_WRITE_H #include #include @@ -34,4 +34,4 @@ extern void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* gpio, uint8_t *pixels, uint32_t numBytes); -#endif +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_NEOPIXEL_WRITE_H diff --git a/shared-bindings/rtc/RTC.c b/shared-bindings/rtc/RTC.c index 8a3e89d732..663f5be6cb 100644 --- a/shared-bindings/rtc/RTC.c +++ b/shared-bindings/rtc/RTC.c @@ -69,7 +69,7 @@ STATIC mp_obj_t rtc_rtc_make_new(const mp_obj_type_t *type, size_t n_args, const //| import time //| //| r = rtc.RTC() -//| r.datetime = rtctime.struct_time((2019, 5, 29, 15, 14, 15, 0, -1, -1)) +//| r.datetime = time.struct_time((2019, 5, 29, 15, 14, 15, 0, -1, -1)) //| //| //| Once set, the RTC will automatically update this value as time passes. You can read this diff --git a/shared-module/_bleio/ScanResults.c b/shared-module/_bleio/ScanResults.c index 7ea0c165f4..ae36f8863d 100644 --- a/shared-module/_bleio/ScanResults.c +++ b/shared-module/_bleio/ScanResults.c @@ -45,10 +45,10 @@ bleio_scanresults_obj_t* shared_module_bleio_new_scanresults(size_t buffer_size, } mp_obj_t common_hal_bleio_scanresults_next(bleio_scanresults_obj_t *self) { - while (ringbuf_count(&self->buf) == 0 && !self->done && !mp_hal_is_interrupted()) { + while (ringbuf_num_filled(&self->buf) == 0 && !self->done && !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; } - if (ringbuf_count(&self->buf) == 0 || mp_hal_is_interrupted()) { + if (ringbuf_num_filled(&self->buf) == 0 || mp_hal_is_interrupted()) { return mp_const_none; } @@ -97,7 +97,7 @@ void shared_module_bleio_scanresults_append(bleio_scanresults_obj_t* self, uint16_t len) { int32_t packet_size = sizeof(uint8_t) + sizeof(ticks_ms) + sizeof(rssi) + NUM_BLEIO_ADDRESS_BYTES + sizeof(addr_type) + sizeof(len) + len; - int32_t empty_space = self->buf.size - ringbuf_count(&self->buf); + int32_t empty_space = self->buf.size - ringbuf_num_filled(&self->buf); if (packet_size >= empty_space) { // We can't fit the packet so skip it. return; diff --git a/shared-module/aesio/__init__.c b/shared-module/aesio/__init__.c new file mode 100644 index 0000000000..2cacaeb66e --- /dev/null +++ b/shared-module/aesio/__init__.c @@ -0,0 +1,58 @@ +#include + +#include "py/runtime.h" + +#include "shared-bindings/aesio/__init__.h" +#include "shared-module/aesio/__init__.h" + +void common_hal_aesio_aes_construct(aesio_aes_obj_t *self, const uint8_t *key, + uint32_t key_length, const uint8_t *iv, + int mode, int counter) { + self->mode = mode; + self->counter = counter; + common_hal_aesio_aes_rekey(self, key, key_length, iv); +} + +void common_hal_aesio_aes_rekey(aesio_aes_obj_t *self, const uint8_t *key, + uint32_t key_length, const uint8_t *iv) { + memset(&self->ctx, 0, sizeof(self->ctx)); + if (iv != NULL) { + AES_init_ctx_iv(&self->ctx, key, key_length, iv); + } else { + AES_init_ctx(&self->ctx, key, key_length); + } +} + +void common_hal_aesio_aes_set_mode(aesio_aes_obj_t *self, int mode) { + self->mode = mode; +} + +void common_hal_aesio_aes_encrypt(aesio_aes_obj_t *self, uint8_t *buffer, + size_t length) { + switch (self->mode) { + case AES_MODE_ECB: + AES_ECB_encrypt(&self->ctx, buffer); + break; + case AES_MODE_CBC: + AES_CBC_encrypt_buffer(&self->ctx, buffer, length); + break; + case AES_MODE_CTR: + AES_CTR_xcrypt_buffer(&self->ctx, buffer, length); + break; + } +} + +void common_hal_aesio_aes_decrypt(aesio_aes_obj_t *self, uint8_t *buffer, + size_t length) { + switch (self->mode) { + case AES_MODE_ECB: + AES_ECB_decrypt(&self->ctx, buffer); + break; + case AES_MODE_CBC: + AES_CBC_decrypt_buffer(&self->ctx, buffer, length); + break; + case AES_MODE_CTR: + AES_CTR_xcrypt_buffer(&self->ctx, buffer, length); + break; + } +} diff --git a/ports/mimxrt10xx/common-hal/time/__init__.c b/shared-module/aesio/__init__.h similarity index 60% rename from ports/mimxrt10xx/common-hal/time/__init__.c rename to shared-module/aesio/__init__.h index 524e31d1ae..1a0bb86967 100644 --- a/ports/mimxrt10xx/common-hal/time/__init__.c +++ b/shared-module/aesio/__init__.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2018 Dan Halbert for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,26 +24,36 @@ * THE SOFTWARE. */ -#include "py/mphal.h" +#ifndef MICROPY_INCLUDED_SHARED_MODULE_AESIO__INIT__H +#define MICROPY_INCLUDED_SHARED_MODULE_AESIO__INIT__H -#include "shared-bindings/time/__init__.h" +#include +#include -#include "supervisor/shared/tick.h" +#include "py/obj.h" +#include "py/proto.h" -#include "tick.h" +#include "shared-module/aesio/aes.h" -inline uint64_t common_hal_time_monotonic(void) { - return supervisor_ticks_ms64(); -} +// These values were chosen to correspond with the values +// present in pycrypto. +enum AES_MODE { + AES_MODE_ECB = 1, + AES_MODE_CBC = 2, + AES_MODE_CTR = 6, +}; -uint64_t common_hal_time_monotonic_ns(void) { - uint64_t ms; - uint32_t us_until_ms; - current_tick(&ms, &us_until_ms); - // us counts down. - return 1000 * (ms * 1000 + (1000 - us_until_ms)); -} +typedef struct { + mp_obj_base_t base; -void common_hal_time_delay_ms(uint32_t delay) { - mp_hal_delay_ms(delay); -} + // The tinyaes context + struct AES_ctx ctx; + + // Which AES mode this instance of the object is configured to use + enum AES_MODE mode; + + // Counter for running in CTR mode + uint32_t counter; +} aesio_aes_obj_t; + +#endif // MICROPY_INCLUDED_SHARED_MODULE_AESIO__INIT__H diff --git a/shared-module/aesio/aes.c b/shared-module/aesio/aes.c new file mode 100644 index 0000000000..b62b5afc48 --- /dev/null +++ b/shared-module/aesio/aes.c @@ -0,0 +1,608 @@ +/* + +This is an implementation of the AES algorithm, specifically ECB, CTR and CBC mode. +Block size can be chosen in aes.h - available choices are AES128, AES192, AES256. + +The implementation is verified against the test vectors in: + National Institute of Standards and Technology Special Publication 800-38A 2001 ED + +ECB-AES128 +---------- + + plain-text: + 6bc1bee22e409f96e93d7e117393172a + ae2d8a571e03ac9c9eb76fac45af8e51 + 30c81c46a35ce411e5fbc1191a0a52ef + f69f2445df4f9b17ad2b417be66c3710 + + key: + 2b7e151628aed2a6abf7158809cf4f3c + + resulting cipher + 3ad77bb40d7a3660a89ecaf32466ef97 + f5d3d58503b9699de785895a96fdbaaf + 43b1cd7f598ece23881b00e3ed030688 + 7b0c785e27e8ad3f8223207104725dd4 + + +NOTE: String length must be evenly divisible by 16byte (str_len % 16 == 0) + You should pad the end of the string with zeros if this is not the case. + For AES192/256 the key size is proportionally larger. + +*/ + +/*****************************************************************************/ +/* Includes: */ +/*****************************************************************************/ +#include // CBC mode, for memset +#include "aes.h" + +/*****************************************************************************/ +/* Defines: */ +/*****************************************************************************/ +// The number of columns comprising a state in AES. This is a constant in AES. +// Value=4 +#define Nb 4UL + +#if defined(AES256) && (AES256 == 1) + #define Nk256 8UL + #define Nr256 14UL +#endif +#if defined(AES192) && (AES192 == 1) + #define Nk192 6UL + #define Nr192 12UL +#endif +#if defined(AES128) && (AES128 == 1) + #define Nk128 4UL // The number of 32 bit words in a key. + #define Nr128 10UL // The number of rounds in AES Cipher. +#endif + +// jcallan@github points out that declaring Multiply as a function reduces code +// size considerably with the Keil ARM compiler. See this link for more +// information: https://github.com/kokke/tiny-AES-C/pull/3 +#ifndef MULTIPLY_AS_A_FUNCTION + #define MULTIPLY_AS_A_FUNCTION 0 +#endif + + + + +/*****************************************************************************/ +/* Private variables: */ +/*****************************************************************************/ +// state - array holding the intermediate results during decryption. +typedef uint8_t state_t[4][4]; + + + +// The lookup-tables are marked const so they can be placed in read-only storage +// instead of RAM The numbers below can be computed dynamically trading ROM for +// RAM - This can be useful in (embedded) bootloader applications, where ROM is +// often limited. +static const uint8_t sbox[256] = { + //0 1 2 3 4 5 6 7 8 9 A B C D E F + 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, + 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, + 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, + 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, + 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, + 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, + 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, + 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, + 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, + 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, + 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, + 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, + 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, + 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, + 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, + 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 }; + +static const uint8_t rsbox[256] = { + 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, + 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, + 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, + 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, + 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, + 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, + 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, + 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, + 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, + 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, + 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, + 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, + 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, + 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, + 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d }; + +// The round constant word array, Rcon[i], contains the values given by x to the +// power (i-1) being powers of x (x is denoted as {02}) in the field GF(2^8) +static const uint8_t Rcon[11] = { + 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36 }; + +/* + * Jordan Goulder points out in PR #12 + * (https://github.com/kokke/tiny-AES-C/pull/12), that you can remove most of + * the elements in the Rcon array, because they are unused. + * + * From Wikipedia's article on the Rijndael key schedule @ + * https://en.wikipedia.org/wiki/Rijndael_key_schedule#Rcon + * + * "Only the first some of these constants are actually used – up to rcon[10] + * for AES-128 (as 11 round keys are needed), up to rcon[8] for AES-192, up to + * rcon[7] for AES-256. rcon[0] is not used in AES algorithm." + */ + + +/*****************************************************************************/ +/* Private functions: */ +/*****************************************************************************/ +static const uint8_t *GetRoundKey(const struct AES_ctx *ctx) { + switch (ctx->KeyLength) { +#if defined(AES128) && (AES128 == 1) + case 16: return ctx->RoundKey128; +#endif +#if defined(AES192) && (AES192 == 1) + case 24: return ctx->RoundKey192; +#endif +#if defined(AES256) && (AES256 == 1) + case 32: return ctx->RoundKey256; +#endif + } + return NULL; +} + + +/* +static uint8_t getSBoxValue(uint8_t num) +{ + return sbox[num]; +} +*/ +#define getSBoxValue(num) (sbox[(num)]) +/* +static uint8_t getSBoxInvert(uint8_t num) +{ + return rsbox[num]; +} +*/ +#define getSBoxInvert(num) (rsbox[(num)]) + +// This function produces Nb(Nr+1) round keys. The round keys are used in each +// round to decrypt the states. +static void KeyExpansion(struct AES_ctx* ctx, const uint8_t* Key) +{ + uint8_t* RoundKey = (uint8_t *)GetRoundKey(ctx); + + unsigned i, j, k; + uint8_t tempa[4]; // Used for the column/row operations + + // The first round key is the key itself. + for (i = 0; i < ctx->Nk; ++i) + { + RoundKey[(i * 4) + 0] = Key[(i * 4) + 0]; + RoundKey[(i * 4) + 1] = Key[(i * 4) + 1]; + RoundKey[(i * 4) + 2] = Key[(i * 4) + 2]; + RoundKey[(i * 4) + 3] = Key[(i * 4) + 3]; + } + + // All other round keys are found from the previous round keys. + for (i = ctx->Nk; i < Nb * (ctx->Nr + 1); ++i) + { + { + k = (i - 1) * 4; + tempa[0]=RoundKey[k + 0]; + tempa[1]=RoundKey[k + 1]; + tempa[2]=RoundKey[k + 2]; + tempa[3]=RoundKey[k + 3]; + + } + + if (i % ctx->Nk == 0) + { + // This function shifts the 4 bytes in a word to the left once. + // [a0,a1,a2,a3] becomes [a1,a2,a3,a0] + + // Function RotWord() + { + const uint8_t u8tmp = tempa[0]; + tempa[0] = tempa[1]; + tempa[1] = tempa[2]; + tempa[2] = tempa[3]; + tempa[3] = u8tmp; + } + + // SubWord() is a function that takes a four-byte input word and applies + // the S-box to each of the four bytes to produce an output word. + + // Function Subword() + { + tempa[0] = getSBoxValue(tempa[0]); + tempa[1] = getSBoxValue(tempa[1]); + tempa[2] = getSBoxValue(tempa[2]); + tempa[3] = getSBoxValue(tempa[3]); + } + + tempa[0] = tempa[0] ^ Rcon[i/ctx->Nk]; + } +#if defined(AES256) && (AES256 == 1) + if (ctx->KeyLength == 32) { + if (i % ctx->Nk == 4) + { + // Function Subword() + { + tempa[0] = getSBoxValue(tempa[0]); + tempa[1] = getSBoxValue(tempa[1]); + tempa[2] = getSBoxValue(tempa[2]); + tempa[3] = getSBoxValue(tempa[3]); + } + } + } +#endif + j = i * 4; k=(i - ctx->Nk) * 4; + RoundKey[j + 0] = RoundKey[k + 0] ^ tempa[0]; + RoundKey[j + 1] = RoundKey[k + 1] ^ tempa[1]; + RoundKey[j + 2] = RoundKey[k + 2] ^ tempa[2]; + RoundKey[j + 3] = RoundKey[k + 3] ^ tempa[3]; + } +} + +void AES_init_ctx(struct AES_ctx* ctx, const uint8_t* key, uint32_t keylen) +{ + ctx->KeyLength = keylen; + switch (ctx->KeyLength) { +#if defined(AES128) && (AES128 == 1) + case 16: ctx->Nr = Nr128; ctx->Nk = Nk128; break; +#endif +#if defined(AES192) && (AES192 == 1) + case 24: ctx->Nr = Nr192; ctx->Nk = Nk192; break; +#endif +#if defined(AES256) && (AES256 == 1) + case 32: ctx->Nr = Nr256; ctx->Nk = Nk256; break; +#endif + default: ctx->Nr = 0; ctx->Nk = 0; break; + } + KeyExpansion(ctx, key); +} +#if (defined(CBC) && (CBC == 1)) || (defined(CTR) && (CTR == 1)) +void AES_init_ctx_iv(struct AES_ctx* ctx, const uint8_t* key, uint32_t keylen, const uint8_t* iv) +{ + AES_init_ctx(ctx, key, keylen); + memcpy (ctx->Iv, iv, AES_BLOCKLEN); +} +void AES_ctx_set_iv(struct AES_ctx* ctx, const uint8_t* iv) +{ + memcpy (ctx->Iv, iv, AES_BLOCKLEN); +} +#endif + +// This function adds the round key to state. The round key is added to the +// state by an XOR function. +static void AddRoundKey(uint8_t round, state_t* state, const uint8_t* RoundKey) +{ + uint8_t i,j; + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + (*state)[i][j] ^= RoundKey[(round * Nb * 4) + (i * Nb) + j]; + } + } +} + +// The SubBytes Function Substitutes the values in the state matrix with values +// in an S-box. +static void SubBytes(state_t* state) +{ + uint8_t i, j; + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + (*state)[j][i] = getSBoxValue((*state)[j][i]); + } + } +} + +// The ShiftRows() function shifts the rows in the state to the left. Each row +// is shifted with different offset. Offset = Row number. So the first row is +// not shifted. +static void ShiftRows(state_t* state) +{ + uint8_t temp; + + // Rotate first row 1 columns to left + temp = (*state)[0][1]; + (*state)[0][1] = (*state)[1][1]; + (*state)[1][1] = (*state)[2][1]; + (*state)[2][1] = (*state)[3][1]; + (*state)[3][1] = temp; + + // Rotate second row 2 columns to left + temp = (*state)[0][2]; + (*state)[0][2] = (*state)[2][2]; + (*state)[2][2] = temp; + + temp = (*state)[1][2]; + (*state)[1][2] = (*state)[3][2]; + (*state)[3][2] = temp; + + // Rotate third row 3 columns to left + temp = (*state)[0][3]; + (*state)[0][3] = (*state)[3][3]; + (*state)[3][3] = (*state)[2][3]; + (*state)[2][3] = (*state)[1][3]; + (*state)[1][3] = temp; +} + +static uint8_t xtime(uint8_t x) +{ + return ((x<<1) ^ (((x>>7) & 1) * 0x1b)); +} + +// MixColumns function mixes the columns of the state matrix +static void MixColumns(state_t* state) +{ + uint8_t i; + uint8_t Tmp, Tm, t; + for (i = 0; i < 4; ++i) + { + t = (*state)[i][0]; + Tmp = (*state)[i][0] ^ (*state)[i][1] ^ (*state)[i][2] ^ (*state)[i][3] ; + Tm = (*state)[i][0] ^ (*state)[i][1] ; Tm = xtime(Tm); (*state)[i][0] ^= Tm ^ Tmp ; + Tm = (*state)[i][1] ^ (*state)[i][2] ; Tm = xtime(Tm); (*state)[i][1] ^= Tm ^ Tmp ; + Tm = (*state)[i][2] ^ (*state)[i][3] ; Tm = xtime(Tm); (*state)[i][2] ^= Tm ^ Tmp ; + Tm = (*state)[i][3] ^ t ; Tm = xtime(Tm); (*state)[i][3] ^= Tm ^ Tmp ; + } +} + +// Multiply is used to multiply numbers in the field GF(2^8) +// Note: The last call to xtime() is unneeded, but often ends up generating a smaller binary +// The compiler seems to be able to vectorize the operation better this way. +// See https://github.com/kokke/tiny-AES-c/pull/34 +#if MULTIPLY_AS_A_FUNCTION +static uint8_t Multiply(uint8_t x, uint8_t y) +{ + return (((y & 1) * x) ^ + ((y>>1 & 1) * xtime(x)) ^ + ((y>>2 & 1) * xtime(xtime(x))) ^ + ((y>>3 & 1) * xtime(xtime(xtime(x)))) ^ + ((y>>4 & 1) * xtime(xtime(xtime(xtime(x)))))); /* this last call to xtime() can be omitted */ + } +#else +#define Multiply(x, y) \ + ( ((y & 1) * x) ^ \ + ((y>>1 & 1) * xtime(x)) ^ \ + ((y>>2 & 1) * xtime(xtime(x))) ^ \ + ((y>>3 & 1) * xtime(xtime(xtime(x)))) ^ \ + ((y>>4 & 1) * xtime(xtime(xtime(xtime(x)))))) \ + +#endif + +#if (defined(CBC) && CBC == 1) || (defined(ECB) && ECB == 1) +// MixColumns function mixes the columns of the state matrix. The method used to +// multiply may be difficult to understand for the inexperienced. Please use the +// references to gain more information. +static void InvMixColumns(state_t* state) +{ + int i; + uint8_t a, b, c, d; + for (i = 0; i < 4; ++i) + { + a = (*state)[i][0]; + b = (*state)[i][1]; + c = (*state)[i][2]; + d = (*state)[i][3]; + + (*state)[i][0] = Multiply(a, 0x0e) ^ Multiply(b, 0x0b) ^ Multiply(c, 0x0d) ^ Multiply(d, 0x09); + (*state)[i][1] = Multiply(a, 0x09) ^ Multiply(b, 0x0e) ^ Multiply(c, 0x0b) ^ Multiply(d, 0x0d); + (*state)[i][2] = Multiply(a, 0x0d) ^ Multiply(b, 0x09) ^ Multiply(c, 0x0e) ^ Multiply(d, 0x0b); + (*state)[i][3] = Multiply(a, 0x0b) ^ Multiply(b, 0x0d) ^ Multiply(c, 0x09) ^ Multiply(d, 0x0e); + } +} + + +// The SubBytes Function Substitutes the values in the state matrix with values +// in an S-box. +static void InvSubBytes(state_t* state) +{ + uint8_t i, j; + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + (*state)[j][i] = getSBoxInvert((*state)[j][i]); + } + } +} + +static void InvShiftRows(state_t* state) +{ + uint8_t temp; + + // Rotate first row 1 columns to right + temp = (*state)[3][1]; + (*state)[3][1] = (*state)[2][1]; + (*state)[2][1] = (*state)[1][1]; + (*state)[1][1] = (*state)[0][1]; + (*state)[0][1] = temp; + + // Rotate second row 2 columns to right + temp = (*state)[0][2]; + (*state)[0][2] = (*state)[2][2]; + (*state)[2][2] = temp; + + temp = (*state)[1][2]; + (*state)[1][2] = (*state)[3][2]; + (*state)[3][2] = temp; + + // Rotate third row 3 columns to right + temp = (*state)[0][3]; + (*state)[0][3] = (*state)[1][3]; + (*state)[1][3] = (*state)[2][3]; + (*state)[2][3] = (*state)[3][3]; + (*state)[3][3] = temp; +} +#endif // #if (defined(CBC) && CBC == 1) || (defined(ECB) && ECB == 1) + +// Cipher is the main function that encrypts the PlainText. +static void Cipher(state_t* state, const struct AES_ctx* ctx) +{ + const uint8_t* RoundKey = GetRoundKey(ctx); + uint8_t round = 0; + + // Add the First round key to the state before starting the rounds. + AddRoundKey(0, state, RoundKey); + + // There will be Nr rounds. The first Nr-1 rounds are identical. These Nr + // rounds are executed in the loop below. Last one without MixColumns() + for (round = 1; ; ++round) + { + SubBytes(state); + ShiftRows(state); + if (round == ctx->Nr) { + break; + } + MixColumns(state); + AddRoundKey(round, state, RoundKey); + } + // Add round key to last round + AddRoundKey(ctx->Nr, state, RoundKey); +} + +#if (defined(CBC) && CBC == 1) || (defined(ECB) && ECB == 1) +static void InvCipher(state_t* state, const struct AES_ctx* ctx) +{ + const uint8_t* RoundKey = GetRoundKey(ctx); + uint8_t round = 0; + + // Add the First round key to the state before starting the rounds. + AddRoundKey(ctx->Nr, state, RoundKey); + + // There will be Nr rounds. The first Nr-1 rounds are identical. These Nr + // rounds are executed in the loop below. Last one without InvMixColumn() + for (round = (ctx->Nr - 1); ; --round) + { + InvShiftRows(state); + InvSubBytes(state); + AddRoundKey(round, state, RoundKey); + if (round == 0) { + break; + } + InvMixColumns(state); + } + +} +#endif // #if (defined(CBC) && CBC == 1) || (defined(ECB) && ECB == 1) + +/*****************************************************************************/ +/* Public functions: */ +/*****************************************************************************/ +#if defined(ECB) && (ECB == 1) + + +void AES_ECB_encrypt(const struct AES_ctx* ctx, uint8_t* buf) +{ + // The next function call encrypts the PlainText with the Key using AES + // algorithm. + Cipher((state_t*)buf, ctx); +} + +void AES_ECB_decrypt(const struct AES_ctx* ctx, uint8_t* buf) +{ + // The next function call decrypts the PlainText with the Key using AES + // algorithm. + InvCipher((state_t*)buf, ctx); +} + + +#endif // #if defined(ECB) && (ECB == 1) + + + + + +#if defined(CBC) && (CBC == 1) + + +static void XorWithIv(uint8_t* buf, const uint8_t* Iv) +{ + uint8_t i; + for (i = 0; i < AES_BLOCKLEN; ++i) // The block in AES is always 128bit no matter the key size + { + buf[i] ^= Iv[i]; + } +} + +void AES_CBC_encrypt_buffer(struct AES_ctx *ctx, uint8_t* buf, uint32_t length) +{ + uintptr_t i; + uint8_t *Iv = ctx->Iv; + for (i = 0; i < length; i += AES_BLOCKLEN) + { + XorWithIv(buf, Iv); + Cipher((state_t*)buf, ctx); + Iv = buf; + buf += AES_BLOCKLEN; + } + /* store Iv in ctx for next call */ + memcpy(ctx->Iv, Iv, AES_BLOCKLEN); +} + +void AES_CBC_decrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length) +{ + uintptr_t i; + uint8_t storeNextIv[AES_BLOCKLEN]; + for (i = 0; i < length; i += AES_BLOCKLEN) + { + memcpy(storeNextIv, buf, AES_BLOCKLEN); + InvCipher((state_t*)buf, ctx); + XorWithIv(buf, ctx->Iv); + memcpy(ctx->Iv, storeNextIv, AES_BLOCKLEN); + buf += AES_BLOCKLEN; + } + +} + +#endif // #if defined(CBC) && (CBC == 1) + + + +#if defined(CTR) && (CTR == 1) + +/* Symmetrical operation: same function for encrypting as for decrypting. Note +any IV/nonce should never be reused with the same key */ +void AES_CTR_xcrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length) +{ + uint8_t buffer[AES_BLOCKLEN]; + + unsigned i; + int bi; + for (i = 0, bi = AES_BLOCKLEN; i < length; ++i, ++bi) + { + if (bi == AES_BLOCKLEN) /* we need to regen xor compliment in buffer */ + { + memcpy(buffer, ctx->Iv, AES_BLOCKLEN); + Cipher((state_t*)buffer, ctx); + + /* Increment Iv and handle overflow */ + for (bi = (AES_BLOCKLEN - 1); bi >= 0; --bi) + { + /* inc will overflow */ + if (ctx->Iv[bi] == 255) + { + ctx->Iv[bi] = 0; + continue; + } + ctx->Iv[bi] += 1; + break; + } + bi = 0; + } + + buf[i] = (buf[i] ^ buffer[bi]); + } +} + +#endif // #if defined(CTR) && (CTR == 1) diff --git a/shared-module/aesio/aes.h b/shared-module/aesio/aes.h new file mode 100644 index 0000000000..a87fa5be75 --- /dev/null +++ b/shared-module/aesio/aes.h @@ -0,0 +1,105 @@ +#ifndef _AES_H_ +#define _AES_H_ + +#include + +// #define the macros below to 1/0 to enable/disable the mode of operation. +// +// CBC enables AES encryption in CBC-mode of operation. +// CTR enables encryption in counter-mode. +// ECB enables the basic ECB 16-byte block algorithm. All can be enabled simultaneously. + +// The #ifndef-guard allows it to be configured before #include'ing or at compile time. +#ifndef CBC + #define CBC 1 +#endif + +#ifndef ECB + #define ECB 1 +#endif + +#ifndef CTR + #define CTR 1 +#endif + + +#define AES128 1 +#define AES192 1 +#define AES256 1 + +#define AES_BLOCKLEN 16 // Block length in bytes - AES is 128b block only + +#if defined(AES256) && (AES256 == 1) + #define AES_KEYLEN256 32 + #define AES_keyExpSize256 240 +#endif +#if defined(AES192) && (AES192 == 1) + #define AES_KEYLEN192 24 + #define AES_keyExpSize192 208 +#endif +#if defined(AES128) && (AES128 == 1) + #define AES_KEYLEN128 16 // Key length in bytes + #define AES_keyExpSize128 176 +#endif + +struct AES_ctx +{ + union { +#if defined(AES256) && (AES256 == 1) + uint8_t RoundKey256[AES_keyExpSize256]; +#endif +#if defined(AES192) && (AES192 == 1) + uint8_t RoundKey192[AES_keyExpSize192]; +#endif +#if defined(AES128) && (AES128 == 1) + uint8_t RoundKey128[AES_keyExpSize128]; +#endif + }; +#if (defined(CBC) && (CBC == 1)) || (defined(CTR) && (CTR == 1)) + uint8_t Iv[AES_BLOCKLEN]; +#endif + uint32_t KeyLength; + uint8_t Nr; + uint8_t Nk; +}; + +void AES_init_ctx(struct AES_ctx* ctx, const uint8_t* key, uint32_t keylen); +#if (defined(CBC) && (CBC == 1)) || (defined(CTR) && (CTR == 1)) +void AES_init_ctx_iv(struct AES_ctx* ctx, const uint8_t* key, uint32_t keylen, const uint8_t* iv); +void AES_ctx_set_iv(struct AES_ctx* ctx, const uint8_t* iv); +#endif + +#if defined(ECB) && (ECB == 1) +// buffer size is exactly AES_BLOCKLEN bytes; +// you need only AES_init_ctx as IV is not used in ECB +// NB: ECB is considered insecure for most uses +void AES_ECB_encrypt(const struct AES_ctx* ctx, uint8_t* buf); +void AES_ECB_decrypt(const struct AES_ctx* ctx, uint8_t* buf); + +#endif // #if defined(ECB) && (ECB == !) + + +#if defined(CBC) && (CBC == 1) +// buffer size MUST be mutile of AES_BLOCKLEN; +// Suggest https://en.wikipedia.org/wiki/Padding_(cryptography)#PKCS7 for padding scheme +// NOTES: you need to set IV in ctx via AES_init_ctx_iv() or AES_ctx_set_iv() +// no IV should ever be reused with the same key +void AES_CBC_encrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length); +void AES_CBC_decrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length); + +#endif // #if defined(CBC) && (CBC == 1) + + +#if defined(CTR) && (CTR == 1) + +// Same function for encrypting as for decrypting. +// IV is incremented for every block, and used after encryption as XOR-compliment for output +// Suggesting https://en.wikipedia.org/wiki/Padding_(cryptography)#PKCS7 for padding scheme +// NOTES: you need to set IV in ctx with AES_init_ctx_iv() or AES_ctx_set_iv() +// no IV should ever be reused with the same key +void AES_CTR_xcrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length); + +#endif // #if defined(CTR) && (CTR == 1) + + +#endif // _AES_H_ diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index aaddbb4714..281c6fe90f 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -41,8 +41,6 @@ #include #include -#include "tick.h" - void common_hal_displayio_display_construct(displayio_display_obj_t* self, mp_obj_t bus, uint16_t width, uint16_t height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, @@ -111,6 +109,8 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, // Always set the backlight type in case we're reusing memory. self->backlight_inout.base.type = &mp_type_NoneType; if (backlight_pin != NULL && common_hal_mcu_pin_is_free(backlight_pin)) { + // Avoid PWM types and functions when the module isn't enabled + #if (CIRCUITPY_PULSEIO) pwmout_result_t result = common_hal_pulseio_pwmout_construct(&self->backlight_pwm, backlight_pin, 0, 50000, false); if (result != PWMOUT_OK) { self->backlight_inout.base.type = &digitalio_digitalinout_type; @@ -120,6 +120,12 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, self->backlight_pwm.base.type = &pulseio_pwmout_type; common_hal_pulseio_pwmout_never_reset(&self->backlight_pwm); } + #else + // Otherwise default to digital + self->backlight_inout.base.type = &digitalio_digitalinout_type; + common_hal_digitalio_digitalinout_construct(&self->backlight_inout, backlight_pin); + common_hal_never_reset_pin(backlight_pin); + #endif } if (!self->auto_brightness && (self->backlight_inout.base.type != &mp_type_NoneType || brightness_command != NO_BRIGHTNESS_COMMAND)) { @@ -164,9 +170,21 @@ bool common_hal_displayio_display_set_brightness(displayio_display_obj_t* self, brightness = 1.0-brightness; } bool ok = false; - if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { + + // Avoid PWM types and functions when the module isn't enabled + #if (CIRCUITPY_PULSEIO) + bool ispwm = (self->backlight_pwm.base.type == &pulseio_pwmout_type) ? true : false; + #else + bool ispwm = false; + #endif + + if (ispwm) { + #if (CIRCUITPY_PULSEIO) common_hal_pulseio_pwmout_set_duty_cycle(&self->backlight_pwm, (uint16_t) (0xffff * brightness)); ok = true; + #else + ok = false; + #endif } else if (self->backlight_inout.base.type == &digitalio_digitalinout_type) { common_hal_digitalio_digitalinout_set_value(&self->backlight_inout, brightness > 0.99); ok = true; @@ -392,12 +410,16 @@ void displayio_display_background(displayio_display_obj_t* self) { void release_display(displayio_display_obj_t* self) { release_display_core(&self->core); + #if (CIRCUITPY_PULSEIO) if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { common_hal_pulseio_pwmout_reset_ok(&self->backlight_pwm); - common_hal_pulseio_pwmout_deinit(&self->backlight_pwm); + common_hal_pulseio_pwmout_deinit(&self->backlight_pwm); } else if (self->backlight_inout.base.type == &digitalio_digitalinout_type) { common_hal_digitalio_digitalinout_deinit(&self->backlight_inout); } + #else + common_hal_digitalio_digitalinout_deinit(&self->backlight_inout); + #endif } void reset_display(displayio_display_obj_t* self) { diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 5b4a8f916b..6a55687b9c 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -42,8 +42,6 @@ #include #include -#include "tick.h" - void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* self, mp_obj_t bus, uint8_t* start_sequence, uint16_t start_sequence_len, uint8_t* stop_sequence, uint16_t stop_sequence_len, uint16_t width, uint16_t height, uint16_t ram_width, uint16_t ram_height, diff --git a/shared-module/displayio/FourWire.c b/shared-module/displayio/FourWire.c index fe7234aa7a..17e8cfa1d7 100644 --- a/shared-module/displayio/FourWire.c +++ b/shared-module/displayio/FourWire.c @@ -36,8 +36,6 @@ #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/display_core.h" -#include "tick.h" - void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self, busio_spi_obj_t* spi, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* reset, uint32_t baudrate, diff --git a/shared-module/displayio/I2CDisplay.c b/shared-module/displayio/I2CDisplay.c index 280476f195..0c8f2e69a9 100644 --- a/shared-module/displayio/I2CDisplay.c +++ b/shared-module/displayio/I2CDisplay.c @@ -38,8 +38,6 @@ #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/display_core.h" -#include "tick.h" - void common_hal_displayio_i2cdisplay_construct(displayio_i2cdisplay_obj_t* self, busio_i2c_obj_t* i2c, uint16_t device_address, const mcu_pin_obj_t* reset) { diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 4cc7564d09..d01100f7f1 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -40,8 +40,6 @@ #include #include -#include "tick.h" - void displayio_display_core_construct(displayio_display_core_t* self, mp_obj_t bus, uint16_t width, uint16_t height, uint16_t ram_width, uint16_t ram_height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word) { diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 13fbb26299..2a88b53070 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -40,8 +40,6 @@ #include #include -#include "tick.h" - void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebufferdisplay_obj_t* self, mp_obj_t framebuffer, uint16_t rotation, diff --git a/ports/nrf/common-hal/time/__init__.c b/shared-module/time/__init__.c similarity index 82% rename from ports/nrf/common-hal/time/__init__.c rename to shared-module/time/__init__.c index c85077868a..347e68ae02 100644 --- a/ports/nrf/common-hal/time/__init__.c +++ b/shared-module/time/__init__.c @@ -25,19 +25,19 @@ */ #include "py/mphal.h" - -#include "tick.h" +#include "supervisor/port.h" +#include "supervisor/shared/tick.h" uint64_t common_hal_time_monotonic(void) { return supervisor_ticks_ms64(); } uint64_t common_hal_time_monotonic_ns(void) { - uint64_t ms; - uint32_t us_until_ms; - current_tick(&ms, &us_until_ms); - // us counts down. - return 1000 * (ms * 1000 + (1000 - us_until_ms)); + uint8_t subticks = 0; + uint64_t ticks = port_get_raw_ticks(&subticks); + // A tick is 976562.5 nanoseconds so multiply it by the base and add half instead of doing float + // math. + return 976562 * ticks + ticks / 2 + 30518 * subticks; } void common_hal_time_delay_ms(uint32_t delay) { diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index 8744f2ed31..8e9df6f040 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -25,7 +25,7 @@ */ #include -#include "tick.h" + #include "py/runtime.h" #include "shared-bindings/usb_hid/Device.h" #include "shared-module/usb_hid/Device.h" diff --git a/supervisor/flash.h b/supervisor/flash.h index 0a124353e6..a8a77bf040 100644 --- a/supervisor/flash.h +++ b/supervisor/flash.h @@ -34,7 +34,7 @@ #ifdef EXTERNAL_FLASH_DEVICE_COUNT #include "supervisor/shared/external_flash/external_flash.h" #else -#include "supervisor/internal_flash.h" +#include "supervisor/shared/internal_flash.h" #endif void supervisor_flash_init(void); diff --git a/supervisor/port.h b/supervisor/port.h index b289583dd6..ccbb314adf 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -70,4 +70,22 @@ uint32_t *port_heap_get_top(void); void port_set_saved_word(uint32_t); uint32_t port_get_saved_word(void); +// Get the raw tick count since start up. A tick is 1/1024 of a second, a common low frequency +// clock rate. If subticks is not NULL then the port will fill in the number of subticks where each +// tick is 32 subticks (for a resolution of 1/32768 or 30.5ish microseconds.) +uint64_t port_get_raw_ticks(uint8_t* subticks); + +// Enable 1/1024 second tick. +void port_enable_tick(void); + +// Disable 1/1024 second tick. +void port_disable_tick(void); + +// Wake the CPU after the given number of ticks or sooner. Only the last call to this will apply. +// Only the common sleep routine should use it. +void port_interrupt_after_ticks(uint32_t ticks); + +// Sleep the CPU until an interrupt is received. +void port_sleep_until_interrupt(void); + #endif // MICROPY_INCLUDED_SUPERVISOR_PORT_H diff --git a/supervisor/shared/autoreload.c b/supervisor/shared/autoreload.c index a6212c1a9b..1976f66470 100644 --- a/supervisor/shared/autoreload.c +++ b/supervisor/shared/autoreload.c @@ -28,6 +28,7 @@ #include "py/mphal.h" #include "py/reload.h" +#include "supervisor/shared/tick.h" static volatile uint32_t autoreload_delay_ms = 0; static bool autoreload_enabled = false; @@ -43,6 +44,7 @@ inline void autoreload_tick() { !autoreload_suspended && !reload_requested) { mp_raise_reload_exception(); reload_requested = true; + supervisor_disable_tick(); } autoreload_delay_ms--; } @@ -69,6 +71,12 @@ inline bool autoreload_is_enabled() { } void autoreload_start() { + // Enable ticks if we haven't been tracking an autoreload delay. We check + // our current state so that we only turn ticks on once. Multiple starts + // can occur before we reload and then turn ticks off. + if (autoreload_delay_ms == 0) { + supervisor_enable_tick(); + } autoreload_delay_ms = CIRCUITPY_AUTORELOAD_DELAY_MS; } diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 9d38c07d89..bfc434664a 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -23,11 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "external_flash.h" +#include "supervisor/shared/external_flash/external_flash.h" #include #include +#include "supervisor/flash.h" #include "supervisor/spi_flash_api.h" #include "supervisor/shared/external_flash/common_commands.h" #include "extmod/vfs.h" @@ -217,11 +218,12 @@ void supervisor_flash_init(void) { do { spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1); } while ((read_status_response[0] & 0x1) != 0); - // The suspended write/erase bit should be low. - do { + if (!flash_device->single_status_byte) { + // The suspended write/erase bit should be low. + do { spi_flash_read_command(CMD_READ_STATUS2, read_status_response, 1); - } while ((read_status_response[0] & 0x80) != 0); - + } while ((read_status_response[0] & 0x80) != 0); + } spi_flash_command(CMD_ENABLE_RESET); spi_flash_command(CMD_RESET); @@ -451,7 +453,7 @@ static void spi_flash_flush_keep_cache(bool keep_cache) { #endif } -void supervisor_flash_flush(void) { +void supervisor_external_flash_flush(void) { spi_flash_flush_keep_cache(true); } diff --git a/supervisor/shared/external_flash/external_flash.h b/supervisor/shared/external_flash/external_flash.h index 72b619a2a8..db5c677eb0 100644 --- a/supervisor/shared/external_flash/external_flash.h +++ b/supervisor/shared/external_flash/external_flash.h @@ -45,4 +45,6 @@ #define SPI_FLASH_MAX_BAUDRATE 8000000 #endif +void supervisor_external_flash_flush(void); + #endif // MICROPY_INCLUDED_SUPERVISOR_SHARED_EXTERNAL_FLASH_EXTERNAL_FLASH_H diff --git a/supervisor/shared/flash.c b/supervisor/shared/flash.c index 6b1f24b4bc..298e7d83e4 100644 --- a/supervisor/shared/flash.c +++ b/supervisor/shared/flash.c @@ -28,6 +28,7 @@ #include "extmod/vfs_fat.h" #include "py/runtime.h" #include "lib/oofatfs/ff.h" +#include "supervisor/shared/tick.h" #define VFS_INDEX 0 @@ -110,6 +111,8 @@ mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_bloc return supervisor_flash_read_blocks(dest, block_num - PART1_START_BLOCK, num_blocks); } +volatile bool filesystem_dirty = false; + mp_uint_t flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { if (block_num == 0) { if (num_blocks > 1) { @@ -118,10 +121,28 @@ mp_uint_t flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t nu // can't write MBR, but pretend we did return 0; } else { + if (!filesystem_dirty) { + // Turn on ticks so that we can flush after a period of time elapses. + supervisor_enable_tick(); + filesystem_dirty = true; + } return supervisor_flash_write_blocks(src, block_num - PART1_START_BLOCK, num_blocks); } } +void supervisor_flash_flush(void) { + #if INTERNAL_FLASH_FILESYSTEM + port_internal_flash_flush(); + #else + supervisor_external_flash_flush(); + #endif + // Turn off ticks now that our filesystem has been flushed. + if (filesystem_dirty) { + supervisor_disable_tick(); + } + filesystem_dirty = false; +} + STATIC mp_obj_t supervisor_flash_obj_readblocks(mp_obj_t self, mp_obj_t block_num, mp_obj_t buf) { mp_buffer_info_t bufinfo; mp_get_buffer_raise(buf, &bufinfo, MP_BUFFER_WRITE); diff --git a/supervisor/shared/internal_flash.h b/supervisor/shared/internal_flash.h new file mode 100644 index 0000000000..80257a2901 --- /dev/null +++ b/supervisor/shared/internal_flash.h @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft, for Adafruit Industries LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_SUPERVISOR_SHARED_INTERNAL_FLASH_H +#define MICROPY_INCLUDED_SUPERVISOR_SHARED_INTERNAL_FLASH_H + +#include "supervisor/internal_flash.h" // This is per-port. + +void port_internal_flash_flush(void); + +#endif // MICROPY_INCLUDED_SUPERVISOR_SHARED_INTERNAL_FLASH_H diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 5668f8fa10..dc38e76f61 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -26,12 +26,13 @@ #include "supervisor/shared/tick.h" +#include "py/mpstate.h" #include "supervisor/linker.h" #include "supervisor/filesystem.h" +#include "supervisor/port.h" #include "supervisor/shared/autoreload.h" -static volatile uint64_t PLACE_IN_DTCM_BSS(ticks_ms); -static volatile uint32_t PLACE_IN_DTCM_BSS(background_ticks_ms32); +static volatile uint64_t PLACE_IN_DTCM_BSS(background_ticks); #if CIRCUITPY_GAMEPAD #include "shared-module/gamepad/__init__.h" @@ -44,9 +45,6 @@ static volatile uint32_t PLACE_IN_DTCM_BSS(background_ticks_ms32); #include "shared-bindings/microcontroller/__init__.h" void supervisor_tick(void) { - - ticks_ms ++; - #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif @@ -54,7 +52,7 @@ void supervisor_tick(void) { autoreload_tick(); #endif #ifdef CIRCUITPY_GAMEPAD_TICKS - if (!(ticks_ms & CIRCUITPY_GAMEPAD_TICKS)) { + if (!(port_get_raw_ticks(NULL) & CIRCUITPY_GAMEPAD_TICKS)) { #if CIRCUITPY_GAMEPAD gamepad_tick(); #endif @@ -68,29 +66,70 @@ void supervisor_tick(void) { uint64_t supervisor_ticks_ms64() { uint64_t result; common_hal_mcu_disable_interrupts(); - result = ticks_ms; + result = port_get_raw_ticks(NULL); common_hal_mcu_enable_interrupts(); + result = result * 1000 / 1024; return result; } uint32_t supervisor_ticks_ms32() { - return ticks_ms; + return supervisor_ticks_ms64(); } extern void run_background_tasks(void); void PLACE_IN_ITCM(supervisor_run_background_tasks_if_tick)() { - uint32_t now32 = ticks_ms; - - if (now32 == background_ticks_ms32) { - return; - } - background_ticks_ms32 = now32; - + // TODO: Add a global that can be set by anyone to indicate we should run background tasks. That + // way we can short circuit the background tasks early. We used to do it based on time but it + // breaks cases where we wake up for a short period and then sleep. If we skipped the last + // background task or more before sleeping we may end up starving a task like USB. run_background_tasks(); } -void supervisor_fake_tick() { - uint32_t now32 = ticks_ms; - background_ticks_ms32 = (now32 - 1); +void mp_hal_delay_ms(mp_uint_t delay) { + uint64_t start_tick = port_get_raw_ticks(NULL); + // Adjust the delay to ticks vs ms. + delay = delay * 1024 / 1000; + uint64_t end_tick = start_tick + delay; + int64_t remaining = delay; + while (remaining > 0) { + RUN_BACKGROUND_TASKS; + // Check to see if we've been CTRL-Ced by autoreload or the user. + if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || + MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { + break; + } + remaining = end_tick - port_get_raw_ticks(NULL); + // We break a bit early so we don't risk setting the alarm before the time when we call + // sleep. + if (remaining < 1) { + break; + } + port_interrupt_after_ticks(remaining); + // Sleep until an interrupt happens. + port_sleep_until_interrupt(); + remaining = end_tick - port_get_raw_ticks(NULL); + } } + +volatile size_t tick_enable_count = 0; +extern void supervisor_enable_tick(void) { + common_hal_mcu_disable_interrupts(); + if (tick_enable_count == 0) { + port_enable_tick(); + } + tick_enable_count++; + common_hal_mcu_enable_interrupts(); +} + +extern void supervisor_disable_tick(void) { + common_hal_mcu_disable_interrupts(); + if (tick_enable_count > 0) { + tick_enable_count--; + } + if (tick_enable_count == 0) { + port_disable_tick(); + } + common_hal_mcu_enable_interrupts(); +} + diff --git a/supervisor/shared/tick.h b/supervisor/shared/tick.h index 7ce8281ba9..e7e8080581 100644 --- a/supervisor/shared/tick.h +++ b/supervisor/shared/tick.h @@ -64,4 +64,7 @@ extern uint64_t supervisor_ticks_ms64(void); */ extern void supervisor_run_background_if_tick(void); +extern void supervisor_enable_tick(void); +extern void supervisor_disable_tick(void); + #endif diff --git a/supervisor/shared/usb/tusb_config.h b/supervisor/shared/usb/tusb_config.h index ad5825b6c9..1b0c834160 100644 --- a/supervisor/shared/usb/tusb_config.h +++ b/supervisor/shared/usb/tusb_config.h @@ -74,8 +74,8 @@ //------------- CLASS -------------// #define CFG_TUD_CDC 1 #define CFG_TUD_MSC 1 -#define CFG_TUD_HID 1 -#define CFG_TUD_MIDI 1 +#define CFG_TUD_HID CIRCUITPY_USB_HID +#define CFG_TUD_MIDI CIRCUITPY_USB_MIDI #define CFG_TUD_CUSTOM_CLASS 0 /*------------------------------------------------------------------*/ diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index a0178528d8..774055a82a 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -24,7 +24,6 @@ * THE SOFTWARE. */ -#include "tick.h" #include "py/objstr.h" #include "shared-bindings/microcontroller/Processor.h" #include "shared-module/usb_midi/__init__.h" diff --git a/supervisor/shared/usb/usb_desc.c b/supervisor/shared/usb/usb_desc.c index 9b333d6fea..080187ebc5 100644 --- a/supervisor/shared/usb/usb_desc.c +++ b/supervisor/shared/usb/usb_desc.c @@ -52,7 +52,7 @@ uint8_t const * tud_hid_descriptor_report_cb(void) { // Invoked when received GET STRING DESCRIPTOR request // Application return pointer to descriptor, whose contents must exist long enough for transfer to complete -uint16_t const* tud_descriptor_string_cb(uint8_t index) { +uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid) { uint8_t const max_index = sizeof(string_desc_arr)/sizeof(string_desc_arr[0]); return (index < max_index) ? string_desc_arr[index] : NULL; } diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 52d60b52b3..d6422f074e 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -73,26 +73,34 @@ else lib/tinyusb/src/device/usbd_control.c \ lib/tinyusb/src/class/msc/msc_device.c \ lib/tinyusb/src/class/cdc/cdc_device.c \ - lib/tinyusb/src/class/hid/hid_device.c \ - lib/tinyusb/src/class/midi/midi_device.c \ lib/tinyusb/src/tusb.c \ supervisor/shared/serial.c \ supervisor/usb.c \ supervisor/shared/usb/usb_desc.c \ supervisor/shared/usb/usb.c \ supervisor/shared/usb/usb_msc_flash.c \ - shared-bindings/usb_hid/__init__.c \ - shared-bindings/usb_hid/Device.c \ - shared-bindings/usb_midi/__init__.c \ - shared-bindings/usb_midi/PortIn.c \ - shared-bindings/usb_midi/PortOut.c \ - shared-module/usb_hid/__init__.c \ - shared-module/usb_hid/Device.c \ - shared-module/usb_midi/__init__.c \ - shared-module/usb_midi/PortIn.c \ - shared-module/usb_midi/PortOut.c \ $(BUILD)/autogen_usb_descriptor.c + ifeq ($(CIRCUITPY_USB_HID), 1) + SRC_SUPERVISOR += \ + lib/tinyusb/src/class/hid/hid_device.c \ + shared-bindings/usb_hid/__init__.c \ + shared-bindings/usb_hid/Device.c \ + shared-module/usb_hid/__init__.c \ + shared-module/usb_hid/Device.c + endif + + ifeq ($(CIRCUITPY_USB_MIDI), 1) + SRC_SUPERVISOR += \ + lib/tinyusb/src/class/midi/midi_device.c \ + shared-bindings/usb_midi/__init__.c \ + shared-bindings/usb_midi/PortIn.c \ + shared-bindings/usb_midi/PortOut.c \ + shared-module/usb_midi/__init__.c \ + shared-module/usb_midi/PortIn.c \ + shared-module/usb_midi/PortOut.c + endif + CFLAGS += -DUSB_AVAILABLE endif diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 543224faea..3594f2ae76 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -48,6 +48,7 @@ extension_by_board = { "feather_m0_basic": BIN_UF2, "feather_m0_rfm69": BIN_UF2, "feather_m0_rfm9x": BIN_UF2, + "uchip": BIN_UF2, # nRF52840 dev kits that may not have UF2 bootloaders, "makerdiary_nrf52840_mdk": HEX, diff --git a/tools/build_memory_info.py b/tools/build_memory_info.py index 93b4c1e82f..808b70bd22 100644 --- a/tools/build_memory_info.py +++ b/tools/build_memory_info.py @@ -52,7 +52,7 @@ regions = {} with open(sys.argv[1], "r") as f: for line in f: line = line.strip() - if line.startswith(("FLASH_FIRMWARE", "FLASH", "RAM")): + if line.startswith(("FLASH_FIRMWARE", "RAM")): regions[line.split()[0]] = line.split("=")[-1] for region in regions: @@ -63,17 +63,15 @@ for region in regions: space = M_PATTERN.sub(M_REPLACE, space) regions[region] = int(eval(space)) -# TODO Remove check for both FLASH_FIRMWARE and FLASH after all ports are converted to use FLASH_FIRMWARE. -try: - firmware_region = regions["FLASH_FIRMWARE"] -except KeyError: - firmware_region = regions["FLASH"] +firmware_region = regions["FLASH_FIRMWARE"] ram_region = regions["RAM"] -free_flash = firmware_region - text - data -free_ram = ram_region - data - bss -print("{} bytes free in flash firmware space out of {} bytes ({}kB).".format(free_flash, firmware_region, firmware_region / 1024)) -print("{} bytes free in ram for stack and heap out of {} bytes ({}kB).".format(free_ram, ram_region, ram_region / 1024)) +used_flash = data + text +free_flash = firmware_region - used_flash +used_ram = data + bss +free_ram = ram_region - used_ram +print("{} bytes used, {} bytes free in flash firmware space out of {} bytes ({}kB).".format(used_flash, free_flash, firmware_region, firmware_region / 1024)) +print("{} bytes used, {} bytes free in ram for stack and heap out of {} bytes ({}kB).".format(used_ram, free_ram, ram_region, ram_region / 1024)) print() # Check that we have free flash space. GCC doesn't fail when the text + data